@arcgis/core 4.25.0-next.20220704 → 4.25.0-next.20220705
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/chunks/SSAO.glsl.js +3 -3
- package/core/quantityUtils.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/moveUtils.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ExtentTransformTool.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/GraphicTransformTool.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/tooltip/TranslateTooltipInfos.js +1 -1
- package/views/interactive/tooltip/content/{TooltipContentReshapeMoveGraphic.js → TooltipContentTranslateGraphic.js} +1 -1
- package/views/interactive/tooltip/content/{TooltipContentTranslateZ.js → TooltipContentTranslateGraphicXY.js} +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphicZ.js +5 -0
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexXY.js +5 -0
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexZ.js +5 -0
- package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.25.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t)??"";if(void 0===o)throw new Error(`could not find key "${r}" in template`);return o.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e,t){let r=e.length!==t.length;e.length=t.length;for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function a(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function b(e,t,r,n){const o=r??e.length,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{Mr:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Property: "+(n?n+"::":"")+t,r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o.add("trident",parseFloat(r.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var n=r(67676),o=(r(80442),r(70586)),s=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=a(e[t]);return r}function c(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const r=e.map((e=>{const r=c(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=c(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return(0,s.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,a(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(a(e))})),t}return null}function p(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e,t){return n(e)?t(e):null}function i(e){return e}function a(e,t){if(o(e))throw new Error(t);return e}function c(e,t){return n(e)?e:"function"==typeof t?t():t}function l(e,t){return n(e)?e:t}function u(e){return n(e)&&e.destroy(),null}function f(e){return n(e)&&e.dispose(),null}function d(e){return n(e)&&e.remove(),null}function h(e){return n(e)&&e.abort(),null}function p(e){return n(e)&&e.release(),null}function b(e,t,r){return n(e)&&n(t)?n(r)?r(e,t):e.equals(t):e===t}function g(e){return null}function m(e,t){const r=new Array;for(const n of e)r.push(w(n,null,t));return r}function y(e,t){for(const r of e)s(r,t)}function w(e,t,r){return n(e)?r(e):t}function v(e){return e.filter((e=>n(e)))}function _(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function O(e){return e}r.d(t,{Bd:()=>g,Fd:()=>m,IM:()=>h,JR:()=>y,O3:()=>f,Pt:()=>c,R2:()=>w,RY:()=>p,SC:()=>u,U2:()=>_,Wg:()=>i,Wi:()=>o,_W:()=>b,hw:()=>d,j0:()=>O,lV:()=>v,pC:()=>n,s3:()=>a,yl:()=>l,yw:()=>s})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>j,gx:()=>S,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o;r(60235);var s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const r=u(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(!(0,a.Wi)(r))return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){const r=u(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=p(t,(()=>n(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await v(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return new Promise((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,r){const n=new AbortController;return p(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);p(n,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const n=new AbortController;r=S(e(...u,n.signal));const o=r;O(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=S(e(...u));const f=()=>{const e=n;n=o=r=i=null,null!=e&&l(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}async function j(e){await Promise.resolve(),l(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>j,D6:()=>U,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>A,ed:()=>N,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>L,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>E,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>D,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function P(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function A(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),S(r)}function E(e){const t=N(e);let r,n;if(t){const e=x(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=S(e);e=r+"?"+t.path;const o=j({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const T={path:"",query:""};function x(e){const t=e.indexOf("?");return-1!==t?(T.path=e.slice(0,t),T.query=e.slice(t+1)):(T.path=e,T.query=null),T}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=x(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function U(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(U(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(U(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(D("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=x(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function B(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=S(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=S(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=S(e),o=n.query||{};return o[t]=String(r),`${n.path}?${j(o)}`}function pe(e,t){const r=S(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=j(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(9293),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(4478)]).then(r.bind(r,14478)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(9594)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(6481),r.e(6459),r.e(1438)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(8494),r.e(6208)]).then(r.bind(r,2255)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(802)]).then(r.bind(r,10802)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(8494),r.e(4325),r.e(908)]).then(r.bind(r,61837)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(7789)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(176),r.e(2398),r.e(8061)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(6481),r.e(2631),r.e(934)]).then(r.bind(r,40614)),SceneLayerWorker:()=>Promise.all([r.e(3739),r.e(1412)]).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,deferred:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,Cs:()=>n,QM:()=>l,jt:()=>i,oi:()=>c});var n,o=r(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(n||(n={}));let s=0;function i(){return s++}function a(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function c(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=u(o),t.data=r):(s=u(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.25",i={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20220704",o="386f06472c57351670683c63015851c0b6b4a631"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"40fa9b28ca882a70813a",176:"97f32af5893c86f6444c",247:"b24a76738482ebfc626f",280:"39de883f236e2a8d9024",461:"0e00741d35cdbf48e72d",565:"bbff8ed3192fe22a6b6d",576:"7fdd029a76a7ab1c3d83",639:"1fe8daa3a0f4fea3a61c",734:"d81bcc85ceb91bbba69f",739:"e1bb3361a20c8c830d57",802:"c495a66978d67c7e17f3",819:"5d3e774ce7b006c8cba8",908:"83c9da68d6dbc77f60e5",934:"0273e841e78880e450c5",1197:"3228293c159886513f60",1400:"910a2ffb4328f8ee7a0d",1408:"1a581e201e905588e2e6",1412:"e5b5b93e707173a4c883",1421:"6196cfdeb91ceba52af3",1423:"6889d698a2c796ed1ce6",1433:"dfdd853dd6c023089963",1438:"a07ab40977e06cb58486",1491:"d3650d799aad1f401efb",1534:"08a5c5a33a7c7c6852e5",1562:"8ebaad46e2fe8925e3b0",1761:"c9e890b4be9d01c13efe",1773:"e153e89c8a15c2f036ef",1785:"f135822fceac5ad4667c",1819:"fb97361a09b39a8a0483",1938:"a9a459639c82c35ada1f",2133:"1cffa7cf5e10ffbd6eb1",2134:"30dbdf2aa1bc8e61cad4",2398:"bc1155973f3d84371df7",2485:"c3459e4b453289f57c2f",2631:"35cd0856d669a0a725be",2664:"bbe51b49fe7093e47306",2723:"009386ed70740f87a014",2855:"d595f2c41e3bd1b33e07",2916:"3485e2342f44e4d760a2",3027:"4bfcb7350ca492767a45",3121:"8caeb7c52816b582553f",3127:"9e6ce879ec0da884b9b8",3128:"8cdeccb6b67098d6a8d7",3172:"869310ef4c98542bf9df",3230:"6ddaf66e5608deda6811",3388:"f7d1f75b6aa3ef566d74",3471:"5470cb0c3f670957c22c",3529:"9520b32d5d53ea9cd0d3",3668:"290899b47a52f8b28a9c",3723:"4ae670bb98a88add544f",3739:"e201ffcca7321771ee20",3750:"28ecf5c49144903fbf68",3852:"b71a0a8a2f446c671161",3853:"24f7a3df08c3a2d3795c",3974:"39a754713a48d46618bd",4109:"d499cce61c1c5c367380",4133:"f039a029515be17164c0",4166:"93c945099be3a4f43263",4286:"037e666f6a7ad1def59c",4325:"d91140bc583925e4faf6",4358:"71a4618d959a09302c51",4417:"591a22aaf068a6e0aabb",4475:"d10cb53bc07963d87311",4477:"de46fe79391f11d09d42",4478:"0c067c59a2a1bb4101f9",4499:"577679f302c26ba4060a",4547:"4aa26e005a953d14cf21",4695:"98c519ac806cc55bc19b",4720:"4daed788b965c26d76ec",4836:"c7fa92daca3f6e91734e",4889:"17be5bd0d1c233d73d7a",4910:"86f99e7078f427ad929f",5001:"5e20fd8b7c9497f2da1f",5235:"7773b9415c5a8d82973f",5329:"c8a3a28809542396c6fd",5787:"42987dcfda665c860151",5837:"bc682351fc915b4ab5a6",5853:"3bfab05ae07ac18a75fe",5886:"821a0754eae11421e56a",5906:"3c05a56dda4ad67a3520",6130:"fde9e9683335fa6c8236",6199:"35d46e4eeb43c256a63b",6208:"1970d7a65832b70f7f5c",6233:"1e4e5d147263e98536bc",6237:"c544df83e86a9d36b68c",6312:"2e4887ba01cf8507e3e3",6459:"65161a874595b0a34aa1",6481:"c2286d97539066c8549a",6690:"3790f0362b6f27ee798b",6710:"d828a0656e7351a74fc4",6748:"77c6ba5ea85915d9078c",6774:"c8402e32307a7b7eaaeb",6810:"7ad6721cf0ad76ce5a9d",6841:"0e3e2276665d8e466379",6920:"47d78b4f7117554acecf",6968:"d1d71c1516ae00a0b4f1",7175:"06a7f58260225f52f8e6",7202:"b26ea76e3f41b45756e0",7277:"2ee9ba5b08998b4ddb8e",7304:"b58eab838bd5c3a7961a",7374:"f9d744ba6bbd7c1dd689",7572:"43e7ef49b3f50cca6f8f",7789:"695f90305478f5024fa7",7845:"cc5a83f3a2b7c8be5db1",7873:"93eb468381bfcf0e47d7",8008:"594d7fdb80ad9cdedb85",8061:"be78cd4a28d3bbb07488",8062:"b34cffd5c45d3a8134bc",8096:"04e5486f0d8d4c6bd8a2",8140:"006353a16c6addee17f9",8163:"0b269862733afe740a63",8227:"76b424b6d2c1ef089324",8326:"9d07969fbea13aa5b03c",8422:"1e7d6920c4d176093ca8",8494:"462163f31fa134b7b216",8636:"f5d10ea7b8888f822b0c",8758:"ce546851aa7f48585494",8828:"92e1fd97afcdbb719e3f",8899:"3d36278e4f7b8267b78c",9032:"1ebb29ceabc81509646c",9070:"85a2cf095f002b2c486f",9147:"45ab9933f014e12f2330",9153:"ff6ebc9c3890a9e28e12",9169:"76b75ac18c8239687321",9291:"905130ff0118962c8140",9293:"ecb8d864dd00de322657",9296:"f0d1b51492106fda3efe",9348:"a05f6afcf56245824853",9454:"fa5a2912d084994a661a",9490:"7574316b3af61c389e8f",9594:"dda5ea7f8d35e257815c",9779:"9b8711ba50ebaec535f8",9884:"356db8b8297282c77291",9904:"cf3e1ac63580bc495ea6",9932:"abd1bd74ba571e39ab5a"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
|
|
1
|
+
var RemoteClient;(()=>{var e={88277:(e,t,r)=>{r.p=self.esriConfig.assetsPath+"/esri/core/workers/"},68773:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s}),r(80442);var n=r(78286),o=r(17202);const s={apiKey:void 0,applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&((0,n.RH)(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){const e="4.25.0";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}-next.${o.r}/assets`}s.baseUrl&&console.warn("[esri.config]","baseUrl has been replaced by assetsPath"),Object.defineProperty(s,"baseUrl",{set(){console.warn("[esri.config]","baseUrl has been replaced by assetsPath")}}),s.request.corsEnabledServers=[],s.request.corsEnabledServers.push=function(){return console.warn("[esri.config]","request.corsEnabledServers is not supported and will be removed in a future release. See http://esriurl.com/cors8664"),0}},20102:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(22974),o=r(92604),s=r(58896);class i extends s.Z{constructor(e,t,r){if(super(e,t,r),!(this instanceof i))return new i(e,t,r)}toJSON(){if(null!=this.details)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,((e,t)=>{if(t&&"object"==typeof t&&"function"==typeof t.toJSON)return t;try{return(0,n.d9)(t)}catch(e){return"[object]"}})))}}catch(e){throw o.Z.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new i(e.name,e.message,e.details)}}i.prototype.type="error"},92604:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(68773),o=(r(80442),r(70586)),s=r(19153);const i={info:0,warn:1,error:2,none:3};class a{constructor(e){this.level=null,this._module="",this._parent=null,this.writer=null,this._loggedMessages={error:new Map,warn:new Map,info:new Map},null!=e.level&&(this.level=e.level),null!=e.writer&&(this.writer=e.writer),this._module=e.module,a._loggers[this.module]=this;const t=this.module.lastIndexOf(".");-1!==t&&(this._parent=a.getLogger(this.module.slice(0,t)))}get module(){return this._module}get parent(){return this._parent}error(...e){this._log("error","always",...e)}warn(...e){this._log("warn","always",...e)}info(...e){this._log("info","always",...e)}errorOnce(...e){this._log("error","once",...e)}warnOnce(...e){this._log("warn","once",...e)}infoOnce(...e){this._log("info","once",...e)}errorOncePerTick(...e){this._log("error","oncePerTick",...e)}warnOncePerTick(...e){this._log("warn","oncePerTick",...e)}infoOncePerTick(...e){this._log("info","oncePerTick",...e)}get test(){const e=this;return{loggedMessages:e._loggedMessages,clearLoggedWarnings:()=>e._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(e={}){const t=a._loggers;return a._loggers=e,t},set throttlingDisabled(e){a._throttlingDisabled=e}}}static getLogger(e){let t=a._loggers[e];return t||(t=new a({module:e})),t}_log(e,t,...r){if(this._matchLevel(e)){if("always"!==t&&!a._throttlingDisabled){const n=this._argsToKey(r),o=this._loggedMessages[e].get(n);if("once"===t&&null!=o||"oncePerTick"===t&&o&&o>=a._tickCounter)return;this._loggedMessages[e].set(n,a._tickCounter),a._scheduleTickCounterIncrement()}for(const t of n.Z.log.interceptors)if(t(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,t){let r=this;for(;(0,o.pC)(r);){const t=r[e];if((0,o.pC)(t))return t;r=r.parent}return t}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,t,...r){console[e](`[${t}]`,...r)}_matchLevel(e){const t=n.Z.log.level?n.Z.log.level:"warn";return i[this._parentWithMember("level",t)]<=i[e]}_argsToKey(...e){return(0,s.hP)(JSON.stringify(e,((e,t)=>"object"!=typeof t||Array.isArray(t)?t:"[Object]")))}static _scheduleTickCounterIncrement(){a._tickCounterScheduled||(a._tickCounterScheduled=!0,Promise.resolve().then((()=>{a._tickCounter++,a._tickCounterScheduled=!1})))}}a._loggers={},a._tickCounter=0,a._tickCounterScheduled=!1,a._throttlingDisabled=!1},58896:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(78286);class o{constructor(e,t,r){this.name=e,this.details=r,this.message=void 0,this instanceof o&&(this.message=t&&function(e,t){return e.replace(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,((e,r)=>{if(""===r)return"$";const o=(0,n.hS)(r,t)??"";if(void 0===o)throw new Error(`could not find key "${r}" in template`);return o.toString()}))}(t,r)||"")}toString(){return"["+this.name+"]: "+this.message}}},77734:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});class n{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*n._m}getInt(){return this._seed=(n._a*this._seed+n._c)%n._m,this._seed}getFloat(){return this.getInt()/(n._m-1)}getIntRange(e,t){return Math.round(this.getFloatRange(e,t))}getFloatRange(e,t){const r=t-e;return e+this.getInt()/n._m*r}}n._m=2147483647,n._a=48271,n._c=0},67676:(e,t,r)=>{"use strict";r.d(t,{FY:()=>m,Od:()=>y,SO:()=>d,Vx:()=>i,a9:()=>u,cq:()=>p,e$:()=>b,e5:()=>a,fS:()=>s,w6:()=>f,zG:()=>c});var n=r(70586),o=r(77734);function s(e,t,r){if((0,n.Wi)(e)&&(0,n.Wi)(t))return!0;if((0,n.Wi)(e)||(0,n.Wi)(t)||e.length!==t.length)return!1;if(r){for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}else for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function i(e,t){let r=e.length!==t.length;e.length=t.length;for(let n=0;n<t.length;++n)e[n]!==t[n]&&(e[n]=t[n],r=!0);return r}function a(e,t,r){let n,o;return r?(n=t.filter((t=>!e.some((e=>r(e,t))))),o=e.filter((e=>!t.some((t=>r(t,e)))))):(n=t.filter((t=>!e.includes(t))),o=e.filter((e=>!t.includes(e)))),{added:n,removed:o}}function c(e){return e&&"number"==typeof e.length}const l=!!Array.prototype.fill;function u(e,t){if(l)return new Array(e).fill(t);const r=new Array(e);for(let n=0;n<e;n++)r[n]=t;return r}function f(e,t){void 0===t&&(t=e,e=0);const r=new Array(t-e);for(let n=e;n<t;n++)r[n-e]=n;return r}class d{constructor(){this.last=0}}const h=new d;function p(e,t,r,n){n=n||h;const o=Math.max(0,n.last-10);for(let s=o;s<r;++s)if(e[s]===t)return n.last=s,s;const s=Math.min(o,r);for(let r=0;r<s;++r)if(e[r]===t)return n.last=r,r;return-1}function b(e,t,r,n){const o=r??e.length,s=p(e,t,o,n);if(-1!==s)return e[s]=e[o-1],null==r&&e.pop(),t}const g=new Set;function m(e,t,r=e.length,n=t.length,o,s){if(0===n||0===r)return r;g.clear();for(let e=0;e<n;++e)g.add(t[e]);o=o||h;const i=Math.max(0,o.last-10);for(let t=i;t<r;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;for(let t=0;t<i;++t)if(g.has(e[t])&&(s&&s.push(e[t]),g.delete(e[t]),e[t]=e[r-1],--r,--t,0===g.size||0===r))return g.clear(),r;return g.clear(),r}function y(e,t){const r=e.indexOf(t);return-1!==r?(e.splice(r,1),t):null}new o.Z},60235:(e,t,r)=>{"use strict";r.d(t,{Mr:()=>i,x9:()=>a});var n=r(80442);const o=new Set;function s(e,t,r=!1){r&&o.has(t)||(r&&o.add(t),e.warn(`🛑 DEPRECATED - ${t}`))}function i(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{moduleName:n}=r;a(e,"Property: "+(n?n+"::":"")+t,r)}}function a(e,t,r={}){if((0,n.Z)("esri-deprecation-warnings")){const{replacement:n,version:o,see:i,warnOnce:a}=r;let c=t;n&&(c+=`\n\t🛠️ Replacement: ${n}`),o&&(c+=`\n\t⚙️ Version: ${o}`),i&&(c+=`\n\t🔗 See ${i} for more details.`),s(e,c,a)}}},91460:(e,t,r)=>{"use strict";function n(e){return e&&("function"==typeof e.on||"function"==typeof e.addEventListener)}function o(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,r);if(Array.isArray(t)){const n=t.slice();for(const t of n)e.addEventListener(t,r);return{remove(){for(const t of n)e.removeEventListener(t,r)}}}return e.addEventListener(t,r),{remove(){e.removeEventListener(t,r)}}}function s(e,t,r){if(!n(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,r);const s=o(e,t,(t=>{s.remove(),r.call(e,t)}));return{remove(){s.remove()}}}r.d(t,{IH:()=>s,on:()=>o,vT:()=>n})},80442:(e,t,r)=>{"use strict";let n;function o(e){return"function"==typeof n[e]?n[e]=n[e](globalThis):n[e]}r.d(t,{Z:()=>o}),n=globalThis.dojoConfig?.has||globalThis.esriConfig?.has?{...globalThis.dojoConfig?.has,...globalThis.esriConfig?.has}:{},o.add=(e,t,r,s)=>((s||void 0===n[e])&&(n[e]=t),r&&o(e)),o.cache=n,o.add("esri-deprecation-warnings",!0),(()=>{o.add("host-webworker",void 0!==globalThis.WorkerGlobalScope&&self instanceof globalThis.WorkerGlobalScope);const e="undefined"!=typeof window&&"undefined"!=typeof location&&"undefined"!=typeof document&&window.location===location&&window.document===document;if(o.add("host-browser",e),o.add("host-node","object"==typeof globalThis.process&&globalThis.process.versions?.node&&globalThis.process.versions.v8),o.add("dom",e),o("host-browser")){const e=navigator,t=e.userAgent,r=e.appVersion,n=parseFloat(r);if(o.add("wp",parseFloat(t.split("Windows Phone")[1])||void 0),o.add("msapp",parseFloat(t.split("MSAppHost/")[1])||void 0),o.add("khtml",r.includes("Konqueror")?n:void 0),o.add("edge",parseFloat(t.split("Edge/")[1])||void 0),o.add("opr",parseFloat(t.split("OPR/")[1])||void 0),o.add("webkit",!o("wp")&&!o("edge")&&parseFloat(t.split("WebKit/")[1])||void 0),o.add("chrome",!o("edge")&&!o("opr")&&parseFloat(t.split("Chrome/")[1])||void 0),o.add("android",!o("wp")&&parseFloat(t.split("Android ")[1])||void 0),o.add("safari",!r.includes("Safari")||o("wp")||o("chrome")||o("android")||o("edge")||o("opr")?void 0:parseFloat(r.split("Version/")[1])),o.add("mac",r.includes("Macintosh")),!o("wp")&&t.match(/(iPhone|iPod|iPad)/)){const e=RegExp.$1.replace(/P/,"p"),r=t.match(/OS ([\d_]+)/)?RegExp.$1:"1",n=parseFloat(r.replace(/_/,".").replace(/_/g,""));o.add(e,n),o.add("ios",n)}o.add("trident",parseFloat(r.split("Trident/")[1])||void 0),o("webkit")||(!t.includes("Gecko")||o("wp")||o("khtml")||o("trident")||o("edge")||o.add("mozilla",n),o("mozilla")&&o.add("ff",parseFloat(t.split("Firefox/")[1]||t.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),r=/iPhone/i.test(e);t&&o.add("esri-mobile",t),r&&o.add("esri-iPhone",r),o.add("esri-geolocation",!!navigator.geolocation)}o.add("esri-canvas-svg-support",!o("trident")),o.add("esri-wasm","WebAssembly"in globalThis),o.add("esri-shared-array-buffer",(()=>{const e="SharedArrayBuffer"in globalThis,t=!1===globalThis.crossOriginIsolated;return e&&!t})),o.add("wasm-simd",(()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])))),o.add("esri-atomics","Atomics"in globalThis),o.add("esri-workers","Worker"in globalThis),o.add("web-feat:cache","caches"in globalThis),o.add("esri-workers-arraybuffer-transfer",!o("safari")||Number(o("safari"))>=12),o.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),o.add("featurelayer-simplify-payload-size-factors",[1,1,4]),o.add("featurelayer-snapshot-enabled",!0),o.add("featurelayer-snapshot-point-min-threshold",8e4),o.add("featurelayer-snapshot-point-max-threshold",4e5),o.add("featurelayer-snapshot-point-coverage",.1),o.add("featurelayer-advanced-symbols",!1),o.add("featurelayer-pbf",!0),o.add("featurelayer-pbf-statistics",!1),o.add("feature-layers-workers",!0),o.add("feature-polyline-generalization-factor",1),o.add("mapview-transitions-duration",200),o.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),o.add("mapserver-pbf-enabled",!1),o.add("mapimagelayer-popup-identify-max-tolerance",20),o.add("heatmap-allow-raster-fallback",!0),o.add("heatmap-force-raster",!1),o("host-webworker")||o("host-browser")&&(o.add("esri-csp-restrictions",(()=>{try{new Function}catch{return!0}return!1})),o.add("esri-image-decode",(()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,<svg version="1.1" xmlns="http://www.w3.org/2000/svg"></svg>',void e.decode().then((()=>{o.add("esri-image-decode",!0,!0,!0)})).catch((()=>{o.add("esri-image-decode",!1,!0,!0)}))}return!1})),o.add("esri-url-encodes-apostrophe",(()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")})))})()},22974:(e,t,r)=>{"use strict";r.d(t,{Vo:()=>c,d9:()=>a,fS:()=>p,y7:()=>b,yd:()=>i});var n=r(67676),o=(r(80442),r(70586)),s=r(1533);function i(e,t){let r;if(t)for(r in e)e.hasOwnProperty(r)&&(void 0===e[r]?delete e[r]:e[r]instanceof Object&&i(e[r],!0));else for(r in e)e.hasOwnProperty(r)&&void 0===e[r]&&delete e[r];return e}function a(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(l(e))return e.clone();if(u(e))return e.map(a);if(f(e))return e.clone();const r={};for(const t of Object.getOwnPropertyNames(e))r[t]=a(e[t]);return r}function c(e){if(!e||"object"!=typeof e||"function"==typeof e)return e;const t=h(e);if((0,o.pC)(t))return t;if(u(e)){let t=!0;const r=e.map((e=>{const r=c(e);return null!=e&&null==r&&(t=!1),r}));return t?r:null}if(l(e))return e.clone();if(!f(e)){const t=new(0,Object.getPrototypeOf(e).constructor);for(const r of Object.getOwnPropertyNames(e)){const n=e[r],o=c(n);if(null!=n&&null==o)return null;t[r]=o}return t}return null}function l(e){return"function"==typeof e.clone}function u(e){return"function"==typeof e.map&&"function"==typeof e.forEach}function f(e){return"function"==typeof e.notifyChange&&"function"==typeof e.watch}function d(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function h(e){if((0,s.W0)(e)||(0,s.lq)(e)||(0,s.KZ)(e)||(0,s.z3)(e)||(0,s.Uc)(e)||(0,s.Hx)(e)||(0,s.ZY)(e)||(0,s.xZ)(e)||(0,s.fS)(e))return(0,s.tP)(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;return e.forEach(((e,r)=>{t.set(r,a(e))})),t}if(e instanceof Set){const t=new Set;return e.forEach((e=>{t.add(a(e))})),t}return null}function p(e,t){return e===t||"number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t)||"function"==typeof(e||{}).getTime&&"function"==typeof(t||{}).getTime&&e.getTime()===t.getTime()||!1}function b(e,t){return e===t||(null==e||"string"==typeof e?e===t:"number"==typeof e?e===t||"number"==typeof t&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&(0,n.fS)(e,t):e instanceof Set?t instanceof Set&&function(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}(e,t):e instanceof Map?t instanceof Map&&function(e,t){if(e.size!==t.size)return!1;for(const[r,n]of e){const e=t.get(r);if(e!==n||void 0===e&&!t.has(r))return!1}return!0}(e,t):!!d(e)&&d(t)&&function(e,t){if(null===e||null===t)return!1;const r=Object.keys(e);if(null===t||Object.keys(t).length!==r.length)return!1;for(const n of r)if(e[n]!==t[n]||!Object.prototype.hasOwnProperty.call(t,n))return!1;return!0}(e,t))}},70586:(e,t,r)=>{"use strict";function n(e){return null!=e}function o(e){return null==e}function s(e,t){return n(e)?t(e):null}function i(e){return e}function a(e,t){if(o(e))throw new Error(t);return e}function c(e,t){return n(e)?e:"function"==typeof t?t():t}function l(e,t){return n(e)?e:t}function u(e){return n(e)&&e.destroy(),null}function f(e){return n(e)&&e.dispose(),null}function d(e){return n(e)&&e.remove(),null}function h(e){return n(e)&&e.abort(),null}function p(e){return n(e)&&e.release(),null}function b(e,t,r){return n(e)&&n(t)?n(r)?r(e,t):e.equals(t):e===t}function g(e){return null}function m(e,t){const r=new Array;for(const n of e)r.push(w(n,null,t));return r}function y(e,t){for(const r of e)s(r,t)}function w(e,t,r){return n(e)?r(e):t}function v(e){return e.filter((e=>n(e)))}function _(e,...t){let r=e;for(let e=0;e<t.length&&r;++e)r=r[t[e]];return r}function O(e){return e}r.d(t,{Bd:()=>g,Fd:()=>m,IM:()=>h,JR:()=>y,O3:()=>f,Pt:()=>c,R2:()=>w,RY:()=>p,SC:()=>u,U2:()=>_,Wg:()=>i,Wi:()=>o,_W:()=>b,hw:()=>d,j0:()=>O,lV:()=>v,pC:()=>n,s3:()=>a,yl:()=>l,yw:()=>s})},78286:(e,t,r)=>{"use strict";r.d(t,{RB:()=>i,RH:()=>o,hS:()=>s});var n=r(22974);function o(e,t,r=!1){return c(e,t,r)}function s(e,t){if(null!=t)return t[e]||a(e.split("."),!1,t)}function i(e,t,r){const n=e.split("."),o=n.pop(),s=a(n,!0,r);s&&o&&(s[o]=t)}function a(e,t,r){let n=r;for(const r of e){if(null==n)return;if(!(r in n)){if(!t)return;n[r]={}}n=n[r]}return n}function c(e,t,r){return t?Object.keys(t).reduce(((e,o)=>{let s=e[o],i=t[o];return s===i?e:void 0===s?(e[o]=(0,n.d9)(i),e):(Array.isArray(i)||Array.isArray(e)?(s=s?Array.isArray(s)?e[o]=s.concat():e[o]=[s]:e[o]=[],i&&(Array.isArray(i)||(i=[i]),r?i.forEach((e=>{s.includes(e)||s.push(e)})):e[o]=i.concat())):i&&"object"==typeof i?e[o]=c(s,i,r):e.hasOwnProperty(o)&&!t.hasOwnProperty(o)||(e[o]=i),e)}),e||{}):e}},95330:(e,t,r)=>{"use strict";r.d(t,{e4:()=>O,zE:()=>c,dD:()=>w,hh:()=>C,Ds:()=>P,as:()=>v,WW:()=>_,R8:()=>y,D_:()=>m,Hc:()=>f,y8:()=>k,fu:()=>p,$F:()=>b,r9:()=>d,k_:()=>l,H9:()=>h,Yn:()=>j,gx:()=>S,Hl:()=>g});const n=(o=globalThis,{setTimeout:(e,t)=>{const r=o.setTimeout(e,t);return{remove:()=>o.clearTimeout(r)}}});var o;r(60235);var s=r(20102),i=r(91460),a=(r(92604),r(70586));function c(e="Aborted"){return new s.Z("AbortError",e)}function l(e,t="Aborted"){if(f(e))throw c(t)}function u(e){return(0,a.pC)(e)?"aborted"in e?e:e.signal:e}function f(e){const t=u(e);return(0,a.pC)(t)&&t.aborted}function d(e){if(m(e))throw e}function h(e){if(!m(e))throw e}function p(e,t){const r=u(e);if(!(0,a.Wi)(r)){if(!r.aborted)return(0,i.IH)(r,"abort",(()=>t()));t()}}function b(e,t){const r=u(e);if(!(0,a.Wi)(r))return l(r),(0,i.IH)(r,"abort",(()=>t(c())))}function g(e,t){const r=u(t);return(0,a.Wi)(r)?e:new Promise(((r,n)=>{let o=p(t,(()=>n(c())));const s=()=>o=(0,a.hw)(o);e.then(s,s),e.then(r,n)}))}function m(e){return"AbortError"===e?.name}async function y(e){try{return await e}catch(e){if(!m(e))throw e;return}}function w(){let e=null;const t=new Promise(((t,r)=>{e={promise:void 0,resolve:t,reject:r}}));return e.promise=t,e}async function v(e){if(!e)return;if("function"!=typeof e.forEach){const t=Object.keys(e),r=t.map((t=>e[t])),n=await v(r),o={};return t.map(((e,t)=>o[e]=n[t])),o}const t=e;return new Promise((e=>{const r=[];let n=t.length;0===n&&e(r),t.forEach((t=>{const o={promise:t||Promise.resolve(t)};r.push(o),o.promise.then((e=>{o.value=e})).catch((e=>{o.error=e})).then((()=>{--n,0===n&&e(r)}))}))}))}async function _(e){return(await v(e)).filter((e=>!!e.value)).map((e=>e.value))}function O(e,t,r){const n=new AbortController;return p(r,(()=>n.abort())),new Promise(((r,o)=>{let s=setTimeout((()=>{s=0,r(t)}),e);p(n,(()=>{s&&(clearTimeout(s),o(c()))}))}))}function k(e){return e&&"function"==typeof e.then}function S(e){return k(e)?e:Promise.resolve(e)}function P(e,t=-1){let r,n,o,s,i=null;const l=(...u)=>{if(r){n=u,s&&s.reject(c()),s=w();const e=(0,a.j0)(s.promise);if(i){const e=i;i=null,e.abort()}return e}if(o=s||w(),s=null,t>0){const n=new AbortController;r=S(e(...u,n.signal));const o=r;O(t).then((()=>{r===o&&(s?n.abort():i=n)}))}else r=1,r=S(e(...u));const f=()=>{const e=n;n=o=r=i=null,null!=e&&l(...e)},d=r,h=o;return d.then(f,f),d.then(h.resolve,h.reject),(0,a.j0)(h.promise)};return l}function C(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n})),o=t=>{e(t)};return o.resolve=t=>e(t),o.reject=e=>t(e),o.timeout=(e,t)=>n.setTimeout((()=>o.reject(t)),e),o.promise=r,o}async function j(e){await Promise.resolve(),l(e)}},19153:(e,t,r)=>{"use strict";r.d(t,{Cb:()=>l,Qs:()=>a,gx:()=>i,hP:()=>c});var n=r(78286);const o=/\{([^\}]+)\}/g;function s(e){return e??""}function i(e,t){return e.replace(o,"object"==typeof t?(e,r)=>s((0,n.hS)(r,t)):(e,r)=>s(t(r)))}function a(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,(e=>t&&t.includes(e)?e:`\\${e}`))}function c(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t}function l(e){return(new DOMParser).parseFromString(e||"","text/html").body.innerText||""}},1533:(e,t,r)=>{"use strict";function n(e,t){if(e.forEach)e.forEach(t);else for(let r=0;r<e.length;r++)t(e[r],r,e)}function o(e,t,r){if(e.slice)return e.slice(t,r);void 0===t?t=0:(t<0&&(t+=e.length),t=Math.min(e.length,Math.max(0,t))),void 0===r?r=e.length:(r<0&&(r+=e.length),r=Math.min(e.length,Math.max(0,r)));const n=Math.max(0,r-t),o=new(0,e.constructor)(n);for(let r=0;r<n;r++)o[r]=e[t+r];return o}function s(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}function i(e){return e instanceof Int8Array||e&&e.constructor&&"Int8Array"===e.constructor.name}function a(e){return e instanceof Uint8Array||e&&e.constructor&&"Uint8Array"===e.constructor.name}function c(e){return e instanceof Uint8ClampedArray||e&&e.constructor&&"Uint8ClampedArray"===e.constructor.name}function l(e){return e instanceof Int16Array||e&&e.constructor&&"Int16Array"===e.constructor.name}function u(e){return e instanceof Uint16Array||e&&e.constructor&&"Uint16Array"===e.constructor.name}function f(e){return e instanceof Int32Array||e&&e.constructor&&"Int32Array"===e.constructor.name}function d(e){return e instanceof Uint32Array||e&&e.constructor&&"Uint32Array"===e.constructor.name}function h(e){return e instanceof Float32Array||e&&e.constructor&&"Float32Array"===e.constructor.name}function p(e){return e instanceof Float64Array||e&&e.constructor&&"Float64Array"===e.constructor.name}r.d(t,{Ed:()=>n,Hx:()=>f,KZ:()=>c,Uc:()=>u,W0:()=>i,ZY:()=>d,eP:()=>s,fS:()=>p,lq:()=>a,tP:()=>o,xZ:()=>h,z3:()=>l})},17452:(e,t,r)=>{"use strict";r.d(t,{$U:()=>ne,AH:()=>V,B7:()=>j,D6:()=>U,Fv:()=>Z,HK:()=>K,Hu:()=>de,Ie:()=>ue,L:()=>k,Ml:()=>be,P$:()=>B,PF:()=>F,Qj:()=>le,R9:()=>y,TI:()=>O,YP:()=>H,Yd:()=>ae,ZN:()=>he,_l:()=>X,b7:()=>A,ed:()=>N,fl:()=>pe,hF:()=>q,hO:()=>oe,io:()=>ee,jc:()=>z,kl:()=>L,mN:()=>S,oC:()=>te,oh:()=>W,qg:()=>E,rS:()=>Q,sJ:()=>Y,tD:()=>$,tm:()=>I,u0:()=>P,v_:()=>D,vt:()=>ce});var n=r(68773),o=r(20102),s=r(92604),i=r(70586);const a=s.Z.getLogger("esri.core.urlUtils"),c=n.Z.request,l="esri/config: esriConfig.request.proxyUrl is not set.",u=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,f=/^\s*http:/i,d=/^\s*https:/i,h=/^\s*file:/i,p=/:\d+$/,b=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,g=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),m=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class y{constructor(e=""){this.uri=e,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let t=(0,i.j0)(this.uri.match(g));this.scheme=t[2]||(t[1]?"":null),this.authority=t[4]||(t[3]?"":null),this.path=t[5],this.query=t[7]||(t[6]?"":null),this.fragment=t[9]||(t[8]?"":null),null!=this.authority&&(t=(0,i.j0)(this.authority.match(m)),this.user=t[3]||null,this.password=t[4]||null,this.host=t[6]||t[7],this.port=t[9]||null)}toString(){return this.uri}}const w={};let v=new y(n.Z.applicationUrl);let _=function(){const e=(0,i.j0)(v.path),t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${v.scheme}://${v.host}${null!=v.port?`:${v.port}`:""}${t}`}();const O=()=>v,k=()=>_;function S(e){const t={path:null,query:null},r=new y(e),n=e.indexOf("?");return null===r.query?t.path=e:(t.path=e.substring(0,n),t.query=P(r.query)),r.fragment&&(t.hash=r.fragment,null===r.query&&(t.path=t.path.substring(0,t.path.length-(r.fragment.length+1)))),t}function P(e){const t=e.split("&"),r={};for(const e of t){if(!e)continue;const t=e.indexOf("=");let n,o;t<0?(n=decodeURIComponent(e),o=""):(n=decodeURIComponent(e.slice(0,t)),o=decodeURIComponent(e.slice(t+1)));let s=r[n];"string"==typeof s&&(s=r[n]=[s]),Array.isArray(s)?s.push(o):r[n]=o}return r}function C(e){return e&&"object"==typeof e&&"toJSON"in e&&"function"==typeof e.toJSON}function j(e,t){return e?t&&"function"==typeof t?Object.keys(e).map((r=>encodeURIComponent(r)+"="+encodeURIComponent(t(r,e[r])))).join("&"):Object.keys(e).map((r=>{const n=e[r];if(null==n)return"";const o=encodeURIComponent(r)+"=",s=t&&t[r];return s?o+encodeURIComponent(s(n)):Array.isArray(n)?n.map((e=>C(e)?o+encodeURIComponent(JSON.stringify(e)):o+encodeURIComponent(e))).join("&"):C(n)?o+encodeURIComponent(JSON.stringify(n)):o+encodeURIComponent(n)})).filter((e=>e)).join("&"):""}function A(e=!1){let t,r=c.proxyUrl;if("string"==typeof e){t=ne(e);const n=N(e);n&&(r=n.proxyUrl)}else t=!!e;if(!r)throw a.warn(l),new o.Z("urlutils:proxy-not-set",l);return t&&se()&&(r=oe(r)),S(r)}function E(e){const t=N(e);let r,n;if(t){const e=x(t.proxyUrl);r=e.path,n=e.query?P(e.query):null}if(r){const t=S(e);e=r+"?"+t.path;const o=j({...n,...t.query});o&&(e=`${e}?${o}`)}return e}const T={path:"",query:""};function x(e){const t=e.indexOf("?");return-1!==t?(T.path=e.slice(0,t),T.query=e.slice(t+1)):(T.path=e,T.query=null),T}function M(e){return(e=ie(e=function(e){return e&&"/"===e[e.length-1]?e:`${e}/`}(e=x(e).path),!0)).toLowerCase()}function $(e){const t={proxyUrl:e.proxyUrl,urlPrefix:M(e.urlPrefix)},r=c.proxyRules,n=t.urlPrefix;let o=r.length;for(let e=0;e<r.length;e++){const t=r[e].urlPrefix;if(0===n.indexOf(t)){if(n.length===t.length)return-1;o=e;break}0===t.indexOf(n)&&(o=e+1)}return r.splice(o,0,t),o}function N(e){const t=c.proxyRules,r=M(e);for(let e=0;e<t.length;e++)if(0===r.indexOf(t[e].urlPrefix))return t[e]}function I(e,t){return e=R(e),t=R(t),ie(e)===ie(t)}function R(e){const t=(e=Z(e)).indexOf("/sharing");return t>0?e.substring(0,t):e.replace(/\/+$/,"")}function W(e){const t=t=>null==t||t instanceof RegExp&&t.test(e)||"string"==typeof t&&e.startsWith(t),r=c.interceptors;if(r)for(const e of r)if(Array.isArray(e.urls)){if(e.urls.some(t))return e}else if(t(e.urls))return e;return null}function U(e,t,r=!1){const n=fe(e),o=fe(t);return!(!r&&n.scheme!==o.scheme)&&null!=n.host&&null!=o.host&&n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function L(e){if("string"==typeof e){if(!H(e))return!0;e=fe(e)}if(U(e,v))return!0;const t=c.trustedServers||[];for(let r=0;r<t.length;r++){const n=J(t[r]);for(let t=0;t<n.length;t++)if(U(e,n[t]))return!0}return!1}function J(e){return w[e]||(re(e)||te(e)?w[e]=[new y(q(e))]:w[e]=[new y(`http://${e}`),new y(`https://${e}`)]),w[e]}function q(e,t=_,r){return te(e)?r&&r.preserveProtocolRelative?e:"http"===v.scheme&&v.authority===B(e).slice(2)?`http:${e}`:`https:${e}`:re(e)?e:(0,i.j0)(D("/"===e[0]?function(e){const t=e.indexOf("//"),r=e.indexOf("/",t+2);return-1===r?e:e.slice(0,r)}(t):t,e))}function F(e,t=_,r){if(!H(e))return e;const n=Z(e),o=n.toLowerCase(),s=Z(t).toLowerCase().replace(/\/+$/,""),i=r?Z(r).toLowerCase().replace(/\/+$/,""):null;if(i&&0!==s.indexOf(i))return e;const a=(e,t,r)=>-1===(r=e.indexOf(t,r))?e.length:r;let c=a(o,"/",o.indexOf("//")+2),l=-1;for(;o.slice(0,c+1)===s.slice(0,c)+"/"&&(l=c+1,c!==o.length);)c=a(o,"/",c+1);if(-1===l)return e;if(i&&l<i.length)return e;e=n.slice(l);const u=s.slice(l-1).replace(/[^/]+/g,"").length;if(u>0)for(let t=0;t<u;t++)e=`../${e}`;else e=`./${e}`;return e}function Z(e){return function(e){const t=c.httpsDomains;if(!function(e){return f.test(e)||"http"===v.scheme&&te(e)}(e))return e;const r=e.indexOf("/",7);let n;if(n=-1===r?e:e.slice(0,r),n=n.toLowerCase().slice(7),p.test(n)){if(!n.endsWith(":80"))return e;n=n.slice(0,-3),e=e.replace(":80","")}return"http"===v.scheme&&n===v.authority&&!b.test(e)||(se()&&n===v.authority||t&&t.some((e=>n===e||n.endsWith(`.${e}`)))||se()&&!N(e))&&(e=oe(e)),e}(e=function(e){return e.replace(/^(https?:\/\/)(arcgis\.com)/i,"$1www.$2")}(e=function(e){if(/^https?:\/\//i.test(e)){const t=x(e);e=(e=t.path.replace(/\/{2,}/g,"/")).replace("/","//"),t.query&&(e+=`?${t.query}`)}return e}(e=q(e=e.trim()))))}function D(...e){const t=e.filter(i.pC);if(!t||!t.length)return;const r=[];if(H(t[0])){const e=t[0],n=e.indexOf("//");-1!==n&&(r.push(e.slice(0,n+1)),function(e){return h.test(e)}(t[0])&&(r[0]+="/"),t[0]=e.slice(n+2))}else"/"===t[0][0]&&r.push("");const n=t.reduce(((e,t)=>t?e.concat(t.split("/")):e),[]);for(let e=0;e<n.length;e++){const t=n[e];".."===t&&r.length>0&&".."!==r[r.length-1]?r.pop():(!t&&e===n.length-1||t&&("."!==t||0===r.length))&&r.push(t)}return r.join("/")}function B(e,t=!1){if(z(e)||K(e))return null;let r=e.indexOf("://");if(-1===r&&te(e))r=2;else{if(-1===r)return null;r+=3}const n=e.indexOf("/",r);return-1!==n&&(e=e.slice(0,n)),t&&(e=ie(e,!0)),e}function H(e){return te(e)||re(e)}function z(e){return null!=e&&"blob:"===e.slice(0,5)}function K(e){return"data:"===e.slice(0,5)}function V(e){const t=Y(e);if(!t||!t.isBase64)return null;const r=atob(t.data),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n.buffer}function Q(e){return btoa(String.fromCharCode.apply(null,e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const G=/^data:(.*?)(;base64)?,(.*)$/;function Y(e){const t=e.match(G);if(!t)return null;const[,r,n,o]=t;return{mediaType:r,isBase64:!!n,data:o}}function X(e){return e.isBase64?`data:${e.mediaType};base64,${e.data}`:`data:${e.mediaType},${e.data}`}function ee(e,t){(function(e,t){if(!e)return!1;const r=document.createElement("a");if(!("download"in r))return!1;const n=URL.createObjectURL(e);return r.download=t,r.href=n,r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),!0})(e,t)||function(e,t){!!window.navigator.msSaveOrOpenBlob&&window.navigator.msSaveOrOpenBlob(e,t)}(e,t)}function te(e){return null!=e&&void 0!==e&&"/"===e[0]&&"/"===e[1]}function re(e){return u.test(e)}function ne(e){return d.test(e)||"https"===v.scheme&&te(e)}function oe(e){return te(e)?`https:${e}`:e.replace(f,"https:")}function se(){return"https"===v.scheme}function ie(e,t=!1){return te(e)?e.slice(2):(e=e.replace(u,""),t&&e.length>1&&"/"===e[0]&&"/"===e[1]&&(e=e.slice(2)),e)}function ae(e){let t=0;if(H(e)){const r=e.indexOf("//");-1!==r&&(t=r+2)}const r=e.lastIndexOf("/");return r<t?e:e.slice(0,r+1)}function ce(e,t){if(!e)return"";const r=S(e).path.replace(/\/+$/,""),n=r.substring(r.lastIndexOf("/")+1);if(!t?.length)return n;const o=new RegExp(`.(${t.join("|")})$`,"ig");return n.replace(o,"")}function le(e){return e.replace(/\/+$/,"")}function ue(e,t,r){if(!(t&&r&&e&&H(e)))return e;const n=e.indexOf("//"),o=e.indexOf("/",n+2),s=e.indexOf(":",n+2),i=Math.min(o<0?e.length:o,s<0?e.length:s);return e.slice(n+2,i).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,n+2)}${r}${e.slice(i)}`}function fe(e){return"string"==typeof e?new y(q(e)):(e.scheme||(e.scheme=v.scheme),e)}function de(e,t){const r=S(e),n=Object.keys(r.query||{});return n.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${n.join(", ")}.`),r.path}function he(e,t,r){const n=S(e),o=n.query||{};return o[t]=String(r),`${n.path}?${j(o)}`}function pe(e,t){const r=S(e),n=r.query||{};for(const e in t)n[e]=t[e];const o=j(n);return o?`${r.path}?${o}`:r.path}function be(e){if((0,i.Wi)(e))return null;const t=e.match(ge);return t?t[1]:null}const ge=/.*?\.([^\/]*)$/},25045:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var n=r(40330),o=r(20102),s=r(91460),i=r(70586),a=r(95330),c=r(94362),l=r(17202);const u={statsWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(9293),r.e(6841)]).then(r.bind(r,36841)),geometryEngineWorker:()=>Promise.all([r.e(5837),r.e(8227)]).then(r.bind(r,48227)),CSVSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(4478)]).then(r.bind(r,14478)),EdgeProcessingWorker:()=>Promise.all([r.e(6481),r.e(9594)]).then(r.bind(r,49594)),ElevationSamplerWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(6481),r.e(6459),r.e(1438)]).then(r.bind(r,61787)),FeatureServiceSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(8494),r.e(6208)]).then(r.bind(r,2255)),GeoJSONSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(7845)]).then(r.bind(r,97845)),LercWorker:()=>r.e(3027).then(r.bind(r,23027)),MemorySourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(639)]).then(r.bind(r,30639)),PBFDecoderWorker:()=>Promise.all([r.e(1400),r.e(1562),r.e(5886),r.e(802)]).then(r.bind(r,10802)),Pipeline:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(8494),r.e(4325),r.e(908)]).then(r.bind(r,61837)),PointCloudWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(7789)]).then(r.bind(r,16583)),RasterWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(176),r.e(2398),r.e(8061)]).then(r.bind(r,61576)),SceneLayerSnappingSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(6481),r.e(2631),r.e(934)]).then(r.bind(r,40614)),SceneLayerWorker:()=>Promise.all([r.e(3739),r.e(1412)]).then(r.bind(r,31412)),WFSSourceWorker:()=>Promise.all([r.e(4547),r.e(1400),r.e(3739),r.e(1562),r.e(1534),r.e(5886),r.e(9293),r.e(2916),r.e(8140),r.e(3230)]).then(r.bind(r,43230)),WorkerTileHandler:()=>Promise.all([r.e(4325),r.e(1785),r.e(6810),r.e(3388)]).then(r.bind(r,56456))},{CLOSE:f,ABORT:d,INVOKE:h,RESPONSE:p,OPEN_PORT:b,ON:g}=c.Cs;class m{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===c.Cs.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),null===this._timer&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class y{constructor(e,t,r){this._port=e,this._getNextJob=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new m((e=>this._onInvokeMessage(e))),this._client=t.client,this._onMessage=this._onMessage.bind(this),this._channel=t.channel,this._schedule=t.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(e){const t=new MessageChannel;let r;r="function"==typeof e?new e:"default"in e&&"function"==typeof e.default?new e.default:e;const n=new y(t.port1,{channel:t,client:r},(()=>null));return"object"==typeof r&&"remoteClient"in r&&(r.remoteClient=n),y.clients.set(n,r),t.port2}static loadWorker(e){const t=u[e];return t?t():Promise.resolve(null)}close(){this._post({type:f}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,t,r){const n=r&&r.signal,s=r&&r.transferList;if(!this._port)return Promise.reject(new o.Z("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:t}));const l=(0,c.jt)();return new Promise(((r,o)=>{if((0,a.Hc)(n))return this._processWork(),void o((0,a.zE)());const c=(0,a.fu)(n,(()=>{const e=this._outJobs.get(l);e&&(this._outJobs.delete(l),this._processWork(),(0,i.hw)(e.abortHandle),this._post({type:d,jobId:l}),o((0,a.zE)()))})),u={resolve:r,reject:o,abortHandle:c,debugInfo:e};this._outJobs.set(l,u),this._post({type:h,jobId:l,methodName:e,abortable:null!=n},t,s)}))}on(e,t){const r=new MessageChannel;function n(e){t(e.data)}return this._port.postMessage({type:c.Cs.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),{remove(){r.port1.postMessage({type:c.Cs.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)}}}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:b,port:e.port2}),e.port1}_processWork(){if(this._outJobs.size>=2)return;const e=this._getNextJob();if(!e)return;const{methodName:t,data:r,invokeOptions:n,deferred:o}=e;this.invoke(t,r,n).then((e=>o.resolve(e))).catch((e=>o.reject(e)))}_close(){this._channel&&(this._channel=null),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach((e=>{(0,i.hw)(e.abortHandle),e.reject((0,a.zE)(`Worker closing, aborting job calling '${e.debugInfo}'`))})),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(e){(0,i.pC)(this._schedule)?this._schedule((()=>this._processMessage(e))):this._processMessage(e)}_processMessage(e){const t=(0,c.QM)(e);if(t)switch(t.type){case p:this._onResponseMessage(t);break;case h:this._invokeQueue.push(t);break;case d:this._onAbortMessage(t);break;case f:this._onCloseMessage();break;case b:this._onOpenPortMessage(t);break;case g:this._onOnMessage(t)}}_onAbortMessage(e){const t=this._inJobs,r=e.jobId,n=t.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),t.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&y.clients.get(this)===e&&e.destroy(),y.clients.delete(this),e&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:t,jobId:r,data:n,abortable:o}=e,s=o?new AbortController:null,i=this._inJobs;let l,u=this._client,f=u[t];try{if(!f&&t&&t.includes(".")){const e=t.split(".");for(let t=0;t<e.length-1;t++)u=u[e[t]],f=u[e[t+1]]}if("function"!=typeof f)throw new TypeError(`${t} is not a function`);l=f.call(u,n,{client:this,signal:s?s.signal:null})}catch(e){return void this._post({type:p,jobId:r,error:(0,c.AB)(e)})}(0,a.y8)(l)?(i.set(r,{controller:s,promise:l}),l.then((e=>{i.has(r)&&(i.delete(r),this._post({type:p,jobId:r},e))}),(e=>{i.has(r)&&(i.delete(r),(0,a.D_)(e)||this._post({type:p,jobId:r,error:(0,c.AB)(e||{message:`Error encountered at method ${t}`})}))}))):this._post({type:p,jobId:r},l)}_onOpenPortMessage(e){new y(e.port,{client:this._client},(()=>null))}_onOnMessage(e){const{port:t}=e,r=this._client.on(e.eventType,(e=>{t.postMessage(e)})),n=(0,s.on)(e.port,"message",(e=>{(0,c.QM)(e).type===c.Cs.CLOSE&&(n.remove(),r.remove(),t.close())}))}_onResponseMessage(e){const{jobId:t,error:r,data:n}=e,s=this._outJobs;if(!s.has(t))return;const a=s.get(t);s.delete(t),this._processWork(),(0,i.hw)(a.abortHandle),r?a.reject(o.Z.fromJSON(JSON.parse(r))):a.resolve(n)}_post(e,t,r){return(0,c.oi)(this._port,e,t,r)}}y.kernelInfo={revision:l.$,version:n.i8,buildDate:l.r},y.clients=new Map},94362:(e,t,r)=>{"use strict";r.d(t,{AB:()=>a,Cs:()=>n,QM:()=>l,jt:()=>i,oi:()=>c});var n,o=r(80442);!function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"}(n||(n={}));let s=0;function i(){return s++}function a(e){return e?"string"==typeof e?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function c(e,t,r,o){if(t.type===n.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==n.INVOKE&&t.type!==n.RESPONSE)return void e.postMessage(t);let s;!function(e){return e&&"object"==typeof e&&("result"in e||"transferList"in e)}(r)?(s=u(o),t.data=r):(s=u(r.transferList),t.data=r.result),s?e.postMessage(t,s):e.postMessage(t)}function l(e){if(!e)return null;const t=e.data;return t?"string"==typeof t?JSON.parse(t):t:null}function u(e){if(!e||!e.length)return null;if((0,o.Z)("esri-workers-arraybuffer-transfer"))return e;const t=e.filter((e=>!function(e){return e instanceof ArrayBuffer||e&&e.constructor&&"ArrayBuffer"===e.constructor.name}(e)));return t.length?t:null}},40330:(e,t,r)=>{"use strict";r.d(t,{Dp:()=>l,Nv:()=>i,i8:()=>s,id:()=>a,qh:()=>c});var n=r(80442),o=r(17452);const s="4.25",i={async request(e,t){const{default:n}=await r.e(3172).then(r.bind(r,3172)),s=e.options,i=s.responseType;s.signal=t?.signal,s.responseType="native"===i||"native-request-init"===i?"native-request-init":["blob","json","text"].includes(i)&&(0,o.oh)(e.url)?.after?i:"array-buffer";const a=await n(e.url,s),c={data:a.data,ssl:a.ssl};switch(a.requestOptions.responseType){case"native-request-init":return delete c.data.signal,c;case"blob":c.data=await c.data.arrayBuffer();break;case"json":c.data=(new TextEncoder).encode(JSON.stringify(c.data)).buffer;break;case"text":c.data=(new TextEncoder).encode(c.data).buffer}return{result:c,transferList:[c.data]}}};let a;function c(e){a=e}function l(e){const t=a&&a.findCredential(e);return t&&t.token?(0,o.ZN)(e,"token",t.token):e}(0,n.Z)("host-webworker")||((0,n.Z)("edge")||(0,n.Z)("trident"))&&console.warn("Deprecated browser - see http://esriurl.com/oldbrowser")},17202:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,r:()=>n});const n="20220705",o="2ffeb1ba19a7be6123a2382e7d4f00f581760d96"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.m=e,r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"chunks/"+{24:"40fa9b28ca882a70813a",176:"97f32af5893c86f6444c",247:"b24a76738482ebfc626f",280:"39de883f236e2a8d9024",461:"0e00741d35cdbf48e72d",565:"bbff8ed3192fe22a6b6d",576:"7fdd029a76a7ab1c3d83",639:"1fe8daa3a0f4fea3a61c",734:"d81bcc85ceb91bbba69f",739:"e1bb3361a20c8c830d57",802:"c495a66978d67c7e17f3",819:"5d3e774ce7b006c8cba8",908:"83c9da68d6dbc77f60e5",934:"0273e841e78880e450c5",1197:"3228293c159886513f60",1400:"910a2ffb4328f8ee7a0d",1408:"1a581e201e905588e2e6",1412:"e5b5b93e707173a4c883",1421:"6196cfdeb91ceba52af3",1423:"6889d698a2c796ed1ce6",1433:"dfdd853dd6c023089963",1438:"a07ab40977e06cb58486",1491:"d3650d799aad1f401efb",1534:"08a5c5a33a7c7c6852e5",1562:"8ebaad46e2fe8925e3b0",1761:"c9e890b4be9d01c13efe",1773:"e153e89c8a15c2f036ef",1785:"f135822fceac5ad4667c",1819:"fb97361a09b39a8a0483",1938:"a9a459639c82c35ada1f",2133:"1cffa7cf5e10ffbd6eb1",2134:"30dbdf2aa1bc8e61cad4",2398:"bc1155973f3d84371df7",2485:"c3459e4b453289f57c2f",2631:"35cd0856d669a0a725be",2664:"bbe51b49fe7093e47306",2723:"009386ed70740f87a014",2855:"d595f2c41e3bd1b33e07",2916:"3485e2342f44e4d760a2",3027:"4bfcb7350ca492767a45",3121:"8caeb7c52816b582553f",3127:"9e6ce879ec0da884b9b8",3128:"8cdeccb6b67098d6a8d7",3172:"869310ef4c98542bf9df",3230:"6ddaf66e5608deda6811",3388:"f7d1f75b6aa3ef566d74",3471:"5470cb0c3f670957c22c",3529:"9520b32d5d53ea9cd0d3",3668:"290899b47a52f8b28a9c",3723:"4ae670bb98a88add544f",3739:"e201ffcca7321771ee20",3750:"28ecf5c49144903fbf68",3852:"b71a0a8a2f446c671161",3853:"24f7a3df08c3a2d3795c",3974:"39a754713a48d46618bd",4109:"d499cce61c1c5c367380",4133:"f039a029515be17164c0",4166:"93c945099be3a4f43263",4286:"037e666f6a7ad1def59c",4325:"d91140bc583925e4faf6",4358:"71a4618d959a09302c51",4417:"591a22aaf068a6e0aabb",4475:"d10cb53bc07963d87311",4477:"de46fe79391f11d09d42",4478:"0c067c59a2a1bb4101f9",4499:"577679f302c26ba4060a",4547:"4aa26e005a953d14cf21",4695:"98c519ac806cc55bc19b",4720:"4daed788b965c26d76ec",4836:"c7fa92daca3f6e91734e",4889:"17be5bd0d1c233d73d7a",4910:"86f99e7078f427ad929f",5001:"5e20fd8b7c9497f2da1f",5235:"7773b9415c5a8d82973f",5329:"c8a3a28809542396c6fd",5787:"42987dcfda665c860151",5837:"bc682351fc915b4ab5a6",5853:"3bfab05ae07ac18a75fe",5886:"821a0754eae11421e56a",5906:"3c05a56dda4ad67a3520",6130:"fde9e9683335fa6c8236",6199:"35d46e4eeb43c256a63b",6208:"1970d7a65832b70f7f5c",6233:"1e4e5d147263e98536bc",6237:"c544df83e86a9d36b68c",6312:"2e4887ba01cf8507e3e3",6459:"65161a874595b0a34aa1",6481:"c2286d97539066c8549a",6690:"3790f0362b6f27ee798b",6710:"d828a0656e7351a74fc4",6748:"77c6ba5ea85915d9078c",6774:"c8402e32307a7b7eaaeb",6810:"7ad6721cf0ad76ce5a9d",6841:"0e3e2276665d8e466379",6920:"47d78b4f7117554acecf",6968:"d1d71c1516ae00a0b4f1",7175:"06a7f58260225f52f8e6",7202:"b26ea76e3f41b45756e0",7277:"2ee9ba5b08998b4ddb8e",7304:"b58eab838bd5c3a7961a",7374:"f9d744ba6bbd7c1dd689",7572:"43e7ef49b3f50cca6f8f",7789:"695f90305478f5024fa7",7845:"cc5a83f3a2b7c8be5db1",7873:"93eb468381bfcf0e47d7",8008:"594d7fdb80ad9cdedb85",8061:"be78cd4a28d3bbb07488",8062:"b34cffd5c45d3a8134bc",8096:"04e5486f0d8d4c6bd8a2",8140:"006353a16c6addee17f9",8163:"0b269862733afe740a63",8227:"76b424b6d2c1ef089324",8326:"9d07969fbea13aa5b03c",8422:"1e7d6920c4d176093ca8",8494:"462163f31fa134b7b216",8636:"f5d10ea7b8888f822b0c",8758:"ce546851aa7f48585494",8828:"92e1fd97afcdbb719e3f",8899:"3d36278e4f7b8267b78c",9032:"1ebb29ceabc81509646c",9070:"85a2cf095f002b2c486f",9147:"45ab9933f014e12f2330",9153:"ff6ebc9c3890a9e28e12",9169:"76b75ac18c8239687321",9291:"905130ff0118962c8140",9293:"ecb8d864dd00de322657",9296:"f0d1b51492106fda3efe",9348:"a05f6afcf56245824853",9454:"fa5a2912d084994a661a",9490:"7574316b3af61c389e8f",9594:"dda5ea7f8d35e257815c",9779:"9b8711ba50ebaec535f8",9884:"356db8b8297282c77291",9904:"cf3e1ac63580bc495ea6",9932:"abd1bd74ba571e39ab5a"}[e]+".js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={134:1};r.f.i=(t,n)=>{e[t]||importScripts(r.p+r.u(t))};var t=self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[],n=t.push.bind(t);t.push=t=>{var[o,s,i]=t;for(var a in s)r.o(s,a)&&(r.m[a]=s[a]);for(i&&i(r);o.length;)e[o.pop()]=1;n(t)}})(),r(88277);var n=r(25045);RemoteClient=n})();
|
package/chunks/SSAO.glsl.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{unwrap as e}from"../core/maybe.js";import{s as r}from"./vec2.js";import{a as t}from"./vec2f64.js";import{i as a}from"./vec3.js";import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js";import{ReadLinearDepth as n}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js";import{CameraSpace as s,getZScale as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{Float2DrawUniform as
|
|
5
|
+
import{unwrap as e}from"../core/maybe.js";import{s as r}from"./vec2.js";import{a as t}from"./vec2f64.js";import{i as a}from"./vec3.js";import{ScreenSpacePass as o}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js";import{ReadLinearDepth as n}from"../views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js";import{CameraSpace as s,getZScale as i}from"../views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js";import{Float2DrawUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js";import{Float2PassUniform as c}from"../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{FloatPassUniform as u}from"../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{NoParameters as f,glsl as d}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as p}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DDrawUniform as m}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";import{Texture2DPassUniform as v}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{SSAOOutput as h}from"../views/3d/webgl-engine/lib/SSAOTechniqueConfiguration.js";const w={samples:16,filterRadius:4,attenuation:.5};class x extends f{constructor(){super(...arguments),this.projScale=1}}class g extends f{constructor(){super(...arguments),this.blurSize=t()}}function b(t){const f=new p,x=f.fragment;if(f.include(o),t.output===h.Blur){const e=(w.filterRadius+1)/2,r=1/(2*e*e);x.include(n),x.uniforms.add([new v("depthMap",(e=>e.depthTexture)),new m("tex",(e=>e.colorTexture)),new l("blurSize",(e=>e.blurSize)),new u("projScale",((e,r)=>{const t=a(r.camera.eye,r.camera.center);return t>5e4?Math.max(0,e.projScale-(t-5e4)):e.projScale})),new c("nearFar",((e,r)=>r.camera.nearFar))]),x.code.add(d`
|
|
6
6
|
void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) {
|
|
7
7
|
float c = texture2D(tex, uv).r;
|
|
8
8
|
float d = linearDepthFromTexture(depthMap, uv, nearFar);
|
|
@@ -56,7 +56,7 @@ vec3 v = Q - C;
|
|
|
56
56
|
float vv = dot(v, v);
|
|
57
57
|
float vn = dot(normalize(v), n_C);
|
|
58
58
|
return fallOffFunction(vv, vn, 0.1);
|
|
59
|
-
}`),x.uniforms.add([new
|
|
59
|
+
}`),x.uniforms.add([new c("nearFar",((e,r)=>r.camera.nearFar)),new v("normalMap",(e=>e.normalTexture)),new v("depthMap",(e=>e.depthTexture)),new c("zScale",((e,r)=>i(r))),new u("projScale",(e=>e.projScale)),new v("rnm",(e=>e.noiseTexture)),new c("rnmScale",((t,a)=>r(F,a.camera.fullWidth/e(t.noiseTexture).descriptor.width,a.camera.fullHeight/e(t.noiseTexture).descriptor.height))),new u("intensity",((e,r)=>4*w.attenuation/S(r)**6)),new c("screenSize",((e,t)=>r(F,t.camera.fullWidth,t.camera.fullHeight)))]),x.code.add(d`
|
|
60
60
|
void main(void) {
|
|
61
61
|
fillSphere();
|
|
62
62
|
vec3 fres = normalize((texture2D(rnm, uv * rnmScale).xyz * 2.0) - vec3(1.0));
|
|
@@ -112,4 +112,4 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
112
112
|
A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;
|
|
113
113
|
gl_FragColor = vec4(A);
|
|
114
114
|
}
|
|
115
|
-
`)),f}function S(e){return Math.max(
|
|
115
|
+
`)),f}function S(e){return Math.max(10,20*e.camera.computeRenderPixelSizeAtDist(Math.abs(4*e.camera.relativeElevation)))}const F=t(),P=Object.freeze(Object.defineProperty({__proto__:null,SSAOPassParameters:x,SSAODrawParameters:g,build:b},Symbol.toStringTag,{value:"Module"}));export{x as S,g as a,P as b,b as c};
|
package/core/quantityUtils.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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"./maybe.js";import{unitType as n,isBaseUnit as u,convertUnit as e,baseUnitForUnit as i}from"./unitUtils.js";function r(t,u){return{type:n(u),value:t,unit:u}}function o(t,u){return{type:n(u),value:t,unit:u}}function a(t,u){return{type:n(u),value:t,unit:u}}function
|
|
5
|
+
import{isNone as t}from"./maybe.js";import{unitType as n,isBaseUnit as u,convertUnit as e,baseUnitForUnit as i}from"./unitUtils.js";function r(t,u){return{type:n(u),value:t,unit:u}}function o(t,u){return{type:n(u),value:t,unit:u}}function a(t,u){return{type:n(u),value:t,unit:u}}function l(t,u){return{type:n(u),value:t,unit:u}}function c(t,u,e="arithmetic"){return{type:n(u),value:t,unit:u,rotationType:e}}function f(t){return u(t.unit)}function v(t,n){return r(e(t.value,t.unit,n),n)}function s(t){return v(t,i(t.unit))}function p(n,u){return t(n)?u:t(u)||n.value>e(u.value,u.unit,n.unit)?n:u}function m(n,u){return t(n)?u:t(u)||n.value<e(u.value,u.unit,n.unit)?n:u}function y(n,u){return t(n)?null:{...n,value:n.value*u}}const j=o(0,"meters"),U=a(0,"square-meters");export{c as createAngle,a as createArea,o as createLength,r as createQuantity,l as createVolume,f as isBaseUnit,p as max,m as min,y as scale,s as toBaseUnit,v as toUnit,j as zeroMeters,U as zeroSquareMeters};
|
package/package.json
CHANGED
package/support/revision.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const e="20220705",f="2ffeb1ba19a7be6123a2382e7d4f00f581760d96";export{e as buildDate,f 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.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import i from"../../../../../core/Handles.js";import{handlesGroup as a}from"../../../../../core/handleUtils.js";import has from"../../../../../core/has.js";import{isSome as t}from"../../../../../core/maybe.js";import{when as
|
|
5
|
+
import i from"../../../../../core/Handles.js";import{handlesGroup as a}from"../../../../../core/handleUtils.js";import has from"../../../../../core/has.js";import{isSome as t}from"../../../../../core/maybe.js";import{when as n}from"../../../../../core/reactiveUtils.js";import{ManipulatorType as e}from"../ManipulatorType.js";import{DISC_RADIUS_SMALL as s,DISC_RADIUS as o}from"./config.js";import{Manipulation as r}from"./Manipulation.js";import{MoveXYAxisManipulation as l}from"./MoveXYAxisManipulation.js";import{MoveXYDiscManipulation as p}from"./MoveXYDiscManipulation.js";import{MoveZManipulation as h}from"./MoveZManipulation.js";class u extends r{constructor(a){super(),this._handles=new i,this._interactive=!0;const{tool:t,view:n,snapToScene:e,radius:s}=a;this._view=n,this.xyManipulation=new p({tool:t,view:n,snapToScene:e,radius:s}),this.xyAxisManipulation=new l({tool:t,view:n,radius:s}),this.zManipulation=new h({tool:t,view:n,radius:s}),this.xyManipulation.available=a.xyAvailable,this.xyAxisManipulation.available=a.xyAxisAvailable,this.zManipulation.available=a.zAvailable,this._autoHideXYAxis(),this.forEachManipulator((i=>{this._handles.add(i.events.on("grab-changed",(()=>this._updateManipulatorInteractivity())))}))}destroy(){this._handles.destroy(),this.xyManipulation.destroy(),this.xyAxisManipulation.destroy(),this.zManipulation.destroy()}createGraphicDragPipeline(i,t,n){return a([this.xyManipulation.createGraphicDragPipeline(((a,t,n,e,s)=>i(M.XY,a,t,n,e,s)),t,n),this.xyAxisManipulation.createGraphicDragPipeline(((a,t,n,e,s)=>i(M.XY_AXIS,a,t,n,e,s)),t,n),this.zManipulation.createGraphicDragPipeline(((a,t,n,e,s)=>i(M.Z,a,t,n,e,s)),t,n)])}createDragPipeline(i,t,n,e){return a([this.xyManipulation.createDragPipeline(((a,t,n,e,s)=>i(M.XY,a,t,n,e,s)),t,n,e),this.xyAxisManipulation.createDragPipeline(((a,t,n,e,s)=>i(M.XY_AXIS,a,t,n,e,s)),t,n,e),this.zManipulation.createDragPipeline(((a,t,n,e,s)=>i(M.Z,a,t,n,e,s)),n)])}set snapToScene(i){this.xyManipulation.snapToScene=i}set angle(i){this.xyAxisManipulation.angle=i}set interactive(i){this._interactive!==i&&(this._interactive=i,this._updateManipulatorInteractivity())}set radius(i){this.xyAxisManipulation.radius=i,this.xyManipulation.radius=i,this.zManipulation.radius=i}set displayScale(i){this.xyManipulation.displayScale=i,this.xyAxisManipulation.displayScale=i}forEachManipulator(i){this.xyManipulation.forEachManipulator((a=>i(a,e.TRANSLATE_XY))),this.xyAxisManipulation.forEachManipulator((a=>i(a,e.TRANSLATE_XY))),this.zManipulation.forEachManipulator((a=>i(a,e.TRANSLATE_Z)))}get _xyAxisVisible(){const i=this.xyManipulation.someManipulator((i=>i.focused))||this.xyAxisManipulation.someManipulator((i=>i.focused));return this._view.inputManager&&"touch"===this._view.inputManager.latestPointerType||i}_autoHideXYAxis(){const i=this.xyAxisManipulation,a=this.xyManipulation;if(has("esri-mobile"))return;const t=[];a.forEachManipulator((i=>t.push(i))),i.forEachManipulator((i=>t.push(i)));const e=()=>{const a=[];this._xyAxisVisible||i.forEachManipulator((i=>a.push(i.disableDisplay()))),this._handles.remove(c),this._handles.add(a,c)};for(const n of t)this._handles.add(n.events.on("focus-changed",e));this._view.inputManager&&this._handles.add(n((()=>this._view.inputManager?.latestPointerType),e)),e()}_updateManipulatorInteractivity(){const i=this.grabbing;this.forEachManipulator((a=>{a.interactive=!i&&this._interactive||a.grabbing}))}static radiusForSymbol(i){const a=t(i)&&"point-3d"===i.type&&i.symbolLayers;return!!a&&a.length>0&&a.some((i=>"icon"===i.type))?s:o}}const c="disable-xy-axis-display";var M;!function(i){i[i.XY=0]="XY",i[i.XY_AXIS=1]="XY_AXIS",i[i.Z=2]="Z"}(M||(M={}));export{M as ManipulationType,u as MoveManipulation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../../../../core/maybe.js";import{dragGraphic as e,resetGraphic as n}from"../../../../interactive/dragEventPipeline.js";function r(t,r,a,
|
|
5
|
+
import{isNone as t}from"../../../../../core/maybe.js";import{dragGraphic as e,resetGraphic as n}from"../../../../interactive/dragEventPipeline.js";function r(t,r,a,i){const c=t.graphic,s=(t,e)=>r({action:t,graphic:c,dxScreen:e.screenDeltaX,dyScreen:e.screenDeltaY});return a(((t,r,a)=>{const o=r.next((t=>("start"===t.action&&s("start",t),t))).next(e(c,i)).next((t=>{switch(t.action){case"start":case"update":(t.translationX||t.translationY||t.translationZ)&&s("update",t);break;case"end":s("end",t)}return t}));return a.next(n(c)).next((()=>{s("end",{screenDeltaX:0,screenDeltaY:0})})),o}))}function a(e){if(t(e)||"polyline"!==e.type&&"polygon"!==e.type)return 0;const n=("polyline"===e.type?e.paths:e.rings)[0];if(!n||n.length<2)return 0;const r=n[0],a=n[1];return Math.atan2(a[1]-r[1],a[0]-r[0])}function i(e){if(t(e)||t(e.axis))return 1;const{mapStart:n,mapEnd:r,axis:a}=e,i=[r.x-n.x,r.y-n.y];return i[0]*a[0]+i[1]*a[1]>0?1:-1}export{i as axisConstrainedDragSign,r as createGraphicMoveDragPipeline,a as shapeOrientation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Collection.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as o}from"../../../../../core/HandleOwner.js";import{makeHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as a,isNone as s,unwrap as r,isSome as p,applySome as l}from"../../../../../core/maybe.js";import{watch as h,syncAndInitial as c}from"../../../../../core/reactiveUtils.js";import{property as m}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{makeDehydratedPoint as d}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as g,getConvertedElevation as v}from"../../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as f}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as y}from"../../SnappingVisualizer3D.js";import{SupportedGraphicResult as M}from"../isSupportedGraphicUtils.js";import{ManipulatorType as _}from"../ManipulatorType.js";import{canMoveZ as w}from"../manipulatorUtils.js";import{createVisualElements as j}from"../visualElementUtils.js";import{DISC_RADIUS as b}from"../manipulations/config.js";import{ManipulationType as S,MoveManipulation as x}from"../manipulations/MoveManipulation.js";import{shapeOrientation as O}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as E}from"../manipulations/MoveXYGraphicManipulation.js";import{isSupportedGraphic as T}from"./isSupportedGraphic.js";import{OutlineVisualElement as A}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as P}from"../../../layers/graphics/GraphicState.js";import{dragGraphicMany as D,resetGraphicMany as X}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Y}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as G}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import U from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as R}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as z}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as k}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as I,TranslateZTooltipInfo as H}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as Z}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as C}from"../../../../support/euclideanLengthMeasurementUtils.js";class V{constructor(t){this.allGraphics=t,this.type="graphic-move-start"}}class L{constructor(t,i,e){this.dx=t,this.dy=i,this.allGraphics=e,this.type="graphic-move"}}class N{constructor(t){this.allGraphics=t,this.type="graphic-move-stop"}}let F=class extends(o(e.EventedMixin(Y))){constructor(t){super(t),this.graphics=new i,this.enableZ=!0,this.tooltipOptions=new U,this.type="move-3d",this._snappingPipeline=new z,this._tooltip=null}initialize(){const{graphics:t,view:i}=this;this.addHandles([t.on("change",(()=>this._refreshManipulators())),h((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new k({view:i}):a(this._tooltip)}),c)]),this._refreshManipulators(),this.finishToolCreation()}destroy(){this._tooltip=a(this._tooltip),this.graphics.removeAll(),this._set("view",null)}get updating(){return this.updatingHandles.updating}reset(){}_refreshManipulators(){this.handles.removeAll(),this._moveManipulation&&this._moveManipulation.destroy(),this.manipulators.removeAll();const t=this.graphics.toArray().filter((t=>T(t)===M.SUPPORTED)).map((t=>new B(t)));t.length&&(this._createManipulators(t),this._createVisualElements(t),this.handles.add(t.map((t=>this.view.trackGraphicState(t.state)))),this._updateMoveManipulation(t))}_createManipulators(t){for(const i of t){const e=i.state;i.manipulationXY=new E({tool:this,view:this.view,graphicState:e}),i.manipulationXY.forEachManipulator((t=>this.handles.add([t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:e.graphic}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;s(e)||("focus"===t?e.info=new I({tooltipOptions:i}):e.clear())}))]))),this.handles.add(i.manipulationXY.createDragPipeline(((i,e,o,n)=>this._buildDragEventPipeline(t,S.XY,i,e,o,n))))}this._createMoveManipulation(t)}_createMoveManipulation(t){const i=new x({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?x.radiusForSymbol(t[0].graphic.symbol):b});this._moveManipulation=i,i.elevationInfo={mode:"absolute-height",offset:0},i.forEachManipulator(((t,e)=>{this.handles.add(t.events.on("immediate-click",(e=>{i.zManipulation.hasManipulator(t)||1!==this.graphics.length||this.emit("immediate-click",{...e,graphic:this.graphics.getItemAt(0)}),e.stopPropagation()}))),e===_.TRANSLATE_XY&&this.handles.add(t.events.on("focus-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;s(e)||("focus"===t?e.info=new I({tooltipOptions:i}):e.clear())}))),e===_.TRANSLATE_Z&&this.handles.add(t.events.on("focus-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;s(e)||("focus"===t?e.info=new H({tooltipOptions:i}):e.clear())})))}));const e=()=>this._updateMoveManipulation(t);for(const n of t)this.handles.add([n.state.on("changed",e),h((()=>n.state.displaying),e)]);const o=t[t.length-1];this.handles.add(o.state.on("changed",(()=>this._updateMoveManipulationAngle(o)))),this.handles.add(i.createDragPipeline(((i,e,o,n,a)=>this._buildDragEventPipeline(t,i,e,o,n,a)),g(o.graphic),r(o.graphic.geometry).spatialReference,o.graphic)),this._updateMoveManipulationAngle(o)}_createVisualElements(t){for(const i of t){const e=i.graphic,o=j({view:this.view,graphic:e,forEachManipulator:t=>{i.manipulationXY.forEachManipulator(t),this._moveManipulation.forEachManipulator(t)},onManipulatorsChanged:()=>n()});s(o)||(i.geometryRepresentation=o.visualElement,i.geometryRepresentation instanceof A&&this.handles.add([i.geometryRepresentation.events.on("attachment-origin-changed",(()=>{i.state.isDraped||this._updateMoveManipulation(t)})),h((()=>i.state.isDraped),(()=>this._updateMoveManipulation(t)))]),this.handles.add(o))}}_updateMoveManipulationAngle(t){this._moveManipulation.angleDeferred=()=>O(t.graphic.geometry)}_updateMoveManipulation(t){const i=d(0,0,0,this.view.spatialReference);let e=0,o=!1;const n=this._moveManipulation;for(const a of t){if(!a.state.displaying)continue;const t=a.state.graphic;this.enableZ&&w(t)&&(o=!0);const n=a.geometryRepresentation instanceof A&&!a.state.isDraped?a.geometryRepresentation.attachmentOrigin:f(this.view,t);p(n)&&(i.x+=n.x,i.y+=n.y,i.z+=n.z,e++)}e>0?(i.x/=e,i.y/=e,i.z/=e,n.location=i,n.xyManipulation.available=!0,n.xyAxisManipulation.available=!0,n.zManipulation.available=o):n.available=!1}_buildDragEventPipeline(t,i,e,o,n,a){const s=[],r=[];let p=null,l=null;const h=()=>{for(const t of s)t.dragging=!1;s.length=0,r.length=0,p=null,l=null,this._moveManipulation.interactive=!0};if(1===t.length&&i===S.XY){const i=t[0].graphic;o=this._buildSnappingPipelineSteps(i,g(i),o,n,a)}const c=o.next((i=>{if("start"===i.action){s.length=0,r.length=0;for(const i of t)i.dragging||!i.manipulationXY.hasManipulator(e)&&i.manipulationXY.grabbing||(s.push(i),r.push(i.graphic),i.dragging=!0);if(0!==r.length&&(this._moveManipulation.interactive=!1,p=D(r,this.view.state.viewingMode),l=X(r),this.emit("graphic-move-start",new V(r)),this.destroyed))return null}return 0!==r.length?i:null})).next((t=>p(t))).next((e=>this._updateMoveTooltip(e,i,t))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const i=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),o=e.x-i.x,n=e.y-i.y;if(this.emit("graphic-move",new L(o,n,r)),this.destroyed)return null}break;case"end":if(this.emit("graphic-move-stop",new N(r)),this.destroyed)return null;h()}}));return n.next((t=>l(t))).next((()=>{if(this.emit("graphic-move-stop",new N(r)),this.destroyed)return null;h()})),c}_updateMoveTooltip(t,i,e){const{tooltipOptions:o,_tooltip:n}=this;if(s(n))return t;if(n.clear(),i===S.XY||i===S.XY_AXIS)if("end"===t.action)n.info=new I({tooltipOptions:o});else{const i=0===e.length?"absolute-height":e[0].state.isDraped?"on-the-ground":"absolute-height",a=Z(t.mapStart,t.mapEnd,i);p(a)&&(n.info=new I({tooltipOptions:o,distance:a}))}return i===S.Z&&("end"===t.action?n.info=new H({tooltipOptions:o}):l(C(t.mapStart,t.mapEnd),(t=>{n.info=new H({tooltipOptions:o,distance:t})}))),t}_buildSnappingPipelineSteps(t,i,e,o,n){const a=t.geometry;if(s(a)||"point"!==a.type&&"mesh"!==a.type)return e;const r=("point"===a.type?a:a.anchor).clone(),p=new R({elevationInfo:i,pointer:n,editGeometryOperations:G.fromGeometry(r,this.view.state.viewingMode),visualizer:new y,excludeFeature:t}),l=this.snappingManager;return e.next((i=>{r.z=v(this.view,r,g(t),{mode:"absolute-height",offset:0});return{...i,snapOrigin:p.coordinateHelper.pointToVector(r)}})).next(this._snappingPipeline.createSnapDragEventPipelineStep({snappingContext:p,snappingManager:l,cancel:o,updatingHandles:this.updatingHandles}),this._snappingPipeline.next)}get test(){return{tooltip:this._tooltip}}};t([m({constructOnly:!0,nonNullable:!0})],F.prototype,"view",void 0),t([m()],F.prototype,"graphics",void 0),t([m({constructOnly:!0,nonNullable:!0})],F.prototype,"enableZ",void 0),t([m({constructOnly:!0,type:U})],F.prototype,"tooltipOptions",void 0),t([m({constructOnly:!0})],F.prototype,"snappingManager",void 0),t([m()],F.prototype,"type",void 0),t([m()],F.prototype,"updating",null),F=t([u("esri.views.3d.interactive.editingTools.graphicMove3D.GraphicMoveTool")],F);class B{constructor(t){this.state=null,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1,this.state=new P({graphic:t})}get graphic(){return this.state.graphic}}export{L as GraphicMoveEvent,V as GraphicMoveStartEvent,N as GraphicMoveStopEvent,F as GraphicMoveTool};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Collection.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as o}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{destroyMaybe as n,isNone as s,unwrap as r,isSome as p}from"../../../../../core/maybe.js";import{scale as l,zeroMeters as h}from"../../../../../core/quantityUtils.js";import{watch as c,syncAndInitial as u}from"../../../../../core/reactiveUtils.js";import{property as m}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as d}from"../../../../../core/accessorSupport/decorators/subclass.js";import{makeDehydratedPoint as g}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as v,getConvertedElevation as f}from"../../../../../support/elevationInfoUtils.js";import{getGraphicAttachmentOrigin as M}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as y}from"../../SnappingVisualizer3D.js";import{SupportedGraphicResult as _}from"../isSupportedGraphicUtils.js";import{canMoveZ as w}from"../manipulatorUtils.js";import{createVisualElements as j}from"../visualElementUtils.js";import{DISC_RADIUS as b}from"../manipulations/config.js";import{ManipulationType as x,MoveManipulation as S}from"../manipulations/MoveManipulation.js";import{shapeOrientation as E,axisConstrainedDragSign as O}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as T}from"../manipulations/MoveXYGraphicManipulation.js";import{isSupportedGraphic as D}from"./isSupportedGraphic.js";import{OutlineVisualElement as P}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as X}from"../../../layers/graphics/GraphicState.js";import{dragGraphicMany as A,resetGraphicMany as Y}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as G}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as U}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import k from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as z}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as R}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as I}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as H,TranslateGraphicZTooltipInfo as Z,TranslateGraphicXYTooltipInfo as C}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as V}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as F}from"../../../../support/euclideanLengthMeasurementUtils.js";class L{constructor(t){this.allGraphics=t,this.type="graphic-move-start"}}class N{constructor(t,i,e){this.dx=t,this.dy=i,this.allGraphics=e,this.type="graphic-move"}}class q{constructor(t){this.allGraphics=t,this.type="graphic-move-stop"}}let B=class extends(o(e.EventedMixin(G))){constructor(t){super(t),this.graphics=new i,this.enableZ=!0,this.tooltipOptions=new k,this.type="move-3d",this._snappingPipeline=new R,this._tooltip=null}initialize(){const{graphics:t,view:i}=this;this.addHandles([t.on("change",(()=>this._refreshManipulators())),c((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new I({view:i}):n(this._tooltip)}),u)]),this._refreshManipulators(),this.finishToolCreation()}destroy(){this._tooltip=n(this._tooltip),this.graphics.removeAll(),this._set("view",null)}get updating(){return this.updatingHandles.updating}reset(){}_refreshManipulators(){this.handles.removeAll(),this._moveManipulation&&this._moveManipulation.destroy(),this.manipulators.removeAll();const t=this.graphics.toArray().filter((t=>D(t)===_.SUPPORTED)).map((t=>new J(t)));t.length&&(this._createManipulators(t),this._createVisualElements(t),this.handles.add(t.map((t=>this.view.trackGraphicState(t.state)))),this._updateMoveManipulation(t))}_createManipulators(t){for(const i of t){const e=i.state;i.manipulationXY=new T({tool:this,view:this.view,graphicState:e}),i.manipulationXY.forEachManipulator((t=>this.handles.add([t.events.on("immediate-click",(t=>{this.emit("immediate-click",{...t,graphic:e.graphic}),t.stopPropagation()})),t.events.on("grab-changed",(({action:t})=>{const{tooltipOptions:i,_tooltip:e}=this;s(e)||("focus"===t?e.info=new H({tooltipOptions:i}):e.clear())}))]))),this.handles.add(i.manipulationXY.createDragPipeline(((i,e,o,a)=>this._buildDragEventPipeline(t,x.XY,i,e,o,a))))}this._createMoveManipulation(t)}_createMoveManipulation(t){const i=new S({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:1===t.length?S.radiusForSymbol(t[0].graphic.symbol):b});this._moveManipulation=i,i.elevationInfo={mode:"absolute-height",offset:0},i.forEachManipulator((t=>{this.handles.add(t.events.on("immediate-click",(e=>{i.zManipulation.hasManipulator(t)||1!==this.graphics.length||this.emit("immediate-click",{...e,graphic:this.graphics.getItemAt(0)}),e.stopPropagation()})))}));const e=i=>e=>{this.handles.add(e.events.on("focus-changed",(({action:e})=>{const o=this._tooltip;s(o)||("focus"===e?this._updateMoveTooltip(t,i):o.clear())})))};this._moveManipulation.xyManipulation.forEachManipulator(e(x.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(x.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(x.Z));const o=()=>this._updateMoveManipulation(t);for(const n of t)this.handles.add([n.state.on("changed",o),c((()=>n.state.displaying),o)]);const a=t[t.length-1];this.handles.add(a.state.on("changed",(()=>this._updateMoveManipulationAngle(a)))),this.handles.add(i.createDragPipeline(((i,e,o,a,n)=>this._buildDragEventPipeline(t,i,e,o,a,n)),v(a.graphic),r(a.graphic.geometry).spatialReference,a.graphic)),this._updateMoveManipulationAngle(a)}_createVisualElements(t){for(const i of t){const e=i.graphic,o=j({view:this.view,graphic:e,forEachManipulator:t=>{i.manipulationXY.forEachManipulator(t),this._moveManipulation.forEachManipulator(t)},onManipulatorsChanged:()=>a()});s(o)||(i.geometryRepresentation=o.visualElement,i.geometryRepresentation instanceof P&&this.handles.add([i.geometryRepresentation.events.on("attachment-origin-changed",(()=>{i.state.isDraped||this._updateMoveManipulation(t)})),c((()=>i.state.isDraped),(()=>this._updateMoveManipulation(t)))]),this.handles.add(o))}}_updateMoveManipulationAngle(t){this._moveManipulation.angle=E(t.graphic.geometry)}_updateMoveManipulation(t){const i=g(0,0,0,this.view.spatialReference);let e=0,o=!1;const a=this._moveManipulation;for(const n of t){if(!n.state.displaying)continue;const t=n.state.graphic;this.enableZ&&w(t)&&(o=!0);const a=n.geometryRepresentation instanceof P&&!n.state.isDraped?n.geometryRepresentation.attachmentOrigin:M(this.view,t);p(a)&&(i.x+=a.x,i.y+=a.y,i.z+=a.z,e++)}e>0?(i.x/=e,i.y/=e,i.z/=e,a.location=i,a.xyManipulation.available=!0,a.xyAxisManipulation.available=!0,a.zManipulation.available=o):a.available=!1}_buildDragEventPipeline(t,i,e,o,a,n){const s=[],r=[];let p=null,l=null;const h=()=>{for(const t of s)t.dragging=!1;s.length=0,r.length=0,p=null,l=null,this._moveManipulation.interactive=!0};if(1===t.length&&i===x.XY){const i=t[0].graphic;o=this._buildSnappingPipelineSteps(i,v(i),o,a,n)}const c=o.next((i=>{if("start"===i.action){s.length=0,r.length=0;for(const i of t)i.dragging||!i.manipulationXY.hasManipulator(e)&&i.manipulationXY.grabbing||(s.push(i),r.push(i.graphic),i.dragging=!0);if(0!==r.length&&(this._moveManipulation.interactive=!1,p=A(r,this.view.state.viewingMode),l=Y(r),this.emit("graphic-move-start",new L(r)),this.destroyed))return null}return 0!==r.length?i:null})).next((t=>p(t))).next((e=>(this._updateMoveTooltip(t,i,e),e))).next((t=>{switch(t.action){case"start":case"update":if(t.translationX||t.translationY||t.translationZ){const i=this.view.toScreen(t.mapStart),e=this.view.toScreen(t.mapEnd),o=e.x-i.x,a=e.y-i.y;if(this.emit("graphic-move",new N(o,a,r)),this.destroyed)return null}break;case"end":if(this.emit("graphic-move-stop",new q(r)),this.destroyed)return null;h()}}));return a.next((t=>l(t))).next((()=>{if(this.emit("graphic-move-stop",new q(r)),this.destroyed)return null;h()})),c}_updateMoveTooltip(t,i,e){const{tooltipOptions:o,_tooltip:a}=this;if(s(a))return;a.clear();const n=0===t.length?"absolute-height":t[0].state.isDraped?"on-the-ground":"absolute-height";switch(i){case x.XY:a.info=new H({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>V(t,i,n)));break;case x.XY_AXIS:a.info=new C({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,((t,i)=>{const o=V(t,i,n);return l(o,O(e))}));break;case x.Z:a.info=new Z({tooltipOptions:o}),this._updateMoveTooltipDistance(a.info,e,F)}}_updateMoveTooltipDistance(t,i,e){if(p(i)&&"end"!==i.action){const{mapStart:o,mapEnd:a}=i,n=e(o,a);t.distance=p(n)?n:h}}_buildSnappingPipelineSteps(t,i,e,o,a){const n=t.geometry;if(s(n)||"point"!==n.type&&"mesh"!==n.type)return e;const r=("point"===n.type?n:n.anchor).clone(),p=new z({elevationInfo:i,pointer:a,editGeometryOperations:U.fromGeometry(r,this.view.state.viewingMode),visualizer:new y,excludeFeature:t}),l=this.snappingManager;return e.next((i=>{r.z=f(this.view,r,v(t),{mode:"absolute-height",offset:0});return{...i,snapOrigin:p.coordinateHelper.pointToVector(r)}})).next(this._snappingPipeline.createSnapDragEventPipelineStep({snappingContext:p,snappingManager:l,cancel:o,updatingHandles:this.updatingHandles}),this._snappingPipeline.next)}get test(){return{tooltip:this._tooltip}}};t([m({constructOnly:!0,nonNullable:!0})],B.prototype,"view",void 0),t([m()],B.prototype,"graphics",void 0),t([m({constructOnly:!0,nonNullable:!0})],B.prototype,"enableZ",void 0),t([m({constructOnly:!0,type:k})],B.prototype,"tooltipOptions",void 0),t([m({constructOnly:!0})],B.prototype,"snappingManager",void 0),t([m()],B.prototype,"type",void 0),t([m()],B.prototype,"updating",null),B=t([d("esri.views.3d.interactive.editingTools.graphicMove3D.GraphicMoveTool")],B);class J{constructor(t){this.state=null,this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1,this.state=new X({graphic:t})}get graphic(){return this.state.graphic}}export{N as GraphicMoveEvent,L as GraphicMoveStartEvent,q as GraphicMoveStopEvent,B as GraphicMoveTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import t from"../../../../../core/Evented.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import a from"../../../../../core/Handles.js";import{handlesGroup as o,destroyHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as r,isSome as s,isNone as l,unwrap as p,removeMaybe as h}from"../../../../../core/maybe.js";import{zeroMeters as d,createLength as u}from"../../../../../core/quantityUtils.js";import{watch as c,when as m,initial as g}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as _}from"../../../../../core/unitUtils.js";import{property as f}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{I as M}from"../../../../../chunks/mat4f64.js";import{l as y,b as O,h as x,s as b,a as E,g as G}from"../../../../../chunks/vec3.js";import{f as S,c as V}from"../../../../../chunks/vec3f64.js";import I from"../../../../../geometry/Polyline.js";import{projectPoint as H}from"../../../../../geometry/support/plane.js";import{sv3d as w}from"../../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as A}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as D}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as T}from"../../../../../symbols/support/utils.js";import{Manipulator3D as L}from"../../Manipulator3D.js";import{createManipulatorMaterial as P,createManipulatorOutlineMaterial as j,placeAtGraphic as U}from"../../manipulatorUtils.js";import{SegmentLabels3D as N}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as k}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as R,convertToMapCoordinates as C,screenToMapXYAtLocation as F,screenToMapXYForGraphicAtLocation as z}from"../dragEventPipeline3D.js";import{ManipulatorType as Z}from"../ManipulatorType.js";import{canMoveZ as X}from"../manipulatorUtils.js";import{settings as Y,colors as q}from"../settings.js";import{createVisualElements as W}from"../visualElementUtils.js";import{DISC_RADIUS_SMALL as K}from"../manipulations/config.js";import{ManipulationType as B,MoveManipulation as J}from"../manipulations/MoveManipulation.js";import{shapeOrientation as Q}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as $}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as ee,createEdgeOffsetOperation as te,edgeOffsetRotationMatrix as ie,screenEdgeLengthSquared as ae}from"./edgeOffsetUtils.js";import{OutlineVisualElement as oe}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as ne}from"../../../layers/graphics/GraphicState.js";import re from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as se}from"../../../../input/IViewEvents.js";import{addMapDelta as le,createManipulatorDragEventPipeline as pe,dragAtLocation as he,addScreenDelta as de}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as ue,ManipulatorStateCustomFlags as ce}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as me}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as ge}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as _e}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as fe}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{ReshapeEdgeOffsetTooltipInfo as ve}from"../../../../interactive/tooltip/ReshapeTooltipInfos.js";import{Tooltip as Me}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateZTooltipInfo as ye,TranslateGraphicTooltipInfo as Oe,TranslateVertexTooltipInfo as xe}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoAreaByDrapedStatus as be}from"../../../../support/automaticAreaMeasurementUtils.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as Ee,autoLengthByElevationMode as Ge}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as Se,elevationOfPoint as Ve}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as Ie}from"../../../../support/geodesicLengthMeasurementUtils.js";let He=class extends(t.EventedMixin(i)){constructor(e){super(e),this._vertexManipulatorMaterial=P(Y.colorToVec4(Y.reshapeManipulators.vertex.color),Y.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorOutlineMaterial=j(Y.colorToVec4(Y.reshapeManipulators.vertex.outlineColor),Y.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=j(Y.colorToVec4(Y.reshapeManipulators.vertex.hoverOutlineColor),Y.reshapeManipulators.vertex.renderOccluded),this._edgeManipulatorMaterial=P(Y.colorToVec4(Y.reshapeManipulators.edge.color),Y.reshapeManipulators.edge.renderOccluded),this._edgeManipulatorOutlineMaterial=j(Y.colorToVec4(Y.reshapeManipulators.edge.outlineColor),Y.reshapeManipulators.edge.renderOccluded),this._edgeOffsetManipulatorMaterial=P(Y.colorToVec4(Y.reshapeManipulators.edgeOffset.color),Y.reshapeManipulators.edgeOffset.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=P(Y.colorToVec4(Y.reshapeManipulators.edgeOffset.hoverColor),Y.reshapeManipulators.edgeOffset.renderOccluded,!1),this._selectedManipulatorMaterial=P(Y.colorToVec4(Y.reshapeManipulators.selected.color),Y.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorOutlineMaterial=j(Y.colorToVec4(Y.reshapeManipulators.selected.outlineColor),Y.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=j(Y.colorToVec4(Y.reshapeManipulators.selected.hoverOutlineColor),Y.reshapeManipulators.selected.renderOccluded),this._selectedIndex=0,this._vertexManipulatorGeometry=null,this._vertexManipulatorOutlineGeometry=null,this._edgeManipulatorGeometry=null,this._edgeManipulatorOutlineGeometry=null,this._edgeOffsetManipulatorGeometryInside=null,this._edgeOffsetManipulatorGeometryOutside=null,this._manipulatorHandles=new a,this._manipulatorInfos=[],this._editGeometryOperations=null,this._graphicMoveManipulation=null,this._moveManipulation=null,this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Pe.NONE,this._outlineVisualElement=null,this._segmentLabels=null,this.outputGeometry=null,this._snappingPipeline=new fe,this._snappingPipelineHandle=new fe,this._vertexLaserLineVisualElement=null}initialize(){const{graphic:e,view:t}=this,i=this._graphicState=new ne({graphic:e});this._tooltip=new Me({view:t}),this.addHandles([c((()=>i.displaying),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e})),c((()=>({labels:this._segmentLabels,enabled:this._labelOptions.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:e,enabled:t,edgeOffsetEnabled:i})=>{s(e)&&(e.visible=t,e.edgeDistance=i?"far":"default")}),g),m((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),g),this.view.trackGraphicState(i)])}destroy(){this._segmentLabels=r(this._segmentLabels),this._tooltip=r(this._tooltip),this._editGeometryOperations=r(this._editGeometryOperations),this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles=r(this._manipulatorHandles),this.manipulators.removeAll(),this._manipulatorInfos=[],this._resetGrabbingDragging()}get inputGeometry(){return s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null}set inputGeometry(e){this._recreateEditGeometryAndManipulators(e)}get updating(){return this.updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get graphic(){return this.tool.graphic}get enableZShape(){return this.tool.enableZShape}get enableZVertex(){return this.tool.enableZVertex}get enableMoveGraphic(){return this.tool.enableMoveGraphic}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _labelOptions(){return this.tool.labelOptions}get _tooltipOptions(){return this.tool.tooltipOptions}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));this._removeVertices(e)}manipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles.removeAll(),this.manipulators.removeAll(),this._manipulatorInfos=[]}_resetGrabbingDragging(){this._numGrabbing=0,this._numDragging=0}_createManipulators(){if(l(this._editGeometryOperations))return;const e=D(this.graphic);for(const t of this._editGeometryOperations.data.components){for(const i of t.vertices)this._createVertexOrEdgeManipulator(i,e);for(const i of t.edges)this._createVertexOrEdgeManipulator(i,e)}this._createGraphicMoveManipulators(e)}get canRedo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canRedo}get canUndo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canUndo}redo(){if(l(this._editGeometryOperations))return null;const e=this._editGeometryOperations.redo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}undo(){if(l(this._editGeometryOperations))return null;this.emit("undo");const e=this._editGeometryOperations.undo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}_recreateManipulators(){this._removeManipulators(),this._resetGrabbingDragging(),this._tooltip.clear(),this._createManipulators()}_recreateEditGeometryAndManipulators(e=this.inputGeometry){this._removeManipulators(),this._resetGrabbingDragging(),this._tooltip.clear(),l(e)||(r(this._editGeometryOperations),this._editGeometryOperations=me.fromGeometry(e,this.view.state.viewingMode),this._createManipulators(),r(this._segmentLabels),this._segmentLabels=new N({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:D(this.graphic),labelOptions:this._labelOptions,graphic:this.graphic,graphicState:this._graphicState},visible:this._labelOptions.enabled}))}_perGraphicManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],o=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),n=e===je.SELECTED_OR_ALL&&o;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.grabbing||n&&!r.manipulator.selected||a.push(r),i++);if(0===a.length)return t;this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(Pe.MOVING),this.destroyed)return t;this.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(Pe.RESHAPING),this.destroyed)return t;this.emit("reshape",{type:"reshape",mover:this.graphic})}return t}_isMultiVertexSelection(){let e=0;for(const t of this._manipulatorInfos)"vertex"===t.type&&t.manipulator.selected&&e++;return e>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Pe.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const o=[];for(const n of this._manipulatorInfos)"vertex"===n.type&&(n.manipulator.selected&&!n.manipulator.grabbing||n===e.info)&&o.push(n);this._moveVertices(o,e,ge.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case Pe.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Pe.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case Pe.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case Pe.MOVING:switch(this._reshapeEventState){case Pe.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case Pe.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic}),this.destroyed||this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic})}break;case Pe.RESHAPING:switch(this._reshapeEventState){case Pe.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case Pe.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic}),this.destroyed||this.emit("reshape",{type:"reshape-start",mover:this.graphic})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createGraphicMoveManipulators(e){const{graphic:t,handles:i,tool:a,view:o}=this,n=this._graphicState;if(this._graphicMoveManipulation=new $({tool:a,view:o,graphicState:n}),this.enableMoveGraphic){let e=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=p(this._editGeometryOperations).createUndoGroup()),t))).next((e=>this._perGraphicManipulatorDragAction(je.ALL,e))).next((e=>(this._updateTranslateGraphicTooltip(B.XY,e),e))).next((t=>{"end"===t.action&&(this._tooltip.clear(),e=h(e))})),a.next(this._cancelDragOperation((()=>e=h(e))))})))}else this._graphicMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._graphicMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()}))]))),this._moveManipulation=new J({tool:a,view:o,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&X(t),snapToScene:!1,radius:J.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator(((e,a)=>{i.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(i=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.emit("immediate-click",{...i,graphic:t}),i.stopPropagation()}))]),i.add(e.events.on("focus-changed",(({action:e})=>{"focus"===e&&this._tooltipOptions.enabled?this._updateTranslateTooltip(a===Z.TRANSLATE_Z?B.Z:B.XY):this._tooltip.clear()})))})),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const r=p(t.geometry).spatialReference;i.add([this._moveManipulation.createDragPipeline(((i,o,n,r,s)=>{const l=n.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===Z.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:{...e,info:null}})).next(this._snappingPipelineHandle.createSnapDragEventPipelineStep({predicate:e=>!!e.info,cancel:r,snappingManager:a.snappingManager,snappingContext:new _e({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:e,pointer:s,excludeFeature:t,visualizer:new k}),updatingHandles:this.updatingHandles}),this._snappingPipelineHandle.next).next(le()).next((e=>this._perGraphicManipulatorDragAction(je.SELECTED_OR_ALL,e))).next((e=>(this._updateTranslateTooltip(i,e),e)));return r.next(this._cancelDragOperation()),l}),e,r,t),c((()=>n?.displaying),(()=>{this._updateMoveManipulationPosition()}),g),n.on("changed",(()=>this._updateMoveManipulationPosition())),c((()=>n?.isDraped),(e=>{const t="align-move-manipulation";e?i.add(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):i.remove(t)}),g)]),this._updateMoveManipulationPosition();const l=W({view:o,graphic:t,forEachManipulator:e=>{if(!this.destroyed){s(this._graphicMoveManipulation)&&this._graphicMoveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,Z.TRANSLATE_XY);this._moveManipulation.forEachManipulator(e)}},onManipulatorsChanged:e=>this.on("manipulators-changed",e)});s(l)&&(this._outlineVisualElement=l.visualElement instanceof oe?l.visualElement:null),s(this._outlineVisualElement)&&this._manipulatorHandles.add([this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{n.isDraped||this._updateMoveManipulationPosition()})),c((()=>n.isDraped),(()=>this._updateMoveManipulationPosition()))]),this._manipulatorHandles.add(l)}_createEdgeOffsetManipulator(e,t=D(this.graphic)){const i=Y.reshapeManipulators.edgeOffset,a=i.size/2,n=a+i.collisionPadding;if(l(this._edgeOffsetManipulatorGeometryInside)||l(this._edgeOffsetManipulatorGeometryOutside)){const e=a/n,t=e*Math.sqrt(3)/2;this._edgeOffsetManipulatorGeometryInside=re.createExtrudedTriangle(t,e/2,e/2,i.height,i.offset),this._edgeOffsetManipulatorGeometryOutside=re.createExtrudedTriangle(-t,e/2,e/2,i.height,-i.offset)}const r=[{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorMaterial,stateMask:ue.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:ue.Focused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorMaterial,stateMask:ue.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:ue.Focused}],p=new L({view:this.view,renderObjects:r,elevationInfo:"on-the-ground"!==t.mode||T(this.graphic.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:n,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionType:{type:"disc",direction:S(0,0,1)},collisionPriority:1}),h=new L({view:this.view,renderObjects:[],worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default"}),d={manipulator:p,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:t,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(d,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(d);const u=[];for(const o of[d.handle.leftVertex,d.handle.rightVertex]){const e=this._getManipulatorInfoFromHandle(o);s(e)&&u.push(e.manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d))))}d.locationUpdateHandle=o(u),this._manipulatorHandles.add(d.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(pe(p,this._createEdgeOffsetPipeline(d,t)),p),this._manipulatorHandles.add(pe(h,((e,i,a,o)=>{if("touch"===o){this._createEdgeOffsetPipeline(d,t)(e,i,a)}else if(this.enableMoveGraphic){const o=this.graphic,n=s(o.geometry)?o.geometry.spatialReference:null;i.next((e=>this._trackNumDragging(e))).next(he(this.view,e.elevationAlignedLocation)).next(F(this.view,e.elevationAlignedLocation,t,n,o)).next(de()).next(le()).next((e=>this._perGraphicManipulatorDragAction(je.ALL,e))).next((e=>(this._updateTranslateGraphicTooltip(B.XY,e),e))).next((e=>{"end"===e.action&&this._tooltip.clear()})),a.next(this._cancelDragOperation())}})),p);const c=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",c),h.events.on("immediate-click",c),p.events.on("focus-changed",(({action:e})=>{const t=this._tooltipOptions;"focus"===e&&t.enabled?this._tooltip.info=new ve({tooltipOptions:t}):this._tooltip.clear()}))],p),this._manipulatorInfos.push(d),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),d}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{e.visibilityHandle=h(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=s(n)&&s(r)&&ae(n.manipulator.renderLocation,r.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,e.visibilityHandle=o([i.disableDisplay(),{remove:()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}}]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),{remove:()=>{h(e.visibilityHandle),this.manipulators.remove(a)}}],i),n()}_updateEdgeOffsetManipulator(e){this._updateManipulatorPosition(e);const t=p(this._editGeometryOperations).data.coordinateHelper,i=ee(this.view,e.manipulator.elevationAlignedLocation,te(t,e.handle,p(e.manipulator.elevationInfo))),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(l(a)||l(o))return;const n=a.manipulator.renderLocation,r=o.manipulator.renderLocation,h=s(i)?ie(i,n,r):M;e.manipulator.modelTransform=h,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=h;const d=y(O(Te,n,r))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-d,0,0],[d,0,0]]]}}_createEdgeOffsetPipeline(e,t){return(i,a,o)=>{this._clearSelection();const{step:n,cleanup:r}=this._initializeEdgeOffset(e,t);a.next((e=>this._trackNumDragging(e))).next(he(this.view,i.elevationAlignedLocation)).next(n).next(R(this.view)).next(C(this.view,p(this._editGeometryOperations).data.spatialReference)).next(le()).next(this._applyComputeEdgeOffsetDistanceStep()).next(this._applyEdgeOffsetStep(e)).next(this._showEdgeOffsetTooltip()).next((e=>{"end"===e.action&&r()})),o.next((e=>(r(),e))).next((e=>(this._tooltip.clear(),e))).next(this._cancelDragOperation())}}_initializeEdgeOffset(e,t){const i=p(this._editGeometryOperations),a=te(i.data.coordinateHelper,e.handle,t),r=i.createUndoGroup(),d=ee(this.view,e.manipulator.elevationAlignedLocation,a);if(a.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);s(t)&&this._splitEdgeManipulator(t,1)}if(a.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);s(t)&&this._splitEdgeManipulator(t,0)}const u=()=>new I({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:p(this._editGeometryOperations).data.spatialReference}),m=new oe({view:this.view,isDraped:this._graphicState.isDraped,geometry:u(),elevationInfo:e.elevationInfo,width:Y.visualElements.lineGraphics.outline.width,color:Y.colorToVec4(q.main),attached:!0});let g;const _=()=>{this._cleanEdgeOffsetCollapsedEdges(e),g=h(g)},f=this.on("undo",_);return g=o([n(m),c((()=>this._graphicState.isDraped),(e=>m.isDraped=e)),this._graphicState.on("changed",(()=>m.geometry=u())),r,f]),{step:e=>l(a)||l(d)?(_(),null):{...e,operation:a,plane:d},cleanup:_}}_applyEdgeOffsetStep(e){return t=>{if(this.destroyed||l(t.operation))return t;this._updateEventState(Pe.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:o}=t;return(i||a||o)&&(this._offsetEdge(e,t),this.emit("reshape",{type:"reshape",mover:this.graphic})),t}}_applyComputeEdgeOffsetDistanceStep(){return e=>{const{operation:t,mapEnd:i}=e;if(l(t)||l(i))return e;const a=t.signedDistanceToPoint(i);return{...e,signedDistance:a}}}_showEdgeOffsetTooltip(){return e=>{const{mapEnd:t,signedDistance:i,operation:a}=e,o=this._tooltip,n=this._tooltipOptions;if(!n.enabled||l(i))return o.clear(),e;const r="end"===e.action?d:Ae(this._graphicState.isDraped,-i,t,a.plane,p(this._editGeometryOperations).data.coordinateHelper);return l(o.info)||"reshape-edge-offset"!==o.info.type?o.info=new ve({tooltipOptions:n,distance:r}):o.info.distance=r,e}}_cleanEdgeOffsetCollapsedEdges(e){const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,o=e.handle.rightVertex,n=p(this._editGeometryOperations).data.coordinateHelper,r=1e-6,l=[];if(t&&n.distance(t.pos,i.pos)<r){const e=this._getManipulatorInfoFromHandle(i);s(e)&&l.push(e)}if(n.distance(i.pos,o.pos)<r||a&&n.distance(a.pos,o.pos)<r){const e=this._getManipulatorInfoFromHandle(o);s(e)&&l.push(e)}l.length&&this._removeVertices(l)}_computeVertexManipulatorSizeAndOutline(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}_createVertexOrEdgeManipulator(e,t=D(this.graphic)){if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(l(this._vertexManipulatorGeometry)||l(this._vertexManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(Y.reshapeManipulators.vertex);this._vertexManipulatorGeometry=re.createSphereGeometry(e,16,16),this._vertexManipulatorOutlineGeometry=re.createSphereGeometry(t,16,16)}if(l(this._edgeManipulatorGeometry)||l(this._edgeManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(Y.reshapeManipulators.edge);this._edgeManipulatorGeometry=re.createSphereGeometry(e,16,16),this._edgeManipulatorOutlineGeometry=re.createSphereGeometry(t,16,16)}const i=s(this.graphic.geometry)&&"point"===this.graphic.geometry.type?[]:[{geometry:this._vertexManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Le.Vertex|ue.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorOutlineMaterial,stateMask:Le.Vertex|ue.Unfocused|ue.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Le.Vertex|ue.Focused|ue.Unselected},{geometry:this._vertexManipulatorGeometry,material:this._selectedManipulatorMaterial,stateMask:ue.Selected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorOutlineMaterial,stateMask:ue.Selected|ue.Unfocused},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorHoverOutlineMaterial,stateMask:ue.Selected|ue.Focused}];this.enableMidpoints&&i.push({geometry:this._edgeManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Le.Edge|ue.Focused|ue.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Le.Edge|ue.Focused|ue.Unselected},{geometry:this._edgeManipulatorGeometry,material:this._edgeManipulatorMaterial,stateMask:Le.Edge|ue.Unfocused|ue.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._edgeManipulatorOutlineMaterial,stateMask:Le.Edge|ue.Unfocused|ue.Unselected});const a=new L({view:this.view,renderObjects:i,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer.visible)});this._setTypeSpecificManipulatorSettings(a,e,t);const n="edge"===e.type?{manipulator:a,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:a,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(n),this.manipulators.add(a),this._updateManipulatorPosition(n),"edge"===n.type){const e=[];for(const t of[n.handle.leftVertex,n.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);s(i)&&e.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(n))))}n.locationUpdateHandle=o(e),this._manipulatorHandles.add(n.locationUpdateHandle,a)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(a,!0),a);const r=pe(a,((e,i,a,o)=>{let r=null;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&(r=p(this._editGeometryOperations).createUndoGroup()),"edge"===n.type){const t=this._splitEdgeManipulator(n);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:n,snapOrigin:n.handle.pos}})).next(he(this.view,e.elevationAlignedLocation)).next(z(this.view,this.graphic,e.elevationAlignedLocation,e.location.spatialReference,this.graphic)).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>!this._isMultiVertexSelection(),cancel:a,snappingManager:this.tool.snappingManager,snappingContext:new _e({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:t,pointer:o,excludeFeature:this.graphic,visualizer:new k}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next(le()).next((t=>{this._perVertexManipulatorDragAction(t),"end"===t.action&&(r=h(r)),this._updateTranslateVertexTooltip(e,B.XY,t)})),a.next(this._cancelDragOperation((()=>r=h(r))))}));return this._manipulatorHandles.add([r,a.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,n))),a.events.on("select-changed",(()=>{n.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()})),a.events.on("focus-changed",(({action:e})=>{"focus"===e&&"edge"!==n.type?this._updateTranslateVertexTooltip(a,B.XY):this._tooltip.clear()}))],a),this.emit("manipulators-changed"),n}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_cancelDragOperation(e){return()=>{switch(this._numDragging--,this.undo(),this.outputGeometry=s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null,s(this.tool.snappingManager)&&this.tool.snappingManager.doneSnapping(),this._tooltip.clear(),this._reshapeEventState){case Pe.NONE:break;case Pe.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case Pe.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(Pe.NONE)}}_setTypeSpecificManipulatorSettings(e,t,i){switch(t.type){case"vertex":e.state=Le.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.radius=Y.reshapeManipulators.vertex.size/2+Y.reshapeManipulators.vertex.collisionPadding,e.elevationInfo=i,e.interactive=s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type;break;case"edge":e.state=Le.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1,e.radius=Y.reshapeManipulators.edge.size/2+Y.reshapeManipulators.edge.collisionPadding,e.elevationInfo="on-the-ground"!==i.mode||T(this.graphic.symbol)?{mode:"absolute-height",offset:0}:i}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>this._onGrabStateChanged(e,t,i.action,i.pointerType)))}_onGrabStateChanged(e,t,i,a="mouse"){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Pe.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{e.manipulator.interactive=e.manipulator.grabbing||!this._numGrabbing&&s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type,"edgeManipulator"in e&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)})),p(this._graphicMoveManipulation).forEachManipulator((e=>{e.interactive=e.grabbing||!this._numGrabbing})))}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(e){l(e)||(this._manipulatorHandles.remove(e.manipulator),this._manipulatorInfos.splice(this._manipulatorInfos.indexOf(e),1),this.manipulators.remove(e.manipulator),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPosition(e){if(l(e))return;const t=p(this._editGeometryOperations);if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,De),e.manipulator.grabbing&&s(this._vertexLaserLineVisualElement)&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(l(i)||l(a))return;const o=i.manipulator,n=a.manipulator;if(s(e.manipulator.elevationInfo)&&"on-the-ground"===e.manipulator.elevationInfo.mode){const i=o.location,a=n.location,r=.5,s=i.x+r*(a.x-i.x),l=i.y+r*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;e.manipulator.location=A(s,l,p,t.data.spatialReference)}else x(Te,o.renderLocation,n.renderLocation,.5),e.manipulator.renderLocation=Te}}_splitEdgeManipulator(e,t=.5){const i=p(this._editGeometryOperations),a=p(i.splitEdge(e.handle,t).createdVertex);e.locationUpdateHandle.remove(),e.locationUpdateHandle=void 0;const o=D(this.graphic);let n;this.enableEdgeOffset?(this._removeManipulator(e),n=this._createVertexOrEdgeManipulator(a)):(n=e,n.handle=a,n.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,o)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(n),this.enableEdgeOffset||this._updateTranslateVertexTooltip(n.manipulator,B.XY),this._updateSelection(e.manipulator);const r=this._updateEventState(Pe.RESHAPING),s=i.data.coordinateHelper.vectorToArray(n.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:s,componentIndex:l,vertexIndex:p(a.index)}],added:s}),r&&this._updateEventState(Pe.NONE),n}_updateMoveManipulationPosition(){const e=b(Te,0,0,0);let t=0,i=!1,a=null,o=null;for(const n of this._manipulatorInfos)"vertex"===n.type&&(n.manipulator.selected?(t++,E(e,e,n.manipulator.renderLocation),l(a)||n.selectedIndex>a.selectedIndex?(o=a,a=n):(l(o)||n.selectedIndex>o.selectedIndex)&&(o=n)):i=!0);if(0!==t){const e=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&X(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t}else{const e=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&X(this.graphic)}if(0!==t){let e=0;if(s(a)){const t=a.handle.pos,i=s(o)?o.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,n=l(o)&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;i&&n?this._moveManipulation.xyAxisManipulation.available=!1:i?e=we(i,t):n&&(e=we(t,n))}this._moveManipulation.angle=e,this._moveManipulation.radius=K}else this._moveManipulation.angleDeferred=()=>Q(p(this.graphic.geometry)),this._moveManipulation.radius=J.radiusForSymbol(this.graphic.symbol);0!==t&&i?(G(e,e,1/t),De.spatialReference=p(this._editGeometryOperations).data.spatialReference,De.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,De),this._moveManipulation.elevationAlignedLocation=De):s(this._outlineVisualElement)&&!this._graphicState.isDraped&&s(this._outlineVisualElement.attachmentOrigin)?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:U(this.view,this._moveManipulation,this.graphic)}_removeVertices(e){const t=[],i=p(this._editGeometryOperations);for(const a of e)if("vertex"===a.type&&i.canRemoveVertex()){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const e=p(i.removeVertices([a.handle]).removedVertices[0].createdEdge);e&&this._createVertexOrEdgeManipulator(e)}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:p(e.index)}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(Pe.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(Pe.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(e,t,i=("start"===t.action?ge.NEW_STEP:ge.ACCUMULATE_STEPS)){const a=p(this._editGeometryOperations);a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const o of e)this._updateManipulatorPosition(o)}_offsetEdge(e,t){if(l(t.operation)||l(t.signedDistance))return;const i=p(this._editGeometryOperations),a=t.operation.clone();a.distance=t.signedDistance,i.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,e.button===se.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===se.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){const i=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));1===i.length?this._updateTranslateVertexTooltip(i[0].manipulator,e,t):this._updateTranslateGraphicTooltip(e,t)}_updateTranslateGraphicTooltip(e,t){const i=this._tooltipOptions;if(!i.enabled)return;const a=e===B.Z,o=a?new ye({tooltipOptions:i}):new Oe({tooltipOptions:i});if(s(t)&&"end"!==t.action){const{mapStart:e,mapEnd:i}=t,n=a?Se(e,i):Ee(e,i,this._graphicState.isDraped?"on-the-ground":"absolute-height");o.distance=s(n)?n:d}this._tooltip.info=o}_updateTranslateVertexTooltip(e,t,i){const a=this._tooltipOptions;if(!a.enabled)return;const o=t===B.Z,n=new xe({tooltipOptions:a});if(s(i)&&"end"!==i.action){const{mapStart:e,mapEnd:t}=i,a=o?Se(e,t):Ee(e,t,this._graphicState.isDraped?"on-the-ground":"absolute-height");n.distance=s(a)?a:d}const r=Ve(e.elevationAlignedLocation);s(r)&&(n.elevation={mode:"absolute-height",...r});const{geometry:l}=this.graphic;s(l)&&!o&&(n.area="polygon"===l.type?be(l,this._graphicState.isDraped):null,n.totalLength="polyline"===l.type?Ge(l,this._graphicState.isDraped?"on-the-ground":"absolute-height"):null),this._tooltip.info=n}get test(){return{segmentLabels:this._segmentLabels,tooltip:this._tooltip}}};function we(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function Ae(e,t,i,a,o){if(e){const e=o.toXYZ(o.pointToVector(i)),n=H(a,e,w.get()),r=Ie(n,e,o.spatialReference);if(s(r))return u(r.value*Math.sign(t),r.unit)}return u(t*_(i.spatialReference),"meters")}e([f()],He.prototype,"_segmentLabels",void 0),e([f({constructOnly:!0})],He.prototype,"tool",void 0),e([f()],He.prototype,"_tooltip",void 0),e([f()],He.prototype,"inputGeometry",null),e([f()],He.prototype,"outputGeometry",void 0),e([f({readOnly:!0})],He.prototype,"updating",null),e([f()],He.prototype,"manipulators",null),e([f()],He.prototype,"view",null),e([f()],He.prototype,"graphic",null),e([f()],He.prototype,"enableZShape",null),e([f()],He.prototype,"enableZVertex",null),e([f()],He.prototype,"enableMoveGraphic",null),e([f()],He.prototype,"enableMidpoints",null),e([f()],He.prototype,"enableEdgeOffset",null),e([f()],He.prototype,"_labelOptions",null),e([f()],He.prototype,"_tooltipOptions",null),He=e([v("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],He);const De=A(0,0,null,null),Te=V();var Le,Pe,je;!function(e){e.Vertex=ce.Custom1,e.Edge=ce.Custom2}(Le||(Le={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Pe||(Pe={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(je||(je={}));export{He as ReshapeOperation};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import t from"../../../../../core/Evented.js";import{HandleOwner as i}from"../../../../../core/HandleOwner.js";import a from"../../../../../core/Handles.js";import{handlesGroup as o,destroyHandle as n}from"../../../../../core/handleUtils.js";import{destroyMaybe as r,isSome as s,isNone as l,unwrap as p,removeMaybe as h}from"../../../../../core/maybe.js";import{zeroMeters as d,scale as u,createLength as c}from"../../../../../core/quantityUtils.js";import{watch as m,when as g,initial as _}from"../../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as f}from"../../../../../core/unitUtils.js";import{property as v}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as M}from"../../../../../core/accessorSupport/decorators/subclass.js";import{I as y}from"../../../../../chunks/mat4f64.js";import{l as x,b as O,h as b,s as E,a as G,g as S}from"../../../../../chunks/vec3.js";import{f as V,c as I}from"../../../../../chunks/vec3f64.js";import T from"../../../../../geometry/Polyline.js";import{projectPoint as H}from"../../../../../geometry/support/plane.js";import{sv3d as w}from"../../../../../geometry/support/vectorStacks.js";import{makeDehydratedPoint as D}from"../../../../../layers/graphics/dehydratedFeatures.js";import{getGraphicEffectiveElevationInfo as A}from"../../../../../support/elevationInfoUtils.js";import{isVolumetricSymbol as L}from"../../../../../symbols/support/utils.js";import{Manipulator3D as P}from"../../Manipulator3D.js";import{createManipulatorMaterial as j,createManipulatorOutlineMaterial as U,placeAtGraphic as k}from"../../manipulatorUtils.js";import{SegmentLabels3D as N}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as R}from"../../SnappingVisualizer3D.js";import{screenToRenderPlaneFromEvent as C,convertToMapCoordinates as F,screenToMapXYAtLocation as z,screenToMapXYForGraphicAtLocation as X}from"../dragEventPipeline3D.js";import{ManipulatorType as Y}from"../ManipulatorType.js";import{canMoveZ as Z}from"../manipulatorUtils.js";import{settings as q,colors as W}from"../settings.js";import{createVisualElements as K}from"../visualElementUtils.js";import{DISC_RADIUS_SMALL as B}from"../manipulations/config.js";import{ManipulationType as J,MoveManipulation as Q}from"../manipulations/MoveManipulation.js";import{shapeOrientation as $,axisConstrainedDragSign as ee}from"../manipulations/moveUtils.js";import{MoveXYGraphicManipulation as te}from"../manipulations/MoveXYGraphicManipulation.js";import{createEdgeOffsetIntersectionPlane as ie,createEdgeOffsetOperation as ae,edgeOffsetRotationMatrix as oe,screenEdgeLengthSquared as ne}from"./edgeOffsetUtils.js";import{OutlineVisualElement as re}from"../../visualElements/OutlineVisualElement.js";import{GraphicState as se}from"../../../layers/graphics/GraphicState.js";import le from"../../../webgl-engine/lib/GeometryUtil.js";import{MouseButton as pe}from"../../../../input/IViewEvents.js";import{addMapDelta as he,createManipulatorDragEventPipeline as de,dragAtLocation as ue,addScreenDelta as ce}from"../../../../interactive/dragEventPipeline.js";import{ManipulatorStateFlags as me,ManipulatorStateCustomFlags as ge}from"../../../../interactive/interfaces.js";import{EditGeometryOperations as _e}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as fe}from"../../../../interactive/editGeometry/interfaces.js";import{SnappingContext as ve}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as Me}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{ReshapeEdgeOffsetTooltipInfo as ye}from"../../../../interactive/tooltip/ReshapeTooltipInfos.js";import{Tooltip as xe}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as Oe,TranslateGraphicXYTooltipInfo as be,TranslateGraphicTooltipInfo as Ee,TranslateVertexZTooltipInfo as Ge,TranslateVertexXYTooltipInfo as Se,TranslateVertexTooltipInfo as Ve}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoAreaByDrapedStatus as Ie}from"../../../../support/automaticAreaMeasurementUtils.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as Te,autoLengthByElevationMode as He}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as we,elevationOfPoint as De}from"../../../../support/euclideanLengthMeasurementUtils.js";import{geodesicDistance as Ae}from"../../../../support/geodesicLengthMeasurementUtils.js";let Le=class extends(t.EventedMixin(i)){constructor(e){super(e),this._vertexManipulatorMaterial=j(q.colorToVec4(q.reshapeManipulators.vertex.color),q.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorOutlineMaterial=U(q.colorToVec4(q.reshapeManipulators.vertex.outlineColor),q.reshapeManipulators.vertex.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=U(q.colorToVec4(q.reshapeManipulators.vertex.hoverOutlineColor),q.reshapeManipulators.vertex.renderOccluded),this._edgeManipulatorMaterial=j(q.colorToVec4(q.reshapeManipulators.edge.color),q.reshapeManipulators.edge.renderOccluded),this._edgeManipulatorOutlineMaterial=U(q.colorToVec4(q.reshapeManipulators.edge.outlineColor),q.reshapeManipulators.edge.renderOccluded),this._edgeOffsetManipulatorMaterial=j(q.colorToVec4(q.reshapeManipulators.edgeOffset.color),q.reshapeManipulators.edgeOffset.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=j(q.colorToVec4(q.reshapeManipulators.edgeOffset.hoverColor),q.reshapeManipulators.edgeOffset.renderOccluded,!1),this._selectedManipulatorMaterial=j(q.colorToVec4(q.reshapeManipulators.selected.color),q.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorOutlineMaterial=U(q.colorToVec4(q.reshapeManipulators.selected.outlineColor),q.reshapeManipulators.selected.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=U(q.colorToVec4(q.reshapeManipulators.selected.hoverOutlineColor),q.reshapeManipulators.selected.renderOccluded),this._selectedIndex=0,this._vertexManipulatorGeometry=null,this._vertexManipulatorOutlineGeometry=null,this._edgeManipulatorGeometry=null,this._edgeManipulatorOutlineGeometry=null,this._edgeOffsetManipulatorGeometryInside=null,this._edgeOffsetManipulatorGeometryOutside=null,this._manipulatorHandles=new a,this._manipulatorInfos=[],this._editGeometryOperations=null,this._graphicMoveManipulation=null,this._moveManipulation=null,this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=Re.NONE,this._outlineVisualElement=null,this._segmentLabels=null,this.outputGeometry=null,this._snappingPipeline=new Me,this._snappingPipelineHandle=new Me,this._vertexLaserLineVisualElement=null}initialize(){const{graphic:e,view:t}=this,i=this._graphicState=new se({graphic:e});this._tooltip=new xe({view:t}),this.addHandles([m((()=>i.displaying),(e=>{for(const t of this._manipulatorInfos)t.manipulator.available=e})),m((()=>({labels:this._segmentLabels,enabled:this._labelOptions.enabled,edgeOffsetEnabled:this.enableEdgeOffset})),(({labels:e,enabled:t,edgeOffsetEnabled:i})=>{s(e)&&(e.visible=t,e.edgeDistance=i?"far":"default")}),_),g((()=>!this._tooltipOptions.enabled),(()=>this._tooltip.clear()),_),this.view.trackGraphicState(i)])}destroy(){this._segmentLabels=r(this._segmentLabels),this._tooltip=r(this._tooltip),this._editGeometryOperations=r(this._editGeometryOperations),this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles=r(this._manipulatorHandles),this.manipulators.removeAll(),this._manipulatorInfos=[],this._resetGrabbingDragging()}get inputGeometry(){return s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null}set inputGeometry(e){this._recreateEditGeometryAndManipulators(e)}get updating(){return this.updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get graphic(){return this.tool.graphic}get enableZShape(){return this.tool.enableZShape}get enableZVertex(){return this.tool.enableZVertex}get enableMoveGraphic(){return this.tool.enableMoveGraphic}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _labelOptions(){return this.tool.labelOptions}get _tooltipOptions(){return this.tool.tooltipOptions}removeSelectedVertices(){const e=this._manipulatorInfos.filter((e=>e.manipulator.selected&&"vertex"===e.type));this._removeVertices(e)}manipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._moveManipulation=r(this._moveManipulation),this._graphicMoveManipulation=r(this._graphicMoveManipulation),this._manipulatorHandles.removeAll(),this.manipulators.removeAll(),this._manipulatorInfos=[]}_resetGrabbingDragging(){this._numGrabbing=0,this._numDragging=0}_createManipulators(){if(l(this._editGeometryOperations))return;const e=A(this.graphic);for(const t of this._editGeometryOperations.data.components){for(const i of t.vertices)this._createVertexOrEdgeManipulator(i,e);for(const i of t.edges)this._createVertexOrEdgeManipulator(i,e)}this._createGraphicMoveManipulators(e)}get canRedo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canRedo}get canUndo(){return s(this._editGeometryOperations)&&this._editGeometryOperations.canUndo}redo(){if(l(this._editGeometryOperations))return null;const e=this._editGeometryOperations.redo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}undo(){if(l(this._editGeometryOperations))return null;this.emit("undo");const e=this._editGeometryOperations.undo();return s(e)&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),e}_recreateManipulators(){this._removeManipulators(),this._resetGrabbingDragging(),this._tooltip.clear(),this._createManipulators()}_recreateEditGeometryAndManipulators(e=this.inputGeometry){this._removeManipulators(),this._resetGrabbingDragging(),this._tooltip.clear(),l(e)||(r(this._editGeometryOperations),this._editGeometryOperations=_e.fromGeometry(e,this.view.state.viewingMode),this._createManipulators(),r(this._segmentLabels),this._segmentLabels=new N({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:A(this.graphic),labelOptions:this._labelOptions,graphic:this.graphic,graphicState:this._graphicState},visible:this._labelOptions.enabled}))}_perGraphicManipulatorDragAction(e,t){if("end"===t.action)return t;let i=0;const a=[],o=this._manipulatorInfos.some((e=>"vertex"===e.type&&e.manipulator.selected)),n=e===Ce.SELECTED_OR_ALL&&o;for(const r of this._manipulatorInfos)"vertex"===r.type&&(r.manipulator.grabbing||n&&!r.manipulator.selected||a.push(r),i++);if(0===a.length)return t;this._moveVertices(a,t);if(a.length===i){if(this._updateEventState(Re.MOVING),this.destroyed)return t;this.emit("move",{type:"move",dx:t.screenDeltaX,dy:t.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(Re.RESHAPING),this.destroyed)return t;this.emit("reshape",{type:"reshape",mover:this.graphic})}return t}_isMultiVertexSelection(){let e=0;for(const t of this._manipulatorInfos)"vertex"===t.type&&t.manipulator.selected&&e++;return e>1}_perVertexManipulatorDragAction(e){if(this._updateEventState(Re.RESHAPING),this.destroyed)return;const{mapDeltaX:t,mapDeltaY:i,mapDeltaZ:a}=e;if(!t&&!i&&!a)return;const o=[];for(const n of this._manipulatorInfos)"vertex"===n.type&&(n.manipulator.selected&&!n.manipulator.grabbing||n===e.info)&&o.push(n);this._moveVertices(o,e,fe.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(e){if(e===this._reshapeEventState)return!1;switch(e){case Re.NONE:if(0!==this._numGrabbing||0!==this._numDragging)return!1;switch(this._reshapeEventState){case Re.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case Re.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case Re.MOVING:switch(this._reshapeEventState){case Re.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case Re.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic}),this.destroyed||this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic})}break;case Re.RESHAPING:switch(this._reshapeEventState){case Re.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case Re.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic}),this.destroyed||this.emit("reshape",{type:"reshape-start",mover:this.graphic})}}if(this.destroyed)return!1;const t=this._reshapeEventState!==e;return this._reshapeEventState=e,t}_createGraphicMoveManipulators(e){const{graphic:t,handles:i,tool:a,view:o}=this,n=this._graphicState;if(this._graphicMoveManipulation=new te({tool:a,view:o,graphicState:n}),this.enableMoveGraphic){let e=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline(((t,i,a)=>{i.next((e=>this._trackNumDragging(e))).next((t=>("start"===t.action&&(e=p(this._editGeometryOperations).createUndoGroup()),t))).next((e=>this._perGraphicManipulatorDragAction(Ce.ALL,e))).next((e=>(this._updateTranslateGraphicTooltip(J.XY,e),e))).next((t=>{"end"===t.action&&(this._tooltip.clear(),e=h(e))})),a.next(this._cancelDragOperation((()=>e=h(e))))})))}else this._graphicMoveManipulation.forEachManipulator((e=>{e.grabbable=!1,e.cursor=null}));this._graphicMoveManipulation.forEachManipulator((e=>this._manipulatorHandles.add([this._watchAndUpdateGrabState(e,!1),e.events.on("immediate-click",(e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()}))]))),this._moveManipulation=new Q({tool:a,view:o,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&Z(t),snapToScene:!1,radius:Q.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator((e=>i.add([e.events.on("immediate-click",(i=>{this._moveManipulation.zManipulation.hasManipulator(e)||this._manipulatorInfos.some((e=>e.manipulator.selected))||this.emit("immediate-click",{...i,graphic:t}),i.stopPropagation()})),this._watchAndUpdateGrabState(e,!1)])));const r=e=>t=>{i.add(t.events.on("focus-changed",(({action:t})=>{"focus"===t&&this._tooltipOptions.enabled?this._updateTranslateTooltip(e):this._tooltip.clear()})))};this._moveManipulation.xyManipulation.forEachManipulator(r(J.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(r(J.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(r(J.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const l=p(t.geometry).spatialReference;i.add([this._moveManipulation.createDragPipeline(((i,o,n,r,s)=>{const l=n.next((e=>this._trackNumDragging(e))).next((e=>{const t=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));return e.manipulatorType===Y.TRANSLATE_XY&&1===t.length?{...e,info:t[0],snapOrigin:t[0].handle.pos}:{...e,info:null}})).next(this._snappingPipelineHandle.createSnapDragEventPipelineStep({predicate:e=>!!e.info,cancel:r,snappingManager:a.snappingManager,snappingContext:new ve({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:e,pointer:s,excludeFeature:t,visualizer:new R}),updatingHandles:this.updatingHandles}),this._snappingPipelineHandle.next).next(he()).next((e=>this._perGraphicManipulatorDragAction(Ce.SELECTED_OR_ALL,e))).next((e=>(this._updateTranslateTooltip(i,e),e)));return r.next(this._cancelDragOperation()),l}),e,l,t),m((()=>n?.displaying),(()=>{this._updateMoveManipulationPosition()}),_),n.on("changed",(()=>this._updateMoveManipulationPosition())),m((()=>n?.isDraped),(e=>{const t="align-move-manipulation";e?i.add(this.view.elevationProvider.on("elevation-change",(()=>this._updateMoveManipulationPosition())),t):i.remove(t)}),_)]),this._updateMoveManipulationPosition();const d=K({view:o,graphic:t,forEachManipulator:e=>{if(!this.destroyed){s(this._graphicMoveManipulation)&&this._graphicMoveManipulation.forEachManipulator(e);for(const t of this._manipulatorInfos)e(t.manipulator,Y.TRANSLATE_XY);this._moveManipulation.forEachManipulator(e)}},onManipulatorsChanged:e=>this.on("manipulators-changed",e)});s(d)&&(this._outlineVisualElement=d.visualElement instanceof re?d.visualElement:null),s(this._outlineVisualElement)&&this._manipulatorHandles.add([this._outlineVisualElement.events.on("attachment-origin-changed",(()=>{n.isDraped||this._updateMoveManipulationPosition()})),m((()=>n.isDraped),(()=>this._updateMoveManipulationPosition()))]),this._manipulatorHandles.add(d)}_createEdgeOffsetManipulator(e,t=A(this.graphic)){const i=q.reshapeManipulators.edgeOffset,a=i.size/2,n=a+i.collisionPadding;if(l(this._edgeOffsetManipulatorGeometryInside)||l(this._edgeOffsetManipulatorGeometryOutside)){const e=a/n,t=e*Math.sqrt(3)/2;this._edgeOffsetManipulatorGeometryInside=le.createExtrudedTriangle(t,e/2,e/2,i.height,i.offset),this._edgeOffsetManipulatorGeometryOutside=le.createExtrudedTriangle(-t,e/2,e/2,i.height,-i.offset)}const r=[{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorMaterial,stateMask:me.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryInside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:me.Focused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorMaterial,stateMask:me.Unfocused},{geometry:this._edgeOffsetManipulatorGeometryOutside,material:this._edgeOffsetManipulatorHoverMaterial,stateMask:me.Focused}],p=new P({view:this.view,renderObjects:r,elevationInfo:"on-the-ground"!==t.mode||L(this.graphic.symbol)?{mode:"absolute-height",offset:0}:t,worldOriented:!1,focusMultiplier:1,radius:n,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionType:{type:"disc",direction:V(0,0,1)},collisionPriority:1}),h=new P({view:this.view,renderObjects:[],worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!this.graphic.layer.visible),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default"}),d={manipulator:p,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:h,elevationInfo:t,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(d,i.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(d);const u=[];for(const o of[d.handle.leftVertex,d.handle.rightVertex]){const e=this._getManipulatorInfoFromHandle(o);s(e)&&u.push(e.manipulator.events.on("location-update",(()=>this._updateEdgeOffsetManipulator(d))))}d.locationUpdateHandle=o(u),this._manipulatorHandles.add(d.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(h,!0)],p),this._manipulatorHandles.add(de(p,this._createEdgeOffsetPipeline(d,t)),p),this._manipulatorHandles.add(de(h,((e,i,a,o)=>{if("touch"===o){this._createEdgeOffsetPipeline(d,t)(e,i,a)}else if(this.enableMoveGraphic){const o=this.graphic,n=s(o.geometry)?o.geometry.spatialReference:null;i.next((e=>this._trackNumDragging(e))).next(ue(this.view,e.elevationAlignedLocation)).next(z(this.view,e.elevationAlignedLocation,t,n,o)).next(ce()).next(he()).next((e=>this._perGraphicManipulatorDragAction(Ce.ALL,e))).next((e=>(this._updateTranslateGraphicTooltip(J.XY,e),e))).next((e=>{"end"===e.action&&this._tooltip.clear()})),a.next(this._cancelDragOperation())}})),p);const c=e=>{this._manipulatorInfos.some((e=>e.manipulator.selected))?this._clearSelection():this.emit("immediate-click",{...e,graphic:this.graphic}),e.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",c),h.events.on("immediate-click",c),p.events.on("focus-changed",(({action:e})=>{const t=this._tooltipOptions;"focus"===e&&t.enabled?this._tooltip.info=new ye({tooltipOptions:t}):this._tooltip.clear()}))],p),this._manipulatorInfos.push(d),this.manipulators.add(p),this.manipulators.add(h),this.emit("manipulators-changed"),d}_autoHideEdgeOffsetManipulator(e,t){const i=e.manipulator,a=e.edgeManipulator,n=()=>{e.visibilityHandle=h(e.visibilityHandle);const n=this._getManipulatorInfoFromHandle(e.handle.leftVertex),r=this._getManipulatorInfoFromHandle(e.handle.rightVertex),l=s(n)&&s(r)&&ne(n.manipulator.renderLocation,r.manipulator.renderLocation,this.view.state.camera)<t;(!i.focused&&!a.focused||l)&&(i.grabbable=!l,a.grabbable=!l,e.visibilityHandle=o([i.disableDisplay(),{remove:()=>{i.grabbable=!0,a.grabbable=this.enableMoveGraphic}}]))};this._manipulatorHandles.add([i.events.on("focus-changed",n),a.events.on("focus-changed",n),{remove:()=>{h(e.visibilityHandle),this.manipulators.remove(a)}}],i),n()}_updateEdgeOffsetManipulator(e){this._updateManipulatorPosition(e);const t=p(this._editGeometryOperations).data.coordinateHelper,i=ie(this.view,e.manipulator.elevationAlignedLocation,ae(t,e.handle,p(e.manipulator.elevationInfo))),a=this._getManipulatorInfoFromHandle(e.handle.leftVertex),o=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(l(a)||l(o))return;const n=a.manipulator.renderLocation,r=o.manipulator.renderLocation,h=s(i)?oe(i,n,r):y;e.manipulator.modelTransform=h,e.edgeManipulator.elevationAlignedLocation=e.manipulator.elevationAlignedLocation,e.edgeManipulator.modelTransform=h;const d=x(O(ke,n,r))/2;e.edgeManipulator.collisionType={type:"line",paths:[[[-d,0,0],[d,0,0]]]}}_createEdgeOffsetPipeline(e,t){return(i,a,o)=>{this._clearSelection();const{step:n,cleanup:r}=this._initializeEdgeOffset(e,t);a.next((e=>this._trackNumDragging(e))).next(ue(this.view,i.elevationAlignedLocation)).next(n).next(C(this.view)).next(F(this.view,p(this._editGeometryOperations).data.spatialReference)).next(he()).next(this._applyComputeEdgeOffsetDistanceStep()).next(this._applyEdgeOffsetStep(e)).next(this._showEdgeOffsetTooltip()).next((e=>{"end"===e.action&&r()})),o.next((e=>(r(),e))).next((e=>(this._tooltip.clear(),e))).next(this._cancelDragOperation())}}_initializeEdgeOffset(e,t){const i=p(this._editGeometryOperations),a=ae(i.data.coordinateHelper,e.handle,t),r=i.createUndoGroup(),d=ie(this.view,e.manipulator.elevationAlignedLocation,a);if(a.requiresSplitEdgeLeft){const t=this._getManipulatorInfoFromHandle(e.handle.leftVertex.leftEdge);s(t)&&this._splitEdgeManipulator(t,1)}if(a.requiresSplitEdgeRight){const t=this._getManipulatorInfoFromHandle(e.handle.rightVertex.rightEdge);s(t)&&this._splitEdgeManipulator(t,0)}const u=()=>new T({paths:[[e.handle.leftVertex.pos,e.handle.rightVertex.pos]],spatialReference:p(this._editGeometryOperations).data.spatialReference}),c=new re({view:this.view,isDraped:this._graphicState.isDraped,geometry:u(),elevationInfo:e.elevationInfo,width:q.visualElements.lineGraphics.outline.width,color:q.colorToVec4(W.main),attached:!0});let g;const _=()=>{this._cleanEdgeOffsetCollapsedEdges(e),g=h(g)},f=this.on("undo",_);return g=o([n(c),m((()=>this._graphicState.isDraped),(e=>c.isDraped=e)),this._graphicState.on("changed",(()=>c.geometry=u())),r,f]),{step:e=>l(a)||l(d)?(_(),null):{...e,operation:a,plane:d},cleanup:_}}_applyEdgeOffsetStep(e){return t=>{if(this.destroyed||l(t.operation))return t;this._updateEventState(Re.RESHAPING);const{mapDeltaX:i,mapDeltaY:a,mapDeltaZ:o}=t;return(i||a||o)&&(this._offsetEdge(e,t),this.emit("reshape",{type:"reshape",mover:this.graphic})),t}}_applyComputeEdgeOffsetDistanceStep(){return e=>{const{operation:t,mapEnd:i}=e;if(l(t)||l(i))return e;const a=t.signedDistanceToPoint(i);return{...e,signedDistance:a}}}_showEdgeOffsetTooltip(){return e=>{const{mapEnd:t,signedDistance:i,operation:a}=e,o=this._tooltip,n=this._tooltipOptions;if(!n.enabled||l(i))return o.clear(),e;const r="end"===e.action?d:je(this._graphicState.isDraped,-i,t,a.plane,p(this._editGeometryOperations).data.coordinateHelper);return l(o.info)||"reshape-edge-offset"!==o.info.type?o.info=new ye({tooltipOptions:n,distance:r}):o.info.distance=r,e}}_cleanEdgeOffsetCollapsedEdges(e){const t=e.handle.leftVertex.leftEdge?.leftVertex,i=e.handle.leftVertex,a=e.handle.rightVertex.rightEdge?.rightVertex,o=e.handle.rightVertex,n=p(this._editGeometryOperations).data.coordinateHelper,r=1e-6,l=[];if(t&&n.distance(t.pos,i.pos)<r){const e=this._getManipulatorInfoFromHandle(i);s(e)&&l.push(e)}if(n.distance(i.pos,o.pos)<r||a&&n.distance(a.pos,o.pos)<r){const e=this._getManipulatorInfoFromHandle(o);s(e)&&l.push(e)}l.length&&this._removeVertices(l)}_computeVertexManipulatorSizeAndOutline(e){const t=e.size/2,i=t+e.collisionPadding;return{size:t/i,outlineSize:(t+e.outlineSize)/i}}_createVertexOrEdgeManipulator(e,t=A(this.graphic)){if("edge"===e.type){if(this.enableEdgeOffset)return this._createEdgeOffsetManipulator(e,t);if(!this.enableMidpoints)return null}if(l(this._vertexManipulatorGeometry)||l(this._vertexManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(q.reshapeManipulators.vertex);this._vertexManipulatorGeometry=le.createSphereGeometry(e,16,16),this._vertexManipulatorOutlineGeometry=le.createSphereGeometry(t,16,16)}if(l(this._edgeManipulatorGeometry)||l(this._edgeManipulatorOutlineGeometry)){const{size:e,outlineSize:t}=this._computeVertexManipulatorSizeAndOutline(q.reshapeManipulators.edge);this._edgeManipulatorGeometry=le.createSphereGeometry(e,16,16),this._edgeManipulatorOutlineGeometry=le.createSphereGeometry(t,16,16)}const i=s(this.graphic.geometry)&&"point"===this.graphic.geometry.type?[]:[{geometry:this._vertexManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Ne.Vertex|me.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorOutlineMaterial,stateMask:Ne.Vertex|me.Unfocused|me.Unselected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Ne.Vertex|me.Focused|me.Unselected},{geometry:this._vertexManipulatorGeometry,material:this._selectedManipulatorMaterial,stateMask:me.Selected},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorOutlineMaterial,stateMask:me.Selected|me.Unfocused},{geometry:this._vertexManipulatorOutlineGeometry,material:this._selectedManipulatorHoverOutlineMaterial,stateMask:me.Selected|me.Focused}];this.enableMidpoints&&i.push({geometry:this._edgeManipulatorGeometry,material:this._vertexManipulatorMaterial,stateMask:Ne.Edge|me.Focused|me.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._vertexManipulatorHoverOutlineMaterial,stateMask:Ne.Edge|me.Focused|me.Unselected},{geometry:this._edgeManipulatorGeometry,material:this._edgeManipulatorMaterial,stateMask:Ne.Edge|me.Unfocused|me.Unselected},{geometry:this._edgeManipulatorOutlineGeometry,material:this._edgeManipulatorOutlineMaterial,stateMask:Ne.Edge|me.Unfocused|me.Unselected});const a=new P({view:this.view,renderObjects:i,elevationInfo:t,focusMultiplier:1,touchMultiplier:1,available:!(!this.graphic.visible||!this.graphic.layer.visible)});this._setTypeSpecificManipulatorSettings(a,e,t);const n="edge"===e.type?{manipulator:a,handle:e,locationUpdateHandle:null,type:"edge",selectedIndex:0}:{manipulator:a,handle:e,type:"vertex",selectedIndex:0};if(this._manipulatorInfos.push(n),this.manipulators.add(a),this._updateManipulatorPosition(n),"edge"===n.type){const e=[];for(const t of[n.handle.leftVertex,n.handle.rightVertex]){const i=this._getManipulatorInfoFromHandle(t);s(i)&&e.push(i.manipulator.events.on("location-update",(()=>this._updateManipulatorPosition(n))))}n.locationUpdateHandle=o(e),this._manipulatorHandles.add(n.locationUpdateHandle,a)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(a,!0),a);const r=de(a,((e,i,a,o)=>{let r=null;i.next((e=>this._trackNumDragging(e))).next((e=>{if("start"===e.action&&(r=p(this._editGeometryOperations).createUndoGroup()),"edge"===n.type){const t=this._splitEdgeManipulator(n);return{...e,info:t,snapOrigin:t.handle.pos}}return{...e,info:n,snapOrigin:n.handle.pos}})).next(ue(this.view,e.elevationAlignedLocation)).next(X(this.view,this.graphic,e.elevationAlignedLocation,e.location.spatialReference,this.graphic)).next(this._snappingPipeline.createSnapDragEventPipelineStep({predicate:()=>!this._isMultiVertexSelection(),cancel:a,snappingManager:this.tool.snappingManager,snappingContext:new ve({editGeometryOperations:p(this._editGeometryOperations),elevationInfo:t,pointer:o,excludeFeature:this.graphic,visualizer:new R}),updatingHandles:this.updatingHandles}),this._snappingPipeline.next).next(he()).next((t=>{this._perVertexManipulatorDragAction(t),"end"===t.action&&(r=h(r)),this._updateTranslateVertexTooltip(e,J.XY,t)})),a.next(this._cancelDragOperation((()=>r=h(r))))}));return this._manipulatorHandles.add([r,a.events.on("immediate-click",(e=>this._manipulatorClickCallback(e,n))),a.events.on("select-changed",(()=>{n.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()})),a.events.on("focus-changed",(({action:e})=>{"focus"===e&&"edge"!==n.type?this._updateTranslateVertexTooltip(a,J.XY):this._tooltip.clear()}))],a),this.emit("manipulators-changed"),n}_trackNumDragging(e){switch(e.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return e}_cancelDragOperation(e){return()=>{switch(this._numDragging--,this.undo(),this.outputGeometry=s(this._editGeometryOperations)?this._editGeometryOperations.data.geometry:null,s(this.tool.snappingManager)&&this.tool.snappingManager.doneSnapping(),this._tooltip.clear(),this._reshapeEventState){case Re.NONE:break;case Re.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case Re.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(Re.NONE)}}_setTypeSpecificManipulatorSettings(e,t,i){switch(t.type){case"vertex":e.state=Ne.Vertex,e.selectable=!0,e.cursor="move",e.collisionPriority=2,e.radius=q.reshapeManipulators.vertex.size/2+q.reshapeManipulators.vertex.collisionPadding,e.elevationInfo=i,e.interactive=s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type;break;case"edge":e.state=Ne.Edge,e.selectable=!1,e.cursor="copy",e.collisionPriority=-1,e.radius=q.reshapeManipulators.edge.size/2+q.reshapeManipulators.edge.collisionPadding,e.elevationInfo="on-the-ground"!==i.mode||L(this.graphic.symbol)?{mode:"absolute-height",offset:0}:i}}_watchAndUpdateGrabState(e,t){return e.events.on("grab-changed",(i=>this._onGrabStateChanged(e,t,i.action,i.pointerType)))}_onGrabStateChanged(e,t,i,a="mouse"){if("start"===i)t&&this._updateSelection(e),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(Re.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,("touch"!==a||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach((e=>{e.manipulator.interactive=e.manipulator.grabbing||!this._numGrabbing&&s(this.graphic.geometry)&&"point"!==this.graphic.geometry.type,"edgeManipulator"in e&&(e.edgeManipulator.interactive=e.edgeManipulator.grabbing||!this._numGrabbing)})),p(this._graphicMoveManipulation).forEachManipulator((e=>{e.interactive=e.grabbing||!this._numGrabbing})))}_clearSelection(){for(const e of this._manipulatorInfos)e.manipulator.grabbing||(e.manipulator.selected=!1)}_updateSelection(e){e.grabbing&&!e.selected&&e.selectable&&(this._clearSelection(),e.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(e){l(e)||(this._manipulatorHandles.remove(e.manipulator),this._manipulatorInfos.splice(this._manipulatorInfos.indexOf(e),1),this.manipulators.remove(e.manipulator),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(e){if(e)for(const t of this._manipulatorInfos)if(e===t.handle)return t;return null}_updateManipulatorPosition(e){if(l(e))return;const t=p(this._editGeometryOperations);if("vertex"===e.type)e.manipulator.location=t.data.coordinateHelper.vectorToDehydratedPoint(e.handle.pos,Ue),e.manipulator.grabbing&&s(this._vertexLaserLineVisualElement)&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=e.manipulator.renderLocation);else if("edge"===e.type){const i=this._getManipulatorInfoFromHandle(e.handle.leftVertex),a=this._getManipulatorInfoFromHandle(e.handle.rightVertex);if(l(i)||l(a))return;const o=i.manipulator,n=a.manipulator;if(s(e.manipulator.elevationInfo)&&"on-the-ground"===e.manipulator.elevationInfo.mode){const i=o.location,a=n.location,r=.5,s=i.x+r*(a.x-i.x),l=i.y+r*(a.y-i.y),p=i.hasZ&&a.hasZ?0:void 0;e.manipulator.location=D(s,l,p,t.data.spatialReference)}else b(ke,o.renderLocation,n.renderLocation,.5),e.manipulator.renderLocation=ke}}_splitEdgeManipulator(e,t=.5){const i=p(this._editGeometryOperations),a=p(i.splitEdge(e.handle,t).createdVertex);e.locationUpdateHandle.remove(),e.locationUpdateHandle=void 0;const o=A(this.graphic);let n;this.enableEdgeOffset?(this._removeManipulator(e),n=this._createVertexOrEdgeManipulator(a)):(n=e,n.handle=a,n.type="vertex",this._setTypeSpecificManipulatorSettings(e.manipulator,e.handle,o)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(n),this.enableEdgeOffset||this._updateTranslateVertexTooltip(n.manipulator,J.XY),this._updateSelection(e.manipulator);const r=this._updateEventState(Re.RESHAPING),s=i.data.coordinateHelper.vectorToArray(n.handle.pos),l=i.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:s,componentIndex:l,vertexIndex:p(a.index)}],added:s}),r&&this._updateEventState(Re.NONE),n}_updateMoveManipulationPosition(){const e=E(ke,0,0,0);let t=0,i=!1,a=null,o=null;for(const n of this._manipulatorInfos)"vertex"===n.type&&(n.manipulator.selected?(t++,G(e,e,n.manipulator.renderLocation),l(a)||n.selectedIndex>a.selectedIndex?(o=a,a=n):(l(o)||n.selectedIndex>o.selectedIndex)&&(o=n)):i=!0);if(0!==t){const e=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.zManipulation.available=e&&this.enableZVertex&&Z(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e&&1!==t}else{const e=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=e,this._moveManipulation.xyAxisManipulation.available=e,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=e,this._moveManipulation.zManipulation.available=e&&this.enableZShape&&Z(this.graphic)}if(0!==t){let e=0;if(s(a)){const t=a.handle.pos,i=s(o)?o.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,n=l(o)&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;i&&n?this._moveManipulation.xyAxisManipulation.available=!1:i?e=Pe(i,t):n&&(e=Pe(t,n))}this._moveManipulation.angle=e,this._moveManipulation.radius=B}else this._moveManipulation.angle=$(p(this.graphic.geometry)),this._moveManipulation.radius=Q.radiusForSymbol(this.graphic.symbol);0!==t&&i?(S(e,e,1/t),Ue.spatialReference=p(this._editGeometryOperations).data.spatialReference,Ue.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(e,Ue),this._moveManipulation.elevationAlignedLocation=Ue):s(this._outlineVisualElement)&&!this._graphicState.isDraped&&s(this._outlineVisualElement.attachmentOrigin)?this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin:k(this.view,this._moveManipulation,this.graphic)}_removeVertices(e){const t=[],i=p(this._editGeometryOperations);for(const a of e)if("vertex"===a.type&&i.canRemoveVertex()){t.push(a.handle),this._removeManipulator(a),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(a.handle.rightEdge));const e=p(i.removeVertices([a.handle]).removedVertices[0].createdEdge);e&&this._createVertexOrEdgeManipulator(e)}if(t.length>0){const e=t.map((e=>{const t=i.data.components.indexOf(e.component);return{coordinates:i.data.coordinateHelper.vectorToArray(e.pos),componentIndex:t,vertexIndex:p(e.index)}}));this.outputGeometry=i.data.geometry;const a=this._updateEventState(Re.RESHAPING);if(this.destroyed)return;if(this.emit("vertex-remove",{type:"vertex-remove",removed:e.map((e=>e.coordinates)),vertices:e}),this.destroyed)return;if(a&&(this._updateEventState(Re.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(e,t,i=("start"===t.action?fe.NEW_STEP:fe.ACCUMULATE_STEPS)){const a=p(this._editGeometryOperations);a.moveVertices(e.map((e=>e.handle)),t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i),this.outputGeometry=a.data.geometry;for(const o of e)this._updateManipulatorPosition(o)}_offsetEdge(e,t){if(l(t.operation)||l(t.signedDistance))return;const i=p(this._editGeometryOperations),a=t.operation.clone();a.distance=t.signedDistance,i.updateVertices([e.handle.leftVertex,e.handle.rightVertex],a),this.outputGeometry=i.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(e.handle.rightVertex))}_manipulatorClickCallback(e,t){e.shiftKey||this._clearSelection(),"vertex"===t.type&&(t.manipulator.selected=!t.manipulator.selected,e.button===pe.Right&&this._removeVertices([t])),"edge"===t.type&&e.button===pe.Left&&this._splitEdgeManipulator(t),e.stopPropagation()}_updateTranslateTooltip(e,t){const i=this._manipulatorInfos.filter((e=>"vertex"===e.type&&e.manipulator.selected));1===i.length?this._updateTranslateVertexTooltip(i[0].manipulator,e,t):this._updateTranslateGraphicTooltip(e,t)}_updateTranslateGraphicTooltip(e,t){const i=this._tooltipOptions;if(!i.enabled)return;const a=this._graphicState.isDraped?"on-the-ground":"absolute-height";switch(e){case J.XY:this._tooltip.info=new Ee({tooltipOptions:i}),this._updateTranslateTooltipDistance(this._tooltip.info,t,((e,t)=>Te(e,t,a)));break;case J.XY_AXIS:this._tooltip.info=new be({tooltipOptions:i}),this._updateTranslateTooltipDistance(this._tooltip.info,t,((e,i)=>{const o=Te(e,i,a);return u(o,ee(t))}));break;case J.Z:this._tooltip.info=new Oe({tooltipOptions:i}),this._updateTranslateTooltipDistance(this._tooltip.info,t,we)}}_updateTranslateVertexTooltip(e,t,i){const a=this._tooltipOptions;if(!a.enabled)return;let o;const n=this._graphicState.isDraped?"on-the-ground":"absolute-height";switch(t){case J.XY:o=new Ve({tooltipOptions:a}),this._updateTranslateTooltipDistance(o,i,((e,t)=>Te(e,t,n))),this._updateTranslateVertexTooltipSum(o);break;case J.XY_AXIS:o=new Se({tooltipOptions:a}),this._updateTranslateTooltipDistance(o,i,((e,t)=>{const a=Te(e,t,n);return u(a,ee(i))})),this._updateTranslateVertexTooltipSum(o);break;case J.Z:o=new Ge({tooltipOptions:a}),this._updateTranslateTooltipDistance(o,i,we)}const r=De(e.elevationAlignedLocation);s(r)&&(o.elevation={mode:"absolute-height",...r}),this._tooltip.info=o}_updateTranslateTooltipDistance(e,t,i){if(s(t)&&"end"!==t.action){const{mapStart:a,mapEnd:o}=t,n=i(a,o);e.distance=s(n)?n:d}}_updateTranslateVertexTooltipSum(e){const{geometry:t}=this.graphic;s(t)&&(e.area="polygon"===t.type?Ie(t,this._graphicState.isDraped):null,e.totalLength="polyline"===t.type?He(t,this._graphicState.isDraped?"on-the-ground":"absolute-height"):null)}get test(){return{segmentLabels:this._segmentLabels,tooltip:this._tooltip}}};function Pe(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])+Math.PI/2}function je(e,t,i,a,o){if(e){const e=o.toXYZ(o.pointToVector(i)),n=H(a,e,w.get()),r=Ae(n,e,o.spatialReference);if(s(r))return c(r.value*Math.sign(t),r.unit)}return c(t*f(i.spatialReference),"meters")}e([v()],Le.prototype,"_segmentLabels",void 0),e([v({constructOnly:!0})],Le.prototype,"tool",void 0),e([v()],Le.prototype,"_tooltip",void 0),e([v()],Le.prototype,"inputGeometry",null),e([v()],Le.prototype,"outputGeometry",void 0),e([v({readOnly:!0})],Le.prototype,"updating",null),e([v()],Le.prototype,"manipulators",null),e([v()],Le.prototype,"view",null),e([v()],Le.prototype,"graphic",null),e([v()],Le.prototype,"enableZShape",null),e([v()],Le.prototype,"enableZVertex",null),e([v()],Le.prototype,"enableMoveGraphic",null),e([v()],Le.prototype,"enableMidpoints",null),e([v()],Le.prototype,"enableEdgeOffset",null),e([v()],Le.prototype,"_labelOptions",null),e([v()],Le.prototype,"_tooltipOptions",null),Le=e([M("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],Le);const Ue=D(0,0,null,null),ke=I();var Ne,Re,Ce;!function(e){e.Vertex=ge.Custom1,e.Edge=ge.Custom2}(Ne||(Ne={})),function(e){e[e.NONE=0]="NONE",e[e.MOVING=1]="MOVING",e[e.RESHAPING=2]="RESHAPING"}(Re||(Re={})),function(e){e[e.ALL=0]="ALL",e[e.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(Ce||(Ce={}));export{Le as ReshapeOperation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as o,unwrapOr as r,isNone as n,unwrap as p}from"../../../../../core/maybe.js";import{createLength as l}from"../../../../../core/quantityUtils.js";import{watch as h,initial as c}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as d}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as u,getMetersPerUnitForSR as m}from"../../../../../core/unitUtils.js";import{property as g}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{p as y}from"../../../../../chunks/mat4.js";import{s as f,a as _,f as S}from"../../../../../chunks/vec2.js";import{a as M}from"../../../../../chunks/vec2f64.js";import{c as b,C as T,b as E,n as x,l as B,e as A}from"../../../../../chunks/vec3.js";import{c as O,a as R}from"../../../../../chunks/vec3f64.js";import{containsXY as j}from"../../../../../geometry/support/aaBoundingRect.js";import{a as G,c as D}from"../../../../../chunks/boundedPlane.js";import{intersectRay as w,create as P,normal as z}from"../../../../../geometry/support/plane.js";import{create as I}from"../../../../../geometry/support/ray.js";import{sv2d as U,sv3d as Z,sm4d as C}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as k}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as X,OffsetMode as Y,IsShiftEdgeOnScreenFlag as L,createResizeManipulator as N,createRotateManipulator as V,resizeNormal as H,resizeOutlineOnly as F,isDiagonalResizeHandle as q,calculateDiagonalResizeHandleScale as W,createRotatePlane as J,RotationAxis as K,calculateBoundedPlaneTranslateRotate as Q,updateRotateHeadingHandle as $,updateResizeHandle as tt}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as et}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as it}from"../../Manipulator3D.js";import{getGraphicAttachmentOrigin as at,calculateInputRotationTransform as st}from"../../manipulatorUtils.js";import{screenToZConstrained as ot,screenToRenderPlane as rt}from"../dragEventPipeline3D.js";import{ManipulatorType as nt}from"../ManipulatorType.js";import{canMoveZ as pt}from"../manipulatorUtils.js";import{createVisualElements as lt}from"../visualElementUtils.js";import{ManipulationType as ht}from"../manipulations/MoveManipulation.js";import{MoveXYGraphicManipulation as ct}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as dt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ut}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as mt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as gt}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as vt}from"../../../layers/graphics/GraphicState.js";import{fromScreen as yt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as ft,addMapDelta as _t,addScreenDelta as St}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Mt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as bt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as Tt}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as Et}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{mapPlaneAutoHorizontalSizeByElevationMode as xt,calculateOrientedBounds as Bt,mapPlaneToRenderPlane as At,apply as Ot,unapply as Rt}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import jt from"../../../../interactive/sketch/SketchTooltipOptions.js";import{ExtentRotateTooltipInfo as Gt,ExtentScaleTooltipInfo as Dt}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import{Tooltip as wt}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as Pt,TranslateZTooltipInfo as zt}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as It}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistance as Ut}from"../../../../support/euclideanLengthMeasurementUtils.js";let Zt=class extends(e.EventedMixin(Mt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new jt,this._preserveAspectRatio=new dt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this.handles=new i,this.moveZManipulator=null,this.resizeManipulators=null,this.rotateManipulator=null,this.attachmentOrigin=null,this.outlineVisualElement=null,this.mapBounds=G(),this.mapBoundsStart=G(),this.zmax=0,this.sizeStart=null,this.displayBounds=G(),this.displayBoundsStart=G(),this.displayBoundsMarginStart=0,this.resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._rotateTooltipInfo=null,this._scaleTooltipInfo=null,this._startAngle=0,this._endAngle=0,this._startScale=M(),this._endScale=M()}initialize(){const{view:t,graphic:e,manipulators:i,handles:s}=this,r=this.graphicState=new vt({graphic:e}),n=e.geometry;this.editGeometryOperations=bt.fromGeometry(n,t.state.viewingMode),this.graphicMoveManipulation=new ct({tool:this,view:t,graphicState:r}),this.moveZManipulator=X(t,Y.CENTER_ON_CALLOUT),this.moveZManipulator.state|=L,s.add([this._createMoveXYGraphicDragPipeline(),h((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this.moveZManipulator,nt.TRANSLATE_Z))),this._createMoveZDragPipeline()]),i.add(this.moveZManipulator),this.resizeManipulators=this.resizeHandles.map((e=>{const i=N(t,e);return s.add([h((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,nt.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),i.addMany(this.resizeManipulators),this.rotateManipulatorTexture=et(t.toolViewManager.textures),this.rotateManipulator=V(t,this.rotateManipulatorTexture.texture),s.add([h((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this.rotateManipulator,nt.ROTATE))),this.rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this.rotateManipulator)]),i.add(this.rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const p=lt({view:t,graphic:e,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()});o(p)&&(this.outlineVisualElement=p.visualElement instanceof ut?p.visualElement:null),o(this.outlineVisualElement)&&s.add(this.outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),s.add(p),s.add([r.on("changed",(()=>this._onGeometryChanged())),h((()=>r.displaying),(()=>this._updateAllManipulatorAvailability())),h((()=>r.isDraped),(()=>this._graphicDrapedChanged()),c),t.trackGraphicState(r)]);const l=t.pointsOfInterest;l&&s.add(h((()=>l.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const d=t=>{s.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(d);const u=(t,i)=>{s.add(t.events.on("immediate-click",(t=>{i===nt.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:e}),t.stopPropagation()})))};this._forEachManipulator(u),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this.mapBounds=null,this.displayBounds=null,this.rotateManipulatorTexture.release(),this.handles.destroy(),this.graphicMoveManipulation.destroy(),this.editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{handles:t,view:e}=this,i=this._tooltip=new wt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",(()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._tooltip.clear()})),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{f(this._startScale,t.xScale,t.yScale),f(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{f(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{f(this._startScale,0,0),f(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",(t=>{"cancel"===t.action?this._tooltip.clear():a()}))])}))}_getUpdatedTooltipInfo(){return this.tooltipOptions.enabled?this.graphicMoveManipulation.grabbing||this.graphicMoveManipulation.dragging?this._computeMoveXYTooltipInfo():this.moveZManipulator.focused?this._computeMoveZTooltipInfo():this.rotateManipulator.focused?this._computeRotateTooltipInfo():this.resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null:null}_computeMoveXYTooltipInfo(){return this._moveXYTooltipInfo=r(this._moveXYTooltipInfo,(()=>new Pt({tooltipOptions:this.tooltipOptions})))}_computeMoveZTooltipInfo(){const t=this._moveZTooltipInfo=r(this._moveZTooltipInfo,(()=>new zt({tooltipOptions:this.tooltipOptions}))),e=this._moveUnit;if(this.moveZManipulator.dragging){const e=this.mapBoundsStart.origin,i=this.mapBounds.origin,a=Ut(e,i,this.view.spatialReference);if(n(a))return null;t.distance=a}else t.distance=l(0,e);return t}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo=r(this._rotateTooltipInfo,(()=>new Gt({tooltipOptions:this.tooltipOptions})));return t.angle=this._startAngle-this._endAngle,t}_computeScaleTooltipInfo(){const t=this.graphic.geometry;if(n(t))return null;const e=this._scaleTooltipInfo=r(this._scaleTooltipInfo,(()=>new Dt({tooltipOptions:this.tooltipOptions}))),i=xt(this.mapBounds,this.zmax,t.spatialReference,this.graphicState.isDraped);return n(i)?null:(e.xSize=i[0],e.ySize=i[1],o(this.sizeStart)&&this.resizeManipulators.some((t=>t.dragging))?(e.xScale=i[0].value/this.sizeStart[0].value,e.yScale=i[1].value/this.sizeStart[1].value):(e.xScale=1,e.yScale=1),e)}_graphicDrapedChanged(){this.handles.remove(Ct),this._updateDisplayBounds(),this.graphicState.isDraped&&this.handles.add(this.view.elevationProvider.on("elevation-change",(t=>{o(this.attachmentOrigin)&&j(t.extent,this.attachmentOrigin.x,this.attachmentOrigin.y)&&this._updateDisplayBounds()})),Ct)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof it){const a=this.graphicState.displaying,s=this.enableZ&&pt(this.graphic);switch(e){case nt.ROTATE:t.available=a&&this.enableRotation;break;case nt.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?H:F;break;case nt.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this.graphicMoveManipulation.forEachManipulator(t),this.resizeManipulators.forEach((e=>t(e,nt.SCALE))),t(this.rotateManipulator,nt.ROTATE),t(this.moveZManipulator,nt.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return r(u(this.view.spatialReference),"meters")}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this.editGeometryOperations.data,i=e.components[0].edges[0],a=_(U.get(),i.leftVertex.pos,i.rightVertex.pos);S(a,a);const s=r(at(this.view,this.graphic),(()=>t.extent.center));let o=Xt*this.view.pixelSizeAt(s);const n=this.view.spatialReference,p=t.spatialReference;n.equals(p)||(o*=m(n)/m(p)),Bt(a,e,o,this.mapBounds),this._updateZMax()}_updateZMax(){const t=this.editGeometryOperations.data;if(!t.geometry.hasZ)return void(this.zmax=0);const e=t.coordinateHelper;let i=Number.NEGATIVE_INFINITY;for(const a of t.components)for(const t of a.vertices){const a=e.getZ(t.pos);i=Math.max(a,i)}this.zmax=i}_updateDisplayBounds(){const t=this.graphic.geometry;if(n(t))return;const e=o(this.outlineVisualElement)&&!this.graphicState.isDraped&&o(this.outlineVisualElement.attachmentOrigin)?this.outlineVisualElement.attachmentOrigin:at(this.view,this.graphic);this.attachmentOrigin=r(e,t.extent.center);const i=o(e)?e.z:mt(this.mapBounds.origin,this.view.elevationProvider,gt.fromElevationInfo(k(this.graphic)),this.view.renderCoordsHelper),a=D(this.mapBounds);a.origin[2]=i,At(a,this.view.renderCoordsHelper,t.spatialReference,this._displayBoundsMargin,this.displayBounds),this._updateManipulators()}get _displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this.editGeometryOperations.data.geometry.extent.center;return kt*this.view.pixelSizeAt(e)}_createMoveXYGraphicDragPipeline(){return this.graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i,ht.XY)))}_createMoveZDragPipeline(){const t=this.view,e=this.editGeometryOperations.data.spatialReference;return ft(this.moveZManipulator,((i,a,s)=>{const o=R(i.renderLocation),r=a.next(ot(t,o,e)).next(St());this._applyGraphicMoveSteps(r,s,ht.Z)}))}_applyGraphicMoveSteps(t,e,i){const a=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},this._updateOperationStartProperties(),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(_t()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t})).next((t=>this._updateMoveTooltip(t,i)));return e.next((()=>{o(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),a}_updateOperationStartProperties(){D(this.displayBounds,this.displayBoundsStart),D(this.mapBounds,this.mapBoundsStart),n(this.graphic.geometry)?this.sizeStart=null:this.sizeStart=xt(this.mapBoundsStart,this.zmax,this.graphic.geometry.spatialReference,this.graphicState.isDraped)}_moveDragUpdateGeometry(){return t=>{if(n(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this.editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,a=this.editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return Ot(a,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_updateMoveTooltip(t,e){if(e===ht.XY||e===ht.XY_AXIS){const e=It(t.mapStart,t.mapEnd,this.graphicState.isDraped?"on-the-ground":"absolute-height");o(e)&&o(this._moveXYTooltipInfo)&&(this._moveXYTooltipInfo.distance=e)}return t}_onResizeGrab(t){if("start"!==t.action)return;const e=this._calculatePickRay(t.screenPoint);w(this.displayBounds.plane,e,Z.get())&&(this._updateOperationStartProperties(),this.displayBoundsMarginStart=this._displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return ft(t,((t,i,a)=>{n(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(rt(this.view,this.displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{o(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this.displayBoundsStart,i=t.handle.direction,a=this._displayBoundsMargin,s=this.displayBoundsMarginStart,o=b(Z.get(),e.origin);T(o,o,e.basis1,-i[0]),T(o,o,e.basis2,-i[1]);const r=E(Z.get(),t.renderEnd,o),n=E(Z.get(),t.renderStart,o),p=q(t.handle),l=W(e),h=W(this.displayBounds)/l,c=(t,e)=>{if(0===t)return 1;let i=B(e),o=.5*t*A(e,r)/i;const l=o<0?-1:1;if(p){o+=(i-.5*t*A(e,n)/i)*l*h}const c=i<1.5*s?1:Yt;return i=Math.max(i-s,Yt),l>0&&(o-=a),l*Math.max(l*(o/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=b(O(),this.mapBoundsStart.origin);T(e,e,this.mapBoundsStart.basis1,-t.handle.direction[0]),T(e,e,this.mapBoundsStart.basis2,-t.handle.direction[1]);const i=f(M(),this.mapBoundsStart.basis1[0],this.mapBoundsStart.basis1[1]);S(i,i);const a=[];for(const r of this.editGeometryOperations.data.components)a.push(...r.vertices);const s="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,o=this.editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,Et.REPLACE);return D(this.mapBoundsStart,this.mapBounds),Ot(o,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_onRotateGrab(t){if("start"!==t.action)return;const e=J(this.displayBounds,this.view.renderCoordsHelper,K.HEADING,P()),i=this._calculatePickRay(t.screenPoint);w(e,i,Z.get())&&(this._updateOperationStartProperties(),this.inputState={type:"rotate",rotatePlane:e})}_createRotateDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;n(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(rt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{o(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=z(t.rotatePlane),a=st(e.renderStart,e.renderEnd,this.displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=b(O(),this.mapBoundsStart.origin),i=[];for(const o of this.editGeometryOperations.data.components)i.push(...o.vertices);const a="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,s=this.editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,Et.REPLACE);return D(this.mapBoundsStart,this.mapBounds),Ot(s,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=I(),i=d(t);return yt(this.view.state.camera,i,e),x(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=Q(this.displayBounds,C.get());$(this.rotateManipulator,t,this.displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this.moveZManipulator,t),this.resizeManipulators.forEach(((e,i)=>{tt(e,this.resizeHandles[i],t,this.displayBounds)}))}_updateZMoveHandle(t,e){const i=this.displayBounds,a={basis:i.basis1,direction:-1,position:E(Z.get(),i.origin,i.basis1),edge:2},s=C.get();y(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this.editGeometryOperations.lastOperation;n(t)||(this.editGeometryOperations.undo(),this.graphic.geometry=this.editGeometryOperations.data.geometry,Rt(t,this.mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this.editGeometryOperations.canUndo}undo(){if(o(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this.editGeometryOperations.undo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Rt(p(t),this.mapBounds),this._updateDisplayBounds()}}get canRedo(){return this.editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this.editGeometryOperations.redo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Ot(p(t),this.mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this.resizeManipulators,rotateManipulator:this.rotateManipulator,moveZManipulator:this.moveZManipulator,tooltip:this._tooltip}}};t([g({constructOnly:!0,nonNullable:!0})],Zt.prototype,"view",void 0),t([g({constructOnly:!0,nonNullable:!0})],Zt.prototype,"graphic",void 0),t([g({constructOnly:!0,nonNullable:!0})],Zt.prototype,"enableZ",void 0),t([g()],Zt.prototype,"enableRotation",void 0),t([g()],Zt.prototype,"enableScaling",void 0),t([g({constructOnly:!0,type:jt})],Zt.prototype,"tooltipOptions",void 0),t([g()],Zt.prototype,"preserveAspectRatio",null),t([g()],Zt.prototype,"grabbing",void 0),t([g()],Zt.prototype,"inputState",void 0),t([g({readOnly:!0})],Zt.prototype,"type",void 0),t([g()],Zt.prototype,"_moveUnit",null),Zt=t([v("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],Zt);const Ct="draped-elevation-changes",kt=10,Xt=80,Yt=1e-6;export{Yt as EPSILON,Zt as ExtentTransformTool};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import i from"../../../../../core/Handles.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{rad2deg as s}from"../../../../../core/mathUtils.js";import{isSome as o,unwrapOr as r,isNone as n,unwrap as p}from"../../../../../core/maybe.js";import{createLength as l}from"../../../../../core/quantityUtils.js";import{watch as h,initial as c}from"../../../../../core/reactiveUtils.js";import{screenPointObjectToArray as d}from"../../../../../core/screenUtils.js";import{lengthUnitFromSpatialReference as u,getMetersPerUnitForSR as m}from"../../../../../core/unitUtils.js";import{property as g}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as v}from"../../../../../core/accessorSupport/decorators/subclass.js";import{p as y}from"../../../../../chunks/mat4.js";import{s as f,a as _,f as S}from"../../../../../chunks/vec2.js";import{a as M}from"../../../../../chunks/vec2f64.js";import{c as b,C as T,b as E,n as x,l as B,e as A}from"../../../../../chunks/vec3.js";import{c as O,a as R}from"../../../../../chunks/vec3f64.js";import{containsXY as j}from"../../../../../geometry/support/aaBoundingRect.js";import{a as G,c as D}from"../../../../../chunks/boundedPlane.js";import{intersectRay as w,create as P,normal as z}from"../../../../../geometry/support/plane.js";import{create as I}from"../../../../../geometry/support/ray.js";import{sv2d as U,sv3d as Z,sm4d as C}from"../../../../../geometry/support/vectorStacks.js";import{getGraphicEffectiveElevationInfo as k}from"../../../../../support/elevationInfoUtils.js";import{createShiftManipulator as X,OffsetMode as Y,IsShiftEdgeOnScreenFlag as L,createResizeManipulator as N,createRotateManipulator as V,resizeNormal as H,resizeOutlineOnly as F,isDiagonalResizeHandle as q,calculateDiagonalResizeHandleScale as W,createRotatePlane as J,RotationAxis as K,calculateBoundedPlaneTranslateRotate as Q,updateRotateHeadingHandle as $,updateResizeHandle as tt}from"../../../analysis/Slice/sliceToolUtils.js";import{getRotateHeadingTexture as et}from"../../../analysis/Slice/images/Factory.js";import{Manipulator3D as it}from"../../Manipulator3D.js";import{getGraphicAttachmentOrigin as at,calculateInputRotationTransform as st}from"../../manipulatorUtils.js";import{screenToZConstrained as ot,screenToRenderPlane as rt}from"../dragEventPipeline3D.js";import{ManipulatorType as nt}from"../ManipulatorType.js";import{canMoveZ as pt}from"../manipulatorUtils.js";import{createVisualElements as lt}from"../visualElementUtils.js";import{ManipulationType as ht}from"../manipulations/MoveManipulation.js";import{MoveXYGraphicManipulation as ct}from"../manipulations/MoveXYGraphicManipulation.js";import{PreserveAspectRatio as dt}from"./PreserveAspectRatio.js";import{OutlineVisualElement as ut}from"../../visualElements/OutlineVisualElement.js";import{evaluateElevationAlignmentAtPoint as mt}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as gt}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as vt}from"../../../layers/graphics/GraphicState.js";import{fromScreen as yt}from"../../../support/geometryUtils/ray.js";import{createManipulatorDragEventPipeline as ft,addMapDelta as _t,addScreenDelta as St}from"../../../../interactive/dragEventPipeline.js";import{InteractiveToolBase as Mt}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as bt}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as Tt}from"../../../../interactive/editGeometry/interfaces.js";import{AccumulationType as Et}from"../../../../interactive/editGeometry/operations/UpdateVertices.js";import{mapPlaneAutoHorizontalSizeByElevationMode as xt,calculateOrientedBounds as Bt,mapPlaneToRenderPlane as At,apply as Ot,unapply as Rt}from"../../../../interactive/editGeometry/support/editPlaneUtils.js";import jt from"../../../../interactive/sketch/SketchTooltipOptions.js";import{ExtentRotateTooltipInfo as Gt,ExtentScaleTooltipInfo as Dt}from"../../../../interactive/tooltip/ExtentTooltipInfos.js";import{Tooltip as wt}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicTooltipInfo as Pt,TranslateGraphicZTooltipInfo as zt}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as It}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistance as Ut}from"../../../../support/euclideanLengthMeasurementUtils.js";let Zt=class extends(e.EventedMixin(Mt)){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new jt,this._preserveAspectRatio=new dt,this.grabbing=!1,this.inputState=null,this.type="transform-3d",this.handles=new i,this.moveZManipulator=null,this.resizeManipulators=null,this.rotateManipulator=null,this.attachmentOrigin=null,this.outlineVisualElement=null,this.mapBounds=G(),this.mapBoundsStart=G(),this.zmax=0,this.sizeStart=null,this.displayBounds=G(),this.displayBoundsStart=G(),this.displayBoundsMarginStart=0,this.resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._rotateTooltipInfo=null,this._scaleTooltipInfo=null,this._startAngle=0,this._endAngle=0,this._startScale=M(),this._endScale=M()}initialize(){const{view:t,graphic:e,manipulators:i,handles:s}=this,r=this.graphicState=new vt({graphic:e}),n=e.geometry;this.editGeometryOperations=bt.fromGeometry(n,t.state.viewingMode),this.graphicMoveManipulation=new ct({tool:this,view:t,graphicState:r}),this.moveZManipulator=X(t,Y.CENTER_ON_CALLOUT),this.moveZManipulator.state|=L,s.add([this._createMoveXYGraphicDragPipeline(),h((()=>this.enableZ),(()=>this._updateManipulatorAvailability(this.moveZManipulator,nt.TRANSLATE_Z))),this._createMoveZDragPipeline()]),i.add(this.moveZManipulator),this.resizeManipulators=this.resizeHandles.map((e=>{const i=N(t,e);return s.add([h((()=>this.enableScaling),(()=>this._updateManipulatorAvailability(i,nt.SCALE))),i.events.on("grab-changed",(t=>this._onResizeGrab(t))),this._createResizeDragPipeline(i,e)]),i})),i.addMany(this.resizeManipulators),this.rotateManipulatorTexture=et(t.toolViewManager.textures),this.rotateManipulator=V(t,this.rotateManipulatorTexture.texture),s.add([h((()=>this.enableRotation),(()=>this._updateManipulatorAvailability(this.rotateManipulator,nt.ROTATE))),this.rotateManipulator.events.on("grab-changed",(t=>{this._onRotateGrab(t)})),this._createRotateDragPipeline(this.rotateManipulator)]),i.add(this.rotateManipulator),this._calculateMapBounds(),this._updateDisplayBounds();const p=lt({view:t,graphic:e,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()});o(p)&&(this.outlineVisualElement=p.visualElement instanceof ut?p.visualElement:null),o(this.outlineVisualElement)&&s.add(this.outlineVisualElement.events.on("attachment-origin-changed",(()=>this._updateDisplayBounds()))),s.add(p),s.add([r.on("changed",(()=>this._onGeometryChanged())),h((()=>r.displaying),(()=>this._updateAllManipulatorAvailability())),h((()=>r.isDraped),(()=>this._graphicDrapedChanged()),c),t.trackGraphicState(r)]);const l=t.pointsOfInterest;l&&s.add(h((()=>l.centerOnSurfaceFrequent.location),(()=>this._updateDisplayBounds())));const d=t=>{s.add(t.events.on("grab-changed",(()=>{this.grabbing=t.grabbing,this._updateAllManipulatorAvailability()})))};this._forEachManipulator(d);const u=(t,i)=>{s.add(t.events.on("immediate-click",(t=>{i===nt.TRANSLATE_XY&&this.emit("immediate-click",{...t,graphic:e}),t.stopPropagation()})))};this._forEachManipulator(u),this._onGeometryChanged(),this._updateAllManipulatorAvailability(),this._initializeTooltip(),this.finishToolCreation()}destroy(){this.mapBounds=null,this.displayBounds=null,this.rotateManipulatorTexture.release(),this.handles.destroy(),this.graphicMoveManipulation.destroy(),this.editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{handles:t,view:e}=this,i=this._tooltip=new wt({view:e}),a=()=>{i.info=this._getUpdatedTooltipInfo()};t.add([this.on("graphic-translate-start",a),this.on("graphic-translate",a),this.on("graphic-translate-stop",(()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null,this._tooltip.clear()})),this.on("graphic-rotate-start",(t=>{this._startAngle=t.angle,a()})),this.on("graphic-rotate",(t=>{this._endAngle=t.angle,a()})),this.on("graphic-rotate-stop",(()=>{this._startAngle=0,this._endAngle=0,a()})),this.on("graphic-scale-start",(t=>{f(this._startScale,t.xScale,t.yScale),f(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale",(t=>{f(this._endScale,t.xScale,t.yScale),a()})),this.on("graphic-scale-stop",(()=>{f(this._startScale,0,0),f(this._endScale,0,0),a()}))]),this._forEachManipulator((e=>{t.add([e.events.on("focus-changed",a),e.events.on("grab-changed",a),e.events.on("drag",(t=>{"cancel"===t.action?this._tooltip.clear():a()}))])}))}_getUpdatedTooltipInfo(){return this.tooltipOptions.enabled?this.graphicMoveManipulation.grabbing||this.graphicMoveManipulation.dragging?this._computeMoveXYTooltipInfo():this.moveZManipulator.focused?this._computeMoveZTooltipInfo():this.rotateManipulator.focused?this._computeRotateTooltipInfo():this.resizeManipulators.some((t=>t.focused))?this._computeScaleTooltipInfo():null:null}_computeMoveXYTooltipInfo(){return this._moveXYTooltipInfo=r(this._moveXYTooltipInfo,(()=>new Pt({tooltipOptions:this.tooltipOptions})))}_computeMoveZTooltipInfo(){const t=this._moveZTooltipInfo=r(this._moveZTooltipInfo,(()=>new zt({tooltipOptions:this.tooltipOptions}))),e=this._moveUnit;if(this.moveZManipulator.dragging){const e=this.mapBoundsStart.origin,i=this.mapBounds.origin,a=Ut(e,i,this.view.spatialReference);if(n(a))return null;t.distance=a}else t.distance=l(0,e);return t}_computeRotateTooltipInfo(){const t=this._rotateTooltipInfo=r(this._rotateTooltipInfo,(()=>new Gt({tooltipOptions:this.tooltipOptions})));return t.angle=this._startAngle-this._endAngle,t}_computeScaleTooltipInfo(){const t=this.graphic.geometry;if(n(t))return null;const e=this._scaleTooltipInfo=r(this._scaleTooltipInfo,(()=>new Dt({tooltipOptions:this.tooltipOptions}))),i=xt(this.mapBounds,this.zmax,t.spatialReference,this.graphicState.isDraped);return n(i)?null:(e.xSize=i[0],e.ySize=i[1],o(this.sizeStart)&&this.resizeManipulators.some((t=>t.dragging))?(e.xScale=i[0].value/this.sizeStart[0].value,e.yScale=i[1].value/this.sizeStart[1].value):(e.xScale=1,e.yScale=1),e)}_graphicDrapedChanged(){this.handles.remove(Ct),this._updateDisplayBounds(),this.graphicState.isDraped&&this.handles.add(this.view.elevationProvider.on("elevation-change",(t=>{o(this.attachmentOrigin)&&j(t.extent,this.attachmentOrigin.x,this.attachmentOrigin.y)&&this._updateDisplayBounds()})),Ct)}_updateAllManipulatorAvailability(){this._forEachManipulator(((t,e)=>this._updateManipulatorAvailability(t,e)))}_updateManipulatorAvailability(t,e){const i=this.grabbing&&!t.grabbing;if(t.interactive=!i,t instanceof it){const a=this.graphicState.displaying,s=this.enableZ&&pt(this.graphic);switch(e){case nt.ROTATE:t.available=a&&this.enableRotation;break;case nt.SCALE:t.available=a&&(this.enableScaling||this.enableRotation||s),t.interactive=!i&&this.enableScaling,t.state=this.enableScaling?H:F;break;case nt.TRANSLATE_Z:t.available=a&&s;break;default:t.available=a}}}_forEachManipulator(t){this.graphicMoveManipulation.forEachManipulator(t),this.resizeManipulators.forEach((e=>t(e,nt.SCALE))),t(this.rotateManipulator,nt.ROTATE),t(this.moveZManipulator,nt.TRANSLATE_Z)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(t){this._preserveAspectRatio.enabled=t,this._set("preserveAspectRatio",t)}get _moveUnit(){return r(u(this.view.spatialReference),"meters")}reset(){}_onGeometryChanged(){this._updateDisplayBounds()}_calculateMapBounds(){const t=this.graphic.geometry,e=this.editGeometryOperations.data,i=e.components[0].edges[0],a=_(U.get(),i.leftVertex.pos,i.rightVertex.pos);S(a,a);const s=r(at(this.view,this.graphic),(()=>t.extent.center));let o=Xt*this.view.pixelSizeAt(s);const n=this.view.spatialReference,p=t.spatialReference;n.equals(p)||(o*=m(n)/m(p)),Bt(a,e,o,this.mapBounds),this._updateZMax()}_updateZMax(){const t=this.editGeometryOperations.data;if(!t.geometry.hasZ)return void(this.zmax=0);const e=t.coordinateHelper;let i=Number.NEGATIVE_INFINITY;for(const a of t.components)for(const t of a.vertices){const a=e.getZ(t.pos);i=Math.max(a,i)}this.zmax=i}_updateDisplayBounds(){const t=this.graphic.geometry;if(n(t))return;const e=o(this.outlineVisualElement)&&!this.graphicState.isDraped&&o(this.outlineVisualElement.attachmentOrigin)?this.outlineVisualElement.attachmentOrigin:at(this.view,this.graphic);this.attachmentOrigin=r(e,t.extent.center);const i=o(e)?e.z:mt(this.mapBounds.origin,this.view.elevationProvider,gt.fromElevationInfo(k(this.graphic)),this.view.renderCoordsHelper),a=D(this.mapBounds);a.origin[2]=i,At(a,this.view.renderCoordsHelper,t.spatialReference,this._displayBoundsMargin,this.displayBounds),this._updateManipulators()}get _displayBoundsMargin(){const t=this.view.pointsOfInterest,e=t?t.centerOnSurfaceFrequent.location:this.editGeometryOperations.data.geometry.extent.center;return kt*this.view.pixelSizeAt(e)}_createMoveXYGraphicDragPipeline(){return this.graphicMoveManipulation.createDragPipeline(((t,e,i)=>this._applyGraphicMoveSteps(e,i,ht.XY)))}_createMoveZDragPipeline(){const t=this.view,e=this.editGeometryOperations.data.spatialReference;return ft(this.moveZManipulator,((i,a,s)=>{const o=R(i.renderLocation),r=a.next(ot(t,o,e)).next(St());this._applyGraphicMoveSteps(r,s,ht.Z)}))}_applyGraphicMoveSteps(t,e,i){const a=t.next((t=>("start"===t.action&&(this.inputState={type:"move"},this._updateOperationStartProperties(),this.emit("graphic-translate-start",{graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY})),t))).next(_t()).next(this._moveDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,dxScreen:t.screenDeltaX,dyScreen:t.screenDeltaY};switch(t.action){case"start":case"update":(t.mapEnd.x-t.mapStart.x||t.mapEnd.y-t.mapStart.y||t.mapEnd.z-t.mapStart.z)&&this.emit("graphic-translate",e);break;case"end":this.inputState=null,this.emit("graphic-translate-stop",e)}return t})).next((t=>this._updateMoveTooltip(t,i)));return e.next((()=>{o(this.inputState)&&this.emit("graphic-translate-stop",{graphic:this.graphic,dxScreen:0,dyScreen:0}),this._cancel()})),a}_updateOperationStartProperties(){D(this.displayBounds,this.displayBoundsStart),D(this.mapBounds,this.mapBoundsStart),n(this.graphic.geometry)?this.sizeStart=null:this.sizeStart=xt(this.mapBoundsStart,this.zmax,this.graphic.geometry.spatialReference,this.graphicState.isDraped)}_moveDragUpdateGeometry(){return t=>{if(n(this.inputState)||"move"!==this.inputState.type)return t;const e=[];for(const s of this.editGeometryOperations.data.components)e.push(...s.vertices);const i="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,a=this.editGeometryOperations.moveVertices(e,t.mapDeltaX,t.mapDeltaY,t.mapDeltaZ,i);return Ot(a,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_updateMoveTooltip(t,e){if(e===ht.XY||e===ht.XY_AXIS){const e=It(t.mapStart,t.mapEnd,this.graphicState.isDraped?"on-the-ground":"absolute-height");o(e)&&o(this._moveXYTooltipInfo)&&(this._moveXYTooltipInfo.distance=e)}return t}_onResizeGrab(t){if("start"!==t.action)return;const e=this._calculatePickRay(t.screenPoint);w(this.displayBounds.plane,e,Z.get())&&(this._updateOperationStartProperties(),this.displayBoundsMarginStart=this._displayBoundsMargin,this.inputState={type:"resize"})}_createResizeDragPipeline(t,e){return ft(t,((t,i,a)=>{n(this.inputState)||(i.next((t=>("start"===t.action&&this.emit("graphic-scale-start",{graphic:this.graphic,xScale:1,yScale:1}),t))).next(rt(this.view,this.displayBoundsStart.plane)).next((t=>({...t,handle:e}))).next(this._resizeDragRenderPlaneToFactors()).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(this._resizeDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,xScale:t.factor1,yScale:t.factor2};switch(t.action){case"start":case"update":this.emit("graphic-scale",e);break;case"end":this.inputState=null,this.emit("graphic-scale-stop",e)}return t})),a.next((()=>{o(this.inputState)&&this.emit("graphic-scale-stop",{graphic:this.graphic,xScale:1,yScale:1}),this._cancel()})))}))}_resizeDragRenderPlaneToFactors(){return t=>{const e=this.displayBoundsStart,i=t.handle.direction,a=this._displayBoundsMargin,s=this.displayBoundsMarginStart,o=b(Z.get(),e.origin);T(o,o,e.basis1,-i[0]),T(o,o,e.basis2,-i[1]);const r=E(Z.get(),t.renderEnd,o),n=E(Z.get(),t.renderStart,o),p=q(t.handle),l=W(e),h=W(this.displayBounds)/l,c=(t,e)=>{if(0===t)return 1;let i=B(e),o=.5*t*A(e,r)/i;const l=o<0?-1:1;if(p){o+=(i-.5*t*A(e,n)/i)*l*h}const c=i<1.5*s?1:Yt;return i=Math.max(i-s,Yt),l>0&&(o-=a),l*Math.max(l*(o/i),c)};return{...t,factor1:c(i[0],e.basis1),factor2:c(i[1],e.basis2)}}}_resizeDragUpdateGeometry(){return t=>{const e=b(O(),this.mapBoundsStart.origin);T(e,e,this.mapBoundsStart.basis1,-t.handle.direction[0]),T(e,e,this.mapBoundsStart.basis2,-t.handle.direction[1]);const i=f(M(),this.mapBoundsStart.basis1[0],this.mapBoundsStart.basis1[1]);S(i,i);const a=[];for(const r of this.editGeometryOperations.data.components)a.push(...r.vertices);const s="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,o=this.editGeometryOperations.scaleVertices(a,e,i,t.factor1,t.factor2,s,Et.REPLACE);return D(this.mapBoundsStart,this.mapBounds),Ot(o,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_onRotateGrab(t){if("start"!==t.action)return;const e=J(this.displayBounds,this.view.renderCoordsHelper,K.HEADING,P()),i=this._calculatePickRay(t.screenPoint);w(e,i,Z.get())&&(this._updateOperationStartProperties(),this.inputState={type:"rotate",rotatePlane:e})}_createRotateDragPipeline(t){return ft(t,((t,e,i)=>{const a=this.inputState;n(a)||(e.next((t=>("start"===t.action&&this.emit("graphic-rotate-start",{graphic:this.graphic,angle:0}),t))).next(rt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdateGeometry()).next((t=>{const e={graphic:this.graphic,angle:s(t.rotateAngle)};switch(t.action){case"start":case"update":this.emit("graphic-rotate",e);break;case"end":this.inputState=null,this.emit("graphic-rotate-stop",e)}return t})),i.next((()=>{o(this.inputState)&&this.emit("graphic-rotate-stop",{graphic:this.graphic,angle:0}),this._cancel()})))}))}_rotateDragRenderPlaneToRotate(t){return e=>{const i=z(t.rotatePlane),a=st(e.renderStart,e.renderEnd,this.displayBounds.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdateGeometry(){return t=>{const e=b(O(),this.mapBoundsStart.origin),i=[];for(const o of this.editGeometryOperations.data.components)i.push(...o.vertices);const a="start"===t.action?Tt.NEW_STEP:Tt.ACCUMULATE_STEPS,s=this.editGeometryOperations.rotateVertices(i,e,t.rotateAngle,a,Et.REPLACE);return D(this.mapBoundsStart,this.mapBounds),Ot(s,this.mapBounds),this.graphic.geometry=this.editGeometryOperations.data.geometry,t}}_calculatePickRay(t){const e=I(),i=d(t);return yt(this.view.state.camera,i,e),x(e.direction,e.direction),e}_updateManipulators(){if(!this.visible)return;const t=Q(this.displayBounds,C.get());$(this.rotateManipulator,t,this.displayBounds,this.view.renderCoordsHelper),this._updateZMoveHandle(this.moveZManipulator,t),this.resizeManipulators.forEach(((e,i)=>{tt(e,this.resizeHandles[i],t,this.displayBounds)}))}_updateZMoveHandle(t,e){const i=this.displayBounds,a={basis:i.basis1,direction:-1,position:E(Z.get(),i.origin,i.basis1),edge:2},s=C.get();y(s,e,a.edge*Math.PI/2),s[12]=0,s[13]=0,s[14]=0,t.modelTransform=s,t.renderLocation=a.position}_cancel(){const t=this.editGeometryOperations.lastOperation;n(t)||(this.editGeometryOperations.undo(),this.graphic.geometry=this.editGeometryOperations.data.geometry,Rt(t,this.mapBounds),this._updateDisplayBounds(),this.inputState=null)}get canUndo(){return this.editGeometryOperations.canUndo}undo(){if(o(this.inputState))this.view.activeTool=null;else if(this.canUndo){const t=this.editGeometryOperations.undo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Rt(p(t),this.mapBounds),this._updateDisplayBounds()}}get canRedo(){return this.editGeometryOperations.canRedo}redo(){if(this.canRedo){const t=this.editGeometryOperations.redo();this.graphic.geometry=this.editGeometryOperations.data.geometry,Ot(p(t),this.mapBounds),this._updateDisplayBounds()}}get test(){return{resizeManipulators:this.resizeManipulators,rotateManipulator:this.rotateManipulator,moveZManipulator:this.moveZManipulator,tooltip:this._tooltip}}};t([g({constructOnly:!0,nonNullable:!0})],Zt.prototype,"view",void 0),t([g({constructOnly:!0,nonNullable:!0})],Zt.prototype,"graphic",void 0),t([g({constructOnly:!0,nonNullable:!0})],Zt.prototype,"enableZ",void 0),t([g()],Zt.prototype,"enableRotation",void 0),t([g()],Zt.prototype,"enableScaling",void 0),t([g({constructOnly:!0,type:jt})],Zt.prototype,"tooltipOptions",void 0),t([g()],Zt.prototype,"preserveAspectRatio",null),t([g()],Zt.prototype,"grabbing",void 0),t([g()],Zt.prototype,"inputState",void 0),t([g({readOnly:!0})],Zt.prototype,"type",void 0),t([g()],Zt.prototype,"_moveUnit",null),Zt=t([v("esri.views.3d.interactive.editingTools.graphicTransform3D.ExtentTransformTool")],Zt);const Ct="draped-elevation-changes",kt=10,Xt=80,Yt=1e-6;export{Yt as EPSILON,Zt as ExtentTransformTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../../chunks/tslib.es6.js";import e from"../../../../../core/Evented.js";import{HandleOwnerMixin as i}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isNone as o,isSome as s,destroyMaybe as n}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as p}from"../../../../../core/reactiveUtils.js";import{property as l}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as c}from"../../../../../core/accessorSupport/decorators/subclass.js";import h from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as m}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as d}from"../../../../ViewingMode.js";import{Manipulator3D as u}from"../../Manipulator3D.js";import{placeAtGraphic as g}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as v}from"../../SnappingVisualizer3D.js";import{ManipulatorType as _}from"../ManipulatorType.js";import{canMoveZ as f}from"../manipulatorUtils.js";import{createVisualElements as M}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as y}from"../manipulations/config.js";import{MoveManipulation as S,ManipulationType as R}from"../manipulations/MoveManipulation.js";import{GraphicScaleRotateTransform as b}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as w}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as j}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as A}from"./undoRecords.js";import{GraphicState as O}from"../../../layers/graphics/GraphicState.js";import{InteractiveToolBase as T}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as x}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import G from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as E}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as z}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as U}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateZTooltipInfo as L,TranslateGraphicTooltipInfo as C}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as P}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as Z}from"../../../../support/euclideanLengthMeasurementUtils.js";let k=class extends(i(e.EventedMixin(T))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new G,this.type="transform-3d",this._scaleRotate=null,this._snappingPipeline=new z,this._tooltip=null}initialize(){const{graphic:t,view:e}=this;this.graphicState=new O({graphic:t}),this.addHandles(r((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new U({view:e}):n(this._tooltip)}),p)),this._moveManipulation=new S({tool:this,view:e,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&f(t),radius:S.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator(((e,i)=>this.handles.add([e.events.on("immediate-click",(e=>{this.emit("immediate-click",{...e,graphic:t}),e.stopPropagation()})),e.events.on("focus-changed",(({action:t})=>{const{tooltipOptions:e,_tooltip:a}=this;if(!o(a)&&(a.clear(),"focus"===t)){const t=i===_.TRANSLATE_Z?L:C;a.info=new t({tooltipOptions:e})}}))]))),this._moveManipulation.elevationInfo=m(t);const i=t.geometry;if(this._moveManipulation.createGraphicDragPipeline(((a,n,r,p,l)=>(s(i)&&a===R.XY&&(r=r.next(this._snappingPipeline.createSnapDragEventPipelineStep({snappingContext:new E({elevationInfo:m(t),pointer:l,editGeometryOperations:x.fromGeometry(new h({spatialReference:i.spatialReference}),e.state.viewingMode),visualizer:new v,excludeFeature:t}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,cancel:p}),this._snappingPipeline.next)),r=r.next((t=>{const{tooltipOptions:e,_tooltip:i}=this;if(o(i))return t;const{mapStart:n,mapEnd:r}=t;i.clear();const p=a===R.Z?L:C;if("end"===t.action)i.info=new p({tooltipOptions:e});else{const t=a===R.Z?Z(n,r):P(n,r,this.graphicState.isDraped?"on-the-ground":"absolute-height");s(t)&&(i.info=new p({tooltipOptions:e,distance:t}))}return t})))),this.graphicState,(t=>{const{action:e,graphic:i,dxScreen:a,dyScreen:o}=t,s={graphic:i,dxScreen:a,dyScreen:o};switch(e){case"start":this.emit("graphic-translate-start",s),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",s);break;case"end":this.emit("graphic-translate-stop",s)}})),this._moveManipulation.angle=s(this._scaleRotate)?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(r((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new b({tool:this,mode:t,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.handles.add(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([M({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),r((()=>e.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof u&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this._tooltip=n(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=n(this._scaleRotate),this._scaleRotateAdapter=n(this._scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){o(this._scaleRotate)||(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){return s(this.graphic.geometry)&&"mesh"===this.graphic.geometry.type?new w({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new j({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer)),sizeAxis:s(this.tooltipOptions.visualVariables)&&s(this.tooltipOptions.visualVariables.size)?this.tooltipOptions.visualVariables.size.axis:null})}_forEachManipulator(t){this._moveManipulation.forEachManipulator(t),s(this._scaleRotate)&&this._scaleRotate.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return r((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((e=>e.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&f(this.graphic)}))}_createGeometryUndoRecord(){return A(this.graphic)}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this._moveManipulation.location=t,s(this._scaleRotate)&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,s(this._scaleRotate)&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){s(this._scaleRotate)&&this._scaleRotate.cancelActiveAnimation()}_onScaleChanged(){if(o(this._scaleRotate))return;const t=this._scaleRotate.getScale();this._moveManipulation.displayScale=t}_updateMoveAngle(){this.view.state.viewingMode===d.Local||this.view.scale<y?this._moveManipulation.angle=this._scaleRotateAdapter.angle:this._moveManipulation.angle=0}_onGeometryChanged(){g(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:s(this._scaleRotate)?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate,tooltip:this._tooltip}}};t([l({constructOnly:!0,nonNullable:!0})],k.prototype,"view",void 0),t([l({constructOnly:!0,nonNullable:!0})],k.prototype,"graphic",void 0),t([l({constructOnly:!0,nonNullable:!0})],k.prototype,"enableZ",void 0),t([l()],k.prototype,"enableRotation",void 0),t([l()],k.prototype,"enableScaling",void 0),t([l({constructOnly:!0,type:G})],k.prototype,"tooltipOptions",void 0),t([l()],k.prototype,"graphicState",void 0),t([l({value:!1})],k.prototype,"snapToScene",null),t([l({constructOnly:!0})],k.prototype,"snappingManager",void 0),t([l({readOnly:!0})],k.prototype,"type",void 0),t([l({readOnly:!0})],k.prototype,"updating",null),k=t([c("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],k);export{k as GraphicTransformTool};
|
|
5
|
+
import{_ as t}from"../../../../../chunks/tslib.es6.js";import i from"../../../../../core/Evented.js";import{HandleOwnerMixin as e}from"../../../../../core/HandleOwner.js";import{makeHandle as a}from"../../../../../core/handleUtils.js";import{isNone as o,isSome as n,destroyMaybe as s}from"../../../../../core/maybe.js";import{scale as r,zeroMeters as p}from"../../../../../core/quantityUtils.js";import{watch as l,syncAndInitial as c}from"../../../../../core/reactiveUtils.js";import{property as h}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/arrayUtils.js";import"../../../../../core/has.js";import"../../../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import d from"../../../../../geometry/Point.js";import{getGraphicEffectiveElevationInfo as u}from"../../../../../support/elevationInfoUtils.js";import{ViewingMode as g}from"../../../../ViewingMode.js";import{Manipulator3D as v}from"../../Manipulator3D.js";import{placeAtGraphic as _}from"../../manipulatorUtils.js";import{SnappingVisualizer3D as M}from"../../SnappingVisualizer3D.js";import{canMoveZ as f}from"../manipulatorUtils.js";import{createVisualElements as y}from"../visualElementUtils.js";import{ALIGN_ARROWS_SCALE_THRESHOLD as S}from"../manipulations/config.js";import{MoveManipulation as R,ManipulationType as b}from"../manipulations/MoveManipulation.js";import{axisConstrainedDragSign as w}from"../manipulations/moveUtils.js";import{GraphicScaleRotateTransform as j}from"./GraphicScaleRotateTransform.js";import{ScaleRotateMeshAdapter as A}from"./ScaleRotateMeshAdapter.js";import{ScaleRotateObjectSymbol3DAdapter as T}from"./ScaleRotateObjectSymbol3DAdapter.js";import{createGraphicGeometryUndoRecord as O}from"./undoRecords.js";import{GraphicState as x}from"../../../layers/graphics/GraphicState.js";import{InteractiveToolBase as E}from"../../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as G}from"../../../../interactive/editGeometry/EditGeometryOperations.js";import z from"../../../../interactive/sketch/SketchTooltipOptions.js";import{SnappingContext as U}from"../../../../interactive/snapping/SnappingContext.js";import{SnappingPipeline as D}from"../../../../interactive/snapping/SnappingDragPipelineStep.js";import{Tooltip as k}from"../../../../interactive/tooltip/Tooltip.js";import{TranslateGraphicZTooltipInfo as C,TranslateGraphicXYTooltipInfo as I,TranslateGraphicTooltipInfo as L}from"../../../../interactive/tooltip/TranslateTooltipInfos.js";import{autoHorizontalDistanceByElevationModeBetweenPoints as P}from"../../../../support/automaticLengthMeasurementUtils.js";import{verticalSignedDistanceBetweenPoints as Z}from"../../../../support/euclideanLengthMeasurementUtils.js";let V=class extends(e(i.EventedMixin(E))){constructor(t){super(t),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new z,this.type="transform-3d",this._scaleRotate=null,this._snappingPipeline=new D,this._tooltip=null}initialize(){const{graphic:t,view:i}=this;this.graphicState=new x({graphic:t}),this.addHandles(l((()=>this.tooltipOptions.enabled),(t=>{this._tooltip=t?new k({view:i}):s(this._tooltip)}),c)),this._moveManipulation=new R({tool:this,view:i,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&f(t),radius:R.radiusForSymbol(t.symbol)}),this._moveManipulation.forEachManipulator((i=>this.handles.add(i.events.on("immediate-click",(i=>{this.emit("immediate-click",{...i,graphic:t}),i.stopPropagation()})))));const e=t=>i=>{this.handles.add(i.events.on("focus-changed",(({action:i})=>{const e=this._tooltip;o(e)||("focus"===i?this._updateMoveTooltip(t):e.clear())})))};this._moveManipulation.xyManipulation.forEachManipulator(e(b.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(b.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(b.Z)),this._moveManipulation.elevationInfo=u(t);const r=t.geometry;if(this._moveManipulation.createGraphicDragPipeline(((e,a,o,s,p)=>(n(r)&&e===b.XY&&(o=o.next(this._snappingPipeline.createSnapDragEventPipelineStep({snappingContext:new U({elevationInfo:u(t),pointer:p,editGeometryOperations:G.fromGeometry(new d({spatialReference:r.spatialReference}),i.state.viewingMode),visualizer:new M,excludeFeature:t}),snappingManager:this.snappingManager,updatingHandles:this.updatingHandles,cancel:s}),this._snappingPipeline.next)),o=o.next((t=>(this._updateMoveTooltip(e,t),t))))),this.graphicState,(t=>{const{action:i,graphic:e,dxScreen:a,dyScreen:o}=t,n={graphic:e,dxScreen:a,dyScreen:o};switch(i){case"start":this.emit("graphic-translate-start",n),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",n);break;case"end":this.emit("graphic-translate-stop",n)}})),this._moveManipulation.angle=n(this._scaleRotate)?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.handles.add(l((()=>this._scaleRotateAdapter.angle),(()=>this._updateMoveAngle()))),this.enableScaling||this.enableRotation){const t=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new j({tool:this,mode:t,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.handles.add(this._scaleRotate.events.on("scale-changed",(()=>this._onScaleChanged())))}this.handles.add([y({view:this.view,graphic:this.graphic,forEachManipulator:t=>this._forEachManipulator(t),onManipulatorsChanged:()=>a()}),this.graphicState.on("changed",(()=>this._onGeometryChanged())),this._hideManipulatorsForGraphicState(),l((()=>i.scale),(()=>this._updateMoveAngle()))]),this.handles.add(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator((t=>{t instanceof v&&this.handles.add(t.events.on("grab-changed",(()=>this._updateManipulatorsInteractive())))})),this.finishToolCreation()}destroy(){this._tooltip=s(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=s(this._scaleRotate),this._scaleRotateAdapter=s(this._scaleRotateAdapter),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){o(this._scaleRotate)||(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){return n(this.graphic.geometry)&&"mesh"===this.graphic.geometry.type?new A({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new T({graphic:this.graphic,sizeFilter:t=>this._enforceNonZeroSize(t),findLayerView:()=>this.view.allLayerViews.find((t=>t.layer===this.graphic.layer)),sizeAxis:n(this.tooltipOptions.visualVariables)&&n(this.tooltipOptions.visualVariables.size)?this.tooltipOptions.visualVariables.size.axis:null})}_forEachManipulator(t){this._moveManipulation.forEachManipulator(t),n(this._scaleRotate)&&this._scaleRotate.forEachManipulator(t)}_hideManipulatorsForGraphicState(){return l((()=>this.graphicState.displaying),(t=>{this._forEachManipulator((i=>i.available=t)),this._moveManipulation.zManipulation.available=t&&this.enableZ&&f(this.graphic)}))}_createGeometryUndoRecord(){return O(this.graphic)}set snapToScene(t){this._moveManipulation&&(this._moveManipulation.snapToScene=t),this._set("snapToScene",t)}get updating(){return this.updatingHandles.updating}set location(t){this._moveManipulation.location=t,n(this._scaleRotate)&&(this._scaleRotate.location=t)}set elevationAlignedLocation(t){this._moveManipulation.elevationAlignedLocation=t,n(this._scaleRotate)&&(this._scaleRotate.elevationAlignedLocation=t)}reset(){}onHide(){n(this._scaleRotate)&&this._scaleRotate.cancelActiveAnimation()}_onScaleChanged(){if(o(this._scaleRotate))return;const t=this._scaleRotate.getScale();this._moveManipulation.displayScale=t}_updateMoveAngle(){this.view.state.viewingMode===g.Local||this.view.scale<S?this._moveManipulation.angle=this._scaleRotateAdapter.angle:this._moveManipulation.angle=0}_onGeometryChanged(){_(this.view,this,this.graphic)}_enforceNonZeroSize(t){return t||this.view.state.camera.computeRenderPixelSizeAt(this._moveManipulation.renderLocation)}_updateMoveTooltip(t,i){const{tooltipOptions:e,_tooltip:a}=this;if(o(a))return;a.clear();const n=this.graphicState.isDraped?"on-the-ground":"absolute-height";switch(t){case b.XY:a.info=new L({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,((t,i)=>P(t,i,n)));break;case b.XY_AXIS:a.info=new I({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,((t,e)=>{const a=P(t,e,n);return r(a,w(i))}));break;case b.Z:a.info=new C({tooltipOptions:e}),this._updateMoveTooltipDistance(a.info,i,Z)}}_updateMoveTooltipDistance(t,i,e){if(n(i)&&"end"!==i.action){const{mapStart:a,mapEnd:o}=i,s=e(a,o);t.distance=n(s)?s:p}}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:n(this._scaleRotate)?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate,tooltip:this._tooltip}}};t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"view",void 0),t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"graphic",void 0),t([h({constructOnly:!0,nonNullable:!0})],V.prototype,"enableZ",void 0),t([h()],V.prototype,"enableRotation",void 0),t([h()],V.prototype,"enableScaling",void 0),t([h({constructOnly:!0,type:z})],V.prototype,"tooltipOptions",void 0),t([h()],V.prototype,"graphicState",void 0),t([h({value:!1})],V.prototype,"snapToScene",null),t([h({constructOnly:!0})],V.prototype,"snappingManager",void 0),t([h({readOnly:!0})],V.prototype,"type",void 0),t([h({readOnly:!0})],V.prototype,"updating",null),V=t([m("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],V);export{V as GraphicTransformTool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../geometry.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{isSome as r,isNone as o,unwrap as a}from"../../core/maybe.js";import{createScreenPoint as
|
|
5
|
+
import"../../geometry.js";import{handlesGroup as t}from"../../core/handleUtils.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{isSome as r,isNone as o,unwrap as a}from"../../core/maybe.js";import{createScreenPoint as s}from"../../core/screenUtils.js";import{f as c}from"../../chunks/vec3f64.js";import{project as i}from"../../geometry/projection.js";import{hydratedSpatialReference as l}from"../../layers/graphics/hydratedFeatures.js";import{ViewingMode as u}from"../ViewingMode.js";import{move as m}from"../draw/support/drawUtils.js";import f from"../../geometry/Point.js";function p(t,n){let e=null,a=null;return s=>{if("cancel"===s.action)return void(r(a)&&(a.execute({action:"cancel"}),e=null,a=null));const c={action:s.action,screenStart:s.start,screenEnd:s.screenPoint};"start"===s.action&&o(e)&&(e=new P,a=new P,n(t,e,a,s.pointerType,c)),r(e)&&e.execute(c),"end"===s.action&&r(e)&&(e=null,a=null)}}function y(t,n){return t.events.on("drag",p(t,n))}function d(n,e){const r=[];for(const t of n)r.push(y(t,e));return t(r)}function x(t,n){const e=[t.x,t.y,t.z],r=n,o=[Math.cos(r),Math.sin(r)],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);if(0===a)return null;o[0]/=a,o[1]/=a;const s=t=>{const n=(t.x-e[0])*o[0]+(t.y-e[1])*o[1];t.x=e[0]+n*o[0],t.y=e[1]+n*o[1]};return t=>(s(t.mapStart),s(t.mapEnd),{...t,axis:o})}function g(t,n){let e=null;return r=>{if("start"===r.action&&(e=E(t,r.mapStart.spatialReference,n)),o(e))return null;const a=r.mapEnd.x-r.mapStart.x,s=r.mapEnd.y-r.mapStart.y,c=r.mapEnd.z-r.mapStart.z;return e.move(a,s,c),{...r,translationX:a,translationY:s,translationZ:c}}}function h(t,n){return o(t)?null:t.spatialReference.equals(n)?t.clone():i(t,n)}function E(t,n,e){const r=t.geometry,a=l(n);if(o(r))return null;if("mesh"===r.type)return S(t,r,a,e);const s=h(r,a),c=r.spatialReference;return o(s)?null:{move:(n,e,r)=>{const o=m(s.clone(),n,e,r);o.spatialReference.equals(c)?t.geometry=o:t.geometry=i(o,c)}}}function S(t,n,e,o){if(r(n.transform))return j(t,n,n.transform,e);if(!n.spatialReference.equals(e))return null;let a=0,s=0,c=0;return{move:(e,r,i)=>{const l=e-a,m=r-s,p=i-c;if(l||m||p){const y=new f(n.origin.x+l,n.origin.y+m,n.origin.z+p,n.origin.spatialReference);n.centerAt(y,{geographic:o===u.Global}),t.notifyGeometryChanged(),a=e,s=r,c=i}}}}function j(t,n,e,a){const s=h(e.getOriginPoint(n.spatialReference),a),l=n.spatialReference;return o(s)?null:{move:(n,o,a)=>{const u=m(s.clone(),n,o,a);if(u.spatialReference.equals(l))e.origin=c(u.x,u.y,u.z);else{const t=i(u,l);r(t)&&(e.origin=c(t.x,t.y,t.z))}t.notifyMeshTransformChanged(),t.notifyGeometryChanged()}}}function R(t,n=null,e){let a=null;const s=r(n)&&!t.spatialReference.equals(n)?t=>r(t)?i(t,n):t:t=>t,c={exclude:[],...e};return n=>{if("start"===n.action&&(a=s(t.toMap(n.screenStart,c))),o(a))return null;const e=s(t.toMap(n.screenEnd,c));return r(e)?{...n,mapStart:a,mapEnd:e}:null}}function z(t,n){const e=t.map((t=>a(g(t,n)))).filter((t=>r(t)));return t=>{const n=t.mapEnd.x-t.mapStart.x,r=t.mapEnd.y-t.mapStart.y,o=t.mapEnd.z-t.mapStart.z;return e.forEach((n=>n(t))),{...t,translationX:n,translationY:r,translationZ:o}}}function w(t,e){const r=new Map;for(const o of e)r.set(o,n(t[o]));return n=>(r.forEach(((n,e)=>{t[e]=n})),n)}function v(t){return r(t.geometry)&&"mesh"===t.geometry.type?M(t,t.geometry):w(t,["geometry"])}function M(t,n){const e=r(n.transform)?n.transform.clone():null,o=n.vertexAttributes.clonePositional();return r=>(n.transform=e,n.vertexAttributes=o,t.notifyGeometryChanged(),r)}function q(t){const n=t.map((t=>a(v(t)))).filter((t=>r(t)));return t=>(n.forEach((n=>n(t))),t)}function D(t){return w(t,["symbol"])}function b(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z);const o=r.mapEnd.x-t,a=r.mapEnd.y-n,s=r.mapEnd.z-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:o,mapDeltaY:a,mapDeltaZ:s,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function C(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,o=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:o}}}function G(t,n){let r=null,o=0,a=0;return c=>{if("start"===c.action&&(r=t.toScreen(n),r.x<0||r.x>t.width||r.y<0||r.y>t.height?r=null:(o=c.screenStart.x-r.x,a=c.screenStart.y-r.y)),null==r)return null;const i=e(c.screenEnd.x-o,0,t.width),l=e(c.screenEnd.y-a,0,t.height),u=s(i,l);return c.screenStart=r,c.screenEnd=u,c}}class P{constructor(){this.execute=()=>{}}next(t,n=new P){return r(t)&&(this.execute=e=>{const o=t(e);r(o)&&n.execute(o)}),n}}export{P as EventPipeline,b as addMapDelta,C as addScreenDelta,x as constrainToMapAxis,p as createDragEventPipelineCallback,y as createManipulatorDragEventPipeline,d as createManipulatorDragEventPipelineMany,G as dragAtLocation,g as dragGraphic,z as dragGraphicMany,v as resetGraphic,q as resetGraphicMany,w as resetProperties,D as resetSymbol,R as screenToMap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{zeroMeters as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{zeroMeters as e}from"../../../core/quantityUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as s}from"./SketchTooltipInfo.js";let r=class extends s{constructor(t){super(t),this.type="translate-graphic",this.distance=e}};t([o()],r.prototype,"type",void 0),t([o()],r.prototype,"distance",void 0),r=t([i("esri.views.interactive.tooltip.TranslateGraphicTooltipInfo")],r);let p=class extends s{constructor(t){super(t),this.type="translate-graphic-z",this.distance=e}};t([o()],p.prototype,"type",void 0),t([o()],p.prototype,"distance",void 0),p=t([i("esri.views.interactive.tooltip.TranslateGraphicZTooltipInfo")],p);let a=class extends s{constructor(t){super(t),this.type="translate-graphic-xy",this.distance=e}};t([o()],a.prototype,"type",void 0),t([o()],a.prototype,"distance",void 0),a=t([i("esri.views.interactive.tooltip.TranslateGraphicXYTooltipInfo")],a);let n=class extends s{constructor(t){super(t),this.type="translate-vertex",this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}};t([o()],n.prototype,"type",void 0),t([o()],n.prototype,"distance",void 0),t([o()],n.prototype,"elevation",void 0),t([o()],n.prototype,"area",void 0),t([o()],n.prototype,"totalLength",void 0),n=t([i("esri.views.interactive.tooltip.TranslateVertexTooltipInfo")],n);let l=class extends s{constructor(t){super(t),this.type="translate-vertex-z",this.distance=e,this.elevation=null}};t([o()],l.prototype,"type",void 0),t([o()],l.prototype,"distance",void 0),t([o()],l.prototype,"elevation",void 0),l=t([i("esri.views.interactive.tooltip.TranslateVertexZTooltipInfo")],l);let c=class extends s{constructor(t){super(t),this.type="translate-vertex-xy",this.distance=e,this.elevation=null,this.area=null,this.totalLength=null}};t([o()],c.prototype,"type",void 0),t([o()],c.prototype,"distance",void 0),t([o()],c.prototype,"elevation",void 0),t([o()],c.prototype,"area",void 0),t([o()],c.prototype,"totalLength",void 0),c=t([i("esri.views.interactive.tooltip.TranslateVertexXYTooltipInfo")],c);export{r as TranslateGraphicTooltipInfo,a as TranslateGraphicXYTooltipInfo,p as TranslateGraphicZTooltipInfo,n as TranslateVertexTooltipInfo,c as TranslateVertexXYTooltipInfo,l as TranslateVertexZTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as
|
|
5
|
+
import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipField as e}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../../widgets/support/jsxFactory.js";const p={base:`${o} ${`${o}--translate-graphic`}`};let c=class extends r{render(){const{distance:s}=this.info,t=this._messagesTooltip?.sketch;return i("div",{class:p.base},i(e,{title:t?.distance,value:this._formatLength(s)}))}};c=s([t("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphic")],c);export{c as TooltipContentTranslateGraphic};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipField as e}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../../widgets/support/jsxFactory.js";const p={base:`${o} ${`${o}--
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipField as e}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../../widgets/support/jsxFactory.js";const p={base:`${o} ${`${o}--translate-graphic-xy`}`};let a=class extends r{render(){const{distance:t}=this.info,s=this._messagesTooltip?.sketch;return i("div",{class:p.base},i(e,{title:s?.distance,value:this._formatRelativeLength(t)}))}};a=t([s("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphicXY")],a);export{a as TooltipContentTranslateGraphicXY};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipField as e}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as i}from"../../../../widgets/support/jsxFactory.js";const p={base:`${o} ${`${o}--translate-graphic-z`}`};let a=class extends r{render(){const{distance:t}=this.info,s=this._messagesTooltip?.sketch;return i("div",{class:p.base},i(e,{title:s?.distance,value:this._formatRelativeVerticalLength(t)}))}};a=t([s("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphicZ")],a);export{a as TooltipContentTranslateGraphicZ};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as r}from"../css.js";import{TooltipContent as s}from"./TooltipContent.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const p={base:`${r} ${`${r}--translate-vertex`}`};let l=class extends s{render(){const{area:t,distance:o,elevation:r,totalLength:s}=this.info,l=this._messagesTooltip?.sketch;return a("div",{class:p.base},a(i,{title:l?.distance,value:this._formatRelativeLength(o)}),e(r)&&a(i,{title:l?.elevation,value:this._formatVerticalLength(r)}),e(t)&&a(i,{title:l?.area,value:this._formatArea(t)}),e(s)&&a(i,{title:l?.totalLength,value:this._formatLength(s)}))}};l=t([o("esri.views.interactive.tooltip.content.TooltipContentTranslateVertexXY")],l);export{l as TooltipContentTranslateVertexXY};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import"../../../../core/Error.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const p={base:`${s} ${`${s}--translate-vertex`}`};let c=class extends r{render(){const{distance:t,elevation:o}=this.info,s=this._messagesTooltip?.sketch;return a("div",{class:p.base},a(i,{title:s?.distance,value:this._formatRelativeVerticalLength(t)}),e(o)&&a(i,{title:s?.elevation,value:this._formatVerticalLength(o)}))}};c=t([o("esri.views.interactive.tooltip.content.TooltipContentTranslateVertexZ")],c);export{c as TooltipContentTranslateVertexZ};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as t}from"../../../../core/maybe.js";import{TooltipContentDrawCircle as o}from"./TooltipContentDrawCircle.js";import{TooltipContentDrawPoint as n}from"./TooltipContentDrawPoint.js";import{TooltipContentDrawPolygon as e}from"./TooltipContentDrawPolygon.js";import{TooltipContentDrawPolyline as r}from"./TooltipContentDrawPolyline.js";import{TooltipContentDrawRectangle as i}from"./TooltipContentDrawRectangle.js";import{TooltipContentExtentRotate as a}from"./TooltipContentExtentRotate.js";import{TooltipContentExtentScale as
|
|
5
|
+
import{isNone as t}from"../../../../core/maybe.js";import{TooltipContentDrawCircle as o}from"./TooltipContentDrawCircle.js";import{TooltipContentDrawPoint as n}from"./TooltipContentDrawPoint.js";import{TooltipContentDrawPolygon as e}from"./TooltipContentDrawPolygon.js";import{TooltipContentDrawPolyline as r}from"./TooltipContentDrawPolyline.js";import{TooltipContentDrawRectangle as i}from"./TooltipContentDrawRectangle.js";import{TooltipContentExtentRotate as a}from"./TooltipContentExtentRotate.js";import{TooltipContentExtentScale as l}from"./TooltipContentExtentScale.js";import{TooltipContentReshapeEdgeOffset as p}from"./TooltipContentReshapeEdgeOffset.js";import{TooltipContentTransformAbsolute as s}from"./TooltipContentTransformAbsolute.js";import{TooltipContentTransformRotate as c}from"./TooltipContentTransformRotate.js";import{TooltipContentTransformScale as f}from"./TooltipContentTransformScale.js";import{TooltipContentTranslateGraphic as m}from"./TooltipContentTranslateGraphic.js";import{TooltipContentTranslateGraphicXY as w}from"./TooltipContentTranslateGraphicXY.js";import{TooltipContentTranslateGraphicZ as T}from"./TooltipContentTranslateGraphicZ.js";import{TooltipContentTranslateVertex as u}from"./TooltipContentTranslateVertex.js";import{TooltipContentTranslateVertexXY as j}from"./TooltipContentTranslateVertexXY.js";import{TooltipContentTranslateVertexZ as C}from"./TooltipContentTranslateVertexZ.js";function x(x,d){if(t(d))return null;const g=document.createElement("div");switch(d.type){case"draw-point":return new n({tooltip:x,info:d,container:g});case"draw-polygon":return new e({tooltip:x,info:d,container:g});case"draw-polyline":return new r({tooltip:x,info:d,container:g});case"draw-rectangle":return new i({tooltip:x,info:d,container:g});case"draw-circle":return new o({tooltip:x,info:d,container:g});case"extent-rotate":return new a({tooltip:x,info:d,container:g});case"extent-scale":return new l({tooltip:x,info:d,container:g});case"transform-absolute":return new s({tooltip:x,info:d,container:g});case"transform-rotate":return new c({tooltip:x,info:d,container:g});case"transform-scale":return new f({tooltip:x,info:d,container:g});case"translate-graphic":return new m({tooltip:x,info:d,container:g});case"translate-graphic-z":return new T({tooltip:x,info:d,container:g});case"translate-graphic-xy":return new w({tooltip:x,info:d,container:g});case"translate-vertex":return new u({tooltip:x,info:d,container:g});case"translate-vertex-z":return new C({tooltip:x,info:d,container:g});case"translate-vertex-xy":return new j({tooltip:x,info:d,container:g});case"reshape-edge-offset":return new p({tooltip:x,info:d,container:g})}}export{x as tooltipContentFactory};
|