@arcgis/core 4.33.0-next.20250424 → 4.33.0-next.20250425

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 (115) hide show
  1. package/analysis/Analysis.js +1 -1
  2. package/analysis/support/AnalysisOriginWebScene.d.ts +1 -1
  3. package/analysis/support/AnalysisOriginWebScene.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/070839cb71c8e764b8d7.js +1 -0
  6. package/assets/esri/core/workers/chunks/19084a293694c5a00cae.js +1 -0
  7. package/assets/esri/core/workers/chunks/{5958af341014e13475d2.js → 2bed8a5ed9ae3760fa2f.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{7ffa68d69c138db1295d.js → 2e3019ce49e972a815ca.js} +1 -1
  9. package/assets/esri/core/workers/chunks/38f5e6a202ce292edd9f.js +1 -0
  10. package/assets/esri/core/workers/chunks/415903f481392c72870f.js +1 -0
  11. package/assets/esri/core/workers/chunks/4351b3e54b309935faed.js +1 -0
  12. package/assets/esri/core/workers/chunks/4da99f058cca83937e9b.js +1 -0
  13. package/assets/esri/core/workers/chunks/5acdd49c5f1a49fdc6e7.js +1 -0
  14. package/assets/esri/core/workers/chunks/968f2f841c011095a6d2.js +1 -0
  15. package/assets/esri/core/workers/chunks/a2676f3f135ad5fdf872.js +1 -0
  16. package/assets/esri/core/workers/chunks/a8430e1e2142f1ce9b92.js +1 -0
  17. package/assets/esri/core/workers/chunks/b53300b46646cfad2526.js +319 -0
  18. package/assets/esri/core/workers/chunks/bf543bdec3da0fe278fb.js +1 -0
  19. package/assets/esri/core/workers/chunks/f52e597dca4b32a81881.js +1 -0
  20. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  21. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  22. package/chunks/ShadowCastAccumulate.glsl.js +13 -9
  23. package/chunks/ShadowCastVisualize.glsl.js +24 -9
  24. package/chunks/lyr3DMain.js +1 -1
  25. package/chunks/lyr3DWorker.js +1 -1
  26. package/interfaces.d.ts +200 -5
  27. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  28. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  29. package/layers/ParquetLayer.js +1 -1
  30. package/layers/mixins/ImageryTileMixin.js +1 -1
  31. package/layers/support/ParquetEncodingLocation.d.ts +4 -0
  32. package/layers/support/ParquetEncodingLocation.js +1 -1
  33. package/layers/support/ParquetEncodingWkb.d.ts +4 -0
  34. package/layers/support/ParquetEncodingWkb.js +1 -1
  35. package/layers/support/RasterStorageInfo.js +1 -1
  36. package/layers/support/layerUtils.js +1 -1
  37. package/layers/support/parquetUtils.d.ts +3 -0
  38. package/layers/support/parquetUtils.js +1 -1
  39. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  40. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  41. package/layers/support/rasterDatasets/RawBlockCache.js +1 -1
  42. package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
  43. package/package.json +2 -2
  44. package/portal/schemas/definitions.js +1 -1
  45. package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
  46. package/support/revision.js +1 -1
  47. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  48. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  49. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  50. package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
  51. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  52. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  53. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  54. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  55. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  56. package/views/3d/layers/Lyr3DWorker.js +1 -1
  57. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  58. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  59. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  60. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  61. package/views/3d/layers/graphics/pipeline/PipelineCommand.js +1 -1
  62. package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
  63. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  64. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandContext.js +1 -1
  65. package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +5 -0
  66. package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +5 -0
  67. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  68. package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +1 -1
  69. package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
  70. package/views/3d/layers/support/MediaLayerInteraction.js +1 -1
  71. package/views/3d/webgl/ManagedFBO.js +1 -1
  72. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  73. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +7 -13
  74. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendColorsPremultiplied.glsl.js +5 -0
  75. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  76. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  77. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  78. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechnique.js +1 -1
  79. package/views/3d/webgl-engine/shaders/ShadowCastAccumulateTechniqueConfiguration.js +5 -0
  80. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  81. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechnique.js +1 -1
  82. package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
  83. package/views/PopupView.js +1 -1
  84. package/views/SelectionManager.js +1 -1
  85. package/views/analysis/analysisViewUtils.js +1 -1
  86. package/views/input/InputManager.js +1 -1
  87. package/views/input/ViewEvents.js +1 -1
  88. package/views/support/selectionUtils.js +1 -1
  89. package/webscene/support/analysisUtils.js +1 -1
  90. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  91. package/widgets/Editor/UpdateWorkflow.js +1 -1
  92. package/widgets/Editor/workflowUtils.js +1 -1
  93. package/widgets/ElevationProfile/ElevationProfileInteraction.js +1 -1
  94. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +1 -1
  95. package/widgets/FeatureTable/support/tableUtils.js +1 -1
  96. package/widgets/FeatureTable.js +1 -1
  97. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  98. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  99. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  100. package/widgets/ShadowCast/ThresholdOptions.js +1 -1
  101. package/widgets/Sketch/SketchViewModel.js +1 -1
  102. package/widgets/VideoPlayer.js +1 -1
  103. package/widgets/support/AnalysisViewModel.js +1 -1
  104. package/assets/esri/core/workers/chunks/0a48b9734ab4c64a6f4f.js +0 -1
  105. package/assets/esri/core/workers/chunks/1427e7953c3d8c87c5e8.js +0 -1
  106. package/assets/esri/core/workers/chunks/146b3699a9e8b1f2dcc2.js +0 -1
  107. package/assets/esri/core/workers/chunks/22f604726529ee6f8c25.js +0 -1
  108. package/assets/esri/core/workers/chunks/8dd26b12c625d20196ed.js +0 -319
  109. package/assets/esri/core/workers/chunks/91f8547a13f0461045ef.js +0 -1
  110. package/assets/esri/core/workers/chunks/931275cfa2c55eb0f504.js +0 -1
  111. package/assets/esri/core/workers/chunks/9f416cc5673665f8c37c.js +0 -1
  112. package/assets/esri/core/workers/chunks/b42ecc7c3eb2fd8d1308.js +0 -1
  113. package/assets/esri/core/workers/chunks/d04efa51da9b4eb3a8a7.js +0 -1
  114. package/assets/esri/core/workers/chunks/d8474dca270b25705699.js +0 -1
  115. package/assets/esri/core/workers/chunks/ed3d1d0465f4a4d8df4a.js +0 -1
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[107,8256],{4146:(t,e,r)=>{r.d(e,{A:()=>_});var i=r(90237),n=r(78888),s=r(49186),a=r(65529),o=r(4902),l=r(92474),u=r(53966),c=r(74887),h=r(84952),p=r(10107),d=(r(44208),r(87811),r(40608)),f=r(5443),y=r(16930),m=r(92602),g=r(79677);let v=0,M=class extends(a.A.EventedMixin(o.A.IdentifiableMixin(l.A))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new f.A(-180,-90,180,90,y.A.WGS84),this.id=Date.now().toString(16)+"-layer-"+v++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=y.A.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const e="string"==typeof t?{url:t}:t;return(await r.e(7982).then(r.bind(r,27982))).fromUrl(e)}static fromPortalItem(t){return async function(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:i}=await r.e(5613).then(r.bind(r,45613));try{return await i(e)}catch(t){const r=e?.portalItem,i=r?.id||"unset",n=r?.portal?.url||m.A.portalUrl;throw u.A.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+n+"', id: '"+i+"')",t),t}}(t)}initialize(){this.when().catch((t=>{(0,c.zf)(t)||u.A.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})}))}destroy(){const t=this.parent;if(t){const e=this;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"referenceLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const e=this.parent;return t&&e&&"effectiveVisible"in e&&(t&&=e.effectiveVisible),t}get hasAttributionData(){return null!=this.attributionDataUrl}get parsedUrl(){return(0,h.An)(this.url)}createLayerView(t,e){return Promise.reject(new s.A("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await(0,n.A)(t,{query:{f:"json"},responseType:"json"})).data;throw new s.A("layer:no-attribution-data","Layer does not have attribution data")}};(0,i._)([(0,p.MZ)({type:String})],M.prototype,"attributionDataUrl",void 0),(0,i._)([(0,p.MZ)({readOnly:!0})],M.prototype,"effectiveVisible",null),(0,i._)([(0,p.MZ)({type:f.A})],M.prototype,"fullExtent",void 0),(0,i._)([(0,p.MZ)({readOnly:!0})],M.prototype,"hasAttributionData",null),(0,i._)([(0,p.MZ)({type:String,clonable:!1})],M.prototype,"id",void 0),(0,i._)([(0,p.MZ)({type:Boolean,nonNullable:!0})],M.prototype,"legendEnabled",void 0),(0,i._)([(0,p.MZ)({type:["show","hide","hide-children"]})],M.prototype,"listMode",void 0),(0,i._)([(0,p.MZ)({type:Number,range:{min:0,max:1},nonNullable:!0})],M.prototype,"opacity",void 0),(0,i._)([(0,p.MZ)({clonable:!1})],M.prototype,"parent",void 0),(0,i._)([(0,p.MZ)({readOnly:!0})],M.prototype,"parsedUrl",null),(0,i._)([(0,p.MZ)({type:Boolean,readOnly:!0})],M.prototype,"persistenceEnabled",void 0),(0,i._)([(0,p.MZ)({type:Boolean})],M.prototype,"popupEnabled",void 0),(0,i._)([(0,p.MZ)({type:Boolean})],M.prototype,"attributionVisible",void 0),(0,i._)([(0,p.MZ)({type:y.A})],M.prototype,"spatialReference",void 0),(0,i._)([(0,p.MZ)({type:String})],M.prototype,"title",void 0),(0,i._)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],M.prototype,"type",void 0),(0,i._)([(0,p.MZ)()],M.prototype,"url",void 0),(0,i._)([(0,p.MZ)({type:g.A})],M.prototype,"visibilityTimeExtent",void 0),(0,i._)([(0,p.MZ)({type:Boolean,nonNullable:!0})],M.prototype,"visible",void 0),M=(0,i._)([(0,d.$)("esri.layers.Layer")],M);const _=M},4902:(t,e,r)=>{r.d(e,{A:()=>c});var i=r(90237),n=r(40608);let s=0;const a=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+s++})}};return e=(0,i._)([(0,n.$)("esri.core.Identifiable")],e),e},o=t=>{let e=class extends t{constructor(...t){super(...t),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:s++})}};return e=(0,i._)([(0,n.$)("esri.core.Identifiable.NumericIdentifiable")],e),e};let l=class extends(a(class{})){};var u;l=(0,i._)([(0,n.$)("esri.core.Identifiable")],l),(u=l||(l={})).IdentifiableMixin=a,u.NumericIdentifiableMixin=o;const c=l},8303:(t,e,r)=>{r.d(e,{A:()=>A});var i=r(90237),n=r(92602),s=r(70333),a=r(78888),o=r(60999),l=r(49186),u=r(53966),c=r(97768),h=r(74887),p=r(84952),d=r(10107),f=(r(44208),r(87811),r(36005)),y=r(40608),m=r(43937),g=r(77548),v=r(20655),M=r(80812),_=r(41318),b=r(10407);const A=t=>{let e=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=(0,c.pR)(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(t){t!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",t))}readPortalItem(t,e,r){if(e.itemId)return new M.default({id:e.itemId,portal:r?.portal})}writePortalItem(t,e){t?.id&&(e.itemId=t.id)}async loadFromPortal(t,e){if(this.portalItem?.id)try{const{load:i}=await r.e(1204).then(r.bind(r,41204));return(0,h.Te)(e),await i({instance:this,supportedTypes:t.supportedTypes,validateItem:t.validateItem,supportsData:t.supportsData,layerModuleTypeMap:t.layerModuleTypeMap,populateGroupLayer:t.populateGroupLayer},e)}catch(t){throw(0,h.zf)(t)||u.A.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${t}`),t}}async finishLoadEditablePortalLayer(t){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(t).catch((t=>((0,h.QP)(t),!0))))}async setUserPrivileges(t,e){if(!n.A.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:r,fullEdit:i},content:{updateItem:n}}=await this._fetchUserPrivileges(t,e);this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",n)}catch(t){(0,h.QP)(t)}}async _fetchUserPrivileges(t,e){let r=this.portalItem;if(!t||!r||!r.loaded||r.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=!s.id?.findCredential(this.url),n=t===r.id;if(n&&r.portal.user)return this._getUserPrivileges(r,i);let a,o;if(n)a=r.portal.url;else try{a=await(0,g.wI)(this.url,e)}catch(t){(0,h.QP)(t)}if(!a||!(0,p.b8)(a,r.portal.url))return this._fetchFallbackUserPrivileges(e);try{const t=null!=e?e.signal:null;o=await(s.id?.getCredential(`${a}/sharing`,{prompt:!1,signal:t}))}catch(t){(0,h.QP)(t)}const l=!0,u=!1,c=!1;if(!o)return{features:{edit:l,fullEdit:u},content:{updateItem:c}};try{if(n?await r.reload():(r=new M.default({id:t,portal:{url:a}}),await r.load(e)),r.portal.user)return this._getUserPrivileges(r,i)}catch(t){(0,h.QP)(t)}return{features:{edit:l,fullEdit:u},content:{updateItem:c}}}_getUserPrivileges(t,e){const r=(0,b.It)(t);return e&&(r.features.edit=!0),r}async _fetchFallbackUserPrivileges(t){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(t)}catch(t){(0,h.QP)(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(t){const e=this.url?s.id?.findCredential(this.url):null;if(!e)return!0;const r=S.credential===e?S.user:await this._fetchEditingUser(t);return S.credential=e,S.user=r,null==r?.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(t){const e=this.portalItem?.portal?.user;if(e)return e;const r=s.id?.findServerInfo(this.url??"");if(!r?.owningSystemUrl)return null;const i=`${r.owningSystemUrl}/sharing/rest`,n=v.A.getDefault();if(n&&n.loaded&&(0,p.S8)(n.restUrl)===(0,p.S8)(i))return n.user;const l=`${i}/community/self`,u=null!=t?t.signal:null,c=await(0,o.Ke)((0,a.A)(l,{authMode:"no-prompt",query:{f:"json"},signal:u}));return c.ok?_.A.fromJSON(c.value.data):null}read(t,e){e&&(e.layer=this),super.read(t,e)}write(t,e){const r=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||v.A.getDefault());return r&&i&&!(0,p.ut)(i.restUrl,r.restUrl)?(e.messages&&e.messages.push(new l.A("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(t,{...e,layer:this})}};return(0,i._)([(0,d.MZ)({type:M.default})],e.prototype,"portalItem",null),(0,i._)([(0,f.w)("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),(0,i._)([(0,m.K)("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),(0,i._)([(0,d.MZ)({clonable:!1})],e.prototype,"resourceReferences",void 0),(0,i._)([(0,d.MZ)({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),(0,i._)([(0,d.MZ)({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),(0,i._)([(0,d.MZ)({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=(0,i._)([(0,y.$)("esri.layers.mixins.PortalLayer")],e),e},S={credential:null,user:null}},18768:(t,e,r)=>{r.d(e,{b:()=>l});var i=r(90237),n=r(53966),s=r(10107),a=(r(44208),r(87811),r(40608)),o=r(60694);const l=t=>{let e=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const t=(0,o.qg)(this.url);if(t?.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",(0,o.Jf)(t,n.A.getLogger(this)))}};return(0,i._)([(0,s.MZ)()],e.prototype,"title",null),(0,i._)([(0,s.MZ)({type:String})],e.prototype,"url",null),e=(0,i._)([(0,a.$)("esri.layers.mixins.ArcGISService")],e),e}},24212:(t,e,r)=>{function i(t,e){return function(t,e){return e?.mode?e.mode:function(t){return t?l:u}(t).mode}(null==t||(t.hasZ??!1),e)}function n(t,e,r){return r&&r.mode!==e?`${t} only support ${e} elevation mode`:null}function s(t,e,r){return r?.mode===e?`${t} do not support ${e} elevation mode`:null}function a(t,e){return null!=e?.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression?`${t} do not support featureExpressionInfo`:null}function o(t,e){e&&t.warn(".elevationInfo=",e)}r.d(e,{$7:()=>s,B:()=>n,XF:()=>o,tW:()=>a,w7:()=>i}),r(83047),r(16271);const l={mode:"absolute-height",offset:0},u={mode:"on-the-ground",offset:null}},25036:(t,e,r)=>{r.d(e,{j:()=>a});var i=r(90237),n=r(10107),s=(r(44208),r(53966),r(87811),r(40608));const a=t=>{let e=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const t={minScale:this.minScale,maxScale:this.maxScale},e=this.parent;e&&"effectiveScaleRange"in e&&function(t,e){t.minScale=t.minScale>0?e.minScale>0?Math.min(t.minScale,e.minScale):t.minScale:e.minScale,t.maxScale=t.maxScale>0?e.maxScale>0?Math.max(t.maxScale,e.maxScale):t.maxScale:e.maxScale}(t,e.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===t.minScale&&r.maxScale===t.maxScale?r:t}};return(0,i._)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),(0,i._)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),(0,i._)([(0,n.MZ)({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=(0,i._)([(0,s.$)("esri.layers.mixins.ScaleRangeLayer")],e),e}},38954:(t,e,r)=>{r.d(e,{A:()=>f,B:()=>d,C:()=>c,D:()=>y,E:()=>h,F:()=>R,H:()=>q,a:()=>D,b:()=>g,c:()=>a,d:()=>u,e:()=>x,f:()=>w,g:()=>l,h:()=>m,i:()=>o,j:()=>v,k:()=>_,l:()=>s,m:()=>E,n:()=>S,o:()=>Z,p:()=>L,q:()=>O,s:()=>M,t:()=>I,u:()=>A,v:()=>b,w:()=>P,x:()=>p,y:()=>j,z:()=>F});var i=r(51850),n=r(34304);function s(t){const e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function o(t,e,r,i){return t[0]=e,t[1]=r,t[2]=i,t}function l(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function u(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function c(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function h(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function p(t,e){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t}function d(t,e){return t[0]=Math.sign(e[0]),t[1]=Math.sign(e[1]),t[2]=Math.sign(e[2]),t}function f(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function y(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function m(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function g(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t}function v(t,e){const r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+i*i+n*n)}function M(t,e){const r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n}function _(t){const e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i}function b(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function A(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function S(t,e){const r=e[0],i=e[1],n=e[2];let s=r*r+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function w(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function x(t,e,r){const i=e[0],n=e[1],s=e[2],a=r[0],o=r[1],l=r[2];return t[0]=n*l-s*o,t[1]=s*a-i*l,t[2]=i*o-n*a,t}function E(t,e,r,i){const n=e[0],s=e[1],a=e[2];return t[0]=n+i*(r[0]-n),t[1]=s+i*(r[1]-s),t[2]=a+i*(r[2]-a),t}function I(t,e,r){const i=e[0],n=e[1],s=e[2];return t[0]=r[0]*i+r[4]*n+r[8]*s+r[12],t[1]=r[1]*i+r[5]*n+r[9]*s+r[13],t[2]=r[2]*i+r[6]*n+r[10]*s+r[14],t}function O(t,e,r){const i=e[0],n=e[1],s=e[2];return t[0]=i*r[0]+n*r[3]+s*r[6],t[1]=i*r[1]+n*r[4]+s*r[7],t[2]=i*r[2]+n*r[5]+s*r[8],t}function P(t,e,r){const i=r[0],n=r[1],s=r[2],a=r[3],o=e[0],l=e[1],u=e[2],c=n*u-s*l,h=s*o-i*u,p=i*l-n*o,d=n*p-s*h,f=s*c-i*p,y=i*h-n*c,m=2*a;return t[0]=o+c*m+2*d,t[1]=l+h*m+2*f,t[2]=u+p*m+2*y,t}const T=(0,i.vt)(),U=(0,i.vt)();function L(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Z(t,e,r){const i=r[0]-e[0],n=r[1]-e[1],s=r[2]-e[2];let a=i*i+n*n+s*s;return a>0?(a=1/Math.sqrt(a),t[0]=i*a,t[1]=n*a,t[2]=s*a,t):(t[0]=0,t[1]=0,t[2]=0,t)}const D=u,N=c,$=h,R=v,j=M,q=s,F=_;Object.freeze(Object.defineProperty({__proto__:null,abs:p,add:l,angle:function(t,e){S(T,t),S(U,e);const r=w(T,U);return r>1?0:r<-1?Math.PI:Math.acos(r)},bezier:function(t,e,r,i,n,s){const a=1-s,o=a*a,l=s*s,u=o*a,c=3*s*o,h=3*l*a,p=l*s;return t[0]=e[0]*u+r[0]*c+i[0]*h+n[0]*p,t[1]=e[1]*u+r[1]*c+i[1]*h+n[1]*p,t[2]=e[2]*u+r[2]*c+i[2]*h+n[2]*p,t},ceil:function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t},clamp:function(t,e=0,r=1){return t[0]=Math.min(Math.max(t[0],e),r),t[1]=Math.min(Math.max(t[1],e),r),t[2]=Math.min(Math.max(t[2],e),r),t},copy:a,cross:x,crossAndNormalize:function(t,e,r){const i=e[0],n=e[1],s=e[2],a=r[0],o=r[1],l=r[2],u=n*l-s*o,c=s*a-i*l,h=i*o-n*a,p=Math.sqrt(u*u+c*c+h*h);return t[0]=u/p,t[1]=c/p,t[2]=h/p,t},direction:Z,dist:R,distance:v,div:$,divide:h,dot:w,equals:function(t,e){if(t===e)return!0;const r=t[0],i=t[1],s=t[2],a=e[0],o=e[1],l=e[2],u=(0,n.FD)();return Math.abs(r-a)<=u*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-o)<=u*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(s-l)<=u*Math.max(1,Math.abs(s),Math.abs(l))},exactEquals:L,floor:function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t},hermite:function(t,e,r,i,n,s){const a=s*s,o=a*(2*s-3)+1,l=a*(s-2)+s,u=a*(s-1),c=a*(3-2*s);return t[0]=e[0]*o+r[0]*l+i[0]*u+n[0]*c,t[1]=e[1]*o+r[1]*l+i[1]*u+n[1]*c,t[2]=e[2]*o+r[2]*l+i[2]*u+n[2]*c,t},inverse:A,len:q,length:s,lerp:E,max:y,min:f,mul:N,multiply:c,negate:b,normalize:S,random:function(t,e=1){const r=n.Ov,i=2*r()*Math.PI,s=2*r()-1,a=Math.sqrt(1-s*s)*e;return t[0]=Math.cos(i)*a,t[1]=Math.sin(i)*a,t[2]=s*e,t},rotateX:function(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[0],s[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),s[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},rotateY:function(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),s[1]=n[1],s[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},rotateZ:function(t,e,r,i){const n=[],s=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],s[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),s[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),s[2]=n[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t},round:function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t},scale:m,scaleAndAdd:g,set:o,sign:d,sqrDist:j,sqrLen:F,squaredDistance:M,squaredLength:_,str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},sub:D,subtract:u,transformMat3:O,transformMat4:I,transformQuat:P},Symbol.toStringTag,{value:"Module"}))},52136:(t,e,r)=>{r.d(e,{p:()=>a});var i=r(90237),n=r(10107),s=(r(44208),r(53966),r(87811),r(40608));const a=t=>{let e=class extends t{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):"portalItem"in this?this.portalItem?.apiKey:null}set apiKey(t){null!=t?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,n.MZ)({type:String})],e.prototype,"apiKey",null),e=(0,i._)([(0,s.$)("esri.layers.mixins.APIKeyMixin")],e),e}},61528:(t,e,r)=>{r.r(e),r.d(e,{default:()=>O});var i=r(90237),n=r(78888),s=r(49186),a=r(53966),o=r(34727),l=r(92071),u=r(74887),c=r(10107),h=(r(44208),r(87811),r(40608)),p=r(38954),d=r(51850),f=r(73941),y=r(5443),m=r(16930),g=r(9762),v=r(4146),M=r(52136),_=r(18768),b=r(69208),A=r(16131),S=r(8303),w=r(25036),x=r(10873),E=r(24212);let I=class extends((0,_.b)((0,A.q)((0,S.A)((0,w.j)((0,l.P)((0,b.d)((0,M.p)(v.A)))))))){constructor(t){super(t),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new m.A({wkid:4326,vcsWkid:115700}),this.fullExtent=new y.A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(t){null!=t&&"absolute-height"!==t.mode||this._set("elevationInfo",t),this._validateElevationInfo(t)}_verifyArray(t,e){if(!Array.isArray(t)||t.length<e)return!1;for(const e of t)if("number"!=typeof e)return!1;return!0}_initFullExtent(t){const e=t.root?.boundingVolume;if(!e)return;if(e.box){const t=e?.box;if(t[3]>7972671&&t[7]>7972671&&t[11]>7945940)return}const r=t.root?.transform,i=(0,d.vt)();if(e.region&&this._verifyArray(e.region,6)){const t=e.region,r=(0,o.KJ)(t[0]),i=(0,o.KJ)(t[1]),n=t[4],s=(0,o.KJ)(t[2]),a=(0,o.KJ)(t[3]),l=t[5];this.fullExtent=new y.A({xmin:r,ymin:i,zmin:n,xmax:s,ymax:a,zmax:l,spatialReference:this.spatialReference})}else if(e.sphere&&this._verifyArray(e.sphere,4)){const t=e.sphere,n=(0,d.fA)(t[0],t[1],t[2]),s=t[3]/Math.sqrt(3),a=(0,d.vt)();(0,p.d)(a,n,(0,d.fA)(s,s,s));const o=(0,d.vt)();if((0,p.g)(o,n,(0,d.fA)(s,s,s)),r&&this._verifyArray(r,16)){const t=r;(0,p.t)(i,a,t),(0,p.c)(a,i),(0,p.t)(i,o,t),(0,p.c)(o,i)}(0,g.projectBuffer)(a,f.Ro,0,a,m.A.WGS84,0),(0,g.projectBuffer)(o,f.Ro,0,o,m.A.WGS84,0);const l=(0,d.vt)(),u=(0,d.vt)();(0,p.A)(l,a,o),(0,p.D)(u,a,o),this.fullExtent=new y.A({xmin:l[0],ymin:l[1],zmin:l[2],xmax:u[0],ymax:u[1],zmax:u[2],spatialReference:this.spatialReference})}else if(e.box&&this._verifyArray(e.box,12)){const t=e.box,i=(0,d.fA)(t[0],t[1],t[2]),n=(0,d.fA)(t[3],t[4],t[5]),s=(0,d.fA)(t[6],t[7],t[8]),a=(0,d.fA)(t[9],t[10],t[11]),o=[];for(let t=0;t<8;++t)o.push((0,d.vt)());if((0,p.g)(o[0],i,n),(0,p.g)(o[0],o[0],s),(0,p.g)(o[0],o[0],a),(0,p.a)(o[1],i,n),(0,p.g)(o[1],o[1],s),(0,p.g)(o[1],o[1],a),(0,p.g)(o[2],i,n),(0,p.a)(o[2],o[2],s),(0,p.g)(o[2],o[2],a),(0,p.a)(o[3],i,n),(0,p.a)(o[3],o[3],s),(0,p.g)(o[3],o[3],a),(0,p.g)(o[4],i,n),(0,p.g)(o[4],o[4],s),(0,p.a)(o[4],o[4],a),(0,p.a)(o[5],i,n),(0,p.g)(o[5],o[5],s),(0,p.a)(o[5],o[5],a),(0,p.g)(o[6],i,n),(0,p.a)(o[6],o[6],s),(0,p.a)(o[6],o[6],a),(0,p.a)(o[7],i,n),(0,p.a)(o[7],o[7],s),(0,p.a)(o[7],o[7],a),r&&this._verifyArray(r,16)){const t=r;for(let e=0;e<8;++e)(0,p.t)(o[e],o[e],t)}const l=(0,d.fA)(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),u=(0,d.fA)(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let t=0;t<8;++t)(0,g.projectBuffer)(o[t],f.Ro,0,o[t],m.A.WGS84,0),(0,p.A)(u,u,o[t]),(0,p.D)(l,l,o[t]);this.fullExtent=new y.A({xmin:u[0],ymin:u[1],zmin:u[2],xmax:l[0],ymax:l[1],zmax:l[2],spatialReference:this.spatialReference})}}async load(t){return this.addResolvingPromise(this._doLoad(t)),this}async _doLoad(t){const e=null!=t?t.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:t=>{if(t.typeKeywords?.includes("IntegratedMesh"))return!0;throw new s.A("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},t)}catch(t){(0,u.QP)(t)}if(this.url){const t=(0,n.A)(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then((t=>{this._initFullExtent(t.data)}),(t=>{(0,u.QP)(t)}));await t}}async fetchAttributionData(){return this.load().then((()=>({})))}_validateElevationInfo(t){const e="Integrated mesh 3d tiles layers";(0,E.XF)(a.A.getLogger(this),(0,E.B)(e,"absolute-height",t)),(0,E.XF)(a.A.getLogger(this),(0,E.tW)(e,t))}};(0,i._)([(0,c.MZ)({type:["IntegratedMesh3DTilesLayer"]})],I.prototype,"operationalLayerType",void 0),(0,i._)([(0,c.MZ)({type:m.A})],I.prototype,"spatialReference",void 0),(0,i._)([(0,c.MZ)({type:y.A})],I.prototype,"fullExtent",void 0),(0,i._)([(0,c.MZ)(x.Yj)],I.prototype,"elevationInfo",null),(0,i._)([(0,c.MZ)({type:["show","hide"]})],I.prototype,"listMode",void 0),(0,i._)([(0,c.MZ)(x.OZ)],I.prototype,"url",void 0),(0,i._)([(0,c.MZ)({readOnly:!0})],I.prototype,"type",void 0),(0,i._)([(0,c.MZ)({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],I.prototype,"path",void 0),(0,i._)([(0,c.MZ)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],I.prototype,"minScale",void 0),(0,i._)([(0,c.MZ)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],I.prototype,"maxScale",void 0),I=(0,i._)([(0,h.$)("esri.layers.IntegratedMesh3DTilesLayer")],I);const O=I},69208:(t,e,r)=>{r.d(e,{d:()=>a});var i=r(90237),n=r(10107),s=(r(44208),r(53966),r(87811),r(40608));const a=t=>{let e=class extends t{constructor(){super(...arguments),this.customParameters=null}};return(0,i._)([(0,n.MZ)({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=(0,i._)([(0,s.$)("esri.layers.mixins.CustomParametersMixin")],e),e}},69540:(t,e,r)=>{r.d(e,{A:()=>p});var i=r(90237),n=r(69622),s=(r(44208),r(4718)),a=(r(53966),r(97768)),o=r(35666),l=r(88620),u=r(40608);const c=t=>{let e=class extends t{clone(){const t=(0,l.oY)(this);(0,a.Lw)(t,"unable to clone instance of non-accessor class");const e=t.metadata,r=t.store,i={},n=new Map;for(const t in e){const a=e[t],l=r?.originOf(t),u=a.clonable;if(a.readOnly||!1===u||l!==o.Gr.USER&&l!==o.Gr.DEFAULTS&&l!==o.Gr.WEB_MAP&&l!==o.Gr.WEB_SCENE)continue;const c=this[t];let h=null;h="function"==typeof u?u(c):"reference"===u?c:(0,s.TU)(c),null!=c&&null==h||(l===o.Gr.DEFAULTS?n.set(t,h):i[t]=h)}const u=new(0,Object.getPrototypeOf(this).constructor)(i);if(n.size){const t=(0,l.oY)(u)?.store;if(t)for(const[e,r]of n)t.set(e,r,o.Gr.DEFAULTS)}return u}};return e=(0,i._)([(0,u.$)("esri.core.Clonable")],e),e};let h=class extends(c(n.A)){};h=(0,i._)([(0,u.$)("esri.core.Clonable")],h),(h||(h={})).ClonableMixin=c;const p=h},78553:(t,e,r)=>{r.d(e,{D:()=>s,p:()=>n});var i=r(56507);function n(t){const e=(0,i.Vr)(100*(1-t));return Math.max(0,Math.min(e,100))}function s(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}},79677:(t,e,r)=>{r.d(e,{A:()=>d});var i,n=r(90237),s=r(25482),a=r(88930),o=r(10107),l=(r(44208),r(53966),r(87811),r(36005)),u=r(40608),c=r(43937),h=r(98623);let p=class extends s.A{static{i=this}static get allTime(){return f}static get empty(){return y}static fromArray(t){return new i({start:null!=t[0]?new Date(t[0]):t[0],end:null!=t[1]?new Date(t[1]):t[1]})}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(i.allTime)}get isEmpty(){return this.equals(i.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new i({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,i=t.start?.getTime()??t.start,n=t.end?.getTime()??t.end;return e===i&&r===n}expandTo(t,e=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();let r=this.start;r&&(r=(0,a.lL)(r,t,e));let n=this.end;if(n){const r=(0,a.lL)(n,t,e);n=n.getTime()===r.getTime()?r:(0,a.S1)(r,1,t,e)}return new i({start:r,end:n})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return i.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,n=t.start?.getTime()??-1/0,s=t.end?.getTime()??1/0;let a,o;return n>=e&&n<=r?a=n:e>=n&&e<=s&&(a=e),r>=n&&r<=s?o=r:s>=e&&s<=r&&(o=s),null==a||null==o||isNaN(a)||isNaN(o)?i.empty:new i({start:a===-1/0?null:new Date(a),end:o===1/0?null:new Date(o)})}offset(t,e,r=h.qU){if(this.isEmpty||this.isAllTime)return this.clone();const n=new i,{start:s,end:o}=this;return null!=s&&(n.start=(0,a.S1)(s,t,e,r)),null!=o&&(n.end=(0,a.S1)(o,t,e,r)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return f.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new i({start:e,end:r})}};(0,n._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"end",void 0),(0,n._)([(0,l.w)("end")],p.prototype,"readEnd",null),(0,n._)([(0,c.K)("end")],p.prototype,"writeEnd",null),(0,n._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isAllTime",null),(0,n._)([(0,o.MZ)({readOnly:!0,json:{read:!1}})],p.prototype,"isEmpty",null),(0,n._)([(0,o.MZ)({type:Date,json:{write:{allowNull:!0}}})],p.prototype,"start",void 0),(0,n._)([(0,l.w)("start")],p.prototype,"readStart",null),(0,n._)([(0,c.K)("start")],p.prototype,"writeStart",null),p=i=(0,n._)([(0,u.$)("esri.time.TimeExtent")],p);const d=p,f=new p,y=new p({start:void 0,end:void 0})},92071:(t,e,r)=>{r.d(e,{P:()=>M,L:()=>_});var i=r(90237),n=r(69622),s=r(76953),a=r(4718),o=r(35666);class l{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(o.AU),this._values=new Map,this.multipleOriginsSupported=!0}clone(t){const e=new l,r=this._originStores[o.Gr.DEFAULTS];r&&r.forEach(((t,r)=>{e.set(r,(0,a.o8)(t),o.Gr.DEFAULTS)}));for(let r=o.Gr.SERVICE;r<o.AU;r++){const i=this._originStores[r];i&&i.forEach(((i,n)=>{t&&t.has(n)||e.set(n,(0,a.o8)(i),r)}))}return e}get(t,e){const r=void 0===e?this._values:this._originStores[e];return r?r.get(t):void 0}keys(t){const e=null==t?this._values:this._originStores[t];return e?[...e.keys()]:[]}set(t,e,r=o.Gr.USER){let i=this._originStores[r];if(i||(i=new Map,this._originStores[r]=i),i.set(t,e),!this._values.has(t)||this._propertyOriginMap.get(t)<=r){const i=this._values.get(t);return this._values.set(t,e),this._propertyOriginMap.set(t,r),i!==e}return!1}delete(t,e=o.Gr.USER){const r=this._originStores[e];if(!r)return;const i=r.get(t);if(r.delete(t),this._values.has(t)&&this._propertyOriginMap.get(t)===e){this._values.delete(t);for(let r=e-1;r>=0;r--){const e=this._originStores[r];if(e&&e.has(t)){this._values.set(t,e.get(t)),this._propertyOriginMap.set(t,r);break}}}return i}has(t,e){const r=void 0===e?this._values:this._originStores[e];return!!r&&r.has(t)}revert(t,e){for(;e>0&&!this.has(t,e);)--e;const r=this._originStores[e],i=r?.get(t),n=this._values.get(t);return this._values.set(t,i),this._propertyOriginMap.set(t,e),n!==i}originOf(t){return this._propertyOriginMap.get(t)||o.Gr.DEFAULTS}isAtOrigin(t,e){return this.has(t,e)&&this.originOf(t)===e}isBelowOrigin(t,e){return!this.has(t)||this.originOf(t)<e}forEach(t){this._values.forEach(t)}}var u=r(45917),c=r(88620),h=r(40608);const p=t=>{let e=class extends t{constructor(...t){super(...t);const e=(0,c.oY)(this),r=e.store,i=new l;e.store=i,(0,s.k)(e,r,i)}read(t,e){(0,u.L)(this,t,e)}getAtOrigin(t,e){const r=d(this),i=(0,o.aB)(e);if("string"==typeof t)return r.get(t,i);const n={};return t.forEach((t=>{n[t]=r.get(t,i)})),n}originOf(t){return(0,o.OL)(this.originIdOf(t))}originIdOf(t){return d(this).originOf(t)}revert(t,e){const r=d(this),i=(0,o.aB)(e),n=(0,c.oY)(this);let s;s="string"==typeof t?"*"===t?r.keys(i):[t]:t,s.forEach((t=>{n.invalidate(t),r.revert(t,i),n.commit(t)}))}};return e=(0,i._)([(0,h.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function d(t){return(0,c.oY)(t).store}let f=class extends(p(n.A)){};f=(0,i._)([(0,h.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],f);var y=r(16649),m=r(49422);const g=t=>{let e=class extends t{constructor(...t){super(...t)}clear(t,e="user"){(0,c.oY)(this).clearOrigin(t,(0,o.aB)(e))}write(t,e){return(0,m.M)(this,t=t||{},e),t}setAtOrigin(t,e,r){(0,c.oY)(this).setAtOrigin(t,e,(0,o.aB)(r))}removeOrigin(t){const e=v(this),r=(0,o.aB)(t),i=e.keys(r);for(const t of i)e.originOf(t)===r&&e.set(t,e.get(t,r),o.Gr.USER)}updateOrigin(t,e){const r=v(this),i=(0,o.aB)(e),n=(0,y.Jt)(this,t);for(let e=i+1;e<o.AU;++e)r.delete(t,e);r.set(t,n,i)}toJSON(t){return this.write({},t)}};return e=(0,i._)([(0,h.$)("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function v(t){return(0,c.oY)(t).store}const M=t=>{let e=class extends(g(p(t))){constructor(...t){super(...t)}};return e=(0,i._)([(0,h.$)("esri.core.MultiOriginJSONSupport")],e),e};let _=class extends(M(n.A)){};_=(0,i._)([(0,h.$)("esri.core.MultiOriginJSONSupport")],_)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7677],{563:(e,t,i)=>{i.d(t,{QueueProcessor:()=>u});var s=i(97768),n=i(74887),r=i(9775),o=i(32587),l=i(11932),a=i(44794);class c{constructor(e,t){this.item=e,this.controller=t,this.promise=null}}class u{constructor(e){this._schedule=null,this._deferreds=new o.A,this._controllers=new o.A,this._processingItems=new o.A,this._pausedSignal=(0,a.v)(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new r.A(e.peeker),this.process=e.process}destroy(){this.clear(),this._schedule=(0,s.xt)(this._schedule)}get updating(){return this.running}get length(){return this._processingItems.size+this._queue.length}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size<this.concurrency}abort(e){const t=this._controllers.get(e);t&&t.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach((t=>e.push(t))),this._controllers.clear(),e.forEach((e=>e.abort())),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach(((t,i)=>e(i)))}get(e){const t=this._deferreds.get(e);return t?t.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,t){const i=this.get(e);if(i)return i;const s=new AbortController;let r=null;t&&(r=(0,n.u7)(t,(()=>s.abort())));const o=()=>{l.remove(),null!=r&&r.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},l=(0,n.NY)(s.signal,(()=>{const t=this._processingItems.get(e);t&&t.controller.abort(),o(),a.reject((0,n.NK)())})),a=(0,n.Tw)();return this._deferreds.set(e,a),this._controllers.set(e,s),a.promise.then(o,o),this._queue.push(e),this._scheduleNext(),a.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject((0,n.NK)()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const t of e)this._queue.push(t.item),t.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}_removeItem(e){this._deferreds.delete(e),this._controllers.delete(e),this._processingItems.delete(e)}_scheduleNext(){this._pausedSignal.value||this._schedule||(this._schedule=(0,l._)((()=>{this._schedule=null,this._next()})))}_next(){for(;this._queue.length>0&&this._processingItems.size<this.concurrency;)this._process(this._queue.pop())}_cancelNext(){this._schedule&&(this._schedule.remove(),this._schedule=null)}_processResult(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).resolve(t))}_processError(e,t){this._canProcessFulfillment(e)&&(this._scheduleNext(),this._deferreds.get(e.item).reject(t))}_canProcessFulfillment(e){return!!this._deferreds.get(e.item)&&this._processingItems.get(e.item)===e}_process(e){if(null==e)return;let t;const i=new AbortController,s=new c(e,i);this._processingItems.set(e,s);try{t=this.process(e,i.signal)}catch(e){this._processError(s,e)}(0,n.$X)(t)?(s.promise=t,t.then((e=>this._processResult(s,e)),(e=>this._processError(s,e)))):this._processResult(s,t)}}},4916:(e,t,i)=>{i.d(t,{A:()=>B});var s=i(90237),n=i(78888),r=i(49186),o=i(25482),l=i(53966),a=i(74887),c=i(563),u=i(10107),h=i(56507),p=(i(44208),i(87811),i(40608)),d=i(5443),f=i(86738),m=i(16930),y=i(60694),g=i(10873),x=i(45617),_=i(91806),w=i(20223),b=i(87045),v=i(76353),R=i(77301),I=i(70834);const S=new Map,M=new class{constructor(e=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,t)}decreaseRefCount(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.refCount--,e.refCount<=0&&(s.delete(i),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const i=e+"/"+t,s=this._cachedBlocks;if(s.has(i)){const e=s.get(i);return e.ts=Date.now(),e.refCount++,s.delete(i),s.set(i,e),e.block}return null}putBlock(e,t,i,s){const n=this._cachedBlocks,r=e+"/"+t;if(n.has(r)){const e=n.get(r);e.ts=Date.now(),e.refCount++}else n.set(r,{block:i,ts:Date.now(),refCount:1,controller:s});this._trim(),this._updateTimer()}deleteBlock(e,t){const i=this._cachedBlocks,s=e+"/"+t;i.has(s)&&i.delete(s)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(null!=this._timer)return;const e=this._cachedBlocks;this._timer=setInterval((()=>{const t=Array.from(e),i=Date.now();for(let s=0;s<t.length&&t[s][1].ts<=i-this._duration;s++)e.delete(t[s][0]);0===e.size&&this._clearTimer()}),this._interval)}_trim(){const e=this._cachedBlocks;if(-1===this._size||this._size>=e.size)return;const t=Array.from(e);for(let i=0;i<t.length-this._size;i++)e.delete(t[i][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function k(e,t,i){const s=S.get(e);if(!s)return null==t?M.decreaseRefCount(e,i):0;if(null==t||null==s[t])return M.decreaseRefCount(e,i);const n=s[t]?.cache,r=n?.get(i);if(n&&r){if(r.refCount--,0===r.refCount){n.delete(i);for(let e=0;e<s.length;e++)s[e]?.cache.delete(i);r.controller&&r.controller.abort()}return r.refCount}return 0}function T(e,t,i){const s=S.get(e);if(!s)return null==t?M.getBlock(e,i):null;if(null==t||null==s[t]){for(let e=0;e<s.length;e++){const t=s[e]?.cache.get(i);if(t)return t.refCount++,t.block}return M.getBlock(e,i)}const n=s[t]?.cache.get(i);if(n)return n.refCount++,n.block;for(let e=0;e<s.length;e++){if(e===t||!s[e])continue;const n=s[e]?.cache,r=n?.get(i);if(n&&r)return r.refCount++,n.set(i,r),r.block}return null}function A(e,t,i,s,n=null){const r=S.get(e);if(!r)return void(null==t&&M.putBlock(e,i,s,n));if(null==t||null==r[t])return void M.putBlock(e,i,s,n);const o={refCount:1,block:s,isResolved:!1,isRejected:!1,controller:n};s.then((()=>o.isResolved=!0)).catch((()=>o.isRejected=!0)),r[t]?.cache.set(i,o)}function z(e,t,i){const s=S.get(e);s?null!=t&&null!=s[t]?s[t]?.cache.delete(i):M.deleteBlock(e,i):null==t&&M.deleteBlock(e,i)}var F=i(16019),P=i(51244),C=i(28435),D=i(14636);let N=0,O=class extends o.A{constructor(){super(...arguments),this._tileFetchQueue=new c.QueueProcessor({concurrency:32,process:(e,t)=>this._fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:b.A.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,I.FT)(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),(0,v.q)(this)&&this.primaryRasters?.rasters?.forEach((t=>t.rasterJobHandler=e))}get rasterId(){return this.url||"rasterId-"+N++}set url(e){this._set("url",(0,y.Jf)(e,l.A.getLogger(this)))}async open(e){return this._openPromise??=(0,I.Hh)().then((()=>this._open(e))),this._openPromise}async fetchTile(e,t,i,s={}){const n=s.tileInfo||this.rasterInfo.storageInfo.tileInfo,r=this.getTileExtentFromTileInfo(e,t,i,n);return s={noClip:!0,...s},this.fetchPixels(r,n.size[0],n.size[1],s)}async identify(e,t={}){e=(0,h.PZ)(f.A,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:s}=t,{rasterInfo:n}=this,{hasMultidimensionalTranspose:r,multidimensionalInfo:o}=n;let{transposedVariableName:l}=t;const a=null!=o&&r&&(null!=s||(0,R.DY)(i));a&&!l&&(l=null!=i&&i.length>0?i[0].variableName??void 0:o.variables[0].name,t={...t,transposedVariableName:l}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=n,{datumTransformation:p}=t;let m=(0,I._I)(e,c,p);if(!u.intersects(m))return{location:m,value:null};if(null!=n.transform){const e=n.transform.inverseTransform(m);if(!n.nativeExtent.intersects(e))return{location:e,value:null};m=e}let y=0;const g=null!=l&&null!=o&&n.hasMultidimensionalTranspose;if((0,v.q)(this)){const e=this.primaryRasters.rasters[0];if(g)return e.identify(m,t);const{pixelSize:s}=n,r=3,o=s.x*r/2,l=s.y*r/2,a=new d.A({xmin:m.x-o,xmax:m.x+o,ymin:m.y-l,ymax:m.y+l,spatialReference:c}),u={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId},{pixelBlock:h}=await e.fetchPixels(a,r,r,u),{pixelBlock:p}=await this.fetchPixels(a,r,r,u);if(null==h)return{location:m,value:null};const f=Math.floor(r*r*.5),y=!h.mask||h.mask[f]?h.pixels.map((e=>e[f])):null;let x;return null!=p&&(x=!p.mask||p.mask[f]?p.pixels.map((e=>e[f])):void 0),{location:m,value:y,processedValue:x,pyramidLevel:0}}if(!g)if(t.srcResolution)y=(0,I.t$)(t.srcResolution,n,this.ioConfig.sampling).pyramidLevel;else if(y=await this.computeBestPyramidLevelForLocation(e,t),null==y)return{location:m,value:null};const x=this.identifyPixelLocation(m,y,null,g);if(null===x)return{location:m,value:null};const{row:_,col:w,rowOffset:b,colOffset:S,blockWidth:M}=x,k=await this._tileFetchQueue.push({pyramidLevel:y,row:_,col:w,options:t},{signal:t.signal});if(!k?.pixels?.length)return{location:m,value:null};const T=b*M+S;return this._processIdentifyResult(k,{srcLocation:m,position:T,pyramidLevel:y,useTransposedTile:!!g,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,s={}){e=(0,I.Ps)(e),s=this._getRequestOptionsWithSliceId(s);const{_hasNoneOrGCSShiftTransform:n}=this;if(s.requestRawData&&n)return this._fetchPixels(e,t,i,s);const r=(0,I.FT)(e.spatialReference),o=(0,I.OM)(e);if(null==r||0===o||1===o&&this._isGlobalWrappableSource&&n)return this._fetchPixels(e,t,i,s);if(o>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(r/(c-a)*t),h=u-Math.round((r/2-a)/(c-a)*t);let p=0;const f=[];for(let n=0;n<=o;n++){const m=new d.A({xmin:0===n?a:-r/2,xmax:n===o?c-r*n:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),y=0===n?u-h:n===o?t-p:u;p+=y,f.push(y);const g=s.disableWrapAround&&n>0?null:this._fetchPixels(m,y,i,s);l.push(g)}const m=(await Promise.all(l)).map((e=>e?.pixelBlock));let y=null;const g={width:t,height:i};return y=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:m,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},s)).pixelBlock:(0,C.z7)(m,g,{blockWidths:f}),{extent:e,srcExtent:(0,I._l)(e,this.rasterInfo.spatialReference,s.datumTransformation),pixelBlock:y}}async fetchRawPixels(e,t,i,s={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,s),{nativeExtent:r,nativePixelSize:o,storageInfo:l}=this.rasterInfo,a=2**e,c=o.x*a,u=o.y*a,h=new d.A({xmin:r.xmin+c*t.x,xmax:r.xmin+c*(t.x+i.width-1),ymin:r.ymax-u*(t.y+i.height-1),ymax:r.ymax-u*t.y,spatialReference:r.spatialReference});if(!n)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:p,mosaicSize:f}=n;if(1===p.length&&null!=p[0]&&p[0].width===i.width&&p[0].height===i.height)return{extent:h,srcExtent:h,pixelBlock:n.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,y=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%m,y:t.y%y};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:f,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:s.interpolation,alignmentInfo:null,blockWidths:null},s)).pixelBlock:(0,C.z7)(p,f,{clipOffset:g,clipSize:i}),{extent:h,srcExtent:h,pixelBlock:x}}fetchRawTile(e,t,i,s){throw new r.A("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,I._l)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,P.D)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,i=0){const{customFetchParameters:s}=this.ioConfig,{range:r,query:o,headers:l}=t;i=i??t.retryCount??this.ioConfig.retryCount;const a=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await(0,n.A)(e,{...t,query:{...o,...s},headers:{...l,...a}})}catch(s){if(i>0)return i--,this.request(e,t,i);throw s}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:(0,R.NG)(e,t)}getTileExtentFromTileInfo(e,t,i,s){const n=s.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,s.origin,s.spatialReference,s.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:s}=this.rasterInfo,{pyramidResolutions:n}=e;if(!e.tileInfo){const r=[],o=e.maximumPyramidLevel||0;let l=(s.x+s.y)/2,a=1/.0254*96*l;for(let e=0;e<=o&&(r.unshift(new _.A({level:o-e,resolution:l,scale:a})),e!==o);e++)if(n){const t=(n[e].x+n[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new f.A({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new b.A({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,s){const{width:n,height:r,nativeExtent:o,pixelSize:l,spatialReference:a}=e,c=new f.A({x:o.xmin,y:o.ymax,spatialReference:a});null==s&&(s=Math.max(0,Math.round(Math.log(Math.max(n,r))/Math.LN2-8)));const u=this.computeBlockBoundary(o,512,512,{x:o.xmin,y:o.ymax},[l],s);e.storageInfo=new w.A({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:s,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,s,n,r=0,o=2){if(1===n.length&&r>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<r;i++)e*=o,t*=o,n.push({x:e,y:t})}const l=[],{x:a,y:c}=s;for(let s=0;s<n.length;s++){const{x:r,y:o}=n[s];l.push({minCol:Math.floor((e.xmin-a+.1*r)/t/r),maxCol:Math.floor((e.xmax-a-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:s}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const n=s**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,s){const{spatialReference:n,nativeExtent:r,storageInfo:o}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=o,u=s&&null!=c?c.tileSize[0]:o.blockWidth,h=s&&null!=c?c.tileSize[1]:o.blockHeight,p=(0,I._I)(e,n,i);if(!r.intersects(p))return null;if(t<0||t>l)return null;const d=this.getPyramidPixelSize(t),{x:f,y:m}=d,y=(a.y-p.y)/m/h,g=(p.x-a.x)/f/u,x=Math.min(h-1,Math.floor((y-Math.floor(y))*h)),_=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(g),rowOffset:x,colOffset:_,blockWidth:u,srcLocation:p}}getTileExtent(e,t,i,s,n,r){const[o,l]=r,a=s.x+i*o*e.x,c=a+o*e.x,u=s.y-t*l*e.y,h=u-l*e.y;return new d.A({xmin:a,xmax:c,ymin:h,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];return!s||s.maxRow<t||s.maxCol<i||s.minRow>t||s.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:s}=e,n=m.A.WebMercator;e.spatialReference=n,e.extent=e.nativeExtent=new d.A({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-s,spatialReference:n}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new f.A({x:1,y:1,spatialReference:n});const{extent:r,storageInfo:o}=e;if(o){o.origin=new f.A({x:r.xmin,y:r.ymax,spatialReference:n});const{pyramidResolutions:i,tileInfo:s}=o;if(i&&i.forEach((e=>{e.x/=t.x,e.y/=t.y})),s){s.origin=o.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;s.lods.forEach(((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254}))}}}async _fetchPixels(e,t,i,s={}){let n=(0,I.OM)(e);if(n>=2)return{extent:e,pixelBlock:null};const r=this._getSourceDataInfo(e,t,i,s),{pyramidLevel:o,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:u,ul:h}=r;if(0===c||0===u)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:p}=this,d=p.transform,m="gcs-shift"===d?.type,y=null!=(0,I.FT)(e.spatialReference);!m&&y||(n=(0,I.OM)(r.srcExtent,m));const g=await this._fetchRawTiles(o,h,{width:c,height:u,wrapCount:n},s);if(!g)return{extent:e,srcExtent:a,pixelBlock:null};const x=p.storageInfo,_=o>0?x.pyramidBlockWidth:x.blockWidth,w=o>0?x.pyramidBlockHeight:x.blockHeight;let{x:b,y:v}=p.pixelSize;if(o>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=x;if(null!=e&&e[o-1])({x:b,y:v}=e[o-1]);else{const e=t**o;b*=e,v*=e}}const R=p.spatialReference,S=new f.A({x:b,y:v,spatialReference:R}),M=_===c&&w===u&&h.x%_==0&&h.y%w==0,k=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(R),A=R.isGeographic?1e-9:1e-4,{datumTransformation:z}=s;if(!T&&M&&1===g.pixelBlocks.length&&_===t&&w===i&&function(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}(l,k,A))return{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:g.pixelBlocks[0]};const F=y&&null!=(0,I.FT)(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,P=s.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");P&&!this.rasterJobHandler&&await(0,I.Hh)();const N=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k.toJSON(),datumTransformation:z,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:P},s):(0,I.l0)({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k,datumTransformation:z,rasterTransform:d,hasWrapAround:n>0||F,isAdaptive:!1,includeGCSGrid:P});let O;const B=!s.requestRawData,E={rows:N.spacing[0],cols:N.spacing[1]},J=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(o,g.extent.xmin):void 0,{pixelBlocks:H,mosaicSize:L,isPartiallyFilled:Z}=g;let W=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:H,srcMosaicSize:L,destDimension:B?{width:t,height:i}:null,coefs:B?N.coefficients:null,sampleSpacing:B?E:null,projectDirections:P,gcsGrid:P?N.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:s.interpolation,alignmentInfo:J,blockWidths:null},s);({pixelBlock:O,localNorthDirections:W}=e)}else{const e=(0,C.z7)(H,L,{alignmentInfo:J});O=B?(0,C.$i)(e,{width:t,height:i},N.coefficients,E,s.interpolation):e,P&&N.gcsGrid&&(W=(0,C.QF)({width:t,height:i},N.gcsGrid),O=(0,D.Y2)(O,this.rasterInfo.dataType,W))}return s.requestRawData||P?{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:O,transformGrid:N,localNorthDirections:W,isPartiallyFilled:Z}:{extent:e,srcExtent:a,srcTilePixelSize:S,pixelBlock:O}}async _fetchRawTiles(e,t,i,s){const{origin:n,blockBoundary:r}=this.rasterInfo.storageInfo,{blockWidth:o,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:h,wrapCount:p}=i;const f=this._getRasterTileAlignmentInfo(e,0);s.buffer&&(a-=s.buffer.cols,c-=s.buffer.rows,u+=2*s.buffer.cols,h+=2*s.buffer.rows);let m=0,y=0,g=0;p&&null!=f&&(({worldColumnCountFromOrigin:y,originColumnOffset:g,rightPadding:m}=f),y*f.blockWidth-m>=a+u&&(m=0));const x=Math.floor(a/o),_=Math.floor(c/l),w=Math.floor((a+u+m-1)/o),b=Math.floor((c+h+m-1)/l),v=r[e];if(!v)return null;const{minRow:R,minCol:I,maxCol:S,maxRow:M}=v;if(0===p&&(b<R||w<I||_>M||x>S))return null;const k=new Array;let T=!1;const A=null==this.ioConfig.allowPartialFill?s.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=_;t<=b;t++)for(let i=x;i<=w;i++){let n=i;if(!s.disableWrapAround&&p&&null!=f&&y<=i&&(n=i-y-g),t>=R&&n>=I&&M>=t&&S>=n){const i=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:n,options:s},{signal:s.signal});A?k.push(new Promise((e=>{i.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):k.push(i)}else k.push(Promise.resolve(null))}if(0===k.length)return null;const z=await Promise.all(k),F={height:(b-_+1)*l,width:(w-x+1)*o},{spatialReference:P}=this.rasterInfo,C=this.getPyramidPixelSize(e),{x:D,y:N}=C;return{extent:new d.A({xmin:n.x+x*o*D,xmax:n.x+(w+1)*o*D,ymin:n.y-(b+1)*l*N,ymax:n.y-_*l*N,spatialReference:P}),pixelBlocks:z,mosaicSize:F,isPartiallyFilled:T}}_fetchRawTile(e,t,i,s){const{storageInfo:n}=this.rasterInfo,r=null!=n.transposeInfo&&!!s.transposedVariableName;if(!r){const s=n.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:r,minCol:o,maxCol:l,maxRow:a}=s;if(t<r||i<o||t>a||i>l)return Promise.resolve(null)}const o=function(e,t){return null==t?e:`${e}?sliceId=${t}`}(this.rasterId,r?s.transposeVariableName:s.sliceId),l=`${e}/${t}/${i}`;let c=T(o,s.registryId,l);if(null==c){const n=new AbortController;c=this.fetchRawTile(e,t,i,{...s,signal:n.signal}),A(o,s.registryId,l,c,n),c.catch((()=>z(o,s.registryId,l)))}return s.signal&&(0,a.u7)(s,(()=>{k(o,s.registryId,l)})),c}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if((2!==t||"vector-magdir"!==i)&&"vector-uv"!==i||2!==e?.length||!e[0]?.length)return null;const s=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,r]=e,o=[],l=[];for(let e=0;e<s;e++){const[t,i]=(0,D.Lu)([n[e],r[e]]);o.push(t),l.push(i)}return[o,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=(0,I.DO)(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,s={}){const n={datumTransformation:s.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};s.srcResolution&&(n.srcResolution=s.srcResolution,this._updateSourceDataInfo(e,n));const r=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:o,srcHeight:l,pyramidLevel:a}=n,c=o/t,u=l/i,h=a<r&&c*u>=16,p=a===r&&this._requireTooManySrcTiles(o,l,t,i);if(h||p||0===o||0===l){const o=new f.A({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=(0,I.Wo)(o,this.rasterInfo.spatialReference,e,n.datumTransformation);const p=!l||s.srcResolution&&l.x+l.y<s.srcResolution.x+s.srcResolution.y;if(h&&s.srcResolution&&p){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(r-a+3>=e){const t=2**e;l={x:s.srcResolution.x*t,y:s.srcResolution.y*t}}}l&&(n.srcResolution=l,this._updateSourceDataInfo(e,n))}return this._requireTooManySrcTiles(n.srcWidth,n.srcHeight,t,i)&&(n.srcWidth=0,n.srcHeight=0),n}_requireTooManySrcTiles(e,t,i,s){const{tileInfo:n}=this.rasterInfo.storageInfo,r=e/i,o=t/s;return Math.ceil(e/n.size[0])*Math.ceil(t/n.size[1])>=256*Math.max(1,(i+s)/1024)||r>8||o>8}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,s=i.spatialReference,{srcResolution:n,datumTransformation:r}=t,{pyramidLevel:o,pyramidResolution:l,excessiveReading:a}=(0,I.t$)(n,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||(0,I._l)(e,s,r);if(null==c)return;const u=i.transform;u&&(c=u.inverseTransform(c)),t.srcExtent=c;const{x:h,y:p}=i.storageInfo.origin,d=Math.floor((c.xmin-h)/l.x+.1),f=Math.floor((p-c.ymax)/l.y+.1),m=Math.floor((c.xmax-h)/l.x-.1),y=Math.floor((p-c.ymin)/l.y-.1),g=c.width<.1*l.x?0:m-d+1,x=c.height<.1*l.y?0:y-f+1;t.pyramidLevel=o,t.pyramidResolution=l,t.srcWidth=g,t.srcHeight=x,t.ul={x:d,y:f}}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:s,pyramidLevel:n,useTransposedTile:r}=t,o=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[s])return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!r){const t=e.pixels.map((e=>e[s])),r={location:i,value:t,pyramidLevel:n},o=this._computeMagDirValues(t.map((e=>[e])));return o?.length&&(r.magdirValue=o.map((e=>e[0]))),r}let a=e.pixels.map((e=>e.slice(s*o,s*o+o))),c=this._computeMagDirValues(a);const{requestSomeSlices:u,identifyOptions:h}=t;let p=(0,R.QW)(l,h.transposedVariableName);if(u){const e=(0,R.xx)(p,h.multidimensionalDefinition,h.timeExtent);a=a.map((t=>e.map((e=>t[e])))),c=c?.map((t=>e.map((e=>t[e])))),p=e.map((e=>p[e]))}const d=e.noDataValues||this.rasterInfo.noDataValue,f={pixels:a,pixelType:e.pixelType};let m;return null!=d&&((0,F.Sp)(f,d),m=f.mask),{location:i,value:null,dataSeries:p.map(((e,t)=>{const i={value:0===m?.[t]?null:a.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition.map((e=>new x.A({...e,isSlice:!0})))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i})),pyramidLevel:n}}};(0,s._)([(0,u.MZ)()],O.prototype,"_rasterTileAlignmentInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"_tileFetchQueue",void 0),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"_isGlobalWrappableSource",null),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"_hasNoneOrGCSShiftTransform",null),(0,s._)([(0,u.MZ)()],O.prototype,"_openPromise",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"rasterJobHandler",null),(0,s._)([(0,u.MZ)({readOnly:!0})],O.prototype,"rasterId",null),(0,s._)([(0,u.MZ)(g.OZ)],O.prototype,"url",null),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],O.prototype,"datasetName",void 0),(0,s._)([(0,u.MZ)({type:String,json:{write:!0}})],O.prototype,"datasetFormat",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"hasUniqueSourceStorageInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"rasterInfo",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"ioConfig",void 0),(0,s._)([(0,u.MZ)()],O.prototype,"sourceJSON",void 0),O=(0,s._)([(0,p.$)("esri.layers.support.rasterDatasets.BaseRaster")],O);const B=O},32587:(e,t,i)=>{i.d(t,{A:()=>r});var s=i(62788),n=i(95488);class r{constructor(e){this._observable=new n.I,this._map=new Map(e)}get size(){return(0,s.gc)(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(e){const t=this._map.delete(e);return t&&this._observable.notify(),t}entries(){return(0,s.gc)(this._observable),this._map.entries()}forEach(e,t){(0,s.gc)(this._observable),this._map.forEach(((i,s)=>e.call(t,i,s,this)),t)}get(e){return(0,s.gc)(this._observable),this._map.get(e)}has(e){return(0,s.gc)(this._observable),this._map.has(e)}keys(){return(0,s.gc)(this._observable),this._map.keys()}set(e,t){return this._map.set(e,t),this._observable.notify(),this}values(){return(0,s.gc)(this._observable),this._map.values()}[Symbol.iterator](){return(0,s.gc)(this._observable),this._map[Symbol.iterator]()}[Symbol.dispose](){this._observable.destroy()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}},44794:(e,t,i)=>{i.d(t,{v:()=>l});var s=i(4718),n=i(62788),r=i(95488);class o{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,n.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function l(e,t=s.gh){return new o(e,t)}},50103:(e,t,i)=>{function s(e,t){if(!e||!t)return[];let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const n=[];if(t){const r=s(e,i);for(let e=0;e<r.length;e++)s(r[e],t).forEach((e=>n.push(e)));return n}const r=e.getElementsByTagNameNS("*",i);if(!r||0===r.length)return[];for(let e=0;e<r.length;e++)n.push(r[e]||r.item(e));return n}function n(e,t){if(!e||!t)return null;let i=t;t.includes("/")?(i=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const r=s(e,i);return r.length>0?t?n(r[0],t):r[0]:null}function r(e,t=null){const i=t?n(e,t):e;let s;return i?(s=i.textContent||i.nodeValue,s?s.trim():null):null}function o(e,t){const i=s(e,t),n=[];let r;for(let e=0;e<i.length;e++)r=i[e].textContent||i[e].nodeValue,r&&(r=r.trim(),""!==r&&n.push(r));return n}function l(e,t=null){const i=r(e,t);return i?.split(" ").map((e=>Number(e)))??[]}function a(e,t){return o(e,t).map((e=>Number(e)))}function c(e,t){const i=r(e,t);return Number(i)}function u(e,t){const i=e?.nodeName?.toLowerCase(),s=t.toLowerCase();return i.slice(i.lastIndexOf(":")+1)===s}function h(e){return e.nodeName.slice(e.nodeName.lastIndexOf(":")+1)}i.d(t,{Dy:()=>o,IC:()=>s,Ui:()=>a,V6:()=>n,g7:()=>u,mX:()=>r,pN:()=>l,v7:()=>c,vv:()=>h})},72802:(e,t,i)=>{i.d(t,{U:()=>s});class s{constructor(e,t,i,s,n=void 0){this.id=e,this.level=t,this.row=i,this.col=s,this.extent=n}}},84169:(e,t,i)=>{i.d(t,{A:()=>f});var s=i(90237),n=i(49186),r=i(10107),o=(i(44208),i(53966),i(87811),i(40608)),l=i(39829),a=i(4916),c=i(77359),u=i(28435),h=i(70834),p=i(22671);let d=class extends a.A{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(e,t,i,s={}){const{rasters:n,rasterIds:r}=this.primaryRasters;let o=!1;const{interpolation:l}=s,a=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&a&&(o=1===n.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:o});const h=n.map((n=>n.fetchPixels(e,t,i,s))),p=await Promise.all(h),d=p.map((e=>e.pixelBlock)),f=o||s.requestRawData?p.map((e=>e.srcTilePixelSize)):null;if(s.skipRasterFunction||d.every((e=>null==e)))return p[0];const m=p.find((e=>null!=e.pixelBlock))?.extent??e;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r}):this.rasterFunction.process({extent:m,primaryPixelBlocks:d,primaryPixelSizes:f,primaryRasterIds:r});const{transformGrid:g}=p[0];if(!o||null==y||null==g){const e=s.noClip?null:this.getClippingGeometry(m.spatialReference);return s.noClip||s.requestRawData||null==y||!e||(y=await(0,c.$Q)(y,m,e)),{...p[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let _;_=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:t,height:i},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock:(0,u.$i)(y,{width:t,height:i},g.coefficients,x,l);const w=s.noClip?null:this.getClippingGeometry(e.spatialReference);return s.noClip||s.requestRawData||null==_||null==w||(_=await(0,c.$Q)(_,e,w)),{extent:e,srcExtent:p[0].srcExtent,pixelBlock:_}}getClippingGeometry(e){const t=this._clippingGeometry.get("0");if(!e||!t)return t;const i=function(e){return String(e.wkid??e.wkt??e.wkt2)}(e);let s=this._clippingGeometry.get(i);return null!=s||(s=e.equals(t.spatialReference)?t:(0,h.uk)(t,e),this._clippingGeometry.set(i,s)),s}async _open(e){const{rasterFunction:t}=this;t.isRoot=!0,this.primaryRasters?.rasters?.length?t.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=t.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((e=>e.rasterJobHandler=this.rasterJobHandler)));const{rasters:i,rasterIds:s}=this.primaryRasters,r=i.map((t=>t.rasterInfo?void 0:t.open(e)));await Promise.all(r);const o=i.map((({rasterInfo:e})=>e)),l=t.bind({rasterInfos:o,rasterIds:s});if(t.rawSourceRasterInfos=o,!l.success||0===o.length)throw new n.A("raster-function:open",`cannot bind the function: ${l.error??""}`);const a="Table"===t.functionName?t:t.functionArguments?.raster;"Table"===a?.functionName&&(t.rasterInfo.attributeTable=p.A.fromJSON(a.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every((e=>function(e,t){const{storageInfo:i,pixelSize:s,spatialReference:n,extent:r}=e,{storageInfo:o,pixelSize:l,spatialReference:a,extent:c}=t;return s.x===l.x&&s.y===l.y&&n.equals(a)&&r.equals(c)&&i.blockHeight===o.blockHeight&&i.blockWidth===o.blockWidth&&i.maximumPyramidLevel===o.maximumPyramidLevel}(e,c))),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",t.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const e=this.rasterFunction.getClippingGeometries()[0];let t=e?.clippingGeometry;if(t&&"inside"===e.clippingType){const{extent:e}=this.rasterInfo,s=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),n=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(3054)]).then(i.bind(i,93054));let r=s.execute(l.A.fromExtent(e),2*(e.width+e.height)/40);r=(0,h.uk)(r,t.spatialReference),t=n.execute(r,t)}this._clippingGeometry.clear(),t&&this._clippingGeometry.set("0",t)}};(0,s._)([(0,r.MZ)({type:String,json:{write:!0}})],d.prototype,"datasetFormat",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"tileType",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"rasterFunction",void 0),(0,s._)([(0,r.MZ)()],d.prototype,"primaryRasters",void 0),d=(0,s._)([(0,o.$)("esri.layers.support.rasterDatasets.FunctionRaster")],d);const f=d},87045:(e,t,i)=>{i.d(t,{A:()=>I});var s,n=i(90237),r=i(66552),o=i(25482),l=i(83047),a=i(10107),c=i(56507),u=(i(44208),i(87811),i(36005)),h=i(40608),p=i(43937),d=i(86738),f=i(16930),m=i(19419),y=i(21325),g=i(28735),x=i(91806),_=i(72802);const w=new r.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let b=class extends o.A{static{s=this}static create(e={}){const{resolutionFactor:t=1,scales:i,size:n=256,spatialReference:r=f.A.WebMercator,numLODs:o=24}=e;if(!(0,y.fn)(r)){const e=[];if(i)for(let t=0;t<i.length;t++){const s=i[t];e.push(new x.A({level:t,scale:s,resolution:s}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new x.A({level:i,scale:t,resolution:t})),t*=2}return new s({dpi:96,lods:e,origin:new d.A(0,0,r),size:[n,n],spatialReference:r})}const a=(0,y.Vp)(r),c=e.origin?new d.A({x:e.origin.x,y:e.origin.y,spatialReference:r}):new d.A(a?{x:a.origin[0],y:a.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),u=1/(39.37*(0,l.GA)(r)*96),h=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],s=t*u;h.push(new x.A({level:e,scale:t,resolution:s}))}else{let e=(0,y.EA)(r)?512/n*591657527.5917094:256/n*591657527.591555;const i=Math.ceil(o/t);h.push(new x.A({level:0,scale:e,resolution:e*u}));for(let s=1;s<i;s++){const i=e/2**t,n=i*u;h.push(new x.A({level:s,scale:i,resolution:n})),e=i}}return new s({dpi:96,lods:h,origin:c,size:[n,n],spatialReference:r})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return d.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const s=[],n=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach((e=>{s.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,n[e.level]=e}))),this._set("scales",s),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;s<i;s++){const i=t[s],n=t[s+1];if(i<=e)return s;if(n===e)return s+1;if(i>e&&n<e)return s+Math.log(i/e)/Math.log(i/n)}return s}tileAt(e,t,i,s){const n=this.lodAt(e);if(!n)return null;let r,o;if("number"==typeof t)r=t,o=i;else if((0,y.aI)(t.spatialReference,this.spatialReference))r=t.x,o=t.y,s=i;else{const e=(0,g.Cv)(t,this.spatialReference);if(null==e)return null;r=e.x,o=e.y,s=i}const l=n.resolution*this.size[0],a=n.resolution*this.size[1];return s||(s=new _.U(null,0,0,0,(0,m.vt)())),s.level=e,s.row=Math.floor((this.origin.y-o)/a+.001),s.col=Math.floor((r-this.origin.x)/l+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=s.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===s.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const n=e.level-i.level,r=i.resolution*this.size[0]/2**n,o=i.resolution*this.size[1]/2**n;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,m.vt)()),e.extent[0]=this.origin.x+e.col*r,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+r,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const i=this.lodAt(t.level);if(null==i)return null;const{resolution:s}=i,n=s*this.size[0],r=s*this.size[1];return e[0]=this.origin.x+t.col*n,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+n,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return s.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;const t=(512===this.size[0]&&256===e?-1:0)+(this.spatialReference.isGeographic?1:0);if(this.size[0]===e&&0===t)return this;const i=[],n=this.lods.length-t;for(let e=0;e<n;e++){const s=e+t,{scale:n,resolution:r}=s>=0?this.lods[s]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new x.A({level:e,scale:n,resolution:r}))}return new s({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const s=e[i];this._upsampleLevels[s.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/s.resolution:0},t=s}}};var v,R;(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],b.prototype,"compressionQuality",void 0),(0,n._)([(0,a.MZ)({type:Number,json:{write:!0}})],b.prototype,"dpi",void 0),(0,n._)([(0,a.MZ)({type:String,json:{read:w.read,write:w.write,origins:{"web-scene":{read:!1,write:!1}}}})],b.prototype,"format",void 0),(0,n._)([(0,a.MZ)({readOnly:!0})],b.prototype,"isWrappable",null),(0,n._)([(0,a.MZ)({type:d.A,json:{write:!0}})],b.prototype,"origin",void 0),(0,n._)([(0,u.w)("origin")],b.prototype,"readOrigin",null),(0,n._)([(0,a.MZ)({type:[x.A],value:null,json:{write:!0}})],b.prototype,"lods",null),(0,n._)([(0,a.MZ)({readOnly:!0})],b.prototype,"scales",void 0),(0,n._)([(0,a.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],b.prototype,"size",void 0),(0,n._)([(0,u.w)("size",["rows","cols"])],b.prototype,"readSize",null),(0,n._)([(0,p.K)("size",{cols:{type:c.jz},rows:{type:c.jz}})],b.prototype,"writeSize",null),(0,n._)([(0,a.MZ)({type:f.A,json:{write:!0}})],b.prototype,"spatialReference",void 0),b=s=(0,n._)([(0,h.$)("esri.layers.support.TileInfo")],b),v=b||(b={}),(R=v.ExtrapolateOptions||(v.ExtrapolateOptions={}))[R.NONE=0]="NONE",R[R.POWER_OF_TWO=1]="POWER_OF_TWO";const I=b},89015:(e,t,i)=>{i.d(t,{o:()=>O});var s=i(90237),n=i(78888),r=i(49186),o=i(53966),l=i(10107),a=i(56507),c=(i(44208),i(87811),i(93223)),u=i(36005),h=i(40608),p=i(86738),d=i(16930),f=i(21325),m=i(60694),y=i(10873),g=i(45617),x=i(43577),_=i(13868),w=i(22796),b=i(87045),v=i(76353),R=i(84169),I=i(77301),S=i(77359),M=i(6049),k=i(70834),T=i(6952),A=i(12711),z=i(85676),F=i(94359),P=i(22048),C=i(49410),D=i(34606),N=i(51508);const O=e=>{let t=class extends e{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=(0,v.q)(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",(0,m.Jf)(e,o.A.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const s=t?.layerDefinition?.drawingInfo?.renderer;return(0,F.LF)(s,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=(0,a.PZ)(P.A,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=i;if(!s.spatialReference.equals(o)){await(0,k.Hh)();const e="extent"===s.type?(0,k._l)(s,o):(0,k.uk)(s,o);if(null==e)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new p.A({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:u,height:h}=(0,S.b7)(i,n,l),d=await this.fetchPixels(c,u,h,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new r.A("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const f=await(0,S.$Q)(d.pixelBlock,c,n),m=this._rasterJobHandler;return m?m.computeStatisticsHistograms({pixelBlock:f},t):(0,T.eH)(f)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=(0,I.XU)({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:s}=this.raster,n=(0,I.ct)(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),r=n?.name,o=(0,A.m7)(s,r);return this._updateSymbolizer(t,i,r,o)}async applyRenderer(e,t,i){const s=e?.pixelBlock;if(!(null!=s&&s.pixels&&s.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:r}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},i);return r}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const s=(0,f.Vp)(e);return b.A.create({size:256,spatialReference:e,origin:s?{x:s.origin[0],y:s.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,i,s={}){if(O(this),s.requestAsImageElement){const r=this.getTileUrl(e,t,i);return(0,n.A)(r,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:r}=this;if(null!=r.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const n=s.tileInfo||r.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,i,n),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,i,s)}async fetchPixels(e,t,i,s={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,s))}async getSamples(e,t){if(await this.load(),(e=(0,a.PZ)(D.A,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r.A("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:i},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),o=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new N.A({samples:o})}async identify(e,t={}){await this.load();const{raster:i,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo&&!(s.hasMultidimensionalTranspose&&((0,I.DY)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||null!=(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition))return{location:e,value:null};const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new r.A("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return i.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date((0,I.$E)(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return(0,I.z2)(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,I.fy)(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&(0,v.q)(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;O(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,(0,v.q)(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:s,type:n}=t;if("multipoint"===n)return t.points.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})));if("polyline"===n){let n=t;if(e.sampleCount||e.sampleDistance){const s=await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(8411)]).then(i.bind(i,88411)),r=(await Promise.all([i.e(3661),i.e(1878),i.e(2189),i.e(3299),i.e(4929)]).then(i.bind(i,965))).execute(t,{unit:"meters"}),o=Math.min(e.sampleCount||100,1e3);let l=e.sampleDistance;l||(l=r/(o+(2===n.paths[0].length?1:0))),n=s.execute(t,l,{unit:"meters"})}return n.paths.flatMap((e=>e.map((e=>new p.A({x:e[0],y:e[1],spatialReference:s})))))}const r=Math.min(e.sampleCount||100,1e3),o="extent"===t.type,l=o?t:t.extent,a=Math.sqrt(l.width*l.height/r),c=l.height/a,u=l.width/a,{xmin:h,ymax:d}=l,f=[];for(let e=0;e<c;e++)for(let i=0;i<u;i++){const n=new p.A({x:h+(i+.5)*a,y:d-(e+.5)*a,spatialReference:s});(o||t.contains(n))&&f.push(n)}return f}_configDefaultInterpolation(){if(null==this.interpolation){O(this);const{raster:e}=this,t=(0,A.w6)(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){O(this);const{rasterInfo:t}=this.raster,i=(0,I.ct)(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=(0,A.I8)({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??(0,A.ci)(t)),!this.renderer||"override"===e){const e=(0,A.Mm)(this.raster),i=n?.renderer??(0,A.PD)(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,l=o?.max??0,a=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(l>1e24||a<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const r=(0,A.$P)({...this.renderer.toJSON(),variableName:s}),l=(0,A.m7)(t,s);this.symbolizer?(this.symbolizer.rendererJSON=r,this.symbolizer.rasterInfo=l):this.symbolizer=new z.A({rendererJSON:r,rasterInfo:l});const a=this.symbolizer.bind();if(a.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=(0,A.PD)(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else o.A.getLogger(this).warn("imagery-tile-mixin",a.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&(0,v.q)(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",w.A.fromJSON(e)))}let e,t=this.raster,i=!1;(0,v.q)(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:s}=this;if(s){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const n=(0,M.vt)(s.functionDefinition?.toJSON()??s.toJSON(),i),r=new R.A({rasterFunction:n});r.rasterJobHandler=this._rasterJobHandler,await r.open(),this.raster=r}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!s)return;const{bandIds:n}=this,{bandCount:r}=this.raster.rasterInfo,o=n?.length?n.some((e=>e>=r)):r>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,s=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(i.pixelSize.x+i.pixelSize.y)/2*s;if(!e.dataSeries?.length)return[new C.A({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const r=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:s},o)=>{const l={Variables:s[0].variableName,Dimensions:s.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of s){l[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];l[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const a=new C.A({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:n,attributes:l});r.push(a)})),r}};function O(e){if(!e.raster||!e.serviceRasterInfo)throw new r.A("imagery-tile","no raster")}return(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_cachedRasterFunctionJson",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_compatibleFullExtent",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_isConstructedFromFunctionRaster",void 0),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"_rasterFunctionUpdatePromise",void 0),(0,s._)([(0,l.MZ)({type:[a.jz],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],t.prototype,"bandIds",void 0),(0,s._)([(0,l.MZ)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,s._)([(0,l.MZ)({json:{read:!1}})],t.prototype,"fullExtent",null),(0,s._)([(0,l.MZ)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,c.e)(_.SZ)],t.prototype,"interpolation",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"ioConfig",void 0),(0,s._)([(0,l.MZ)({type:[g.A],json:{write:!0}})],t.prototype,"multidimensionalDefinition",null),(0,s._)([(0,l.MZ)({type:x.A,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"raster",void 0),(0,s._)([(0,l.MZ)({type:w.A})],t.prototype,"rasterFunction",null),(0,s._)([(0,l.MZ)()],t.prototype,"serviceRasterInfo",void 0),(0,s._)([(0,l.MZ)()],t.prototype,"sourceJSON",void 0),(0,s._)([(0,l.MZ)({readOnly:!0,type:d.A,json:{read:!1}})],t.prototype,"spatialReference",void 0),(0,s._)([(0,l.MZ)({type:b.A})],t.prototype,"tileInfo",void 0),(0,s._)([(0,l.MZ)(y.OZ)],t.prototype,"url",null),(0,s._)([(0,l.MZ)()],t.prototype,"renderer",null),(0,s._)([(0,l.MZ)({types:F.uy,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:F.Gj,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"internalRenderer",null),(0,s._)([(0,u.w)("internalRenderer")],t.prototype,"readRenderer",null),(0,s._)([(0,l.MZ)({clonable:!1})],t.prototype,"symbolizer",void 0),t=(0,s._)([(0,h.$)("esri.layers.mixins.ImageryTileMixin")],t),t}},91806:(e,t,i)=>{i.d(t,{A:()=>u});var s,n=i(90237),r=i(25482),o=i(10107),l=i(56507),a=(i(44208),i(87811),i(40608));let c=class extends r.A{static{s=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new s({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"cols",void 0),(0,n._)([(0,o.MZ)({type:l.jz,json:{write:!0}})],c.prototype,"level",void 0),(0,n._)([(0,o.MZ)({type:String,json:{write:!0}})],c.prototype,"levelValue",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"origin",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"resolution",void 0),(0,n._)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],c.prototype,"rows",void 0),(0,n._)([(0,o.MZ)({type:Number,json:{write:!0}})],c.prototype,"scale",void 0),c=s=(0,n._)([(0,a.$)("esri.layers.support.LOD")],c);const u=c}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2343],{2343:(r,e,t)=>{t.r(e),t.d(e,{l:()=>s});var n,o=t(11053),a={exports:{}};const i=(0,o.g)(function(){return n||(n=1,r=a,e="undefined"!=typeof document?document.currentScript?.src:void 0,t=function(r={}){var t,n,a,i=r,s=new Promise(((r,e)=>{t=r,n=e})),l=Object.assign({},i),u="./this.program",d="";"undefined"!=typeof document&&document.currentScript&&(d=document.currentScript.src),e&&(d=e),d=d.startsWith("blob:")?"":d.substr(0,d.replace(/[?#].*/,"").lastIndexOf("/")+1),a=r=>fetch(r,{credentials:"same-origin"}).then((r=>r.ok?r.arrayBuffer():Promise.reject(new Error(r.status+" : "+r.url))));var c=i.print||console.log.bind(console),f=i.printErr||console.error.bind(console);Object.assign(i,l),l=null,i.arguments&&i.arguments,i.thisProgram&&(u=i.thisProgram);var h,m,p,v,w,y,g,E,_,b=i.wasmBinary,k=!1;function F(){var r=h.buffer;i.HEAP8=m=new Int8Array(r),i.HEAP16=v=new Int16Array(r),i.HEAPU8=p=new Uint8Array(r),i.HEAPU16=w=new Uint16Array(r),i.HEAP32=y=new Int32Array(r),i.HEAPU32=g=new Uint32Array(r),i.HEAPF32=E=new Float32Array(r),i.HEAPF64=_=new Float64Array(r)}var P=[],A=[],S=[],D=0,$=null;function C(r){D++,i.monitorRunDependencies?.(D)}function T(r){if(D--,i.monitorRunDependencies?.(D),0==D&&$){var e=$;$=null,e()}}function j(r){i.onAbort?.(r),f(r="Aborted("+r+")"),k=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw n(e),e}var M,x,R,N=r=>r.startsWith("data:application/octet-stream;base64,");function z(r){if(r==M&&b)return new Uint8Array(b);throw"both async and sync fetching of the wasm failed"}function O(r,e,t){return function(r){return b?Promise.resolve().then((()=>z(r))):a(r).then((r=>new Uint8Array(r)),(()=>z(r)))}(r).then((r=>WebAssembly.instantiate(r,e))).then(t,(r=>{f(`failed to asynchronously prepare wasm: ${r}`),j(r)}))}class W{name="ExitStatus";constructor(r){this.message=`Program terminated with exit(${r})`,this.status=r}}var U=r=>{for(;r.length>0;)r.shift()(i)},B=i.noExitRuntime||!0,L=r=>ke(r),I=()=>Fe();class H{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){g[this.ptr+4>>2]=r}get_type(){return g[this.ptr+4>>2]}set_destructor(r){g[this.ptr+8>>2]=r}get_destructor(){return g[this.ptr+8>>2]}set_caught(r){r=r?1:0,m[this.ptr+12]=r}get_caught(){return 0!=m[this.ptr+12]}set_rethrown(r){r=r?1:0,m[this.ptr+13]=r}get_rethrown(){return 0!=m[this.ptr+13]}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){g[this.ptr+16>>2]=r}get_adjusted_ptr(){return g[this.ptr+16>>2]}}var V=()=>{var r=y[+fr.varargs>>2];return fr.varargs+=4,r},q=V,X={isAbs:r=>"/"===r.charAt(0),splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var t=0,n=r.length-1;n>=0;n--){var o=r[n];"."===o?r.splice(n,1):".."===o?(r.splice(n,1),t++):t&&(r.splice(n,1),t--)}if(e)for(;t;t--)r.unshift("..");return r},normalize:r=>{var e=X.isAbs(r),t="/"===r.substr(-1);return(r=X.normalizeArray(r.split("/").filter((r=>!!r)),!e).join("/"))||e||(r="."),r&&t&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=X.splitPath(r),t=e[0],n=e[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:r=>{if("/"===r)return"/";var e=(r=(r=X.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return-1===e?r:r.substr(e+1)},join:(...r)=>X.normalize(r.join("/")),join2:(r,e)=>X.normalize(r+"/"+e)},G=r=>(G=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return r=>crypto.getRandomValues(r);j("initRandomDevice")})())(r),K={resolve:(...r)=>{for(var e="",t=!1,n=r.length-1;n>=-1&&!t;n--){var o=n>=0?r[n]:dr.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");if(!o)return"";e=o+"/"+e,t=X.isAbs(o)}return(t?"/":"")+(e=X.normalizeArray(e.split("/").filter((r=>!!r)),!t).join("/"))||"."},relative:(r,e)=>{function t(r){for(var e=0;e<r.length&&""===r[e];e++);for(var t=r.length-1;t>=0&&""===r[t];t--);return e>t?[]:r.slice(e,t-e+1)}r=K.resolve(r).substr(1),e=K.resolve(e).substr(1);for(var n=t(r.split("/")),o=t(e.split("/")),a=Math.min(n.length,o.length),i=a,s=0;s<a;s++)if(n[s]!==o[s]){i=s;break}var l=[];for(s=i;s<n.length;s++)l.push("..");return(l=l.concat(o.slice(i))).join("/")}},Y="undefined"!=typeof TextDecoder?new TextDecoder:void 0,J=(r,e=0,t=NaN)=>{for(var n=e+t,o=e;r[o]&&!(o>=n);)++o;if(o-e>16&&r.buffer&&Y)return Y.decode(r.subarray(e,o));for(var a="";e<o;){var i=r[e++];if(128&i){var s=63&r[e++];if(192!=(224&i)){var l=63&r[e++];if((i=224==(240&i)?(15&i)<<12|s<<6|l:(7&i)<<18|s<<12|l<<6|63&r[e++])<65536)a+=String.fromCharCode(i);else{var u=i-65536;a+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a},Q=[],Z=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n<=127?e++:n<=2047?e+=2:n>=55296&&n<=57343?(e+=4,++t):e+=3}return e},rr=(r,e,t,n)=>{if(!(n>0))return 0;for(var o=t,a=t+n-1,i=0;i<r.length;++i){var s=r.charCodeAt(i);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&r.charCodeAt(++i)),s<=127){if(t>=a)break;e[t++]=s}else if(s<=2047){if(t+1>=a)break;e[t++]=192|s>>6,e[t++]=128|63&s}else if(s<=65535){if(t+2>=a)break;e[t++]=224|s>>12,e[t++]=128|s>>6&63,e[t++]=128|63&s}else{if(t+3>=a)break;e[t++]=240|s>>18,e[t++]=128|s>>12&63,e[t++]=128|s>>6&63,e[t++]=128|63&s}}return e[t]=0,t-o},er={ttys:[],init(){},shutdown(){},register(r,e){er.ttys[r]={input:[],output:[],ops:e},dr.registerDevice(r,er.stream_ops)},stream_ops:{open(r){var e=er.ttys[r.node.rdev];if(!e)throw new dr.ErrnoError(43);r.tty=e,r.seekable=!1},close(r){r.tty.ops.fsync(r.tty)},fsync(r){r.tty.ops.fsync(r.tty)},read(r,e,t,n,o){if(!r.tty||!r.tty.ops.get_char)throw new dr.ErrnoError(60);for(var a=0,i=0;i<n;i++){var s;try{s=r.tty.ops.get_char(r.tty)}catch(r){throw new dr.ErrnoError(29)}if(void 0===s&&0===a)throw new dr.ErrnoError(6);if(null==s)break;a++,e[t+i]=s}return a&&(r.node.timestamp=Date.now()),a},write(r,e,t,n,o){if(!r.tty||!r.tty.ops.put_char)throw new dr.ErrnoError(60);try{for(var a=0;a<n;a++)r.tty.ops.put_char(r.tty,e[t+a])}catch(r){throw new dr.ErrnoError(29)}return n&&(r.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:r=>(()=>{if(!Q.length){var r=null;if("undefined"!=typeof window&&"function"==typeof window.prompt&&null!==(r=window.prompt("Input: "))&&(r+="\n"),!r)return null;Q=function(r){var e=Z(r)+1,t=new Array(e),n=rr(r,t,0,t.length);return t.length=n,t}(r)}return Q.shift()})(),put_char(r,e){null===e||10===e?(c(J(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(c(J(r.output)),r.output=[])},ioctl_tcgets:r=>({c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}),ioctl_tcsets:(r,e,t)=>0,ioctl_tiocgwinsz:r=>[24,80]},default_tty1_ops:{put_char(r,e){null===e||10===e?(f(J(r.output)),r.output=[]):0!=e&&r.output.push(e)},fsync(r){r.output&&r.output.length>0&&(f(J(r.output)),r.output=[])}}},tr=(r,e)=>Math.ceil(r/e)*e,nr=r=>{j()},or={ops_table:null,mount:r=>or.createNode(null,"/",16895,0),createNode(r,e,t,n){if(dr.isBlkdev(t)||dr.isFIFO(t))throw new dr.ErrnoError(63);or.ops_table||={dir:{node:{getattr:or.node_ops.getattr,setattr:or.node_ops.setattr,lookup:or.node_ops.lookup,mknod:or.node_ops.mknod,rename:or.node_ops.rename,unlink:or.node_ops.unlink,rmdir:or.node_ops.rmdir,readdir:or.node_ops.readdir,symlink:or.node_ops.symlink},stream:{llseek:or.stream_ops.llseek}},file:{node:{getattr:or.node_ops.getattr,setattr:or.node_ops.setattr},stream:{llseek:or.stream_ops.llseek,read:or.stream_ops.read,write:or.stream_ops.write,allocate:or.stream_ops.allocate,mmap:or.stream_ops.mmap,msync:or.stream_ops.msync}},link:{node:{getattr:or.node_ops.getattr,setattr:or.node_ops.setattr,readlink:or.node_ops.readlink},stream:{}},chrdev:{node:{getattr:or.node_ops.getattr,setattr:or.node_ops.setattr},stream:dr.chrdev_stream_ops}};var o=dr.createNode(r,e,t,n);return dr.isDir(o.mode)?(o.node_ops=or.ops_table.dir.node,o.stream_ops=or.ops_table.dir.stream,o.contents={}):dr.isFile(o.mode)?(o.node_ops=or.ops_table.file.node,o.stream_ops=or.ops_table.file.stream,o.usedBytes=0,o.contents=null):dr.isLink(o.mode)?(o.node_ops=or.ops_table.link.node,o.stream_ops=or.ops_table.link.stream):dr.isChrdev(o.mode)&&(o.node_ops=or.ops_table.chrdev.node,o.stream_ops=or.ops_table.chrdev.stream),o.timestamp=Date.now(),r&&(r.contents[e]=o,r.timestamp=o.timestamp),o},getFileDataAsTypedArray:r=>r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0),expandFileStorage(r,e){var t=r.contents?r.contents.length:0;if(!(t>=e)){e=Math.max(e,t*(t<1048576?2:1.125)>>>0),0!=t&&(e=Math.max(e,256));var n=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(n.subarray(0,r.usedBytes),0)}},resizeFileStorage(r,e){if(r.usedBytes!=e)if(0==e)r.contents=null,r.usedBytes=0;else{var t=r.contents;r.contents=new Uint8Array(e),t&&r.contents.set(t.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr(r){var e={};return e.dev=dr.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,dr.isDir(r.mode)?e.size=4096:dr.isFile(r.mode)?e.size=r.usedBytes:dr.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr(r,e){void 0!==e.mode&&(r.mode=e.mode),void 0!==e.timestamp&&(r.timestamp=e.timestamp),void 0!==e.size&&or.resizeFileStorage(r,e.size)},lookup(r,e){throw or.doesNotExistError},mknod:(r,e,t,n)=>or.createNode(r,e,t,n),rename(r,e,t){if(dr.isDir(r.mode)){var n;try{n=dr.lookupNode(e,t)}catch(r){}if(n)for(var o in n.contents)throw new dr.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=t,e.contents[t]=r,e.timestamp=r.parent.timestamp},unlink(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir(r,e){var t=dr.lookupNode(r,e);for(var n in t.contents)throw new dr.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir(r){var e=[".",".."];for(var t of Object.keys(r.contents))e.push(t);return e},symlink(r,e,t){var n=or.createNode(r,e,41471,0);return n.link=t,n},readlink(r){if(!dr.isLink(r.mode))throw new dr.ErrnoError(28);return r.link}},stream_ops:{read(r,e,t,n,o){var a=r.node.contents;if(o>=r.node.usedBytes)return 0;var i=Math.min(r.node.usedBytes-o,n);if(i>8&&a.subarray)e.set(a.subarray(o,o+i),t);else for(var s=0;s<i;s++)e[t+s]=a[o+s];return i},write(r,e,t,n,o,a){if(e.buffer===m.buffer&&(a=!1),!n)return 0;var i=r.node;if(i.timestamp=Date.now(),e.subarray&&(!i.contents||i.contents.subarray)){if(a)return i.contents=e.subarray(t,t+n),i.usedBytes=n,n;if(0===i.usedBytes&&0===o)return i.contents=e.slice(t,t+n),i.usedBytes=n,n;if(o+n<=i.usedBytes)return i.contents.set(e.subarray(t,t+n),o),n}if(or.expandFileStorage(i,o+n),i.contents.subarray&&e.subarray)i.contents.set(e.subarray(t,t+n),o);else for(var s=0;s<n;s++)i.contents[o+s]=e[t+s];return i.usedBytes=Math.max(i.usedBytes,o+n),n},llseek(r,e,t){var n=e;if(1===t?n+=r.position:2===t&&dr.isFile(r.node.mode)&&(n+=r.node.usedBytes),n<0)throw new dr.ErrnoError(28);return n},allocate(r,e,t){or.expandFileStorage(r.node,e+t),r.node.usedBytes=Math.max(r.node.usedBytes,e+t)},mmap(r,e,t,n,o){if(!dr.isFile(r.node.mode))throw new dr.ErrnoError(43);var a,i,s=r.node.contents;if(2&o||!s||s.buffer!==m.buffer){if(i=!0,!(a=nr()))throw new dr.ErrnoError(48);s&&((t>0||t+e<s.length)&&(s=s.subarray?s.subarray(t,t+e):Array.prototype.slice.call(s,t,t+e)),m.set(s,a))}else i=!1,a=s.byteOffset;return{ptr:a,allocated:i}},msync:(r,e,t,n,o)=>(or.stream_ops.write(r,e,0,n,t,!1),0)}},ar=(r,e,t,n)=>{var o=`al ${r}`;a(r).then((r=>{e(new Uint8Array(r)),o&&T()}),(e=>{if(!t)throw`Loading data file "${r}" failed.`;t()})),o&&C()},ir=(r,e,t,n,o,a)=>{dr.createDataFile(r,e,t,n,o,a)},sr=i.preloadPlugins||[],lr=(r,e,t,n,o,a,i,s,l,u)=>{var d=e?K.resolve(X.join2(r,e)):r;function c(t){function c(t){u?.(),s||ir(r,e,t,n,o,l),a?.(),T()}((r,e,t,n)=>{"undefined"!=typeof Browser&&Browser.init();var o=!1;return sr.forEach((a=>{o||a.canHandle(e)&&(a.handle(r,e,t,n),o=!0)})),o})(t,d,c,(()=>{i?.(),T()}))||c(t)}C(),"string"==typeof t?ar(t,c,i):c(t)},ur=(r,e)=>{var t=0;return r&&(t|=365),e&&(t|=146),t},dr={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:class{name="ErrnoError";constructor(r){this.errno=r}},filesystems:null,syncFSRequests:0,readFiles:{},FSStream:class{shared={};get object(){return this.node}set object(r){this.node=r}get isRead(){return 1!=(2097155&this.flags)}get isWrite(){return!!(2097155&this.flags)}get isAppend(){return 1024&this.flags}get flags(){return this.shared.flags}set flags(r){this.shared.flags=r}get position(){return this.shared.position}set position(r){this.shared.position=r}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(r,e,t,n){r||(r=this),this.parent=r,this.mount=r.mount,this.id=dr.nextInode++,this.name=e,this.mode=t,this.rdev=n}get read(){return(this.mode&this.readMode)===this.readMode}set read(r){r?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(r){r?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return dr.isDir(this.mode)}get isDevice(){return dr.isChrdev(this.mode)}},lookupPath(r,e={}){if(!(r=K.resolve(r)))return{path:"",node:null};if((e=Object.assign({follow_mount:!0,recurse_count:0},e)).recurse_count>8)throw new dr.ErrnoError(32);for(var t=r.split("/").filter((r=>!!r)),n=dr.root,o="/",a=0;a<t.length;a++){var i=a===t.length-1;if(i&&e.parent)break;if(n=dr.lookupNode(n,t[a]),o=X.join2(o,t[a]),dr.isMountpoint(n)&&(!i||i&&e.follow_mount)&&(n=n.mounted.root),!i||e.follow)for(var s=0;dr.isLink(n.mode);){var l=dr.readlink(o);if(o=K.resolve(X.dirname(o),l),n=dr.lookupPath(o,{recurse_count:e.recurse_count+1}).node,s++>40)throw new dr.ErrnoError(32)}}return{path:o,node:n}},getPath(r){for(var e;;){if(dr.isRoot(r)){var t=r.mount.mountpoint;return e?"/"!==t[t.length-1]?`${t}/${e}`:t+e:t}e=e?`${r.name}/${e}`:r.name,r=r.parent}},hashName(r,e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return(r+t>>>0)%dr.nameTable.length},hashAddNode(r){var e=dr.hashName(r.parent.id,r.name);r.name_next=dr.nameTable[e],dr.nameTable[e]=r},hashRemoveNode(r){var e=dr.hashName(r.parent.id,r.name);if(dr.nameTable[e]===r)dr.nameTable[e]=r.name_next;else for(var t=dr.nameTable[e];t;){if(t.name_next===r){t.name_next=r.name_next;break}t=t.name_next}},lookupNode(r,e){var t=dr.mayLookup(r);if(t)throw new dr.ErrnoError(t);for(var n=dr.hashName(r.id,e),o=dr.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===r.id&&a===e)return o}return dr.lookup(r,e)},createNode(r,e,t,n){var o=new dr.FSNode(r,e,t,n);return dr.hashAddNode(o),o},destroyNode(r){dr.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>32768==(61440&r),isDir:r=>16384==(61440&r),isLink:r=>40960==(61440&r),isChrdev:r=>8192==(61440&r),isBlkdev:r=>24576==(61440&r),isFIFO:r=>4096==(61440&r),isSocket:r=>!(49152&~r),flagsToPermissionString(r){var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>dr.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>dr.isDir(r.mode)?dr.nodePermissions(r,"x")||(r.node_ops.lookup?0:2):54,mayCreate(r,e){try{return dr.lookupNode(r,e),20}catch(r){}return dr.nodePermissions(r,"wx")},mayDelete(r,e,t){var n;try{n=dr.lookupNode(r,e)}catch(r){return r.errno}var o=dr.nodePermissions(r,"wx");if(o)return o;if(t){if(!dr.isDir(n.mode))return 54;if(dr.isRoot(n)||dr.getPath(n)===dr.cwd())return 10}else if(dr.isDir(n.mode))return 31;return 0},mayOpen:(r,e)=>r?dr.isLink(r.mode)?32:dr.isDir(r.mode)&&("r"!==dr.flagsToPermissionString(e)||512&e)?31:dr.nodePermissions(r,dr.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd(){for(var r=0;r<=dr.MAX_OPEN_FDS;r++)if(!dr.streams[r])return r;throw new dr.ErrnoError(33)},getStreamChecked(r){var e=dr.getStream(r);if(!e)throw new dr.ErrnoError(8);return e},getStream:r=>dr.streams[r],createStream:(r,e=-1)=>(r=Object.assign(new dr.FSStream,r),-1==e&&(e=dr.nextfd()),r.fd=e,dr.streams[e]=r,r),closeStream(r){dr.streams[r]=null},dupStream(r,e=-1){var t=dr.createStream(r,e);return t.stream_ops?.dup?.(t),t},chrdev_stream_ops:{open(r){var e=dr.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open?.(r)},llseek(){throw new dr.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice(r,e){dr.devices[r]={stream_ops:e}},getDevice:r=>dr.devices[r],getMounts(r){for(var e=[],t=[r];t.length;){var n=t.pop();e.push(n),t.push(...n.mounts)}return e},syncfs(r,e){"function"==typeof r&&(e=r,r=!1),dr.syncFSRequests++,dr.syncFSRequests>1&&f(`warning: ${dr.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=dr.getMounts(dr.root.mount),n=0;function o(r){return dr.syncFSRequests--,e(r)}function a(r){if(r)return a.errored?void 0:(a.errored=!0,o(r));++n>=t.length&&o(null)}t.forEach((e=>{if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)}))},mount(r,e,t){var n,o="/"===t,a=!t;if(o&&dr.root)throw new dr.ErrnoError(10);if(!o&&!a){var i=dr.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,dr.isMountpoint(n))throw new dr.ErrnoError(10);if(!dr.isDir(n.mode))throw new dr.ErrnoError(54)}var s={type:r,opts:e,mountpoint:t,mounts:[]},l=r.mount(s);return l.mount=s,s.root=l,o?dr.root=l:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),l},unmount(r){var e=dr.lookupPath(r,{follow_mount:!1});if(!dr.isMountpoint(e.node))throw new dr.ErrnoError(28);var t=e.node,n=t.mounted,o=dr.getMounts(n);Object.keys(dr.nameTable).forEach((r=>{for(var e=dr.nameTable[r];e;){var t=e.name_next;o.includes(e.mount)&&dr.destroyNode(e),e=t}})),t.mounted=null;var a=t.mount.mounts.indexOf(n);t.mount.mounts.splice(a,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod(r,e,t){var n=dr.lookupPath(r,{parent:!0}).node,o=X.basename(r);if(!o||"."===o||".."===o)throw new dr.ErrnoError(28);var a=dr.mayCreate(n,o);if(a)throw new dr.ErrnoError(a);if(!n.node_ops.mknod)throw new dr.ErrnoError(63);return n.node_ops.mknod(n,o,e,t)},statfs(r){var e={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:dr.nextInode,ffree:dr.nextInode-1,fsid:42,flags:2,namelen:255},t=dr.lookupPath(r,{follow:!0}).node;return t?.node_ops.statfs&&Object.assign(e,t.node_ops.statfs(t.mount.opts.root)),e},create:(r,e=438)=>(e&=4095,e|=32768,dr.mknod(r,e,0)),mkdir:(r,e=511)=>(e&=1023,e|=16384,dr.mknod(r,e,0)),mkdirTree(r,e){for(var t=r.split("/"),n="",o=0;o<t.length;++o)if(t[o]){n+="/"+t[o];try{dr.mkdir(n,e)}catch(r){if(20!=r.errno)throw r}}},mkdev:(r,e,t)=>(void 0===t&&(t=e,e=438),e|=8192,dr.mknod(r,e,t)),symlink(r,e){if(!K.resolve(r))throw new dr.ErrnoError(44);var t=dr.lookupPath(e,{parent:!0}).node;if(!t)throw new dr.ErrnoError(44);var n=X.basename(e),o=dr.mayCreate(t,n);if(o)throw new dr.ErrnoError(o);if(!t.node_ops.symlink)throw new dr.ErrnoError(63);return t.node_ops.symlink(t,n,r)},rename(r,e){var t,n,o=X.dirname(r),a=X.dirname(e),i=X.basename(r),s=X.basename(e);if(t=dr.lookupPath(r,{parent:!0}).node,n=dr.lookupPath(e,{parent:!0}).node,!t||!n)throw new dr.ErrnoError(44);if(t.mount!==n.mount)throw new dr.ErrnoError(75);var l,u=dr.lookupNode(t,i),d=K.relative(r,a);if("."!==d.charAt(0))throw new dr.ErrnoError(28);if("."!==(d=K.relative(e,o)).charAt(0))throw new dr.ErrnoError(55);try{l=dr.lookupNode(n,s)}catch(r){}if(u!==l){var c=dr.isDir(u.mode),f=dr.mayDelete(t,i,c);if(f)throw new dr.ErrnoError(f);if(f=l?dr.mayDelete(n,s,c):dr.mayCreate(n,s))throw new dr.ErrnoError(f);if(!t.node_ops.rename)throw new dr.ErrnoError(63);if(dr.isMountpoint(u)||l&&dr.isMountpoint(l))throw new dr.ErrnoError(10);if(n!==t&&(f=dr.nodePermissions(t,"w")))throw new dr.ErrnoError(f);dr.hashRemoveNode(u);try{t.node_ops.rename(u,n,s),u.parent=n}catch(r){throw r}finally{dr.hashAddNode(u)}}},rmdir(r){var e=dr.lookupPath(r,{parent:!0}).node,t=X.basename(r),n=dr.lookupNode(e,t),o=dr.mayDelete(e,t,!0);if(o)throw new dr.ErrnoError(o);if(!e.node_ops.rmdir)throw new dr.ErrnoError(63);if(dr.isMountpoint(n))throw new dr.ErrnoError(10);e.node_ops.rmdir(e,t),dr.destroyNode(n)},readdir(r){var e=dr.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new dr.ErrnoError(54);return e.node_ops.readdir(e)},unlink(r){var e=dr.lookupPath(r,{parent:!0}).node;if(!e)throw new dr.ErrnoError(44);var t=X.basename(r),n=dr.lookupNode(e,t),o=dr.mayDelete(e,t,!1);if(o)throw new dr.ErrnoError(o);if(!e.node_ops.unlink)throw new dr.ErrnoError(63);if(dr.isMountpoint(n))throw new dr.ErrnoError(10);e.node_ops.unlink(e,t),dr.destroyNode(n)},readlink(r){var e=dr.lookupPath(r).node;if(!e)throw new dr.ErrnoError(44);if(!e.node_ops.readlink)throw new dr.ErrnoError(28);return e.node_ops.readlink(e)},stat(r,e){var t=dr.lookupPath(r,{follow:!e}).node;if(!t)throw new dr.ErrnoError(44);if(!t.node_ops.getattr)throw new dr.ErrnoError(63);return t.node_ops.getattr(t)},lstat:r=>dr.stat(r,!0),chmod(r,e,t){var n;if(!(n="string"==typeof r?dr.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new dr.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&e|-4096&n.mode,timestamp:Date.now()})},lchmod(r,e){dr.chmod(r,e,!0)},fchmod(r,e){var t=dr.getStreamChecked(r);dr.chmod(t.node,e)},chown(r,e,t,n){var o;if(!(o="string"==typeof r?dr.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new dr.ErrnoError(63);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown(r,e,t){dr.chown(r,e,t,!0)},fchown(r,e,t){var n=dr.getStreamChecked(r);dr.chown(n.node,e,t)},truncate(r,e){if(e<0)throw new dr.ErrnoError(28);var t;if(!(t="string"==typeof r?dr.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new dr.ErrnoError(63);if(dr.isDir(t.mode))throw new dr.ErrnoError(31);if(!dr.isFile(t.mode))throw new dr.ErrnoError(28);var n=dr.nodePermissions(t,"w");if(n)throw new dr.ErrnoError(n);t.node_ops.setattr(t,{size:e,timestamp:Date.now()})},ftruncate(r,e){var t=dr.getStreamChecked(r);if(!(2097155&t.flags))throw new dr.ErrnoError(28);dr.truncate(t.node,e)},utime(r,e,t){var n=dr.lookupPath(r,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(e,t)})},open(r,e,t=438){if(""===r)throw new dr.ErrnoError(44);var n;if(t=64&(e="string"==typeof e?(r=>{var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[r];if(void 0===e)throw new Error(`Unknown file open mode: ${r}`);return e})(e):e)?4095&t|32768:0,"object"==typeof r)n=r;else{r=X.normalize(r);try{n=dr.lookupPath(r,{follow:!(131072&e)}).node}catch(r){}}var o=!1;if(64&e)if(n){if(128&e)throw new dr.ErrnoError(20)}else n=dr.mknod(r,t,0),o=!0;if(!n)throw new dr.ErrnoError(44);if(dr.isChrdev(n.mode)&&(e&=-513),65536&e&&!dr.isDir(n.mode))throw new dr.ErrnoError(54);if(!o){var a=dr.mayOpen(n,e);if(a)throw new dr.ErrnoError(a)}512&e&&!o&&dr.truncate(n,0),e&=-131713;var s=dr.createStream({node:n,path:dr.getPath(n),flags:e,seekable:!0,position:0,stream_ops:n.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!i.logReadFiles||1&e||r in dr.readFiles||(dr.readFiles[r]=1),s},close(r){if(dr.isClosed(r))throw new dr.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(r){throw r}finally{dr.closeStream(r.fd)}r.fd=null},isClosed:r=>null===r.fd,llseek(r,e,t){if(dr.isClosed(r))throw new dr.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new dr.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new dr.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,t),r.ungotten=[],r.position},read(r,e,t,n,o){if(n<0||o<0)throw new dr.ErrnoError(28);if(dr.isClosed(r))throw new dr.ErrnoError(8);if(1==(2097155&r.flags))throw new dr.ErrnoError(8);if(dr.isDir(r.node.mode))throw new dr.ErrnoError(31);if(!r.stream_ops.read)throw new dr.ErrnoError(28);var a=void 0!==o;if(a){if(!r.seekable)throw new dr.ErrnoError(70)}else o=r.position;var i=r.stream_ops.read(r,e,t,n,o);return a||(r.position+=i),i},write(r,e,t,n,o,a){if(n<0||o<0)throw new dr.ErrnoError(28);if(dr.isClosed(r))throw new dr.ErrnoError(8);if(!(2097155&r.flags))throw new dr.ErrnoError(8);if(dr.isDir(r.node.mode))throw new dr.ErrnoError(31);if(!r.stream_ops.write)throw new dr.ErrnoError(28);r.seekable&&1024&r.flags&&dr.llseek(r,0,2);var i=void 0!==o;if(i){if(!r.seekable)throw new dr.ErrnoError(70)}else o=r.position;var s=r.stream_ops.write(r,e,t,n,o,a);return i||(r.position+=s),s},allocate(r,e,t){if(dr.isClosed(r))throw new dr.ErrnoError(8);if(e<0||t<=0)throw new dr.ErrnoError(28);if(!(2097155&r.flags))throw new dr.ErrnoError(8);if(!dr.isFile(r.node.mode)&&!dr.isDir(r.node.mode))throw new dr.ErrnoError(43);if(!r.stream_ops.allocate)throw new dr.ErrnoError(138);r.stream_ops.allocate(r,e,t)},mmap(r,e,t,n,o){if(2&n&&!(2&o)&&2!=(2097155&r.flags))throw new dr.ErrnoError(2);if(1==(2097155&r.flags))throw new dr.ErrnoError(2);if(!r.stream_ops.mmap)throw new dr.ErrnoError(43);if(!e)throw new dr.ErrnoError(28);return r.stream_ops.mmap(r,e,t,n,o)},msync:(r,e,t,n,o)=>r.stream_ops.msync?r.stream_ops.msync(r,e,t,n,o):0,ioctl(r,e,t){if(!r.stream_ops.ioctl)throw new dr.ErrnoError(59);return r.stream_ops.ioctl(r,e,t)},readFile(r,e={}){if(e.flags=e.flags||0,e.encoding=e.encoding||"binary","utf8"!==e.encoding&&"binary"!==e.encoding)throw new Error(`Invalid encoding type "${e.encoding}"`);var t,n=dr.open(r,e.flags),o=dr.stat(r).size,a=new Uint8Array(o);return dr.read(n,a,0,o,0),"utf8"===e.encoding?t=J(a):"binary"===e.encoding&&(t=a),dr.close(n),t},writeFile(r,e,t={}){t.flags=t.flags||577;var n=dr.open(r,t.flags,t.mode);if("string"==typeof e){var o=new Uint8Array(Z(e)+1),a=rr(e,o,0,o.length);dr.write(n,o,0,a,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");dr.write(n,e,0,e.byteLength,void 0,t.canOwn)}dr.close(n)},cwd:()=>dr.currentPath,chdir(r){var e=dr.lookupPath(r,{follow:!0});if(null===e.node)throw new dr.ErrnoError(44);if(!dr.isDir(e.node.mode))throw new dr.ErrnoError(54);var t=dr.nodePermissions(e.node,"x");if(t)throw new dr.ErrnoError(t);dr.currentPath=e.path},createDefaultDirectories(){dr.mkdir("/tmp"),dr.mkdir("/home"),dr.mkdir("/home/web_user")},createDefaultDevices(){dr.mkdir("/dev"),dr.registerDevice(dr.makedev(1,3),{read:()=>0,write:(r,e,t,n,o)=>n,llseek:()=>0}),dr.mkdev("/dev/null",dr.makedev(1,3)),er.register(dr.makedev(5,0),er.default_tty_ops),er.register(dr.makedev(6,0),er.default_tty1_ops),dr.mkdev("/dev/tty",dr.makedev(5,0)),dr.mkdev("/dev/tty1",dr.makedev(6,0));var r=new Uint8Array(1024),e=0,t=()=>(0===e&&(e=G(r).byteLength),r[--e]);dr.createDevice("/dev","random",t),dr.createDevice("/dev","urandom",t),dr.mkdir("/dev/shm"),dr.mkdir("/dev/shm/tmp")},createSpecialDirectories(){dr.mkdir("/proc");var r=dr.mkdir("/proc/self");dr.mkdir("/proc/self/fd"),dr.mount({mount(){var e=dr.createNode(r,"fd",16895,73);return e.node_ops={lookup(r,e){var t=+e,n=dr.getStreamChecked(t),o={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>n.path}};return o.parent=o,o}},e}},{},"/proc/self/fd")},createStandardStreams(r,e,t){r?dr.createDevice("/dev","stdin",r):dr.symlink("/dev/tty","/dev/stdin"),e?dr.createDevice("/dev","stdout",null,e):dr.symlink("/dev/tty","/dev/stdout"),t?dr.createDevice("/dev","stderr",null,t):dr.symlink("/dev/tty1","/dev/stderr"),dr.open("/dev/stdin",0),dr.open("/dev/stdout",1),dr.open("/dev/stderr",1)},staticInit(){dr.nameTable=new Array(4096),dr.mount(or,{},"/"),dr.createDefaultDirectories(),dr.createDefaultDevices(),dr.createSpecialDirectories(),dr.filesystems={MEMFS:or}},init(r,e,t){dr.initialized=!0,r??=i.stdin,e??=i.stdout,t??=i.stderr,dr.createStandardStreams(r,e,t)},quit(){dr.initialized=!1;for(var r=0;r<dr.streams.length;r++){var e=dr.streams[r];e&&dr.close(e)}},findObject(r,e){var t=dr.analyzePath(r,e);return t.exists?t.object:null},analyzePath(r,e){try{r=(n=dr.lookupPath(r,{follow:!e})).path}catch(r){}var t={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=dr.lookupPath(r,{parent:!0});t.parentExists=!0,t.parentPath=n.path,t.parentObject=n.node,t.name=X.basename(r),n=dr.lookupPath(r,{follow:!e}),t.exists=!0,t.path=n.path,t.object=n.node,t.name=n.node.name,t.isRoot="/"===n.path}catch(r){t.error=r.errno}return t},createPath(r,e,t,n){r="string"==typeof r?r:dr.getPath(r);for(var o=e.split("/").reverse();o.length;){var a=o.pop();if(a){var i=X.join2(r,a);try{dr.mkdir(i)}catch(r){}r=i}}return i},createFile(r,e,t,n,o){var a=X.join2("string"==typeof r?r:dr.getPath(r),e),i=ur(n,o);return dr.create(a,i)},createDataFile(r,e,t,n,o,a){var i=e;r&&(r="string"==typeof r?r:dr.getPath(r),i=e?X.join2(r,e):r);var s=ur(n,o),l=dr.create(i,s);if(t){if("string"==typeof t){for(var u=new Array(t.length),d=0,c=t.length;d<c;++d)u[d]=t.charCodeAt(d);t=u}dr.chmod(l,146|s);var f=dr.open(l,577);dr.write(f,t,0,t.length,0,a),dr.close(f),dr.chmod(l,s)}},createDevice(r,e,t,n){var o=X.join2("string"==typeof r?r:dr.getPath(r),e),a=ur(!!t,!!n);dr.createDevice.major??=64;var i=dr.makedev(dr.createDevice.major++,0);return dr.registerDevice(i,{open(r){r.seekable=!1},close(r){n?.buffer?.length&&n(10)},read(r,e,n,o,a){for(var i=0,s=0;s<o;s++){var l;try{l=t()}catch(r){throw new dr.ErrnoError(29)}if(void 0===l&&0===i)throw new dr.ErrnoError(6);if(null==l)break;i++,e[n+s]=l}return i&&(r.node.timestamp=Date.now()),i},write(r,e,t,o,a){for(var i=0;i<o;i++)try{n(e[t+i])}catch(r){throw new dr.ErrnoError(29)}return o&&(r.node.timestamp=Date.now()),i}}),dr.mkdev(o,a,i)},forceLoadFile(r){if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");try{r.contents=(void 0)(r.url),r.usedBytes=r.contents.length}catch(r){throw new dr.ErrnoError(29)}},createLazyFile(r,e,t,n,o){if("undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var a={isDevice:!1,url:t},i=dr.createFile(r,e,a,n,o);a.contents?i.contents=a.contents:a.url&&(i.contents=null,i.url=a.url),Object.defineProperties(i,{usedBytes:{get:function(){return this.contents.length}}});var s={};function l(r,e,t,n,o){var a=r.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(a.slice)for(var s=0;s<i;s++)e[t+s]=a[o+s];else for(s=0;s<i;s++)e[t+s]=a.get(o+s);return i}return Object.keys(i.stream_ops).forEach((r=>{var e=i.stream_ops[r];s[r]=(...r)=>(dr.forceLoadFile(i),e(...r))})),s.read=(r,e,t,n,o)=>(dr.forceLoadFile(i),l(r,e,t,n,o)),s.mmap=(r,e,t,n,o)=>{dr.forceLoadFile(i);var a=nr();if(!a)throw new dr.ErrnoError(48);return l(r,m,a,e,t),{ptr:a,allocated:!0}},i.stream_ops=s,i}},cr=(r,e)=>r?J(p,r,e):"",fr={DEFAULT_POLLMASK:5,calculateAt(r,e,t){if(X.isAbs(e))return e;var n;if(n=-100===r?dr.cwd():fr.getStreamFromFD(r).path,0==e.length){if(!t)throw new dr.ErrnoError(44);return n}return X.join2(n,e)},doStat(r,e,t){var n=r(e);y[t>>2]=n.dev,y[t+4>>2]=n.mode,g[t+8>>2]=n.nlink,y[t+12>>2]=n.uid,y[t+16>>2]=n.gid,y[t+20>>2]=n.rdev,R=[n.size>>>0,(x=n.size,+Math.abs(x)>=1?x>0?+Math.floor(x/4294967296)>>>0:~~+Math.ceil((x-+(~~x>>>0))/4294967296)>>>0:0)],y[t+24>>2]=R[0],y[t+28>>2]=R[1],y[t+32>>2]=4096,y[t+36>>2]=n.blocks;var o=n.atime.getTime(),a=n.mtime.getTime(),i=n.ctime.getTime();return R=[Math.floor(o/1e3)>>>0,(x=Math.floor(o/1e3),+Math.abs(x)>=1?x>0?+Math.floor(x/4294967296)>>>0:~~+Math.ceil((x-+(~~x>>>0))/4294967296)>>>0:0)],y[t+40>>2]=R[0],y[t+44>>2]=R[1],g[t+48>>2]=o%1e3*1e3*1e3,R=[Math.floor(a/1e3)>>>0,(x=Math.floor(a/1e3),+Math.abs(x)>=1?x>0?+Math.floor(x/4294967296)>>>0:~~+Math.ceil((x-+(~~x>>>0))/4294967296)>>>0:0)],y[t+56>>2]=R[0],y[t+60>>2]=R[1],g[t+64>>2]=a%1e3*1e3*1e3,R=[Math.floor(i/1e3)>>>0,(x=Math.floor(i/1e3),+Math.abs(x)>=1?x>0?+Math.floor(x/4294967296)>>>0:~~+Math.ceil((x-+(~~x>>>0))/4294967296)>>>0:0)],y[t+72>>2]=R[0],y[t+76>>2]=R[1],g[t+80>>2]=i%1e3*1e3*1e3,R=[n.ino>>>0,(x=n.ino,+Math.abs(x)>=1?x>0?+Math.floor(x/4294967296)>>>0:~~+Math.ceil((x-+(~~x>>>0))/4294967296)>>>0:0)],y[t+88>>2]=R[0],y[t+92>>2]=R[1],0},doMsync(r,e,t,n,o){if(!dr.isFile(e.node.mode))throw new dr.ErrnoError(43);if(2&n)return 0;var a=p.slice(r,r+t);dr.msync(e,a,o,t,n)},getStreamFromFD:r=>dr.getStreamChecked(r),varargs:void 0,getStr:r=>cr(r)},hr={},mr=r=>{for(;r.length;){var e=r.pop();r.pop()(e)}};function pr(r){return this.fromWireType(g[r>>2])}var vr,wr,yr,gr={},Er={},_r={},br=r=>{throw new vr(r)},kr=(r,e,t)=>{function n(e){var n=t(e);n.length!==r.length&&br("Mismatched type converter count");for(var o=0;o<r.length;++o)Ar(r[o],n[o])}r.forEach((r=>_r[r]=e));var o=new Array(e.length),a=[],i=0;e.forEach(((r,e)=>{Er.hasOwnProperty(r)?o[e]=Er[r]:(a.push(r),gr.hasOwnProperty(r)||(gr[r]=[]),gr[r].push((()=>{o[e]=Er[r],++i===a.length&&n(o)})))})),0===a.length&&n(o)},Fr=r=>{for(var e="",t=r;p[t];)e+=wr[p[t++]];return e},Pr=r=>{throw new yr(r)};function Ar(r,e,t={}){return function(r,e,t={}){var n=e.name;if(r||Pr(`type "${n}" must have a positive integer typeid pointer`),Er.hasOwnProperty(r)){if(t.ignoreDuplicateRegistrations)return;Pr(`Cannot register type '${n}' twice`)}if(Er[r]=e,delete _r[r],gr.hasOwnProperty(r)){var o=gr[r];delete gr[r],o.forEach((r=>r()))}}(r,e,t)}var Sr,Dr,$r,Cr=[],Tr=[],jr=r=>{r>9&&0==--Tr[r+1]&&(Tr[r]=void 0,Cr.push(r))},Mr=r=>(r||Pr("Cannot use deleted val. handle = "+r),Tr[r]),xr=r=>{switch(r){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const e=Cr.pop()||Tr.length;return Tr[e]=r,Tr[e+1]=1,e}}},Rr={name:"emscripten::val",fromWireType:r=>{var e=Mr(r);return jr(r),e},toWireType:(r,e)=>xr(e),argPackAdvance:8,readValueFromPointer:pr,destructorFunction:null},Nr=(r,e)=>{switch(e){case 4:return function(r){return this.fromWireType(E[r>>2])};case 8:return function(r){return this.fromWireType(_[r>>3])};default:throw new TypeError(`invalid float width (${e}): ${r}`)}},zr=(r,e)=>Object.defineProperty(e,"name",{value:r}),Or=(r,e,t)=>{if(void 0===r[e].overloadTable){var n=r[e];r[e]=function(...n){return r[e].overloadTable.hasOwnProperty(n.length)||Pr(`Function '${t}' called with an invalid number of arguments (${n.length}) - expects one of (${r[e].overloadTable})!`),r[e].overloadTable[n.length].apply(this,n)},r[e].overloadTable=[],r[e].overloadTable[n.argCount]=n}},Wr=(r,e,t)=>{i.hasOwnProperty(r)?((void 0===t||void 0!==i[r].overloadTable&&void 0!==i[r].overloadTable[t])&&Pr(`Cannot register public name '${r}' twice`),Or(i,r,r),i[r].overloadTable.hasOwnProperty(t)&&Pr(`Cannot register multiple overloads of a function with the same number of arguments (${t})!`),i[r].overloadTable[t]=e):(i[r]=e,i[r].argCount=t)},Ur=(r,e,t)=>{i.hasOwnProperty(r)||br("Replacing nonexistent public symbol"),void 0!==i[r].overloadTable&&void 0!==t?i[r].overloadTable[t]=e:(i[r]=e,i[r].argCount=t)},Br=[],Lr=r=>{var e=Br[r];return e||(r>=Br.length&&(Br.length=r+1),Br[r]=e=Sr.get(r)),e},Ir=(r,e)=>{var t=(r=Fr(r)).includes("j")?((r,e)=>(...t)=>((r,e,t=[])=>r.includes("j")?((r,e,t)=>(r=r.replace(/p/g,"i"),(0,i["dynCall_"+r])(e,...t)))(r,e,t):Lr(e)(...t))(r,e,t))(r,e):Lr(e);return"function"!=typeof t&&Pr(`unknown function pointer with signature ${r}: ${e}`),t},Hr=r=>{var e=ge(r),t=Fr(e);return _e(e),t},Vr=(r,e,t)=>{switch(e){case 1:return t?r=>m[r]:r=>p[r];case 2:return t?r=>v[r>>1]:r=>w[r>>1];case 4:return t?r=>y[r>>2]:r=>g[r>>2];default:throw new TypeError(`invalid integer width (${e}): ${r}`)}},qr=(r,e,t)=>rr(r,p,e,t),Xr="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0,Gr=(r,e)=>{for(var t=r,n=t>>1,o=n+e/2;!(n>=o)&&w[n];)++n;if((t=n<<1)-r>32&&Xr)return Xr.decode(p.subarray(r,t));for(var a="",i=0;!(i>=e/2);++i){var s=v[r+2*i>>1];if(0==s)break;a+=String.fromCharCode(s)}return a},Kr=(r,e,t)=>{if(t??=2147483647,t<2)return 0;for(var n=e,o=(t-=2)<2*r.length?t/2:r.length,a=0;a<o;++a){var i=r.charCodeAt(a);v[e>>1]=i,e+=2}return v[e>>1]=0,e-n},Yr=r=>2*r.length,Jr=(r,e)=>{for(var t=0,n="";!(t>=e/4);){var o=y[r+4*t>>2];if(0==o)break;if(++t,o>=65536){var a=o-65536;n+=String.fromCharCode(55296|a>>10,56320|1023&a)}else n+=String.fromCharCode(o)}return n},Qr=(r,e,t)=>{if(t??=2147483647,t<4)return 0;for(var n=e,o=n+t-4,a=0;a<r.length;++a){var i=r.charCodeAt(a);if(i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),y[e>>2]=i,(e+=4)+4>o)break}return y[e>>2]=0,e-n},Zr=r=>{for(var e=0,t=0;t<r.length;++t){var n=r.charCodeAt(t);n>=55296&&n<=57343&&++t,e+=4}return e},re=(r,e)=>{var t=Er[r];return void 0===t&&Pr(`${e} has unknown type ${Hr(r)}`),t},ee=(r,e,t)=>{var n=[],o=r.toWireType(n,t);return n.length&&(g[e>>2]=xr(n)),o},te={},ne=r=>{var e=te[r];return void 0===e?Fr(r):e},oe=[],ae=()=>{if("object"==typeof globalThis)return globalThis;function r(r){r.$$$embind_global$$$=r;var e="object"==typeof $$$embind_global$$$&&r.$$$embind_global$$$==r;return e||delete r.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof o.c&&r(o.c)?$$$embind_global$$$=o.c:"object"==typeof self&&r(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")},ie=Reflect.construct,se=r=>{var e=(r-h.buffer.byteLength+65535)/65536|0;try{return h.grow(e),F(),1}catch(r){}},le={},ue=()=>{if(!ue.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:u||"./this.program"};for(var e in le)void 0===le[e]?delete r[e]:r[e]=le[e];var t=[];for(var e in r)t.push(`${e}=${r[e]}`);ue.strings=t}return ue.strings},de=(r,e)=>{r<128?e.push(r):e.push(r%128|128,r>>7)},ce=[],fe=(r,e)=>{Sr.set(r,e),Br[r]=Sr.get(r)},he=dr.createPath,me=dr.createLazyFile,pe=dr.createDevice;dr.createPreloadedFile=lr,dr.staticInit(),i.FS_createPath=dr.createPath,i.FS_createDataFile=dr.createDataFile,i.FS_createPreloadedFile=dr.createPreloadedFile,i.FS_unlink=dr.unlink,i.FS_createLazyFile=dr.createLazyFile,i.FS_createDevice=dr.createDevice,or.doesNotExistError=new dr.ErrnoError(44),or.doesNotExistError.stack="<generic error, no stack>",vr=i.InternalError=class extends Error{constructor(r){super(r),this.name="InternalError"}},(()=>{for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);wr=r})(),yr=i.BindingError=class extends Error{constructor(r){super(r),this.name="BindingError"}},Tr.push(0,1,void 0,1,null,1,!0,1,!1,1),i.count_emval_handles=()=>Tr.length/2-5-Cr.length,Dr=i.UnboundTypeError=((r,e)=>{var t=zr(e,(function(r){this.name=e,this.message=r;var t=new Error(r).stack;void 0!==t&&(this.stack=this.toString()+"\n"+t.replace(/^Error(:[^\n]*)?\n/,""))}));return t.prototype=Object.create(r.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return void 0===this.message?this.name:`${this.name}: ${this.message}`},t})(Error,"UnboundTypeError");var ve,we={i:(r,e,t)=>{throw new H(r).init(e,t),r},w:function(r,e,t){fr.varargs=t;try{var n=fr.getStreamFromFD(r);switch(e){case 0:if((o=V())<0)return-28;for(;dr.streams[o];)o++;return dr.dupStream(n,o).fd;case 1:case 2:case 13:case 14:return 0;case 3:return n.flags;case 4:var o=V();return n.flags|=o,0;case 12:return o=q(),v[o+0>>1]=2,0}return-28}catch(r){if(void 0===dr||"ErrnoError"!==r.name)throw r;return-r.errno}},M:function(r,e,t){fr.varargs=t;try{var n=fr.getStreamFromFD(r);switch(e){case 21509:case 21510:case 21511:case 21512:case 21524:case 21515:return n.tty?0:-59;case 21505:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcgets){var o=n.tty.ops.ioctl_tcgets(n),a=q();y[a>>2]=o.c_iflag||0,y[a+4>>2]=o.c_oflag||0,y[a+8>>2]=o.c_cflag||0,y[a+12>>2]=o.c_lflag||0;for(var i=0;i<32;i++)m[a+i+17]=o.c_cc[i]||0;return 0}return 0;case 21506:case 21507:case 21508:if(!n.tty)return-59;if(n.tty.ops.ioctl_tcsets){a=q();var s=y[a>>2],l=y[a+4>>2],u=y[a+8>>2],d=y[a+12>>2],c=[];for(i=0;i<32;i++)c.push(m[a+i+17]);return n.tty.ops.ioctl_tcsets(n.tty,e,{c_iflag:s,c_oflag:l,c_cflag:u,c_lflag:d,c_cc:c})}return 0;case 21519:return n.tty?(a=q(),y[a>>2]=0,0):-59;case 21520:return n.tty?-28:-59;case 21531:return a=q(),dr.ioctl(n,e,a);case 21523:if(!n.tty)return-59;if(n.tty.ops.ioctl_tiocgwinsz){var f=n.tty.ops.ioctl_tiocgwinsz(n.tty);a=q(),v[a>>1]=f[0],v[a+2>>1]=f[1]}return 0;default:return-28}}catch(r){if(void 0===dr||"ErrnoError"!==r.name)throw r;return-r.errno}},N:function(r,e,t,n){fr.varargs=n;try{e=fr.getStr(e),e=fr.calculateAt(r,e);var o=n?V():0;return dr.open(e,t,o).fd}catch(r){if(void 0===dr||"ErrnoError"!==r.name)throw r;return-r.errno}},P:()=>j(""),V:r=>{var e=hr[r];delete hr[r];var t=e.rawConstructor,n=e.rawDestructor,o=e.fields,a=o.map((r=>r.getterReturnType)).concat(o.map((r=>r.setterArgumentType)));kr([r],a,(r=>{var a={};return o.forEach(((e,t)=>{var n=e.fieldName,i=r[t],s=e.getter,l=e.getterContext,u=r[t+o.length],d=e.setter,c=e.setterContext;a[n]={read:r=>i.fromWireType(s(l,r)),write:(r,e)=>{var t=[];d(c,r,u.toWireType(t,e)),mr(t)}}})),[{name:e.name,fromWireType:r=>{var e={};for(var t in a)e[t]=a[t].read(r);return n(r),e},toWireType:(r,e)=>{for(var o in a)if(!(o in e))throw new TypeError(`Missing field: "${o}"`);var i=t();for(o in a)a[o].write(i,e[o]);return null!==r&&r.push(n,i),i},argPackAdvance:8,readValueFromPointer:pr,destructorFunction:n}]}))},F:(r,e,t,n,o)=>{},T:(r,e,t,n)=>{Ar(r,{name:e=Fr(e),fromWireType:function(r){return!!r},toWireType:function(r,e){return e?t:n},argPackAdvance:8,readValueFromPointer:function(r){return this.fromWireType(p[r])},destructorFunction:null})},S:r=>Ar(r,Rr),y:(r,e,t)=>{Ar(r,{name:e=Fr(e),fromWireType:r=>r,toWireType:(r,e)=>e,argPackAdvance:8,readValueFromPointer:Nr(e,t),destructorFunction:null})},q:(r,e,t,n,o,a,i,s)=>{var l=((r,e)=>{for(var t=[],n=0;n<r;n++)t.push(g[e+4*n>>2]);return t})(e,t);r=(r=>{const e=(r=r.trim()).indexOf("(");return-1!==e?r.substr(0,e):r})(r=Fr(r)),o=Ir(n,o),Wr(r,(function(){((r,e)=>{var t=[],n={};throw e.forEach((function r(e){n[e]||Er[e]||(_r[e]?_r[e].forEach(r):(t.push(e),n[e]=!0))})),new Dr(`${r}: `+t.map(Hr).join([", "]))})(`Cannot call ${r} due to unbound types`,l)}),e-1),kr([],l,(t=>{var n=[t[0],null].concat(t.slice(1));return Ur(r,function(r,e,t,n,o){var a=e.length;a<2&&Pr("argTypes array size mismatch! Must at least get return value and 'this' types!"),e[1];var i=function(r){for(var e=1;e<r.length;++e)if(null!==r[e]&&void 0===r[e].destructorFunction)return!0;return!1}(e),s="void"!==e[0].name,l=a-2,u=new Array(l),d=[],c=[];return zr(r,(function(...r){c.length=0,d.length=1,d[0]=o;for(var t=0;t<l;++t)u[t]=e[t+2].toWireType(c,r[t]),d.push(u[t]);return function(r){if(i)mr(c);else for(var t=2;t<e.length;t++){var n=1===t?void 0:u[t-2];null!==e[t].destructorFunction&&e[t].destructorFunction(n)}if(s)return e[0].fromWireType(r)}(n(...d))}))}(r,n,0,o,a),e-1),[]}))},c:(r,e,t,n,o)=>{e=Fr(e);var a=r=>r;if(0===n){var i=32-8*t;a=r=>r<<i>>>i}var s=e.includes("unsigned");Ar(r,{name:e,fromWireType:a,toWireType:s?function(r,e){return this.name,e>>>0}:function(r,e){return this.name,e},argPackAdvance:8,readValueFromPointer:Vr(e,t,0!==n),destructorFunction:null})},b:(r,e,t)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(r){var e=g[r>>2],t=g[r+4>>2];return new n(m.buffer,t,e)}Ar(r,{name:t=Fr(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},x:(r,e)=>{var t="std::string"===(e=Fr(e));Ar(r,{name:e,fromWireType(r){var e,n=g[r>>2],o=r+4;if(t)for(var a=o,i=0;i<=n;++i){var s=o+i;if(i==n||0==p[s]){var l=cr(a,s-a);void 0===e?e=l:(e+=String.fromCharCode(0),e+=l),a=s+1}}else{var u=new Array(n);for(i=0;i<n;++i)u[i]=String.fromCharCode(p[o+i]);e=u.join("")}return _e(r),e},toWireType(r,e){var n;e instanceof ArrayBuffer&&(e=new Uint8Array(e));var o="string"==typeof e;o||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||Pr("Cannot pass non-string to std::string"),n=t&&o?Z(e):e.length;var a=Ee(4+n+1),i=a+4;if(g[a>>2]=n,t&&o)qr(e,i,n+1);else if(o)for(var s=0;s<n;++s){var l=e.charCodeAt(s);l>255&&(_e(i),Pr("String has UTF-16 code units that do not fit in 8 bits")),p[i+s]=l}else for(s=0;s<n;++s)p[i+s]=e[s];return null!==r&&r.push(_e,a),a},argPackAdvance:8,readValueFromPointer:pr,destructorFunction(r){_e(r)}})},p:(r,e,t)=>{var n,o,a,i;t=Fr(t),2===e?(n=Gr,o=Kr,i=Yr,a=r=>w[r>>1]):4===e&&(n=Jr,o=Qr,i=Zr,a=r=>g[r>>2]),Ar(r,{name:t,fromWireType:r=>{for(var t,o=g[r>>2],i=r+4,s=0;s<=o;++s){var l=r+4+s*e;if(s==o||0==a(l)){var u=n(i,l-i);void 0===t?t=u:(t+=String.fromCharCode(0),t+=u),i=l+e}}return _e(r),t},toWireType:(r,n)=>{"string"!=typeof n&&Pr(`Cannot pass non-string to C++ string type ${t}`);var a=i(n),s=Ee(4+a+e);return g[s>>2]=a/e,o(n,s+4,a+e),null!==r&&r.push(_e,s),s},argPackAdvance:8,readValueFromPointer:pr,destructorFunction(r){_e(r)}})},W:(r,e,t,n,o,a)=>{hr[r]={name:Fr(e),rawConstructor:Ir(t,n),rawDestructor:Ir(o,a),fields:[]}},k:(r,e,t,n,o,a,i,s,l,u)=>{hr[r].fields.push({fieldName:Fr(e),getterReturnType:t,getter:Ir(n,o),getterContext:a,setterArgumentType:i,setter:Ir(s,l),setterContext:u})},U:(r,e)=>{Ar(r,{isVoid:!0,name:e=Fr(e),argPackAdvance:0,fromWireType:()=>{},toWireType:(r,e)=>{}})},R:r=>{do{var e=g[r>>2],t=g[(r+=4)>>2],n=g[(r+=4)>>2];r+=4;var o=cr(e);dr.createPath("/",X.dirname(o),!0,!0),dr.createDataFile(o,null,m.subarray(n,n+t),!0,!0,!0)}while(g[r>>2])},O:(r,e,t)=>p.copyWithin(r,e,e+t),G:()=>{throw 1/0},Y:(r,e,t)=>(r=Mr(r),e=re(e,"emval::as"),ee(e,t,r)),z:(r,e,t,n,o)=>(r=oe[r])(e=Mr(e),e[t=ne(t)],n,o),a:jr,Z:r=>0===r?xr(ae()):(r=ne(r),xr(ae()[r])),A:(r,e,t)=>{var n=((r,e)=>{for(var t=new Array(r),n=0;n<r;++n)t[n]=re(g[e+4*n>>2],"parameter "+n);return t})(r,e),o=n.shift();r--;var a=new Array(r),i=`methodCaller<(${n.map((r=>r.name)).join(", ")}) => ${o.name}>`;return(r=>{var e=oe.length;return oe.push(r),e})(zr(i,((e,i,s,l)=>{for(var u=0,d=0;d<r;++d)a[d]=n[d].readValueFromPointer(l+u),u+=n[d].argPackAdvance;var c=1===t?ie(i,a):i.apply(e,a);return ee(o,s,c)})))},m:(r,e)=>(r=Mr(r),e=Mr(e),xr(r[e])),g:r=>{r>9&&(Tr[r+1]+=1)},B:()=>xr([]),h:r=>xr(ne(r)),r:r=>{var e=Mr(r);mr(e),jr(r)},X:(r,e,t)=>{r=Mr(r),e=Mr(e),t=Mr(t),r[e]=t},l:(r,e)=>{var t=(r=re(r,"_emval_take_value")).readValueFromPointer(e);return xr(t)},I:(r,e,t,n)=>{var o=(new Date).getFullYear(),a=new Date(o,0,1),i=new Date(o,6,1),s=a.getTimezoneOffset(),l=i.getTimezoneOffset(),u=Math.max(s,l);g[r>>2]=60*u,y[e>>2]=Number(s!=l);var d=r=>{var e=r>=0?"-":"+",t=Math.abs(r);return`UTC${e}${String(Math.floor(t/60)).padStart(2,"0")}${String(t%60).padStart(2,"0")}`},c=d(s),f=d(l);l<s?(qr(c,t,17),qr(f,n,17)):(qr(c,n,17),qr(f,t,17))},H:r=>{var e=p.length,t=2147483648;if((r>>>=0)>t)return!1;for(var n=1;n<=4;n*=2){var o=e*(1+.2/n);o=Math.min(o,r+100663296);var a=Math.min(t,tr(Math.max(r,o),65536));if(se(a))return!0}return!1},J:(r,e)=>{var t=0;return ue().forEach(((n,o)=>{var a=e+t;g[r+4*o>>2]=a,((r,e)=>{for(var t=0;t<r.length;++t)m[e++]=r.charCodeAt(t);m[e]=0})(n,a),t+=n.length+1})),0},K:(r,e)=>{var t=ue();g[r>>2]=t.length;var n=0;return t.forEach((r=>n+=r.length+1)),g[e>>2]=n,0},Q:(r,e)=>{(r=>{B||(i.onExit?.(r),k=!0),((r,e)=>{throw e})(0,new W(r))})(r)},u:function(r){try{var e=fr.getStreamFromFD(r);return dr.close(e),0}catch(r){if(void 0===dr||"ErrnoError"!==r.name)throw r;return r.errno}},L:function(r,e,t,n){try{var o=((r,e,t)=>{for(var n=0,o=0;o<t;o++){var a=g[e>>2],i=g[e+4>>2];e+=8;var s=dr.read(r,m,a,i,undefined);if(s<0)return-1;if(n+=s,s<i)break}return n})(fr.getStreamFromFD(r),e,t);return g[n>>2]=o,0}catch(r){if(void 0===dr||"ErrnoError"!==r.name)throw r;return r.errno}},E:function(r,e,t,n,o){var a=((r,e)=>e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN)(e,t);try{if(isNaN(a))return 61;var i=fr.getStreamFromFD(r);return dr.llseek(i,a,n),R=[i.position>>>0,(x=i.position,+Math.abs(x)>=1?x>0?+Math.floor(x/4294967296)>>>0:~~+Math.ceil((x-+(~~x>>>0))/4294967296)>>>0:0)],y[o>>2]=R[0],y[o+4>>2]=R[1],i.getdents&&0===a&&0===n&&(i.getdents=null),0}catch(r){if(void 0===dr||"ErrnoError"!==r.name)throw r;return r.errno}},v:function(r,e,t,n){try{var o=((r,e,t)=>{for(var n=0,o=0;o<t;o++){var a=g[e>>2],i=g[e+4>>2];e+=8;var s=dr.write(r,m,a,i,undefined);if(s<0)return-1;if(n+=s,s<i)break}return n})(fr.getStreamFromFD(r),e,t);return g[n>>2]=o,0}catch(r){if(void 0===dr||"ErrnoError"!==r.name)throw r;return r.errno}},n:function(r,e){var t=I();try{return Lr(r)(e)}catch(r){if(L(t),r!==r+0)throw r;be(1,0)}},j:function(r,e,t){var n=I();try{return Lr(r)(e,t)}catch(r){if(L(n),r!==r+0)throw r;be(1,0)}},o:function(r,e,t,n){var o=I();try{return Lr(r)(e,t,n)}catch(r){if(L(o),r!==r+0)throw r;be(1,0)}},s:function(r,e,t,n,o){var a=I();try{return Lr(r)(e,t,n,o)}catch(r){if(L(a),r!==r+0)throw r;be(1,0)}},D:function(r,e,t,n,o,a,i,s,l,u){var d=I();try{return Lr(r)(e,t,n,o,a,i,s,l,u)}catch(r){if(L(d),r!==r+0)throw r;be(1,0)}},t:function(r){var e=I();try{Lr(r)()}catch(r){if(L(e),r!==r+0)throw r;be(1,0)}},d:function(r,e){var t=I();try{Lr(r)(e)}catch(r){if(L(t),r!==r+0)throw r;be(1,0)}},C:function(r,e,t,n){var o=I();try{Lr(r)(e,t,n)}catch(r){if(L(o),r!==r+0)throw r;be(1,0)}},e:function(r,e,t){var n=I();try{Lr(r)(e,t)}catch(r){if(L(n),r!==r+0)throw r;be(1,0)}},f:function(r,e,t,n){var o=I();try{Lr(r)(e,t,n)}catch(r){if(L(o),r!==r+0)throw r;be(1,0)}}},ye=function(){function r(r,e){return ye=r.exports,h=ye._,F(),Sr=ye.ba,function(r){A.unshift(r)}(ye.$),T(),ye}C();var e={a:we};if(i.instantiateWasm)try{return i.instantiateWasm(e,r)}catch(r){f(`Module.instantiateWasm callback failed with error: ${r}`),n(r)}return M??=function(){var r="lyr3DWorker.wasm";return N(r)?r:function(r){return i.locateFile?i.locateFile(r,d):d+r}(r)}(),function(r,e,t,n){return r||"function"!=typeof WebAssembly.instantiateStreaming||N(e)||"function"!=typeof fetch?O(e,t,n):fetch(e,{credentials:"same-origin"}).then((r=>WebAssembly.instantiateStreaming(r,t).then(n,(function(r){return f(`wasm streaming compile failed: ${r}`),f("falling back to ArrayBuffer instantiation"),O(e,t,n)}))))}(b,M,e,(function(e){r(e.instance)})).catch(n),{}}(),ge=r=>(ge=ye.aa)(r),Ee=i._malloc=r=>(Ee=i._malloc=ye.ca)(r),_e=i._free=r=>(_e=i._free=ye.da)(r),be=(r,e)=>(be=ye.ea)(r,e),ke=r=>(ke=ye.fa)(r),Fe=()=>(Fe=ye.ga)();function Pe(){function r(){ve||(ve=!0,i.calledRun=!0,k||(i.noFSInit||dr.initialized||dr.init(),dr.ignorePermissions=!1,U(A),t(i),i.onRuntimeInitialized?.(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)r=i.postRun.shift(),S.unshift(r);var r;U(S)}()))}D>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)r=i.preRun.shift(),P.unshift(r);var r;U(P)}(),D>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((()=>{setTimeout((()=>i.setStatus("")),1),r()}),1)):r()))}if(i.dynCall_viji=(r,e,t,n,o)=>(i.dynCall_viji=ye.ha)(r,e,t,n,o),i.dynCall_ji=(r,e)=>(i.dynCall_ji=ye.ia)(r,e),i.dynCall_jiji=(r,e,t,n,o)=>(i.dynCall_jiji=ye.ja)(r,e,t,n,o),i.dynCall_viijii=(r,e,t,n,o,a,s)=>(i.dynCall_viijii=ye.ka)(r,e,t,n,o,a,s),i.dynCall_iiiiij=(r,e,t,n,o,a,s)=>(i.dynCall_iiiiij=ye.la)(r,e,t,n,o,a,s),i.dynCall_iiiiijj=(r,e,t,n,o,a,s,l,u)=>(i.dynCall_iiiiijj=ye.ma)(r,e,t,n,o,a,s,l,u),i.dynCall_iiiiiijj=(r,e,t,n,o,a,s,l,u,d)=>(i.dynCall_iiiiiijj=ye.na)(r,e,t,n,o,a,s,l,u,d),i.___emscripten_embedded_file_data=1536624,i.addRunDependency=C,i.removeRunDependency=T,i.addFunction=(r,e)=>{var t=(r=>($r||($r=new WeakMap,((r,e)=>{if($r)for(var t=0;t<0+e;t++){var n=Lr(t);n&&$r.set(n,t)}})(0,Sr.length)),$r.get(r)||0))(r);if(t)return t;var n=(()=>{if(ce.length)return ce.pop();try{Sr.grow(1)}catch(r){if(!(r instanceof RangeError))throw r;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return Sr.length-1})();try{fe(n,r)}catch(t){if(!(t instanceof TypeError))throw t;var o=((r,e)=>{if("function"==typeof WebAssembly.Function)return new WebAssembly.Function((r=>{for(var e={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},t={parameters:[],results:"v"==r[0]?[]:[e[r[0]]]},n=1;n<r.length;++n)t.parameters.push(e[r[n]]);return t})(e),r);var t=[1];((r,e)=>{var t=r.slice(0,1),n=r.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96),de(n.length,e);for(var a=0;a<n.length;++a)e.push(o[n[a]]);"v"==t?e.push(0):e.push(1,o[t])})(e,t);var n=[0,97,115,109,1,0,0,0,1];de(t.length,n),n.push(...t),n.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var o=new WebAssembly.Module(new Uint8Array(n));return new WebAssembly.Instance(o,{e:{f:r}}).exports.f})(r,e);fe(n,o)}return $r.set(r,n),n},i.UTF8ToString=cr,i.FS_createPreloadedFile=lr,i.FS_unlink=r=>dr.unlink(r),i.FS_createPath=he,i.FS_createDevice=pe,i.FS_createDataFile=ir,i.FS_createLazyFile=me,$=function r(){ve||Pe(),ve||($=r)},i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Pe(),s},r.exports=t),a.exports;var r,e,t}()),s=Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"}))},11053:(r,e,t)=>{t.d(e,{c:()=>n,g:()=>o});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}}}]);