@arcgis/core 4.34.0-next.90 → 4.34.0-next.91

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.
@@ -1 +1 @@
1
- var RemoteClient;(()=>{var e={799:(e,t,r)=>{"use strict";r.d(t,{Cj:()=>i,HC:()=>s,Wm:()=>c,_e:()=>f});var n=r(93637);const o=/\{([^}]+)\}/g;function a(e){return e??""}function s(e,t){return t?e.replaceAll(o,"object"==typeof t?(e,r)=>a((0,n.wc)(r,t)):(e,r)=>a(t(r))):e}function i(e,t){return e.replaceAll(/([.$?*|{}()[\]\\/+\-^])/g,e=>t?.includes(e)?e:`\\${e}`)}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}let l;function f(e){return l??=new DOMParser,l.parseFromString(e||"","text/html").body.innerText||""}},2131:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},4576:(e,t,r)=>{"use strict";r.d(t,{Ji:()=>a,MJ:()=>s,Mo:()=>g,Ru:()=>_,TF:()=>v,VO:()=>c,Xj:()=>f,Xy:()=>h,aI:()=>i,iv:()=>l,k4:()=>w,mW:()=>m,qh:()=>b,vW:()=>u});var n=r(21818),o=r(87811);const a=1.5;function s(e,t,r,n,o,a,s){if(null==e&&null==n)return!0;t=Math.max(0,t),o=Math.max(0,o),r=Math.max(0,r<0?(e?.length??0)+r:r),a=Math.max(0,a<0?(n?.length??0)+a:a);const i=r-t;if(null==e||null==n||i!==a-o)return!1;if(s){for(let r=0;r<i;r++)if(!s(e[t+r],n[o+r]))return!1}else for(let r=0;r<i;r++)if(e[t+r]!==n[o+r])return!1;return!0}function i(e,t,r){return s(e,0,e?.length??0,t,0,t?.length??0,r)}function c(){return(e,t)=>{if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}}function l(e,t,r){let n,o;return r?(n=t.filter(t=>!e.some(e=>r(e,t))),o=e.filter(e=>!t.some(t=>r(t,e)))):(n=t.filter(t=>!e.includes(t)),o=e.filter(e=>!t.includes(e))),{added:n,removed:o}}function f(e){return e&&"number"==typeof e.length}class u{constructor(){this.last=0}}const d=new u;function b(e,t,r,n){n=n||d;const o=Math.max(0,n.last-10);for(let a=o;a<r;++a)if(e[a]===t)return n.last=a,a;const a=Math.min(o,r);for(let r=0;r<a;++r)if(e[r]===t)return n.last=r,r;return-1}function h(e,t,r,o){const a=r??e.length,s=b(e,(0,n.zI)(t),a,o);if(-1!==s)return e[s]=e[a-1],null==r&&e.pop(),t}const p=new Set;function m(e,t,r=e.length,n=t.length,o,a){if(0===n||0===r)return r;p.clear();for(let e=0;e<n;++e)p.add(t[e]);o=o||d;const s=Math.max(0,o.last-10);for(let t=s;t<r;++t)if(p.has(e[t])&&(a?.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;for(let t=0;t<s;++t)if(p.has(e[t])&&(a?.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;return p.clear(),r}function g(e){return e?(y.seed=e,()=>y.getFloat()):Math.random}const y=new o.A;function w(e,t){if(!e)return e;const r=g(t);for(let t=e.length-1;t>0;t--){const n=Math.floor(r()*(t+1)),o=e[t];e[t]=e[n],e[n]=o}return e}function v(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}function _(e,t){return null!=e}},4718:(e,t,r)=>{"use strict";r.d(t,{Nb:()=>c,TU:()=>i,aI:()=>b,gh:()=>h,o8:()=>s,oy:()=>a});var n=r(4576),o=r(34275);function a(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&a(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function s(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if(null!=t)return t;if(c(e))return e.clone();if(l(e))return e.map(s);if(f(e))throw new Error("Trying to clone an unclonable Accessor instance");const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=s(e[t]);return r}function i(e,t){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const r=d(e);if(null!=r)return r;if(l(e)){let r=!0;const n=e.map(e=>{const n=i(e,t);return null!=e&&null==n&&(r=!1),n});return r?n:null}if(c(e))return e.clone(t);if(e instanceof File||e instanceof Blob)return e;if(f(e))return null;const n=new(0,Object.getPrototypeOf(e).constructor);for(const t of Object.getOwnPropertyNames(e)){const r=e[t],o=i(r);if(null!=r&&null==o)return null;n[t]=o}return n}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function u(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function d(e){if((0,o.dz)(e)||(0,o.mg)(e)||(0,o.UR)(e)||(0,o.IY)(e)||(0,o.jq)(e)||(0,o._G)(e)||(0,o.XJ)(e)||(0,o.vZ)(e)||(0,o.aI)(e))return e.slice();if(e instanceof Date)return new Date(e);if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[r,n]of e)t.set(r,s(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(s(r));return t}return null}function b(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof e?.getTime&&"function"==typeof t?.getTime&&e.getTime()===t.getTime()||!1}function h(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.aI)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!u(e)&&u(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}},8341:(e,t,r)=>{"use strict";r.d(t,{Go:()=>s,Jc:()=>c,T:()=>a,VI:()=>u,mF:()=>l,oV:()=>b,u1:()=>f});var n=r(44208),o=r(74887);const a="worker:port-closed",s={HANDSHAKE:0,OPEN:1,OPENED:2,RESPONSE:3,INVOKE:4,ABORT:5,CLOSE:6,OPEN_PORT:7,ON:8};let i=0;function c(){return i++}function l(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function f(e,t,r,o){if(t.type===s.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==s.INVOKE&&t.type!==s.RESPONSE)return void e.postMessage(t);let a;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(a=d(r.transferList),t.data=r.result):(a=d(o),t.data=r),a){if((0,n.A)("ff"))for(const r of a)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case s.INVOKE:throw r;case s.RESPONSE:return void f(e,{type:s.RESPONSE,jobId:t.jobId,error:l(r)})}}e.postMessage(t,a)}else e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function d(e){if(!e?.length)return null;if((0,n.A)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter(e=>!function(e){return e instanceof ArrayBuffer||"ArrayBuffer"===e?.constructor?.name}(e));return t.length?t:null}async function b(e){try{return await e}catch(e){const t=e?.name===a;if(!(0,o.zf)(e)&&!t)throw e;return}}},12195:(e,t,r)=>{"use strict";function n(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}r.d(t,{W:()=>n})},18357:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,u:()=>o});const n="20250920",o="5c5be205c3bfc5a6d482cebdd09cadc899dd3fe8"},21818:(e,t,r)=>{"use strict";function n(e){}function o(e){return e}r.d(t,{Xb:()=>n,zI:()=>o}),r(44208)},26306:(e,t,r)=>{"use strict";function n(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}function o(e){const t=new Uint8Array(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}r.d(t,{M:()=>n,Y:()=>o})},34275:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function o(e){return"Int8Array"===e?.constructor?.name}function a(e){return"Uint8Array"===e?.constructor?.name}function s(e){return"Uint8ClampedArray"===e?.constructor?.name}function i(e){return"Int16Array"===e?.constructor?.name}function c(e){return"Uint16Array"===e?.constructor?.name}function l(e){return"Int32Array"===e?.constructor?.name}function f(e){return"Uint32Array"===e?.constructor?.name}function u(e){return"Float16Array"===e?.constructor?.name}function d(e){return"Float32Array"===e?.constructor?.name}function b(e){return"Float64Array"===e?.constructor?.name}function h(e){return"buffer"in e}r.d(t,{IY:()=>i,JI:()=>m,LW:()=>u,OO:()=>_,PI:()=>w,UR:()=>s,XJ:()=>f,_G:()=>l,a3:()=>y,aI:()=>b,dk:()=>g,dz:()=>o,h2:()=>v,iu:()=>h,jq:()=>c,mg:()=>a,mw:()=>n,vZ:()=>d,y9:()=>p}),r(44208);const p=1024;function m(e){return b(e)||d(e)||l(e)||i(e)||o(e)}function g(e){return b(e)||d(e)}function y(e){return b(e)?179769e303:u(e)?65504:d(e)?3402823e32:f(e)?4294967295:c(e)?65535:a(e)||s(e)?255:l(e)?2147483647:i(e)?32767:o(e)?127:256}const w=-32768,v=-2147483648;function _(e){return e}},36563:(e,t,r)=>{"use strict";r.d(t,{Bf:()=>i,hA:()=>o,rE:()=>s,vE:()=>a});const n={remove:()=>{}};function o(e){return e?{remove(){e&&(e(),e=void 0)}}:n}function a(e){return o(()=>function(e){e.forEach(e=>e?.remove())}(e))}function s(e){return o(()=>e?.abort())}function i(e){return{[Symbol.dispose](){e.remove()}}}},37955:(e,t,r)=>{"use strict";r.d(t,{Oo:()=>i,on:()=>s,wb:()=>o});var n=r(36563);function o(e){return function(e){return null!=e&&"object"==typeof e&&"on"in e&&"function"==typeof e.on}(e)||a(e)}function a(e){return null!=e&&"object"==typeof e&&"addEventListener"in e&&"function"==typeof e.addEventListener}function s(e,t,r){if(!o(e))throw new TypeError("target is not a Evented or EventTarget object");return a(e)?function(e,t,r,o){if(Array.isArray(t)){const a=t.slice();for(const t of a)e.addEventListener(t,r,o);return(0,n.hA)(()=>{for(const t of a)e.removeEventListener(t,r,o)})}return e.addEventListener(t,r,o),(0,n.hA)(()=>e.removeEventListener(t,r,o))}(e,t,r):e.on(t,r)}function i(e,t,r){if(!o(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const n=s(e,t,t=>{n.remove(),r.call(e,t)});return n}},39131:(e,t,r)=>{"use strict";r.d(t,{$E:()=>s,py:()=>a,qG:()=>i});const n=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,o={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function a(e){const t=e?.match(n);if(!t)return null;const[,r,a,s]=t;if(!r)return null;let i=null,c=null,l=null;const{devext:f,qaext:u,www:d}=o;if(a)if(i=r,s)switch(s.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=f);break;case"qa":({customBaseUrl:c,portalHostname:l}=u);break;default:return null}else({customBaseUrl:c,portalHostname:l}=d);else switch(r.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=f);break;case"qaext":({customBaseUrl:c,portalHostname:l}=u);break;case"www":({customBaseUrl:c,portalHostname:l}=d);break;default:return null}return{customBaseUrl:c,isPortal:!1,portalHostname:l,urlKey:i}}function s(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}function i(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,n=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):n.test(e)&&(e=e.replace(n,"https://qaext.arcgis.com")),e}},44208:(e,t,r)=>{"use strict";let n;r.d(t,{A:()=>a});const o=globalThis;function a(e){return"function"==typeof n[e]?n[e]=n[e](o):n[e]}n=o.dojoConfig?.has||o.esriConfig?.has?{...o.dojoConfig?.has,...o.esriConfig?.has}:{},a.add=(e,t,r,o)=>{(o||void 0===n[e])&&(n[e]=t),r&&a(e)},a.cache=n,a.add("big-integer-warning-enabled",!0),a.add("esri-deprecation-warnings",!0),a.add("esri-tests-disable-screenshots",!1),a.add("esri-tests-use-full-window",!1),a.add("esri-tests-post-to-influx",!0),a.add("esri-cim-animations-enable-status","enabled"),a.add("esri-cim-animations-spotlight",!1),a.add("esri-cim-animations-freeze-time",!1),(()=>{a.add("host-webworker",void 0!==o.WorkerGlobalScope&&self instanceof o.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(a.add("host-browser",e),a.add("host-node",!("object"!=typeof o.process||!o.process.versions?.node||!o.process.versions.v8)),a.add("dom",e),a("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(a.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),a.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),a.add("khtml",r.includes("Konqueror")?n:void 0),a.add("edge",parseFloat(t.split("Edge/")[1])||void 0),a.add("opr",parseFloat(t.split("OPR/")[1])||void 0),a.add("webkit",!a("wp")&&!a("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),a.add("chrome",!a("edge")&&!a("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),a.add("android",!a("wp")&&parseFloat(t.split("Android ")[1])||void 0),a.add("safari",!r.includes("Safari")||a("wp")||a("chrome")||a("android")||a("edge")||a("opr")?void 0:parseFloat(r.split("Version/")[1])),a.add("mac",r.includes("Macintosh")),!a("wp")&&/(iPhone|iPod|iPad)/.test(t)){const e=RegExp.$1.replace(/P/,"p"),r=/OS ([\d_]+)/.test(t)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replaceAll("_",""));a.add(e,n),a.add("ios",n)}a("webkit")||(!t.includes("Gecko")||a("wp")||a("khtml")||a("edge")||a.add("mozilla",n),a("mozilla")&&a.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(o.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&a.add("esri-mobile",t),r&&a.add("esri-iPhone",r),a.add("esri-geolocation",!!navigator.geolocation)}a.add("esri-wasm","WebAssembly"in o),a.add("esri-performance-mode-frames-between-render",20),a.add("esri-force-performance-mode",!1),a.add("esri-shared-array-buffer",()=>{const e="SharedArrayBuffer"in o,t=!1===o.crossOriginIsolated;return e&&!t}),a.add("wasm-simd",()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))),a.add("esri-atomics","Atomics"in o),a.add("esri-workers","Worker"in o),a.add("web-feat:cache","caches"in o),a.add("esri-workers-arraybuffer-transfer",!a("safari")||Number(a("safari"))>=12),a.add("workers-pool-size",8),a.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),a.add("featurelayer-simplify-payload-size-factors",[1,1,4]),a.add("featurelayer-fast-triangulation-enabled",!0),a.add("featurelayer-animation-enabled",!0),a.add("featurelayer-snapshot-enabled",!0),a.add("featurelayer-snapshot-initial-tolerance",0),a.add("featurelayer-snapshot-point-min-threshold",8e4),a.add("featurelayer-snapshot-point-max-threshold",4e5),a.add("featurelayer-snapshot-multipoint-min-threshold",2e4),a.add("featurelayer-snapshot-multipoint-max-threshold",1e5),a.add("featurelayer-snapshot-polygon-min-threshold",2e3),a.add("featurelayer-snapshot-polygon-max-threshold",2e3),a.add("featurelayer-snapshot-polyline-min-threshold",2e3),a.add("featurelayer-snapshot-polyline-max-threshold",2e3),a.add("featurelayer-snapshot-max-vertex-count",25e4),a.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),a.add("featurelayer-snapshot-concurrency",4),a.add("featurelayer-snapshot-coverage",.1),a.add("featurelayer-query-max-depth",4),a.add("featurelayer-query-pausing-enabled",!1),a.add("featurelayer-query-tile-concurrency",4),a.add("featurelayer-query-tile-max-features",6e5),a.add("featurelayer-advanced-symbols",!1),a.add("featurelayer-pbf",!0),a.add("featurelayer-pbf-statistics",!1),a.add("feature-layers-workers",!0),a.add("feature-polyline-generalization-factor",1),a.add("mapview-transitions-duration",200),a.add("mapview-essential-goto-duration",200),a.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),a.add("mapserver-pbf-version-support",10.81),a.add("mapservice-popup-identify-max-tolerance",20),a.add("request-queue-concurrency-hosted",16),a.add("request-queue-concurrency-non-hosted",4),a.add("curve-densification-coarse-segments",128),a.add("curve-densification-max-segments",2e3),a.add("curve-densification-min-segments",3),a.add("curve-densification-pixel-deviation",.5),a.add("view-readyState-waiting-delay",1e3),a.add("gradient-depth-bias",.01),a.add("gradient-depth-epsilon",1e-8),a.add("enable-feature:esri-compress-textures",!0),a("host-webworker")||a("host-browser")&&(a.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),a.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})()},49186:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(4718),o=r(53966),a=r(79907);class s extends a.A{constructor(e,t,r){super(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.o8)(t)}catch(e){return"[object]"}}))}}catch(e){throw o.A.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new s(e.name,e.message,e.details)}}s.prototype.type="error"},52268:(e,t,r)=>{"use strict";function n(e,t){return new Proxy({},{get:(r,n,o)=>(...r)=>{let o,a;const s=r[r.length-1];return function(e){return"object"==typeof e&&!Array.isArray(e)&&null!=e&&("signal"in e||"transferList"in e||0===Object.keys(e).length)}(s)&&(o=s.signal,a=s.transferList,r.pop()),e.apply(t?`${t}.${n.toString()}`:n.toString(),r,{transferList:a,signal:o})}})}r.d(t,{L:()=>n})},53966:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(92602),o=(r(44208),r(799));const a={info:0,warn:1,error:2,none:3};class s{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,s._loggers.set(this.module,this);const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=s.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){}static get test(){}static getLogger(e){return e="string"!=typeof e?e.declaredClass:e,s._loggers.get(e)||new s({module:e})}static{this._loggers=new Map}static{this._tickCounter=0}static{this._tickCounterScheduled=!1}static{this._throttlingDisabled=!1}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!s._throttlingDisabled){const n=function(...e){return(0,o.Wm)(JSON.stringify(e,(e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]"))}(r),a=this._loggedMessages[e].get(n);if("once"===t&&null!=a||"oncePerTick"===t&&a&&a>=s._tickCounter)return;this._loggedMessages[e].set(n,s._tickCounter),s._scheduleTickCounterIncrement()}for(const t of n.A.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;null!=r;){const t=r[e];if(null!=t)return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",i)}_matchLevel(e){const t=n.A.log.level||"warn";return a[this._parentWithMember("level",t)]<=a[e]}static _scheduleTickCounterIncrement(){s._tickCounterScheduled||(s._tickCounterScheduled=!0,Promise.resolve().then(()=>{s._tickCounter++,s._tickCounterScheduled=!1}))}}function i(e,t,...r){console[e](`[${t}]`,...r)}},61322:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(70333),o=r(49186),a=r(37955),s=r(36563),i=r(97768),c=r(74887),l=r(52268);const f={statsWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(9476),r.e(3009)]).then(r.bind(r,33009)),geometryEngineWorker:()=>Promise.all([r.e(3209),r.e(8887)]).then(r.bind(r,68887)),arcadeGeometryOperatorsWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(6357)]).then(r.bind(r,1123)),CSVSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(9536)]).then(r.bind(r,40752)),EdgeProcessingWorker:()=>Promise.all([r.e(431),r.e(135)]).then(r.bind(r,71936)),ElevationSamplerWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8487),r.e(5845)]).then(r.bind(r,38419)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(7603),r.e(1956),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(7115),r.e(8702)]).then(r.bind(r,12543)),GaussianSplatSortWorker:()=>r.e(5856).then(r.bind(r,35856)),GeoJSONSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(860)]).then(r.bind(r,71202)),LercWorker:()=>r.e(7087).then(r.bind(r,57087)),MemorySourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(1360)]).then(r.bind(r,29432)),PBFDecoderWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(8140)]).then(r.bind(r,39078)),FeaturePipelineWorker:()=>Promise.all([r.e(7603),r.e(5323),r.e(8303),r.e(1956),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(8786),r.e(7115),r.e(3443),r.e(5363),r.e(3117)]).then(r.bind(r,93117)),PointCloudWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(2603),r.e(7005),r.e(7984),r.e(7242)]).then(r.bind(r,34142)),RasterWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(3356),r.e(6049),r.e(7449)]).then(r.bind(r,30139)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4946),r.e(2603),r.e(431),r.e(2504)]).then(r.bind(r,27444)),SceneLayerWorker:()=>Promise.all([r.e(7603),r.e(9953),r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(8256)]).then(r.bind(r,29030)),WFSSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(8969)]).then(r.bind(r,33771)),WorkerTileHandler:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(5897),r.e(3443),r.e(5294)]).then(r.bind(r,69286)),Lyr3DWorker:()=>Promise.all([r.e(2741),r.e(2772)]).then(r.bind(r,72772)),Feature3DPipelineWorker:()=>Promise.all([r.e(7603),r.e(2869),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(7005),r.e(655),r.e(3474),r.e(2883),r.e(4283)]).then(r.bind(r,64183)),TextureCompressionWorker:()=>Promise.all([r.e(2741),r.e(5902)]).then(r.bind(r,95902)),FlowWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(5007)]).then(r.bind(r,35007)),ParquetSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(8786),r.e(4841)]).then(r.bind(r,6557)),PanoramicMeshWorker:()=>r.e(6982).then(r.bind(r,96982))};var u=r(8341),d=r(18357);const{CLOSE:b,ABORT:h,INVOKE:p,RESPONSE:m,OPEN_PORT:g,ON:y}=u.Go;class w{constructor(e){this._invoke=e,this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._timer=null,this._process=this._process.bind(this)}push(e){e.type===h?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 v{static{this.kernelInfo={buildDate:d.$,fullVersion:n.ol,revision:d.u}}static{this.clients=new Map}static connect(e,t){const r=new MessageChannel;let n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new v(r.port1,{channel:r,client:n,schedule:t});return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=o),v.clients.set(o,n),r.port2}static loadWorker(e){const t=f[e];return t?t():Promise.resolve(null)}constructor(e,t,r,n){this._port=e,this._jobQueue=r,this._lowPriorityJobQueue=n,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new w(e=>this._onInvokeMessage(e)),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:b}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=r?.signal,a=r?.transferList;if(!this._port)return Promise.reject(new o.A(u.T,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const s=(0,u.Jc)();return new Promise((r,o)=>{if((0,c.G4)(n))return this._processWork(),void o((0,c.NK)());const l=(0,c.u7)(n,()=>{const e=this._outJobs.get(s);e&&(this._outJobs.delete(s),this._processWork(),(0,i.xt)(e.abortHandle),this._post({type:h,jobId:s}),o((0,c.NK)()))}),f={resolve:r,reject:o,abortHandle:l,debugInfo:e};this._outJobs.set(s,f),this._post({type:p,jobId:s,methodName:e,abortable:null!=n},t,a)})}createInvokeProxy(e){return(0,l.L)(this,e)}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:y,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),(0,s.hA)(()=>{r.port1.postMessage({type:b}),r.port1.close(),r.port1.removeEventListener("message",n)})}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:g,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._jobQueue?.pop()??this._lowPriorityJobQueue?.pop();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:o}=e;this.apply(t,r,n).then(e=>o.resolve(e)).catch(e=>o.reject(e))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(e=>{(0,i.xt)(e.abortHandle),e.reject((0,c.NK)(`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,this._onMessage=null,this._channel=null,this._jobQueue=void 0,this._invokeQueue=void 0,this._lowPriorityJobQueue=void 0}_onMessage(e){null!=this._schedule?this._schedule(()=>this._processMessage(e,!0)):this._processMessage(e,!1)}_processMessage(e,t){const r=(0,u.VI)(e);if(r)switch(r.type){case m:this._onResponseMessage(r);break;case p:t?this._onInvokeMessage(r):this._invokeQueue.push(r);break;case h:this._onAbortMessage(r);break;case b:this._onCloseMessage();break;case g:this._onOpenPortMessage(r);break;case y:this._onOnMessage(r)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&v.clients.get(this)===e&&e.destroy(),v.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n=[],abortable:o}=e,a=o?new AbortController:null,s=this._inJobs;let i,l=this._client,f=l[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)l=l[e[t]],f=l[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);n.push({client:this,signal:a?a.signal:null}),i=f.apply(l,n)}catch(e){return void this._post({type:m,jobId:r,error:(0,u.mF)(e)})}(0,c.$X)(i)?(s.set(r,{controller:a,promise:i}),i.then(e=>{s.has(r)&&(s.delete(r),this._post({type:m,jobId:r},e))},e=>{s.has(r)&&(s.delete(r),(0,c.zf)(e)||this._post({type:m,jobId:r,error:(0,u.mF)(e||{message:`Error encountered at method ${t}`})}))})):this._post({type:m,jobId:r},i)}_onOpenPortMessage(e){new v(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,e=>{t.postMessage(e)}),n=(0,a.on)(e.port,"message",e=>{const o=(0,u.VI)(e);o?.type===b&&(n.remove(),r.remove(),t.close())})}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,a=this._outJobs;if(!a.has(t))return;const s=a.get(t);a.delete(t),this._processWork(),(0,i.xt)(s.abortHandle),r?s.reject(o.A.fromJSON(JSON.parse(r))):s.resolve(n)}_post(e,t,r){return(0,u.u1)(this._port,e,t,r)}}},70333:(e,t,r)=>{"use strict";r.d(t,{Aq:()=>c,Y3:()=>l,id:()=>s,ol:()=>i,rE:()=>a});var n=r(44208),o=r(84952);Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const a="4.34";let s,i=a;function c(e){s=e}function l(e){const t=s?.findCredential(e);return t?.token?(0,o.rs)(e,"token",t.token):e}i="4.34.0-next.90",(0,n.A)("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),(0,n.A)("host-webworker")},74887:(e,t,r)=>{"use strict";r.d(t,{Pl:()=>O,Ol:()=>k,nA:()=>_,NK:()=>l,Tw:()=>x,sg:()=>S,Lx:()=>v,QZ:()=>w,zf:()=>y,G4:()=>d,$X:()=>P,u7:()=>p,NY:()=>m,hn:()=>j,Mq:()=>u,QP:()=>b,Te:()=>f,jH:()=>h,NO:()=>M,z7:()=>A,qr:()=>g});var n=r(36563);const o=(a=globalThis,{setTimeout:(e,t)=>{const r=a.setTimeout(e,t);return(0,n.hA)(()=>a.clearTimeout(r))}});var a,s=r(49186),i=r(37955),c=(r(53966),r(97768));function l(e="Aborted"){return new s.A("AbortError",e)}function f(e,t="Aborted"){if(d(e))throw l(t)}function u(e){return e instanceof AbortSignal?e:e?.signal??void 0}function d(e){const t=u(e);return null!=t&&t.aborted}function b(e){if(y(e))throw e}function h(e){if(!y(e))throw e}function p(e,t){const r=u(e);if(null!=r){if(!r.aborted)return(0,i.Oo)(r,"abort",()=>t());t()}}function m(e,t){const r=u(e);if(null!=r)return f(r),(0,i.Oo)(r,"abort",()=>t(l()))}function g(e,t){return null==u(t)?e:new Promise((r,n)=>{let o=p(t,()=>n(l()));const a=()=>{o=(0,c.xt)(o)};e.then(a,a),e.then(r,n)})}function y(e){return"AbortError"===e?.name}async function w(e){try{return await e}catch(e){if(!y(e))throw e;return}}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map(t=>e[t]),n=await v(r),o={};return t.map((e,t)=>o[e]=n[t]),o}const t=e;return Promise.allSettled(t).then(e=>Array.from(t,(t,r)=>{const n=e[r];return"fulfilled"===n.status?{promise:t,value:n.value}:{promise:t,error:n.reason}}))}async function _(e){return(await Promise.allSettled(e)).filter(e=>"fulfilled"===e.status).map(e=>e.value)}async function k(e){return(await Promise.allSettled(e)).filter(e=>"rejected"===e.status).map(e=>e.reason)}function O(e,t=void 0,r){const n=new AbortController;return p(r,()=>n.abort()),new Promise((r,o)=>{let a=setTimeout(()=>{a=0,r(t)},e);p(n,()=>{a&&(clearTimeout(a),o(l()))})})}function P(e){return e&&"function"==typeof e.then}function A(e){return P(e)?e:Promise.resolve(e)}function S(e,t=-1){let r,n,o,a,s=null;const i=(...c)=>{if(r){n=c,a&&a.reject(l()),a=x();const e=a.promise;if(s){const e=s;s=null,e.abort()}return e}if(o=a||x(),a=null,t>0){const n=new AbortController;r=A(e(...c,n.signal));const o=r;O(t).then(()=>{r===o&&(a?n.abort():s=n)})}else r=1,r=A(e(...c));const f=()=>{const e=n;n=o=r=s=null,null!=e&&i(...e)},u=r,d=o;return u.then(f,f),u.then(d.resolve,d.reject),d.promise};return i}function x(){let e,t;const r=new Promise((r,n)=>{e=r,t=n}),n=t=>{e(t)};return n.resolve=t=>e(t),n.reject=e=>t(e),n.timeout=(e,t)=>o.setTimeout(()=>n.reject(t),e),n.promise=r,n}function j(e,t){t.then(e.resolve,e.reject)}async function M(e){await Promise.resolve(),f(e)}},79907:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(93637);class o{constructor(e,t,r=void 0){this.name=e,this.details=r,this.message=(t&&function(e,t){return e.replaceAll(/\$\{([^\s:}]*)(?::([^\s:}]+))?\}/g,(e,r)=>""===r?"$":((0,n.wc)(r,t)??"").toString())}(t,r))??""}toString(){return"["+this.name+"]: "+this.message}}},84952:(e,t,r)=>{"use strict";r.d(t,{$1:()=>Z,$z:()=>Q,An:()=>x,BQ:()=>ae,DB:()=>X,FL:()=>F,FX:()=>J,Hg:()=>re,Il:()=>be,Ln:()=>ge,N9:()=>oe,S8:()=>D,T1:()=>pe,UC:()=>he,V1:()=>H,Xq:()=>A,Zo:()=>ke,_0:()=>Pe,a6:()=>_e,b8:()=>R,e7:()=>de,fj:()=>G,gd:()=>S,hf:()=>me,lJ:()=>Y,lM:()=>ce,m3:()=>ie,nM:()=>ue,oP:()=>K,oy:()=>N,r$:()=>te,rs:()=>ve,s0:()=>_,s2:()=>B,sC:()=>q,s_:()=>C,tk:()=>ne,ut:()=>L,w8:()=>V,x0:()=>M,xw:()=>Oe,yM:()=>$,zf:()=>j,zi:()=>we,zs:()=>T});var n=r(92602),o=r(4576),a=r(49186),s=r(53966),i=r(12195),c=r(39131),l=r(26306);const f=()=>s.A.getLogger("esri.core.urlUtils"),u=n.A.request,d="esri/config: esriConfig.request.proxyUrl is not set.",b=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,h=/^\s*http:/i,p=/^\s*https:/i,m=/^\s*file:/i,g=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,w=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),v=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class _{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(w);this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=this.authority.match(v),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const k={};let O=new _(n.A.applicationUrl);let P=function(){const e=O.path,t=e.slice(0,e.lastIndexOf("/")+1);return`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}${t}`}();const A=()=>O,S=()=>P;function x(e){if(!e)return null;const t={path:null,query:null},r=new _(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.slice(0,n),t.query=j(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.slice(0,t.path.length-(r.fragment.length+1)))),t}function j(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let a=r[n];"string"==typeof a&&(a=r[n]=[a]),Array.isArray(a)?a.push(o):r[n]=o}return r}function M(e,t){return e?t&&"function"==typeof t?Object.keys(e).map(r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r]))).join("&"):Object.keys(e).map(r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",a=t?.[r];return a?o+encodeURIComponent(a(n)):Array.isArray(n)?n.map(e=>(0,i.W)(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e)).join("&"):(0,i.W)(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)}).filter(e=>e).join("&"):""}function C(e=!1){let t,r=u.proxyUrl;if("string"==typeof e){t=ie(e);const n=T(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw f().warn(d),new a.A("urlUtils:proxy-not-set",d);return t&&le()&&(r=ce(r)),x(r)}function $(e,t=!1){const r=T(e);let n,o;if(r){const e=E(r.proxyUrl);n=e.path,o=e.query?j(e.query):null}else if(t){const t=C(e);n=t.path,o=t.query}if(n){const t=x(e);e=n+"?"+t.path;const r=M({...o,...t.query});r&&(e=`${e}?${r}`)}return e}const I={path:"",query:""};function E(e){const t=e.indexOf("?");return-1!==t?(I.path=e.slice(0,t),I.query=e.slice(t+1)):(I.path=e,I.query=null),I}function W(e){return(e=fe(e=be(e=E(e).path),!0)).toLowerCase()}function N(e){const t={proxyUrl:e.proxyUrl,urlPrefix:W(e.urlPrefix)},r=u.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(n.startsWith(t)){if(n.length===t.length)return-1;o=e;break}t.startsWith(n)&&(o=e+1)}return r.splice(o,0,t),o}function T(e){const t=u.proxyRules,r=W(e);for(let e=0;e<t.length;e++)if(r.startsWith(t[e].urlPrefix))return t[e]}function R(e,t){if(!e||!t)return!1;e=U(e),t=U(t);const r=(0,c.py)(e),n=(0,c.py)(t);return null!=r&&null!=n?r.portalHostname===n.portalHostname:null==r&&null==n&&J(e,t,!0)}function L(e,t){return e=U(e),t=U(t),fe(e)===fe(t)}function U(e){const t=(e=D(e)).indexOf("/sharing");return t>0?e.slice(0,t):e.replace(/\/+$/,"")}function q(e,t=u.interceptors){const r=t=>t instanceof RegExp?t.test(e):"string"==typeof t?e.startsWith(t):null==t;if(t)for(const e of t)if(Array.isArray(e.urls)){if(e.urls.some(r))return e}else if(r(e.urls))return e;return null}function J(e,t,r=!1){if(!e||!t)return!1;const n=ye(e),o=ye(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function F(e){if("string"==typeof e){if(!K(e))return!0;e=ye(e)}if(J(e,O))return!0;const t=u.trustedServers||[];for(let r=0;r<t.length;r++){const n=z(t[r]);for(let t=0;t<n.length;t++)if(J(e,n[t]))return!0}return!1}function z(e){return k[e]||(se(e)||ae(e)?k[e]=[new _(B(e))]:k[e]=[new _(`http://${e}`),new _(`https://${e}`)]),k[e]}function B(e,t=P,r){return ae(e)?r?.preserveProtocolRelative?e:"http"===O.scheme&&O.authority===Q(e).slice(2)?`http:${e}`:`https:${e}`:se(e)?e:G(e.startsWith("/")?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e)}function H(e,t=P,r){if(null==e||!K(e))return e;const n=D(e),o=n.toLowerCase(),a=D(t).toLowerCase().replace(/\/+$/,""),s=r?D(r).toLowerCase().replace(/\/+$/,""):null;if(s&&!a.startsWith(s))return e;const i=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=i(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===a.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=i(o,"/",c+1);if(-1===l)return e;if(s&&l<s.length)return e;e=n.slice(l);const f=a.slice(l-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let t=0;t<f;t++)e=`../${e}`;else e=`./${e}`;return e}function D(e){return function(e){const t=u.httpsDomains;if(!function(e){return null!=e&&h.test(e)||"http"===O.scheme&&ae(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),g.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===O.scheme&&n===O.authority&&!y.test(e)||(le()&&n===O.authority||t&&t.some(e=>n===e||n.endsWith(`.${e}`))||le()&&!T(e))&&(e=ce(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=E(e);e=(e=t.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=B(e=e.trim()))))}function G(...e){const t=e.filter(o.Ru);if(!t?.length)return;const r=[];if(K(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&m.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else t[0].startsWith("/")&&r.push("");const n=t.reduce((e,t)=>t?e.concat(t.split("/")):e,[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function Q(e,t=!1){if(null==e||V(e)||X(e))return null;let r=e.indexOf("://");if(-1===r&&ae(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=fe(e,!0)),e}function K(e){return ae(e)||se(e)}function V(e){return null!=e&&e.startsWith("blob:")}function X(e){return null!=e&&e.startsWith("data:")}function Y(e){const t=te(e);return t?.isBase64?(0,l.M)(t.data):null}function Z(e){return(0,l.Y)(e).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const ee=/^data:(.*?)(;base64)?,(.*)$/;function te(e){const t=e.match(ee);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function re(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function ne(e){return(await fetch(e)).blob()}function oe(e){const t=Y(e);if(!t)return null;const r=te(e);return new Blob([t],{type:r.mediaType})}function ae(e){return null!=e&&e.startsWith("/")&&"/"===e[1]}function se(e){return null!=e&&b.test(e)}function ie(e){return null!=e&&p.test(e)||"https"===O.scheme&&ae(e)}function ce(e){return ae(e)?`https:${e}`:e.replace(h,"https:")}function le(){return"https"===O.scheme}function fe(e,t=!1){return ae(e)?e.slice(2):(e=e.replace(b,""),t&&e.length>1&&e.startsWith("/")&&"/"===e[1]&&(e=e.slice(2)),e)}function ue(e){let t=0;if(K(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function de(e,t){if(!e)return"";const r=x(e).path.replace(/\/+$/,""),n=r.slice(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`\\.(${t.join("|")})$`,"i");return n.replace(o,"")}function be(e){return e.endsWith("/")?e:`${e}/`}function he(e){return e.replace(/\/+$/,"")}function pe(e,t,r){if(!(t&&r&&e&&K(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),a=e.indexOf(":",n+2),s=Math.min(o<0?e.length:o,a<0?e.length:a);return e.slice(n+2,s).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(s)}`}function me(e,t){const r=new URL(e);return r.host=t,r.port&&!g.test(t)&&(r.port=""),r.toString()}function ge(e){return new URL(e).host}function ye(e){return"string"==typeof e?new _(B(e)):(e.scheme||(e.scheme=O.scheme),e)}function we(e,t){const r=x(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function ve(e,t,r){const n=x(e),o=n.query||{};return o[t]=String(r),`${n.path}?${M(o)}`}function _e(e,t){if(!t)return e;const r=x(e),n=r.query||{};for(const[e,r]of Object.entries(t))null!=r&&(n[e]=r);const o=M(n);return o?`${r.path}?${o}`:r.path}function ke(e){if(null==e)return null;const t=e.match(Ae);return t?t[2]:null}function Oe(e){if(null==e)return null;const t=e.match(Ae);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function Pe(e){return"string"==typeof e?te(e)??{data:e}:new Promise((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(te(n.result)),n.onerror=e=>r(e)})}const Ae=/([^.]*)\.([^/]*)$/},87811:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{static{this._m=2147483647}static{this._a=48271}static{this._c=0}constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}},92602:(e,t,r)=>{"use strict";r.d(t,{A:()=>o}),r(44208);var n=r(93637);const o={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.$N)(o,globalThis.esriConfig,!0),delete o.has),!o.assetsPath){{const e="4.34.0-next.90";o.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}o.defaultAssetsPath=o.assetsPath}},93637:(e,t,r)=>{"use strict";r.d(t,{$N:()=>o,a4:()=>u,i7:()=>f,i8:()=>i,sM:()=>s,wc:()=>a});var n=r(4718);function o(e,t,r=!1){return l(e,t,r)}function a(e,t){if(null!=t)return t[e]||c(e.split("."),!1,t)}function s(e,t,r){const n=e.split("."),o=n.pop(),a=c(n,!0,r);a&&o&&(a[o]=t)}function i(e,t){if(null==e&&null==t)return!1;if(null==e)return!0;if(null==t)return!0;if("object"==typeof e){if(Array.isArray(e)){const r=t;if(e.length!==r.length)return!0;for(let t=0;t<e.length;t++)if(i(e[t],r[t]))return!0;return!1}if(Object.keys(e).length!==Object.keys(t).length)return!0;for(const r in e)if(i(e[r],t[r]))return!0;return!1}return e!==t}function c(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function l(e,t,r){return t?Object.keys(t).reduce((e,o)=>{if("__proto__"===o)return e;let a=e[o],s=t[o];return a===s?e:void 0===a?(e[o]=(0,n.o8)(s),e):(Array.isArray(s)||Array.isArray(e)?(a=a?Array.isArray(a)?e[o]=a.slice():e[o]=[a]:e[o]=[],s&&(Array.isArray(s)||(s=[s]),r?s.forEach(e=>{a.includes(e)||a.push(e)}):e[o]=s.slice())):s&&"object"==typeof s?e[o]=l(a,s,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=s),e)},e||{}):e}function f(e,t){for(const r of Object.entries(e))if(t===r[1])return r[0]}function u(e,t){return Object.values(e).includes(t)}},97768:(e,t,r)=>{"use strict";function n(e,t){if(null==e)throw new Error(t??"value is None")}function o(e){return e?.destroy(),null}function a(e){return e?.dispose(),null}function s(e){return e?.remove(),null}function i(e){return e?.abort(),null}function c(e){return e?.release(),null}function l(e,t,r){return null!=e&&null!=t?null!=r?r(e,t):e.equals(t):e===t}function f(e,t){let r;return e.some((e,n)=>(r=t(e,n),null!=r)),r??void 0}r.d(t,{CM:()=>l,DC:()=>i,Gz:()=>c,Lw:()=>n,Pb:()=>f,WD:()=>a,pR:()=>o,xt:()=>s})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"chunks/"+{36:"c547692862df95d22818",61:"bb0a1be03bb9d621432c",73:"19bd0b56d82446dbb7c5",132:"71c6c0b26253c4ca1b68",135:"45aeff2f751f124f8e53",146:"3c3b1dc95f03082e4d5b",168:"46ef545d2b3b3f4e6d32",177:"e5a9c37de44508e9733b",191:"09b77f82c22530b44daa",217:"6391ce002fbde9f27a77",224:"f651c05604eab83aef5f",309:"65e279516170ddbd4a65",353:"04bac7bb3f794b33e2e4",364:"3d800fbc449bea18b1cd",369:"af00081b78fc30ac556c",382:"b0e52c3775f05aaf7ff6",390:"41f487713c6278d389a1",427:"c954d281038f6bf80232",431:"c27783ce7ea51a5e49c5",489:"1214c126af0de25a4b4a",490:"4823e4522bd7379d858e",547:"8736b78256037b145f8b",563:"31c6e951b99315e8e68a",573:"8cae725e631d922853c8",588:"c3020747f9001ca6a6e7",591:"a17ed7ce97e69466d730",603:"baa48614d9567d5f240d",624:"52121179d4f9833008ec",647:"48b9ba825856a0c843ff",655:"56de25a6fe659a5b5c2b",692:"05aac984cbbadb5f6aa0",708:"5ea03f53d4d64d9e7cae",744:"648c91a9822bc9d6ee47",788:"ff8e2f998169ca3a7a68",795:"9f2a3f37fe9b19ef1209",807:"f6ce485c082d0d640b01",812:"71fef0a33b7ed9456e47",820:"3c5f07ebe1b09dcdc958",860:"3e11a893271caa11a881",873:"77e611724a499d36eacc",957:"e2fdc4dc1ab9decd731e",979:"cb6a9b43406f4fbe10b2",980:"edaf059c7ea18088c3dd",985:"24921d31efa8d222ad2d",1017:"ce8f56cf371812b57a46",1088:"004c2a1a37b99a184b13",1190:"ce569860b170700e9b31",1197:"35ca317490540fae437c",1204:"e9311386f58f3cb95c22",1214:"009556f323e58271bc7a",1224:"c799f1c03cb22ef52f5f",1273:"d7adef4093ce19ad356d",1277:"6e4ec9fa931c69e4e4ba",1352:"a1a7b0e7ca488c895cb7",1360:"147f6e7b147beaa4ed29",1384:"ed8a85efbd90241512bb",1414:"48c8ef4170e803a564d6",1421:"9a20be3b02c9d6349b8d",1436:"3a457e718a901a45902e",1437:"2e1cc11462846febb3b2",1598:"61a9ffd4cf07d8bb7a9b",1698:"c6cae8471c5d4ae40c65",1713:"70c8f69eed14d55c5cf6",1728:"1f2d13466c60a6b57717",1776:"c20862fe15295a294bbd",1837:"b4349db7155673329432",1863:"393274af1804e5b6046a",1867:"49e6219dd08cb6c27023",1874:"38d874d7f815f5329420",1878:"65fd971d0574d69cbc26",1882:"a6533bab3b2fbc1e2a47",1894:"0b679d5a1bfdbd006d6e",1918:"db81d881805f6f92a2e4",1956:"56edb55b53779e7fd31e",2095:"c7c76a8a1c47eb62bef1",2158:"e537e1d37f3fcb14fce2",2186:"36fe6b8228e622407ec2",2274:"f62717338075df626eda",2288:"0856cd281efd71bfe3c4",2314:"23e17b745adf71a5efc7",2343:"61bb39597ccf89f99a72",2372:"21d7f42c2033de987b97",2390:"a34a14fd989dbbd3c2d0",2409:"29471e0b3f7296dee096",2423:"2d3ae187f8aa3495d4ae",2503:"e0017c6739d2532793e6",2504:"0427f66b56ec6601deb0",2507:"0ca5060c81a1a05b8be3",2515:"41f275401e1cde7eee20",2558:"bbdadced49446c907361",2561:"a845c68e76382a73da5e",2568:"f6806780ca2aa591475a",2593:"ef75cad6570b14a42b62",2603:"2b7f9a57a2cfbc108673",2657:"7f0c78bcba0aed3c4eff",2712:"b661ea374fe38c8e29ca",2741:"9346437b152b20bdcf8a",2764:"d3b1d1c389d70919fb02",2772:"ba6452acee3d6defb37e",2848:"08374e5805fcedc1cb57",2869:"e99fc64b67bb0c71dc34",2883:"4660798b3b45dcb5cecb",2958:"66db5f77e09d25e33951",2980:"eafc4da265469e9e5e0b",3009:"3fe7be535affae31de7e",3054:"348c871657b0af621c33",3081:"100a0041ee42b0b2fa32",3091:"976dd80e318266ab4c2c",3103:"7b17f52019762aa21af8",3116:"8d63b42aea32ce2e5d09",3117:"8f4cfef97716c3502b0f",3169:"e689a4849f5af3f2f641",3209:"e34136ad9d620cb845fd",3236:"1ed7a8f4a0058d3b69ef",3263:"ce16489cf7eb0d78c741",3276:"e5baa30944061418cb13",3285:"98175b454e807b1a3c5f",3299:"c5c6a32a24005478c976",3356:"06aed0a5464965be8d52",3359:"c55c096669677321a227",3367:"7a240ab31d9ff2d2c5af",3390:"94c9d3094c93f7760433",3443:"72ecf49d03bb24bf0998",3444:"fdadf11f31384c09db9f",3474:"633faa9cec8988ab06af",3513:"f88fe2e8fbc763bdc940",3543:"1c52999a6392370844a6",3548:"de34c21d3e6913befe5a",3561:"f03635ddf56e2ef90e4c",3562:"3ff3e1507220d3869c76",3637:"20988e116f3723228f36",3661:"b8f55ee77ab6ea4c289e",3666:"755e2ecd20b6bd1909be",3747:"95bae3c275f1483eb7ed",3779:"00ee2a605c30744f415a",3813:"5ad1985a9e66fb2232ae",3910:"c38360d912f256519e06",3937:"9046a792395da28fa8f7",4038:"c95e6bef8c97cf647869",4045:"0652d7e525d99e39c957",4097:"82d5aa8ba4a67160ea69",4123:"5a6b487b70ca85a45f57",4167:"21f37a4b8d1857369203",4224:"fb6ebb780bb59e252887",4283:"1bbc0dfad4cd72a1c42b",4342:"0037abf0a82d1ed32e91",4383:"56569d0c2cf5c5167651",4496:"80a155496deef2c02a3e",4526:"50d9f69d5255af4b29bb",4575:"0810dbbf348a927392e7",4649:"0aaaf4d1c4a5d284216e",4753:"5c585b338a9e9aa0e205",4784:"47c0c16c1e995a441ec2",4800:"2266a8f2c2ec37c19bb4",4802:"4d807bfe75108438db83",4815:"6688efc71d9d8f4d2559",4841:"b8997ae5893afa0298d1",4903:"1990162dcf73601d54f7",4929:"e0bbfbe1ed39c82f1bd4",4946:"23e600e368ac829680b5",4996:"0e5e565df6ec71445f2e",5007:"57c08ccb75e3135978d1",5066:"c84665db250b05e2829d",5141:"e19cd07df8ce87e18832",5165:"2b867cec6ada339f1c8f",5180:"6cfa0967045068ce8a8b",5181:"282c4f3484c605ce7d5e",5257:"8644c54b4f00c53bab80",5294:"3b2ef975831eb75b40fb",5323:"700b5a536f97233bc4af",5363:"ff6d189ba78980d40bb5",5367:"d48af7bc06b4bb176534",5369:"024063fe2bbb27899094",5404:"fc06014fb484fc8c697e",5455:"a8f998b8ec8c56150479",5549:"6201356f7f91e5c06425",5552:"8a6052b4d163d5088e11",5605:"459a67928bde4a62b6a4",5613:"e22b400636094fc7b6c0",5655:"39a5863355cccaabd2d6",5666:"28a5a7c6b3d6902146f6",5710:"4133ab8720e7e4afa9a6",5740:"620a94b54be3ed78350d",5756:"8bbae8ac586e5c0819d2",5794:"8513c9282c44bb0a736e",5804:"6bb5158de43c4b59107f",5845:"a6a2d4602dfeb62e0ecc",5856:"0b24a6c06d1becbb6815",5874:"cb90cfa35d77ab561939",5890:"1194c2432c31def87db1",5897:"a85acb948cc7d22be592",5902:"19f1bfe815896d4983af",5913:"375f20f2e91d6a7507e8",5924:"d56548a994753b08403c",5971:"c86ca87959f04075e834",6018:"31186e83fe009aa0fd36",6049:"bdf0ab95401c6d8fbc7d",6052:"ab005fe84952f0676020",6129:"0271a2ca4e9b1e4fd284",6154:"a987731d1b5449d8fb0c",6160:"fd34c033ce7f16835368",6187:"388873be1dca91ccbc9d",6339:"4d0e099f34639cda3a9b",6343:"f98689562017583f73ee",6357:"388482cea4b9fdeaf06e",6395:"aa78b69219d9a0ef1c54",6468:"5d15ca055071d7db6de8",6554:"e4833b718a813a8d125b",6558:"82ba4140e30f083fbc87",6650:"28bb6896c5fd353ca5e9",6673:"0328eaea66c1db98da1c",6699:"b265472ac3f949a7f40c",6730:"eea9d49d55c2d1355497",6791:"06c389283ee5b60573f2",6859:"06221ebadab32111e2c6",6982:"3dcdbba706a8034b6ba3",7005:"04dbdaa63c950f32b8f0",7048:"58e2652810143f509fe1",7074:"cf5db995ba88912cf6b7",7087:"0f4e9846d074864b39c2",7115:"83065bef261314f9b2c5",7136:"16d66770ef841564ee3f",7242:"d71836cf70b9604832f1",7243:"c6077a893d5b5c34a46c",7301:"2e6ae1ca07df442fc966",7330:"873008572c1f21cea122",7360:"74881340e040bfd0580f",7367:"79968c183135281d2a6f",7375:"db5a985ccc6b7d0ad855",7444:"ced12ad98f8f48d0dc00",7449:"6aa349e1adf844df4b5b",7464:"143503f6eb270c4683f8",7528:"64c31c90e4c589ca2f04",7546:"d08b80583a23ba253c7e",7548:"cab2a1382bdd32bb34d8",7559:"7f8b85de079614b9c336",7561:"9a0b9d931c1a29e81475",7603:"86832d94190150c70c11",7656:"5993427325d1add18ed9",7677:"a1196637268b89281780",7694:"2bb61f80473b495163e3",7817:"2870723d57aa7b885896",7836:"2845a0810e9c00bf30f8",7883:"68f5a2d2666636c3f807",7982:"b240298b8b643a323d34",7984:"a244afea77127e54dd3a",8010:"5d1d909354c90cb8eb60",8018:"6e5175b43220d6692263",8098:"d6e0528eacee7ea4c1ce",8125:"be06c8a58c217a17451b",8140:"79ab06fb4c91ac8da323",8207:"5b7a2ee44883b1fb2a5f",8241:"b2fbb44e219232e61cbd",8256:"22c3a21bc9f32c429c48",8303:"025f1d78dfa5ec93178b",8344:"f594df2f5ce6ca41a254",8350:"b510c07dfd0d31683b08",8368:"ae6066ea6cb373dc6db3",8377:"9a855a10798348a21bab",8399:"0f37204f86d2997a2811",8411:"5d4b24c864ebb68ae61e",8487:"4753793daf0b7ff8b5ff",8506:"541bffd61006d0e36166",8535:"d9d86cf0500fa29d1d43",8628:"17103e6542aae53c7301",8654:"37b5007660535f1c91c6",8692:"05072093e0209ef5db20",8702:"2605062e44f2d4e73f14",8714:"809a9055da28c8fa58b0",8766:"9d9a639f7388a29e7c96",8786:"14114be3afd6d292f89c",8812:"920b4def081c78c0d586",8887:"08957e462d06c4dc8ab5",8969:"f3284d4e0d41efb0b4a0",8999:"5caf49e679ed0c27e0bd",9e3:"67d9cfe02613cb73ee37",9013:"a5a67216e0d0cee95a55",9036:"614a00a3179f8fe23f45",9041:"b48abbf877e26ed1a4f8",9062:"896c7d137bfd7a8fa0bc",9110:"0ceb68ff73e5d39e837a",9117:"155dcbd957f8787a45c3",9126:"c5cc0fc652432a9264cc",9159:"efa47bccb95514fe953d",9187:"f2b63597ae956db74eb3",9192:"fe6fa1f2c2d54d41645e",9202:"da4163b4f9b34e83c92d",9221:"142c45ad68eecaf3fc7c",9239:"899f493412acd5a5d91f",9240:"512dcd6e34e217029391",9247:"3807d0b9b1894731174d",9263:"ad9606164c694af0c61f",9265:"ab88577987cf2fe1cb32",9279:"6f29951f5a2da068b257",9321:"24ff9dad3fb64ab54970",9361:"779ee975efebb838b5d6",9384:"88cbaa91c495d86f4bb0",9419:"77705d0c7c17bd46d81a",9476:"8ff2daef892881ff2019",9506:"ecc15622d6c434ea842b",9536:"b47f26d6aa9a2848a677",9573:"07a7ca89ef2ca4fc090b",9588:"651b9144abb1895cc510",9644:"edef1e2254c992459c63",9645:"61e8e159f1f336569b27",9647:"b18887a6dc86f0c8324a",9695:"18e9cb71fa020e93d139",9700:"768ae52b4e5c3e571ef5",9718:"8bdbd94a59269e216fba",9838:"a1b08aab73747f4e7e25",9926:"5713f96bade5ebb54c81",9933:"9bb6984f24cd5461a754",9953:"0cfded1acf92f89a13cb"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={76:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,a,s]=t;for(var i in a)r.o(a,i)&&(r.m[i]=a[i]);for(s&&s(r);o.length;)e[o.pop()]=1;n(t)}})(),r(2131);var n=r(61322);RemoteClient=n})();
1
+ var RemoteClient;(()=>{var e={799:(e,t,r)=>{"use strict";r.d(t,{Cj:()=>i,HC:()=>s,Wm:()=>c,_e:()=>f});var n=r(93637);const o=/\{([^}]+)\}/g;function a(e){return e??""}function s(e,t){return t?e.replaceAll(o,"object"==typeof t?(e,r)=>a((0,n.wc)(r,t)):(e,r)=>a(t(r))):e}function i(e,t){return e.replaceAll(/([.$?*|{}()[\]\\/+\-^])/g,e=>t?.includes(e)?e:`\\${e}`)}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}let l;function f(e){return l??=new DOMParser,l.parseFromString(e||"","text/html").body.innerText||""}},2131:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},4576:(e,t,r)=>{"use strict";r.d(t,{Ji:()=>a,MJ:()=>s,Mo:()=>g,Ru:()=>_,TF:()=>v,VO:()=>c,Xj:()=>f,Xy:()=>h,aI:()=>i,iv:()=>l,k4:()=>w,mW:()=>m,qh:()=>b,vW:()=>u});var n=r(21818),o=r(87811);const a=1.5;function s(e,t,r,n,o,a,s){if(null==e&&null==n)return!0;t=Math.max(0,t),o=Math.max(0,o),r=Math.max(0,r<0?(e?.length??0)+r:r),a=Math.max(0,a<0?(n?.length??0)+a:a);const i=r-t;if(null==e||null==n||i!==a-o)return!1;if(s){for(let r=0;r<i;r++)if(!s(e[t+r],n[o+r]))return!1}else for(let r=0;r<i;r++)if(e[t+r]!==n[o+r])return!1;return!0}function i(e,t,r){return s(e,0,e?.length??0,t,0,t?.length??0,r)}function c(){return(e,t)=>{if(null==e&&null==t)return!0;if(null==e||null==t||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}}function l(e,t,r){let n,o;return r?(n=t.filter(t=>!e.some(e=>r(e,t))),o=e.filter(e=>!t.some(t=>r(t,e)))):(n=t.filter(t=>!e.includes(t)),o=e.filter(e=>!t.includes(e))),{added:n,removed:o}}function f(e){return e&&"number"==typeof e.length}class u{constructor(){this.last=0}}const d=new u;function b(e,t,r,n){n=n||d;const o=Math.max(0,n.last-10);for(let a=o;a<r;++a)if(e[a]===t)return n.last=a,a;const a=Math.min(o,r);for(let r=0;r<a;++r)if(e[r]===t)return n.last=r,r;return-1}function h(e,t,r,o){const a=r??e.length,s=b(e,(0,n.zI)(t),a,o);if(-1!==s)return e[s]=e[a-1],null==r&&e.pop(),t}const p=new Set;function m(e,t,r=e.length,n=t.length,o,a){if(0===n||0===r)return r;p.clear();for(let e=0;e<n;++e)p.add(t[e]);o=o||d;const s=Math.max(0,o.last-10);for(let t=s;t<r;++t)if(p.has(e[t])&&(a?.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;for(let t=0;t<s;++t)if(p.has(e[t])&&(a?.push(e[t]),p.delete(e[t]),e[t]=e[r-1],--r,--t,0===p.size||0===r))return p.clear(),r;return p.clear(),r}function g(e){return e?(y.seed=e,()=>y.getFloat()):Math.random}const y=new o.A;function w(e,t){if(!e)return e;const r=g(t);for(let t=e.length-1;t>0;t--){const n=Math.floor(r()*(t+1)),o=e[t];e[t]=e[n],e[n]=o}return e}function v(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}function _(e,t){return null!=e}},4718:(e,t,r)=>{"use strict";r.d(t,{Nb:()=>c,TU:()=>i,aI:()=>b,gh:()=>h,o8:()=>s,oy:()=>a});var n=r(4576),o=r(34275);function a(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&a(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function s(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=d(e);if(null!=t)return t;if(c(e))return e.clone();if(l(e))return e.map(s);if(f(e))throw new Error("Trying to clone an unclonable Accessor instance");const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=s(e[t]);return r}function i(e,t){if(!e||"object"!=typeof e||"function"==typeof e||"HTMLElement"in globalThis&&e instanceof HTMLElement)return e;const r=d(e);if(null!=r)return r;if(l(e)){let r=!0;const n=e.map(e=>{const n=i(e,t);return null!=e&&null==n&&(r=!1),n});return r?n:null}if(c(e))return e.clone(t);if(e instanceof File||e instanceof Blob)return e;if(f(e))return null;const n=new(0,Object.getPrototypeOf(e).constructor);for(const t of Object.getOwnPropertyNames(e)){const r=e[t],o=i(r);if(null!=r&&null==o)return null;n[t]=o}return n}function c(e){return"function"==typeof e.clone}function l(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function u(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function d(e){if((0,o.dz)(e)||(0,o.mg)(e)||(0,o.UR)(e)||(0,o.IY)(e)||(0,o.jq)(e)||(0,o._G)(e)||(0,o.XJ)(e)||(0,o.vZ)(e)||(0,o.aI)(e))return e.slice();if(e instanceof Date)return new Date(e);if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[r,n]of e)t.set(r,s(n));return t}if(e instanceof Set){const t=new Set;for(const r of e)t.add(s(r));return t}return null}function b(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof e?.getTime&&"function"==typeof t?.getTime&&e.getTime()===t.getTime()||!1}function h(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.aI)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!u(e)&&u(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}},8341:(e,t,r)=>{"use strict";r.d(t,{Go:()=>s,Jc:()=>c,T:()=>a,VI:()=>u,mF:()=>l,oV:()=>b,u1:()=>f});var n=r(44208),o=r(74887);const a="worker:port-closed",s={HANDSHAKE:0,OPEN:1,OPENED:2,RESPONSE:3,INVOKE:4,ABORT:5,CLOSE:6,OPEN_PORT:7,ON:8};let i=0;function c(){return i++}function l(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function f(e,t,r,o){if(t.type===s.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==s.INVOKE&&t.type!==s.RESPONSE)return void e.postMessage(t);let a;if(function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(a=d(r.transferList),t.data=r.result):(a=d(o),t.data=r),a){if((0,n.A)("ff"))for(const r of a)if("byteLength"in r&&r.byteLength>267386880){const r="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case s.INVOKE:throw r;case s.RESPONSE:return void f(e,{type:s.RESPONSE,jobId:t.jobId,error:l(r)})}}e.postMessage(t,a)}else e.postMessage(t)}function u(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function d(e){if(!e?.length)return null;if((0,n.A)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter(e=>!function(e){return e instanceof ArrayBuffer||"ArrayBuffer"===e?.constructor?.name}(e));return t.length?t:null}async function b(e){try{return await e}catch(e){const t=e?.name===a;if(!(0,o.zf)(e)&&!t)throw e;return}}},12195:(e,t,r)=>{"use strict";function n(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}r.d(t,{W:()=>n})},18357:(e,t,r)=>{"use strict";r.d(t,{$:()=>n,u:()=>o});const n="20250921",o="6daa3a9703ef8b2a8bc52218c606f4b89423ac32"},21818:(e,t,r)=>{"use strict";function n(e){}function o(e){return e}r.d(t,{Xb:()=>n,zI:()=>o}),r(44208)},26306:(e,t,r)=>{"use strict";function n(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}function o(e){const t=new Uint8Array(e);let r="";for(let e=0;e<t.length;e++)r+=String.fromCharCode(t[e]);return btoa(r)}r.d(t,{M:()=>n,Y:()=>o})},34275:(e,t,r)=>{"use strict";function n(e){return e instanceof ArrayBuffer}function o(e){return"Int8Array"===e?.constructor?.name}function a(e){return"Uint8Array"===e?.constructor?.name}function s(e){return"Uint8ClampedArray"===e?.constructor?.name}function i(e){return"Int16Array"===e?.constructor?.name}function c(e){return"Uint16Array"===e?.constructor?.name}function l(e){return"Int32Array"===e?.constructor?.name}function f(e){return"Uint32Array"===e?.constructor?.name}function u(e){return"Float16Array"===e?.constructor?.name}function d(e){return"Float32Array"===e?.constructor?.name}function b(e){return"Float64Array"===e?.constructor?.name}function h(e){return"buffer"in e}r.d(t,{IY:()=>i,JI:()=>m,LW:()=>u,OO:()=>_,PI:()=>w,UR:()=>s,XJ:()=>f,_G:()=>l,a3:()=>y,aI:()=>b,dk:()=>g,dz:()=>o,h2:()=>v,iu:()=>h,jq:()=>c,mg:()=>a,mw:()=>n,vZ:()=>d,y9:()=>p}),r(44208);const p=1024;function m(e){return b(e)||d(e)||l(e)||i(e)||o(e)}function g(e){return b(e)||d(e)}function y(e){return b(e)?179769e303:u(e)?65504:d(e)?3402823e32:f(e)?4294967295:c(e)?65535:a(e)||s(e)?255:l(e)?2147483647:i(e)?32767:o(e)?127:256}const w=-32768,v=-2147483648;function _(e){return e}},36563:(e,t,r)=>{"use strict";r.d(t,{Bf:()=>i,hA:()=>o,rE:()=>s,vE:()=>a});const n={remove:()=>{}};function o(e){return e?{remove(){e&&(e(),e=void 0)}}:n}function a(e){return o(()=>function(e){e.forEach(e=>e?.remove())}(e))}function s(e){return o(()=>e?.abort())}function i(e){return{[Symbol.dispose](){e.remove()}}}},37955:(e,t,r)=>{"use strict";r.d(t,{Oo:()=>i,on:()=>s,wb:()=>o});var n=r(36563);function o(e){return function(e){return null!=e&&"object"==typeof e&&"on"in e&&"function"==typeof e.on}(e)||a(e)}function a(e){return null!=e&&"object"==typeof e&&"addEventListener"in e&&"function"==typeof e.addEventListener}function s(e,t,r){if(!o(e))throw new TypeError("target is not a Evented or EventTarget object");return a(e)?function(e,t,r,o){if(Array.isArray(t)){const a=t.slice();for(const t of a)e.addEventListener(t,r,o);return(0,n.hA)(()=>{for(const t of a)e.removeEventListener(t,r,o)})}return e.addEventListener(t,r,o),(0,n.hA)(()=>e.removeEventListener(t,r,o))}(e,t,r):e.on(t,r)}function i(e,t,r){if(!o(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const n=s(e,t,t=>{n.remove(),r.call(e,t)});return n}},39131:(e,t,r)=>{"use strict";r.d(t,{$E:()=>s,py:()=>a,qG:()=>i});const n=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,o={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function a(e){const t=e?.match(n);if(!t)return null;const[,r,a,s]=t;if(!r)return null;let i=null,c=null,l=null;const{devext:f,qaext:u,www:d}=o;if(a)if(i=r,s)switch(s.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=f);break;case"qa":({customBaseUrl:c,portalHostname:l}=u);break;default:return null}else({customBaseUrl:c,portalHostname:l}=d);else switch(r.toLowerCase()){case"devext":({customBaseUrl:c,portalHostname:l}=f);break;case"qaext":({customBaseUrl:c,portalHostname:l}=u);break;case"www":({customBaseUrl:c,portalHostname:l}=d);break;default:return null}return{customBaseUrl:c,isPortal:!1,portalHostname:l,urlKey:i}}function s(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}function i(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,n=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):n.test(e)&&(e=e.replace(n,"https://qaext.arcgis.com")),e}},44208:(e,t,r)=>{"use strict";let n;r.d(t,{A:()=>a});const o=globalThis;function a(e){return"function"==typeof n[e]?n[e]=n[e](o):n[e]}n=o.dojoConfig?.has||o.esriConfig?.has?{...o.dojoConfig?.has,...o.esriConfig?.has}:{},a.add=(e,t,r,o)=>{(o||void 0===n[e])&&(n[e]=t),r&&a(e)},a.cache=n,a.add("big-integer-warning-enabled",!0),a.add("esri-deprecation-warnings",!0),a.add("esri-tests-disable-screenshots",!1),a.add("esri-tests-use-full-window",!1),a.add("esri-tests-post-to-influx",!0),a.add("esri-cim-animations-enable-status","enabled"),a.add("esri-cim-animations-spotlight",!1),a.add("esri-cim-animations-freeze-time",!1),(()=>{a.add("host-webworker",void 0!==o.WorkerGlobalScope&&self instanceof o.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(a.add("host-browser",e),a.add("host-node",!("object"!=typeof o.process||!o.process.versions?.node||!o.process.versions.v8)),a.add("dom",e),a("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(a.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),a.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),a.add("khtml",r.includes("Konqueror")?n:void 0),a.add("edge",parseFloat(t.split("Edge/")[1])||void 0),a.add("opr",parseFloat(t.split("OPR/")[1])||void 0),a.add("webkit",!a("wp")&&!a("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),a.add("chrome",!a("edge")&&!a("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),a.add("android",!a("wp")&&parseFloat(t.split("Android ")[1])||void 0),a.add("safari",!r.includes("Safari")||a("wp")||a("chrome")||a("android")||a("edge")||a("opr")?void 0:parseFloat(r.split("Version/")[1])),a.add("mac",r.includes("Macintosh")),!a("wp")&&/(iPhone|iPod|iPad)/.test(t)){const e=RegExp.$1.replace(/P/,"p"),r=/OS ([\d_]+)/.test(t)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replaceAll("_",""));a.add(e,n),a.add("ios",n)}a("webkit")||(!t.includes("Gecko")||a("wp")||a("khtml")||a("edge")||a.add("mozilla",n),a("mozilla")&&a.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(o.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&a.add("esri-mobile",t),r&&a.add("esri-iPhone",r),a.add("esri-geolocation",!!navigator.geolocation)}a.add("esri-wasm","WebAssembly"in o),a.add("esri-performance-mode-frames-between-render",20),a.add("esri-force-performance-mode",!1),a.add("esri-shared-array-buffer",()=>{const e="SharedArrayBuffer"in o,t=!1===o.crossOriginIsolated;return e&&!t}),a.add("wasm-simd",()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]))),a.add("esri-atomics","Atomics"in o),a.add("esri-workers","Worker"in o),a.add("web-feat:cache","caches"in o),a.add("esri-workers-arraybuffer-transfer",!a("safari")||Number(a("safari"))>=12),a.add("workers-pool-size",8),a.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),a.add("featurelayer-simplify-payload-size-factors",[1,1,4]),a.add("featurelayer-fast-triangulation-enabled",!0),a.add("featurelayer-animation-enabled",!0),a.add("featurelayer-snapshot-enabled",!0),a.add("featurelayer-snapshot-initial-tolerance",0),a.add("featurelayer-snapshot-point-min-threshold",8e4),a.add("featurelayer-snapshot-point-max-threshold",4e5),a.add("featurelayer-snapshot-multipoint-min-threshold",2e4),a.add("featurelayer-snapshot-multipoint-max-threshold",1e5),a.add("featurelayer-snapshot-polygon-min-threshold",2e3),a.add("featurelayer-snapshot-polygon-max-threshold",2e3),a.add("featurelayer-snapshot-polyline-min-threshold",2e3),a.add("featurelayer-snapshot-polyline-max-threshold",2e3),a.add("featurelayer-snapshot-max-vertex-count",25e4),a.add("featurelayer-snapshot-non-hosted-exceedslimit-enabled",!0),a.add("featurelayer-snapshot-concurrency",4),a.add("featurelayer-snapshot-coverage",.1),a.add("featurelayer-query-max-depth",4),a.add("featurelayer-query-pausing-enabled",!1),a.add("featurelayer-query-tile-concurrency",4),a.add("featurelayer-query-tile-max-features",6e5),a.add("featurelayer-advanced-symbols",!1),a.add("featurelayer-pbf",!0),a.add("featurelayer-pbf-statistics",!1),a.add("feature-layers-workers",!0),a.add("feature-polyline-generalization-factor",1),a.add("mapview-transitions-duration",200),a.add("mapview-essential-goto-duration",200),a.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),a.add("mapserver-pbf-version-support",10.81),a.add("mapservice-popup-identify-max-tolerance",20),a.add("request-queue-concurrency-hosted",16),a.add("request-queue-concurrency-non-hosted",4),a.add("curve-densification-coarse-segments",128),a.add("curve-densification-max-segments",2e3),a.add("curve-densification-min-segments",3),a.add("curve-densification-pixel-deviation",.5),a.add("view-readyState-waiting-delay",1e3),a.add("gradient-depth-bias",.01),a.add("gradient-depth-epsilon",1e-8),a.add("enable-feature:esri-compress-textures",!0),a("host-webworker")||a("host-browser")&&(a.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),a.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})()},49186:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(4718),o=r(53966),a=r(79907);class s extends a.A{constructor(e,t,r){super(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.o8)(t)}catch(e){return"[object]"}}))}}catch(e){throw o.A.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new s(e.name,e.message,e.details)}}s.prototype.type="error"},52268:(e,t,r)=>{"use strict";function n(e,t){return new Proxy({},{get:(r,n,o)=>(...r)=>{let o,a;const s=r[r.length-1];return function(e){return"object"==typeof e&&!Array.isArray(e)&&null!=e&&("signal"in e||"transferList"in e||0===Object.keys(e).length)}(s)&&(o=s.signal,a=s.transferList,r.pop()),e.apply(t?`${t}.${n.toString()}`:n.toString(),r,{transferList:a,signal:o})}})}r.d(t,{L:()=>n})},53966:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(92602),o=(r(44208),r(799));const a={info:0,warn:1,error:2,none:3};class s{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,s._loggers.set(this.module,this);const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=s.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){}static get test(){}static getLogger(e){return e="string"!=typeof e?e.declaredClass:e,s._loggers.get(e)||new s({module:e})}static{this._loggers=new Map}static{this._tickCounter=0}static{this._tickCounterScheduled=!1}static{this._throttlingDisabled=!1}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!s._throttlingDisabled){const n=function(...e){return(0,o.Wm)(JSON.stringify(e,(e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]"))}(r),a=this._loggedMessages[e].get(n);if("once"===t&&null!=a||"oncePerTick"===t&&a&&a>=s._tickCounter)return;this._loggedMessages[e].set(n,s._tickCounter),s._scheduleTickCounterIncrement()}for(const t of n.A.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;null!=r;){const t=r[e];if(null!=t)return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",i)}_matchLevel(e){const t=n.A.log.level||"warn";return a[this._parentWithMember("level",t)]<=a[e]}static _scheduleTickCounterIncrement(){s._tickCounterScheduled||(s._tickCounterScheduled=!0,Promise.resolve().then(()=>{s._tickCounter++,s._tickCounterScheduled=!1}))}}function i(e,t,...r){console[e](`[${t}]`,...r)}},61322:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var n=r(70333),o=r(49186),a=r(37955),s=r(36563),i=r(97768),c=r(74887),l=r(52268);const f={statsWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(9476),r.e(3009)]).then(r.bind(r,33009)),geometryEngineWorker:()=>Promise.all([r.e(3209),r.e(8887)]).then(r.bind(r,68887)),arcadeGeometryOperatorsWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(6357)]).then(r.bind(r,1123)),CSVSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(9536)]).then(r.bind(r,40752)),EdgeProcessingWorker:()=>Promise.all([r.e(431),r.e(135)]).then(r.bind(r,71936)),ElevationSamplerWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8487),r.e(5845)]).then(r.bind(r,38419)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(7603),r.e(1956),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(7115),r.e(8702)]).then(r.bind(r,12543)),GaussianSplatSortWorker:()=>r.e(5856).then(r.bind(r,35856)),GeoJSONSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(860)]).then(r.bind(r,71202)),LercWorker:()=>r.e(7087).then(r.bind(r,57087)),MemorySourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(1360)]).then(r.bind(r,29432)),PBFDecoderWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(8140)]).then(r.bind(r,39078)),FeaturePipelineWorker:()=>Promise.all([r.e(7603),r.e(5323),r.e(8303),r.e(1956),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(8786),r.e(7115),r.e(3443),r.e(5363),r.e(3117)]).then(r.bind(r,93117)),PointCloudWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(2603),r.e(7005),r.e(7984),r.e(7242)]).then(r.bind(r,34142)),RasterWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(3356),r.e(6049),r.e(7449)]).then(r.bind(r,30139)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4946),r.e(2603),r.e(431),r.e(2504)]).then(r.bind(r,27444)),SceneLayerWorker:()=>Promise.all([r.e(7603),r.e(9953),r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(8256)]).then(r.bind(r,29030)),WFSSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(8969)]).then(r.bind(r,33771)),WorkerTileHandler:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(5897),r.e(3443),r.e(5294)]).then(r.bind(r,69286)),Lyr3DWorker:()=>Promise.all([r.e(2741),r.e(2772)]).then(r.bind(r,72772)),Feature3DPipelineWorker:()=>Promise.all([r.e(7603),r.e(2869),r.e(3910),r.e(5323),r.e(8303),r.e(4903),r.e(1214),r.e(1956),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(7005),r.e(655),r.e(3474),r.e(2883),r.e(4283)]).then(r.bind(r,64183)),TextureCompressionWorker:()=>Promise.all([r.e(2741),r.e(5902)]).then(r.bind(r,95902)),FlowWorker:()=>Promise.all([r.e(4946),r.e(2741),r.e(6791),r.e(4996),r.e(9419),r.e(5007)]).then(r.bind(r,35007)),ParquetSourceWorker:()=>Promise.all([r.e(7603),r.e(4946),r.e(2741),r.e(708),r.e(6791),r.e(4996),r.e(9419),r.e(1882),r.e(2603),r.e(8368),r.e(4800),r.e(4649),r.e(9476),r.e(8786),r.e(4841)]).then(r.bind(r,6557)),PanoramicMeshWorker:()=>r.e(6982).then(r.bind(r,96982))};var u=r(8341),d=r(18357);const{CLOSE:b,ABORT:h,INVOKE:p,RESPONSE:m,OPEN_PORT:g,ON:y}=u.Go;class w{constructor(e){this._invoke=e,this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._timer=null,this._process=this._process.bind(this)}push(e){e.type===h?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 v{static{this.kernelInfo={buildDate:d.$,fullVersion:n.ol,revision:d.u}}static{this.clients=new Map}static connect(e,t){const r=new MessageChannel;let n;n="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const o=new v(r.port1,{channel:r,client:n,schedule:t});return"object"==typeof n&&"remoteClient"in n&&(n.remoteClient=o),v.clients.set(o,n),r.port2}static loadWorker(e){const t=f[e];return t?t():Promise.resolve(null)}constructor(e,t,r,n){this._port=e,this._jobQueue=r,this._lowPriorityJobQueue=n,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new w(e=>this._onInvokeMessage(e)),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:b}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){return this.apply(e,[t],r)}apply(e,t,r){const n=r?.signal,a=r?.transferList;if(!this._port)return Promise.reject(new o.A(u.T,`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const s=(0,u.Jc)();return new Promise((r,o)=>{if((0,c.G4)(n))return this._processWork(),void o((0,c.NK)());const l=(0,c.u7)(n,()=>{const e=this._outJobs.get(s);e&&(this._outJobs.delete(s),this._processWork(),(0,i.xt)(e.abortHandle),this._post({type:h,jobId:s}),o((0,c.NK)()))}),f={resolve:r,reject:o,abortHandle:l,debugInfo:e};this._outJobs.set(s,f),this._post({type:p,jobId:s,methodName:e,abortable:null!=n},t,a)})}createInvokeProxy(e){return(0,l.L)(this,e)}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:y,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),(0,s.hA)(()=>{r.port1.postMessage({type:b}),r.port1.close(),r.port1.removeEventListener("message",n)})}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:g,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._jobQueue?.pop()??this._lowPriorityJobQueue?.pop();if(!e)return;const{methodName:t,data:r,invokeOptions:n,resolver:o}=e;this.apply(t,r,n).then(e=>o.resolve(e)).catch(e=>o.reject(e))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(e=>{(0,i.xt)(e.abortHandle),e.reject((0,c.NK)(`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,this._onMessage=null,this._channel=null,this._jobQueue=void 0,this._invokeQueue=void 0,this._lowPriorityJobQueue=void 0}_onMessage(e){null!=this._schedule?this._schedule(()=>this._processMessage(e,!0)):this._processMessage(e,!1)}_processMessage(e,t){const r=(0,u.VI)(e);if(r)switch(r.type){case m:this._onResponseMessage(r);break;case p:t?this._onInvokeMessage(r):this._invokeQueue.push(r);break;case h:this._onAbortMessage(r);break;case b:this._onCloseMessage();break;case g:this._onOpenPortMessage(r);break;case y:this._onOnMessage(r)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&v.clients.get(this)===e&&e.destroy(),v.clients.delete(this),e?.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n=[],abortable:o}=e,a=o?new AbortController:null,s=this._inJobs;let i,l=this._client,f=l[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)l=l[e[t]],f=l[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);n.push({client:this,signal:a?a.signal:null}),i=f.apply(l,n)}catch(e){return void this._post({type:m,jobId:r,error:(0,u.mF)(e)})}(0,c.$X)(i)?(s.set(r,{controller:a,promise:i}),i.then(e=>{s.has(r)&&(s.delete(r),this._post({type:m,jobId:r},e))},e=>{s.has(r)&&(s.delete(r),(0,c.zf)(e)||this._post({type:m,jobId:r,error:(0,u.mF)(e||{message:`Error encountered at method ${t}`})}))})):this._post({type:m,jobId:r},i)}_onOpenPortMessage(e){new v(e.port,{client:this._client})}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,e=>{t.postMessage(e)}),n=(0,a.on)(e.port,"message",e=>{const o=(0,u.VI)(e);o?.type===b&&(n.remove(),r.remove(),t.close())})}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,a=this._outJobs;if(!a.has(t))return;const s=a.get(t);a.delete(t),this._processWork(),(0,i.xt)(s.abortHandle),r?s.reject(o.A.fromJSON(JSON.parse(r))):s.resolve(n)}_post(e,t,r){return(0,u.u1)(this._port,e,t,r)}}},70333:(e,t,r)=>{"use strict";r.d(t,{Aq:()=>c,Y3:()=>l,id:()=>s,ol:()=>i,rE:()=>a});var n=r(44208),o=r(84952);Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const a="4.34";let s,i=a;function c(e){s=e}function l(e){const t=s?.findCredential(e);return t?.token?(0,o.rs)(e,"token",t.token):e}i="4.34.0-next.91",(0,n.A)("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),(0,n.A)("host-webworker")},74887:(e,t,r)=>{"use strict";r.d(t,{Pl:()=>O,Ol:()=>k,nA:()=>_,NK:()=>l,Tw:()=>x,sg:()=>S,Lx:()=>v,QZ:()=>w,zf:()=>y,G4:()=>d,$X:()=>P,u7:()=>p,NY:()=>m,hn:()=>j,Mq:()=>u,QP:()=>b,Te:()=>f,jH:()=>h,NO:()=>M,z7:()=>A,qr:()=>g});var n=r(36563);const o=(a=globalThis,{setTimeout:(e,t)=>{const r=a.setTimeout(e,t);return(0,n.hA)(()=>a.clearTimeout(r))}});var a,s=r(49186),i=r(37955),c=(r(53966),r(97768));function l(e="Aborted"){return new s.A("AbortError",e)}function f(e,t="Aborted"){if(d(e))throw l(t)}function u(e){return e instanceof AbortSignal?e:e?.signal??void 0}function d(e){const t=u(e);return null!=t&&t.aborted}function b(e){if(y(e))throw e}function h(e){if(!y(e))throw e}function p(e,t){const r=u(e);if(null!=r){if(!r.aborted)return(0,i.Oo)(r,"abort",()=>t());t()}}function m(e,t){const r=u(e);if(null!=r)return f(r),(0,i.Oo)(r,"abort",()=>t(l()))}function g(e,t){return null==u(t)?e:new Promise((r,n)=>{let o=p(t,()=>n(l()));const a=()=>{o=(0,c.xt)(o)};e.then(a,a),e.then(r,n)})}function y(e){return"AbortError"===e?.name}async function w(e){try{return await e}catch(e){if(!y(e))throw e;return}}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map(t=>e[t]),n=await v(r),o={};return t.map((e,t)=>o[e]=n[t]),o}const t=e;return Promise.allSettled(t).then(e=>Array.from(t,(t,r)=>{const n=e[r];return"fulfilled"===n.status?{promise:t,value:n.value}:{promise:t,error:n.reason}}))}async function _(e){return(await Promise.allSettled(e)).filter(e=>"fulfilled"===e.status).map(e=>e.value)}async function k(e){return(await Promise.allSettled(e)).filter(e=>"rejected"===e.status).map(e=>e.reason)}function O(e,t=void 0,r){const n=new AbortController;return p(r,()=>n.abort()),new Promise((r,o)=>{let a=setTimeout(()=>{a=0,r(t)},e);p(n,()=>{a&&(clearTimeout(a),o(l()))})})}function P(e){return e&&"function"==typeof e.then}function A(e){return P(e)?e:Promise.resolve(e)}function S(e,t=-1){let r,n,o,a,s=null;const i=(...c)=>{if(r){n=c,a&&a.reject(l()),a=x();const e=a.promise;if(s){const e=s;s=null,e.abort()}return e}if(o=a||x(),a=null,t>0){const n=new AbortController;r=A(e(...c,n.signal));const o=r;O(t).then(()=>{r===o&&(a?n.abort():s=n)})}else r=1,r=A(e(...c));const f=()=>{const e=n;n=o=r=s=null,null!=e&&i(...e)},u=r,d=o;return u.then(f,f),u.then(d.resolve,d.reject),d.promise};return i}function x(){let e,t;const r=new Promise((r,n)=>{e=r,t=n}),n=t=>{e(t)};return n.resolve=t=>e(t),n.reject=e=>t(e),n.timeout=(e,t)=>o.setTimeout(()=>n.reject(t),e),n.promise=r,n}function j(e,t){t.then(e.resolve,e.reject)}async function M(e){await Promise.resolve(),f(e)}},79907:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(93637);class o{constructor(e,t,r=void 0){this.name=e,this.details=r,this.message=(t&&function(e,t){return e.replaceAll(/\$\{([^\s:}]*)(?::([^\s:}]+))?\}/g,(e,r)=>""===r?"$":((0,n.wc)(r,t)??"").toString())}(t,r))??""}toString(){return"["+this.name+"]: "+this.message}}},84952:(e,t,r)=>{"use strict";r.d(t,{$1:()=>Z,$z:()=>Q,An:()=>x,BQ:()=>ae,DB:()=>X,FL:()=>F,FX:()=>J,Hg:()=>re,Il:()=>be,Ln:()=>ge,N9:()=>oe,S8:()=>D,T1:()=>pe,UC:()=>he,V1:()=>H,Xq:()=>A,Zo:()=>ke,_0:()=>Pe,a6:()=>_e,b8:()=>R,e7:()=>de,fj:()=>G,gd:()=>S,hf:()=>me,lJ:()=>Y,lM:()=>ce,m3:()=>ie,nM:()=>ue,oP:()=>K,oy:()=>N,r$:()=>te,rs:()=>ve,s0:()=>_,s2:()=>B,sC:()=>q,s_:()=>C,tk:()=>ne,ut:()=>L,w8:()=>V,x0:()=>M,xw:()=>Oe,yM:()=>$,zf:()=>j,zi:()=>we,zs:()=>T});var n=r(92602),o=r(4576),a=r(49186),s=r(53966),i=r(12195),c=r(39131),l=r(26306);const f=()=>s.A.getLogger("esri.core.urlUtils"),u=n.A.request,d="esri/config: esriConfig.request.proxyUrl is not set.",b=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,h=/^\s*http:/i,p=/^\s*https:/i,m=/^\s*file:/i,g=/:\d+$/,y=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,w=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),v=new RegExp("^((([^[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^[:]*))(:([0-9]+))?$");class _{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=this.uri.match(w);this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=this.authority.match(v),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const k={};let O=new _(n.A.applicationUrl);let P=function(){const e=O.path,t=e.slice(0,e.lastIndexOf("/")+1);return`${O.scheme}://${O.host}${null!=O.port?`:${O.port}`:""}${t}`}();const A=()=>O,S=()=>P;function x(e){if(!e)return null;const t={path:null,query:null},r=new _(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.slice(0,n),t.query=j(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.slice(0,t.path.length-(r.fragment.length+1)))),t}function j(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let a=r[n];"string"==typeof a&&(a=r[n]=[a]),Array.isArray(a)?a.push(o):r[n]=o}return r}function M(e,t){return e?t&&"function"==typeof t?Object.keys(e).map(r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r]))).join("&"):Object.keys(e).map(r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",a=t?.[r];return a?o+encodeURIComponent(a(n)):Array.isArray(n)?n.map(e=>(0,i.W)(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e)).join("&"):(0,i.W)(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)}).filter(e=>e).join("&"):""}function C(e=!1){let t,r=u.proxyUrl;if("string"==typeof e){t=ie(e);const n=T(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw f().warn(d),new a.A("urlUtils:proxy-not-set",d);return t&&le()&&(r=ce(r)),x(r)}function $(e,t=!1){const r=T(e);let n,o;if(r){const e=E(r.proxyUrl);n=e.path,o=e.query?j(e.query):null}else if(t){const t=C(e);n=t.path,o=t.query}if(n){const t=x(e);e=n+"?"+t.path;const r=M({...o,...t.query});r&&(e=`${e}?${r}`)}return e}const I={path:"",query:""};function E(e){const t=e.indexOf("?");return-1!==t?(I.path=e.slice(0,t),I.query=e.slice(t+1)):(I.path=e,I.query=null),I}function W(e){return(e=fe(e=be(e=E(e).path),!0)).toLowerCase()}function N(e){const t={proxyUrl:e.proxyUrl,urlPrefix:W(e.urlPrefix)},r=u.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(n.startsWith(t)){if(n.length===t.length)return-1;o=e;break}t.startsWith(n)&&(o=e+1)}return r.splice(o,0,t),o}function T(e){const t=u.proxyRules,r=W(e);for(let e=0;e<t.length;e++)if(r.startsWith(t[e].urlPrefix))return t[e]}function R(e,t){if(!e||!t)return!1;e=U(e),t=U(t);const r=(0,c.py)(e),n=(0,c.py)(t);return null!=r&&null!=n?r.portalHostname===n.portalHostname:null==r&&null==n&&J(e,t,!0)}function L(e,t){return e=U(e),t=U(t),fe(e)===fe(t)}function U(e){const t=(e=D(e)).indexOf("/sharing");return t>0?e.slice(0,t):e.replace(/\/+$/,"")}function q(e,t=u.interceptors){const r=t=>t instanceof RegExp?t.test(e):"string"==typeof t?e.startsWith(t):null==t;if(t)for(const e of t)if(Array.isArray(e.urls)){if(e.urls.some(r))return e}else if(r(e.urls))return e;return null}function J(e,t,r=!1){if(!e||!t)return!1;const n=ye(e),o=ye(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function F(e){if("string"==typeof e){if(!K(e))return!0;e=ye(e)}if(J(e,O))return!0;const t=u.trustedServers||[];for(let r=0;r<t.length;r++){const n=z(t[r]);for(let t=0;t<n.length;t++)if(J(e,n[t]))return!0}return!1}function z(e){return k[e]||(se(e)||ae(e)?k[e]=[new _(B(e))]:k[e]=[new _(`http://${e}`),new _(`https://${e}`)]),k[e]}function B(e,t=P,r){return ae(e)?r?.preserveProtocolRelative?e:"http"===O.scheme&&O.authority===Q(e).slice(2)?`http:${e}`:`https:${e}`:se(e)?e:G(e.startsWith("/")?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e)}function H(e,t=P,r){if(null==e||!K(e))return e;const n=D(e),o=n.toLowerCase(),a=D(t).toLowerCase().replace(/\/+$/,""),s=r?D(r).toLowerCase().replace(/\/+$/,""):null;if(s&&!a.startsWith(s))return e;const i=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=i(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===a.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=i(o,"/",c+1);if(-1===l)return e;if(s&&l<s.length)return e;e=n.slice(l);const f=a.slice(l-1).replaceAll(/[^/]+/g,"").length;if(f>0)for(let t=0;t<f;t++)e=`../${e}`;else e=`./${e}`;return e}function D(e){return function(e){const t=u.httpsDomains;if(!function(e){return null!=e&&h.test(e)||"http"===O.scheme&&ae(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),g.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===O.scheme&&n===O.authority&&!y.test(e)||(le()&&n===O.authority||t&&t.some(e=>n===e||n.endsWith(`.${e}`))||le()&&!T(e))&&(e=ce(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=E(e);e=(e=t.path.replaceAll(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=B(e=e.trim()))))}function G(...e){const t=e.filter(o.Ru);if(!t?.length)return;const r=[];if(K(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return null!=e&&m.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else t[0].startsWith("/")&&r.push("");const n=t.reduce((e,t)=>t?e.concat(t.split("/")):e,[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function Q(e,t=!1){if(null==e||V(e)||X(e))return null;let r=e.indexOf("://");if(-1===r&&ae(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=fe(e,!0)),e}function K(e){return ae(e)||se(e)}function V(e){return null!=e&&e.startsWith("blob:")}function X(e){return null!=e&&e.startsWith("data:")}function Y(e){const t=te(e);return t?.isBase64?(0,l.M)(t.data):null}function Z(e){return(0,l.Y)(e).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const ee=/^data:(.*?)(;base64)?,(.*)$/;function te(e){const t=e.match(ee);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function re(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}async function ne(e){return(await fetch(e)).blob()}function oe(e){const t=Y(e);if(!t)return null;const r=te(e);return new Blob([t],{type:r.mediaType})}function ae(e){return null!=e&&e.startsWith("/")&&"/"===e[1]}function se(e){return null!=e&&b.test(e)}function ie(e){return null!=e&&p.test(e)||"https"===O.scheme&&ae(e)}function ce(e){return ae(e)?`https:${e}`:e.replace(h,"https:")}function le(){return"https"===O.scheme}function fe(e,t=!1){return ae(e)?e.slice(2):(e=e.replace(b,""),t&&e.length>1&&e.startsWith("/")&&"/"===e[1]&&(e=e.slice(2)),e)}function ue(e){let t=0;if(K(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function de(e,t){if(!e)return"";const r=x(e).path.replace(/\/+$/,""),n=r.slice(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`\\.(${t.join("|")})$`,"i");return n.replace(o,"")}function be(e){return e.endsWith("/")?e:`${e}/`}function he(e){return e.replace(/\/+$/,"")}function pe(e,t,r){if(!(t&&r&&e&&K(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),a=e.indexOf(":",n+2),s=Math.min(o<0?e.length:o,a<0?e.length:a);return e.slice(n+2,s).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(s)}`}function me(e,t){const r=new URL(e);return r.host=t,r.port&&!g.test(t)&&(r.port=""),r.toString()}function ge(e){return new URL(e).host}function ye(e){return"string"==typeof e?new _(B(e)):(e.scheme||(e.scheme=O.scheme),e)}function we(e,t){const r=x(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function ve(e,t,r){const n=x(e),o=n.query||{};return o[t]=String(r),`${n.path}?${M(o)}`}function _e(e,t){if(!t)return e;const r=x(e),n=r.query||{};for(const[e,r]of Object.entries(t))null!=r&&(n[e]=r);const o=M(n);return o?`${r.path}?${o}`:r.path}function ke(e){if(null==e)return null;const t=e.match(Ae);return t?t[2]:null}function Oe(e){if(null==e)return null;const t=e.match(Ae);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}async function Pe(e){return"string"==typeof e?te(e)??{data:e}:new Promise((t,r)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(te(n.result)),n.onerror=e=>r(e)})}const Ae=/([^.]*)\.([^/]*)$/},87811:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});class n{static{this._m=2147483647}static{this._a=48271}static{this._c=0}constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}},92602:(e,t,r)=>{"use strict";r.d(t,{A:()=>o}),r(44208);var n=r(93637);const o={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.$N)(o,globalThis.esriConfig,!0),delete o.has),!o.assetsPath){{const e="4.34.0-next.91";o.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}o.defaultAssetsPath=o.assetsPath}},93637:(e,t,r)=>{"use strict";r.d(t,{$N:()=>o,a4:()=>u,i7:()=>f,i8:()=>i,sM:()=>s,wc:()=>a});var n=r(4718);function o(e,t,r=!1){return l(e,t,r)}function a(e,t){if(null!=t)return t[e]||c(e.split("."),!1,t)}function s(e,t,r){const n=e.split("."),o=n.pop(),a=c(n,!0,r);a&&o&&(a[o]=t)}function i(e,t){if(null==e&&null==t)return!1;if(null==e)return!0;if(null==t)return!0;if("object"==typeof e){if(Array.isArray(e)){const r=t;if(e.length!==r.length)return!0;for(let t=0;t<e.length;t++)if(i(e[t],r[t]))return!0;return!1}if(Object.keys(e).length!==Object.keys(t).length)return!0;for(const r in e)if(i(e[r],t[r]))return!0;return!1}return e!==t}function c(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function l(e,t,r){return t?Object.keys(t).reduce((e,o)=>{if("__proto__"===o)return e;let a=e[o],s=t[o];return a===s?e:void 0===a?(e[o]=(0,n.o8)(s),e):(Array.isArray(s)||Array.isArray(e)?(a=a?Array.isArray(a)?e[o]=a.slice():e[o]=[a]:e[o]=[],s&&(Array.isArray(s)||(s=[s]),r?s.forEach(e=>{a.includes(e)||a.push(e)}):e[o]=s.slice())):s&&"object"==typeof s?e[o]=l(a,s,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=s),e)},e||{}):e}function f(e,t){for(const r of Object.entries(e))if(t===r[1])return r[0]}function u(e,t){return Object.values(e).includes(t)}},97768:(e,t,r)=>{"use strict";function n(e,t){if(null==e)throw new Error(t??"value is None")}function o(e){return e?.destroy(),null}function a(e){return e?.dispose(),null}function s(e){return e?.remove(),null}function i(e){return e?.abort(),null}function c(e){return e?.release(),null}function l(e,t,r){return null!=e&&null!=t?null!=r?r(e,t):e.equals(t):e===t}function f(e,t){let r;return e.some((e,n)=>(r=t(e,n),null!=r)),r??void 0}r.d(t,{CM:()=>l,DC:()=>i,Gz:()=>c,Lw:()=>n,Pb:()=>f,WD:()=>a,pR:()=>o,xt:()=>s})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,n)=>(r.f[n](e,t),t),[])),r.u=e=>"chunks/"+{36:"c547692862df95d22818",61:"bb0a1be03bb9d621432c",73:"19bd0b56d82446dbb7c5",132:"71c6c0b26253c4ca1b68",135:"45aeff2f751f124f8e53",146:"3c3b1dc95f03082e4d5b",168:"46ef545d2b3b3f4e6d32",177:"e5a9c37de44508e9733b",191:"09b77f82c22530b44daa",217:"6391ce002fbde9f27a77",224:"f651c05604eab83aef5f",309:"65e279516170ddbd4a65",353:"04bac7bb3f794b33e2e4",364:"3d800fbc449bea18b1cd",369:"af00081b78fc30ac556c",382:"b0e52c3775f05aaf7ff6",390:"41f487713c6278d389a1",427:"c954d281038f6bf80232",431:"c27783ce7ea51a5e49c5",489:"1214c126af0de25a4b4a",490:"4823e4522bd7379d858e",547:"8736b78256037b145f8b",563:"31c6e951b99315e8e68a",573:"8cae725e631d922853c8",588:"c3020747f9001ca6a6e7",591:"a17ed7ce97e69466d730",603:"baa48614d9567d5f240d",624:"52121179d4f9833008ec",647:"48b9ba825856a0c843ff",655:"56de25a6fe659a5b5c2b",692:"05aac984cbbadb5f6aa0",708:"5ea03f53d4d64d9e7cae",744:"648c91a9822bc9d6ee47",788:"ff8e2f998169ca3a7a68",795:"9f2a3f37fe9b19ef1209",807:"f6ce485c082d0d640b01",812:"71fef0a33b7ed9456e47",820:"3c5f07ebe1b09dcdc958",860:"3e11a893271caa11a881",873:"77e611724a499d36eacc",957:"e2fdc4dc1ab9decd731e",979:"cb6a9b43406f4fbe10b2",980:"edaf059c7ea18088c3dd",985:"24921d31efa8d222ad2d",1017:"ce8f56cf371812b57a46",1088:"004c2a1a37b99a184b13",1190:"ce569860b170700e9b31",1197:"35ca317490540fae437c",1204:"e9311386f58f3cb95c22",1214:"009556f323e58271bc7a",1224:"c799f1c03cb22ef52f5f",1273:"d7adef4093ce19ad356d",1277:"6e4ec9fa931c69e4e4ba",1352:"a1a7b0e7ca488c895cb7",1360:"147f6e7b147beaa4ed29",1384:"ed8a85efbd90241512bb",1414:"48c8ef4170e803a564d6",1421:"9a20be3b02c9d6349b8d",1436:"3a457e718a901a45902e",1437:"2e1cc11462846febb3b2",1598:"61a9ffd4cf07d8bb7a9b",1698:"c6cae8471c5d4ae40c65",1713:"70c8f69eed14d55c5cf6",1728:"1f2d13466c60a6b57717",1776:"c20862fe15295a294bbd",1837:"b4349db7155673329432",1863:"393274af1804e5b6046a",1867:"49e6219dd08cb6c27023",1874:"38d874d7f815f5329420",1878:"65fd971d0574d69cbc26",1882:"a6533bab3b2fbc1e2a47",1894:"0b679d5a1bfdbd006d6e",1918:"db81d881805f6f92a2e4",1956:"56edb55b53779e7fd31e",2095:"c7c76a8a1c47eb62bef1",2158:"e537e1d37f3fcb14fce2",2186:"36fe6b8228e622407ec2",2274:"f62717338075df626eda",2288:"0856cd281efd71bfe3c4",2314:"23e17b745adf71a5efc7",2343:"61bb39597ccf89f99a72",2372:"21d7f42c2033de987b97",2390:"a34a14fd989dbbd3c2d0",2409:"29471e0b3f7296dee096",2423:"2d3ae187f8aa3495d4ae",2503:"e0017c6739d2532793e6",2504:"0427f66b56ec6601deb0",2507:"0ca5060c81a1a05b8be3",2515:"41f275401e1cde7eee20",2558:"bbdadced49446c907361",2561:"a845c68e76382a73da5e",2568:"f6806780ca2aa591475a",2593:"ef75cad6570b14a42b62",2603:"2b7f9a57a2cfbc108673",2657:"7f0c78bcba0aed3c4eff",2712:"b661ea374fe38c8e29ca",2741:"9346437b152b20bdcf8a",2764:"d3b1d1c389d70919fb02",2772:"ba6452acee3d6defb37e",2848:"08374e5805fcedc1cb57",2869:"e99fc64b67bb0c71dc34",2883:"4660798b3b45dcb5cecb",2958:"66db5f77e09d25e33951",2980:"eafc4da265469e9e5e0b",3009:"3fe7be535affae31de7e",3054:"348c871657b0af621c33",3081:"100a0041ee42b0b2fa32",3091:"976dd80e318266ab4c2c",3103:"7b17f52019762aa21af8",3116:"8d63b42aea32ce2e5d09",3117:"8f4cfef97716c3502b0f",3169:"e689a4849f5af3f2f641",3209:"e34136ad9d620cb845fd",3236:"1ed7a8f4a0058d3b69ef",3263:"ce16489cf7eb0d78c741",3276:"e5baa30944061418cb13",3285:"98175b454e807b1a3c5f",3299:"c5c6a32a24005478c976",3356:"06aed0a5464965be8d52",3359:"c55c096669677321a227",3367:"7a240ab31d9ff2d2c5af",3390:"94c9d3094c93f7760433",3443:"72ecf49d03bb24bf0998",3444:"fdadf11f31384c09db9f",3474:"633faa9cec8988ab06af",3513:"f88fe2e8fbc763bdc940",3543:"1c52999a6392370844a6",3548:"de34c21d3e6913befe5a",3561:"f03635ddf56e2ef90e4c",3562:"3ff3e1507220d3869c76",3637:"20988e116f3723228f36",3661:"b8f55ee77ab6ea4c289e",3666:"755e2ecd20b6bd1909be",3747:"95bae3c275f1483eb7ed",3779:"00ee2a605c30744f415a",3813:"5ad1985a9e66fb2232ae",3910:"c38360d912f256519e06",3937:"9046a792395da28fa8f7",4038:"c95e6bef8c97cf647869",4045:"0652d7e525d99e39c957",4097:"82d5aa8ba4a67160ea69",4123:"5a6b487b70ca85a45f57",4167:"21f37a4b8d1857369203",4224:"fb6ebb780bb59e252887",4283:"1bbc0dfad4cd72a1c42b",4342:"0037abf0a82d1ed32e91",4383:"56569d0c2cf5c5167651",4496:"80a155496deef2c02a3e",4526:"50d9f69d5255af4b29bb",4575:"0810dbbf348a927392e7",4649:"0aaaf4d1c4a5d284216e",4753:"5c585b338a9e9aa0e205",4784:"47c0c16c1e995a441ec2",4800:"2266a8f2c2ec37c19bb4",4802:"4d807bfe75108438db83",4815:"6688efc71d9d8f4d2559",4841:"b8997ae5893afa0298d1",4903:"1990162dcf73601d54f7",4929:"e0bbfbe1ed39c82f1bd4",4946:"23e600e368ac829680b5",4996:"0e5e565df6ec71445f2e",5007:"57c08ccb75e3135978d1",5066:"c84665db250b05e2829d",5141:"e19cd07df8ce87e18832",5165:"2b867cec6ada339f1c8f",5180:"6cfa0967045068ce8a8b",5181:"282c4f3484c605ce7d5e",5257:"8644c54b4f00c53bab80",5294:"3b2ef975831eb75b40fb",5323:"700b5a536f97233bc4af",5363:"ff6d189ba78980d40bb5",5367:"d48af7bc06b4bb176534",5369:"024063fe2bbb27899094",5404:"fc06014fb484fc8c697e",5455:"a8f998b8ec8c56150479",5549:"6201356f7f91e5c06425",5552:"8a6052b4d163d5088e11",5605:"459a67928bde4a62b6a4",5613:"e22b400636094fc7b6c0",5655:"39a5863355cccaabd2d6",5666:"28a5a7c6b3d6902146f6",5710:"4133ab8720e7e4afa9a6",5740:"620a94b54be3ed78350d",5756:"8bbae8ac586e5c0819d2",5794:"8513c9282c44bb0a736e",5804:"6bb5158de43c4b59107f",5845:"a6a2d4602dfeb62e0ecc",5856:"0b24a6c06d1becbb6815",5874:"cb90cfa35d77ab561939",5890:"1194c2432c31def87db1",5897:"a85acb948cc7d22be592",5902:"19f1bfe815896d4983af",5913:"375f20f2e91d6a7507e8",5924:"d56548a994753b08403c",5971:"c86ca87959f04075e834",6018:"31186e83fe009aa0fd36",6049:"bdf0ab95401c6d8fbc7d",6052:"ab005fe84952f0676020",6129:"0271a2ca4e9b1e4fd284",6154:"a987731d1b5449d8fb0c",6160:"fd34c033ce7f16835368",6187:"388873be1dca91ccbc9d",6339:"4d0e099f34639cda3a9b",6343:"f98689562017583f73ee",6357:"388482cea4b9fdeaf06e",6395:"aa78b69219d9a0ef1c54",6468:"5d15ca055071d7db6de8",6554:"e4833b718a813a8d125b",6558:"82ba4140e30f083fbc87",6650:"28bb6896c5fd353ca5e9",6673:"0328eaea66c1db98da1c",6699:"b265472ac3f949a7f40c",6730:"eea9d49d55c2d1355497",6791:"06c389283ee5b60573f2",6859:"06221ebadab32111e2c6",6982:"3dcdbba706a8034b6ba3",7005:"04dbdaa63c950f32b8f0",7048:"58e2652810143f509fe1",7074:"cf5db995ba88912cf6b7",7087:"0f4e9846d074864b39c2",7115:"83065bef261314f9b2c5",7136:"16d66770ef841564ee3f",7242:"d71836cf70b9604832f1",7243:"c6077a893d5b5c34a46c",7301:"2e6ae1ca07df442fc966",7330:"873008572c1f21cea122",7360:"74881340e040bfd0580f",7367:"79968c183135281d2a6f",7375:"db5a985ccc6b7d0ad855",7444:"ced12ad98f8f48d0dc00",7449:"6aa349e1adf844df4b5b",7464:"143503f6eb270c4683f8",7528:"64c31c90e4c589ca2f04",7546:"d08b80583a23ba253c7e",7548:"cab2a1382bdd32bb34d8",7559:"7f8b85de079614b9c336",7561:"9a0b9d931c1a29e81475",7603:"86832d94190150c70c11",7656:"5993427325d1add18ed9",7677:"a1196637268b89281780",7694:"2bb61f80473b495163e3",7817:"2870723d57aa7b885896",7836:"2845a0810e9c00bf30f8",7883:"68f5a2d2666636c3f807",7982:"b240298b8b643a323d34",7984:"a244afea77127e54dd3a",8010:"5d1d909354c90cb8eb60",8018:"6e5175b43220d6692263",8098:"d6e0528eacee7ea4c1ce",8125:"be06c8a58c217a17451b",8140:"79ab06fb4c91ac8da323",8207:"5b7a2ee44883b1fb2a5f",8241:"b2fbb44e219232e61cbd",8256:"22c3a21bc9f32c429c48",8303:"025f1d78dfa5ec93178b",8344:"f594df2f5ce6ca41a254",8350:"b510c07dfd0d31683b08",8368:"ae6066ea6cb373dc6db3",8377:"9a855a10798348a21bab",8399:"0f37204f86d2997a2811",8411:"5d4b24c864ebb68ae61e",8487:"4753793daf0b7ff8b5ff",8506:"541bffd61006d0e36166",8535:"d9d86cf0500fa29d1d43",8628:"17103e6542aae53c7301",8654:"37b5007660535f1c91c6",8692:"05072093e0209ef5db20",8702:"2605062e44f2d4e73f14",8714:"809a9055da28c8fa58b0",8766:"9d9a639f7388a29e7c96",8786:"14114be3afd6d292f89c",8812:"920b4def081c78c0d586",8887:"08957e462d06c4dc8ab5",8969:"f3284d4e0d41efb0b4a0",8999:"5caf49e679ed0c27e0bd",9e3:"67d9cfe02613cb73ee37",9013:"a5a67216e0d0cee95a55",9036:"614a00a3179f8fe23f45",9041:"b48abbf877e26ed1a4f8",9062:"896c7d137bfd7a8fa0bc",9110:"0ceb68ff73e5d39e837a",9117:"155dcbd957f8787a45c3",9126:"c5cc0fc652432a9264cc",9159:"efa47bccb95514fe953d",9187:"f2b63597ae956db74eb3",9192:"fe6fa1f2c2d54d41645e",9202:"da4163b4f9b34e83c92d",9221:"142c45ad68eecaf3fc7c",9239:"899f493412acd5a5d91f",9240:"512dcd6e34e217029391",9247:"3807d0b9b1894731174d",9263:"ad9606164c694af0c61f",9265:"ab88577987cf2fe1cb32",9279:"6f29951f5a2da068b257",9321:"24ff9dad3fb64ab54970",9361:"779ee975efebb838b5d6",9384:"88cbaa91c495d86f4bb0",9419:"77705d0c7c17bd46d81a",9476:"8ff2daef892881ff2019",9506:"ecc15622d6c434ea842b",9536:"b47f26d6aa9a2848a677",9573:"07a7ca89ef2ca4fc090b",9588:"651b9144abb1895cc510",9644:"edef1e2254c992459c63",9645:"61e8e159f1f336569b27",9647:"b18887a6dc86f0c8324a",9695:"18e9cb71fa020e93d139",9700:"768ae52b4e5c3e571ef5",9718:"8bdbd94a59269e216fba",9838:"a1b08aab73747f4e7e25",9926:"5713f96bade5ebb54c81",9933:"9bb6984f24cd5461a754",9953:"0cfded1acf92f89a13cb"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={76:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,a,s]=t;for(var i in a)r.o(a,i)&&(r.m[i]=a[i]);for(s&&s(r);o.length;)e[o.pop()]=1;n(t)}})(),r(2131);var n=r(61322);RemoteClient=n})();
package/config.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.34/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.90";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.91";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s 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.34/esri/copyright.txt for details.
4
4
  */
5
- function r(r){return r&&"layer"in r?r.layer:void 0}export{r as getGraphicOriginLayer};
5
+ function r(r){return r&&"layer"in r?r.layer:void 0}function e(e){return r(e.origin)??e.sourceLayer??e.layer}export{e as getGraphicLayer,r as getGraphicOriginLayer};
package/interfaces.d.ts CHANGED
@@ -115873,7 +115873,7 @@ declare namespace __esri {
115873
115873
  | "awaiting-update-feature-candidate"
115874
115874
  | "creating-features"
115875
115875
  | "disabled"
115876
- | "drawing-split-geometry"
115876
+ | "drawing-splitter-geometry"
115877
115877
  | "editing-attributes"
115878
115878
  | "editing-attachment"
115879
115879
  | "editing-existing-feature"
@@ -116003,6 +116003,33 @@ declare namespace __esri {
116003
116003
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startCreateFeaturesWorkflowAtFeatureTypeSelection Read more...}
116004
116004
  */
116005
116005
  startCreateFeaturesWorkflowAtFeatureTypeSelection(): Promise<void>;
116006
+ /**
116007
+ * Starts a split feature workflow for the given feature.
116008
+ *
116009
+ * @param feature The feature to be split.
116010
+ * @param options Options for the split feature workflow.
116011
+ *
116012
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startSplitFeatureWorkflow Read more...}
116013
+ */
116014
+ startSplitFeatureWorkflow(feature: Graphic, options: EditorViewModelStartSplitFeatureWorkflowOptions): Promise<void>;
116015
+ /**
116016
+ * Starts a split feature workflow at the "drawing-splitter-geometry" step using the provided feature.
116017
+ *
116018
+ * @param feature The feature to be split.
116019
+ * @param sketchTool The preferred Sketch tool to use for drawing the splitter geometry.
116020
+ *
116021
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startSplitFeatureWorkflowAtDrawingSplitterGeometry Read more...}
116022
+ */
116023
+ startSplitFeatureWorkflowAtDrawingSplitterGeometry(feature: Graphic, sketchTool?: "point" | "polyline" | "polygon"): Promise<void>;
116024
+ /**
116025
+ * Starts a split feature workflow at the "reviewing-features".
116026
+ *
116027
+ * @param feature The feature to be split.
116028
+ * @param splitterGeometry The geometry to use for splitting the given feature.
116029
+ *
116030
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-EditorViewModel.html#startSplitFeatureWorkflowAtReviewingFeatures Read more...}
116031
+ */
116032
+ startSplitFeatureWorkflowAtReviewingFeatures(feature: Graphic, splitterGeometry: Point | Polyline | Polygon): Promise<void>;
116006
116033
  /**
116007
116034
  * Starts an {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-UpdateFeaturesWorkflow.html UpdateFeaturesWorkflow} using
116008
116035
  * the provided features.
@@ -116105,6 +116132,12 @@ declare namespace __esri {
116105
116132
  initialFeature: Graphic;
116106
116133
  }
116107
116134
 
116135
+ export interface EditorViewModelStartSplitFeatureWorkflowOptions {
116136
+ defaultSplitterGeometryType?: "point" | "polyline" | "polygon";
116137
+ splitterGeometry?: Point | Polyline | Polygon;
116138
+ startAt?: "drawing-splitter-geometry" | "reviewing-features";
116139
+ }
116140
+
116108
116141
  export interface EditorViewModelSketchCreateEvent {
116109
116142
  detail: EditorViewModelSketchCreateEventDetail;
116110
116143
  layer: FeatureLayer | SceneLayer | SubtypeSublayer;
@@ -116158,6 +116191,83 @@ declare namespace __esri {
116158
116191
  interface EditsProperties {
116159
116192
  }
116160
116193
 
116194
+ export class SplitFeatureWorkflow extends Workflow {
116195
+ /**
116196
+ * The currently active feature.
116197
+ *
116198
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#activeFeature Read more...}
116199
+ */
116200
+ readonly activeFeature: Graphic | nullish;
116201
+ /**
116202
+ * Specifies the type of geometry to be drawn by the Sketch operation that is
116203
+ * started automatically when the workflow is launched.
116204
+ *
116205
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#defaultSplitterGeometryType Read more...}
116206
+ */
116207
+ defaultSplitterGeometryType: "point" | "polyline" | "polygon" | nullish;
116208
+ /**
116209
+ * The instance of
116210
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm-FeatureFormViewModel.html FeatureFormViewModel} used by the
116211
+ * workflow to manage the attributes of the resulting features.
116212
+ *
116213
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#featureFormViewModel Read more...}
116214
+ */
116215
+ readonly featureFormViewModel: FeatureFormViewModel;
116216
+ /**
116217
+ * The layer to which the feature being split belongs.
116218
+ *
116219
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#layer Read more...}
116220
+ */
116221
+ readonly layer: GeoJSONLayer | FeatureLayer | OrientedImageryLayer | SceneLayer | SubtypeSublayer | nullish;
116222
+ /**
116223
+ * The type of the workflow.
116224
+ *
116225
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#type Read more...}
116226
+ */
116227
+ readonly type: "split-feature";
116228
+ /**
116229
+ * A read-only class containing the logic used when splitting a feature using
116230
+ * the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html Editor} widget.
116231
+ *
116232
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html Read more...}
116233
+ */
116234
+ constructor(properties?: SplitFeatureWorkflowProperties);
116235
+ /**
116236
+ * Sets the specified feature as the active feature in the workflow.
116237
+ *
116238
+ * @param feature The feature to set as active.
116239
+ *
116240
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#setActiveFeature Read more...}
116241
+ */
116242
+ setActiveFeature(feature: Graphic): Promise<void>;
116243
+ }
116244
+
116245
+ interface SplitFeatureWorkflowProperties extends WorkflowProperties {
116246
+ /**
116247
+ * Specifies the type of geometry to be drawn by the Sketch operation that is
116248
+ * started automatically when the workflow is launched.
116249
+ *
116250
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html#defaultSplitterGeometryType Read more...}
116251
+ */
116252
+ defaultSplitterGeometryType?: "point" | "polyline" | "polygon" | nullish;
116253
+ }
116254
+
116255
+ /**
116256
+ * This object contains data for the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html SplitFeatureWorkflow}.
116257
+ *
116258
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflowData.html Read more...}
116259
+ */
116260
+ interface SplitFeatureWorkflowData {
116261
+ editorItem: EditorItem;
116262
+ existingFeatureEdits: Edits | nullish;
116263
+ newFeatureEdits: Edits | nullish;
116264
+ originalFeature: Graphic;
116265
+ splitterGeometry: Point | Polyline | Polygon | nullish;
116266
+ viewModel: EditorViewModel;
116267
+ }
116268
+
116269
+ export const SplitFeatureWorkflowData: SplitFeatureWorkflowData;
116270
+
116161
116271
  export class EditorItem extends Accessor {
116162
116272
  /**
116163
116273
  * The current {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-support-EditorItem.html#EditorEditingCapabilities editing capabilities} for the provided layer.
@@ -116223,6 +116333,12 @@ declare namespace __esri {
116223
116333
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-support-EditorItem.html#supportsCreateFeaturesWorkflow Read more...}
116224
116334
  */
116225
116335
  readonly supportsCreateFeaturesWorkflow: boolean;
116336
+ /**
116337
+ * Indicates whether the item supports starting a new {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-SplitFeatureWorkflow.html split feature} workflow based on specific conditions set within the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html Editor}.
116338
+ *
116339
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-support-EditorItem.html#supportsSplitFeatureWorkflow Read more...}
116340
+ */
116341
+ readonly supportsSplitFeatureWorkflow: boolean;
116226
116342
  /**
116227
116343
  * Indicates whether the item supports starting a new {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-UpdateWorkflow.html update workflow} based on specific conditions set within the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor.html Editor}.
116228
116344
  *
@@ -116463,7 +116579,10 @@ declare namespace __esri {
116463
116579
  *
116464
116580
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Editor-Workflow.html#data Read more...}
116465
116581
  */
116466
- readonly data: CreateFeaturesWorkflowData | UpdateWorkflowData | UpdateFeaturesWorkflowData;
116582
+ readonly data: | CreateFeaturesWorkflowData
116583
+ | SplitFeatureWorkflowData
116584
+ | UpdateWorkflowData
116585
+ | UpdateFeaturesWorkflowData;
116467
116586
  /**
116468
116587
  * This property indicates whether there is a next step in the workflow.
116469
116588
  *
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.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.90",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.91",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.34.0-next.90",
3
+ "version": "4.34.0-next.91",
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.34/esri/copyright.txt for details.
4
4
  */
5
- const c="20250920",d="5c5be205c3bfc5a6d482cebdd09cadc899dd3fe8";export{c as buildDate,d as commitHash};
5
+ const a="20250921",c="6daa3a9703ef8b2a8bc52218c606f4b89423ac32";export{a as buildDate,c 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{unique as t,isSome as i}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import{deprecatedFunction as o}from"../../core/deprecate.js";import s from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import{makeHandle as l}from"../../core/handleUtils.js";import p from"../../core/Logger.js";import{destroyMaybe as d,abortMaybe as c,removeMaybe as u}from"../../core/maybe.js";import{throwIfAborted as h,createResolver as w}from"../../core/promiseUtils.js";import{watch as f,on as m,when as y,syncAndInitial as g,initial as v,sync as k,whenOnce as _}from"../../core/reactiveUtils.js";import{property as M}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as W}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as T}from"../../editing/templateUtils.js";import V from"../../layers/GraphicsLayer.js";import{isEditableLayer as b}from"../../layers/support/editableLayers.js";import{isFeatureLayer as E,isSubtypeGroupLayer as S,getOwningPortalUrl as L}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as I}from"../../portal/support/urlUtils.js";import A from"../../views/SelectionManager.js";import U from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as C}from"../../views/interactive/snapping/SnappingManager.js";import O from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as j}from"../../views/support/selectionUtils.js";import P from"../Attachments/AttachmentsViewModel.js";import R from"./CreateFeaturesWorkflow.js";import H from"./UpdateFeaturesWorkflow.js";import q from"./UpdateWorkflow.js";import{getLayersFromWorkflow as G,isCreateFeaturesWorkflow as x,isUpdateRecordWorkflow as D,isUpdateFeaturesWorkflow as B,isUpdateWorkflow as N,findEditorItemForLayerOrThrow as Q,makeMultipleSourceLayersError as z,findEditorItemForLayer as Z,whenEditorLayerView as $}from"./workflowUtils.js";import J from"./support/EditorItem.js";import{makeTemplateGroupInfoForLayer as K}from"../FeatureTemplates/featureTemplatesUtils.js";import X from"../FeatureTemplates/FeatureTemplatesViewModel.js";import Y from"../Sketch/SketchViewModel.js";import ee from"../Spinner/SpinnerViewModel.js";import{goTo as te}from"../support/goToUtils.js";import{isFeatureItem as ie,isLayerItem as ae}from"../support/SelectionList/selectionListUtils.js";import re from"../support/SelectionList/SelectionListViewModel.js";import oe from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function se(e,t){return e?.find(e=>e.layer===t)}let ne=class extends n{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new V({listMode:"hide",internal:!0,title:"Editor sketch layer"}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new F,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new r,this.editorItems=new r,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new P({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new X({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new Y({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new re,this.selectionManager=new A,this.selectionToolbarViewModel=new oe({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new U,this.snappingOptions=new O({attributeRulesEnabled:!0}),this.spinnerViewModel=new ee,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;this._candidateCommitted||"update"!==i?.type||(i.data.rootFeature=e,t&&(i.next(),this._candidateCommitted=!0))}}initialize(){this.addHandles([f(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,a=i?.filter(e=>!!t?.includes(e.layer));return[t,a,this.layerInfos]},()=>this._updateEditorItems(),g),f(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),f(()=>this._selectionSources,()=>this._syncSelectionSources(),v),m(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),m(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),m(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),f(()=>this.activeWorkflow,e=>this.selectionManager.showHighlight=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),v),m(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),f(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),f(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},g),y(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),m(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const a={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(a);await this.startCreateFeaturesWorkflowAtFeatureCreation(a)}),f(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),m(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),m(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i="update"===t?.type,a=G(t),r=i?t?.activeWorkflow?.parentLayer??void 0:void 0,o=`sketch-${e.type}`;this.emit(o,{type:o,detail:e,layer:a[0],layers:a,parentLayer:r})},k),f(()=>this.view,e=>{if(this._snappingManager=d(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new C({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),f(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),m(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),f(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:a})=>{t.view=e,i.view=e,a.view=e},g),f(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=c(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=u(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new r;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new r;for(const t of this.editorItems)j(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return x(e)?e.pendingFeatures.length:D(e)&&e.data.edits.feature?1:B(e)?e.data.features.length:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&N(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:"update-features"===e?.type?e.formViewModel:null}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type||"update-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associatedLayer)return"viewing-associated-features";if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associationId)return"viewing-associated-layers";if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(D(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.featureFormViewModel.disabled;if(B(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(D(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!B(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await _(()=>!this.updating),!this.canCreate)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(a){this._logErrorAndCancelWorkflow(a)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await _(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,a=i?Q(this.editorItems,i):void 0;if(!a?.supportsCreateFeaturesWorkflow)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const r=this._createCreateFeaturesWorkflow({initialFeature:t,layer:a.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",r),await r.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateFeaturesWorkflow(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");if(t(e.map(e=>e.sourceLayer??e.layer)).length>1)throw z();const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateFeaturesWorkflow(e);this._set("activeWorkflow",t),await t.start()}catch(a){this._logErrorAndCancelWorkflow(a)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature",e);t.addHandles(m(()=>t,"commit",()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)})),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount)throw new s("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new s("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.visibleFeatureItems.map(e=>e.graphic);1===t.length?await this.startUpdateWorkflowAtFeatureEdit(t[0]):await this.startUpdateFeaturesWorkflow(t)}async deleteFeatureFromWorkflow(){o(p.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;return N(e)?e.deleteActiveFeature():B(e)?e.deleteAndCommit():void this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return null!=e&&!0===Z(this.editorItems,e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:t,sketchViewModel:a}=this;if(!t)return;const r=e??a?.createGraphic;if(r)"mesh"===r.geometry?.type?te(t,r.geometry):te(t,r);else{const e=a?.updateGraphics?.toArray();"3d"===t.type&&e?.some(e=>"mesh"===e.geometry?.type)?te(t,e.map(e=>e.geometry).filter(i)):e&&te(t,e)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){ie(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){if(ie(e))await this.startUpdateWorkflowAtFeatureEdit(e.graphic);else if(ae(e)){const t=e.featureItems.filter(e=>e.visible).map(e=>e.graphic);1===t.length?await this.startUpdateWorkflowAtFeatureEdit(t[0]):await this.startUpdateFeaturesWorkflow(t)}}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),l(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,a=i.editableLayers.toArray(),r=i.allTables.toArray().filter(e=>E(e)||S(e));return await Promise.allSettled([...a.flatMap(e=>this._getLayerLoadPromise(e)),...r.flatMap(e=>this._getLayerLoadPromise(e))]),h(e),[...a.reverse(),...r.reverse()].filter(e=>b(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return S(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){c(this._updateItemsTask);const{view:e}=this,t=a(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const a=[],r=[],o=[],{layerInfos:s}=this;for(const l of i){const t=se(s,l),i=await $(e,l).catch(()=>null);(t?a:i?r:o).push(new J({layer:l,layerInfo:t,layerView:i}))}s?.length&&a.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...a,...r,...o];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){c(this._updateTemplatesTask);const e=a(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const a=await T({layers:i.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(const{layer:e,templates:i}of a)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const a of e){const e=t.get(a);e&&e.length>0&&i.push(K(a,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return R.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateFeaturesWorkflow(e){const t=H.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,features:e,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i)});return t.addHandles(m(()=>t,"commit",()=>{t.destroy(),this.activeWorkflow===t&&this._set("activeWorkflow",null)})),t}_createUpdateWorkflow(e,t){return q.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,rootFeature:t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let a=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new s("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(a=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,a)),a}async _applyEdits(e,t,i){let a=null;const r=e.url?await L(e.url):null,o={returnServiceEditsOption:(!r||!I(r))&&!/\/hosted\//i.test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const r=await $(i,e).catch(()=>null);return a=await e.applyEdits(t,o),r&&await _(()=>!r.updating),a}),a}async _applyEditsFeatureService(e,t,i){let a=null;return await this._queueOperation(async()=>a=await e.applyEdits(t,i)),a}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const a={error:i,retry:()=>(t(a,this.failures),this._queueOperation(e)),cancel:()=>{t(a,this.failures)}};this._set("failures",[...this.failures,a])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:a}=e,r=t.find(e=>!!e.error)||a.find(e=>!!e.error)||i.find(e=>!!e.error);if(r)throw r.error}}_createUpdatingResolver(){const e=w();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:a}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,a??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=Q(this.editorItems,e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){p.getLogger(this).error(new s(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:a}=this,r="ready"===this.state,o=1===i.length;if(this._queuedSelectionTool=void 0,r&&o&&"replace"===t)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":a.updateSelection({current:[],added:[],removed:i});break;case"replace":a.clear(),a.updateSelection({current:i,added:[],removed:[]});break;case"add":a.updateSelection({current:i,added:[],removed:[]})}}};e([M()],ne.prototype,"_featureTemplatesLayersAndTables",null),e([M()],ne.prototype,"_queuedSelectionTool",void 0),e([M()],ne.prototype,"_snappingManager",void 0),e([M()],ne.prototype,"_selectionSources",null),e([M()],ne.prototype,"activeFeatureCount",null),e([M({readOnly:!0})],ne.prototype,"activeWorkflow",void 0),e([M()],ne.prototype,"activeLeafWorkflow",null),e([M({readOnly:!0})],ne.prototype,"_activityQueue",void 0),e([M({readOnly:!0})],ne.prototype,"canCreate",null),e([M()],ne.prototype,"canCreateVisible",null),e([M({readOnly:!0})],ne.prototype,"canUpdate",null),e([M()],ne.prototype,"canUpdateVisible",null),e([M()],ne.prototype,"featureTemplatesLayers",null),e([M()],ne.prototype,"editorItems",void 0),e([M()],ne.prototype,"effectiveSelectionManager",null),e([M({readOnly:!0})],ne.prototype,"failures",void 0),e([M()],ne.prototype,"hideTemplatesForInactiveLayers",void 0),e([M({type:P})],ne.prototype,"attachmentsViewModel",void 0),e([M()],ne.prototype,"featureFormViewModel",null),e([M()],ne.prototype,"formViewModel",null),e([M()],ne.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([M({type:X})],ne.prototype,"featureTemplatesViewModel",void 0),e([M()],ne.prototype,"labelOptions",null),e([M()],ne.prototype,"layerInfos",void 0),e([M()],ne.prototype,"ownSketchViewModel",void 0),e([M()],ne.prototype,"selectionListViewModel",void 0),e([M()],ne.prototype,"selectionManager",void 0),e([M()],ne.prototype,"selectionToolbarViewModel",void 0),e([M()],ne.prototype,"sketchOptions",void 0),e([M()],ne.prototype,"sketchViewModel",null),e([M({type:O,nonNullable:!0})],ne.prototype,"snappingOptions",void 0),e([M()],ne.prototype,"spinnerViewModel",void 0),e([M()],ne.prototype,"state",null),e([M({readOnly:!0})],ne.prototype,"syncing",null),e([M()],ne.prototype,"updating",null),e([M()],ne.prototype,"tooltipOptions",null),e([M()],ne.prototype,"valueOptions",null),e([M()],ne.prototype,"view",null),e([M()],ne.prototype,"canZoomTo",null),e([M()],ne.prototype,"pageStack",void 0),e([M()],ne.prototype,"showDiscardEditsPrompt",void 0),e([M()],ne.prototype,"_candidateCommitted",void 0),e([M()],ne.prototype,"page",null),e([M()],ne.prototype,"featureFormDisabled",null),e([M()],ne.prototype,"featureFormHasAssociation",null),e([M()],ne.prototype,"canGoBack",null),e([M()],ne.prototype,"shouldShowDeleteButton",null),e([M()],ne.prototype,"hasPendingEdits",null),e([M()],ne.prototype,"snappingManager",null),ne=e([W("esri.widgets.Editor.EditorViewModel")],ne);const le=ne;export{le as default};
5
+ import{__decorate as e}from"tslib";import{unique as t,isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{deprecatedFunction as o}from"../../core/deprecate.js";import s from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import{abortHandle as l,makeHandle as p}from"../../core/handleUtils.js";import d from"../../core/Logger.js";import{destroyMaybe as c,abortMaybe as u,removeMaybe as h}from"../../core/maybe.js";import{throwIfAborted as w,createResolver as f}from"../../core/promiseUtils.js";import{watch as m,on as y,when as g,syncAndInitial as k,initial as v,sync as _,whenOnce as W}from"../../core/reactiveUtils.js";import{property as M}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as F}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as T}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as V}from"../../editing/templateUtils.js";import{getGraphicLayer as b}from"../../graphic/graphicOriginUtils.js";import E from"../../layers/GraphicsLayer.js";import{isEditableLayer as S}from"../../layers/support/editableLayers.js";import{isFeatureLayer as A,isSubtypeGroupLayer as I,getOwningPortalUrl as L}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as U}from"../../portal/support/urlUtils.js";import C from"../../views/SelectionManager.js";import O from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as j}from"../../views/interactive/snapping/SnappingManager.js";import P from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as R}from"../../views/support/selectionUtils.js";import H from"../Attachments/AttachmentsViewModel.js";import q from"./CreateFeaturesWorkflow.js";import G from"./UpdateFeaturesWorkflow.js";import x from"./UpdateWorkflow.js";import{getLayersFromWorkflow as D,isCreateFeaturesWorkflow as B,isUpdateRecordWorkflow as N,isUpdateFeaturesWorkflow as Q,isUpdateWorkflow as z,findEditorItemForLayerOrThrow as Z,assertSplitWorkflowCapabilities as $,fetchFullFeatures as J,makeMultipleSourceLayersError as K,findEditorItemForLayer as X,whenEditorLayerView as Y}from"./workflowUtils.js";import ee from"./support/EditorItem.js";import{makeTemplateGroupInfoForLayer as te}from"../FeatureTemplates/featureTemplatesUtils.js";import ie from"../FeatureTemplates/FeatureTemplatesViewModel.js";import re from"../Sketch/SketchViewModel.js";import ae from"../Spinner/SpinnerViewModel.js";import{goTo as oe}from"../support/goToUtils.js";import{isFeatureItem as se,isLayerItem as ne}from"../support/SelectionList/selectionListUtils.js";import le from"../support/SelectionList/SelectionListViewModel.js";import pe from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function de(e,t){return e?.find(e=>e.layer===t)}let ce=class extends n{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new E({listMode:"hide",internal:!0,title:"Editor sketch layer"}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new T,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new a,this.editorItems=new a,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new H({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new ie({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new re({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new le,this.selectionManager=new C,this.selectionToolbarViewModel=new pe({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new O,this.snappingOptions=new P({attributeRulesEnabled:!0}),this.spinnerViewModel=new ae,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;this._candidateCommitted||"update"!==i?.type||(i.data.rootFeature=e,t&&(i.next(),this._candidateCommitted=!0))}}initialize(){this.addHandles([m(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,r=i?.filter(e=>!!t?.includes(e.layer));return[t,r,this.layerInfos]},()=>this._updateEditorItems(),k),m(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),m(()=>this._selectionSources,()=>this._syncSelectionSources(),v),y(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),y(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),y(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),g(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),m(()=>this.activeWorkflow,e=>this.selectionManager.showHighlight=!e),g(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),v),y(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),m(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),m(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},k),g(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),y(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);await this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),m(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},k),y(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),y(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i="update"===t?.type,r=D(t),a=i?t?.activeWorkflow?.parentLayer??void 0:void 0,o=`sketch-${e.type}`;this.emit(o,{type:o,detail:e,layer:r[0],layers:r,parentLayer:a})},_),m(()=>this.view,e=>{if(this._snappingManager=c(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new j({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},k),m(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},k),y(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),m(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:r})=>{t.view=e,i.view=e,r.view=e},k),m(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},k)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=u(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=h(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new a;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new a;for(const t of this.editorItems)R(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return B(e)?e.pendingFeatures.length:N(e)&&e.data.edits.feature?1:Q(e)?e.data.features.length:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&z(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:"update-features"===e?.type?e.formViewModel:null}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type||"update-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associatedLayer)return"viewing-associated-features";if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associationId)return"viewing-associated-layers";if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(N(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.featureFormViewModel.disabled;if(Q(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(N(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!Q(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await W(()=>!this.updating),!this.canCreate)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await W(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,r=i?Z(this.editorItems,i):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",a),await a.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startSplitFeatureWorkflow(e,t={}){await W(()=>!this.updating);const{view:i}=this;if(!i)throw new s("editing:view-required","A view is required to start a split feature workflow.");const r=b(e);if(!r)throw new s("editing:layer-required","The feature must be associated with a layer to start a split feature workflow.");const a=Z(this.editorItems,r);$(a);const o=this._createUpdatingResolver(),n=new AbortController;this.addHandles(l(n));try{await this._cancelWorkflow();const a=await J([e],r,i.spatialReference,n.signal);if(0===a.length)throw new s("editing:fetch-feature","Failed to fetch the full feature from the service.");const o=this._createUpdateWorkflow("editing-existing-feature",{rootFeature:a[0],rootWorkflowOptions:{type:"split",props:t}});this._set("activeWorkflow",o),this.addHandles(this._destroyWorkflowOnCommit(o)),await o.start()}catch(p){this._logErrorAndCancelWorkflow(p)}finally{o.resolve()}}async startSplitFeatureWorkflowAtDrawingSplitterGeometry(e,t){return this.startSplitFeatureWorkflow(e,{defaultSplitterGeometryType:t,startAt:"drawing-splitter-geometry"})}async startSplitFeatureWorkflowAtReviewingFeatures(e,t){return this.startSplitFeatureWorkflow(e,{splitterGeometry:t,startAt:"reviewing-features"})}async startUpdateFeaturesWorkflow(e){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");if(t(e.map(e=>e.sourceLayer??e.layer)).length>1)throw K();const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateFeaturesWorkflow(e);this._set("activeWorkflow",t),await t.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature",{rootFeature:e});t.addHandles(this._destroyWorkflowOnCommit(t)),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount)throw new s("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new s("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.visibleFeatureItems.map(e=>e.graphic);1===t.length?await this.startUpdateWorkflowAtFeatureEdit(t[0]):await this.startUpdateFeaturesWorkflow(t)}async deleteFeatureFromWorkflow(){o(d.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;return z(e)?e.deleteActiveFeature():Q(e)?e.deleteAndCommit():void this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return null!=e&&!0===X(this.editorItems,e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:t,sketchViewModel:r}=this;if(!t)return;const a=e??r?.createGraphic;if(a)"mesh"===a.geometry?.type?oe(t,a.geometry):oe(t,a);else{const e=r?.updateGraphics?.toArray();"3d"===t.type&&e?.some(e=>"mesh"===e.geometry?.type)?oe(t,e.map(e=>e.geometry).filter(i)):e&&oe(t,e)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){se(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){if(se(e))await this.startUpdateWorkflowAtFeatureEdit(e.graphic);else if(ne(e)){const t=e.featureItems.filter(e=>e.visible).map(e=>e.graphic);1===t.length?await this.startUpdateWorkflowAtFeatureEdit(t[0]):await this.startUpdateFeaturesWorkflow(t)}}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),p(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,r=i.editableLayers.toArray(),a=i.allTables.toArray().filter(e=>A(e)||I(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...a.flatMap(e=>this._getLayerLoadPromise(e))]),w(e),[...r.reverse(),...a.reverse()].filter(e=>S(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return I(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){u(this._updateItemsTask);const{view:e}=this,t=r(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const r=[],a=[],o=[],{layerInfos:s}=this;for(const l of i){const t=de(s,l),i=await Y(e,l).catch(()=>null);(t?r:i?a:o).push(new ee({layer:l,layerInfo:t,layerView:i}))}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...r,...a,...o];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){u(this._updateTemplatesTask);const e=r(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const r=await V({layers:i.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(const{layer:e,templates:i}of r)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const r of e){const e=t.get(r);e&&e.length>0&&i.push(te(r,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return q.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateFeaturesWorkflow(e){const t=G.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,features:e,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i)});return this.addHandles(this._destroyWorkflowOnCommit(t)),t}_createUpdateWorkflow(e,t){const i=x.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,rootFeature:t?.rootFeature,rootWorkflowOptions:t?.rootWorkflowOptions,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)});return i}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let r=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new s("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(r=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,r)),r}async _applyEdits(e,t,i){let r=null;const a=e.url?await L(e.url):null,o={returnServiceEditsOption:(!a||!U(a))&&!/\/hosted\//i.test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const a=await Y(i,e).catch(()=>null);return r=await e.applyEdits(t,o),a&&await W(()=>!a.updating),r}),r}async _applyEditsFeatureService(e,t,i){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,i)),r}_destroyWorkflowOnCommit(e){return y(()=>e,"commit",()=>{e.destroy(),this.activeWorkflow===e&&this._set("activeWorkflow",null)})}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const r={error:i,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:r}=e,a=t.find(e=>!!e.error)||r.find(e=>!!e.error)||i.find(e=>!!e.error);if(a)throw a.error}}_createUpdatingResolver(){const e=f();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:r}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=Z(this.editorItems,e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){d.getLogger(this).error(new s(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:r}=this,a="ready"===this.state,o=1===i.length;if(this._queuedSelectionTool=void 0,a&&o&&"replace"===t)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":r.updateSelection({current:[],added:[],removed:i});break;case"replace":r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case"add":r.updateSelection({current:i,added:[],removed:[]})}}};e([M()],ce.prototype,"_featureTemplatesLayersAndTables",null),e([M()],ce.prototype,"_queuedSelectionTool",void 0),e([M()],ce.prototype,"_snappingManager",void 0),e([M()],ce.prototype,"_selectionSources",null),e([M()],ce.prototype,"activeFeatureCount",null),e([M({readOnly:!0})],ce.prototype,"activeWorkflow",void 0),e([M()],ce.prototype,"activeLeafWorkflow",null),e([M({readOnly:!0})],ce.prototype,"_activityQueue",void 0),e([M({readOnly:!0})],ce.prototype,"canCreate",null),e([M()],ce.prototype,"canCreateVisible",null),e([M({readOnly:!0})],ce.prototype,"canUpdate",null),e([M()],ce.prototype,"canUpdateVisible",null),e([M()],ce.prototype,"featureTemplatesLayers",null),e([M()],ce.prototype,"editorItems",void 0),e([M()],ce.prototype,"effectiveSelectionManager",null),e([M({readOnly:!0})],ce.prototype,"failures",void 0),e([M()],ce.prototype,"hideTemplatesForInactiveLayers",void 0),e([M({type:H})],ce.prototype,"attachmentsViewModel",void 0),e([M()],ce.prototype,"featureFormViewModel",null),e([M()],ce.prototype,"formViewModel",null),e([M()],ce.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([M({type:ie})],ce.prototype,"featureTemplatesViewModel",void 0),e([M()],ce.prototype,"labelOptions",null),e([M()],ce.prototype,"layerInfos",void 0),e([M()],ce.prototype,"ownSketchViewModel",void 0),e([M()],ce.prototype,"selectionListViewModel",void 0),e([M()],ce.prototype,"selectionManager",void 0),e([M()],ce.prototype,"selectionToolbarViewModel",void 0),e([M()],ce.prototype,"sketchOptions",void 0),e([M()],ce.prototype,"sketchViewModel",null),e([M({type:P,nonNullable:!0})],ce.prototype,"snappingOptions",void 0),e([M()],ce.prototype,"spinnerViewModel",void 0),e([M()],ce.prototype,"state",null),e([M({readOnly:!0})],ce.prototype,"syncing",null),e([M()],ce.prototype,"updating",null),e([M()],ce.prototype,"tooltipOptions",null),e([M()],ce.prototype,"valueOptions",null),e([M()],ce.prototype,"view",null),e([M()],ce.prototype,"canZoomTo",null),e([M()],ce.prototype,"pageStack",void 0),e([M()],ce.prototype,"showDiscardEditsPrompt",void 0),e([M()],ce.prototype,"_candidateCommitted",void 0),e([M()],ce.prototype,"page",null),e([M()],ce.prototype,"featureFormDisabled",null),e([M()],ce.prototype,"featureFormHasAssociation",null),e([M()],ce.prototype,"canGoBack",null),e([M()],ce.prototype,"shouldShowDeleteButton",null),e([M()],ce.prototype,"hasPendingEdits",null),e([M()],ce.prototype,"snappingManager",null),ce=e([F("esri.widgets.Editor.EditorViewModel")],ce);const ue=ce;export{ue as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import SplitFeatureWorkflow = __esri.SplitFeatureWorkflow;
4
+ export default SplitFeatureWorkflow;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as i,handlesGroup as r}from"../../core/handleUtils.js";import"../../core/has.js";import a from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import{debounce as s}from"../../core/promiseUtils.js";import{watch as l,on as n,whenOnce as p}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/GraphicsLayer.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as m}from"../../views/support/HighlightDefaults.js";import w from"./Edits.js";import g from"./SplitFeatureWorkflowData.js";import y from"./Workflow.js";import{createWorkflowSteps as f,swapForEditingSession as _,updateGraphicSymbolWhenRequired as v,makeMinimalAttributes as F}from"./workflowUtils.js";import{getCompatibleSpitterGeometryType as M,ensureSplittableGeometry as b,makeNewFeatureAttributes as k,splitGeometry as S,isSplitterGeometry as V}from"./support/splitFeatureUtils.js";import j from"../FeatureForm/FeatureFormViewModel.js";import G from"../Sketch/SketchViewModel.js";var T;const E=()=>a.getLogger("esri.widgets.Editor.SplitFeatureWorkflow");let H=T=class extends y{constructor(e){super(e),this.defaultSplitterGeometryType=null,this.type="split-feature",this._activeFeature=null,this._formViewModel=null,this._graphicsLayer=null,this._highlightHelper=null,this._sketchViewModel=null,this._webStyleCache=new Map}initialize(){const e=this.data.viewModel.view;this._highlightHelper=e?new c({view:e,highlightName:m}):null,this._initializeFeatureFormViewModel();const t=this._initializeGraphicsLayer();this._initializeSketchViewModel(t)}destroy(){const e=this._graphicsLayer,{view:t}=this.data.viewModel;t?.destroyed||t?.map.remove(e),this._graphicsLayer=o(this._graphicsLayer),this._formViewModel.destroy(),this._sketchViewModel.destroy(),this._highlightHelper?.destroy()}get activeFeature(){return this._activeFeature}get featureFormViewModel(){return this._formViewModel}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get updating(){return this._updatingHandles.updating||this._formViewModel.updating||this._sketchViewModel.updating}static create(e){const{applyEdits:i,applyEditsFeatureService:r,defaultSplitterGeometryType:a,startAt:o,...s}=e;if("reviewing-features"===o){if(!s.splitterGeometry)throw new t("editing:split-geometry-required","Must provide the split geometry to start at the 'reviewing-features' step.");const e=M(b(s.originalFeature.geometry),s.splitterGeometry.type);if(s.splitterGeometry.type!==e)throw new t("editing:incompatible-split-geometries",`Geometry of type '${s.splitterGeometry.type}' cannot be used to split geometry of type '${s.originalFeature.geometry?.type}'.`)}const l=new T({data:new g(s),defaultSplitterGeometryType:a,onCommit:L(e.applyEdits)});return l._set("steps",T._createWorkflowSteps(l,o)),l}async enter(){}exit(){if("reviewing-features"!==this.stepId)throw new t("editing:invalid-exit-state","The SplitFeatureWorkflow can only be exited when in the 'reviewing-features' step.")}async setActiveFeature(e){const i=this._activeFeature;if(e===i)return;const r=this.data,a=this._highlightHelper;a?.removeAll();const o=i?r.getEditsForFeature(i):null;if(o&&(o.submittable=this._formViewModel.submittable),this._activeFeature=e,null==e)return;const s=this.data.getRoleForFeature(e);if(!s)throw new t("editing:unknown-feature","The provided feature is not part of this workflow.");a?.add(e),await this._setFeatureOnFormViewModel(e,s)}async start(){return await super.start(),this._makeSketchController()}async _createAndInitializeEdits({newPart:e,remainingPart:t}){const{data:i}=this,r=i.originalFeature,a=this._formViewModel,o=r.clone();o.geometry=t;const s=new w({feature:o});i.existingFeatureEdits=s,s.trackChanges(r),await this._setFeatureOnFormViewModel(o,"existing"),s.submittable=a.submittable;const l=r.clone();l.geometry=e,l.attributes=k(r.attributes,i.editorItem.layer);const n=new w({feature:l});return i.newFeatureEdits=n,n.trackChanges(),await this._setFeatureOnFormViewModel(l,"new"),n.submittable=a.submittable,{featureToCreate:l,featureToUpdate:o}}static _createWorkflowSteps(e,i="drawing-split-geometry"){const{data:r}=e;return f(["drawing-split-geometry","reviewing-features"],i,{"drawing-split-geometry":()=>({id:"drawing-split-geometry",async setUp(){const t=b(r.originalFeature.geometry),i=M(t,e.defaultSplitterGeometryType),a=e._sketchViewModel;e.addHandles(n(()=>a,"create",t=>{if("complete"===t.state){const o=t.graphic?.geometry;if(!V(o))return E().warn("editing:invalid-split-geometry","The geometry produced by the Sketch operation cannot be used for splitting."),void a.create(i);r.splitterGeometry=o,e.next()}}),this.id),await a.create(i)},async tearDown(){e.removeHandles(this.id)}}),"reviewing-features":()=>({id:"reviewing-features",async setUp(){const i=r.splitterGeometry;if(!i)throw new t("editing:missing-splitter-geometry","The `splitterGeometry` property of the workflow's data must be set in order to start the 'reviewing-features' step.");const a=await e._executeSplit(i),{featureToCreate:o,featureToUpdate:s}=await e._createAndInitializeEdits(a),l=await e._displayFeatureGraphics(s,o);e.addHandles(l,this.id)},async tearDown(){e._highlightHelper?.removeAll()}})})}async _displayFeatureGraphics(e,t){const{data:a,_graphicsLayer:o}=this,n=a.viewModel.view,p=[];if(!e||!t||!n)return i();const d=s(i=>Promise.all([v(e,this._webStyleCache,i),v(t,this._webStyleCache,i)]));return await d("2d"===n.type?n.scale:null),"2d"===n.type&&p.push(l(()=>n.scale,e=>d(e))),o.add(t),p.push(i(()=>o.remove(t))),p.push(await _(o,n,a.originalFeature,e)),r(p)}async _executeSplit(e){const{data:i}=this,{originalFeature:r}=i,a=r.geometry;if(!a)throw new t("editing:feature-has-no-geometry","Cannot split the provided feature as it has no geometry.");const o=await S(a,e);if(!o||!o.newPart)throw new t("editing:split-failed","The split operation did not produce a valid result.");return o}_initializeFeatureFormViewModel(){const{data:e,_webStyleCache:t}=this,i=e.viewModel.view,r=i?.spatialReference??e.editorItem.layer.spatialReference,a=new j({formTemplate:e.editorItem.formTemplate,highlightHelper:this._highlightHelper,map:i?.map,spatialReference:r,timeZone:e.timeZone});this._formViewModel=a,this.addHandles(n(()=>a,"value-change",({feature:r,fieldName:a,value:o})=>{r&&(e.getEditsForFeature(r)?.setAttribute(a,o),v(r,t,i?.scale))}))}_initializeGraphicsLayer(){const{data:e}=this,{view:t}=e.viewModel,i=new u({elevationInfo:e.editorItem.layer.elevationInfo,internal:!0,listMode:"hide",title:"splitFeatureWorkflow-internal"});return this._graphicsLayer=i,t?.map.add(i),i}_initializeSketchViewModel(e){const{data:t}=this,{view:i}=t.viewModel;this._sketchViewModel=new G({layer:e,creationMode:"single",sketchOptions:t.sketchOptions,snappingManager:t.snappingManager,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:i})}_makeSketchController(){return{enter:async()=>{const{activeFeature:e}=this;e&&this._highlightHelper?.add(e)},exit:()=>{this._highlightHelper?.removeAll()}}}async _setFeatureOnFormViewModel(e,t){const{data:i}=this,r=this._formViewModel;r.feature=e,"existing"===t?(r.editType="UPDATE",r.overrideInitialFeature(i.originalFeature)):r.editType="INSERT",await p(()=>!r.updating)}get test(){}};e([d()],H.prototype,"activeFeature",null),e([d()],H.prototype,"defaultSplitterGeometryType",void 0),e([d()],H.prototype,"featureFormViewModel",null),e([d()],H.prototype,"layer",null),e([d()],H.prototype,"parent",null),e([d()],H.prototype,"parentLayer",null),e([d()],H.prototype,"type",void 0),e([d()],H.prototype,"updating",null),e([d()],H.prototype,"_activeFeature",void 0),e([d()],H.prototype,"_formViewModel",void 0),e([d()],H.prototype,"_graphicsLayer",void 0),e([d()],H.prototype,"_highlightHelper",void 0),e([d()],H.prototype,"_sketchViewModel",void 0),H=T=e([h("esri.widgets.Editor.SplitFeatureWorkflow")],H);const I=H;function L(e){return async i=>{const{existingFeatureEdits:r,newFeatureEdits:a}=i,o=r?.feature?.cloneShallow(),s=a?.feature?.cloneShallow(),l=i.editorItem.layer;if(null==o||null==s)throw new t("editing:missing-features","Expected both a feature to update and a feature to add for the split operation.");r?.attributesModified||(o.attributes=F(o,i.editorItem.layer)),await e(l,{addFeatures:[s],updateFeatures:[o]})}}export{I as default};
5
+ import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{makeHandle as i,handlesGroup as r}from"../../core/handleUtils.js";import"../../core/has.js";import a from"../../core/Logger.js";import{destroyMaybe as o}from"../../core/maybe.js";import{debounce as s}from"../../core/promiseUtils.js";import{watch as l,on as n,whenOnce as p}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../layers/GraphicsLayer.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as m}from"../../views/support/HighlightDefaults.js";import w from"./Edits.js";import g from"./SplitFeatureWorkflowData.js";import y from"./Workflow.js";import{assertSplitWorkflowCapabilities as f,createWorkflowSteps as _,swapForEditingSession as v,updateGraphicSymbolWhenRequired as F,makeMinimalAttributes as M}from"./workflowUtils.js";import{getCompatibleSpitterGeometryType as k,ensureSplittableGeometry as b,makeNewFeatureAttributes as S,splitGeometry as V,isSplitterGeometry as j}from"./support/splitFeatureUtils.js";import G from"../FeatureForm/FeatureFormViewModel.js";import T from"../Sketch/SketchViewModel.js";var E;const H=()=>a.getLogger("esri.widgets.Editor.SplitFeatureWorkflow");let I=E=class extends y{constructor(e){super(e),this.defaultSplitterGeometryType=null,this.type="split-feature",this._activeFeature=null,this._formViewModel=null,this._graphicsLayer=null,this._highlightHelper=null,this._sketchViewModel=null,this._webStyleCache=new Map}initialize(){const e=this.data.viewModel.view;this._highlightHelper=e?new c({view:e,highlightName:m}):null,this._initializeFeatureFormViewModel();const t=this._initializeGraphicsLayer();this._initializeSketchViewModel(t)}destroy(){const e=this._graphicsLayer,{view:t}=this.data.viewModel;t?.destroyed||t?.map.remove(e),this._graphicsLayer=o(this._graphicsLayer),this._formViewModel.destroy(),this._sketchViewModel.destroy(),this._highlightHelper?.destroy()}get activeFeature(){return this._activeFeature}get featureFormViewModel(){return this._formViewModel}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get updating(){return this._updatingHandles.updating||this._formViewModel.updating||this._sketchViewModel.updating}static create(e){const{applyEdits:i,applyEditsFeatureService:r,defaultSplitterGeometryType:a,startAt:o,...s}=e;if(f(s.editorItem),"reviewing-features"===o){if(!s.splitterGeometry)throw new t("editing:split-geometry-required","Must provide the split geometry to start at the 'reviewing-features' step.");const e=k(b(s.originalFeature.geometry),s.splitterGeometry.type);if(s.splitterGeometry.type!==e)throw new t("editing:incompatible-split-geometries",`Geometry of type '${s.splitterGeometry.type}' cannot be used to split geometry of type '${s.originalFeature.geometry?.type}'.`)}const l=new E({data:new g(s),defaultSplitterGeometryType:a,onCommit:x(e.applyEdits)});return l._set("steps",E._createWorkflowSteps(l,o)),l}async enter(){}exit(){if("reviewing-features"!==this.stepId)throw new t("editing:invalid-exit-state","The SplitFeatureWorkflow can only be exited when in the 'reviewing-features' step.")}async setActiveFeature(e){const i=this._activeFeature;if(e===i)return;const r=this.data,a=this._highlightHelper;a?.removeAll();const o=i?r.getEditsForFeature(i):null;if(o&&(o.submittable=this._formViewModel.submittable),this._activeFeature=e,null==e)return;const s=this.data.getRoleForFeature(e);if(!s)throw new t("editing:unknown-feature","The provided feature is not part of this workflow.");a?.add(e),await this._setFeatureOnFormViewModel(e,s)}async start(){return await super.start(),this._makeSketchController()}async _createAndInitializeEdits({newPart:e,remainingPart:t}){const{data:i}=this,r=i.originalFeature,a=this._formViewModel,o=r.clone();o.geometry=t;const s=new w({feature:o});i.existingFeatureEdits=s,s.trackChanges(r),await this._setFeatureOnFormViewModel(o,"existing"),s.submittable=a.submittable;const l=r.clone();l.geometry=e,l.attributes=S(r.attributes,i.editorItem.layer);const n=new w({feature:l});return i.newFeatureEdits=n,n.trackChanges(),await this._setFeatureOnFormViewModel(l,"new"),n.submittable=a.submittable,{featureToCreate:l,featureToUpdate:o}}static _createWorkflowSteps(e,i="drawing-splitter-geometry"){const{data:r}=e;return _(["drawing-splitter-geometry","reviewing-features"],i,{"drawing-splitter-geometry":()=>({id:"drawing-splitter-geometry",async setUp(){const t=b(r.originalFeature.geometry),i=k(t,e.defaultSplitterGeometryType),a=e._sketchViewModel;e.addHandles(n(()=>a,"create",t=>{if("complete"===t.state){e._graphicsLayer.removeAll();const o=t.graphic?.geometry;if(!j(o))return H().warn("editing:invalid-split-geometry","The geometry produced by the Sketch operation cannot be used for splitting."),void a.create(i);r.splitterGeometry=o,e.next()}}),this.id),await a.create(i)},async tearDown(){e.removeHandles(this.id)}}),"reviewing-features":()=>({id:"reviewing-features",async setUp(){const i=r.splitterGeometry;if(!i)throw new t("editing:missing-splitter-geometry","The `splitterGeometry` property of the workflow's data must be set in order to start the 'reviewing-features' step.");const a=await e._executeSplit(i),{featureToCreate:o,featureToUpdate:s}=await e._createAndInitializeEdits(a),l=await e._displayFeatureGraphics(s,o);e.addHandles(l,this.id)},async tearDown(){e._highlightHelper?.removeAll()}})})}async _displayFeatureGraphics(e,t){const{data:a,_graphicsLayer:o}=this,n=a.viewModel.view,p=[];if(!e||!t||!n)return i();const d=s(i=>Promise.all([F(e,this._webStyleCache,i),F(t,this._webStyleCache,i)]));return await d("2d"===n.type?n.scale:null),"2d"===n.type&&p.push(l(()=>n.scale,e=>d(e))),o.add(t),p.push(i(()=>o.remove(t))),p.push(await v(o,n,a.originalFeature,e)),r(p)}async _executeSplit(e){const{data:i}=this,{originalFeature:r}=i,a=r.geometry;if(!a)throw new t("editing:feature-has-no-geometry","Cannot split the provided feature as it has no geometry.");const o=await V(a,e);if(!o||!o.newPart)throw new t("editing:split-failed","The split operation did not produce a valid result.");return o}_initializeFeatureFormViewModel(){const{data:e,_webStyleCache:t}=this,i=e.viewModel.view,r=i?.spatialReference??e.editorItem.layer.spatialReference,a=new G({formTemplate:e.editorItem.formTemplate,highlightHelper:this._highlightHelper,map:i?.map,spatialReference:r,timeZone:e.timeZone});this._formViewModel=a,this.addHandles(n(()=>a,"value-change",({feature:r,fieldName:a,value:o})=>{r&&(e.getEditsForFeature(r)?.setAttribute(a,o),F(r,t,i?.scale))}))}_initializeGraphicsLayer(){const{data:e}=this,{view:t}=e.viewModel,i=new u({elevationInfo:e.editorItem.layer.elevationInfo,internal:!0,listMode:"hide",title:"splitFeatureWorkflow-internal"});return this._graphicsLayer=i,t?.map.add(i),i}_initializeSketchViewModel(e){const{data:t}=this,{view:i}=t.viewModel;this._sketchViewModel=new T({layer:e,creationMode:"single",sketchOptions:t.sketchOptions,snappingManager:t.snappingManager,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:i})}_makeSketchController(){return{enter:async()=>{const{activeFeature:e}=this;e&&this._highlightHelper?.add(e)},exit:()=>{this._highlightHelper?.removeAll()},viewModel:this._sketchViewModel}}async _setFeatureOnFormViewModel(e,t){const{data:i}=this,r=this._formViewModel;r.feature=e,"existing"===t?(r.editType="UPDATE",r.overrideInitialFeature(i.originalFeature)):r.editType="INSERT",await p(()=>!r.updating)}get test(){}};e([d()],I.prototype,"activeFeature",null),e([d()],I.prototype,"defaultSplitterGeometryType",void 0),e([d()],I.prototype,"featureFormViewModel",null),e([d()],I.prototype,"layer",null),e([d()],I.prototype,"parent",null),e([d()],I.prototype,"parentLayer",null),e([d()],I.prototype,"type",void 0),e([d()],I.prototype,"updating",null),e([d()],I.prototype,"_activeFeature",void 0),e([d()],I.prototype,"_formViewModel",void 0),e([d()],I.prototype,"_graphicsLayer",void 0),e([d()],I.prototype,"_highlightHelper",void 0),e([d()],I.prototype,"_sketchViewModel",void 0),I=E=e([h("esri.widgets.Editor.SplitFeatureWorkflow")],I);const L=I;function x(e){return async i=>{const{existingFeatureEdits:r,newFeatureEdits:a}=i,o=r?.feature?.cloneShallow(),s=a?.feature?.cloneShallow(),l=i.editorItem.layer;if(null==o||null==s)throw new t("editing:missing-features","Expected both a feature to update and a feature to add for the split operation.");r?.attributesModified||(o.attributes=M(o,i.editorItem.layer)),await e(l,{addFeatures:[s],updateFeatures:[o]})}}export{L as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import SplitFeatureWorkflowData = __esri.SplitFeatureWorkflowData;
4
+ export default SplitFeatureWorkflowData;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import o from"../../core/Error.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 s}from"../../core/accessorSupport/decorators/subclass.js";import i from"./Edits.js";import{findEditorItemForLayer as a}from"./workflowUtils.js";var p;let d=p=class extends e{constructor(t){super(t),this.association=null,this.editorItem=null,this.edits=null,this.parent=null,this.featureFormCallbacks=null,this.viewModel=null,this.readOnly=!1}get attachmentsCapabilities(){const t=this.editorItem.capabilities.update.attachments.enabled;return{editing:!0,operations:{add:t,update:t,delete:t}}}get formTemplate(){return this.editorItem.formTemplate}static async create(t){const e=p._makeConstructorProps(t);return new p(e)}static _makeConstructorProps(t){const{association:e,feature:r,parent:s,featureFormCallbacks:p,viewModel:d,readOnly:l}=t,n=a(d.editorItems,r.sourceLayer);if(!n)throw new o("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified Graphic's layer");return{association:e,editorItem:n,edits:new i({feature:r}),parent:s,featureFormCallbacks:p,viewModel:d,readOnly:l}}};t([r()],d.prototype,"association",void 0),t([r()],d.prototype,"attachmentsCapabilities",null),t([r({constructOnly:!0})],d.prototype,"editorItem",void 0),t([r()],d.prototype,"edits",void 0),t([r()],d.prototype,"formTemplate",null),t([r()],d.prototype,"parent",void 0),t([r()],d.prototype,"featureFormCallbacks",void 0),t([r()],d.prototype,"viewModel",void 0),t([r()],d.prototype,"readOnly",void 0),d=p=t([s("esri.widgets.Editor.UpdateRecordWorkflowData")],d);const l=d;export{l as default};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import o from"../../core/Error.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 s}from"../../core/accessorSupport/decorators/subclass.js";import i from"./Edits.js";import{findEditorItemForLayer as a}from"./workflowUtils.js";var p;let d=p=class extends e{constructor(t){super(t),this.association=null,this.editorItem=null,this.edits=null,this.parent=null,this.featureFormCallbacks=null,this.viewModel=null,this.readOnly=!1}get attachmentsCapabilities(){const t=this.editorItem.capabilities.update.attachments.enabled;return{editing:!0,operations:{add:t,update:t,delete:t}}}get formTemplate(){return this.editorItem.formTemplate}static async create(t){const e=p._makeConstructorProps(t);return new p(e)}static _makeConstructorProps(t){const{association:e,feature:r,parent:s,featureFormCallbacks:p,viewModel:d,readOnly:l}=t,n=a(d.editorItems,r.sourceLayer);if(!n)throw new o("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified Graphic's layer");return{association:e,editorItem:n,edits:new i({feature:r}),parent:s,featureFormCallbacks:p,viewModel:d,readOnly:l??!1}}};t([r()],d.prototype,"association",void 0),t([r()],d.prototype,"attachmentsCapabilities",null),t([r({constructOnly:!0})],d.prototype,"editorItem",void 0),t([r()],d.prototype,"edits",void 0),t([r()],d.prototype,"formTemplate",null),t([r()],d.prototype,"parent",void 0),t([r()],d.prototype,"featureFormCallbacks",void 0),t([r()],d.prototype,"viewModel",void 0),t([r()],d.prototype,"readOnly",void 0),d=p=t([s("esri.widgets.Editor.UpdateRecordWorkflowData")],d);const l=d;export{l 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import i from"../../core/Error.js";import{makeHandle as a}from"../../core/handleUtils.js";import o from"../../core/Logger.js";import{abortMaybe as r}from"../../core/maybe.js";import{debounce as s,createResolver as n,onAbort as l,createAbortError as d,throwIfAborted as c}from"../../core/promiseUtils.js";import p from"../../core/Queue.js";import{whenOnce as u,watch as w,sync as h,when as f}from"../../core/reactiveUtils.js";import{last as g}from"../../core/SetUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as k}from"../../core/accessorSupport/decorators/subclass.js";import{isEditableLayer as m}from"../../layers/support/editableLayers.js";import{isFeatureLayer as y,isSubtypeSublayer as W,isSubtypeGroupLayer as A,isTable as _}from"../../layers/support/layerUtils.js";import{createFeatureServices as b}from"../../rest/featureService/utils.js";import C from"../../views/draw/support/HighlightHelper.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import{temporaryHighlightName as S}from"../../views/support/HighlightDefaults.js";import M from"./CreateFeaturesWorkflow.js";import I from"./SplitFeatureWorkflow.js";import{UpdateFeatureWorkflow as E}from"./UpdateFeatureWorkflow.js";import{UpdateRecordWorkflow as R}from"./UpdateRecordWorkflow.js";import V from"./UpdateWorkflowData.js";import U from"./Workflow.js";import{findEditorItemForLayer as j,isSplitFeatureWorkflow as P,isUpdateRecordWorkflow as L,isParentWorkflow as x,findEditorItemForLayerOrThrow as T,createWorkflowSteps as H,fetchCandidates as N}from"./workflowUtils.js";import{findUtilityNetwork as O,isGraphicForRelatableFeatureSupportedLayer as D}from"../Feature/support/featureUtils.js";var q;let G=q=class extends U{constructor(e){super(e),this._workflowStack=new p(g),this._sketchStack=new p(g),this.data=void 0,this.type="update"}destroy(){this._drainWorkflowStack(e=>e.cancel({force:!0}))}get activeEditorItem(){return this.activeWorkflow?.data.editorItem??void 0}get activeFeatureFormViewModel(){return this.activeWorkflow?.featureFormViewModel}get activeUtilityNetworkAssociationAddAssociationViewModel(){return"add-association"===this.activeWorkflow?.type?this.activeWorkflow.utilityNetworkAssociationAddAssociationViewModel:null}get activeSketchViewModel(){return this._sketchStack.peek()?.viewModel}get canDeleteAssociation(){const{activeFeatureFormViewModel:e}=this;if(!this.activeWorkflow||!this.data.viewModel.view?.map||!e)return!1;const{activeAssociation:t,feature:i}=e;return!(!t||!i?.sourceLayer||!y(i?.sourceLayer)&&!W(i?.sourceLayer))}get activeWorkflow(){return this._workflowStack.last()}get updating(){return this._updatingHandles.updating||!!this.activeWorkflow?.updating}get hasPreviousStep(){const e=this.activeWorkflow?.featureFormViewModel;return this._stepIndex>0||this.nestedWorkflowCount>1||null!=e?.relationshipId||"view"!==this.data.viewModel.attachmentsViewModel.mode||null!=e?.associationId||null!=e?.associatedLayer}get hasUpdatableCandidates(){const{candidates:e,viewModel:t}=this.data;return e.some(({layer:e})=>j(t.editorItems,e)?.supportsUpdateWorkflow)}get nestedWorkflowCount(){return this._workflowStack.length}get shouldShowAttachments(){return!!this.activeEditorItem?.capabilities.attachments.enabled}get shouldAllowAttachmentEditing(){return!!this.activeEditorItem?.capabilities.update.attachments.enabled}get hasPendingEdits(){return Array.from(this._workflowStack).some(e=>e.hasPendingEdits)}get helpMessage(){return this.activeWorkflow?.helpMessage?this.activeWorkflow.helpMessage:"awaiting-feature-to-update"===this.stepId?"select":void 0}get reliesOnOwnerAdminPrivileges(){return this.activeWorkflow?.reliesOnOwnerAdminPrivileges??!1}get hasInvalidFormTemplate(){return!!this.activeEditorItem?.hasInvalidFormTemplate}async back(e=()=>Promise.resolve(!0)){const{activeWorkflow:t}=this,i=t?.featureFormViewModel;if(i?.activeRelationshipInput){const e=i.activeRelationshipInput;if(e.activeCategory)return void(e.activeCategory=null);if(null!=i.relationshipId)return void(i.relationshipId=null);if(e.showAllEnabled)return void(e.showAllEnabled=!1)}if("add-association"===t?.type){const{activeUtilityNetworkAssociationAddAssociationViewModel:e}=this;if(e?.filterOptionsVisible)return void(e.filterOptionsVisible=!1);e?.featureSpatialItems.length&&e.reset()}if(null==i?.associatedLayer)if(null==i?.associationId)if("create-features"===t?.type&&t.hasPreviousStep)await t.previous({cancelCurrentStep:!0});else if(t){if(t.hasPendingEdits&&!i?.disabled){if(!await e())return}t.hasPreviousStep?await t.previous({cancelCurrentStep:!0}):await this.cancelActiveWorkflow({force:!0})}else this.hasPreviousStep?await this.previous({cancelCurrentStep:!0}):await this.cancel({force:!0});else i.associationId=null;else i.associatedLayer=null}async cancelActiveWorkflow(e){await(this.activeWorkflow?.cancel(e)),await this._popWorkflowAndReconcile()}async commit(){await this._drainWorkflowStack(e=>e.commit()),await super.commit()}static create(e){const{startAt:t,applyEdits:i,applyEditsFeatureService:a,...o}=e,r=new q({data:new V({applyEditsCallback:i,applyEditsFeatureServiceCallback:a,...o}),onCommit:async()=>{}});return r._set("steps",this._createWorkflowSteps(r,t)),r}async save(){const{activeFeatureFormViewModel:e}=this;if(e){if(e.submit(),!e.submittable||e.pendingSubtypeChoice)return;const t=e.getValues();if(e.validateContingencyConstraints(t,{includeIncompleteViolations:!0}).length>0)return}if(this.nestedWorkflowCount<2)return await this.commit();const{activeWorkflow:t}=this;if(await(t?.commit()),!P(t))return void await this._popWorkflowAndReconcile();this._popWorkflow();const i=this._workflowStack.peek();if(i&&i===t?.parent&&(await i.cancel(),this._popWorkflow(),0===this.nestedWorkflowCount))return await this.commit();await this._reconcileWorkflowStack()}async startCreatingRelatedRecord(e){try{const t=this._createNestedCreateFeaturesWorkflow(e);await this._pushWorkflowAndReconcile(t)}catch(t){throw new i("editor:unable-to-start-creating","Could not begin updating the provided feature or table record.",{error:t})}}async startSplittingFeature(e){try{const t=await this._createNestedSplitFeatureWorkflow(e);await this._pushWorkflowAndReconcile(t)}catch(t){throw new i("editor:unable-to-start-splitting","Could not begin splitting the provided feature.",{error:t})}}async startUpdating(e,t,a=!1){try{const i=await this._createNestedUpdateWorkflow(e,a,t);await this._pushWorkflowAndReconcile(i)}catch(o){throw new i("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:o})}}async startAddAssociation(e,t,a){try{const i=await this._createNestedAddAssociationWorkflow(e,t,a);await this._pushWorkflowAndReconcile(i)}catch(o){throw new i("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:o})}}async deleteActiveFeature(){const{activeWorkflow:e}=this;if(!e)throw new i("editor:nothing-to-delete","There is no feature to delete");const t=L(e);t?(e.stageDelete(),e.data.edits.feature===this.data.rootFeature&&this._removeRootFeatureFromCandidates()):await e.cancel(),this.nestedWorkflowCount<2?t?await this.commit():await this.cancel({force:!0}):(t&&await e.commit(),await this._popWorkflowAndReconcile(),await this._returnToPageWithContent())}async deleteActiveAssociation(){if(!this.canDeleteAssociation)throw new i("editor:nothing-to-delete","There is no association to delete");await this._deleteActiveAssociation(),await this._popWorkflowAndReconcile(),await this._returnToPageWithContent()}async cancelAll(){await this._drainWorkflowStack(e=>e.cancel({force:!0}))}async _deleteActiveAssociation(){const{activeFeatureFormViewModel:e,data:t}=this,{activeAssociation:a,feature:o}=e,{applyEditsFeatureServiceCallback:r,viewModel:s}=t,{sourceLayer:n}=o,l=W(n)&&n.parent?n.parent:n,d=b([l]),c=d.values().next().value?.featureService;if(!c)throw new i("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(c?.load());const p=s.view.map,u=O(p,l);await(u?.networkSystemLayers.loadAssociationsTable());const w=u?.generateDeleteAssociations([a]);if(!w)throw new i("editor:failed-to-delete-association","Could not create payload needed to delete association");const h=u?.gdbVersion??void 0;await r(c,[w],{gdbVersion:h,globalIdUsed:!0})}_removeRootFeatureFromCandidates(){const{candidates:e,rootFeature:t}=this.data;if(0===e.length||!t)return;const i=e.indexOf(t);i>-1&&e.splice(i,1)}async _returnToPageWithContent(){const{activeFeatureFormViewModel:e}=this;if(!e?.activeAssociationInput)return;const{activeAssociationInput:t,associationId:i}=e;await t.refresh(),t.associatedLayer&&!t.associatedFeatures?.length&&(e.associatedLayer=null),null==i||t.associatedFeatureInfos.size||(e.associationId=null)}_createNestedCreateFeaturesWorkflow(e){const{relatedLayer:t}=e,{addAttachmentsCallback:a,applyEditsCallback:o,applyEditsFeatureServiceCallback:r,sketchOptions:s,snappingManager:n,viewModel:l}=this.data;if(!m(t))throw new i("editor:unsupported-layer","Editing is not supported on the provided layer");const d=this._getCreationInfoForNestedCreateFeaturesWorkflow(e),c=d.template||d.initialFeature?"creating-features":"awaiting-feature-creation-info",p=x(this.activeWorkflow)?this.activeWorkflow:void 0;return M.create({addAttachmentsCallback:a,applyEdits:o,applyEditsFeatureService:r,creationInfo:d,isNested:!0,parent:p,sketchOptions:s,snappingManager:n,startAt:c,viewModel:l})}_getCreationInfoForNestedCreateFeaturesWorkflow(e){const{relatedLayer:a}=e;if(!m(a)||A(a))throw new i("editor:unsupported-layer","Editing is not supported on the provided layer");const{viewModel:o}=this.data,r={layer:a,maxFeatures:1},s=this._makeRelatedRecordAttributes(e),n=o.getTemplatesForLayer(a);return n?.length>0?(r.attributeOverrides=s,1===n.length&&(r.template=n[0])):r.initialFeature=new t({sourceLayer:a,attributes:s}),r}async _createNestedUpdateWorkflow(e,t,i){const a=_(e.sourceLayer)?R:E,{applyEditsCallback:o,applyEditsFeatureServiceCallback:r,sketchOptions:s,snappingManager:n,viewModel:l}=this.data,d=x(this.activeWorkflow)?this.activeWorkflow:void 0,c=await a.create({association:i,feature:e,parent:d,sketchOptions:s,snappingManager:n,viewModel:l,readOnly:t,applyEdits:o,applyEditsFeatureService:r,featureFormCallbacks:{addRelatedRecord:async e=>await this._updatingHandles.addPromise(this.startCreatingRelatedRecord(e)),editRelatedRecord:async({relatedFeature:e,readOnly:t})=>await this._updatingHandles.addPromise(this.startUpdating(e,void 0,t)),selectAssociatedFeature:async({feature:e,association:i})=>await this._updatingHandles.addPromise(this.startUpdating(e,i,t)),addAssociation:async e=>await this._updatingHandles.addPromise(this.startAddAssociation(e.feature,e.utilityNetwork,e.associationType))}});return await u(()=>!c.updating),c}async _createNestedAddAssociationWorkflow(e,t,i){const{AddAssociationWorkflow:a}=await import("./AddAssociationWorkflow.js"),{applyEditsCallback:o,applyEditsFeatureServiceCallback:r,viewModel:s}=this.data,n=x(this.activeWorkflow)?this.activeWorkflow:void 0,l=this.activeFeatureFormViewModel?.activeAssociationInput,d=await a.create({utilityNetwork:t,associationType:i,feature:e,parent:n,viewModel:s,associationInput:l,applyEdits:o,applyEditsFeatureService:r});return await u(()=>!d.updating),d}async _createNestedSplitFeatureWorkflow(e){const{applyEditsCallback:t,applyEditsFeatureServiceCallback:i,viewModel:a}=this.data,o=x(this.activeWorkflow)?this.activeWorkflow:void 0,r=T(a.editorItems,e.sourceLayer),s=I.create({applyEdits:t,applyEditsFeatureService:i,editorItem:r,originalFeature:e,parent:o,viewModel:a});return await u(()=>!s.updating),s}async _drainWorkflowStack(e){const t=this._workflowStack,i=[];for(const a of t){const t=e(a).finally(()=>a.destroy());this._updatingHandles.addPromise(t),i.push(t)}await Promise.all(i),this._workflowStack.clear(),this._sketchStack.clear()}_makeRelatedRecordAttributes(e){const{parentFeature:t,relatedLayer:i,relationshipId:a}=e;if(!D(t))return;const o=i.relationships?.find(e=>e.id===a);if(!o)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the destination layer.");if("origin"===o.role)return void this._logContinuingWithoutRelationshipWarning("unsupported-role","Creating new related records in the 'origin' table of a relationship is not yet supported");const r=t.sourceLayer;o.relatedTableId!==r.layerId&&this._logContinuingWithoutRelationshipWarning("invalid-argument-combination","The given parent feature does not belong to the relationship designated by the given relationship ID.");const s=r.relationships?.find(e=>e.id===a);if(!s)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the origin layer.");const n=z(r,s),l=t.getAttribute(n);l||this._logContinuingWithoutRelationshipWarning("no-key-on-origin-feature","The given parent feature does not have a value for the relationship's origin primary key field.");const d=z(i,o);return{[d]:l}}_popWorkflow(){this._workflowStack.pop()?.destroy(),this._sketchStack.pop()}async _popWorkflowAndReconcile(){this._popWorkflow();const e=await this._reconcileWorkflowStack();if(e.failureCount>0)throw new i("editor:next-workflow-failed","Popped the top workflow, but the next workflow in the stack failed to activate",e)}async _pushWorkflowAndReconcile(e){const t=this._workflowRequiresSketchViewModel(e);this.activeWorkflow?.exit({removeSketchHandles:t});const a=this._sketchStack,o=await(e?.start()),r=a.peek();o?(r?.exit(),a.push(o)):a.push(this._cloneSketchController(r)),this._workflowStack.push(e);const s=await this._reconcileWorkflowStack();if(s.failureCount>0)throw new i("editor:failed-to-start-updating-feature","Failed to enter the provided workflow.",s)}async _reconcileWorkflowStack(){const e=this._workflowStack,t=this._sketchStack;try{const i=e.peek();return await(i?.enter()),await(t.peek()?.enter()),{activeWorkflow:i,failureCount:0}}catch(i){e.pop().destroy(),t.pop();const{activeWorkflow:a,failureCount:o}=await this._reconcileWorkflowStack();return{activeWorkflow:a,failureCount:o+1}}}_cloneSketchController(e){return{enter:e?.enter??(async()=>{}),exit:e?.exit??(async()=>{}),viewModel:e?.viewModel}}_workflowRequiresSketchViewModel(e){const{type:t}=e;return"update-feature"===t||"create-features"===t&&!_(e.data.creationInfo?.layer)}static _createWorkflowSteps(e,t="awaiting-feature-to-update"){const{data:o}=e;return H(["awaiting-feature-to-update","awaiting-update-feature-candidate","editing-existing-feature","adding-attachment","editing-attachment"],t,{"awaiting-feature-to-update":()=>({id:"awaiting-feature-to-update",async setUp(){const{spinnerViewModel:t}=o.viewModel,i=o.viewModel.view;i.activeTool=null;let s=null;e.addHandles(a(()=>{s=r(s)}),this.id),o.rootFeature=null,o.candidates=[];const p=i.on("immediate-click",async a=>{const r=n();e._updatingHandles.addPromise(r.promise);try{t.location=a.mapPoint,t.visible=!0,s?.abort();const{editorItems:r}=o.viewModel;s=new AbortController;const n=await a.defer(()=>new Promise((e,t)=>{l(s?.signal,()=>t(d())),e(N(r,i,a,s?.signal))}));if(c(s),o.candidates=n.filter(e=>"fulfilled"===e.status).flatMap(e=>e.value).filter(e=>!e.isAggregate),t.visible=1===o.candidates.length,0===o.candidates.length)return;a.stopPropagation(),1===o.candidates.length?(o.rootFeature=o.candidates[0],e.go("editing-existing-feature").catch(()=>{}).then(()=>t.visible=!1)):e.next()}finally{r.resolve()}},F.TOOL),u=f(()=>null!=i.activeTool,()=>e.cancel({force:!0}),{once:!0});i.focus(),e.addHandles([p,u],this.id)},async tearDown(){0===o.candidates.length&&(o.viewModel.spinnerViewModel.visible=!1),e.removeHandles(this.id)}}),"awaiting-update-feature-candidate":()=>({id:"awaiting-update-feature-candidate",async setUp(){o.rootFeature=null;const{view:t}=o.viewModel;if(!t)return;const i=new C({view:t,highlightName:S});e.addHandles([w(()=>o.rootFeature,(e,t)=>{i.remove(t),i.add(e)},h),a(()=>i.removeAll())],this.id)},async tearDown(){e.removeHandles(this.id)}}),"editing-existing-feature":()=>({id:"editing-existing-feature",async setUp(){const{data:t}=e,{rootFeature:a}=t;if(!a)throw new i("editor:no-feature-specified","Cannot setup the 'updating-existing-feature' step until the root feature is defined");"split"===t.rootWorkflowType?await e.startSplittingFeature(a):await e.startUpdating(a),t.viewModel.spinnerViewModel.visible=!1;const o=s(async()=>{await u(()=>!e.updating),e.previous()});e.addHandles([w(()=>e.nestedWorkflowCount,(e,t)=>{0===e&&0!==t&&o()},h)],this.id)},async tearDown(){await e.cancelAll(),e.removeHandles(this.id)}}),"adding-attachment":()=>({id:"adding-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}})})}_logContinuingWithoutRelationshipWarning(e,t){o.getLogger(this).warn(`editor:${e}`,t,"The create operation will be allowed to proceed, but the resulting feature may not be related to the given parent feature.")}};function z(e,{keyField:t}){return e.getField(t)?.name??t}e([v()],G.prototype,"activeEditorItem",null),e([v()],G.prototype,"activeFeatureFormViewModel",null),e([v()],G.prototype,"activeUtilityNetworkAssociationAddAssociationViewModel",null),e([v()],G.prototype,"activeSketchViewModel",null),e([v()],G.prototype,"canDeleteAssociation",null),e([v()],G.prototype,"activeWorkflow",null),e([v()],G.prototype,"updating",null),e([v()],G.prototype,"data",void 0),e([v()],G.prototype,"hasPreviousStep",null),e([v()],G.prototype,"hasUpdatableCandidates",null),e([v()],G.prototype,"nestedWorkflowCount",null),e([v()],G.prototype,"shouldShowAttachments",null),e([v()],G.prototype,"shouldAllowAttachmentEditing",null),e([v()],G.prototype,"hasPendingEdits",null),e([v()],G.prototype,"helpMessage",null),e([v()],G.prototype,"reliesOnOwnerAdminPrivileges",null),e([v()],G.prototype,"hasInvalidFormTemplate",null),G=q=e([k("esri.widgets.Editor.UpdateWorkflow")],G);const Q=G;export{Q as default};
5
+ import{__decorate as t}from"tslib";import e from"../../Graphic.js";import i from"../../core/Error.js";import{makeHandle as a}from"../../core/handleUtils.js";import o from"../../core/Logger.js";import{abortMaybe as r}from"../../core/maybe.js";import{debounce as s,createResolver as n,onAbort as l,createAbortError as d,throwIfAborted as c}from"../../core/promiseUtils.js";import p from"../../core/Queue.js";import{whenOnce as u,watch as w,sync as h,when as f}from"../../core/reactiveUtils.js";import{last as g}from"../../core/SetUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as k}from"../../core/accessorSupport/decorators/subclass.js";import{isEditableLayer as m}from"../../layers/support/editableLayers.js";import{isFeatureLayer as y,isSubtypeSublayer as W,isSubtypeGroupLayer as A,isTable as _}from"../../layers/support/layerUtils.js";import{createFeatureServices as b}from"../../rest/featureService/utils.js";import C from"../../views/draw/support/HighlightHelper.js";import{ViewEventPriorities as F}from"../../views/input/InputManager.js";import{temporaryHighlightName as S}from"../../views/support/HighlightDefaults.js";import M from"./CreateFeaturesWorkflow.js";import I from"./SplitFeatureWorkflow.js";import{UpdateFeatureWorkflow as E}from"./UpdateFeatureWorkflow.js";import{UpdateRecordWorkflow as R}from"./UpdateRecordWorkflow.js";import V from"./UpdateWorkflowData.js";import U from"./Workflow.js";import{findEditorItemForLayer as j,isSplitFeatureWorkflow as P,isUpdateRecordWorkflow as L,isParentWorkflow as x,findEditorItemForLayerOrThrow as O,createWorkflowSteps as T,fetchCandidates as H}from"./workflowUtils.js";import{findUtilityNetwork as N,isGraphicForRelatableFeatureSupportedLayer as D}from"../Feature/support/featureUtils.js";var q;let G=q=class extends U{constructor(t){super(t),this._workflowStack=new p(g),this._sketchStack=new p(g),this.data=void 0,this.type="update"}destroy(){this._drainWorkflowStack(t=>t.cancel({force:!0}))}get activeEditorItem(){return this.activeWorkflow?.data.editorItem??void 0}get activeFeatureFormViewModel(){return this.activeWorkflow?.featureFormViewModel}get activeUtilityNetworkAssociationAddAssociationViewModel(){return"add-association"===this.activeWorkflow?.type?this.activeWorkflow.utilityNetworkAssociationAddAssociationViewModel:null}get activeSketchViewModel(){return this._sketchStack.peek()?.viewModel}get canDeleteAssociation(){const{activeFeatureFormViewModel:t}=this;if(!this.activeWorkflow||!this.data.viewModel.view?.map||!t)return!1;const{activeAssociation:e,feature:i}=t;return!(!e||!i?.sourceLayer||!y(i?.sourceLayer)&&!W(i?.sourceLayer))}get activeWorkflow(){return this._workflowStack.last()}get updating(){return this._updatingHandles.updating||!!this.activeWorkflow?.updating}get hasPreviousStep(){const t=this.activeWorkflow?.featureFormViewModel;return this._stepIndex>0||this.nestedWorkflowCount>1||null!=t?.relationshipId||"view"!==this.data.viewModel.attachmentsViewModel.mode||null!=t?.associationId||null!=t?.associatedLayer}get hasUpdatableCandidates(){const{candidates:t,viewModel:e}=this.data;return t.some(({layer:t})=>j(e.editorItems,t)?.supportsUpdateWorkflow)}get nestedWorkflowCount(){return this._workflowStack.length}get shouldShowAttachments(){return!!this.activeEditorItem?.capabilities.attachments.enabled}get shouldAllowAttachmentEditing(){return!!this.activeEditorItem?.capabilities.update.attachments.enabled}get hasPendingEdits(){return Array.from(this._workflowStack).some(t=>t.hasPendingEdits)}get helpMessage(){return this.activeWorkflow?.helpMessage?this.activeWorkflow.helpMessage:"awaiting-feature-to-update"===this.stepId?"select":void 0}get reliesOnOwnerAdminPrivileges(){return this.activeWorkflow?.reliesOnOwnerAdminPrivileges??!1}get hasInvalidFormTemplate(){return!!this.activeEditorItem?.hasInvalidFormTemplate}async back(t=()=>Promise.resolve(!0)){const{activeWorkflow:e}=this,i=e?.featureFormViewModel;if(i?.activeRelationshipInput){const t=i.activeRelationshipInput;if(t.activeCategory)return void(t.activeCategory=null);if(null!=i.relationshipId)return void(i.relationshipId=null);if(t.showAllEnabled)return void(t.showAllEnabled=!1)}if("add-association"===e?.type){const{activeUtilityNetworkAssociationAddAssociationViewModel:t}=this;if(t?.filterOptionsVisible)return void(t.filterOptionsVisible=!1);t?.featureSpatialItems.length&&t.reset()}if(null==i?.associatedLayer)if(null==i?.associationId)if("create-features"===e?.type&&e.hasPreviousStep)await e.previous({cancelCurrentStep:!0});else if(e){if(e.hasPendingEdits&&!i?.disabled){if(!await t())return}e.hasPreviousStep?await e.previous({cancelCurrentStep:!0}):await this.cancelActiveWorkflow({force:!0})}else this.hasPreviousStep?await this.previous({cancelCurrentStep:!0}):await this.cancel({force:!0});else i.associationId=null;else i.associatedLayer=null}async cancelActiveWorkflow(t){await(this.activeWorkflow?.cancel(t)),await this._popWorkflowAndReconcile()}async commit(){await this._drainWorkflowStack(t=>t.commit()),await super.commit()}static create(t){const{startAt:e,applyEdits:i,applyEditsFeatureService:a,...o}=t,r=new q({data:new V({applyEditsCallback:i,applyEditsFeatureServiceCallback:a,...o}),onCommit:async()=>{}});return r._set("steps",this._createWorkflowSteps(r,e)),r}async save(){const{activeFeatureFormViewModel:t}=this;if(t){if(t.submit(),!t.submittable||t.pendingSubtypeChoice)return;const e=t.getValues();if(t.validateContingencyConstraints(e,{includeIncompleteViolations:!0}).length>0)return}if(this.nestedWorkflowCount<2)return await this.commit();const{activeWorkflow:e}=this;if(await(e?.commit()),!P(e))return void await this._popWorkflowAndReconcile();this._popWorkflow();const i=this._workflowStack.peek();if(i&&i===e?.parent&&(await i.cancel(),this._popWorkflow(),0===this.nestedWorkflowCount))return await this.commit();await this._reconcileWorkflowStack()}async startCreatingRelatedRecord(t){try{const e=this._createNestedCreateFeaturesWorkflow(t);await this._pushWorkflowAndReconcile(e)}catch(e){throw new i("editor:unable-to-start-creating","Could not begin updating the provided feature or table record.",{error:e})}}async startSplittingFeature(t,e){try{const i=await this._createNestedSplitFeatureWorkflow(t,e);await this._pushWorkflowAndReconcile(i)}catch(a){throw new i("editor:unable-to-start-splitting","Could not begin splitting the provided feature.",{error:a})}}async startUpdating(t,e){try{const i=await this._createNestedUpdateWorkflow(t,e);await this._pushWorkflowAndReconcile(i)}catch(a){throw new i("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:a})}}async startAddAssociation(t,e,a){try{const i=await this._createNestedAddAssociationWorkflow(t,e,a);await this._pushWorkflowAndReconcile(i)}catch(o){throw new i("editor:unable-to-start-updating","Could not begin updating the provided feature or table record.",{error:o})}}async deleteActiveFeature(){const{activeWorkflow:t}=this;if(!t)throw new i("editor:nothing-to-delete","There is no feature to delete");const e=L(t);e?(t.stageDelete(),t.data.edits.feature===this.data.rootFeature&&this._removeRootFeatureFromCandidates()):await t.cancel(),this.nestedWorkflowCount<2?e?await this.commit():await this.cancel({force:!0}):(e&&await t.commit(),await this._popWorkflowAndReconcile(),await this._returnToPageWithContent())}async deleteActiveAssociation(){if(!this.canDeleteAssociation)throw new i("editor:nothing-to-delete","There is no association to delete");await this._deleteActiveAssociation(),await this._popWorkflowAndReconcile(),await this._returnToPageWithContent()}async cancelAll(){await this._drainWorkflowStack(t=>t.cancel({force:!0}))}async _deleteActiveAssociation(){const{activeFeatureFormViewModel:t,data:e}=this,{activeAssociation:a,feature:o}=t,{applyEditsFeatureServiceCallback:r,viewModel:s}=e,{sourceLayer:n}=o,l=W(n)&&n.parent?n.parent:n,d=b([l]),c=d.values().next().value?.featureService;if(!c)throw new i("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(c?.load());const p=s.view.map,u=N(p,l);await(u?.networkSystemLayers.loadAssociationsTable());const w=u?.generateDeleteAssociations([a]);if(!w)throw new i("editor:failed-to-delete-association","Could not create payload needed to delete association");const h=u?.gdbVersion??void 0;await r(c,[w],{gdbVersion:h,globalIdUsed:!0})}_removeRootFeatureFromCandidates(){const{candidates:t,rootFeature:e}=this.data;if(0===t.length||!e)return;const i=t.indexOf(e);i>-1&&t.splice(i,1)}async _returnToPageWithContent(){const{activeFeatureFormViewModel:t}=this;if(!t?.activeAssociationInput)return;const{activeAssociationInput:e,associationId:i}=t;await e.refresh(),e.associatedLayer&&!e.associatedFeatures?.length&&(t.associatedLayer=null),null==i||e.associatedFeatureInfos.size||(t.associationId=null)}_createNestedCreateFeaturesWorkflow(t){const{relatedLayer:e}=t,{addAttachmentsCallback:a,applyEditsCallback:o,applyEditsFeatureServiceCallback:r,sketchOptions:s,snappingManager:n,viewModel:l}=this.data;if(!m(e))throw new i("editor:unsupported-layer","Editing is not supported on the provided layer");const d=this._getCreationInfoForNestedCreateFeaturesWorkflow(t),c=d.template||d.initialFeature?"creating-features":"awaiting-feature-creation-info",p=x(this.activeWorkflow)?this.activeWorkflow:void 0;return M.create({addAttachmentsCallback:a,applyEdits:o,applyEditsFeatureService:r,creationInfo:d,isNested:!0,parent:p,sketchOptions:s,snappingManager:n,startAt:c,viewModel:l})}_getCreationInfoForNestedCreateFeaturesWorkflow(t){const{relatedLayer:a}=t;if(!m(a)||A(a))throw new i("editor:unsupported-layer","Editing is not supported on the provided layer");const{viewModel:o}=this.data,r={layer:a,maxFeatures:1},s=this._makeRelatedRecordAttributes(t),n=o.getTemplatesForLayer(a);return n?.length>0?(r.attributeOverrides=s,1===n.length&&(r.template=n[0])):r.initialFeature=new e({sourceLayer:a,attributes:s}),r}async _createNestedUpdateWorkflow(t,e={}){const i=_(t.sourceLayer)?R:E,{applyEditsCallback:a,applyEditsFeatureServiceCallback:o,sketchOptions:r,snappingManager:s,viewModel:n}=this.data,l=x(this.activeWorkflow)?this.activeWorkflow:void 0,d=await i.create({feature:t,parent:l,sketchOptions:r,snappingManager:s,viewModel:n,applyEdits:a,applyEditsFeatureService:o,featureFormCallbacks:{addRelatedRecord:async t=>await this._updatingHandles.addPromise(this.startCreatingRelatedRecord(t)),editRelatedRecord:async({relatedFeature:t,readOnly:e})=>await this._updatingHandles.addPromise(this.startUpdating(t,{readOnly:e})),selectAssociatedFeature:async({feature:t,association:e})=>await this._updatingHandles.addPromise(this.startUpdating(t,{association:e})),addAssociation:async t=>await this._updatingHandles.addPromise(this.startAddAssociation(t.feature,t.utilityNetwork,t.associationType))},...e});return await u(()=>!d.updating),d}async _createNestedAddAssociationWorkflow(t,e,i){const{AddAssociationWorkflow:a}=await import("./AddAssociationWorkflow.js"),{applyEditsCallback:o,applyEditsFeatureServiceCallback:r,viewModel:s}=this.data,n=x(this.activeWorkflow)?this.activeWorkflow:void 0,l=this.activeFeatureFormViewModel?.activeAssociationInput,d=await a.create({utilityNetwork:e,associationType:i,feature:t,parent:n,viewModel:s,associationInput:l,applyEdits:o,applyEditsFeatureService:r});return await u(()=>!d.updating),d}async _createNestedSplitFeatureWorkflow(t,e){const{applyEditsCallback:i,applyEditsFeatureServiceCallback:a,viewModel:o}=this.data,r=x(this.activeWorkflow)?this.activeWorkflow:void 0,s=O(o.editorItems,t.sourceLayer),n=I.create({applyEdits:i,applyEditsFeatureService:a,editorItem:s,originalFeature:t,parent:r,viewModel:o,...e});return await u(()=>!n.updating),n}async _drainWorkflowStack(t){const e=this._workflowStack,i=[];for(const a of e){const e=t(a).finally(()=>a.destroy());this._updatingHandles.addPromise(e),i.push(e)}await Promise.all(i),this._workflowStack.clear(),this._sketchStack.clear()}_makeRelatedRecordAttributes(t){const{parentFeature:e,relatedLayer:i,relationshipId:a}=t;if(!D(e))return;const o=i.relationships?.find(t=>t.id===a);if(!o)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the destination layer.");if("origin"===o.role)return void this._logContinuingWithoutRelationshipWarning("unsupported-role","Creating new related records in the 'origin' table of a relationship is not yet supported");const r=e.sourceLayer;o.relatedTableId!==r.layerId&&this._logContinuingWithoutRelationshipWarning("invalid-argument-combination","The given parent feature does not belong to the relationship designated by the given relationship ID.");const s=r.relationships?.find(t=>t.id===a);if(!s)return void this._logContinuingWithoutRelationshipWarning("relationship-not-found","Could not begin creating a related record because the relationship specified could not be found on the origin layer.");const n=z(r,s),l=e.getAttribute(n);l||this._logContinuingWithoutRelationshipWarning("no-key-on-origin-feature","The given parent feature does not have a value for the relationship's origin primary key field.");const d=z(i,o);return{[d]:l}}_popWorkflow(){this._workflowStack.pop()?.destroy(),this._sketchStack.pop()}async _popWorkflowAndReconcile(){this._popWorkflow();const t=await this._reconcileWorkflowStack();if(t.failureCount>0)throw new i("editor:next-workflow-failed","Popped the top workflow, but the next workflow in the stack failed to activate",t)}async _pushWorkflowAndReconcile(t){const e=this._workflowRequiresSketchViewModel(t);this.activeWorkflow?.exit({removeSketchHandles:e});const a=this._sketchStack,o=await(t?.start()),r=a.peek();o?(r?.exit(),a.push(o)):a.push(this._cloneSketchController(r)),this._workflowStack.push(t);const s=await this._reconcileWorkflowStack();if(s.failureCount>0)throw new i("editor:failed-to-start-updating-feature","Failed to enter the provided workflow.",s)}async _reconcileWorkflowStack(){const t=this._workflowStack,e=this._sketchStack;try{const i=t.peek();return await(i?.enter()),await(e.peek()?.enter()),{activeWorkflow:i,failureCount:0}}catch(i){t.pop().destroy(),e.pop();const{activeWorkflow:a,failureCount:o}=await this._reconcileWorkflowStack();return{activeWorkflow:a,failureCount:o+1}}}_cloneSketchController(t){return{enter:t?.enter??(async()=>{}),exit:t?.exit??(async()=>{}),viewModel:t?.viewModel}}_workflowRequiresSketchViewModel(t){const{type:e}=t;return"update-feature"===e||"create-features"===e&&!_(t.data.creationInfo?.layer)}static _createWorkflowSteps(t,e="awaiting-feature-to-update"){const{data:o}=t;return T(["awaiting-feature-to-update","awaiting-update-feature-candidate","editing-existing-feature","adding-attachment","editing-attachment"],e,{"awaiting-feature-to-update":()=>({id:"awaiting-feature-to-update",async setUp(){const{spinnerViewModel:e}=o.viewModel,i=o.viewModel.view;i.activeTool=null;let s=null;t.addHandles(a(()=>{s=r(s)}),this.id),o.rootFeature=null,o.candidates=[];const p=i.on("immediate-click",async a=>{const r=n();t._updatingHandles.addPromise(r.promise);try{e.location=a.mapPoint,e.visible=!0,s?.abort();const{editorItems:r}=o.viewModel;s=new AbortController;const n=await a.defer(()=>new Promise((t,e)=>{l(s?.signal,()=>e(d())),t(H(r,i,a,s?.signal))}));if(c(s),o.candidates=n.filter(t=>"fulfilled"===t.status).flatMap(t=>t.value).filter(t=>!t.isAggregate),e.visible=1===o.candidates.length,0===o.candidates.length)return;a.stopPropagation(),1===o.candidates.length?(o.rootFeature=o.candidates[0],t.go("editing-existing-feature").catch(()=>{}).then(()=>e.visible=!1)):t.next()}finally{r.resolve()}},F.TOOL),u=f(()=>null!=i.activeTool,()=>t.cancel({force:!0}),{once:!0});i.focus(),t.addHandles([p,u],this.id)},async tearDown(){0===o.candidates.length&&(o.viewModel.spinnerViewModel.visible=!1),t.removeHandles(this.id)}}),"awaiting-update-feature-candidate":()=>({id:"awaiting-update-feature-candidate",async setUp(){o.rootFeature=null;const{view:e}=o.viewModel;if(!e)return;const i=new C({view:e,highlightName:S});t.addHandles([w(()=>o.rootFeature,(t,e)=>{i.remove(e),i.add(t)},h),a(()=>i.removeAll())],this.id)},async tearDown(){t.removeHandles(this.id)}}),"editing-existing-feature":()=>({id:"editing-existing-feature",async setUp(){const{data:e}=t,{rootFeature:a}=e;if(!a)throw new i("editor:no-feature-specified","Cannot setup the 'updating-existing-feature' step until the root feature is defined");"split"===e.rootWorkflowOptions?.type?await t.startSplittingFeature(a,e.rootWorkflowOptions.props):await t.startUpdating(a),e.viewModel.spinnerViewModel.visible=!1;const o=s(async()=>{await u(()=>!t.updating),t.previous()});t.addHandles([w(()=>t.nestedWorkflowCount,(t,e)=>{0===t&&0!==e&&o()},h)],this.id)},async tearDown(){await t.cancelAll(),t.removeHandles(this.id)}}),"adding-attachment":()=>({id:"adding-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"editing-existing-feature",async setUp(){},async tearDown(){o.viewModel.attachmentsViewModel.mode="view"}})})}_logContinuingWithoutRelationshipWarning(t,e){o.getLogger(this).warn(`editor:${t}`,e,"The create operation will be allowed to proceed, but the resulting feature may not be related to the given parent feature.")}};function z(t,{keyField:e}){return t.getField(e)?.name??e}t([v()],G.prototype,"activeEditorItem",null),t([v()],G.prototype,"activeFeatureFormViewModel",null),t([v()],G.prototype,"activeUtilityNetworkAssociationAddAssociationViewModel",null),t([v()],G.prototype,"activeSketchViewModel",null),t([v()],G.prototype,"canDeleteAssociation",null),t([v()],G.prototype,"activeWorkflow",null),t([v()],G.prototype,"updating",null),t([v()],G.prototype,"data",void 0),t([v()],G.prototype,"hasPreviousStep",null),t([v()],G.prototype,"hasUpdatableCandidates",null),t([v()],G.prototype,"nestedWorkflowCount",null),t([v()],G.prototype,"shouldShowAttachments",null),t([v()],G.prototype,"shouldAllowAttachmentEditing",null),t([v()],G.prototype,"hasPendingEdits",null),t([v()],G.prototype,"helpMessage",null),t([v()],G.prototype,"reliesOnOwnerAdminPrivileges",null),t([v()],G.prototype,"hasInvalidFormTemplate",null),G=q=t([k("esri.widgets.Editor.UpdateWorkflow")],G);const Q=G;export{Q 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import o from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../views/interactive/sketch/SketchOptions.js";let p=class extends o{constructor(t){super(t),this.addAttachmentsCallback=null,this.applyEditsCallback=null,this.applyEditsFeatureServiceCallback=null,this.candidates=[],this.rootFeature=null,this.rootWorkflowType="update",this.sketchOptions=new s,this.snappingManager=null,this.viewModel=null}};t([e()],p.prototype,"addAttachmentsCallback",void 0),t([e()],p.prototype,"applyEditsCallback",void 0),t([e()],p.prototype,"applyEditsFeatureServiceCallback",void 0),t([e()],p.prototype,"candidates",void 0),t([e()],p.prototype,"rootFeature",void 0),t([e()],p.prototype,"rootWorkflowType",void 0),t([e({constructOnly:!0})],p.prototype,"sketchOptions",void 0),t([e()],p.prototype,"snappingManager",void 0),t([e()],p.prototype,"viewModel",void 0),p=t([r("esri.widgets.Editor.UpdateWorkflowData")],p);const a=p;export{a as default};
5
+ import{__decorate as t}from"tslib";import o from"../../core/Accessor.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import s from"../../views/interactive/sketch/SketchOptions.js";let p=class extends o{constructor(t){super(t),this.addAttachmentsCallback=null,this.applyEditsCallback=null,this.applyEditsFeatureServiceCallback=null,this.candidates=[],this.rootFeature=null,this.rootWorkflowOptions={type:"update"},this.sketchOptions=new s,this.snappingManager=null,this.viewModel=null}};t([e()],p.prototype,"addAttachmentsCallback",void 0),t([e()],p.prototype,"applyEditsCallback",void 0),t([e()],p.prototype,"applyEditsFeatureServiceCallback",void 0),t([e()],p.prototype,"candidates",void 0),t([e()],p.prototype,"rootFeature",void 0),t([e()],p.prototype,"rootWorkflowOptions",void 0),t([e({constructOnly:!0})],p.prototype,"sketchOptions",void 0),t([e()],p.prototype,"snappingManager",void 0),t([e()],p.prototype,"viewModel",void 0),p=t([r("esri.widgets.Editor.UpdateWorkflowData")],p);const i=p;export{i 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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.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 s}from"../../../core/accessorSupport/decorators/subclass.js";import{isTable as o}from"../../../layers/support/layerUtils.js";import i from"./EditorEditingCapabilities.js";import{formTemplateHasInvalidFields as l}from"../../FeatureForm/featureFormUtils.js";let a=class extends t{constructor(e){super(e),this.disabled=!1,this.layer=null,this.layerInfo=null,this.layerView=null}get _suspended(){return!!this.layerView?.suspended}get capabilities(){return new i({layer:this.layer,layerInfo:this.layerInfo,layerView:this.layerView})}get editable(){const{create:e,relationship:t,update:r,delete:{enabled:s}}=this.capabilities,o=e.attachments.enabled||r.attachments.enabled;return!this.disabled&&(e.enabled||r.enabled||o||s||t.enabled)}get formTemplate(){return this.capabilities.formTemplate}get hasInvalidFormTemplate(){return l(this.layer,this.formTemplate)}get isTable(){return o(this.layer)}get supportsCreateFeaturesWorkflow(){if(this.disabled)return!1;const{enabled:e,geometry:t}=this.capabilities.create;return this.isTable?e:e&&t}get supportsUpdateWorkflow(){const{capabilities:e}=this;return!this.disabled&&(e.update.enabled||e.update.attachments.enabled||e.delete.enabled)}get visible(){const{layer:e}=this,t=e.parent;return!this._suspended&&e.visible&&(!t||!("visible"in t)||t.visible)}};e([r()],a.prototype,"_suspended",null),e([r()],a.prototype,"capabilities",null),e([r()],a.prototype,"disabled",void 0),e([r()],a.prototype,"editable",null),e([r()],a.prototype,"formTemplate",null),e([r()],a.prototype,"hasInvalidFormTemplate",null),e([r()],a.prototype,"isTable",null),e([r()],a.prototype,"layer",void 0),e([r()],a.prototype,"layerInfo",void 0),e([r()],a.prototype,"layerView",void 0),e([r()],a.prototype,"supportsCreateFeaturesWorkflow",null),e([r()],a.prototype,"supportsUpdateWorkflow",null),e([r()],a.prototype,"visible",null),a=e([s("esri.widgets.Editor.support.EditorItem")],a);const p=a;export{p as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.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{isTable as s}from"../../../layers/support/layerUtils.js";import l from"./EditorEditingCapabilities.js";import{formTemplateHasInvalidFields as i}from"../../FeatureForm/featureFormUtils.js";let a=class extends t{constructor(e){super(e),this.disabled=!1,this.layer=null,this.layerInfo=null,this.layerView=null}get _suspended(){return!!this.layerView?.suspended}get capabilities(){return new l({layer:this.layer,layerInfo:this.layerInfo,layerView:this.layerView})}get editable(){const{create:e,relationship:t,update:r,delete:{enabled:o}}=this.capabilities,s=e.attachments.enabled||r.attachments.enabled;return!this.disabled&&(e.enabled||r.enabled||s||o||t.enabled)}get formTemplate(){return this.capabilities.formTemplate}get hasInvalidFormTemplate(){return i(this.layer,this.formTemplate)}get isTable(){return s(this.layer)}get supportsCreateFeaturesWorkflow(){if(this.disabled)return!1;const{enabled:e,geometry:t}=this.capabilities.create;return this.isTable?e:e&&t}get supportsSplitFeatureWorkflow(){const{capabilities:e}=this;return!this.disabled&&e.update.enabled&&e.update.geometry&&e.create.enabled}get supportsUpdateWorkflow(){const{capabilities:e}=this;return!this.disabled&&(e.update.enabled||e.update.attachments.enabled||e.delete.enabled)}get visible(){const{layer:e}=this,t=e.parent;return!this._suspended&&e.visible&&(!t||!("visible"in t)||t.visible)}};e([r()],a.prototype,"_suspended",null),e([r()],a.prototype,"capabilities",null),e([r()],a.prototype,"disabled",void 0),e([r()],a.prototype,"editable",null),e([r()],a.prototype,"formTemplate",null),e([r()],a.prototype,"hasInvalidFormTemplate",null),e([r()],a.prototype,"isTable",null),e([r()],a.prototype,"layer",void 0),e([r()],a.prototype,"layerInfo",void 0),e([r()],a.prototype,"layerView",void 0),e([r()],a.prototype,"supportsCreateFeaturesWorkflow",null),e([r()],a.prototype,"supportsSplitFeatureWorkflow",null),e([r()],a.prototype,"supportsUpdateWorkflow",null),e([r()],a.prototype,"visible",null),a=e([o("esri.widgets.Editor.support.EditorItem")],a);const p=a;export{p 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.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../Color.js";import t from"../../Graphic.js";import{isSome as r,equals as n,addMany as o}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import"../../core/has.js";import i from"../../core/Error.js";import{handlesGroup as s,makeHandle as l,abortHandle as c}from"../../core/handleUtils.js";import{clone as u}from"../../core/lang.js";import d from"../../core/Logger.js";import{getOrCreateMapValue as p}from"../../core/MapUtils.js";import{debounce as f,isPromiseLike as y,throwIfAborted as m,whenOrAbort as h}from"../../core/promiseUtils.js";import{watch as g,on as b,whenOnce as w}from"../../core/reactiveUtils.js";import{px2pt as I}from"../../core/screenUtils.js";import{addMany as v}from"../../core/SetUtils.js";import{diff as T}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as S,isSharedGroupTemplate as F,isSharedTemplate as j,isSharedPresetTemplate as k,isStandardFeatureTemplate as A,isSharedFeatureTemplate as L}from"../../editing/templateUtils.js";import{getSharedTemplateProvider as U}from"../../editing/sharedTemplates/SharedTemplateProvider.js";import V from"../../layers/GraphicsLayer.js";import{featureHasFields as M,fixFields as O,getDisplayFieldName as x}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as q}from"../../layers/support/layerUtils.js";import{calculateTolerance as z}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as E}from"../../renderers/support/lengthUtils.js";import{isRenderer as P}from"../../renderers/support/typeUtils.js";import{getTransformationType as C}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import D from"../../symbols/SimpleFillSymbol.js";import R from"../../symbols/SimpleLineSymbol.js";import G from"../../symbols/SimpleMarkerSymbol.js";import{to3D as B}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as N}from"../../symbols/support/symbolUtils.js";import{getServices as Z}from"../../undoredo/support/Services.js";import{GraphicState as W}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as Q}from"../../views/draw/DrawingMode.js";import{createQueryGeometry as $}from"../../views/support/drapedUtils.js";import{filterGraphicHits as J,hitTestSelectSimilarDistance as H}from"../../views/support/hitTestSelectUtils.js";import{dependencySort as K}from"./support/dependencySort.js";import{isDrawGraphicTool as X}from"../Sketch/support/sketchUtils.js";const Y=()=>d.getLogger("esri.widgets.Editor.workflowUtils");function _(e){return!!e&&"features"in e}function ee(e){return null!=e&&"create-features"===e.type}function te(e){return null!=e&&"update-features"===e.type}function re(e){return null!=e&&e.type.includes("update-")&&"fullFeature"in e}function ne(e){return null!=e&&"update"===e.type}function oe(e){return null!=e&&"split-feature"===e.type}function ae(e){const t=e?.type;return"update-feature"===t||"update-table-record"===t||"split-feature"===t}function ie(e){const t=e&&"renderer"in e?e.renderer:null;if(!fe(t))return{rotation:null,size:null};const r=t.getVisualVariablesForType("rotation").filter(e=>(!e.axis||"heading"===e.axis)&&e.field&&!e.valueExpression),n=t.getVisualVariablesForType("size").filter(e=>e.field&&!e.useSymbolValue&&!e.valueExpression&&"real-world-size"===C(e));return{rotation:1===r.length?r[0]:null,size:1===n.length?n[0]:null}}function se(e){const t=e.sourceLayer;if(!(t&&"renderer"in t&&fe(t.renderer)))return{rotation:null,size:null};const{rotation:r,size:n}=ie(t);let o=null,a=null;if(r){const e=t.fields?.filter(e=>e.name===r.field),n=1===e?.length?e[0]:null;o=le(r,n)}if(n){const e=t.fields?.filter(e=>e.name===n.field),r=1===e?.length?e[0]:null;a=de(n,r)}return{rotation:o,size:a}}function le(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=t?.type??"double",o={initial:0,current:0};return{field:e.field,fieldType:n,getDefaultValue:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,pe((o.current+360)%360,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function ce(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function ue(e,t,r){if(null==t)return 0;const{symbol:n}=B(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const o=n.symbolLayers.at(0);if(!o)return 0;switch(o.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return Math.min(tt.icon,(await e(o,tt.icon))[0])||tt.icon}case"text":return tt.text;case"line":return tt.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return ce(await t(o,e.scale/tt.viewScaleSizeFactor),r)}case"path":case"extrude":return e.scale/tt.viewScaleSizeFactor;default:return 0}}function de(e,t){const r=e.axis,n=t?.type??"double",o={initial:0,current:0},a=E[e.valueUnit]??1;let i;return i="area"===e.valueRepresentation?e=>(e*a/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*a/2:e=>e*a,{field:e.field,fieldType:n,getDefaultValue:async(e,t)=>pe(i(await ue(t,e,r)),n),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,pe(o.current,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:ot(e.valueUnit),axis:e.axis}}function pe(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function fe(e){if(!P(e))return!1;switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function ye(e,t,r){const n=await N(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=T(e.symbol,n)&&(e.symbol=n)}function me(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const n={mode:Q,optionsPerTool:r};if(S(t)){const o=t.defaultTool,a=F(t)?t.definition?.inputGeometryType??e:e;switch(o){case"freehand":case"stream-line":return{tool:"polyline"===a?"freehandPolyline":"freehandPolygon",createOptions:n};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:n};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===a?"polygon":"polyline",createOptions:n};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:n};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:n};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:n};case"line":case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:n};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:n};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:n}}}else{const o=t.drawingTool;if("circle"===o||"ellipse"===o)return r.get("circle").preserveAspectRatio="circle"===o,{tool:"circle",createOptions:n};if("rectangle"===o)return{tool:"rectangle",createOptions:n};if("freehand"===o)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:n}}return{tool:e,createOptions:n}}async function he(e,t,r,n){const{creationInfo:o,fullTemplate:a}=r;if(!o)throw new i("featureworkflow","No creation info provided.");const s=o.layer,l=qe(a,o.attributeOverrides),{view:c}=e,u="2d"===c?.type;F(a)||k(a)||await ze(e,s,l,n,u?c.scale:null);const{capabilities:d}=s;t.elevationInfo=s.elevationInfo;const p=me(s.geometryType,a);e.defaultCreateOptions={graphicProperties:{attributes:l,sourceLayer:s},mode:p.createOptions.mode,optionsPerTool:p.createOptions.optionsPerTool,preserveAspectRatio:p.createOptions.preserveAspectRatio,hasZ:d.data.supportsZ,defaultZ:(u?d.editing.zDefault:null)??e.defaultCreateOptions.defaultZ},null==o.geometryToPlace?await e.create(p.tool):await e.place(o.geometryToPlace,{graphicProperties:{attributes:l,sourceLayer:s}})}async function ge(e){return s([be(e),we(e)])}function be({creationAttributes:e,data:t,sketchViewModel:r,view:n,webStyleCache:o}){const{creationInfo:a}=t,{fullTemplate:i}=t;if(!a||"2d"!==n?.type||F(i)||k(i))return null;const s=f(t=>ze(r,a.layer,e,o,t));return g(()=>n.scale,e=>s(e))}function we({data:t,sketchViewModel:r,view:n}){const{templateExecutorInfo:o}=t;if(!o)return null;const a=r.activeComponent;if(!n||!X(a))return Y().error(new i("featureworkflow","Failed to set up template feedback.")),null;const c=new V({effect:"saturate(0.6) opacity(0.8)",listMode:"hide",title:"Shared Template Feedback Graphics"});n.map?.add(c);const{executor:u,serviceLayersById:d}=o,p=n.theme?.accentColor??new e([255,165,0,1]);return s([b(()=>a,["cursor-update","vertex-add"],()=>{c.removeAll();const e=a.graphic?.geometry;if(!e||!Ie(e))return;const t=u(e,"digitizing");if(!y(t))for(const r of t.edits){const e=d.get(r.id);if(e&&r.addFeatures&&0!==r.addFeatures.length)for(const t of e)if(!t.isTable)for(const e of r.addFeatures){const t=ve(e,p);t&&c.add(t)}}}),l(()=>{n.map.remove(c),c.destroy()})])}function Ie(e){switch(e.type){case"point":case"multipoint":return!0;case"polyline":return e.paths[0].length>1;case"polygon":{const t=e.rings[0];return n(t.at(0),t.at(-1))?t.length>2:t.length>1}default:return!1}}function ve(e,r){let n=null;switch(e.geometry?.type){case"point":case"multipoint":n=new G({angle:0,color:r,outline:new R({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:1}),path:"undefined",size:8,style:"circle",xoffset:0,yoffset:0});break;case"polygon":n=new D({color:r,outline:new R({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:3}),style:"none"});break;case"polyline":n=new R({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:2});break;default:return null}return new t({geometry:e.geometry,symbol:n,attributes:{...e.attributes}})}async function Te(e,t){const r=await Z(t).load(),n=q(e)?e.parent:e;return r.tablesAndLayersLookup.get(n)}async function Se(e,t){const r=await Te(e,t);if(!r)return new Map;const n=new Map;for(const o of r.layersAndTables)p(n,o.layerId,()=>[]).push(o);return n}function Fe(e){const t=e.objectIdField,r=e.globalIdField??"";return{id:e.layerId,identifierFields:{objectIdField:t,globalIdField:r},addFeatures:[],deleteAttachments:[],addAttachments:[],deleteFeatures:[],updateFeatures:[]}}function je(e){const{edits:t,serviceInfo:n,view:o,findOriginalFeature:a}=e,i=ke(n.layersAndTables),s=n.layersAndTables.toArray(),{allEditData:l,editDataByLayerIdMap:c,editDataByIdMap:u}=Le(t,i,a),d=Ue(l,Ae(s,c),c);if(o&&Oe(l,d,o),0===d.length)return t;const p=K(d,{continueOnCircularDependency:!0}).map(e=>u.get(e)).filter(r),f=new Map;for(const r of p)f.set(r.uniqueId,r);const y=[];for(const r of l)f.has(r.uniqueId)||y.push(r);const m=[];let h=null;for(const r of p){const{layer:e}=r;switch(null==h?h=Fe(e):h.id!==e.layerId&&(m.push(h),h=Fe(e)),r.operationType){case"add":case"modify":h.addFeatures.push(r.after);break;case"delete":h.deleteFeatures.push(r.before)}}null!==h&&m.push(h);for(const r of y){const e=r.layer.layerId,t=m.find(t=>t.id===e)??Fe(r.layer);switch(m.includes(t)||m.push(t),r.operationType){case"add":t.addFeatures.push(r.after);break;case"modify":t.updateFeatures.push(r.after);break;case"delete":t.deleteFeatures.push(r.before);break;case"deleteAttachment":t.deleteAttachments.push(r.attachmentId);break;case"addAttachment":t.addAttachments.push(r.attachment)}}for(const r of m)void 0!==r.deleteAttachments&&0===r.deleteAttachments.length&&delete r.deleteAttachments,void 0!==r.addAttachments&&0===r.addAttachments.length&&delete r.addAttachments;return m}function ke(e){const t=new Map;for(const r of e)t.set(r.layerId,r);return t}function Ae(e,t){const r=new Map;for(const n of e)for(const e of n.relationships??[])if(r.set(Ve(n,e),""),t.has(e.relatedTableId)){const o=t.get(e.relatedTableId);if(o.length>0)for(const t of o[0].layer.relationships??[])if(t.id===e.id){r.set(Ve(n,e),t.keyField);break}}return r}function Le(e,t,r){const n=new Map,o=[],a=new Map;let s=1;for(const l of e){const e=[],c=t.get(l.id);if(!c)throw new i("featureworkflow",`Failed to prepare applyEdits payload. Layer with id ${l.id} not found.`);for(const t of l.addFeatures??[])e.push({uniqueId:"T"+s++,operationType:"add",layer:c,after:t});for(const t of l.deleteFeatures??[])e.push({uniqueId:"T"+s++,operationType:"delete",before:t,layer:c});for(const t of l.deleteAttachments??[])e.push({uniqueId:"T"+s++,operationType:"deleteAttachment",attachmentId:t,layer:c});for(const t of l.addAttachments??[])e.push({uniqueId:"T"+s++,operationType:"addAttachment",attachment:t,layer:c});for(const t of l.updateFeatures??[])e.push({uniqueId:"T"+s++,operationType:"modify",before:r(t),after:t,layer:c});n.set(c.layerId,e);for(const t of e)o.push(t),a.set(t.uniqueId,t)}return{allEditData:o,editDataByIdMap:a,editDataByLayerIdMap:n}}function Ue(e,t,r){const n=[];for(const o of e){const e=o.layer.relationships??[],{uniqueId:a}=o;for(const i of e){const e=i.keyField;if("origin"===i.role){const s=r.get(i.relatedTableId);if(!s||0===s.length)continue;const l=Ve(o.layer,i),c=t.get(l);if(void 0===c||""===c)continue;switch(o.operationType){case"add":for(const t of s)t!==o&&("add"!==t.operationType&&"modify"!==t.operationType||t.after.attributes[c]===o.after.attributes[e]&&n.push([a,t.uniqueId]));break;case"modify":if(o.before.attributes[e]!==o.after.attributes[e])for(const t of s){const r=t.uniqueId;t!==o&&("delete"===t.operationType?t.before.attributes[c]===o.before.attributes[e]?n.push([r,a]):t.before.attributes[c]===o.after.attributes[e]&&n.push([a,r]):"add"===t.operationType?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):t.after.attributes[c]===o.before.attributes[e]&&n.push([r,a]):"modify"===t.operationType&&(t.before.attributes[c]!==t.after.attributes[c]?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):n.push([r,a]):n.push([a,r])))}break;case"delete":for(const t of s)t!==o&&("delete"!==t.operationType&&"modify"!==t.operationType||t.before.attributes[c]===o.before.attributes[e]&&n.push([t.uniqueId,a]))}}}}return n}function Ve(e,t){return`${e.layerId}:${t.id}`}function Me(e,t){return!!(t?.map&&"utilityNetworks"in t.map&&t.map.utilityNetworks?.length&&t.map.utilityNetworks.some(t=>!(!t.loaded||!e.url?.startsWith(t.featureServiceUrl)||e.layerId!==t.networkSystemLayers.associationsTableId)))}function Oe(e,t,r){const n=[];for(const a of e)Me(a.layer,r)&&n.push(a);if(0===n.length)return;let o=[];for(const a of n){const r=a.layer;switch(a.operationType){case"delete":o=[...xe(a.before.attributes[r.fieldsIndex.get("fromglobalid").name],e),...xe(a.before.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([a.uniqueId,e.uniqueId]);break;case"add":o=[...xe(a.after.attributes[r.fieldsIndex.get("fromglobalid").name],e),...xe(a.after.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([e.uniqueId,a.uniqueId])}}}function xe(e,t){const r=[],n=t.filter(({layer:e})=>""!==e.globalIdField&&null!=e.globalIdField);for(const o of n){const t=o.layer.globalIdField;("before"in o&&o.before?.attributes[t]===e||"after"in o&&o.after?.attributes[t]===e)&&r.push(o)}return r}function qe(e,t={}){return F(e)||k(e)?{}:A(e)?{...e.prototype.attributes,...t}:L(e)?{...e.definition?.defaultValues,...t}:{...t}}async function ze(e,r,n,o,a){const i=new t({sourceLayer:r,attributes:n}),{rotation:s,size:l}=se(i);let c=await N(i,{useSourceLayer:!0,webStyleCache:o,scale:a}),u=!1;for(const t of[l,s]){if(null==t)continue;null==n[t.field]&&(n[t.field]=await t.getDefaultValue(c,e.view),u=!0)}switch(u&&(c=await N(i,{useSourceLayer:!0,webStyleCache:o,scale:a})),c?.type){case"simple-fill":case"polygon-3d":e.polygonSymbol=c;break;case"simple-line":case"line-3d":e.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":e.pointSymbol=c;break;case"mesh-3d":e.meshSymbol=c}Ee(e.tooltipOptions,l,s)}function Ee(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function Pe(e,t){return e.find(e=>e.layer===t)}function Ce(e,t){const r=Pe(e,t);if(null==r)throw new i("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified layer");return r}function De(e,t){return e?.find(e=>e.layer===t)}async function Re(e,t,r,n){switch(t.type){case"3d":return Ge(e,t,r,n);case"2d":return Be(e,t,r,n)}}async function Ge(e,t,r,n){if(0===e.length)return[];const{updatable:a,graphicsByLayer:i}=await r.defer(async()=>{const{results:o}=await h(H(t,r),n),a=new Map,i=e=>{const t=e.layer,r=a.get(t);if(!r){const e=new Array;return a.set(t,e),e}return r};J(o).forEach(({graphic:e})=>i(e).push(e));const s=e.filter(({capabilities:e,layer:t})=>e.update.enabled&&a.has(t));return 0!==s.length&&r.stopPropagation(),{updatable:s,graphicsByLayer:a}});return h(Promise.allSettled(a.map(async({layer:e})=>{const t=i.get(e),r=Ne(e);if(t.every(e=>M(e,r)))return t;const a=[];for(const n of t){a.push(n.getObjectId());const e=Object.keys(n.attributes);o(r,e)}const s=e.createQuery();return s.returnGeometry=!1,s.objectIds=a,s.outFields=O(e.fieldsIndex,r),e.queryFeatures(s,{signal:n}).then(({features:e})=>e)})),n)}async function Be(e,t,r,n){if(0===e.length)return[];const{mapPoint:o}=r;if(null==o)return[];let a=null;const i=await r.defer(async()=>{const{results:o}=await h(t.hitTest(r),n);if(0===o.length)return[];const i=new Set;a=J(o),a.forEach(({graphic:e})=>e&&i.add(e.layer));const s=e.filter(e=>i.has(e.layer)&&e.supportsUpdateWorkflow);return s.length>0&&r.stopPropagation(),s});return h(Promise.allSettled(i.map(async({layer:e})=>{const i=e.createQuery();i.returnGeometry=!0,i.outFields=Ne(e);const s="renderer"in e?z({renderer:e.renderer,pointerType:r.pointerType}):0;i.geometry=$(o,s,t),i.outSpatialReference=t.spatialReference;const{features:l}=await e.queryFeatures(i,{signal:n});return a?.forEach(({graphic:t})=>{t.layer!==e||l.some(e=>e.getObjectId()===t.getObjectId())||l.push(t)}),l})),n)}function Ne(e){return O(e.fieldsIndex,[e.objectIdField,x({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function Ze(e,t,n,o){const a=t.createQuery();a.objectIds=e.map(e=>e.getObjectId()).filter(r),a.outFields=["*"],a.returnM=t.capabilities.data.supportsM,a.returnZ=t.capabilities.data.supportsZ,"scene"===t.type&&null!=t.infoFor3D||(a.outSpatialReference=n);const i=await t.queryFeatures(a,{signal:o});return m(o),i.features}function We(e){const t=new Map;for(const r of e){const e=r.sourceLayer,n=q(e)?e.parent:e;p(t,n,()=>[]).push(r)}return t}async function Qe(e){const{graphic:t,sketchViewModel:r,sourceLayer:n,visualVariables:o}=e;await $e(e);const a={multipleSelectionEnabled:!1};return"point"===n.geometryType&&(a.enableRotation=null!=o.rotation,a.enableScaling=null!=o.size),r.update(t,a)}async function $e(e){const{graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:o,visualVariables:a,webStyleCache:i}=e;let s=!1;const{rotation:l,size:c}=a;for(const u of[l,c]){if(null==u)continue;const e=t.getAttribute(u.field);if(null!=e)u.setInitialValue(e);else{const e=await u.getDefaultValue(t.symbol,n.view);u.setInitialValue(e),t.setAttribute(u.field,e),s=!0}}if(s){const e="2d"===n.view?.type?n.view.scale:null;await ye(t,i,e)}Ee(n.tooltipOptions,c,l),r.elevationInfo=o.elevationInfo}function Je(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function He(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}function Ke(e,t,r,n){if(null==t.geometry||"point"!==t.geometry?.type)return!1;const o=t.attributes;let a=!1;const i=n.rotation,s=Je(r.toolEventInfo);if(null!=i&&null!=s){const{field:r,getValue:n}=i;if("rotate-stop"===s.type)i.isUpdatingInteractively=!1,i.setInitialValue(t.getAttribute(r));else{i.isUpdatingInteractively=!0;const l=n(s.angle,e);l!==o[r]&&t.setAttribute(r,l),a=!0}}const l=n.size,c=He(r.toolEventInfo);if(null!=l&&null!=c){const{field:r,getValue:n}=l;if("scale-stop"===c.type)l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r));else{l.isUpdatingInteractively=!0;const i=n(c.xScale,e);i!==o[r]&&t.setAttribute(r,i),a=!0}}return a}async function Xe({feature:e,featureClone:t,visualVariableAttributes:r,sketchLayer:n,sketchViewModel:o,view:a,onUpdate:i,webStyleCache:u,addUpdatingPromise:d,addHandle:p}){await ye(t,u,"2d"===a.type?a.scale:null);let y=null;if("2d"===o?.view?.type){const e=f(e=>ye(t,u,e));y=g(()=>o?.view?.scale,t=>e(t))}const m=t.sourceLayer,h=st(a,m);await Qe({graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u});let b=null;h.then(e=>b=e).catch(()=>{});const I=r.size,v=r.rotation,T=g(()=>e.attributes,async e=>{let r=!1;for(const n in e){const o=e[n];o!==t.getAttribute(n)&&(t.setAttribute(n,o),null==I||I.isUpdatingInteractively||I.field!==n||I.setInitialValue(o),null==v||v.isUpdatingInteractively||v.field!==n||v.setInitialValue(o),(null==b||b.requiredFields.includes(n))&&(r=!0))}r&&await ye(t,u,"2d"===a.type?a.scale:null)}),S=o.on("update",async e=>{const t=e.graphics[0],s={graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u};if("complete"===e.state){if(null===a.activeTool)return Qe(s);const e=new AbortController,t=c(e);return p(t),d(w(()=>null===a.activeTool,e.signal).then(async()=>{if(!e.signal.aborted)return e.abort(),Qe(s)}))}Ke(a,t,e,r)&&await ye(t,u,"2d"===a.type?a.scale:null),i(ct(t),e)}),F=o.on(["undo","redo"],e=>{i(ct(e.graphics[0]),e)});return s([F,S,l(()=>o.cancel()),T,y])}async function Ye(e,t,r,n){e.add(n);const o=r.sourceLayer,i=r.getAttribute(o.objectIdField);let c=null;function u(e){c?.abort(),c=a(async r=>{const n=await st(t,o);m(r),n.setVisibility?.(i,e)})}return await et(t,n),u(!1),s([_e(t,n,e=>u(!e)),l(async()=>{u(!0);try{if(!t.destroyed){const e=await st(t,o).catch(()=>{});e&&!e.destroyed&&await w(()=>!e.updating)}}finally{e.remove(n)}})])}function _e(e,t,r){if("3d"===e.type){const n=new W({graphic:t});return s([e.trackGraphicState(n),g(()=>n.displaying,r)])}return g(()=>t.visible,r)}async function et(e,t){if("3d"===e.type){const r=new W({graphic:t}),n=e.trackGraphicState(r);await w(()=>r.displaying||r.error),n.remove()}else await w(()=>t.visible)}const tt={icon:I(24),text:I(12),line:I(1),viewScaleSizeFactor:100};function rt(e,t,r){let n=!1;return e.filter(e=>!!n||(n=e===t,n)).map(e=>r[e]())}function nt(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const n=r.layer,o=e.viewModel.getTemplatesForLayer(n);1===o.length&&"scene"!==n.type&&(r.template=o[0],t.shift())}return t}function ot(e){return"unknown"===e?null:e}function at(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const it=e=>e.includes("-stop")||e.includes("vertex-"),st=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function lt(e){return"createInteractiveEditSession"in e}function ct(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=u(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function ut(e){return e.acquireCursor("progress")}async function dt(e,t){const{template:r}=e;if(null==r)return null;if(j(r))return r.load();if(S(r)){const e=(await import("../../editing/sharedTemplates/SharedTemplate.js")).default,n=U(t,{makeSharedTemplateFromJSON:t=>e.fromJSON(t)}),o=await n.getTemplates({templateIds:[r.templateId],featureService:r.featureService});if(0===o.length)throw new i("editor:failed-to-load-template","Unable to load the provided template");return o[0].load()}return r}function pt(e){for(const t of e){const{destinationGraphic:e,destinationField:r,sourceGraphic:n,sourceField:o}=t;e.setAttribute(r,n.getAttribute(o))}}function ft(e){const t=e.templateExecutorInfo?.completionResults;return t?.length?(t.forEach(e=>pt(e.relationships)),t.flatMap(e=>e.edits)):null}function yt(e){if(null==e)return[];if(te(e))return e.data.layers;const t=ne(e)?e.activeWorkflow:e,r=t?.layer;return r?[r]:[]}function mt(){return new i("editing:multiple-layers-not-supported","UpdateFeaturesWorkflow does not support updating features from multiple layers.")}function ht({attributes:e},t){const r=new Set;r.add(t.objectIdField),"uniqueIdFields"in t&&t.uniqueIdFields&&t.uniqueIdFields.length>0&&v(r,t.uniqueIdFields);const n={};for(const o of r)null!=e[o]&&(n[o]=e[o]);if("scene"===t.type&&null!=t.infoFor3D){const r=t.associatedLayer?.globalIdField;null!=r&&(e[r]=e[r])}return n}export{Oe as appendAllUtilityNetworkAssociationRelationships,nt as avoidFeatureTemplateSelectionWithOnlyOneItem,lt as canCreateInteractiveEditSession,ct as cloneGraphicExceptMesh,ke as createLayerIdMap,Ae as createRelationshipKeyMap,me as createToolFromGeometryType,rt as createWorkflowSteps,Re as fetchCandidates,Ze as fetchFullFeatures,Ue as findAllDependencies,xe as findChangesByGlobalId,Pe as findEditorItemForLayer,Ce as findEditorItemForLayerOrThrow,De as findLayerInfo,Ve as generateHashForRelationship,qe as getCreationAttributes,dt as getFullTemplateForCreationInfo,yt as getLayersFromWorkflow,le as getRotationVariableAttribute,ft as getServiceEditsFromWorkflowData,Te as getServiceInfoForLayer,Se as getServiceLayersById,de as getSizeVariableAttribute,se as getVisualVariableAttributes,ie as getVisualVariablesForLayer,We as groupFeaturesByLayer,_ as isBatchAttributeFormViewModel,ee as isCreateFeaturesWorkflow,ae as isParentWorkflow,oe as isSplitFeatureWorkflow,it as isTerminalUpdateEventType,te as isUpdateFeaturesWorkflow,re as isUpdateRecordWorkflow,ne as isUpdateWorkflow,Me as isUtilityNetworkAssociationsTable,ht as makeMinimalAttributes,mt as makeMultipleSourceLayersError,je as orderEditsByRelationshipDependencies,at as prepareAttachmentsForCreateFeaturesWorkflow,pt as setRelationshipFields,Xe as setUpGeometryUpdate,ge as setUpSketchCreateWatchers,$e as setVisualVariablesAndElevationInfoForUpdate,ut as showProgressCursor,tt as sizeDefaults,ot as sizeVariableUnitToLengthUnit,he as startCreatingNewFeature,Qe as startUpdatingFeatureGeometry,Ye as swapForEditingSession,ye as updateGraphicSymbolWhenRequired,Ke as visualVariableInteractiveUpdate,st as whenEditorLayerView,et as whenGraphicDisplayed};
5
+ import e from"../../Color.js";import t from"../../Graphic.js";import{isSome as r,equals as n,addMany as o}from"../../core/arrayUtils.js";import{createTask as a}from"../../core/asyncUtils.js";import"../../core/has.js";import i from"../../core/Error.js";import{handlesGroup as s,makeHandle as l,abortHandle as c}from"../../core/handleUtils.js";import{clone as u}from"../../core/lang.js";import d from"../../core/Logger.js";import{getOrCreateMapValue as p}from"../../core/MapUtils.js";import{debounce as f,isPromiseLike as y,throwIfAborted as m,whenOrAbort as h}from"../../core/promiseUtils.js";import{watch as g,on as b,whenOnce as w}from"../../core/reactiveUtils.js";import{px2pt as I}from"../../core/screenUtils.js";import{addMany as v}from"../../core/SetUtils.js";import{diff as T}from"../../core/accessorSupport/diffUtils.js";import{isSharedTemplateOrMetadata as S,isSharedGroupTemplate as F,isSharedTemplate as k,isSharedPresetTemplate as j,isStandardFeatureTemplate as A,isSharedFeatureTemplate as L}from"../../editing/templateUtils.js";import{getSharedTemplateProvider as U}from"../../editing/sharedTemplates/SharedTemplateProvider.js";import V from"../../layers/GraphicsLayer.js";import{featureHasFields as M,fixFields as O,getDisplayFieldName as x}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as q}from"../../layers/support/layerUtils.js";import{calculateTolerance as z}from"../../renderers/support/clickToleranceUtils.js";import{meterIn as E}from"../../renderers/support/lengthUtils.js";import{isRenderer as P}from"../../renderers/support/typeUtils.js";import{getTransformationType as C}from"../../renderers/visualVariables/support/sizeVariableUtils.js";import D from"../../symbols/SimpleFillSymbol.js";import R from"../../symbols/SimpleLineSymbol.js";import G from"../../symbols/SimpleMarkerSymbol.js";import{to3D as B}from"../../symbols/support/symbolConversion.js";import{getDisplayedSymbol as N}from"../../symbols/support/symbolUtils.js";import{getServices as Z}from"../../undoredo/support/Services.js";import{GraphicState as W}from"../../views/3d/layers/graphics/GraphicState.js";import{defaultDrawingMode as Q}from"../../views/draw/DrawingMode.js";import{createQueryGeometry as $}from"../../views/support/drapedUtils.js";import{filterGraphicHits as J,hitTestSelectSimilarDistance as H}from"../../views/support/hitTestSelectUtils.js";import{dependencySort as K}from"./support/dependencySort.js";import{isDrawGraphicTool as X}from"../Sketch/support/sketchUtils.js";const Y=()=>d.getLogger("esri.widgets.Editor.workflowUtils");function _(e){return!!e&&"features"in e}function ee(e){return null!=e&&"create-features"===e.type}function te(e){return null!=e&&"update-features"===e.type}function re(e){return null!=e&&e.type.includes("update-")&&"fullFeature"in e}function ne(e){return null!=e&&"update"===e.type}function oe(e){return null!=e&&"split-feature"===e.type}function ae(e){const t=e?.type;return"update-feature"===t||"update-table-record"===t||"split-feature"===t}function ie(e){const t=e&&"renderer"in e?e.renderer:null;if(!fe(t))return{rotation:null,size:null};const r=t.getVisualVariablesForType("rotation").filter(e=>(!e.axis||"heading"===e.axis)&&e.field&&!e.valueExpression),n=t.getVisualVariablesForType("size").filter(e=>e.field&&!e.useSymbolValue&&!e.valueExpression&&"real-world-size"===C(e));return{rotation:1===r.length?r[0]:null,size:1===n.length?n[0]:null}}function se(e){const t=e.sourceLayer;if(!(t&&"renderer"in t&&fe(t.renderer)))return{rotation:null,size:null};const{rotation:r,size:n}=ie(t);let o=null,a=null;if(r){const e=t.fields?.filter(e=>e.name===r.field),n=1===e?.length?e[0]:null;o=le(r,n)}if(n){const e=t.fields?.filter(e=>e.name===n.field),r=1===e?.length?e[0]:null;a=de(n,r)}return{rotation:o,size:a}}function le(e,t){const r="heading"===(e.axis||"heading")&&"arithmetic"===e.rotationType?-1:1,n=t?.type??"double",o={initial:0,current:0};return{field:e.field,fieldType:n,getDefaultValue:()=>Promise.resolve(0),getValue:e=>(o.current=o.initial-r*e,pe((o.current+360)%360,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,rotationType:e.rotationType??"geographic"}}function ce(e,t){switch(t){case"width":return e[0];case"depth":return e[1];case"height":return e[2];default:return e[2]||e[1]||e[0]}}async function ue(e,t,r){if(null==t)return 0;const{symbol:n}=B(t);if(null==n||"web-style"===n.type||"cim"===n.type)return 0;const o=n.symbolLayers.at(0);if(!o)return 0;switch(o.type){case"icon":{const{computeIconLayerResourceSize:e}=await import("../../symbols/support/symbolLayerUtils.js");return Math.min(tt.icon,(await e(o,tt.icon))[0])||tt.icon}case"text":return tt.text;case"line":return tt.line;case"object":{const{computeObjectLayerResourceSize:t}=await import("../../symbols/support/symbolLayerUtils.js");return ce(await t(o,e.scale/tt.viewScaleSizeFactor),r)}case"path":case"extrude":return e.scale/tt.viewScaleSizeFactor;default:return 0}}function de(e,t){const r=e.axis,n=t?.type??"double",o={initial:0,current:0},a=E[e.valueUnit]??1;let i;return i="area"===e.valueRepresentation?e=>(e*a/2)**2*Math.PI:"radius"===e.valueRepresentation||"distance"===e.valueRepresentation?e=>e*a/2:e=>e*a,{field:e.field,fieldType:n,getDefaultValue:async(e,t)=>pe(i(await ue(t,e,r)),n),getValue:(e,t)=>(o.initial||(o.initial=t.pixelSizeAt(t.center)),o.current=o.initial*e,pe(o.current,n)),setInitialValue:e=>{o.initial=e,o.current=0},isUpdatingInteractively:!1,displayUnit:ot(e.valueUnit),axis:e.axis}}function pe(e,t){switch(t){case"small-integer":case"integer":case"long":return Math.round(e);case"double":case"single":return e;default:return 0}}function fe(e){if(!P(e))return!1;switch(e?.type){case"class-breaks":case"simple":case"unique-value":case"dot-density":case"dictionary":case"pie-chart":return!0;default:return!1}}async function ye(e,t,r){const n=await N(e,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:t,scale:r});null!=T(e.symbol,n)&&(e.symbol=n)}function me(e,t){if(!e||!t)throw new Error("no geometry type");if("multipatch"===e)return{tool:"mesh",createOptions:{mode:"hybrid"}};const r=new Map;r.set("circle",{mode:"freehand"}),r.set("rectangle",{mode:"freehand"});const n={mode:Q,optionsPerTool:r};if(S(t)){const o=t.defaultTool,a=F(t)?t.definition?.inputGeometryType??e:e;switch(o){case"freehand":case"stream-line":return{tool:"polyline"===a?"freehandPolyline":"freehandPolygon",createOptions:n};case"autocomplete-freehand-polygons":case"stream-polygon":return{tool:"freehandPolygon",createOptions:n};case"autocomplete-polygons":case"difference-polygon":case"create-structures":case"polygon":case"trace":return{tool:"polygon"===a?"polygon":"polyline",createOptions:n};case"circle":return r.get("circle").preserveAspectRatio=!0,{tool:"circle",createOptions:n};case"ellipse":return r.get("circle").preserveAspectRatio=!1,{tool:"circle",createOptions:n};case"create-points-along-line":case"multipoint":return{tool:"multipoint",createOptions:n};case"line":case"radial-line":case"right-angle-line":case"split":case"two-point-line":return{tool:"polyline",createOptions:n};case"rectangle":case"regular-polygon":case"right-angle-polygon":return{tool:"rectangle",createOptions:n};case"elevation-point-from-contour":case"elevation-point-from-dem":case"parcel-seed":case"point":case"point-and-rotation":case"point-at-end-of-line":return{tool:"point",createOptions:n}}}else{const o=t.drawingTool;if("circle"===o||"ellipse"===o)return r.get("circle").preserveAspectRatio="circle"===o,{tool:"circle",createOptions:n};if("rectangle"===o)return{tool:"rectangle",createOptions:n};if("freehand"===o)return{tool:"polygon"===e?"freehandPolygon":"freehandPolyline",createOptions:n}}return{tool:e,createOptions:n}}async function he(e,t,r,n){const{creationInfo:o,fullTemplate:a}=r;if(!o)throw new i("featureworkflow","No creation info provided.");const s=o.layer,l=qe(a,o.attributeOverrides),{view:c}=e,u="2d"===c?.type;F(a)||j(a)||await ze(e,s,l,n,u?c.scale:null);const{capabilities:d}=s;t.elevationInfo=s.elevationInfo;const p=me(s.geometryType,a);e.defaultCreateOptions={graphicProperties:{attributes:l,sourceLayer:s},mode:p.createOptions.mode,optionsPerTool:p.createOptions.optionsPerTool,preserveAspectRatio:p.createOptions.preserveAspectRatio,hasZ:d.data.supportsZ,defaultZ:(u?d.editing.zDefault:null)??e.defaultCreateOptions.defaultZ},null==o.geometryToPlace?await e.create(p.tool):await e.place(o.geometryToPlace,{graphicProperties:{attributes:l,sourceLayer:s}})}async function ge(e){return s([be(e),we(e)])}function be({creationAttributes:e,data:t,sketchViewModel:r,view:n,webStyleCache:o}){const{creationInfo:a}=t,{fullTemplate:i}=t;if(!a||"2d"!==n?.type||F(i)||j(i))return null;const s=f(t=>ze(r,a.layer,e,o,t));return g(()=>n.scale,e=>s(e))}function we({data:t,sketchViewModel:r,view:n}){const{templateExecutorInfo:o}=t;if(!o)return null;const a=r.activeComponent;if(!n||!X(a))return Y().error(new i("featureworkflow","Failed to set up template feedback.")),null;const c=new V({effect:"saturate(0.6) opacity(0.8)",listMode:"hide",title:"Shared Template Feedback Graphics"});n.map?.add(c);const{executor:u,serviceLayersById:d}=o,p=n.theme?.accentColor??new e([255,165,0,1]);return s([b(()=>a,["cursor-update","vertex-add"],()=>{c.removeAll();const e=a.graphic?.geometry;if(!e||!Ie(e))return;const t=u(e,"digitizing");if(!y(t))for(const r of t.edits){const e=d.get(r.id);if(e&&r.addFeatures&&0!==r.addFeatures.length)for(const t of e)if(!t.isTable)for(const e of r.addFeatures){const t=ve(e,p);t&&c.add(t)}}}),l(()=>{n.map.remove(c),c.destroy()})])}function Ie(e){switch(e.type){case"point":case"multipoint":return!0;case"polyline":return e.paths[0].length>1;case"polygon":{const t=e.rings[0];return n(t.at(0),t.at(-1))?t.length>2:t.length>1}default:return!1}}function ve(e,r){let n=null;switch(e.geometry?.type){case"point":case"multipoint":n=new G({angle:0,color:r,outline:new R({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:1}),path:"undefined",size:8,style:"circle",xoffset:0,yoffset:0});break;case"polygon":n=new D({color:r,outline:new R({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:3}),style:"none"});break;case"polyline":n=new R({cap:"round",color:r,join:"round",miterLimit:1,style:"solid",width:2});break;default:return null}return new t({geometry:e.geometry,symbol:n,attributes:{...e.attributes}})}async function Te(e,t){const r=await Z(t).load(),n=q(e)?e.parent:e;return r.tablesAndLayersLookup.get(n)}async function Se(e,t){const r=await Te(e,t);if(!r)return new Map;const n=new Map;for(const o of r.layersAndTables)p(n,o.layerId,()=>[]).push(o);return n}function Fe(e){const t=e.objectIdField,r=e.globalIdField??"";return{id:e.layerId,identifierFields:{objectIdField:t,globalIdField:r},addFeatures:[],deleteAttachments:[],addAttachments:[],deleteFeatures:[],updateFeatures:[]}}function ke(e){const{edits:t,serviceInfo:n,view:o,findOriginalFeature:a}=e,i=je(n.layersAndTables),s=n.layersAndTables.toArray(),{allEditData:l,editDataByLayerIdMap:c,editDataByIdMap:u}=Le(t,i,a),d=Ue(l,Ae(s,c),c);if(o&&Oe(l,d,o),0===d.length)return t;const p=K(d,{continueOnCircularDependency:!0}).map(e=>u.get(e)).filter(r),f=new Map;for(const r of p)f.set(r.uniqueId,r);const y=[];for(const r of l)f.has(r.uniqueId)||y.push(r);const m=[];let h=null;for(const r of p){const{layer:e}=r;switch(null==h?h=Fe(e):h.id!==e.layerId&&(m.push(h),h=Fe(e)),r.operationType){case"add":case"modify":h.addFeatures.push(r.after);break;case"delete":h.deleteFeatures.push(r.before)}}null!==h&&m.push(h);for(const r of y){const e=r.layer.layerId,t=m.find(t=>t.id===e)??Fe(r.layer);switch(m.includes(t)||m.push(t),r.operationType){case"add":t.addFeatures.push(r.after);break;case"modify":t.updateFeatures.push(r.after);break;case"delete":t.deleteFeatures.push(r.before);break;case"deleteAttachment":t.deleteAttachments.push(r.attachmentId);break;case"addAttachment":t.addAttachments.push(r.attachment)}}for(const r of m)void 0!==r.deleteAttachments&&0===r.deleteAttachments.length&&delete r.deleteAttachments,void 0!==r.addAttachments&&0===r.addAttachments.length&&delete r.addAttachments;return m}function je(e){const t=new Map;for(const r of e)t.set(r.layerId,r);return t}function Ae(e,t){const r=new Map;for(const n of e)for(const e of n.relationships??[])if(r.set(Ve(n,e),""),t.has(e.relatedTableId)){const o=t.get(e.relatedTableId);if(o.length>0)for(const t of o[0].layer.relationships??[])if(t.id===e.id){r.set(Ve(n,e),t.keyField);break}}return r}function Le(e,t,r){const n=new Map,o=[],a=new Map;let s=1;for(const l of e){const e=[],c=t.get(l.id);if(!c)throw new i("featureworkflow",`Failed to prepare applyEdits payload. Layer with id ${l.id} not found.`);for(const t of l.addFeatures??[])e.push({uniqueId:"T"+s++,operationType:"add",layer:c,after:t});for(const t of l.deleteFeatures??[])e.push({uniqueId:"T"+s++,operationType:"delete",before:t,layer:c});for(const t of l.deleteAttachments??[])e.push({uniqueId:"T"+s++,operationType:"deleteAttachment",attachmentId:t,layer:c});for(const t of l.addAttachments??[])e.push({uniqueId:"T"+s++,operationType:"addAttachment",attachment:t,layer:c});for(const t of l.updateFeatures??[])e.push({uniqueId:"T"+s++,operationType:"modify",before:r(t),after:t,layer:c});n.set(c.layerId,e);for(const t of e)o.push(t),a.set(t.uniqueId,t)}return{allEditData:o,editDataByIdMap:a,editDataByLayerIdMap:n}}function Ue(e,t,r){const n=[];for(const o of e){const e=o.layer.relationships??[],{uniqueId:a}=o;for(const i of e){const e=i.keyField;if("origin"===i.role){const s=r.get(i.relatedTableId);if(!s||0===s.length)continue;const l=Ve(o.layer,i),c=t.get(l);if(void 0===c||""===c)continue;switch(o.operationType){case"add":for(const t of s)t!==o&&("add"!==t.operationType&&"modify"!==t.operationType||t.after.attributes[c]===o.after.attributes[e]&&n.push([a,t.uniqueId]));break;case"modify":if(o.before.attributes[e]!==o.after.attributes[e])for(const t of s){const r=t.uniqueId;t!==o&&("delete"===t.operationType?t.before.attributes[c]===o.before.attributes[e]?n.push([r,a]):t.before.attributes[c]===o.after.attributes[e]&&n.push([a,r]):"add"===t.operationType?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):t.after.attributes[c]===o.before.attributes[e]&&n.push([r,a]):"modify"===t.operationType&&(t.before.attributes[c]!==t.after.attributes[c]?t.after.attributes[c]===o.after.attributes[e]?n.push([a,r]):n.push([r,a]):n.push([a,r])))}break;case"delete":for(const t of s)t!==o&&("delete"!==t.operationType&&"modify"!==t.operationType||t.before.attributes[c]===o.before.attributes[e]&&n.push([t.uniqueId,a]))}}}}return n}function Ve(e,t){return`${e.layerId}:${t.id}`}function Me(e,t){return!!(t?.map&&"utilityNetworks"in t.map&&t.map.utilityNetworks?.length&&t.map.utilityNetworks.some(t=>!(!t.loaded||!e.url?.startsWith(t.featureServiceUrl)||e.layerId!==t.networkSystemLayers.associationsTableId)))}function Oe(e,t,r){const n=[];for(const a of e)Me(a.layer,r)&&n.push(a);if(0===n.length)return;let o=[];for(const a of n){const r=a.layer;switch(a.operationType){case"delete":o=[...xe(a.before.attributes[r.fieldsIndex.get("fromglobalid").name],e),...xe(a.before.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([a.uniqueId,e.uniqueId]);break;case"add":o=[...xe(a.after.attributes[r.fieldsIndex.get("fromglobalid").name],e),...xe(a.after.attributes[r.fieldsIndex.get("toglobalid").name],e)];for(const e of o)t.push([e.uniqueId,a.uniqueId])}}}function xe(e,t){const r=[],n=t.filter(({layer:e})=>""!==e.globalIdField&&null!=e.globalIdField);for(const o of n){const t=o.layer.globalIdField;("before"in o&&o.before?.attributes[t]===e||"after"in o&&o.after?.attributes[t]===e)&&r.push(o)}return r}function qe(e,t={}){return F(e)||j(e)?{}:A(e)?{...e.prototype.attributes,...t}:L(e)?{...e.definition?.defaultValues,...t}:{...t}}async function ze(e,r,n,o,a){const i=new t({sourceLayer:r,attributes:n}),{rotation:s,size:l}=se(i);let c=await N(i,{useSourceLayer:!0,webStyleCache:o,scale:a}),u=!1;for(const t of[l,s]){if(null==t)continue;null==n[t.field]&&(n[t.field]=await t.getDefaultValue(c,e.view),u=!0)}switch(u&&(c=await N(i,{useSourceLayer:!0,webStyleCache:o,scale:a})),c?.type){case"simple-fill":case"polygon-3d":e.polygonSymbol=c;break;case"simple-line":case"line-3d":e.polylineSymbol=c;break;case"simple-marker":case"picture-marker":case"point-3d":case"cim":e.pointSymbol=c;break;case"mesh-3d":e.meshSymbol=c}Ee(e.tooltipOptions,l,s)}function Ee(e,t,r){e.visualVariables=null!=t||null!=r?{size:null!=t?{unit:t.displayUnit,axis:t.axis,valueType:t.fieldType}:null,rotation:null!=r?{valueType:r.fieldType,rotationType:r.rotationType??"geographic"}:null}:null}function Pe(e,t){return e.find(e=>e.layer===t)}function Ce(e,t){const r=Pe(e,t);if(null==r)throw new i("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified layer");return r}function De(e,t){return e?.find(e=>e.layer===t)}async function Re(e,t,r,n){switch(t.type){case"3d":return Ge(e,t,r,n);case"2d":return Be(e,t,r,n)}}async function Ge(e,t,r,n){if(0===e.length)return[];const{updatable:a,graphicsByLayer:i}=await r.defer(async()=>{const{results:o}=await h(H(t,r),n),a=new Map,i=e=>{const t=e.layer,r=a.get(t);if(!r){const e=new Array;return a.set(t,e),e}return r};J(o).forEach(({graphic:e})=>i(e).push(e));const s=e.filter(({capabilities:e,layer:t})=>e.update.enabled&&a.has(t));return 0!==s.length&&r.stopPropagation(),{updatable:s,graphicsByLayer:a}});return h(Promise.allSettled(a.map(async({layer:e})=>{const t=i.get(e),r=Ne(e);if(t.every(e=>M(e,r)))return t;const a=[];for(const n of t){a.push(n.getObjectId());const e=Object.keys(n.attributes);o(r,e)}const s=e.createQuery();return s.returnGeometry=!1,s.objectIds=a,s.outFields=O(e.fieldsIndex,r),e.queryFeatures(s,{signal:n}).then(({features:e})=>e)})),n)}async function Be(e,t,r,n){if(0===e.length)return[];const{mapPoint:o}=r;if(null==o)return[];let a=null;const i=await r.defer(async()=>{const{results:o}=await h(t.hitTest(r),n);if(0===o.length)return[];const i=new Set;a=J(o),a.forEach(({graphic:e})=>e&&i.add(e.layer));const s=e.filter(e=>i.has(e.layer)&&e.supportsUpdateWorkflow);return s.length>0&&r.stopPropagation(),s});return h(Promise.allSettled(i.map(async({layer:e})=>{const i=e.createQuery();i.returnGeometry=!0,i.outFields=Ne(e);const s="renderer"in e?z({renderer:e.renderer,pointerType:r.pointerType}):0;i.geometry=$(o,s,t),i.outSpatialReference=t.spatialReference;const{features:l}=await e.queryFeatures(i,{signal:n});return a?.forEach(({graphic:t})=>{t.layer!==e||l.some(e=>e.getObjectId()===t.getObjectId())||l.push(t)}),l})),n)}function Ne(e){return O(e.fieldsIndex,[e.objectIdField,x({displayField:"displayField"in e?e.displayField:null,fields:e.fields})])}async function Ze(e,t,n,o){const a=t.createQuery();a.objectIds=e.map(e=>e.getObjectId()).filter(r),a.outFields=["*"],a.returnM=t.capabilities.data.supportsM,a.returnZ=t.capabilities.data.supportsZ,"scene"===t.type&&null!=t.infoFor3D||(a.outSpatialReference=n);const i=await t.queryFeatures(a,{signal:o});return m(o),i.features}function We(e){const t=new Map;for(const r of e){const e=r.sourceLayer,n=q(e)?e.parent:e;p(t,n,()=>[]).push(r)}return t}async function Qe(e){const{graphic:t,sketchViewModel:r,sourceLayer:n,visualVariables:o}=e;await $e(e);const a={multipleSelectionEnabled:!1};return"point"===n.geometryType&&(a.enableRotation=null!=o.rotation,a.enableScaling=null!=o.size),r.update(t,a)}async function $e(e){const{graphic:t,sketchLayer:r,sketchViewModel:n,sourceLayer:o,visualVariables:a,webStyleCache:i}=e;let s=!1;const{rotation:l,size:c}=a;for(const u of[l,c]){if(null==u)continue;const e=t.getAttribute(u.field);if(null!=e)u.setInitialValue(e);else{const e=await u.getDefaultValue(t.symbol,n.view);u.setInitialValue(e),t.setAttribute(u.field,e),s=!0}}if(s){const e="2d"===n.view?.type?n.view.scale:null;await ye(t,i,e)}Ee(n.tooltipOptions,c,l),r.elevationInfo=o.elevationInfo}function Je(e){return null==e||"rotate-start"!==e.type&&"rotate"!==e.type&&"rotate-stop"!==e.type?null:e}function He(e){return null==e||"scale-start"!==e.type&&"scale"!==e.type&&"scale-stop"!==e.type?null:e}function Ke(e,t,r,n){if(null==t.geometry||"point"!==t.geometry?.type)return!1;const o=t.attributes;let a=!1;const i=n.rotation,s=Je(r.toolEventInfo);if(null!=i&&null!=s){const{field:r,getValue:n}=i;if("rotate-stop"===s.type)i.isUpdatingInteractively=!1,i.setInitialValue(t.getAttribute(r));else{i.isUpdatingInteractively=!0;const l=n(s.angle,e);l!==o[r]&&t.setAttribute(r,l),a=!0}}const l=n.size,c=He(r.toolEventInfo);if(null!=l&&null!=c){const{field:r,getValue:n}=l;if("scale-stop"===c.type)l.isUpdatingInteractively=!1,l.setInitialValue(t.getAttribute(r));else{l.isUpdatingInteractively=!0;const i=n(c.xScale,e);i!==o[r]&&t.setAttribute(r,i),a=!0}}return a}async function Xe({feature:e,featureClone:t,visualVariableAttributes:r,sketchLayer:n,sketchViewModel:o,view:a,onUpdate:i,webStyleCache:u,addUpdatingPromise:d,addHandle:p}){await ye(t,u,"2d"===a.type?a.scale:null);let y=null;if("2d"===o?.view?.type){const e=f(e=>ye(t,u,e));y=g(()=>o?.view?.scale,t=>e(t))}const m=t.sourceLayer,h=st(a,m);await Qe({graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u});let b=null;h.then(e=>b=e).catch(()=>{});const I=r.size,v=r.rotation,T=g(()=>e.attributes,async e=>{let r=!1;for(const n in e){const o=e[n];o!==t.getAttribute(n)&&(t.setAttribute(n,o),null==I||I.isUpdatingInteractively||I.field!==n||I.setInitialValue(o),null==v||v.isUpdatingInteractively||v.field!==n||v.setInitialValue(o),(null==b||b.requiredFields.includes(n))&&(r=!0))}r&&await ye(t,u,"2d"===a.type?a.scale:null)}),S=o.on("update",async e=>{const t=e.graphics[0],s={graphic:t,sketchLayer:n,sketchViewModel:o,sourceLayer:m,visualVariables:r,webStyleCache:u};if("complete"===e.state){if(null===a.activeTool)return Qe(s);const e=new AbortController,t=c(e);return p(t),d(w(()=>null===a.activeTool,e.signal).then(async()=>{if(!e.signal.aborted)return e.abort(),Qe(s)}))}Ke(a,t,e,r)&&await ye(t,u,"2d"===a.type?a.scale:null),i(ct(t),e)}),F=o.on(["undo","redo"],e=>{i(ct(e.graphics[0]),e)});return s([F,S,l(()=>o.cancel()),T,y])}async function Ye(e,t,r,n){e.add(n);const o=r.sourceLayer,i=r.getAttribute(o.objectIdField);let c=null;function u(e){c?.abort(),c=a(async r=>{const n=await st(t,o);m(r),n.setVisibility?.(i,e)})}return await et(t,n),u(!1),s([_e(t,n,e=>u(!e)),l(async()=>{u(!0);try{if(!t.destroyed){const e=await st(t,o).catch(()=>{});e&&!e.destroyed&&await w(()=>!e.updating)}}finally{e.remove(n)}})])}function _e(e,t,r){if("3d"===e.type){const n=new W({graphic:t});return s([e.trackGraphicState(n),g(()=>n.displaying,r)])}return g(()=>t.visible,r)}async function et(e,t){if("3d"===e.type){const r=new W({graphic:t}),n=e.trackGraphicState(r);await w(()=>r.displaying||r.error),n.remove()}else await w(()=>t.visible)}const tt={icon:I(24),text:I(12),line:I(1),viewScaleSizeFactor:100};function rt(e,t,r){let n=!1;return e.filter(e=>!!n||(n=e===t,n)).map(e=>r[e]())}function nt(e,t){e.viewModel.syncFeatureTemplates();const r=e.creationInfo;if("awaiting-feature-creation-info"===t[0].id&&r){const n=r.layer,o=e.viewModel.getTemplatesForLayer(n);1===o.length&&"scene"!==n.type&&(r.template=o[0],t.shift())}return t}function ot(e){return"unknown"===e?null:e}function at(e){e.filesEnabled=!0,e.mode="view",e.capabilities={editing:!0,operations:{add:!0,update:!0,delete:!0}}}const it=e=>e.includes("-stop")||e.includes("vertex-"),st=(e,t)=>{const r="subtype-sublayer"===t.type?t.parent:t;return e.whenLayerView(r)};function lt(e){return"createInteractiveEditSession"in e}function ct(e){const t=e.geometry;if("mesh"===t?.type){const r=e.cloneShallow();return r.attributes=u(e.attributes),r.geometry=t.cloneShallow(),r.geometry.transform=t.transform?.clone()??null,r}return e.clone()}function ut(e){return e.acquireCursor("progress")}async function dt(e,t){const{template:r}=e;if(null==r)return null;if(k(r))return r.load();if(S(r)){const e=(await import("../../editing/sharedTemplates/SharedTemplate.js")).default,n=U(t,{makeSharedTemplateFromJSON:t=>e.fromJSON(t)}),o=await n.getTemplates({templateIds:[r.templateId],featureService:r.featureService});if(0===o.length)throw new i("editor:failed-to-load-template","Unable to load the provided template");return o[0].load()}return r}function pt(e){for(const t of e){const{destinationGraphic:e,destinationField:r,sourceGraphic:n,sourceField:o}=t;e.setAttribute(r,n.getAttribute(o))}}function ft(e){const t=e.templateExecutorInfo?.completionResults;return t?.length?(t.forEach(e=>pt(e.relationships)),t.flatMap(e=>e.edits)):null}function yt(e){if(null==e)return[];if(te(e))return e.data.layers;const t=ne(e)?e.activeWorkflow:e,r=t?.layer;return r?[r]:[]}function mt(){return new i("editing:multiple-layers-not-supported","UpdateFeaturesWorkflow does not support updating features from multiple layers.")}function ht({attributes:e},t){const r=new Set;r.add(t.objectIdField),"uniqueIdFields"in t&&t.uniqueIdFields&&t.uniqueIdFields.length>0&&v(r,t.uniqueIdFields);const n={};for(const o of r)null!=e[o]&&(n[o]=e[o]);if("scene"===t.type&&null!=t.infoFor3D){const r=t.associatedLayer?.globalIdField;null!=r&&(e[r]=e[r])}return n}function gt(e){if(!e.supportsSplitFeatureWorkflow)throw new i("editing:unsupported-workflow","Split feature workflow requires that both creating features and updating their geometries are allowed.")}export{Oe as appendAllUtilityNetworkAssociationRelationships,gt as assertSplitWorkflowCapabilities,nt as avoidFeatureTemplateSelectionWithOnlyOneItem,lt as canCreateInteractiveEditSession,ct as cloneGraphicExceptMesh,je as createLayerIdMap,Ae as createRelationshipKeyMap,me as createToolFromGeometryType,rt as createWorkflowSteps,Re as fetchCandidates,Ze as fetchFullFeatures,Ue as findAllDependencies,xe as findChangesByGlobalId,Pe as findEditorItemForLayer,Ce as findEditorItemForLayerOrThrow,De as findLayerInfo,Ve as generateHashForRelationship,qe as getCreationAttributes,dt as getFullTemplateForCreationInfo,yt as getLayersFromWorkflow,le as getRotationVariableAttribute,ft as getServiceEditsFromWorkflowData,Te as getServiceInfoForLayer,Se as getServiceLayersById,de as getSizeVariableAttribute,se as getVisualVariableAttributes,ie as getVisualVariablesForLayer,We as groupFeaturesByLayer,_ as isBatchAttributeFormViewModel,ee as isCreateFeaturesWorkflow,ae as isParentWorkflow,oe as isSplitFeatureWorkflow,it as isTerminalUpdateEventType,te as isUpdateFeaturesWorkflow,re as isUpdateRecordWorkflow,ne as isUpdateWorkflow,Me as isUtilityNetworkAssociationsTable,ht as makeMinimalAttributes,mt as makeMultipleSourceLayersError,ke as orderEditsByRelationshipDependencies,at as prepareAttachmentsForCreateFeaturesWorkflow,pt as setRelationshipFields,Xe as setUpGeometryUpdate,ge as setUpSketchCreateWatchers,$e as setVisualVariablesAndElevationInfoForUpdate,ut as showProgressCursor,tt as sizeDefaults,ot as sizeVariableUnitToLengthUnit,he as startCreatingNewFeature,Qe as startUpdatingFeatureGeometry,Ye as swapForEditingSession,ye as updateGraphicSymbolWhenRequired,Ke as visualVariableInteractiveUpdate,st as whenEditorLayerView,et as whenGraphicDisplayed};