@arcgis/core 4.26.0-next.20230113 → 4.26.0-next.20230115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/05679a6529421d546fe0.js +1 -0
- package/assets/esri/core/workers/chunks/2e5b61ee21fa6287cc65.js +1 -0
- package/assets/esri/core/workers/chunks/2e7e8b035673d90deefd.js +1 -0
- package/assets/esri/core/workers/chunks/4e13f84441f0b149f32e.js +1 -0
- package/assets/esri/core/workers/chunks/5605de870cfc1498a393.js +1 -0
- package/assets/esri/core/workers/chunks/5ad3a3d15831b759e758.js +1 -0
- package/assets/esri/core/workers/chunks/633a86e8e8ad2ab866f4.js +1 -0
- package/assets/esri/core/workers/chunks/86491e6269e25b1766ed.js +1 -0
- package/assets/esri/core/workers/chunks/c3fda4056c5eeaef1339.js +1 -0
- package/assets/esri/core/workers/chunks/{399c453397a1f10408bf.js → c7b23f664a2707b96daf.js} +1 -1
- package/assets/esri/core/workers/chunks/{dd2e9206133d6888f33d.js → dc6bad8c0a09393834a1.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc3564689bd42cba97f9.js → f34c607e73757f6024eb.js} +1 -1
- package/core/accessorSupport/decorators/persistable.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/SceneService.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/layers/support/rasterFormats/Lerc.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFormats/pixelRangeUtils.js +5 -0
- package/layers/support/rasterFunctions/ConvolutionFunction.js +1 -1
- package/layers/support/rasterFunctions/stretchUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/MapView.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/assets/esri/core/workers/chunks/1363e647f3b0bca07e09.js +0 -1
- package/assets/esri/core/workers/chunks/2541edeae4b1a53b8723.js +0 -1
- package/assets/esri/core/workers/chunks/3b689bb038ebc301c3b2.js +0 -1
- package/assets/esri/core/workers/chunks/6216cd8134703fd9d9b4.js +0 -1
- package/assets/esri/core/workers/chunks/64f137358100a1c818f0.js +0 -1
- package/assets/esri/core/workers/chunks/6fba07833345b2d8d373.js +0 -1
- package/assets/esri/core/workers/chunks/78fd609f334a29ef39dc.js +0 -1
- package/assets/esri/core/workers/chunks/798cd875d64182741364.js +0 -1
- package/assets/esri/core/workers/chunks/8bd26c71e78698c16778.js +0 -1
package/WebMap.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import a from"./core/Error.js";import s from"./core/Loadable.js";import{loadAll as n}from"./core/loadAll.js";import l from"./core/Logger.js";import{unwrap as p,isSome as m}from"./core/maybe.js";import{MultiOriginJSONMixin as h,MultiOriginJSONSupport as u}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as d}from"./core/Promise.js";import{eachAlways as c}from"./core/promiseUtils.js";import{whenOnce as y}from"./core/reactiveUtils.js";import{urlToObject as w,isDataProtocol as g,dataComponents as f,addQueryParameter as b}from"./core/urlUtils.js";import{property as _}from"./core/accessorSupport/decorators/property.js";import"./core/accessorSupport/ensureType.js";import"./core/arrayUtils.js";import{reader as v}from"./core/accessorSupport/decorators/reader.js";import{subclass as A}from"./core/accessorSupport/decorators/subclass.js";import{writer as I}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as S}from"./core/accessorSupport/originUtils.js";import{readLoadable as j}from"./core/accessorSupport/read.js";import L from"./geometry/SpatialReference.js";import{equals as P}from"./geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as U,webMercatorToGeographic as O}from"./geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as V}from"./layers/support/arcgisLayerUrl.js";import{isFeatureServiceLayer as F,isFeatureCollectionLayer as T}from"./layers/support/layerUtils.js";import R from"./networks/UtilityNetwork.js";import W from"./portal/Portal.js";import k from"./portal/PortalItem.js";import{removeTypeKeyword as N,addTypeKeyword as C,hasTypeKeyword as M,TypeKeyword as x}from"./portal/support/portalItemUtils.js";import{project as E}from"./rest/geometryService/project.js";import B from"./rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as G,isDeveloperBasemapLayer as J,findSpatialReference as D}from"./support/basemapUtils.js";import K from"./support/MapFloorInfo.js";import $ from"./webdoc/GeotriggersInfo.js";import z from"./webdoc/RangeInfo.js";import q from"./webdoc/Widgets.js";import{getOptimalThumbnailSize as H}from"./webdoc/support/thumbnailUtils.js";import{getLayerJSON as Q}from"./webdoc/support/writeUtils.js";import X from"./webmap/ApplicationProperties.js";import Y from"./webmap/Bookmark.js";import Z from"./webmap/InitialViewProperties.js";import{Version as ee}from"./webmap/Version.js";import te from"./webmap/background/ColorBackground.js";const re=new ee(2,26),ie="Web Map",oe=o.ofType(Y),ae=o.ofType(R),se=new Map;se.set("image/jpeg","jpeg"),se.set("image/jpg","jpg"),se.set("image/png","png"),se.set("image/gif","gif");const ne="ArcGIS Pro",le=x.JSAPI,pe="CollectorDisabled",me="Collector",he="Data Editing",ue="OfflineDisabled",de="Offline",ce="Workforce Project",ye="Workforce Worker",we="Workforce Dispatcher",ge="Offline Map Areas",fe="FieldMapsDisabled",be=x.DEVELOPER_BASEMAP,_e="UtilityNetwork",ve=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map((e=>e.toLowerCase()));let Ae=class extends(h(s.LoadableMixin(d(r)))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this.applicationProperties=null,this.bookmarks=new oe,this.floorInfo=null,this.geotriggersInfo=null,this.initialViewProperties=new Z,this.portalItem=null,this.presentation=null,this.sourceVersion=null,this.widgets=null,this.utilityNetworks=null,this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){const e=this.portalItem;this.portalItem=null,e?.destroy()}initialize(){if(this.when().catch((e=>{l.getLogger(this.declaredClass).error("#load()","Failed to load web map",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=le}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new Z;t.background&&(r.background=te.fromJSON(t.background));const o=t.initialState?.viewpoint;if(o){if(o.rotation){ee.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===ne&&(o.rotation*=-1)}r.viewpoint=i.fromJSON(o)}return t.mapRangeInfo&&(r.rangeInfo=z.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=L.fromJSON(t.spatialReference)),r}writeInitialViewProperties(e,t,r,i){if(!e)return;const o=e.background;o&&o.color&&(t.background=o.write({},i)),e.viewpoint&&(t.initialState={viewpoint:e.viewpoint.write({},i)}),e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i))}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new ee(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${re.major}.${re.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem&&this.portalItem.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return n(this,(e=>{e(this.ground,this.basemap,this.layers,this.tables)}))}read(e,t){t={...t,origin:"web-map"};const r=this._getAuthoringPropsState();j(this,e,(t=>super.read(e,t)),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new a("webmap:not-loaded","Web map must be loaded before it can be serialized");throw l.getLogger(this.declaredClass).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:"web-map",restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}async save(e){e=e||{},this._validateItem(),await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const t=this.portalItem,r={origin:"web-map",messages:[],writtenProperties:[],url:t.itemUrl?w(t.itemUrl):void 0,portal:t.portal||W.getDefault()},i=this.write({},r);return this._validateJSONForWriting(r,e),await this._updateItemProperties(t),await this._updateItem(t,i,r),await this._updateItemThumbnail(),t}async saveAs(e,t){t=t||{};const r=this._getPortalItem(e);await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const i={origin:"web-map",messages:[],writtenProperties:[],url:null,portal:r.portal},o=this.write({},i);this._validateJSONForWriting(i,t),await this._updateItemPropertiesForSaveAs(r);const a=this._getThumbnailState();return await this._createItem(r,o,i,t),this._restoreThumbnailFromState(a),await this._updateItemThumbnail(),r}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find((t=>t.id===e.id))}_collectAllLayersJSON(e){return e.reduce(((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e)),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map((e=>p(Q(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t)))).filter(Boolean).toArray()}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-map"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):Promise.resolve()}_loadFromItem(e){return e.load().catch((e=>{throw new a("webmap:load-portal-item","Failed to load portal item",{error:e})})).then((()=>{if("Web Map"!==e.type)throw new a("webmap:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Map'",{type:e.type})})).then((()=>e.fetchData())).then((t=>(this.resourceInfo=t,this._readAndLoadFromJSON(t,{origin:"web-map",portal:e.portal||W.getDefault()})))).then((()=>this._computeInitialViewpoint()))}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_validateJSON(e){const t=ee.parse(e.version||"","webmap");return re.validate(t),e.version=`${t.major}.${t.minor}`,e}_loadFromJSON(e,t){const r={context:{...t,layerContainerType:"operational-layers"}};return this.portalItem&&(r.context.portal=this.portalItem.portal||W.getDefault()),import("./layers/support/layersCreator.js").then((({populateOperationalLayers:t})=>{const i=[],o=e.operationalLayers;o&&o.length&&i.push(t(this.layers,o,r));const a={...r,context:{...r.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"},s=e.tables;return s&&s.length&&i.push(t(this.tables,s,a)),c(i).then((()=>{}))}))}async _computeInitialViewpoint(){let e=this.initialViewProperties;const t=e?.viewpoint?.targetGeometry;if(t)return;const r=await this._getExtentFromItem();r&&(e=e?e.clone():new Z,e.viewpoint=new i,e.viewpoint.targetGeometry=r,this.initialViewProperties=e)}async _getExtentFromItem(){const e=this.initialViewProperties?.spatialReference,t=this.portalItem?.extent;if(e&&t){if(e.isWGS84)return t.clone();if(e.isWebMercator)return U(t);return(await import("./portal/support/geometryServiceUtils.js")).getGeometryServiceURL(this.portalItem).then((r=>{const i=new B;return i.geometries=[t],i.outSpatialReference=e,E(r,i)})).then((e=>e[0])).catch((e=>(l.getLogger(this.declaredClass).error("Error projecting item's extent:",e),null)))}return null}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e&&e.viewing&&e.viewing.search,r=e=>this.allLayers.some((t=>t.id===e));t&&t.layers&&(t.layers=t.layers.filter((e=>r(e.id)))),t&&t.tables&&(t.tables=t.tables.filter((e=>this.tables.some((t=>t.id===e.id)))));const i=e&&e.editing&&e.editing.locationTracking;i&&i.info&&!r(i.info.layerId)&&(e.editing=null);const o=this.presentation&&this.presentation.slides;o&&o.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>r(e.id))))}))}async _validateMap(){if(!this.basemap?.baseLayers.length)throw new a("webmap:save","Map does not have a valid basemap with a base layer.");let e=null;if(await y((()=>{const t=D(this.initialViewProperties,this.basemap);return e=t.spatialReference,!t.updating})),!P(e,this.initialViewProperties.spatialReference))throw new a("webmap:save","The spatial reference of the basemap is not compatible with the one from the map.",{expected:this.initialViewProperties.spatialReference,actual:e})}_validateItem(){if(!this.portalItem)throw l.getLogger(this.declaredClass).error("save: requires the portalItem property to be set"),new a("webmap:portal-item-not-set","Portal item to save to has not been set on the WebMap");this._validateItemType(this.portalItem)}_validateItemType(e){if(e.type!==ie)throw new a("webmap:portal-item-wrong-type",`Portal item needs to have type "${ie}"`)}_loadLayerContainers(){const e=[];return this.basemap&&e.push(this.basemap.load()),this.ground&&e.push(this.ground.load()),c(e).then((()=>{}))}async _beforeSave(){const e=[];for(const t of this.allLayers)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await c(e)}_loadAllLayers(){const e=this._getAllLayersAndTables().map((e=>e.load()));return c(e).then((()=>{}))}_getAllLayersAndTables(){return this.allLayers.concat(this.allTables)}_validateJSONForWriting(e,t){let r=(e.messages?e.messages:[]).filter((e=>"error"===e.type)).map((e=>new a(e.name,e.message,e.details)));if(t.ignoreUnsupported&&(r=r.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name))),r.length>0)throw new a("webmap:save","Failed to save webmap due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}async _updateItemProperties(e){e.extent=await this._getWGS84Extent(this.initialViewProperties.viewpoint.targetGeometry),await this._updateTypeKeywords(e)}async _updateItemPropertiesForSaveAs(e){N(e,pe),N(e,fe),N(e,x.METADATA),N(e,ue),N(e,ge),N(e,we),N(e,ce),N(e,ye),await this._updateItemProperties(e)}async _getWGS84Extent(e){const t=e.clone().normalize();let r;if(t.length>1)for(const i of t)r?i.width>r.width&&(r=i):r=i;else r=t[0];return this._projectToWGS84(r)}async _projectToWGS84(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return O(e);const r=await import("./portal/support/geometryServiceUtils.js"),i=await r.getGeometryServiceURL(this.portalItem),o=new B;o.geometries=[e],o.outSpatialReference=L.WGS84;return(await E(i,o))[0]}async _updateTypeKeywords(e){C(e,le),await this._loadAllLayers(),this._evalCollectorKeyword(e),this._evalDataEditingKeyword(e),this._evalOfflineKeyword(e),this._evalDeveloperBasemapKeyword(e),this._evalUtilityNetworkKeyword(e),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}_evalCollectorKeyword(e){M(e,pe)||M(e,ce)||M(e,ye)||M(e,we)||!this._hasEditableFeatureLayer()?N(e,me):C(e,me)}_evalDataEditingKeyword(e){this._hasEditableFeatureLayer()?C(e,he):N(e,he)}_evalOfflineKeyword(e){!M(e,ue)&&this._isOfflineCapableMap()?C(e,de):N(e,de)}_evalDeveloperBasemapKeyword(e){G(this.basemap)?C(e,be):N(e,be)}_evalUtilityNetworkKeyword(e){this.utilityNetworks?.length?C(e,_e):N(e,_e)}_hasEditableFeatureLayer(){return this._getAllLayersAndTables().some((e=>e.loaded&&F(e)&&e.capabilities.operations.supportsEditing&&e.editingEnabled))}_isOfflineCapableMap(){return this._getAllLayersAndTables().filter((e=>"group"!==e.type)).every((e=>e.loaded&&this._isOfflineCapableLayer(e)))}_isFeatureCollectionLike(e){return T(e)||"map-notes"===e.type||"route"===e.type}_isOfflineCapableLayer(e){return F(e)&&e.capabilities.operations.supportsSync||this._isFeatureCollectionLike(e)&&!e.portalItem||("tile"===e.type||"vector-tile"===e.type)&&(e.capabilities.operations.supportsExportTiles||this._isExportableAGOLTileLayer(e)||J(e))&&e.spatialReference.equals(this.initialViewProperties.spatialReference)}_isExportableAGOLTileLayer(e){return"tile"===e.type&&(V(e.url)&&ve.some((t=>e.url?.toLowerCase().includes("/"+t+"/"))))}async _updateItem(e,t,r){await e.update({data:t}),this._syncUpInstanceWithItem(e,t,r)}async _createItem(e,t,r,i){const o=this.portalItem,s=!!(o&&o.id&&o.portal.user),n=e.portal;if(await n.signIn(),!await this._canCopyItem(o,s,n))throw new a("webmap:save-as-copy-not-allowed","Owner of this map does not allow others to save a copy");await(n.user?.addItem({item:e,folder:i.folder,data:t})),this.portalItem=e,this._syncUpInstanceWithItem(e,t,r)}async _canCopyItem(e,t,r){return!(m(e)&&e.id&&e.typeKeywords&&e.typeKeywords.includes("useOnly"))||e.portal.portalHostname===r.portalHostname&&(t||await e.reload(),"admin"===e.itemControl||"update"===e.itemControl)}_syncUpInstanceWithItem(e,t,r){u.prototype.read.call(this,{version:t.version,authoringApp:t.authoringApp,authoringAppVersion:t.authoringAppVersion},{origin:"web-map",ignoreDefaults:!0,url:e.itemUrl&&w(e.itemUrl)}),S(r),this.resourceInfo=t}async _updateItemThumbnail(){this.thumbnailUrl&&this._isOverridden("thumbnailUrl")&&(await(this.portalItem?.updateThumbnail({thumbnail:this.thumbnailUrl,filename:this._thumbnailFilename})),this._clearThumbnailOverride())}_getPortalItem(e){let t=k.from(e);return t.id&&(t=t.clone(),t.id=null),t.type||(t.type=ie),t.portal||(t.portal=W.getDefault()),this._validateItemType(t),t}async _updateFromInternal(e,t){if(t=t||{},await y((()=>e.ready)),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)for(const e of["visible","featureEffect"])e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e]);await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.persistableViewModels)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=H(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(g(e)){const t=f(e),r=t&&t.mediaType,i=r&&se.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:b(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}_restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}static fromJSON(e){const t=e;if(!t)throw new a("webmap:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:t})}};Ae.VERSION=re,e([_({type:X,json:{write:!0}})],Ae.prototype,"applicationProperties",void 0),e([_({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],Ae.prototype,"authoringApp",null),e([I("authoringApp")],Ae.prototype,"writeAuthoringApp",null),e([_({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],Ae.prototype,"authoringAppVersion",null),e([I("authoringAppVersion")],Ae.prototype,"writeAuthoringAppVersion",null),e([_({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Ae.prototype,"basemap",void 0),e([_({type:oe,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],Ae.prototype,"bookmarks",void 0),e([_({type:K,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],Ae.prototype,"floorInfo",void 0),e([_({type:$,json:{write:!0}})],Ae.prototype,"geotriggersInfo",void 0),e([_({type:Z,nonNullable:!0,json:{read:{source:["background","initialState.viewpoint","mapRangeInfo","spatialReference"]},write:{ignoreOrigin:!0,target:{background:{type:te},"initialState.viewpoint":{type:i},mapRangeInfo:{type:z},spatialReference:{type:L}}}}})],Ae.prototype,"initialViewProperties",void 0),e([v("initialViewProperties")],Ae.prototype,"readInitialViewProperties",null),e([I("initialViewProperties")],Ae.prototype,"writeInitialViewProperties",null),e([_({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],Ae.prototype,"layers",void 0),e([I("layers")],Ae.prototype,"writeLayers",null),e([_({type:k})],Ae.prototype,"portalItem",void 0),e([_({json:{write:!0}})],Ae.prototype,"presentation",void 0),e([_()],Ae.prototype,"resourceInfo",void 0),e([_({readOnly:!0,type:ee,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],Ae.prototype,"sourceVersion",void 0),e([v("sourceVersion")],Ae.prototype,"readSourceVersion",null),e([I("sourceVersion")],Ae.prototype,"writeSourceVersion",null),e([_({json:{read:!1,write:{ignoreOrigin:!0}}})],Ae.prototype,"tables",void 0),e([I("tables")],Ae.prototype,"writeTables",null),e([_()],Ae.prototype,"thumbnailUrl",null),e([_({type:q,json:{write:!0}})],Ae.prototype,"widgets",void 0),e([_({type:ae,json:{read:!0,write:!0}})],Ae.prototype,"utilityNetworks",void 0),Ae=e([A("esri.WebMap")],Ae);const Ie=Ae;export{Ie as default};
|
|
5
|
+
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import a from"./core/Error.js";import s from"./core/Loadable.js";import{loadAll as n}from"./core/loadAll.js";import l from"./core/Logger.js";import{unwrap as p,isSome as m}from"./core/maybe.js";import{MultiOriginJSONMixin as u,MultiOriginJSONSupport as h}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as d}from"./core/Promise.js";import{eachAlways as c}from"./core/promiseUtils.js";import{whenOnce as y}from"./core/reactiveUtils.js";import{urlToObject as w,isDataProtocol as g,dataComponents as f,addQueryParameter as b}from"./core/urlUtils.js";import{property as _}from"./core/accessorSupport/decorators/property.js";import"./core/accessorSupport/ensureType.js";import"./core/arrayUtils.js";import{reader as v}from"./core/accessorSupport/decorators/reader.js";import{subclass as I}from"./core/accessorSupport/decorators/subclass.js";import{writer as A}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as S}from"./core/accessorSupport/originUtils.js";import{readLoadable as j}from"./core/accessorSupport/read.js";import U from"./geometry/SpatialReference.js";import{equals as P}from"./geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as O,webMercatorToGeographic as L}from"./geometry/support/webMercatorUtils.js";import{isServerOrServicesAGOLUrl as V}from"./layers/support/arcgisLayerUrl.js";import{isFeatureServiceLayer as R,isFeatureCollectionLayer as F}from"./layers/support/layerUtils.js";import T from"./networks/UtilityNetwork.js";import W from"./portal/Portal.js";import k from"./portal/PortalItem.js";import{removeTypeKeyword as N,addTypeKeyword as C,hasTypeKeyword as M,TypeKeyword as x}from"./portal/support/portalItemUtils.js";import{project as E}from"./rest/geometryService/project.js";import B from"./rest/support/ProjectParameters.js";import{hasDeveloperBasemapLayer as G,isDeveloperBasemapLayer as J,findSpatialReference as D}from"./support/basemapUtils.js";import K from"./support/MapFloorInfo.js";import $ from"./webdoc/GeotriggersInfo.js";import z from"./webdoc/RangeInfo.js";import q from"./webdoc/Widgets.js";import{getOptimalThumbnailSize as H}from"./webdoc/support/thumbnailUtils.js";import{getLayerJSON as Q}from"./webdoc/support/writeUtils.js";import X from"./webmap/ApplicationProperties.js";import Y from"./webmap/Bookmark.js";import Z from"./webmap/InitialViewProperties.js";import{Version as ee}from"./webmap/Version.js";import te from"./webmap/background/ColorBackground.js";const re=new ee(2,26),ie="Web Map",oe=o.ofType(Y),ae=o.ofType(T),se=new Map;se.set("image/jpeg","jpeg"),se.set("image/jpg","jpg"),se.set("image/png","png"),se.set("image/gif","gif");const ne="ArcGIS Pro",le=x.JSAPI,pe="CollectorDisabled",me="Collector",ue="Data Editing",he="OfflineDisabled",de="Offline",ce="Workforce Project",ye="Workforce Worker",we="Workforce Dispatcher",ge="Offline Map Areas",fe="FieldMapsDisabled",be=x.DEVELOPER_BASEMAP,_e="UtilityNetwork",ve=["NatGeo_World_Map","Ocean_Basemap","USA_Topo_Maps","World_Imagery","World_Street_Map","World_Terrain_Base","World_Topo_Map","World_Hillshade","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Reference/World_Boundaries_and_Places","Reference/World_Reference_Overlay","Reference/World_Transportation"].map((e=>e.toLowerCase()));let Ie=class extends(u(s.LoadableMixin(d(r)))){constructor(e){super(e),this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1,this._thumbnailFilename=null,this._updateFromPromise=null,this._resourceReferences={portalItem:null,paths:[]},this.applicationProperties=null,this.bookmarks=new oe,this.floorInfo=null,this.geotriggersInfo=null,this.initialViewProperties=new Z,this.portalItem=null,this.presentation=null,this.sourceVersion=null,this.widgets=null,this.utilityNetworks=null,this.authoringApp=this.authoringAppVersion=null,this._isAuthoringAppSetByUser=this._isAuthoringAppVersionSetByUser=!1}destroy(){const e=this.portalItem;this.portalItem=null,e?.destroy()}initialize(){if(this.when().catch((e=>{l.getLogger(this.declaredClass).error("#load()","Failed to load web map",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t)}}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp=le}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}readInitialViewProperties(e,t){const r=new Z;t.background&&(r.background=te.fromJSON(t.background));const o=t.initialState?.viewpoint;if(o){if(o.rotation){ee.parse(t.version||"","webmap").lessThan(2,20)&&t.authoringApp===ne&&(o.rotation*=-1)}r.viewpoint=i.fromJSON(o)}return t.mapRangeInfo&&(r.rangeInfo=z.fromJSON(t.mapRangeInfo)),t.spatialReference&&(r.spatialReference=U.fromJSON(t.spatialReference)),r}writeInitialViewProperties(e,t,r,i){if(!e)return;const o=e.background;o&&o.color&&(t.background=o.write({},i)),e.viewpoint&&(t.initialState={viewpoint:e.viewpoint.write({},i)}),e.rangeInfo&&(t.mapRangeInfo=e.rangeInfo.toJSON(i)),e.spatialReference&&(t.spatialReference=e.spatialReference.write({},i))}writeLayers(e,t,r,i){t[r]=this._writeLayers(e,i,"operational-layers")}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new ee(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${re.major}.${re.minor}`}writeTables(e,t,r,i){const o=this._writeLayers(e,i,"tables");o.length&&(t[r]=o)}get thumbnailUrl(){return this.portalItem&&this.portalItem.thumbnailUrl||null}set thumbnailUrl(e){e?(this._override("thumbnailUrl",e),this._thumbnailFilename=this._generateCustomThumbnailFilename(e)):this._clearThumbnailOverride()}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return n(this,(e=>{e(this.ground,this.basemap,this.layers,this.tables)}))}read(e,t){t={...t,origin:"web-map"};const r=this._getAuthoringPropsState();j(this,e,(t=>super.read(e,t)),t),this._restoreAuthoringPropsFromState(r)}write(e,t){if("loaded"!==this.loadStatus){const e=new a("webmap:not-loaded","Web map must be loaded before it can be serialized");throw l.getLogger(this.declaredClass).error("#toJSON()","Web map must be loaded before it can be serialized",this.loadError||this.loadStatus),e}return this._removeDanglingLayerRefs(),t={...t,origin:"web-map",restrictedWebMapWriting:!0,webmap:this},super.write(e,t)}async save(e){e=e||{},this._validateItem();const t=import("./webdoc/support/saveUtils.js");await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const r=this.portalItem,i=w(r.itemUrl),o={origin:"web-map",messages:[],writtenProperties:[],url:i,portal:r.portal||W.getDefault(),portalItem:r,verifyItemRelativeUrls:i?{rootPath:i.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[],propertyPendingOperations:[]}},a=this.write({},o);return await Promise.all(o.resources.pendingOperations),this._validateJSONForWriting(o,e),await this._updateItemProperties(r),await this._updateItem(r,a,o),await Promise.all([this._updateItemThumbnail(),t.then((({saveResources:e})=>e(this._resourceReferences,o,null)))]),r}async saveAs(e,t){t=t||{};const r=this._getPortalItem(e),i=import("./webdoc/support/saveUtils.js");await this._updateFromPromise,await this.load(),await this._loadLayerContainers(),await this._beforeSave(),await this._validateMap();const o={origin:"web-map",messages:[],writtenProperties:[],url:null,portal:r.portal,portalItem:r,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[],propertyPendingOperations:[]}},a=this.write({},o);await Promise.all(o.resources.pendingOperations),this._validateJSONForWriting(o,t),await this._updateItemPropertiesForSaveAs(r);const s=this._getThumbnailState();return await this._createItem(r,a,o,t),this._restoreThumbnailFromState(s),await Promise.all([this._updateItemThumbnail(),i.then((({saveResources:e})=>e(this._resourceReferences,o,null)))]),r}async updateFrom(e,t){const r=this._updateFromInternal(e,t);this._updateFromPromise=r,await r;r===this._updateFromPromise&&(this._updateFromPromise=null)}getLayerJSONFromResourceInfo(e){const t=this.resourceInfo;return this._collectAllLayersJSON([...t?.baseMap?.baseMapLayers||[],...t?.operationalLayers||[],...this.basemap?.resourceInfo?.data?.baseMapLayers||[]]).find((t=>t.id===e.id))}_collectAllLayersJSON(e){return e.reduce(((e,t)=>(e.push(t),"GroupLayer"===t.layerType&&(e=e.concat(this._collectAllLayersJSON(t.layers||[]))),e)),[])}_writeLayers(e,t,r){t={...t,layerContainerType:r};return e.map((e=>p(Q(e,"tables"===r?null:this.getLayerJSONFromResourceInfo(e),t)))).filter(Boolean).toArray()}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-map"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):Promise.resolve()}_loadFromItem(e){return e.load().catch((e=>{throw new a("webmap:load-portal-item","Failed to load portal item",{error:e})})).then((()=>{if("Web Map"!==e.type)throw new a("webmap:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Map'",{type:e.type})})).then((()=>e.fetchData())).then((t=>(this.resourceInfo=t,this._readAndLoadFromJSON(t,{origin:"web-map",portal:e.portal||W.getDefault()})))).then((()=>this._computeInitialViewpoint()))}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_validateJSON(e){const t=ee.parse(e.version||"","webmap");return re.validate(t),e.version=`${t.major}.${t.minor}`,e}_loadFromJSON(e,t){const r={context:{...t,layerContainerType:"operational-layers"}};return this.portalItem&&(r.context.portal=this.portalItem.portal||W.getDefault()),import("./layers/support/layersCreator.js").then((({populateOperationalLayers:t})=>{const i=[],o=e.operationalLayers;o&&o.length&&i.push(t(this.layers,o,r));const a={...r,context:{...r.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"},s=e.tables;return s&&s.length&&i.push(t(this.tables,s,a)),c(i).then((()=>{}))}))}async _computeInitialViewpoint(){let e=this.initialViewProperties;const t=e?.viewpoint?.targetGeometry;if(t)return;const r=await this._getExtentFromItem();r&&(e=e?e.clone():new Z,e.viewpoint=new i,e.viewpoint.targetGeometry=r,this.initialViewProperties=e)}async _getExtentFromItem(){const e=this.initialViewProperties?.spatialReference,t=this.portalItem?.extent;if(e&&t){if(e.isWGS84)return t.clone();if(e.isWebMercator)return O(t);return(await import("./portal/support/geometryServiceUtils.js")).getGeometryServiceURL(this.portalItem).then((r=>{const i=new B;return i.geometries=[t],i.outSpatialReference=e,E(r,i)})).then((e=>e[0])).catch((e=>(l.getLogger(this.declaredClass).error("Error projecting item's extent:",e),null)))}return null}_removeDanglingLayerRefs(){const e=this.applicationProperties,t=e&&e.viewing&&e.viewing.search,r=e=>this.allLayers.some((t=>t.id===e));t&&t.layers&&(t.layers=t.layers.filter((e=>r(e.id)))),t&&t.tables&&(t.tables=t.tables.filter((e=>this.tables.some((t=>t.id===e.id)))));const i=e&&e.editing&&e.editing.locationTracking;i&&i.info&&!r(i.info.layerId)&&(e.editing=null);const o=this.presentation&&this.presentation.slides;o&&o.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>r(e.id))))}))}async _validateMap(){if(!this.basemap?.baseLayers.length)throw new a("webmap:save","Map does not have a valid basemap with a base layer.");let e=null;if(await y((()=>{const t=D(this.initialViewProperties,this.basemap);return e=t.spatialReference,!t.updating})),!P(e,this.initialViewProperties.spatialReference))throw new a("webmap:save","The spatial reference of the basemap is not compatible with the one from the map.",{expected:this.initialViewProperties.spatialReference,actual:e})}_validateItem(){if(!this.portalItem)throw l.getLogger(this.declaredClass).error("save: requires the portalItem property to be set"),new a("webmap:portal-item-not-set","Portal item to save to has not been set on the WebMap");this._validateItemType(this.portalItem)}_validateItemType(e){if(e.type!==ie)throw new a("webmap:portal-item-wrong-type",`Portal item needs to have type "${ie}"`)}_loadLayerContainers(){const e=[];return this.basemap&&e.push(this.basemap.load()),this.ground&&e.push(this.ground.load()),c(e).then((()=>{}))}async _beforeSave(){const e=[];for(const t of this.allLayers)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await c(e)}_loadAllLayers(){const e=this._getAllLayersAndTables().map((e=>e.load()));return c(e).then((()=>{}))}_getAllLayersAndTables(){return this.allLayers.concat(this.allTables)}_validateJSONForWriting(e,t){let r=(e.messages?e.messages:[]).filter((e=>"error"===e.type)).map((e=>new a(e.name,e.message,e.details)));if(e.blockedRelativeUrls&&(r=r.concat(e.blockedRelativeUrls.map((e=>new a("url:unsupported",`Relative url '${e}' is not supported in Web Map`))))),t.ignoreUnsupported&&(r=r.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name))),r.length>0)throw new a("webmap:save","Failed to save webmap due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}async _updateItemProperties(e){e.extent=await this._getWGS84Extent(this.initialViewProperties.viewpoint.targetGeometry),await this._updateTypeKeywords(e)}async _updateItemPropertiesForSaveAs(e){N(e,pe),N(e,fe),N(e,x.METADATA),N(e,he),N(e,ge),N(e,we),N(e,ce),N(e,ye),await this._updateItemProperties(e)}async _getWGS84Extent(e){const t=e.clone().normalize();let r;if(t.length>1)for(const i of t)r?i.width>r.width&&(r=i):r=i;else r=t[0];return this._projectToWGS84(r)}async _projectToWGS84(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return L(e);const r=await import("./portal/support/geometryServiceUtils.js"),i=await r.getGeometryServiceURL(this.portalItem),o=new B;o.geometries=[e],o.outSpatialReference=U.WGS84;return(await E(i,o))[0]}async _updateTypeKeywords(e){C(e,le),await this._loadAllLayers(),this._evalCollectorKeyword(e),this._evalDataEditingKeyword(e),this._evalOfflineKeyword(e),this._evalDeveloperBasemapKeyword(e),this._evalUtilityNetworkKeyword(e),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}_evalCollectorKeyword(e){M(e,pe)||M(e,ce)||M(e,ye)||M(e,we)||!this._hasEditableFeatureLayer()?N(e,me):C(e,me)}_evalDataEditingKeyword(e){this._hasEditableFeatureLayer()?C(e,ue):N(e,ue)}_evalOfflineKeyword(e){!M(e,he)&&this._isOfflineCapableMap()?C(e,de):N(e,de)}_evalDeveloperBasemapKeyword(e){G(this.basemap)?C(e,be):N(e,be)}_evalUtilityNetworkKeyword(e){this.utilityNetworks?.length?C(e,_e):N(e,_e)}_hasEditableFeatureLayer(){return this._getAllLayersAndTables().some((e=>e.loaded&&R(e)&&e.capabilities.operations.supportsEditing&&e.editingEnabled))}_isOfflineCapableMap(){return this._getAllLayersAndTables().filter((e=>"group"!==e.type)).every((e=>e.loaded&&this._isOfflineCapableLayer(e)))}_isFeatureCollectionLike(e){return F(e)||"map-notes"===e.type||"route"===e.type}_isOfflineCapableLayer(e){return R(e)&&e.capabilities.operations.supportsSync||this._isFeatureCollectionLike(e)&&!e.portalItem||("tile"===e.type||"vector-tile"===e.type)&&(e.capabilities.operations.supportsExportTiles||this._isExportableAGOLTileLayer(e)||J(e))&&e.spatialReference.equals(this.initialViewProperties.spatialReference)}_isExportableAGOLTileLayer(e){return"tile"===e.type&&(V(e.url)&&ve.some((t=>e.url?.toLowerCase().includes("/"+t+"/"))))}async _updateItem(e,t,r){await e.update({data:t}),this._syncUpInstanceWithItem(e,t,r)}async _createItem(e,t,r,i){const o=this.portalItem,s=!!(o&&o.id&&o.portal.user),n=e.portal;if(await n.signIn(),!await this._canCopyItem(o,s,n))throw new a("webmap:save-as-copy-not-allowed","Owner of this map does not allow others to save a copy");await(n.user?.addItem({item:e,folder:i.folder,data:t})),this.portalItem=e,this._syncUpInstanceWithItem(e,t,r)}async _canCopyItem(e,t,r){return!(m(e)&&e.id&&e.typeKeywords&&e.typeKeywords.includes("useOnly"))||e.portal.portalHostname===r.portalHostname&&(t||await e.reload(),"admin"===e.itemControl||"update"===e.itemControl)}_syncUpInstanceWithItem(e,t,r){h.prototype.read.call(this,{version:t.version,authoringApp:t.authoringApp,authoringAppVersion:t.authoringAppVersion},{origin:"web-map",ignoreDefaults:!0,url:e.itemUrl&&w(e.itemUrl)}),S(r),this.resourceInfo=t}async _updateItemThumbnail(){this.thumbnailUrl&&this._isOverridden("thumbnailUrl")&&(await(this.portalItem?.updateThumbnail({thumbnail:this.thumbnailUrl,filename:this._thumbnailFilename})),this._clearThumbnailOverride())}_getPortalItem(e){let t=k.from(e);return t.id&&(t=t.clone(),t.id=null),t.type||(t.type=ie),t.portal||(t.portal=W.getDefault()),this._validateItemType(t),t}async _updateFromInternal(e,t){if(t=t||{},await y((()=>e.ready)),this._updateInitialViewProperties(e,t),e.map===this)for(const r of e.allLayerViews)for(const e of["visible","featureEffect"])e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e]);await this._updateThumbnailUrl(e,t)}_updateInitialViewProperties(e,t){if(t.backgroundExcluded||(this.initialViewProperties.background=e.background?.clone()),this.initialViewProperties.spatialReference=e.spatialReference?.clone(),t.viewpointExcluded||(this.initialViewProperties.viewpoint=new i({rotation:e.rotation,scale:t.scalePreserved?e.scale:null,targetGeometry:this._getViewExtent(e)})),!t.widgetsExcluded)for(const r of e.persistableViewModels)r.updateWebDocument(this)}_getViewExtent(e){const t=e.center.clone().normalize(),r=e.extent.clone(),i=r.width/2;return r.xmin=t.x-i,r.xmax=t.x+i,r}async _updateThumbnailUrl(e,t){if(t.thumbnailExcluded)return;const r=H(e,t.thumbnailSize),i=await e.takeScreenshot({format:"png",width:r.width,height:r.height});this._setAutoGeneratedThumbnail(i.dataUrl)}_setAutoGeneratedThumbnail(e){this.thumbnailUrl=e,this._thumbnailFilename=null}_clearThumbnailOverride(){this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"),this._thumbnailFilename=null}_generateCustomThumbnailFilename(e){if(g(e)){const t=f(e),r=t&&t.mediaType,i=r&&se.get(r.toLowerCase())||null,o=`thumbnail${Date.now()}`;return i?`${o}.${i}`:o}return null}_getThumbnailState(){let e=this.thumbnailUrl;return e&&(e=this._isOverridden("thumbnailUrl")?e:b(e,"w","8192")),{thumbnailUrl:e,filename:this._thumbnailFilename}}_restoreThumbnailFromState(e){this.thumbnailUrl=e.thumbnailUrl,this._thumbnailFilename=e.filename}_getAuthoringPropsState(){return{authoringApp:this.authoringApp,authoringAppVersion:this.authoringAppVersion,isAuthoringAppSetByUser:this._isAuthoringAppSetByUser,isAuthoringAppVersionSetByUser:this._isAuthoringAppVersionSetByUser}}_restoreAuthoringPropsFromState(e){e.isAuthoringAppSetByUser?this.authoringApp=e.authoringApp:this._isAuthoringAppSetByUser=!1,e.isAuthoringAppVersionSetByUser?this.authoringAppVersion=e.authoringAppVersion:this._isAuthoringAppVersionSetByUser=!1}static fromJSON(e){const t=e;if(!t)throw new a("webmap:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:t})}};Ie.VERSION=re,e([_({type:X,json:{write:!0}})],Ie.prototype,"applicationProperties",void 0),e([_({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],Ie.prototype,"authoringApp",null),e([A("authoringApp")],Ie.prototype,"writeAuthoringApp",null),e([_({type:String,json:{write:{allowNull:!0,ignoreOrigin:!0}}})],Ie.prototype,"authoringAppVersion",null),e([A("authoringAppVersion")],Ie.prototype,"writeAuthoringAppVersion",null),e([_({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Ie.prototype,"basemap",void 0),e([_({type:oe,json:{write:{overridePolicy:e=>({enabled:!!(e&&e.length>0),ignoreOrigin:!0})}}})],Ie.prototype,"bookmarks",void 0),e([_({type:K,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],Ie.prototype,"floorInfo",void 0),e([_({type:$,json:{write:!0}})],Ie.prototype,"geotriggersInfo",void 0),e([_({type:Z,nonNullable:!0,json:{read:{source:["background","initialState.viewpoint","mapRangeInfo","spatialReference"]},write:{ignoreOrigin:!0,target:{background:{type:te},"initialState.viewpoint":{type:i},mapRangeInfo:{type:z},spatialReference:{type:U}}}}})],Ie.prototype,"initialViewProperties",void 0),e([v("initialViewProperties")],Ie.prototype,"readInitialViewProperties",null),e([A("initialViewProperties")],Ie.prototype,"writeInitialViewProperties",null),e([_({json:{read:!1,write:{target:"operationalLayers",ignoreOrigin:!0}}})],Ie.prototype,"layers",void 0),e([A("layers")],Ie.prototype,"writeLayers",null),e([_({type:k})],Ie.prototype,"portalItem",void 0),e([_({json:{write:!0}})],Ie.prototype,"presentation",void 0),e([_()],Ie.prototype,"resourceInfo",void 0),e([_({readOnly:!0,type:ee,json:{read:{source:"version"},write:{allowNull:!0,ignoreOrigin:!0,target:"version",isRequired:!0}}})],Ie.prototype,"sourceVersion",void 0),e([v("sourceVersion")],Ie.prototype,"readSourceVersion",null),e([A("sourceVersion")],Ie.prototype,"writeSourceVersion",null),e([_({json:{read:!1,write:{ignoreOrigin:!0}}})],Ie.prototype,"tables",void 0),e([A("tables")],Ie.prototype,"writeTables",null),e([_()],Ie.prototype,"thumbnailUrl",null),e([_({type:q,json:{write:!0}})],Ie.prototype,"widgets",void 0),e([_({type:ae,json:{read:!0,write:!0}})],Ie.prototype,"utilityNetworks",void 0),Ie=e([I("esri.WebMap")],Ie);const Ae=Ie;export{Ae as default};
|
package/WebScene.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import s from"./core/Error.js";import a from"./core/Handles.js";import"./core/has.js";import{clone as n}from"./core/lang.js";import l from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import c from"./core/Logger.js";import{isSome as d,unwrap as h}from"./core/maybe.js";import{MultiOriginJSONMixin as u,MultiOriginJSONSupport as m}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as y}from"./core/Promise.js";import{debounce as w,eachAlways as g}from"./core/promiseUtils.js";import{urlToObject as f,addQueryParameter as v}from"./core/urlUtils.js";import{property as b}from"./core/accessorSupport/decorators/property.js";import"./core/accessorSupport/ensureType.js";import{reader as S}from"./core/accessorSupport/decorators/reader.js";import{subclass as _}from"./core/accessorSupport/decorators/subclass.js";import{writer as A}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as I}from"./core/accessorSupport/originUtils.js";import{readLoadable as j}from"./core/accessorSupport/read.js";import L from"./geometry/Extent.js";import R from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as P}from"./geometry/projection.js";import V from"./geometry/SpatialReference.js";import{validateWebSceneError as M}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as U}from"./geometry/support/jsonUtils.js";import{isEarth as O}from"./geometry/support/spatialReferenceUtils.js";import E from"./portal/Portal.js";import C from"./portal/PortalItem.js";import N from"./support/MapFloorInfo.js";import{createSchemaValidationError as T,createCopyError as G}from"./support/webSceneUtils.js";import{ViewingMode as F}from"./views/ViewingMode.js";import{isSpatialReferenceSupported as $}from"./views/support/spatialReferenceSupport.js";import{saveResources as W}from"./webdoc/support/saveUtils.js";import{getOptimalThumbnailSize as J}from"./webdoc/support/thumbnailUtils.js";import x from"./webscene/ApplicationProperties.js";import k from"./webscene/Environment.js";import B from"./webscene/InitialViewProperties.js";import q from"./webscene/Presentation.js";import K from"./webscene/TransportationNetwork.js";import{Version as D}from"./webscene/Version.js";const H=new D(1,30),z=()=>{const e=8,t=[],r=H.major;for(let i=e;i<=H.minor;i++)t.push(`${r}.${i}`);return t},Q="Web Scene",X="ViewingMode-Local";let Y=class extends(l.LoadableMixin(y(u(r)))){constructor(e){super(e),this._layersIdGCTimeoutId=void 0,this._handles=new a,this._updateFromPromise=null,this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=void 0,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new q,this.initialViewProperties=new B,this.portalItem=null,this.resourceInfo=null,this._debouncedSaveOperations=w((async(e,t,r)=>{switch(e){case Z.SAVE:return this._saveImpl(t);case Z.SAVE_AS:return this._saveAsImpl(r,t)}})),this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch((e=>{c.getLogger(this.declaredClass).error("#load()","Failed to load web scene",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this._handles.add(this.allLayers.on("change",(()=>this._scheduleLayersIdGC())))}destroy(){this._unscheduleLayersIdGC(),this._handles.destroy(),this.presentation&&this.presentation.destroy();const e=this.portalItem;this.portalItem=null,e?.destroy()}writeClippingArea(e,t){t.clippingArea||(t.clippingArea={}),t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return!!t.clippingArea&&!!t.clippingArea.clip}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||(t.clippingArea={}),t.clippingArea.clip=e)}writeLayers(e,t,r,i){const o={...i,layerContainerType:"operational-layers"},s=e.map((e=>this.verifyWriteLayer(e,i)?e.write({},o):null)).filter((e=>!!e));t[r]=s.toArray()}verifyWriteLayer(e,t){return"write"in e||(t&&t.messages&&t.messages.push(new s("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted in web scenes`,{layer:e})),!1)}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new D(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${H.major}.${H.minor}`}get thumbnailUrl(){return this.portalItem?.thumbnailUrl??null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}writeGround(e,t,r,i){t[r]=e?e.write({},i):{transparency:0,layers:[]}}readInitialViewProperties(e,t){const r={};return t.initialState&&t.initialState.environment&&(r.environment=k.fromJSON(t.initialState.environment)),t.spatialReference?r.spatialReference=V.fromJSON(t.spatialReference):r.spatialReference=V.WebMercator,r.viewingMode=t.viewingMode||"global",t.initialState&&t.initialState.viewpoint&&(r.viewpoint=i.fromJSON(t.initialState.viewpoint)),new B(r)}get spatialReference(){return this.initialViewProperties?.spatialReference??V.WebMercator}get viewingMode(){return this.initialViewProperties?.viewingMode??"global"}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return p(this,(e=>{const t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map((e=>e.basemap)))}))}read(e,t){t={...t,origin:"web-scene"};const r=this._isAuthoringAppVersionSetByUser,i=this._isAuthoringAppSetByUser;if(j(this,e,(t=>super.read(e,t)),t),i||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&this.sourceVersion?.supportsVisibleElevationLayersInSlides){const t=e.baseMap.elevationLayers.map((e=>({id:e.id}))),r=this.presentation.slides,i=(e,t)=>e.visibleLayers.some((e=>e.id===t)),o=t.filter((e=>!r.some((t=>i(t,e.id)))));r.forEach((e=>{e.visibleLayers.addMany(o)}))}}_writeBasemapElevationLayers(e){const t=e.ground&&e.ground.layers;!e.baseMap&&t&&t.length&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=n(t))}write(e,t){if("loaded"!==this.loadStatus){const e=new s("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw c.getLogger(this.declaredClass).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),e}this._runLayersIdGC();const r=!t?.messages;t={messages:[],...t,origin:"web-scene"};const i=super.write(e,t);if(r){const e=t.messages?.filter((e=>"web-document-write:property-required"===e.name))??[];if(e.length){const t=new s("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:e});throw c.getLogger(this.declaredClass).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",e),t}}return this._writeBasemapElevationLayers(i),i}async save(e){return this._debouncedSaveOperations(Z.SAVE,e)}async _saveImpl(e){if(!this.portalItem)throw c.getLogger(this.declaredClass).error("save(): requires the .portalItem property to be set"),await Promise.resolve(),new s("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene");if(this.portalItem?.type!==Q)throw await Promise.resolve(),new s("webscene:portal-item-wrong-type",`Portal item needs to have type "${Q}"`);const t=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:this.portalItem.itemUrl?f(this.portalItem.itemUrl):null,messages:[],portal:this.portalItem.portal??E.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),i=this.write({},r);return await Promise.all(r.resources?.pendingOperations??[]),await this._verifySave(i,r,e),this._updateTypeKeywords(this.portalItem),await this.portalItem.update({data:i}),await W(this._resourceReferences,r,null),I(r),t&&await t,await this._saveThumbnail(),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(Z.SAVE_AS,t,e)}async _saveAsImpl(e,t){let r=C.from(e);r||(c.getLogger(this.declaredClass).error("saveAs(portalItem): requires a portal item parameter"),await Promise.reject(new s("webscene:portal-item-required","saveAs requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const i=r.portal||E.getDefault();await this._ensureLoadBeforeSave(),r.type=Q,r.portal=i;const o=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:null,messages:[],portal:i,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),a=this.write({},o);await Promise.all(o.resources?.pendingOperations??[]),await this._verifySaveAs(a,o,t);const n=this.thumbnailUrl,l=!this._isOverridden("thumbnailUrl");return this._updateTypeKeywords(r),await i.signIn(),await(i.user?.addItem({item:r,folder:t&&t.folder,data:a})),await W(this._resourceReferences,o,null),this.portalItem=r,m.prototype.read.call(this,{version:a.version,authoringApp:a.authoringApp,authoringAppVersion:a.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl&&f(r.itemUrl)}),I(o),n&&(this.thumbnailUrl=l?v(n,"w","8192"):n),o.portalItem=r,await this._saveThumbnail(),r}async _saveThumbnail(){this._isOverridden("thumbnailUrl")&&(await(this.portalItem?.updateThumbnail({thumbnail:this.thumbnailUrl})),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}_verifySave(e,t,r,i=!1){if(!O(this.spatialReference))return Promise.reject(new s("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently."));let o,a=t.messages?.filter((e=>"error"===e.type)).map((e=>new s(e.name,e.message,e.details)))??[];t.blockedRelativeUrls&&(a=a.concat(t.blockedRelativeUrls.map((e=>new s("url:unsupported",`Relative url '${e}' is not supported in Web Scene`))))),r&&r.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),r?.requiredPropertyChecksDisabled&&(a=a.filter((e=>"web-document-write:property-required"!==e.name)));const n=r&&r.strictSchemaValidationEnabled;return o=n?import("./webscene/support/schemaValidator.js").then((t=>{const r=t.validate(e);if(r.length>0){const e=`webscene did not validate:\n${r.join("\n")}`;c.getLogger(this.declaredClass).error(`${i?"saveAs":"save"}(): ${e}`)}return r.map((e=>new s("webscene:schema-validation",e)))})).then((e=>{if(n&&e.length>0){throw T(e.concat(a))}return a})):Promise.resolve(a),o.then((e=>{if(e.length>0)throw new s("webscene:save","Failed to save webscene due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}))}_verifySaveAs(e,t,r){return this.canNotSaveAs(t)?Promise.reject(G()):this._verifySave(e,t,r,!0)}verifySaveAs(e){const t=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},t);return this._verifySaveAs(r,t,e)}canNotSaveAs(e){return e||(e=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),this.write({},e)),(e.verifyItemRelativeUrls?.writtenUrls?.length??0)>0}async updateFrom(e,t={}){const r=this._updateFrom(e,t);this._updateFromPromise=r,await r;this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=k.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,d(e.clippingArea)?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const e="visible";e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e])}(!1===t.thumbnailExcluded||null==t.thumbnailExcluded&&!t.viewpointExcluded)&&await this._updateFromThumbnail(e,t.thumbnailSize??void 0)}async _updateFromThumbnail(e,t){const r=J(e,t),i=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=i.dataUrl}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-scene"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):this._loadObjectsWithLayers()}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_extractOperationalLayers(e){const t=[];if(!this.sourceVersion?.supportsGround&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)t.push(o);const r=[],i=e=>(e.layers&&(e.layers=e.layers.filter(i)),"ArcGISTiledElevationServiceLayer"!==e.layerType||(this.sourceVersion?.supportsGround||r.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(i):[],operationalElevationLayers:r,basemapElevationLayers:t}}_loadFromJSON(e,t){const r=new o;return this._validateSpatialReference().then((()=>this._validateHeightModelInfo())).then((()=>import("./layers/support/layersCreator.js"))).then((({populateOperationalLayers:i})=>{const{operationalLayers:o,operationalElevationLayers:s,basemapElevationLayers:a}=this._extractOperationalLayers(e),n=[],l={context:{...t,layerContainerType:"operational-layers"}};if(this.portalItem&&(l.context.portal=this.portalItem.portal||E.getDefault()),a.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(this.ground.layers,a,e))}if(s.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(r,s,e))}return o&&o.length>0&&n.push(i(this.layers,o,l)),g(n).then((()=>{}))})).then((()=>this._loadObjectsWithLayers())).then((()=>{this.ground.layers.addMany(r)}))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[];for(const t of this.allLayers.items)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await g(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach((t=>{t.basemap&&e.push(t.basemap.load())})),await g(e)}async _loadFromItem(e){if(await e.load().catch((e=>{throw new s("webscene:load-portal-item","Failed to load portal item",{error:e})})),"Web Scene"!==e.type)throw new s("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const t=await e.fetchData();this.resourceInfo=t;const r={origin:"web-scene",url:f(e.itemUrl),portal:e.portal||E.getDefault(),portalItem:e,readResourcePaths:[]};await this._readAndLoadFromJSON(t,r),this._resourceReferences={portalItem:e,paths:r.readResourcePaths??[]}}_validateSpatialReference(){const e=this.initialViewProperties,t=this._sceneSpatialReference;let r;if("local"!==e.viewingMode){if(!$(t,F.Global))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||P(e,t)}else{if(!$(t,F.Local))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}const i=e=>h(e?.camera)?.position.spatialReference??h(e?.targetGeometry)?.spatialReference,o=e.viewpoint,a=i(o);if(a&&!r(a))return Promise.reject(new s("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:a,sceneSpatialReference:t,viewingMode:e.viewingMode}));const n=this.presentation.slides.find((e=>!r(i(e.viewpoint))));if(n){const r=i(n.viewpoint);return Promise.reject(new s("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:r,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,t=M(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateJSON(e){const t=D.parse(e.version||"","webscene");return H.validate(t),e.version=`${t.major}.${t.minor}`,1===t.major&&t.minor<=2&&(e.spatialReference=V.WebMercator.toJSON()),e}_updateTypeKeywords(e){"local"===this.initialViewProperties.viewingMode?e.typeKeywords?e.typeKeywords.includes(X)||e.typeKeywords.push(X):e.typeKeywords=[X]:"global"===this.initialViewProperties.viewingMode&&e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e=>e!==X))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||V.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem?.itemUrl?f(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout((()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()}),3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();const e=this.applicationProperties&&this.applicationProperties.viewing&&this.applicationProperties.viewing.search,t=e=>this.allLayers.some((t=>t.id===e));e&&e.layers&&(e.layers=e.layers.filter((e=>t(e.id))));const r=this.presentation&&this.presentation.slides;r&&r.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>t(e.id))))}))}static fromJSON(e){if(!e)throw new s("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}};var Z;Y.version=`${H.major}.${H.minor}`,e([b({type:x,json:{write:!0}})],Y.prototype,"applicationProperties",void 0),e([b({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Y.prototype,"basemap",void 0),e([b({type:L,json:{read:{source:"clippingArea.geometry",reader:U},write:{target:"clippingArea.geometry"}}})],Y.prototype,"clippingArea",void 0),e([A("clippingArea")],Y.prototype,"writeClippingArea",null),e([b({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],Y.prototype,"clippingEnabled",void 0),e([S("clippingEnabled",["clippingArea"])],Y.prototype,"readClippingEnabled",null),e([A("clippingEnabled")],Y.prototype,"writeClippingEnabled",null),e([b({type:N,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],Y.prototype,"floorInfo",void 0),e([b({type:R,json:{write:!0}})],Y.prototype,"heightModelInfo",void 0),e([b({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],Y.prototype,"layers",void 0),e([A("layers")],Y.prototype,"writeLayers",null),e([b({readOnly:!0,type:D,json:{type:z(),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],Y.prototype,"sourceVersion",void 0),e([S("sourceVersion",["version"])],Y.prototype,"readSourceVersion",null),e([A("sourceVersion")],Y.prototype,"writeSourceVersion",null),e([b({json:{read:!1,write:!1}})],Y.prototype,"tables",void 0),e([b()],Y.prototype,"thumbnailUrl",null),e([b({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],Y.prototype,"authoringApp",null),e([A("authoringApp")],Y.prototype,"writeAuthoringApp",null),e([b({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],Y.prototype,"authoringAppVersion",null),e([A("authoringAppVersion")],Y.prototype,"writeAuthoringAppVersion",null),e([b({json:{write:{isRequired:!0,allowNull:!0,ignoreOrigin:!0,enabled:!0}}})],Y.prototype,"ground",void 0),e([A("ground")],Y.prototype,"writeGround",null),e([b({type:o.ofType(K),json:{write:!0}})],Y.prototype,"transportationNetworks",void 0),e([b({type:q,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,r,i)=>{if(e.slides&&e.slides.length>0){const r={...i,isPresentation:!0};t.presentation=e.write({},r)}}}}})],Y.prototype,"presentation",void 0),e([b({type:B,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new B({viewingMode:"global",spatialReference:V.WebMercator})}})],Y.prototype,"initialViewProperties",void 0),e([S("initialViewProperties",["initialState.environment","spatialReference","viewingMode","initialState.viewpoint"])],Y.prototype,"readInitialViewProperties",null),e([b({type:V,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],Y.prototype,"spatialReference",null),e([b({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],Y.prototype,"viewingMode",null),e([b({type:C})],Y.prototype,"portalItem",void 0),e([b()],Y.prototype,"resourceInfo",void 0),Y=e([_("esri.WebScene")],Y),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(Z||(Z={}));const ee=Y;export{ee as default};
|
|
5
|
+
import{_ as e}from"./chunks/tslib.es6.js";import{version as t}from"./kernel.js";import r from"./Map.js";import i from"./Viewpoint.js";import o from"./core/Collection.js";import s from"./core/Error.js";import a from"./core/Handles.js";import"./core/has.js";import{clone as n}from"./core/lang.js";import l from"./core/Loadable.js";import{loadAll as p}from"./core/loadAll.js";import c from"./core/Logger.js";import{isSome as d,unwrap as h}from"./core/maybe.js";import{MultiOriginJSONMixin as u,MultiOriginJSONSupport as m}from"./core/MultiOriginJSONSupport.js";import{EsriPromiseMixin as y}from"./core/Promise.js";import{debounce as w,eachAlways as g}from"./core/promiseUtils.js";import{urlToObject as f,addQueryParameter as v}from"./core/urlUtils.js";import{property as b}from"./core/accessorSupport/decorators/property.js";import"./core/accessorSupport/ensureType.js";import{reader as S}from"./core/accessorSupport/decorators/reader.js";import{subclass as _}from"./core/accessorSupport/decorators/subclass.js";import{writer as A}from"./core/accessorSupport/decorators/writer.js";import{updateOrigins as I}from"./core/accessorSupport/originUtils.js";import{readLoadable as j}from"./core/accessorSupport/read.js";import L from"./geometry/Extent.js";import R from"./geometry/HeightModelInfo.js";import{canProjectWithoutEngine as P}from"./geometry/projection.js";import V from"./geometry/SpatialReference.js";import{validateWebSceneError as M}from"./geometry/support/heightModelInfoUtils.js";import{fromJSON as U}from"./geometry/support/jsonUtils.js";import{isEarth as O}from"./geometry/support/spatialReferenceUtils.js";import E from"./portal/Portal.js";import C from"./portal/PortalItem.js";import N from"./support/MapFloorInfo.js";import{createSchemaValidationError as T,createCopyError as G}from"./support/webSceneUtils.js";import{ViewingMode as F}from"./views/ViewingMode.js";import{isSpatialReferenceSupported as $}from"./views/support/spatialReferenceSupport.js";import{saveResources as W}from"./webdoc/support/saveUtils.js";import{getOptimalThumbnailSize as J}from"./webdoc/support/thumbnailUtils.js";import x from"./webscene/ApplicationProperties.js";import k from"./webscene/Environment.js";import B from"./webscene/InitialViewProperties.js";import q from"./webscene/Presentation.js";import K from"./webscene/TransportationNetwork.js";import{Version as D}from"./webscene/Version.js";const H=new D(1,30),z=()=>{const e=8,t=[],r=H.major;for(let i=e;i<=H.minor;i++)t.push(`${r}.${i}`);return t},Q="Web Scene",X="ViewingMode-Local";let Y=class extends(l.LoadableMixin(y(u(r)))){constructor(e){super(e),this._layersIdGCTimeoutId=void 0,this._handles=new a,this._updateFromPromise=null,this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=void 0,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new q,this.initialViewProperties=new B,this.portalItem=null,this.resourceInfo=null,this._debouncedSaveOperations=w((async(e,t,r)=>{switch(e){case Z.SAVE:return this._saveImpl(t);case Z.SAVE_AS:return this._saveAsImpl(r,t)}})),this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch((e=>{c.getLogger(this.declaredClass).error("#load()","Failed to load web scene",e)})),this.resourceInfo){let t;try{t=this._validateJSON(this.resourceInfo)}catch(e){return void this.addResolvingPromise(Promise.reject(e))}this.read(t),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this._handles.add(this.allLayers.on("change",(()=>this._scheduleLayersIdGC())))}destroy(){this._unscheduleLayersIdGC(),this._handles.destroy(),this.presentation&&this.presentation.destroy();const e=this.portalItem;this.portalItem=null,e?.destroy()}writeClippingArea(e,t){t.clippingArea||(t.clippingArea={}),t.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,t){return!!t.clippingArea&&!!t.clippingArea.clip}writeClippingEnabled(e,t){this.clippingArea&&(t.clippingArea||(t.clippingArea={}),t.clippingArea.clip=e)}writeLayers(e,t,r,i){const o={...i,layerContainerType:"operational-layers"},s=e.map((e=>this.verifyWriteLayer(e,i)?e.write({},o):null)).filter((e=>!!e));t[r]=s.toArray()}verifyWriteLayer(e,t){return"write"in e||(t&&t.messages&&t.messages.push(new s("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted in web scenes`,{layer:e})),!1)}readSourceVersion(e,t){const[r,i]=t.version.split(".");return new D(parseInt(r,10),parseInt(i,10))}writeSourceVersion(e,t,r){t[r]=`${H.major}.${H.minor}`}get thumbnailUrl(){return this.portalItem?.thumbnailUrl??null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,t){e&&this._isAuthoringAppSetByUser?t.authoringApp=e:t.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,r){e&&this._isAuthoringAppVersionSetByUser?r.authoringAppVersion=e:r.authoringAppVersion=t}writeGround(e,t,r,i){t[r]=e?e.write({},i):{transparency:0,layers:[]}}readInitialViewProperties(e,t){const r={};return t.initialState&&t.initialState.environment&&(r.environment=k.fromJSON(t.initialState.environment)),t.spatialReference?r.spatialReference=V.fromJSON(t.spatialReference):r.spatialReference=V.WebMercator,r.viewingMode=t.viewingMode||"global",t.initialState&&t.initialState.viewpoint&&(r.viewpoint=i.fromJSON(t.initialState.viewpoint)),new B(r)}get spatialReference(){return this.initialViewProperties?.spatialReference??V.WebMercator}get viewingMode(){return this.initialViewProperties?.viewingMode??"global"}load(e){return this.addResolvingPromise(this._loadFromSource()),Promise.resolve(this)}loadAll(){return p(this,(e=>{const t=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,t&&t.map((e=>e.basemap)))}))}read(e,t){t={...t,origin:"web-scene"};const r=this._isAuthoringAppVersionSetByUser,i=this._isAuthoringAppSetByUser;if(j(this,e,(t=>super.read(e,t)),t),i||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&this.sourceVersion?.supportsVisibleElevationLayersInSlides){const t=e.baseMap.elevationLayers.map((e=>({id:e.id}))),r=this.presentation.slides,i=(e,t)=>e.visibleLayers.some((e=>e.id===t)),o=t.filter((e=>!r.some((t=>i(t,e.id)))));r.forEach((e=>{e.visibleLayers.addMany(o)}))}}_writeBasemapElevationLayers(e){const t=e.ground&&e.ground.layers;!e.baseMap&&t&&t.length&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=n(t))}write(e,t){if("loaded"!==this.loadStatus){const e=new s("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw c.getLogger(this.declaredClass).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),e}this._runLayersIdGC();const r=!t?.messages;t={messages:[],...t,origin:"web-scene"};const i=super.write(e,t);if(r){const e=t.messages?.filter((e=>"web-document-write:property-required"===e.name))??[];if(e.length){const t=new s("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:e});throw c.getLogger(this.declaredClass).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",e),t}}return this._writeBasemapElevationLayers(i),i}async save(e){return this._debouncedSaveOperations(Z.SAVE,e)}async _saveImpl(e){if(!this.portalItem)throw c.getLogger(this.declaredClass).error("save(): requires the .portalItem property to be set"),await Promise.resolve(),new s("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene");if(this.portalItem?.type!==Q)throw await Promise.resolve(),new s("webscene:portal-item-wrong-type",`Portal item needs to have type "${Q}"`);const t=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:this.portalItem.itemUrl?f(this.portalItem.itemUrl):null,messages:[],portal:this.portalItem.portal??E.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],propertyPendingOperations:[],pendingOperations:[]}}),i=this.write({},r);return await Promise.all(r.resources.pendingOperations),await this._verifySave(i,r,e),this._updateTypeKeywords(this.portalItem),await this.portalItem.update({data:i}),await W(this._resourceReferences,r,null),I(r),t&&await t,await this._saveThumbnail(),this.portalItem}async saveAs(e,t){return this._debouncedSaveOperations(Z.SAVE_AS,t,e)}async _saveAsImpl(e,t){let r=C.from(e);r||(c.getLogger(this.declaredClass).error("saveAs(portalItem): requires a portal item parameter"),await Promise.reject(new s("webscene:portal-item-required","saveAs requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const i=r.portal||E.getDefault();await this._ensureLoadBeforeSave(),r.type=Q,r.portal=i;const o=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:null,messages:[],portal:i,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],propertyPendingOperations:[],pendingOperations:[]}}),a=this.write({},o);await Promise.all(o.resources.pendingOperations),await this._verifySaveAs(a,o,t);const n=this.thumbnailUrl,l=!this._isOverridden("thumbnailUrl");return this._updateTypeKeywords(r),await i.signIn(),await(i.user?.addItem({item:r,folder:t&&t.folder,data:a})),await W(this._resourceReferences,o,null),this.portalItem=r,m.prototype.read.call(this,{version:a.version,authoringApp:a.authoringApp,authoringAppVersion:a.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl&&f(r.itemUrl)}),I(o),n&&(this.thumbnailUrl=l?v(n,"w","8192"):n),o.portalItem=r,await this._saveThumbnail(),r}async _saveThumbnail(){this._isOverridden("thumbnailUrl")&&(await(this.portalItem?.updateThumbnail({thumbnail:this.thumbnailUrl})),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}_verifySave(e,t,r,i=!1){if(!O(this.spatialReference))return Promise.reject(new s("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently."));let o,a=t.messages?.filter((e=>"error"===e.type)).map((e=>new s(e.name,e.message,e.details)))??[];t.blockedRelativeUrls&&(a=a.concat(t.blockedRelativeUrls.map((e=>new s("url:unsupported",`Relative url '${e}' is not supported in Web Scene`))))),r&&r.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),r?.requiredPropertyChecksDisabled&&(a=a.filter((e=>"web-document-write:property-required"!==e.name)));const n=r&&r.strictSchemaValidationEnabled;return o=n?import("./webscene/support/schemaValidator.js").then((t=>{const r=t.validate(e);if(r.length>0){const e=`webscene did not validate:\n${r.join("\n")}`;c.getLogger(this.declaredClass).error(`${i?"saveAs":"save"}(): ${e}`)}return r.map((e=>new s("webscene:schema-validation",e)))})).then((e=>{if(n&&e.length>0){throw T(e.concat(a))}return a})):Promise.resolve(a),o.then((e=>{if(e.length>0)throw new s("webscene:save","Failed to save webscene due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}))}_verifySaveAs(e,t,r){return this.canNotSaveAs(t)?Promise.reject(G()):this._verifySave(e,t,r,!0)}verifySaveAs(e){const t=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},t);return this._verifySaveAs(r,t,e)}canNotSaveAs(e){return e||(e=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),this.write({},e)),(e.verifyItemRelativeUrls?.writtenUrls?.length??0)>0}async updateFrom(e,t={}){const r=this._updateFrom(e,t);this._updateFromPromise=r,await r;this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,t={}){if(await e.whenReady(),!t.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=k.prototype.clone.apply(e.environment)),!t.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,d(e.clippingArea)?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const e="visible";e in r&&e in r.layer&&r._isOverridden(e)&&(r.layer[e]=r[e])}(!1===t.thumbnailExcluded||null==t.thumbnailExcluded&&!t.viewpointExcluded)&&await this._updateFromThumbnail(e,t.thumbnailSize??void 0)}async _updateFromThumbnail(e,t){const r=J(e,t),i=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=i.dataUrl}_loadFromSource(){return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-scene"}):this.portalItem&&this.portalItem.id?this._loadFromItem(this.portalItem):this._loadObjectsWithLayers()}_readAndLoadFromJSON(e,t){const r=this._validateJSON(e);return this.read(r,t),this._loadFromJSON(r,t)}_extractOperationalLayers(e){const t=[];if(!this.sourceVersion?.supportsGround&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)t.push(o);const r=[],i=e=>(e.layers&&(e.layers=e.layers.filter(i)),"ArcGISTiledElevationServiceLayer"!==e.layerType||(this.sourceVersion?.supportsGround||r.push(e),!1));return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(i):[],operationalElevationLayers:r,basemapElevationLayers:t}}_loadFromJSON(e,t){const r=new o;return this._validateSpatialReference().then((()=>this._validateHeightModelInfo())).then((()=>import("./layers/support/layersCreator.js"))).then((({populateOperationalLayers:i})=>{const{operationalLayers:o,operationalElevationLayers:s,basemapElevationLayers:a}=this._extractOperationalLayers(e),n=[],l={context:{...t,layerContainerType:"operational-layers"}};if(this.portalItem&&(l.context.portal=this.portalItem.portal||E.getDefault()),a.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(this.ground.layers,a,e))}if(s.length>0){const e={...l,context:{...l.context,layerContainerType:"ground"}};e.defaultLayerType="ArcGISTiledElevationServiceLayer",n.push(i(r,s,e))}return o&&o.length>0&&n.push(i(this.layers,o,l)),g(n).then((()=>{}))})).then((()=>this._loadObjectsWithLayers())).then((()=>{this.ground.layers.addMany(r)}))}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[];for(const t of this.allLayers.items)if("beforeSave"in t&&"function"==typeof t.beforeSave){const r=t.beforeSave();r&&e.push(r)}await g(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach((t=>{t.basemap&&e.push(t.basemap.load())})),await g(e)}async _loadFromItem(e){if(await e.load().catch((e=>{throw new s("webscene:load-portal-item","Failed to load portal item",{error:e})})),"Web Scene"!==e.type)throw new s("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const t=await e.fetchData();this.resourceInfo=t;const r={origin:"web-scene",url:f(e.itemUrl),portal:e.portal||E.getDefault(),portalItem:e,readResourcePaths:[]};await this._readAndLoadFromJSON(t,r),this._resourceReferences={portalItem:e,paths:r.readResourcePaths??[]}}_validateSpatialReference(){const e=this.initialViewProperties,t=this._sceneSpatialReference;let r;if("local"!==e.viewingMode){if(!$(t,F.Global))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||P(e,t)}else{if(!$(t,F.Local))return Promise.reject(new s("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:t,viewingMode:e.viewingMode}));r=e=>!e||e.equals(t)}const i=e=>h(e?.camera)?.position.spatialReference??h(e?.targetGeometry)?.spatialReference,o=e.viewpoint,a=i(o);if(a&&!r(a))return Promise.reject(new s("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:a,sceneSpatialReference:t,viewingMode:e.viewingMode}));const n=this.presentation.slides.find((e=>!r(i(e.viewpoint))));if(n){const r=i(n.viewpoint);return Promise.reject(new s("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:r,sceneSpatialReference:t,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,t=M(this.heightModelInfo,e);return t?Promise.reject(t):Promise.resolve()}_validateJSON(e){const t=D.parse(e.version||"","webscene");return H.validate(t),e.version=`${t.major}.${t.minor}`,1===t.major&&t.minor<=2&&(e.spatialReference=V.WebMercator.toJSON()),e}_updateTypeKeywords(e){"local"===this.initialViewProperties.viewingMode?e.typeKeywords?e.typeKeywords.includes(X)||e.typeKeywords.push(X):e.typeKeywords=[X]:"global"===this.initialViewProperties.viewingMode&&e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((e=>e!==X))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||V.WebMercator}get _verifyItemRelativeRootPath(){return this.portalItem?.itemUrl?f(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const t=this._verifyItemRelativeRootPath;return t&&(e.verifyItemRelativeUrls={rootPath:t,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout((()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()}),3e3)}_runLayersIdGC(){this._unscheduleLayersIdGC();const e=this.applicationProperties&&this.applicationProperties.viewing&&this.applicationProperties.viewing.search,t=e=>this.allLayers.some((t=>t.id===e));e&&e.layers&&(e.layers=e.layers.filter((e=>t(e.id))));const r=this.presentation&&this.presentation.slides;r&&r.forEach((e=>{e.visibleLayers&&(e.visibleLayers=e.visibleLayers.filter((e=>t(e.id))))}))}static fromJSON(e){if(!e)throw new s("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}};var Z;Y.version=`${H.major}.${H.minor}`,e([b({type:x,json:{write:!0}})],Y.prototype,"applicationProperties",void 0),e([b({json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Y.prototype,"basemap",void 0),e([b({type:L,json:{read:{source:"clippingArea.geometry",reader:U},write:{target:"clippingArea.geometry"}}})],Y.prototype,"clippingArea",void 0),e([A("clippingArea")],Y.prototype,"writeClippingArea",null),e([b({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],Y.prototype,"clippingEnabled",void 0),e([S("clippingEnabled",["clippingArea"])],Y.prototype,"readClippingEnabled",null),e([A("clippingEnabled")],Y.prototype,"writeClippingEnabled",null),e([b({type:N,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],Y.prototype,"floorInfo",void 0),e([b({type:R,json:{write:!0}})],Y.prototype,"heightModelInfo",void 0),e([b({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],Y.prototype,"layers",void 0),e([A("layers")],Y.prototype,"writeLayers",null),e([b({readOnly:!0,type:D,json:{type:z(),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],Y.prototype,"sourceVersion",void 0),e([S("sourceVersion",["version"])],Y.prototype,"readSourceVersion",null),e([A("sourceVersion")],Y.prototype,"writeSourceVersion",null),e([b({json:{read:!1,write:!1}})],Y.prototype,"tables",void 0),e([b()],Y.prototype,"thumbnailUrl",null),e([b({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],Y.prototype,"authoringApp",null),e([A("authoringApp")],Y.prototype,"writeAuthoringApp",null),e([b({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],Y.prototype,"authoringAppVersion",null),e([A("authoringAppVersion")],Y.prototype,"writeAuthoringAppVersion",null),e([b({json:{write:{isRequired:!0,allowNull:!0,ignoreOrigin:!0,enabled:!0}}})],Y.prototype,"ground",void 0),e([A("ground")],Y.prototype,"writeGround",null),e([b({type:o.ofType(K),json:{write:!0}})],Y.prototype,"transportationNetworks",void 0),e([b({type:q,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(e,t,r,i)=>{if(e.slides&&e.slides.length>0){const r={...i,isPresentation:!0};t.presentation=e.write({},r)}}}}})],Y.prototype,"presentation",void 0),e([b({type:B,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new B({viewingMode:"global",spatialReference:V.WebMercator})}})],Y.prototype,"initialViewProperties",void 0),e([S("initialViewProperties",["initialState.environment","spatialReference","viewingMode","initialState.viewpoint"])],Y.prototype,"readInitialViewProperties",null),e([b({type:V,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],Y.prototype,"spatialReference",null),e([b({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],Y.prototype,"viewingMode",null),e([b({type:C})],Y.prototype,"portalItem",void 0),e([b()],Y.prototype,"resourceInfo",void 0),Y=e([_("esri.WebScene")],Y),function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(Z||(Z={}));const ee=Y;export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.26.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this instanceof o&&(this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t)??"";if(void 0===o)throw new Error(`could not find key "${r}" in template`);return o.toString()}))}(t,r))??"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e,t){let r=e.length!==t.length;r&&(e.length=t.length);for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function a(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function b(e,t,r,n){const o=r??e.length,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{Mr:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Property: "+(n?n+"::":"")+t,r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-version-support",10.81),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})(),o.add("enable-feature:SceneLayer-editing",!0),o.add("enable-feature:direct-3d-object-feature-layer-display",!0)},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var n=r(67676),o=r(70586),s=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=a(e[t]);return r}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const r=e.map((e=>{const r=c(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=c(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[r,n]of e)t.set(r,a(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(a(r));return t}return null}function p(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e,t){return n(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.abort(),null}function b(e){return n(e)&&e.release(),null}function g(e,t,r){return n(e)&&n(t)?n(r)?r(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const r=new Array;for(const n of e)r.push(v(n,null,t));return r}function w(e,t){for(const r of e)s(r,t)}function v(e,t,r){return n(e)?r(e):t}function _(e){return e.filter((e=>n(e)))}function O(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function k(e){return e}r.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>n,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>j,gx:()=>S,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o;r(60235);var s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const r=u(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(!(0,a.Wi)(r))return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){const r=u(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=p(t,(()=>n(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await v(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return new Promise((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,r){const n=new AbortController;return p(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);p(n,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const n=new AbortController;r=S(e(...u,n.signal));const o=r;O(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=S(e(...u));const f=()=>{const e=n;n=o=r=i=null,null!=e&&l(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}async function j(e){await Promise.resolve(),l(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function o(e){return e&&e.constructor&&"Int8Array"===e.constructor.name}function s(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name}function i(e){return e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function a(e){return e&&e.constructor&&"Int16Array"===e.constructor.name}function c(e){return e&&e.constructor&&"Uint16Array"===e.constructor.name}function l(e){return e&&e.constructor&&"Int32Array"===e.constructor.name}function u(e){return e&&e.constructor&&"Uint32Array"===e.constructor.name}function f(e){return e&&e.constructor&&"Float32Array"===e.constructor.name}function d(e){return e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{DB:()=>h,Hx:()=>l,KZ:()=>i,Uc:()=>c,W0:()=>o,ZY:()=>u,eP:()=>n,fS:()=>d,lq:()=>s,xZ:()=>f,z3:()=>a});const h=1024},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>j,D6:()=>L,Fv:()=>F,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>Z,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>E,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>U,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>T,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>D,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){if(!e)return null;const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function P(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function E(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),S(r)}function T(e){const t=N(e);let r,n;if(t){const e=A(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=S(e);e=r+"?"+t.path;const o=j({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function A(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=A(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=F(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function L(e,t,r=!1){if(!e||!t)return!1;const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function U(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(L(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(L(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(D("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function Z(e,t=_,r){if(null==e||!H(e))return e;const n=F(e),o=n.toLowerCase(),s=F(t).toLowerCase().replace(/\/+$/,""),i=r?F(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function F(e){return function(e){const t=c.httpsDomains;if(!function(e){return null!=e&&f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=A(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function B(e,t=!1){if(null==e||z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function re(e){return null!=e&&u.test(e)}function ne(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=S(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=S(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=S(e),o=n.query||{};return o[t]=String(r),`${n.path}?${j(o)}`}function pe(e,t){const r=S(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=j(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(3847),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7154)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(212),r.e(2062)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(4807),r.e(6481),r.e(6459),r.e(98)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(3660)]).then(r.bind(r,65967)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7774),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7774),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(8732),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(7126),r.e(4547),r.e(1722),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4325),r.e(3942),r.e(6367),r.e(9347)]).then(r.bind(r,37138)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(7863),r.e(797)]).then(r.bind(r,90447)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(8363),r.e(5202),r.e(9209)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(6481),r.e(212),r.e(1391)]).then(r.bind(r,73248)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7774),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6656),r.e(6188)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,deferred:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e)?.type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,Cs:()=>n,QM:()=>l,jt:()=>i,oi:()=>c});var n,o=r(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(n||(n={}));let s=0;function i(){return s++}function a(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function c(e,t,r,s){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let i;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(i=u(r.transferList),t.data=r.result):(i=u(s),t.data=r),i){if((0,o.Z)("ff"))for(const r of i)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case n.INVOKE:throw r;case n.RESPONSE:return void c(e,{type:n.RESPONSE,jobId:t.jobId,error:a(r)})}}e.postMessage(t,i)}else e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.26",i={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,httpStatus:a.httpStatus,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20230113",o="8559a9366e4f2245dac1f05db0ab22559c700ae6"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{9:"f5801da64e1f08d28a9f",81:"b5a823da33cdcf4efe2d",98:"6924cb0721033945ccd1",212:"f3f2759b39ab76cde66c",216:"5e9869849d999aac5756",223:"acf800382cbcd4875865",247:"a9f83bbccf3b5f229262",540:"96536f507bc6e501a4f7",565:"969bb94d5bdc9da114e2",576:"5ec4fedbbcbb0053cf74",639:"1186a56dacaf269d5271",661:"0419bb1a147a2c464980",665:"64f137358100a1c818f0",690:"798cd875d64182741364",739:"5983c9f28b7f63c7e1e0",797:"0c354d566015226c338a",819:"d1ead6e8aa7e8e21fbc6",837:"bd2fe663a2b090b134e9",908:"493e2b00133682748e62",911:"2187672a72e776b9b153",1070:"94633a9bb5fa4f4ba4de",1073:"7bc7b6cf75771687d81f",1074:"fa059d94d5051ded85b3",1082:"c16003307aad2f84ac51",1158:"3714482f3a829d122da1",1391:"a1ceb32172161a2ae254",1400:"dd2e9206133d6888f33d",1412:"889dc98d8acea2f48a17",1421:"106329846470141953ad",1423:"d00bd1c0f003417d97c7",1433:"4d5bdf18feeb9c8cb6ff",1513:"ba7239089a04098e3619",1534:"1cf86638f8e097d8e6e2",1562:"1fe589ec2cf9bc9e7c25",1569:"e18851e915cb69f53032",1612:"64b63a6f82d3969af846",1722:"5191f80f2413ee92c875",1761:"1039cd48a12e88baa97a",1785:"2304857374630a00f6a2",1790:"3a00f94f8f0d49c60969",1916:"90653ef5e718bafd6960",1932:"a605bf8bc29099ae1b1a",2062:"f9e0b8eaf99f48393a6e",2133:"8a69a9b5a04e7321740d",2134:"1d4112776271f744bda0",2422:"43f6aa5c6f6a2bf316ef",2592:"6216cd8134703fd9d9b4",2664:"06ef2a1a43b2b0b66086",2693:"4d8c53e961275b6a4ee1",2710:"719ee5c4a064ea9bdfcf",3027:"fce9f487437d3c5ef080",3055:"a51c2c5d3e7f764f44d5",3084:"cd0fa942d57a278b0a44",3172:"8490cdc994f28fe2141b",3230:"ed1312c2627c0d7e654d",3327:"028f9a133104e78e60d2",3529:"05ab092987251d4a1242",3572:"3b689bb038ebc301c3b2",3660:"cb83480d7074f6185e21",3668:"7747ee359d357f6e5858",3847:"9070aa0a94a9204ded1c",3852:"d4338bc4a99b71c44dc2",3942:"41d25407888326c91566",3992:"4a2b4574b87be7b98481",4046:"bc3564689bd42cba97f9",4150:"5049771eeffe208a9cb8",4166:"5f61db625e7f836f96c3",4183:"d798bd544433e932f772",4242:"6fba07833345b2d8d373",4268:"d6bcf18e742f017752b1",4325:"e95e449c3fab1a03498c",4358:"eab47a18717478014e03",4371:"4b56a15d904a64747e64",4475:"a84ad71a80c3f84869a7",4499:"423955dd5f10692daf3b",4547:"118592fa82bbc586d1e4",4599:"bb8a670d4a1eaa458bef",4695:"cdf7b4b87132af9a8ca8",4729:"5ab921b4d7d717b666ca",4807:"1b7392ee1f550f339063",5015:"d75f1c8f8dcabdf32021",5072:"c81d898f4aef6ecacdb5",5179:"d289a6e3d663731fff28",5202:"8bd26c71e78698c16778",5235:"7227df502cacbb6d0529",5329:"0e21e5b4d065567a6a91",5464:"2541edeae4b1a53b8723",5468:"399c453397a1f10408bf",5546:"2dfb17fa5b6a5d239942",5587:"4c085cee22ff64ce6d1f",5590:"5f0e211f07d8abe5e764",5732:"83f7e22a12d90ef93e62",5795:"13da7d992cbeb39cc2c7",5809:"329e512f210cb3e904f1",5837:"c419a26e2b7d20d99cef",5853:"19ed87aaf7b63ea62fae",5935:"60a08ce29d09cb07ef06",6188:"d79ee2fd81becba277f2",6233:"acfde5a4cce3a4589f15",6237:"1aaf284ce0ee24053bd1",6261:"14b113a6fdcf81e56674",6367:"a194f90ffe13b3d448b0",6395:"9785dba81a6af339e35a",6459:"de4b687431b4d5cf0369",6465:"d55332e4d7b8184fd718",6481:"3ca8ff2c0f65872bc81a",6502:"78ff7a0a6422df4d9b4c",6584:"5dfed65b615b33588488",6636:"033e6ae5da6afebd993c",6656:"9c36fff8a1cb2aea3fe9",6710:"c860891552d6d886394b",6748:"9aee6f171d4fbac941d9",6774:"22677d246a80195507e6",6785:"8658d2d3945c7c79fdb8",6841:"b3a717b7e41f3b0180be",6904:"60bfcc987aae6efb98af",6925:"bad2ec88d0ed090daf56",7035:"46fbfb2f815f4a543d5f",7066:"ea1054116ec842a4f813",7126:"d6842acbfa7a39f3ca30",7154:"f2750a7b44e8bc8b1e4c",7269:"02497309e0f848bf2879",7277:"8c12b82612f050492fef",7279:"8530ac02c840c89cc1df",7374:"3878efe67f43962b46f8",7476:"1363e647f3b0bca07e09",7541:"190c9feab5f80e586d84",7774:"62c8e43741f2d6141f00",7845:"2680392cef77d98ad097",7863:"34a08bce0c882b64de7a",7873:"21f7d3400c070aa45596",7905:"264e1c00936bcafb9a36",8092:"f1b26b73101210b8f29c",8096:"22a990a8d4d4587866a5",8227:"1c9fff56d6e1cc3df63f",8244:"d19deb5233712148e266",8363:"78fd609f334a29ef39dc",8636:"e0b40a4bd4b096db7a33",8732:"99e16173584702577b80",8758:"4b2edcb8ef7fae4f7d28",8828:"c6eb6a97ecc6ed9ce713",8833:"30ae4c22f6b8aab9f841",8907:"a53d194e3eede703a6df",9070:"6f5f81855985db7c1936",9078:"2e3962506c353b562a88",9169:"ac4c10194e904840a4ad",9209:"01cd5a9cd4cb1f13691c",9230:"df8963df0766e26d20a0",9238:"897d713a73efd5a573a3",9243:"d15dd77b6ac668647ab6",9291:"179efcf889111d2576c5",9296:"f86ee9fd7ac176f86796",9300:"6aa38c43b8ba7c866ed6",9347:"3b6748f414437cc6cfde",9513:"dab2742d580c467c2b3c",9746:"27ba1889fe9f1812389a",9771:"8914f5e72a51636a59d3",9790:"7acc061da63714d388da",9880:"1b5bdd80db9a1a410ff8",9884:"a6866c770e341d26d265",9903:"75b0c3a49a3494c63c68",9904:"af046d64ba4af5fa93b3",9942:"8176286f8dd055c8ae05"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
|
|
1
|
+
var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.26.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.defaultAssetsPath=s.assetsPath}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this instanceof o&&(this.message=(t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t)??"";if(void 0===o)throw new Error(`could not find key "${r}" in template`);return o.toString()}))}(t,r))??"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e,t){let r=e.length!==t.length;r&&(e.length=t.length);for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function a(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function b(e,t,r,n){const o=r??e.length,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{Mr:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Property: "+(n?n+"::":"")+t,r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-version-support",10.81),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})(),o.add("enable-feature:SceneLayer-editing",!0),o.add("enable-feature:direct-3d-object-feature-layer-display",!0)},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var n=r(67676),o=r(70586),s=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=a(e[t]);return r}function c(e){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const r=e.map((e=>{const r=c(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=c(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return e.slice();if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[r,n]of e)t.set(r,a(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(a(r));return t}return null}function p(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e,t){return n(e)?t(e):null}function i(e){return e}function a(e,t){return c(e,t),e}function c(e,t){if(o(e))throw new Error(t??"value is None")}function l(e,t){return n(e)?e:"function"==typeof t?t():t}function u(e,t){return n(e)?e:t}function f(e){return n(e)&&e.destroy(),null}function d(e){return n(e)&&e.dispose(),null}function h(e){return n(e)&&e.remove(),null}function p(e){return n(e)&&e.abort(),null}function b(e){return n(e)&&e.release(),null}function g(e,t,r){return n(e)&&n(t)?n(r)?r(e,t):e.equals(t):e===t}function m(e){return null}function y(e,t){const r=new Array;for(const n of e)r.push(v(n,null,t));return r}function w(e,t){for(const r of e)s(r,t)}function v(e,t,r){return n(e)?r(e):t}function _(e){return e.filter((e=>n(e)))}function O(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function k(e){return e}r.d(t,{Fd:()=>y,IM:()=>p,JR:()=>w,M2:()=>d,O3:()=>c,Pt:()=>l,R2:()=>v,RY:()=>b,SC:()=>f,U2:()=>O,Wg:()=>i,Wi:()=>o,_W:()=>g,hw:()=>h,j0:()=>k,lV:()=>_,pC:()=>n,s3:()=>a,wN:()=>m,yl:()=>u,yw:()=>s})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>j,gx:()=>S,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o;r(60235);var s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const r=u(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(!(0,a.Wi)(r))return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){const r=u(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=p(t,(()=>n(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await v(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return new Promise((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,r){const n=new AbortController;return p(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);p(n,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const n=new AbortController;r=S(e(...u,n.signal));const o=r;O(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=S(e(...u));const f=()=>{const e=n;n=o=r=i=null,null!=e&&l(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}async function j(e){await Promise.resolve(),l(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function o(e){return e&&e.constructor&&"Int8Array"===e.constructor.name}function s(e){return e&&e.constructor&&"Uint8Array"===e.constructor.name}function i(e){return e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function a(e){return e&&e.constructor&&"Int16Array"===e.constructor.name}function c(e){return e&&e.constructor&&"Uint16Array"===e.constructor.name}function l(e){return e&&e.constructor&&"Int32Array"===e.constructor.name}function u(e){return e&&e.constructor&&"Uint32Array"===e.constructor.name}function f(e){return e&&e.constructor&&"Float32Array"===e.constructor.name}function d(e){return e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{DB:()=>h,Hx:()=>l,KZ:()=>i,Uc:()=>c,W0:()=>o,ZY:()=>u,eP:()=>n,fS:()=>d,lq:()=>s,xZ:()=>f,z3:()=>a});const h=1024},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>j,D6:()=>L,Fv:()=>F,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>Z,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>E,ed:()=>N,fZ:()=>ge,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>U,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>T,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>D,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){if(!e)return null;const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function P(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function E(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),S(r)}function T(e){const t=N(e);let r,n;if(t){const e=A(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=S(e);e=r+"?"+t.path;const o=j({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const x={path:"",query:""};function A(e){const t=e.indexOf("?");return-1!==t?(x.path=e.slice(0,t),x.query=e.slice(t+1)):(x.path=e,x.query=null),x}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=A(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=F(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function L(e,t,r=!1){if(!e||!t)return!1;const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function U(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(L(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(L(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(D("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function Z(e,t=_,r){if(null==e||!H(e))return e;const n=F(e),o=n.toLowerCase(),s=F(t).toLowerCase().replace(/\/+$/,""),i=r?F(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function F(e){return function(e){const t=c.httpsDomains;if(!function(e){return null!=e&&f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=A(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function B(e,t=!1){if(null==e||z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return null!=e&&"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&"/"===e[0]&&"/"===e[1]}function re(e){return null!=e&&u.test(e)}function ne(e){return null!=e&&d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=S(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=S(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=S(e),o=n.query||{};return o[t]=String(r),`${n.path}?${j(o)}`}function pe(e,t){const r=S(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=j(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?t[2]:null}function ge(e){if((0,i.Wi)(e))return null;const t=e.match(me);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const me=/([^.]*)\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(3847),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7154)]).then(r.bind(r,27793)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(212),r.e(2062)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(4807),r.e(6481),r.e(6459),r.e(98)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(3660)]).then(r.bind(r,65967)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7774),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7774),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(8732),r.e(1916)]).then(r.bind(r,61916)),Pipeline:()=>Promise.all([r.e(7126),r.e(4547),r.e(1722),r.e(5795),r.e(1400),r.e(1534),r.e(1562),r.e(4599),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4325),r.e(3942),r.e(6367),r.e(9347)]).then(r.bind(r,37138)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(7863),r.e(797)]).then(r.bind(r,90447)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1562),r.e(8363),r.e(5202),r.e(9209)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(6481),r.e(212),r.e(1391)]).then(r.bind(r,73248)),SceneLayerWorker:()=>r.e(1412).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(1534),r.e(1562),r.e(8732),r.e(3847),r.e(5809),r.e(8833),r.e(4807),r.e(7774),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6656),r.e(6188)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,deferred:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e)?.type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,Cs:()=>n,QM:()=>l,jt:()=>i,oi:()=>c});var n,o=r(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(n||(n={}));let s=0;function i(){return s++}function a(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function c(e,t,r,s){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let i;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(i=u(r.transferList),t.data=r.result):(i=u(s),t.data=r),i){if((0,o.Z)("ff"))for(const r of i)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case n.INVOKE:throw r;case n.RESPONSE:return void c(e,{type:n.RESPONSE,jobId:t.jobId,error:a(r)})}}e.postMessage(t,i)}else e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.26",i={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":i&&["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,httpStatus:a.httpStatus,ssl:a.ssl};switch(a.requestOptions?.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20230115",o="e92a0b6c9c6734bcd8b3437811d748c7986cc033"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{9:"f5801da64e1f08d28a9f",81:"b5a823da33cdcf4efe2d",98:"6924cb0721033945ccd1",212:"f3f2759b39ab76cde66c",216:"5e9869849d999aac5756",223:"acf800382cbcd4875865",247:"a9f83bbccf3b5f229262",540:"96536f507bc6e501a4f7",565:"969bb94d5bdc9da114e2",576:"5ec4fedbbcbb0053cf74",639:"1186a56dacaf269d5271",661:"0419bb1a147a2c464980",665:"2e5b61ee21fa6287cc65",690:"633a86e8e8ad2ab866f4",739:"5983c9f28b7f63c7e1e0",797:"0c354d566015226c338a",819:"d1ead6e8aa7e8e21fbc6",837:"bd2fe663a2b090b134e9",908:"493e2b00133682748e62",911:"2187672a72e776b9b153",1070:"94633a9bb5fa4f4ba4de",1073:"7bc7b6cf75771687d81f",1074:"fa059d94d5051ded85b3",1082:"c16003307aad2f84ac51",1158:"3714482f3a829d122da1",1391:"a1ceb32172161a2ae254",1400:"dc6bad8c0a09393834a1",1412:"889dc98d8acea2f48a17",1421:"106329846470141953ad",1423:"d00bd1c0f003417d97c7",1433:"4d5bdf18feeb9c8cb6ff",1513:"ba7239089a04098e3619",1534:"1cf86638f8e097d8e6e2",1562:"1fe589ec2cf9bc9e7c25",1569:"e18851e915cb69f53032",1612:"64b63a6f82d3969af846",1722:"5191f80f2413ee92c875",1761:"1039cd48a12e88baa97a",1785:"2304857374630a00f6a2",1790:"3a00f94f8f0d49c60969",1916:"90653ef5e718bafd6960",1932:"a605bf8bc29099ae1b1a",2062:"f9e0b8eaf99f48393a6e",2133:"8a69a9b5a04e7321740d",2134:"1d4112776271f744bda0",2422:"43f6aa5c6f6a2bf316ef",2592:"c3fda4056c5eeaef1339",2664:"06ef2a1a43b2b0b66086",2693:"4d8c53e961275b6a4ee1",2710:"719ee5c4a064ea9bdfcf",3027:"fce9f487437d3c5ef080",3055:"a51c2c5d3e7f764f44d5",3084:"cd0fa942d57a278b0a44",3172:"8490cdc994f28fe2141b",3230:"ed1312c2627c0d7e654d",3327:"028f9a133104e78e60d2",3529:"05ab092987251d4a1242",3572:"5605de870cfc1498a393",3660:"cb83480d7074f6185e21",3668:"7747ee359d357f6e5858",3847:"9070aa0a94a9204ded1c",3852:"d4338bc4a99b71c44dc2",3942:"41d25407888326c91566",3992:"4a2b4574b87be7b98481",4046:"f34c607e73757f6024eb",4150:"5049771eeffe208a9cb8",4166:"5f61db625e7f836f96c3",4183:"d798bd544433e932f772",4242:"2e7e8b035673d90deefd",4268:"d6bcf18e742f017752b1",4325:"e95e449c3fab1a03498c",4358:"eab47a18717478014e03",4371:"4b56a15d904a64747e64",4475:"a84ad71a80c3f84869a7",4499:"423955dd5f10692daf3b",4547:"118592fa82bbc586d1e4",4599:"bb8a670d4a1eaa458bef",4695:"cdf7b4b87132af9a8ca8",4729:"5ab921b4d7d717b666ca",4807:"1b7392ee1f550f339063",5015:"d75f1c8f8dcabdf32021",5072:"c81d898f4aef6ecacdb5",5179:"d289a6e3d663731fff28",5202:"4e13f84441f0b149f32e",5235:"7227df502cacbb6d0529",5329:"0e21e5b4d065567a6a91",5464:"5ad3a3d15831b759e758",5468:"c7b23f664a2707b96daf",5546:"2dfb17fa5b6a5d239942",5587:"4c085cee22ff64ce6d1f",5590:"5f0e211f07d8abe5e764",5732:"83f7e22a12d90ef93e62",5795:"13da7d992cbeb39cc2c7",5809:"329e512f210cb3e904f1",5837:"c419a26e2b7d20d99cef",5853:"19ed87aaf7b63ea62fae",5935:"60a08ce29d09cb07ef06",6188:"d79ee2fd81becba277f2",6233:"acfde5a4cce3a4589f15",6237:"1aaf284ce0ee24053bd1",6261:"14b113a6fdcf81e56674",6367:"a194f90ffe13b3d448b0",6395:"9785dba81a6af339e35a",6459:"de4b687431b4d5cf0369",6465:"d55332e4d7b8184fd718",6481:"3ca8ff2c0f65872bc81a",6502:"78ff7a0a6422df4d9b4c",6584:"5dfed65b615b33588488",6636:"033e6ae5da6afebd993c",6656:"9c36fff8a1cb2aea3fe9",6710:"c860891552d6d886394b",6748:"9aee6f171d4fbac941d9",6774:"22677d246a80195507e6",6785:"8658d2d3945c7c79fdb8",6841:"b3a717b7e41f3b0180be",6904:"60bfcc987aae6efb98af",6925:"bad2ec88d0ed090daf56",7035:"46fbfb2f815f4a543d5f",7066:"ea1054116ec842a4f813",7126:"d6842acbfa7a39f3ca30",7154:"f2750a7b44e8bc8b1e4c",7269:"02497309e0f848bf2879",7277:"8c12b82612f050492fef",7279:"8530ac02c840c89cc1df",7374:"3878efe67f43962b46f8",7476:"05679a6529421d546fe0",7541:"190c9feab5f80e586d84",7774:"62c8e43741f2d6141f00",7845:"2680392cef77d98ad097",7863:"34a08bce0c882b64de7a",7873:"21f7d3400c070aa45596",7905:"264e1c00936bcafb9a36",8092:"f1b26b73101210b8f29c",8096:"22a990a8d4d4587866a5",8227:"1c9fff56d6e1cc3df63f",8244:"d19deb5233712148e266",8363:"86491e6269e25b1766ed",8636:"e0b40a4bd4b096db7a33",8732:"99e16173584702577b80",8758:"4b2edcb8ef7fae4f7d28",8828:"c6eb6a97ecc6ed9ce713",8833:"30ae4c22f6b8aab9f841",8907:"a53d194e3eede703a6df",9070:"6f5f81855985db7c1936",9078:"2e3962506c353b562a88",9169:"ac4c10194e904840a4ad",9209:"01cd5a9cd4cb1f13691c",9230:"df8963df0766e26d20a0",9238:"897d713a73efd5a573a3",9243:"d15dd77b6ac668647ab6",9291:"179efcf889111d2576c5",9296:"f86ee9fd7ac176f86796",9300:"6aa38c43b8ba7c866ed6",9347:"3b6748f414437cc6cfde",9513:"dab2742d580c467c2b3c",9746:"27ba1889fe9f1812389a",9771:"8914f5e72a51636a59d3",9790:"7acc061da63714d388da",9880:"1b5bdd80db9a1a410ff8",9884:"a6866c770e341d26d265",9903:"75b0c3a49a3494c63c68",9904:"af046d64ba4af5fa93b3",9942:"8176286f8dd055c8ae05"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7476],{28659:(e,t,r)=>{r.d(t,{B:()=>f});var i=r(81153),s=r(17452),o=r(41123),n=r(7628),a=r(31263),l=r(5600);function p(e){return d[function(e){return e instanceof Blob?e.type:function(e){const t=(0,s.Ml)(e);return y[t]||c}(e.url)}(e)]||u}const d={},c="text/plain",u=d[c],y={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in y)d[y[e]]=e;var h=r(25929);function f(e){const t=e?.origins??[void 0];return(r,o)=>{const d=function(e,t,r){if("resource"===e?.type)return function(e,t,r){const o=(0,n.Oe)(t,r);return{type:String,read:(e,t,r)=>{const i=(0,h.r)(e,t,r);return o.type===String?i:"function"==typeof o.type?new o.type({url:i}):void 0},write:{writer(t,n,l,d){if(!d||!d.resources)return"string"==typeof t?void(n[l]=(0,h.t)(t,d)):void(n[l]=t.write({},d));const c=function(e){return null==e?null:"string"==typeof e?e:e.url}(t),u=(0,h.t)(c,{...d,verifyItemRelativeUrls:d&&d.verifyItemRelativeUrls?{writtenUrls:d.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},h.M.NO),y=o.type!==String&&(!(0,i.l)(this)||d&&d.origin&&this.originIdOf(r)>(0,a.M9)(d.origin)),f={object:this,propertyName:r,value:t,targetUrl:u,dest:n,targetPropertyName:l,context:d,params:e};d&&d.portalItem&&u&&!(0,s.YP)(u)?y?function(e){const{context:t,targetUrl:r,params:i,value:o,dest:n,targetPropertyName:a}=e;if(!t.portalItem)return;const l=t.portalItem.resourceFromPath(r),d=b(o,r,t),c=p(d),u=(0,s.Ml)(l.path),y=i?.compress??!1;c===u?(t.resources&&m({...e,resource:l,content:d,compress:y,updates:t.resources.toUpdate}),n[a]=r):g(e)}(f):function({context:e,targetUrl:t,dest:r,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),r[i]=t)}(f):d&&d.portalItem&&(null==u||null!=(0,h.i)(u)||(0,s.jc)(u)||y)?g(f):n[l]=u}}}}(e,t,r);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:e,write:t}=h.a;return{read:e,write:t}}}}(e,r,o);for(const e of t){const t=(0,l.CJ)(r,e,o);for(const e in d)t[e]=d[e]}}}function g(e){const{targetUrl:t,params:i,value:n,context:a,dest:l,targetPropertyName:d}=e;if(!a.portalItem)return;const c=(0,h.p)(t),u=c?.filename??(0,o.D)(),y=i?.prefix??c?.prefix,f=b(n,t,a),g=(0,s.v_)(y,u),v=`${g}.${p(f)}`,w=a.portalItem.resourceFromPath(v);(0,s.jc)(t)&&a.resources&&a.resources.propertyPendingOperations.push(async function(e){const t=(await Promise.resolve().then(r.bind(r,3172))).default,{data:i}=await t(e,{responseType:"blob"});return i}(t).then((e=>{w.path=`${g}.${p(e)}`,l[d]=w.itemRelativeUrl})).catch((()=>{})));const I=i?.compress??!1;a.resources&&m({...e,resource:w,content:f,compress:I,updates:a.resources.toAdd}),l[d]=w.itemRelativeUrl}function m({object:e,propertyName:t,updates:r,resource:i,content:s,compress:o}){r.push({resource:i,content:s,compress:o,finish:r=>{!function(e,t,r){"string"==typeof e[t]?e[t]=r.url:e[t].url=r.url}(e,t,r)}})}function b(e,t,r){return"string"==typeof e?{url:t}:new Blob([JSON.stringify(e.toJSON(r))],{type:"application/json"})}},57476:(e,t,r)=>{r.r(t),r.d(t,{default:()=>he});var i=r(43697),s=r(38171),o=r(51773),n=(r(16050),r(12501),r(28756),r(92271),r(72529),r(5499),r(84382),r(81571),r(91423),r(32400)),a=r(3172),l=r(46791),p=r(20102),d=r(92604),c=r(70586),u=r(16453),y=r(95330),h=r(17445),f=r(17452),g=r(5600),m=(r(75215),r(67676),r(1153)),b=r(71715),v=r(52011),w=r(31263),I=r(87085),_=r(54295),C=r(17287),L=r(66361),S=r(38009),F=r(16859),j=r(72965),x=r(32271),O=r(15506),P=r(21506),R=r(61960),E=r(85857),T=r(14147),N=r(53518),A=r(99514),Z=r(35671),D=r(51161),U=r(54306),q=r(30707),Q=r(56765),k=r(96674);let G=class extends k.wq{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};(0,i._)([(0,g.Cb)({type:String,json:{read:!0,write:!0}})],G.prototype,"name",void 0),(0,i._)([(0,g.Cb)({type:String,json:{read:!0,write:!0}})],G.prototype,"field",void 0),(0,i._)([(0,g.Cb)({type:[Number],json:{read:!0,write:!0}})],G.prototype,"currentRangeExtent",void 0),(0,i._)([(0,g.Cb)({type:[Number],json:{read:!0,write:!0}})],G.prototype,"fullRangeExtent",void 0),(0,i._)([(0,g.Cb)({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],G.prototype,"type",void 0),G=(0,i._)([(0,v.j)("esri.layers.support.RangeInfo")],G);var V,J=r(61247),W=r(22974),M=r(28659),z=r(20941),$=(r(80442),r(38913)),K=r(44547);let B=V=class extends((0,k.eC)(l.Z.ofType($.Z))){constructor(e){super(e)}clone(){return new V(this.items.map((e=>e.clone())))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map((r=>{if(!t.equals(r.spatialReference)){if(!(0,K.Up)(r.spatialReference,t))return e&&e.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const i=new $.Z;(0,K.Wt)(r,i,t),r=i}const i=r.toJSON(e);return delete i.spatialReference,i})).filter((e=>null!=e)):(e?.messages&&e.messages.push(new z.Z("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map((t=>t.toJSON(e))))}static fromJSON(e,t){const r=new V;return e.forEach((e=>r.add($.Z.fromJSON(e,t)))),r}};B=V=(0,i._)([(0,v.j)("esri.layers.support.PolygonCollection")],B);const Y=B;var H,X=r(25929);let ee=H=class extends k.wq{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new Y,this._geometriesSource=null,this._handles=new J.Z}initialize(){this._handles.add((0,h.on)((()=>this.geometries),"after-changes",(()=>this.geometries=this.geometries),h.Z_))}destroy(){this._handles.destroy()}readGeometries(e,t,r){this._geometriesSource={url:(0,X.f)(e,r),context:r}}async loadGeometries(e,t){if((0,c.Wi)(this._geometriesSource))return;const{url:r,context:i}=this._geometriesSource,s=await(0,a.default)(r,{responseType:"json",signal:(0,c.U2)(t,"signal")}),o=e.toJSON(),n=s.data.map((e=>({...e,spatialReference:o})));this.geometries=Y.fromJSON(n,i),this._geometriesSource=null}clone(){return new H({geometries:(0,W.d9)(this.geometries),spatialRelationship:this.spatialRelationship})}};(0,i._)([(0,g.Cb)({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],ee.prototype,"spatialRelationship",void 0),(0,i._)([(0,g.Cb)({type:Y,nonNullable:!0,json:{write:!0}}),(0,M.B)({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries"})],ee.prototype,"geometries",void 0),(0,i._)([(0,b.r)(["web-scene","portal-item"],"geometries")],ee.prototype,"readGeometries",null),ee=H=(0,i._)([(0,v.j)("esri.layers.support.SceneFilter")],ee);const te=ee;var re=r(40555),ie=r(14165),se=r(72245),oe=r(32163),ne=r(77397),ae=r(19833),le=r(65242);const pe=["3DObject","Point"],de=(0,N.v)();let ce=class extends((0,L.o1)((0,x.Vt)((0,C.Y)((0,S.q)((0,F.I)((0,j.M)((0,u.R)((0,_.V)(I.Z))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new l.Z,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return null!=e&&(0,c.pC)(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.types??[]:[]}get typeIdField(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new A.Z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:D.U4.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return ye[this.profile]||"mesh"}set renderer(e){(0,Z.YN)(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){const e=(0,c.pC)(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:O.C,{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:i,supportsUploadWithItemId:s,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:a,supportsM:l,isVersioned:p,supportsAttachment:d},operations:{supportsEditing:u,supportsAdd:y,supportsUpdate:h,supportsDelete:f,supportsQuery:g,supportsQueryAttachments:m}}=e,b=e.operations.supportsChangeTracking,v=(0,c.pC)(this.associatedLayer)&&(0,c.pC)(this.associatedLayer.infoFor3D)&&(0,se.Rx)();return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:i,supportsGeometryUpdate:v&&o,supportsUploadWithItemId:s},data:{supportsAttachment:d,supportsZ:a,supportsM:l,isVersioned:p},operations:{supportsQuery:g,supportsQueryAttachments:m,supportsEditing:u&&b,supportsAdd:v&&y&&b,supportsDelete:v&&f&&b,supportsUpdate:h&&b}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.infoFor3D:null}get defaultPopupTemplate(){return(0,c.pC)(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return(0,c.pC)(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const r=t.store.profile;return null!=r&&ue[r]?ue[r]:(d.Z.getLogger(this.declaredClass).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=(0,c.pC)(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(y.r9).then((()=>this._fetchService(t))).then((()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),(0,c.pC)(this.filter)?this.filter.loadGeometries(this.spatialReference):null]))).then((()=>this._validateElevationInfo())).then((()=>this._applyAssociatedLayerOverrides())).then((()=>this._populateFieldUsageInfo())).then((()=>(0,re.y)(this,{origin:"service"},t))).then((()=>(0,Z.YN)(this.renderer,this.fieldsIndex))).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}async beforeSave(){(0,c.pC)(this.filter)&&await this.load()}createQuery(){const e=new ie.Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryCachedAttributes(e,t){const r=(0,Z.Lk)(this.fieldsIndex,await(0,ae.e)(this,(0,ae.V)(this)));return(0,ne.xe)(this.parsedUrl.path,this.attributeStorageInfo??[],e,t,r)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||0===r.length)throw new p.Z("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const i=new s.Z;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(d.Z.getLogger(this.declaredClass).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return(0,oe.eZ)(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return(0,c.pC)(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),(0,c.Wi)(this.associatedLayer))throw new p.Z("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new p.Z("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new p.Z("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new p.Z("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const e of this.statisticsInfo)if(e.name===r.name){const r=(0,f.v_)(this.parsedUrl.path,e.href);return(0,a.default)(r,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new p.Z("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(x.xp.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(x.xp.SAVE,e)}async applyEdits(e,t){const i=await r.e(7541).then(r.bind(r,87269));if(await this.load(),(0,c.Wi)(this.associatedLayer))throw new p.Z(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),i.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!pe.includes(e.layerType))throw new p.Z("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new p.Z("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new p.Z("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});!function(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new p.Z("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new p.Z("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new p.Z("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!((0,c.pC)(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some((t=>t&&e.name===t.name))),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if((0,c.Wi)(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if((0,c.Wi)(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=(0,m.vw)(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===w.s3.SERVICE||o===w.s3.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}async _setAssociatedFeatureLayer(e){if(!["mesh-pyramids","points"].includes(this.profile))return;const t=new T.W(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(e){(0,y.D_)(e)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await(0,h.N1)((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?d.Z.getLogger(this.declaredClass).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):d.Z.getLogger(this.declaredClass).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&("mesh-pyramids"===this.profile&&"relative-to-scene"===e.mode&&d.Z.getLogger(this.declaredClass).warn(".elevationInfo=","Mesh scene layers don't support relative-to-scene elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&d.Z.getLogger(this.declaredClass).warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};(0,i._)([(0,g.Cb)({types:{key:"type",base:R.B,typeMap:{selection:E.Z}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],ce.prototype,"featureReduction",void 0),(0,i._)([(0,g.Cb)({type:[G],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],ce.prototype,"rangeInfos",void 0),(0,i._)([(0,g.Cb)({json:{read:!1}})],ce.prototype,"associatedLayer",void 0),(0,i._)([(0,g.Cb)({type:["show","hide"]})],ce.prototype,"listMode",void 0),(0,i._)([(0,g.Cb)({type:["ArcGISSceneServiceLayer"]})],ce.prototype,"operationalLayerType",void 0),(0,i._)([(0,g.Cb)({json:{read:!1},readOnly:!0})],ce.prototype,"type",void 0),(0,i._)([(0,g.Cb)({...de.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,"fields",void 0),(0,i._)([(0,g.Cb)()],ce.prototype,"types",null),(0,i._)([(0,g.Cb)()],ce.prototype,"typeIdField",null),(0,i._)([(0,g.Cb)()],ce.prototype,"formTemplate",null),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"fieldsIndex",null),(0,i._)([(0,g.Cb)({type:Q.Z,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],ce.prototype,"floorInfo",void 0),(0,i._)([(0,g.Cb)(de.outFields)],ce.prototype,"outFields",void 0),(0,i._)([(0,g.Cb)({type:D.U4,readOnly:!0,json:{read:!1}})],ce.prototype,"nodePages",void 0),(0,i._)([(0,b.r)("service","nodePages",["nodePages","pointNodePages"])],ce.prototype,"readNodePages",null),(0,i._)([(0,g.Cb)({type:[D.QI],readOnly:!0})],ce.prototype,"materialDefinitions",void 0),(0,i._)([(0,g.Cb)({type:[D.Yh],readOnly:!0})],ce.prototype,"textureSetDefinitions",void 0),(0,i._)([(0,g.Cb)({type:[D.H3],readOnly:!0})],ce.prototype,"geometryDefinitions",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"serviceUpdateTimeStamp",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"attributeStorageInfo",void 0),(0,i._)([(0,g.Cb)({readOnly:!0})],ce.prototype,"statisticsInfo",void 0),(0,i._)([(0,g.Cb)({type:l.Z.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],ce.prototype,"excludeObjectIds",void 0),(0,i._)([(0,g.Cb)({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ce.prototype,"definitionExpression",void 0),(0,i._)([(0,g.Cb)({type:te,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],ce.prototype,"filter",void 0),(0,i._)([(0,g.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ce.prototype,"path",void 0),(0,i._)([(0,g.Cb)(P.PV)],ce.prototype,"elevationInfo",null),(0,i._)([(0,g.Cb)({type:String})],ce.prototype,"geometryType",null),(0,i._)([(0,g.Cb)(P.iR)],ce.prototype,"labelsVisible",void 0),(0,i._)([(0,g.Cb)({type:[U.Z],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:q.r},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:q.r},write:!0}})],ce.prototype,"labelingInfo",void 0),(0,i._)([(0,g.Cb)(P.rn)],ce.prototype,"legendEnabled",void 0),(0,i._)([(0,g.Cb)({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?(0,le.b)(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],ce.prototype,"opacity",void 0),(0,i._)([(0,g.Cb)({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,"priority",void 0),(0,i._)([(0,g.Cb)({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ce.prototype,"semantic",void 0),(0,i._)([(0,g.Cb)({types:n.o,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],ce.prototype,"renderer",null),(0,i._)([(0,g.Cb)({json:{read:!1}})],ce.prototype,"cachedDrawingInfo",void 0),(0,i._)([(0,b.r)("service","cachedDrawingInfo")],ce.prototype,"readCachedDrawingInfo",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],ce.prototype,"capabilities",null),(0,i._)([(0,g.Cb)({type:Boolean,json:{read:!1}})],ce.prototype,"editingEnabled",null),(0,i._)([(0,g.Cb)({readOnly:!0,json:{write:!1,read:!1}})],ce.prototype,"infoFor3D",null),(0,i._)([(0,g.Cb)(P.C_)],ce.prototype,"popupEnabled",void 0),(0,i._)([(0,g.Cb)({type:o.Z,json:{name:"popupInfo",write:!0}})],ce.prototype,"popupTemplate",void 0),(0,i._)([(0,g.Cb)({readOnly:!0,json:{read:!1}})],ce.prototype,"defaultPopupTemplate",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ce.prototype,"objectIdField",void 0),(0,i._)([(0,b.r)("service","objectIdField",["objectIdField","fields"])],ce.prototype,"readObjectIdField",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ce.prototype,"globalIdField",void 0),(0,i._)([(0,b.r)("service","globalIdField",["globalIdField","fields"])],ce.prototype,"readGlobalIdField",null),(0,i._)([(0,g.Cb)({readOnly:!0,type:String,json:{read:!1}})],ce.prototype,"displayField",null),(0,i._)([(0,g.Cb)({type:String,json:{read:!1}})],ce.prototype,"profile",void 0),(0,i._)([(0,b.r)("service","profile",["store.profile"])],ce.prototype,"readProfile",null),(0,i._)([(0,g.Cb)({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],ce.prototype,"normalReferenceFrame",void 0),(0,i._)([(0,g.Cb)(P.YI)],ce.prototype,"screenSizePerspectiveEnabled",void 0),ce=(0,i._)([(0,v.j)("esri.layers.SceneLayer")],ce);const ue={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},ye={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},he=ce}}]);
|