@arcgis/core 4.30.0-next.20240510 → 4.30.0-next.20240513
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{46c0675cf0718aa7a86d.js → 0bb0d1779f1f02506a2c.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fdbb71c0fd6e4a34abc.js → 13efee3e0e7152884baa.js} +1 -1
- package/assets/esri/core/workers/chunks/c50d82bdd4bd74dfbcd8.js +1 -0
- package/assets/esri/libs/basisu/basis_transcoder.wasm +0 -0
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/basis_transcoder.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/interfaces.d.ts +95 -8
- package/layers/orientedImagery/core/coverageUtils.js +1 -1
- package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
- package/libs/basisu/BasisU.js +1 -1
- package/package.json +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileRendererHelper3D.js +1 -1
- package/views/2d/engine/vectorTiles/decluttering/jobsUtil.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/analysis/images/heading-rotate-svg.js +1 -1
- package/views/3d/analysis/images/tilt-rotate-svg.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/reshapeTooltipUtils.js +1 -1
- package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
- package/views/3d/interactive/editingTools/transform/TransformTool3D.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/draw/support/Box.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/reshapeTooltipUtils.js +5 -0
- package/views/interactive/tooltip/Tooltip.js +1 -1
- package/views/interactive/tooltip/content/tooltipContentFactory.js +1 -1
- package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
- package/views/interactive/tooltip/infos/TransformMeshTooltipInfo.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/magnifier/overlay-svg.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/support/EditorEditingCapabilities.js +1 -1
- package/widgets/FeatureTable/ActionColumn.js +1 -1
- package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/RelationshipColumn.js +1 -1
- package/widgets/FeatureTable/VisibleElements.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/3568168ee1c278a78550.js +0 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +0 -5
|
@@ -260,7 +260,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
260
260
|
|
|
261
261
|
fragBlur = b / w_total;
|
|
262
262
|
}
|
|
263
|
-
`),e}const f=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>i});var o=r(49186);let i=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[i,a]=t.split("."),n=/^\s*\d+\s*$/;if(!i?.match||!n.test(i))throw new o.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!n.test(a))throw new o.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(i,10),l=parseInt(a,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function o(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function i(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>i,b5:()=>o});const a=/^devext\.arcgis\.com$/,n=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,a,n,/^jsapps\.esri\.com$/,s,l]},11868:(e,t,r)=>{r.d(t,{oe:()=>i});var o=r(34275);function i(e,t=!1){return e<=o.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}},19582:(e,t,r)=>{r.d(t,{fetch:()=>ur});var o=r(61473),i=r(34727),a=r(77690),n=r(29242),s=r(58083),l=r(9093),c=r(48163),d=r(38954),u=r(51850),h=r(70328),m=r(11868),f=r(13030),p=r(73354),v=r(65686),g=r(43609),_=r(51737),x=r(78358),T=r(21015),b=r(4399),E=r(84498),A=r(51530),S=r(88340);function y(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:S.Un,i=(0,n.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,n.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,n.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,n.vt)();return(0,a.lw)(c,s,l),(0,a.lw)(c,i,c),c}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var C=r(78888),R=r(60999),O=r(86805),I=r(49186),N=r(53966);class L{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const o=this._outer.get(e);o?o.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var H=r(74887),P=r(46140),D=r(97146);async function F(e,t){const{data:r}=await(0,C.A)(e,{responseType:"image",...t});return r}var B=r(46610),z=r(89192),V=r(75130),G=r(44208),W=r(65529),U=r(97768),j=r(34275),k=r(84952),q=r(56058),$=r(2741);let Y;var X,Z;(Z=X||(X={}))[Z.ETC1_RGB=0]="ETC1_RGB",Z[Z.ETC2_RGBA=1]="ETC2_RGBA",Z[Z.BC1_RGB=2]="BC1_RGB",Z[Z.BC3_RGBA=3]="BC3_RGBA",Z[Z.BC4_R=4]="BC4_R",Z[Z.BC5_RG=5]="BC5_RG",Z[Z.BC7_M6_RGB=6]="BC7_M6_RGB",Z[Z.BC7_M5_RGBA=7]="BC7_M5_RGBA",Z[Z.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Z[Z.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Z[Z.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Z[Z.ATC_RGB=11]="ATC_RGB",Z[Z.ATC_RGBA=12]="ATC_RGBA",Z[Z.FXT1_RGB=17]="FXT1_RGB",Z[Z.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Z[Z.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Z[Z.ETC2_EAC_R11=20]="ETC2_EAC_R11",Z[Z.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Z[Z.RGBA32=13]="RGBA32",Z[Z.RGB565=14]="RGB565",Z[Z.BGR565=15]="BGR565",Z[Z.RGBA4444=16]="RGBA4444";var J=r(63907),K=r(21231),Q=r(42293);let ee=null,te=null;async function re(){return null==te&&(te=function(){if(null==Y){const e=e=>(0,$.s)(`esri/libs/basisu/${e}`);Y=r.e(9321).then(r.bind(r,49321)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return Y}(),ee=await te),te}function oe(e,t,r,o,i){const a=(0,Q.IB)(t?J.CQ.COMPRESSED_RGBA8_ETC2_EAC:J.CQ.COMPRESSED_RGB8_ETC2),n=i&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*o*a*n)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function ae(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,o,i,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?o?[X.ETC2_RGBA,J.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,J.CQ.COMPRESSED_RGB8_ETC2]:c?o?[X.BC3_RGBA,J.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,J.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,J.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?J.Cj.LINEAR_MIPMAP_LINEAR:J.Cj.LINEAR,t.width=i,t.height=a,new K.g(e,t,{type:"compressed",levels:m})}var se=r(69720),le=r(96672);const ce=()=>N.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function de(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ue=de("DXT1"),he=de("DXT3"),me=de("DXT5");function fe(e,t,r){if(e instanceof ImageData)return fe(pe(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}function pe(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var ve,ge,_e=r(620),xe=r(67171);class Te extends se.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=le.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new W.A,this._parameters={...Ee,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,k.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,k.DB)(e.src)||(0,k.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new xe.R;return t.wrapMode=this._parameters.wrap??J.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?J.Cj.LINEAR_MIPMAP_LINEAR:J.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,j.mw)(e)||(0,j.mg)(e))return t.encoding===z.JS.KTX2_ENCODING?function(e,t){if(null==ee)return e.byteLength;const r=new ee.KTX2File(new Uint8Array(e)),o=ae(r)?oe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):t.encoding===z.JS.BASIS_ENCODING?function(e,t){if(null==ee)return e.byteLength;const r=new ee.BasisFile(new Uint8Array(e)),o=ie(r)?oe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):e.byteLength;const{width:r,height:o}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?be(e):t;return(t.mipmap?4/3:1)*r*o*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new K.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,j.mw)(t)||(0,j.mg)(t))&&this._parameters.encoding===z.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,j.mw)(t)||(0,j.mg)(t))&&this._parameters.encoding===z.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,j.mw)(t)||(0,j.mg)(t))&&this._parameters.encoding===z.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,j.mg)(t)?this._loadFromPixelData(e,t):(0,j.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<ve.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const o=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return ce().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return ce().error("Unsupported format, must contain a FourCC code"),null;const o=r[21];let i,a;switch(o){case ue:i=8,a=J.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case he:i=16,a=J.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case me:i=16,a=J.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return ce().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(o)),null}let n=1,s=r[4],l=r[3];(3&s||3&l)&&(ce().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*i,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==o)throw new Error("DDS texture data is null");const{textureData:i,internalFormat:a,width:n,height:s}=o;return t.samplingMode=i.levels.length>1?J.Cj.LINEAR_MIPMAP_LINEAR:J.Cj.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new K.g(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==ee&&(ee=await re());const o=new ee.KTX2File(new Uint8Array(r));if(!ae(o))return null;o.startTranscoding();const i=ne(e,t,o.getLevels(),o.getHasAlpha(),o.getWidth(),o.getHeight(),((e,t)=>o.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>o.transcodeImage(r,e,0,0,t,0,-1,-1)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==ee&&(ee=await re());const o=new ee.BasisFile(new Uint8Array(r));if(!ie(o))return null;o.startTranscoding();const i=ne(e,t,o.getNumLevels(0),o.getHasAlpha(),o.getImageWidth(0,0),o.getImageHeight(0,0),((e,t)=>o.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>o.transcodeImage(r,0,e,t,0,0)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,_e.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?J.Ab.LUMINANCE:3===this._parameters.components?J.Ab.RGB:J.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new K.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const o=await F(t,{signal:r});return(0,H.Te)(r),this._loadFromImage(e,o)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const o=await(0,q.Sx)(t,t.src,!1,r);return(0,H.Te)(r),this._loadFromImage(e,o)}))}_loadFromVideoElement(e,t){return t.readyState>=ve.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,i)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,U.xt)(l)},n=()=>{t.readyState>=ve.HAVE_CURRENT_DATA&&(a(),o(this._loadFromImage(e,t)))},s=e=>{a(),i(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,H.u7)(r,(()=>s((0,H.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?pe(e):e;let o=e.width,i=e.height;do{o=Math.ceil(o/2),i=Math.ceil(i/2),r=o*i}while(r>1048576||null!=t&&(o>t||i>t));return fe(e,o,i)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const o=t/r;return fe(e,Math.round(e.width*o),Math.round(e.height*o))}(r,t)}const o=be(r);this._parameters.width=o.width,this._parameters.height=o.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this._parameters.components?J.Ab.RGB:J.Ab.RGBA,i.width=o.width,i.height=o.height,this._glTexture=new K.g(e,i,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const o=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(o,o),r}unload(){if(this._glTexture=(0,U.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function be(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(ge=ve||(ve={}))[ge.HAVE_NOTHING=0]="HAVE_NOTHING",ge[ge.HAVE_METADATA=1]="HAVE_METADATA",ge[ge.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",ge[ge.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",ge[ge.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Ee={wrap:{s:J.pF.REPEAT,t:J.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ae=r(46540),Se=r(24151),ye=r(1843),we=r(49255),Me=r(96336),Ce=r(62602),Re=r(59469),Oe=r(25634),Ie=r(14903),Ne=r(14327),Le=r(90644);const He=(0,Le.p3)(J.dn.SRC_ALPHA,J.dn.ONE,J.dn.ONE_MINUS_SRC_ALPHA,J.dn.ONE_MINUS_SRC_ALPHA),Pe=(0,Le.p3)(J.dn.ONE,J.dn.ZERO,J.dn.ONE,J.dn.ONE_MINUS_SRC_ALPHA);function De(e){return e===Ne.y.FrontFace?null:Pe}const Fe={factor:-1,units:-2};function Be(e,t=J.MT.LESS){return e===Ne.y.NONE||e===Ne.y.FrontFace?t:J.MT.LEQUAL}function ze(e){return e===Ne.y.ColorAlpha?{buffers:[J.Nm.COLOR_ATTACHMENT0,J.Nm.COLOR_ATTACHMENT1]}:null}class Ve{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const Ge=(0,h.vt)();function We(e,t,r,o,i,a){if(!e.visible)return;const n=(0,d.A)(tt,o,r),s=(e,t,r)=>{a(e,r,t,!1)},l=new Ve(!1,t.options.normalRequired);if(e.boundingInfo){(0,_e.vA)(e.type===le.X.Mesh);const o=t.tolerance;je(e.boundingInfo,r,n,o,i,l,s)}else{const t=e.attributes.get(Ae.r.POSITION),o=t.indices;!function(e,t,r,o,i,a,n,s,l,c){const u=t,h=rt,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],E=u[T]/u[g],A=1/u[g],S=qe,y=$e,w=Ye,{normalRequired:M}=l;for(let t=r;t<o;++t){const r=3*t,o=n*i[r];(0,d.s)(h[0],a[o+0],a[o+1],a[o+2]);const l=n*i[r+1];(0,d.s)(h[1],a[l+0],a[l+1],a[l+2]);const u=n*i[r+2];(0,d.s)(h[2],a[u+0],a[u+1],a[u+2]),s&&((0,d.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.A)(S,h[0],e),(0,d.A)(y,h[1],e),(0,d.A)(w,h[2],e);const m=S[x]-b*S[g],f=S[T]-E*S[g],p=y[x]-b*y[g],v=y[T]-E*y[g],_=w[x]-b*w[g],C=w[T]-E*w[g],R=_*v-C*p,O=m*C-f*_,I=p*f-v*m;if((R<0||O<0||I<0)&&(R>0||O>0||I>0))continue;const N=R+O+I;if(0===N)continue;const L=R*(A*S[g])+O*(A*y[g])+I*(A*w[g]);if(L*Math.sign(N)<0)continue;const H=L/N;H>=0&&c(H,t,M?Ze(h):null)}}(r,n,0,o.length/3,o,t.data,t.stride,i,l,s)}}const Ue=(0,u.vt)();function je(e,t,r,o,i,a,n){if(null==e)return;const s=function(e,t){return(0,d.s)(t,1/e[0],1/e[1],1/e[2])}(r,Ue);if((0,h.Ne)(Ge,e.bbMin),(0,h.vI)(Ge,e.bbMax),null!=i&&i.applyToAabb(Ge),function(e,t,r,o){return function(e,t,r,o,i){const a=(e[0]-o-t[0])*r[0],n=(e[3]+o-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-o-t[1])*r[1],d=(e[4]+o-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-o-t[2])*r[2],h=(e[5]+o-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,o)}(Ge,t,s,o)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>Qe){const s=e.getChildren();if(void 0!==s){for(const e of s)je(e,t,r,o,i,a,n);return}}!function(e,t,r,o,i,a,n,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<o;++e){const t=s[e],r=3*t,o=n*i[r];let c=a[o],_=a[o+1],x=a[o+2];const T=n*i[r+1];let b=a[T],E=a[T+1],A=a[T+2];const S=n*i[r+2];let y=a[S],w=a[S+1],M=a[S+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,E,A]=l.applyToVertex(b,E,A,e),[y,w,M]=l.applyToVertex(y,w,M,e));const C=b-c,R=E-_,O=A-x,I=y-c,N=w-_,L=M-x,H=p*L-N*v,P=v*I-L*f,D=f*N-I*p,F=C*H+R*P+O*D;if(Math.abs(F)<=et)continue;const B=u-c,z=h-_,V=m-x,G=B*H+z*P+V*D;if(F>0){if(G<0||G>F)continue}else if(G>0||G<F)continue;const W=z*O-R*V,U=V*C-O*B,j=B*R-C*z,k=f*W+p*U+v*j;if(F>0){if(k<0||G+k>F)continue}else if(k>0||G+k<F)continue;const q=(I*W+N*U+L*j)/F;q>=0&&d(q,t,g?Xe(C,R,O,I,N,L,ke):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,i,a,n)}}const ke=(0,u.vt)();const qe=(0,u.vt)(),$e=(0,u.vt)(),Ye=(0,u.vt)();function Xe(e,t,r,o,i,a,n){return(0,d.s)(Je,e,t,r),(0,d.s)(Ke,o,i,a),(0,d.b)(n,Je,Ke),(0,d.n)(n,n),n}function Ze(e){return(0,d.A)(Je,e[1],e[0]),(0,d.A)(Ke,e[2],e[0]),(0,d.b)(ke,Je,Ke),(0,d.n)(ke,ke),ke}const Je=(0,u.vt)(),Ke=(0,u.vt)(),Qe=1e3,et=1e-7,tt=(0,u.vt)(),rt=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()];var ot,it;(it=ot||(ot={}))[it.INTEGRATED_MESH=0]="INTEGRATED_MESH",it[it.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",it[it.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",it[it.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",it[it.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",it[it.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",it[it.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",it[it.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",it[it.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",it[it.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",it[it.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",it[it.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",it[it.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",it[it.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",it[it.LASERLINES=14]="LASERLINES",it[it.LASERLINES_CONTRAST_CONTROL=15]="LASERLINES_CONTRAST_CONTROL",it[it.HUD_MATERIAL=16]="HUD_MATERIAL",it[it.LABEL_MATERIAL=17]="LABEL_MATERIAL",it[it.LINE_CALLOUTS=18]="LINE_CALLOUTS",it[it.LINE_CALLOUTS_HUD_DEPTH=19]="LINE_CALLOUTS_HUD_DEPTH",it[it.DRAPED_MATERIAL=20]="DRAPED_MATERIAL",it[it.DRAPED_WATER=21]="DRAPED_WATER",it[it.VIEWSHED=22]="VIEWSHED",it[it.VOXEL=23]="VOXEL",it[it.MAX_SLOTS=24]="MAX_SLOTS";var at=r(76412),nt=r(57005);const st=new class{constructor(e=0){this.offset=e,this.sphere=(0,at.c)(),this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,i=(0,d.s)(lt,e,t,r),a=(0,d.h)(i,i,o),n=this.offset/(0,d.l)(a);(0,d.u)(a,a,a,n);const s=this.objectTransform.inverse;return(0,d.h)(this.tmpVertex,a,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,d.l)(e);(0,d.u)(e,e,e,r);const o=this.offset/(0,d.l)(t);(0,d.u)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,d.l)((0,at.g)(e)),r=this.offset/t;return(0,d.u)((0,at.g)(this.sphere),(0,at.g)(e),(0,at.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,u.vt)(),this._tmpMbs=(0,at.c)(),this._tmpObb=new nt.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,d.l)(e)}applyToVertex(e,t,r){const o=(0,d.s)(lt,e,t,r),i=(0,d.s)(ct,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,d.l)(i);return(0,d.u)(this._tmpVertex,o,i,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],o=e[1],i=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(o),d=Math.abs(i),u=Math.abs(a),h=Math.abs(n),m=Math.abs(s),f=.5*(1+Math.sign(r*a))*Math.min(l,u),p=.5*(1+Math.sign(o*n))*Math.min(c,h),v=.5*(1+Math.sign(i*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(f*f+p*p+v*v),b=Math.sign(l+r),E=Math.sign(c+o),A=Math.sign(d+i),S=Math.sign(u+a),y=Math.sign(h+n),w=Math.sign(m+s),M=this._totalOffset;if(T<M)return e[0]-=(1-b)*M,e[1]-=(1-E)*M,e[2]-=(1-A)*M,e[3]+=S*M,e[4]+=y*M,e[5]+=w*M,e;const C=M/Math.sqrt(g*g+_*_+x*x),R=M/T,O=R-C,I=-O;return e[0]+=r*(b*I+R),e[1]+=o*(E*I+R),e[2]+=i*(A*I+R),e[3]+=a*(S*O+C),e[4]+=n*(y*O+C),e[5]+=s*(w*O+C),e}applyToMbs(e){const t=(0,d.l)((0,at.g)(e)),r=this._totalOffset/t;return(0,d.u)((0,at.g)(this._tmpMbs),(0,at.g)(e),(0,at.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,nt.gm)(e,this._totalOffset,this._totalOffset,Se.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=(0,d.s)(lt,e,t,r),i=(0,d.g)(ct,o,this.localOrigin),a=this.offset/(0,d.l)(i);return(0,d.u)(this.tmpVertex,o,i,a),this.tmpVertex}applyToAabb(e){const t=dt,r=ut,o=ht;for(let i=0;i<3;++i)t[i]=e[0+i]+this.localOrigin[i],r[i]=e[3+i]+this.localOrigin[i],o[i]=t[i];const i=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=i[t],e[t+3]=i[t];const a=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let i=0;i<3;++i)o[i]=e&1<<i?r[i]:t[i];a(o)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(!(n&e)){for(let i=0;i<3;++i)o[i]=n&1<<i?0:e&1<<i?t[i]:r[i];a(o)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const lt=(0,u.vt)(),ct=(0,u.vt)(),dt=(0,u.vt)(),ut=(0,u.vt)(),ht=(0,u.vt)();function mt(e,t,r){const{data:o,indices:i}=e,a=t.typedBuffer,n=t.typedBufferStride,s=i.length;r*=n;for(let e=0;e<s;++e){const t=2*i[e];a[r]=o[t],a[r+1]=o[t+1],r+=n}}function ft(e,t,r,o){const{data:i,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,null==o||1===o)for(let e=0;e<l;++e){const t=3*a[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<o;++e)n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],r+=s}}function pt(e,t,r,o=1){const{data:i,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===o)for(let e=0;e<l;++e){const t=4*a[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<o;++e)n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=s}}function vt(e,t,r,o,i=1){const a=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===i)for(let t=0;t<r;++t)a[o]=e[0],a[o+1]=e[1],a[o+2]=e[2],a[o+3]=e[3],o+=n;else for(let t=0;t<r;++t)for(let t=0;t<i;++t)a[o]=e[0],a[o+1]=e[1],a[o+2]=e[2],a[o+3]=e[3],o+=n}function gt(e,t,r,o,i,a){switch(e){case Ae.r.POSITION:{(0,_e.vA)(3===t.size);const o=i.getField(e,f.xs);(0,_e.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void ft(e,r,o,i);const{data:a,indices:n}=e,l=r.typedBuffer,c=r.typedBufferStride,d=n.length,u=t[0],h=t[1],m=t[2],f=t[4],p=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],b=t[13],E=t[14];o*=c;let A=0,S=0,y=0;const w=(0,s.tZ)(t)?e=>{A=a[e]+T,S=a[e+1]+b,y=a[e+2]+E}:e=>{const t=a[e],r=a[e+1],o=a[e+2];A=u*t+f*r+g*o+T,S=h*t+p*r+_*o+b,y=m*t+v*r+x*o+E};if(1===i)for(let e=0;e<d;++e)w(3*n[e]),l[o]=A,l[o+1]=S,l[o+2]=y,o+=c;else for(let e=0;e<d;++e){w(3*n[e]);for(let e=0;e<i;++e)l[o]=A,l[o+1]=S,l[o+2]=y,o+=c}}(t,r,o,a);break}case Ae.r.NORMAL:{(0,_e.vA)(3===t.size);const r=i.getField(e,f.xs);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,o,i=1){if(!t)return void ft(e,r,o,i);const{data:a,indices:n}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=n.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),E=1e-6,A=1-E;o*=d;let S=0,y=0,w=0;const M=(0,s.tZ)(l)?e=>{S=a[e],y=a[e+1],w=a[e+2]}:e=>{const t=a[e],r=a[e+1],o=a[e+2];S=h*t+p*r+_*o,y=m*t+v*r+x*o,w=f*t+g*r+T*o};if(1===i)if(b)for(let e=0;e<u;++e){M(3*n[e]);const t=S*S+y*y+w*w;if(t<A&&t>E){const e=1/Math.sqrt(t);c[o]=S*e,c[o+1]=y*e,c[o+2]=w*e}else c[o]=S,c[o+1]=y,c[o+2]=w;o+=d}else for(let e=0;e<u;++e)M(3*n[e]),c[o]=S,c[o+1]=y,c[o+2]=w,o+=d;else for(let e=0;e<u;++e){if(M(3*n[e]),b){const e=S*S+y*y+w*w;if(e<A&&e>E){const t=1/Math.sqrt(e);S*=t,y*=t,w*=t}}for(let e=0;e<i;++e)c[o]=S,c[o+1]=y,c[o+2]=w,o+=d}}(t,o,r,a);break}case Ae.r.NORMALCOMPRESSED:{(0,_e.vA)(2===t.size);const r=i.getField(e,f.mJ);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&mt(t,r,a);break}case Ae.r.UV0:{(0,_e.vA)(2===t.size);const r=i.getField(e,f.gH);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&mt(t,r,a);break}case Ae.r.COLOR:case Ae.r.SYMBOLCOLOR:{const r=i.getField(e,f.XP);(0,_e.vA)(!!r,`No buffer view for ${e}`),(0,_e.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,o,i=1){const{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(o*=l,t!==a.length||4!==t)if(1!==i)if(4!==t)for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<i;++e)s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=255,o+=l}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<i;++e)s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=a[t+3],o+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*n[e];s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=a[t+3],o+=l}return}for(let e=0;e<c;++e){const t=3*n[e];s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=255,o+=l}}else{s[o]=a[0],s[o+1]=a[1],s[o+2]=a[2],s[o+3]=a[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[o/=4];o+=t;const d=c*i;for(let r=1;r<d;++r)e[o]=n,o+=t}}(t,t.size,r,a);break}case Ae.r.COLORFEATUREATTRIBUTE:{const r=i.getField(e,f.Y$);(0,_e.vA)(!!r,`No buffer view for ${e}`),(0,_e.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:o,indices:i}=e,a=t.typedBuffer,n=t.typedBufferStride,s=i.length,l=o[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case Ae.r.TANGENT:{(0,_e.vA)(4===t.size);const o=i.getField(e,f.Eq);(0,_e.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void pt(e,r,o,i);const{data:a,indices:n}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=n.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),E=1e-6,A=1-E;if(o*=d,1===i)for(let e=0;e<u;++e){const t=4*n[e],r=a[t],i=a[t+1],s=a[t+2],l=a[t+3];let u=h*r+p*i+_*s,S=m*r+v*i+x*s,y=f*r+g*i+T*s;if(b){const e=u*u+S*S+y*y;if(e<A&&e>E){const t=1/Math.sqrt(e);u*=t,S*=t,y*=t}}c[o]=u,c[o+1]=S,c[o+2]=y,c[o+3]=l,o+=d}else for(let e=0;e<u;++e){const t=4*n[e],r=a[t],s=a[t+1],l=a[t+2],u=a[t+3];let S=h*r+p*s+_*l,y=m*r+v*s+x*l,w=f*r+g*s+T*l;if(b){const e=S*S+y*y+w*w;if(e<A&&e>E){const t=1/Math.sqrt(e);S*=t,y*=t,w*=t}}for(let e=0;e<i;++e)c[o]=S,c[o+1]=y,c[o+2]=w,c[o+3]=u,o+=d}}(t,r,o,a);break}case Ae.r.PROFILERIGHT:case Ae.r.PROFILEUP:case Ae.r.PROFILEVERTEXANDNORMAL:case Ae.r.FEATUREVALUE:{(0,_e.vA)(4===t.size);const r=i.getField(e,f.Eq);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&pt(t,r,a)}}}class _t{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ae.r.POSITION).indices.length}write(e,t,r,o,i){!function(e,t,r,o,i,a){for(const n of t.fields.keys()){const t=e.attributes.get(n),s=t?.indices;if(t&&s)gt(n,t,r,o,i,a);else if(n===Ae.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ae.r.POSITION)?.indices;if(t){const r=t.length,o=i.getField(n,f.XP);vt(e.objectAndLayerIdColor,o,r,a)}}}}(r,this.vertexBufferLayout,e,t,o,i)}}var xt=r(19245),Tt=r(91829),bt=r(53466),Et=r(72824),At=r(35093),St=r(97220),yt=r(84867),wt=r(39341),Mt=r(34886);J.MT.LESS,J.MT.ALWAYS;const Ct={mask:255},Rt={function:{func:J.MT.ALWAYS,ref:z.dd.OutlineVisualElementMask,mask:z.dd.OutlineVisualElementMask},operation:{fail:J.eA.KEEP,zFail:J.eA.KEEP,zPass:J.eA.ZERO}},Ot={function:{func:J.MT.ALWAYS,ref:z.dd.OutlineVisualElementMask,mask:z.dd.OutlineVisualElementMask},operation:{fail:J.eA.KEEP,zFail:J.eA.KEEP,zPass:J.eA.REPLACE}};J.MT.EQUAL,z.dd.OutlineVisualElementMask,z.dd.OutlineVisualElementMask,J.eA.KEEP,J.eA.KEEP,J.eA.KEEP,J.MT.NOTEQUAL,z.dd.OutlineVisualElementMask,z.dd.OutlineVisualElementMask,J.eA.KEEP,J.eA.KEEP,J.eA.KEEP;const It=[1,1,.5],Nt=[0,.6,.2],Lt=[0,1,.2];var Ht=r(28491);class Pt extends Et.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.ci)(It),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=z.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,u.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Me.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.fA)(.2,.2,.2),this.diffuse=(0,u.fA)(.8,.8,.8),this.externalColor=(0,Tt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=z.it.Less,this.textureAlphaMode=z.sf.Blend,this.textureAlphaCutoff=At.H,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ie.m$.Occlude,this.isDecoration=!1}}Et.gy;class Dt extends yt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===Se.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?bt.q.Default:bt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Dt.shader)}_initializeProgram(e,t){return new Mt.B(e.rctx,t.get().build(this.configuration),wt.D)}_makePipeline(e,t){const r=this.configuration,o=e===Ne.y.NONE,i=e===Ne.y.FrontFace;return(0,Le.Ey)({blending:r.output===we.V.Color&&r.transparent?o?He:De(e):null,culling:Bt(r)?(0,Le.Xt)(r.cullFace):null,depthTest:{func:Be(e,Ft(r.customDepthTest))},depthWrite:(o||i)&&r.writeDepth?Le.kn:null,drawBuffers:r.output===we.V.Depth?{buffers:[J.Hr.NONE]}:ze(e),colorWrite:Le.wE,stencilWrite:r.hasOccludees?Ct:null,stencilTest:r.hasOccludees?t?Ot:Rt:null,polygonOffset:o||i?null:(a=r.enableOffset,a?Fe:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Ft(e){return e===z.it.Lequal?J.MT.LEQUAL:J.MT.LESS}function Bt(e){return e.cullFace!==z.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Dt.shader=new St.$(Ht.D,(()=>r.e(5141).then(r.bind(r,5141))));var zt=r(90237),Vt=r(99769),Gt=r(82991),Wt=r(46263);class Ut extends Gt.nW{}(0,zt._)([(0,Vt.W)({constValue:!0})],Ut.prototype,"hasSliceHighlight",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],Ut.prototype,"hasSliceInVertexProgram",void 0),(0,zt._)([(0,Vt.W)({constValue:Wt.c.Pass})],Ut.prototype,"pbrTextureBindType",void 0);class jt extends Ut{constructor(){super(...arguments),this.output=we.V.Color,this.alphaDiscardMode=z.sf.Opaque,this.doubleSidedMode=Ce.W.None,this.pbrMode=Re.A9.Disabled,this.cullFace=z.s2.None,this.transparencyPassType=Ne.y.NONE,this.normalType=Me.W.Attribute,this.textureCoordinateType=bt.q.None,this.customDepthTest=z.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,zt._)([(0,Vt.W)({count:we.V.COUNT})],jt.prototype,"output",void 0),(0,zt._)([(0,Vt.W)({count:z.sf.COUNT})],jt.prototype,"alphaDiscardMode",void 0),(0,zt._)([(0,Vt.W)({count:Ce.W.COUNT})],jt.prototype,"doubleSidedMode",void 0),(0,zt._)([(0,Vt.W)({count:Re.A9.COUNT})],jt.prototype,"pbrMode",void 0),(0,zt._)([(0,Vt.W)({count:z.s2.COUNT})],jt.prototype,"cullFace",void 0),(0,zt._)([(0,Vt.W)({count:Ne.y.COUNT})],jt.prototype,"transparencyPassType",void 0),(0,zt._)([(0,Vt.W)({count:Me.W.COUNT})],jt.prototype,"normalType",void 0),(0,zt._)([(0,Vt.W)({count:bt.q.COUNT})],jt.prototype,"textureCoordinateType",void 0),(0,zt._)([(0,Vt.W)({count:z.it.COUNT})],jt.prototype,"customDepthTest",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"spherical",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasVertexColors",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasSymbolColors",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasVerticalOffset",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasSlicePlane",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasSliceHighlight",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasColorTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasMetallicRoughnessTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasEmissionTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasOcclusionTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasNormalTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasScreenSizePerspective",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasVertexTangents",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasOccludees",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"multipassEnabled",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasModelTransformation",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"offsetBackfaces",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"vvSize",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"vvColor",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"receiveShadows",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"receiveAmbientOcclusion",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"textureAlphaPremultiplied",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"instanced",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"instancedColor",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"instancedDoublePrecision",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"writeDepth",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"transparent",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"enableOffset",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"cullAboveGround",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"snowCover",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasColorTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasEmissionTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasNormalTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasOcclusionTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],jt.prototype,"occlusionPass",void 0),(0,zt._)([(0,Vt.W)({constValue:!0})],jt.prototype,"hasVvInstancing",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],jt.prototype,"useCustomDTRExponentForWater",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],jt.prototype,"supportsTextureAtlas",void 0),(0,zt._)([(0,Vt.W)({constValue:!0})],jt.prototype,"useFillLights",void 0);var kt=r(57323);class qt extends Dt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Me.W.Attribute,t.doubleSidedMode=Ce.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,qt.shader)}}qt.shader=new St.$(kt.R,(()=>r.e(9933).then(r.bind(r,39933))));class $t extends Ie.im{constructor(e){super(e,Xt),this.supportsEdges=!0,this.produces=new Map([[ot.OPAQUE_MATERIAL,e=>((0,we.XY)(e)||(0,we.PJ)(e))&&!this.parameters.transparent],[ot.TRANSPARENT_MATERIAL,e=>((0,we.XY)(e)||(0,we.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[ot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,we.XY)(e)||(0,we.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._configuration=new jt,this._vertexBufferLayout=function(e){const t=(0,ye.BP)().vec3f(Ae.r.POSITION);return e.normalType===Me.W.Compressed?t.vec2i16(Ae.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ae.r.NORMAL),e.hasVertexTangents&&t.vec4f(Ae.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ae.r.UV0),e.hasVertexColors&&t.vec4u8(Ae.r.COLOR),e.hasSymbolColors&&t.vec4u8(Ae.r.SYMBOLCOLOR),(0,G.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ae.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==we.V.Shadow&&e!==we.V.ShadowExcludeHighlight&&e!==we.V.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:o,vvColor:i}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||i||o;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?z.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e===we.V.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ce.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ce.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ce.W.WindingOrder:Ce.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Re.A9.Schematic:Re.A9.Normal:Re.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,o,i,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.s)(tr,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case Se.RT.Global:a=(0,d.n)(Qt,tr);break;case Se.RT.Local:a=(0,d.c)(Qt,Kt)}let n=0;const s=(0,d.f)(rr,tr,e.eye),l=(0,d.l)(s),c=(0,d.j)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,d.m)(a,c)),n+=(0,xt.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,d.j)(a,a,n),(0,d.t)(er,a,r.transform.inverseRotation),o=(0,d.f)(Zt,o,er),i=(0,d.f)(Jt,i,er)}var n;We(e,r,o,i,null!=(n=r.verticalOffset)?(st.offset=n,st):null,a)}createGLMaterial(e){return new Yt(e)}createBufferWriter(){return new _t(this._vertexBufferLayout)}}class Yt extends Oe.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===we.V.Color&&(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?qt:Dt,e)}}const Xt=new class extends Pt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Zt=(0,u.vt)(),Jt=(0,u.vt)(),Kt=(0,u.fA)(0,0,1),Qt=(0,u.vt)(),er=(0,u.vt)(),tr=(0,u.vt)(),rr=(0,u.vt)(),or=()=>N.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function ir(e){throw new I.A("",`Request for object resource failed: ${e}`)}function ar(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(or().warn("Geometry must specify vertex attributes"),o=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(or().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(or().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(or().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else or().warn("Indexed geometries must specify faces"),o=!1;break}default:or().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(or().warn("Geometry requires material"),o=!1);const i=e.params.vertexAttributes;for(const e in i)i[e].values||(or().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function nr(e){const t=(0,h.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))})),t}function sr(e){switch(e){case"mask":return z.sf.Mask;case"maskAndTransparency":return z.sf.MaskBlend;case"none":return z.sf.Opaque;default:return z.sf.Blend}}function lr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const cr=new P.R(1,2,"wosr");var dr=r(61765);async function ur(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const o=await(0,R.Ke)(t.request(e,"json",r));if(!0===o.ok)return o.value;(0,H.QP)(o.error),ir(o.error.details.url)}(e,r,t);const o=await(0,R.Ke)((0,C.A)(e,t));if(!0===o.ok)return o.value.data;(0,H.QP)(o.error),ir(o.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const i=e[o],a=i.images[0].data;if(!a){or().warn("Externally referenced texture data is not yet supported");continue}const n=i.encoding+";base64,"+a,s="/textureDefinitions/"+o,l="rgba"===i.channels?i.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:J.pF.REPEAT,t:J.pF.REPEAT},preMultiplyAlpha:sr(l)!==z.sf.Opaque},d=t?.disableTextures?Promise.resolve(null):F(n,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const o=await Promise.all(r),i={};for(const e of o)i[e.refId]=e;return i}(r.textureDefinitions??{},t);let i=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];i+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:o,size:i+(0,O.iL)(r)}}(r.url,t)),{engineResources:o,referenceBoundingBox:i}=function(e,t){const r=new Array,o=new Array,i=new Array,a=new L,n=e.resource,s=P.R.parse(n.version||"1.0","wosr");cr.validate(s);const l=n.model.name,c=n.model.geometries,d=n.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<c.length;e++){const n=c[e];if(!ar(n))continue;const s=lr(n),l=n.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===n.params.topology)return null;const t=n.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[Ae.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,D.tM)(_);p.push([e,new B.n(r,o,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!f.has(x)){const{image:e,parameters:t}=T,r=new Te(e,t);o.push(r),f.set(x,r)}const b=f.get(x),E=b?b.id:void 0,A=s.material;let S=a.get(A,x);if(null==S){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,o=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,i=T?sr(T.alphaChannelUsage):void 0,n={ambient:(0,u.ci)(e.diffuse),diffuse:(0,u.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:o,textureAlphaMode:i,textureAlphaCutoff:.33,textureId:E,initTextureTransparent:!0,doubleSided:!0,cullFace:z.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),S=new $t(n),a.set(A,x,S)}i.push(S);const y=new V.V(S,p);m+=p.find((e=>e[0]===Ae.r.POSITION))?.[1]?.indices.length??0,r.push(y)}return{engineResources:[{name:l,stageResources:{textures:o,materials:i,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:nr(r)}}(e,t);return{lods:o,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,b.y)(new T.R(t.streamDataRequester),r.url,t,t.usePBR)),S=n.model.meta?.ESRI_proxyEllipsoid,w=n.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===n.meta.ESRI_webstyle;w&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const i of o.parts){const o=i.attributes.normal;if(null==o)return;const a=i.attributes.position,n=a.count,c=(0,u.vt)(),h=(0,u.vt)(),m=(0,u.vt)(),p=new Uint8Array(4*n),v=new Float64Array(3*n),g=(0,s.B8)((0,l.vt)(),i.transform);let _=0,x=0;for(let s=0;s<n;s++){a.getVec(s,h),o.getVec(s,c),(0,d.h)(h,h,i.transform),(0,d.f)(m,h,t.center),(0,d.F)(m,m,t.radius);const n=m[2],l=(0,d.l)(m),u=Math.min(.45+.55*l*l,1);(0,d.F)(m,m,t.radius),null!==g&&(0,d.h)(m,m,g),(0,d.n)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.o)(m,m,c,n>-1?.2:Math.min(-4*n-3.8,1)),v[_]=m[0],v[_+1]=m[1],v[_+2]=m[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}i.attributes.normal=new f.xs(v),i.attributes.color=new f.XP(p)}}}(n,S));const I=!!t.usePBR,N=n.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:w,mrrFactors:[...Lt]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...It]},G={...t.materialParameters,treeRendering:w},{engineResources:W,referenceBoundingBox:U}=function(e,t,r,o){const n=e.model,s=new Array,l=new Map,T=new Map,b=n.lods.length,S=(0,h.Ie)();return n.lods.forEach(((e,w)=>{const C=!0===o.skipHighLods&&(b>1&&0===w||b>3&&1===w)||!1===o.skipHighLods&&null!=o.singleLodIndex&&w!==o.singleLodIndex;if(C&&0!==w)return;const R=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const o=C?new $t({}):function(e,t,r,o,i,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==l)return null;const f=function(e){switch(e){case"BLEND":return z.sf.Blend;case"MASK":return z.sf.Mask;case"OPAQUE":case null:case void 0:return z.sf.Opaque}}(l.alphaMode);if(!a.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const o=e.textures.get(t);if(null!=o){const e=o.data;n.set(t,new Te((0,A.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,A.x3)(e)&&r,encoding:(0,A.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,f!==z.sf.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/dr.T),p=l.color[1]**(1/dr.T),v=l.color[2]**(1/dr.T),g=l.emissiveFactor[0]**(1/dr.T),_=l.emissiveFactor[1]**(1/dr.T),x=l.emissiveFactor[2]**(1/dr.T),T=null!=l.textureColor&&h?n.get(l.textureColor):null,b=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:i,emissiveFactor:a,occlusionTexture:n}){return null==e&&null==t&&null==i&&(null==a||(0,d.e)(a,u.uY))&&null==n&&(null==o||1===o)&&(null==r||1===r)}({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion}),E=null!=l.normalTextureTransform?.scale?l.normalTextureTransform?.scale:c.Un;a.set(s,new $t({...o,transparent:f===z.sf.Blend,customDepthTest:z.it.Lequal,textureAlphaMode:f,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,p,v],ambient:[r,p,v],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?z.s2.None:z.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Me.W.Attribute:Me.W.ScreenDerivative,castShadows:!0,receiveShadows:l.receiveShadows,receiveAmbientOcclusion:l.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&h?n.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&h?n.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&h?n.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&h?n.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:b?[...Nt]:[l.metallicFactor,l.roughnessFactor,o.mrrFactors[2]],isSchematic:b,colorTextureTransformMatrix:y(l.colorTextureTransform),normalTextureTransformMatrix:y(l.normalTextureTransform),scale:[E[0],E[1]],occlusionTextureTransformMatrix:y(l.occlusionTextureTransform),emissiveTextureTransformMatrix:y(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:y(l.metallicRoughnessTextureTransform),...i}))}const p=a.get(s);if(r.stageResources.materials.push(p),h){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return p}(n,e,R,t,r,l,T),{geometry:s,vertexCount:b}=function(e,t){const r=e.attributes.position.count,o=(0,E.x)(e.indices||r,e.primitiveType),n=(0,m.oe)(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,p.a)(n,s,e.transform,3,l);const c=[[Ae.r.POSITION,new B.n(n,o,3,!0)]];if(null!=e.attributes.normal){const t=(0,m.oe)(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.normal;(0,a.Ge)(hr,e.transform),(0,p.t)(t,n,hr,3,s),(0,i.or)(hr)&&(0,p.n)(t,t),c.push([Ae.r.NORMAL,new B.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=(0,m.oe)(4*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.tangent;(0,a.z0)(hr,e.transform),(0,v.t)(t,n,hr,4,s),(0,i.or)(hr)&&(0,p.n)(t,t,4),c.push([Ae.r.TANGENT,new B.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,m.oe)(2*r),{typedBuffer:i,typedBufferStride:a}=e.attributes.texCoord0;(0,g.n)(t,i,2,a),c.push([Ae.r.UV0,new B.n(t,o,2,!0)])}const d=e.attributes.color;if(null!=d){const t=new Uint8Array(4*r);4===d.elementCount?d instanceof f.Eq?(0,v.s)(t,d,255):d instanceof f.XP?(0,x.c)(t,d):d instanceof f.Uz&&(0,v.s)(t,d,1/256):(t.fill(255),d instanceof f.xs?(0,p.s)(t,d.typedBuffer,255,4,d.typedBufferStride):e.attributes.color instanceof f.eI?(0,_.c)(t,d.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof f.nS&&(0,p.s)(t,d.typedBuffer,1/256,4,d.typedBufferStride)),c.push([Ae.r.COLOR,new B.n(t,o,4,!0)])}return{geometry:new V.V(t,c),vertexCount:r}}(e,null!=o?o:new $t({})),M=s.boundingInfo;null!=M&&0===w&&((0,h.iT)(S,M.bbMin),(0,h.iT)(S,M.bbMax)),null!=o&&(R.stageResources.geometries.push(s),R.numberOfVertices+=b)})),C||s.push(R)})),{engineResources:s,referenceBoundingBox:S}}(n,N,G,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:W,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const hr=(0,n.vt)()},1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>c});var o=r(13030),i=r(90239),a=r(620);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,o=e.count){const i=this.stride;if(i%4==0){const a=new Uint32Array(e.buffer,t*i,o*i/4);new Uint32Array(this.buffer,r*i,o*i/4).set(a)}else{const a=new Uint8Array(e.buffer,t*i,o*i);new Uint8Array(this.buffer,r*i,o*i).set(a)}return this}get usedMemory(){return this.byteLength}dispose(){}}class s{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:h(e[1].constructor)}))))}freeze(){return this}vec2f(e,t){return this._appendField(e,o.gH,t),this}vec2f64(e,t){return this._appendField(e,o.si,t),this}vec3f(e,t){return this._appendField(e,o.xs,t),this}vec3f64(e,t){return this._appendField(e,o.Xm,t),this}vec4f(e,t){return this._appendField(e,o.Eq,t),this}vec4f64(e,t){return this._appendField(e,o.Aj,t),this}mat3f(e,t){return this._appendField(e,o.jZ,t),this}mat3f64(e,t){return this._appendField(e,o.j0,t),this}mat4f(e,t){return this._appendField(e,o.Sx,t),this}mat4f64(e,t){return this._appendField(e,o.E$,t),this}vec4u8(e,t){return this._appendField(e,o.XP,t),this}f32(e,t){return this._appendField(e,o.Y$,t),this}f64(e,t){return this._appendField(e,o.qB,t),this}u8(e,t){return this._appendField(e,o.SL,t),this}u16(e,t){return this._appendField(e,o.h,t),this}i8(e,t){return this._appendField(e,o.bf,t),this}vec2i8(e,t){return this._appendField(e,o.D6,t),this}vec2i16(e,t){return this._appendField(e,o.mJ,t),this}vec2u8(e,t){return this._appendField(e,o.LC,t),this}vec4u16(e,t){return this._appendField(e,o.Uz,t),this}u32(e,t){return this._appendField(e,o.P,t),this}_appendField(e,t,r){if(this._fields.has(e))return void(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const o=t.ElementCount*(0,i.GJ)(t.ElementType),n=this._stride;this._stride+=o,this._fields.set(e,{size:o,constructor:t,offset:n,optional:r})}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new s;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,r)=>e._fields.set(r,t))),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach((t=>e=Math.max(e,(0,i.GJ)(t.constructor.ElementType)))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function l(){return new s}class c{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const r={...e,constructor:u(e.constructor)};this.fields.push([t,r])})),this.stride=e.stride}}const d=[o.Y$,o.gH,o.xs,o.Eq,o.jZ,o.Sx,o.qB,o.si,o.Xm,o.Aj,o.j0,o.E$,o.SL,o.LC,o.eI,o.XP,o.h,o.Yi,o.nS,o.Uz,o.P,o.An,o.H$,o.ml,o.bf,o.D6,o.m8,o.TX,o.Qt,o.mJ,o.Vp,o.E7,o.My,o.UL,o.zD,o.Y4];function u(e){return`${e.ElementType}_${e.ElementCount}`}function h(e){return m.get(e)}const m=new Map;d.forEach((e=>m.set(u(e),e)))},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var o=r(49255),i=r(33752),a=r(47286),n=r(2597);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.G("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
263
|
+
`),e}const f=Object.freeze(Object.defineProperty({__proto__:null,build:m},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>i});var o=r(49186);let i=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}since(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new o.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[i,a]=t.split("."),n=/^\s*\d+\s*$/;if(!i?.match||!n.test(i))throw new o.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!a?.match||!n.test(a))throw new o.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const s=parseInt(i,10),l=parseInt(a,10);return new e(s,l,r)}}},61473:(e,t,r)=>{function o(e){return e=e||globalThis.location.hostname,c.some((t=>null!=e?.match(t)))}function i(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(a)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(n)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{EM:()=>i,b5:()=>o});const a=/^devext\.arcgis\.com$/,n=/^qaext\.arcgis\.com$/,s=/^[\w-]*\.mapsdevext\.arcgis\.com$/,l=/^[\w-]*\.mapsqa\.arcgis\.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,a,n,/^jsapps\.esri\.com$/,s,l]},11868:(e,t,r)=>{r.d(t,{oe:()=>i});var o=r(34275);function i(e,t=!1){return e<=o.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}},19582:(e,t,r)=>{r.d(t,{fetch:()=>ur});var o=r(61473),i=r(34727),a=r(77690),n=r(29242),s=r(58083),l=r(9093),c=r(48163),d=r(38954),u=r(51850),h=r(70328),m=r(11868),f=r(13030),p=r(73354),v=r(65686),g=r(43609),_=r(51737),x=r(78358),T=r(21015),b=r(4399),E=r(84498),A=r(51530),S=r(88340);function y(e){if(null==e)return null;const t=null!=e.offset?e.offset:S.uY,r=null!=e.rotation?e.rotation:0,o=null!=e.scale?e.scale:S.Un,i=(0,n.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,n.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),l=(0,n.fA)(o[0],0,0,0,o[1],0,0,0,1),c=(0,n.vt)();return(0,a.lw)(c,s,l),(0,a.lw)(c,i,c),c}class w{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class M{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new w,this.numberOfVertices=0}}var C=r(78888),R=r(60999),O=r(86805),I=r(49186),N=r(53966);class L{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(e,t){return this._outer.get(e)?.get(t)}set(e,t,r){const o=this._outer.get(e);o?o.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}forEach(e){this._outer.forEach(((t,r)=>e(t,r)))}}var H=r(74887),P=r(46140),D=r(97146);async function F(e,t){const{data:r}=await(0,C.A)(e,{responseType:"image",...t});return r}var B=r(46610),z=r(89192),V=r(75130),G=r(44208),W=r(65529),U=r(97768),j=r(34275),k=r(84952),q=r(56058),$=r(2741);let Y;var X,Z;(Z=X||(X={}))[Z.ETC1_RGB=0]="ETC1_RGB",Z[Z.ETC2_RGBA=1]="ETC2_RGBA",Z[Z.BC1_RGB=2]="BC1_RGB",Z[Z.BC3_RGBA=3]="BC3_RGBA",Z[Z.BC4_R=4]="BC4_R",Z[Z.BC5_RG=5]="BC5_RG",Z[Z.BC7_M6_RGB=6]="BC7_M6_RGB",Z[Z.BC7_M5_RGBA=7]="BC7_M5_RGBA",Z[Z.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",Z[Z.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",Z[Z.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",Z[Z.ATC_RGB=11]="ATC_RGB",Z[Z.ATC_RGBA=12]="ATC_RGBA",Z[Z.FXT1_RGB=17]="FXT1_RGB",Z[Z.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",Z[Z.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",Z[Z.ETC2_EAC_R11=20]="ETC2_EAC_R11",Z[Z.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",Z[Z.RGBA32=13]="RGBA32",Z[Z.RGB565=14]="RGB565",Z[Z.BGR565=15]="BGR565",Z[Z.RGBA4444=16]="RGBA4444";var J=r(63907),K=r(21231),Q=r(42293);let ee=null,te=null;async function re(){return null==te&&(Y??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,$.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),te=Y,ee=await te),te}function oe(e,t,r,o,i){const a=(0,Q.IB)(t?J.CQ.COMPRESSED_RGBA8_ETC2_EAC:J.CQ.COMPRESSED_RGB8_ETC2),n=i&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*o*a*n)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function ae(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,o,i,a,n,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?o?[X.ETC2_RGBA,J.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[X.ETC1_RGB,J.CQ.COMPRESSED_RGB8_ETC2]:c?o?[X.BC3_RGBA,J.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[X.BC1_RGB,J.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[X.RGBA32,J.Ab.RGBA],h=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<h;e++)m.push(new Uint8Array(n(e,d))),s(e,d,m[e]);return t.internalFormat=u,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?J.Cj.LINEAR_MIPMAP_LINEAR:J.Cj.LINEAR,t.width=i,t.height=a,new K.g(e,t,{type:"compressed",levels:m})}var se=r(69720),le=r(96672);const ce=()=>N.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function de(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const ue=de("DXT1"),he=de("DXT3"),me=de("DXT5");function fe(e,t,r){if(e instanceof ImageData)return fe(pe(e),t,r);const o=document.createElement("canvas");return o.width=t,o.height=r,o.getContext("2d").drawImage(e,0,0,o.width,o.height),o}function pe(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new I.A("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}var ve,ge,_e=r(620),xe=r(67171);class Te extends se.J{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=le.X.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new W.A,this._parameters={...Ee,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){null!=e&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!((0,k.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const t=()=>{e.removeEventListener("canplay",t),e.play()};e.addEventListener("canplay",t)}}}_startPreloadImageElement(e){(0,k.DB)(e.src)||(0,k.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new xe.R;return t.wrapMode=this._parameters.wrap??J.pF.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?J.Cj.LINEAR_MIPMAP_LINEAR:J.Cj.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||function(e,t){if(null==e)return 0;if((0,j.mw)(e)||(0,j.mg)(e))return t.encoding===z.JS.KTX2_ENCODING?function(e,t){if(null==ee)return e.byteLength;const r=new ee.KTX2File(new Uint8Array(e)),o=ae(r)?oe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):t.encoding===z.JS.BASIS_ENCODING?function(e,t){if(null==ee)return e.byteLength;const r=new ee.BasisFile(new Uint8Array(e)),o=ie(r)?oe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),o}(e,!!t.mipmap):e.byteLength;const{width:r,height:o}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?be(e):t;return(t.mipmap?4/3:1)*r*o*(t.components||4)||0}(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return null==t?(this._glTexture=new K.g(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):((0,j.mw)(t)||(0,j.mg)(t))&&this._parameters.encoding===z.JS.DDS_ENCODING?this._loadFromDDSData(e,t):((0,j.mw)(t)||(0,j.mg)(t))&&this._parameters.encoding===z.JS.KTX2_ENCODING?this._loadFromKTX2(e,t):((0,j.mw)(t)||(0,j.mg)(t))&&this._parameters.encoding===z.JS.BASIS_ENCODING?this._loadFromBasis(e,t):(0,j.mg)(t)?this._loadFromPixelData(e,t):(0,j.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return null==this._glTexture||e.readyState<ve.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._glTexture.setData(e),this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const o=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return ce().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return ce().error("Unsupported format, must contain a FourCC code"),null;const o=r[21];let i,a;switch(o){case ue:i=8,a=J.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case he:i=16,a=J.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case me:i=16,a=J.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return ce().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(o)),null}let n=1,s=r[4],l=r[3];(3&s||3&l)&&(ce().warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(n=Math.max(1,r[7]));let m=r[1]+4;const f=[];for(let t=0;t<n;++t)h=(s+3>>2)*(l+3>>2)*i,u=new Uint8Array(e,m,h),f.push(u),m+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:f},internalFormat:a,width:c,height:d}}(r,t.hasMipmap??!1);if(null==o)throw new Error("DDS texture data is null");const{textureData:i,internalFormat:a,width:n,height:s}=o;return t.samplingMode=i.levels.length>1?J.Cj.LINEAR_MIPMAP_LINEAR:J.Cj.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=a,t.width=n,t.height=s,new K.g(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){null==ee&&(ee=await re());const o=new ee.KTX2File(new Uint8Array(r));if(!ae(o))return null;o.startTranscoding();const i=ne(e,t,o.getLevels(),o.getHasAlpha(),o.getWidth(),o.getHeight(),((e,t)=>o.getImageTranscodedSizeInBytes(e,0,0,t)),((e,t,r)=>o.transcodeImage(r,e,0,0,t,0,-1,-1)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){null==ee&&(ee=await re());const o=new ee.BasisFile(new Uint8Array(r));if(!ie(o))return null;o.startTranscoding();const i=ne(e,t,o.getNumLevels(0),o.getHasAlpha(),o.getImageWidth(0,0),o.getImageHeight(0,0),((e,t)=>o.getImageTranscodedSizeInBytes(0,e,t)),((e,t,r)=>o.transcodeImage(r,0,e,t,0,0)));return o.close(),o.delete(),i}(e,this._createDescriptor(e),t).then((e=>(this._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,_e.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this._parameters.components?J.Ab.LUMINANCE:3===this._parameters.components?J.Ab.RGB:J.Ab.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new K.g(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync((async r=>{const o=await F(t,{signal:r});return(0,H.Te)(r),this._loadFromImage(e,o)}))}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync((async r=>{const o=await(0,q.Sx)(t,t.src,!1,r);return(0,H.Te)(r),this._loadFromImage(e,o)}))}_loadFromVideoElement(e,t){return t.readyState>=ve.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync((r=>new Promise(((o,i)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",s),(0,U.xt)(l)},n=()=>{t.readyState>=ve.HAVE_CURRENT_DATA&&(a(),o(this._loadFromImage(e,t)))},s=e=>{a(),i(e||new I.A("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",s);const l=(0,H.u7)(r,(()=>s((0,H.NK)())))}))))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:t}=e.parameters;r=this._parameters.downsampleUncompressed?function(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?pe(e):e;let o=e.width,i=e.height;do{o=Math.ceil(o/2),i=Math.ceil(i/2),r=o*i}while(r>1048576||null!=t&&(o>t||i>t));return fe(e,o,i)}(r,t):function(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const o=t/r;return fe(e,Math.round(e.width*o),Math.round(e.height*o))}(r,t)}const o=be(r);this._parameters.width=o.width,this._parameters.height=o.height;const i=this._createDescriptor(e);return i.pixelFormat=3===this._parameters.components?J.Ab.RGB:J.Ab.RGBA,i.width=o.width,i.height=o.height,this._glTexture=new K.g(e,i,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const o=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(o,o),r}unload(){if(this._glTexture=(0,U.WD)(this._glTexture),null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}function be(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}(ge=ve||(ve={}))[ge.HAVE_NOTHING=0]="HAVE_NOTHING",ge[ge.HAVE_METADATA=1]="HAVE_METADATA",ge[ge.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",ge[ge.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",ge[ge.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";const Ee={wrap:{s:J.pF.REPEAT,t:J.pF.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};var Ae=r(46540),Se=r(24151),ye=r(1843),we=r(49255),Me=r(96336),Ce=r(62602),Re=r(59469),Oe=r(25634),Ie=r(14903),Ne=r(14327),Le=r(90644);const He=(0,Le.p3)(J.dn.SRC_ALPHA,J.dn.ONE,J.dn.ONE_MINUS_SRC_ALPHA,J.dn.ONE_MINUS_SRC_ALPHA),Pe=(0,Le.p3)(J.dn.ONE,J.dn.ZERO,J.dn.ONE,J.dn.ONE_MINUS_SRC_ALPHA);function De(e){return e===Ne.y.FrontFace?null:Pe}const Fe={factor:-1,units:-2};function Be(e,t=J.MT.LESS){return e===Ne.y.NONE||e===Ne.y.FrontFace?t:J.MT.LEQUAL}function ze(e){return e===Ne.y.ColorAlpha?{buffers:[J.Nm.COLOR_ATTACHMENT0,J.Nm.COLOR_ATTACHMENT1]}:null}class Ve{constructor(e=!1,t=!0){this.isVerticalRay=e,this.normalRequired=t}}const Ge=(0,h.vt)();function We(e,t,r,o,i,a){if(!e.visible)return;const n=(0,d.A)(tt,o,r),s=(e,t,r)=>{a(e,r,t,!1)},l=new Ve(!1,t.options.normalRequired);if(e.boundingInfo){(0,_e.vA)(e.type===le.X.Mesh);const o=t.tolerance;je(e.boundingInfo,r,n,o,i,l,s)}else{const t=e.attributes.get(Ae.r.POSITION),o=t.indices;!function(e,t,r,o,i,a,n,s,l,c){const u=t,h=rt,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),v=m>=f?m>=p?0:2:f>=p?1:2,g=v,_=u[g]<0?2:1,x=(v+_)%3,T=(v+(3-_))%3,b=u[x]/u[g],E=u[T]/u[g],A=1/u[g],S=qe,y=$e,w=Ye,{normalRequired:M}=l;for(let t=r;t<o;++t){const r=3*t,o=n*i[r];(0,d.s)(h[0],a[o+0],a[o+1],a[o+2]);const l=n*i[r+1];(0,d.s)(h[1],a[l+0],a[l+1],a[l+2]);const u=n*i[r+2];(0,d.s)(h[2],a[u+0],a[u+1],a[u+2]),s&&((0,d.c)(h[0],s.applyToVertex(h[0][0],h[0][1],h[0][2],t)),(0,d.c)(h[1],s.applyToVertex(h[1][0],h[1][1],h[1][2],t)),(0,d.c)(h[2],s.applyToVertex(h[2][0],h[2][1],h[2][2],t))),(0,d.A)(S,h[0],e),(0,d.A)(y,h[1],e),(0,d.A)(w,h[2],e);const m=S[x]-b*S[g],f=S[T]-E*S[g],p=y[x]-b*y[g],v=y[T]-E*y[g],_=w[x]-b*w[g],C=w[T]-E*w[g],R=_*v-C*p,O=m*C-f*_,I=p*f-v*m;if((R<0||O<0||I<0)&&(R>0||O>0||I>0))continue;const N=R+O+I;if(0===N)continue;const L=R*(A*S[g])+O*(A*y[g])+I*(A*w[g]);if(L*Math.sign(N)<0)continue;const H=L/N;H>=0&&c(H,t,M?Ze(h):null)}}(r,n,0,o.length/3,o,t.data,t.stride,i,l,s)}}const Ue=(0,u.vt)();function je(e,t,r,o,i,a,n){if(null==e)return;const s=function(e,t){return(0,d.s)(t,1/e[0],1/e[1],1/e[2])}(r,Ue);if((0,h.Ne)(Ge,e.bbMin),(0,h.vI)(Ge,e.bbMax),null!=i&&i.applyToAabb(Ge),function(e,t,r,o){return function(e,t,r,o,i){const a=(e[0]-o-t[0])*r[0],n=(e[3]+o-t[0])*r[0];let s=Math.min(a,n),l=Math.max(a,n);const c=(e[1]-o-t[1])*r[1],d=(e[4]+o-t[1])*r[1];if(l=Math.min(l,Math.max(c,d)),l<0)return!1;if(s=Math.max(s,Math.min(c,d)),s>l)return!1;const u=(e[2]-o-t[2])*r[2],h=(e[5]+o-t[2])*r[2];return l=Math.min(l,Math.max(u,h)),!(l<0)&&(s=Math.max(s,Math.min(u,h)),!(s>l)&&s<1/0)}(e,t,r,o)}(Ge,t,s,o)){const{primitiveIndices:s,position:l}=e,c=s?s.length:l.indices.length/3;if(c>Qe){const s=e.getChildren();if(void 0!==s){for(const e of s)je(e,t,r,o,i,a,n);return}}!function(e,t,r,o,i,a,n,s,l,c,d){const u=e[0],h=e[1],m=e[2],f=t[0],p=t[1],v=t[2],{normalRequired:g}=c;for(let e=0;e<o;++e){const t=s[e],r=3*t,o=n*i[r];let c=a[o],_=a[o+1],x=a[o+2];const T=n*i[r+1];let b=a[T],E=a[T+1],A=a[T+2];const S=n*i[r+2];let y=a[S],w=a[S+1],M=a[S+2];null!=l&&([c,_,x]=l.applyToVertex(c,_,x,e),[b,E,A]=l.applyToVertex(b,E,A,e),[y,w,M]=l.applyToVertex(y,w,M,e));const C=b-c,R=E-_,O=A-x,I=y-c,N=w-_,L=M-x,H=p*L-N*v,P=v*I-L*f,D=f*N-I*p,F=C*H+R*P+O*D;if(Math.abs(F)<=et)continue;const B=u-c,z=h-_,V=m-x,G=B*H+z*P+V*D;if(F>0){if(G<0||G>F)continue}else if(G>0||G<F)continue;const W=z*O-R*V,U=V*C-O*B,j=B*R-C*z,k=f*W+p*U+v*j;if(F>0){if(k<0||G+k>F)continue}else if(k>0||G+k<F)continue;const q=(I*W+N*U+L*j)/F;q>=0&&d(q,t,g?Xe(C,R,O,I,N,L,ke):null)}}(t,r,0,c,l.indices,l.data,l.stride,s,i,a,n)}}const ke=(0,u.vt)();const qe=(0,u.vt)(),$e=(0,u.vt)(),Ye=(0,u.vt)();function Xe(e,t,r,o,i,a,n){return(0,d.s)(Je,e,t,r),(0,d.s)(Ke,o,i,a),(0,d.b)(n,Je,Ke),(0,d.n)(n,n),n}function Ze(e){return(0,d.A)(Je,e[1],e[0]),(0,d.A)(Ke,e[2],e[0]),(0,d.b)(ke,Je,Ke),(0,d.n)(ke,ke),ke}const Je=(0,u.vt)(),Ke=(0,u.vt)(),Qe=1e3,et=1e-7,tt=(0,u.vt)(),rt=[(0,u.vt)(),(0,u.vt)(),(0,u.vt)()];var ot,it;(it=ot||(ot={}))[it.INTEGRATED_MESH=0]="INTEGRATED_MESH",it[it.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",it[it.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",it[it.OPAQUE_NO_SSAO_DEPTH=3]="OPAQUE_NO_SSAO_DEPTH",it[it.TRANSPARENT_MATERIAL=4]="TRANSPARENT_MATERIAL",it[it.TRANSPARENT_NO_SSAO_DEPTH=5]="TRANSPARENT_NO_SSAO_DEPTH",it[it.TRANSPARENT_TERRAIN=6]="TRANSPARENT_TERRAIN",it[it.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=7]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",it[it.OCCLUDED_TERRAIN=8]="OCCLUDED_TERRAIN",it[it.OCCLUDER_MATERIAL=9]="OCCLUDER_MATERIAL",it[it.TRANSPARENT_OCCLUDER_MATERIAL=10]="TRANSPARENT_OCCLUDER_MATERIAL",it[it.OCCLUSION_PIXELS=11]="OCCLUSION_PIXELS",it[it.OPAQUE_ENVIRONMENT=12]="OPAQUE_ENVIRONMENT",it[it.TRANSPARENT_ENVIRONMENT=13]="TRANSPARENT_ENVIRONMENT",it[it.LASERLINES=14]="LASERLINES",it[it.LASERLINES_CONTRAST_CONTROL=15]="LASERLINES_CONTRAST_CONTROL",it[it.HUD_MATERIAL=16]="HUD_MATERIAL",it[it.LABEL_MATERIAL=17]="LABEL_MATERIAL",it[it.LINE_CALLOUTS=18]="LINE_CALLOUTS",it[it.LINE_CALLOUTS_HUD_DEPTH=19]="LINE_CALLOUTS_HUD_DEPTH",it[it.DRAPED_MATERIAL=20]="DRAPED_MATERIAL",it[it.DRAPED_WATER=21]="DRAPED_WATER",it[it.VIEWSHED=22]="VIEWSHED",it[it.VOXEL=23]="VOXEL",it[it.MAX_SLOTS=24]="MAX_SLOTS";var at=r(76412),nt=r(57005);const st=new class{constructor(e=0){this.offset=e,this.sphere=(0,at.c)(),this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=this.objectTransform.transform,i=(0,d.s)(lt,e,t,r),a=(0,d.h)(i,i,o),n=this.offset/(0,d.l)(a);(0,d.u)(a,a,a,n);const s=this.objectTransform.inverse;return(0,d.h)(this.tmpVertex,a,s),this.tmpVertex}applyToMinMax(e,t){const r=this.offset/(0,d.l)(e);(0,d.u)(e,e,e,r);const o=this.offset/(0,d.l)(t);(0,d.u)(t,t,t,o)}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=(0,d.l)((0,at.g)(e)),r=this.offset/t;return(0,d.u)((0,at.g)(this.sphere),(0,at.g)(e),(0,at.g)(e),r),this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,u.vt)(),this._tmpMbs=(0,at.c)(),this._tmpObb=new nt.ab,this._resetOffset(e)}_resetOffset(e){this._offset=e,this._totalOffset=e}set offset(e){this._resetOffset(e)}get offset(){return this._offset}set componentOffset(e){this._totalOffset=this._offset+e}set localOrigin(e){this.componentLocalOriginLength=(0,d.l)(e)}applyToVertex(e,t,r){const o=(0,d.s)(lt,e,t,r),i=(0,d.s)(ct,e,t,r+this.componentLocalOriginLength),a=this._totalOffset/(0,d.l)(i);return(0,d.u)(this._tmpVertex,o,i,a),this._tmpVertex}applyToAabb(e){const t=this.componentLocalOriginLength,r=e[0],o=e[1],i=e[2]+t,a=e[3],n=e[4],s=e[5]+t,l=Math.abs(r),c=Math.abs(o),d=Math.abs(i),u=Math.abs(a),h=Math.abs(n),m=Math.abs(s),f=.5*(1+Math.sign(r*a))*Math.min(l,u),p=.5*(1+Math.sign(o*n))*Math.min(c,h),v=.5*(1+Math.sign(i*s))*Math.min(d,m),g=Math.max(l,u),_=Math.max(c,h),x=Math.max(d,m),T=Math.sqrt(f*f+p*p+v*v),b=Math.sign(l+r),E=Math.sign(c+o),A=Math.sign(d+i),S=Math.sign(u+a),y=Math.sign(h+n),w=Math.sign(m+s),M=this._totalOffset;if(T<M)return e[0]-=(1-b)*M,e[1]-=(1-E)*M,e[2]-=(1-A)*M,e[3]+=S*M,e[4]+=y*M,e[5]+=w*M,e;const C=M/Math.sqrt(g*g+_*_+x*x),R=M/T,O=R-C,I=-O;return e[0]+=r*(b*I+R),e[1]+=o*(E*I+R),e[2]+=i*(A*I+R),e[3]+=a*(S*O+C),e[4]+=n*(y*O+C),e[5]+=s*(w*O+C),e}applyToMbs(e){const t=(0,d.l)((0,at.g)(e)),r=this._totalOffset/t;return(0,d.u)((0,at.g)(this._tmpMbs),(0,at.g)(e),(0,at.g)(e),r),this._tmpMbs[3]=e[3]+e[3]*this._totalOffset/t,this._tmpMbs}applyToObb(e){return(0,nt.gm)(e,this._totalOffset,this._totalOffset,Se.RT.Global,this._tmpObb),this._tmpObb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,u.vt)()}applyToVertex(e,t,r){const o=(0,d.s)(lt,e,t,r),i=(0,d.g)(ct,o,this.localOrigin),a=this.offset/(0,d.l)(i);return(0,d.u)(this.tmpVertex,o,i,a),this.tmpVertex}applyToAabb(e){const t=dt,r=ut,o=ht;for(let i=0;i<3;++i)t[i]=e[0+i]+this.localOrigin[i],r[i]=e[3+i]+this.localOrigin[i],o[i]=t[i];const i=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=i[t],e[t+3]=i[t];const a=t=>{const r=this.applyToVertex(t[0],t[1],t[2]);for(let t=0;t<3;++t)e[t]=Math.min(e[t],r[t]),e[t+3]=Math.max(e[t+3],r[t])};for(let e=1;e<8;++e){for(let i=0;i<3;++i)o[i]=e&1<<i?r[i]:t[i];a(o)}let n=0;for(let e=0;e<3;++e)t[e]*r[e]<0&&(n|=1<<e);if(0!==n&&7!==n)for(let e=0;e<8;++e)if(!(n&e)){for(let i=0;i<3;++i)o[i]=n&1<<i?0:e&1<<i?t[i]:r[i];a(o)}for(let t=0;t<3;++t)e[t]-=this.localOrigin[t],e[t+3]-=this.localOrigin[t];return e}};const lt=(0,u.vt)(),ct=(0,u.vt)(),dt=(0,u.vt)(),ut=(0,u.vt)(),ht=(0,u.vt)();function mt(e,t,r){const{data:o,indices:i}=e,a=t.typedBuffer,n=t.typedBufferStride,s=i.length;r*=n;for(let e=0;e<s;++e){const t=2*i[e];a[r]=o[t],a[r+1]=o[t+1],r+=n}}function ft(e,t,r,o){const{data:i,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,null==o||1===o)for(let e=0;e<l;++e){const t=3*a[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],r+=s}else for(let e=0;e<l;++e){const t=3*a[e];for(let e=0;e<o;++e)n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],r+=s}}function pt(e,t,r,o=1){const{data:i,indices:a}=e,n=t.typedBuffer,s=t.typedBufferStride,l=a.length;if(r*=s,1===o)for(let e=0;e<l;++e){const t=4*a[e];n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=s}else for(let e=0;e<l;++e){const t=4*a[e];for(let e=0;e<o;++e)n[r]=i[t],n[r+1]=i[t+1],n[r+2]=i[t+2],n[r+3]=i[t+3],r+=s}}function vt(e,t,r,o,i=1){const a=t.typedBuffer,n=t.typedBufferStride;if(o*=n,1===i)for(let t=0;t<r;++t)a[o]=e[0],a[o+1]=e[1],a[o+2]=e[2],a[o+3]=e[3],o+=n;else for(let t=0;t<r;++t)for(let t=0;t<i;++t)a[o]=e[0],a[o+1]=e[1],a[o+2]=e[2],a[o+3]=e[3],o+=n}function gt(e,t,r,o,i,a){switch(e){case Ae.r.POSITION:{(0,_e.vA)(3===t.size);const o=i.getField(e,f.xs);(0,_e.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void ft(e,r,o,i);const{data:a,indices:n}=e,l=r.typedBuffer,c=r.typedBufferStride,d=n.length,u=t[0],h=t[1],m=t[2],f=t[4],p=t[5],v=t[6],g=t[8],_=t[9],x=t[10],T=t[12],b=t[13],E=t[14];o*=c;let A=0,S=0,y=0;const w=(0,s.tZ)(t)?e=>{A=a[e]+T,S=a[e+1]+b,y=a[e+2]+E}:e=>{const t=a[e],r=a[e+1],o=a[e+2];A=u*t+f*r+g*o+T,S=h*t+p*r+_*o+b,y=m*t+v*r+x*o+E};if(1===i)for(let e=0;e<d;++e)w(3*n[e]),l[o]=A,l[o+1]=S,l[o+2]=y,o+=c;else for(let e=0;e<d;++e){w(3*n[e]);for(let e=0;e<i;++e)l[o]=A,l[o+1]=S,l[o+2]=y,o+=c}}(t,r,o,a);break}case Ae.r.NORMAL:{(0,_e.vA)(3===t.size);const r=i.getField(e,f.xs);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&function(e,t,r,o,i=1){if(!t)return void ft(e,r,o,i);const{data:a,indices:n}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=n.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),E=1e-6,A=1-E;o*=d;let S=0,y=0,w=0;const M=(0,s.tZ)(l)?e=>{S=a[e],y=a[e+1],w=a[e+2]}:e=>{const t=a[e],r=a[e+1],o=a[e+2];S=h*t+p*r+_*o,y=m*t+v*r+x*o,w=f*t+g*r+T*o};if(1===i)if(b)for(let e=0;e<u;++e){M(3*n[e]);const t=S*S+y*y+w*w;if(t<A&&t>E){const e=1/Math.sqrt(t);c[o]=S*e,c[o+1]=y*e,c[o+2]=w*e}else c[o]=S,c[o+1]=y,c[o+2]=w;o+=d}else for(let e=0;e<u;++e)M(3*n[e]),c[o]=S,c[o+1]=y,c[o+2]=w,o+=d;else for(let e=0;e<u;++e){if(M(3*n[e]),b){const e=S*S+y*y+w*w;if(e<A&&e>E){const t=1/Math.sqrt(e);S*=t,y*=t,w*=t}}for(let e=0;e<i;++e)c[o]=S,c[o+1]=y,c[o+2]=w,o+=d}}(t,o,r,a);break}case Ae.r.NORMALCOMPRESSED:{(0,_e.vA)(2===t.size);const r=i.getField(e,f.mJ);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&mt(t,r,a);break}case Ae.r.UV0:{(0,_e.vA)(2===t.size);const r=i.getField(e,f.gH);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&mt(t,r,a);break}case Ae.r.COLOR:case Ae.r.SYMBOLCOLOR:{const r=i.getField(e,f.XP);(0,_e.vA)(!!r,`No buffer view for ${e}`),(0,_e.vA)(3===t.size||4===t.size),!r||3!==t.size&&4!==t.size||function(e,t,r,o,i=1){const{data:a,indices:n}=e,s=r.typedBuffer,l=r.typedBufferStride,c=n.length;if(o*=l,t!==a.length||4!==t)if(1!==i)if(4!==t)for(let e=0;e<c;++e){const t=3*n[e];for(let e=0;e<i;++e)s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=255,o+=l}else for(let e=0;e<c;++e){const t=4*n[e];for(let e=0;e<i;++e)s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=a[t+3],o+=l}else{if(4===t){for(let e=0;e<c;++e){const t=4*n[e];s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=a[t+3],o+=l}return}for(let e=0;e<c;++e){const t=3*n[e];s[o]=a[t],s[o+1]=a[t+1],s[o+2]=a[t+2],s[o+3]=255,o+=l}}else{s[o]=a[0],s[o+1]=a[1],s[o+2]=a[2],s[o+3]=a[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=l/4,n=e[o/=4];o+=t;const d=c*i;for(let r=1;r<d;++r)e[o]=n,o+=t}}(t,t.size,r,a);break}case Ae.r.COLORFEATUREATTRIBUTE:{const r=i.getField(e,f.Y$);(0,_e.vA)(!!r,`No buffer view for ${e}`),(0,_e.vA)(1===t.size),r&&1===t.size&&function(e,t,r){const{data:o,indices:i}=e,a=t.typedBuffer,n=t.typedBufferStride,s=i.length,l=o[0];r*=n;for(let e=0;e<s;++e)a[r]=l,r+=n}(t,r,a);break}case Ae.r.TANGENT:{(0,_e.vA)(4===t.size);const o=i.getField(e,f.Eq);(0,_e.vA)(!!o,`No buffer view for ${e}`),o&&function(e,t,r,o,i=1){if(!t)return void pt(e,r,o,i);const{data:a,indices:n}=e,l=t,c=r.typedBuffer,d=r.typedBufferStride,u=n.length,h=l[0],m=l[1],f=l[2],p=l[4],v=l[5],g=l[6],_=l[8],x=l[9],T=l[10],b=!(0,s.ut)(l),E=1e-6,A=1-E;if(o*=d,1===i)for(let e=0;e<u;++e){const t=4*n[e],r=a[t],i=a[t+1],s=a[t+2],l=a[t+3];let u=h*r+p*i+_*s,S=m*r+v*i+x*s,y=f*r+g*i+T*s;if(b){const e=u*u+S*S+y*y;if(e<A&&e>E){const t=1/Math.sqrt(e);u*=t,S*=t,y*=t}}c[o]=u,c[o+1]=S,c[o+2]=y,c[o+3]=l,o+=d}else for(let e=0;e<u;++e){const t=4*n[e],r=a[t],s=a[t+1],l=a[t+2],u=a[t+3];let S=h*r+p*s+_*l,y=m*r+v*s+x*l,w=f*r+g*s+T*l;if(b){const e=S*S+y*y+w*w;if(e<A&&e>E){const t=1/Math.sqrt(e);S*=t,y*=t,w*=t}}for(let e=0;e<i;++e)c[o]=S,c[o+1]=y,c[o+2]=w,c[o+3]=u,o+=d}}(t,r,o,a);break}case Ae.r.PROFILERIGHT:case Ae.r.PROFILEUP:case Ae.r.PROFILEVERTEXANDNORMAL:case Ae.r.FEATUREVALUE:{(0,_e.vA)(4===t.size);const r=i.getField(e,f.Eq);(0,_e.vA)(!!r,`No buffer view for ${e}`),r&&pt(t,r,a)}}}class _t{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(Ae.r.POSITION).indices.length}write(e,t,r,o,i){!function(e,t,r,o,i,a){for(const n of t.fields.keys()){const t=e.attributes.get(n),s=t?.indices;if(t&&s)gt(n,t,r,o,i,a);else if(n===Ae.r.OBJECTANDLAYERIDCOLOR&&null!=e.objectAndLayerIdColor){const t=e.attributes.get(Ae.r.POSITION)?.indices;if(t){const r=t.length,o=i.getField(n,f.XP);vt(e.objectAndLayerIdColor,o,r,a)}}}}(r,this.vertexBufferLayout,e,t,o,i)}}var xt=r(19245),Tt=r(91829),bt=r(53466),Et=r(72824),At=r(35093),St=r(97220),yt=r(84867),wt=r(39341),Mt=r(34886);J.MT.LESS,J.MT.ALWAYS;const Ct={mask:255},Rt={function:{func:J.MT.ALWAYS,ref:z.dd.OutlineVisualElementMask,mask:z.dd.OutlineVisualElementMask},operation:{fail:J.eA.KEEP,zFail:J.eA.KEEP,zPass:J.eA.ZERO}},Ot={function:{func:J.MT.ALWAYS,ref:z.dd.OutlineVisualElementMask,mask:z.dd.OutlineVisualElementMask},operation:{fail:J.eA.KEEP,zFail:J.eA.KEEP,zPass:J.eA.REPLACE}};J.MT.EQUAL,z.dd.OutlineVisualElementMask,z.dd.OutlineVisualElementMask,J.eA.KEEP,J.eA.KEEP,J.eA.KEEP,J.MT.NOTEQUAL,z.dd.OutlineVisualElementMask,z.dd.OutlineVisualElementMask,J.eA.KEEP,J.eA.KEEP,J.eA.KEEP;const It=[1,1,.5],Nt=[0,.6,.2],Lt=[0,1,.2];var Ht=r(28491);class Pt extends Et.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=(0,u.ci)(It),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=z.s2.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=(0,u.fA)(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Me.W.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=(0,u.fA)(.2,.2,.2),this.diffuse=(0,u.fA)(.8,.8,.8),this.externalColor=(0,Tt.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,u.vt)(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=z.it.Less,this.textureAlphaMode=z.sf.Blend,this.textureAlphaCutoff=At.H,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Ie.m$.Occlude,this.isDecoration=!1}}Et.gy;class Dt extends yt.w{initializeConfiguration(e,t){t.spherical=e.viewingMode===Se.RT.Global,t.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,t.textureCoordinateType=t.hasColorTexture||t.hasMetallicRoughnessTexture||t.hasEmissionTexture||t.hasOcclusionTexture||t.hasNormalTexture?bt.q.Default:bt.q.None,t.objectAndLayerIdColorInstanced=t.instanced}initializeProgram(e){return this._initializeProgram(e,Dt.shader)}_initializeProgram(e,t){return new Mt.B(e.rctx,t.get().build(this.configuration),wt.D)}_makePipeline(e,t){const r=this.configuration,o=e===Ne.y.NONE,i=e===Ne.y.FrontFace;return(0,Le.Ey)({blending:r.output===we.V.Color&&r.transparent?o?He:De(e):null,culling:Bt(r)?(0,Le.Xt)(r.cullFace):null,depthTest:{func:Be(e,Ft(r.customDepthTest))},depthWrite:(o||i)&&r.writeDepth?Le.kn:null,drawBuffers:r.output===we.V.Depth?{buffers:[J.Hr.NONE]}:ze(e),colorWrite:Le.wE,stencilWrite:r.hasOccludees?Ct:null,stencilTest:r.hasOccludees?t?Ot:Rt:null,polygonOffset:o||i?null:(a=r.enableOffset,a?Fe:null)});var a}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}function Ft(e){return e===z.it.Lequal?J.MT.LEQUAL:J.MT.LESS}function Bt(e){return e.cullFace!==z.s2.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}Dt.shader=new St.$(Ht.D,(()=>r.e(5141).then(r.bind(r,5141))));var zt=r(90237),Vt=r(99769),Gt=r(82991),Wt=r(46263);class Ut extends Gt.nW{}(0,zt._)([(0,Vt.W)({constValue:!0})],Ut.prototype,"hasSliceHighlight",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],Ut.prototype,"hasSliceInVertexProgram",void 0),(0,zt._)([(0,Vt.W)({constValue:Wt.c.Pass})],Ut.prototype,"pbrTextureBindType",void 0);class jt extends Ut{constructor(){super(...arguments),this.output=we.V.Color,this.alphaDiscardMode=z.sf.Opaque,this.doubleSidedMode=Ce.W.None,this.pbrMode=Re.A9.Disabled,this.cullFace=z.s2.None,this.transparencyPassType=Ne.y.NONE,this.normalType=Me.W.Attribute,this.textureCoordinateType=bt.q.None,this.customDepthTest=z.it.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}(0,zt._)([(0,Vt.W)({count:we.V.COUNT})],jt.prototype,"output",void 0),(0,zt._)([(0,Vt.W)({count:z.sf.COUNT})],jt.prototype,"alphaDiscardMode",void 0),(0,zt._)([(0,Vt.W)({count:Ce.W.COUNT})],jt.prototype,"doubleSidedMode",void 0),(0,zt._)([(0,Vt.W)({count:Re.A9.COUNT})],jt.prototype,"pbrMode",void 0),(0,zt._)([(0,Vt.W)({count:z.s2.COUNT})],jt.prototype,"cullFace",void 0),(0,zt._)([(0,Vt.W)({count:Ne.y.COUNT})],jt.prototype,"transparencyPassType",void 0),(0,zt._)([(0,Vt.W)({count:Me.W.COUNT})],jt.prototype,"normalType",void 0),(0,zt._)([(0,Vt.W)({count:bt.q.COUNT})],jt.prototype,"textureCoordinateType",void 0),(0,zt._)([(0,Vt.W)({count:z.it.COUNT})],jt.prototype,"customDepthTest",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"spherical",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasVertexColors",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasSymbolColors",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasVerticalOffset",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasSlicePlane",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasSliceHighlight",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasColorTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasMetallicRoughnessTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasEmissionTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasOcclusionTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasNormalTexture",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasScreenSizePerspective",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasVertexTangents",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasOccludees",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"multipassEnabled",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasModelTransformation",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"offsetBackfaces",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"vvSize",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"vvColor",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"receiveShadows",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"receiveAmbientOcclusion",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"textureAlphaPremultiplied",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"instanced",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"instancedColor",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"objectAndLayerIdColorInstanced",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"instancedDoublePrecision",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"doublePrecisionRequiresObfuscation",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"writeDepth",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"transparent",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"enableOffset",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"cullAboveGround",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"snowCover",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasColorTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasEmissionTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasNormalTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasOcclusionTextureTransform",void 0),(0,zt._)([(0,Vt.W)()],jt.prototype,"hasMetallicRoughnessTextureTransform",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],jt.prototype,"occlusionPass",void 0),(0,zt._)([(0,Vt.W)({constValue:!0})],jt.prototype,"hasVvInstancing",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],jt.prototype,"useCustomDTRExponentForWater",void 0),(0,zt._)([(0,Vt.W)({constValue:!1})],jt.prototype,"supportsTextureAtlas",void 0),(0,zt._)([(0,Vt.W)({constValue:!0})],jt.prototype,"useFillLights",void 0);var kt=r(57323);class qt extends Dt{initializeConfiguration(e,t){super.initializeConfiguration(e,t),t.hasMetallicRoughnessTexture=!1,t.hasEmissionTexture=!1,t.hasOcclusionTexture=!1,t.hasNormalTexture=!1,t.hasModelTransformation=!1,t.normalType=Me.W.Attribute,t.doubleSidedMode=Ce.W.WindingOrder,t.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,qt.shader)}}qt.shader=new St.$(kt.R,(()=>r.e(9933).then(r.bind(r,39933))));class $t extends Ie.im{constructor(e){super(e,Xt),this.supportsEdges=!0,this.produces=new Map([[ot.OPAQUE_MATERIAL,e=>((0,we.XY)(e)||(0,we.PJ)(e))&&!this.parameters.transparent],[ot.TRANSPARENT_MATERIAL,e=>((0,we.XY)(e)||(0,we.PJ)(e))&&this.parameters.transparent&&this.parameters.writeDepth],[ot.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,e=>((0,we.XY)(e)||(0,we.PJ)(e))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._configuration=new jt,this._vertexBufferLayout=function(e){const t=(0,ye.BP)().vec3f(Ae.r.POSITION);return e.normalType===Me.W.Compressed?t.vec2i16(Ae.r.NORMALCOMPRESSED,{glNormalized:!0}):t.vec3f(Ae.r.NORMAL),e.hasVertexTangents&&t.vec4f(Ae.r.TANGENT),(e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId)&&t.vec2f(Ae.r.UV0),e.hasVertexColors&&t.vec4u8(Ae.r.COLOR),e.hasSymbolColors&&t.vec4u8(Ae.r.SYMBOLCOLOR),(0,G.A)("enable-feature:objectAndLayerId-rendering")&&t.vec4u8(Ae.r.OBJECTANDLAYERIDCOLOR),t}(this.parameters)}isVisibleForOutput(e){return e!==we.V.Shadow&&e!==we.V.ShadowExcludeHighlight&&e!==we.V.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const{hasInstancedColor:t,hasVertexColors:r,hasSymbolColors:o,vvColor:i}=e,a="replace"===e.colorMixMode,n=e.opacity>0,s=e.externalColor&&e.externalColor[3]>0,l=t||i||o;return r&&l?a||n:r?a?s:n:l?a||n:a?s:n}getConfiguration(e,t){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=null!=this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,null!=this.parameters.customDepthTest&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?z.s2.None:this.parameters.cullFace,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=null!=this.parameters.modelTransformation,e===we.V.Color&&(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Ce.W.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ce.W.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ce.W.WindingOrder:Ce.W.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=this.parameters.receiveAmbientOcclusion&&null!=t.ssao,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?Re.A9.Schematic:Re.A9.Normal:Re.A9.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.enableOffset=t.camera.relativeElevation<5e5,this._configuration.snowCover=this.hasSnowCover(t),this._configuration.hasColorTextureTransform=!!this.parameters.colorTextureTransformMatrix,this._configuration.hasNormalTextureTransform=!!this.parameters.normalTextureTransformMatrix,this._configuration.hasEmissionTextureTransform=!!this.parameters.emissiveTextureTransformMatrix,this._configuration.hasOcclusionTextureTransform=!!this.parameters.occlusionTextureTransformMatrix,this._configuration.hasMetallicRoughnessTextureTransform=!!this.parameters.metallicRoughnessTextureTransformMatrix),this._configuration}hasSnowCover(e){return null!=e.weather&&e.weatherVisible&&"snowy"===e.weather.type&&"enabled"===e.weather.snowCover}intersect(e,t,r,o,i,a){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,d.s)(tr,t[12],t[13],t[14]);let a=null;switch(r.viewingMode){case Se.RT.Global:a=(0,d.n)(Qt,tr);break;case Se.RT.Local:a=(0,d.c)(Qt,Kt)}let n=0;const s=(0,d.f)(rr,tr,e.eye),l=(0,d.l)(s),c=(0,d.j)(s,s,1/l);let u=null;this.parameters.screenSizePerspective&&(u=(0,d.m)(a,c)),n+=(0,xt.kE)(e,l,this.parameters.verticalOffset,u??0,this.parameters.screenSizePerspective),(0,d.j)(a,a,n),(0,d.t)(er,a,r.transform.inverseRotation),o=(0,d.f)(Zt,o,er),i=(0,d.f)(Jt,i,er)}var n;We(e,r,o,i,null!=(n=r.verticalOffset)?(st.offset=n,st):null,a)}createGLMaterial(e){return new Yt(e)}createBufferWriter(){return new _t(this._vertexBufferLayout)}}class Yt extends Oe.m{constructor(e){super({...e,...e.material.parameters})}_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMap.enabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){this._output===we.V.Color&&(this._updateShadowState(e),this._updateOccludeeState(e));const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,d.s)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(t.treeRendering?qt:Dt,e)}}const Xt=new class extends Pt{constructor(){super(...arguments),this.initTextureTransparent=!1,this.treeRendering=!1,this.hasVertexTangents=!1}},Zt=(0,u.vt)(),Jt=(0,u.vt)(),Kt=(0,u.fA)(0,0,1),Qt=(0,u.vt)(),er=(0,u.vt)(),tr=(0,u.vt)(),rr=(0,u.vt)(),or=()=>N.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function ir(e){throw new I.A("",`Request for object resource failed: ${e}`)}function ar(e){const t=e.params,r=t.topology;let o=!0;switch(t.vertexAttributes||(or().warn("Geometry must specify vertex attributes"),o=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(or().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),o=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(or().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),o=!1)):(or().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),o=!1)}}else or().warn("Indexed geometries must specify faces"),o=!1;break}default:or().warn(`Unsupported topology '${r}'`),o=!1}e.params.material||(or().warn("Geometry requires material"),o=!1);const i=e.params.vertexAttributes;for(const e in i)i[e].values||(or().warn("Geometries with externally defined attributes are not yet supported"),o=!1);return o}function nr(e){const t=(0,h.Ie)();return e.forEach((e=>{const r=e.boundingInfo;null!=r&&((0,h.iT)(t,r.bbMin),(0,h.iT)(t,r.bbMax))})),t}function sr(e){switch(e){case"mask":return z.sf.Mask;case"maskAndTransparency":return z.sf.MaskBlend;case"none":return z.sf.Opaque;default:return z.sf.Blend}}function lr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const cr=new P.R(1,2,"wosr");var dr=r(61765);async function ur(e,t){const r=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=t?.streamDataRequester;if(r)return async function(e,t,r){const o=await(0,R.Ke)(t.request(e,"json",r));if(!0===o.ok)return o.value;(0,H.QP)(o.error),ir(o.error.details.url)}(e,r,t);const o=await(0,R.Ke)((0,C.A)(e,t));if(!0===o.ok)return o.value.data;(0,H.QP)(o.error),ir(o.error)}(e,t),o=await async function(e,t){const r=new Array;for(const o in e){const i=e[o],a=i.images[0].data;if(!a){or().warn("Externally referenced texture data is not yet supported");continue}const n=i.encoding+";base64,"+a,s="/textureDefinitions/"+o,l="rgba"===i.channels?i.alphaChannelUsage||"transparency":"none",c={noUnpackFlip:!0,wrap:{s:J.pF.REPEAT,t:J.pF.REPEAT},preMultiplyAlpha:sr(l)!==z.sf.Opaque},d=t?.disableTextures?Promise.resolve(null):F(n,t);r.push(d.then((e=>({refId:s,image:e,parameters:c,alphaChannelUsage:l}))))}const o=await Promise.all(r),i={};for(const e of o)i[e.refId]=e;return i}(r.textureDefinitions??{},t);let i=0;for(const e in o)if(o.hasOwnProperty(e)){const t=o[e];i+=t?.image?t.image.width*t.image.height*4:0}return{resource:r,textures:o,size:i+(0,O.iL)(r)}}(r.url,t)),{engineResources:o,referenceBoundingBox:i}=function(e,t){const r=new Array,o=new Array,i=new Array,a=new L,n=e.resource,s=P.R.parse(n.version||"1.0","wosr");cr.validate(s);const l=n.model.name,c=n.model.geometries,d=n.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<c.length;e++){const n=c[e];if(!ar(n))continue;const s=lr(n),l=n.params.vertexAttributes,p=[],v=e=>{if("PerAttributeArray"===n.params.topology)return null;const t=n.params.faces;for(const r in t)if(r===e)return t[r].values;return null},g=l[Ae.r.POSITION],_=g.values.length/g.valuesPerElement;for(const e in l){const t=l[e],r=t.values,o=v(e)??(0,D.tM)(_);p.push([e,new B.n(r,o,t.valuesPerElement,!0)])}const x=s.texture,T=h&&h[x];if(T&&!f.has(x)){const{image:e,parameters:t}=T,r=new Te(e,t);o.push(r),f.set(x,r)}const b=f.get(x),E=b?b.id:void 0,A=s.material;let S=a.get(A,x);if(null==S){const e=d[A.substring(A.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=T&&T.alphaChannelUsage,o=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,i=T?sr(T.alphaChannelUsage):void 0,n={ambient:(0,u.ci)(e.diffuse),diffuse:(0,u.ci)(e.diffuse),opacity:1-(e.transparency||0),transparent:o,textureAlphaMode:i,textureAlphaCutoff:.33,textureId:E,initTextureTransparent:!0,doubleSided:!0,cullFace:z.s2.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:T?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),S=new $t(n),a.set(A,x,S)}i.push(S);const y=new V.V(S,p);m+=p.find((e=>e[0]===Ae.r.POSITION))?.[1]?.indices.length??0,r.push(y)}return{engineResources:[{name:l,stageResources:{textures:o,materials:i,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:nr(r)}}(e,t);return{lods:o,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,!!t.usePBR):(0,b.y)(new T.R(t.streamDataRequester),r.url,t,t.usePBR)),S=n.model.meta?.ESRI_proxyEllipsoid,w=n.meta.isEsriSymbolResource&&null!=S&&"EsriRealisticTreesStyle"===n.meta.ESRI_webstyle;w&&!n.customMeta.esriTreeRendering&&(n.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const i of o.parts){const o=i.attributes.normal;if(null==o)return;const a=i.attributes.position,n=a.count,c=(0,u.vt)(),h=(0,u.vt)(),m=(0,u.vt)(),p=new Uint8Array(4*n),v=new Float64Array(3*n),g=(0,s.B8)((0,l.vt)(),i.transform);let _=0,x=0;for(let s=0;s<n;s++){a.getVec(s,h),o.getVec(s,c),(0,d.h)(h,h,i.transform),(0,d.f)(m,h,t.center),(0,d.F)(m,m,t.radius);const n=m[2],l=(0,d.l)(m),u=Math.min(.45+.55*l*l,1);(0,d.F)(m,m,t.radius),null!==g&&(0,d.h)(m,m,g),(0,d.n)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,d.o)(m,m,c,n>-1?.2:Math.min(-4*n-3.8,1)),v[_]=m[0],v[_+1]=m[1],v[_+2]=m[2],_+=3,p[x]=255*u,p[x+1]=255*u,p[x+2]=255*u,p[x+3]=255,x+=4}i.attributes.normal=new f.xs(v),i.attributes.color=new f.XP(p)}}}(n,S));const I=!!t.usePBR,N=n.meta.isEsriSymbolResource?{usePBR:I,isSchematic:!1,treeRendering:w,mrrFactors:[...Lt]}:{usePBR:I,isSchematic:!1,treeRendering:!1,mrrFactors:[...It]},G={...t.materialParameters,treeRendering:w},{engineResources:W,referenceBoundingBox:U}=function(e,t,r,o){const n=e.model,s=new Array,l=new Map,T=new Map,b=n.lods.length,S=(0,h.Ie)();return n.lods.forEach(((e,w)=>{const C=!0===o.skipHighLods&&(b>1&&0===w||b>3&&1===w)||!1===o.skipHighLods&&null!=o.singleLodIndex&&w!==o.singleLodIndex;if(C&&0!==w)return;const R=new M(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach((e=>{const o=C?new $t({}):function(e,t,r,o,i,a,n){const s=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),l=e.materials.get(t.material),h=null!=t.attributes.texCoord0,m=null!=t.attributes.normal;if(null==l)return null;const f=function(e){switch(e){case"BLEND":return z.sf.Blend;case"MASK":return z.sf.Mask;case"OPAQUE":case null:case void 0:return z.sf.Opaque}}(l.alphaMode);if(!a.has(s)){if(h){const t=(t,r=!1)=>{if(null!=t&&!n.has(t)){const o=e.textures.get(t);if(null!=o){const e=o.data;n.set(t,new Te((0,A.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,A.x3)(e)&&r,encoding:(0,A.x3)(e)&&null!=e.encoding?e.encoding:void 0}))}}};t(l.textureColor,f!==z.sf.Opaque),t(l.textureNormal),t(l.textureOcclusion),t(l.textureEmissive),t(l.textureMetallicRoughness)}const r=l.color[0]**(1/dr.T),p=l.color[1]**(1/dr.T),v=l.color[2]**(1/dr.T),g=l.emissiveFactor[0]**(1/dr.T),_=l.emissiveFactor[1]**(1/dr.T),x=l.emissiveFactor[2]**(1/dr.T),T=null!=l.textureColor&&h?n.get(l.textureColor):null,b=function({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:o,emissiveTexture:i,emissiveFactor:a,occlusionTexture:n}){return null==e&&null==t&&null==i&&(null==a||(0,d.e)(a,u.uY))&&null==n&&(null==o||1===o)&&(null==r||1===r)}({normalTexture:l.textureNormal,metallicRoughnessTexture:l.textureMetallicRoughness,metallicFactor:l.metallicFactor,roughnessFactor:l.roughnessFactor,emissiveTexture:l.textureEmissive,emissiveFactor:l.emissiveFactor,occlusionTexture:l.textureOcclusion}),E=null!=l.normalTextureTransform?.scale?l.normalTextureTransform?.scale:c.Un;a.set(s,new $t({...o,transparent:f===z.sf.Blend,customDepthTest:z.it.Lequal,textureAlphaMode:f,textureAlphaCutoff:l.alphaCutoff,diffuse:[r,p,v],ambient:[r,p,v],opacity:l.opacity,doubleSided:l.doubleSided,doubleSidedType:"winding-order",cullFace:l.doubleSided?z.s2.None:z.s2.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?Me.W.Attribute:Me.W.ScreenDerivative,castShadows:!0,receiveShadows:l.receiveShadows,receiveAmbientOcclusion:l.receiveAmbientOcclustion,textureId:null!=T?T.id:void 0,colorMixMode:l.colorMixMode,normalTextureId:null!=l.textureNormal&&h?n.get(l.textureNormal).id:void 0,textureAlphaPremultiplied:null!=T&&!!T.parameters.preMultiplyAlpha,occlusionTextureId:null!=l.textureOcclusion&&h?n.get(l.textureOcclusion).id:void 0,emissiveTextureId:null!=l.textureEmissive&&h?n.get(l.textureEmissive).id:void 0,metallicRoughnessTextureId:null!=l.textureMetallicRoughness&&h?n.get(l.textureMetallicRoughness).id:void 0,emissiveFactor:[g,_,x],mrrFactors:b?[...Nt]:[l.metallicFactor,l.roughnessFactor,o.mrrFactors[2]],isSchematic:b,colorTextureTransformMatrix:y(l.colorTextureTransform),normalTextureTransformMatrix:y(l.normalTextureTransform),scale:[E[0],E[1]],occlusionTextureTransformMatrix:y(l.occlusionTextureTransform),emissiveTextureTransformMatrix:y(l.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:y(l.metallicRoughnessTextureTransform),...i}))}const p=a.get(s);if(r.stageResources.materials.push(p),h){const e=e=>{null!=e&&r.stageResources.textures.push(n.get(e))};e(l.textureColor),e(l.textureNormal),e(l.textureOcclusion),e(l.textureEmissive),e(l.textureMetallicRoughness)}return p}(n,e,R,t,r,l,T),{geometry:s,vertexCount:b}=function(e,t){const r=e.attributes.position.count,o=(0,E.x)(e.indices||r,e.primitiveType),n=(0,m.oe)(3*r),{typedBuffer:s,typedBufferStride:l}=e.attributes.position;(0,p.a)(n,s,e.transform,3,l);const c=[[Ae.r.POSITION,new B.n(n,o,3,!0)]];if(null!=e.attributes.normal){const t=(0,m.oe)(3*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.normal;(0,a.Ge)(hr,e.transform),(0,p.t)(t,n,hr,3,s),(0,i.or)(hr)&&(0,p.n)(t,t),c.push([Ae.r.NORMAL,new B.n(t,o,3,!0)])}if(null!=e.attributes.tangent){const t=(0,m.oe)(4*r),{typedBuffer:n,typedBufferStride:s}=e.attributes.tangent;(0,a.z0)(hr,e.transform),(0,v.t)(t,n,hr,4,s),(0,i.or)(hr)&&(0,p.n)(t,t,4),c.push([Ae.r.TANGENT,new B.n(t,o,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,m.oe)(2*r),{typedBuffer:i,typedBufferStride:a}=e.attributes.texCoord0;(0,g.n)(t,i,2,a),c.push([Ae.r.UV0,new B.n(t,o,2,!0)])}const d=e.attributes.color;if(null!=d){const t=new Uint8Array(4*r);4===d.elementCount?d instanceof f.Eq?(0,v.s)(t,d,255):d instanceof f.XP?(0,x.c)(t,d):d instanceof f.Uz&&(0,v.s)(t,d,1/256):(t.fill(255),d instanceof f.xs?(0,p.s)(t,d.typedBuffer,255,4,d.typedBufferStride):e.attributes.color instanceof f.eI?(0,_.c)(t,d.typedBuffer,4,e.attributes.color.typedBufferStride):e.attributes.color instanceof f.nS&&(0,p.s)(t,d.typedBuffer,1/256,4,d.typedBufferStride)),c.push([Ae.r.COLOR,new B.n(t,o,4,!0)])}return{geometry:new V.V(t,c),vertexCount:r}}(e,null!=o?o:new $t({})),M=s.boundingInfo;null!=M&&0===w&&((0,h.iT)(S,M.bbMin),(0,h.iT)(S,M.bbMax)),null!=o&&(R.stageResources.geometries.push(s),R.numberOfVertices+=b)})),C||s.push(R)})),{engineResources:s,referenceBoundingBox:S}}(n,N,G,t.skipHighLods&&null==r.specifiedLodIndex?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:W,referenceBoundingBox:U,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1}}const hr=(0,n.vt)()},1843:(e,t,r)=>{r.d(t,{BP:()=>l,l5:()=>c});var o=r(13030),i=r(90239),a=r(620);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,o=e.count){const i=this.stride;if(i%4==0){const a=new Uint32Array(e.buffer,t*i,o*i/4);new Uint32Array(this.buffer,r*i,o*i/4).set(a)}else{const a=new Uint8Array(e.buffer,t*i,o*i);new Uint8Array(this.buffer,r*i,o*i).set(a)}return this}get usedMemory(){return this.byteLength}dispose(){}}class s{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach((e=>this._fields.set(e[0],{...e[1],constructor:h(e[1].constructor)}))))}freeze(){return this}vec2f(e,t){return this._appendField(e,o.gH,t),this}vec2f64(e,t){return this._appendField(e,o.si,t),this}vec3f(e,t){return this._appendField(e,o.xs,t),this}vec3f64(e,t){return this._appendField(e,o.Xm,t),this}vec4f(e,t){return this._appendField(e,o.Eq,t),this}vec4f64(e,t){return this._appendField(e,o.Aj,t),this}mat3f(e,t){return this._appendField(e,o.jZ,t),this}mat3f64(e,t){return this._appendField(e,o.j0,t),this}mat4f(e,t){return this._appendField(e,o.Sx,t),this}mat4f64(e,t){return this._appendField(e,o.E$,t),this}vec4u8(e,t){return this._appendField(e,o.XP,t),this}f32(e,t){return this._appendField(e,o.Y$,t),this}f64(e,t){return this._appendField(e,o.qB,t),this}u8(e,t){return this._appendField(e,o.SL,t),this}u16(e,t){return this._appendField(e,o.h,t),this}i8(e,t){return this._appendField(e,o.bf,t),this}vec2i8(e,t){return this._appendField(e,o.D6,t),this}vec2i16(e,t){return this._appendField(e,o.mJ,t),this}vec2u8(e,t){return this._appendField(e,o.LC,t),this}vec4u16(e,t){return this._appendField(e,o.Uz,t),this}u32(e,t){return this._appendField(e,o.P,t),this}_appendField(e,t,r){if(this._fields.has(e))return void(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const o=t.ElementCount*(0,i.GJ)(t.ElementType),n=this._stride;this._stride+=o,this._fields.set(e,{size:o,constructor:t,offset:n,optional:r})}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new s;return e._stride=this._stride,e._fields=new Map,this._fields.forEach(((t,r)=>e._fields.set(r,t))),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach((t=>e=Math.max(e,(0,i.GJ)(t.constructor.ElementType)))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function l(){return new s}class c{constructor(e){this.fields=new Array,e.fields.forEach(((e,t)=>{const r={...e,constructor:u(e.constructor)};this.fields.push([t,r])})),this.stride=e.stride}}const d=[o.Y$,o.gH,o.xs,o.Eq,o.jZ,o.Sx,o.qB,o.si,o.Xm,o.Aj,o.j0,o.E$,o.SL,o.LC,o.eI,o.XP,o.h,o.Yi,o.nS,o.Uz,o.P,o.An,o.H$,o.ml,o.bf,o.D6,o.m8,o.TX,o.Qt,o.mJ,o.Vp,o.E7,o.My,o.UL,o.zD,o.Y4];function u(e){return`${e.ElementType}_${e.ElementCount}`}function h(e){return m.get(e)}const m=new Map;d.forEach((e=>m.set(u(e),e)))},46686:(e,t,r)=>{r.d(t,{i$:()=>c,oD:()=>d,xJ:()=>l});var o=r(49255),i=r(33752),a=r(47286),n=r(2597);function s(e){e.varyings.add("linearDepth","float")}function l(e){e.vertex.uniforms.add(new a.G("nearFar",((e,t)=>t.camera.nearFar)))}function c(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
264
264
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
265
265
|
}`)}function d(e,t){const{vertex:r}=e;switch(t.output){case o.V.Color:if(t.receiveShadows)return s(e),void r.code.add(n.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case o.V.LinearDepth:case o.V.Shadow:case o.V.ShadowHighlight:case o.V.ShadowExcludeHighlight:case o.V.ViewshedShadow:return e.include(i.em,t),s(e),l(e),c(e),void r.code.add(n.H`void forwardLinearDepth() {
|
|
266
266
|
linearDepth = calculateLinearDepth(nearFar, vPosition_view.z);
|