@arcgis/core 4.29.5 → 4.29.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{863d14c98737482f6788.js → 0700231efdaf7ce06d19.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{2146f7e55911da806aec.js → 2ca0fc695c66640a57dd.js} +1 -1
  4. package/assets/esri/core/workers/chunks/{90b36361651839b1e3f0.js → 326aa2951f7e4da6d6b0.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{1251638c842dcf895ffe.js → 37133cf60bc9039a7407.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{de6d54df7ae32694fd70.js → 534abb4408b15ac778dd.js} +1 -1
  7. package/assets/esri/core/workers/chunks/967812e66fef41febb98.js +1 -0
  8. package/assets/esri/core/workers/chunks/{2621b755fa5403bd8a4c.js → e232f6fca5629ae66dcc.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{0e56ff6978ba8d9cf0c0.js → f74eec62bcf3264e2d90.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{8a9387483b19a5ec5b86.js → fc5ac713872766571e07.js} +1 -1
  11. package/assets/esri/themes/base/widgets/_LayerList.scss +2 -0
  12. package/assets/esri/themes/dark/main.css +1 -1
  13. package/assets/esri/themes/light/main.css +1 -1
  14. package/assets/esri/themes/light/view.css +1 -1
  15. package/core/workers/InvokeHandler.js +1 -1
  16. package/core/workers/RemoteClient.js +1 -1
  17. package/core/workers/utils.js +1 -1
  18. package/interfaces.d.ts +53 -35
  19. package/kernel.js +1 -1
  20. package/networks/UtilityNetwork.js +1 -1
  21. package/package.json +1 -1
  22. package/support/revision.js +1 -1
  23. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  24. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  25. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  26. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/utils.js +1 -1
  27. package/views/2d/layers/features/FeatureContainer.js +1 -1
  28. package/views/2d/layers/features/PipelineConnectionHandlers.js +1 -1
  29. package/views/2d/layers/features/RenderState.js +1 -1
  30. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  31. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  32. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  33. package/views/2d/layers/features/sources/strategies/AFetchLoadStrategy.js +1 -1
  34. package/views/2d/layers/features/sources/strategies/chunks/OverrideChunk.js +1 -1
  35. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  36. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  37. package/widgets/LayerList/support/layerListUtils.js +1 -1
  38. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  39. package/assets/esri/core/workers/chunks/5db9739e00f15613d1ea.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- function t(t,r){return new Proxy({},{get:(e,i,s)=>(...e)=>{let s,o;const a=e[e.length-1];return n(a)&&(s=a.signal,o=a.transferList,e.pop()),t.apply(r?`${r}.${i.toString()}`:i.toString(),e,{transferList:o,signal:s})}})}function n(t){return"object"==typeof t&&!Array.isArray(t)&&null!=t&&("signal"in t||"transferList"in t||0===Object.keys(t).length)}export{t as createInvokeProxy};
5
+ import{ignoreConnectionErrors as t}from"./utils.js";function n(n,e,i){return new Proxy({},{get:(o,s,l)=>(...o)=>{let l,a;const g=o[o.length-1];r(g)&&(l=g.signal,a=g.transferList,o.pop());const c=n.apply(e?`${e}.${s.toString()}`:s.toString(),o,{transferList:a,signal:l});return i?.ignoreConnectionErrors?t(c):c}})}function r(t){return"object"==typeof t&&!Array.isArray(t)&&null!=t&&("signal"in t||"transferList"in t||0===Object.keys(t).length)}export{n as createInvokeProxy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{fullVersion as e}from"../../kernel.js";import s from"../Error.js";import{on as t}from"../events.js";import{makeHandle as o}from"../handleUtils.js";import{removeMaybe as n}from"../maybe.js";import{isAborted as r,createAbortError as i,onAbort as l,isPromiseLike as a,isAbortError as h}from"../promiseUtils.js";import{createInvokeProxy as c}from"./InvokeHandler.js";import{registry as p}from"./registry.js";import{newJobId as _,MessageType as u,receiveMessage as d,toInvokeError as b,postMessage as m}from"./utils.js";import{buildDate as g,commitHash as f}from"../../support/revision.js";const{CLOSE:v,ABORT:M,INVOKE:k,RESPONSE:j,OPEN_PORT:y,ON:I}=u,J=2;class w{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===u.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class O{static connect(e){const s=new MessageChannel;let t;t="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new O(s.port1,{channel:s,client:t});return"object"==typeof t&&"remoteClient"in t&&(t.remoteClient=o),O.clients.set(o,t),s.port2}static loadWorker(e){const s=p[e];return s?s():Promise.resolve(null)}constructor(e,s,t){this._port=e,this._jobQueue=t,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new w((e=>this._onInvokeMessage(e))),this._client=s.client,this._onMessage=this._onMessage.bind(this),this._channel=s.channel,this._schedule=s.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:v}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,s,t){return this.apply(e,[s],t)}apply(e,t,o){const a=o?.signal,h=o?.transferList;if(!this._port)return Promise.reject(new s("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=_();return new Promise(((s,o)=>{if(r(a))return this._processWork(),void o(i());const p=l(a,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),n(e.abortHandle),this._post({type:M,jobId:c}),o(i()))})),_={resolve:s,reject:o,abortHandle:p,debugInfo:e};this._outJobs.set(c,_),this._post({type:k,jobId:c,methodName:e,abortable:null!=a},t,h)}))}createInvokeProxy(e){return c(this,e)}on(e,s){const t=new MessageChannel;function n(e){s(e.data)}return this._port.postMessage({type:u.ON,eventType:e,port:t.port2},[t.port2]),t.port1.addEventListener("message",n),t.port1.start(),o((()=>{t.port1.postMessage({type:u.CLOSE}),t.port1.close(),t.port1.removeEventListener("message",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:y,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=J)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:s,data:t,invokeOptions:o,resolver:n}=e;this.apply(s,t,o).then((e=>n.resolve(e))).catch((e=>n.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{n(e.abortHandle),e.reject(i(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const s=d(e);if(s)switch(s.type){case j:this._onResponseMessage(s);break;case k:this._invokeQueue.push(s);break;case M:this._onAbortMessage(s);break;case v:this._onCloseMessage();break;case y:this._onOpenPortMessage(s);break;case I:this._onOnMessage(s)}}_onAbortMessage(e){const s=this._inJobs,t=e.jobId,o=s.get(t);this._invokeQueue.push(e),o&&(o.controller&&o.controller.abort(),s.delete(t))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&O.clients.get(this)===e&&e.destroy(),O.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:s,jobId:t,data:o=[],abortable:n}=e,r=n?new AbortController:null,i=this._inJobs;let l,c=this._client,p=c[s];try{if(!p&&s&&s.includes(".")){const e=s.split(".");for(let s=0;s<e.length-1;s++)c=c[e[s]],p=c[e[s+1]]}if("function"!=typeof p)throw new TypeError(`${s} is not a function`);o.push({client:this,signal:r?r.signal:null}),l=p.apply(c,o)}catch(_){return void this._post({type:j,jobId:t,error:b(_)})}a(l)?(i.set(t,{controller:r,promise:l}),l.then((e=>{i.has(t)&&(i.delete(t),this._post({type:j,jobId:t},e))}),(e=>{i.has(t)&&(i.delete(t),h(e)||this._post({type:j,jobId:t,error:b(e||{message:`Error encountered at method ${s}`})}))}))):this._post({type:j,jobId:t},l)}_onOpenPortMessage(e){new O(e.port,{client:this._client})}_onOnMessage(e){const{port:s}=e,o=this._client.on(e.eventType,(e=>{s.postMessage(e)})),n=t(e.port,"message",(e=>{const t=d(e);t?.type===u.CLOSE&&(n.remove(),o.remove(),s.close())}))}_onResponseMessage(e){const{jobId:t,error:o,data:r}=e,i=this._outJobs;if(!i.has(t))return;const l=i.get(t);i.delete(t),this._processWork(),n(l.abortHandle),o?l.reject(s.fromJSON(JSON.parse(o))):l.resolve(r)}_post(e,s,t){return m(this._port,e,s,t)}}O.kernelInfo={buildDate:g,fullVersion:e,revision:f},O.clients=new Map;export{O as default};
5
+ import{fullVersion as e}from"../../kernel.js";import s from"../Error.js";import{on as t}from"../events.js";import{makeHandle as o}from"../handleUtils.js";import{removeMaybe as n}from"../maybe.js";import{isAborted as r,createAbortError as i,onAbort as l,isPromiseLike as a,isAbortError as h}from"../promiseUtils.js";import{createInvokeProxy as c}from"./InvokeHandler.js";import{registry as p}from"./registry.js";import{portClosedErrorName as _,newJobId as u,MessageType as d,receiveMessage as b,toInvokeError as m,postMessage as g}from"./utils.js";import{buildDate as f,commitHash as v}from"../../support/revision.js";const{CLOSE:M,ABORT:k,INVOKE:j,RESPONSE:y,OPEN_PORT:I,ON:J}=d,w=2;class O{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===d.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class E{static connect(e){const s=new MessageChannel;let t;t="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new E(s.port1,{channel:s,client:t});return"object"==typeof t&&"remoteClient"in t&&(t.remoteClient=o),E.clients.set(o,t),s.port2}static loadWorker(e){const s=p[e];return s?s():Promise.resolve(null)}constructor(e,s,t){this._port=e,this._jobQueue=t,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new O((e=>this._onInvokeMessage(e))),this._client=s.client,this._onMessage=this._onMessage.bind(this),this._channel=s.channel,this._schedule=s.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:M}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,s,t){return this.apply(e,[s],t)}apply(e,t,o){const a=o?.signal,h=o?.transferList;if(!this._port)return Promise.reject(new s(_,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const c=u();return new Promise(((s,o)=>{if(r(a))return this._processWork(),void o(i());const p=l(a,(()=>{const e=this._outJobs.get(c);e&&(this._outJobs.delete(c),this._processWork(),n(e.abortHandle),this._post({type:k,jobId:c}),o(i()))})),_={resolve:s,reject:o,abortHandle:p,debugInfo:e};this._outJobs.set(c,_),this._post({type:j,jobId:c,methodName:e,abortable:null!=a},t,h)}))}createInvokeProxy(e,s){return c(this,e,s)}on(e,s){const t=new MessageChannel;function n(e){s(e.data)}return this._port.postMessage({type:d.ON,eventType:e,port:t.port2},[t.port2]),t.port1.addEventListener("message",n),t.port1.start(),o((()=>{t.port1.postMessage({type:d.CLOSE}),t.port1.close(),t.port1.removeEventListener("message",n)}))}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:I,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=w)return;const e=this._jobQueue?.pop();if(!e)return;const{methodName:s,data:t,invokeOptions:o,resolver:n}=e;this.apply(s,t,o).then((e=>n.resolve(e))).catch((e=>n.reject(e)))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{n(e.abortHandle),e.reject(i(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){null!=this._schedule?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const s=b(e);if(s)switch(s.type){case y:this._onResponseMessage(s);break;case j:this._invokeQueue.push(s);break;case k:this._onAbortMessage(s);break;case M:this._onCloseMessage();break;case I:this._onOpenPortMessage(s);break;case J:this._onOnMessage(s)}}_onAbortMessage(e){const s=this._inJobs,t=e.jobId,o=s.get(t);this._invokeQueue.push(e),o&&(o.controller&&o.controller.abort(),s.delete(t))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&E.clients.get(this)===e&&e.destroy(),E.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:s,jobId:t,data:o=[],abortable:n}=e,r=n?new AbortController:null,i=this._inJobs;let l,c=this._client,p=c[s];try{if(!p&&s&&s.includes(".")){const e=s.split(".");for(let s=0;s<e.length-1;s++)c=c[e[s]],p=c[e[s+1]]}if("function"!=typeof p)throw new TypeError(`${s} is not a function`);o.push({client:this,signal:r?r.signal:null}),l=p.apply(c,o)}catch(_){return void this._post({type:y,jobId:t,error:m(_)})}a(l)?(i.set(t,{controller:r,promise:l}),l.then((e=>{i.has(t)&&(i.delete(t),this._post({type:y,jobId:t},e))}),(e=>{i.has(t)&&(i.delete(t),h(e)||this._post({type:y,jobId:t,error:m(e||{message:`Error encountered at method ${s}`})}))}))):this._post({type:y,jobId:t},l)}_onOpenPortMessage(e){new E(e.port,{client:this._client})}_onOnMessage(e){const{port:s}=e,o=this._client.on(e.eventType,(e=>{s.postMessage(e)})),n=t(e.port,"message",(e=>{const t=b(e);t?.type===d.CLOSE&&(n.remove(),o.remove(),s.close())}))}_onResponseMessage(e){const{jobId:t,error:o,data:r}=e,i=this._outJobs;if(!i.has(t))return;const l=i.get(t);i.delete(t),this._processWork(),n(l.abortHandle),o?l.reject(s.fromJSON(JSON.parse(o))):l.resolve(r)}_post(e,s,t){return g(this._port,e,s,t)}}E.kernelInfo={buildDate:f,fullVersion:e,revision:v},E.clients=new Map;export{E as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"../has.js";var t;!function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"}(t||(t={}));let e=0;function r(){return e++}function n(t){return t&&"object"==typeof t&&("result"in t||"transferList"in t)}function s(t){return t?"string"==typeof t?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function f(e,r,i,a){if(r.type===t.OPEN_PORT)return void e.postMessage(r,[r.port]);if(r.type!==t.INVOKE&&r.type!==t.RESPONSE)return void e.postMessage(r);let u;if(n(i)?(u=o(i.transferList),r.data=i.result):(u=o(a),r.data=i),u){if(has("ff"))for(const n of u)if("byteLength"in n&&n.byteLength>267386880){const n="Worker call with large ArrayBuffer would crash Firefox";switch(r.type){case t.INVOKE:throw n;case t.RESPONSE:return void f(e,{type:t.RESPONSE,jobId:r.jobId,error:s(n)})}}e.postMessage(r,u)}else e.postMessage(r)}function i(t){if(!t)return null;const e=t.data;return e?"string"==typeof e?JSON.parse(e):e:null}function o(t){if(!t?.length)return null;if(has("esri-workers-arraybuffer-transfer"))return t;const e=t.filter((t=>!a(t)));return e.length?e:null}function a(t){return t instanceof ArrayBuffer||"ArrayBuffer"===t?.constructor?.name}export{t as MessageType,n as isTransferrableResult,r as newJobId,f as postMessage,i as receiveMessage,s as toInvokeError};
5
+ import has from"../has.js";import{isAbortError as t}from"../promiseUtils.js";const r="worker:port-closed";var e;!function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"}(e||(e={}));let n=0;function s(){return n++}function o(t){return t&&"object"==typeof t&&("result"in t||"transferList"in t)}function i(t){return t?"string"==typeof t?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function a(t,r,n,s){if(r.type===e.OPEN_PORT)return void t.postMessage(r,[r.port]);if(r.type!==e.INVOKE&&r.type!==e.RESPONSE)return void t.postMessage(r);let f;if(o(n)?(f=u(n.transferList),r.data=n.result):(f=u(s),r.data=n),f){if(has("ff"))for(const n of f)if("byteLength"in n&&n.byteLength>267386880){const n="Worker call with large ArrayBuffer would crash Firefox";switch(r.type){case e.INVOKE:throw n;case e.RESPONSE:return void a(t,{type:e.RESPONSE,jobId:r.jobId,error:i(n)})}}t.postMessage(r,f)}else t.postMessage(r)}function f(t){if(!t)return null;const r=t.data;return r?"string"==typeof r?JSON.parse(r):r:null}function u(t){if(!t?.length)return null;if(has("esri-workers-arraybuffer-transfer"))return t;const r=t.filter((t=>!c(t)));return r.length?r:null}function c(t){return t instanceof ArrayBuffer||"ArrayBuffer"===t?.constructor?.name}async function O(e){try{return await e}catch(n){const e=n?.name===r;if(!(t(n)||e))throw n;return}}export{e as MessageType,O as ignoreConnectionErrors,o as isTransferrableResult,s as newJobId,r as portClosedErrorName,a as postMessage,f as receiveMessage,i as toInvokeError};
package/interfaces.d.ts CHANGED
@@ -11350,6 +11350,12 @@ declare namespace __esri {
11350
11350
  }
11351
11351
 
11352
11352
  export class FeatureLayer {
11353
+ /**
11354
+ * Array of Chart Items of type WebMapWebChart available on the feature layer.
11355
+ *
11356
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#charts)
11357
+ */
11358
+ charts: any[];
11353
11359
  /**
11354
11360
  * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace.
11355
11361
  *
@@ -11554,6 +11560,12 @@ declare namespace __esri {
11554
11560
  }
11555
11561
 
11556
11562
  interface FeatureLayerProperties extends LayerProperties, OrderedLayerProperties, PortalLayerProperties, ScaleRangeLayerProperties, TemporalLayerProperties, BlendLayerProperties, CustomParametersMixinProperties, APIKeyMixinProperties, FeatureEffectLayerProperties, FeatureReductionLayerProperties, PublishableLayerProperties, OperationalLayerProperties, FeatureLayerBaseProperties {
11563
+ /**
11564
+ * Array of Chart Items of type WebMapWebChart available on the feature layer.
11565
+ *
11566
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#charts)
11567
+ */
11568
+ charts?: any[];
11557
11569
  /**
11558
11570
  * An object that allows you to create a dynamic layer with data either from map service sublayers or data from a registered workspace.
11559
11571
  *
@@ -112094,12 +112106,12 @@ declare namespace __esri {
112094
112106
  }
112095
112107
 
112096
112108
  export interface SketchUpdateEvent {
112097
- __4: "update";
112098
112109
  aborted: boolean;
112099
112110
  graphics: Graphic[];
112100
112111
  state: "start" | "active" | "complete";
112101
112112
  tool: "move" | "transform" | "reshape";
112102
112113
  toolEventInfo: UpdateToolEventInfo;
112114
+ type: "update";
112103
112115
  }
112104
112116
 
112105
112117
  /**
@@ -119200,9 +119212,9 @@ declare namespace __esri {
119200
119212
  /**
119201
119213
  * Map of Service URLs and user type extensions.
119202
119214
  *
119203
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#advancedEditingUserTypeExtensionForUrl)
119215
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#advancedEditingUserTypeExtensionLookup)
119204
119216
  */
119205
- readonly advancedEditingUserTypeExtensionForUrl: globalThis.Map<string, boolean>;
119217
+ readonly advancedEditingUserTypeExtensionLookup: globalThis.Map<string, boolean>;
119206
119218
  /**
119207
119219
  * Displays execution errors.
119208
119220
  *
@@ -119212,15 +119224,9 @@ declare namespace __esri {
119212
119224
  /**
119213
119225
  * A key-value pair of [FeatureServiceResourcesBundle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#FeatureServiceResourcesBundle).
119214
119226
  *
119215
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServices)
119227
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServiceLookup)
119216
119228
  */
119217
- featureServices: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119218
- /**
119219
- * Collection of [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with versioning enabled that belong to the [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
119220
- *
119221
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#layers)
119222
- */
119223
- layers: Collection<Layer>;
119229
+ featureServiceLookup: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119224
119230
  /**
119225
119231
  * Displays an error if loading fails.
119226
119232
  *
@@ -119230,15 +119236,15 @@ declare namespace __esri {
119230
119236
  /**
119231
119237
  * Map of Service URLs and enterprise versions.
119232
119238
  *
119233
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serverVersionForUrl)
119239
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serverVersionLookup)
119234
119240
  */
119235
- readonly serverVersionForUrl: globalThis.Map<string, number>;
119241
+ readonly serverVersionLookup: globalThis.Map<string, number>;
119236
119242
  /**
119237
119243
  * Map of Service URLs and service names.
119238
119244
  *
119239
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNames)
119245
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNameLookup)
119240
119246
  */
119241
- serviceNames: globalThis.Map<string, string>;
119247
+ serviceNameLookup: globalThis.Map<string, string>;
119242
119248
  /**
119243
119249
  * The viewModel's state.
119244
119250
  *
@@ -119248,21 +119254,33 @@ declare namespace __esri {
119248
119254
  /**
119249
119255
  * Map of Service URLs and logged in users.
119250
119256
  *
119251
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#userForUrl)
119257
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#userLookup)
119258
+ */
119259
+ readonly userLookup: globalThis.Map<string, string>;
119260
+ /**
119261
+ * A Map of current version identifiers keyed on the map service url.
119262
+ *
119263
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionIdentifierLookup)
119252
119264
  */
119253
- readonly userForUrl: globalThis.Map<string, string>;
119265
+ readonly versionIdentifierLookup: globalThis.Map<string, VersionIdentifier>;
119254
119266
  /**
119255
119267
  * Contains information about the versions in the versionmanagementservice such as name, guid, etc
119256
119268
  *
119257
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfos)
119269
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfoLookup)
119258
119270
  */
119259
- versionInfos: globalThis.Map<string, VersionInfo[]>;
119271
+ versionInfoLookup: globalThis.Map<string, VersionInfo[]>;
119260
119272
  /**
119261
119273
  * This class contains metadata about the version management service.
119262
119274
  *
119263
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServices)
119275
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServiceLookup)
119264
119276
  */
119265
- versionManagementServices: globalThis.Map<string, VersionManagementService>;
119277
+ versionManagementServiceLookup: globalThis.Map<string, VersionManagementService>;
119278
+ /**
119279
+ * The view from which the widget will operate.
119280
+ *
119281
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#view)
119282
+ */
119283
+ view: MapView;
119266
119284
  /**
119267
119285
  * This class allows you to manage versions from a variety of [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
119268
119286
  *
@@ -119305,33 +119323,33 @@ declare namespace __esri {
119305
119323
  /**
119306
119324
  * A key-value pair of [FeatureServiceResourcesBundle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#FeatureServiceResourcesBundle).
119307
119325
  *
119308
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServices)
119326
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#featureServiceLookup)
119309
119327
  */
119310
- featureServices?: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119311
- /**
119312
- * Collection of [layers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) with versioning enabled that belong to the [feature services](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
119313
- *
119314
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#layers)
119315
- */
119316
- layers?: CollectionProperties<LayerProperties>;
119328
+ featureServiceLookup?: globalThis.Map<string, VersionManagementViewModelFeatureServiceResourcesBundle>;
119317
119329
  /**
119318
119330
  * Map of Service URLs and service names.
119319
119331
  *
119320
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNames)
119332
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#serviceNameLookup)
119321
119333
  */
119322
- serviceNames?: globalThis.Map<string, string>;
119334
+ serviceNameLookup?: globalThis.Map<string, string>;
119323
119335
  /**
119324
119336
  * Contains information about the versions in the versionmanagementservice such as name, guid, etc
119325
119337
  *
119326
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfos)
119338
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionInfoLookup)
119327
119339
  */
119328
- versionInfos?: globalThis.Map<string, VersionInfo[]>;
119340
+ versionInfoLookup?: globalThis.Map<string, VersionInfo[]>;
119329
119341
  /**
119330
119342
  * This class contains metadata about the version management service.
119331
119343
  *
119332
- * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServices)
119344
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#versionManagementServiceLookup)
119345
+ */
119346
+ versionManagementServiceLookup?: globalThis.Map<string, VersionManagementService>;
119347
+ /**
119348
+ * The view from which the widget will operate.
119349
+ *
119350
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-VersionManagement-VersionManagementViewModel.html#view)
119333
119351
  */
119334
- versionManagementServices?: globalThis.Map<string, VersionManagementService>;
119352
+ view?: MapViewProperties;
119335
119353
  }
119336
119354
 
119337
119355
  /**
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.29/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.29";let t,i=r;i="4.29.5";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};
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.29";let t,i=r;i="4.29.7";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.29/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import s from"../layers/FeatureLayer.js";import{queryAllJSON as a}from"../layers/support/featureQueryAll.js";import i from"./Network.js";import n from"./RulesTable.js";import l from"./support/NamedTraceConfiguration.js";import u from"./support/NetworkSystemLayers.js";import m from"./support/TerminalConfiguration.js";import d from"./support/TraceJobInfo.js";import{AssociationTypeEnum as c,RuleType as p}from"./support/typeUtils.js";import y from"../rest/support/Query.js";let f=class extends i{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility"}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new u({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map((e=>m.fromJSON(e)))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map((e=>e.domainNetworkName))||[]}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map((t=>{t.edgeSources.map((t=>{e.add(t.layerId)})),t.junctionSources.map((t=>{e.add(t.layerId)}))})),e}async load(e){return this.addResolvingPromise(super.load(e)),this.addResolvingPromise(this._loadNamedTraceConfigurationsFromNetwork(e)),this}getTerminalConfiguration(e){let t=null,r=null;const o=e.layer;let s=null;if("feature"===o?.type){if(s=o.layerId,null===s)return null}else{if("subtype-sublayer"!==o?.type)return null;if(s=o?.parent?.layerId??null,null===s)return null}const a=e.attributes;if(null==a)return null;for(const l of Object.keys(a))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let i=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find((e=>e.layerId===s));if(e){const o=e.assetGroups?.find((e=>e.assetGroupCode===t));if(o){const e=o.assetTypes?.find((e=>e.assetTypeCode===r));if(e){i=e.terminalConfigurationId;break}}}}if(null!=i){const e=this.dataElement.terminalConfigurations,t=e?.find((e=>e.terminalConfigurationId===i));return t?m.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find((t=>t.domainNetworkName===e));return t?.tiers.map((e=>e.name))||[]}async getRulesTable(){return this._sharedRulesTable||(this._sharedRulesTable=this._createRulesTable()),await this._sharedRulesTable}isUtilityLayer(e){return this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1)}async queryAssociations(e){const[{queryAssociations:t},{default:r}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=r.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await t(this.networkServiceUrl,o)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),o=r.from(e);return o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment,t(this.networkServiceUrl,o)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),o=r.from(e);return o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment,t(this.networkServiceUrl,o)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),o=r.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;const s=await t(this.networkServiceUrl,o);return new d({statusUrl:s})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;await t.load();const r=(e,t)=>e?1===e.terminalId?!t?.terminalId||t?.terminalId===e.terminalId:e.terminalId===t?.terminalId:!t?.terminalId,o=(e,t)=>e.fromNetworkSource?.sourceId===t.fromNetworkElement?.networkSourceId&&e.toNetworkSource?.sourceId===t.toNetworkElement?.networkSourceId&&e.fromAssetGroup?.assetGroupCode===t.fromNetworkElement?.assetGroupCode&&e.fromAssetType?.assetTypeCode===t.fromNetworkElement?.assetTypeCode&&e.toAssetGroup?.assetGroupCode===t.toNetworkElement?.assetGroupCode&&e.toAssetType?.assetTypeCode===t.toNetworkElement?.assetTypeCode&&r(e.fromTerminal,t.fromNetworkElement)&&r(e.toTerminal,t.toNetworkElement);if("containment"===e.associationType){return t.rulesCategorized.containment.some((t=>o(t,e)))}if("attachment"===e.associationType){return t.rulesCategorized.attachment.some((t=>o(t,e)))}return t.rulesCategorized.connectivity.some((t=>t.viaNetworkSource?t.fromNetworkSource?.sourceId===e.fromNetworkElement?.networkSourceId&&t.viaNetworkSource?.sourceId===e.toNetworkElement?.networkSourceId&&t.fromAssetGroup?.assetGroupCode===e.fromNetworkElement?.assetGroupCode&&t.fromAssetType?.assetTypeCode===e.fromNetworkElement?.assetTypeCode&&t.viaAssetGroup?.assetGroupCode===e.toNetworkElement?.assetGroupCode&&t.viaAssetType?.assetTypeCode===e.toNetworkElement?.assetTypeCode&&r(t.fromTerminal,e.fromNetworkElement)&&r(t.viaTerminal,e.toNetworkElement)||t.viaNetworkSource?.sourceId===e.fromNetworkElement?.networkSourceId&&t.toNetworkSource?.sourceId===e.toNetworkElement?.networkSourceId&&t.viaAssetGroup?.assetGroupCode===e.fromNetworkElement?.assetGroupCode&&t.viaAssetType?.assetTypeCode===e.fromNetworkElement?.assetTypeCode&&t.toAssetGroup?.assetGroupCode===e.toNetworkElement?.assetGroupCode&&t.toAssetType?.assetTypeCode===e.toNetworkElement?.assetTypeCode&&r(t.viaTerminal,e.fromNetworkElement)&&r(t.toTerminal,e.toNetworkElement):o(t,e)))}async generateAddAssociations(e){return{addFeatures:await Promise.all(e.map((e=>new t({attributes:{fromnetworksourceid:e.fromNetworkElement?.networkSourceId,fromglobalid:e.fromNetworkElement?.globalId,fromterminalid:e.fromNetworkElement?.terminalId,tonetworksourceid:e.toNetworkElement?.networkSourceId,toglobalid:e.toNetworkElement?.globalId,toterminalid:e.toNetworkElement?.terminalId,associationtype:c[e.associationType],iscontentvisible:e.isContentVisible?1:0,percentalong:e.percentAlong,globalid:e.globalId}})))),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:"globalid",objectIdField:"objectid"}}}generateDeleteAssociations(e){return{deleteFeatures:e.map((e=>({globalId:e.globalId}))),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:"globalid",objectIdField:"objectid"}}}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map((e=>e.globalId)),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const o of this.sharedNamedTraceConfigurations){const e=r?.find((e=>e.globalId===o.globalId));if(e){const t=e.write({},{origin:"service"});o.read(t,{origin:"service"})}}}async _createRulesTable(){const e=this.networkSystemLayers.rulesTableUrl,t=new s({url:e});await t.load();const r=this.dataElement?.domainNetworks;if(!r)return null;const o=r.flatMap((e=>[...e.edgeSources||[],...e.junctionSources||[]])),a=(await this._queryRulesTable(t)).map((e=>this._hydrateRuleInfo(t,o,e)));return new n({layer:t,rules:a})}async _queryRulesTable(e){const t=new y({where:"1=1",outFields:["*"]});return(await a(e,t)).features}_hydrateRuleInfo(e,t,r){const o=e.fieldsIndex,s=o.get("RULETYPE"),a=o.get("CREATIONDATE"),i=o.get("FROMNETWORKSOURCEID"),n=o.get("FROMASSETGROUP"),l=o.get("FROMASSETTYPE"),u=o.get("FROMTERMINALID"),m=o.get("TONETWORKSOURCEID"),d=o.get("TOASSETGROUP"),c=o.get("TOASSETTYPE"),y=o.get("TOTERMINALID"),f=o.get("VIANETWORKSOURCEID"),w=o.get("VIAASSETGROUP"),T=o.get("VIAASSETTYPE"),I=o.get("VIATERMINALID"),g=r.attributes[s.name],k=new Date(r.attributes[a.name]),b=[{networkSourceId:r.attributes[i.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[m.name],assetGroupId:r.attributes[d.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[f.name],assetGroupId:r.attributes[w.name],assetTypeId:r.attributes[T.name],terminalId:r.attributes[I.name]}];let h;!function(e){e[e.from=0]="from",e[e.to=1]="to",e[e.via=2]="via"}(h||(h={}));const N={ruleType:g,creationDate:k};for(const S of[h.from,h.to,h.via]){if(g!==p.RTEdgeJunctionEdgeConnectivity&&S===h.via)continue;const e=b[S],r=t.find((t=>t.sourceId===e.networkSourceId)),o=r?.assetGroups.find((t=>t.assetGroupCode===e.assetGroupId)),s=o?.assetTypes.find((t=>t.assetTypeCode===e.assetTypeId)),a=this._getTerminal(s,e);let i="";switch(S){case h.from:i="from";break;case h.to:i="to";break;case h.via:i="via"}N[`${i}NetworkSource`]=r,N[`${i}AssetGroup`]=o,N[`${i}AssetType`]=s,N[`${i}Terminal`]=a?.toJSON()}return N}_getTerminal(e,t){const r=e?.terminalConfigurationId,o=this.terminalConfigurations?.find((e=>e.id===r));return o?.terminals?.find((e=>e.id===t.terminalId))??null}};e([r({type:[l],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],f.prototype,"sharedNamedTraceConfigurations",void 0),e([r({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],f.prototype,"type",void 0),e([r({readOnly:!0})],f.prototype,"serviceTerritoryFeatureLayerId",null),e([r({readOnly:!0})],f.prototype,"networkSystemLayers",null),e([r({readOnly:!0})],f.prototype,"terminalConfigurations",null),e([r({readOnly:!0})],f.prototype,"domainNetworkNames",null),f=e([o("esri.networks.UtilityNetwork")],f);const w=f;export{w as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import s from"../layers/FeatureLayer.js";import{queryAllJSON as a}from"../layers/support/featureQueryAll.js";import i from"./Network.js";import n from"./RulesTable.js";import l from"./support/NamedTraceConfiguration.js";import u from"./support/NetworkSystemLayers.js";import m from"./support/TerminalConfiguration.js";import d from"./support/TraceJobInfo.js";import{AssociationTypeEnum as c,RuleType as p}from"./support/typeUtils.js";import y from"../rest/support/Query.js";let f=class extends i{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility"}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new u({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map((e=>m.fromJSON(e)))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map((e=>e.domainNetworkName))||[]}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map((t=>{t.edgeSources.map((t=>{e.add(t.layerId)})),t.junctionSources.map((t=>{e.add(t.layerId)}))})),e}async load(e){return this.addResolvingPromise(super.load(e)),this.addResolvingPromise(this._loadNamedTraceConfigurationsFromNetwork(e)),this}getTerminalConfiguration(e){let t=null,r=null;const o=e.layer;let s=null;if("feature"===o?.type){if(s=o.layerId,null===s)return null}else{if("subtype-sublayer"!==o?.type)return null;if(s=o?.parent?.layerId??null,null===s)return null}const a=e.attributes;if(null==a)return null;for(const l of Object.keys(a))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let i=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find((e=>e.layerId===s));if(e){const o=e.assetGroups?.find((e=>e.assetGroupCode===t));if(o){const e=o.assetTypes?.find((e=>e.assetTypeCode===r));if(e){i=e.terminalConfigurationId;break}}}}if(null!=i){const e=this.dataElement.terminalConfigurations,t=e?.find((e=>e.terminalConfigurationId===i));return t?m.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find((t=>t.domainNetworkName===e));return t?.tiers.map((e=>e.name))||[]}async getRulesTable(){return this._sharedRulesTable||(this._sharedRulesTable=this._createRulesTable()),await this._sharedRulesTable}isUtilityLayer(e){return this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1)}async queryAssociations(e){const[{queryAssociations:t},{default:r}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=r.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await t(this.networkServiceUrl,o)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),o=r.from(e);return o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment,t(this.networkServiceUrl,o)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),o=r.from(e);return o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment,t(this.networkServiceUrl,o)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),o=r.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;const s=await t(this.networkServiceUrl,o);return new d({statusUrl:s})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;await t.load();const r=(e,t)=>e?1===e.terminalId?!t?.terminalId||t?.terminalId===e.terminalId:e.terminalId===t?.terminalId:!t?.terminalId,o=(e,t)=>e.fromNetworkSource?.sourceId===t.fromNetworkElement?.networkSourceId&&e.toNetworkSource?.sourceId===t.toNetworkElement?.networkSourceId&&e.fromAssetGroup?.assetGroupCode===t.fromNetworkElement?.assetGroupCode&&e.fromAssetType?.assetTypeCode===t.fromNetworkElement?.assetTypeCode&&e.toAssetGroup?.assetGroupCode===t.toNetworkElement?.assetGroupCode&&e.toAssetType?.assetTypeCode===t.toNetworkElement?.assetTypeCode&&r(e.fromTerminal,t.fromNetworkElement)&&r(e.toTerminal,t.toNetworkElement);if("containment"===e.associationType){return t.rulesCategorized.containment.some((t=>o(t,e)))}if("attachment"===e.associationType){return t.rulesCategorized.attachment.some((t=>o(t,e)))}return t.rulesCategorized.connectivity.some((t=>t.viaNetworkSource?t.fromNetworkSource?.sourceId===e.fromNetworkElement?.networkSourceId&&t.viaNetworkSource?.sourceId===e.toNetworkElement?.networkSourceId&&t.fromAssetGroup?.assetGroupCode===e.fromNetworkElement?.assetGroupCode&&t.fromAssetType?.assetTypeCode===e.fromNetworkElement?.assetTypeCode&&t.viaAssetGroup?.assetGroupCode===e.toNetworkElement?.assetGroupCode&&t.viaAssetType?.assetTypeCode===e.toNetworkElement?.assetTypeCode&&r(t.fromTerminal,e.fromNetworkElement)&&r(t.viaTerminal,e.toNetworkElement)||t.viaNetworkSource?.sourceId===e.fromNetworkElement?.networkSourceId&&t.toNetworkSource?.sourceId===e.toNetworkElement?.networkSourceId&&t.viaAssetGroup?.assetGroupCode===e.fromNetworkElement?.assetGroupCode&&t.viaAssetType?.assetTypeCode===e.fromNetworkElement?.assetTypeCode&&t.toAssetGroup?.assetGroupCode===e.toNetworkElement?.assetGroupCode&&t.toAssetType?.assetTypeCode===e.toNetworkElement?.assetTypeCode&&r(t.viaTerminal,e.fromNetworkElement)&&r(t.toTerminal,e.toNetworkElement):o(t,e)))}generateAddAssociations(e){return{addFeatures:e.map((e=>new t({attributes:{fromnetworksourceid:e.fromNetworkElement?.networkSourceId,fromglobalid:e.fromNetworkElement?.globalId,fromterminalid:e.fromNetworkElement?.terminalId,tonetworksourceid:e.toNetworkElement?.networkSourceId,toglobalid:e.toNetworkElement?.globalId,toterminalid:e.toNetworkElement?.terminalId,associationtype:c[e.associationType],iscontentvisible:e.isContentVisible?1:0,percentalong:e.percentAlong,globalid:e.globalId}}))),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:"globalid",objectIdField:"objectid"}}}generateDeleteAssociations(e){return{deleteFeatures:e.map((e=>({globalId:e.globalId}))),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:"globalid",objectIdField:"objectid"}}}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map((e=>e.globalId)),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const o of this.sharedNamedTraceConfigurations){const e=r?.find((e=>e.globalId===o.globalId));if(e){const t=e.write({},{origin:"service"});o.read(t,{origin:"service"})}}}async _createRulesTable(){const e=this.networkSystemLayers.rulesTableUrl,t=new s({url:e});await t.load();const r=this.dataElement?.domainNetworks;if(!r)return null;const o=r.flatMap((e=>[...e.edgeSources||[],...e.junctionSources||[]])),a=(await this._queryRulesTable(t)).map((e=>this._hydrateRuleInfo(t,o,e)));return new n({layer:t,rules:a})}async _queryRulesTable(e){const t=new y({where:"1=1",outFields:["*"]});return(await a(e,t)).features}_hydrateRuleInfo(e,t,r){const o=e.fieldsIndex,s=o.get("RULETYPE"),a=o.get("CREATIONDATE"),i=o.get("FROMNETWORKSOURCEID"),n=o.get("FROMASSETGROUP"),l=o.get("FROMASSETTYPE"),u=o.get("FROMTERMINALID"),m=o.get("TONETWORKSOURCEID"),d=o.get("TOASSETGROUP"),c=o.get("TOASSETTYPE"),y=o.get("TOTERMINALID"),f=o.get("VIANETWORKSOURCEID"),w=o.get("VIAASSETGROUP"),T=o.get("VIAASSETTYPE"),I=o.get("VIATERMINALID"),g=r.attributes[s.name],k=new Date(r.attributes[a.name]),b=[{networkSourceId:r.attributes[i.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[m.name],assetGroupId:r.attributes[d.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[f.name],assetGroupId:r.attributes[w.name],assetTypeId:r.attributes[T.name],terminalId:r.attributes[I.name]}];let h;!function(e){e[e.from=0]="from",e[e.to=1]="to",e[e.via=2]="via"}(h||(h={}));const N={ruleType:g,creationDate:k};for(const S of[h.from,h.to,h.via]){if(g!==p.RTEdgeJunctionEdgeConnectivity&&S===h.via)continue;const e=b[S],r=t.find((t=>t.sourceId===e.networkSourceId)),o=r?.assetGroups.find((t=>t.assetGroupCode===e.assetGroupId)),s=o?.assetTypes.find((t=>t.assetTypeCode===e.assetTypeId)),a=this._getTerminal(s,e);let i="";switch(S){case h.from:i="from";break;case h.to:i="to";break;case h.via:i="via"}N[`${i}NetworkSource`]=r,N[`${i}AssetGroup`]=o,N[`${i}AssetType`]=s,N[`${i}Terminal`]=a?.toJSON()}return N}_getTerminal(e,t){const r=e?.terminalConfigurationId,o=this.terminalConfigurations?.find((e=>e.id===r));return o?.terminals?.find((e=>e.id===t.terminalId))??null}};e([r({type:[l],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],f.prototype,"sharedNamedTraceConfigurations",void 0),e([r({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],f.prototype,"type",void 0),e([r({readOnly:!0})],f.prototype,"serviceTerritoryFeatureLayerId",null),e([r({readOnly:!0})],f.prototype,"networkSystemLayers",null),e([r({readOnly:!0})],f.prototype,"terminalConfigurations",null),e([r({readOnly:!0})],f.prototype,"domainNetworkNames",null),f=e([o("esri.networks.UtilityNetwork")],f);const w=f;export{w as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.29.5",
3
+ "version": "4.29.7",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- const a="20240305",b="bba2f64408804c3983fca01a467bc20efb07d4a9";export{a as buildDate,b as commitHash};
5
+ const b="20240307",d="8edb474d2bd6a26e9cb72a83b1b1aaddd81bbf2a";export{b as buildDate,d 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.29/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{createResolver as i}from"../../../../core/promiseUtils.js";import{AttributeDataType as s,filterFlagsUnit as r,animationUnit as n,gpgpuUnit as a,visualVariableUnit as o,dataDrivenUnit0 as u,dataDrivenUnit1 as h,dataDrivenUnit2 as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as _}from"./Utils.js";import{TextureWrapMode as c,TextureSamplingMode as g}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=c.CLAMP_TO_EDGE,t.samplingMode=g.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=l(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=l(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),o=4,u=(s-s%this.size)/this.size,h=(r-r%this.size)/this.size,d=u,l=this.size,_=h,c=u*this.size*o,g=(l+_*this.size)*o-c,x=p(this.pixelType),f=new x(n,c*x.BYTES_PER_ELEMENT,g),b=this.size,m=_-d+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),o=_(r),u=new(p(r))(new ArrayBuffer(i*s*o*this.texelSize)),h=t.getBoundFramebufferObject(),{x:d,y:l,width:c,height:g}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,u),e.updateData(0,0,0,2*i,s/2,u),t.setViewport(d,l,c,g),t.bindFramebuffer(h)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose();for(const{resolver:t}of this._pendingAttributeUpdates)t.reject("AttributeStore destroyed");this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,s.VV,0,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}async requestUpdate(t){const e=i();this._version=t.version,this._pendingAttributeUpdates.push({inner:t,resolver:e}),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const{inner:e,resolver:i}of t){const{blockData:t,initArgs:s,sendUpdateEpoch:r,version:n}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${r}] AttributeStoreView.applyUpdate`),this._version=n,this._epoch=r,null!=s&&this._initialize(s);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}i.resolve()}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,s.FilterFlags),unit:r},animation:{texture:this._getTexture(t,s.Animation),unit:n},gpgpu:{texture:this._getTexture(t,s.GPGPU),unit:a},visualVariableData:{texture:this._getTexture(t,s.VV),unit:o},dataDriven0:{texture:this._getTexture(t,s.DD0),unit:u},dataDriven1:{texture:this._getTexture(t,s.DD1),unit:h},dataDriven2:{texture:this._getTexture(t,s.DD2),unit:d},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=c.CLAMP_TO_EDGE,e.samplingMode=g.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
5
+ import t from"../../../../core/Error.js";import has from"../../../../core/has.js";import e from"../../../../core/Logger.js";import{createResolver as i}from"../../../../core/promiseUtils.js";import{AttributeDataType as s,filterFlagsUnit as r,animationUnit as n,gpgpuUnit as a,visualVariableUnit as o,dataDrivenUnit0 as u,dataDrivenUnit1 as h,dataDrivenUnit2 as d}from"./definitions.js";import{getDisplayIdTexel as l}from"./DisplayId.js";import{getPixelArrayCtor as p,getPixelBytes as c}from"./Utils.js";import{TextureWrapMode as _,TextureSamplingMode as g}from"../../../webgl/enums.js";import{FramebufferObject as x}from"../../../webgl/FramebufferObject.js";import{Texture as f}from"../../../webgl/Texture.js";import{TextureDescriptor as b}from"../../../webgl/TextureDescriptor.js";const T=()=>e.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:r,textureOnly:n}=t,a=p(r);this.blockIndex=i,this.pixelType=r,this.size=e,this.textureOnly=n,n||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&("0"===t&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new b;return t.wrapMode=_.CLAMP_TO_EDGE,t.samplingMode=g.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=l(t),r=this.data,n=s*this.texelSize+e;!r||n>=r.length||(r[n]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(null==this.data)return null;const i=l(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=0===e?this.getTexture(t):this._textureDesc;this._fbos[e]=new x(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(e,i){try{const s=this.dirtyStart,r=this.dirtyEnd;if(!this.hasDirty)return;has("esri-2d-update-debug")&&console.debug(`Version[${i}] AttributeStoreView.updateTexture`,{start:s,end:r,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,a=this.getTexture(e),o=4,u=(s-s%this.size)/this.size,h=(r-r%this.size)/this.size,d=u,l=this.size,c=h,_=u*this.size*o,g=(l+c*this.size)*o-_,x=p(this.pixelType),f=new x(n,_*x.BYTES_PER_ELEMENT,g),b=this.size,m=c-d+1;if(m>this.size)return void T().error(new t("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,d,b,m,f)}catch(s){}}update(t){const{data:e,start:i,end:s}=t;if(null!=e&&null!=this.data){const s=this.data,r=i*this.texelSize;for(let i=0;i<e.length;i++){const n=1<<i%this.texelSize;t.layout&n&&(s[r+i]=e[i])}}this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,s)}resize(t,e){const i=this.size;if(this.size=e,this.textureOnly)return void(i!==this.size&&(this._lastTexture=this._texture,this._texture=null));const s=p(this.pixelType);this.destroy(),this.data=new s(t.buffer)}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}_initTexture(t){const e=new f(t,this._textureDesc,this.data??void 0);if(null!=this._lastTexture&&this._fbos[0]){const i=this._lastTexture.descriptor.width,s=this._lastTexture.descriptor.height,r=this._lastTexture.descriptor.dataType,n=this._lastTexture.descriptor.pixelFormat,a=this.getFBO(t),o=c(r),u=new(p(r))(new ArrayBuffer(i*s*o*this.texelSize)),h=t.getBoundFramebufferObject(),{x:d,y:l,width:_,height:g}=t.getViewport();t.bindFramebuffer(a),a.readPixels(0,0,i,s,n,r,u),e.updateData(0,0,0,2*i,s/2,u),t.setViewport(d,l,_,g),t.bindFramebuffer(h)}return this.destroy(),this._texture=e,this._texture}}class y{constructor(){this.size=0,this._pendingAttributeUpdates=[],this._version=0,this._epoch=0,this._locked=!1}_initialize(t){if(!t)throw new Error("InternalError: initArgs must be defined");const e=t.blockDescriptors;if(this.size=t.blockSize,has("esri-2d-update-debug")&&console.debug("AttributeStoreView.initialize",{message:t}),null==this._data)this._data=e.map(((t,e)=>null!=t?new m(t,this.size,e):null));else for(let i=0;i<this._data.length;i++){const t=this._data[i],s=e[i];null!=s&&(null==t?this._data[i]=new m(s,this.size,i):t.resize(s,this.size))}}destroy(){for(const t of this._data??[])t?.destroy();this._defaultTexture?.dispose();for(const{resolver:t}of this._pendingAttributeUpdates)t.reject("AttributeStore destroyed");this._pendingAttributeUpdates=[]}isEmpty(){return null==this._data}getBlock(t){if(null==this._data)return null;return this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,s.VV,0,0)}getData(t,e,i,s){if(!this._data)return 0;const r=this._data[e];if(null==r)return 0;const n=r.getData(t,i);return null!=n?n:s}setData(t,e,i,s){this._data[e].setData(t,i,s)}lockTextureUploads(){this._locked=!0}unlockTextureUploads(){this._locked=!1,this.update()}async requestUpdate(t){const e=i();e.promise=e.promise.catch((t=>{has("esri-2d-update-debug")&&console.error("AttributeStoreView.requestUpdate rejected",t)})),this._version=t.version,this._pendingAttributeUpdates.push({inner:t,resolver:e}),has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] AttributeStoreView.requestUpdate`,{message:t})}get currentEpoch(){return this._epoch}update(){if(this._locked)return;const t=this._pendingAttributeUpdates;this._pendingAttributeUpdates=[];for(const{inner:e,resolver:i}of t){const{blockData:t,initArgs:s,sendUpdateEpoch:r,version:n}=e;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] Epoch[${r}] AttributeStoreView.applyUpdate`),this._version=n,this._epoch=r,null!=s&&this._initialize(s);const a=this._data;for(let e=0;e<t.length;e++){const i=t[e],s=a[e];null!=s&&null!=i&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] CpuBlock[${e}] AttributeStoreView.update`,{block:i}),s.update(i))}i.resolve()}}getUniforms(t){return{filterFlags:{texture:this._getTexture(t,s.FilterFlags),unit:r},animation:{texture:this._getTexture(t,s.Animation),unit:n},gpgpu:{texture:this._getTexture(t,s.GPGPU),unit:a},visualVariableData:{texture:this._getTexture(t,s.VV),unit:o},dataDriven0:{texture:this._getTexture(t,s.DD0),unit:u},dataDriven1:{texture:this._getTexture(t,s.DD1),unit:h},dataDriven2:{texture:this._getTexture(t,s.DD2),unit:d},size:this.size}}_getTexture(t,e){const i=this._data?.[e];return i?(i.updateTexture(t,this._version),i.getTexture(t)):this._getDefaultTexture(t)}_getDefaultTexture(t){if(null==this._defaultTexture){const e=new b;e.wrapMode=_.CLAMP_TO_EDGE,e.samplingMode=g.NEAREST,e.width=1,e.height=1,this._defaultTexture=new f(t,e,new Uint8Array(4))}return this._defaultTexture}}export{y as AttributeStoreView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{FillMeshWriter as t}from"./FillMeshWriter.js";import{processColorInput as r,packBitset as s}from"./meshWriterUtils.js";import{LineVertexSpec as i,LineMeshWriter as o}from"../line/LineMeshWriter.js";import{bitsetTypeFillOutline as n}from"../shaders/constants.js";import{DataType as a}from"../../../../../../webgl/enums.js";const c={createComputedParams:e=>e,attributes:{...i.attributes,bitset:{type:a.UNSIGNED_BYTE,count:1,pack:e=>0},color:{type:a.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>r(e)}}},u={createComputedParams:e=>e,attributes:{...i.attributes,bitset:{type:a.UNSIGNED_BYTE,count:1,pack:e=>s([[n,!0]])},color:{type:a.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>r(e)}}};class p extends o{constructor(){super(...arguments),this.vertexSpec=u}}class l extends t{constructor(e,t,r,s){super(e,t,r,s),this.vertexSpec=c,this._lineMeshWriter=this._createOutlineWriter(e,t,r,s)}_createOutlineWriter(e,t,r,s){return new p(e,t,r,s)}_write(t,r,s){const i=s?.asOptimized()??r.readGeometryForDisplay(),o=this._clip(i);o&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,r,o),this._lineMeshWriter.writeLineVertices(t,e.fromOptimizedCIM(o,"esriGeometryPolyline"),r),t.recordEnd())}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}export{l as OutlineFillMeshWriter,p as OutlineFillOutlineMeshWriter,c as outlineFillVertexSpec_Fill,u as outlineFillVertexSpec_Outline};
5
+ import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{clipMarshall as t}from"../../../mesh/templates/templateUtils.js";import{FillMeshWriter as r}from"./FillMeshWriter.js";import{processColorInput as s,packBitset as i}from"./meshWriterUtils.js";import{LineVertexSpec as o,LineMeshWriter as n}from"../line/LineMeshWriter.js";import{getLineClippingMargin as a}from"../mesh/utils.js";import{bitsetTypeFillOutline as u}from"../shaders/constants.js";import{DataType as c}from"../../../../../../webgl/enums.js";const l={createComputedParams:e=>e,attributes:{...o.attributes,bitset:{type:c.UNSIGNED_BYTE,count:1,pack:e=>0},color:{type:c.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:e})=>s(e)}}},m={createComputedParams:e=>e,attributes:{...o.attributes,bitset:{type:c.UNSIGNED_BYTE,count:1,pack:e=>i([[u,!0]])},color:{type:c.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:e})=>s(e)}}};class p extends n{constructor(){super(...arguments),this.vertexSpec=m}}class h extends r{constructor(e,t,r,s){super(e,t,r,s),this.vertexSpec=l,this._lineMeshWriter=this._createOutlineWriter(e,t,r,s)}_createOutlineWriter(e,t,r,s){return new p(e,t,r,s)}_write(t,r,s){const i=s?.asOptimized()??r.readGeometryForDisplay(),o=this._clip(i);o&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,r,o),this._lineMeshWriter.writeLineVertices(t,e.fromOptimizedCIM(o,"esriGeometryPolyline"),r),t.recordEnd())}_clip(e){return e?t(e,a(this.evaluatedMeshParams)):null}ensurePacked(e,t,r){super.ensurePacked(e,t,r),this._lineMeshWriter.ensurePacked(e,t,r)}enqueueRequest(e,t,r){super.enqueueRequest(e,t,r),this._lineMeshWriter.enqueueRequest(e,t,r)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}export{h as OutlineFillMeshWriter,p as OutlineFillOutlineMeshWriter,l as outlineFillVertexSpec_Fill,m as outlineFillVertexSpec_Outline};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{minMaxZoomPrecisionFactor as s,thinLineHalfWidthThreshold as i}from"../../../definitions.js";import{LineTessellation as r}from"../../../TurboLine.js";import{clipLinesMarshall as o}from"../../../mesh/templates/templateUtils.js";import{getMinMaxZoom as n,processColorInput as a,packRounded as c,packCeil as h,processLineCapInput as l,processLineJoinInput as m}from"../fill/meshWriterUtils.js";import{MeshWriter as u}from"../mesh/MeshWriter.js";import{DataType as p}from"../../../../../../webgl/enums.js";class d{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}}const f={createComputedParams:t=>t,attributes:{id:{type:p.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:p.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:p.UNSIGNED_BYTE,count:1},zoomRange:{type:p.SHORT,count:2,packPrecisionFactor:s,pack:({scaleInfo:t},{tileInfo:e})=>n(t,e)},color:{type:p.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>a(t)},offset:{type:p.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[c(t,16),c(e,16)]},normal:{type:p.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[c(t,16),c(e,16)]},halfWidth:{type:p.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({width:e})=>h(t(.5*e),16)},referenceHalfWidth:{type:p.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({referenceWidth:e})=>h(t(.5*e),16)}}};class _{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}}const x=65535;class T extends u{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=f,this._currentWrite=new _,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:x,textured:!1},this._tessParams=new d,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);null!=i&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new r(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,s,i){const r=i??e.fromFeatureSetReaderCIM(s);r&&this._writeGeometry(t,s,r)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){const e=this.hasEffects;return o(t,e?256:16)}_writeVertices(e,s,r){const{_currentWrite:o,_tessellationOptions:n,evaluatedMeshParams:a}=this,{width:c,capType:h,joinType:u,miterLimit:p,hasSizeVV:d}=a,f=t(.5*c);n.halfWidth=f,n.capType=l(h),n.joinType=m(u),n.miterLimit=p;const _=!d;o.out=e,o.id=s.getDisplayId(),o.vertexCount=0,o.indexCount=0,o.vertexFrom=e.vertexCount(),o.vertexBounds=_&&f<i?0:1;for(const{line:t,start:i}of r)n.initialDistance=i%x,this._lineTessellator.tessellate(t,n,_)}_writeTesselatedVertex(t,e,s,i,r,o,n,a,c,h,l){const{out:m,id:u,vertexBounds:p}=this._currentWrite;return this.hasEffects&&m.recordBounds(t,e,p,p),this._tessParams.extrusionOffsetX=n,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=c,this._tessParams.normalY=h,this._tessParams.directionX=r,this._tessParams.directionY=o,this._tessParams.distance=l,this._writeVertex(m,u,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}export{T as LineMeshWriter,d as LineTessellationParams,f as LineVertexSpec};
5
+ import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{GeometryCursor as e}from"../../../../../../../geometry/GeometryCursor.js";import{minMaxZoomPrecisionFactor as s,thinLineHalfWidthThreshold as i}from"../../../definitions.js";import{LineTessellation as r}from"../../../TurboLine.js";import{clipLinesMarshall as o}from"../../../mesh/templates/templateUtils.js";import{getMinMaxZoom as n,processColorInput as a,packRounded as c,packCeil as h,processLineCapInput as l,processLineJoinInput as m}from"../fill/meshWriterUtils.js";import{MeshWriter as u}from"../mesh/MeshWriter.js";import{getLineClippingMargin as p}from"../mesh/utils.js";import{DataType as d}from"../../../../../../webgl/enums.js";class f{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}}const _={createComputedParams:t=>t,attributes:{id:{type:d.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:d.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:d.UNSIGNED_BYTE,count:1},zoomRange:{type:d.SHORT,count:2,packPrecisionFactor:s,pack:({scaleInfo:t},{tileInfo:e})=>n(t,e)},color:{type:d.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>a(t)},offset:{type:d.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[c(t,16),c(e,16)]},normal:{type:d.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[c(t,16),c(e,16)]},halfWidth:{type:d.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({width:e})=>h(t(.5*e),16)},referenceHalfWidth:{type:d.UNSIGNED_SHORT,count:1,packPrecisionFactor:16,pack:({referenceWidth:e})=>h(t(.5*e),16)}}};class x{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}}const T=65535;class w extends u{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=_,this._currentWrite=new x,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:T,textured:!1},this._tessParams=new f,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);null!=i&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new r(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,s,i){const r=i??e.fromFeatureSetReaderCIM(s);r&&this._writeGeometry(t,s,r)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return o(t,p(this.evaluatedMeshParams))}_writeVertices(e,s,r){const{_currentWrite:o,_tessellationOptions:n,evaluatedMeshParams:a}=this,{width:c,capType:h,joinType:u,miterLimit:p,hasSizeVV:d}=a,f=t(.5*c);n.halfWidth=f,n.capType=l(h),n.joinType=m(u),n.miterLimit=p;const _=!d;o.out=e,o.id=s.getDisplayId(),o.vertexCount=0,o.indexCount=0,o.vertexFrom=e.vertexCount(),o.vertexBounds=_&&f<i?0:1;for(const{line:t,start:i}of r)n.initialDistance=i%T,this._lineTessellator.tessellate(t,n,_)}_writeTesselatedVertex(t,e,s,i,r,o,n,a,c,h,l){const{out:m,id:u,vertexBounds:p}=this._currentWrite;return this.hasEffects&&m.recordBounds(t,e,p,p),this._tessParams.extrusionOffsetX=n,this._tessParams.extrusionOffsetY=a,this._tessParams.normalX=c,this._tessParams.normalY=h,this._tessParams.directionX=r,this._tessParams.directionY=o,this._tessParams.distance=l,this._writeVertex(m,u,t,e,this._tessParams),this._currentWrite.vertexFrom+this._currentWrite.vertexCount++}_writeTriangle(t,e,s){const{out:i}=this._currentWrite;i.indexEnsureSize(3),i.indexWrite(t),i.indexWrite(e),i.indexWrite(s),this._currentWrite.indexCount+=3}}export{w as LineMeshWriter,f as LineTessellationParams,_ as LineVertexSpec};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{numericHash as e}from"../../../../../../../core/string.js";function o(o){const r=o.map((({name:e,count:o,type:r})=>`${e}.${o}.${r}`)).join(",");return e(r)}function r(e,o,t,i,a,n,c){if(e.primitiveName===o)for(const r in e)if(r===t){let o=i?.readWithDefault(a,n,e[r]&&c);return"text"===e.type&&(o=o.toString()),void(e[r]=o)}if("type"in e&&null!=e.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.symbolLayers)for(const l of e.symbolLayers)r(l,o,t,i,a,n,c);break;case"CIMHatchFill":e.lineSymbol&&r(e.lineSymbol,o,t,i,a,n,c);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if("CIMVectorMarker"===e.type&&e.markerGraphics)for(const l of e.markerGraphics)r(l,o,t,i,a,n,c),r(l.symbol,o,t,i,a,n,c)}}export{r as applyComputedValue,o as vertexLayoutHash};
5
+ import{numericHash as e}from"../../../../../../../core/string.js";function t(t){const o=t.map((({name:e,count:t,type:o})=>`${e}.${t}.${o}`)).join(",");return e(o)}function o(e,t,r,i,n,a,c){if(e.primitiveName===t)for(const o in e)if(o===r){let t=i?.readWithDefault(n,a,e[o]&&c);return"text"===e.type&&(t=t.toString()),void(e[o]=t)}if("type"in e&&null!=e.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.symbolLayers)for(const l of e.symbolLayers)o(l,t,r,i,n,a,c);break;case"CIMHatchFill":e.lineSymbol&&o(e.lineSymbol,t,r,i,n,a,c);break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if("CIMVectorMarker"===e.type&&e.markerGraphics)for(const l of e.markerGraphics)o(l,t,r,i,n,a,c),o(l.symbol,t,r,i,n,a,c)}}function r(e){const t=e.width;return null!=e.effects?256:Math.max(1.25*t,8)}export{o as applyComputedValue,r as getLineClippingMargin,t as vertexLayoutHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import"../../../../core/Logger.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as r,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/InstanceStore.js";import{RenderState as h}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";class l{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class u extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._layerView=e}renderChildren(e){if(this.attributeView.update(),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);if(super.renderChildren(e),this.hasAnimation){e.painter.effects.integrate.draw(e,e.attributeView)}switch(e.drawPhase){case r.MAP:return this._renderMapPhase(e);case r.HIGHLIGHT:return this._renderHighlightPhase(e);case r.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(null==this._instanceStore)return null;let t=0,s=null;for(const i of this._instanceStore.values())i.techniqueRef.drawPhase&e&&(t++,i.techniqueRef.postProcessingEnabled&&(s=i));return t>1?null:s}_getOverrideStencilRef({drawPhase:e}){if(null==this._instanceStore)return null;let t=null;for(const s of this._instanceStore.values()){if(!(s.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:i}=s.techniqueRef;if(null==t)t=i;else if(t!==i){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new l(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new h(this._stage,e,this._tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const i of t)s.set(i.fieldName,{minValue:i.minValue,maxValue:i.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){if(this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const e of this._renderState.tiles())e.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(t,s){if(e(s),!this._subscriptions.has(t.id))return;const i=this._subscriptions.get(t.id);if(i.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const r=this._renderStateNext??this._renderState;if(!r)throw new Error("InternalError: No renderState defined");if(r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.updateTile(t),t.end){this._subscriptions.get(t.id).end()}this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const i=t();return s?s.resolvers.push(i):(s={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(s)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const i of this.children)if(i.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,i=e.state.scale;i<=(t||1/0)&&i>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(null==t)super.setStencilReference(e);else for(const s of this.children)s.stencilRef=t(s)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,i=t.getBoundFramebufferObject(),r=t.getViewport(),a=e.passOptions;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,n.All),s.draw(e),s.unbind(),t.bindFramebuffer(i),t.restoreViewport(r),e.passOptions=a}_renderFeatures(e,t){for(const i of this.children){if(!i.visible)continue;const s=has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,r=i.getDisplayList(e.drawPhase,this._instanceStore,s);e.selection=t,r?.render(e)}const s=this._getExclusivePostprocessingInstance(e);null!=s&&s.techniqueRef.postProcess(e,s)}}export{u as FeatureContainer};
5
+ import has from"../../../../core/has.js";import"../../../../core/Logger.js";import{throwIfAborted as e,createResolver as t}from"../../../../core/promiseUtils.js";import{UpdatingHandles as s}from"../../../../core/support/UpdatingHandles.js";import{AFeatureContainer as i}from"../../engine/AFeatureContainer.js";import{WGLDrawPhase as r,FeatureSelection as n,FeatureBatchingStrategy as a}from"../../engine/webgl/enums.js";import o from"../../engine/webgl/shaderGraph/techniques/InstanceStore.js";import{RenderState as h}from"./RenderState.js";import{renderHighlight as d}from"../support/util.js";class l{constructor(e,s){this.id=e,this.version=s,this._resolver=t(),this._done=!1}get done(){return this._done}get promise(){return this._resolver.promise}end(){this._resolver.resolve(),this._done=!0}destroy(){this._resolver.reject()}}class u extends i{constructor(e){super(e.view.featuresTilingScheme),this.updatingHandles=new s,this._hitTestsRequests=[],this._store=new o,this._visibleTiles=new Set,this._subscriptions=new Map,this._updateStatisticsRequests=[],this._lockStatisticUpdates=!1,this._layerView=e}renderChildren(e){if(this.attributeView.update(),this._renderState){const e=Array.from(this._renderState.tiles()).filter((e=>e.needsUpload));if(e.length){e[Math.floor(Math.random()*e.length)].upload(),e.length>=2&&this.requestRender()}for(const t of this._renderState.tiles())t.tryReady(this.attributeView.currentEpoch)&&(this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);if(super.renderChildren(e),this.hasAnimation){e.painter.effects.integrate.draw(e,e.attributeView)}switch(e.drawPhase){case r.MAP:return this._renderMapPhase(e);case r.HIGHLIGHT:return this._renderHighlightPhase(e);case r.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getExclusivePostprocessingInstance({drawPhase:e}){if(null==this._instanceStore)return null;let t=0,s=null;for(const i of this._instanceStore.values())i.techniqueRef.drawPhase&e&&(t++,i.techniqueRef.postProcessingEnabled&&(s=i));return t>1?null:s}_getOverrideStencilRef({drawPhase:e}){if(null==this._instanceStore)return null;let t=null;for(const s of this._instanceStore.values()){if(!(s.techniqueRef.drawPhase&e))continue;const{overrideStencilRef:i}=s.techniqueRef;if(null==t)t=i;else if(t!==i){t=null;break}}return t}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter((e=>this._visibleTiles.has(e.key.id))):[]}async updateAttributeView(e){this.requestRender(),await this.updatingHandles.addPromise(this.attributeView.requestUpdate(e)),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:s}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=s;else{const e=new l(t,s);this._subscriptions.set(t,e),this.updatingHandles.addPromise(e.promise)}for(const t of e.unsubscribe){const e=this._subscriptions.get(t);e?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new h((()=>this._stage),e,this._tileInfoView)}getDisplayStatistics(e,t){const s=this._statisticsByLevel.get(e);return s?s.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let s=this._statisticsByLevel.get(e);s||(s=new Map,this._statisticsByLevel.set(e,s));for(const i of t)s.set(i.fieldName,{minValue:i.minValue,maxValue:i.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){if(this._renderStateNext&&(has("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState)for(const e of this._renderState.tiles())e.upload();this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(t,s){if(e(s),!this._subscriptions.has(t.id))return;const i=this._subscriptions.get(t.id);if(i.version!==t.subscriptionVesrion){if(has("esri-2d-update-debug")){const e=`${t.subscriptionVesrion} != ${i.version}`;console.debug(`Version[${e}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}const r=this._renderStateNext??this._renderState;if(!r)throw new Error("InternalError: No renderState defined");if(r.version!==t.version&&console.error(`InternalError: Version mismatch. [renderState: ${r.version}, message: ${t.version}]`),r.updateTile(t),t.end){this._subscriptions.get(t.id).end()}this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let s=this._hitTestsRequests.find((({x:t,y:s})=>t===e.x&&s===e.y));const i=t();return s?s.resolvers.push(i):(s={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(s)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),s=new Map;for(const i of this.children)if(i.getSortKeys(t).forEach(((e,t)=>s.set(t,e))),s.size===t.size)break;return s}get hasAnimation(){return this.hasLabels}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer.effectiveScaleRange,i=e.state.scale;i<=(t||1/0)&&i>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){const t=this._getOverrideStencilRef(e);if(null==t)super.setStencilReference(e);else for(const s of this.children)s.stencilRef=t(s)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,n.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&d(e,!1,(e=>{this._renderFeatures(e,n.Highlight)}))}_renderLabelPhase(e){this._renderFeatures(e,n.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,n.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,n.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,s=e.painter.effects.hittest,i=t.getBoundFramebufferObject(),r=t.getViewport(),a=e.passOptions;s.bind(e),e.passOptions=s.createOptions(e,this._hitTestsRequests),this._renderFeatures(e,n.All),s.draw(e),s.unbind(),t.bindFramebuffer(i),t.restoreViewport(r),e.passOptions=a}_renderFeatures(e,t){for(const i of this.children){if(!i.visible)continue;const s=has("featurelayer-force-marker-text-draw-order")?a.STRICT_MARKERS_AND_TEXT:a.BATCHING,r=i.getDisplayList(e.drawPhase,this._instanceStore,s);e.selection=t,r?.render(e)}const s=this._getExclusivePostprocessingInstance(e);null!=s&&s.techniqueRef.postProcess(e,s)}}export{u as FeatureContainer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy(),this.container=this._client.createInvokeProxy("container"),this.eventLog=this._client.createInvokeProxy("eventLog")}}export{e as PipelineConnectionHandlers};
5
+ class e{constructor(e){this._client=e,this.layerView=this._client.createInvokeProxy("",{ignoreConnectionErrors:!0}),this.container=this._client.createInvokeProxy("container",{ignoreConnectionErrors:!0}),this.eventLog=this._client.createInvokeProxy("eventLog",{ignoreConnectionErrors:!0})}}export{e as PipelineConnectionHandlers};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{create as e}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import t from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as i}from"../../engine/webgl/FeatureTile.js";import{getPow2NeighborKey as s}from"./support/tileUtils.js";class o{constructor(e,t,i){this.stage=e,this.version=t,this._tileInfoView=i,this._tiles=new Map,this._pendingUpdates=[],this._locked=!1}destroy(){}tiles(){return this._tiles.values()}size(){return this._tiles.size}setTiles(e){this._tiles.clear();for(const t of e)this._tiles.set(t.key.id,t)}lockUploads(){this._locked=!0}unlockUploads(){this._locked=!1;for(const e of this._pendingUpdates)this.updateTile(e);this._pendingUpdates=[]}updateTile(e){if(this._locked)return void this._pendingUpdates.push(e);if(has("esri-2d-update-debug")){const t=e.debugInfo?.chunkId??"<EnsureEnd>";console.debug(`Version[${e.version}] Tile[${e.id}] Chunk[${t}] RenderState.updateTile [${e.type}]`,e)}const t=this._ensureTile(e.id);if("update"===e.type){const[i,...s]=e.modify;t.onMessage({type:"update",modify:i,remove:e.remove,end:e.end,attributeEpoch:e.attributeEpoch});for(const t of s){const i=this._tiles.get(t.tileId);i&&i.onMessage({type:"update",modify:t,remove:e.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null})}return}if(null==e.append)return void t.onMessage({type:"append",clear:e.clear,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});const[i,...s]=e.append;t.onMessage({type:"append",clear:e.clear,append:i,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});for(const o of s){const e=this._tiles.get(o.tileId);e&&e.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null})}}removeTile(e){const t=this._tiles.get(e);has("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(s){has("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${s}] RenderState.createTile`);const o=new t(s),n=this._tileInfoView.getTileBounds(e(),o),r=this._tileInfoView.getTileResolution(o.level),l=new i(o,r,n[0],n[3],!0);return l.stage=this.stage,l}_copyPixelBufferedEntitiesInto(e){let t=7;for(let i=-1;i<=1;i++)for(let o=-1;o<=1;o++){if(0===i&&0===o)continue;const n=this._tileInfoView.tileInfo.isWrappable,r=s(e.key,o,i,n).id,l=this._tiles.get(r);if(null!=l){const s=1<<t;e.copyPixelBufferedEntitesFrom(l,s,o,i)}t--}}}export{o as RenderState};
5
+ import e from"../../../../core/Error.js";import has from"../../../../core/has.js";import t from"../../../../core/Logger.js";import{create as i}from"../../../../geometry/support/aaBoundingRect.js";import"../../tiling/TileInfoView.js";import s from"../../tiling/TileKey.js";import"../../tiling/TileQueue.js";import"../../tiling/TileStrategy.js";import{FeatureTile as o}from"../../engine/webgl/FeatureTile.js";import{getPow2NeighborKey as r}from"./support/tileUtils.js";class n{constructor(e,t,i){this.getStage=e,this.version=t,this._tileInfoView=i,this._tiles=new Map,this._pendingUpdates=[],this._locked=!1}destroy(){}tiles(){return this._tiles.values()}size(){return this._tiles.size}setTiles(e){this._tiles.clear();for(const t of e)this._tiles.set(t.key.id,t)}lockUploads(){this._locked=!0}unlockUploads(){this._locked=!1;for(const e of this._pendingUpdates)this.updateTile(e);this._pendingUpdates=[]}updateTile(e){if(this._locked)return void this._pendingUpdates.push(e);if(has("esri-2d-update-debug")){const t=e.debugInfo?.chunkId??"<EnsureEnd>";console.debug(`Version[${e.version}] Tile[${e.id}] Chunk[${t}] RenderState.updateTile [${e.type}]`,e)}const t=this._ensureTile(e.id);if("update"===e.type){const[i,...s]=e.modify;t.onMessage({type:"update",modify:i,remove:e.remove,end:e.end,attributeEpoch:e.attributeEpoch});for(const t of s){const i=this._tiles.get(t.tileId);i&&i.onMessage({type:"update",modify:t,remove:e.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null})}return}if(null==e.append)return void t.onMessage({type:"append",clear:e.clear,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});const[i,...s]=e.append;t.onMessage({type:"append",clear:e.clear,append:i,debugInfo:e.debugInfo,end:e.end,attributeEpoch:e.attributeEpoch});for(const o of s){const e=this._tiles.get(o.tileId);e&&e.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null})}}removeTile(e){const t=this._tiles.get(e);has("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(r){has("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${r}] RenderState.createTile`);const n=new s(r),l=this._tileInfoView.getTileBounds(i(),n),d=this._tileInfoView.getTileResolution(n.level),a=new o(n,d,l[0],l[3],!0);if(a.stage=this.getStage(),!a.stage){const i=new e("featurelayerview:webgl","Cannot create tile with empty stage");t.getLogger("esri.views.2d.layers.features.RenderState").error(i)}return a}_copyPixelBufferedEntitiesInto(e){let t=7;for(let i=-1;i<=1;i++)for(let s=-1;s<=1;s++){if(0===i&&0===s)continue;const o=this._tileInfoView.tileInfo.isWrappable,n=r(e.key,s,i,o).id,l=this._tiles.get(n);if(null!=l){const o=1<<t;e.copyPixelBufferedEntitesFrom(l,o,s,i)}t--}}}export{n as RenderState};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../geometry.js";import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as o}from"../../../../../layers/graphics/data/projectionSupport.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as i}from"./AAggregateStrategy.js";import{ASendState as n}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as l}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as d}from"../support/ComputedAttributeStorage.js";import c from"../support/FeatureFilter.js";import{FeatureMetadata as u}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as p}from"../support/FeatureSetReaderJSON.js";import f from"../../../tiling/TileKey.js";import h from"../../../../../geometry/SpatialReference.js";class m extends n{constructor(e,t){super(e),this.bins=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.bins.clear(),this.done=!1,this.handledChunks.clear()}destroy(){const e=this.subscription.tile.key.level;for(const t of this.bins.values()){const s=t.cachedFeature?.objectId;null!=s&&this._store.releaseDisplayIdForObjectId(`${s}.${e}`)}}*featuresWorldSpace(){for(const e of this.bins.values()){const s=e.cachedFeature;if(s){const e=s.clone();t(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}}getGeohashBounds(t,s){const r=this.subscription.tile;return e(r.extent,r.resolution,s,t)}}class g extends i{static async create(e,t,s,r,i){const n=new d({spatialReference:t}),l=e.fixedBinLevel,u=await Promise.all(e.fields.map((async e=>a.create(n,e)))),p=e.featureFilter?await c.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return await o(t,h.WGS84),new g({fields:u,geohashLevel:l,spatialReference:t,featureFilter:p,timeZone:i},e.fields,s,r)}constructor(e,t,s,r){super(s,r,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new u({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new m(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values())t.reset()}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),o=[];for(const a of this._sendStates.values())for(const e of a.featuresWorldSpace()){const{objectId:t,displayId:a}=e,i=r.get(t);if(null!=i){const e=s(a,i,t);o.push(e),r.delete(t)}}return o}getDisplayFeatures(e){const t=new Set(e),r=new Set,o=[];for(const a of this._sendStates.values())for(const e of a.featuresWorldSpace())t.has(e.displayId)&&!r.has(e.objectId)&&(e.geometry&&o.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),r.add(e.objectId));return{features:[],aggregates:o}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:o,bins:a}=e,{spatialReference:i,geohashLevel:n}=this._indexOptions,d=o.tile;if(e.done)return;for(const r of t.chunks()){if(s.has(r.chunkId))continue;s.add(r.chunkId);const t=r.queryInfo;if("tileId"in t){const e=new f(t.tileId);if(e.level!==d.level||e.world!==d.key.world)continue}const o=r.getGeohashIndex(this._indexOptions),l=e.getGeohashBounds(i,n);null!=l&&o.putBins(a,l)}const c=[],u=o.tile.transform,h=o.tile.key.level;for(const l of a.values()){if(l.cachedFeature)l.cachedFeature.attributes=l.getAttributes();else{const e=l.getGeometry(this.spatialReference,u),t=new r(e,l.getAttributes(),null);e||(t.centroid=l.getGeometryCentroid(this.spatialReference,u)),t.objectId=l.id,t.displayId=this._attributeStore.createDisplayIdForObjectId(`${t.objectId}.${h}`),l.cachedFeature=t}c.push(l.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const m=p.fromOptimizedFeatures(c,this._metadata,u),g=m.getCursor(),y=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,y);const b=new l(e.subscription,m,[],e.done,{});yield b}}export{m as BinningState,g as BinningStrategy};
5
+ import"../../../../../geometry.js";import{getGeohashBounds as e}from"../../../../../geohash/geohashUtils.js";import{unquantizeOptimizedGeometry as t,convertToFeature as s}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as r}from"../../../../../layers/graphics/OptimizedFeature.js";import{checkProjectionSupport as o}from"../../../../../layers/graphics/data/projectionSupport.js";import{ComputedAggregateField as a}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as i}from"./AAggregateStrategy.js";import{ASendState as n}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as l,FeatureTileUpdateMessage as d}from"../sources/FeatureSourceMessage.js";import{ComputedAttributeStorage as c}from"../support/ComputedAttributeStorage.js";import u from"../support/FeatureFilter.js";import{FeatureMetadata as p}from"../support/FeatureMetadata.js";import{FeatureSetReaderJSON as f}from"../support/FeatureSetReaderJSON.js";import h from"../../../tiling/TileKey.js";import m from"../../../../../geometry/SpatialReference.js";class g extends n{constructor(e,t){super(e),this.bins=new Map,this.done=!1,this._store=t}reset(){this.destroy(),this.bins.clear(),this.done=!1,this.handledChunks.clear()}destroy(){const e=this.subscription.tile.key.level;for(const t of this.bins.values()){const s=t.cachedFeature?.objectId;null!=s&&this._store.releaseDisplayIdForObjectId(`${s}.${e}`)}}*featuresWorldSpace(){for(const e of this.bins.values()){const s=e.cachedFeature;if(s){const e=s.clone();t(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}}getGeohashBounds(t,s){const r=this.subscription.tile;return e(r.extent,r.resolution,s,t)}}class y extends i{static async create(e,t,s,r,i){const n=new c({spatialReference:t}),l=e.fixedBinLevel,d=await Promise.all(e.fields.map((async e=>a.create(n,e)))),p=e.featureFilter?await u.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return await o(t,m.WGS84),new y({fields:d,geohashLevel:l,spatialReference:t,featureFilter:p,timeZone:i},e.fields,s,r)}constructor(e,t,s,r){super(s,r,e.spatialReference,e.fields),this._indexOptions=e,this._metadata=new p({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fields:t,globalIdField:null,spatialReference:s.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new g(e,this._attributeStore)}async*applyOverride(e){for(const t of this._sendStates.values()){t.reset();const e=new l(t.subscription,f.empty(this._source.metadata),!0,!1,{});yield e}}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),o=[];for(const a of this._sendStates.values())for(const e of a.featuresWorldSpace()){const{objectId:t,displayId:a}=e,i=r.get(t);if(null!=i){const e=s(a,i,t);o.push(e),r.delete(t)}}return o}getDisplayFeatures(e){const t=new Set(e),r=new Set,o=[];for(const a of this._sendStates.values())for(const e of a.featuresWorldSpace())t.has(e.displayId)&&!r.has(e.objectId)&&(e.geometry&&o.push({...s(e,this._metadata.geometryType,!1,!1),displayId:e.displayId}),r.add(e.objectId));return{features:[],aggregates:o}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const s of t.bins.values())if(s.id===e)return Array.from(s.objectIds);return[]}async*updateChunks(){if(this._source.chunks().length)for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){for(const t of this._sendStates.values())for(const s of t.featuresWorldSpace())e(s)}async*_update(e,t){const{handledChunks:s,subscription:o,bins:a}=e,{spatialReference:i,geohashLevel:n}=this._indexOptions,l=o.tile;if(e.done)return;for(const r of t.chunks()){if(s.has(r.chunkId))continue;s.add(r.chunkId);const t=r.queryInfo;if("tileId"in t){const e=new h(t.tileId);if(e.level!==l.level||e.world!==l.key.world)continue}const o=r.getGeohashIndex(this._indexOptions),d=e.getGeohashBounds(i,n);null!=d&&o.putBins(a,d)}const c=[],u=o.tile.transform,p=o.tile.key.level;for(const d of a.values()){if(d.cachedFeature)d.cachedFeature.attributes=d.getAttributes();else{const e=d.getGeometry(this.spatialReference,u),t=new r(e,d.getAttributes(),null);e||(t.centroid=d.getGeometryCentroid(this.spatialReference,u)),t.objectId=d.id,t.displayId=this._attributeStore.createDisplayIdForObjectId(`${t.objectId}.${p}`),d.cachedFeature=t}c.push(d.cachedFeature)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const m=f.fromOptimizedFeatures(c,this._metadata,u),g=m.getCursor(),y=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;g.next();)this._attributeStore.setAttributeData(g.getDisplayId(),g,y);const b=new d(e.subscription,m,[],e.done,{});yield b}}export{g as BinningState,y as BinningStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.29/esri/copyright.txt for details.
4
4
  */
5
- import{ASendState as e,AProcessorStrategy as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/OverrideChunk.js";class n extends e{}class a extends t{constructor(e,t,s){super(e,t),this._timeZone=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._timeZone)}createState(e){return new n(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),o=[];for(const n of this._source.chunks()){const e=n.reader.getCursor();for(;e.next();){const t=e.getObjectId(),n=e.getDisplayId(),a=r.get(t);if(null!=a){const e=s(n,a,t);o.push(e),r.delete(t)}}}return o}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const o of this._source.chunks()){const e=o.reader.getCursor();for(;e.next();){const o=e.getObjectId(),n=e.getDisplayId();t.has(n)&&!s.has(o)&&(r.push({...e.readLegacyFeatureWorldSpace(),displayId:n}),s.add(o))}}return{features:r,aggregates:[]}}async*applyOverride(e){const t=[],r=e.reader.getCursor();for(;r.next();){const e=r.getObjectId();t.push(e);const s=this._attributeStore.createDisplayIdForObjectId(e);r.setDisplayId(s),this._attributeStore.setAttributeData(s,r,this._evalOptions)}const n=this.getDisplayIds(t),a=this.getDisplayIds(e.removed),i=new o;i.applyOverrides(e);for(const o of this._sendStates.values())yield new s(o.subscription,null,n,!1,i.queryInfo);for(const o of this._sendStates.values()){const e=i.getTileReader(o.subscription.tile);yield new s(o.subscription,e,a,!1,i.queryInfo)}for(const s of e.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const o of this._source.chunks()){const{chunkId:n}=o;if(s.has(n))continue;s.add(n);const a=o.getTileReader(t.tile);a&&(yield new r(e.subscription,a,!1,o.end,o.queryInfo))}}}export{n as DefaultSendState,a as FeatureUpdateStrategy};
5
+ import{ASendState as e,AProcessorStrategy as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as n}from"../sources/strategies/chunks/OverrideChunk.js";class a extends e{}class o extends t{constructor(e,t,s){super(e,t),this._timeZone=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._timeZone)}createState(e){return new a(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const r=new Map(e.map((e=>[t(e),e]))),n=[];for(const a of this._source.chunks()){const e=a.reader.getCursor();for(;e.next();){const t=e.getObjectId(),a=e.getDisplayId(),o=r.get(t);if(null!=o){const e=s(a,o,t);n.push(e),r.delete(t)}}}return n}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const n of this._source.chunks()){const e=n.reader.getCursor();for(;e.next();){const n=e.getObjectId(),a=e.getDisplayId();t.has(a)&&!s.has(n)&&(r.push({...e.readLegacyFeatureWorldSpace(),displayId:a}),s.add(n))}}return{features:r,aggregates:[]}}async*applyOverride(e){const t=[],r=e.reader.getCursor();for(;r.next();){const e=r.getObjectId();t.push(e);const s=this._attributeStore.createDisplayIdForObjectId(e);r.setDisplayId(s),this._attributeStore.setAttributeData(s,r,this._evalOptions)}const a=this.getDisplayIds(t),o=this.getDisplayIds(e.removed),d=new n(this._source.metadata);d.applyOverrides(e),this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const n of this._sendStates.values())n.handledChunks.add(d.chunkId),yield new s(n.subscription,null,a,!1,d.queryInfo);for(const n of this._sendStates.values()){const e=d.getTileReader(n.subscription.tile);yield new s(n.subscription,e,o,!1,d.queryInfo)}for(const s of e.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}async _updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const n of this._source.chunks()){const{chunkId:a}=n;if(s.has(a))continue;s.add(a);const o=n.getTileReader(t.tile);o&&(yield new r(e.subscription,o,!1,n.end,n.queryInfo))}}}export{a as DefaultSendState,o as FeatureUpdateStrategy};