@arcgis/core 4.28.4 → 4.28.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{80d9bb9f247ecdfa266f.js → 0695fcdc01f195c5ae8d.js} +1 -1
- package/assets/esri/core/workers/chunks/07cb7d142205f2eccc83.js +1 -0
- package/assets/esri/core/workers/chunks/0f6b766f08c648fd7b99.js +1 -0
- package/assets/esri/core/workers/chunks/16b56e541afa438dfb7f.js +1 -0
- package/assets/esri/core/workers/chunks/28c4a21cdddf2602ab97.js +1 -0
- package/assets/esri/core/workers/chunks/2cf2340ad817f3c27802.js +1 -0
- package/assets/esri/core/workers/chunks/319c222ce72254934060.js +1 -0
- package/assets/esri/core/workers/chunks/340ab726ba40fe3a99c8.js +1 -0
- package/assets/esri/core/workers/chunks/46b4a17ec898ab744861.js +1 -0
- package/assets/esri/core/workers/chunks/{7f3bc7a2de59e485f22f.js → 4f0412b52844aa9c7bd4.js} +1 -1
- package/assets/esri/core/workers/chunks/54867a094fb740a6f4d9.js +1 -0
- package/assets/esri/core/workers/chunks/5b17de91091fc17d9821.js +1 -0
- package/assets/esri/core/workers/chunks/5b80ae1eb79f1db75dc6.js +1 -0
- package/assets/esri/core/workers/chunks/80fcb63476829b6a48d2.js +1 -0
- package/assets/esri/core/workers/chunks/84725021c43f1122056a.js +1 -0
- package/assets/esri/core/workers/chunks/{9f0e8dd5c9bacfc0f03c.js → 908a5326b61843d6d2b3.js} +1 -1
- package/assets/esri/core/workers/chunks/9607460895182d31aef9.js +1 -0
- package/assets/esri/core/workers/chunks/9ef3746c545296565ef6.js +1 -0
- package/assets/esri/core/workers/chunks/{77f557359a5033d7e429.js → a0a86383e69932a25e50.js} +1 -1
- package/assets/esri/core/workers/chunks/a3bf50d9e24ad1de9847.js +1 -0
- package/assets/esri/core/workers/chunks/a5db3be5eeb3005df3c1.js +1 -0
- package/assets/esri/core/workers/chunks/a87ab14d6a6ccc9004a0.js +1 -0
- package/assets/esri/core/workers/chunks/ba00df2e707550939a6f.js +1 -0
- package/assets/esri/core/workers/chunks/ca43955065012d4b22e9.js +1 -0
- package/assets/esri/core/workers/chunks/e0382138cf58191a9697.js +1 -0
- package/assets/esri/core/workers/chunks/{e3950975030412ff6e20.js → f343db8dad71f3840610.js} +1 -1
- package/assets/esri/core/workers/chunks/{46ddc52fe9cdd573a614.js → fa5c69a0cdd78aa34ad7.js} +1 -1
- package/assets/esri/core/workers/chunks/fe0c6814ef56604540b3.js +1 -0
- package/core/sql/WhereClause.js +1 -1
- package/kernel.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/dateUtils.js +1 -1
- package/assets/esri/core/workers/chunks/32fbd4355a4a649623a7.js +0 -1
- package/assets/esri/core/workers/chunks/41306b698f78001dda55.js +0 -1
- package/assets/esri/core/workers/chunks/4747741429e8ff7112bb.js +0 -1
- package/assets/esri/core/workers/chunks/49faa024bab1ba6e2bf0.js +0 -1
- package/assets/esri/core/workers/chunks/534726130ef1698ec89e.js +0 -1
- package/assets/esri/core/workers/chunks/846e5e51dc278bc3f80f.js +0 -1
- package/assets/esri/core/workers/chunks/8b541cbf82a5ba0317ee.js +0 -1
- package/assets/esri/core/workers/chunks/8e91be2e38010391e351.js +0 -1
- package/assets/esri/core/workers/chunks/90f96a2ddfb25d851d4d.js +0 -1
- package/assets/esri/core/workers/chunks/91a3181071874525ed44.js +0 -1
- package/assets/esri/core/workers/chunks/9d97a20f69047d0c47cc.js +0 -1
- package/assets/esri/core/workers/chunks/ac4636e82a103e2c27ca.js +0 -1
- package/assets/esri/core/workers/chunks/ae7ba94af6d4fd97dd8b.js +0 -1
- package/assets/esri/core/workers/chunks/b0653f63745e756f55fe.js +0 -1
- package/assets/esri/core/workers/chunks/bab0aa000c65d5c256b7.js +0 -1
- package/assets/esri/core/workers/chunks/c2199fb8f7a54a0ef18a.js +0 -1
- package/assets/esri/core/workers/chunks/c3f462d11ed570482e7a.js +0 -1
- package/assets/esri/core/workers/chunks/c8cb5fe1d23145c4842b.js +0 -1
- package/assets/esri/core/workers/chunks/ce409944221a784ddb61.js +0 -1
- package/assets/esri/core/workers/chunks/e8b7d1c586aff229484c.js +0 -1
- package/assets/esri/core/workers/chunks/eb5213ffb83d83a4dd05.js +0 -1
- package/assets/esri/core/workers/chunks/f520f093aa81d8ee1790.js +0 -1
- package/assets/esri/core/workers/chunks/fab4ee57b7c5376c9ccd.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8008],{7335:(e,a,t)=>{t.d(a,{L:()=>n});var r=t(96187);class n{constructor(){this._serviceMetadatas=new Map}async fetchServiceMetadata(e,a){const t=this._serviceMetadatas.get(e);if(t)return t;const n=await(0,r.T)(e,a);return this._serviceMetadatas.set(e,n),n}}},71592:(e,a,t)=>{t.d(a,{w:()=>u});var r=t(40330),n=t(3172),s=t(20102),i=t(95330),l=t(66677),c=t(48522),o=t(15235);async function u(e,a){const t=(0,l.Qc)(e);if(!t)throw new s.Z("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const t=new o.default({id:a,apiKey:e.apiKey}),s=await async function(e){const a=r.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.Z)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,i.r9)(e)}return null}(e);null!=s&&(t.portal=new c.Z({url:s}));try{return t.load({signal:e.signal})}catch(e){return(0,i.r9)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new o.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,i.r9)(e),null}}(u);if(!f?.url)throw new s.Z("related-service-not-found","Could not find feature service through portal item relationship");const m=await d(f.url,u);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,n.Z)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,l.Qc)(e);if(!t)throw new s.Z("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,i=a.layerId;if(null==i)return{serverUrl:r};const c=y(a),o=e=>{const t={query:{f:"json"},responseType:"json",authMode:e,signal:a.signal};return(0,n.Z)(r,t)},u=o("anonymous").catch((()=>o("no-prompt"))),[d,f]=await Promise.all([u,c]),m=f?.layers,w=d.data&&d.data.layers;if(!Array.isArray(w))throw new Error("expected layers array");if(Array.isArray(m)){for(let e=0;e<Math.min(m.length,w.length);e++)if(m[e].id===i)return{serverUrl:r,layerId:w[e].id}}else if(null!=i&&i<w.length)return{serverUrl:r,layerId:w[i].id};throw new Error("could not find matching associated sublayer")}},87344:(e,a,t)=>{t.d(a,{T:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(8153)]).then(t.bind(t,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(4680),t.e(9238),t.e(6170),t.e(1767),t.e(4681),t.e(3554)]).then(t.bind(t,30223))).default,CSVLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(4680),t.e(9238),t.e(7587)]).then(t.bind(t,45425))).default,DimensionLayer:async()=>(await Promise.all([t.e(163),t.e(9717)]).then(t.bind(t,40081))).default,ElevationLayer:async()=>(await Promise.all([t.e(163),t.e(9016),t.e(2763)]).then(t.bind(t,65665))).default,FeatureLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(4680),t.e(9238),t.e(447)]).then(t.bind(t,19238))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(8621)]).then(t.bind(t,23477))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(6e3)]).then(t.bind(t,3723))).default,GroupLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9059)]).then(t.bind(t,40504))).default,ImageryLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(4599),t.e(6610),t.e(1319),t.e(4608)]).then(t.bind(t,60590))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(6610),t.e(1319),t.e(4136),t.e(9532)]).then(t.bind(t,74878))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(163),t.e(1767),t.e(1537)]).then(t.bind(t,9310))).default,KMLLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(1423),t.e(6413)]).then(t.bind(t,42756))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(163),t.e(4998)]).then(t.bind(t,21786))).default,LinkChartLayer:async()=>(await Promise.all([t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(6404),t.e(8968),t.e(3794),t.e(5129)]).then(t.bind(t,19087))).default,MapImageLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(4599),t.e(9735),t.e(2725),t.e(7374)]).then(t.bind(t,27374))).default,MapNotesLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(4680),t.e(9238),t.e(6618)]).then(t.bind(t,62128))).default,MediaLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(4828)]).then(t.bind(t,57765))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(3966),t.e(3809)]).then(t.bind(t,88068))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9971),t.e(6237)]).then(t.bind(t,66237))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(4680),t.e(9238),t.e(178)]).then(t.bind(t,44958))).default,PointCloudLayer:async()=>(await Promise.all([t.e(163),t.e(8775),t.e(1767),t.e(7863)]).then(t.bind(t,10608))).default,RouteLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(1423),t.e(9206)]).then(t.bind(t,40153))).default,SceneLayer:async()=>(await Promise.all([t.e(163),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6170),t.e(1767),t.e(4681),t.e(299)]).then(t.bind(t,57476))).default,StreamLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(3847)]).then(t.bind(t,88387))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(4680),t.e(7157),t.e(7701)]).then(t.bind(t,20697))).default,TileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(4599),t.e(9735),t.e(9016),t.e(2725),t.e(8636)]).then(t.bind(t,98636))).default,UnknownLayer:async()=>(await t.e(4166).then(t.bind(t,44166))).default,UnsupportedLayer:async()=>(await t.e(9296).then(t.bind(t,39296))).default,VectorTileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9016),t.e(4325),t.e(9805),t.e(5481)]).then(t.bind(t,94756))).default,VoxelLayer:async()=>(await Promise.all([t.e(163),t.e(8775),t.e(1767),t.e(7528)]).then(t.bind(t,28865))).default,WFSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6404),t.e(8089),t.e(5245)]).then(t.bind(t,12653))).default,WMSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7915)]).then(t.bind(t,25906))).default,WMTSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9971),t.e(2594)]).then(t.bind(t,72594))).default,WebTileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9971)]).then(t.bind(t,16199))).default}},3072:(e,a,t)=>{t.d(a,{$O:()=>s,CD:()=>u,Ok:()=>i,Q4:()=>l,XX:()=>c,_Y:()=>o,bS:()=>n});var r=t(71592);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function s(e,a,t){if(null==e?.layers||null==e?.tables){const r=await t.fetchServiceMetadata(a);(e=e||{}).layers=e.layers||r?.layers?.map(n),e.tables=e.tables||r?.tables?.map(n)}return e}function i(e){const a=e.layers;if(a?.length)return a[0].id;const t=e.tables;return t?.length?t[0].id:null}function l(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function c(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function o(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}async function u(e,a,t){if(!e?.url)return a??{};if(a??={},!a.layers){const r=await t.fetchServiceMetadata(e.url);a.layers=r.layers?.map(n)}const{serverUrl:s,portalItem:i}=await(0,r.w)(e.url,{sceneLayerItem:e}).catch((()=>({serverUrl:null,portalItem:null})));if(null==s)return a.tables=[],a;if(!a.tables&&i){const e=await i.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const e=await t.fetchServiceMetadata(s);a.tables=e?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${s}/${e.id}`;return a}},28008:(e,a,t)=>{t.d(a,{fromItem:()=>y,v:()=>d});var r=t(20102),n=t(71592),s=t(7335),i=t(84230),l=t(87344),c=t(15235),o=t(3072),u=t(14661);async function y(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new s.L;return async function(e){const a=e.className,t=l.T[a];return{constructor:await t(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"Map Service":return async function(e,a){return await async function(e,a){return(await a.fetchServiceMetadata(e.url)).tileInfo}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Feature Service":return async function(e,a){const t=await f(e,a);if("object"==typeof t){const e={};return null!=t.id&&(e.layerId=t.id),{className:t.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}(e,a);case"Feature Collection":return async function(e){await e.load();const a=(0,u._$)(e,"Map Notes"),t=(0,u._$)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,u._$)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,o.Q4)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Scene Service":return async function(e,a){const t=await f(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await(0,n.w)(e.url,{sceneLayerItem:e}),r=await a.fetchServiceMetadata(t);return r?.tables??[]}catch{return[]}}));if("object"==typeof t){const r={};let n;if(null!=t.id?(r.layerId=t.id,n=`${e.url}/layers/${t.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(i.fb))if(e.typeKeywords.includes(a))return{className:i.fb[a]};const s=await a.fetchServiceMetadata(n);return{className:i.fb[s?.layerType]||"SceneLayer",properties:r}}if(!1===t){const t=await a.fetchServiceMetadata(e.url);if("Voxel"===t?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Image Service":return async function(e,a){await e.load();const t=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await e.fetchData(),n=r?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url),i=s.cacheType?.toLowerCase(),l=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===i||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"Stream Service":case"Feed":return{className:"StreamLayer"};case"Vector Tile Service":return{className:"VectorTileLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"CSV":return{className:"CSVLayer"};case"KML":return{className:"KMLLayer"};case"WFS":return{className:"WFSLayer"};case"WMTS":return{className:"WMTSLayer"};case"WMS":return{className:"WMSLayer"};case"Group Layer":return{className:"GroupLayer"};default:throw new r.Z("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function f(e,a,t){const r=e.url;if(!r||/\/\d+$/.test(r))return{};await e.load();let n=await e.fetchData();if("Feature Service"===e.type){const e=await(0,o.$O)(n,r,a),t=m(e);if("object"==typeof t){const a=(0,o.XX)(e),r=(0,o._Y)(e);t.className=null!=t.id&&a.includes(t.id)?"SubtypeGroupLayer":null!=t.id&&r?.includes(t.id)?"OrientedImageryLayer":"FeatureLayer"}return t}if("Scene Service"===e.type&&(n=await(0,o.CD)(e,n,a)),(0,o.Q4)(n)>0)return m(n);const s=await a.fetchServiceMetadata(r);return t&&(s.tables=await t()),m(s)}function m(e){return 1===(0,o.Q4)(e)&&{id:(0,o.Ok)(e)}}},96187:(e,a,t)=>{t.d(a,{T:()=>n});var r=t(3172);async function n(e,a){const{data:t}=await(0,r.Z)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8008],{7335:(e,a,t)=>{t.d(a,{L:()=>n});var r=t(96187);class n{constructor(){this._serviceMetadatas=new Map}async fetchServiceMetadata(e,a){const t=this._serviceMetadatas.get(e);if(t)return t;const n=await(0,r.T)(e,a);return this._serviceMetadatas.set(e,n),n}}},71592:(e,a,t)=>{t.d(a,{w:()=>u});var r=t(40330),n=t(3172),s=t(20102),i=t(95330),l=t(66677),c=t(48522),o=t(15235);async function u(e,a){const t=(0,l.Qc)(e);if(!t)throw new s.Z("invalid-url","Invalid scene service url");const u={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(u.sceneLayerItem??=await async function(e){const a=(await y(e)).serviceItemId;if(!a)return null;const t=new o.default({id:a,apiKey:e.apiKey}),s=await async function(e){const a=r.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,n.Z)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,i.r9)(e)}return null}(e);null!=s&&(t.portal=new c.Z({url:s}));try{return t.load({signal:e.signal})}catch(e){return(0,i.r9)(e),null}}(u),null==u.sceneLayerItem)return d(u.sceneServerUrl.replace("/SceneServer","/FeatureServer"),u);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find((e=>"Feature Service"===e.type))||null;if(!t)return null;const r=new o.default({portal:t.portal,id:t.id});return await r.load(),r}catch(e){return(0,i.r9)(e),null}}(u);if(!f?.url)throw new s.Z("related-service-not-found","Could not find feature service through portal item relationship");const m=await d(f.url,u);return m.portalItem=f,m}async function y(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,n.Z)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,l.Qc)(e);if(!t)throw new s.Z("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,i=a.layerId;if(null==i)return{serverUrl:r};const c=y(a),o=e=>{const t={query:{f:"json"},responseType:"json",authMode:e,signal:a.signal};return(0,n.Z)(r,t)},u=o("anonymous").catch((()=>o("no-prompt"))),[d,f]=await Promise.all([u,c]),m=f?.layers,w=d.data&&d.data.layers;if(!Array.isArray(w))throw new Error("expected layers array");if(Array.isArray(m)){for(let e=0;e<Math.min(m.length,w.length);e++)if(m[e].id===i)return{serverUrl:r,layerId:w[e].id}}else if(null!=i&&i<w.length)return{serverUrl:r,layerId:w[i].id};throw new Error("could not find matching associated sublayer")}},87344:(e,a,t)=>{t.d(a,{T:()=>r});const r={BingMapsLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(8153)]).then(t.bind(t,2723))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(4723),t.e(9238),t.e(6170),t.e(1767),t.e(2139),t.e(3554)]).then(t.bind(t,30223))).default,CSVLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(4723),t.e(9238),t.e(7587)]).then(t.bind(t,45425))).default,DimensionLayer:async()=>(await Promise.all([t.e(163),t.e(9717)]).then(t.bind(t,40081))).default,ElevationLayer:async()=>(await Promise.all([t.e(163),t.e(9016),t.e(2763)]).then(t.bind(t,65665))).default,FeatureLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(4723),t.e(9238),t.e(447)]).then(t.bind(t,19238))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(2934)]).then(t.bind(t,23477))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(6e3)]).then(t.bind(t,3723))).default,GroupLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9059)]).then(t.bind(t,40504))).default,ImageryLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(4599),t.e(6610),t.e(1319),t.e(4608)]).then(t.bind(t,60590))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(6610),t.e(1319),t.e(4136),t.e(9532)]).then(t.bind(t,74878))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(163),t.e(1767),t.e(1537)]).then(t.bind(t,9310))).default,KMLLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(1423),t.e(6413)]).then(t.bind(t,42756))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(163),t.e(4998)]).then(t.bind(t,21786))).default,LinkChartLayer:async()=>(await Promise.all([t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(7215),t.e(8968),t.e(3794),t.e(6939)]).then(t.bind(t,19087))).default,MapImageLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(4599),t.e(9735),t.e(2725),t.e(7374)]).then(t.bind(t,27374))).default,MapNotesLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(4723),t.e(9238),t.e(6618)]).then(t.bind(t,62128))).default,MediaLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(4828)]).then(t.bind(t,57765))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(3966),t.e(2118)]).then(t.bind(t,88068))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9971),t.e(6237)]).then(t.bind(t,66237))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(4723),t.e(9238),t.e(178)]).then(t.bind(t,44958))).default,PointCloudLayer:async()=>(await Promise.all([t.e(163),t.e(8775),t.e(1767),t.e(7863)]).then(t.bind(t,10608))).default,RouteLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(1423),t.e(9206)]).then(t.bind(t,40153))).default,SceneLayer:async()=>(await Promise.all([t.e(163),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(6170),t.e(1767),t.e(2139),t.e(299)]).then(t.bind(t,57476))).default,StreamLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(5936)]).then(t.bind(t,88387))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(4723),t.e(7157),t.e(7021)]).then(t.bind(t,20697))).default,TileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(4599),t.e(9735),t.e(9016),t.e(2725),t.e(8636)]).then(t.bind(t,98636))).default,UnknownLayer:async()=>(await t.e(4166).then(t.bind(t,44166))).default,UnsupportedLayer:async()=>(await t.e(9296).then(t.bind(t,39296))).default,VectorTileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9016),t.e(4325),t.e(9805),t.e(5481)]).then(t.bind(t,94756))).default,VoxelLayer:async()=>(await Promise.all([t.e(163),t.e(8775),t.e(1767),t.e(7528)]).then(t.bind(t,28865))).default,WFSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7899),t.e(957),t.e(1423),t.e(3778),t.e(7215),t.e(8089),t.e(7740)]).then(t.bind(t,12653))).default,WMSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9790),t.e(8775),t.e(7915)]).then(t.bind(t,25906))).default,WMTSLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9971),t.e(2594)]).then(t.bind(t,72594))).default,WebTileLayer:async()=>(await Promise.all([t.e(163),t.e(4609),t.e(9971)]).then(t.bind(t,16199))).default}},3072:(e,a,t)=>{t.d(a,{$O:()=>s,CD:()=>u,Ok:()=>i,Q4:()=>l,XX:()=>c,_Y:()=>o,bS:()=>n});var r=t(71592);function n(e){const a={id:e.id,name:e.name};return"Oriented Imagery Layer"===e.type&&(a.layerType="OrientedImageryLayer"),a}async function s(e,a,t){if(null==e?.layers||null==e?.tables){const r=await t.fetchServiceMetadata(a);(e=e||{}).layers=e.layers||r?.layers?.map(n),e.tables=e.tables||r?.tables?.map(n)}return e}function i(e){const a=e.layers;if(a?.length)return a[0].id;const t=e.tables;return t?.length?t[0].id:null}function l(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function c(e){const a=[];return e?.layers?.forEach((e=>{"SubtypeGroupLayer"===e.layerType&&a.push(e.id)})),a}function o(e){return e?.layers?.filter((({layerType:e})=>"OrientedImageryLayer"===e)).map((({id:e})=>e))}async function u(e,a,t){if(!e?.url)return a??{};if(a??={},!a.layers){const r=await t.fetchServiceMetadata(e.url);a.layers=r.layers?.map(n)}const{serverUrl:s,portalItem:i}=await(0,r.w)(e.url,{sceneLayerItem:e}).catch((()=>({serverUrl:null,portalItem:null})));if(null==s)return a.tables=[],a;if(!a.tables&&i){const e=await i.fetchData();if(e?.tables)a.tables=e.tables.map(n);else{const e=await t.fetchServiceMetadata(s);a.tables=e?.tables?.map(n)}}if(a.tables)for(const e of a.tables)e.url=`${s}/${e.id}`;return a}},28008:(e,a,t)=>{t.d(a,{fromItem:()=>y,v:()=>d});var r=t(20102),n=t(71592),s=t(7335),i=t(84230),l=t(87344),c=t(15235),o=t(3072),u=t(14661);async function y(e){!e.portalItem||e.portalItem instanceof c.default||(e={...e,portalItem:new c.default(e.portalItem)});const a=await async function(e){await e.load();const a=new s.L;return async function(e){const a=e.className,t=l.T[a];return{constructor:await t(),properties:e.properties}}(await d(e,a))}(e.portalItem);return new(0,a.constructor)({portalItem:e.portalItem,...a.properties})}async function d(e,a){switch(e.type){case"Map Service":return async function(e,a){return await async function(e,a){return(await a.fetchServiceMetadata(e.url)).tileInfo}(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}(e,a);case"Feature Service":return async function(e,a){const t=await f(e,a);if("object"==typeof t){const e={};return null!=t.id&&(e.layerId=t.id),{className:t.className||"FeatureLayer",properties:e}}return{className:"GroupLayer"}}(e,a);case"Feature Collection":return async function(e){await e.load();const a=(0,u._$)(e,"Map Notes"),t=(0,u._$)(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if((0,u._$)(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return 1===(0,o.Q4)(r)?{className:"FeatureLayer"}:{className:"GroupLayer"}}(e);case"Scene Service":return async function(e,a){const t=await f(e,a,(async()=>{try{if(!e.url)return[];const{serverUrl:t}=await(0,n.w)(e.url,{sceneLayerItem:e}),r=await a.fetchServiceMetadata(t);return r?.tables??[]}catch{return[]}}));if("object"==typeof t){const r={};let n;if(null!=t.id?(r.layerId=t.id,n=`${e.url}/layers/${t.id}`):n=e.url,e.typeKeywords?.length)for(const a of Object.keys(i.fb))if(e.typeKeywords.includes(a))return{className:i.fb[a]};const s=await a.fetchServiceMetadata(n);return{className:i.fb[s?.layerType]||"SceneLayer",properties:r}}if(!1===t){const t=await a.fetchServiceMetadata(e.url);if("Voxel"===t?.layerType)return{className:"VoxelLayer"}}return{className:"GroupLayer"}}(e,a);case"Image Service":return async function(e,a){await e.load();const t=e.typeKeywords?.map((e=>e.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await e.fetchData(),n=r?.layerType;if("ArcGISTiledImageServiceLayer"===n)return{className:"ImageryTileLayer"};if("ArcGISImageServiceLayer"===n)return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url),i=s.cacheType?.toLowerCase(),l=s.capabilities?.toLowerCase().includes("tilesonly");return"map"===i||l?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}(e,a);case"Stream Service":case"Feed":return{className:"StreamLayer"};case"Vector Tile Service":return{className:"VectorTileLayer"};case"GeoJson":return{className:"GeoJSONLayer"};case"CSV":return{className:"CSVLayer"};case"KML":return{className:"KMLLayer"};case"WFS":return{className:"WFSLayer"};case"WMTS":return{className:"WMTSLayer"};case"WMS":return{className:"WMSLayer"};case"Group Layer":return{className:"GroupLayer"};default:throw new r.Z("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function f(e,a,t){const r=e.url;if(!r||/\/\d+$/.test(r))return{};await e.load();let n=await e.fetchData();if("Feature Service"===e.type){const e=await(0,o.$O)(n,r,a),t=m(e);if("object"==typeof t){const a=(0,o.XX)(e),r=(0,o._Y)(e);t.className=null!=t.id&&a.includes(t.id)?"SubtypeGroupLayer":null!=t.id&&r?.includes(t.id)?"OrientedImageryLayer":"FeatureLayer"}return t}if("Scene Service"===e.type&&(n=await(0,o.CD)(e,n,a)),(0,o.Q4)(n)>0)return m(n);const s=await a.fetchServiceMetadata(r);return t&&(s.tables=await t()),m(s)}function m(e){return 1===(0,o.Q4)(e)&&{id:(0,o.Ok)(e)}}},96187:(e,a,t)=>{t.d(a,{T:()=>n});var r=t(3172);async function n(e,a){const{data:t}=await(0,r.Z)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}});return t}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2330],{70272:(e,t,s)=>{s.d(t,{S6:()=>o,nd:()=>n,u_:()=>r});class r{constructor(e=null,t={},s,r){this.geometry=e,this.attributes=t,this.centroid=s,this.objectId=r,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new r(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}}function o(e){return!!e.geometry?.coords?.length}class n extends r{}},44876:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new r;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},5428:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(e=[],t=[],s=!1){this.lengths=e??[],this.coords=t??[],this.hasIndeterminateRingOrder=s}static fromRect(e){const[t,s,o,n]=e,i=o-t,a=n-s;return new r([5],[t,s,i,0,0,a,-i,0,0,-a])}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let s=0;s<this.lengths.length;s++){const r=this.lengths[s];for(let s=0;s<r;s++)e(this.coords[2*(s+t)],this.coords[2*(s+t)+1]);t+=r}}clone(e){return e?(e.set(this.coords),new r(this.lengths.slice(),e,this.hasIndeterminateRingOrder)):new r(this.lengths.slice(),this.coords.slice(),this.hasIndeterminateRingOrder)}}},95047:(e,t,s)=>{s.r(t),s.d(t,{createConnection:()=>C});var r=s(43697),o=(s(66577),s(3172)),n=s(20102),i=s(92604),a=s(95330),c=s(17452),h=(s(75215),s(67676),s(80442),s(52011)),l=s(5600),u=s(69285),d=s(32448);let g=class extends d.Z.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new n.Z("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,r._)([(0,l.Cb)({readOnly:!0})],g.prototype,"connectionError",null),g=(0,r._)([(0,h.j)("esri.layers.support.StreamConnection")],g);const f=g;var y,m;(m=y||(y={}))[m.CONNECTING=0]="CONNECTING",m[m.OPEN=1]="OPEN",m[m.CLOSING=2]="CLOSING",m[m.CLOSED=3]="CLOSED";let _=class extends f{constructor(e){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,u.k)(t,r,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case y.CONNECTING:case y.OPEN:return"connected";case y.CLOSING:case y.CLOSED:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,c.fl)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){const o=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(i.Z.getLogger(this).error(new n.Z("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(i.Z.getLogger(this).error(new n.Z("websocket-connection",`Failed to connect. Attempting to reconnect in ${o}s`,r)),await(0,a.e4)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void i.Z.getLogger(this).error(new n.Z("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise(((t,s)=>{const r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(r),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,s(e)}}))}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const s=(0,a.hh)(),r=t.onmessage,{filter:o,outFields:c,spatialReference:h}=this._config;return s.timeout(e),t.onmessage=e=>{let a=null;try{a=JSON.parse(e.data)}catch(e){}a&&"object"==typeof a||(i.Z.getLogger(this).error(new n.Z("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),s.reject(),this.destroy()),a.spatialReference?.wkid!==h?.wkid&&(i.Z.getLogger(this).error(new n.Z("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${h.wkid}`,e.data)),s.reject(),this.destroy()),"json"!==a.format&&(i.Z.getLogger(this).error(new n.Z("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),s.reject(),this.destroy()),o&&a.filter!==o&&i.Z.getLogger(this).error(new n.Z("websocket-connection","Tried to set filter, but server doesn't support it")),c&&a.outFields!==c&&i.Z.getLogger(this).error(new n.Z("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],s.resolve()},t.send(JSON.stringify({filter:o,outFields:c,format:"json",spatialReference:{wkid:h.wkid}})),s.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),i.Z.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&i.Z.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,r._)([(0,l.Cb)()],_.prototype,"connectionStatus",null),(0,r._)([(0,l.Cb)()],_.prototype,"errorString",void 0),_=(0,r._)([(0,h.j)("esri.layers.graphics.sources.connections.WebSocketConnection")],_);var p=s(34599),w=s(14165),b=s(33955),S=s(82971);const k={maxQueryDepth:5,maxRecordCountFactor:3};let v=class extends _{constructor(e){super({...k,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||i.Z.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:r}=this._config;this.destroyed||this._setFilter(s,r)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void i.Z.getLogger(this).error(new n.Z("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,o.Z)(e.path,{query:t,responseType:"json"}),r=(await s).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const s=e[0],{urls:r,token:o}=s,n=this._inferWebSocketBaseUrl(r);return(0,c.fl)(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return i.Z.getLogger(this).error(new n.Z("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if(null==s||null==e&&null==t)return;const r=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const c=(0,a.hh)();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(i.Z.getLogger(this).error(new n.Z("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),c.reject(t.error)),this._setWebSocketJSONParseHandler(s),o=!0,c.resolve())},s.send(r),setTimeout((()=>{o||(this.destroyed||this._websocket!==s||i.Z.getLogger(this).error(new n.Z("geoevent-connection","Server timed out when setting filter")),c.reject())}),1e4),c.promise}_serializeFilter(e,t){const s={};if(null==e&&null==t)return s;if(e?.geometry)try{const t=(0,b.im)(e.geometry);if("extent"!==t.type)throw new n.Z(`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){i.Z.getLogger(this).error(new n.Z("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(s.where=e.where),null!=t&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t],r=this._relatedFeatures.get(s);if(!r)return i.Z.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:a}=r;for(const t in o)e.attributes[t]=o[t];return a&&(e.geometry=a),e.geometry||e.centroid||i.Z.getLogger(this).error(new n.Z("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),r=this._queryArchive(t);await s;const o=await r;if(!o)return;for(const e of o.features)this.onFeature(this._enrich(e))}catch(e){i.Z.getLogger(this).error(new n.Z("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(163),s.e(4609),s.e(9790),s.e(8775),s.e(7899),s.e(1423),s.e(3778),s.e(6404),s.e(4680),s.e(9238),s.e(3342)]).then(s.bind(s,19238))).default)({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,n=r.query.supportsPagination,i=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,c=t.capabilities.query.maxRecordCount,h=o?c*a:c,l=new w.Z;if(l.outFields=this._config.outFields??["*"],l.where=this._config.filter?.where??"1=1",l.returnGeometry=!0,l.returnExceededLimitFeatures=!0,l.outSpatialReference=S.Z.fromJSON(this._config.spatialReference),i&&(l.returnCentroid=!0),o&&(l.maxRecordCountFactor=a),n)return l.num=h,t.destroy(),this._queryPages(e,l);const u=await(0,p.JT)(e,l,this._config.sourceSpatialReference);return t.destroy(),u.data}async _queryPages(e,t,s=[],r=0){t.start=null!=t.num?r*t.num:null;const{data:o}=await(0,p.JT)(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&r<(this._config.maxQueryDepth??0)?(o.features.forEach((e=>s.push(e))),this._queryPages(e,t,s,r+1)):(s.forEach((e=>o.features.push(e))),o)}_addRelatedFeatures(e){const t=new Map,s=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[r];t.set(s,e)}this._relatedFeatures=t}};v=(0,r._)([(0,h.j)("esri.layers.graphics.sources.connections.GeoEventConnection")],v);const F=v;let Z=class extends f{constructor(e){super(),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._featureZScaler=(0,u.k)(t,r,s)}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function C(e,t,s,r,o,n,i,a){const c={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:r,filter:o,maxReconnectionAttempts:n,maxReconnectionInterval:i,customParameters:a};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new _(c):new F(c):new Z(c)}(0,r._)([(0,l.Cb)()],Z.prototype,"connectionStatus",void 0),(0,r._)([(0,l.Cb)()],Z.prototype,"errorString",void 0),Z=(0,r._)([(0,h.j)("esri.layers.support.ClientSideConnection")],Z)},28694:(e,t,s)=>{s.d(t,{p:()=>o});var r=s(69285);function o(e,t,s){if(!s?.features||!s.hasZ)return;const o=(0,r.k)(s.geometryType,t,e.outSpatialReference);if(null!=o)for(const e of s.features)o(e.geometry)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2330],{70272:(e,t,s)=>{s.d(t,{S6:()=>o,nd:()=>n,u_:()=>r});class r{constructor(e=null,t={},s,r){this.geometry=e,this.attributes=t,this.centroid=s,this.objectId=r,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new r(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}}function o(e){return!!e.geometry?.coords?.length}class n extends r{}},44876:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new r;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},5428:(e,t,s)=>{s.d(t,{Z:()=>r});class r{constructor(e=[],t=[],s=!1){this.lengths=e??[],this.coords=t??[],this.hasIndeterminateRingOrder=s}static fromRect(e){const[t,s,o,n]=e,i=o-t,a=n-s;return new r([5],[t,s,i,0,0,a,-i,0,0,-a])}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let s=0;s<this.lengths.length;s++){const r=this.lengths[s];for(let s=0;s<r;s++)e(this.coords[2*(s+t)],this.coords[2*(s+t)+1]);t+=r}}clone(e){return e?(e.set(this.coords),new r(this.lengths.slice(),e,this.hasIndeterminateRingOrder)):new r(this.lengths.slice(),this.coords.slice(),this.hasIndeterminateRingOrder)}}},95047:(e,t,s)=>{s.r(t),s.d(t,{createConnection:()=>C});var r=s(43697),o=(s(66577),s(3172)),n=s(20102),i=s(92604),a=s(95330),c=s(17452),h=(s(75215),s(67676),s(80442),s(52011)),l=s(5600),u=s(69285),d=s(32448);let g=class extends d.Z.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new n.Z("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};(0,r._)([(0,l.Cb)({readOnly:!0})],g.prototype,"connectionError",null),g=(0,r._)([(0,h.j)("esri.layers.support.StreamConnection")],g);const f=g;var y,m;(m=y||(y={}))[m.CONNECTING=0]="CONNECTING",m[m.OPEN=1]="OPEN",m[m.CLOSING=2]="CLOSING",m[m.CLOSED=3]="CLOSED";let _=class extends f{constructor(e){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._config=e,this._featureZScaler=(0,u.k)(t,r,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),null!=this._websocket&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(null==this._websocket)return"disconnected";switch(this._websocket.readyState){case y.CONNECTING:case y.OPEN:return"connected";case y.CLOSING:case y.CLOSED:return"disconnected"}}sendMessageToSocket(e){null!=this._websocket?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,null!=this._websocket&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,s=0){try{if(this.destroyed)return;const t=(0,c.fl)(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(r){const o=t/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(i.Z.getLogger(this).error(new n.Z("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(i.Z.getLogger(this).error(new n.Z("websocket-connection",`Failed to connect. Attempting to reconnect in ${o}s`,r)),await(0,a.e4)(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(e){return void i.Z.getLogger(this).error(new n.Z("websocket-connection","Failed to parse message, invalid JSON",{error:e}))}}}_createWebSocket(e){return new Promise(((t,s)=>{const r=new WebSocket(e);r.onopen=()=>{if(r.onopen=null,this.destroyed)return r.onclose=null,void r.close();r.onclose=e=>this._onClose(e),r.onerror=e=>this._onError(e),this._setWebSocketJSONParseHandler(r),t(r)},r.onclose=e=>{r.onopen=r.onclose=null,s(e)}}))}async _handshake(e=1e4){const t=this._websocket;if(null==t)return;const s=(0,a.hh)(),r=t.onmessage,{filter:o,outFields:c,spatialReference:h}=this._config;return s.timeout(e),t.onmessage=e=>{let a=null;try{a=JSON.parse(e.data)}catch(e){}a&&"object"==typeof a||(i.Z.getLogger(this).error(new n.Z("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),s.reject(),this.destroy()),a.spatialReference?.wkid!==h?.wkid&&(i.Z.getLogger(this).error(new n.Z("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${h.wkid}`,e.data)),s.reject(),this.destroy()),"json"!==a.format&&(i.Z.getLogger(this).error(new n.Z("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),s.reject(),this.destroy()),o&&a.filter!==o&&i.Z.getLogger(this).error(new n.Z("websocket-connection","Tried to set filter, but server doesn't support it")),c&&a.outFields!==c&&i.Z.getLogger(this).error(new n.Z("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=r;for(const e of this._outstandingMessages)t.send(JSON.stringify(e));this._outstandingMessages=[],s.resolve()},t.send(JSON.stringify({filter:o,outFields:c,format:"json",spatialReference:{wkid:h.wkid}})),s.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),i.Z.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&i.Z.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};(0,r._)([(0,l.Cb)()],_.prototype,"connectionStatus",null),(0,r._)([(0,l.Cb)()],_.prototype,"errorString",void 0),_=(0,r._)([(0,h.j)("esri.layers.graphics.sources.connections.WebSocketConnection")],_);var p=s(34599),w=s(14165),b=s(33955),S=s(82971);const k={maxQueryDepth:5,maxRecordCountFactor:3};let v=class extends _{constructor(e){super({...k,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||i.Z.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:s,outFields:r}=this._config;this.destroyed||this._setFilter(s,r)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),null!=this._featureZScaler&&this._featureZScaler(t.geometry)}catch(e){return void i.Z.getLogger(this).error(new n.Z("geoevent-connection","Failed to parse message",e))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},s=(0,o.Z)(e.path,{query:t,responseType:"json"}),r=(await s).data;return this._serviceDefinition=r,r}_fetchWebSocketUrl(e,t){const s=e[0],{urls:r,token:o}=s,n=this._inferWebSocketBaseUrl(r);return(0,c.fl)(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return i.Z.getLogger(this).error(new n.Z("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const s=this._websocket;if(null==s||null==e&&null==t)return;const r=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const c=(0,a.hh)();return s.onmessage=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(i.Z.getLogger(this).error(new n.Z("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),c.reject(t.error)),this._setWebSocketJSONParseHandler(s),o=!0,c.resolve())},s.send(r),setTimeout((()=>{o||(this.destroyed||this._websocket!==s||i.Z.getLogger(this).error(new n.Z("geoevent-connection","Server timed out when setting filter")),c.reject())}),1e4),c.promise}_serializeFilter(e,t){const s={};if(null==e&&null==t)return s;if(e?.geometry)try{const t=(0,b.im)(e.geometry);if("extent"!==t.type)throw new n.Z(`Expected extent but found type ${t.type}`);s.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(e){i.Z.getLogger(this).error(new n.Z("geoevent-connection","Encountered an error when setting connection geometryDefinition",e))}return e?.where&&"1 = 1"!==e.where&&"1=1"!==e.where&&(s.where=e.where),null!=t&&(s.outFields=t.join(",")),s}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,s=e.attributes[t],r=this._relatedFeatures.get(s);if(!r)return i.Z.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:a}=r;for(const t in o)e.attributes[t]=o[t];return a&&(e.geometry=a),e.geometry||e.centroid||i.Z.getLogger(this).error(new n.Z("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,s=this._queryRelatedFeatures(e),r=this._queryArchive(t);await s;const o=await r;if(!o)return;for(const e of o.features)this.onFeature(this._enrich(e))}catch(e){i.Z.getLogger(this).error(new n.Z("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await Promise.all([s.e(163),s.e(4609),s.e(9790),s.e(8775),s.e(7899),s.e(1423),s.e(3778),s.e(7215),s.e(4723),s.e(9238),s.e(3342)]).then(s.bind(s,19238))).default)({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,n=r.query.supportsPagination,i=r.query.supportsCentroid,a=this._config.maxRecordCountFactor,c=t.capabilities.query.maxRecordCount,h=o?c*a:c,l=new w.Z;if(l.outFields=this._config.outFields??["*"],l.where=this._config.filter?.where??"1=1",l.returnGeometry=!0,l.returnExceededLimitFeatures=!0,l.outSpatialReference=S.Z.fromJSON(this._config.spatialReference),i&&(l.returnCentroid=!0),o&&(l.maxRecordCountFactor=a),n)return l.num=h,t.destroy(),this._queryPages(e,l);const u=await(0,p.JT)(e,l,this._config.sourceSpatialReference);return t.destroy(),u.data}async _queryPages(e,t,s=[],r=0){t.start=null!=t.num?r*t.num:null;const{data:o}=await(0,p.JT)(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&r<(this._config.maxQueryDepth??0)?(o.features.forEach((e=>s.push(e))),this._queryPages(e,t,s,r+1)):(s.forEach((e=>o.features.push(e))),o)}_addRelatedFeatures(e){const t=new Map,s=e.features,r=this._serviceDefinition.relatedFeatures.joinField;for(const e of s){const s=e.attributes[r];t.set(s,e)}this._relatedFeatures=t}};v=(0,r._)([(0,h.j)("esri.layers.graphics.sources.connections.GeoEventConnection")],v);const F=v;let Z=class extends f{constructor(e){super(),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:s,sourceSpatialReference:r}=e;this._featureZScaler=(0,u.k)(t,r,s)}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)null!=this._featureZScaler&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};function C(e,t,s,r,o,n,i,a){const c={source:e,sourceSpatialReference:t,spatialReference:s,geometryType:r,filter:o,maxReconnectionAttempts:n,maxReconnectionInterval:i,customParameters:a};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new _(c):new F(c):new Z(c)}(0,r._)([(0,l.Cb)()],Z.prototype,"connectionStatus",void 0),(0,r._)([(0,l.Cb)()],Z.prototype,"errorString",void 0),Z=(0,r._)([(0,h.j)("esri.layers.support.ClientSideConnection")],Z)},28694:(e,t,s)=>{s.d(t,{p:()=>o});var r=s(69285);function o(e,t,s){if(!s?.features||!s.hasZ)return;const o=(0,r.k)(s.geometryType,t,e.outSpatialReference);if(null!=o)for(const e of s.features)o(e.geometry)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7021,5732,5935],{5732:(e,t,i)=>{i.d(t,{c:()=>n,g:()=>r});var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},60437:(e,t,i)=>{i.d(t,{G_:()=>w,HH:()=>s,JR:()=>h,TC:()=>a,Tn:()=>c,Ue:()=>r,al:()=>o,bZ:()=>m,cS:()=>y,dp:()=>u,fS:()=>b,is:()=>f,op:()=>d,pp:()=>l,t8:()=>p});var n=i(6570);function r(e=g){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t,i,n,o,s,a=r()){return a[0]=e,a[1]=t,a[2]=i,a[3]=n,a[4]=o,a[5]=s,a}function s(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new n.Z(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function l(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function u(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function d(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function c(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function p(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function y(e){return e?p(e,w):r(w)}function h(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function m(e,t,i,n,r){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=n,e[4]=r,e[5]=Number.POSITIVE_INFINITY,e}function f(e){return 6===e.length}function b(e,t,i){if(null==e||null==t)return e===t;if(!f(e)||!f(t))return!1;if(i){for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}i(24470);const w=[1/0,1/0,1/0,-1/0,-1/0,-1/0],g=[0,0,0,0,0,0];r()},1231:(e,t,i)=>{i.d(t,{Z:()=>f});var n,r=i(43697),o=i(35454),s=i(96674),a=i(5600),l=i(75215),u=(i(67676),i(80442),i(36030)),d=i(71715),c=i(52011),p=i(72729),y=i(86719);const h=new o.X({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=n=class extends s.wq{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch(e){}return i?.value??null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch(e){}return i?h.fromJSON(i.fieldValueType):null}clone(){return new n({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],m.prototype,"alias",void 0),(0,r._)([(0,a.Cb)({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),(0,r._)([(0,a.Cb)()],m.prototype,"description",void 0),(0,r._)([(0,d.r)("description")],m.prototype,"readDescription",null),(0,r._)([(0,a.Cb)({types:p.V5,json:{read:{reader:p.im},write:!0}})],m.prototype,"domain",void 0),(0,r._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),(0,r._)([(0,a.Cb)({type:l.z8,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],m.prototype,"name",void 0),(0,r._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),(0,r._)([(0,u.J)(y.v)],m.prototype,"type",void 0),(0,r._)([(0,a.Cb)()],m.prototype,"valueType",void 0),(0,r._)([(0,d.r)("valueType",["description"])],m.prototype,"readValueType",null),(0,r._)([(0,a.Cb)({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=n=(0,r._)([(0,c.j)("esri.layers.support.Field")],m);const f=m},99514:(e,t,i)=>{i.d(t,{Z:()=>l});var n=i(20102),r=i(96674),o=i(92604),s=i(69165),a=i(25031);class l{static fromJSON(e){return new l(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new l(e.fields??[],p(e))}static fromLayerJSON(e){return new l(e.fields??[],p(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const i=[];for(const e of this.fields){const t=e?.name,n=d(t);if(t&&n){const r=u(t);this._fieldsMap.set(t,e),this._fieldsMap.set(r,e),this._normalizedFieldsMap.set(n,e),i.push(`${r}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,s.y2)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,s.H7)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,s.Dl)(e)||(0,s.Se)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,s.Dl)(e)||(0,s.Se)(e)||e.nullable||void 0!==(0,s.os)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(u(e))??this._normalizedFieldsMap.get(d(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(o.Z.getLogger("esri.layers.support.FieldsIndex").error(new n.Z("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),a.pt):c.has(t.type)?a._4:null:null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,s.sX)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,r.AK)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function u(e){return e.trim().toLowerCase()}function d(e){return(0,s.q6)(e)?.toLowerCase()??""}const c=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function p(e){const t=new Map;if(!e.fields)return t;const i=!0===e.datesInUnknownTimezone,{timeInfo:n,editFieldsInfo:r}=e,o=(n?"startField"in n?n.startField:n.startTimeField:"")??"",s=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,a.Jv)(e.dateFieldsTimeReference):null,d=r?function(e){return"timeZone"in e}(r)?r.timeZone??l:r.dateFieldsTimeReference?(0,a.Jv)(r.dateFieldsTimeReference):l??a.pt:null,p=n?function(e){return"timeZone"in e}(n)?n.timeZone??l:n.timeReference?(0,a.Jv)(n.timeReference):l:null,y=new Map([[u(r?.creationDateField??""),d],[u(r?.editDateField??""),d],[u(o),p],[u(s),p]]);for(const{name:n,type:r}of e.fields)if(c.has(r))t.set(n,a._4);else if("date"!==r&&"esriFieldTypeDate"!==r)t.set(n,null);else if(i)t.set(n,a._4);else{const e=y.get(u(n??""))??l;t.set(n,e)}return t}},72729:(e,t,i)=>{i.d(t,{im:()=>T,V5:()=>I}),i(80442);var n,r=i(43697),o=i(22974),s=i(5600),a=(i(75215),i(36030)),l=i(52011),u=i(96674);i(67676);let d=n=class extends u.wq{constructor(e){super(e),this.name=null,this.code=null}clone(){return new n({name:this.name,code:this.code})}};(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],d.prototype,"name",void 0),(0,r._)([(0,s.Cb)({type:[String,Number],json:{write:!0}})],d.prototype,"code",void 0),d=n=(0,r._)([(0,l.j)("esri.layers.support.CodedValue")],d);const c=new(i(35454).X)({inherited:"inherited",codedValue:"coded-value",range:"range"});let p=class extends u.wq{constructor(e){super(e),this.name=null,this.type=null}};(0,r._)([(0,s.Cb)({type:String,json:{write:!0}})],p.prototype,"name",void 0),(0,r._)([(0,a.J)(c)],p.prototype,"type",void 0),p=(0,r._)([(0,l.j)("esri.layers.support.Domain")],p);const y=p;var h;let m=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some((e=>(String(e.code)===i&&(t=e.name),!!t)))}return t}clone(){return new h({codedValues:(0,o.d9)(this.codedValues),name:this.name})}};(0,r._)([(0,s.Cb)({type:[d],json:{write:!0}})],m.prototype,"codedValues",void 0),(0,r._)([(0,a.J)({codedValue:"coded-value"})],m.prototype,"type",void 0),m=h=(0,r._)([(0,l.j)("esri.layers.support.CodedValueDomain")],m);const f=m;var b;i(92604),i(20102);let w=b=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new b}};(0,r._)([(0,a.J)({inherited:"inherited"})],w.prototype,"type",void 0),w=b=(0,r._)([(0,l.j)("esri.layers.support.InheritedDomain")],w);const g=w;var F;let _=F=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new F({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,r._)([(0,s.Cb)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],_.prototype,"maxValue",void 0),(0,r._)([(0,s.Cb)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],_.prototype,"minValue",void 0),(0,r._)([(0,a.J)({range:"range"})],_.prototype,"type",void 0),_=F=(0,r._)([(0,l.j)("esri.layers.support.RangeDomain")],_);const v=_,I={key:"type",base:y,typeMap:{range:_,"coded-value":f,inherited:g}};function T(e){if(!e?.type)return null;switch(e.type){case"range":return v.fromJSON(e);case"codedValue":return f.fromJSON(e);case"inherited":return g.fromJSON(e)}return null}},45574:(e,t,i)=>{i.d(t,{JD:()=>g,Jj:()=>v,sX:()=>E,Ob:()=>G,rP:()=>V,FV:()=>T,nU:()=>P,Ci:()=>S,Fr:()=>w,HW:()=>B,gG:()=>N,uA:()=>L,SU:()=>j,KE:()=>Z,VG:()=>O,tD:()=>C,kp:()=>x,C9:()=>M,rk:()=>q,kZ:()=>R,JY:()=>A,Y5:()=>_,uj:()=>I});var n=i(40330),r=i(9790),o=i(66643),s=i(20102),a=i(35454),l=i(42033),u=i(63213),d=i(14165);async function c(e,t,i){t=t.clone(),e.capabilities.query.supportsMaxRecordCountFactor&&(t.maxRecordCountFactor=p(e));const n=function(e){return p(e)*function(e){return e.capabilities.query.maxRecordCount||2e3}(e)}(e),r=e.capabilities.query.supportsPagination;t.start=0,t.num=n;let o=null;for(;;){const s=await e.source.queryFeaturesJSON(t,i);if(null==o?o=s:o.features=o.features.concat(s.features),o.exceededTransferLimit=s.exceededTransferLimit,!r||!s.exceededTransferLimit)break;t.start+=n}return o}function p(e){return e.capabilities.query.supportsMaxRecordCountFactor?d.Z.MAX_MAX_RECORD_COUNT_FACTOR:1}var y=i(84230),h=i(84382),m=i(81571),f=i(56545),b=i(75935);const w=new a.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function g(e,t,i,n){const r=await D(e);if(await F(e,t,n),!r.addAttachment)throw new s.Z(n,"Layer source does not support addAttachment capability");return r.addAttachment(t,i)}function F(e,t,i){const{attributes:n}=t,{objectIdField:r}=e;return e.capabilities?.data?.supportsAttachment?t?n?r&&n[r]?Promise.resolve():Promise.reject(new s.Z(i,`feature is missing the identifying attribute ${r}`)):Promise.reject(new s.Z(i,"'attributes' are required on a feature to query attachments")):Promise.reject(new s.Z(i,"A feature is required to add/delete/update attachments")):Promise.reject(new s.Z(i,"this layer doesn't support attachments"))}async function _(e,t,i,n,r){const o=await D(e);if(await F(e,t,r),!o.updateAttachment)throw new s.Z(r,"Layer source does not support updateAttachment capability");return o.updateAttachment(t,i,n)}async function v(e,t,n){const{applyEdits:r}=await i.e(4720).then(i.bind(i,14720)),o=await e.load(),{source:s,globalIdField:a}=o;let l=n;return("feature"===o.type?o.infoFor3D:null)&&null!=t.deleteFeatures&&null!=a&&(l={...l,globalIdToObjectId:await B(e,t.deleteFeatures,a)}),r(o,s,t,n)}async function I(e,t,n){const{uploadAssets:r}=await i.e(4720).then(i.bind(i,14720)),o=await e.load();return r(o,o.source,t,n)}async function T(e,t,i,n){const r=await D(e);if(await F(e,t,n),!r.deleteAttachments)throw new s.Z(n,"Layer source does not support deleteAttachments capability");return r.deleteAttachments(t,i)}async function S(e,t,i){const n=(await e.load({signal:t?.signal})).source;if(!n.fetchRecomputedExtents)throw new s.Z(i,"Layer source does not support fetchUpdates capability");return n.fetchRecomputedExtents(t)}async function j(e,t,i,n){t=f.Z.from(t),await e.load();const r=e.source,o=e.capabilities;if(!o?.data?.supportsAttachment)throw new s.Z(n,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:l,globalIds:u,num:d,size:c,start:p,where:y}=t;if(!o?.operations?.supportsQueryAttachments&&(a?.length>0||u?.length>0||c?.length>0||d||p||y))throw new s.Z(n,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t);if(!(l?.length||u?.length||y))throw new s.Z(n,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!r.queryAttachments)throw new s.Z(n,"Layer source does not support queryAttachments capability",t);return r.queryAttachments(t)}async function C(e,t,i,n){const r=await D(e);if(!r.queryObjectIds)throw new s.Z(n,"Layer source does not support queryObjectIds capability");return r.queryObjectIds(d.Z.from(t)??e.createQuery(),i)}async function O(e,t,i,n){const r=await D(e);if(!r.queryFeatureCount)throw new s.Z(n,"Layer source does not support queryFeatureCount capability");return r.queryFeatureCount(d.Z.from(t)??e.createQuery(),i)}async function Z(e,t,i,n){const r=await D(e);if(!r.queryExtent)throw new s.Z(n,"Layer source does not support queryExtent capability");return r.queryExtent(d.Z.from(t)??e.createQuery(),i)}async function x(e,t,i,n){const r=await D(e);if(!r.queryRelatedFeatures)throw new s.Z(n,"Layer source does not support queryRelatedFeatures capability");return r.queryRelatedFeatures(b.default.from(t),i)}async function M(e,t,i,n){const r=await D(e);if(!r.queryRelatedFeaturesCount)throw new s.Z(n,"Layer source does not support queryRelatedFeaturesCount capability");return r.queryRelatedFeaturesCount(b.default.from(t),i)}async function N(e){const t=e.source;if(t?.refresh)try{const{dataChanged:i,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),i)return!0}catch{}if(e.definitionExpression)try{return(await(0,l.E)(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function V(e){const t=new d.Z,i=e.capabilities?.data,n=e.capabilities?.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,n&&(t.compactGeometryEnabled=n.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),i&&(i.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),i.supportsM&&null!=e.returnM&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:r,timeExtent:o}=e;return t.timeExtent=null!=r&&null!=o?o.offset(-r.value,r.unit):o||null,t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null,t}function q(e){const{globalIdField:t,fields:i}=e;if(t)return t;if(i)for(const e of i)if("esriFieldTypeGlobalID"===e.type)return e.name}function R(e){const{objectIdField:t,fields:i}=e;if(t)return t;if(i)for(const e of i)if("esriFieldTypeOID"===e.type)return e.name}function A(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}async function D(e){return(await e.load()).source}async function P(e,t,i){const r=e.parsedUrl?.path;r&&e.authenticationTriggerEvent===t&&await async function(e,t){if(!n.id)return;if(n.id.findCredential(e))return;let i;try{const r=await(0,y.oP)(e,t);r&&(i=await n.id.checkSignInStatus(`${r}/sharing`))}catch(e){}if(i)try{const i=null!=t?t.signal:null;await n.id.getCredential(e,{signal:i})}catch(e){}}(r,i)}function E(e){return!e.sourceJSON?.isMultiServicesView&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const J=(0,u.d)({types:r.QT});function G(e,t){if(e.defaultSymbol)return e.types?.length?new m.Z({defaultSymbol:J(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:J(e.symbol,e,t)})))}):new h.Z({symbol:J(e.defaultSymbol,e,t)})}function L(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const i=e.editingInfo?.lastEditDate?.getTime();return null==i||(t*=1e3,Date.now()-i<t)}async function B(e,t,i){if(null==t)return null;const n=[],{objectIdField:r}=e;if(t.forEach((e=>{let t=null;if("attributes"in e){const{attributes:n}=e;t={globalId:n[i],objectId:null!=n[r]&&-1!==n[r]?n[r]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||n.push(t.globalId))})),0===n.length)return null;const s=e.createQuery();s.where=n.map((e=>`${i}='${e}'`)).join(" OR "),s.returnGeometry=!1,s.outFields=[r,i],s.cacheHint=!1;const a=await(0,o.mt)(c(e,s));if(!a.ok)return null;const l=new Map,u=a.value.features;for(const e of u){const t=e.attributes[i],n=e.attributes[r];null!=t&&null!=n&&-1!==n&&l.set(t,n)}return l}},53518:(e,t,i)=>{i.d(t,{v:()=>l});var n=i(80442),r=i(92604),o=i(1231),s=i(99514),a=i(69165);function l(){return{fields:{type:[o.Z],value:null,set:function(e){if(e&&(0,n.Z)("big-integer-warning-enabled")){const t=e.filter((e=>"big-integer"===e.type||"oid"===e.type&&(e.length||0)>=8));if(t.length){const e=t.map((e=>`'${e.name}'`)).join(", ");r.Z.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${e}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return s.Z.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const t of e){const i=this.fieldsIndex?.has(t);i||r.Z.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${t} found in outFields`,{layer:this,outFields:e})}return(0,a.Q0)(this.fieldsIndex,e)}}}}},86719:(e,t,i)=>{i.d(t,{v:()=>n});const n=new(i(35454).X)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"})},75935:(e,t,i)=>{i.r(t),i.d(t,{default:()=>h});var n,r=i(43697),o=(i(66577),i(96674)),s=i(22974),a=i(5600),l=i(75215),u=i(52011),d=i(30556),c=i(10158),p=i(82971);let y=n=class extends o.wq{constructor(e){super(e),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,this.start>0&&null==this.where&&(t.definitionExpression="1=1")}clone(){return new n((0,s.d9)({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};(0,r._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],y.prototype,"cacheHint",void 0),(0,r._)([(0,a.Cb)({type:c.n,json:{write:!0}})],y.prototype,"dynamicDataSource",void 0),(0,r._)([(0,a.Cb)({type:String,json:{write:!0}})],y.prototype,"gdbVersion",void 0),(0,r._)([(0,a.Cb)({type:Number,json:{write:!0}})],y.prototype,"geometryPrecision",void 0),(0,r._)([(0,a.Cb)({type:Date})],y.prototype,"historicMoment",void 0),(0,r._)([(0,d.c)("historicMoment")],y.prototype,"_writeHistoricMoment",null),(0,r._)([(0,a.Cb)({type:Number,json:{write:!0}})],y.prototype,"maxAllowableOffset",void 0),(0,r._)([(0,a.Cb)({type:[Number],json:{write:!0}})],y.prototype,"objectIds",void 0),(0,r._)([(0,a.Cb)({type:[String],json:{write:!0}})],y.prototype,"orderByFields",void 0),(0,r._)([(0,a.Cb)({type:[String],json:{write:!0}})],y.prototype,"outFields",void 0),(0,r._)([(0,a.Cb)({type:p.Z,json:{read:{source:"outSR"},write:{target:"outSR"}}})],y.prototype,"outSpatialReference",void 0),(0,r._)([(0,a.Cb)({json:{write:!0}})],y.prototype,"relationshipId",void 0),(0,r._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],y.prototype,"start",void 0),(0,r._)([(0,d.c)("start"),(0,d.c)("num")],y.prototype,"writeStart",null),(0,r._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],y.prototype,"num",void 0),(0,r._)([(0,a.Cb)({json:{write:!0}})],y.prototype,"returnGeometry",void 0),(0,r._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnM",void 0),(0,r._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnZ",void 0),(0,r._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],y.prototype,"where",void 0),y=n=(0,r._)([(0,u.j)("esri.rest.support.RelationshipQuery")],y),y.from=(0,l.se)(y);const h=y}}]);
|
package/core/sql/WhereClause.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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{SqlError as t,SqlErrorCodes as a}from"../../arcade/featureset/support/errorsupport.js";import has from"../has.js";import{isAggregate as r,aggregateFunction as s}from"./AggregateFunctions.js";import{DateOnly as i}from"./DateOnly.js";import{sqlCalculateFunction as n}from"./sqlArithmeticUtils.js";import{sqlCompare as o}from"./sqlCompareUtils.js";import{isDate as l,isDateTime as u,isTimestampOffset as c,isTimeOnly as h,isDateOnly as p,convertToExecutingTimeZone as m,parseTime as d,parseTimestamp as f,parseDate as v}from"./sqlDateParsingUtils.js";import{SqlInterval as N}from"./SqlInterval.js";import{SqlTimeStampOffset as g}from"./SqlTimestampOffset.js";import{isStandardized as S,evaluateFunction as T}from"./StandardizedFunctions.js";import{TimeOnly as y}from"./TimeOnly.js";import{WhereGrammar as _}from"./WhereGrammar.js";import{DateTime as w}from"luxon";const J=new Set(["current_timestamp","current_date","current_time"]);class A{static makeBool(e){return O(e)}static featureValue(e,t,a,r){return L(e,t,a,r)}static equalsNull(e){return null===e}static applyLike(e,t,a){return j(e,t,a)}static ensureArray(e){return x(e)}static applyIn(e,t){return k(e,t)}static currentDate(e){return i.fromNow(e)}static makeSqlInterval(e,t,a){return N.createFromValueAndQualifer(e,t,a)}static convertInterval(e){return e instanceof N?e.valueInMilliseconds():e}static currentTimestamp(e){return m(new Date,e)}static compare(e,t,a,r){return o(t,a,e)}static calculate(e,t,a,r){return n(e,t,a,r)}static evaluateTime(e){return d(e)}static evaluateTimestamp(e,t,a){return f(e,t,a)}static evaluateDate(e,t){return v(e,t)}static evaluateFunction(e,t,a){return T(e,t,a)}static lookup(e,t){const a=t[e];return void 0===a?null:a}static between(e,t,a){return null==e||null==t[0]||null==t[1]?null:o(e,t[0],">=")&&o(e,t[1],"<=")}static notbetween(e,t,a){return null==e||null==t[0]||null==t[1]?null:o(e,t[0],"<")||o(e,t[1],">")}static ternaryNot(e){return F(e)}static ternaryAnd(e,t){return b(e,t)}static ternaryOr(e,t){return D(e,t)}}class I{constructor(e,t,a="UTC"){this.fieldsIndex=t,this.timeZone=a,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=_.parse(e);const{isStandardized:r,isAggregate:s,referencedFieldNames:i}=this._extractExpressionInfo(t);this._referencedFieldNames=i,this.isStandardized=r,this.isAggregate=s}static convertValueToStorageFormat(e,t=null){if(null===t)return l(e)?e.getTime():u(e)?e.toMillis():c(e)?e.toStorageFormat():h(e)?e.toStorageString():p(e)?e.toStorageFormat():e;switch(t){case"date":return l(e)?e.getTime():u(e)?e.toMillis():c(e)?e.toMilliseconds():p(e)?e.toNumber():e;case"date-only":return l(e)?i.fromDateJS(e).toString():c(e)?i.fromSqlTimeStampOffset(e).toString():u(e)?i.fromDateTime(e).toString():e;case"time-only":return l(e)?y.fromDateJS(e).toStorageString():u(e)?y.fromDateTime(e).toStorageString():c(e)?y.fromSqlTimeStampOffset(e).toStorageString():h(e)?e.toStorageString():e;case"timestamp-offset":if(l(e))return g.fromJSDate(e).toStorageFormat();if(u(e))return g.fromDateTime(e).toStorageFormat();if(c(e))return e.toStorageFormat()}return e}static create(e,t,a="UTC"){return new I(e,t,a)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=C){return!!this._evaluateNode(this.parseTree,null,t,e)}calculateValue(e,t=C){const a=this._evaluateNode(this.parseTree,e,t,null);return a instanceof N?a.valueInMilliseconds()/864e5:a}calculateValueCompiled(e,t=C){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):has("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}testFeature(e,t=C){return!!this._evaluateNode(this.parseTree,e,t,null)}testFeatureCompiled(e,t=C){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):has("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||J.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,(t=>{if("function"===t.type){const a=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,s=`${a}-${t}`;e.has(s)||e.set(s,{aggregateType:a,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone",e).bind(A)}_extractExpressionInfo(e){const t=[],a=new Set;let s=!0,i=!1;return this._visitAll(this.parseTree,(n=>{switch(n.type){case"column-reference":{const r=e?.get(n.column);let s,i;r?s=i=r.name??"":(i=n.column,s=i.toLowerCase()),a.has(s)||(a.add(s),t.push(i)),n.column=i;break}case"function":{const{name:e,args:t}=n,a=t.value.length;s&&(s=S(e,a)),!1===i&&(i=r(e,a));break}}})),{referencedFieldNames:Array.from(t),isStandardized:s,isAggregate:i}}_visitAll(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const a of e.clauses)this._visitAll(a,t);"simple"===e.format&&this._visitAll(e.operand,t),null!==e.else&&this._visitAll(e.else,t);break;case"expression-list":for(const a of e.value)this._visitAll(a,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const a=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let r=0;r<e.clauses.length;r++)t+=" (this.compare('=',"+a+","+this.evaluateNodeToJavaScript(e.clauses[r].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let a=0;a<e.clauses.length;a++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[a].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[a].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const a of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(a);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new t(a.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new t(a.UnsupportedIsRhs);return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"))";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+")))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+")";case"NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+"))";case"<>":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)"}throw new t(a.UnsupportedOperator,{operator:e.operator});case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"time":return"this.evaluateTime(JSON.stringify(node.value))";case"date":return"this.evaluateDate(JSON.stringify(node.value), 'unknown')";case"timestamp":return"this.evaluateTimestamp(JSON.stringify(node.value), 'unknown')";case"current-time":return"date"===e.mode?"this.currentDate(timeZone)":"this.currentTimestamp(timeZone)";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",fieldsIndex,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+", timeZone)"}throw new t(a.UnsupportedSyntax,{node:e.type})}_evaluateNode(u,c,h,p){let g;switch(u.type){case"interval":{const e=this._evaluateNode(u.value,c,h,p);return N.createFromValueAndQualifer(e,u.qualifier,u.op)}case"case-expression":if("simple"===u.format){const e=this._evaluateNode(u.operand,c,h,p);for(let t=0;t<u.clauses.length;t++)if(o(e,this._evaluateNode(u.clauses[t].operand,c,h,p),"=",this.timeZone))return this._evaluateNode(u.clauses[t].value,c,h,p);if(null!==u.else)return this._evaluateNode(u.else,c,h,p)}else{for(let e=0;e<u.clauses.length;e++)if(O(this._evaluateNode(u.clauses[e].operand,c,h,p)))return this._evaluateNode(u.clauses[e].value,c,h,p);if(null!==u.else)return this._evaluateNode(u.else,c,h,p)}return null;case"parameter":return g=this.parameters[u.value.toLowerCase()],l(g)?w.fromJSDate(g):g instanceof e?g.toDateTime():g;case"expression-list":{const e=[];for(const t of u.value)e.push(this._evaluateNode(t,c,h,p));return e}case"unary-expression":return F(this._evaluateNode(u.expr,c,h,p));case"binary-expression":switch(u.operator){case"AND":return b(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p));case"OR":return D(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p));case"IS":if("null"!==u.right.type)throw new t(a.UnsupportedIsRhs);return null===this._evaluateNode(u.left,c,h,p);case"ISNOT":if("null"!==u.right.type)throw new t(a.UnsupportedIsRhs);return null!==this._evaluateNode(u.left,c,h,p);case"IN":{const e=x(this._evaluateNode(u.right,c,h,p));return k(this._evaluateNode(u.left,c,h,p),e)}case"NOT IN":{const e=x(this._evaluateNode(u.right,c,h,p));return F(k(this._evaluateNode(u.left,c,h,p),e))}case"BETWEEN":{const e=this._evaluateNode(u.left,c,h,p),t=this._evaluateNode(u.right,c,h,p);return null==e||null==t[0]||null==t[1]?null:o(e,t[0],">=",this.timeZone)&&o(e,t[1],"<=",this.timeZone)}case"NOTBETWEEN":{const e=this._evaluateNode(u.left,c,h,p),t=this._evaluateNode(u.right,c,h,p);return null==e||null==t[0]||null==t[1]?null:o(e,t[0],"<",this.timeZone)||o(e,t[1],">",this.timeZone)}case"LIKE":return j(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),u.escape);case"NOT LIKE":return F(j(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),u.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return o(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),u.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return n(u.operator,this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),this.timeZone)}case"null":case"boolean":case"string":case"number":return u.value;case"date":return v(u.value,"unknown");case"timestamp":return f(u.value,"unknown");case"time":return d(u.value);case"current-time":return"date"===u.mode?i.fromNow(this.timeZone):m(new Date,this.timeZone);case"column-reference":return L(c,u.column,this.fieldsIndex,h);case"data-type":return u.value;case"function":{if(this.isAggregate&&r(u.name,u.args.value.length)){const e=[];for(const t of u.args?.value||[]){const a=[];for(const e of p||[])a.push(this._evaluateNode(t,e,h,null));e.push(a)}return s(u.name,e)}const e=this._evaluateNode(u.args,c,h,p);return T(u.name,e,this.timeZone)}}throw new t(a.UnsupportedSyntax,{node:u.type})}}function O(e){return!0===e}function x(e){return Array.isArray(e)?e:[e]}function F(e){return null!==e?!0!==e:null}function b(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function D(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function k(e,t){if(null==e)return null;let a=!1;for(const r of t)if(null==r)a=null;else if(e===r){a=!0;break}return a}const E="-[]/{}()*+?.\\^$|";var Z;function V(e,t){const a=t;let r="",s=Z.Normal;for(let i=0;i<e.length;i++){const t=e.charAt(i);switch(s){case Z.Normal:t===a?s=Z.Escaped:E.includes(t)?r+="\\"+t:r+="%"===t?".*":"_"===t?".":t;break;case Z.Escaped:E.includes(t)?r+="\\"+t:r+=t,s=Z.Normal}}return new RegExp("^"+r+"$","m")}function j(e,t,a){if(null==e)return null;return V(t,a).test(e)}function q(e){return e&&"object"==typeof e.attributes}function L(e,t,a,r){const s=r.getAttribute(e,t),n=a?.get(t);return null==s||"esriFieldTypeDate"!==n?.type&&"date"!==n?.type?null==s||"esriFieldTypeDateOnly"!==n?.type&&"date-only"!==n?.type?null==s||"esriFieldTypeTimeOnly"!==n?.type&&"time-only"!==n?.type?null==s||"esriFieldTypeTimestampOffset"!==n?.type&&"timestamp-offset"!==n?.type?s:new g(s):y.fromReader(s):i.fromReader(s):m(new Date(s),a.getTimeZone(n.name)??"UTC")}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(Z||(Z={}));const C={getAttribute:(e,t)=>(q(e)?e.attributes:e)[t]};export{I as WhereClause,C as defaultAttributeAdapter};
|
|
5
|
+
import{ArcadeDate as e}from"../../arcade/ArcadeDate.js";import{SqlError as t,SqlErrorCodes as a}from"../../arcade/featureset/support/errorsupport.js";import has from"../has.js";import{isAggregate as r,aggregateFunction as s}from"./AggregateFunctions.js";import{DateOnly as i}from"./DateOnly.js";import{sqlCalculateFunction as n}from"./sqlArithmeticUtils.js";import{sqlCompare as l}from"./sqlCompareUtils.js";import{isDate as o,isDateTime as u,isTimestampOffset as c,isTimeOnly as h,isDateOnly as p,convertToExecutingTimeZone as m,parseTime as d,parseTimestamp as f,parseDate as v}from"./sqlDateParsingUtils.js";import{SqlInterval as N}from"./SqlInterval.js";import{SqlTimeStampOffset as g}from"./SqlTimestampOffset.js";import{isStandardized as S,evaluateFunction as T}from"./StandardizedFunctions.js";import{TimeOnly as y}from"./TimeOnly.js";import{WhereGrammar as _}from"./WhereGrammar.js";import{DateTime as w}from"luxon";const J=new Set(["current_timestamp","current_date","current_time"]);class A{static makeBool(e){return O(e)}static featureValue(e,t,a,r){return L(e,t,a,r)}static equalsNull(e){return null===e}static applyLike(e,t,a){return j(e,t,a)}static ensureArray(e){return x(e)}static applyIn(e,t){return k(e,t)}static currentDate(e){return i.fromNow(e)}static makeSqlInterval(e,t,a){return N.createFromValueAndQualifer(e,t,a)}static convertInterval(e){return e instanceof N?e.valueInMilliseconds():e}static currentTimestamp(e){return m(new Date,e)}static compare(e,t,a,r){return l(t,a,e)}static calculate(e,t,a,r){return n(e,t,a,r)}static evaluateTime(e){return d(e)}static evaluateTimestamp(e,t,a){return f(e,t,a)}static evaluateDate(e,t){return v(e,t)}static evaluateFunction(e,t,a){return T(e,t,a)}static lookup(e,t){const a=t[e];return void 0===a?null:a}static between(e,t,a){return null==e||null==t[0]||null==t[1]?null:l(e,t[0],">=")&&l(e,t[1],"<=")}static notbetween(e,t,a){return null==e||null==t[0]||null==t[1]?null:l(e,t[0],"<")||l(e,t[1],">")}static ternaryNot(e){return F(e)}static ternaryAnd(e,t){return b(e,t)}static ternaryOr(e,t){return D(e,t)}}class I{constructor(e,t,a="UTC"){this.fieldsIndex=t,this.timeZone=a,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=_.parse(e);const{isStandardized:r,isAggregate:s,referencedFieldNames:i}=this._extractExpressionInfo(t);this._referencedFieldNames=i,this.isStandardized=r,this.isAggregate=s}static convertValueToStorageFormat(e,t=null){if(null===t)return o(e)?e.getTime():u(e)?e.toMillis():c(e)?e.toStorageFormat():h(e)?e.toStorageString():p(e)?e.toStorageFormat():e;switch(t){case"date":return o(e)?e.getTime():u(e)?e.toMillis():c(e)?e.toMilliseconds():p(e)?e.toNumber():e;case"date-only":return o(e)?i.fromDateJS(e).toString():c(e)?i.fromSqlTimeStampOffset(e).toString():u(e)?i.fromDateTime(e).toString():e;case"time-only":return o(e)?y.fromDateJS(e).toStorageString():u(e)?y.fromDateTime(e).toStorageString():c(e)?y.fromSqlTimeStampOffset(e).toStorageString():h(e)?e.toStorageString():e;case"timestamp-offset":if(o(e))return g.fromJSDate(e).toStorageFormat();if(u(e))return g.fromDateTime(e).toStorageFormat();if(c(e))return e.toStorageFormat()}return e}static create(e,t,a="UTC"){return new I(e,t,a)}get fieldNames(){return this._referencedFieldNames}testSet(e,t=C){return!!this._evaluateNode(this.parseTree,null,t,e)}calculateValue(e,t=C){const a=this._evaluateNode(this.parseTree,e,t,null);return a instanceof N?a.valueInMilliseconds()/864e5:a}calculateValueCompiled(e,t=C){return null!=this.parseTree._compiledVersion?this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):has("esri-csp-restrictions")?this.calculateValue(e,t):(this._compileMe(),this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}testFeature(e,t=C){return!!this._evaluateNode(this.parseTree,e,t,null)}testFeatureCompiled(e,t=C){return null!=this.parseTree._compiledVersion?!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone):has("esri-csp-restrictions")?this.testFeature(e,t):(this._compileMe(),!!this.parseTree._compiledVersion(e,this.parameters,t,this.fieldsIndex,this.timeZone))}get hasDateFunctions(){return null!=this._hasDateFunctions||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,(e=>{"current-time"===e.type?this._hasDateFunctions=!0:"function"===e.type&&(this._hasDateFunctions=this._hasDateFunctions||J.has(e.name.toLowerCase()))}))),this._hasDateFunctions}getFunctions(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"function"===t.type&&e.add(t.name.toLowerCase())})),Array.from(e)}getExpressions(){const e=new Map;return this._visitAll(this.parseTree,(t=>{if("function"===t.type){const a=t.name.toLowerCase(),r=t.args.value[0];if("column-reference"===r.type){const t=r.column,s=`${a}-${t}`;e.has(s)||e.set(s,{aggregateType:a,field:t})}}})),[...e.values()]}getVariables(){const e=new Set;return this._visitAll(this.parseTree,(t=>{"parameter"===t.type&&e.add(t.value.toLowerCase())})),Array.from(e)}_compileMe(){const e="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone",e).bind(A)}_extractExpressionInfo(e){const t=[],a=new Set;let s=!0,i=!1;return this._visitAll(this.parseTree,(n=>{switch(n.type){case"column-reference":{const r=e?.get(n.column);let s,i;r?s=i=r.name??"":(i=n.column,s=i.toLowerCase()),a.has(s)||(a.add(s),t.push(i)),n.column=i;break}case"function":{const{name:e,args:t}=n,a=t.value.length;s&&(s=S(e,a)),!1===i&&(i=r(e,a));break}}})),{referencedFieldNames:Array.from(t),isStandardized:s,isAggregate:i}}_visitAll(e,t){if(null!=e)switch(t(e),e.type){case"when-clause":this._visitAll(e.operand,t),this._visitAll(e.value,t);break;case"case-expression":for(const a of e.clauses)this._visitAll(a,t);"simple"===e.format&&this._visitAll(e.operand,t),null!==e.else&&this._visitAll(e.else,t);break;case"expression-list":for(const a of e.value)this._visitAll(a,t);break;case"unary-expression":this._visitAll(e.expr,t);break;case"binary-expression":this._visitAll(e.left,t),this._visitAll(e.right,t);break;case"function":this._visitAll(e.args,t)}}evaluateNodeToJavaScript(e){switch(e.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(e.value)+", "+JSON.stringify(e.qualifier)+","+JSON.stringify(e.op)+")";case"case-expression":{let t="";if("simple"===e.format){const a=this.evaluateNodeToJavaScript(e.operand);t="( ";for(let r=0;r<e.clauses.length;r++)t+=" (this.compare('=',"+a+","+this.evaluateNodeToJavaScript(e.clauses[r].operand)+") ? ("+this.evaluateNodeToJavaScript(e.clauses[r].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}else{t="( ";for(let a=0;a<e.clauses.length;a++)t+=" this.makeBool("+this.evaluateNodeToJavaScript(e.clauses[a].operand)+")===true ? ("+this.evaluateNodeToJavaScript(e.clauses[a].value)+") : ";null!==e.else?t+=this.evaluateNodeToJavaScript(e.else):t+="null",t+=" )"}return t}case"parameter":return"this.lookup("+JSON.stringify(e.value.toLowerCase())+",lookups)";case"expression-list":{let t="[";for(const a of e.value)"["!==t&&(t+=","),t+=this.evaluateNodeToJavaScript(a);return t+="]",t}case"unary-expression":return"this.ternaryNot("+this.evaluateNodeToJavaScript(e.expr)+")";case"binary-expression":switch(e.operator){case"AND":return"this.ternaryAnd("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"OR":return"this.ternaryOr("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+" )";case"IS":if("null"!==e.right.type)throw new t(a.UnsupportedIsRhs);return"this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")";case"ISNOT":if("null"!==e.right.type)throw new t(a.UnsupportedIsRhs);return"(!(this.equalsNull("+this.evaluateNodeToJavaScript(e.left)+")))";case"IN":return"this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+"))";case"NOT IN":return"this.ternaryNot(this.applyIn("+this.evaluateNodeToJavaScript(e.left)+",this.ensureArray("+this.evaluateNodeToJavaScript(e.right)+")))";case"BETWEEN":return"this.between("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"NOTBETWEEN":return"this.notbetween("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"LIKE":return"this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+")";case"NOT LIKE":return"this.ternaryNot(this.applyLike("+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+","+JSON.stringify(e.escape)+"))";case"<>":case"<":case">":case">=":case"<=":case"=":return"this.compare("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)";case"*":case"-":case"+":case"/":case"||":return"this.calculate("+JSON.stringify(e.operator)+","+this.evaluateNodeToJavaScript(e.left)+","+this.evaluateNodeToJavaScript(e.right)+", timeZone)"}throw new t(a.UnsupportedOperator,{operator:e.operator});case"null":case"boolean":case"string":case"number":return JSON.stringify(e.value);case"time":return"this.evaluateTime(JSON.stringify(node.value))";case"date":return"this.evaluateDate(JSON.stringify(node.value), 'unknown')";case"timestamp":return"this.evaluateTimestamp(JSON.stringify(node.value), 'unknown')";case"current-time":return"date"===e.mode?"this.currentDate(timeZone)":"this.currentTimestamp(timeZone)";case"column-reference":return"this.featureValue(feature,"+JSON.stringify(e.column)+",fieldsIndex,attributeAdapter)";case"function":return"this.evaluateFunction("+JSON.stringify(e.name)+","+this.evaluateNodeToJavaScript(e.args)+", timeZone)"}throw new t(a.UnsupportedSyntax,{node:e.type})}_evaluateNode(u,c,h,p){let g;switch(u.type){case"interval":{const e=this._evaluateNode(u.value,c,h,p);return N.createFromValueAndQualifer(e,u.qualifier,u.op)}case"case-expression":if("simple"===u.format){const e=this._evaluateNode(u.operand,c,h,p);for(let t=0;t<u.clauses.length;t++)if(l(e,this._evaluateNode(u.clauses[t].operand,c,h,p),"=",this.timeZone))return this._evaluateNode(u.clauses[t].value,c,h,p);if(null!==u.else)return this._evaluateNode(u.else,c,h,p)}else{for(let e=0;e<u.clauses.length;e++)if(O(this._evaluateNode(u.clauses[e].operand,c,h,p)))return this._evaluateNode(u.clauses[e].value,c,h,p);if(null!==u.else)return this._evaluateNode(u.else,c,h,p)}return null;case"parameter":return g=this.parameters[u.value.toLowerCase()],o(g)?w.fromJSDate(g):g instanceof e?g.toDateTime():g;case"expression-list":{const e=[];for(const t of u.value)e.push(this._evaluateNode(t,c,h,p));return e}case"unary-expression":return F(this._evaluateNode(u.expr,c,h,p));case"binary-expression":switch(u.operator){case"AND":return b(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p));case"OR":return D(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p));case"IS":if("null"!==u.right.type)throw new t(a.UnsupportedIsRhs);return null===this._evaluateNode(u.left,c,h,p);case"ISNOT":if("null"!==u.right.type)throw new t(a.UnsupportedIsRhs);return null!==this._evaluateNode(u.left,c,h,p);case"IN":{const e=x(this._evaluateNode(u.right,c,h,p));return k(this._evaluateNode(u.left,c,h,p),e)}case"NOT IN":{const e=x(this._evaluateNode(u.right,c,h,p));return F(k(this._evaluateNode(u.left,c,h,p),e))}case"BETWEEN":{const e=this._evaluateNode(u.left,c,h,p),t=this._evaluateNode(u.right,c,h,p);return null==e||null==t[0]||null==t[1]?null:l(e,t[0],">=",this.timeZone)&&l(e,t[1],"<=",this.timeZone)}case"NOTBETWEEN":{const e=this._evaluateNode(u.left,c,h,p),t=this._evaluateNode(u.right,c,h,p);return null==e||null==t[0]||null==t[1]?null:l(e,t[0],"<",this.timeZone)||l(e,t[1],">",this.timeZone)}case"LIKE":return j(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),u.escape);case"NOT LIKE":return F(j(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),u.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return l(this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),u.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return n(u.operator,this._evaluateNode(u.left,c,h,p),this._evaluateNode(u.right,c,h,p),this.timeZone)}case"null":case"boolean":case"string":case"number":return u.value;case"date":return u.parsedValue??=v(u.value,"unknown"),u.parsedValue;case"timestamp":return u.parsedValue??=f(u.value,"unknown"),u.parsedValue;case"time":return d(u.value);case"current-time":return"date"===u.mode?i.fromNow(this.timeZone):m(new Date,this.timeZone);case"column-reference":return L(c,u.column,this.fieldsIndex,h);case"data-type":return u.value;case"function":{if(this.isAggregate&&r(u.name,u.args.value.length)){const e=[];for(const t of u.args?.value||[]){const a=[];for(const e of p||[])a.push(this._evaluateNode(t,e,h,null));e.push(a)}return s(u.name,e)}const e=this._evaluateNode(u.args,c,h,p);return T(u.name,e,this.timeZone)}}throw new t(a.UnsupportedSyntax,{node:u.type})}}function O(e){return!0===e}function x(e){return Array.isArray(e)?e:[e]}function F(e){return null!==e?!0!==e:null}function b(e,t){return null!=e&&null!=t?!0===e&&!0===t:!1!==e&&!1!==t&&null}function D(e,t){return null!=e&&null!=t?!0===e||!0===t:!0===e||!0===t||null}function k(e,t){if(null==e)return null;let a=!1;for(const r of t)if(null==r)a=null;else if(e===r){a=!0;break}return a}const E="-[]/{}()*+?.\\^$|";var Z;function V(e,t){const a=t;let r="",s=Z.Normal;for(let i=0;i<e.length;i++){const t=e.charAt(i);switch(s){case Z.Normal:t===a?s=Z.Escaped:E.includes(t)?r+="\\"+t:r+="%"===t?".*":"_"===t?".":t;break;case Z.Escaped:E.includes(t)?r+="\\"+t:r+=t,s=Z.Normal}}return new RegExp("^"+r+"$","m")}function j(e,t,a){if(null==e)return null;return V(t,a).test(e)}function q(e){return e&&"object"==typeof e.attributes}function L(e,t,a,r){const s=r.getAttribute(e,t),n=a?.get(t);return null==s||"esriFieldTypeDate"!==n?.type&&"date"!==n?.type?null==s||"esriFieldTypeDateOnly"!==n?.type&&"date-only"!==n?.type?null==s||"esriFieldTypeTimeOnly"!==n?.type&&"time-only"!==n?.type?null==s||"esriFieldTypeTimestampOffset"!==n?.type&&"timestamp-offset"!==n?.type?s:new g(s):y.fromReader(s):i.fromReader(s):m(new Date(s),a.getTimeZone(n.name)??"UTC")}!function(e){e[e.Normal=0]="Normal",e[e.Escaped=1]="Escaped"}(Z||(Z={}));const C={getAttribute:(e,t)=>(q(e)?e.attributes:e)[t]};export{I as WhereClause,C as defaultAttributeAdapter};
|
package/kernel.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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.28";let t,i=r;i="4.28.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";import{buildDate as s,commitHash as e}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const r="4.28";let t,i=r;i="4.28.6";function n(o){t=o}function m(s){const e=t?.findCredential(s);return e?.token?o(s,"token",e.token):s}has("host-webworker");export{m as addTokenParameter,s as buildDate,i as fullVersion,t as id,e as revision,n as setId,r as version};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{difference as e,isSome as a}from"../../core/arrayUtils.js";import r from"../../core/Error.js";import{updateOrigins as t}from"../../core/accessorSupport/originUtils.js";import
|
|
5
|
+
import{difference as e,isSome as a}from"../../core/arrayUtils.js";import r from"../../core/Error.js";import{updateOrigins as t}from"../../core/accessorSupport/originUtils.js";import{save as o,getLayerJSON as s,setCommonItemProperties as n,saveAs as l,getPortalItem as i,addItem as c,ensureLayerConfig as u,ensureItemConfig as p,createErrorMessage as y}from"./utils.js";import{parse as m}from"../support/arcgisLayerUrl.js";import{fetchFeatureService as f}from"../support/fetchService.js";import{isLayerWithFeatureLayerSource as d}from"../support/layerUtils.js";import{layerLookupMap as h}from"../support/lazyLayerLoader.js";import{createForItemWrite as w}from"../../portal/support/jsonContext.js";import{getWGS84ExtentForItem as v,removeTypeKeyword as I,TypeKeyword as T,toggleTypeKeword as S,addTypeKeyword as b}from"../../portal/support/portalItemUtils.js";const L="Feature Service",P="feature-layer-utils",E=`${P}-save`,$=`${P}-save-as`,A=`${P}-saveall`,N=`${P}-saveall-as`;function g(e){return{isValid:d(e)&&("feature"!==e.type||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function x(e){const a=[],r=[];for(const{layer:t,layerJSON:o}of e)t.isTable?r.push(o):a.push(o);return{layers:a,tables:r}}function j(e){return x([e])}async function O(e,a){return/\/\d+\/?$/.test(e.url)?j(a[0]):U(a,e)}async function U(e,a){if(!a)return e.reverse(),x(e);const{layer:{url:r,customParameters:t,apiKey:o}}=e[0];let s=await a.fetchData("json");null!=s?.layers&&null!=s?.tables||(s=await F(s,{url:r??"",customParameters:t,apiKey:o},e.map((e=>e.layer.layerId))));for(const n of e)K(n.layer,n.layerJSON,s);return s}async function F(e,a,r){e||={},e.layers||=[],e.tables||=[];const{url:t,customParameters:o,apiKey:s}=a,{serviceJSON:n,layersJSON:l}=await f(t,{customParameters:o,apiKey:s}),i=J(e.layers,n.layers,r),c=J(e.tables,n.tables,r);e.layers=i.itemResources,e.tables=c.itemResources;const u=[...i.added,...c.added],p=l?[...l.layers,...l.tables]:[];return await M(e,u,t,p),e}function J(a,r,t){const o=e(a,r,((e,a)=>e.id===a.id));a=a.filter((e=>!o.removed.some((a=>a.id===e.id))));const s=o.added;return s.forEach((({id:e})=>{a.push({id:e})})),{itemResources:a,added:s.filter((({id:e})=>!t.includes(e)))}}async function M(e,a,r,t){const o=await R(a),s=a.map((({id:e,type:a})=>new(o.get(a))({url:r,layerId:e,sourceJSON:t.find((({id:a})=>a===e))})));await Promise.allSettled(s.map((e=>e.load()))),s.forEach((a=>{const{layerId:r,loaded:t,defaultPopupTemplate:o}=a;if(!t||null==o)return;const s={id:r,popupInfo:o.toJSON()};"ArcGISFeatureLayer"!==a.operationalLayerType&&(s.layerType=a.operationalLayerType),K(a,s,e)}))}async function R(e){const a=[];e.forEach((({type:e})=>{const r=D(e),t=h[r];a.push(t())}));const r=await Promise.all(a),t=new Map;return e.forEach((({type:e},a)=>{t.set(e,r[a])})),t}function D(e){let a;switch(e){case"Feature Layer":case"Table":a="FeatureLayer";break;case"Oriented Imagery Layer":a="OrientedImageryLayer"}return a}function K(e,a,r){e.isTable?Y(r.tables,a):Y(r.layers,a)}function Y(e,a){const r=e.findIndex((({id:e})=>e===a.id));-1===r?e.push(a):e[r]=a}function _(e,a){if(!e.length)throw new r(`${a}:missing-parameters`,"'layers' array should contain at least one feature layer")}function z(e,a){const t=e.map((e=>e.portalItem.id));if(new Set(t).size>1)throw new r(`${a}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function G(e,a){const t=e.map((e=>e.layerId));if(new Set(t).size!==t.length)throw new r(`${a}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function B(e){_(e,A),await Promise.all(e.map((e=>e.load())));for(const a of e)u(a,A,g),p({layer:a,itemType:L,errorNamePrefix:A});z(e,A),G(e,A)}async function k(e,a){const{url:r,layerId:t,title:o,fullExtent:s,isTable:n}=e,l=m(r);a.url="FeatureServer"===l?.serverType?r:`${r}/${t}`,a.title||=o,a.extent=null,n||null==s||(a.extent=await v(s)),I(a,T.METADATA),I(a,T.MULTI_LAYER),b(a,T.SINGLE_LAYER),n&&b(a,T.TABLE)}function C(e,a){for(const n of e){const t=n.parsedUrl.path,o=m(t),s=o?.url.path;if(!s)throw new r(`${a}:invalid-parameters`,y(n,`has unsupported url pattern: ${t}`),{layer:n});const l=o?.serverType;if("FeatureServer"!==l&&"MapServer"!==l)throw new r(`${a}:invalid-parameters`,y(n,`has unsupported server type: ${l}`),{layer:n});if("MapServer"===l&&e.length>1)throw new r(`${a}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const t=m(e[0].parsedUrl.path),o=t?.url.path,s=e.every((e=>{const a=m(e.parsedUrl.path);return a?.url.path===o}));if(!s)throw new r(`${a}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")}async function V(e){_(e,N),await Promise.all(e.map((e=>e.load())));for(const a of e)u(a,N,g);C(e,N),G(e,N)}async function q(e,r){let t=0,o=0;for(const{isTable:a}of r)a?o++:t++;const s=r[0].parsedUrl.path,l=m(s);if(e.url="FeatureServer"===l?.serverType?l.url.path:s,e.title||=l.title,e.extent=null,t>0){const t=r.map((e=>e.fullExtent)).filter(a).reduce(((e,a)=>e.clone().union(a)));t&&(e.extent=await v(t))}I(e,T.METADATA),S(e,T.MULTI_LAYER,r.length>1),S(e,T.SINGLE_LAYER,1===r.length),S(e,T.TABLE,o>0&&0===t),n(e)}async function H(e,a){return o({layer:e,itemType:L,validateLayer:g,createItemData:(e,a)=>O(a,[e]),errorNamePrefix:E},a)}async function Q(e,a){await B(e);const r=e[0].portalItem,o=w(r),l=await Promise.all(e.map((e=>s(e,o,a)))),i=await O(r,e.map(((e,a)=>({layer:e,layerJSON:l[a]}))));return n(r),await r.update({data:i}),await Promise.all(e.slice(1).map((e=>e.portalItem.reload()))),t(o),r.clone()}async function W(e,a,r){return l({layer:e,itemType:L,validateLayer:g,createItemData:(e,a)=>Promise.resolve(j(e)),errorNamePrefix:$,newItem:a,setItemProperties:k},r)}async function X(e,a,r){await V(e);const o=i({itemType:L,errorNamePrefix:N,newItem:a}),n=w(o),l=await Promise.all(e.map((e=>s(e,n,r)))),u=await U(e.map(((e,a)=>({layer:e,layerJSON:l[a]}))));await q(o,e),await c(o,u,r);for(const t of e)t.portalItem=o.clone();return t(n),o}export{H as save,Q as saveAll,X as saveAllAs,W as saveAs};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{fetchArcGISServiceJSON as e}from"../../support/requestPresets.js";async function
|
|
5
|
+
import{fetchArcGISServiceJSON as e}from"../../support/requestPresets.js";async function t(t,r){const a=await e(t,r);y(a),n(a);const s={serviceJSON:a};if((a.currentVersion??0)<10.5)return s;const o=await e(t+"/layers",r);return y(o),n(o),s.layersJSON={layers:o.layers,tables:o.tables},s}function r(e){return"Feature Layer"===e.type||"Oriented Imagery Layer"===e.type}function a(e){return"Table"===e.type}function n(e){e.layers=e.layers?.filter(r),e.tables=e.tables?.filter(a)}function s(e){e.type||="Feature Layer"}function o(e){e.type||="Table"}function y(e){e.layers?.forEach(s),e.tables?.forEach(o)}export{t as fetchFeatureService};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import e from"../../request.js";import{clone as t}from"../../core/lang.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{isProtocolRelative as s,isAbsolute as o,join as l,removeTrailingSlash as n,normalize as i,removeFile as u,getAppBaseUrl as a,addQueryParameters as c}from"../../core/urlUtils.js";import{WGS84 as f,WebMercator as p}from"../../geometry/support/spatialReferenceUtils.js";import{geographicToWebMercator as y}from"../../geometry/support/webMercatorUtils.js";import m from"../../views/2d/engine/vectorTiles/style/VectorTileSource.js";async function x(e,t){const r={source:null,sourceBase:null,sourceUrl:null,validatedSource:null,style:null,styleBase:null,styleUrl:null,sourceNameToSource:{},primarySourceName:"",spriteFormat:"png"},[s,o]="string"==typeof e?[e,null]:[null,e.jsonUrl];await S(r,"esri",e,o,t);return{layerDefinition:r.validatedSource,url:s,serviceUrl:r.sourceUrl,style:r.style,styleUrl:r.styleUrl,spriteUrl:r.style.sprite&&d(r.styleBase,r.style.sprite),spriteFormat:r.spriteFormat,glyphsUrl:r.style.glyphs&&d(r.styleBase,r.style.glyphs),sourceNameToSource:r.sourceNameToSource,primarySourceName:r.primarySourceName}}function d(...e){let t;for(const r of e)if(null!=r)if(s(r)){if(t){const e=t.split("://")[0];t=e+":"+r.trim()}}else t=o(r)?r:l(t,r);return t?n(t):void 0}async function S(t,s,o,l,n){let u,a,c;if(r(n),"string"==typeof o){const t=i(o);c=await e(t,{...n,responseType:"json",query:{f:"json",...n?.query}}),c.ssl&&(u&&(u=u.replace(/^http:/i,"https:")),a&&(a=a.replace(/^http:/i,"https:"))),u=t,a=t}else null!=o&&(c={data:o},u=o.jsonUrl||null,a=l);const f=c?.data;if(w(f))return t.styleUrl=u||null,j(t,f,a,n);if(U(f))return t.sourceUrl?g(t,f,a,!1,s,n):(t.sourceUrl=u||null,g(t,f,a,!0,s,n));throw new Error("You must specify the URL or the JSON for a service or for a style.")}function h(e){return"object"==typeof e&&!!e&&"tilejson"in e&&null!=e.tilejson}function w(e){return!!e&&"sources"in e&&!!e.sources}function U(e){return!w(e)}async function j(e,t,r,s){const o=r?u(r):a();e.styleBase=o,e.style=t,t["sprite-format"]&&"webp"===t["sprite-format"].toLowerCase()&&(e.spriteFormat="webp");const l=[];if(t.sources&&t.sources.esri){const r=t.sources.esri;r.url?await S(e,"esri",d(o,r.url),void 0,s):l.push(S(e,"esri",r,o,s))}for(const n of Object.keys(t.sources))"esri"!==n&&"vector"===t.sources[n].type&&(t.sources[n].url?l.push(S(e,n,d(o,t.sources[n].url),void 0,s)):t.sources[n].tiles&&l.push(S(e,n,t.sources[n],o,s)));await Promise.all(l)}async function g(e,t,r,s,o,l){const i=r?n(r)+"/":a(),u=v(t),f=new m(o,c(i,l?.query??{}),u);if(!s&&e.primarySourceName in e.sourceNameToSource){const t=e.sourceNameToSource[e.primarySourceName];if(!t.isCompatibleWith(f))return;null!=f.fullExtent&&(null!=t.fullExtent?t.fullExtent.union(f.fullExtent):t.fullExtent=f.fullExtent.clone()),t.tileInfo&&f.tileInfo&&t.tileInfo.lods.length<f.tileInfo.lods.length&&(t.tileInfo=f.tileInfo)}if(s&&(e.sourceBase=i,e.source=t,e.validatedSource=u,e.primarySourceName=o),e.sourceNameToSource[o]=f,!h(e)&&"defaultStyles"in t&&!e.style){if(null==t.defaultStyles)throw new Error;return"string"==typeof t.defaultStyles?S(e,"",d(i,t.defaultStyles,"root.json"),void 0,l):S(e,"",t.defaultStyles,d(i,"root.json"),l)}}function v(e){if(e.hasOwnProperty("tileInfo"))return e;const r={xmin:-20037507.067161843,ymin:-20037507.067161843,xmax:20037507.067161843,ymax:20037507.067161843,spatialReference:{wkid:102100,latestWkid:3857}};let s=null;if(h(e)){const{bounds:r}=e;if(r){const e=y({x:r[0],y:r[1],spatialReference:t(f)}),o=y({x:r[2],y:r[3],spatialReference:t(f)});s={xmin:e.x,ymin:e.y,xmax:o.x,ymax:o.y,spatialReference:t(p)}}}null===s&&(s=r);const o=512;let l=78271.51696400007,n=295828763.7957775;const i=[],u=e.hasOwnProperty("maxzoom")&&null!=e.maxzoom?+e.maxzoom:22,a=0,c=0;for(let t=0;t<=u;t++)i.push({level:t,scale:n,resolution:l}),l/=2,n/=2;return{capabilities:"TilesOnly",initialExtent:s,fullExtent:r,minScale:a,maxScale:c,tiles:e.tiles,tileInfo:{rows:o,cols:o,dpi:96,format:"pbf",origin:{x:-20037508.342787,y:20037508.342787},lods:i,spatialReference:t(p)}}}export{x as loadMetadata};
|
package/package.json
CHANGED
package/support/revision.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.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const c="
|
|
5
|
+
const c="20231101",e="f93dcf3e52237cc72e8ed2a8df36d88c9bba7ae7";export{c as buildDate,e as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/CircularArray.js";import has from"../../../../../core/has.js";import{createResolver as t}from"../../../../../core/promiseUtils.js";import{FeatureSetReaderJSON as
|
|
5
|
+
import{isSome as e}from"../../../../../core/arrayUtils.js";import s from"../../../../../core/CircularArray.js";import has from"../../../../../core/has.js";import{createResolver as t,throwIfNotAbortError as r,createAbortError as i}from"../../../../../core/promiseUtils.js";import{FeatureSetReaderJSON as o}from"../support/FeatureSetReaderJSON.js";import{UpdateToken as d}from"../support/UpdateToken.js";class a{constructor(e,i){this.requests={done:new Array,stream:new s(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._isDone=!1,this.didSend=!1,this.tile=e,this._version=i,this._resolver=t(),this._resolver.promise.catch((e=>r(e)))}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length&&null==this.edits}get edits(){return this._edits}get done(){return this._resolver.promise}get isDone(){return this._isDone}resolve(){this._isDone=!0,this._resolver.resolve()}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach((s=>s.message.status.unset(e))),this._version=e.version,null!=this._edits&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??d.empty(),e.message.status.version=this._version,has("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&(this.requests.done.forEach((e=>{null!=e.message&&e.message.end&&(e.message.end=!1)})),this._resolver.resolve(),this._isDone=!0),this.requests.done.push(e)}edit(s,t){const r=s.getQuantizationTransform(),i=s.fullSchema(),a=Array.from(s.features()).filter(e),n=[...t,...a.map((e=>e.objectId))];if(this.removeIds(n),this._invalidate(),null==this._edits)return void(this._edits={type:"append",addOrUpdate:o.fromOptimizedFeatures(a,i,r),id:this.tile.id,status:d.empty(),end:!0});this.requests.done.forEach((e=>e.message.end=!1));this._edits.addOrUpdate.append(s.features())}*readers(){for(const{message:e}of this.requests.done)null!=e.addOrUpdate&&(yield e.addOrUpdate);null!=this._edits?.addOrUpdate&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=d.empty();null!=this._edits&&(this._edits.status=d.empty())}removeIds(e){this._invalidate();for(const{message:s}of this.requests.done){const t=s.addOrUpdate;null!=t&&(t.removeIds(e),t.isEmpty&&(has("esri-2d-update-debug")&&console.debug("Removing FeatureSetReader"),s.addOrUpdate=null))}null!=this._edits?.addOrUpdate&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter((e=>e.message.addOrUpdate||e.message.end))}abort(){this._abortController.abort(),this._resolver.reject(i())}}export{a as DataTileSubscription};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../intl.js";import{isSome as e}from"../../core/arrayUtils.js";import{neverReached as t}from"../../core/compilerUtils.js";import{templateHasKey as n,replace as r}from"../../core/string.js";import{DomainValidationError as
|
|
5
|
+
import"../../intl.js";import{isSome as e}from"../../core/arrayUtils.js";import{neverReached as t}from"../../core/compilerUtils.js";import{templateHasKey as n,replace as r}from"../../core/string.js";import{DomainValidationError as o}from"../../layers/support/domainUtils.js";import{isTimeOnlyField as i,NumericRangeValidationError as l,TypeValidationError as a}from"../../layers/support/fieldUtils.js";import{isAnyDateField as s}from"../../smartMapping/support/utils.js";import{getLabelForDateFieldValue as u,getIntlOptionsForField as p}from"../support/dateUtils.js";import{substitute as m}from"../../intl/substitute.js";const d=e=>"field"===e?.type,c=e=>"group"===e?.type,f=e=>"relationship"===e?.type,y=e=>!c(e)&&null!=e.group,b=e=>"field"===e.type,T=e=>"group"===e.type,E=e=>"relationship"===e.type,g=e=>e.reduce(((e,t)=>c(t)?[...e,...t.inputs]:[...e,t]),[]),v=e=>g(e).filter(d),O=e=>g(e).filter(f),j=e=>null!=e&&(x(e,"combo-box")||x(e,"radio-buttons")),x=(e,t)=>null!=e&&e.input?.type===t,V=e=>null!=e&&(x(e,"text-box")||x(e,"text-area")),h=({domain:e,inputType:t="text-box",dataType:n})=>"number"===n&&"text-box"===t&&(!e||"coded-value"!==e.type),U=e=>"items"in e,N={typeFieldName:null,types:[]};function _(t){const{attributes:r,fieldsIndex:o,label:i,timeZone:l}=t;if(!r||"object"!=typeof r)return i;const a=Object.keys(r).filter((e=>n(i,e))),s=a.map((e=>r[e])),u=a.map((e=>o.get(e))).filter(e);return I(i,A({values:s,fields:u,timeZone:l}))}function A(e){const{fields:t,values:n}=e,r=e.timeZone??void 0,o=t.map(((e,t)=>{let o=n[t];if(e.domain&&"coded-value"===e.domain.type){const t=e.domain.codedValues.find((e=>e.code===o));t?.name&&(o=t.name)}return(s(e)||i(e))&&(o=u(e,o,{timeZone:r,...p(e)})),[e.name,o]}));return Object.fromEntries(o)}function I(e,t){return r(r(e,(e=>`{${e.toLowerCase()}}`)),Object.fromEntries(Object.entries(t).map((([e,t])=>[e.toLowerCase(),t]))))}const L=e=>e?"subtype-sublayer"===e.type?{typeFieldName:e.parent?.subtypeField,types:e.parent?.subtypes??[]}:"types"in e&&e.types?{typeFieldName:e.typeIdField,types:e.types.map((({id:e,name:t,domains:n})=>({code:e,name:t,domains:n})))}:N:N,F=(e,t)=>{if(!e)return!0;const{operations:n}=e;switch(t){case"INSERT":return n.supportsAdd;case"UPDATE":case"DELETE":return n.supportsUpdate;default:return!0}};var D;!function(e){e.TOO_SHORT="length-validation-error::too-short"}(D||(D={}));const R={type:"number"},Z={type:"number",intlOptions:{notation:"scientific"}},w={day:"2-digit",month:"2-digit",year:"numeric"},C={hour:"numeric",minute:"numeric",second:"numeric"},S={...w,...C};function G(e){return e>=1e7||e<=-1e7}const H=(e,t,n)=>{const{dataType:r,error:i,minLength:s,value:u,required:p}=e;if(!t||!i)return null;if(p&&null===u)return t.validationErrors.cannotBeNull;if(i===o.VALUE_OUT_OF_RANGE||i===l.OUT_OF_RANGE){const{field:o,range:i}=e,l={type:"date",intlOptions:{..."time-only"===o.type?C:"date-only"===o.type?w:S,timeZone:n??void 0}};return m(t.validationErrors.outsideRange,i,{format:{max:"date"===r?l:null!=i.max&&G(i.max)?Z:R,min:"date"===r?l:null!=i.min&&G(i.min)?Z:R}})}return i===o.INVALID_CODED_VALUE?t.validationErrors.invalidCodedValue:i===a.INVALID_TYPE?t.validationErrors.invalidType:i===D.TOO_SHORT?m(t.validationErrors.tooShort,{min:s}):null},P=e=>{if(!e)return;const t=e.layer,n=t&&"geometryType"in t?t.geometryType:void 0,r=e.geometry?.type;return"polyline"===r||"polyline"===n?"line":r||n||"table"},k=e=>{const t=[];if(e.formTemplate){const{description:r,title:o}=e.formTemplate;e.fields?.forEach((e=>{const i=o&&n(o,e.name),l=r&&n(r,e.name);(i||l)&&t.push(e.name)}))}return t};function q(e){if("formTemplate"in e&&e.formTemplate){return(e.formTemplate.elements?.filter(b)??[]).some((({fieldName:t})=>!e.fieldsIndex.get(t)))}return!1}function B(e,t){return null==e||t.onValue!==e&&t.offValue!==e}function M(e,n){switch(n.objectType){case"any":return!0;case"null":return null==e;case"code":return e===n.codedValue?.code;case"range":return null!=e&&null!=n.minValue&&null!=n.maxValue&&+e>=n.minValue&&+e<=n.maxValue;default:return t(n.objectType),!1}}export{D as LengthValidationError,F as capabilitiesAllowEditType,v as flattenFieldInputs,g as flattenInputs,O as flattenRelationshipInputs,q as formTemplateHasInvalidFields,A as getComputedAttributes,H as getErrorMessageForFieldInput,k as getFieldsInTitleAndDesc,P as getIconForFeature,L as getNormalizedFeatureTypeInfo,b as isFieldElement,x as isFieldElementWithInputType,j as isFieldElementWithShowNoValueOptionInput,V as isFieldElementWithTextInput,d as isFieldInput,T as isGroupElement,c as isGroupInput,y as isInputInGroupInput,h as isNumberFieldInput,E as isRelationshipElement,f as isRelationshipInput,U as isTemplateItemGroup,_ as parseFormTemplateString,I as substituteFieldTemplatesInString,B as valueIsInvalidSwitchValue,M as valueIsValidContingentValue};
|