@arcgis/core 6.0.0-next.2 → 6.0.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{01b00fbf6a6a22d573ee.js → 122111703528381539cc.js} +1 -1
  3. package/assets/esri/core/workers/chunks/25e6013e2c095629b236.js +1 -0
  4. package/assets/esri/core/workers/chunks/347bf269c2b1583d2dca.js +1 -0
  5. package/assets/esri/core/workers/chunks/{40fb1910f780e78c128c.js → 8b54589f173259c1ba55.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{61ad8306ab79aca79505.js → 8ba32d3a0df4a206ef1c.js} +1 -1
  7. package/assets/esri/core/workers/chunks/b1008bdfca995ebf98ed.js +1 -0
  8. package/assets/esri/core/workers/chunks/d4926545193414cf2f16.js +1 -0
  9. package/assets/esri/core/workers/chunks/{e1ba915dae7747932c0f.js → eb04e1717a1002cda3ab.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{4310c8d2b40ae69c3681.js → fccbb902fe08448f91de.js} +1 -1
  11. package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
  12. package/config.js +1 -1
  13. package/core/arrayUtils.js +1 -1
  14. package/kernel.js +1 -1
  15. package/layers/GeospatialPDFLayer.d.ts +2 -5
  16. package/layers/GeospatialPDFLayer.js +1 -1
  17. package/layers/ParquetLayer.d.ts +8 -1
  18. package/layers/ParquetLayer.js +1 -1
  19. package/layers/geospatialPDF/renderExtentUtils.js +1 -1
  20. package/package.json +3 -3
  21. package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
  22. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  23. package/views/DOMContainer.d.ts +1 -0
  24. package/views/layers/FeatureLikeLayerView.d.ts +1 -0
  25. package/views/layers/GraphicsLayerView.d.ts +1 -0
  26. package/views/layers/ImageryLayerView.d.ts +1 -0
  27. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  28. package/widgets/OrientedImageryViewer/types.d.ts +20 -0
  29. package/widgets/OrientedImageryViewer.d.ts +9 -1
  30. package/assets/esri/core/workers/chunks/1f3148cebee1961249a4.js +0 -1
  31. package/assets/esri/core/workers/chunks/380cc538c1ab453870fa.js +0 -1
  32. package/assets/esri/core/workers/chunks/ae2181805d8ba130babc.js +0 -1
  33. package/assets/esri/core/workers/chunks/d6d5a9e73ee43d6066d3.js +0 -1
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8902],{66131(e,t,i){i.d(t,{lY:()=>c,mT:()=>m});var r=i(59534),s=i(799),n=i(3330),o=i(84741),a=i(34747);const l={TimeZoneNotRecognized:"Timezone identifier has not been recognized."};class u extends Error{constructor(e,t){super((0,s.HC)(l[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,u)}}function h(e,t,i){return e<t?e-t:e>i?e-i:0}function d(e,t,i){return e<t?t:e>i?i:e}class c{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,i=1,r=0,s=0,n=0,o=0,l){if(isNaN(e)||isNaN(t)||isNaN(i)||isNaN(r)||isNaN(s)||isNaN(n)||isNaN(o))return null;let u=a.c9.local(e,t).daysInMonth,f=a.c9.fromObject({day:d(i,1,u),year:e,month:d(t,1,12),hour:d(r,0,23),minute:d(s,0,59),second:d(n,0,59),millisecond:d(o,0,999)},{zone:m(l)});return f=f.plus({months:h(t,1,12),days:h(i,1,u),hours:h(r,0,23),minutes:h(s,0,59),seconds:h(n,0,59),milliseconds:h(o,0,999)}),new c(f)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){let i=m(t);return e.isUnknownTimeZone||i===n.GB.instance?c.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,i):new c(e._date.setZone(i))}static dateJSToArcadeDate(e){return new c(a.c9.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){let i=m(t);return new c(a.c9.fromJSDate(e,{zone:i}))}static unknownEpochToArcadeDate(e){return new c(a.c9.fromMillis(e,{zone:n.GB.instance}))}static unknownDateJSToArcadeDate(e){return new c(a.c9.fromMillis(e.getTime(),{zone:n.GB.instance}))}static epochToArcadeDate(e,t="system"){let i=m(t);return new c(a.c9.fromMillis(e,{zone:i}))}static dateTimeToArcadeDate(e){return new c(e)}clone(){return new c(this._date)}changeTimeZone(e){let t=m(e);return c.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){let i=m(t);return e.zone===n.GB.instance||i===n.GB.instance?c.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,i):new c(e.setZone(i))}static nowToArcadeDate(e){let t=m(e);return new c(a.c9.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new c(a.c9.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===c.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===n.GB.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";let e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new c(this._date.plus(e))}diff(e,t){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new c(this._date.toUTC())}toLocal(){return new c(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;let t=a.c9.fromISO(e,{setZone:!0});return new c(t)}}function m(e,t=!0){if(e instanceof a.bo)return e;switch((0,r.B)(e)){case"system":return"system";case"utc":return"UTC";case"unknown":return n.GB.instance}if(/^[+-]?[0-9]{1,2}(:[0-9]{2})?$/.test(e)){let t=a.mQ.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}let i=(0,o.p)(e);if(!i.isValid){if(t)throw new u("TimeZoneNotRecognized");return null}return i}},59534(e,t,i){i.d(t,{B:()=>s,b:()=>n});var r=i(85935);function s(e){return e.toLowerCase().replaceAll(/[\s-]+/g,"")}class n{constructor(e,t){let i=new Map;for(let t of e){let e=s(t);if(i.has(e))throw Error(`${t} already added as ${i.get(e)}`);i.set(e,t)}if(null!=t)for(let[e,r]of t){let t=s(e);if(i.has(t))throw Error(`${e} already associated with ${i.get(t)}`);i.set(t,r)}this._enumMap=i}lookup(e){return this._enumMap.get(s(e))}get(e){let t=this.lookup(e);if(null==t)throw new r.D$("InvalidParameter",null);return t}}},85935(e,t,i){i.d(t,{D$:()=>a,O$:()=>h,i2:()=>d,mT:()=>u,ps:()=>m});var r=i(799);const s={TypeNotAllowedInFeature:"Feature attributes only support dates, numbers, strings, guids.",LogicError:"Logic error - {reason}",CannotCompareDateAndTime:"Cannot compare date or dateonly with timeonly types",NeverReach:"Encountered unreachable logic",AsyncNotEnabled:"Async Arcade must be enabled for this script",ModuleAccessorMustBeString:"Module accessor must be a string",ModuleExportNotFound:"Module has no export with provided identifier",ModulesNotSupported:"Current profile does not support modules",ArrayAccessMustBeNumber:"Array accessor must be a number",FunctionNotFound:"Function not found",FieldNotFound:"Key not found - {key}",CircularModules:"Circular module dependencies are not allowed",Cancelled:"Execution cancelled",UnsupportedHashType:"Type not supported in hash function",IllegalResult:"Value is not a supported return type",PortalRequired:"Portal is required",InvalidParameter:"Invalid parameter",WrongNumberOfParameters:"Call with wrong number of parameters",Unrecognized:"Unrecognized code structure",UnrecognizedType:"Unrecognized type",WrongSpatialReference:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",BooleanConditionRequired:"Conditions must use booleans",NoFunctionInDictionary:"Dictionaries cannot contain functions.",NoFunctionInArray:"Arrays cannot contain functions.",NoFunctionInTemplateLiteral:"Template Literals do not expect functions by value.",KeyAccessorMustBeString:"Accessor must be a string",KeyMustBeString:"Object keys must be a string",Immutable:"Object is immutable",UnexpectedToken:"Unexpected token",MemberOfNull:"Cannot access property of null object",MaximumCallDepth:"Exceeded maximum function depth",OutOfBounds:"Out of bounds",InvalidIdentifier:"Identifier not recognized",CallNonFunction:"Expression is not a function",InvalidMemberAccessKey:"Cannot access value using a key of this type",AssignModuleFunction:"Cannot assign function to module variable",UnsupportUnaryOperator:"Unsupported unary operator",UnsupportedOperator:"Unsupported operator",LogicalExpressionOnlyBoolean:"Logical expressions must be boolean",LogicExpressionOrAnd:"Logical expression can only be combined with || or &&",CannotChangeTimeZoneTime:"Cannot change the timezone of a Time",CannotChangeTimeZoneDateOnly:"Cannot change the timezone of a DateOnly",FeatureSetDoesNotHaveSubtypes:"FeatureSet does not have subtypes"};function n(e){return"object"==typeof e&&"line"in e&&"column"in e&&"number"==typeof e.line&&"number"==typeof e.column}class o extends Error{constructor(e,t){super(l(t)+("object"==typeof e&&e&&"message"in e?e.message:""),{cause:e}),this.loc=t?.loc??null}}class a extends Error{constructor(e,t,i){super("Execution error - "+l(t)+(0,r.HC)(s[e],i)),this.declaredRootClass="esri.arcade.arcadeexecutionerror",this.loc=t?.loc??null}}function l(e){return null==e?.loc?"":`Line ${e.loc.start.line}:${e.loc.start.column}: `}class u extends Error{constructor(e,t,i){super("Compilation error - "+l(t)+(0,r.HC)(s[e],i)),this.declaredRootClass="esri.arcade.arcadecompilationerror",this.loc=t?.loc??null}}class h extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror"}}function d(e,t){return!function(e){if(e instanceof Error&&"loc"in e){let t=e.loc;return null==t||"object"==typeof t&&"start"in t&&null!=t.start&&n(t.start)&&(!("end"in t)||null==t.end||n(t.end))}return!1}(e)||null==e.loc&&null!=t?.loc?new o(e,t):e}const c={UnrecognizedUri:"Unrecognized uri - {uri}",UnsupportedUriProtocol:"Unrecognized uri protocol"};class m extends Error{constructor(e,t){super((0,r.HC)(c[e],t)),this.declaredRootClass="esri.arcade.arcademoduleerror"}}},69540(e,t,i){var r=i(32198),s=i(69622),n=(i(44208),i(4718)),o=(i(53966),i(97768)),a=i(88620),l=i(64108);const u=Symbol("ClonableMixin"),h=e=>{var t;let i=e,s=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){let t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");let i=t.metadata,r=t.store,s={},l=new Map;for(let t in i){let o=i[t],a=r?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;let h=this[t],d=null;if("function"==typeof u)d=u(h,e);else if("reference"===u)d=h;else if(d=(0,n.TU)(h,e),null!=h&&null==d)continue;0===a?l.set(t,d):s[t]=d}let u=new(0,Object.getPrototypeOf(this).constructor)(s);if(l.size){let e=(0,a.oY)(u)?.store;if(e)for(let[t,i]of l)e.set(t,i,0)}return u}};return s=(0,r.Cg)([(0,l.$)("esri.core.Clonable")],s),s},d=h(s.A);i.d(t,["OU",0,h,"Pw",0,d])},66344(e,t,i){i.d(t,{q:()=>a});const r=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(e=10485760,t=.3){this._maxSize=e,this._maxClientSizeRatio=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(e){this._clients.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._clients.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(e,t){return this._db.get(e.id+t)?.size??0}put(e,t,i,s,o){t=e.id+t;let a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),s>this._maxSize)return void this._notifyRemove(t,i,s,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return r||console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,i,0,0);let l=1+Math.max(o,-4)- -3;this._db.set(t,new n(i,s,l)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t){t=e.id+t;let i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let r=i.entry.usedMemory;for(;r>this._maxSize;){let e=this._notifyRemove(t,i.entry,r,1);if(!(null!=e&&e>0))return void this._db.delete(t);r=e}i.size=r,this._size+=r,e.size+=r,this._checkSize()}pop(e,t){t=e.id+t;let i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;let i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){let i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){let e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=[];this._db.forEach((e,r)=>{let s=e.lifetime;i[s]=(i[s]||0)+e.size,this._clients.forEach(i=>{let{id:s,name:n}=i;if(r.startsWith(s)){let i=t[n]||0;t[n]=i+e.size}})});let r={};this._clients.forEach(e=>{let i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){let s=t[i]||0;t[i]=s,r[i]=Math.round(100*e.hitRate)+"%"}else r[i]="0%"});let s=Object.keys(t);s.sort((e,i)=>t[i]-t[e]),s.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+r[i]);for(let t=i.length-1;t>=0;--t){let r=i[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._clients.forEach(e=>e.resetHitRate())}clear(e){let t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._clients.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(let[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,r){let s=this._clients.get(e.split(o)[0])?.removeFunc,n=s?.(t,r,i);return"number"==typeof n?n:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._clients.forEach(e=>this._checkSizeLimits(this._maxClientSize,e)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){let i=t??this;if(i.size<=e)return;let r=t?.id,s=!0;for(;s;){s=!1;for(let[n,a]of this._db)if(0===a.lifetime&&(!r||n.startsWith(r))){let r=t??this._clients.get(n.split(o)[0]);if(this._purgeItem(n,a,r),i.size<=.9*e)return;s||=this._db.has(n)}}for(let[s,n]of this._db)if(!r||s.startsWith(r)){let r=t??this._clients.get(s.split(o)[0]);if(this._purgeItem(s,n,r),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);let r=this._notifyRemove(e,t.entry,t.size,1);null!=r&&r>0&&(this._size+=r,i&&(i.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new s(0);class n{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this.id="",this.name="",this.size=0,this._storage=new s(e,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},60999(e,t,i){i.d(t,{DZ:()=>f,Ke:()=>m,QA:()=>p,Tj:()=>h,UT:()=>g,aD:()=>_,jJ:()=>u});var r=i(32198),s=i(69622),n=i(97768),o=i(17676),a=i(10107),l=i(64108);function u(e,t,i){return(0,o.Lx)(e.map((e,r)=>t.apply(i,[e,r])))}async function h(e,t,i){return(await(0,o.Lx)(e.map((e,r)=>t.apply(i,[e,r])))).map(e=>e.value)}function d(e){return{ok:!0,value:e}}function c(e){return{ok:!1,error:e}}async function m(e){if(null==e)return{ok:!1,error:Error("no promise provided")};try{return d(await e)}catch(e){return c(e)}}async function f(e){try{return d(await e)}catch(e){return(0,o.QP)(e),c(e)}}function p(e){if(!0===e.ok)return e.value;throw e.error}function g(e,t){return new y(e,t)}let y=class extends s.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;let{signal:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=d(e),this._cleanup()},e=>{this._result=c(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.xt)(this._abortHandle),this._abortController=null}};(0,r.Cg)([(0,a.MZ)()],y.prototype,"value",null),(0,r.Cg)([(0,a.MZ)()],y.prototype,"error",null),(0,r.Cg)([(0,a.MZ)()],y.prototype,"finished",null),(0,r.Cg)([(0,a.MZ)()],y.prototype,"promise",void 0),(0,r.Cg)([(0,a.MZ)()],y.prototype,"_result",void 0),y=(0,r.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],y);class _{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});let t=await e;return{[Symbol.dispose]:t}}async run(e){let t={stack:[],error:void 0,hasError:!1};try{return(0,r.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,r.hk)(t)}}}},9093(e,t,i){function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}i.d(t,{o8:()=>s,vt:()=>r});const n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n,clone:s,create:r,fromValues:function(e,t,i,r,s,n,o,a,l,u,h,d,c,m,f,p){return[e,t,i,r,s,n,o,a,l,u,h,d,c,m,f,p]}},Symbol.toStringTag,{value:"Module"})),i.d(t,["zK",0,n])},35522(e,t,i){i.d(t,{$A:()=>b,Bw:()=>n,C:()=>o,Cc:()=>T,DI:()=>M,Io:()=>_,Ln:()=>y,Om:()=>C,Qr:()=>d,Re:()=>u,S8:()=>S,T9:()=>p,WQ:()=>l,Z0:()=>F,_S:()=>m,aI:()=>E,ei:()=>I,fw:()=>O,gL:()=>A,hG:()=>v,hZ:()=>a,hs:()=>g,jk:()=>f,lw:()=>h,m3:()=>x,oW:()=>R,t2:()=>Z,tn:()=>c,ze:()=>w});var r=i(51850),s=i(34304);function n(e){let t=e[0],i=e[1],r=e[2];return Math.sqrt(t*t+i*i+r*r)}function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e}function l(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function u(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function h(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function d(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e}function c(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}function m(e,t){return e[0]=Math.sign(t[0]),e[1]=Math.sign(t[1]),e[2]=Math.sign(t[2]),e}function f(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function p(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function g(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function y(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e}function _(e,t){let i=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(i*i+r*r+s*s)}function v(e,t){let i=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return i*i+r*r+s*s}function x(e){let t=e[0],i=e[1],r=e[2];return t*t+i*i+r*r}function w(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function M(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function S(e,t=e){let i=t[0],r=t[1],s=t[2],n=i*i+r*r+s*s;return n>0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n),e}function C(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function b(e,t,i){let r=t[0],s=t[1],n=t[2],o=i[0],a=i[1],l=i[2];return e[0]=s*l-n*a,e[1]=n*o-r*l,e[2]=r*a-s*o,e}function T(e,t,i,r){let s=t[0],n=t[1],o=t[2];return e[0]=s+r*(i[0]-s),e[1]=n+r*(i[1]-n),e[2]=o+r*(i[2]-o),e}function F(e,t,i){let r=t[0],s=t[1],n=t[2];return e[0]=i[0]*r+i[4]*s+i[8]*n+i[12],e[1]=i[1]*r+i[5]*s+i[9]*n+i[13],e[2]=i[2]*r+i[6]*s+i[10]*n+i[14],e}function I(e,t,i){let r=t[0],s=t[1],n=t[2];return e[0]=r*i[0]+s*i[3]+n*i[6],e[1]=r*i[1]+s*i[4]+n*i[7],e[2]=r*i[2]+s*i[5]+n*i[8],e}function A(e,t,i){return O(e,t,i[0],i[1],i[2],i[3])}function O(e,t,i,r,s,n){let o=t[0],a=t[1],l=t[2],u=r*l-s*a,h=s*o-i*l,d=i*a-r*o,c=r*d-s*h,m=s*u-i*d,f=i*h-r*u,p=2*n;return e[0]=o+u*p+2*c,e[1]=a+h*p+2*m,e[2]=l+d*p+2*f,e}const z=(0,r.vt)(),P=(0,r.vt)();function Z(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function E(e,t){if(e===t)return!0;let i=e[0],r=e[1],n=e[2],o=t[0],a=t[1],l=t[2],u=(0,s.FD)();return Math.abs(i-o)<=u*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-a)<=u*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=u*Math.max(1,Math.abs(n),Math.abs(l))}function R(e,t,i){let r=i[0]-t[0],s=i[1]-t[1],n=i[2]-t[2],o=r*r+s*s+n*n;return o>0?(o=1/Math.sqrt(o),e[0]=r*o,e[1]=s*o,e[2]=n*o,e):(e[0]=0,e[1]=0,e[2]=0,e)}const D=u,N=h,B=d,k=_,L=v,Y=n,U=x;Object.freeze(Object.defineProperty({__proto__:null,abs:c,add:l,angle:function(e,t){S(z,e),S(P,t);let i=C(z,P);return i>1?0:i<-1?Math.PI:Math.acos(i)},bezier:function(e,t,i,r,s,n){let o=1-n,a=o*o,l=n*n,u=a*o,h=3*n*a,d=3*l*o,c=l*n;return e[0]=t[0]*u+i[0]*h+r[0]*d+s[0]*c,e[1]=t[1]*u+i[1]*h+r[1]*d+s[1]*c,e[2]=t[2]*u+i[2]*h+r[2]*d+s[2]*c,e},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},clamp:function(e,t=0,i=1){return e[0]=Math.min(Math.max(e[0],t),i),e[1]=Math.min(Math.max(e[1],t),i),e[2]=Math.min(Math.max(e[2],t),i),e},copy:o,cross:b,crossAndNormalize:function(e,t,i){let r=t[0],s=t[1],n=t[2],o=i[0],a=i[1],l=i[2],u=s*l-n*a,h=n*o-r*l,d=r*a-s*o,c=Math.sqrt(u*u+h*h+d*d);return e[0]=u/c,e[1]=h/c,e[2]=d/c,e},direction:R,dist:k,distance:_,div:B,divide:d,dot:C,equals:E,exactEquals:Z,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},hermite:function(e,t,i,r,s,n){let o=n*n,a=o*(2*n-3)+1,l=o*(n-2)+n,u=o*(n-1),h=o*(3-2*n);return e[0]=t[0]*a+i[0]*l+r[0]*u+s[0]*h,e[1]=t[1]*a+i[1]*l+r[1]*u+s[1]*h,e[2]=t[2]*a+i[2]*l+r[2]*u+s[2]*h,e},inverse:M,len:Y,length:n,lerp:T,max:p,min:f,mul:N,multiply:h,negate:w,normalize:S,random:function(e,t=1){let i=s.Ov,r=2*i()*Math.PI,n=2*i()-1,o=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*o,e[1]=Math.sin(r)*o,e[2]=n*t,e},rotateX:function(e,t,i,r){let s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0],n[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),n[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e},rotateY:function(e,t,i,r){let s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),n[1]=s[1],n[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e},rotateZ:function(e,t,i,r){let s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),n[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),n[2]=s[2],e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},scale:g,scaleAndAdd:y,scaleTo:function(e,t){return g(e,e,t/Y(e))},set:a,sign:m,sqrDist:L,sqrLen:U,squaredDistance:v,squaredLength:x,str:function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},sub:D,subtract:u,transformMat3:I,transformMat4:F,transformMat4Z:function(e,t){return t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]},transformQuat:A,transformQuatValues:O},Symbol.toStringTag,{value:"Module"})),i.d(t,["Il",0,Y,"jb",0,D,"lo",0,L,"uE",0,U])},75503(e,t,i){i.d(t,{wq:()=>a});var r=i(4576),s=i(21818),n=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=c,this._compareMinY=m,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),w.prune(),M.prune(),S.prune(),C.prune()}all(e){l(this._data,e)}search(e,t){let i=this._data,r=this._toBBox;if(v(e,i))for(w.clear();i;){for(let s=0,n=i.children.length;s<n;s++){let n=i.children[s],o=i.leaf?r(n):n;v(e,o)&&(i.leaf?t(n):_(e,o)?l(n,t):w.push(n))}i=w.pop()}}collides(e){let t=this._data,i=this._toBBox;if(!v(e,t))return!1;for(w.clear();t;){for(let r=0,s=t.children.length;r<s;r++){let s=t.children[r],n=t.leaf?i(s):s;if(v(e,n)){if(t.leaf||_(e,n))return!0;w.push(s)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){let e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new F([]),this}remove(e){if(!e)return this;let t,i=this._data,n=null,o=0,a=!1,l=this._toBBox(e);for(S.clear(),C.clear();i||S.length>0;){if(i||(i=S.pop(),n=S.data[S.length-1],o=C.pop()??0,a=!0),i.leaf&&(t=(0,r.qh)(i.children,(0,s.z)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),S.push(i),this._condense(S),this;a||i.leaf||!_(i,l)?n?(o++,i=n.children[o],a=!1):i=null:(S.push(i),C.push(o),o=0,n=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,r){let s=i-t+1,n=this._maxEntries;if(s<=n){let r=new F(e.slice(t,i+1));return u(r,this._toBBox),r}r||(r=Math.ceil(Math.log(s)/Math.log(n)),n=Math.ceil(s/n**(r-1)));let o=new I([]);o.height=r;let a=Math.ceil(s/n),l=a*Math.ceil(Math.sqrt(n));x(e,t,i,l,this._compareMinX);for(let s=t;s<=i;s+=l){let t=Math.min(s+l-1,i);x(e,s,t,a,this._compareMinY);for(let i=s;i<=t;i+=a){let s=Math.min(i+a-1,t);o.children.push(this._build(e,i,s,r-1))}}return u(o,this._toBBox),o}_insert(e,t,i){let r=this._toBBox,s=i?e:r(e);S.clear();let n=function(e,t,i,r){for(;r.push(t),!0!==t.leaf&&r.length-1!==i;){let i,r=1/0,s=1/0;for(let n=0,o=t.children.length;n<o;n++){let o=t.children[n],a=f(o),l=g(e,o)-a;l<s?(s=l,r=a<r?a:r,i=o):l===s&&a<r&&(r=a,i=o)}t=i||t.children[0]}return t}(s,this._data,t,S);for(n.children.push(e),d(n,s);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;!function(e,t,i){for(let r=i;r>=0;r--)d(t.data[r],e)}(s,S,t)}_split(e,t){let i=e.data[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);let n=this._chooseSplitIndex(i,s,r);if(!n)return;let o=i.children.splice(n,i.children.length-n),a=i.leaf?new F(o):new I(o);a.height=i.height,u(i,this._toBBox),u(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new I([e,t]),this._data.height=e.height+1,u(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let r,s,n;r=s=1/0;for(let o=t;o<=i-t;o++){let t=h(e,0,o,this._toBBox),a=h(e,o,i,this._toBBox),l=y(t,a),u=f(t)+f(a);l<r?(r=l,n=o,s=u<s?u:s):l===r&&u<s&&(s=u,n=o)}return n}_chooseSplitAxis(e,t,i){let r=e.leaf?this._compareMinX:c,s=e.leaf?this._compareMinY:m;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,s)&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);let s=this._toBBox,n=h(e,0,t,s),o=h(e,i-t,i,s),a=p(n)+p(o);for(let r=t;r<i-t;r++){let t=e.children[r];d(n,e.leaf?s(t):t),a+=p(n)}for(let r=i-t-1;r>=t;r--){let t=e.children[r];d(o,e.leaf?s(t):t),a+=p(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){let i=e.data[t];if(0===i.children.length)if(t>0){let s=e.data[t-1],n=s.children;n.splice((0,r.qh)(n,i,n.length,s.indexHint),1)}else this.clear();else u(i,this._toBBox)}}_initFormat(e){let t=["return a"," - b",";"];this._compareMinX=Function("a","b",t.join(e[0])),this._compareMinY=Function("a","b",t.join(e[1])),this._toBBox=Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let i=e;for(M.clear();i;){if(!0===i.leaf)for(let e of i.children)t((0,s.z)(e));else M.pushArray(i.children);i=M.pop()??null}}function u(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,r,s){s||=new F([]),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let n,o=t;o<i;o++)n=e.children[o],d(s,e.leaf?r(n):n);return s}function d(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function c(e,t){return e.minX-t.minX}function m(e,t){return e.minY-t.minY}function f(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){let i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,s-i)*Math.max(0,n-r)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function x(e,t,i,r,s){let n=[t,i];for(;n.length;){let t=n.pop(),i=n.pop();if(t-i<=r)continue;let a=i+Math.ceil((t-i)/r/2)*r;(0,o.q)(e,a,i,t,s),n.push(i,a,a,t)}}const w=new n.A,M=new n.A,S=new n.A,C=new n.A({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class T extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new r.vW}}class F extends T{constructor(e){super(),this.children=e,this.leaf=!0}}class I extends T{constructor(e){super(),this.children=e,this.leaf=!1}}},36708(e,t,i){i.d(t,{C_:()=>c,on:()=>d,wB:()=>l,z7:()=>u});var r=i(37955),s=i(36563),n=i(97768),o=i(17676),a=i(14012);function l(e,t,i={}){return h(e,t,i,m)}function u(e,t,i={}){return h(e,t,i,f)}function h(e,t,i={},r){let s=null,o=i.once?(e,i)=>{r(e)&&((0,n.xt)(s),t(e,i))}:(e,i)=>{r(e)&&t(e,i)};if(s=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){let t=e();o(t,t)}return s}function d(e,t,i,o={}){let a=null,u=null,h=null;function d(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function c(e){o.once&&o.once&&(0,n.xt)(h),i(e)}let m=l(e,(e,i)=>{d(),(0,r.wb)(e)&&(a=e,u=(0,r.on)(e,t,c),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return h=(0,s.hA)(()=>{m.remove(),d()}),h}function c(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());let r=e();if(t?.(r))return Promise.resolve(r);let a=null;function l(){a=(0,n.xt)(a)}return new Promise((r,n)=>{a=(0,s.vE)([(0,o.u7)(i,()=>{l(),n((0,o.NK)())}),h(e,e=>{l(),r(e)},{sync:!1,once:!0},t??m)])})}(e,f,t)}function m(e){return!0}function f(e){return!!e}i(80559),i.d(t,["OH",0,{sync:!0},"Vh",0,{initial:!0},"pc",0,{sync:!0,initial:!0}])},44794(e,t,i){i.d(t,{v:()=>a});var r=i(4718),s=i(62788),n=i(95488);class o{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,s.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function a(e,t=r.gh){return new o(e,t)}},44729(e,t,i){i.d(t,{n:()=>l});var r=i(66131),s=i(73444),n=i(34747);function o(e){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let t="";for(let i of e.match(/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g)||[])switch(i){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?t+=`'${i.slice(1,-1)}'`:t+=`'${i}'`}return t}const a="esri.core.sql.dateonly";class l{constructor(e,t,i){this._year=e,this._month=t,this._day=i,this.declaredRootClass=a}static isDateOnly(e){return"object"==typeof e&&!!e&&"declaredRootClass"in e&&e.declaredRootClass===a}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return l.isDateOnly(e)&&e.day===this.day&&e.month===this.month&&e.year===this.year}compare(e){return this.year===e.year?this.month===e.month?this.day-e.day:this.month-e.month:this.year-e.year}clone(){return new l(this._year,this._month,this._day)}toDateTime(e){return n.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toDateTimeLuxon(e){return n.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=o(e)),!e)return"";let i=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(i).toFormat(e,{locale:(0,s.JK)(),numberingSystem:"latn"})}toArcadeDate(){let e=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return l.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return n.c9.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){let t=n.c9.fromMillis(e,{zone:n.mQ.utcInstance});return t.isValid?l.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){let t=n.c9.fromSeconds(e,{zone:n.mQ.utcInstance});return t.isValid?l.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;let t=e.indexOf("-");if(t<0)return null;let i=e.indexOf("-",t+1);return i<0?null:new l(parseInt(e.slice(0,t),10),parseInt(e.slice(t+1,i),10),parseInt(e.slice(i+1),10))}static fromParts(e,t,i){let r=new l(e,t,i);return!1===r.isValid?null:r}static fromDateJS(e){return l.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return l.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e||null===e)return null;let i=[];if(t)(t=o(t))&&i.push(t);else if(null===t||""===t){let t=n.c9.fromISO(e,{setZone:!0});return t.isValid?l.fromParts(t.year,t.month,t.day):null}for(let r of i){let i=n.c9.fromFormat(e,t??r);if(i.isValid)return new l(i.year,i.month,i.day)}return null}static fromNow(e="system"){let t=n.c9.fromJSDate(new Date).setZone((0,r.mT)(e));return new l(t.year,t.month,t.day)}}},15032(e,t,i){i.d(t,{k:()=>l});var r=i(73444),s=i(54218),n=i(34747);function o(e){if(!e)return"";let t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g,i="";for(let r of e.match(t)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":i+=r;break;case"A":case"a":i+="a";break;default:i+=`'${r}'`}return i}const a="esri.core.sql.timeonly";class l{constructor(e,t,i,r){this._hour=e,this._minute=t,this._second=i,this._millisecond=r,this.declaredRootClass=a}static isTimeOnly(e){return"object"==typeof e&&!!e&&"declaredRootClass"in e&&e.declaredRootClass===a}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return l.isTimeOnly(e)&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new l(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,s.Fq)(this.hour)&&(0,s.Fq)(this.minute)&&(0,s.Fq)(this.second)&&(0,s.Fq)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=o(e))?n.c9.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,r.JK)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,i,r){let s=new l(e,t,i,r);return s.isValid()?s:null}static fromReader(e){if(!e)return null;let t=e.indexOf(":");if(t<0)return null;let i=e.indexOf(":",t+1);return i<0?null:new l(parseInt(e.slice(0,t),10),parseInt(e.slice(t+1,i),10),parseInt(e.slice(i+1),10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;let t=Math.floor(e/1e3%60),i=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),s=Math.floor(e%1e3);return new l(r,i,t,s)}static fromDateJS(e){return new l(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new l(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e||null===e)return null;let i=[];t?(t=o(t))&&i.push(t):(null===t||""===t)&&(i.push("HH:mm:ss"),i.push("HH:mm:ss.SSS"),i.push("hh:mm:ss a"),i.push("hh:mm:ss.SSS a"),i.push("HH:mm"),i.push("hh:mm a"),i.push("H:mm"),i.push("h:mm a"),i.push("H:mm:ss"),i.push("h:mm:ss a"),i.push("H:mm:ss.SSS"),i.push("h:mm:ss.SSS a"));for(let t of i){let i=n.c9.fromFormat(e,t);if(i.isValid)return new l(i.hour,i.minute,i.second,i.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return l.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return n.c9.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},79897(e,t,i){i.d(t,{U:()=>h});var r=i(32198),s=i(69622),n=i(36563),o=i(36708),a=i(76030),l=i(10107),u=i(64108);let h=class extends s.A{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,i={}){return this._installWatch(e,t,i,o.wB)}addWhen(e,t,i={}){return this._installWatch(e,t,i,o.z7)}addOnCollectionChange(e,t,{initial:i=!1,final:r=!1}={}){let s=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.OH),(0,o.on)(e,"change",t,{onListenerAdd:i?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:r?e=>t({added:[],removed:e.toArray()}):void 0})],s),(0,n.hA)(()=>this.removeHandles(s))}consumePromise(e){this.addPromise(e)?.catch(()=>{})}addPromise(e){if(null==e)return e;let t=++this._handleId;this.addHandles((0,n.hA)(()=>{this._pendingPromises.delete(e)&&0===this._pendingPromises.size&&!this.hasHandles(d)&&this._set("updating",!1)}),t),this._pendingPromises.add(e),this._set("updating",!0);let i=()=>this.removeHandles(t);return e.then(i,i),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,i={},r){let s=++this._handleId;i.sync||this._installSyncUpdatingWatch(e,s);let o=r(e,t,i);return this.addHandles(o,s),(0,n.hA)(()=>this.removeHandles(s))}_installSyncUpdatingWatch(e,t){let i=this._createSyncUpdatingCallback(),r=(0,o.wB)(e,i,{sync:!0,equals:()=>!1});return this.addHandles(r,t),r}_createSyncUpdatingCallback(){return()=>{this.removeHandles(d),++this._scheduleHandleId;let e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a._)(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(d))}),d)}}};(0,r.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,r.Cg)([(0,u.$)("esri.core.support.UpdatingHandles")],h);const d=-42},88930(e,t,i){i.d(t,{S1:()=>a,VW:()=>l,lL:()=>u,rb:()=>h,t:()=>d});var r=i(97770),s=(i(98623),i(34747));const n=/^(?<hh>([01][0-9])|(2[0-3])):(?<mm>[0-5][0-9])(:(?<ss>[0-5][0-9]))?(\.(?<ms>\d+))?$/,o={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8,unknown:NaN};function a(e,t,i,n="system"){if("unknown"===i)return e;let o=new s.oh((0,r.wj)(n)),a=s.c9.fromJSDate(e,{zone:o}),l="decades"===i||"centuries"===i?"year":function(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}(i);return"decades"===i&&(t*=10),"centuries"===i&&(t*=100),a.plus({[l]:t}).toJSDate()}function l(e,t,i="milliseconds"){let r=e.getTime(),s=d(t,i,"milliseconds");return new Date(r+s)}function u(e,t,i="system"){let{unit:n}=t,o=Math.max(1,Math.trunc(t.value)),a=new s.oh((0,r.wj)(i)),l=s.c9.fromJSDate(e,{zone:a}),u=e=>e-e%o;switch(n){case"milliseconds":return l.startOf("second").plus({millisecond:u(l.millisecond)}).toJSDate();case"seconds":return l.startOf("minute").plus({second:u(l.second)}).toJSDate();case"minutes":return l.startOf("hour").plus({minute:u(l.minute)}).toJSDate();case"hours":return l.startOf("day").plus({hour:u(l.hour)}).toJSDate();case"days":return l.startOf("month").plus({day:u(l.day-1)}).toJSDate();case"weeks":{let e=l.startOf("year").startOf("week"),t=Math.floor(l.diff(e,"weeks").weeks);return e.plus({week:u(t)}).toJSDate()}case"months":return l.startOf("year").plus({month:u(l.month-1)}).toJSDate();case"years":case"decades":case"centuries":{let e=l.startOf("year"),t=("decades"===n?10:"centuries"===n?100:1)*o,i=e.year-e.year%t;return e.set({year:i}).toJSDate()}case"unknown":return e}}function h(e){let t=n.exec(e);if(!t)return null;let{hh:i,mm:r,ss:s,ms:a}=t.groups;return Number(i)*o.hours+Number(r)*o.minutes+Number(s||0)*o.seconds+Number(a||0)}function d(e,t,i){return 0===e?0:e*o[t]/o[i]}},13069(e,t,i){i.d(t,{AG:()=>a,lk:()=>s,vD:()=>o,yS:()=>n});const r="randomUUID"in crypto;function s(){if(r)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;let t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${s().toUpperCase()}}`}function o(){return`{${s()}}`}function a(e){let t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},87992(e,t,i){i.d(t,{JR:()=>C,ME:()=>w,MY:()=>T,NO:()=>x,Nh:()=>S,V2:()=>z,_s:()=>P,e6:()=>E,gh:()=>M,jm:()=>b,tr:()=>D,uX:()=>p});var r=i(32198),s=i(16930),n=i(19419),o=i(60408),a=i(21325),l=i(513),u=i(50954),h=i(79567),d=i(52006),c=i(49663),m=i(46068),f=i(92722);class p{constructor({type:e,spatialReference:t,vertexCount:i,vertexXY:r,vertexZ:s,vertexM:n,partCount:o,partOffsets:a,partFlags:l,segmentFlags:u,segmentIndices:h,segmentParams:d,segmentCountArc:c,segmentCountBezier:m}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=e,this.spatialReference=t,this.vertexCount=i,this.vertexXY=r,this.vertexZ=s,this.vertexM=n,this.partCount=o,this.partOffsets=a,this.partFlags=l,this.segmentFlags=u,this.segmentIndices=h,this.segmentParams=d,this.segmentCountArc=c,this.segmentCountBezier=m}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){let{segmentCount:e,segmentCountArc:t,segmentCountBezier:i}=this;return e&&e-t-i}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return this.segmentCountArc+this.segmentCountBezier>0}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function e(e){return e?64+e.byteLength:0}return e(this.vertexXY)+e(this.vertexZ)+e(this.vertexM)+e(this.partOffsets)+e(this.partFlags)+e(this.segmentFlags)+e(this.segmentIndices)+e(this.segmentParams)}clone(){let{type:e,vertexCount:t,partCount:i,hasZ:r,hasM:s,segmentCountArc:n,segmentCountBezier:o}=this,a=z(e,t,i,r,s,this.hasCurves(),n,o);a.spatialReference=this.spatialReference;let{vertexXY:l,vertexZ:u,vertexM:h}=this;if(a.vertexXY.set(l.subarray(0,2*t),0),a.vertexZ?.set(u.subarray(0,t),0),a.vertexM?.set(h.subarray(0,t),0),this.isMultipart()){let{partOffsets:e,partFlags:t}=this;a.partFlags.set(t.subarray(0,i+1)),a.partOffsets.set(e.subarray(0,i+1))}if(this.hasCurves()){let{segmentFlags:e,segmentIndices:i,segmentParams:r,segmentParamCount:s}=this;a.segmentFlags.set(e.subarray(0,t),0),a.segmentIndices.set(i.subarray(0,t),0),a.segmentParams.set(r.subarray(0,s),0)}return a}equals(e){return this.equalsWithinTolerance(e,0)}equalsWithinTolerance(e,t){if(null==e)return!1;if(this===e)return!0;if(!(0,a.aI)(this.spatialReference,e.spatialReference)||this.vertexCount!==e.vertexCount||this.partCount!==e.partCount||this.hasZ!==e.hasZ||this.hasM!==e.hasM||this.hasCurves()!==e.hasCurves()||this.segmentCountArc!==e.segmentCountArc||this.segmentCountBezier!==e.segmentCountBezier)return!1;let i=0===t?(e,t)=>e!==t||isNaN(e)!==isNaN(t):(e,i)=>Math.abs(e-i)>t||isNaN(e)!==isNaN(i);for(let t=0;t<this.vertexCount;++t)if(i(this.vertexXY[2*t],e.vertexXY[2*t])||i(this.vertexXY[2*t+1],e.vertexXY[2*t+1]))return!1;if(this.hasZ)for(let t=0;t<this.vertexCount;++t)if(i(this.vertexZ[t],e.vertexZ[t]))return!1;if(this.hasM)for(let t=0;t<this.vertexCount;++t)if(i(this.vertexM[t],e.vertexM[t]))return!1;for(let t=0;t<this.partCount;++t)if(this.partFlags[t]!==e.partFlags[t]||this.partOffsets[t]!==e.partOffsets[t])return!1;if(this.hasCurves()){for(let t=0;t<this.vertexCount;++t)if(this.segmentFlags[t]!==e.segmentFlags[t]||this.segmentIndices[t]!==e.segmentIndices[t])return!1;for(let t=0;t<this.segmentParamCount;++t)if(i(this.segmentParams[t],e.segmentParams[t]))return!1}return!0}get parts(){return this.isMultipart()?new g(this):[][Symbol.iterator]()}}class g{constructor(e){this.geometry=e,this.value=new y(e)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class y{constructor(e){this.geometry=e,this.index=-1,this._readVertex=A(e),this._segments=new _(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){let e=this.geometry.partOffsets;return e[this.index+1]-e[this.index]}}class _{constructor(e){this._part=e,this._partStart=0,this._partEnd=0,this.value=new v(e.geometry)}get _partIsClosed(){return!!(1&this._part.geometry.partFlags?.[this._part.index])}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;let e=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=e&&this._partIsClosed?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){let{index:e}=this._part,t=this._part.geometry.partOffsets;this._partStart=t[e],this._partEnd=t[e+1]-(this._partIsClosed?1:2),this.value.indexOfStartVertex=this._partStart-1}}class v{constructor(e){this.geometry=e,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=A(e)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){let e=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===e)return this.end;let t=this.geometry.segmentParams,i=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===e){let e=t[i++],r=t[i++],s=t[i++],n=t[i++];return{b:[this.end,[e,r],[s,n]]}}let r=t[i++],s=t[i++],n=t[i++],o=t[i++],a=t[i++],l=t[i++];i++,i++;let u=t[i++],h=t[i++];if(!(4&r)&&1===n)return{c:[this.end,[u,h]]};let d=2&r?0:1,c=1&r?0:1;return{a:[this.end,[a,l],d,c,o,s,n]}}}function x(e,t){let i={stack:[],error:void 0,hasError:!1};try{return t??=(0,n.Ie)(),(0,r.mS)(i,new F(e,["vertexZ","vertexM","spatialReference"]),!1),(0,n.bx)(t,function(e){let t,{vertexCount:i,vertexXY:s,vertexZ:o,vertexM:a}=e,l=I(e);if(e.hasCurves()){let i={stack:[],error:void 0,hasError:!1};try{(0,r.mS)(i,new F(e,["vertexZ","vertexM"]),!1);let s=(0,n.Ie)();for(let t of e.parts){let e=t.startVertex;for(let{curve:i}of t.segments)(0,h.e)(s,e,i),e=(0,d.yP)(i)}let[o,a,u,c]=s;t={xmin:o,ymin:a,xmax:u,ymax:c,spatialReference:l}}catch(e){i.error=e,i.hasError=!0}finally{(0,r.hk)(i)}}else{let e,r,n,o;e=r=1/0,n=o=-1/0;for(let t=0;t<i;++t){let i=s[2*t],a=s[2*t+1];e=Math.min(e,i),n=Math.max(n,i),r=Math.min(r,a),o=Math.max(o,a)}t={xmin:e,ymin:r,xmax:n,ymax:o,spatialReference:l}}if(o){let e=1/0,i=-1/0;for(let t of o)e=Math.min(e,t),i=Math.max(i,t);t.zmin=e,t.zmax=i}if(a){let e=1/0,i=-1/0;for(let t of a)e=Math.min(e,t),i=Math.max(i,t);t.mmin=e,t.mmax=i}return t}(e)),t}catch(e){i.error=e,i.hasError=!0}finally{(0,r.hk)(i)}}function w(e){let t,i,r;if((0,o.fT)(e)){r="point";let{x:s,y:n,z:o,m:a}=e,l=[s,n];null!=o&&l.push(o),null!=a&&l.push(a),i=[[l]],t=1}else(0,o.U9)(e)?(r="multipoint",i=[e.points],t=e.points.length):(0,o.Rg)(e)?(r="polyline",i=e.curvePaths??e.paths,t=i.reduce((e,t)=>e+t.length,0)):(r="polygon",i=e.curveRings??e.rings,t=i.reduce((e,t)=>(0===t.length||(e+=t.length,O(t[0],(0,d.yP)(t.at(-1)))&&--e),e),0));let s=z(r,t,r.includes("point")?0:i.length,(0,o.Pv)(e),(0,o.W0)(e),(0,d.Ed)(e)),{hasZ:n,hasM:a,vertexXY:l,vertexZ:u,vertexM:h}=s;function c(e){l[2*f]=e[0],l[2*f+1]=e[1],n&&(u[f]=e[2]),a&&(h[f]=e[m]),++f}s.spatialReference=e.spatialReference??void 0;let m=s.hasZ?3:2,f=0;if(!s.isMultipart()){if(!n&&!a){for(let[e,t]of i[0])l[2*f]=e,l[2*f+1]=t,++f;return s}for(let e of i[0])c(e);return s}let p="polygon"===r,{partOffsets:g}=s,y=0;if(!(0,d.Ed)(e)){for(let e of i){if(g[y++]=f,0===e.length)continue;let t=e.length;if(p&&O(e[0],e.at(-1))&&--t,n||a)for(let i=0;i<t;++i)c(e[i]);else for(let i=0;i<t;++i){let[t,r]=e[i];l[2*f]=t,l[2*f+1]=r,++f}}return g[y]=f,s}function _(e){let t=v+e;if(t<=(s.segmentParams?.length??0))return;let i=t*N;i=20*Math.ceil(i/20);let r=s.segmentParams;s.segmentParams=new Float64Array(i),null!=r&&s.segmentParams.set(r)}let v=0;for(let e of i){if(s.partOffsets[y++]=f,0===e.length)continue;let t=e[0],i=t;for(let t=1;t<e.length;++t){let r=e[t];c(i);let n=f-1;(0,d.wY)(r)?(_(10),++s.segmentCountArc,v=P(i,r,s,n,v),i=r.a[0]):(0,d.DA)(r)?(_(10),++s.segmentCountArc,v=Z(i,r,s,n,v),i=r.a[0]):(0,d.aO)(r)?(_(10),++s.segmentCountArc,v=E(i,r,s,n,v),i=r.c[0]):(0,d.n1)(r)?(_(4),++s.segmentCountBezier,v=D(0,r,s,n,v),i=r.b[0]):i=r}p&&O(t,i)||c(i)}return s.partOffsets[y]=f,s}function M(e){let t=A(e),{vertexCount:i,partCount:r,hasZ:s,hasM:n}=e,o=I(e),a=0;if(!e.isMultipart()){if("point"===e.type){let[t,i]=e.vertexXY;return{x:t,y:i,z:e.vertexZ?.[0],m:e.vertexM?.[0],spatialReference:o}}let r=[];for(;a<i;)r.push(t(a++));return{points:r,spatialReference:o,hasZ:s,hasM:n}}if(!e.hasCurves()){let i=[];for(let s=0;s<r;++s){let r=!!(1&e.partFlags[s]),n=e.partOffsets[s+1],o=[];for(;a<n;)o.push(t(a++));r&&o.length>0&&o.push([...o[0]]),i.push(o)}return"polygon"===e.type?{rings:i,hasZ:s,hasM:n,spatialReference:o}:{paths:i,hasZ:s,hasM:n,spatialReference:o}}let l=[];for(let{segments:t,startVertex:i}of e.parts){let e=[i];for(let{curve:i}of t)e.push(i);l.push(e)}return"polygon"===e.type?{rings:[],curveRings:l,hasZ:s,hasM:n,spatialReference:o}:{paths:[],curvePaths:l,hasZ:s,hasM:n,spatialReference:o}}function S(e,{lengths:t,coords:i,hasZ:r,hasM:s},n){let o=e.includes("point")?0:t.length,a="polygon"===e,l="point"===e?1:t.reduce((e,t)=>e+t,0)-(a?o:0);r??=!1,s??=!1;let u=z(e,l,o,r,s,!1,0,0);if(u.spatialReference=n??void 0,!u.isMultipart()){for(let e=0,t=0;e<l;++e)u.vertexXY[2*e]=i[t++],u.vertexXY[2*e+1]=i[t++],r&&(u.vertexZ[e]=i[t++]),s&&(u.vertexM[e]=i[t++]);return u}let h=2+Number(r)+Number(s),d=0,c=0;u.partOffsets[0]=0;for(let e of t){let t=u.partOffsets[c],n=t+e-Number(a);u.partOffsets[++c]=n;for(let e=t;e<n;++e)u.vertexXY[2*e]=i[d++],u.vertexXY[2*e+1]=i[d++],r&&(u.vertexZ[e]=i[d++]),s&&(u.vertexM[e]=i[d++]);a&&(d+=h)}return u}function C({type:e,vertexCount:t,vertexXY:i,vertexZ:r,vertexM:s,partCount:n,partOffsets:o,partFlags:a,hasZ:l,hasM:u}){let h=new f.A([],[],l,u);n=Math.max(n,1);let d=0;for(let e=0;e<n;++e){let n=o?.[e+1]??t,c=h.coords.length;for(let e=d;e<n;++e)h.coords.push(i[2*e],i[2*e+1]),l&&h.coords.push(r[e]),u&&h.coords.push(s[e]);if(a&&1&a[e]){let e=d;h.coords.push(i[2*e],i[2*e+1]),l&&h.coords.push(r[e]),u&&h.coords.push(s[e])}h.lengths.push((h.coords.length-c)/h.stride),d=n}return"point"===e&&(h.lengths.length=0),h}function b(...e){let t=new Set;for(let i of e){if(!i)continue;let e=[i.vertexXY,i.vertexZ,i.vertexM,i.partOffsets,i.partFlags,i.segmentFlags,i.segmentIndices,i.segmentParams];for(let i of e){let e=i?.buffer;e&&t.add(e)}}return Array.from(t)}function T(e,t){return"getSpatialReference"in e&&(t=function(e){if(null==e)return;let t=e.getText()||void 0,i=e.isCustomWkid()?0:e.getOldID();if(i<=0)return{wkt:t};let r=e.getLatestID();(r<=0||r===i)&&(r=void 0);let s=e.getVCS();if(null==s)return{wkid:i,latestWkid:r,wkt:t};let n=s.isCustomWkid()?0:s.getOldID();if(n<=0)return{wkt:t};let o=e.getLatestVerticalID();return(o<=0||o===n)&&(o=void 0),{wkid:i,wkt:t,latestWkid:r,vcsWkid:n,latestVcsWkid:o}}(e.getSpatialReference()),e=e.getGeometry()),new p({...e.toFlatGeometry(),spatialReference:t})}class F{constructor(e,t){this.target=e,this.keys=t,this.oldValues=t.map(t=>e[t]);for(let i of t)e[i]=void 0}[Symbol.dispose](){this.keys.map((e,t)=>{this.target[e]=this.oldValues[t]})}}function I({spatialReference:e}){return e instanceof s.A?e.toJSON():e}function A({vertexXY:e,vertexZ:t,vertexM:i}){return t?i?r=>[e[2*r],e[2*r+1],t[r],i[r]]:i=>[e[2*i],e[2*i+1],t[i]]:i?t=>[e[2*t],e[2*t+1],i[t]]:t=>[e[2*t],e[2*t+1]]}function O(e,t){return e.every((e,i)=>e===t[i])}function z(e,t,i,r,s,n,o,a){o??=0,a??=0;let l=new p({type:e,vertexCount:t,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:i,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:o,segmentCountBezier:a}),u=2*Float64Array.BYTES_PER_ELEMENT*t;r&&(u+=Float64Array.BYTES_PER_ELEMENT*t),s&&(u+=Float64Array.BYTES_PER_ELEMENT*t),l.isMultipart()&&(u+=(i+1)*Int32Array.BYTES_PER_ELEMENT,u+=(i+1)*Int8Array.BYTES_PER_ELEMENT),n&&(u+=t*Int8Array.BYTES_PER_ELEMENT,u+=t*Int32Array.BYTES_PER_ELEMENT,u+=l.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);let h=new ArrayBuffer(u),d=0;return l.vertexXY=new Float64Array(h,d,2*t),d+=l.vertexXY.byteLength,r&&(l.vertexZ=new Float64Array(h,d,t),d+=l.vertexZ.byteLength),s&&(l.vertexM=new Float64Array(h,d,t),d+=l.vertexM.byteLength),n&&(l.segmentParams=new Float64Array(h,d,l.segmentParamCount),d+=l.segmentParams.byteLength,l.segmentIndices=new Int32Array(h,d,t),l.segmentIndices.fill(B),d+=l.segmentIndices.byteLength),l.isMultipart()&&(l.partOffsets=new Int32Array(h,d,i+1),d+=l.partOffsets.byteLength,l.partFlags=new Int8Array(h,d,i+1),d+=l.partFlags.byteLength,"polygon"===l.type&&l.partFlags.subarray(0,i).fill(1)),n&&(l.segmentFlags=new Int8Array(h,d,t),l.segmentFlags.fill(1),d+=l.segmentFlags.byteLength),l}function P(e,t,{segmentFlags:i,segmentIndices:r,segmentParams:s},n,o){i[n]=4,r[n]=o;let[a,[l,u],h,d,c,f,p]=t.a,g=4;d||(g|=1),h||(g|=2);let y=(0,m.SW)(e,t),[_,v]=(0,m.Uk)(y,.5);return s[o++]=g,s[o++]=f,s[o++]=p,s[o++]=c,s[o++]=l,s[o++]=u,s[o++]=y.u2-y.u1,s[o++]=y.u1,s[o++]=_,s[o++]=v,o}function Z(e,t,{segmentFlags:i,segmentIndices:r,segmentParams:s},n,o){i[n]=4,r[n]=o;let a=(0,c.io)(e,t);return R(a,4,...(0,l.mq)(a,.5),s,o)}function E(e,t,{segmentFlags:i,segmentIndices:r,segmentParams:s},n,o){return i[n]=4,r[n]=o,R((0,u.pM)(e,t),0,...t.c[1],s,o)}function R(e,t,i,r,s,n){let{cx:o,cy:a,thetaStart:l,thetaEnd:u,radius:h}=e;return l>u||(t|=1),Math.abs(u-l)<=Math.PI||(t|=2),s[n++]=t,s[n++]=h,s[n++]=1,s[n++]=0,s[n++]=o,s[n++]=a,s[n++]=u-l,s[n++]=l,s[n++]=i,s[n++]=r,n}function D(e,{b:[t,[i,r],[s,n]]},{segmentFlags:o,segmentIndices:a,segmentParams:l},u,h){return o[u]=2,a[u]=h,l[h++]=i,l[h++]=r,l[h++]=s,l[h++]=n,h}const N=1.61803,B=-1},48526(e,t,i){i.d(t,{A:()=>g});var r,s=i(32198),n=i(4576),o=i(4718),a=i(91429),l=i(5443),u=i(91075),h=i(86738),d=i(16930),c=i(90634),m=i(47610),f=i(56993),p=i(43937);let g=r=class extends u.A{constructor(e){super(function(e){if(!e)return;let{points:t,hasM:i,hasZ:r,spatialReference:s}=e;switch(t??=[],t?.at(0)?.length){case 4:r??=!0,i??=!0;break;case 3:r??=!0!==i,i??=!r;break;default:r??=!1,i??=!1}return s??=d.A.WGS84,{...e,hasM:i,hasZ:r,points:t,spatialReference:s}}(e)),this.points=[],this.type="multipoint"}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){let e=(0,c.ge)(this);return e?new l.A({...e,spatialReference:this.spatialReference}):null}writePoints(e,t){t.points=(0,o.o8)(this.points)}clone(){let{points:e,spatialReference:t,hasM:i,hasZ:s}=this;return new r({points:(0,o.o8)(e),spatialReference:t.clone(),hasM:i,hasZ:s})}equals(e){if(this===e)return!0;if(null==e)return!1;let t=this.spatialReference,i=e.spatialReference;return!(null!=t!=(null!=i)||null!=t&&null!=i&&!t.equals(i))&&(0,n.aI)(this.points,e.points,m.v6)}addPoint(e){return(0,f.h)(this,e),Array.isArray(e)?this.points.push(e):this.points.push(e.toArray()),this.notifyChange("points"),this}getPoint(e){if(!this._validateInputs(e))return null;let t=this.points[e],i={x:t[0],y:t[1],spatialReference:this.spatialReference},r=2;return this.hasZ&&(i.z=t[2],r=3),this.hasM&&(i.m=t[r]),new h.A(i)}removePoint(e){if(!this._validateInputs(e))return null;let t=new h.A(this.points.splice(e,1)[0],this.spatialReference);return this.notifyChange("points"),t}setPoint(e,t){return this._validateInputs(e)&&((0,f.h)(this,t),Array.isArray(t)||(t=t.toArray()),this.points[e]=t,this.notifyChange("points")),this}toJSON(e){return this.write({},e)}_validateInputs(e){return null!=e&&e>=0&&e<this.points.length}};(0,s.Cg)([(0,a.MZ)({readOnly:!0})],g.prototype,"cache",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],g.prototype,"extent",null),(0,s.Cg)([(0,a.MZ)({type:[[Number]],json:{write:{isRequired:!0}}})],g.prototype,"points",void 0),(0,s.Cg)([(0,p.K)("points")],g.prototype,"writePoints",null),g=r=(0,s.Cg)([(0,a.$K)("esri.geometry.Multipoint")],g),g.prototype.toJSON.isDefaultToJSON=!0},82799(e,t,i){i.d(t,{A:()=>f});var r,s=i(32198),n=i(4718),o=i(91429),a=i(5443),l=i(91075),u=i(86738),h=i(16930),d=i(90634),c=i(56993),m=i(43937);let f=r=class extends l.A{constructor(e){super(function(e){if(!e)return;let{paths:t,hasM:i,hasZ:r,spatialReference:s}=e;switch(t??=[],function(e){return"number"==typeof e[0]?.[0]}(t)&&(t=[t]),t[0]?.[0]?.length){case 4:r??=!0,i??=!0;break;case 3:r??=!0!==i,i??=!r;break;default:r??=!1,i??=!1}return s??=h.A.WGS84,{...e,hasM:i,hasZ:r,paths:t,spatialReference:s}}(e)),this.curvePaths=void 0,this.paths=[],this.type="polyline"}get cache(){return this.commitProperty("curvePaths"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("paths"),this.commitProperty("spatialReference"),{}}writeCurvePaths(e,t){t.curvePaths=(0,n.o8)(e)}get extent(){let e=(0,d.Z3)(this),{spatialReference:t}=this;return e?new a.A({...e,spatialReference:t}):null}writePaths(e,t){t.paths=(0,n.o8)(this.paths)}addPath(e){if(!e)return;let t=this.paths,i=t.length;if(function(e){return!Array.isArray(e[0])}(e)){let r=[];for(let t=0,i=e.length;t<i;t++)r[t]=e[t].toArray();t[i]=r}else t[i]=e.slice();return this.notifyChange("paths"),this}clone(){let e=new r;return e.spatialReference=this.spatialReference,e.paths=(0,n.o8)(this.paths),e.curvePaths=(0,n.o8)(this.curvePaths),e.hasZ=this.hasZ,e.hasM=this.hasM,e}getPoint(e,t){if(!this._validateInputs(e,t))return null;let i=this.paths[e][t],r=this.hasZ,s=this.hasM;return r&&!s?new u.A(i[0],i[1],i[2],void 0,this.spatialReference):s&&!r?new u.A(i[0],i[1],void 0,i[2],this.spatialReference):r&&s?new u.A(i[0],i[1],i[2],i[3],this.spatialReference):new u.A(i[0],i[1],this.spatialReference)}insertPoint(e,t,i){return this._validateInputs(e,t,!0)&&((0,c.h)(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e].splice(t,0,i),this.notifyChange("paths")),this}removePath(e){if(!this._validateInputs(e,null))return null;let t=this.paths.splice(e,1)[0],i=this.spatialReference,r=t.map(e=>new u.A(e,i));return this.notifyChange("paths"),r}removePoint(e,t){if(!this._validateInputs(e,t))return null;let i=new u.A(this.paths[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(e,t,i){return this._validateInputs(e,t)&&((0,c.h)(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e][t]=i,this.notifyChange("paths")),this}_validateInputs(e,t,i=!1){if(null==e||e<0||e>=this.paths.length)return!1;if(null!=t){let r=this.paths[e];if(i&&(t<0||t>r.length)||!i&&(t<0||t>=r.length))return!1}return!0}toJSON(e){return this.write({},e)}};(0,s.Cg)([(0,o.MZ)({readOnly:!0})],f.prototype,"cache",null),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],f.prototype,"curvePaths",void 0),(0,s.Cg)([(0,m.K)("curvePaths")],f.prototype,"writeCurvePaths",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0})],f.prototype,"extent",null),(0,s.Cg)([(0,o.MZ)({type:[[[Number]]],json:{write:{isRequired:!0}}})],f.prototype,"paths",void 0),(0,s.Cg)([(0,m.K)("paths")],f.prototype,"writePaths",null),f=r=(0,s.Cg)([(0,o.$K)("esri.geometry.Polyline")],f),f.prototype.toJSON.isDefaultToJSON=!0},4197(e,t,i){i.d(t,{Vj:()=>h,cj:()=>u,jh:()=>n,l5:()=>a,yH:()=>l});var r=i(34275),s=i(9093);function n(e){return e<=1024?Array(e).fill(0):new Float64Array(e)}function o(e){return((0,r.iu)(e)?e.byteLength/8:e.length)<=1024?Array.from(e):new Float64Array(e)}function a(e,t,i){return Array.isArray(e)?e.slice(t,t+i):e.subarray(t,t+i)}function l(e,t){if(0===t.length)return o(e);if(0===e.length)return o(t);let i=n(e.length+t.length);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}function u(e){return[...e]}function h(e){let t=(0,s.vt)();for(let i=0;i<16;++i)t[i]=e[i];return t}},70328(e,t,i){i.d(t,{BI:()=>F,C:()=>o,DC:()=>c,Ej:()=>v,Ie:()=>b,Jt:()=>T,Lu:()=>w,Ne:()=>M,RF:()=>d,TF:()=>y,VL:()=>f,aI:()=>A,fA:()=>a,gE:()=>u,gX:()=>_,hZ:()=>C,iT:()=>m,is:()=>I,pg:()=>x,uJ:()=>g,vI:()=>S,vY:()=>l,vt:()=>n,w1:()=>h,yr:()=>p}),i(35522);var r=i(5443),s=(i(19419),i(4197));function n(e=z){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t){for(let i=0;i<6;i++)e[i]=t[i];return e}function a(e,t,i,r,s,o,a=n()){return a[0]=e,a[1]=t,a[2]=i,a[3]=r,a[4]=s,a[5]=o,a}function l(e,t=n()){return function(e,t,i,r=n()){return C(r,O),function(e,t,i=0,r=t.length/3){let s=e[0],n=e[1],o=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<r;e++)s=Math.min(s,t[i+3*e]),n=Math.min(n,t[i+3*e+1]),o=Math.min(o,t[i+3*e+2]),a=Math.max(a,t[i+3*e]),l=Math.max(l,t[i+3*e+1]),u=Math.max(u,t[i+3*e+2]);e[0]=s,e[1]=n,e[2]=o,e[3]=a,e[4]=l,e[5]=u}(r,e,t,i),r}(e,0,e.length/3,t)}function u(e,t=(0,s.jh)(24)){let[i,r,n,o,a,l]=e;return t[0]=i,t[1]=r,t[2]=n,t[3]=i,t[4]=r,t[5]=l,t[6]=i,t[7]=a,t[8]=n,t[9]=i,t[10]=a,t[11]=l,t[12]=o,t[13]=r,t[14]=n,t[15]=o,t[16]=r,t[17]=l,t[18]=o,t[19]=a,t[20]=n,t[21]=o,t[22]=a,t[23]=l,t}function h(e,t){return isFinite(e[2])||isFinite(e[5])?new r.A({xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}):new r.A({xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function d(e,t,i=e){i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.min(e[2],t[2]),i[3]=Math.max(e[3],t[3]),i[4]=Math.max(e[4],t[4]),i[5]=Math.max(e[5],t[5])}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function m(e,[t,i,r]){!function(e,t,i,r){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.min(e[2],r),e[3]=Math.max(e[3],t),e[4]=Math.max(e[4],i),e[5]=Math.max(e[5],r)}(e,t,i,r)}function f(e){return e[0]>=e[3]?0:e[3]-e[0]}function p(e){return e[1]>=e[4]?0:e[4]-e[1]}function g(e){return e[2]>=e[5]?0:e[5]-e[2]}function y(e){let t=f(e),i=g(e),r=p(e);return t*t+i*i+r*r}function _(e,t=[0,0,0]){return t[0]=e[0]+f(e)/2,t[1]=e[1]+p(e)/2,t[2]=e[2]+g(e)/2,t}function v(e,t=[0,0,0]){return t[0]=f(e),t[1]=p(e),t[2]=g(e),t}function x(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function w(e,t){return t[0]=e[3],t[1]=e[4],t[2]=e[5],t}function M(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function S(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function C(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function b(e){return e?C(e,O):n(O)}function T(e,t){return e[0]=t[0],e[1]=t[1],e[2]=-1/0,e[3]=t[2],e[4]=t[3],e[5]=1/0,e}function F(e,t,i,r,s){return e[0]=t,e[1]=i,e[2]=-1/0,e[3]=r,e[4]=s,e[5]=1/0,e}function I(e){return 6===e.length}function A(e,t,i){if(null==e||null==t)return e===t;if(!I(e)||!I(t))return!1;if(i){for(let r=0;r<e.length;r++)if(!i(e[r],t[r]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],z=[0,0,0,0,0,0];n(),i.d(t,["qv",0,O,"v_",0,z])},60408(e,t,i){function r(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function s(e){return void 0!==e.points}function n(e){return void 0!==e.x&&void 0!==e.y}function o(e){return void 0!==e.paths||void 0!==e.curvePaths}function a(e){return void 0!==e.rings||void 0!==e.curveRings}function l(e){return"object"==typeof e&&"vertexAttributes"in e}function u(e){return e?n(e)?"esriGeometryPoint":o(e)?"esriGeometryPolyline":a(e)?"esriGeometryPolygon":r(e)?"esriGeometryEnvelope":s(e)?"esriGeometryMultipoint":null:null}function h(e){return null!=e&&("hasZ"in e&&e.hasZ||"z"in e&&null!=e.z)}function d(e){return null!=e&&("hasM"in e&&e.hasM||"m"in e&&null!=e.m)}i.d(t,{$B:()=>u,Bi:()=>a,Pv:()=>h,Rg:()=>o,U9:()=>s,W0:()=>d,ZC:()=>r,fT:()=>n,uW:()=>l})},65864(e,t,i){i.d(t,{rS:()=>h,xD:()=>c});var r=i(5443),s=i(91075),n=i(48526),o=i(86738),a=i(39829),l=i(82799),u=i(60408);function h(e){return null==e?null:e instanceof s.A?e:(0,u.fT)(e)?o.A.fromJSON(e):(0,u.Rg)(e)?l.A.fromJSON(e):(0,u.Bi)(e)?a.A.fromJSON(e):(0,u.U9)(e)?n.A.fromJSON(e):(0,u.ZC)(e)?r.A.fromJSON(e):null}const d={esriGeometryPoint:o.A,esriGeometryPolyline:l.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:r.A,esriGeometryMultipoint:n.A,esriGeometryMultiPatch:a.A};function c(e){return e&&d[e]||null}},50498(e,t,i){var r=i(66552),s=i(5443),n=i(91075),o=i(48526),a=i(86738),l=i(39829),u=i(82799);const h=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),d=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),c={base:n.A,key:"type",typeMap:{extent:s.A,multipoint:o.A,point:a.A,polyline:u.A,polygon:l.A}},m=new r.J({esriGeometryBezier3Curve:"cubic-bezier",esriGeometryCircularArc:"circular-arc",esriGeometryEllipticArc:"elliptic-arc"},{ignoreUnknown:!0});i.d(t,["Ye",0,d,"gy",0,h,"iI",0,m,"yR",0,c])},97770(e,t,i){i.d(t,{Ey:()=>O,F8:()=>A,J2:()=>b,Yq:()=>F,_m:()=>T,iS:()=>I,wj:()=>z});var r=i(66552),s=i(73444),n=i(98623),o=i(34747);const a={dateStyle:void 0,year:void 0,month:void 0,day:void 0,weekday:void 0},l={timeStyle:void 0,hour12:void 0,hourCycle:void 0,hour:void 0,minute:void 0,second:void 0},u={timeZone:"UTC"},h={year:"numeric",month:"numeric",day:"numeric"},d={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},m={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},p={...f,second:"numeric"},g={hourCycle:"h23"},y={...f,...g},_={...p,...g},v={"short-date":h,"short-date-short-time":{...h,...f},"short-date-short-time-24":{...h,...y},"short-date-long-time":{...h,...p},"short-date-long-time-24":{...h,..._},"short-date-le":h,"short-date-le-short-time":{...h,...f},"short-date-le-short-time-24":{...h,...y},"short-date-le-long-time":{...h,...p},"short-date-le-long-time-24":{...h,..._},"long-month-day-year":d,"long-month-day-year-short-time":{...d,...f},"long-month-day-year-short-time-24":{...d,...y},"long-month-day-year-long-time":{...d,...p},"long-month-day-year-long-time-24":{...d,..._},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...f},"day-short-month-year-short-time-24":{...c,...y},"day-short-month-year-long-time":{...c,...p},"day-short-month-year-long-time-24":{...c,..._},"long-date":m,"long-date-short-time":{...m,...f},"long-date-short-time-24":{...m,...y},"long-date-long-time":{...m,...p},"long-date-long-time-24":{...m,..._},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":p},x=(0,r.O)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),w={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"};function M(){let e=(0,s.lR)();return(e&&w[e])??(0,s.QC)()}"mart"!==new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)).find(({type:e})=>"month"===e)?.value.toLowerCase()&&(w.bs="sr-Latn-CS");let S=new WeakMap;const C=v["short-date-short-time"];function b(e){return v[e]}function T(e){let{dateStyle:t,timeStyle:i,hour12:r,year:s,month:n}=e,o={};return t?o.dateStyle=t:s&&(o.year=s,o.month=n||void 0),i&&!o.year&&(o.timeStyle=i,o.hour12="auto"===r?void 0:"always"===r),o}function F(e,t=C){return function(e){let t=S.get(e);if(!t){let i=M(),r=z(e.timeZone??"system"),s={...e,timeZone:r};t=new Intl.DateTimeFormat(i,s),S.set(e,t)}return t}(t).format(e)}function I(e,t=C){return F(new Date(e),{...t,...u,...l})}function A(e,t=C){return F(new Date(`1970-01-01T${e}Z`),{...t,...u,...a})}function O(e,t=C){let i=o.c9.fromISO(e,{setZone:!0});if(!i.isValid)return e;if(t.timeZone)return F(i.toJSDate(),t);let r=0===i.offset?"UTC":t.timeZone,s={...t,timeZone:r};return i.toLocaleString(s,{locale:M()})}function z(e){switch(e){case"system":return n.N;case n.L:return"UTC";default:return e}}(0,s.Ml)(()=>{S=new WeakMap}),i.d(t,["_v",0,x])},73444(e,t,i){i.d(t,{JK:()=>l,Ml:()=>g,QC:()=>d,lR:()=>h,oQ:()=>f});var r=i(36563);let s;i(44208);const n=globalThis.esriConfig?.locale,o=globalThis.document?.documentElement;function a(){let e=o?.getAttribute("lang"),t=globalThis.navigator?.language;return n??e??t??"en"}function l(){return void 0===s&&(s=a()),s}const u=/^(?<language>[a-z]{2,3})(?:-(?<extlang>[a-z]{3}))?(?:-[A-Z][a-z]{3})?(?:-(?<region>[A-Z]{2}|\d{3}))?(?:-.*)?$/;function h(e=l()){return c(e)?.language}function d(e=l()){let t=c(e);return t?.language&&t?.extlang?e.replace(`${t.language}-`,""):e}function c(e=l()){return u.exec(e)?.groups}const m=[];function f(e){return m.push(e),(0,r.hA)(()=>{m.splice(m.indexOf(e),1)})}new Map;const p=[];function g(e){return p.push(e),(0,r.hA)(()=>p.splice(p.indexOf(e),1))}function y(){let e=a();s!==e&&([...p].forEach(t=>t(e)),s=e,[...m].forEach(t=>t(e)))}globalThis.addEventListener?.("languagechange",y),o&&new MutationObserver(()=>{y()}).observe(o,{attributeFilter:["lang"]})},6518(e,t,i){i.d(t,{F:()=>a});var r=i(44208),s=i(75503),n=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new s.wq(9,(0,r.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){let e=Array(this._idByBounds.size),t=0;this._idByBounds.forEach((i,r)=>{e[t++]=r}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;let e=(0,n.Ie)();for(let t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){let t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){let t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},39357(e,t,i){i.d(t,{A:()=>a});var r,s=i(32198),n=i(25482),o=i(91429);let a=r=class extends n.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new r({name:this.name,code:this.code})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),(0,s.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],a.prototype,"code",void 0),a=r=(0,s.Cg)([(0,o.$K)("esri.layers.support.CodedValue")],a)},53177(e,t,i){i.d(t,{A:()=>h});var r,s=i(32198),n=i(4718),o=i(91429),a=i(39357),l=i(76357),u=i(93223);let h=class extends l.A{static{r=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){let i=String(e);this.codedValues.some(e=>(String(e.code)===i&&(t=e.name),!!t))}return t}clone(){return new r({codedValues:(0,n.o8)(this.codedValues),name:this.name})}};(0,s.Cg)([(0,o.MZ)({type:[a.A],json:{write:{isRequired:!0}}})],h.prototype,"codedValues",void 0),(0,s.Cg)([(0,u.e)({codedValue:"coded-value"})],h.prototype,"type",void 0),h=r=(0,s.Cg)([(0,o.$K)("esri.layers.support.CodedValueDomain")],h)},76357(e,t,i){i.d(t,{A:()=>u});var r=i(32198),s=i(66552),n=i(25482),o=i(91429),a=i(93223);const l=new s.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let u=class extends n.o{constructor(e){super(e),this.name=null,this.type=null}};(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],u.prototype,"name",void 0),(0,r.Cg)([(0,a.e)(l),(0,o.MZ)({json:{write:{isRequired:!0}}})],u.prototype,"type",void 0),u=(0,r.Cg)([(0,o.$K)("esri.layers.support.Domain")],u)},20437(e,t,i){i.d(t,{A:()=>f});var r,s=i(32198),n=i(66552),o=i(25482),a=i(91429),l=i(78888),u=i(8631),h=i(98453),d=i(36005),c=i(93223);const m=new n.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",marginOfError:"margin-of-error",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier",url:"url"});let f=class extends o.o{static{r=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?.value??null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?m.fromJSON(i.fieldValueType):null}clone(){return new r({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,s.Cg)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,s.Cg)([(0,a.MZ)()],f.prototype,"description",void 0),(0,s.Cg)([(0,d.w)("description")],f.prototype,"readDescription",null),(0,s.Cg)([(0,a.MZ)({types:u.g,json:{read:{reader:u.r},write:!0}})],f.prototype,"domain",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,s.Cg)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,s.Cg)([(0,c.e)(h.m)],f.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)()],f.prototype,"valueType",void 0),(0,s.Cg)([(0,d.w)("valueType",["description"])],f.prototype,"readValueType",null),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=r=(0,s.Cg)([(0,a.$K)("esri.layers.support.Field")],f)},95466(e,t,i){i.d(t,{A:()=>u});var r=i(49186),s=i(53966),n=i(12195),o=i(30524),a=i(98623),l=i(56400);class u{static fromJSON(e){return new u(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new u(e.fields??[],d(e))}static fromLayerJSON(e){return new u(e.fields??[],d(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;let i=[];for(let e of this.fields){let t=e?.name,r=(0,o.GZ)(t);if(t&&r){let s=(0,o.NF)(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(r,e),i.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,o.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,o.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),!(0,o.te)(e)&&!(0,o.Xz)(e)&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(let e of this.fields)!(0,o.te)(e)&&!(0,o.Xz)(e)&&!e.nullable&&void 0===(0,o.lD)(e)&&this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){return(0,o.Vb)({fieldName:e,fieldsMap:this._fieldsMap,normalizedFieldsMap:this._normalizedFieldsMap})}getTimeZone(e){let t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),"UTC"):h.has(t.type)?a.L:null:null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,o.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,n.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}const h=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function d(e){let t=new Map;if(!e.fields)return t;let i=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:s}=e,n=(r?"startField"in r?r.startField:r.startTimeField:"")??"",u=(r?"endField"in r?r.endField:r.endTimeField:"")??"",d=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,l.ZS)(e.dateFieldsTimeReference):null,c=s?function(e){return"timeZone"in e}(s)?s.timeZone??d:s.dateFieldsTimeReference?(0,l.ZS)(s.dateFieldsTimeReference):d??"UTC":null,m=r?function(e){return"timeZone"in e}(r)?r.timeZone??d:r.timeReference?(0,l.ZS)(r.timeReference):d:null,f=new Map([[(0,o.NF)(s?.creationDateField??""),c],[(0,o.NF)(s?.editDateField??""),c],[(0,o.NF)(n),m],[(0,o.NF)(u),m]]);for(let{name:r,type:s}of e.fields)if(h.has(s))t.set(r,a.L);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(r,null);else if(i)t.set(r,a.L);else{let e=f.get((0,o.NF)(r??""))??d;t.set(r,e)}return t}},91806(e,t,i){i.d(t,{A:()=>l});var r,s=i(32198),n=i(25482),o=i(91429),a=i(78888);let l=class extends n.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,s.Cg)([(0,o.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=r=(0,s.Cg)([(0,o.$K)("esri.layers.support.LOD")],l)},41628(e,t,i){i.d(t,{A:()=>l});var r,s=i(32198),n=i(91429),o=i(76357),a=i(93223);let l=class extends o.A{static{r=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new r({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,s.Cg)([(0,n.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]},isRequired:!0}}})],l.prototype,"maxValue",void 0),(0,s.Cg)([(0,n.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]},isRequired:!0}}})],l.prototype,"minValue",void 0),(0,s.Cg)([(0,a.e)({range:"range"})],l.prototype,"type",void 0),l=r=(0,s.Cg)([(0,n.$K)("esri.layers.support.RangeDomain")],l)},87045(e,t,i){i.d(t,{A:()=>v});var r,s=i(32198),n=i(66552),o=i(25482),a=i(86211),l=i(91429),u=i(78888),h=i(86738),d=i(16930),c=i(21325),m=i(28735),f=i(91806),p=i(72802),g=i(36005),y=i(43937);const _=new n.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=class extends o.o{static{r=this}static create(e={}){let{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:n=d.A.WebMercator,numLODs:o=24}=e;if(!(0,c.fn)(n)){let e=[];if(i)for(let t=0;t<i.length;t++){let r=i[t];e.push(new f.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new h.A(0,0,n),size:[s,s],spatialReference:n})}let l=(0,c.Vp)(n),u=e.origin?new h.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):l?new h.A({x:l.origin[0],y:l.origin[1],spatialReference:n}):new h.A({x:0,y:0,spatialReference:n}),m=1/(39.37*(0,a.GA)(n)*96),p=[];if(i)for(let e=0;e<i.length;e++){let t=i[e],r=t*m;p.push(new f.A({level:e,scale:t,resolution:r}))}else{let e=(0,c.EA)(n)?512/s*591657527.5917094:256/s*591657527.591555,i=Math.ceil(o/t);p.push(new f.A({level:0,scale:e,resolution:e*m}));for(let r=1;r<i;r++){let i=e/2**t,s=i*m;p.push(new f.A({level:r,scale:i,resolution:s})),e=i}}return new r({dpi:96,lods:p,origin:u,size:[s,s],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){let{spatialReference:e,origin:t}=this;if(e&&t){let i=(0,c.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return h.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0,r=[],s=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,s[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){let t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];let i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){let t=this.scales,i=t.length-1,r=0;for(;r<i;r++){let i=t[r],s=t[r+1];if(i<=e)return r;if(s===e)return r+1;if(i>e&&s<e)return r+Math.log(i/e)/Math.log(i/s)}return r}tileAt(e,t,i,r){let s,n,o=this.lodAt(e);if(!o)return null;if("number"==typeof t)s=t,n=i;else if((0,c.aI)(t.spatialReference,this.spatialReference))s=t.x,n=t.y,r=i;else{let e=(0,m.Cv)(t,this.spatialReference);if(null==e)return null;s=e.x,n=e.y,r=i}let a=o.resolution*this.size[0],l=o.resolution*this.size[1];return r??=new p.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-n)/l+.001),r.col=Math.floor((s-this.origin.x)/a+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){let t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;let r=e.level-i.level,s=i.resolution*this.size[0]/2**r,n=i.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+n,!0}upsampleTile(e){let t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){let i=this.lodAt(t.level);if(null==i)return null;let{resolution:r}=i,s=r*this.size[0],n=r*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+s,e[3]=e[1]+n,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;let t=(512===this.size[0]&&256===e?-1:0)+ +!!this.spatialReference.isGeographic;if(this.size[0]===e&&0===t)return this;let i=[],s=this.lods.length-t;for(let e=0;e<s;e++){let r=e+t,{scale:s,resolution:n}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:s,resolution:n}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){let e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){let r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,s.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,s.Cg)([(0,g.w)("origin")],v.prototype,"readOrigin",null),(0,s.Cg)([(0,l.MZ)({type:[f.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,s.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,s.Cg)([(0,g.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,s.Cg)([(0,y.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],v.prototype,"writeSize",null),(0,s.Cg)([(0,l.MZ)({type:d.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=r=(0,s.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],v)},72802(e,t,i){i.d(t,{U:()=>s});var r=i(19419);class s{constructor(e,t,i,s=(0,r.vt)()){this._level=e,this._row=t,this._col=i,this.extent=s}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new s(e.level,e.row,e.col,e.extent)}}},8631(e,t,i){i.d(t,{r:()=>c,g:()=>d});var r,s=i(53177),n=i(76357),o=i(32198),a=i(91429),l=i(93223);let u=class extends n.A{static{r=this}constructor(e){super(e),this.type="inherited"}clone(){return new r}};(0,o.Cg)([(0,l.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=r=(0,o.Cg)([(0,a.$K)("esri.layers.support.InheritedDomain")],u);var h=i(41628);const d={key:"type",base:n.A,typeMap:{range:h.A,"coded-value":s.A,inherited:u}};function c(e){if(!e?.type)return null;switch(e.type){case"range":return h.A.fromJSON(e);case"codedValue":return s.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},98453(e,t,i){const r=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});i.d(t,["m",0,r])},73133(e,t,i){const r=(0,i(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"});i.d(t,["j",0,r])},31756(e,t,i){var r=i(86211),s=i(79258);const n={unknown:1,inches:(0,r.oU)(1,"meters","inches"),feet:(0,r.oU)(1,"meters","feet"),"us-feet":(0,r.oU)(1,"meters","us-feet"),yards:(0,r.oU)(1,"meters","yards"),miles:(0,r.oU)(1,"meters","miles"),"nautical-miles":(0,r.oU)(1,"meters","nautical-miles"),millimeters:(0,r.oU)(1,"meters","millimeters"),centimeters:(0,r.oU)(1,"meters","centimeters"),decimeters:(0,r.oU)(1,"meters","decimeters"),meters:(0,r.oU)(1,"meters","meters"),kilometers:(0,r.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,r.vl)(1,"meters",s.$O.radius)};i.d(t,["j",0,n])},63746(e,t,i){function r(e){return class{constructor(){for(let t of e)this[t]=null}}}function s(e,t=1){let{transform:i,hasZ:r,hasM:s}=e;if(null==i)return r&&1!==t?e=>{e[2]*=t}:null;let[n,o]=function(e,t,i,r){let{scale:s,translate:n,originPosition:o}=e;return"upperLeft"===o&&(s=s.map((e,t)=>1===t?-e:e)),t&&(s=s.map((e,t)=>2===t?e*r:e),n=n.map((e,t)=>2===t?e*r:e)),!t&&i&&(s=s.filter((e,t)=>2!==t),n=n.filter((e,t)=>2!==t)),[s,n]}(i,r,s,t),a=e.hasZ?3:2;return e=>{for(let t=0;t<e.length&&(t!==a||0!==e[t]);++t)e[t]=e[t]*n[t]+o[t]}}i.d(t,{M:()=>s,_:()=>r})},88625(e,t,i){i.d(t,{A:()=>_});var r,s=i(32198),n=i(69540),o=i(66552),a=i(25482),l=i(97768),u=i(91429),h=i(30524);let d=r=class extends a.o{constructor(e){super(e),this.expression=void 0,this.title=void 0}async collectRequiredFields(e,t){return(0,h.Dx)(e,t,null,this.expression)}clone(){return new r({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,s.Cg)([(0,u.MZ)({type:String,json:{write:{isRequired:!0}}})],d.prototype,"expression",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],d.prototype,"title",void 0),d=r=(0,s.Cg)([(0,u.$K)("esri.symbols.support.FeatureExpressionInfo")],d);const c=d;var m=i(16271),f=i(36005),p=i(43937);const g=(0,o.O)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new o.J({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let _=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.featureExpressionInfo=void 0,this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e.expression?e:void 0:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,i,r){t[i]=e.write({},r),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){let{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,l.CM)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,s.Cg)([(0,u.MZ)({type:c,json:{write:!0}})],_.prototype,"featureExpressionInfo",void 0),(0,s.Cg)([(0,f.w)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],_.prototype,"readFeatureExpressionInfo",null),(0,s.Cg)([(0,p.K)("featureExpressionInfo",{featureExpressionInfo:{type:c},"featureExpression.value":{type:[0]}})],_.prototype,"writeFeatureExpressionInfo",null),(0,s.Cg)([(0,u.MZ)({type:g.apiValues,nonNullable:!0,json:{type:g.jsonValues,read:g.read,write:{writer:g.write,isRequired:!0}}})],_.prototype,"mode",null),(0,s.Cg)([(0,u.MZ)({type:Number,json:{write:!0}})],_.prototype,"offset",void 0),(0,s.Cg)([(0,u.MZ)({type:m.KQ,json:{type:String,read:y.read,write:y.write}})],_.prototype,"unit",null),_=(0,s.Cg)([(0,u.$K)("esri.symbols.support.ElevationInfo")],_)},16271(e,t,i){i.d(t,{Ao:()=>n});var r=i(4576),s=i(31756);function n(e){return 1/(s.j[e]||1)}const o=function(){let e=Object.keys(s.j);return(0,r.TF)(e,"decimal-degrees"),e.sort(),e}();i.d(t,["KQ",0,o])},79677(e,t,i){i.d(t,{A:()=>d});var r,s=i(32198),n=i(25482),o=i(88930),a=i(91429),l=(i(98623),i(10184)),u=i(36005),h=i(43937);let d=class extends n.o{static{r=this}static get allTime(){return c}static get empty(){return m}static fromArray(e){return new r({start:null==e[0]?e[0]:new Date(e[0]),end:null==e[1]?e[1]:new Date(e[1])})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null==t.end?null:new Date(t.end)}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null==t.start?null:new Date(t.start)}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;let t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===r&&i===s}expandTo(e,t="system"){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let i=this.start;i&&=(0,o.lL)(i,new l.A({value:1,unit:e}),t);let s=this.end;if(s){let i=(0,o.lL)(s,new l.A({value:1,unit:e}),t);s=s.getTime()===i.getTime()?i:(0,o.S1)(i,1,e,t)}return new r({start:i,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();let t,i,s=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,o=e.start?.getTime()??-1/0,a=e.end?.getTime()??1/0;return o>=s&&o<=n?t=o:s>=o&&s<=a&&(t=s),n>=o&&n<=a?i=n:a>=s&&a<=n&&(i=a),null==t||null==i||isNaN(t)||isNaN(i)?r.empty:new r({start:t===-1/0?null:new Date(t),end:i===1/0?null:new Date(i)})}offset(e,t,i="system"){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();let s=new r,{start:n,end:a}=this;return null!=n&&(s.start=(0,o.S1)(n,e,t,i)),null!=a&&(s.end=(0,o.S1)(a,e,t,i)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return c.clone();let t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:i})}};(0,s.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,s.Cg)([(0,u.w)("end")],d.prototype,"readEnd",null),(0,s.Cg)([(0,h.K)("end")],d.prototype,"writeEnd",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,s.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,s.Cg)([(0,u.w)("start")],d.prototype,"readStart",null),(0,s.Cg)([(0,h.K)("start")],d.prototype,"writeStart",null),d=r=(0,s.Cg)([(0,a.$K)("esri.time.TimeExtent")],d);const c=new d,m=new d({start:void 0,end:void 0})},10184(e,t,i){i.d(t,{A:()=>h});var r=i(32198),s=i(69540),n=i(25482),o=i(88930),a=i(91429),l=i(73133),u=i(93223);let h=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,r.Cg)([(0,u.e)(l.j,{nonNullable:!0})],h.prototype,"unit",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],h.prototype,"value",void 0),h=(0,r.Cg)([(0,a.$K)("esri.time.TimeInterval")],h)},20401(e,t,i){i.r(t),i.d(t,{default:()=>ze});var r=i(32198),s=i(65529),n=i(17676),o=i(36708),a=i(91429),l=i(79897),u=i(16930),h=i(65864),d=i(4576),c=i(49186),m=i(53966),f=i(87992),p=i(70328),g=i(6518),y=i(50498),_=i(69397),v=i(27647);class x{constructor(e=null,t={},i,r,s=0,n=null){this.geometry=e,this.attributes=t,this.centroid=i,this.objectId=r,this.displayId=s,this.distance=n}weakClone(){return new x(this.geometry,this.attributes,this.centroid,this.objectId,this.displayId,this.distance)}clone(){return new x(this.geometry?.clone(),{...this.attributes},this.centroid?.clone(),this.objectId,this.displayId,this.distance)}get usedMemory(){return 128+(0,_.lM)(this.attributes)+(this.geometry?.usedMemory??0)}ensureCentroid(e){return this.centroid??=(0,v.Q)(this.geometry&&(0,f.JR)(this.geometry)),this.centroid}}const w={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,i)=>new x((0,f.Nh)(y.gy.fromJSON(i),t),e.attributes,null,e.objectId,e.displayId,e.distance),getGeometry:e=>e.geometry&&(0,f.JR)(e.geometry),getGeometryWithCurves:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)},M=(0,p.vt)();class S{constructor(e,t,i){this.geometryType=e,this.hasZ=t,this.hasM=i,this._boundsStore=new g.F,this._featuresById=new Map,this._usedMemory=0,this.events=new s.bk,this.featureAdapter=w}get usedMemory(){return this._usedMemory}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=this._featuresById.size,t=0;return this._featuresById.forEach(({geometry:e})=>{t+=e?e.vertexCount:0}),{featureCount:e,vertexCount:t}}getFullExtent(e){if(null==this.fullBounds)return null;let[t,i,r,s]=this.fullBounds;return{xmin:t,ymin:i,xmax:r,ymax:s,spatialReference:e}}add(e){this._add(e),this._emitChanged()}addMany(e){for(let t of e)this._add(t);this._emitChanged()}upsertMany(e){let t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(d.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){let t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(let t of e){let e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(let i of e){let e=this._boundsStore.get(i.objectId);e&&t((0,p.Jt)(M,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;let t=e.objectId;if(null==t)return void m.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new c.A("featurestore:invalid-feature","feature id is missing",{feature:e}));let i,r=this._featuresById.get(t);r?(e.displayId=r.displayId,i=this._boundsStore.get(t)??void 0,this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(r)??0):this.onFeatureAdd?.(e),e.geometry?(this._boundsStore.set(t,(0,f.NO)(e.geometry,i)),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0):(this._boundsStore.set(t,null),this._featuresById.set(t,e))}_upsert(e){let t=e?.objectId;if(null==t)return m.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new c.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;let i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;let{geometry:r,attributes:s}=e;for(let e in s)i.attributes[e]=s[e];return r&&(i.geometry=r,this._boundsStore.set(t,(0,f.NO)(r)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);let t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}var C=i(75752),b=i(87045),T=i(72802),F=i(97552),I=i(88625),A=i(66344),O=i(91869),z=i(86211),P=i(52006),Z=i(16271);function E(e=!1,t){if(e){let{elevationInfo:e,alignPointsInFeatures:i}=t;return new D(e,i)}return new R}class R{async alignCandidates(e,t,i){return e}notifyElevationSourceChange(){}}class D{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new A.q(1024),this._cacheVersion=0}async alignCandidates(e,t,i){let r=this._elevationInfo;return null==r||"absolute-height"!==r.mode||r.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,i):(function(e,t,i){let{offset:r,unit:s}=i;if(null==r)return;let n=(0,z.G9)(t),o=r*((0,Z.Ao)(s??"meters")/n);for(let t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o,t.curve&&((0,P.yP)(t.curve)[2]+=o);continue;case"vertex":t.target.z+=o;continue}}(e,t,r),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,i){let r=new Map;for(let t of e)(0,O.tE)(r,t.objectId,k).push(t);let[s,o,a]=this._prepareQuery(r,t),l=await this._alignPointsInFeatures(s,i);if((0,n.Te)(i),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,i);this._applyCacheAndResponse(s,l,o);let{drapedObjectIds:u,failedObjectIds:h}=l,d=[];for(let t of e){let{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||d.push(t)}return d}_prepareQuery(e,t){let i=[],r=[];for(let[t,s]of e){let e=[];for(let i of s)this._addToQueriesOrCachedResult(t,i.target,e,r),"edge"===i.type&&(this._addToQueriesOrCachedResult(t,i.start,e,r),this._addToQueriesOrCachedResult(t,i.end,e,r));0!==e.length&&i.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:i},r,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,i,r){let s=B(e,t),n=this._alignmentsCache.get(s);null==n?i.push(t):r.push(new N(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:i,failedObjectIds:r},s){for(let e of s)e.apply();let n=0,o=this._alignmentsCache;for(let{objectId:s,points:a}of e.pointsInFeatures){if(r.has(s)){n+=a.length;continue}let e=!i.has(s);for(let i of a){let r=B(s,i),a=t[n++];i.z=a,e&&o.put(r,a,1)}}}}class N{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function B(e,{x:t,y:i,z:r,spatialReference:s}){return`${e}-${t}-${i}-${r??0}}-wkid:${s?.wkid}`}function k(){return[]}class L{filter(e,t){return t}notifyElevationSourceChange(){}}class Y{filter(e,t){let{point:i,distance:r}=e,{z:s}=i;if(null==s||0===t.length)return t;let n=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(r),o=this._updateCandidatesTo3D(t,i,n).filter(U);return o.sort(X),o}_updateCandidatesTo3D(e,t,i){for(let r of e)switch(r.type){case"edge":V(r,t,i);continue;case"vertex":q(r,t,i);continue}return e}}function U(e){return e.distance<=1}function j(e=!1){return e?new Y:new L}function V(e,t,{x:i,y:r,z:s}){let{start:n,end:o,target:a}=e;if(e.curve)throw Error("Curves are not yet supported.");e.draped||function(e,t,i,r){let s=r.x-i.x,n=r.y-i.y,o=r.z-i.z,a=s*s+n*n+o*o,l=(t.x-i.x)*s+(t.y-i.y)*n+o*(t.z-i.z),u=Math.min(1,Math.max(0,l/a)),h=i.x+s*u,d=i.y+n*u,c=i.z+o*u;e.x=h,e.y=d,e.z=c}(a,t,n,o);let l=(t.x-a.x)/i,u=(t.y-a.y)/r,h=(t.z-a.z)/s;e.distance=Math.sqrt(l*l+u*u+h*h)}function q(e,t,{x:i,y:r,z:s}){let{target:n}=e,o=(t.x-n.x)/i,a=(t.y-n.y)/r,l=(t.z-n.z)/s;e.distance=Math.sqrt(o*o+a*a+l*l)}function X(e,t){return e.distance-t.distance}var J=i(4718),H=i(799);function G(e=!1,t){return e?new W(t):new $}class ${async fetch(){return[]}notifySymbologyChange(){}}class W{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new A.q(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];let i=[],r=[],s=this._candidatesCache;for(let t of e){let e=K(t),n=s.get(e);if(n)for(let e of n)r.push((0,J.o8)(e));else i.push(t),s.put(e,[],1)}if(0===i.length)return r;let o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(i,t);if((0,n.Te)(t),o!==this._cacheVersion)return this.fetch(e,t);let u=[],{length:h}=a;for(let e=0;e<h;++e){let t=a[e],r=K(i[l[e]]),n=s.get(r);n.push(t),s.put(r,n,n.length),u.push((0,J.o8)(t))}return r.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function K(e){switch(e.type){case"vertex":{let{objectId:t,target:i}=e,r=`${t}-vertex-${i.x}-${i.y}-${i.z??0}`;return(0,H.Wm)(r).toString()}case"edge":{let{objectId:t,start:i,end:r}=e,s=`${t}-edge-${i.x}-${i.y}-${i.z??0}-to-${r.x}-${r.y}-${r.z??0}`;return(0,H.Wm)(s).toString()}default:return""}}var Q=i(69622),ee=i(60999),te=i(3483),ie=i(13069),re=i(5443),se=i(19419),ne=i(92722),oe=i(54339);class ae{constructor(){this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){let e=new ae;return e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}var le=i(60694),ue=i(62815),he=i(63746);class de{constructor(e){this._options=e,this.featureSet=new ae,this.parseOnly=null,this._idInfo=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._push=de._pushXY,this._attributesClass=null,this._previousX=0,this._previousY=0,this._vertex=[],this._i=0,this._geometry=null,this._iVertex=0,this._iPart=0,this._isPolygon=!1,this._ringEndsAt=-1}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){"string"==typeof e?this._idInfo??={type:"object-id",fieldName:e}:this._idInfo={type:"unique-id-simple",fieldName:e.name}}finish(){if(this._idInfo)for(let e of this.featureSet.features)e.objectId=(0,oe.W)(e,this._idInfo);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:i}of t)i&&(i.spatialReference=e);this.featureSet.transform=null}feature(){this._attributesClass??=(0,he._)(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push(new x(null,new this._attributesClass,null,0)),this._setVertexTransformer()}centroid(e){let{hasZ:t,hasM:i}=this.featureSet;this.featureSet.features.at(-1).centroid=new ne.A([],e,t,i)}geometry(e,t,i){this._previousX=this._previousY=0,this._i=this._iVertex=this._iPart=0;let{hasZ:r,hasM:s}=this.featureSet;r??=!1,s??=!1,this._vertex=[0,0],r&&this._vertex.push(0),s&&this._vertex.push(0);let n=y.gy.fromJSON(t);this._isPolygon="polygon"===n;let o=Number(this._isPolygon),a="point"===n?1:i.reduce((e,t)=>e+t-o,0),l="point"===n?0:i.length;if(this._geometry=(0,f.V2)(n,a,l,r,s,!1),this._push=r?s?de._pushXYZM:de._pushXYZ:s?de._pushXYM:de._pushXY,this._geometry.isMultipart()){this._geometry.partOffsets[0]=0;for(let e=0;e<l;++e)this._geometry.partOffsets[e+1]=this._geometry.partOffsets[e]+i[e]-o}this._ringEndsAt=o?this._geometry.partOffsets.at(1)??0:-1,1===e?(this.featureSet.queryGeometry=this._geometry,this.featureSet.queryGeometryType=t):this.featureSet.features.at(-1).geometry=this._geometry}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,(this._iVertex!==this._ringEndsAt||(++this._iPart,this._ringEndsAt=this._geometry.partOffsets[this._iPart+1],this._previousX=this._previousY=0,!this._isPolygon))&&(this._transformInPlace?.(t),this._push(this)))}curvedGeometry(e,t,i,r){let{hasZ:s,hasM:n}=this.featureSet;s??=!1,n??=!1,this._i=this._iVertex=this._iPart=0;let o=y.gy.fromJSON(e);this._isPolygon="polygon"===o;let a=Number(!this._isPolygon),l=t.length,u=0,h=0,d=a*l;for(let e=0;e<i.length;++e)switch(d+=r[e],i[e]){case 1:case 3:u+=r[e];continue;case 2:h+=r[e]}this._geometry=(0,f.V2)(o,d,l,s,n,!0,u,h);let{partOffsets:c}=this._geometry;c[0]=0;for(let e=0,i=0;e<l;++e){c[e+1]=c[e]+a;for(let s=0;s<t[e];++s)c[e+1]+=r[i++]}switch(e){case"esriGeometryPoint":case"esriGeometryMultipoint":throw Error(`Curved ${e} does not make sense`)}this.featureSet.features.at(-1).geometry=this._geometry}startCurvedPart(e){}finishCurvedPart(e){this._isPolygon||(this._transform(e,this._vertex),this._push(this)),++this._iPart}lineSegment(e,t){this._transform(e,this._vertex),this._push(this)}bezierSegment(e,t,i,r){this._transform(e,this._vertex),this._push(this),this._transformXY(t,fe.b[0]),this._transformXY(i,fe.b[1]),this._transformXY(r,fe.b[2]),this._i=(0,f.tr)(this._vertex,fe,this._geometry,this._iVertex-1,this._i)}circularArcSegment(e,t,i){this._transform(e,this._vertex),this._push(this),this._transformXY(t,ce.c[0]),this._transformXY(i,ce.c[1]),this._i=(0,f.e6)(this._vertex,ce,this._geometry,this._iVertex-1,this._i)}ellipticArcSegment(e,t,i,r,s,n,o,a){this._transform(e,this._vertex),this._push(this),this._transformXY(t,me.a[0]),this._transformXY(i,me.a[1]),me.a[2]=r,me.a[3]=s,me.a[4]=n,me.a[5]=o,me.a[6]=a,this._i=(0,f._s)(this._vertex,me,this._geometry,this._iVertex-1,this._i)}static _pushXY(e){let t=e._iVertex++,{vertexXY:i}=e._geometry;[i[2*t],i[2*t+1]]=e._vertex}static _pushXYZ(e){let t=e._iVertex++,{vertexXY:i,vertexZ:r}=e._geometry;[i[2*t],i[2*t+1],r[t]]=e._vertex}static _pushXYM(e){let t=e._iVertex++,{vertexXY:i,vertexM:r}=e._geometry;[i[2*t],i[2*t+1],r[t]]=e._vertex}static _pushXYZM(e){let t=e._iVertex++,{vertexXY:i,vertexM:r,vertexZ:s}=e._geometry;[i[2*t],i[2*t+1],s[t],r[t]]=e._vertex}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:t,hasZ:i,transform:r}=this.featureSet,s=i?(0,ue.d)(e,t):1;this._transformInPlace??=(0,he.M)(this.featureSet,s),this._transformInPlaceXY??=(0,he.M)({transform:r})}_transform(e,t){for(let i=0;i<e.length;++i)t[i]=e[i];this._transformInPlace?.(t)}_transformXY(e,t){t[0]=e[0],t[1]=e[1],this._transformInPlaceXY?.(t)}}const ce={c:[[0,0],[0,0]]},me={a:[[0,0],[0,0],0,0,0,0,0]},fe={b:[[0,0],[0,0],[0,0]]};var pe=i(80893);class ge{constructor(e,t){this.key=e,this.resolution=t,this.state={type:0},this.alive=!0}process(e){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 4:this.state=this._goToDone(this.state,e)}return null}get debugInfo(){return{key:this.key,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(e,t){return{type:1,previous:e,task:(0,ee.UT)(async e=>{let i=await(0,ee.DZ)(t.fetchCount(this,e));1===this.state.type&&(this.state=function(e,t){return{type:2,featureCount:t,previous:e}}(this.state,i.ok?i.value:1/0))})}}_gotoFetchFeatures(e,t){return{type:3,previous:e,task:(0,ee.UT)(async i=>{let r=await(0,ee.DZ)(t.fetchFeatures(this,e.featureCount,i));3===this.state.type&&(this.state=function(e,t){return{type:4,previous:e,features:t}}(this.state,r.ok?r.value:[]))})}}_goToDone(e,t){return t.finish(this,e.features),{type:5,previous:e}}reset(){let e=this.state;switch(this.state={type:0},e.type){case 0:case 2:case 4:case 5:break;case 1:case 3:e.task.abort()}}}let ye=class extends Q.A{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){let e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){let t=this._get("outFields"),i=(0,te.KC)(e,this._mandatoryOutFields);(0,te.aI)(i,t)||(this._set("outFields",i),(0,te.Yy)(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){let t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){let t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){let t=this._get("tileInfo");t!==e&&(null==e||null==t||JSON.stringify(e)!==JSON.stringify(t))&&(this._set("tileInfo",e),this.store.tileInfo=e)}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new l.U}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>(0,d.aI)(e,t,({id:e},{id:t})=>e===t)}),this._updatingHandles.addWhen(()=>!this.suspended,()=>this._process())}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(let e of this._pendingTiles.values())e.reset();let t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=(0,ee.UT)(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(e){(0,n.QP)(e),m.A.getLogger(this).warn("Failed to apply edits",e)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,le.Wo)(this.url))return;let e=(0,ee.UT)(async e=>{try{let t=await(0,pe.Jf)(this.url,new F.A({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=re.A.fromJSON(t?.extent)}catch(e){(0,n.QP)(e),m.A.getLogger(this).warn("Failed to fetch data extent",e)}});this._updatingHandles.consumePromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(let e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;let e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(let{data:t,resolution:i}of e.missingTiles){let e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(let t of this.tilesOfInterest){let i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(let e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){let e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(let t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.consumePromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<xe}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;let i=this.tileSize*t;return we/(i*i)*e<Me}_ensureFetchAllCounts(e){let t=!0;for(let i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.consumePromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){let e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){let i=new ge(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ve,signal:t})}async _fetchFeatures(e,t,i){let r=0,s=[],n=0,o=t;for(;;){let a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,r,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,i);l&&(r+=a.num),n+=u.length;for(let e of u)s.push(e);if(o=t-n,!l||!h||o<=0)return s}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){let t=this.globalIdField,i=this.objectIdField;if(null==t)throw Error("Expected globalIdField to be defined");let r=null,s=e&&(0,ie.AG)(e);if(this.store.featureStore.forEach(e=>{s===(0,ie.AG)(e.attributes[t])&&(r=e.objectId??e.attributes[i])}),null==r)throw Error(`Expected to find a feature with globalId ${e}`);return r}_queryFeaturesById(e,t){let i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}async _queryFeatures(e,t){return 0===e.num?new ae:this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){let{sourceSpatialReference:i}=this;return await(0,pe.IJ)(this.url,e,new de({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:ve,signal:t})}async _queryFeaturesJSON(e,t){let{sourceSpatialReference:i}=this;return function({exceededTransferLimit:e,features:t,fields:i,geometryType:r,hasM:s,hasZ:n,spatialReference:o,transform:a},l){let u=new ae;u.exceededTransferLimit=e??!1;for(let e of t??[]){let t,i;r&&(t=e.geometry&&(0,f.ME)(e.geometry),i=e.centroid&&new ne.A([],[e.centroid.x,e.centroid.y]));let s=(0,oe.W)(e,l);u.features.push(new x(t,e.attributes,i,s,void 0,e.distance))}return u.fields=i??u.fields,u.geometryType=r??null,u.hasM=s??!1,u.hasZ=n??!1,u.spatialReference=o??null,u.transform=a??null,u}(await(0,pe.eW)(this.url,e,i,{query:this._configuration.customParameters,timeout:ve,signal:t}),{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){let t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){let t=this._createBaseQuery(e),i=null==e?.key?null:this.store.getAttributesForTile(e?.key?.id),r=(0,te.KC)((0,te.iv)(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(r),t.returnGeometry=!0,this.capabilities.data.supportsTrueCurve&&(!this.capabilities.query.supportsFormatPBF||this.capabilities.query.supportsFormatPBFWithCurves)&&(t.returnTrueCurves=!0),null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){let t=new F.A({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?(0,se.w1)(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;let{supportsMaxRecordCountFactor:r,supportsCacheHint:s,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=r?F.A.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||s)&&n?n:o||_e);return e.start=t,r?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"url",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"currentVersion",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"objectIdField",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"globalIdField",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"capabilities",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"sourceSpatialReference",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"spatialReference",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"store",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"_minimumVerticesPerFeature",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"_mandatoryOutFields",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"outFields",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"suspended",void 0),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"_historicMoment",void 0),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"filter",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"customParameters",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"_configuration",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"tileInfo",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"tileSize",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"tilesOfInterest",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"updating",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"availability",void 0),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"hasZ",null),ye=(0,r.Cg)([(0,a.$K)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],ye);const _e=2e3,ve=6e5,xe=1e6,we=25,Me=1;i(44208);class Se{constructor(){this._store=new Map,this._priorities=new Map}get size(){return this._store.size}setPriorityOrderByKey(e){this._priorities.clear();for(let t=e.length-1;t>=0;t--)this._priorities.set(e[t],e.length-t)}hasLowerPriority(e){let t=this._priorities.get(e);if(null==t)return!0;for(let[e]of this._store){let i=this._priorities.get(e);if(null==i||i<t)return!0}return!1}someFromLowestToHighestPriority(e){let{_priorities:t}=this;for(let[i,r]of this._store)if(!t.has(i)&&e(r,i))return!0;for(let[i]of t){let t=this._store.get(i);if(t&&e(t,i))return!0}return!1}set(e,t){this._store.set(e,t)}delete(e){return this._store.delete(e)}get(e){return this._store.get(e)}has(e){return this._store.has(e)}clear(){this._store.clear()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}let Ce=class extends Q.A{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new g.F,this._tiles=new Se,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,se.vt)()}add(e,t){for(let e of t)this._referenceFeature(e.objectId);let i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>(0,te.E$)(e,t),new Set(Object.keys(i[0]?.attributes??[]))),s=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),s&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;let{_tiles:e,featureStore:t,maximumByteSize:i}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<i||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(let i of e.objectIds)if(1===this._refCounts.get(i)){let e=this.featureStore.getFeature(i);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}return t}_hasAttributesForTile(e,t){if(e){let i=this._tiles.get(e);if(i)return!i.objectIds.size||(0,te.Yy)(t,i.attributeKeys)}return!1}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,i){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,i)}_addTileStorage(e,t,i){let r=e.id;this._tiles.set(r,new be(e,t,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){let t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){let t=[];for(let i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);let i=e.key.id;this._tiles.delete(i),this._tileBounds.delete(i)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(let t of this._tiles.values()){for(let i of e)t.objectIds.delete(i);this._tileFeatureCounts.set(t.key.id,t.objectIds.size)}for(let t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,i){if(!e.length)return;let{features:r}=await t(e,i);for(let e of r){if(this._tmpBoundingRect.fill(0),null==e.geometry||0===e.geometry.vertexCount)continue;(0,se.Ie)(this._tmpBoundingRect);let t=(0,f.NO)(e.geometry,this._tmpBoundingRect);this._tileBounds.forEachInBounds(t,t=>{let i=this._tiles.get(t);this.featureStore.add(e);let r=e.objectId;i.objectIds.has(r)||(i.objectIds.add(r),this._referenceFeature(r),this._tileFeatureCounts.set(i.key.id,i.objectIds.size))})}}process(e,t=()=>!0,i){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,se.HY)((0,se.VY)(this.extent,this._tmpBoundingRect),e.extent)||this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??"")||this._hasAttributesForTile(e.id,i))return new Fe(e);let r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,i)}get debugInfo(){return Array.from(this._tiles.values()).map(({key:e})=>({key:e.toJSON(),featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,i,r){let s=this._tileFeatureCounts.get(e.id);return s??(s=await(0,pe.gW)(t,i,r),this._tileFeatureCounts.set(e.id,s)),s}_createTileTree(e,t){let i=new Te(e.level,e.row,e.col);return t.updateTileInfo(i,1),this._tileBounds.forEachInBounds(e.extent,r=>{let s=this._tiles.get(r)?.key;s&&function(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;let i=e.level<t.level,r=i?e:t,s=i?t:e,n=1<<s.level-r.level;return Math.floor(s.row/n)===r.row&&Math.floor(s.col/n)===r.col}(e,s)&&this._populateChildren(i,s,t,this._tileFeatureCounts.get(s.id)||0)}),i}_populateChildren(e,t,i,r){let s=t.level-e.level-1;if(s<0)return void(e.isLeaf=!0);let n=t.row>>s,o=t.col>>s,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,i,r);else{let s=new Te(e.level+1,n,o);i.updateTileInfo(s,1),e.children[l]=s,this._populateChildren(s,t,i,r)}}_simplify(e,t,i,r,s){let n=s*s;if(e.isLeaf)return t(this.getFeatureCount(e),s)?0:(this._remove(e),null!=i&&(i.children[r]=null),n);let o=s/2,a=o*o,l=0;for(let i=0;i<e.children.length;i++){let r=e.children[i];l+=null==r?a:this._simplify(r,t,e,i,o)}return 0===l?this._mergeChildren(e):1-l/n<Ae&&(this._purge(e),null!=i&&(i.children[r]=null),l=n),l}_mergeChildren(e){let t,i=new Set;this._forEachLeaf(e,e=>{let r=this._tiles.get(e.id);if(r){t=t?(0,te.E$)(t,r.attributeKeys):new Set(r.attributeKeys);for(let e of r.objectIds)i.has(e)||(i.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,i,t??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,i.size)}_forEachLeaf(e,t){for(let i of e.children)null!=i&&(i.isLeaf?t(i):this._forEachLeaf(i,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){let i=e.children[t];this._purge(i),e.children[t]=null}}_collectMissingTiles(e,t,i,r){let s=new Ie(i,e,this.extent);return this._collectMissingTilesRecurse(t,s,1,r),s.info}_collectMissingTilesRecurse(e,t,i,r){let s=this._tiles.has(e.id)&&!this._hasAttributesForTile(e.id,r);if(s&&t.addMissing(e.level,e.row,e.col,i),e.isLeaf)return;if(!e.hasChildren)return void(s||t.addMissing(e.level,e.row,e.col,i));let n=i/2;for(let i=0;i<e.children.length;i++){let s=e.children[i];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),n):this._collectMissingTilesRecurse(s,t,n,r)}}_referenceFeature(e){let t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){let t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],Ce.prototype,"featureStore",void 0),(0,r.Cg)([(0,a.MZ)()],Ce.prototype,"tileInfo",void 0),(0,r.Cg)([(0,a.MZ)()],Ce.prototype,"extent",void 0),(0,r.Cg)([(0,a.MZ)()],Ce.prototype,"maximumByteSize",void 0),Ce=(0,r.Cg)([(0,a.$K)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],Ce);class be{constructor(e,t,i){this.key=e,this.objectIds=t,this.attributeKeys=i}}class Te extends T.U{constructor(){super(...arguments),this.isLeaf=!1,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class Fe{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,se.Wc)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class Ie{constructor(e,t,i){this._tileInfo=e,this._extent=null,this.info=new Fe(t),null!=i&&(this._extent=(0,se.VY)(i))}addMissing(e,t,i,r){let s=new T.U(e,t,i);this._tileInfo.updateTileInfo(s,1)&&(null==this._extent||(0,se.HY)(this._extent,s.extent))&&(this.info.missingTiles.push({data:s,resolution:r}),this.info.coveredArea-=(0,se.Wc)(s.extent))}}const Ae=.18751;let Oe=class extends s.nJ{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=Promise.withResolvers(),this._elevationAligner=E(),this._elevationFilter=j(),this._symbologyCandidatesFetcher=G(),this._updatingHandles=new l.U,this._alignPointsInFeatures=async(e,t)=>{let i={query:e},r=await this.remoteClient.invoke("alignElevation",i,{signal:t});return(0,n.Te)(t),r},this._getSymbologyCandidates=async(e,t)=>{let i={candidates:e,spatialReference:this._spatialReference.toJSON()},r=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return(0,n.Te)(t),r}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};let{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:s}=e.serviceInfo,{hasZ:n}=e,a=u.A.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new S(t,n,!1),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new C.do({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:s,hasZ:n,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:r}),this._featureFetcher=new ye({store:new Ce({featureStore:this._featureStore}),url:e.serviceInfo.url,currentVersion:e.serviceInfo.currentVersion,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:u.A.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});let l="3d"===e.configuration.viewType;return this._elevationAligner=E(l,{elevationInfo:null==e.elevationInfo?null:I.A.fromJSON(e.elevationInfo),alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=j(l),this.addHandles([(0,o.wB)(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),o.OH),(0,o.wB)(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),Pe}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.suspended=e,Pe}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.outFields=new Set(e??[]),Pe}async fetchCandidates(e,t){await this._whenSetup.promise,(0,n.Te)(t);let i=function(e,t){let i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};let{distance:r,units:s,spatialRel:n,where:o,timeExtent:a,objectIds:l}=e.filter,u={geometry:e.filter.geometry?(0,h.rS)(e.filter.geometry):void 0,distance:r,units:s,spatialRel:n,timeExtent:a,objectIds:l,returnZ:i,where:o??"1=1"};return{...e,query:u}}(e,this._featureStore.hasZ),r=t?.signal,s=await this._queryEngine.executeQueryForSnapping(i,r);(0,n.Te)(r);let o=await this._elevationAligner.alignCandidates(s.candidates,u.A.fromJSON(e.point.spatialReference)??u.A.WGS84,r);(0,n.Te)(r);let a=await this._symbologyCandidatesFetcher.fetch(o,r);(0,n.Te)(r);let l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles.map(e=>T.U.fromJSON(e)),this._featureFetcher.tileInfo=null==e.tileInfo?null:b.A.fromJSON(e.tileInfo),Pe}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.refresh(),Pe}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),await(0,o.C_)(()=>!this.updating,t),(0,n.Te)(t),Pe}async getDebugInfo(e,t){return(0,n.Te)(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),(0,n.Te)(t),Pe}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),Pe}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),Pe}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),Pe}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=G(e,this._getSymbologyCandidates),Pe}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null==e.filter?null:F.A.fromJSON(e.filter),this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,r.Cg)([(0,a.MZ)({readOnly:!0})],Oe.prototype,"updating",null),(0,r.Cg)([(0,a.MZ)()],Oe.prototype,"_isInitializing",void 0),Oe=(0,r.Cg)([(0,a.$K)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],Oe);const ze=Oe,Pe={result:{}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8902],{66131(e,t,i){i.d(t,{lY:()=>c,mT:()=>m});var r=i(59534),s=i(799),n=i(3330),o=i(84741),a=i(34747);const l={TimeZoneNotRecognized:"Timezone identifier has not been recognized."};class u extends Error{constructor(e,t){super((0,s.HC)(l[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,u)}}function h(e,t,i){return e<t?e-t:e>i?e-i:0}function d(e,t,i){return e<t?t:e>i?i:e}class c{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,i=1,r=0,s=0,n=0,o=0,l){if(isNaN(e)||isNaN(t)||isNaN(i)||isNaN(r)||isNaN(s)||isNaN(n)||isNaN(o))return null;let u=a.c9.local(e,t).daysInMonth,f=a.c9.fromObject({day:d(i,1,u),year:e,month:d(t,1,12),hour:d(r,0,23),minute:d(s,0,59),second:d(n,0,59),millisecond:d(o,0,999)},{zone:m(l)});return f=f.plus({months:h(t,1,12),days:h(i,1,u),hours:h(r,0,23),minutes:h(s,0,59),seconds:h(n,0,59),milliseconds:h(o,0,999)}),new c(f)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){let i=m(t);return e.isUnknownTimeZone||i===n.GB.instance?c.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,i):new c(e._date.setZone(i))}static dateJSToArcadeDate(e){return new c(a.c9.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){let i=m(t);return new c(a.c9.fromJSDate(e,{zone:i}))}static unknownEpochToArcadeDate(e){return new c(a.c9.fromMillis(e,{zone:n.GB.instance}))}static unknownDateJSToArcadeDate(e){return new c(a.c9.fromMillis(e.getTime(),{zone:n.GB.instance}))}static epochToArcadeDate(e,t="system"){let i=m(t);return new c(a.c9.fromMillis(e,{zone:i}))}static dateTimeToArcadeDate(e){return new c(e)}clone(){return new c(this._date)}changeTimeZone(e){let t=m(e);return c.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){let i=m(t);return e.zone===n.GB.instance||i===n.GB.instance?c.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,i):new c(e.setZone(i))}static nowToArcadeDate(e){let t=m(e);return new c(a.c9.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new c(a.c9.utc())}get isSystem(){return"system"===this.timeZone||this.timeZone===c.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===n.GB.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if("system"===this._date.zone.type)return"system";let e=this.zone;return"fixed"===e.type?0===e.fixed?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new c(this._date.plus(e))}diff(e,t){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new c(this._date.toUTC())}toLocal(){return new c(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;let t=a.c9.fromISO(e,{setZone:!0});return new c(t)}}function m(e,t=!0){if(e instanceof a.bo)return e;switch((0,r.B)(e)){case"system":return"system";case"utc":return"UTC";case"unknown":return n.GB.instance}if(/^[+-]?[0-9]{1,2}(:[0-9]{2})?$/.test(e)){let t=a.mQ.parseSpecifier("UTC"+(e.startsWith("+")||e.startsWith("-")?"":"+")+e);if(t)return t}let i=(0,o.p)(e);if(!i.isValid){if(t)throw new u("TimeZoneNotRecognized");return null}return i}},59534(e,t,i){i.d(t,{B:()=>s,b:()=>n});var r=i(85935);function s(e){return e.toLowerCase().replaceAll(/[\s-]+/g,"")}class n{constructor(e,t){let i=new Map;for(let t of e){let e=s(t);if(i.has(e))throw Error(`${t} already added as ${i.get(e)}`);i.set(e,t)}if(null!=t)for(let[e,r]of t){let t=s(e);if(i.has(t))throw Error(`${e} already associated with ${i.get(t)}`);i.set(t,r)}this._enumMap=i}lookup(e){return this._enumMap.get(s(e))}get(e){let t=this.lookup(e);if(null==t)throw new r.D$("InvalidParameter",null);return t}}},85935(e,t,i){i.d(t,{D$:()=>a,O$:()=>h,i2:()=>d,mT:()=>u,ps:()=>m});var r=i(799);const s={TypeNotAllowedInFeature:"Feature attributes only support dates, numbers, strings, guids.",LogicError:"Logic error - {reason}",CannotCompareDateAndTime:"Cannot compare date or dateonly with timeonly types",NeverReach:"Encountered unreachable logic",AsyncNotEnabled:"Async Arcade must be enabled for this script",ModuleAccessorMustBeString:"Module accessor must be a string",ModuleExportNotFound:"Module has no export with provided identifier",ModulesNotSupported:"Current profile does not support modules",ArrayAccessMustBeNumber:"Array accessor must be a number",FunctionNotFound:"Function not found",FieldNotFound:"Key not found - {key}",CircularModules:"Circular module dependencies are not allowed",Cancelled:"Execution cancelled",UnsupportedHashType:"Type not supported in hash function",IllegalResult:"Value is not a supported return type",PortalRequired:"Portal is required",InvalidParameter:"Invalid parameter",WrongNumberOfParameters:"Call with wrong number of parameters",Unrecognized:"Unrecognized code structure",UnrecognizedType:"Unrecognized type",WrongSpatialReference:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",BooleanConditionRequired:"Conditions must use booleans",NoFunctionInDictionary:"Dictionaries cannot contain functions.",NoFunctionInArray:"Arrays cannot contain functions.",NoFunctionInTemplateLiteral:"Template Literals do not expect functions by value.",KeyAccessorMustBeString:"Accessor must be a string",KeyMustBeString:"Object keys must be a string",Immutable:"Object is immutable",UnexpectedToken:"Unexpected token",MemberOfNull:"Cannot access property of null object",MaximumCallDepth:"Exceeded maximum function depth",OutOfBounds:"Out of bounds",InvalidIdentifier:"Identifier not recognized",CallNonFunction:"Expression is not a function",InvalidMemberAccessKey:"Cannot access value using a key of this type",AssignModuleFunction:"Cannot assign function to module variable",UnsupportUnaryOperator:"Unsupported unary operator",UnsupportedOperator:"Unsupported operator",LogicalExpressionOnlyBoolean:"Logical expressions must be boolean",LogicExpressionOrAnd:"Logical expression can only be combined with || or &&",CannotChangeTimeZoneTime:"Cannot change the timezone of a Time",CannotChangeTimeZoneDateOnly:"Cannot change the timezone of a DateOnly",FeatureSetDoesNotHaveSubtypes:"FeatureSet does not have subtypes"};function n(e){return"object"==typeof e&&"line"in e&&"column"in e&&"number"==typeof e.line&&"number"==typeof e.column}class o extends Error{constructor(e,t){super(l(t)+("object"==typeof e&&e&&"message"in e?e.message:""),{cause:e}),this.loc=t?.loc??null}}class a extends Error{constructor(e,t,i){super("Execution error - "+l(t)+(0,r.HC)(s[e],i)),this.declaredRootClass="esri.arcade.arcadeexecutionerror",this.loc=t?.loc??null}}function l(e){return null==e?.loc?"":`Line ${e.loc.start.line}:${e.loc.start.column}: `}class u extends Error{constructor(e,t,i){super("Compilation error - "+l(t)+(0,r.HC)(s[e],i)),this.declaredRootClass="esri.arcade.arcadecompilationerror",this.loc=t?.loc??null}}class h extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror"}}function d(e,t){return!function(e){if(e instanceof Error&&"loc"in e){let t=e.loc;return null==t||"object"==typeof t&&"start"in t&&null!=t.start&&n(t.start)&&(!("end"in t)||null==t.end||n(t.end))}return!1}(e)||null==e.loc&&null!=t?.loc?new o(e,t):e}const c={UnrecognizedUri:"Unrecognized uri - {uri}",UnsupportedUriProtocol:"Unrecognized uri protocol"};class m extends Error{constructor(e,t){super((0,r.HC)(c[e],t)),this.declaredRootClass="esri.arcade.arcademoduleerror"}}},69540(e,t,i){var r=i(32198),s=i(69622),n=(i(44208),i(4718)),o=(i(53966),i(97768)),a=i(88620),l=i(64108);const u=Symbol("ClonableMixin"),h=e=>{var t;let i=e,s=class extends i{constructor(){super(...arguments),this[t]=!0}static{t=u}clone(e){let t=(0,a.oY)(this);(0,o.Lw)(t,"unable to clone instance of non-accessor class");let i=t.metadata,r=t.store,s={},l=new Map;for(let t in i){let o=i[t],a=r?.originOf(t),u=o.clonable;if(o.readOnly||!1===u||7!==a&&0!==a&&5!==a&&4!==a)continue;let h=this[t],d=null;if("function"==typeof u)d=u(h,e);else if("reference"===u)d=h;else if(d=(0,n.TU)(h,e),null!=h&&null==d)continue;0===a?l.set(t,d):s[t]=d}let u=new(0,Object.getPrototypeOf(this).constructor)(s);if(l.size){let e=(0,a.oY)(u)?.store;if(e)for(let[t,i]of l)e.set(t,i,0)}return u}};return s=(0,r.Cg)([(0,l.$)("esri.core.Clonable")],s),s},d=h(s.A);i.d(t,["OU",0,h,"Pw",0,d])},66344(e,t,i){i.d(t,{q:()=>a});const r=!!(0,i(44208).A)("esri-tests-disable-gpu-memory-measurements");Symbol.iterator;class s{get size(){return this._size}constructor(e=10485760,t=.3){this._maxSize=e,this._maxClientSizeRatio=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._clients=new Map,this._sizeLimits=new Map}destroy(){this.clearAll(),this._sizeLimits.clear(),this._clients.clear(),this._db.clear()}register(e){this._clients.set(e.id.slice(0,-1),e)}deregister(e){this.clear(e),this._sizeLimits.delete(e),this._clients.delete(e.id.slice(0,-1))}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,-1),this._checkSize()}get _maxClientSize(){return this._maxSize*this._maxClientSizeRatio}getSize(e,t){return this._db.get(e.id+t)?.size??0}put(e,t,i,s,o){t=e.id+t;let a=this._db.get(t);if(a&&(this._size-=a.size,e.size-=a.size,this._db.delete(t),a.entry!==i&&this._notifyRemove(t,a.entry,a.size,0)),s>this._maxSize)return void this._notifyRemove(t,i,s,0);if(void 0===i)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return r||console.warn(`Refusing to cache entry with size ${s} for key ${t}`),void this._notifyRemove(t,i,0,0);let l=1+Math.max(o,-4)- -3;this._db.set(t,new n(i,s,l)),this._size+=s,e.size+=s,this._checkSize()}updateSize(e,t){t=e.id+t;let i=this._db.get(t);if(!i)return;this._size-=i.size,e.size-=i.size;let r=i.entry.usedMemory;for(;r>this._maxSize;){let e=this._notifyRemove(t,i.entry,r,1);if(!(null!=e&&e>0))return void this._db.delete(t);r=e}i.size=r,this._size+=r,e.size+=r,this._checkSize()}pop(e,t){t=e.id+t;let i=this._db.get(t);if(i)return this._size-=i.size,e.size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(e,t){t=e.id+t;let i=this._db.get(t);if(void 0!==i)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}peek(e,t){let i=this._db.get(e.id+t);return i?++this._hit:++this._miss,i?.entry}get performanceInfo(){let e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},i=[];this._db.forEach((e,r)=>{let s=e.lifetime;i[s]=(i[s]||0)+e.size,this._clients.forEach(i=>{let{id:s,name:n}=i;if(r.startsWith(s)){let i=t[n]||0;t[n]=i+e.size}})});let r={};this._clients.forEach(e=>{let i=e.name;if("hitRate"in e&&"number"==typeof e.hitRate&&!isNaN(e.hitRate)&&e.hitRate>0){let s=t[i]||0;t[i]=s,r[i]=Math.round(100*e.hitRate)+"%"}else r[i]="0%"});let s=Object.keys(t);s.sort((e,i)=>t[i]-t[e]),s.forEach(i=>e[i]=Math.round(t[i]/2**20)+"MB / "+r[i]);for(let t=i.length-1;t>=0;--t){let r=i[t];r&&(e["Priority "+(t+-3-1)]=Math.round(r/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._clients.forEach(e=>e.resetHitRate())}clear(e){let t=e.id;this._db.forEach((e,i)=>{i.startsWith(t)&&(this._size-=e.size,this._db.delete(i),this._notifyRemove(i,e.entry,e.size,0))}),e.size=0}clearAll(){this._db.forEach((e,t)=>this._notifyRemove(t,e.entry,e.size,0)),this._clients.forEach(e=>e.size=0),this._size=0,this._db.clear()}*values(e){for(let[t,i]of this._db)t.startsWith(e.id)&&(yield i.entry)}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,t,i,r){let s=this._clients.get(e.split(o)[0])?.removeFunc,n=s?.(t,r,i);return"number"==typeof n?n:null}_checkSize(){this._sizeLimits.forEach((e,t)=>this._checkSizeLimits(e,t)),this._clients.forEach(e=>this._checkSizeLimits(this._maxClientSize,e)),this._checkSizeLimits(this.maxSize)}setMaxClientSize(e,t){null==t||t<=0?this._sizeLimits.delete(e):this._sizeLimits.set(e,t)}_checkSizeLimits(e,t){let i=t??this;if(i.size<=e)return;let r=t?.id,s=!0;for(;s;){s=!1;for(let[n,a]of this._db)if(0===a.lifetime&&(!r||n.startsWith(r))){let r=t??this._clients.get(n.split(o)[0]);if(this._purgeItem(n,a,r),i.size<=.9*e)return;s||=this._db.has(n)}}for(let[s,n]of this._db)if(!r||s.startsWith(r)){let r=t??this._clients.get(s.split(o)[0]);if(this._purgeItem(s,n,r),i.size<=.9*e)return}}_purgeItem(e,t,i){if(this._db.delete(e),t.lives<=1){this._size-=t.size,i&&(i.size-=t.size);let r=this._notifyRemove(e,t.entry,t.size,1);null!=r&&r>0&&(this._size+=r,i&&(i.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(e,t))}else--t.lives,this._db.set(e,t)}}new s(0);class n{constructor(e,t,i){this.entry=e,this.size=t,this.lifetime=i,this.lives=i}}const o=":";class a{constructor(e,t){this.removeFunc=t,this.id="",this.name="",this.size=0,this._storage=new s(e,1),this._storage.register(this)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,t,i=1){this._storage.put(this,e,t,i,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}}},60999(e,t,i){i.d(t,{DZ:()=>f,Ke:()=>m,QA:()=>p,Tj:()=>h,UT:()=>g,aD:()=>_,jJ:()=>u});var r=i(32198),s=i(69622),n=i(97768),o=i(17676),a=i(10107),l=i(64108);function u(e,t,i){return(0,o.Lx)(e.map((e,r)=>t.apply(i,[e,r])))}async function h(e,t,i){return(await(0,o.Lx)(e.map((e,r)=>t.apply(i,[e,r])))).map(e=>e.value)}function d(e){return{ok:!0,value:e}}function c(e){return{ok:!1,error:e}}async function m(e){if(null==e)return{ok:!1,error:Error("no promise provided")};try{return d(await e)}catch(e){return c(e)}}async function f(e){try{return d(await e)}catch(e){return(0,o.QP)(e),c(e)}}function p(e){if(!0===e.ok)return e.value;throw e.error}function g(e,t){return new y(e,t)}let y=class extends s.A{get value(){return null!=(e=this._result)&&!0===e.ok?e.value:null;var e}get error(){return null!=(e=this._result)&&!1===e.ok?e.error:null;var e}get finished(){return null!=this._result}constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=(0,n.DC)(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;let{signal:i}=this._abortController;this.promise=e(i),this.promise.then(e=>{this._result=d(e),this._cleanup()},e=>{this._result=c(e),this._cleanup()}),this._abortHandle=(0,o.u7)(t,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=(0,n.xt)(this._abortHandle),this._abortController=null}};(0,r.Cg)([(0,a.MZ)()],y.prototype,"value",null),(0,r.Cg)([(0,a.MZ)()],y.prototype,"error",null),(0,r.Cg)([(0,a.MZ)()],y.prototype,"finished",null),(0,r.Cg)([(0,a.MZ)()],y.prototype,"promise",void 0),(0,r.Cg)([(0,a.MZ)()],y.prototype,"_result",void 0),y=(0,r.Cg)([(0,l.$)("esri.core.asyncUtils.ReactiveTask")],y);class _{constructor(){this._sequence=Promise.resolve()}async acquire(){let e;this._sequence=new Promise(t=>{e=this._sequence.then(()=>t,()=>t)});let t=await e;return{[Symbol.dispose]:t}}async run(e){let t={stack:[],error:void 0,hasError:!1};try{return(0,r.mS)(t,await this.acquire(),!1),await e()}catch(e){t.error=e,t.hasError=!0}finally{(0,r.hk)(t)}}}},9093(e,t,i){function r(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}i.d(t,{o8:()=>s,vt:()=>r});const n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:n,clone:s,create:r,fromValues:function(e,t,i,r,s,n,o,a,l,u,h,d,c,m,f,p){return[e,t,i,r,s,n,o,a,l,u,h,d,c,m,f,p]}},Symbol.toStringTag,{value:"Module"})),i.d(t,["zK",0,n])},35522(e,t,i){i.d(t,{$A:()=>b,Bw:()=>n,C:()=>o,Cc:()=>T,DI:()=>M,Io:()=>_,Ln:()=>y,Om:()=>C,Qr:()=>d,Re:()=>u,S8:()=>S,T9:()=>p,WQ:()=>l,Z0:()=>F,_S:()=>m,aI:()=>E,ei:()=>I,fw:()=>O,gL:()=>A,hG:()=>v,hZ:()=>a,hs:()=>g,jk:()=>f,lw:()=>h,m3:()=>x,oW:()=>R,t2:()=>Z,tn:()=>c,ze:()=>w});var r=i(51850),s=i(34304);function n(e){let t=e[0],i=e[1],r=e[2];return Math.sqrt(t*t+i*i+r*r)}function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function a(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e}function l(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function u(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function h(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function d(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e}function c(e,t){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e}function m(e,t){return e[0]=Math.sign(t[0]),e[1]=Math.sign(t[1]),e[2]=Math.sign(t[2]),e}function f(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function p(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function g(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function y(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e}function _(e,t){let i=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(i*i+r*r+s*s)}function v(e,t){let i=t[0]-e[0],r=t[1]-e[1],s=t[2]-e[2];return i*i+r*r+s*s}function x(e){let t=e[0],i=e[1],r=e[2];return t*t+i*i+r*r}function w(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function M(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function S(e,t=e){let i=t[0],r=t[1],s=t[2],n=i*i+r*r+s*s;return n>0&&(n=1/Math.sqrt(n),e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n),e}function C(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function b(e,t,i){let r=t[0],s=t[1],n=t[2],o=i[0],a=i[1],l=i[2];return e[0]=s*l-n*a,e[1]=n*o-r*l,e[2]=r*a-s*o,e}function T(e,t,i,r){let s=t[0],n=t[1],o=t[2];return e[0]=s+r*(i[0]-s),e[1]=n+r*(i[1]-n),e[2]=o+r*(i[2]-o),e}function F(e,t,i){let r=t[0],s=t[1],n=t[2];return e[0]=i[0]*r+i[4]*s+i[8]*n+i[12],e[1]=i[1]*r+i[5]*s+i[9]*n+i[13],e[2]=i[2]*r+i[6]*s+i[10]*n+i[14],e}function I(e,t,i){let r=t[0],s=t[1],n=t[2];return e[0]=r*i[0]+s*i[3]+n*i[6],e[1]=r*i[1]+s*i[4]+n*i[7],e[2]=r*i[2]+s*i[5]+n*i[8],e}function A(e,t,i){return O(e,t,i[0],i[1],i[2],i[3])}function O(e,t,i,r,s,n){let o=t[0],a=t[1],l=t[2],u=r*l-s*a,h=s*o-i*l,d=i*a-r*o,c=r*d-s*h,m=s*u-i*d,f=i*h-r*u,p=2*n;return e[0]=o+u*p+2*c,e[1]=a+h*p+2*m,e[2]=l+d*p+2*f,e}const z=(0,r.vt)(),P=(0,r.vt)();function Z(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function E(e,t){if(e===t)return!0;let i=e[0],r=e[1],n=e[2],o=t[0],a=t[1],l=t[2],u=(0,s.FD)();return Math.abs(i-o)<=u*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-a)<=u*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=u*Math.max(1,Math.abs(n),Math.abs(l))}function R(e,t,i){let r=i[0]-t[0],s=i[1]-t[1],n=i[2]-t[2],o=r*r+s*s+n*n;return o>0?(o=1/Math.sqrt(o),e[0]=r*o,e[1]=s*o,e[2]=n*o,e):(e[0]=0,e[1]=0,e[2]=0,e)}const D=u,B=h,N=d,k=_,L=v,Y=n,U=x;Object.freeze(Object.defineProperty({__proto__:null,abs:c,add:l,angle:function(e,t){S(z,e),S(P,t);let i=C(z,P);return i>1?0:i<-1?Math.PI:Math.acos(i)},bezier:function(e,t,i,r,s,n){let o=1-n,a=o*o,l=n*n,u=a*o,h=3*n*a,d=3*l*o,c=l*n;return e[0]=t[0]*u+i[0]*h+r[0]*d+s[0]*c,e[1]=t[1]*u+i[1]*h+r[1]*d+s[1]*c,e[2]=t[2]*u+i[2]*h+r[2]*d+s[2]*c,e},ceil:function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},clamp:function(e,t=0,i=1){return e[0]=Math.min(Math.max(e[0],t),i),e[1]=Math.min(Math.max(e[1],t),i),e[2]=Math.min(Math.max(e[2],t),i),e},copy:o,cross:b,crossAndNormalize:function(e,t,i){let r=t[0],s=t[1],n=t[2],o=i[0],a=i[1],l=i[2],u=s*l-n*a,h=n*o-r*l,d=r*a-s*o,c=Math.sqrt(u*u+h*h+d*d);return e[0]=u/c,e[1]=h/c,e[2]=d/c,e},direction:R,dist:k,distance:_,div:N,divide:d,dot:C,equals:E,exactEquals:Z,floor:function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},hermite:function(e,t,i,r,s,n){let o=n*n,a=o*(2*n-3)+1,l=o*(n-2)+n,u=o*(n-1),h=o*(3-2*n);return e[0]=t[0]*a+i[0]*l+r[0]*u+s[0]*h,e[1]=t[1]*a+i[1]*l+r[1]*u+s[1]*h,e[2]=t[2]*a+i[2]*l+r[2]*u+s[2]*h,e},inverse:M,len:Y,length:n,lerp:T,max:p,min:f,mul:B,multiply:h,negate:w,normalize:S,random:function(e,t=1){let i=s.Ov,r=2*i()*Math.PI,n=2*i()-1,o=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*o,e[1]=Math.sin(r)*o,e[2]=n*t,e},rotateX:function(e,t,i,r){let s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0],n[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),n[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e},rotateY:function(e,t,i,r){let s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),n[1]=s[1],n[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e},rotateZ:function(e,t,i,r){let s=[],n=[];return s[0]=t[0]-i[0],s[1]=t[1]-i[1],s[2]=t[2]-i[2],n[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),n[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),n[2]=s[2],e[0]=n[0]+i[0],e[1]=n[1]+i[1],e[2]=n[2]+i[2],e},round:function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},scale:g,scaleAndAdd:y,scaleTo:function(e,t){return g(e,e,t/Y(e))},set:a,sign:m,sqrDist:L,sqrLen:U,squaredDistance:v,squaredLength:x,str:function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},sub:D,subtract:u,transformMat3:I,transformMat4:F,transformMat4Z:function(e,t){return t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]},transformQuat:A,transformQuatValues:O},Symbol.toStringTag,{value:"Module"})),i.d(t,["Il",0,Y,"jb",0,D,"lo",0,L,"uE",0,U])},75503(e,t,i){i.d(t,{wq:()=>a});var r=i(4576),s=i(21818),n=(i(44208),i(15142)),o=i(11006);class a{constructor(e=9,t){this._compareMinX=c,this._compareMinY=m,this._toBBox=e=>e,this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&("function"==typeof t?this._toBBox=t:this._initFormat(t)),this.clear()}destroy(){this.clear(),w.prune(),M.prune(),S.prune(),C.prune()}all(e){l(this._data,e)}search(e,t){let i=this._data,r=this._toBBox;if(v(e,i))for(w.clear();i;){for(let s=0,n=i.children.length;s<n;s++){let n=i.children[s],o=i.leaf?r(n):n;v(e,o)&&(i.leaf?t(n):_(e,o)?l(n,t):w.push(n))}i=w.pop()}}collides(e){let t=this._data,i=this._toBBox;if(!v(e,t))return!1;for(w.clear();t;){for(let r=0,s=t.children.length;r<s;r++){let s=t.children[r],n=t.leaf?i(s):s;if(v(e,n)){if(t.leaf||_(e,n))return!0;w.push(s)}}t=w.pop()}return!1}load(e){if(!e.length)return this;if(e.length<this._minEntries){for(let t=0,i=e.length;t<i;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this._data.children.length)if(this._data.height===t.height)this._splitRoot(this._data,t);else{if(this._data.height<t.height){let e=this._data;this._data=t,t=e}this._insert(t,this._data.height-t.height-1,!0)}else this._data=t;return this}insert(e){return e&&this._insert(e,this._data.height-1),this}clear(){return this._data=new F([]),this}remove(e){if(!e)return this;let t,i=this._data,n=null,o=0,a=!1,l=this._toBBox(e);for(S.clear(),C.clear();i||S.length>0;){if(i||(i=S.pop(),n=S.data[S.length-1],o=C.pop()??0,a=!0),i.leaf&&(t=(0,r.qh)(i.children,(0,s.z)(e),i.children.length,i.indexHint),-1!==t))return i.children.splice(t,1),S.push(i),this._condense(S),this;a||i.leaf||!_(i,l)?n?(o++,i=n.children[o],a=!1):i=null:(S.push(i),C.push(o),o=0,n=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(e){return this._data=e,this}_build(e,t,i,r){let s=i-t+1,n=this._maxEntries;if(s<=n){let r=new F(e.slice(t,i+1));return u(r,this._toBBox),r}r||(r=Math.ceil(Math.log(s)/Math.log(n)),n=Math.ceil(s/n**(r-1)));let o=new I([]);o.height=r;let a=Math.ceil(s/n),l=a*Math.ceil(Math.sqrt(n));x(e,t,i,l,this._compareMinX);for(let s=t;s<=i;s+=l){let t=Math.min(s+l-1,i);x(e,s,t,a,this._compareMinY);for(let i=s;i<=t;i+=a){let s=Math.min(i+a-1,t);o.children.push(this._build(e,i,s,r-1))}}return u(o,this._toBBox),o}_insert(e,t,i){let r=this._toBBox,s=i?e:r(e);S.clear();let n=function(e,t,i,r){for(;r.push(t),!0!==t.leaf&&r.length-1!==i;){let i,r=1/0,s=1/0;for(let n=0,o=t.children.length;n<o;n++){let o=t.children[n],a=f(o),l=g(e,o)-a;l<s?(s=l,r=a<r?a:r,i=o):l===s&&a<r&&(r=a,i=o)}t=i||t.children[0]}return t}(s,this._data,t,S);for(n.children.push(e),d(n,s);t>=0&&S.data[t].children.length>this._maxEntries;)this._split(S,t),t--;!function(e,t,i){for(let r=i;r>=0;r--)d(t.data[r],e)}(s,S,t)}_split(e,t){let i=e.data[t],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);let n=this._chooseSplitIndex(i,s,r);if(!n)return;let o=i.children.splice(n,i.children.length-n),a=i.leaf?new F(o):new I(o);a.height=i.height,u(i,this._toBBox),u(a,this._toBBox),t?e.data[t-1].children.push(a):this._splitRoot(i,a)}_splitRoot(e,t){this._data=new I([e,t]),this._data.height=e.height+1,u(this._data,this._toBBox)}_chooseSplitIndex(e,t,i){let r,s,n;r=s=1/0;for(let o=t;o<=i-t;o++){let t=h(e,0,o,this._toBBox),a=h(e,o,i,this._toBBox),l=y(t,a),u=f(t)+f(a);l<r?(r=l,n=o,s=u<s?u:s):l===r&&u<s&&(s=u,n=o)}return n}_chooseSplitAxis(e,t,i){let r=e.leaf?this._compareMinX:c,s=e.leaf?this._compareMinY:m;this._allDistMargin(e,t,i,r)<this._allDistMargin(e,t,i,s)&&e.children.sort(r)}_allDistMargin(e,t,i,r){e.children.sort(r);let s=this._toBBox,n=h(e,0,t,s),o=h(e,i-t,i,s),a=p(n)+p(o);for(let r=t;r<i-t;r++){let t=e.children[r];d(n,e.leaf?s(t):t),a+=p(n)}for(let r=i-t-1;r>=t;r--){let t=e.children[r];d(o,e.leaf?s(t):t),a+=p(o)}return a}_condense(e){for(let t=e.length-1;t>=0;t--){let i=e.data[t];if(0===i.children.length)if(t>0){let s=e.data[t-1],n=s.children;n.splice((0,r.qh)(n,i,n.length,s.indexHint),1)}else this.clear();else u(i,this._toBBox)}}_initFormat(e){let t=["return a"," - b",";"];this._compareMinX=Function("a","b",t.join(e[0])),this._compareMinY=Function("a","b",t.join(e[1])),this._toBBox=Function("a","return {minX: a"+e[0]+", minY: a"+e[1]+", maxX: a"+e[2]+", maxY: a"+e[3]+"};")}}function l(e,t){let i=e;for(M.clear();i;){if(!0===i.leaf)for(let e of i.children)t((0,s.z)(e));else M.pushArray(i.children);i=M.pop()??null}}function u(e,t){h(e,0,e.children.length,t,e)}function h(e,t,i,r,s){s||=new F([]),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let n,o=t;o<i;o++)n=e.children[o],d(s,e.leaf?r(n):n);return s}function d(e,t){e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY)}function c(e,t){return e.minX-t.minX}function m(e,t){return e.minY-t.minY}function f(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function p(e){return e.maxX-e.minX+(e.maxY-e.minY)}function g(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function y(e,t){let i=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),s=Math.min(e.maxX,t.maxX),n=Math.min(e.maxY,t.maxY);return Math.max(0,s-i)*Math.max(0,n-r)}function _(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function v(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function x(e,t,i,r,s){let n=[t,i];for(;n.length;){let t=n.pop(),i=n.pop();if(t-i<=r)continue;let a=i+Math.ceil((t-i)/r/2)*r;(0,o.q)(e,a,i,t,s),n.push(i,a,a,t)}}const w=new n.A,M=new n.A,S=new n.A,C=new n.A({deallocator:void 0});class b{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class T extends b{constructor(){super(...arguments),this.height=1,this.indexHint=new r.vW}}class F extends T{constructor(e){super(),this.children=e,this.leaf=!0}}class I extends T{constructor(e){super(),this.children=e,this.leaf=!1}}},36708(e,t,i){i.d(t,{C_:()=>c,on:()=>d,wB:()=>l,z7:()=>u});var r=i(37955),s=i(36563),n=i(97768),o=i(17676),a=i(14012);function l(e,t,i={}){return h(e,t,i,m)}function u(e,t,i={}){return h(e,t,i,f)}function h(e,t,i={},r){let s=null,o=i.once?(e,i)=>{r(e)&&((0,n.xt)(s),t(e,i))}:(e,i)=>{r(e)&&t(e,i)};if(s=(0,a.Cn)(e,o,i.sync,i.equals),i.initial){let t=e();o(t,t)}return s}function d(e,t,i,o={}){let a=null,u=null,h=null;function d(){a&&u&&(u.remove(),o.onListenerRemove?.(a),a=null,u=null)}function c(e){o.once&&o.once&&(0,n.xt)(h),i(e)}let m=l(e,(e,i)=>{d(),(0,r.wb)(e)&&(a=e,u=(0,r.on)(e,t,c),o.onListenerAdd?.(e))},{sync:o.sync,initial:!0});return h=(0,s.hA)(()=>{m.remove(),d()}),h}function c(e,t){return function(e,t,i){if((0,o.G4)(i))return Promise.reject((0,o.NK)());let r=e();if(t?.(r))return Promise.resolve(r);let a=null;function l(){a=(0,n.xt)(a)}return new Promise((r,n)=>{a=(0,s.vE)([(0,o.u7)(i,()=>{l(),n((0,o.NK)())}),h(e,e=>{l(),r(e)},{sync:!1,once:!0},t??m)])})}(e,f,t)}function m(e){return!0}function f(e){return!!e}i(80559),i.d(t,["OH",0,{sync:!0},"Vh",0,{initial:!0},"pc",0,{sync:!0,initial:!0}])},44794(e,t,i){i.d(t,{v:()=>a});var r=i(4718),s=i(62788),n=i(95488);class o{constructor(e,t){this._observable=new n.I,this._value=e,this._equalityFunction=t}get value(){return(0,s.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function a(e,t=r.gh){return new o(e,t)}},44729(e,t,i){i.d(t,{n:()=>l});var r=i(66131),s=i(73444),n=i(34747);function o(e){e=e.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let t="";for(let i of e.match(/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g)||[])switch(i){case"D":t+="d";break;case"DD":t+="dd";break;case"DDD":t+="o";break;case"d":t+="c";break;case"ddd":t+="ccc";break;case"dddd":t+="cccc";break;case"M":t+="L";break;case"MM":t+="LL";break;case"MMM":t+="LLL";break;case"MMMM":t+="LLLL";break;case"YY":t+="yy";break;case"Y":case"YYYY":t+="yyyy";break;case"Q":t+="q";break;case"X":case"x":t+=i;break;default:i.length>=2&&i.startsWith("[")&&i.endsWith("]")?t+=`'${i.slice(1,-1)}'`:t+=`'${i}'`}return t}const a="esri.core.sql.dateonly";class l{constructor(e,t,i){this._year=e,this._month=t,this._day=i,this.declaredRootClass=a}static isDateOnly(e){return"object"==typeof e&&!!e&&"declaredRootClass"in e&&e.declaredRootClass===a}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return l.isDateOnly(e)&&e.day===this.day&&e.month===this.month&&e.year===this.year}compare(e){return this.year===e.year?this.month===e.month?this.day-e.day:this.month-e.month:this.year-e.year}clone(){return new l(this._year,this._month,this._day)}toDateTime(e){return n.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toDateTimeLuxon(e){return n.c9.fromObject({day:this.day,month:this.month,year:this.year},{zone:(0,r.mT)(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(null===e||""===e)return this.toString();if(t&&(e=o(e)),!e)return"";let i=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(i).toFormat(e,{locale:(0,s.JK)(),numberingSystem:"latn"})}toArcadeDate(){let e=this.toDateTime("unknown");return r.lY.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return l.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return n.c9.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){let t=n.c9.fromMillis(e,{zone:n.mQ.utcInstance});return t.isValid?l.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){let t=n.c9.fromSeconds(e,{zone:n.mQ.utcInstance});return t.isValid?l.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;let t=e.indexOf("-");if(t<0)return null;let i=e.indexOf("-",t+1);return i<0?null:new l(parseInt(e.slice(0,t),10),parseInt(e.slice(t+1,i),10),parseInt(e.slice(i+1),10))}static fromParts(e,t,i){let r=new l(e,t,i);return!1===r.isValid?null:r}static fromDateJS(e){return l.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return l.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e||null===e)return null;let i=[];if(t)(t=o(t))&&i.push(t);else if(null===t||""===t){let t=n.c9.fromISO(e,{setZone:!0});return t.isValid?l.fromParts(t.year,t.month,t.day):null}for(let r of i){let i=n.c9.fromFormat(e,t??r);if(i.isValid)return new l(i.year,i.month,i.day)}return null}static fromNow(e="system"){let t=n.c9.fromJSDate(new Date).setZone((0,r.mT)(e));return new l(t.year,t.month,t.day)}}},15032(e,t,i){i.d(t,{k:()=>l});var r=i(73444),s=i(54218),n=i(34747);function o(e){if(!e)return"";let t=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g,i="";for(let r of e.match(t)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":i+=r;break;case"A":case"a":i+="a";break;default:i+=`'${r}'`}return i}const a="esri.core.sql.timeonly";class l{constructor(e,t,i,r){this._hour=e,this._minute=t,this._second=i,this._millisecond=r,this.declaredRootClass=a}static isTimeOnly(e){return"object"==typeof e&&!!e&&"declaredRootClass"in e&&e.declaredRootClass===a}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return l.isTimeOnly(e)&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new l(this.hour,this.minute,this.second,this.millisecond)}isValid(){return(0,s.Fq)(this.hour)&&(0,s.Fq)(this.minute)&&(0,s.Fq)(this.second)&&(0,s.Fq)(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return null===e||""===e?this.toString():(e=o(e))?n.c9.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:(0,r.JK)(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,i,r){let s=new l(e,t,i,r);return s.isValid()?s:null}static fromReader(e){if(!e)return null;let t=e.indexOf(":");if(t<0)return null;let i=e.indexOf(":",t+1);return i<0?null:new l(parseInt(e.slice(0,t),10),parseInt(e.slice(t+1,i),10),parseInt(e.slice(i+1),10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;let t=Math.floor(e/1e3%60),i=Math.floor(e/6e4%60),r=Math.floor(e/36e5%24),s=Math.floor(e%1e3);return new l(r,i,t,s)}static fromDateJS(e){return new l(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new l(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(""===e||null===e)return null;let i=[];t?(t=o(t))&&i.push(t):(null===t||""===t)&&(i.push("HH:mm:ss"),i.push("HH:mm:ss.SSS"),i.push("hh:mm:ss a"),i.push("hh:mm:ss.SSS a"),i.push("HH:mm"),i.push("hh:mm a"),i.push("H:mm"),i.push("h:mm a"),i.push("H:mm:ss"),i.push("h:mm:ss a"),i.push("H:mm:ss.SSS"),i.push("h:mm:ss.SSS a"));for(let t of i){let i=n.c9.fromFormat(e,t);if(i.isValid)return new l(i.hour,i.minute,i.second,i.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return l.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return n.c9.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return"M"===t?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}},79897(e,t,i){i.d(t,{U:()=>h});var r=i(32198),s=i(69622),n=i(36563),o=i(36708),a=i(76030),l=i(10107),u=i(64108);let h=class extends s.A{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,i={}){return this._installWatch(e,t,i,o.wB)}addWhen(e,t,i={}){return this._installWatch(e,t,i,o.z7)}addOnCollectionChange(e,t,{initial:i=!1,final:r=!1}={}){let s=++this._handleId;return this.addHandles([(0,o.on)(e,"after-changes",this._createSyncUpdatingCallback(),o.OH),(0,o.on)(e,"change",t,{onListenerAdd:i?e=>t({added:e.toArray(),removed:[]}):void 0,onListenerRemove:r?e=>t({added:[],removed:e.toArray()}):void 0})],s),(0,n.hA)(()=>this.removeHandles(s))}consumePromise(e){this.addPromise(e)?.catch(()=>{})}addPromise(e){if(null==e)return e;let t=++this._handleId;this.addHandles((0,n.hA)(()=>{this._pendingPromises.delete(e)&&0===this._pendingPromises.size&&!this.hasHandles(d)&&this._set("updating",!1)}),t),this._pendingPromises.add(e),this._set("updating",!0);let i=()=>this.removeHandles(t);return e.then(i,i),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,i={},r){let s=++this._handleId;i.sync||this._installSyncUpdatingWatch(e,s);let o=r(e,t,i);return this.addHandles(o,s),(0,n.hA)(()=>this.removeHandles(s))}_installSyncUpdatingWatch(e,t){let i=this._createSyncUpdatingCallback(),r=(0,o.wB)(e,i,{sync:!0,equals:()=>!1});return this.addHandles(r,t),r}_createSyncUpdatingCallback(){return()=>{this.removeHandles(d),++this._scheduleHandleId;let e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles((0,a._)(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(d))}),d)}}};(0,r.Cg)([(0,l.MZ)({readOnly:!0})],h.prototype,"updating",void 0),h=(0,r.Cg)([(0,u.$)("esri.core.support.UpdatingHandles")],h);const d=-42},88930(e,t,i){i.d(t,{S1:()=>a,VW:()=>l,lL:()=>u,rb:()=>h,t:()=>d});var r=i(97770),s=(i(98623),i(34747));const n=/^(?<hh>([01][0-9])|(2[0-3])):(?<mm>[0-5][0-9])(:(?<ss>[0-5][0-9]))?(\.(?<ms>\d+))?$/,o={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8,unknown:NaN};function a(e,t,i,n="system"){if("unknown"===i)return e;let o=new s.oh((0,r.wj)(n)),a=s.c9.fromJSDate(e,{zone:o}),l="decades"===i||"centuries"===i?"year":function(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}(i);return"decades"===i&&(t*=10),"centuries"===i&&(t*=100),a.plus({[l]:t}).toJSDate()}function l(e,t,i="milliseconds"){let r=e.getTime(),s=d(t,i,"milliseconds");return new Date(r+s)}function u(e,t,i="system"){let{unit:n}=t,o=Math.max(1,Math.trunc(t.value)),a=new s.oh((0,r.wj)(i)),l=s.c9.fromJSDate(e,{zone:a}),u=e=>e-e%o;switch(n){case"milliseconds":return l.startOf("second").plus({millisecond:u(l.millisecond)}).toJSDate();case"seconds":return l.startOf("minute").plus({second:u(l.second)}).toJSDate();case"minutes":return l.startOf("hour").plus({minute:u(l.minute)}).toJSDate();case"hours":return l.startOf("day").plus({hour:u(l.hour)}).toJSDate();case"days":return l.startOf("month").plus({day:u(l.day-1)}).toJSDate();case"weeks":{let e=l.startOf("year").startOf("week"),t=Math.floor(l.diff(e,"weeks").weeks);return e.plus({week:u(t)}).toJSDate()}case"months":return l.startOf("year").plus({month:u(l.month-1)}).toJSDate();case"years":case"decades":case"centuries":{let e=l.startOf("year"),t=("decades"===n?10:"centuries"===n?100:1)*o,i=e.year-e.year%t;return e.set({year:i}).toJSDate()}case"unknown":return e}}function h(e){let t=n.exec(e);if(!t)return null;let{hh:i,mm:r,ss:s,ms:a}=t.groups;return Number(i)*o.hours+Number(r)*o.minutes+Number(s||0)*o.seconds+Number(a||0)}function d(e,t,i){return 0===e?0:e*o[t]/o[i]}},13069(e,t,i){i.d(t,{AG:()=>a,lk:()=>s,vD:()=>o,yS:()=>n});const r="randomUUID"in crypto;function s(){if(r)return crypto.randomUUID();let e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;let t=t=>e[t].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}function n(){return`{${s().toUpperCase()}}`}function o(){return`{${s()}}`}function a(e){let t=e.toUpperCase();return e.startsWith("{")?t:`{${t}}`}},87992(e,t,i){i.d(t,{JR:()=>C,ME:()=>w,MY:()=>T,NO:()=>x,Nh:()=>S,V2:()=>z,_s:()=>P,e6:()=>E,gh:()=>M,jm:()=>b,tr:()=>D,uX:()=>p});var r=i(32198),s=i(16930),n=i(19419),o=i(60408),a=i(21325),l=i(513),u=i(50954),h=i(79567),d=i(52006),c=i(49663),m=i(46068),f=i(92722);class p{constructor({type:e,spatialReference:t,vertexCount:i,vertexXY:r,vertexZ:s,vertexM:n,partCount:o,partOffsets:a,partFlags:l,segmentFlags:u,segmentIndices:h,segmentParams:d,segmentCountArc:c,segmentCountBezier:m}){this.segmentCountArc=0,this.segmentCountBezier=0,this.type=e,this.spatialReference=t,this.vertexCount=i,this.vertexXY=r,this.vertexZ=s,this.vertexM=n,this.partCount=o,this.partOffsets=a,this.partFlags=l,this.segmentFlags=u,this.segmentIndices=h,this.segmentParams=d,this.segmentCountArc=c,this.segmentCountBezier=m}get segmentParamCount(){return 10*this.segmentCountArc+4*this.segmentCountBezier}get segmentCountLine(){let{segmentCount:e,segmentCountArc:t,segmentCountBezier:i}=this;return e&&e-t-i}get segmentCount(){return"polyline"===this.type?this.vertexCount-this.partCount:"polygon"===this.type?this.vertexCount:0}get hasZ(){return null!=this.vertexZ}get hasM(){return null!=this.vertexM}hasCurves(){return this.segmentCountArc+this.segmentCountBezier>0}isMultipart(){return"polyline"===this.type||"polygon"===this.type}get usedMemory(){function e(e){return e?64+e.byteLength:0}return e(this.vertexXY)+e(this.vertexZ)+e(this.vertexM)+e(this.partOffsets)+e(this.partFlags)+e(this.segmentFlags)+e(this.segmentIndices)+e(this.segmentParams)}clone(){let{type:e,vertexCount:t,partCount:i,hasZ:r,hasM:s,segmentCountArc:n,segmentCountBezier:o}=this,a=z(e,t,i,r,s,this.hasCurves(),n,o);a.spatialReference=this.spatialReference;let{vertexXY:l,vertexZ:u,vertexM:h}=this;if(a.vertexXY.set(l.subarray(0,2*t),0),a.vertexZ?.set(u.subarray(0,t),0),a.vertexM?.set(h.subarray(0,t),0),this.isMultipart()){let{partOffsets:e,partFlags:t}=this;a.partFlags.set(t.subarray(0,i+1)),a.partOffsets.set(e.subarray(0,i+1))}if(this.hasCurves()){let{segmentFlags:e,segmentIndices:i,segmentParams:r,segmentParamCount:s}=this;a.segmentFlags.set(e.subarray(0,t),0),a.segmentIndices.set(i.subarray(0,t),0),a.segmentParams.set(r.subarray(0,s),0)}return a}equals(e){return this.equalsWithinTolerance(e,0)}equalsWithinTolerance(e,t){if(null==e)return!1;if(this===e)return!0;if(!(0,a.aI)(this.spatialReference,e.spatialReference)||this.vertexCount!==e.vertexCount||this.partCount!==e.partCount||this.hasZ!==e.hasZ||this.hasM!==e.hasM||this.hasCurves()!==e.hasCurves()||this.segmentCountArc!==e.segmentCountArc||this.segmentCountBezier!==e.segmentCountBezier)return!1;let i=0===t?(e,t)=>e!==t||isNaN(e)!==isNaN(t):(e,i)=>Math.abs(e-i)>t||isNaN(e)!==isNaN(i);for(let t=0;t<this.vertexCount;++t)if(i(this.vertexXY[2*t],e.vertexXY[2*t])||i(this.vertexXY[2*t+1],e.vertexXY[2*t+1]))return!1;if(this.hasZ)for(let t=0;t<this.vertexCount;++t)if(i(this.vertexZ[t],e.vertexZ[t]))return!1;if(this.hasM)for(let t=0;t<this.vertexCount;++t)if(i(this.vertexM[t],e.vertexM[t]))return!1;for(let t=0;t<this.partCount;++t)if(this.partFlags[t]!==e.partFlags[t]||this.partOffsets[t]!==e.partOffsets[t])return!1;if(this.hasCurves()){for(let t=0;t<this.vertexCount;++t)if(this.segmentFlags[t]!==e.segmentFlags[t]||this.segmentIndices[t]!==e.segmentIndices[t])return!1;for(let t=0;t<this.segmentParamCount;++t)if(i(this.segmentParams[t],e.segmentParams[t]))return!1}return!0}get parts(){return this.isMultipart()?new g(this):[][Symbol.iterator]()}}class g{constructor(e){this.geometry=e,this.value=new y(e)}get done(){return this.value.index>=this.geometry.partCount}next(){return++this.value.index,this}[Symbol.iterator](){return this}}class y{constructor(e){this.geometry=e,this.index=-1,this._readVertex=A(e),this._segments=new _(this)}get segments(){return this._segments.reset(),this._segments}get startVertex(){return this._readVertex(this.geometry.partOffsets[this.index])}get vertexCount(){let e=this.geometry.partOffsets;return e[this.index+1]-e[this.index]}}class _{constructor(e){this._part=e,this._partStart=0,this._partEnd=0,this.value=new v(e.geometry)}get _partIsClosed(){return!!(1&this._part.geometry.partFlags?.[this._part.index])}get done(){return this.value.indexOfStartVertex>this._partEnd}next(){++this.value.indexOfStartVertex;let e=this.value.indexOfStartVertex>=this._partEnd;return this.value.indexOfEndVertex=e&&this._partIsClosed?this._partStart:this.value.indexOfStartVertex+1,this}[Symbol.iterator](){return this}reset(){let{index:e}=this._part,t=this._part.geometry.partOffsets;this._partStart=t[e],this._partEnd=t[e+1]-(this._partIsClosed?1:2),this.value.indexOfStartVertex=this._partStart-1}}class v{constructor(e){this.geometry=e,this.indexOfStartVertex=-1,this.indexOfEndVertex=-1,this._readVertex=A(e)}get xStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex]}get yStart(){return this.geometry.vertexXY[2*this.indexOfStartVertex+1]}get zStart(){return this.geometry.vertexZ[this.indexOfStartVertex]}get mStart(){return this.geometry.vertexM[this.indexOfStartVertex]}get xEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex]}get yEnd(){return this.geometry.vertexXY[2*this.indexOfEndVertex+1]}get zEnd(){return this.geometry.vertexZ[this.indexOfEndVertex]}get mEnd(){return this.geometry.vertexM[this.indexOfEndVertex]}get start(){return this._readVertex(this.indexOfStartVertex)}get end(){return this._readVertex(this.indexOfEndVertex)}get curve(){let e=this.geometry.segmentFlags?.[this.indexOfStartVertex]??1;if(1===e)return this.end;let t=this.geometry.segmentParams,i=this.geometry.segmentIndices[this.indexOfStartVertex];if(2===e){let e=t[i++],r=t[i++],s=t[i++],n=t[i++];return{b:[this.end,[e,r],[s,n]]}}let r=t[i++],s=t[i++],n=t[i++],o=t[i++],a=t[i++],l=t[i++];i++,i++;let u=t[i++],h=t[i++];if(!(4&r)&&1===n)return{c:[this.end,[u,h]]};let d=2&r?0:1,c=1&r?0:1;return{a:[this.end,[a,l],d,c,o,s,n]}}}function x(e,t){let i={stack:[],error:void 0,hasError:!1};try{return t??=(0,n.Ie)(),(0,r.mS)(i,new F(e,["vertexZ","vertexM","spatialReference"]),!1),(0,n.bx)(t,function(e){let t,{vertexCount:i,vertexXY:s,vertexZ:o,vertexM:a}=e,l=I(e);if(e.hasCurves()){let i={stack:[],error:void 0,hasError:!1};try{(0,r.mS)(i,new F(e,["vertexZ","vertexM"]),!1);let s=(0,n.Ie)();for(let t of e.parts){let e=t.startVertex;for(let{curve:i}of t.segments)(0,h.e)(s,e,i),e=(0,d.yP)(i)}let[o,a,u,c]=s;t={xmin:o,ymin:a,xmax:u,ymax:c,spatialReference:l}}catch(e){i.error=e,i.hasError=!0}finally{(0,r.hk)(i)}}else{let e,r,n,o;e=r=1/0,n=o=-1/0;for(let t=0;t<i;++t){let i=s[2*t],a=s[2*t+1];e=Math.min(e,i),n=Math.max(n,i),r=Math.min(r,a),o=Math.max(o,a)}t={xmin:e,ymin:r,xmax:n,ymax:o,spatialReference:l}}if(o){let e=1/0,i=-1/0;for(let t of o)e=Math.min(e,t),i=Math.max(i,t);t.zmin=e,t.zmax=i}if(a){let e=1/0,i=-1/0;for(let t of a)e=Math.min(e,t),i=Math.max(i,t);t.mmin=e,t.mmax=i}return t}(e)),t}catch(e){i.error=e,i.hasError=!0}finally{(0,r.hk)(i)}}function w(e){let t,i,r;if((0,o.fT)(e)){r="point";let{x:s,y:n,z:o,m:a}=e,l=[s,n];null!=o&&l.push(o),null!=a&&l.push(a),i=[[l]],t=1}else(0,o.U9)(e)?(r="multipoint",i=[e.points],t=e.points.length):(0,o.Rg)(e)?(r="polyline",i=e.curvePaths??e.paths,t=i.reduce((e,t)=>e+t.length,0)):(r="polygon",i=e.curveRings??e.rings,t=i.reduce((e,t)=>(0===t.length||(e+=t.length,O(t[0],(0,d.yP)(t.at(-1)))&&--e),e),0));let s=z(r,t,r.includes("point")?0:i.length,(0,o.Pv)(e),(0,o.W0)(e),(0,d.Ed)(e)),{hasZ:n,hasM:a,vertexXY:l,vertexZ:u,vertexM:h}=s;function c(e){l[2*f]=e[0],l[2*f+1]=e[1],n&&(u[f]=e[2]),a&&(h[f]=e[m]),++f}s.spatialReference=e.spatialReference??void 0;let m=s.hasZ?3:2,f=0;if(!s.isMultipart()){if(!n&&!a){for(let[e,t]of i[0])l[2*f]=e,l[2*f+1]=t,++f;return s}for(let e of i[0])c(e);return s}let p="polygon"===r,{partOffsets:g}=s,y=0;if(!(0,d.Ed)(e)){for(let e of i){if(g[y++]=f,0===e.length)continue;let t=e.length;if(p&&O(e[0],e.at(-1))&&--t,n||a)for(let i=0;i<t;++i)c(e[i]);else for(let i=0;i<t;++i){let[t,r]=e[i];l[2*f]=t,l[2*f+1]=r,++f}}return g[y]=f,s}function _(e){let t=v+e;if(t<=(s.segmentParams?.length??0))return;let i=t*B;i=20*Math.ceil(i/20);let r=s.segmentParams;s.segmentParams=new Float64Array(i),null!=r&&s.segmentParams.set(r)}let v=0;for(let e of i){if(s.partOffsets[y++]=f,0===e.length)continue;let t=e[0],i=t;for(let t=1;t<e.length;++t){let r=e[t];c(i);let n=f-1;(0,d.wY)(r)?(_(10),++s.segmentCountArc,v=P(i,r,s,n,v),i=r.a[0]):(0,d.DA)(r)?(_(10),++s.segmentCountArc,v=Z(i,r,s,n,v),i=r.a[0]):(0,d.aO)(r)?(_(10),++s.segmentCountArc,v=E(i,r,s,n,v),i=r.c[0]):(0,d.n1)(r)?(_(4),++s.segmentCountBezier,v=D(0,r,s,n,v),i=r.b[0]):i=r}p&&O(t,i)||c(i)}return s.partOffsets[y]=f,s}function M(e){let t=A(e),{vertexCount:i,partCount:r,hasZ:s,hasM:n}=e,o=I(e),a=0;if(!e.isMultipart()){if("point"===e.type){let[t,i]=e.vertexXY;return{x:t,y:i,z:e.vertexZ?.[0],m:e.vertexM?.[0],spatialReference:o}}let r=[];for(;a<i;)r.push(t(a++));return{points:r,spatialReference:o,hasZ:s,hasM:n}}if(!e.hasCurves()){let i=[];for(let s=0;s<r;++s){let r=!!(1&e.partFlags[s]),n=e.partOffsets[s+1],o=[];for(;a<n;)o.push(t(a++));r&&o.length>0&&o.push([...o[0]]),i.push(o)}return"polygon"===e.type?{rings:i,hasZ:s,hasM:n,spatialReference:o}:{paths:i,hasZ:s,hasM:n,spatialReference:o}}let l=[];for(let{segments:t,startVertex:i}of e.parts){let e=[i];for(let{curve:i}of t)e.push(i);l.push(e)}return"polygon"===e.type?{rings:[],curveRings:l,hasZ:s,hasM:n,spatialReference:o}:{paths:[],curvePaths:l,hasZ:s,hasM:n,spatialReference:o}}function S(e,{lengths:t,coords:i,hasZ:r,hasM:s},n){let o=e.includes("point")?0:t.length,a="polygon"===e,l="point"===e?1:t.reduce((e,t)=>e+t,0)-(a?o:0);r??=!1,s??=!1;let u=z(e,l,o,r,s,!1,0,0);if(u.spatialReference=n??void 0,!u.isMultipart()){for(let e=0,t=0;e<l;++e)u.vertexXY[2*e]=i[t++],u.vertexXY[2*e+1]=i[t++],r&&(u.vertexZ[e]=i[t++]),s&&(u.vertexM[e]=i[t++]);return u}let h=2+Number(r)+Number(s),d=0,c=0;u.partOffsets[0]=0;for(let e of t){let t=u.partOffsets[c],n=t+e-Number(a);u.partOffsets[++c]=n;for(let e=t;e<n;++e)u.vertexXY[2*e]=i[d++],u.vertexXY[2*e+1]=i[d++],r&&(u.vertexZ[e]=i[d++]),s&&(u.vertexM[e]=i[d++]);a&&(d+=h)}return u}function C({type:e,vertexCount:t,vertexXY:i,vertexZ:r,vertexM:s,partCount:n,partOffsets:o,partFlags:a,hasZ:l,hasM:u}){let h=new f.A([],[],l,u);n=Math.max(n,1);let d=0;for(let e=0;e<n;++e){let n=o?.[e+1]??t,c=h.coords.length;for(let e=d;e<n;++e)h.coords.push(i[2*e],i[2*e+1]),l&&h.coords.push(r[e]),u&&h.coords.push(s[e]);if(a&&1&a[e]){let e=d;h.coords.push(i[2*e],i[2*e+1]),l&&h.coords.push(r[e]),u&&h.coords.push(s[e])}h.lengths.push((h.coords.length-c)/h.stride),d=n}return"point"===e&&(h.lengths.length=0),h}function b(...e){let t=new Set;for(let i of e){if(!i)continue;let e=[i.vertexXY,i.vertexZ,i.vertexM,i.partOffsets,i.partFlags,i.segmentFlags,i.segmentIndices,i.segmentParams];for(let i of e){let e=i?.buffer;e&&t.add(e)}}return Array.from(t)}function T(e,t){return"getSpatialReference"in e&&(t=function(e){if(null==e)return;let t=e.getText()||void 0,i=e.isCustomWkid()?0:e.getOldID();if(i<=0)return{wkt:t};let r=e.getLatestID();(r<=0||r===i)&&(r=void 0);let s=e.getVCS();if(null==s)return{wkid:i,latestWkid:r,wkt:t};let n=s.isCustomWkid()?0:s.getOldID();if(n<=0)return{wkt:t};let o=e.getLatestVerticalID();return(o<=0||o===n)&&(o=void 0),{wkid:i,wkt:t,latestWkid:r,vcsWkid:n,latestVcsWkid:o}}(e.getSpatialReference()),e=e.getGeometry()),new p({...e.toFlatGeometry(),spatialReference:t})}class F{constructor(e,t){this.target=e,this.keys=t,this.oldValues=t.map(t=>e[t]);for(let i of t)e[i]=void 0}[Symbol.dispose](){this.keys.map((e,t)=>{this.target[e]=this.oldValues[t]})}}function I({spatialReference:e}){return e instanceof s.A?e.toJSON():e}function A({vertexXY:e,vertexZ:t,vertexM:i}){return t?i?r=>[e[2*r],e[2*r+1],t[r],i[r]]:i=>[e[2*i],e[2*i+1],t[i]]:i?t=>[e[2*t],e[2*t+1],i[t]]:t=>[e[2*t],e[2*t+1]]}function O(e,t){return e.every((e,i)=>e===t[i])}function z(e,t,i,r,s,n,o,a){o??=0,a??=0;let l=new p({type:e,vertexCount:t,vertexXY:null,vertexZ:void 0,vertexM:void 0,partCount:i,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:o,segmentCountBezier:a}),u=2*Float64Array.BYTES_PER_ELEMENT*t;r&&(u+=Float64Array.BYTES_PER_ELEMENT*t),s&&(u+=Float64Array.BYTES_PER_ELEMENT*t),l.isMultipart()&&(u+=(i+1)*Int32Array.BYTES_PER_ELEMENT,u+=(i+1)*Int8Array.BYTES_PER_ELEMENT),n&&(u+=t*Int8Array.BYTES_PER_ELEMENT,u+=t*Int32Array.BYTES_PER_ELEMENT,u+=l.segmentParamCount*Float64Array.BYTES_PER_ELEMENT);let h=new ArrayBuffer(u),d=0;return l.vertexXY=new Float64Array(h,d,2*t),d+=l.vertexXY.byteLength,r&&(l.vertexZ=new Float64Array(h,d,t),d+=l.vertexZ.byteLength),s&&(l.vertexM=new Float64Array(h,d,t),d+=l.vertexM.byteLength),n&&(l.segmentParams=new Float64Array(h,d,l.segmentParamCount),d+=l.segmentParams.byteLength,l.segmentIndices=new Int32Array(h,d,t),l.segmentIndices.fill(N),d+=l.segmentIndices.byteLength),l.isMultipart()&&(l.partOffsets=new Int32Array(h,d,i+1),d+=l.partOffsets.byteLength,l.partFlags=new Int8Array(h,d,i+1),d+=l.partFlags.byteLength,"polygon"===l.type&&l.partFlags.subarray(0,i).fill(1)),n&&(l.segmentFlags=new Int8Array(h,d,t),l.segmentFlags.fill(1),d+=l.segmentFlags.byteLength),l}function P(e,t,{segmentFlags:i,segmentIndices:r,segmentParams:s},n,o){i[n]=4,r[n]=o;let[a,[l,u],h,d,c,f,p]=t.a,g=4;d||(g|=1),h||(g|=2);let y=(0,m.SW)(e,t),[_,v]=(0,m.Uk)(y,.5);return s[o++]=g,s[o++]=f,s[o++]=p,s[o++]=c,s[o++]=l,s[o++]=u,s[o++]=y.u2-y.u1,s[o++]=y.u1,s[o++]=_,s[o++]=v,o}function Z(e,t,{segmentFlags:i,segmentIndices:r,segmentParams:s},n,o){i[n]=4,r[n]=o;let a=(0,c.io)(e,t);return R(a,4,...(0,l.mq)(a,.5),s,o)}function E(e,t,{segmentFlags:i,segmentIndices:r,segmentParams:s},n,o){return i[n]=4,r[n]=o,R((0,u.pM)(e,t),0,...t.c[1],s,o)}function R(e,t,i,r,s,n){let{cx:o,cy:a,thetaStart:l,thetaEnd:u,radius:h}=e;return l>u||(t|=1),Math.abs(u-l)<=Math.PI||(t|=2),s[n++]=t,s[n++]=h,s[n++]=1,s[n++]=0,s[n++]=o,s[n++]=a,s[n++]=u-l,s[n++]=l,s[n++]=i,s[n++]=r,n}function D(e,{b:[t,[i,r],[s,n]]},{segmentFlags:o,segmentIndices:a,segmentParams:l},u,h){return o[u]=2,a[u]=h,l[h++]=i,l[h++]=r,l[h++]=s,l[h++]=n,h}const B=1.61803,N=-1},48526(e,t,i){i.d(t,{A:()=>g});var r,s=i(32198),n=i(4576),o=i(4718),a=i(91429),l=i(5443),u=i(91075),h=i(86738),d=i(16930),c=i(90634),m=i(47610),f=i(56993),p=i(43937);let g=r=class extends u.A{constructor(e){super(function(e){if(!e)return;let{points:t,hasM:i,hasZ:r,spatialReference:s}=e;switch(t??=[],t?.at(0)?.length){case 4:r??=!0,i??=!0;break;case 3:r??=!0!==i,i??=!r;break;default:r??=!1,i??=!1}return s??=d.A.WGS84,{...e,hasM:i,hasZ:r,points:t,spatialReference:s}}(e)),this.points=[],this.type="multipoint"}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){let e=(0,c.ge)(this);return e?new l.A({...e,spatialReference:this.spatialReference}):null}writePoints(e,t){t.points=(0,o.o8)(this.points)}clone(){let{points:e,spatialReference:t,hasM:i,hasZ:s}=this;return new r({points:(0,o.o8)(e),spatialReference:t.clone(),hasM:i,hasZ:s})}equals(e){if(this===e)return!0;if(null==e)return!1;let t=this.spatialReference,i=e.spatialReference;return!(null!=t!=(null!=i)||null!=t&&null!=i&&!t.equals(i))&&(0,n.aI)(this.points,e.points,m.v6)}addPoint(e){return(0,f.h)(this,e),Array.isArray(e)?this.points.push(e):this.points.push(e.toArray()),this.notifyChange("points"),this}getPoint(e){if(!this._validateInputs(e))return null;let t=this.points[e],i={x:t[0],y:t[1],spatialReference:this.spatialReference},r=2;return this.hasZ&&(i.z=t[2],r=3),this.hasM&&(i.m=t[r]),new h.A(i)}removePoint(e){if(!this._validateInputs(e))return null;let t=new h.A(this.points.splice(e,1)[0],this.spatialReference);return this.notifyChange("points"),t}setPoint(e,t){return this._validateInputs(e)&&((0,f.h)(this,t),Array.isArray(t)||(t=t.toArray()),this.points[e]=t,this.notifyChange("points")),this}toJSON(e){return this.write({},e)}_validateInputs(e){return null!=e&&e>=0&&e<this.points.length}};(0,s.Cg)([(0,a.MZ)({readOnly:!0})],g.prototype,"cache",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0})],g.prototype,"extent",null),(0,s.Cg)([(0,a.MZ)({type:[[Number]],json:{write:{isRequired:!0}}})],g.prototype,"points",void 0),(0,s.Cg)([(0,p.K)("points")],g.prototype,"writePoints",null),g=r=(0,s.Cg)([(0,a.$K)("esri.geometry.Multipoint")],g),g.prototype.toJSON.isDefaultToJSON=!0},82799(e,t,i){i.d(t,{A:()=>f});var r,s=i(32198),n=i(4718),o=i(91429),a=i(5443),l=i(91075),u=i(86738),h=i(16930),d=i(90634),c=i(56993),m=i(43937);let f=r=class extends l.A{constructor(e){super(function(e){if(!e)return;let{paths:t,hasM:i,hasZ:r,spatialReference:s}=e;switch(t??=[],function(e){return"number"==typeof e[0]?.[0]}(t)&&(t=[t]),t[0]?.[0]?.length){case 4:r??=!0,i??=!0;break;case 3:r??=!0!==i,i??=!r;break;default:r??=!1,i??=!1}return s??=h.A.WGS84,{...e,hasM:i,hasZ:r,paths:t,spatialReference:s}}(e)),this.curvePaths=void 0,this.paths=[],this.type="polyline"}get cache(){return this.commitProperty("curvePaths"),this.commitProperty("hasM"),this.commitProperty("hasZ"),this.commitProperty("paths"),this.commitProperty("spatialReference"),{}}writeCurvePaths(e,t){t.curvePaths=(0,n.o8)(e)}get extent(){let e=(0,d.Z3)(this),{spatialReference:t}=this;return e?new a.A({...e,spatialReference:t}):null}writePaths(e,t){t.paths=(0,n.o8)(this.paths)}addPath(e){if(!e)return;let t=this.paths,i=t.length;if(function(e){return!Array.isArray(e[0])}(e)){let r=[];for(let t=0,i=e.length;t<i;t++)r[t]=e[t].toArray();t[i]=r}else t[i]=e.slice();return this.notifyChange("paths"),this}clone(){let e=new r;return e.spatialReference=this.spatialReference,e.paths=(0,n.o8)(this.paths),e.curvePaths=(0,n.o8)(this.curvePaths),e.hasZ=this.hasZ,e.hasM=this.hasM,e}getPoint(e,t){if(!this._validateInputs(e,t))return null;let i=this.paths[e][t],r=this.hasZ,s=this.hasM;return r&&!s?new u.A(i[0],i[1],i[2],void 0,this.spatialReference):s&&!r?new u.A(i[0],i[1],void 0,i[2],this.spatialReference):r&&s?new u.A(i[0],i[1],i[2],i[3],this.spatialReference):new u.A(i[0],i[1],this.spatialReference)}insertPoint(e,t,i){return this._validateInputs(e,t,!0)&&((0,c.h)(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e].splice(t,0,i),this.notifyChange("paths")),this}removePath(e){if(!this._validateInputs(e,null))return null;let t=this.paths.splice(e,1)[0],i=this.spatialReference,r=t.map(e=>new u.A(e,i));return this.notifyChange("paths"),r}removePoint(e,t){if(!this._validateInputs(e,t))return null;let i=new u.A(this.paths[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(e,t,i){return this._validateInputs(e,t)&&((0,c.h)(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e][t]=i,this.notifyChange("paths")),this}_validateInputs(e,t,i=!1){if(null==e||e<0||e>=this.paths.length)return!1;if(null!=t){let r=this.paths[e];if(i&&(t<0||t>r.length)||!i&&(t<0||t>=r.length))return!1}return!0}toJSON(e){return this.write({},e)}};(0,s.Cg)([(0,o.MZ)({readOnly:!0})],f.prototype,"cache",null),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"portal-item":{write:!1},"web-map":{write:!1},"web-scene":{write:!1}}}})],f.prototype,"curvePaths",void 0),(0,s.Cg)([(0,m.K)("curvePaths")],f.prototype,"writeCurvePaths",null),(0,s.Cg)([(0,o.MZ)({readOnly:!0})],f.prototype,"extent",null),(0,s.Cg)([(0,o.MZ)({type:[[[Number]]],json:{write:{isRequired:!0}}})],f.prototype,"paths",void 0),(0,s.Cg)([(0,m.K)("paths")],f.prototype,"writePaths",null),f=r=(0,s.Cg)([(0,o.$K)("esri.geometry.Polyline")],f),f.prototype.toJSON.isDefaultToJSON=!0},4197(e,t,i){i.d(t,{Vj:()=>h,cj:()=>u,jh:()=>n,l5:()=>a,yH:()=>l});var r=i(34275),s=i(9093);function n(e){return e<=1024?Array(e).fill(0):new Float64Array(e)}function o(e){return((0,r.iu)(e)?e.byteLength/8:e.length)<=1024?Array.from(e):new Float64Array(e)}function a(e,t,i){return Array.isArray(e)?e.slice(t,t+i):e.subarray(t,t+i)}function l(e,t){if(0===t.length)return o(e);if(0===e.length)return o(t);let i=n(e.length+t.length);for(let t=0;t<e.length;++t)i[t]=e[t];for(let r=0;r<t.length;++r)i[e.length+r]=t[r];return i}function u(e){return[...e]}function h(e){let t=(0,s.vt)();for(let i=0;i<16;++i)t[i]=e[i];return t}},70328(e,t,i){i.d(t,{BI:()=>F,C:()=>o,DC:()=>c,Ej:()=>v,Ie:()=>b,Jt:()=>T,Lu:()=>w,Ne:()=>M,RF:()=>d,TF:()=>y,VL:()=>f,aI:()=>A,fA:()=>a,gE:()=>u,gX:()=>_,hZ:()=>C,iT:()=>m,is:()=>I,pg:()=>x,uJ:()=>g,vI:()=>S,vY:()=>l,vt:()=>n,w1:()=>h,yr:()=>p}),i(35522);var r=i(5443),s=(i(19419),i(4197));function n(e=z){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function o(e,t){for(let i=0;i<6;i++)e[i]=t[i];return e}function a(e,t,i,r,s,o,a=n()){return a[0]=e,a[1]=t,a[2]=i,a[3]=r,a[4]=s,a[5]=o,a}function l(e,t=n()){return function(e,t,i,r=n()){return C(r,O),function(e,t,i=0,r=t.length/3){let s=e[0],n=e[1],o=e[2],a=e[3],l=e[4],u=e[5];for(let e=0;e<r;e++)s=Math.min(s,t[i+3*e]),n=Math.min(n,t[i+3*e+1]),o=Math.min(o,t[i+3*e+2]),a=Math.max(a,t[i+3*e]),l=Math.max(l,t[i+3*e+1]),u=Math.max(u,t[i+3*e+2]);e[0]=s,e[1]=n,e[2]=o,e[3]=a,e[4]=l,e[5]=u}(r,e,t,i),r}(e,0,e.length/3,t)}function u(e,t=(0,s.jh)(24)){let[i,r,n,o,a,l]=e;return t[0]=i,t[1]=r,t[2]=n,t[3]=i,t[4]=r,t[5]=l,t[6]=i,t[7]=a,t[8]=n,t[9]=i,t[10]=a,t[11]=l,t[12]=o,t[13]=r,t[14]=n,t[15]=o,t[16]=r,t[17]=l,t[18]=o,t[19]=a,t[20]=n,t[21]=o,t[22]=a,t[23]=l,t}function h(e,t){return isFinite(e[2])||isFinite(e[5])?new r.A({xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}):new r.A({xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function d(e,t,i=e){i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.min(e[2],t[2]),i[3]=Math.max(e[3],t[3]),i[4]=Math.max(e[4],t[4]),i[5]=Math.max(e[5],t[5])}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function m(e,[t,i,r]){!function(e,t,i,r){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.min(e[2],r),e[3]=Math.max(e[3],t),e[4]=Math.max(e[4],i),e[5]=Math.max(e[5],r)}(e,t,i,r)}function f(e){return e[0]>=e[3]?0:e[3]-e[0]}function p(e){return e[1]>=e[4]?0:e[4]-e[1]}function g(e){return e[2]>=e[5]?0:e[5]-e[2]}function y(e){let t=f(e),i=g(e),r=p(e);return t*t+i*i+r*r}function _(e,t=[0,0,0]){return t[0]=e[0]+f(e)/2,t[1]=e[1]+p(e)/2,t[2]=e[2]+g(e)/2,t}function v(e,t=[0,0,0]){return t[0]=f(e),t[1]=p(e),t[2]=g(e),t}function x(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function w(e,t){return t[0]=e[3],t[1]=e[4],t[2]=e[5],t}function M(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function S(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function C(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function b(e){return e?C(e,O):n(O)}function T(e,t){return e[0]=t[0],e[1]=t[1],e[2]=-1/0,e[3]=t[2],e[4]=t[3],e[5]=1/0,e}function F(e,t,i,r,s){return e[0]=t,e[1]=i,e[2]=-1/0,e[3]=r,e[4]=s,e[5]=1/0,e}function I(e){return 6===e.length}function A(e,t,i){if(null==e||null==t)return e===t;if(!I(e)||!I(t))return!1;if(i){for(let r=0;r<e.length;r++)if(!i(e[r],t[r]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const O=[1/0,1/0,1/0,-1/0,-1/0,-1/0],z=[0,0,0,0,0,0];n(),i.d(t,["qv",0,O,"v_",0,z])},60408(e,t,i){function r(e){return void 0!==e.xmin&&void 0!==e.ymin&&void 0!==e.xmax&&void 0!==e.ymax}function s(e){return void 0!==e.points}function n(e){return void 0!==e.x&&void 0!==e.y}function o(e){return void 0!==e.paths||void 0!==e.curvePaths}function a(e){return void 0!==e.rings||void 0!==e.curveRings}function l(e){return"object"==typeof e&&"vertexAttributes"in e}function u(e){return e?n(e)?"esriGeometryPoint":o(e)?"esriGeometryPolyline":a(e)?"esriGeometryPolygon":r(e)?"esriGeometryEnvelope":s(e)?"esriGeometryMultipoint":null:null}function h(e){return null!=e&&("hasZ"in e&&e.hasZ||"z"in e&&null!=e.z)}function d(e){return null!=e&&("hasM"in e&&e.hasM||"m"in e&&null!=e.m)}i.d(t,{$B:()=>u,Bi:()=>a,Pv:()=>h,Rg:()=>o,U9:()=>s,W0:()=>d,ZC:()=>r,fT:()=>n,uW:()=>l})},65864(e,t,i){i.d(t,{rS:()=>h,xD:()=>c});var r=i(5443),s=i(91075),n=i(48526),o=i(86738),a=i(39829),l=i(82799),u=i(60408);function h(e){return null==e?null:e instanceof s.A?e:(0,u.fT)(e)?o.A.fromJSON(e):(0,u.Rg)(e)?l.A.fromJSON(e):(0,u.Bi)(e)?a.A.fromJSON(e):(0,u.U9)(e)?n.A.fromJSON(e):(0,u.ZC)(e)?r.A.fromJSON(e):null}const d={esriGeometryPoint:o.A,esriGeometryPolyline:l.A,esriGeometryPolygon:a.A,esriGeometryEnvelope:r.A,esriGeometryMultipoint:n.A,esriGeometryMultiPatch:a.A};function c(e){return e&&d[e]||null}},50498(e,t,i){var r=i(66552),s=i(5443),n=i(91075),o=i(48526),a=i(86738),l=i(39829),u=i(82799);const h=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),d=(0,r.O)()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"}),c={base:n.A,key:"type",typeMap:{extent:s.A,multipoint:o.A,point:a.A,polyline:u.A,polygon:l.A}},m=new r.J({esriGeometryBezier3Curve:"cubic-bezier",esriGeometryCircularArc:"circular-arc",esriGeometryEllipticArc:"elliptic-arc"},{ignoreUnknown:!0});i.d(t,["Ye",0,d,"gy",0,h,"iI",0,m,"yR",0,c])},97770(e,t,i){i.d(t,{Ey:()=>O,F8:()=>A,J2:()=>b,Yq:()=>F,_m:()=>T,iS:()=>I,wj:()=>z});var r=i(66552),s=i(73444),n=i(98623),o=i(34747);const a={dateStyle:void 0,year:void 0,month:void 0,day:void 0,weekday:void 0},l={timeStyle:void 0,hour12:void 0,hourCycle:void 0,hour:void 0,minute:void 0,second:void 0},u={timeZone:"UTC"},h={year:"numeric",month:"numeric",day:"numeric"},d={year:"numeric",month:"long",day:"numeric"},c={year:"numeric",month:"short",day:"numeric"},m={year:"numeric",month:"long",weekday:"long",day:"numeric"},f={hour:"numeric",minute:"numeric"},p={...f,second:"numeric"},g={hourCycle:"h23"},y={...f,...g},_={...p,...g},v={"short-date":h,"short-date-short-time":{...h,...f},"short-date-short-time-24":{...h,...y},"short-date-long-time":{...h,...p},"short-date-long-time-24":{...h,..._},"short-date-le":h,"short-date-le-short-time":{...h,...f},"short-date-le-short-time-24":{...h,...y},"short-date-le-long-time":{...h,...p},"short-date-le-long-time-24":{...h,..._},"long-month-day-year":d,"long-month-day-year-short-time":{...d,...f},"long-month-day-year-short-time-24":{...d,...y},"long-month-day-year-long-time":{...d,...p},"long-month-day-year-long-time-24":{...d,..._},"day-short-month-year":c,"day-short-month-year-short-time":{...c,...f},"day-short-month-year-short-time-24":{...c,...y},"day-short-month-year-long-time":{...c,...p},"day-short-month-year-long-time-24":{...c,..._},"long-date":m,"long-date-short-time":{...m,...f},"long-date-short-time-24":{...m,...y},"long-date-long-time":{...m,...p},"long-date-long-time-24":{...m,..._},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":f,"long-time":p},x=(0,r.O)()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),w={ar:"ar-u-nu-latn-ca-gregory",nn:"no-NN"};function M(){let e=(0,s.lR)();return(e&&w[e])??(0,s.QC)()}"mart"!==new Intl.DateTimeFormat("bs",{month:"long"}).formatToParts(new Date(2025,2)).find(({type:e})=>"month"===e)?.value.toLowerCase()&&(w.bs="sr-Latn-CS");let S=new WeakMap;const C=v["short-date-short-time"];function b(e){return v[e]}function T(e){let{dateStyle:t,timeStyle:i,hour12:r,year:s,month:n}=e,o={};return t?o.dateStyle=t:s&&(o.year=s,o.month=n||void 0),i&&!o.year&&(o.timeStyle=i,o.hour12="auto"===r?void 0:"always"===r),o}function F(e,t=C){return function(e){let t=S.get(e);if(!t){let i=M(),r=z(e.timeZone??"system"),s={...e,timeZone:r};t=new Intl.DateTimeFormat(i,s),S.set(e,t)}return t}(t).format(e)}function I(e,t=C){return F(new Date(e),{...t,...u,...l})}function A(e,t=C){return F(new Date(`1970-01-01T${e}Z`),{...t,...u,...a})}function O(e,t=C){let i=o.c9.fromISO(e,{setZone:!0});if(!i.isValid)return e;if(t.timeZone)return F(i.toJSDate(),t);let r=0===i.offset?"UTC":t.timeZone,s={...t,timeZone:r};return i.toLocaleString(s,{locale:M()})}function z(e){switch(e){case"system":return n.N;case n.L:return"UTC";default:return e}}(0,s.Ml)(()=>{S=new WeakMap}),i.d(t,["_v",0,x])},73444(e,t,i){i.d(t,{JK:()=>l,Ml:()=>g,QC:()=>d,lR:()=>h,oQ:()=>f});var r=i(36563);let s;i(44208);const n=globalThis.esriConfig?.locale,o=globalThis.document?.documentElement;function a(){let e=o?.getAttribute("lang"),t=globalThis.navigator?.language;return n??e??t??"en"}function l(){return void 0===s&&(s=a()),s}const u=/^(?<language>[a-z]{2,3})(?:-(?<extlang>[a-z]{3}))?(?:-[A-Z][a-z]{3})?(?:-(?<region>[A-Z]{2}|\d{3}))?(?:-.*)?$/;function h(e=l()){return c(e)?.language}function d(e=l()){let t=c(e);return t?.language&&t?.extlang?e.replace(`${t.language}-`,""):e}function c(e=l()){return u.exec(e)?.groups}const m=[];function f(e){return m.push(e),(0,r.hA)(()=>{m.splice(m.indexOf(e),1)})}new Map;const p=[];function g(e){return p.push(e),(0,r.hA)(()=>p.splice(p.indexOf(e),1))}function y(){let e=a();s!==e&&([...p].forEach(t=>t(e)),s=e,[...m].forEach(t=>t(e)))}globalThis.addEventListener?.("languagechange",y),o&&new MutationObserver(()=>{y()}).observe(o,{attributeFilter:["lang"]})},6518(e,t,i){i.d(t,{F:()=>a});var r=i(44208),s=i(75503),n=i(19419);const o={minX:0,minY:0,maxX:0,maxY:0};class a{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new s.wq(9,(0,r.A)("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){let e=Array(this._idByBounds.size),t=0;this._idByBounds.forEach((i,r)=>{e[t++]=r}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(e=>this._idByBounds.has(e))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;let e=(0,n.Ie)();for(let t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){let t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),function(e,t,i){(function(e){o.minX=e[0],o.minY=e[1],o.maxX=e[2],o.maxY=e[3]})(t),e.search(o,i)}(this._index,e,e=>t(this._idByBounds.get(e)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){let t=this._boundsById.get(e);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>5e4&&this._loadIndex()))}}},39357(e,t,i){i.d(t,{A:()=>a});var r,s=i(32198),n=i(25482),o=i(91429);let a=r=class extends n.o{constructor(e){super(e),this.name=null,this.code=null}clone(){return new r({name:this.name,code:this.code})}};(0,s.Cg)([(0,o.MZ)({type:String,json:{write:{isRequired:!0}}})],a.prototype,"name",void 0),(0,s.Cg)([(0,o.MZ)({type:[String,Number],json:{write:{isRequired:!0}}})],a.prototype,"code",void 0),a=r=(0,s.Cg)([(0,o.$K)("esri.layers.support.CodedValue")],a)},53177(e,t,i){i.d(t,{A:()=>h});var r,s=i(32198),n=i(4718),o=i(91429),a=i(39357),l=i(76357),u=i(93223);let h=class extends l.A{static{r=this}constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){let i=String(e);this.codedValues.some(e=>(String(e.code)===i&&(t=e.name),!!t))}return t}clone(){return new r({codedValues:(0,n.o8)(this.codedValues),name:this.name})}};(0,s.Cg)([(0,o.MZ)({type:[a.A],json:{write:{isRequired:!0}}})],h.prototype,"codedValues",void 0),(0,s.Cg)([(0,u.e)({codedValue:"coded-value"})],h.prototype,"type",void 0),h=r=(0,s.Cg)([(0,o.$K)("esri.layers.support.CodedValueDomain")],h)},76357(e,t,i){i.d(t,{A:()=>u});var r=i(32198),s=i(66552),n=i(25482),o=i(91429),a=i(93223);const l=new s.J({inherited:"inherited",codedValue:"coded-value",range:"range"});let u=class extends n.o{constructor(e){super(e),this.name=null,this.type=null}};(0,r.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],u.prototype,"name",void 0),(0,r.Cg)([(0,a.e)(l),(0,o.MZ)({json:{write:{isRequired:!0}}})],u.prototype,"type",void 0),u=(0,r.Cg)([(0,o.$K)("esri.layers.support.Domain")],u)},20437(e,t,i){i.d(t,{A:()=>f});var r,s=i(32198),n=i(66552),o=i(25482),a=i(91429),l=i(78888),u=i(8631),h=i(98453),d=i(36005),c=i(93223);const m=new n.J({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",marginOfError:"margin-of-error",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier",url:"url"});let f=class extends o.o{static{r=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?.value??null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?m.fromJSON(i.fieldValueType):null}clone(){return new r({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],f.prototype,"alias",void 0),(0,s.Cg)([(0,a.MZ)({type:[String,Number],json:{write:{allowNull:!0}}})],f.prototype,"defaultValue",void 0),(0,s.Cg)([(0,a.MZ)()],f.prototype,"description",void 0),(0,s.Cg)([(0,d.w)("description")],f.prototype,"readDescription",null),(0,s.Cg)([(0,a.MZ)({types:u.g,json:{read:{reader:u.r},write:!0}})],f.prototype,"domain",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"editable",void 0),(0,s.Cg)([(0,a.MZ)({type:l.jz,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],f.prototype,"length",void 0),(0,s.Cg)([(0,a.MZ)({type:String,json:{write:!0}})],f.prototype,"name",void 0),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{write:!0}})],f.prototype,"nullable",void 0),(0,s.Cg)([(0,c.e)(h.m)],f.prototype,"type",void 0),(0,s.Cg)([(0,a.MZ)()],f.prototype,"valueType",void 0),(0,s.Cg)([(0,d.w)("valueType",["description"])],f.prototype,"readValueType",null),(0,s.Cg)([(0,a.MZ)({type:Boolean,json:{read:!1}})],f.prototype,"visible",void 0),f=r=(0,s.Cg)([(0,a.$K)("esri.layers.support.Field")],f)},95466(e,t,i){i.d(t,{A:()=>u});var r=i(49186),s=i(53966),n=i(12195),o=i(30524),a=i(98623),l=i(56400);class u{static fromJSON(e){return new u(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new u(e.fields??[],d(e))}static fromLayerJSON(e){return new u(e.fields??[],d(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;let i=[];for(let e of this.fields){let t=e?.name,r=(0,o.GZ)(t);if(t&&r){let s=(0,o.NF)(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(r,e),i.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,o.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,o.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),!(0,o.te)(e)&&!(0,o.Xz)(e)&&(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(let e of this.fields)!(0,o.te)(e)&&!(0,o.Xz)(e)&&!e.nullable&&void 0===(0,o.lD)(e)&&this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){return(0,o.Vb)({fieldName:e,fieldsMap:this._fieldsMap,normalizedFieldsMap:this._normalizedFieldsMap})}getTimeZone(e){let t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new r.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),"UTC"):h.has(t.type)?a.L:null:null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,o.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,n.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}const h=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function d(e){let t=new Map;if(!e.fields)return t;let i=!0===e.datesInUnknownTimezone,{timeInfo:r,editFieldsInfo:s}=e,n=(r?"startField"in r?r.startField:r.startTimeField:"")??"",u=(r?"endField"in r?r.endField:r.endTimeField:"")??"",d=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,l.ZS)(e.dateFieldsTimeReference):null,c=s?function(e){return"timeZone"in e}(s)?s.timeZone??d:s.dateFieldsTimeReference?(0,l.ZS)(s.dateFieldsTimeReference):d??"UTC":null,m=r?function(e){return"timeZone"in e}(r)?r.timeZone??d:r.timeReference?(0,l.ZS)(r.timeReference):d:null,f=new Map([[(0,o.NF)(s?.creationDateField??""),c],[(0,o.NF)(s?.editDateField??""),c],[(0,o.NF)(n),m],[(0,o.NF)(u),m]]);for(let{name:r,type:s}of e.fields)if(h.has(s))t.set(r,a.L);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(r,null);else if(i)t.set(r,a.L);else{let e=f.get((0,o.NF)(r??""))??d;t.set(r,e)}return t}},91806(e,t,i){i.d(t,{A:()=>l});var r,s=i(32198),n=i(25482),o=i(91429),a=i(78888);let l=class extends n.o{static{r=this}constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new r({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"cols",void 0),(0,s.Cg)([(0,o.MZ)({type:a.jz,json:{write:!0}})],l.prototype,"level",void 0),(0,s.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],l.prototype,"levelValue",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"origin",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"resolution",void 0),(0,s.Cg)([(0,o.MZ)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"rows",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,json:{write:!0}})],l.prototype,"scale",void 0),l=r=(0,s.Cg)([(0,o.$K)("esri.layers.support.LOD")],l)},41628(e,t,i){i.d(t,{A:()=>l});var r,s=i(32198),n=i(91429),o=i(76357),a=i(93223);let l=class extends o.A{static{r=this}constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new r({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};(0,s.Cg)([(0,n.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:null!=this.maxValue&&null==this.minValue}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]},isRequired:!0}}})],l.prototype,"maxValue",void 0),(0,s.Cg)([(0,n.MZ)({json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range?.[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]},isRequired:!0}}})],l.prototype,"minValue",void 0),(0,s.Cg)([(0,a.e)({range:"range"})],l.prototype,"type",void 0),l=r=(0,s.Cg)([(0,n.$K)("esri.layers.support.RangeDomain")],l)},87045(e,t,i){i.d(t,{A:()=>v});var r,s=i(32198),n=i(66552),o=i(25482),a=i(86211),l=i(91429),u=i(78888),h=i(86738),d=i(16930),c=i(21325),m=i(28735),f=i(91806),p=i(72802),g=i(36005),y=i(43937);const _=new n.J({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let v=class extends o.o{static{r=this}static create(e={}){let{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:n=d.A.WebMercator,numLODs:o=24}=e;if(!(0,c.fn)(n)){let e=[];if(i)for(let t=0;t<i.length;t++){let r=i[t];e.push(new f.A({level:t,scale:r,resolution:r}))}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift(new f.A({level:i,scale:t,resolution:t})),t*=2}return new r({dpi:96,lods:e,origin:new h.A(0,0,n),size:[s,s],spatialReference:n})}let l=(0,c.Vp)(n),u=e.origin?new h.A({x:e.origin.x,y:e.origin.y,spatialReference:n}):l?new h.A({x:l.origin[0],y:l.origin[1],spatialReference:n}):new h.A({x:0,y:0,spatialReference:n}),m=1/(39.37*(0,a.GA)(n)*96),p=[];if(i)for(let e=0;e<i.length;e++){let t=i[e],r=t*m;p.push(new f.A({level:e,scale:t,resolution:r}))}else{let e=(0,c.EA)(n)?512/s*591657527.5917094:256/s*591657527.591555,i=Math.ceil(o/t);p.push(new f.A({level:0,scale:e,resolution:e*m}));for(let r=1;r<i;r++){let i=e/2**t,s=i*m;p.push(new f.A({level:r,scale:i,resolution:s})),e=i}}return new r({dpi:96,lods:p,origin:u,size:[s,s],spatialReference:n})}constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.size=null,this.spatialReference=null}get isWrappable(){let{spatialReference:e,origin:t}=this;if(e&&t){let i=(0,c.Vp)(e);return e.isWrappable&&!!i&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return h.A.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0,r=[],s=this._levelToLOD={};e&&(t=-1/0,i=1/0,e.forEach(e=>{r.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,s[e.level]=e})),this._set("scales",r),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){let t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];let i=Math.floor(e),r=i+1;return t[i]/(t[i]/t[r])**(e-i)}scaleToZoom(e){let t=this.scales,i=t.length-1,r=0;for(;r<i;r++){let i=t[r],s=t[r+1];if(i<=e)return r;if(s===e)return r+1;if(i>e&&s<e)return r+Math.log(i/e)/Math.log(i/s)}return r}tileAt(e,t,i,r){let s,n,o=this.lodAt(e);if(!o)return null;if("number"==typeof t)s=t,n=i;else if((0,c.aI)(t.spatialReference,this.spatialReference))s=t.x,n=t.y,r=i;else{let e=(0,m.Cv)(t,this.spatialReference);if(null==e)return null;s=e.x,n=e.y,r=i}let a=o.resolution*this.size[0],l=o.resolution*this.size[1];return r??=new p.U(0,0,0),r.level=e,r.row=Math.floor((this.origin.y-n)/l+.001),r.col=Math.floor((s-this.origin.x)/a+.001),this.updateTileInfo(r),r}updateTileInfo(e,t=0){if(!("extent"in e))return!1;let i=this.lodAt(e.level);if(!i&&1===t){let t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return!1;let r=e.level-i.level,s=i.resolution*this.size[0]/2**r,n=i.resolution*this.size[1]/2**r;return e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*n,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+n,!0}upsampleTile(e){let t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){let i=this.lodAt(t.level);if(null==i)return null;let{resolution:r}=i,s=r*this.size[0],n=r*this.size[1];return e[0]=this.origin.x+t.col*s,e[1]=this.origin.y-(t.row+1)*n,e[2]=e[0]+s,e[3]=e[1]+n,e}lodAt(e){return this._levelToLOD?.[e]??null}clone(){return r.fromJSON(this.write({}))}getCompatibleForVTL(e){if(this.size[0]!==this.size[1]||256===this.size[0]&&512===e)return null;let t=(512===this.size[0]&&256===e?-1:0)+ +!!this.spatialReference.isGeographic;if(this.size[0]===e&&0===t)return this;let i=[],s=this.lods.length-t;for(let e=0;e<s;e++){let r=e+t,{scale:s,resolution:n}=r>=0?this.lods[r]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};i.push(new f.A({level:e,scale:s,resolution:n}))}return new r({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){let e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){let r=e[i];this._upsampleLevels[r.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/r.resolution:0},t=r}}};(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],v.prototype,"compressionQuality",void 0),(0,s.Cg)([(0,l.MZ)({type:Number,json:{write:!0}})],v.prototype,"dpi",void 0),(0,s.Cg)([(0,l.MZ)({type:String,json:{read:_.read,write:_.write,origins:{"web-scene":{read:!1,write:!1}}}})],v.prototype,"format",void 0),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],v.prototype,"isWrappable",null),(0,s.Cg)([(0,l.MZ)({type:h.A,json:{write:!0}})],v.prototype,"origin",void 0),(0,s.Cg)([(0,g.w)("origin")],v.prototype,"readOrigin",null),(0,s.Cg)([(0,l.MZ)({type:[f.A],value:null,json:{write:!0}})],v.prototype,"lods",null),(0,s.Cg)([(0,l.MZ)({readOnly:!0})],v.prototype,"scales",void 0),(0,s.Cg)([(0,l.MZ)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],v.prototype,"size",void 0),(0,s.Cg)([(0,g.w)("size",["rows","cols"])],v.prototype,"readSize",null),(0,s.Cg)([(0,y.K)("size",{cols:{type:u.jz},rows:{type:u.jz}})],v.prototype,"writeSize",null),(0,s.Cg)([(0,l.MZ)({type:d.A,json:{write:!0}})],v.prototype,"spatialReference",void 0),v=r=(0,s.Cg)([(0,l.$K)("esri.layers.support.TileInfo")],v)},72802(e,t,i){i.d(t,{U:()=>s});var r=i(19419);class s{constructor(e,t,i,s=(0,r.vt)()){this._level=e,this._row=t,this._col=i,this.extent=s}get id(){return this._id??=`${this.level}/${this.row}/${this.col}`,this._id}get level(){return this._level}set level(e){this._level=e,this._id=null}get row(){return this._row}set row(e){this._row=e,this._id=null}get col(){return this._col}set col(e){this._col=e,this._id=null}toJSON(){return{level:this._level,row:this._row,col:this._col,extent:this.extent}}static fromJSON(e){return new s(e.level,e.row,e.col,e.extent)}}},8631(e,t,i){i.d(t,{r:()=>c,g:()=>d});var r,s=i(53177),n=i(76357),o=i(32198),a=i(91429),l=i(93223);let u=class extends n.A{static{r=this}constructor(e){super(e),this.type="inherited"}clone(){return new r}};(0,o.Cg)([(0,l.e)({inherited:"inherited"})],u.prototype,"type",void 0),u=r=(0,o.Cg)([(0,a.$K)("esri.layers.support.InheritedDomain")],u);var h=i(41628);const d={key:"type",base:n.A,typeMap:{range:h.A,"coded-value":s.A,inherited:u}};function c(e){if(!e?.type)return null;switch(e.type){case"range":return h.A.fromJSON(e);case"codedValue":return s.A.fromJSON(e);case"inherited":return u.fromJSON(e)}return null}},98453(e,t,i){const r=new(i(66552).J)({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});i.d(t,["m",0,r])},73133(e,t,i){const r=(0,i(66552).O)()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:"unknown"});i.d(t,["j",0,r])},31756(e,t,i){var r=i(86211),s=i(79258);const n={unknown:1,inches:(0,r.oU)(1,"meters","inches"),feet:(0,r.oU)(1,"meters","feet"),"us-feet":(0,r.oU)(1,"meters","us-feet"),yards:(0,r.oU)(1,"meters","yards"),miles:(0,r.oU)(1,"meters","miles"),"nautical-miles":(0,r.oU)(1,"meters","nautical-miles"),millimeters:(0,r.oU)(1,"meters","millimeters"),centimeters:(0,r.oU)(1,"meters","centimeters"),decimeters:(0,r.oU)(1,"meters","decimeters"),meters:(0,r.oU)(1,"meters","meters"),kilometers:(0,r.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,r.vl)(1,"meters",s.$O.radius)};i.d(t,["j",0,n])},63746(e,t,i){function r(e){return class{constructor(){for(let t of e)this[t]=null}}}function s(e,t=1){let{transform:i,hasZ:r,hasM:s}=e;if(null==i)return r&&1!==t?e=>{e[2]*=t}:null;let[n,o]=function(e,t,i,r){let{scale:s,translate:n,originPosition:o}=e;return"upperLeft"===o&&(s=s.map((e,t)=>1===t?-e:e)),t&&(s=s.map((e,t)=>2===t?e*r:e),n=n.map((e,t)=>2===t?e*r:e)),!t&&i&&(s=s.filter((e,t)=>2!==t),n=n.filter((e,t)=>2!==t)),[s,n]}(i,r,s,t),a=e.hasZ?3:2;return e=>{for(let t=0;t<e.length&&(t!==a||0!==e[t]);++t)e[t]=e[t]*n[t]+o[t]}}i.d(t,{M:()=>s,_:()=>r})},88625(e,t,i){i.d(t,{A:()=>_});var r,s=i(32198),n=i(69540),o=i(66552),a=i(25482),l=i(97768),u=i(91429),h=i(30524);let d=r=class extends a.o{constructor(e){super(e),this.expression=void 0,this.title=void 0}async collectRequiredFields(e,t){return(0,h.Dx)(e,t,null,this.expression)}clone(){return new r({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,s.Cg)([(0,u.MZ)({type:String,json:{write:{isRequired:!0}}})],d.prototype,"expression",void 0),(0,s.Cg)([(0,u.MZ)({type:String,json:{write:!0}})],d.prototype,"title",void 0),d=r=(0,s.Cg)([(0,u.$K)("esri.symbols.support.FeatureExpressionInfo")],d);const c=d;var m=i(16271),f=i(36005),p=i(43937);const g=(0,o.O)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),y=new o.J({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let _=class extends((0,n.OU)(a.o)){constructor(e){super(e),this.featureExpressionInfo=void 0,this.offset=null}readFeatureExpressionInfo(e,t){return null!=e?e.expression?e:void 0:t.featureExpression&&0===t.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,i,r){t[i]=e.write({},r),"0"===e.expression&&(t.featureExpression={value:0})}get mode(){let{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,l.CM)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,s.Cg)([(0,u.MZ)({type:c,json:{write:!0}})],_.prototype,"featureExpressionInfo",void 0),(0,s.Cg)([(0,f.w)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],_.prototype,"readFeatureExpressionInfo",null),(0,s.Cg)([(0,p.K)("featureExpressionInfo",{featureExpressionInfo:{type:c},"featureExpression.value":{type:[0]}})],_.prototype,"writeFeatureExpressionInfo",null),(0,s.Cg)([(0,u.MZ)({type:g.apiValues,nonNullable:!0,json:{type:g.jsonValues,read:g.read,write:{writer:g.write,isRequired:!0}}})],_.prototype,"mode",null),(0,s.Cg)([(0,u.MZ)({type:Number,json:{write:!0}})],_.prototype,"offset",void 0),(0,s.Cg)([(0,u.MZ)({type:m.KQ,json:{type:String,read:y.read,write:y.write}})],_.prototype,"unit",null),_=(0,s.Cg)([(0,u.$K)("esri.symbols.support.ElevationInfo")],_)},16271(e,t,i){i.d(t,{Ao:()=>n});var r=i(4576),s=i(31756);function n(e){return 1/(s.j[e]||1)}const o=function(){let e=Object.keys(s.j);return(0,r.TF)(e,"decimal-degrees"),e.sort(),e}();i.d(t,["KQ",0,o])},79677(e,t,i){i.d(t,{A:()=>d});var r,s=i(32198),n=i(25482),o=i(88930),a=i(91429),l=(i(98623),i(10184)),u=i(36005),h=i(43937);let d=class extends n.o{static{r=this}static get allTime(){return c}static get empty(){return m}static fromArray(e){return new r({start:null==e[0]?e[0]:new Date(e[0]),end:null==e[1]?e[1]:new Date(e[1])})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return null==t.end?null:new Date(t.end)}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(r.allTime)}get isEmpty(){return this.equals(r.empty)}readStart(e,t){return null==t.start?null:new Date(t.start)}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new r({end:this.end,start:this.start})}equals(e){if(!e)return!1;let t=this.start?.getTime()??this.start,i=this.end?.getTime()??this.end,r=e.start?.getTime()??e.start,s=e.end?.getTime()??e.end;return t===r&&i===s}expandTo(e,t="system"){if(this.isEmpty||this.isAllTime||"unknown"===e)return this.clone();let i=this.start;i&&=(0,o.lL)(i,new l.A({value:1,unit:e}),t);let s=this.end;if(s){let i=(0,o.lL)(s,new l.A({value:1,unit:e}),t);s=s.getTime()===i.getTime()?i:(0,o.S1)(i,1,e,t)}return new r({start:i,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return r.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();let t,i,s=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,o=e.start?.getTime()??-1/0,a=e.end?.getTime()??1/0;return o>=s&&o<=n?t=o:s>=o&&s<=a&&(t=s),n>=o&&n<=a?i=n:a>=s&&a<=n&&(i=a),null==t||null==i||isNaN(t)||isNaN(i)?r.empty:new r({start:t===-1/0?null:new Date(t),end:i===1/0?null:new Date(i)})}offset(e,t,i="system"){if(this.isEmpty||this.isAllTime||"unknown"===t)return this.clone();let s=new r,{start:n,end:a}=this;return null!=n&&(s.start=(0,o.S1)(n,e,t,i)),null!=a&&(s.end=(0,o.S1)(a,e,t,i)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return c.clone();let t=null!=this.start&&null!=e.start?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=null!=this.end&&null!=e.end?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new r({start:t,end:i})}};(0,s.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"end",void 0),(0,s.Cg)([(0,u.w)("end")],d.prototype,"readEnd",null),(0,s.Cg)([(0,h.K)("end")],d.prototype,"writeEnd",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isAllTime",null),(0,s.Cg)([(0,a.MZ)({readOnly:!0,json:{read:!1}})],d.prototype,"isEmpty",null),(0,s.Cg)([(0,a.MZ)({type:Date,json:{write:{allowNull:!0}}})],d.prototype,"start",void 0),(0,s.Cg)([(0,u.w)("start")],d.prototype,"readStart",null),(0,s.Cg)([(0,h.K)("start")],d.prototype,"writeStart",null),d=r=(0,s.Cg)([(0,a.$K)("esri.time.TimeExtent")],d);const c=new d,m=new d({start:void 0,end:void 0})},10184(e,t,i){i.d(t,{A:()=>h});var r=i(32198),s=i(69540),n=i(25482),o=i(88930),a=i(91429),l=i(73133),u=i(93223);let h=class extends((0,s.OU)(n.o)){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return(0,o.t)(this.value,this.unit,"milliseconds")}};(0,r.Cg)([(0,u.e)(l.j,{nonNullable:!0})],h.prototype,"unit",void 0),(0,r.Cg)([(0,a.MZ)({type:Number,json:{write:!0},nonNullable:!0})],h.prototype,"value",void 0),h=(0,r.Cg)([(0,a.$K)("esri.time.TimeInterval")],h)},20401(e,t,i){i.r(t),i.d(t,{default:()=>ze});var r=i(32198),s=i(65529),n=i(17676),o=i(36708),a=i(91429),l=i(79897),u=i(16930),h=i(65864),d=i(4576),c=i(49186),m=i(53966),f=i(87992),p=i(70328),g=i(6518),y=i(50498),_=i(69397),v=i(27647);class x{constructor(e=null,t={},i,r,s=0,n=null){this.geometry=e,this.attributes=t,this.centroid=i,this.objectId=r,this.displayId=s,this.distance=n}weakClone(){return new x(this.geometry,this.attributes,this.centroid,this.objectId,this.displayId,this.distance)}clone(){return new x(this.geometry?.clone(),{...this.attributes},this.centroid?.clone(),this.objectId,this.displayId,this.distance)}get usedMemory(){return 128+(0,_.lM)(this.attributes)+(this.geometry?.usedMemory??0)}ensureCentroid(e){return this.centroid??=(0,v.Q)(this.geometry&&(0,f.JR)(this.geometry)),this.centroid}}const w={getObjectId:e=>e.objectId,getAttributes:e=>e.attributes,getAttribute:(e,t)=>e.attributes[t],cloneWithGeometry:(e,t,i)=>new x((0,f.Nh)(y.gy.fromJSON(i),t),e.attributes,null,e.objectId,e.displayId,e.distance),getGeometry:e=>e.geometry&&(0,f.JR)(e.geometry),getGeometryWithCurves:e=>e.geometry,getCentroid:(e,t)=>e.ensureCentroid(t)},M=(0,p.vt)();class S{constructor(e,t,i){this.geometryType=e,this.hasZ=t,this.hasM=i,this._boundsStore=new g.F,this._featuresById=new Map,this._usedMemory=0,this.events=new s.bk,this.featureAdapter=w}get usedMemory(){return this._usedMemory}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=this._featuresById.size,t=0;return this._featuresById.forEach(({geometry:e})=>{t+=e?e.vertexCount:0}),{featureCount:e,vertexCount:t}}getFullExtent(e){if(null==this.fullBounds)return null;let[t,i,r,s]=this.fullBounds;return{xmin:t,ymin:i,xmax:r,ymax:s,spatialReference:e}}add(e){this._add(e),this._emitChanged()}addMany(e){for(let t of e)this._add(t);this._emitChanged()}upsertMany(e){let t=e.map(e=>this._upsert(e));return this._emitChanged(),t.filter(d.Ru)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged(),this._usedMemory=0}removeById(e){let t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(let t of e){let e=this._featuresById.get(t);e&&this._remove(e)}this._emitChanged()}forEachBounds(e,t){for(let i of e){let e=this._boundsStore.get(i.objectId);e&&t((0,p.Jt)(M,e))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,e=>{t(this._featuresById.get(e))})}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;let t=e.objectId;if(null==t)return void m.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new c.A("featurestore:invalid-feature","feature id is missing",{feature:e}));let i,r=this._featuresById.get(t);r?(e.displayId=r.displayId,i=this._boundsStore.get(t)??void 0,this._boundsStore.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(r)??0):this.onFeatureAdd?.(e),e.geometry?(this._boundsStore.set(t,(0,f.NO)(e.geometry,i)),this._featuresById.set(t,e),this._usedMemory+=this.estimateFeatureUsedMemory?.(e)??0):(this._boundsStore.set(t,null),this._featuresById.set(t,e))}_upsert(e){let t=e?.objectId;if(null==t)return m.A.getLogger("esri.layers.graphics.data.FeatureStore").error(new c.A("featurestore:invalid-feature","feature id is missing",{feature:e})),null;let i=this._featuresById.get(t);if(!i)return this._add(e),e;this._usedMemory-=this.estimateFeatureUsedMemory?.(i)??0;let{geometry:r,attributes:s}=e;for(let e in s)i.attributes[e]=s[e];return r&&(i.geometry=r,this._boundsStore.set(t,(0,f.NO)(r)??null)),this._usedMemory+=this.estimateFeatureUsedMemory?.(i)??0,i}_remove(e){null!=this.onFeatureRemove&&this.onFeatureRemove(e);let t=e.objectId;return this._boundsStore.delete(t),this._featuresById.delete(t),this._usedMemory-=this.estimateFeatureUsedMemory?.(e)??0,e}}var C=i(75752),b=i(87045),T=i(72802),F=i(97552),I=i(88625),A=i(66344),O=i(91869),z=i(86211),P=i(52006),Z=i(16271);function E(e=!1,t){if(e){let{elevationInfo:e,alignPointsInFeatures:i}=t;return new D(e,i)}return new R}class R{async alignCandidates(e,t,i){return e}notifyElevationSourceChange(){}}class D{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new A.q(1024),this._cacheVersion=0}async alignCandidates(e,t,i){let r=this._elevationInfo;return null==r||"absolute-height"!==r.mode||r.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,i):(function(e,t,i){let{offset:r,unit:s}=i;if(null==r)return;let n=(0,z.G9)(t),o=r*((0,Z.Ao)(s??"meters")/n);for(let t of e)switch(t.type){case"edge":t.start.z+=o,t.end.z+=o,t.curve&&((0,P.yP)(t.curve)[2]+=o);continue;case"vertex":t.target.z+=o;continue}}(e,t,r),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,i){let r=new Map;for(let t of e)(0,O.tE)(r,t.objectId,k).push(t);let[s,o,a]=this._prepareQuery(r,t),l=await this._alignPointsInFeatures(s,i);if((0,n.Te)(i),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,i);this._applyCacheAndResponse(s,l,o);let{drapedObjectIds:u,failedObjectIds:h}=l,d=[];for(let t of e){let{objectId:e}=t;u.has(e)&&"edge"===t.type&&(t.draped=!0),h.has(e)||d.push(t)}return d}_prepareQuery(e,t){let i=[],r=[];for(let[t,s]of e){let e=[];for(let i of s)this._addToQueriesOrCachedResult(t,i.target,e,r),"edge"===i.type&&(this._addToQueriesOrCachedResult(t,i.start,e,r),this._addToQueriesOrCachedResult(t,i.end,e,r));0!==e.length&&i.push({objectId:t,points:e})}return[{spatialReference:t.toJSON(),pointsInFeatures:i},r,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,i,r){let s=N(e,t),n=this._alignmentsCache.get(s);null==n?i.push(t):r.push(new B(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:i,failedObjectIds:r},s){for(let e of s)e.apply();let n=0,o=this._alignmentsCache;for(let{objectId:s,points:a}of e.pointsInFeatures){if(r.has(s)){n+=a.length;continue}let e=!i.has(s);for(let i of a){let r=N(s,i),a=t[n++];i.z=a,e&&o.put(r,a,1)}}}}class B{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function N(e,{x:t,y:i,z:r,spatialReference:s}){return`${e}-${t}-${i}-${r??0}}-wkid:${s?.wkid}`}function k(){return[]}class L{filter(e,t){return t}notifyElevationSourceChange(){}}class Y{filter(e,t){let{point:i,distance:r}=e,{z:s}=i;if(null==s||0===t.length)return t;let n=function(e){return"number"==typeof e?{x:e,y:e,z:e}:e}(r),o=this._updateCandidatesTo3D(t,i,n).filter(U);return o.sort(X),o}_updateCandidatesTo3D(e,t,i){for(let r of e)switch(r.type){case"edge":V(r,t,i);continue;case"vertex":q(r,t,i);continue}return e}}function U(e){return e.distance<=1}function j(e=!1){return e?new Y:new L}function V(e,t,{x:i,y:r,z:s}){let{start:n,end:o,target:a}=e;if(e.curve)throw Error("Curves are not yet supported.");e.draped||function(e,t,i,r){let s=r.x-i.x,n=r.y-i.y,o=r.z-i.z,a=s*s+n*n+o*o,l=(t.x-i.x)*s+(t.y-i.y)*n+o*(t.z-i.z),u=Math.min(1,Math.max(0,l/a)),h=i.x+s*u,d=i.y+n*u,c=i.z+o*u;e.x=h,e.y=d,e.z=c}(a,t,n,o);let l=(t.x-a.x)/i,u=(t.y-a.y)/r,h=(t.z-a.z)/s;e.distance=Math.sqrt(l*l+u*u+h*h)}function q(e,t,{x:i,y:r,z:s}){let{target:n}=e,o=(t.x-n.x)/i,a=(t.y-n.y)/r,l=(t.z-n.z)/s;e.distance=Math.sqrt(o*o+a*a+l*l)}function X(e,t){return e.distance-t.distance}var J=i(4718),H=i(799);function G(e=!1,t){return e?new W(t):new $}class ${async fetch(){return[]}notifySymbologyChange(){}}class W{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new A.q(1024),this._cacheVersion=0}async fetch(e,t){if(0===e.length)return[];let i=[],r=[],s=this._candidatesCache;for(let t of e){let e=K(t),n=s.get(e);if(n)for(let e of n)r.push((0,J.o8)(e));else i.push(t),s.put(e,[],1)}if(0===i.length)return r;let o=this._cacheVersion,{candidates:a,sourceCandidateIndices:l}=await this._getSymbologyCandidates(i,t);if((0,n.Te)(t),o!==this._cacheVersion)return this.fetch(e,t);let u=[],{length:h}=a;for(let e=0;e<h;++e){let t=a[e],r=K(i[l[e]]),n=s.get(r);n.push(t),s.put(r,n,n.length),u.push((0,J.o8)(t))}return r.concat(u)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function K(e){switch(e.type){case"vertex":{let{objectId:t,target:i}=e,r=`${t}-vertex-${i.x}-${i.y}-${i.z??0}`;return(0,H.Wm)(r).toString()}case"edge":{let{objectId:t,start:i,end:r}=e,s=`${t}-edge-${i.x}-${i.y}-${i.z??0}-to-${r.x}-${r.y}-${r.z??0}`;return(0,H.Wm)(s).toString()}default:return""}}var Q=i(69622),ee=i(60999),te=i(3483),ie=i(13069),re=i(5443),se=i(19419),ne=i(92722),oe=i(54339);class ae{constructor(){this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){let e=new ae;return e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}var le=i(60694),ue=i(62815),he=i(63746);class de{constructor(e){this._options=e,this.featureSet=new ae,this.parseOnly=null,this._idInfo=null,this._transformInPlace=null,this._transformInPlaceXY=null,this._push=de._pushXY,this._attributesClass=null,this._previousX=0,this._previousY=0,this._vertex=[],this._i=0,this._geometry=null,this._iVertex=0,this._iPart=0,this._isPolygon=!1,this._ringEndsAt=-1,this._pointBuffer=null,this._pointBufferOffset=0}queryGeometryType(){return this.featureSet.queryGeometryType}queryGeometry(){return this.featureSet.queryGeometry}idField(e){"string"==typeof e?this._idInfo??={type:"object-id",fieldName:e}:this._idInfo={type:"unique-id-simple",fieldName:e.name}}finish(){if(this._idInfo)for(let e of this.featureSet.features)e.objectId=(0,oe.W)(e,this._idInfo);let{spatialReference:e,features:t}=this.featureSet;if(e)for(let{geometry:i}of t)i&&(i.spatialReference=e);this.featureSet.transform=null}feature(){this._attributesClass??=(0,he._)(this.featureSet.fields?.map(e=>e.name)??[]),this.featureSet.features.push(new x(null,new this._attributesClass,null,0)),this._setVertexTransformer()}centroid(e){let{hasZ:t,hasM:i}=this.featureSet;this.featureSet.features.at(-1).centroid=new ne.A([],e,t,i)}geometry(e,t,i){this._previousX=this._previousY=0,this._i=this._iVertex=this._iPart=0;let{hasZ:r,hasM:s}=this.featureSet;r??=!1,s??=!1,this._vertex=[0,0],r&&this._vertex.push(0),s&&this._vertex.push(0);let n=y.gy.fromJSON(t);this._isPolygon="polygon"===n;let o=Number(this._isPolygon),a="point"===n?1:i.reduce((e,t)=>e+t-o,0),l="point"===n?0:i.length;if(this._geometry="point"===n?this._allocatePoint():(0,f.V2)(n,a,l,r,s,!1),this._push=r?s?de._pushXYZM:de._pushXYZ:s?de._pushXYM:de._pushXY,this._geometry.isMultipart()){this._geometry.partOffsets[0]=0;for(let e=0;e<l;++e)this._geometry.partOffsets[e+1]=this._geometry.partOffsets[e]+i[e]-o}this._ringEndsAt=o?this._geometry.partOffsets.at(1)??0:-1,1===e?(this.featureSet.queryGeometry=this._geometry,this.featureSet.queryGeometryType=t):this.featureSet.features.at(-1).geometry=this._geometry}coord(e){let t=this._vertex;t[this._i++]=e,!(this._i<t.length)&&(this._i=0,t[0]+=this._previousX,t[1]+=this._previousY,[this._previousX,this._previousY]=t,(this._iVertex!==this._ringEndsAt||(++this._iPart,this._ringEndsAt=this._geometry.partOffsets[this._iPart+1],this._previousX=this._previousY=0,!this._isPolygon))&&(this._transformInPlace?.(t),this._push(this)))}curvedGeometry(e,t,i,r){let{hasZ:s,hasM:n}=this.featureSet;s??=!1,n??=!1,this._i=this._iVertex=this._iPart=0;let o=y.gy.fromJSON(e);this._isPolygon="polygon"===o;let a=Number(!this._isPolygon),l=t.length,u=0,h=0,d=a*l;for(let e=0;e<i.length;++e)switch(d+=r[e],i[e]){case 1:case 3:u+=r[e];continue;case 2:h+=r[e]}this._geometry=(0,f.V2)(o,d,l,s,n,!0,u,h);let{partOffsets:c}=this._geometry;c[0]=0;for(let e=0,i=0;e<l;++e){c[e+1]=c[e]+a;for(let s=0;s<t[e];++s)c[e+1]+=r[i++]}switch(e){case"esriGeometryPoint":case"esriGeometryMultipoint":throw Error(`Curved ${e} does not make sense`)}this.featureSet.features.at(-1).geometry=this._geometry}startCurvedPart(e){}finishCurvedPart(e){this._isPolygon||(this._transform(e,this._vertex),this._push(this)),++this._iPart}lineSegment(e,t){this._transform(e,this._vertex),this._push(this)}bezierSegment(e,t,i,r){this._transform(e,this._vertex),this._push(this),this._transformXY(t,fe.b[0]),this._transformXY(i,fe.b[1]),this._transformXY(r,fe.b[2]),this._i=(0,f.tr)(this._vertex,fe,this._geometry,this._iVertex-1,this._i)}circularArcSegment(e,t,i){this._transform(e,this._vertex),this._push(this),this._transformXY(t,ce.c[0]),this._transformXY(i,ce.c[1]),this._i=(0,f.e6)(this._vertex,ce,this._geometry,this._iVertex-1,this._i)}ellipticArcSegment(e,t,i,r,s,n,o,a){this._transform(e,this._vertex),this._push(this),this._transformXY(t,me.a[0]),this._transformXY(i,me.a[1]),me.a[2]=r,me.a[3]=s,me.a[4]=n,me.a[5]=o,me.a[6]=a,this._i=(0,f._s)(this._vertex,me,this._geometry,this._iVertex-1,this._i)}_allocatePoint(){let{hasZ:e,hasM:t}=this.featureSet,i=Float64Array.BYTES_PER_ELEMENT*(2+Number(e)+Number(t));if(this._pointBuffer??=new ArrayBuffer(32*i),this._pointBufferOffset>=this._pointBuffer.byteLength){let e=Math.floor(this._pointBuffer.byteLength/i*1.5);this._pointBuffer=new ArrayBuffer(e*i),this._pointBufferOffset=0}let r=new Float64Array(this._pointBuffer,this._pointBufferOffset,2);this._pointBufferOffset+=r.byteLength;let s=new f.uX({type:"point",vertexCount:1,vertexXY:r,vertexZ:void 0,vertexM:void 0,partCount:0,partOffsets:void 0,partFlags:void 0,segmentFlags:void 0,segmentIndices:void 0,segmentParams:void 0,segmentCountArc:0,segmentCountBezier:0});return e&&(s.vertexZ=new Float64Array(this._pointBuffer,this._pointBufferOffset,1),this._pointBufferOffset+=s.vertexZ.byteLength),t&&(s.vertexM=new Float64Array(this._pointBuffer,this._pointBufferOffset,1),this._pointBufferOffset+=s.vertexM.byteLength),s}static _pushXY(e){let t=e._iVertex++,{vertexXY:i}=e._geometry;[i[2*t],i[2*t+1]]=e._vertex}static _pushXYZ(e){let t=e._iVertex++,{vertexXY:i,vertexZ:r}=e._geometry;[i[2*t],i[2*t+1],r[t]]=e._vertex}static _pushXYM(e){let t=e._iVertex++,{vertexXY:i,vertexM:r}=e._geometry;[i[2*t],i[2*t+1],r[t]]=e._vertex}static _pushXYZM(e){let t=e._iVertex++,{vertexXY:i,vertexM:r,vertexZ:s}=e._geometry;[i[2*t],i[2*t+1],s[t],r[t]]=e._vertex}_setVertexTransformer(){let{sourceSpatialReference:e}=this._options,{spatialReference:t,hasZ:i,transform:r}=this.featureSet,s=i?(0,ue.d)(e,t):1;this._transformInPlace??=(0,he.M)(this.featureSet,s),this._transformInPlaceXY??=(0,he.M)({transform:r})}_transform(e,t){for(let i=0;i<e.length;++i)t[i]=e[i];this._transformInPlace?.(t)}_transformXY(e,t){t[0]=e[0],t[1]=e[1],this._transformInPlaceXY?.(t)}}const ce={c:[[0,0],[0,0]]},me={a:[[0,0],[0,0],0,0,0,0,0]},fe={b:[[0,0],[0,0],[0,0]]};var pe=i(80893);class ge{constructor(e,t){this.key=e,this.resolution=t,this.state={type:0},this.alive=!0}process(e){switch(this.state.type){case 0:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 1:case 3:break;case 2:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case 4:this.state=this._goToDone(this.state,e)}return null}get debugInfo(){return{key:this.key,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case 0:case 1:return 0;case 2:return this.state.featureCount;case 3:return this.state.previous.featureCount;case 4:return this.state.features.length;case 5:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case 0:return"created";case 1:return"fetch-count";case 2:return"fetched-count";case 3:return"fetch-features";case 4:return"fetched-features";case 5:return"done"}}_gotoFetchCount(e,t){return{type:1,previous:e,task:(0,ee.UT)(async e=>{let i=await(0,ee.DZ)(t.fetchCount(this,e));1===this.state.type&&(this.state=function(e,t){return{type:2,featureCount:t,previous:e}}(this.state,i.ok?i.value:1/0))})}}_gotoFetchFeatures(e,t){return{type:3,previous:e,task:(0,ee.UT)(async i=>{let r=await(0,ee.DZ)(t.fetchFeatures(this,e.featureCount,i));3===this.state.type&&(this.state=function(e,t){return{type:4,previous:e,features:t}}(this.state,r.ok?r.value:[]))})}}_goToDone(e,t){return t.finish(this,e.features),{type:5,previous:e}}reset(){let e=this.state;switch(this.state={type:0},e.type){case 0:case 2:case 4:case 5:break;case 1:case 3:e.task.abort()}}}let ye=class extends Q.A{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){let e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){let t=this._get("outFields"),i=(0,te.KC)(e,this._mandatoryOutFields);(0,te.aI)(i,t)||(this._set("outFields",i),(0,te.Yy)(i,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){let t=this._get("filter"),i=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(e){let t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){let t=this._get("tileInfo");t!==e&&(null==e||null==t||JSON.stringify(e)!==JSON.stringify(t))&&(this._set("tileInfo",e),this.store.tileInfo=e)}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new l.U}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,()=>{this._updatePriorities(),this._process()},{sync:!0,initial:!0,equals:(e,t)=>(0,d.aI)(e,t,({id:e},{id:t})=>e===t)}),this._updatingHandles.addWhen(()=>!this.suspended,()=>this._process())}_updatePriorities(){this.store.setPriorityOrderByKey(this.tilesOfInterest.map(({id:e})=>e)??[])}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(let e of this._pendingTiles.values())e.reset();let t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:e,globalId:t})=>e&&-1!==e?e:this._lookupObjectIdByGlobalId(t))},i=(0,ee.UT)(async e=>{try{await this.store.processEdits(t,(e,t)=>this._queryFeaturesById(e,t),e),this._processPendingTiles()}catch(e){(0,n.QP)(e),m.A.getLogger(this).warn("Failed to apply edits",e)}});this.addHandles(i),await this._updatingHandles.addPromise(i.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!(0,le.Wo)(this.url))return;let e=(0,ee.UT)(async e=>{try{let t=await(0,pe.Jf)(this.url,new F.A({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=re.A.fromJSON(t?.extent)}catch(e){(0,n.QP)(e),m.A.getLogger(this).warn("Failed to fetch data extent",e)}});this._updatingHandles.consumePromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(let e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;let e=this._collectMissingTilesInfo();if(this._setAvailability(null==e?1:e.coveredArea/e.fullArea),null!=e)for(let{data:t,resolution:i}of e.missingTiles){let e=this._pendingTiles.get(t.id);e?(e.resolution=i,e.alive=!0):this._createPendingTile(t,i)}}_collectMissingTilesInfo(){let e=null;for(let t of this.tilesOfInterest){let i=this.store.process(t,(e,t)=>this._verifyTileComplexity(e,t),this.outFields);null==e?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(let e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){let e={fetchCount:(e,t)=>this._fetchCount(e,t),fetchFeatures:(e,t,i)=>this._fetchFeatures(e,t,i),finish:(e,t)=>this._finishPendingTile(e,t),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(let t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.key),t.resolution)&&this._updatingHandles.consumePromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature<xe}_verifyFeatureDensity(e,t){if(null==this.tileInfo)return!1;let i=this.tileSize*t;return we/(i*i)*e<Me}_ensureFetchAllCounts(e){let t=!0;for(let i of this._pendingTiles.values())i.state.type<2&&this._updatingHandles.consumePromise(i.process(e)),i.state.type<=1&&(t=!1);return t}_finishPendingTile(e,t){this.store.add(e.key,t),this._deletePendingTile(e),this._updateAvailability()}_updateAvailability(){let e=this._collectMissingTilesInfo();this._setAvailability(null==e?1:e.coveredArea/e.fullArea)}_setAvailability(e){this._set("availability",e)}_createPendingTile(e,t){let i=new ge(e,t);return this._pendingTiles.set(e.id,i),i}_deletePendingTile(e){e.reset(),this._pendingTiles.delete(e.key.id)}async _fetchCount(e,t){return this.store.fetchCount(e.key,this.url,this._createCountQuery(e),{query:this.customParameters,timeout:ve,signal:t})}async _fetchFeatures(e,t,i){let r=0,s=[],n=0,o=t;for(;;){let a=this._createFeaturesQuery(e),l=this._setPagingParameters(a,r,o),{features:u,exceededTransferLimit:h}=await this._queryFeatures(a,i);l&&(r+=a.num),n+=u.length;for(let e of u)s.push(e);if(o=t-n,!l||!h||o<=0)return s}}_filterProperties(e){return null==e?{where:"1=1",gdbVersion:void 0,timeExtent:void 0}:{where:e.where||"1=1",timeExtent:e.timeExtent,gdbVersion:e.gdbVersion}}_lookupObjectIdByGlobalId(e){let t=this.globalIdField,i=this.objectIdField;if(null==t)throw Error("Expected globalIdField to be defined");let r=null,s=e&&(0,ie.AG)(e);if(this.store.featureStore.forEach(e=>{s===(0,ie.AG)(e.attributes[t])&&(r=e.objectId??e.attributes[i])}),null==r)throw Error(`Expected to find a feature with globalId ${e}`);return r}_queryFeaturesById(e,t){let i=this._createFeaturesQuery();return i.objectIds=e,this._queryFeatures(i,t)}async _queryFeatures(e,t){return 0===e.num?new ae:this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){let{sourceSpatialReference:i}=this;return await(0,pe.IJ)(this.url,e,new de({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:ve,signal:t})}async _queryFeaturesJSON(e,t){let{sourceSpatialReference:i}=this;return function({exceededTransferLimit:e,features:t,fields:i,geometryType:r,hasM:s,hasZ:n,spatialReference:o,transform:a},l){let u=new ae;u.exceededTransferLimit=e??!1;for(let e of t??[]){let t,i;r&&(t=e.geometry&&(0,f.ME)(e.geometry),i=e.centroid&&new ne.A([],[e.centroid.x,e.centroid.y]));let s=(0,oe.W)(e,l);u.features.push(new x(t,e.attributes,i,s,void 0,e.distance))}return u.fields=i??u.fields,u.geometryType=r??null,u.hasM=s??!1,u.hasZ=n??!1,u.spatialReference=o??null,u.transform=a??null,u}(await(0,pe.eW)(this.url,e,i,{query:this._configuration.customParameters,timeout:ve,signal:t}),{type:"object-id",fieldName:this.objectIdField})}_createCountQuery(e){let t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){let t=this._createBaseQuery(e),i=null==e?.key?null:this.store.getAttributesForTile(e?.key?.id),r=(0,te.KC)((0,te.iv)(this.outFields,i??new Set),this._mandatoryOutFields);return t.outFields=Array.from(r),t.returnGeometry=!0,this.capabilities.data.supportsTrueCurve&&(!this.capabilities.query.supportsFormatPBF||this.capabilities.query.supportsFormatPBFWithCurves)&&(t.returnTrueCurves=!0),null!=e&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){let t=new F.A({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:null!=this.tileInfo&&null!=e?(0,se.w1)(e.key.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return null!=i&&(t.where=i.where,t.gdbVersion=i.gdbVersion,t.timeExtent=i.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,i){if(!this.capabilities.query.supportsPagination)return!1;let{supportsMaxRecordCountFactor:r,supportsCacheHint:s,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=r?F.A.MAX_MAX_RECORD_COUNT_FACTOR:1,u=l*((a||s)&&n?n:o||_e);return e.start=t,r?(e.maxRecordCountFactor=Math.min(l,Math.ceil(i/u)),e.num=Math.min(i,e.maxRecordCountFactor*u)):e.num=Math.min(i,u),!0}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"url",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"currentVersion",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"objectIdField",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"globalIdField",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"capabilities",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"sourceSpatialReference",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"spatialReference",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],ye.prototype,"store",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"_minimumVerticesPerFeature",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"_mandatoryOutFields",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"outFields",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"suspended",void 0),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"_historicMoment",void 0),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"filter",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"customParameters",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"_configuration",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"tileInfo",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"tileSize",null),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"tilesOfInterest",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"updating",null),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],ye.prototype,"availability",void 0),(0,r.Cg)([(0,a.MZ)()],ye.prototype,"hasZ",null),ye=(0,r.Cg)([(0,a.$K)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],ye);const _e=2e3,ve=6e5,xe=1e6,we=25,Me=1;i(44208);class Se{constructor(){this._store=new Map,this._priorities=new Map}get size(){return this._store.size}setPriorityOrderByKey(e){this._priorities.clear();for(let t=e.length-1;t>=0;t--)this._priorities.set(e[t],e.length-t)}hasLowerPriority(e){let t=this._priorities.get(e);if(null==t)return!0;for(let[e]of this._store){let i=this._priorities.get(e);if(null==i||i<t)return!0}return!1}someFromLowestToHighestPriority(e){let{_priorities:t}=this;for(let[i,r]of this._store)if(!t.has(i)&&e(r,i))return!0;for(let[i]of t){let t=this._store.get(i);if(t&&e(t,i))return!0}return!1}set(e,t){this._store.set(e,t)}delete(e){return this._store.delete(e)}get(e){return this._store.get(e)}has(e){return this._store.has(e)}clear(){this._store.clear()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}let Ce=class extends Q.A{setPriorityOrderByKey(e){this._tiles.setPriorityOrderByKey(e)}get _memoryLimitExceeded(){return this.featureStore.usedMemory>=this.maximumByteSize}constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10485760,this._tileBounds=new g.F,this._tiles=new Se,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=(0,se.vt)()}add(e,t){for(let e of t)this._referenceFeature(e.objectId);let i=this.featureStore.upsertMany(t),r=i.map(e=>new Set(Object.keys(e.attributes))).reduce((e,t)=>(0,te.E$)(e,t),new Set(Object.keys(i[0]?.attributes??[]))),s=this._memoryLimitExceeded;this._addTileStorage(e,new Set(i.map(e=>e.objectId)),r),s&&this._applyCacheMemoryLimits()}_applyCacheMemoryLimits(){if(!this._memoryLimitExceeded)return;let{_tiles:e,featureStore:t,maximumByteSize:i}=this;e.someFromLowestToHighestPriority(e=>!this._memoryLimitExceeded||t.usedMemory-this._estimateRemoveTileMemoryReduction(e)<i||(this._removeTileStorage(e),!1))}_estimateRemoveTileMemoryReduction(e){let t=0;for(let i of e.objectIds)if(1===this._refCounts.get(i)){let e=this.featureStore.getFeature(i);e&&(t+=this.featureStore.estimateFeatureUsedMemory?.(e)??0)}return t}_hasAttributesForTile(e,t){if(e){let i=this._tiles.get(e);if(i)return!i.objectIds.size||(0,te.Yy)(t,i.attributeKeys)}return!1}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,i){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,i)}_addTileStorage(e,t,i){let r=e.id;this._tiles.set(r,new be(e,t,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){let t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){let t=[];for(let i of e.objectIds)1===this._unreferenceFeature(i)&&t.push(i);this.featureStore.removeManyById(t);let i=e.key.id;this._tiles.delete(i),this._tileBounds.delete(i)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(let t of this._tiles.values()){for(let i of e)t.objectIds.delete(i);this._tileFeatureCounts.set(t.key.id,t.objectIds.size)}for(let t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,i){if(!e.length)return;let{features:r}=await t(e,i);for(let e of r){if(this._tmpBoundingRect.fill(0),null==e.geometry||0===e.geometry.vertexCount)continue;(0,se.Ie)(this._tmpBoundingRect);let t=(0,f.NO)(e.geometry,this._tmpBoundingRect);this._tileBounds.forEachInBounds(t,t=>{let i=this._tiles.get(t);this.featureStore.add(e);let r=e.objectId;i.objectIds.has(r)||(i.objectIds.add(r),this._referenceFeature(r),this._tileFeatureCounts.set(i.key.id,i.objectIds.size))})}}process(e,t=()=>!0,i){if(null==this.tileInfo||!e.extent||null!=this.extent&&!(0,se.HY)((0,se.VY)(this.extent,this._tmpBoundingRect),e.extent)||this._memoryLimitExceeded&&!this._tiles.hasLowerPriority(e.id??"")||this._hasAttributesForTile(e.id,i))return new Fe(e);let r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,i)}get debugInfo(){return Array.from(this._tiles.values()).map(({key:e})=>({key:e.toJSON(),featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,i,r){let s=this._tileFeatureCounts.get(e.id);return s??(s=await(0,pe.gW)(t,i,r),this._tileFeatureCounts.set(e.id,s)),s}_createTileTree(e,t){let i=new Te(e.level,e.row,e.col);return t.updateTileInfo(i,1),this._tileBounds.forEachInBounds(e.extent,r=>{let s=this._tiles.get(r)?.key;s&&function(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;let i=e.level<t.level,r=i?e:t,s=i?t:e,n=1<<s.level-r.level;return Math.floor(s.row/n)===r.row&&Math.floor(s.col/n)===r.col}(e,s)&&this._populateChildren(i,s,t,this._tileFeatureCounts.get(s.id)||0)}),i}_populateChildren(e,t,i,r){let s=t.level-e.level-1;if(s<0)return void(e.isLeaf=!0);let n=t.row>>s,o=t.col>>s,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),u=e.children[l];if(null!=u)this._populateChildren(u,t,i,r);else{let s=new Te(e.level+1,n,o);i.updateTileInfo(s,1),e.children[l]=s,this._populateChildren(s,t,i,r)}}_simplify(e,t,i,r,s){let n=s*s;if(e.isLeaf)return t(this.getFeatureCount(e),s)?0:(this._remove(e),null!=i&&(i.children[r]=null),n);let o=s/2,a=o*o,l=0;for(let i=0;i<e.children.length;i++){let r=e.children[i];l+=null==r?a:this._simplify(r,t,e,i,o)}return 0===l?this._mergeChildren(e):1-l/n<Ae&&(this._purge(e),null!=i&&(i.children[r]=null),l=n),l}_mergeChildren(e){let t,i=new Set;this._forEachLeaf(e,e=>{let r=this._tiles.get(e.id);if(r){t=t?(0,te.E$)(t,r.attributeKeys):new Set(r.attributeKeys);for(let e of r.objectIds)i.has(e)||(i.add(e),this._referenceFeature(e));this._remove(e)}}),this._addTileStorage(e,i,t??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,i.size)}_forEachLeaf(e,t){for(let i of e.children)null!=i&&(i.isLeaf?t(i):this._forEachLeaf(i,t))}_purge(e){if(null!=e)if(e.isLeaf)this._remove(e);else for(let t=0;t<e.children.length;t++){let i=e.children[t];this._purge(i),e.children[t]=null}}_collectMissingTiles(e,t,i,r){let s=new Ie(i,e,this.extent);return this._collectMissingTilesRecurse(t,s,1,r),s.info}_collectMissingTilesRecurse(e,t,i,r){let s=this._tiles.has(e.id)&&!this._hasAttributesForTile(e.id,r);if(s&&t.addMissing(e.level,e.row,e.col,i),e.isLeaf)return;if(!e.hasChildren)return void(s||t.addMissing(e.level,e.row,e.col,i));let n=i/2;for(let i=0;i<e.children.length;i++){let s=e.children[i];null==s?t.addMissing(e.level+1,(e.row<<1)+((2&i)>>1),(e.col<<1)+(1&i),n):this._collectMissingTilesRecurse(s,t,n,r)}}_referenceFeature(e){let t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),1===t?0:2}_unreferenceFeature(e){let t=(this._refCounts.get(e)||0)-1;return 0===t?(this._refCounts.delete(e),1):(t>0&&this._refCounts.set(e,t),2)}get test(){}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],Ce.prototype,"featureStore",void 0),(0,r.Cg)([(0,a.MZ)()],Ce.prototype,"tileInfo",void 0),(0,r.Cg)([(0,a.MZ)()],Ce.prototype,"extent",void 0),(0,r.Cg)([(0,a.MZ)()],Ce.prototype,"maximumByteSize",void 0),Ce=(0,r.Cg)([(0,a.$K)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],Ce);class be{constructor(e,t,i){this.key=e,this.objectIds=t,this.attributeKeys=i}}class Te extends T.U{constructor(){super(...arguments),this.isLeaf=!1,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(null!=this.children[0]||null!=this.children[1]||null!=this.children[2]||null!=this.children[3])}}class Fe{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=(0,se.Wc)(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class Ie{constructor(e,t,i){this._tileInfo=e,this._extent=null,this.info=new Fe(t),null!=i&&(this._extent=(0,se.VY)(i))}addMissing(e,t,i,r){let s=new T.U(e,t,i);this._tileInfo.updateTileInfo(s,1)&&(null==this._extent||(0,se.HY)(this._extent,s.extent))&&(this.info.missingTiles.push({data:s,resolution:r}),this.info.coveredArea-=(0,se.Wc)(s.extent))}}const Ae=.18751;let Oe=class extends s.nJ{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=Promise.withResolvers(),this._elevationAligner=E(),this._elevationFilter=j(),this._symbologyCandidatesFetcher=G(),this._updatingHandles=new l.U,this._alignPointsInFeatures=async(e,t)=>{let i={query:e},r=await this.remoteClient.invoke("alignElevation",i,{signal:t});return(0,n.Te)(t),r},this._getSymbologyCandidates=async(e,t)=>{let i={candidates:e,spatialReference:this._spatialReference.toJSON()},r=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return(0,n.Te)(t),r}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};let{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:s}=e.serviceInfo,{hasZ:n}=e,a=u.A.fromJSON(e.spatialReference);this._spatialReference=a,this._featureStore=new S(t,n,!1),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new C.do({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:s,hasZ:n,hasM:!1,featureIdInfo:{type:"object-id",fieldName:i},timeInfo:r}),this._featureFetcher=new ye({store:new Ce({featureStore:this._featureStore}),url:e.serviceInfo.url,currentVersion:e.serviceInfo.currentVersion,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:u.A.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});let l="3d"===e.configuration.viewType;return this._elevationAligner=E(l,{elevationInfo:null==e.elevationInfo?null:I.A.fromJSON(e.elevationInfo),alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=j(l),this.addHandles([(0,o.wB)(()=>this._featureFetcher.availability,e=>this.emit("notify-availability",{availability:e}),o.OH),(0,o.wB)(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),Pe}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.suspended=e,Pe}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.outFields=new Set(e??[]),Pe}async fetchCandidates(e,t){await this._whenSetup.promise,(0,n.Te)(t);let i=function(e,t){let i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};let{distance:r,units:s,spatialRel:n,where:o,timeExtent:a,objectIds:l}=e.filter,u={geometry:e.filter.geometry?(0,h.rS)(e.filter.geometry):void 0,distance:r,units:s,spatialRel:n,timeExtent:a,objectIds:l,returnZ:i,where:o??"1=1"};return{...e,query:u}}(e,this._featureStore.hasZ),r=t?.signal,s=await this._queryEngine.executeQueryForSnapping(i,r);(0,n.Te)(r);let o=await this._elevationAligner.alignCandidates(s.candidates,u.A.fromJSON(e.point.spatialReference)??u.A.WGS84,r);(0,n.Te)(r);let a=await this._symbologyCandidatesFetcher.fetch(o,r);(0,n.Te)(r);let l=0===a.length?o:o.concat(a);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles.map(e=>T.U.fromJSON(e)),this._featureFetcher.tileInfo=null==e.tileInfo?null:b.A.fromJSON(e.tileInfo),Pe}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),this._featureFetcher.refresh(),Pe}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),await(0,o.C_)(()=>!this.updating,t),(0,n.Te)(t),Pe}async getDebugInfo(e,t){return(0,n.Te)(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),(0,n.Te)(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),(0,n.Te)(t),Pe}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),Pe}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),Pe}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),Pe}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=G(e,this._getSymbologyCandidates),Pe}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null==e.filter?null:F.A.fromJSON(e.filter),this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};(0,r.Cg)([(0,a.MZ)({readOnly:!0})],Oe.prototype,"updating",null),(0,r.Cg)([(0,a.MZ)()],Oe.prototype,"_isInitializing",void 0),Oe=(0,r.Cg)([(0,a.$K)("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],Oe);const ze=Oe,Pe={result:{}}}}]);