@arcgis/core 5.0.0-next.71 → 5.0.0-next.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/Ground.js +1 -1
  2. package/applications/Components/analysisUtils.d.ts +1 -2
  3. package/applications/Components/analysisUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/00631252e8bd4a456253.js +1 -0
  6. package/assets/esri/core/workers/chunks/{322085d63719da6e443c.js → 0c02b084ae30ba138c5d.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0f2f1731543ed21db0a8.js +1 -0
  8. package/assets/esri/core/workers/chunks/1b201d83e9ba7d8615c0.js +1 -0
  9. package/assets/esri/core/workers/chunks/{b4f944ef6c174b20b619.js → 23545a9adc75564ecf6e.js} +1 -1
  10. package/assets/esri/core/workers/chunks/261b5a5db022ef580a1b.js +1 -0
  11. package/assets/esri/core/workers/chunks/2bd59ece927b5c1c9f80.js +1 -0
  12. package/assets/esri/core/workers/chunks/{37e46461da3000949a26.js → 2d8b8880e6bff4414e95.js} +1 -1
  13. package/assets/esri/core/workers/chunks/2fba74bae99ece15706c.js +1 -0
  14. package/assets/esri/core/workers/chunks/2fc64404bc42b7250086.js +1 -0
  15. package/assets/esri/core/workers/chunks/33cbfc34d5e2fc1a1a4f.js +1 -0
  16. package/assets/esri/core/workers/chunks/35887be3e4a218268d99.js +1 -0
  17. package/assets/esri/core/workers/chunks/3596ae4cb2bd2f3f35d9.js +1 -0
  18. package/assets/esri/core/workers/chunks/37814bf052ab59a5fb9e.js +1 -0
  19. package/assets/esri/core/workers/chunks/4e0d299054da075e5103.js +1 -0
  20. package/assets/esri/core/workers/chunks/50186162cd6d7c2ef0f9.js +1 -0
  21. package/assets/esri/core/workers/chunks/543ea1a0e7a6f1d267d1.js +1 -0
  22. package/assets/esri/core/workers/chunks/{dbfb00fb28b8b9f687a1.js → 5bbf20135c87a1cc8a18.js} +1 -1
  23. package/assets/esri/core/workers/chunks/5ed31ec0f53c1d55c4ea.js +1 -0
  24. package/assets/esri/core/workers/chunks/6309e8beedf5e7f2a50f.js +1 -0
  25. package/assets/esri/core/workers/chunks/{1a45b4b4803337f4b99f.js → 64985e9b6e2edb3ceb37.js} +38 -38
  26. package/assets/esri/core/workers/chunks/65475370cc4ebe2aa657.js +1 -0
  27. package/assets/esri/core/workers/chunks/65d9f3bc88472008443a.js +1 -0
  28. package/assets/esri/core/workers/chunks/6ab0f16f5c8806855c47.js +1 -0
  29. package/assets/esri/core/workers/chunks/7e37a3005f2ad2c0a918.js +1 -0
  30. package/assets/esri/core/workers/chunks/7f2496a59379e1a61ee5.js +1 -0
  31. package/assets/esri/core/workers/chunks/88379cd8e8e1c7ae3c7c.js +1 -0
  32. package/assets/esri/core/workers/chunks/{25abbe1663e18e677dc2.js → 935a6dccb88557f98189.js} +2 -2
  33. package/assets/esri/core/workers/chunks/{a808be466812db51813d.js → 9382af94bf6bf1b09c8c.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{8e83c133b201b9b61e70.js → 979bc762ccc0d3fc2467.js} +1 -1
  35. package/assets/esri/core/workers/chunks/9c417f4dfb19e4c4bd71.js +1 -0
  36. package/assets/esri/core/workers/chunks/a554ad74be03b1ed1a72.js +1 -0
  37. package/assets/esri/core/workers/chunks/{e6e837e43b9348050832.js → a67c86f4254807eb6a05.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{1ec1a1997b5577619040.js → b211b53aa7616a093b90.js} +1 -1
  39. package/assets/esri/core/workers/chunks/c31babdb59382b6bc007.js +1 -0
  40. package/assets/esri/core/workers/chunks/c8182c2cbb0ead202af6.js +1 -0
  41. package/assets/esri/core/workers/chunks/ce218c10b209b58e04fd.js +1 -0
  42. package/assets/esri/core/workers/chunks/ceef586d8cc8adc4d249.js +1 -0
  43. package/assets/esri/core/workers/chunks/d13e8ce9270dc0662b87.js +1 -0
  44. package/assets/esri/core/workers/chunks/db28d00171240b4fffac.js +1 -0
  45. package/assets/esri/core/workers/chunks/dbd382546837aa7709e2.js +1 -0
  46. package/assets/esri/core/workers/chunks/ea6f897f21b4f30e8e99.js +1 -0
  47. package/assets/esri/core/workers/chunks/{e8a3ad00936f2ccaf362.js → f0a667d8d33bc51c795d.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{29b09db309ff75fb3e97.js → f65d26588d2d80680a26.js} +1 -1
  49. package/assets/esri/core/workers/chunks/f72e6c903f55ce95a6c5.js +1 -0
  50. package/assets/esri/core/workers/chunks/f893e10d660e819cca45.js +1 -0
  51. package/assets/esri/core/workers/chunks/{878010ca23da0bca9405.js → fb1ed5ef2f95ab093346.js} +1 -1
  52. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  53. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  54. package/chunks/lyr3DMain.js +1 -1
  55. package/config.js +1 -1
  56. package/core/workers/registry.js +1 -1
  57. package/geometry/spatialReferenceEllipsoidUtils.js +1 -1
  58. package/kernel.js +1 -1
  59. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  60. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  61. package/layers/RouteLayer.d.ts +3 -3
  62. package/layers/support/ElevationQuery.js +1 -1
  63. package/layers/support/GeometryDescriptor.js +1 -1
  64. package/layers/support/layerUtils.d.ts +4 -0
  65. package/layers/support/types.d.ts +3 -2
  66. package/package.json +1 -1
  67. package/rest/featureService/FeatureService.d.ts +1 -1
  68. package/rest/featureService/types.d.ts +4 -4
  69. package/rest/geoprocessor/GPOptions.d.ts +5 -5
  70. package/rest/geoprocessor/execute.d.ts +6 -0
  71. package/rest/layerSources/DynamicDataLayer.d.ts +2 -2
  72. package/rest/layerSources/QueryTableDataSource.d.ts +1 -1
  73. package/rest/print.d.ts +1 -1
  74. package/rest/support/ClosestFacilityParameters.d.ts +3 -3
  75. package/rest/support/ClosestFacilitySolveResult.d.ts +2 -2
  76. package/rest/support/Query.d.ts +2 -2
  77. package/rest/support/RouteParameters.d.ts +2 -5
  78. package/rest/support/RouteResult.d.ts +1 -1
  79. package/rest/support/ServiceAreaParameters.d.ts +1 -1
  80. package/rest/support/ServiceAreaSolveResult.d.ts +2 -2
  81. package/rest/support/types.d.ts +1 -1
  82. package/rest/symbolService.d.ts +2 -2
  83. package/support/revision.js +1 -1
  84. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  85. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementController.js +1 -1
  86. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  87. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  88. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  89. package/views/3d/analysis/support/measurementUtils.js +1 -1
  90. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  91. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  92. package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
  93. package/views/3d/interactive/visualElements/support/Segment.js +1 -1
  94. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  95. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  96. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  97. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  98. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  99. package/views/3d/webgl-engine/lib/Material.js +1 -1
  100. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  101. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  102. package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
  103. package/views/3d/webgl-engine/materials/VisualVariablePassParameters.js +1 -1
  104. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  105. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  106. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  107. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  108. package/views/support/MeasurementWorker.js +5 -0
  109. package/views/support/MeasurementWorkerHandle.js +5 -0
  110. package/views/support/automaticAreaMeasurementUtils.js +1 -1
  111. package/views/support/geodesicAreaMeasurementUtils.js +1 -1
  112. package/views/support/geodesicLengthMeasurementUtils.js +1 -1
  113. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  114. package/widgets/Directions/DirectionsViewModel.d.ts +2 -2
  115. package/widgets/Search/SearchResultRenderer.d.ts +0 -2
  116. package/widgets/Search/SearchSource.d.ts +2 -2
  117. package/widgets/Search/SearchViewModel.d.ts +6 -7
  118. package/widgets/Search/types.d.ts +4 -4
  119. package/assets/esri/core/workers/chunks/0367a8580fede8f804f9.js +0 -1
  120. package/assets/esri/core/workers/chunks/14f4f5b7549cea7b5a6a.js +0 -1
  121. package/assets/esri/core/workers/chunks/1b475593c80d7bccdda5.js +0 -1
  122. package/assets/esri/core/workers/chunks/27ec8688f72130239b98.js +0 -1
  123. package/assets/esri/core/workers/chunks/2dd347aa2a061d536e69.js +0 -1
  124. package/assets/esri/core/workers/chunks/2f6fa33692478e99d24b.js +0 -1
  125. package/assets/esri/core/workers/chunks/3e7ea06b342e33bc48a5.js +0 -1
  126. package/assets/esri/core/workers/chunks/4387aaf9d5e8f6d1833d.js +0 -1
  127. package/assets/esri/core/workers/chunks/668a868fe2dcb6384ac9.js +0 -1
  128. package/assets/esri/core/workers/chunks/6acfa51b81e6f4255118.js +0 -1
  129. package/assets/esri/core/workers/chunks/6f8098f9fe233833245a.js +0 -1
  130. package/assets/esri/core/workers/chunks/76dbaef0d0794913f36f.js +0 -1
  131. package/assets/esri/core/workers/chunks/7c5218eae13d3bd30598.js +0 -1
  132. package/assets/esri/core/workers/chunks/7fc09382f934e9223a9b.js +0 -1
  133. package/assets/esri/core/workers/chunks/822ef6a043c7e147b4b6.js +0 -1
  134. package/assets/esri/core/workers/chunks/980313a6c35e79812d17.js +0 -1
  135. package/assets/esri/core/workers/chunks/9c157c0eeadb824ad01e.js +0 -1
  136. package/assets/esri/core/workers/chunks/a39ac9127a215d14d412.js +0 -1
  137. package/assets/esri/core/workers/chunks/a893f8db2477cf677ac8.js +0 -1
  138. package/assets/esri/core/workers/chunks/a95e28ade258b144cbb5.js +0 -1
  139. package/assets/esri/core/workers/chunks/abcee7cfd53cfe1d91e9.js +0 -1
  140. package/assets/esri/core/workers/chunks/b9f0d313f59fc7c43560.js +0 -1
  141. package/assets/esri/core/workers/chunks/bbe2eaef7edfa33b6eea.js +0 -1
  142. package/assets/esri/core/workers/chunks/bfdf646d4c8f175a4236.js +0 -1
  143. package/assets/esri/core/workers/chunks/d749aa62ad694147aebe.js +0 -1
  144. package/assets/esri/core/workers/chunks/d7d9656b990ce8be2152.js +0 -1
  145. package/assets/esri/core/workers/chunks/d8a7004c399d539aed09.js +0 -1
  146. package/assets/esri/core/workers/chunks/df92239eefff04471a0b.js +0 -1
  147. package/assets/esri/core/workers/chunks/ee2ca25048a920e43743.js +0 -1
  148. package/assets/esri/core/workers/chunks/eeb24a4ab4993f1f4e8e.js +0 -1
  149. package/assets/esri/core/workers/chunks/fe5d2735f057c7789f4b.js +0 -1
  150. package/views/support/GeodesicMeasurementWorker.js +0 -5
  151. package/views/support/GeodesicMeasurementWorkerHandle.js +0 -5
@@ -1,4 +1,4 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2206],{2495:(e,t,r)=>{r.d(t,{$U:()=>Ce,fs:()=>Ee,ty:()=>Ae});var i=r(38954),n=r(51850),o=r(49255),a=r(25634),s=r(11725),l=r(70328),c=r(620);class d{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const u=(0,l.vt)(),h=(0,n.vt)();function m(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.h)(t,1/e[0],1/e[1],1/e[2])}(r,h);if((0,l.Ne)(u,e.bbMin),(0,l.vI)(u,e.bbMax),null!=o&&o.applyToAabb(u),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(u,t,c,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>M){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],v=t[1],g=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],w=o[i+1],b=o[i+2];const y=a*n[r+1];let M=o[y],C=o[y+1],S=o[y+2];const E=a*n[r+2];let A=o[E],I=o[E+1],R=o[E+2];null!=l&&([c,w,b]=l.applyToVertex(c,w,b,e),[M,C,S]=l.applyToVertex(M,C,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const O=M-c,F=C-w,P=S-b,D=A-c,H=I-w,N=R-b,z=v*N-H*g,L=g*D-N*f,B=f*H-D*v,V=O*z+F*L+P*B;if(Math.abs(V)<=T)continue;const U=u-c,G=h-w,j=m-b,W=U*z+G*L+j*B;if(V>0){if(W<0||W>V)continue}else if(W>0||W<V)continue;const k=G*P-F*j,$=j*O-P*U,Z=U*F-O*G,q=f*k+v*$+g*Z;if(V>0){if(q<0||W+q>V)continue}else if(q>0||W+q<V)continue;const Y=(D*k+H*$+N*Z)/V;Y>=0&&d(Y,t,_?x(O,F,P,D,H,N,p):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const p=(0,n.vt)();function f(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=o*t,v=n[f],g=n[f+1],_=n[f+2],w=o*r,b=o*i,y=n[w]-v,M=n[w+1]-g,C=n[w+2]-_,S=n[b]-v,E=n[b+1]-g,A=n[b+2]-_,I=h*A-E*m,R=m*S-A*u,O=u*E-S*h,F=y*I+M*R+C*O;if(Math.abs(F)<=T)continue;const P=l-v,D=c-g,H=d-_,N=P*I+D*R+H*O;if(F>0){if(N<0||N>F)continue}else if(N>0||N<F)continue;const z=D*C-M*H,L=H*y-C*P,B=P*M-y*D,V=u*z+h*L+m*B;if(F>0){if(V<0||N+V>F)continue}else if(V>0||N+V<F)continue;const U=(S*z+E*L+A*B)/F;U>=0&&s(U,e,a?x(y,M,C,S,E,A,p):null)}}const v=(0,n.vt)(),g=(0,n.vt)(),_=(0,n.vt)();function x(e,t,r,n,o,a,s){return(0,i.h)(b,e,t,r),(0,i.h)(y,n,o,a),(0,i.f)(s,b,y),(0,i.n)(s,s),s}function w(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(y,e[2],e[0]),(0,i.f)(p,b,y),(0,i.n)(p,p),p}const b=(0,n.vt)(),y=(0,n.vt)(),M=1e3,T=1e-7,C=(0,n.vt)(),S=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var E=r(16396),A=r(13030),I=r(59907);class R{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,I.vJ)(r,i,this.layout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.layout.createView(e).getField("position",A.xs);if(null==l)return;const c=(0,i.a)(O,a,o),d=l.count/3,u=n.options.normalRequired;f(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,n.vt)();var F=r(43616),P=r(31635),D=r(91429),H=r(91829),N=r(4431),z=r(1843),L=r(72824),B=r(13840),V=r(42958),U=r(16943),G=r(33524);const j={mask:255},W={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var $=r(4576),Z=r(44208);r(53966),r(34275),r(94656),r(63907),(0,Z.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(77690),K=r(29242),J=r(58083),Q=r(9093),ee=r(32728);class te{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",A.Eq),this.color=e.getField("instanceColor",A.XP),this.olidColor=e.getField("instanceOlidColor",A.XP),this.state=e.getField("state",A.SL),this.lodLevel=e.getField("lodLevel",A.SL)}}let re=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return ne(ie.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ce,this._buffer=this._layout.createBuffer(this._capacity),this._view=new te(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=oe,n=ae;t.localTransform.getMat(e,se),t.globalTransform.getMat(e,le);const o=(0,J.lw)(le,le,se);(0,i.h)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,X.z0)(n,o),t.model.setMat(e,n);const a=(0,ee.wp)(oe,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,X.B8)(n,n),(0,X.mg)(n,n),t.modelNormal.setMat(e,n),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,ae),r.modelOrigin.getVec(e,oe),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=oe[0],t[13]=oe[1],t[14]=oe[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(oe,this,e),t*=Math.max(oe[0],oe[1],oe[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(oe,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(oe[0],oe[1],oe[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ce,Math.floor(this._capacity*$.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new te(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,P.Cg)([(0,D.MZ)({constructOnly:!0})],re.prototype,"shaderTransformation",void 0),(0,P.Cg)([(0,D.MZ)()],re.prototype,"_size",void 0),(0,P.Cg)([(0,D.MZ)({readOnly:!0})],re.prototype,"size",null),re=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],re);const ie=(0,z.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function ne(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,U.E)()&&e.vec4u8("instanceOlidColor"),e}const oe=(0,n.vt)(),ae=(0,K.vt)(),se=(0,Q.vt)(),le=(0,Q.vt)(),ce=64,de=(0,z.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var ue=r(74810),he=r(28491),me=r(90644),pe=r(49788);class fe extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ue.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,H.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=pe.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;let ve=class extends V.w{constructor(e,t){let i=(0,N.U)(xe(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,N.U)(function(e){return ne(de.clone(),e)}(t)))),super(e,t,i),this.shader=new B.r(he.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,hasEmission:n,transparent:a,cullFace:s,customDepthTest:l,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,o._o)(i)&&a?(0,G.Yf)(r):null,culling:_e(e)?(0,me.Xt)(s):null,depthTest:(0,G.mt)(r,ge(l)),depthWrite:(0,G.z5)(e),drawBuffers:(0,V.L)(i,(0,G.Sv)(r,n)),colorWrite:me.kn,stencilWrite:c?j:null,stencilTest:c?t?k:W:null,polygonOffset:(0,G.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function ge(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function _e(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function xe(e){const t=(0,z.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,U.E)()&&t.vec4u8("olidColor"),t}ve=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],ve);var we=r(51976),be=r(99550);class ye extends be.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,P.Cg)([(0,we.W)({count:4})],ye.prototype,"alphaDiscardMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"doubleSidedMode",void 0),(0,P.Cg)([(0,we.W)({count:7})],ye.prototype,"pbrMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"cullFace",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"normalType",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"customDepthTest",void 0),(0,P.Cg)([(0,we.W)({count:8})],ye.prototype,"emissionSource",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasSymbolColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVerticalOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexTangents",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instanced",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedDoublePrecision",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasModelTransformation",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"offsetBackfaces",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveShadows",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveAmbientOcclusion",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"textureAlphaPremultiplied",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedFeatureAttribute",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"writeDepth",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"transparent",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"enableOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"terrainDepthTest",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"cullAboveTerrain",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"snowCover",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasEmissionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Me=r(57323);let Te=class extends ve{constructor(){super(...arguments),this.shader=new B.r(Me.R,()=>r.e(2314).then(r.bind(r,39933)))}};Te=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Te);class Ce extends s.i{constructor(e,t){super(e,Ee),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,o.iq)(e)||(0,o.yT)(e))&&!this.transparent],[4,e=>((0,o.iq)(e)||(0,o.yT)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,o.iq)(e)||(0,o.yT)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=xe(this.parameters),this._configuration=new ye(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=pe.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.m)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,o._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.h)(De,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(Fe,De);break;case 2:a=(0,i.d)(Fe,Oe)}const s=(0,i.e)(He,De,e.eye),l=(0,i.b)(s),c=(0,i.j)(s,s,1/l);let d=null;this.parameters.screenSizePerspective&&(d=(0,i.g)(a,c));const u=(0,F.kE)(e,l,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective,null);(0,i.j)(a,a,u),(0,i.t)(Pe,a,r.transform.inverseRotation),n=(0,i.e)(Ie,n,Pe),o=(0,i.e)(Re,o,Pe)}!function(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(C,n,r),l=(e,t,r)=>a(e,r,t),{tolerance:u}=t,h=new d(u,!1,t.options.normalRequired);if(e.boundingInfo)(0,c.vA)(0===e.type),m(e.boundingInfo,r,s,u,o,h,l);else{const t=e.positionAttribute,n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=S,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),x=m>=p?m>=f?0:2:p>=f?1:2,b=x,y=u[b]<0?2:1,M=(x+y)%3,T=(x+(3-y))%3,C=u[M]/u[b],E=u[T]/u[b],A=1/u[b],I=v,R=g,O=_,{normalRequired:F}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.h)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.h)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.h)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(O,h[2],e);const m=I[M]-C*I[b],p=I[T]-E*I[b],f=R[M]-C*R[b],v=R[T]-E*R[b],g=O[M]-C*O[b],_=O[T]-E*O[b],x=g*v-_*f,y=m*_-p*g,S=f*p-v*m;if((x<0||y<0||S<0)&&(x>0||y>0||S>0))continue;const P=x+y+S;if(0===P)continue;const D=x*(A*I[b])+y*(A*R[b])+S*(A*O[b]);if(D*Math.sign(P)<0)continue;const H=D/P;H>=0&&d(H,t,F?w(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,h,l)}}(e,r,n,o,(0,E.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Se(e)}createBufferWriter(){return new R(this._layout)}get transparent(){return Ae(this.parameters)}}class Se extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.h)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Te:ve,e)}}class Ee extends fe{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ae(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Ie=(0,n.vt)(),Re=(0,n.vt)(),Oe=(0,n.fA)(0,0,1),Fe=(0,n.vt)(),Pe=(0,n.vt)(),De=(0,n.vt)(),He=(0,n.vt)()},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.j)(h,this.ray.direction,this.distance),(0,o.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.j)(h,this.ray.direction,this.distance),(0,o.i)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.d)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,o.d)(e,m),(0,o.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>o});var i=r(33094),n=r(31821);function o(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[2206],{2495:(e,t,r)=>{r.d(t,{$U:()=>Ce,fs:()=>Ee,ty:()=>Ae});var i=r(38954),n=r(51850),o=r(49255),a=r(25634),s=r(11725),l=r(70328),c=r(620);class d{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const u=(0,l.vt)(),h=(0,n.vt)();function m(e,t,r,n,o,a,s){if(null==e)return;const c=function(e,t){return(0,i.h)(t,1/e[0],1/e[1],1/e[2])}(r,h);if((0,l.Ne)(u,e.bbMin),(0,l.vI)(u,e.bbMax),null!=o&&o.applyToAabb(u),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let a=Math.min(n,o),s=Math.max(n,o);const l=(e[1]-i-t[1])*r[1],c=(e[4]+i-t[1])*r[1];if(s=Math.min(s,Math.max(l,c)),s<0)return!1;if(a=Math.max(a,Math.min(l,c)),a>s)return!1;const d=(e[2]-i-t[2])*r[2],u=(e[5]+i-t[2])*r[2];return s=Math.min(s,Math.max(d,u)),!(s<0)&&(a=Math.max(a,Math.min(d,u)),!(a>s)&&a<1/0)}(e,t,r,i)}(u,t,c,n)){const{primitiveIndices:i,position:l}=e,c=i?i.length:l.indices.length/3;if(c>M){const i=e.getChildren();if(void 0!==i){for(const e of i)m(e,t,r,n,o,a,s);return}}!function(e,t,r,i,n,o,a,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],v=t[1],g=t[2],{normalRequired:_}=c;for(let e=0;e<i;++e){const t=s[e],r=3*t,i=a*n[r];let c=o[i],w=o[i+1],b=o[i+2];const y=a*n[r+1];let M=o[y],C=o[y+1],S=o[y+2];const E=a*n[r+2];let A=o[E],I=o[E+1],R=o[E+2];null!=l&&([c,w,b]=l.applyToVertex(c,w,b,e),[M,C,S]=l.applyToVertex(M,C,S,e),[A,I,R]=l.applyToVertex(A,I,R,e));const O=M-c,F=C-w,P=S-b,D=A-c,H=I-w,N=R-b,z=v*N-H*g,L=g*D-N*f,B=f*H-D*v,V=O*z+F*L+P*B;if(Math.abs(V)<=T)continue;const U=u-c,G=h-w,j=m-b,W=U*z+G*L+j*B;if(V>0){if(W<0||W>V)continue}else if(W>0||W<V)continue;const k=G*P-F*j,$=j*O-P*U,Z=U*F-O*G,q=f*k+v*$+g*Z;if(V>0){if(q<0||W+q>V)continue}else if(q>0||W+q<V)continue;const Y=(D*k+H*$+N*Z)/V;Y>=0&&d(Y,t,_?x(O,F,P,D,H,N,p):null)}}(t,r,0,c,l.indices,l.data,l.stride,i,o,a,s)}}const p=(0,n.vt)();function f(e,t,r,i,n,o,a,s){const l=e[0],c=e[1],d=e[2],u=t[0],h=t[1],m=t[2];for(let e=r;e<i;++e){const t=3*e,r=t+1,i=t+2,f=o*t,v=n[f],g=n[f+1],_=n[f+2],w=o*r,b=o*i,y=n[w]-v,M=n[w+1]-g,C=n[w+2]-_,S=n[b]-v,E=n[b+1]-g,A=n[b+2]-_,I=h*A-E*m,R=m*S-A*u,O=u*E-S*h,F=y*I+M*R+C*O;if(Math.abs(F)<=T)continue;const P=l-v,D=c-g,H=d-_,N=P*I+D*R+H*O;if(F>0){if(N<0||N>F)continue}else if(N>0||N<F)continue;const z=D*C-M*H,L=H*y-C*P,B=P*M-y*D,V=u*z+h*L+m*B;if(F>0){if(V<0||N+V>F)continue}else if(V>0||N+V<F)continue;const U=(S*z+E*L+A*B)/F;U>=0&&s(U,e,a?x(y,M,C,S,E,A,p):null)}}const v=(0,n.vt)(),g=(0,n.vt)(),_=(0,n.vt)();function x(e,t,r,n,o,a,s){return(0,i.h)(b,e,t,r),(0,i.h)(y,n,o,a),(0,i.f)(s,b,y),(0,i.n)(s,s),s}function w(e){return(0,i.a)(b,e[1],e[0]),(0,i.a)(y,e[2],e[0]),(0,i.f)(p,b,y),(0,i.n)(p,p),p}const b=(0,n.vt)(),y=(0,n.vt)(),M=1e3,T=1e-7,C=(0,n.vt)(),S=[(0,n.vt)(),(0,n.vt)(),(0,n.vt)()];var E=r(16396),A=r(13030),I=r(59907);class R{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return(0,I.vJ)(r,i,this.layout,e,t,n,o)}intersect(e,t,r,n,o,a,s){const l=this.layout.createView(e).getField("position",A.xs);if(null==l)return;const c=(0,i.a)(O,a,o),d=l.count/3,u=n.options.normalRequired;f(o,c,0,d,l.typedBuffer,l.typedBufferStride,u,(e,t,r)=>s(e,r,t))}}const O=(0,n.vt)();var F=r(43616),P=r(31635),D=r(91429),H=r(91829),N=r(4431),z=r(1843),L=r(72824),B=r(13840),V=r(42958),U=r(16943),G=r(33524);const j={mask:255},W={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},k={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var $=r(4576),Z=r(44208);r(53966),r(34275),r(94656),r(63907),(0,Z.A)("esri-tests-disable-gpu-memory-measurements");var q=r(69622),Y=r(65529),X=r(77690),K=r(29242),J=r(58083),Q=r(9093),ee=r(32728);class te{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",A.Eq),this.color=e.getField("instanceColor",A.XP),this.olidColor=e.getField("instanceOlidColor",A.XP),this.state=e.getField("state",A.SL),this.lodLevel=e.getField("lodLevel",A.SL)}}let re=class extends q.A{constructor(e,t){super(e),this.events=new Y.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return ne(ie.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=ce,this._buffer=this._layout.createBuffer(this._capacity),this._view=new te(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,c.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=oe,n=ae;t.localTransform.getMat(e,se),t.globalTransform.getMat(e,le);const o=(0,J.lw)(le,le,se);(0,i.h)(r,o[12],o[13],o[14]),t.modelOrigin.setVec(e,r),(0,X.z0)(n,o),t.model.setMat(e,n);const a=(0,ee.wp)(oe,o);a.sort(),t.modelScaleFactors.set(e,0,a[1]),t.modelScaleFactors.set(e,1,a[2]),(0,X.B8)(n,n),(0,X.mg)(n,n),t.modelNormal.setMat(e,n),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,ae),r.modelOrigin.getVec(e,oe),t[0]=ae[0],t[1]=ae[1],t[2]=ae[2],t[3]=0,t[4]=ae[3],t[5]=ae[4],t[6]=ae[5],t[7]=0,t[8]=ae[6],t[9]=ae[7],t[10]=ae[8],t[11]=0,t[12]=oe[0],t[13]=oe[1],t[14]=oe[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(oe,this,e),t*=Math.max(oe[0],oe[1],oe[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(oe,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(oe[0],oe[1],oe[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max(ce,Math.floor(this._capacity*$.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new te(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,P.Cg)([(0,D.MZ)({constructOnly:!0})],re.prototype,"shaderTransformation",void 0),(0,P.Cg)([(0,D.MZ)()],re.prototype,"_size",void 0),(0,P.Cg)([(0,D.MZ)({readOnly:!0})],re.prototype,"size",null),re=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],re);const ie=(0,z.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function ne(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,U.E)()&&e.vec4u8("instanceOlidColor"),e}const oe=(0,n.vt)(),ae=(0,K.vt)(),se=(0,Q.vt)(),le=(0,Q.vt)(),ce=64,de=(0,z.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var ue=r(74810),he=r(28491),me=r(90644),pe=r(49788);class fe extends L.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=ue.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=n.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,n.CN)(.2,.2,.2),this.diffuse=(0,n.CN)(.8,.8,.8),this.externalColor=(0,H.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,n.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=pe.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}L.gy;let ve=class extends V.w{constructor(e,t){let i=(0,N.U)(xe(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,N.U)(function(e){return ne(de.clone(),e)}(t)))),super(e,t,i),this.shader=new B.r(he.D,()=>r.e(5141).then(r.bind(r,5141)))}_makePipeline(e,t){const{oitPass:r,output:i,hasEmission:n,transparent:a,cullFace:s,customDepthTest:l,hasOccludees:c}=e;return(0,me.Ey)({blending:(0,o._o)(i)&&a?(0,G.Yf)(r):null,culling:_e(e)?(0,me.Xt)(s):null,depthTest:(0,G.mt)(r,ge(l)),depthWrite:(0,G.z5)(e),drawBuffers:(0,V.L)(i,(0,G.Sv)(r,n)),colorWrite:me.kn,stencilWrite:c?j:null,stencilTest:c?t?k:W:null,polygonOffset:(0,G.mE)(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function ge(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function _e(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function xe(e){const t=(0,z.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,U.E)()&&t.vec4u8("olidColor"),t}ve=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],ve);var we=r(51976),be=r(99550);class ye extends be.E{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,P.Cg)([(0,we.W)({count:4})],ye.prototype,"alphaDiscardMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"doubleSidedMode",void 0),(0,P.Cg)([(0,we.W)({count:7})],ye.prototype,"pbrMode",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"cullFace",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"normalType",void 0),(0,P.Cg)([(0,we.W)({count:3})],ye.prototype,"customDepthTest",void 0),(0,P.Cg)([(0,we.W)({count:8})],ye.prototype,"emissionSource",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasSymbolColors",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVerticalOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTexture",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasScreenSizePerspective",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVertexTangents",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOccludees",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instanced",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedDoublePrecision",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasModelTransformation",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"offsetBackfaces",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVSize",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasVVColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveShadows",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"receiveAmbientOcclusion",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"textureAlphaPremultiplied",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedFeatureAttribute",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"instancedColor",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"writeDepth",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"transparent",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"enableOffset",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"terrainDepthTest",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"cullAboveTerrain",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"snowCover",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasColorTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasEmissionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasNormalTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasOcclusionTextureTransform",void 0),(0,P.Cg)([(0,we.W)()],ye.prototype,"hasMetallicRoughnessTextureTransform",void 0);var Me=r(57323);let Te=class extends ve{constructor(){super(...arguments),this.shader=new B.r(Me.R,()=>r.e(2314).then(r.bind(r,39933)))}};Te=(0,P.Cg)([(0,D.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],Te);class Ce extends s.i{constructor(e,t){super(e,Ee),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,o.iq)(e)||(0,o.yT)(e))&&!this.transparent],[4,e=>((0,o.iq)(e)||(0,o.yT)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,o.iq)(e)||(0,o.yT)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=xe(this.parameters),this._configuration=new ye(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=pe.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,i.m)(this.parameters.emissiveBaseColor,n.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:a,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:a&&"normal"===s?1:a&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,o._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.oitPass=t.oitPass,i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,n,o,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,i.h)(De,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case 1:a=(0,i.n)(Fe,De);break;case 2:a=(0,i.d)(Fe,Oe)}const s=(0,i.e)(He,De,e.eye),l=(0,i.b)(s),c=(0,i.j)(s,s,1/l);let d=null;this.parameters.screenSizePerspective&&(d=(0,i.g)(a,c));const u=(0,F.kE)(e,l,this.parameters.verticalOffset,d??0,this.parameters.screenSizePerspective,null);(0,i.j)(a,a,u),(0,i.t)(Pe,a,r.transform.inverseRotation),n=(0,i.e)(Ie,n,Pe),o=(0,i.e)(Re,o,Pe)}!function(e,t,r,n,o,a){if(!e.visible)return;const s=(0,i.a)(C,n,r),l=(e,t,r)=>a(e,r,t),{tolerance:u}=t,h=new d(u,!1,t.options.normalRequired);if(e.boundingInfo)(0,c.vA)(0===e.type),m(e.boundingInfo,r,s,u,o,h,l);else{const t=e.positionAttribute,n=t.indices;!function(e,t,r,n,o,a,s,l,c,d){const u=t,h=S,m=Math.abs(u[0]),p=Math.abs(u[1]),f=Math.abs(u[2]),x=m>=p?m>=f?0:2:p>=f?1:2,b=x,y=u[b]<0?2:1,M=(x+y)%3,T=(x+(3-y))%3,C=u[M]/u[b],E=u[T]/u[b],A=1/u[b],I=v,R=g,O=_,{normalRequired:F}=c;for(let t=r;t<n;++t){const r=3*t,n=s*o[r];(0,i.h)(h[0],a[n+0],a[n+1],a[n+2]);const c=s*o[r+1];(0,i.h)(h[1],a[c+0],a[c+1],a[c+2]);const u=s*o[r+2];(0,i.h)(h[2],a[u+0],a[u+1],a[u+2]),l&&((0,i.d)(h[0],l.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,i.d)(h[1],l.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,i.d)(h[2],l.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,i.a)(I,h[0],e),(0,i.a)(R,h[1],e),(0,i.a)(O,h[2],e);const m=I[M]-C*I[b],p=I[T]-E*I[b],f=R[M]-C*R[b],v=R[T]-E*R[b],g=O[M]-C*O[b],_=O[T]-E*O[b],x=g*v-_*f,y=m*_-p*g,S=f*p-v*m;if((x<0||y<0||S<0)&&(x>0||y>0||S>0))continue;const P=x+y+S;if(0===P)continue;const D=x*(A*I[b])+y*(A*R[b])+S*(A*O[b]);if(D*Math.sign(P)<0)continue;const H=D/P;H>=0&&d(H,t,F?w(h):null)}}(r,s,0,n.length/3,n,t.data,t.stride,o,h,l)}}(e,r,n,o,(0,E.ou)(r.verticalOffset),a)}createGLMaterial(e){return new Se(e)}createBufferWriter(){return new R(this._layout)}get transparent(){return Ae(this.parameters)}}class Se extends a.m8{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,i.h)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?Te:ve,e)}}class Ee extends fe{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function Ae(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:a,textureAlphaMode:s,colorMixMode:l}=e,c=i[3];return t||r<1&&"replace"!==l||c<1&&"ignore"!==l||n<1||(null!=o||null!=a)&&1!==s&&2!==s&&"replace"!==l}const Ie=(0,n.vt)(),Re=(0,n.vt)(),Oe=(0,n.fA)(0,0,1),Fe=(0,n.vt)(),Pe=(0,n.vt)(),De=(0,n.vt)(),He=(0,n.vt)()},6867:(e,t,r)=>{r.d(t,{i:()=>d});var i=r(58083),n=r(9093),o=r(38954),a=r(51850),s=r(87317),l=r(91829),c=r(71351);class d{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,o.j)(h,this.ray.direction,this.distance),(0,o.b)(h))}withinDistance(e){return!!u(this)&&this.distanceInRenderSpace<=e}getIntersectionPoint(e){return!!u(this)&&((0,o.j)(h,this.ray.direction,this.distance),(0,o.i)(e,this.ray.origin,h),!0)}getTransformedNormal(e){return(0,o.d)(m,this.normal),m[3]=0,(0,s.t)(m,m,this.transformation),(0,o.d)(e,m),(0,o.n)(e,e)}constructor(e){this.intersector=4,this.normal=(0,a.vt)(),this.transformation=(0,n.vt)(),this._ray=(0,c.vt)(),this.init(e)}init(e){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,c.C)(e,this._ray)}set(e,t,r,s,l,c,d){this.intersector=e,this.distance=r,(0,o.d)(this.normal,s??a.Cb),(0,i.C)(this.transformation,l??n.zK),this.target=t,this.drapedLayerOrder=c,this.renderPriority=d}copy(e){(0,c.C)(e.ray,this._ray),this.intersector=e.intersector,this.distance=e.distance,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.renderPriority=e.renderPriority,(0,o.d)(this.normal,e.normal),(0,i.C)(this.transformation,e.transformation)}}function u(e){return null!=e?.distance}const h=(0,a.vt)(),m=(0,l.vt)()},10906:(e,t,r)=>{r.d(t,{b:()=>o});var i=r(33094),n=r(31821);function o(e,t){t.snowCover&&(e.uniforms.add(new i.U("snowCover",e=>e.snowCover)).code.add(n.H`float getSnow(vec3 normal, vec3 groundNormal) {
2
2
  return smoothstep(0.5, 0.55, dot(normal, groundNormal)) * snowCover;
3
3
  }
4
4
  float getRealisticTreeSnow(vec3 faceNormal, vec3 shadingNormal, vec3 groundNormal) {
@@ -8,7 +8,7 @@ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
8
8
  return snow * snowCover;
9
9
  }`),e.code.add(n.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
10
10
  return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
11
- }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),n=r(49255),o=r(99550),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new o.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,n._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"uint":i=f._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])}, ${f._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>vt});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,o.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,g.GB)(e.x||0),n.y=(0,g.GB)(e.y||0),n.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,o.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,o.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,o.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(71351)),R=r(69622),O=r(53966),F=r(90629),P=r(58083),D=r(48163),H=r(87317),N=r(91829),z=r(82919),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var U;let G=U=class extends R.A{constructor(e){super(e),this._ray=(0,I.vt)(),this._viewport=(0,N.fA)(0,0,1,1),this._padding=(0,N.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,D.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,z.vt)(),this._fullViewport=(0,N.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,P.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,H.s)((0,N.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,H.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,H.s)((0,N.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,H.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,H.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,H.f)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,P.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,P.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.B)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,P.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,P.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,P.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,P.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,H.f)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,H.f)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,P.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,z.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,P.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,H.f)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new U).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,H.a)(this._viewport,e.viewport)&&(0,H.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,H.g)(e.screenPadding,this.screenPadding)>=t||(0,H.g)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.H)(k),n=(0,M.H)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,M.G)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,H.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,H.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,H.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,P.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,P.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,H.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,n,o)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.C)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):O.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,z.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,P.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"relativeElevation",void 0),G=U=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],G);const j=(0,N.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)();var q=r(5443),Y=r(39829),X=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Q,t[0],t[0])&&J(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Q,t[r],i)){case 1:J(e,i);break;case 3:J(e,(0,D.o8)(Q));break;case 2:J(e,(0,D.o8)(Q)),J(e,i)}}}}function J(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const Q=(0,D.vt)();var ee=r(11964),te=r(27921);const re=(0,T.vt)(),ie=(0,T.vt)();function ne(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function oe(e,t,r,i,n){let o=(0,M.n)(re,e),s=(0,M.g)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(o,t),l&&(0,M.j)(o,o,-1)):o=null);let c=0;if(o){(0,M.j)(ie,i,(0,M.g)(i,o)),(0,M.e)(o,o,ie);const e=(0,M.g)(o,n)/((0,M.b)(o)*(0,M.b)(n));(0,M.f)(ie,o,n),c=((0,M.g)(ie,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function ae(e,t,r,i){(0,M.e)(se,r,t),(0,te.T7)(i,(0,ee.LV)(t,se),e)||e===r||(0,M.d)(e,r)}const se=(0,T.vt)(),le=(0,T.fA)(0,1,0),ce=(0,T.fA)(0,0,1),de=(0,y.vt)(),ue=(0,T.vt)(),he=(0,T.vt)();function me(e,t,r,i=ne()){const{direction:n,up:o}=i;return(0,P.N9)(de,-(0,a.kU)(t)),(0,P.eL)(de,de,(0,a.kU)(r)),(0,M.p)(n,ce,de),(0,M.j)(n,n,-1),(0,M.p)(o,le,de),i}function pe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,M.c)(e,i,o,a)}const fe=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return oe(t,r,i,ce,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,T.vt)();return(0,M.j)(o,n.direction,-t),(0,M.i)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,I.LV)(t.origin,t.direction),n,fe)||pe(fe,r,i,t.endpoint,n),ae(fe,a,fe,l),s.push((0,D.fA)(fe[0],fe[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(fe,e[0],e[1],0),t.fromRenderCoords(fe,fe,r),[fe[0],fe[1]]));return i.length<=2?new Y.A({spatialReference:r}):(i.push(i[0].slice()),(0,X.$3)(i)||i.reverse(),new Y.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,ue,o),(0,S.g)(t,he,o),ue[0]-=r/2,he[0]+=r/2,ue[1]-=i/2,he[1]+=i/2,(0,E.F)(ue,o,ue,a),(0,E.F)(he,o,he,a),n?(n.xmin=ue[0],n.ymin=ue[1],n.xmax=he[0],n.ymax=he[1],n.spatialReference=a):n=new q.A(ue[0],ue[1],he[0],he[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),ge=r(17136),_e=r(94008),xe=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,z.vt)(),this._points=(0,z.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._boundingSphere=new _e.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,z.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,z.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,z.m7)(this.frustum,e)}intersectsRay(e){return(0,z.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,z.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,z.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=Me;(0,M.n)(t,this.direction);const r=ye;(0,M.a)(r,this.points[4],e);const i=.5*(0,M.g)(r,r)/(0,M.g)(t,r),n=this._boundingSphere,o=(0,M.c)(Te,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=z.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,M.C)(e.direction,t,r)}const ye=(0,T.vt)(),Me=(0,T.vt)(),Te=(0,T.vt)();r(86211);const Ce=(0,T.fA)(5802e-9,13558e-9,331e-7),Se=(0,T.fA)(65e-8*3,5643e-9,255e-9);(0,T.fA)(Ce[0]+Se[0],Ce[1]+Se[1],Ce[2]+Se[2]);class Ee{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ee(0,0)}static{this.Infinite=new Ee}}(0,T.vt)(),(0,T.vt)(),new _e.iy,(0,I.vt)();var Ae=r(32728);const Ie=(0,T.fA)(0,0,1),Re=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Oe=(0,y.vt)(),Fe=(0,T.vt)(),Pe=(0,T.vt)();function De(e,t,r,i=ne()){(0,M.f)(Fe,e,Ie),0===(0,M.g)(Fe,Fe)&&(0,M.f)(Fe,e,Re),(0,P.$0)(Oe,-(0,a.kU)(t),e),(0,P.e$)(Oe,Oe,-(0,a.kU)(r),Fe);const{up:n,direction:o}=i;return(0,M.f)(n,Fe,e),(0,M.n)(n,n),(0,M.p)(n,n,Oe),(0,M.n)(o,e),(0,M.q)(o,o),(0,M.p)(o,o,Oe),i}function He(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=De(t,e.heading,e.tilt);return e.up=r.up,e}function ze(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,ee.Cr)(a,s,ke),c=(0,te.vE)(t,l.origin,l.vector,0,je);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,te.Qj)(t),d=(0,M.c)((0,T.vt)(),je,l,e*n),u=(0,M.c)((0,T.vt)(),je,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Be=(0,T.fA)(1,0,0),Ve=(0,T.fA)(0,1,0),Ue=(0,T.vt)(),Ge=(0,T.vt)(),je=(0,T.vt)(),We=new _e.iy,ke=(0,ee.vt)(),$e=(0,N.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Fe,o=Pe;return(0,M.n)(n,e),(0,M.f)(Pe,n,Ie),0===(0,M.g)(Pe,Pe)&&(0,M.f)(Pe,n,Re),(0,M.f)(o,Pe,n),oe(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,T.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(o);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-o[1]*o[1]);if(b<0)return(0,M.j)(n.eye,o,f/p),n.tilt=0,Ne(n,e);const y=Math.sqrt(b),C=o[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,M.j)(n.eye,o,f/p),n.tilt=0,He(n.eye),Ne(n,e);n.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,P=Math.sqrt(F),D=_*O+A-2*R*P*x+F*w;return Math.abs(D)<1e-8?((0,M.j)(n.eye,o,f/p),n.tilt=0,He(n.eye),Ne(n,e)):(n.eye[0]=(F*(f*o[0]-v*o[0])-I*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(F*(f*o[2]-v*o[2])-I*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,M.j)(n.eye,n.eye,f),He(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,M.b)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:De,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.B)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=Le,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=n.planes[5],b=[],y=(0,te.O_)(T.uY,Be,(0,te.vt)()),C=(0,te.O_)(T.uY,Ve,(0,te.vt)());(0,H.c)($e,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Ge,s.origin,l.origin,u),m=(0,Ae.nu)(s.direction,l.direction,u,Ue);r.intersectManifoldClosestSilhouette((0,I.LV)(h,m),o,je),ae(je,c,je,w),b.push((0,T.o8)(je)),0!==b.length&&S((0,M.G)(b.at(-1),je));const p=((0,te.Tj)(y,je)?1:0)|((0,te.Tj)(C,je)?2:0);$e[p]=1}}b.length>2&&(0,M.G)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,je,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,je[1]]),n.push([null,je[1]]),o=!0):n.push([je[0],je[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,X.$3)(n)||n.reverse(),n})}((0,H.d)($e)>1?function(e,t){const r=[];for(const i of e)r.push(...ze(i,t));return r}(ze(b,y),C):[b],r,s);return new Y.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=ge.Y_.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new q.A(o,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ze="ssao";(0,T.vt)();var qe=r(49186),Ye=r(10107),Xe=r(64108);let Ke=class extends R.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new qe.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"view",void 0),(0,o.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"consumes",void 0),(0,o.Cg)([(0,Ye.MZ)()],Ke.prototype,"produces",void 0),(0,o.Cg)([(0,Ye.MZ)({readOnly:!0})],Ke.prototype,"techniques",null),Ke=(0,o.Cg)([(0,Xe.$)("esri.views.3d.webgl.RenderNode")],Ke);var Je=r(13840),Qe=r(42958),et=r(95774),tt=r(90644);let rt=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(et.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};rt=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],rt);var it=r(65786);class nt extends it.Y{constructor(){super(...arguments),this.projScale=1}}class ot extends nt{constructor(){super(...arguments),this.intensity=1}}class at extends it.Y{}class st extends at{constructor(){super(...arguments),this.blurSize=(0,D.vt)()}}var lt=r(15581);let ct=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(lt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};ct=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],ct);var dt=r(63907),ut=r(76284),ht=r(67171);const mt=2;let pt=class extends Ke{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=Ze,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new ot,this._drawParameters=new st}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ht.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new ut.A(this.renderingContext,t,e),this.techniques.precompile(ct),this.techniques.precompile(rt),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(dt.nI);if(!r||!i)return;const n=this.techniques.get(ct),o=this.techniques.get(rt);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ft/(0,lt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/mt),b=Math.round(_/mt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,mt/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,Ze,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,mt/g,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,o.Cg)([(0,d.MZ)()],pt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],pt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],pt.prototype,"isEnabled",void 0),pt=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],pt);const ft=.5;function vt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/mt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
11
+ }`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),n=r(49255),o=r(99550),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return!1}getConfiguration(e,t,r=new o.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,n._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},11868:(e,t,r)=>{r.d(t,{Wz:()=>o,oe:()=>n});var i=r(34275);function n(e,t=!1){return e<=i.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function o(e){return(Array.isArray(e)?e.length:e.byteLength/8)<=i.y9?Array.from(e):new Float32Array(e)}},12791:(e,t,r)=>{r.d(t,{x:()=>n});var i=r(74333);class n extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),a=n.code.generateSource(),s=n.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=n.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let a=0;a<i;++a)r[a](e,o,t,n)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"uint":i=f._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToUintStr(r[0])}, ${f._numberToUintStr(r[1])}, ${f._numberToUintStr(r[2])}, ${f._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>n});var i=r(74333);class n extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,n)=>i.setUniform4fv(e,t(n),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>vt});var i=r(31821),n=r(12791),o=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,o.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,g.GB)(e.x||0),n.y=(0,g.GB)(e.y||0),n.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,o.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,o.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,o.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,o.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,o.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(71351)),R=r(69622),O=r(53966),F=r(90629),P=r(58083),D=r(48163),H=r(87317),N=r(91829),z=r(82919),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var U;let G=U=class extends R.A{constructor(e){super(e),this._ray=(0,I.vt)(),this._viewport=(0,N.fA)(0,0,1,1),this._padding=(0,N.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,D.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,z.vt)(),this._fullViewport=(0,N.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,P.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,H.s)((0,N.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,H.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,H.s)((0,N.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,H.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,H.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,H.f)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,P.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,P.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.B)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,P.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,P.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,a=-i/2+this.column*o,s=a+o,l=-r/2+this.row*n,c=l+n,d=(0,P.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,P.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,H.f)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,H.f)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,P.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,z.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,P.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,H.f)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new U).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,H.a)(this._viewport,e.viewport)&&(0,H.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,H.g)(e.screenPadding,this.screenPadding)>=t||(0,H.g)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.H)(k),n=(0,M.H)($),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,M.G)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,H.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,H.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,H.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,n=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,P.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,P.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,H.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,a=Math.max(n-r/2,0),s=Math.max(this.fullHeight-o-i/2,0),l=-Math.min(n-r/2,0),c=-Math.min(this.fullHeight-o-i/2,0),d=r-l- -Math.min(this.fullWidth-n-r/2,0),u=i-c- -Math.min(o-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,n,o)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.C)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):O.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,z.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,P.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewport",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_padding",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_fov",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_nearFar",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"pixelRatio",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"row",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"column",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_rows",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"rows",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_columns",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"columns",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"eye",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"center",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_center",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"up",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"_up",void 0),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewForward",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewUp",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"viewRight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"nearFar",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"near",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"far",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenViewport",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"screenPadding",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"x",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"y",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"width",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"height",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fullWidth",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fullHeight",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_aspect",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"padding",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"projectionMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fov",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fovX",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"fovY",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,d.MZ)({readOnly:!0})],G.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,d.MZ)()],G.prototype,"relativeElevation",void 0),G=U=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],G);const j=(0,N.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)();var q=r(5443),Y=r(39829),X=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===n?0:1;if(t[r]>i&&a[r]>i)return 1===n?1:0;const s=(a[o]-t[o])/(a[r]-t[r]),l=t[o]+s*(i-t[r]);return e[r]=i,e[o]=l,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(Q,t[0],t[0])&&J(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(Q,t[r],i)){case 1:J(e,i);break;case 3:J(e,(0,D.o8)(Q));break;case 2:J(e,(0,D.o8)(Q)),J(e,i)}}}}function J(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const Q=(0,D.vt)();var ee=r(11964),te=r(27921);const re=(0,T.vt)(),ie=(0,T.vt)();function ne(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function oe(e,t,r,i,n){let o=(0,M.n)(re,e),s=(0,M.g)(o,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(o,t),l&&(0,M.j)(o,o,-1)):o=null);let c=0;if(o){(0,M.j)(ie,i,(0,M.g)(i,o)),(0,M.e)(o,o,ie);const e=(0,M.g)(o,n)/((0,M.b)(o)*(0,M.b)(n));(0,M.f)(ie,o,n),c=((0,M.g)(ie,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function ae(e,t,r,i){(0,M.e)(se,r,t),(0,te.T7)(i,(0,ee.LV)(t,se),e)||e===r||(0,M.d)(e,r)}const se=(0,T.vt)(),le=(0,T.fA)(0,1,0),ce=(0,T.fA)(0,0,1),de=(0,y.vt)(),ue=(0,T.vt)(),he=(0,T.vt)();function me(e,t,r,i=ne()){const{direction:n,up:o}=i;return(0,P.N9)(de,-(0,a.kU)(t)),(0,P.eL)(de,de,(0,a.kU)(r)),(0,M.p)(n,ce,de),(0,M.j)(n,n,-1),(0,M.p)(o,le,de),i}function pe(e,t,r,i,n){const o=t.lines[11].direction,a=(n-r.getAltitude(i))/o[2];(0,M.c)(e,i,o,a)}const fe=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return oe(t,r,i,ce,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=me(0,r,i),o=(0,T.vt)();return(0,M.j)(o,n.direction,-t),(0,M.i)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:me,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,I.LV)(t.origin,t.direction),n,fe)||pe(fe,r,i,t.endpoint,n),ae(fe,a,fe,l),s.push((0,D.fA)(fe[0],fe[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(fe,e[0],e[1],0),t.fromRenderCoords(fe,fe,r),[fe[0],fe[1]]));return i.length<=2?new Y.A({spatialReference:r}):(i.push(i[0].slice()),(0,X.$3)(i)||i.reverse(),new Y.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(s,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,ue,o),(0,S.g)(t,he,o),ue[0]-=r/2,he[0]+=r/2,ue[1]-=i/2,he[1]+=i/2,(0,E.F)(ue,o,ue,a),(0,E.F)(he,o,he,a),n?(n.xmin=ue[0],n.ymin=ue[1],n.xmax=he[0],n.ymax=he[1],n.spatialReference=a):n=new q.A(ue[0],ue[1],he[0],he[1],a),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),ge=r(17136),_e=r(94008),xe=r(28735);class we{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,z.vt)(),this._points=(0,z.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._boundingSphere=new _e.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,z.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,z.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,z.m7)(this.frustum,e)}intersectsRay(e){return(0,z.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,z.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,z.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=Me;(0,M.n)(t,this.direction);const r=ye;(0,M.a)(r,this.points[4],e);const i=.5*(0,M.g)(r,r)/(0,M.g)(t,r),n=this._boundingSphere,o=(0,M.c)(Te,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=z.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,M.C)(e.direction,t,r)}const ye=(0,T.vt)(),Me=(0,T.vt)(),Te=(0,T.vt)();r(86211);const Ce=(0,T.fA)(5802e-9,13558e-9,331e-7),Se=(0,T.fA)(65e-8*3,5643e-9,255e-9);(0,T.fA)(Ce[0]+Se[0],Ce[1]+Se[1],Ce[2]+Se[2]);class Ee{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ee(0,0)}static{this.Infinite=new Ee}}(0,T.vt)(),(0,T.vt)(),new _e.iy,(0,I.vt)();var Ae=r(32728);const Ie=(0,T.fA)(0,0,1),Re=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Oe=(0,y.vt)(),Fe=(0,T.vt)(),Pe=(0,T.vt)();function De(e,t,r,i=ne()){(0,M.f)(Fe,e,Ie),0===(0,M.g)(Fe,Fe)&&(0,M.f)(Fe,e,Re),(0,P.$0)(Oe,-(0,a.kU)(t),e),(0,P.e$)(Oe,Oe,-(0,a.kU)(r),Fe);const{up:n,direction:o}=i;return(0,M.f)(n,Fe,e),(0,M.n)(n,n),(0,M.p)(n,n,Oe),(0,M.n)(o,e),(0,M.q)(o,o),(0,M.p)(o,o,Oe),i}function He(e){const t=e[1];e[1]=-e[2],e[2]=t}function Ne(e,t){const r=De(t,e.heading,e.tilt);return e.up=r.up,e}function ze(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const a=e[o],s=o===e.length-1?e[0]:e[o+1],l=(0,ee.Cr)(a,s,ke),c=(0,te.vE)(t,l.origin,l.vector,0,je);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,o,s]=0===c?[1,r,i]:[-1,i,r],l=(0,te.Qj)(t),d=(0,M.c)((0,T.vt)(),je,l,e*n),u=(0,M.c)((0,T.vt)(),je,l,e*-n);o.push(a),o.push(d),s.push(u)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const Le={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Be=(0,T.fA)(1,0,0),Ve=(0,T.fA)(0,1,0),Ue=(0,T.vt)(),Ge=(0,T.vt)(),je=(0,T.vt)(),We=new _e.iy,ke=(0,ee.vt)(),$e=(0,N.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=Fe,o=Pe;return(0,M.n)(n,e),(0,M.f)(Pe,n,Ie),0===(0,M.g)(Pe,Pe)&&(0,M.f)(Pe,n,Re),(0,M.f)(o,Pe,n),oe(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,T.vt)(),up:null,tilt:i,heading:r},o=Fe;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(o);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-o[1]*o[1]);if(b<0)return(0,M.j)(n.eye,o,f/p),n.tilt=0,Ne(n,e);const y=Math.sqrt(b),C=o[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=s):(0,M.j)(n.eye,o,f/p),n.tilt=0,He(n.eye),Ne(n,e);n.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,P=Math.sqrt(F),D=_*O+A-2*R*P*x+F*w;return Math.abs(D)<1e-8?((0,M.j)(n.eye,o,f/p),n.tilt=0,He(n.eye),Ne(n,e)):(n.eye[0]=(F*(f*o[0]-v*o[0])-I*P*(o[0]*n.eye[1]*u+o[2]*d))/D,n.eye[2]=(F*(f*o[2]-v*o[2])-I*P*(o[2]*n.eye[1]*u-o[0]*d))/D,(0,M.j)(n.eye,n.eye,f),He(n.eye),Ne(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),n=(0,M.b)(t);return(0,a.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:De,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,a.YN)(r/(n/Math.sin(e)));return(0,a.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);const o=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.B)(c,t)/(l+o),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=Le,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=n.planes[5],b=[],y=(0,te.O_)(T.uY,Be,(0,te.vt)()),C=(0,te.O_)(T.uY,Ve,(0,te.vt)());(0,H.c)($e,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=n.lines[e],l=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const d=n/_,u=0===n?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Ge,s.origin,l.origin,u),m=(0,Ae.nu)(s.direction,l.direction,u,Ue);r.intersectManifoldClosestSilhouette((0,I.LV)(h,m),o,je),ae(je,c,je,w),b.push((0,T.o8)(je)),0!==b.length&&S((0,M.G)(b.at(-1),je));const p=((0,te.Tj)(y,je)?1:0)|((0,te.Tj)(C,je)?2:0);$e[p]=1}}b.length>2&&(0,M.G)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const a of e)t.fromRenderCoords(a,je,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(n.push([null,je[1]]),n.push([null,je[1]]),o=!0):n.push([je[0],je[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,X.$3)(n)||n.reverse(),n})}((0,H.d)($e)>1?function(e,t){const r=[];for(const i of e)r.push(...ze(i,t));return r}(ze(b,y),C):[b],r,s);return new Y.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,n){let o,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,n=(0,a.kU)(e),o=Math.sin(i/2),s=Math.cos(n),l=2*(0,a.YN)(Math.sqrt(o*o/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;o=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=ge.Y_.monotonic(o,s),s-o>180){const e=(s-o-180)/2;o+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return n?(n.xmin=o,n.ymin=l,n.xmax=s,n.ymax=c,n.spatialReference=w):n=new q.A(o,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,xe.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const Ze="ssao";(0,T.vt)();var qe=r(49186),Ye=r(10107),Xe=r(64108);let Ke=class extends R.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new qe.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"view",void 0),(0,o.Cg)([(0,Ye.MZ)({constructOnly:!0})],Ke.prototype,"consumes",void 0),(0,o.Cg)([(0,Ye.MZ)()],Ke.prototype,"produces",void 0),(0,o.Cg)([(0,Ye.MZ)({readOnly:!0})],Ke.prototype,"techniques",null),Ke=(0,o.Cg)([(0,Xe.$)("esri.views.3d.webgl.RenderNode")],Ke);var Je=r(13840),Qe=r(42958),et=r(95774),tt=r(90644);let rt=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(et.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};rt=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],rt);var it=r(65786);class nt extends it.Y{constructor(){super(...arguments),this.projScale=1}}class ot extends nt{constructor(){super(...arguments),this.intensity=1}}class at extends it.Y{}class st extends at{constructor(){super(...arguments),this.blurSize=(0,D.vt)()}}var lt=r(15581);let ct=class extends Qe.w{constructor(){super(...arguments),this.shader=new Je.r(lt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,tt.Ey)({colorWrite:tt.kn})}};ct=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],ct);var dt=r(63907),ut=r(76284),ht=r(67171);const mt=2;let pt=class extends Ke{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=Ze,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new ot,this._drawParameters=new st}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ht.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new ut.A(this.renderingContext,t,e),this.techniques.precompile(ct),this.techniques.precompile(rt),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(dt.nI);if(!r||!i)return;const n=this.techniques.get(ct),o=this.techniques.get(rt);if(!n.compiled||!o.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ft/(0,lt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/mt),b=Math.round(_/mt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,mt/_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,Ze,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,mt/g,0),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,o.Cg)([(0,d.MZ)()],pt.prototype,"consumes",void 0),(0,o.Cg)([(0,d.MZ)()],pt.prototype,"produces",void 0),(0,o.Cg)([(0,d.MZ)({constructOnly:!0})],pt.prototype,"isEnabled",void 0),pt=(0,o.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],pt);const ft=.5;function vt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/mt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
12
12
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
13
13
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
14
14
  }