@arcgis/core 4.27.0 → 4.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/07f52b140db07fa962bb.js +1 -0
- package/assets/esri/core/workers/chunks/2d19500b2c042b6b79ac.js +1 -0
- package/assets/esri/core/workers/chunks/{979d9f37c555df0e8fa6.js → 7adbd577bb58c3bbaf28.js} +1 -1
- package/assets/esri/core/workers/chunks/{588cd91d08cec5207be1.js → 873b608720cce890e572.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d4bd73dd50400e9d328.js → 9c8ab6bd8c170cbc5fa5.js} +1 -1
- package/assets/esri/core/workers/chunks/da2110b4caff9cc9b116.js +1 -0
- package/assets/esri/themes/base/widgets/_BasemapGallery.scss +1 -1
- package/assets/esri/themes/base/widgets/_Feature.scss +1 -1
- package/assets/esri/themes/base/widgets/_ValuePicker.scss +5 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Pattern.glsl.js +33 -32
- package/interfaces.d.ts +42 -12
- package/kernel.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/TelemetryData.js +1 -1
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/video/videoUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/featureEditing.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/webgl/AppleAmdDriverHelper.js +5 -0
- package/views/webgl/testAppleAmdDrawArrays.js +1 -1
- package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Feature/FeatureAttachments.js +1 -1
- package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
- package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/assets/esri/core/workers/chunks/17ab08f60764244b2cf8.js +0 -1
- package/assets/esri/core/workers/chunks/38c6452dc9cf18e8bca8.js +0 -1
- package/assets/esri/core/workers/chunks/fbd3c78ee8e2219a6c7a.js +0 -1
- package/views/3d/webgl-engine/lib/AppleAmdDriverHelper.js +0 -5
|
@@ -282,7 +282,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
282
282
|
|
|
283
283
|
fragColor = vec4(b / w_total);
|
|
284
284
|
}
|
|
285
|
-
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>u,Z:()=>c,c:()=>i,f:()=>o});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>u,e:()=>l,n:()=>d,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[4],d=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+u*i+m*a+g,e[x+1]=l*r+d*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+u*i+m*a,e[v+1]=l*r+d*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function u(e,t){d(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:d,normalizeView:u,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n||!n.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},43090:(e,t,r)=>{function i(e){return 32+e.length}function o(e){if(!e)return 0;let t=l;for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];switch(typeof o){case"string":t+=i(o);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e){if(!e)return 0;if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return 32+8*t;let r=c;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=l;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e){switch(typeof e){case"object":return n(e);case"string":return i(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(e,t){return c+e.length*t}r.d(t,{Ul:()=>n,do:()=>s,f2:()=>o});const l=32,c=32},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>u,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.b)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,u=(0,n.b)(s.WM.get(),t,c),d=(0,n.e)(l,u)/(0,n.p)(l);return(0,n.g)(a,l,(0,i.uZ)(d,0,1)),(0,n.a)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},40706:(e,t,r)=>{r.d(t,{fetch:()=>lr});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),u=r(60437),d=r(1533);function h(e,t=!1){return e<=d.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),b=r(91911),E=r(15317),A=r(14682),S=r(1265);function w(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class R{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new R,this.numberOfVertices=0}}var y=r(3172),O=r(66643),M=r(43090),P=r(20102),I=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function H(e,t){const{data:r}=await(0,y.default)(e,{responseType:"image",...t});return r}var F=r(51417),B=r(47026),U=r(24882);function z(e){if(e.length<d.DB)return Array.from(e);if((0,d.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,d.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var V=r(44553),G=r(11726);class W{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,G.hu)(e.length>=1),(0,G.hu)(r.length%this._numIndexPerPrimitive==0),(0,G.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,G.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];k.clear(),k.push(s);const u=(0,c.f)(o[s],o[s+1],o[s+2]),d=(0,c.a)(u);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],k.push(s);let t=o[s];u[0]=Math.min(t,u[0]),d[0]=Math.max(t,d[0]),t=o[s+1],u[1]=Math.min(t,u[1]),d[1]=Math.max(t,d[1]),t=o[s+2],u[2]=Math.min(t,u[2]),d[2]=Math.max(t,d[2])}}this.bbMin=u,this.bbMax=d;const h=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(d[0]-u[0],d[1]-u[1]),d[2]-u[2]);let m=this.radius*this.radius;for(let e=0;e<k.length;++e){s=k.at(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],n=t*t+r*r+i*i;if(n<=m)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,m=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,k.clear()}getChildren(){if(this._children||(0,l.d)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],u=o[l+1],d=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<u&&(u=r),i<d&&(d=i)}c<e[0]&&(t|=1),u<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==s[e]&&this._children.push(new W(s[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){k.prune()}}const k=new V.Z({deallocator:null});var $=r(17662),j=r(4726),q=r(22807),X=r(16996);function Y(e,t,r){return(0,l.b)(J,t,e),(0,l.b)(Z,r,e),(0,l.l)((0,l.f)(J,J,Z))/2}r(12981),new q.x(X.Ue),new q.x((()=>{return e?{p0:(0,c.a)(e.p0),p1:(0,c.a)(e.p1),p2:(0,c.a)(e.p2)}:{p0:(0,c.c)(),p1:(0,c.c)(),p2:(0,c.c)()};var e}));const J=(0,c.c)(),Z=(0,c.c)(),K=(0,c.c)(),Q=(0,c.c)(),ee=(0,c.c)(),te=(0,c.c)();var re=r(99001);class ie{constructor(e){this.channel=e,this.id=(0,re.D)()}}var oe=r(35065);r(9820),(0,c.c)(),new Float32Array(6);class ne extends $.c{constructor(e,t,r=[],i=null,o=j.U.Mesh,n=null,a=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=a,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,U.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,U.mi)(t)),e===oe.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new ne(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===j.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===j.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,l.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0),(0,l.s)(te,0,0,0);let n=0,a=0;for(let e=0;e<t.length-2;e+=3){const s=t[e]*i,c=t[e+1]*i,u=t[e+2]*i;(0,l.s)(K,o[s],o[s+1],o[s+2]),(0,l.s)(Q,o[c],o[c+1],o[c+2]),(0,l.s)(ee,o[u],o[u+1],o[u+2]);const d=Y(K,Q,ee);d?((0,l.a)(K,K,Q),(0,l.a)(K,K,ee),(0,l.g)(K,K,1/3*d),(0,l.a)(r,r,K),n+=d):((0,l.a)(te,te,K),(0,l.a)(te,te,Q),(0,l.a)(te,te,ee),a+=3)}return!(0===a&&0===n||(0!==n?((0,l.g)(r,r,1/n),0):0===a||((0,l.g)(r,te,1/a),0)))}(this.vertexAttributes.get(oe.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(oe.T.POSITION),r=this.indices.get(oe.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,l.s)(i,0,0,0),(0,l.s)(te,0,0,0);let o=0,n=0;const{size:a,data:s}=e,c=t?t.length-1:s.length/a-1,u=c+(r?2:0);for(let e=0;e<u;e+=2){const r=e<c?e:c,u=e<c?e+1:0,d=(t?t[r]:r)*a,h=(t?t[u]:u)*a;K[0]=s[d],K[1]=s[d+1],K[2]=s[d+2],Q[0]=s[h],Q[1]=s[h+1],Q[2]=s[h+2],(0,l.g)(K,(0,l.a)(K,K,Q),.5);const m=(0,l.j)(K,Q);m>0?((0,l.a)(i,i,(0,l.g)(K,K,m)),o+=m):0===o&&((0,l.a)(te,te,K),n++)}return 0!==o?((0,l.g)(i,i,1/o),!0):0!==n&&((0,l.g)(i,te,1/n),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0);let n=-1,a=0;for(let e=0;e<t.length;e++){const s=t[e]*i;n!==s&&(r[0]+=o[s],r[1]+=o[s+1],r[2]+=o[s+2],a++),n=s}return a>1&&(0,l.g)(r,r,1/a),a>0}(this.vertexAttributes.get(oe.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(oe.T.POSITION),t=this.vertexAttributes.get(oe.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===j.U.Mesh?3:1;(0,G.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,U.KF)(e.length/r);return new W(i,r,e,t)}get transformation(){return this._transformation??s.I}set transformation(e){this._transformation=e&&e!==s.I?(0,s.b)(e):null}get shaderTransformation(){return null!=this._shaderTransformer?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return null!=this._shaderTransformer}addHighlight(){const e=new ie(B.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ae=r(80442),se=r(32448),le=r(70586),ce=r(81271),ue=r(85958),de=r(99880);let he;var me,fe;(fe=me||(me={}))[fe.ETC1_RGB=0]="ETC1_RGB",fe[fe.ETC2_RGBA=1]="ETC2_RGBA",fe[fe.BC1_RGB=2]="BC1_RGB",fe[fe.BC3_RGBA=3]="BC3_RGBA",fe[fe.BC4_R=4]="BC4_R",fe[fe.BC5_RG=5]="BC5_RG",fe[fe.BC7_M6_RGB=6]="BC7_M6_RGB",fe[fe.BC7_M5_RGBA=7]="BC7_M5_RGBA",fe[fe.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",fe[fe.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",fe[fe.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",fe[fe.ATC_RGB=11]="ATC_RGB",fe[fe.ATC_RGBA=12]="ATC_RGBA",fe[fe.FXT1_RGB=17]="FXT1_RGB",fe[fe.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",fe[fe.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",fe[fe.ETC2_EAC_R11=20]="ETC2_EAC_R11",fe[fe.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",fe[fe.RGBA32=13]="RGBA32",fe[fe.RGB565=14]="RGB565",fe[fe.BGR565=15]="BGR565",fe[fe.RGBA4444=16]="RGBA4444";var pe=r(35371),ge=r(57088),ve=r(45762);let _e=null,Te=null;async function xe(){return null==Te&&(Te=function(){if(null==he){const e=e=>(0,de.V)(`esri/libs/basisu/${e}`);he=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return he}(),_e=await Te),Te}function be(e,t,r,i,o){const n=(0,ve.RG)(t?pe.q_.COMPRESSED_RGBA8_ETC2_EAC:pe.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function Ee(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Se(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[me.ETC2_RGBA,pe.q_.COMPRESSED_RGBA8_ETC2_EAC]:[me.ETC1_RGB,pe.q_.COMPRESSED_RGB8_ETC2]:c?i?[me.BC3_RGBA,pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[me.BC1_RGB,pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[me.RGBA32,pe.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.width=o,t.height=n,new ge.x(e,t,{type:"compressed",levels:m})}const we=I.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Re(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Ce=Re("DXT1"),ye=Re("DXT3"),Oe=Re("DXT5");var Me,Pe,Ie=r(47859);class Ne extends $.c{constructor(e,t){super(),this._data=e,this.type=j.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.Z,this.parameters=t||{},this.parameters.mipmap=!1!==this.parameters.mipmap,this.parameters.noUnpackFlip=this.parameters.noUnpackFlip||!1,this.parameters.preMultiplyAlpha=this.parameters.preMultiplyAlpha||!1,this.parameters.wrap=this.parameters.wrap||{s:pe.e8.REPEAT,t:pe.e8.REPEAT},this._startPreload(e)}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.HK)(e.src)||(0,ce.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}dispose(){this._data=void 0}_createDescriptor(e){const t=new Ie.X;return t.wrapMode=this.parameters.wrap??pe.e8.REPEAT,t.flipped=!this.parameters.noUnpackFlip,t.samplingMode=this.parameters.mipmap?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.hasMipmap=!!this.parameters.mipmap,t.preMultiplyAlpha=!!this.parameters.preMultiplyAlpha,t.maxAnisotropy=this.parameters.maxAnisotropy??(this.parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,d.eP)(e)||(0,d.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.KTX2File(new Uint8Array(e)),i=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.BasisFile(new Uint8Array(e)),i=Ee(r)?be(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Le(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this.parameters)}load(e){if(null!=this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ge.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this.parameters.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,t)):((0,d.eP)(t)||(0,d.lq)(t))&&this.parameters.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,t)):((0,d.eP)(t)||(0,d.lq)(t))&&this.parameters.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,t)):(0,d.lq)(t)?this._loadFromPixelData(e,t):(0,d.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&null!=this._glTexture?this._data.readyState<Me.HAVE_CURRENT_DATA||e===this._data.currentTime?e:(this._glTexture.setData(this._data),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.parameters.updateCallback&&this.parameters.updateCallback(),this._data.currentTime):e}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return we.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return we.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case Ce:o=8,n=pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ye:o=16,n=pe.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:o=16,n=pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return we.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(we.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,d=new Uint8Array(e,m,h),f.push(d),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new ge.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await xe());const i=new _e.KTX2File(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const o=Se(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await xe());const i=new _e.BasisFile(new Uint8Array(r));if(!Ee(i))return null;i.startTranscoding();const o=Se(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,G.hu)(this.parameters.width>0&&this.parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.parameters.components?pe.VI.LUMINANCE:3===this.parameters.components?pe.VI.RGB:pe.VI.RGBA,r.width=this.parameters.width??0,r.height=this.parameters.height??0,this._glTexture=new ge.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,ue.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=Me.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,le.hw)(l)},a=()=>{t.readyState>=Me.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new P.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=Le(t);this.parameters.width=r.width,this.parameters.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this.parameters.components?pe.VI.RGB:pe.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new ge.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,le.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Le(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(Pe=Me||(Me={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var De=r(64822),He=r(65576),Fe=r(55039),Be=r(60624),Ue=r(19419),ze=r(85504),Ve=r(60537),Ge=r(82791),We=r(93144),ke=r(27097);const $e=(0,ke.wK)(pe.zi.SRC_ALPHA,pe.zi.ONE,pe.zi.ONE_MINUS_SRC_ALPHA,pe.zi.ONE_MINUS_SRC_ALPHA),je=(0,ke.if)(pe.zi.ONE,pe.zi.ONE),qe=(0,ke.if)(pe.zi.ZERO,pe.zi.ONE_MINUS_SRC_ALPHA);function Xe(e){return e===We.A.FrontFace?null:e===We.A.Alpha?qe:je}const Ye={factor:-1,units:-2};function Je(e,t=pe.wb.LESS){return e===We.A.NONE||e===We.A.FrontFace?t:pe.wb.LEQUAL}var Ze,Ke;(Ke=Ze||(Ze={}))[Ke.INTEGRATED_MESH=0]="INTEGRATED_MESH",Ke[Ke.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Ke[Ke.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Ke[Ke.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",Ke[Ke.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",Ke[Ke.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Ke[Ke.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",Ke[Ke.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",Ke[Ke.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",Ke[Ke.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",Ke[Ke.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",Ke[Ke.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",Ke[Ke.LASERLINES=12]="LASERLINES",Ke[Ke.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",Ke[Ke.HUD_MATERIAL=14]="HUD_MATERIAL",Ke[Ke.LABEL_MATERIAL=15]="LABEL_MATERIAL",Ke[Ke.LINE_CALLOUTS=16]="LINE_CALLOUTS",Ke[Ke.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Ke[Ke.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Ke[Ke.DRAPED_WATER=19]="DRAPED_WATER",Ke[Ke.VOXEL=20]="VOXEL",Ke[Ke.MAX_SLOTS=21]="MAX_SLOTS";var Qe=r(51305),et=r(94961),tt=r(72119),rt=r(29268);const it=(0,c.c)(),ot=(0,c.c)(),nt=(0,c.c)(),at=new class{constructor(e=0){this.offset=e,this.sphere=(0,rt.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,rt.c)(),this._obb={center:(0,c.c)(),halfSize:(0,tt.c)(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this._totalOffset/Math.sqrt(i*i+o*o+n*n);return this._tmpVertex[0]=e+i*a,this._tmpVertex[1]=t+o*a,this._tmpVertex[2]=r+n*a,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*n<0?0:Math.min(Math.abs(r),Math.abs(n)),c=i*a<0?0:Math.min(Math.abs(i),Math.abs(a)),u=Math.sqrt(s*s+l*l+c*c);if(u<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=n>0?this._totalOffset:0,e[5]+=a>0?this._totalOffset:0,e;const d=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(n)),m=Math.max(Math.abs(i),Math.abs(a)),f=Math.sqrt(d*d+h*h+m*m),p=this._totalOffset/f,g=this._totalOffset/u;return e[0]+=t*(t>0?p:g),e[1]+=r*(r>0?p:g),e[2]+=i*(i>0?p:g),e[3]+=o*(o<0?p:g),e[4]+=n*(n<0?p:g),e[5]+=a*(a<0?p:g),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,l.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,l.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,l.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,Qe.c)(st,e.quaternion),(0,l.q)(this._obb.halfSize,this._obb.halfSize,st),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)it[t]=e[0+t]+this.localOrigin[t],ot[t]=e[3+t]+this.localOrigin[t],nt[t]=it[t];const t=this.applyToVertex(it[0],it[1],it[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)nt[t]=0==(e&1<<t)?it[t]:ot[t];r(nt)}let i=0;for(let e=0;e<3;++e)it[e]*ot[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)nt[t]=0!=(i&1<<t)?0:0!=(e&1<<t)?it[t]:ot[t];r(nt)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const st=(0,et.a)();function lt(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function ct(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function ut(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function dt(e,t,r,i,o,n=1){if(!r)return void ct(e,t,i,o,n);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,u=r[0],d=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],v=r[9],_=r[10],T=r[12],x=r[13],b=r[14];o*=l;let E=0,A=0,S=0;const w=(0,a.y)(r)?e=>{E=t[e]+T,A=t[e+1]+x,S=t[e+2]+b}:e=>{const r=t[e],i=t[e+1],o=t[e+2];E=u*r+m*i+g*o+T,A=d*r+f*i+v*o+x,S=h*r+p*i+_*o+b};if(1===n)for(let t=0;t<c;++t)w(3*e[t]),s[o]=E,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){w(3*e[t]);for(let e=0;e<n;++e)s[o]=E,s[o+1]=A,s[o+2]=S,o+=l}}function ht(e,t,r,i,o,n=1){if(!r)return void ct(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),b=1e-6,E=1-b;o*=c;let A=0,S=0,w=0;const R=(0,a.y)(s)?e=>{A=t[e],S=t[e+1],w=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=d*r+f*i+v*o,S=h*r+p*i+_*o,w=m*r+g*i+T*o};if(1===n)if(x)for(let t=0;t<u;++t){R(3*e[t]);const r=A*A+S*S+w*w;if(r<E&&r>b){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=w*e}else l[o]=A,l[o+1]=S,l[o+2]=w;o+=c}else for(let t=0;t<u;++t)R(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=w,o+=c;else for(let t=0;t<u;++t){if(R(3*e[t]),x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=w,o+=c}}function mt(e,t,r,i,o,n=1){if(!r)return void ut(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),b=1e-6,E=1-b;if(o*=c,1===n)for(let r=0;r<u;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],u=t[i+3];let A=d*n+f*a+v*s,S=h*n+p*a+_*s,w=m*n+g*a+T*s;if(x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}l[o]=A,l[o+1]=S,l[o+2]=w,l[o+3]=u,o+=c}else for(let r=0;r<u;++r){const i=4*e[r],a=t[i],s=t[i+1],u=t[i+2],A=t[i+3];let S=d*a+f*s+v*u,w=h*a+p*s+_*u,R=m*a+g*s+T*u;if(x){const e=S*S+w*w+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);S*=t,w*=t,R*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=w,l[o+2]=R,l[o+3]=A,o+=c}}function ft(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const u=l*n;for(let t=1;t<u;++t)e[o]=c,o+=r}}function pt(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}function gt(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}class vt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(oe.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case oe.T.POSITION:{(0,G.hu)(3===t.size);const e=o.getField(a,m.ct);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&dt(s,t.data,r,e,n);break}case oe.T.NORMAL:{(0,G.hu)(3===t.size);const e=o.getField(a,m.ct);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&ht(s,t.data,i,e,n);break}case oe.T.NORMALCOMPRESSED:{(0,G.hu)(2===t.size);const e=o.getField(a,m.or);(0,G.hu)(!!e,`No buffer view for ${a}`),e&<(s,t.data,e,n);break}case oe.T.UV0:{(0,G.hu)(2===t.size);const e=o.getField(a,m.Eu);(0,G.hu)(!!e,`No buffer view for ${a}`),e&<(s,t.data,e,n);break}case oe.T.COLOR:case oe.T.SYMBOLCOLOR:{const e=o.getField(a,m.mc);(0,G.hu)(!!e,`No buffer view for ${a}`),(0,G.hu)(3===t.size||4===t.size),!e||3!==t.size&&4!==t.size||ft(s,t.data,t.size,e,n);break}case oe.T.COLORFEATUREATTRIBUTE:{const e=o.getField(a,m.ly);(0,G.hu)(!!e,`No buffer view for ${a}`),(0,G.hu)(1===t.size),e&&1===t.size&&pt(s,t.data,e,n);break}case oe.T.TANGENT:{(0,G.hu)(4===t.size);const e=o.getField(a,m.ek);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&mt(s,t.data,i,e,n);break}case oe.T.PROFILERIGHT:case oe.T.PROFILEUP:case oe.T.PROFILEVERTEXANDNORMAL:case oe.T.FEATUREVALUE:{(0,G.hu)(4===t.size);const e=o.getField(a,m.ek);(0,G.hu)(!!e,`No buffer view for ${a}`),e&&ut(s,t.data,e,n)}}else if(a===oe.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(oe.T.POSITION);if((0,G.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);gt(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var _t=r(57790),Tt=r(88669),xt=r(135),bt=r(15719),Et=r(96310),At=r(78869),St=r(14589),wt=r(83475),Rt=r(59377);pe.wb.LESS,pe.wb.ALWAYS;const Ct={mask:255},yt={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.ZERO}},Ot={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.REPLACE}};pe.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP,pe.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP;const Mt=[1,1,.5],Pt=[0,.6,.2],It=[0,1,.2];var Nt=r(32078);class Lt extends bt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.g)(Mt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Be.r.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,Tt.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=Et.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ge.yD.Occlude}}class Dt extends St.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===De.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?xt.N.Default:xt.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Dt.shader)}_initializeProgram(e,t){return new Rt.$(e.rctx,t.get().build(this.configuration),wt.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?pe.wb.LEQUAL:pe.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===We.A.NONE,o=e===We.A.FrontFace;return(0,ke.sm)({blending:r.output!==Fe.H.Color&&r.output!==Fe.H.Alpha||!r.transparent?null:i?$e:Xe(e),culling:Ht(r)?(0,ke.zp)(r.cullFace):null,depthTest:{func:Je(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?ke.LZ:null,colorWrite:ke.BK,stencilWrite:r.hasOccludees?Ct:null,stencilTest:r.hasOccludees?t?Ot:yt:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Ye:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function Ht(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Dt.shader=new At.J(Nt.D,(()=>r.e(9291).then(r.bind(r,79291))));var Ft=r(43697),Bt=r(51354),Ut=r(67498);class zt extends Bt.m{}(0,Ft._)([(0,Bt.o)({constValue:!0})],zt.prototype,"hasSliceHighlight",void 0),(0,Ft._)([(0,Bt.o)({constValue:!1})],zt.prototype,"hasSliceInVertexProgram",void 0),(0,Ft._)([(0,Bt.o)({constValue:!1})],zt.prototype,"instancedDoublePrecision",void 0),(0,Ft._)([(0,Bt.o)({constValue:!1})],zt.prototype,"hasModelTransformation",void 0),(0,Ft._)([(0,Bt.o)({constValue:Ut.P.Pass})],zt.prototype,"pbrTextureBindType",void 0);class Vt extends zt{constructor(){super(...arguments),this.output=Fe.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Ue.q.None,this.pbrMode=ze.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=We.A.NONE,this.normalType=Be.r.Attribute,this.textureCoordinateType=xt.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Ft._)([(0,Bt.o)({count:Fe.H.COUNT})],Vt.prototype,"output",void 0),(0,Ft._)([(0,Bt.o)({count:B.JJ.COUNT})],Vt.prototype,"alphaDiscardMode",void 0),(0,Ft._)([(0,Bt.o)({count:Ue.q.COUNT})],Vt.prototype,"doubleSidedMode",void 0),(0,Ft._)([(0,Bt.o)({count:ze.f7.COUNT})],Vt.prototype,"pbrMode",void 0),(0,Ft._)([(0,Bt.o)({count:B.Vr.COUNT})],Vt.prototype,"cullFace",void 0),(0,Ft._)([(0,Bt.o)({count:We.A.COUNT})],Vt.prototype,"transparencyPassType",void 0),(0,Ft._)([(0,Bt.o)({count:Be.r.COUNT})],Vt.prototype,"normalType",void 0),(0,Ft._)([(0,Bt.o)({count:xt.N.COUNT})],Vt.prototype,"textureCoordinateType",void 0),(0,Ft._)([(0,Bt.o)({count:B.Gv.COUNT})],Vt.prototype,"customDepthTest",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"spherical",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasVertexColors",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasSymbolColors",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasVerticalOffset",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasSlicePlane",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasSliceHighlight",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasColorTexture",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasMetallicRoughnessTexture",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasEmissionTexture",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasOcclusionTexture",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasNormalTexture",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasScreenSizePerspective",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasVertexTangents",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasOccludees",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasMultipassTerrain",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasModelTransformation",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"offsetBackfaces",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"vvSize",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"vvColor",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"receiveShadows",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"receiveAmbientOcclusion",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"textureAlphaPremultiplied",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"instanced",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"instancedColor",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"instancedDoublePrecision",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"writeDepth",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"transparent",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"enableOffset",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"cullAboveGround",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"snowCover",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasColorTextureTransform",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasEmissionTextureTransform",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasNormalTextureTransform",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasOcclusionTextureTransform",void 0),(0,Ft._)([(0,Bt.o)()],Vt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Ft._)([(0,Bt.o)({constValue:!0})],Vt.prototype,"hasVvInstancing",void 0),(0,Ft._)([(0,Bt.o)({constValue:!1})],Vt.prototype,"useCustomDTRExponentForWater",void 0),(0,Ft._)([(0,Bt.o)({constValue:!1})],Vt.prototype,"supportsTextureAtlas",void 0),(0,Ft._)([(0,Bt.o)({constValue:!0})],Vt.prototype,"useFillLights",void 0);var Gt=r(41846);class Wt extends Dt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Be.r.Attribute,t.doubleSidedMode=Ue.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Wt.shader)}}Wt.shader=new At.J(Gt.R,(()=>r.e(8096).then(r.bind(r,38096))));class kt extends Ge.F5{constructor(e){super(e,jt),this.supportsEdges=!0,this._configuration=new Vt,this._vertexBufferLayout=function(e){const t=(0,He.U$)().vec3f(oe.T.POSITION);return e.normalType===Be.r.Compressed?t.vec2i16(oe.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(oe.T.NORMAL),e.hasVertexTangents&&t.vec4f(oe.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(oe.T.UV0),e.hasVertexColors&&t.vec4u8(oe.T.COLOR),e.hasSymbolColors&&t.vec4u8(oe.T.SYMBOLCOLOR),(0,ae.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(oe.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Fe.H.Shadow&&e!==Fe.H.ShadowExcludeHighlight&&e!==Fe.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Fe.H.Color&&e!==Fe.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ue.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ue.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ue.q.WindingOrder:Ue.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?ze.f7.Schematic:ze.f7.Normal:ze.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Kt,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case De.JY.Global:n=(0,l.n)(Jt,Kt);break;case De.JY.Local:n=(0,l.c)(Jt,Yt)}let a=0;const s=(0,l.b)(Qt,Kt,e.eye),c=(0,l.l)(s),u=(0,l.g)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.e)(n,u)),a+=(0,_t.Hx)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.g)(n,n,a),(0,l.t)(Zt,n,r.transform.inverseRotation),i=(0,l.b)(qt,i,Zt),o=(0,l.b)(Xt,o,Zt)}(0,_t.Bw)(e,r,i,o,function(e){return null!=e?(at.offset=e,at):null}(r.verticalOffset),n)}requiresSlot(e,t){return!(t!==Fe.H.Color&&t!==Fe.H.Alpha&&t!==Fe.H.Depth&&t!==Fe.H.Normal&&t!==Fe.H.Shadow&&t!==Fe.H.ShadowHighlight&&t!==Fe.H.ShadowExcludeHighlight&&t!==Fe.H.Highlight&&t!==Fe.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Ze.TRANSPARENT_MATERIAL:Ze.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Ze.OPAQUE_MATERIAL)&&e!==Ze.DRAPED_MATERIAL)}createGLMaterial(e){return new $t(e)}createBufferWriter(){return new vt(this._vertexBufferLayout)}}class $t extends Ve.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Fe.H.Color&&this._output!==Fe.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Wt:Dt,e)}}const jt=new class extends Lt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},qt=(0,c.c)(),Xt=(0,c.c)(),Yt=(0,c.f)(0,0,1),Jt=(0,c.c)(),Zt=(0,c.c)(),Kt=(0,c.c)(),Qt=(0,c.c)(),er=I.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function tr(e){throw new P.Z("",`Request for object resource failed: ${e}`)}function rr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(er.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(er.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(er.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(er.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else er.warn("Indexed geometries must specify faces"),i=!1;break}default:er.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(er.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(er.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function ir(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function or(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function nr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const ar=new D.G(1,2,"wosr");var sr=r(57758);async function lr(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,O.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),tr(i.error.details.url)}(e,r,t);const i=await(0,O.q6)((0,y.default)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),tr(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){er.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.e8.REPEAT,t:pe.e8.REPEAT},preMultiplyAlpha:or(l)!==B.JJ.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):H(a,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,M.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");ar.validate(s);const l=a.model.name,u=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const a=u[e];if(!rr(a))continue;const s=nr(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new F.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)g.push([t,e[t].values])}const v=s.texture,_=h&&h[v];if(_&&!f.has(v)){const{image:e,parameters:t}=_,r=new Ne(e,t);i.push(r),f.set(v,r)}const T=f.get(v),x=T?T.id:void 0,b=s.material;let E=n.get(b,v);if(null==E){const e=d[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=_?or(_.alphaChannelUsage):void 0,a={ambient:(0,c.g)(e.diffuse),diffuse:(0,c.g)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:_?.parameters.preMultiplyAlpha??!1};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),E=new kt(a),n.set(b,v,E)}o.push(E);const A=new ne(E,p,g);m+=g.find((e=>e[0]===oe.T.POSITION))?.[1].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:ir(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),d=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=d&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,u=n.count,d=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,a.a)((0,s.c)(),o.transform);let _=0,T=0;for(let a=0;a<u;a++){n.getVec(a,h),i.getVec(a,d),(0,l.m)(h,h,o.transform),(0,l.b)(f,h,t.center),(0,l.D)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.D)(f,f,t.radius),null!==v&&(0,l.m)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.h)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*u,p[T+1]=255*u,p[T+2]=255*u,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,d));const S=!!t.usePBR,R=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...It]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...Mt]},P={...t.materialParamsMixin,treeRendering:A},{engineResources:I,referenceBoundingBox:U}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,d=new Map,T=n.lods.length,x=(0,u.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const R=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new kt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(u.alphaMode);if(!n.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new Ne((0,E.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,E.$A)(e)&&r,encoding:(0,E.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==B.JJ.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/sr.K),f=u.color[1]**(1/sr.K),p=u.color[2]**(1/sr.K),g=u.emissiveFactor[0]**(1/sr.K),v=u.emissiveFactor[1]**(1/sr.K),_=u.emissiveFactor[2]**(1/sr.K),T=null!=u.textureColor&&d?a.get(u.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.k)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});n.set(s,new kt({...i,transparent:m===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?Be.r.Attribute:Be.r.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?a.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?a.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?a.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?a.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...Pt]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:w(u.colorTextureTransform),normalTextureTransformMatrix:w(u.normalTextureTransform),occlusionTextureTransformMatrix:w(u.occlusionTextureTransform),emissiveTextureTransformMatrix:w(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:w(u.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(n,e,R,t,r,s,d),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,b.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[oe.T.POSITION,new F.a(n,3,!0)]],c=[[oe.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.b)(cr,e.transform),(0,f.a)(t,n,cr,3,a),l.push([oe.T.NORMAL,new F.a(t,3,!0)]),c.push([oe.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.b)(cr,e.transform),(0,p.t)(t,n,cr,4,a),l.push([oe.T.TANGENT,new F.a(t,4,!0)]),c.push([oe.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([oe.T.UV0,new F.a(t,2,!0)]),c.push([oe.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([oe.T.COLOR,new F.a(t,4,!0)]),c.push([oe.T.COLOR,i])}return{geometry:new ne(t,l,c),vertexCount:r}}(e,null!=i?i:new kt({})),C=a.boundingInfo;null!=C&&0===A&&((0,u.pp)(x,C.bbMin),(0,u.pp)(x,C.bbMax)),null!=i&&(R.stageResources.geometries.push(a),R.numberOfVertices+=T)})),S||a.push(R)})),{engineResources:a,referenceBoundingBox:x}}(n,R,P,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:I,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const cr=(0,n.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>u});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
285
|
+
`),e}const p=Object.freeze(Object.defineProperty({__proto__:null,build:f},Symbol.toStringTag,{value:"Module"}))},14682:(e,t,r)=>{function i(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function o(e,t,r,i,o,n,a,s,l){const c=new Float32Array(9);return c[0]=e,c[1]=t,c[2]=r,c[3]=i,c[4]=o,c[5]=n,c[6]=a,c[7]=s,c[8]=l,c}r.d(t,{c:()=>i,f:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,clone:function(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},create:i,createView:function(e,t){return new Float32Array(e,t,9)},fromValues:o},Symbol.toStringTag,{value:"Module"}))},1265:(e,t,r)=>{function i(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function n(){return i()}function a(){return o(1,1)}function s(){return o(1,0)}function l(){return o(0,1)}r.d(t,{O:()=>u,Z:()=>c,c:()=>i,f:()=>o});const c=n(),u=a(),d=s(),h=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:d,UNIT_Y:h,ZEROS:c,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,createView:function(e,t){return new Float32Array(e,t,2)},fromValues:o,ones:a,unitX:s,unitY:l,zeros:n},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>s,b:()=>a,c:()=>o,d:()=>u,e:()=>l,n:()=>d,s:()=>c,t:()=>n});var i=r(72220);function o(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return i.c.error("source and destination buffers need to have the same number of elements"),e;const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[4],d=r[5],h=r[6],m=r[8],f=r[9],p=r[10],g=r[12],v=r[13],_=r[14];let T=0,x=0;for(let r=0;r<a;r++){const r=t[T],i=t[T+1],a=t[T+2];e[x]=s*r+u*i+m*a+g,e[x+1]=l*r+d*i+f*a+v,e[x+2]=c*r+h*i+p*a+_,T+=n,x+=o}return e}function a(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,o=3,n=o){if(e.length/o!==Math.ceil(t.length/n))return void i.c.error("source and destination buffers need to have the same number of elements");const a=e.length/o,s=r[0],l=r[1],c=r[2],u=r[3],d=r[4],h=r[5],m=r[6],f=r[7],p=r[8];let g=0,v=0;for(let r=0;r<a;r++){const r=t[g],i=t[g+1],a=t[g+2];e[v]=s*r+u*i+m*a,e[v+1]=l*r+d*i+f*a,e[v+2]=c*r+h*i+p*a,g+=n,v+=o}}function l(e,t,r){c(e.typedBuffer,t,r,e.typedBufferStride)}function c(e,t,r,i=3){const o=Math.min(e.length/i,t.count),n=t.typedBuffer,a=t.typedBufferStride;let s=0,l=0;for(let t=0;t<o;t++)e[l]=r*n[s],e[l+1]=r*n[s+1],e[l+2]=r*n[s+2],s+=a,l+=i}function u(e,t){d(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function d(e,t,r=3,i=r){const o=Math.min(e.length/r,t.length/i);let n=0,a=0;for(let s=0;s<o;s++){const o=t[n],s=t[n+1],l=t[n+2],c=o*o+s*s+l*l;if(c>0){const t=1/Math.sqrt(c);e[a]=t*o,e[a+1]=t*s,e[a+2]=t*l}n+=i,a+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:d,normalizeView:u,scale:c,scaleView:l,shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;let l=0,c=0;for(let e=0;e<i;e++)o[c]=a[l]>>r,o[c+1]=a[l+1]>>r,o[c+2]=a[l+2]>>r,l+=s,c+=n},transformMat3:s,transformMat3View:a,transformMat4:n,transformMat4View:o},Symbol.toStringTag,{value:"Module"}))},23670:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(20102);let o=class{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.Z(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new o(this.major,this.minor,this._context)}static parse(e,t=""){const[r,n]=e.split("."),a=/^\s*\d+\s*$/;if(!r||!r.match||!a.test(r))throw new i.Z((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!n||!n.match||!a.test(n))throw new i.Z((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const s=parseInt(r,10),l=parseInt(n,10);return new o(s,l,t)}}},43090:(e,t,r)=>{function i(e){return 32+e.length}function o(e){if(!e)return 0;let t=l;for(const r in e)if(e.hasOwnProperty(r)){const o=e[r];switch(typeof o){case"string":t+=i(o);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function n(e){if(!e)return 0;if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return 32+8*t;let r=c;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=l;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e){switch(typeof e){case"object":return n(e);case"string":return i(e);case"number":return 16;case"boolean":return 4;default:return 8}}function s(e,t){return c+e.length*t}r.d(t,{Ul:()=>n,do:()=>s,f2:()=>o});const l=32,c=32},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{XO:()=>i,pJ:()=>o});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},16996:(e,t,r)=>{r.d(t,{Ue:()=>l,nF:()=>u,zk:()=>c});var i=r(22021),o=r(22807),n=r(17896),a=r(65617),s=r(12981);function l(e){return e?{origin:(0,a.a)(e.origin),vector:(0,a.a)(e.vector)}:{origin:(0,a.c)(),vector:(0,a.c)()}}function c(e,t,r=l()){return(0,n.c)(r.origin,e),(0,n.b)(r.vector,t,e),r}function u(e,t,r){return function(e,t,r,o,a){const{vector:l,origin:c}=e,u=(0,n.b)(s.WM.get(),t,c),d=(0,n.e)(l,u)/(0,n.p)(l);return(0,n.g)(a,l,(0,i.uZ)(d,0,1)),(0,n.a)(a,a,e.origin)}(e,t,0,0,r)}(0,a.c)(),(0,a.c)(),new o.x((()=>l()))},40706:(e,t,r)=>{r.d(t,{fetch:()=>or});var i=r(32243),o=r(21787),n=r(46521),a=r(52138),s=r(13598),l=r(17896),c=r(65617),u=r(60437),d=r(1533);function h(e,t=!1){return e<=d.DB?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var m=r(56481),f=r(20773),p=r(11077),g=r(10816),v=r(56067),_=r(75488),T=r(40270),x=r(91695),b=r(91911),E=r(15317),A=r(14682),S=r(1265);function w(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.Z,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:S.O,n=(0,A.f)(1,0,0,0,1,0,t[0],t[1],1),a=(0,A.f)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),s=(0,A.f)(i[0],0,0,0,i[1],0,0,0,1),l=(0,A.c)();return(0,o.m)(l,a,s),(0,o.m)(l,n,l),l}class R{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new R,this.numberOfVertices=0}}var y=r(3172),O=r(66643),M=r(43090),P=r(20102),I=r(92604);class N{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var L=r(95330),D=r(23670);async function H(e,t){const{data:r}=await(0,y.default)(e,{responseType:"image",...t});return r}var F=r(51417),B=r(47026),U=r(24882);function z(e){if(e.length<d.DB)return Array.from(e);if((0,d.kJ)(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,d.Uc)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var V=r(44553),G=r(11726);class W{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this._children=void 0,(0,G.hu)(e.length>=1),(0,G.hu)(r.length%this._numIndexPerPrimitive==0),(0,G.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,G.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];k.clear(),k.push(s);const u=(0,c.f)(o[s],o[s+1],o[s+2]),d=(0,c.a)(u);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],k.push(s);let t=o[s];u[0]=Math.min(t,u[0]),d[0]=Math.max(t,d[0]),t=o[s+1],u[1]=Math.min(t,u[1]),d[1]=Math.max(t,d[1]),t=o[s+2],u[2]=Math.min(t,u[2]),d[2]=Math.max(t,d[2])}}this.bbMin=u,this.bbMax=d;const h=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5);this.radius=.5*Math.max(Math.max(d[0]-u[0],d[1]-u[1]),d[2]-u[2]);let m=this.radius*this.radius;for(let e=0;e<k.length;++e){s=k.at(e);const t=o[s]-h[0],r=o[s+1]-h[1],i=o[s+2]-h[2],n=t*t+r*r+i*i;if(n<=m)continue;const a=Math.sqrt(n),l=.5*(a-this.radius);this.radius=this.radius+l,m=this.radius*this.radius;const c=l/a;h[0]+=t*c,h[1]+=r*c,h[2]+=i*c}this.center=h,k.clear()}getChildren(){if(this._children||(0,l.d)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,l.h)((0,c.c)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],u=o[l+1],d=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<u&&(u=r),i<d&&(d=i)}c<e[0]&&(t|=1),u<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const s=new Array(8);for(let e=0;e<8;++e)s[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==s[e]&&this._children.push(new W(s[e],this._numIndexPerPrimitive,this.indices,this.position));return this._children}static prune(){k.prune()}}const k=new V.Z({deallocator:null});var $=r(17662),j=r(4726),q=r(22807),X=r(16996);function Y(e,t,r){return(0,l.b)(J,t,e),(0,l.b)(Z,r,e),(0,l.l)((0,l.f)(J,J,Z))/2}r(12981),new q.x(X.Ue),new q.x((()=>{return e?{p0:(0,c.a)(e.p0),p1:(0,c.a)(e.p1),p2:(0,c.a)(e.p2)}:{p0:(0,c.c)(),p1:(0,c.c)(),p2:(0,c.c)()};var e}));const J=(0,c.c)(),Z=(0,c.c)(),K=(0,c.c)(),Q=(0,c.c)(),ee=(0,c.c)(),te=(0,c.c)();var re=r(99001);class ie{constructor(e){this.channel=e,this.id=(0,re.D)()}}var oe=r(35065);r(9820),(0,c.c)(),new Float32Array(6);class ne extends $.c{constructor(e,t,r=[],i=null,o=j.U.Mesh,n=null,a=-1){super(),this.material=e,this.mapPositions=i,this.type=o,this.objectAndLayerIdColor=n,this.edgeIndicesLength=a,this.visible=!0,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[e,r]of t)r&&this._vertexAttributes.set(e,{...r});if(null==r||0===r.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,U.KF)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,t]of r)t&&(this._indices.set(e,(0,U.mi)(t)),e===oe.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}instantiate(e={}){const t=new ne(e.material||this.material,[],void 0,this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._vertexAttributes.forEach(((e,r)=>{e.exclusive=!1,t._vertexAttributes.set(r,e)})),this._indices.forEach(((e,r)=>t._indices.set(r,e))),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){let t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._vertexAttributes.set(e,t)),t}setAttributeData(e,t){const r=this._vertexAttributes.get(e);r&&this._vertexAttributes.set(e,{...r,exclusive:!0,data:t})}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get faceCount(){return this.indexCount/3}get boundingInfo(){return null==this._boundingInfo&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===j.U.Mesh?this._computeAttachmentOriginTriangles(e):this.type===j.U.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,l.m)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0),(0,l.s)(te,0,0,0);let n=0,a=0;for(let e=0;e<t.length-2;e+=3){const s=t[e]*i,c=t[e+1]*i,u=t[e+2]*i;(0,l.s)(K,o[s],o[s+1],o[s+2]),(0,l.s)(Q,o[c],o[c+1],o[c+2]),(0,l.s)(ee,o[u],o[u+1],o[u+2]);const d=Y(K,Q,ee);d?((0,l.a)(K,K,Q),(0,l.a)(K,K,ee),(0,l.g)(K,K,1/3*d),(0,l.a)(r,r,K),n+=d):((0,l.a)(te,te,K),(0,l.a)(te,te,Q),(0,l.a)(te,te,ee),a+=3)}return!(0===a&&0===n||(0!==n?((0,l.g)(r,r,1/n),0):0===a||((0,l.g)(r,te,1/a),0)))}(this.vertexAttributes.get(oe.T.POSITION),t,e)}_computeAttachmentOriginLines(e){const t=this.vertexAttributes.get(oe.T.POSITION),r=this.indices.get(oe.T.POSITION);return function(e,t,r,i){if(!e)return!1;(0,l.s)(i,0,0,0),(0,l.s)(te,0,0,0);let o=0,n=0;const{size:a,data:s}=e,c=t?t.length-1:s.length/a-1,u=c+(r?2:0);for(let e=0;e<u;e+=2){const r=e<c?e:c,u=e<c?e+1:0,d=(t?t[r]:r)*a,h=(t?t[u]:u)*a;K[0]=s[d],K[1]=s[d+1],K[2]=s[d+2],Q[0]=s[h],Q[1]=s[h+1],Q[2]=s[h+2],(0,l.g)(K,(0,l.a)(K,K,Q),.5);const m=(0,l.j)(K,Q);m>0?((0,l.a)(i,i,(0,l.g)(K,K,m)),o+=m):0===o&&((0,l.a)(te,te,K),n++)}return 0!==o?((0,l.g)(i,i,1/o),!0):0!==n&&((0,l.g)(i,te,1/n),!0)}(t,r,r&&function(e,t,r){return!(!("isClosed"in e)||!e.isClosed)&&(r?r.length>2:t.data.length>6)}(this.material.parameters,t,r),e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(oe.T.POSITION);return function(e,t,r){if(!e||!t)return!1;const{size:i,data:o}=e;(0,l.s)(r,0,0,0);let n=-1,a=0;for(let e=0;e<t.length;e++){const s=t[e]*i;n!==s&&(r[0]+=o[s],r[1]+=o[s+1],r[2]+=o[s+2],a++),n=s}return a>1&&(0,l.g)(r,r,1/a),a>0}(this.vertexAttributes.get(oe.T.POSITION),t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(oe.T.POSITION),t=this.vertexAttributes.get(oe.T.POSITION);if(!e||0===e.length||!t)return null;const r=this.type===j.U.Mesh?3:1;(0,G.hu)(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=(0,U.KF)(e.length/r);return new W(i,r,e,t)}get transformation(){return this._transformation??s.I}set transformation(e){this._transformation=e&&e!==s.I?(0,s.b)(e):null}get shaderTransformation(){return null!=this._shaderTransformer?this._shaderTransformer(this.transformation):this.transformation}get shaderTransformer(){return this._shaderTransformer}set shaderTransformer(e){this._shaderTransformer=e}get hasVolatileTransformation(){return null!=this._shaderTransformer}addHighlight(){const e=new ie(B.V_.Highlight);return this.highlights=function(e,t){return null==e&&(e=[]),e.push(t),e}(this.highlights,e),e}removeHighlight(e){this.highlights=function(e,t){if(null==e)return null;const r=e.filter((e=>e!==t));return 0===r.length?null:r}(this.highlights,e)}}var ae=r(80442),se=r(32448),le=r(70586),ce=r(81271),ue=r(85958),de=r(99880);let he;var me,fe;(fe=me||(me={}))[fe.ETC1_RGB=0]="ETC1_RGB",fe[fe.ETC2_RGBA=1]="ETC2_RGBA",fe[fe.BC1_RGB=2]="BC1_RGB",fe[fe.BC3_RGBA=3]="BC3_RGBA",fe[fe.BC4_R=4]="BC4_R",fe[fe.BC5_RG=5]="BC5_RG",fe[fe.BC7_M6_RGB=6]="BC7_M6_RGB",fe[fe.BC7_M5_RGBA=7]="BC7_M5_RGBA",fe[fe.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",fe[fe.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",fe[fe.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",fe[fe.ATC_RGB=11]="ATC_RGB",fe[fe.ATC_RGBA=12]="ATC_RGBA",fe[fe.FXT1_RGB=17]="FXT1_RGB",fe[fe.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",fe[fe.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",fe[fe.ETC2_EAC_R11=20]="ETC2_EAC_R11",fe[fe.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",fe[fe.RGBA32=13]="RGBA32",fe[fe.RGB565=14]="RGB565",fe[fe.BGR565=15]="BGR565",fe[fe.RGBA4444=16]="RGBA4444";var pe=r(35371),ge=r(57088),ve=r(45762);let _e=null,Te=null;async function xe(){return null==Te&&(Te=function(){if(null==he){const e=e=>(0,de.V)(`esri/libs/basisu/${e}`);he=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return he}(),_e=await Te),Te}function be(e,t,r,i,o){const n=(0,ve.RG)(t?pe.q_.COMPRESSED_RGBA8_ETC2_EAC:pe.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function Ee(e){return e.getNumImages()>=1&&!e.isUASTC()}function Ae(e){return e.getFaces()>=1&&e.isETC1S()}function Se(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[u,d]=l?i?[me.ETC2_RGBA,pe.q_.COMPRESSED_RGBA8_ETC2_EAC]:[me.ETC1_RGB,pe.q_.COMPRESSED_RGB8_ETC2]:c?i?[me.BC3_RGBA,pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[me.BC1_RGB,pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[me.RGBA32,pe.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(a(e,u))),s(e,u,m[e]);return t.internalFormat=d,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.width=o,t.height=n,new ge.x(e,t,{type:"compressed",levels:m})}const we=I.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Re(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Ce=Re("DXT1"),ye=Re("DXT3"),Oe=Re("DXT5");var Me,Pe,Ie=r(47859);class Ne extends $.c{constructor(e,t){super(),this._data=e,this.type=j.U.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new se.Z,this.parameters=t||{},this.parameters.mipmap=!1!==this.parameters.mipmap,this.parameters.noUnpackFlip=this.parameters.noUnpackFlip||!1,this.parameters.preMultiplyAlpha=this.parameters.preMultiplyAlpha||!1,this.parameters.wrap=this.parameters.wrap||{s:pe.e8.REPEAT,t:pe.e8.REPEAT},this._startPreload(e)}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,ce.jc)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,ce.HK)(e.src)||(0,ce.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}dispose(){this._data=void 0}_createDescriptor(e){const t=new Ie.X;return t.wrapMode=this.parameters.wrap??pe.e8.REPEAT,t.flipped=!this.parameters.noUnpackFlip,t.samplingMode=this.parameters.mipmap?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.hasMipmap=!!this.parameters.mipmap,t.preMultiplyAlpha=!!this.parameters.preMultiplyAlpha,t.maxAnisotropy=this.parameters.maxAnisotropy??(this.parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.gpuMemoryUsage||function(e,t){if(null==e)return 0;if((0,d.eP)(e)||(0,d.lq)(e))return t.encoding===B.Ti.KTX2_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.KTX2File(new Uint8Array(e)),i=Ae(r)?be(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):t.encoding===B.Ti.BASIS_ENCODING?function(e,t){if(null==_e)return e.byteLength;const r=new _e.BasisFile(new Uint8Array(e)),i=Ee(r)?be(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?Le(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}(this._data,this.parameters)}load(e){if(null!=this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new ge.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,d.eP)(t)||(0,d.lq)(t))&&this.parameters.encoding===B.Ti.DDS_ENCODING?(this._data=void 0,this._loadFromDDSData(e,t)):((0,d.eP)(t)||(0,d.lq)(t))&&this.parameters.encoding===B.Ti.KTX2_ENCODING?(this._data=void 0,this._loadFromKTX2(e,t)):((0,d.eP)(t)||(0,d.lq)(t))&&this.parameters.encoding===B.Ti.BASIS_ENCODING?(this._data=void 0,this._loadFromBasis(e,t)):(0,d.lq)(t)?this._loadFromPixelData(e,t):(0,d.eP)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null}get requiresFrameUpdates(){return this._data instanceof HTMLVideoElement}frameUpdate(e){return this._data instanceof HTMLVideoElement&&null!=this._glTexture?this._data.readyState<Me.HAVE_CURRENT_DATA||e===this._data.currentTime?e:(this._glTexture.setData(this._data),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.parameters.updateCallback&&this.parameters.updateCallback(),this._data.currentTime):e}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return we.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return we.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case Ce:o=8,n=pe.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ye:o=16,n=pe.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Oe:o=16,n=pe.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return we.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(we.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,u=l;let d,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,d=new Uint8Array(e,m,h),f.push(d),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:c,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:n,width:a,height:s}=i;return t.samplingMode=o.levels.length>1?pe.cw.LINEAR_MIPMAP_LINEAR:pe.cw.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=n,t.width=a,t.height=s,new ge.x(e,t,o)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await xe());const i=new _e.KTX2File(new Uint8Array(r));if(!Ae(i))return null;i.startTranscoding();const o=Se(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),((e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==_e&&(_e=await xe());const i=new _e.BasisFile(new Uint8Array(r));if(!Ee(i))return null;i.startTranscoding();const o=Se(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),((e,t)=>i.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>i.transcodeImage(r,0,e,t,0,0)));return i.close(),i.delete(),o}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,G.hu)(this.parameters.width>0&&this.parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.parameters.components?pe.VI.LUMINANCE:3===this.parameters.components?pe.VI.RGB:pe.VI.RGBA,r.width=this.parameters.width??0,r.height=this.parameters.height??0,this._glTexture=new ge.x(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const i=await H(t,{signal:r});return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const i=await(0,ue.fY)(t,t.src,!1,r);return(0,L.k_)(r),this._loadFromImage(e,i)}))}_loadFromVideoElement(e,t){return t.readyState>=Me.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((i,o)=>{const n=()=>{t.removeEventListener("loadeddata",a),t.removeEventListener("error",s),(0,le.hw)(l)},a=()=>{t.readyState>=Me.HAVE_CURRENT_DATA&&(n(),i(this._loadFromImage(e,t)))},s=e=>{n(),o(e||new P.Z("Failed to load video"))};t.addEventListener("loadeddata",a),t.addEventListener("error",s);const l=(0,L.fu)(r,(()=>s((0,L.zE)())))}))))}_loadFromImage(e,t){const r=Le(t);this.parameters.width=r.width,this.parameters.height=r.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this.parameters.components?pe.VI.RGB:pe.VI.RGBA,i.width=r.width,i.height=r.height,this._glTexture=new ge.x(e,i,t),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=(0,le.M2)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function Le(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(Pe=Me||(Me={}))[Pe.HAVE_NOTHING=0]="HAVE_NOTHING",Pe[Pe.HAVE_METADATA=1]="HAVE_METADATA",Pe[Pe.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Pe[Pe.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Pe[Pe.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var De=r(64822),He=r(65576),Fe=r(55039),Be=r(60624),Ue=r(19419),ze=r(85504),Ve=r(60537),Ge=r(82791),We=r(93144),ke=r(27097);const $e=(0,ke.wK)(pe.zi.SRC_ALPHA,pe.zi.ONE,pe.zi.ONE_MINUS_SRC_ALPHA,pe.zi.ONE_MINUS_SRC_ALPHA),je=(0,ke.if)(pe.zi.ONE,pe.zi.ONE),qe=(0,ke.if)(pe.zi.ZERO,pe.zi.ONE_MINUS_SRC_ALPHA);function Xe(e){return e===We.A.FrontFace?null:e===We.A.Alpha?qe:je}const Ye={factor:-1,units:-2};function Je(e,t=pe.wb.LESS){return e===We.A.NONE||e===We.A.FrontFace?t:pe.wb.LEQUAL}var Ze,Ke;(Ke=Ze||(Ze={}))[Ke.INTEGRATED_MESH=0]="INTEGRATED_MESH",Ke[Ke.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",Ke[Ke.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",Ke[Ke.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",Ke[Ke.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",Ke[Ke.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",Ke[Ke.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",Ke[Ke.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",Ke[Ke.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",Ke[Ke.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",Ke[Ke.POSTPROCESSING_ENVIRONMENT_OPAQUE=10]="POSTPROCESSING_ENVIRONMENT_OPAQUE",Ke[Ke.POSTPROCESSING_ENVIRONMENT_TRANSPARENT=11]="POSTPROCESSING_ENVIRONMENT_TRANSPARENT",Ke[Ke.LASERLINES=12]="LASERLINES",Ke[Ke.LASERLINES_CONTRAST_CONTROL=13]="LASERLINES_CONTRAST_CONTROL",Ke[Ke.HUD_MATERIAL=14]="HUD_MATERIAL",Ke[Ke.LABEL_MATERIAL=15]="LABEL_MATERIAL",Ke[Ke.LINE_CALLOUTS=16]="LINE_CALLOUTS",Ke[Ke.LINE_CALLOUTS_HUD_DEPTH=17]="LINE_CALLOUTS_HUD_DEPTH",Ke[Ke.DRAPED_MATERIAL=18]="DRAPED_MATERIAL",Ke[Ke.DRAPED_WATER=19]="DRAPED_WATER",Ke[Ke.VOXEL=20]="VOXEL",Ke[Ke.MAX_SLOTS=21]="MAX_SLOTS";var Qe=r(51305),et=r(94961),tt=r(72119),rt=r(29268);const it=(0,c.c)(),ot=(0,c.c)(),nt=(0,c.c)(),at=new class{constructor(e=0){this.offset=e,this.sphere=(0,rt.c)(),this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._tmpVertex=(0,c.c)(),this._mbs=(0,rt.c)(),this._obb={center:(0,c.c)(),halfSize:(0,tt.c)(),quaternion:null},this._totalOffset=0,this._offset=0,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this._totalOffset/Math.sqrt(i*i+o*o+n*n);return this._tmpVertex[0]=e+i*a,this._tmpVertex[1]=t+o*a,this._tmpVertex[2]=r+n*a,this._tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=t*o<0?0:Math.min(Math.abs(t),Math.abs(o)),l=r*n<0?0:Math.min(Math.abs(r),Math.abs(n)),c=i*a<0?0:Math.min(Math.abs(i),Math.abs(a)),u=Math.sqrt(s*s+l*l+c*c);if(u<this._totalOffset)return e[0]-=t<0?this._totalOffset:0,e[1]-=r<0?this._totalOffset:0,e[2]-=i<0?this._totalOffset:0,e[3]+=o>0?this._totalOffset:0,e[4]+=n>0?this._totalOffset:0,e[5]+=a>0?this._totalOffset:0,e;const d=Math.max(Math.abs(t),Math.abs(o)),h=Math.max(Math.abs(r),Math.abs(n)),m=Math.max(Math.abs(i),Math.abs(a)),f=Math.sqrt(d*d+h*h+m*m),p=this._totalOffset/f,g=this._totalOffset/u;return e[0]+=t*(t>0?p:g),e[1]+=r*(r>0?p:g),e[2]+=i*(i>0?p:g),e[3]+=o*(o<0?p:g),e[4]+=n*(n<0?p:g),e[5]+=a*(a<0?p:g),e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this._totalOffset/t;return this._mbs[0]=e[0]+e[0]*r,this._mbs[1]=e[1]+e[1]*r,this._mbs[2]=e[2]+e[2]*r,this._mbs[3]=e[3]+e[3]*this._totalOffset/t,this._mbs}applyToObb(e){const t=e.center,r=this._totalOffset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this._obb.center[0]=t[0]+t[0]*r,this._obb.center[1]=t[1]+t[1]*r,this._obb.center[2]=t[2]+t[2]*r,(0,l.q)(this._obb.halfSize,e.halfSize,e.quaternion),(0,l.a)(this._obb.halfSize,this._obb.halfSize,e.center);const i=this._totalOffset/Math.sqrt(this._obb.halfSize[0]*this._obb.halfSize[0]+this._obb.halfSize[1]*this._obb.halfSize[1]+this._obb.halfSize[2]*this._obb.halfSize[2]);return this._obb.halfSize[0]+=this._obb.halfSize[0]*i,this._obb.halfSize[1]+=this._obb.halfSize[1]*i,this._obb.halfSize[2]+=this._obb.halfSize[2]*i,(0,l.b)(this._obb.halfSize,this._obb.halfSize,e.center),(0,Qe.c)(st,e.quaternion),(0,l.q)(this._obb.halfSize,this._obb.halfSize,st),this._obb.halfSize[0]*=this._obb.halfSize[0]<0?-1:1,this._obb.halfSize[1]*=this._obb.halfSize[1]<0?-1:1,this._obb.halfSize[2]*=this._obb.halfSize[2]<0?-1:1,this._obb.quaternion=e.quaternion,this._obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,c.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){for(let t=0;t<3;++t)it[t]=e[0+t]+this.localOrigin[t],ot[t]=e[3+t]+this.localOrigin[t],nt[t]=it[t];const t=this.applyToVertex(it[0],it[1],it[2]);for(let r=0;r<3;++r)e[r]=t[r],e[r+3]=t[r];const r=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let t=0;t<3;++t)nt[t]=0==(e&1<<t)?it[t]:ot[t];r(nt)}let i=0;for(let e=0;e<3;++e)it[e]*ot[e]<0&&(i|=1<<e);if(0!==i&&7!==i)for(let e=0;e<8;++e)if(0==(i&e)){for(let t=0;t<3;++t)nt[t]=0!=(i&1<<t)?0:0!=(e&1<<t)?it[t]:ot[t];r(nt)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const st=(0,et.a)();function lt(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function ct(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function ut(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}function dt(e,t,r,i,o=1){const n=t.typedBuffer,a=t.typedBufferStride;if(i*=a,1===o)for(let t=0;t<r;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a;else for(let t=0;t<r;++t)for(let t=0;t<o;++t)n[i]=e[0],n[i+1]=e[1],n[i+2]=e[2],n[i+3]=e[3],i+=a}function ht(e,t,r,i,o,n,s){switch(e){case oe.T.POSITION:{(0,G.hu)(3===t.size);const o=n.getField(e,m.ct);(0,G.hu)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,i,o,n=1){if(!r)return void ct(e,t,i,o,n);const s=i.typedBuffer,l=i.typedBufferStride,c=e.length,u=r[0],d=r[1],h=r[2],m=r[4],f=r[5],p=r[6],g=r[8],v=r[9],_=r[10],T=r[12],x=r[13],b=r[14];o*=l;let E=0,A=0,S=0;const w=(0,a.y)(r)?e=>{E=t[e]+T,A=t[e+1]+x,S=t[e+2]+b}:e=>{const r=t[e],i=t[e+1],o=t[e+2];E=u*r+m*i+g*o+T,A=d*r+f*i+v*o+x,S=h*r+p*i+_*o+b};if(1===n)for(let t=0;t<c;++t)w(3*e[t]),s[o]=E,s[o+1]=A,s[o+2]=S,o+=l;else for(let t=0;t<c;++t){w(3*e[t]);for(let e=0;e<n;++e)s[o]=E,s[o+1]=A,s[o+2]=S,o+=l}}(r,t.data,i,o,s);break}case oe.T.NORMAL:{(0,G.hu)(3===t.size);const i=n.getField(e,m.ct);(0,G.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void ct(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),b=1e-6,E=1-b;o*=c;let A=0,S=0,w=0;const R=(0,a.y)(s)?e=>{A=t[e],S=t[e+1],w=t[e+2]}:e=>{const r=t[e],i=t[e+1],o=t[e+2];A=d*r+f*i+v*o,S=h*r+p*i+_*o,w=m*r+g*i+T*o};if(1===n)if(x)for(let t=0;t<u;++t){R(3*e[t]);const r=A*A+S*S+w*w;if(r<E&&r>b){const e=1/Math.sqrt(r);l[o]=A*e,l[o+1]=S*e,l[o+2]=w*e}else l[o]=A,l[o+1]=S,l[o+2]=w;o+=c}else for(let t=0;t<u;++t)R(3*e[t]),l[o]=A,l[o+1]=S,l[o+2]=w,o+=c;else for(let t=0;t<u;++t){if(R(3*e[t]),x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}for(let e=0;e<n;++e)l[o]=A,l[o+1]=S,l[o+2]=w,o+=c}}(r,t.data,o,i,s);break}case oe.T.NORMALCOMPRESSED:{(0,G.hu)(2===t.size);const i=n.getField(e,m.or);(0,G.hu)(!!i,`No buffer view for ${e}`),i&<(r,t.data,i,s);break}case oe.T.UV0:{(0,G.hu)(2===t.size);const i=n.getField(e,m.Eu);(0,G.hu)(!!i,`No buffer view for ${e}`),i&<(r,t.data,i,s);break}case oe.T.COLOR:case oe.T.SYMBOLCOLOR:{const i=n.getField(e,m.mc);(0,G.hu)(!!i,`No buffer view for ${e}`),(0,G.hu)(3===t.size||4===t.size),!i||3!==t.size&&4!==t.size||function(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,r!==t.length||4!==r)if(1!==n)if(4!==r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}else for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else{if(4===r){for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}return}for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else{a[o]=t[0],a[o+1]=t[1],a[o+2]=t[2],a[o+3]=t[3];const e=new Uint32Array(i.typedBuffer.buffer,i.start),r=s/4,c=e[o/=4];o+=r;const u=l*n;for(let t=1;t<u;++t)e[o]=c,o+=r}}(r,t.data,t.size,i,s);break}case oe.T.COLORFEATUREATTRIBUTE:{const i=n.getField(e,m.ly);(0,G.hu)(!!i,`No buffer view for ${e}`),(0,G.hu)(1===t.size),i&&1===t.size&&function(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length,s=t[0];i*=n;for(let e=0;e<a;++e)o[i]=s,i+=n}(r,t.data,i,s);break}case oe.T.TANGENT:{(0,G.hu)(4===t.size);const i=n.getField(e,m.ek);(0,G.hu)(!!i,`No buffer view for ${e}`),i&&function(e,t,r,i,o,n=1){if(!r)return void ut(e,t,i,o,n);const s=r,l=i.typedBuffer,c=i.typedBufferStride,u=e.length,d=s[0],h=s[1],m=s[2],f=s[4],p=s[5],g=s[6],v=s[8],_=s[9],T=s[10],x=!(0,a.z)(s),b=1e-6,E=1-b;if(o*=c,1===n)for(let r=0;r<u;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],u=t[i+3];let A=d*n+f*a+v*s,S=h*n+p*a+_*s,w=m*n+g*a+T*s;if(x){const e=A*A+S*S+w*w;if(e<E&&e>b){const t=1/Math.sqrt(e);A*=t,S*=t,w*=t}}l[o]=A,l[o+1]=S,l[o+2]=w,l[o+3]=u,o+=c}else for(let r=0;r<u;++r){const i=4*e[r],a=t[i],s=t[i+1],u=t[i+2],A=t[i+3];let S=d*a+f*s+v*u,w=h*a+p*s+_*u,R=m*a+g*s+T*u;if(x){const e=S*S+w*w+R*R;if(e<E&&e>b){const t=1/Math.sqrt(e);S*=t,w*=t,R*=t}}for(let e=0;e<n;++e)l[o]=S,l[o+1]=w,l[o+2]=R,l[o+3]=A,o+=c}}(r,t.data,o,i,s);break}case oe.T.PROFILERIGHT:case oe.T.PROFILEUP:case oe.T.PROFILEVERTEXANDNORMAL:case oe.T.FEATUREVALUE:{(0,G.hu)(4===t.size);const i=n.getField(e,m.ek);(0,G.hu)(!!i,`No buffer view for ${e}`),i&&ut(r,t.data,i,s)}}}class mt{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.indices.get(oe.T.POSITION).length}write(e,t,r,i,o){!function(e,t,r,i,o,n){for(const a of t.fields.keys()){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)ht(a,t,s,r,i,o,n);else if(a===oe.T.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.indices.get(oe.T.POSITION);if((0,G.hu)(!!t,`No buffer view for ${a}`),t){const r=t.length,i=o.getField(a,m.mc);dt(e.objectAndLayerIdColor,i,r,n)}}}}(r,this.vertexBufferLayout,e,t,i,o)}}var ft=r(57790),pt=r(88669),gt=r(135),vt=r(15719),_t=r(96310),Tt=r(78869),xt=r(14589),bt=r(83475),Et=r(59377);pe.wb.LESS,pe.wb.ALWAYS;const At={mask:255},St={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.ZERO}},wt={function:{func:pe.wb.ALWAYS,ref:B.hU.OutlineVisualElementMask,mask:B.hU.OutlineVisualElementMask},operation:{fail:pe.xS.KEEP,zFail:pe.xS.KEEP,zPass:pe.xS.REPLACE}};pe.wb.EQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP,pe.wb.NOTEQUAL,B.hU.OutlineVisualElementMask,B.hU.OutlineVisualElementMask,pe.xS.KEEP,pe.xS.KEEP,pe.xS.KEEP;const Rt=[1,1,.5],Ct=[0,.6,.2],yt=[0,1,.2];var Ot=r(32078);class Mt extends vt.d4{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,c.g)(Rt),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=B.Vr.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,c.f)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Be.r.Attribute,this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,c.f)(.2,.2,.2),this.diffuse=(0,c.f)(.8,.8,.8),this.externalColor=(0,pt.f)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,c.c)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=B.Gv.Less,this.textureAlphaMode=B.JJ.Blend,this.textureAlphaCutoff=_t.F,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ge.yD.Occlude}}class Pt extends xt.A{initializeConfiguration(e,t){t.spherical=e.viewingMode===De.JY.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?gt.N.Default:gt.N.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Pt.shader)}_initializeProgram(e,t){return new Et.$(e.rctx,t.get().build(this.configuration),bt.i)}_convertDepthTestFunction(e){return e===B.Gv.Lequal?pe.wb.LEQUAL:pe.wb.LESS}_makePipeline(e,t){const r=this.configuration,i=e===We.A.NONE,o=e===We.A.FrontFace;return(0,ke.sm)({blending:r.output!==Fe.H.Color&&r.output!==Fe.H.Alpha||!r.transparent?null:i?$e:Xe(e),culling:It(r)?(0,ke.zp)(r.cullFace):null,depthTest:{func:Je(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(i||o)&&r.writeDepth?ke.LZ:null,colorWrite:ke.BK,stencilWrite:r.hasOccludees?At:null,stencilTest:r.hasOccludees?t?wt:St:null,polygonOffset:i||o?null:(n=r.enableOffset,n?Ye:null)});var n}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function It(e){return e.cullFace!==B.Vr.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Pt.shader=new Tt.J(Ot.D,(()=>r.e(9291).then(r.bind(r,79291))));var Nt=r(43697),Lt=r(51354),Dt=r(67498);class Ht extends Lt.m{}(0,Nt._)([(0,Lt.o)({constValue:!0})],Ht.prototype,"hasSliceHighlight",void 0),(0,Nt._)([(0,Lt.o)({constValue:!1})],Ht.prototype,"hasSliceInVertexProgram",void 0),(0,Nt._)([(0,Lt.o)({constValue:!1})],Ht.prototype,"instancedDoublePrecision",void 0),(0,Nt._)([(0,Lt.o)({constValue:!1})],Ht.prototype,"hasModelTransformation",void 0),(0,Nt._)([(0,Lt.o)({constValue:Dt.P.Pass})],Ht.prototype,"pbrTextureBindType",void 0);class Ft extends Ht{constructor(){super(...arguments),this.output=Fe.H.Color,this.alphaDiscardMode=B.JJ.Opaque,this.doubleSidedMode=Ue.q.None,this.pbrMode=ze.f7.Disabled,this.cullFace=B.Vr.None,this.transparencyPassType=We.A.NONE,this.normalType=Be.r.Attribute,this.textureCoordinateType=gt.N.None,this.customDepthTest=B.Gv.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,Nt._)([(0,Lt.o)({count:Fe.H.COUNT})],Ft.prototype,"output",void 0),(0,Nt._)([(0,Lt.o)({count:B.JJ.COUNT})],Ft.prototype,"alphaDiscardMode",void 0),(0,Nt._)([(0,Lt.o)({count:Ue.q.COUNT})],Ft.prototype,"doubleSidedMode",void 0),(0,Nt._)([(0,Lt.o)({count:ze.f7.COUNT})],Ft.prototype,"pbrMode",void 0),(0,Nt._)([(0,Lt.o)({count:B.Vr.COUNT})],Ft.prototype,"cullFace",void 0),(0,Nt._)([(0,Lt.o)({count:We.A.COUNT})],Ft.prototype,"transparencyPassType",void 0),(0,Nt._)([(0,Lt.o)({count:Be.r.COUNT})],Ft.prototype,"normalType",void 0),(0,Nt._)([(0,Lt.o)({count:gt.N.COUNT})],Ft.prototype,"textureCoordinateType",void 0),(0,Nt._)([(0,Lt.o)({count:B.Gv.COUNT})],Ft.prototype,"customDepthTest",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"spherical",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasVertexColors",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasSymbolColors",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasVerticalOffset",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasSlicePlane",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasSliceHighlight",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasColorTexture",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasMetallicRoughnessTexture",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasEmissionTexture",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasOcclusionTexture",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasNormalTexture",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasScreenSizePerspective",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasVertexTangents",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasOccludees",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasMultipassTerrain",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasModelTransformation",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"offsetBackfaces",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"vvSize",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"vvColor",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"receiveShadows",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"receiveAmbientOcclusion",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"textureAlphaPremultiplied",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"instanced",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"instancedColor",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"objectAndLayerIdColorInstanced",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"instancedDoublePrecision",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"writeDepth",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"transparent",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"enableOffset",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"cullAboveGround",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"snowCover",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasColorTextureTransform",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasEmissionTextureTransform",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasNormalTextureTransform",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasOcclusionTextureTransform",void 0),(0,Nt._)([(0,Lt.o)()],Ft.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,Nt._)([(0,Lt.o)({constValue:!0})],Ft.prototype,"hasVvInstancing",void 0),(0,Nt._)([(0,Lt.o)({constValue:!1})],Ft.prototype,"useCustomDTRExponentForWater",void 0),(0,Nt._)([(0,Lt.o)({constValue:!1})],Ft.prototype,"supportsTextureAtlas",void 0),(0,Nt._)([(0,Lt.o)({constValue:!0})],Ft.prototype,"useFillLights",void 0);var Bt=r(41846);class Ut extends Pt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Be.r.Attribute,t.doubleSidedMode=Ue.q.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,Ut.shader)}}Ut.shader=new Tt.J(Bt.R,(()=>r.e(8096).then(r.bind(r,38096))));class zt extends Ge.F5{constructor(e){super(e,Gt),this.supportsEdges=!0,this._configuration=new Ft,this._vertexBufferLayout=function(e){const t=(0,He.U$)().vec3f(oe.T.POSITION);return e.normalType===Be.r.Compressed?t.vec2i16(oe.T.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(oe.T.NORMAL),e.hasVertexTangents&&t.vec4f(oe.T.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(oe.T.UV0),e.hasVertexColors&&t.vec4u8(oe.T.COLOR),e.hasSymbolColors&&t.vec4u8(oe.T.SYMBOLCOLOR),(0,ae.Z)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(oe.T.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==Fe.H.Shadow&&e!==Fe.H.ShadowExcludeHighlight&&e!==Fe.H.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:i,vvColor:o}=e,n="replace"===e.colorMixMode,a=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||o||i;return r&&l?n||a:r?n?s:a:l?n||a:n?s:a}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?B.Vr.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=t.multipassTerrain.enabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e!==Fe.H.Color&&e!==Fe.H.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ue.q.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ue.q.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ue.q.WindingOrder:Ue.q.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!t.ssaoHelper.active&&this.parameters.receiveSSAO,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?ze.f7.Schematic:ze.f7.Normal:ze.f7.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,i,o,n){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,l.s)(Xt,t[12],t[13],t[14]);let n=null;switch(r.viewingMode){case De.JY.Global:n=(0,l.n)(jt,Xt);break;case De.JY.Local:n=(0,l.c)(jt,$t)}let a=0;const s=(0,l.b)(Yt,Xt,e.eye),c=(0,l.l)(s),u=(0,l.g)(s,s,1/c);let d=null;this.parameters.screenSizePerspective&&(d=(0,l.e)(n,u)),a+=(0,ft.Hx)(e,c,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective),(0,l.g)(n,n,a),(0,l.t)(qt,n,r.transform.inverseRotation),i=(0,l.b)(Wt,i,qt),o=(0,l.b)(kt,o,qt)}(0,ft.Bw)(e,r,i,o,function(e){return null!=e?(at.offset=e,at):null}(r.verticalOffset),n)}requiresSlot(e,t){return!(t!==Fe.H.Color&&t!==Fe.H.Alpha&&t!==Fe.H.Depth&&t!==Fe.H.Normal&&t!==Fe.H.Shadow&&t!==Fe.H.ShadowHighlight&&t!==Fe.H.ShadowExcludeHighlight&&t!==Fe.H.Highlight&&t!==Fe.H.ObjectAndLayerIdColor||e!==(this.parameters.transparent?this.parameters.writeDepth?Ze.TRANSPARENT_MATERIAL:Ze.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Ze.OPAQUE_MATERIAL)&&e!==Ze.DRAPED_MATERIAL)}createGLMaterial(e){return new Vt(e)}createBufferWriter(){return new mt(this._vertexBufferLayout)}}class Vt extends Ve.F{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output!==Fe.H.Color&&this._output!==Fe.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,l.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?Ut:Pt,e)}}const Gt=new class extends Mt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Wt=(0,c.c)(),kt=(0,c.c)(),$t=(0,c.f)(0,0,1),jt=(0,c.c)(),qt=(0,c.c)(),Xt=(0,c.c)(),Yt=(0,c.c)(),Jt=I.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Zt(e){throw new P.Z("",`Request for object resource failed: ${e}`)}function Kt(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Jt.warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Jt.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Jt.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Jt.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Jt.warn("Indexed geometries must specify faces"),i=!1;break}default:Jt.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Jt.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Jt.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Qt(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,u.pp)(t,r.bbMin),(0,u.pp)(t,r.bbMax))})),t}function er(e){switch(e){case"mask":return B.JJ.Mask;case"maskAndTransparency":return B.JJ.MaskBlend;case"none":return B.JJ.Opaque;default:return B.JJ.Blend}}function tr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const rr=new D.G(1,2,"wosr");var ir=r(57758);async function or(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=null!=t&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,O.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,L.r9)(i.error),Zt(i.error.details.url)}(e,r,t);const i=await(0,O.q6)((0,y.default)(e,t));if(!0===i.ok)return i.value.data;(0,L.r9)(i.error),Zt(i.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const o=e[i],n=o.images[0].data;if(!n){Jt.warn("Externally referenced texture data is not yet supported");continue}const a=o.encoding+";base64,"+n,s="/textureDefinitions/"+i,l="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:pe.e8.REPEAT,t:pe.e8.REPEAT},preMultiplyAlpha:er(l)!==B.JJ.Opaque},u=null!=t&&t.disableTextures?Promise.resolve(null):H(a,t);r.push(u.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const i=await Promise.all(r),o={};for(const e of i)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];o+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:i,size:o+(0,M.Ul)(r)}}(r.url,t)),{engineResources:i,referenceBoundingBox:o}=function(e,t){const r=new Array,i=new Array,o=new Array,n=new N,a=e.resource,s=D.G.parse(a.version||"1.0","wosr");rr.validate(s);const l=a.model.name,u=a.model.geometries,d=a.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<u.length;e++){const a=u[e];if(!Kt(a))continue;const s=tr(a),l=a.params.vertexAttributes,p=[];for(const e in l){const t=l[e],r=t.values;p.push([e,new F.a(r,t.valuesPerElement,!0)])}const g=[];if("PerAttributeArray"!==a.params.topology){const e=a.params.faces;for(const t in e)g.push([t,e[t].values])}const v=s.texture,_=h&&h[v];if(_&&!f.has(v)){const{image:e,parameters:t}=_,r=new Ne(e,t);i.push(r),f.set(v,r)}const T=f.get(v),x=T?T.id:void 0,b=s.material;let E=n.get(b,v);if(null==E){const e=d[b.substring(b.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,o=_?er(_.alphaChannelUsage):void 0,a={ambient:(0,c.g)(e.diffuse),diffuse:(0,c.g)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:o,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:B.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:_?.parameters.preMultiplyAlpha??!1};null!=t&&t.materialParamsMixin&&Object.assign(a,t.materialParamsMixin),E=new zt(a),n.set(b,v,E)}o.push(E);const A=new ne(E,p,g);m+=g.find((e=>e[0]===oe.T.POSITION))?.[1].length??0,r.push(A)}return{engineResources:[{name:l,stageResources:{textures:i,materials:o,geometries:r},pivotOffset:a.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:Qt(r)}}(e,t);return{lods:i,referenceBoundingBox:o,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,x.Q)(new T.C(t.streamDataRequester),r.url,t,t.usePBR)),d=n.model.meta?.ESRI_proxyEllipsoid,A=n.meta.isEsriSymbolResource&&null!=d&&n.meta.uri.includes("/RealisticTrees/");A&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];for(const o of i.parts){const i=o.attributes.normal;if(null==i)return;const n=o.attributes.position,u=n.count,d=(0,c.c)(),h=(0,c.c)(),f=(0,c.c)(),p=new Uint8Array(4*u),g=new Float64Array(3*u),v=(0,a.a)((0,s.c)(),o.transform);let _=0,T=0;for(let a=0;a<u;a++){n.getVec(a,h),i.getVec(a,d),(0,l.m)(h,h,o.transform),(0,l.b)(f,h,t.center),(0,l.D)(f,f,t.radius);const s=f[2],c=(0,l.l)(f),u=Math.min(.45+.55*c*c,1);(0,l.D)(f,f,t.radius),null!==v&&(0,l.m)(f,f,v),(0,l.n)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,l.h)(f,f,d,s>-1?.2:Math.min(-4*s-3.8,1)),g[_]=f[0],g[_+1]=f[1],g[_+2]=f[2],_+=3,p[T]=255*u,p[T+1]=255*u,p[T+2]=255*u,p[T+3]=255,T+=4}o.attributes.normal=new m.ct(g),o.attributes.color=new m.mc(p)}}}(n,d));const S=!!t.usePBR,R=n.meta.isEsriSymbolResource?{usePBR:S,isSchematic:!1,treeRendering:A,mrrFactors:[...yt]}:{usePBR:S,isSchematic:!1,treeRendering:!1,mrrFactors:[...Rt]},P={...t.materialParamsMixin,treeRendering:A},{engineResources:I,referenceBoundingBox:U}=function(e,t,r,i){const n=e.model,a=new Array,s=new Map,d=new Map,T=n.lods.length,x=(0,u.cS)();return n.lods.forEach(((e,A)=>{const S=!0===i.skipHighLods&&(T>1&&0===A||T>3&&1===A)||!1===i.skipHighLods&&null!=i.singleLodIndex&&A!==i.singleLodIndex;if(S&&0!==A)return;const R=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const i=S?new zt({}):function(e,t,r,i,o,n,a){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),u=e.materials.get(t.material),d=null!=t.attributes.texCoord0,h=null!=t.attributes.normal;if(null==u)return null;const m=function(e){switch(e){case"BLEND":return B.JJ.Blend;case"MASK":return B.JJ.Mask;case"OPAQUE":case null:case void 0:return B.JJ.Opaque}}(u.alphaMode);if(!n.has(s)){if(d){const t=(t,r=!1)=>{if(null!=t&&!a.has(t)){const i=e.textures.get(t);if(null!=i){const e=i.data;a.set(t,new Ne((0,E.$A)(e)?e.data:e,{...i.parameters,preMultiplyAlpha:!(0,E.$A)(e)&&r,encoding:(0,E.$A)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(u.textureColor,m!==B.JJ.Opaque),t(u.textureNormal),t(u.textureOcclusion),t(u.textureEmissive),t(u.textureMetallicRoughness)}const r=u.color[0]**(1/ir.K),f=u.color[1]**(1/ir.K),p=u.color[2]**(1/ir.K),g=u.emissiveFactor[0]**(1/ir.K),v=u.emissiveFactor[1]**(1/ir.K),_=u.emissiveFactor[2]**(1/ir.K),T=null!=u.textureColor&&d?a.get(u.textureColor):null,x=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:i,emissiveTexture:o,emissiveFactor:n,occlusionTexture:a}){return null==e&&null==t&&null==o&&(null==n||(0,l.k)(n,c.Z))&&null==a&&(null==i||1===i)&&(null==r||1===r||0===r)}({normalTexture:u.textureNormal,metallicRoughnessTexture:u.textureMetallicRoughness,metallicFactor:u.metallicFactor,roughnessFactor:u.roughnessFactor,emissiveTexture:u.textureEmissive,emissiveFactor:u.emissiveFactor,occlusionTexture:u.textureOcclusion});n.set(s,new zt({...i,transparent:m===B.JJ.Blend,customDepthTest:B.Gv.Lequal,textureAlphaMode:m,textureAlphaCutoff:u.alphaCutoff,diffuse:[r,f,p],ambient:[r,f,p],opacity:u.opacity,doubleSided:u.doubleSided,doubleSidedType:"winding-order",cullFace:u.doubleSided?B.Vr.None:B.Vr.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:h?Be.r.Attribute:Be.r.ScreenDerivative,castShadows:!0,receiveSSAO:!0,textureId:null!=T?T.id:void 0,colorMixMode:u.colorMixMode,normalTextureId:null!=u.textureNormal&&d?a.get(u.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=u.textureOcclusion&&d?a.get(u.textureOcclusion).id:void 0,emissiveTextureId:null!=u.textureEmissive&&d?a.get(u.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=u.textureMetallicRoughness&&d?a.get(u.textureMetallicRoughness).id:void 0,emissiveFactor:[g,v,_],mrrFactors:x?[...Ct]:[u.metallicFactor,u.roughnessFactor,i.mrrFactors[2]],isSchematic:x,colorTextureTransformMatrix:w(u.colorTextureTransform),normalTextureTransformMatrix:w(u.normalTextureTransform),occlusionTextureTransformMatrix:w(u.occlusionTextureTransform),emissiveTextureTransformMatrix:w(u.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:w(u.metallicRoughnessTextureTransform),...o}))}const f=n.get(s);if(r.stageResources.materials.push(f),d){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(u.textureColor),e(u.textureNormal),e(u.textureOcclusion),e(u.textureEmissive),e(u.textureMetallicRoughness)}return f}(n,e,R,t,r,s,d),{geometry:a,vertexCount:T}=function(e,t){const r=e.attributes.position.count,i=(0,b.p)(e.indices||r,e.primitiveType),n=h(3*r),{typedBuffer:a,typedBufferStride:s}=e.attributes.position;(0,f.t)(n,a,e.transform,3,s);const l=[[oe.T.POSITION,new F.a(n,3,!0)]],c=[[oe.T.POSITION,i]];if(null!=e.attributes.normal){const t=h(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,o.b)(nr,e.transform),(0,f.a)(t,n,nr,3,a),l.push([oe.T.NORMAL,new F.a(t,3,!0)]),c.push([oe.T.NORMAL,i])}if(null!=e.attributes.tangent){const t=h(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,o.b)(nr,e.transform),(0,p.t)(t,n,nr,4,a),l.push([oe.T.TANGENT,new F.a(t,4,!0)]),c.push([oe.T.TANGENT,i])}if(null!=e.attributes.texCoord0){const t=h(2*r),{typedBuffer:o,typedBufferStride:n}=e.attributes.texCoord0;(0,g.n)(t,o,2,n),l.push([oe.T.UV0,new F.a(t,2,!0)]),c.push([oe.T.UV0,i])}if(null!=e.attributes.color){const t=new Uint8Array(4*r);4===e.attributes.color.elementCount?e.attributes.color instanceof m.ek?(0,p.s)(t,e.attributes.color,255):e.attributes.color instanceof m.mc?(0,_.c)(t,e.attributes.color):e.attributes.color instanceof m.v6&&(0,p.s)(t,e.attributes.color,1/256):(t.fill(255),e.attributes.color instanceof m.ct?(0,f.s)(t,e.attributes.color,255,4):e.attributes.color instanceof m.ne?(0,v.c)(t,e.attributes.color.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof m.mw&&(0,f.s)(t,e.attributes.color,1/256,4)),l.push([oe.T.COLOR,new F.a(t,4,!0)]),c.push([oe.T.COLOR,i])}return{geometry:new ne(t,l,c),vertexCount:r}}(e,null!=i?i:new zt({})),C=a.boundingInfo;null!=C&&0===A&&((0,u.pp)(x,C.bbMin),(0,u.pp)(x,C.bbMax)),null!=i&&(R.stageResources.geometries.push(a),R.numberOfVertices+=T)})),S||a.push(R)})),{engineResources:a,referenceBoundingBox:x}}(n,R,P,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:I,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const nr=(0,n.c)()},1391:(e,t,r)=>{r.d(t,{Zu:()=>l,bA:()=>c,qj:()=>u});var i=r(55039),o=r(2095),n=r(19693),a=r(74709);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new n.A("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(a.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
286
286
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
287
287
|
}`)}function u(e,t){const{vertex:r}=e;switch(t.output){case i.H.Color:if(t.receiveShadows)return s(e),void r.code.add(a.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case i.H.Depth:case i.H.Shadow:case i.H.ShadowHighlight:case i.H.ShadowExcludeHighlight:return e.include(o.up,t),s(e),l(e),c(e),void r.code.add(a.H`void forwardLinearDepth() {
|
|
288
288
|
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3919],{13598:(e,t,r)=>{function s(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(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]]}function n(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>i,a:()=>n,b:()=>a,c:()=>s});const i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:a,create:s,createView:n,fromValues:function(e,t,r,s,a,n,i,o,u,l,d,c,p,h,y,f){return[e,t,r,s,a,n,i,o,u,l,d,c,p,h,y,f]}},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>i,c:()=>a,d:()=>d,e:()=>u,n:()=>c,s:()=>l,t:()=>n});var s=r(72220);function a(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,a=3,n=a){if(e.length/a!==Math.ceil(t.length/n))return s.c.error("source and destination buffers need to have the same number of elements"),e;const i=e.length/a,o=r[0],u=r[1],l=r[2],d=r[4],c=r[5],p=r[6],h=r[8],y=r[9],f=r[10],m=r[12],g=r[13],b=r[14];let F=0,w=0;for(let r=0;r<i;r++){const r=t[F],s=t[F+1],i=t[F+2];e[w]=o*r+d*s+h*i+m,e[w+1]=u*r+c*s+y*i+g,e[w+2]=l*r+p*s+f*i+b,F+=n,w+=a}return e}function i(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,a=3,n=a){if(e.length/a!==Math.ceil(t.length/n))return void s.c.error("source and destination buffers need to have the same number of elements");const i=e.length/a,o=r[0],u=r[1],l=r[2],d=r[3],c=r[4],p=r[5],h=r[6],y=r[7],f=r[8];let m=0,g=0;for(let r=0;r<i;r++){const r=t[m],s=t[m+1],i=t[m+2];e[g]=o*r+d*s+h*i,e[g+1]=u*r+c*s+y*i,e[g+2]=l*r+p*s+f*i,m+=n,g+=a}}function u(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,s=3){const a=Math.min(e.length/s,t.count),n=t.typedBuffer,i=t.typedBufferStride;let o=0,u=0;for(let t=0;t<a;t++)e[u]=r*n[o],e[u+1]=r*n[o+1],e[u+2]=r*n[o+2],o+=i,u+=s}function d(e,t){c(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function c(e,t,r=3,s=r){const a=Math.min(e.length/r,t.length/s);let n=0,i=0;for(let o=0;o<a;o++){const a=t[n],o=t[n+1],u=t[n+2],l=a*a+o*o+u*u;if(l>0){const t=1/Math.sqrt(l);e[i]=t*a,e[i+1]=t*o,e[i+2]=t*u}n+=s,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:c,normalizeView:d,scale:l,scaleView:u,shiftRight:function(e,t,r){const s=Math.min(e.count,t.count),a=e.typedBuffer,n=e.typedBufferStride,i=t.typedBuffer,o=t.typedBufferStride;let u=0,l=0;for(let e=0;e<s;e++)a[l]=i[u]>>r,a[l+1]=i[u+1]>>r,a[l+2]=i[u+2]>>r,u+=o,l+=n},transformMat3:o,transformMat3View:i,transformMat4:n,transformMat4View:a},Symbol.toStringTag,{value:"Module"}))},41123:(e,t,r)=>{r.d(t,{D:()=>a,z:()=>n});const s="randomUUID"in crypto;function a(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const 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`{${a()}}`}},85872:(e,t,r)=>{r.d(t,{Z:()=>p});var s=r(43697),a=r(2368),n=r(96674),i=r(5600),o=(r(75215),r(67676),r(80442),r(36030)),u=r(52011),l=r(65617),d=r(94139);let c=class extends((0,a.J)(n.wq)){constructor(e){super(e),this.type="georeferenced-relative",this.isRelative=!0,this.isGeoreferenced=!0,this.origin=(0,l.c)()}getOriginPoint(e){const[t,r,s]=this.origin;return new d.Z({x:t,y:r,z:s,spatialReference:e})}setOriginFormPoint({x:e,y:t,z:r}){this.origin=(0,l.f)(e,t,r??0)}};(0,s._)([(0,o.J)({georeferencedRelative:"georeferenced-relative"},{readOnly:!0})],c.prototype,"type",void 0),(0,s._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,s._)([(0,u.j)("esri.geometry.support.MeshGeoreferencedRelativeVertexSpace")],c);const p=c},72220:(e,t,r)=>{r.d(t,{c:()=>s});const s=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},84470:(e,t,r)=>{r.d(t,{CP:()=>o,JG:()=>y,LL:()=>u,NZ:()=>l,fV:()=>f,vj:()=>g,yT:()=>F,zE:()=>b});var s=r(3172),a=r(67676),n=r(95330),i=r(2981);class o{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,a.fS)(this.parts,e.parts,((e,t)=>e.equals(t)))}isOnService(e){return this.parts.every((t=>t.isOnService(e)))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const r=await Promise.all(t.map((t=>t.toBlob(e))));return(0,n.k_)(e),new Blob(r)}}class u{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,s.default)(this.partUrl,{responseType:"blob"});return(0,n.k_)(e),t}}function l(e){return function(e){return!!e&&(Array.isArray(e)?e.some(h):h(e))}(e?.source)}function d(e){return!!Array.isArray(e)&&e.every((e=>e instanceof o))}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,p=/\.(gltf|glb)/i;function h(e){if(e instanceof File){const{type:t,name:r}=e;return c.test(t)||p.test(r)}return c.test(e.assetMimeType)||p.test(e.assetName)}function y(e,t){if(!e)return!1;const{source:r}=e;return function(e,t){return Array.isArray(e)?e.every((e=>m(e,t))):m(e,t)}(r,t)}function f(e,t){if(e===t)return!0;const{source:r}=e,{source:s}=t;if(r===s)return!0;if(d(r)&&d(s)){if(r.length!==s.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...r].sort(e),a=[...s].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(a[e]))return!1;return!0}return!1}function m(e,t){return e instanceof o&&e.isOnService(t)}function g(e,t){return e instanceof File?(0,i.Ow)(e.name,t)??(0,i.S0)(e.type,t):(0,i.S0)(e.assetMimeType,t)??(0,i.Ow)(e.assetName,t)}function b(e){return Array.isArray(e)?e:[e]}function F(e){return!!e.original}},61159:(e,t,r)=>{r.d(t,{g:()=>s});const s={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},14720:(e,t,r)=>{r.d(t,{Ey:()=>b,applyEdits:()=>F,aw:()=>m,uploadAssets:()=>O});var s=r(38171),a=r(46791),n=r(20102),i=r(22974),o=r(92604),u=r(95330),l=r(81271),d=r(16306),c=r(66361),p=r(2981),h=r(84230);function y(e){return e&&null!=e.applyEdits}function f(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function m(e){return e.every(f)}function g(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function b(e){return e.every(g)}async function F(e,t,r,s={}){let l;if((0,c.lQ)(e)&&e.url)l=(0,c.jF)(e.url,e.layerId,"original-and-current-features"===s.returnServiceEditsOption);else{l=(0,u.hh)(),l.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:l.promise};e.emit("apply-edits",t)}try{const{results:u,edits:d}=await async function(e,t,r,s){if(await e.load(),!y(t))throw new n.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!(0,h.ln)(e))throw new n.Z(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:u}=await async function(e,t,r){const s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),i=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),u=null!=e.infoFor3D;if(!t||!s&&!i)throw new n.Z(`${e.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const l=(0,h.S1)(e);if(!l.data.isVersioned&&r?.gdbVersion)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!l.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!l.editing.supportsGlobalId&&r?.globalIdUsed)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!l.editing.supportsGlobalId&&i)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new n.Z(`${e.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const d={...r};if(null!=d.rollbackOnFailureEnabled||l.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||"original-and-current-features"!==d.returnServiceEditsOption||(!1===d.rollbackOnFailureEnabled&&o.Z.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),d.rollbackOnFailureEnabled=!0),!l.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&"original-and-current-features"!==d.returnServiceEditsOption)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const c={...t};if(c.addFeatures=t&&a.Z.isCollection(t.addFeatures)?t.addFeatures.toArray():c.addFeatures||[],c.updateFeatures=t&&a.Z.isCollection(t.updateFeatures)?t.updateFeatures.toArray():c.updateFeatures||[],c.deleteFeatures=t&&a.Z.isCollection(t.deleteFeatures)?t.deleteFeatures.toArray():c.deleteFeatures||[],c.addFeatures.length&&!l.operations.supportsAdd)throw new n.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(c.updateFeatures.length&&!l.operations.supportsUpdate)throw new n.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(c.deleteFeatures.length&&!l.operations.supportsDelete)throw new n.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support deleting features.");c.addAttachments=c.addAttachments||[],c.updateAttachments=c.updateAttachments||[],c.deleteAttachments=c.deleteAttachments||[],c.addFeatures=c.addFeatures.map(A),c.updateFeatures=c.updateFeatures.map(A),c.addAssetFeatures=[];const y=r?.globalIdUsed||u;return c.addFeatures.forEach((t=>function(e,t,r){w(e,t,r),S(e,t)}(t,e,y))),c.updateFeatures.forEach((t=>function(e,t,r){w(e,t,r),S(e,t);const s=(0,h.S1)(t);if("geometry"in e&&null!=e.geometry&&!s?.editing.supportsGeometryUpdate)throw new n.Z(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,y))),c.deleteFeatures.forEach((t=>function(e,t,r){w(e,t,r)}(t,e,y))),c.addAttachments.forEach((t=>_(t,e))),c.updateAttachments.forEach((t=>_(t,e))),u&&await async function(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,s=(0,p.S0)("model/gltf-binary",r.supportedFormats)??(0,p.Ow)("glb",r.supportedFormats);if(!s||!r.editFormats.includes(s))throw new n.Z(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const t of e.addFeatures??[])v(t)&&a.push(t);for(const t of e.updateFeatures??[])v(t)&&a.push(t)}(c,e),{edits:await R(c),options:d}}(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,u)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,r,s),c=e=>e.filter((e=>!e.error)).map(i.d9),f={edits:d,addedFeatures:c(u.addFeatureResults),updatedFeatures:c(u.updateFeatureResults),deletedFeatures:c(u.deleteFeatureResults),addedAttachments:c(u.addAttachmentResults),updatedAttachments:c(u.updateAttachmentResults),deletedAttachments:c(u.deleteAttachmentResults),exceededTransferLimit:!1};return u.editedFeatureResults?.length&&(f.editedFeatures=u.editedFeatureResults),l.resolve(f),u}catch(e){throw l.reject(e),e}}function w(e,t,r){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n.Z(`${t.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in e)&&!e.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new n.Z(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new n.Z(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function S(e,t){if("geometry"in e&&"mesh"===e.geometry?.type){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new n.Z(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function _(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&s.data.name||s.name))throw new n.Z(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=(0,l.sJ)(s.data);if(e&&!e.isBase64)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function R(e){const t=e.addFeatures??[],r=e.updateFeatures??[],s=t.concat(r).map((e=>e.geometry)),a=await(0,d.aX)(s),n=t.length,i=r.length;return a.slice(0,n).forEach(((e,r)=>t[r].geometry=e)),a.slice(n,n+i).forEach(((e,t)=>r[t].geometry=e)),e}function A(e){const t=new s.Z;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function v(e){return"mesh"===e?.geometry?.type}function O(e,t,r,s){if(!y(t))throw new n.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n.Z(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}},73919:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Q});var s=r(43697),a=(r(66577),r(38171)),n=r(40330),i=r(3172),o=r(92835),u=r(67676),l=r(20102),d=r(80442),c=r(35454),p=r(83379),h=r(92604),y=r(78286),f=r(95330),m=r(67900),g=r(81271),b=r(41123),F=r(5600),w=(r(75215),r(52011)),S=r(6570),_=r(44547),R=r(33955),A=r(52138),v=r(13598),O=r(85872),I=r(20773);function E(e){const{vertexSpace:t}=e;if(t.isRelative)return e.clone();const{anchor:r}=e,s=r.clone(),a=(0,A.f)(x,[-s.x,-s.y,-s.z]),n=new O.Z({origin:[s.x,s.y,s.z]}),i=e.cloneWithVertexSpace(n),{position:o}=i.vertexAttributes;return i.vertexAttributes.position=(0,I.t)(new Float64Array(o.length),o,a),i.vertexAttributesChanged(),i}const x=(0,v.c)();var q=r(84470),C=r(14720),Z=r(25278),T=r(49735),D=r(66677),M=r(2981),P=r(4967),N=r(59431),k=r(14165),$=r(82971);const G=new c.X({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),U=new Set(["Feature Layer","Oriented Imagery Layer","Table"]),B=new c.X({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let j=class extends p.Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=(0,f.Ds)((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})),this._ongoingAssetUploads=new Map}load(e){const t=null!=e?e.signal:null,r=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(r,t)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:r,infoFor3D:s,gdbVersion:a,spatialReference:n,fieldsIndex:i}=this.layer,o=(0,d.Z)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==s,u=e?.operations?.supportsQueryAttachments??!1;return new T.Z({url:t.path,pbfSupported:o,fieldsIndex:i,infoFor3D:s,dynamicDataSource:r,gdbVersion:a,sourceSpatialReference:n,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const r=e.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+r+"/addAttachment",a=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(t,a.query);try{const e=await(0,i.default)(s,{body:n});return this._createFeatureEditResult(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(r,e)}}async updateAttachment(e,t,r){await this.load();const s=e.attributes[this.layer.objectIdField],a=this.layer.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:t}}),o=this._getFormDataForAttachment(r,n.query);try{const e=await(0,i.default)(a,{body:o});return this._createFeatureEditResult(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}async applyEdits(e,t){await this.load();const{layer:r}=this,s=r.infoFor3D,a=null!=s,o=a||(t?.globalIdUsed??!1),l=a?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,d=e.addFeatures?.map((e=>this._getFeatureJSON(e,s)))??[],c=(await Promise.all(d)).filter(u.pC),p=e.updateFeatures?.map((e=>this._getFeatureJSON(e,s)))??[],h=(await Promise.all(p)).filter(u.pC),y=this._getFeatureIds(e.deleteFeatures,o);(0,N.P)(c,h,r.spatialReference);const f=await this._getAttachmentEditsJSON(e),m=r.capabilities.editing.supportsAsyncApplyEdits&&a,g={gdbVersion:t?.gdbVersion||r.gdbVersion,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:o,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,sessionId:t?.sessionId,async:m};t?.returnServiceEditsOption?(g.edits=JSON.stringify([{id:r.layerId,adds:c,updates:h,deletes:y,attachments:f,assetMaps:l}]),g.returnServiceEditsOption=G.toJSON(t?.returnServiceEditsOption),g.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(g.adds=c.length?JSON.stringify(c):null,g.updates=h.length?JSON.stringify(h):null,g.deletes=y.length?o?JSON.stringify(y):y.join(","):null,g.attachments=f&&JSON.stringify(f),g.assetMaps=null!=l?JSON.stringify(l):void 0);const b=this._getLayerRequestOptions({method:"post",query:g}),F=t?.returnServiceEditsOption?r.url:r.parsedUrl.path,w=m?await this._asyncApplyEdits(F+"/applyEdits",b):await(0,i.default)(F+"/applyEdits",b);if(!r.capabilities.operations?.supportsEditing&&r.effectiveCapabilities?.operations?.supportsEditing){const e=n.id?.findCredential(r.url);await(e?.refreshToken())}return this._createEditsResult(w)}async deleteAttachments(e,t){await this.load();const r=e.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await(0,i.default)(s,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(e){throw this._createAttachmentErrorResult(r,e)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:a}=await(0,i.default)(`${s}/${r}`,t),{id:n,extent:u,fullExtent:l,timeExtent:d}=a,c=u||l;return{id:n,fullExtent:c&&S.Z.fromJSON(c),timeExtent:d&&o.Z.fromJSON({start:d[0],end:d[1]})}}))}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){return await this.load(),this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,D.M8)(this.layer.url))return"unavailable";const e=(0,g.v_)(this.layer.url,"status"),t=await(0,i.default)(e,{query:{f:"json"}});return B.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:s}=await r.e(6946).then(r.bind(r,36946));return s(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}async _asyncApplyEdits(e,t){const r=(await(0,i.default)(e,t)).data.statusUrl;for(;;){const e=(await(0,i.default)(r,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return(0,i.default)(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new l.Z("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new l.Z("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,f.e4)(J)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const{data:r}=await(0,i.default)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:(0,d.Z)("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:t}));e=r}this.sourceJSON=this._patchServiceJSON(e);const r=e.type;if(!U.has(r))throw new l.Z("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}_patchServiceJSON(e){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=(0,Z.bU)(e.geometryType).renderer;(0,y.RB)("drawingInfo.renderer",t,e)}return"esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),e}async _getFeatureJSON(e,t){const{geometry:r}=e,s={...e.attributes};if(null!=t&&"mesh"===r?.type){const{transformFieldRoles:e}=t,{origin:a,spatialReference:n,transform:i}=r,o=this.layer.spatialReference;await(0,_.initializeProjection)(n,o);const u=(0,_.iV)(a,o);if(s[e.originX]=u.x,s[e.originY]=u.y,s[e.originZ]=u.z??0,null!=i){const{translation:t,scale:a,rotation:u}=i,{vertexSpace:l}=r,d=l.isGeoreferenced?1:(0,m.r6)(n)/(0,m.r6)(o);s[e.translationX]=t[0]*d,s[e.translationY]=-t[2]*d,s[e.translationZ]=t[1]*d,s[e.scaleX]=a[0],s[e.scaleY]=a[2],s[e.scaleZ]=a[1],s[e.rotationX]=u[0],s[e.rotationY]=u[2],s[e.rotationZ]=u[1],s[e.rotationDeg]=u[3]}return{geometry:null,attributes:s}}return null==r?{attributes:s}:"mesh"===r.type||"extent"===r.type?null:{geometry:r.toJSON(),attributes:s}}async _getAttachmentEditsJSON(e){const t=await Promise.all((e.addAttachments??[]).map((e=>this._getAttachmentEditJSON(e)))),r=await Promise.all((e.updateAttachments??[]).map((e=>this._getAttachmentEditJSON(e)))),s=e.deleteAttachments??[];return t.length||r.length||s.length?{adds:t,updates:r,deletes:[...s]}:null}async _getAttachmentEditJSON(e){const{feature:t,attachment:r}=e,{globalId:s,name:a,contentType:n,data:i,uploadId:o}=r,u={globalId:s,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(t&&(u.parentGlobalId="attributes"in t?t.attributes&&t.attributes[this.layer.globalIdField]:t.globalId),o)u.uploadId=o;else if(i){const e=await(0,g.IR)(i);e&&(u.contentType=e.mediaType,u.data=e.data),i instanceof File&&(u.name=i.name)}return a&&(u.name=a),n&&(u.contentType=n),u}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;const r=await this._filterRedundantAssetMaps(t);if(!t?.length)return null;const s=new Array,a=new Map;for(const e of r){const{geometry:t}=e,{vertexSpace:r}=t;if(r.isRelative)s.push(t);else{const r=E(t);a.set(r,t),e.geometry=r,s.push(r)}}await this.uploadAssets(s);for(const[e,t]of a)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(r),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:n}=e,i=n.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===i.length){h.Z.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:u}=i.find(q.yT)??i[0],{vertexSpace:l}=e,d=l.isGeoreferenced?["PROJECT_VERTICES"]:[];for(const e of u)1===e.parts.length?t.push({globalId:(0,b.z)(),parentGlobalId:o,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:d}):h.Z.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_getFeatureIds(e,t){if(!e||0===e.length)return[];if(t&&(0,C.Ey)(e))return e.map((e=>e.globalId));if((0,C.aw)(e))return e.map((e=>e.objectId));const{layer:r}=this,s=t?r.globalIdField:r.objectIdField;return s?e.map((e=>e.getAttribute(s))):[]}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const e of t)s.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===r&&(a={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else a=t;const n=a?.assetMaps;if(n){for(const e of n.addResults)e.success||h.Z.getLogger(this).error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(const e of n.updateResults)e.success||h.Z.getLogger(this).error(`Failed to map asset to feature with globalId ${e.globalId}.`)}const i=a?.attachments,o={addFeatureResults:a?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:a?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:a?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:i&&i.addResults?i.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:i&&i.updateResults?i.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:i&&i.deleteResults?i.deleteResults.map(this._createFeatureEditResult,this):[]};if(a?.editMoment&&(o.editMoment=a.editMoment),s.length>0){o.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new $.Z(t.spatialReference):null;o.editedFeatureResults.push({layerId:e.id,editedFeatures:{adds:t?.adds?.map((e=>this._createEditedFeature(e,r)))||[],updates:t?.updates?.map((e=>({original:this._createEditedFeature(e[0],r),current:this._createEditedFeature(e[1],r)})))||[],deletes:t?.deletes?.map((e=>this._createEditedFeature(e,r)))||[],spatialReference:r}})}}return o}_createEditedFeature(e,t){return new a.Z({attributes:e.attributes,geometry:(0,R.im)({...e.geometry,spatialReference:t})})}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new l.Z("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_createAttachmentErrorResult(e,t){const r=t.details.messages&&t.details.messages[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new l.Z("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const e in t){const s=t[e];null!=s&&(r.set?r.set(e,s):r.append(e,s))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:r,dynamicDataSource:s}=this.layer;return{...e,query:{gdbVersion:r,layer:s?JSON.stringify({source:s}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _filterRedundantAssetMaps(e){const{layer:t}=this,{globalIdField:r,infoFor3D:s,parsedUrl:a}=t;if(null==s||null==r)return e;const n=(0,M.$6)(s);if(null==n)return e;const i=(0,g.v_)(a.path,`../${n.id}`),o=new Array,l=new Array;for(const t of e)t.geometry.metadata.getExternalSourcesOnService(a).length>0?l.push(t):o.push(t);const d=l.map((e=>e.getAttribute(r))).filter(u.pC);if(0===d.length)return e;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:p}}=s,h=new k.Z;h.where=`${c} IN (${d.map((e=>`'${e}'`))})`,h.outFields=[p,c],h.returnGeometry=!1;const y=await(0,P.e)(i,h),{features:f}=y;return 0===f.length?e:[...o,...l.filter((e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,n=f.filter((e=>e.getAttribute(c)===t));if(0===n.length)return!0;const i=n.map((e=>e.getAttribute(p)));return s.getExternalSourcesOnService(a).flatMap((({source:e})=>e.flatMap((e=>e.parts.map((e=>e.partHash)))))).some((e=>i.every((t=>e!==t))))}))]}};(0,s._)([(0,F.Cb)()],j.prototype,"type",void 0),(0,s._)([(0,F.Cb)({constructOnly:!0})],j.prototype,"layer",void 0),(0,s._)([(0,F.Cb)({readOnly:!0})],j.prototype,"queryTask",null),j=(0,s._)([(0,w.j)("esri.layers.graphics.sources.FeatureLayerSource")],j);const J=1e3,Q=j},49735:(e,t,r)=>{r.d(t,{Z:()=>R});var s=r(43697),a=r(92036),n=r(20102),i=r(80442),o=r(95330),u=r(81271),l=r(5600),d=(r(75215),r(67676),r(52011)),c=r(2981),p=r(10158),h=r(11282),y=r(41818),f=(r(66577),r(34599)),m=r(14165),g=r(6570),b=r(5396),F=r(4967),w=r(53261),S=r(74889);let _=class extends a.Z{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,u.mN)(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=null!=e.outStatistics?.[0],a=(0,i.Z)("featurelayer-pbf-statistics"),n=!s||a;let o;if(this.pbfSupported&&n)try{o=await(0,w.t)(this.url,r,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&n||(o=await(0,F.F)(this.url,r,t)),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,s){if(!this._queryIs3DObjectFormat(e)||null==this.infoFor3D||!t.features)return S.Z.fromJSON(t);const{meshFeatureSetFromJSON:a}=await(0,o.Hl)(Promise.all([r.e(6481),r.e(6459),r.e(2097)]).then(r.bind(r,91681)),s);return a(e,this.infoFor3D,t)}executeForCount(e,t){return(0,y.P)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,r){const s=(0,h.en)(e);return(0,f.Vr)(s,m.Z.from(t),{...r}).then((e=>({count:e.data.count,extent:g.Z.fromJSON(e.data.extent)})))}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,b.G)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:s},{executeRelationshipQuery:a}]=await(0,o.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=s.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:s},{executeRelationshipQueryForCount:a}]=await(0,o.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=s.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:s,fetchAttachments:a,processAttachmentQueryResult:n}=await(0,o.Hl)(r.e(540).then(r.bind(r,30540)),t),i=(0,h.en)(this.url);return n(i,await(this.queryAttachmentsSupported?s(i,e,t):a(i,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:s}=await(0,o.Hl)(r.e(1158).then(r.bind(r,71158)),t);return s(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:s}=await(0,o.Hl)(r.e(3992).then(r.bind(r,33992)),t);return s(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:s}=await(0,o.Hl)(r.e(1790).then(r.bind(r,21790)),t);return s(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:s}=await(0,o.Hl)(r.e(4371).then(r.bind(r,14371)),t);return s(this.parsedUrl,e,t)}_normalizeQuery(e){let t=m.Z.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?p.n.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(null!=r&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:s,queryFormats:a}=r,i=(0,c.S0)("model/gltf-binary",s)??(0,c.Ow)("glb",s),o=(0,c.S0)("model/gltf+json",s)??(0,c.Ow)("gtlf",s);for(const e of a){if(e===i){t.formatOf3DObjects=e;break}e!==o||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new n.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,null==t.outFields&&(t.outFields=[]);const{originX:s,originY:a,originZ:n,translationX:i,translationY:o,translationZ:u,scaleX:l,scaleY:d,scaleZ:c,rotationX:p,rotationY:h,rotationZ:y,rotationDeg:f}=r.transformFieldRoles;t.outFields.push(s,a,n,i,o,u,l,d,c,p,h,y,f)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return null!=this.infoFor3D&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,s._)([(0,l.Cb)({type:p.n})],_.prototype,"dynamicDataSource",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"fieldsIndex",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"gdbVersion",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"infoFor3D",void 0),(0,s._)([(0,l.Cb)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,s._)([(0,l.Cb)()],_.prototype,"pbfSupported",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"queryAttachmentsSupported",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"sourceSpatialReference",void 0),(0,s._)([(0,l.Cb)({type:String})],_.prototype,"url",void 0),_=(0,s._)([(0,d.j)("esri.tasks.QueryTask")],_);const R=_},25278:(e,t,r)=>{r.d(t,{Dm:()=>d,Hq:()=>c,MS:()=>p,bU:()=>o});var s=r(80442),a=r(22974),n=r(61159),i=r(58333);function o(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?i.I4:"esriGeometryPolyline"===e?i.ET:i.lF}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function d(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${u.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch(r){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,a.d9)(e)}}]}function p(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:n.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}},2981:(e,t,r)=>{r.d(t,{$6:()=>d,Ow:()=>n,S0:()=>a,d1:()=>i});const s=[["binary","application/octet-stream","bin",""]];function a(e,t){return u(function(e,t){return o(t).find((t=>l(t)===e))}(e,t))}function n(e,t){return u(function(e,t){const r=e.toLowerCase();return o(t).find((e=>function(e){return e?.[2].split(",")??[]}(e).some((e=>r.endsWith(e)))))}(e,t))}function i(e,t){return l(function(e,t){return o(t).find((t=>u(t)===e))}(e,t))}function o(e){return[...s,...e]}function u(e){return e?.[0]}function l(e){return e?.[1]}function d(e){return e.tables?.find((e=>"assetMaps"===e.role))}},41818:(e,t,r)=>{r.d(t,{P:()=>i});var s=r(11282),a=r(34599),n=r(14165);async function i(e,t,r){const i=(0,s.en)(e);return(0,a.hH)(i,n.Z.from(t),{...r}).then((e=>e.data.count))}},5396:(e,t,r)=>{r.d(t,{G:()=>i});var s=r(11282),a=r(34599),n=r(14165);async function i(e,t,r){const i=(0,s.en)(e);return(0,a.Ev)(i,n.Z.from(t),{...r}).then((e=>e.data.objectIds))}},4967:(e,t,r)=>{r.d(t,{F:()=>u,e:()=>o});var s=r(11282),a=r(34599),n=r(74889),i=r(14165);async function o(e,t,r){const s=await u(e,t,r);return n.Z.fromJSON(s)}async function u(e,t,r){const n=(0,s.en)(e),o={...r},u=i.Z.from(t),{data:l}=await(0,a.JT)(n,u,u.sourceSpatialReference,o);return l}},53261:(e,t,r)=>{r.d(t,{t:()=>m});var s=r(11282),a=r(70586),n=r(69285),i=r(98732);function o(e,t){return t}function u(e,t,r,s){switch(r){case 0:return p(e,t+s,0);case 1:return"lowerLeft"===e.originPosition?p(e,t+s,1):function({translate:e,scale:t},r,s){return e[s]-r*t[s]}(e,t+s,1)}}function l(e,t,r,s){return 2===r?p(e,t,2):u(e,t,r,s)}function d(e,t,r,s){return 2===r?p(e,t,3):u(e,t,r,s)}function c(e,t,r,s){return 3===r?p(e,t,3):l(e,t,r,s)}function p({translate:e,scale:t},r,s){return e[s]+r*t[s]}class h{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=o,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,n.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=t)for(const r of e.features)t(r.geometry)}createSpatialReference(){return{}}addField(e,t){const r=e.fields;(0,a.O3)(r),r.push(t);const s=r.map((e=>e.name));this._attributesConstructor=function(){for(const e of s)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:s}=t,a=(0,i.$g)(r.clone(),r,!1,!1,this._transform),n=(0,i.di)(a,s,!1,!1);e.queryGeometryType=s,e.queryGeometry={...n}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const s=(0,a.s3)(this._transform,"transform");switch(t=this._applyTransform(s,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const s=(0,a.s3)(this._transform,"transform");return this._applyTransform(s,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const s=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(s)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(t,r),a=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),a.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?c:t?l:r?d:u}}var y=r(34599),f=(r(74889),r(14165));async function m(e,t,r){const a=(0,s.en)(e),n={...r},i=f.Z.from(t),o=!i.quantizationParameters,{data:u}=await(0,y.qp)(a,i,new h({sourceSpatialReference:i.sourceSpatialReference,applyTransform:o}),n);return u}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3919],{13598:(e,t,r)=>{function s(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(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]]}function n(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>i,a:()=>n,b:()=>a,c:()=>s});const i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:i,clone:a,create:s,createView:n,fromValues:function(e,t,r,s,a,n,i,o,u,l,d,c,p,h,y,f){return[e,t,r,s,a,n,i,o,u,l,d,c,p,h,y,f]}},Symbol.toStringTag,{value:"Module"}))},20773:(e,t,r)=>{r.d(t,{a:()=>o,b:()=>i,c:()=>a,d:()=>d,e:()=>u,n:()=>c,s:()=>l,t:()=>n});var s=r(72220);function a(e,t,r){n(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function n(e,t,r,a=3,n=a){if(e.length/a!==Math.ceil(t.length/n))return s.c.error("source and destination buffers need to have the same number of elements"),e;const i=e.length/a,o=r[0],u=r[1],l=r[2],d=r[4],c=r[5],p=r[6],h=r[8],y=r[9],f=r[10],m=r[12],g=r[13],b=r[14];let F=0,w=0;for(let r=0;r<i;r++){const r=t[F],s=t[F+1],i=t[F+2];e[w]=o*r+d*s+h*i+m,e[w+1]=u*r+c*s+y*i+g,e[w+2]=l*r+p*s+f*i+b,F+=n,w+=a}return e}function i(e,t,r){o(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r,a=3,n=a){if(e.length/a!==Math.ceil(t.length/n))return void s.c.error("source and destination buffers need to have the same number of elements");const i=e.length/a,o=r[0],u=r[1],l=r[2],d=r[3],c=r[4],p=r[5],h=r[6],y=r[7],f=r[8];let m=0,g=0;for(let r=0;r<i;r++){const r=t[m],s=t[m+1],i=t[m+2];e[g]=o*r+d*s+h*i,e[g+1]=u*r+c*s+y*i,e[g+2]=l*r+p*s+f*i,m+=n,g+=a}}function u(e,t,r){l(e.typedBuffer,t,r,e.typedBufferStride)}function l(e,t,r,s=3){const a=Math.min(e.length/s,t.count),n=t.typedBuffer,i=t.typedBufferStride;let o=0,u=0;for(let t=0;t<a;t++)e[u]=r*n[o],e[u+1]=r*n[o+1],e[u+2]=r*n[o+2],o+=i,u+=s}function d(e,t){c(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function c(e,t,r=3,s=r){const a=Math.min(e.length/r,t.length/s);let n=0,i=0;for(let o=0;o<a;o++){const a=t[n],o=t[n+1],u=t[n+2],l=a*a+o*o+u*u;if(l>0){const t=1/Math.sqrt(l);e[i]=t*a,e[i+1]=t*o,e[i+2]=t*u}n+=s,i+=r}}Object.freeze(Object.defineProperty({__proto__:null,normalize:c,normalizeView:d,scale:l,scaleView:u,shiftRight:function(e,t,r){const s=Math.min(e.count,t.count),a=e.typedBuffer,n=e.typedBufferStride,i=t.typedBuffer,o=t.typedBufferStride;let u=0,l=0;for(let e=0;e<s;e++)a[l]=i[u]>>r,a[l+1]=i[u+1]>>r,a[l+2]=i[u+2]>>r,u+=o,l+=n},transformMat3:o,transformMat3View:i,transformMat4:n,transformMat4View:a},Symbol.toStringTag,{value:"Module"}))},41123:(e,t,r)=>{r.d(t,{D:()=>a,z:()=>n});const s="randomUUID"in crypto;function a(){if(s)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const 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`{${a()}}`}},85872:(e,t,r)=>{r.d(t,{Z:()=>p});var s=r(43697),a=r(2368),n=r(96674),i=r(5600),o=(r(75215),r(67676),r(80442),r(36030)),u=r(52011),l=r(65617),d=r(94139);let c=class extends((0,a.J)(n.wq)){constructor(e){super(e),this.type="georeferenced-relative",this.isRelative=!0,this.isGeoreferenced=!0,this.origin=(0,l.c)()}getOriginPoint(e){const[t,r,s]=this.origin;return new d.Z({x:t,y:r,z:s,spatialReference:e})}setOriginFormPoint({x:e,y:t,z:r}){this.origin=(0,l.f)(e,t,r??0)}};(0,s._)([(0,o.J)({georeferencedRelative:"georeferenced-relative"},{readOnly:!0})],c.prototype,"type",void 0),(0,s._)([(0,i.Cb)({type:[Number],nonNullable:!0,json:{write:!0}})],c.prototype,"origin",void 0),c=(0,s._)([(0,u.j)("esri.geometry.support.MeshGeoreferencedRelativeVertexSpace")],c);const p=c},72220:(e,t,r)=>{r.d(t,{c:()=>s});const s=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},84470:(e,t,r)=>{r.d(t,{CP:()=>o,JG:()=>y,LL:()=>u,NZ:()=>l,fV:()=>f,vj:()=>g,yT:()=>F,zE:()=>b});var s=r(3172),a=r(67676),n=r(95330),i=r(2981);class o{constructor(e,t,r){this.assetName=e,this.assetMimeType=t,this.parts=r}equals(e){return this===e||this.assetName===e.assetName&&this.assetMimeType===e.assetMimeType&&(0,a.fS)(this.parts,e.parts,((e,t)=>e.equals(t)))}isOnService(e){return this.parts.every((t=>t.isOnService(e)))}makeHash(){let e="";for(const t of this.parts)e+=t.partHash;return e}async toBlob(e){const{parts:t}=this;if(1===t.length)return t[0].toBlob(e);const r=await Promise.all(t.map((t=>t.toBlob(e))));return(0,n.k_)(e),new Blob(r)}}class u{constructor(e,t){this.partUrl=e,this.partHash=t}equals(e){return this===e||this.partUrl===e.partUrl&&this.partHash===e.partHash}isOnService(e){return this.partUrl.startsWith(`${e.path}/assets/`)}async toBlob(e){const{data:t}=await(0,s.default)(this.partUrl,{responseType:"blob"});return(0,n.k_)(e),t}}function l(e){return function(e){return!!e&&(Array.isArray(e)?e.some(h):h(e))}(e?.source)}function d(e){return!!Array.isArray(e)&&e.every((e=>e instanceof o))}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,p=/\.(gltf|glb)/i;function h(e){if(e instanceof File){const{type:t,name:r}=e;return c.test(t)||p.test(r)}return c.test(e.assetMimeType)||p.test(e.assetName)}function y(e,t){if(!e)return!1;const{source:r}=e;return function(e,t){return Array.isArray(e)?e.every((e=>m(e,t))):m(e,t)}(r,t)}function f(e,t){if(e===t)return!0;const{source:r}=e,{source:s}=t;if(r===s)return!0;if(d(r)&&d(s)){if(r.length!==s.length)return!1;const e=(e,t)=>e.assetName<t.assetName?-1:e.assetName>t.assetName?1:0,t=[...r].sort(e),a=[...s].sort(e);for(let e=0;e<t.length;++e)if(!t[e].equals(a[e]))return!1;return!0}return!1}function m(e,t){return e instanceof o&&e.isOnService(t)}function g(e,t){return e instanceof File?(0,i.Ow)(e.name,t)??(0,i.S0)(e.type,t):(0,i.S0)(e.assetMimeType,t)??(0,i.Ow)(e.assetName,t)}function b(e){return Array.isArray(e)?e:[e]}function F(e){return!!e.original}},61159:(e,t,r)=>{r.d(t,{g:()=>s});const s={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},14720:(e,t,r)=>{r.d(t,{Ey:()=>b,applyEdits:()=>F,aw:()=>m,uploadAssets:()=>O});var s=r(38171),a=r(46791),n=r(20102),i=r(22974),o=r(92604),u=r(95330),l=r(81271),d=r(16306),c=r(66361),p=r(2981),h=r(84230);function y(e){return e&&null!=e.applyEdits}function f(e){return"object"==typeof e&&null!=e&&"objectId"in e&&!!e.objectId}function m(e){return e.every(f)}function g(e){return"object"==typeof e&&null!=e&&"globalId"in e&&!!e.globalId}function b(e){return e.every(g)}async function F(e,t,r,s={}){let l;if((0,c.lQ)(e)&&e.url)l=(0,c.jF)(e.url,e.layerId,"original-and-current-features"===s.returnServiceEditsOption);else{l=(0,u.hh)(),l.promise.then((t=>{(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length)&&e.emit("edits",t)}));const t={result:l.promise};e.emit("apply-edits",t)}try{const{results:u,edits:d}=await async function(e,t,r,s){if(await e.load(),!y(t))throw new n.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!(0,h.ln)(e))throw new n.Z(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:i,options:u}=await async function(e,t,r){const s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),i=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),u=null!=e.infoFor3D;if(!t||!s&&!i)throw new n.Z(`${e.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");const l=(0,h.S1)(e);if(!l.data.isVersioned&&r?.gdbVersion)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!l.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!l.editing.supportsGlobalId&&r?.globalIdUsed)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!l.editing.supportsGlobalId&&i)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&i)throw new n.Z(`${e.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const d={...r};if(null!=d.rollbackOnFailureEnabled||l.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||"original-and-current-features"!==d.returnServiceEditsOption||(!1===d.rollbackOnFailureEnabled&&o.Z.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),d.rollbackOnFailureEnabled=!0),!l.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new n.Z(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&"original-and-current-features"!==d.returnServiceEditsOption)throw new n.Z(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const c={...t};if(c.addFeatures=t&&a.Z.isCollection(t.addFeatures)?t.addFeatures.toArray():c.addFeatures||[],c.updateFeatures=t&&a.Z.isCollection(t.updateFeatures)?t.updateFeatures.toArray():c.updateFeatures||[],c.deleteFeatures=t&&a.Z.isCollection(t.deleteFeatures)?t.deleteFeatures.toArray():c.deleteFeatures||[],c.addFeatures.length&&!l.operations.supportsAdd)throw new n.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(c.updateFeatures.length&&!l.operations.supportsUpdate)throw new n.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(c.deleteFeatures.length&&!l.operations.supportsDelete)throw new n.Z(`${e.type}-layer:unsupported-operation`,"Layer does not support deleting features.");c.addAttachments=c.addAttachments||[],c.updateAttachments=c.updateAttachments||[],c.deleteAttachments=c.deleteAttachments||[],c.addFeatures=c.addFeatures.map(A),c.updateFeatures=c.updateFeatures.map(A),c.addAssetFeatures=[];const y=r?.globalIdUsed||u;return c.addFeatures.forEach((t=>function(e,t,r){w(e,t,r),S(e,t)}(t,e,y))),c.updateFeatures.forEach((t=>function(e,t,r){w(e,t,r),S(e,t);const s=(0,h.S1)(t);if("geometry"in e&&null!=e.geometry&&!s?.editing.supportsGeometryUpdate)throw new n.Z(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}(t,e,y))),c.deleteFeatures.forEach((t=>function(e,t,r){w(e,t,r)}(t,e,y))),c.addAttachments.forEach((t=>_(t,e))),c.updateAttachments.forEach((t=>_(t,e))),u&&await async function(e,t){if(null==t.infoFor3D)return;const{infoFor3D:r}=t,s=(0,p.S0)("model/gltf-binary",r.supportedFormats)??(0,p.Ow)("glb",r.supportedFormats);if(!s||!r.editFormats.includes(s))throw new n.Z(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const t of e.addFeatures??[])v(t)&&a.push(t);for(const t of e.updateFeatures??[])v(t)&&a.push(t)}(c,e),{edits:await R(c),options:d}}(e,r,s);return i.addFeatures?.length||i.updateFeatures?.length||i.deleteFeatures?.length||i.addAttachments?.length||i.updateAttachments?.length||i.deleteAttachments?.length?{edits:i,results:await t.applyEdits(i,u)}:{edits:i,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}(e,t,r,s),c=e=>e.filter((e=>!e.error)).map(i.d9),f={edits:d,addedFeatures:c(u.addFeatureResults),updatedFeatures:c(u.updateFeatureResults),deletedFeatures:c(u.deleteFeatureResults),addedAttachments:c(u.addAttachmentResults),updatedAttachments:c(u.updateAttachmentResults),deletedAttachments:c(u.deleteAttachmentResults),exceededTransferLimit:!1};return u.editedFeatureResults?.length&&(f.editedFeatures=u.editedFeatureResults),l.resolve(f),u}catch(e){throw l.reject(e),e}}function w(e,t,r){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n.Z(`${t.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in e)&&!e.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in e&&null!=e.geometry){if(e.geometry.hasZ&&!1===t.capabilities?.data.supportsZ)throw new n.Z(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&!1===t.capabilities?.data.supportsM)throw new n.Z(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function S(e,t){if("geometry"in e&&"mesh"===e.geometry?.type){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new n.Z(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function _(e,t){const{feature:r,attachment:s}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!s.globalId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!s.data&&!s.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(s.data instanceof File&&s.data.name||s.name))throw new n.Z(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&s.uploadId)throw new n.Z(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if("string"==typeof s.data){const e=(0,l.sJ)(s.data);if(e&&!e.isBase64)throw new n.Z(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function R(e){const t=e.addFeatures??[],r=e.updateFeatures??[],s=t.concat(r).map((e=>e.geometry)),a=await(0,d.aX)(s),n=t.length,i=r.length;return a.slice(0,n).forEach(((e,r)=>t[r].geometry=e)),a.slice(n,n+i).forEach(((e,t)=>r[t].geometry=e)),e}function A(e){const t=new s.Z;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}function v(e){return"mesh"===e?.geometry?.type}function O(e,t,r,s){if(!y(t))throw new n.Z(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n.Z(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,s)}},73919:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Q});var s=r(43697),a=(r(66577),r(38171)),n=r(40330),i=r(3172),o=r(92835),u=r(67676),l=r(20102),d=r(80442),c=r(35454),p=r(83379),h=r(92604),y=r(78286),f=r(95330),m=r(67900),g=r(81271),b=r(41123),F=r(5600),w=(r(75215),r(52011)),S=r(6570),_=r(44547),R=r(33955),A=r(52138),v=r(13598),O=r(85872),I=r(20773);function E(e){const{vertexSpace:t}=e;if(t.isRelative)return e.clone();const{anchor:r}=e,s=r.clone(),a=(0,A.f)(x,[-s.x,-s.y,-s.z]),n=new O.Z({origin:[s.x,s.y,s.z]}),i=e.cloneWithVertexSpace(n),{position:o}=i.vertexAttributes;return i.vertexAttributes.position=(0,I.t)(new Float64Array(o.length),o,a),i.vertexAttributesChanged(),i}const x=(0,v.c)();var q=r(84470),C=r(14720),Z=r(25278),T=r(49735),D=r(66677),M=r(2981),P=r(4967),N=r(59431),k=r(14165),$=r(82971);const G=new c.X({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),U=new Set(["Feature Layer","Oriented Imagery Layer","Table"]),B=new c.X({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let j=class extends p.Z{constructor(){super(...arguments),this.type="feature-layer",this.refresh=(0,f.Ds)((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})),this._ongoingAssetUploads=new Map}load(e){const t=null!=e?e.signal:null,r=this.layer.sourceJSON;return this.addResolvingPromise(this._fetchService(r,t)),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:r,infoFor3D:s,gdbVersion:a,spatialReference:n,fieldsIndex:i}=this.layer,o=(0,d.Z)("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==s,u=e?.operations?.supportsQueryAttachments??!1;return new T.Z({url:t.path,pbfSupported:o,fieldsIndex:i,infoFor3D:s,dynamicDataSource:r,gdbVersion:a,sourceSpatialReference:n,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const r=e.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+r+"/addAttachment",a=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(t,a.query);try{const e=await(0,i.default)(s,{body:n});return this._createFeatureEditResult(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(r,e)}}async updateAttachment(e,t,r){await this.load();const s=e.attributes[this.layer.objectIdField],a=this.layer.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:t}}),o=this._getFormDataForAttachment(r,n.query);try{const e=await(0,i.default)(a,{body:o});return this._createFeatureEditResult(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(s,e)}}async applyEdits(e,t){await this.load();const{layer:r}=this,s=r.infoFor3D,a=null!=s,o=a||(t?.globalIdUsed??!1),l=a?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,d=e.addFeatures?.map((e=>this._getFeatureJSON(e,s)))??[],c=(await Promise.all(d)).filter(u.pC),p=e.updateFeatures?.map((e=>this._getFeatureJSON(e,s)))??[],h=(await Promise.all(p)).filter(u.pC),y=this._getFeatureIds(e.deleteFeatures,o);(0,N.P)(c,h,r.spatialReference);const f=await this._getAttachmentEditsJSON(e),m=r.capabilities.editing.supportsAsyncApplyEdits&&a,g={gdbVersion:t?.gdbVersion||r.gdbVersion,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:o,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,sessionId:t?.sessionId,async:m};t?.returnServiceEditsOption?(g.edits=JSON.stringify([{id:r.layerId,adds:c,updates:h,deletes:y,attachments:f,assetMaps:l}]),g.returnServiceEditsOption=G.toJSON(t?.returnServiceEditsOption),g.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(g.adds=c.length?JSON.stringify(c):null,g.updates=h.length?JSON.stringify(h):null,g.deletes=y.length?o?JSON.stringify(y):y.join(","):null,g.attachments=f&&JSON.stringify(f),g.assetMaps=null!=l?JSON.stringify(l):void 0);const b=this._getLayerRequestOptions({method:"post",query:g}),F=t?.returnServiceEditsOption?r.url:r.parsedUrl.path,w=m?await this._asyncApplyEdits(F+"/applyEdits",b):await(0,i.default)(F+"/applyEdits",b);if(!r.capabilities.operations?.supportsEditing&&r.effectiveCapabilities?.operations?.supportsEditing){const e=n.id?.findCredential(r.url);await(e?.refreshToken())}return this._createEditsResult(w)}async deleteAttachments(e,t){await this.load();const r=e.attributes[this.layer.objectIdField],s=this.layer.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await(0,i.default)(s,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(e){throw this._createAttachmentErrorResult(r,e)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:a}=await(0,i.default)(`${s}/${r}`,t),{id:n,extent:u,fullExtent:l,timeExtent:d}=a,c=u||l;return{id:n,fullExtent:c&&S.Z.fromJSON(c),timeExtent:d&&o.Z.fromJSON({start:d[0],end:d[1]})}}))}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){return await this.load(),this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!(0,D.M8)(this.layer.url))return"unavailable";const e=(0,g.v_)(this.layer.url,"status"),t=await(0,i.default)(e,{query:{f:"json"}});return B.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:s}=await r.e(6946).then(r.bind(r,36946));return s(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}async _asyncApplyEdits(e,t){const r=(await(0,i.default)(e,t)).data.statusUrl;for(;;){const e=(await(0,i.default)(r,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return(0,i.default)(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new l.Z("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new l.Z("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await(0,f.e4)(J)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const{data:r}=await(0,i.default)(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:(0,d.Z)("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:t}));e=r}this.sourceJSON=await this._patchServiceJSON(e,t);const r=e.type;if(!U.has(r))throw new l.Z("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=(0,Z.bU)(e.geometryType).renderer;(0,y.RB)("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:r}=await(0,i.default)(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){(0,f.r9)(e)}return e}async _getFeatureJSON(e,t){const{geometry:r}=e,s={...e.attributes};if(null!=t&&"mesh"===r?.type){const{transformFieldRoles:e}=t,{origin:a,spatialReference:n,transform:i}=r,o=this.layer.spatialReference;await(0,_.initializeProjection)(n,o);const u=(0,_.iV)(a,o);if(s[e.originX]=u.x,s[e.originY]=u.y,s[e.originZ]=u.z??0,null!=i){const{translation:t,scale:a,rotation:u}=i,{vertexSpace:l}=r,d=l.isGeoreferenced?1:(0,m.r6)(n)/(0,m.r6)(o);s[e.translationX]=t[0]*d,s[e.translationY]=-t[2]*d,s[e.translationZ]=t[1]*d,s[e.scaleX]=a[0],s[e.scaleY]=a[2],s[e.scaleZ]=a[1],s[e.rotationX]=u[0],s[e.rotationY]=u[2],s[e.rotationZ]=u[1],s[e.rotationDeg]=u[3]}return{geometry:null,attributes:s}}return null==r?{attributes:s}:"mesh"===r.type||"extent"===r.type?null:{geometry:r.toJSON(),attributes:s}}async _getAttachmentEditsJSON(e){const t=await Promise.all((e.addAttachments??[]).map((e=>this._getAttachmentEditJSON(e)))),r=await Promise.all((e.updateAttachments??[]).map((e=>this._getAttachmentEditJSON(e)))),s=e.deleteAttachments??[];return t.length||r.length||s.length?{adds:t,updates:r,deletes:[...s]}:null}async _getAttachmentEditJSON(e){const{feature:t,attachment:r}=e,{globalId:s,name:a,contentType:n,data:i,uploadId:o}=r,u={globalId:s,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(t&&(u.parentGlobalId="attributes"in t?t.attributes&&t.attributes[this.layer.globalIdField]:t.globalId),o)u.uploadId=o;else if(i){const e=await(0,g.IR)(i);e&&(u.contentType=e.mediaType,u.data=e.data),i instanceof File&&(u.name=i.name)}return a&&(u.name=a),n&&(u.contentType=n),u}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;const r=await this._filterRedundantAssetMaps(t);if(!t?.length)return null;const s=new Array,a=new Map;for(const e of r){const{geometry:t}=e,{vertexSpace:r}=t;if(r.isRelative)s.push(t);else{const r=E(t);a.set(r,t),e.geometry=r,s.push(r)}}await this.uploadAssets(s);for(const[e,t]of a)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(r),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:n}=e,i=n.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===i.length){h.Z.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:u}=i.find(q.yT)??i[0],{vertexSpace:l}=e,d=l.isGeoreferenced?["PROJECT_VERTICES"]:[];for(const e of u)1===e.parts.length?t.push({globalId:(0,b.z)(),parentGlobalId:o,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:d}):h.Z.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_getFeatureIds(e,t){if(!e||0===e.length)return[];if(t&&(0,C.Ey)(e))return e.map((e=>e.globalId));if((0,C.aw)(e))return e.map((e=>e.objectId));const{layer:r}=this,s=t?r.globalIdField:r.objectIdField;return s?e.map((e=>e.getAttribute(s))):[]}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const e of t)s.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===r&&(a={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else a=t;const n=a?.assetMaps;if(n){for(const e of n.addResults)e.success||h.Z.getLogger(this).error(`Failed to map asset to feature with globalId ${e.globalId}.`);for(const e of n.updateResults)e.success||h.Z.getLogger(this).error(`Failed to map asset to feature with globalId ${e.globalId}.`)}const i=a?.attachments,o={addFeatureResults:a?.addResults?.map(this._createFeatureEditResult,this)??[],updateFeatureResults:a?.updateResults?.map(this._createFeatureEditResult,this)??[],deleteFeatureResults:a?.deleteResults?.map(this._createFeatureEditResult,this)??[],addAttachmentResults:i&&i.addResults?i.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:i&&i.updateResults?i.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:i&&i.deleteResults?i.deleteResults.map(this._createFeatureEditResult,this):[]};if(a?.editMoment&&(o.editMoment=a.editMoment),s.length>0){o.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new $.Z(t.spatialReference):null;o.editedFeatureResults.push({layerId:e.id,editedFeatures:{adds:t?.adds?.map((e=>this._createEditedFeature(e,r)))||[],updates:t?.updates?.map((e=>({original:this._createEditedFeature(e[0],r),current:this._createEditedFeature(e[1],r)})))||[],deletes:t?.deletes?.map((e=>this._createEditedFeature(e,r)))||[],spatialReference:r}})}}return o}_createEditedFeature(e,t){return new a.Z({attributes:e.attributes,geometry:(0,R.im)({...e.geometry,spatialReference:t})})}_createFeatureEditResult(e){const t=!0===e.success?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new l.Z("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_createAttachmentErrorResult(e,t){const r=t.details.messages&&t.details.messages[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new l.Z("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const e in t){const s=t[e];null!=s&&(r.set?r.set(e,s):r.append(e,s))}return r}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:r,dynamicDataSource:s}=this.layer;return{...e,query:{gdbVersion:r,layer:s?JSON.stringify({source:s}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _filterRedundantAssetMaps(e){const{layer:t}=this,{globalIdField:r,infoFor3D:s,parsedUrl:a}=t;if(null==s||null==r)return e;const n=(0,M.$6)(s);if(null==n)return e;const i=(0,g.v_)(a.path,`../${n.id}`),o=new Array,l=new Array;for(const t of e)t.geometry.metadata.getExternalSourcesOnService(a).length>0?l.push(t):o.push(t);const d=l.map((e=>e.getAttribute(r))).filter(u.pC);if(0===d.length)return e;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:p}}=s,h=new k.Z;h.where=`${c} IN (${d.map((e=>`'${e}'`))})`,h.outFields=[p,c],h.returnGeometry=!1;const y=await(0,P.e)(i,h),{features:f}=y;return 0===f.length?e:[...o,...l.filter((e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,n=f.filter((e=>e.getAttribute(c)===t));if(0===n.length)return!0;const i=n.map((e=>e.getAttribute(p)));return s.getExternalSourcesOnService(a).flatMap((({source:e})=>e.flatMap((e=>e.parts.map((e=>e.partHash)))))).some((e=>i.every((t=>e!==t))))}))]}};(0,s._)([(0,F.Cb)()],j.prototype,"type",void 0),(0,s._)([(0,F.Cb)({constructOnly:!0})],j.prototype,"layer",void 0),(0,s._)([(0,F.Cb)({readOnly:!0})],j.prototype,"queryTask",null),j=(0,s._)([(0,w.j)("esri.layers.graphics.sources.FeatureLayerSource")],j);const J=1e3,Q=j},49735:(e,t,r)=>{r.d(t,{Z:()=>R});var s=r(43697),a=r(92036),n=r(20102),i=r(80442),o=r(95330),u=r(81271),l=r(5600),d=(r(75215),r(67676),r(52011)),c=r(2981),p=r(10158),h=r(11282),y=r(41818),f=(r(66577),r(34599)),m=r(14165),g=r(6570),b=r(5396),F=r(4967),w=r(53261),S=r(74889);let _=class extends a.Z{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return(0,u.mN)(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=null!=e.outStatistics?.[0],a=(0,i.Z)("featurelayer-pbf-statistics"),n=!s||a;let o;if(this.pbfSupported&&n)try{o=await(0,w.t)(this.url,r,t)}catch(e){if("query:parsing-pbf"!==e.name)throw e;this.pbfSupported=!1}return this.pbfSupported&&n||(o=await(0,F.F)(this.url,r,t)),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,s){if(!this._queryIs3DObjectFormat(e)||null==this.infoFor3D||!t.features)return S.Z.fromJSON(t);const{meshFeatureSetFromJSON:a}=await(0,o.Hl)(Promise.all([r.e(6481),r.e(6459),r.e(2097)]).then(r.bind(r,91681)),s);return a(e,this.infoFor3D,t)}executeForCount(e,t){return(0,y.P)(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return async function(e,t,r){const s=(0,h.en)(e);return(0,f.Vr)(s,m.Z.from(t),{...r}).then((e=>({count:e.data.count,extent:g.Z.fromJSON(e.data.extent)})))}(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return(0,b.G)(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:s},{executeRelationshipQuery:a}]=await(0,o.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=s.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:s},{executeRelationshipQueryForCount:a}]=await(0,o.Hl)(Promise.all([r.e(5935).then(r.bind(r,75935)),r.e(1073).then(r.bind(r,81073))]),t);return e=s.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),a(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:s,fetchAttachments:a,processAttachmentQueryResult:n}=await(0,o.Hl)(r.e(540).then(r.bind(r,30540)),t),i=(0,h.en)(this.url);return n(i,await(this.queryAttachmentsSupported?s(i,e,t):a(i,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:s}=await(0,o.Hl)(r.e(1158).then(r.bind(r,71158)),t);return s(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:s}=await(0,o.Hl)(r.e(3992).then(r.bind(r,33992)),t);return s(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:s}=await(0,o.Hl)(r.e(1790).then(r.bind(r,21790)),t);return s(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:s}=await(0,o.Hl)(r.e(4371).then(r.bind(r,14371)),t);return s(this.parsedUrl,e,t)}_normalizeQuery(e){let t=m.Z.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?p.n.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(null!=r&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:s,queryFormats:a}=r,i=(0,c.S0)("model/gltf-binary",s)??(0,c.Ow)("glb",s),o=(0,c.S0)("model/gltf+json",s)??(0,c.Ow)("gtlf",s);for(const e of a){if(e===i){t.formatOf3DObjects=e;break}e!==o||t.formatOf3DObjects||(t.formatOf3DObjects=e)}if(!t.formatOf3DObjects)throw new n.Z("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(null==t.outFields||!t.outFields.includes("*")){t=t===e?t.clone():t,null==t.outFields&&(t.outFields=[]);const{originX:s,originY:a,originZ:n,translationX:i,translationY:o,translationZ:u,scaleX:l,scaleY:d,scaleZ:c,rotationX:p,rotationY:h,rotationZ:y,rotationDeg:f}=r.transformFieldRoles;t.outFields.push(s,a,n,i,o,u,l,d,c,p,h,y,f)}}return t}_normalizeFields(e){if(null!=this.fieldsIndex&&null!=e)for(const t of e){const e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryIs3DObjectFormat(e){return null!=this.infoFor3D&&!0===e.returnGeometry&&"xyFootprint"!==e.multipatchOption&&!e.outStatistics}};(0,s._)([(0,l.Cb)({type:p.n})],_.prototype,"dynamicDataSource",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"fieldsIndex",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"gdbVersion",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"infoFor3D",void 0),(0,s._)([(0,l.Cb)({readOnly:!0})],_.prototype,"parsedUrl",null),(0,s._)([(0,l.Cb)()],_.prototype,"pbfSupported",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"queryAttachmentsSupported",void 0),(0,s._)([(0,l.Cb)()],_.prototype,"sourceSpatialReference",void 0),(0,s._)([(0,l.Cb)({type:String})],_.prototype,"url",void 0),_=(0,s._)([(0,d.j)("esri.tasks.QueryTask")],_);const R=_},25278:(e,t,r)=>{r.d(t,{Dm:()=>d,Hq:()=>c,MS:()=>p,bU:()=>o});var s=r(80442),a=r(22974),n=r(61159),i=r(58333);function o(e){return{renderer:{type:"simple",symbol:"esriGeometryPoint"===e||"esriGeometryMultipoint"===e?i.I4:"esriGeometryPolyline"===e?i.ET:i.lF}}}const u=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let l=1;function d(e,t){if((0,s.Z)("esri-csp-restrictions"))return()=>({[t]:null,...e});try{let r=`this.${t} = null;`;for(const t in e)r+=`this${u.test(t)?`.${t}`:`["${t}"]`} = ${JSON.stringify(e[t])};`;const s=new Function(`\n return class AttributesClass$${l++} {\n constructor() {\n ${r};\n }\n }\n `)();return()=>new s}catch(r){return()=>({[t]:null,...e})}}function c(e={}){return[{name:"New Feature",description:"",prototype:{attributes:(0,a.d9)(e)}}]}function p(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:t,supportsDelete:t,supportsEditing:t,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:t,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:n.g,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:t,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1}}}},2981:(e,t,r)=>{r.d(t,{$6:()=>d,Ow:()=>n,S0:()=>a,d1:()=>i});const s=[["binary","application/octet-stream","bin",""]];function a(e,t){return u(function(e,t){return o(t).find((t=>l(t)===e))}(e,t))}function n(e,t){return u(function(e,t){const r=e.toLowerCase();return o(t).find((e=>function(e){return e?.[2].split(",")??[]}(e).some((e=>r.endsWith(e)))))}(e,t))}function i(e,t){return l(function(e,t){return o(t).find((t=>u(t)===e))}(e,t))}function o(e){return[...s,...e]}function u(e){return e?.[0]}function l(e){return e?.[1]}function d(e){return e.tables?.find((e=>"assetMaps"===e.role))}},41818:(e,t,r)=>{r.d(t,{P:()=>i});var s=r(11282),a=r(34599),n=r(14165);async function i(e,t,r){const i=(0,s.en)(e);return(0,a.hH)(i,n.Z.from(t),{...r}).then((e=>e.data.count))}},5396:(e,t,r)=>{r.d(t,{G:()=>i});var s=r(11282),a=r(34599),n=r(14165);async function i(e,t,r){const i=(0,s.en)(e);return(0,a.Ev)(i,n.Z.from(t),{...r}).then((e=>e.data.objectIds))}},4967:(e,t,r)=>{r.d(t,{F:()=>u,e:()=>o});var s=r(11282),a=r(34599),n=r(74889),i=r(14165);async function o(e,t,r){const s=await u(e,t,r);return n.Z.fromJSON(s)}async function u(e,t,r){const n=(0,s.en)(e),o={...r},u=i.Z.from(t),{data:l}=await(0,a.JT)(n,u,u.sourceSpatialReference,o);return l}},53261:(e,t,r)=>{r.d(t,{t:()=>m});var s=r(11282),a=r(70586),n=r(69285),i=r(98732);function o(e,t){return t}function u(e,t,r,s){switch(r){case 0:return p(e,t+s,0);case 1:return"lowerLeft"===e.originPosition?p(e,t+s,1):function({translate:e,scale:t},r,s){return e[s]-r*t[s]}(e,t+s,1)}}function l(e,t,r,s){return 2===r?p(e,t,2):u(e,t,r,s)}function d(e,t,r,s){return 2===r?p(e,t,3):u(e,t,r,s)}function c(e,t,r,s){return 3===r?p(e,t,3):l(e,t,r,s)}function p({translate:e,scale:t},r,s){return e[s]+r*t[s]}class h{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=o,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=(0,n.k)(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(null!=t)for(const r of e.features)t(r.geometry)}createSpatialReference(){return{}}addField(e,t){const r=e.fields;(0,a.O3)(r),r.push(t);const s=r.map((e=>e.name));this._attributesConstructor=function(){for(const e of s)this[e]=null}}addFeature(e,t){e.features.push(t)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,t,r)=>this.addCoordinatePoint(e,t,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,t,r)=>this._addCoordinatePolygon(e,t,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,t,r)=>this._addCoordinatePolyline(e,t,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,t,r)=>this._addCoordinateMultipoint(e,t,r),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,t,r){0===this._lengths.length&&(this._toAddInCurrentPath=t),this._lengths.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:s}=t,a=(0,i.$g)(r.clone(),r,!1,!1,this._transform),n=(0,i.di)(a,s,!1,!1);e.queryGeometryType=s,e.queryGeometry={...n}}createPointGeometry(e){const t={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(t.z=0),e.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const s=(0,a.s3)(this._transform,"transform");switch(t=this._applyTransform(s,t,r,0),r){case 0:e.x=t;break;case 1:e.y=t;break;case 2:"z"in e?e.z=t:e.m=t;break;case 3:e.m=t}}_transformPathLikeValue(e,t){let r=0;t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e);const s=(0,a.s3)(this._transform,"transform");return this._applyTransform(s,e,t,r)}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){0===r&&e.points.push([]);const s=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(s)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){0===r&&0==this._toAddInCurrentPath--&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(t,r),a=e[e.length-1];0===r&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),a.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?c:t?l:r?d:u}}var y=r(34599),f=(r(74889),r(14165));async function m(e,t,r){const a=(0,s.en)(e),n={...r},i=f.Z.from(t),o=!i.quantizationParameters,{data:u}=await(0,y.qp)(a,i,new h({sourceSpatialReference:i.sourceSpatialReference,applyTransform:o}),n);return u}}}]);
|