@arcgis/core 4.24.0-next.20220607 → 4.24.0-next.20220610
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/Analysis.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade.d.ts +4 -0
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{4d2181bde97983ecac8b.js → 03ddf44e6fb8bf9db3ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{2e2d7f5952934af43fd7.js → 04034dabc8e0a489b0f8.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7168ff8f26ca2537080.js → 0747c28fce0b344dc89b.js} +1 -1
- package/assets/esri/core/workers/chunks/1e4e5d147263e98536bc.js +1 -0
- package/assets/esri/core/workers/chunks/{cbe98327181d8d7ad9e5.js → 262fabdc409d55831ffa.js} +1 -1
- package/assets/esri/core/workers/chunks/2a52c2c6edd70432f4a5.js +1 -0
- package/assets/esri/core/workers/chunks/{71d445d1e6812e03a1d7.js → 3ce7adaefc9de28d9c87.js} +1 -1
- package/assets/esri/core/workers/chunks/{c165845a117c21246b1e.js → 42aa8ce4eb7bd851475e.js} +1 -1
- package/assets/esri/core/workers/chunks/{a9a4bb1d781b1a995fb3.js → 4824926501e11d04eb4a.js} +1 -1
- package/assets/esri/core/workers/chunks/{e51420d231c286b9c062.js → 540f1ed1ea9cddc739af.js} +1 -1
- package/assets/esri/core/workers/chunks/6196cfdeb91ceba52af3.js +1 -0
- package/assets/esri/core/workers/chunks/71a4618d959a09302c51.js +1 -0
- package/assets/esri/core/workers/chunks/76fbc8eaabba62fd4f9c.js +1 -0
- package/assets/esri/core/workers/chunks/{cb906a3f03dd0805c880.js → 7cc17b716b16a6684023.js} +1 -1
- package/assets/esri/core/workers/chunks/871681c1353026cb6d4b.js +1 -0
- package/assets/esri/core/workers/chunks/{13e9e6f0b4942d79b0eb.js → 88942e9f60687ac006dc.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c5b80ba3dbfe6f6cafb.js → acb1e649cda99d4f69a5.js} +1 -1
- package/assets/esri/core/workers/chunks/b71a0a8a2f446c671161.js +1 -0
- package/assets/esri/core/workers/chunks/b8002aaa665712299121.js +1 -0
- package/assets/esri/core/workers/chunks/{e4ca3f04ca7f71b46240.js → bb3480e231934b7bb34e.js} +1 -1
- package/assets/esri/core/workers/chunks/{185da42e7cc8e440c0f0.js → c157b46b0724f3f0947e.js} +1 -1
- package/assets/esri/core/workers/chunks/{1aba8c73c62a64e0658c.js → c6af8b0903d8d934d542.js} +1 -1
- package/assets/esri/core/workers/chunks/c8402e32307a7b7eaaeb.js +1 -0
- package/assets/esri/core/workers/chunks/c8e08a956b16034d9819.js +1 -0
- package/assets/esri/core/workers/chunks/d0d2566bedc493ed0a3b.js +1 -0
- package/assets/esri/core/workers/chunks/{8152cd26ebeae910b753.js → d3c73da9c2abb59e762a.js} +1 -1
- package/assets/esri/core/workers/chunks/d828a0656e7351a74fc4.js +1 -0
- package/assets/esri/core/workers/chunks/{172368d4eb6e6f8d2bdb.js → d8b9551df1bd196d0126.js} +1 -1
- package/assets/esri/core/workers/chunks/e5c8584ae764892c324d.js +1 -0
- package/assets/esri/core/workers/chunks/{1d893ebc6f203ff1fc3d.js → efe605ff4ba2a95c14c5.js} +1 -1
- package/assets/esri/core/workers/chunks/f54d5abbb9668c45bd19.js +1 -0
- package/assets/esri/core/workers/chunks/{bd2f4a01cb71e25837ba.js → f7ba74fc4eb541c424fc.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ebed6d6f561f926bd36.js → faf6e48f9f1205fb2e43.js} +1 -1
- package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BasemapToggle.scss +6 -23
- package/assets/esri/themes/base/widgets/_Directions.scss +0 -3
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +10 -2
- package/assets/esri/themes/base/widgets/_Slider.scss +8 -3
- package/assets/esri/themes/base/widgets/_Tooltip.scss +8 -8
- package/assets/esri/themes/base/widgets/_Weather.scss +5 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ar.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bg.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_bs.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ca.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_cs.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_da.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_de.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_el.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_en.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_es.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_et.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fi.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_fr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_he.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_hu.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_id.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_it.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ja.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ko.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lt.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_lv.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nb.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_nl.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pl.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-BR.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_pt-PT.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ro.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_ru.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sk.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sl.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_sv.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_th.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_tr.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_uk.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_vi.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-CN.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-HK.json +1 -1
- package/assets/esri/widgets/BasemapToggle/t9n/BasemapToggle_zh-TW.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_en.json +1 -1
- package/chunks/RasterColorizer.glsl.js +22 -18
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/i3s.js +1 -1
- package/chunks/lclayout.js +1 -1
- package/chunks/lerc-wasm.js +1 -1
- package/chunks/libtess-asm.js +1 -1
- package/chunks/libtess.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/chunks/persistableUrlUtils.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/quantityUtils.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +471 -52
- package/layers/LineOfSightLayer.js +1 -1
- package/layers/RouteLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/RasterInfo.js +1 -1
- package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
- package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/JpgPlus.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/package.json +1 -1
- package/portal/support/urlUtils.js +5 -0
- package/renderers/support/colorRampUtils.js +1 -1
- package/rest/imageService/fetchRasterInfo.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/persistableUrlUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/webgl/Utils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/support/MemoryController.js +1 -1
- package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/BlendOptions.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
- package/views/interactive/tooltip/TranslateTooltipInfos.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/support/measurements.js +1 -1
- package/views/support/areaMeasurementUtils.js +1 -1
- package/views/support/automaticLengthMeasurementUtils.js +5 -0
- package/views/support/euclideanLengthMeasurementUtils.js +5 -0
- package/views/support/geodesicLengthMeasurementUtils.js +5 -0
- package/views/support/measurementUtils.js +5 -0
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Widget.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/AnchorElementViewModel.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/2ac6c99aacb873134f7c.js +0 -1
- package/assets/esri/core/workers/chunks/471beeb6924599209567.js +0 -1
- package/assets/esri/core/workers/chunks/5242c9badca17ba2ab25.js +0 -1
- package/assets/esri/core/workers/chunks/72c7d48408d1f8050026.js +0 -1
- package/assets/esri/core/workers/chunks/770cf0a66102100abe74.js +0 -1
- package/assets/esri/core/workers/chunks/96ff15d6c2bfca0c6061.js +0 -1
- package/assets/esri/core/workers/chunks/9c4c721d890b49697132.js +0 -1
- package/assets/esri/core/workers/chunks/af3766a2d27419c7766c.js +0 -1
- package/assets/esri/core/workers/chunks/b50bbfd75768d9a8de88.js +0 -1
- package/assets/esri/core/workers/chunks/b577ec80647cf2ece397.js +0 -1
- package/assets/esri/core/workers/chunks/c1653b6cb201ecbaabaa.js +0 -1
- package/assets/esri/core/workers/chunks/e99b58d07475bffce7ea.js +0 -1
- package/assets/esri/core/workers/chunks/f3d885aec4bca18928d4.js +0 -1
- package/assets/esri/core/workers/chunks/fc0da1dfeef041182ddf.js +0 -1
- package/views/support/lengthMeasurementUtils.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9032,4889],{78346:(e,t,r)=>{r.d(t,{bA:()=>Z});var i=r(20102),s=r(80442),n=r(95330),a=r(80903),o=r(25045),l=r(40330),c=r(92604),u=r(70586),h=r(94362),f=r(99880),d=r(68773),p=(r(2587),r(17452));const m={};function g(e){const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=m.baseUrl),m.packages?.forEach((e=>{!function(e,t){for(const r of e)if(r.name===t.name)return;e.push(t)}(t.packages,e)})),t}var y=r(41213);class x{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach((t=>{this[t]=(...r)=>e[t](...r)}))}}class w{constructor(){this._dispatcher=new x,this._workerPostMessage({type:h.Cs.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){(0,y.Y)((()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))}))}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,t,r){this._dispatcher.addEventListener(e,t,r)}removeEventListener(e,t,r){this._dispatcher.removeEventListener(e,t,r)}_workerPostMessage(e){(0,y.Y)((()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))}))}async _workerMessageHandler(e){const t=(0,h.QM)(e);if(t&&t.type===h.Cs.OPEN){const{modulePath:e,jobId:r}=t;let i=await o.default.loadWorker(e);i||(i=await import(e));const s=o.default.connect(i);this._workerPostMessage({type:h.Cs.OPENED,jobId:r,data:s})}}}var b=r(70171),I=r(17202);const v=c.Z.getLogger("esri.core.workers"),{HANDSHAKE:_}=h.Cs;let C,S;const R="Failed to create Worker. Fallback to execute module in main thread";async function k(e){return new Promise((t=>{function r(s){const n=(0,h.QM)(s);n&&n.type===_&&(e.removeEventListener("message",r),e.removeEventListener("error",i),t(e))}function i(t){t.preventDefault(),e.removeEventListener("message",r),e.removeEventListener("error",i),v.warn("Failed to create Worker. Fallback to execute module in main thread",t),(e=new w).addEventListener("message",r),e.addEventListener("error",i)}e.addEventListener("message",r),e.addEventListener("error",i)}))}let T=0;const P=c.Z.getLogger("esri.core.workers"),{ABORT:M,INVOKE:E,OPEN:O,OPENED:F,RESPONSE:B}=h.Cs;class D{constructor(e,t){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=t,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",(e=>{e.preventDefault(),P.error(e)}))}static async create(e){const t=await async function(){if(!(0,s.Z)("esri-workers")||((0,s.Z)("mozilla"),0))return k(new w);if(!C&&!S)try{const e='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,buildDate:r,version:t}=configuration.kernelInfo,{revision:n,buildDate:i,version:s}=e.kernelInfo;o!==n&&console.warn(`[esri.core.workers] Version mismatch detected between ArcGIS API for JavaScript and assets:\\nAPI version: ${t} [Date: ${r}, Revision: ${o.slice(0,8)}]\nAssets version: ${s} [Date: ${i}, Revision: ${n.slice(0,8)}]`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let e;function t(o){const t=e.connect(o);self.postMessage({type:2,jobId:r,data:t},[t])}"function"==typeof define&&define.amd?require([workerPath],(r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((r=>(e=r.default,checkWorkerRevision(e),e.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((r=>{e=r.default||r,checkWorkerRevision(e),e.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),e=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(e),e.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const e=outgoing.get(r);outgoing.delete(r),o.error?e.reject(JSON.parse(o.error)):e.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});'.replace('"{CONFIGURATION}"',`'${function(){let e;if(null!=d.Z.default){const t={...d.Z};delete t.default,e=JSON.parse(JSON.stringify(t))}else e=JSON.parse(JSON.stringify(d.Z));e.assetsPath=(0,p.hF)(e.assetsPath),e.request.interceptors=[],e.log.interceptors=[],e.locale=(0,b.Kd)(),e.has={"esri-csp-restrictions":(0,s.Z)("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":(0,s.Z)("esri-2d-update-debug"),"esri-2d-query-centroid-enabled":(0,s.Z)("esri-2d-query-centroid-enabled"),"featurelayer-pbf":(0,s.Z)("featurelayer-pbf"),"featurelayer-simplify-thresholds":(0,s.Z)("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":(0,s.Z)("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":(0,s.Z)("featurelayer-simplify-mobile-factor"),"esri-atomics":(0,s.Z)("esri-atomics"),"esri-shared-array-buffer":(0,s.Z)("esri-shared-array-buffer"),"esri-tiles-debug":(0,s.Z)("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":(0,s.Z)("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":(0,s.Z)("feature-polyline-generalization-factor"),"host-webworker":1},e.workers.loaderUrl&&(e.workers.loaderUrl=(0,p.hF)(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=(0,p.hF)(e.workers.workerPath):e.workers.workerPath=(0,p.hF)((0,f.V)("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=d.Z.workers.loaderConfig,r=g({baseUrl:t?.baseUrl,locale:(0,b.Kd)(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t?.has},map:{...t?.map},paths:{...t?.paths},packages:t?.packages||[]}),i={version:l.i8,buildDate:I.r,revision:I.$};return JSON.stringify({esriConfig:e,loaderConfig:r,kernelInfo:i})}()}'`);C=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){S=e||{}}let e;if(C)try{e=new Worker(C,{name:"esri-worker-"+T++})}catch(t){v.warn(R,S),e=new w}else v.warn(R,S),e=new w;return k(e)}();return new D(t,e)}terminate(){this.worker.terminate()}async open(e,t={}){const{signal:r}=t,i=(0,h.jt)();return new Promise(((t,s)=>{const a={resolve:t,reject:s,abortHandle:(0,n.$F)(r,(()=>{this._outJobs.delete(i),this._post({type:M,jobId:i})}))};this._outJobs.set(i,a),this._post({type:O,jobId:i,modulePath:e})}))}_onMessage(e){const t=(0,h.QM)(e);if(t)switch(t.type){case F:this._onOpenedMessage(t);break;case B:this._onResponseMessage(t);break;case M:this._onAbortMessage(t);break;case E:this._onInvokeMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,i=t.get(r);i&&(i.controller&&i.controller.abort(),t.delete(r))}_onInvokeMessage(e){const{methodName:t,jobId:r,data:i,abortable:s}=e,a=s?new AbortController:null,o=this._inJobs,c=l.Nv[t];let u;try{if("function"!=typeof c)throw new TypeError(`${t} is not a function`);u=c.call(null,i,{signal:a?a.signal:null})}catch(e){return void this._post({type:B,jobId:r,error:(0,h.AB)(e)})}(0,n.y8)(u)?(o.set(r,{controller:a,promise:u}),u.then((e=>{o.has(r)&&(o.delete(r),this._post({type:B,jobId:r},e))}),(e=>{o.has(r)&&(o.delete(r),e||(e={message:"Error encountered at method"+t}),(0,n.D_)(e)||this._post({type:B,jobId:r,error:(0,h.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:B,jobId:r},u)}_onOpenedMessage(e){const{jobId:t,data:r}=e,i=this._outJobs.get(t);i&&(this._outJobs.delete(t),(0,u.hw)(i.abortHandle),i.resolve(r))}_onResponseMessage(e){const{jobId:t,error:r,data:s}=e,n=this._outJobs.get(t);n&&(this._outJobs.delete(t),(0,u.hw)(n.abortHandle),r?n.reject(i.Z.fromJSON(JSON.parse(r))):n.resolve(s))}_post(e,t,r){return(0,h.oi)(this.worker,e,t,r)}}let N=(0,s.Z)("esri-workers-debug")?1:(0,s.Z)("host-browser")?navigator.hardwareConcurrency-1:0;N||(N=(0,s.Z)("safari")&&(0,s.Z)("mac")||(0,s.Z)("trident")?7:2);let z=0;const L=[];async function H(e,t){const r=new a.Z;return await r.open(e,t),r}async function Z(e,t={}){if("string"!=typeof e)throw new i.Z("workers:undefined-module","modulePath is missing");let r=t.strategy||"distributed";if((0,s.Z)("host-webworker")&&!(0,s.Z)("esri-workers")&&(r="local"),"local"===r){let r=await o.default.loadWorker(e);r||(r=await import(e)),(0,n.k_)(t.signal);const i=t.client||r;return H([o.default.connect(r)],{...t,client:i})}if(await async function(){if(J)return J;A=new AbortController;const e=[];for(let t=0;t<N;t++){const r=D.create(t).then((e=>(L[t]=e,e)));e.push(r)}return J=Promise.all(e),J}(),(0,n.k_)(t.signal),"dedicated"===r){const r=z++%N;return H([await L[r].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const r=Math.min(t.maxNumWorkers,N);if(r<N){const i=new Array(r);for(let s=0;s<r;++s){const r=z++%N;i[s]=L[r].open(e,t)}return H(i,t)}}return H(L.map((r=>r.open(e,t))),t)}let A,J=null},2587:(e,t,r)=>{r(90344),r(18848),r(940),r(70171);var i=r(94443),s=r(3172),n=r(20102),a=r(70586);async function o(e){if((0,a.pC)(c.fetchBundleAsset))return c.fetchBundleAsset(e);const t=await(0,s.default)(e,{responseType:"text"});return JSON.parse(t.data)}class l{constructor({base:e="",pattern:t,location:r=new URL(window.location.href)}){let i;i="string"==typeof r?e=>new URL(e,new URL(r,window.location.href)).href:r instanceof URL?e=>new URL(e,r).href:r,this.pattern="string"==typeof t?new RegExp(`^${t}`):t,this.getAssetUrl=i,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,t){return async function(e,t,r,s){const a=t.exec(r);if(!a)throw new n.Z("esri-intl:invalid-bundle",`Bundle id "${r}" is not compatible with the pattern "${t}"`);const l=a[1]?`${a[1]}/`:"",c=a[2],u=(0,i.Su)(s),h=`${l}${c}.json`,f=u?`${l}${c}_${u}.json`:h;let d;try{d=await o(e(f))}catch(t){if(f===h)throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:t});try{d=await o(e(h))}catch(e){throw new n.Z("intl:unknown-bundle",`Bundle "${r}" cannot be loaded`,{error:e})}}return d}(this.getAssetUrl,this.matcher,e,t)}}const c={};var u,h=r(99880);(0,i.tz)((u={pattern:"esri/",location:h.V},new l(u)))},940:(e,t,r)=>{r.d(t,{n:()=>c});var i=r(92604),s=r(78286),n=r(19153),a=r(90344),o=r(18848);const l=i.Z.getLogger("esri.intl");function c(e,t,r={}){const{format:i={}}=r;return(0,n.gx)(e,(e=>function(e,t,r){let i,n;const a=e.indexOf(":");if(-1===a?i=e.trim():(i=e.slice(0,a).trim(),n=e.slice(a+1).trim()),!i)return"";const o=(0,s.hS)(i,t);if(null==o)return"";const l=r[n]||r[i];return l?u(o,l):n?h(o,n):f(o)}(e,t,i)))}function u(e,t){switch(t.type){case"date":return(0,a.p6)(e,t.intlOptions);case"number":return(0,o.uf)(e,t.intlOptions);default:return l.warn("missing format descriptor for key {key}"),f(e)}}function h(e,t){switch(t.toLowerCase()){case"dateformat":return(0,a.p6)(e);case"numberformat":return(0,o.uf)(e);default:return l.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?(0,a.p6)(e):/^numberformat/i.test(t)?(0,o.uf)(e):f(e)}}function f(e){switch(typeof e){case"string":return e;case"number":return(0,o.uf)(e);case"boolean":return""+e;default:return e instanceof Date?(0,a.p6)(e):""}}},52294:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Ye});var i=r(43697),s=r(51773),n=r(30030),a=r(20102),o=r(70586),l=r(16453),c=r(95330),u=r(17445),h=r(5600),f=(r(67676),r(80442),r(75215)),d=r(36030),p=r(71715),m=r(52011),g=r(87085),y=r(71612),x=r(17017),w=(r(66577),r(3172)),b=r(92604),I=r(44422),v=r(8744),_=r(66677),C=r(21506),S=r(35956),R=r(88281),k=r(11145),T=r(99815),P=r(80676),M=r(67058),E=r(91219),O=r(23808),F=r(6570),B=r(82971);const D=b.Z.getLogger("esri.layers.mixins.ImageryTileMixin"),N=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.fullExtent=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.tileInfo=null,this.symbolizer=null}set url(e){this._set("url",(0,_.Nm)(e,D))}set renderer(e){this._set("renderer",e),this.updateRenderer()}async convertVectorFieldData(e,t){if((0,o.Wi)(e))return null;const r=this._rasterJobHandler.instance,i=this.rasterInfo.dataType;return r?r.convertVectorFieldData({pixelBlock:e,dataType:i},t):(0,P.KC)(e,i)}async createFlowMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createFlowMesh(e,t):(0,O.GE)(e.meshType,e.simulationSettings,e.flowData,(0,o.pC)(t.signal)?t.signal:(new AbortController).signal)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.rasterInfo;if((0,o.Wi)(t))return e;let r=e.multidimensionalDefinition||this.multidimensionalDefinition;!(0,o.Wi)(r)&&r.length||(r=(0,T.Tj)(this.raster.rasterInfo));const i=e.timeExtent||this.timeExtent;if((0,o.pC)(r)&&(0,o.pC)(i)&&((0,o.pC)(i.start)||(0,o.pC)(i.end))){r=r.map((e=>e.clone()));const s=t.variables.find((({name:e})=>e===r[0].variableName))?.dimensions?.find((({name:e})=>"StdTime"===e)),n=r.find((({dimensionName:e})=>"StdTime"===e));if(!s||!n)return{...e,multidimensionalDefinition:null};const{start:a,end:l}=i,c=(0,o.Wi)(a)?null:a.getTime(),u=(0,o.Wi)(l)?null:l.getTime(),h=c??u,f=u??c;if((0,o.pC)(s.values)){const e=s.values.filter((e=>{if(Array.isArray(e)){if(h===f)return e[0]<=h&&e[1]>=h;const t=e[0]<=h&&e[1]>h||e[0]<f&&e[1]>=f,r=e[0]>=h&&e[1]<=f||e[0]<h&&e[1]>f;return t||r}return h===f?e===h:e>=h&&e<=f}));if(e.length){const t=e.sort(((e,t)=>h===f?(e[0]??e)-(t[0]??t):Math.abs((e[1]??e)-f)-Math.abs((t[1]??t)-f)))[0];n.values=[t]}else r=null}else if(s.hasRegularIntervals&&s.extent){const[e,t]=s.extent;h>t||f<e?r=null:n.values=h===f?[h]:[Math.max(e,h),Math.min(t,f)]}}return{...e,multidimensionalDefinition:r}}async updateRenderer(){if(!this.loaded)return;if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(this.renderer))return;const e=this._rasterJobHandler.instance;e&&(this.symbolizer.rendererJSON=(0,M.ol)(this.renderer.toJSON()),this.symbolizer.bind(),await e.updateSymbolizer(this.symbolizer),this._cachedRendererJson=this.renderer.toJSON())}async applyRenderer(e,t){const r=e&&e.pixelBlock;if(!((0,o.pC)(r)&&r.pixels&&r.pixels.length>0))return null;let i;await this.updateRenderer();const s=this._rasterJobHandler.instance,{bandIds:n}=this;return i=s?await s.symbolize({...e,simpleStretchParams:t,bandIds:n}):this.symbolizer.symbolize({...e,simpleStretchParams:t,bandIds:n}),i}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||(0,o.Wi)(t))return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=(0,v.C5)(e);return k.Z.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,t,r,i={}){if(i.requestAsImageElement){const s=this.getTileUrl(e,t,r);return(0,w.default)(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:i.signal}).then((e=>e.data))}if((0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(i=this.normalizeRasterFetchOptions(i),(0,o.Wi)(i.multidimensionalDefinition))){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,t,r,s),pixelBlock:null}}return await this._initJobHandler(),"raster-shaded-relief"===this.renderer.type&&(i={...i,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,t,r,i)}async fetchPixels(e,t,r,i={}){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&(i=this.normalizeRasterFetchOptions(i),(0,o.Wi)(i.multidimensionalDefinition))?{extent:e,pixelBlock:null}:(await this._initJobHandler(),this.raster.fetchPixels(e,t,r,i))}async identify(e,t={}){return!(0,o.pC)(this.rasterInfo.multidimensionalInfo)||this.rasterInfo.hasMultidimensionalTranspose&&((0,T.WU)(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent)||(t=this.normalizeRasterFetchOptions(t),!(0,o.Wi)(t.multidimensionalDefinition))?this.raster.identify(e,t):{location:e,value:null}}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const e=this.rasterInfo.multidimensionalInfo;if((0,o.Wi)(e)||"standard-time"!==this.rasterInfo.dataType)return!1;const t=this.multidimensionalDefinition[0]?.variableName;return e.variables.some((e=>e.name===t&&e.dimensions.some((e=>"StdTime"===e.name))))}getStandardTimeValue(e){return new Date(24*(e-25569)*3600*1e3).toString()}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=(0,T.Tj)(this.raster.rasterInfo)),this._configDefaultRenderer()}_initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new R.Z;return this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e,this.raster.rasterJobHandler=e,this.renderer&&this.updateRenderer()})).catch((()=>null)),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this.raster.rasterJobHandler=null,this._cachedRendererJson=null}_configDefaultInterpolation(){if(null==this.interpolation){const e=(0,M.In)(this.rasterInfo,this.raster.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",e)}}_configDefaultRenderer(){const e=this.raster.rasterInfo;this.bandIds||(this.bandIds=(0,M.YD)(e)),this.renderer||(this.renderer=(0,M.Ob)(e,{bandIds:this.bandIds,variableName:(0,o.pC)(this.multidimensionalDefinition)?this.multidimensionalDefinition[0]?.variableName:null})),this.symbolizer?(this.symbolizer.rendererJSON=(0,M.ol)(this.renderer.toJSON()),this.symbolizer.rasterInfo=e):this.symbolizer=new E.Z({rendererJSON:this.renderer.toJSON(),rasterInfo:e});const t=this.symbolizer.bind();t.success||D.warn("imagery-tile-mixin",t.error||"The given renderer is not supported by the layer.")}};return(0,i._)([(0,h.Cb)()],t.prototype,"_cachedRendererJson",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"_compatibleFullExtent",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"_rasterJobHandler",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"bandIds",void 0),(0,i._)([(0,h.Cb)({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),(0,i._)([(0,h.Cb)({type:F.Z,json:{read:!1}}),(0,I.B)("rasterInfo.extent")],t.prototype,"fullExtent",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"interpolation",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"ioConfig",void 0),(0,i._)([(0,h.Cb)({type:[S.Z]})],t.prototype,"multidimensionalDefinition",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"raster",void 0),(0,i._)([(0,h.Cb)({readOnly:!0}),(0,I.B)("raster.rasterInfo")],t.prototype,"rasterInfo",void 0),(0,i._)([(0,h.Cb)()],t.prototype,"sourceJSON",void 0),(0,i._)([(0,h.Cb)({type:B.Z,json:{read:!1}}),(0,I.B)("rasterInfo.spatialReference")],t.prototype,"spatialReference",void 0),(0,i._)([(0,h.Cb)({type:k.Z,json:{read:!1}}),(0,I.B)("rasterInfo.storageInfo.tileInfo")],t.prototype,"tileInfo",void 0),(0,i._)([(0,h.Cb)(C.HQ)],t.prototype,"url",null),(0,i._)([(0,h.Cb)({types:n.dr})],t.prototype,"renderer",null),(0,i._)([(0,h.Cb)()],t.prototype,"symbolizer",void 0),t=(0,i._)([(0,m.j)("esri.layers.ImageryTileMixin")],t),t};var z=r(38009),L=r(16859),H=r(34760),Z=r(72965),A=r(28294),J=r(1231),W=r(69608),j=r(48526),q=r(36679),G=r(96674),U=r(609),$=r(73506),V=r(13473);const Y=new Map,K=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 r=e+"/"+t,i=this._cachedBlocks;if(i.has(r)){const e=i.get(r);return e.refCount--,e.refCount<=0&&(i.delete(r),e.controller&&e.controller.abort()),e.refCount}return 0}getBlock(e,t){const r=e+"/"+t,i=this._cachedBlocks;if(i.has(r)){const e=i.get(r);return e.ts=Date.now(),e.refCount++,i.delete(r),i.set(r,e),e.block}return null}putBlock(e,t,r,i=null){const s=this._cachedBlocks,n=e+"/"+t;if(s.has(n)){const e=s.get(n);e.ts=Date.now(),e.refCount++}else s.set(n,{block:r,ts:Date.now(),refCount:1,controller:i});this._trim(),this._updateTimer()}deleteBlock(e,t){const r=this._cachedBlocks,i=e+"/"+t;r.has(i)&&r.delete(i)}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),r=Date.now();for(let i=0;i<t.length&&t[i][1].ts<=r-this._duration;i++)e.delete(t[i][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 r=0;r<t.length-this._size;r++)e.delete(t[r][0])}_clearTimer(){null!=this._timer&&(clearInterval(this._timer),this._timer=null)}};function X(e,t){return null==t?e:`${e}?sliceId=${t}`}function Q(e,t,r){if(!Y.has(e))return null==t?K.getBlock(e,r):null;const i=Y.get(e);if(null==i[t]){for(let e=0;e<i.length;e++)if(i[e]&&i[e].cache.has(r)){const t=i[e].cache.get(r);return t.refCount++,t.block}return K.getBlock(e,r)}const s=i[t].cache;if(s.has(r)){const e=s.get(r);return e.refCount++,e.block}for(let e=0;e<i.length;e++)if(e!==t&&i[e]&&i[e]&&i[e].cache.has(r)){const t=i[e].cache.get(r);return t.refCount++,s.set(r,t),t.block}return null}function ee(e,t,r,i,s=null){if(!Y.has(e))return void(null==t&&K.putBlock(e,r,i,s));const n=Y.get(e);if(null==n[t])return void K.putBlock(e,r,i,s);const a={refCount:1,block:i,isResolved:!1,isRejected:!1,controller:s};i.then((()=>a.isResolved=!0)).catch((()=>a.isRejected=!0)),n[t].cache.set(r,a)}var te=r(75993),re=r(55914);let ie=class extends((0,U.v)(G.wq)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=(0,$.zD)();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:k.Z.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=(0,$.ut)(e.spatialReference);return(0,o.pC)(t)&&e.extent.width>=t/2}set url(e){this._set("url",(0,_.Nm)(e,b.Z.getLogger(this.declaredClass)))}async open(e){throw new a.Z("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,r,s);return this.fetchPixels(n,s.size[0],s.size[1],i)}async identify(e,t={}){const{multidimensionalDefinition:r,timeExtent:i}=t,{hasMultidimensionalTranspose:s,multidimensionalInfo:n}=this.rasterInfo;let{transposedVariableName:a}=t;const l=(0,o.pC)(n)&&s&&(null!=i||(0,T.WU)(r));l&&!a&&(a=(0,o.pC)(r)&&r.length>0?r[0].variableName:n.variables[0].name,t={...t,transposedVariableName:a}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:c,extent:u}=this.rasterInfo,{datumTransformation:h}=t;let f=(0,$.nF)(e,c,h);if(!u.intersects(f))return{location:f,value:null};if((0,o.pC)(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(f);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};f=e}let d=0;const p=a&&(0,o.pC)(n)&&this.rasterInfo.hasMultidimensionalTranspose;if(!p)if(t.srcResolution)d=(0,$.kr)(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(d=await this.computeBestPyramidLevelForLocation(e,t),null==d)return{location:f,value:null};const m=this.identifyPixelLocation(f,d,null,p);if(null===m)return{location:f,value:null};const{row:g,col:y,rowOffset:x,colOffset:w,blockWidth:b}=m,I=a??(0,o.Wg)(t.sliceId),v=X(this.url,I),_=`${d}/${g}/${y}`;let C=Q(v,null,_);(0,o.Wi)(C)&&(C=this.fetchRawTile(d,g,y,t),ee(v,null,_,C));const S=await C;if((0,o.Wi)(S)||!S.pixels?.length)return{location:f,value:null};const R=x*b+w;return this._processIdentifyResult(S,{srcLocation:f,position:R,pyramidLevel:d,useTransposedTile:p,requestSomeSlices:l,identifyOptions:t})}async fetchPixels(e,t,r,i={}){if(e=(0,$.kZ)(e),(i=this._getRequestOptionsWithSliceId(i)).requestRawData)return this._fetchPixels(e,t,r,i);const s=(0,$.ut)(e.spatialReference),n=(0,$.Hq)(e);if((0,o.Wi)(s)||0===n||1===n&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,r,i);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:l,xmax:c}=e,u=Math.round(s/(c-l)*t),h=u-Math.round((s/2-l)/(c-l)*t);let f=0;const d=[];for(let o=0;o<=n;o++){const p=new F.Z({xmin:0===o?l:-s/2,xmax:o===n?c-s*o:s/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),m=0===o?u-h:o===n?t-f:u;f+=m,d.push(m);const g=i.disableWrapAround&&o>0?null:this._fetchPixels(p,m,r,i);a.push(g)}const p=(await Promise.all(a)).map((e=>e?.pixelBlock));let m=null;const g={width:t,height:r};return m=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:p,srcMosaicSize:g,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:d},i)).pixelBlock:(0,re.us)(p,g,{blockWidths:d}),{extent:e,srcExtent:(0,$.tB)(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:m}}async fetchRawPixels(e,t,r,i={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const s=await this._fetchRawTiles(e,t,r,i),{nativeExtent:n,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,h=a.y*c,f=new F.Z({xmin:n.xmin+u*t.x,xmax:n.xmin+u*(t.x+r.width-1),ymin:n.ymax-h*(t.y+r.height-1),ymax:n.ymax-h*t.y,spatialReference:n.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:d,mosaicSize:p}=s;if(1===d.length&&(0,o.pC)(d[0])&&d[0].width===r.width&&d[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const m=e>0?l.pyramidBlockWidth:l.blockWidth,g=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%m,y:t.y%g};let x;return x=this.rasterJobHandler?(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:p,destDimension:r,clipOffset:y,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:(0,re.us)(d,p,{clipOffset:y,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:x}}fetchRawTile(e,t,r,i){throw new a.Z("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return(0,$.tB)(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?(0,te.J)(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,r){const{customFetchParameters:i}=this.ioConfig,{range:s,query:n,headers:a}=t;r=r??t.retryCount??this.ioConfig.retryCount;const o=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await(0,w.default)(e,{...t,query:{...n,...i},headers:{...a,...o}})}catch(i){if(r>0)return r--,this.request(e,t,r);throw i}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return(0,o.Wi)(t)||(0,o.Wi)(e)||0===e.length?null:(0,T.gk)(e,t)}getTileExtentFromTileInfo(e,t,r,i){const s=i.lodAt(e);return this.getTileExtent({x:s.resolution,y:s.resolution},t,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:r,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const s=[],n=e.maximumPyramidLevel||0;let a=Math.max(i.x,i.y),o=1/.0254*96*a;for(let e=0;e<=n;e++)s.push({level:n-e,resolution:a,scale:o}),a*=2,o*=2;const l=new V.Z({x:r.xmin,y:r.ymax,spatialReference:t});e.tileInfo=new k.Z({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:s}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,r=512,i){const{width:s,height:n,nativeExtent:a,pixelSize:o,spatialReference:l}=e,c=new V.Z({x:a.xmin,y:a.ymax,spatialReference:l});null==i&&(i=Math.max(0,Math.round(Math.log(Math.max(s,n))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[o],i);e.storageInfo=new q.Z({blockWidth:t,blockHeight:r,pyramidBlockWidth:t,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,r,i,s,n=0,a=2){if(1===s.length&&n>0){s=[...s];let{x:e,y:t}=s[0];for(let r=0;r<n;r++)e*=a,t*=a,s.push({x:e,y:t})}const o=[],{x:l,y:c}=i;for(let i=0;i<s.length;i++){const{x:n,y:a}=s[i];o.push({minCol:Math.floor((e.xmin-l+.1*n)/t/n),maxCol:Math.floor((e.xmax-l-.1*n)/t/n),minRow:Math.floor((c-e.ymax+.1*a)/r/a),maxRow:Math.floor((c-e.ymin-.1*a)/r/a)})}return o}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:r,pyramidScalingFactor:i}=this.rasterInfo.storageInfo;if(0===e)return t;if((0,o.pC)(r)&&r.length)return r[e-1];const s=i**e;return{x:t.x*s,y:t.y*s}}identifyPixelLocation(e,t,r,i){const{spatialReference:s,nativeExtent:n,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:l,origin:c,transposeInfo:u}=a,h=i&&(0,o.pC)(u)?u.tileSize[0]:a.blockWidth,f=i&&(0,o.pC)(u)?u.tileSize[1]:a.blockHeight,d=(0,$.nF)(e,s,r);if(!n.intersects(d))return null;if(t<0||t>l)return null;const p=this.getPyramidPixelSize(t),{x:m,y:g}=p,y=(c.y-d.y)/g/f,x=(d.x-c.x)/m/h,w=Math.min(f-1,Math.floor((y-Math.floor(y))*f)),b=Math.min(h-1,Math.floor((x-Math.floor(x))*h));return{pyramidLevel:t,row:Math.floor(y),col:Math.floor(x),rowOffset:w,colOffset:b,blockWidth:h,srcLocation:d}}getTileExtent(e,t,r,i,s,n){const[a,o]=n,l=i.x+r*a*e.x,c=l+a*e.x,u=i.y-t*o*e.y,h=u-o*e.y;return new F.Z({xmin:l,xmax:c,ymin:h,ymax:u,spatialReference:s})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,r){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRow<t||i.maxCol<r||i.minRow>t||i.minCol>r}async _fetchPixels(e,t,r,i={}){let s=(0,$.Hq)(e);if(s>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,r,i),{pyramidLevel:a,pyramidResolution:l,srcResolution:c,srcExtent:u,srcWidth:h,srcHeight:f}=n;if(0===h||0===f)return{extent:e,srcExtent:u,pixelBlock:null};const d=(0,o.Wg)(this.rasterInfo.transform),p="gcs-shift"===d?.type,m=(0,o.pC)((0,$.ut)(e.spatialReference));!p&&m||(s=(0,$.Hq)(n.srcExtent,p));const g=this.rasterInfo.storageInfo,y={x:Math.floor((u.xmin-g.origin.x)/l.x+.1),y:Math.floor((g.origin.y-u.ymax)/l.y+.1)},x=await this._fetchRawTiles(a,y,{width:h,height:f,wrapCount:s},i);if(!x)return{extent:e,srcExtent:u,pixelBlock:null};const w=a>0?g.pyramidBlockWidth:g.blockWidth,b=a>0?g.pyramidBlockHeight:g.blockHeight,I=w===h&&b===f&&y.x%w==0&&y.y%b==0,v=new V.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference}),_=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:C}=i;if(!_&&I&&1===x.pixelBlocks.length&&w===t&&b===r&&c.x===v.x&&c.y===v.y)return{extent:e,srcExtent:u,pixelBlock:x.pixelBlocks[0]};const S=m&&(0,o.pC)((0,$.ut)(u.spatialReference)),R=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");R&&!this.rasterJobHandler&&await(0,$.zD)();const k=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:v.toJSON(),datumTransformation:C,rasterTransform:d,hasWrapAround:s>0||S,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:R},i):(0,$.Qp)({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:v,datumTransformation:C,rasterTransform:d,hasWrapAround:s>0||S,isAdaptive:!1,includeGCSGrid:R});let T;const M=!i.requestRawData,E={rows:k.spacing[0],cols:k.spacing[1]},O=(0,o.Wg)(this._getRasterTileAlignmentInfo(a,x.extent.xmin)),{pixelBlocks:F,mosaicSize:B,isPartiallyFilled:D}=x;let N=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:F,srcMosaicSize:B,destDimension:M?{width:t,height:r}:null,coefs:M?k.coefficients:null,sampleSpacing:M?E:null,projectDirections:R,gcsGrid:R?k.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:i.interpolation,alignmentInfo:O,blockWidths:null},i);({pixelBlock:T,localNorthDirections:N}=e)}else{const e=(0,re.us)(F,B,{alignmentInfo:O});T=M?(0,re.Uk)(e,{width:t,height:r},k.coefficients,E,i.interpolation):e,R&&k.gcsGrid&&(N=(0,re.Qh)({width:t,height:r},k.gcsGrid),T=(0,P.xQ)(T,this.rasterInfo.dataType,N))}return i.requestRawData||R?{srcExtent:u,pixelBlock:T,transformGrid:k,localNorthDirections:N,extent:e,isPartiallyFilled:D}:{srcExtent:u,extent:e,pixelBlock:T}}async _fetchRawTiles(e,t,r,i){const{origin:s,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:h,height:f,wrapCount:d}=r;const p=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(c-=i.buffer.cols,u-=i.buffer.rows,h+=2*i.buffer.cols,f+=2*i.buffer.rows);let m=0,g=0,y=0;d&&(0,o.pC)(p)&&(({worldColumnCountFromOrigin:g,originColumnOffset:y,rightPadding:m}=p),g*p.blockWidth-m>=c+h&&(m=0));const x=Math.floor(c/a),w=Math.floor(u/l),b=Math.floor((c+h+m-1)/a),I=Math.floor((u+f+m-1)/l),v=n[e];if(!v)return null;const{minRow:_,minCol:C,maxCol:S,maxRow:R}=v;if(0===d&&(I<_||b<C||w>R||x>S))return null;const k=new Array;let T=!1;const P=null==this.ioConfig.allowPartialFill?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let t=w;t<=I;t++)for(let r=x;r<=b;r++){let s=r;if(!i.disableWrapAround&&d&&(0,o.pC)(p)&&g<=r&&(s=r-g-y),t>=_&&s>=C&&R>=t&&S>=s){const r=this._fetchRawTile(e,t,s,i);P?k.push(new Promise((e=>{r.then((t=>e(t))).catch((()=>{T=!0,e(null)}))}))):k.push(r)}else k.push(null)}if(0===k.length)return null;const M=await Promise.all(k),E={height:(I-w+1)*l,width:(b-x+1)*a},{spatialReference:O}=this.rasterInfo,B=this.getPyramidPixelSize(e),{x:D,y:N}=B;return{extent:new F.Z({xmin:s.x+x*a*D,xmax:s.x+(b+1)*a*D,ymin:s.y-(I+1)*l*N,ymax:s.y-w*l*N,spatialReference:O}),pixelBlocks:M,mosaicSize:E,isPartiallyFilled:T}}_fetchRawTile(e,t,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[e];if(!s)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:l,maxRow:u}=s;if(t<n||r<a||t>u||r>l)return Promise.resolve(null);const h=X(this.url,i.sliceId),f=`${e}/${t}/${r}`;let d=Q(h,i.registryId,f);if((0,o.Wi)(d)){const s=new AbortController;d=this.fetchRawTile(e,t,r,{...i,signal:s.signal}),ee(h,i.registryId,f,d,s),d.catch((()=>function(e,t,r){if(!Y.has(e))return void(null==t&&K.deleteBlock(e,r));const i=Y.get(e);null!=i[t]?i[t].cache.delete(r):K.deleteBlock(e,r)}(h,i.registryId,f)))}return i.signal&&(0,c.fu)(i,(()=>{!function(e,t,r){if(!Y.has(e))return null==t?K.decreaseRefCount(e,r):0;const i=Y.get(e);if(null==i[t])return K.decreaseRefCount(e,r);const s=i[t].cache;if(s.has(r)){const e=s.get(r);if(e.refCount--,0===e.refCount){s.delete(r);for(let e=0;e<i.length;e++)i[e]&&i[e].cache.has(r)&&i[e].cache.delete(r);e.controller&&e.controller.abort()}e.refCount}}(h,i.registryId,f)})),d}_computeMagDirValues(e){const{bandCount:t,dataType:r}=this.rasterInfo;if((2!==t||"vector-magdir"!==r)&&"vector-uv"!==r||2!==e?.length||!e[0]?.length)return null;const i=e[0].length;if("vector-magdir"===r){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[s,n]=e,a=[],o=[];for(let e=0;e<i;e++){const[t,r]=(0,P.Tg)([s[e],n[e]]);a.push(t),o.push(r)}return[a,o]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=(0,$.P_)(this.rasterInfo)),(0,o.Wi)(this._rasterTileAlighmentInfo.pyramidsInfo)?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,r,i={}){const s={datumTransformation:i.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};i.srcResolution&&(s.srcResolution=i.srcResolution,this._updateSourceDataInfo(e,s));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:a,srcHeight:o,pyramidLevel:l}=s,c=a/t,u=o/r,h=l<n&&c*u>=16;if(h||l===n&&(c>8||u>8)||0===a||0===o){const a=new V.Z({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/r,spatialReference:e.spatialReference});let o=(0,$.VO)(a,this.rasterInfo.spatialReference,e,s.datumTransformation);const f=!o||i.srcResolution&&o.x+o.y<i.srcResolution.x+i.srcResolution.y;if(h&&i.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(n-l+3>=e){const t=2**e;o={x:i.srcResolution.x*t,y:i.srcResolution.y*t}}}o&&(s.srcResolution=o,this._updateSourceDataInfo(e,s))}return(s.srcWidth/t>8||s.srcHeight/r>8)&&(s.srcWidth=0,s.srcHeight=0),s}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const r=this.rasterInfo.spatialReference,{srcResolution:i,datumTransformation:s}=t,{pyramidLevel:n,pyramidResolution:a,excessiveReading:l}=(0,$.kr)(i,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||(0,$.tB)(e,r,s);if(null==c)return;const u=(0,o.Wg)(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const h=Math.ceil((c.xmax-c.xmin)/a.x-.1),f=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=n,t.pyramidResolution=a,t.srcWidth=h,t.srcHeight=f}_getRequestOptionsWithSliceId(e){return(0,o.pC)(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:n}=t,a=e.pixels[0].length/e.width/e.height;if(e.mask&&!e.mask[i])return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if((0,o.Wi)(l)||!n){const t=e.pixels.map((e=>e[i])),n={location:r,value:t,pyramidLevel:s},a=this._computeMagDirValues(t.map((e=>[e])));return a?.length&&(n.magdirValue=a.map((e=>e[0]))),n}let c=e.pixels.map((e=>Array.prototype.slice.call(e,i*a,i*a+a))),u=this._computeMagDirValues(c);const{requestSomeSlices:h,identifyOptions:f}=t;let d=(0,T.MO)(l,f.transposedVariableName);if(h){const e=(0,T.Ur)(d,(0,o.Wg)(f.multidimensionalDefinition),(0,o.Wg)(f.timeExtent));c=c.map((t=>e.map((e=>t[e])))),u=u?.map((t=>e.map((e=>t[e])))),d=e.map((e=>d[e]))}return{location:r,value:null,dataSeries:d.map(((e,t)=>{const r={value:c.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition,variableName:e.multidimensionalDefinition[0].variableName,dimensionValues:{}};return u?.length&&(r.magdirValue=[u[0][t],u[1][t]]),e.multidimensionalDefinition.forEach((e=>r.dimensionValues[e.dimensionName]=e.values[0])),r})),pyramidLevel:s}}};(0,i._)([(0,h.Cb)()],ie.prototype,"_rasterTileAlighmentInfo",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],ie.prototype,"_isGlobalWrappableSource",null),(0,i._)([(0,h.Cb)(C.HQ)],ie.prototype,"url",null),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],ie.prototype,"datasetName",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],ie.prototype,"rasterInfo",void 0),(0,i._)([(0,h.Cb)()],ie.prototype,"ioConfig",void 0),(0,i._)([(0,h.Cb)()],ie.prototype,"sourceJSON",void 0),ie=(0,i._)([(0,m.j)("esri.layers.support.rasterDatasets.BaseRaster")],ie);const se=ie;var ne=r(20095);function ae(e){const t=e.fields,r=e.records,i=t.some((e=>"oid"===e.name.toLowerCase()))?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map((e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name})))),n=s.map((e=>e.name)),a=[];let o=0,l=0;return r.forEach((e=>{const t={};for(t[i]=o++,l=1;l<n.length;l++)t[n[l]]=e[l-1];a.push({attributes:t})})),{displayFieldName:"",fields:s,features:a}}var oe=r(87521),le=r(74889);const ce=new Map;ce.set("int16","esriFieldTypeSmallInteger"),ce.set("int32","esriFieldTypeInteger"),ce.set("int64","esriFieldTypeInteger"),ce.set("float32","esriFieldTypeSingle"),ce.set("float64","esriFieldTypeDouble"),ce.set("text","esriFieldTypeString");let ue=class extends se{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(t))throw new a.Z("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:r,rasterInfo:i}=this._parseHeader(t);if("thematic"===i.dataType){const e=await this._fetchAuxiliaryInformation();i.attributeTable=e}this._set("storageInfo",r),this._set("rasterInfo",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,i={}){const{transposeInfo:s}=this.rasterInfo.storageInfo,{transposedVariableName:n}=i,a=!(!s||!n),o=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const l=this._buildCacheFilePath(o,t,r,i.multidimensionalDefinition,n),c=this._getIndexRecordFromBundle(t,r,a),u=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,c);if(0===f.recordSize)return null;const d=await this.request(l,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:i.signal});if(!d)return null;const[p,m]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:m,planes:null,pixelType:null,returnPixelInterleavedDims:a})}_validateHeader(e){return e&&"RasterInfo"===e.type&&!["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"].some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:r,histograms:i,colormap:s,blockWidth:n,blockHeight:a,firstPyramidLevel:o,maximumPyramidLevel:l}=e,c=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),u=e.extent.spatialReference,h=e.geodataXform?.spatialReference,f=new B.Z(u?.wkid||u?.wkt?u:h);let d=new F.Z({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new V.Z({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),m=Math.round((d.xmax-d.xmin)/p.x),g=Math.round((d.ymax-d.ymin)/p.y),y=this._parseTransform(e.geodataXform),x=y?d:null;y&&(d=y.forwardTransform(d),p.x=(d.xmax-d.xmin)/m,p.y=(d.ymax-d.ymin)/g);const w=e.properties??{},b=e.format.toLowerCase().replace("cache/",""),I=new V.Z(e.origin.x,e.origin.y,f);let v,_,C,S;if(s&&s.colors)for(v=[],_=0;_<s.colors.length;_++)C=s.colors[_],S=s.values?s.values[_]:_,v.push([S,255&C,C<<16>>>24,C<<8>>>24,C>>>24]);const R=e.LODInfos,T=[];for(_=0;_<R.levels.length;_++)T.push({level:R.levels[_],resolution:R.resolutions[_],scale:96/.0254*R.resolutions[_]});const P=new k.Z({dpi:96,lods:T,format:b,origin:I,size:[n,a],spatialReference:f}),M={recordSize:8,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*8+64},E=[{maxCol:Math.ceil(m/n)-1,maxRow:Math.ceil(g/a)-1,minCol:0,minRow:0}];let O=2;if(l>0)for(_=0;_<l;_++)E.push({maxCol:Math.ceil(m/O/n)-1,maxRow:Math.ceil(g/O/a)-1,minCol:0,minRow:0}),O*=2;const D=e.mdInfo;let N=null;if(D&&w._yxs){const e=w._yxs;N={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:M,rasterInfo:new j.Z({width:m,height:g,pixelType:t,bandCount:r,extent:d,nativeExtent:x,transform:y,spatialReference:f,pixelSize:p,keyProperties:w,statistics:c,histograms:i,multidimensionalInfo:D,colormap:v,storageInfo:new q.Z({blockWidth:n,blockHeight:a,pyramidBlockWidth:n,pyramidBlockHeight:a,origin:I,tileInfo:P,transposeInfo:N,firstPyramidLevel:o,maximumPyramidLevel:l,blockBoundary:E})})}}_parseTransform(e){if(!(0,oe.j)(e))throw new a.Z("cloudraster:open","the data contains unsupported geodata transform types");const t=(0,oe.c)(e);if("identity"===t.type)return null;if("polynomial"!==t.type||!t.forwardCoefficients?.length||!t.inverseCoefficients?.length)throw new a.Z("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return t}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),r=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),i=await Promise.all([t,r]);let s;if(i[0]){let e=i[0].fields;const t=i[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":ce.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(s={fields:e,features:r})}}return!s&&i[1]&&(s=class{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),r=3&t.getUint8(0);if(3!==r)return{header:{version:r},recordSet:null};const i=t.getUint32(4,!0),s=t.getUint16(8,!0),n=t.getUint16(10,!0),a={version:r,recordCount:i,headerByteCount:s,recordByteCount:n};let o=32;const l=[],c=[];let u;if(3===r){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,ne.f)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<i&&e.byteLength-o>n;){const r=[];32===t.getUint8(o)?(o+=1,l.forEach((t=>{if("C"===t.type)r.push((0,ne.f)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)r.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)r.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const i=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();r.push(new Date(parseInt(i.substring(0,4),10),parseInt(i.substring(4,6),10)-1,parseInt(i.substring(6,8),10)))}o+=t.length})),c.push(r)):o+=n}}return{header:a,fields:l,records:c,recordSet:ae({fields:l,records:c})}}}.parse(i[1]).recordSet),le.default.fromJSON(s)}_buildCacheFilePath(e,t,r,i,s){const n=this._getPackageSize(!!s),a=Math.floor(t/n)*n,l=Math.floor(r/n)*n,c="R"+this._toHexString4(a)+"C"+this._toHexString4(l);let u="L";u+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:h}=this.rasterInfo,f=i?.[0];if((0,o.Wi)(h)||!f)return`${this.url}/_alllayers/${u}/${c}.bundle`;let d="_yxs";if(!s){d=h.variables.find((e=>e.name===f.variableName)).dimensions[0].values.indexOf(f.values[0]).toString(16);const e=4-d.length;for(let t=0;t<e;t++)d="0"+d;d="S"+d}const p=this._getVariableFolderName(s||f.variableName);return`${this.url}/_alllayers/${p}/${d}/${u}/${c}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&(0,o.pC)(t)?t.packetSize:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:r}=t;return e&&(0,o.pC)(r)?r.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,r=!1){const i=this._getPackageSize(r),s=i*(e%i)+t%i;if(s<0)throw"Invalid level / row / col";return 20+s*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const r=e.subarray(t,t+8);let i,s=0;for(i=0;i<5;i++)s|=(255&r[i])<<8*i;const n=0xffffffffff&s;for(s=0,i=5;i<8;i++)s|=(255&r[i])<<8*(i-5);return{position:n,recordSize:0xffffffffff&s}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};(0,i._)([(0,h.Cb)({readOnly:!0})],ue.prototype,"storageInfo",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),ue=(0,i._)([(0,m.j)("esri.layers.support.rasterDatasets.CloudRaster")],ue);const he=ue;var fe=r(15612);let de=class extends se{constructor(){super(...arguments),this.datasetFormat="MEMORY"}async open(e){await this.init();const{pixelBlock:t,statistics:r,histograms:i,name:s,keyProperties:n,nativeExtent:a,transform:o}=this.data,{width:l,height:c,pixelType:u}=t,h=this.data.extent||new F.Z({xmin:-.5,ymin:.5,xmax:l-.5,ymax:c-.5,spatialReference:new B.Z({wkid:3857})}),f=this.data.isPseudoSpatialReference??!this.data.extent,d={x:h.width/l,y:h.height/c},p=new j.Z({width:l,height:c,pixelType:u,extent:h,nativeExtent:a,transform:o,pixelSize:d,spatialReference:h.spatialReference,bandCount:3,keyProperties:n||{},statistics:r,isPseudoSpatialReference:f,histograms:i});this.createRemoteDatasetStorageInfo(p,512,512),this._set("rasterInfo",p),this.updateTileInfo(),await this._buildInMemoryRaster(t,{width:512,height:512},e),this.datasetName=s,this.url="/InMemory/"+s}fetchRawTile(e,t,r,i={}){const s=this._pixelBlockTiles.get(`${e}/${t}/${r}`);return Promise.resolve(s)}async _buildInMemoryRaster(e,t,r){const i=this.rasterInfo.storageInfo.maximumPyramidLevel,s=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:i},r):Promise.resolve((0,re.Vl)(e,t,i)),n=(0,o.pC)(this.rasterInfo.statistics),l=(0,o.pC)(this.rasterInfo.histograms),u=n&&l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},r):Promise.resolve((0,fe.Hv)(e)),h=await(0,c.as)([s,u]);if(!h[0].value&&h[1].value)throw new a.Z("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,n||(this.rasterInfo.statistics=h[1].value?.statistics),l&&(this.rasterInfo.histograms=h[1].value?.histograms)}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],de.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],de.prototype,"data",void 0),de=(0,i._)([(0,m.j)("esri.layers.support.rasterDatasets.InMemoryRaster")],de);const pe=de;function me(e,t){if(!e||!t)return[];let r=t;t.includes("/")?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=[];if(t){const s=me(e,r);for(let e=0;e<s.length;e++)me(s[e],t).forEach((e=>i.push(e)));return i}const s=e.getElementsByTagNameNS("*",r);if(!s||0===s.length)return[];for(let e=0;e<s.length;e++)i.push(s[e]||s.item[e]);return i}function ge(e,t){if(!e||!t)return null;let r=t;t.includes("/")?(r=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=me(e,r);return i.length>0?t?ge(i[0],t):i[0]:null}function ye(e,t=null){const r=t?ge(e,t):e;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function xe(e,t){return function(e,t){const r=me(e,t),i=[];let s;for(let e=0;e<r.length;e++)s=r[e].textContent||r[e].nodeValue,s&&(s=s.trim(),""!==s&&i.push(s));return i}(e,t).map((e=>Number(e)))}function we(e,t){const r=ye(e,t);return Number(r)}function be(e,t){const r=e?.nodeName?.toLowerCase(),i=t.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}var Ie=r(87390);function ve(e,t){if(!e||!t)return null;const r=[];for(let i=0;i<e.length;i++)r.push(e[i]),r.push(t[i]);return r}function _e(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new B.Z({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const r=e.indexOf("VERTCS"),i=e.indexOf("PROJCS"),s=i>-1?i:e.indexOf("GEOGCS");if(-1===s)return null;const n=e.slice(s,e.lastIndexOf("]",r)+1).trim(),a=e.slice(r,e.lastIndexOf("]")).trim();t=Ce(n);const o=new B.Z(t?{wkid:t}:{wkt:n}),l=Ce(a);return l&&(o.vcsWkid=l),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=Ce(e),new B.Z(0!==t?{wkid:t}:{wkt:e})):null}function Ce(e){const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),r=t[t.length-1].split(","),i=r[0]?.toLowerCase();if(("epsg"===i||"esri"===i)&&e.endsWith('"]]')){const e=Number(r[1]);if(!isNaN(e)&&0!==e)return e}return 0}function Se(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach((e=>{if(1===e.nodeType)if(be(e,"SRS")){if(!t.spatialReference){const r=ye(e);t.spatialReference=_e(r)}}else if(be(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:r,transform:i}=function(e){const t=ge(e,"GeodataXform"),r=_e(we(t,"SpatialReference/WKID")||ye(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:r,transform:null};const i=we(t,"PolynomialOrder")??1,s=xe(t,"CoeffX/Double"),n=xe(t,"CoeffY/Double"),a=xe(t,"InverseCoeffX/Double"),o=xe(t,"InverseCoeffY/Double"),l=ve(s,n),c=ve(a,o);return{spatialReference:r,transform:new Ie.Z({spatialReference:r,polynomialOrder:i,forwardCoefficients:l,inverseCoefficients:c})}}(e);t.transform=i,t.spatialReference||(t.spatialReference=r)}else me(e,"MDI").forEach((e=>t.metadata[e.getAttribute("key")]=ye(e)));else if(be(e,"PAMRasterBand")){const r=function(e){const t=we(e,"NoDataValue"),r=ge(e,"Histograms/HistItem"),i=we(r,"HistMin"),s=we(r,"HistMax"),n=we(r,"BucketCount"),a=ye(r,"HistCounts")?.split("|").map((e=>Number(e)));let o,l,c,u;me(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}}));const h=we(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:a?.length&&null!=o&&null!=l?{min:i,max:s,size:n||a.length,counts:a}:null,sourceBandIndex:h,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=r.sourceBandIndex&&null==t.rasterBands[r.sourceBandIndex]?t.rasterBands[r.sourceBandIndex]=r:t.rasterBands.push(r)}}));const r=t.rasterBands;if(r){const e=!!r[0].statistics;t.statistics=e?r.map((e=>e.statistics)):null;const i=!!r[0].histogram;t.histograms=i?r.map((e=>e.histogram)):null}return t}let Re=class extends se{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:r,statistics:i,histograms:s,transform:n}=await this._fetchAuxiliaryData(e);const a=!r;a&&(r=new B.Z({wkid:3857})),s?.length&&null==i&&(i=(0,fe.Oh)(s));const{width:o,height:l}=t;let c=new F.Z({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:r});const u=n?n.forwardTransform(c):c;let h=!0;if(n){const e=n.forwardCoefficients;h=e&&0===e[1]&&0===e[2],h&&(n=null,c=u)}const f=new pe({data:{extent:u,nativeExtent:c,transform:n,pixelBlock:t,statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,r,i={}){return this._inMemoryRaster.fetchRawTile(e,t,r,i)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),r=(0,te.y)(t).toUpperCase();if("JPG"!==r&&"PNG"!==r&&"GIF"!==r&&"BMP"!==r)throw new a.Z("image-aux-raster:open","the data is not a supported format");return this._set("datasetFormat",r),await this.decodePixelBlock(t,{format:"jpg",width:1,height:1,useCanvas:!0})}async _fetchAuxiliaryData(e){const t=(0,o.Wg)(e?.signal),r=this.ioConfig.skipExtensions??[],i=r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),s=this.datasetFormat,n="JPG"===s?"jgw":"PNG"===s?"pgw":"BMP"===s?"bpw":null,a=r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),l=await(0,c.as)([i,a]);if(t?.aborted)throw(0,c.zE)();const u=Se(l[0].value?.data);if(!u.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map((e=>Number(e))):null;u.transform=6===e?.length?new Ie.Z({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return u}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],Re.prototype,"datasetFormat",void 0),Re=(0,i._)([(0,m.j)("esri.layers.support.rasterDatasets.ImageAuxRaster")],Re);const ke=Re;var Te=r(17452),Pe=r(45322),Me=r(56608),Ee=r(29680),Oe=r(26059);let Fe=class extends se{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer"}async open(e){await this.init();const t=e&&e.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new a.Z("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new a.Z("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=i.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===i.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name.slice(i.name.indexOf("/")+1);const s=await this._fetchRasterInfo({signal:t});if(!(0,o.pC)(s))throw new a.Z("image-server-raster:open","cannot initialize image service");{const e="Map"===this.tileType?(0,Pe.d)(i.tileInfo,i):k.Z.fromJSON(i.tileInfo),{extent:t,pixelSize:r}=s,n=.5/s.width*r.x;let a,o;const l=e.lodAt(Math.max.apply(null,e.lods.map((e=>e.level))));"Map"!==this.tileType&&0!==i.maxScale&&("Raster"===this.tileType?(a=e.lods.find((e=>e.resolution===r.x)),a||(a=e.lods[e.lods.length-1])):(a=e.lods.find((e=>Math.abs(e.scale-i.maxScale)<n)),a||(a=e.lods.filter((e=>e.scale>i.maxScale)).sort(((e,t)=>e.scale>t.scale?1:-1))[0])),r.x=r.y=a.resolution,s.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),s.height=Math.ceil((t.ymax-t.ymin)/r.y-.1)),a||(a=l);const c=e.lodAt(Math.min.apply(null,e.lods.map((e=>e.level))));"Map"===this.tileType?this._levelOffset=e.lods[0].level:0!==i.minScale&&"Elevation"===this.tileType&&(o=e.lods.find((e=>Math.abs(e.scale-i.minScale)<n)),this._levelOffset=o.level-c.level),o||(o=c);const u=Math.max(r.x,r.y);(Math.abs(r.x-r.y)>n||!e.lods.some((e=>Math.abs(e.resolution-u)<n)))&&(r.x=r.y=a.resolution,s.width=Math.ceil((t.xmax-t.xmin)/r.x-.1),s.height=Math.ceil((t.ymax-t.ymin)/r.y-.1));const h=a.level-o.level,[f,d]=e.size,p=[];e.lods.forEach((e=>{e.level>=o.level&&e.level<=a.level&&p.push({x:e.resolution,y:e.resolution})})),p.sort(((e,t)=>e.x-t.x));const m=this.computeBlockBoundary(t,f,d,e.origin,p,h),g=p.length>1?p.slice(1):null;let y;i.transposeInfo&&(y={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:s.keyProperties?._yxs.PacketSize??0}),s.storageInfo=new q.Z({blockWidth:e.size[0],blockHeight:e.size[1],pyramidBlockWidth:e.size[0],pyramidBlockHeight:e.size[1],pyramidResolutions:g,compression:e.format,origin:e.origin,firstPyramidLevel:1,maximumPyramidLevel:h,tileInfo:e,transposeInfo:y,blockBoundary:m}),this._fixGCSShift(s),this._set("rasterInfo",s)}if(i.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:s.storageInfo.tileInfo,parsedUrl:(0,Te.mN)(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new Me.y({layer:e})}}async fetchRawTile(e,t,r,i={}){const{storageInfo:s,extent:n}=this.rasterInfo,{transposeInfo:a}=s,l=(0,o.pC)(a)&&!!i.transposedVariableName;if(this._slices&&!l&&null==i.sliceId)return null;const c=l?0:s.maximumPyramidLevel-e+this._levelOffset,u=`${this.url}/tile/${c}/${t}/${r}`,h=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(u,{query:h,responseType:"array-buffer",signal:i.signal});if(!f)return null;const d=l?a.tileSize:s.tileInfo.size,p=await this.decodePixelBlock(f,{width:d[0],height:d[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnPixelInterleavedDims:l}),m=s.blockBoundary[e];if("jpg"!==s.compression||r>m.minCol&&r<m.maxCol&&t>m.minRow&&t<m.maxRow)return p;const{origin:g,blockWidth:y,blockHeight:x}=s,{x:w,y:b}=this.getPyramidPixelSize(e),I=Math.round((n.xmin-g.x)/w)%y,v=Math.round((n.xmax-g.x)/w)%y||y,_=Math.round((g.y-n.ymax)/b)%x,C=Math.round((g.y-n.ymin)/b)%x||x,S=r===m.minCol?I:0,R=t===m.minRow?_:0,k=r===m.maxCol?v:y,T=t===m.maxRow?C:x;return(0,re.pW)(p,{x:S,y:R},{width:k-S,height:T-R}),p}getSliceIndex(e){if(!this._slices||(0,o.Wi)(e)||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const r=this._slices[e].multidimensionalDefinition;if(r.length===t.length&&!r.some((e=>{const r=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));return!r||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(r.values[0])?`${r.values[0][0]}-${r.values[0][1]}`:r.values[0])})))return e}return null}async fetchVariableStatisticsHistograms(e,t){const r=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([r,i]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(e,0,(0,o.Wg)(t.datumTransformation));if(null===r)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let n=s-i+this._levelOffset;const a=r.srcLocation;for(;n>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(n,r.row,r.col,t))break}catch{}if(n--,i++,r=this.identifyPixelLocation(a,i,(0,o.Wg)(t.datumTransformation)),null===r)return null}return-1===n||null==r?null:i}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),r=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),i=B.Z.fromJSON(t.spatialReference||t.extent.spatialReference),s=new V.Z({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:i});return new j.Z({width:e,height:r,bandCount:3,extent:F.Z.fromJSON(t.extent),spatialReference:i,pixelSize:s,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=e,i=(0,Oe.g)(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,n=await Promise.all([i,s]);return this._slices=n[1],n[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:r}=e;0===t.xmin&&360===t.xmax&&r.wkid&&r.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Ee.Z,e.extent=e.transform.forwardTransform(t))}};(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],Fe.prototype,"datasetFormat",void 0),(0,i._)([(0,h.Cb)()],Fe.prototype,"tileType",void 0),Fe=(0,i._)([(0,m.j)("esri.layers.support.rasterDatasets.ImageServerRaster")],Fe);const Be=Fe;var De=r(54163),Ne=r(48279);const ze=new Map;ze.set("Int8","s8"),ze.set("UInt8","u8"),ze.set("Int16","s16"),ze.set("UInt16","u16"),ze.set("Int32","s32"),ze.set("UInt32","u32"),ze.set("Float32","f32"),ze.set("Float64","f32"),ze.set("Double64","f32");const Le=new Map;Le.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Le.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Le.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Le.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let He=class extends se{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(e){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?(0,o.Wg)(e.signal):null,r=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:i,files:s}=this._parseHeader(r.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const t=await this._fetchAuxiliaryData(e);null!=t&&(i.statistics=t.statistics??i.statistics,i.histograms=t.histograms,t.histograms&&(0,o.Wi)(i.statistics)&&(i.statistics=(0,fe.Oh)(t.histograms)))}this._set("rasterInfo",i),this._files=s;const n=await this.request(s.index,{responseType:"array-buffer",signal:t});this._storageIndex=this._parseIndex(n.data);const{blockWidth:a,blockHeight:l}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:u,height:h}=this.rasterInfo,f=[],d=this._getBandSegmentCount();let p=0,m=-1;for(;p<this._storageIndex.length;){m++;const e=Math.ceil(u/a/c**m)-1,t=Math.ceil(h/l/c**m)-1;p+=(e+1)*(t+1)*d*4,f.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=f,m>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=m),this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){const{blockWidth:s,blockHeight:n,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[e];if(!l||l.maxRow<t||l.maxCol<r||l.minRow>t||l.minCol>r)return null;const{bandCount:c,pixelType:u}=this.rasterInfo,{ranges:h,actualTileWidth:f,actualTileHeight:d}=this._getTileLocation(e,t,r);if(!h||0===h.length)return null;if(0===h[0].from&&0===h[0].to){const e=new Uint8Array(s*n);return new De.Z({width:s,height:n,pixels:null,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,m=this._getBandSegmentCount(),g=[];let y=0;for(y=0;y<m;y++)(!p||p.indexOf[y]>-1)&&g.push(this.request(this._files.data,{range:{from:h[y].from,to:h[y].to},responseType:"array-buffer",signal:i.signal}));const x=await Promise.all(g),w=x.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),b=new Uint8Array(w);let I=0;for(y=0;y<m;y++)b.set(new Uint8Array(x[y].data),I),I+=x[y].data.byteLength;const v=Le.get(this.rasterInfo.storageInfo.compression).decoderFormat,_=await this.decodePixelBlock(b.buffer,{width:s,height:n,format:v,planes:p?.length||c,pixelType:u});if((0,o.pC)(this.rasterInfo.noDataValue)&&"lerc"!==v&&!_.mask){const e=this.rasterInfo.noDataValue[0];if(null!=e){const t=_.width*_.height,r=new Uint8Array(t);if(Math.abs(e)>1e24)for(y=0;y<t;y++)Math.abs((_.pixels[0][y]-e)/e)>1e-6&&(r[y]=1);else for(y=0;y<t;y++)_.pixels[0][y]!==e&&(r[y]=1);_.mask=r}}let C=0,S=0;if(f!==s||d!==n){let e=_.mask;if(e)for(y=0;y<n;y++)if(S=y*s,y<d)for(C=f;C<s;C++)e[S+C]=0;else for(C=0;C<s;C++)e[S+C]=0;else for(e=new Uint8Array(s*n),_.mask=e,y=0;y<d;y++)for(S=y*s,C=0;C<f;C++)e[S+C]=1}return _}_parseIndex(e){if(e.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let t,r,i,s,n,a;if(Ne.f){for(r=new Uint8Array(e),s=new ArrayBuffer(e.byteLength),i=new Uint8Array(s),n=0;n<e.byteLength/4;n++)for(a=0;a<4;a++)i[4*n+a]=r[4*n+3-a];t=new Uint32Array(s)}else t=new Uint32Array(e);return t}_getBandSegmentCount(){return Le.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:n}=this.rasterInfo.storageInfo,{width:a,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,h,f=0,d=0;for(h=0;h<e;h++)d=n**h,c=Math.ceil(a/i/d),u=Math.ceil(o/s/d),f+=c*u;d=n**e,c=Math.ceil(a/i/d),u=Math.ceil(o/s/d),f+=t*c+r,f*=4*l;const p=this._storageIndex.subarray(f,f+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=p[4*e+0]*2**32+p[4*e+1],g=m+p[4*e+2]*2**32+p[4*e+3],y.push({from:m,to:g});return{ranges:y,actualTileWidth:r<c-1?i:Math.ceil(a/d)-i*(c-1),actualTileHeight:t<u-1?s:Math.ceil(o/d)-s*(u-1)}}_parseHeader(e){const t=ge(e,"MRF_META/Raster");if(!t)throw new a.Z("mrf:open","not a valid MRF format");const r=ge(t,"Size"),i=parseInt(r.getAttribute("x"),10),s=parseInt(r.getAttribute("y"),10),n=parseInt(r.getAttribute("c"),10),o=(ye(t,"Compression")||"none").toLowerCase();if(!Le.has(o))throw new a.Z("mrf:open","currently does not support compression "+o);const l=ye(t,"DataType")||"UInt8",c=ze.get(l);if(null==c)throw new a.Z("mrf:open","currently does not support pixel type "+l);const u=ge(t,"PageSize"),h=parseInt(u.getAttribute("x"),10),f=parseInt(u.getAttribute("y"),10),d=ge(t,"DataValues");let p,m;if(d&&(m=d.getAttribute("NoData"),null!=m&&(p=m.trim().split(" ").map((e=>parseFloat(e))))),ge(e,"MRF_META/CachedSource"))throw new a.Z("mrf:open","currently does not support MRF referencing other data files");const g=ge(e,"MRF_META/GeoTags"),y=ge(g,"BoundingBox");let x,w=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),r=parseFloat(y.getAttribute("maxx")),i=parseFloat(y.getAttribute("maxy")),s=ye(g,"Projection")||"";let n;if("LOCAL_CS[]"!==s)if(s.toLowerCase().startsWith("epsg:")){const e=Number(s.slice(5));isNaN(e)||0===e||(n=new B.Z({wkid:e}))}else n=_e(s);else w=!0,n=new B.Z({wkid:3857});x=new F.Z(e,t,r,i),x.spatialReference=n}else w=!0,x=new F.Z({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new B.Z({wkid:3857})});const b=ge(e,"MRF_META/Rsets"),I=parseInt(b&&b.getAttribute("scale")||"2",10),v=x.spatialReference,_=new q.Z({origin:new V.Z({x:x.xmin,y:x.ymax,spatialReference:v}),blockWidth:h,blockHeight:f,pyramidBlockWidth:h,pyramidBlockHeight:f,compression:o,pyramidScalingFactor:I}),C=new V.Z({x:x.width/i,y:x.height/s,spatialReference:v}),S=new j.Z({width:i,height:s,extent:x,isPseudoSpatialReference:w,spatialReference:v,bandCount:n,pixelType:c,pixelSize:C,noDataValue:p,storageInfo:_}),R=ye(e,"datafile"),k=ye(e,"IndexFile");return{rasterInfo:S,files:{mrf:this.url,index:k||this.url.replace(".mrf",".idx"),data:R||this.url.replace(".mrf",Le.get(o).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Se(t)}catch{return null}}};(0,i._)([(0,h.Cb)()],He.prototype,"_files",void 0),(0,i._)([(0,h.Cb)()],He.prototype,"_storageIndex",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],He.prototype,"datasetFormat",void 0),He=(0,i._)([(0,m.j)("esri.layers.support.rasterIO.MRFRaster")],He);const Ze=He;var Ae=r(94793),Je=r(9832);const We=(e,t)=>{const r=e.get(t);return r&&r.values},je=(e,t)=>{const r=e.get(t);return r&&r.values[0]};let qe=class extends se{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?(0,o.Wg)(e.signal):null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!r)throw new a.Z("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:i,firstIFD:s,isBigTiff:n}=(0,Ae.cK)(r),l=[];await this._readIFDs(l,r,i,s,0,n?8:4,t);const c=(0,Ae.FI)(l),{width:u,height:h,tileWidth:f,tileHeight:d,planes:p,pixelType:m,compression:g,firstPyramidLevel:y,maximumPyramidLevel:x,pyramidBlockWidth:w,pyramidBlockHeight:b,tileBoundary:I,affine:v,metadata:_}=c;let C=_e(c.extent.spatialReference?.wkt||c.extent.spatialReference?.wkid),S=!1;null==C&&(S=!0,C=new B.Z({wkid:3857}));const R=new F.Z({...c.extent,spatialReference:C}),k=new V.Z(R?{x:R.xmin,y:R.ymax,spatialReference:C}:{x:0,y:0}),T=new q.Z({blockWidth:f,blockHeight:d,pyramidBlockWidth:w,pyramidBlockHeight:b,compression:g,origin:k,firstPyramidLevel:y,maximumPyramidLevel:x,blockBoundary:I}),P=new V.Z({x:(R.xmax-R.xmin)/u,y:(R.ymax-R.ymin)/h,spatialReference:C}),M=_?{BandProperties:_.bandProperties,DataType:_.dataType}:{},E=new j.Z({width:u,height:h,bandCount:p,pixelType:m,compression:g,pixelSize:P,storageInfo:T,spatialReference:C,isPseudoSpatialReference:S,keyProperties:M,extent:R,statistics:_?_.statistics:null});if(v?.length&&(E.nativeExtent=new F.Z({xmin:-.5,ymin:.5-h,xmax:u-.5,ymax:.5,spatialReference:C}),E.transform=new Ie.Z({polynomialOrder:1,forwardCoefficients:[v[2]+v[0]/2,v[5]-v[3]/2,v[0],v[3],-v[1],-v[4]]}),E.extent=E.transform.forwardTransform(E.nativeExtent),E.pixelSize=new V.Z({x:(R.xmax-R.xmin)/u,y:(R.ymax-R.ymin)/h,spatialReference:C}),T.origin.x=-.5,T.origin.y=.5),!this.ioConfig.skipExtensions?.includes("aux.xml")){const t=await this._fetchAuxiliaryData(e);if(null!=t){if(E.statistics=t.statistics??E.statistics,E.histograms=t.histograms,t.histograms&&(0,o.Wi)(E.statistics)&&(E.statistics=(0,fe.Oh)(t.histograms)),t.transform&&!v){E.transform=t.transform,E.nativeExtent=E.extent;const e=E.transform.forwardTransform(E.nativeExtent);E.pixelSize=new V.Z({x:(e.xmax-e.xmin)/u,y:(e.ymax-e.ymin)/h,spatialReference:C}),E.extent=e}E.spatialReference||(E.spatialReference=t.spatialReference)}}if(this._set("rasterInfo",E),this._headerInfo={littleEndian:i,isBigTiff:n,ifds:l,...c},!this._headerInfo.isSupported)throw new a.Z("tiffraster:open","this tiff is not supported: "+this._headerInfo.message);this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,r))return null;const s=this._getTileLocation(e,t,r);if(!s)return null;const{ranges:n,actualTileWidth:a,actualTileHeight:o,ifd:l}=s,c=n.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:i.signal}))),u=await Promise.all(c),h=u.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),f=1===u.length?u[0].data:new ArrayBuffer(h),d=[0],p=[0];if(u.length>1){const e=new Uint8Array(f);for(let t=0,r=0;t<u.length;t++){const i=u[t].data;e.set(new Uint8Array(i),r),d[t]=r,r+=i.byteLength,p[t]=i.byteLength}}const{blockWidth:m,blockHeight:g}=this.getBlockWidthHeight(e),y=await this.decodePixelBlock(f,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:p},width:m,height:g,planes:null,pixelType:null});let x,w,b;if(a!==m||o!==g){let e=y.mask;if(e)for(x=0;x<g;x++)if(b=x*m,x<o)for(w=a;w<m;w++)e[b+w]=0;else for(w=0;w<m;w++)e[b+w]=0;else for(e=new Uint8Array(m*g),y.mask=e,x=0;x<o;x++)for(b=x*m,w=0;w<a;w++)e[b+w]=1}return y}async _readIFDs(e,t,r,i,s,n=4,a){if(!i)return null;(i>=t.byteLength||i<0)&&(t=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:a})).data,s=i+s,i=0);const o=await this._readIFD(t,r,i,s,Je.Z.TIFF_TAGS,n,a);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-s,s,n,a)}async _readIFD(e,t,r,i,s=Je.Z.TIFF_TAGS,n=4,a){if(!e)return null;const o=(0,Ae.vr)(e,t,r,i,s,n);if(o.success){const r=[];if(o.ifd.forEach((e=>{e.values||r.push(e)})),r.length>0){const s=r.map((e=>e.offlineOffsetSize)),n=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-n<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:n,to:n+this._bufferSize},responseType:"array-buffer",signal:a});e=s,i=n,r.forEach((r=>(0,Ae.Dq)(e,t,r,i)))}}if(o.ifd.has("GEOKEYDIRECTORY")){const r=o.ifd.get("GEOKEYDIRECTORY"),s=r.values;if(s&&s.length>4){const n=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,r.valueOffset+6-i,i,Je.Z.GEO_KEYS,2,a);r.data=o.ifd,r.data&&r.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const r=await this.request(this.url,{range:{from:i,to:i+o.requiredBufferSize+4},responseType:"array-buffer",signal:a});return(e=r.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,i,Je.Z.TIFF_TAGS,4,a)}}_getTileLocation(e,t,r){const{firstPyramidLevel:i,blockBoundary:s}=this.rasterInfo.storageInfo,n=0===e?0:e-(i-1),a=this._headerInfo.ifds[n];if(!a)return null;const o=(0,Ae.If)(a,this._headerInfo),l=We(a,"TILEOFFSETS");if(void 0===l)return null;const c=We(a,"TILEBYTECOUNTS"),{minRow:u,minCol:h,maxRow:f,maxCol:d}=s[n];if(t>f||r>d||t<u||r<h)return null;const p=je(a,"IMAGEWIDTH"),m=je(a,"IMAGELENGTH"),g=je(a,"TILEWIDTH"),y=je(a,"TILELENGTH"),x=o?this.rasterInfo.bandCount:1,w=x*t*(d+1)+r,b=[{from:l[w],to:l[w+x-1]+c[w+x-1]-1}];if(o){let e=!0;for(let t=0;t<x;t++)if(l[w+t]+c[w+t]!==l[w+t+1]){e=!1;break}if(!e)for(let e=0;e<x;e++)b[e]={from:l[w+e],to:l[w+e]+c[w+e]-1}}const I=l[w],v=c[w];return null==I||null==v?null:{ranges:b,ifd:a,actualTileWidth:r===d?p%g:g,actualTileHeight:t===f?m%y:y}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return Se(t)}catch{return null}}};(0,i._)([(0,h.Cb)()],qe.prototype,"_files",void 0),(0,i._)([(0,h.Cb)()],qe.prototype,"_headerInfo",void 0),(0,i._)([(0,h.Cb)()],qe.prototype,"_bufferSize",void 0),(0,i._)([(0,h.Cb)({type:String,json:{write:!0}})],qe.prototype,"datasetFormat",void 0),qe=(0,i._)([(0,m.j)("esri.layers.support.rasterDatasets.TIFFRaster")],qe);const Ge=qe,Ue=new Map;Ue.set("CRF",{desc:"Cloud Raster Format",constructor:he}),Ue.set("MRF",{desc:"Meta Raster Format",constructor:Ze}),Ue.set("TIFF",{desc:"GeoTIFF",constructor:Ge}),Ue.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Be}),Ue.set("JPG",{desc:"JPG Raster Format",constructor:ke}),Ue.set("PNG",{desc:"PNG Raster Format",constructor:ke}),Ue.set("GIF",{desc:"GIF Raster Format",constructor:ke}),Ue.set("BMP",{desc:"BMP Raster Format",constructor:ke});var $e=r(32163);let Ve=class extends((0,y.h)((0,Z.M)((0,z.q)((0,L.I)((0,x.N)(N((0,A.n)((0,H.Q)((0,l.R)(g.Z)))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=(0,o.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(c.r9).then((()=>this._openRaster(t)))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[new J.Z({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const t=this.rasterInfo?.attributeTable?.fields;if(t){const r=t.filter((e=>"oid"!==e.type&&"value"!==e.name.toLowerCase())).map((e=>{const t=e.clone();return t.name="Raster."+e.name,t}));e=e.concat(r)}const r=this.rasterInfo.dataType;if(("vector-magdir"===r||"vector-uv"===r)&&(0,o.pC)(this.rasterInfo.multidimensionalInfo)){const t=this.rasterInfo.multidimensionalInfo.variables[0].unit?.trim(),r="Magnitude"+(t?` (${t})`:"");e.push(new J.Z({name:"Raster.Magnitude",alias:r,domain:null,editable:!1,type:"double"})),e.push(new J.Z({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return e}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,r){const i=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,s=(0,n.ij)(i,r)||void 0;if(null!=s)return s}createPopupTemplate(e){return(0,$e.eZ)({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:r}=this;if(this.loaded?"RasterTileServer"===r.datasetFormat&&("Raster"===r.tileType||"Map"===r.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new a.Z("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){this.raster?(this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url):this.raster=await class{static get supportedFormats(){const e=new Set;return Ue.forEach(((t,r)=>e.add(r))),e}static async open(e){const{url:t,ioConfig:r,sourceJSON:i}=e;let s=e.datasetFormat;null==s&&t.lastIndexOf(".")&&(s=t.slice(t.lastIndexOf(".")+1).toUpperCase()),"OVR"===s||"TIF"===s?s="TIFF":"JPG"!==s&&"JPEG"!==s&&"JFIF"!==s||(s="JPG"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(s="RasterTileServer");const n={url:t,sourceJSON:i,datasetFormat:s,ioConfig:r||{bandIds:null,sampling:null}};let o,l;if(this.supportedFormats.has(s))return o=Ue.get(s).constructor,l=new o(n),await l.open({signal:e.signal}),l;if(s)throw new a.Z("rasterfactory:open","not a supported format "+s);const c=Array.from(Ue.keys());let u=0;const h=()=>(s=c[u++],s?(o=Ue.get(s).constructor,l=new o(n),l.open({signal:e.signal}).then((()=>l)).catch((()=>h()))):null);return h()}static register(e,t,r){Ue.has(e.toUpperCase())||Ue.set(e.toUpperCase(),{desc:t,constructor:r})}}.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});const{rasterInfo:t}=this.raster;if(!t)throw new a.Z("imagery-tile-layer:load","cannot load resources on "+this.url);if(this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}null==this.title&&(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.own((0,u.YP)((()=>this.customParameters),(e=>{this.raster.ioConfig.customFetchParameters=e})))}};(0,i._)([(0,h.Cb)({type:[f.z8],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Ve.prototype,"bandIds",void 0),(0,i._)([(0,h.Cb)({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),(0,d.J)(W.c)],Ve.prototype,"interpolation",void 0),(0,i._)([(0,h.Cb)({json:{write:!0}})],Ve.prototype,"multidimensionalDefinition",void 0),(0,i._)([(0,h.Cb)(C.rn)],Ve.prototype,"legendEnabled",void 0),(0,i._)([(0,h.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Ve.prototype,"isReference",void 0),(0,i._)([(0,h.Cb)({type:["show","hide"]})],Ve.prototype,"listMode",void 0),(0,i._)([(0,h.Cb)({json:{read:!0,write:!0}})],Ve.prototype,"blendMode",void 0),(0,i._)([(0,h.Cb)()],Ve.prototype,"sourceJSON",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],Ve.prototype,"version",void 0),(0,i._)([(0,h.Cb)()],Ve.prototype,"title",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,json:{read:!1}})],Ve.prototype,"type",void 0),(0,i._)([(0,h.Cb)({type:["ArcGISTiledImageServiceLayer"]})],Ve.prototype,"operationalLayerType",void 0),(0,i._)([(0,h.Cb)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,r){t[r]=!e}}}})],Ve.prototype,"popupEnabled",void 0),(0,i._)([(0,h.Cb)({type:s.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],Ve.prototype,"popupTemplate",void 0),(0,i._)([(0,h.Cb)({readOnly:!0})],Ve.prototype,"defaultPopupTemplate",null),(0,i._)([(0,h.Cb)({readOnly:!0,type:[J.Z]})],Ve.prototype,"fields",void 0),(0,i._)([(0,h.Cb)({readOnly:!0,type:[J.Z]})],Ve.prototype,"rasterFields",null),(0,i._)([(0,h.Cb)({types:n.dr,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:n.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Ve.prototype,"renderer",null),(0,i._)([(0,p.r)("renderer")],Ve.prototype,"readRenderer",null),Ve=(0,i._)([(0,m.j)("esri.layers.ImageryTileLayer")],Ve);const Ye=Ve},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var i,s=r(43697),n=r(66577),a=r(38171),o=r(35454),l=r(96674),c=r(22974),u=r(70586),h=r(5600),f=(r(75215),r(71715)),d=r(52011),p=r(30556),m=r(82971),g=r(33955),y=r(1231);const x=new o.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let w=i=class extends l.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=m.Z.fromJSON(t.spatialReference),i=[];for(let t=0;t<e.length;t++){const s=e[t],n=a.Z.fromJSON(s),o=s.geometry&&s.geometry.spatialReference;(0,u.pC)(n.geometry)&&!o&&(n.geometry.spatialReference=r);const l=s.aggregateGeometries,c=n.aggregateGeometries;if(l&&(0,u.pC)(c))for(const e in c){const t=c[e],i=l[e]?.spatialReference;(0,u.pC)(t)&&!i&&(t.spatialReference=r)}i.push(n)}return i}writeGeometryType(e,t,r,i){if(e)return void x.write(e,t,r,i);const{features:s}=this;if(s)for(const e of s)if(e&&(0,u.pC)(e.geometry))return void x.write(e.geometry.type,t,r,i)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,i=(0,g.im)(e);return!r&&t.spatialReference&&(i.spatialReference=m.Z.fromJSON(t.spatialReference)),i}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,u.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new i(this.cloneProperties())}cloneProperties(){return(0,c.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const i=t.features[r];if(i.geometry){const t=e&&e[r];i.geometry=t&&t.toJSON()||i.geometry}}return t}quantize(e){const{scale:[t,r],translate:[i,s]}=e,n=this.features,a=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-i)/t)),(e=>Math.round((s-e)/r)));for(let e=0,t=n.length;e<t;e++)a((0,u.Wg)(n[e].geometry))||(n.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[i,s],scale:[n,a]}=r,o=this._getHydrationFunction(e,(e=>e*n+i),(e=>s-e*a));for(const{geometry:e}of t)(0,u.pC)(e)&&o(e);return this.transform=null,this}_quantizePoints(e,t,r){let i,s;const n=[];for(let a=0,o=e.length;a<o;a++){const o=e[a];if(a>0){const e=t(o[0]),a=r(o[1]);e===i&&a===s||(n.push([e-i,a-s]),i=e,s=a)}else i=t(o[0]),s=r(o[1]),n.push([i,s])}return n.length>0?n:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const i=(0,g.oU)(e)?e.rings:e.paths,s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e],a=this._quantizePoints(n,t,r);a&&s.push(a)}return s.length>0?((0,g.oU)(e)?e.rings=s:e.paths=s,e):null}:"multipoint"===e?e=>{const i=this._quantizePoints(e.points,t,r);return i.length>0?(e.points=i,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const i=(0,g.oU)(e)?e.rings:e.paths;let s,n;for(let e=0,a=i.length;e<a;e++){const a=i[e];for(let e=0,i=a.length;e<i;e++){const i=a[e];e>0?(s+=i[0],n+=i[1]):(s=i[0],n=i[1]),i[0]=t(s),i[1]=r(n)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const i=e.points;let s,n;for(let e=0,a=i.length;e<a;e++){const a=i[e];e>0?(s+=a[0],n+=a[1]):(s=a[0],n=a[1]),a[0]=t(s),a[1]=r(n)}}:void 0}};(0,s._)([(0,h.Cb)({type:String,json:{write:!0}})],w.prototype,"displayFieldName",void 0),(0,s._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"exceededTransferLimit",void 0),(0,s._)([(0,h.Cb)({type:[a.Z],json:{write:!0}})],w.prototype,"features",void 0),(0,s._)([(0,f.r)("features")],w.prototype,"readFeatures",null),(0,s._)([(0,h.Cb)({type:[y.Z],json:{write:!0}})],w.prototype,"fields",void 0),(0,s._)([(0,h.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:x.read}}})],w.prototype,"geometryType",void 0),(0,s._)([(0,p.c)("geometryType")],w.prototype,"writeGeometryType",null),(0,s._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasM",void 0),(0,s._)([(0,h.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],w.prototype,"hasZ",void 0),(0,s._)([(0,h.Cb)({types:n.qM,json:{write:!0}})],w.prototype,"queryGeometry",void 0),(0,s._)([(0,f.r)("queryGeometry")],w.prototype,"readQueryGeometry",null),(0,s._)([(0,h.Cb)({type:m.Z,json:{write:!0}})],w.prototype,"spatialReference",void 0),(0,s._)([(0,p.c)("spatialReference")],w.prototype,"writeSpatialReference",null),(0,s._)([(0,h.Cb)({json:{write:!0}})],w.prototype,"transform",void 0),w=i=(0,s._)([(0,d.j)("esri.rest.support.FeatureSet")],w),w.prototype.toJSON.isDefaultToJSON=!0;const b=w}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1421],{21421:(t,e,n)=>{n.r(e),n.d(e,{b:()=>s});var r,i,o,a=n(5732),u={exports:{}};r=u,i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(i=i||__filename),o=function(t){var e,n,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,r){e=t,n=r}));var o,u,s,l,c,f={};for(o in r)r.hasOwnProperty(o)&&(f[o]=r[o]);u="object"==typeof window,s="function"==typeof importScripts,l="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,c=!u&&!l&&!s;var p,d,y,h,v="";l?(v=s?require("path").dirname(v)+"/":__dirname+"/",p=function(t,e){return y||(y=require("fs")),h||(h=require("path")),t=h.normalize(t),y.readFileSync(t,e?null:"utf8")},d=function(t){var e=p(t,!0);return e.buffer||(e=new Uint8Array(e)),T(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof _e))throw t})),process.on("unhandledRejection",et),r.inspect=function(){return"[Emscripten Module object]"}):c?("undefined"!=typeof read&&(p=function(t){return read(t)}),d=function(t){var e;return"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(T("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(u||s)&&(s?v=self.location.href:document.currentScript&&(v=document.currentScript.src),i&&(v=i),v=0!==v.indexOf("blob:")?v.substr(0,v.lastIndexOf("/")+1):"",p=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},s&&(d=function(t){var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));var m,g,b=r.print||console.log.bind(console),$=r.printErr||console.warn.bind(console);for(o in f)f.hasOwnProperty(o)&&(r[o]=f[o]);f=null,r.arguments,r.thisProgram,r.quit,r.wasmBinary&&(m=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&et("no native wasm support detected");var C=new WebAssembly.Table({initial:157,maximum:157,element:"anyfunc"}),w=!1;function T(t,e){t||et("Assertion failed: "+e)}var _="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&_)return _.decode(t.subarray(e,i));for(var o="";e<i;){var a=t[e++];if(128&a){var u=63&t[e++];if(192!=(224&a)){var s=63&t[e++];if((a=224==(240&a)?(15&a)<<12|u<<6|s:(7&a)<<18|u<<12|s<<6|63&t[e++])<65536)o+=String.fromCharCode(a);else{var l=a-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&a)<<6|u)}else o+=String.fromCharCode(a)}return o}function A(t,e){return t?P(E,t,e):""}var W,S,E,k,O,j,F,R,x,D="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function I(t,e){for(var n=t,r=n>>1,i=r+e/2;!(r>=i)&&O[r];)++r;if((n=r<<1)-t>32&&D)return D.decode(E.subarray(t,n));for(var o=0,a="";;){var u=k[t+2*o>>1];if(0==u||o==e/2)return a;++o,a+=String.fromCharCode(u)}}function U(t,e,n){if(void 0===n&&(n=2147483647),n<2)return 0;for(var r=e,i=(n-=2)<2*t.length?n/2:t.length,o=0;o<i;++o){var a=t.charCodeAt(o);k[e>>1]=a,e+=2}return k[e>>1]=0,e-r}function M(t){return 2*t.length}function V(t,e){for(var n=0,r="";!(n>=e/4);){var i=j[t+4*n>>2];if(0==i)break;if(++n,i>=65536){var o=i-65536;r+=String.fromCharCode(55296|o>>10,56320|1023&o)}else r+=String.fromCharCode(i)}return r}function H(t,e,n){if(void 0===n&&(n=2147483647),n<4)return 0;for(var r=e,i=r+n-4,o=0;o<t.length;++o){var a=t.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),j[e>>2]=a,(e+=4)+4>i)break}return j[e>>2]=0,e-r}function z(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r>=55296&&r<=57343&&++n,e+=4}return e}function B(t,e){return t%e>0&&(t+=e-t%e),t}function q(t){W=t,r.HEAP8=S=new Int8Array(t),r.HEAP16=k=new Int16Array(t),r.HEAP32=j=new Int32Array(t),r.HEAPU8=E=new Uint8Array(t),r.HEAPU16=O=new Uint16Array(t),r.HEAPU32=F=new Uint32Array(t),r.HEAPF32=R=new Float32Array(t),r.HEAPF64=x=new Float64Array(t)}var N=r.INITIAL_MEMORY||16777216;function G(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var n=e.func;"number"==typeof n?void 0===e.arg?r.dynCall_v(n):r.dynCall_vi(n,e.arg):n(void 0===e.arg?null:e.arg)}else e(r)}}(g=r.wasmMemory?r.wasmMemory:new WebAssembly.Memory({initial:N/65536,maximum:32768}))&&(W=g.buffer),N=W.byteLength,q(W),j[80624]=5565536;var L=[],X=[],J=[],Y=[],Z=Math.ceil,K=Math.floor,Q=0,tt=null;function et(t){r.onAbort&&r.onAbort(t),$(t+=""),w=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(t);throw n(e),e}function nt(t,e){return String.prototype.startsWith?t.startsWith(e):0===t.indexOf(e)}function rt(t){return nt(t,"data:application/octet-stream;base64,")}function it(t){return nt(t,"file://")}r.preloadedImages={},r.preloadedAudios={};var ot,at="basis_transcoder.wasm";function ut(){try{if(m)return new Uint8Array(m);if(d)return d(at);throw"both async and sync fetching of the wasm failed"}catch(t){et(t)}}rt(at)||(ot=at,at=r.locateFile?r.locateFile(ot,v):v+ot),X.push({func:function(){$e()}});var st={};function lt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function ct(t){return this.fromWireType(F[t>>2])}var ft={},pt={},dt={};function yt(t){if(void 0===t)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=48&&e<=57?"_"+t:t}function ht(t,e){return t=yt(t),function(){return e.apply(this,arguments)}}function vt(t,e){var n=ht(e,(function(t){this.name=e,this.message=t;var n=new Error(t).stack;void 0!==n&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},n}var mt=void 0;function gt(t){throw new mt(t)}function bt(t,e,n){function r(e){var r=n(e);r.length!==t.length&>("Mismatched type converter count");for(var i=0;i<t.length;++i)Pt(t[i],r[i])}t.forEach((function(t){dt[t]=e}));var i=new Array(e.length),o=[],a=0;e.forEach((function(t,e){pt.hasOwnProperty(t)?i[e]=pt[t]:(o.push(t),ft.hasOwnProperty(t)||(ft[t]=[]),ft[t].push((function(){i[e]=pt[t],++a===o.length&&r(i)})))})),0===o.length&&r(i)}function $t(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var Ct=void 0;function wt(t){for(var e="",n=t;E[n];)e+=Ct[E[n++]];return e}var Tt=void 0;function _t(t){throw new Tt(t)}function Pt(t,e,n){if(n=n||{},!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var r=e.name;if(t||_t('type "'+r+'" must have a positive integer typeid pointer'),pt.hasOwnProperty(t)){if(n.ignoreDuplicateRegistrations)return;_t("Cannot register type '"+r+"' twice")}if(pt[t]=e,delete dt[t],ft.hasOwnProperty(t)){var i=ft[t];delete ft[t],i.forEach((function(t){t()}))}}function At(t){return{count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}}function Wt(t){_t(function(t){return t.$$.ptrType.registeredClass.name}(t)+" instance already deleted")}var St=!1;function Et(t){}function kt(t){t.count.value-=1,0===t.count.value&&function(t){t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)}(t)}function Ot(t){return"undefined"==typeof FinalizationGroup?(Ot=function(t){return t},t):(St=new FinalizationGroup((function(t){for(var e=t.next();!e.done;e=t.next()){var n=e.value;n.ptr?kt(n):console.warn("object already deleted: "+n.ptr)}})),Ot=function(t){return St.register(t,t.$$,t.$$),t},Et=function(t){St.unregister(t.$$)},Ot(t))}var jt=void 0,Ft=[];function Rt(){for(;Ft.length;){var t=Ft.pop();t.$$.deleteScheduled=!1,t.delete()}}function xt(){}var Dt={};function It(t,e,n){if(void 0===t[e].overloadTable){var r=t[e];t[e]=function(){return t[e].overloadTable.hasOwnProperty(arguments.length)||_t("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[e].overloadTable+")!"),t[e].overloadTable[arguments.length].apply(this,arguments)},t[e].overloadTable=[],t[e].overloadTable[r.argCount]=r}}function Ut(t,e,n){r.hasOwnProperty(t)?((void 0===n||void 0!==r[t].overloadTable&&void 0!==r[t].overloadTable[n])&&_t("Cannot register public name '"+t+"' twice"),It(r,t,t),r.hasOwnProperty(n)&&_t("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),r[t].overloadTable[n]=e):(r[t]=e,void 0!==n&&(r[t].numArguments=n))}function Mt(t,e,n,r,i,o,a,u){this.name=t,this.constructor=e,this.instancePrototype=n,this.rawDestructor=r,this.baseClass=i,this.getActualType=o,this.upcast=a,this.downcast=u,this.pureVirtualFunctions=[]}function Vt(t,e,n){for(;e!==n;)e.upcast||_t("Expected null or instance of "+n.name+", got an instance of "+e.name),t=e.upcast(t),e=e.baseClass;return t}function Ht(t,e){if(null===e)return this.isReference&&_t("null is not a valid "+this.name),0;e.$$||_t('Cannot pass "'+ue(e)+'" as a '+this.name),e.$$.ptr||_t("Cannot pass deleted object as a pointer of type "+this.name);var n=e.$$.ptrType.registeredClass;return Vt(e.$$.ptr,n,this.registeredClass)}function zt(t,e){var n;if(null===e)return this.isReference&&_t("null is not a valid "+this.name),this.isSmartPointer?(n=this.rawConstructor(),null!==t&&t.push(this.rawDestructor,n),n):0;e.$$||_t('Cannot pass "'+ue(e)+'" as a '+this.name),e.$$.ptr||_t("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&e.$$.ptrType.isConst&&_t("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);var r=e.$$.ptrType.registeredClass;if(n=Vt(e.$$.ptr,r,this.registeredClass),this.isSmartPointer)switch(void 0===e.$$.smartPtr&&_t("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:e.$$.smartPtrType===this?n=e.$$.smartPtr:_t("Cannot convert argument of type "+(e.$$.smartPtrType?e.$$.smartPtrType.name:e.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:n=e.$$.smartPtr;break;case 2:if(e.$$.smartPtrType===this)n=e.$$.smartPtr;else{var i=e.clone();n=this.rawShare(n,ie((function(){i.delete()}))),null!==t&&t.push(this.rawDestructor,n)}break;default:_t("Unsupporting sharing policy")}return n}function Bt(t,e){if(null===e)return this.isReference&&_t("null is not a valid "+this.name),0;e.$$||_t('Cannot pass "'+ue(e)+'" as a '+this.name),e.$$.ptr||_t("Cannot pass deleted object as a pointer of type "+this.name),e.$$.ptrType.isConst&&_t("Cannot convert argument of type "+e.$$.ptrType.name+" to parameter type "+this.name);var n=e.$$.ptrType.registeredClass;return Vt(e.$$.ptr,n,this.registeredClass)}function qt(t,e,n){if(e===n)return t;if(void 0===n.baseClass)return null;var r=qt(t,e,n.baseClass);return null===r?null:n.downcast(r)}var Nt={};function Gt(t,e){return e.ptrType&&e.ptr||gt("makeClassHandle requires ptr and ptrType"),!!e.smartPtrType!=!!e.smartPtr&>("Both smartPtrType and smartPtr must be specified"),e.count={value:1},Ot(Object.create(t,{$$:{value:e}}))}function Lt(t,e,n,r,i,o,a,u,s,l,c){this.name=t,this.registeredClass=e,this.isReference=n,this.isConst=r,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=a,this.rawGetPointee=u,this.rawConstructor=s,this.rawShare=l,this.rawDestructor=c,i||void 0!==e.baseClass?this.toWireType=zt:r?(this.toWireType=Ht,this.destructorFunction=null):(this.toWireType=Bt,this.destructorFunction=null)}function Xt(t,e,n){r.hasOwnProperty(t)||gt("Replacing nonexistant public symbol"),void 0!==r[t].overloadTable&&void 0!==n?r[t].overloadTable[n]=e:(r[t]=e,r[t].argCount=n)}function Jt(t,e){t=wt(t);var n=function(t){var n=[e];return function(){n.length=arguments.length+1;for(var e=0;e<arguments.length;e++)n[e+1]=arguments[e];return t.apply(null,n)}}(r["dynCall_"+t]);return"function"!=typeof n&&_t("unknown function pointer with signature "+t+": "+e),n}var Yt=void 0;function Zt(t){var e=Te(t),n=wt(e);return we(e),n}function Kt(t,e){var n=[],r={};throw e.forEach((function t(e){r[e]||pt[e]||(dt[e]?dt[e].forEach(t):(n.push(e),r[e]=!0))})),new Yt(t+": "+n.map(Zt).join([", "]))}function Qt(t,e){for(var n=[],r=0;r<t;r++)n.push(j[(e>>2)+r]);return n}function te(t,e,n,r,i){var o=e.length;o<2&&_t("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=null!==e[1]&&null!==n,u=!1,s=1;s<e.length;++s)if(null!==e[s]&&void 0===e[s].destructorFunction){u=!0;break}var l="void"!==e[0].name,c=o-2,f=new Array(c),p=[],d=[];return function(){var n;arguments.length!==c&&_t("function "+t+" called with "+arguments.length+" arguments, expected "+c+" args!"),d.length=0,p.length=a?2:1,p[0]=i,a&&(n=e[1].toWireType(d,this),p[1]=n);for(var o=0;o<c;++o)f[o]=e[o+2].toWireType(d,arguments[o]),p.push(f[o]);var s=r.apply(null,p);if(u)lt(d);else for(o=a?1:2;o<e.length;o++){var y=1===o?n:f[o-2];null!==e[o].destructorFunction&&e[o].destructorFunction(y)}if(l)return e[0].fromWireType(s)}}var ee=[],ne=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function re(t){t>4&&0==--ne[t].refcount&&(ne[t]=void 0,ee.push(t))}function ie(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=ee.length?ee.pop():ne.length;return ne[e]={refcount:1,value:t},e}}function oe(t,e,n){switch(e){case 0:return function(t){var e=n?S:E;return this.fromWireType(e[t])};case 1:return function(t){var e=n?k:O;return this.fromWireType(e[t>>1])};case 2:return function(t){var e=n?j:F;return this.fromWireType(e[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function ae(t,e){var n=pt[t];return void 0===n&&_t(e+" has unknown type "+Zt(t)),n}function ue(t){if(null===t)return"null";var e=typeof t;return"object"===e||"array"===e||"function"===e?t.toString():""+t}function se(t,e){switch(e){case 2:return function(t){return this.fromWireType(R[t>>2])};case 3:return function(t){return this.fromWireType(x[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function le(t,e,n){switch(e){case 0:return n?function(t){return S[t]}:function(t){return E[t]};case 1:return n?function(t){return k[t>>1]}:function(t){return O[t>>1]};case 2:return n?function(t){return j[t>>2]}:function(t){return F[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function ce(t){return t||_t("Cannot use deleted val. handle = "+t),ne[t].value}var fe={};function pe(t){var e=fe[t];return void 0===e?wt(t):e}var de=[];function ye(){if("object"==typeof globalThis)return globalThis;function t(t){t.$$$embind_global$$$=t;var e="object"==typeof $$$embind_global$$$&&t.$$$embind_global$$$===t;return e||delete t.$$$embind_global$$$,e}if("object"==typeof $$$embind_global$$$)return $$$embind_global$$$;if("object"==typeof a.c&&t(a.c)?$$$embind_global$$$=a.c:"object"==typeof self&&t(self)&&($$$embind_global$$$=self),"object"==typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.")}var he={};function ve(t){try{return g.grow(t-W.byteLength+65535>>>16),q(g.buffer),1}catch(t){}}var me={mappings:{},buffers:[null,[],[]],printChar:function(t,e){var n=me.buffers[t];0===e||10===e?((1===t?b:$)(P(n,0)),n.length=0):n.push(e)},varargs:void 0,get:function(){return me.varargs+=4,j[me.varargs-4>>2]},getStr:function(t){return A(t)},get64:function(t,e){return t}};mt=r.InternalError=vt(Error,"InternalError"),function(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Ct=t}(),Tt=r.BindingError=vt(Error,"BindingError"),xt.prototype.isAliasOf=function(t){if(!(this instanceof xt))return!1;if(!(t instanceof xt))return!1;for(var e=this.$$.ptrType.registeredClass,n=this.$$.ptr,r=t.$$.ptrType.registeredClass,i=t.$$.ptr;e.baseClass;)n=e.upcast(n),e=e.baseClass;for(;r.baseClass;)i=r.upcast(i),r=r.baseClass;return e===r&&n===i},xt.prototype.clone=function(){if(this.$$.ptr||Wt(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=Ot(Object.create(Object.getPrototypeOf(this),{$$:{value:At(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},xt.prototype.delete=function(){this.$$.ptr||Wt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_t("Object already scheduled for deletion"),Et(this),kt(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},xt.prototype.isDeleted=function(){return!this.$$.ptr},xt.prototype.deleteLater=function(){return this.$$.ptr||Wt(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&_t("Object already scheduled for deletion"),Ft.push(this),1===Ft.length&&jt&&jt(Rt),this.$$.deleteScheduled=!0,this},Lt.prototype.getPointee=function(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},Lt.prototype.destructor=function(t){this.rawDestructor&&this.rawDestructor(t)},Lt.prototype.argPackAdvance=8,Lt.prototype.readValueFromPointer=ct,Lt.prototype.deleteObject=function(t){null!==t&&t.delete()},Lt.prototype.fromWireType=function(t){var e=this.getPointee(t);if(!e)return this.destructor(t),null;var n=function(t,e){return e=function(t,e){for(void 0===e&&_t("ptr should not be undefined");t.baseClass;)e=t.upcast(e),t=t.baseClass;return e}(t,e),Nt[e]}(this.registeredClass,e);if(void 0!==n){if(0===n.$$.count.value)return n.$$.ptr=e,n.$$.smartPtr=t,n.clone();var r=n.clone();return this.destructor(t),r}function i(){return this.isSmartPointer?Gt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:e,smartPtrType:this,smartPtr:t}):Gt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}var o,a=this.registeredClass.getActualType(e),u=Dt[a];if(!u)return i.call(this);o=this.isConst?u.constPointerType:u.pointerType;var s=qt(e,this.registeredClass,o.registeredClass);return null===s?i.call(this):this.isSmartPointer?Gt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s,smartPtrType:this,smartPtr:t}):Gt(o.registeredClass.instancePrototype,{ptrType:o,ptr:s})},r.getInheritedInstanceCount=function(){return Object.keys(Nt).length},r.getLiveInheritedInstances=function(){var t=[];for(var e in Nt)Nt.hasOwnProperty(e)&&t.push(Nt[e]);return t},r.flushPendingDeletes=Rt,r.setDelayFunction=function(t){jt=t,Ft.length&&jt&&jt(Rt)},Yt=r.UnboundTypeError=vt(Error,"UnboundTypeError"),r.count_emval_handles=function(){for(var t=0,e=5;e<ne.length;++e)void 0!==ne[e]&&++t;return t},r.get_first_emval=function(){for(var t=5;t<ne.length;++t)if(void 0!==ne[t])return ne[t];return null};var ge={u:function(t){var e=st[t];delete st[t];var n=e.rawConstructor,r=e.rawDestructor,i=e.fields;bt([t],i.map((function(t){return t.getterReturnType})).concat(i.map((function(t){return t.setterArgumentType}))),(function(t){var o={};return i.forEach((function(e,n){var r=e.fieldName,a=t[n],u=e.getter,s=e.getterContext,l=t[n+i.length],c=e.setter,f=e.setterContext;o[r]={read:function(t){return a.fromWireType(u(s,t))},write:function(t,e){var n=[];c(f,t,l.toWireType(n,e)),lt(n)}}})),[{name:e.name,fromWireType:function(t){var e={};for(var n in o)e[n]=o[n].read(t);return r(t),e},toWireType:function(t,e){for(var i in o)if(!(i in e))throw new TypeError('Missing field: "'+i+'"');var a=n();for(i in o)o[i].write(a,e[i]);return null!==t&&t.push(r,a),a},argPackAdvance:8,readValueFromPointer:ct,destructorFunction:r}]}))},J:function(t,e,n,r,i){var o=$t(n);Pt(t,{name:e=wt(e),fromWireType:function(t){return!!t},toWireType:function(t,e){return e?r:i},argPackAdvance:8,readValueFromPointer:function(t){var r;if(1===n)r=S;else if(2===n)r=k;else{if(4!==n)throw new TypeError("Unknown boolean type size: "+e);r=j}return this.fromWireType(r[t>>o])},destructorFunction:null})},y:function(t,e,n,r,i,o,a,u,s,l,c,f,p){c=wt(c),o=Jt(i,o),u&&(u=Jt(a,u)),l&&(l=Jt(s,l)),p=Jt(f,p);var d=yt(c);Ut(d,(function(){Kt("Cannot construct "+c+" due to unbound types",[r])})),bt([t,e,n],r?[r]:[],(function(e){var n,i;e=e[0],i=r?(n=e.registeredClass).instancePrototype:xt.prototype;var a=ht(d,(function(){if(Object.getPrototypeOf(this)!==s)throw new Tt("Use 'new' to construct "+c);if(void 0===f.constructor_body)throw new Tt(c+" has no accessible constructor");var t=f.constructor_body[arguments.length];if(void 0===t)throw new Tt("Tried to invoke ctor of "+c+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(f.constructor_body).toString()+") parameters instead!");return t.apply(this,arguments)})),s=Object.create(i,{constructor:{value:a}});a.prototype=s;var f=new Mt(c,a,s,p,n,o,u,l),y=new Lt(c,f,!0,!1,!1),h=new Lt(c+"*",f,!1,!1,!1),v=new Lt(c+" const*",f,!1,!0,!1);return Dt[t]={pointerType:h,constPointerType:v},Xt(d,a),[y,h,v]}))},x:function(t,e,n,r,i,o){T(e>0);var a=Qt(e,n);i=Jt(r,i);var u=[o],s=[];bt([],[t],(function(t){var n="constructor "+(t=t[0]).name;if(void 0===t.registeredClass.constructor_body&&(t.registeredClass.constructor_body=[]),void 0!==t.registeredClass.constructor_body[e-1])throw new Tt("Cannot register multiple constructors with identical number of parameters ("+(e-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.registeredClass.constructor_body[e-1]=function(){Kt("Cannot construct "+t.name+" due to unbound types",a)},bt([],a,(function(r){return t.registeredClass.constructor_body[e-1]=function(){arguments.length!==e-1&&_t(n+" called with "+arguments.length+" arguments, expected "+(e-1)),s.length=0,u.length=e;for(var t=1;t<e;++t)u[t]=r[t].toWireType(s,arguments[t-1]);var o=i.apply(null,u);return lt(s),r[0].fromWireType(o)},[]})),[]}))},d:function(t,e,n,r,i,o,a,u){var s=Qt(n,r);e=wt(e),o=Jt(i,o),bt([],[t],(function(t){var r=(t=t[0]).name+"."+e;function i(){Kt("Cannot call "+r+" due to unbound types",s)}u&&t.registeredClass.pureVirtualFunctions.push(e);var l=t.registeredClass.instancePrototype,c=l[e];return void 0===c||void 0===c.overloadTable&&c.className!==t.name&&c.argCount===n-2?(i.argCount=n-2,i.className=t.name,l[e]=i):(It(l,e,r),l[e].overloadTable[n-2]=i),bt([],s,(function(i){var u=te(r,i,t,o,a);return void 0===l[e].overloadTable?(u.argCount=n-2,l[e]=u):l[e].overloadTable[n-2]=u,[]})),[]}))},k:function(t,e,n){t=wt(t),bt([],[e],(function(e){return e=e[0],r[t]=e.fromWireType(n),[]}))},I:function(t,e){Pt(t,{name:e=wt(e),fromWireType:function(t){var e=ne[t].value;return re(t),e},toWireType:function(t,e){return ie(e)},argPackAdvance:8,readValueFromPointer:ct,destructorFunction:null})},n:function(t,e,n,r){var i=$t(n);function o(){}e=wt(e),o.values={},Pt(t,{name:e,constructor:o,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,e){return e.value},argPackAdvance:8,readValueFromPointer:oe(e,i,r),destructorFunction:null}),Ut(e,o)},a:function(t,e,n){var r=ae(t,"enum");e=wt(e);var i=r.constructor,o=Object.create(r.constructor.prototype,{value:{value:n},constructor:{value:ht(r.name+"_"+e,(function(){}))}});i.values[n]=o,i[e]=o},B:function(t,e,n){var r=$t(n);Pt(t,{name:e=wt(e),fromWireType:function(t){return t},toWireType:function(t,e){if("number"!=typeof e&&"boolean"!=typeof e)throw new TypeError('Cannot convert "'+ue(e)+'" to '+this.name);return e},argPackAdvance:8,readValueFromPointer:se(e,r),destructorFunction:null})},i:function(t,e,n,r,i,o){var a=Qt(e,n);t=wt(t),i=Jt(r,i),Ut(t,(function(){Kt("Cannot call "+t+" due to unbound types",a)}),e-1),bt([],a,(function(n){var r=[n[0],null].concat(n.slice(1));return Xt(t,te(t,r,null,i,o),e-1),[]}))},j:function(t,e,n,r,i){e=wt(e),-1===i&&(i=4294967295);var o=$t(n),a=function(t){return t};if(0===r){var u=32-8*n;a=function(t){return t<<u>>>u}}var s=-1!=e.indexOf("unsigned");Pt(t,{name:e,fromWireType:a,toWireType:function(t,n){if("number"!=typeof n&&"boolean"!=typeof n)throw new TypeError('Cannot convert "'+ue(n)+'" to '+this.name);if(n<r||n>i)throw new TypeError('Passing a number "'+ue(n)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+r+", "+i+"]!");return s?n>>>0:0|n},argPackAdvance:8,readValueFromPointer:le(e,o,0!==r),destructorFunction:null})},h:function(t,e,n){var r=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function i(t){var e=F,n=e[t>>=2],i=e[t+1];return new r(W,i,n)}Pt(t,{name:n=wt(n),fromWireType:i,argPackAdvance:8,readValueFromPointer:i},{ignoreDuplicateRegistrations:!0})},C:function(t,e){var n="std::string"===(e=wt(e));Pt(t,{name:e,fromWireType:function(t){var e,r=F[t>>2];if(n)for(var i=t+4,o=0;o<=r;++o){var a=t+4+o;if(o==r||0==E[a]){var u=A(i,a-i);void 0===e?e=u:(e+=String.fromCharCode(0),e+=u),i=a+1}}else{var s=new Array(r);for(o=0;o<r;++o)s[o]=String.fromCharCode(E[t+4+o]);e=s.join("")}return we(t),e},toWireType:function(t,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var r="string"==typeof e;r||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||_t("Cannot pass non-string to std::string");var i=(n&&r?function(){return function(t){for(var e=0,n=0;n<t.length;++n){var r=t.charCodeAt(n);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&t.charCodeAt(++n)),r<=127?++e:e+=r<=2047?2:r<=65535?3:4}return e}(e)}:function(){return e.length})(),o=Ce(4+i+1);if(F[o>>2]=i,n&&r)!function(t,e,n){!function(t,e,n,r){if(!(r>0))return 0;for(var i=n+r-1,o=0;o<t.length;++o){var a=t.charCodeAt(o);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(n>=i)break;e[n++]=a}else if(a<=2047){if(n+1>=i)break;e[n++]=192|a>>6,e[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;e[n++]=224|a>>12,e[n++]=128|a>>6&63,e[n++]=128|63&a}else{if(n+3>=i)break;e[n++]=240|a>>18,e[n++]=128|a>>12&63,e[n++]=128|a>>6&63,e[n++]=128|63&a}}e[n]=0}(t,E,e,n)}(e,o+4,i+1);else if(r)for(var a=0;a<i;++a){var u=e.charCodeAt(a);u>255&&(we(o),_t("String has UTF-16 code units that do not fit in 8 bits")),E[o+4+a]=u}else for(a=0;a<i;++a)E[o+4+a]=e[a];return null!==t&&t.push(we,o),o},argPackAdvance:8,readValueFromPointer:ct,destructorFunction:function(t){we(t)}})},w:function(t,e,n){var r,i,o,a,u;n=wt(n),2===e?(r=I,i=U,a=M,o=function(){return O},u=1):4===e&&(r=V,i=H,a=z,o=function(){return F},u=2),Pt(t,{name:n,fromWireType:function(t){for(var n,i=F[t>>2],a=o(),s=t+4,l=0;l<=i;++l){var c=t+4+l*e;if(l==i||0==a[c>>u]){var f=r(s,c-s);void 0===n?n=f:(n+=String.fromCharCode(0),n+=f),s=c+e}}return we(t),n},toWireType:function(t,r){"string"!=typeof r&&_t("Cannot pass non-string to C++ string type "+n);var o=a(r),s=Ce(4+o+e);return F[s>>2]=o>>u,i(r,s+4,o+e),null!==t&&t.push(we,s),s},argPackAdvance:8,readValueFromPointer:ct,destructorFunction:function(t){we(t)}})},v:function(t,e,n,r,i,o){st[t]={name:wt(e),rawConstructor:Jt(n,r),rawDestructor:Jt(i,o),fields:[]}},c:function(t,e,n,r,i,o,a,u,s,l){st[t].fields.push({fieldName:wt(e),getterReturnType:n,getter:Jt(r,i),getterContext:o,setterArgumentType:a,setter:Jt(u,s),setterContext:l})},K:function(t,e){Pt(t,{isVoid:!0,name:e=wt(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,e){}})},m:function(t,e,n){t=ce(t),e=ae(e,"emval::as");var r=[],i=ie(r);return j[n>>2]=i,e.toWireType(r,t)},s:function(t,e,n,r){(t=de[t])(e=ce(e),n=pe(n),null,r)},b:re,z:function(t){return 0===t?ie(ye()):(t=pe(t),ie(ye()[t]))},t:function(t,e){var n=function(t,e){for(var n=new Array(t),r=0;r<t;++r)n[r]=ae(j[(e>>2)+r],"parameter "+r);return n}(t,e),r=n[0],i=new Array(t-1);return function(t){var e=de.length;return de.push(t),e}((function(e,o,a,u){for(var s=0,l=0;l<t-1;++l)i[l]=n[l+1].readValueFromPointer(u+s),s+=n[l+1].argPackAdvance;var c=e[o].apply(e,i);for(l=0;l<t-1;++l)n[l+1].deleteObject&&n[l+1].deleteObject(i[l]);if(!r.isVoid)return r.toWireType(a,c)}))},r:function(t){return t=pe(t),ie(r[t])},e:function(t,e){return ie((t=ce(t))[e=ce(e)])},g:function(t){t>4&&(ne[t].refcount+=1)},q:function(t,e,n,r){t=ce(t);var i=he[e];return i||(i=function(t){var e=new Array(t+1);return function(n,r,i){e[0]=n;for(var o=0;o<t;++o){var a=ae(j[(r>>2)+o],"parameter "+o);e[o+1]=a.readValueFromPointer(i),i+=a.argPackAdvance}return ie(new(n.bind.apply(n,e)))}}(e),he[e]=i),i(t,n,r)},f:function(t){return ie(pe(t))},l:function(t){lt(ne[t].value),re(t)},p:function(){et()},F:function(t,e,n){E.copyWithin(t,e,e+n)},G:function(t){t>>>=0;var e=E.length,n=2147483648;if(t>n)return!1;for(var r=1;r<=4;r*=2){var i=e*(1+.2/r);if(i=Math.min(i,t+100663296),ve(Math.min(n,B(Math.max(16777216,t,i),65536))))return!0}return!1},H:function(t){return 0},D:function(t,e,n,r,i){},A:function(t,e,n,r){for(var i=0,o=0;o<n;o++){for(var a=j[e+8*o>>2],u=j[e+(8*o+4)>>2],s=0;s<u;s++)me.printChar(t,E[a+s]);i+=u}return j[r>>2]=i,0},memory:g,o:function(t){return(t=+t)>=0?+K(t+.5):+Z(t-.5)},E:function(t){},table:C};!function(){var t={a:ge};function e(t,e){var n=t.exports;r.asm=n,function(t){if(Q--,r.monitorRunDependencies&&r.monitorRunDependencies(Q),0==Q&&tt){var e=tt;tt=null,e()}}()}function n(t){e(t.instance)}function i(e){return(m||!u&&!s||"function"!=typeof fetch||it(at)?new Promise((function(t,e){t(ut())})):fetch(at,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+at+"'";return t.arrayBuffer()})).catch((function(){return ut()}))).then((function(e){return WebAssembly.instantiate(e,t)})).then(e,(function(t){$("failed to asynchronously prepare wasm: "+t),et(t)}))}if(Q++,r.monitorRunDependencies&&r.monitorRunDependencies(Q),r.instantiateWasm)try{return r.instantiateWasm(t,e)}catch(t){return $("Module.instantiateWasm callback failed with error: "+t),!1}!function(){if(m||"function"!=typeof WebAssembly.instantiateStreaming||rt(at)||it(at)||"function"!=typeof fetch)return i(n);fetch(at,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(n,(function(t){return $("wasm streaming compile failed: "+t),$("falling back to ArrayBuffer instantiation"),i(n)}))}))}()}();var be,$e=r.___wasm_call_ctors=function(){return($e=r.___wasm_call_ctors=r.asm.L).apply(null,arguments)},Ce=r._malloc=function(){return(Ce=r._malloc=r.asm.M).apply(null,arguments)},we=r._free=function(){return(we=r._free=r.asm.N).apply(null,arguments)},Te=r.___getTypeName=function(){return(Te=r.___getTypeName=r.asm.O).apply(null,arguments)};function _e(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Pe(t){function n(){be||(be=!0,r.calledRun=!0,w||(G(X),G(J),e(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)t=r.postRun.shift(),Y.unshift(t);var t;G(Y)}()))}Q>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)t=r.preRun.shift(),L.unshift(t);var t;G(L)}(),Q>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),n()}),1)):n()))}if(r.___embind_register_native_and_builtin_types=function(){return(r.___embind_register_native_and_builtin_types=r.asm.P).apply(null,arguments)},r.dynCall_viii=function(){return(r.dynCall_viii=r.asm.Q).apply(null,arguments)},r.dynCall_vi=function(){return(r.dynCall_vi=r.asm.R).apply(null,arguments)},r.dynCall_v=function(){return(r.dynCall_v=r.asm.S).apply(null,arguments)},r.dynCall_i=function(){return(r.dynCall_i=r.asm.T).apply(null,arguments)},r.dynCall_iii=function(){return(r.dynCall_iii=r.asm.U).apply(null,arguments)},r.dynCall_ii=function(){return(r.dynCall_ii=r.asm.V).apply(null,arguments)},r.dynCall_vii=function(){return(r.dynCall_vii=r.asm.W).apply(null,arguments)},r.dynCall_iiii=function(){return(r.dynCall_iiii=r.asm.X).apply(null,arguments)},r.dynCall_iiiii=function(){return(r.dynCall_iiiii=r.asm.Y).apply(null,arguments)},r.dynCall_iiiiii=function(){return(r.dynCall_iiiiii=r.asm.Z).apply(null,arguments)},r.dynCall_iiiiiiii=function(){return(r.dynCall_iiiiiiii=r.asm._).apply(null,arguments)},r.dynCall_iiiiiiiii=function(){return(r.dynCall_iiiiiiiii=r.asm.$).apply(null,arguments)},r.dynCall_viiii=function(){return(r.dynCall_viiii=r.asm.aa).apply(null,arguments)},r.dynCall_iiiiiii=function(){return(r.dynCall_iiiiiii=r.asm.ba).apply(null,arguments)},r.dynCall_iiiiiiiiiiiiiiiiiiii=function(){return(r.dynCall_iiiiiiiiiiiiiiiiiiii=r.asm.ca).apply(null,arguments)},r.dynCall_iiiiiiiiiiiiiiiiiiiii=function(){return(r.dynCall_iiiiiiiiiiiiiiiiiiiii=r.asm.da).apply(null,arguments)},r.dynCall_iiiiiiiiiiiiiiiiiii=function(){return(r.dynCall_iiiiiiiiiiiiiiiiiii=r.asm.ea).apply(null,arguments)},r.dynCall_viiiii=function(){return(r.dynCall_viiiii=r.asm.fa).apply(null,arguments)},r.dynCall_iiiiiiiiii=function(){return(r.dynCall_iiiiiiiiii=r.asm.ga).apply(null,arguments)},r.dynCall_iiiiiiiiiii=function(){return(r.dynCall_iiiiiiiiiii=r.asm.ha).apply(null,arguments)},r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.ia).apply(null,arguments)},r.dynCall_viiiiii=function(){return(r.dynCall_viiiiii=r.asm.ja).apply(null,arguments)},tt=function t(){be||Pe(),be||(tt=t)},r.run=Pe,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return Pe(),t.ready},r.exports=o;const s=function(t,e){for(var n=0;n<e.length;n++){const r=e[n];if("string"!=typeof r&&!Array.isArray(r))for(const e in r)if("default"!==e&&!(e in t)){const n=Object.getOwnPropertyDescriptor(r,e);n&&Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>r[e]})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}({__proto__:null,default:u.exports},[u.exports])}}]);
|