viewer3D.min.js 2.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*!
  2. * LMV v7.85.0
  3. *
  4. * Copyright 2023 Autodesk, Inc.
  5. * All rights reserved.
  6. *
  7. * This computer source code and related instructions and comments are the
  8. * unpublished confidential and proprietary information of Autodesk, Inc.
  9. * and are protected under Federal copyright and state trade secret law.
  10. * They may not be disclosed to, copied or used by any third party without
  11. * the prior written consent of Autodesk, Inc.
  12. *
  13. * Autodesk Viewer SDK Usage Limitations:
  14. *
  15. * The Autodesk Viewer SDK JavaScript must be delivered from an
  16. * Autodesk-hosted URL.
  17. */
  18. var LMV;(()=>{var e,t,i={32263:e=>{e.exports="#if NUM_CUTPLANES > 0\nuniform vec4 cutplanes[NUM_CUTPLANES];\nvoid checkCutPlanes(vec3 worldPosition) {\n for (int i=0; i<NUM_CUTPLANES; i++) {\n if (dot(vec4(worldPosition, 1.0), cutplanes[i]) > 0.0) {\n discard;\n }\n }\n}\n#endif\n"},16006:e=>{e.exports="uniform float point_size;"},25334:e=>{e.exports="\nuniform sampler2D tDepth;\nuniform vec4 projInfo;\nuniform float isOrtho;\nuniform mat4 worldMatrix_mainPass;\nvec3 reconstructCSPosition(vec2 fragCoords, float z) {\n return vec3((fragCoords * projInfo.xy + projInfo.zw) * mix(z, -1.0, isOrtho), z);\n}\nvec3 reconstructWorldPosition(vec2 fragCoords, vec2 screenUv) {\n float zCam = texture2D(tDepth, screenUv).z;\n vec3 csPos = reconstructCSPosition(fragCoords, zCam);\n return (worldMatrix_mainPass * vec4(csPos, 1.0)).xyz;\n}\n"},7246:e=>{e.exports="\nuniform float envRotationSin;\nuniform float envRotationCos;\nvec3 adjustLookupVector(in vec3 lookup) {\n return vec3(\n envRotationCos * lookup.x - envRotationSin * lookup.z,\n lookup.y,\n envRotationSin * lookup.x + envRotationCos * lookup.z);\n}\nvec3 RGBMDecode(in vec4 vRGBM, in float exposure) {\n vec3 ret = vRGBM.rgb * (vRGBM.a * 16.0);\n ret *= ret;\n ret *= exposure;\n return ret;\n}\nvec3 GammaDecode(in vec4 vRGBA, in float exposure) {\n return vRGBA.xyz * vRGBA.xyz * exposure;\n}\nvec3 sampleIrradianceMap(vec3 dirWorld, samplerCube irrMap, float exposure) {\n vec4 cubeColor4 = textureCube(irrMap, adjustLookupVector(dirWorld));\n#ifdef IRR_GAMMA\n vec3 indirectDiffuse = GammaDecode(cubeColor4, exposure);\n#elif defined(IRR_RGBM)\n vec3 indirectDiffuse = RGBMDecode(cubeColor4, exposure);\n#else\n vec3 indirectDiffuse = cubeColor4.xyz;\n#ifdef GAMMA_INPUT\n indirectDiffuse.xyz *= indirectDiffuse.xyz;\n#endif\n#endif\n return indirectDiffuse;\n}\n"},53833:e=>{e.exports="#ifdef HATCH_PATTERN\ngl_FragColor = calculateHatchPattern(hatchParams, gl_FragCoord.xy, gl_FragColor, hatchTintColor, hatchTintIntensity);\n#endif\n#ifdef MRT_NORMALS\noutNormal = vec4(geomNormal.x, geomNormal.y, depth, gl_FragColor.a < 1.0 ? 0.0 : 1.0);\n#endif\n#include <id_frag>\n"},72448:e=>{e.exports="float averageOfFloat3(in vec3 value) { \n const float oneThird = 1.0 / 3.0; \n return dot(value, vec3(oneThird, oneThird, oneThird)); \n} \n"},52698:e=>{e.exports="#ifdef HATCH_PATTERN\nuniform vec2 hatchParams;\nuniform vec3 hatchTintColor;\nuniform float hatchTintIntensity;\nfloat curveGaussian(float r, float invWidth) {\n float amt = clamp(r * invWidth, 0.0, 1.0);\n float exponent = amt * 3.5;\n return exp(-exponent*exponent);\n}\nvec4 calculateHatchPattern(vec2 hatchParams, vec2 coord, vec4 fragColor, vec3 hatchTintColor, float hatchTintIntensity ) {\n float hatchSlope = hatchParams.x;\n float hatchPeriod = hatchParams.y;\n if (abs(hatchSlope) <= 1.0) {\n float hatchPhase = coord.y - hatchSlope * coord.x;\n float dist = abs(mod((hatchPhase), (hatchPeriod)));\n if (dist < 1.0) {\n fragColor = vec4(0.0,0.0,0.0,1.0);\n } else {\n fragColor.xyz = mix(fragColor.xyz, hatchTintColor, hatchTintIntensity);\n }\n } else {\n float hatchPhase = - coord.y / hatchSlope + coord.x;\n float dist = abs(mod((hatchPhase), (hatchPeriod)));\n if (dist < 1.0) {\n fragColor = vec4(0.0,0.0,0.0,1.0);\n } else {\n fragColor.xyz = mix(fragColor.xyz, hatchTintColor, hatchTintIntensity);\n }\n }\n return fragColor;\n}\n#endif\n"},68643:e=>{e.exports="vec3 rgb2hsv(vec3 color)\n{\n float delta;\n float colorMax, colorMin;\n float h,s,v;\n vec3 hsv;\n colorMax = max(color.r,color.g);\n colorMax = max(colorMax,color.b);\n colorMin = min(color.r,color.g);\n colorMin = min(colorMin,color.b);\n v = colorMax;\n if(colorMax != 0.0)\n {\n s = (colorMax - colorMin)/colorMax;\n }\n else\n {\n s = 0.0;\n }\n if(s != 0.0)\n {\n delta = colorMax-colorMin;\n if (color.r == colorMax)\n {\n h = (color.g-color.b)/delta;\n }\n else if (color.g == colorMax)\n {\n h = 2.0 + (color.b-color.r) / delta;\n }\n else\n {\n h = 4.0 + (color.r-color.g)/delta;\n }\n h /= 6.0;\n if( h < 0.0)\n {\n h +=1.0;\n }\n }\n else\n {\n h = 0.0;\n }\n hsv = vec3(h,s,v);\n return hsv;\n}\nvec3 hsv2rgb(vec3 hsv)\n{\n vec3 color;\n float f,p,q,t;\n float h,s,v;\n float i,hi;\n {\n h = hsv.x*6.0;\n s = hsv.y;\n v = hsv.z;\n i = floor(h);\n f = h-i;\n p = v * (1.0 - s);\n q = v * (1.0 - (s * f));\n t = v * (1.0 - (s * (1.0 - f)));\n float r,g,b;\n if (i == 0.0)\n {\n r = v;\n g = t;\n b = p;\n }\n else if (i == 1.0)\n {\n r = q;\n g = v;\n b = p;\n }\n else if (i == 2.0)\n {\n r = p;\n g = v;\n b = t;\n }\n else if (i == 3.0)\n {\n r = p;\n g = q;\n b = v;\n }\n else if (i == 4.0)\n {\n r = t;\n g = p;\n b = v;\n }\n else\n {\n r = v;\n g = p;\n b = q;\n }\n color = vec3(r,g,b);\n }\n return color;\n}"},74610:e=>{e.exports="#if defined(MRT_NORMALS) || defined(MRT_ID_BUFFER)\n varying highp float depth;\n#endif\n#if defined(MRT_ID_BUFFER) || defined(ID_COLOR)\n #ifdef USE_VERTEX_ID\n varying vec3 vId;\n #elif defined(LINE_2D_SHADER)\n varying vec4 dbId;\n #else\n uniform vec3 dbId;\n #endif\n#endif\n#if defined(MRT_ID_BUFFER) || defined(MODEL_COLOR)\n uniform vec3 modelId;\n#endif\n#ifdef _LMVWEBGL2_\n #if defined(MRT_NORMALS)\n layout(location = 1) out vec4 outNormal;\n #if defined(MRT_ID_BUFFER)\n layout(location = 2) out vec4 outId;\n #if defined(MODEL_COLOR)\n layout(location = 3) out vec4 outModelId;\n #endif\n #endif\n #elif defined(MRT_ID_BUFFER)\n layout(location = 1) out vec4 outId;\n #if defined(MODEL_COLOR)\n layout(location = 2) out vec4 outModelId;\n #endif\n #endif\n#else\n #define gl_FragColor gl_FragData[0]\n #if defined(MRT_NORMALS)\n #define outNormal gl_FragData[1]\n #if defined(MRT_ID_BUFFER)\n #define outId gl_FragData[2]\n #if defined(MODEL_COLOR)\n #define outModelId gl_FragData[3]\n #endif\n #endif\n #elif defined(MRT_ID_BUFFER)\n #define outId gl_FragData[1]\n #if defined(MODEL_COLOR)\n #define outModelId gl_FragData[2]\n #endif\n #endif\n#endif"},7959:e=>{e.exports="#ifdef USE_VERTEX_ID\nattribute vec3 id;\nvarying vec3 vId;\n#endif\n"},46223:e=>{e.exports="\n#if defined(USE_VERTEX_ID) && (defined(MRT_ID_BUFFER) || defined(ID_COLOR))\n vec3 dbId = vId;\n#endif\n#ifdef MRT_ID_BUFFER\n #ifndef ENABLE_ID_DISCARD\n const float writeId = 1.0;\n #endif\n outId = vec4(dbId.rgb, writeId);\n #ifdef MODEL_COLOR\n outModelId = vec4(modelId.rgb, writeId);\n #endif\n#elif defined(ID_COLOR)\n #ifdef ENABLE_ID_DISCARD\n if (writeId==0.0) {\n discard;\n }\n #endif\n gl_FragColor = vec4(dbId.rgb, 1.0);\n#elif defined(MODEL_COLOR)\n #ifdef ENABLE_ID_DISCARD\n if (writeId==0.0) {\n discard;\n }\n #endif\n gl_FragColor = vec4(modelId.rgb, 1.0);\n#endif\n"},61539:e=>{e.exports="\n#ifdef USE_VERTEX_ID\nvId = id;\n#endif\n"},21600:e=>{e.exports="#if defined( IMPORTANTSAMPLING )\n#define SAMPLECOUNT 32\nvec2 Hammersley(int index)\n{\n float u = (float(index) + 0.5) / 32.0;\n float v = 0.5;\n float noise = texture2D(importantSamplingRandomMap, vec2(u, v), 0.0).r;\n return vec2(2.0 * PI * float(index/SAMPLECOUNT), noise);\n}\nvec3 ImportanceSampleAnisotropicGGX(int index, vec2 alpha, vec3 N, vec3 Tu, vec3 Tv)\n{\n vec2 uniformSample2D = Hammersley(index);\n float coef = sqrt(uniformSample2D.y / (1.0 - uniformSample2D.y));\n float sinSigma, cosSigma;\n sinSigma = sin(uniformSample2D.x);\n cosSigma = cos(uniformSample2D.x);\n vec3 H = coef * ((alpha.x * cosSigma) * Tu + (alpha.y * sinSigma) * Tv) + N;\n H = normalize(H);\n return H;\n}\nfloat ComputePDF(vec2 alpha, float NdotH, float HdotTu, float HdotTv, float VdotH)\n{\n float factor1 = HdotTu / alpha.x;\n float factor2 = HdotTv / alpha.y;\n float factor3 = factor1 * factor1 + factor2 * factor2 + NdotH * NdotH;\n float factor = factor3 * factor3 * alpha.x * alpha.y * VdotH * 4.0 * PI;\n if (factor > 0.0)\n {\n return (NdotH / factor);\n }\n else\n {\n return 0.0;\n }\n}\n#define INVFACESIZE 0.0078125\nfloat DirectionToSolidAngle(vec3 dir)\n{\n dir = abs(dir);\n float first = min(dir.x, dir.y);\n float temp = max(dir.x, dir.y);\n float second = min(temp, dir.z);\n float third = max(temp, dir.z);\n first /= third;\n second /= third;\n float u = (first+1.0)/2.0;\n float v = (second + 1.0) / 2.0;\n float solidAngle = texture2D(importantSamplingSolidAngleMap, vec2(u, v), 0.0).r * 0.000255;\n return solidAngle;\n}\nfloat Smith_GGX(float value)\n{\n return 2.0 / (1.0 + sqrt(1.0 + value));\n}\nvec2 RoughnessAnisotropyToAlpha(float roughness, float anisotropy)\n{\n float aspect = sqrt(1.0 - 0.9 * anisotropy);\n vec2 alpha = vec2(roughness * roughness / aspect, roughness * roughness * aspect);\n return alpha;\n}\nvec3 ImportanceSamplingSpecular(float angle, vec3 reflectance, float roughness, float anisotropy, vec3 V, vec3 N, vec3 Tu, vec3 Tv)\n{\n vec3 specular = vec3(0.0);\n float radAngle;\n if (anisotropy < 1e-10)\n {\n radAngle = 0.0;\n }\n else\n {\n radAngle = -PI * angle;\n }\n vec2 alpha = RoughnessAnisotropyToAlpha(roughness, anisotropy);\n float alpha2 = max(alpha.x * alpha.x, alpha.y * alpha.y);\n float NdotV = dot(N, V);\n float alpha2NV = aSqrd(alpha2, NdotV);\n vec2 sincosTheta;\n sincosTheta.x = sin(radAngle);\n sincosTheta.y = cos(radAngle);\n vec3 Tu1, Tv1;\n Tu1 = sincosTheta.y * Tu - sincosTheta.x * Tv;\n Tv1 = sincosTheta.x * Tu + sincosTheta.y * Tv;\n vec3 H;\n vec3 sampleLightIntensity;\n vec3 L;\n float effectiveSample = 0.0;\n for (int i = 0; i < SAMPLECOUNT; i++)\n {\n H = ImportanceSampleAnisotropicGGX(i, alpha, N, Tu1, Tv1);\n float VdotH = dot(V, H);\n L = 2.0 * VdotH * H - V;\n float NdotH = dot(N, H);\n float NdotL = dot(N, L);\n if (NdotL >= 0.0 && NdotV > 0.0 && NdotH > 0.0)\n {\n float alpha2NL = aSqrd(alpha2, NdotL);\n float HdotTu = dot(H, Tu1);\n float HdotTv = dot(H, Tv1);\n float pdf = ComputePDF(alpha, NdotH, HdotTu, HdotTv, VdotH);\n float mipmapLevel = 0.0;\n if (pdf > 0.0)\n {\n mipmapLevel = 0.3 * log2(1.0 / (float(SAMPLECOUNT) * pdf * DirectionToSolidAngle(L)));\n }\n mipmapLevel = clamp(mipmapLevel, 0.0, 4.0);\n L = normalize(L);\n sampleLightIntensity = sampleReflection(L, L, mipmapLevel).rgb;\n float G = Smith_GGX(alpha2NL) * Smith_GGX(alpha2NV);\n vec3 F = Fresnel_Schlick(reflectance, VdotH);\n float factor = G * VdotH / (NdotH * NdotV);\n if (factor >= 0.0)\n {\n specular += abs(sampleLightIntensity * F * factor);\n effectiveSample += 1.0;\n }\n }\n }\n if (effectiveSample > 0.0)\n {\n specular /= effectiveSample;\n }\n return specular;\n}\n#endif"},58121:e=>{e.exports="\n#ifdef USE_INSTANCING\nattribute vec3 instOffset;\nattribute vec4 instRotation;\nattribute vec3 instScaling;\nvec3 applyQuaternion(vec3 p, vec4 q) {\n return p + 2.0 * cross(q.xyz, cross(q.xyz, p) + q.w * p);\n}\nvec3 getInstancePos(vec3 pos) {\n return instOffset + applyQuaternion(instScaling * pos, instRotation);\n}\nvec3 getInstanceNormal(vec3 normal) {\n return applyQuaternion(normal/instScaling, instRotation);\n}\n#else\nvec3 getInstancePos(vec3 pos) { return pos; }\nvec3 getInstanceNormal(vec3 normal) { return normal; }\n#endif\n"},81456:e=>{e.exports="\n#define LINE_2D_SHADER 1\n#define TAU 6.28318530718\n#define PI 3.14159265358979\n#define HALF_PI 1.57079632679\n#define PI_0_5 HALF_PI\n#define PI_1_5 4.71238898038\n#define ENABLE_ID_DISCARD\n#define VBB_GT_TRIANGLE_INDEXED 0.0\n#define VBB_GT_LINE_SEGMENT 1.0\n#define VBB_GT_ARC_CIRCULAR 2.0\n#define VBB_GT_ARC_ELLIPTICAL 3.0\n#define VBB_GT_TEX_QUAD 4.0\n#define VBB_GT_ONE_TRIANGLE 5.0\n#define VBB_GT_MSDF_TRIANGLE_INDEXED 6.0\n#define VBB_GT_LINE_SEGMENT_CAPPED 8.0\n#define VBB_GT_LINE_SEGMENT_CAPPED_START 9.0\n#define VBB_GT_LINE_SEGMENT_CAPPED_END 10.0\n#define VBB_GT_LINE_SEGMENT_MITER 11.0\n#define VBB_INSTANCED_FLAG 0.0\n#define VBB_SEG_START_RIGHT 0.0\n#define VBB_SEG_START_LEFT 1.0\n#define VBB_SEG_END_RIGHT 2.0\n#define VBB_SEG_END_LEFT 3.0\n#define LTSCALE 0.25\nvarying vec4 fsColor;\nvarying vec2 fsOffsetDirection;\nvarying vec4 fsMultipurpose;\nvarying float fsHalfWidth;\nvarying vec2 fsVpTC;\nvarying float fsGhosting;\n#ifdef LOADING_ANIMATION\nvarying float loadingProgress;\n#endif\n"},14227:e=>{e.exports="#if defined(USE_SURFACE_NORMAL_MAP) || defined( USE_LAYERED_NORMAL_MAP ) || defined( USE_TILING_NORMAL )\nvoid heightMapTransform(\n sampler2D bumpTexture,\n vec2 uv,\n mat3 transform,\n vec2 bumpScale,\n inout vec3 T,\n inout vec3 B,\n inout vec3 N\n) {\n vec2 st = (transform * vec3(uv, 1.0)).xy;\n mat3 mtxTangent = mat3(T, B, N);\n T = normalize(mtxTangent * (transform * vec3(1.0, 0.0, 0.0)));\n B = normalize(mtxTangent * (transform * vec3(0.0, 1.0, 0.0)));\n const float oneThird = 1.0 / 3.0;\n vec3 avg = vec3(oneThird, oneThird, oneThird);\n vec2 offset = fwidth(st);\n float h0 = dot(texture2D(bumpTexture, st).xyz, avg);\n float hx = dot(texture2D(bumpTexture, st + vec2(offset.x, 0.0)).xyz, avg);\n float hy = dot(texture2D(bumpTexture, st + vec2(0.0, offset.y)).xyz, avg);\n vec2 diff = vec2(h0 - hx, h0 - hy) / offset;\n N = normalize(\n N + (\n diff.x * T * bumpScale.x +\n diff.y * B * bumpScale.y\n )\n );\n}\nvoid normalMapTransform(\n sampler2D bumpTexture,\n vec2 uv,\n mat3 transform,\n vec2 bumpScale,\n inout vec3 T,\n inout vec3 B,\n inout vec3 N\n) {\n vec2 st = (transform * vec3(uv, 1.0)).xy;\n vec3 mapN = 2.0 * texture2D(bumpTexture, st).xyz - 1.0;\n mapN.xy *= bumpScale.x;\n mapN.z *= bumpScale.y;\n vec3 v = vec3(mapN.y, -mapN.x, 0.0);\n float c = -mapN.z;\n mat3 skewV = mat3(\n 0.0, v.z, -v.y,\n -v.z, 0.0, v.x,\n v.y, -v.x, 0.0\n );\n mat3 rot = mat3(1.0) + skewV + skewV*skewV * 1.0/(1.0-c);\n N *= rot;\n T *= rot;\n B *= rot;\n}\n#endif\n"},52035:e=>{e.exports="vec3 orderedDithering(vec3 col) {\n const vec4 m0 = vec4( 1.0, 13.0, 4.0, 16.0);\n const vec4 m1 = vec4( 9.0, 5.0, 12.0, 8.0);\n const vec4 m2 = vec4( 3.0, 15.0, 2.0, 14.0);\n const vec4 m3 = vec4(11.0, 7.0, 10.0, 6.0);\n#ifdef _LMVWEBGL2_\n int i = int(gl_FragCoord.x) & 3;\n int j = int(gl_FragCoord.y) & 3;\n#else\n int i = int(mod(float(gl_FragCoord.x), 4.0));\n int j = int(mod(float(gl_FragCoord.y), 4.0));\n#endif\n vec4 biasRow;\n if (i==0) biasRow = m0;\n else if (i==1) biasRow = m1;\n else if (i==2) biasRow = m2;\n else biasRow = m3;\n float bias;\n if (j==0) bias = biasRow.x;\n else if (j==1) bias = biasRow.y;\n else if (j==2) bias = biasRow.z;\n else bias = biasRow.w;\n return col + bias * (1.0 / (17.0 * 256.0));\n}\n"},23300:e=>{e.exports="\nvec4 packDepth( const in float depth ) {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 160581375.0) * depth;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0/255.0,1.0/255.0,1.0/255.0,0.0);\n return enc;\n}\nfloat unpackDepth( const in vec4 rgba_depth ) {\n return dot( rgba_depth, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/160581375.0) );\n}\n"},15931:e=>{e.exports="\n#define kPI 3.14159265358979\nvec2 encodeNormal (vec3 n) {\n return (vec2(atan(n.y,n.x)/kPI, n.z)+1.0)*0.5;\n}\nvec3 decodeNormal (vec2 enc) {\n vec2 ang = enc * 2.0 - 1.0;\n vec2 scth = vec2(sin(ang.x * kPI), cos(ang.x * kPI));\n vec2 scphi = vec2(sqrt(1.0 - ang.y * ang.y), ang.y);\n return vec3(scth.y * scphi.x, scth.x * scphi.x, scphi.y);\n}\n"},26649:e=>{e.exports="gl_PointSize = point_size;"},58998:e=>{e.exports="\nvec3 TransmitAdjust(vec3 transmission, vec3 f0) \n{ \n vec3 limit = max(1.0 - f0, 0.00001); \n return clamp(transmission, vec3(0.0, 0.0, 0.0), limit) / limit; \n} \nfloat ColorToIlluminance(in vec3 color) \n{ \n const vec3 rgb2grey = vec3(0.299, 0.587, 0.114); \n float illuminance = dot(rgb2grey, color); \n return illuminance; \n} \nvoid applyPrismGlazingOpacity(\n inout vec4 color,\n vec3 transmissionF,\n float transmissionAlpha,\n float NdotV,\n float glazingIlluminace) \n{\n const float third = 1.0/3.0; \n float transSurface = exp(-(transmissionAlpha + (transmissionAlpha < 0.0025 ? 0.0 : 0.25)) * NdotV * PI); \n float opacity = 1.0- dot((1.0 - transmissionF), vec3(third,third,third)) * transSurface * glazingIlluminace; \n opacity = clamp(opacity, 0.01, 0.99);\n color.a *= opacity;\n} \n"},72438:e=>{e.exports="void applyPrismTransparency(\n inout vec4 color,\n vec3 transparentColor,\n float transparentIor\n) {\n float fsLevel = max(max(color.r, color.g), color.b);\n color = vec4(color.rgb/fsLevel, fsLevel);\n float transLevel = min(min(transparentColor.r, transparentColor.g), transparentColor.b);\n transLevel = min( (1.0 - surface_roughness), transLevel );\n float transAlpha = (1.0 - transLevel) * 0.4 + surface_roughness * 0.55;\n vec3 tr_g_color = sqrt(transparentColor);\n vec4 transColor = vec4(0.5 * vec3(tr_g_color), transAlpha);\n float strength = 1.0 - (1.0 - fsLevel) * (1.0 - fsLevel);\n color = mix(transColor, color, strength);\n color.a = max(color.a, 0.05);\n if (transparentIor == 1.0 && tr_g_color == vec3(1.0)) {\n color.a = 0.0;\n }\n}"},65355:e=>{e.exports="#if defined( PRISMWOOD )\n#define ONE 0.00390625\nfloat GetIndexedValue(vec4 array, int index)\n{\n if (index == 0)\n return array[0];\n else if (index == 1)\n return array[1];\n else if (index == 2)\n return array[2];\n else if (index == 3)\n return array[3];\n else\n return 0.0;\n}\nint GetIndexedValue(ivec2 array, int index)\n{\n if (index == 0)\n return array[0];\n else if (index == 1)\n return array[1];\n else\n return 0;\n}\n#if defined( USE_WOOD_CURLY_DISTORTION_MAP )\nfloat SampleCurlyPattern(vec2 uv)\n{\n vec2 uv_wood_curly_distortion_map = (wood_curly_distortion_map_texMatrix * vec3(uv, 1.0)).xy;\n WOOD_CURLY_DISTORTION_CLAMP_TEST;\n vec3 curlyDistortion = texture2D(wood_curly_distortion_map, uv_wood_curly_distortion_map).xyz;\n if(wood_curly_distortion_map_invert) curlyDistortion = vec3(1.0) - curlyDistortion;\n return curlyDistortion.r;\n}\nvec3 DistortCurly(vec3 p)\n{\n if (!wood_curly_distortion_enable) return p;\n float r = length(p.xy);\n if (r < 0.00001) return p;\n const float INV_ANGLE_INTERVAL = 1.27323954;\n const float NUM_INTERVAL = 8.0;\n float theta = atan(p.y, p.x);\n if (theta < 0.0)\n theta += PI2;\n float intIdx = theta * INV_ANGLE_INTERVAL;\n int idx0 = int(mod(floor(intIdx), NUM_INTERVAL));\n int idx1 = int(mod(ceil(intIdx), NUM_INTERVAL));\n const vec4 HASH_TABLE1 = vec4(0.450572,0.114598, 0.886043, 0.315119);\n const vec4 HASH_TABLE2 = vec4(0.216133,0.306264, 0.685616, 0.317907);\n float offset0 = idx0 < 4 ? GetIndexedValue(HASH_TABLE1, idx0) : GetIndexedValue(HASH_TABLE2, idx0-4);\n float offset1 = idx1 < 4 ? GetIndexedValue(HASH_TABLE1, idx1) : GetIndexedValue(HASH_TABLE2, idx1-4);\n const float maxOffset = 100.0;\n offset0 = (offset0 - 0.5) * maxOffset;\n offset1 = (offset1 - 0.5) * maxOffset;\n vec2 uv0 = vec2(p.z + offset0, r);\n float shiftWeight0 = SampleCurlyPattern(uv0);\n vec2 uv1 = vec2(p.z + offset1, r);\n float shiftWeight1 = SampleCurlyPattern(uv1);\n float interpWeight = fract(intIdx);\n float shiftWeight = mix(shiftWeight0, shiftWeight1, interpWeight);\n const float INV_MIN_RADIUS = 2.0;\n float shiftWeightAdjust = smoothstep(0.0, 1.0, r * INV_MIN_RADIUS);\n r -= wood_curly_distortion_scale * (shiftWeight * shiftWeightAdjust);\n float thetaNew = atan(p.y, p.x);\n vec3 pNew = p;\n pNew.x = r * cos(thetaNew);\n pNew.y = r * sin(thetaNew);\n return pNew;\n}\n#endif\nvec3 un2sn(vec3 range)\n{\n return range * 2.0 - 1.0;\n}\nfloat inoise(vec3 p)\n{\n vec3 modp = mod(floor(p), 256.0);\n modp.xy = modp.xy * ONE;\n vec4 AA = texture2D(perm2DMap, vec2(modp.x, modp.y), 0.0) * 255.0;\n AA = AA + modp.z;\n AA = mod(floor(AA), 256.0);\n AA *= ONE;\n vec3 gradx1 = un2sn(texture2D(permGradMap,vec2(AA.x,0.0),0.0).xyz);\n vec3 grady1 = un2sn(texture2D(permGradMap,vec2(AA.y,0.0),0.0).xyz);\n vec3 gradz1 = un2sn(texture2D(permGradMap,vec2(AA.z,0.0),0.0).xyz);\n vec3 gradw1 = un2sn(texture2D(permGradMap,vec2(AA.w,0.0),0.0).xyz);\n vec3 gradx2 = un2sn(texture2D(permGradMap,vec2(AA.x + ONE,0.0),0.0).xyz);\n vec3 grady2 = un2sn(texture2D(permGradMap,vec2(AA.y + ONE,0.0),0.0).xyz);\n vec3 gradz2 = un2sn(texture2D(permGradMap,vec2(AA.z + ONE,0.0),0.0).xyz);\n vec3 gradw2 = un2sn(texture2D(permGradMap,vec2(AA.w + ONE,0.0),0.0).xyz);\n p -= floor(p);\n vec3 fadep = p * p * p * (p * (p * 6.0 - 15.0) + 10.0);\n return mix( mix( mix( dot(gradx1, p ),\n dot(gradz1, p + vec3(-1.0, 0.0, 0.0)), fadep.x),\n mix( dot(grady1, p + vec3(0.0, -1.0, 0.0)),\n dot(gradw1, p + vec3(-1.0, -1.0, 0.0)), fadep.x), fadep.y),\n mix( mix( dot(gradx2, p + vec3(0.0, 0.0, -1.0)),\n dot(gradz2, p + vec3(-1.0, 0.0, -1.0)), fadep.x),\n mix( dot(grady2, p + vec3(0.0, -1.0, -1.0)),\n dot(gradw2, p + vec3(-1.0, -1.0, -1.0)), fadep.x), fadep.y), fadep.z);\n}\nfloat inoise(float p)\n{\n float modp = mod(floor(p), 256.0);\n modp = (modp + 256.0) * ONE;\n float permx = texture2D(permutationMap, vec2(modp, 0.0), 0.0).r;\n float gradx = texture2D(gradientMap, vec2(permx, 0.0), 0.0).r*2.0-1.0;\n float permy = texture2D(permutationMap, vec2(modp + ONE, 0.0), 0.0).r;\n float grady = texture2D(gradientMap, vec2(permy, 0.0), 0.0).r*2.0-1.0;\n p -= floor(p);\n float fadep = p * p * p * (p * (p * 6.0 - 15.0) + 10.0);\n return mix(gradx * p, grady * (p - 1.0), fadep);\n}\nfloat multiband_inoise(vec3 p, int bands, vec4 w, vec4 f)\n{\n float noise = 0.0;\n for(int i = 0; i < 4; ++i)\n {\n if (i >= bands) break;\n noise += GetIndexedValue(w, i) * inoise(p * GetIndexedValue(f, i));\n }\n return noise;\n}\nfloat multiband_inoise(float p, int bands, vec4 w, vec4 f)\n{\n float noise = 0.0;\n for(int i = 0; i < 4; ++i)\n {\n if (i >= bands) break;\n noise += GetIndexedValue(w, i) * inoise(p * GetIndexedValue(f, i));\n }\n return noise;\n}\nvec3 Distort3DCosineRadialDir(vec3 p)\n{\n float radius = length(p.xy);\n if (radius < 0.00001) return p;\n vec2 theta = p.xy / radius;\n float radiusShift = 0.0;\n for (int i = 0; i < 4; ++i)\n {\n if (i >= wood_fiber_cosine_bands) break;\n radiusShift += GetIndexedValue(wood_fiber_cosine_weights, i) * cos(p.z * RECIPROCAL_PI2 * GetIndexedValue(wood_fiber_cosine_frequencies, i));\n }\n const float MIN_RADIUS = 1.5;\n float weight = clamp(radius / MIN_RADIUS, 0.0, 1.0);\n if(weight >= 0.5)\n weight = weight * weight * (3.0 - (weight + weight));\n p.xy += theta * radiusShift * weight;\n return p;\n}\nvec3 Distort3DPerlin(vec3 p)\n{\n vec3 pAniso = vec3(p.xy, p.z * wood_fiber_perlin_scale_z);\n p.xy += multiband_inoise(pAniso, wood_fiber_perlin_bands, wood_fiber_perlin_weights, wood_fiber_perlin_frequencies);\n return p;\n}\nvec3 Distort(vec3 p)\n{\n if(wood_fiber_cosine_enable)\n p = Distort3DCosineRadialDir(p);\n if(wood_fiber_perlin_enable)\n p = Distort3DPerlin(p);\n return p;\n}\nfloat DistortRadiusLength(float radiusLength)\n{\n radiusLength += multiband_inoise(radiusLength, wood_growth_perlin_bands, wood_growth_perlin_weights, wood_growth_perlin_frequencies);\n if (radiusLength < 0.0) radiusLength = 0.0;\n return radiusLength;\n}\nfloat ComputeEarlyWoodRatio(float radiusLength)\n{\n float fraction = mod(radiusLength, wood_ring_thickness) / wood_ring_thickness;\n if (fraction <= wood_ring_fraction.y)\n return 1.0;\n else if(fraction <= wood_ring_fraction.x)\n return (1.0 - (fraction - wood_ring_fraction.y) / wood_fall_rise.x);\n else if(fraction <= wood_ring_fraction.w)\n return 0.0;\n else\n return ((fraction - wood_ring_fraction.w) / wood_fall_rise.y);\n}\nvec3 DistortEarlyColor(vec3 earlyColor, float radiusLength)\n{\n float expValue = 1.0 + multiband_inoise(radiusLength,wood_earlycolor_perlin_bands,wood_earlycolor_perlin_weights,wood_earlycolor_perlin_frequencies);\n earlyColor = pow(abs(earlyColor), vec3(expValue));\n return earlyColor;\n}\nvec3 DistortLateColor(vec3 lateColor, float radiusLength)\n{\n float expValue = 1.0 + multiband_inoise(radiusLength,wood_latecolor_perlin_bands,wood_latecolor_perlin_weights,wood_latecolor_perlin_frequencies);\n lateColor = pow(abs(lateColor), vec3(expValue));\n return lateColor;\n}\nvec3 DistortDiffuseColor(vec3 diffAlbedo, vec3 p)\n{\n p.z *= wood_diffuse_perlin_scale_z;\n float expValue = 1.0 + multiband_inoise(p, wood_diffuse_perlin_bands, wood_diffuse_perlin_weights, wood_diffuse_perlin_frequencies);\n diffAlbedo = pow(abs(diffAlbedo), vec3(expValue));\n return diffAlbedo;\n}\nfloat LayerRoughnessVar(float roughness, float earlyWoodRatio)\n{\n return earlyWoodRatio * wood_groove_roughness + (1.0 - earlyWoodRatio) * roughness;\n}\nfloat hashword(vec2 k)\n{\n k = mod(k, vec2(256.0)) * ONE;\n float a = texture2D(permutationMap, vec2(k.x, 0.0)).x + k.y ;\n a = texture2D(permutationMap, vec2(a, 0.0)).x ;\n return a*255.0;\n}\nfloat wyvillsq(float rsq)\n{\n if (rsq >= 1.0) return 0.0;\n float tmp = 1.0 - rsq;\n return tmp*tmp*tmp;\n}\nfloat Weight2DNeighborImpulses(vec3 p, float woodWeight)\n{\n if(woodWeight <= 0.0) return 0.0;\n float poreRadius = wood_pore_radius * woodWeight;\n vec2 left = floor((p.xy - poreRadius) / wood_pore_cell_dim);\n vec2 right = floor((p.xy + poreRadius) / wood_pore_cell_dim);\n float weight = 0.0;\n float invRsq = 1.0 / (poreRadius * poreRadius);\n const float norm = 1.0 / 15.0;\n for (int j = 0; j <= 4; j++)\n {\n if (j > int(right.y - left.y)) continue;\n for (int i = 0; i <= 4; i++)\n {\n if (i > int(right.x - left.x)) continue;\n vec2 pij = vec2(float(i) + left.x,float(j) + left.y);\n float hRNum = hashword(pij);\n float impPosX = mod(hRNum, 16.0) * norm;\n float impPosY = floor(hRNum / 16.0) * norm;\n impPosX = (pij.x + impPosX)* wood_pore_cell_dim;\n impPosY = (pij.y + impPosY)* wood_pore_cell_dim;\n float dsq = (p.x - impPosX) * (p.x - impPosX) + (p.y - impPosY) * (p.y - impPosY);\n weight += wyvillsq(dsq * invRsq);\n }\n }\n return weight;\n}\nfloat Weight3DRayImpulses(vec3 p)\n{\n int segIdx = int(floor(p.z / wood_ray_seg_length_z));\n float factor = p.z / wood_ray_seg_length_z - float(segIdx);\n int segIdx1 = segIdx - 1;\n if ( factor > 0.5 )\n segIdx1 = segIdx + 1;\n float theta = atan(p.y, p.x);\n float sliceIdx = floor(((theta + PI) * RECIPROCAL_PI2) * wood_ray_num_slices);\n if ( sliceIdx == wood_ray_num_slices)\n sliceIdx-=1.0;\n ivec2 arrSegs = ivec2(segIdx, segIdx1);\n float weight = 0.0;\n const float norm = 1.0 / 15.0;\n float radialOffset = 5.0;\n float radialLength = length(p.xy);\n for (int seg = 0; seg < 2; seg++)\n {\n float hRNum = hashword(vec2(sliceIdx, GetIndexedValue(arrSegs, seg)));\n float rn1 = mod(hRNum,16.0) * norm;\n if (radialLength < radialOffset * rn1)\n continue;\n float rayTheta = rn1;\n rayTheta = ( ( sliceIdx + rayTheta ) / wood_ray_num_slices ) * ( 2.0 * PI ) - PI;\n float rayPosZ = (hRNum/16.0)* norm;\n rayPosZ = ( float(GetIndexedValue(arrSegs, seg)) + rayPosZ ) * wood_ray_seg_length_z;\n vec3 pt1 = vec3(0.0);\n vec3 pt2 = vec3(cos(rayTheta), sin(rayTheta), 0.0);\n vec3 p1 = p;\n p1.z -= rayPosZ;\n p1.z /= wood_ray_ellipse_z2x;\n vec3 v1 = pt2 - pt1;\n vec3 v2 = pt1 - p1;\n v2 = cross(v1, v2);\n float dist = length(v2) / length(v1);\n float invRsq = 1.0 / ( wood_ray_ellipse_radius_x * wood_ray_ellipse_radius_x);\n weight += wyvillsq( (dist * dist) * invRsq );\n }\n return weight;\n}\nvec3 DarkenColorWithPores(vec3 p, vec3 diffColor, float woodWeight)\n{\n float poresWeight = Weight2DNeighborImpulses(p, woodWeight);\n float a = wood_pore_color_power - 1.0;\n float b = 1.0;\n float y = a * poresWeight + b;\n return pow(abs(diffColor), vec3(y));\n}\nvec3 DarkenColorWithRays(vec3 p, vec3 diffColor)\n{\n float raysWeight = Weight3DRayImpulses(p);\n float a = wood_ray_color_power - 1.0;\n float b = 1.0;\n float y = a * raysWeight + b;\n return pow(abs(diffColor), vec3(y));\n}\nfloat ComputeWoodWeight(float earlyWoodRatio)\n{\n float woodWeight = 0.0;\n if (wood_pore_type == 0)\n woodWeight = 1.0;\n else if (wood_pore_type == 1)\n woodWeight = earlyWoodRatio;\n else if (wood_pore_type == 2)\n woodWeight = 1.0 - earlyWoodRatio;\n else\n woodWeight = -1.0;\n return woodWeight;\n}\n#if defined( PRISMWOODBUMP )\nfloat ComputeEarlyWoodRatioAA(float radiusLength, float invUnitExt)\n{\n float transPixels = min(wood_fall_rise.x, wood_fall_rise.y) * wood_ring_thickness * invUnitExt;\n float samplesf = clamp(4.0 / transPixels, 1.0, 4.0);\n int samples = int(samplesf);\n float inverseSamples = 1.0 / float(samples);\n vec2 rdelta = vec2(dFdx(radiusLength), dFdy(radiusLength)) * inverseSamples;\n float earlywoodRatio = 0.0;\n for (int i = 0; i < 4; ++i)\n {\n if (i >= samples) break;\n for (int j = 0; j < 4; ++j)\n {\n if (j >= samples) break;\n float r = radiusLength + dot(vec2(i, j), rdelta);\n earlywoodRatio += ComputeEarlyWoodRatio(r);\n }\n }\n return earlywoodRatio * (inverseSamples * inverseSamples);\n}\nfloat LatewoodDepthVariation(float invUnitExt)\n{\n float transPixels = min(wood_fall_rise.x, wood_fall_rise.y) * wood_ring_thickness * invUnitExt;\n return clamp(transPixels * 0.5, 0.0, 1.0);\n}\nfloat LatewoodHeightVariation(float earlyWoodRatio, float latewoodBumpDepth,\n float depthVar)\n{\n return ( 1.0 - earlyWoodRatio ) * latewoodBumpDepth * depthVar;\n}\nfloat PoreDepthVariation(float woodWeight, float invUnitExt)\n{\n float porePixels = woodWeight * wood_pore_radius * invUnitExt;\n return clamp(porePixels, 0.0, 1.0);\n}\nfloat PoreHeightVariation(float earlyWoodRatio, float poresWeight, float poreDepth,\n float depthVar)\n{\n return poresWeight * (-1.0 * poreDepth) * depthVar;\n}\nvoid ComputeTangents(vec3 normal, out vec3 u, out vec3 v)\n{\n float scale = normal.z < 0.0 ? -1.0 : 1.0;\n vec3 temp = scale * normal;\n float e = temp.z;\n float h = 1.0/(1.0 + e);\n float hvx = h * temp.y;\n float hvxy = hvx * -temp.x;\n u = vec3(e + hvx * temp.y, hvxy, -temp.x);\n v = vec3(hvxy, e + h * temp.x * temp.x, -temp.y);\n u *= scale;\n v *= scale;\n}\nvec3 WoodBumpHeight(float heightLeft, float heightRight, float heightBack, float heightFront)\n{\n const float epsilon = 0.001;\n float heightDeltaX = heightRight - heightLeft;\n vec3 Tu = vec3(2.0 * epsilon, 0.0, heightDeltaX);\n float heightDeltaY = heightFront - heightBack;\n vec3 Tv = vec3(0.0, 2.0 * epsilon, heightDeltaY);\n return cross(Tu, Tv);\n}\nvec3 SelectNormal(vec3 N, vec3 bumpN, vec3 V)\n{\n float bumpNdotV = dot(bumpN, V);\n if(bumpNdotV > 0.0)\n return bumpN;\n else return N;\n}\nfloat MinInverseUnitExtent(vec3 p)\n{\n return 1.0 / max(max(length(dFdx(p.xy)), length(dFdy(p.xy))), 0.000001);\n}\nfloat HeightVariation(vec3 pos)\n{\n vec3 p = Distort(pos);\n float radiusLength = length(p.xy);\n if (wood_growth_perlin_enable)\n radiusLength = DistortRadiusLength(radiusLength);\n float invUnitExt = MinInverseUnitExtent(p);\n float earlyWoodRatio = ComputeEarlyWoodRatioAA(radiusLength, invUnitExt);\n float woodWeight = ComputeWoodWeight(earlyWoodRatio);\n float poresWeight = Weight2DNeighborImpulses(p, woodWeight);\n float depthVar = PoreDepthVariation(woodWeight, invUnitExt);\n float poreHeightVariation = -1.0 * poresWeight * wood_pore_depth * depthVar;\n float latewoodHeightVariation = 0.0;\n if (wood_use_latewood_bump)\n {\n float latewoodDepthVar = LatewoodDepthVariation(invUnitExt);\n latewoodHeightVariation = (1.0 - earlyWoodRatio) * wood_latewood_bump_depth * latewoodDepthVar;\n }\n float sumHeightVariation = poreHeightVariation + latewoodHeightVariation;\n return sumHeightVariation;\n}\n#endif\nvec3 NoiseWood(vec3 p, inout float roughness)\n{\n p = Distort(p);\n float radiusLength = length(p.xy);\n if(wood_growth_perlin_enable)\n radiusLength = DistortRadiusLength(radiusLength);\n#if defined( PRISMWOODBUMP )\n float invUnitExt = MinInverseUnitExtent( p );\n float earlyWoodRatio = ComputeEarlyWoodRatioAA(radiusLength, invUnitExt);\n#else\n float earlyWoodRatio = ComputeEarlyWoodRatio(radiusLength);\n#endif\n vec3 earlyColor = wood_early_color;\n if (wood_earlycolor_perlin_enable)\n earlyColor = DistortEarlyColor(earlyColor, radiusLength);\n vec3 lateColor;\n if (wood_use_manual_late_color)\n lateColor = wood_manual_late_color;\n else\n lateColor = pow(abs(earlyColor), vec3(wood_late_color_power));\n if(wood_latecolor_perlin_enable)\n lateColor = DistortLateColor(lateColor, radiusLength);\n vec3 diffAlbedo = earlyWoodRatio * earlyColor + (1.0 - earlyWoodRatio) * lateColor;\n if(wood_diffuse_perlin_enable)\n diffAlbedo = DistortDiffuseColor(diffAlbedo, p);\n if (wood_use_pores)\n {\n float woodWeight = ComputeWoodWeight(earlyWoodRatio);\n diffAlbedo = DarkenColorWithPores(p, diffAlbedo, woodWeight);\n }\n if (wood_use_rays)\n diffAlbedo = DarkenColorWithRays(p, diffAlbedo);\n if(wood_use_groove_roughness)\n roughness = LayerRoughnessVar(roughness, earlyWoodRatio);\n return clamp(diffAlbedo, vec3(0.0), vec3(1.0));\n}\n#if defined(PRISMWOODBUMP)\nvoid getFinalWoodContext(\n inout vec3 N, vec3 V, inout vec3 Tu, inout vec3 Tv, vec3 p,\n vec3 geoNormal, vec3 tNormal, mat3 normalMatrix\n) {\n vec3 offsetTuLeft = p - 0.001 * Tu;\n vec3 offsetTuRight = p + 0.001 * Tu;\n vec3 offsetTvLeft = p - 0.001 * Tv;\n vec3 offsetTvRight = p + 0.001 * Tv;\n float heightVariationTuLeft = HeightVariation(offsetTuLeft);\n float heightVariationTuRight = HeightVariation(offsetTuRight);\n float heightVariationTvLeft = HeightVariation(offsetTvLeft);\n float heightVariationTvRight = HeightVariation(offsetTvRight);\n vec3 bumpHeight = WoodBumpHeight(heightVariationTuLeft, heightVariationTuRight, heightVariationTvLeft, heightVariationTvRight);\n vec3 newNormal = normalize(bumpHeight.x * Tu + bumpHeight.y * Tv + bumpHeight.z * vtNormal);\n vec3 newNormalView = normalize(vNormalMatrix * newNormal);\n vec3 selectedNormal = SelectNormal(geoNormal, newNormalView, V);\n ComputeTangents(selectedNormal, Tu, Tv);\n Tu = normalize(Tu);\n Tv = normalize(Tv);\n N = faceforward(selectedNormal, -V, selectedNormal);\n}\n#endif\n#endif\n"},4949:e=>{e.exports="\nuniform float shadowESMConstant;\nuniform float shadowMapRangeMin;\nuniform float shadowMapRangeSize;\n"},65080:e=>{e.exports="\n#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap;\nuniform vec2 shadowMapSize;\nuniform float shadowDarkness;\nuniform float shadowBias;\nuniform vec3 shadowLightDir;\nvarying vec4 vShadowCoord;\n#include <shadowmap_decl_common>\nfloat getShadowValue() {\n float fDepth;\n vec3 shadowColor = vec3( 1.0 );\n vec3 shadowCoord = vShadowCoord.xyz / vShadowCoord.w;\n shadowCoord.xyz = 0.5 * (shadowCoord.xyz + vec3(1.0, 1.0, 1.0));\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n float shadowValue = 1.0;\n if (inFrustum) {\n shadowCoord.z = min(0.999, shadowCoord.z);\n shadowCoord.z -= shadowBias;\n#ifdef USE_HARD_SHADOWS\n vec4 rgbaDepth = texture2D( shadowMap, shadowCoord.xy );\n float fDepth = rgbaDepth.r;\n if ( fDepth < shadowCoord.z ) {\n shadowValue = 1.0 - shadowDarkness;\n }\n#else\n vec4 rgbaDepth = texture2D( shadowMap, shadowCoord.xy );\n float shadowMapValue = rgbaDepth.r;\n shadowValue = exp(-shadowESMConstant * shadowCoord.z) * shadowMapValue;\n shadowValue = min(shadowValue, 1.0);\n shadowValue = mix(1.0 - shadowDarkness, 1.0, shadowValue);\n#endif\n }\n return shadowValue;\n}\n#else\nfloat getShadowValue() { return 1.0; }\n#endif\nvec3 applyEnvShadow(vec3 colorWithoutShadow, vec3 worldNormal) {\n#if defined(USE_SHADOWMAP)\n float dp = dot(shadowLightDir, worldNormal);\n float dpValue = (dp + 1.0) / 2.0;\n dpValue = min(1.0, dpValue * 1.5);\n float sv = getShadowValue();\n vec3 result = colorWithoutShadow * min(sv, dpValue);\n return result;\n#else\n return colorWithoutShadow;\n#endif\n}\n"},11458:e=>{e.exports="\n#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord;\nuniform mat4 shadowMatrix;\n#endif\n"},36238:e=>{e.exports="\n#ifdef USE_SHADOWMAP\n{\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vShadowCoord = shadowMatrix * worldPosition;\n}\n#endif\n"},94005:e=>{e.exports="uniform vec4 themingColor;\n"},25759:e=>{e.exports="gl_FragColor.rgb = mix(gl_FragColor.rgb, themingColor.rgb, themingColor.a);\n"},73985:e=>{e.exports="\nfloat luminance_post(vec3 rgb) {\n return dot(rgb, vec3(0.299, 0.587, 0.114));\n}\nfloat luminance_pre(vec3 rgb) {\n return dot(rgb, vec3(0.212671, 0.715160, 0.072169));\n}\nvec3 xyz2rgb(vec3 xyz) {\n vec3 R = vec3( 3.240479, -1.537150, -0.498535);\n vec3 G = vec3(-0.969256, 1.875992, 0.041556);\n vec3 B = vec3( 0.055648, -0.204043, 1.057311);\n vec3 rgb;\n rgb.b = dot(xyz, B);\n rgb.g = dot(xyz, G);\n rgb.r = dot(xyz, R);\n return rgb;\n}\nvec3 rgb2xyz(vec3 rgb) {\n vec3 X = vec3(0.412453, 0.35758, 0.180423);\n vec3 Y = vec3(0.212671, 0.71516, 0.0721688);\n vec3 Z = vec3(0.0193338, 0.119194, 0.950227);\n vec3 xyz;\n xyz.x = dot(rgb, X);\n xyz.y = dot(rgb, Y);\n xyz.z = dot(rgb, Z);\n return xyz;\n}\nvec3 xyz2xyY(vec3 xyz) {\n float sum = xyz.x + xyz.y + xyz.z;\n sum = 1.0 / sum;\n vec3 xyY;\n xyY.z = xyz.y;\n xyY.x = xyz.x * sum;\n xyY.y = xyz.y * sum;\n return xyY;\n}\nvec3 xyY2xyz(vec3 xyY) {\n float x = xyY.x;\n float y = xyY.y;\n float Y = xyY.z;\n vec3 xyz;\n xyz.y = Y;\n xyz.x = x * (Y / y);\n xyz.z = (1.0 - x - y) * (Y / y);\n return xyz;\n}\nfloat toneMapCanon_T(float x)\n{\n float xpow = pow(x, 1.60525727);\n float tmp = ((1.05542877*4.68037409)*xpow) / (4.68037409*xpow + 1.0);\n return clamp(tmp, 0.0, 1.0);\n}\nconst float Shift = 1.0 / 0.18;\nfloat toneMapCanonFilmic_NoGamma(float x) {\n x *= Shift;\n const float A = 0.2;\n const float B = 0.34;\n const float C = 0.002;\n const float D = 1.68;\n const float E = 0.0005;\n const float F = 0.252;\n const float scale = 1.0/0.833837;\n return (((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F) * scale;\n}\nvec3 toneMapCanonFilmic_WithGamma(vec3 x) {\n x *= Shift;\n const float A = 0.27;\n const float B = 0.29;\n const float C = 0.052;\n const float D = 0.2;\n const float F = 0.18;\n const float scale = 1.0/0.897105;\n return (((x*(A*x+C*B))/(x*(A*x+B)+D*F))) * scale;\n}\nvec3 toneMapCanonOGS_WithGamma_WithColorPerserving(vec3 x) {\n vec3 outColor = x.rgb;\n outColor = min(outColor, vec3(3.0));\n float inLum = luminance_pre(outColor);\n if (inLum > 0.0) {\n float outLum = toneMapCanon_T(inLum);\n outColor = outColor * (outLum / inLum);\n outColor = clamp(outColor, vec3(0.0), vec3(1.0));\n }\n float gamma = 1.0/2.2;\n outColor = pow(outColor, vec3(gamma));\n return outColor;\n}\n"},13458:e=>{e.exports="\n#ifdef WIDE_LINES\nattribute vec3 prev;\nattribute vec3 next;\nattribute float side;\nuniform vec2 view_size;\nvec2 to2d(vec4 i) {\n return i.xy / i.w;\n}\n#endif\n"},16017:e=>{e.exports="\n#ifdef WIDE_LINES\nvec4 mvpPosition = projectionMatrix * mvPosition; \nmat3 vectorMatrix = mat3(modelViewMatrix);\nvec2 _pos = to2d(mvpPosition) * view_size;\nvec2 _prev = to2d(projectionMatrix * vec4(mvPosition.xyz + vectorMatrix * (prev * 0.01), 1.0)) * view_size;\nvec2 _next = to2d(projectionMatrix * vec4(mvPosition.xyz - vectorMatrix * (next * 0.01), 1.0)) * view_size;\nvec2 dir1 = _pos - _next;\nvec2 dir2 = _prev - _pos;\ndir2 = (length(dir2) > 0.0000001) ? normalize(dir2) : vec2(0.0, 0.0);\ndir1 = (length(dir1) > 0.0000001) ? normalize(dir1) : dir2;\nvec2 dir_sharp = normalize(dir1 + dir2);\nvec2 dir = normalize(dir1 + dir_sharp);\nvec2 offset = vec2(-dir.y, dir.x);\nfloat len = 1.0 / cross(vec3(offset, 0), vec3(dir1, 0)).z;\noffset *= len;\noffset /= view_size;\noffset *= side;\noffset *= mvpPosition.w;\nmvpPosition.xy += offset;\ngl_Position = mvpPosition;\n#endif\n"},2867:e=>{e.exports="varying vec3 vColor;\nvarying vec2 vUv;\nuniform samplerCube envMap;\nuniform vec3 uCamDir;\nuniform vec3 uCamUp;\nuniform vec2 uResolution;\nuniform float uHalfFovTan;\nuniform float opacity;\nuniform bool envMapBackground;\n#ifdef USE_BACKGROUND_TEXTURE\nuniform sampler2D backgroundTexture;\n#endif\n#include <env_sample>\nconst int bloomRange = 4;\n#include <ordered_dither>\nuniform float envMapExposure;\n#if TONEMAP_OUTPUT > 0\nuniform float exposureBias;\n#include <tonemap>\n#endif\nvec3 rayDir(in vec2 vUv) {\n vec3 A = (uResolution.x/uResolution.y)*normalize(cross(uCamDir,uCamUp)) * (uHalfFovTan * 2.0);\n vec3 B = normalize(uCamUp) * (uHalfFovTan * 2.0);\n vec3 C = normalize(uCamDir);\n vec3 ray = normalize( C + (2.0*vUv.x-1.0)*A + (2.0*vUv.y-1.0)*B );\n return ray;\n}\nvec3 getColor(in vec3 rd) {\n return RGBMDecode(textureCube(envMap, adjustLookupVector(rd)), envMapExposure);\n}\nvoid main() {\n vec3 rd = rayDir(vUv);\n vec3 outColor;\n float alpha = opacity;\n#ifdef USE_BACKGROUND_TEXTURE\n vec4 texel = texture2D(backgroundTexture, vUv);\n outColor = texel.rgb;\n alpha *= texel.a;\n#else\n if (envMapBackground) {\n outColor = getColor(rd);\n#if TONEMAP_OUTPUT == 1\n outColor = toneMapCanonOGS_WithGamma_WithColorPerserving(exposureBias * outColor);\n#elif TONEMAP_OUTPUT == 2\n outColor = toneMapCanonFilmic_WithGamma(exposureBias * outColor);\n#endif\n }\n else {\n outColor = vColor;\n }\n#endif\n gl_FragColor = vec4(orderedDithering(outColor), alpha);\n}\n"},59047:e=>{e.exports="uniform vec3 color1;\nuniform vec3 color2;\nvarying vec2 vUv;\nvarying vec3 vColor;\nvoid main() {\n if (uv.y == 0.0)\n vColor = color2;\n else\n vColor = color1;\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},48544:e=>{e.exports="uniform vec3 diffuse;\nuniform float opacity;\n#if defined(DEPTH_OCCLUSION) && DEPTH_OCCLUSION == 1\nuniform sampler2D tDepthTest;\nuniform vec2 tDepthResolution;\nvarying float vDepthPositionZ;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#if NUM_CUTPLANES > 0\nvarying highp vec3 vWorldPosition;\n#endif\n#if defined( PARTICLE_UV )\nvarying highp vec4 vUVp;\n#endif\n#include <cutplanes>\n#include <id_decl_frag>\n#include <theming_decl_frag>\nvoid main() {\n#if NUM_CUTPLANES > 0\n checkCutPlanes(vWorldPosition);\n#endif\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );\n#if defined( USE_MAP ) && defined ( PARTICLE_FRAGMENT )\n #if defined( PARTICLE_UV )\n vec2 uv3 = mix( vUVp.xy, vUVp.zw, gl_PointCoord );\n diffuseColor = texture2D( map, uv3);\n #else\n \tdiffuseColor = texture2D( map, gl_PointCoord );\n #endif\n#else\n #include <map_fragment>\n#endif\n#include <color_fragment>\n#include <alphamap_fragment>\n#include <alphatest_fragment>\n#include <specularmap_fragment>\n outgoingLight = diffuseColor.rgb;\n#if !defined ( PARTICLE_FRAGMENT )\n #include <lightmap_fragment>\n #include <envmap_fragment>\n#endif\n#include <linear_to_gamma_fragment>\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n vec3 geomNormal = vec3(0.0,0.0,0.0);\n float depth = 0.0;\n#include <theming_frag>\n#if defined(DEPTH_OCCLUSION) && DEPTH_OCCLUSION == 1\n vec2 depthUV = gl_FragCoord.xy * tDepthResolution;\n float depthVal = texture2D(tDepthTest, depthUV).z;\n if(depthVal > vDepthPositionZ && depthVal != 0.) {\n discard;\n }\n#endif\n#include <final_frag>\n}\n"},75101:e=>{e.exports="#include <id_decl_vert>\n#include <decl_point_size>\n#include <common>\n#include <map_pars_vertex>\n#include <lightmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <wide_lines_decl>\n#include <pack_normals>\n#ifdef USE_INSTANCING\n #include <instancing_decl_vert>\n#endif\n#if defined( PARTICLE_UV )\nattribute vec4 uvp;\nvarying highp vec4 vUVp;\n#endif\n#if defined (PARTICLE_FLAGS)\nattribute float pointScale;\n#endif\n#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\n#if defined(DEPTH_OCCLUSION) && DEPTH_OCCLUSION == 1\nvarying float vDepthPositionZ;\n#endif\nvoid main() {\n#ifdef USE_INSTANCING\n vec3 instancePosition = getInstancePos(position);\n #define position instancePosition\n#endif\n#if defined(USE_ENVMAP) && (defined(UNPACK_NORMALS) || defined(USE_INSTANCE))\n vec3 correctNormal;\n #ifdef UNPACK_NORMALS\n correctNormal = decodeNormal(normal);\n #else\n correctNormal = normal;\n #endif\n #ifdef USE_INSTANCING\n correctNormal = getInstanceNormal(correctNormal);\n #endif\n #define normal correctNormal\n#endif\n#include <map_vertex>\n#include <lightmap_vertex>\n#include <color_vertex>\n#ifdef USE_ENVMAP\n#include <defaultnormal_vertex>\n#endif\n#include <default_vertex>\n#include <wide_lines_vert>\n#include <worldpos_vertex>\n#if NUM_CUTPLANES > 0\n vec4 _worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = _worldPosition.xyz;\n#endif\n#if defined(DEPTH_OCCLUSION) && DEPTH_OCCLUSION == 1\n vec4 _vDepthPosition = modelViewMatrix * vec4( position, 1.0 );\n vDepthPositionZ = _vDepthPosition.z;\n#endif\n#if defined( PARTICLE_UV )\n vUVp = uvp;\n#endif\n#include <envmap_vertex>\n#include <id_vert>\n#include <point_size>\n#if defined (PARTICLE_FLAGS) \n gl_PointSize *= clamp(pointScale, 0.0, 2.0);\n#endif\n}\n"},20505:e=>{e.exports="uniform sampler2D tDiffuse;\nuniform sampler2D tAO;\nuniform int useAO;\nuniform float aoOpacity;\nuniform sampler2D tOverlay;\nuniform int useOverlay;\nuniform int useOverlayAlpha;\nuniform vec2 resolution;\nuniform vec4 objIDv4;\nuniform sampler2D tID;\nuniform vec4 edgeObjIDv4;\n#if defined(USE_MODEL_ID)\n#if defined(HIGHLIGHT_MODEL_ID_COUNT)\nuniform vec2 modelIDsv2v[HIGHLIGHT_MODEL_ID_COUNT];\n#else\nuniform vec2 modelIDv2;\n#endif\nuniform sampler2D tID2;\nuniform vec2 edgeModelIDv2;\n#endif\nuniform float highlightIntensity;\nuniform vec3 selectionColor;\nuniform float highlightFullModel;\nuniform vec3 highlightColor;\n#ifdef IS_2D\nuniform float expand2dSelection;\n#endif\nuniform sampler2D tCrossFadeTex0;\nuniform sampler2D tCrossFadeTex1;\nuniform float crossFadeOpacity0;\nuniform float crossFadeOpacity1;\nvarying vec2 vUv;\n#ifdef SPATIAL_FILTER\n#include <depth_texture>\n#endif\n#include <tonemap>\n#ifdef USE_IDBUFFER_SELECTION\nbool isSelection(vec2 vUv, float I, float J) {\n vec4 idAtPixel = texture2D(tID, vUv+resolution*vec2(I,J));\n if (idAtPixel.rgb == vec3(0.0))\n return false;\n#if defined(USE_MODEL_ID)\n vec4 modelAtPixel = texture2D(tID2, vUv+resolution*vec2(I,J));\n idAtPixel.a = modelAtPixel.b;\n vec4 idDelta = abs(idAtPixel.rgba - edgeObjIDv4.rgba);\n vec2 modelDelta = abs(modelAtPixel.rg - edgeModelIDv2.rg);\n#else\n vec4 idDelta = vec4(abs(idAtPixel.rgb - edgeObjIDv4.rgb), 0.0);\n vec2 modelDelta = vec2(0.0, 0.0);\n#endif\n if (max(max(modelDelta.r, modelDelta.g), max(max(idDelta.r, idDelta.g), max(idDelta.b, idDelta.a))) < 1e-3) {\n return true;\n } else {\n return false;\n }\n}\n#else\nbool isSelected(vec3 C) {\n float minS = min(selectionColor.r, min(selectionColor.g, selectionColor.b));\n float maxS = max(selectionColor.r, max(selectionColor.g, selectionColor.b));\n float satS = maxS - minS;\n float minC = min(C.r, min(C.g, C.b));\n float maxC = max(C.r, max(C.g, C.b));\n float satC = maxC - minC;\n if (satC < .01 || satS < .01)\n return false;\n vec3 S = (selectionColor - minS) / satS;\n vec3 H = (C - minC) / satC;\n vec3 D = H - S;\n float eps = .15;\n return (abs(D.r) + abs(D.g) + abs(D.b) < eps)\n || (maxC >= (1.0 - eps) && D.r >= -eps && D.g >= -eps && D.b >= -eps);\n}\n#define IS_SELECTION(C) isSelected((C).rgb)\n#endif\nvec4 overlayEdgeDetect(vec2 vUv) {\n#ifdef IS_2D\n#define MAX_ALPHA(c)\n#define SUM_ALPHA(c, w) sumAlpha += c.a * w; sumWeight += w;\n#else\n#define MAX_ALPHA(c) maxAlpha = max(maxAlpha, c.a);\n#define SUM_ALPHA(c, w) \n#endif\n#ifdef USE_IDBUFFER_SELECTION\n#define CHECK_EDGE_ALPHA(I, J, W) { vec4 c = texture2D( tOverlay, vUv+resolution*vec2((I),(J)) ); MAX_ALPHA(c) if (c.a > 0.0 && isSelection(vUv, I, J)) { hasEdge++; SUM_ALPHA(c, W) selectionPixel = c; } }\n#else\n#define CHECK_EDGE_ALPHA(I, J, W) { vec4 c = texture2D( tOverlay, vUv+resolution*vec2((I),(J)) ); MAX_ALPHA(c) if (c.a > 0.0 && IS_SELECTION(c)) { hasEdge++; SUM_ALPHA(c, W) selectionPixel = c; } }\n#endif\n#ifndef IS_2D\n#define CHECK_EDGE_SELECTION(I, J) { vec4 c = texture2D( tOverlay, vUv+resolution*vec2((I),(J)) ); MAX_ALPHA(c) if (c.a <= 0.0) hasEdge++; }\n#endif\n int hasEdge = 0;\n vec4 center = texture2D(tOverlay, vUv);\n vec4 selectionPixel = vec4(0.0);\n#ifdef IS_2D\n float sumAlpha = 0.0, sumWeight = 0.0;\n#else\n float maxAlpha = 0.0;\n bool paintOutline = false;\n#endif\n if (center.a <= 0.0) {\n CHECK_EDGE_ALPHA(-1.0,-1.0, 1.0);\n CHECK_EDGE_ALPHA( 0.0,-1.0, 2.0);\n CHECK_EDGE_ALPHA( 1.0,-1.0, 1.0);\n CHECK_EDGE_ALPHA(-1.0, 0.0, 2.0);\n CHECK_EDGE_ALPHA( 1.0, 0.0, 2.0);\n CHECK_EDGE_ALPHA(-1.0, 1.0, 1.0);\n CHECK_EDGE_ALPHA( 0.0, 1.0, 2.0);\n CHECK_EDGE_ALPHA( 1.0, 1.0, 1.0);\n if (hasEdge != 0) {\n#ifdef IS_2D\n center.a = -clamp(expand2dSelection - 1.0 + sumAlpha / sumWeight, 0.0, 1.0);\n center.rgb = center.a < 0.0 ? selectionPixel.rgb : center.rgb;\n#else\n center = selectionPixel;\n paintOutline = true;\n#endif\n }\n }\n#ifdef USE_IDBUFFER_SELECTION\n else if (center.a > 0.0 && isSelection(vUv, 0.0, 0.0)) {\n#else\n else if (center.a > 0.0 && IS_SELECTION(center)) {\n#endif\n#ifdef IS_2D\n center.a = -clamp(center.a + expand2dSelection, 0.0, 1.0);\n#else\n CHECK_EDGE_SELECTION(-1.0,-1.0);\n CHECK_EDGE_SELECTION( 0.0,-1.0);\n CHECK_EDGE_SELECTION( 1.0,-1.0);\n CHECK_EDGE_SELECTION(-1.0, 0.0);\n CHECK_EDGE_SELECTION( 1.0, 0.0);\n CHECK_EDGE_SELECTION(-1.0, 1.0);\n CHECK_EDGE_SELECTION( 0.0, 1.0);\n CHECK_EDGE_SELECTION( 1.0, 1.0);\n if (hasEdge != 0)\n paintOutline = true;\n else\n center.a = -center.a;\n#endif\n }\n#ifndef IS_2D\n if (paintOutline) {\n float maxComponent = max(center.r, max(center.g, center.b));\n center.rgb /= maxComponent;\n center.rgb = sqrt(center.rgb);\n center.a = 0.5 + 0.5 * maxAlpha * 0.125 * float(hasEdge);\n }\n#endif\n return center;\n}\n#ifdef SPATIAL_FILTER\nSPATIAL_FILTER\n#endif\nvec4 sampleColor() {\n return texture2D( tDiffuse, vUv );\n}\nfloat sampleAO() {\n return (useAO != 0) ? sqrt(texture2D(tAO, vUv).r) : 1.0;\n}\nvec3 applyCrossFade(vec3 srcColor, sampler2D fadeTex, float opacity, vec2 vUv) {\n vec4 blendCol = texture2D(fadeTex, vUv);\n return mix(srcColor.rgb, blendCol.rgb, blendCol.a * opacity);\n}\nvoid applyHighlighting(inout vec3 rgb, float filterValue) {\n#ifdef IS_2D\n rgb = mix(rgb, vec3(1.0,1.0,0.0), filterValue * highlightIntensity * 0.25);\n#else\n rgb += highlightColor * filterValue * highlightIntensity * 0.20;\n#endif\n}\n#ifdef USE_MODEL_ID\nfloat getModelIdDelta(vec2 a, vec2 b) {\n vec2 delta = abs(a-b);\n return max(delta.r, delta.g);\n}\nfloat getModelIdDelta(vec2 modelAtPixel) {\n \n#ifdef HIGHLIGHT_MODEL_ID_COUNT\n float delta = 1.0;\n for (int i=0; i<HIGHLIGHT_MODEL_ID_COUNT; i++) {\n delta = min(delta, getModelIdDelta(modelAtPixel, modelIDsv2v[i]));\n }\n return delta;\n#else\n return getModelIdDelta(modelAtPixel, modelIDv2.rg);\n#endif\n}\n#endif\nvoid main() {\n vec4 texel = sampleColor();\n float ao = sampleAO();\n #ifdef NUM_CROSSFADE_TARGETS\n #if (NUM_CROSSFADE_TARGETS > 1)\n #if (TARGET_FADE_MODE == 0)\n texel.rgb = applyCrossFade(texel.rgb, tCrossFadeTex0, crossFadeOpacity0, vUv);\n texel.rgb = applyCrossFade(texel.rgb, tCrossFadeTex1, crossFadeOpacity1, vUv);\n #else\n vec4 t0 = texture2D(tCrossFadeTex0, vUv);\n vec4 t1 = texture2D(tCrossFadeTex1, vUv);\n vec4 mixed = mix(t0, t1, crossFadeOpacity1);\n texel.rgb = mix(texel.rgb, mixed.rgb, mixed.a);\n float aoGamma = 1.0 + 3.0 * (1.0 - 2.0 * abs(crossFadeOpacity1 - 0.5));\n if (aoGamma == 0.0)\n aoGamma = 1.0;\n ao = pow(ao, 1.0 / aoGamma);\n #endif\n #else\n vec4 mixed = texture2D(tCrossFadeTex0, vUv);\n texel.rgb = mix(texel.rgb, mixed.rgb, mixed.a);\n #endif\n #else\n #endif\n ao = 1.0 - (1.0 - ao) * aoOpacity;\n texel.rgb *= ao;\n if (useOverlay != 0) {\n vec4 overlay = overlayEdgeDetect(vUv);\n if (overlay.a < 0.0) {\n overlay.a = -overlay.a;\n#ifdef IS_2D\n overlay.a *= 0.6;\n#else\n if (overlay.a >= 0.99) {\n overlay.a = 0.75;\n texel.rgb = vec3(luminance_post(texel.rgb));\n }\n#endif\n }\n#ifdef IS_2D\n texel.rgb = texel.rgb * (1.0 - overlay.a) + overlay.rgb;\n#else\n texel.rgb = texel.rgb * (1.0 - overlay.a) + sqrt(overlay.rgb * overlay.a);\n#endif\n if (useOverlayAlpha != 0) {\n texel.a += overlay.a * (1.0 - texel.a);\n }\n }\n if (objIDv4 != vec4(0.0)) {\n vec4 idAtPixel = texture2D(tID, vUv);\n #ifdef SPATIAL_FILTER\n vec3 worldPos = reconstructWorldPosition(gl_FragCoord.xy, vUv);\n float filterValue = (spatialFilter(worldPos) ? 1.0 : 0.0);\n if (idAtPixel != vec4(1,1,1,1)) {\n applyHighlighting(texel.rgb, filterValue);\n }\n #else\n #if defined(USE_MODEL_ID)\n vec4 modelAtPixel = texture2D(tID2, vUv);\n idAtPixel.a = modelAtPixel.b;\n vec4 idDelta = abs(idAtPixel.rgba - objIDv4.rgba) * (1.0 - highlightFullModel);\n float modelDelta = getModelIdDelta(modelAtPixel.rg);\n #else\n vec4 idDelta = vec4(abs(idAtPixel.rgb - objIDv4.rgb), 0.0);\n float modelDelta = 0.0;\n #endif\n if (max(modelDelta, max(max(idDelta.r, idDelta.g), max(idDelta.b, idDelta.a))) < 1e-3) {\n applyHighlighting(texel.rgb, 1.0);\n }\n #endif\n }\n gl_FragColor = texel;\n}\n"},40518:e=>{e.exports="\n#include <depth_texture>\nuniform sampler2D tDiffuse;\nuniform sampler2D tID;\nuniform vec2 resolution;\nuniform float cameraNear;\nuniform float cameraFar;\nuniform sampler2D tFill;\nuniform sampler2D tPaper;\nuniform int style;\nuniform int idEdges;\nuniform int normalEdges;\nuniform int depthEdges;\nuniform float brightness;\nuniform float contrast;\nuniform int grayscale;\nuniform int preserveColor;\nuniform int outlineNoise;\nuniform float levels;\nuniform float repeats;\nuniform float rotation;\nuniform float outlineRadius;\nuniform sampler2D tGraphite1;\nuniform sampler2D tGraphite2;\nuniform sampler2D tGraphite3;\nuniform sampler2D tGraphite4;\nuniform sampler2D tGraphite5;\nuniform sampler2D tGraphite6;\nuniform sampler2D tGraphite7;\nuniform sampler2D tGraphite8;\nvarying vec2 vUv;\nvec4 recoverNZ(vec4 nrmz) {\n float z = sqrt(1.0 - dot(nrmz.xy, nrmz.xy));\n nrmz.w = -(nrmz.z + cameraNear) / (cameraFar - cameraNear);\n nrmz.z = z;\n return nrmz;\n}\n#include <tonemap>\n#include <hsv>\nvec3 quantize(vec3 c) {\n float L = max(c.r, max(c.g, c.b));\n c *= floor(L * (levels-1.0) + 0.5) / (L * (levels-1.0));\n return c;\n}\nvec3 quantizeRGB(vec3 c) {\n c *= c;\n c *= floor(c * levels * 0.9999) / (levels-1.0);\n return sqrt(c);\n}\nvec3 clampHue(vec3 c, float hues, float sats, float vals) {\n vec3 hsv = rgb2hsv(c);\n hsv.x = floor(hsv.x * hues + 0.5) / hues;\n hsv.y = floor(hsv.y * sats + 0.5) / sats;\n hsv.z = floor(hsv.z * vals + 0.5) / vals;\n vec3 col = hsv2rgb(hsv);\n return col;\n}\nvec3 reconstructCSFaceNormal(vec3 C) {\n return normalize(cross(dFdy(C), dFdx(C)));\n}\nvec3 getPosition(ivec2 ssP, float depth) {\n vec3 P;\n P = reconstructCSPosition(vec2(ssP) + vec2(0.5), depth);\n return P;\n}\nint isObjectEdge() {\n vec2 uv = vUv;\n if (outlineNoise == 1) {\n vec4 noise = texture2D(tGraphite7, vUv);\n uv = vUv + 0.02 * (noise.xy - vec2(0.25));\n }\n vec4 MM = texture2D(tID, uv);\n vec4 LL = texture2D(tID, uv + vec2(-outlineRadius, -outlineRadius) * resolution);\n if (MM != LL) return 1;\n vec4 LM = texture2D(tID, uv + vec2( 0.0, -outlineRadius) * resolution);\n if (MM != LM) return 1;\n vec4 LR = texture2D(tID, uv + vec2( outlineRadius, -outlineRadius) * resolution);\n if (MM != LR) return 1;\n vec4 ML = texture2D(tID, uv + vec2(-outlineRadius, 0.0) * resolution);\n if (MM != ML) return 1;\n vec4 MR = texture2D(tID, uv + vec2( outlineRadius, 0.0) * resolution);\n if (MM != MR) return 1;\n vec4 UL = texture2D(tID, uv + vec2(-outlineRadius, outlineRadius) * resolution);\n if (MM != UL) return 1;\n vec4 UM = texture2D(tID, uv + vec2( 0.0, outlineRadius) * resolution);\n if (MM != UM) return 1;\n vec4 UR = texture2D(tID, uv + vec2( outlineRadius, outlineRadius) * resolution);\n if (MM != UR) return 1;\n return (MM.x + MM.y + MM.z + MM.w) >= 4.0 ? 0 : -1;\n}\nfloat normalDiff(vec3 n1, vec3 n2) {\n float d = dot(n1.xyz, n2.xyz);\n return acos(clamp(d, -1.0, 1.0));\n}\nint isNormalDepthEdge() {\n ivec2 ssC = ivec2(gl_FragCoord.xy);\n vec2 uv = vUv;\n if (outlineNoise == 1) {\n vec4 noise = texture2D(tGraphite7, vUv);\n uv = vUv + 0.02 * (noise.xy - vec2(0.25));\n }\n vec4 MM = texture2D(tDepth, uv);\n vec4 LL = texture2D(tDepth, uv + vec2(-outlineRadius, -outlineRadius) * resolution);\n vec4 LM = texture2D(tDepth, uv + vec2( 0.0, -outlineRadius) * resolution);\n vec4 LR = texture2D(tDepth, uv + vec2( outlineRadius, -outlineRadius) * resolution);\n \n vec4 ML = texture2D(tDepth, uv + vec2(-outlineRadius, 0.0) * resolution);\n vec4 MR = texture2D(tDepth, uv + vec2( outlineRadius, 0.0) * resolution);\n vec4 UL = texture2D(tDepth, uv + vec2(-outlineRadius, outlineRadius) * resolution);\n vec4 UM = texture2D(tDepth, uv + vec2( 0.0, outlineRadius) * resolution);\n vec4 UR = texture2D(tDepth, uv + vec2( outlineRadius, outlineRadius) * resolution);\n LL = recoverNZ(LL);\n LM = recoverNZ(LM);\n LR = recoverNZ(LR);\n ML = recoverNZ(ML);\n MM = recoverNZ(MM);\n MR = recoverNZ(MR);\n UL = recoverNZ(UL);\n UM = recoverNZ(UM);\n UR = recoverNZ(UR);\n float dd = 0.0;\n if ( depthEdges == 1 ) {\n float G = (abs(UL.w - MM.w) + 2.0 * abs(UM.w - MM.w) + abs(UR.w - MM.w) + 2.0 * abs(ML.w - MM.w) + 2.0 * abs(MR.w - MM.w) + abs(LL.w - MM.w) + 2.0 * abs(LM.w - MM.w) + abs(LR.w - MM.w));\n dd = abs(dFdx(G)) + abs(dFdy(G));\n }\n float Gn = 0.0;\n if ( normalEdges == 1 ) {\n float pLL = normalDiff(LL.xyz, MM.xyz);\n float pLM = normalDiff(LM.xyz, MM.xyz);\n float pLR = normalDiff(LR.xyz, MM.xyz);\n float pML = normalDiff(ML.xyz, MM.xyz);\n float pMM = normalDiff(MM.xyz, MM.xyz);\n float pMR = normalDiff(MR.xyz, MM.xyz);\n float pUL = normalDiff(UL.xyz, MM.xyz);\n float pUM = normalDiff(UM.xyz, MM.xyz);\n float pUR = normalDiff(UR.xyz, MM.xyz);\n Gn = (abs(pUL - pMM) + 2.0 * abs(pUM - pMM) + abs(pUR - pMM) + 2.0 * abs(pML - pMM) + 2.0 * abs(pMR - pMM) + abs(pLL - pMM) + 2.0 * abs(pLM - pMM) + abs(pLR - pMM));\n }\n \n return (dd > 0.004 || Gn > 2.0) ? 1 : 0;\n}\nvec3 computeGraphite( vec3 color, vec2 loc ) {\n float lum = 0.299 * color.r + 0.587 * color.g + 0.114 * color.b;\n float offset;\n vec3 col1, col2;\n if ( lum > 6.0/7.0 ) {\n col1 = texture2D(tGraphite1, loc ).xyz;\n col2 = texture2D(tGraphite2, loc ).xyz;\n offset = 6.0/7.0;\n } else if ( lum > 5.0/7.0 ) {\n col1 = texture2D(tGraphite2, loc ).xyz;\n col2 = texture2D(tGraphite3, loc ).xyz;\n offset = 5.0/7.0;\n } else if ( lum > 4.0/7.0 ) {\n col1 = texture2D(tGraphite3, loc ).xyz;\n col2 = texture2D(tGraphite4, loc ).xyz;\n offset = 4.0/7.0;\n } else if ( lum > 3.0/7.0 ) {\n col1 = texture2D(tGraphite4, loc ).xyz;\n col2 = texture2D(tGraphite5, loc ).xyz;\n offset = 3.0/7.0;\n } else if ( lum > 2.0/7.0 ) {\n col1 = texture2D(tGraphite5, loc ).xyz;\n col2 = texture2D(tGraphite6, loc ).xyz;\n offset = 2.0/7.0;\n } else if ( lum > 1.0/7.0 ) {\n col1 = texture2D(tGraphite6, loc ).xyz;\n col2 = texture2D(tGraphite7, loc ).xyz;\n offset = 1.0/7.0;\n } else {\n col1 = texture2D(tGraphite7, loc ).xyz;\n col2 = texture2D(tGraphite8, loc ).xyz;\n offset = 0.0;\n }\n if ( col1.r == 0.0 && col2.r == 0.0 ) {\n return vec3(lum,lum,lum);\n }\n float t = (lum-offset)*7.0;\n return (col1 * t + col2 * (1.0 - t));\n}\nvec3 colorWithAdjustments() {\n vec3 sceneRGB = texture2D(tDiffuse, vUv).xyz;\n if ( brightness != 0.0 || contrast != 0.0) {\n if ( brightness < 0.0 )\n {\n sceneRGB = sceneRGB * (1.0 + brightness);\n }\n else\n {\n sceneRGB = sceneRGB + ((1.0 - sceneRGB) * brightness);\n }\n float slant = tan(( clamp(contrast,-1.0,1.0) + 1.0) * 3.141592/4.001);\n sceneRGB = (sceneRGB - 0.5) * slant + 0.5;\n if ( preserveColor == 1 )\n {\n float maxval = max( sceneRGB.r, sceneRGB.g );\n maxval = max( maxval, sceneRGB.b );\n if ( maxval > 1.0 )\n {\n sceneRGB /= maxval;\n }\n }\n sceneRGB = clamp(sceneRGB,0.0,1.0);\n }\n if ( grayscale == 1 ) {\n sceneRGB.rgb = vec3(luminance_post(sceneRGB.rgb));\n }\n return sceneRGB;\n}\nvoid main() {\n int foundEdge = 0;\n foundEdge = ( idEdges == 1 && isObjectEdge() == 1 ) ? 1 : 0;\n if ( foundEdge == 0 && (normalEdges == 1 || depthEdges == 1) ) {\n foundEdge = isNormalDepthEdge();\n }\n vec2 loc = vec2((vUv.x-0.5)*(resolution.y/resolution.x),vUv.y-0.5)*repeats;\n if ( style > 2 && rotation != 0.0 ) {\n float rot = 3.14159*rotation;\n float sinr = sin(rot);\n float cosr = cos(rot);\n loc = vec2(loc.x*cosr + -loc.y*sinr, loc.x*sinr + loc.y*cosr);\n }\n loc += vec2(0.5,0.5);\n vec3 color;\n if ( style == 2 ) {\n if ( foundEdge == 1 ) {\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n } else {\n gl_FragColor = vec4(quantize(colorWithAdjustments()),1.0);\n }\n } else if ( style == 3 ) {\n color = colorWithAdjustments();\n vec3 graphColor = computeGraphite( color, loc );\n if ( foundEdge == 1 ) {\n gl_FragColor = vec4(0.16,0.16,0.16,1.0) + vec4(0.18 * graphColor,0.0);\n } else {\n gl_FragColor = vec4(graphColor,1.0);\n }\n return;\n } else if ( style == 4 ) {\n float fill = texture2D(tFill, loc ).r;\n float paperStrength = 0.3;\n vec3 paper = texture2D(tPaper, loc ).rgb;\n paper = paperStrength * paper + (1.0-paperStrength)*vec3(1.0,1.0,1.0);\n if ( foundEdge == 1 ) {\n gl_FragColor = 0.75 * vec4(paper * fill, 1.0);\n } else {\n fill = pow(fill,1.6);\n gl_FragColor = vec4(colorWithAdjustments() * (1.0 - fill) + paper * fill, 1.0);\n }\n } else {\n if ( foundEdge == 1 ) {\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n } else {\n gl_FragColor = vec4(colorWithAdjustments(),1.0);\n }\n return; \n }\n}\n"},67086:e=>{e.exports="uniform sampler2D tDiffuse;\nvarying vec2 vUv;\nvoid main() {\n gl_FragColor = texture2D(tDiffuse, vUv);\n}\n"},6750:e=>{e.exports="\n#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\n#include <cutplanes>\nuniform vec4 color;\n#include <id_decl_frag>\nvoid main() {\n#if NUM_CUTPLANES > 0\n checkCutPlanes(vWorldPosition);\n#endif\n gl_FragColor = color;\n#ifdef MRT_NORMALS\noutNormal = vec4(0.0);\n#endif\n#ifdef MRT_ID_BUFFER\n outId = vec4(0.0);\n #ifdef MODEL_COLOR\n outModelId = vec4(0.0);\n #endif\n#elif defined(ID_COLOR)\n gl_FragColor = vec4(0.0);\n#elif defined(MODEL_COLOR)\n gl_FragColor = vec4(0.0);\n#endif\n}"},79282:e=>{e.exports="\n#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\n#include <instancing_decl_vert>\nvoid main() {\n vec3 instPos = getInstancePos(position);\n#if NUM_CUTPLANES > 0\n vec4 worldPosition = modelMatrix * vec4( instPos, 1.0 );\n vWorldPosition = worldPosition.xyz;\n#endif\n vec4 mvPosition = modelViewMatrix * vec4( instPos, 1.0 );\n vec4 p_Position = projectionMatrix * mvPosition;\n gl_Position = p_Position;\n}"},49510:e=>{e.exports="#define FXAA_EDGE_SHARPNESS (8.0)\n#define FXAA_EDGE_THRESHOLD (0.125)\n#define FXAA_EDGE_THRESHOLD_MIN (0.05)\n#define FXAA_RCP_FRAME_OPT (0.50)\n#define FXAA_RCP_FRAME_OPT2 (2.0)\nuniform sampler2D tDiffuse;\nuniform highp vec2 uResolution;\nvarying vec2 vPos;\nvarying vec4 vPosPos;\nfloat FxaaLuma(vec3 rgb) {\n return dot(rgb, vec3(0.299, 0.587, 0.114));\n}\nvoid main() {\n float lumaNw = FxaaLuma(texture2D(tDiffuse, vPosPos.xy).rgb);\n float lumaSw = FxaaLuma(texture2D(tDiffuse, vPosPos.xw).rgb);\n float lumaNe = FxaaLuma(texture2D(tDiffuse, vPosPos.zy).rgb) + 1.0/384.0;\n float lumaSe = FxaaLuma(texture2D(tDiffuse, vPosPos.zw).rgb);\n vec4 rgbaM = texture2D(tDiffuse, vPos.xy); \n float lumaM = FxaaLuma(rgbaM.rgb);\n float lumaMax = max(max(lumaNe, lumaSe), max(lumaNw, lumaSw));\n float lumaMin = min(min(lumaNe, lumaSe), min(lumaNw, lumaSw));\n float lumaMaxSubMinM = max(lumaMax, lumaM) - min(lumaMin, lumaM);\n float lumaMaxScaledClamped = max(FXAA_EDGE_THRESHOLD_MIN, lumaMax * FXAA_EDGE_THRESHOLD);\n if (lumaMaxSubMinM < lumaMaxScaledClamped) {\n gl_FragColor = rgbaM;\n return;\n }\n float dirSwMinusNe = lumaSw - lumaNe;\n float dirSeMinusNw = lumaSe - lumaNw;\n vec2 dir1 = normalize(vec2(dirSwMinusNe + dirSeMinusNw, dirSwMinusNe - dirSeMinusNw));\n vec3 rgbN1 = texture2D(tDiffuse, vPos.xy - dir1 * FXAA_RCP_FRAME_OPT*uResolution).rgb;\n vec3 rgbP1 = texture2D(tDiffuse, vPos.xy + dir1 * FXAA_RCP_FRAME_OPT*uResolution).rgb;\n float dirAbsMinTimesC = min(abs(dir1.x), abs(dir1.y)) * FXAA_EDGE_SHARPNESS;\n vec2 dir2 = clamp(dir1.xy / dirAbsMinTimesC, -2.0, 2.0);\n vec3 rgbN2 = texture2D(tDiffuse, vPos.xy - dir2 * FXAA_RCP_FRAME_OPT2*uResolution).rgb;\n vec3 rgbP2 = texture2D(tDiffuse, vPos.xy + dir2 * FXAA_RCP_FRAME_OPT2*uResolution).rgb;\n vec3 rgbA = rgbN1 + rgbP1;\n vec3 rgbB = ((rgbN2 + rgbP2) * 0.25) + (rgbA * 0.25);\n float lumaB = FxaaLuma(rgbB);\n float alpha = rgbaM.a;\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n gl_FragColor = vec4(rgbA * 0.5, rgbaM.a);\n else\n gl_FragColor = vec4(rgbB, rgbaM.a);\n}\n"},63332:e=>{e.exports="uniform vec2 uResolution;\nvarying vec2 vPos;\nvarying vec4 vPosPos;\nvoid main() {\n vPos = uv;\n vPosPos.xy = uv + vec2(-0.5, -0.5) * uResolution;\n vPosPos.zw = uv + vec2( 0.5, 0.5) * uResolution;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},93285:e=>{e.exports="uniform sampler2D tDiffuse;\nuniform vec4 uColor;\nvarying vec2 vUv;\n#ifdef HORIZONTAL\n#define GET_UV(X) vec2(vUv.x + KERNEL_SCALE_H*(X), vUv.y)\n#else\n#define GET_UV(Y) vec2(vUv.x, vUv.y + KERNEL_SCALE_V*(Y))\n#endif\n#define PI 3.14159265358979\n#define SIGMA ((KERNEL_RADIUS+KERNEL_RADIUS+1.0) / 6.0)\n#define SIGMASQ2 (2.0 * SIGMA * SIGMA)\n#define GAUSSIAN(X) ( (1.0 / sqrt(PI * SIGMASQ2)) * exp(-(X)*(X)/SIGMASQ2) )\nvoid main() {\n vec4 texColSum = vec4(0.0);\n float gaussSum = 0.0;\n for (float x=-KERNEL_RADIUS; x<=KERNEL_RADIUS; x+=1.0) {\n float gauss = GAUSSIAN(x);\n vec4 texCol = texture2D(tDiffuse, GET_UV(x));\n#ifdef HAS_ALPHA\n texCol.rgb *= texCol.a;\n#endif\n texColSum += texCol * gauss;\n gaussSum += gauss;\n }\n#ifdef HAS_ALPHA\n texColSum.rgb /= (texColSum.a == 0.0 ? 0.0001 : texColSum.a);\n#endif\n#ifdef HORIZONTAL\n gl_FragColor = texColSum/gaussSum;\n#else\n gl_FragColor = texColSum/gaussSum * uColor;\n#endif\n}\n"},3911:e=>{e.exports="varying vec2 vUv;\nvoid main() {\n#if defined(HORIZONTAL) && defined(FLIP_UV)\n vUv = vec2(uv.x, 1.0-uv.y);\n#else\n vUv = vec2(uv.x, uv.y);\n#endif\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"},24687:e=>{e.exports="uniform sampler2D tDiffuse;\nvarying vec2 vUv;\nvoid main() {\n vec4 texel = texture2D( tDiffuse, vUv );\n gl_FragColor = texel;\n}\n"},24009:e=>{e.exports="#define NUM_SAMPLES 29.0\n#define NUM_SPIRAL_TURNS 7.0\nuniform sampler2D tDepth;\nuniform vec3 worldSize;\nvarying vec2 vUv;\n#ifdef PRESET_2\n#define SAMPLE_RADIUS 0.3\n#define AO_GAMMA 1.0\n#define AO_INTENSITY 1.0\n#else\n#define SAMPLE_RADIUS 0.2\n#define AO_GAMMA 3.0\n#define AO_INTENSITY 0.8\n#endif\n#include <pack_depth>\n#define PI 3.14159265358979\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\nfloat getRandomAngle(vec2 pos) {\n return rand(pos) * (2.0 * PI);\n}\nvec2 tapLocation(float sampleNumber, float spinAngle, out float ssR){\n float alpha = float(sampleNumber + 0.5) * (1.0 / NUM_SAMPLES);\n float angle = alpha * (NUM_SPIRAL_TURNS * PI * 2.0) + spinAngle;\n ssR = alpha;\n return vec2(cos(angle), sin(angle));\n}\nvec2 sampleAO(vec2 unitDirection, float radius) {\n vec2 sampleOffset = unitDirection * radius;\n float idepth = unpackDepth(texture2D(tDepth, vUv + sampleOffset));\n float depth = 1.0 - idepth;\n if (depth < 1e-6) {\n if (radius == 0.0)\n return vec2(1.0, 1.0);\n else\n return vec2(0.0, 1.0);\n }\n vec3 dir = vec3(sampleOffset.x, depth, sampleOffset.y) * worldSize;\n float distance2 = dot(dir,dir);\n float idistance = 1.0 / sqrt(distance2);\n vec3 ndir = dir * idistance;\n#ifdef PRESET_2\n float importance = ndir.y * idistance;\n#else\n float importance = ndir.y / distance2;\n#endif\n vec2 ret;\n ret.x = (idepth == 0.0) ? 0.0 : importance;\n ret.y = importance;\n return ret;\n}\nvoid main() {\n vec2 sum = vec2(0.0);\n float angle = getRandomAngle(vUv);\n for (float i = 0.0; i<NUM_SAMPLES; i+= 1.0) {\n float ssR;\n vec2 uv = tapLocation(i, angle, ssR);\n sum += sampleAO(uv, ssR * SAMPLE_RADIUS);\n }\n float ao = sum.x / sum.y;\n gl_FragColor = packDepth(AO_INTENSITY * clamp(pow(ao, AO_GAMMA), 0.0, 0.9999));\n}\n"},8242:e=>{e.exports="uniform sampler2D tDepth;\nvarying vec2 vUv;\n#ifdef HORIZONTAL\n#define GET_UV(X) vec2(vUv.x + KERNEL_SCALE*(X), vUv.y)\n#else\n#define GET_UV(Y) vec2(vUv.x, vUv.y + KERNEL_SCALE*(Y))\n#endif\n#include <pack_depth>\n#define PI 3.14159265358979\n#define SIGMA ((2.0 * KERNEL_RADIUS+1.0) / 6.0)\n#define SIGMASQ2 (2.0 * SIGMA * SIGMA)\n#ifdef BOX\n#define KERNEL_VAL(X) 1.0\n#else\n#define KERNEL_VAL(X) ( (1.0 / sqrt(PI * SIGMASQ2)) * exp(-(X)*(X)/SIGMASQ2) )\n#endif\nvoid main() {\n float depthVal = 0.0;\n float sum = 0.0;\n for (float x=-KERNEL_RADIUS; x<=KERNEL_RADIUS; x+=1.0) {\n depthVal += unpackDepth(texture2D(tDepth, GET_UV(x))) * KERNEL_VAL(x);\n sum += KERNEL_VAL(x);\n }\n gl_FragColor = packDepth(depthVal/sum);\n}\n"},14810:e=>{e.exports="uniform sampler2D tDepth;\nuniform vec4 uShadowColor;\nvarying vec2 vUv;\n#include <pack_depth>\nvoid main() {\n float depthVal = unpackDepth(texture2D(tDepth, vUv));\n gl_FragColor = vec4(uShadowColor.rgb, uShadowColor.a * depthVal);\n}\n"},57165:e=>{e.exports="#include <pack_depth>\n#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\n#include <cutplanes>\nvoid main() {\n#if NUM_CUTPLANES > 0\n checkCutPlanes(vWorldPosition);\n#endif\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n depth = 1.0 - depth;\n gl_FragColor = packDepth(depth);\n}\n"},40520:e=>{e.exports="#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );;\n#if NUM_CUTPLANES > 0\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n#endif\n}\n"},13518:e=>{e.exports="#include <common>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <id_decl_frag>\n#include <theming_decl_frag>\n#define ENABLE_ID_DISCARD\nuniform float opacity;\nuniform vec4 selectionColor;\n#if NUM_CUTPLANES>0\nvarying highp vec3 vWorldPosition;\n#endif\n#ifdef VIEWPORT_CLIPPING\nuniform highp vec4 viewportBounds;\nvarying vec4 vPosition;\n#endif\n#include <cutplanes>\nvoid main(){\n #if NUM_CUTPLANES>0\n checkCutPlanes(vWorldPosition);\n #endif\n \n #ifdef VIEWPORT_CLIPPING\n \n if (vPosition.x < viewportBounds.x || vPosition.x > viewportBounds.z || vPosition.y < viewportBounds.y || vPosition.y > viewportBounds.w) {\n discard;\n }\n #endif\n \n float depth = 0.;\n vec3 geomNormal = vec3(0.);\n vec3 outgoingLight = vec3(0.);\n vec4 diffuseColor = vec4(opacity);\n \n #include <map_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n \n outgoingLight = diffuseColor.rgb;\n \n #include <linear_to_gamma_fragment>\n \n gl_FragColor = vec4(outgoingLight, diffuseColor.a);\n float writeId = 1.0;\n #ifdef GHOSTED \n writeId = 0.;\n gl_FragColor.a *= 0.1;\n #endif\n \n #include <theming_frag>\n gl_FragColor.rgb = mix(gl_FragColor.rgb, selectionColor.rgb, selectionColor.a);\n #include <final_frag>\n}\n"},34722:e=>{e.exports="#include <common>\n#include <map_pars_vertex>\n#if NUM_CUTPLANES>0\nvarying vec3 vWorldPosition;\n#endif\n#ifdef VIEWPORT_CLIPPING\nuniform mat4 modelLocalMatrix;\nvarying vec4 vPosition;\n#endif\nvoid main(){\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n \n #if NUM_CUTPLANES>0\n vWorldPosition = (modelMatrix * vec4(position,1.)).xyz;\n #endif\n \n #ifdef VIEWPORT_CLIPPING\n vPosition = modelLocalMatrix * vec4(position.xy,0.,1.);\n #endif\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4(position.xy,0.,1.);\n}\n"},18350:e=>{e.exports="\r\n\r\n#define LINE\r\n#include <line_decl_common>\r\n#include <id_decl_frag>\r\n\r\nuniform highp float pixelsPerUnit;\r\nuniform highp float aaRange;\r\n\r\nuniform float opacity;\r\nuniform highp float viewportId;\r\nuniform highp float swap;\r\nuniform highp float grayscale;\r\n\r\n#ifdef HAS_RASTER_QUADS\r\nuniform sampler2D tRaster;\r\n#endif\r\n\r\n#ifdef HAS_LINESTYLES\r\nuniform sampler2D tLineStyle;\r\nuniform vec2 vLineStyleTexSize;\r\n#endif\r\n\r\n#ifdef VIEWPORT_CLIPPING\r\nuniform highp vec4 viewportBounds;\r\nvarying highp vec2 vPosition;\r\n#endif\r\n\r\n#ifdef IMAGE_UV_TEXTURE\r\nvarying highp vec2 vuv;\r\nuniform sampler2D tRaster;\r\n#endif\r\n\r\n\r\nfloat curveGaussian(float r, float invWidth) {\r\n float amt = clamp(r * invWidth, 0.0, 1.0);\r\n\r\n float exponent = amt * 2.0;\r\n\r\n return exp(-exponent*exponent);\r\n\r\n\r\n\r\n}\r\n\r\n#ifdef HAS_LINESTYLES\r\nfloat getLinePatternPixel(int i, int j) {\r\n\r\n return texture2D(tLineStyle, (vec2(i, j) + 0.5) / vLineStyleTexSize).x * 255.0;\r\n}\r\n\r\nfloat getPatternLength(int whichPattern) {\r\n float p1 = getLinePatternPixel(0, whichPattern);\r\n float p2 = getLinePatternPixel(1, whichPattern);\r\n return (p2 * 256.0 + p1);\r\n}\r\n#endif\r\n\r\n\r\nvoid fillLineSegment() {\r\n\r\n float radius = abs(fsHalfWidth);\r\n float parametricDistance = fsMultipurpose.x;\r\n float segmentLength = fsMultipurpose.y;\r\n float totalDistance = fsMultipurpose.z;\r\n\r\n#ifdef LOADING_ANIMATION\r\n float distFromStart = parametricDistance / segmentLength;\r\n if (loadingProgress < 1.0 && distFromStart > loadingProgress) {\r\n discard;\r\n }\r\n#endif\r\n\r\n\r\n#ifdef HAS_LINESTYLES\r\n int whichPattern = int(fsMultipurpose.w);\r\n\r\n if (whichPattern > 0) {\r\n const float TEX_TO_UNIT = 1.0 / 96.0;\r\n\r\n float patternScale;\r\n\r\n\r\n\r\n if (fsHalfWidth < 0.0) {\r\n patternScale = LTSCALE;\r\n } else {\r\n patternScale = LTSCALE * TEX_TO_UNIT * pixelsPerUnit;\r\n }\r\n\r\n float patLen = patternScale * getPatternLength(whichPattern);\r\n float phase = mod((totalDistance + parametricDistance) * pixelsPerUnit, patLen);\r\n\r\n bool onPixel = true;\r\n float radiusPixels = radius * pixelsPerUnit;\r\n\r\n for (int i=2; i<MAX_LINESTYLE_LENGTH; i+=2) {\r\n\r\n float on = getLinePatternPixel(i, whichPattern);\r\n if (on == 1.0) on = 0.0;\r\n on *= patternScale;\r\n\r\n onPixel = true;\r\n phase -= on;\r\n if (phase < 0.0) {\r\n break;\r\n }\r\n else if (phase <= radiusPixels) {\r\n onPixel = false;\r\n break;\r\n }\r\n\r\n float off = getLinePatternPixel(i+1, whichPattern);\r\n if (off <= 1.0) off = 0.0;\r\n off *= patternScale;\r\n\r\n onPixel = false;\r\n phase -= off;\r\n if (phase < -radiusPixels)\r\n discard;\r\n if (phase <= 0.0)\r\n break;\r\n }\r\n\r\n\r\n\r\n\r\n if (!onPixel && (abs(phase) <= radiusPixels)) {\r\n segmentLength = 0.0;\r\n parametricDistance = phase / pixelsPerUnit;\r\n }\r\n }\r\n#endif\r\n\r\n\r\n\r\n\r\n float dist;\r\n float offsetLength2 = dot(fsOffsetDirection, fsOffsetDirection);\r\n\r\n\r\n\r\n\r\n float ltz = max(0.0, sign(-parametricDistance));\r\n float gtsl = max(0.0, sign(parametricDistance - segmentLength));\r\n float d = (ltz + gtsl) * (parametricDistance - gtsl * segmentLength);\r\n dist = sqrt(max(0.0, offsetLength2 + d*d));\r\n\r\n\r\n\r\n\r\n float range = dist - radius;\r\n\r\n if (range > aaRange) {\r\n discard;\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n gl_FragColor = fsColor;\r\n gl_FragColor.a *= curveGaussian(range+aaRange, pixelsPerUnit);\r\n}\r\n\r\n#ifdef HAS_CIRCLES\r\nvoid fillCircularArc() {\r\n\r\n float dist = length(fsOffsetDirection);\r\n vec2 angles = fsMultipurpose.xz;\r\n float radius = abs(fsMultipurpose.y);\r\n float range = abs(dist - radius);\r\n range -= fsHalfWidth;\r\n\r\n\r\n\r\n if (range > aaRange) {\r\n discard;\r\n }\r\n\r\n vec2 direction = fsOffsetDirection;\r\n float angle = atan(direction.y, direction.x);\r\n\r\n\r\n\r\n\r\n if (angles.x > angles.y) {\r\n\r\n if (angle > angles.x && angle < PI) {\r\n angle -= TAU;\r\n }\r\n angles.x -= TAU;\r\n\r\n\r\n\r\n if (angle < angles.x ) {\r\n angle += TAU;\r\n }\r\n }\r\n else if (angle < 0.0)\r\n angle += TAU;\r\n\r\n#ifdef LOADING_ANIMATION\r\n if ((angle - angles.x) / (angles.y - angles.x) > loadingProgress) {\r\n discard;\r\n }\r\n#endif\r\n\r\n\r\n if (angle > angles.x && angle < angles.y) {\r\n gl_FragColor = fsColor;\r\n gl_FragColor.a *= curveGaussian(range+aaRange, pixelsPerUnit);\r\n }\r\n else {\r\n discard;\r\n }\r\n\r\n}\r\n#endif\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n#ifdef HAS_ELLIPTICALS\r\n\r\n\r\n\r\n\r\n\r\n\r\nfloat EllipticalApprox(\r\n const int iters,\r\n inout float t0, inout float t1,\r\n const vec2 y, out vec2 x,\r\n const vec2 e, const vec2 ey, const vec2 esqr\r\n ) {\r\n vec2 r;\r\n for (int i = 0; i < 10; ++i) {\r\n if(i >= iters) break;\r\n\r\n float t = mix(t0, t1, 0.5);\r\n r = ey / (vec2(t) + esqr);\r\n\r\n vec2 rsq = r * r;\r\n float f = rsq.x + rsq.y - 1.0;\r\n\r\n if(f > 0.0) { t0 = t; } else { t1 = t; }\r\n }\r\n\r\n x = e * r;\r\n return distance(x, y);\r\n}\r\n\r\nfloat DistancePointEllipseSpecial (vec2 e, vec2 y, out vec2 x, float width, float aaRange) {\r\n float dist;\r\n\r\n\r\n vec2 esqr = e * e;\r\n vec2 ey = e * y;\r\n float t0 = -esqr[1] + ey[1];\r\n float t1 = -esqr[1] + length(ey);\r\n\r\n\r\n\r\n dist = EllipticalApprox(6, t0, t1, y, x, e, ey, esqr);\r\n\r\n\r\n if (dist > max(2.0 * (width + aaRange), e[0] * 0.05))\r\n return dist;\r\n\r\n\r\n dist = EllipticalApprox(6, t0, t1, y, x, e, ey, esqr);\r\n\r\n\r\n\r\n\r\n float ecc = 1.0 + 0.1 * e[0] / e[1];\r\n\r\n if (dist > max(ecc * (width + aaRange), e[0] * 0.001))\r\n return dist;\r\n if (dist < (width - aaRange) / ecc)\r\n return dist;\r\n\r\n\r\n\r\n\r\n dist = EllipticalApprox(10, t0, t1, y, x, e, ey, esqr);\r\n return dist;\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\nfloat DistancePointEllipse(vec2 e, vec2 y, out vec2 locX, float width, float aaRange) {\r\n vec2 locE, locY;\r\n\r\n\r\n\r\n\r\n float diff = sign(e[0] - e[1]);\r\n vec2 swizzle = vec2(max(diff, 0.0), -min(diff, 0.0));\r\n locE.x = dot(e, swizzle.xy);\r\n locE.y = dot(e, swizzle.yx);\r\n locY.x = dot(y, swizzle.xy);\r\n locY.y = dot(y, swizzle.yx);\r\n\r\n\r\n vec2 refl = sign(locY);\r\n locY *= refl;\r\n\r\n vec2 x;\r\n float distance = DistancePointEllipseSpecial(locE, locY, x, width, aaRange);\r\n\r\n x *= refl;\r\n\r\n locX.x = dot(x, swizzle.xy);\r\n locX.y = dot(x, swizzle.yx);\r\n\r\n return distance;\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\nvoid fillEllipticalArc() {\r\n vec2 angles = fsMultipurpose.xz;\r\n vec2 radii = abs(fsMultipurpose.yw);\r\n vec2 dir = fsOffsetDirection;\r\n\r\n\r\n\r\n\r\n vec2 pos;\r\n float range = DistancePointEllipse(radii, dir, pos, fsHalfWidth, aaRange);\r\n range -= fsHalfWidth;\r\n\r\n if (range > aaRange)\r\n discard;\r\n\r\n float ar = radii[0] / radii[1];\r\n\r\n\r\n\r\n\r\n float angle = atan(ar * pos.y, pos.x);\r\n\r\n\r\n\r\n\r\n if (angles.x > angles.y) {\r\n\r\n if (angle > angles.x && angle < PI) {\r\n angle -= TAU;\r\n }\r\n angles.x -= TAU;\r\n\r\n\r\n\r\n if (angle < angles.x ) {\r\n angle += TAU;\r\n }\r\n }\r\n else if (angle < 0.0)\r\n angle += TAU;\r\n\r\n#ifdef LOADING_ANIMATION\r\n if ((angle - angles.x) / (angles.y - angles.x) > loadingProgress) {\r\n discard;\r\n }\r\n#endif\r\n\r\n\r\n if (angle > angles.x && angle < angles.y) {\r\n gl_FragColor = fsColor;\r\n gl_FragColor.a *= curveGaussian(range+aaRange, pixelsPerUnit);\r\n }\r\n else {\r\n discard;\r\n }\r\n}\r\n#endif\r\n\r\n#ifdef HAS_RASTER_QUADS\r\n void fillTexQuad() {\r\n gl_FragColor = texture2D(tRaster, fsMultipurpose.xy);\r\n #ifdef LOADING_ANIMATION\r\n gl_FragColor.a *= loadingProgress;\r\n #endif\r\n }\r\n#endif\r\n\r\nvoid fillTriangle() {\r\n#ifdef IMAGE_UV_TEXTURE\r\n gl_FragColor = texture2D(tRaster, fract(vuv));\r\n#else\r\n gl_FragColor = fsColor;\r\n#endif\r\n\r\n#ifdef LOADING_ANIMATION\r\n gl_FragColor.a *= loadingProgress;\r\n#endif\r\n}\r\n\r\n#if NUM_CUTPLANES > 0\r\nvarying highp vec3 vWorldPosition;\r\n#endif\r\n\r\n#ifdef MSDF_TEXTURE_FONT\r\nvarying highp vec2 vuv;\r\nvarying float isMSDFQuards;\r\nuniform sampler2D tRaster;\r\nfloat median(float r, float g, float b) {\r\n return max(min(r, g), min(max(r, g), b));\r\n}\r\n\r\n#endif\r\n\r\n#include <cutplanes>\r\n\r\nvoid main() {\r\n\r\n\r\n\r\n\r\n\r\n if (fsColor == vec4(0.0)) {\r\n discard;\r\n }\r\n\r\n\r\n#ifdef VIEWPORT_CLIPPING\r\n if(vPosition.x < viewportBounds.x || vPosition.x > viewportBounds.z || vPosition.y < viewportBounds.y || vPosition.y > viewportBounds.w) {\r\n discard;\r\n }\r\n#endif\r\n\r\n#ifdef MSDF_TEXTURE_FONT\r\n vec4 msdfColor = texture2D(tRaster, vuv);\r\n float dist = median(msdfColor.r, msdfColor.g, msdfColor.b);\r\n\r\n\r\n float delta = mix(0.25, 0.5, 1.0 - fwidth(dist));\r\n\r\n float sigDist = dist - delta;\r\n float msdfAlpha = clamp(sigDist/fwidth(sigDist) + delta, 0.0, 1.0);\r\n\r\n msdfAlpha = smoothstep(0., 1., msdfAlpha);\r\n gl_FragColor.a = mix(msdfAlpha, 1., 1.-isMSDFQuards);\r\n if (gl_FragColor.a < 0.0001) discard;\r\n\r\n#endif\r\n\r\n\r\n if (fsHalfWidth == 0.0) {\r\n#ifdef HAS_RASTER_QUADS\r\n if (fsMultipurpose.z != 0.0)\r\n fillTexQuad();\r\n else\r\n#endif\r\n fillTriangle();\r\n }\r\n else if (fsMultipurpose.y < 0.0) {\r\n#ifdef HAS_CIRCLES\r\n#ifdef HAS_ELLIPTICALS\r\n if (abs(fsMultipurpose.y) == fsMultipurpose.w)\r\n#endif\r\n fillCircularArc();\r\n#endif\r\n#ifdef HAS_ELLIPTICALS\r\n#ifdef HAS_CIRCLES\r\n else\r\n#endif\r\n fillEllipticalArc();\r\n#endif\r\n }\r\n else\r\n fillLineSegment();\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n float writeId = 1.0;\r\n \r\n gl_FragColor.a *= opacity;\r\n\r\n if (gl_FragColor.a == 0.0) {\r\n discard;\r\n }\r\n\r\n\r\n\r\n\r\n if (fsGhosting != 0.0 || \r\n ((viewportId != 0.0) && (abs(fsVpTC.x * 255.0 + fsVpTC.y) >= 0.5 && abs(fsVpTC.x * 255.0 + fsVpTC.y - viewportId) >= 0.5))) {\r\n\r\n writeId = 0.0;\r\n\r\n\r\n\r\n gl_FragColor.a *= ((swap == 1.0) ? 0.21 : 0.1);\r\n }\r\n\r\n#ifndef SELECTION_RENDERER\r\n\r\n if (grayscale != 0.0) {\r\n const vec3 rgb2grey = vec3(0.299, 0.587, 0.114);\r\n float gray = dot(gl_FragColor.rgb, rgb2grey);\r\n gl_FragColor.rgb = vec3(gray);\r\n }\r\n#endif\r\n\r\n#if NUM_CUTPLANES > 0\r\n checkCutPlanes(vWorldPosition);\r\n#endif\r\n\r\n#ifdef MRT_NORMALS\r\n\r\n outNormal = vec4(0.0, 0.0, 0.0, 1.0);\r\n#endif\r\n\r\n#ifdef NO_ID_OUTPUT\r\n\r\n writeId = 0.0;\r\n#endif\r\n\r\n#include <id_frag>\r\n}\r\n"},71519:e=>{e.exports="\r\n\r\n#include <line_decl_common>\r\n\r\nattribute vec2 fields1;\r\nattribute vec4 fields2;\r\nattribute vec4 flags4b;\r\nattribute vec4 layerVp4b;\r\n\r\n#ifdef HAS_ELLIPTICALS\r\nattribute vec3 extraParams;\r\n#endif\r\n\r\n#ifdef USE_INSTANCING\r\nattribute vec4 instFlags4b;\r\n#endif\r\n\r\n#ifdef MSDF_TEXTURE_FONT\r\nvarying highp vec2 vuv;\r\nvarying float isMSDFQuards;\r\n#endif\r\n\r\n#ifdef IMAGE_UV_TEXTURE\r\nvarying highp vec2 vuv;\r\n#endif\r\n\r\n#ifdef VIEWPORT_CLIPPING\r\nvarying vec2 vPosition;\r\n#endif\r\n\r\nuniform mat4 mvpMatrix;\r\n\r\nuniform float pixelsPerUnit;\r\nuniform float aaRange;\r\nuniform float viewportId;\r\nuniform float swap;\r\n\r\n\r\n\r\n\r\n\r\n#ifdef HAS_LAYERS\r\nuniform sampler2D tLayerMask;\r\n#endif\r\n\r\n#ifdef SELECTION_RENDERER\r\nuniform sampler2D tSelectionTexture;\r\nuniform vec2 vSelTexSize;\r\n#endif\r\n\r\n#ifdef SELECTION_RENDERER\r\nuniform vec4 selectionColor;\r\n#endif\r\n\r\n#ifdef LOADING_ANIMATION\r\nuniform float meshAnimTime;\r\n#endif\r\n\r\n#if NUM_CUTPLANES > 0\r\nvarying vec3 vWorldPosition;\r\n#endif\r\n\r\nvarying vec4 dbId;\r\n\r\n#ifdef UNPACK_POSITIONS\r\nuniform sampler2D tIdColor;\r\nuniform vec2 vIdColorTexSize;\r\nuniform vec4 unpackXform;\r\nattribute vec2 uvIdColor;\r\nfloat unpackLineWeight(float w) {\r\n if (w > 0.5) {\r\n return - (w - 0.5) * 1024.0;\r\n } else {\r\n return w * max(unpackXform.x, unpackXform.y) * 2.0;\r\n }\r\n}\r\nvec4 getVertexColor() {\r\n float u = (uvIdColor.x + 0.5) / vIdColorTexSize.x;\r\n return texture2D(tIdColor, vec2(u, 0.5));\r\n}\r\nvec4 getDbId() {\r\n float u = (uvIdColor.y + 0.5) / vIdColorTexSize.x;\r\n vec4 normDbId = texture2D(tIdColor, vec2(u, 0.5));\r\n return normDbId * 255.0;\r\n}\r\n#else\r\nattribute vec4 color4b;\r\nattribute vec4 dbId4b;\r\nvec4 unpackXform;\r\nfloat unpackLineWeight(float w) {\r\n return w;\r\n}\r\nvec4 getVertexColor() {\r\n return color4b;\r\n}\r\nvec4 getDbId() {\r\n return dbId4b;\r\n}\r\n#endif\r\n\r\n\r\nvec2 centralVertex;\r\nvec2 offsetPosition;\r\n\r\nvec2 cos_sin(const float angle) { return vec2(cos(angle), sin(angle)); }\r\n\r\nvoid min_max(inout vec2 minPt, inout vec2 maxPt, const vec2 p) {\r\n minPt = min(minPt, p);\r\n maxPt = max(maxPt, p);\r\n}\r\n\r\n#if defined(USE_INSTANCING)\r\nfloat getVertexId() { return instFlags4b.x; }\r\n#else\r\nfloat getVertexId() { return flags4b.x; }\r\n#endif\r\n\r\nbool isStartVertex() { return (getVertexId() < VBB_SEG_END_RIGHT); }\r\nbool isLeftVertex() { float id = getVertexId(); return ((id == VBB_SEG_END_LEFT || id == VBB_SEG_START_LEFT)); }\r\n\r\nstruct SegmentData { float angle, distAlong, distTotal, lineWidthHalf, lineType; };\r\nvoid decodeSegmentData(out SegmentData seg) {\r\n seg.angle = fields2.x * TAU - PI;\r\n seg.distAlong = fields2.y * max(unpackXform.x, unpackXform.y);\r\n seg.distTotal = fields2.w;\r\n seg.lineWidthHalf = unpackLineWeight(fields2.z);\r\n seg.lineType = flags4b.z;\r\n}\r\n\r\nvoid strokeLineSegment() {\r\n SegmentData seg; decodeSegmentData(seg);\r\n\r\n float isStartCapVertex = isStartVertex() ? -1.0 : 1.0;\r\n float isLeftSide = isLeftVertex( ) ? 1.0 : -1.0;\r\n\r\n\r\n float angleTransverse = seg.angle + isLeftSide * HALF_PI;\r\n float lwAdjustment = fsHalfWidth + aaRange;\r\n vec2 transverseOffset = cos_sin(angleTransverse) * lwAdjustment;\r\n offsetPosition.xy += transverseOffset;\r\n\r\n\r\n\r\n\r\n float distanceFromStart = max(isStartCapVertex, 0.0) * seg.distAlong;\r\n vec2 along = distanceFromStart * cos_sin(seg.angle);\r\n offsetPosition.xy += along;\r\n centralVertex.xy += along;\r\n\r\n\r\n vec2 moveOffset = isStartCapVertex * isLeftSide * vec2(-transverseOffset.y, transverseOffset.x);\r\n offsetPosition.xy -= moveOffset;\r\n centralVertex.xy -= moveOffset;\r\n\r\n\r\n\r\n\r\n fsMultipurpose.x = (isStartCapVertex * lwAdjustment) + distanceFromStart;\r\n fsMultipurpose.y = seg.distAlong;\r\n fsMultipurpose.z = seg.distTotal;\r\n fsMultipurpose.w = seg.lineType;\r\n\r\n if (seg.lineWidthHalf < 0.0)\r\n fsHalfWidth = -fsHalfWidth;\r\n}\r\n\r\n\r\n#ifdef HAS_TRIANGLE_GEOMS\r\nstruct TriangleData { vec2 p0, p1, p2; };\r\nvoid decodeTriangleData(out TriangleData tri) {\r\n\r\n tri.p1 = vec2(fields2.x, fields2.y) * unpackXform.xy + unpackXform.zw;\r\n tri.p2 = fields2.zw * unpackXform.xy + unpackXform.zw;\r\n}\r\n\r\nvoid strokeOneTriangle() {\r\n TriangleData tri; decodeTriangleData(tri);\r\n\r\n\r\n\r\n\r\n\r\n\r\n fsHalfWidth = 0.0;\r\n fsMultipurpose.z = 0.0;\r\n\r\n\r\n\r\n\r\n\r\n float vertexId = getVertexId();\r\n if (vertexId == VBB_SEG_END_RIGHT)\r\n offsetPosition.xy = tri.p1;\r\n else if (vertexId == VBB_SEG_END_LEFT)\r\n offsetPosition.xy = tri.p2;\r\n}\r\n#endif\r\n\r\n\r\n\r\n\r\n#ifdef HAS_RASTER_QUADS\r\nstruct TexQuadData { float angle; vec2 size; };\r\nvoid decodeTexQuadData(out TexQuadData quad) {\r\n quad.angle = fields2.x * TAU;\r\n quad.size = fields2.yz * max(unpackXform.x, unpackXform.y);\r\n}\r\n\r\nvoid strokeTexQuad() {\r\n TexQuadData quad; decodeTexQuadData(quad);\r\n\r\n vec2 corner = vec2(isLeftVertex() ? -1.0 : 1.0, isStartVertex() ? -1.0 : 1.0);\r\n\r\n vec2 p = 0.5 * corner * quad.size;\r\n vec2 rot = cos_sin(quad.angle);\r\n vec2 offset = vec2(p.x * rot.x - p.y * rot.y, p.x * rot.y + p.y * rot.x);\r\n\r\n offsetPosition.xy += offset;\r\n\r\n fsMultipurpose.xy = max(vec2(0.0), corner);\r\n\r\n\r\n fsMultipurpose.z = 1.0;\r\n fsHalfWidth = 0.0;\r\n}\r\n#endif\r\n\r\n#if defined(HAS_CIRCLES) || defined(HAS_ELLIPTICALS)\r\nstruct ArcData { vec2 c; float start, end, major, minor, tilt; };\r\nvoid decodeArcData(out ArcData arc) {\r\n arc.c = fields1.xy * unpackXform.xy + unpackXform.zw;\r\n arc.start = fields2.x * TAU;\r\n arc.end = fields2.y * TAU;\r\n arc.major = fields2.w * max(unpackXform.x, unpackXform.y);\r\n#if defined(HAS_ELLIPTICALS)\r\n arc.minor = extraParams.x;\r\n arc.tilt = extraParams.y * TAU;\r\n#endif\r\n}\r\n\r\nvoid strokeArc(const ArcData arc) {\r\n\r\n\r\n float isStart = isStartVertex() ? -1.0 : 1.0;\r\n float isLeft = isLeftVertex() ? -1.0 : 1.0;\r\n\r\n\r\n\r\n\r\n vec2 minPt;\r\n vec2 maxPt;\r\n\r\n vec2 angles = vec2(arc.start, arc.end);\r\n vec2 endsX = vec2(arc.c.x) + arc.major * cos(angles);\r\n vec2 endsY = vec2(arc.c.y) + arc.minor * sin(angles);\r\n minPt = maxPt = vec2(endsX.x, endsY.x);\r\n min_max(minPt, maxPt, vec2(endsX.y, endsY.y));\r\n\r\n if (arc.end > arc.start) {\r\n if (arc.start < PI_0_5 && arc.end > PI_0_5) {\r\n min_max(minPt, maxPt, vec2(arc.c.x, arc.c.y + arc.minor));\r\n }\r\n if (arc.start < PI && arc.end > PI) {\r\n min_max(minPt, maxPt, vec2(arc.c.x - arc.major, arc.c.y));\r\n }\r\n if (arc.start < PI_1_5 && arc.end > PI_1_5) {\r\n min_max(minPt, maxPt, vec2(arc.c.x, arc.c.y - arc.minor));\r\n }\r\n } else {\r\n\r\n min_max(minPt, maxPt, vec2(arc.c.x + arc.major, arc.c.y));\r\n\r\n\r\n\r\n if (arc.start < PI_0_5 || arc.end > PI_0_5) {\r\n min_max(minPt, maxPt, vec2(arc.c.x, arc.c.y + arc.minor));\r\n }\r\n if (arc.start < PI || arc.end > PI) {\r\n min_max(minPt, maxPt, vec2(arc.c.x - arc.major, arc.c.y));\r\n }\r\n if (arc.start < PI_1_5 || arc.end > PI_1_5) {\r\n min_max(minPt, maxPt, vec2(arc.c.x, arc.c.y - arc.minor));\r\n }\r\n }\r\n\r\n minPt -= fsHalfWidth + aaRange;\r\n maxPt += fsHalfWidth + aaRange;\r\n\r\n offsetPosition.x = (isStart < 0.0) ? minPt.x : maxPt.x;\r\n offsetPosition.y = (isLeft < 0.0) ? minPt.y : maxPt.y;\r\n\r\n\r\n\r\n\r\n\r\n fsMultipurpose.x = arc.start;\r\n fsMultipurpose.y = -arc.major;\r\n fsMultipurpose.z = arc.end;\r\n fsMultipurpose.w = arc.minor;\r\n}\r\n#endif\r\n\r\n#if defined(HAS_CIRCLES)\r\n\r\nvoid strokeCircularArc() {\r\n ArcData arc; decodeArcData(arc);\r\n\r\n float r = arc.major;\r\n if (r * pixelsPerUnit < 0.125)\r\n r = 0.25 * aaRange;\r\n arc.major = arc.minor = r;\r\n\r\n strokeArc(arc);\r\n}\r\n\r\n#endif\r\n\r\n#if defined(HAS_ELLIPTICALS)\r\nvoid strokeEllipticalArc() {\r\n ArcData arc; decodeArcData(arc);\r\n strokeArc(arc);\r\n}\r\n#endif\r\n\r\nstruct CommonAttribs { vec2 pos; vec4 color; vec2 layerTC, vpTC; float lineWidthHalf, geomType, ghosting; };\r\nvoid decodeCommonAttribs(out CommonAttribs attribs) {\r\n attribs.pos = fields1.xy * unpackXform.xy + unpackXform.zw;\r\n attribs.color = getVertexColor();\r\n attribs.geomType = flags4b.y;\r\n attribs.layerTC = layerVp4b.xy / 255.0;\r\n attribs.vpTC = layerVp4b.zw / 255.0;\r\n attribs.lineWidthHalf = unpackLineWeight(fields2.z);\r\n attribs.ghosting = flags4b.w;\r\n}\r\n\r\nvoid strokeIndexedTriangle() {\r\n\r\n fsHalfWidth = 0.0;\r\n fsMultipurpose.z = 0.0;\r\n}\r\n\r\n#ifdef SELECTION_RENDERER\r\nbool isSelected(const CommonAttribs attribs) {\r\n\r\n\r\n vec3 oid = getDbId().rgb;\r\n\r\n\r\n float id01 = oid.r + oid.g * 256.0;\r\n float t = (id01 + 0.5) * (1.0 / 4096.0);\r\n float flrt = floor(t);\r\n float texU = t - flrt;\r\n\r\n\r\n float id23 = oid.b * (65536.0 / 4096.0) + flrt;\r\n t = (id23 + 0.5) / vSelTexSize.y;\r\n float texV = fract(t);\r\n\r\n vec4 selBit = texture2D(tSelectionTexture, vec2(texU, texV));\r\n return selBit.r == 1.0;\r\n}\r\n#endif\r\n\r\nbool isLayerOff(const CommonAttribs attribs) {\r\n#ifdef HAS_LAYERS\r\n vec4 layerBit = texture2D(tLayerMask, attribs.layerTC);\r\n return (layerBit.r == 0.0);\r\n#else\r\n return false;\r\n#endif\r\n}\r\n\r\nvec4 getColor(const CommonAttribs attribs) {\r\n\r\n if (isLayerOff(attribs)) { return vec4(0.0); }\r\n\r\n#ifdef SELECTION_RENDERER\r\n if (isSelected(attribs)) { return selectionColor; }\r\n return vec4(0.0);\r\n#else\r\n return attribs.color;\r\n#endif\r\n}\r\n\r\n#ifdef GAMMA_INPUT\r\nvec4 inputToLinear(vec4 c) {\r\n return vec4(vec3(c*c), c.a);\r\n}\r\n#endif\r\n\r\nvoid main() {\r\n#ifndef UNPACK_POSITIONS\r\n unpackXform = vec4(1.0, 1.0, 0.0, 0.0);\r\n#endif\r\n\r\n CommonAttribs attribs; decodeCommonAttribs(attribs);\r\n#ifdef MSDF_TEXTURE_FONT\r\n vuv = fields2.xy;\r\n isMSDFQuards = 1.0 - abs(sign(attribs.geomType - VBB_GT_MSDF_TRIANGLE_INDEXED));\r\n#endif\r\n\r\n#ifdef IMAGE_UV_TEXTURE\r\n vuv = fields2.xy;\r\n#endif\r\n\r\n fsColor = getColor(attribs);\r\n\r\n #ifdef GAMMA_INPUT\r\n fsColor = inputToLinear(fsColor);\r\n #endif\r\n\r\n\r\n if (swap != 0.0 ) {\r\n\r\n if ( fsColor.r == 0.0 && fsColor.g == 0.0 && fsColor.b == 0.0 )\r\n fsColor.rgb = vec3(1.0,1.0,1.0);\r\n\r\n else if ( fsColor.r == 1.0 && fsColor.g == 1.0 && fsColor.b == 1.0 )\r\n fsColor.rgb = vec3(0.0,0.0,0.0);\r\n }\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n centralVertex = offsetPosition = attribs.pos;\r\n\r\n float lineWeight = attribs.lineWidthHalf;\r\n if (lineWeight > 0.0) {\r\n\r\n\r\n if(lineWeight < 0.5 / pixelsPerUnit) {\r\n lineWeight = 0.5 / pixelsPerUnit;\r\n }\r\n }\r\n else {\r\n\r\n\r\n lineWeight = abs(lineWeight) / pixelsPerUnit;\r\n }\r\n\r\n fsHalfWidth = lineWeight;\r\n\r\n dbId = getDbId() / 255.0;\r\n\r\n fsVpTC = attribs.vpTC;\r\n fsGhosting = attribs.ghosting;\r\n\r\n if (attribs.geomType == VBB_GT_LINE_SEGMENT || attribs.geomType == VBB_GT_LINE_SEGMENT_CAPPED || attribs.geomType == VBB_GT_LINE_SEGMENT_CAPPED_START || attribs.geomType == VBB_GT_LINE_SEGMENT_CAPPED_END || attribs.geomType == VBB_GT_LINE_SEGMENT_MITER) strokeLineSegment();\r\n#ifdef HAS_CIRCLES\r\n else if (attribs.geomType == VBB_GT_ARC_CIRCULAR) strokeCircularArc();\r\n#endif\r\n#ifdef HAS_ELLIPTICALS\r\n else if (attribs.geomType == VBB_GT_ARC_ELLIPTICAL) strokeEllipticalArc();\r\n#endif\r\n#ifdef HAS_RASTER_QUADS\r\n else if (attribs.geomType == VBB_GT_TEX_QUAD) strokeTexQuad();\r\n#endif\r\n#ifdef HAS_TRIANGLE_GEOMS\r\n else if (attribs.geomType == VBB_GT_ONE_TRIANGLE) strokeOneTriangle();\r\n#endif\r\n else if (attribs.geomType == VBB_GT_TRIANGLE_INDEXED) strokeIndexedTriangle();\r\n\r\n\r\n\r\n fsOffsetDirection = offsetPosition - centralVertex;\r\n\r\n\r\n gl_Position = mvpMatrix * modelMatrix * vec4( offsetPosition.xy, 0.0, 1.0 );\r\n\r\n#ifdef LOADING_ANIMATION\r\n\r\n if (dbId.rgb == vec3(1.0)) {\r\n loadingProgress = 1.0;\r\n } else {\r\n loadingProgress = smoothstep(0.0, 1.0, meshAnimTime);\r\n }\r\n#endif\r\n\r\n#ifdef IMAGE_UV_TEXTURE\r\n fsHalfWidth = 0.0;\r\n#endif\r\n\r\n\r\n#if NUM_CUTPLANES > 0\r\n vec4 worldPosition = modelMatrix * vec4( offsetPosition.xy, 0.0, 1.0 );\r\n vWorldPosition = worldPosition.xyz;\r\n#endif\r\n\r\n#ifdef VIEWPORT_CLIPPING\r\n vPosition = offsetPosition.xy;\r\n#endif\r\n}\r\n"},59191:e=>{e.exports="\n#define LINE_SS\n#include <line_decl_common>\n#include <id_decl_frag>\nuniform highp float aaRange;\nuniform float opacity;\nuniform highp float viewportId;\nuniform highp float swap;\nuniform highp float grayscale;\n#ifdef HAS_LINESTYLES\nuniform sampler2D tLineStyle;\nuniform vec2 vLineStyleTexSize;\nvarying highp float vPixelsPerUnit;\n#endif\n#ifdef VIEWPORT_CLIPPING\nuniform highp vec4 viewportBounds;\nvarying highp vec2 vPosition;\nuniform mat4 mvpMatrix;\nuniform mat4 modelMatrix;\n#endif\nfloat curveGaussian(float r, float width) {\n float amt = clamp(abs(r / (width * 1.0)), 0.0, 1.0);\n amt = max(amt - 0.0, 0.0);\n float exponent = amt * 2.0;\n return clamp(exp(-exponent*exponent), 0.0, 1.0);\n}\n#ifdef HAS_LINESTYLES\nfloat getLinePatternPixel(int i, int j) {\n return texture2D(tLineStyle, (vec2(i, j) + 0.5) / vLineStyleTexSize).x * 255.0;\n}\nfloat getPatternLength(int whichPattern) {\n float p1 = getLinePatternPixel(0, whichPattern);\n float p2 = getLinePatternPixel(1, whichPattern);\n return (p2 * 256.0 + p1);\n}\n#endif\nvoid fillLineSegment() {\n float radius = abs(fsHalfWidth);\n float parametricDistance = fsMultipurpose.x;\n float segmentLength = fsMultipurpose.y;\n float totalDistance = fsMultipurpose.z;\n#ifdef LOADING_ANIMATION\n float distFromStart = parametricDistance / segmentLength;\n if (loadingProgress < 1.0 && distFromStart > loadingProgress) {\n discard;\n }\n#endif\n#ifdef HAS_LINESTYLES\n int whichPattern = int(fsMultipurpose.w);\n if (whichPattern > 0) {\n const float TEX_TO_UNIT = 1.0 / 96.0;\n float patternScale;\n if (fsHalfWidth < 0.0) {\n patternScale = LTSCALE;\n } else {\n patternScale = LTSCALE * TEX_TO_UNIT * vPixelsPerUnit;\n }\n float patLen = patternScale * getPatternLength(whichPattern);\n float phase = mod((totalDistance + parametricDistance), patLen);\n bool onPixel = true;\n float radiusPixels = radius + aaRange;\n for (int i=2; i<MAX_LINESTYLE_LENGTH; i+=2) {\n float on = getLinePatternPixel(i, whichPattern);\n if (on == 1.0) on = 0.0;\n on *= patternScale;\n onPixel = true;\n phase -= on;\n if (phase < 0.0) {\n break;\n }\n else if (phase <= radiusPixels) {\n onPixel = false;\n break;\n }\n float off = getLinePatternPixel(i+1, whichPattern);\n if (off <= 1.0) off = 0.0;\n off *= patternScale;\n onPixel = false;\n phase -= off;\n if (phase < -radiusPixels)\n discard;\n if (phase <= 0.0)\n break;\n }\n if (!onPixel && (abs(phase) <= radiusPixels)) {\n segmentLength = 0.0;\n parametricDistance = phase;\n }\n }\n#endif\n float dist;\n float offsetLength2 = dot(fsOffsetDirection, fsOffsetDirection);\n float ltz = max(0.0, sign(-parametricDistance));\n float gtsl = max(0.0, sign(parametricDistance - segmentLength));\n float d = (ltz + gtsl) * (parametricDistance - gtsl * segmentLength);\n dist = sqrt(max(0.0, offsetLength2 + d*d));\n float range = dist - radius;\n if (range > aaRange) {\n discard;\n }\n gl_FragColor = fsColor;\n if (range > -aaRange)\n gl_FragColor.a *= curveGaussian(range+aaRange, aaRange * 2.0);\n}\n#ifdef LOADING_ANIMATION\n void fillTriangle() { gl_FragColor = vec4(fsColor.rgb, fsColor.a * loadingProgress); }\n#else\n void fillTriangle() { gl_FragColor = fsColor; }\n#endif\n#if NUM_CUTPLANES > 0\nvarying highp vec3 vWorldPosition;\n#endif\n#include <cutplanes>\nfloat getSide(vec2 a, vec2 b, vec2 c) {\n return sign((b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x));\n}\nvoid main() {\n if (fsColor == vec4(0.0)) {\n discard;\n }\n#ifdef VIEWPORT_CLIPPING\n vec2 bottomLeft = (mvpMatrix * modelMatrix * vec4(viewportBounds.xy, 0., 1.)).xy;\n vec2 bottomRight = (mvpMatrix * modelMatrix * vec4(viewportBounds.zy, 0., 1.)).xy;\n vec2 topRight = (mvpMatrix * modelMatrix * vec4(viewportBounds.zw, 0., 1.)).xy;\n vec2 topLeft = (mvpMatrix * modelMatrix * vec4(viewportBounds.xw, 0., 1.)).xy;\n float side = getSide(topLeft, topRight, bottomLeft);\n if (side * getSide(topRight, bottomRight, vPosition) < 0.0 ||\n side * getSide(bottomRight, bottomLeft, vPosition) < 0.0 ||\n side * getSide(bottomLeft, topLeft, vPosition) < 0.0 ||\n side * getSide(topLeft, topRight, vPosition) < 0.0) {\n discard;\n }\n#endif\n if (fsHalfWidth == 0.0) {\n fillTriangle();\n }\n else\n fillLineSegment();\n float writeId = 1.0;\n gl_FragColor.a *= opacity;\n if (gl_FragColor.a == 0.0) {\n discard;\n }\n if (fsGhosting != 0.0 || \n ((viewportId != 0.0) && (abs(fsVpTC.x * 255.0 + fsVpTC.y) >= 0.5 && abs(fsVpTC.x * 255.0 + fsVpTC.y - viewportId) >= 0.5))) {\n writeId = 0.0;\n gl_FragColor.a *= ((swap == 1.0) ? 0.21 : 0.1);\n }\n#ifndef SELECTION_RENDERER\n if (grayscale != 0.0) {\n const vec3 rgb2grey = vec3(0.299, 0.587, 0.114);\n float gray = dot(gl_FragColor.rgb, rgb2grey);\n gl_FragColor.rgb = vec3(gray);\n }\n#endif\n#if NUM_CUTPLANES > 0\n checkCutPlanes(vWorldPosition);\n#endif\n#ifdef MRT_NORMALS\n outNormal = vec4(0.0, 0.0, 0.0, 1.0);\n#endif\n#ifdef NO_ID_OUTPUT\n writeId = 0.0;\n#endif\n#include <id_frag>\n}\n"},84325:e=>{e.exports="\n#include <line_decl_common>\nattribute vec2 fields1;\nattribute vec4 fields2;\nattribute vec4 flags4b;\nattribute vec4 layerVp4b;\n#ifdef HAS_MITER_LINES\nattribute vec3 extraParams;\nuniform float miterLimit;\nuniform float miterScaleFactor;\nuniform float miterCP;\n#endif\n#ifdef USE_INSTANCING\nattribute vec4 instFlags4b;\n#endif\n#ifdef VIEWPORT_CLIPPING\nvarying vec2 vPosition;\n#endif\nuniform mat4 mvpMatrix;\nuniform float pixelsPerUnit;\nuniform float aaRange;\nuniform vec2 size;\nuniform float viewportId;\nuniform float swap;\nuniform vec3 cameraPos;\nuniform float tanHalfFov;\n#ifdef HAS_LINESTYLES\nvarying float vPixelsPerUnit;\n#endif\n#ifdef HAS_LAYERS\nuniform sampler2D tLayerMask;\n#endif\n#ifdef SELECTION_RENDERER\nuniform sampler2D tSelectionTexture;\nuniform vec2 vSelTexSize;\n#endif\n#ifdef SELECTION_RENDERER\nuniform vec4 selectionColor;\n#endif\n#ifdef LOADING_ANIMATION\nuniform float meshAnimTime;\n#endif\n#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\nvarying vec4 dbId;\n#ifdef UNPACK_POSITIONS\nuniform sampler2D tIdColor;\nuniform vec2 vIdColorTexSize;\nuniform vec4 unpackXform;\nattribute vec2 uvIdColor;\nfloat unpackLineWeight(float w) {\n if (w > 0.5) {\n return - (w - 0.5) * 1024.0;\n } else {\n return w * max(unpackXform.x, unpackXform.y) * 2.0;\n }\n}\nvec4 getVertexColor() {\n float u = (uvIdColor.x + 0.5) / vIdColorTexSize.x;\n return texture2D(tIdColor, vec2(u, 0.5));\n}\nvec4 getDbId() {\n float u = (uvIdColor.y + 0.5) / vIdColorTexSize.x;\n vec4 normDbId = texture2D(tIdColor, vec2(u, 0.5));\n return normDbId * 255.0;\n}\n#else\nattribute vec4 color4b;\nattribute vec4 dbId4b;\nvec4 unpackXform;\nfloat unpackLineWeight(float w) {\n return w;\n}\nvec4 getVertexColor() {\n return color4b;\n}\nvec4 getDbId() {\n return dbId4b;\n}\n#endif\nvec2 centralVertex;\nvec2 offsetPosition;\nvec2 offsetPosDepth;\nvec2 cos_sin(const float angle) { return vec2(cos(angle), sin(angle)); }\nvoid min_max(inout vec2 minPt, inout vec2 maxPt, const vec2 p) {\n minPt = min(minPt, p);\n maxPt = max(maxPt, p);\n}\n#if defined(USE_INSTANCING)\nfloat getVertexId() { return instFlags4b.x; }\n#else\nfloat getVertexId() { return flags4b.x; }\n#endif\nbool isStartVertex() { return (getVertexId() < VBB_SEG_END_RIGHT); }\nbool isLeftVertex() { float id = getVertexId(); return ((id == VBB_SEG_END_LEFT || id == VBB_SEG_START_LEFT)); }\nstruct SegmentData { float angle, distAlong, distTotal, lineWidthHalf, lineType; };\nvoid decodeSegmentData(out SegmentData seg) {\n seg.angle = fields2.x * TAU - PI;\n seg.distAlong = fields2.y * max(unpackXform.x, unpackXform.y);\n seg.distTotal = fields2.w;\n seg.lineWidthHalf = unpackLineWeight(fields2.z);\n seg.lineType = flags4b.z;\n}\nvoid strokeLineSegment(float geomType) {\n SegmentData seg; decodeSegmentData(seg);\n float isStartCapVertex = isStartVertex() ? -1.0 : 1.0;\n float isLeftSide = isLeftVertex( ) ? 1.0 : -1.0;\n vec4 startPosition = (mvpMatrix * modelMatrix * vec4(centralVertex.xy, 0.0, 1.0));\n float distanceAlong = seg.distAlong;\n vec2 along = distanceAlong * cos_sin(seg.angle);\n vec4 endPosition = (mvpMatrix * modelMatrix * vec4(centralVertex.xy + along, 0.0, 1.0));\n vec2 screenStart = startPosition.xy * 0.5 * size / startPosition.w;\n vec2 screenEnd = endPosition.xy * 0.5 * size / endPosition.w;\n float roundedEnd = 0.0;\n if (isStartCapVertex < 0.0) {\n offsetPosition = centralVertex = screenStart;\n offsetPosDepth = startPosition.zw;\n roundedEnd = (geomType == VBB_GT_LINE_SEGMENT || geomType == VBB_GT_LINE_SEGMENT_CAPPED_END) ? 1.0 : 0.0;\n } else {\n offsetPosition = centralVertex = screenEnd;\n offsetPosDepth = endPosition.zw;\n roundedEnd = (geomType == VBB_GT_LINE_SEGMENT || geomType == VBB_GT_LINE_SEGMENT_CAPPED_START) ? 1.0 : 0.0;\n }\n vec2 screenDelta = screenEnd - screenStart;\n float screenAngle = (distanceAlong == 0.0) ? 0.0 : atan(screenDelta.y, screenDelta.x);\n float angleTransverse = screenAngle - isLeftSide * HALF_PI;\n float lwAdjustment = fsHalfWidth + aaRange;\n vec2 transverseOffset = cos_sin(angleTransverse) * lwAdjustment;\n offsetPosition += transverseOffset;\n float distanceFromStart = max(0.0, isStartCapVertex) * length(screenDelta);\n if (roundedEnd > 0.0) {\n vec2 moveOffset = isStartCapVertex * isLeftSide * vec2(-transverseOffset.y, transverseOffset.x);\n offsetPosition += moveOffset;\n centralVertex += moveOffset;\n fsMultipurpose.x = (isStartCapVertex * lwAdjustment) + distanceFromStart;\n }\n else {\n fsMultipurpose.x = distanceFromStart;\n }\n fsMultipurpose.y = length(screenDelta);\n fsMultipurpose.z = seg.distTotal;\n fsMultipurpose.w = seg.lineType;\n if (seg.lineWidthHalf < 0.0)\n fsHalfWidth = -fsHalfWidth;\n fsOffsetDirection = offsetPosition - centralVertex;\n gl_Position = vec4(2.0 * offsetPosition / size * offsetPosDepth.y, offsetPosDepth.xy);\n}\n#ifdef HAS_MITER_LINES\nstruct MiterSegmentData { float angle, distAlong, distAlongPN, anglePrev, angleNext, lineWidthHalf, lineType; };\nvoid decodeMiterSegment(out MiterSegmentData seg) {\n seg.angle = fields2.x * TAU - PI;\n seg.distAlong = fields2.y * max(unpackXform.x, unpackXform.y);\n seg.anglePrev = fields2.w * TAU - PI;\n seg.lineWidthHalf = unpackLineWeight(fields2.z);\n seg.lineType = flags4b.z;\n seg.angleNext = extraParams.x * TAU - PI;\n seg.distAlongPN = extraParams.y * max(unpackXform.x, unpackXform.y);\n}\nvoid strokeMiterLineSegment() {\n MiterSegmentData seg; decodeMiterSegment(seg);\n float isStartCapVertex = isStartVertex() ? -1.0 : 1.0;\n float isLeftSide = isLeftVertex( ) ? 1.0 : -1.0;\n float next = floor(seg.distAlongPN / miterCP);\n float prev = seg.distAlongPN - (next * miterCP);\n float distanceAlongNext = floor(next) / miterScaleFactor;\n float distanceAlongPrev = floor(prev) / miterScaleFactor;\n float distanceAlong = seg.distAlong;\n vec2 along = cos_sin(seg.anglePrev) * distanceAlongPrev;\n vec2 along2 = cos_sin(seg.angle) * distanceAlong;\n vec2 along3 = along2 + cos_sin(seg.angleNext) * distanceAlongNext;\n vec4 prevPosition = (mvpMatrix * modelMatrix * vec4(centralVertex.xy - along , 0.0, 1.0));\n vec4 startPosition = (mvpMatrix * modelMatrix * vec4(centralVertex.xy , 0.0, 1.0));\n vec4 endPosition = (mvpMatrix * modelMatrix * vec4(centralVertex.xy + along2, 0.0, 1.0));\n vec4 nextPosition = (mvpMatrix * modelMatrix * vec4(centralVertex.xy + along3, 0.0, 1.0));\n vec2 screenPrev = prevPosition.xy * 0.5 * size / prevPosition.w;\n vec2 screenStart = startPosition.xy * 0.5 * size / startPosition.w;\n vec2 screenEnd = endPosition.xy * 0.5 * size / endPosition.w;\n vec2 screenNext = nextPosition.xy * 0.5 * size / nextPosition.w;\n if (isStartCapVertex < 0.0) {\n offsetPosition = centralVertex = screenStart;\n offsetPosDepth = startPosition.zw;\n } else {\n offsetPosition = centralVertex = screenEnd;\n offsetPosDepth = endPosition.zw;\n }\n vec2 screenDelta = screenEnd - screenStart;\n vec2 AB = normalize(screenStart.xy - screenPrev.xy);\n vec2 BC = normalize(screenDelta);\n vec2 CD = normalize(screenNext.xy - screenEnd.xy);\n vec2 a = screenPrev;\n vec2 b = screenStart;\n vec2 c = screenEnd;\n vec2 d = screenNext;\n vec2 p = (isStartCapVertex < 0.0) ? a : d;\n vec2 a2 = (isStartCapVertex < 0.0) ? a : c;\n vec2 b2 = (isStartCapVertex < 0.0) ? b : d;\n vec2 p2 = (isStartCapVertex < 0.0) ? c : b;\n vec2 PP = (isStartCapVertex < 0.0) ? AB : CD;\n vec2 normalBC = vec2(-BC.y, BC.x);\n vec2 normalPP = vec2(-PP.y, PP.x);\n float pIsLeftOfBC = ((c.x - b.x)*(p.y - b.y) - (c.y - b.y)*(p.x - b.x)) > 0.0 ? 1.0 : -1.0;\n vec2 bN = b + normalBC * fsHalfWidth * pIsLeftOfBC;\n vec2 cN = c + normalBC * fsHalfWidth * pIsLeftOfBC;\n vec2 pN = p + normalPP * fsHalfWidth * pIsLeftOfBC;\n float isPIntersecting = ((cN.x - bN.x)*(pN.y - bN.y) - (cN.y - bN.y)*(pN.x - bN.x)) * pIsLeftOfBC;\n float p2IsLeftOfPP = ((b2.x - a2.x)*(p2.y - a2.y) - (b2.y - a2.y)*(p2.x - a2.x)) > 0.0 ? 1.0 : -1.0;\n vec2 a2N = a2 + normalPP * fsHalfWidth * p2IsLeftOfPP;\n vec2 b2N = b2 + normalPP * fsHalfWidth * p2IsLeftOfPP;\n vec2 p2N = p2 + normalBC * fsHalfWidth * p2IsLeftOfPP;\n float isP2Intersecting = ((b2N.x - a2N.x)*(p2N.y - a2N.y) - (b2N.y - a2N.y)*(p2N.x - a2N.x)) * p2IsLeftOfPP;\n float tangentLength = (isStartCapVertex < 0.0) ? length(AB + BC) : length(BC + CD);\n vec2 tangent = (isStartCapVertex < 0.0) ? normalize(AB + BC) : normalize(BC + CD);\n vec2 miter = vec2(-tangent.y, tangent.x);\n vec2 normal = (isStartCapVertex < 0.0) ? vec2(-AB.y, AB.x) : vec2(-BC.y, BC.x);\n float miterLength = abs(1.0 / dot(miter, normal));\n vec2 moveOffset;\n float lwAdjustment = fsHalfWidth + aaRange;\n if (miterLength > miterLimit || min(isPIntersecting, isP2Intersecting) < 0.0) {\n moveOffset = isLeftSide * lwAdjustment * normalBC;\n } else {\n moveOffset = isLeftSide * miter * lwAdjustment * miterLength;\n }\n offsetPosition += moveOffset;\n float distanceFromStart = max(0.0, isStartCapVertex) * (length(screenDelta) + dot(moveOffset, BC));\n fsMultipurpose.x = distanceFromStart;\n fsMultipurpose.y = length(screenDelta) + dot(moveOffset, BC);\n fsMultipurpose.z = 0.0;\n fsMultipurpose.w = seg.lineType;\n if (seg.lineWidthHalf < 0.0)\n fsHalfWidth = -fsHalfWidth;\n fsOffsetDirection = offsetPosition - BC * dot(moveOffset, BC) - centralVertex;\n gl_Position = vec4(2.0 * offsetPosition / size * offsetPosDepth.y, offsetPosDepth.xy);\n}\n#endif\nstruct CommonAttribs { vec2 pos; vec4 color; vec2 layerTC, vpTC; float lineWidthHalf, geomType, ghosting; };\nvoid decodeCommonAttribs(out CommonAttribs attribs) {\n attribs.pos = fields1.xy * unpackXform.xy + unpackXform.zw;\n attribs.color = getVertexColor();\n attribs.geomType = flags4b.y;\n attribs.layerTC = layerVp4b.xy / 255.0;\n attribs.vpTC = layerVp4b.zw / 255.0;\n attribs.lineWidthHalf = unpackLineWeight(fields2.z);\n attribs.ghosting = flags4b.w;\n}\nvoid strokeIndexedTriangle() {\n fsHalfWidth = 0.0;\n fsMultipurpose.z = 0.0;\n gl_Position = (mvpMatrix * modelMatrix * vec4(centralVertex.xy, 0.0, 1.0));\n}\n#ifdef SELECTION_RENDERER\nbool isSelected(const CommonAttribs attribs) {\n vec3 oid = getDbId().rgb;\n float id01 = oid.r + oid.g * 256.0;\n float t = (id01 + 0.5) * (1.0 / 4096.0);\n float flrt = floor(t);\n float texU = t - flrt;\n float id23 = oid.b * (65536.0 / 4096.0) + flrt;\n t = (id23 + 0.5) / vSelTexSize.y;\n float texV = fract(t);\n vec4 selBit = texture2D(tSelectionTexture, vec2(texU, texV));\n return selBit.r == 1.0;\n}\n#endif\nbool isLayerOff(const CommonAttribs attribs) {\n#ifdef HAS_LAYERS\n vec4 layerBit = texture2D(tLayerMask, attribs.layerTC);\n return (layerBit.r == 0.0);\n#else\n return false;\n#endif\n}\nvec4 getColor(const CommonAttribs attribs) {\n if (isLayerOff(attribs)) { return vec4(0.0); }\n#ifdef SELECTION_RENDERER\n if (isSelected(attribs)) { return selectionColor; }\n return vec4(0.0);\n#else\n return attribs.color;\n#endif\n}\n#ifdef GAMMA_INPUT\nvec4 inputToLinear(vec4 c) {\n return vec4(vec3(c*c), c.a);\n}\n#endif\nvoid main() {\n#ifndef UNPACK_POSITIONS\n unpackXform = vec4(1.0, 1.0, 0.0, 0.0);\n#endif\n CommonAttribs attribs; decodeCommonAttribs(attribs);\n fsColor = getColor(attribs);\n #ifdef GAMMA_INPUT\n fsColor = inputToLinear(fsColor);\n #endif\n if (swap != 0.0 ) {\n if ( fsColor.r == 0.0 && fsColor.g == 0.0 && fsColor.b == 0.0 )\n fsColor.rgb = vec3(1.0,1.0,1.0);\n else if ( fsColor.r == 1.0 && fsColor.g == 1.0 && fsColor.b == 1.0 )\n fsColor.rgb = vec3(0.0,0.0,0.0);\n }\n centralVertex = offsetPosition = attribs.pos;\n float lineWeight = attribs.lineWidthHalf;\n float ppu = pixelsPerUnit;\n if (tanHalfFov > 0.0) {\n vec4 worldPos = modelMatrix * vec4(offsetPosition.xy, 0.0, 1.0);\n float distanceToCamera = length(cameraPos - worldPos.xyz);\n ppu = size.y / (2.0 * distanceToCamera * tanHalfFov);\n }\n#ifdef HAS_LINESTYLES\n vPixelsPerUnit = ppu;\n#endif\n if (lineWeight > 0.0) {\n lineWeight = max(0.5, lineWeight * ppu);\n }\n else {\n lineWeight = max(0.5, abs(lineWeight));\n }\n fsHalfWidth = lineWeight;\n dbId = dbId4b / 255.0;\n fsVpTC = attribs.vpTC;\n fsGhosting = attribs.ghosting;\n#ifdef LOADING_ANIMATION\n if (dbId.rgb == vec3(1.0)) {\n loadingProgress = 1.0;\n } else {\n loadingProgress = smoothstep(0.0, 1.0, meshAnimTime);\n }\n#endif\n if (attribs.geomType == VBB_GT_LINE_SEGMENT || attribs.geomType == VBB_GT_LINE_SEGMENT_CAPPED || attribs.geomType == VBB_GT_LINE_SEGMENT_CAPPED_START || attribs.geomType == VBB_GT_LINE_SEGMENT_CAPPED_END) strokeLineSegment(attribs.geomType);\n#ifdef HAS_MITER_LINES\n else if (attribs.geomType == VBB_GT_LINE_SEGMENT_MITER) strokeMiterLineSegment();\n#endif\n else strokeIndexedTriangle();\n#if NUM_CUTPLANES > 0\n vec4 worldPosition = modelMatrix * vec4( offsetPosition.xy, 0.0, 1.0 );\n vWorldPosition = worldPosition.xyz;\n#endif\n#ifdef VIEWPORT_CLIPPING\n vPosition = gl_Position.xy;\n#endif\n}\n"},74957:e=>{e.exports="varying highp vec3 vNormal;\nvarying highp float depth;\n#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\n#include <cutplanes>\nvoid main() {\n#if NUM_CUTPLANES > 0\n checkCutPlanes(vWorldPosition);\n#endif\n vec3 n = vNormal;\n n = n * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n n = normalize( n );\n gl_FragColor = vec4(n.x, n.y, depth, 1.0);\n}\n"},5030:e=>{e.exports="varying vec3 vNormal;\nvarying float depth;\n#if NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\n#include <pack_normals>\n#include <instancing_decl_vert>\nvoid main() {\n#ifdef UNPACK_NORMALS\n vec3 objectNormal = decodeNormal(normal);\n#else\n vec3 objectNormal = normal;\n#endif\n#ifdef FLIP_SIDED\n objectNormal = -objectNormal;\n#endif\n objectNormal = getInstanceNormal(objectNormal);\n vec3 instPos = getInstancePos(position);\n vec3 transformedNormal = normalMatrix * objectNormal;\n vNormal = normalize( transformedNormal );\n#if NUM_CUTPLANES > 0\n vec4 worldPosition = modelMatrix * vec4( instPos, 1.0 );\n vWorldPosition = worldPosition.xyz;\n#endif\n vec4 mvPosition = modelViewMatrix * vec4( instPos, 1.0 );\n depth = mvPosition.z;\n vec4 p_Position = projectionMatrix * mvPosition;\n gl_Position = p_Position;\n}\n"},83039:e=>{e.exports="uniform vec3 diffuse;\r\nuniform float opacity;\r\n\r\nuniform vec3 emissive;\r\nuniform vec3 specular;\r\nuniform float shininess;\r\n\r\n#include <env_sample>\r\n\r\n#ifdef USE_COLOR\r\nvarying vec3 vColor;\r\n#endif\r\n\r\n#ifdef GAMMA_INPUT\r\nvec3 InputToLinear(vec3 c) {\r\n return c * c;\r\n}\r\nfloat InputToLinear(float c) {\r\n return c * c;\r\n}\r\n#else\r\nvec3 InputToLinear(vec3 c) {\r\n return c;\r\n}\r\nfloat InputToLinear(float c) {\r\n return c;\r\n}\r\n#endif\r\n\r\n#if defined( USE_MAP ) || defined( USE_SPECULARMAP )\r\nvarying vec2 vUv;\r\n#endif\r\n\r\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\nvarying vec2 vUvBump;\r\n#endif\r\n\r\n#if defined( USE_ALPHAMAP )\r\nvarying vec2 vUvAlpha;\r\n#endif\r\n\r\n#ifdef USE_MAP\r\nuniform sampler2D map;\r\n#endif\r\n\r\n#if TONEMAP_OUTPUT > 0\r\nuniform float exposureBias;\r\n#include <tonemap>\r\n#endif\r\n\r\n#if defined(IRR_RGBM) || defined(ENV_RGBM) || defined(ENV_GAMMA) || defined(IRR_GAMMA)\r\nuniform float envMapExposure;\r\n#endif\r\n\r\n#ifdef USE_FOG\r\nuniform vec3 fogColor;\r\nuniform float fogNear;\r\nuniform float fogFar;\r\n#endif\r\n#include <id_decl_frag>\r\n#include <theming_decl_frag>\r\n#include <shadowmap_decl_frag>\r\n\r\n#ifdef USE_ENVMAP\r\n\r\nuniform float reflMipIndex;\r\n\r\nuniform float reflectivity;\r\nuniform samplerCube envMap;\r\n\r\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\nuniform float refractionRatio;\r\n\r\n#endif\r\n\r\nvec3 sampleReflection(vec3 dir, float mipIndex) {\r\n\r\n vec3 adjDir = adjustLookupVector(dir);\r\n\r\n#ifdef ENV_GAMMA\r\n\r\n#ifdef HAVE_TEXTURE_LOD\r\n vec4 envTexColor = textureCubeLodEXT( envMap, adjDir, mipIndex );\r\n#else\r\n\r\n\r\n vec4 envTexColor = textureCube( envMap, adjDir, mipIndex );\r\n#endif\r\n\r\n return GammaDecode(envTexColor, envMapExposure);\r\n\r\n#elif defined(ENV_RGBM)\r\n\r\n#ifdef HAVE_TEXTURE_LOD\r\n vec4 envTexColor = textureCubeLodEXT( envMap, adjDir, mipIndex );\r\n#else\r\n\r\n\r\n vec4 envTexColor = textureCube( envMap, adjDir, mipIndex );\r\n#endif\r\n\r\n return RGBMDecode(envTexColor, envMapExposure);\r\n\r\n#else\r\n\r\n\r\n\r\n vec4 envTexColor = textureCube( envMap, adjDir );\r\n vec3 cubeColor = envTexColor.xyz;\r\n\r\n#ifdef GAMMA_INPUT\r\n cubeColor *= cubeColor;\r\n#endif\r\n\r\n return cubeColor;\r\n\r\n#endif\r\n\r\n}\r\n\r\n#endif\r\n\r\n\r\nuniform vec3 ambientLightColor;\r\n\r\n#if MAX_DIR_LIGHTS > 0\r\n\r\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\r\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\r\n\r\n#endif\r\n\r\n#if MAX_POINT_LIGHTS > 0\r\n\r\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\r\n\r\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\r\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\r\n\r\n#endif\r\n\r\n#if MAX_SPOT_LIGHTS > 0\r\n\r\nuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\r\nuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\r\nuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\r\nuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\r\nuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\r\n\r\nuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\r\n\r\n#endif\r\n\r\n#ifdef USE_IRRADIANCEMAP\r\nuniform samplerCube irradianceMap;\r\n#endif\r\n\r\n#if MAX_SPOT_LIGHTS > 0 || NUM_CUTPLANES > 0\r\nvarying highp vec3 vWorldPosition;\r\n#endif\r\n\r\nvarying highp vec3 vViewPosition;\r\n#ifndef FLAT_SHADED\r\nvarying highp vec3 vNormal;\r\n#endif\r\n\r\n#ifdef USE_BUMPMAP\r\n\r\nuniform sampler2D bumpMap;\r\nuniform float bumpScale;\r\n\r\n\r\n\r\n\r\n\r\n\r\nvec2 dHdxy_fwd() {\r\n\r\n vec2 dSTdx = dFdx( vUvBump );\r\n vec2 dSTdy = dFdy( vUvBump );\r\n\r\n float Hll = bumpScale * GET_BUMPMAP(vUvBump).x;\r\n float dBx = bumpScale * GET_BUMPMAP(vUvBump + dSTdx).x - Hll;\r\n float dBy = bumpScale * GET_BUMPMAP(vUvBump + dSTdy).x - Hll;\r\n\r\n return vec2( dBx, dBy );\r\n\r\n}\r\n\r\nvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\r\n\r\n vec3 vSigmaX = dFdx( surf_pos );\r\n vec3 vSigmaY = dFdy( surf_pos );\r\n vec3 vN = surf_norm;\r\n\r\n vec3 R1 = cross( vSigmaY, vN );\r\n vec3 R2 = cross( vN, vSigmaX );\r\n\r\n float fDet = dot( vSigmaX, R1 );\r\n\r\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\r\n return normalize( abs( fDet ) * surf_norm - vGrad );\r\n\r\n}\r\n\r\n#endif\r\n\r\n\r\n#ifdef USE_NORMALMAP\r\n\r\nuniform sampler2D normalMap;\r\nuniform vec2 normalScale;\r\n\r\n\r\n\r\n\r\nvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\r\n\r\n vec3 q0 = dFdx( eye_pos.xyz );\r\n vec3 q1 = dFdy( eye_pos.xyz );\r\n vec2 st0 = dFdx( vUvBump.st );\r\n vec2 st1 = dFdy( vUvBump.st );\r\n\r\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\r\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\r\n vec3 N = normalize( surf_norm );\r\n\r\n vec3 mapN = GET_NORMALMAP(vUvBump).xyz * 2.0 - 1.0;\r\n mapN.xy = normalScale * mapN.xy;\r\n mat3 tsn = mat3( S, T, N );\r\n return normalize( tsn * mapN );\r\n\r\n}\r\n\r\n#endif\r\n\r\n\r\n#ifdef USE_SPECULARMAP\r\nuniform sampler2D specularMap;\r\n#endif\r\n\r\n#ifdef USE_ALPHAMAP\r\nuniform sampler2D alphaMap;\r\n#endif\r\n\r\n#include <hatch_pattern>\r\n\r\nvec3 Schlick_v3(vec3 v, float cosHV) {\r\n float facing = max(1.0 - cosHV, 0.0);\r\n return v + (1.0 - v) * pow(facing, 5.0);\r\n}\r\n\r\nfloat Schlick_f(float v, float cosHV) {\r\n float facing = max(1.0 - cosHV, 0.0);\r\n return v + ( 1.0 - v ) * pow(facing, 5.0);\r\n}\r\n\r\n#include <cutplanes>\r\n\r\nvoid main() {\r\n\r\n#if NUM_CUTPLANES > 0\r\n checkCutPlanes(vWorldPosition);\r\n#endif\r\n\r\n gl_FragColor = vec4( vec3 ( 1.0 ), opacity );\r\n\r\n#ifdef USE_MAP\r\n vec4 texelColor = GET_MAP(vUv);\r\n#ifdef MAP_INVERT\r\n texelColor.xyz = 1.0-texelColor.xyz;\r\n#endif\r\n#ifdef GAMMA_INPUT\r\n texelColor.xyz *= texelColor.xyz;\r\n#endif\r\n gl_FragColor = gl_FragColor * texelColor;\r\n#endif\r\n\r\n#ifdef USE_ALPHAMAP\r\n vec4 texelAlpha = GET_ALPHAMAP(vUvAlpha);\r\n gl_FragColor.a *= texelAlpha.r;\r\n#endif\r\n\r\n#ifdef ALPHATEST\r\n if ( gl_FragColor.a < ALPHATEST ) discard;\r\n#endif\r\n\r\n float specularStrength;\r\n\r\n#ifdef USE_SPECULARMAP\r\n vec4 texelSpecular = GET_SPECULARMAP(vUv);\r\n specularStrength = texelSpecular.r;\r\n#else\r\n specularStrength = 1.0;\r\n#endif\r\n\r\n#ifndef FLAT_SHADED\r\n vec3 normal = normalize( vNormal );\r\n#ifdef DOUBLE_SIDED\r\n\r\n#endif\r\n#else\r\n vec3 fdx = dFdx( vViewPosition );\r\n vec3 fdy = dFdy( vViewPosition );\r\n vec3 normal = normalize( cross( fdx, fdy ) );\r\n#endif\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n vec3 viewDirection;\r\n if (projectionMatrix[3][3] == 0.0) {\r\n viewDirection = normalize( vViewPosition );\r\n } else {\r\n viewDirection = vec3(0.0, 0.0, 1.0);\r\n }\r\n normal = faceforward(normal, -viewDirection, normal);\r\n\r\n vec3 geomNormal = normal;\r\n\r\n#ifdef USE_NORMALMAP\r\n normal = perturbNormal2Arb( -vViewPosition, normal );\r\n#elif defined( USE_BUMPMAP )\r\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\r\n#endif\r\n\r\n vec3 totalDiffuse = vec3( 0.0 );\r\n vec3 totalSpecular = vec3( 0.0 );\r\n\r\n\r\n\r\n float shininessB = shininess * 4.0;\r\n\r\n#if MAX_POINT_LIGHTS > 0\r\n\r\n vec3 pointDiffuse = vec3( 0.0 );\r\n vec3 pointSpecular = vec3( 0.0 );\r\n\r\n for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\r\n\r\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\r\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\r\n\r\n float lDistance = 1.0;\r\n if ( pointLightDistance[ i ] > 0.0 )\r\n lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\r\n\r\n lVector = normalize( lVector );\r\n\r\n\r\n\r\n float dotProduct = dot( normal, lVector );\r\n\r\n float pointDiffuseWeight = max( dotProduct, 0.0 );\r\n\r\n\r\n pointDiffuse += InputToLinear(diffuse) * InputToLinear(pointLightColor[ i ]) * pointDiffuseWeight * lDistance;\r\n\r\n\r\n\r\n vec3 pointHalfVector = normalize( lVector + viewDirection );\r\n float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\r\n\r\n float pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininessB ), 0.0 );\r\n float specularNormalization = shininessB * 0.125 + 0.25;\r\n vec3 schlick = Schlick_v3(InputToLinear(specular), dot( lVector, pointHalfVector ) );\r\n pointSpecular += schlick * InputToLinear(pointLightColor[ i ]) * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization ;\r\n\r\n }\r\n\r\n totalDiffuse += pointDiffuse;\r\n totalSpecular += pointSpecular;\r\n\r\n#endif\r\n\r\n#if MAX_SPOT_LIGHTS > 0\r\n\r\n vec3 spotDiffuse = vec3( 0.0 );\r\n vec3 spotSpecular = vec3( 0.0 );\r\n\r\n for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\r\n\r\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\r\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\r\n\r\n float lDistance = 1.0;\r\n if ( spotLightDistance[ i ] > 0.0 )\r\n lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\r\n\r\n lVector = normalize( lVector );\r\n\r\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\r\n\r\n if ( spotEffect > spotLightAngleCos[ i ] ) {\r\n\r\n spotEffect = max( pow( spotEffect, spotLightExponent[ i ] ), 0.0 );\r\n\r\n\r\n\r\n float dotProduct = dot( normal, lVector );\r\n\r\n float spotDiffuseWeight = max( dotProduct, 0.0 );\r\n\r\n spotDiffuse += InputToLinear(diffuse) * InputToLinear(spotLightColor[ i ]) * spotDiffuseWeight * lDistance * spotEffect;\r\n\r\n\r\n\r\n vec3 spotHalfVector = normalize( lVector + viewDirection );\r\n float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\r\n float spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininessB ), 0.0 );\r\n\r\n float specularNormalization = shininessB * 0.125 + 0.25;\r\n vec3 schlick = Schlick_v3(InputToLinear(specular), dot( lVector, spotHalfVector ) );\r\n spotSpecular += schlick * InputToLinear(spotLightColor[ i ]) * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\r\n }\r\n\r\n }\r\n\r\n totalDiffuse += spotDiffuse;\r\n totalSpecular += spotSpecular;\r\n\r\n#endif\r\n\r\n#if MAX_DIR_LIGHTS > 0\r\n\r\n vec3 dirDiffuse = vec3( 0.0 );\r\n vec3 dirSpecular = vec3( 0.0 );\r\n\r\n for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\r\n\r\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\r\n vec3 dirVector = normalize( lDirection.xyz );\r\n\r\n\r\n\r\n float dotProduct = dot( normal, dirVector );\r\n\r\n float dirDiffuseWeight = max( dotProduct, 0.0 );\r\n\r\n dirDiffuse += InputToLinear(diffuse) * InputToLinear(directionalLightColor[ i ]) * dirDiffuseWeight;\r\n\r\n\r\n\r\n vec3 dirHalfVector = normalize( dirVector + viewDirection );\r\n float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\r\n float dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininessB ), 0.0 );\r\n\r\n float specularNormalization = shininessB * 0.125 + 0.25;\r\n vec3 schlick = Schlick_v3(InputToLinear(specular), dot( dirVector, dirHalfVector ));\r\n\r\n dirSpecular += schlick * InputToLinear(directionalLightColor[ i ]) * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\r\n\r\n }\r\n\r\n totalDiffuse += dirDiffuse;\r\n totalSpecular += dirSpecular;\r\n\r\n#endif\r\n\r\n\r\n\r\n#ifdef USE_IRRADIANCEMAP\r\n vec3 worldNormal = mat3(viewMatrixInverse) * normal;\r\n vec3 indirectDiffuse = sampleIrradianceMap(worldNormal, irradianceMap, envMapExposure);\r\n\r\n indirectDiffuse = applyEnvShadow(indirectDiffuse, worldNormal);\r\n\r\n totalDiffuse += InputToLinear(diffuse) * indirectDiffuse;\r\n#endif\r\n\r\n\r\n#ifdef METAL\r\n gl_FragColor.xyz = gl_FragColor.xyz * ( InputToLinear(emissive) + totalDiffuse + ambientLightColor * InputToLinear(diffuse) + totalSpecular );\r\n#else\r\n gl_FragColor.xyz = gl_FragColor.xyz * ( InputToLinear(emissive) + totalDiffuse + ambientLightColor * InputToLinear(diffuse) ) + totalSpecular;\r\n#endif\r\n\r\n\r\n\r\n#ifdef USE_COLOR\r\n gl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\r\n#endif\r\n\r\n\r\n#if defined(USE_ENVMAP)\r\n\r\n vec3 reflectVec;\r\n\r\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\r\n\r\n#ifdef ENVMAP_MODE_REFLECTION\r\n reflectVec = reflect( -viewDirection, normal );\r\n#else \r\n reflectVec = refract( -viewDirection, normal, refractionRatio );\r\n#endif\r\n\r\n#else\r\n\r\n reflectVec = reflect( -viewDirection, normal );\r\n\r\n#endif\r\n\r\n reflectVec = mat3(viewMatrixInverse) * reflectVec;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n float reflectScale = 1.0;\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n vec3 cubeColor = sampleReflection(reflectVec, reflMipIndex);\r\n\r\n cubeColor *= reflectScale;\r\n\r\n float facing = dot( viewDirection, normal );\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n if (facing < -1e-2 || reflectivity == 0.0)\r\n facing = 1.0;\r\n else\r\n facing = max(1e-6, facing);\r\n\r\n#ifdef USE_BUMPMAP\r\n\r\n\r\n\r\n facing = min(1.0, facing + bumpScale * 7.0);\r\n\r\n#endif\r\n\r\n vec3 schlickRefl;\r\n\r\n#ifdef METAL\r\n\r\n\r\n schlickRefl = InputToLinear(specular);\r\n\r\n#else\r\n\r\n\r\n schlickRefl = Schlick_v3(InputToLinear(specular), facing);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n gl_FragColor.a = mix(gl_FragColor.a, Schlick_f(gl_FragColor.a, facing), reflectivity);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n float invSchlick = pow(1.0 - facing * 0.5, 5.0);\r\n\r\n\r\n float norm_factor = (28.0 / 23.0) * (1.0 - invSchlick) * (1.0 - invSchlick);\r\n\r\n gl_FragColor.xyz *= norm_factor * (1.0 - InputToLinear(specular));\r\n\r\n#endif\r\n\r\n\r\n gl_FragColor.xyz += cubeColor.xyz * specularStrength * schlickRefl.xyz;\r\n\r\n#ifdef CLEARCOAT\r\n\r\n vec3 reflectVecClearcoat = reflect( -viewDirection, geomNormal );\r\n reflectVecClearcoat = mat3(viewMatrixInverse) * reflectVecClearcoat;\r\n\r\n vec3 cubeColorClearcoat = sampleReflection(reflectVecClearcoat, 0.0);\r\n\r\n\r\n float schlickClearcoat = Schlick_f(InputToLinear(reflectivity), facing);\r\n\r\n\r\n\r\n gl_FragColor.xyz = mix(gl_FragColor.xyz, cubeColorClearcoat * schlickClearcoat, 0.5);\r\n\r\n#endif\r\n\r\n\r\n\r\n\r\n#endif\r\n\r\n#if TONEMAP_OUTPUT == 1\r\n gl_FragColor.xyz = toneMapCanonOGS_WithGamma_WithColorPerserving(exposureBias * gl_FragColor.xyz);\r\n#elif TONEMAP_OUTPUT == 2\r\n gl_FragColor.xyz = toneMapCanonFilmic_WithGamma( exposureBias * gl_FragColor.xyz );\r\n#endif\r\n\r\n\r\n\r\n#ifdef USE_FOG\r\n float depth = gl_FragCoord.z / gl_FragCoord.w;\r\n float fogFactor = smoothstep( fogNear, fogFar, depth );\r\n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\r\n#endif\r\n#include <theming_frag>\r\n#include <final_frag>\r\n\r\n}\r\n"},4352:e=>{e.exports="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\nvarying vec3 vNormal;\n#endif\n#if defined( USE_MAP ) || defined( USE_SPECULARMAP )\nvarying vec2 vUv;\nuniform mat3 texMatrix;\n#endif\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\nvarying vec2 vUvBump;\nuniform mat3 texMatrixBump;\n#endif\n#if defined( USE_ALPHAMAP )\nvarying vec2 vUvAlpha;\nuniform mat3 texMatrixAlpha;\n#endif\n#if defined( USE_ENVMAP )\n#if ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP )\nuniform float refractionRatio;\n#endif\n#endif\n#if MAX_SPOT_LIGHTS > 0 || NUM_CUTPLANES > 0\nvarying vec3 vWorldPosition;\n#endif\n#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif\n#ifdef MRT_NORMALS\nvarying float depth;\n#endif\n#include <pack_normals>\n#include <instancing_decl_vert>\n#include <id_decl_vert>\n#include <wide_lines_decl>\n#include <shadowmap_decl_vert>\nvoid main() {\n#if defined( USE_MAP ) || defined( USE_SPECULARMAP )\n vUv = (texMatrix * vec3(uv, 1.0)).xy;\n#endif\n#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n vUvBump = (texMatrixBump * vec3(uv, 1.0)).xy;\n#endif\n#if defined( USE_ALPHAMAP )\n vUvAlpha = (texMatrixAlpha * vec3(uv, 1.0)).xy;\n#endif\n#ifdef USE_COLOR\n#ifdef GAMMA_INPUT\n vColor = color * color;\n#else\n vColor = color;\n#endif\n#endif\n#ifdef UNPACK_NORMALS\n vec3 objectNormal = decodeNormal(normal);\n#else\n vec3 objectNormal = normal;\n#endif\n#ifdef FLIP_SIDED\n objectNormal = -objectNormal;\n#endif\n objectNormal = getInstanceNormal(objectNormal);\n vec3 instPos = getInstancePos(position);\n vec3 transformedNormal = normalMatrix * objectNormal;\n#ifndef FLAT_SHADED\n vNormal = normalize( transformedNormal );\n#endif\n vec4 mvPosition = modelViewMatrix * vec4( instPos, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n#include <wide_lines_vert>\n vViewPosition = -mvPosition.xyz;\n#if MAX_SPOT_LIGHTS > 0 || NUM_CUTPLANES > 0\n vec4 worldPosition = modelMatrix * vec4( instPos, 1.0 );\n vWorldPosition = worldPosition.xyz;\n#endif\n#ifdef MRT_NORMALS\n depth = mvPosition.z;\n#endif\n#include <shadowmap_vert>\n#include <id_vert>\n}\n"},50410:e=>{e.exports="\n#define EDGE_SHARPNESS (3.0)\n#define SCALE (2)\n#define R (4)\n#define VALUE_TYPE float\n#define VALUE_COMPONENTS r\n#define VALUE_IS_KEY 0\n#define KEY_COMPONENTS gb\n#if __VERSION__ >= 330\nconst float gaussian[R + 1] =\nfloat[](0.153170, 0.144893, 0.122649, 0.092902, 0.062970);\n#endif\nuniform sampler2D tDiffuse;\nuniform vec2 size;\nuniform vec2 resolution;\nuniform vec2 axis;\nuniform float radius;\n#define result gl_FragColor.VALUE_COMPONENTS\n#define keyPassThrough gl_FragColor.KEY_COMPONENTS\nfloat unpackKey(vec2 p) {\n return p.x + p.y * (1.0 / 255.0);\n}\nvarying vec2 vUv;\nvoid main() {\n# if __VERSION__ < 330\n float gaussian[R + 1];\n# if R == 3\n gaussian[0] = 0.153170; gaussian[1] = 0.144893; gaussian[2] = 0.122649; gaussian[3] = 0.092902;\n# elif R == 4\n gaussian[0] = 0.153170; gaussian[1] = 0.144893; gaussian[2] = 0.122649; gaussian[3] = 0.092902; gaussian[4] = 0.062970;\n# elif R == 6\n gaussian[0] = 0.111220; gaussian[1] = 0.107798; gaussian[2] = 0.098151; gaussian[3] = 0.083953; gaussian[4] = 0.067458; gaussian[5] = 0.050920; gaussian[6] = 0.036108;\n# endif\n# endif\n ivec2 axisi = ivec2(axis);\n ivec2 ssC = ivec2(gl_FragCoord.xy);\n vec4 temp = texture2D(tDiffuse, vUv);\n gl_FragColor.gb = temp.KEY_COMPONENTS;\n gl_FragColor.a = temp.a;\n VALUE_TYPE sum = temp.VALUE_COMPONENTS;\n if (temp.a == 0.0) {\n result = sum;\n return;\n }\n float key = unpackKey(keyPassThrough);\n float BASE = gaussian[0];\n float totalWeight = BASE;\n sum *= totalWeight;\n float scale = 1.5 / radius;\n int r = -4; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[4];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n r = -3; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[3];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n r = -2; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[2];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n r=-1; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[1];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n r = 1; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[1];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n r = 2; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[2];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n r = 3; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[3];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n r = 4; {\n vec2 ssUV = vec2(ssC + axisi * (r * SCALE))*resolution;\n temp = texture2D(tDiffuse, ssUV);\n float tapKey = unpackKey(temp.KEY_COMPONENTS);\n VALUE_TYPE value = temp.VALUE_COMPONENTS;\n float weight = 0.3 + gaussian[4];\n float dz = tapKey - key;\n weight *= max(0.0, 1.0 - (EDGE_SHARPNESS * 2000.0) * abs(dz) * scale);\n sum += value * weight;\n totalWeight += weight;\n }\n const float epsilon = 0.0001;\n result = sum / (totalWeight + epsilon);\n}\n"},6890:e=>{e.exports="\n#include <depth_texture>\n#define USE_MIPMAP 1\nuniform float cameraNear;\nuniform float cameraFar;\nuniform vec2 size;\nuniform vec2 resolution;\nuniform float lumInfluence;\nvarying vec2 vUv;\n#define NUM_SAMPLES (17)\n#define LOG_MAX_OFFSET (3)\n#define MAX_MIP_LEVEL (5)\n#define NUM_SPIRAL_TURNS (5)\n#define MIN_RADIUS (3.0)\n#define TAU 6.28318530718\nuniform float projScale;\n#ifdef USE_MIPMAP\nuniform sampler2D tDepth_mip1;\nuniform sampler2D tDepth_mip2;\nuniform sampler2D tDepth_mip3;\nuniform sampler2D tDepth_mip4;\nuniform sampler2D tDepth_mip5;\n#endif\nuniform float radius;\nuniform float bias;\nuniform float intensity;\nvec2 tapLocation(int sampleNumber, float spinAngle, out float ssR){\n float alpha = float(float(sampleNumber) + 0.5) * (1.0 / float(NUM_SAMPLES));\n float angle = alpha * (float(NUM_SPIRAL_TURNS) * TAU) + spinAngle;\n ssR = alpha;\n return vec2(cos(angle), sin(angle));\n}\nfloat CSZToKey(float z) {\n return clamp( (z+cameraNear) / (cameraNear-cameraFar), 0.0, 1.0);\n}\nvoid packKey(float key, out vec2 p) {\n float temp = floor(key * 255.0);\n p.x = temp * (1.0 / 255.0);\n p.y = key * 255.0 - temp;\n}\n#include <pack_depth>\nfloat unpackDepthNearFar( const in vec4 rgba_depth ) {\n float depth = unpackDepth( rgba_depth );\n if (depth == 0.0)\n return -cameraFar * 1.0e10;\n return depth * (cameraNear - cameraFar) - cameraNear;\n}\nvec3 reconstructCSFaceNormal(vec3 C) {\n return normalize(cross(dFdy(C), dFdx(C)));\n}\nvec3 reconstructNonUnitCSFaceNormal(vec3 C) {\n return cross(dFdy(C), dFdx(C));\n}\nvec3 getPosition(ivec2 ssP, float depth) {\n vec3 P;\n P = reconstructCSPosition(vec2(ssP) + vec2(0.5), depth);\n return P;\n}\nvec3 getOffsetPosition(ivec2 ssC, vec2 unitOffset, float ssR) {\n ivec2 ssP = ivec2(ssR * unitOffset) + ssC;\n vec3 P;\n#ifdef _LMVWEBGL2_\n#ifdef USE_MIPMAP\n int mipLevel = clamp(int(floor(log2(ssR))) - LOG_MAX_OFFSET, 0, MAX_MIP_LEVEL);\n if (mipLevel == 0) {\n P.z = texelFetch(tDepth, ssP, 0).z;\n if (P.z == 0.0) P.z = -cameraFar * 1.0e10;\n }\n else if (mipLevel == 1) {\n ivec2 mipP = clamp(ssP >> mipLevel, ivec2(0), textureSize(tDepth_mip1, 0) - ivec2(1));\n P.z = unpackDepthNearFar(texelFetch(tDepth_mip1, mipP, 0));\n } else if (mipLevel == 2) {\n ivec2 mipP = clamp(ssP >> mipLevel, ivec2(0), textureSize(tDepth_mip2, 0) - ivec2(1));\n P.z = unpackDepthNearFar(texelFetch(tDepth_mip2, mipP, 0));\n } else if (mipLevel == 3) {\n ivec2 mipP = clamp(ssP >> mipLevel, ivec2(0), textureSize(tDepth_mip3, 0) - ivec2(1));\n P.z = unpackDepthNearFar(texelFetch(tDepth_mip3, mipP, 0));\n } else if (mipLevel == 4) {\n ivec2 mipP = clamp(ssP >> mipLevel, ivec2(0), textureSize(tDepth_mip4, 0) - ivec2(1));\n P.z = unpackDepthNearFar(texelFetch(tDepth_mip4, mipP, 0));\n } else if (mipLevel == 5) {\n ivec2 mipP = clamp(ssP >> mipLevel, ivec2(0), textureSize(tDepth_mip5, 0) - ivec2(1));\n P.z = unpackDepthNearFar(texelFetch(tDepth_mip5, mipP, 0));\n }\n#else\n P.z = texelFetch(tDepth, ssP, 0).z;\n if (P.z == 0.0) P.z = -cameraFar * 1.0e10;\n#endif\n#else\n vec2 screenUV = (vec2(ssP) + vec2(0.5)) * resolution;\n#ifdef USE_MIPMAP\n int mipLevel = int(max(0.0, min(floor(log2(ssR)) - float(LOG_MAX_OFFSET), float(MAX_MIP_LEVEL))));\n if (mipLevel == 0) {\n P.z = texture2D(tDepth, screenUV).z;\n if (P.z == 0.0) P.z = -cameraFar * 1.0e10;\n }\n else if (mipLevel == 1)\n P.z = unpackDepthNearFar(texture2D(tDepth_mip1, screenUV));\n else if (mipLevel == 2)\n P.z = unpackDepthNearFar(texture2D(tDepth_mip2, screenUV));\n else if (mipLevel == 3)\n P.z = unpackDepthNearFar(texture2D(tDepth_mip3, screenUV));\n else if (mipLevel == 4)\n P.z = unpackDepthNearFar(texture2D(tDepth_mip4, screenUV));\n else if (mipLevel == 5)\n P.z = unpackDepthNearFar(texture2D(tDepth_mip5, screenUV));\n#else\n P.z = texture2D(tDepth, screenUV).z;\n if (P.z == 0.0) P.z = -cameraFar * 1.0e10;\n#endif\n#endif\n P = reconstructCSPosition(vec2(ssP) + vec2(0.5), P.z);\n return P;\n}\nfloat sampleAO(in ivec2 ssC, in vec3 C, in vec3 n_C, in float ssDiskRadius, in int tapIndex, in float randomPatternRotationAngle) {\n float ssR;\n vec2 unitOffset = tapLocation(tapIndex, randomPatternRotationAngle, ssR);\n ssR = max(0.75, ssR * ssDiskRadius);\n vec3 Q = getOffsetPosition(ssC, unitOffset, ssR);\n vec3 v = Q - C;\n float vv = dot(v, v);\n float vn = dot(v, n_C);\n const float epsilon = 0.001;\n float angAdjust = mix(1.0, max(0.0, 1.5 * n_C.z), 0.35);\n#define HIGH_QUALITY\n#ifdef HIGH_QUALITY\n float f = max(1.0 - vv / (radius * radius), 0.0); return angAdjust * f * max((vn - bias) / sqrt(epsilon + vv), 0.0);\n#else\n float f = max(radius * radius - vv, 0.0); return angAdjust * f * f * f * max((vn - bias) / (epsilon + vv), 0.0);\n#endif\n}\nconst bool useNoise = true;\nfloat getRandomAngle(vec2 pos) {\n float dt= dot(pos ,vec2(12.9898,78.233));\n return TAU * fract(sin(mod(dt,3.14)) * 43758.5453);\n}\nvoid main() {\n ivec2 ssC = ivec2(gl_FragCoord.xy);\n vec4 nrmz = texture2D(tDepth, vUv);\n if (nrmz.z == 0.0) {\n gl_FragColor.r = 1.0;\n gl_FragColor.a = 0.0;\n packKey(1.0, gl_FragColor.gb);\n return;\n }\n vec3 C = getPosition(ssC, nrmz.z);\n packKey(CSZToKey(C.z), gl_FragColor.gb);\n float ssDiskRadius = -projScale * radius / mix(C.z, -1.0, isOrtho);\n float A;\n if (ssDiskRadius <= MIN_RADIUS) {\n A = 1.0;\n } else {\n float sum = 0.0;\n float randomPatternRotationAngle = getRandomAngle(vUv);\n vec3 n_C = vec3(nrmz.x, nrmz.y, sqrt(1.0 - dot(nrmz.xy, nrmz.xy)));\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 0, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 1, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 2, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 3, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 4, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 5, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 6, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 7, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 8, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 9, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 10, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 11, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 12, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 13, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 14, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 15, randomPatternRotationAngle);\n sum += sampleAO(ssC, C, n_C, ssDiskRadius, 16, randomPatternRotationAngle);\n float intensityDivR6 = intensity / pow(radius, 6.0);\n#ifdef HIGH_QUALITY\n A = pow(max(0.0, 1.0 - sqrt(sum * (3.0 / float(NUM_SAMPLES)))), intensity);\n#else\n A = max(0.0, 1.0 - sum * intensityDivR6 * (5.0 / float(NUM_SAMPLES)));\n A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2;\n#endif\n if (abs(dFdx(C.z)) < 0.02) {\n A -= dFdx(A) * (mod(float(ssC.x), 2.0) - 0.5);\n }\n if (abs(dFdy(C.z)) < 0.02) {\n A -= dFdy(A) * (mod(float(ssC.y), 2.0) - 0.5);\n }\n A = mix(1.0, A, clamp(ssDiskRadius - MIN_RADIUS,0.0,1.0));\n }\n gl_FragColor.r = A;\n gl_FragColor.a = 1.0;\n}\n"},3819:e=>{e.exports="uniform sampler2D tDiffuse;\nuniform vec2 resolution;\nvoid main() {\n vec2 ssP = vec2(gl_FragCoord.xy);\n ssP = ssP * 2.0 + mod(ssP, 2.0);\n ssP = (ssP + 0.5) * resolution * 0.5;\n gl_FragColor = texture2D(tDiffuse, ssP);\n}\n"},92003:e=>{e.exports="uniform sampler2D tDiffuse;\nuniform vec2 resolution;\nuniform float cameraNear;\nuniform float cameraInvNearFar;\n#include <pack_depth>\nvoid main() {\n vec2 ssP = vec2(gl_FragCoord.xy);\n ssP = ssP * 2.0 + mod(ssP, 2.0);\n ssP = (ssP + 0.5) * resolution * 0.5;\n float depth = texture2D(tDiffuse, ssP).z;\n if (depth != 0.0)\n depth = (depth + cameraNear) * cameraInvNearFar;\n gl_FragColor = packDepth(depth);\n}\n"},66209:e=>{e.exports="varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},11342:e=>{e.exports="\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},18214:e=>{e.exports="#include <shadowmap_decl_common>\nvarying float depth;\n#ifdef USE_SURFACE_CUTOUT_MAP\n#include <float3_average>\n#if defined( USE_SURFACE_CUTOUT_MAP )\n uniform sampler2D surface_cutout_map;\n uniform mat3 surface_cutout_map_texMatrix;\n uniform bool surface_cutout_map_invert;\n#endif\nvarying vec2 vUv;\n#else\n#ifdef USE_MAP\nvarying vec2 vUv;\nuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\nvarying vec2 vUvAlpha;\nuniform sampler2D alphaMap;\n#endif\n#endif\nuniform float shadowMinOpacity;\nvoid applyCutoutMaps() {\n float opacity = 1.0;\n#ifdef USE_SURFACE_CUTOUT_MAP\n #if defined( USE_SURFACE_CUTOUT_MAP )\n vec2 uv_surface_cutout_map = (surface_cutout_map_texMatrix * vec3(uv, 1.0)).xy;\n SURFACE_CUTOUT_CLAMP_TEST;\n vec3 opacity_v3 = texture2D(surface_cutout_map, uv_surface_cutout_map).xyz;\n if(surface_cutout_map_invert) opacity_v3 = vec3(1.0) - opacity_v3;\n opacity = average(opacity_v3);\n #else\n opacity = surface_cutout;\n #endif\n#else\n#ifdef USE_MAP\n opacity *= GET_MAP(vUv).a;\n#endif\n#ifdef USE_ALPHAMAP\n opacity *= GET_ALPHAMAP(vUvAlpha).r;\n#endif\n#endif\n#if defined(USE_SURFACE_CUTOUT_MAP) || defined(USE_MAP) || defined(USE_ALPHAMAP)\n if (opacity < shadowMinOpacity) discard;\n#endif\n}\nvoid main() {\n float normalizedLinearDepth = (depth - shadowMapRangeMin) / shadowMapRangeSize;\n float val = exp(shadowESMConstant * normalizedLinearDepth);\n#ifdef USE_HARD_SHADOWS\n val = normalizedLinearDepth;\n#endif\n applyCutoutMaps();\n gl_FragColor = vec4(val, 0, 0, 1);\n}\n"},83159:e=>{e.exports="#include <shadowmap_decl_frag>\nvoid main() {\n float shadowIntensity = 0.5 * (1.0 - getShadowValue());\n gl_FragColor = vec4(0.0, 0.0, 0.0, shadowIntensity);\n}\n"},2680:e=>{e.exports="#include <shadowmap_decl_vert>\nvoid main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n#include <shadowmap_vert>\n}\n"},47065:e=>{e.exports="#include <shadowmap_decl_common>\nvarying float depth;\n#ifdef USE_SURFACE_CUTOUT_MAP\nvarying vec2 vUv;\n#else\n#ifdef USE_MAP\nvarying vec2 vUv;\nuniform mat3 texMatrix;\n#endif\n#ifdef USE_ALPHAMAP\nvarying vec2 vUvAlpha;\nuniform mat3 texMatrixAlpha;\n#endif\n#endif\nvoid passCutoutUVCoords() {\n#ifdef USE_SURFACE_CUTOUT_MAP\n vUv = uv;\n#else\n#ifdef USE_MAP\n vUv = (texMatrix * vec3(uv, 1.0)).xy;\n#endif\n#ifdef USE_ALPHAMAP\n vUvAlpha = (texMatrixAlpha * vec3(uv, 1.0)).xy;\n#endif\n#endif\n}\nvoid main() {\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n vec4 p_Position = projectionMatrix * mvPosition;\n gl_Position = p_Position;\n depth = -mvPosition.z;\n passCutoutUVCoords();\n}\n"},70125:e=>{e.exports="#include <id_decl_frag>\nuniform sampler2D sheetMap;\nuniform sampler2D idMap;\nuniform vec2 resolution;\nuniform vec3 modelIDv2;\nuniform float alphaTest;\nvoid main() {\n vec2 uv = vec2(gl_FragCoord.x * resolution.x, gl_FragCoord.y * resolution.y);\n vec4 c = texture2D(sheetMap, uv);\n if (c.a <= alphaTest)\n discard;\n \n gl_FragColor = c;\n vec4 dbId = texture2D(idMap, uv);\n#ifdef MRT_NORMALS\n outNormal = vec4(0.0, 0.0, 0.0, 1.0);\n#endif\n#ifdef MRT_ID_BUFFER\n outId = vec4(dbId.rgb, 1.0);\n #ifdef MODEL_COLOR\n outModelId = vec4(modelIDv2.rgb, 1.0);\n #endif\n#elif defined(ID_COLOR)\n gl_FragColor = vec4(dbId.rgb, 1.0);\n#elif defined(MODEL_COLOR)\n gl_FragColor = vec4(modelIDv2.rgb, 1.0);\n#endif\n}\n"},70057:e=>{e.exports="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},35150:(e,t,i)=>{"use strict";i.r(t);var n=i(9749),r=i(20457),o=i(58927),s=i(12194),a=i(62421),l=i(33423),c=i(59991);function h(e,t){r.Extension.call(this,e,t),this.name="propertiesmanager",this._panel=null,this._onIsolateEvent=this._onIsolateEvent.bind(this),this._onSelectionChangeEvent=this._onSelectionChangeEvent.bind(this),this._onPrefChange=this._onPrefChange.bind(this),this._onContextMenu=this._onContextMenu.bind(this)}h.prototype=Object.create(r.Extension.prototype),h.prototype.constructor=h;var u=h.prototype;const d=Autodesk.Viewing.Private;u.load=function(){return this.viewer.addEventListener(l.ISOLATE_EVENT,this._onIsolateEvent),this.viewer.addEventListener(l.AGGREGATE_SELECTION_CHANGED_EVENT,this._onSelectionChangeEvent),this.viewer.prefs.addListeners(c.Prefs.OPEN_PROPERTIES_ON_SELECT,this._onPrefChange),this.viewer.registerContextMenuCallback(this.name,this._onContextMenu),!0},u.unload=function(){this.viewer.removeEventListener(l.ISOLATE_EVENT,this._onIsolateEvent),this.viewer.removeEventListener(l.AGGREGATE_SELECTION_CHANGED_EVENT,this._onSelectionChangeEvent),this.viewer.prefs.removeListeners(c.Prefs.OPEN_PROPERTIES_ON_SELECT,this._onPrefChange),this.viewer.unregisterContextMenuCallback(this.name),this.deactivate(),this.setPanel(null),this._toolbarButton&&(this.viewer.settingsTools.removeControl(this._toolbarButton),this.viewer.settingsTools.propertiesbutton=null,this._toolbarButton=null)},u.onToolbarCreated=function(){this.setDefaultPanel(),this._addToolbarButton()},u.activate=function(){return!!this._panel&&(this._panel.setVisible(!0),!0)},u.deactivate=function(){return this._panel&&this._panel.setVisible(!1),!0},u.isActive=function(){return!!this._panel&&this._panel.isVisible()},u.setPanel=function(e){return(e instanceof o.PropertyPanel||!e)&&(this._panel&&(this._panel.setVisible(!1),this.viewer.removePanel(this._panel),this._panel.uninitialize()),this._panel=e,e&&(this.viewer.addPanel(e),e.addVisibilityListener((e=>{e&&this.viewer.onPanelVisible(this._panel),this._toolbarButton.setState(e?a.Button.State.ACTIVE:a.Button.State.INACTIVE)}))),!0)},u.setDefaultPanel=function(){this.setPanel(new s.ViewerPropertyPanel(this.viewer))},u.getPanel=function(){return this._panel},u.getToolbarButton=function(){return this._toolbarButton},u._addToolbarButton=function(){if(!this._toolbarButton){var e=this._toolbarButton=new a.Button("toolbar-propertiesTool");e.setToolTip("Properties"),e.setIcon("adsk-icon-properties"),e.onClick=()=>{this._panel.setVisible(!this._panel.isVisible()),this._panel.isVisible()&&d.analytics.track("viewer.properties",{action:"View List",from:"Toolbar"})},e.setVisible(!this.viewer.prefs.get("openPropertiesOnSelect")),this.viewer.settingsTools.addControl(e,{index:1}),this.viewer.settingsTools.propertiesbutton=e}},u._onIsolateEvent=function(e){this._panel&&(this.viewer.prefs.get("openPropertiesOnSelect")||e.nodeIdArray[0]===e.model.getRootId())&&this._panel.setVisible(e.nodeIdArray.length>0||this.viewer.impl.selector.hasSelection())},u._onSelectionChangeEvent=function(e){if(!this.viewer.prefs.get("openPropertiesOnSelect"))return;let t=!1;for(let i=0;i<e.selections.length;++i)if(e.selections[i].dbIdArray.length>0){t=!0;break}t?this.activate():this.deactivate()},u._onPrefChange=function(e){this._toolbarButton&&this._toolbarButton.setVisible(!e)},u._onContextMenu=function(e,t){if(this.isActive())return;if(!t.hasSelected)return;const i={title:"Show Properties",target:()=>{this.activate(),d.analytics.track("viewer.properties",{action:"View List",from:"Contextual"})}};e.unshift(i)};var p=i(48155);function f(e,t){r.Extension.call(this,e,t),this.viewer=e,this.options=t,this.name="viewersettings"}f.prototype=Object.create(r.Extension.prototype),f.prototype.constructor=f;var m=f.prototype;m.activate=function(){this.activeStatus||(this.viewer.showViewer3dOptions(!0),this.viewer.getSettingsPanel(!0).selectTab(p.ViewerSettingTab.Performance),this.activeStatus=!0);return!0},m.deactivate=function(){return this.activeStatus&&(this.viewer.showViewer3dOptions(!1),this.activeStatus=!1),!0};var g=i(25230),v=i(16840);const y=Autodesk.Viewing.Private;function b(e,t){r.Extension.call(this,e,t),this.viewer=e,this.options=t,this.name="modelstructure",this._modelstructure=null,this._onLoadModel=this._onLoadModel.bind(this),this._onUnloadModel=this._onUnloadModel.bind(this)}b.prototype=Object.create(r.Extension.prototype),b.prototype.constructor=b;var x=b.prototype;x.load=function(){return this.viewer.addEventListener(l.MODEL_ADDED_EVENT,this._onLoadModel),this.viewer.addEventListener(l.MODEL_ROOT_LOADED_EVENT,this._onLoadModel),this.viewer.addEventListener(l.MODEL_UNLOADED_EVENT,this._onUnloadModel),this.viewer.addEventListener(l.MODEL_REMOVED_EVENT,this._onUnloadModel),!0},x.unload=function(){return this.deactivate(),this.setModelStructurePanel(null),this._structureButton&&(this.viewer.settingsTools.removeControl(this._structureButton),this.viewer.settingsTools.structurebutton=null,this._structureButton=null),this.viewer.removeEventListener(l.MODEL_ADDED_EVENT,this._onLoadModel),this.viewer.removeEventListener(l.MODEL_ROOT_LOADED_EVENT,this._onLoadModel),this.viewer.removeEventListener(l.MODEL_UNLOADED_EVENT,this._onUnloadModel),this.viewer.removeEventListener(l.MODEL_REMOVED_EVENT,this._onUnloadModel),!0},x.onToolbarCreated=function(){const e=new a.Button("toolbar-modelStructureTool");e.setToolTip("Model browser"),e.setIcon("adsk-icon-structure"),e.onClick=()=>{!this._modelstructure.isVisible()?this.activate():this.deactivate()};const t=this.viewer.settingsTools;t.addControl(e,{index:0}),t.structurebutton=e,this._structureButton=e,this.restoreDefaultPanel()},x.activate=function(){return!!this._modelstructure&&(this._modelstructure.setVisible(!0),y.analytics.track("viewer.model_browser",{action:"View List"}),!0)},x.deactivate=function(){return this._modelstructure&&this._modelstructure.setVisible(!1),!0},x.isActive=function(){return!!this._modelstructure&&this._modelstructure.isVisible()},x.setModelStructurePanel=function(e){if(e===this._modelstructure)return!1;if(this._modelstructure&&(this._modelstructure.setVisible(!1),this.viewer.removePanel(this._modelstructure),this._modelstructure.uninitialize()),this._modelstructure=e,this.viewer.modelstructure=e,!e)return!0;this.viewer.addPanel(this._modelstructure);for(var t=this.viewer.impl.modelQueue().getModels(),i=0;i<t.length;++i)this._modelstructure.addModel(t[i]);return this._modelstructure.addVisibilityListener((e=>{e&&this.viewer.onPanelVisible(this._modelstructure),this._structureButton.setState(e?a.Button.State.ACTIVE:a.Button.State.INACTIVE)})),!0},x.restoreDefaultPanel=function(){const e=this.viewer.config;var t={docStructureConfig:e.docStructureConfig,hideSearch:(0,v.isMobileDevice)(),excludeRoot:e.modelBrowserExcludeRoot,startCollapsed:e.modelBrowserStartCollapsed},i=e.defaultModelStructureTitle||"Browser",n=new g.ViewerModelStructurePanel({...t,...(0,g.generateDefaultViewerHandlerOptions)(this.viewer)},i);this.setModelStructurePanel(n)},x._onLoadModel=function(e){this._modelstructure&&this._modelstructure.addModel(e.model)},x._onUnloadModel=function(e){this._modelstructure&&this._modelstructure.unloadModel(e.model)};var _=i(5442),E=i(56905),A=i(16274),S=i(21609),w=i(71224),M=i(84220),T=i(99902),C="dolly",P="freeorbit",D="orbit",L="worldup",I="fittoview";function R(e,t){r.Extension.call(this,e,t),this.name="navtools",this.modes=["pan",C,P,D,"fov",L,I],this.onToolChanged=this.onToolChanged.bind(this),this.onNavigationModeChanged=this.onNavigationModeChanged.bind(this),this.navToolsConfig=t.navToolsConfig||{}}R.prototype=Object.create(r.Extension.prototype),R.prototype.constructor=R;var O=R.prototype;function N(e,t,i){return function(){e.isActive(i)?e.deactivate():e.activate(i)}}O.load=function(){var e=this.viewer,t=new A.FovTool(e);if(e.toolController.registerTool(t),!this.navToolsConfig.isAECCameraControls){var i=new S.WorldUpTool(e.impl,e);e.toolController.registerTool(i)}return this.initFocalLengthOverlay(),e.addEventListener(l.TOOL_CHANGE_EVENT,this.onToolChanged),e.addEventListener(l.NAVIGATION_MODE_CHANGED_EVENT,this.onNavigationModeChanged),!0},O.updateUI=function(e){e!==this.is3d&&(this._destroyUI(),this._createUI(e))},O.onToolbarCreated=function(){var e=!this.viewer.impl.is2d;this._createUI(e)},O.navActionDisplayMode=function(e){return this.viewer.navigation.isActionEnabled(e)?"block":"none"},O._createUI=function(e){var t=this.viewer.getToolbar().getControl(_.TOOLBAR.NAVTOOLSID);if(e){var i=new E.ComboButton("toolbar-orbitTools");i.setToolTip("Orbit"),i.setIcon("adsk-icon-orbit-constrained"),i.setDisplay(this.navActionDisplayMode("orbit")),this.createOrbitSubmenu(i),t.addControl(i),t.orbittoolsbutton=i,i.setState(a.Button.State.ACTIVE),t.returnToDefault=function(){i.setState(a.Button.State.ACTIVE)}}var n=new a.Button("toolbar-panTool");n.setToolTip("Pan"),n.setIcon("adsk-icon-pan"),n.onClick=N(this,0,"pan"),n.setDisplay(this.navActionDisplayMode("pan")),t.addControl(n),t.panbutton=n,e||(t.returnToDefault=function(){n.setState(a.Button.State.ACTIVE)},t.returnToDefault());var r=new a.Button("toolbar-zoomTool");if(r.setToolTip("Zoom"),r.setIcon("adsk-icon-zoom"),r.onClick=N(this,0,C),r.setDisplay(this.navActionDisplayMode("zoom")),t.addControl(r),t.dollybutton=r,this.navToolsConfig.isAECCameraControls)t.addControl(this.createFitViewButton(t));else{var o=new E.ComboButton("toolbar-cameraSubmenuTool");o.setToolTip("Camera interactions"),o.setIcon("adsk-icon-camera"),o.saveAsDefault(),this.createCameraSubmenu(o,e),t.addControl(o),t.camerabutton=o}this.is3d=e},O.createOrbitSubmenu=function(e){var t=this.viewer.getToolbar().getControl(_.TOOLBAR.NAVTOOLSID),i=new a.Button("toolbar-freeOrbitTool");i.setToolTip("Free orbit"),i.setIcon("adsk-icon-orbit-free"),i.onClick=N(this,0,P),e.addControl(i),t.freeorbitbutton=i;var n=new a.Button("toolbar-orbitTool");n.setToolTip("Orbit"),n.setIcon("adsk-icon-orbit-constrained"),n.onClick=N(this,0,D),e.addControl(n),t.orbitbutton=n,e.onClick=n.onClick},O.createFitViewButton=function(e,t){var i=this.viewer,n=new a.Button("toolbar-fitToViewTool");return n.setToolTip("Fit to view"),n.setIcon("adsk-icon-fit-to-view"),n.onClick=function(){i.impl.fitToView(i.impl.selector.getAggregateSelection());Autodesk.Viewing.Private.analytics.track("viewer.fit_to_view",{from:"UI"});var e=i.getDefaultNavigationToolName();i.setActiveNavigationTool(e),t&&t.restoreDefault()},n.setDisplay(this.navActionDisplayMode("gotoview")),e.fittoviewbutton=n,n},O.createCameraSubmenu=function(e,t){var i=this,n=this.viewer,r=n.getToolbar().getControl(_.TOOLBAR.NAVTOOLSID);if((0,v.isTouchDevice)()){var o=new a.Button("toolbar-homeTool");o.setToolTip("Home"),o.setIcon("adsk-icon-home"),o.onClick=function(){n.navigation.setRequestHomeView(!0);var t=n.getDefaultNavigationToolName();i.activate(t),e.restoreDefault()},o.setDisplay(this.navActionDisplayMode("gotoview")),e.addControl(o),r.homebutton=o}if(e.addControl(this.createFitViewButton(r,e)),t){var s=new a.Button("toolbar-focalLengthTool");s.setToolTip("Focal length"),s.setIcon("adsk-icon-fov"),s.onClick=N(this,0,"fov"),s.setDisplay(this.navActionDisplayMode("fov")),e.addControl(s),r.fovbutton=s}var l=new a.Button("toolbar-rollTool");l.setToolTip("Roll"),l.setIcon("adsk-icon-roll"),l.onClick=N(this,0,L),l.setDisplay(this.navActionDisplayMode("roll")),e.addControl(l),r.rollbutton=l},O.onToolChanged=function(e){if("fov"===e.toolName&&this.showFocalLengthOverlay(e.active),e.active)switch(e.toolName){case"dolly":this.handleAltRelease("dollybutton");break;case"pan":this.handleAltRelease("panbutton");break;case"worldup":this.handleAltRelease("rollbutton");break;case"fov":this.handleAltRelease("fovbutton")}},O.onNavigationModeChanged=function(e){if(this.viewer.getDefaultNavigationToolName()===e.id){var t=this.viewer.getToolbar();if(!t)return;var i=t.getControl(_.TOOLBAR.NAVTOOLSID);if(!i)return;i.returnToDefault&&i.returnToDefault()}},O.handleAltRelease=function(e){var t=this.viewer.getToolbar();if(t){var i=t.getControl(_.TOOLBAR.NAVTOOLSID),n=i&&i[e];n&&n.setState(a.Button.State.ACTIVE)}},O.initFocalLengthOverlay=function(){const e=this.getDocument();var t=this.focallength=e.createElement("div");t.classList.add("message-panel"),t.classList.add("docking-panel"),t.classList.add("focal-length"),t.classList.add("docking-panel-container-solid-color-b");var i=e.createElement("table"),n=e.createElement("tbody");i.appendChild(n),t.appendChild(i),this.viewer.container.appendChild(t);var r=n.insertRow(-1),o=r.insertCell(0);o.classList.add("name"),o.setAttribute("data-i18n","Focal Length"),o.textContent=w.Z.t("Focal Length"),(o=r.insertCell(1)).classList.add("value"),o.textContent="",this.fovCell=o,t.style.visibility="hidden"},O.showFocalLengthOverlay=function(e){var t=this,i=this.viewer,n=0;function r(e){if(e){T.HudMessage.displayMessage(i.container,{msgTitleKey:"Orthographic View Set",messageKey:"The view is set to Orthographic",messageDefaultValue:"The view is set to Orthographic. Changing the focal length will switch to Perspective."})}else T.HudMessage.dismiss()}function o(e){e&&s(),t.focallength&&(t.focallength.style.visibility=e?"visible":"hidden")}function s(){var e=i.getFocalLength();n!==e&&(n=e,t.fovCell.textContent=e.toString()+" mm")}function a(){if(s(),"fov"===i.toolController.getActiveToolName()){var e=i.navigation.getCamera(),t=e&&!e.isPerspective;o(!t),r(t)}}var c=i.navigation.getCamera(),h=c&&!c.isPerspective;o(e&&!h),r(e&&h),e?i.addEventListener(l.CAMERA_CHANGE_EVENT,a):i.removeEventListener(l.CAMERA_CHANGE_EVENT,a)},O.unload=function(){return this._destroyUI(),!0},O._destroyUI=function(){var e=this.viewer,t=e.getToolbar();if(!t)return!0;var i=t.getControl(_.TOOLBAR.NAVTOOLSID);if(!i)return!0;function n(e){e&&(e.subMenu.removeEventListener(M.RadioButtonGroup.Event.ACTIVE_BUTTON_CHANGED,e.subMenuActiveButtonChangedHandler(i)),i.removeControl(e.getId()),e.onClick=null)}function r(e){e&&(i.removeControl(e.getId()),e.onClick=null)}return this.is3d&&(n(i.orbittoolsbutton),i.orbittoolsbutton=null,r(i.orbitbutton),i.orbitbutton=null,r(i.freeorbitbutton),i.freeorbitbutton=null,r(i.fovbutton),i.fovbutton=null),r(i.panbutton),i.panbutton=null,r(i.dollybutton),i.dollybutton=null,n(i.camerabutton),i.camerabutton=null,r(i.rollbutton),i.rollbutton=null,r(i.fittoviewbutton),i.fittoviewbutton=null,this.focallength&&(e.container.removeChild(this.focallength),this.focallength=null),e.removeEventListener(l.TOOL_CHANGE_EVENT,this.onToolChanged),this.onToolChanged=null,e.removeEventListener(l.NAVIGATION_MODE_CHANGED_EVENT,this.onNavigationModeChanged),this.onNavigationModeChanged=null,!0},O.activate=function(e){if(this.isActive(e))return!1;if(e===I)return this.viewer.impl.fitToView(this.viewer.impl.selector.getAggregateSelection()),!0;if(-1!=this.modes.indexOf(e)){const t=this.viewer.getDefaultNavigationToolName();return-1===this.modes.indexOf(t)&&this.viewer.activateDefaultNavigationTools(this.viewer.model.is2d()),this.viewer.setActiveNavigationTool(e),!0}return!1},O.deactivate=function(){return this.viewer.setActiveNavigationTool(),!0},O.isActive=function(e){return this.viewer.getActiveNavigationTool()===e};var k=i(79002);const F=Autodesk.Viewing.GlobalManagerMixin;class V extends k.ToolInterface{constructor(e){var t;super(),t=this,this.names=["explode"],this.viewer=e,this.setGlobalManager(this.viewer.globalManager),this.active=!1,this.activate=()=>{this.active=!0},this.deactivate=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e&&t.setScale(0),t.active=!1},this.isActive=()=>this.active}setScale(e){return this.viewer.explode(e)}getScale(){return this.viewer.getExplodeScale()}}F.call(V.prototype);var U=i(43644),B=i(49720);class z{constructor(e){this.ext=e;const t=e.viewer,i=new a.Button("toolbar-explodeTool");i.setIcon("adsk-icon-explode"),i.setToolTip("Explode model"),t.modelTools.addControl(i);let n,r=(0,U.stringToDOM)('<div class="docking-panel docking-panel-container-solid-color-b explode-submenu"><input class="explode-slider" type="range" min="0" max="1" step="0.01" value="0"/></div>');n=this.ext.getDocument().querySelector("#toolbar-explodeTool").parentNode,(0,v.isIOSDevice)()?r.classList.add("ios"):(0,v.isAndroidDevice)()&&r.classList.add("android"),n.appendChild(r),i.addEventListener(Autodesk.Viewing.UI.Control.Event.VISIBILITY_CHANGED,(function(e){e.isVisible?r.classList.add("visible"):r.classList.remove("visible")}));const o=r.querySelector(".explode-slider");o.addEventListener(v.isIE11?"change":"input",(function(){e.setScale(o.value)})),v.isIE11&&(o.style["padding-top"]="0",o.style["padding-bottom"]="0",o.style["margin-top"]="10px"),r.onclick=function(e){e.stopPropagation()};var s=i.container.querySelector(".adsk-control-tooltip");i.onClick=function(){e.isActive()?e.deactivate():(e.activate(),B.logger.track({category:"tool_changed",name:"explode"}))},this._slider=o,this._explodeButton=i,this._explodeSubmenu=r,this._tooltip=s,t.explodeSlider=o,t.explodeSubmenu=r,this._onExplode=this._onExplode.bind(this)}activate(){this._explodeSubmenu.classList.add("visible"),this._explodeButton.setState(a.Button.State.ACTIVE),this._tooltip.style.display="none";let e=this.ext.getScale();this._slider.value=e,this.ext.viewer.addEventListener(l.EXPLODE_CHANGE_EVENT,this._onExplode)}deactivate(){this._explodeButton.setState(a.Button.State.INACTIVE),this._hideSlider(this),this.ext.viewer.removeEventListener(l.EXPLODE_CHANGE_EVENT,this._onExplode)}destroy(){const e=this.ext.viewer;this._slider&&(this._explodeButton&&this._explodeButton.removeFromParent(),this._slider=null,this._explodeButton=null,this._explodeSubmenu=null,this._tooltip=null,e.explodeSlider=null,e.explodeSubmenu=null)}setUIEnabled(e){this._explodeButton&&(e?(this._explodeButton.setState(Autodesk.Viewing.UI.Button.State.INACTIVE),this._wasActive&&this.ext.activate()):(this._wasActive=this.ext.isActive(),this._hideSlider(this),this._explodeButton.setState(Autodesk.Viewing.UI.Button.State.DISABLED)))}_hideSlider(){this._explodeSubmenu.classList.remove("visible"),this._tooltip.style.display=""}_onExplode(e){this._slider.value=e.scale}}var G=Autodesk.Viewing.Private;class H extends r.Extension{constructor(e,t){super(e,t),this.viewer=e,this.options=t,this.name="explode",this.tool=null,this.explodeUI=null}load(){return this.tool=new V(this.viewer),this.viewer.toolController.registerTool(this.tool,this.setActive.bind(this)),!0}unload(){return this.deactivate(),this.explodeUI&&(this.explodeUI.destroy(),this.explodeUI=null),this.viewer.toolController.deregisterTool(this.tool),this.tool=null,!0}onToolbarCreated(e){this.explodeUI=new z(this,e)}activate(){return!!this.isActive()||!!this.explodeUI&&(this.explodeUI.activate(),this.viewer.toolController.activateTool("explode"),!0)}deactivate(){return!this.isActive()||(!this.explodeUI||(this.explodeUI.deactivate(),this.viewer.toolController.deactivateTool("explode"),!0))}isActive(){return this.tool.isActive()}getScale(){return this.tool.getScale()}setScale(e){return this.tool.setScale(e)}setStrategy(e){e!==this.getStrategy()&&this.viewer.prefs.set(G.Prefs3D.EXPLODE_STRATEGY,e)}getStrategy(){return this.viewer.prefs.get(G.Prefs3D.EXPLODE_STRATEGY)}setUIEnabled(e){this.explodeUI.setUIEnabled(e),e||this.tool.deactivate(!1)}}function W(e,t){r.Extension.call(this,e,t),this.viewer=e,this.options=t,this.name="fullscreen"}W.prototype=Object.create(r.Extension.prototype),W.prototype.constructor=W;var j=W.prototype;function X(e,t){r.Extension.call(this,e,t),this.viewer=e,this.options=t,this.name="gohome"}j.activate=function(){return this.activeStatus||(this.viewer.nextScreenMode(),this.activeStatus=!0),!0},j.deactivate=function(){return this.activeStatus&&(this.viewer.escapeScreenMode(),this.activeStatus=!1),!0},X.prototype=Object.create(r.Extension.prototype),X.prototype.constructor=X;var q=X.prototype;q.activate=function(){return this.viewer.navigation.setRequestHomeView(!0),!0},q.deactivate=function(){return!1};var Y=i(76052);const K=Autodesk.Viewing,Z=['<div class="orbit-gizmo noselect">','<div class="outside"></div>','<div class="ring"></div>','<div class="layout-hor">','<div class="edgemark-area"><div class="edgemark"></div></div>',"</div>",'<div class="layout-mid">','<div class="layout-ver">','<div class="edgemark-area"><div class="edgemark"></div></div>',"</div>",'<div class="circle">','<div class="crosshair-area">','<div class="crosshair-v"></div>','<div class="crosshair-h"></div>',"</div>","</div>",'<div class="layout-ver">','<div class="edgemark-area"><div class="edgemark"></div></div>',"</div>","</div>",'<div class="layout-hor">','<div class="edgemark-area"><div class="edgemark"></div></div>',"</div>","</div>"].join("\n");function Q(){var e,t,i,n,r,o=["fusion orbit","fusion orbit constrained"],s=0,a=1,l=2,c=.005,h=.005,u=1,d={},p=(0,v.isTouchDevice)(),f=!1,m={buttons:[],src:void 0,x:0,y:0,dx:0,dy:0,firstMove:!0,mode:void 0},g=this;this.setViewer=function(e){this.viewer=e,this.navapi=e?e.navigation:null,e&&this.setGlobalManager(e.globalManager)};var y=function(e){m.buttons[e.touches?0:e.button]=!0,m.src=e.target.className,m.x=0,m.y=0,m.dx=0,m.dy=0,m.firstMove=!0,m.mode=void 0,"ring"===m.src?m.mode=l:"edgemark-area"===m.src&&("layout-ver"===e.target.parentNode.className?m.mode=s:"layout-hor"===e.target.parentNode.className&&(m.mode=a)),S(),e.stopPropagation()},b=function(e){m.buttons[e.touches?0:e.button]=!1,m.src=void 0},x=function(e){m.buttons[0]&&(_(e),E(),m.firstMove=!1)},_=function(e){var t=e.touches?e.touches[0].pageX:e.pageX,i=e.touches?e.touches[0].pageY:e.pageY;m.firstMove||(m.dx=t-m.x,m.dy=i-m.y),m.x=t,m.y=i},E=function(){switch(m.mode){case l:if(!g.navapi.isActionEnabled("roll"))return;break;case s:case a:if(!g.navapi.isActionEnabled("orbit"))return}var e=r.target.clone().sub(r.position).normalize(),t=e.clone().cross(r.up).normalize(),i=t.clone().cross(e).normalize();if(r.up.copy(i),m.mode===l){var o=new THREE.Vector3(m.x-d.center.x,m.y-d.center.y,0),p=new THREE.Vector3(m.dx,m.dy,0).add(o);o.normalize(),p.normalize();var f=o.clone().cross(p),v=Math.asin(f.z);r.up.applyAxisAngle(e,-v*u)}else{var y,b;m.mode===s?(b=-m.dx*c,n&&(r.up=Y.Navigation.snapToAxis(r.up.clone())),y=r.up):m.mode===a&&(b=-m.dy*h,n?(m.firstMove&&(r.up=Y.Navigation.snapToAxis(r.up.clone())),y=e.clone().cross(r.up).normalize()):y=t,r.up.applyAxisAngle(y,b));var x=g.navapi.getPivotPoint(),_=r.position.clone().sub(x);_.applyAxisAngle(y,b),r.position.addVectors(x,_);var E=r.target.clone().sub(x);E.applyAxisAngle(y,b),r.target.addVectors(x,E)}r.dirty=!0},A=function(e,t){var i=t||e.clone().sub(r.position).normalize();return new THREE.Plane(i,-i.x*e.x-i.y*e.y-i.z*e.z)},S=function(){var e=r.target.clone().sub(r.position).normalize(),t=A(r.position,e).distanceToPoint(r.pivot);r.pivot.copy(e).multiplyScalar(t).add(r.position)},w=function(e){e.touches||0!==e.button||S()},M=function(){f&&g.viewer.setActiveNavigationTool()},T=function(e,t){var i,n=g.viewer.impl.hitTest(e,t);if(n&&n.intersectPoint)i=n.intersectPoint;else{var o=g.viewer.impl.viewportToRay(g.viewer.impl.clientToViewport(e,t));i=new THREE.Vector3,o.intersectPlane(A(r.target),i)}var s=r.position.clone().sub(function(){var e=r.target.clone().sub(r.position).normalize(),t=g.viewer.impl.rayIntersect(new THREE.Ray(r.position,e));return t&&t.intersectPoint?t.intersectPoint:r.target}()).add(i);g.navapi.setRequestTransition(!0,s,i,r.fov)};this.register=function(){(e=(0,U.stringToDOM)(Z)).style.display="none",this.viewer.canvasWrap.insertBefore(e,this.viewer.canvasWrap.firstChild),(t=e.querySelector(".ring")).addEventListener("mousedown",y),Array.prototype.forEach.call(e.querySelectorAll(".edgemark-area"),(function(e){e.addEventListener("mousedown",y),p&&e.addEventListener("touchstart",y)})),this.addWindowEventListener("mouseup",b),this.addWindowEventListener("mousemove",x),(i=e.querySelector(".outside")).addEventListener("mousedown",M);var n=e.querySelector(".circle");n.addEventListener("mousedown",w),p&&(t.addEventListener("touchstart",y),this.addWindowEventListener("touchend",b),this.addWindowEventListener("touchmove",x),i.addEventListener("touchstart",M),n.addEventListener("touchstart",w)),r=this.viewer.impl.camera},this.deregister=function(){this.removeWindowEventListener("mouseup",b),this.removeWindowEventListener("mousemove",x),i.removeEventListener("mousedown",M),p&&(this.removeWindowEventListener("touchend",b),this.removeWindowEventListener("touchmove",x),i.removeEventListener("touchstart",M)),this.viewer.canvasWrap.removeChild(e),e=void 0,t=void 0,i=void 0},this.activate=function(t){e.style.display="",this.handleResize(),n="fusion orbit constrained"===t;var i=this.viewer.toolController.isToolActivated("hyperlink");i&&this.viewer.toolController.deactivateTool("hyperlink"),n?(this.viewer.setDefaultNavigationTool("orbit"),this.viewer.prefs.set("fusionOrbitConstrained",!0)):(this.viewer.setDefaultNavigationTool("freeorbit"),this.viewer.prefs.set("fusionOrbitConstrained",!1)),i&&this.viewer.toolController.activateTool("hyperlink"),this.viewer.navigation.setZoomTowardsPivot(!0)},this.deactivate=function(){e.style.display="none",this.viewer.navigation.setZoomTowardsPivot(this.viewer.prefs.get("zoomTowardsPivot"))},this.getNames=function(){return o},this.getName=function(){return o[0]},this.update=function(){return!1},this.handleSingleClick=function(e){return T(e.canvasX,e.canvasY),!0},this.handleDoubleClick=function(){return!0},this.handleSingleTap=function(e){return T(e.canvasX,e.canvasY),!0},this.handleDoubleTap=function(){return!1},this.handleKeyDown=function(){return!1},this.handleKeyUp=function(){return!1},this.handleWheelInput=function(){return!1},this.handleButtonDown=function(){return!1},this.handleButtonUp=function(){return!1},this.handleMouseMove=function(e){var t=this.viewer.impl.getCanvasBoundingClientRect(),n=(t.width>t.height?new THREE.Vector2(((e.canvasX+.5)/t.width*2-1)*t.width/t.height,-(e.canvasY+.5)/t.height*2+1):new THREE.Vector2((e.canvasX+.5)/t.width*2-1,(-(e.canvasY+.5)/t.height*2+1)*t.height/t.width)).length()>1.2;return f!==n&&(i.style.cursor=n?"":"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAt1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAzMzP6+vri4uISEhKKioqtra2dnZ2EhIR9fX10dHRkZGQdHR3t7e3Hx8e5ubm1tbWoqKhWVlZKSko4ODgICAjv7+/o6OjMzMyxsbFOTk4pKSkXFxcEBAT29vbW1tZ6enpISEgLCwvhzeX+AAAAGXRSTlMANRO0nHRJHfnskIxQRKh89syDVwTWZjEJxPFEswAAAOFJREFUKM+1j+lygkAQhIflEAJe0Rw9u4CCeKKoSTTX+z9XoMJWWeX+ssrvZ3f19DQ5zOw/0DUMQPlmQ72bE2adBp8/Rp3CQUi3ILx+bxj4fjDs9T1Bmo6bbPPN8aDU4bjJt4nb+de789kSFyxn826jW3ICLNZZKU8nWWbrBTCRVm04U8TpjquRFf1Go0d7l8aYOrUR7FGEFr1S9LGymwthgX2gE/Kl0cHPOtF2xOWZ5QpIC93RflW4InkDoPRXesd5LJIMQPzV7tCMa7f6BvhJL79AVDmYTNQ1NhnxbI/uwB8H5Bjd4zQPBAAAAABJRU5ErkJggg==), auto",f=n),!1},this.handleGesture=function(){return S(),!1},this.handleBlur=function(){return!1},this.handleResize=function(){var i=e.getBoundingClientRect();const n=this.getWindow();d.left=i.left+n.pageXOffset,d.top=i.top+n.pageYOffset,d.width=i.width,d.height=i.height,d.center={},d.center.x=d.left+d.width/2,d.center.y=d.top+d.height/2;var r=.8*(n.innerWidth>n.innerHeight?n.innerHeight:n.innerWidth);e.style.width=e.style.height=r+"px",e.style.top=e.style.left="calc(50% - "+r/2+"px)",t.style.borderWidth=.1*r+"px"}}K.GlobalManagerMixin.call(Q.prototype);const J="fusionfreeorbit",$="fusionorbit";function ee(e,t){r.Extension.call(this,e,t),this.name=$,this.modes=[$,J]}ee.prototype=Object.create(r.Extension.prototype),ee.prototype.constructor=ee;var te=ee.prototype;te.load=function(){var e=this.viewer;return this.tool=new Q,this.tool.setViewer(e),e.toolController.registerTool(this.tool),this._onToolChanged=this._onToolChanged.bind(this),!0},te._updateActiveState=function(e,t){this.activeStatus=e,this.mode=t},te._onToolChanged=function(e){if("fusion orbit constrained"===e.toolName||"fusion orbit"===e.toolName){const t=this._toolbar.getControl(_.TOOLBAR.NAVTOOLSID),i="fusion orbit"===e.toolName?t.freeorbitbutton:t.orbitbutton,n=e.active?a.Button.State.ACTIVE:a.Button.State.INACTIVE;i.setState(n),this._updateActiveState(!n)}},te.onToolbarCreated=async function(e){var t=this,i=this.viewer,n=e.getControl(_.TOOLBAR.NAVTOOLSID);n&&n.orbitbutton||await i.loadExtension("Autodesk.DefaultTools.NavTools",i.config),this._toolbar=e,this.viewer.addEventListener(Autodesk.Viewing.TOOL_CHANGE_EVENT,this._onToolChanged),this.classicBehavior={},this.classicBehavior.orbitOnClick=n.orbitbutton.onClick,this.classicBehavior.freeorbitOnClick=n.freeorbitbutton.onClick,this.classicBehavior.returnToDefault=n.returnToDefault,n.freeorbitbutton.onClick=function(){var e=n.freeorbitbutton.getState();e===a.Button.State.INACTIVE?t.activate(J):e===a.Button.State.ACTIVE&&t.deactivate()},n.orbitbutton.onClick=function(){var e=n.orbitbutton.getState();e===a.Button.State.INACTIVE?t.activate($):e===a.Button.State.ACTIVE&&t.deactivate()},n.returnToDefault=function(){n.orbittoolsbutton&&n.orbittoolsbutton.setState(a.Button.State.ACTIVE)},n.orbittoolsbutton.setState(a.Button.State.INACTIVE),i.prefs.get("fusionOrbitConstrained")?(n.orbittoolsbutton.onClick=n.orbitbutton.onClick,n.orbittoolsbutton.setIcon(n.orbitbutton.iconClass),i.setDefaultNavigationTool("orbit")):(n.orbittoolsbutton.onClick=n.freeorbitbutton.onClick,n.orbittoolsbutton.setIcon(n.freeorbitbutton.iconClass),i.setDefaultNavigationTool("freeorbit")),i.setActiveNavigationTool(),n.returnToDefault&&n.returnToDefault()},te.unload=function(){var e=this.viewer;if(e.removeEventListener(Autodesk.Viewing.TOOL_CHANGE_EVENT,this._onToolChanged),this.classicBehavior){var t=e.getToolbar().getControl(_.TOOLBAR.NAVTOOLSID);t&&(t.orbitbutton&&(t.orbitbutton.onClick=this.classicBehavior.orbitOnClick),t.freeorbitbutton&&(t.freeorbitbutton.onClick=this.classicBehavior.freeorbitOnClick),t.returnToDefault=this.classicBehavior.returnToDefault,t.orbittoolsbutton&&(t.orbitbutton?t.orbittoolsbutton.onClick=t.orbitbutton.onClick:t.orbittoolsbutton.onClick=null,t.orbittoolsbutton.setIcon("adsk-icon-orbit-constrained"),t.orbittoolsbutton.setState(a.Button.State.ACTIVE))),this.classicBehavior=null}return e.setActiveNavigationTool("orbit"),e.setDefaultNavigationTool("orbit"),e.toolController.deregisterTool(this.tool),this.tool.setViewer(null),this.tool=null,this._toolbar=null,!0},te.activate=function(e){if(!this.isActive(e)){switch(e){default:case $:this.viewer.setActiveNavigationTool("fusion orbit constrained"),this.mode=$;break;case J:this.viewer.setActiveNavigationTool("fusion orbit"),this.mode=J}return this.activeStatus=!0,!0}},te.deactivate=function(){return this.activeStatus&&(this.viewer.setActiveNavigationTool(),this.activeStatus=!1),!0},n.theExtensionManager.registerExtension("Autodesk.PropertiesManager",h),n.theExtensionManager.registerExtension("Autodesk.ViewerSettings",f),n.theExtensionManager.registerExtension("Autodesk.ModelStructure",b),n.theExtensionManager.registerExtension("Autodesk.DefaultTools.NavTools",R),n.theExtensionManager.registerExtension("Autodesk.Explode",H),n.theExtensionManager.registerExtension("Autodesk.FullScreen",W),n.theExtensionManager.registerExtension("Autodesk.GoHome",X),n.theExtensionManager.registerExtension("Autodesk.Viewing.FusionOrbit",ee)},74232:e=>{e.exports={externalExtensions:[{src:"./extensions/WebGLTools/index.js",ids:["Autodesk.WebGLTools.ObjectCounter"]},{src:"./extensions/Wireframes/Wireframes.js",ids:["Autodesk.Viewing.Wireframes"]},{src:"./extensions/ZoomWindow/ZoomWindow.js",ids:["Autodesk.Viewing.ZoomWindow"]},{src:"./extensions/AEC/LibraryExports.js",ids:["Autodesk.AEC.LevelsExtension","Autodesk.AEC.HyperlinkExtension","Autodesk.AEC.DropMeExtension","Autodesk.AEC.CanvasBookmarkExtension","Autodesk.AEC.Minimap3DExtension","Autodesk.AEC.LocationsExtension","Autodesk.AEC.Hypermodeling","Autodesk.AEC.ViewportsExtension","Autodesk.AEC.DisciplinesExtension"]},{src:"./extensions/Pushpins/PushPinExtension.js",ids:["Autodesk.BIM360.Extension.PushPin"]},{src:"./extensions/Hyperlink/Hyperlink.js",ids:["Autodesk.Hyperlink"]},{src:"./extensions/Debug/Debug.js",ids:["Autodesk.Debug"]},{src:"./extensions/BimWalk/BimWalk.js",ids:["Autodesk.BimWalk"]},{src:"./extensions/Section/Section.js",ids:["Autodesk.Section"]},{src:"./extensions/CompGeom/index.js",ids:["Autodesk.CompGeom"]},{src:"./extensions/Snapping/index.js",ids:["Autodesk.Snapping"]},{src:"./extensions/Beeline/Beeline.js",ids:["Autodesk.Beeline"]},{src:"./extensions/FirstPerson/FirstPerson.js",ids:["Autodesk.FirstPerson"]},{src:"./extensions/webVR/webVR.js",ids:["Autodesk.Viewing.WebVR"]},{src:"./extensions/WebXR/index.js",ids:["Autodesk.WebXR.Core","Autodesk.WebXR.VR","Autodesk.WebXR.AR"]},{src:"./extensions/CAM360/CAM360.js",ids:["Autodesk.CAM360"]},{src:"./extensions/Collaboration/Collaboration.js",ids:["Autodesk.Viewing.Collaboration"]},{src:"./extensions/FusionSim/FusionSim.js",ids:["Autodesk.Fusion360.Simulation"]},{src:"./extensions/OMV/OMV.js",ids:["Autodesk.OMV"]},{src:"./extensions/SplitScreen/SplitScreen.js",ids:["Autodesk.SplitScreen"]},{src:"./extensions/CrossFadeEffects/CrossFadeEffects.js",ids:["Autodesk.CrossFadeEffects"]},{src:"./extensions/Edit2D/Edit2D.js",ids:["Autodesk.Edit2D"]},{src:"./extensions/Edit3D/Edit3D.js",ids:["Autodesk.Edit3D"]},{src:"./extensions/VisualClusters/VisualClusters.js",ids:["Autodesk.VisualClusters"]},{src:"./extensions/Moldflow/Moldflow.js",ids:["Autodesk.Moldflow"]},{src:"./extensions/PixelCompare/PixelCompare.js",ids:["Autodesk.Viewing.PixelCompare"]},{src:"./extensions/ScalarisSimulation/ScalarisSimulation.js",ids:["Autodesk.Viewing.ScalarisSimulation"]},{src:"./extensions/Measure/Measure.js",ids:["Autodesk.Measure"]},{src:"./extensions/Markup/Markup.js",ids:["Autodesk.Viewing.MarkupsCore","Autodesk.Viewing.MarkupsGui"]},{src:"./extensions/PDF/index.js",ids:["Autodesk.PDF"]},{src:"./extensions/ReCap/index.js",ids:["Autodesk.ReCap"]},{src:"./extensions/Scalaris/index.js",ids:["Autodesk.Scalaris"]},{src:"./extensions/DocumentBrowser/index.js",ids:["Autodesk.DocumentBrowser"]},{src:"./extensions/Geolocation/index.js",ids:["Autodesk.Geolocation"]},{src:"./extensions/Fusion360/AnimationExtension.js",ids:["Autodesk.Fusion360.Animation"]},{src:"./extensions/NPR/index.js",ids:["Autodesk.NPR"]},{src:"./extensions/DOF/DOFExtension.js",ids:["Autodesk.DOF"]},{src:"./extensions/MSDF/index.js",ids:["Autodesk.MSDF"]},{src:"./extensions/MemoryLimited/MemoryLimited.js",ids:["Autodesk.MemoryLimited"]},{src:"./extensions/ViewCubeUi/ViewCubeUi.js",ids:["Autodesk.ViewCubeUi"]},{src:"./extensions/MemoryLimitedDebug/MemoryManager.js",ids:["Autodesk.Viewing.MemoryLimitedDebug"]},{src:"./extensions/BimMarkups/BimMarkups.js",ids:["Autodesk.BIM360.Markups"]},{src:"./extensions/Minimap2D/Minimap2D.js",ids:["Autodesk.BIM360.Minimap"]},{src:"./extensions/GestureDocumentNavigation/GestureDocumentNavigation.js",ids:["Autodesk.BIM360.GestureDocumentNavigation"]},{src:"./extensions/RollCamera/RollCamera.js",ids:["Autodesk.BIM360.RollCamera"]},{src:"./extensions/LayerManager/LayerManager.js",ids:["Autodesk.LayerManager"]},{src:"./extensions/SceneBuilder/sceneBuilder.js",ids:["Autodesk.Viewing.SceneBuilder"]},{src:"./extensions/Popout/index.js",ids:["Autodesk.Viewing.Popout"]},{src:"./extensions/ProfileUi/index.js",ids:["Autodesk.ProfileUi"]},{src:"./extensions/PropertySearch/PropertySearch.js",ids:["Autodesk.PropertySearch"]},{src:"./extensions/StandardSurface/index.js",ids:["Autodesk.StandardSurface"]},{src:"./extensions/MaterialConverterPrism/index.js",ids:["Autodesk.Viewing.MaterialConverterPrism"]},{src:"./extensions/DWF/index.js",ids:["Autodesk.DWF"]},{src:"./extensions/ModelsPanel/index.js",ids:["Autodesk.ModelsPanel"]},{src:"./extensions/ModelAlignment/index.js",ids:["Autodesk.ModelAlignment","Autodesk.SheetAlignment"],dependencies:["Autodesk.Edit3D"]},{src:"./extensions/ModelAlignmentService/ModelAlignmentService.js",ids:["Autodesk.ModelAlignmentService"]},{src:"./extensions/MixpanelProvider/index.js",ids:["Autodesk.Viewing.MixpanelExtension"]},{src:"./extensions/Crop/Crop.js",ids:["Autodesk.Crop"]},{src:"./extensions/DataVisualization/index.js",ids:["Autodesk.DataVisualization"]},{src:"./extensions/ExtensionsPanel/index.js",ids:["Autodesk.ExtensionsPanel"]},{src:"./extensions/StringExtractor/StringExtractor.js",ids:["Autodesk.StringExtractor"]},{src:"./extensions/ModelSheetTransition/ModelSheetTransition.js",ids:["Autodesk.ModelSheetTransition"]},{src:"./extensions/BoxSelection/BoxSelectionExtension.js",ids:["Autodesk.BoxSelection"]},{src:"./extensions/glTF/index.js",ids:["Autodesk.glTF"]},{src:"./extensions/PropertyQuery/index.js",ids:["Autodesk.PropertyQuery"]},{src:"./extensions/VaultPrintUI/index.js",ids:["Autodesk.Vault.Print"]},{src:"./extensions/VaultMarkupsUI/index.js",ids:["Autodesk.Vault.Markups"],dependencies:["Autodesk.BIM360.Markups"]},{src:"./extensions/ThreeJSOverlays/index.js",ids:["Autodesk.ThreeJSOverlays"]},{src:"./extensions/DataExchange/DataExchange.js",ids:["Autodesk.DataExchange"]},{src:"./extensions/Multipage/Multipage.js",ids:["Autodesk.Multipage"]},{src:"./extensions/DynamicDimensions/DynamicDimensions.js",ids:["Autodesk.DynamicDimensions"]},{src:"./extensions/Filter/index.js",ids:["Autodesk.Filter"],buildConfig:"./extensions/Filter/webpack.config.js"},{src:"./extensions/Grid/Grid.js",ids:["Autodesk.Grid"]},{src:"./extensions/SmartSection/index.js",ids:["Autodesk.SmartSection"]}],getExtensionEntryKey:function(e){return e.src.split("/")[2]}}},86783:(e,t,i)=>{"use strict";i.r(t);var n=i(9749),r=i(74232);r.externalExtensions.forEach((e=>{let t=(0,r.getExtensionEntryKey)(e),i=`extensions/${t}/${t}.min.js`,o=e.dependencies;e.ids.forEach((e=>{n.theExtensionManager.registerExternalExtension(e,i,o)}))})),n.theExtensionManager.registerExternalExtension("Autodesk.DiffTool","extensions/DiffTool/DiffTool.min.js")},36291:(e,t,i)=>{"use strict";i.r(t),i.d(t,{analytics:()=>o});var n=i(49720),r=i(19531);const o=new class{constructor(){this.providerMap={},this.instances=[],this.superProps={},this.shouldTrack=!0,this.trackCache=[],this.oneTimers={}}registerProvider(e){if(!e)return void n.logger.error("Undefined provider");if(!e.name)return void n.logger.error("missing provider name");const t=e.name.toLowerCase();t in this.providerMap?n.logger.warn(`Provider with name ${e.name} already registered`):this.providerMap[t]=e;const i=this.createInstance(e.name,e.defaultOptions);this.instances.push(i),this.shouldTrack&&this.init(i),this.trackCache.length>0&&(this.trackCache.forEach((e=>{let{event:t,properties:i}=e;this.track(t,i)})),this.trackCache=[])}init(e){e.initialized||(e.init(),e.register(this.superProps))}createInstance(e,t){const i=e&&e.toLowerCase();if(!(i in this.providerMap))return void n.logger.error(`Unknown ${e}`);const o=this.providerMap[i],s=new o(t);if(!(s instanceof r.AnalyticsProviderInterface))throw new Error("not an analytics provider");return o.instanceCount=o.instanceCount||0,s.name=`${i}-${o.instanceCount}`,o.instanceCount++,s}optIn(e){this.instances.forEach((e=>this.init(e))),this._callMethod("optIn",e),this.shouldTrack=!0}optOut(e){this._callMethod("optOut",e),this.shouldTrack=!1}hasOptedOut(){return this._callMethod("hasOptedOut")}getDistinctId(){return this._callMethod("getDistinctId")}track(e,t,i){if(this.shouldTrack){if(i){const i={event:e,properties:t};try{const e=JSON.stringify(i);if(this.oneTimers[e])return;this.oneTimers[e]=!0}catch(e){}}0===this.instances.length?this.trackCache.push({event:e,properties:t}):this._callMethod("track",e,t)}}identify(e){this._callMethod("identify",e)}_callMethod(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const n=t[0],r=t.slice(1,t.length);return this.instances.map((e=>({name:e.name,value:e[n](...r)})))}}},19531:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AnalyticsProviderInterface:()=>n});class n{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=e}init(){}register(){}static get name(){return null}static get defaultOptions(){return{}}optIn(e){}optOut(e){}hasOptedOut(){}getDistinctId(){}track(e,t){}identify(e){}}},37231:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Animation:()=>r,interpolateCatmullRom:()=>o});var n=i(35787);function r(e,t,i){this.root=e,this.handler=i.animationHandler,this.data=this.handler.init(t),this.hierarchy=this.handler.parse(e),this.viewer=i.viewer,this.animator=i,this.currentTime=0,this.timeScale=1,this.isPlaying=!1,this.isPaused=!0,this.loop=!1,this.delta=.5,this.interpolationType=n.u.LINEAR,this.setStartAndEndKeyTime()}function o(e,t){function i(e,t,i,n,r,o,s){var a=.5*(i-e),l=.5*(n-t);return(2*(t-i)+a+l)*s+(-3*(t-i)-2*a-l)*o+a*r+t}var n,r,o,s,a,l,c,h,u,d=[],p=[];return o=(n=(e.length-1)*t)-(r=Math.floor(n)),d[0]=0===r?r:r-1,d[1]=r,d[2]=r>e.length-2?r:r+1,d[3]=r>e.length-3?r:r+2,l=e[d[0]],c=e[d[1]],h=e[d[2]],u=e[d[3]],a=o*(s=o*o),p[0]=i(l[0],c[0],h[0],u[0],o,s,a),p[1]=i(l[1],c[1],h[1],u[1],o,s,a),p[2]=i(l[2],c[2],h[2],u[2],o,s,a),p}i(27293).GlobalManagerMixin.call(r.prototype),r.prototype.setStartAndEndKeyTime=function(){if(this.data.hierarchy.length>0){var e=this.data.hierarchy[0].keys;this.startKeyTime=e[0].time,this.endKeyTime=e[e.length-1].time}else this.startKeyTime=this.endKeyTime=0},r.prototype.keyTypes=[],r.prototype.defaultKey={},r.prototype.play=function(e){this.currentTime=void 0!==e?e:0,this.isPlaying=!0,this.isPaused=!1,this.reset(),this.handler.play(this)},r.prototype.pause=function(){!0===this.isPaused?this.handler.play(this):this.handler.stop(this),this.isPaused=!this.isPaused},r.prototype.stop=function(){this.isPlaying=!1,this.isPaused=!1,this.handler.stop(this)},r.prototype.goto=function(e){this.isPlaying||this.play(),this.isPaused||this.pause();var t=e-this.currentTime;this.update(t)},r.prototype.reset=function(){for(var e=0,t=this.hierarchy.length;e<t;e++){var i=this.hierarchy[e];void 0===i.animationCache&&(i.animationCache={}),void 0===i.animationCache[this.data.name]&&(i.animationCache[this.data.name]={prevKey:this.defaultKey,nextKey:this.defaultKey,originalMatrix:i.matrix});for(var n=i.animationCache[this.data.name],r=0;r<this.keyTypes.length;r++){for(var o=this.keyTypes[r],s=this.data.hierarchy[e].keys[0],a=this.getNextKeyWith(o,e,1);a.time<this.currentTime&&a.index>s.index;)s=a,a=this.getNextKeyWith(o,e,a.index+1);n.prevKey[o]=s,n.nextKey[o]=a}}this.setStartAndEndKeyTime()},r.prototype.getNextKeyWith=function(e,t,i){var r=this.data.hierarchy[t].keys;for(this.interpolationType===n.u.CATMULLROM||this.interpolationType===n.u.CATMULLROM_FORWARD?i=i<r.length-1?i:r.length-1:i%=r.length;i<r.length;i++)if(void 0!==r[i][e])return r[i];return this.data.hierarchy[t].keys[0]},r.prototype.getPrevKeyWith=function(e,t,i){var r=this.data.hierarchy[t].keys;for(i=this.interpolationType===n.u.CATMULLROM||this.interpolationType===n.u.CATMULLROM_FORWARD?i>0?i:0:i>=0?i:i+r.length;i>=0;i--)if(void 0!==r[i][e])return r[i];return this.data.hierarchy[t].keys[r.length-1]},r.prototype.isPlayingOutOfRange=function(){return!1===this.isPaused&&(this.currentTime<this.startKeyTime-this.delta||this.currentTime>this.endKeyTime+this.delta)},r.prototype.resetIfLooped=function(){!0===this.loop&&this.currentTime>this.endKeyTime&&(this.currentTime%=this.endKeyTime,this.reset())}},35787:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});const n={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2}},86788:(e,t,i)=>{"use strict";function n(){this.animations=[]}i.r(t),i.d(t,{KeyFrameAnimator:()=>y}),n.prototype.init=function(e){if(!0===e.initialized)return e;for(var t=0;t<e.hierarchy.length;t++){for(var i=0;i<e.hierarchy[t].keys.length;i++)if(e.hierarchy[t].keys[i].time<0&&(e.hierarchy[t].keys[i].time=0),void 0!==e.hierarchy[t].keys[i].rot&&!(e.hierarchy[t].keys[i].rot instanceof THREE.Quaternion)){var n=e.hierarchy[t].keys[i].rot;Array.isArray(n)||(n=[n._x,n._y,n._z,n._w]),e.hierarchy[t].keys[i].rot=(new THREE.Quaternion).fromArray(n)}for(let i=1;i<e.hierarchy[t].keys.length;i++)e.hierarchy[t].keys[i].time===e.hierarchy[t].keys[i-1].time&&(e.hierarchy[t].keys.splice(i,1),i--);for(let i=0;i<e.hierarchy[t].keys.length;i++)e.hierarchy[t].keys[i].index=i}return e.initialized=!0,e},n.prototype.parse=function(e){var t=[];return function e(t,i){if(i.push(t),t.children&&!(t instanceof THREE.Camera))for(var n=0;n<t.children.length;n++)e(t.children[n],i)}(e,t),t},n.prototype.play=function(e){-1===this.animations.indexOf(e)&&this.animations.push(e)},n.prototype.stop=function(e){var t=this.animations.indexOf(e);-1!==t&&this.animations.splice(t,1)},n.prototype.update=function(e){for(var t=0;t<this.animations.length;t++)this.animations[t].update(e)};var r,o,s,a=i(99946),l=i(41434),c=i(35787),h=i(37231);function u(e,t,i){h.Animation.call(this,e,t,i),this.followCam=!0}function d(e,t,i){let n;h.Animation.call(this,{},e,i),this.fragPointers=[],this.nodeChildren=[],this.nodeFragments=[];const r=this.viewer.model.getData().instanceTree;r.enumNodeChildren(t,(e=>{this.nodeChildren.push(e)}),!0),r.enumNodeFragments(e.id,(e=>{this.nodeFragments.push(e),n=this.viewer.getFragmentProxy(this.viewer.model,e),n&&(this.fragPointers.push(n),n.setMaterial(this.viewer.matman().cloneMaterial(n.getMaterial(),this.viewer.model)))}),!0),this.nodeId=t,this.epsilon=.1}u.prototype=Object.create(h.Animation.prototype),u.prototype.constructor=u,u.prototype.keyTypes=["pos","up","target","fov","perspective"],u.prototype.defaultKey={pos:0,up:0,target:0,fov:0,perspective:0},u.prototype.setFollowCamera=function(e){this.followCam=e},u.prototype.update=(r=[],o=new l.Vector3,s=new l.Vector3,function(e){if(!1!==this.isPlaying&&(this.currentTime+=e*this.timeScale,this.resetIfLooped(),this.followCam&&!this.isPlayingOutOfRange())){for(var t=0,i=this.hierarchy.length;t<i;t++){for(var n=this.hierarchy[t],a=n.animationCache[this.data.name],l=0;l<this.keyTypes.length;l++){var u=this.keyTypes[l],d=a.prevKey[u],p=a.nextKey[u];if(p.time<=this.currentTime||d.time>=this.currentTime){for(d=this.data.hierarchy[t].keys[0],p=this.getNextKeyWith(u,t,1);p.time<this.currentTime&&p.index>d.index;)d=p,p=this.getNextKeyWith(u,t,p.index+1);a.prevKey[u]=d,a.nextKey[u]=p}var f=d[u],m=p[u];if(p.time!==d.time&&void 0!==f&&void 0!==m){var g,v=(this.currentTime-d.time)/(p.time-d.time);if(v<0&&(v=0),v>1&&(v=1),"pos"===u)g=n.position;else if("up"===u)g=n.up;else if("target"===u)g=n.target;else{if("fov"===u){n.setFov(f+(m-f)*v);continue}if("perspective"===u){(v>.5?m:f)?n.toPerspective():n.toOrthographic();continue}}if(this.interpolationType===c.u.LINEAR)s.x=f[0]+(m[0]-f[0])*v,s.y=f[1]+(m[1]-f[1])*v,s.z=f[2]+(m[2]-f[2])*v,g.copy(s);else{r[0]=this.getPrevKeyWith(u,t,d.index-1)[u],r[1]=f,r[2]=m,r[3]=this.getNextKeyWith(u,t,p.index+1)[u],v=.33*v+.33;var y=(0,h.interpolateCatmullRom)(r,v);if(s.x=y[0],s.y=y[1],s.z=y[2],g.copy(s),this.interpolationType===c.u.CATMULLROM_FORWARD){var b=(0,h.interpolateCatmullRom)(r,1.01*v);o.set(b[0],b[1],b[2]),o.sub(g),o.y=0,o.normalize();var x=Math.atan2(o.x,o.z);n.rotation.set(0,x,0)}}}}n.matrixAutoUpdate=!0,n.matrixWorldNeedsUpdate=!0}n.lookAt(n.target),this.animator.updateFlag|=this.animator.UPDATE_CAMERA}}),d.prototype=Object.create(h.Animation.prototype),d.prototype.constructor=d,d.prototype.keyTypes=["vis","opa"],d.prototype.defaultKey={viz:1,opa:1},d.prototype.getPrevAndNextKeys=function(e,t){let i=this.data.hierarchy[e].keys[0],n=this.getNextKeyWith(t,e,1);for(;n.time<this.currentTime&&n.index>i.index;)i=n,n=this.getNextKeyWith(t,e,n.index+1);return{prevKey:i,nextKey:n}},d.prototype.update=function(e){if(!1!==this.isPlaying&&(this.currentTime+=e*this.timeScale,this.resetIfLooped(),!this.isPlayingOutOfRange()))for(var t=0,i=this.hierarchy.length;t<i;t++){var n=this.hierarchy[t].animationCache[this.data.name],r=n.prevKey.vis,o=n.prevKey.vis,s=n.prevKey.opa,a=n.prevKey.opa;if(o.time<=this.currentTime||r.time>=this.currentTime){const{prevKey:e,nextKey:i}=this.getPrevAndNextKeys(t,"vis");r=e,o=i,n.prevKey.vis=r,n.nextKey.vis=o}if(a.time<=this.currentTime||s.time>=this.currentTime){const{prevKey:e,nextKey:i}=this.getPrevAndNextKeys(t,"opa");s=e,a=i,n.prevKey.opa=s,n.nextKey.opa=a}let e=r.vis,i=o.vis;if(void 0!==e&&void 0!==i&&r.time!==o.time){const t=Math.abs(this.currentTime-o.time)<this.epsilon?i:e;this.viewer.visibilityManager.setNodeOff(this.nodeId,!t,this.viewer.model,this.nodeChildren,this.nodeFragments)}if(e=s.opa,i=a.opa,void 0===e&&1===r.vis&&(e=1),void 0!==e&&void 0!==i&&s.time!==a.time){let t=(this.currentTime-s.time)/(a.time-s.time);t<0&&(t=0),t>1&&(t=1);const n=e+(i-e)*t;for(let e=0;e<this.fragPointers.length;++e){const t=this.fragPointers[e].getMaterial();t.transparent=1!==n,t.opacity=n}n>0&&this.viewer.visibilityManager.setNodeOff(this.nodeId,!1,this.viewer.model,this.nodeChildren,this.nodeFragments)}}};var p=i(24820),f=i(93033),m=i(11236);function g(e,t,i){var n=this;null===e&&(e=function(e,t,i){var r=this.getDocument(),o=n.container=r.createElement("div"),s=e.name;o.id=s,o.style.cursor="pointer",o.style.visibility=i;var a=r.createElement("div");a.id=s+"-txt",a.style.cssText="display: none;position: absolute;z-index: 1;",o.appendChild(a);var c=r.createElement("img"),h=e.custom&&e.custom.att&&1===e.custom.att;c.src=h?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAABv1BMVEUAAAAAAAAAAAAAAAABAwEAAAAAAAAjSRkAAAAFDASJqnZhg1IqTyAjSRkpTx8hRxggRRcAAAAhRRcKFwgAAACau4R9mnFmiFUhSBgbOhMZNhIAAAAECQMgQxcAAAAAAAAAAAAHDwXB2q2jw4yfvoivyJ6fuI6mv5eSr4KAoWu2trZpiV3Nzc0wVSUhRxhNT01vb28AAAAgRBcAAAAAAAAAAAAhRxgeQBYAAAAAAAAAAAAfQRbP5MC0zqCqyJKpyJJBYje3z6WxyKOFpXF9nmkrTiG+wb5xkGVcf0xYfEg1WSpNTU0hRhgfQhYfQhZVVVVAQEAXMREcOhQcHBwSJw0AAAAAAAAWLxAVLQ8AAAAAAAAfQhYIEgYAAACbvn+DsGCGsmSUunaItGXc6dStypelxY2ZvX2Ntm2JtGnS48fB17G40aWNuWucxH6ny4mUvnPF27aPuHCEsGHV5czI3Lq52KGvzJqz1JmqyJOqzY6ew4OYwHiGs2OEsWHb29vL4LvM5bnD3q2+3KWkyoaLtWuKtmfOzs7IyMi21pyawXqPuG/g4ODX68fI4rTG4LCu0ZKszJKlx4qZwHuBnXR2iXENcZskAAAAXnRSTlMAEAIBCAsF6BUn+vPu7erjsZyBEwP99/TRk3JgRUQ1IxwO/v79/Pv6+fn09PPq08q7sqWDe2xrY01AMBj+/v7+/v37+fn59fXz8u/c1cbFxLWonZiIcm1lYVdSQT8de/EoFwAAAgVJREFUOMutklVz21AQRiNFlswYs+M6DTdN0kCDZWZmuAKDZFtgiO2YYm6TlOEHV53ptGs5j93Xc+a7e3d36P/W9prdZ/PZ17aPxphz3mR0x91G07wTG8TDo5R3HLGH3S6fGPdSo8Na/to6W2HZBEqwPCNULlu1BkFdQSyKx4qxOMoyDDJSRB/HnTcqWbSbTmVS6V3E57hvXicOBZd1gmfj6Z1kPrmTjrMMfRizumDA+k3UTcRSyWg0mkzFEgLNlU3rIIJcns0KqJjJq0I+U0SqUJlZJv8JugU3J/QnHEwu6MCMqPN1pq+H3sFxCgOC7RyT48Ev6qLUL/gmeJrJ/p0DzSnyxTtAGLMbv9dohv8zSbomSqUpOxB0AdNXsUbnGEEQmJzKq3JrLgCaJAzms5LI1enfVefEamc/YzYQYFB6/1xBUsQex3E9UZHkUvO6X48PwQjLTKEjVRVFqUqd8v6naQsMUCNcL8xTrVJZluXyl1K7OW1+7sL71x15cvVH43O7UGi3mmc8lkCE0ByMbvXazwueycbHxiXPrUdv3hLDGiF8au/d4sO7Novtnj9k0BO45uRGTp98f2JlK/RqYzN8TK8bGTjZLTXgfvDp6rMNA0ZADAOWHI6VTYwE4WAZjz/s3V5yvIxADosIPlh0BNXHSdA8LFIfDgE8WDg5hmmx9h/40fgXth2SDk3yjP4AAAAASUVORK5CYII=":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAABvFBMVEUAAAAAAAADAAAAAAAAAAACAAAAAAAAAAC5PznHVE8BAAAAAADbc27NXVeUDQaZDQaRBwAAAAAAAACHBgDuhoHVa2W9RD2QCAKYCAGPBgB0BQAAAAAAAACMBgAAAAADAAD2jonWb2n2jYjYbWfmeXPNzc3RYFqzODKfFA1RUVGKBgCVBwBvb2+WBwCBBgCFBgCWBwCLBgAAAAAAAACMBgCTBwByBQCTBwBbBACEBgAAAAAAAAAoAgBSBADgeHOoOzXmfnnofnjieHPGvr63t7e0tLTidW/ebmnba2XWZWDAT0qRHBfBSkRNTU2aFxGOBgBYTEsAAACNBgBAQEAAAABbBQAcHBxyBQBKBAAAAABfBAAAAAAAAAAsAgAkAgCJBgDZRT3MOTHQPDTVQjrlUkrjUEjRPjbOOjP/bGTvXFTqV0/fTETNOjL5Zl7eS0PzYFjxXlbiT0fUQTn0e3T7aGDWXFXbSEDTRj/PQTrOPjbb29vgamTxY1zoVE3STETTQjvSPzfOzs7IyMj5g3zzaWLXY13XYVrsXlbbU0zg4OD8lZD4gXq0eHXqd3HscWv2b2jrZmDQZWDdWVLkV1C5y9+5AAAAYHRSTlMAAgUBDggMEeDsIBj+8NHJxpxAEP754tDDtIFsYDkvI/78+/j08/DfycfHxbuvr5mTjYN0bWxkWVZTTDUjEfz8+/n59fT08vHw8PDw5NzV0Mq5uLWrm5iLfX1hV0g/ODZEwKduAAACAklEQVQ4y62SVXPbQBzEa1mWZYaY49ihBhtmKjMzw92JLLBsyxxT2mCZvnCVmU59VpO37Ms97G929nb+p05WXUvTE5GJ6aWuY+yFEdoVdAZd9MjCEYi5J0L3FZutSqVZdIYiPWaj/85j2yszAACGVyq7Lo+RIMZtxRaQOZaTwZZSLbrGLR2+aX54twVykpgVpRzgYbVGz5twYMPTV2ZkKZMupDOSzAiwfNazgQesDO9VASemU6lUWuQAgnyNXsEiiBlbEwE2W9CBQpbVAfRraIZoA5ZosII6EpB6MYrVpLxOQejowKsBL9UGSK+zCnnsF4omB7wkBkQHylDZ+rcDROD3hYcYQE0NHQhQ4f8uCQVG/XF9isJKLtI1TYBQQAgdPlqJzYcWMYBYd58/YJACD6UgpsTVA+51AhvKGgt9zQGN1xN4Dajs/vbtmBXf2mIP3/jGqiW9Q0nlGtn8tXBSnwGPWHYP5PcbLMs2JHFn+6p7WQ/ARTie3/rZm9+pZ+rfP/fawi8dhOFgqLlLX87dHOz/1D9ou/vsrcNiNgBrZzbf338yOXZvbDL2xm4ljCdn6j794cpswr/62p+wWy2m/042oQeMxudedK8mSdzGAy4/9vlm/STRtjGRTz9u3nnge2U3+O2h4o9GfXG7lcLKGWZY8ycduG3sQJCk0Tb+w3S0/Qemc4+eJchuZgAAAABJRU5ErkJggg==",c.id=s+"-img",c.style.cssText="display: block;position: absolute;z-index: 1;",o.appendChild(c),t.api.container.appendChild(o),o.addEventListener("click",(function(){a.style.display="none"===a.style.display?"block":"none"}));var u=new l.SphereGeometry(.01),d=new m.LMVMeshPhongMaterial({color:32512,opacity:.6,transparent:!0}),p=new f.LMVMesh(u,d);return p.visible=!1,void 0===t.overlayScenes.annotation&&t.createOverlayScene("annotation"),t.addOverlay("annotation",p),p}.call(this,t,i.viewer,"hidden")),h.Animation.call(this,e,t,i),this.id=t.name,this.text="",this.state="hidden",this.epsilon=.1,this.viewer.api.addEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,(function(t){n.updateText(e.position,n.text)}))}function v(e,t,i){this.viewer=i.viewer,null===e&&(e=this.createPolyline([])),h.Animation.call(this,e,t,i),this.epsilon=.1}function y(e,t){this.animations=[],this.viewer=e,this.setGlobalManager(e.globalManager),this.keys=[],this.isPlaying=!1,this.isPaused=!0,this.updateFlag=0,this.duration=t,this.currentTime=0,this.onPlayCallback=null,this.animationHandler=new n,this.areCameraAnimationsPaused=!1,this.UPDATE_SCENE=1,this.UPDATE_CAMERA=2,this.followCam=!0,this._speedMod=1,this._loops=!1}g.prototype=Object.create(h.Animation.prototype),g.prototype.constructor=g,g.prototype.keyTypes=["pos","text","vis"],g.prototype.defaultKey={pos:0,text:"",vis:1},g.prototype.stop=function(){h.Animation.prototype.stop.call(this),this.container.parentNode.removeChild(this.container),this.viewer.removeOverlay("annotation",this.root),this.root=null},g.prototype.updateText=function(e,t){var i=function(e,t,i){var n=e.clone(),r=new l.Matrix4;return t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),{x:((n=(0,p.r)(n,r)).x+1)*i.width/2+i.offsetLeft-12,y:(1-n.y)*i.height/2+i.offsetTop+12}}(e,this.viewer.camera,this.viewer.canvas),n=this.getDocument(),r=n.getElementById(this.id+"-txt");r&&(r.innerHTML=t,r.style.left=i.x+"px",r.style.top=i.y+"px",this.text=t),(r=n.getElementById(this.id+"-img"))&&(r.style.left=i.x+"px",r.style.top=i.y-24+"px")},g.prototype.update=function(){var e=[],t=new l.Vector3,i=new l.Vector3;return function(n){if(!1!==this.isPlaying&&(this.currentTime+=n*this.timeScale,this.resetIfLooped(),!this.isPlayingOutOfRange())){var r=this.getDocument();if(this.isPaused&&this.currentTime<this.startKeyTime)(E=r.getElementById(this.id))&&(E.style.visibility=this.state);else for(var o=0,s=this.hierarchy.length;o<s;o++){for(var a=this.hierarchy[o],l=a.animationCache[this.data.name],u=0;u<this.keyTypes.length;u++){var d=this.keyTypes[u],p=l.prevKey[d],f=l.nextKey[d];if(f.time<=this.currentTime||p.time>=this.currentTime){for(p=this.data.hierarchy[o].keys[0],f=this.getNextKeyWith(d,o,1);f.time<this.currentTime&&f.index>p.index;)p=f,f=this.getNextKeyWith(d,o,f.index+1);l.prevKey[d]=p,l.nextKey[d]=f}var m=p[d],g=f[d];if(f.time!==p.time&&void 0!==m&&void 0!==g){var v=(this.currentTime-p.time)/(f.time-p.time);if(v<0&&(v=0),v>1&&(v=1),"pos"===d){if(this.interpolationType===c.u.LINEAR)i.x=m[0]+(g[0]-m[0])*v,i.y=m[1]+(g[1]-m[1])*v,i.z=m[2]+(g[2]-m[2])*v,a.position.copy(i);else if(this.interpolationType===c.u.CATMULLROM||this.interpolationType===c.u.CATMULLROM_FORWARD){e[0]=this.getPrevKeyWith("pos",o,p.index-1).pos,e[1]=m,e[2]=g,e[3]=this.getNextKeyWith("pos",o,f.index+1).pos,v=.33*v+.33;var y=(0,h.interpolateCatmullRom)(e,v);if(i.x=y[0],i.y=y[1],i.z=y[2],a.position.copy(i),this.interpolationType===c.u.CATMULLROM_FORWARD){var b=(0,h.interpolateCatmullRom)(e,1.01*v);t.set(b[0],b[1],b[2]),t.sub(vector),t.y=0,t.normalize();var x=Math.atan2(t.x,t.z);a.rotation.set(0,x,0)}}}else if("text"===d){var _=Math.abs(this.currentTime-f.time)<this.epsilon?g:m;this.updateText(a.position,_)}else if("vis"===d){var E;if(E=r.getElementById(this.id)){var A=Math.abs(this.currentTime-f.time)<this.epsilon?g:m;E.style.visibility=A?"visible":"hidden"}}}}a.matrixAutoUpdate=!0,a.matrixWorldNeedsUpdate=!0}}}}(),v.prototype=Object.create(h.Animation.prototype),v.prototype.constructor=v,v.prototype.keyTypes=["points","vis"],v.prototype.defaultKey={points:[],vis:1},v.prototype.stop=function(){h.Animation.prototype.stop.call(this),this.viewer.removeOverlay("polyline",this.root),this.root=null},v.prototype.update=function(){function e(e){e.root&&(e.viewer.removeOverlay("polyline",e.root),e.root=null)}return function(t){if(!1!==this.isPlaying&&(this.currentTime+=t*this.timeScale,this.resetIfLooped(),!this.isPlayingOutOfRange()))if(this.isPaused&&this.currentTime<this.startKeyTime)e(this);else for(var i=0,n=this.hierarchy.length;i<n;i++)for(var r=this.hierarchy[i].animationCache[this.data.name],o=0;o<this.keyTypes.length;o++){var s=this.keyTypes[o],a=r.prevKey[s],c=r.nextKey[s];if(c.time<=this.currentTime||a.time>=this.currentTime){for(a=this.data.hierarchy[i].keys[0],c=this.getNextKeyWith(s,i,1);c.time<this.currentTime&&c.index>a.index;)a=c,c=this.getNextKeyWith(s,i,c.index+1);r.prevKey[s]=a,r.nextKey[s]=c}var h=a[s],u=c[s];if(c.time!==a.time&&void 0!==h&&void 0!==u){var d=(this.currentTime-a.time)/(c.time-a.time);if(d<0&&(d=0),d>1&&(d=1),"points"===s){var p=d<.5?h:u;this.viewer.removeOverlay("polyline",this.root),this.root=null;for(var f=[],m=0;m<p.length;m++){var g=p[m].slice();if(0===m)g[0]=h[m][0]+(u[m][0]-h[m][0])*d,g[1]=h[m][1]+(u[m][1]-h[m][1])*d,g[2]=h[m][2]+(u[m][2]-h[m][2])*d;else if(m===p.length-1){var v=h.length-1,y=u.length-1;g[0]=h[v][0]+(u[y][0]-h[v][0])*d,g[1]=h[v][1]+(u[y][1]-h[v][1])*d,g[2]=h[v][2]+(u[y][2]-h[v][2])*d}var b=new l.Vector3(g[0],g[1],g[2]);f.push(b)}this.root=this.createPolyline(f)}else if("vis"===s){var x=Math.abs(this.currentTime-c.time)<this.epsilon?u:h;this.root.visible=x,x||e(this)}}}}}(),v.prototype.createPolyline=function(e){for(var t=new l.Geometry,i=0;i<e.length;i++)t.vertices.push(e[i]);t.computeLineDistances();var n=new l.LineDashedMaterial({color:0,dashSize:1,gapSize:.5,linewidth:1}),r=new l.Line(t,n,l.LineStrip);return void 0===this.viewer.overlayScenes.polyline&&this.viewer.createOverlayScene("polyline"),this.viewer.addOverlay("polyline",r),r},i(27293).GlobalManagerMixin.call(y.prototype),y.prototype.destroy=function(){this.stop(),this.viewer=null,this.keys=null,this.animations=null,this.isPlaying=!1,this.isPaused=!1,this.animationHandler=null},y.prototype.add=function(e){if(!(!e.hierarchy||e.hierarchy.length<1||!e.hierarchy[0].keys||e.hierarchy[0].keys.length<2)){var t=null,i=this;if("camera"===e.type?(t=new u(i.viewer.camera,e,i),i.animations.push(t)):"annotation"===e.type?(t=new g(null,e,i),i.animations.push(t)):"polyline"===e.type?(t=new v(null,e,i),i.animations.push(t)):"mesh"===e.type?i.viewer.model.getData().instanceTree.enumNodeFragments(e.id,(function(n){var r=i.viewer.getFragmentProxy(i.viewer.model,n);r&&(t=new a.MeshAnimation(r,e,i),i.animations.push(t))}),!0):"visibility"===e.type&&(t=new d(e,e.id,i),i.animations.push(t)),i.animations.forEach((e=>e.setGlobalManager(this.globalManager))),t){for(var n=0,r=e.hierarchy.length;n<r;n++)for(var o=e.hierarchy[n].keys,s=0;s<o.length;s++)void 0===o[s].xk&&i.keys.push(o[s].time);!function(e){e.sort((function(e,t){return e-t})),function(e,t,i){for(t=e.length;i=--t;)for(;i--;)e[t]!==e[i]||e.splice(i,1)}(e)}(i.keys)}this.updateFlag|=this.UPDATE_SCENE}},y.prototype.update=function(e){e*=this._speedMod,this.animationHandler.update(e);var t=this.updateFlag;return this.isPlaying&&!this.isPaused&&(this.currentTime+=e,this.currentTime=Math.min(this.currentTime,this.duration),this.onPlayCallback&&this.onPlayCallback(this.duration>0?this.currentTime/this.duration*100:0),this.currentTime>=this.duration&&(this._loops?this.play(0,this.onPlayCallback):this.pause()),t|=this.UPDATE_SCENE),this.updateFlag=0,t},y.prototype.play=function(e,t){if(this.onPlayCallback=t,this.currentTime>=this.duration&&this.goto(0),this.isPlaying)this.pause();else{for(var i=0;i<this.animations.length;i++){this.animations[i].play(e)}this.isPlaying=!0,this.isPaused=!1}},y.prototype.setFollowCamera=function(e){this.followCam=e;for(var t=0;t<this.animations.length;t++){var i=this.animations[t];i.setFollowCamera&&i.setFollowCamera(e)}},y.prototype.isFollowingCamera=function(){return this.followCam},y.prototype.setSpeedModifier=function(e){this._speedMod=e},y.prototype.getSpeedModifier=function(){return this._speedMod},y.prototype.setLooping=function(e){this._loops=e},y.prototype.isLooping=function(){return this._loops},y.prototype.pause=function(){for(var e=0;e<this.animations.length;e++){var t=this.animations[e];t.isPaused===this.isPaused&&t.pause()}this.isPaused=!this.isPaused,this.areCameraAnimationsPaused=this.isPaused},y.prototype.pauseCameraAnimations=function(){for(var e=0;e<this.animations.length;e++){var t=this.animations[e];t instanceof u&&t.pause()}this.areCameraAnimationsPaused=!this.areCameraAnimationsPaused},y.prototype.stop=function(){for(var e=0;e<this.animations.length;e++){this.animations[e].stop()}this.isPlaying=!1,this.isPaused=!1},y.prototype.goto=function(e){if(void 0!==e){for(var t=0;t<this.animations.length;t++){this.animations[t].goto(e)}this.isPlaying=!1,this.isPaused=!0,this.currentTime=e,this.updateFlag|=this.UPDATE_SCENE}},y.prototype.next=function(){var e=function(e,t){for(var i=-1,n=0;n<t.length;n++)if(t[n]>e){i=t[n];break}return i<0?t[t.length-1]:i}(this.currentTime,this.keys);this.goto(e)},y.prototype.prev=function(){var e=function(e,t){for(var i=-1,n=t.length-1;n>-1;n--)if(t[n]<e){i=t[n];break}return i<0?t[0]:i}(this.currentTime,this.keys);this.goto(e)}},99946:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MeshAnimation:()=>d});var n,r,o,s,a,l,c=i(41434),h=i(35787),u=i(37231);function d(e,t,i){u.Animation.call(this,e,t,i),this.localMatrix=new c.Matrix4,this.root.getAnimTransform(),this.relativeTransform=!t.custom||!t.custom.transform||"abs"!==t.custom.transform}d.prototype=Object.create(u.Animation.prototype),d.prototype.constructor=d,d.prototype.keyTypes=["pos","rot","scl"],d.prototype.defaultKey={pos:0,rot:0,scl:0},d.prototype.update=(n=[],r=new c.Vector3,o=new c.Vector3,s=new c.Quaternion,a=new c.Matrix4,l=new c.Matrix4,function(e){if(!1!==this.isPlaying&&(this.currentTime+=e*this.timeScale,this.resetIfLooped(),!this.isPlayingOutOfRange()))for(var t=0,i=this.hierarchy.length;t<i;t++){for(var c=this.hierarchy[t],d=c.animationCache[this.data.name],p=0;p<this.keyTypes.length;p++){var f=this.keyTypes[p],m=d.prevKey[f],g=d.nextKey[f];if(g.time<=this.currentTime||m.time>=this.currentTime){for(m=this.data.hierarchy[t].keys[0],g=this.getNextKeyWith(f,t,1);g.time<this.currentTime&&g.index>m.index;)m=g,g=this.getNextKeyWith(f,t,g.index+1);d.prevKey[f]=m,d.nextKey[f]=g}var v=m[f],y=g[f];if(g.time!==m.time&&void 0!==v&&void 0!==y){var b=(this.currentTime-m.time)/(g.time-m.time);if(b<0&&(b=0),b>1&&(b=1),"pos"===f)if(this.interpolationType===h.u.LINEAR)o.x=v[0]+(y[0]-v[0])*b,o.y=v[1]+(y[1]-v[1])*b,o.z=v[2]+(y[2]-v[2])*b,c.position.copy(o);else{n[0]=this.getPrevKeyWith("pos",t,m.index-1).pos,n[1]=v,n[2]=y,n[3]=this.getNextKeyWith("pos",t,g.index+1).pos,b=.33*b+.33;var x=(0,u.interpolateCatmullRom)(n,b);if(o.x=x[0],o.y=x[1],o.z=x[2],c.position.copy(o),this.interpolationType===h.u.CATMULLROM_FORWARD){var _=(0,u.interpolateCatmullRom)(n,1.01*b);r.set(_[0],_[1],_[2]),r.sub(vector),r.y=0,r.normalize();var E=Math.atan2(r.x,r.z);c.rotation.set(0,E,0)}}else"rot"===f?(s.slerpQuaternions(v,y,b),c.quaternion.copy(s)):"scl"===f&&(o.x=v[0]+(y[0]-v[0])*b,o.y=v[1]+(y[1]-v[1])*b,o.z=v[2]+(y[2]-v[2])*b,c.scale.copy(o))}}if(!this.relativeTransform){var A=a.compose(c.position,c.quaternion,c.scale),S=l;c.getOriginalWorldMatrix(S),S.invert(),a.multiplyMatrices(A,S).decompose(c.position,c.quaternion,c.scale)}c.updateAnimTransform()}})},60301:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AggregatedView:()=>_});var n=i(43644),r=i(16840),o=i(7452),s=i(71224);const a=Autodesk.Viewing,l=a.Private,c={BimWalk:"Autodesk.BimWalk",Bookmarks:"Autodesk.AEC.CanvasBookmarkExtension",Levels:"Autodesk.AEC.LevelsExtension",CrossFade:"Autodesk.CrossFadeEffects",Hyperlinks:"Autodesk.AEC.HyperlinkExtension",Minimap:"Autodesk.AEC.Minimap3DExtension",DropMe:"Autodesk.AEC.DropMeExtension",ZoomWindow:"Autodesk.Viewing.ZoomWindow",FusionOrbit:"Autodesk.Viewing.FusionOrbit",Disciplines:"Autodesk.AEC.DisciplinesExtension",DiffTool:"Autodesk.DiffTool",ModelStructure:"Autodesk.ModelStructure",ModelAlignment:"Autodesk.ModelAlignment",SheetAlignment:"Autodesk.SheetAlignment",ModelSheetTransition:"Autodesk.ModelSheetTransition"},h={ALIGNMENT_SERVICE_FAILED:"alignmentServiceFailure",ENVIRONMENT_CHANGED:"environmentChanged"},u={LocalStorage:()=>new Autodesk.ModelAlignmentService.AlignmentServiceLS},d=[c.ModelAlignment,c.SheetAlignment],p=e=>{return e instanceof a.BubbleNode?e.getModelKey():e instanceof a.Model?null===(t=e.getDocumentNode())||void 0===t?void 0:t.getModelKey():"string"==typeof e?e:void console.error("makeKey: Input must be key, model, or BubbleNode");var t},f=e=>isFinite(e.x)&&isFinite(e.y)&&isFinite(e.z),m=e=>{let t=e.getUpVector();return t&&(new THREE.Vector3).fromArray(t)},g=e=>f(e.position)&&f(e.target)&&f(e.up)&&isFinite(e.orthoScale),v=(e,t,i)=>{let n=0;const r=new THREE.Vector3;for(let o=0;o<e.length;o++){const s=e[o].getBoundingBox();if(i.intersectsBox(s)===Autodesk.Viewing.Private.FrustumIntersector.OUTSIDE)continue;const a=s.getSize(r).length;s.distanceToPoint(t)>50*a||n++}return n},y={enabled:!1,diffBubbles:void 0,primaryBubbles:void 0,diffBubbleLabel:void 0,primaryBubbleLabel:void 0,progressCallback:void 0,supportBubbles:void 0,refNames:void 0,customCompute:void 0},b=(e,t)=>{let i=e.getVisibleModels();i=i.filter((e=>{return t=e.getBoundingBox(),f(t.min)&&f(t.max);var t}));let n,r,o,s,a=e.impl.camera.clone(),l=new Autodesk.Viewing.Private.FrustumIntersector;const c=new THREE.Vector3;for(let e=0;e<i.length;e++){const t=i[e];n||(n=m(t));const h=t.getDefaultCamera();if(!h||!g(h))continue;const u=t.getBoundingBox();a.position.copy(h.position),a.target.copy(h.target),a.up.copy(h.up),a.isPerspective=h.isPerspective,a.near=u.distanceToPoint(a.position),a.far=a.near+u.getSize(c).length,a.updateMatrixWorld(),a.updateProjectionMatrix(),l.reset(a);const d=v(i,h.position,l);(!r||d>=o)&&(r=h,o=d,s=t)}r&&(r.pivot=r.target,r.worldup=n,r.fov=45,t&&t(r,s),e.autocam.setHomeViewFrom(r))};class x{constructor(e){this.color=e,this.enabled=!0,this.active=!1}setEnabled(e,t){t!==this.enabled&&(this.enabled=t,this.active&&!t?(e.clearThemingColors(),this.active=!1):this.update(e))}update(e){if(this.active||!this.enabled)return;const t=e.myData.fragments.fragId2dbId;for(let i=0;i<t.length;i++){const n=t[i];e.setThemingColor(n,this.color)}this.active=!0}}class _{constructor(){this.globalOffset=void 0,this.refPoint=void 0,this.modelItems={},this.resetOnNextModelAdd=!0,this.resetTriggeringBubble=null,this.memTracker=null,this.cameraInitialized=!1,this.is3D=void 0,this.pendingCamera=null,this.extensionLoaded={},this.loadersInProgress={},this.diff={...y},this.modelIsGhosted={},this.diffCache=[],this.onDiffDone=void 0,this.waitForFirstModel=!1,this.loadPendingPromises={},this.onLoad=[],this.onUnload=[],this.modelThemingStates={},window.LMV_MAIN_VIEW=this,this.pendingAlignmentFetches=[],Autodesk.Viewing.EventDispatcher.prototype.apply(this)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.useConsolidation=void 0===t.useConsolidation||t.useConsolidation,this.initViewerInstance(e,t),this.memTracker=new a.ModelMemoryTracker(this.viewer,t.memoryLimit),this.viewer.impl.showTransparencyWhenMoving(),t.useDynamicGlobalOffset&&(this.dynamicGlobalOffset=new o.DynamicGlobalOffset(this.viewer)),this.options=t,this._registerLmvEventListeners(),this._loadExtensions()}initViewerInstance(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=t.viewerClass||(t.headlessViewer?a.Viewer3D:a.GuiViewer3D);let n=t.viewerConfig||{};n.disabledExtensions=n.disabledExtensions||{},n.disabledExtensions.hyperlink=!0,t.multiViewerFactory?this.viewer=t.multiViewerFactory.createViewer(e,t.viewerConfig,i):this.viewer=new i(e,t.viewerConfig),this.viewer.start(void 0,void 0,void 0,void 0,t.viewerStartOptions),t.propagateInputEventTypes&&(this.viewer.toolController.propagateInputEventTypes=t.propagateInputEventTypes,this.viewer.canvas.style.outline="none")}destroy(){var e;this.dynamicGlobalOffset=null,this.memTracker=null,this.modelItems=null,null===(e=this.viewer)||void 0===e||e.finish(),this.viewer=null,window.LMV_MAIN_VIEW=null}_onError(){console.error(...arguments)}reset(){this.hideAll(),this.pendingCamera=null,this.cameraInitialized=!1,this.resetOnNextModelAdd=!0,this._stopActiveTools(),this._unloadDiffTool(!0),this.refPoint=void 0,this.loadersInProgress={}}getModel(e){const t=this._getItem(e);return t&&t.model}getModelAndWait(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((i=>{const n=()=>{const t=this.getModel(e);if(t)return this.viewer.removeEventListener(Autodesk.Viewing.MODEL_ADDED_EVENT,n),this.onLoad.splice(this.onLoad.indexOf(n),1),i(t)};if(!(t&&!this.isVisible(e))){const t=this.getModel(e);if(t)return i(t)}this.viewer.addEventListener(Autodesk.Viewing.MODEL_ADDED_EVENT,n),this.onLoad.push(n)}))}isEmpty(){return!this.getVisibleNodes().length}_initForEnvironmentChange(e,t){if(this.areAllNodes2D()&&e.is3D()){let i;if(this.is3D=t,!t){const t=e=>e.visible&&e.node&&e.node.is2D();i=Object.values(this.modelItems).filter(t)[0],e=i.node}this._updateExtensions(e),this._updateRefPoint(e),t?(this.resetOnNextModelAdd=!0,this.resetTriggeringBubble=e):i.model&&(this._resetOnModeSwitch(i.model),this.viewer.impl.setUp2DMode(i.model,!1),this.viewer.getExtension("Autodesk.ViewCubeUi",(e=>e.displayViewCube(!1,!1)))),this.fireEvent({type:h.ENVIRONMENT_CHANGED,is3D:this.is3D})}}_needsReset(e){return!!this.resetOnNextModelAdd&&(!this.resetTriggeringBubble||this.resetTriggeringBubble===e)}show(e,t){this.isEmpty()?this._initForFirstViewable(e):this._initForEnvironmentChange(e,!0);const i=e.getModelKey();let n,r=this.getModel(i);var o;r?(this.modelItems[i].visible=!0,this._showModel(r),n=Promise.resolve(r)):(n=null===(o=this.modelItems[i])||void 0===o?void 0:o.loadingPromise,n||(n=this.load(e,t)),this.modelItems[i].visible=!0);return this._updateModelTimestamps(),this._consolidateVisibleModels(),n}hide(e){let t=this._getItem(e);t&&(!this.options.unloadUnfinishedModels||t.model&&t.model.isLoadDone()?t.model&&this.viewer.hideModel(t.model.id):this.unload(t.node),t.visible=!1,b(this.viewer,this.options.cameraValidator),this._updateUpVector(),this._cleanupModels(),this._initForEnvironmentChange(t.node,!1))}isVisible(e){const t=this._getItem(e);return t&&t.visible}hideAll(){for(let e in this.modelItems)this.hide(e)}getVisibleNodes(){let e=[];for(let t in this.modelItems){let i=this.modelItems[t];i.visible&&e.push(i.node)}return e}areAllNodes2D(){const e=this.getVisibleNodes();return!!e.length&&e.every((e=>!(e instanceof Autodesk.Viewing.BubbleNode)||e.is2D()))}isOtgManifestMissing(e){if(e.is2D())return!1;let t=e.getOtgGraphicsNode();if(t&&!t.error)return!1;if(t?this._onError(`Otg translation failed for viewable '${e.name()}'. Error:`,t.error):this._onError(`Otg node missing for viewable '${e.name()}'.`),this.onViewerNotification){const t=a.i18n.t("Model translation failed for view '%(viewableName)'",{viewableName:e.name()});this.onViewerNotification("error",t)}return!0}load(e){var t,i;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=p(e);let o=this.modelItems[r];if(o||(o={model:null,node:e,visible:!1,url:null,loadingPromise:null,error:!1},this.modelItems[r]=o),o.model)return Promise.resolve(o.model);if(this.options.disableSvf&&this.isOtgManifestMissing(e))return o.error=!0,Promise.reject("OTG manifest missing");if(o.loadingPromise||o.error)return Promise.reject("Model load was already triggered");if(e.is3D()){if(this.waitForFirstModel)return new Promise(((e,t)=>{this.loadPendingPromises[r]={resolve:e,reject:t}}));this.options.ignoreGlobalOffset||this.globalOffset||(this.waitForFirstModel=!0)}let s=e.getRootNode().getDocument();const a={globalOffset:this.globalOffset,applyRefPoint:!0,applyScaling:this.options.viewerUnits,isAEC:!0,bvhOptions:l.Consolidation.getDefaultBVHOptions(),useConsolidation:!1,loadAsHidden:!0,bubbleNode:e,disablePrecomputedNodeBoxes:!0,preserveView:!0,onFragmentListLoadProgress:()=>this._updateDiffLoadProgress(),disable3DModelLayers:!0,keepCurrentModels:!0,headlessViewer:this.options.headlessViewer,leafletOptions:{fitPaperSize:!0}},c=this._onModelLoaded.bind(this),h=t=>this._onModelLoadFailed(e,t),u=null===(t=(i=this.options).getCustomLoadOptions)||void 0===t?void 0:t.call(i,e);return u&&Object.assign(a,u),n&&Object.assign(a,n),o.loadingPromise=new Promise(((t,i)=>{this._applyAlignmentService(e,a).then((()=>(this.viewer||i(),this.viewer.loadDocumentNode(s,e,a)))).then((e=>{this.viewer||i(),c(e),t(e)})).catch((e=>{h(e),i(e)}))})),o.loadingPromise}unloadUnderlayRaster(e){const t=this.viewer.getUnderlayRaster(e);t&&this.viewer.unloadModel(t)}unload(e){this.unloadUnderlayRaster(e),this.viewer.unloadDocumentNode(e);const t=this._getItem(e);t&&(t.loading&&this._onModelLoadEnded(t),t.model&&delete this.loadersInProgress[t.model.id]);let i=p(e);delete this.modelItems[i];const n=this.modelThemingStates[i];n&&(n.active=!1),this.onUnload.forEach((t=>t(e)))}unloadAll(e){let t=Object.keys(this.modelItems).slice();for(var i=0;i<t.length;i++){let n=t[i],r=this.modelItems[n];e&&!e(r)||this.unload(r.node)}}setCameraGlobal(e){this.pendingCamera={position:e.position&&(new THREE.Vector3).copy(e.position),target:e.target&&(new THREE.Vector3).copy(e.target),up:e.up&&(new THREE.Vector3).copy(e.up),fov:e.fov,isPerspective:e.isPerspective,ignoreGlobalOffset:e.ignoreGlobalOffset},this._applyPendingCameraWhenReady()}setCamera(e){this.viewer.impl.setViewFromCamera(e,!0),this.cameraInitialized=!0}startBimWalk(){this.bimWalkStartPending=!0,this._startBimWalkWhenReady()}stopBimWalk(){let e=this.viewer.getExtension(c.BimWalk);e&&e.isActive()&&e.deactivate(),this.bimWalkStartPending=!1}isBimWalkActive(){let e=this.viewer.getExtension("Autodesk.BimWalk");return e&&e.activeStatus||this.bimWalkStartPending}switchView(e,t){return this.reset(),this.setNodes(e,t)}setNodes(e,t){e=(e=e||[])instanceof a.BubbleNode?[e]:e,this.fetchAlignmentsForNodes(e);const i=e.filter((e=>!this.isVisible(e)));let n={};e.forEach((e=>{n[e.getModelKey()]=!0}));this.getVisibleNodes().filter((e=>void 0===n[e.getModelKey()])).forEach((e=>{this.hide(e)}));const r=i.map((e=>this.show(e)));return this._setDiff(t),Promise.all(r)}getFloorSelector(){return this.levelsExtension&&this.levelsExtension.floorSelector}setBookmarks(e){this.bookmarks=e,this._updateBookmarks()}isLoadDone(){for(let e in this.modelItems){const t=this.modelItems[e],i=t&&t.model,n=!i&&!t.error,r=i&&!i.isLoadDone(),o=i&&i.getPropertyDb()&&!i.getPropertyDb().isLoadDone(),s=l.TextureLoader.requestsInProgress()>0;if(n||r||o||s)return!1}return!0}waitForLoadDone(){return new Promise((e=>{this.isLoadDone()&&e();const t=()=>{this.isLoadDone()&&(this.viewer.removeEventListener(a.GEOMETRY_LOADED_EVENT,t),this.viewer.removeEventListener(a.OBJECT_TREE_CREATED_EVENT,t),this.viewer.removeEventListener(a.TEXTURES_LOADED_EVENT,t),this.onUnload.splice(this.onUnload.indexOf(t),1),e())};this.viewer.addEventListener(a.GEOMETRY_LOADED_EVENT,t),this.viewer.addEventListener(a.OBJECT_TREE_CREATED_EVENT,t),this.viewer.addEventListener(a.TEXTURES_LOADED_EVENT,t),this.onUnload.push(t)}))}setAlignmentService(e){this.alignmentService=e,d.forEach((e=>this._connectModelAlignment(e)))}async fetchAlignments(e){if(!this.isUsingAlignmentService())return;const t=(async()=>{const t=await this.getAlignmentService();await t.fetchItems(e)})();return this.pendingAlignmentFetches.push(t),await t}fetchAlignmentsForNodes(e){const t=null==e?void 0:e.filter((e=>e.is3D())),i=null==t?void 0:t.map((e=>e.getRootNode().urn()));this.fetchAlignments(i)}static findDiffSupportModel(e){if(!e.is2D())return null;const t=e.data.phaseNames,i=Array.isArray(t)?t[0]:t;return i?e.getMasterView(i):(console.warn(`A sheet node must have a phase name. Missing for sheet: ${e.name}`),null)}static findDiffSupportModels(e){e.supportBubbles.diff=_.findDiffSupportModel(e.diffBubbles[0]),e.supportBubbles.primary=_.findDiffSupportModel(e.primaryBubbles[0])}updateHomeCamera(){b(this.viewer,this.options.cameraValidator)}_setDiff(e){if(e){Object.assign(this.diff,e,{enabled:!0});const t=e.supportBubbles;if(t)if(t.autoDetect&&_.findDiffSupportModels(e),t.diff&&t.primary)this.load(t.primary),this.load(t.diff);else{const t=e.diffBubbles&&e.diffBubbles[0];t&&t.is2D()&&console.warn("Could not find support models for 2D diff."),this.diff.supportBubbles=null}!e.empty&&e.progressCallback&&this._signalDiffLoadProgress(0,!0),this.diffStartTime=performance.now()}else Object.assign(this.diff,y);this.diffNeedsUpdate=!0,this._updateDiff()}_updateUpVector(){let e;if(this.areAllNodes2D())e=new THREE.Vector3(0,1,0);else{const t=e=>e.visible&&e.node&&e.node.is3D(),i=Object.values(this.modelItems).filter(t)[0];e=i&&i.model?m(i.model):new THREE.Vector3(0,0,1)}this.viewer.navigation.setWorldUpVector(e,!1,!0)}_showModel(e){if(e.is3d()&&!e.hasGeometry()){const t=e.getDocumentNode().getRootNode().children[0].name();return void console.warn("Ignored model with empty geometry: ",t)}this.viewer.showModel(e.id,!0),b(this.viewer,this.options.cameraValidator),this._updateUpVector()}_resetOnModeSwitch(e){this.viewer.getExtension(c.ZoomWindow)&&this.viewer.unloadExtension(c.ZoomWindow),this.options.headlessViewer||this.viewer.createUI(e,!0);const t=this.viewer.setNavigationLock(!1);this.viewer.activateDefaultNavigationTools(!this.is3D),this.viewer.setNavigationLock(t),this.viewer.navigation.setIs2D(!this.is3D),this._loadExtension(c.ZoomWindow).catch((e=>this._onError(e))),this._startBimWalkWhenReady()}_onModelAdded(e){const t=e.model;if(this.cameraInitialized||this._initCamera(t),t.getData().underlayRaster)return;t.is3d()&&this.options.useDynamicGlobalOffset&&(t.setGlobalOffset(this.viewer.impl.camera.globalOffset),this.viewer.impl.onModelTransformChanged(t));const i=e.model.getDocumentNode();if(this._needsReset(i)&&(this.resetTriggeringBubble=null,this.resetOnNextModelAdd=!1,this._resetOnModeSwitch(t)),(e=>{const t=e.getData(),i=t.loadOptions.bubbleNode;if(e.is3d()&&t.metadata.stats&&!t.metadata.stats.num_fragments){const e=i.name(),t=i.getRootNode().children[0].name();console.warn(`Empty View "${e}" in model "${t}".`)}})(t),i){const e=i.getModelKey();delete this.modelIsGhosted[e],this._updateGhosting()}}_onGeometryLoaded(e){this._consolidateVisibleModels(),this._updateDiff(),this.loadersInProgress[e.model.id]=100}_onExtensionLoaded(e){const t=e.extensionId;this._startBimWalkWhenReady(),t===c.Levels&&(this.levelsExtension=this.viewer.getExtension(c.Levels)),t===c.Bookmarks&&this._updateBookmarks(),d.includes(t)&&this.alignmentService&&this._connectModelAlignment(t)}_registerLmvEventListeners(){this.viewer.addEventListener(a.GEOMETRY_LOADED_EVENT,this._onGeometryLoaded.bind(this)),this.viewer.addEventListener(a.MODEL_ADDED_EVENT,this._onModelAdded.bind(this)),this.viewer.addEventListener(a.EXTENSION_LOADED_EVENT,this._onExtensionLoaded.bind(this)),this.viewer.addEventListener(a.PROGRESS_UPDATE_EVENT,this._onProgressUpdate.bind(this)),this.viewer.addEventListener(a.MODEL_ROOT_LOADED_EVENT,this._updateDiff.bind(this))}_consolidateVisibleModels(){if(this._cleanupModels(),(0,r.isMobileDevice)())return;let e=(0,n.getParameterByName)("useConsolidation");if("false"===e||!1===this.options.useConsolidation&&"true"!==e)return;const t=this.viewer.getVisibleModels();for(let e=0;e<t.length;e++){const i=t[e];if(this.memTracker.memoryExceeded())return;if(!(i&&i.isLoadDone()))return;if(i.is2d()||i.isSceneBuilder())return;i.isConsolidated()||(this.viewer.impl.consolidateModel(i),this._cleanupModels())}}_cleanupModels(){this._updateModelTimestamps();this.memTracker.cleanup((e=>{const t=e.getDocumentNode(),i=this._getItem(t);i&&i.visible||this.unload(t)}))}_updateModelTimestamps(){let e=this.viewer.getVisibleModels().slice();const t=this._getDiffSupportModels();this.diff.enabled&&t&&(t.diff&&e.push(t.diff),t.primary&&e.push(t.primary)),this.memTracker.updateModelTimestamps(e)}_stopActiveTools(){const e=this.viewer.getExtension("Autodesk.Section");e&&e.isActive()&&e.enableSectionTool(!1),this.stopBimWalk();const t=!this.options.headlessViewer&&this.viewer.getPropertyPanel(!1);t&&t.isVisible()&&t.setVisible(!1)}_onModelLoaded(e){let t=this._getItem(e);t&&(e.is3d()&&(this.options.useDynamicGlobalOffset?e.setGlobalOffset(this.viewer.impl.camera.globalOffset):this.waitForFirstModel&&!this.options.ignoreGlobalOffset&&(this.globalOffset=(new THREE.Vector3).copy(e.myData.globalOffset),this._onGlobalOffsetChanged())),t.model=e,t.visible&&this._showModel(t.model),this._updateModelTimestamps(),this._updateDiffLoadProgress(),this._updateModelTheming(e),this._onModelLoadEnded(t))}_onModelLoadFailed(e,t){this._onError(`Failed to load model: ${e.name()}. Error code: ${t}`);const i=this._getItem(e);i&&(i.error=!0,this._onModelLoadEnded(i))}_onModelLoadEnded(e){e.loadingPromise=null;const t=e.node;t.is3D()&&this.waitForFirstModel&&(this.waitForFirstModel=!1,Object.keys(this.loadPendingPromises).forEach((e=>{var t;const i=null===(t=this.modelItems[e])||void 0===t?void 0:t.node;if(!i)return;const{resolve:n,reject:r}=this.loadPendingPromises[e];this.load(i).then((e=>{n(e)})).catch((e=>{r(e)}))})),this.loadPendingPromises={}),this.onLoad.forEach((e=>e(t)))}_initCamera(e,t){this.viewer.impl.setViewFromFile(e,!t),this.options.cameraValidator&&this.options.cameraValidator(this.viewer.impl.camera,e),this.viewer.impl.controls.recordHomeView(),this.cameraInitialized=!0,this.pendingCamera&&this._applyPendingCameraWhenReady()}_getItem(e){var t;let i=p(e);return null===(t=this.modelItems)||void 0===t?void 0:t[i]}_updateRefPoint(e){if(this.options.useDynamicGlobalOffset)return;if(!(this.isEmpty()||this.areAllNodes2D())||!e.is3D()||this.options.ignoreGlobalOffset)return;const t=e.getAecModelData();if(!t)return;let i=t&&t.refPointTransformation,n=i?{x:i[9],y:i[10],z:0}:{x:0,y:0,z:0};if(this.isUsingAlignmentService()){var r;const t=e.getRootNode().urn(),i=null===(r=this.alignmentService)||void 0===r?void 0:r.getTransform(t);if(void 0===i)return;i&&(n.x=i.elements[12],n.y=i.elements[13])}if(this.refPoint=n,this.options.viewerUnits){const e=Autodesk.Viewing.Private.convertUnits("ft",this.options.viewerUnits,1,1);this.refPoint.x*=e,this.refPoint.y*=e,this.refPoint.z*=e}const o=this.globalOffset&&THREE.Vector3.prototype.distanceToSquared.call(this.refPoint,this.globalOffset);(!this.globalOffset||o>4e6)&&(this.globalOffset=(new THREE.Vector3).copy(this.refPoint),this.unloadAll((e=>e.model&&e.model.is3d())),this._onGlobalOffsetChanged())}_onGlobalOffsetChanged(){const e=this.viewer.getExtension(c.Bookmarks);e&&e.resetGlobalOffset(this.globalOffset)}_getDefaultExtensions(){return[{name:c.CrossFade,getLoadingCondition:()=>!a.isMobileDevice()},{name:c.Levels,getOptions:()=>this.viewer.config},{name:c.ModelStructure,getOptions:()=>this.viewer.config},{name:c.Hyperlinks,getOptions:()=>({loadViewableCb:(e,t)=>{this.onHyperlink?this.onHyperlink(e,t):this.switchView([e])}})},{name:c.Minimap,getLoadingCondition:()=>!this.options.disableMinimap,getOptions:()=>({trackUsage:this._trackMinimapUsage?this._trackMinimapUsage.bind(this):void 0})},{name:c.Bookmarks,getLoadingCondition:()=>this.is3D,getOptions:()=>({globalOffset:this.globalOffset,onBookmark:(e,t)=>{this.onBookmark?this.onBookmark(e,t):this.switchView([e]),t.isPerspective&&this.startBimWalk()},clusterfck:this.options.clusterfck,clusteringThreshold:110})},{name:c.DropMe,getLoadingCondition:()=>!1===this.is3D,getOptions:()=>({enableGuidance:!0,onDrop:this._handleDropMe.bind(this),getTransformForNode:this._getTransformForNode.bind(this),getMain3DView:this._findMain3DView.bind(this),onHandleViewIn3D:this._handleViewIn3D.bind(this)})}]}async _loadExtensions(){this.extensions=this.options.extensions||this._getDefaultExtensions();const e=[];return this.extensions.forEach((t=>{t.getLoadingCondition&&!t.getLoadingCondition(this)||(e.push(this._loadExtension(t.name,t.getOptions&&t.getOptions(this),t.onLoadedCB)),this.extensionLoaded[t.name]=!0)})),Promise.all(e)}async _loadExtension(e,t,i){const n=this.options.extensionOptions,r=n&&n[e],o=Object.assign({},t,r),s=this.viewer.loadExtension(e,o);return i&&s.then((e=>{i(this,e)})).catch((e=>{i(this,null,e)})),s}_updateExtensions(e){const t=(e,t,i,n,r)=>{const o=this.extensionLoaded[e];!o&&i?this._loadExtension(e,t,n).catch((e=>this._onError(e))):o&&!i&&(r&&r(this),this.viewer.unloadExtension(e)),this.extensionLoaded[e]=i};this.extensions.forEach((i=>{i.getLoadingCondition&&t(i.name,i.getOptions&&i.getOptions(this),i.getLoadingCondition(this,e),i.onLoadedCB,i.onBeforeUnloadCB)}))}_initForFirstViewable(e){this.is3D!==e.is3D()&&(this.resetOnNextModelAdd||(this.reset(),this.resetTriggeringBubble=e),this.is3D=e.is3D()),this._updateExtensions(e),this._updateRefPoint(e)}_updateBookmarks(){let e=this.viewer.getExtension(c.Bookmarks);e&&e.resetBookmarks(this.bookmarks)}_applyPendingCameraWhenReady(){if(!this.cameraInitialized)return;let e=this.pendingCamera;this.pendingCamera=null;let t=this.viewer.impl.camera;e.position&&t.position.copy(e.position),e.target&&t.target.copy(e.target),e.up&&t.up.copy(e.up),e.fov&&(t.fov=e.fov),void 0!==e.isPerspective&&(t.isPerspective=e.isPerspective);const i=this.globalOffset||this.viewer.model.getData().globalOffset;!this.is3D||this.options.ignoreGlobalOffset||e.ignoreGlobalOffset||(t.position.sub(i),t.target.sub(i)),this.viewer.impl.syncCamera()}_findMain3DView(e){const t=e.getMasterViews();if(t[0])return t[0];const i=null==e?void 0:e.getRootNode();if(!i)return;const n=null==i?void 0:i.search(a.BubbleNode.MODEL_NODE),r=n.filter((e=>e.name().toLowerCase().startsWith("{3d")))[0];return r||n[0]}_handleDropMe(e,t,i,n,r){if(this.onDrop)this.onDrop(e,t,i,n);else if(n){if(this.switchView(n),e&&t){let i={position:e,target:e.clone().add(t),isPerspective:!0,ignoreGlobalOffset:r};this.setCameraGlobal(i)}}else console.warn("DropMe handler: Document does not contain a 3D view to switch to")}async _handleViewIn3D(e,t,i,n){if(i&&!this.options.ignoreGlobalOffset){const i=this.globalOffset||this.viewer.model.getData().globalOffset;e=e.clone().add(i),t=t.clone().add(i)}let r={position:e,target:t,isPerspective:!0};this.setCameraGlobal(r);const o=await this.viewer.getExtensionAsync(c.BimWalk);o.activate(),o.disableGravityUntilNextMove(),n&&n()}_startBimWalkWhenReady(){if(!this.bimWalkStartPending)return;let e=!this.resetOnNextModelAdd,t=this.viewer.getExtension(c.BimWalk),i=this.viewer.getExtension(c.FusionOrbit);e&&t&&i&&(t.activate(),this.bimWalkStartPending=!1)}_unloadDiffTool(e){this.viewer.getExtension(c.DiffTool)&&(e&&(this.diffCache.length=0),this.viewer.unloadExtension(c.DiffTool))}_onProgressUpdate(e){e.model&&e.state===a.ProgressState.LOADING&&(this.loadersInProgress[e.model.id]=e.percent,this._updateDiffLoadProgress())}_getDiffSupportModels(){if(this.diff.supportBubbles)return{diff:this.getModel(this.diff.supportBubbles.diff),primary:this.getModel(this.diff.supportBubbles.primary)}}_diffSupportModelsReady(){const e=this._getDiffSupportModels(),t=e.diff&&e.diff.isLoadDone(),i=e.primary&&e.primary.isLoadDone();return t&&i}_updateGhosting(){let e={};this.diff.enabled&&this.diffBubbles&&(e=this.diffBubbles.forEach((t=>e[t.getModelKey()])));for(let t in this.modelItems){let i=this.getModel(t);if(!i)continue;let n=this.diff.enabled&&!e[t];n!=!!this.modelIsGhosted[t]&&(i.setAllVisibility(!n),n?this.modelIsGhosted[t]=!0:delete this.modelIsGhosted[t])}}getModels(e){return e.map((e=>this.getModel(e)))}setModelTheming(e){e=e||{};const t=this.modelThemingStates;this.modelThemingStates={};for(let i in e){let n=t[i];const r=e[i],o=this.getModel(i);if(n){!n.color.equals(r)&&(n.color.copy(r),n.active=!1)}else n=new x(r);this.modelThemingStates[i]=n,o&&this._updateModelTheming(o)}for(let i in t){const n=t[i],r=!e[i],o=this.getModel(i);r&&n.active&&o&&this.viewer.clearThemingColors(o)}}_signalDiffLoadProgress(e,t){if(t||e!==this._lastDiffLoadPercent){const t=a.i18n.t("Loading Model for Change Visualization");this.diff.progressCallback(e,t),this._lastDiffLoadPercent=e}}_updateDiffLoadProgress(){if(!this.diffNeedsUpdate||!this.diff.enabled||this.diff.empty||!this.diff.progressCallback)return;const e=this.getModels(this.diff.diffBubbles),t=this.getModels(this.diff.primaryBubbles),i=e.concat(t),n=this._getDiffSupportModels();n&&i.push(n.diff,n.primary);const r=i.filter(Boolean).length;if(r<i.length){const e=Math.floor(10*r/i.length);return void this._signalDiffLoadProgress(e)}if(!this.is3D){const e=(e,t)=>e+(0|this.loadersInProgress[t.id]),t=i.reduce(e,0),n=100*i.length,r=10+Math.floor(90*t/n);return void this._signalDiffLoadProgress(r)}const o=i.reduce(((e,t)=>e+t.getData().fragsLoadedNoGeom),0),s=i.reduce(((e,t)=>e+t.getData().metadata.stats.num_fragments),0),a=10+Math.floor(90*o/s);this._signalDiffLoadProgress(a)}_updateDiff(){if(!this.diffNeedsUpdate)return;if(this._updateGhosting(),this._updateDiffLoadProgress(),!this.diff.enabled)return this._unloadDiffTool(),void this._updateAllModelTheming();const e=this.getModels(this.diff.diffBubbles),t=this.getModels(this.diff.primaryBubbles);if(this.diff.customCompute){let i=t,n=e;const r=[this.diff.customCompute].flat();for(const e of r)[i,n]=e.init(i,n)}for(let i=0;i<e.length;i++){const n=e[i],r=t[i],o=n instanceof a.Model&&(n.isOTG()||n.isLoadDone()),s=r instanceof a.Model&&(r.isOTG()||r.isLoadDone());if(!o||!s)return;if(!n.getPropertyDb()||!r.getPropertyDb())return}let i;if(!!this.diff.supportBubbles){if(!this._diffSupportModelsReady())return;i=this._getDiffSupportModels()}const n=performance.now()-this.diffStartTime;console.log("Time for loading diff models: ",n),this._updateAllModelTheming(),this._setDiffModels(e,t,i)}_setDiffModels(e,t,i){if(this.diffNeedsUpdate=!1,!t.length)return void this._unloadDiffTool();const n=this.viewer.getExtension(c.DiffTool);if(n)n.replaceModels(e,t,i);else{const n={diffModels:e,primaryModels:t,supportModels:i,diffadp:!1,availableDiffModes:["overlay","sidebyside"],diffMode:"overlay",customCompute:this.diff.customCompute,versionA:this.diff.primaryBubbleLabel,versionB:this.diff.diffBubbleLabel,refNames:this.diff.refNames,mimeType:"application/vnd.autodesk.revit",hotReload:!0,diffCache:this.diffCache,useSplitScreenExtension:!0,showDetailsSection:!0,progress:(e,t)=>{this.diff.progressCallback&&(t!==Autodesk.DiffTool.DIFFTOOL_PROGRESS_STATES.LoadingPropDb?(100===e&&this.onDiffDone&&this.onDiffDone(),this.diff.progressCallback(e,a.i18n.t("Computing change visualization"))):this.diff.progressCallback(e,a.i18n.t("Loading element properties")))},excludeFromDiff:(e,t)=>this.levelsExtension&&!this.levelsExtension.floorSelector.isVisible(e,t),setNodesOff:e=>{const t=this.levelsExtension;t&&t.floorSelector._floorSelectorFilter.reApplyFilter(e)},hideModeSwitchButton:!0,externalUi:this.diff.externalUi,attachDetachViewerEventHandlers:this.diff.attachDetachViewerEventHandlers,onDiffModeChanged:this.diff.onDiffModeChanged,onInitialized:this.diff.onInitialized};this._loadExtension(c.DiffTool,n).catch((e=>this._onError(e)))}}_updateModelTheming(e){const t=p(e),i=this.modelThemingStates[t];if(!i)return;const n=!this.viewer.getExtension(c.DiffTool);i.setEnabled(e,n),i.update(e),this.viewer.impl.invalidate(!0)}_updateAllModelTheming(){for(let e in this.modelItems){let t=this.getModel(e);t&&this._updateModelTheming(t)}}async getAlignmentService(){return this.alignmentService||(this._alignmentServicePromise?await this._alignmentServicePromise:(this._alignmentServicePromise=this._initAlignmentService(),await this._alignmentServicePromise,this._alignmentServicePromise=null)),this.alignmentService}isUsingAlignmentService(){return this.options.createModelAlignmentService||this.alignmentService}async _initAlignmentService(){const e=this.options.createModelAlignmentService;if(!e)return;await this.viewer.loadExtension("Autodesk.ModelAlignmentService").then((async()=>{const t=await e();this.viewer&&this.setAlignmentService(t)}))}async _getTransformForNode(e){const t=await this.getAlignmentService();if(!t)return;await Promise.all(this.pendingAlignmentFetches);const i=e.getRootNode().urn(),n=e.is2D()?e.name():void 0;return await t.loadTransform(i,n)}async _applyAlignmentService(e,t){if(e.is2D())return;if(this.alignmentServiceFailed)return;const i=await this._getTransformForNode(e);this._checkAlignmentService()&&(!function(){l.analytics.track(...arguments)}("viewer.modelalignment.alignment_loaded",{hasAlignmentTransform:Boolean(i)}),i&&(t.applyRefPoint=!1,t.placementTransform=i,t.applyPlacementInModelUnits=!0))}_checkAlignmentService(){if(this.alignmentServiceFailed||!this.alignmentService)return!1;if(this.alignmentService.isWorking())return!0;const e=s.Z.t("Failed to connect to alignment service: Model alignment support is temporarily unavaible. Models with alignment transforms may not appear correctly and alignment editing is disabled.");this.fireEvent({type:h.ALIGNMENT_SERVICE_FAILED,message:e}),l.logger.error("AggregatedView: Disabled alignment due to alignment service connection error."),this.alignmentServiceFailed=!0}_connectModelAlignment(e){const t=this.viewer.getExtension(e);t&&t.setAlignmentService(this.alignmentService)}}_.ExtNames=c,_.AlignmentServices=u,_.Events=h},62383:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CameraLS:()=>a});var n=i(27293);const r=e=>isFinite(e.x)&&isFinite(e.y)&&isFinite(e.z),o=e=>{const t=e.isPerspective||isFinite(e.orthoScale);return r(e.position)&&r(e.target)&&r(e.up)&&t};class s{constructor(){this.cacheObj={}}setItem(e,t){this.cacheObj[e]=t}getItem(e){return this.cacheObj[e]}}class a{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{useLocalStorage:!0};this.aggregatedView=e,this.options=t,this.key=void 0,this.options.useLocalStorage?this.cache=Autodesk.Viewing.Private.LocalStorage:this.cache=new s,this.unloadCb=this.saveCamera.bind(this),this.addWindowEventListener("beforeunload",this.unloadCb)}destroy(){this.unsetKey(),this.removeWindowEventListener("beforeunload",this.unloadCb)}setKey(e){this.key=e}unsetKey(){this.key=void 0}saveCamera(){if(!this.aggregatedView.cameraInitialized||!this.key)return;const e=this.aggregatedView.viewer.impl.camera;if(!o(e))return;const t=this.aggregatedView.isBimWalkActive(),i=this.aggregatedView.is3D?this.aggregatedView.globalOffset:void 0;this.saveStartCamera(this.key,this.aggregatedView.viewer.impl.camera,t,i)}saveStartCamera(e,t,i,n,r){const o=JSON.stringify({offset:n,position:t.position,target:t.target,up:t.up,orthoScale:t.orthoScale,isPerspective:t.isPerspective,fov:t.fov,startBimWalk:i,ignoreGlobalOffset:r});this.cache.setItem(e,o)}clearItem(e){this.cache.setItem(e)}loadCamera(){if(!this.key)return!1;let e;try{const t=this.cache.getItem(this.key);e=JSON.parse(t)}catch(e){}if(!(e&&e.position&&e.target&&e.up))return!1;const t=e=>new THREE.Vector3(parseFloat(e.x),parseFloat(e.y),parseFloat(e.z)),i={position:t(e.position),target:t(e.target),up:t(e.up),isPerspective:Boolean(e.isPerspective),fov:parseFloat(e.fov),ignoreGlobalOffset:Boolean(e.ignoreGlobalOffset)};if(e.orthoScale&&(i.orthoScale=parseFloat(e.orthoScale)),!o(i))return!1;const n=e.offset?t(e.offset):void 0;if(n){if(!r(n))return;i.position.add(n),i.target.add(n)}this.aggregatedView.setCameraGlobal(i),e.startBimWalk&&this.aggregatedView.startBimWalk()}}n.GlobalManagerMixin.call(a.prototype)},38215:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Document:()=>p});var n=i(77693),r=i(82079),o=i(75121),s=i(32154),a=i(16840),l=i(49720),c=i(53005),h=i(43644),u=(0,a.getGlobal)(),d=u;function p(e,t,i){this.myPath=t,this.myData=e,e&&(this.docRoot=new n.BubbleNode(e),this.docRoot.setDocument(this)),this.myNumViews={},this.acmSessionId=i;var r=this;this.docRoot.traverse((function(e){if(e.isViewPreset()){const t=e.findParentGeom2Dor3D();if(t){let e=r.myNumViews[t.guid()]||0;r.myNumViews[t.guid()]=e+1}}})),0===this.docRoot.findAllViewables().length&&l.logger.error("Document contains no viewables.")}p.load=function(e,t,i,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};var l,d,f=p.getDocumentPath(e);function m(t){var i=e.split(":");i=i[1];var n=(0,h.fromUrlSafeBase64)(i);for(let e=0;e<t.length;e++)if(n.indexOf(t[e])>-1)return!0;return!1}const g=["urn:adsk.wipemea","urn:adsk.wipbimemea"];if(e.startsWith("urn")&&m(g)){var v=o.endpoint.getApiFlavor(),y=(0,o.getEnv)(),b=v===o.endpoint.ENDPOINT_API_DERIVATIVE_SERVICE_V2&&!y.endsWith("EU"),x=y.endsWith("US")&&v===o.endpoint.ENDPOINT_API_D3S,_=v===o.endpoint.ENDPOINT_API_DERIVATIVE_STREAMING&&!v.endsWith("_EU");if(v+="_EU",b)o.endpoint.setEndpointAndApi(null,v);else if(x){y=y.replace("US","EU"),(0,o.setEnv)(y);var E=c.EnvironmentConfigurations[y];o.endpoint.setEndpointAndApi(E.ROOT,v)}else _&&o.endpoint.setEndpointAndApi(null,v)}function A(e){(o.endpoint.isSVF2Backend()||o.endpoint.isOtgBackend())&&(l=l?e.urn+","+l:e.urn);var n=new p(e,f,l);if(n.getRoot().search({type:"geometry"}).length>0)d=n.getGlobalMessages(),t&&t(n,d);else if(i){d=n.getGlobalMessages();var s=r.ErrorCodes.BAD_DATA_NO_VIEWABLE_CONTENT;i(s,"No viewable content",d)}}function S(e,t,n){if(401===e&&void 0===u.LMV_THIRD_PARTY_COOKIE)u.LMV_THIRD_PARTY_COOKIE=!1,(0,c.refreshRequestHeader)(c.token.accessToken),w();else if(i){var o="Error: "+e+" ("+t+")",s=(0,r.getErrorCode)(e);i(s,o,e,t,n)}}function w(){var e=!n||(o.endpoint.isSVF2Backend()||o.endpoint.isOtgBackend())&&!n["x-ads-acm-scopes"];l||e?s.ViewingService.getManifest(o.endpoint.initLoadContext(a),f,A,S):(n.oauth2AccessToken||(n.oauth2AccessToken=c.token.accessToken),s.ViewingService.getACMSession(o.endpoint.getApiEndpoint(),n,(function(e){l=e,a.queryParams=l?"acmsession="+l:"",o.endpoint.setAcmSession(l),s.ViewingService.getManifest(o.endpoint.initLoadContext(a),f,A,S)}),i))}w()},p.getDocumentPath=function(e){if(-1===e.indexOf("urn:")){if(-1!==e.indexOf("://"))return e;var t=e;return"undefined"!=typeof window?(0!==t.indexOf("/")&&(t="/"+t),d.location.protocol+"//"+d.location.host+t):t}return e},p.requestThumbnailWithSecurity=function(e,t){var i={responseType:"blob",skipAssetCallback:!0,size:e.width,guid:e.guid,acmsession:e.acmsession},n="urn:"+e.urn,r=void 0;if(!(0,a.getGlobal)().USE_OTG_DS_PROXY){var l=(0,o.getEnv)();r=c.EnvironmentConfigurations[l].UPSTREAM;const e=(0,c.getUpstreamApiData)(l,o.endpoint.getApiFlavor());i.apiData=e}s.ViewingService.getThumbnail(o.endpoint.initLoadContext({endpoint:r}),n,(function(e){t(null,e)}),(function(){t("error",null)}),i)},p.prototype.getAcmSessionId=function(e){return p.getAcmSessionId(e,this.acmSessionId)},p.getAcmSessionId=function(e,t){if(!e)return"";let i=e.indexOf("urn:adsk.fluent")>=0;return(0,a.getGlobal)().USE_OTG_DS_PROXY||i||!o.endpoint.isSVF2Backend()&&!o.endpoint.isOtgBackend()?t:t.split(",")[1]||""},p.prototype.getFullPath=function(e){if(!e)return e;var t=e;if((0,o.isOffline)())-1==t.indexOf((0,o.getOfflineResourcePrefix)())&&(t=decodeURIComponent((0,o.getOfflineResourcePrefix)())+t.substr(t.indexOf("/")));else if(0===e.indexOf("urn")){if(0===e.indexOf("urn:adsk.fluent")||!o.endpoint.isSVF2Backend()&&!o.endpoint.isOtgBackend())t=o.endpoint.getItemApi(null,e),o.endpoint.ENDPOINT_API_MODEL_DERIVATIVE_V2===o.endpoint.getApiFlavor()&&(t=decodeURIComponent(t));else{const i=(0,o.getEnv)(),n=c.EnvironmentConfigurations[i],r=(0,a.getGlobal)().USE_OTG_DS_PROXY?null:n.UPSTREAM,s=(0,c.getUpstreamApiData)(i,o.endpoint.getApiFlavor());t=o.endpoint.getItemApi(r,e,s)}}else 0===e.indexOf("$file$")&&(t=this.myPath.replace("/bubble.json",e.replace("$file$","")));return t},p.prototype.getThumbnailOptions=function(e,t,i){var n=t||200,r=i||200,o=e.urn||this.myData.urn;return{urn:o,width:n,height:r,guid:e.guid,acmsession:this.getAcmSessionId(o)}},p.prototype.getThumbnailPath=function(e,t,i){var n=this.getThumbnailOptions(e,t,i),r=o.endpoint.getThumbnailApi(null,n.urn)+"?width="+n.width+"&height="+n.height;n.guid&&(r+="&guid="+n.guid),n.acmsession&&(r+="&acmsession="+n.acmsession);var s=o.endpoint.getQueryParams();return s&&(r+="&"+s),r},p.prototype.getLeafletZipParams=function(e,t){for(var i,n,r=t.search({role:"leaflet-zip"},!1),o=0;o<r.length;o++){n={};var s=(i=r[o]._raw()).urn;n.urnZip=this.getFullPath(s),n.centralDirOffset=i.central_dir_offset,n.centralDirLength=i.central_dir_length,n.centralDirEntries=i.central_dir_entries,n.zipMaxLevel=i.max_level-e.levelOffset,n.loadFromZip=!!(n.urnZip&&n.centralDirOffset&&n.centralDirLength&&n.centralDirEntries),n.fileTable={},e.zips||(e.zips=[]),e.zips.push(n)}e.zips.sort((function(e,t){return e.zipMaxLevel-t.zipMaxLevel}))},p.prototype.getLeafletParams=function(e,t,i){e.tileSize=i.tileSize?i.tileSize:512,e.texWidth=i.resolution[0],e.texHeight=i.resolution[1],e.paperWidth=i.paperWidth,e.paperHeight=i.paperHeight,e.paperUnits=i.paperUnits,e.urlPattern=i.urn,e.mime=i.mime,e.isLeaflet=!0,e.levelOffset=function(e){for(var t=1,i=0,n=0;n<20;n++){if((t*=2)>e)return i;i++}return l.logger.log("unexpected leaflet tileSize"),0}(e.tileSize),this.getLeafletZipParams(e,t),e.loadFromZip=e.zips&&e.zips[0].loadFromZip,e.zips&&(0,o.isOffline)()&&(0,a.isMobileDevice)()&&(e.zips=e.zips.slice(0,1),e.maxLevel=e.zips[0].zipMaxLevel)},p.prototype.derivePdfUrnHack=function(e,t){var i=e.parent.children.slice();i.sort(((e,t)=>e._raw().order-t._raw().order));let r;r=i.length<=75?i[i.length-1]:i[74];let o=r.search(n.BubbleNode.GEOMETRY_F2D_NODE)[0];if(o){var s=o.urn().indexOf("/"),a=o.urn().slice(0,s),l=e._raw().order,c=0|l%75,h=1+(0|l/75),u=a+`/output/${c}/${c}.pdf`;return t.page=h,t.isPdf=!0,console.log("pdf path",u),u}return null},p.prototype.getViewableUrn=function(e,t){let i;if(e instanceof n.BubbleNode)i=e;else{let t=this.docRoot.search(e);i=t.length>0?t[0]:new n.BubbleNode(e)}const r=()=>{const e=i.search(n.BubbleNode.GEOMETRY_F2D_NODE);if(e.length)return e[0].urn()},o=()=>{if(i.isRevitPdf()){const e=r();if(e)return e}var e=i.data.totalRasterPixels;"number"!=typeof e&&(e=1/0);var o=e<1<<21,s="true"===(0,h.getParameterByName)("vectorPdf")||(0,a.getGlobal)().LMV_VECTOR_PDF||this.myData&&this.myData.isVectorPDF||!!i.data.isVectorPDF,l="false"===(0,h.getParameterByName)("vectorPdf")||(0,a.getGlobal)().LMV_RASTER_PDF;s?o=!0:l&&(o=!1);var c=i.search(n.BubbleNode.PDF_PAGE_NODE),u=i.search(n.BubbleNode.LEAFLET_NODE);if(o&&u.length>0&&t&&(this.getLeafletParams(t,i,u[0]._raw()),t.tempRasterPath=u[0].urn()),o&&c.length)return t&&(t.isPdf=!0,t.page=c[0].data.page||1),c[0].urn();if(u.length>0&&t){if(s){var d=this.derivePdfUrnHack(i,t);if(d)return d}return this.getLeafletParams(t,i,u[0]._raw()),u[0].urn()}};if(i.isGeometry()){if(i.is3D())return i.getViewableRootPath();if(i.is2D()){const e=o()||(()=>{const e=i.search(n.BubbleNode.IMAGE_NODE);if(e.length)return e[0].urn()})()||r();if(e)return e}}else if(i.isViewPreset()){var s=this.getViewGeometry(i,!0);if(s)return this.getViewableUrn(s,t)}return""},p.prototype.getViewablePath=function(e,t){var i=this.getViewableUrn(e,t);return i?this.getFullPath(i):""},p.prototype.downloadAecModelData=function(e){const t=e?t=>{try{e(t)}catch(e){console.error("Document.downloadAecModelData() onFinished handler crashed",e)}return t}:e=>e;if(this.downloadAecModelDataPromise)return this.downloadAecModelDataPromise.then(t),this.downloadAecModelDataPromise;var i=this.docRoot.findViewableParent(),n=i&&i.data.aec_model_data;if(n)return t(n),Promise.resolve(n);var r=this.docRoot.search({role:"Autodesk.AEC.ModelData"})[0];if(!r)return t(),Promise.resolve(null);let a=r.getViewableRootPath();const l=this.getFullPath(a),h={headers:{}},u=this.getAcmSessionId(l);return-1!==l.indexOf(".api.autodesk.com")&&c.token.accessToken&&(h.headers.Authorization="Bearer "+c.token.accessToken),u&&(h.queryParams="acmsession="+u),this.downloadAecModelDataPromise=new Promise((e=>{var t=t=>{r.findViewableParent().data.aec_model_data=t,e(t)};s.ViewingService.getItem(o.endpoint.initLoadContext(h),l,(e=>t(e)),(()=>t()),{responseType:"json"})})).then((e=>(delete this.downloadAecModelDataPromise,e))).then(t),this.downloadAecModelDataPromise},p.getAecModelData=function(e){if(Array.isArray(e)){let t=new Map,i=e.map((e=>{let i=e.getDocument(),n=t.get(i);if(n)return n;{let e=i.downloadAecModelData();return t[i]=e,e}}));return Promise.all(i)}return e.getDocument().downloadAecModelData()},p.prototype.getRoot=function(){return this.docRoot},p.prototype.getPath=function(){return this.myPath},p.prototype.getViewGeometry=function(e){return e.findParentGeom2Dor3D()},p.prototype.getNumViews=function(e){var t=e.guid;return e instanceof n.BubbleNode&&(t=e.guid()),this.myNumViews[t]||0},p.prototype.getMessages=function(e,t){var i=[];if(!e)return i;for(var n=e;n&&(!t||n.parent);)n._raw().messages&&(i=i.concat(n._raw().messages)),n=n.parent;return i},p.prototype.getGlobalMessages=function(){var e=[],t=0,i=0;this.getRoot().traverse((function(n){var r=n._raw().messages||[];r.filter((function(e){return"error"===e.type})).length>0&&(t+=1),"inprogress"===n._raw().status&&(i+=1),e=e.concat(r)}));var n="translated";n=t>0?"failed":n,n=i>0?"processing":n;for(var r=e.length;r--;e[r].$translation=n);return e}},7452:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DynamicGlobalOffset:()=>a});const n=Autodesk.Viewing.Private;let r=null,o=null,s=null;class a{constructor(e){this.viewer=e,this.enabled=!1,this.onCameraChanged=this.onCameraChanged.bind(this);this.maxDistSq=1e8,this.setActive(!0)}setActive(e){e!=this.enabled&&(this.enabled=e,e?this.viewer.addEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,this.onCameraChanged):this.viewer.removeEventListener(Autodesk.Viewing.CAMERA_CHANGE_EVENT,this.onCameraChanged))}static updateModelMatrix(e,t,i){r=r||new n.LmvMatrix4(!0),o=o||new n.LmvMatrix4(!0),s=s||new n.LmvMatrix4(!0);const a=e.myData.placementWithOffset?r.copy(e.myData.placementWithOffset).invert():r.identity(),l=t?o.copy(t):o.identity();i&&(l.elements[12]-=i.x,l.elements[13]-=i.y,l.elements[14]-=i.z);const c=s.multiplyMatrices(l,a);e.setModelTransform(c)}onCameraChanged(){if(this.viewer.impl.is2d)return;if(this.blockEvents)return;const e=this.viewer.toolController.getTool("orbit");if(null!=e&&e.isDragging)return;if(this.viewer.impl.camera.position.lengthSq()<this.maxDistSq)return;this.blockEvents=!0;const t=this.viewer.impl.camera.getGlobalPosition();this.resetGlobalOffset(t),this.blockEvents=!1}resetGlobalOffset(e){this.viewer.getVisibleModels().forEach((t=>{t.setGlobalOffset(e),this.viewer.impl.onModelTransformChanged(t)})),this.viewer.impl.camera.setGlobalOffset(e),this.viewer.impl.syncCamera(),this.viewer.autocam&&this.viewer.autocam.onGlobalOffsetChanged(e),this.viewer.autocam.sync(this.viewer.impl.camera)}}},78443:(e,t,i)=>{"use strict";i.r(t),i.d(t,{EventDispatcher:()=>n});let n=function(){};n.prototype={constructor:n,apply:function(e){e.addEventListener=n.prototype.addEventListener,e.hasEventListener=n.prototype.hasEventListener,e.removeEventListener=n.prototype.removeEventListener,e.clearListeners=n.prototype.clearListeners,e.fireEvent=n.prototype.fireEvent,e.dispatchEvent=n.prototype.fireEvent,e.debugEvents=n.prototype.debugEvents},addEventListener:function(e,t,i){if(e){void 0===this.listeners&&(this.listeners={}),void 0===this.listeners[e]&&(this.listeners[e]=[]);for(var n=i&&i.priority||0,r=this.listeners[e].length,o=this.listeners[e].length-1;o>=0&&n>this.listeners[e][o].priority;o--)r--;this.listeners[e].splice(r,0,{callbackFn:t,once:!!i&&!!i.once,priority:n})}},hasEventListener:function(e,t){if(!e)return!1;if(void 0===this.listeners)return!1;var i=this.listeners[e];if(!i||0===i.length)return!1;for(var n=0,r=i.length;n<r;++n)if(i[n].callbackFn===t)return!0;return!1},removeEventListener:function(e,t){if(e)if(void 0!==this.listeners){var i=this.listeners[e];if(i)for(var n=0,r=i.length;n<r;++n)if(i[n].callbackFn===t){i.splice(n,1);break}}else this.listeners={}},clearListeners:function(){this.listeners=void 0},dispatchEvent:function(e){if(void 0!==this.listeners){if("string"==typeof e&&(e={type:e}),!e.target)try{e.target=this}catch(e){}if(!e.type)throw new Error("event type unknown.");if(this._doDebug&&console.log("Event: "+e.type),Array.isArray(this.listeners[e.type])){for(var t=this.listeners[e.type].slice(),i=[],n=0,r=t.length;n<r;++n)t[n].callbackFn.call(this,e),t[n].once&&i.push(t[n].callbackFn);for(var o=0;o<i.length;++o)this.removeEventListener(e.type,i[o])}}else this.listeners={}},debugEvents:function(e){this._doDebug=e}},n.prototype.fireEvent=n.prototype.dispatchEvent,"undefined"!=typeof Autodesk&&(Autodesk.Viewing.EventDispatcher=n)},33423:e=>{"use strict";var t=e.exports;t.ESCAPE_EVENT="escape",t.PROGRESS_UPDATE_EVENT="progress",t.FULLSCREEN_MODE_EVENT="fullScreenMode",t.NAVIGATION_MODE_CHANGED_EVENT="navmode",t.VIEWER_STATE_RESTORED_EVENT="viewerStateRestored",t.VIEWER_RESIZE_EVENT="viewerResize",t.VIEWER_INITIALIZED="viewerInitialized",t.VIEWER_UNINITIALIZED="viewerUninitialized",t.LOADER_LOAD_FILE_EVENT="loaderLoadFile",t.LOADER_LOAD_ERROR_EVENT="loaderLoadError",t.LOADER_REPAINT_REQUEST_EVENT="loaderRepaint",t.MODEL_ROOT_LOADED_EVENT="svfLoaded",t.GEOMETRY_LOADED_EVENT="geometryLoaded",t.TEXTURES_LOADED_EVENT="texturesLoaded",t.OBJECT_TREE_CREATED_EVENT="propertyDbLoaded",t.OBJECT_TREE_UNAVAILABLE_EVENT="propertyDbUnavailable",t.OBJECT_TREE_LOAD_PROGRESS_EVENT="propertyDbLoadProgress",t.MODEL_UNLOADED_EVENT="modelUnloaded",t.BEFORE_MODEL_UNLOAD_EVENT="beforeModelUnload",t.MODEL_ADDED_EVENT="modelAdded",t.MODEL_REMOVED_EVENT="modelRemoved",t.MODEL_LAYERS_LOADED_EVENT="modelLayersLoaded",t.MODEL_TRANSFORM_CHANGED_EVENT="modelTransformChanged",t.MODEL_PLACEMENT_CHANGED_EVENT="placementTransformChanged",t.MODEL_VIEWPORT_BOUNDS_CHANGED_EVENT="viewportBoundsChanged",t.MODEL_FRAGMENT_BOUNDING_BOXES_SET_EVENT="fragmentBoundingBoxesSet",t.EXTENSION_PRE_LOADED_EVENT="extensionPreLoaded",t.EXTENSION_LOADED_EVENT="extensionLoaded",t.EXTENSION_PRE_UNLOADED_EVENT="extensionPreUnloaded",t.EXTENSION_UNLOADED_EVENT="extensionUnloaded",t.EXTENSION_PRE_ACTIVATED_EVENT="extensionPreActivated",t.EXTENSION_ACTIVATED_EVENT="extensionActivated",t.EXTENSION_PRE_DEACTIVATED_EVENT="extensionPreDeactivated",t.EXTENSION_DEACTIVATED_EVENT="extensionDeactivated",t.SELECTION_CHANGED_EVENT="selection",t.AGGREGATE_SELECTION_CHANGED_EVENT="aggregateSelection",t.ISOLATE_EVENT="isolate",t.AGGREGATE_ISOLATION_CHANGED_EVENT="aggregateIsolation",t.HIDE_EVENT="hide",t.AGGREGATE_HIDDEN_CHANGED_EVENT="aggregateHidden",t.SHOW_EVENT="show",t.SHOW_PROPERTIES_EVENT="showProperties",t.SHOW_ALL_EVENT="showAll",t.HIDE_ALL_EVENT="hideAll",t.CAMERA_CHANGE_EVENT="cameraChanged",t.EXPLODE_CHANGE_EVENT="explodeChanged",t.FIT_TO_VIEW_EVENT="fitToView",t.AGGREGATE_FIT_TO_VIEW_EVENT="aggregateFitToView",t.CUTPLANES_CHANGE_EVENT="cutplanesChanged",t.TOOL_CHANGE_EVENT="toolChanged",t.RENDER_OPTION_CHANGED_EVENT="renderOptionChanged",t.FINAL_FRAME_RENDERED_CHANGED_EVENT="finalFrameRenderedChanged",t.RENDER_PRESENTED_EVENT="renderPresented",t.LAYER_VISIBILITY_CHANGED_EVENT="layerVisibility",t.PREF_CHANGED_EVENT="PrefChanged",t.PREF_RESET_EVENT="PrefReset",t.RESTORE_DEFAULT_SETTINGS_EVENT="restoreDefaultSettings",t.ANIMATION_READY_EVENT="animationReady",t.CAMERA_TRANSITION_COMPLETED="cameraTransitionCompleted",t.HYPERLINK_EVENT="hyperlink",t.HYPERLINK_NAVIGATE="hyperlink_navigate",t.LOAD_GEOMETRY_EVENT="load_geometry",t.LOAD_MISSING_GEOMETRY="loadMissingGeometry",t.WEBGL_CONTEXT_LOST_EVENT="webglcontextlost",t.WEBGL_CONTEXT_RESTORED_EVENT="webglcontextrestored",t.CANCEL_LEAFLET_SCREENSHOT="cancelLeafletScreenshot",t.SET_VIEW_EVENT="setView",t.RENDER_FIRST_PIXEL="renderFirstPixel",t.PROFILE_CHANGE_EVENT="profileChanged",t.RENDER_SCENE_PART="renderScenePart",t.OBJECT_UNDER_MOUSE_CHANGED="hoverObjectChanged",t.ANIM_ENDED="animEnded",t.TRANSITION_STARTED="transitionStarted",t.TRANSITION_ENDED="transitionEnded"},21553:(e,t,i)=>{"use strict";i.r(t),i.d(t,{EventUtils:()=>s});var n=i(16840);let r=!1,o=!1;class s{static isRightClick(e){if(!(e instanceof a(e).MouseEvent))return!1;let t=e.button;"buttons"in e&&(!o||1&e.buttons?2===t&&1&e.buttons&&(t=0,o=!0):(o=!1,t=0));return t===(r?0:2)}static isMiddleClick(e){return e instanceof a(e).MouseEvent&&1===e.button}static setUseLeftHandedInput(e){r=e}static async waitUntilTransitionEnded(e){if(e.navigation.getRequestTransition()||e.navigation.getTransitionActive())return new Promise((t=>{setTimeout((()=>{e.navigation.getRequestTransition()||e.navigation.getTransitionActive()?e.addEventListener(Autodesk.Viewing.CAMERA_TRANSITION_COMPLETED,t,{once:!0}):t()}))}))}static async waitUntilGeometryLoaded(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.model;if(!t||!t.isLoadDone())return new Promise((i=>{const n=r=>{t&&t!==r.model||(i(),e.removeEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT,n))};e.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT,n)}))}static async waitUntilModelAdded(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.model;if(!t)return new Promise((i=>{const n=r=>{t&&t!==r.model||(i(),e.removeEventListener(Autodesk.Viewing.MODEL_ADDED_EVENT,n))};e.addEventListener(Autodesk.Viewing.MODEL_ADDED_EVENT,n)}))}}function a(e){const t=e.target&&e.target.ownerDocument;return t?t.defaultView||t.parentWindow:(0,n.getGlobal)()}Autodesk.Viewing.isRightClick=s.isRightClick,Autodesk.Viewing.isMiddleClick=s.isMiddleClick},20457:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Extension:()=>o});var n=i(63740),r=i(27293),o=function(e,t){this.viewer=e,r.GlobalManagerMixin.call(this),this.setGlobalManager(e.globalManager),this.options=t||{},this.id="",this.modes=[],this.mode="",this.name="",this.activeStatus=!1};o.prototype.load=function(){return!0},o.prototype.unload=function(){return!0},o.prototype.activate=function(e){return!0},o.prototype.deactivate=function(){return!0},o.prototype.setActive=function(e,t){e?this.activate(t):this.deactivate()},o.prototype.getName=function(){return this.name},o.prototype.getModes=function(){return this.modes},o.prototype.isActive=function(e){return e?this.activeStatus&&this.mode===e:this.activeStatus},o.prototype.getState=function(e){},o.prototype.restoreState=function(e,t){return!0},o.prototype.extendLocalization=function(e){return(0,n.extendLocalization)(e)},o.prototype.getCache=function(){this.viewer.extensionCache||(this.viewer.extensionCache={});var e=this.viewer.extensionCache[this.id];return e||(e=this.viewer.extensionCache[this.id]={}),e},o.prototype.onToolbarCreated=function(e){},"undefined"!=typeof Autodesk&&(Autodesk.Viewing.Extension=o)},9749:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ExtensionMixin:()=>c,theExtensionManager:()=>l});var n=i(49720),r=i(73993),o=i(33423),s=i(36291);const a=Autodesk.Viewing;const l=new class{constructor(){this.registeredExtensions=new Map}registerExtension(e,t){if(this.registeredExtensions.has(e)){const i=this.registeredExtensions.get(e);if(i.EXTENSION_CLASS)return!1;i.EXTENSION_CLASS=t}else this.registeredExtensions.set(e,{EXTENSION_CLASS:t});return!0}getExtensionClass(e){return this.registeredExtensions.has(e)?this.registeredExtensions.get(e).EXTENSION_CLASS:null}unregisterExtension(e){return!!this.registeredExtensions.has(e)&&(this.registeredExtensions.delete(e),!0)}registerExternalExtension(e,t,i){return!this.registeredExtensions.has(e)&&(this.registeredExtensions.set(e,{EXTENSION_CLASS:null,externalPathOrCallback:t,dependencies:i}),!0)}getExternalPath(e){return this.registeredExtensions.has(e)?this.registeredExtensions.get(e).externalPathOrCallback:null}getRegisteredExtensions(){return Array.from(this.registeredExtensions).map((e=>{let[t,i]=e;return{id:t,inMemory:!!i.EXTENSION_CLASS,isAsync:!!i.externalPathOrCallback}}))}downloadExtension(e){if(!this.registeredExtensions.has(e))return Promise.reject("Extension not found: "+e+". Has it been registered(1)?");const t=this.registeredExtensions.get(e);if(!t.externalPathOrCallback)return Promise.reject("Extension not found: "+e+". Has it been registered(2)?");if(t.downloadPromise)return t.downloadPromise;const i=(t.dependencies||[]).map((e=>this.downloadExtension(e))),n=Promise.all(i);return t.downloadPromise=n.then((()=>"string"==typeof t.externalPathOrCallback?r.theResourceLoader.loadScript(t.externalPathOrCallback,e):t.externalPathOrCallback())).then((()=>{if(delete t.downloadPromise,!t.EXTENSION_CLASS)throw new Error("Extension not found: "+e+". Has it been registered(3)?");return t.EXTENSION_CLASS})),t.downloadPromise}popuplateOptions(e){this.registeredExtensions.forEach((t=>{t.EXTENSION_CLASS.populateDefaultOptions(e)}))}isDownloading(e){return!!this.registeredExtensions.has(e)&&!!this.registeredExtensions.get(e).downloadPromise}isAvailable(e){return!!this.getExtensionClass(e)}},c=function(){};c.prototype={loadExtension:function(e,t){return this.loadedExtensions=this.loadedExtensions||{},l.isAvailable(e)?this.loadExtensionLocal(e,t):(this.loadExtensionPromises=this.loadExtensionPromises||{},e in this.loadExtensionPromises||(this.loadExtensionPromises[e]=l.downloadExtension(e).then((()=>{if(delete this.loadExtensionPromises[e],this.loadedExtensions){if(this.cancelledExtensions&&e in this.cancelledExtensions)throw delete this.cancelledExtensions[e],new Error(`Abort loadExtension('${e}') - extension has been unloaded`);return this.loadExtensionLocal(e,t)}n.logger.info(`Abort loadExtension('${e}') - teardown in progress`)}))),this.loadExtensionPromises[e])},getExtension:function(e,t){var i=this.loadedExtensions&&e in this.loadedExtensions?this.loadedExtensions[e]:null;return i&&t&&t(i),i},getExtensionAsync:function(e){let t=this.getExtension(e);return t?Promise.resolve(t):new Promise((i=>{this.addEventListener(o.EXTENSION_LOADED_EVENT,(function n(r){r.extensionId===e&&(this.removeEventListener(o.EXTENSION_LOADED_EVENT,n),t=this.getExtension(e),i(t))}))}))},unloadExtension:function(e){if(this.cancelledExtensions=this.cancelledExtensions||{},l.isDownloading(e))return this.cancelledExtensions[e]=!0,!1;let t=!1;const i=this.getExtension(e);return i?(t=i.unload(),n.logger.info("Extension unloaded: "+e),delete this.loadedExtensions[e],s.analytics.track("viewer.extensionManager.extensionUnloaded",{extensionId:e}),this.dispatchEvent({type:o.EXTENSION_UNLOADED_EVENT,extensionId:e})):n.logger.warn("Extension not found: "+e),t},loadExtensionLocal:function(e,t){const i=l.getExtensionClass(e);if(!i)return Promise.reject("Extension not found : "+e);let r=this.getExtension(e);if(r)return Promise.resolve(r);if(this.loadingExtensions&&e in this.loadingExtensions)return this.loadingExtensions[e];r=function(e){function t(t,i,n){const r=e[t];r?e[t]=function(){i&&i.call(e,...arguments);const t=r.call(e,...arguments);return n&&n.call(e,...arguments),t}:console.warn(t," not implemented in ",e)}return t("load",(function(){this.viewer.dispatchEvent({type:a.EXTENSION_PRE_LOADED_EVENT,extensionId:this.id})})),t("unload",(function(){this.viewer.dispatchEvent({type:a.EXTENSION_PRE_UNLOADED_EVENT,extensionId:this.id})})),t("activate",(function(e){this.viewer.dispatchEvent({type:a.EXTENSION_PRE_ACTIVATED_EVENT,extensionId:this.id,mode:e})}),(function(e){this.viewer.dispatchEvent({type:a.EXTENSION_ACTIVATED_EVENT,extensionId:this.id,mode:e}),s.analytics.track("viewer.extension.activate",{extensionId:this.id,mode:e})})),t("deactivate",(function(){this.viewer.dispatchEvent({type:a.EXTENSION_PRE_DEACTIVATED_EVENT,extensionId:this.id})}),(function(){this.viewer.dispatchEvent({type:a.EXTENSION_DEACTIVATED_EVENT,extensionId:this.id}),s.analytics.track("viewer.extension.deactivate",{extensionId:this.id})})),e}(new i(this,t)),r.id=e;const c=()=>Promise.reject("Extension failed to .load() : "+e),h=r.load();if(!h)return c();const u=()=>(this.loadedExtensions[e]=r,this.onPostExtensionLoad(r),n.logger.info("Extension loaded: "+e),s.analytics.track("viewer.extensionManager.extensionLoaded",{extensionId:e}),setImmediate((()=>{this.getExtension(e)&&this.dispatchEvent({type:o.EXTENSION_LOADED_EVENT,extensionId:e})})),Promise.resolve(r));return"function"==typeof h.then?(this.loadingExtensions=this.loadingExtensions||{},this.loadingExtensions[e]=h.then((e=>e?u():c())).finally((()=>{delete this.loadingExtensions[e]})),this.loadingExtensions[e]):u()},onPostExtensionLoad:function(e){},forEachExtension:function(e){const t=this.loadedExtensions||{};for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&e(t[i])},apply:function(e){var t=c.prototype;e.loadExtension=t.loadExtension,e.getExtension=t.getExtension,e.getExtensionAsync=t.getExtensionAsync,e.unloadExtension=t.unloadExtension,e.loadExtensionLocal=t.loadExtensionLocal,e.forEachExtension=t.forEachExtension,e.onPostExtensionLoad=t.onPostExtensionLoad}}},66033:(e,t,i)=>{"use strict";function n(e){this.viewer=e}i.r(t),i.d(t,{FileLoader:()=>n}),n.prototype.constructor=n,n.prototype.loadFile=function(e,t,i,n){return!1},n.prototype.is3d=function(){return!1}},72614:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FileLoaderManager:()=>r});var n={};let r={registerFileLoader:function(e,t,i){return n[e]?n[e].loader===i&&(n[e].count++,!0):(n[e]={loader:i,extensions:t,count:1},!0)},getFileLoader:function(e){return n[e]?n[e].loader:null},getFileLoaderForExtension:function(e){for(var t in e=e?e.toLowerCase():"",n){var i=n[t];if(i)for(var r=0;r<i.extensions.length;r++)if(i.extensions[r].toLowerCase()===e)return i.loader}return null},unregisterFileLoader:function(e){return!!n[e]&&(n[e].count--,0===n[e].count&&delete n[e],!0)}}},5073:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GlobalManager:()=>r});const n=Autodesk.Viewing;class r{constructor(){this._window={inner:null,registeredEventListeners:new Map},this._document={inner:null,registeredEventListeners:new Map},this._window.inner=n.getGlobal(),this._document.inner=this._window.inner.document,this.addWindowEventListener=s.bind(this._window),this.removeWindowEventListener=a.bind(this._window),this.addDocumentEventListener=s.bind(this._document),this.removeDocumentEventListener=a.bind(this._document)}getWindow(){return this._window.inner}getDocument(){return this._document.inner}setWindow(e){if(e&&e!==this._window.inner){for(let[t,i]of this._window.registeredEventListeners.entries())for(let[n,r]of i.entries())e.addEventListener(t,n,...r),this._window.inner.removeEventListener(t,n,...r);for(let[t,i]of this._document.registeredEventListeners.entries())for(let[n,r]of i.entries())e.document.addEventListener(t,n,...r),this._document.inner.removeEventListener(t,n,...r);this._window.inner=e,this._document.inner=e.document}}}function o(e){return!!e.opener}function s(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];o(this.inner)||(this.registeredEventListeners.has(e)?this.registeredEventListeners.get(e).set(t,n):this.registeredEventListeners.set(e,new Map([[t,n]]))),this.inner.addEventListener(e,t,...n)}function a(e,t){o(this.inner)||this.registeredEventListeners.has(e)&&this.registeredEventListeners.get(e).has(t)&&this.registeredEventListeners.get(e).delete(t);for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];this.inner.removeEventListener(e,t,...n)}},27293:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GlobalManagerMixin:()=>o});var n=i(5073);const r=new n.GlobalManager;function o(){this.globalManager=r,this.setGlobalManager=function(e){this.globalManager=e,this.onSetGlobalManager(this.globalManager)},this.onSetGlobalManager=function(e){},this.getWindow=function(){return this.globalManager.getWindow()},this.getDocument=function(){return this.globalManager.getDocument()},this.setWindow=function(e){return this.globalManager.setWindow(e)},this.addWindowEventListener=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];this.globalManager.addWindowEventListener(e,t,...n)},this.removeWindowEventListener=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];this.globalManager.removeWindowEventListener(e,t,...n)},this.addDocumentEventListener=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];this.globalManager.addDocumentEventListener(e,t,...n)},this.removeDocumentEventListener=function(e,t){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];this.globalManager.removeDocumentEventListener(e,t,...n)}}Autodesk.Viewing.GlobalManager=n.GlobalManager,Autodesk.Viewing.GlobalManagerMixin=o},34345:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BackgroundPresets:()=>a,DefaultLightPreset:()=>r,DefaultLightPreset2d:()=>o,DefaultToneMapMethod:()=>s,LightPresets:()=>c,copyLightPreset:()=>u});var n=i(16840);let r=1,o=0,s=1,a={"Fusion Grey":[230,230,230,150,150,150],"Sky Blue":[226,244,255,156,172,180],Snow:[181,186,199,181,186,199],Midnight:[41,76,120,1,2,3],White:[255,255,255,255,255,255],AutoCADModel:[30,40,48,30,40,48],"Dark Grey":[51,51,51,51,51,51],"Dark Sky":[51,51,51,51,51,51],"Infinity Pool":[255,255,255,255,255,255],Tranquility:[0,84,166,0,84,166],"Grey Room":[129,129,129,129,129,129],"Photo Booth":[237,237,237,237,237,237],"RaaS SBS":[1,1,1,90,90,90],Plaza:[79,102,130,79,102,130],Field:[202,226,252,202,201,190],Boardwalk:[216,230,248,230,228,220],Custom:[230,230,230,150,150,150]};var l=a;let c=[{name:"Simple Grey",path:null,tonemap:0,E_bias:0,directLightColor:[1,.84,.67],ambientColor:[.2,.225,.25],lightMultiplier:1,bgColorGradient:l["Fusion Grey"],darkerFade:!1,rotation:0},{name:"Sharp Highlights",path:"SharpHighlights",type:"logluv",tonemap:s,E_bias:-9,directLightColor:[.5,.5,.5],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[.5,-.2,-.06],bgColorGradient:l["Photo Booth"],darkerFade:!0,rotation:0},{name:"Dark Sky",path:"DarkSky",type:"logluv",tonemap:s,E_bias:-1,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:1,lightDirection:[.1,-.55,-1],bgColorGradient:l["Dark Sky"],darkerFade:!1,rotation:0},{name:"Grey Room",path:"GreyRoom",type:"logluv",tonemap:s,E_bias:-1,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:.5,lightDirection:[.1,-.55,-1],bgColorGradient:l["Grey Room"],darkerFade:!0,rotation:0},{name:"Photo Booth",path:"PhotoBooth",type:"logluv",tonemap:s,E_bias:0,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:.5,lightDirection:[.1,-.55,-1],bgColorGradient:l["Photo Booth"],darkerFade:!0,rotation:0},{name:"Tranquility",path:"TranquilityBlue",type:"logluv",tonemap:s,E_bias:-1,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:.5,lightDirection:[.1,-.55,-1],bgColorGradient:l.Tranquility,darkerFade:!1,rotation:0},{name:"Infinity Pool",path:"InfinityPool",type:"logluv",tonemap:s,E_bias:-1,directLightColor:[1,.84,.67],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:.5,lightDirection:[.1,-.55,-1],bgColorGradient:l["Infinity Pool"],darkerFade:!1,rotation:0},{name:"Simple White",path:null,tonemap:0,E_bias:0,directLightColor:[1,1,1],ambientColor:[.25,.25,.25],lightMultiplier:1,bgColorGradient:l.White,saoRadius:.06,saoIntensity:.15,darkerFade:!0,rotation:0},{name:"Riverbank",path:"riverbank",type:"logluv",tonemap:s,E_bias:-5.7,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l["Sky Blue"],darkerFade:!1,rotation:0},{name:"Contrast",path:"IDViz",type:"logluv",tonemap:s,E_bias:0,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l.Midnight,darkerFade:!1,rotation:0},{name:"Rim Highlights",path:"RimHighlights",type:"logluv",tonemap:s,E_bias:-9,directLightColor:[.5,.5,.5],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[.35,-.35,-.5],bgColorGradient:l["Photo Booth"],darkerFade:!0,rotation:0},{name:"Cool Light",path:"CoolLight",type:"logluv",tonemap:s,E_bias:-9,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[-0,-.15,-.5],bgColorGradient:l["Fusion Grey"],darkerFade:!0,rotation:0},{name:"Warm Light",path:"WarmLight",type:"logluv",tonemap:s,E_bias:-9,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[-0,-.15,-.5],bgColorGradient:l["Fusion Grey"],darkerFade:!0,rotation:0},{name:"Soft Light",path:"SoftLight",type:"logluv",tonemap:s,E_bias:-9,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[-.5,-.5,0],bgColorGradient:l["Fusion Grey"],darkerFade:!0,rotation:0},{name:"Grid Light",path:"GridLight",type:"logluv",tonemap:s,E_bias:-9,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[-.5,-.6,0],bgColorGradient:l["Fusion Grey"],darkerFade:!0,rotation:0},{name:"Plaza",path:"Plaza",type:"logluv",tonemap:s,E_bias:-14,directLightColor:[.9,.9,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[-.2,-.18,.72],bgColorGradient:l.Plaza,darkerFade:!1,rotation:0},{name:"Snow Field",path:"SnowField",type:"logluv",tonemap:s,E_bias:-10.461343,directLightColor:[1,1,1],ambientColor:[.25/8,.25/8,.25/8],lightMultiplier:0,lightDirection:[0,-1,0],bgColorGradient:l.Snow,darkerFade:!1,rotation:0},{name:"Field",path:"field",type:"logluv",tonemap:s,E_bias:-2.9,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l.Field,useIrradianceAsBackground:!0,darkerFade:!0,rotation:0},{name:"Boardwalk",path:"boardwalk",type:"logluv",tonemap:s,E_bias:-7,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l.Boardwalk,useIrradianceAsBackground:!0,darkerFade:!1,rotation:0},{name:"Flat Shading",path:null,tonemap:0,E_bias:0,directLightColor:[0,0,0],ambientColor:[0,0,0],lightMultiplier:0,bgColorGradient:l["Fusion Grey"],darkerFade:!1,rotation:0}],h=[{name:"Harbor",path:"Harbor",type:"logluv",tonemap:s,E_bias:1.9,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l["Sky Blue"],useIrradianceAsBackground:!0,saoIntensity:.5,darkerFade:!1,rotation:0},{name:"Night",path:"Night",type:"logluv",tonemap:1,E_bias:4,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l.Midnight,useIrradianceAsBackground:!1,darkerFade:!1,rotation:0},{name:"Parking",path:"Parking",type:"logluv",tonemap:s,E_bias:2.8,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l["Sky Blue"],useIrradianceAsBackground:!1,saoIntensity:.5,darkerFade:!1,rotation:0},{name:"River Road",path:"RiverRoad",type:"logluv",tonemap:s,E_bias:0,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l["Fusion Grey"],useIrradianceAsBackground:!1,saoIntensity:.7,darkerFade:!1,rotation:0},{name:"Crossroads",path:"crossroads",type:"logluv",tonemap:s,E_bias:-5.5,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l["Sky Blue"],useIrradianceAsBackground:!0,darkerFade:!0,rotation:0},{name:"Seaport",path:"seaport",type:"logluv",tonemap:s,E_bias:-6.5,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l["Sky Blue"],useIrradianceAsBackground:!0,darkerFade:!1,rotation:0},{name:"Glacier",path:"glacier",type:"logluv",tonemap:s,E_bias:0,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l.Midnight,darkerFade:!1,rotation:0},{name:"RaaS Test Env",path:"Reflection",type:"logluv",tonemap:2,E_bias:-1.5,directLightColor:[1,1,1],lightMultiplier:0,bgColorGradient:l["RaaS SBS"],darkerFade:!1,rotation:0},{name:"City Night",path:"CityNight",type:"logluv",tonemap:s,E_bias:1.6,directLightColor:[1,1,1],lightMultiplier:.2,bgColorGradient:l.Midnight,useIrradianceAsBackground:!1,darkerFade:!1,rotation:0}];function u(e,t){(0,n.ObjectAssign)(t,e),t.name=e.name+" (copy)"}(0,n.getGlobal)().ENABLE_DEBUG&&Array.prototype.push.apply(c,h)},83833:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LocalStorage:()=>a});var n,r=i(49720),o=(0,i(16840).getGlobal)();function s(){this.isSupported()||(this._data={})}s.prototype.getItem=function(e){return this.isSupported()?o.localStorage.getItem(e):Object.prototype.hasOwnProperty.call(this._data,e)?this._data[e]:null},s.prototype.setItem=function(e,t){if(this.isSupported())try{o.localStorage.setItem(e,t)}catch(e){r.logger.debug("avp.LocalStorage: Failed to setItem()")}else this._data[e]=String(t)},s.prototype.removeItem=function(e){this.isSupported()?o.localStorage.removeItem(e):delete this._data[e]},s.prototype.clear=function(){this.isSupported()?o.localStorage.clear():this._data={}},s.prototype.isSupported=function(){return void 0===n&&(n=(()=>{if("undefined"==typeof window)return!1;try{const e="lmv_viewer_test_localStorage",t=o.localStorage;return!!t&&(t.setItem(e,"1"),t.removeItem(e),!0)}catch(e){return!1}})()),n},s.prototype.getAllKeys=function(){return n?Object.keys(o.localStorage):Object.keys(this._data)};const a=new s},18989:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Model:()=>d});var n=i(60485),r=i(78443),o=i(32154),s=i(98500),a=i(16840),l=i(55339),c=i(44822),h=i(97967),u=i(64432);function d(e){n.RenderModel.call(this),this.myData=e,this.topology=null,this.topologyPromise=null,this.svfUUID=null,this.defaultCameraHash=null,this.getInstanceTree=function(){return this.myData?this.myData.instanceTree:null},this.getBoundingBox=function(){const e=new THREE.Box3;return function(t,i){if(!this.myData)return null;if(e.copy(this.myData.modelSpaceBBox||this.myData.bbox),i&&e.copy(this.trimPageShadowGeometry(e)),t)return e;const n=this.getData().placementWithOffset;n&&this.myData.modelSpaceBBox&&e.applyMatrix4(n);const r=this.getModelTransform();return r&&e.applyMatrix4(r),e}}(),this.getFuzzyBox=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=Boolean(e.ignoreTransforms),i=this.getFragmentList();if(!i||this.is2d())return this.getBoundingBox(t);var n=null;if(t){var r=new Array(6);const e=this.getData().placementWithOffset,t=e?e.clone().invert():void 0;n=function(e,n){i.getOriginalWorldBounds(e,r),n.min.fromArray(r),n.max.fromArray(r,3),t&&n.applyMatrix4(t)}}else n=function(e,t){i.getWorldBounds(e,t)};function o(){var t=new THREE.Box3,r=new THREE.Vector3,o=new THREE.Vector3,s=new THREE.Vector3,a=0;function l(i){if(!e.allowlist||e.allowlist.includes(i)){n(i,t),t.getCenter(r);var l=t.getSize(o).length();s.add(r.multiplyScalar(l)),a+=l}}for(var c=0;c<i.getCount();c++)l(c);return s.multiplyScalar(1/a),s}var s=e.center||o(),a=e.quantil||.75,l=new THREE.Box3,c=[];const h=new THREE.Vector3;for(let t=0;t<i.getCount();t++)if((!e.allowlist||e.allowlist.includes(t))&&(n(t,l),!l.isEmpty())){var u=l.distanceToPoint(s);0===u&&(u=s.distanceTo(l.getCenter(h))),c.push({fragId:t,distance:u})}c.sort((function(e,t){return e.distance-t.distance}));var d=new THREE.Box3;for(let e=0;e<c.length*a;e++){var p=c[e];n(p.fragId,l),d.union(l)}return d},this.is2d=function(){return!(!this.myData||!this.myData.is2d)},this.is3d=function(){return!this.is2d()},this.isOTG=function(){return this.myData&&!!this.myData.isOTG},this.isSVF2=function(){var e=this.getDocumentNode();return!!e&&e.isSVF2()},this.isPdf=function(e){return!(!this.myData||!this.myData.isPdf||e&&this.isSmartPdf())},this.isRevitPdf=function(){var e;return!(null===(e=this.getDocumentNode())||void 0===e||!e.isRevitPdf())},this.isSmartPdf=function(){var e;return!(null===(e=this.getDocumentNode())||void 0===e||!e.isSmartPdf())},this.isLeaflet=function(){return!(!this.myData||!this.myData.isLeaflet)},this.isPageCoordinates=function(){var e;return this.is2d()&&(!this.isLeaflet()||(null===(e=this.loader)||void 0===e?void 0:e.isPageCoordinates()))},this.isSceneBuilder=function(){return!(!this.myData||!this.myData.isSceneBuilder)}}r.EventDispatcher.prototype.apply(d.prototype),d.prototype.constructor=d,d.prototype.getData=function(){return this.myData},d.prototype.setUUID=function(e){this.svfUUID=btoa(encodeURI((0,o.pathToURL)(e)))},d.prototype.getDocumentNode=function(){var e,t;return(null===(e=this.getData())||void 0===e||null===(t=e.loadOptions)||void 0===t?void 0:t.bubbleNode)??null},d.prototype.getRoot=function(){var e=this.getData();return e&&e.instanceTree?e.instanceTree.root:null},d.prototype.getRootId=function(){var e=this.getData();return e&&e.instanceTree&&e.instanceTree.getRootId()||0},d.prototype.getUnitData=function(e){return console.warn("Model.getUnitData is deprecated and will be removed in a future release, use Autodesk.Viewing.Private.getUnitData() instead."),(0,h.getUnitData)(e)},d.prototype.getUnitScale=function(){return(0,h.convertUnits)(this.getUnitString(),h.ModelUnits.METER,1,1)},d.prototype.getUnitString=function(){var e;if(this.is2d())e=this.getMetadata("page_dimensions","model_units",null)||this.getMetadata("page_dimensions","page_units",null);else{var t=this.getData();e=t&&t.overriddenUnits?t.overriddenUnits:t&&t.scalingUnit?t.scalingUnit:this.getMetadata("distance unit","value",null)}return(0,h.fixUnitString)(e)},d.prototype.getDisplayUnit=function(){var e;if(this.is2d())e=this.getMetadata("page_dimensions","model_units",null)||this.getMetadata("page_dimensions","page_units",null);else{var t=this.getData();e=t&&t.scalingUnit?t.scalingUnit:this.getMetadata("default display unit","value",null)||this.getMetadata("distance unit","value",null)}return(0,h.fixUnitString)(e)},d.prototype.getSourceFileUnits=function(){const e=this.getDocumentNode();return null==e?void 0:e.getSourceFileUnits()},d.prototype.getMetadata=function(e,t,i){var n=this.getData();if(n){var r=n.metadata;if(r){var o=r[e];if(void 0!==o){if(!t)return o;var s=o[t];if(void 0!==s)return s}}}return i},d.prototype.getDefaultCamera=function(){var e=this.getData();if(!e)return null;var t=null,i=e.cameras?e.cameras.length:0;if(0<i){var n=this.getMetadata("default camera","index",null);if(null!==n&&e.cameras[n])t=e.cameras[n];else{for(var r=0;r<i;r++){var o=e.cameras[r];if(o.isPerspective){t=o;break}}t||(t=e.cameras[0])}}var s=this.getModelTransform();if(t&&s){const e=c.UnifiedCamera.copyViewParams(t);return c.UnifiedCamera.transformViewParams(e,s),c.UnifiedCamera.adjustOrthoCamera(e,this.getBoundingBox()),e}return t},d.prototype.isAEC=function(){return!!this.getData().loadOptions.isAEC},d.prototype.hasPageShadow=function(){return this.getData().hasPageShadow},d.prototype.getUpVector=function(){return this.getMetadata("world up vector","XYZ",null)},d.prototype.geomPolyCount=function(){var e=this.getGeometryList();return e?e.geomPolyCount:null},d.prototype.instancePolyCount=function(){var e=this.getGeometryList();return e?e.instancePolyCount:null},d.prototype.isLoadDone=function(e){const t=this.getData(),i=!e||!1!==t.texLoadDone;return!!(t&&t.loadDone&&i)},d.prototype.isObjectTreeCreated=function(){return!!this.getData().instanceTree},d.prototype.getPropertyDb=function(){var e=this.getData();return e&&e.propDbLoader},d.prototype.getProperties=function(e,t,i){var n=this.getPropertyDb();!n||e<=0?i&&i():n.getProperties(e,t,i)},d.prototype.getProperties2=function(e,t,i,n){var r=this.getPropertyDb();!r||e<=0?i&&i():r.getProperties2(e,t,i,n)},d.prototype.getBulkProperties=function(e,t,i,n){Array.isArray(t)&&(t={propFilter:t});var r=(t=t||{}).propFilter||null,o=t.ignoreHidden||!1,s=this.getPropertyDb();s?s.getBulkProperties(e,r,i,n,o):n&&n()},d.prototype.getBulkProperties2=function(e,t,i,n){var r=this.getPropertyDb();r?r.getBulkProperties2(e,t,i,n):n&&n()},d.prototype.getPropertySetAsync=function(e,t){return new Promise(((i,n)=>{this.getPropertySet(e,i,n,t)}))},d.prototype.getPropertySet=function(e,t,i,n){var r=this.getPropertyDb();r||i&&i("Properties failed to load."),r.getPropertySet(e,n,(e=>{t(new u.PropertySet(e))}),i)},d.prototype.getExternalIdMapping=function(e,t){var i=this.getPropertyDb();i?i.getExternalIdMapping(e,t):t&&t()},d.prototype.getLayerToNodeIdMapping=function(e,t){var i=this.getPropertyDb();i?i.getLayerToNodeIdMapping(e,t):t&&t()},d.prototype.getObjectTree=function(e,t){const i=this.getData().instanceTree;if(i)e(i);else{var n=this.getPropertyDb();n?n.getObjectTree(e,t):t&&t()}},d.prototype.isObjectTreeLoaded=function(){var e=this.getPropertyDb();return!!e&&e.isObjectTreeLoaded()},d.prototype.search=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{searchHidden:!1};var o=this.getPropertyDb();o?o.searchProperties(e,n,t,i,r):i&&i()},d.prototype.findProperty=function(e){var t=this.getPropertyDb();return t?t.findProperty(e):Promise.reject("Model doesn't have any properties.")};var p=function(e,t,i,n){var r,o,s,a,l,c,h=!1;s=n[i[i.length-1]].x,r=(a=n[i[i.length-1]].y)>=t;for(var u=0,d=i.length;u<d;++u)l=n[i[u]].x,r!=(o=(c=n[i[u]].y)>=t)&&(c-t)*(s-l)>=(l-e)*(a-c)==o&&(h=!h),r=o,s=l,a=c;return h};d.prototype.pointInPolygon=function(e,t,i,n){for(var r=!1,o=0;o<i.length;o++)p(e,t,i[o],n)&&(r=!r);return r},d.prototype.getPageToModelTransform=function(e){var t=this.getData();if(t.pageToModelTransform)return t.pageToModelTransform;var i=t,n=i.metadata.page_dimensions,r=i.viewports&&i.viewports[e];if(!r)return new THREE.Matrix4;i.viewportTransforms||(i.viewportTransforms=new Array(i.viewports.length));var o=i.viewportTransforms[e];if(o)return o;var a=new s.LmvMatrix4(!0).set(n.logical_width/n.page_width,0,0,n.logical_offset_x,0,n.logical_height/n.page_height,0,n.logical_offset_y,0,0,1,0,0,0,0,1),l=r.transform.slice();!function(e){var t=.001,i=e;if(Math.abs(i[0])<t)if(Math.abs(i[4])>t)for(var n=0;n<4;n++){var r=i[n];i[n]=i[n+4],i[n+4]=r}else for(let e=0;e<4;e++){const t=i[e];i[e]=i[e+8],i[e+8]=t}if(Math.abs(i[5])<t)for(let e=4;e<8;e++){const t=i[e];i[e]=i[e+4],i[e+4]=t}}(l);var c=new s.LmvMatrix4(!0);c.elements.set(l);var h=new s.LmvMatrix4(!0);return h.copy(c).invert(),h.multiply(a),i.viewportTransforms[e]=h,h},d.prototype.pageToModel=function(e,t,i,n){let r=this.getPageToModelTransform(i);function o(e){if(e){var t=(new THREE.Vector3).set(e.x,e.y,0).applyMatrix4(r);e.x=t.x,e.y=t.y,e.z=t.z}}n&&(r=r.clone().invert()),o(e),o(t)},d.prototype.pointInClip=function(e,t){for(var i=this.getData().clips,n=[],r=1;r<i.length;r++)if(r!==t){for(var o=[],s=[],a=i[r].contourCounts,l=i[r].points,c=0,h=[],u=0;u<a.length;u++){for(var d=0;d<a[u];d++)o.push(c),c++;s.push(o),o=[]}for(let e=0;e<l.length;e+=2){var p={x:l[e],y:l[e+1]};h.push(p)}this.pointInPolygon(e.x,e.y,s,h)&&n.push(r)}return n},d.prototype.getClip=function(e){for(var t=this.getData().clips,i=[],n=[],r=t[e].contourCounts,o=t[e].points,s=0,a=[],l=0;l<r.length;l++){for(var c=0;c<r[l];c++)i.push(s),s++;n.push(i),i=[]}for(let e=0;e<o.length;e+=2){var h={x:o[e],y:o[e+1]};a.push(h)}return{contours:n,points:a}},d.prototype.getTopoIndex=function(e){var t=this.getData();if(t&&t.fragments){var i=t.fragments.topoIndexes;if(i)return i[e]}},d.prototype.getTopology=function(e){return this.topology?this.topology[e]:null},d.prototype.hasTopology=function(){return!!this.topology},d.prototype.fetchTopology=function(e){if(this.topology)return Promise.resolve(this.topology);var t=this.getData();if(!t.topologyPath)return Promise.reject({error:"no-topology"});var i=e||((0,a.isMobileDevice)()?20:100);if(t.topologySizeMB>i)return Promise.reject({error:"topology-too-big",limitMB:i,topologyMB:t.topologySizeMB});if(!this.topologyPromise){var n=this;this.topologyPromise=new Promise((function(e,t){n.loader.fetchTopologyFile(n.getData().topologyPath,(function(i){i&&i.topology?(n.topology=i.topology,e(i.topology)):t(i)}))}))}return this.topologyPromise},d.prototype.hasGeometry=function(){var e=this.getData();return!!e&&(!!e.isLeaflet||(!!e.isSceneBuilder||e.fragments.length>0))},d.prototype.getFragmentPointer=function(e){return e?new l.FragmentPointer(this.getFragmentList(),e):null},d.prototype.clone=function(){const e=new d(this.myData);return e.topology=this.topology,e.topologyPromise=this.topologyPromise,e.svfUUID=this.svfUUID,e.defaultCameraHash=this.defaultCameraHash,e.loader=this.loader,e.setInnerAttributes(this.getInnerAttributes()),e},d.prototype.getSeedUrn=function(){var e;return(null===(e=this.loader)||void 0===e?void 0:e.svfUrn)||""},d.prototype.isNodeExists=function(e){let t;const i=this.getInstanceTree();if(i)i.enumNodeChildren(e,(function(e){i.enumNodeFragments(e,(function(){t=!0}))}),!0);else{var n;null!==(n=this.getFragmentList().fragments.dbId2fragId)&&void 0!==n&&n[e]&&(t=!0)}return!!t},d.prototype.getModelKey=function(){const e=this.getDocumentNode();return e?e.getModelKey():this.getData().urn},d.prototype.dispose=function(){const e=this.getInstanceTree();null==e||e.dtor(),this.myData=null,this.topology=null,this.topologyPromise=null},d.prototype.setFragmentBoundingBoxes=function(e,t){const i=this.getFragmentList().fragments,n=i.boxes,r=e.length/t;for(let i=0,o=0,s=0;i<r;i++,o+=t,s+=6)n[s+0]=e[o+0],n[s+1]=e[o+1],n[s+2]=e[o+2],n[s+3]=e[o+3],n[s+4]=e[o+4],n[s+5]=e[o+5];i.boxesLoaded=!0,this.visibleBoundsDirty=!0,this.fireEvent({type:Autodesk.Viewing.MODEL_FRAGMENT_BOUNDING_BOXES_SET_EVENT,model:this})}},22038:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ModelLayers:()=>s});var n=i(49720),r=i(33423),o={name:"root",id:"root",isLayer:!1,children:[],childCount:0};function s(e){this.viewer=e,this.matman=e.matman(),this.model=null,this.root=null,this.initialized=!1,this.layerToIndex={},this.indexToLayer=[null],this.nodeToLayer=[]}var a=s.prototype;function l(e){var t=e.getData(),i=o;return t&&t.layersRoot&&(i=t.layersRoot),Promise.resolve(i)}function c(e){if(e.getData().loadOptions.skipPropertyDb)return Promise.resolve(null);var t=e.getPropertyDb();return!t||e.getData().loadOptions.disable3DModelLayers?Promise.resolve(o):t.findLayers()}function h(e,t){var i=e.model,n=e.indexToLayer;if(i.is2d()){if(!i.getData().layerCount)return;var r=[];for(var o in e.layerToIndex)r.push(e.layerToIndex[o]);e.matman.setLayerVisible(r,t,i.id),e.viewer.invalidate(!0)}else{var s=[],a=t?e.viewer.visibilityManager.show:e.viewer.visibilityManager.hide;u(e,(function(e,r){n[r].visible!==t&&(s.push(e),1024===s.length&&(a(s,i),s.length=0))})),s.length>0&&a(s,i)}for(var l=n.length,c=1;c<l;++c){var h=n[c];h&&(h.visible=t)}}function u(e,t){var i=e.nodeToLayer;if(i&&i.length){var n=e.model.getData().instanceTree.nodeAccess;for(var r in n.dbIdToIndex){var o=i[n.dbIdToIndex[r]]||0;0!==o&&t(0|r,o)}}}function d(e,t){return"number"==typeof t?t:e.layerToIndex[t.name||t]||0}function p(e){return!e.layer.isLayer}function f(e){if(!e)return[];var t=[],i=0;m(e,(e=>{t.push(e),e.isLayer&&(i=Math.max(i,0|e.index))}));for(var n=0;n<t.length;++n)t[n].isLayer||(t[n].index=++i);return t}function m(e,t){for(var i=0;i<e.length;++i){var n=e[i];t(n),n.children&&m(n.children,t)}}a.addModel=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.initialized&&(e.is2d()||!t)){var i=function(t){if(t){var i=this.model.getData().instanceTree;t.children=t.children||[];var r=f(t.children);t.childCount=r.length,this.indexToLayer=new Array(t.childCount+1),this.indexToLayer[0]=null;for(var o=0;o<t.childCount;++o){var s=r[o],a=null==s.visible||s.visible;this.layerToIndex[s.name]=s.index,this.indexToLayer[s.index]={layer:s,visible:a}}if(!this.model.is2d()&&0!==t.childCount){this.nodeToLayer=t.childCount<=256?new Uint8Array(i.nodeAccess.getNumNodes()):new Uint16Array(i.nodeAccess.getNumNodes());var l=function(e){if(this.model){var t=this.model.getData().instanceTree;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))for(var n=this.layerToIndex[i],r=e[i],o=0,s=r.length;o<s;++o){var a=t.nodeAccess.getIndex(r[o]);this.nodeToLayer[a]=n}}}.bind(this),c=function(){n.logger.warn("ModelLayers error: coudn't get layers from property database.")}.bind(this);e.getLayerToNodeIdMapping(l,c)}}}.bind(this),s=function(t){var i;this.root=t,this.initialized=!0;!this.activateLayerState("Initial")&&null!==(i=this.model)&&void 0!==i&&i.is2d()&&this.indexToLayer.forEach((e=>{e&&!e.visible&&this.setLayerVisible(e.layer,!1)})),this.viewer.api.dispatchEvent({type:r.MODEL_LAYERS_LOADED_EVENT,model:e,root:t})}.bind(this);this.model=e,(e.is2d()?l(e):c(e)).then((function(e){i(e),s(e)})).catch((function(e){n.logger.warn(e),s(o)}))}},a.removeModel=function(e){this.model===e&&(this.model=null,this.root=null,this.initialized=!1,this.layerToIndex={},this.indexToLayer=[null],this.nodeToLayer=[])},a.getRoot=function(){return this.initialized||n.logger.warn("Autodesk.Viewing.ModelLayers.getRoot couldn't peform action, layers are still being loaded"),this.root},a.showAllLayers=function(){this.initialized?h(this,!0):n.logger.warn("Autodesk.Viewing.ModelLayers.showAllLayers couldn't peform action, layers are still being loaded")},a.hideAllLayers=function(){this.initialized?h(this,!1):n.logger.warn("Autodesk.Viewing.ModelLayers.hideAllLayers couldn't peform action, layers are still being loaded")},a.isLayerVisible=function(e){if(!this.initialized)return n.logger.warn("Autodesk.Viewing.ModelLayers.isLayerVisible couldn't peform action, layers are still being loaded"),!1;let t=d(this,e);const i=this.indexToLayer[t];if(p(i)){const e=i.layer.children;for(var r=0;r<e.length;++r){let t=e[r].index;if(this.indexToLayer[t].visible)return!0}return!1}return i.visible},a.setLayerVisible=function(e,t){if(!this.initialized)return void n.logger.warn("Autodesk.Viewing.ModelLayers.setLayersVisible couldn't peform action, layers are still being loaded");var i=(e=Array.isArray(e)?e:[e]).map(function(e){return d(this,e)}.bind(this));const r=i.length;for(var o=0;o<r;++o){let e=i[o],t=this.indexToLayer[e];if(p(t)){t.layer.children.forEach((e=>{i.push(e.index)}))}}var s=this.model,a=this.indexToLayer;if(s.is2d())this.matman.setLayerVisible(i,t,s.id),this.viewer.invalidate(!0);else{var l=a.map((function(e){return!(null!==e&&-1!==i.indexOf(e.layer.index)&&e.visible!==t)})),c=[],h=t?this.viewer.visibilityManager.show:this.viewer.visibilityManager.hide;u(this,(function(e,t){l[t]||(c.push(e),1024===c.length&&(h(c,s),c.length=0))})),c.length>0&&h(c,s)}var f=i.length;for(let e=0;e<f;++e){const n=this.indexToLayer[i[e]];n&&(n.visible=t)}},a.getVisibleLayerIndices=function(){if(!this.initialized)return n.logger.warn("Autodesk.Viewing.ModelLayers.getVisibleLayerIndices couldn't peform action, layers are still being loaded"),[];for(var e=[],t=this.indexToLayer,i=t.length,r=1;r<i;++r){var o=t[r];o&&o.visible&&!p(o)&&e.push(o.layer.index)}return e},a.allLayersVisible=function(){if(!this.initialized)return!0;for(var e=this.indexToLayer,t=e.length,i=1;i<t;++i){var n=e[i];if(n&&!n.visible)return!1}return!0},a.activateLayerState=function(e){if(!this.initialized)return n.logger.warn("Autodesk.Viewing.ModelLayers.activateLayerState couldn't peform action, layers are still being loaded"),!1;if(!this.model||this.model.is3d()||!e)return!1;var t=this.model.getData().metadata,i=null==t?void 0:t.layer_states;if(!i)return!1;let r;for(r=0;r<i.length&&i[r].name!==e;r++);if(r>=i.length)return!1;var o=i[r].visible_layers,s={};if(o&&0<o.length)for(var a=0;a<o.length;a++)s[o[a]]=1;var l=[],c=[];for(var h in t.layers){var u=t.layers[h].name;h|=0,1===s[u]?l.push(h):c.push(h)}return this.setLayerVisible(l,!0),this.setLayerVisible(c,!1),!0},a.getLayerStates=function(){function e(e,t){var i=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);if(i.length!==n.length)return!1;for(var r=0;r<i.length;++r){var o=i[r];if(e[o]!==t[o])return!1}return!0}if(!this.initialized)return n.logger.warn("Autodesk.Viewing.ModelLayers.getLayerStates couldn't peform action, layers are still being loaded"),null;var t,i=this.model,r=i?i.getData().metadata:null,o=r?r.layers:null,s=r?r.layer_states:null;if(this.model.is3d()||!o||!s)return null;var a={},l={};for(var c in o)if(Object.prototype.hasOwnProperty.call(o,c)){var h=parseInt(c),u=o[c];a[t="string"==typeof u?u:u.name]=!0,this.isLayerVisible(h)&&(l[t]=!0)}for(var d=[],p=0;p<s.length;++p){var f=s[p],m=f.visible_layers,g={};if(!f.hidden){if(m&&0<m.length)for(var v=0;v<m.length;++v)t=m[v],Object.prototype.hasOwnProperty.call(a,t)&&(g[t]=!0);d.push({name:f.name,description:f.description,active:e(l,g)})}}return 0<d.length?d:null}},43095:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ModelMemoryTracker:()=>h,estimateMemUsage:()=>c});function n(e){return e&&e.byteLength||0}function r(e){return n(e.boxes)+n(e.transforms)+n(e.fragId2dbId)+n(e.geomDataIndexes)+n(e.materials)}function o(e){return n(e.geomids)+n(e.materialids)+n(e.vizflags)+(e.boxes!==e.fragments.boxes?n(e.boxes):0)+(e.transforms!==e.fragments.transforms?n(e.transforms):0)}function s(e){return n(e.nodes.nodesRaw?e.nodes.nodesRaw:e.nodes)+n(e.primitives)}var a=!1;function l(e){for(var t,i=Autodesk.Viewing.Private,l=0,c=0;c<e.length;c++){var h=e[c],u=h.getData();if(u){var d=h.getConsolidation();if(d&&(l+=d.byteSize),h.isLeaflet())a||(console.warn("Memory tracking not implemented for leaflets."),a=!0);else{if(!u.isOTG)l+=h.getGeometryList().geomMemory;var p=u.fragments;p&&(l+=r(p));var f=h.getFragmentList();f&&(l+=o(f));var m=u.bvh;m&&(l+=s(m));var g=u.instanceTree;g&&(l+=(t=void 0,n((t=g.nodeAccess).children)+n(t.nameSuffixes)+n(t.names)+n(t.nodeBoxes)+n(t.nodes)))}}}return isFinite(l)||i.logger.warn("Memory estimate result was not a number"),l}function c(e){var t=e.impl.geomCache(),i=t?t.byteSize:0,n=e.impl.modelQueue(),r=n.getModels(),o=n.getHiddenModels();return i+l(r)+l(o)}function h(e,t){var i=e,n=0,r=t||1048576e3;function o(e){var t;return e.lruTimestamp===n||(null===(t=e.getData())||void 0===t?void 0:t.loadOptions.keepHiddenModel)}this.updateModelTimestamps=function(e){n++;for(var t=0;t<e.length;t++){e[t].lruTimestamp=n}},this.memoryExceeded=function(){return c(i)>=r},this.getMemLimit=function(){return r},this.setMemLimit=function(e){r=e},this.cleanup=function(e){var t=e||i.impl.unloadModel.bind(i.impl);if(this.memoryExceeded()){for(var n=function(){for(var e=i.impl.modelQueue().getHiddenModels(),t=[],n=0;n<e.length;n++){var r=e[n];o(r)||t.push(r)}return t.sort((function(e,t){return e.lurTimestamp-t.lruTimestamp})),t}(),r=0;r<n.length;r++){var s=n[r];if(s.isConsolidated&&(s.unconsolidate(),!this.memoryExceeded()))return}var a=i.impl.geomCache();for(r=0;r<n.length;r++)if(t(s=n[r]),a&&a.cleanup(),!this.memoryExceeded())return}}}},13138:(e,t,i)=>{"use strict";i.r(t),i.d(t,{OverlayManager:()=>n});class n{constructor(e){this.impl=e}dtor(){this.impl=null}addScene(e){return!!e&&(Object.prototype.hasOwnProperty.call(this.impl.overlayScenes,e)||this.impl.createOverlayScene(e),!0)}removeScene(e){return!!e&&(this.impl.removeOverlayScene(e),!0)}clearScene(e){this.impl.clearOverlay(e)}hasScene(e){return!!e&&Object.prototype.hasOwnProperty.call(this.impl.overlayScenes,e)}addMesh(e,t){return!!(e&&t&&Object.prototype.hasOwnProperty.call(this.impl.overlayScenes,t))&&(e=Array.isArray(e)?e:[e],this.impl.addMultipleOverlays(t,e),!0)}removeMesh(e,t){return!!(e&&t&&Object.prototype.hasOwnProperty.call(this.impl.overlayScenes,t))&&(e=Array.isArray(e)?e:[e],this.impl.removeMultipleOverlays(t,e),!0)}hasMesh(e,t){var i=this.impl.overlayScenes[t];if(!i)return!1;var n=i.scene.children;for(let t=0,i=n.length;t<i;++t)if(n[t]===e)return!0;return!1}}},59991:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Prefs:()=>o,Prefs2D:()=>r,Prefs3D:()=>n,VIEW_TYPES:()=>s});const n={VIEW_CUBE:"viewCube",VIEW_CUBE_COMPASS:"viewCubeCompass",VIEW_TYPE:"viewType",ALWAYS_USE_PIVOT:"alwaysUsePivot",ZOOM_TOWARDS_PIVOT:"zoomTowardsPivot",SELECTION_SETS_PIVOT:"selectionSetsPivot",REVERSE_HORIZONTAL_LOOK_DIRECTION:"reverseHorizontalLookDirection",REVERSE_VERTICAL_LOOK_DIRECTION:"reverseVerticalLookDirection",ORBIT_PAST_WORLD_POLES:"orbitPastWorldPoles",CLICK_TO_SET_COI:"clickToSetCOI",GHOSTING:"ghosting",OPTIMIZE_NAVIGATION:"optimizeNavigation",AMBIENT_SHADOWS:"ambientShadows",ANTIALIASING:"antialiasing",GROUND_SHADOW:"groundShadow",GROUND_REFLECTION:"groundReflection",LINE_RENDERING:"lineRendering",EDGE_RENDERING:"edgeRendering",LIGHT_PRESET:"lightPreset",ENV_MAP_BACKGROUND:"envMapBackground",FIRST_PERSON_TOOL_POPUP:"firstPersonToolPopup",BIM_WALK_TOOL_POPUP:"bimWalkToolPopup",BIM_WALK_NAVIGATOR_TYPE:"bimWalkNavigatorType",BIM_WALK_GRAVITY:"bimWalkGravity",DEFAULT_NAVIGATION_TOOL_3D:"defaultNavigationTool3D",SELECTION_MODE:"selectionMode",ENABLE_CUSTOM_ORBIT_TOOL_CURSOR:"enableCustomOrbitToolCursor",EXPLODE_STRATEGY:"explodeStrategy",FORCE_DOUBLE_SIDED:"forceDoubleSided",DISPLAY_SECTION_HATCHES:"displaySectionHatches"},r={GRAYSCALE:"grayscale",SWAP_BLACK_AND_WHITE:"swapBlackAndWhite",LOADING_ANIMATION:"loadingAnimation",FORCE_PDF_CALIBRATION:"forcePDFCalibration",FORCE_LEAFLET_CALIBRATION:"forceLeafletCalibration",DISABLE_PDF_HIGHLIGHT:"disablePdfHighlight",USE_PDF_VIEWPORT_INFO:"usePdfViewportInfo"},o={PROGRESSIVE_RENDERING:"progressiveRendering",OPEN_PROPERTIES_ON_SELECT:"openPropertiesOnSelect",POINT_RENDERING:"pointRendering",BACKGROUND_COLOR_PRESET:"backgroundColorPreset",REVERSE_MOUSE_ZOOM_DIR:"reverseMouseZoomDir",LEFT_HANDED_MOUSE_SETUP:"leftHandedMouseSetup",FUSION_ORBIT:"fusionOrbit",FUSION_ORBIT_CONSTRAINED:"fusionOrbitConstrained",WHEEL_SETS_PIVOT:"wheelSetsPivot",RESTORE_SESSION_MEASUREMENTS:"restoreMeasurements",DISPLAY_UNITS:"displayUnits",DISPLAY_UNITS_PRECISION:"displayUnitsPrecision",KEY_MAP_CMD:"keyMapCmd",ZOOM_DRAG_SPEED:"zoomDragSpeed",ZOOM_SCROLL_SPEED:"zoomScrollSpeed"},s={DEFAULT:0,ORTHOGRAPHIC:1,PERSPECTIVE:2,PERSPECTIVE_ORTHO_FACES:3}},52208:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Preferences:()=>l});var n=i(33423),r=i(49720),o=i(27293),s=i(50467),a=i(83833);class l{constructor(e,t){this.viewer=e;this.options={},this.storageCache={},this.setGlobalManager(e.globalManager),this.setWebStorageKey("Default"),"string"==typeof t&&(this.options={prefix:t}),this.options={...t},this.options.prefix||(this.options.prefix="Autodesk.Viewing.Preferences."),Object.prototype.hasOwnProperty.call(this.options,"localStorage")||(this.options.localStorage=!0),this.defaults={},this.callbacks={},this.tags={},this.useLocalStorage=this.options.localStorage&&a.LocalStorage.isSupported(),e.addEventListener(n.PREF_CHANGED_EVENT,(e=>{var t=this.callbacks[e.name];t&&t.forEach((t=>{var i=t.changed;i&&"function"==typeof i&&i(e.value)}))})),e.addEventListener(n.PREF_RESET_EVENT,(e=>{var t=this.callbacks[e.name];t&&t.forEach((t=>{var i=t.reset;i&&"function"==typeof i&&i(e.value)}))}));return new Proxy(this,{get:function(e,t){return t in e?e[t]:e.storageCache[t]}})}setWebStorageKey(e){this.storageKey=e}webStorage(e,t){if(this.useLocalStorage){if(this.hasTag(e,"no-storage"))return;const i=this.getLocalStoragePrefix()+this.storageKey;let n=a.LocalStorage.getItem(i);if(n=JSON.parse(n||"{}"),void 0!==t)t instanceof s.EnumType&&(t=t.toString()),n[e]=t,a.LocalStorage.setItem(i,JSON.stringify(n));else if(void 0!==(t=n[e]))try{"__enum"===(t=JSON.parse(t)).type&&(t=s.EnumType.deSerialize(t))}catch(e){r.logger.log("Preferences: Cannot deserialize value ="+t),t=void 0}return t}}getPrefFromLocalStorage(e){return this.webStorage(e)}setPrefInLocalStorage(e,t){return this.webStorage(e,t)}addPref(e,t){if("string"!=typeof e||"function"==typeof this.storageCache[e])return void r.logger.log("Preferences: invalid name="+e);t instanceof s.EnumType&&(t=t.clone());const i=this.webStorage(e);this.storageCache[e]=i||t,this.tags[e]={}}load(e){for(var t in this.defaults=e,this.defaults)Object.prototype.hasOwnProperty.call(this.defaults,t)&&this.addPref(t,this.defaults[t])}addTags(e,t){if(!t||!e)return!1;t=Array.isArray(t)?t:[t];for(var i=0;i<t.length;++i)this.tag(t[i],e);return!0}tag(e,t){if(e){t?Array.isArray(t)||(t=[t]):t=Object.keys(this.defaults);for(var i=0;i<t.length;++i)this.tags[t[i]]&&(this.tags[t[i]][e]=!0)}}untag(e,t){if(e){t?Array.isArray(t)||(t=[t]):t=Object.keys(this.defaults);for(var i=0;i<t.length;++i)this.tags[t[i]]&&(this.tags[t[i]][e]=!1)}}hasTag(e,t){var i=this.tags[e];return!!i&&!0===i[t]}add(e,t,i,o){return!Object.prototype.hasOwnProperty.call(this.defaults,e)||o?(this.setDefault(e,t),this.addPref(e,t),this.addTags(e,i),o&&this.viewer.dispatchEvent({type:n.PREF_CHANGED_EVENT,name:e,value:this.get(e)}),!0):(r.logger.log("Preferences: "+e+" already exists"),!1)}setDefault(e,t){e&&null!=t&&(t instanceof s.EnumType?this.defaults[e]=t.clone():this.defaults[e]=t)}remove(e,t){return!!Object.prototype.hasOwnProperty.call(this.defaults,e)&&(delete this.defaults[e],delete this.tags[e],this.storageCache&&delete this.storageCache[e],t&&this.deleteFromWebStorage(e),!0)}deleteFromWebStorage(e){if(this.useLocalStorage){const t=this.getLocalStoragePrefix()+this.storageKey;let i=a.LocalStorage.getItem(t);i=JSON.parse(i||"{}"),delete i[e],a.LocalStorage.setItem(t,JSON.stringify(i))}}clearWebStorage(){const e=this.getLocalStoragePrefix();if(this.useLocalStorage)for(let t of a.LocalStorage.getAllKeys())-1!==t.indexOf(e)&&a.LocalStorage.removeItem(t)}reset(e,t){for(var i in e&&void 0===t&&(t=!0),this.defaults)if(Object.prototype.hasOwnProperty.call(this.defaults,i)){if(e){var r=!!this.tags[i][e];if(t&&!r||!t&&r)continue}this.set(i,this.defaults[i],!1)&&this.viewer.dispatchEvent({type:n.PREF_RESET_EVENT,name:i,value:this.get(i)}),this.deleteFromWebStorage(i)}}getLocalStoragePrefix(){return this.options.prefix}get(e){return this.storageCache[e]instanceof s.EnumType?this.storageCache[e].value:this.storageCache[e]}set(e,t,i){const r=t instanceof s.EnumType?t.value:t;return!function(e,t){const i=e=>"object"==typeof e?JSON.stringify(e):e;return i(e)===i(t)}(this.get(e),r)&&(this.storageCache[e]instanceof s.EnumType?this.storageCache[e].value=r:t instanceof s.EnumType?this.storageCache[e]=t.clone():this.storageCache[e]=r,this.webStorage(e,this.storageCache[e]),(void 0===i||i)&&this.viewer.dispatchEvent({type:n.PREF_CHANGED_EVENT,name:e,value:this.get(e)}),!0)}dispatchEvent(e){const t=this.get(e),i=n.PREF_CHANGED_EVENT;this.viewer.dispatchEvent({type:i,name:e,value:t})}addListeners(e,t,i){this.callbacks[e]||(this.callbacks[e]=[]),i||(i=t),this.callbacks[e].push({changed:t,reset:i})}removeListeners(e,t,i){if(void 0!==this.callbacks[e])if(t||i){i||(i=t);for(let n=0;n<this.callbacks[e].length;++n)if(this.callbacks[e][n].changed===t&&this.callbacks[e][n].reset===i){this.callbacks[e].splice(n,1);break}}else delete this.callbacks[e]}clearListeners(){this.callbacks={}}setUseLocalStorage(e){this.useLocalStorage=!!e}}o.GlobalManagerMixin.call(l.prototype)},51968:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Profile:()=>o});var n=i(59991),r=i(83833);function o(e){if(!e)return;const t=Autodesk.Viewing,i=t.ProfileSettings.Default;let o=[];if(this.name=Object.prototype.hasOwnProperty.call(e,"name")?e.name:"Custom",this.label=e.label,this.description=e.description,this.storageVersion="2.0",this.persistent=Array.isArray(e.persistent)?e.persistent:i.persistent,this.settings=Object.assign({},i.settings),Object.prototype.hasOwnProperty.call(e,"settings")){const t=e.settings;o=Object.keys(t),this.settings=Object.assign(this.settings,t)}let s=[],a=[];if(Object.prototype.hasOwnProperty.call(e,"extensions")){const t=e.extensions.load,i=e.extensions.unload;s=t?t.slice():s,a=i?i.slice():a}this.extensions={load:s,unload:a},this.apply=function(e){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)return!1;const s=e.getLocalStoragePrefix()+"StorageVersion",a="Autodesk.Viewing.ProfileName",l=()=>!!e.useLocalStorage&&(!r.LocalStorage.getItem(s)&&!!r.LocalStorage.getItem(a)),c=()=>{const t={},i=r.LocalStorage.getItem(a),n=e.getLocalStoragePrefix();for(let e of r.LocalStorage.getAllKeys())if(-1!==e.indexOf(n))try{t[e.split(".").pop()]=JSON.parse(r.LocalStorage.getItem(e)),r.LocalStorage.removeItem(e)}catch{console.log(`Cound't convert preference to new format: ${e}`)}r.LocalStorage.setItem(n+i,JSON.stringify(t)),r.LocalStorage.removeItem(a)};l()&&c();const h=e.getLocalStoragePrefix()+"StorageVersion";r.LocalStorage.setItem(h,this.storageVersion);const u=e.getLocalStoragePrefix()+"CurrentProfile";r.LocalStorage.setItem(u,this.name),e.setWebStorageKey(this.name);const d=this.settings,p=[t.ProfileSettings.Default.name,t.ProfileSettings.AEC.name],f=Object.values(n.Prefs3D),m=Object.values(n.Prefs2D);for(let t in d)if(Object.prototype.hasOwnProperty.call(d,t)){const n=d[t],r=-1!==o.indexOf(t)&&-1===p.indexOf(this.name)?["ignore-producer"]:[];-1!==f.indexOf(t)?r.push("3d"):-1!==m.indexOf(t)?r.push("2d"):(r.push("2d"),r.push("3d")),-1===this.persistent.indexOf(t)&&r.push("no-storage");const s=e.webStorage(t),a=e.get(t);if(void 0!==s){s!=a&&(e.add(t,s,r,!0),e.setDefault(t,n));continue}if(void 0!==a){e.addTags(t,r),a!==n&&i&&e.set(t,n);continue}e.add(t,n,r,!0)}return!0}}},88364:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ProfileManager:()=>o});var n=i(49720),r=i(51968);class o{constructor(){this.registered={};const e=Autodesk.Viewing.ProfileSettings;this.PROFILE_DEFAULT=new r.Profile(e.Default),this.registerProfile("default",this.PROFILE_DEFAULT),this.PROFILE_AEC=new r.Profile(e.AEC),this.registerProfile("rvt",this.PROFILE_AEC),this.registerProfile("ifc",this.PROFILE_AEC),this.PROFILE_NAVIS=new r.Profile(e.Navis),this.registerProfile("nwc",this.PROFILE_NAVIS),this.registerProfile("nwd",this.PROFILE_NAVIS),this.PROFILE_FLUENT=new r.Profile(e.Fluent),this.registerProfile("fluent",this.PROFILE_FLUENT)}registerProfile(e,t){t?(e=e||"default",this.registered[e]=t instanceof r.Profile?t:new r.Profile(t)):n.logger.log("ProfileManager: missing profileSettings when registering a profile.")}unregisterProfile(e){e?delete this.registered[e]:n.logger.log("ProfileManager: missing fileExt when unregistering a profile.")}getProfiles(){return Object.assign({},this.registered)}getProfileOrDefault(e){if(!e)return n.logger.log("ProfileManager: missing fileExt for getProfile. Returning the default Profile."),this.registered.default;const t=this.registered[e];return t||(n.logger.log(`ProfileManager: No profile registered for ${e}. Returning the default Profile.`),this.registered.default)}}},50467:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DefaultSettings:()=>u,EnumType:()=>c,ProfileSettings:()=>v});var n=i(59991),r=i(49720),o=i(4123),s=i(16840),a=i(34345),l=i(85552);class c{constructor(e,t){if(!Array.isArray(e)||0===e.length)throw new Error(`Invalid ${e}`);this.values=new Set(e),this.current=e.includes(t)?t:e[0]}get value(){return this.current}set value(e){this.values.has(e)&&(this.current=e)}clone(){return c.deSerialize(JSON.parse(this.toString()))}toString(){return JSON.stringify({type:"__enum",values:Array.from(this.values),current:this.current})}static deSerialize(e){if("__enum"===e.type)return new c(e.values,e.current)}}const h={};h[n.Prefs3D.AMBIENT_SHADOWS]=!0,h[n.Prefs3D.ANTIALIASING]=!(0,s.isMobileDevice)(),h[n.Prefs3D.GROUND_SHADOW]=!0,h[n.Prefs3D.GROUND_REFLECTION]=!1,h[n.Prefs3D.GHOSTING]=!0,h[n.Prefs3D.VIEW_CUBE]=!(0,s.isMobileDevice)(),h[n.Prefs3D.VIEW_CUBE_COMPASS]=!1,h[n.Prefs3D.VIEW_TYPE]=n.VIEW_TYPES.DEFAULT,h[n.Prefs3D.LINE_RENDERING]=!0,h[n.Prefs3D.LIGHT_PRESET]=a.DefaultLightPreset,h[n.Prefs3D.EDGE_RENDERING]=!1,h[n.Prefs3D.REVERSE_HORIZONTAL_LOOK_DIRECTION]=!1,h[n.Prefs3D.REVERSE_VERTICAL_LOOK_DIRECTION]=!1,h[n.Prefs3D.ALWAYS_USE_PIVOT]=!1,h[n.Prefs3D.ZOOM_TOWARDS_PIVOT]=!1,h[n.Prefs3D.ORBIT_PAST_WORLD_POLES]=!0,h[n.Prefs3D.CLICK_TO_SET_COI]=!1,h[n.Prefs3D.OPTIMIZE_NAVIGATION]=(0,s.isMobileDevice)(),h[n.Prefs3D.ENV_MAP_BACKGROUND]=!1,h[n.Prefs3D.FIRST_PERSON_TOOL_POPUP]=!0,h[n.Prefs3D.BIM_WALK_TOOL_POPUP]=!0,h[n.Prefs3D.BIM_WALK_NAVIGATOR_TYPE]="default",h[n.Prefs3D.BIM_WALK_GRAVITY]=!0,h[n.Prefs3D.DEFAULT_NAVIGATION_TOOL_3D]="default",h[n.Prefs3D.SELECTION_MODE]=o.SelectionMode.LEAF_OBJECT,h[n.Prefs3D.ENABLE_CUSTOM_ORBIT_TOOL_CURSOR]=!0,h[n.Prefs3D.EXPLODE_STRATEGY]="hierarchy",h[n.Prefs3D.SELECTION_SETS_PIVOT]=!1,h[n.Prefs3D.FORCE_DOUBLE_SIDED]=!1,h[n.Prefs3D.DISPLAY_SECTION_HATCHES]=!0,h[n.Prefs2D.GRAYSCALE]=!1,h[n.Prefs2D.SWAP_BLACK_AND_WHITE]=!1,h[n.Prefs2D.LOADING_ANIMATION]=!1,h[n.Prefs2D.FORCE_PDF_CALIBRATION]=!1,h[n.Prefs2D.FORCE_LEAFLET_CALIBRATION]=!0,h[n.Prefs2D.DISABLE_PDF_HIGHLIGHT]=!1,h[n.Prefs2D.USE_PDF_VIEWPORT_INFO]=!1,h[n.Prefs.PROGRESSIVE_RENDERING]=!0,h[n.Prefs.OPEN_PROPERTIES_ON_SELECT]=!1,h[n.Prefs.POINT_RENDERING]=!0,h[n.Prefs.BACKGROUND_COLOR_PRESET]=null,h[n.Prefs.REVERSE_MOUSE_ZOOM_DIR]=!1,h[n.Prefs.LEFT_HANDED_MOUSE_SETUP]=!1,h[n.Prefs.FUSION_ORBIT]=!0,h[n.Prefs.FUSION_ORBIT_CONSTRAINED]=!0,h[n.Prefs.WHEEL_SETS_PIVOT]=!1,h[n.Prefs.RESTORE_SESSION_MEASUREMENTS]=!0,h[n.Prefs.DISPLAY_UNITS]=new c(l.displayUnitsEnum),h[n.Prefs.DISPLAY_UNITS_PRECISION]=new c(l.displayUnitsPrecisionEnum),h[n.Prefs.KEY_MAP_CMD]=!0;const u=h,d={name:"Default",label:"Manufacturing (Default)",description:"Default Viewer settings"};d.settings=h,d.persistent=[n.Prefs3D.ALWAYS_USE_PIVOT,n.Prefs3D.ZOOM_TOWARDS_PIVOT,n.Prefs3D.REVERSE_HORIZONTAL_LOOK_DIRECTION,n.Prefs3D.REVERSE_VERTICAL_LOOK_DIRECTION,n.Prefs3D.ORBIT_PAST_WORLD_POLES,n.Prefs3D.CLICK_TO_SET_COI,n.Prefs3D.GHOSTING,n.Prefs3D.OPTIMIZE_NAVIGATION,n.Prefs3D.AMBIENT_SHADOWS,n.Prefs3D.ANTIALIASING,n.Prefs3D.GROUND_SHADOW,n.Prefs3D.GROUND_REFLECTION,n.Prefs3D.FIRST_PERSON_TOOL_POPUP,n.Prefs3D.BIM_WALK_TOOL_POPUP,n.Prefs3D.BIM_WALK_GRAVITY,n.Prefs3D.VIEW_TYPE,n.Prefs3D.SELECTION_MODE,n.Prefs2D.SWAP_BLACK_AND_WHITE,n.Prefs2D.LOADING_ANIMATION,n.Prefs.OPEN_PROPERTIES_ON_SELECT,n.Prefs.REVERSE_MOUSE_ZOOM_DIR,n.Prefs.LEFT_HANDED_MOUSE_SETUP,n.Prefs.WHEEL_SETS_PIVOT,n.Prefs.KEY_MAP_CMD,n.Prefs.DISPLAY_UNITS,n.Prefs.DISPLAY_UNITS_PRECISION],d.extensions={load:[],unload:[]};const p=g(d);p.name="AEC",p.label="Construction (AEC)",p.description="A common set of preferences designed for the Construction industry",p.settings[n.Prefs.REVERSE_MOUSE_ZOOM_DIR]=!0,p.settings[n.Prefs3D.EDGE_RENDERING]=!(0,s.isMobileDevice)(),p.settings[n.Prefs3D.LIGHT_PRESET]=(0,s.getGlobal)().DefaultLightPresetAec||"Boardwalk",p.settings[n.Prefs3D.ENV_MAP_BACKGROUND]=!0,p.settings[n.Prefs3D.VIEW_CUBE_COMPASS]=!0,p.settings[n.Prefs3D.SELECTION_SETS_PIVOT]=!0,p.extensions={load:[],unload:[]};const f=g(p);f.name="Fluent",f.label="Design Collaboration",f.description="User experience that matches Design Collaboration",f.settings[n.Prefs.WHEEL_SETS_PIVOT]=!0,f.settings[n.Prefs.RESTORE_SESSION_MEASUREMENTS]=!1,f.settings[n.Prefs2D.FORCE_PDF_CALIBRATION]=!0,f.settings[n.Prefs3D.ALWAYS_USE_PIVOT]=!0,f.settings[n.Prefs3D.ENABLE_CUSTOM_ORBIT_TOOL_CURSOR]=!1,f.extensions={load:[],unload:[]},f.persistent.splice(f.persistent.indexOf(n.Prefs3D.VIEW_TYPE),1);const m=g(p);function g(e){e||(r.logger.log("ProfileSettings.clone: missing profileSettings, using DefaultProfileSettings..."),e=d);const t={};return t.settings=Object.assign({},e.settings),t.extensions={},Object.prototype.hasOwnProperty.call(e,"extensions")?(t.extensions.load=Object.prototype.hasOwnProperty.call(e.extensions,"load")?e.extensions.load.slice():[],t.extensions.unload=Object.prototype.hasOwnProperty.call(e.extensions,"unload")?e.extensions.unload.slice():[]):t.extensions={load:[],unload:[]},t.persistent=e.persistent.slice(),t}m.name="Navis",m.label="Navisworks",m.description="Provides a user experience similar to Autodesk Navisworks desktop application",m.settings[n.Prefs3D.BIM_WALK_TOOL_POPUP]=!1,m.settings[n.Prefs3D.BIM_WALK_NAVIGATOR_TYPE]="aec",m.settings[n.Prefs3D.DEFAULT_NAVIGATION_TOOL_3D]="extractor_defined";const v={Default:d,AEC:p,Fluent:f,Navis:m,clone:g}},91531:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ProgressState:()=>n});let n={ROOT_LOADED:0,LOADING:1,RENDERING:2}},64432:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PropertySet:()=>r});var n=i(52081);class r{constructor(e){this.map=e}forEach(e){if(e)for(let t in this.map){if("__selected_dbIds__"===t)continue;e(t,this.map[t])}}getAggregation(e){if(!e)return null;if("string"==typeof e&&(e=this.map[e]),0===e.length)return null;const t=e[0].type;if(!(0,n.OY)(t))return null;const i={average:0,count:0,max:0,median:0,min:0,mode:[],range:0,sum:0},r=e.map((e=>Number(e.displayValue)));r.sort(((e,t)=>e-t));const o={};let s=0,a=0;r.forEach((e=>{a+=e,Object.prototype.hasOwnProperty.call(o,e)?o[e]++:o[e]=1,s=Math.max(s,o[e]),i.sum+=e})),i.count=r.length,i.average=a/i.count,i.max=r[i.count-1],i.min=r[0];const l=Math.ceil(i.count/2);i.median=i.count%2&&i.count>1?(r[l]+r[l-1])/2:r[l-1];for(let e in o)o[e]===s&&i.mode.push(Number(e));return i.range=i.max-i.min,i.sum=function(e,t){var i=t.displayValue.toString().split(".");if(1===i.length)return e;const n=e.toString().split(".");if(1===n.length)return e;const r=n[1];let o=i[1];if(r===o)return e;o=o.match(/\d+/);const s=o&&o[0]&&o[0].length||t.precision||0;return Number(e.toFixed(s))}(i.sum,e[0]),i}getValue2PropertiesMap(e){if(!e)return null;if("string"==typeof e&&(e=this.map[e]),!e||0===e.length)return null;const t={};return e.forEach((e=>{Object.prototype.hasOwnProperty.call(t,e.displayValue)||(t[e.displayValue]=[]),t[e.displayValue].push(e.parentName)})),t}getValidIds(e,t){const i=Object.keys(this.map),n=[];for(let r=0;r<i.length;r++){const o=i[r];if(e){if(-1!==o.indexOf(e)){n.push(o);continue}}if(t){const e=o.split("/");if(e.length>=2&&e[0]===t){n.push(o);continue}}}return n}getDbIds(){return this.map.__selected_dbIds__}getVisibleKeys(){const e=[];return this.forEach(((t,i)=>{i[0].hidden||e.push(t)})),e}getKeysWithCategories(){const e=[];return this.forEach(((t,i)=>{const n=!!i[0].hidden;i[0].displayCategory&&!n&&e.push(t)})),e}merge(e){if(!(e instanceof r))return this;const t=e.map;for(let e in t){const i=t[e];if(!Object.prototype.hasOwnProperty.call(this.map,e)){this.map[e]=i;continue}const n=this.map[e];if("__selected_dbIds__"!==e)for(let e=0;e<i.length;e++){const t=i[e];let r=!0;for(let e=0;e<n.length;e++){const i=n[e];t.displayValue!==i.displayValue||t.dbId!==i.dbId||(r=!1)}r&&n.push(t)}else this.map[e]=[...n,...i]}return this}}},53427:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AppScreenModeDelegate:()=>u,ApplicationScreenModeDelegate:()=>d,NullScreenModeDelegate:()=>p,ScreenMode:()=>c,ScreenModeDelegate:()=>h,ScreenModeMixin:()=>f});var n=i(16840),r=i(33423),o=i(49720),s=["fullscreenchange","mozfullscreenchange","webkitfullscreenchange","MSFullscreenChange"];function a(e,t){for(var i=0;i<s.length;++i)t.addDocumentEventListener(s[i],e,!1)}function l(e,t){for(var i=0;i<s.length;++i)t.removeDocumentEventListener(s[i],e,!1)}const c={kNormal:0,kFullBrowser:1,kFullScreen:2};function h(e){this.viewer=e,this.bindFullscreenEventListener=this.fullscreenEventListener.bind(this),this.getMode()===c.kFullScreen&&a(this.bindFullscreenEventListener,this.viewer.globalManager)}function u(e){h.call(this,e)}h.prototype.uninitialize=function(){l(this.bindFullscreenEventListener,this.viewer.globalManager),this.viewer=null},h.prototype.isModeSupported=function(e){return!0},h.prototype.setMode=function(e){var t=this.getMode();return!(e===t||!this.isModeSupported(e))&&(this.doScreenModeChange(t,e),this.onScreenModeChanged(t,e),!0)},h.prototype.getMode=function(){throw"Implement getMode() in derived class"},h.prototype.getNextMode=function(){var e,t=this.getMode(),i=c;return t===i.kNormal&&this.isModeSupported(i.kFullBrowser)?e=i.kFullBrowser:t===i.kNormal&&this.isModeSupported(i.kFullScreen)||t===i.kFullBrowser&&this.isModeSupported(i.kFullScreen)?e=i.kFullScreen:t===i.kFullBrowser&&this.isModeSupported(i.kNormal)||t===i.kFullScreen&&this.isModeSupported(i.kNormal)?e=i.kNormal:t===i.kFullScreen&&this.isModeSupported(i.kFullBrowser)&&(e=i.kFullBrowser),e},h.prototype.getEscapeMode=function(){return this.getMode()!==c.kNormal?c.kNormal:void 0},h.prototype.fullscreenEventListener=function(){var e=this.viewer.globalManager.getDocument();(0,n.inFullscreen)(e)?this.viewer.resize():(this.doScreenModeChange(c.kFullScreen,c.kNormal),this.onScreenModeChanged(c.kFullScreen,c.kNormal))},h.prototype.doScreenModeChange=function(e,t){throw"Implement doScreenModeChange() in derived class"},h.prototype.onScreenModeChanged=function(e,t){e===c.kFullScreen?l(this.bindFullscreenEventListener,this.viewer.globalManager):t===c.kFullScreen&&a(this.bindFullscreenEventListener,this.viewer.globalManager),this.viewer.resize(),this.viewer.dispatchEvent({type:r.FULLSCREEN_MODE_EVENT,mode:t})},u.prototype=Object.create(h.prototype),u.prototype.constructor=u,u.prototype.isModeSupported=function(e){return e!==c.kFullBrowser},u.prototype.getMode=function(){var e=this.viewer.globalManager.getDocument();return(0,n.inFullscreen)(e)?c.kFullScreen:c.kNormal},u.prototype.doScreenModeChange=function(e,t){var i=this.viewer.container;if(t===c.kNormal){i.classList.remove("viewer-fill-browser");var r=this.viewer.globalManager.getDocument();(0,n.exitFullscreen)(r)}else t===c.kFullScreen&&(i.classList.add("viewer-fill-browser"),(0,n.launchFullscreen)(i))};let d=u;function p(e){h.call(this,e)}function f(){}p.prototype=Object.create(h.prototype),p.prototype.constructor=h,p.prototype.isModeSupported=function(){return!1},p.prototype.getMode=function(){return c.kNormal},f.prototype={setScreenModeDelegate:function(e){this.screenModeDelegate&&(this.screenModeDelegate.uninitialize(),this.screenModeDelegate=null),this.screenModeDelegateClass=e||(null===e?p:u)},getScreenModeDelegate:function(){return this.screenModeDelegate||(this.screenModeDelegate=new this.screenModeDelegateClass(this)),this.screenModeDelegate},isScreenModeSupported:function(e){return this.getScreenModeDelegate().isModeSupported(e)},canChangeScreenMode:function(){return this.isScreenModeSupported(Autodesk.Viewing.ScreenMode.kNormal)},setScreenMode:function(e){var t={category:"screen_mode",value:e};return o.logger.track(t),this.getScreenModeDelegate().setMode(e)},getScreenMode:function(){return this.getScreenModeDelegate().getMode()},nextScreenMode:function(){var e=this.getScreenModeDelegate().getNextMode();return void 0!==e&&this.setScreenMode(e)},escapeScreenMode:function(){var e=this.getScreenModeDelegate().getEscapeMode();return void 0!==e&&this.setScreenMode(e)},apply:function(e){var t=f.prototype;e.setScreenModeDelegate=t.setScreenModeDelegate,e.getScreenModeDelegate=t.getScreenModeDelegate,e.isScreenModeSupported=t.isScreenModeSupported,e.canChangeScreenMode=t.canChangeScreenMode,e.setScreenMode=t.setScreenMode,e.getScreenMode=t.getScreenMode,e.nextScreenMode=t.nextScreenMode,e.escapeScreenMode=t.escapeScreenMode}}},84670:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ScreenShot:()=>x});var n=i(29996),r=i(10834),o=i(2285),s=i(16840),a=i(42198),l=i(41723),c=i(35797),h=i(34423),u=i(41434),d=i(33423),p=i(89135);const f=(e,t,i,d,f)=>{let m=f.getMaterials(),g=f.glrenderer(),v=f.renderer(),y=f.modelQueue(),b=[],x=(d=d||{}).models||y.getModels();for(let e=0;e<x.length;e++){let t=x[e].getIterator();if(!t||!t.getGeomScenes)continue;let i=t.getGeomScenes();for(let e=0;e<i.length;e++){let t=i[e];t&&b.push(t)}}let _=d.camera||f.camera;_===f.camera&&(_=_.clone()),_.isUnifiedCamera&&_.updateCameraMatrices(),_.clientWidth=e,_.clientHeight=t;let E,A,S=new r.FrustumIntersector,w=d.excludeCutPlanes?[]:m.getCutPlanes();S.reset(_,w),S.areaCullThreshold=n.PIXEL_CULLING_THRESHOLD,g.pushViewport(),g.setPixelRatio(1),d.renderContext?E=d.renderContext:(E=new o.RenderContext,E.init(g,e,t,{offscreen:!0})),f.isSheetRendererNeeded()&&(A=d.sheetRenderer?d.sheetRenderer:new p.Z(f,E,g,m)),m.addOverrideMaterial("normalsMaterial_screenshot",E.getDepthMaterial()),m.addOverrideMaterial("edgeMaterial_screenshot",E.getEdgeMaterial());let M=d.renderConfig||v.getConfig();E.applyConfig(M),E.beginScene(f.scene,_,f.noLights,!0),g.popViewport(),g.setPixelRatio();let T,C=0,P={stop:()=>{T&&((0,s.getGlobal)().clearTimeout(T),I())},finished:()=>!!T},D=-1,L=[];for(let e=0;e<x.length;e++){let t=x[e];if(t.isLeaflet()){let e=t.getIterator();L.push({iter:e,viewId:e.registerView(),ready:!1})}}const I=()=>{L.forEach((e=>e.iter.unregisterView(e.viewId))),L.length=0};let R=d.fragOptions,O=R?[]:void 0;const N=e=>{if(!(!!R&&e instanceof a.RenderBatch))return;let t=e.frags;e.forEachNoMesh((function(e,i){O[i]=t.vizflags[e];let n=R.isFragOff&&R.isFragOff(e);void 0!==n&&t.setFlagFragment(e,l.MeshFlags.MESH_HIDE,n);let r=R.isFragVisible&&R.isFragVisible(e);void 0!==r&&t.setFlagFragment(e,l.MeshFlags.MESH_VISIBLE,r)}))},k=e=>{if(!(!!R&&e instanceof a.RenderBatch))return;let t=e.frags;e.forEachNoMesh((function(e,i){let n=O[i],r=!!(n&l.MeshFlags.MESH_HIDE),o=!!(n&l.MeshFlags.MESH_VISIBLE);t.setFlagFragment(e,l.MeshFlags.MESH_HIDE,r),t.setFlagFragment(e,l.MeshFlags.MESH_VISIBLE,o)}))},F=(()=>{let e;if(d.models){e=new u.Box3;for(let t=0;t<x.length;t++){let i=x[t];e.union(i.getBoundingBox())}}else e=f.getVisibleBounds();let t=Object.prototype.hasOwnProperty.call(d,"is2d")?d.is2d:f.is2d,i=E.settings.deviceHeight,n=d.excludeCutPlanes?void 0:m.getCutPlanesRaw(),r=n&&n[0],o=x[0]&&x[0].getBoundingBox();return c.SceneMath.getPixelsPerUnit(_,t,e,i,r,o)})();let V=[],U=null;const B=e=>{d.excludeThemingColors&&e instanceof a.RenderBatch&&(e.frags.is2d||(U=e.frags.db2ThemingColor,e.frags.db2ThemingColor=V))},z=e=>{U&&(e.frags.db2ThemingColor=U,U=null)};let G=new u.Vector4(0,0,-1,-1e20),H=[],W=null;const j=()=>{if(!(()=>{let e=!0;for(let t=0;t<L.length;t++){let i=L[t];i.ready||(i.ready=i.iter.reset(S,_,i.viewId)),e=e&&i.ready}if(e=e||d.dontWaitForLeafletTiles,e)for(let e=0;e<L.length;e++){let t=L[e],i=t.iter.getScene(t.viewId);b.push(i)}return e})())return void(T=(0,s.getGlobal)().setTimeout(j,0));let n=performance.now();g.pushViewport(),g.setPixelRatio(1),g.setViewport(0,0,e,t);let r=f.getPixelsPerUnit(f.camera,f.getVisibleBounds());var o,l;(m.updatePixelScale(F,e,t,_),d.excludeCutPlanes)?(()=>{W=m.getCutPlanes();let e=W.length;if(H.length!==e){H.length=e;for(let t=0;t<e;t++)H[t]=G}v.toggleTwoSided(m.setCutPlanes(H))})():null===(o=(l=f.api).syncCutPlanes)||void 0===o||o.call(l);for(d.beforeRender&&d.beforeRender();C<b.length;){let e=b[C];const t=x.find((t=>{var i;return t.id===(null===(i=e.frags)||void 0===i?void 0:i.modelId)}));if(null!=t&&t.is2d()){const e=t.getModelToViewerTransform(),i=e?e.getMaxScaleOnAxis():1;if(!f.is2d||1!==i){const e=t.getVisibleBounds(),n=E.settings.deviceWidth,r=E.settings.deviceHeight,o=c.SceneMath.getPixelsPerUnit(_,!0,e,r,null,e);m.updatePixelScaleForModel(t,o,n,r,i,_)}}if(N(e),B(e),e instanceof a.RenderBatch&&e.applyVisibility(h.RenderFlags.RENDER_NORMAL,S),A&&e.frags.is2d?A.renderScenePart(e,!0,!0,!1,E):(E.renderScenePart(e,!0,!0,!1,!1),(e.frags&&!e.frags.areAllVisible()&&f.showGhosting||R)&&(e instanceof a.RenderBatch&&e.applyVisibility(h.RenderFlags.RENDER_HIDDEN,S),v.setEdgeColor(f.edgeColorGhosted),e.overrideMaterial=f.fadeMaterial,E.renderScenePart(e,!0,!0,!1,!1),v.setEdgeColor(f.edgeColorMain),e.overrideMaterial=null)),z(e),k(e),C++,performance.now()-n>20)break}if(g.popViewport(),g.setPixelRatio(),m.updatePixelScale(r,v.settings.deviceWidth,v.settings.deviceHeight,_),d.excludeCutPlanes&&v.toggleTwoSided(m.setCutPlanes(W)),d.afterRender&&d.afterRender(),C===b.length?(()=>{I();let e=E.getColorTarget();if((M.aoEnabled||M.antialias)&&(M.aoEnabled&&E.computeSSAO(),e=E.getNamedTarget("overlay"),E.getBlendPass().uniforms.tOverlay.value=null,E.setOffscreenTarget(e),E.presentBuffer()),d.returnAsTarget)return void i(E,e,_,A);var t;d.sheetRenderer||(null===(t=A)||void 0===t||t.destroy(),A=null),E.targetToCanvas(e).canvas.toBlob((function(e){let t=(0,s.getGlobal)().URL.createObjectURL(e);i&&(i(t),d.renderContext||E.cleanup())}))})():T=(0,s.getGlobal)().setTimeout(j,0),d.onProgress){let e=Math.floor(100*C/b.length);e!==D&&(D=e,d.onProgress(e))}};return j(),P},m=(e,t,i,n,r)=>{var{fullPage:o,bounds:a,getCropBounds:l,margin:c,overlayRenderer:h,overlayRendererExtraOptions:d}=r;o&&(a=e.impl.getVisibleBounds());const p=e.impl.getCanvasBoundingClientRect().width;let m=e.navigation.getCamera();a&&(m=b(e,a,c));const y=g(e,m);try{if(o){const e=y.getSize(new u.Vector3),n=p/Math.max(e.x,e.y);t=Math.floor(t*n),i=Math.floor(i*n)}const r=r=>{if(o){const e=t/p;y.min.x*=e,y.min.y*=e,y.max.x*=e,y.max.y*=e,v(r,y,n)}else if(l){const t=l(e,m,a);v(r,t,n)}else r.toBlob((e=>{const r=(0,s.getGlobal)().URL.createObjectURL(e);n(r,t,i)}))},c=e.impl.selector.getSelection();return e.clearSelection(),f(t,i,((n,o,s)=>{if(e.impl.selector.setSelection(c),h){h(e,{width:t,height:i,ctx:n,target:o,screenshotCamera:s,onRenderDone:r},d)}else{const{canvas:e}=n.targetToCanvas(o);r(e)}}),{returnAsTarget:!0,camera:m},e.impl)}catch(e){console.error("getScreenShot error: "+e),n(null)}},g=(e,t)=>{const i=e.impl.getVisibleBounds(void 0,void 0,void 0,!0),n=e.worldToClient(i.min,t),r=e.worldToClient(i.max,t);return(new u.Box3).setFromPoints([n,r])},v=(e,t,i)=>{const n=(0,s.getGlobal)().document.createElement("canvas"),r=n.getContext("2d"),o=t.getSize(new u.Vector3),a=Math.min(Math.floor(o.x),e.width),l=Math.min(Math.floor(o.y),e.height);n.width=a,n.height=l;const c=Math.max(Math.floor(t.min.x),0),h=Math.max(Math.floor(t.min.y),0),d=a,p=l;r.drawImage(e,c,h,d,p,0,0,a,l),n.toBlob((e=>{var t=(0,s.getGlobal)().URL.createObjectURL(e);i(t,a,l)}),"image/png")},y=(e,t,i,n)=>{const r=(0,s.getGlobal)().document.createElement("canvas"),o=r.getContext("2d"),a=new Image;r.width=t,r.height=i,a.src=e,a.onload=function(){o.drawImage(a,0,0,t,i);const e=r.toDataURL("image/png");n(e)}},b=(e,t,i)=>{i=i||e.navigation.FIT_TO_VIEW_HORIZONTAL_MARGIN;const n={horizontal:e.navigation.FIT_TO_VIEW_HORIZONTAL_MARGIN,vertical:e.navigation.FIT_TO_VIEW_VERTICAL_MARGIN};e.navigation.FIT_TO_VIEW_HORIZONTAL_MARGIN=i,e.navigation.FIT_TO_VIEW_VERTICAL_MARGIN=i;const r=e.getState({viewport:!0});e.navigation.fitBounds(!0,t,!1,!0);const o=e.navigation.getCamera().clone();return e.restoreState(r,void 0,!0),e.navigation.FIT_TO_VIEW_HORIZONTAL_MARGIN=n.horizontal,e.navigation.FIT_TO_VIEW_VERTICAL_MARGIN=n.vertical,e.impl.updateNearFarValues(o,t),o};let x={getScreenShotLegacy:function(e,t,i,n,r){var o=e.impl,a=o.renderer(),l=a.settings.logicalWidth,c=a.settings.logicalHeight,h=o.progressiveRender,p=o.glrenderer().getPixelRatio();t&&i||(t=l,i=c),o.progressiveRender=!1,o.resize(t/p,i/p,!0),o.tick(performance.now());let f=u.RGBAFormat;f=u.RGBFormat;var m=new u.WebGLRenderTarget(t,i,{minFilter:u.LinearFilter,magFilter:u.LinearFilter,format:f,type:u.UnsignedByteType});const g=a.getOffscreenTarget();function v(){var e=a.targetToCanvas(m||a.getColorTarget());function t(){o.progressiveRender=h,o.resize(l,c,!0),e.canvas.toBlob((function(e){var t=(0,s.getGlobal)().URL.createObjectURL(e);n?n(t):(0,s.getGlobal)().open(t)}),"image/png")}m&&(m.dispose(),m=void 0,o.glrenderer().setRenderTarget(null)),r?r(e.ctx,t):t()}if(a.setOffscreenTarget(m),a.presentBuffer(),a.setOffscreenTarget(g),e.model.isLeaflet()){var y=!1;const t=function(){y=!0,o.progressiveRender=h,o.resize(l,c,!0),m&&m.dispose()};e.addEventListener(d.CANCEL_LEAFLET_SCREENSHOT,t,{once:!0}),o.invalidate(!0),e.model.getIterator().callWhenRefined((function(){y||(e.removeEventListener(d.CANCEL_LEAFLET_SCREENSHOT,t),v())}))}else v()},getScreenShot:f,getScreenShotWithBounds:m,getScreenShotAtScreenSize:(e,t,i)=>{const n=e.impl.getCanvasBoundingClientRect(),r=Math.floor(n.width),o=Math.floor(n.height);m(e,r,o,((e,i,n)=>{e?y(e,i,n,(e=>{t(e,i,n)})):t(null)}),i)},getSceneClientBounds:g,cropImage:v,blobToImage:y,makeBoundsSquare:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=e.getSize(new u.Vector3),n=Math.max(i.x,i.y,t);e.expandByVector(new u.Vector3((n-i.x)/2,(n-i.y)/2,0))},getCameraWithFitBounds:b}},16526:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Thumbnails:()=>l});var n=i(83833),r=i(75121),o=i(32154),s=i(16840),a=i(53005);let l={getUrlForBubbleNode:function(e,t){if(!e)return Promise.reject(new Error("Missing instance of BubbleNode"));var i=e.findParentGeom2Dor3D();if(!i)return Promise.reject(new Error("No thumbnail available."));const l=(t=t||{}).size||200,c=e.getRootNode();return(c.data.isVectorPDF||i.data.isVectorPDF)&&c.data.getPDF?new Promise((t=>{let i=e.data,r=c.data.getPDF(),o=l,a=l,h=`${i.guid}/thumbnail/${o}x${a}`;!function(e,t,i,r,o,a){var l=n.LocalStorage.getItem(o);l?a(l):e.getPage(t).then((e=>{var t=(0,s.getGlobal)().document.createElement("canvas");t.width=i,t.height=r;var l=t.getContext("2d"),c={scale:1},h=e.getViewport(c),u=Math.min(t.width/h.width,t.height/h.height);e.render({canvasContext:l,viewport:e.getViewport({scale:u})}).promise.then((()=>{e.cleanup(),t.toBlob((e=>{var t=new FileReader;t.readAsDataURL(e),t.onloadend=function(){n.LocalStorage.setItem(o,t.result),a(t.result)}}),"image/png")}))}))}(r,i.page,o,a,h,t)})):new Promise(((t,i)=>{var n={urn:c.urn(),width:l,height:l,guid:encodeURIComponent(e.guid()),acmsession:r.endpoint.getAcmSession()},h={responseType:"blob",skipAssetCallback:!0,size:l,guid:n.guid,acmsession:n.acmSession};let u="urn:"+n.urn;e.data.thumbnailUrn&&(u=c.getDocument().getFullPath(e.data.thumbnailUrn));var d=void 0;if(!(0,s.getGlobal)().USE_OTG_DS_PROXY){var p=(0,r.getEnv)();d=a.EnvironmentConfigurations[p].UPSTREAM;const e=(0,a.getUpstreamApiData)(p,r.endpoint.getApiFlavor());h.apiData=e}o.ViewingService.getThumbnail((0,r.initLoadContext)({endpoint:d}),u,(e=>{var i=new FileReader;i.onload=e=>{var i=e.target.result;t(i)},i.readAsDataURL(e)}),(()=>{i(new Error("Thumbnail is unavailable."))}),h)}))}}},83368:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Viewer3D:()=>te,waitForCompleteLoad:()=>ie});var n=i(41434),r=i(16840),o=i(49720),s=i(51968),a=i(59991),l=i(50467),c=i(85552),h=i(88364),u=i(43644),d=i(82079),p=i(78443),f=i(21553),m=i(53427),g=i(9749),v=i(27587),y=i(76052),b=i(42502),x=i(82877),_=i(85623),E=i(30126),A=i(71224),S=i(33423),w=i(72614),M=i(47899),T=i(63946),C=i(88762),P=i(37804),D=i(54372),L=i(77693),I=i(29865),R=i(89853),O=i(27293);const N=416,k=1e3;class F{constructor(e){this.viewer=e,this.setGlobalManager(this.viewer.globalManager),this.domElement=null,this._step=this._step.bind(this)}createDom(e){const t=this.getDocument();this.domElement=t.createElement("div"),this.domElement.className="forge-spinner",this._initTransform="translate(-50%, -50%) scale(0.5)",this.domElement.style.transform=this._initTransform.slice();var i=this._createSvgElement("svg");i.setAttribute("width","242"),i.setAttribute("height","242"),i.setAttribute("viewBox","0 0 72 72"),i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.domElement.appendChild(i);var n=this._createWheelPointData(10,72,6.75);this._createMask(n);var r=this._createSvgElement("polygon");r.setAttribute("mask","url(#mask)"),i.appendChild(r),this._addPoints(n.outerPoints,r),this._createSegments(n);var o=t.createElement("img");return o.src=Autodesk.Viewing.Private.getResourceUrl("res/ui/powered-by-autodesk-blk-rgb.png"),this._onResize=this._onResize.bind(this),o.onload=()=>{this._onResize(),this._initResize=!0,this.viewer.addEventListener(Autodesk.Viewing.VIEWER_RESIZE_EVENT,this._onResize)},this.domElement.appendChild(o),e&&e.appendChild(this.domElement),this.domElement.style.display="none",this.domElement}_createSvgElement(e){return this.getDocument().createElementNS("http://www.w3.org/2000/svg",e)}_getSvg(){return null==this?void 0:this.domElement.getElementsByTagNameNS("http://www.w3.org/2000/svg","svg")[0]}_createMask(e){const t=this._getSvg(),i=this._createSvgElement("defs"),n=this._createSvgElement("mask");n.id="mask",i.appendChild(n),t.appendChild(i);const r=this._createSvgElement("polygon");r.style.opacity=.15,r.style.fill="#FFF",n.appendChild(r),this._addPoints(e.outerPoints,r);const o=this._createSvgElement("polygon");n.appendChild(o),this._addPoints(e.innerPoints,o)}_step(e){this.startTime||(this.startTime=e);const t=(e-this.startTime)%k;this._setSegmentOpacities(t);const i=this.getWindow();this._animId=i.requestAnimationFrame(this._step)}_stop(){if(this._animId){this.getWindow().cancelAnimationFrame(this._animId),this._animId=null}}_setSegmentOpacities(e){this.segments.forEach(((t,i)=>{const n=Math.abs(i-this.segments.length)-1;t.style.opacity=this._getSegmentOpacity(n,e)}))}_getSegmentOpacity(e,t){const i=e*(k/this.segments.length);return i+N>k&&t<N?-1*((t+k-i)/N-1):t<i||t>i+N?0:Math.abs((t-i)/N-1)}_getSegments(){return Array.from(this.domElement.querySelectorAll(".segment"))}_addPoints(e,t){for(let i of e){const e=this._getSvg().createSVGPoint();e.x=i[0],e.y=i[1],t.points.appendItem(e)}}_createWheelPointData(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const n=t/2,r=t/2,o=t/2,s={outerPoints:[],innerPoints:[]};for(let t=1;t<=e;t++)s.outerPoints.push([r+n*Math.cos(2*t*Math.PI/e),o+n*Math.sin(2*t*Math.PI/e)]),s.innerPoints.push([r+(n-i)*Math.cos(2*t*Math.PI/e),o+(n-i)*Math.sin(2*t*Math.PI/e)]);return s}_createSegments(e){const{outerPoints:t,innerPoints:i}=e,n=this._getSvg(),r=(e,t)=>{var i=this._createSvgElement("polygon");V(i,"segment"),V(i,t),this._addPoints(e,i),n.appendChild(i)};for(let e=t.length-1;e>=0;--e){let n=t[e],o=t[e-1],s=i[e],a=i[e-1];0===e&&(o=t[t.length-1],a=i[t.length-1]),r([n,o,s],"light-blue"),r([s,a,o],"dark-blue")}}_fadeOut(){let e=1;const t=setInterval((()=>{var i;null!==(i=this.domElement)&&void 0!==i&&i.style?(e<=.1&&(clearInterval(t),this.domElement.style.display="none"),this.domElement.style.opacity=e,e-=.1*e):clearInterval(t)}),1)}show(){this.domElement&&(this.domElement.style.display="block",this.domElement.style.opacity=1,this.segments=this._getSegments(),this._step(1))}hide(){if(this.domElement){this._hide=e=>{this._stop(),e.model.is3d()?this._fadeOut():(this.domElement.style.opacity=0,this.domElement.style.display="none")};var e=this.viewer.impl.modelQueue().getModels();0===e.length?this.viewer.addEventListener(Autodesk.Viewing.MODEL_ADDED_EVENT,this._hide,{once:!0}):this._hide({model:e[0]})}}destroy(){var e;this._stop(),null!==(e=this.domElement)&&void 0!==e&&e.parentElement&&this.domElement.parentElement.removeChild(this.domElement),this.domElement=null,this.viewer.removeEventListener(Autodesk.Viewing.VIEWER_RESIZE_EVENT,this._onResize)}_onResize(){var e,t;if(this._initResize)return void(this._initResize=!1);const i=this.domElement;if(!i)return;if("none"==i.style.display)return;const n=i.parentElement;if(!n)return;const r=n.getBoundingClientRect(),o=i.getBoundingClientRect(),s=Math.max(o.width/r.width,(o.height+350)/r.height),a=null===(e=this.domElement)||void 0===e||null===(t=e.style)||void 0===t?void 0:t.transform;if(a)if(s>.8){const e=/[-+]?scale\(\d*\.\d+|\d+\)/,t=e.exec(a);if(t.length>0){const i=t[0].split("scale(")[1],n=Number((i/s).toFixed(4)),r=a.replace(e,`scale(${n}`);r!=this.domElement.style.transform&&n<=.5&&n>.2&&(this.domElement.style.transform=r)}}else this.domElement.style.transform!=this._initTransform&&(this.domElement.style.transform=this._initTransform)}}function V(e,t){if(e.classList)e.classList.add(t);else{let i=e.getAttribute("class")||"";i=i.split(" ").includes(t)?i:`${i} ${t}`,e.setAttribute("class",i)}}O.GlobalManagerMixin.call(F.prototype);class U{constructor(){this.domElement=null}createDom(e){var t=this.getDocument(),i=t.createElement("div");i.className="spinner",e&&e.appendChild(i);for(var n=1;n<=3;n++){var r=t.createElement("div");r.className="bounce"+n,i.appendChild(r)}return this.domElement=i,this.hide(),i}show(){this.domElement&&(this.domElement.style.display="block")}hide(){this.domElement&&(this.domElement.style.display="None")}destroy(){this.domElement=null}}O.GlobalManagerMixin.call(U.prototype);var B=i(35797),z=i(84670);const G=Object.freeze({pdf:"Autodesk.PDF",scalaris:"Autodesk.Scalaris",dwf:"Autodesk.DWF",dwfx:"Autodesk.DWF",rcp:"Autodesk.ReCap",gltf:"Autodesk.glTF",glb:"Autodesk.glTF"});var H=i(13138),W=i(5073),j=i(34345),X=i(84302),q=i(36291),Y=i(75121);var K=i(52208);class Z extends K.Preferences{constructor(e,t){super(e,t);const i={[a.Prefs3D.VIEW_CUBE]:function(t){e.getExtension("Autodesk.ViewCubeUi",(function(e){e.displayViewCube(t)}))},[a.Prefs3D.ALWAYS_USE_PIVOT]:e.setUsePivotAlways.bind(e),[a.Prefs3D.ORBIT_PAST_WORLD_POLES]:e.setOrbitPastWorldPoles.bind(e),[a.Prefs3D.ZOOM_TOWARDS_PIVOT]:e.setZoomTowardsPivot.bind(e),[a.Prefs.REVERSE_MOUSE_ZOOM_DIR]:e.setReverseZoomDirection.bind(e),[a.Prefs.LEFT_HANDED_MOUSE_SETUP]:e.setUseLeftHandedInput.bind(e),[a.Prefs3D.CLICK_TO_SET_COI]:e.setClickToSetCOI.bind(e),[a.Prefs.ZOOM_DRAG_SPEED]:function(t){var i;const n=e.toolController.getTool("dolly");null==n||null===(i=n.setDollyDragScale)||void 0===i||i.call(n,t)},[a.Prefs.ZOOM_SCROLL_SPEED]:t=>{var i;const n=e.toolController.getTool("dolly");null==n||null===(i=n.setDollyScrollScale)||void 0===i||i.call(n,t)},[a.Prefs3D.ANTIALIASING]:t=>e.setQualityLevel(this.get("ambientShadows"),t),[a.Prefs3D.AMBIENT_SHADOWS]:t=>e.setQualityLevel(t,e.prefs.get("antialiasing")),[a.Prefs3D.GROUND_SHADOW]:e.setGroundShadow.bind(e),[a.Prefs3D.GROUND_REFLECTION]:e.setGroundReflection.bind(e),[a.Prefs2D.SWAP_BLACK_AND_WHITE]:e.setSwapBlackAndWhite.bind(e),[a.Prefs3D.OPTIMIZE_NAVIGATION]:e.setOptimizeNavigation.bind(e),[a.Prefs.PROGRESSIVE_RENDERING]:e.setProgressiveRendering.bind(e),[a.Prefs.GHOSTING]:e.setGhosting.bind(e),[a.Prefs3D.LINE_RENDERING]:t=>e.hideLines(!t),[a.Prefs.POINT_RENDERING]:t=>e.hidePoints(!t),[a.Prefs3D.EDGE_RENDERING]:e.setDisplayEdges.bind(e),[a.Prefs3D.ENV_MAP_BACKGROUND]:e.setEnvMapBackground.bind(e),[a.Prefs3D.LIGHT_PRESET]:e.setLightPreset.bind(e)};Object.keys(i).forEach((e=>{this.addListeners(e,i[e])}))}}var Q=i(62206);const J=Autodesk.Viewing;var $=0;const ee=["markups-svg","pushpin-container"];function te(e,t){if(this.setGlobalManager(new W.GlobalManager),e){if(this.clientContainer=e,this.container=this.getDocument().createElement("div"),this.container.classList.add("adsk-viewing-viewer"),this.container.style.height="100%",this.container.style.width="100%",this.container.style.overflow="hidden",this.container.classList.add((0,r.isTouchDevice)()?"touch":"notouch"),this.clientContainer.appendChild(this.container),this.config=t||{},this.contextMenu=null,this.contextMenuCallbacks={},this.started=!1,this.theme=this.config.theme||"dark-theme",this.container.classList.add(this.theme),this.containerLayerOrder=this.config.containerLayerOrder||ee,(0,r.isChrome)()&&this.container.classList.add("quality-text"),"CANVAS"===this.container.nodeName)throw"Viewer must be initialized on a div [temporary]";if(this.canvasWrap=this.getDocument().createElement("div"),this.canvasWrap.classList.add("canvas-wrap"),this.canvas=this.getDocument().createElement("canvas"),this.canvas.tabIndex=0,this.canvas.setAttribute("data-viewer-canvas","true"),this.canvasWrap.appendChild(this.canvas),this.container.appendChild(this.canvasWrap),!(0,r.isPhoneFormFactor)()&&!J.Private.DISABLE_FORGE_LOGO&&!J.Private.DISABLE_FORGE_CANVAS_LOGO){const e=this.getDocument();this._forgeLogo=e.createElement("div"),this._forgeLogo.classList.add("forge-logo-canvas");const t=e.createElement("img");t.src=Autodesk.Viewing.Private.getResourceUrl("res/ui/powered-by-autodesk-oneline-blk-rgb.png"),this._forgeLogo.appendChild(t),this._forgeLogo.style.display="none",this.container.appendChild(this._forgeLogo)}this.canvas.viewer=this}var i=t&&t.localStoragePrefix||"Autodesk.Viewing.Private.GuiViewer3D.SavedSettings.";i.endsWith(".")||(i+=".");var n={prefix:i,localStorage:!(0,r.isNodeJS)()};this._displayEdges=null,this._setDoubleSided=null,this.prefs=new Z(this,n),this.profile=null,this.profileManager=new h.ProfileManager,this._hotkeyManager=new v.HotkeyManager,this.extensionCache=null,this.running=!1,this._pushedTool="",this._defaultNavigationTool="",this.id=$++,this.impl=new D.Viewer3DImpl(this.canvas,this),this.overlays=new H.OverlayManager(this.impl),this._loadingSpinner=J.Private.DISABLE_FORGE_LOGO?new U:new F(this),this._loadingSpinner.setGlobalManager(this.globalManager),this.trackADPTimer=[]}function ie(e,t){return new Promise(((i,n)=>{var r=0;function o(t){2===r&&i({viewer:e,model:t})}e.addEventListener(S.GEOMETRY_LOADED_EVENT,(function i(s){s.model.getData().loadOptions.bubbleNode===t.bubbleNode&&(e.removeEventListener(S.GEOMETRY_LOADED_EVENT,i),r++,t.skipPropertyDb?o(s.model):s.model.getProperties(1,(()=>o(s.model)),(e=>n(e))))})),e.addEventListener(S.TEXTURES_LOADED_EVENT,(function i(n){n.model.getData().loadOptions.bubbleNode===t.bubbleNode&&(e.removeEventListener(S.TEXTURES_LOADED_EVENT,i),r++,o(n.model))}))}))}p.EventDispatcher.prototype.apply(te.prototype),m.ScreenModeMixin.prototype.apply(te.prototype),g.ExtensionMixin.prototype.apply(te.prototype),O.GlobalManagerMixin.call(te.prototype),te.prototype.constructor=te,Object.defineProperty(te.prototype,"model",{get:function(){var e;return null===(e=this.impl)||void 0===e?void 0:e.model},set:function(){throw"Do not set viewer.model"}}),te.ViewerCount=0,te.kDefaultCanvasConfig={click:{onObject:["selectOnly"],offObject:["deselectAll"]},clickAlt:{onObject:["setCOI"],offObject:["setCOI"]},clickCtrl:{onObject:["selectToggle"]},clickShift:{onObject:["selectToggle"]},disableSpinner:!1,disableMouseWheel:!1,disableTwoFingerSwipe:!1},Object.defineProperty(te.prototype,"scene",{get:function(){return this.impl.scene},set:function(){throw"Do not set viewer.scene"}}),Object.defineProperty(te.prototype,"sceneAfter",{get:function(){return this.impl.sceneAfter},set:function(){throw"Do not set viewer.sceneAfter"}}),te.createHeadlessViewer=function(){var e=new te;return e.impl.initialize(),e.impl.setLightPreset(0),e},te.prototype.start=function(e,t,i,n,r){if(this.started)return 0;this.started=!0;var o=this,s=o.initialize(r);return 0!==s?(n&&setTimeout((function(){n(s)}),1),s):(setTimeout((function(){o.setUp(o.config)}),1),e&&this.loadModel(e,t,i,n),0)},te.prototype.startWithDocumentNode=function(e,t,i){var n=this;return new Promise((function(r,o){if(n.started)return 0;n.started=!0;var s=n.initialize();0===s?(setTimeout((function(){n.setUp(n.config)}),1),n.loadDocumentNode(e,t,i).then(r).catch(o)):setTimeout((function(){o(s)}),1)}))},te.prototype.registerUniversalHotkeys=function(){var e,t,i,n=this;e=function(){return n.navigation.setRequestFitToView(!0),q.analytics.track("viewer.fit_to_view",{from:"Keyboard"}),!0},n._hotkeyManager.pushHotkeys("Autodesk.FitToView",[{keycodes:[R.KeyCode.f],onPress:e}]),e=function(){return n.navigation.setRequestHomeView(!0),!0},n._hotkeyManager.pushHotkeys("Autodesk.Home",[{keycodes:[R.KeyCode.h],onPress:e},{keycodes:[R.KeyCode.HOME],onPress:e}]),t=function(){return n.objectContextMenu&&n.objectContextMenu.hide()||n.dispatchEvent({type:S.ESCAPE_EVENT}),!0},n._hotkeyManager.pushHotkeys("Autodesk.Escape",[{keycodes:[R.KeyCode.ESCAPE],onRelease:t}]),e=function(){return i=n.getActiveNavigationTool(),n.setActiveNavigationTool("pan")},t=function(){return n.setActiveNavigationTool(i)};var r=[{keycodes:[R.KeyCode.SHIFT],onPress:e,onRelease:t},{keycodes:[R.KeyCode.SPACE],onPress:e,onRelease:t}];n._hotkeyManager.pushHotkeys("Autodesk.Pan",r,{tryUntilSuccess:!0})},te.prototype.createControls=function(){var e=this,t=e.impl;return e.navigation=new y.Navigation(t.camera),e.__initAutoCam(t),e.utilities=new x.ViewingUtilities(t,e.autocam,e.navigation),e.clickHandler=new _.DefaultHandler(t,e.navigation,e.utilities),e.toolController=new b.ToolController(t,e,e.autocam,e.utilities,e.clickHandler),e.toolController.registerTool(new E.GestureHandler(e)),e.toolController.registerTool(e._hotkeyManager),e.toolController.activateTool(e._hotkeyManager.getName()),e.registerUniversalHotkeys(),e.toolController.registerTool(new C.OrbitDollyPanTool(t,e,this.config.navToolsConfig),(e=>{e||this.setActiveNavigationTool()})),e.toolController.setModalityMap({section:{explode:!1,pan:!1,dolly:!1},explode:{section:!1,pan:!1,dolly:!1},measure:{"box-selection":!1},calibration:{"box-selection":!1},orbit:{},dolly:{},pan:{},fov:{},bimwalk:{},"box-selection":{measure:!1,calibration:!1}}),e.toolController},te.prototype.initialize=function(e){this.setScreenModeDelegate(this.config?this.config.screenModeDelegate:void 0);var t=this.getDimensions();if(this.canvas.width=t.width,this.canvas.height=t.height,(0,r.isIOSDevice)()&&this.getWindow().devicePixelRatio&&(this.canvas.width/=this.getWindow().devicePixelRatio,this.canvas.height/=this.getWindow().devicePixelRatio),this.impl.initialize(e),!this.impl.glrenderer()){var i=function(){if(J.getGlobal().WebGLRenderingContext){for(var e=J.getGlobal().document.createElement("canvas"),t=["webgl","experimental-webgl","moz-webgl","webkit-3d"],i=!1,n=0;n<4;n++)try{if((i=e.getContext(t[n]))&&"function"==typeof i.getParameter)return 1}catch(e){}return 0}return-1}();if(i<=0)return-1===i?d.ErrorCodes.BROWSER_WEBGL_NOT_SUPPORTED:d.ErrorCodes.BROWSER_WEBGL_DISABLED}var n,o=this;(0,r.isIOSDevice)()?this.onResizeCallback=function(){clearTimeout(n),n=setTimeout(o.resize.bind(o),500)}:this.onResizeCallback=function(){var e=o.impl.camera.clientWidth,t=o.impl.camera.clientHeight,i=o.container.clientWidth,n=o.container.clientHeight;e===i&&t===n||o.resize()};this.addWindowEventListener("resize",this.onResizeCallback),this.onPixelRatioChanged=()=>{if(!o.impl.glrenderer())return;const e=o.getWindow().devicePixelRatio;matchMedia(`(resolution: ${e}dppx)`).addEventListener("change",o.onPixelRatioChanged,{once:!0}),o.impl.glrenderer().setPixelRatio(e),o.resize()},this.onPixelRatioChanged(),this.onScrollCallback=function(){o.impl.canvasBoundingclientRectDirty=!0},this.addWindowEventListener("scroll",this.onScrollCallback),this.initContextMenu(),this.localize(),this.impl.controls=this.createControls(),this.initializePrefListeners(),this.setDefaultNavigationTool("orbit"),this.impl.controls&&this.impl.controls.setAutocam(this.autocam);var s=this.config&&this.config.canvasConfig?this.config.canvasConfig:te.kDefaultCanvasConfig;this.setCanvasClickBehavior(s),s.disableSpinner||(this.loadSpinner=this._loadingSpinner.createDom(this.container)),this.viewerState=new T.ViewerState(this),this.config&&Object.prototype.hasOwnProperty.call(this.config,"startOnInitialize")&&!this.config.startOnInitialize||this.run();const a=J.getGlobal();return a.NOP_VIEWER||(a.NOP_VIEWER=this),a.NOP_VIEWERS=a.NOP_VIEWERS||[],a.NOP_VIEWERS.push(this),this.addEventListener(S.MODEL_ADDED_EVENT,(function(e){o.onModelAdded(e.model,e.preserveTools)})),this.addEventListener(S.GEOMETRY_LOADED_EVENT,(function(e){var t,i,n;e.model.is2d()&&!e.model.isLeaflet()&&o.navigation.setMinimumLineWidth(null===(i=e.model.loader)||void 0===i||null===(n=i.svf)||void 0===n?void 0:n.minLineWidth);const r=(null===(t=e.model.getGeometryList())||void 0===t?void 0:t.geoms)||[];e.model.hasEdges=!1;for(let t=0;t<r.length;t++){const i=r[t];if(i&&(i.isLine||(0,Q.getLineIndexBufferArray)(i))){e.model.hasEdges=!0;break}}})),this.dispatchEvent(S.VIEWER_INITIALIZED),this.trackADPSettingsOptions(),this.trackADPExtensionsLoaded(),te.ViewerCount++,0},te.prototype.setUp=function(e){var t;if(this.config=e||{},this.config.extensions=this.config.extensions||[],Array.isArray(this.config.extensions))for(var i=this.config.extensions,n=0;n<i.length;++n)this.loadExtension(i[n],this.config);"fedramp"===(null===(t=e.region)||void 0===t?void 0:t.toLowerCase())||this.loadExtension("Autodesk.Viewing.MixpanelExtension"),"true"===(0,u.getParameterByName)("lmv_viewer_debug")&&this.loadExtension("Autodesk.Debug",this.config);var r=this.config.canvasConfig||te.kDefaultCanvasConfig;this.setCanvasClickBehavior(r),this._onAggregatedSelectionChanged=this._onAggregatedSelectionChanged.bind(this),this.addEventListener(S.AGGREGATE_SELECTION_CHANGED_EVENT,this._onAggregatedSelectionChanged)},te.prototype.tearDown=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.clearSelection(),this.removeEventListener(S.AGGREGATE_SELECTION_CHANGED_EVENT,this._onAggregatedSelectionChanged),this.loadedExtensions){for(var t in this.loadedExtensions)try{this.unloadExtension(t)}catch(e){o.logger.error("Failed to unload extension: "+t,e,(0,d.errorCodeString)(d.ErrorCodes.VIEWER_INTERNAL_ERROR)),o.logger.track({category:"error_unload_extension",extensionId:t,error_message:e.message,call_stack:e.stack})}this.loadedExtensions=null}for(this.toolController&&(this.toolController.enableMouseButtons(!1),this.toolController.deactivateTool("gestures")),o.logger.reportRuntimeStats(!0),this._loadingSpinner.show(),this.liveReviewClient&&(this.liveReviewClient.destroy(),this.liveReviewClient=null);this.trackADPTimer.length>0;)clearTimeout(this.trackADPTimer.pop());e&&this.impl.unloadCurrentModel(),this.impl.setCutPlaneSet("__set_view",void 0)},te.prototype._onAggregatedSelectionChanged=function(){if(this.navigation.getSelectionSetsPivot()){const e=this.impl.selector.getAggregateSelection();if(e.length){const t=this.impl.get3DBounds(e);this.utilities.setPivotPoint(t.getCenter(new n.Vector3),!0,!0),this.utilities.pivotActive(this.navigation.getPivotSetFlag(),!0)}}},te.prototype.run=function(){this.running||(this.resize(),this.running=!0,this.impl.run())},te.prototype.localize=function(){A.Z.localize()},te.prototype.__initAutoCam=function(e){var t=this,i=e.camera;i.pivot||(i.pivot=new n.Vector3(0,0,0)),i.target||(i.target=new n.Vector3(0,0,0)),i.worldup||(i.worldup=i.up.clone()),t.autocamCamera=i.clone(),t.autocamCamera.target=i.target.clone(),t.autocamCamera.pivot=i.pivot.clone(),t.autocamCamera.worldup=i.worldup.clone(),t.autocam=new P.Autocam(t.autocamCamera,t.navigation,t.canvas),t.autocam.setGlobalManager(this.globalManager),t.autocam.registerCallbackCameraChanged((function(e){t.autocamCamera.isPerspective!==i.isPerspective&&(t.autocamCamera.isPerspective?t.navigation.toPerspective():t.navigation.toOrthographic()),t.navigation.setVerticalFov(t.autocamCamera.fov,!1),t.navigation.setView(t.autocamCamera.position,t.autocamCamera.target),t.navigation.setPivotPoint(t.autocamCamera.pivot),t.navigation.setCameraUpVector(t.autocamCamera.up),e&&t.navigation.setWorldUpVector(t.autocamCamera.worldup),t.impl.syncCamera(e)})),t.autocam.registerCallbackPivotDisplay((function(e){t.utilities?t.utilities.pivotActive(e,!1):t.impl.controls.pivotActive(e,!1)})),t.autocam.registerCallbackTransitionCompleted((function(){t.fireEvent({type:S.CAMERA_TRANSITION_COMPLETED})})),t.addEventListener("cameraChanged",(function(e){var i=e.camera;t.autocam.sync(i)})),t.autocam.sync(i)},te.prototype.uninitialize=function(){var e;this.removeWindowEventListener("resize",this.onResizeCallback,!1),this.onResizeCallback=null,this.removeWindowEventListener("scroll",this.onScrollCallback),this.onScrollCallback=null,this.canvas?this.canvas.removeEventListener("mousedown",this.onMouseDown):this.container&&this.container.removeEventListener("mousedown",this.onMouseDown),this.onMouseDown=null,this.canvas?this.canvas.removeEventListener("mouseup",this.onMouseUp):this.container&&this.container.removeEventListener("mouseup",this.onMouseUp),this.onMouseUp=null,this.canvas.parentNode.removeChild(this.canvas),this.canvas.viewer=null,D.InitParametersSetting.canvas===this.canvas&&(D.InitParametersSetting.canvas=null),this.canvas=null,this.canvasWrap=null,this.viewerState=null,o.logger.reportRuntimeStats(),o.logger.track({category:"viewer_destroy"},!0),this.toolController&&(this.toolController.uninitialize(),this.toolController=null,this.clickHandler=null,this.utilities=null),this.navigation&&(this.navigation.uninitialize(),this.navigation=null),this.impl&&(this.impl.dtor(),this.impl=null),this.overlays&&(this.overlays.dtor(),this.overlays=null),this.loadSpinner=null,this._loadingSpinner.destroy(),this._loadingSpinner=null,this.prefs&&this.prefs.clearListeners(),this.prefs=null,this.profile=null,this.profileManager=null,this.autocam.dtor(),this.autocam=null,this.autocamCamera=null,this._hotkeyManager.popHotkeys("Autodesk.FitToView"),this._hotkeyManager.popHotkeys("Autodesk.Home"),this._hotkeyManager.popHotkeys("Autodesk.Escape"),this._hotkeyManager.popHotkeys("Autodesk.Pan"),this._hotkeyManager.popHotkeys("Autodesk.Orbit"),this._hotkeyManager=null,te.ViewerCount--,0===te.ViewerCount&&(0,M.clearPropertyWorkerCache)(),this.onDefaultContextMenu&&(this.container.removeEventListener("contextmenu",this.onDefaultContextMenu,!1),this.onDefaultContextMenu=null),this.screenModeDelegate&&(this.screenModeDelegate.uninitialize(),this.screenModeDelegate=null),this._displayEdges&&(this.removeEventListener(S.GEOMETRY_LOADED_EVENT,this._displayEdges),this._displayEdges=null),this._setDoubleSided&&(this.removeEventListener(S.MODEL_ADDED_EVENT,this._setDoubleSided),this._setDoubleSided=null),this.extensionCache=null,this.clientContainer=null,this.config=null,this.contextMenu=null,this.contextMenuCallbacks=null,this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this._forgeLogo=null,this.dispatchEvent(S.VIEWER_UNINITIALIZED),this.listeners={};const t=J.getGlobal();t.NOP_VIEWER===this&&(t.NOP_VIEWER=null);const i=null===(e=t.NOP_VIEWERS)||void 0===e?void 0:e.indexOf(this);-1!==i&&(t.NOP_VIEWERS.splice(i,1),0===t.NOP_VIEWERS.length&&(t.NOP_VIEWERS=null)),o.logger.log("viewer destroy")},te.prototype.finish=function(){this.tearDown(),this.uninitialize()},te.prototype.setLoadHeuristics=function(e){var t=e.bubbleNode;if(t){var i=t.findViewableParent();if(i){var n=i.name();e.fileExt=n.slice(n.length-3).toLowerCase();void 0===e.isAEC&&-1!==["rvt","nwd","nwc","ifc"].indexOf(e.fileExt)&&(e.isAEC=!0)}}if(e.isAEC){if(void 0===e.useConsolidation){let t=(0,u.getParameterByName)("useConsolidation")||"";e.useConsolidation="true"===t||"false"!==t&&void 0}void 0===e.useConsolidation&&(e.useConsolidation=!(0,r.isMobileDevice)()&&!(0,r.isNodeJS)()),void 0===e.createWireframe&&(e.createWireframe=!(0,r.isMobileDevice)()),void 0===e.disablePrecomputedNodeBoxes&&(e.disablePrecomputedNodeBoxes=!0)}else void 0===e.createWireframe&&(e.createWireframe=!(0,r.isMobileDevice)()&&this.prefs.get("edgeRendering"));e.useConsolidation&&!e.bvhOptions&&(e.bvhOptions={},I.Consolidation.applyBVHDefaults(e.bvhOptions))},te.prototype.trackADPSettingsOptions=function(){var e=this;this.trackADPTimer.push(setTimeout((function(){if(e.prefs){var t={category:"settingOptionsStatus",switchSheetColorWhiteToBlack:e.prefs.get("swapBlackAndWhite"),leftHandedMouseSetup:e.prefs.get("leftHandedMouseSetup"),openPropertiesOnSelect:e.prefs.get("openPropertiesOnSelect"),orbitPastWorldPoles:e.prefs.get("orbitPastWorldPoles"),reverseMouseZoomDirection:e.prefs.get("reverseMouseZoomDir"),fusionStyleOrbit:e.prefs.get("fusionOrbit"),setPivotWithLeftMouseButton:e.prefs.get("clickToSetCOI"),zoomTowardPivot:e.prefs.get("zoomTowardsPivot"),viewCubeActsOnPivot:e.prefs.get("alwaysUsePivot"),showViewCube:e.prefs.get("viewCube"),environmentImageVisible:e.prefs.get("envMapBackground"),displayEdges:e.prefs.get("edgeRendering"),displayPoints:e.prefs.get("pointRendering"),displayLines:e.prefs.get("lineRendering"),ghostHiddenObjects:e.prefs.get("ghosting"),groundReflection:e.prefs.get("groundReflection"),groundShadow:e.prefs.get("groundShadow"),ambientShadows:e.prefs.get("ambientShadows"),antiAliasing:e.prefs.get("antialiasing"),progressiveModelDisplay:e.prefs.get("progressiveRendering"),smoothNavigation:e.prefs.get("optimizeNavigation")};o.logger.track(t)}}),3e4))},te.prototype.trackADPExtensionsLoaded=function(){var e=this,t={category:"loaded_extensions"};this.trackADPTimer.push(setTimeout((function(){if(e.loadedExtensions)for(var i in e.loadedExtensions)t[i]=i;o.logger.track(t)}),3e4))},te.prototype.activateDefaultNavigationTools=function(e){if(!(0,r.isNodeJS)()){var t=e?"pan":"orbit";this.setDefaultNavigationTool(t),this.setActiveNavigationTool(t),this.toolController&&(this.toolController.enableMouseButtons(!0),this.toolController.activateTool("gestures"))}},te.prototype.registerDimensionSpecificHotkeys=function(e){if(this._hotkeyManager)if(e)this._hotkeyManager.popHotkeys("Autodesk.Orbit");else{var t,i=this,n=[{keycodes:[R.KeyCode.ALT],onPress:function(){return t=i.getActiveNavigationTool(),i.setActiveNavigationTool("orbit")},onRelease:function(){return i.setActiveNavigationTool(t)}}];this._hotkeyManager.pushHotkeys("Autodesk.Orbit",n,{tryUntilSuccess:!0})}},te.prototype.onModelAdded=function(e,t){var i,n;e.is2d()&&!e.isLeaflet()&&this.navigation.setMinimumLineWidth(null===(i=e.loader)||void 0===i||null===(n=i.svf)||void 0===n?void 0:n.minLineWidth);1===this.impl.modelQueue().getModels().length&&this.initializeFirstModelPresets(e,t)},te.prototype.initializeFirstModelPresets=function(e,t,i){if(e.is2d()&&this.activateLayerState("Initial"),i||e.getData().loadOptions.preserveView||(this.setActiveNavigationTool(),this.impl.setViewFromFile(e,!0),this.toolController.recordHomeView()),this.registerDimensionSpecificHotkeys(e.is2d()),t||this.activateDefaultNavigationTools(e.is2d()),this.navigation.setIs2D(this.impl.modelQueue().areAll2D()),e.isLeaflet()){var n=e.getData();this.navigation.setConstraints2D(n.bbox,n.maxPixelPerUnit)}else this.navigation.setConstraints2D()},te.prototype.loadModel=async function(e,t,i,n,s){var h,p=this,f=p.impl._reserveLoadingFile();if(void 0===(t=t||{}).skipPropertyDb){var m=(0,u.getParameterByName)("skipPropertyDb")||"";t.skipPropertyDb="true"===m||"false"!==m&&void 0}function g(e,t,i){p._loadingSpinner.hide(),n&&n(e,t,i)}var v,y=e.toLowerCase().match(/\.([a-z0-9]+)(\?|$)/),b=y?y[1]:null,x=this.config&&this.config.loaderExtensions&&this.config.loaderExtensions[b]||b in G&&G[b];if(x&&!this.isExtensionLoaded(x))try{await this.loadExtension(x,this.config)}catch(e){return p.impl._removeLoadingFile(f),n&&n(d.ErrorCodes.VIEWER_INTERNAL_ERROR,e.toString()),!1}if(!(v=t&&t.fileLoader?t.fileLoader:w.FileLoaderManager.getFileLoaderForExtension(b)))return p.impl._removeLoadingFile(f),o.logger.error("File extension not supported:"+b,(0,d.errorCodeString)(d.ErrorCodes.UNSUPORTED_FILE_EXTENSION)),g(d.ErrorCodes.UNSUPORTED_FILE_EXTENSION,"File extension not supported",0),!1;this.setLoadHeuristics(t),this.impl.hasModels()||this._loadingSpinner.show(),"function"==typeof v.getExistingInstance&&(h=v.getExistingInstance(e,t,this.config)),h||(h=new v(this.impl,this.config)),p.impl._addLoadingFile(f,h);var _=h.loadFile(e,t,(function(e,n){if(p.impl){if(p.impl._removeLoadingFile(h),e)return p.dispatchEvent({type:S.LOADER_LOAD_ERROR_EVENT,error:e,loader:h}),void g(e.code,e.msg,e.args);n.getData().underlayRaster=t.underlayRaster&&n.getLeaflet(),t.loadAsHidden?p.impl.modelQueue().addHiddenModel(n):p.impl.addModel(n),n.loader&&n.loader.notifiesFirstPixel&&p._loadingSpinner instanceof U?p.addEventListener(S.RENDER_FIRST_PIXEL,(function(){p._loadingSpinner.hide()}),{once:!0}):p._loadingSpinner.hide(),!(0,r.isNodeJS)()&&p._forgeLogo&&(p._forgeLogo.style.display="block"),i&&i(n)}}),s);if(_||p.impl._removeLoadingFile(h),this.fireEvent({type:S.LOADER_LOAD_FILE_EVENT,loader:h}),t.skipPrefs)void 0===this.prefs.get(a.Prefs.DISPLAY_UNITS)&&this.prefs.set(a.Prefs.DISPLAY_UNITS,new l.EnumType(c.displayUnitsEnum)),void 0===this.prefs.get(a.Prefs.DISPLAY_UNITS_PRECISION)&&this.prefs.set(a.Prefs.DISPLAY_UNITS_PRECISION,new l.EnumType(c.displayUnitsPrecisionEnum));else if(!(0,r.isNodeJS)()&&!this.profile){let e=this.chooseProfile(t);this.setProfile(e,!1)}const E=function(e,t,i,n){const r={url:e,lmvFileExtension:t,returnValue:i};if(n){r.isOtg=n.isOtg()&&Y.endpoint.isOtgBackend(),r.isSVF2=n.isSVF2()&&Y.endpoint.isSVF2Backend(),r.geometrySize=n.data.size||0,r.viewable_type=n.is2D()?"2d":"3d";const e=n.findViewableParent();try{const t=e&&e.name(),i=t&&t.lastIndexOf("."),n=i>=0&&t.substring(i+1);n&&(r.seedFileExt=n.toLowerCase())}catch(e){}}return r}(e,b,_,t.bubbleNode);return q.analytics.track("viewer.model.load",E),_},te.prototype.isLoadDone=function(){let{geometry:e=!0,propDb:t=!0,textures:i=!0,hidden:n=!1,onlyModels:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!r){if(!this.started)return!0;if(this.impl._hasLoadingFile())return!1}if(i&&Autodesk.Viewing.Private.TextureLoader.requestsInProgress()>0)return!1;e=e||i;const o=i=>!i||(e?i.isLoadDone():i.modelRootLoaded)&&(!t||!i.getPropertyDb()||i.getPropertyDb().isLoadDone());if(r)return Array.isArray(r)?r.every(o):o(r);const s=this.impl.modelQueue();return s.getModels().every(o)&&(!n||s.getHiddenModels().every(o))},te.prototype.waitForLoadDone=function(e){return new Promise(((t,i)=>{var{geometry:n=!0,propDb:r=!0,textures:o=!0,hidden:s=!1,onlyModels:a}=e||{};const l={geometry:n=n||o,propDb:r,textures:o,hidden:s,onlyModels:a},c=()=>this.started&&(this.impl._hasLoadingFile()||this.impl.modelQueue().getModels().length>0||this.impl.modelQueue().getHiddenModels().length>0);var h,u=!a&&c();if(u&&this.isLoadDone(l))return void t();const d=()=>{(u=u||c())&&this.isLoadDone(l)&&(h(),t())},p=e=>{h();const t=new Error("Error loading model");t.loader=e.loader,t.error=e.error,i(t)};h=()=>{n&&this.removeEventListener(S.GEOMETRY_LOADED_EVENT,d),r&&(this.removeEventListener(S.OBJECT_TREE_CREATED_EVENT,d),this.removeEventListener(S.OBJECT_TREE_UNAVAILABLE_EVENT,d)),o&&this.removeEventListener(S.TEXTURES_LOADED_EVENT,d),this.removeEventListener(S.LOADER_LOAD_FILE_EVENT,d),this.removeEventListener(S.MODEL_ADDED_EVENT,d),this.removeEventListener(S.MODEL_REMOVED_EVENT,d),this.removeEventListener(S.LOADER_LOAD_ERROR_EVENT,p),this.removeEventListener(S.MODEL_ROOT_LOADED_EVENT,d),this.removeEventListener(S.VIEWER_UNINITIALIZED,t)},n&&this.addEventListener(S.GEOMETRY_LOADED_EVENT,d),r&&(this.addEventListener(S.OBJECT_TREE_CREATED_EVENT,d),this.addEventListener(S.OBJECT_TREE_UNAVAILABLE_EVENT,d)),o&&this.addEventListener(S.TEXTURES_LOADED_EVENT,d),this.addEventListener(S.LOADER_LOAD_FILE_EVENT,d),this.addEventListener(S.MODEL_ADDED_EVENT,d),this.addEventListener(S.MODEL_REMOVED_EVENT,d),this.addEventListener(S.LOADER_LOAD_ERROR_EVENT,p),this.addEventListener(S.MODEL_ROOT_LOADED_EVENT,d,{priority:-1e6}),this.addEventListener(S.VIEWER_UNINITIALIZED,(()=>i(new Error("Promise reject because viewer finished"))))}))},te.prototype.unloadModel=function(e){e||(e=this.model),this.impl.unloadModel(e)},te.prototype.loadDocumentNode=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var n=t,r=i.leafletOptions||{},o=e.getViewableUrn(n,r),s=n.findPropertyDbPath();o=e.getFullPath(o);var a={sharedPropertyDbPath:s=e.getFullPath(s),acmSessionId:e.getAcmSessionId(o),bubbleNode:n,applyRefPoint:!1,loadOptions:r,page:r.page||1};for(var l in a)Object.prototype.hasOwnProperty.call(i,l)||(i[l]=a[l]);if(!i.keepCurrentModels&&this.impl.hasModels()){let e=this.config;this.tearDown(),this.setUp(e)}var c=n.findParentGeom2Dor3D(),h=c.extensions();Array.isArray(h)&&h.forEach((e=>{this.loadExtension(e,this.config)}));var u=r.isPdf?this.loadExtension("Autodesk.PDF",this.config):Promise.resolve(),d=!i.disableUnderlayRaster&&r.tempRasterPath,p=d?this._loadTempRasterModel(e,i,n):Promise.resolve();return u.then((()=>p)).then((e=>new Promise(((t,r)=>{d&&e&&e!==this.getUnderlayRaster(n)?r("load canceled"):this.loadModel(o,i,(e=>{i.loadAsHidden||i.preserveView||"view"!==n.type()||this.setView(n,{skipTransition:!0}),t(e)}),(e=>{r(e)}))}))))},te.prototype.unloadDocumentNode=function(e){let t=this.impl.findModel(e,!0);if(t)return this.impl.unloadModel(t),!0;if(!this.impl.loaders)return!1;for(let t=0;t<this.impl.loaders.length;t++){let i=this.impl.loaders[t];if((i.options&&i.options.bubbleNode)===e)return i.dtor(),this.impl.loaders.splice(t,1),!0}return!1},te.prototype._loadTempRasterModel=function(e,t,i){return new Promise(((n,r)=>{if(t.loadAsHidden)return n();t.underlayRaster=!0,t.loadOptions.fitPaperSize=!0;const o=e=>{var t,n;const r=e.getDocumentNode();return r&&(null===(t=r.getDocument())||void 0===t?void 0:t.getPath())===(null===(n=i.getDocument())||void 0===n?void 0:n.getPath())&&r.guid()===i.guid()&&!e.isLeaflet()},s=e=>{let{model:t}=e;o(t)&&(2===this.getVisibleModels().length&&this.initializeFirstModelPresets(t,!1,!0),this.removeEventListener(S.MODEL_ADDED_EVENT,s))};this.addEventListener(S.MODEL_ADDED_EVENT,s);const a=e=>{let{model:t}=e;o(t)&&(t.changePaperVisibility(!0),this.removeEventListener(S.MODEL_REMOVED_EVENT,a),this.removeEventListener(S.MODEL_ADDED_EVENT,s),this.removeEventListener(S.GEOMETRY_LOADED_EVENT,c))};let l;this.addEventListener(S.MODEL_REMOVED_EVENT,a);const c=e=>{let{model:t}=e;o(t)&&(t.changePaperVisibility(!0),this.removeEventListener(S.MODEL_REMOVED_EVENT,a),l&&(this.unloadModel(l),l=null),this.removeEventListener(S.GEOMETRY_LOADED_EVENT,c))};this.addEventListener(S.GEOMETRY_LOADED_EVENT,c);const h=e.getFullPath(t.loadOptions.tempRasterPath);this.loadModel(h,t,(e=>{t.loadOptions.fitPaperSize=void 0,t.underlayRaster=void 0,t.hideBackground=!0,l=e,n(e)}),(e=>{if(t.loadOptions.fitPaperSize=void 0,t.underlayRaster=void 0,e===d.ErrorCodes.LOAD_CANCELED)return r("load canceled");n()}))}))},te.prototype.getDimensions=function(){if(this.container){var e={};return this.getScreenMode()===m.ScreenMode.kFullScreen?(e.width=screen.width,e.height=screen.height):e=this.container.getBoundingClientRect(),{width:e.width,height:e.height}}return null},te.prototype.resize=function(){this.container.clientWidth>0&&this.container.clientHeight>0&&this.impl.resize(this.container.clientWidth,this.container.clientHeight)},te.prototype.getHotkeyManager=function(){return this._hotkeyManager},te.prototype.getCamera=function(){return this.impl.camera},te.prototype.getState=function(e){return this.viewerState.getState(e)},te.prototype.restoreState=function(e,t,i){var n=this.viewerState.restoreState(e,t,i);return n&&this.dispatchEvent({type:S.VIEWER_STATE_RESTORED_EVENT,value:n}),n},te.prototype.getViewpointCamData=function(e){const t=e.position,i=e.target,n=e.up,r=e.isPerspective?0:1;return[t.x,t.y,t.z,i.x,i.y,i.z,n.x,n.y,n.z,e.aspect,e.fov*(Math.PI/180),e.orthoScale,r]},te.prototype.setView=function(e,t){if(!(e&&e instanceof L.BubbleNode))return!1;const i=e.findParentGeom2Dor3D();let r=i&&this.impl.findModel(i,!0)||this.model;if(!r)return!1;let o,s,a=!!t&&t.skipTransition,l=!t||t.useExactCamera;if(e.getViewBox())return this.setViewFromViewBox(e.getViewBox(),e.name(),a),this.dispatchEvent({type:S.SET_VIEW_EVENT,view:e}),!0;let c,h,u,d=e.data.camera;if(e.data.isViewpoint){s=this.model.loader.svf.viewpoints[e.data.entry];const t=s.camera;d=this.getViewpointCamData(t);const i=this.model.loader.svf.overrideSets[s.overrideSet];if(i){const{defaultMaterialIndex:e,materialOverrides:t,flagOverrides:n,defaultFlags:r}=i,o=this.model.getFragmentList(),s=o.fragments.length;if(o.materialIdMapOriginal||o.storeOriginalMaterials(),e){const t=this.impl.matman()._getMaterialHash(this.model,e),i=this.impl.matman()._materials[t];if(i)for(let e=0;e<s;e++)this.model.getFragmentList().setMaterial(e,i)}if(t){e||this.model.getFragmentList().restoreOriginalMaterials();for(let e=0;e<t.length;e++){const i=t[e].dbId,n=t[e].materialIndex;if(!Number.isFinite(i)||!Number.isFinite(n))continue;const r=this.impl.matman()._getMaterialHash(this.model,n),o=this.impl.matman()._materials[r];o&&this.model.getInstanceTree().enumNodeFragments(i,(e=>{this.model.getFragmentList().setMaterial(e,o)}),!0)}}if(r&&(1===r?this.hideAll():2===r&&this.showAll()),n)if(0===n.length)this.showAll();else for(let e=0;e<n.length;e++){const{flags:t,dbId:i}=n[e];Number.isFinite(t)&&Number.isFinite(i)&&(1===t?this.hide(i,this.model):2===t&&this.show(i,this.model))}}}if(o=this.getCameraFromViewArray(d,r),!o)return!1;this.impl.setViewFromCamera(o,a,l);const p=s??e.data;c=p.sectionPlane,h=p.sectionBox,u=p.sectionBoxTransform;const f=r.getModelToViewerTransform();if(c){let e=[];for(let t=0;t<c.length;t+=4){const i=new n.Plane(new n.Vector3(c[t+0],c[t+1],c[t+2]),c[t+3]);f&&i.applyMatrix4(f),e.push(new n.Vector4(i.normal.x,i.normal.y,i.normal.z,i.constant))}this.impl.setCutPlaneSet("__set_view",e)}else if(h&&u){let t;if(e.data.isViewpoint){const e=new n.Box3,i=new n.Matrix4;i.makeRotationFromQuaternion(u),e.set(h.min,h.max),e.applyMatrix4(i),t=B.SceneMath.box2CutPlanes(e,f)}else{const e=(new n.Matrix4).fromArray([u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15]]);let i=new n.Vector3(h[0],h[1],h[2]),r=new n.Vector3(h[3],h[4],h[5]),o=new n.Box3(i,r);const s=new n.Matrix4;s.copy(f),s.multiply(e),t=B.SceneMath.box2CutPlanes(o,s)}this.impl.setCutPlaneSet("__set_view",t)}else this.impl.setCutPlaneSet("__set_view",void 0);return this.dispatchEvent({type:S.SET_VIEW_EVENT,view:e}),!0},te.prototype.setViewType=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setViewType is not applicable to 2D"):this.prefs.set(a.Prefs3D.VIEW_TYPE,e)},te.prototype.setViewFromArray=function(e){var t=this.getCameraFromViewArray(e);this.impl.setViewFromCamera(t,!1,!0)},te.prototype.getCameraFromViewArray=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.model;const i=null==t?void 0:t.getModelToViewerTransform();return L.BubbleNode.readCameraFromArray(e,i)},te.prototype.getViewArrayFromCamera=function(){var e=this.model?this.model.getData().globalOffset:{x:0,y:0,z:0};return this.impl.getViewArrayFromCamera(e)},te.prototype.setViewFromViewBox=function(e,t,i){var n=this.model;if(!n||n.is2d()){if(t&&t.length){var r,s=n.getData().metadata.views||[];for(r=0;r<s.length&&s[r].name!=t;r++);if(r<s.length){var a=s[r].layer_state;a&&this.activateLayerState(a)}}this.impl.setViewFromViewBox(this.model,e,t,i)}else o.logger.warn("Viewer3D.setViewFromViewBox is not applicable to 3D")},te.prototype.activateLayerState=function(e){this.impl.layers.activateLayerState(e),this.dispatchEvent({type:S.LAYER_VISIBILITY_CHANGED_EVENT})},te.prototype.getLayerStates=function(){return this.impl.layers.getLayerStates()},te.prototype.setViewFromFile=function(e){this.setActiveNavigationTool(),this.impl.setViewFromFile(e||this.model)},te.prototype.getProperties=function(e,t,i){this.model?this.model.getProperties(e,t,i):i&&i(d.ErrorCodes.BAD_DATA,"Properties failed to load since model does not exist")},te.prototype.getObjectTree=function(e,t){this.model?this.model.getObjectTree(e,t):t&&t(d.ErrorCodes.BAD_DATA,"ObjectTree failed to load since model does not exist")},te.prototype.setCanvasClickBehavior=function(e){if(Object.prototype.hasOwnProperty.call(this.impl.controls,"setClickBehavior")&&this.impl.controls.setClickBehavior(e),this.clickHandler&&this.clickHandler.setClickBehavior(e),e&&e.disableMouseWheel&&this.toolController.setMouseWheelInputEnabled(!1),e&&e.disableTwoFingerSwipe){var t=this.toolController.getTool("gestures");t&&t.disableTwoFingerSwipe()}},te.prototype.search=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{searchHidden:!1};this.searchText=e,this.model?this.model.search(e,t,i,n,r):i&&i(d.ErrorCodes.BAD_DATA,"Search failed since model does not exist")},te.prototype.getHiddenNodes=function(e){return e=e||this.model,this.impl.visibilityManager.getHiddenNodes(e)},te.prototype.getIsolatedNodes=function(e){return(e=e||this.model)&&e.is2d()?(o.logger.warn("Viewer3D.getIsolatedNodes is not yet implemented for 2D"),[]):this.impl.visibilityManager.getIsolatedNodes(e)},te.prototype.isolate=function(e,t){(t=t||this.model)&&this.impl.visibilityManager.isolate(e,t)},te.prototype.setBackgroundColor=function(e,t,i,n,r,o){this.impl.setClearColors(e,t,i,n,r,o)},te.prototype.setBackgroundOpacity=function(e){this.impl.setClearAlpha(e)},te.prototype.toggleSelect=function(e,t,i){(t=t||this.model)&&t.is2d()?o.logger.warn("Viewer3D.toggleSelect is not yet implemented for 2D"):this.impl.selector.toggleSelection(e,t,i)},te.prototype.select=function(e,t,i){"number"==typeof e&&(e=[e]),t=t||this.model,this.impl.selector.setSelection(e,t,i)},te.prototype.clearSelection=function(){this.impl.selector.clearSelection()},te.prototype.getSelectionVisibility=function(){return this.impl.selector.getSelectionVisibility()},te.prototype.getSelectionCount=function(){return this.impl.selector.getSelectionLength()},te.prototype.setSelectionMode=function(e){this.prefs.set(a.Prefs3D.SELECTION_MODE,e)},te.prototype.getSelection=function(){return this.impl.selector.getSelection()},te.prototype.lockSelection=function(e,t,i){i=i||this.model,this.impl.selector.lockSelection(e,t,i)},te.prototype.unlockSelection=function(e,t){this.impl.selector.unlockSelection(e,t)},te.prototype.isSelectionLocked=function(e,t){return this.impl.selector.isNodeSelectionLocked(e,t)},te.prototype.getAggregateSelection=function(e){var t=this.impl.selector.getAggregateSelection();if(e)for(var i=0;i<t.length;i++)for(var n=0;n<t[i].selection.length;n++)e(t[i].model,t[i].selection[n]);return t},te.prototype.setAggregateSelection=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.impl.selector.setAggregateSelection(e,t)},te.prototype.getAggregateIsolation=function(){return this.impl.visibilityManager.getAggregateIsolatedNodes()},te.prototype.getAggregateHiddenNodes=function(){return this.impl.visibilityManager.getAggregateHiddenNodes()},te.prototype.hide=function(e,t){t=t||this.model,this.impl.visibilityManager.hide(e,t)},te.prototype.show=function(e,t){t=t||this.model,this.impl.visibilityManager.show(e,t)},te.prototype.showAll=function(){this.impl.visibilityManager.aggregateIsolate([]),this.impl.layers.showAllLayers(),this.fireEvent({type:S.SHOW_ALL_EVENT})},te.prototype.hideAll=function(){this.getVisibleModels().forEach((e=>{this.hide(e.getRootId(),e)})),this.fireEvent({type:S.HIDE_ALL_EVENT})},te.prototype.toggleVisibility=function(e,t){this.impl.visibilityManager.toggleVisibility(e,t)},te.prototype.areAllVisible=function(){return this.impl.isWholeModelVisible(this.model)},te.prototype.isNodeVisible=function(e,t){return t=t||this.model,this.impl.isNodeVisible(e,t)},te.prototype.lockVisible=function(e,t,i){i=i||this.model,this.impl.visibilityManager.lockNodeVisible(e,t,i)},te.prototype.toggleLockVisible=function(e,t){this.impl.visibilityManager.toggleVisibleLocked(e,t)},te.prototype.isVisibleLocked=function(e,t){return this.impl.visibilityManager.isNodeVisibleLocked(e,t)},te.prototype.explode=function(e){this.model&&(this.model.is2d()?o.logger.warn("Viewer3D.explode is not applicable to 2D"):this.impl.explode(e)&&o.logger.track({name:"explode_count",aggregate:"count"}))},te.prototype.getExplodeScale=function(){return this.model&&this.model.is2d()?(o.logger.warn("Viewer3D.getExplodeScale is not applicable to 2D"),0):this.impl.getExplodeScale()},te.prototype.lockExplode=function(e,t,i){return(i=i||this.model)&&i.is2d()?(o.logger.warn("Viewer3D.lockExplode is not applicable to 2D"),0):this.impl.lockExplode(e,t,i)},te.prototype.isExplodeLocked=function(e,t){return(t=t||this.model)&&t.is2d()?(o.logger.warn("Viewer3D.isExplodeLocked is not applicable to 2D"),0):this.impl.isExplodeLocked(e,t)},te.prototype.toggleLockExplode=function(e,t){return(t=t||this.model)&&t.is2d()?(o.logger.warn("Viewer3D.toggleLockExplode is not applicable to 2D"),0):this.impl.lockExplode(e,!this.isExplodeLocked(e,t),t)},te.prototype.setQualityLevel=function(e,t){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setQualityLevel is not applicable to 2D"):(this.prefs.set(a.Prefs3D.AMBIENT_SHADOWS,e),this.prefs.set(a.Prefs3D.ANTIALIASING,t))},te.prototype.setGhosting=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setGhosting is not applicable to 2D"):this.prefs.set(a.Prefs3D.GHOSTING,e)},te.prototype.setGroundShadow=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setGroundShadow is not applicable to 2D"):this.prefs.set(a.Prefs3D.GROUND_SHADOW,e)},te.prototype.setGroundReflection=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setGroundReflection is not applicable to 2D"):this.prefs.set(a.Prefs3D.GROUND_REFLECTION,e)},te.prototype.setEnvMapBackground=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setEnvMapBackground is not applicable to 2D"):this.prefs.set(a.Prefs3D.ENV_MAP_BACKGROUND,e)},te.prototype.setFirstPersonToolPopup=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setFirstPersonToolPopup is not applicable to 2D"):this.prefs.set(a.Prefs3D.FIRST_PERSON_TOOL_POPUP,e)},te.prototype.getFirstPersonToolPopup=function(){if(!this.model||!this.model.is2d())return this.prefs.get("firstPersonToolPopup");o.logger.warn("Viewer3D.getFirstPersonToolPopup is not applicable to 2D")},te.prototype.setBimWalkToolPopup=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setBimWalkToolPopup is not applicable to 2D"):this.prefs.set(a.Prefs3D.BIM_WALK_TOOL_POPUP,e)},te.prototype.getBimWalkToolPopup=function(){if(!this.model||!this.model.is2d())return this.prefs.get("bimWalkToolPopup");o.logger.warn("Viewer3D.getBimWalkToolPopup is not applicable to 2D")},te.prototype.setProgressiveRendering=function(e){this.prefs.set(a.Prefs.PROGRESSIVE_RENDERING,e)},te.prototype.setGrayscale=function(e){this.model&&this.model.is3d()?o.logger.warn("Viewer3D.setGrayscale is not applicable to 3D"):this.prefs.set(a.Prefs2D.GRAYSCALE,e)},te.prototype.setSwapBlackAndWhite=function(e){this.model&&this.model.is3d()?o.logger.warn("Viewer3D.setSwapBlackAndWhite is not applicable to 3D"):this.prefs.set(a.Prefs2D.SWAP_BLACK_AND_WHITE,e)},te.prototype.setOptimizeNavigation=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setOptimizeNaviation is not applicable to 2D"):this.prefs.set(a.Prefs3D.OPTIMIZE_NAVIGATION,e)},te.prototype.initializePrefListeners=function(){var e=this;this.prefs.addListeners(a.Prefs.KEY_MAP_CMD,(e=>{this.impl.toggleCmdMapping(e,this.toolController)})),this.prefs.addListeners(a.Prefs3D.ANTIALIASING,(e=>{const t=this.prefs.get(a.Prefs3D.AMBIENT_SHADOWS);this.impl.togglePostProcess(t,e)})),this.prefs.addListeners(a.Prefs3D.AMBIENT_SHADOWS,(e=>{const t=this.prefs.get(a.Prefs3D.ANTIALIASING);this.impl.togglePostProcess(e,t)})),this.prefs.addListeners(a.Prefs3D.GROUND_SHADOW,(e=>{this.impl.toggleGroundShadow(e)})),this.prefs.addListeners(a.Prefs3D.GROUND_REFLECTION,(e=>{this.impl.toggleGroundReflection(e)})),this.prefs.addListeners(a.Prefs3D.ENV_MAP_BACKGROUND,(e=>{this.impl.toggleEnvMapBackground(e)})),this.prefs.addListeners(a.Prefs.PROGRESSIVE_RENDERING,(e=>{this.impl.toggleProgressive(e)})),this.prefs.addListeners(a.Prefs3D.VIEW_TYPE,(e=>{const t=this.prefs.get(a.Prefs3D.VIEW_TYPE),i=this.impl.getModelCamera(this.model);if(i){const e=i.isPerspective;if(!isNaN(e)){const i=e?a.VIEW_TYPES.PERSPECTIVE:a.VIEW_TYPES.ORTHOGRAPHIC;this.prefs.setDefault(a.Prefs3D.VIEW_TYPE,i),t===a.VIEW_TYPES.DEFAULT&&(this.prefs[a.Prefs3D.VIEW_TYPE]=i)}}this.autocam.setViewType(e)})),this.prefs.addListeners(a.Prefs2D.GRAYSCALE,(e=>{this.impl.toggleGrayscale(e)})),this.prefs.addListeners(a.Prefs2D.SWAP_BLACK_AND_WHITE,(e=>{this.impl.toggleSwapBlackAndWhite(e)})),this.prefs.addListeners(a.Prefs3D.OPTIMIZE_NAVIGATION,(e=>{this.impl.setOptimizeNavigation(e)})),this.prefs.addListeners(a.Prefs3D.GHOSTING,(e=>{this.impl.toggleGhosting(e)})),this.prefs.addListeners(a.Prefs3D.LINE_RENDERING,(e=>{this.impl.hideLines(!e)})),this.prefs.addListeners(a.Prefs.POINT_RENDERING,(e=>{this.impl.hidePoints(!e)})),this.prefs.addListeners(a.Prefs3D.EDGE_RENDERING,(e=>{this._displayEdges=()=>{this.impl.setDisplayEdges(e)},e||this.model&&this.model.isLoadDone()?this._displayEdges():this.addEventListener(S.GEOMETRY_LOADED_EVENT,this._displayEdges)})),this.prefs.addListeners(a.Prefs3D.LIGHT_PRESET,(e=>{let t=!1;if("string"==typeof e){for(var i=e,n=-1,r=0;r<j.LightPresets.length;r++)if(j.LightPresets[r].name===i){n=r;break}-1===n&&(o.logger.warn("Invalid Prefs3D.LIGHT_PRESET: "+e),o.logger.warn("Setting to default light preset."),t=!0),e=n}this.impl.setLightPreset(e,t)})),this.prefs.addListeners(a.Prefs3D.ALWAYS_USE_PIVOT,(e=>{this.navigation.setUsePivotAlways(e)})),this.prefs.addListeners(a.Prefs.REVERSE_MOUSE_ZOOM_DIR,(e=>{this.navigation.setReverseZoomDirection(e)})),this.prefs.addListeners(a.Prefs3D.REVERSE_HORIZONTAL_LOOK_DIRECTION,(e=>{this.navigation.setReverseHorizontalLookDirection(e)})),this.prefs.addListeners(a.Prefs3D.REVERSE_VERTICAL_LOOK_DIRECTION,(e=>{this.navigation.setReverseVerticalLookDirection(e)})),this.prefs.addListeners(a.Prefs3D.ZOOM_TOWARDS_PIVOT,(e=>{this.navigation.setZoomTowardsPivot(e)})),this.prefs.addListeners(a.Prefs3D.SELECTION_SETS_PIVOT,(e=>{this.navigation.setSelectionSetsPivot(e)})),this.prefs.addListeners(a.Prefs3D.ORBIT_PAST_WORLD_POLES,(e=>{this.navigation.setOrbitPastWorldPoles(e)})),this.prefs.addListeners(a.Prefs.LEFT_HANDED_MOUSE_SETUP,(e=>{this.navigation.setUseLeftHandedInput(e),f.EventUtils.setUseLeftHandedInput(e)})),this.prefs.addListeners(a.Prefs.WHEEL_SETS_PIVOT,(e=>{this.navigation.setWheelSetsPivot(e)})),this.prefs.addListeners(a.Prefs3D.SELECTION_MODE,(e=>{this.impl.selector.setSelectionMode(e)})),this.prefs.addListeners(a.Prefs.BACKGROUND_COLOR_PRESET,(e=>{if(e)try{var t=JSON.parse(e);this.impl.setClearColors(t[0],t[1],t[2],t[3],t[4],t[5])}catch(e){o.logger.warn("Invalid Prefs.BACKGROUND_COLOR_PRESET: "+t)}})),this.prefs.addListeners(a.Prefs3D.EXPLODE_STRATEGY,(e=>{X.i.setStrategy(e)&&this.impl.refreshExplode()})),this.prefs.addListeners(a.Prefs2D.LOADING_ANIMATION,(e=>{this.impl.onLoadingAnimationChanged(e)}));const t={};this.prefs.addListeners(a.Prefs3D.FORCE_DOUBLE_SIDED,(i=>{function n(e){return"boolean"==typeof i?i:!!i[e.id]}this._setDoubleSided=function(i){let r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=i.model,s=n(o);const a=o.getData();Object.prototype.hasOwnProperty.call(t,o.id)||(t[o.id]=!!a.doubleSided);const l=s||!!a.doubleSided;l!==t[o.id]&&(e.impl.setDoubleSided(l,o,r),t[o.id]=l)};var r=this.impl.modelQueue().getModels();0===r.length?this.addEventListener(S.MODEL_ADDED_EVENT,this._setDoubleSided):(r.forEach((e=>{this._setDoubleSided({model:e},!1)})),this.impl.sceneUpdated())}))},te.prototype.setNavigationLock=function(e){const t=this.navigation.getIsLocked();return t!==e&&(this.navigation.setIsLocked(e),this.dispatchEvent({type:S.NAVIGATION_MODE_CHANGED_EVENT,id:this.getActiveNavigationTool()})),t},te.prototype.getNavigationLock=function(){return this.navigation.getIsLocked()},te.prototype.setNavigationLockSettings=function(e){this.navigation.setLockSettings(e),this.dispatchEvent({type:S.NAVIGATION_MODE_CHANGED_EVENT,id:this.getActiveNavigationTool()})},te.prototype.getNavigationLockSettings=function(){return this.navigation.getLockSettings()},te.prototype.setActiveNavigationTool=function(e){if(e===this._pushedTool||!e&&!this._pushedTool)return!0;if(this._pushedTool){if(!this.impl.controls.deactivateTool(this._pushedTool))return!1;this.impl.controls.setToolActiveName(this.getDefaultNavigationToolName()),this._pushedTool=null}return(!e||e===this.getDefaultNavigationToolName())&&null===this._pushedTool?(this.dispatchEvent({type:S.NAVIGATION_MODE_CHANGED_EVENT,id:this.getDefaultNavigationToolName()}),!0):!!this.impl.controls.activateTool(e)&&(this._pushedTool=e,this.dispatchEvent({type:S.NAVIGATION_MODE_CHANGED_EVENT,id:this._pushedTool}),!0)},te.prototype.getActiveNavigationTool=function(){return this._pushedTool?this._pushedTool:this._defaultNavigationTool},te.prototype.setDefaultNavigationTool=function(e){this._defaultNavigationTool&&this.impl.controls.deactivateTool(this._defaultNavigationTool);var t=this._pushedTool;this._pushedTool=null,t&&this.impl.controls.deactivateTool(t),this.impl.controls.activateTool(e),this._defaultNavigationTool=e,t&&(this.impl.controls.activateTool(t),this._pushedTool=t)},te.prototype.getDefaultNavigationToolName=function(){return this._defaultNavigationTool},te.prototype.getFOV=function(){return this.navigation.getVerticalFov()},te.prototype.setFOV=function(e){this.navigation.setVerticalFov(e,!0)},te.prototype.getFocalLength=function(){return this.navigation.getFocalLength()},te.prototype.setFocalLength=function(e){this.navigation.setFocalLength(e,!0)},te.prototype.hideLines=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.hideLines is not applicable to 2D"):this.prefs.set(a.Prefs3D.LINE_RENDERING,!e)},te.prototype.hidePoints=function(e){this.prefs.set(a.Prefs.POINT_RENDERING,!e)},te.prototype.setDisplayEdges=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setDisplayEdges is not applicable to 2D"):this.prefs.set(a.Prefs3D.EDGE_RENDERING,e)},te.prototype.applyCamera=function(e,t){this.impl.setViewFromCamera(e,!0),t&&this.fitToView()},te.prototype.fitToView=function(e,t,i){var n=[];e&&(e.length>0&&e[0].model?n=e:e.length>0&&n.push({model:t||this.model,selection:e})),this.impl.fitToView(n,i)},te.prototype.setClickConfig=function(e,t,i){var n=this.clickHandler?this.clickHandler.getClickBehavior():this.impl.controls.getClickBehavior();if(e in n){var r=n[e];if(t in r)return r[t]=i,!0}return!1},te.prototype.getClickConfig=function(e,t){var i=this.clickHandler?this.clickHandler.getClickBehavior():this.impl.controls.getClickBehavior();if(e in i){var n=i[e];if(t in n)return n[t]}return null},te.prototype.setClickToSetCOI=function(e,t){!1!==t&&this.prefs.set(a.Prefs3D.CLICK_TO_SET_COI,e);var i=this.getClickConfig("click","onObject");e?-1===i.indexOf("setCOI")&&this.setClickConfig("click","onObject",["setCOI"]):i.indexOf("setCOI")>=0&&this.setClickConfig("click","onObject",["selectOnly"])},te.prototype.setProfile=function(e,t){if(!e)return!1;this.profile=e,this.profile.apply(this.prefs,t);const i=this.profile.extensions&&this.profile.extensions.unload||[],n=this.profile.extensions&&this.profile.extensions.load||[];i.forEach((e=>{this.isExtensionLoaded(e)&&this.unloadExtension(e)})),n.forEach((e=>{this.isExtensionLoaded(e)||this.loadExtension(e,this.config)})),this.dispatchEvent({type:Autodesk.Viewing.PROFILE_CHANGE_EVENT,profile:e})},te.prototype.initSettings=function(e){if(!this.profile){const t=new s.Profile(e);this.setProfile(t)}},te.prototype.setLightPreset=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setLightPreset is not applicable to 2D"):this.prefs.set(a.Prefs3D.LIGHT_PRESET,e)},te.prototype.setUsePivotAlways=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setUsePivotAlways is not applicable to 2D"):this.prefs.set(a.Prefs3D.ALWAYS_USE_PIVOT,e)},te.prototype.setReverseZoomDirection=function(e){this.prefs.set(a.Prefs.REVERSE_MOUSE_ZOOM_DIR,e)},te.prototype.setReverseHorizontalLookDirection=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setReverseHorizontalLookDirection is not applicable to 2D"):this.prefs.set(a.Prefs3D.REVERSE_HORIZONTAL_LOOK_DIRECTION,e)},te.prototype.setReverseVerticalLookDirection=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setReverseVerticalLookDirection is not applicable to 2D"):this.prefs.set(a.Prefs3D.REVERSE_VERTICAL_LOOK_DIRECTION,e)},te.prototype.setZoomTowardsPivot=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setZoomTowardsPivot is not applicable to 2D"):this.prefs.set(a.Prefs3D.ZOOM_TOWARDS_PIVOT,e)},te.prototype.setOrbitPastWorldPoles=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setOrbitPastWorldPoles is not applicable to 2D"):this.prefs.set(a.Prefs3D.ORBIT_PAST_WORLD_POLES,e)},te.prototype.setUseLeftHandedInput=function(e){this.prefs.set(a.Prefs.LEFT_HANDED_MOUSE_SETUP,e)},te.prototype.setDisplayUnits=function(e){this.prefs.set(a.Prefs.DISPLAY_UNITS,e)},te.prototype.setDisplayUnitsPrecision=function(e){null==e&&(e=""),this.prefs.set(a.Prefs.DISPLAY_UNITS_PRECISION,e)},te.prototype.setLayerVisible=function(e,t,i){var n=this.impl.layers;null===e?t?n.showAllLayers():n.hideAllLayers():(Array.isArray(e)||(e=[e]),i&&n.hideAllLayers(),this.impl.setLayerVisible(e,t)),this.dispatchEvent({type:S.LAYER_VISIBILITY_CHANGED_EVENT})},te.prototype.isLayerVisible=function(e){return!!(e&&e.isLayer&&this.impl.isLayerVisible(e))},te.prototype.anyLayerHidden=function(){for(var e=this.impl.getLayersRoot(),t=e&&e.children,i=t?t.length:0,n=0;n<i;++n)if(!this.impl.layers.isLayerVisible(t[n]))return!0;return!1},te.prototype.allLayersHidden=function(){for(var e=this.impl.getLayersRoot(),t=e&&e.children,i=t?t.length:0,n=0;n<i;++n)if(this.impl.layers.isLayerVisible(t[n]))return!1;return!0},te.prototype.setGroundShadowColor=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setGroundShadowColor is not applicable to 2D"):this.impl.setGroundShadowColor(e)},te.prototype.setGroundShadowAlpha=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setGroundShadowAlpha is not applicable to 2D"):this.impl.setGroundShadowAlpha(e)},te.prototype.setGroundReflectionColor=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setGroundReflectionColor is not applicable to 2D"):this.impl.setGroundReflectionColor(e)},te.prototype.setGroundReflectionAlpha=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.setGroundReflectionAlpha is not applicable to 2D"):this.impl.setGroundReflectionAlpha(e)},te.prototype.getCutPlanes=function(){return this.model&&this.model.is2d()?(o.logger.warn("Viewer3D.getCutPlanes is not applicable to 2D"),[]):this.impl.getCutPlanes()},te.prototype.setCutPlanes=function(e){this.model&&this.model.is2d()?o.logger.warn("Viewer3D.getCutPlanes is not applicable to 2D"):this.impl.setCutPlaneSet("__set_view",e)},te.prototype.getScreenShot=function(e,t,i,n){return z.ScreenShot.getScreenShotLegacy(this,e,t,i,n)},te.prototype.setContextMenu=function(e){this.contextMenu&&this.contextMenu.hide(),this.contextMenu=e||null},te.prototype.setDefaultContextMenu=function(){var e=Autodesk.Viewing.Extensions;return!(!e||!e.ViewerObjectContextMenu)&&(this.setContextMenu(new e.ViewerObjectContextMenu(this)),!0)},te.prototype.triggerContextMenu=function(e){return this.config&&this.config.onTriggerContextMenuCallback&&this.config.onTriggerContextMenuCallback(e),!!this.contextMenu&&(this.contextMenu.show(e),!0)},te.prototype.triggerSelectionChanged=function(e){this.config&&this.config.onTriggerSelectionChangedCallback&&this.config.onTriggerSelectionChangedCallback(e)},te.prototype.triggerDoubleTapCallback=function(e){this.config&&this.config.onTriggerDoubleTapCallback&&this.config.onTriggerDoubleTapCallback(e)},te.prototype.triggerSingleTapCallback=function(e){this.config&&this.config.onTriggerSingleTapCallback&&this.config.onTriggerSingleTapCallback(e)},te.prototype.triggerSwipeCallback=function(e){this.config&&this.config.onTriggerSwipeCallback&&this.config.onTriggerSwipeCallback(e)},te.prototype.initContextMenu=function(){(!this.config||!Object.prototype.hasOwnProperty.call(this.config,"disableBrowserContextMenu")||this.config.disableBrowserContextMenu)&&(this.onDefaultContextMenu=function(e){e.preventDefault()},this.container.addEventListener("contextmenu",this.onDefaultContextMenu,!1));var e=this,t=this.canvas||this.container;this.onMouseDown=function(t){f.EventUtils.isRightClick(t)&&(e.startX=t.clientX,e.startY=t.clientY)},t.addEventListener("mousedown",this.onMouseDown),this.onMouseUp=function(t){if(f.EventUtils.isRightClick(t)&&t.clientX===e.startX&&t.clientY===e.startY){if(this.viewer.impl.isRightBtnSelectionEnabled()){const e=this.viewer.impl.clientToViewport(t.clientX,t.clientY),i=this.viewer.impl.hitTestViewport(e,!1),n=null==i?void 0:i.dbId,r=this.viewer.getSelection();if(void 0!==n&&!r.includes(n))return;if(void 0===n&&r.length)return}e.triggerContextMenu(t)}return!0},t.addEventListener("mouseup",this.onMouseUp,!1)},te.prototype.registerContextMenuCallback=function(e,t){this.contextMenuCallbacks[e]=t},te.prototype.unregisterContextMenuCallback=function(e){return e in this.contextMenuCallbacks&&(delete this.contextMenuCallbacks[e],!0)},te.prototype.runContextMenuCallbacks=function(e,t){for(var i in this.contextMenuCallbacks)Object.prototype.hasOwnProperty.call(this.contextMenuCallbacks,i)&&this.contextMenuCallbacks[i](e,t)},te.prototype.joinLiveReview=function(e){console.warn("Autodesk.Viewing.Collaboration and its service has been deprecated and will be removed in a future version of Forge Viewer."),this.loadExtension("Autodesk.Viewing.Collaboration").then((t=>{t.joinLiveReview.call(this,e)}))},te.prototype.leaveLiveReview=function(){console.warn("Autodesk.Viewing.Collaboration and its service has been deprecated and will be removed in a future version of Forge Viewer."),this.loadExtension("Autodesk.Viewing.Collaboration").then((e=>{e.leaveLiveReview.call(this)}))},te.prototype.setModelUnits=function(e){this.model&&(this.model.getData().overriddenUnits=e)},te.prototype.worldToClient=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.impl.camera;return this.impl.worldToClient(e,t)},te.prototype.clientToWorld=function(e,t,i,n,r){return this.impl.clientToWorld(e,t,i,n,r)},te.prototype.modelHasTopology=function(){return!(!this.model||!this.model.hasTopology())},te.prototype.setSelectionColor=function(e,t){this.impl.setSelectionColor(e,t)},te.prototype.set2dSelectionColor=function(e,t){this.impl.set2dSelectionColor(e,t)},te.prototype.setTheme=function(e){for(var t=this.container.classList,i=0;i<t.length;++i){-1!==t[i].indexOf("-theme")&&t.remove(t[i--])}t.add(e)},te.prototype.setThemingColor=function(e,t,i,n){(i=i||this.model).setThemingColor(e,t,n),this.impl.invalidate(!0)},te.prototype.clearThemingColors=function(e){(e=e||this.model).clearThemingColors(),this.impl.invalidate(!0)},te.prototype.transferModel=function(e,t){var i,n=this.impl.findModel(e);if(n){var r=[];this.getAggregateSelection((function(t,i){t.id==e&&r.push(i)}));var o=this.impl.visibilityManager.getIsolatedNodes(n),s=this.impl.visibilityManager.getHiddenNodes(n),a=this.impl.matman().exportModelMaterials(n);this.impl.unloadModel(n,!0),null===(i=n.getFragmentList())||void 0===i||i.dispose(this.impl.glrenderer()),n.isAEC()&&n.is3d()&&t.impl.setLightPresetForAec(),t.impl.setRenderingPrefsFor2D(n.is2d()),t.impl.addModel(n),t.impl.matman().importModelMaterials(a,e),t._loadingSpinner.hide(),n.loader&&n.loader.viewer3DImpl===this.impl&&(n.loader.viewer3DImpl=t.impl),n.getData().loadDone&&t.impl.onLoadComplete(n),t.impl.selector.setSelection(r,n),0!=o.length?t.impl.visibilityManager.isolate(o,n):0!=s.length&&t.impl.visibilityManager.hide(s,n)}},te.prototype.hideModel=function(e){var t=this.impl.modelQueue();return!!(e="number"==typeof e?t.findModel(e):e)&&(this.impl.removeModel(e),t.addHiddenModel(e),!0)},te.prototype.showModel=function(e,t){var i=this.impl.modelQueue();return!!(e="number"==typeof e?i.findHiddenModel(e):e)&&(i.removeHiddenModel(e),this.impl.addModel(e,t),!0)},te.prototype.getVisibleModels=function(){return this.impl.modelQueue().getModels().slice()},te.prototype.getHiddenModels=function(){return this.impl.modelQueue().getHiddenModels().slice()},te.prototype.getAllModels=function(){return this.impl.modelQueue().getAllModels().slice()},te.prototype.getFirstModel=function(){let e=this.impl.is2d?this.impl.get2DModels()[0]:this.impl.get3DModels()[0];return e||(e=this.model),e},te.prototype.getUnderlayRaster=function(e){return this.getAllModels().find((t=>{var i,n;const r=t.getDocumentNode();return r&&(null===(i=r.getDocument())||void 0===i?void 0:i.getPath())===(null===(n=e.getDocument())||void 0===n?void 0:n.getPath())&&r.guid()===e.guid()&&t.getData().underlayRaster}))},te.prototype.restoreDefaultSettings=function(){var e=this.model,t=e.is2d()?"2d":"3d";this.prefs.reset(t),this.impl.setupLighting(e),e.isAEC()&&e.is3d()&&this.impl.setLightPresetForAec(),this.impl.setRenderingPrefsFor2D(!e.is3d()),this.fireEvent({type:S.RESTORE_DEFAULT_SETTINGS_EVENT})},te.prototype.disableHighlight=function(e){this.impl.disableHighlight(e)},te.prototype.disableSelection=function(e){e&&this.clearSelection(),this.impl.disableSelection(e)},te.prototype.isHighlightDisabled=function(){return this.impl.selector.highlightDisabled},te.prototype.isHighlightPaused=function(){return this.impl.selector.highlightPaused},te.prototype.isHighlightActive=function(){return!(this.impl.selector.highlightDisabled||this.impl.selector.highlightPaused)},te.prototype.isSelectionDisabled=function(){return this.impl.selector.selectionDisabled},te.prototype.activateExtension=function(e,t){return this.loadedExtensions&&e in this.loadedExtensions?this.loadedExtensions[e].activate(t):(o.logger.warn("Extension is not loaded or doesn't exist"),!1)},te.prototype.deactivateExtension=function(e){return this.loadedExtensions&&e in this.loadedExtensions?this.loadedExtensions[e].deactivate():(o.logger.warn("Extension is not loaded or doesn't exist"),!1)},te.prototype.isExtensionActive=function(e,t){return this.loadedExtensions&&e in this.loadedExtensions?this.loadedExtensions[e].isActive(t):(o.logger.warn("Extension is not loaded or doesn't exist"),!1)},te.prototype.isExtensionLoaded=function(e){return this.loadedExtensions&&e in this.loadedExtensions},te.prototype.getLoadedExtensions=function(){return this.loadedExtensions||[]},te.prototype.getExtensionModes=function(e){return this.loadedExtensions&&e in this.loadedExtensions?this.loadedExtensions[e].getModes():(console.warn("Extension is not loaded or doesn't exist"),[])},te.prototype.reorderElements=function(e){var t=e.getAttribute("layer-order-id"),i=this.containerLayerOrder.indexOf(t),n=null;if(-1!==i)for(var r=i+1;r<this.containerLayerOrder.length&&!n;r++)n=this.container.querySelector('[layer-order-id="'+this.containerLayerOrder[r]+'"]');n?this.container.insertBefore(e,n):this.container.appendChild(e)},te.prototype.appendOrderedElementToViewer=function(e){var t=this.container.querySelector('[layer-order-id="'+e+'"]');if(t)return t;var i=this.getDocument().createElement("div");return i.setAttribute("layer-order-id",e),this.reorderElements(i),i},te.prototype.hitTest=function(e,t,i){return this.impl.hitTest(e,t,i)},te.prototype.refresh=function(e){this.impl.invalidate(e,!1,!e,!e)},te.prototype.chooseProfile=function(e){let t=this.profileManager.PROFILE_DEFAULT;return this.config&&this.config.profileSettings?t=new s.Profile(this.config.profileSettings):e&&e.useFileProfile?t=this.profileManager.getProfileOrDefault(e.fileExt):e.isAEC&&(t=this.profileManager.PROFILE_AEC),t}},54372:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InitParametersSetting:()=>be,Viewer3DImpl:()=>_e,createRenderer:()=>xe});var n=i(16840),r=i(84670),o=i(91531),s=i(9038),a=i(2285),l=i(84807),c=i(31255),h=i(29156),u=i(34345),d=i(40424),p=i(63560),f=i(49720),m=i(79291),g=i(64),v=i(34423),y=i(20657),b=i(419),x=i(11613),_=i(76428),E=i(22038),A=i(55339),S=i(50437),w=i(43644),M=i(41839),T=i(20806),C=i(23850),P=i(41434),D=i(44822),L=i(33423),I=i(76052),R=i(25590),O=i(77693),N=i(35797),k=i(27293),F=i(59991),V=i(89135),U=i(78443),B=i(12156);function z(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function G(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function H(e,t,i){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return i}var W=new WeakSet,j=new WeakSet,X=new WeakSet,q=new WeakSet,Y=new WeakSet,K=new WeakSet;class Z{constructor(){z(this,K),z(this,Y),z(this,q),z(this,X),z(this,j),z(this,W),G(this,"_callbacks",void 0),G(this,"_numberOfTotalDrawCalls",void 0),G(this,"_numberOfInjections",void 0),this._callbacks=new Array,this._numberOfTotalDrawCalls=0,this._numberOfInjections=0,this.counters={drawArrays:0,drawArraysInstanced:0,drawElements:0,drawElementsInstanced:0,total:0}}initialize(e){if(e instanceof WebGLRenderingContext||e instanceof WebGL2RenderingContext)switch(e.constructor.name){case"WebGLRenderingContext":H(this,X,$).call(this,e),H(this,q,ee).call(this,e);break;case"WebGL2RenderingContext":H(this,Y,te).call(this,e),H(this,K,ie).call(this,e)}else console.debug("Draw calls cannot be intruded and counted: Valid context object expected, given",e)}uninitialize(){}resetCounters(){for(const e of this._callbacks)e.continuous?e.callCountOnLastInvocation-=this.counters.total:e.callCountOnLastInvocation=0;this.counters.drawArrays=0,this.counters.drawArraysInstanced=0,this.counters.drawElements=0,this.counters.drawElementsInstanced=0,this.counters.total=0}inject(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Number.isInteger(t)&&t<0?console.warn("After-draw-call callback injection ignored. Number of calls ignored before invocation must be a positive number, given",t):this._callbacks.push({callback:e,numberOfCallsIgnoreBeforeInvocation:t,callCountOnLastInvocation:0,continuous:i})}}function Q(e,t){if(void 0!==e)return function(){e.apply(this,arguments),t.apply(this)}}function J(){if(++this.counters.total,++this._numberOfTotalDrawCalls,0!==this._callbacks.length)for(const e of this._callbacks)this.counters.total-e.callCountOnLastInvocation<=e.numberOfCallsIgnoreBeforeInvocation||(e.callback(),e.callCountOnLastInvocation=this.counters.total,++this._numberOfInjections)}function $(e){e.drawArrays=H(this,W,Q).call(this,e.drawArrays,(()=>{++this.counters.drawArrays,H(this,j,J).call(this)})),e.drawElements=H(this,W,Q).call(this,e.drawElements,(()=>{++this.counters.drawElements,H(this,j,J).call(this)}))}function ee(e){const t=e.getExtension("ANGLE_instanced_arrays");null!==t&&(t.drawArraysInstancedANGLE=H(this,W,Q).call(this,t.drawArraysInstancedANGLE,(()=>{++this.counters.drawArraysInstanced,H(this,j,J).call(this)})),t.drawElementsInstancedANGLE=H(this,W,Q).call(this,t.drawElementsInstancedANGLE,(()=>{++this.counters.drawElementsInstanced,H(this,j,J).call(this)})))}function te(e){e.drawArrays=H(this,W,Q).call(this,e.drawArrays,(()=>{++this.counters.drawArrays,H(this,j,J).call(this)})),e.drawArraysInstanced=H(this,W,Q).call(this,e.drawArraysInstanced,(()=>{++this.counters.drawArraysInstanced,H(this,j,J).call(this)})),e.drawElements=H(this,W,Q).call(this,e.drawElements,(()=>{++this.counters.drawElements,H(this,j,J).call(this)})),e.drawElementsInstanced=H(this,W,Q).call(this,e.drawElementsInstanced,(()=>{++this.counters.drawElementsInstanced,H(this,j,J).call(this)})),e.drawRangeElements=H(this,W,Q).call(this,e.drawRangeElements,(()=>{++this.counters.drawElements,H(this,j,J).call(this)}))}function ie(e){}function ne(e,t,i){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,i)}function re(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function oe(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,ae(e,t,"get"))}function se(e,t,i){return function(e,t,i){if(t.set)t.set.call(e,i);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=i}}(e,ae(e,t,"set"),i),i}function ae(e,t,i){if(!t.has(e))throw new TypeError("attempted to "+i+" private field on non-instance");return t.get(e)}const le={WEBGL_CONTEXT_LOST:"webglcontextlost",WEBGL_CONTEXT_RESTORED:"webglcontextrestored",PHYSICALLY_CORRECT_LIGHTS:"physicallycorrectlights"};let ce;ce=B.WebGLRenderer;var he=new WeakMap,ue=new WeakMap,de=new WeakMap;class pe extends ce{constructor(){var e,t;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(i),re(this,"_drawCallIntrusion",void 0),ne(this,he,{writable:!0,value:void 0}),ne(this,ue,{writable:!0,value:void 0}),ne(this,de,{writable:!0,value:void 0}),null===(e=i.canvas)||void 0===e||e.addEventListener("webglcontextlost",(()=>{this.fireEvent({type:le.WEBGL_CONTEXT_LOST})})),null===(t=i.canvas)||void 0===t||t.addEventListener("webglcontextrestored",(()=>{this.fireEvent({type:le.WEBGL_CONTEXT_RESTORED})})),this.refCount=0;const r=(0,n.getIOSVersion)();if((0,n.isIOSDevice)()&&(r.startsWith("15.")||r.startsWith("16."))){this._drawCallIntrusion=new Z,this._drawCallIntrusion.initialize(this.getContext());const e=pe.DEFAULT_NUM_DRAW_CALLS_TO_INJECT_FLUSH_AFTER_IOS-1;this._drawCallIntrusion.inject((()=>{this.getContext().flush()}),e,!0),console.debug(e<1?"LMVRenderer: Additional context flushes will be invoked after every draw call.":`LMVRenderer: Additional context flushes will be invoked after ${e+1} subsequent draw calls.`)}else this._drawCallIntrusion=void 0;se(this,he,[]),this.loadingAnimationDuration=-1,this.highResTimeStamp=-1,se(this,ue,this.render),se(this,de,this.setRenderTarget),this.render=pe.prototype.render.bind(this),this.setRenderTarget=pe.prototype.setRenderTarget.bind(this)}supportsMRT(){return this.capabilities.isWebGL2||this.extensions.get("WEBGL_draw_buffers")}verifyMRTWorks(e){let t=!1;return this.supportsMRT()&&(t=this.initFrameBufferMRT(e,!0)),t}updateTimestamp(e){return this.highResTimeStamp=e}getLoadingAnimationDuration(){return this.loadingAnimationDuration}setLoadingAnimationDuration(e){return this.loadingAnimationDuration=e}addAnimationLoop(e){oe(this,he).push(e),this.setAnimationLoop((e=>{for(let t of oe(this,he))t(e)}))}removeAnimationLoop(e){for(let t=0;t<oe(this,he).length;++t)if(oe(this,he)[t]===e){oe(this,he).splice(t,1);break}0===oe(this,he).length&&this.setAnimationLoop(null)}clearBlend(){this.state.setBlending(P.NoBlending)}isWebGL2(){return console.warn("LMVRenderer: .isWebGL2() has been deprecated. Use .capabilities.isWebGL2 instead."),this.capabilities.isWebGL2}render(e,t,i){oe(this,ue).call(this,e,t,!1,i)}notifyFinalFrameRendered(e){void 0!==this._drawCallIntrusion&&this._drawCallIntrusion.resetCounters()}setRenderTarget(e){oe(this,de).call(this,e)}}re(pe,"DEFAULT_NUM_DRAW_CALLS_TO_INJECT_FLUSH_AFTER_IOS",1e3),U.EventDispatcher.prototype.apply(pe.prototype),pe.Events=le;var fe=i(93033),me=i(11236),ge=null,ve=(0,n.getGlobal)().ENABLE_DEBUG,ye=(0,n.getGlobal)().ENABLE_DEBUG_RCS;let be={canvas:null,antialias:!1,alpha:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!0,stencil:!1,depth:!1};function xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,n.isNodeJS)())return;var i=Object.assign({},be,t);let r;i.canvas=e;try{r=new pe(i)}catch(e){return null}return r.name="MainRenderer",!r.getContext||r.getContext&&!r.getContext()?null:(r.autoClear=!1,r.sortObjects=!1,r)}function _e(e,t){var i=this;this.setGlobalManager(t.globalManager);var k,U,B,z,G,H,W,j,X,q,Y,K,Z,Q,J,$=1e3/15,ee=1e3/30,te=1,ie=-1,ne=-1,re=-1,oe=null,se="y",ae=null,le=null,ce=null,he=!1,ue=!1,de=!1,be={type:L.PROGRESS_UPDATE_EVENT,state:o.ProgressState.LOADING,percent:0},_e=!1,Ee=!1,Ae=!1,Se=0,we=0,Me=1e3/60,Te=0,Ce=!0,Pe=!1,De=!1,Le=null,Ie=null;this.edgeColorMain=new P.Vector4(0,0,0,.3),this.edgeColorGhosted=new P.Vector4(0,0,0,.1);var Re,Oe,Ne,ke,Fe,Ve,Ue,Be=(0,n.getGlobal)(),ze=!1,Ge=e=>{var t=e.model;this.canvas&&t&&t.getData()&&t.getData().stdSurfMats&&t.getData().stdSurfMats.materials&&this.api.loadExtension("Autodesk.StandardSurface").then((e=>{e&&e.processModel(t)}))},He=e=>e.model.modelRootLoaded=!0,We=()=>this.invalidate(!1,!0),je={},Xe="",qe=!0;function Ye(e){var t;const n=null===(t=e.frags)||void 0===t?void 0:t.is2d;var r=Re.phase,o=!0,s=r==v.RenderFlags.RENDER_NORMAL,a=X.settings.idbuffer&&r!=v.RenderFlags.RENDER_HIDDEN,l=r==v.RenderFlags.RENDER_HIDDEN?i.edgeColorGhosted:i.edgeColorMain;X.setEdgeColor(l),r!=v.RenderFlags.RENDER_HIDDEN||e.ignoreFadeMaterial?r==v.RenderFlags.RENDER_HIGHLIGHTED&&(e.overrideMaterial=i.highlightMaterial):e.overrideMaterial=i.fadeMaterial;const c={type:L.RENDER_SCENE_PART,scene:e,wantColor:o,wantSAO:s,wantID:a,context:X};i.api.dispatchEvent(c),!i.is2d&&n?i.getSheetRenderer().renderScenePart(e,o,s,a):X.renderScenePart(e,o,s,a),e.overrideMaterial=null}function Ke(e){if(!B)return;i.canvasBoundingclientRectDirty=!0,i.camera.aspect=z/G,i.camera.clientWidth=z,i.camera.clientHeight=G;const t=i.getWindow().devicePixelRatio;i.glrenderer().getPixelRatio()!==t&&i.glrenderer().setPixelRatio(t),X.setSize(z,G),i.controls.handleResize(),Q&&Q.setSize(z,G),q&&q.setSize(),i.invalidate(!0,!0,!0,!0),B=!1,e||i.api.dispatchEvent({type:L.VIEWER_RESIZE_EVENT,width:z,height:G})}function Ze(){var e;if((Z.enabled||Q)&&!i.is2d&&(e=i.model&&!i.model.isLoadDone()?i.model.getData().bbox:i.getVisibleBounds(!0,!1,void 0,void 0,!1))){var t=i.camera,n=e.clone(),r=new P.Vector3(1,0,0),o=le.clone();t.worldUpTransform&&(n.applyMatrix4(t.worldUpTransform),r.applyMatrix4(t.worldUpTransform),o.applyMatrix4(t.worldUpTransform)),n.min.y-=.005*(n.max.y-n.min.y),Y&&Y.expandByGroundShadow(n,o);var s=n.getSize(new P.Vector3),a=n.getCenter(new P.Vector3);if(Y||(s.x*=1.25,s.z*=1.25,s.x=s.z=Math.max(s.x,s.z)),t.worldUpTransform){var l=t.worldUpTransform.clone().invert();a.applyMatrix4(l)}if(Z.setTransform(a,s,t.worldup,r),Q){var c=(new P.Vector3).subVectors(a,t.worldup.clone().multiplyScalar(s.y/2));Q.setTransform(c,t.worldup,s)}Y&&Y.setGroundShadowTransform(a,s,t.worldup,r)}}function Qe(){Y&&(Y.state=y.SHADOWMAP_NEEDS_UPDATE)}function Je(){this.highResTimeStamp=-1,this.screenDrawn=ke.NOTHING_DRAWN,this.screenHasChanged=!1,this.frameBudget=0,this.frameRemaining=0,this.phase=v.RenderFlags.RENDER_NORMAL,this.signalProgressByRendering=!1,this.tickCount=0,this.beginFrameAvg=0,this.lastBeginFrameTimeStamp=0,this.RENDERMODE_FULL=0,this.RENDERMODE_PROGRESSIVE=1,this.RENDERMODE_SILENT=2,this.renderType=this.RENDERMODE_FULL,this.INITIAL_GROUND_SHADOW=.2,this.cmdListActive=!1,this.cmdIndex=0,this.continueExecution=!0,this.encounteredAlwaysDo=!1,this.finishedFullRender=!0,this.groundShadowInPost=!1,this.drawOverlay=!1,this.cmdIsOpen=!1,this.allocArraySize=0,this.cmdListLength=0,this.cmdList=[],this.paramList=[],this.CMD_NORMAL_SEQUENCE=0,this.CMD_DO_AFTER=1,this.CMD_ALWAYS_DO=2,this.isActive=function(){return this.cmdListActive},this.setFrame=function(e){this.frameBudget=e},this.beginCommandSet=function(){this.cmdListActive=!0,this.cmdIndex=0,this.cmdListLength=0,this.encounteredAlwaysDo=!1,this.tickCount=0,this.screenDrawn=ke.NOTHING_DRAWN,this.screenHasChanged=!1},this.endCommandSet=function(){this.cmdIsOpen&&(this.cmdIsOpen=!1,this.cmdListLength++)},this._internalSetParam=function(e,t){this.paramList[this.cmdIndex][e]=t},this.addCommand=function(e,t){for(this.cmdIsOpen&&this.cmdListLength++,this.cmdIsOpen=!0;this.allocArraySize<=this.cmdListLength;)this.cmdList[this.cmdListLength]={},this.paramList[this.cmdListLength]={},this.allocArraySize++;return this.cmdList[this.cmdListLength]=e,this.paramList[this.cmdListLength].executionLevel=t||this.CMD_NORMAL_SEQUENCE,this.encounteredAlwaysDo=this.encounteredAlwaysDo||t===this.CMD_ALWAYS_DO,this.cmdListLength},this.setParam=function(e,t){this.cmdIsOpen?this.paramList[this.cmdListLength][e]=t:ve&&f.logger.error("ERROR: cannot set param when no command is open!")},this.getParam=function(e){return ve&&void 0===this.paramList[this.cmdIndex][e]&&f.logger.error("ERROR: parameter "+e+" was never set for this command! Go fix it."),this.paramList[this.cmdIndex][e]},this.executeCommandList=function(){if(!Re.cmdListActive)return Re.lastBeginFrameTimeStamp=0,!0;var e;if(this.tickCount>0&&(Re.lastBeginFrameTimeStamp=0),this.frameRemaining=this.frameBudget,ve&&this.cmdIsOpen&&f.logger.error("ERROR: should call endCommandSet before executing"),this.continueExecution=!0,ye&&(0===this.tickCount&&console.log("==================="),console.log("Running commands for "+(Re.renderType===Re.RENDERMODE_PROGRESSIVE?"progressive":Re.renderType===Re.RENDERMODE_FULL?"full":"silent")+" render, for tick count "+this.tickCount)),this.encounteredAlwaysDo)for(var t=0;t<this.cmdIndex;)this.paramList[t].executionLevel>=Re.CMD_ALWAYS_DO&&(ye&&console.log(" ALWAYS DO command "+t+": "+this.cmdList[t].name),this.cmdList[t]()),t++;for(;this.cmdIndex<this.cmdListLength;)(this.continueExecution||this.paramList[this.cmdIndex].executionLevel>=Re.CMD_DO_AFTER)&&(ye&&console.log(" command "+this.cmdIndex+": "+this.cmdList[this.cmdIndex].name+" and "+Re.frameRemaining+" frame budget remaining"),this.cmdList[this.cmdIndex]()&&(ye&&console.log(" >>> out of tick time with "+Re.frameRemaining),e=this.cmdIndex,this.continueExecution=!1)),this.cmdIndex++;return this.continueExecution?this.cmdListActive=!1:this.cmdIndex=e,this.tickCount++,!this.continueExecution}}function $e(){if(Re.renderType===Re.RENDERMODE_PROGRESSIVE)if(Re.getParam("GenerateGroundShadow.afterBeauty")){if(Re.frameRemaining=Z.prepareGroundShadow(i.modelQueue(),0,Re.frameRemaining),Z.getStatus()==b.GroundFlags.GROUND_RENDERED){if(Re.getParam("GenerateGroundShadow.signalRedraw"))return i.requestSilentRender(),ye&&console.log(" $$$$ SIGNAL FULL GROUND SHADOW REDRAW"),!0;Re.groundShadowInPost=!0}}else 0===Re.tickCount&&Z.prepareGroundShadow(i.modelQueue(),10);else Re.frameRemaining=Z.prepareGroundShadow(i.modelQueue(),0,Re.frameRemaining);return Re.frameRemaining<0&&Z.getStatus()===b.GroundFlags.GROUND_UNFINISHED}function et(){return Z.getStatus()!==b.GroundFlags.GROUND_UNFINISHED&&i.renderGroundShadow(),!1}function tt(){return Re.renderType===Re.RENDERMODE_PROGRESSIVE?Re.getParam("GenerateGroundReflection.afterBeauty")?(Re.frameRemaining=Q.prepareGroundReflection(Z,i,!1,0,Re.frameRemaining),Q.getStatus()==b.GroundFlags.GROUND_RENDERED&&(Re.screenDrawn|=ke.REFLECTION_DRAWN,Re.groundShadowInPost&&H.hasTransparentMaterial()&&i.requestDeferredSilentRender())):0===Re.tickCount&&Q.prepareGroundReflection(Z,i,!0,10):Re.frameRemaining=Q.prepareGroundReflection(Z,i,!1,0,Re.frameRemaining),Re.frameRemaining<0&&Q.getStatus()===b.GroundFlags.GROUND_UNFINISHED}function it(){if(Y.state===y.SHADOWMAP_NEEDS_UPDATE)Re.frameRemaining=Y.startUpdate(J,Re.frameRemaining,i.camera,le,H);else if(Y.state==y.SHADOWMAP_INCOMPLETE&&(Re.frameRemaining=Y.continueUpdate(J,Re.frameRemaining,H),Y.state==y.SHADOWMAP_VALID))return i.requestSilentRender(),ye&&console.log(" $$$$ SIGNAL FULL SHADOW MAP REDRAW"),!0;return Re.frameRemaining<0&&Y.state!==y.SHADOWMAP_VALID}function nt(){Y.state=y.SHADOWMAP_NEEDS_UPDATE}function rt(){if(Re.signalProgressByRendering&&i.signalProgress(0,o.ProgressState.RENDERING),Re.renderType===Re.RENDERMODE_PROGRESSIVE){if(Re.lastBeginFrameTimeStamp>0){var e=Re.highResTimeStamp-Re.lastBeginFrameTimeStamp;Re.beginFrameAvg=.75*Re.beginFrameAvg+.25*e}Re.lastBeginFrameTimeStamp=Re.highResTimeStamp,Re.beginFrameAvg<ee&&Re.frameBudget<$?(i.targetFrameBudget+=1,i.targetFrameBudget>$&&(i.targetFrameBudget=$)):Re.beginFrameAvg>ee&&Re.frameBudget>te&&(i.targetFrameBudget*=.75+.25*ee/Re.beginFrameAvg,i.targetFrameBudget<te&&(i.targetFrameBudget=te))}var t=Re.getParam("BeginScene.clear");return X.beginScene(i.scene,i.camera,i.lightsOn?i.lights:i.no_lights,t),t&&(Re.screenDrawn|=ke.BACKGROUND_DRAWN),Re.getParam("BeginScene.signalCameraChanged")&&i.api.dispatchEvent(i.cameraChangedEvent),!1}function ot(){var e;if(Re.phase=Re.getParam("BeginPhase.phase"),ye&&console.log(" render phase is now "+Re.phase),null!==(e=i.glrenderer().xr)&&void 0!==e&&e.isPresenting){const e=i.glrenderer().xr.getCamera(i.camera);i.camera.projectionMatrix.copy(e.projectionMatrix),e.matrixWorld.decompose(e.position,e.quaternion,e.scale),i.camera.position.copy(e.position),i.camera.quaternion.copy(e.quaternion),i.camera.scale.copy(e.scale),i.camera.matrix.copy(e.matrix),i.camera.matrixWorld.copy(e.matrixWorld)}return J.reset(i.camera,Re.phase,Re.getParam("BeginPhase.moved"),H.getCutPlanes()),!1}function st(){return J.isEmpty()||J.isDone()||(Re.screenDrawn|=ke.MODEL_DRAWN,Re.frameRemaining=J.renderSome(Ye,Re.frameRemaining),Re.signalProgressByRendering&&(i.signalProgress(100*J.getRenderProgress(),o.ProgressState.RENDERING),ye&&console.log(" %%% percent done "+100*J.getRenderProgress()))),!J.isDone()}function at(){return Re.phase=v.RenderFlags.RENDER_FINISHED,X.renderScenePart(i.sceneAfter,!0,!0,!0),!1}function lt(){return Re.phase=v.RenderFlags.RENDER_FINISHED,!1}function ct(){i.signalProgress(100,o.ProgressState.RENDERING)}function ht(){return i.isOverlayDirty()&&(i.clearOverlayDirtyFlag(),Re.drawOverlay=!0),Re.drawOverlay&&(!J.isEmpty()&&J.isDone()||i.showOverlaysWhileMoving?(i.renderOverlays(),Re.screenDrawn|=ke.OVERLAY_DRAWN):(X.clearAllOverlays(),Re.drawOverlay=!1)),!1}function ut(){Re.screenDrawn|=ke.ALL_DRAWN}function dt(){if(Re.screenDrawn&&(Re.phase===v.RenderFlags.RENDER_FINISHED||Re.tickCount%i.frameDisplayRate==0)){var e=!Re.getParam("PostAndPresent.performAO")||(Re.screenDrawn&(ke.BACKGROUND_DRAWN|ke.MODEL_DRAWN))==ke.BACKGROUND_DRAWN;X.composeFinalFrame(e),Re.screenHasChanged=!0,Re.screenDrawn=ke.NOTHING_DRAWN,t=Re.highResTimeStamp,Te++,we<=t&&we>0&&(Me=.8*Me+.2*(t-we)),i.fpsCallback&&i.fpsCallback(i.fps()),i.api.dispatchEvent({type:L.RENDER_PRESENTED_EVENT})}var t;return!1}function pt(){return ve&&!1===X.getAOEnabled()&&f.logger.error("AO should be on at this point!"),X.setAOEnabled(!1),!1}function ft(){return ve&&!0===X.getAOEnabled()&&f.logger.error("AO should be off at this point!"),X.setAOEnabled(!0),!1}function mt(){return i.requestSilentRender(),!1}function gt(){return Re.finishedFullRender=!0,!1}e&&(this.interval=setInterval((function(){Ce||Te<60||i.track({name:"fps",value:Number(i.fps().toFixed(2)),aggregate:"last"})}),3e4)),this.api=t,this.canvas=e,this.loader=null,this.canvasBoundingclientRectDirty=!0,this.nearRadius=0,this.defaultLoadingAnimationDuration=300,this.lastTime2dGeometryCreated=0,this.maxModelDistance=0,this.initialize=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(k=new P.Vector3(0,1,0),J=new s.RenderScene,(j=t.glrenderer||xe(e,t.webglInitParams))||(0,n.isNodeJS)()){j&&(this.onWebGLcontextLost=this.onWebGLcontextLost.bind(this),this.onWebGLcontextRestored=this.onWebGLcontextRestored.bind(this),j.addEventListener(pe.Events.WEBGL_CONTEXT_LOST,this.onWebGLcontextLost),j.refCount++,t.enableContextRestore&&(j.enableContextRestore=!0,j.addEventListener(pe.Events.WEBGL_CONTEXT_RESTORED,this.onWebGLcontextRestored))),(X=t.renderer||new a.RenderContext).init(j,e?e.clientWidth:0,e?e.clientHeight:0,t),(H=t.materialManager||new l.MaterialManager(j)).refCount++,this.camera=new D.UnifiedCamera(e?e.clientWidth:512,e?e.clientHeight:512),this.lightsOn=!1,this.lights=[],this.no_lights=[],Le=(new P.Color).setRGB(1,1,1),Ie=(new P.Color).setRGB(1,1,1),this.cameraChangedEvent={type:L.CAMERA_CHANGE_EVENT,camera:this.camera},ae=new P.Vector3(1,1,1),le=(new P.Vector3).copy(ae),ce=new P.Vector3(-1,0,1),this.scene=new P.Scene,this.sceneAfter=new P.Scene,this.sceneAfter.sortObjects=!1,this.overlayScenes={},yt(),this.createOverlayScene("selection_points",null,null),this.selectionMeshes={},this.fadeMaterial=new me.LMVMeshPhongMaterial({color:16777215,opacity:.1,reflectivity:0,transparent:!0,depthWrite:!1}),this.fadeMaterial.packedNormals=!0,H.addInstancingSupport(this.fadeMaterial),H.addMaterial("__fadeMaterial__",this.fadeMaterial,!0),this.setSelectionColor(6724095),H.togglePolygonOffset(!0),X.setDepthMaterialOffset(H.getPolygonOffsetOn(),H.getPolygonOffsetFactor(),H.getPolygonOffsetUnits()),this.progressiveRender=!0,this.swapBlackAndWhite=!1,this.targetFrameBudget=ee,this.frameDisplayRate=5,(0,n.isMobileDevice)()&&($*=2,ee*=2,this.targetFrameBudget/=2,this.frameDisplayRate/=2),this.interruptBudget=1e10,this.controls={update:function(){this.camera.lookAt(this.camera.target),this.camera.updateProjectionMatrix(),this.camera.dirty=!1},handleResize:function(){},recordHomeView:function(){},uninitialize:function(){},isToolActivated:function(){return!1}},this.selector=new c.MultiModelSelector(this),this.visibilityManager=new h.MultiModelVisibilityManager(this),this.showGhosting=!0,this.showOverlaysWhileMoving=!0,this.skipAOWhenMoving=!1,this.keyFrameAnimator=null,this.zoomBoundsChanged=!0;var i=u.LightPresets[u.DefaultLightPreset].bgColorGradient;this.setClearColors(i[0],i[1],i[2],i[3],i[4],i[5]),(Z=new d.GroundShadow(j)).enabled=!0,Re=new Je,H.addMaterialNonHDR("groundShadowDepthMaterial",Z.getDepthMaterial()),H.addOverrideMaterial("normalsMaterial",X.getDepthMaterial()),H.addOverrideMaterial("edgeMaterial",X.getEdgeMaterial()),X.beginScene(this.scene,this.camera,this.noLights,!0),X.composeFinalFrame(!0,n.isIE11),this.api.addEventListener(L.MODEL_ROOT_LOADED_EVENT,Ge),this.api.addEventListener(L.MODEL_ROOT_LOADED_EVENT,He),this.api.addEventListener(L.LOADER_REPAINT_REQUEST_EVENT,We)}},this.getSheetRenderer=function(){return q||(q=new V.Z(i,X,j,H)),q},this.isSheetRendererNeeded=function(){return!i.is2d&&this.get2DModels().length>0},this.get2DModels=function(){return J.getModels().filter((e=>e.is2d()))},this.get3DModels=function(){return J.getModels().filter((e=>e.is3d()))},this.renderGroundShadow=function(e){Y?Y.state==y.SHADOWMAP_VALID&&Y.renderGroundShadow(i.camera,e||X.getColorTarget()):(Z.renderShadow(i.camera,e||X.getColorTarget()),Z.rendered=!0)},ke={NOTHING_DRAWN:0,MODEL_DRAWN:1,BACKGROUND_DRAWN:2,OVERLAY_DRAWN:4,REFLECTION_DRAWN:8,ALL_DRAWN:15},this.tick=function(e){Re.highResTimeStamp=e=e||0,j.updateTimestamp(e);var t=H.updateMaterials();i.invalidate(t.needsClear,t.needsRender,t.overlayDirty,!1);const n=function(e){if(i.keyFrameAnimator){var t=we>0?(e-we)/1e3:0,n=i.keyFrameAnimator.update(t);if(n&&(i.sceneUpdated(!0),n&i.keyFrameAnimator.UPDATE_CAMERA))return!0}return!1}(e),r=i.controls.update(e),o=J&&J.update(e),s=r||n||K||o;K=!1;var a=B;Ke(),he||(he=s),de||(de=s);var l=!1,c=X.overlayUpdate();de?function(){for(var e in i.selectionMeshes){var t=i.selectionMeshes[e];if(t.model){var n=t.model.getFragmentList();t.geometry===(null==n?void 0:n.getGeometry(t.fragId))&&n.getWorldMatrix(t.fragId,t.matrix)}}}():c&&!de&&(de=l=!0),this.isLoadingAnimationEnabled()&&we-i.lastTime2dGeometryCreated<=j.getLoadingAnimationDuration()&&(ue=!0);var h=i.model&&i.model.loader&&i.model.loader.pagingProxy&&i.model.loader.pagingProxy.getMemoryInfo();Re.signalProgressByRendering=i.model&&i.model.isLoadDone()&&!i.model.isLeaflet()&&!h,_e&&(Ze(),Z.setDirty(),_e=!1,1)&&(he=!0);var u=he,d=J.frameResumePossible();he=he||!d;if(Ae=Ae||Ee&&!Re.cmdListActive,he||ue||de||Ae)if(Re.drawOverlay=de||he||ue,he||ue||Ae){var p,f=u?x.ResetFlags.RESET_RELOAD:x.ResetFlags.RESET_NORMAL;he||ue?(i.progressiveRender?(Re.renderType=Re.RENDERMODE_PROGRESSIVE,p=i.targetFrameBudget):(Re.renderType=Re.RENDERMODE_FULL,p=i.interruptBudget),he&&(Ee=Ae=!1)):(Re.renderType=Re.RENDERMODE_SILENT,p=i.targetFrameBudget,he=!0,f=x.ResetFlags.RESET_REDRAW,Ee=Ae=!1),i.skipCameraUpdate||i.updateCameraMatrices(),Re.setFrame(p),Re.finishedFullRender=!1,Re.beginCommandSet();var m=Z.enabled&&!i.is2d&&!Ce,g=!!Q&&!i.is2d&&!Ce,b=s||a,_=s&&i.skipAOWhenMoving&&X.getAOEnabled();Re.addCommand(rt),Re.setParam("BeginScene.signalCameraChanged",b),Re.setParam("BeginScene.clear",he),_&&Re.addCommand(pt,Re.CMD_ALWAYS_DO),J&&(Y&&Y.state!==y.SHADOWMAP_VALID&&Re.addCommand(it),m&&(Re.addCommand($e),Re.setParam("GenerateGroundShadow.afterBeauty",!1),Re.setParam("GenerateGroundShadow.signalRedraw",!1)),g?(Q.setDirty(),Re.addCommand(tt),Re.setParam("GenerateGroundReflection.afterBeauty",!1)):m&&he&&Re.addCommand(et),J.hasHighlighted()&&(Re.addCommand(ot),Re.setParam("BeginPhase.phase",v.RenderFlags.RENDER_HIGHLIGHTED),Re.setParam("BeginPhase.moved",f),f=!1,Re.addCommand(st)),Re.addCommand(ot),Re.setParam("BeginPhase.phase",v.RenderFlags.RENDER_NORMAL),Re.setParam("BeginPhase.moved",f),f=!1,Re.addCommand(st),!J.areAllVisible()&&i.showGhosting&&(g&&Re.renderType===Re.RENDERMODE_PROGRESSIVE||(Re.addCommand(ot),Re.setParam("BeginPhase.phase",v.RenderFlags.RENDER_HIDDEN),Re.setParam("BeginPhase.moved",f),Re.addCommand(st))),Re.addCommand(at),Re.signalProgressByRendering&&Re.addCommand(ct)),Re.addCommand(ht,Re.renderType===Re.RENDERMODE_PROGRESSIVE?Re.CMD_DO_AFTER:Re.CMD_NORMAL_SEQUENCE),Re.addCommand(dt,Re.renderType===Re.RENDERMODE_PROGRESSIVE?Re.CMD_DO_AFTER:Re.CMD_NORMAL_SEQUENCE),Re.setParam("PostAndPresent.performAO",X.getAOEnabled()&&!_),Re.renderType===Re.RENDERMODE_PROGRESSIVE&&J&&(Y&&Y.state!==y.SHADOWMAP_VALID&&(Re.addCommand(nt),Re.addCommand(it)),m&&(Re.addCommand($e),Re.setParam("GenerateGroundShadow.afterBeauty",!0),Re.setParam("GenerateGroundShadow.signalRedraw",!g),Re.signalProgressByRendering&&Re.addCommand(ct)),g&&(Re.groundShadowInPost=!1,Re.addCommand(tt),Re.setParam("GenerateGroundReflection.afterBeauty",!0),!J.areAllVisible()&&i.showGhosting&&(Re.addCommand(ot),Re.setParam("BeginPhase.phase",v.RenderFlags.RENDER_HIDDEN),Re.setParam("BeginPhase.moved",f),Re.addCommand(st)),Re.addCommand(lt),Re.addCommand(dt),Re.setParam("PostAndPresent.performAO",X.getAOEnabled()&&!_),Re.signalProgressByRendering&&Re.addCommand(ct))),_&&(Re.addCommand(ft,Re.CMD_ALWAYS_DO),Re.addCommand(mt)),Re.addCommand(gt),Re.endCommandSet(),he=!1,ue=!1,this.clearOverlayDirtyFlag()}else Re.finishedFullRender&&(Re.beginCommandSet(),ye&&console.log("=====\nOVERLAY DIRTY"),l?Re.addCommand(ut):Re.addCommand(ht,!0),Re.addCommand(dt,!0),Re.setParam("PostAndPresent.performAO",X.getAOEnabled()),Re.signalProgressByRendering&&Re.addCommand(ct),Re.endCommandSet(),this.clearOverlayDirtyFlag());Ne=Re.cmdListActive,i.onBeforeRender&&i.onBeforeRender(Ne),Re.executeCommandList(),Ne!==qe&&(Ne||i.glrenderer().notifyFinalFrameRendered(),i.api.dispatchEvent({type:L.FINAL_FRAME_RENDERED_CHANGED_EVENT,value:{finalFrame:!Ne}}),qe=Ne),we=Re.highResTimeStamp},this.setLmvDisplay=function(e){Be=e},this.run=function(){W=!0,U=0,setTimeout((function(){W&&function e(t){U=Be.requestAnimationFrame(e),i.tick(t)}()}),1)},this.stop=function(){i.getWindow().cancelAnimationFrame(U);W=!1},this.toggleProgressive=function(e){this.progressiveRender=e,he=!0},this.updateClearColors=function(){var e=this.clearColorTop;if(this.is2d&&this.swapBlackAndWhite){var t=1===e.x&&1===e.y&&1===e.z,i=0===e.x&&0===e.y&&0===e.z;t?e=new P.Color(0,0,0):i&&(e=new P.Color(1,1,1))}X.setClearColors(e,this.clearColorBottom)},this.toggleSwapBlackAndWhite=function(e){this.swapBlackAndWhite=e,this.updateClearColors(),he=!0},this.toggleGrayscale=function(e){H.setGrayscale(e),he=!0},this.toggleGhosting=function(e){this.showGhosting=e,he=!0},this.toggleOverlaysWhileMoving=function(e){this.showOverlaysWhileMoving=e},this.togglePostProcess=function(e,t){X.initPostPipeline(e,t),this.fireRenderOptionChanged(),he=!0},this.toggleCmdMapping=function(e,t){t.keyMapCmd=e},this.toggleGroundShadow=function(e){Z.enabled!==e&&(Z.enabled=e,Z.clear(),e&&Z.setDirty(),Ze(),this.fireRenderOptionChanged(),this.invalidate(!0,!1,!1,!0))},this.isGroundShadowEnabled=function(){return Z&&Z.enabled},this.setGroundShadowColor=function(e){Z.enabled&&(Z.setColor(e),this.invalidate(!0,!1,!1,!1))},this.setGroundShadowAlpha=function(e){Z.enabled&&(Z.setAlpha(e),this.invalidate(!0,!1,!1,!1))},this.setRightBtnSelection=function(e){ze=e},this.isRightBtnSelectionEnabled=function(){return ze},this.toggleGroundReflection=function(e){e&&Q||!e&&!Q||(e?((Q=new _.GroundReflection(j,this.canvas.clientWidth,this.canvas.clientHeight,{clearPass:X.getClearPass()})).setClearColors(this.clearColorTop,this.clearColorBottom,(0,n.isMobileDevice)()),Q.toggleEnvMapBackground(Pe),Q.setEnvRotation(X.getEnvRotation()),Ze()):(Q.cleanup(),Q=void 0),this.fireRenderOptionChanged(),this.invalidate(!0,!1,!1,!1))},this.setGroundReflectionColor=function(e){Q&&(Q.setColor(e),this.invalidate(!0,!1,!1,!1))},this.setGroundReflectionAlpha=function(e){Q&&(Q.setAlpha(e),this.invalidate(!0,!1,!1,!1))},this.toggleEnvMapBackground=function(e){Pe=e,X.toggleEnvMapBackground(e),Q&&Q.toggleEnvMapBackground(e),this.invalidate(!0,!0,!1,!1)},this.isEnvMapBackground=function(){return Pe},this.setOptimizeNavigation=function(e){this.skipAOWhenMoving=e},this.renderOverlays=function(){!function(){for(var e in i.selectionMeshes){var t=i.selectionMeshes[e];t.model&&t.model.isConsolidated()&&t.model.updateRenderProxy(t,t.fragId)}}();var e,t=this.lightsOn;t||this.toggleLights(!0,!0),this.dir_light1&&(e=this.dir_light1.intensity,this.dir_light1.intensity=1),X.renderOverlays(this.overlayScenes,this.lightsOn?this.lights:this.no_lights),t||this.toggleLights(!1,!0),this.dir_light1&&(this.dir_light1.intensity=e)},this.setLayerVisible=function(e,t){this.layers.setLayerVisible(e,t)},this.isLayerVisible=function(e){return this.layers.isLayerVisible(e)},this.getVisibleLayerIndices=function(){return this.layers.getVisibleLayerIndices()},this.setNearRadius=function(e,t){this.nearRadius!==e&&(this.nearRadius=e,t&&this.invalidate(!0))},this.getNearRadius=function(){return this.nearRadius},this.updateNearFarValues=function(e,t){if(t.isEmpty())f.logger.warn("Calculating near-far values based on empty worldBox (infinity) will result in incorrect values - Better to keep previous values instead.");else{if(Ue||(Fe=new P.Matrix4,Ve=new P.Matrix4,Ue=new P.Box3),Fe.compose(e.position,e.quaternion,e.scale),Ve.copy(Fe).invert(),Ue.copy(t),Q){var i=new P.Vector3;i.multiplyVectors(Ue.max,e.worldup);var n=new P.Vector3;n.multiplyVectors(Ue.min,e.worldup),i.sub(n),i.x>=0?Ue.min.x-=i.x:Ue.max.x-=i.x,i.y>=0?Ue.min.y-=i.y:Ue.max.y-=i.y,i.z>=0?Ue.min.z-=i.z:Ue.max.z-=i.z}Y&&Y.groundShapeBox&&Ue.union(Y.groundShapeBox),Ue.applyMatrix4(Ve);var r=1e-5*(Ue.max.z-Ue.min.z),o=.5*(Ue.max.y-Ue.min.y),s=-(Ue.max.z+r)-o,a=-(Ue.min.z-r)+o;if(e.isPerspective){this.nearRadius>0?(s=Math.max(s,Math.min(this.nearRadius,1e-4*Math.abs(a-s))),a=Math.min(a,1e4*s)):(s=Math.max(s,Math.min(1,1e-4*Math.abs(a-s))),a<0&&(a=1e-4),s=Math.max(s,1e-5*a));const i=Math.sqrt(N.SceneMath.pointToBoxDistance2(e.position,t)),n=Math.max(1,i);s=Math.min(s,n)}if(a=Math.max(a,s),Autodesk.Viewing.isSafari()&&!this.glrenderer().capabilities.isWebGL2){const t=a/s;e.isPerspective&&t>2e3&&(s=Math.max(s,1))}e.near=s,e.far=a,e.updateCameraMatrices()}},this.getPixelsPerUnit=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.model;var n=X.settings.deviceHeight,r=H.getCutPlanesRaw(),o=r[0],s=i?i.getBoundingBox():t;return N.SceneMath.getPixelsPerUnit(e,this.is2d,t,n,o,s)},this.updateCameraMatrices=function(){const e=this.camera;e.worldup&&this.setWorldUp(e.worldup);const t=this.getVisibleBounds(!0,de);this.updateNearFarValues(e,t),this.maxModelDistance&&this._applyMaxModelDistanceToNearFar();const i=this.getPixelsPerUnit(e,t),n=X.settings.deviceWidth,r=X.settings.deviceHeight;this.is2d?(H.updatePixelScale(i,n,r,e),H.updateSwapBlackAndWhite(this.swapBlackAndWhite)):H.updatePixelScale(i,n,r,e);this.get2DModels().forEach((t=>{const i=t.getModelToViewerTransform(),o=i?i.getMaxScaleOnAxis():1;if(!this.is2d||1!==o){const i=t.getVisibleBounds(),s=N.SceneMath.getPixelsPerUnit(e,!0,i,r,null,i);H.updatePixelScaleForModel(t,s,n,r,o,e)}}))},this.initLights=function(){De||(this.dir_light1=new P.DirectionalLight(Le,1),this.dir_light1.position.copy(ce),this.amb_light=new P.AmbientLight(Ie),this.lights=[this.dir_light1,this.amb_light],this.camera.add(this.dir_light1),this.camera.add(this.dir_light1.target),De=!0)};function vt(){if((0,n.isMobileDevice)())return;var e=J.getModels().length;let t=X.mrtFlags();e>1&&t.mrtIdBuffer<2&&(X.setIdTargetCount(2)&&H.toggleMRTSetting(X.mrtFlags()))}this.toggleLights=function(e,t){this.amb_light&&(this.lightsOn=e,function(e,t,i,n){var r,o,s=u.LightPresets[ie],a=s&&s.ambientColor,l=s&&s.directLightColor;a=(null===(r=a)||void 0===r?void 0:r.slice(0))??Ie.toArray(),l=(null===(o=l)||void 0===o?void 0:o.slice(0))??Le.toArray(),i?(n&&e?e.color.setRGB(.5*l[0],.5*l[1],.5*l[2]):e&&e.color.setRGB(a[0],a[1],a[2]),t&&t.color.setRGB(l[0],l[1],l[2])):e&&n&&e.color.setRGB(a[0],a[1],a[2])}(this.amb_light,this.dir_light1,e,t))},this.syncCamera=function(e){this.camera.updateCameraMatrices(),e&&this.setWorldUp(this.api.navigation.getWorldUpVector()),K=!0},this.getModelCamera=function(e){if(!e)return;let t;const i=e.getDefaultCamera();return t=i||D.UnifiedCamera.getViewParamsFromBox(e.getBoundingBox(),e.is2d(),this.camera.aspect,this.camera.up,this.camera.fov),t},this.setViewFromFile=function(e,t){if(e){var i=this.getModelCamera(e),n=e.getMetadata("navigation hint","value",null),r=this.controls.isToolActivated("freeorbit")||t&&"Freeorbit"===n;this.setViewFromCamera(i,t,r)}},this.adjustOrthoCamera=function(e){var t=this.getVisibleBounds();D.UnifiedCamera.adjustOrthoCamera(e,t)},this.setViewFromCamera=function(e,t,i){this.adjustOrthoCamera(e);var n,r=this.model?this.model.getUpVector():null;n=r?(new P.Vector3).fromArray(r):i?e.up.clone():I.Navigation.snapToAxis(e.up.clone());const o=e.target.clone().sub(e.position).normalize().distanceTo(n.clone().negate())<1e-6;i?this.api.prefs&&this.api.prefs.set("fusionOrbitConstrained",n.equals(e.up)):o||(e.up=n);var s=this.api.navigation;if(s){var a=this.camera;if(t)a.up.copy(e.up),a.position.copy(e.position),a.target.copy(e.target),e.isPerspective?a.fov=e.fov:(a.saveFov=e.fov,a.fov=D.UnifiedCamera.ORTHO_FOV),a.isPerspective=e.isPerspective,a.orthoScale=e.orthoScale,a.dirty=!0,s.setWorldUpVector(i||o?n:a.up),s.setView(a.position,a.target),s.setPivotPoint(a.target),this.syncCamera(!0);else if(a.isPerspective=e.isPerspective,e.isPerspective||(a.saveFov=e.fov,e.fov=D.UnifiedCamera.ORTHO_FOV),i)s.setRequestTransitionWithUp(!0,e.position,e.target,e.fov,e.up,n);else{var l=this.getVisibleBounds();if(!l.containsPoint(e.target)){var c=l.getCenter(new P.Vector3).distanceTo(e.position),h=e.target.clone().sub(e.position).normalize().multiplyScalar(c);e.target.copy(e.position.clone().add(h))}var u=s.computeOrthogonalUp(e.position,e.target);s.setRequestTransitionWithUp(!0,e.position,e.target,e.fov,u,n)}}K=!0},this.getViewArrayFromCamera=function(e){var t,i=e||{x:0,y:0,z:0},n=this.camera,r=this.model.getUpVector();t=r?(new P.Vector3).fromArray(r):I.Navigation.snapToAxis(n.up.clone());var o=this.api.navigation.getPivotPoint();return[n.position.x+i.x,n.position.y+i.y,n.position.z+i.z,o.x+i.x,o.y+i.y,o.z+i.z,t.x,t.y,t.z,n.aspect,P.Math.degToRad(n.fov),n.orthoScale,n.isPerspective?0:1]},this.setViewFromViewBox=function(e,t,i,n){if(!e.is2d())return;var r={},o=e.getBoundingBox(),s={width:t[2]-t[0],height:t[3]-t[1]};s.aspect=s.width/s.height,s.centerX=t[0]+s.width/2,s.centerY=t[1]+s.height/2;var a=this.camera.aspect;a>s.aspect?r.orthoScale=s.height:r.orthoScale=s.width/a;const l=o.getCenter(new P.Vector3);r.isPerspective=!1,r.position=new P.Vector3(s.centerX,s.centerY,l.z+r.orthoScale),r.target=new P.Vector3(s.centerX,s.centerY,l.z),r.target.y+=1e-6*s.height,r.up=new P.Vector3(0,0,1),this.setViewFromCamera(r,n,!1)},this.setWorldUp=function(e){if(!k.equals(e)){k.copy(e);var t=Math.abs(e.x);se="x",Math.abs(e.y)>t&&(se="y",t=Math.abs(e.y)),Math.abs(e.z)>t&&(se="z");var n,r,o,s,a=new P.Vector3(0,1,0);i.camera.worldUpTransform=(n=a,r=e,o=(new P.Vector3).crossVectors(r,n).normalize(),s=Math.acos(n.dot(r)),(new P.Matrix4).makeRotationAxis(o,s)),this.sceneUpdated(!1)}},this.setUp2DMode=function(e,t){const n=e.getData();n.layerCount&&H.initLayersTexture(n.layerCount,n.layersMap,e.id);const r=H.create2DMaterial(null,{},!0,!1,(function(){i.invalidate(!1,!0,!1,!1)})),o=H.findMaterial(null,r);if(!t){this.is2d&&X.exit2DMode(),X.enter2DMode(o,this.matman().get2dSelectionColor()),this.is2d||this.saveLightPreset(),this.is2d=!0,this.setLightPreset(u.DefaultLightPreset2d),this.setRenderingPrefsFor2D(!0);const t=e.getData();if(t.hidePaper){var s=t.bgColor,a=s>>16&255,l=s>>8&255,c=255&s;this.setClearColors(a,l,c,a,l,c)}}},this.addModel=function(e,t){if(e){var i=!!this.model,n=e.is2d();this.model||e.getData().underlayRaster||(this.model=e,X.setUnitScale(e.getUnitScale())),this.layers||(this.layers=new E.ModelLayers(this)),e.getData().underlayRaster||this.layers.addModel(e,!0),J.addModel(e),this.selector.addModel(e),this.visibilityManager.addModel(e),this._setModelPreferences(e),n?this.setUp2DMode(e,i):this.is2d?(this.is2d=void 0,X.exit2DMode()):re>=0&&(ne=re),this.updateClearColors(),this.setupLighting(e),vt(),this.fireRenderOptionChanged(),this.invalidate(!0),this.api.fireEvent({type:L.MODEL_ADDED_EVENT,model:e,preserveTools:t,isOverlay:i})}},this._setModelPreferences=function(e){e.hideLines(!this.api.prefs.get("lineRendering")),e.hidePoints(!this.api.prefs.get("pointRendering")),e.selector.setSelectionMode(this.api.prefs.get(F.Prefs3D.SELECTION_MODE))},this.setupLighting=function(e){e=e||this.model,(0,n.isNodeJS)()||!e||e.is2d()||(this.setLightPresetFromFile(e)||(ne>=0?(this.setLightPreset(ne,!0,oe),ne=-1,oe=null):this.setLightPreset(ie,!1)),this.setAOHeuristics(e))},this.getSvfMaterialId=function(e){return this.model.getFragmentList().getSvfMaterialId(e)},this.getMaterials=function(){return H},this.setupMesh=function(e,t,i,n){const r={geometry:t,matrix:n};return i&&(r.material=this.matman().setupMaterial(e,t,i)),r.isLine=t.isLines,r.isWideLine=t.isWideLines,r.isPoint=t.isPoints,r.is2d=t.is2d,e.is2d()&&(r.geometry.creationTime=we,this.lastTime2dGeometryCreated=we),r},this.selection2dOverlayName=function(e){return H._getMaterialHash(e,"selection2d")},this.init2dSelection=function(e){var t=this.selection2dOverlayName(e);if(this.overlayScenes[t])return;var n=H.initSelectionTexture(e.getData().maxObjectNumber,e.id);const r=e.getFragmentList(),o=e.getDoNotCut();let s;if(null!=r&&r.viewBounds){const e=r.viewBounds;s=new P.Vector4(e.min.x,e.min.y,e.max.x,e.max.y)}var a=H.create2DMaterial(e,{doNotCut:o,viewportBounds:s},!1,n,(function(){i.invalidate(!1,!0,!1,!1)})),l=H.findMaterial(e,a);this.createOverlayScene(t,l)},this.onLoadComplete=function(e){Ce=!1,this.signalProgress(100,o.ProgressState.LOADING),this.modelVisible(e.id)&&((Z&&Z.enabled||Q)&&this.sceneUpdated(!1,!0),this.invalidate(!!Q,!0,!1,!1)),e.is2d()&&this.init2dSelection(e);var t=e.getGeometryList();t&&t.printStats(),e.hasGeometry()?H.hasTransparentMaterial()&&this.requestSilentRender():f.logger.warn("Loaded model has no geometry."),this.handleInitialVisibility(e),this.api.dispatchEvent({type:L.GEOMETRY_LOADED_EVENT,model:e})},this.onTextureLoadComplete=function(e){this.api.dispatchEvent({type:L.TEXTURES_LOADED_EVENT,model:e}),this.requestSilentRender()},this.signalProgress=function(e,t,i){be.percent===e&&be.state===t&&i&&be.model&&be.model.id===i.id||(be.percent=e,be.state=t,i&&(be.model=i),this.api.dispatchEvent(be))},this.resize=function(e,t,i){var n,r;null!==(n=this.glrenderer())&&void 0!==n&&null!==(r=n.xr)&&void 0!==r&&r.isPresenting?console.warn("Viewer3DImpl: Can't change size while XR device is presenting."):(B=!0,z=e,G=t,i&&Ke(!0))},this.unloadModel=function(e,t){if(this.api.dispatchEvent({type:L.BEFORE_MODEL_UNLOAD_EVENT,model:e}),this.removeModel(e)||J.removeHiddenModel(e)){var i,n;if(!t)if(e.dtor(this.glrenderer()),H.cleanup(e),e.loader)null===(i=(n=e.loader).dtor)||void 0===i||i.call(n),e.loader=null;e.is2d()&&this.overlayScenes[e.id]&&this.removeOverlayScene(this.selection2dOverlayName(e)),this.api.dispatchEvent({type:L.MODEL_UNLOADED_EVENT,model:e})}},this._reserveLoadingFile=function(){this.loaders||(this.loaders=[]);var e={dtor:function(){}};return this.loaders.push(e),e},this._hasLoadingFile=function(){return this.loaders&&this.loaders.length>0},this._addLoadingFile=function(e,t){if(this.loaders){var i=this.loaders.indexOf(e);i>=0&&(this.loaders[i]=t)}},this._removeLoadingFile=function(e){if(this.loaders){var t=this.loaders.indexOf(e);t>=0&&this.loaders.splice(t,1)}},this.removeModel=function(e){return!!J.removeModel(e)&&(this.keyFrameAnimator&&(this.keyFrameAnimator.destroy(),this.keyFrameAnimator=null),this.selector.removeModel(e),this.visibilityManager.removeModel(e),this.layers.removeModel(e),e===this.model&&(this.model=null,J.isEmpty()||(this.model=J.getModels()[0])),vt(),this.invalidate(!0,!0,!0,!0),this.api.fireEvent({type:L.MODEL_REMOVED_EVENT,model:e}),!0)},this.cancelLoad=function(e){if(this.loaders)for(var t=0;t<this.loaders.length;t++){var i=this.loaders[t];if(i.currentLoadPath===e){i.dtor(),this.loaders.splice(t,1);break}}},this.unloadCurrentModel=function(){this.model&&(this.is2d?(this.is2d=void 0,this.removeOverlayScene(this.selection2dOverlayName(this.model)),X.exit2DMode()):ne=ie,this.model.is3d()&&(re=ie),X.beginScene(this.scene,this.camera,this.lightsOn?this.lights:this.no_lights,!0),X.composeFinalFrame(!0)),this.loaders&&(this.loaders.forEach((function(e){e.dtor()})),this.loaders=[]);for(var e=J.getAllModels(),t=e.length-1;t>=0;t--)this.unloadModel(e[t]);this.model=null};var yt=function(){var e,t,n;i.selectionMaterialBase=new me.LMVMeshPhongMaterial({specular:526344,opacity:1,transparent:!1}),i.selectionMaterialTop=new me.LMVMeshPhongMaterial({specular:526344,opacity:.15,transparent:!0}),i.selectionMaterialTop.packedNormals=!0,i.selectionMaterialBase.packedNormals=!0,e="selection",t=i.selectionMaterialBase,n=i.selectionMaterialTop,t.depthWrite=!1,t.depthTest=!0,t.side=P.DoubleSide,n.depthWrite=!1,n.depthTest=!0,n.side=P.DoubleSide,H.addInstancingSupport(t),H.addInstancingSupport(n),i.createOverlayScene(e,t,n),i.highlightMaterial=new me.LMVMeshPhongMaterial({specular:526344,opacity:1,transparent:!1}),i.highlightMaterial.packedNormals=!0,H.addInstancingSupport(i.highlightMaterial),H.addMaterial("__highlightMaterial__",i.highlightMaterial,!0)};this.createOverlayScene=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];t&&H.addOverrideMaterial(e+"_pre",t),i&&H.addOverrideMaterial(e+"_post",i);var s=new P.Scene;return s.__lights=this.scene.__lights,this.overlayScenes[e]={scene:s,camera:n,materialName:e,materialPre:t,materialPost:i,needIdTarget:r,needSeparateDepth:o}},this.removeOverlayScene=function(e){if(this.overlayScenes[e]){var t=this.overlayScenes[e];t.materialPre&&H.removeMaterial(t.materialName+"_pre"),t.materialPost&&H.removeMaterial(t.materialName+"_post"),delete this.overlayScenes[e],this.invalidate(!1,!1,!0,!1)}},this.addOverlay=function(e,t){this.overlayScenes[e]&&(this.overlayScenes[e].scene.add(t),this.invalidate(!1,!1,!0,!1))},this.addMultipleOverlays=function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&this.addOverlay(e,t[i])},this.removeOverlay=function(e,t){this.overlayScenes[e]&&(this.overlayScenes[e].scene.remove(t),this.invalidate(!1,!1,!0,!1))},this.removeMultipleOverlays=function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&this.removeOverlay(e,t[i])},this.clearOverlay=function(e){if(this.overlayScenes[e]){var t,i,n=this.overlayScenes[e].scene;for(i=n.children.length-1;i>=0;--i)(t=n.children[i])&&n.remove(t);this.invalidate(!1,!1,!0,!1)}},this.setClearColors=function(e,t,i,r,o,s){this.clearColorTop=new P.Vector3(e/255,t/255,i/255),this.clearColorBottom=new P.Vector3(r/255,o/255,s/255),this.updateClearColors(),Q&&Q.setClearColors(this.clearColorTop,this.clearColorBottom,(0,n.isMobileDevice)()),he=!0,this.fireRenderOptionChanged()},this.setClearAlpha=function(e){X.setClearAlpha(e)};var bt=new P.Box3;function xt(e,t,i){t.updateMatrixWorld(!0),t.traverse((function(t){var n=t.geometry;const r=t.model&&"number"==typeof t.fragId;if(!r||n.boundingBox)void 0!==n&&t.visible&&(n.boundingBox||n.computeBoundingBox(),bt.copy(n.boundingBox),bt.applyMatrix4(t.matrixWorld),i&&!i(bt)||e.union(bt));else{const n=r&&t.model.getFragmentList();n&&(n.getWorldBounds(t.fragId,bt),i&&!i(bt)||e.union(bt))}}))}var _t,Et=new P.Box3;function At(e){Et.makeEmpty();var t=i.overlayScenes;for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&xt(Et,t[n].scene,e);return xt(Et,i.scene,e),xt(Et,i.sceneAfter,e),Et}this.getVisibleBounds=function(e,t,i,n){var r=new P.Box3;return J.isEmpty()||(xt(r,this.scene,i),r=J.getVisibleBounds(e,i,n).union(r),t&&(r=At(i).union(r))),r},this.getFitBounds=function(e){var t;return e||null===this.selector||(t=this.selector.getSelectionBounds()),t&&!t.isEmpty()||(t=this.getVisibleBounds()).isEmpty()&&this.model.is2d()&&(t=this.model.getBoundingBox()),t},this.getRenderProxy=function(e,t){var i;return null===(i=e.getFragmentList())||void 0===i?void 0:i.getVizmesh(t)},this.getLayersRoot=function(){return this.layers.getRoot()},this.getFragmentProxy=function(e,t){return new A.FragmentPointer(e.getFragmentList(),t)},this.getRenderProxyCount=function(e){return e.getFragmentList().getCount()},this.getRenderProxyDbIds=function(e,t){return e.getFragmentList().getDbIds(t)},this.isWholeModelVisible=function(){return!J||J.areAllVisible()},this.isNodeVisible=function(e,t){return this.visibilityManager.isNodeVisible(t,e)},this.highlightObjectNode=function(e,t,i,n){t=e.reverseMapDbIdFor2D(t),e.is2d()&&(H.highlightObject2D(t,i,e.id),this.invalidate(!1,!1,!0,!1)),this.renderer().setDbIdForEdgeDetection(i&&!n?t:0,i?e.id:0);var r=this,o=e.getData().instanceTree;if(o&&!e.is2d())if(e.useIdBufferSelection){var s=e.getData().fragments.dbId2fragId[t];r.highlightFragment(e,s,i,n)}else o.enumNodeFragments(t,(function(t){r.highlightFragment(e,t,i,n)}),!1);else{let o=t;if(e.is2d()&&e.getData().fragments&&(o=e.getData().fragments.dbId2fragId[t]),Array.isArray(o))for(var a=0;a<o.length;a++)r.highlightFragment(e,o[a],i,n);else r.highlightFragment(e,o,i,n)}},this.highlightFragment=function(e,t,i,n){if(e.isLeaflet())return e.getIterator().highlightSelection(i,this.highlightMaterial.color),void this.invalidate(!0);var r=this.getRenderProxy(e,t);if(r){var o=!n||r.is2d||r.isPoint||r.themingColor,s=e.id+":"+t;if(o){var a="selection";if(e.is2d()&&(a=this.selection2dOverlayName(e)),r.isPoint&&(a+="_points"),i)if(r.is2d&&Object.prototype.hasOwnProperty.call(this.selectionMeshes,s))++this.selectionMeshes[s]._lmv_highlightCount;else{var l;if(!r||!r.geometry)return;if(r.isPoint){var c=r.material.clone();c.color=this.selectionMaterialBase.color,c.needsUpdate=!0,c.defines&&r.geometry.attributes.pointScale&&(c.defines.PARTICLE_FLAGS=1),l=new fe.LMVMesh(r.geometry,c)}else l=new fe.LMVMesh(r.geometry,r.material);l.matrix.copy(r.matrixWorld),l.matrixAutoUpdate=!1,l.matrixWorldNeedsUpdate=!0,l.frustumCulled=!1,l.model=e,l.fragId=t,l._lmv_highlightCount=1,this.addOverlay(a,l),this.selectionMeshes[s]=l}else if(Object.prototype.hasOwnProperty.call(this.selectionMeshes,s)){var h=this.selectionMeshes[s];--h._lmv_highlightCount<=0&&(this.removeOverlay(a,h),delete this.selectionMeshes[s])}}o&&i||e.setHighlighted(t,i)&&this.invalidate(!0)}},this.explode=function(e){return(e=Number(e))!=Se&&(Se=e,this.refreshExplode(),this.api.dispatchEvent({type:L.EXPLODE_CHANGE_EVENT,scale:e}),!0)},this.refreshExplode=function(){J.explode(Se),this.sceneUpdated(!0)},this.getExplodeScale=function(){return Se},this.lockExplode=function(e,t,i){const n=(i=i||this.model).getData().instanceTree;if(!n)return!1;const r=function(e,i){return n.enumNodeChildren(i,(function(i){e=n.lockNodeExplode(i,t)||e}),!0),e};let o;return o=Array.isArray(e)?e.reduce(r,!1):r(!1,e),o&&Se>0&&(J.explode(Se),this.sceneUpdated(!0)),o},this.isExplodeLocked=function(e,t){const i=(t=t||this.model).getData().instanceTree;return i&&i.isNodeExplodeLocked(e)},this.setGhostingBrightness=function(e){var t=new P.Color(e?1052688:16777215);function i(e){e.color=t}i(this.fadeMaterial),this.fadeMaterial.variants&&this.fadeMaterial.variants.forEach(i)},this.loadCubeMapFromColors=function(e,t){var i=(0,S.CreateCubeMapFromColors)(e,t);return i.isBgColor=!0,H.setReflectionMap(i),i},this.loadCubeMap=function(e,t){this._reflectionMapPath=e;return m.TextureLoader.loadCubeMap(e,t,(function(t){e===i._reflectionMapPath&&H&&(H.setReflectionMap(t),i.invalidate(!0),t?u.LightPresets[ie].useIrradianceAsBackground||X.setCubeMap(t):i.loadCubeMapFromColors(i.clearColorTop,i.clearColorBottom))}))},this.loadIrradianceMap=function(e,t){this._irradianceMapPath=e;return m.TextureLoader.loadCubeMap(e,t,(function(t){e===i._irradianceMapPath&&H&&(H.setIrradianceMap(t),i.invalidate(!0),u.LightPresets[ie].useIrradianceAsBackground&&X.setCubeMap(t))}))},this.setCurrentLightPreset=function(e){ie=e},this.setLightPreset=function(e,t,i){var r;if((0,n.isNodeJS)()&&(e=0),this.initLights(),ie===e&&!t)return void(i&&i());if((e<0||u.LightPresets.length<=e)&&(e=u.DefaultLightPreset),ie=e,J.isEmpty())return ne=ie,void(oe=i);var o=u.LightPresets[e],s=o.bgColorGradient;if(s||(s=u.BackgroundPresets.Custom),this.setClearColors(s[0],s[1],s[2],s[3],s[4],s[5]),void 0!==o.useIrradianceAsBackground&&(this.api.prefs.hasTag("envMapBackground","ignore-producer")?f.logger.debug("setLightPreset(): envMapBackground is locked. No changes."):(this.api.prefs.tag("no-storage","envMapBackground"),this.api.setEnvMapBackground(o.useIrradianceAsBackground))),o.path){var a="res/environments/"+o.path,l=(0,w.getResourceUrl)(a+"_mipdrop."+(o.type||"")+".dds"),c=(0,w.getResourceUrl)(a+"_irr."+(o.type||"")+".dds");this.loadIrradianceMap(c,o.E_bias),this.loadCubeMap(l,o.E_bias),H.setEnvExposure(-o.E_bias),X.setEnvExposure(-o.E_bias),this.setTonemapExposureBias(o.E_bias),this.setTonemapMethod(o.tonemap),this.setGhostingBrightness(o.darkerFade)}else{var h=this.loadCubeMapFromColors(this.clearColorTop,this.clearColorBottom);X.setCubeMap(h),H.setIrradianceMap(null),H.setEnvExposure(-o.E_bias||0),X.setEnvExposure(-o.E_bias||0),this.setTonemapExposureBias(o.E_bias||0),this.setTonemapMethod(o.tonemap||0),this.setGhostingBrightness(o.darkerFade),X.toggleEnvMapBackground(Pe),this.invalidate(!0)}const d=null===(r=J)||void 0===r?void 0:r.getModels().filter((e=>{var t,i;const n=null==e?void 0:e.getDocumentNode(),r=(null==n?void 0:n.getInputFileType())||(null==n||null===(t=n.getRootNode())||void 0===t||null===(i=t.data)||void 0===i?void 0:i.name)||"";return["dwfx","dwf"].includes(r.toLowerCase())}));d.length>0&&d.forEach((e=>{H.forEachInModel(e,!1,(e=>{e.emissiveOrig||(e.emissiveOrig=e.emissive),e.emissive=e.emissiveOrig.clone().multiplyScalar(Math.pow(2,-o.E_bias))}))}));var p=M.SAOShader.uniforms.radius.value,m=M.SAOShader.uniforms.intensity.value;Object.prototype.hasOwnProperty.call(o,"saoRadius")&&(p=o.saoRadius),Object.prototype.hasOwnProperty.call(o,"saoIntensity")&&(m=o.saoIntensity),X.setAOOptions(p,m);var g=1;null!==o.lightMultiplier&&void 0!==o.lightMultiplier&&(g=o.lightMultiplier),le.copy(ae),o.lightDirection&&le.fromArray(o.lightDirection).negate(),Y&&Qe(),this.dir_light1&&(this.dir_light1.intensity=g,o.lightDirection?this.dir_light1.position.set(-o.lightDirection[0],-o.lightDirection[1],-o.lightDirection[2]):this.dir_light1.position.copy(ce)),H.setEnvRotation(o.rotation||0),X.setEnvRotation(o.rotation||0),Q&&Q.setEnvRotation(o.rotation||0),this.toggleLights(0!==g),this.invalidate(!0,!1,!0,!0),this.fireRenderOptionChanged(),i&&i()},this.setLightPresetFromFile=function(e){if(!e||e.is2d())return!1;let t;var i=e.getMetadata("renderEnvironmentGroundReflection","value",null);t=this.api.prefs.hasTag(F.Prefs3D.GROUND_REFLECTION,"ignore-producer"),null===i||t||(this.api.prefs.tag("no-storage",F.Prefs3D.GROUND_REFLECTION),this.api.setGroundReflection(i));var r=e.getMetadata("renderEnvironmentGroundShadow","value",null);t=this.api.prefs.hasTag(F.Prefs3D.GROUND_SHADOW,"ignore-producer"),null===r||t||(this.api.prefs.tag("no-storage",F.Prefs3D.GROUND_SHADOW),this.api.setGroundShadow(r));var o=e.getMetadata("renderEnvironmentAmbientShadows","value",null);t=this.api.prefs.hasTag(F.Prefs3D.AMBIENT_SHADOWS,"ignore-producer"),null===o||t||(this.api.prefs.tag("no-storage",F.Prefs3D.AMBIENT_SHADOWS),this.api.setQualityLevel(o,X.getAntialiasing()));var s=e.getMetadata("renderEnvironmentDisplayLines","value",null);t=this.api.prefs.hasTag(F.Prefs3D.LINE_RENDERING,"ignore-producer"),null===s||t||(this.api.prefs.tag("no-storage",F.Prefs3D.LINE_RENDERING),this.api.hideLines(!s));var a=e.getMetadata("renderEnvironmentDisplayPoints","value",null);t=this.api.prefs.hasTag(F.Prefs.POINT_RENDERING,"ignore-producer"),null===a||t||(this.api.prefs.tag("no-storage",F.Prefs.POINT_RENDERING),this.api.hidePoints(!a));var l=e.getMetadata("renderEnvironmentDisplayEdges","value",null);t=this.api.prefs.hasTag(F.Prefs3D.EDGE_RENDERING,"ignore-producer"),null===l||t||(this.api.prefs.tag("no-storage",F.Prefs3D.EDGE_RENDERING),this.api.setDisplayEdges(!(0,n.isMobileDevice)()&&!!l));var c=e.getMetadata("renderEnvironmentStyle","value",null),h=u.LightPresets.filter((function(e){return e.name===c}))[0];if(t=this.api.prefs.hasTag(F.Prefs3D.LIGHT_PRESET,"ignore-producer"),h&&!t){this.api.prefs.tag("no-storage",F.Prefs3D.LIGHT_PRESET);var d=ge;d||(d=ge={},u.LightPresets.push(d)),(0,u.copyLightPreset)(h,d),d.name="Custom Model defined";var p=e.getMetadata("renderEnvironmentExposureBias","value",null),f=e.getMetadata("renderEnvironmentExposureBase","value",null);null!==p&&null!==f&&(d.E_bias=p+f);var m=e.getMetadata("renderEnvironmentBackgroundColor","value",null);t=this.api.prefs.hasTag(F.Prefs.BACKGROUND_COLOR_PRESET,"ignore-producer"),m&&!t&&(d.bgColorGradient=[255*m[0],255*m[1],255*m[2],255*m[0],255*m[1],255*m[2]]);var g=e.getMetadata("renderEnvironmentRotation","value",null);null!==g&&(d.rotation=g);var v=u.LightPresets.indexOf(d);this.setLightPreset(v,!0)}var y=e.getMetadata("renderEnvironmentBackgroundFromEnvironment","value",null);return t=this.api.prefs.hasTag(F.Prefs3D.ENV_MAP_BACKGROUND,"ignore-producer"),null===y||t||(this.api.prefs.tag("no-storage",F.Prefs3D.ENV_MAP_BACKGROUND),this.api.setEnvMapBackground(y)),h},this.setLightPresetForAec=function(){for(var e=(0,n.getGlobal)().DefaultLightPresetAec||"Boardwalk",t=-1,i=0;i<u.LightPresets.length;i++)if(u.LightPresets[i].name===e){t=i;break}return t>=0&&(this.api.prefs.hasTag("lightPreset","ignore-producer")?f.logger.debug("setLightPresetForAec(): lightPreset is locked. No changes."):(this.api.prefs.tag("no-storage","lightPreset"),this.setLightPreset(t,!0,function(){this.api.prefs.tag("ignore-producer","envMapBackground")}.bind(this)),this.saveLightPreset())),this.api.prefs.hasTag("edgeRendering","ignore-producer")?f.logger.debug("setLightPresetForAec(): edgeRendering is locked. No changes."):(this.api.prefs.tag("no-storage","edgeRendering"),this.api.setDisplayEdges(!(0,n.isMobileDevice)())),!0},this.setAOHeuristics=function(e){var t=e.getUnitScale(),i=e.getMetadata("renderEnvironmentAmbientShadows","radius",void 0),n=e.getMetadata("renderEnvironmentAmbientShadows","intensity",void 0),r=e.getMetadata("renderEnvironmentAmbientShadows","opacity",void 0);if(void 0!==i||void 0!==n||void 0!==r)X.setAOOptions(i/t,n,r);else if(e.isAEC()){t>.3?X.setAOOptions(4/t,1,.625):X.setAOOptions(.25/t,1,.625)}else{var o=e.getData().bbox.getSize(new P.Vector3).length();X.setAOOptions(Math.min(10,.05*o))}},this.setTonemapMethod=function(e){e!=X.getToneMapMethod()&&(X.setTonemapMethod(e),H.setTonemapMethod(e),this.fireRenderOptionChanged(),this.invalidate(!0))},this.setTonemapExposureBias=function(e){e!=X.getExposureBias()&&(X.setTonemapExposureBias(e),H.setTonemapExposureBias(e),this.fireRenderOptionChanged(),this.invalidate(!0))},this.setRenderingPrefsFor2D=function(e){if(!(0,n.isNodeJS)()){var t=!e&&!!this.api.prefs.get("envMapBackground");this.toggleEnvMapBackground(t)}},this.dtor=function(){var e;this.stop(),this.api.removeEventListener(L.MODEL_ROOT_LOADED_EVENT,Ge),this.api.removeEventListener(L.MODEL_ROOT_LOADED_EVENT,He),this.api.removeEventListener(L.LOADER_REPAINT_REQUEST_EVENT,We),this.unloadCurrentModel(),this.controls=null,this.canvas=null,clearInterval(this.interval),this.loader=null,this.selector.dtor(),this.selector=null,this.model=null,this.layers=null,this.visibilityManager=null,Oe&&(Oe.removeViewer(this.api),Oe=null),J=null,null===(e=X)||void 0===e||e.cleanup(),X=null,H.refCount--,0===H.refCount&&H.dtor(),H=null,j&&(j.refCount--,0===j.refCount&&(j.domElement=null,j.context=null),j.removeEventListener(pe.Events.WEBGL_CONTEXT_LOST,this.onWebGLcontextLost),j.removeEventListener(pe.Events.WEBGL_CONTEXT_RESTORED,this.onWebGLcontextRestored),j=null)},this.hideLines=function(e){J&&!J.isEmpty()&&(J.hideLines(e),this.sceneUpdated(!0))},this.hidePoints=function(e){J&&!J.isEmpty()&&(J.hidePoints(e),this.sceneUpdated(!0))},this.setDisplayEdges=function(e){X.toggleEdges(e);var t=e;e||(t=!(!this.model||!this.model.getData().hasLines)),H.togglePolygonOffset(t),X.setDepthMaterialOffset(H.getPolygonOffsetOn(),H.getPolygonOffsetFactor(),H.getPolygonOffsetUnits()),this.invalidate(!0)},this.setDoubleSided=function(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if((t=t||this.model).is2d())return;const n=t.getData();n&&(this.matman().setDoubleSided(e,t),i&&this.sceneUpdated())},this.getAllCutPlanes=function(){var e=void 0;for(var t in je){var i=je[t];i&&i.length&&(e=e?t===Xe?i.concat(e):e.concat(i):i)}return e},this.updateCutPlanes=function(){var e=this.getAllCutPlanes();this.setCutPlanes(e)},this.setCutPlaneSet=function(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(je[e]=t?t.slice():void 0,i)this.updateCutPlanes();else{var n=this.getAllCutPlanes();this.setCutPlanesInScene(n)}},this.setCutPlaneSetFor2DRendering=function(e){Xe=e,this.updateCutPlanes()},this.getCutPlaneSet=function(e){return je[e]||[]},this.getCutPlaneSets=function(){var e=[];for(var t in je){var i=je[t];i&&i.length&&e.push(t)}return e},this.getCutPlanes=function(){return H.getCutPlanes()},this.setCutPlanesInScene=function(e){X.toggleTwoSided(H.setCutPlanes(e)),this.sceneUpdated()},this.setCutPlanes=function(e){this.setCutPlanesInScene(e),this.api.dispatchEvent({type:L.CUTPLANES_CHANGE_EVENT,planes:e})},this.fireRenderOptionChanged=function(){H.toggleMRTSetting(X.mrtFlags()),this.api.dispatchEvent({type:L.RENDER_OPTION_CHANGED_EVENT})},this.viewportToRay=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.camera;return i.viewportToRay(e,t)},this.rayIntersect=function(e,t,i,n,r,o){var s=J.rayIntersect(e.origin,e.direction,t,i,n,r,(e=>{const t=(new P.Vector3).copy(e);t.project(this.camera);const i=[];return X.idAtPixel(t.x,t.y,i),i}),o),a=[this.scene,this.sceneAfter];const l=new P.Vector3;for(let t=0;t<a.length;t++){let i=a[t];if(i.children.length){var c=new P.Raycaster(e.origin,e.direction,this.camera.near,this.camera.far);xt(Et,i),c.params.Line.threshold=Math.min(1,.5*Et.getSize(l).length()*.001);var h=r||[];if(T.VBIntersector.intersectObject(i,c,h,!0),h.length){const e=h[0];(!s||e.distance<s.distance)&&(void 0!==e.modelId&&(e.model=this.findModel(e.modelId)),s=e)}}}return s?(void 0===s.dbId&&void 0!==s.fragId&&(s.dbId=s.model.getFragmentList().getDbIds(s.fragId),s.model.getData().instanceTree||(s.dbId=s.fragId)),s.intersectPoint=s.point,s):null},this.castRayViewport=function(e,t,i,n,r,o){return _t=_t||new P.Ray,J?(this.viewportToRay(e,_t),this.rayIntersect(_t,t,i,n,r,o)):{}},this.getCanvasBoundingClientRect=function(){return this.canvasBoundingclientRectDirty&&(this.canvasBoundingclientRectDirty=!1,this.boundingClientRect=this.canvas.getBoundingClientRect()),this.boundingClientRect},this.clientToViewport=function(e,t){var i=this.getCanvasBoundingClientRect();return new P.Vector3((e+.5)/i.width*2-1,-(t+.5)/i.height*2+1,1)},this.viewportToClient=function(e,t){var i=this.getCanvasBoundingClientRect();return new P.Vector3(.5*(e+1)*i.width-.5,-.5*(t-1)*i.height-.5,0)},this.castRay=function(e,t,i,n){return this.castRayViewport(this.clientToViewport(e,t),i,void 0,void 0,void 0,n)},this.intersectGroundViewport=function(e){var t="z";this.is2d||(t=se);var i=this.model&&this.model.getBoundingBox();return N.SceneMath.intersectGroundViewport(e,this.camera,t,i)},this.intersectGround=function(e,t){return this.intersectGroundViewport(this.clientToViewport(e,t))},this._2dHitTestViewport=function(e,t,i){const n=[0,0],r=X.idAtPixels(e.x,e.y,t,n);if(r<i)return null;const o=J.findModel(n[1])||this.model;if(!o)return null;const s=this.intersectGroundViewport(e),a=o.getData().fragments,l=a?a.dbId2fragId[r]:-1;return{intersectPoint:s,dbId:o.remapDbIdFor2D(r),fragId:l,model:o}};const St=e=>t=>{if(!(t&&t.object&&t.object.isLine))return!0;const n=1/i.camera.pixelsPerUnitAtDistance(t.distance),r=e*n;return t.distanceToRay<r};function wt(e,t,i,n){var r=e.getFragmentList().getVizmesh(t);new C.VertexBufferReader(r.geometry).enumGeomsForVisibleLayer(i,n)}function Mt(e,t,i,n){var r=e.getFragmentList().getVizmesh(t);new C.VertexBufferReader(r.geometry).enumGeomsForObject(i,n)}this.hitTestViewport=function(e,t,i,r,o){let s;if(this.is2d){const t=(0,n.isMobileDevice)()?45:5;s=this._2dHitTestViewport(e,t,1)}else s=this.castRayViewport(e,t,i,r,o);return s},this.hitTest=function(e,t,n,r,o){return i.hitTestViewport(this.clientToViewport(e,t),n,r,o)},this.hitBoxTestViewport=function(e,t,i){const n=[],r=[];X.idsAtPixelsBox(e.x,e.y,t,i,r);for(let e=0;e<r.length;e++){const t=J.findModel(r[e][1])||this.model;if(t){const i=t.remapDbIdFor2D(r[e][0]);n.push({dbId:i,model:t})}}return n},this.snappingHitTestViewport=function(e,t){let i;const r=(0,n.isMobileDevice)()?45:17;if(this.is2d)if(this.model&&this.model.isLeaflet()){i={intersectPoint:this.intersectGroundViewport(e)}}else i=this._2dHitTestViewport(e,r,0);else{const n=[],o=X.idAtPixels(e.x,e.y,r,n);n[2]&&n[3]&&(e.setX(n[2]),e.setY(n[3]));const s={filter:St(r)};i=this.castRayViewport(e,t,o>0?[o]:null,void 0,void 0,s)}return i},this.snappingHitTest=function(e,t,i){return this.snappingHitTestViewport(this.clientToViewport(e,t),i)},this.clearHighlight=function(){X.rolloverObjectId(-1),this.invalidate(!1,!1,!0,!1)},this.rollOverIdChanged=function(){this.api.fireEvent({type:L.OBJECT_UNDER_MOUSE_CHANGED,dbId:X.getRollOverDbId(),modelId:X.getRollOverModelId()}),this.invalidate(!1,!1,!0,!1)},this.rolloverObjectViewport=function(e){if(!this.model)return;if(this.is2d&&this.model&&(this.model.isLeaflet()||this.model.isPdf(!0)&&this.api.prefs.get(F.Prefs2D.DISABLE_PDF_HIGHLIGHT)))return;const t=[],i=X.idAtPixel(e.x,e.y,t);if(this.selector&&this.selector.isNodeSelectionLocked(i,this.model))return void this.clearHighlight();const n=t[1],r=this.findModel(n);null!=r&&r.isLeaflet()?X.rollOverModelId(n)&&this.rollOverIdChanged():X.rolloverObjectViewport(e.x,e.y)&&this.rollOverIdChanged()},this.rolloverObject=function(e,t){this.selector.highlightPaused||this.selector.highlightDisabled||this.rolloverObjectViewport(this.clientToViewport(e,t))},this.pauseHighlight=function(e){this.selector.highlightPaused=e,e&&this.clearHighlight()},this.disableHighlight=function(e){this.selector.highlightDisabled=e,e&&this.clearHighlight()},this.disableSelection=function(e){this.selector.selectionDisabled=e},this.cancelLeafletScreenshot=function(){i.api.dispatchEvent({type:L.CANCEL_LEAFLET_SCREENSHOT})},this.getScreenShotProgressive=function(e,t,i,n){return r.ScreenShot.getScreenShot(e,t,i,n,this)},this.modelQueue=function(){return J},this.glrenderer=function(){return j},this.renderer=function(){return X},this.setGeomCache=function(e){(Oe=e).addViewer(i.api)},this.geomCache=function(){return Oe||this.setGeomCache(new p.OtgResourceCache),Oe},this.shadowMaps=function(){return Y},this.worldUp=function(){return k},this.worldUpName=function(){return se},this.setUserRenderContext=function(e,t){X=e||new a.RenderContext,t||(X.init(j,this.canvas.clientWidth,this.canvas.clientHeight),X.setClearColors(this.clearColorTop,this.clearColorBottom)),this.invalidate(!0),this.sceneUpdated(!1)},this.setUserGroundShadow=function(e){var t=Z;return Z=e,t},this.invalidate=function(e,t,i,n){he||(he=e),ue||(ue=t),de||(de=i)},this.isOverlayDirty=function(){return de},this.clearOverlayDirtyFlag=function(){de=!1},this.sceneUpdated=function(e,t){this.invalidate(!t,!1,!t),J&&e&&(J.invalidateVisibleBounds(),this.zoomBoundsChanged=!0),_e=!0,Qe()},this.requestSilentRender=function(){Ee=Ae=!0},this.requestDeferredSilentRender=function(){Ee=!0},this.currentLightPreset=function(){return ie},this.saveLightPreset=function(){ne=ie},this.matman=function(){return H},this.fps=function(){return 1e3/Me},this.setFPSTargets=function(e,t,i){$=1e3/i,te=1,ee=1e3/t,this.targetFrameBudget=(0,n.isMobileDevice)()?ee/4:ee},this.track=function(e){f.logger.track(e)},this.worldToClient=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.camera;var i=new P.Vector4(e.x,e.y,e.z,1);return i.applyMatrix4(t.matrixWorldInverse),i.applyMatrix4(t.projectionMatrix),i.w>0&&(i.x/=i.w,i.y/=i.w,i.z/=i.w),this.viewportToClient(i.x,i.y)},this.clientToWorld=function(e,t,i,n,r){var o=null;if(this.is2d){var s=this.model,a=s.getData(),l=this.intersectGround(e,t);if(l){l.z=0;var c=a.bbox;(n||a.hidePaper||c.containsPoint(l))&&(o={point:l,model:s})}else n&&(o={point:this.camera.position.clone(),model:s})}else{let n;r&&(n=this.get3DModels().map((e=>e.id))),(o=this.hitTest(e,t,i,void 0,n))&&(o.point=o.intersectPoint)}return o},this.set2dSelectionColor=function(e,t){this.matman().set2dSelectionColor(e,t),this.invalidate(!1,!1,!0,!1)},this.setSelectionColor=function(e,t){t=t||R.SelectionType.MIXED;var i=new P.Color(e);i.multiplyScalar(.5);var n=function(t){t.color.set(e),t.emissive.set(i),t.variants&&t.variants.forEach(n)};switch(t){default:case R.SelectionType.MIXED:n(this.selectionMaterialBase),n(this.selectionMaterialTop),X.setSelectionColor(e),n(this.highlightMaterial),this.invalidate(!0);break;case R.SelectionType.REGULAR:n(this.highlightMaterial),this.invalidate(!0);break;case R.SelectionType.OVERLAYED:n(this.selectionMaterialBase),n(this.selectionMaterialTop),X.setSelectionColor(e),this.invalidate(!1,!1,!0,!1)}},this.updateViewportId=function(e){H.updateViewportId(e),this.invalidate(!0)},this.findModel=function(e,t){let i;if("number"==typeof e)i=t=>t.id==e;else if(e instanceof O.BubbleNode)i=t=>t.getDocumentNode()==e;else{if(!e)return null;i=e}let n=J.getModels().find(i);return t&&!n&&(n=J.getHiddenModels().find(i)),n},this.getFrameRate=function(){return this.frameDisplayRate},this.setFrameRate=function(e){this.frameDisplayRate=e<1?1:e},this.setShadowLightDirection=function(e){le.copy(e),Qe(),this.invalidate(!0,!1,!1,!1),Ze()},this.getShadowLightDirection=function(e){var t=e||new P.Vector3;return t.copy(le),t},this.toggleShadows=function(e){!!Y!=!!e&&(e?Y=new y.ShadowMaps(j):(Y.cleanup(H),Y=null),Ze(),this.invalidate(!0,!0,!1,!1))},this.showTransparencyWhenMoving=function(e){J.enableNonResumableFrames=e},this.fitToView=function(e,t){(t=!!t,0===e.length)&&(e=J.getModels().map((function(e){return{model:e,selection:[]}})));if(0===e.length)return!1;for(var i=0,n=0;n<e.length;++n){var r=e[n].model;if(!r)return!1;r.is2d()&&i++}return!!(i===e.length?this._fitToView2d(e,t):this._fitToView3d(e,t))&&(1===J.getModels().length&&this.api.dispatchEvent({type:L.FIT_TO_VIEW_EVENT,nodeIdArray:e[0].selection,immediate:t,model:e[0].model}),this.api.dispatchEvent({type:L.AGGREGATE_FIT_TO_VIEW_EVENT,selection:e,immediate:t}),!0)},this._fitToView2d=function(e,t){e.length>1&&f.logger.warn("fitToView() doesn't support multiple 2D models. Using the first one...");var i=e[0].model,n=e[0].selection,r=new P.Box3,o=new C.BoundsCallback(r);if(n&&0!==n.length)this.computeSelectionBounds(n,i,o);else if(this.api.anyLayerHidden())for(var s=i.getData().fragments,a=this.getVisibleLayerIndices(),l=0;l<s.length;l++)wt(i,l,a,o);else r=this.getFitBounds(!0);return!r.isEmpty()&&(this.api.navigation.fitBounds(t,r),!0)},this.computeSelectionBounds=function(e,t,i){var n;i||(i=new C.BoundsCallback(new P.Box3));var r=null===(n=t.getData().fragments)||void 0===n?void 0:n.dbId2fragId;if(r){for(var o=0;o<e.length;o++){var s=t.reverseMapDbIdFor2D(e[o]),a=r[s];if(Array.isArray(a))for(var l=0;l<a.length;l++)Mt(t,a[l],s,i);else"number"==typeof a&&Mt(t,a,s,i)}i.bounds.applyMatrix4(t.getPlacementTransform())}else i.bounds.copy(t.getBoundingBox());return i.bounds},this.get3DBounds=function(e){for(var t=!1,i=0;i<e.length;++i)if(e[i].selection.length>0){t=!0;break}var n=new P.Box3,r=new P.Box3;if(t)for(var o=0;o<e.length;++o){var s=e[o].selection;if(0!==s.length){var a=e[o].model,l=a.getInstanceTree(),c=a.getFragmentList();if(l)for(var h=0;h<s.length;++h){var u=parseInt(s[h]);l.enumNodeFragments(u,(function(e){c.getWorldBounds(e,r),n.union(r)}),!0)}}}else n.union(this.getVisibleBounds(!1,!1));return n},this.onModelTransformChanged=function(e){if(this.sceneUpdated(),e.isConsolidated())for(var t in i.selectionMeshes){var n=i.selectionMeshes[t];n.model===e&&(n.needsUpdate=!0)}this.invalidate(!0,!0,!0,!0),this.api.fireEvent({type:L.MODEL_TRANSFORM_CHANGED_EVENT,model:e,matrix:e.getModelTransform()})},this.setPlacementTransform=function(e,t){e.setPlacementTransform(t),this.api.fireEvent({type:L.MODEL_PLACEMENT_CHANGED_EVENT,model:e,matrix:e.getPlacementTransform()}),this.onModelTransformChanged(e)},this._fitToView3d=function(e,t){const i=this.get3DBounds(e);return!i.isEmpty()&&(this.api.navigation.fitBounds(t,i),!0)},this.onWebGLcontextLost=function(){j.enableContextRestore&&(this._reconsolidateOnRestore=(0,g.I5)(this.api)),this.stop(),this.api.fireEvent({type:L.WEBGL_CONTEXT_LOST_EVENT})},this.onWebGLcontextRestored=function(){(0,g.p1)(this.api,this._reconsolidateOnRestore),this._reconsolidateOnRestore=null,X.clearAllOverlays(),Z.setDirty(),Q&&Q.setDirty(),this.invalidate(!0,!0,!0,!0),this.run(),this.api.fireEvent({type:L.WEBGL_CONTEXT_RESTORED_EVENT})},this.modelVisible=function(e){return!!J.findModel(e)},this.handleInitialVisibility=function(e){var t=this.api;e.visibilityManager&&e.getObjectTree((function(i){var n=e.getFragmentList();if(!n.areAllVisible()){var r=[];i&&(i.enumNodeChildren(e.getRootId(),(function(e){i.enumNodeFragments(e,(function(e){return n.isFragVisible(e)}),!0)||i.isNodeHidden(e)||i.isNodeOff(e)||r.push(e)}),!0),r.length&&t.hide(r,e))}}))},this.changePaperVisibility=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(e.is3d())return void(null==n||n());const o=e.getFragmentList();if(!o)return void(null==n||n());if(e.paperVisibilityAnim&&(e.paperVisibilityAnim.stop(),e.paperVisibilityAnim=null),!i||!r)return e.changePaperVisibility(t),this.invalidate(!0),void(null==n||n());const s=-1,a=void 0!==o.dbIdOpacity[s]?o.dbIdOpacity[s]:t?0:1,l=t?1:0,c=r,h=e=>{e=Autodesk.Viewing.Private.smootherStep(e),o.setObject2DOpacity(s,e),this.invalidate(!0)},u=()=>{e.paperVisibilityAnim=null,null==n||n()};e.paperVisibilityAnim=Autodesk.Viewing.Private.fadeValue(a,l,c,h,u)},this._signalNoMeshes=function(){J.isEmpty()&&(this._geometryAvailable=0)},this._signalMeshAvailable=function(){0===this._geometryAvailable&&(this._geometryAvailable=1,this.api.fireEvent({type:L.RENDER_FIRST_PIXEL}))},this.hasModels=function(){return!J.isEmpty()},this.onLoadingAnimationChanged=function(e){j.setLoadingAnimationDuration(e?this.defaultLoadingAnimationDuration:-1),this.invalidate(!1,!0,!1,!1)},this.isLoadingAnimationEnabled=function(){return this.api.prefs.get(F.Prefs2D.LOADING_ANIMATION)&&(!this.model||this.model.is2d())},this.setMaxModelDistance=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e5;this.maxModelDistance=e},this._applyMaxModelDistanceToNearFar=function(){var e=this.camera;if(e.far<=e.near+this.maxModelDistance)return null;const t=e.near+this.maxModelDistance;const i=this.getVisibleBounds(!0,de,(function(i){return N.SceneMath.pointToBoxDistance2(e.position,i)<t*t}));this.updateNearFarValues(e,i)},this.consolidateModel=function(e,t){e.consolidate(H,t,j)},this.setDoNotCut=function(e,t){e.setDoNotCut(H,t)},this.setViewportBounds=function(e,t){e.setViewportBounds(H,t),this.invalidate(!0),this.api.fireEvent({type:L.MODEL_VIEWPORT_BOUNDS_CHANGED_EVENT,model:e,bounds:t})}}_e.prototype.constructor=_e,k.GlobalManagerMixin.call(_e.prototype)},63946:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ViewerState:()=>s});var n=i(49720),r=i(34345),o=i(35797);function s(e){this.getVisibleModel=function(t){const i=e.getVisibleModels();for(let e=0;e<i.length;++e){const n=i[e];if(this.getSeedUrn(n)===t)return n}},this.createObjectSets=function(t){var i=t.objectSet;Array.isArray(i)||(t.objectSet=i=[]);for(var n=e.getVisibleModels(),r=0;r<n.length;r++){var o=n[r],s=this.getSeedUrn(o),a=this.getSelectedNodes(o);i[r]={id:a,idType:"lmv"},n.length>1&&(i[r].seedUrn=s),o.is2d()?(i[r].isolated=this.getVisibleLayers2d(o),i[r].allLayers=this.areAllLayersVisible(o),i[r].hidden=[]):(i[r].isolated=e.getIsolatedNodes(o),i[r].hidden=e.getHiddenNodes(o),i[r].explodeScale=e.getExplodeScale())}},this.getState=function(t){var i=e.navigation,n={};n.seedURN=this.getSeedUrn(),this.createObjectSets(n);var r=n.viewport;r||(r=n.viewport={});var o=i.getCamera().isPerspective;r.name="",r.eye=i.getPosition().toArray(),r.target=i.getTarget().toArray(),r.up=i.getCameraUpVector().toArray(),r.worldUpVector=i.getWorldUpVector().toArray(),r.pivotPoint=i.getPivotPoint().toArray(),r.distanceToOrbit=i.getPivotPlaneDistance(),r.aspectRatio=this.getAspectRatio(),r.projection=o?"perspective":"orthographic",r.isOrthographic=!o,o?r.fieldOfView=i.getVerticalFov():r.orthographicHeight=this.getOrthographicHeight();var s=n.renderOptions;if(s||(s=n.renderOptions={}),s.environment=this.getEnvironmentName(),s.ambientOcclusion={enabled:e.impl.renderer().getAOEnabled(),radius:e.impl.renderer().getAORadius(),intensity:e.impl.renderer().getAOIntensity()},s.toneMap={method:e.impl.renderer().getToneMapMethod(),exposure:e.impl.renderer().getExposureBias(),lightMultiplier:this.getToneMapIntensity()},s.appearance={ghostHidden:e.impl.showGhosting,ambientShadow:e.prefs.get("ambientShadows"),antiAliasing:e.impl.renderer().settings.antialias,progressiveDisplay:e.prefs.get("progressiveRendering"),swapBlackAndWhite:e.prefs.get("swapBlackAndWhite"),displayLines:e.prefs.get("lineRendering"),displayPoints:e.prefs.get("pointRendering")},e.model&&!e.model.is2d())for(var a=n.cutplanes=[],l=e.impl.getCutPlaneSet("__set_view"),c=0;c<l.length;c++)a.push(l[c].toArray());for(var h in e.loadedExtensions){var u=e.loadedExtensions[h];u.getState&&u.getState(n)}return t&&true!==t&&this.applyFilter(n,t),n},this.restoreObjectSet=function(t){var i=t.objectSet;if(Array.isArray(i)&&0!==i.length){for(var n=[],r=[],o=[],s=e.model,a=0;a<i.length;++a){var l=i[a];if("lmv"===l.idType){var c=l.seedUrn;if(!c||(s=this.getVisibleModel(c))){var h=l.id;if(h&&(h=this.toIntArray(h),o.push({model:s,ids:h})),s.is2d()){var u=l.isolated;if(Array.isArray(u)&&u.length>0){e.setLayerVisible(null,!1);for(var d=0;d<u.length;++d)u[d]=parseInt(u[d]);e.impl.setLayerVisible(u,!0)}else l.allLayers||e.setLayerVisible(null,!1)}else{var p=l.isolated||[],f=l.hidden||[];p=this.toIntArray(p),n.push({model:s,ids:p}),0===p.length&&f.length>0&&(f=this.toIntArray(f),r.push({model:s,ids:f}))}if("explodeScale"in l){var m=parseFloat(l.explodeScale);e.explode&&e.explode(m)}}}}o.length>0&&e.impl.selector.setAggregateSelection(o),n.length>0&&e.impl.visibilityManager.aggregateIsolate(n,{hideLoadedModels:!1}),r.length>0&&e.impl.visibilityManager.aggregateHide(r)}},this.restoreState=function(t,i,r){if(!t)return n.logger.warn("restoreState has no viewer state to restore from."),!1;if(!e||!e.model)return n.logger.warn("restoreState has no viewer or model to restore."),!1;i&&true!==i&&(t=JSON.parse(JSON.stringify(t)),this.applyFilter(t,i));var o=e.navigation,s=!e.model.is2d();this.restoreObjectSet(t);var a=t.viewport;if(a){var l=this.getVector3FromArray(a.eye,o.getPosition()),c=this.getVector3FromArray(a.up,o.getCameraUpVector()),h=this.getVector3FromArray(a.target,o.getTarget()),u="fieldOfView"in a?parseFloat(a.fieldOfView):o.getVerticalFov(),d=this.getVector3FromArray(a.worldUpVector,null);if(!d){var p=e.model?e.model.getUpVector():null;d=p?(new THREE.Vector3).fromArray(p):new THREE.Vector3(0,1,0)}var f=this.getVector3FromArray(a.pivotPoint,o.getPivotPoint()),m=o.getCamera().isPerspective;"isOrthographic"in a&&(m=!a.isOrthographic);var g=this.getOrthographicHeight();"orthographicHeight"in a&&(g=Number(a.orthographicHeight));var v={position:l,target:h,up:c,worldup:d,aspect:e.impl.camera.aspect,fov:u,orthoScale:g,isPerspective:m,pivot:f};this.restoreCameraState(v,r)}var y=t.renderOptions;if(y){var b=e.impl.renderer(),x=e.prefs,_=x.get("ambientShadows"),E=x.get("antialiasing"),A=y.ambientOcclusion;if(A){"enabled"in A&&(_=A.enabled);var S="radius"in A?A.radius:null,w="intensity"in A?A.intensity:null;null!==S&&null!==w&&(S===b.getAORadius()&&w===b.getAOIntensity()||(b.setAOOptions(S,w),b.composeFinalFrame()))}if("environment"in y){var M=this.getLightPresetIndex(y.environment);-1!==M&&M!==x.get("lightPreset")&&s&&e.setLightPreset(M)}var T=y.toneMap;if(T){var C=!1,P="exposure"in T?T.exposure:null,D="lightMultiplier"in T?T.lightMultiplier:null;null!==P&&P!==b.getExposureBias()&&(b.setTonemapExposureBias(P),C=!0),null!==D&&e.impl.dir_light1&&D!==this.getToneMapIntensity()&&(e.impl.dir_light1.intensity=Math.pow(2,D),C=!0),C&&e.impl.invalidate(!0)}var L=y.appearance;L&&("antiAliasing"in L&&(E=L.antiAliasing),"progressiveDisplay"in L&&L.progressiveDisplay!==x.get("progressiveRendering")&&e.setProgressiveRendering(L.progressiveDisplay),"swapBlackAndWhite"in L&&L.swapBlackAndWhite!==x.get("swapBlackAndWhite")&&e.setSwapBlackAndWhite(L.swapBlackAndWhite),"ghostHidden"in L&&L.ghostHidden!==x.get("ghosting")&&s&&e.setGhosting(L.ghostHidden),"displayLines"in L&&L.displayLines!==x.get("lineRendering")&&e.hideLines(!L.displayLines),"displayPoints"in L&&L.displayPoints!==x.get("pointRendering")&&e.hidePoints(!L.displayPoints)),s&&_!==x.get("ambientShadows")&&E!==x.get("antialiasing")&&e.setQualityLevel(_,E)}if(Array.isArray(t.cutplanes)&&e.model&&s){for(var I=[],R=0;R<t.cutplanes.length;R++){var O=t.cutplanes[R];Array.isArray(O)&&O.length>=4&&I.push(new THREE.Vector4(O[0],O[1],O[2],O[3]))}!function(t,i){if(e.getExtension("Autodesk.AEC.LevelsExtension")&&void 0===t.floorGuid){const e=i.length;if(3===e||8===e){const t=i[e-2],n=i[e-1];0===t.x&&0===t.y&&-1===t.z&&0===n.x&&0===n.y&&1===n.z&&i.splice(-2,2)}}}(t,I),e.impl.setCutPlaneSet("__set_view",I)}for(var N in e.loadedExtensions){var k=e.loadedExtensions[N];k.restoreState&&k.restoreState(t,r)}return!0},this.getEnvironmentName=function(){var t=r.LightPresets[e.impl.currentLightPreset()];return t?t.name:"none"},this.restoreCameraState=function(t,i){e.impl.adjustOrthoCamera(t);var n=e.navigation;i?(t.isPerspective?n.toPerspective():n.toOrthographic(),n.setCameraUpVector(t.up),n.setWorldUpVector(t.worldup),n.setView(t.position,t.target),n.setPivotPoint(t.pivot),n.setVerticalFov(t.fov,!1),e.impl.syncCamera(!0)):(e.impl.camera.isPerspective=t.isPerspective,n.setRequestTransitionWithUp(!0,t.position,t.target,t.fov,t.up,t.worldup,t.pivot))},this.areEqual=function(e,t,i){function n(e,t){if(t=t||[],(e=e||[]).length!==t.length)return!1;for(var i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}function r(e,t,i){return t=t||[],(e=e||[]).length===t.length&&(0!==e.length&&(o(e[0],t[0],i)||o(e[1],t[1],i)||o(e[2],t[2],i)))}function o(e,t,i){var n=e?parseFloat(e):null,r=e?parseFloat(t):null;return"number"===typeof n&&"number"===typeof r?Math.abs(e-t)<i:(e=e||null)===(t=t||null)}var s=e,a=t,l=1e-9;if(i&&!0!==i&&(s=this.applyFilter(s,i),a=this.applyFilter(a,i)),s.seedURN!==a.seedURN)return!1;var c=s.objectSet||[],h=a.objectSet||[];if(c.length!==h.length)return!1;var u=c[0]||{},d=h[0]||{};if(!(u.idType===d.idType&&o(u.explodeScale,d.explodeScale,l)&&n(u.id,d.id)&&n(u.isolated,d.isolated)&&n(u.hidden,d.hidden)))return!1;var p=s.viewport||{},f=a.viewport||{};return!!(p.name===f.name&&p.projection===f.projection&&p.isOrthographic===f.isOrthographic&&o(p.distanceToOrbit,f.distanceToOrbit,l)&&o(p.fieldOfView,f.fieldOfView,l)&&o(p.orthographicHeight,f.orthographicHeight,l)&&r(p.eye,f.eye,l)&&r(p.target,f.target,l)&&r(p.up,f.up,l)&&r(p.worldUpVector,f.worldUpVector,l)&&r(p.pivotPoint,f.pivotPoint,l))},this.toIntArray=function(e){var t=[];if(Array.isArray(e))for(var i=0,n=e.length;i<n;++i)t.push(parseInt(e[i]));return t},this.getVector3FromArray=function(e,t){return e instanceof Array&&e.length>2?(e[0]=parseFloat(e[0]),e[1]=parseFloat(e[1]),e[2]=parseFloat(e[2]),(new THREE.Vector3).fromArray(e)):t},this.getSelectedNodes=function(t){return(t=t||e.model).selector?t.selector.getSelection():[]},this.getVisibleLayers2d=function(t){return t&&t!==e.model?(n.logger.warn("[getVisibleLayers2d] multiple models not yet supported."),[]):e.impl.getVisibleLayerIndices()},this.areAllLayersVisible=function(t){return t&&t!==e.model?(n.logger.warn("[areAllLayersVisible] multiple models not yet supported."),!0):e.impl.layers.allLayersVisible()},this.getAspectRatio=function(){var t=e.navigation.getScreenViewport();return t.width/t.height},this.getOrthographicHeight=function(){var t=e.navigation.getCamera();return t.isPerspective?0:Math.abs(2*t.orthographicCamera.top)},this.getSeedUrn=function(t){var i;return(null===(i=t=t||e.model)||void 0===i?void 0:i.getSeedUrn())||""},this.getToneMapIntensity=function(){var t=0;return e.impl.dir_light1&&(t=0!=e.impl.dir_light1.intensity?Math.log(e.impl.dir_light1.intensity)/Math.log(2):-1e-20),t},this.getLightPresetIndex=function(e){for(var t=0;t<r.LightPresets.length;t++)if(r.LightPresets[t].name===e)return t;return-1},this.applyFilter=function(e,t){if(!0!==t)for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=t[i];void 0===r?delete e[i]:"boolean"==typeof r?!1===r&&delete e[i]:r instanceof Object?e[i]instanceof Object?this.applyFilter(e[i],t[i]):n.logger.warn("[applyFilter] A - Invalid filter Object for key ["+i+"]"):n.logger.warn("[applyFilter] B - Invalid filter value for key ["+i+"]")}},this.normalizeCoordinates=function(t){var i=t.viewport;if(i){if(i.normalized)return void n.logger.warn("invalid normalization of state.viewport. Ignoring command.");i.normalized=!0;if(a(i,o.SceneMath.getNormalizingMatrix(e.model)),"orthographicHeight"in i){var r=e.model.myData.bbox,s=r.max.y-r.min.y,l=i.orthographicHeight/s;i.orthographicHeight=l}}},this.denormalizeCoordinates=function(t){var i=t.viewport;if(i){if(!i.normalized)return void n.logger.warn("invalid denormalization of state.viewport. Ignoring command.");delete i.normalized;if(a(i,o.SceneMath.getNormalizingMatrix(e.model).clone().invert()),"orthographicHeight"in i){var r=e.model.myData.bbox,s=r.max.y-r.min.y,l=i.orthographicHeight*s;i.orthographicHeight=l}}}}function a(e,t){var i=new THREE.Vector3(e.eye[0],e.eye[1],e.eye[2]),n=new THREE.Vector3(e.pivotPoint[0],e.pivotPoint[1],e.pivotPoint[2]),r=new THREE.Vector3(e.target[0],e.target[1],e.target[2]);i.applyMatrix4(t),n.applyMatrix4(t),r.applyMatrix4(t),e.eye[0]=i.x,e.eye[1]=i.y,e.eye[2]=i.z,e.pivotPoint[0]=n.x,e.pivotPoint[1]=n.y,e.pivotPoint[2]=n.z,e.target[0]=r.x,e.target[1]=r.y,e.target[2]=r.z}s.prototype.constructor=s},77693:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BubbleNode:()=>r});var n=1;var r=function(e,t){if(this.parent=t,this.id=n++,this.data=e,this.isLeaf="geometry"===e.type&&("3d"===e.role||"2d"===e.role||"lod"===e.role),Array.isArray(e.children)||Array.isArray(e.derivatives)){this.children=[];for(var i=e.children||e.derivatives,o=i.length,s=0;s<o;s++)this.children[s]=new r(i[s],this);this.children.length>1&&this.children.sort(((e,t)=>Object.prototype.hasOwnProperty.call(e.data,"order")&&Object.prototype.hasOwnProperty.call(t.data,"order")?e.data.order-t.data.order:0));for(let e=0;e<o;e++){var a="application/autodesk-db"==(l=i[e]).mime&&l.urn?0===l.urn.indexOf("urn:adsk.objects:os.object")?l.urn.substr(0,l.urn.lastIndexOf("%2F")+3):l.urn.substr(0,l.urn.lastIndexOf("/")+1):null;a&&(this.sharedPropertyDbPath=a),"lod"===i[e].role&&(this.lodNode=this.children[e])}}var l};r.prototype.constructor=r,r.prototype.setDocument=function(e){this.lmvDocument=e},r.prototype.getDocument=function(){let e=this;for(;e.parent;)e=e.parent;return e.lmvDocument},r.prototype.isOtg=function(){return!!this._getOtgManifest()},r.prototype._getOtgManifest=function(){if("undefined"!=typeof DISABLE_OTG&&DISABLE_OTG)return null;var e=this.findViewableParent();return e?e.data.otg_manifest:null},r.prototype.isSVF2=function(){var e,t=this._getOtgManifest();return Boolean("cacheable"===(null==t||null===(e=t.paths)||void 0===e?void 0:e.pharos_type))},r.prototype.getOtgGraphicsNode=function(){if(this.isViewPreset())return this.findParentGeom2Dor3D().getOtgGraphicsNode();var e=this._getOtgManifest();return e&&e.views&&e.views[this.guid()]},r.prototype.getPropertyDbManifest=function(){var e,t=this._getOtgManifest();if(t&&t.pdb_manifest){var i=t.pdb_manifest;e={propertydb:{},isOtg:!0};for(var n=0;n<i.assets.length;n++){var r,o=i.assets[n];r=o.isShared?t.paths.shared_root+i.pdb_shared_rel_path:t.paths.version_root+i.pdb_version_rel_path,e.propertydb[o.tag]=[{path:r+o.uri,isShared:o.isShared}]}this.getOtgGraphicsNode()||(e.needsDbIdRemap=!0)}else{let t=this.findPropertyDbPath();null===t&&(console.warn("Missing property database entry in manifest."),t=""),0===t.indexOf("$file$")&&(console.warn("Bubble local path given for shared property DB files. Assuming that sharedPropertyDbPath is specified correctly by loadDocumentNode()."),t="");const i=this.getDocument();i&&0===t.indexOf("urn")&&(t=i.getFullPath(t)),e={propertydb:{attrs:[{path:t+"objects_attrs.json.gz"}],values:[{path:t+"objects_vals.json.gz"}],avs:[{path:t+"objects_avs.json.gz"}],offsets:[{path:t+"objects_offs.json.gz"}],ids:[{path:t+"objects_ids.json.gz"}]}}}return e},r.prototype.getRootNode=function(){return this.parent?this.parent.getRootNode():this},r.prototype.isForgeManifest=function(){return"manifest"===this.getRootNode().data.type},r.prototype.findPropertyDbPath=function(){var e=this._getOtgManifest(),t=e&&e.pdb_manifest;return t&&t.assets&&t.assets.length?e.paths.version_root+e.pdb_manifest.pdb_version_rel_path:(e&&console.warn("Unexpected: OTG manifest exists, but it has no property database manifest."),this.sharedPropertyDbPath?this.sharedPropertyDbPath:this.parent?this.parent.findPropertyDbPath():null)},r.prototype._raw=function(){return this.data},r.prototype.name=function(){return this.data.name||""},r.prototype.guid=function(){return this.data.guid},r.prototype.type=function(){return this.data.type},r.prototype.extensions=function(){if(this.data.extensions)return Array.isArray(this.data.extensions)?this.data.extensions:[this.data.extensions]},r.prototype.urn=function(e){var t=this.data.urn;if(!e)return t;for(var i=this.parent;!t&&i;)t=i.data.urn,i=i.parent;return t},r.prototype.lineageUrn=function(e){const t=this.getRootNode().urn();let i=r.parseLineageUrnFromEncodedUrn(t);return e&&(i=Autodesk.Viewing.toUrlSafeBase64(i)),i},r.parseLineageUrnFromEncodedUrn=function(e){if(!e)return null;const t=e.split("/");let i=null;for(let e=t.length-1;e>=0;e--){var n;try{i=Autodesk.Viewing.fromUrlSafeBase64(t[e])}catch(e){}if(-1!=(null===(n=i)||void 0===n?void 0:n.indexOf("file:")))break;i=null}return r.parseLineageUrnFromDecodedUrn(i)},r.parseLineageUrnFromDecodedUrn=function(e){if(!e)return null;const t=(e=e.replace("fs.file:vf.","dm.lineage:")).indexOf("?version");return e.substring(0,t)},r.prototype.isGeomLeaf=function(){return this.isLeaf},r.prototype.isViewable=function(){return"viewable"===this.data.role||"svf"===this.data.outputType},r.prototype.getLodNode=function(){return this.lodNode},r.prototype.isGeometry=function(){return"geometry"===this.data.type},r.prototype.isViewPreset=function(){return"view"===this.data.type},r.prototype.is2D=function(){return"2d"===this.data.role},r.prototype.is3D=function(){return"3d"===this.data.role},r.prototype.is2DGeom=function(){return this.isGeometry()&&this.is2D()},r.prototype.is3DGeom=function(){return this.isGeometry()&&this.is3D()},r.prototype.useAsDefault=function(){return!0===this.data.useAsDefault},r.prototype.getDefaultGeometry=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i=[];if(e){let e=this.search(r.MASTER_VIEW_NODE);e.length&&(i=e[0].search({type:"geometry"}))}0==i.length&&(i=this.search({type:"geometry"})),t&&i.sort((function(e,t){return t.data.size-e.data.size}));for(var n=0;n<i.length;++n)if(i[n].useAsDefault())return i[n];return i[0]},r.prototype.getPlacementTransform=function(){return console.warn("BubbleNode.getPlacementTransform is deprecated. Sheet placement information is stored in AECModelData.json"),null},r.prototype.getHash=function(){return console.warn("BubbleNode.getHash is deprecated and will be removed in a future release."),null},r.prototype.getViewBox=function(){return this.data.viewbox},r.prototype.isMetadata=function(){if(this.data.role){if(-1!==this.data.role.indexOf("Autodesk.CloudPlatform.DesignDescription"))return!0;if("Autodesk.CloudPlatform.PropertyDatabase"===this.data.role)return!0}return!1},r.prototype.findViewableParent=function(){for(var e=null,t=this;t;)t.isViewable()&&(e=t),t=t.parent;if(!e&&!this.parent&&this.children)for(var i=0;i<this.children.length;i++){var n=this.children[i];if(n.isViewable()){e=n;break}}return e},r.prototype.findParentGeom2Dor3D=function(e){for(var t=this;t&&!t.is2DGeom()&&!t.is3DGeom();)t=t.parent;!t&&this.isViewPreset()&&(t=this.findGeometryFromSiblings()[0],e&&e.fallbackParent&&(t=e.fallbackParent));return t},r.prototype.findGeometryFromSiblings=function(){var e=this.parent;if(!e)return[];for(var t=[],i=0,n=e.children.length;i<n;++i){var r,o=e.children[i];if(o!==this)o.traverse((e=>{if(e.isGeometry()&&(e.is2D()||e.is3D()))return r=e,!0})),r&&t.push(r)}return t},r.prototype.findAllViewables=function(){var e=[];this.isForgeManifest()&&(e=this.search({outputType:"svf"}));var t=this.search({role:"viewable"});return e.concat(t)},r.prototype.getViewableRootPath=function(e){var t=this.getOtgGraphicsNode();if(t&&t.urn&&!t.error)return this._getOtgManifest().paths.version_root+t.urn;if(!this.isGeomLeaf())return this.urn();if(this.is2D()){if(!e){var i=this.search({role:"leaflet"});if(i&&i.length)return i[0].urn()}const t=this.search(r.PDF_PAGE_NODE);if(null!=t&&t.length)return t[0].urn()}var n=this.is2D()?"application/autodesk-f2d":"application/autodesk-svf",o=this.search({mime:n});return o&&o.length?o[0].urn():null},r.prototype.getNamedViews=function(){var e=this.search({type:"view"});return e=e.filter((function(e){return!!e.data.name&&!!Array.isArray(e.data.camera)}))},r.prototype.findByGuid=function(e){var t=null;return this.traverse((function(i){if(i.data.guid===e)return t=i,!0})),t},r.prototype.search=function(e){var t=[];return this.traverse((function(i){var n=!0;for(var r in e)if(!Object.prototype.hasOwnProperty.call(i.data,r)||i.data[r]!==e[r]){n=!1;break}n&&t.push(i)})),t},r.prototype.traverse=function(e){if(e(this))return!0;if(this.children)for(var t=0;t<this.children.length;t++)if(this.children[t].traverse(e))return!0;return!1},r.prototype.getShallowCopySource=function(e){if(!this.isViewable())return console.error("getShallowCopySource must be called with a viewable node."),null;e||(e=this.parent.urn());var t=this.urn();return t!==e&&(t?(console.log(`Redirecting shallow copied URN ${e} to ${t}`),e=t):console.warn(`Unexpected: manifest viewable node does not have a urn property.\n${JSON.stringify(this._raw())}`)),e},r.prototype.getAecModelData=function(){var e=this.findViewableParent();if(!e)return null;if(!e.data.aec_model_data){var t=this.getRootNode().search({role:"Autodesk.AEC.ModelData"})[0];return Boolean(t)&&console.warn("Use Document.getAecModelData(bubbleNode) instead of BubbleNode.getAecModelData(), or make sure Document.downloadAecModelData is loaded before using this API"),null}return e.data.aec_model_data},r.prototype.extractRefPointTransform=function(){var e=this.getAecModelData();return e&&e.refPointTransformation&&r.readMatrixFromArray12(e.refPointTransformation)},r.prototype.extractCamera=function(){if(this.data.camera)return r.readCameraFromArray(this.data.camera);var e=this.isGeometry()&&this.search({type:"view"})[0];return e?e.extractCamera():null},r.prototype.getLevel=function(){var e=this.data.levelNumber;return Array.isArray(e)?e[0]:e},r.prototype.getLevelName=function(){return this.data.levelName||this.getLevel()},r.prototype.isSheet=function(){let e=this.parent;for(;e;){if("Sheets"===e.name())return!0;e=e.parent}return!1},r.prototype.isMasterView=function(){const e=r.MASTER_VIEW_NODE.name;let t=this;for(;t;){if(t.name()===e)return!0;t=t.parent}return!1},r.prototype.getModelName=function(){const e=this.getRootNode().children[0];return null==e?void 0:e.name()},r.prototype.getInputFileType=function(){var e;const t=null===(e=this.getRootNode().children)||void 0===e?void 0:e[0];return null==t?void 0:t.data.inputFileType},r.prototype.isRevitPdf=function(){return!(!this.data.isVectorPDF||"rvt"!==this.getInputFileType())},r.prototype.isSmartPdf=function(){return!(!this.data.isVectorPDF||"pdf"===this.getInputFileType())},r.prototype.getModelKey=function(){const e=`${this.getViewableRootPath()}${this.originModel}${this.guid()}`;return decodeURIComponent(e)},r.readCameraFromArray=function(e,t){if(!Array.isArray(e))return null;if(t&&!t.elements){t instanceof THREE.Vector3||(t=(new THREE.Vector3).copy(t));var i=new THREE.Matrix4;i.setPosition(t),t=i}var n={position:new THREE.Vector3(e[0],e[1],e[2]),target:new THREE.Vector3(e[3],e[4],e[5]),up:new THREE.Vector3(e[6],e[7],e[8]),aspect:e[9],fov:THREE.Math.radToDeg(e[10]),orthoScale:e[11],isPerspective:!e[12]};return t&&(n.position.applyMatrix4(t),n.target.applyMatrix4(t),n.up.transformDirection(t)),0===e[10]&&1===e[11]&&1===e[12]&&(n.orthoScale=n.position.distanceTo(n.target)),n},r.readMatrixFromArray12=function(e){return(new THREE.Matrix4).fromArray([e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,e[9],e[10],e[11],1])},r.prototype.getSourceFileUnits=function(){return this.data.units};r.prototype.getMasterViews=function(){const e=this.getRootNode().search({name:"08f99ae5-b8be-4f8d-881b-128675723c10"});return e&&e.length>0&&e[0].children||[]},r.prototype.getMasterView=function(e){return this.getMasterViews().find((t=>t.data.phaseNames===e))},r.prototype.get3DModelNodes=function(){return this.search(r.MODEL_NODE)},r.prototype.getSheetNodes=function(){return this.search(r.SHEET_NODE)},r.MODEL_NODE={role:"3d",type:"geometry"},r.GEOMETRY_SVF_NODE={role:"graphics",mime:"application/autodesk-svf"},r.SHEET_NODE={role:"2d",type:"geometry"},r.LEAFLET_NODE={role:"leaflet"},r.PDF_PAGE_NODE={role:"pdf-page"},r.IMAGE_NODE={role:"image"},r.GEOMETRY_F2D_NODE={role:"graphics",mime:"application/autodesk-f2d"},r.VIEWABLE_NODE={role:"viewable"},r.AEC_MODEL_DATA={role:"Autodesk.AEC.ModelData"},r.MASTER_VIEW_NODE={name:"08f99ae5-b8be-4f8d-881b-128675723c10"}},16840:(e,t,i)=>{"use strict";var n;function r(){return"undefined"!=typeof window&&null!==window?window:"undefined"!=typeof self&&null!==self?self:i.g}i.r(t),i.d(t,{ObjectAssign:()=>L,disableDocumentTouchSafari:()=>R,enableDocumentTouchSafari:()=>O,exitFullscreen:()=>d,fullscreenElement:()=>f,getAndroidVersion:()=>y,getGlobal:()=>r,getIOSVersion:()=>v,inFullscreen:()=>p,isAndroidDevice:()=>A,isBrowser:()=>a,isChrome:()=>C,isFirefox:()=>T,isFullscreenAvailable:()=>m,isFullscreenEnabled:()=>g,isIE11:()=>c,isIE11Only:()=>h,isIOSDevice:()=>_,isMac:()=>P,isMobileDevice:()=>S,isNodeJS:()=>l,isPhoneFormFactor:()=>w,isSafari:()=>M,isTouchDevice:()=>b,isWindows:()=>D,launchFullscreen:()=>u,touchStartToClick:()=>N});const o=r(),s=o&&o.document,a="undefined"!=typeof navigator,l=function(){return!a};let c=a&&!!navigator.userAgent.match(/Edge|Trident\/7\./),h=a&&!!navigator.userAgent.match(/Trident\/7\./);function u(e,t){e.requestFullscreen?e.requestFullscreen(t):e.mozRequestFullScreen?e.mozRequestFullScreen(t):e.webkitRequestFullscreen?e.webkitRequestFullscreen(t):e.msRequestFullscreen&&e.msRequestFullscreen(t)}function d(e){p(e)&&(e.exitFullscreen?e.exitFullscreen():e.mozCancelFullScreen?e.mozCancelFullScreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.msExitFullscreen&&e.msExitFullscreen())}function p(e){return"webkitIsFullScreen"in e?!!e.webkitIsFullScreen:"fullscreenElement"in e?!!e.fullscreenElement:"mozFullScreenElement"in e?!!e.mozFullScreenElement:"msFullscreenElement"in e?!!e.msFullscreenElement:!!e.querySelector(".viewer-fill-browser")}function f(e){return e.fullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||e.msFullscreenElement}function m(e){return e.requestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen||e.msRequestFullscreen}function g(e){return e.fullscreenEnabled||e.webkitFullscreenEnabled||e.mozFullScreenEnabled||e.msFullscreenEnabled}function v(e){var t=(e=e||navigator.userAgent).match(/OS ((\d+)_(\d+)(_(\d+))?) like Mac OS X/);return!t&&_()&&(t=e.match(/\/((\d+)\.(\d+)(\.\d)?) Safari\//)),t?t[1].replace("_","."):""}function y(e){var t=(e=e||navigator.userAgent).match(/Android\s([0-9\.]*)/);return!!t&&t[1]}function b(){return"undefined"!=typeof window&&("ontouchstart"in window||navigator.maxTouchPoints>0)}"undefined"!=typeof window&&c&&function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=s.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}e.prototype=o.CustomEvent.prototype,o.CustomEvent=e}(),ArrayBuffer.prototype.slice||(ArrayBuffer.prototype.slice=function(e,t){if(!t||t>this.byteLength?t=this.byteLength:t<0&&(t=this.byteLength+t)<0&&(t=0),e<0&&(e=this.byteLength+e)<0&&(e=0),t<=e)return new ArrayBuffer;for(var i=t-e,n=new Uint8Array(this,e,i),r=new Uint8Array(i),o=0;o<i;o++)r[o]=n[o];return r.buffer}),Math.log2=Math.log2||function(e){return Math.log(e)/Math.LN2},"undefined"!=typeof window&&(o.BlobBuilder=o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder);const x=a&&(/ip(ad|hone|od)/.test(navigator.userAgent.toLowerCase())||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/^ip(ad|hone|od)$/.test(null===(n=navigator.platform)||void 0===n?void 0:n.toLowerCase()));function _(){return x}const E=a&&-1!==navigator.userAgent.toLowerCase().indexOf("android");function A(){return E}function S(){return!!a&&(_()||A())}function w(){return S()&&(o.matchMedia("(max-width: 750px)").matches||o.matchMedia("(max-height: 750px)").matches)}function M(){if(!a)return!1;var e=navigator.userAgent.toLowerCase();return-1!==e.indexOf("safari")&&-1===e.indexOf("chrome")}function T(){return!!a&&-1!==navigator.userAgent.toLowerCase().indexOf("firefox")}function C(){return!!a&&-1!==navigator.userAgent.toLowerCase().indexOf("chrome")}function P(){return!!a&&(-1!==navigator.userAgent.toLowerCase().indexOf("mac os")&&!_())}function D(){if(!a)return!1;var e=navigator.userAgent.toLowerCase();return-1!==e.indexOf("win32")||-1!==e.indexOf("windows")}function L(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function I(e){var t=o.hasOwnProperty("pageXOffset")?o.pageXOffset:s.documentElement.scrollLeft,i=o.hasOwnProperty("pageYOffset")?o.pageYOffset:s.documentElement.scrollTop,n=void 0===e.pageX?e.changedTouches[0].pageX:e.pageX,r=void 0===e.pageY?e.changedTouches[0].pageY:e.pageY,a=s.elementFromPoint(n-t,r-i);return!a||"CANVAS"!==a.nodeName||("true"!==a.getAttribute("data-viewer-canvas")||(e.preventDefault(),!1))}function R(){S()&&M()&&(s.documentElement.addEventListener("touchstart",I,!0),s.documentElement.addEventListener("touchmove",I,!0),s.documentElement.addEventListener("touchcanceled",I,!0),s.documentElement.addEventListener("touchend",I,!0))}function O(){S()&&M()&&(s.documentElement.removeEventListener("touchstart",I,!0),s.documentElement.removeEventListener("touchmove",I,!0),s.documentElement.removeEventListener("touchcanceled",I,!0),s.documentElement.removeEventListener("touchend",I,!0))}function N(e){e.target.className&&(e.target.className.indexOf("fullscreen")>-1||e.target.className.indexOf("webvr")>-1||e.target.className.indexOf("webxr")>-1)||(e.preventDefault(),e.stopPropagation(),e.target.click())}!function(){var e=r();e.performance||(e.performance=Date)}(),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},String.prototype.repeat=String.prototype.repeat||function(e){if(e<1)return"";for(var t="",i=this.valueOf();e>1;)1&e&&(t+=i),e>>=1,i+=i;return t+i},Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,(function(i,n){return Array.isArray(n)?i.push.apply(i,e.call(n,t-1)):i.push(n),i}),[]):Array.prototype.slice.call(this)}}),Array.prototype.fill||Object.defineProperty(Array.prototype,"fill",{enumerable:!1,value:function(e,t,i){t=void 0===t?0:t,i=void 0===i?this.length:i;for(var n=t;n<i;++n)this[n]=e}}),Int32Array.prototype.lastIndexOf=Int32Array.prototype.lastIndexOf||function(e,t){return Array.prototype.lastIndexOf.call(this,e,t)},Array.prototype.find||Object.defineProperty(Array.prototype,"find",{enumerable:!1,value:function(e,t){for(var i=this.length,n=0;n<i;++n){var r=this[n];if(e.call(t,r,n,this))return r}}}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])}return i},writable:!0,configurable:!0}),"undefined"==typeof window||!c&&!_()||HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(e,t,i){var n=this;setTimeout((function(){for(var r=atob(n.toDataURL(t,i).split(",")[1]),o=r.length,s=new Uint8Array(o),a=0;a<o;a++)s[a]=r.charCodeAt(a);e(new Blob([s],{type:t||"image/png"}))}))}}),Uint8Array.prototype.slice||(Uint8Array.prototype.slice=function(e,t){if(t=void 0!==t?t:this.length,"[object Array]"===Object.prototype.toString.call(this))return _slice.call(this,e,t);var i,n,r=[],o=this.length,s=e||0;s=s>=0?s:Math.max(0,o+s);var a="number"==typeof t?Math.min(t,o):o;if(t<0&&(a=o+t),(n=a-s)>0)if(r=new Array(n),this.charAt)for(i=0;i<n;i++)r[i]=this.charAt(s+i);else for(i=0;i<n;i++)r[i]=this[s+i];return r})},53005:(e,t,i)=>{"use strict";i.r(t),i.d(t,{EnvironmentConfigurations:()=>H,Initializer:()=>ee,getUpstreamApiData:()=>W,getWebGLHelpLink:()=>g,initializeAuth:()=>Q,initializeEnvironmentVariable:()=>j,initializeLogger:()=>J,initializeResourceRoot:()=>X,initializeServiceEndPoints:()=>q,refreshCookie:()=>Y,refreshRequestHeader:()=>K,refreshToken:()=>Z,shutdown:()=>te,token:()=>f});var n=i(43644),r=i(49720),o=i(75121),s=i(16840),a=i(85218),l=i(32154),c=i(63740),h=i(36291),u=(0,s.getGlobal)();const d=u;var p={accessToken:null,getAccessToken:null,tokenRefreshInterval:null};let f=p,m=null;function g(){return m}var v={local:{RTC:["https://rtc-dev.api.autodesk.com:443","https://lmv.autodesk.com:443"]},dev:{RTC:["https://rtc-dev.api.autodesk.com:443","https://lmv.autodesk.com:443"]},stg:{RTC:["https://rtc-stg.api.autodesk.com:443","https://lmv.autodesk.com:443"]},prod:{RTC:["https://rtc.api.autodesk.com:443","https://lmv.autodesk.com:443"]}},y="",b="";if((0,s.getGlobal)().location){var x=(0,s.getGlobal)().location;b=x.protocol+"//"+x.hostname,y=x.protocol+"//"+x.host}var _={local:"",dev:"https://developer-dev.api.autodesk.com",stg:"https://developer-stg.api.autodesk.com",prod:"https://developer.api.autodesk.com"},E="https://us.otgs-dev.autodesk.com",A="https://us.otgs-stg.autodesk.com",S="https://us.otgs.autodesk.com",w="https://eu.otgs-stg.autodesk.com",M="https://eu.otgs.autodesk.com",T="https://cdn-dev.derivative.autodesk.com",C="https://cdn-dev.derivative.autodesk.com/regions/eu",P="https://cdn-stg.derivative.autodesk.com",D="https://cdn-stg.derivative.autodesk.com/regions/eu",L="https://cdn.derivative.autodesk.com",I="https://cdn.derivative.autodesk.com/regions/eu",R="https://cdn-dev.derivative.autodesk.com",O="https://cdn-stg.derivative.autodesk.com",N="https://cdn.derivative.autodesk.com",k="https://cdn-stg-fips.derivative.autodesk.com",F="https://cdn-fips.derivative.autodesk.com",V="https://api-stg.afg.us.autodesk.com",U="https://api.afg.us.autodesk.com",B="derivativeV2",z="derivativeV2_EU",G="derivativeV2_Fedramp";let H=Object.freeze({Local:{ROOT:"",LMV:v.local},Development:{ROOT:R,LMV:v.dev,bubbleManifest:!0},Staging:{ROOT:O,LMV:v.stg,bubbleManifest:!0},Production:{ROOT:N,LMV:v.prod,bubbleManifest:!0},AutodeskDevelopment:{ROOT:R,LMV:v.dev},AutodeskStaging:{ROOT:O,LMV:v.stg},AutodeskProduction:{ROOT:N,LMV:v.prod},AutodeskDevelopment2:{ROOT:R,LMV:v.dev,UPSTREAM:_.dev,UPSTREAM_API_DATA:B},AutodeskStaging2:{ROOT:O,LMV:v.stg,UPSTREAM:_.stg,UPSTREAM_API_DATA:B},AutodeskProduction2:{ROOT:N,LMV:v.prod,UPSTREAM:_.prod,UPSTREAM_API_DATA:B},FluentLocal:{ROOT:y,LMV:y},FluentDev:{ROOT:E,LMV:v.dev,UPSTREAM:_.stg,UPSTREAM_API_DATA:B},FluentStaging:{ROOT:A,LMV:v.stg,UPSTREAM:_.stg,UPSTREAM_API_DATA:B},FluentProduction:{ROOT:S,LMV:v.prod,UPSTREAM:_.prod,UPSTREAM_API_DATA:B},FluentStagingEU:{ROOT:w,LMV:v.stg,UPSTREAM:_.stg,UPSTREAM_API_DATA:z},FluentProductionEU:{ROOT:M,LMV:v.prod,UPSTREAM:_.prod,UPSTREAM_API_DATA:z},MD20DevUS:{ROOT:T,LMV:v.dev,UPSTREAM:_.dev,UPSTREAM_API_DATA:B},MD20DevEU:{ROOT:C,LMV:v.dev,UPSTREAM:_.dev,UPSTREAM_API_DATA:z},MD20StgUS:{ROOT:P,LMV:v.stg,UPSTREAM:_.stg,UPSTREAM_API_DATA:B},MD20StgEU:{ROOT:D,LMV:v.stg,UPSTREAM:_.stg,UPSTREAM_API_DATA:z},MD20ProdUS:{ROOT:L,LMV:v.prod,UPSTREAM:_.prod,UPSTREAM_API_DATA:B},MD20ProdEU:{ROOT:I,LMV:v.prod,UPSTREAM:_.prod,UPSTREAM_API_DATA:z},D3SLocalUS:{ROOT:y,LMV:y,UPSTREAM:y,UPSTREAM_API_DATA:B},D3SLocalEU:{ROOT:y,LMV:y,UPSTREAM:y,UPSTREAM_API_DATA:z},Test:{ROOT:`${b}:3000`,LMV:v.dev},FedrampStaging2:{ROOT:k,LMV:v.stg,UPSTREAM:V,UPSTREAM_API_DATA:G},FedrampProduction2:{ROOT:F,LMV:v.prod,UPSTREAM:U,UPSTREAM_API_DATA:G}});function W(e,t){return e.endsWith("EU")?H[e].UPSTREAM_API_DATA:t.endsWith("_EU")?H[e].UPSTREAM_API_DATA+"_EU":H[e].UPSTREAM_API_DATA}function j(e){var t;if(e&&e.env&&(t=e.env),t||(t=(0,n.getParameterByName)("env")),(0,o.setOfflineResourcePrefix)(e&&e.offlineResourcePrefix||""),(0,o.setOffline)(e&&"true"===e.offline),!t)switch(d.location.hostname){case"developer-dev.api.autodesk.com":t="AutodeskDevelopment";break;case"developer-stg.api.autodesk.com":t="AutodeskStaging";break;case"developer.api.autodesk.com":default:t="AutodeskProduction";break;case"localhost.autodesk.com":case"":case"127.0.0.1":t="Local"}(0,o.setEnv)(t),"undefined"!=typeof window&&r.logger.info("Host name : "+window.location.hostname),r.logger.info("Environment initialized as : "+t)}function X(e){var t,i,r=["viewer3D.js","viewer3D.min.js","viewerCE.js","viewerCE.min.js"];e&&Object.prototype.hasOwnProperty.call(e,"libraryName")&&r.push(e.libraryName);var o=!1;for(let e=0;e<r.length;e++){var s=(0,n.getScript)(r[e]),a=(i=s?s.src:"").indexOf(r[e]);if(a>=0){t=i.substr(0,a),(i.indexOf("&v=",a)>0||i.indexOf("?v=",a)>0)&&(o=!0);break}}if(u.LMV_RESOURCE_ROOT=t||u.LMV_RESOURCE_ROOT,o){var l=!1,c=["dev","stg","prod"];for(let e=0;e<c.length;++e){var h=_[c[e]];if(-1!==u.LMV_RESOURCE_ROOT.indexOf(h)){l=!0;break}}l&&(u.LMV_RESOURCE_ROOT+=u.LMV_VIEWER_VERSION+"/")}}function q(e){var t=e.endpoint;t||(t=H[(0,o.getEnv)()].ROOT);var i=e.api||t.ENDPOINT_API_DERIVATIVE_SERVICE_V2;if(o.endpoint.setEndpointAndApi(t,i),void 0!==e.escapeOssObjects&&o.endpoint.setEscapeOssObjects(e.escapeOssObjects),!(0,s.isNodeJS)())return X(e),Promise.resolve()}function Y(e,t,i){t=t||function(){},l.ViewingService.rawGet(o.endpoint.getApiEndpoint(),null,"/auth/settoken",t,i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},withCredentials:!0,postData:"access-token="+e})}function K(e){e?o.endpoint.HTTP_REQUEST_HEADERS.Authorization="Bearer "+e:delete o.endpoint.HTTP_REQUEST_HEADERS.Authorization}function Z(e,t,i){if(p.accessToken=e,o.endpoint.getUseCookie()){Y(e,t,(function(t){r.logger.warn("Failed to set token in cookie. Will use header instead."),o.endpoint.setUseCookie(!1),K(e),i&&i(t)}))}else K(e),t&&t()}function Q(e,t){var i,s=t?t.shouldInitializeAuth:void 0;void 0===s&&(s="false"!==(0,n.getParameterByName)("auth").toLowerCase());if(s||K(null),"Local"==(0,o.getEnv)()||!s)return setTimeout(e,0),void o.endpoint.setUseCredentials(void 0!==t.useCredentials&&t.useCredentials);o.endpoint.setUseCredentials(void 0===t.useCredentials||t.useCredentials),o.endpoint.setUseCookie(t.useCookie),p.tokenRefreshInterval&&(clearTimeout(p.tokenRefreshInterval),p.tokenRefreshInterval=null),t&&t.getAccessToken?(p.getAccessToken=t.getAccessToken,i=t.getAccessToken((function n(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3599;if(i=r,p.tokenRefreshInterval?Z(i):Z(i,e,e),"number"!=typeof o){const e=new Date(o);o=Boolean(+e)&&e.toISOString()===o?(e-Date.now())/1e3:3599}var s=(null==t?void 0:t.tokenExpirationBuffer)||5,a=o-s;a<=0&&(a=o),p.tokenRefreshInterval=setTimeout((function(){t.getAccessToken(n)}),1e3*a)})),"string"==typeof i&&i&&Z(i,e)):t&&t.accessToken?Z(i=t.accessToken,e):((i=(0,n.getParameterByName)("accessToken"))||r.logger.error("No access token is provided, but authorization requested. This is a problem."),Z(i,e))}function J(e){r.logger.initialize(e);var t=(0,n.getParameterByName)("logLevel");t&&r.logger.setLevel(parseInt(t))}function $(e){e&&"Local"===e.env||o.endpoint.getCdnRedirectUrl()&&l.ViewingService.rawGet(o.endpoint.getCdnRedirectUrl(),null,null,(function(e){e&&e.length&&(o.endpoint.setCdnUrl(e),r.logger.info("CDN_ROOT is: "+e))}),(function(){}),{withCredentials:!1,responseType:"text"})}function ee(e,t){if((0,s.isNodeJS)())return j(e),q(e),J(e),$(e),void Q(t,e);e.webGLHelpLink&&(m=e.webGLHelpLink),j(e);var i=q(e);J(e),$(e),(0,c.initializeLocalization)(e),(0,s.disableDocumentTouchSafari)(),function(e){const t=!(-1!==["Production","fluent"].indexOf("Production"));(e.optOutTrackingByDefault||t)&&(h.analytics.shouldTrack=!1);const i=e.productId?e.productId:"Local"===(0,o.getEnv)()?"Local":"NOT_SET";h.analytics.superProps={productId:i,lmvBuildType:u.LMV_BUILD_TYPE,lmvViewerVersion:u.LMV_VIEWER_VERSION}}(e),(0,a.initWorkerScript)();var n=function(e){return new Promise((t=>{Q(t,e)}))}(e);Promise.all([i,n]).then(t)}function te(){r.logger.shutdown(),Autodesk.Viewing.Private.shutdownPropWorker()}},65258:(e,t,i)=>{"use strict";i.d(t,{A:()=>u});var n=i(2283),r=new ArrayBuffer(8),o=new Uint8Array(r),s=new Uint16Array(r),a=new Int32Array(r),l=new Uint32Array(r),c=new Float32Array(r),h=new Float64Array(r);function u(e){this.buffer=e,this.offset=0,this.byteLength=e.length}u.prototype.seek=function(e){this.offset=e},u.prototype.getBytes=function(e){var t=new Uint8Array(this.buffer.buffer,this.offset,e);return this.offset+=e,t},u.prototype.getVarints=function(){var e,t=0,i=0;do{t|=(127&(e=this.buffer[this.offset++]))<<i,i+=7}while(128&e);return t},u.prototype.getUint8=function(){return this.buffer[this.offset++]},u.prototype.getUint16=function(){return o[0]=this.buffer[this.offset++],o[1]=this.buffer[this.offset++],s[0]},u.prototype.getInt16=function(){var e=this.getUint16();return e>32767&&(e|=4294901760),e},u.prototype.getInt32=function(){var e=this.buffer,t=o,i=this.offset;return t[0]=e[i],t[1]=e[i+1],t[2]=e[i+2],t[3]=e[i+3],this.offset+=4,a[0]},u.prototype.getUint32=function(){var e=this.buffer,t=o,i=this.offset;return t[0]=e[i],t[1]=e[i+1],t[2]=e[i+2],t[3]=e[i+3],this.offset+=4,l[0]},u.prototype.getFloat32=function(){var e=this.buffer,t=o,i=this.offset;return t[0]=e[i],t[1]=e[i+1],t[2]=e[i+2],t[3]=e[i+3],this.offset+=4,c[0]},u.prototype.getIndicesArray=function(e,t,i){for(var n=this.buffer,r=new Uint8Array(e,t,2*i),o=this.offset,s=0,a=2*i;s<a;s+=2)r[s]=n[o],r[s+1]=n[o+1],o+=4;this.offset=o},u.prototype.getVector3Array=function(e,t,i,n){var r=this.buffer,o=this.offset,s=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(3===n&&0===i){var a=12*t;s.set(r.subarray(o,o+a)),this.offset+=a}else{n*=4;for(var l=4*i,c=0;c<t;c++){for(var h=0;h<12;h++)s[l+h]=r[o++];l+=n}this.offset=o}},u.prototype.getVector2Array=function(e,t,i,n){var r=this.buffer,o=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=this.offset;n*=4;for(var a=4*i,l=0;l<t;l++){for(var c=0;c<8;c++)o[a+c]=r[s++];a+=n}this.offset=s},u.prototype.getVector4=function(e,t){for(var i=this.buffer,n=o,r=this.offset,s=c,a=0;a<4;a++)n[0]=i[r],n[1]=i[r+1],n[2]=i[r+2],n[3]=i[r+3],e[t+a]=s[0],r+=4;this.offset=r},u.prototype.getFloat64=function(){for(var e=this.buffer,t=o,i=this.offset,n=0;n<8;n++)t[n]=e[i+n];return this.offset+=8,h[0]},u.prototype.getString=function(e){var t=(0,n.Pp)(this.buffer,this.offset,e);return this.offset+=e,t},u.prototype.reset=function(e){this.buffer=e,this.offset=0,this.byteLength=e.length}},19157:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PropertyDatabase:()=>s});var n=i(2283);function r(e,t){let i,n=0,r=e.length-1;for(;n<=r;){if(i=(n+r)/2|0,t===e[i])return i;t<e[i]?r=i-1:n=i+1}return-1}var o=i(52081);function s(e){var t,i,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,_=this,E=!1,A=!1;let S={};for(var w in e.attrs){"pdb version 2"===(t=(0,n.Up)(e.attrs[w]))[0]&&(E=!0);for(var M=1;M<t.length;M++){if("Layer"===t[M][0])y=M;switch(t[M][1]){case"__parent__":d=M;break;case"__child__":u=M;break;case"__name__":p=M;break;case"__instanceof__":f=M;break;case"__viewable_in__":m=M;break;case"__externalref__":g=M;break;case"__node_flags__":v=M}E&&t[M][2]===o.GC.DbKey&&(t[M][6]=t[M][6]|o.zF.afDirectStorage)}break}for(let t in e.avs){let i=e.avs[t];i[0]==="[".charCodeAt(0)?s=(0,n.fN)(e.avs[t],0):(s=i,A=!0),delete e.avs;break}for(let t in e.offsets){let r=e.offsets[t];r[0]==="[".charCodeAt(0)?(i=(0,n.fN)(r,1))[i.length-1]=s.length/2:i=new Int32Array(r.buffer,r.byteOffset,r.byteLength/4),delete e.offsets;break}for(let t in e.values){a=e.values[t],l=(0,n.Zp)(a);break}this.setIdsBlob=function(e){c=e,h=(0,n.Zp)(e)};for(let t in e.ids){this.setIdsBlob(e.ids[t]);break}function T(e){for(var t={},i=0,n=e.length;i<n;i++){var r=e[i];Array.isArray(r)||(r=[r]);for(var o=0;o<r.length;o++){var s=r[o],a=t[s];void 0===a?t[s]=i:Array.isArray(a)?a.push(i):t[s]=[a,i]}}return t}this.getObjectCount=function(){return i.length-1},this.getValueAt=function(e){return(0,n.U8)(a,l[e])},this.getIntValueAt=function(e){return(0,n.ON)(a,l[e])},this.getIdAt=function(e){return(0,n.U8)(c,h[e])},this.externalIdsLoaded=function(){return Boolean(c)},this.getAttrValue=function(e,i,n){var r=t[e];return r[6]&o.zF.afDirectStorage&&r[2]===o.GC.DbKey?i:n?this.getIntValueAt(i):this.getValueAt(i)},this._getObjectProperty=function(e,i){var n=t[e],r=n[5]?n[5]:n[0],o=this.attributeHidden(e);return{displayName:r,displayValue:_.getAttrValue(e,i),displayCategory:n[1],attributeName:n[0],type:n[2],units:n[3],hidden:o,precision:n[7]||0}},this.getObjectProperties=function(e,i,n,r,o){var s={dbId:e,properties:[]},a=!1,l=i&&-1!==i.indexOf("externalId"),c=this.externalIdsLoaded();l&&!c&&console.error("Requesting externalID requires loading of the externalID table");var h=c&&(!i||l);if(h&&(s.externalId=this.getIdAt(e),i&&1===i.length))return s;var u=null;if(this.enumObjectProperties(e,(function(e,l){if(e!=f){var c=t[e];if(!(i&&-1===i.indexOf(c[0])&&-1===i.indexOf(c[5])||o&&-1===o.indexOf(c[1])||r&&(r.indexOf(c[0])>-1||r.indexOf(c[5])>-1)))if(e==p){var h=_.getAttrValue(e,l);a=!0,s.name=h}else{var d=_.attributeHidden(e);if(n&&d)return;var m=_._getObjectProperty(e,l);s.properties.push(m)}}else{var g=_.getObjectProperties(_.getAttrValue(e,l),i,!0,r,o);g&&g.properties&&(u=g)}})),u){var d={},m=s.properties;for(let e=0;e<m.length;e++)d[m[e].displayName]=1;s.name||(s.name=u.name);var g=u.properties;for(let e=0;e<g.length;e++)Object.prototype.hasOwnProperty.call(d,g[e].displayName)||m.push(g[e])}return o&&!s.properties.length?null:!i||s.properties.length||h||a?s:null},this.getExternalIdMapping=function(e){var t={};if(h&&"length"in h)for(var i=1,n=h.length;i<n;++i){var r=this.getIdAt(i);e&&!0!==e[r]||(t[r]=i)}return t},this.findRootNodes=function(){var e=[],t=[];return this.enumObjects((function(i){var n=!1,r=!1,o=!1;_.enumObjectProperties(i,(function(e,t){e==d?_.getAttrValue(e,t,!0)&&(r=!0):e==u?n=!0:e==p&&(o=!0)})),o&&!r&&(n?e.push(i):t.push(i))})),e.length>0?e:t},this.nodeHasChild=function(e){let t=!1;return this.enumObjectProperties(e,(function(e){if(e===u)return t=!0,!0})),t},this.getNodeNameAndChildren=function(e,t){var i,n,r=e.dbId;if(this.enumObjectProperties(r,(function(r,o){var s;if(r===d);else if(r!=u||t)r===p?e.name=_.getAttrValue(r,o):r===v?e.flags=_.getAttrValue(r,o,!0):r===f&&(n=o);else if((s=_.getAttrValue(r,o,!0))!==e.dbId){var a={dbId:s,parent:e.dbId};i?i.push(a):i=[a]}})),(!e.name||!e.flags)&&n){const t=_.getAttrValue(f,n,!0);let i=S[t];i||(S[t]=i={dbId:t,name:null,flags:null},_.getNodeNameAndChildren(i,!0)),i.name&&!e.name&&(e.name=i.name),"number"!=typeof e.flags&&"number"==typeof i.flags&&(e.flags=i.flags)}return i},this.buildDbIdToFragMap=T;this.buildObjectTree=function(e,t,i,n){var r;t&&(r=T(t)),b={},x=0;var o=this.buildObjectTreeRec(e,0,r,0,i,n);return x>0&&console.warn("Property database integrity not guaranteed ("+x+")."),b=null,S={},o},this.buildObjectTreeRec=function(e,t,i,n,r,o){if(b[e])return x++,0;b[e]=t||e,n>r[0]&&(r[0]=n);var s,a={dbId:e},l=this.getNodeNameAndChildren(a),c=[];if(l)for(var h=0;h<l.length;h++){this.buildObjectTreeRec(l[h].dbId,e,i,n+1,r,o)&&c.push(l[h].dbId)}if(i){var u=i[e];void 0!==u&&(s=Array.isArray(u)?u:[u])}var d=a.flags||0;void 0===d&&(d=s&&s.length?6:(c.length,0));var p=c.length+(s?s.length:0);return p&&o.setNode(e,t,a.name,d,c,s),p},this.getSearchTerms=function(e){for(var t=(e=e.toLowerCase()).match(/"[^"]+"|[^\s]+/g)||[],i=t.length;i--;)t[i]=t[i].replace(/"/g,"");var n=[];for(i=0;i<t.length;i++)t[i].length>1&&n.push(t[i]);return n},this.bruteForceSearch=function(e,i,n){const o=this.getSearchTerms(e);if(0===o.length)return[];var s=[];const a=null==n?void 0:n.searchHidden,c=null==n?void 0:n.includeInherited,h={};for(let e=0;e<o.length;e++){for(var u=[],d=[],p=0,m=l.length;p<m;p++){var g=this.getValueAt(p);null!==g&&(-1!==g.toString().toLowerCase().indexOf(o[e])&&d.push(p))}0!==d.length?(d.sort((function(e,t){return e-t})),this.enumObjects((function(e){_.enumObjectProperties(e,(function(n,o){if(c&&n===f){const t=parseInt(_.getAttrValue(n,o));h[t]=h[t]||[],h[t].push(e)}if(!a&&_.attributeHidden(n))return;if(-1!==r(d,o)){if(i&&i.length&&-1===i.indexOf(t[n][0]))return;return u.push(e),!0}}))})),s.push(u)):s.push(u)}const v=(e,t)=>{const i=new Set(e);for(let n=0;n<e.length;++n){const r=e[n];if(!(r in t))continue;const o=t[r];for(let t=0;t<o.length;++t){const n=o[t];i.has(n)||(e.push(n),i.add(n))}}};if(1===s.length)return c&&v(s[0],h),s[0];var y={},b=s[0];for(let e=0;e<b.length;e++)y[b[e]]=1;for(let e=1;e<s.length;e++){b=s[e];var x={};for(let e=0;e<b.length;e++)1===y[b[e]]&&(x[b[e]]=1);y=x}u=[];for(let e in y)u.push(parseInt(e));return c&&v(u,h),u},this.bruteForceFind=function(e){var i=[];return this.enumObjects((function(n){var r=!1;_.enumObjectProperties(n,(function(i){var n=t[i],o=n[0],s=n[5];if(o===e||s===e)return r=!0,!0})),r&&i.push(n)})),i},this.getLayerToNodeIdMapping=function(){var e={};return this.enumObjects((function(t){_.enumObjectProperties(t,(function(i,n){if(i==y){var r=_.getAttrValue(i,n);return Array.isArray(e[r])||(e[r]=[]),e[r].push(t),!0}}))})),e},this.getAttributeDef=function(e){var i=t[e];return{name:i[0],category:i[1],dataType:i[2],dataTypeContext:i[3],description:i[4],displayName:i[5],flags:i[6],precision:i.length>7?i[7]:0}},this.enumAttributes=function(e){for(var i=1;i<t.length&&!e(i,this.getAttributeDef(i),t[i]);i++);},this.enumObjectProperties=A?function(e,t){let n=i[e],r=i[e+1],o=s,a=0;for(;n<r;){let e=o[n++],i=127&e,r=7;for(;128&e;)e=o[n++],i|=(127&e)<<r,r+=7;for(a+=i,e=o[n++],i=127&e,r=7;128&e;)e=o[n++],i|=(127&e)<<r,r+=7;if(t(a,i))break}}:function(e,t){let n=2*i[e],r=2*i[e+1];for(let e=n;e<r;e+=2){if(t(s[e],s[e+1]))break}};let C={};function P(e,t,n){let r=i[e],o=i[e+1],a=s,l=[],c=[];n=n||{};let h=0;for(;r<o;){let e=a[r++],i=127&e,o=7;for(;128&e;)e=a[r++],i|=(127&e)<<o,o+=7;for(h+=i,e=a[r++],i=127&e,o=7;128&e;)e=a[r++],i|=(127&e)<<o,o+=7;if(h===f){let e=_.getAttrValue(h,i);c.push(e)}else t&&!t[h]||(n[h]=i,l.push(h),l.push(i))}for(let e=0;e<c.length;e++){let i=c[e],r=C[i];r||(C[i]=r=P(i));for(let e=0;e<r.length;e+=2){let i=r[e],o=r[e+1];t&&!t[i]||(n[i]||_.attributeHidden(i)||(n[i]=o,l.push(i),l.push(o)))}}return l}this.getPropertiesSubsetWithInheritance=A?P:function(e,t,n){let r=2*i[e],o=2*i[e+1],a=[],l=[];n=n||{};for(let e=r;e<o;e+=2){let i=s[e],r=s[e+1];if(i===f){let e=_.getAttrValue(i,r);l.push(e)}else t&&!t[i]||(n[i]=r,a.push(i),a.push(r))}for(let e=0;e<l.length;e++){let i=l[e],r=C[i];r||(C[i]=r=P(i));for(let e=0;e<r.length;e+=2){let i=r[e],o=r[e+1];t&&!t[i]||(n[i]||_.attributeHidden(i)||(n[i]=o,a.push(i),a.push(o)))}}return a},this.findLayers=function(){var e={name:"root",id:1,index:1,children:[],isLayer:!1,childCount:0};if(void 0===y)return e;var t=[],i=this;return this.enumObjects((function(e){i.enumObjectProperties(e,(function(e,n){if(e===y){var r=i.getValueAt(n);return-1===t.indexOf(r)&&t.push(r),!0}}))})),t.sort((function(e,t){return e.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})})),e.childCount=t.length,e.children=t.map((function(e,t){return{name:e,index:t+1,id:t+1,isLayer:!0}})),e},this.enumObjects=function(e,t,n){var r=i.length-1;t="number"==typeof t?Math.max(t,1):1,n="number"==typeof n?Math.min(r,n):r;for(var o=t;o<n&&!e(o);o++);},this.getAttrChild=function(){return u},this.getAttrParent=function(){return d},this.getAttrName=function(){return p},this.getAttrLayers=function(){return y},this.getAttrInstanceOf=function(){return f},this.getAttrViewableIn=function(){return m},this.getAttrXref=function(){return g},this.getAttrNodeFlags=function(){return v},this.attributeHidden=function(e){return 1&t[e][6]||e==d||e==u||e==m||e==g},this._attributeIsBlacklisted=function(e){var i=t[e],n=i[0],r=i[1];return!(!o.WU.hasOwnProperty(r)||-1===o.WU[r].indexOf(n))||!(!o.am.hasOwnProperty(r)||-1===o.am[r].indexOf(n))},this._ignoreAttribute=function(e,i){var n=t[i],r=n[0],o=n[1];return e[o]&&e[o].has(r)},this.findParent=function(e){let t=null;return _.enumObjectProperties(e,(function(e,i){e===d&&(t=_.getAttrValue(e,i,!0))})),t},this._getAttributeAndValueIds=function(e,t,i){let n=this.getPropertiesSubsetWithInheritance(e),r=i&&Object.keys(i).length>=1;for(let e=0;e<n.length;e+=2){let o=n[e];this._attributeIsBlacklisted(o)||this.attributeHidden(o)||(r&&this._ignoreAttribute(i,o)||t.push({attrId:o,valId:n[e+1]}))}t.sort((function(e,t){return e.attrId-t.attrId}))},this.findDifferences=function(e,t,i){var n={changedIds:[]},r=t&&t.dbIds,o=t&&t.listPropChanges;o&&(n.propChanges=[]);let s=t&&t.propertyFilter||{};var a=this,l=e,c=[],h=[],u={result:[],dbId:-1},d={result:[],dbId:-1},p=function(e){var t=0,i=0;if(c.length=0,h.length=0,a._getAttributeAndValueIds(e,c,s,!0,u),l._getAttributeAndValueIds(e,h,s,!0,d),c.length&&h.length){for(var r=!1,p=void 0;t<c.length&&i<h.length;){var f=c[t],m=h[i],g=f&&f.attrId,v=f&&f.valId,y=m&&m.attrId,b=m&&m.valId;if(g!==y||v!==b){if(r=!0,!o)break;var x=void 0===y||y>g,E=void 0;void 0===g||g>y?((E=l._getObjectProperty(y,b)).displayValueB=E.displayValue,E.displayValue=void 0,i++):x?((E=a._getObjectProperty(g,v)).displayValueB=void 0,t++):((E=a._getObjectProperty(g,v)).displayValueB=_.getAttrValue(y,b),t++,i++),p||(p=[]),p.push(E)}else t++,i++}r&&(n.changedIds.push(e),o&&n.propChanges.push(p))}},f=-1,m=function(e,t){var n=Math.floor(100*e/t);n!=f&&(i&&i(n),f=n)};if(r)for(var g=0;g<r.length;g++){p(r[g]),m(g,r.length)}else{var v=Math.min(a.getObjectCount(),this.getObjectCount());for(let e=1;e<v;e++)p(e),m(e,v)}return n},this.dtor=function(){t=null,i=null,s=null,a=null,l=null,c=null,h=null,u=0,d=0,p=0,f=0,m=0,g=0,v=0}}},52081:(e,t,i)=>{"use strict";i.d(t,{GC:()=>n,OY:()=>a,WU:()=>s,am:()=>o,zF:()=>r});var n={Unknown:0,Boolean:1,Integer:2,Double:3,Float:4,BLOB:10,DbKey:11,String:20,LocalizableString:21,DateTime:22,GeoLocation:23,Position:24},r={afHidden:1,afDontIndex:2,afDirectStorage:4,afReadOnly:8},o={Dimensions:["Perimeter","Volume","Area","Length","Width","Height"]},s={Item:["Source File"]};const a=e=>[n.Integer,n.Double,n.Float].includes(e)},2283:(e,t,i)=>{"use strict";function n(e,t,i){var n,r,o,s,a,l;for(n="",o=i,r=0;r<o;)switch((s=e[t+r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(s);break;case 12:case 13:a=e[t+r++],n+=String.fromCharCode((31&s)<<6|63&a);break;case 14:a=e[t+r++],l=e[t+r++],n+=String.fromCharCode((15&s)<<12|(63&a)<<6|(63&l)<<0)}return n}function r(e,t,i){var n,r,o,s=i||0;if(r=e.length,t)for(n=0;n<r;n++)(o=e.charCodeAt(n))>=1&&o<=127?t[s++]=o:o>2047?(t[s++]=224|o>>12&15,t[s++]=128|o>>6&63,t[s++]=128|o>>0&63):(t[s++]=192|o>>6&31,t[s++]=128|o>>0&63);else for(n=0;n<r;n++)(o=e.charCodeAt(n))>=1&&o<=127?s++:s+=o>2047?3:2;return s-(i||0)}i.d(t,{MA:()=>n,ON:()=>l,Pp:()=>o,Ss:()=>r,U8:()=>a,Up:()=>s,Zp:()=>h,fN:()=>c});function o(e,t,i){return void 0===t&&(t=0),void 0===i&&(i=e.length),i>1048576?function(e,t,i){var n,r,o,s,a,l,c,h;for(n="",a=[],o=i,l=0,r=0;r<o;){switch((s=e[t+r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a.push(String.fromCharCode(s));break;case 12:case 13:c=e[t+r++],a.push(String.fromCharCode((31&s)<<6|63&c));break;case 14:c=e[t+r++],h=e[t+r++],a.push(String.fromCharCode((15&s)<<12|(63&c)<<6|(63&h)<<0))}(++l>=32768||r>=o)&&(n+=a.join(""),a.length=0,l=0)}return n}(e,t,i):n(e,t,i)}function s(e){var t=o(e,0,e.length);return t=t.replace(/\u000e/gi,""),JSON.parse(t)}function a(e,t){if(void 0===t)return"";for(var i=t;i<e.length-1;){var n=e[i];if(44==n&&(10==e[i+1]||13==e[i+1]))break;if(10==n||13==n)break;i++}var r=o(e,t,i-t);try{return JSON.parse(r)}catch(e){return console.error("Error parsing property blob to JSON : "+r),r}}function l(e,t){var i=0,n=t;for(34==e[n]&&n++;n<e.length-1;){var r=e[n];if(44==r&&(10==e[n+1]||13==e[n+1]))break;if(10==r||13==r||34==r)break;r>=48&&r<=57&&(i=10*i+(r-48)),n++}return i}function c(e,t){for(var i=0,n=0,r=e.length;n<r;n++)44==e[n]&&i++;i++;var o=new Uint32Array(i+(t?1:0));n=0;for(var s=e.length;91!=e[n]&&n<s;)n++;if(n==e.length)return null;n++;var a=!1;i=0;for(var l=0;n<s;){var c=e[n];c>=48&&c<=57?(l=10*l+(c-48),a=!0):44==c||93==c?a&&(o[i++]=l,a=!1,l=0):(a=!1,l=0),n++}return o}function h(e){for(var t=0,i=e.length-1,n=0;n<i;n++)44!=e[n]||10!=e[n+1]&&13!=e[n+1]||t++;if(!t)return null;t++;var r=new Uint32Array(t);for(n=0,t=0;91!=e[n]&&n<i;)n++;n++,r[t++]=n;for(var o=!1;n<i;)10==e[n]||13==e[n]?o=!0:o&&(o=!1,r[t++]=n),n++;return r}},78293:(e,t,i)=>{"use strict";i.r(t),i.d(t,{VertexBufferBuilder:()=>o});var n=2*Math.PI,r=[0,1,3,0,3,2];function o(e,t,i,n){var r=t||65536;this.FULL_COUNT=0|(i||32767),this.useInstancing=e,this.useCompactBuffers=n,this.stride=10,this.allocVcount=4*(this.useInstancing?r/4:r),this.vb=new ArrayBuffer(this.stride*this.allocVcount),this.vbf=new Float32Array(this.vb),this.vbi=new Int32Array(this.vb),this.ib=this.useInstancing?null:new Uint16Array(r),this.minLineWidth=Number.MAX_VALUE,this.reset(0)}o.prototype.reset=function(e){this.vcount=e,this.icount=0,this.minx=this.miny=1/0,this.maxx=this.maxy=-1/0,this.dbIds={},this.lastDbId=null,this.colors={},this.numEllipticals=0,this.numCirculars=0,this.numTriangleGeoms=0,this.numMiterLines=0,this.hasLineStyles=!1,this.changeTracking={},this.stride=10},o.prototype.expandStride=function(){var e=this.stride;if(!(e>=12)){for(var t=this.stride+2,i=new ArrayBuffer(t*this.allocVcount),n=new Uint8Array(this.vb),r=new Uint8Array(i),o=0,s=this.vcount;o<s;o++)for(var a=o*e*4,l=o*t*4,c=0;c<4*e;c++)r[l+c]=n[a+c];this.vb=i,this.vbf=new Float32Array(i),this.vbi=new Int32Array(i),this.stride=t}},o.prototype.addToBounds=function(e,t){e<this.minx&&(this.minx=e),e>this.maxx&&(this.maxx=e),t<this.miny&&(this.miny=t),t>this.maxy&&(this.maxy=t)};var s=new Int32Array(1);function a(e){return s[0]=e,s[0]}o.prototype.trackChanges=function(e,t,i,n,r,o){if(i!==this.lastDbId&&(this.dbIds[a(i)]=1,this.lastDbId=i),o&&(this.hasLineStyles=!0),this.useCompactBuffers){var s=this.changeTracking;l("geomType",e),l("color",t),l("dbId",i),l("layerId",n),l("viewportId",r),l("linePattern",o),this.colors[a(t)]=1}function l(t,i){void 0===s[t]?s[t]=e:s[t]===i&&(s[t+"Varies"]=!0)}},o.prototype.setCommonVertexAttribs=function(e,t,i,n,r,o,s,a){this.trackChanges(i,n,r,o,s,a),t&=255,i&=255,a&=255,o&=65535,s&=65535,this.vbi[e+8]=t|i<<8|a<<16,this.vbi[e+6]=n,this.vbi[e+7]=r,this.vbi[e+9]=o|s<<16},o.prototype.addVertexTriangleGeom=function(e,t,i,n,r,o,s,a,l,c){for(var h=this.vcount,u=this.vbf,d=this.useInstancing?1:4,p=0;p<d;p++){var f=(h+p)*this.stride;u[f]=e,u[f+1]=t,u[f+2]=i,u[f+3]=n,u[f+4]=r,u[f+5]=o,this.setCommonVertexAttribs(f,0+p,5,s,a,l,c,0),this.vcount++}return h},o.prototype.addVertexLine=function(e,t,i,r,o,s,a,l,c,h,u,d,p){var f=this.vcount,m=this.vbf;l>=0&&s>0&&r>0&&(this.minLineWidth=Math.min(this.minLineWidth,s));var g=1;d&&p?g=8:d?g=9:p&&(g=10);for(var v=this.useInstancing?1:4,y=0;y<v;y++){var b=(f+y)*this.stride;m[b]=e,m[b+1]=t,m[b+2]=(i+Math.PI)/n,m[b+3]=r,m[b+4]=.5*s,m[b+5]=o,this.setCommonVertexAttribs(b,0+y,g,a,l,c,h,u),this.vcount++}return f},o.prototype.addVertexMiterLine=function(e,t,i,r,o,s,a,l,c,h,u,d,p){var f=this.vcount,m=this.vbf;h>=0&&l>0&&(this.minLineWidth=Math.min(this.minLineWidth,l));for(var g=this.useInstancing?1:4,v=0;v<g;v++){var y=(f+v)*this.stride;m[y]=e,m[y+1]=t,m[y+2]=(i+Math.PI)/n,m[y+3]=s,m[y+4]=.5*l,m[y+5]=(r+Math.PI)/n,m[y+10]=(o+Math.PI)/n,m[y+11]=a,this.setCommonVertexAttribs(y,0+v,11,c,h,u,d,p),this.vcount++}return f},o.prototype.addVertexTexQuad=function(e,t,i,r,o,s,a,l,c){for(var h=this.vcount,u=this.vbf,d=this.useInstancing?1:4,p=0;p<d;p++){var f=(h+p)*this.stride;u[f]=e,u[f+1]=t,u[f+2]=o/n,u[f+3]=i,u[f+4]=r,this.setCommonVertexAttribs(f,0+p,4,s,a,l,c,0),this.vcount++}return h},o.prototype.addVertexArc=function(e,t,i,r,o,s,a,l,c,h,u,d){for(var p=this.vcount,f=this.vbf,m=o==s?2:3,g=this.useInstancing?1:4,v=0;v<g;v++){var y=(p+v)*this.stride;f[y]=e,f[y+1]=t,f[y+2]=i/n,f[y+3]=r/n,f[y+4]=.5*l,f[y+5]=o,3===m&&(f[y+10]=s,f[y+11]=a),this.setCommonVertexAttribs(y,0+v,m,c,h,u,d,0),this.vcount++}return p},o.prototype.addVertex=function(e,t,i,n,r,o){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(!this.useInstancing){var a=this.vcount,l=this.stride*a,c=this.vbf;return c[l]=e,c[l+1]=t,this.setCommonVertexAttribs(l,0,s,i,n,r,o,0),this.vcount++,a}},o.prototype.addVertexPolytriangle=function(e,t,i,n,r,o){this.useInstancing||(this.addVertex(e,t,i,n,r,o),this.addToBounds(e,t))},o.prototype.addVertexMSDFPolytriangle=function(e,t,i,n,r,o,s,a){this.addVertexTexPolytriangle(e,t,i,n,r,o,s,a,6)},o.prototype.addIndices=function(e,t){if(!this.useInstancing){var i=this.ib,n=this.icount;if(n+e.length>=i.length){for(var r=new Uint16Array(2*Math.max(e.length,i.length)),o=0;o<n;++o)r[o]=i[o];this.ib=i=r}for(o=0;o<e.length;++o)i[n+o]=t+e[o];this.icount+=e.length}},o.prototype.finalizeQuad=function(e){this.useInstancing||this.addIndices(r,e)},o.prototype.addSegment=function(e,t,i,n,r,o,s,a,l,c,h,u,d){var p=i-e,f=n-t,m=p||f?Math.atan2(f,p):0,g=p||f?Math.sqrt(p*p+f*f):0,v=this.addVertexLine(e,t,m,g,r,o,s,a,l,c,h,u,d);this.finalizeQuad(v),this.addToBounds(e,t),this.addToBounds(i,n)},o.prototype.addMiterSegment=function(e,t,i,n,r,o,s,a,l,c,h,u,d,p,f,m,g){if(this.useCompactBuffers)this.addSegment(i,n,r,o,l,c,h,u,d,p,f,m,g);else{this.numMiterLines++,this.expandStride();var v=r-i,y=o-n,b=v||y?Math.atan2(y,v):0,x=v||y?Math.sqrt(v*v+y*y):0,_=i-e,E=n-t,A=_||E?Math.atan2(E,_):b,S=_||E?Math.sqrt(_*_+E*E):1,w=s-r,M=a-o,T=w||M?Math.atan2(M,w):b,C=w||M?Math.sqrt(w*w+M*M):1,P=Math.floor(1023*Math.min(64,S)),D=65536*Math.floor(1023*Math.min(64,C))+P,L=this.addVertexMiterLine(i,n,b,A,T,x,D,c,h,u,d,p,f);this.finalizeQuad(L),this.addToBounds(i,n),this.addToBounds(r,o)}},o.prototype.addTriangleGeom=function(e,t,i,n,r,o,s,a,l,c){this.numTriangleGeoms++;var h=this.addVertexTriangleGeom(e,t,i,n,r,o,s,a,l,c);this.finalizeQuad(h),this.addToBounds(e,t),this.addToBounds(i,n),this.addToBounds(r,o)},o.prototype.addArc=function(e,t,i,r,o,s,a,c,h,u,d,p){o==s?this.numCirculars++:(this.numEllipticals++,this.expandStride());var f=l(i,r);i=f.start,r=f.end,0==i&&0==r&&(r=n);{if((x=Math.abs(i-r))>1e-4&&Math.abs(x-n)>1e-4){var m=e+o*Math.cos(i),g=t+s*Math.sin(i);this.addSegment(m,g,m,g,0,c,h,u,d,p);var v=e+o*Math.cos(r),y=t+s*Math.sin(r);this.addSegment(v,y,v,y,0,c,h,u,d,p)}else this.addToBounds(e-o,t-s),this.addToBounds(e+o,t+s);const a=33554431;var b=this.addVertexLine(e,t,0,1e-4,0,0,a,u,d,p);this.finalizeQuad(b)}var x,_=this.addVertexArc(e,t,i,r,o,s,a,c,h,u,d,p);this.finalizeQuad(_)},o.prototype.addTexturedQuad=function(e,t,i,n,r,o,s,a,l){var c=this.addVertexTexQuad(e,t,i,n,r,o,s,a,l);this.finalizeQuad(c);var h=.5*Math.cos(r),u=.5*Math.sin(r),d=Math.abs(i*h)+Math.abs(n*u),p=Math.abs(i*u)+Math.abs(n*h);this.addToBounds(e-d,t-p),this.addToBounds(e+d,t+p)},o.prototype.addVertexImagePolytriangle=function(e,t,i,n,r,o,s,a){return this.addVertexTexPolytriangle(e,t,i,n,r,o,s,a,7)},o.prototype.addVertexTexPolytriangle=function(e,t,i,n,r,o,s,a,l){if(this.useInstancing)return;let c=this.vcount,h=this.vbf;this.addVertex(e,t,r,o,s,a,l),h[c*this.stride+2]=i,h[c*this.stride+3]=n,this.addToBounds(e,t)},o.prototype.isFull=function(e){e=e||3;var t=this.useInstancing?4:1;return this.vcount*t+e>this.FULL_COUNT},o.prototype.makeCompactVertexLayout=function(){var e=Object.keys(this.colors),t=Object.keys(this.dbIds);if(10!==this.stride)return null;var i=e.length+t.length;if(e.length+t.length>65536)return null;var n=new Int32Array(i+1);n[0]=0;for(var r=1,o=0;o<e.length;o++,r++)n[r]=parseInt(e[o]),this.colors[e[o]]=r;for(o=0;o<t.length;o++,r++)n[r]=parseInt(t[o]),this.dbIds[t[o]]=r;var s=new ArrayBuffer(24*this.vcount),a=new Int32Array(s),l=new Uint16Array(s),c=this.maxx-this.minx||1,h=this.maxy-this.miny||1,u=this.minx,d=this.miny,p=Math.max(c,h);function f(e){return 0|Math.round((e-u)/c*65535)}function m(e){return 0|Math.round((e-d)/h*65535)}function g(e){return 0|Math.round(e/p*65535)}function v(e){return 0|65535*e}function y(e){return e<0?32768+32767*Math.min(1,-e/1024):e?0|Math.round(e/p*32767)||1:e}for(o=0;o<this.vcount;o++){var b=this.stride*o,x=6*o,_=2*x;switch(this.vbi[b+8]>>8&255){case 0:l[_]=f(this.vbf[b]),l[_+1]=m(this.vbf[b+1]);break;case 1:case 8:case 9:case 10:l[_]=f(this.vbf[b]),l[_+1]=m(this.vbf[b+1]),l[_+2]=v(this.vbf[b+2]),l[_+3]=g(this.vbf[b+3]),l[_+4]=y(this.vbf[b+4]);break;case 2:l[_]=f(this.vbf[b]),l[_+1]=m(this.vbf[b+1]),l[_+2]=v(this.vbf[b+2]),l[_+3]=v(this.vbf[b+3]),l[_+4]=y(this.vbf[b+4]),l[_+5]=g(this.vbf[b+5]);break;case 3:case 11:break;case 4:l[_]=f(this.vbf[b]),l[_+1]=m(this.vbf[b+1]),l[_+2]=v(this.vbf[b+2]),l[_+3]=g(this.vbf[b+3]),l[_+4]=g(this.vbf[b+4]);break;case 5:l[_]=f(this.vbf[b]),l[_+1]=m(this.vbf[b+1]),l[_+2]=f(this.vbf[b+2]),l[_+3]=m(this.vbf[b+3]),l[_+4]=f(this.vbf[b+4]),l[_+5]=m(this.vbf[b+5]);break;default:console.error("Unknown geometry type")}l[_+6]=this.colors[this.vbi[b+6]]||0,l[_+7]=this.dbIds[this.vbi[b+7]]||0,a[x+4]=this.vbi[b+8],a[x+5]=this.vbi[b+9]}var E={};E.vb=new Float32Array(s),E.vbstride=6;var A=this.useInstancing?1:0;return E.vblayout={fields1:{offset:0,itemSize:2,bytesPerItem:2,divisor:A,normalized:!0},fields2:{offset:1,itemSize:4,bytesPerItem:2,divisor:A,normalized:!0},uvIdColor:{offset:3,itemSize:2,bytesPerItem:2,divisor:A,normalized:!1},flags4b:{offset:4,itemSize:4,bytesPerItem:1,divisor:A,normalized:!1},layerVp4b:{offset:5,itemSize:4,bytesPerItem:1,divisor:A,normalized:!1}},E.unpackXform={x:c,y:h,z:u,w:d},E.texData=n,E},o.prototype.makeWideVertexLayout=function(){var e={};e.vb=new Float32Array(this.vb.slice(0,this.vcount*this.stride*4)),e.vbstride=this.stride;var t=this.useInstancing?1:0;return e.vblayout={fields1:{offset:0,itemSize:2,bytesPerItem:4,divisor:t,normalized:!1},fields2:{offset:2,itemSize:4,bytesPerItem:4,divisor:t,normalized:!1},color4b:{offset:6,itemSize:4,bytesPerItem:1,divisor:t,normalized:!0},dbId4b:{offset:7,itemSize:4,bytesPerItem:1,divisor:t,normalized:!1},flags4b:{offset:8,itemSize:4,bytesPerItem:1,divisor:t,normalized:!1},layerVp4b:{offset:9,itemSize:4,bytesPerItem:1,divisor:t,normalized:!1}},e.vblayout.extraParams={offset:this.stride-2,itemSize:2,bytesPerItem:4,divisor:t,normalized:!1},e},o.prototype.toMesh=function(){var e=null;if(this.useCompactBuffers&&(e=this.makeCompactVertexLayout()),e||(e=this.makeWideVertexLayout()),this.useInstancing){e.numInstances=this.vcount;var t=new Int32Array([0,1,2,3]);e.vblayout.instFlags4b={offset:0,itemSize:4,bytesPerItem:1,divisor:0,normalized:!1},e.vblayout.instFlags4b.array=t.buffer;e.indices=new Uint16Array(r)}else e.indices=new Uint16Array(this.ib.buffer.slice(0,2*this.icount));e.dbIds=this.dbIds;var i=this.maxx-this.minx,n=this.maxy-this.miny,o=Math.max(i,n);e.boundingBox={min:{x:this.minx,y:this.miny,z:.001*-o},max:{x:this.maxx,y:this.maxy,z:.001*o}};e.boundingSphere={center:{x:.5*(this.minx+this.maxx),y:.5*(this.miny+this.maxy),z:0},radius:.5*Math.sqrt(i*i+n*n)};return e};var l=function(e,t){function i(){function i(e,t){return Math.abs(e-t)<.001}i(e,0)&&(e=0),i(t,0)&&(t=0),i(e,n)&&(e=n),i(t,n)&&(t=n)}if(i(),e>t)for(;e>n;)e-=n,t-=n;else for(;t>n;)e-=n,t-=n;return i(),e<0&&t>0&&(e+=n),{start:e,end:t}}},75968:(e,t,i)=>{"use strict";i.r(t),i.d(t,{F2D:()=>f,F2dDataType:()=>h,F2dSemanticType:()=>u,F2dShadowRatio:()=>d,restoreSignBitFromLSB:()=>p});var n=i(78293),r=i(39651),o=i(27957);const s=function(e,t){t.min.x<e.min.x&&(e.min.x=t.min.x),t.min.y<e.min.y&&(e.min.y=t.min.y),t.min.z<e.min.z&&(e.min.z=t.min.z),t.max.x>e.max.x&&(e.max.x=t.max.x),t.max.y>e.max.y&&(e.max.y=t.max.y),t.max.z>e.max.z&&(e.max.z=t.max.z)};var a=i(65258),l=i(49720),c=i(82079),h={dt_object:0,dt_void:1,dt_byte:2,dt_int:3,dt_float:4,dt_double:5,dt_varint:6,dt_point_varint:7,dt_byte_array:32,dt_int_array:33,dt_float_array:34,dt_double_array:35,dt_varint_array:36,dt_point_varint_array:37,dt_arc:38,dt_circle:39,dt_circular_arc:40,dt_string:63,dt_last_data_type:127},u={st_object_member:0,st_fill:1,st_fill_off:2,st_clip_off:3,st_layer:4,st_link:5,st_line_weight:6,st_miter_angle:7,st_miter_length:8,st_line_pattern_ref:9,st_back_color:10,st_color:11,st_markup:12,st_object_id:13,st_markup_id:14,st_reset_rel_offset:15,st_font_ref:16,st_begin_object:32,st_clip:33,st_line_caps:34,st_line_join:35,st_line_pattern_def:36,st_font_def:37,st_viewport:38,st_sheet:42,st_arc:43,st_polyline:44,st_raster:45,st_text:46,st_polytriangle:47,st_dot:48,st_end_object:63,st_last_semantic_type:127};const d=.0075;function p(e){return 1&e?-(e>>>1):e>>>1}function f(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(this.metadata=e,this.scaleX=1,this.scaleY=1,this.bbox={min:{x:0,y:0,z:0},max:{x:0,y:0,z:0}},this.is2d=!0,this.layersMap={},this.fontDefs={},this.fontCount=0,this.fontId=0,this.manifestAvailable=!1,this.geomMetricsSum=0,this.objectMemberQueue=[],this.propertydb={attrs:[],avs:[],ids:[],values:[],offsets:[],viewables:[]},e){var s=e.page_dimensions;this.paperWidth=s.page_width,this.paperHeight=s.page_height,this.scaleX=this.paperWidth/s.plot_width,this.scaleY=this.paperHeight/s.plot_height,this.hidePaper=s.hide_paper;var a=this.paperWidth,l=this.paperHeight;this.bbox.max.x=a,this.bbox.max.y=l;var c=e.page_dimensions||{};if(isFinite(c.paper_rotation)&&0!==c.paper_rotation){var h=c.paper_rotation*Math.PI/180,u=Math.cos(h),d=Math.sin(h),p=a*u,f=a*d,m=-l*d,g=l*u;this.bbox.min.x=Math.min(0,p,m,p+m),this.bbox.max.x=Math.max(0,p,m,p+m),this.bbox.min.y=Math.min(0,f,g,f+g),this.bbox.max.y=Math.max(0,f,g,f+g)}isFinite(c.paper_offset_x)&&0!==c.paper_offset_x&&(this.bbox.min.x+=c.paper_offset_x,this.bbox.max.x+=c.paper_offset_x),isFinite(c.paper_offset_y)&&0!==c.paper_offset_y&&(this.bbox.min.y+=c.paper_offset_y,this.bbox.max.y+=c.paper_offset_y);var v=0;for(var y in this.layersMap[0]=v++,e.layers){var b=parseInt(y);this.layersMap[b]=v++}if(this.layerCount=v,this.createLayerGroups(e.layers),e.geom_metrics){var x=Object.keys(e.geom_metrics).map((function(t){return e.geom_metrics[t]}));this.geomMetricsSum=x.reduce(((e,t)=>e+t))}}this.hidePaper=this.hidePaper||o.modelSpace,this.noShadow=!!o.noShadow,this.hasPageShadow=!1,this.opCount=0,this.excludeTextGeometry=o.excludeTextGeometry,this.extendStringsFetching=o.extendStringsFetching,this.fontFaces=[],this.fontFamilies=[],this.viewports=[{}],this.currentVpId=0,this.viewports[0].geom_metrics=this.currentGeomMetrics={arcs:0,circles:0,circ_arcs:0,viewports:0,clips:0,colors:0,db_ids:0,dots:0,fills:0,layers:0,line_caps:0,line_joins:0,line_patterns:0,line_pat_refs:0,plines:0,pline_points:0,line_weights:0,links:0,miters:0,ptris:0,ptri_indices:0,ptri_points:0,rasters:0,texts:0,strings:[]},this.clips=[0],this.strings=[],this.stringDbIds=[],this.stringBoxes=[],this.extendStringsFetching&&(this.stringCharWidths=[],this.stringAngles=[],this.stringPositions=[],this.stringHeights=[]),this.currentStringNumber=-1,this.currentStringBox=new r.LmvBox3,this.linkBoxes=[],this.currentLinkBox=new r.LmvBox3,this.objectNumber=0,this.currentFakeId=-2,this.imageNumber=0,this.linkNumber=0,this.maxObjectNumber=0,this.objectStack=[],this.objectNameStack=[],this.parseObjState={polyTriangle:{},viewport:{},clip:{},raster:{},text:{},fontDef:{},uknown:{}},this.layer=0,this.bgColor="number"==typeof o.bgColor?o.bgColor:4294967295,this.contrastColor=this.color=this.fillColor=4278190080,this.hidePaper&&(this.contrastColor=4294967040),this.isMobile=o&&!!o.isMobile;var _=o&&!!o.isWebGL2,E=this.isMobile&&(_||this.geomMetricsSum>1e7),A=E&&o&&!!o.supportsInstancing,S=E;if(this.max_vcount=this.isMobile?16383:void 0,this.currentVbb=new n.VertexBufferBuilder(A,void 0,this.max_vcount,S),this.meshes=[],this.numCircles=this.numEllipses=this.numPolylines=this.numLineSegs=0,this.numPolytriangles=this.numTriangles=0,this.error=!1,this.offsetX=0,this.offsetY=0,t){this.manifestAvailable=!0,this.imageId2URI={};for(var w=t.assets,M=0,T=w.length;M<T;++M){var C=w[M],P=C.mime;if(-1!==P.indexOf("image/")){var D=C.id;D=D.substr(0,D.indexOf(".")),this.imageId2URI[D]=i+C.URI}"Autodesk.CloudPlatform.PropertyAttributes"===C.type&&this.propertydb.attrs.push({path:C.URI}),"Autodesk.CloudPlatform.PropertyValues"===C.type&&this.propertydb.values.push({path:C.URI}),"Autodesk.CloudPlatform.PropertyIDs"===C.type&&this.propertydb.ids.push({path:C.URI}),"Autodesk.CloudPlatform.PropertyViewables"===C.type&&this.propertydb.viewables.push({path:C.URI}),"Autodesk.CloudPlatform.PropertyOffsets"===C.type&&-1===C.id.indexOf("rcv")&&this.propertydb.offsets.push({path:C.URI}),"Autodesk.CloudPlatform.PropertyAVs"===C.type&&this.propertydb.avs.push({path:C.URI})}}}f.prototype.load=function(e,t){if(t instanceof Uint8Array||(t=new Uint8Array(t)),this.data=t,this.parse(),this.stringBoxes.length){var i=new Float32Array(this.stringBoxes.length);i.set(this.stringBoxes),this.stringBoxes=i}e.loadDoneCB(!0)},f.prototype.loadFrames=function(e){this.loadContext=e;var t=e.data;if(t)t instanceof Uint8Array||(t=new Uint8Array(t)),this.data=t;else if(e.finalFrame&&(this.data=null,this.stringBoxes.length)){var i=new Float32Array(this.stringBoxes.length);i.set(this.stringBoxes),this.stringBoxes=i}this.parseFrames(e.finalFrame),e.loadDoneCB(!0)},f.prototype.pushMesh=function(e){this.meshes.push(e),e.material={skipEllipticals:!this.currentVbb.numEllipticals,skipCircles:!this.currentVbb.numCirculars,skipTriangleGeoms:!this.currentVbb.numTriangleGeoms,skipMiterLines:!this.currentVbb.numMiterLines,useInstancing:this.currentVbb.useInstancing,unpackPositions:!!e.unpackXform},this.currentImage&&(e.material.image=this.currentImage,e.material.image.name=this.imageNumber++,this.currentImage=null)},f.prototype.flushBuffer=function(e,t){if(this.currentVbb.vcount||t){var i=t;if(i=i||this.currentVbb.isFull(e)){if(this.currentVbb.vcount){var n=this.currentVbb.toMesh();s(this.bbox,n.boundingBox),this.pushMesh(n),this.currentVbb.reset(0)}this.loadContext&&this.loadContext.loadDoneCB(!0,t)}}},f.prototype.tx=function(e){return this.sx(e)},f.prototype.ty=function(e){return this.sy(e)},f.prototype.sx=function(e){return e*this.scaleX},f.prototype.sy=function(e){return e*this.scaleY},f.prototype.invertColor=function(e){var t=e>>16&255,i=e>>8&255,n=255&e;return(e>>24&255)<<24|(t=255-t)<<16|(i=255-i)<<8|(n=255-n)},f.prototype.mapColor=function(e,t){if(!this.hidePaper||0!==this.bgColor)return e;var i=255&e;return i<127||i===(65280&e)>>8&&i===(16711680&e)>>16&&t&&(e&=1442840575),e},f.prototype.parsePointPositions=function(){var e=this.stream.getVarints(),t=this.stream.getVarints();return e=p(e),t=p(t),e+=this.offsetX,t+=this.offsetY,this.offsetX=e,this.offsetY=t,[this.tx(e),this.ty(t)]},f.prototype.parserAssert=function(e,t,i){return e!=t&&(l.logger.warn("Expect "+t+"; actual type is "+e+"; in function "+i),this.error=!0,!0)},f.prototype.unhandledTypeWarning=function(e,t){l.logger.warn("Unhandled semantic type : "+t+" in function "+e)},f.prototype.parseObject=function(){var e=this.stream.getVarints();switch(this.objectStack.push(e),e){case u.st_sheet:this.objectNameStack.push("sheet"),this.objectMemberQueue.unshift("paperColor");break;case u.st_viewport:this.objectNameStack.push("viewport"),this.objectMemberQueue.unshift("units","transform");break;case u.st_clip:this.objectNameStack.push("clip"),this.objectMemberQueue.unshift("contourCounts","points","indices");break;case u.st_polytriangle:this.objectNameStack.push("polyTriangle"),this.objectMemberQueue.unshift("points","indices","colors");break;case u.st_raster:this.objectNameStack.push("raster"),this.objectMemberQueue.unshift("position","width","height","imageId");break;case u.st_text:this.currentStringNumber=this.strings.length,0===this.objectNumber&&(this.objectNumber=this.currentFakeId--),this.currentStringBox.makeEmpty(),this.objectNameStack.push("text"),this.objectMemberQueue.unshift("string","position","height","widthScale","rotation","oblique","charWidths");break;case u.st_font_def:this.objectNameStack.push("fontDef"),this.objectMemberQueue.unshift("name","fullName","flags","spacing","panose");break;case u.st_end_object:if(this.objectStack.pop(),this.objectStack.length){switch(this.objectStack.pop()){case u.st_polytriangle:this.actOnPolyTriangle();break;case u.st_viewport:this.actOnViewport();break;case u.st_clip:this.actOnClip();break;case u.st_raster:this.actOnRaster();break;case u.st_text:this.actOnText();break;case u.st_font_def:this.actOnFontDef()}var t=this.objectNameStack.pop(),i=this.parseObjState[t];for(var n in i)i[n]=null}else this.parserAssert(0,1,"parseEndObject (Stack Empty)");this.objectMemberQueue.length=0;break;default:this.objectNameStack.push("unknown"),this.error=!0,this.unhandledTypeWarning("parseObject",e)}},f.prototype.initSheet=function(e){if(!this.hidePaper&&(this.bgColor=e,this.metadata)){var t=this.paperWidth,i=this.paperHeight,n={x:0,y:0},r={x:t,y:0},o={x:0,y:i},s=this.metadata.page_dimensions||{};if(isFinite(s.paper_rotation)&&0!==s.paper_rotation){var a=s.paper_rotation*Math.PI/180,l=Math.cos(a),c=Math.sin(a);r.y=t*c,r.x=t*l,o.x=-i*c,o.y=i*l}isFinite(s.paper_offset_x)&&0!==s.paper_offset_x&&(n.x=s.paper_offset_x),isFinite(s.paper_offset_y)&&0!==s.paper_offset_y&&(n.y=s.paper_offset_y);var h=this.currentVbb,u=[n.x,n.y,n.x+r.x,n.y+r.y,n.x+r.x+o.x,n.y+r.y+o.y,n.x+o.x,n.y+o.y],p=[e,e,e,e],f=[0,1,2,0,2,3];if(!this.noShadow){var m=t*d,g={x:r.x*m/t,y:r.y*m/t},v={x:o.x*m/i,y:o.y*m/i},y={x:n.x+g.x,y:n.y+g.y},b={x:n.x+r.x,y:n.y+r.y},x=4283782485;u=u.concat([y.x-v.x,y.y-v.y,y.x-v.x+r.x,y.y-v.y+r.y,y.x+r.x,y.y+r.y,y.x,y.y,b.x,b.y,b.x+g.x,b.y+g.y,b.x+g.x-v.x+o.x,b.y+g.y-v.y+o.y,b.x-v.x+o.x,b.y-v.y+o.y]),p=p.concat([x,x,x,x,x,x,x,x]),f=f.concat([4,5,6,4,6,7,8,9,10,8,10,11]),this.hasPageShadow=!0}this.addPolyTriangle(u,p,f,4294967295,-1,0,!1),h.addSegment(n.x,n.y,n.x+r.x,n.y+r.y,0,1e-6,4278190080,-1,0,this.currentVpId),h.addSegment(n.x+r.x,n.y+r.y,n.x+r.x+o.x,n.y+r.y+o.y,0,1e-6,4278190080,-1,0,this.currentVpId),h.addSegment(n.x+r.x+o.x,n.y+r.y+o.y,n.x+o.x,n.y+o.y,0,1e-6,4278190080,-1,0,this.currentVpId),h.addSegment(n.x+o.x,n.y+o.y,n.x,n.y,0,1e-6,4278190080,-1,0,this.currentVpId)}},f.prototype.setObjectMember=function(e){if(!this.objectMemberQueue.length)return l.logger.warn("Unexpected object member. "+e+" on object "+this.objectNameStack[this.objectNameStack.length-1]),!1;var t=this.objectMemberQueue.shift(),i=this.objectNameStack[this.objectNameStack.length-1];return"sheet"==i&&"paperColor"==t?(this.initSheet(e),!0):!!i&&(this.parseObjState[i][t]=e,!0)},f.prototype.parseString=function(){var e=this.stream,t=e.getVarints(),i=e.getVarints(),n=e.getString(i);if(t===u.st_object_member){if(this.setObjectMember(n))return}else l.logger.info("Unexpected opcode semantic type for string.");return n},f.prototype.actOnFontDef=function(){var e=this.parseObjState.fontDef;this.fontDefs[++this.fontCount]=e,this.fontId=this.fontCount},f.prototype.parsePoint=function(){var e=this.stream.getVarints(),t=this.parsePointPositions();if(e===u.st_object_member){if(this.setObjectMember(t))return}else l.logger.info("Unexpected opcode semantic type for point.");return t},f.prototype.parsePointsArray=function(){var e=this.stream,t=e.getVarints(),i=e.getVarints();if(i){i/=2;for(var n,r=[],o=0;o<i;++o)n=this.parsePointPositions(),r.push(n[0]),r.push(n[1]);switch(t){case u.st_polyline:return void this.actOnPolylinePointsArray(r);case u.st_dot:return void this.actOnDot(r);case u.st_object_member:if(this.setObjectMember(r))return;break;default:l.logger.info("Unexpected opcode semantic type for points array.")}return r}},f.prototype.parseIntArray=function(){for(var e=this.stream,t=e.getVarints(),i=e.getVarints(),n=[],r=0;r<i;++r)n.push(e.getUint32());if(t===u.st_object_member){if(this.setObjectMember(n))return}else this.unhandledTypeWarning("parseIntArray",t);return n},f.prototype.parseDoubleArray=function(){for(var e=this.stream,t=e.getVarints(),i=e.getVarints(),n=[],r=0;r<i;++r)n.push(e.getFloat64());if(t===u.st_object_member){if(this.setObjectMember(n))return}else this.unhandledTypeWarning("parseDoubleArray",t);return n},f.prototype.parseByteArray=function(){for(var e=this.stream,t=e.getVarints(),i=e.getVarints(),n=[],r=0;r<i;++r)n.push(e.getUint8());if(t===u.st_object_member){if(this.setObjectMember(n))return}else this.unhandledTypeWarning("parseByteArray",t);return n},f.prototype.parseVarintArray=function(){for(var e=this.stream,t=e.getVarints(),i=[],n=e.getVarints(),r=0;r<n;++r)i.push(e.getVarints());if(t===u.st_object_member){if(this.setObjectMember(i))return}else this.unhandledTypeWarning("parseVarIntArray",t);return i},f.prototype.parseInt=function(){var e=this.stream,t=e.getVarints(),i=e.getUint32();switch(t){case u.st_color:this.color=this.mapColor(i,!1),this.currentGeomMetrics.colors++;break;case u.st_fill:this.fill=!0,this.fillColor=this.mapColor(i,!0),this.currentGeomMetrics.fills++;break;case u.st_object_member:if(this.setObjectMember(i))return;default:this.unhandledTypeWarning("parseInt",t)}return i},f.prototype.parseVoid=function(){var e=this.stream.getVarints();if(e===u.st_fill_off)this.fill=!1,this.currentGeomMetrics.fills++;else this.unhandledTypeWarning("parseVoid",e)},f.prototype.parseVarint=function(){var e=this.stream,t=e.getVarints(),i=e.getVarints();switch(t){case u.st_line_weight:this.lineWeight=this.tx(i),this.currentGeomMetrics.line_weights++;break;case u.st_line_caps:this.currentGeomMetrics.line_caps++;break;case u.st_line_join:this.currentGeomMetrics.line_joins++;break;case u.st_object_id:case u.st_markup_id:this.objectNumber=i,this.maxObjectNumber=Math.max(this.maxObjectNumber,i),this.currentGeomMetrics.db_ids++;break;case u.st_link:this.linkNumber&&(this.linkBoxes[this.linkNumber]=this.currentLinkBox.clone(),this.currentLinkBox.makeEmpty()),this.linkNumber=i;break;case u.st_layer:this.currentGeomMetrics.layers++,this.layer=this.layersMap[i];break;case u.st_font_ref:this.fontId=i;break;case u.st_object_member:if(this.setObjectMember(i))return}return i},f.prototype.parseFloat=function(){var e=this.stream,t=e.getVarints(),i=e.getFloat32();switch(t){case u.st_miter_angle:case u.st_miter_length:break;case u.st_object_member:if(this.setObjectMember(i))return}return i},f.prototype.parseCircularArc=function(){var e=this.stream,t=e.getVarints();if(!this.parserAssert(t,u.st_arc,"parseCircularArc")){var i=this.parsePointPositions(),n=e.getVarints(),r=e.getFloat32(),o=e.getFloat32();this.actOnCircularArc(i[0],i[1],r,o,this.sx(n))}},f.prototype.parseCircle=function(){var e=this.stream,t=e.getVarints();if(!this.parserAssert(t,u.st_arc,"parseCircle")){var i=this.parsePointPositions(),n=e.getVarints();this.actOnCompleteCircle(i[0],i[1],this.sx(n))}},f.prototype.parseArc=function(){var e=this.stream,t=e.getVarints();if(!this.parserAssert(t,u.st_arc,"parseArc")){var i=this.parsePointPositions(),n=e.getVarints(),r=e.getVarints(),o=e.getFloat32(),s=e.getFloat32(),a=e.getFloat32();this.actOnArc(i[0],i[1],s,a,this.sx(n),this.sy(r),o)}},f.prototype.parseDataType=function(){var e=this.stream.getVarints();switch(e){case h.dt_void:this.parseVoid();break;case h.dt_int:this.parseInt();break;case h.dt_object:this.parseObject();break;case h.dt_varint:this.parseVarint();break;case h.dt_point_varint:this.parsePoint();break;case h.dt_float:this.parseFloat();break;case h.dt_point_varint_array:this.parsePointsArray();break;case h.dt_circular_arc:this.parseCircularArc();break;case h.dt_circle:this.parseCircle();break;case h.dt_arc:this.parseArc();break;case h.dt_int_array:this.parseIntArray();break;case h.dt_varint_array:this.parseVarintArray();break;case h.dt_byte_array:this.parseByteArray();break;case h.dt_string:this.parseString();break;case h.dt_double_array:this.parseDoubleArray();break;default:this.error=!0,l.logger.info("Data type not supported yet: "+e)}},f.prototype.readHeader=function(){var e=this.stream=new a.A(this.data),t=e.getString(3);if("F2D"!==t)return l.logger.error("Invalid F2D header : "+t,(0,c.errorCodeString)(c.ErrorCodes.BAD_DATA)),!1;var i=e.getString(2);if("01"!==i)return l.logger.error("Only support f2d major version 1; actual version is : "+i,(0,c.errorCodeString)(c.ErrorCodes.BAD_DATA)),!1;if("."!==e.getString(1))return l.logger.error("Invalid version delimiter.",(0,c.errorCodeString)(c.ErrorCodes.BAD_DATA)),!1;e.getString(2);return!0},f.prototype.parse=function(){if(this.readHeader()){for(var e=this.stream;e.offset<e.byteLength&&(this.parseDataType(),!this.error);)this.opCount++;this.linkNumber&&(this.linkBoxes[this.linkNumber]=this.currentLinkBox.clone(),this.currentLinkBox.makeEmpty()),this.flushBuffer(0,!0),this.currentVbb=null,this.stream=null,this.data=null,l.logger.info("F2d parse: data types count : "+this.opCount)}},f.prototype.parseFrames=function(e){if(this.data)for(var t=this.stream=new a.A(this.data);t.offset<t.byteLength&&(this.parseDataType(),!this.error);)this.opCount++;else e||l.logger.warn("Unexpected F2D parse state: If there is no data, we only expect a flush command, but flush was false.");e&&this.flushBuffer(0,!0),this.stream=null,this.data=null},f.prototype.actOnPolylinePointsArray=function(e){this.flushBuffer();for(var t=e.length/2,i=0,n=e[0],r=e[1],o=1;o<t;++o){var s=e[2*o],a=e[2*o+1];this.currentVbb.addSegment(n,r,s,a,i,this.lineWeight,this.color,this.objectNumber,this.layer,this.currentVpId),i+=Math.sqrt((s-n)*(s-n)+(a-r)*(a-r)),n=s,r=a}this.numPolylines++,this.numLineSegs+=t-1,this.currentGeomMetrics.plines++,this.currentGeomMetrics.pline_points+=t-1},f.prototype.actOnDot=function(e){this.currentGeomMetrics.dots++;var t=e[0],i=e[1];this.actOnCompleteCircle(t,i,this.sx(1),!0)},f.prototype.actOnCompleteCircle=function(e,t,i,n){this.flushBuffer(),this.numCircles++,n||this.currentGeomMetrics.circles++,this.fill?this.currentVbb.addSegment(e,t,e,t,0,2*i,this.color,this.objectNumber,this.layer,this.currentVpId,!0,!1,!0):this.currentVbb.addArc(e,t,0,2*Math.PI,i,i,0,this.lineWeight,this.color,this.objectNumber,this.layer,this.currentVpId)},f.prototype.actOnCircularArc=function(e,t,i,n,r){this.numCircles++,this.currentGeomMetrics.circ_arcs++,this.flushBuffer(),this.currentVbb.addArc(e,t,i,n,r,r,0,this.lineWeight,this.color,this.objectNumber,this.layer,this.currentVpId)},f.prototype.actOnArc=function(e,t,i,n,r,o,s){this.numEllipses++,this.currentGeomMetrics.arcs++,this.flushBuffer(),this.currentVbb.addArc(e,t,i,n,r,o,s,this.lineWeight,this.color,this.objectNumber,this.layer,this.currentVpId)},f.prototype.actOnRaster=function(){if(this.manifestAvailable){this.flushBuffer(4,!0);var e=this.parseObjState.raster,t=e.position,i=e.imageId,n=this.imageId2URI[i],r=this.sx(e.width),o=this.sy(e.height),s=t[0]+.5*r,a=t[1]-.5*o;this.currentVbb.addTexturedQuad(s,a,r,o,0,4278255615,this.objectNumber,this.layer,this.currentVpId),this.currentImage={dataURI:n},this.flushBuffer(0,!0),this.currentGeomMetrics.rasters++}},f.prototype.actOnClip=function(){var e=this.parseObjState.clip;this.parseObjState.clip={},this.clips.push(e),this.currentGeomMetrics.clips++},f.prototype.actOnText=function(){this.strings[this.currentStringNumber]=this.parseObjState.text.string,this.currentGeomMetrics.texts++,this.currentGeomMetrics.strings.push(this.parseObjState.text.string),this.stringDbIds[this.currentStringNumber]=this.objectNumber,this.stringBoxes.push(this.currentStringBox.min.x,this.currentStringBox.min.y,this.currentStringBox.max.x,this.currentStringBox.max.y),this.extendStringsFetching&&(this.stringCharWidths.push(this.parseObjState.text.charWidths),this.stringAngles.push(this.parseObjState.text.rotation),this.stringPositions.push(this.parseObjState.text.position),this.stringHeights.push(this.parseObjState.text.height)),this.currentStringBox.makeEmpty(),this.currentStringNumber=-1,this.objectNumber<-1&&(this.objectNumber=0)};var m=new o.LmvVector3;f.prototype.addPolyTriangle=function(e,t,i,n,r,o,s){var a=this,c=null,h=-1;function d(e,t){if(e>t){var i=e;e=t,t=i}if(c[e]){var n=c[e],r=n.lastIndexOf(t);-1==r?n.push(t):n[r]=-1}else c[e]=[t]}function p(i,s){if(i>s){var u=i;i=s,s=u}var d=c[i];d&&(-1!=d.indexOf(s)&&(a.flushBuffer(4),a.currentVbb.addSegment(e[2*i],e[2*i+1],e[2*s],e[2*s+1],0,h,a.mapColor(t?t[i]:n,!0),r,o,a.currentVpId),t&&t[i]!=t[s]&&l.logger.warn("Gouraud triangle encountered. Will have incorrect antialiasing.")))}if(this.objectStack[this.objectStack.length-1]==u.st_text&&(h=-.5),s){c=new Array(e.length/2);for(var f=0,g=i.length;f<g;f+=3){var v=i[f],y=i[f+1],b=i[f+2];d(v,y),d(y,b),d(b,v)}}if(-1!==this.currentStringNumber||this.linkNumber){var x=e.length/2;for(f=0;f<x;++f)m.set(e[2*f],e[2*f+1],0),-1!==this.currentStringNumber&&this.currentStringBox.expandByPoint(m),this.linkNumber&&this.currentLinkBox.expandByPoint(m)}if(this.currentVbb.useInstancing)for(x=i.length,f=0;f<x;f+=3){v=i[f],y=i[f+1],b=i[f+2];this.flushBuffer(4),this.currentVbb.addTriangleGeom(e[2*v],e[2*v+1],e[2*y],e[2*y+1],e[2*b],e[2*b+1],this.mapColor(t?t[v]:n,!0),r,o,this.currentVpId),s&&(p(v,y),p(y,b),p(b,v))}else{x=e.length/2;this.flushBuffer(x);var _=this.currentVbb,E=_.vcount;for(f=0;f<x;++f){var A=e[2*f],S=e[2*f+1];_.addVertexPolytriangle(A,S,this.mapColor(t?t[f]:n,!0),r,o,this.currentVpId)}_.addIndices(i,E),s&&function(){for(var i=0,s=c.length;i<s;i++){var u=c[i];if(u)for(var d=0;d<u.length;d++){var p=u[d];-1!=p&&(a.flushBuffer(4),a.currentVbb.addSegment(e[2*i],e[2*i+1],e[2*p],e[2*p+1],0,h,a.mapColor(t?t[i]:n,!0),r,o,a.currentVpId),t&&t[i]!=t[p]&&l.logger.warn("Gouraud triangle encountered. Will have incorrect antialiasing."))}}}()}},f.prototype.actOnPolyTriangle=function(){var e=this.parseObjState.polyTriangle;this.parseObjState.polyTriangle={};var t=e.points,i=e.indices,n=e.colors;if(t&&i){if(this.objectStack[this.objectStack.length-1]==u.st_text){if(this.excludeTextGeometry)return}else this.currentGeomMetrics.ptris++,this.currentGeomMetrics.ptri_points+=t.length/2,this.currentGeomMetrics.ptri_indices+=i.length;this.numPolytriangles++,this.numTriangles+=i.length/3,this.addPolyTriangle(t,n,i,this.color,this.objectNumber,this.layer,!0)}else l.logger.warn("Malformed polytriangle.")},f.prototype.actOnViewport=function(){var e=this.parseObjState.viewport;this.parseObjState.viewport={},e.geom_metrics=this.currentGeomMetrics={arcs:0,circles:0,circ_arcs:0,viewports:0,clips:0,colors:0,db_ids:0,dots:0,fills:0,layers:0,line_caps:0,line_joins:0,line_patterns:0,line_pat_refs:0,plines:0,pline_points:0,line_weights:0,links:0,miters:0,ptris:0,ptri_indices:0,ptri_points:0,rasters:0,texts:0,strings:[]},this.viewports.push(e),this.currentVpId=this.viewports.length-1},f.prototype.createLayerGroups=function(e){var t=this.layersRoot={name:"root",id:"root",childrenByName:{},isLayer:!1},i=0,n=0;for(var r in e){var o=parseInt(r),s=e[r],a="string"==typeof s?s:s.name;a||(a=r);var l=a.split("|"),c=t;if(l.length>1)for(var h=0;h<l.length-1;++h){var u=l[h],d=c.childrenByName[u];d||(d={name:u,id:"group-"+i++,childrenByName:{},isLayer:!1},c.childrenByName[u]=d),c=d}c.childrenByName[a]={name:a,index:o,id:n++,childrenByName:{},isLayer:!0}}!function e(t){var i=Object.keys(t.childrenByName).map((function(e){return t.childrenByName[e]}));if(delete t.childrenByName,i.length){t.children=i,t.childCount=0;for(var n=0;n<i.length;++n)t.childCount+=e(i[n]);i.sort((function(e,t){return e.isLayer&&!t.isLayer?-1:!e.isLayer&&t.isLayer?1:e.name.localeCompare(t.name,void 0,{sensitivity:"base",numeric:!0})}))}return t.isLayer?1:t.childCount}(this.layersRoot)}},24401:e=>{for(var t=new Array(256),i=0;i<256;i++){var n=i.toString(16);1===n.length&&(n="0"+n),t[i]=n}var r=new Array(20);var o=new Array(10);function s(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:0}e.exports={getHexStringPacked:function(e,t,i){for(var n=20===i?o:[],r=0;r<i;r+=2){var s=e[t+r],a=e[t+r+1];n[r/2]=a<<8|s}return String.fromCharCode.apply(null,n)},unpackHexString:function(e){for(var i=10===e.length?r:[],n=0;n<e.length;n++){var o=e.charCodeAt(n);i[2*n]=t[255&o],i[2*n+1]=t[o>>8&255]}return i.join("")},hexToBin:function(e,i,r){if(10===e.length)return void function(e,i,n){let r=n;for(var o=0;o<e.length;o++){var a=e.charCodeAt(o);let n=t[255&a],l=t[a>>8&255],c=s(n.charCodeAt(0)),h=s(n.charCodeAt(1));i[r++]=c<<4|h,c=s(l.charCodeAt(0)),h=s(l.charCodeAt(1)),i[r++]=c<<4|h}}(e,i,r);let o=r;for(let e=0;e<n.length;e+=2){let t=s(n.charCodeAt(e)),r=s(n.charCodeAt(e+1));i[o++]=t<<4|r}}}},73098:(e,t,i)=>{"use strict";i.r(t),i.d(t,{readLmvBufferGeom:()=>U,serializeLmvBufferGeom:()=>k});var n=i(16840),r=i(65258),o=i(39651),s=i(62206);const a=0,l=1,c=2,h=3,u=4,d=5,p=0,f=1,m=2,g=3,v=4,y=5,b=6,x=7,_=8,E=9,A=10,S=1,w=2,M=3,T={position:c,normal:h,index:a,indexlines:l,color:d},C={};C[c]="position",C[h]="normal",C[a]="index",C[l]="indexlines",C[d]="color",C[u]="uv";const P={};function D(e){for(var t=[],i=0;i<e.length;i+=2)t.push([e[i],e[i+1]]);for(i=0;i<t.length;i++){if((r=t[i])[0]>r[1]){var n=r[0];r[0]=r[1],r[1]=n}}t.sort((function(e,t){return e[0]-t[0]}));var r=t[0],o=0;e[o]=r[0],e[o+1]=r[1]-r[0],o+=2;for(i=1;i<t.length;i++,o+=2)r=t[i],e[o]=r[0]-t[i-1][0],e[o+1]=r[1]-r[0]}function L(e){if(e.length){e[1]+=e[0],e[2]+=e[0];for(var t=3;t<e.length;t+=3)e[t]+=e[t-3],e[t+1]+=e[t],e[t+2]+=e[t]}}function I(e){if(e.length){e[1]+=e[0];for(var t=2;t<e.length;t+=2)e[t]+=e[t-2],e[t+1]+=e[t]}}function R(e){var t=C[e];return t||(console.error("Unknown vertex attribute"),u)}function O(){}function N(e){this.buffer=e,this.readOffset=0,this.meshFlag=0,this.numBuffers=0,this.numAttributes=0,this.bufferOffsets=[],this.attributes=[],this.buffers=[]}function k(e){var t=new O,i=[];let n,r,o,a;if(!(0,s.isInterleavedGeometry)(e))return console.error("Unexpected non-interleaved vertex buffer"),null;r=e.vb,n=e.vbstride,o=(0,s.getIndexBufferArray)(e),a=(0,s.getLineIndexBufferArray)(e),i=[r.byteLength,o.byteLength],a&&i.push(a.byteLength);var l,c,h=Object.keys(e.attributes),d=0;e.isLines&&(d|=S),e.isWideLines&&(d|=M),e.isPoints&&(d|=w),t.beginHeader(d,h.length,i);for(var p=0;p<h.length;p++){var f=e.attributes[h[p]],m=(l=h[p],c=void 0,void 0!==(c=T[l])?c:(0===l.indexOf("uv")||console.warn("Unknown attribute name"),u));"index"===h[p]?t.addAttribute(m,f,0,1):"indexlines"===h[p]?t.addAttribute(m,f,0,2):t.addAttribute(m,f,n,0)}t.endHeader();var g=Buffer.from(r.buffer,r.byteOffset,r.byteLength);return t.addBuffer(g),e.isLines?D(o):function(e){for(var t,i,n=[],r=0;r<e.length;r+=3)n.push([e[r],e[r+1],e[r+2]]);for(r=0;r<n.length;r++)for(var o=n[r];o[0]>o[1]||o[0]>o[2];)i=void 0,i=(t=o)[0],t[0]=t[1],t[1]=t[2],t[2]=i;n.sort((function(e,t){return e[0]-t[0]})),o=n[0];var s=0;for(e[s]=o[0],e[s+1]=o[1]-o[0],e[s+2]=o[2]-o[0],s+=3,r=1;r<n.length;r++,s+=3)o=n[r],e[s]=o[0]-n[r-1][0],e[s+1]=o[1]-o[0],e[s+2]=o[2]-o[0]}(o),g=Buffer.from(o.buffer,o.byteOffset,o.byteLength),t.addBuffer(g),a&&(D(a),g=Buffer.from(a.buffer,a.byteOffset,a.byteLength),t.addBuffer(g)),t.end()}P[p]=1,P[f]=2,P[m]=1,P[g]=2,P[v]=1,P[y]=2,P[b]=1,P[x]=2,P[_]=4,P[E]=4,P[A]=4,O.prototype.beginHeader=function(e,t,i){var n=8,r=i.length;for(n+=4*(r-1),n+=5*t;n%4!=0;)n++;for(var o=0,s=0;s<i.length;s++)o+=i[s];this.buffer=Buffer.alloc(n+o),this.writeOffset=0;for(s=0;s<4;s++)this.writeOffset=this.buffer.writeUInt8("OTG0".charCodeAt(s),this.writeOffset);this.writeOffset=this.buffer.writeUInt16LE(e,this.writeOffset),this.writeOffset=this.buffer.writeUInt8(r,this.writeOffset),this.writeOffset=this.buffer.writeUInt8(t,this.writeOffset);var a=i[0];for(s=1;s<i.length;s++)this.writeOffset=this.buffer.writeUInt32LE(a,this.writeOffset),a+=i[s]},O.prototype.addAttribute=function(e,t,i,n){this.writeOffset=this.buffer.writeUInt8(e,this.writeOffset),e===a||e===l?(this.writeOffset=this.buffer.writeUInt8(function(e){var t=g,i=e.bytesPerItem||2;return 1===i?t=m:2===i?t=g:4===i&&(t=A),t<<4|15&e.itemSize}(t),this.writeOffset),this.writeOffset=this.buffer.writeUInt8(4*(t.itemOffset||0),this.writeOffset),this.writeOffset=this.buffer.writeUInt8(4*(i||0),this.writeOffset),this.writeOffset=this.buffer.writeUInt8(n,this.writeOffset)):(this.writeOffset=this.buffer.writeUInt8(function(e){var t=_,i=e.bytesPerItem||4;return 1===i?t=e.normalized?b:m:2===i&&(t=e.normalized?x:g),t<<4|15&e.itemSize}(t),this.writeOffset),this.writeOffset=this.buffer.writeUInt8(4*(t.itemOffset||0),this.writeOffset),this.writeOffset=this.buffer.writeUInt8(4*(i||0),this.writeOffset),this.writeOffset=this.buffer.writeUInt8(n,this.writeOffset))},O.prototype.endHeader=function(){for(;this.writeOffset%4!=0;)this.writeOffset=this.buffer.writeUInt8(0,this.writeOffset)},O.prototype.addBuffer=function(e){e.copy(this.buffer,this.writeOffset),this.writeOffset+=e.length},O.prototype.end=function(){return this.writeOffset!==this.buffer.length&&console.error("Incorrect encoding buffer size"),this.buffer},N.prototype.readNodeJS=function(){if("OTG0"!==this.buffer.toString("ascii",0,4))return console.error("Invalid OTG header"),!1;if(this.readOffset=4,this.meshFlag=this.buffer.readUInt16LE(this.readOffset),this.readOffset+=2,this.numBuffers=this.buffer.readUInt8(this.readOffset),this.readOffset++,this.numAttributes=this.buffer.readUInt8(this.readOffset),this.readOffset++,this.numBuffers){this.bufferOffsets.push(0);for(var e=1;e<this.numBuffers;e++){var t=this.buffer.readUInt32LE(this.readOffset);this.readOffset+=4,this.bufferOffsets.push(t)}}for(e=0;e<this.numAttributes;e++){var i={};i.name=this.buffer.readUInt8(this.readOffset),this.readOffset++;var n=this.buffer.readUInt8(this.readOffset);this.readOffset++,i.itemSize=15&n,i.type=n>>4,i.bytesPerItem=P[i.type],i.normalized=i.type===v||i.type===y||i.type===b||i.type===x,i.itemOffset=this.buffer.readUInt8(this.readOffset)/4,this.readOffset++,i.itemStride=this.buffer.readUInt8(this.readOffset)/4,this.readOffset++,i.bufferIndex=this.buffer.readUInt8(this.readOffset),this.readOffset++,this.attributes.push(i)}for(;this.readOffset%4!=0;)this.readOffset++;for(e=0;e<this.bufferOffsets.length;e++){var r,o=this.readOffset+this.bufferOffsets[e];r=e<this.bufferOffsets.length-1?this.readOffset+this.bufferOffsets[e+1]:this.buffer.length,this.buffers.push(this.buffer.slice(o,r))}return!0},N.prototype.readWeb=function(){var e=new r.A(this.buffer);if("OTG0"!==e.getString(4))return console.error("Invalid OTG header"),!1;if(this.meshFlag=e.getUint16(),this.numBuffers=e.getUint8(),this.numAttributes=e.getUint8(),this.numBuffers){this.bufferOffsets.push(0);for(var t=1;t<this.numBuffers;t++){var i=e.getUint32();this.bufferOffsets.push(i)}}for(t=0;t<this.numAttributes;t++){var n={};n.name=e.getUint8();var o=e.getUint8();n.itemSize=15&o,n.type=o>>4,n.bytesPerItem=P[n.type],n.normalized=n.type===v||n.type===y||n.type===b||n.type===x,n.itemOffset=e.getUint8()/4,n.itemStride=e.getUint8()/4,n.bufferIndex=e.getUint8(),this.attributes.push(n)}for(;e.offset%4!=0;)e.offset++;for(t=0;t<this.bufferOffsets.length;t++){var s,a=e.offset+this.bufferOffsets[t];s=t<this.bufferOffsets.length-1?e.offset+this.bufferOffsets[t+1]:e.byteLength,this.buffers.push(this.buffer.subarray(a,s))}return!0},N.prototype.read=function(){return(0,n.isNodeJS)()&&this.buffer instanceof Buffer?this.readNodeJS():this.readWeb()};var F=new o.LmvBox3;F.min.x=-.5,F.min.y=-.5,F.min.z=-.5,F.max.x=.5,F.max.y=.5,F.max.z=.5;var V={center:{x:0,y:0,z:0},radius:Math.sqrt(.75)};function U(e,t){var i=new N(e);if(!i.read())return console.error("Failed to parse OTG geometry"),null;for(var n={vblayout:{},vb:new Float32Array(i.buffers[0].buffer,i.buffers[0].byteOffset,i.buffers[0].byteLength/4),isLines:(3&i.meshFlag)===S,isWideLines:(3&i.meshFlag)===M,isPoints:(3&i.meshFlag)===w,boundingBox:F,boundingSphere:V},r=0;r<i.attributes.length;r++){var o=i.attributes[r];if(o.name===a){var s=i.buffers[1];1===o.bytesPerItem?n.indices=s:2===o.bytesPerItem?n.indices=new Uint16Array(s.buffer,s.byteOffset,s.byteLength/o.bytesPerItem):4===o.bytesPerItem&&(n.indices=new Uint32Array(s.buffer,s.byteOffset,s.byteLength/o.bytesPerItem)),n.isLines?I(n.indices):L(n.indices)}else if(o.name===l){if(!t){var c=i.buffers[2];1===o.bytesPerItem?n.iblines=c:2===o.bytesPerItem?n.iblines=new Uint16Array(c.buffer,c.byteOffset,c.byteLength/o.bytesPerItem):4===o.bytesPerItem&&(n.iblines=new Uint32Array(c.buffer,c.byteOffset,c.byteLength/o.bytesPerItem)),I(n.iblines)}}else{var h=R(o.name);n.vbstride?n.vbstride!==o.itemStride&&console.error("Unexpected vertex buffer stride mismatch."):n.vbstride=o.itemStride,o.itemOffset>=o.itemStride||(n.vblayout[h]={bytesPerItem:o.bytesPerItem,offset:o.itemOffset,normalized:o.normalized,itemSize:o.itemSize})}}return{mesh:n,packId:0,meshIndex:0}}},94094:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Empty2DModelLoader:()=>n});class n{constructor(e){this.viewer3DImpl=e}loadFile(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;const r=t.width||100,o=t.height||100;n&&n(),this.svf={is2d:!0,viewports:[],layersMap:{0:0},layerCount:1,bbox:new THREE.Box3(new THREE.Vector3(0,0,0),new THREE.Vector3(r,o,0)),fragments:{length:1,fragId2dbId:[0],dbId2fragId:{},transforms:new Float32Array(12),boxes:[0,0,0,r,o,0]},loadOptions:{bubbleNode:new Autodesk.Viewing.BubbleNode({urn:"Dummy_urn",guid:"Dummy_guid"})},metadata:{page_dimensions:{page_width:r,page_height:o,logical_width:r,logical_height:o,logical_offset_x:0,logical_offset_y:0,page_units:"inch"}},strings:[],stringDbIds:[],loadDone:!0};const s=new Autodesk.Viewing.Model(this.svf);s.initialize(),s.loader=this,this.model=s,i(null,s),this.viewer3DImpl.api.dispatchEvent({type:Autodesk.Viewing.MODEL_ROOT_LOADED_EVENT,svf:this.svf,model:s}),this.viewer3DImpl.onLoadComplete(s)}dtor(){}is2d(){return!0}is3d(){return!1}}},24264:(e,t,i)=>{"use strict";i.r(t),i.d(t,{F2DLoader:()=>x,OUTPUT_TYPE:()=>b});var n=i(49720),r=i(22769),o=i(62206),s=i(82079),a=i(91531),l=i(72614),c=i(32154),h=i(85218),u=i(47899),d=i(16840),p=i(33423),f=i(79291),m=i(75121),g=i(18989),v=i(41434);const y=Autodesk.Viewing.Private,b={GEOMETRY:"geometry",VERTEX_BUFFER:"vertexBuffer"};function x(e){this.viewer3DImpl=e,this.loading=!1,this.tmpMatrix=new v.Matrix4,this.logger=n.logger,this.loadTime=0}x.prototype.dtor=function(){this.initWorkerScriptToken&&(this.initWorkerScriptToken.cancel(),this.initWorkerScriptToken=null,n.logger.debug("F2D loader dtor: on init worker script.")),this.streamingWorker&&(this.streamingWorker.terminate(),this.streamingWorker=null,n.logger.debug("F2D loader dtor: on streaming worker.")),this.parsingWorker&&(this.parsingWorker.terminate(),this.parsingWorker=null,n.logger.debug("F2D loader dtor: on parsing worker.")),this.svf&&this.svf.propDbLoader&&(this.svf.propDbLoader.dtor(),this.svf.propDbLoader=null),this.viewer3DImpl=null,this.loading=!1,this.tmpMatrix=null,this.logger=null,this.loadTime=0,this.svf=null,this.model=null,this.options=null},x.prototype.isValid=function(){return!!this.viewer3DImpl},x.prototype.loadFile=function(e,t,i,r){if(!this.viewer3DImpl)return n.logger.log("F2D loader was already destructed. So no longer usable."),!1;if(this.loading)return n.logger.log("Loading of F2D already in progress. Ignoring new request."),!1;this.loading=!0;var o=e.indexOf("urn:");if(-1!=o){var s=(e=decodeURIComponent(e)).substr(o,e.substr(o).indexOf("/"));n.logger.log("Extracted URN: "+s);var a=s.lastIndexOf(":");this.svfUrn=s.substr(a+1)}else this.svfUrn=e;this.sharedDbPath=t.sharedPropertyDbPath,this.currentLoadPath=e,this.acmSessionId=t.acmSessionId,this.queryParams="",this.acmSessionId&&(this.queryParams="acmsession="+this.acmSessionId),this.options=t,this.options.placementTransform?this.modelScale=this.options.modelScale||this.options.placementTransform.getMaxScaleOnAxis():this.modelScale=this.options.modelScale||1,this.isf2d=!0;var l=this;return this.initWorkerScriptToken=(0,h.initWorkerScript)((function(){l.loadFydoCB(e,t,i,r)})),!0},x.prototype.loadFydoCB=function(e,t,i,r){this.t0=Date.now();var o=(0,c.pathToURL)(e);this.streamingWorker=(0,h.createWorker)(!0),this.parsingWorker=(0,h.createWorker)();var l,u,f=this,g=!0,y=this.viewer3DImpl.glrenderer();y&&(l=y.supportsInstancedArrays(),u=y.capabilities.isWebGL2);var x=function(){f.parsingWorker.terminate(),f.parsingWorker=null};this.streamingWorker.addEventListener("message",(function(e){var c;f.isValid()&&(g&&r&&(g=!1,r()),e.data&&"F2DBLOB"==e.data.type?(c={operation:"PARSE_F2D",data:e.data.buffer,metadata:e.data.metadata,manifest:e.data.manifest,basePath:e.data.basePath,f2dLoadOptions:{modelSpace:t.modelSpace,bgColor:t.bgColor,noShadow:t.noShadow,isMobile:(0,d.isMobileDevice)(),supportsInstancing:l,isWebGL2:u,excludeTextGeometry:t.excludeTextGeometry,outputType:t.outputType||b.VERTEX_BUFFER,extendStringsFetching:t.extendStringsFetching},url:o},f.parsingWorker.doOperation(c,[c.data]),f.streamingWorker.terminate(),f.streamingWorker=null):e.data&&"F2DSTREAM"==e.data.type?(c={operation:"PARSE_F2D_FRAME",data:e.data.frames,url:o,f2dLoadOptions:{modelSpace:t.modelSpace,bgColor:t.bgColor,noShadow:t.noShadow,isMobile:(0,d.isMobileDevice)(),supportsInstancing:l,isWebGL2:u,excludeTextGeometry:t.excludeTextGeometry,outputType:t.outputType||b.VERTEX_BUFFER,extendStringsFetching:t.extendStringsFetching}},e.data.metadata&&(c.metadata=e.data.metadata,c.manifest=e.data.manifest),e.data.finalFrame&&(c.finalFrame=!0,f.streamingWorker.terminate(),f.streamingWorker=null,f.fileMemorySize/=2),e.data.progress&&f.viewer3DImpl.signalProgress(100*e.data.progress,a.ProgressState.LOADING),f.parsingWorker.doOperation(c,c.data?[c.data]:void 0)):e.data&&"F2DAssetURL"==e.data.type||e.data&&e.data.assetRequest||e.data&&e.data.progress||(e.data&&e.data.debug?n.logger.debug(e.data.message):e.data&&e.data.error?(f.loading=!1,f.streamingWorker.terminate(),f.streamingWorker=null,i&&i(e.data.error)):(n.logger.error("F2D download failed.",(0,s.errorCodeString)(s.ErrorCodes.NETWORK_FAILURE)),f.loading=!1,f.streamingWorker.terminate(),f.streamingWorker=null)))}),!1);var _=t.outputType===b.GEOMETRY?function(e){if(f.isValid()&&(g&&r&&(g=!1,r()),e.data&&e.data.f2d)){f.svf=e.data.f2d;const t=e.data.f2d.geometry;x(),n.logger.info("Num polylines: "+t.numPolylines),n.logger.info("Line segments: "+t.numLineSegs),n.logger.info("Circular arcs: "+t.numCircles),n.logger.info("Ellipitcal arcs:"+t.numEllipses),f.onModelRootLoadDone(f.svf),i&&i(null,f.model),f.viewer3DImpl.api.dispatchEvent({type:p.MODEL_ROOT_LOADED_EVENT,svf:f.svf,model:f.model}),f.onGeomLoadDone()}}:function(e){var t,o;if(f.isValid())if(g&&r&&(g=!1,r()),e.data&&e.data.f2d){for(t=f.svf=e.data.f2d,x(),n.logger.info("Num polylines: "+t.numPolylines),n.logger.info("Line segments: "+t.numLineSegs),n.logger.info("Circular arcs: "+t.numCircles),n.logger.info("Ellipitcal arcs:"+t.numEllipses),n.logger.info("Plain triangles:"+t.numTriangles),n.logger.info("Total # of op codes generated by fydo.parse: "+t.opCount),f.onModelRootLoadDone(f.svf),i&&i(null,f.model),f.viewer3DImpl.api.dispatchEvent({type:p.MODEL_ROOT_LOADED_EVENT,svf:f.svf,model:f.model}),o=0;o<t.meshes.length;o++)f.processReceivedMesh2D(t.meshes[o],o);t.meshes=null,f.onGeomLoadDone(),f.loading=!1}else if(e.data&&e.data.f2dframe){var a=0;if(e.data.meshes){var l=e.data.bbox;f.svf.bbox=(new v.Box3).copy(l),f.svf.modelSpaceBBox=f.svf.bbox.clone(),f.svf.placementTransform&&f.svf.bbox.applyMatrix4(f.svf.placementTransform),a=e.data.baseIndex}else f.svf=e.data.f2dframe,a=e.data.baseIndex;if((t=f.svf).fragments&&t.fragments.initialized||(f.onModelRootLoadDone(t),i&&i(null,f.model),f.viewer3DImpl.api.dispatchEvent({type:p.MODEL_ROOT_LOADED_EVENT,svf:t,model:f.model})),e.data.meshes&&e.data.meshes.length)for(o=0;o<e.data.meshes.length;o++)f.processReceivedMesh2D(e.data.meshes[o],a+o);if(e.data.finalFrame){var c=e.data.cumulativeProps;for(var h in c)t[h]=c[h];x(),f.onGeomLoadDone(),f.loading=!1}}else e.data&&e.data.progress||(e.data&&e.data.debug?n.logger.debug(e.data.message):e.data&&e.data.error?(f.loading=!1,x(),n.logger.error("Error while processing F2d: "+JSON.stringify(e.data.error.args)),i&&i(e.data.error)):(n.logger.error("F2D download failed.",(0,s.errorCodeString)(s.ErrorCodes.NETWORK_FAILURE)),f.loading=!1,x()))};this.parsingWorker.addEventListener("message",_,!1);var E={operation:"STREAM_F2D",url:o,objectIds:t.ids,queryParams:this.queryParams};return this.streamingWorker.doOperation(m.endpoint.initLoadContext(E)),!0},x.prototype.processReceivedMesh=function(e){var t=e.packId+":"+e.meshIndex,i=this.svf,s=i.fragments,a=s.mesh2frag[t];if(void 0===a)return void n.logger.warn("Mesh "+t+" was not referenced by any fragments.");Array.isArray(a)||(a=[a]);var l=e.mesh;if(l.dbIds[-1]&&this.options.hideBackground&&this.model.changePaperVisibility(!1),r.BufferGeometryUtils.meshToGeometry(e),e.geometry.unpackXform=l.unpackXform,l.texData){var c=new v.DataTexture(new Uint8Array(l.texData.buffer),l.texData.length,1,v.RGBAFormat,v.UnsignedByteType,v.UVMapping,v.ClampToEdgeWrapping,v.ClampToEdgeWrapping,v.NearestFilter,v.NearestFilter,0);c.generateMipmaps=!1,c.flipY=!1,c.needsUpdate=!0,e.geometry.tIdColor=c,e.geometry.vIdColorTexSize=new v.Vector2(l.texData.length,1)}var h=a.length,u=this.model;u.getGeometryList().addGeometry(e.geometry,h,e.meshIndex+1);const d=(0,o.getPolygonCount)(e.geometry);for(var f=0;f<a.length;f++){var m=0|a[f];u.getFragmentList().getOriginalWorldMatrix(m,this.tmpMatrix),this.options.placementTransform&&(this.tmpMatrix=(new v.Matrix4).multiplyMatrices(this.options.placementTransform,this.tmpMatrix));var g=s.materials[m].toString();s.polygonCounts&&(s.polygonCounts[m]=d);var y=this.viewer3DImpl.setupMesh(this.model,e.geometry,g,this.tmpMatrix);u.activateFragment(m,y)}s.mesh2frag[t]=null,s.numLoaded+=a.length;var b=s.numLoaded;i.geomPolyCount>i.nextRepaintPolys&&(i.numRepaints++,i.nextRepaintPolys+=1e4*Math.pow(1.5,i.numRepaints),this.viewer3DImpl.api.dispatchEvent({type:p.LOADER_REPAINT_REQUEST_EVENT,loader:this,model:this.model})),b%20==0&&this.viewer3DImpl.api.dispatchEvent({type:p.LOADER_REPAINT_REQUEST_EVENT,loader:this,model:this.model})},x.prototype.processReceivedMesh2D=function(e,t){t>=this.bufferCount&&(this.bufferCount=t+1);var i={mesh:e,is2d:!0,packId:"0",meshIndex:t},n="0:"+t,r=this.svf.fragments;if(!r.fragId2dbId[t]){var o=Object.keys(i.mesh.dbIds).map((function(e){return parseInt(e)}));r.fragId2dbId[t]=o;for(var s=0;s<o.length;s++){var a=o[s],l=r.dbId2fragId[a];Array.isArray(l)?l.push(t):r.dbId2fragId[a]=void 0!==l?[l,t]:t}const n=this.model.getFragmentList();if(e.material.modelScale=this.modelScale,e.material.opacity=this.options.opacity,e.material.doNotCut=this.options.doNotCut||(null==n?void 0:n.getDoNotCut()),null!=n&&n.viewBounds){const t=n.viewBounds;e.material.viewportBounds=new v.Vector4(t.min.x,t.min.y,t.max.x,t.max.y)}var c=this.viewer3DImpl,h=this;r.materials[t]=this.viewer3DImpl.matman().create2DMaterial(this.model,e.material,!1,!1,(function(e,t){var i=t.getData();null==i||!i.loadDone||i.texLoadDone||f.TextureLoader.requestsInProgress()||(i.texLoadDone=!0,c.onTextureLoadComplete(t)),(0,d.isMobileDevice)()&&f.TextureLoader.requestsInProgress()||c.api.dispatchEvent({type:p.LOADER_REPAINT_REQUEST_EVENT,loader:h,model:t})})),r.length++}r.mesh2frag[n]=t,this.processReceivedMesh(i)},x.prototype.onModelRootLoadDone=function(e){var t,i;e.fragments={},e.fragments.mesh2frag={},e.fragments.materials=[],e.fragments.fragId2dbId=[],e.fragments.dbId2fragId={},e.fragments.length=0,e.fragments.initialized=!0,e.geomMemory=0,e.fragments.numLoaded=0,e.gpuNumMeshes=0,e.gpuMeshMemory=0,e.nextRepaintPolys=1e4,e.numRepaints=0,e.urn=this.svfUrn,e.acmSessionId=this.acmSessionId,e.basePath="";var r=this.currentLoadPath.lastIndexOf("/");-1!==r&&(e.basePath=this.currentLoadPath.substr(0,r+1)),e.placementTransform=null===(t=this.options.placementTransform)||void 0===t?void 0:t.clone(),e.placementWithOffset=null===(i=this.options.placementTransform)||void 0===i?void 0:i.clone(),e.loadOptions=this.options,e.texLoadDone=!1;var o=Date.now();n.logger.log("F2D load: "+(o-this.t0)),this.t1=o,e.bbox=(new v.Box3).copy(e.bbox),e.modelSpaceBBox=e.bbox.clone(),e.placementTransform&&e.bbox.applyMatrix4(e.placementTransform);var s=this.model=new g.Model(e);s.loader=this,s.initialize(),this.options.skipPropertyDb||(this.svf.propDbLoader=new u.PropDbLoader(this.sharedDbPath,this.model,this.viewer3DImpl.api)),n.logger.log("scene bounds: "+JSON.stringify(e.bbox));var l={category:"metadata_load_stats",urn:e.urn,layers:e.layerCount};n.logger.track(l),this.viewer3DImpl.setDoNotCut(s,!!this.options.doNotCut),this.viewer3DImpl.signalProgress(5,a.ProgressState.ROOT_LOADED,this.model)},x.prototype.onGeomLoadDone=function(){this.svf.loadDone=!0,this.svf.fragments.entityIndexes=null,this.svf.fragments.mesh2frag=null;var e=Date.now(),t="Fragments load time: "+(e-this.t1);this.loadTime+=e-this.t0,f.TextureLoader.loadModelTextures(this.model,this.viewer3DImpl),this.options.skipPropertyDb||this.loadPropertyDb(),n.logger.log(t);var i={category:"model_load_stats",is_f2d:!0,has_prism:this.viewer3DImpl.matman().hasPrism,load_time:this.loadTime,geometry_size:this.model.getGeometryList().geomMemory,meshes_count:this.model.getGeometryList().geoms.length,urn:this.svfUrn};n.logger.track(i,!0);var r=this.model.getGeometryList();const o={load_time:this.loadTime,polygons:r.geomPolyCount,fragments:this.model.getFragmentList().getCount(),mem_usage:r.gpuMeshMemory,viewable_type:"2d"};y.analytics.track("viewer.model.loaded",o),this.currentLoadPath=null,this.isf2d=void 0,this.viewer3DImpl.onLoadComplete(this.model)},x.prototype.loadPropertyDb=function(){this.svf.propDbLoader&&this.svf.propDbLoader.load()},x.prototype.is3d=function(){return!1},l.FileLoaderManager.registerFileLoader("f2d",["f2d"],x)},94163:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LeafletLoader:()=>m});var n=i(91531),r=i(82079),o=i(49720),s=i(32154),a=i(97818),l=i(79291),c=i(72614),h=i(18989),u=i(75121),d=i(33423),p=i(41434);const f=Autodesk.Viewing.Private;function m(e){var t=e;this.isLeafletLoader=!0,this.loading=!1;var i=function(e,t){var i=[80,75,1,2],n=t;if(e[n++]!==i[0]||e[n++]!==i[1]||e[n++]!==i[2]||e[n++]!==i[3])return o.logger.error("invalid file header signature"),null;var r={};return r.version=e[n++],r.os=e[n++],r.needVersion=e[n++]|e[n++]<<8,r.flags=e[n++]|e[n++]<<8,r.compression=e[n++]|e[n++]<<8,r.time=e[n++]|e[n++]<<8,r.date=e[n++]|e[n++]<<8,r.crc32=(e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24)>>>0,r.compressedSize=(e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24)>>>0,r.plainSize=(e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24)>>>0,r.fileNameLength=e[n++]|e[n++]<<8,r.extraFieldLength=e[n++]|e[n++]<<8,r.fileCommentLength=e[n++]|e[n++]<<8,r.diskNumberStart=e[n++]|e[n++]<<8,r.internalFileAttributes=e[n++]|e[n++]<<8,r.externalFileAttributes=e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24,r.relativeOffset=(e[n++]|e[n++]<<8|e[n++]<<16|e[n++]<<24)>>>0,r.filename=String.fromCharCode.apply(null,e.slice(n,n+=r.fileNameLength)),r.extraField=e.slice(n,n+=r.extraFieldLength),r.comment=e.slice(n,n+r.fileCommentLength),r.length=n-t,r},c=function(e){var t=function(e){var t=[80,75,3,4],i=0;if(e[i++]!==t[0]||e[i++]!==t[1]||e[i++]!==t[2]||e[i++]!==t[3])return o.logger.error("invalid local file header signature"),null;var n={};return n.needVersion=e[i++]|e[i++]<<8,n.flags=e[i++]|e[i++]<<8,n.compression=e[i++]|e[i++]<<8,n.time=e[i++]|e[i++]<<8,n.date=e[i++]|e[i++]<<8,n.crc32=(e[i++]|e[i++]<<8|e[i++]<<16|e[i++]<<24)>>>0,n.compressedSize=(e[i++]|e[i++]<<8|e[i++]<<16|e[i++]<<24)>>>0,n.plainSize=(e[i++]|e[i++]<<8|e[i++]<<16|e[i++]<<24)>>>0,n.fileNameLength=e[i++]|e[i++]<<8,n.extraFieldLength=e[i++]|e[i++]<<8,n.filename=String.fromCharCode.apply(null,e.slice(i,i+=n.fileNameLength)),n.extraField=e.slice(i,i+=n.extraFieldLength),n.length=i,n}(e);if(!t)return null;var i=t.length,n=t.compressedSize;return e.slice(i,i+n)};this.continueLoadFile=function(e,i,s,l,c,u){var m,g=this;if(g.loading){var v;if(null!==(m=i.loadOptions)&&void 0!==m&&m.loadFromZip)v="{z}/{x}_{y}."+i.loadOptions.mime.split("/")[1];else v=e;c.initFromLoadOptions(v,i.loadOptions,u,i);var y=null;l&&l(),!c.valid()&&c.initForSimpleImage(e),c.onRootLoaded=function(){if(g.loading){var a=new function(r){var o;this.bbox=new p.Box3,this.basePath=e,this.is2d=!0,this.urn=null===(o=i.bubbleNode)||void 0===o?void 0:o.getRootNode().urn();var s=r&&r.paperWidth>=0?r.paperWidth:c.texWidth,a=r&&r.paperHeight>=0?r.paperHeight:c.texHeight;this.pageToModelTransform=c.getPageToModelTransform(s,a),this.metadata={},this.metadata.page_dimensions={};var l=this.metadata.page_dimensions;l.page_width=s,l.page_height=a,l.page_units=r&&r.paperUnits,this.loadDone=!0,this.isLeaflet=!0,t.signalProgress(100,n.ProgressState.LOADING),c.texWidth>0&&(this.maxPixelPerUnit=c.texWidth/c.getQuadWidth(),c.isSimpleImage&&(this.maxPixelPerUnit*=10))}(i.loadOptions);a.loadOptions=i,a.bbox.copy(c.getBBox()),a.modelSpaceBBox=a.bbox.clone(),i.placementTransform&&(a.placementTransform=i.placementTransform.clone(),a.placementWithOffset=i.placementTransform.clone(),a.bbox.applyMatrix4(i.placementTransform));var l=new h.Model(a);return l.initFromCustomIterator(y),l.loader=g,t.api.dispatchEvent({type:d.MODEL_ROOT_LOADED_EVENT,svf:a,model:l}),y.callWhenRefined((function(){var e,t,i=Date.now();a.loadTime=i-g.t0,o.logger.log("SVF load: "+a.loadTime),f.analytics.track("viewer.model.loaded",{load_time:a.loadTime,total_raster_pixels:null===(e=a.loadOptions.bubbleNode)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.totalRasterPixels,viewable_type:"2d"})})),s(null,l),g.loading=!1,l.id}s({code:r.ErrorCodes.LOAD_CANCELED,msg:"Load canceled"},null)},c.onDone=s,c.getPixelRatio=t.glrenderer().getPixelRatio,c.maxAnisotropy=t.glrenderer().getMaxAnisotropy(),c.placementTransform=i.placementTransform,(y=new a.ModelIteratorTexQuad(c,t.getMaterials())).requestRootTile()}else s({code:r.ErrorCodes.LOAD_CANCELED,msg:"Load canceled"},null)},this.loadFile=function(e,t,n,h){if(this.loading)return o.logger.log("Loading of Leaflet already in progress. Ignoring new request."),!1;var d=this;this.loading=!0,this.options=t,this.t0=Date.now();var f=new a.TexQuadConfig,m=null,g=t.acmSessionId;if(t.loadOptions&&t.loadOptions.loadFromZip){m=function(e,t,i){for(var n,r=e.split("/")[0]-f.levelOffset,o=0;o<f.zips.length;o++)if(r<=f.zips[o].zipMaxLevel){n=f.zips[o];break}if(!n)return i("Failed loading texture - tile's level doesn't exists."),!1;var s=n.fileTable[e];if(!s)return i("Failed loading texture - entry does not exist inside fileTable."),!1;var a={extractImage:c},h=s.relativeOffset,u=s.relativeOffset+s.contentSize;n.rawData?a.rawData=n.rawData.slice(h,u):a.range={min:h,max:u},l.TextureLoader.loadTextureWithSecurity(n.urnZip,p.UVMapping,t,i,g,!0,a)};t.loadOptions.zips.forEach((function(a){var l=a.centralDirOffset,c=a.centralDirLength,p=a.centralDirEntries;!function(e,t,i,n,r,o){var a=null,l={};(0,u.isOffline)()||(t&&(a="acmsession="+t),l.range={min:i,max:n+i});var c=(0,u.initLoadContext)({queryParams:a});s.ViewingService.getItem(c,e,r,o,l)}(a.urnZip,g,l,c,(function(r){(0,u.isOffline)()&&(a.rawData=r,r=r.slice(l,l+c));var o=function(e,t,n){for(var r,o=0,s={},a=null,l=0;l<n;++l){if(!(r=i(e,o)))return null;a&&(a.contentSize=r.relativeOffset-a.relativeOffset),o+=r.length,s[r.filename]=r,a=r}return a.contentSize=t-a.relativeOffset,s}(r,l,p);if(!o)return n("Failed parsing central directory of the zip.",null),!1;a.fileTable=o,t.loadOptions.zips.every((function(e){return Object.keys(e.fileTable).length>0}))&&d.continueLoadFile(e,t,n,h,f,m)}),(function(e){o.logger.error("Zip download failed: "+e.statusText,(0,r.errorCodeString)(r.ErrorCodes.NETWORK_FAILURE)),n("Zip download failed: "+e.statusText,null)}))}))}else m=function(e,t,i){l.TextureLoader.loadTextureWithSecurity(e,p.UVMapping,t,i,g,!0)},this.continueLoadFile(e,t,n,h,f,m);return!0},this.dtor=function(){this.loading=!1}}m.prototype.is3d=function(){return!1},m.prototype.isPageCoordinates=function(){var e,t;return!(null===(e=this.options)||void 0===e||null===(t=e.loadOptions)||void 0===t||!t.fitPaperSize)},c.FileLoaderManager.registerFileLoader("Leaflet",["jpeg","jpg","png"],m)},77298:(e,t,i)=>{"use strict";i.r(t),i.d(t,{OtgLoader:()=>R});var n=i(98500),r=i(39651),o=i(27957),s=i(49720),a=i(79291),l=i(5120),c=i(41723),h=i(47899),u=i(85218),d=i(75121),p=i(32154);function f(e){switch(e){case"meter":case"meters":case"m":default:return 1;case"feet and inches":case"foot":case"feet":case"ft":return.3048;case"inch":case"inches":case"in":return.0254;case"centimeter":case"centimeters":case"cm":return.01;case"millimeter":case"millimeters":case"mm":return.001}}function m(e,t){if(e.metadata){var i=e.metadata["world bounding box"],s=new o.LmvVector3(i.minXYZ[0],i.minXYZ[1],i.minXYZ[2]),a=new o.LmvVector3(i.maxXYZ[0],i.maxXYZ[1],i.maxXYZ[2]);e.bbox=new r.LmvBox3(s,a),e.modelSpaceBBox=e.bbox.clone();var l=function(e,t){if(e.placementTransform=t.placementTransform,t.applyScaling){var i="m";e.metadata["distance unit"]&&(i=e.metadata["distance unit"].value),e.scalingUnit=i,"object"==typeof t.applyScaling?(t.applyScaling.from&&(i=t.applyScaling.from),t.applyScaling.to&&(e.scalingUnit=t.applyScaling.to)):e.scalingUnit=t.applyScaling;var r=f(i)/f(e.scalingUnit);if(1!=r){var o=new n.LmvMatrix4(!0),s=new n.LmvMatrix4(!0);s.elements[0]=r,s.elements[5]=r,s.elements[10]=r,t.placementTransform&&o.copy(t.placementTransform),t.applyPlacementInModelUnits?t.placementTransform=s.multiply(o):t.placementTransform=o.multiply(s),e.placementTransform=t.placementTransform,e.scalingFactor=r}}var a=e.metadata["custom values"];if(a&&a.refPointTransform){e.refPointTransform=new n.LmvMatrix4(!0);var l=e.refPointTransform.elements,c=a.refPointTransform;l[0]=c[0],l[1]=c[1],l[2]=c[2],l[4]=c[3],l[5]=c[4],l[6]=c[5],l[8]=c[6],l[9]=c[7],l[10]=c[8],l[12]=c[9],l[13]=c[10],l[14]=c[11]}else{var h=e.metadata.georeference,u=h&&h.refPointLMV,d=0;if(a&&a.hasOwnProperty("angleToTrueNorth")&&(d=Math.PI/180*a.angleToTrueNorth),u||d){var p=new n.LmvMatrix4(!0),m=p.elements;m[0]=m[5]=Math.cos(d),m[1]=-Math.sin(d),m[4]=Math.sin(d);var g=new n.LmvMatrix4(!0);m=g.elements,u&&(m[12]=-u[0],m[13]=-u[1],m[14]=-u[2]),e.refPointTransform=p.multiply(g)}}if(t.applyRefPoint&&e.refPointTransform){var v=new n.LmvMatrix4(!0);t.placementTransform&&v.copy(t.placementTransform),v.multiply(e.refPointTransform),e.placementTransform=t.placementTransform=v}else!t.applyRefPoint&&t.placementTransform&&(e.placementTransform=new n.LmvMatrix4(!0).copy(t.placementTransform));return e.placementTransform&&function(e){for(var t=e.elements,i=0;i<4;i++)for(var n=0;n<4;n++)if(i===n){if(1!==t[4*i+n])return!1}else if(0!==t[4*i+n])return!1;return!0}(e.placementTransform)&&(e.placementTransform=null),e.placementTransform}(e,t);l&&!e.bbox.isEmpty()&&e.bbox.applyMatrix4(l),t.globalOffset?e.globalOffset=t.globalOffset:e.globalOffset=e.bbox.getCenter(new o.LmvVector3),function(e,t){var i=e.globalOffset;if(i.x||i.y||i.z){if(t){var r=new n.LmvMatrix4(!0);r.copy(t),(t=r).elements[12]-=i.x,t.elements[13]-=i.y,t.elements[14]-=i.z}else(t=new n.LmvMatrix4(!0)).makeTranslation(-i.x,-i.y,-i.z);e.placementWithOffset=t}else e.placementWithOffset=t}(e,l),e.bbox.isEmpty()||(e.bbox.min.sub(e.globalOffset),e.bbox.max.sub(e.globalOffset)),e.metadata.hasOwnProperty("double sided geometry")&&e.metadata["double sided geometry"].value&&(e.doubleSided=!0)}}function g(e,t){e[0]-=t.x,e[1]-=t.y,e[2]-=t.z}function v(e,t){if(t&&(t.transformPoint(e.position),t.transformPoint(e.target),t.transformDirection(e.up),isFinite(e.orthoScale))){const i=t.getMaxScaleOnAxis();e.orthoScale*=i}}var y=i(24401),b=i(57639);function x(e,t){var i,n,r,o,a,l=0;function c(e){let l=new Uint8Array(4);if("string"==typeof e)for(let t=0;t<4;t++)l[t]=e.charCodeAt(t);else for(let t=0;t<4;t++)l[t]=e[t];(i=l[1]<<8|l[0])||(i=t||0),i||s.logger.error("Unknwon byte stride."),i%4&&s.logger.error("Expected byte size to be multiple of 4, but got "+i),n=l[3]<<8|l[2],i/4,r=new Uint8Array(i),o=new Float32Array(r.buffer),a=new Uint32Array(r.buffer)}this.onData=function(t,n,o){void 0===n&&(n=t.length);for(var s="string"==typeof t;;){if(!l&&n>=4)c(t),l++;else if(n<4)return!1;var a=l*i;if(n<a+i)return o;if(s)for(let e=0;e<i;e++)r[e]=255&t.charCodeAt(e+a);else for(let e=0;e<i;e++)r[e]=t[e+a];if(!e(this,l))return!1;l++}},this.onEnd=function(e,t){this.onData(e,t,!0)||(this.rawData=e,this.rawLength=t)},this.flush=function(){this.rawData&&(this.onData(this.rawData,this.rawLength,!0)&&(this.rawData=null))},this.idata=function(){return a},this.fdata=function(){return o},this.bdata=function(){return r},this.version=function(){return n},this.byteStride=function(){return i}}const _="urn:adsk.fluent:",E="$otg_cdn$";function A(){this.materials=null,this.fragments=null,this.geompacks=[],this.propertydb={attrs:[],avs:[],ids:[],values:[],offsets:[],dbid:[]},this.bbox=null,this.animations=null,this.pendingRequests=0,this.globalOffset={x:0,y:0,z:0},this.pendingRequests=0,this.initialLoadProgress=0,this.materialIdToHash=[],this.aborted=!1}A.prototype.getMaterialHash=function(e){var t=this.materialIdToHash[e];if(t)return t;var i=this.materialHashes.byteStride,n=(0,y.getHexStringPacked)(this.materialHashes.hashes,e*i,i);return this.materialIdToHash[e]=n,n},A.prototype.getGeometryHash=function(e){var t=this.geomMetadata.byteStride;return(0,y.getHexStringPacked)(this.geomMetadata.hashes,e*t,t)},A.prototype.initEmptyLists=function(e){var t=this,i=t.fragments={};i.length=t.metadata.stats.num_fragments,i.numLoaded=0,i.boxes=e.fragmentTransformsDouble?new Float64Array(6*i.length):new Float32Array(6*i.length),i.transforms=e.fragmentTransformsDouble?new Float64Array(12*i.length):new Float32Array(12*i.length),i.materials=(0,b.R)(i.length,t.metadata.stats.num_materials),i.geomDataIndexes=(0,b.R)(i.length,t.metadata.stats.num_geoms),i.fragId2dbId=new Int32Array(i.length),i.visibilityFlags=new Uint8Array(i.length),i.mesh2frag={},i.topoIndexes=null,t.geomMetadata={hashes:null,byteStride:0,version:0,numLoaded:0,hashToIndex:{}},t.materialHashes={hashes:null,byteStride:0,version:0,numLoaded:0},t.materials={name:"LMVTK Simple Materials",version:"1.0",scene:{SceneUnit:8215,YIsUp:0},materials:{}}},A.prototype.loadAsyncResource=function(e,t,i,n){var r=this;this.pendingRequests++,t=(0,p.pathToURL)(t,e.basePath),p.ViewingService.getItem(e,t,(function(e){r.pendingRequests--,n(e)}),e.onFailureCallback,{responseType:i||"arraybuffer"})},A.prototype.loadAsyncProgressive=function(e,t,i,n,r){var o=this;t=(0,p.pathToURL)(t,e.basePath),p.ViewingService.getItem(e,t,(function(t,r){i.onEnd(t,r),o.postLoad(e,n,i,t)}),r||e.onFailureCallback,{responseType:"text",onprogress:function(e,t){if(o.aborted)return!0;i.onData(e,t,!1)}})},A.prototype.loadMetadata=function(e,t){var i=this;this.loadAsyncResource(e,t,"json",(function(r){i.metadata=r,i.manifest=i.metadata.manifest,i.numGeoms=i.metadata.stats.num_geoms,i.processMetadata(e),i.initEmptyLists(e);var o=i.metadata.manifest,s=o.shared_assets.pdb;for(var a in s)i.propertydb[a]&&i.propertydb[a].push({path:s[a],isShared:!0});var l=o.assets.pdb;for(var a in l)i.propertydb[a]&&i.propertydb[a].push({path:l[a],isShared:!1});o.assets.animations&&i.loadAsyncResource(e,o.assets.animations,"json",(function(e){i.animations=e,function(e){if(e.animations){var t=e.animations.animations;if(t)for(var i=e.globalOffset,r=(new n.LmvMatrix4).makeTranslation(i.x,i.y,i.z),o=(new n.LmvMatrix4).makeTranslation(-i.x,-i.y,-i.z),s=new n.LmvMatrix4,a=new n.LmvMatrix4,l=0;l<t.length;l++){var c=t[l];if(c.hierarchy)for(var h=0;h<c.hierarchy.length;h++){var u=c.hierarchy[h].keys;if(u)for(var d=0;d<u.length;d++){var p=u[d].pos;if(p){var f=i,m=u[d].rot;m&&(s.makeRotationFromQuaternion({x:m[0],y:m[1],z:m[2],w:m[3]}),a.multiplyMatrices(r,s).multiply(o),f={x:a.elements[12],y:a.elements[13],z:a.elements[14]}),g(p,f)}var v=u[d].target;v&&g(v,i);var y=u[d].points;if(y)for(var b=0;b<y.length;b++)g(y[b],i)}}}}}(i)})),o.assets.topology&&i.loadAsyncResource(e,t,"json",(function(e){i.topology=e})),e.onLoaderEvent("otg_root"),i.postLoad(e,"metadata")}))},A.prototype.loadFragmentList=function(e,t){var i=this,s=new o.LmvVector3,a=new o.LmvVector3,l={x:0,y:0,z:0,w:1},h=new n.LmvMatrix4(!0),u=new r.LmvBox3,d={x:0,y:0,z:0};let p=new x((function(t,n){if(n-=1,!i.metadata)return!1;var r=t.idata(),o=t.fdata(),p=i.fragments,f=p.geomDataIndexes[n]=r[0],m=p.materials[n]=r[1],g=p.fragId2dbId[n]=r[2],v=r[3];if(f>i.geomMetadata.numLoaded||m>i.materialHashes.numLoaded)return!1;var y,b=p.mesh2frag[f];void 0===b?p.mesh2frag[f]=n:Array.isArray(b)?b.push(n):p.mesh2frag[f]=[b,n],y=!i.dbIdFilter||i.dbIdFilter[g]?1&v?c.MeshFlags.MESH_HIDE:0:c.MeshFlags.MESH_NOTLOADED,p.visibilityFlags[n]=y;var x=i.metadata.fragmentTransformsOffset||d;s.set(o[4]+x.x,o[5]+x.y,o[6]+x.z),l.x=o[7],l.y=o[8],l.z=o[9],l.w=o[10],a.set(o[11],o[12],o[13]),h.compose(s,l,a),i.placementWithOffset&&h.multiplyMatrices(i.placementWithOffset,h);var _=h.elements,E=p.transforms,A=12*n;return E[A+0]=_[0],E[A+1]=_[1],E[A+2]=_[2],E[A+3]=_[4],E[A+4]=_[5],E[A+5]=_[6],E[A+6]=_[8],E[A+7]=_[9],E[A+8]=_[10],E[A+9]=_[12],E[A+10]=_[13],E[A+11]=_[14],u.min.x=-.5,u.min.y=-.5,u.min.z=-.5,u.max.x=.5,u.max.y=.5,u.max.z=.5,u.applyMatrix4(h),p.boxesLoaded||((E=p.boxes)[(A=6*n)+0]=u.min.x,E[A+1]=u.min.y,E[A+2]=u.min.z,E[A+3]=u.max.x,E[A+4]=u.max.y,E[A+5]=u.max.z),p.numLoaded=n+1,e.onLoaderEvent("fragment",n),!0}),52);return this.loadAsyncProgressive(e,t,p,"all_fragments"),p},A.prototype.handleHashListRequestFailures=function(e){this.metadata&&(this.geomHashListFailure&&this.metadata.stats.num_geoms>0&&e.onFailureCallback.apply(e,this.geomHashListFailure),this.matHashListFailure&&this.metadata.stats.num_materials>0&&e.onFailureCallback.apply(e,this.matHashListFailure),this.geomHashListFailure=null,this.matHashListFailure=null)},A.prototype.loadGeometryHashList=function(e,t){var i=this;let n=new x((function(e,t){return!!i.metadata&&(i.geomMetadata.hashes||(i.geomMetadata.hashes=new Uint8Array(e.byteStride()*(i.numGeoms+1)),i.geomMetadata.byteStride=e.byteStride(),i.geomMetadata.version=e.version()),i.geomMetadata.hashes.set(e.bdata(),t*e.byteStride()),i.geomMetadata.numLoaded=t,!0)}),20);return this.loadAsyncProgressive(e,t,n,"geometry_ptrs",(function(){i.geomHashListFailure=arguments,i.handleHashListRequestFailures(e),i.postLoad(e,"geometry_ptrs",n)})),n},A.prototype.loadMaterialHashList=function(e,t){var i=this;let n=new x((function(e,t){return!!i.metadata&&(i.materialHashes.hashes||(i.numMaterials=i.metadata.stats.num_materials,i.materialHashes.hashes=new Uint8Array(e.byteStride()*(i.numMaterials+1)),i.materialHashes.byteStride=e.byteStride(),i.materialHashes.version=e.version()),i.materialHashes.hashes.set(e.bdata(),t*e.byteStride()),i.materialHashes.numLoaded=t,!0)}),20);return this.loadAsyncProgressive(e,t,n,"material_ptrs",(function(){i.matHashListFailure=arguments,i.handleHashListRequestFailures(e),i.postLoad(e,"material_ptrs",n)})),n},A.prototype.processMetadata=function(e){var t=this,i=t.metadata;m(t,e);var n=t.placementWithOffset;if(i.cameras){t.cameras=i.cameras;for(var r=0;r<t.cameras.length;r++){var s=t.cameras[r];s.position=new o.LmvVector3(s.position.x,s.position.y,s.position.z),s.target=new o.LmvVector3(s.target.x,s.target.y,s.target.z),s.up=new o.LmvVector3(s.up.x,s.up.y,s.up.z),n&&v(s,n)}}},A.prototype.beginLoad=function(e,t){this.loadMetadata(e,t);let i=e.objectIds;if(i){this.dbIdFilter={};for(let e=0,t=i.length;e<t;e++)this.dbIdFilter[i[e]]=1}this.materialsCtx=this.loadMaterialHashList(e,"materials_ptrs.hl"),this.geometryCtx=this.loadGeometryHashList(e,"geometry_ptrs.hl"),this.fragmentsCtx=this.loadFragmentList(e,"fragments.fl")},A.prototype.makeSharedResourcePath=function(e,t,i){if(10===i.length&&(i=(0,y.unpackHexString)(i)),e){var n=i,r="";(a=this.manifest.shared_assets.global_sharding||0)&&(r="/"+i.slice(0,a),n=i.slice(a));var o=this.manifest.shared_assets[t];if(0===o.indexOf(_)||0===o.indexOf(E))o=o.slice(o.indexOf("/"));else{var s=o.split("/");o="/"+(s[s.length-1]||s[s.length-2])+"/"}return e+r+o+n}var a;n=i,r="";return(a=this.manifest.shared_assets.global_sharding||2)&&(r="/"+i.slice(0,a)+"/",n=i.slice(a)),(0,p.pathToURL)(this.basePath)+this.manifest.shared_assets[t]+r+n},A.prototype.postLoad=function(e,t,i,n){t&&this.initialLoadProgress++,4===this.initialLoadProgress?(this.materialsCtx.flush(),this.geometryCtx.flush(),this.fragmentsCtx.flush(),this.materialsCtx=null,this.geometryCtx=null,this.fragmentsCtx=null,this.fragments.numLoaded<this.metadata.stats.num_fragments&&s.logger.warn("Fragments actually loaded fewer than expected."),e.onLoaderEvent("all_fragments")):"metadata"===t&&(this.materialsCtx.flush(),this.geometryCtx.flush(),this.fragmentsCtx.flush())},A.prototype.abort=function(){this.aborted=!0};var S=i(72614),w=i(18989),M=i(33423),T=i(91531),C=i(16840),P=i(63560),D=i(2283);const L=Autodesk.Viewing,I=Autodesk.Viewing.Private;function R(e){this.viewer3DImpl=e,this.loading=!1,this.tmpMatrix=new n.LmvMatrix4,this.tmpBox=new r.LmvBox3,this.logger=s.logger,this.loadTime=0,this.pendingMaterials={},this.pendingMaterialsCount=0,this.pendingMeshes={},this.pendingMeshesCount=0,this.operationsDone=0}function O(e){var t="",i=e.lastIndexOf("/");return-1!=i&&(t=e.substr(0,i+1)),t}function N(e){return e.acmSessionId?"acmsession="+e.acmSessionId:""}function k(e,t,i){var n={basePath:t,objectIds:e.ids,globalOffset:e.globalOffset,fragmentTransformsDouble:e.fragmentTransformsDouble,placementTransform:e.placementTransform,applyRefPoint:e.applyRefPoint,queryParams:i,bvhOptions:e.bvhOptions||{isWeakDevice:(0,C.isMobileDevice)()},applyScaling:e.applyScaling,applyPlacementInModelUnits:e.applyPlacementInModelUnits,loadInstanceTree:e.loadInstanceTree};return(0,d.initLoadContext)(n)}function F(e){return Math.floor(100*e.fragsLoaded/e.metadata.stats.num_fragments)}R.prototype.dtor=function(){this.initWorkerScriptToken&&(this.initWorkerScriptToken.cancel(),this.initWorkerScriptToken=null,s.logger.debug("SVF loader dtor: on init worker script.")),this.bvhWorker&&(this.bvhWorker.clearAllEventListenerWithIntercept(),this.bvhWorker.terminate(),this.bvhWorker=null,s.logger.debug("SVF loader dtor: on svf worker.")),this.svf&&(this.svf.loadDone||console.log("stopping load before it was complete"),this.svf.abort(),this.svf.propDbLoader&&(this.svf.propDbLoader.dtor(),this.svf.propDbLoader=null)),this.viewer3DImpl.geomCache()&&this.model&&(this.loading&&this.viewer3DImpl.geomCache().cancelRequests(this.svf.geomMetadata.hashToIndex),this.removeMeshReceiveListener()),this.viewer3DImpl=null,this.model=null,this.svf=null,this.logger=null,this.tmpMatrix=null,this.loading=!1,this.loadTime=0},R.prototype.isValid=function(){return null!=this.viewer3DImpl},R.prototype.removeMeshReceiveListener=function(){this.meshReceiveListener&&(this.viewer3DImpl.geomCache().updateMruTimestamps(),this.viewer3DImpl.geomCache().removeEventListener(P.MESH_RECEIVE_EVENT,this.meshReceiveListener),this.viewer3DImpl.geomCache().removeEventListener(P.MESH_FAILED_EVENT,this.meshReceiveListener),this.viewer3DImpl.geomCache().removeEventListener(P.MATERIAL_RECEIVE_EVENT,this.materialReceiveListener),this.viewer3DImpl.geomCache().removeEventListener(P.MATERIAL_FAILED_EVENT,this.materialReceiveListener),this.meshReceiveListener=null)},R.prototype.loadFile=function(e,t,i,n){if(!this.viewer3DImpl)return s.logger.log("SVF loader was already destructed. So no longer usable."),!1;if(this.loading)return s.logger.log("Loading of SVF already in progress. Ignoring new request."),!1;if(this.loading=!0,t.acmSessionId)this.svfUrn=t.acmSessionId.split(",")[0];else{console.warn("DEPRECATED: Automatic derivation of URN will be removed in a future release. Please set the acmSessionId parameter when loading OTG data.");var r=e.indexOf(_);if(-1===r&&(r=e.indexOf(E)),-1!==r){var o=e.split("/"),a=o[1]+"?version="+o[2],l=L.toUrlSafeBase64(a);this.svfUrn=l}}return this.sharedDbPath=t.sharedPropertyDbPath,this.currentLoadPath=e,this.basePath=O(e),this.acmSessionId=t.acmSessionId,this.options=t,this.queryParams=N(t),this.loadContext=k(t,this.basePath,this.queryParams),this.loadContext.raiseError=function(e,t,n){i&&i({code:e,msg:t,args:n})},this.loadContext.onFailureCallback=p.ViewingService.defaultFailureCallback.bind(this.loadContext),this.loadModelRoot(this.loadContext,i),n&&n(),!0},R.prototype.loadModelRoot=function(e,t){this.t0=(new Date).getTime(),this.firstPixelTimestamp=null;var i=this,n=!1,r={};this.initWorkerScriptToken=(0,u.initWorkerScript)((function(){for(var t in n=!0,r)r.hasOwnProperty(t)&&r[t].forEach((i=>{e.onLoaderEvent(t,i)}));r={}}));var o=this.svf=new A;return o.basePath=e.basePath,e.onLoaderEvent=function(e,a){if(i.svf){if(!n)return r.hasOwnProperty(e)||(r[e]=[]),void r[e].push(a);if("otg_root"===e){i.onModelRootLoadDone(o),t&&t(null,i.model),i.makeBVHInWorker();var l=i.viewer3DImpl.geomCache();l||s.logger.error("geomCache is required for loading OTG models."),l.initWorker(i.options.acmSessionId),i.meshReceiveListener=function(e){e.error&&e.error.args?i.onMeshError(e):i.onMeshReceived(e.geom)},l.addEventListener(P.MESH_RECEIVE_EVENT,i.meshReceiveListener),l.addEventListener(P.MESH_FAILED_EVENT,i.meshReceiveListener),i.materialReceiveListener=function(e){!e.error&&e.material&&e.material.length?i.onMaterialLoaded((0,D.Up)(e.material),e.hash):i.onMaterialLoaded(null,e.hash)},l.addEventListener(P.MATERIAL_RECEIVE_EVENT,i.materialReceiveListener),l.addEventListener(P.MATERIAL_FAILED_EVENT,i.materialReceiveListener),i.svf.loadDone=!1}else if("fragment"===e)i.options.skipMeshLoad||i.tryToActivateFragment(a,"fragment"),i.options.onFragmentListLoadProgress&&i.trackFragmentListLoadProgress();else if("all_fragments"===e)i.options.skipPropertyDb||i.loadPropertyDb(),i.fragmentDataLoaded=!0,i.viewer3DImpl.api.fireEvent({type:M.MODEL_ROOT_LOADED_EVENT,svf:o,model:i.model}),i.options.skipMeshLoad||!i.svf.fragments.length?i.onGeomLoadDone():i.onOperationComplete();else if("bvh"===e){var c=a;i.model&&(i.model.setBVH(c.nodes,c.primitives,i.options.bvhOptions),i.viewer3DImpl&&i.viewer3DImpl.modelVisible(i.model.id)&&i.viewer3DImpl.api.dispatchEvent({type:L.LOADER_REPAINT_REQUEST_EVENT,loader:i,model:i.model})),i.onOperationComplete()}}else console.error("load callback called after load was aborted")},o.beginLoad(e,(0,p.pathToURL)(i.currentLoadPath)),!0},R.prototype.makeBVHInWorker=function(){var e=this;e.bvhWorker=(0,u.createWorkerWithIntercept)();e.bvhWorker.addEventListenerWithIntercept((function(t){if(t.data.bvh){console.log("Received BVH from worker");var i=t.data.bvh;e.model&&(e.svf.bvh=i,e.model.setBVH(new l.NodeArray(i.nodes,i.useLeanNodes),i.primitives,e.options.bvhOptions),e.viewer3DImpl&&e.viewer3DImpl.modelVisible(e.model.id)&&e.viewer3DImpl.api.dispatchEvent({type:L.LOADER_REPAINT_REQUEST_EVENT,loader:e,model:e.model})),e.bvhWorker.clearAllEventListenerWithIntercept(),e.bvhWorker.terminate(),e.bvhWorker=null,e.onOperationComplete()}t.data.boxes&&e.model&&e.model.setFragmentBoundingBoxes(t.data.boxes,t.data.boxStride)}));var t=Object.assign({},e.loadContext);t.operation="LOAD_OTG_BVH",t.raiseError=null,t.onFailureCallback=null,t.onLoaderEvent=null,t.fragments_extra=(0,p.pathToURL)(e.basePath)+e.svf.manifest.assets.fragments_extra,t.placementTransform=e.svf.placementTransform,t.placementWithOffset=e.svf.placementWithOffset,t.fragmentTransformsOffset=e.svf.metadata.fragmentTransformsOffset,t.globalOffset=e.svf.globalOffset,t.fragments_extra?e.bvhWorker.doOperation(t):e.onOperationComplete()},R.prototype.tryToActivateFragment=function(e,t){var i=this.svf,n=this.model;if(n){var r=i.fragments.visibilityFlags[e],o=r&c.MeshFlags.MESH_NOTLOADED,s=r&c.MeshFlags.MESH_HIDE,a=i.loadOptions.skipHiddenFragments??!1;if(o||s&&a)return n.getFragmentList().setFlagFragment(e,c.MeshFlags.MESH_NOTLOADED,!0),void this.trackGeomLoadProgress(i,e,!1);r&c.MeshFlags.MESH_HIDE&&(n.getFragmentList().setFlagFragment(e,c.MeshFlags.MESH_HIDE,!1),n.getFragmentList().setFlagFragment(e,c.MeshFlags.MESH_VISIBLE,!1));var l=!1,h=i.fragments.materials[e],u=i.getMaterialHash(h),d=this.findOrLoadMaterial(n,u,h);d||("fragment"===t&&this.pendingMaterials[u].push(e),"material"!==t&&(l=!0));var p=i.fragments.geomDataIndexes[e];if(0!==p){n.getFragmentList().getOriginalWorldMatrix(e,this.tmpMatrix);var f=n.getGeometryList().getGeometry(p);if(f||("fragment"===t&&this.loadGeometry(p,e),l=!0),!l){var m=this.viewer3DImpl.setupMesh(n,f,u,this.tmpMatrix);m.geomId=p,n.activateFragment(e,m,!!i.placementTransform),this.viewer3DImpl.geomCache().updateGeomImportance(n,e),this.trackGeomLoadProgress(i,e,!1)}}else(d||"material"===t)&&this.trackGeomLoadProgress(i,e,!1)}},R.prototype.onModelRootLoadDone=function(e){e.isOTG=!0,e.geomMetadata.hashToIndex={},e.failedFrags={},e.failedMeshes={},e.failedMaterials={},e.geomMemory=0,e.gpuNumMeshes=0,e.gpuMeshMemory=0,e.fragsLoaded=0,e.fragsLoadedNoGeom=0,e.nextRepaintPolys=0,e.numRepaints=0,e.urn=this.svfUrn,e.acmSessionId=this.acmSessionId,e.basePath=this.basePath,e.loadOptions=this.options||{};var t=Date.now();s.logger.log("SVF load: "+(t-this.t0));var i=this.model=new w.Model(e);i.loader=this,i.initialize(),this.t1=t,s.logger.log("scene bounds: "+JSON.stringify(e.bbox));var n={category:"metadata_load_stats",urn:e.urn,has_topology:!!e.topology,has_animations:!!e.animations,materials:e.metadata.stats.num_materials,is_mobile:(0,C.isMobileDevice)()};s.logger.track(n),this.viewer3DImpl.signalProgress(5,T.ProgressState.ROOT_LOADED,this.model),e.handleHashListRequestFailures(this.loadContext),e.propDbLoader=new h.PropDbLoader(this.sharedDbPath,this.model,this.viewer3DImpl.api)},R.prototype.trackGeomLoadProgress=function(e,t,i){if(i){if(e.failedFrags[t])return void console.log("Double fail",t);e.failedFrags[t]=1}var n=F(e);e.fragsLoaded++;var r=F(e);r>n&&this.viewer3DImpl.signalProgress(r,T.ProgressState.LOADING,this.model),this.model.getGeometryList().geomPolyCount>e.nextRepaintPolys&&(this.firstPixelTimestamp=this.firstPixelTimestamp||Date.now(),e.numRepaints++,e.nextRepaintPolys+=1e5*Math.pow(1.5,e.numRepaints),this.viewer3DImpl.modelVisible(this.model.id)&&this.viewer3DImpl.api.dispatchEvent({type:L.LOADER_REPAINT_REQUEST_EVENT,loader:this,model:this.model})),e.fragsLoaded===e.metadata.stats.num_fragments&&this.onOperationComplete()},R.prototype.trackFragmentListLoadProgress=function(){var e=this.svf;function t(e){return Math.floor(100*e.fragsLoadedNoGeom/e.metadata.stats.num_fragments)}var i=t(e);e.fragsLoadedNoGeom++;var n=t(e);n>i&&this.options.onFragmentListLoadProgress(this.model,n)},R.prototype.onOperationComplete=function(){this.operationsDone++,3===this.operationsDone&&this.onGeomLoadDone()},R.prototype.onMaterialLoaded=async function(e,t,i){if(this.loading){var n=this.pendingMaterials[t];if(n){var r=this.viewer3DImpl.matman();if(e){e.hash=t;try{var o=await r.convertSharedMaterial(this.model,e,t);a.TextureLoader.loadMaterialTextures(this.model,o,this.viewer3DImpl),r.hasTwoSidedMaterials()&&this.viewer3DImpl.renderer().toggleTwoSided(!0)}catch(e){this.svf.failedMaterials[t]=1}}else this.svf.failedMaterials[t]=1;for(var s=0;s<n.length;s++)this.tryToActivateFragment(n[s],"material");this.pendingMaterialsCount--,delete this.pendingMaterials[t]}}},R.prototype.findOrLoadMaterial=function(e,t,i){if(this.pendingMaterials[t])return!1;var n=this.svf;if(this.viewer3DImpl.matman().findMaterial(e,t))return!0;this.pendingMaterialsCount++,this.pendingMaterials[t]=[];var r=!!this.loadContext.otg_cdn,o=n.makeSharedResourcePath(this.loadContext.otg_cdn,"materials",t);return this.viewer3DImpl.geomCache().requestMaterial(o,r,t,i,this.queryParams),!1},R.prototype.loadGeometry=function(e,t){var i=this.svf,n=i.getGeometryHash(e);if(this.pendingMeshes[n])return this.pendingMeshes[n].push(t),!1;this.pendingMeshesCount++,this.pendingMeshes[n]=[t];var r=!!this.loadContext.otg_cdn;i.geomMetadata.hashToIndex[n]=e;var o=i.makeSharedResourcePath(this.loadContext.otg_cdn,"geometry",n);this.viewer3DImpl.geomCache().requestGeometry(o,r,n,e,this.queryParams)},R.prototype.onMeshError=function(e){var t=e.error.args.hash;this.svf.failedMeshes[t]=1;var i=this.pendingMeshes[t];if(i){for(var n=0;n<i.length;n++)this.trackGeomLoadProgress(this.svf,i[n],!0);delete this.svf.geomMetadata.hashToIndex[t],delete this.pendingMeshes[t],this.pendingMeshesCount--}},R.prototype.onMeshReceived=function(e){var t=this.model;if(t){var i=t.getGeometryList(),n=this.svf.geomMetadata.hashToIndex[e.hash];if(void 0!==n){var r=i.getGeometry(n),o=this.pendingMeshes[e.hash];if(!r){i.addGeometry(e,o&&o.length||1,n),this.svf.loadDone&&console.error("Geometry received after load was done");for(var s=0;s<o.length;s++)this.tryToActivateFragment(o[s],"geom");delete this.svf.geomMetadata.hashToIndex[e.hash],delete this.pendingMeshes[e.hash],this.pendingMeshesCount--}}}else console.warn("Received geometry after loader was done. Possibly leaked event listener?",e.hash)},R.prototype.onGeomLoadDone=function(){if(this.svf.loadDone=!0,this.removeMeshReceiveListener(),a.TextureLoader.loadModelTextures(this.model,this.viewer3DImpl),this.options.skipMeshLoad)return this.currentLoadPath=null,void this.viewer3DImpl.onLoadComplete(this.model);this.svf.fragments.entityIndexes=null,this.svf.fragments.mesh2frag=null,this.svf.geomMetadata.hashes=null;var e=Date.now(),t="Fragments load time: "+(e-this.t1);this.loadTime=e-this.t0;var i=this.firstPixelTimestamp-this.t0;t+=" (first pixel time: "+i+")",s.logger.log(t),this.options.useConsolidation&&this.viewer3DImpl.consolidateModel(this.model,this.options.consolidationMemoryLimit);var n={category:"model_load_stats",is_f2d:!1,has_prism:this.viewer3DImpl.matman().hasPrism,load_time:this.loadTime,geometry_size:this.model.getGeometryList().geomMemory,meshes_count:this.svf.metadata.stats.num_geoms,fragments_count:this.svf.metadata.stats.num_fragments,urn:this.svfUrn};i>0&&(n.first_pixel_time=i),s.logger.track(n,!0);const r=this.model.getGeometryList(),o={load_time:this.loadTime,polygons:r.geomPolyCount,fragments:this.model.getFragmentList().getCount(),mem_usage:r.gpuMeshMemory,time_to_first_pixel:this.firstPixelTimestamp-this.t0,viewable_type:"3d"};I.analytics.track("viewer.model.loaded",o),this.currentLoadPath=null,this.viewer3DImpl.onLoadComplete(this.model)},R.prototype.loadPropertyDb=function(){this.svf.propDbLoader.load()},R.prototype.is3d=function(){return!0},R.loadOnlyOtgRoot=function(e,t){const i=O(e),n=k(t,i,N(t)),r=new A;r.basePath=i;const o=(0,p.pathToURL)(e);return new Promise((e=>{r.loadAsyncResource(n,o,"json",(function(t){r.metadata=t,r.manifest=t.manifest,r.numGeoms=r.metadata.stats.num_geoms,r.processMetadata(n),e(r)}))}))},R.prototype.waitForFragmentData=async function(){if(this.fragmentDataLoaded)return!0;const e=this.viewer3DImpl.api,t=this;return await new Promise((function(i){const n=()=>{e.removeEventListener(L.MODEL_ROOT_LOADED_EVENT,r),e.removeEventListener(L.MODEL_UNLOADED_EVENT,o)},r=e=>{e.model.loader===t&&(n(),i(!0))},o=e=>{e.model.loader===t&&(n(),i(!1))};e.addEventListener(L.MODEL_ROOT_LOADED_EVENT,r),e.addEventListener(L.MODEL_UNLOADED_EVENT,o)}))},S.FileLoaderManager.registerFileLoader("json",["json"],R)},63560:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MATERIAL_FAILED_EVENT:()=>E,MATERIAL_RECEIVE_EVENT:()=>_,MESH_FAILED_EVENT:()=>x,MESH_RECEIVE_EVENT:()=>b,OtgResourceCache:()=>T});var n=i(16840),r=i(22769),o=i(85218),s=i(75121),a=i(78443),l=i(33423),c=i(43644),h=i(27957),u=i(39651),d=i(10834),p=i(35797);function f(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i&&Math.abs(e.z-t.z)<i}function m(e,t){return t.importance-e.importance}var g=new u.LmvBox3;function v(e,t,i){var n=function(e,t,i){var n=6*t;return i.min.y=e[n+1],i.min.z=e[n+2],i.min.x=e[n+0],i.max.x=e[n+3],i.max.y=e[n+4],i.max.z=e[n+5],i}(t,e,g),r=i.intersectsBox(n);if(r===d.OUTSIDE)return 0;var o=r===d.CONTAINS,s=i.projectedBoxArea(n,o),a=p.SceneMath.pointToBoxDistance2(i.eye,n);return s/(a=Math.max(a,.01))}class y{constructor(){this.viewers=[],this.waitingTasks=[],this.urgentHashes={},this.prevNumTasks=0,this.fullSortDone=!1,this.lastCamPos={},this.lastCamTarget={},this.lastVisibleModelIds={}}addViewer(e){this.viewers.push(e),this.lastCamPos[e.id]=new h.LmvVector3,this.lastCamTarget[e.id]=new h.LmvVector3,this.lastVisibleModelIds[e.id]=[]}removeViewer(e){const t=this.viewers.indexOf(e);-1!==t&&(delete this.lastCamPos[e.id],delete this.lastCamTarget[e.id],delete this.lastVisibleModelIds[e.id],this.viewers.splice(t,1))}checkCameraChanged(){for(var e=!1,t=0;t<this.viewers.length;t++){var i=this.viewers[t],n=i.impl.camera,r=n.position,o=n.target;f(this.lastCamPos[i.id],r,.01)&&f(this.lastCamTarget[i.id],o,.01)||(this.lastCamPos[i.id].copy(r),this.lastCamTarget[i.id].copy(o),e=!0)}return e}checkModelsChanged(){for(var e=!1,t=0;t<this.viewers.length;t++){var i=this.viewers[t],n=i.impl.modelQueue().getModels();n.length!==this.lastVisibleModelIds[i.id].length&&(this.lastVisibleModelIds[i.id].length=n.length,e=!0);for(var r=0;r<n.length;r++){var o=this.lastVisibleModelIds[i.id][r],s=n[r].id;o!==s&&(this.lastVisibleModelIds[i.id][r]=s,e=!0)}}return e}validateRequestPriorities(){var e=this.checkCameraChanged(),t=this.checkModelsChanged();if(e||t)for(var i=0;i<this.waitingTasks.length;i++)this.waitingTasks[i].importanceNeedsUpdate=!0}updateRequestPriorities(){var e=performance.now();this.validateRequestPriorities();for(var t={},i=[],n=0;n<this.viewers.length;n++){var r=(_=this.viewers[n]).impl.modelQueue(),o=r.frustum();i=i.concat(r.getModels()),o.reset(_.impl.camera),t[_.id]=o}var s=!1,a=0===this.prevNumTasks||this.waitingTasks.length-this.prevNumTasks>3e3||!this.fullSortDone;this.fullSortDone=!a,this.prevNumTasks=this.waitingTasks.length;for(n=0;n<this.waitingTasks.length;n++){var l=this.waitingTasks[n];if(l.importanceNeedsUpdate)if(this.urgentHashes[l.hash])l.importance=1/0;else{if(n%10==0)if(performance.now()-e>10){s=!0;break}l.importanceNeedsUpdate=!1,l.importance=0;for(var c=0,h=l.hash,u=0;u<i.length;u++){var d=i[u];if(d.isOTG()){var p=d.myData,f=p.fragments,g=f.boxes,y=p.geomMetadata.hashToIndex[h];if(y&&f.mesh2frag)for(var b=f.mesh2frag[y],x=0;x<this.viewers.length;x++){var _;if(-1!==(_=this.viewers[x]).impl.modelQueue().getModels().indexOf(d))if("number"==typeof b)c+=v(b,g,t[_.id]);else if(Array.isArray(b))for(x=0;x<b.length;x++){c+=v(b[x],g,t[_.id])}}}}if(l.importance=c,!a){for(u=n;u>0&&c>this.waitingTasks[u-1].importance;)this.waitingTasks[u]=this.waitingTasks[u-1],u--;this.waitingTasks[u]=l}}}return a&&!s&&(this.waitingTasks.sort(m),this.fullSortDone=!0),!s}makeUrgent(e){var t=0;for(var i in e)!0===e[i]&&(this.urgentHashes[i]=!0,t++);if(0===t)return 0;for(var n=0;n<this.waitingTasks.length;n++){var r=this.waitingTasks[n];this.urgentHashes[r.hash]&&(r.importance=1/0)}return this.waitingTasks.sort(m),t}removeUrgent(e){delete this.urgentHashes[e]}addTask(e){this.waitingTasks.push(e)}takeTask(){return this.waitingTasks.shift()}isEmpty(){return 0===this.waitingTasks.length}}var b="meshReceived",x="meshFailed",_="materialReceived",E="materialFailed";const A="true"===(0,c.getParameterByName)("disableIndexedDb").toLowerCase()||(0,n.getGlobal)().DISABLE_INDEXED_DB,S="true"===(0,c.getParameterByName)("disableWebSocket").toLowerCase()||(0,n.getGlobal)().DISABLE_WEBSOCKET;function w(e){var t=(0,s.initLoadContext)(e);return t.disableIndexedDb=A,t.disableWebSocket=S,t.isInlineWorker=Autodesk.Viewing.Private.ENABLE_INLINE_WORKER,t}function M(e,t){return e.importance-t.importance}function T(){for(var e=new Map,t=new Map,i={},s=(0,n.isMobileDevice)()?2:8,a=[],c=0;c<s;c++)a.push((0,o.createWorkerWithIntercept)());this.initialized=!0,this.byteSize=0,this.refCount=0,this.requestsSent=0,this.requestsReceived=0;var h=0,u=void 0,d=new y,p=this,f=1048576;this._maxMemory=100*f,this._minCleanup=50*f;var m=0,v=!1;function A(){v=!1}var S=[];function T(n){if(n.data)if(d.waitingTasks.length&&!u&&(u=setTimeout(P,0)),n.data.error){var o=n.data.error,s=o.args?o.args.hash:void 0,a=o.args?o.args.type:"g";s&&("m"===a?(t.set(s,o),p.fireEvent({type:E,error:o}),console.warn("Error loading material",s)):(e.set(s,o),p.fireEvent({type:x,error:o}),console.warn("Error loading mesh",s)),delete i[o.hash],h--,p.requestsReceived++)}else if(n.data.material){s=(m=n.data).hash;var l=m.material;t.set(s,l),p.fireEvent({type:_,material:l,hash:s}),delete i[m.hash],h--,p.requestsReceived++}else for(var c=n.data,f=0;f<c.length;f++){var m;if((m=c[f]).hash&&m.mesh){r.BufferGeometryUtils.meshToGeometry(m);s=m.hash;var g=m.geometry;e.set(s,g),p.byteSize+=g.byteSize,p.cleanup(),p.fireEvent({type:b,geom:g}),delete i[m.hash]}h--,p.requestsReceived++}}this.addViewer=function(e){e.addEventListener(l.MODEL_UNLOADED_EVENT,A),S.push(e),d.addViewer(e)},this.removeViewer=function(e){const t=S.indexOf(e);-1!==t&&(e.removeEventListener(l.MODEL_UNLOADED_EVENT,A),d.removeViewer(e),S.splice(t,1)),0===S.length&&this.dtor()},this.dtor=function(){S=[];for(var i=0;i<s;i++)a[i].clearAllEventListenerWithIntercept(),a[i].terminate();e=null,t=null,this.initialized=!1};for(c=0;c<s;c++)a[c].addEventListenerWithIntercept(T);function C(e){return"number"==typeof e?e%s:0|Math.random()*s}function P(){var e=100*s-h;if(0!==e){d.updateRequestPriorities()||(e=Math.min(e,10*s));for(var t=[],i=0;!d.isEmpty()&&i<e;){var n=d.takeTask(),r=C(n.geomIdx);(l=t[r])?(l.urls.push(n.url),l.hashes.push(n.hash)):(l={operation:"LOAD_CDN_RESOURCE_OTG",type:"g",urls:[n.url],hashes:[n.hash],isCDN:n.isCDN,queryParams:n.queryParams},t[r]=l),i++}for(var o=0;o<t.length;o++){var l;(l=t[o])&&(a[o].doOperation(w(l)),h+=l.urls.length,p.requestsSent+=l.urls.length)}u=void 0}else u=setTimeout(P,30)}this.initWorker=function(e){for(var t=0;t<s;t++){var i={operation:"INIT_WORKER_OTG",authorizeUrns:[e]};a[t].doOperation(w(i))}},this.updateMruTimestamps=function(){for(var e=0;e<s;e++){var t={operation:"UPDATE_MRU_TIMESTAMPS_OTG",endSession:d.isEmpty()};a[e].doOperation(w(t))}},this.requestGeometry=function(t,r,o,s,a){var l=e.get(o);if(l&&l.args)(0,n.isNodeJS)()?setImmediate((()=>this.fireEvent({type:x,error:l,hash:o,repeated:!0}))):this.fireEvent({type:x,error:l,hash:o,repeated:!0});else if(l)(0,n.isNodeJS)()?setImmediate((()=>this.fireEvent({type:b,geom:l}))):this.fireEvent({type:b,geom:l});else{var c=i[o];if(c&&c.refcount)return c.importanceNeedsUpdate=!0,void c.refcount++;var h={operation:"LOAD_CDN_RESOURCE_OTG",type:"g",url:t,isCDN:r,hash:o,queryParams:a,importance:0,geomIdx:s,importanceNeedsUpdate:!0,refcount:1};d.addTask(h),i[o]=h,u||(u=setTimeout(P,0))}},this.requestMaterial=function(e,n,r,o,s){var l=t.get(r);if(l&&l.args)setImmediate((()=>this.fireEvent({type:E,error:l,hash:r,repeated:!0})));else if(l)setImmediate((()=>this.fireEvent({type:_,material:l,hash:r})));else{var c=i[r];if(c&&c.refcount)c.refcount++;else{var u={operation:"LOAD_CDN_RESOURCE_OTG",type:"m",urls:[e],hashes:[r],isCDN:n,queryParams:s,refcount:1};i[r]=u;var d=C(o);a[d].doOperation(w(u)),h++,this.requestsSent++}}},this.cancelRequests=function(e){for(var t in e){var n=i[t];n&&n.refcount--}for(var r=[],o=0;o<d.waitingTasks.length;o++){var s=d.waitingTasks[o],a=i[s.hash];a&&a.refcount?r.push(s):delete i[s.hash]}d.waitingTasks=r},this.updateGeomImportance=function(e,t){return function(e,t){var i=e.getFragmentList(),n=i.getGeometry(t);if(i.getWorldBounds(t,g),n){var r,o,s,a,l=n.importance||0,c=2*((o=(r=g).max.x-r.min.x)*(s=r.max.y-r.min.y)+s*(a=r.max.z-r.min.z)+a*o);n.importance=Math.max(l,c)}}(e,t)},this.cleanup=function(){var t=[];if(!(this.byteSize<this._maxMemory)){for(var i=[],n=0;n<S.length;n++){var r=S[n].impl.modelQueue();i=i.concat(r.getModels().concat(S[n].getHiddenModels()))}if(!v){m++;for(n=0;n<i.length;n++){var o=i[n],s=o.getData();if(o.isOTG()){var a=s.geomMetadata.hashes;if(a){var l=a.length/s.geomMetadata.byteStride;for(let t=1;t<l;t++){var c=s.getGeometryHash(t);(u=e.get(c))&&(u.timeStamp=m)}}else{const e=o.getGeometryList(),t=null==e?void 0:e.geoms.length;for(let i=1;i<t;++i)e.geoms[i]&&(e.geoms[i].timeStamp=m)}}}t.length>0&&console.warn("OtgResourceCache.cleanup(): array must be empty"),e.forEach((e=>{e.timeStamp!==m&&t.push(e)})),t.sort(M);var h=this._maxMemory-this._minCleanup;for(n=0;n<t.length&&this.byteSize>=h;n++){var u=t[n];e.delete(u.hash),this.byteSize-=u.byteSize,u.dispose()}n===t.length&&(v=!0),t.length=0}}},this.waitForGeometry=function(t,i){var n=0,r=d.makeUrgent(t);if(0===r&&t)i(t);else{P(),this.addEventListener(b,a),this.addEventListener(x,l);for(let i in t){var o=e.get(i);o&&s(i,o)}}function s(e,o){d.removeUrgent(e),!0!=!t[e]&&(t[e]=o,++n<r||(p.removeEventListener(b,a),p.removeEventListener(x,l),i(t)))}function a(e){s(e.geom.hash,e.geom)}function l(e){s(e.error.args.hash,void 0)}},this.getGeometry=function(t){return e.get(t)},this.addGeometry=function(t,i){e.set(t,i)},this.addMaterialData=function(e,i){t.set(e,i)},this.reportLoadingState=function(){console.log("OtgResourceCache:",{sent:this.requestsSent,received:this.requestsReceived});for(let e=0;e<a.length;e++){const t={operation:"REPORT_LOADING_STATE",workerIndex:e};a[e].doOperation(w(t))}}}a.EventDispatcher.prototype.apply(T.prototype)},47899:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PropDbLoader:()=>T,clearPropertyWorkerCache:()=>E,getPropWorker:()=>x,shutdownPropWorker:()=>_});var n,r=i(49720),o=i(32154),s=i(82079),a=i(33423),l=i(75121),c=i(14936),h=i(87100),u=i(85218),d=i(78443),p="GET_PROPERTIES",f="GET_PROPERTY_SET",m="UNLOAD_PROPERTYDB",g=1,v={};function y(e){var t=e.data;if(t&&t.debug)r.logger.debug(t.message);else{var i=t&&t.cbId&&v[t.cbId];i&&(t.progress?i[2]&&i[2](t.progress):(t.error?i[1]&&i[1](t.error):i[0]&&i[0](t.result),delete v[t.cbId]))}}function b(e,t,i){var n=g++;return v[n]=[e,t,i],n}function x(){return n}function _(){n&&(n.clearAllEventListenerWithIntercept(),n.terminate(),n=void 0)}function E(){n&&n.doOperation({operation:m,clearCaches:!0})}var A=0,S=1,w=2,M=3,T=function(e,t,i){var n,s,a,l;this.eventTarget=i||new d.EventDispatcher,this.model=t,this.svf=t&&t.getData(),this.dbPath="",this.sharedDbPath=!1;const c=this.svf&&this.svf.loadOptions.bubbleNode&&this.svf.loadOptions.bubbleNode.findViewableParent()._getOtgManifest(),h=c&&this.svf&&this.svf.is2d;if(this.svf&&!h&&this.svf.propertydb&&this.svf.propertydb.avs.length){for(var u in this.dbFiles=this.svf.propertydb,this.dbFiles)this.dbFiles[u][0]&&(this.dbFiles[u][0].path=this.dbFiles[u][0].path.replace(/\\/g,"/"));var p=(0,o.pathToURL)(this.svf.basePath);if(e){var f=o.ViewingService.simplifyPath(p+this.svf.propertydb.avs[0].path);if((f=f.slice(0,f.lastIndexOf("/")+1))===e){var m={};for(let t in this.dbFiles){var g=this.dbFiles[t][0],v=g.path;0===(v=o.ViewingService.simplifyPath(p+v)).indexOf(e)&&(v=v.slice(e.length)),m[t]=[{path:v,isShared:g.isShared}]}this.dbFiles=m,this.dbPath=e,this.sharedDbPath=!0}else this.dbPath=p,this.sharedDbPath=!1}else this.dbPath=p,this.sharedDbPath=!1}else{if(this.sharedDbPath=!0,this.svf&&this.svf.loadOptions.bubbleNode){this.dbPath=e;let t=this.svf.loadOptions.bubbleNode.getPropertyDbManifest();this.dbFiles=t.propertydb,this.needsDbIdRemap=t.needsDbIdRemap}else r.logger.warn("Deprecated shared property database initialization without bubbleNode in Model load options."),this.dbPath=e,this.dbFiles={attrs:[],avs:[],ids:[],values:[],offsets:[]};r.logger.log("Using shared db path "+e)}c&&(this.needsDbIdRemap=this.svf.loadOptions.needsDbIdRemap||this.needsDbIdRemap),this.queryParams="";let y=null===(n=this.model)||void 0===n||null===(s=n.getDocumentNode())||void 0===s||null===(a=s.getDocument())||void 0===a?void 0:a.getAcmSessionId(this.dbPath);y=y||(null===(l=this.svf)||void 0===l?void 0:l.acmSessionId),this.svf&&y&&(this.queryParams="acmsession="+y),this.loadProgress=0,this.cbId=void 0,this.idLoadState=A,this.waitingForExternalIds=[]};T.prototype.dtor=function(){this.asyncPropertyOperation({operation:m},(function(){}),(function(){}));var e,t=Boolean(this.cbId),i=this.instanceTree||this.propertyDbError;t&&!i&&(e=this.cbId,delete v[e],this.propertyDbError={propDbWasUnloaded:!0},this.eventTarget.dispatchEvent({type:a.OBJECT_TREE_UNAVAILABLE_EVENT,svf:this.svf,model:this.model,target:this})),this.model=null,this.svf=null},T.prototype.processLoadResult=function(e){var t=this;if(e.instanceTreeStorage){var i=new h.InstanceTreeAccess(e.instanceTreeStorage,e.rootId,e.instanceBoxes);t.instanceTree=new c.InstanceTree(i,e.objectCount,e.maxTreeDepth),t.svf&&(t.svf.instanceTree=t.instanceTree,t.instanceTree.setFragmentList(t.model.getFragmentList()))}e.objectCount&&(t.hasObjectProperties=e.objectCount,t.svf&&(t.svf.hasObjectProperties=e.objectCount)),e.dbidOldToNew&&this.model.setDbIdRemap(e.dbidOldToNew),t.onLoadProgress(100),t.eventTarget.dispatchEvent({type:a.OBJECT_TREE_CREATED_EVENT,svf:t.svf,model:t.model,target:t})},T.prototype.processLoadError=function(e){var t=this;t.propertyDbError=e,t.onLoadProgress(100),t.eventTarget.dispatchEvent({type:a.OBJECT_TREE_UNAVAILABLE_EVENT,svf:t.svf,model:t.model,target:t})},T.prototype.load=function(e){var t=this;e=e||{},n||(n=(0,u.createWorkerWithIntercept)(!0)).addEventListenerWithIntercept(y);this.cbId=b((function(e){t.processLoadResult(e)}),(function(e){t.processLoadError(e)}),(function(e){t.onLoadProgress(e.percent)}));var i=this.svf&&this.svf.loadOptions,r=!(i&&i.disablePrecomputedNodeBoxes),o=!(!i||!i.skipExternalIds);let s;o||(this.idLoadState=S),s=this.svf&&this.svf.instanceTree&&this.svf.instanceBoxes?"CREATE_TREE":"LOAD_PROPERTYDB";var a={operation:s,dbPath:this.dbPath,sharedDbPath:this.sharedDbPath,propertydb:this.dbFiles,fragToDbId:this.svf&&this.svf.fragments.fragId2dbId,fragBoxes:r&&this.svf&&this.svf.fragments.boxes,needsDbIdRemap:this.needsDbIdRemap,is2d:this.svf&&this.svf.is2d,cbId:this.cbId,queryParams:this.queryParams,skipExternalIds:o,gltfTree:this.svf.instanceTree,dbToFragId:this.svf&&this.svf.fragments.dbToFragId,...e};n.doOperation((0,l.initLoadContext)(a))},T.prototype.asyncPropertyOperation=function(e,t,i,r){const o=this;if(e.dbPath=this.dbPath,o.instanceTree||o.hasObjectProperties)e.cbId=b(t,i,r),n.doOperation(e);else if(o.propertyDbError)i&&i(o.propertyDbError);else{const n=function(l){o.model===l.model&&(o.eventTarget.removeEventListener(a.OBJECT_TREE_CREATED_EVENT,n),o.eventTarget.removeEventListener(a.OBJECT_TREE_UNAVAILABLE_EVENT,n),o.instanceTree||o.hasObjectProperties||o.propertyDbError?o.asyncPropertyOperation(e,t,i,r):i&&i({code:s.ErrorCodes.UNKNOWN_FAILURE,msg:"Failed to load properties"}))};o.eventTarget.addEventListener(a.OBJECT_TREE_CREATED_EVENT,n),o.eventTarget.addEventListener(a.OBJECT_TREE_UNAVAILABLE_EVENT,n)}},T.prototype.getProperties=function(e,t,i){this.idLoadState===A&&r.logger.warn("Calling getProperties() will cause loading of the potentially large externalIDs file. Use getProperties2() to avoid this warning."),this.getProperties2(e,t,i,{needsExternalId:!0})},T.prototype.getProperties2=function(e,t,i,n){const r=()=>{this.asyncPropertyOperation({operation:p,dbId:e,gltfTree:this.svf&&this.svf.instanceTreeBackup},t,i)};n&&n.needsExternalId?this.loadExternalIds().then(r).catch(i):r()},T.prototype.getBulkProperties=function(e,t,i,n,o){const s={ignoreHidden:o,propFilter:t,needsExternalId:!t||t.includes("externalId")};s.needsExternalId&&this.idLoadState===A&&r.logger.warn("Calling getProperties() will cause loading of the potentially large externalIDs file. Use getProperties2() to avoid this warning."),this.getBulkProperties2(e,s,i,n)},T.prototype.getBulkProperties2=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;const r=()=>{this.asyncPropertyOperation({operation:p,dbIds:e,propFilter:t.propFilter,categoryFilter:t.categoryFilter,ignoreHidden:t.ignoreHidden},i,n)};t&&t.needsExternalId?this.loadExternalIds().then(r).catch(n):r()},T.prototype.getPropertySet=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;const r=()=>{this.asyncPropertyOperation({operation:f,dbIds:e,propFilter:t.propFilter,ignoreHidden:t.ignoreHidden,fileType:t.fileType},i,n)};t&&t.needsExternalId?this.loadExternalIds().then(r).catch(n):r()},T.prototype.searchProperties=function(e,t,i,n,r){this.asyncPropertyOperation({operation:"SEARCH_PROPERTIES",searchText:e,attributeNames:t,searchOptions:r},i,n)},T.prototype.findProperty=function(e){var t=this;return new Promise((function(i,n){t.asyncPropertyOperation({operation:"FIND_PROPERTY",propertyName:e},i,n)}))},T.prototype.diffProperties=function(e,t,i,n,r){this.asyncPropertyOperation({operation:"DIFF_PROPERTIES",dbPath2:e,diffOptions:n},t,i,r)},T.prototype.findLayers=function(){var e=this;return new Promise((function(t,i){e.asyncPropertyOperation({operation:"FIND_LAYERS"},t,i)}))},T.prototype.getExternalIdMapping=function(e,t,i){return this.loadExternalIds().then((()=>{this.asyncPropertyOperation({operation:"BUILD_EXTERNAL_ID_MAPPING",extIdFilter:i},e,t)}))},T.prototype.getLayerToNodeIdMapping=function(e,t){this.asyncPropertyOperation({operation:"BUILD_LAYER_TO_NODE_ID_MAPPING"},e,t)},T.prototype.executeUserFunction=function(e,t){if("function"==typeof e)e=e.toString();else if("string"!=typeof e)return Promise.reject("Expected Function or string.");let i;try{i=new Blob([e],{type:"application/javascript"})}catch(t){let n=new BlobBuilder;n.append(e),i=n.getBlob()}let n=URL.createObjectURL(i);return new Promise(((e,i)=>{this.asyncPropertyOperation({operation:"USER_FUNCTION",userFunction:n,userData:t},e,i)}))},T.prototype.isObjectTreeLoaded=function(){return!!this.instanceTree},T.prototype.getObjectTree=function(e,t){var i=this;if(i.instanceTree)e(i.instanceTree);else if(i.propertyDbError)t&&t(i.propertyDbError);else if("hasObjectProperties"in i)i.svf&&i.svf.is2d&&t?t("F2D files do not have an InstanceTree."):e(null);else{var n=function(){i.eventTarget.removeEventListener(a.OBJECT_TREE_CREATED_EVENT,n),i.eventTarget.removeEventListener(a.OBJECT_TREE_UNAVAILABLE_EVENT,n),i.getObjectTree(e,t)};i.eventTarget.addEventListener(a.OBJECT_TREE_CREATED_EVENT,n),i.eventTarget.addEventListener(a.OBJECT_TREE_UNAVAILABLE_EVENT,n)}},T.prototype.onLoadProgress=function(e){this.eventTarget.dispatchEvent({type:a.OBJECT_TREE_LOAD_PROGRESS_EVENT,percent:e,svf:this.svf,model:this.model,target:this}),this.loadProgress=e},T.prototype.getLoadProgress=function(){return this.loadProgress},T.prototype.isLoadDone=function(){return 100==this.loadProgress},T.prototype.loadExternalIds=function(){switch(this.idLoadState){case S:return Promise.resolve();case M:return Promise.reject();case A:{this.idLoadState=w;const e=()=>{this.idLoadState=S,this.waitingForExternalIds.forEach((e=>e.resolve()))},t=()=>{this.idLoadState=M,this.waitingForExternalIds.forEach((e=>e.reject()))},i={operation:"LOAD_EXTERNAL_IDS",idsFile:this.dbFiles.ids[0],queryParams:this.queryParams};(0,l.initLoadContext)(i),this.asyncPropertyOperation(i,e,t);break}}return new Promise(((e,t)=>{this.waitingForExternalIds.push({resolve:e,reject:t})}))}},92617:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SvfLoader:()=>w});var n=i(16840),r=i(49720),o=i(98500),s=i(82079),a=i(5120),l=i(41723),c=i(22769),h=i(62206),u=i(40582),d=i(32154),p=i(47899),f=i(79291),m=i(85218),g=i(33423),v=i(18989),y=i(41434),b=i(72614),x=i(75121),_=i(91531);const E=Autodesk.Viewing,A=E.Private;var S=(0,n.isNodeJS)()?10:(0,n.isMobileDevice)()?2:6,w=function(e){this.viewer3DImpl=e,this.next_pack=0,this.loading=!1,this.loadedPacksCount=0,this.tmpMatrix=new y.Matrix4,this.tmpBox=new y.Box3,this.fetchingTopology=!1,this.loadTime=0,this.notifiesFirstPixel=!0};w.prototype.dtor=function(){if(this.initWorkerScriptToken&&(this.initWorkerScriptToken.cancel(),this.initWorkerScriptToken=null,r.logger.debug("SVF loader dtor: on init worker script.")),this.svfWorker&&(this.svfWorker.clearAllEventListenerWithIntercept(),this.svfWorker.terminate(),this.svfWorker=null,r.logger.debug("SVF loader dtor: on svf worker.")),this.pack_workers){for(var e=0;e<this.pack_workers.length;e++)this.pack_workers[e].clearAllEventListenerWithIntercept(),this.pack_workers[e].terminate();this.pack_workers=null,r.logger.debug("SVF loader dtor: on geom worker.")}this.svf&&this.svf.propDbLoader&&(this.svf.propDbLoader.dtor(),this.svf.propDbLoader=null),this.tmpMatrix=null,this.tmpBox=null,this.svf=null,this.model=null,this.next_pack=0,this.loading=!1,this.loadedPacksCount=0,this.loadTime=0,this.viewer3DImpl=null},w.prototype.initWorkerScript=m.initWorkerScript,w.prototype.createWorkerWithIntercept=m.createWorkerWithIntercept,w.prototype.startWorkers=function(){for(var e=this.svf,t=Math.min(e.geompacks.length,E.NUM_WORKER_THREADS||S),i=0;i<t;i++){var r=e.geompacks[this.next_pack++];r.loading=!0,(0,n.isNodeJS)()?this.loadGeometryPack(r.id,r.uri):(e=>{setTimeout((()=>{this.loadGeometryPack(e.id,e.uri)}),200*i)})(r)}},w.prototype.createModel=function(e){var t=this.model=new v.Model(e);return t.loader=this,t.initialize(),t},w.prototype.isValid=function(){return this.viewer3DImpl},w.prototype.loadFile=function(e,t,i,n){if(!this.viewer3DImpl)return r.logger.log("SVF loader was already destructed. So no longer usable."),!1;if(this.loading)return r.logger.log("Loading of SVF already in progress. Ignoring new request."),!1;this.loading=!0;var o=e.indexOf("urn:");if(-1!=o){var s=(e=decodeURIComponent(e)).substr(o,e.substr(o).indexOf("/"));r.logger.log("Extracted URN: "+s);var a=s.lastIndexOf(":");this.svfUrn=s.substr(a+1)}else this.svfUrn=e;this.sharedDbPath=t.sharedPropertyDbPath,this.currentLoadPath=e;var l=this.currentLoadPath.lastIndexOf("/");-1!=l&&(this.basePath=this.currentLoadPath.substr(0,l+1)),this.acmSessionId=t.acmSessionId,this.queryParams="",this.acmSessionId&&(this.queryParams="acmsession="+this.acmSessionId),this.options=t;var c=this;return this.initWorkerScriptToken=this.initWorkerScript((function(){c.loadSvfCB(e,t,i,n)})),!0},w.prototype.loadSvfCB=function(e,t,i,o){this.t0=(new Date).getTime(),this.firstPixelTimestamp=null,this.failedToLoadSomeGeometryPacks=null,this.failedToLoadPacksCount=0;var l=!0,c=this,h={url:(0,d.pathToURL)(e),basePath:this.currentLoadPath,objectIds:t.ids,globalOffset:t.globalOffset,fragmentTransformsDouble:t.fragmentTransformsDouble,placementTransform:t.placementTransform,applyRefPoint:t.applyRefPoint,queryParams:this.queryParams,bvhOptions:t.bvhOptions||{isWeakDevice:(0,n.isMobileDevice)()},applyScaling:t.applyScaling,applyPlacementInModelUnits:t.applyPlacementInModelUnits,loadInstanceTree:t.loadInstanceTree};this.viewer3DImpl._signalNoMeshes();var u=this.svfWorker=this.createWorkerWithIntercept();return u.addEventListenerWithIntercept((async function(e){var t=function(){u.clearAllEventListenerWithIntercept(),u.terminate(),c.svfWorker=null,u=null};if(l&&o&&(l=!1,o()),e.data&&e.data.manifest)c.interceptManifest(e.data.manifest),h.operation="LOAD_SVF_CONTD",h.manifest=e.data.manifest,u.doOperation(h);else if(e.data&&e.data.svf){var n=c.svf=e.data.svf;c.failedToLoadSomeGeometryPacks&&(i&&i(c.failedToLoadSomeGeometryPacks),c.failedToLoadSomeGeometryPacks=null),await c.onModelRootLoadDone(n),i&&i(null,c.model),c.viewer3DImpl.api.dispatchEvent({type:g.MODEL_ROOT_LOADED_EVENT,svf:n,model:c.model}),n.loadDone=!1;var d=!1;n.metadata&&n.metadata.gltf&&(d=!0),d||(0==n.geompacks.length?c.onGeomLoadDone():c.startWorkers()),1==e.data.progress&&(c.loading=!1,t()),n.fragments.polygonCounts||(n.fragments.polygonCounts=new Int32Array(n.fragments.length)),e.data.bvh&&(n.bvh=e.data.bvh,c.model.setBVH(new a.NodeArray(n.bvh.nodes,n.bvh.useLeanNodes),n.bvh.primitives,c.options.bvhOptions),c.viewer3DImpl.api.dispatchEvent({type:g.LOADER_REPAINT_REQUEST_EVENT,loader:c,model:c.model}))}else e.data&&e.data.bvh?(c.svf&&!c.svf.bvh&&(c.svf.bvh=e.data.bvh,c.model.setBVH(new a.NodeArray(c.svf.bvh.nodes,c.svf.bvh.useLeanNodes),c.svf.bvh.primitives,c.options.bvhOptions),c.viewer3DImpl.api.dispatchEvent({type:g.LOADER_REPAINT_REQUEST_EVENT,loader:c,model:c.model})),c.loading=!1,t()):e.data&&e.data.mesh?(c.processReceivedMesh(e.data),1===e.data.progress&&(c.onGeomLoadDone(),c.loading=!1,t())):e.data&&e.data.progress?1==e.data.progress&&(c.loading=!1,t()):e.data&&e.data.error?(c.loading=!1,t(),r.logger.error("Error while processing SVF: "+JSON.stringify(e.data.error.args)),i&&i(e.data.error,null)):e.data&&e.data.debug?r.logger.debug(e.data.message):(r.logger.error("SVF download failed.",(0,s.errorCodeString)(s.ErrorCodes.NETWORK_FAILURE)),c.loading=!1,t())})),h.operation="LOAD_SVF",h.interceptManifest=!!this.interceptManifest,u.doOperation((0,x.initLoadContext)(h)),!0},w.prototype.loadGeometryPack=function(e,t){var i,n,o,s,a=this;if(this.svf&&this.isValid()){var l=this.pack_workers;if(l||(l=this.pack_workers=[]),l.length<(E.NUM_WORKER_THREADS||S)){var c=!0;for(o=0;o<l.length;o++)if(0===l[o].queued){c=!1;break}if(c){var h=this.createWorkerWithIntercept();h.addEventListenerWithIntercept((function(e){if(e.data&&e.data.meshes){for(var t=e.data.meshes,i={packId:e.data.packId,meshIndex:0,mesh:null},n=0;n<t.length;n++){var o=t[n];o&&(i.meshIndex=n,i.mesh=o,a.processReceivedMesh(i))}if(e.data.progress>=1){a.pack_workers[e.data.workerId].queued-=1,a.loadedPacksCount++,a.viewer3DImpl.signalProgress(100*a.loadedPacksCount/a.svf.geompacks.length,_.ProgressState.LOADING,a.model);var l=!0;for(s=0;s<a.pack_workers.length;s++)if(0!=a.pack_workers[s].queued){l=!1;break}if(l){for(s=0;s<a.pack_workers.length;s++)a.pack_workers[s].clearAllEventListenerWithIntercept(),a.pack_workers[s].terminate();a.pack_workers=null}a.loadedPacksCount+a.failedToLoadPacksCount==a.svf.geompacks.length&&a.onGeomLoadDone()}}else if(e.data&&e.data.progress){if(a.pack_workers[e.data.workerId].queued-=1,a.next_pack<a.svf.geompacks.length){var c=null;if(!c||c.loading)for(;a.next_pack<a.svf.geompacks.length&&(c=a.svf.geompacks[a.next_pack++]).loading;);c&&!c.loading?(c.loading=!0,a.loadGeometryPack(c.id,c.uri)):(a.viewer3DImpl.modelQueue().enforceBvh=!1,a.svf.fragments.packIds=null)}}else e.data&&e.data.debug?r.logger.debug(e.data.message):e.data&&e.data.error?(++a.failedToLoadPacksCount,a.failedToLoadSomeGeometryPacks={code:e.data.error.code,msg:e.data.error.msg}):a.pack_workers[e.data.workerId].queued-=2})),h.queued=0,l.push(h)}}var u=0,p=l[0].queued;for(o=1;o<l.length;o++)l[o].queued<p&&(u=o,p=l[o].queued);(i=l[u]).queued+=2,n=u;var f={operation:"LOAD_GEOMETRY",url:(0,d.pathToURL)(this.svf.basePath+t),packId:parseInt(e),workerId:n,createWireframe:this.options.createWireframe||this.model.getMetadata("renderEnvironmentDisplayEdges","value",!1),packNormals:this.options.packNormals,queryParams:this.queryParams};i.doOperation((0,x.initLoadContext)(f))}},w.prototype.processReceivedMesh=function(e){var t=e.packId+":"+e.meshIndex,i=this.svf,n=i.fragments,o=this.model,s=n.mesh2frag[t];if(void 0===s)return void r.logger.warn("Mesh "+t+" was not referenced by any fragments.");Array.isArray(s)||(s=[s]),c.BufferGeometryUtils.meshToGeometry(e),e.geometry.packId=e.packId;var a=s.length,u=o.getFragmentList().getGeometryId(s[0]),d=o.getGeometryList().addGeometry(e.geometry,a,u);const p=(0,h.getPolygonCount)(e.geometry);for(var m=0;m<s.length;m++){var v=0|s[m];if(i.loadOptions.skipHiddenFragments)if(!(n.visibilityFlags[v]&l.MeshFlags.MESH_VISIBLE))continue;o.getFragmentList().getOriginalWorldMatrix(v,this.tmpMatrix);var y=n.materials[v].toString(),b=this.viewer3DImpl.matman().findMaterial(o,y);b&&!b.texturesLoaded&&f.TextureLoader.loadMaterialTextures(o,b,this.viewer3DImpl),n.polygonCounts&&(n.polygonCounts[v]=p);var x=this.viewer3DImpl.setupMesh(this.model,e.geometry,y,this.tmpMatrix);o.activateFragment(v,x,!!i.placementTransform)}this.options.onMeshReceived&&this.options.onMeshReceived(this.model,d,s),n.mesh2frag[t]=null,n.numLoaded+=s.length,this.viewer3DImpl._signalMeshAvailable(),o.getGeometryList().geomPolyCount>i.nextRepaintPolys&&(this.firstPixelTimestamp=this.firstPixelTimestamp||Date.now(),i.numRepaints++,i.nextRepaintPolys+=1e4*Math.pow(1.5,i.numRepaints),this.viewer3DImpl.api.dispatchEvent({type:g.LOADER_REPAINT_REQUEST_EVENT,loader:this,model:this.model}))},w.prototype.setupCamera=function(e){return e.position=(new y.Vector3).copy(e.position),e.target=(new y.Vector3).copy(e.target),e.up=(new y.Vector3).copy(e.up),isFinite(e.position.x+e.position.y+e.position.z+e.target.x+e.target.y+e.target.z+e.up.x+e.up.y+e.up.z)||(e.target=svf.bbox.getCenter(new y.Vector3),e.position.copy(e.target),e.position.z+=svf.bbox.max.z-svf.bbox.min.z,e.up={x:0,y:1,z:0}),isFinite(e.aspect)||(e.aspect=1),isFinite(e.fov)||(e.fov=90),isFinite(e.orthoScale)||(e.orthoScale=1),e},w.prototype.onModelRootLoadDone=async function(e){e.geomMemory=0,e.fragments.numLoaded=0,e.gpuNumMeshes=0,e.gpuMeshMemory=0,e.nextRepaintPolys=0,e.numRepaints=0,e.urn=this.svfUrn,e.acmSessionId=this.acmSessionId,e.basePath=this.basePath,e.loadOptions=this.options,e.verylargebbox&&this.viewer3DImpl.setNearRadius(this.options.nearRadius||1);var t=Date.now();r.logger.log("SVF load: "+(t-this.t0));var i=this.createModel(e);this.options.skipPropertyDb||this.loadPropertyDb();var s=await this.convertMaterials(i);if(this.viewer3DImpl.matman().hasTwoSidedMaterials()&&this.viewer3DImpl.renderer().toggleTwoSided(!0),this.t1=t,e.bbox=(new y.Box3).copy(e.bbox),e.refPointTransform&&(e.refPointTransform=new o.LmvMatrix4(!0).copy(e.refPointTransform)),e.placementTransform&&(e.placementTransform=new o.LmvMatrix4(!0).copy(e.placementTransform)),e.placementWithOffset&&(e.placementWithOffset=new o.LmvMatrix4(!0).copy(e.placementWithOffset)),e.cameras)for(var a=0;a<e.cameras.length;a++)this.setupCamera(e.cameras[a]);r.logger.log("scene bounds: "+JSON.stringify(e.bbox));var l={category:"metadata_load_stats",urn:e.urn,has_topology:!!e.topologyPath,has_animations:!!e.animations,cameras:e.cameras?e.cameras.length:0,lights:e.lights?e.lights.length:0,materials:s,is_mobile:(0,n.isMobileDevice)()};r.logger.track(l),this.viewer3DImpl.signalProgress(5,_.ProgressState.ROOT_LOADED,this.model)},w.prototype.convertMaterials=async function(e){var t,i=this.viewer3DImpl.matman(),n=e.getData(),r=0;if(!n.materials)return r;if(n.gltfMaterials){var o=n.materials.materials;for(t in o){var s=o[t],a=u.MaterialConverter.convertMaterialGltf(s,n),l=i._getMaterialHash(e,t);i.addMaterial(l,a,!1),r++}return r}var c=n.materials.materials,h=n.proteinMaterials?n.proteinMaterials.materials:null;for(t in c){var d=h&&h[t]&&u.MaterialConverter.isPrismMaterial(h[t])?h[t]:c[t];await i.convertOneMaterial(e,d,i._getMaterialHash(e,t)),r++}return r},w.prototype.makeBVH=function(e){var t=performance.now(),i=e.materials?e.materials.materials:null;e.bvh=new a.BVHBuilder(e.fragments,i),e.bvh.build(this.options.bvhOptions||{isWeakDevice:(0,n.isMobileDevice)()});var o=performance.now();r.logger.log("BVH build time: "+(o-t))},w.prototype.onGeomLoadDone=function(){this.svf.loadDone=!0,f.TextureLoader.loadModelTextures(this.model,this.viewer3DImpl),this.svf.fragments.entityIndexes=null,this.svf.fragments.mesh2frag=null,this.svf.fragments.visibilityFlags=null;var e=Date.now(),t="Fragments load time: "+(e-this.t1);this.loadTime=e-this.t0;var i=this.firstPixelTimestamp-this.t0;t+=" (first pixel time: "+i+")",this.svf.bvh&&!this.svf.placementTransform||(this.makeBVH(this.svf),this.model.setBVH(this.svf.bvh.nodes,this.svf.bvh.primitives,this.options.bvhOptions)),r.logger.log(t),this.options.useConsolidation&&this.viewer3DImpl.consolidateModel(this.model,this.options.consolidationMemoryLimit);var n={category:"model_load_stats",is_f2d:!1,has_prism:this.viewer3DImpl.matman().hasPrism,load_time:this.loadTime,geometry_size:this.model.getGeometryList().geomMemory,meshes_count:this.model.getGeometryList().geoms.length,fragments_count:this.model.getFragmentList().getCount(),urn:this.svfUrn};i>0&&(n.first_pixel_time=i),r.logger.track(n,!0);const o=this.model.getGeometryList(),s={load_time:this.loadTime,polygons:o.geomPolyCount,fragments:this.model.getFragmentList().getCount(),mem_usage:o.gpuMeshMemory,viewable_type:"3d"};A.analytics.track("viewer.model.loaded",s),this.currentLoadPath=null,this.viewer3DImpl.onLoadComplete(this.model)},w.prototype.loadPropertyDb=function(){this.svf.propDbLoader=new p.PropDbLoader(this.sharedDbPath,this.model,this.viewer3DImpl.api),this.svf.propDbLoader.load()},w.prototype.fetchTopologyFile=function(e,t){if(!this.fetchingTopology){this.fetchingTopology=!0;var i=this.createWorkerWithIntercept();i.addEventListenerWithIntercept((function(e){if(e.data["status-topology"])return n=(new Date).getTime(),s=Math.round((n-l)/1e3),void r.logger.log("Topology file downloaded. ("+s+" seconds). Processing...");var a=e.data["fetch-topology"];a&&(o=(new Date).getTime(),s=Math.round((o-n)/1e3),a.topology?r.logger.log("Topology file processed successfully! ("+s+" seconds)."):r.logger.log("Topology file processed, but an error ocurred. ("+s+" seconds)."),t(a),c.fetchingTopology=!1,i.clearAllEventListenerWithIntercept(),i.terminate(),i=null)}));var n,o,s,a={path:e,queryParams:this.queryParams},l=(new Date).getTime();r.logger.log("Fetching topology file..."),a.operation="FETCH_TOPOLOGY",i.doOperation((0,x.initLoadContext)(a));var c=this}},w.prototype.is3d=function(){return!0},b.FileLoaderManager.registerFileLoader("svf",["svf"],w)},79291:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TextureLoader:()=>M});var n=i(32154),r=i(16840),o=i(82079),s=i(40582),a=i(50437),l=i(49720),c=i(41434),h=i(22907),u=i(75121);const d=i(79916);let p=(0,r.getGlobal)(),f=p.document,m=new d;m.max=(0,r.isMobileDevice)()?4:6;let g=0,v=(0,r.isMobileDevice)()?32:1/0;v*=1048576;let y=0,b=1/0;const x=(e,t,i,n)=>{c.ImageUtils.loadTexture(e,t,i,n)};function _(e,t,i,s,a,d,v){var y=u.endpoint.getUseCredentials(),_=u.endpoint.getUseCookie();y&&_?c.ImageUtils.crossOrigin="use-credentials":u.endpoint.getUseCredentials()?c.ImageUtils.crossOrigin="anonymous":c.ImageUtils.crossOrigin="";var E="";y&&a&&(E="acmsession="+a),v&&v.queryParams&&(E=E?E+"&":"",E+=v.queryParams);var A=u.endpoint.initLoadContext({queryParams:E});g++,m.go((function(a){var u=function(e,t){g--,t&&s?s(t):i(e),a()},m=d?u:function(e){function t(t){e&&(e.image=t),g--,i(e),a()}e&&e.image?function(e,t){let i,n,r=e.width,s=e.height;if(0==(r&r-1)&&0==(s&s-1)){if(r*s<=b)return void t(e);i=r,n=s}else{for(i=1;1.5*i<r;)i*=2;for(n=1;1.5*n<s;)n*=2}for(;i*n>b;)i=Math.max(i/2,1),n=Math.max(n/2,1);let a=f.createElement("canvas"),c=a.getContext("2d");a.width=i,a.height=n,c.drawImage(e,0,0,i,n);const h=new Image;h.src=a.toDataURL(),h.onload=function(){t(h)},h.onerror=function(e){l.logger.error(e,(0,o.errorCodeString)(o.ErrorCodes.UNKNOWN_FAILURE)),t(null)}}(e.image,t):t()},E=function(e){g--,l.logger.error("Texture load error",e),i(null),a()};if((0,r.isNodeJS)())!function(e,t,i,r,s){var a=new c.DataTexture(void 0,i);function h(e){s&&s.extractImage&&(e=s.extractImage(e)),a.image={data:e,width:void 0,height:void 0},a.needsUpdate=!0,r&&r(a)}function u(e,t){var i="Error: "+e+" ("+t+")";l.logger.error(i,(0,o.errorCodeString)(o.ErrorCodes.NETWORK_SERVER_ERROR)),r&&r(null,{msg:t,args:e})}n.ViewingService.getItem(t,e,h,u)}(e,A,t,u,v);else if(".dds"===e.slice(e.length-4).toLocaleLowerCase())if((0,r.isIOSDevice)()){var S=e.slice(0,e.length-4)+".pvr";(new PVRLoader).load(S+"?"+A.queryParams,u,E)}else(new h.DDSLoader).load(e+"?"+A.queryParams,u,E);else if(y&&!_||v&&(v.rawData||v.extractImage))!function(e,t,i,r,s){var a=new c.Texture(void 0,i);function h(e){s&&s.extractImage&&(e=s.extractImage(e));var t,i,n=new Image;a.image=n,n.onload=function(){a.needsUpdate=!0,r&&r(a),p.URL.revokeObjectURL(n.src)},n.onerror=function(e){l.logger.error(e,(0,o.errorCodeString)(o.ErrorCodes.UNKNOWN_FAILURE)),r&&r(null)},n.src=(t=new Uint8Array(e),i=new Blob([t],{type:"image/jpeg"}),(p.URL||p.webkitURL).createObjectURL(i))}function u(e,t){var i="Error: "+e+" ("+t+")";l.logger.error(i,(0,o.errorCodeString)(o.ErrorCodes.NETWORK_SERVER_ERROR)),r&&r(null,{msg:t,args:e})}s&&s.rawData?h(s.rawData):n.ViewingService.getItem(t,e,h,u,s)}(e,A,t,m,v);else if(/^data:/.test(e))x(e,t,m,E);else{/(\w+):\/\//gi.exec(e)&&!/^(https?|file|blob:\w+):\/\//gi.test(e)?Autodesk.Viewing.Private.ViewingService.rawGet("","",e,(function(i){let n=/\.(\w+)$/gi.exec(e);n=n?n[1]:"png";var r,o,s=`data:image/${n};base64, `+(r=i,o=Array.prototype.map.call(r,(function(e){return String.fromCharCode(e)})).join(""),btoa(o));x(s,t,m,E)}),console.error):x(A.queryParams?e+"?"+A.queryParams:e,t,m,E)}}))}function E(e,t,i){var r=t.getData();if(e.startsWith("embed:"))var o=r.loadedBuffers[e.charAt(e.length-1)];else{e=e.replace(/\\/g,"/");o=t.isOTG()?function(e){var t=u.endpoint.initLoadContext({});return r.makeSharedResourcePath(t.otg_cdn,"textures",e)}(e):function(e){for(var t=null,i=0;i<r.manifest.assets.length;++i){var o=r.manifest.assets[i];if(o.id.toLowerCase()==e.toLowerCase()){let e=o.URI;-1===e.indexOf("://")&&(e=r.basePath+e),t=(0,n.pathToURL)(e);break}}return t||(t=(0,n.pathToURL)(r.basePath+e)),t}(e)}return _(o,c.UVMapping,i,null,r.acmSessionId)}function A(e,t,i){if(t.textureMaps&&!t.texturesLoaded){t.texturesLoaded=!0;var n=e.getData(),r=t.textureMaps;for(var o in r){var a=r[o];if(!i.matman().loadTextureFromCache(e,t,a,o))E(a.uri,e,function(t){return function(r){if(r){var o=n.materials.scene.SceneUnit,a=i.renderer()?i.renderer().getMaxAnisotropy():0;(t.converter||s.MaterialConverter.convertTexture)(t,r,o,a)}var l=i.matman();l&&(l.setTextureInCache(e,t,r),n.loadOptions.onTextureReceived&&n.loadOptions.onTextureReceived(l,t,r,!S()),!S()&&i&&n.loadDone&&!n.texLoadDone&&(n.texLoadDone=!0,i.onTextureLoadComplete(e)))}}(a))}}}function S(){return g}function w(e){e>=0&&(y=e,b=Math.max(16384,v/(4*y)))}const M={loadTextureWithSecurity:_,loadMaterialTextures:A,loadModelTextures:function(e,t){var i=t.matman(),n=i._getModelHash(e),r=e.isOTG(),o=0;if(r)o=e.getData().metadata.stats.num_textures||0;else for(var s in i._materials){if(-1!==s.indexOf(n))(a=i._materials[s]).textureMaps&&(o+=Object.keys(a.textureMaps).length)}for(var s in w(o),i._materials){var a;if(r||-1!==s.indexOf(n))A(e,a=i._materials[s],t)}var l=e.getData();!S()&&t&&l.loadDone&&!l.texLoadDone&&(l.texLoadDone=!0,t.onTextureLoadComplete(e))},loadCubeMap:function(e,t,i){var n,r=function(n){n?(n.mapping=c.CubeReflectionMapping,n.LogLuv=-1!==e.indexOf("logluv"),n.RGBM=-1!==e.indexOf("rgbm"),(0,a.DecodeEnvMap)(n,t,!1,i)):i&&i(n)};return c.ImageUtils.crossOrigin="",Array.isArray(e)?(n=c.ImageUtils.loadTextureCube(e,c.CubeReflectionMapping,r)).format=c.RGBFormat:"string"==typeof e?-1!==e.toLowerCase().indexOf(".dds")?(n=(new h.DDSLoader).load(e,r)).mipmaps=n.mipmaps||[]:(n=x(e,c.SphericalReflectionMapping,i)).format=c.RGBFormat:e?i&&i(e):i&&i(null),n},requestsInProgress:S,calculateTextureSize:function(e){var t=4;switch(e.format){case c.AlphaFormat:t=1;break;case c.RGBFormat:t=3;break;case c.LuminanceFormat:t=1;break;case c.LuminanceAlphaFormat:t=2}switch(e.type){case c.ShortType:case c.UnsignedShortType:case c.HalfFloatType:t*=2;break;case c.IntType:case c.UnsignedIntType:case c.FloatType:t*=4;break;case c.UnsignedShort4444Type:case c.UnsignedShort5551Type:case c.UnsignedShort565Type:t=2}var i=t*e.image.width;return i+=e.unpackAlignment-1,i-=i%e.unpackAlignment,e.image.height*i},imageToCanvas:function(e,t,i){let n=e.width,r=e.height,o=f.createElement("canvas"),s=o.getContext("2d");return s.globalCompositeOperation="copy",o.width=n,o.height=r,t&&(s.fillStyle=i||"#FFFFFF",s.fillRect(0,0,n,r)),s.drawImage(e,0,0,n,r),o}}},85218:(e,t,i)=>{const{isNodeJS:n,getGlobal:r}=i(16840);var o=i(43644).getResourceUrl;n()?function(){var t=i(15523).MainWorker;function n(){return new t}e.exports={createWorker:n,initWorkerScript:function(e,t){e&&e()},createWorkerWithIntercept:function(){return n()}}}():function(){var t=Autodesk.Viewing.Private,i=t.LMV_WORKER_URL||"src/file-loaders/workers/MainWorker-web.js",n=null,s=!1,a=[];function l(e){let r;return r=t.ENABLE_INLINE_WORKER?new Worker(n):new Worker(o(i)),r.doOperation=r.postMessage,!0===e&&t.ViewingService.forwardProtocolHandlerToWorker(r),r}e.exports={createWorker:l,initWorkerScript:function(e,l){if(t.ENABLE_INLINE_WORKER&&!n){if(a.push({successCB:e}),!s){let e=new XMLHttpRequest;var c=i,h=o(i);h&&(c=h),e.open("GET",c,!0),e.withCredentials=!1,e.onload=function(){let t,i=r();s=!1,i.URL=i.URL||i.webkitURL;try{t=new Blob([e.responseText],{type:"application/javascript"})}catch(i){let n=new BlobBuilder;n.append(e.responseText),t=n.getBlob()}n=URL.createObjectURL(t);let o=a.concat();a=[];for(let e=0;e<o.length;++e)o[e].successCB&&o[e].successCB()},s=!0,e.send()}let t={cancel:function(){let t=-1;return!!a.some((function(i,n){return i.successCB==e&&(t=n,!0)}))&&(a.splice(t,1),!0)}};return t}return e&&e(),null},createWorkerWithIntercept:function(e){let t=l(e);t.checkEvent=function(e){return!(!e.data||!e.data.assetRequest)};let i=[];return t.addEventListenerWithIntercept=function(e){let n=function(i){t.checkEvent(i)||e(i)};return i||(i=[]),i.push({arg:e,callback:n}),t.addEventListener("message",n,!1),n},t.removeEventListenerWithIntercept=function(e){let n=function(e){if(!i)return null;for(let t=0;t<i.length;++t)if(i[t].arg===e){let e=i[t].callback;return i.splice(t,1),0===i.length&&(i=null),e}return null}(e);n&&t.removeEventListener("message",n,!1)},t.clearAllEventListenerWithIntercept=function(){if(!i)return;let e=i.concat();for(let i=0;i<e.length;++i)t.removeEventListenerWithIntercept(e[i].arg)},t},clearWorkerDataURL:function(){n=null}}}()},72336:(e,t,i)=>{"use strict";i.r(t),i.d(t,{loadWasmWorker:()=>o});const{getResourceUrl:n}=i(43644),{getGlobal:r}=i(16840);function o(e){const t={},i=n("wasm.worker.js");return new Promise(((t,s)=>{(function(e){const t=Autodesk.Viewing.Private;return new Promise((function(i){if(t.ENABLE_INLINE_WORKER){let t=new XMLHttpRequest;t.open("GET",e,!0),t.withCredentials=!1,t.onload=function(){let e,n=r();n.URL=n.URL||n.webkitURL;try{e=new Blob([t.responseText],{type:"application/javascript"})}catch(i){let n=new BlobBuilder;n.append(t.responseText),e=n.getBlob()}i(URL.createObjectURL(e))},t.send()}else i(e)}))})(i).then((function(i){const r=new Worker(i),a={},l=n(e);r.postMessage({eventType:"INITIALIZE",eventData:l}),r.addEventListener("message",(function(e){if("INITIALIZED"===e.data.eventType){e.data.eventData.forEach((e=>{a[e]=function(){return o(e,r,(t=>{t.postMessage({eventData:{method:e,arguments:Array.from(arguments)}})}))}}));const i="getBuffer";return a[i]=function(){return o(i,r,(e=>{e.postMessage({eventType:"GET_BUFFER"})}))},void t(a)}})),r.addEventListener("error",(function(e){s(e)}))}))}));function o(e,i,n){return new Promise(((r,o)=>{const s=function(e,i){let n,r;t&&t.hasOwnProperty(e)?(n=t[e][0],r=n.inUse):(t[e]=[],r=!0);r&&(n={channel:new MessageChannel,inUse:!1},t[e].push(n),i.postMessage({eventType:"SET_CHANNEL_PORT",eventData:{method:e,port:n.channel.port2}},[n.channel.port2]));return n}(e,i),a=s.channel;s.inUse=!0,n(a.port1),a.port1.onmessage=function(i){s.inUse=!1;const n=i.data.eventType,a=i.data.eventData;"ERROR"===n?o(a):r(a),function(e,t){for(let i=1;i<t.length;i++){if(t[i].channel===e.channel)return t.splice(i,1),!0}}(s,t[e])}}))}}},82079:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ErrorCodes:()=>n,errorCodeString:()=>r,getErrorCode:()=>o});const n={UNKNOWN_FAILURE:1,BAD_DATA:2,NETWORK_FAILURE:3,NETWORK_ACCESS_DENIED:4,NETWORK_FILE_NOT_FOUND:5,NETWORK_SERVER_ERROR:6,NETWORK_UNHANDLED_RESPONSE_CODE:7,BROWSER_WEBGL_NOT_SUPPORTED:8,BAD_DATA_NO_VIEWABLE_CONTENT:9,BROWSER_WEBGL_DISABLED:10,BAD_DATA_MODEL_IS_EMPTY:11,RTC_ERROR:12,UNSUPORTED_FILE_EXTENSION:13,VIEWER_INTERNAL_ERROR:14,WEBGL_LOST_CONTEXT:15,LOAD_CANCELED:16};function r(e){return"ErrorCode:"+e+"."}function o(e){return 403===e||401===e?n.NETWORK_ACCESS_DENIED:404===e?n.NETWORK_FILE_NOT_FOUND:e>=500?n.NETWORK_SERVER_ERROR:n.NETWORK_UNHANDLED_RESPONSE_CODE}},32154:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ViewingService:()=>h,pathToURL:()=>p,textToArrayBuffer:()=>f});i(92087),i(83475),i(46273),i(51568),i(26349),i(10072),i(99137),i(71957),i(96306),i(103),i(8582),i(90618),i(74592),i(88440),i(58276),i(35082),i(12813),i(18222),i(24838),i(38563),i(50336),i(7512),i(46603),i(70100),i(10490),i(13187),i(60092),i(19041),i(30666),i(51638),i(62975),i(15728),i(46056),i(44299),i(5162),i(50292),i(1025),i(77479),i(34582),i(47896),i(12647),i(98558),i(84018),i(97507),i(61605),i(49076),i(34999),i(88921),i(96248),i(13599),i(11477),i(64362),i(15389),i(46006),i(90401),i(45164),i(91238),i(54837),i(87485),i(56767),i(69916),i(76651),i(61437),i(35285),i(39865),i(86035),i(67501),i(21568),i(48824),i(44130),i(78206),i(76478),i(79715),i(43561),i(32049),i(86020),i(56585),i(84633);var n=i(49720),r=i(82079),o=i(2283),s=i(75121),a=i(16840),l=i(24414),c=i(99591);let h={WORKER_REGISTER_FILE_PORT:"REGISTER_FILE_PORT",WORKER_READ_FILE:"READ_FILE"};var u=!1;function d(e){var t=e.split("/");if(0==t.length)return e;for(var i=[],n=0;n<t.length;++n){var r=t[n];"."!==r&&(".."===r&&i.length?i.pop():i.push(r))}return 0==i.length?"":i.join("/")}function p(e,t){if(-1!==e.indexOf("://")||0===e.indexOf("urn:"))return e;if(t)return t+e;if("undefined"==typeof window)return e;const i=(0,a.getGlobal)();var n=i.location.pathname,r=n.lastIndexOf("/");return n=n.substr(0,r+1),i.location.protocol+"//"+i.location.host+n+e}function f(e,t){for(var i=e.length-t,n=new ArrayBuffer(i),r=new Uint8Array(n,0),o=0,s=t;o<i;o++,s++)r[o]=255&e.charCodeAt(s);return r}function m(e,t){return-1===t.indexOf("file://")&&(-1!==t.indexOf("://")||(!!e||void 0))}if(h.simplifyPath=d,h.OSS_PREFIX="urn:adsk.objects:os.object:",h.generateUrl=function(e,t,i,n,r,o){if(i=i||"",(0,a.isNodeJS)()&&!m(e,i))return i;var l=(i=d(i)).indexOf("urn:"),c=i.indexOf("?");if(i=-1!=l?-1!==c?i.slice(0,l)+encodeURIComponent(i.slice(l,c))+i.slice(c):i.slice(0,l)+encodeURIComponent(i.slice(l)):encodeURI(i),r&&h.isOSSUrl(i)){var u=i.indexOf("/objects/")+9,p=i.substring(u);i=i.substring(0,u)+encodeURIComponent(p)}if(!t||0!==decodeURIComponent(i).indexOf("urn:"))return m(null,i)?i:e+i;switch("items"!==t&&(i=i.substr(6)),t){case"items":return s.endpoint.getItemApi(e,i,n);case"bubbles":return s.endpoint.getManifestApi(e,i,n);case"thumbnails":return s.endpoint.getThumbnailApi(e,i,n);case"properties":return s.endpoint.getPropertyQueryApi(e,i,n,o)}},(0,a.isNodeJS)())!function(){var e=i(74617),t=i(78322),o=i(80959),s=i(75725),a=i(8575);let l=new o.Agent({keepAlive:!0,keepAliveMsecs:100,maxSockets:10}),c=new s.Agent({keepAlive:!0,keepAliveMsecs:100,maxSockets:10});var u=new o.Agent({maxSockets:10});h.rawGet=function(i,d,p,f,g,v){if(v=v||{},m(i,p=h.generateUrl(i,d,p,void 0,v.escapeOssObjects))){if(v.queryParams){var y=-1===p.indexOf("?")?"?":"&";p=p+y+v.queryParams}var b=a.parse(p),x={host:b.hostname,port:b.port,method:v.method||"GET",path:b.path,headers:{},retryCount:0,agent:"https:"===b.protocol?l:c};if(x.host.endsWith(".api.autodesk.com")&&(x.path.startsWith("/derivativeservice")||x.path.startsWith("/modelderivative"))&&(x.agent=u),v.headers)for(var _ in v.headers)x.headers[_]=v.headers[_];x.headers["accept-encoding"]||(x.headers["accept-encoding"]="gzip, deflate"),v.range&&(x.headers.Range="bytes="+v.range.min+"-"+v.range.max),(v.ondata||v.onprogress)&&(v.responseType="arraybuffer");var E=("https:"===b.protocol?o:s).request(x,(function(e){var i=!(e.statusCode>=200&&e.statusCode<400),o=e;i||!function(e,t){return!!("gzip"===e.headers["content-encoding"]||t.endsWith(".json.gz")||t.endsWith("FragmentList.pack")||t.endsWith("LightList.bin")||t.endsWith("CameraList.bin")||t.endsWith("CameraDefinitions.bin")||t.endsWith("LightDefinitions.bin"))}(e,b.pathname)||v.skipDecompress||(o=e.pipe(t.createGunzip())),"json"!==v.responseType&&"text"!==v.responseType&&v.responseType||o.setEncoding("utf8");var s=[],a=Buffer.allocUnsafe(65536),l=0;o.on("data",(function(e){if(v.onprogress){if(e.length+l>a.length){var t=Buffer.allocUnsafe(0|Math.ceil(1.5*a.length));a.copy(t,0,0,l),a=t}return e.copy(a,l,0,e.length),l+=e.length,void(v.onprogress(a,l)&&E.abort())}s.push(e),v.ondata&&v.ondata(e)})),o.on("end",(function(){if(e.statusCode>=200&&e.statusCode<400){if("json"===v.responseType){var i=JSON.parse(s.join(""));return void f(i)}if("text"===v.responseType||""===v.responseType){var o=s.join("");return void f(o)}var c=v.onprogress?a:Buffer.concat(s);if(!v.skipDecompress&&31===c[0]&&139===c[1]){n.logger.warn("An LMV resource ("+p+") was double compressed, or Content-Encoding header missing");try{c=t.gunzipSync(c),l=c.length}catch(e){g(r.ErrorCodes.BAD_DATA,"Malformed data received when requesting file",{url:p,exception:e.toString(),stack:e.stack})}}200===E.status&&v.range&&(c=new Uint8Array(c,v.range.min,v.range.max-v.range.min)),f(c,l)}else g&&g(e.statusCode,e.statusMessage,{url:p})}))}));E.on("error",(function(e){g&&g(e.code,e.message,{url:p})})),v.postData&&E.write(v.postData),E.end()}else!function(i,n,r,o){function s(e){if("json"===o.responseType)try{return JSON.parse(e.toString("utf8"))}catch(e){r(e)}return e}0===i.indexOf("file://")&&(i=i.substr(7)),e.readFile(i,(function(e,a){e?r(0,0,{httpStatusText:e,url:i}):31===a[0]&&139===a[1]?t.gunzip(a,null,(function(e,t){e?r(0,0,{httpStatusText:e,url:i}):(t=s(t),o.ondata&&o.ondata(t),n(t))})):(a=s(a),o.ondata&&o.ondata(a),n(a))}))}(p,f,g,v)}}();else{var g=new(i(79916));g.max=25;var v={},y={},b={};h.registerProtocolPort=function(e,t){/^(http(s)?|file):/gi.test(e)?console.warn("http(s) or file protocol were not allowed to be handled"):t?(v[e]=t,t.onmessage=function(e){var t=e.data.url;if(y[t]){var i=y[t];if(e.data.error)i.onFailureWrapped(r.ErrorCodes.BAD_DATA,"Malformed data received when requesting file",{url:t,exception:e.data.error.message,stack:e.data.error.stack});else{var n=e.data.buffer;if(y[t]=void 0,31===n[0]&&139===n[1]&&t.match(/(.f2d|.gz)$/gi))try{n=c.ungzip(n),i.options&&i.options.ondata&&i.options.ondata(n),i.onSuccessWrapped(n)}catch(e){i.onFailureWrapped(r.ErrorCodes.BAD_DATA,"Malformed data received when requesting file",{url:t,exception:e.toString(),stack:e.stack})}else i.onSuccessWrapped(n)}}else if(b[t]){var o=[];e.data&&e.data.buffer&&e.data.buffer.buffer instanceof ArrayBuffer&&o.push(e.data.buffer.buffer),b[t].postMessage(e.data,o),b[t]=void 0}}):v[e]&&v[e]instanceof MessagePort&&(v[e].onmessage=void 0,v[e]=void 0)},h.handlerProtocol=function(e,t,i,n,r){var o=v[e];y[t]={onSuccessWrapped:i,onFailureWrapped:n,options:r},o.postMessage({operation:h.WORKER_READ_FILE,url:t})},h.forwardProtocolHandlerToWorker=function(e){var t={},i=new MessageChannel;for(var n in i.port1.onmessage=function(e){var t=new URL(e.data.url);v[t.protocol].postMessage(e.data),b[t]=i.port1},v)v[n]instanceof MessagePort&&(t[n]=i.port2);e.doOperation({operation:h.WORKER_REGISTER_FILE_PORT,protocolPortMap:t},[i.port2])},h.rawGet=function(e,t,i,r,o,s){g.go((a=>{let l=function(){a();for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];o&&o.apply(o,t)},c=function(){a();for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];r&&r.apply(r,t)};var u=/^(\w+:)\/\//gi.exec(i);u&&2==u.length&&v[u[1]]?h.handlerProtocol(u[1],i,c,l,s):h._rawGet(e,t,i,c,(function(){const r=arguments.length<=0?void 0:arguments[0],o=((null==s?void 0:s.method)||(null!=s&&s.noBody?"HEAD":"GET")).toLowerCase(),a="get"===o&&(0===r||429===r||r>=500);if(a){const o=arguments.length<=3?void 0:arguments[3];let a=100,u=5,d=!1;if(429!==r&&503!==r||null==o||!o.getResponseHeader("Retry-After")?0===r&&(d=3,u=2):d=o.getResponseHeader("Retry-After"),d){const e=Number(d);a=!isNaN(e)&&1e3*e||Date.parse(d)-(new Date).getTime(),a=a>100?a:100}h._retryRequest(e,t,i,s,a,u).then((e=>{n.logger.warn(`request ${i} successful after retries.`),c(...e)})).catch((e=>{n.logger.warn(`request ${i} unsuccessful after retries.`),l(...e)}))}else l(...arguments)}),s)}))},h._retryRequest=function(e,t,i,r,o,s){const a={delayFirstAttempt:!0,startingDelay:o,numOfAttempts:4,retry:(e,t)=>{let[i,r,{url:o}]=e;return n.logger.warn(`request ${o} failed with status ${i} ${r}. Attempt ${t}`),!0},timeMultiple:s};return(0,l.backOff)((()=>new Promise(((n,o)=>{h._rawGet(e,t,i,(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n(t)}),(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return o(t)}),r)}))),a)},h.isOSSUrl=function(e){return!!e&&-1!==e.indexOf("/oss/v2/buckets")},h.getSignedS3DownloadUrl=function(e){return new Promise((t=>{const i=e.indexOf("?acmsession=");-1!==i&&(e=e.substring(0,i)),e+="/signeds3download?useCdn=true";const n=new XMLHttpRequest;n.open("GET",e),n.setRequestHeader("Authorization",s.endpoint.HTTP_REQUEST_HEADERS.Authorization),n.responseType="json",n.send();const r=()=>{t(null)};n.onload=e=>{const i=e.currentTarget.response;t(i.url)},n.onerror=r,n.ontimeout=r,n.onabort=r}))},h._rawGet=async function(e,t,i,s,a,l){l=l||{},i=h.generateUrl(e,t,i,l.apiData,l.escapeOssObjects,l.guid);let d=!1;if(h.isOSSUrl(i)){const e=await h.getSignedS3DownloadUrl(i);e?(i=e,d=!0):console.warn("Failed getting signed URL - Fallback to direct OSS resource.")}if(l.queryParams&&!d){var p=-1===i.indexOf("?")?"?":"&";i=i+p+l.queryParams}var m=new XMLHttpRequest;function g(e){a&&a(m.status,m.statusText,{url:i},m)}function v(e){if("json"===l.responseType)try{if(e instanceof Uint8Array)return(0,o.Up)(e);if("string"==typeof e)return JSON.parse(e)}catch(e){}return e}function y(e){if(m.status>=200&&m.status<400)if(m.response&&m.response instanceof ArrayBuffer){var t;if(t=200===m.status&&l.range?new Uint8Array(m.response,l.range.min,l.range.max-l.range.min):new Uint8Array(m.response),!l.skipDecompress&&31===t[0]&&139===t[1]){u||(u=!0,n.logger.warn("An LMV resource ("+i+") was not uncompressed by the browser. This hurts performance. Check the Content-Encoding header returned by the server and check whether you're getting double-compressed streams. The warning prints only once but it's likely the problem affects multiple resources."));try{t=c.ungzip(t)}catch(e){a(r.ErrorCodes.BAD_DATA,"Malformed data received when requesting file",{url:i,exception:e.toString(),stack:e.stack},m)}}s&&s(v(t))}else{var o=m.response;o||l.responseType&&"text"!==l.responseType||(o=m.responseText),s&&s(v(o))}else g()}try{var b=!l.hasOwnProperty("asynchronous")||l.asynchronous;if(m.open(l.method||(l.noBody?"HEAD":"GET"),i,b),l.hasOwnProperty("responseType")&&(m.responseType=l.responseType),l.range&&m.setRequestHeader("Range","bytes="+l.range.min+"-"+l.range.max),!d&&(m.withCredentials=!0,l.hasOwnProperty("withCredentials")&&(m.withCredentials=l.withCredentials),l.headers))for(var x in l.headers)m.setRequestHeader(x,l.headers[x]),"authorization"===x.toLocaleLowerCase()&&(m.withCredentials=!1);b&&(m.onload=y,m.onerror=g,m.ontimeout=g,m.onabort=function(e){a&&a(m.status,"request was aborted",{url:i,aborted:!0},m)},(l.ondata||l.onprogress)&&(m.overrideMimeType("text/plain; charset=x-user-defined"),l._dlProgress={streamOffset:0},m.onreadystatechange=function(){if(m.readyState>2&&200===m.status)if(l.ondata){var e=m.responseText;if(l._dlProgress.streamOffset>=e.length)return;var t=f(e,l._dlProgress.streamOffset);l._dlProgress.streamOffset=e.length,l.ondata(t)}else if(l.onprogress){l.onprogress(m.responseText)&&m.abort()}})),m.send(l.postData),b||y()}catch(e){a(m.status,m.statusText,{url:i,exception:e},m)}}}function x(e,t){t.hasOwnProperty("responseType")||(t.responseType="arraybuffer"),t.hasOwnProperty("withCredentials")||(t.withCredentials=!!e.auth),t.headers=e.headers,t.queryParams=e.queryParams,t.endpoint=e.endpoint,t.escapeOssObjects=e.escapeOssObjects}h.defaultFailureCallback=function(e,t,i){403==e?this.raiseError(r.ErrorCodes.NETWORK_ACCESS_DENIED,"Access denied to remote resource",{url:i.url,httpStatus:e,httpStatusText:t}):404==e?this.raiseError(r.ErrorCodes.NETWORK_FILE_NOT_FOUND,"Remote resource not found",{url:i.url,httpStatus:e,httpStatusText:t}):0===e&&i.aborted?this.raiseError(r.ErrorCodes.LOAD_CANCELED,"Request aborted",{url:i.url,httpStatus:e,httpStatusText:t}):e>=500&&e<600?this.raiseError(r.ErrorCodes.NETWORK_SERVER_ERROR,"Server error when accessing resource",{url:i.url,httpStatus:e,httpStatusText:t}):i.exception?this.raiseError(r.ErrorCodes.NETWORK_FAILURE,"Network failure",{url:i.url,exception:i.exception.toString(),stack:i.exception.stack}):this.raiseError(r.ErrorCodes.NETWORK_UNHANDLED_RESPONSE_CODE,"Unhandled response code from server",{url:i.url,httpStatus:e,httpStatusText:t,data:i})},h.getItem=function(e,t,i,n,r){if(x(e,r=r||{}),r.range&&!e.supportsRangeRequests){let e="start="+r.range.min+"&end="+r.range.max;r.queryParams?r.queryParams+="&"+e:r.queryParams=e,r.range=void 0}h.rawGet(e.endpoint,"items",t,i,n,r)},h.getManifest=function(e,t,i,n,r){(r=r||{}).hasOwnProperty("responseType")||(r.responseType="json"),x(e,r),h.rawGet(e.endpoint,"bubbles",t,i,n,r)},h.getProperties=function(e,t,i,n,r,o){const s={};x(e,s),s.responseType="json",s.guid=i,s.method="POST",s.postData=JSON.stringify(n),s.headers["Content-Type"]="application/json",s.headers.accept="application/json",s.headers["Access-Control-Allow-Origin"]="*",h.rawGet(e.endpoint,"properties",t,r,o,s)},h.getThumbnail=function(e,t,i,n,r){x(e,r=r||{});var o=r.queryParams||"",s=[];if(-1===o.indexOf("guid=")&&r.guid&&s.push("guid="+encodeURIComponent(r.guid)),-1===o.indexOf("role=")){var a=r.role||"rendered";s.push("role="+a)}if(-1===o.indexOf("width=")){var l=r.size||400;s.push("width="+l)}if(-1===o.indexOf("height=")){l=r.size||400;s.push("height="+l)}-1===o.indexOf("acmsession=")&&r.acmsession&&s.push("acmsession="+r.acmsession);var c=s.join("&");r.queryParams?r.queryParams=r.queryParams+"&"+c:r.queryParams=c,h.rawGet(e.endpoint,"thumbnails",t,i,n,r)},h.getACMSession=function(e,t,i,r){const o={numOfAttempts:4,timeMultiple:5,retry:(e,t)=>(n.logger.warn(`acmsession request failed. Attempt #${t}`),!0)};(0,l.backOff)((()=>new Promise(((i,n)=>{h._getACMSession(e,t,i,n)}))),o).then((function(){return i(...arguments)})).catch((function(){return r(...arguments)}))},h._getACMSession=function(e,t,i,n){var r,o={};for(var s in t)"oauth2AccessToken"===s?r=t[s]:-1!==s.indexOf("x-ads-acm")&&(o[s]=t[s]);o.application="autodesk";var a=new XMLHttpRequest;a.open("POST",e+"/oss-ext/v2/acmsessions",!0),a.setRequestHeader("Content-Type","application/json"),a.setRequestHeader("Authorization","Bearer "+r),a.responseType="json",a.onload=function(){if(200===a.status&&a.response){var e="string"==typeof a.response?JSON.parse(a.response):a.response;e&&e.acmsession?i(e.acmsession):n(a.status,"Can't get acm session from response.")}else n(a.status)},a.onerror=n,a.ontimeout=n,a.send(JSON.stringify(o)),delete o.application}},75121:(e,t,i)=>{"use strict";i.r(t),i.d(t,{endpoint:()=>S,getEnv:()=>g,getOfflineResourcePrefix:()=>A,initLoadContext:()=>w,isOffline:()=>b,setEnv:()=>v,setOffline:()=>x,setOfflineResourcePrefix:()=>E});var n=i(16840),r=i(43644);const o=(0,n.getGlobal)();var s={},a=null;s.ENDPOINT_API_DERIVATIVE_SERVICE_V2="derivativeV2",s.ENDPOINT_API_MODEL_DERIVATIVE_V2="modelDerivativeV2",s.ENDPOINT_API_FLUENT="fluent",s.ENDPOINT_API_D3S="D3S",s.ENDPOINT_API_DERIVATIVE_STREAMING="streamingV2";var l,c={derivativeV2:{baseURL:"/derivativeservice/v2",itemURL:"/derivativeservice/v2/derivatives/:derivativeurn",manifestURL:"/derivativeservice/v2/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/thumbnails/:urn",propertyQueryURL:"/modelderivative/v2/designdata/:urn/metadata/:guid/properties:query"},derivativeV2_EU:{baseURL:"/derivativeservice/v2/regions/eu",itemURL:"/derivativeservice/v2/regions/eu/derivatives/:derivativeurn",manifestURL:"/derivativeservice/v2/regions/eu/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/regions/eu/thumbnails/:urn"},derivativeV2_Fedramp:{baseURL:"/derivativeservice/v2",itemURL:"/derivativeservice/v2/derivatives/:derivativeurn",manifestURL:"/derivativeservice/v2/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/thumbnails/:urn"},modelDerivativeV2:{baseURL:"/modelderivative/v2/",itemURL:"/modelderivative/v2/designdata/:urn/manifest/:derivativeurn",manifestURL:"/modelderivative/v2/designdata/:urn/manifest",thumbnailsURL:"/modelderivative/v2/designdata/:urn/thumbnail",propertyQueryURL:"/modelderivative/v2/designdata/:urn/metadata/:guid/properties:query"},fluent:{baseURL:"/modeldata",itemURL:"/modeldata/file/:derivativeurn",manifestURL:"/modeldata/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/thumbnails/:urn",cdnURL:"/cdn",cdnWS:"/cdnws"},D3S:{baseURL:"/modeldata",itemURL:"/modeldata/file/:derivativeurn",manifestURL:"/modeldata/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/thumbnails/:urn",cdnURL:"/cdn",cdnWS:"/cdnws"},D3S_EU:{baseURL:"/modeldata",itemURL:"/modeldata/file/:derivativeurn",manifestURL:"/modeldata/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/regions/eu/thumbnails/:urn",cdnURL:"/cdn",cdnWS:"/cdnws"},streamingV2:{baseURL:"/modeldata",itemURL:"/modeldata/file/:derivativeurn",manifestURL:"/modeldata/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/thumbnails/:urn",cdnURL:"/cdn",cdnWS:"/cdnws"},streamingV2_EU:{baseURL:"/regions/eu/modeldata",itemURL:"/regions/eu/modeldata/file/:derivativeurn",manifestURL:"/regions/eu/modeldata/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/regions/eu/thumbnails/:urn",cdnURL:"/regions/eu/cdn",cdnWS:"/regions/eu/cdnws"},streamingV2_Fedramp:{baseURL:"/modeldata",itemURL:"/modeldata/file/:derivativeurn",manifestURL:"/modeldata/manifest/:urn",thumbnailsURL:"/derivativeservice/v2/thumbnails/:urn",cdnURL:"/cdn",cdnWS:"/cdnws"}},h="",u=s.ENDPOINT_API_DERIVATIVE_SERVICE_V2,d=!1,p=!1,f="",m=!1;function g(){return l}function v(e){l=e,e.startsWith("MD20")&&console.warn(`env=${e} is deprecated and will be removed in a future release. Use Autodesk{env}2 instead, where env=Development, Staging, or Production`)}s.HTTP_REQUEST_HEADERS={},s.queryParams={},s.setEndpointAndApi=function(e,t){e&&(h=e),t&&(u=t,t.startsWith("D3S")&&console.warn(`api=${t} is deprecated and will be removed in a future release. Use streamingV2 or streamingV2_EU (europe region) instead`))},s.getEndpointAndApi=function(){return h+c[u].baseURL},s.getApiEndpoint=function(){return h},s.getApiFlavor=function(){return u},s.getCdnUrl=function(){return a||(h?h+c[u].cdnURL:void 0)},s.getCdnWebSocketEndpoint=function(){return h+(c[u].cdnWS||"")},s.setCdnUrl=function(e){a=e},s.getCdnRedirectUrl=function(){var e=c[u].cdnRedirectURL;return e?h+e:null},s.setAcmSession=function(e){f=e},s.getAcmSession=function(){return f},s.getManifestApi=function(e,t,i){var n=e||h;return t=t||"",n=(n+=c[i=i||u].manifestURL).replace(":urn",t)},s.getItemApi=function(e,t,i){var n=i||u,r=(e||h)+c[n].itemURL;t=t||"";var o=decodeURIComponent(t);if(-1!==r.indexOf(":urn")){var a=o.split("/")[0]||"";a=(a=a.split(":"))[a.length-1]||"",r=r.replace(":urn",a)}return n===s.ENDPOINT_API_MODEL_DERIVATIVE_V2&&(t=encodeURIComponent(o)),r=r.replace(":derivativeurn",t)},s.getThumbnailApi=function(e,t,i){return((e||h)+c[i||u].thumbnailsURL).replace(":urn",t||"")},s.getPropertyQueryApi=function(e,t,i,n){let r=(e||h)+c[i||u].propertyQueryURL;return r=r.replace(":urn",t||""),r.replace(":guid",n||"")},s.getUseCredentials=function(){return d},s.getDomainParam=function(){return console.warn("getDomainParam is deprecated, switch to getQueryParams instead."),this.getUseCredentials()&&!(0,n.isNodeJS)()?"domain="+encodeURIComponent(o.location.origin):""},s.addQueryParam=function(e,t){this.queryParams[e]=t},s.deleteQueryParam=function(e){delete this.queryParams[e]},s.getQueryParams=function(e){let t=this.getUseCredentials()&&!(0,n.isNodeJS)()?"domain="+encodeURIComponent(o.location.origin):"";(0,r.getParameterByName)("bypassds")&&(t=t?t+"&bypassds=1":"bypassds=1");let i=[];for(let e in this.queryParams)i.push(encodeURIComponent(e)+"="+encodeURIComponent(this.queryParams[e]));return i.length&&(t?t+="&"+i.join("&"):t=i.join("&")),t&&e&&(e.queryParams?e.queryParams+="&"+t:e.queryParams=t),t},s.setUseCredentials=function(e){d=e},s.setUseCookie=function(e){p=e},s.getUseCookie=function(){return p},s.isOtgBackend=function(){return this.getApiFlavor()===this.ENDPOINT_API_FLUENT},s.isSVF2Backend=function(){let e=this.getApiFlavor();return e.startsWith(this.ENDPOINT_API_D3S)||e.startsWith(this.ENDPOINT_API_DERIVATIVE_STREAMING)},s.setEscapeOssObjects=function(e){m=e},s.getEscapeOssObjects=function(){return m},s.initLoadContext=function(e){for(var t in(e=e||{}).auth=this.getUseCredentials(),e.endpoint||(e.endpoint=this.getApiEndpoint()),e.api||(e.api=this.getApiFlavor()),e.headers||(e.headers={}),this.HTTP_REQUEST_HEADERS)e.headers[t]=this.HTTP_REQUEST_HEADERS[t];return e.api,this.ENDPOINT_API_FLUENT,this.getQueryParams(e),e.otg_cdn=a||this.getCdnUrl(),e.otg_ws=this.getCdnWebSocketEndpoint(),e.escapeOssObjects=this.getEscapeOssObjects(),e};var y=!1;function b(){return y}function x(e){y=e}var _="";function E(e){_=e}function A(){return _}let S=s,w=s.initLoadContext.bind(s)},63740:(e,t,i)=>{"use strict";i.r(t),i.d(t,{extendLocalization:()=>M,initializeLocalization:()=>C,setLanguage:()=>T});var n=i(16840);function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=[],s=o.forEach,a=o.slice;function l(e){return s.call(a.call(arguments,1),(function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])})),e}function c(){return"function"==typeof XMLHttpRequest||"object"===("undefined"==typeof XMLHttpRequest?"undefined":r(XMLHttpRequest))}var h,u,d,p=i(83154),f=i.t(p,2);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}"function"==typeof fetch&&(h="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),c()&&("undefined"!=typeof global&&global.XMLHttpRequest?u=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(u=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?d=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(d=window.ActiveXObject)),h||!f||u||d||(h=p||f),"function"!=typeof h&&(h=void 0);var g=function(e,t){if(t&&"object"===m(t)){var i="";for(var n in t)i+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t[n]);if(!i)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+i.slice(1)}return e},v=function(e,t,i){h(e,t).then((function(e){if(!e.ok)return i(e.statusText||"Error",{status:e.status});e.text().then((function(t){i(null,{status:e.status,data:t})})).catch(i)})).catch(i)},y=!1;const b=function(e,t,i,n){return"function"==typeof i&&(n=i,i=void 0),n=n||function(){},h?function(e,t,i,n){e.queryStringParams&&(t=g(t,e.queryStringParams));var r=l({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);i&&(r["Content-Type"]="application/json");var o="function"==typeof e.requestOptions?e.requestOptions(i):e.requestOptions,s=l({method:i?"POST":"GET",body:i?e.stringify(i):void 0,headers:r},y?{}:o);try{v(t,s,n)}catch(e){if(!o||0===Object.keys(o).length||!e.message||e.message.indexOf("not implemented")<0)return n(e);try{Object.keys(o).forEach((function(e){delete s[e]})),v(t,s,n),y=!0}catch(e){n(e)}}}(e,t,i,n):c()||"function"==typeof ActiveXObject?function(e,t,i,n){i&&"object"===m(i)&&(i=g("",i).slice(1)),e.queryStringParams&&(t=g(t,e.queryStringParams));try{var r;(r=u?new u:new d("MSXML2.XMLHTTP.3.0")).open(i?"POST":"GET",t,1),e.crossDomain||r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.withCredentials=!!e.withCredentials,i&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.overrideMimeType&&r.overrideMimeType("application/json");var o=e.customHeaders;if(o="function"==typeof o?o():o)for(var s in o)r.setRequestHeader(s,o[s]);r.onreadystatechange=function(){r.readyState>3&&n(r.status>=400?r.statusText:null,{status:r.status,data:r.responseText})},r.send(i)}catch(e){console&&console.log(e)}}(e,t,i,n):void n(new Error("No fetch and no xhr implementation found!"))};function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var E=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(e){return JSON.parse(e)},stringify:JSON.stringify,parsePayload:function(e,t,i){return function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}({},t,i||"")},request:b,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},A=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};x(this,e),this.services=t,this.options=i,this.allOptions=n,this.type="backend",this.init(t,i,n)}var t,i,n;return t=e,i=[{key:"init",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=l(i,this.options||{},E()),this.allOptions=n,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,i){this._readAny(e,e,t,t,i)}},{key:"read",value:function(e,t,i){this._readAny([e],e,[t],t,i)}},{key:"_readAny",value:function(e,t,i,n,r){var o,s=this,a=this.options.loadPath;"function"==typeof this.options.loadPath&&(a=this.options.loadPath(e,i)),(a=function(e){return!!e&&"function"==typeof e.then}(o=a)?o:Promise.resolve(o)).then((function(o){if(!o)return r(null,{});var a=s.services.interpolator.interpolate(o,{lng:e.join("+"),ns:i.join("+")});s.loadUrl(a,r,t,n)}))}},{key:"loadUrl",value:function(e,t,i,n){var r=this;this.options.request(this.options,e,void 0,(function(o,s){if(s&&(s.status>=500&&s.status<600||!s.status))return t("failed loading "+e+"; status code: "+s.status,!0);if(s&&s.status>=400&&s.status<500)return t("failed loading "+e+"; status code: "+s.status,!1);if(!s&&o&&o.message&&o.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+o.message,!0);if(o)return t(o,!1);var a,l;try{a="string"==typeof s.data?r.options.parse(s.data,i,n):s.data}catch(t){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,a)}))}},{key:"create",value:function(e,t,i,n,r){var o=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var s=this.options.parsePayload(t,i,n),a=0,l=[],c=[];e.forEach((function(i){var n=o.options.addPath;"function"==typeof o.options.addPath&&(n=o.options.addPath(i,t));var h=o.services.interpolator.interpolate(n,{lng:i,ns:t});o.options.request(o.options,h,s,(function(t,i){a+=1,l.push(t),c.push(i),a===e.length&&r&&r(l,c)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,i=t.backendConnector,n=t.languageUtils,r=t.logger,o=i.language;if(!o||"cimode"!==o.toLowerCase()){var s=[],a=function(e){n.toResolveHierarchy(e).forEach((function(e){s.indexOf(e)<0&&s.push(e)}))};a(o),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return a(e)})),s.forEach((function(t){e.allOptions.ns.forEach((function(e){i.read(t,e,"read",null,null,(function(n,o){n&&r.warn("loading namespace ".concat(e," for language ").concat(t," failed"),n),!n&&o&&r.log("loaded namespace ".concat(e," for language ").concat(t),o),i.loaded("".concat(t,"|").concat(e),n,o)}))}))}))}}}],i&&_(t.prototype,i),n&&_(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();A.type="backend";const S=A;var w=i(67494),M=function(e){return null!==e&&"object"==typeof e&&(Object.keys(e).forEach((function(t){Autodesk.Viewing.i18n.addResourceBundle(t,"allstrings",e[t],!0,!0)})),!0)},T=function(e,t){return(0,n.getGlobal)().LOCALIZATION_REL_PATH="res/locales/"+e+"/",Autodesk.Viewing.i18n.changeLanguage(e).then((()=>Autodesk.Viewing.i18n.reloadResources())).then((()=>{t&&t()}))},C=function(e){const t=(0,n.getGlobal)(),i=t&&t.document;Autodesk.Viewing.i18n.localize=function(e){var t=e||i;Array.prototype.forEach.call(t.querySelectorAll("[data-i18n]"),(function(e){var t=e.getAttribute("data-i18n"),i=[null,t],n=i[0],r=i[1],o=Autodesk.Viewing.i18n.translate(r);o?n?e.setAttribute(n,o):e.placeholder?e.placeholder=o:e.textContent=o:n?e.setAttribute(n,r):e.textContent=r}))};var r=e&&e.language||navigator.language,o=w.Lang.getSupported(r);Autodesk.Viewing.i18n.use(S).init({lng:r,backend:{loadPath:Autodesk.Viewing.Private.getResourceUrl("res/locales/%(lng)/%(ns).json")},ns:"allstrings",defaultNS:"allstrings",fallbackLng:"en",debug:!1,useCookie:!1,interpolation:{prefix:"%(",suffix:")",escapeValue:!1}}),T(o)}},67494:e=>{"use strict";let t=new function(){this.names=[{symbol:"en",label:"English"},{symbol:"zh-Hans",label:"Chinese Simplified"},{symbol:"zh-Hant",label:"Chinese Traditional"},{symbol:"zh-HK",label:"Hong Kong Traditional"},{symbol:"ja",label:"Japanese"},{symbol:"cs",label:"Czech"},{symbol:"ko",label:"Korean"},{symbol:"pl",label:"Polish"},{symbol:"ru",label:"Russian"},{symbol:"fr",label:"French"},{symbol:"fr-CA",label:"Canadian French"},{symbol:"de",label:"German"},{symbol:"it",label:"Italian"},{symbol:"nl",label:"Dutch"},{symbol:"es",label:"Spanish"},{symbol:"pt-PT",label:"Portuguese Portugal"},{symbol:"pt-BR",label:"Portuguese Brazil"},{symbol:"tr",label:"Turkish"},{symbol:"sv",label:"Swedish"},{symbol:"da",label:"Danish"},{symbol:"no",label:"Norwegian"},{symbol:"en-GB",label:"British English"}],this.isSupported=function(e){for(var t=0;t<this.names.length;++t)if(this.names[t].symbol===e)return!0;return!1},this.getSupported=function(e){const t=e.split("-");if(e=t[0].toLowerCase(),t.length>1){let i=t[1].toUpperCase();i.length>2&&(i=i[0]+i.substring(1).toLowerCase()),e+="-"+i}return this.isSupported(e)||(e=e.indexOf("zh-CN")>-1?"zh-Hans":e.indexOf("zh-TW")>-1?"zh-Hant":t.length>1&&this.isSupported(t[0].toLowerCase())?t[0]:"en"),e},this.getLanguages=function(){return this.names.slice()}};e.exports={Lang:t}},43644:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DISABLE_FORGE_CANVAS_LOGO:()=>l,DISABLE_FORGE_LOGO:()=>a,fromUrlSafeBase64:()=>y,getHtmlTemplate:()=>u,getParameterByName:()=>f,getParameterByNameFromPath:()=>m,getResourceUrl:()=>p,getScript:()=>c,injectCSS:()=>h,isExperimentalFlagEnabled:()=>d,stringToDOM:()=>g,toUrlSafeBase64:()=>v});var n=i(16840),r=(0,n.getGlobal)(),o=r,s=o&&o.document;r.LOCALIZATION_REL_PATH="",r.LMV_VIEWER_VERSION="7.85.0",r.LMV_BUILD_TYPE="Production",r.LMV_RESOURCE_ROOT="",r.LMV_IS_FLUENT_BUILD=!1,r.USE_OTG_DS_PROXY=!1,r.LMV_THIRD_PARTY_COOKIE=!(0,n.isNodeJS)()&&void 0,"v"===r.LMV_VIEWER_VERSION.charAt(0)&&(r.LMV_VIEWER_VERSION=r.LMV_VIEWER_VERSION.substr(1)),r.LMV_VECTOR_PDF=!1,r.LMV_RASTER_PDF=!0;let a=!1,l=!0;function c(e){e=e.toLowerCase();var t=s.getElementsByTagName("SCRIPT");if(t&&t.length>0)for(var i=0;i<t.length;++i)if(t[i].src&&-1!==t[i].src.toLowerCase().indexOf(e))return t[i];return null}function h(e,t,i){for(var n=e.indexOf("://")>0?e:p(e),r=s.getElementsByTagName("link"),o=0,a=r.length;o<a;o++)if(r[o].href===n)return void(t&&t());var l=s.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("href",n),t&&(l.onload=t),i&&(l.onerror=i),s.head.appendChild(l)}function u(e,t){var i=e.indexOf("://")>0?e:p(e),n=new XMLHttpRequest;function r(e){t(e,null)}n.onload=function(e){var i=e.currentTarget.responseText;t(null,i)},n.onerror=r,n.ontimeout=r,n.open("GET",i,!0),n.send()}function d(e,t){return!(!t||!Array.isArray(t.experimental))&&-1!==t.experimental.indexOf(e)}function p(e){return r.LMV_RESOURCE_ROOT+e}function f(e){return"undefined"==typeof window?"":m(e,o.location.href)}function m(e,t){e=e.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null==i?"":decodeURIComponent(i[1].replace(/\+/g," "))}function g(e){var t=s.createElement("div");return t.innerHTML=e,t.firstChild}function v(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function y(e){for(e=(e=e.replace(/-/g,"+")).replace(/_/g,"/");e.length%4;)e+="=";return(0,n.isNodeJS)()?Buffer.from(e,"base64").toString():atob(e)}},22343:(e,t,i)=>{"use strict";i.r(t),i.d(t,{AlertBox:()=>r});var n=i(71224);function r(){}r.instances=[],r.displayError=function(e,t,i,o,s,a){var l=e.ownerDocument,c=l.createElement("div");c.className="alert-box error",e.appendChild(c);var h=o;h||(h="img-item-not-found");var u=l.createElement("div");u.className="alert-box-image "+h,c.appendChild(u);var d=l.createElement("div");d.className="alert-box-msg",c.appendChild(d);var p=i;p||(p=n.Z.t("Error Occurred",{defaultValue:"Error Occurred"}));var f=l.createElement("div");f.className="alert-box-title",f.textContent=p,f.setAttribute("data-i18n",p),d.appendChild(f);var m=l.createElement("div");if(m.className="alert-box-text",m.textContent=t,m.setAttribute("data-i18n",t),d.appendChild(m),s){var g=l.createElement("div");g.className="alert-box-content",d.appendChild(g);var v=l.createElement("ul");v.className="alert-box-content";for(var y=0;y<s.length;y++){var b=s[y];if(b){var x=l.createElement("li"),_=this.extractList(b);if(_.list.length){var E=this.generateListElement(list,l);v.appendChild(E)}x.innerHTML=_.msg,x.setAttribute("data-i18n",_.msg),v.appendChild(x)}}g.appendChild(v)}var A=l.createElement("div");A.className="alert-box-ok",A.textContent=n.Z.t("OK",{defaultValue:"OK"});var S={alertBox:c,container:e,tag:a};A.addEventListener("click",(function(t){c.style.visibility="hidden",e.removeChild(c),r.instances.splice(r.instances.indexOf(S),1)})),c.appendChild(A),c.style.visibility="visible",r.instances.push(S)},r.displayErrors=function(e,t,i){var o=e.ownerDocument,s=o.createElement("div");s.className="alert-box errors",e.appendChild(s);var a=t;a||(a="img-item-not-found");var l=o.createElement("div");l.className="alert-box-image "+a,s.appendChild(l);var c=o.createElement("div");c.className="alert-box-msg errors",s.appendChild(c);for(var h=0;h<i.length;h++){var u=i[h].header;u||(u=n.Z.t("Error",{defaultValue:"Error"}));var d=o.createElement("div");d.className="alert-box-title errors",d.textContent=u,c.appendChild(d);var p=o.createElement("div");p.className="alert-box-text errors";var f=i[h].msg;if((_=this.extractList(f)).list.length){var m=o.createElement("div"),g=this.generateListElement(_.list,o);m.appendChild(g),p.textContent=_.msg,p.appendChild(m)}else p.textContent=f;if(c.appendChild(p),i[h].hints){var v=o.createElement("ul");v.className="alert-box-content";for(var y=i[h].hints,b=0;b<y.length;b++){var x=y[b];if(x){var _,E=o.createElement("li");if(v.appendChild(E),(_=this.extractList(x)).list.length){g=this.generateListElement(_.list,o);v.appendChild(g)}E.innerHTML=_.msg}}c.appendChild(v)}}var A=o.createElement("div");A.className="alert-box-ok",A.textContent=n.Z.t("OK",{defaultValue:"OK"});var S={alertBox:s,container:e};A.addEventListener("click",(function(t){s.style.visibility="hidden",e.removeChild(s),r.instances.splice(r.instances.indexOf(S),1)})),s.appendChild(A),s.style.visibility="visible",r.instances.push(S)},r.extractList=function(e){var t={msg:e,list:[]};if(e&&-1!=e.indexOf("<ul>")){var i=e.split("<ul>");t.msg=i[0],i=i[1].split("</ul>"),t.list=i[0].split(", "),1===t.list.length&&(t.list=i[0].split(","))}return t},r.generateListElement=function(e,t){for(var i=t.createElement("ul"),n=0;n<e.length;n++){var r=t.createElement("li");r.textContent=e[n],r.setAttribute("data-i18n",e[n]),i.appendChild(r)}return i},r.dismissByTag=function(e){var t=r.instances.findIndex((t=>t&&t.tag===e));if(-1==t)return!1;var i=r.instances[t];return i.alertBox.style.visibility="hidden",i.container.removeChild(i.alertBox),r.instances.splice(t,1),!0},r.dismiss=function(){if(r.instances.length>0){var e=r.instances.pop();return e.alertBox.style.visibility="hidden",e.container.removeChild(e.alertBox),!0}return!1}},79976:(e,t,i)=>{"use strict";i.r(t),i.d(t,{OptionButton:()=>u,OptionCheckbox:()=>c,OptionDropDown:()=>d,OptionLabel:()=>h,OptionRow:()=>f,OptionSlider:()=>l,ResizeFooter:()=>p,SimpleList:()=>m});var n=i(78443),r=i(71224),o=i(16840),s=i(27293);const a=i(35255);function l(e,t,i,n,o){var s=this;this.tbody=n;var a=o&&o.insertAtIndex?o.insertAtIndex:-1;this.hideStepper=o&&o.hideStepper;var l=o&&o.hideCaption;this.sliderRow=this.tbody.insertRow(a),this.sliderRow.classList.add("switch-slider-row");var c=this.getDocument(),h=this.sliderRow.insertCell(0);function u(e){e.target!=s.stepperElement&&(s.stepperElement.value=s.sliderElement.value),s.fireChangeEvent()}this.caption=c.createElement("div"),this.caption.setAttribute("data-i18n",e),this.caption.textContent=r.Z.t(e),l&&(this.caption.style.display="none"),h.appendChild(this.caption),h=this.sliderRow.insertCell(1),this.sliderElement=c.createElement("input"),this.sliderElement.type="range",this.sliderElement.id=e+"_slider",this.sliderElement.min=t,this.sliderElement.max=i,this.sliderElement.style.width="85%",h.appendChild(this.sliderElement),h=this.sliderRow.insertCell(2),this.stepperElement=c.createElement("input"),this.stepperElement.type="number",this.stepperElement.id=e+"_stepper",this.stepperElement.min=t,this.stepperElement.max=i,this.stepperElement.step=1,this.stepperElement.style.width="64px",this.hideStepper&&(this.stepperElement.style.display="none"),h.appendChild(this.stepperElement),this.blockEvent=!1,this.stepperElement.addEventListener("change",(function(e){e.target!=s.sliderElement&&(s.sliderElement.value=s.stepperElement.value),s.fireChangeEvent()}),!1),this.sliderElement.addEventListener("change",u,!1),this.sliderElement.addEventListener("input",u,!1)}function c(e,t,i,n,s,l){var c=this;this.tbody=t;var h=l&&l.insertAtIndex?l.insertAtIndex:-1;this.sliderRow=this.tbody.insertRow(h),this.sliderRow.classList.add("switch-slider-row");var u=this.getDocument(),d=this.sliderRow.insertCell(0);this.caption=u.createElement("div"),this.caption.setAttribute("data-i18n",e),this.caption.textContent=r.Z.t(e),d.appendChild(this.caption),d=this.sliderRow.insertCell(1),n&&(this.description=u.createElement("div"),this.description.setAttribute("data-i18n",n),this.description.textContent=r.Z.t(n),d.appendChild(this.description),d=this.sliderRow.insertCell(2));var p=u.createElement("label");p.classList.add("switch"),this.checkElement=u.createElement("input"),this.checkElement.type="checkbox",this.checkElement.id=e+"_check",this.checkElement.checked=i,p.appendChild(this.checkElement);var f=u.createElement("div");f.classList.add("slider"),p.appendChild(f),d.appendChild(p),this.blockEvent=!1,this.checked=i,this.checkElement.addEventListener("change",(function(e){c.fireChangeEvent()}),!1),(0,o.isTouchDevice)()&&(this.sliderRowHammer=new a.Manager(this.sliderRow,{recognizers:[[a.Tap]],handlePointerEventMouse:!1,inputClass:o.isIE11?a.PointerEventInput:a.TouchInput}),this.sliderRowHammer.on("tap",(function(e){e.preventDefault(),e.target.click()}))),this.checkElement.addEventListener("click",(function(e){e.stopPropagation()}),!1),this.sliderRow.addEventListener("click",(function(e){c.checkElement.disabled||(c.checkElement.checked=!c.checkElement.checked,c.fireChangeEvent())}),!1)}function h(e,t,i,n){this.tbody=t;var o=n&&n.insertAtIndex?n.insertAtIndex:-1;this.sliderRow=this.tbody.insertRow(o);var s=this.getDocument(),a=this.sliderRow.insertCell(0);this.caption=s.createElement("div"),this.caption.setAttribute("data-i18n",e),this.caption.textContent=r.Z.t(e),a.appendChild(this.caption),a.colSpan="3",this.blockEvent=!1,this.removeFromParent=function(){this.tbody.removeChild(this.sliderRow),this.tbody=null,this.sliderRow=null,this.caption=null}}function u(e,t,i,n){this.tbody=t;var o=n&&n.insertAtIndex?n.insertAtIndex:-1;this.sliderRow=this.tbody.insertRow(o),this.sliderRow.insertCell();var s=this.sliderRow.insertCell();this.sliderRow.insertCell();var a=this.getDocument();this.caption=a.createElement("div"),this.caption.setAttribute("data-i18n",e),this.caption.textContent=r.Z.t(e),this.caption.classList.add("adsk-button"),this.caption.classList.add("table-button"),s.appendChild(this.caption),this.removeFromParent=function(){this.tbody.removeChild(this.sliderRow),this._onClick&&(this.caption.removeEventListener("click",this._onClick),this._onClick=null),this.tbody=null,this.sliderRow=null,this.caption=null},this.setOnClick=function(e){this._onClick=e,this.caption.addEventListener("click",e,!1)}}function d(e,t,i,n,o,s,a){var l=this;this.tbody=t;var c=a&&a.insertAtIndex?a.insertAtIndex:-1;this.sliderRow=this.tbody.insertRow(c);var h=this.getDocument();this.dropdownElement=h.createElement("select"),this.dropdownElement.id=e+"_dropdown",this.dropdownElement.classList.add("option-drop-down");for(var u=0;u<i.length;u++){var d=h.createElement("option");d.value=u,d.setAttribute("data-i18n",i[u]),d.textContent=r.Z.t(i[u]),this.dropdownElement.add(d)}this.selectedIndex=this.dropdownElement.selectedIndex=n;var p=this.sliderRow.insertCell(0);this.caption=h.createElement("div"),this.caption.setAttribute("data-i18n",e),this.caption.textContent=r.Z.t(e),p.appendChild(this.caption),o?(p.colSpan="2",this.sliderRow=this.tbody.insertRow(c),(p=this.sliderRow.insertCell(0)).appendChild(this.dropdownElement),p.colSpan="2",this.dropdownElement.classList.add("tabcell")):(p=this.sliderRow.insertCell(1)).appendChild(this.dropdownElement),p.style.paddingLeft=(a&&void 0!==a.paddingLeft?a.paddingLeft:5)+"px",p.style.paddingRight=(a&&void 0!==a.paddingRight?a.paddingRight:5)+"px",this.blockEvent=!1,this.dropdownElement.addEventListener("change",(function(e){l.fireChangeEvent()}),!1)}function p(e,t,i){this.resizeCallback=t;var n=this.getDocument(),r=n.createElement("div");r.classList.add("docking-panel-footer");var o=n.createElement("div");o.classList.add("docking-panel-footer-resizer"),r.appendChild(o);var s=!1,a=e.getBoundingClientRect(),l={x:0,y:0},c=n.createElement("div");c.classList.add("adsk-viewing-viewer"),c.classList.add("docking-panel-resize-overlay");var h=function(t){s=!0,a=e.getBoundingClientRect(),this.getDocument().body.appendChild(c),this.addDocumentEventListener("touchmove",d),this.addDocumentEventListener("touchcancel",u),this.addDocumentEventListener("touchend",u),this.addDocumentEventListener("mousemove",d),this.addDocumentEventListener("mouseup",u),t.preventDefault(),t.stopPropagation()};h=h.bind(this);var u=function(e){var t=this.getDocument();t.body.contains(c)&&(t.body.removeChild(c),this.removeDocumentEventListener("touchmove",d),this.removeDocumentEventListener("touchcancel",u),this.removeDocumentEventListener("touchend",u),this.removeDocumentEventListener("mousemove",d),this.removeDocumentEventListener("mouseup",u),e.preventDefault(),e.stopPropagation())};u=u.bind(this);var d=function(t){"touchmove"===t.type&&(t.canvasX=t.touches[0].screenX,t.canvasY=t.touches[0].screenY),s&&(s=!1,l.x=t.canvasX||t.clientX,l.y=t.canvasY||t.clientY);var i=(t.canvasX||t.clientX)-l.x,n=(t.canvasY||t.clientY)-l.y,r=parseInt(a.width+i),o=parseInt(a.height+n);e.style.width=r+"px",e.style.height=o+"px",this.resizeCallback&&this.resizeCallback(r,o),t.preventDefault(),t.stopPropagation()};d=d.bind(this),o.addEventListener("touchstart",h),o.addEventListener("mousedown",h),e.style.resize="none",e.appendChild(r),this.footer=r,this.resizer=o}function f(e,t,i,n,o){this.tbody=t;var s=o&&o.insertAtIndex?o.insertAtIndex:-1;this.sliderRow=this.tbody.insertRow(s),this.sliderRow.classList.add("switch-slider-row");var a=this.getDocument(),l=this.sliderRow.insertCell(0);this.caption=a.createElement("div"),this.caption.setAttribute("data-i18n",e),this.caption.textContent=r.Z.t(e),l.appendChild(this.caption),l=this.sliderRow.insertCell(1),i&&(this.description=a.createElement("div"),this.description.setAttribute("data-i18n",i),this.description.textContent=r.Z.t(i),l.appendChild(this.description),l=this.sliderRow.insertCell(2))}l.prototype.constructor=l,n.EventDispatcher.prototype.apply(l.prototype),l.prototype.fireChangeEvent=function(){if(!this.blockEvent){this.value=this.sliderElement.value;var e=new CustomEvent("change",{detail:{target:this,value:this.sliderElement.value}});this.dispatchEvent(e)}},l.prototype.setValue=function(e){this.blockEvent=!0,this.value=e,this.sliderElement.value=e,this.stepperElement.value=e,this.blockEvent=!1},l.prototype.setDisabled=function(e){this.sliderElement.disabled=e,this.stepperElement.disabled=e,this.caption.disabled=e},s.GlobalManagerMixin.call(l.prototype),c.prototype.constructor=c,n.EventDispatcher.prototype.apply(c.prototype),s.GlobalManagerMixin.call(c.prototype),c.prototype.fireChangeEvent=function(){if(!this.blockEvent){this.checked=this.checkElement.checked;var e=new CustomEvent("change",{detail:{target:this,value:this.checkElement.checked}});this.dispatchEvent(e)}},c.prototype.setChecked=function(e){this.checkElement.checked!=e&&(this.checkElement.checked=e,this.fireChangeEvent())},c.prototype.setValue=function(e){this.blockEvent=!0,this.checked=e,this.checkElement.checked=e,this.blockEvent=!1},c.prototype.getValue=function(){return this.checkElement.checked},c.prototype.setDisabled=function(e){this.checkElement.disabled=e,this.caption.disabled=e},c.prototype.setVisibility=function(e){this.sliderRow.style.display=e?"table-row":"none"},s.GlobalManagerMixin.call(h.prototype),s.GlobalManagerMixin.call(u.prototype),d.prototype.constructor=d,n.EventDispatcher.prototype.apply(d.prototype),d.prototype.setSelectedIndex=function(e){this.blockEvent=!0,this.selectedIndex=this.dropdownElement.selectedIndex=e,this.blockEvent=!1},d.prototype.setSelectedValue=function(e){this.blockEvent=!0,this.dropdownElement.selectedValue=e,this.selectedIndex=this.dropdownElement.selectedIndex,this.blockEvent=!1},d.prototype.fireChangeEvent=function(){if(!this.blockEvent){this.selectedIndex=this.dropdownElement.selectedIndex;var e=new CustomEvent("change",{detail:{target:this,value:this.selectedIndex}});this.dispatchEvent(e)}},d.prototype.setDisabled=function(e){this.dropdownElement.disabled=e,this.caption.disabled=e},s.GlobalManagerMixin.call(d.prototype),s.GlobalManagerMixin.call(p.prototype),s.GlobalManagerMixin.call(f.prototype);class m{constructor(e,t,i){this._parentDiv=e,this._renderRowFn=t,this._onClickFn=i,this._onRowClick=this._onRowClick.bind(this);const n=this.getDocument(),r=n.createElement("div");r.classList.add("settings-container"),this._parentDiv.appendChild(r),this._myContainer=r,this._myContainer.addEventListener("click",this._onRowClick,{capture:!0});const o=n.createElement("div");o.classList.add("settings-table"),this._rowsContainer=o,r.appendChild(o)}setData(e,t){this._removeAllRows(),this._items=e;for(let t=0;t<e.length;++t)this._addRow(t);this._updateSelection(t)}removeFromParent(){this._myContainer.removeEventListener("click",this._onRowClick,{capture:!0}),this._removeAllRows(),this._parentDiv.removeChild(this._myContainer),this._parentDiv=null,this._myContainer=null,this._rowsContainer=null,this._onClickFn=null,this._items=null}_addRow(e){const t=this._items[e],i=this.getDocument(),n=i.createElement("div");this._renderRowFn(n,t,{domDocument:i}),n.setAttribute("data-index",e),this._rowsContainer.appendChild(n)}_removeAllRows(){for(var e=this._rowsContainer.children;e.length;)this._rowsContainer.removeChild(e[0])}_updateSelection(e){const t=this._rowsContainer.children;for(let i=0;i<t.length;i++){const n=t[i];i===e?n.classList.add("border-select"):n.classList.remove("border-select")}}_onRowClick(e){for(var t,i=e.target;i!==this._myContainer&&!(t=i.getAttribute("data-index"));)i=i.parentNode;if(t){var n=parseInt(t);this._onClickFn(n)}}}s.GlobalManagerMixin.call(m.prototype)},18008:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ContextMenu:()=>l});var n=i(16840),r=i(49720),o=i(71224),s=i(27293),a=i(21553);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.viewer=e,this.setGlobalManager(e.globalManager),this.menus=[],this.container=null,this.open=!1,this._onDOMevent=this._onDOMevent.bind(this),this.onHide=t.onHide}l.prototype.constructor=l,s.GlobalManagerMixin.call(l.prototype),l.prototype.show=function(e,t){var i=this.viewer.container.getBoundingClientRect();Array.isArray(e.changedPointers)&&e.changedPointers.length>0&&(e.clientX=e.changedPointers[0].clientX,e.clientY=e.changedPointers[0].clientY);var n=e.clientX-i.left,r=e.clientY-i.top;this.open||(this.showMenu(t,n,r),this.open=!0),this._startX=e.clientX,this._startY=e.clientY},l.prototype.showMenu=function(e,t,i,o){var s,a=[],l=this.getDocument(),c=l.createElement("div");c.style.left="0",c.style.top="0",c.style.width="100%",c.style.height="100%",c.style.position="absolute",c.style.zIndex="10";var h=l.createElement("div");h.classList.add("menu"),h.classList.add("docking-panel"),h.classList.add("docking-panel-container-solid-color-a"),c.appendChild(h),this.viewer.container.appendChild(c),this.container=c,this.menus.push(h);let u=!1;for(var d=0;d<e.length;++d){var p=e[d],f=p.title,m=p.target,g=p.icon,v=p.shortcut,y=p.divider;let t=Array.isArray(m);t&&!e.isChild?u=!0:t=!1,y?(s=this.createDivider(),h.appendChild(s)):(s=this.createMenuItem(f,g,v,t),h.appendChild(s),"function"==typeof m?this.addCallbackToMenuItem(s,m):t?a.push({menuItem:s,target:m}):r.logger.warn("Invalid context menu option:",f,m))}if(!u){const e=h.children;for(let t=0;t<e.length;t++){const i=e[t],n=i.getElementsByClassName("menu-item-expand");n.length>0&&i.removeChild(n[0])}}var b=h.getBoundingClientRect(),x=b.width,_=b.height,E=this.viewer.container.getBoundingClientRect(),A=E.width,S=E.height;(o=!!o||(0,n.isTouchDevice)()&&!this.viewer.navigation.getUseLeftHandedInput())&&(t-=x),t<0&&(t=0),A<t+x&&(t=A-x)<0&&(t=0),i<0&&(i=0),S<i+_&&(i=S-_)<0&&(i=0),h.style.top=Math.round(i)+"px",h.style.left=Math.round(t)+"px";const w=(e,t)=>{const i=e.getElementsByClassName("menu-item-expand");e.removeChild(i[0]);const n=e.getElementsByClassName("menu-item-icon");n.length>0&&e.insertBefore(n[0],e.childNodes[e.length-1]),this.setMenuExpand(e,!0,t)};let M=!1;for(d=0;d<a.length;++d){var T=a[d];const e=(s=T.menuItem).getBoundingClientRect(),n=this.viewer.container.getBoundingClientRect(),r=e.right-e.left;M=n.right-e.right<r||o,M&&w(s,!0),t=Math.round((M?e.left:e.right)-n.left),i=Math.round(e.top-n.top),this.addSubmenuCallbackToMenuItem(s,T.target,t,i,M)}if(a.length>0&&M){const e=h.children;for(let t=0;t<e.length;t++){const i=e[t];i.children.length>2&&-1!==i.children[2].className.indexOf("menu-item-expand")&&w(i,!1)}}this.container.addEventListener("touchend",this._onDOMevent),this.container.addEventListener("mousedown",this._onDOMevent),this.container.addEventListener("mouseup",this._onDOMevent),(0,n.isTouchDevice)()||this.container.addEventListener("mousemove",this._onDOMevent)},l.prototype._onDOMevent=function(e){switch(e.type){case"touchend":this._isContextMenu(e)||this.hide();break;case"mousedown":this._startX=e.clientX,this._startY=e.clientY;break;case"mouseup":this._isContextMenu(e)||(this.hide(),a.EventUtils.isRightClick(e)&&e.clientX===this._startX&&e.clientY===this._startY&&this.viewer.triggerContextMenu(e));break;case"mousemove":{if(!this.currentItem||this.menus.length<2)break;const t=this._isInside(e,this.currentItem),i=this._isInside(e,this.menus[1]);t||i?this.currentItem.backgroundColor&&(this.currentItem.style.backgroundColor=this.currentItem.backgroundColor):(this.hideMenu(this.menus[1]),this.currentItem.style.backgroundColor=null,this.currentItem=null);break}}},l.prototype.createMenuItem=function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var r=this.getDocument(),o=r.createElement("div");return o.className="menu-item",i=i||"",this.setMenuItemIcon(o,t),this.setMenuItemText(o,e),this.setMenuExpand(o,!1,n),this.setMenuItemShortcut(o,i),o},l.prototype.createDivider=function(){var e=this.getDocument(),t=e.createElement("div");t.className="menu-divider-container";var i=e.createElement("div");return i.className="menu-divider",t.appendChild(i),t},l.prototype.setMenuItemIcon=function(e,t){var i=this.getDocument().createElement("div");i.classList.add("menu-item-icon"),t&&i.classList.add(t),e.appendChild(i)},l.prototype.setMenuItemText=function(e,t){var i=this.getDocument().createElement("div");i.classList.add("menu-item-text"),i.setAttribute("data-i18n",t),i.textContent=o.Z.t(t),e.appendChild(i)},l.prototype.setMenuItemShortcut=function(e,t){var i=this.getDocument().createElement("div");i.classList.add("menu-item-shortcut"),i.textContent=t,e.appendChild(i)},l.prototype.setMenuExpand=function(e,t,i){var n=this.getDocument().createElement("div");n.classList.add("menu-item-expand"),t?(n.style.transform="scale(-1)",e.insertBefore(n,e.childNodes[0])):e.appendChild(n);const r=0|i;n.style.opacity=r},l.prototype.addCallbackToMenuItem=function(e,t){var i=this;e.addEventListener("click",(function(e){return i.hide(),t(),e.preventDefault(),!1}),!1)},l.prototype.addSubmenuCallbackToMenuItem=function(e,t,i,r,o){var s=this;t.isChild=!0,(0,n.isTouchDevice)()?e.addEventListener("click",(function(){s.open=!0,s.currentItem=e,s.showMenu(t,i,r,o)}),!1):e.addEventListener("mouseenter",(function(){if(s._isInside(event,e)){s.open=!0,s.currentItem=e;const n=s.getWindow().getComputedStyle(s.currentItem).getPropertyValue("background-color");s.currentItem.backgroundColor=n,s.showMenu(t,i,r,o)}}),!1)},l.prototype.hideMenu=function(e){const t=e=>{e.removeEventListener("touchend",this._onDOMevent),e.removeEventListener("mousedown",this._onDOMevent),e.removeEventListener("mouseup",this._onDOMevent),(0,n.isTouchDevice)()||e.removeEventListener("mousemove",this._onDOMevent),e.parentNode.removeChild(e)};e&&-1!==this.menus.indexOf(e)&&e.parentNode&&(t(e.parentNode),this.menus.splice(this.menus.indexOf(e),1)),0===this.menus.length?(this.open=!1,this.container=null):1===this.menus.length&&(this.container=this.menus[0].parentNode)},l.prototype.hide=function(){if(this.open){for(;this.menus.length>0;)this.hideMenu(this.menus[0]);return this.onHide&&this.onHide(),!0}return!1},l.prototype._isContextMenu=function(e){for(let i=0;i<this.menus.length;i++){const n=this.menus[i];for(var t=e.target;t!==this.container;){if(t===n)return!0;t=t.parentNode}}return!1},l.prototype._isInside=function(e,t){var i=this.viewer.container.getBoundingClientRect();Array.isArray(e.changedPointers)&&e.changedPointers.length>0&&(e.clientX=e.changedPointers[0].clientX,e.clientY=e.changedPointers[0].clientY);var n=Math.ceil(e.clientX-i.left),r=Math.ceil(e.clientY-i.top);const o=t.getBoundingClientRect(),s=Math.floor(o.top-i.top),a=Math.ceil(o.bottom-i.top),l=Math.floor(o.left-i.left),c=Math.ceil(o.right-i.left);return r>=s&&r<=a&&n>=l&&n<=c}},160:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DataTable:()=>o});var n=i(52072);const r=Autodesk.Viewing.UI;function o(e){if(!(e instanceof r.DockingPanel))throw new Error("Invalid docking panel");this.dockingPanel=e;let t=this.dockingPanel.getDocument();this.datatableDiv=t.createElement("div"),this.datatableDiv.setAttribute("id","datatable"),this.datatableDiv.setAttribute("class","datatable"),e.container.appendChild(this.datatableDiv),e.footerInstance&&(e.footerInstance.resizeCallback=this._fitHeaderColumns.bind(this)),this.groupedByColumn=!1,this.aggregated=!1}o.prototype._createColumns=function(e){let t=this.dockingPanel.getDocument();var i=t.createElement("div");i.setAttribute("id","columnArea"),i.setAttribute("class","clusterize-headers");var n='<table id="headersArea"><thead><tr id ="columnRow"></tr></thead></table>';i.innerHTML=n,this.datatableDiv.appendChild(i);var r=i.querySelector("tr");e.forEach((function(e){var i=t.createElement("th");i.appendChild(t.createTextNode(e)),r.appendChild(i)})),n=this.datatableDiv.querySelector("table"),this._makeTableSortable(n)},o.prototype._createRows=function(){var e=this.dockingPanel.getDocument().createElement("div");e.innerHTML='<div id="scrollArea" class="clusterize-scroll"><table id="bodyArea" class="table-striped"><tbody id="contentArea" class="clusterize-content"><tr class="clusterize-no-data"><td>Loading data…</td></tr></tbody></table></div>',this.datatableDiv.appendChild(e)},o.prototype.setData=function(e,t){if(t.length!==e[0].length)throw new Error("Column length should be same as the row length");this._createColumns(t),this._createRows();var i=this;this.rowData=e,this.clusterize=new n({rows:this.rowData.map((function(e){return"<tr>"+e.map((function(e){return"<td>"+e+"</td>"})).join(" ")+"</tr>"})),scrollId:"scrollArea",contentId:"contentArea",callbacks:{clusterChanged:function(){i._fitHeaderColumns(),i._syncHeaderWidth(),i.groupedByColumn&&i._updateClusterGroup()}}}),this.datatableDiv.querySelector(".clusterize-scroll").addEventListener("scroll",(function(){var e=this.scrollLeft;r(e)}));var r=function(e){i.datatableDiv.querySelector("#headersArea").style.setProperty("margin-left",-e+"px")}},o.prototype.destroyTable=function(){this.clusterize.destroy(!0),this.clusterize=null,this.rowData=null,this.groupedByColumn=!1},o.prototype._makeTableSortable=function(e){var t,i=this,n=e.tHead;if(n&&n.rows[0]&&(n=n.rows[0].cells),n)for(t=n.length;--t>=0;)!function(e){var t=1;n[e].addEventListener("click",(function(){i._sortTable(e,t=1-t)}))}(t)},o.prototype._sortTable=function(e,t){var i=this.rowData;this.sortFunction||this.restoreDefaultSortFunction();var n=this.sortFunction&&this.sortFunction.bind(this),r=(i=i.sort(n(e,t))).map((function(e){return"<tr>"+e.map((function(e){return"<td>"+e+"</td>"})).join(" ")+"</tr>"}));this.clusterize.update(r);var o=this.datatableDiv.querySelector("#bodyArea");o.classList.contains("table-striped")||o.classList.add("table-striped")},o.prototype.setSortFunction=function(e){this.sortFunction=e},o.prototype.getSortFunction=function(){return this.sortFunction},o.prototype.restoreDefaultSortFunction=function(){this.sortFunction=function(e,t){return t=-(+t||-1),function(i,n){return t*i[e].localeCompare(n[e])}}},o.prototype.getGroupByColumn=function(e){var t=this.rowData,i={};for(let r=0;r<t.length;r++){var n=t[r][e];i[n]||(i[n]=[]),i[n].push(r)}return i},o.prototype.groupByColumn=function(e){var t=this.rowData,i={};for(let r=0;r<t.length;r++){let o=t[r];var n=o[e];if(i[n]||(i[n]=[]),i[n].length>0)o="<tr class= 'subrow'>"+o.map((function(e){return"<td>"+e+"</td>"})).join(" ")+"</tr>";else{const e=o.length;o="<tr class= 'parentrow'>"+o.map((function(t,i){return e===i+1?"<td>"+t+'<span value="click"></span></td>':"<td>"+t+"</td>"})).join(" ")+"</tr>"}i[n].push(o)}var r=[];for(let e in i){var o=i[e];for(let e=0;e<o.length;e++){let t=o[e];r.push(t)}}this.clusterize.update(r);var s=this.datatableDiv.querySelector("#bodyArea");s.classList.contains("table-striped")&&s.classList.remove("table-striped"),this.datatableDiv.querySelectorAll(".subrow").forEach((e=>{this._slideDown(e),e.style.fontSize="14px"}));var a=this._fitHeaderColumns.bind(this),l=this._expandContent.bind(this);this.datatableDiv.querySelectorAll("span").forEach((e=>{e.addEventListener("click",(function(e){l(this,e),a()}))})),this._fitHeaderColumns(),this.groupedByColumn||(this.groupedByColumn=!0)},o.prototype._updateClusterGroup=function(){var e=this._fitHeaderColumns.bind(this),t=this._expandContent.bind(this);this.datatableDiv.querySelectorAll("span").forEach((i=>{i.addEventListener("click",(function(i){t(this,i),e()}))})),this.datatableDiv.querySelectorAll(".subrow").forEach((e=>{this._slideDown(e),e.style.fontSize="14px"}))},o.prototype._expandContent=function(e){var t=!1;"collapsed"===e.className&&(t=!0);var i=t?14:0,n=e.closest("tr"),r=this._nextUntil(n,":not(.subrow)");for(let e=0;e<r.length;e++)this._slideToggle(r[e],500),r[e].style.fontSize=i+"px";e.classList.toggle("collapsed")},o.prototype._nextUntil=function(e,t,i){var n=[];for(e=e.nextElementSibling;e&&!e.matches(t);)!i||e.matches(i)?(n.push(e),e=e.nextElementSibling):e=e.nextElementSibling;return n},o.prototype._slideToggle=function(e,t){return"none"===this.dockingPanel.getWindow().getComputedStyle(e).display?this._slideDown(e,t):this._slideUp(e,t)},o.prototype._slideUp=function(e,t){e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.boxSizing="border-box",e.style.height=e.offsetHeight+"px",e.offsetHeight,e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0,e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")},o.prototype._slideDown=function(e,t){let i=this.dockingPanel.getWindow();e.style.removeProperty("display");let n=i.getComputedStyle(e).display;"none"===n&&(n="block"),e.style.display=n;e.style.overflow="hidden",e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0,e.style.marginTop=0,e.style.marginBottom=0,e.offsetHeight,e.style.boxSizing="border-box",e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.height="21pxpx",e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),i.setTimeout((()=>{e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")}),t)},o.prototype.getAggregate=function(e,t){var i,n=this.rowData,r=null;switch(e){case"MIN":r=function(){var e=n[0][t];for(let i=1;i<n.length;i++)e>n[i][t]&&(e=n[i][t]);return e||0}();break;case"MAX":r=function(){var e=n[0][t];for(let i=1;i<n.length;i++)e<n[i][t]&&(e=n[i][t]);return e||0}();break;case"SUM":r=o();break;case"AVG":i=o()/n.length,r=(i=parseFloat(i))||0;break;case"COUNT":r=n.length}return r;function o(){var e=0;for(let i=0;i<n.length;i++)e+=parseFloat(n[i][t]);return e||0}},o.prototype.aggregate=function(e,t){var i=this.datatableDiv.querySelector(".clusterize-content").querySelector("tr:not(.clusterize-extra-row):not(.first)");if(!i)return;for(var n=[],r=0;r<i.children.length;r++)n.push(i.children[r].clientWidth);var o=this.getAggregate(e,t);let s=this.dockingPanel.getDocument();if(!this.aggregated){var a=s.createElement("div");a.setAttribute("id","aggregate"),a.setAttribute("class","aggregate-headers");a.innerHTML='<table id="aggregateArea"><tbody></tbody></table>',this.datatableDiv.appendChild(a)}for(var l=this.datatableDiv.querySelector("#aggregateArea"),c=0;c<l.rows.length;c++){if(l.rows[c].cells[t].innerText.indexOf(e)>-1)return}for(var h=0;h<l.rows.length;h++){var u=l.rows[h].cells[t];if(0===u.innerText.length)return u.appendChild(s.createTextNode(e+": ")),void u.appendChild(s.createTextNode(o))}for(var d=l.insertRow(l.rows.length),p=0;p<n.length;p++){var f=s.createElement("td");d.appendChild(f),f.style.setProperty("min-width",n[p]+"px","important"),p===t&&(f.appendChild(s.createTextNode(e+": ")),f.appendChild(s.createTextNode(o)))}this.aggregated=!0},o.prototype.clearAggregates=function(){for(var e=this.datatableDiv.querySelectorAll(".aggregate-headers"),t=0;t<e.length;t++)e[t].parentNode.removeChild(e[t])},o.prototype._fitHeaderColumns=function(){var e=this.datatableDiv.querySelector(".clusterize-content"),t=this.datatableDiv.querySelector("#headersArea"),i=e.querySelector("tr:not(.clusterize-extra-row):not(.first)");if(i){for(var n=[],r=[],o=0;o<i.children.length;o++)r.push(i.children[o].clientWidth);if(r.toString()!=n.toString()){for(var s=t.querySelector("tr"),a=0;a<s.children.length;a++)s.children[a].style.setProperty("clientWidth",r[a]+"px","important"),s.children[a].style.setProperty("min-width",r[a]+"px","important");if(this.aggregated)for(var l=this.datatableDiv.querySelector("#aggregateArea"),c=0;c<l.rows.length;c++)for(var h=l.rows[c],u=0;u<h.children.length;u++)h.children[u].style.setProperty("clientWidth",r[u]+"px","important"),h.children[u].style.setProperty("min-width",r[u]+"px","important");n=r}}},o.prototype._syncHeaderWidth=function(){var e=this.datatableDiv.querySelector(".clusterize-content"),t=this.datatableDiv.querySelector("#headersArea");t.style.setProperty("clientWidth",e.width),t.style.setProperty("min-idth",e.width)}},94577:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DockingPanel:()=>o});var n=i(71224),r=i(79976);function o(e,t,i,n){this.kMinWdth=100,this.kMinHeight=100,this.visibilityCallbacks=[],this.movedSinceLastClick=!1,this.movedSinceCreate=!1,this.parentContainer=e;var r=this.getDocument();this.container=r.createElement("div"),this.container.id=t,this.container.lastWidth="",this.container.dockRight=!1,this.container.dockBottom=!1,this.titleLabel=i,n=n||{},Object.prototype.hasOwnProperty.call(n,"localizeTitle")||(n.localizeTitle=!0),Object.prototype.hasOwnProperty.call(n,"addFooter")||(n.addFooter=!0),this.options=n,this.container.classList.add("docking-panel"),e.appendChild(this.container),this.listeners=[],this.initialize(),this.setVisible(!1)}i(27293).GlobalManagerMixin.call(o.prototype),o.prototype.onSetGlobalManager=function(e){this.footerInstance&&this.footerInstance.setGlobalManager(e)},o.prototype.initialize=function(){this.title=this.createTitleBar(this.titleLabel||this.container.id),this.container.appendChild(this.title),this.initializeMoveHandlers(this.title),this.setTitle(this.titleLabel||this.container.id,this.options),this.closer=this.createCloseButton(),this.container.appendChild(this.closer),this.options.addFooter&&(this.footer=this.createFooter(),this.container.appendChild(this.footer))},o.prototype.uninitialize=function(){for(var e=0;e<this.listeners.length;++e){var t=this.listeners[e];t.target.removeEventListener(t.eventId,t.callback)}this.listeners=[],this.visibilityCallbacks=[],this.parentContainer.removeChild(this.container),this.parentContainer=null,this.container=null,this.title=null,this.closer=null},o.prototype.addVisibilityListener=function(e){this.visibilityCallbacks.push(e)},o.prototype.setVisible=function(e){if(e){var t=this.getContainerBoundingRect();if(this.container.dockRight){var i=t.width,n=300,r=this.container.lastWidth||this.container.style.width;r||(r=this.container.getBoundingClientRect().width),r&&(n=parseInt(r)),this.container.style.left=i-n+"px"}if(this.container.dockBottom){var o=t.height,s=300,a=this.container.lastHeight||this.container.style.height;a||(a=this.container.getBoundingClientRect().height),a&&(s=parseInt(a));var l=o-s;this.container.style.top=l>0?l+"px":0}this.container.style.maxHeight=t.height+"px",this.container.style.maxWidth=t.width+"px",this.container.style.display="block",this.bringToFront()}else this.container.lastWidth=this.container.style.width,this.container.lastHeight=this.container.style.height,this.container.style.display="none";for(var c=0;c<this.visibilityCallbacks.length;c++)this.visibilityCallbacks[c](e)},o.prototype.isVisible=function(){return"block"===this.container.style.display},o.prototype.visibilityChanged=function(){},o.prototype.initializeMoveHandlers=function(e){var t,i,n,r,o,s,a,l,c=this.container,h=this;function u(e){var u=c.style.minWidth?parseInt(c.style.minWidth):h.kMinWdth,d=c.style.minHeight?parseInt(c.style.minHeight):h.kMinHeight,p=h.getContainerBoundingRect();c.style.maxWidth&&parseInt(c.style.width)>parseInt(c.style.maxWidth)&&(c.style.width=c.style.maxWidth),c.style.maxHeight&&parseInt(c.style.height)>parseInt(c.style.maxHeight)&&(c.style.height=c.style.maxHeight),parseInt(c.style.width)<u&&(c.style.width=u+"px"),parseInt(c.style.height)<d&&(c.style.height=d+"px"),"touchmove"===e.type&&(e.screenX=e.touches[0].screenX,e.screenY=e.touches[0].screenY),a+=e.screenX-n,l+=e.screenY-r,t=o+a,i=s+l;var f=parseInt(c.style.width),m=parseInt(c.style.height);isNaN(f)&&(f=h.container.getBoundingClientRect().width),isNaN(m)&&(m=h.container.getBoundingClientRect().height),t<5&&(t=0),i<5&&(i=0),c.dockRight=!1,c.dockBottom=!1,p.width-5<t+f&&(t=p.width-f,c.dockRight=!0),p.height-5<i+m&&(i=p.height-m,c.dockBottom=!0),c.style.left=t+"px",c.style.top=i+"px",c.style.maxWidth=p.width-t+"px",c.style.maxHeight=p.height-i+"px",n=e.screenX,r=e.screenY,h.onMove(e,t,i)}function d(e){h.removeWindowEventListener("mousemove",u),h.removeWindowEventListener("mouseup",d),h.removeWindowEventListener("touchmove",u),h.removeWindowEventListener("touchend",d),h.onEndMove(e,t,i)}function p(e){"touchstart"===e.type&&(e.screenX=e.touches[0].screenX,e.screenY=e.touches[0].screenY),n=e.screenX,r=e.screenY,a=0,l=0,o=h.container.offsetLeft,s=h.container.offsetTop,h.addWindowEventListener("mousemove",u,!1),h.addWindowEventListener("mouseup",d,!1),h.addWindowEventListener("touchmove",u,!1),h.addWindowEventListener("touchend",d,!1),e.preventDefault(),h.onStartMove(e,o,s)}h.addEventListener(e,"mousedown",p),h.addEventListener(e,"touchstart",p)},o.prototype.initializeCloseHandler=function(e){var t=this;t.addEventListener(e,"click",(function(){t.setVisible(!1)}),!1)},o.prototype.createScrollContainer=function(e){var t=this.getDocument().createElement("div"),i=t.classList;return i.add("docking-panel-scroll"),i.add("docking-panel-container-solid-color-a"),i.add(e&&e.left?"left":"right"),e&&e.heightAdjustment&&(t.style.height="calc(100% - "+e.heightAdjustment+"px)"),e&&e.marginTop&&(t.style.marginTop=e.marginTop+"px"),t.id=this.container.id+"-scroll-container",this.container.appendChild(t),this.scrollContainer=t,this.scrollEaseCurve=e&&e.scrollEaseCurve||[0,0,.29,1],this.scrollEaseSpeed=e&&e.scrollEaseSpeed||.003,t},o.prototype.createTitleBar=function(e){var t=this.getDocument().createElement("div");t.classList.add("docking-panel-title"),t.textContent=e;var i=this;return i.addEventListener(t,"click",(function(e){i.movedSinceLastClick||i.onTitleClick(e),i.movedSinceLastClick=!1})),i.addEventListener(t,"mousedown",(function(){i.bringToFront()})),i.addEventListener(t,"dblclick",(function(e){i.onTitleDoubleClick(e)})),t},o.prototype.createFooter=function(){var e=new r.ResizeFooter(this.container);return e.setGlobalManager(this.globalManager),this.footerInstance=e,this.container.style.resize="none",e.footer},o.prototype.setTitle=function(e,t){t&&t.localizeTitle?(this.title.setAttribute("data-i18n",e),e=n.Z.t(e,t.i18nOpts)):this.title.removeAttribute("data-i18n"),this.title.textContent=e},o.prototype.createCloseButton=function(){var e=this.getDocument().createElement("div");return e.className="docking-panel-close",this.initializeCloseHandler(e),e},o.prototype.onStartMove=function(){},o.prototype.onEndMove=function(){},o.prototype.onMove=function(){this.movedSinceLastClick=!0,this.movedSinceCreate=!0},o.prototype.onTitleClick=function(){},o.prototype.onTitleDoubleClick=function(){},o.prototype.addEventListener=function(e,t,i){e.addEventListener(t,i),this.listeners.push({target:e,eventId:t,callback:i})},o.prototype.removeEventListener=function(e,t,i){for(var n=0;n<this.listeners.length;++n){var r=this.listeners[n];if(r.target===e&&r.eventId===t&&r.callback===i)return e.removeEventListener(t,i),this.listeners.splice(n,1),!0}return!1},o.prototype.getContentSize=function(){return{height:this.container.clientHeight,width:this.container.clientWidth}},o.prototype.resizeToContent=function(e){if(this.isVisible()){var t=this.getContentSize().height,i=this.container.getBoundingClientRect(),n=this.getContainerBoundingRect(),r=this.container.querySelector(".docking-panel-footer");r&&(t+=r.getBoundingClientRect().height);var o=n.height;o-=i.top-n.top+75,e&&void 0!==e.maxHeight&&(o=Math.min(o,e.maxHeight)),t>o&&(t=o),this.container.style.maxHeight=o.toString()+"px",this.container.style.height=t.toString()+"px"}},o.prototype.getContainerBoundingRect=function(){return this.parentContainer.getBoundingClientRect()},o.prototype.animateScroll=function(e,t,i){var n=this.scrollEaseCurve,r=this.scrollEaseSpeed,o=this.scrollContainer;var s=performance.now();requestAnimationFrame((function a(l){var c=(l-s)*r;c=Math.min(c,1);var h=function(e,t){var i=3*e[1],n=3*(e[3]-e[1])-i;return(((1-i-n)*t+n)*t+i)*t}(n,c),u=e+(t-e)*h;o.scrollTop=u,i&&i(u),c<1&&requestAnimationFrame(a)}))},o.prototype.onViewerResize=function(e,t,i,n,r,o){var s=this.container,a=s.getBoundingClientRect(),l=a.width,c=a.height;if(!l||!c)return!1;var h=a.top,u=a.bottom,d=a.left,p=a.right;return r<l&&(l=Math.round(r),s.style.width=l+"px"),o<c&&(c=Math.round(o),s.style.height=c+"px"),(n<p||s.dockRight)&&(d=Math.round(n-l-i),s.style.left=d+"px"),(t<u||s.dockBottom)&&((h=Math.round(t-c-e))<0&&(h=0),s.style.top=h+"px"),s.style.maxWidth=Math.round(r)+"px",s.style.maxHeight=Math.round(o)+"px",!0},o.prototype.bringToFront=function(){var e=this.scrollContainer?this.scrollContainer.scrollTop:0;this.parentContainer.appendChild(this.container),this.scrollContainer&&(this.scrollContainer.scrollTop=e)}},52671:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ErrorHandler:()=>l});var n=i(22343),r=i(49720),o=i(71224),s=i(53005),a={1:{img:"img-reload","globalized-msg":"Viewer-UnknownFailure","default-msg":"<title> Sorry </title><message>We seem to have some technical difficulties and couldn't complete your request.</message><hint>Try loading the item again. </hint><hint>Please verify your Internet connection, and refresh the browser to see if that fixes the problem.</hint>"},2:{img:"img-unsupported","globalized-msg":"Viewer-BadData","default-msg":"<title> Sorry </title><message>The item you are trying to view was not processed completely. </message><hint>Try loading the item again.</hint><hint>Please upload the file again to see if that fixes the issue.</hint>"},3:{img:"img-reload","globalized-msg":"Viewer-NetworkError","default-msg":"<title> Sorry </title><message>We seem to have some technical difficulties and couldn't complete your request.</message><hint> Try loading the item again.</hint><hint> Please verify your Internet connection, and refresh the browser to see if that fixes the problem.</hint>"},4:{img:"img-unlock","globalized-msg":"Viewer-AccessDenied","default-msg":"<title> No access </title><message>Sorry. You don’t have the required privileges to access this item.</message><hint> Please contact the author</hint>"},5:{img:"img-item-not-found","globalized-msg":"Viewer-FileNotFound","default-msg":'<title> Sorry </title><message>We can’t display the item you are looking for. It may not have been processed yet. It may have been moved, deleted, or you may be using a corrupt file or unsupported file format.</message><hint> Try loading the item again.</hint><hint> Please upload the file again to see if that fixes the issue.</hint><hint> <a href="http://help.autodesk.com/view/ADSK360/ENU/?guid=GUID-488804D0-B0B0-4413-8741-4F5EE0FACC4A" target="_blank">See a list of supported formats.</a></hint>'},6:{img:"img-reload","globalized-msg":"Viewer-ServerError","default-msg":"<title> Sorry </title><message>We seem to have some technical difficulties and couldn't complete your request.</message><hint> Try loading the item again.</hint><hint> Please verify your Internet connection, and refresh the browser to see if that fixes the problem.</hint>"},7:{img:"img-reload","globalized-msg":"Viewer-UnhandledResponseCode","default-msg":"<title> Network problem </title><message>Sorry. We seem to have some technical difficulties and couldn't complete your request.</message><hint> Try loading the item again.</hint><hint> Please verify your Internet connection, and refresh the browser to see if that fixes the problem.</hint>"},8:{img:"img-unsupported","globalized-msg":"Viewer-WebGlNotSupported","default-msg":'<title>Sorry</title><message>We can\'t show this item because this browser doesn\'t support WebGL.</message><hint>Try Google Chrome, Mozilla Firefox, or another browser that supports WebGL 3D graphics.</hint><hint>For more information, see the <a href="WEBGL_HELP" target="_blank">A360 browser reqirements.</a></hint>'},9:{img:"img-item-not-found","globalized-msg":"Viewer-NoViewable","default-msg":"<title> No viewable content </title><message>There’s nothing to display for this item. It may not have been processed or it may not have content we can display.</message><hint> Please contact the author.</hint><hint> Please upload the file again to see if that fixes the issue.</hint>"},10:{img:"img-unsupported","globalized-msg":"Viewer-WebGlDisabled","default-msg":'<title>Sorry</title><message>We can\'t show this item because WebGL is disabled on this device.</message><hint> For more information see the <a href="WEBGL_HELP" target="_blank">A360 Help.</a></hint>'},11:{img:"img-item-not-found","globalized-msg":"Viewer-ModeIsEmpty","default-msg":"<title>Model is empty</title><message>Model is empty, there is no geometry for the viewer to show.</message><hint> Please contact the author.</hint><hint> Please upload the file again to see if that fixes the issue.</hint>"},12:{img:"img-unsupported","globalized-msg":"Viewer-RTCError","default-msg":"<title> Sorry </title><message>We couldn’t connect to the Collaboration server.</message><hint> Please verify your Internet connection, and refresh the browser to see if that fixes the problem.</hint>"},13:{img:"img-unsupported","globalized-msg":"Viewer-FileExtNotSupported","default-msg":{title:"Sorry",message:"The file extension loaded into the Viewer is not supported",hints:["Try a different file"]}},15:{img:"img-unsupported","globalized-msg":"Viewer-WebGlContextLost","default-msg":{title:"WebGL context lost",message:"Unable to recover from software mode. Please restart your browser and reload the Viewer",hints:["If you continue to encounter this issue when viewing this model, we recommend switching to a different browser."]}}};function l(){}l.prototype.constructor=l,l.reportError=function(e,t,i,c,h,u){if(l.currentError=null,l.currentErrors=null,t){var d={category:"error",code:t,message:i,httpStatusCode:c,httpStatusText:h};r.logger.track(d,!0),l.currentError=[e,t,i,u];var p=a[t];if(p){(b={defaultValue:""}).defaultValue=p["default-msg"];var f=p.img,m=p["globalized-msg"],g=this.parseErrorString(m,b);if(t===Autodesk.Viewing.ErrorCodes.BROWSER_WEBGL_DISABLED||t===Autodesk.Viewing.ErrorCodes.BROWSER_WEBGL_NOT_SUPPORTED)for(var v=(0,s.getWebGLHelpLink)()||"http://www.autodesk.com/a360-browsers",y=0;y<g.hints.length;y++){-1!==g.hints[y].indexOf('href="WEBGL_HELP"')&&(g.hints[y]=g.hints[y].replace('href="WEBGL_HELP"','href="'+v+'"'))}n.AlertBox.displayError(e,g.msg,g.header,f,g.hints)}else{f="img-unsupported";var b={defaultValue:"",interpolationPrefix:"{",interpolationSuffix:"}"};this.parseArguments(i,b),(g=this.parseErrorString(t,b)).header||(g.header="warning"===u?o.Z.t("header-warning"):""),n.AlertBox.displayError(e,g.msg,g.header,f,g.hints,t)}}},l.reportErrors=function(e,t){if(l.currentError=null,l.currentErrors=null,t){l.currentErrors=[e,t];for(var i={defaultValue:"",interpolationPrefix:"{",interpolationSuffix:"}"},s=[],a=0;a<t.length;a++)if(t[a].code){this.parseArguments(t[a].message,i);var c=this.parseErrorString(t[a].code,i);c.header||(c.header="warning"===t[0].type?o.Z.t("header-warning",{defaultValue:"Warning"}):""),s.push(c);var h={category:"error",code:t[a].code,message:t[a].message};r.logger.track(h,!0)}if(s.length){n.AlertBox.displayErrors(e,"img-unsupported",s)}}},l.parseArguments=function(e,t){if(e)if("string"==typeof e)t.defaultValue=e;else{t.defaultValue=e[0];for(var i=1;i<e.length;i++){t[(i-1).toString()]=e[i]}}},l.parseErrorString=function(e,t){var i={msg:null,msgList:null,header:null,hints:null};if(!e)return i;if("object"==typeof t.defaultValue){var n=t.defaultValue;return i.header=n.title,i.msg=n.message,i.hints=n.hints.concat(),i}var r=o.Z.t(e,t);if(!r)return i;if(-1!=r.indexOf("<title>")){var s=r.split("<title>")[1].split("</title>");i.header=s[0],r=s[1]}if(r&&-1!=r.indexOf("<message>")){s=r.split("<message>")[1].split("</message>");i.msg=s[0],r=s[1]}else i.msg=r;if(r&&-1!=r.indexOf("<hint>")){i.hints=[];for(var a=r.split("<hint>"),l=0;l<a.length;l++){var c=a[l].split("</hint")[0];i.hints.push(c)}}return i},l.localize=function(){if(n.AlertBox.instances.length>0)if(n.AlertBox.dismiss(),l.currentError){var e=l.currentError.shift(),t=l.currentError;l.reportError(e,t[0],t[1],t[2])}else{e=l.currentErrors.shift();var i=l.currentErrors[0];l.reportErrors(e,i)}},l.dismissError=function(e){return n.AlertBox.dismissByTag(e)}},38780:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GuiViewer3D:()=>C});var n=i(33423),r=i(59991),o=i(83368),s=i(16840),a=i(82079),l=i(63740),c=i(71224),h=i(67494),u=i(43644),d=i(49720),p=i(34808),f=i(22343),m=i(62421),g=i(3434),v=i(52671),y=i(5442),b=i(99902),x=i(85523),_=i(58847),E=i(47710),A=i(53427),S=i(84220),w=i(34358);function M(e,t){null!=t&&t.globalManager&&this.setGlobalManager(t.globalManager),w.ToolBar.call(this,e,t),this.onToolbarUpdated=(null==t?void 0:t.onToolbarUpdated)||function(){},this.screenModeDelegate=null==t?void 0:t.screenModeDelegate,this.navigation=null==t?void 0:t.navigation,this.onClickViewerOption=(null==t?void 0:t.onClickViewerOption)||function(){},this.onClickRenderOptions=(null==t?void 0:t.onClickRenderOptions)||function(){},this.onClickFullScreen=(null==t?void 0:t.onClickFullScreen)||function(){},this.navTools=new S.RadioButtonGroup(y.TOOLBAR.NAVTOOLSID),this.modelTools=new g.ControlGroup(y.TOOLBAR.MODELTOOLSID),this.settingsTools=new g.ControlGroup(y.TOOLBAR.SETTINGSTOOLSID),this.addControl(this.navTools),this.addControl(this.modelTools),this.addControl(this.settingsTools)}i(27293).GlobalManagerMixin.call(M.prototype),M.prototype=Object.create(w.ToolBar.prototype),M.prototype.constructor=M,M.prototype.initRenderOptionsButton=function(){this.settingsTools&&!this.renderOptionsButton&&(this.renderOptionsButton=new m.Button("toolbar-renderOptionsTool"),this.renderOptionsButton.setToolTip("Rendering options"),this.renderOptionsButton.setIcon("adsk-icon-settings-render"),this.renderOptionsButton.onClick=this.onClickRenderOptions,this.settingsTools.addControl(this.renderOptionsButton))},M.prototype.initSettingsOptionsButton=function(){var e=new m.Button("toolbar-settingsTool");this.viewerOptionButton=e,e.setIcon("adsk-icon-settings"),e.setToolTip("Settings"),this.viewerOptionButton.onClick=this.onClickViewerOption,this.settingsTools.addControl(e)},M.prototype.initModelTools=function(){if(!this.settingsTools.fullscreenbutton){var e=new m.Button("toolbar-fullscreenTool",{collapsible:!1});e.setToolTip("Full screen"),e.setIcon("adsk-icon-fullscreen"),e.onClick=this.onClickFullScreen,this.settingsTools.addControl(e),this.settingsTools.fullscreenbutton=e,this.updateFullscreenButton(this.screenModeDelegate.getMode())}},M.prototype.updateFullscreenButton=function(e){var t="adsk-icon-fullscreen";switch(e){case A.ScreenMode.kNormal:this.screenModeDelegate.isModeSupported(A.ScreenMode.kFullBrowser)||(t="adsk-icon-fullscreen");break;case A.ScreenMode.kFullBrowser:t=this.screenModeDelegate.isModeSupported(A.ScreenMode.kFullScreen)?"adsk-icon-fullscreen":"adsk-icon-fullscreen-exit";break;case A.ScreenMode.kFullScreen:t="adsk-icon-fullscreen-exit"}this.settingsTools.fullscreenbutton.setIcon(t)},M.prototype.updateToolbarButtons=function(e,t){var i,n,r;r=e>310,(n=this.modelTools.getControl("toolbar-explodeTool"))&&n.setVisible(r),r=e>380?"block":"none",(n=this.modelTools.getControl("toolbar-collaborateTool"))&&n.setDisplay(r),r=e>515?"block":"none";var o=this.navTools.getControl("toolbar-cameraSubmenuTool");o&&(o.setDisplay(r),(n=o.subMenu.getControl("toolbar-homeTool"))&&n.setDisplay(this.navigation.isActionEnabled("gotoview")?"block":"none"),(n=o.subMenu.getControl("toolbar-fitToViewTool"))&&n.setDisplay(this.navigation.isActionEnabled("gotoview")?"block":"none"),(n=o.subMenu.getControl("toolbar-focalLengthTool"))&&n.setDisplay(this.navigation.isActionEnabled("fov")?"block":"none"),(n=o.subMenu.getControl("toolbar-rollTool"))&&n.setDisplay(this.navigation.isActionEnabled("roll")?"block":"none")),r=e>700?"block":"none",(n=this.modelTools.getControl("toolbar-measureTool"))&&n.setDisplay(r),(n=this.modelTools.getControl("toolbar-sectionTool"))&&n.setDisplay(r),r=e>740?"block":"none",(n=this.navTools.getControl("toolbar-beelineTool"))&&n.setDisplay(this.navigation.isActionEnabled("walk")?r:"none"),(n=this.navTools.getControl("toolbar-firstPersonTool"))&&n.setDisplay(this.navigation.isActionEnabled("walk")?r:"none"),(n=this.navTools.getControl("toolbar-zoomTool"))&&n.setDisplay(this.navigation.isActionEnabled("zoom")?r:"none"),(n=this.navTools.getControl("toolbar-panTool"))&&n.setDisplay(this.navigation.isActionEnabled("pan")?r:"none"),(n=this.navTools.getControl("toolbar-orbitTools"))&&n.setDisplay(this.navigation.isActionEnabled("orbit")?r:"none"),null===(i=this.onToolbarUpdated)||void 0===i||i.call(this,e,t)},M.prototype.registerCustomizeToolbarCB=function(e){this.onToolbarUpdated=e};var T=i(48155);function C(e,t){t||(t={}),t.startOnInitialize=!1,o.Viewer3D.call(this,e,t),this.toolbar=null,this.dockingPanels=[],this.onFullScreenModeEvent=this.onFullScreenModeEvent.bind(this),this.onProgressBarUpdate=this.onProgressBarUpdate.bind(this)}C.prototype=Object.create(o.Viewer3D.prototype),C.prototype.constructor=C,C.prototype.initialize=function(e){var t=o.Viewer3D.prototype.initialize.call(this,e);if(t>0)return v.ErrorHandler.reportError(this.container,t),t;var i=this;if(this.toolController){var r=new p.HotGestureTool(this);this.toolController.registerTool(r),this.toolController.activateTool(r.getName())}return this.addEventListener(n.FULLSCREEN_MODE_EVENT,this.onFullScreenModeEvent),this.contextMenu||this.setDefaultContextMenu(),this.progressbar=new x.ProgressBar(this.container),this.addEventListener(n.PROGRESS_UPDATE_EVENT,this.onProgressBarUpdate),this.addEventListener(n.VIEWER_RESIZE_EVENT,(function(e){var t;i.resizePanels(),null===(t=i.toolbar)||void 0===t||t.updateToolbarButtons(e.width,e.height)})),this.addEventListener(n.NAVIGATION_MODE_CHANGED_EVENT,(function(){var e;null===(e=i.toolbar)||void 0===e||e.updateToolbarButtons(i.container.clientWidth,i.container.clientHeight)})),this.initEscapeHandlers(),this.localize(),this.addEventListener(n.WEBGL_CONTEXT_LOST_EVENT,function(){for(var e=this.container,t=e.childElementCount,i=0;i<t;++i)e.children[i].classList.add("hide-while-context-lost");v.ErrorHandler.reportError(this.container,a.ErrorCodes.WEBGL_LOST_CONTEXT)}.bind(this)),this.addEventListener(n.WEBGL_CONTEXT_RESTORED_EVENT,function(){for(var e=this.container,t=e.childElementCount,i=0;i<t;++i)e.children[i].classList.remove("hide-while-context-lost");v.ErrorHandler.dismissError(a.ErrorCodes.WEBGL_CONTEXT_LOST_EVENT)}.bind(this)),this.run(),0},C.prototype.uninitialize=function(){this.viewerSettingsPanel&&(this.viewerSettingsPanel.uninitialize(),this.viewerSettingsPanel=null),this.renderoptions&&(this.renderoptions.uninitialize(),this.renderoptions=null),this.viewerOptionButton&&(this.viewerOptionButton=null),this.removeEventListener(n.FULLSCREEN_MODE_EVENT,this.onFullScreenModeEvent),this.removeEventListener(n.PROGRESS_UPDATE_EVENT,this.onProgressBarUpdate),this.progressbar=null,this.debugMenu=null,this.modelStats=null,this.toolbar=null,o.Viewer3D.prototype.uninitialize.call(this)},C.prototype.setUp=function(e){e||(e={}),e.startOnInitialize=!1,o.Viewer3D.prototype.setUp.call(this,e)},C.prototype.tearDown=function(e){o.Viewer3D.prototype.tearDown.call(this,e),this.toolbar&&(this.toolbar.container.parentNode.removeChild(this.toolbar.container),this.toolbar=null),this.viewerSettingsPanel&&this.setSettingsPanel(null),this.renderoptions&&(this.removePanel(this.renderoptions),this.renderoptions.uninitialize(),this.renderoptions=null),this.debugMenu=null,this.removeEventListener(n.GEOMETRY_LOADED_EVENT,this.checkGeometry),this.checkGeometry=null},C.prototype.onPostExtensionLoad=function(e){var t,i=this.getToolbar();i&&e.onToolbarCreated&&e.onToolbarCreated(i),null===(t=this.toolbar)||void 0===t||t.updateToolbarButtons(this.container.clientWidth,this.container.clientHeight)},C.prototype.loadModel=function(e,t,i,n,r){var s=this;var l=o.Viewer3D.prototype.loadModel.call(this,e,t,(function(e){setTimeout((function(){var n,r;t&&(t.loadAsHidden||t.headlessViewer)||function(e){s.running?s.createUI(e):d.logger.error("createUI expects the viewer to be running.",(0,a.errorCodeString)(a.ErrorCodes.VIEWER_INTERNAL_ERROR))}(e);const o=null===(n=e.loader)||void 0===n||null===(r=n.svf)||void 0===r?void 0:r.viewpointTreeRoot;o&&function(e,t){var i;let n=null===(i=t.getDocumentNode())||void 0===i?void 0:i.getRootNode();if(n){const t=new Autodesk.Viewing.BubbleNode(e);t.parent=n.children[0],n.children[0].children.push(t)}}(o,e),i&&i.call(i,e)}),1)}),(function(e){e!==a.ErrorCodes.LOAD_CANCELED?v.ErrorHandler.reportError(s.container,e):d.logger.warn("A load was canceled"),n&&n.apply(n,arguments)}),r);return l},C.prototype.createUI=function(e,t){if(this.model!==e&&!t)return;var i=this;const r=this._createToolbar();this.checkGeometry=function(e){setTimeout((function(){if(!i.impl.is2d&&e.model&&!e.model.hasGeometry()){var t=a.ErrorCodes.BAD_DATA_MODEL_IS_EMPTY;v.ErrorHandler.reportError(i.container,t,"Model is empty"),i._loadingSpinner.hide()}}),1)};var o=this.config.disabledExtensions||{};const l=e=>-1===(this.profile&&this.profile.extensions.unload?this.profile.extensions.unload:[]).indexOf(e);this.initModelTools(e),(0,s.getGlobal)().ENABLE_DEBUG&&this.initDebugTools(),"true"===(0,u.getParameterByName)("lmv_viewer_debug")&&this.loadExtension("Autodesk.Debug",this.config);var c=function(e){i.getExtension(e)&&i.unloadExtension(e)};e.is2d()&&(c("Autodesk.BimWalk"),c("Autodesk.Section"),c("Autodesk.Viewing.FusionOrbit"),c("Autodesk.Explode")),o.measure||c("Autodesk.Measure"),r&&(this.dispatchEvent({type:y.TOOLBAR_CREATED_EVENT}),this.forEachExtension((e=>{e.onToolbarCreated&&e.onToolbarCreated(this.toolbar)})));var h="Autodesk.DefaultTools.NavTools",d=this.getExtension(h);d?d.updateUI(e.is3d()):this.loadExtension(h,i.config),this.resize(),e.is2d()?(this.setDefaultNavigationTool("pan"),this.setClickToSetCOI(!1,!1),setTimeout((function(){if(!i.impl)return;const e={viewcube:"Autodesk.ViewCubeUi",measure:"Autodesk.Measure",hyperlink:"Autodesk.Hyperlink",layerManager:"Autodesk.LayerManager",propertiesPanel:"Autodesk.PropertiesManager"};(0,s.isMobileDevice)()||(e.boxSelection="Autodesk.BoxSelection");for(let t in e){const n=e[t];!o[t]&&l(n)&&i.loadExtension(n,i.config)}}),1)):(-1===this.getDefaultNavigationToolName().indexOf("orbit")&&this.setDefaultNavigationTool("orbit"),setTimeout((function(){if(!i.impl)return;const e={viewcube:"Autodesk.ViewCubeUi",explode:"Autodesk.Explode",bimwalk:"Autodesk.BimWalk",fusionOrbit:"Autodesk.Viewing.FusionOrbit",measure:"Autodesk.Measure",section:"Autodesk.Section",layerManager:"Autodesk.LayerManager",modelBrowser:"Autodesk.ModelStructure",propertiesPanel:"Autodesk.PropertiesManager"};(0,s.isMobileDevice)()||(e.boxSelection="Autodesk.BoxSelection");for(let t in e){const n=e[t];!o[t]&&l(n)&&i.loadExtension(n,i.config)}!o.scalarisSimulation&&l("Autodesk.Viewing.ScalarisSimulation")&&i.model&&i.model.isScalaris&&i.loadExtension("Autodesk.Viewing.ScalarisSimulation",i.config)}),1),e.isLoadDone()?this.checkGeometry({model:e}):this.addEventListener(n.GEOMETRY_LOADED_EVENT,this.checkGeometry,{once:!0}))},C.prototype.onFullScreenModeEvent=function(e){this.resizePanels(),this.toolbar.updateFullscreenButton(e.mode)},C.prototype.onProgressBarUpdate=function(e){e.percent>=0&&this.progressbar.setPercent(e.percent)},C.prototype.addOptionToggle=function(e,t,i,n,r){var o=r?this.prefs[r]:null;i="boolean"==typeof o?o:i;let a=this.getDocument();var l=a.createElement("li");l.className="toolbar-submenu-listitem";var h=a.createElement("input");h.className="toolbar-submenu-checkbox",h.type="checkbox",h.id=t,l.appendChild(h);var u=a.createElement("label");return u.setAttribute("for",t),u.setAttribute("data-i18n",t),u.textContent=c.Z.t(t),l.appendChild(u),e.appendChild(l),h.checked=i,h.addEventListener("touchstart",s.touchStartToClick),u.addEventListener("touchstart",s.touchStartToClick),l.addEventListener("touchstart",s.touchStartToClick),h.addEventListener("click",(function(e){n(h.checked),e.stopPropagation()})),u.addEventListener("click",(function(e){e.stopPropagation()})),l.addEventListener("click",(function(e){n(!h.checked),e.stopPropagation()})),r&&this.prefs.addListeners(r,(function(e){h.checked=e}),(function(e){h.checked=e,n(e)})),h},C.prototype.addOptionList=function(e,t,i,n,r,o){var s=this.prefs[o];n="number"==typeof s?s:n;let a=this.getDocument();var l=a.createElement("select");l.className="option-drop-down",l.id="selectMenu_"+t;for(var h=0;h<i.length;h++){var u=a.createElement("option");u.value=h,u.setAttribute("data-i18n",i[h]),u.textContent=c.Z.t(i[h]),l.add(u)}var d=a.createElement("li");d.className="toolbar-submenu-select";var p=a.createElement("div");return p.className="toolbar-submenu-selectlabel",p.setAttribute("for",t),p.setAttribute("data-i18n",t),p.textContent=c.Z.t(t),d.appendChild(p),d.appendChild(l),e.appendChild(d),l.selectedIndex=n,l.onchange=function(e){var t=e.target.selectedIndex;r(t),e.stopPropagation()},l.addEventListener("touchstart",(function(e){e.stopPropagation()})),l.addEventListener("click",(function(e){e.stopPropagation()})),o&&this.prefs.addListeners(o,(function(e){l.selectedIndex=e}),(function(e){l.selectedIndex=e,r(e)})),l},C.prototype.showViewer3dOptions=function(e){var t=this.getSettingsPanel(!0);e&&t.isVisible()&&t.setVisible(!1),t.setVisible(e)},C.prototype.showRenderingOptions=function(e){e&&this._createRenderingOptionsPanel(),this.renderoptions&&this.renderoptions.setVisible(e)},C.prototype._createRenderingOptionsPanel=function(){this.renderoptions||this.model.is2d()||(this.renderoptions=new _.RenderOptionsPanel(this),this.addPanel(this.renderoptions),this.toolbar.initRenderOptionsButton())},C.prototype.showLayerManager=function(){d.logger.warn('viewer.showLayerManager() is now handled the extension "Autodesk.LayerManager" and will be removed in version 8.0.0.')},C.prototype.initHotkeys=function(){d.logger.warn("viewer.initHotkeys() has been deprecated and will be removed in version 8.0.0.")},C.prototype.setModelStructurePanel=function(e){d.logger.warn('viewer.setModelStructurePanel() is deprecated and will be removed in v8.0.0 - Use extension "Autodesk.ModelStructure".');var t=this.getExtension("Autodesk.ModelStructure");return!!t&&t.setModelStructurePanel(e)},C.prototype.setLayersPanel=function(){d.logger.warn('viewer.setLayersPanel() is now handled the extension "Autodesk.LayerManager" and will be removed in version 8.0.0.')},C.prototype.setPropertyPanel=function(e){d.logger.warn('viewer.setPropertyPanel() is now handled by extension "Autodesk.PropertiesManager" and will be removed in version 8.0.0.');var t=this.getExtension("Autodesk.PropertiesManager");return!!t&&t.setPanel(e)},C.prototype.getPropertyPanel=function(e){d.logger.warn('viewer.getPropertyPanel() is now handled the extension "Autodesk.PropertiesManager" and will be removed in version 8.0.0.');var t=this.getExtension("Autodesk.PropertiesManager");return!t&&e&&(this.loadExtension("Autodesk.PropertiesManager"),t=this.getExtension("Autodesk.PropertiesManager")),t?t.getPanel():null},C.prototype.setSettingsPanel=function(e){var t=this;return(e instanceof E.SettingsPanel||!e)&&(this.viewerSettingsPanel&&(this.viewerSettingsPanel.setVisible(!1),this.removePanel(this.viewerSettingsPanel),this.viewerSettingsPanel.uninitialize()),this.viewerSettingsPanel=e,e&&(this.addPanel(e),e.addVisibilityListener((function(i){var n;i&&t.onPanelVisible(e,t),null===(n=t.toolbar)||void 0===n||n.viewerOptionButton.setState(i?m.Button.State.ACTIVE:m.Button.State.INACTIVE)}))),!0)},C.prototype.getSettingsPanel=function(e,t){return!this.viewerSettingsPanel&&e&&this.createSettingsPanel(t||this.model),this.viewerSettingsPanel},C.prototype.createSettingsPanel=function(e){var t=new T.ViewerSettingsPanel(this,e);this.setSettingsPanel(t),t.syncUI(),this.toolbar.initSettingsOptionsButton(),this.dispatchEvent({type:y.SETTINGS_PANEL_CREATED_EVENT})},C.prototype.initModelTools=function(e){this.createSettingsPanel(e),(0,s.getGlobal)().ENABLE_DEBUG&&this._createRenderingOptionsPanel(),this.canChangeScreenMode()&&(0,s.isFullscreenEnabled)(this.getDocument())&&(this.toolbar.initModelTools(),this.toolbar.updateFullscreenButton(this.getScreenMode()))},C.prototype.setPropertiesOnSelect=function(e){d.logger.warn('viewer.setPropertiesOnSelect() is now handled by viewer.prefs.set("openPropertiesOnSelect", <boolean>) and will be removed in version 8.0.0.'),this.prefs.set(r.Prefs.OPEN_PROPERTIES_ON_SELECT,e)},C.prototype.addDivider=function(e){var t=this.getDocument().createElement("li");return t.className="toolbar-submenu-horizontal-divider",e.appendChild(t),t},C.prototype.initDebugTools=function(){if(this.debugMenu)return!1;var e=new g.ControlGroup("debugTools");this.debugMenu=e;var t=new m.Button("toolbar-debugTool");return t.setIcon("adsk-icon-bug"),e.addControl(t),this.debugMenu.debugSubMenuButton=t,this.createDebugSubmenu(this.debugMenu.debugSubMenuButton),this.toolbar.addControl(e),!0},C.prototype.removeDebugTools=function(){this.debugMenu&&(this.debugMenu.removeFromParent(),this.debugMenu=null)},C.prototype.createDebugSubmenu=function(e){var t=this,i=this.getDocument().createElement("div");i.id="toolbar-debugToolSubmenu",i.classList.add("toolbar-submenu"),i.classList.add("toolbar-settings-sub-menu"),i.classList.add("adsk-hidden"),this.debugMenu.subMenu=i,this.debugMenu.subMenu.style.minWidth="180px",this.container.appendChild(i),this.initModelStats(),this.addDivider(i),this.addDivider(i);var n=h.Lang.getLanguages(),r=n.map((function(e){return e.label})),o=n.map((function(e){return e.symbol}));function a(){t.localize()}var c=t.selectedLanguage?t.selectedLanguage:0;this.addOptionList(i,"Language",r,c,(function(e){var i=o[e];t.selectedLanguage=e,(0,l.setLanguage)(i,a)}),null).parentNode.style.paddingBottom="15px",this.addDivider(this.debugMenu.subMenu);this.addOptionList(i,"Error",["UNKNOWN FAILURE","BAD DATA","NETWORK ERROR","NETWORK ACCESS DENIED","NETWORK FILE NOT FOUND","NETWORK SERVER ERROR","NETWORK UNHANDLED RESPONSE CODE","BROWSER WEBGL NOT SUPPORTED","BAD DATA NO VIEWABLE CONTENT"],0,(function(e){var i=e+1;v.ErrorHandler.reportError(t.container,i,"")}),null).parentNode.style.paddingBottom="15px";var u=i.getBoundingClientRect();this.debugMenu.subMenu.style.width=u.width+"px",this.container.removeChild(i),e.container.appendChild(i);var d=u.left+u.width,p=this.container.getBoundingClientRect().right;if(d>p){var f=-(d-p+10)+"px";this.debugMenu.subMenu.style.left=f}e.onMouseOver=function(){i.classList.remove("adsk-hidden")},e.onMouseOut=function(){i.classList.add("adsk-hidden")},(0,s.isTouchDevice)()&&(e.onClick=function(){i.classList.toggle("adsk-hidden")})},C.prototype.initModelStats=function(){var e=this;function t(t){var i=e.impl,n="";e.model&&(n+="Geom&nbsp;polys:&nbsp;"+i.modelQueue().getGeometryList().geomPolyCount+"<br>",n+="Instance&nbsp;polys:&nbsp;"+i.modelQueue().getGeometryList().instancePolyCount+"<br>",n+="Fragments:&nbsp;"+i.modelQueue().getFragmentList().getCount()+"<br>",n+="Geoms:&nbsp;"+i.modelQueue().getGeometryList().geoms.length+"<br>",n+="Loading&nbsp;time:&nbsp;"+(i.model.loader.loadTime/1e3).toFixed(2)+" s<br>"),n+="# "+(t||""),e.modelStats.innerHTML=n}this.addOptionToggle(this.debugMenu.subMenu,"Model statistics",!1,(function(i){i&&!e.modelStats&&(!function(){let i=e.getDocument();e.modelStats=i.createElement("div"),e.modelStats.className="statspanel",e.container.appendChild(e.modelStats),e.addEventListener(n.PROGRESS_UPDATE_EVENT,(function(e){e.message&&t(e.message)})),e.fpsDisplay=i.createElement("div"),e.fpsDisplay.className="fps",e.container.appendChild(e.fpsDisplay)}(),t("")),e.modelStats.style.visibility=i?"visible":"hidden",e.fpsDisplay.style.visibility=i?"visible":"hidden",e.impl.fpsCallback=i?function(t){e.fpsDisplay.textContent=""+(0|t)}:null}))},C.prototype.initEscapeHandlers=function(){var e=this;this.addEventListener(n.ESCAPE_EVENT,(function(){if(!e.contextMenu||!e.contextMenu.hide())if(e.renderoptions&&e.renderoptions.isVisible())e.renderoptions.setVisible(!1);else if(e.impl.selector.hasSelection())e.clearSelection();else{if(e.getActiveNavigationTool()!==e.getDefaultNavigationToolName())return e.toolController&&e.toolController.setIsLocked(!1),e.setActiveNavigationTool(),void b.HudMessage.dismiss();if(e.areAllVisible()){if(!f.AlertBox.dismiss()){for(var t=0;t<e.dockingPanels.length;++t){var i=e.dockingPanels[t];if("none"!==i.container.style.display&&""!==i.container.style.display)return void i.setVisible(!1)}e.escapeScreenMode()}}else e.showAll()}}))},C.prototype.getToolbar=function(){return this.toolbar},C.prototype._createToolbar=function(){if(this.toolbar)return!1;const e=this;if(this.toolbar=new M("guiviewer3d-toolbar",{globalManager:this.globalManager,navigation:this.navigation,screenModeDelegate:this.getScreenModeDelegate(),onClickFullScreen:e.nextScreenMode.bind(e),onClickRenderOptions:()=>{var e=this.renderoptions&&this.renderoptions.isVisible();this.renderoptions.setVisible(!e)},onClickViewerOption:()=>{e.getSettingsPanel(!0).isVisible()?e.showViewer3dOptions(!1):e.showViewer3dOptions(!0)}}),this._forgeLogo){const e=this._forgeLogo.getBoundingClientRect();this.toolbar.container.style.bottom=`${e.height+10}px`}return this.container.appendChild(this.toolbar.container),this.toolbar.updateToolbarButtons(this.container.clientWidth,this.container.clientHeight,this.navigation),!0},C.prototype.showModelStructurePanel=function(e){d.logger.warn('viewer.showModelStructurePanel() is deprecated and will be removed in v8.0.0 - Use extension "Autodesk.ModelStructure".'),e?this.activateExtension("Autodesk.ModelStructure"):this.deactivateExtension("Autodesk.ModelStructure")},C.prototype.onPanelVisible=function(e){this.dockingPanels.splice(this.dockingPanels.indexOf(e),1),this.dockingPanels.splice(0,0,e)},C.prototype.localize=function(){o.Viewer3D.prototype.localize.call(this),this.debugMenu&&this.debugMenu.debugSubMenuButton&&(this.debugMenu.debugSubMenuButton.container.removeChild(this.debugMenu.subMenu),this.createDebugSubmenu(this.debugMenu.debugSubMenuButton)),v.ErrorHandler.localize()},C.prototype.addPanel=function(e){return-1===this.dockingPanels.indexOf(e)&&(this.dockingPanels.push(e),!0)},C.prototype.removePanel=function(e){var t=this.dockingPanels.indexOf(e);return t>-1&&(this.dockingPanels.splice(t,1),!0)},C.prototype.resizePanels=function(e){e=e||{};var t=this.toolbar?this.toolbar.getDimensions().height:0,i=this.getDimensions(),n=i.height;e.dimensions&&e.dimensions.height?n=e.dimensions.height:e.dimensions={height:i.height,width:i.width},e.dimensions.height=n-t;var r=e?e.dockingPanels:null;r||(r=this.dockingPanels);var o,s,a=this.container.getBoundingClientRect(),l=a.top,c=a.bottom,h=a.left,u=a.right;e&&e.dimensions?(o=e.dimensions.width,c=l+(s=e.dimensions.height)):(o=a.width,s=a.height);for(var d=0;d<r.length;++d)r[d].onViewerResize(l,c,h,u,o,s)},C.prototype.initExplodeSlider=function(){d.logger.warn('viewer.initExplodeSlider() has been replaced by extension "Autodesk.Explode". initExplodeSlier() will be removed in version 7.0.0.')},C.prototype.registerCustomizeToolbarCB=function(e){var t,i;null===(t=this.toolbar)||void 0===t||t.registerCustomizeToolbarCB(e.bind(null,this)),null===(i=this.toolbar)||void 0===i||i.updateToolbarButtons(this.container.clientWidth,this.container.clientHeight)},Object.defineProperty(C.prototype,"navTools",{get(){var e;return null===(e=this.toolbar)||void 0===e?void 0:e.navTools}}),Object.defineProperty(C.prototype,"modelTools",{get(){var e;return null===(e=this.toolbar)||void 0===e?void 0:e.modelTools}}),Object.defineProperty(C.prototype,"settingsTools",{get(){var e;return null===(e=this.toolbar)||void 0===e?void 0:e.settingsTools}}),Object.defineProperty(C.prototype,"updateFullscreenButton",{get(){var e;return null===(e=this.toolbar)||void 0===e?void 0:e.updateFullscreenButton.bind(this)}}),Autodesk.Viewing.Private.GuiViewer3D=C},5442:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SETTINGS_PANEL_CREATED_EVENT:()=>r,TOOLBAR:()=>s,TOOLBAR_CREATED_EVENT:()=>n,VIEW_CUBE_CREATED_EVENT:()=>o});const n="toolbarCreated",r="settingsPanelCreated",o="viewCubeCreated",s={NAVTOOLSID:"navTools",MODELTOOLSID:"modelTools",SETTINGSTOOLSID:"settingsTools",MEASURETOOLSID:"measureTools"}},99902:(e,t,i)=>{"use strict";i.r(t),i.d(t,{HudMessage:()=>r});var n=i(71224);function r(){}r.instances=[],r.displayMessage=function(e,t,i,o,s){let a=e.ownerDocument,l=a.defaultView||a.parentWindow;function c(e){var t=l.getComputedStyle(e),i=parseInt(t["margin-top"]),n=parseInt(t["margin-bottom"]);return e.getBoundingClientRect().height+i+n}function h(e,t,i){var n=l.getComputedStyle(e,null);if(!Array.isArray(t))return n[t];for(var r=i||{},o=0;o<t.length;o++){var s=t[o];r[s]=n[s]}return r}if(!(r.instances.length>0)){var u=t.msgTitleKey,d=t.msgTitleDefaultValue||u,p=t.messageKey,f=t.messageDefaultValue||p,m=t.buttonText,g=t.checkboxChecked||!1,v=t.position||"center",y=a.createElement("div");if(y.classList.add("docking-panel"),y.classList.add("hud"),"top"===v&&y.classList.add("top"),e.appendChild(y),u){var b,x=a.createElement("div");x.classList.add("docking-panel-title"),x.classList.add("docking-panel-delimiter-shadow"),x.textContent=n.Z.t(u,{defaultValue:d}),x.setAttribute("data-i18n",u),y.appendChild(x),i&&((b=a.createElement("div")).classList.add("docking-panel-close"),b.addEventListener("click",(function(e){r.dismiss(),i&&i(e)})),y.appendChild(b));var _=h(x,["width","font-size"]),E=function(e){var t=e.textContent,i=a.createElement("span");h(e,["font-size","font-weight","text-transform","padding","white-space","font-family"],i.style),i.textContent=t,i.style.position="absolute",i.style.top="10000px",i.style.left="-10000px",a.body.appendChild(i);var n=i.offsetWidth;return a.body.removeChild(i),n}(x),A=parseFloat(_["font-size"]),S=b?parseFloat(h(b,"width")):0,w=parseFloat(_.width)-S;x.style["font-size"]=E>w?w/E*A+"px":`${A}px`}var M=a.createElement("div");M.classList.add("hud-client"),M.classList.add("docking-panel-container-solid-color-b"),y.appendChild(M);var T=a.createElement("div");T.className="hud-message",T.textContent=n.Z.t(p,{defaultValue:f}),T.setAttribute("data-i18n",f),M.appendChild(T);var C=c(T);if(o){var P=a.createElement("div");P.classList.add("docking-panel-primary-button"),P.classList.add("hud-button"),P.textContent=n.Z.t(m,{defaultValue:m}),P.setAttribute("data-i18n",m),P.addEventListener("click",o),M.appendChild(P),C+=c(P)}if(s){var D=a.createElement("div"),L=a.createElement("input");L.className="hud-checkbox",L.type="checkbox",L.checked=g,D.appendChild(L);var I="Do not show this message again",R=a.createElement("label");R.setAttribute("for",I),R.setAttribute("data-i18n",I),R.textContent=n.Z.t(I,{defaultValue:I}),D.appendChild(R),L.addEventListener("change",s),M.appendChild(D),C+=c(s)}M.style.height=C+"px",y.style.height=C+(x?c(x):0)+"px";var O={hudMessage:y,container:e};r.instances.push(O)}},r.dismiss=function(){if(r.instances.length>0){var e=r.instances.pop();return e.hudMessage.style.visibility="hidden",e.container.removeChild(e.hudMessage),!0}return!1}},95420:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LoadingSpinner:()=>r});var n=i(71224);function r(e){this.parentDiv=e;var t=this.getDocument();this.container=t.createElement("div"),this.container.innerHTML=['<div class="path">','<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">','<path d="M2.5,50a47.5,47.5 0 1,0 95,0a47.5,47.5 0 1,0 -95,0" vector-effect="non-scaling-stroke"/>','<path d="M 2.5 50 A 47.5 47.5 0 0 1 47.5 2.5" vector-effect="non-scaling-stroke"/>',"</svg>","</div>",'<div class="message" data-i18n="Spinner Loading">LOADING</div>'].join(""),this.container.className="loading-spinner"}i(27293).GlobalManagerMixin.call(r.prototype),r.prototype.addClass=function(e){this.container.classList.add(e)},r.prototype.attachToDom=function(){return!this.container.parentNode&&(n.Z.localize(this.container),this.parentDiv.appendChild(this.container),!0)},r.prototype.removeFromDom=function(){return!!this.container.parentNode&&(this.container.parentNode.removeChild(this.container),!0)},r.prototype.setVisible=function(e){e?this.attachToDom():this.removeFromDom()}},44355:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ModelStructurePanel:()=>f});var n=i(94577),r=i(63988),o=i(9178),s=i(49720),a=i(43644),l=i(71224),c=-1,h=-2;const u=-1e10;function d(e,t){o.TreeDelegate.call(this),this.panel=e,this.model=t;let i=this.getDocument();this.modelDiv=i.createElement("div"),this.modelDiv.classList.add("model-div"),this.modelDiv.setAttribute("lmv-modelId",t.id),this.instanceTree=null,this.rootId=c,this.state=1}function p(e){var t=function(e){var t=e.getData();if(t&&t.loadOptions&&t.loadOptions.modelNameOverride)return t.loadOptions.modelNameOverride;return""}(e);if(t)return t;if(!e.getData())return"";var i=e.getDocumentNode();return i?i.getModelName():"Model"}function f(e,t,i,r){n.DockingPanel.call(this,e,t,i,r),this.container.classList.add("model-structure-panel"),(r=r||{}).heightAdjustment||(r.heightAdjustment=40),r.marginTop||(r.marginTop=0),r.left=!0,this.createScrollContainer(r),this.onScroll=this.onScroll.bind(this),this.scrollContainer.addEventListener("scroll",this.onScroll),this.scrollContainer.style["overflow-x"]="hidden",this.options=r,this.tree=null,this._pendingModels=[],this.uiCreated=!1;var o=this;this.addVisibilityListener((function(e){e&&(o.uiCreated||o.createUI(),o.resizeToContent())}))}d.prototype=Object.create(o.TreeDelegate.prototype),d.prototype.constructor=d,d.prototype.isLoading=function(){return 1===this.state},d.prototype.isAvailable=function(){return 2===this.state},d.prototype.isNotAvailable=function(){return 3===this.state},d.prototype.isControlId=function(e){return e===c||e===h},d.prototype.getControlIdCss=function(e){return null},d.prototype.getRootId=function(){return this.rootId},d.prototype.getTreeNodeId=function(e){return"object"==typeof e?(s.logger.warn("Object used instead of dbId. Fix it."),e.dbId):e},d.prototype.getTreeNodeIndex=function(e){return this.instanceTree.nodeAccess.dbIdToIndex[e]},d.prototype.getTreeNodeLabel=function(e){if(e===c){var t=p(this.model);return l.Z.t("Loading model",{name:t})}return e===h||e===this.getRootId()?t=p(this.model):e==u?"Object 0":this.instanceTree.getNodeName(e,!0)||"Object "+e},d.prototype.getTreeNodeClass=function(e){return e===c||e===h?"message-unexpected":""},d.prototype.getTreeNodeParentId=function(e){if(e===u)return 0;let t=this.instanceTree.nodeAccess.getParentId(e);return 0===t?u:t},d.prototype.getTreeNodeCount=function(){return this.instanceTree.nodeAccess.getNumNodes()},d.prototype.getTreeNodeClientHeight=function(e){return 36},d.prototype.getTreeNodeDepthOffset=function(e,t){return 13+25*t},d.prototype.isTreeNodeGroup=function(e){return!this.isControlId(e)&&this.instanceTree.getChildCount(e)>0},d.prototype.shouldCreateTreeNode=function(e){return!0},d.prototype.createTreeNode=function(e,t){let i=this,n=i.getDocument();if(t.addEventListener("mousedown",(function(){var e=function(){this.classList.remove("highlight"),i.removeDocumentEventListener("mouseup",e)}.bind(t);t.classList.add("highlight"),i.addDocumentEventListener("mouseup",e)})),!this.isControlId(e)){var r=n.createElement("div");r.dbId=e,r.classList.add("visibility"),r.addEventListener("mousedown",(function(e){e.preventDefault(),e.stopPropagation()})),r.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var t=parseInt(e.target.dbId);this.panel.onEyeIcon(t,this.model)}.bind(this)),t.appendChild(r)}if(e===c){var s=n.createElement("img");s.src=(0,a.getResourceUrl)("res/ui/spinner.png"),s.style.animation="loading-spinner-perpetual-motion 1s infinite linear",s.style.float="right",s.style.marginRight="5px",s.style.width="20px",t.appendChild(s)}var l={localize:e===c||e===h};o.TreeDelegate.prototype.createTreeNode.call(this,e,t,l)},d.prototype.onTreeNodeRightClick=function(e,t,i){this.isControlId(t)||this.panel.onTreeNodeRightClick(e,t,this.model,i)},d.prototype.onTreeNodeClick=function(e,t,i){this.isControlId(t)||this.panel.onTreeNodeClick(e,t,this.model,i)},d.prototype.onTreeNodeDoubleClick=function(e,t,i){},d.prototype.onTreeNodeIconClick=function(e,t,i){if(this.isTreeNodeGroup(t)){var n=e.isCollapsed(this,t);e.setCollapsed(this,t,!n)}},d.prototype.onTreeNodeReized=function(e){},d.prototype.forEachChild=function(e,t,i){this.isControlId(e)||this.instanceTree.enumNodeChildren(e,t,i)},d.prototype.setInstanceTree=function(e){this.instanceTree=e,this.state=e?2:3,this.rootId=e?e.getRootId():h,function(e){var t=e.instanceTree;if(!t)return;var i,n=e.rootId,r=t.getNodeName(n),o=0,s=0;t.enumNodeChildren(n,(function(e){s||(i=t.getNodeName(e),o=e),s++})),e.hasDoubleRoot=1===s&&r===i,e.rootId=e.hasDoubleRoot?o:n}(this)},d.prototype.clean=function(){for(var e,t=this.modelDiv;e=t.lastChild;)t.removeChild(e)},f.prototype=Object.create(n.DockingPanel.prototype),f.prototype.constructor=f,f.prototype.uninitialize=function(){var e;this.scrollContainer.addEventListener("scroll",this.onScroll),this.scrollContainer.parentNode.removeChild(this.scrollContainer),null===(e=this.tree)||void 0===e||e.destroy(),n.DockingPanel.prototype.uninitialize.call(this)},f.prototype.addModel=function(e){if(e)if(this.uiCreated)this.createTreeUI(e);else{if(-1!==this._pendingModels.indexOf(e))return;this._pendingModels.push(e)}},f.prototype.unloadModel=function(e){if(e)if(this.uiCreated)this.removeTreeUI(e);else{var t=this._pendingModels.indexOf(e);if(-1===t)return;this._pendingModels.splice(t,1)}},f.prototype.createUI=function(){if(!this.uiCreated){var e,t="";if(this.options&&this.options.defaultTitle?(t=this.options.defaultTitle,e=void 0===this.options.localizeTitle||!!this.options.localizeTitle):(t=this.modelTitle,e=!1),t||(t="Browser",e=!0),this.setTitle(t,{localizeTitle:e}),this.uiCreated=!0,this.tree=new r.TreeOnDemand(this.scrollContainer,this.options),this.tree.setGlobalManager(this.globalManager),0!==this._pendingModels.length){for(var i=0;i<this._pendingModels.length;++i)this.createTreeUI(this._pendingModels[i]);this._pendingModels=[]}}},f.prototype.createTreeUI=function(e){if(this.tree.getDelegate(e.id))return!1;var t=new d(this,e);t.setGlobalManager(this.globalManager),this.tree.pushDelegate(t);var i=this;return e.getObjectTree((function(e){i.setInstanceTree(t,e)}),(function(){i.setInstanceTree(t,null)})),!0},f.prototype.setInstanceTree=function(e,t){this.tree.setInstanceTree(e,t)},f.prototype.removeTreeUI=function(e){this.tree.removeDelegate(e.id)&&(this.scrollContainer.scrollTop=0,this.onScroll())},f.prototype.onScroll=function(){this.tree.setScroll(this.scrollContainer.scrollTop)},f.prototype.getNodeLabel=function(e){return this.myDelegate.getNodeLabel(e)},f.prototype.onTreeNodeClick=function(){throw new Error("Method must be overriden.")},f.prototype.onTreeNodeRightClick=function(){throw new Error("Method must be overriden.")},f.prototype.onTitleClick=function(){},f.prototype.onTitleDoubleClick=function(){}},38329:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ObjectContextMenu:()=>o});var n=i(18008),r=i(27293);function o(e){this.viewer=e,this.setGlobalManager(e.globalManager),this.contextMenu=new n.ContextMenu(e)}o.prototype.constructor=o,r.GlobalManagerMixin.call(o.prototype),o.prototype.show=function(e){var t=this.viewer.getSelectionCount(),i=this.viewer.getSelectionVisibility(),n=this.viewer.impl.getCanvasBoundingClientRect(),r={event:e,numSelected:t,hasSelected:0<t,hasVisible:i.hasVisible,hasHidden:i.hasHidden,canvasX:e.clientX-n.left,canvasY:e.clientY-n.top},o=this.buildMenu(e,r);this.viewer.runContextMenuCallbacks(o,r),o&&0<o.length&&this.contextMenu.show(e,o)},o.prototype.hide=function(){return this.contextMenu.hide()},o.prototype.buildMenu=function(){return null}},85523:(e,t,i)=>{"use strict";function n(e){let t=e.ownerDocument;this.bg=t.createElement("div"),this.bg.className="progressbg",this.fg=t.createElement("div"),this.fg.className="progressfg",this.bg.appendChild(this.fg),e.appendChild(this.bg),this.lastValue=-1,this.fg.style.transform="scale(0, 1)"}i.r(t),i.d(t,{ProgressBar:()=>n}),n.prototype.setPercent=function(e){e!=this.lastValue&&(this.lastValue=e,e>=99?this.bg.style.opacity="0":(this.bg.style.opacity="1",this.fg.style.transform=`scale(${e/100}, 1)`))},n.prototype.setStyle=function(e){!this.fg.classList.contains(e)&&this.fg.classList.add(e)},n.prototype.removeStyle=function(e){this.fg.classList.contains(e)&&this.fg.classList.remove(e)}},58927:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PropertyPanel:()=>c});var n=i(94577),r=i(9178),o=i(19742),s=i(97967),a=i(71224),l=i(52081);function c(e,t,i,s){n.DockingPanel.call(this,e,t,i,s),this.title.classList.add("docking-panel-delimiter-shadow"),this.container.classList.add("property-panel"),this.container.dockRight=!0,this.createScrollContainer({left:!1,heightAdjustment:70,marginTop:0}),this.highlightableElements={};var a=this;var l=function(){var e=new r.TreeDelegate;function t(e){return"category"===e.type}return e.setGlobalManager(a.globalManager),e.getTreeNodeId=function(e){return e.name+(Object.prototype.hasOwnProperty.call(e,"value")?e.value:"")+(Object.prototype.hasOwnProperty.call(e,"category")?e.category:"")},e.getTreeNodeClass=function(e){return t(e)?a.getCategoryClass(e):a.getPropertyClass(e)},e.isTreeNodeGroup=function(e){return t(e)},e.onTreeNodeClick=function(e,i,n){t(i)?a.onCategoryClick(i,n):a.onPropertyClick(i,n)},e.onTreeNodeRightClick=function(e,i,n){t(i)?a.onCategoryRightClick(i,n):a.onPropertyRightClick(i,n)},e.onTreeNodeDoubleClick=function(e,i,n){t(i)?a.onCategoryDoubleClick(i,n):a.onPropertyDoubleClick(i,n)},e.onTreeNodeIconClick=function(e,i,n){t(i)?a.onCategoryIconClick(i,n):a.onPropertyIconClick(i,n)},e.createTreeNode=function(e,i,n){var r=null;(r=t(e)?a.displayCategory(e,i,n):a.displayProperty(e,i,n))&&(a.highlightableElements[this.getTreeNodeId(e)]=r)},e}();this.tree=new o.Tree(l,null,this.scrollContainer,{}),this.tree.setGlobalManager(this.globalManager)}function h(e){e=String(e);var t=' target="blank" class="propertyLink" ';return[{pattern:/\b(?:https?|ftp):\/\/[a-z0-9-+&@#/%?=~_|()!:,.;]*[a-z0-9-+&@#/%=~_|()]/gim,value:"<a"+t+'href="$&">$&</a>'},{pattern:/(^|[^/])(www\.[\S]+(\b|$))/gim,value:"$1<a"+t+'href="http://$2">$2</a>'}].reduce((function(e,t){return e.replace(t.pattern,t.value)}),e)}c.prototype=Object.create(n.DockingPanel.prototype),c.prototype.constructor=c,c.prototype.setAggregatedProperties=function(e){this.removeAllProperties();const t=Autodesk.Viewing.Private,i=this.viewer.prefs.get(t.Prefs.DISPLAY_UNITS);let n=this.viewer.prefs.get(t.Prefs.DISPLAY_UNITS_PRECISION);const r=Object.prototype.hasOwnProperty.call(e.map,"Name")?e.map.Name.map((e=>e.displayValue)):[];function o(e,t){const r=Number(e);e=isNaN(r)?e:r;var o="number"==typeof n?n:t.precision||(0,s.calculatePrecision)(e),a=(0,s.convertToDisplayUnits)(e,t.type,t.units,i);return(0,s.formatValueWithUnits)(a.displayValue,a.displayUnits,t.type,o)}const c=e.getValue2PropertiesMap("Name");if(c){const e=Object.keys(c);if(1===e.length){const t=e[0],i={name:"aggregate-name"};this.tree.createElement_({name:"Name",value:t,type:"property",category:"",css:i},this.tree.myRootContainer)}else{const e={name:"Name",type:"category",value:"Varies"},t=this.tree.createElement_(e,this.tree.myRootContainer);this.setCategoryCollapsed(e,!0);for(let e in c)this.tree.createElement_({name:e,value:"",type:"property",category:"Name"},t)}}let h=e.getKeysWithCategories().length>0;e.forEach(((t,i)=>{if("Name"===t)return;const n=e.getAggregation(t),s=e.getValue2PropertiesMap(t);if(!n&&!s)return;const c=i[0];if(c.hidden)return;const u=!!c.displayCategory;let d,p="";if(u)p=c.displayCategory,d=this.tree.getElementForNode({name:p}),d=d||this.tree.createElement_({name:p,type:"category"},this.tree.myRootContainer);else if(h){if(p="Other",d=this.tree.getElementForNode({name:p}),!d){let e=p;d=this.tree.createElement_({name:e,type:"category"},this.tree.myRootContainer);const t=d.children[0].children[1];t.setAttribute("data-i18n",e),e=a.Z.t(e),t.textContent=e,t.title=e}}else d=this.tree.myRootContainer;const f=Object.keys(s);if(1===f.length){let e=f[0];return e=(0,l.OY)(i[0].type)?o(Number(e),c):e,void(d=this.tree.createElement_({name:c.displayName,value:e,type:"property",category:p,css:{name:"aggregate-name"}},d))}const m={name:c.displayName,value:"Varies",type:"category",category:p};if(d=this.tree.createElement_(m,d),this.setCategoryCollapsed(m,!0),p=c.displayName,(u||h)&&d.classList.add("indented"),n){const e={};for(let t in n){if("count"===t){e[t]=n[t];continue}if("mode"===t){e[t]=n[t].map((e=>o(e,c))).join(", ");continue}const i=n[t];e[t]=o(i,c)}this.tree.createElement_({map:e,default:"sum",type:"property",category:p},d)}const g=[];for(let e in s){const t=o(e,c),i=s[e];for(let e=0;e<i.length;++e){const t=r.indexOf(i[e]);t>-1&&r.splice(t,1)}g.push({name:i,value:t,type:"property",category:p})}r.length>0&&this.tree.createElement_({name:r,value:"--",type:"property",category:p},d),g.forEach((e=>{this.tree.createElement_(e,d)}))}))},c.prototype.setProperties=function(e){this.removeAllProperties();var t=[],i=[];for(let r=0;r<e.length;r++){let o=e[r];if(!o.hidden){var n=e[r].displayCategory;n&&"string"==typeof n&&""!==n?t.push(o):i.push(o)}}if(t.length+i.length===0)return void this.showNoProperties();i[0]&&"Name"===i[0].displayName&&(this.addProperty(i[0].displayName,i[0].displayValue),i.shift());const r=Autodesk.Viewing.Private,o=this.viewer.prefs.get(r.Prefs.DISPLAY_UNITS);let a=this.viewer.prefs.get(r.Prefs.DISPLAY_UNITS_PRECISION);for(let e=0;e<t.length;e++){let i=t[e],n="number"==typeof a?a:i.precision||(0,s.calculatePrecision)(i.displayValue),r=(0,s.convertToDisplayUnits)(i.displayValue,i.type,i.units,o),l=(0,s.formatValueWithUnits)(r.displayValue,r.displayUnits,i.type,n);this.addProperty(i.displayName,l,i.displayCategory)}for(var l=t.length>0,c=0;c<i.length;c++){let e=i[c],t="number"==typeof a?a:e.precision||(0,s.calculatePrecision)(e.displayValue),n=(0,s.convertToDisplayUnits)(e.displayValue,e.type,e.units,o),r=(0,s.formatValueWithUnits)(n.displayValue,n.displayUnits,e.type,t);this.addProperty(e.displayName,r,l?"Other":"",l?{localizeCategory:!0}:{})}},c.prototype.showNoProperties=function(){this.removeAllProperties();var e=this.tree.myRootContainer,t=this.getDocument().createElement("div");t.className="no-properties";var i="No properties to display";t.setAttribute("data-i18n",i),t.textContent=a.Z.t(i),e.appendChild(t)},c.prototype.showDefaultProperties=function(){this.showNoProperties(),this.resizeToContent()},c.prototype.areDefaultPropertiesShown=function(){return!this.hasProperties()},c.prototype.addProperty=function(e,t,i,n){if(this.tree.getElementForNode({name:e,value:t,category:i}))return!1;var r=null,o={name:e,value:t,type:"property"};return i?((r=this.tree.getElementForNode({name:i}))||(r=this.tree.createElement_({name:i,type:"category"},this.tree.myRootContainer,n&&n.localizeCategory?{localize:!0}:null)),o.category=i):r=this.tree.myRootContainer,this.tree.createElement_(o,r,n&&n.localizeProperty?{localize:!0}:null),!0},c.prototype.hasProperties=function(){for(var e in this.highlightableElements)return!0;return!1},c.prototype.removeProperty=function(e,t,i){var n={name:e,value:t,category:i},r=this.tree.getElementForNode(n);return!!r&&(delete this.highlightableElements[this.tree.delegate().getTreeNodeId(n)],r.parentNode.removeChild(r),!0)},c.prototype.removeAllProperties=function(){this.highlightableElements={},this.tree.clear()},c.prototype.setCategoryCollapsed=function(e,t){var i=this.tree.delegate().getTreeNodeId(e);this.tree.setCollapsed(i,t)},c.prototype.isCategoryCollapsed=function(e){var t=this.tree.delegate().getTreeNodeId(e);return this.tree.isCollapsed(t)},c.prototype.getContentSize=function(){var e=this.tree.myRootContainer;return{height:e.clientHeight+55,width:e.clientWidth}},c.prototype.highlight=function(e){function t(t){var i=t.innerHTML,n=i.replace(/(<highlight>|<\/highlight>)/gim,"");if(i!==n&&(t.innerHTML=n),e&&""!==e){var r=new RegExp("(\\b"+e+"\\b)","gim"),o=n.replace(r,"<highlight>$1</highlight>");t.innerHTML=o}}for(var i in this.highlightableElements)for(var n=this.highlightableElements[i],r=0;r<n.length;++r)t(n[r])},c.prototype.displayCategory=function(e,t,i){var n=this.getDocument(),r=n.createElement("div"),o=e.name;i&&i.localize&&(r.setAttribute("data-i18n",o),o=a.Z.t(o)),r.textContent=o,r.title=o,r.className="category-name",t.appendChild(r);const s=[r];if(e.value){var l=n.createElement("div");l.textContent=e.value;var c=e.value;l.title=c,c=h(c),l.innerHTML=c,l.className="category-value",t.appendChild(l),s.push(l)}return s},c.prototype.displayProperty=function(e,t,i){var n,r=this.getDocument(),o=r.createElement("div");if(o.className="separator",e.map){n=r.createElement("select");for(let t in e.map){var s=r.createElement("option");s.value=t,t=t.charAt(0).toUpperCase()+t.slice(1),s.setAttribute("data-i18n",t),s.textContent=a.Z.t(t),n.add(s)}n.value=e.default,e.value=e.map[e.default],n.className="property-drop-down",o.innerText="="}else{n=r.createElement("div");var l=e.name;i&&i.localize&&(n.setAttribute("data-i18n",l),l=a.Z.t(l)),n.textContent=l,n.title=l,n.className="property-name"}var c=r.createElement("div");c.textContent=e.value;var u=e.value;c.title=u,u=h(u),c.innerHTML=u,c.className="property-value",e.map&&n.addEventListener("change",(t=>{const i=t.target.value,n=e.map[i];c.title=n,c.innerHTML=n}),!1);const d=e.css;return d&&(d.name&&n.classList.add(d.name),d.value&&c.classList.add(d.value)),t.appendChild(n),t.appendChild(o),t.appendChild(c),[n,c]},c.prototype.getCategoryClass=function(){return"category"},c.prototype.getPropertyClass=function(){return"property"},c.prototype.onCategoryClick=function(e){this.setCategoryCollapsed(e,!this.isCategoryCollapsed(e))},c.prototype.onPropertyClick=function(){},c.prototype.onCategoryIconClick=function(e){this.setCategoryCollapsed(e,!this.isCategoryCollapsed(e))},c.prototype.onPropertyIconClick=function(){},c.prototype.onCategoryDoubleClick=function(){},c.prototype.onPropertyDoubleClick=function(){},c.prototype.onCategoryRightClick=function(){},c.prototype.onPropertyRightClick=function(){}},58847:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RenderOptionsPanel:()=>l});var n=i(94577),r=i(33423),o=i(16840),s=i(79976),a=i(34345);function l(e){var t=this;this.viewer=e,this.setGlobalManager(e.globalManager),n.DockingPanel.call(this,e.container,"RenderOptionsPanel","Rendering Options");let i=this.getDocument();this.table=i.createElement("table"),this.table.className="adsk-lmv-tftable",this.tbody=i.createElement("tbody"),this.table.appendChild(this.tbody),this.createScrollContainer({heightAdjustment:70}),this.scrollContainer.appendChild(this.table),this.container.style.width="320px",this.container.style.top="260px",this.container.style.left="220px",this.container.style.height="460px",this.container.dockRight=!0,this.saoToggle=new s.OptionCheckbox("AO Enabled",this.tbody,!0),this.saoToggle.setGlobalManager(this.globalManager),this.addEventListener(this.saoToggle,"change",(function(i){var n=t.saoToggle.checked;e.prefs.set("ambientShadows",n),e.setQualityLevel(n,e.impl.renderer().settings.antialias)})),this.saoRadius=new s.OptionSlider("AO Radius",0,200,this.tbody),this.saoRadius.setGlobalManager(this.globalManager),this.saoRadius.setValue(10),this.saoRadius.sliderElement.step=this.saoRadius.stepperElement.step=.01,this.addEventListener(this.saoRadius,"change",(function(i){e.impl.renderer().setAOOptions(parseFloat(t.saoRadius.value),parseFloat(t.saoIntensity.value)),e.impl.renderer().composeFinalFrame()})),this.saoIntensity=new s.OptionSlider("AO Intensity",0,3,this.tbody),this.saoIntensity.setGlobalManager(this.globalManager),this.saoIntensity.setValue(.4),this.saoIntensity.sliderElement.step=this.saoIntensity.stepperElement.step=.01,this.addEventListener(this.saoIntensity,"change",(function(i){e.impl.renderer().setAOOptions(parseFloat(t.saoRadius.value),parseFloat(t.saoIntensity.value)),e.impl.renderer().composeFinalFrame()})),this.groundShadowAlpha=new s.OptionSlider("Shadow Alpha",0,2,this.tbody),this.groundShadowAlpha.setGlobalManager(this.globalManager),this.groundShadowAlpha.setValue(1),this.groundShadowAlpha.sliderElement.step=this.groundShadowAlpha.stepperElement.step=.1,this.addEventListener(this.groundShadowAlpha,"change",(function(i){e.setGroundShadowAlpha(parseFloat(t.groundShadowAlpha.value))})),this.groundShadowColor=new s.OptionCheckbox("Shadow Color",this.tbody),this.groundShadowColor.setGlobalManager(this.globalManager),o.isIE11||(this.groundShadowColor.checkElement.value="#000000",this.groundShadowColor.checkElement.type="color"),this.addEventListener(this.groundShadowColor,"change",(function(i){var n=t.groundShadowColor.checkElement.value;e.setGroundShadowColor(new THREE.Color(parseInt(n.substr(1,7),16)))})),this.groundReflectionAlpha=new s.OptionSlider("Reflection Alpha",0,2,this.tbody),this.groundReflectionAlpha.setGlobalManager(this.globalManager),this.groundReflectionAlpha.setValue(1),this.groundReflectionAlpha.sliderElement.step=this.groundReflectionAlpha.stepperElement.step=.1,this.addEventListener(this.groundReflectionAlpha,"change",(function(i){e.setGroundReflectionAlpha(parseFloat(t.groundReflectionAlpha.value))})),this.groundReflectionColor=new s.OptionCheckbox("Reflection Color",this.tbody),this.groundReflectionColor.setGlobalManager(this.globalManager),o.isIE11||(this.groundReflectionColor.checkElement.value="#000000",this.groundReflectionColor.checkElement.type="color"),this.addEventListener(this.groundReflectionColor,"change",(function(i){var n=t.groundReflectionColor.checkElement.value;e.setGroundReflectionColor(new THREE.Color(parseInt(n.substr(1,7),16)))}));for(var l=[],c=0;c<a.LightPresets.length;c++)l.push(a.LightPresets[c].name);this.envSelect=new s.OptionDropDown("Environment",this.tbody,l,e.impl.currentLightPreset()),this.envSelect.setGlobalManager(this.globalManager),this.addEventListener(this.envSelect,"change",(function(i){var n=t.envSelect.selectedIndex;e.setLightPreset(n)}));var h=e.impl.renderer().getToneMapMethod();this.toneMapMethod=new s.OptionDropDown("Tonemap Method",this.tbody,["None","Canon-Lum","Canon-RGB"],h),this.toneMapMethod.setGlobalManager(this.globalManager),this.addEventListener(this.toneMapMethod,"change",(function(){var i=t.toneMapMethod.selectedIndex;e.impl.setTonemapMethod(i)})),this.exposureBias=new s.OptionSlider("Exposure Bias",-30,30,this.tbody),this.exposureBias.setGlobalManager(this.globalManager),this.exposureBias.setValue(e.impl.renderer().getExposureBias()),this.exposureBias.sliderElement.step=this.exposureBias.stepperElement.step=.1,this.addEventListener(this.exposureBias,"change",(function(i){e.impl.setTonemapExposureBias(t.exposureBias.value,t.whiteScale.value)})),this.exposureBias.setDisabled(0==h),this.whiteScale=new s.OptionSlider("Light Intensity",-5,20,this.tbody),this.whiteScale.setGlobalManager(this.globalManager);var u=0;e.impl.dir_light1&&(u=0!=e.impl.dir_light1.intensity?Math.log(e.impl.dir_light1.intensity)/Math.log(2):-1e-20),this.whiteScale.setValue(u),this.whiteScale.sliderElement.step=this.whiteScale.stepperElement.step=.1,this.addEventListener(this.whiteScale,"change",(function(i){e.impl.dir_light1.intensity=Math.pow(2,t.whiteScale.value),e.impl.setTonemapExposureBias(t.exposureBias.value,t.whiteScale.value)})),this.fovAngle=new s.OptionSlider("FOV-degrees",6.88,100,this.tbody),this.fovAngle.setGlobalManager(this.globalManager),this.fovAngle.setValue(e.getFOV()),this.addEventListener(this.fovAngle,"change",(function(i){e.setFOV(parseFloat(t.fovAngle.value))})),this.frameRate=new s.OptionSlider("Frame rate:",1,100,this.tbody),this.frameRate.setGlobalManager(this.globalManager),this.frameRate.setValue(e.impl.getFrameRate()),this.frameRate.sliderElement.step=this.frameRate.stepperElement.step=1,this.addEventListener(this.frameRate,"change",(function(i){e.impl.setFrameRate(t.frameRate.value)})),this.addEventListener(this.viewer,r.CAMERA_CHANGE_EVENT,(function(i){var n=parseFloat(t.fovAngle.value),r=e.getFOV();n!=r&&t.fovAngle.setValue(r)})),this.addEventListener(this.viewer,r.RENDER_OPTION_CHANGED_EVENT,(function(e){t.syncUI()})),this.addEventListener(this.viewer,r.VIEWER_STATE_RESTORED_EVENT,(function(e){t.syncUI()})),this.addVisibilityListener((function(e){e&&t.resizeToContent()}))}l.prototype=Object.create(n.DockingPanel.prototype),l.prototype.constructor=l,l.prototype.getContentSize=function(){return{height:this.table.clientHeight+75,width:this.table.clientWidth}},l.prototype.syncUI=function(){var e=this.viewer.impl,t=0;e.dir_light1&&(t=0!=e.dir_light1.intensity?Math.log(e.dir_light1.intensity)/Math.log(2):-1e-20),this.whiteScale.setValue(t),this.exposureBias.setValue(e.renderer().getExposureBias());var i=e.renderer().getToneMapMethod();this.toneMapMethod.setSelectedIndex(i),this.envSelect.setSelectedIndex(e.currentLightPreset()),this.exposureBias.setDisabled(0==i),this.saoToggle.setValue(e.renderer().getAOEnabled()),this.saoRadius.setDisabled(!e.renderer().getAOEnabled()),this.saoIntensity.setDisabled(!e.renderer().getAOEnabled()),this.saoRadius.setValue(e.renderer().getAORadius()),this.saoIntensity.setValue(e.renderer().getAOIntensity()),this.groundShadowAlpha.setDisabled(!this.viewer.prefs.get("groundShadow")),this.groundShadowColor.setDisabled(!this.viewer.prefs.get("groundShadow")),this.groundReflectionAlpha.setDisabled(!this.viewer.prefs.get("groundReflection")),this.groundReflectionColor.setDisabled(!this.viewer.prefs.get("groundReflection")),this.fovAngle.setValue(this.viewer.getFOV())},l.prototype.uninitialize=function(){n.DockingPanel.prototype.uninitialize.call(this),this.table=null,this.tbody=null,this.saoToggle=null,this.saoRadius=null,this.saoIntensity=null,this.groundShadowAlpha=null,this.envSelect=null,this.toneMapMethod=null,this.exposureBias=null,this.whiteScale=null,this.fovAngle=null,this.viewer=null}},47710:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SettingsPanel:()=>a});var n=i(94577),r=i(71224),o=i(16840),s=i(79976);function a(e,t,i,r){n.DockingPanel.call(this,e,t,i,r),this.panelTabs=[],this.tabIdToIndex={},this.controls={},this.controlIdCount=0,this.shown=!1;var o=this,s=r&&void 0!==r.width?r.width:340;this.container.style.maxWidth="800px",this.container.style.minWidth=s+"px",this.container.style.top="10px",this.container.style.left=e.offsetWidth/2-170+"px",this.container.style.position="absolute";var a=this.getDocument();this.tabContainer=a.createElement("div"),this.tabContainer.classList.add("docking-panel-container-solid-color-b"),this.tabContainer.classList.add("settings-tabs"),this.tabContainer.classList.add("docking-panel-delimiter-shadow"),this.container.appendChild(this.tabContainer),this.tabs=a.createElement("ul"),this.tabContainer.appendChild(this.tabs),this.heightAdjustment=r&&r.heightAdjustment?r.heightAdjustment:179,r&&r.hideTabBar&&(this.heightAdjustment-=40,this.tabContainer.style.display="none",this.tabContainer.style.height=0),this.createScrollContainer({left:!1,heightAdjustment:this.heightAdjustment,marginTop:0}),this.tablesContainer=a.createElement("div"),this.tablesContainer.classList.add("settings-tabs-tables-container"),r&&r.hideTabBar&&(this.scrollContainer.style.top="50px"),this.scrollContainer.appendChild(this.tablesContainer),this.mouseOver=!1,this.addEventListener(this.container,"mouseover",(function(e){var t=e.toElement||e.relatedTarget;if(o.mouseOver)return!0;for(var i=o.getWindow();t&&t.parentNode&&t.parentNode!=i;){if(t.parentNode==this||t==this){t.preventDefault&&t.preventDefault(),o.mouseOver=!0;for(var n=0;n<o.panelTabs.length;n++)o.panelTabs[n].classList.remove("selectedmouseout");return!0}t=t.parentNode}})),this.addEventListener(this.container,"mouseout",(function(e){var t=e.toElement||e.relatedTarget;if(o.mouseOver){for(var i=o.getWindow();t&&t.parentNode&&t.parentNode!=i;){if(t.parentNode==this||t==this)return t.preventDefault&&t.preventDefault(),!1;t=t.parentNode}o.mouseOver=!1;for(var n=0;n<o.panelTabs.length;n++)o.panelTabs[n].classList.contains("tabselected")&&o.panelTabs[n].classList.add("selectedmouseout")}})),this.expandID=function(e){return t+"-"+e}}a.prototype=Object.create(n.DockingPanel.prototype),a.prototype.constructor=a,a.prototype.setVisible=function(e){e&&(this.container.style.display="block",this.shown||(this.resizeToContent(),this.container.style.left=this.parentContainer.offsetWidth/2-this.container.getBoundingClientRect().width/2+"px"),this.shown=!0),n.DockingPanel.prototype.setVisible.call(this,e)},a.prototype.addTab=function(e,t,i){var n=this;if(void 0!==this.tabIdToIndex[e])return!1;var s=i&&void 0!==i.className?i.className:null,a=i&&void 0!==i.width?i.width:200,l=i&&void 0!==i.index?i.index:this.panelTabs.length;var c=this.getDocument(),h=c.createElement("li");h._id=e,h.id=this.expandID(h._id),h.classList.add(s);var u=c.createElement("a"),d=c.createElement("span");d.setAttribute("data-i18n",t),d.textContent=r.Z.t(t),u.appendChild(d),h.appendChild(u),this.tabs.appendChild(h);var p=c.createElement("table");p._id=e+"-table",p.id=this.expandID(p._id),p.classList.add("settings-table"),p.classList.add("adsk-lmv-tftable"),p.classList.add(s);var f=c.createElement("tbody");return f.style.display="table",f.style.width="100%",p.appendChild(f),this.tablesContainer.appendChild(p),this.addEventListener(h,"touchstart",o.touchStartToClick),this.addEventListener(h,"click",(function(){n.selectTab(e)})),this.panelTabs.push(h),this.tabIdToIndex[e]=l,a>(this.container.style.minWidth?parseInt(this.container.style.minWidth):0)&&(this.container.style.minWidth=a+"px"),!0},a.prototype.removeTab=function(e){var t=this.tabIdToIndex[e];if(!t)return!1;this.panelTabs.splice(t,1);var i=this.getDocument().getElementById(this.expandID(e));this.tabs.removeChild(i),this.tabIdToIndex={};for(var n=this.panelTabs.length,r=0;r<n;r++){var s=this.panelTabs[r];this.tabIdToIndex[s._id]=r,this.removeEventListener(s,"touchstart",o.touchStartToClick)}return!0},a.prototype.resizeTabs=function(){for(var e=this.tabs.getElementsByTagName("li"),t=100/e.length,i=0;i<e.length;i++)e[i].style.width=t+"%"},a.prototype.hasTab=function(e){var t=this.tabIdToIndex[e];return void 0!==this.panelTabs[t]},a.prototype.selectTab=function(e){if(this.isTabSelected(e))return!1;for(var t=this.getDocument(),i=this.panelTabs.length,n=0;n<i;n++){var r=this.panelTabs[n],o=t.getElementById(this.expandID(r._id+"-table"));e===r._id?(r.classList.add("tabselected"),o.classList.add("settings-selected-table"),this.mouseOver||r.classList.add("selectedmouseout")):(r.classList.remove("tabselected"),o.classList.remove("settings-selected-table"),this.mouseOver||this.panelTabs[n].classList.remove("selectedmouseout"))}return this.scrollContainer.scrollTop=0,!0},a.prototype.isTabSelected=function(e){var t=this.tabIdToIndex[e],i=this.panelTabs[t];return i&&i.classList.contains("tabselected")},a.prototype.getSelectedTabId=function(){for(var e in this.tabIdToIndex)if(this.isTabSelected(e))return e;return null},a.prototype.addLabel=function(e,t){var i,n=this.tabIdToIndex[e];if(-1===n)return!1;i=this.tablesContainer.childNodes[n];var r=new s.OptionLabel(t,i.tBodies[0]);return r.setGlobalManager(this.globalManager),r.sliderRow.classList.add("logical-group"),r},a.prototype.addButton=function(e,t){var i=this.tabIdToIndex[e];if(void 0===i)return null;var n=this.tablesContainer.childNodes[i],r=new s.OptionButton(t,n.tBodies[0]);return r.setGlobalManager(this.globalManager),this.addControl(e,r)},a.prototype.addCheckbox=function(e,t,i,n,r,o){var a=this.tabIdToIndex[e];if(void 0===a)return null;var l=this.tablesContainer.childNodes[a],c=new s.OptionCheckbox(t,l.tBodies[0],i,r,o);return c.setGlobalManager(this.globalManager),c.changeListener=function(e){var t=e.detail.target.checked;n(t)},this.addEventListener(c,"change",c.changeListener),this.addControl(e,c)},a.prototype.addRow=function(e,t,i,n){if(void 0===this.tabIdToIndex[e])return null;var r=this.getDocument().getElementById(this.expandID(e+"-table")),o=new s.OptionRow(t,r.tBodies[0],i,n);return o.setGlobalManager(this.globalManager),this.addControl(e,o)},a.prototype.addSlider=function(e,t,i,n,r,o,a){if(void 0===this.tabIdToIndex[e])return null;var l=this.getDocument().getElementById(this.expandID(e+"-table")),c=new s.OptionSlider(t,i,n,l.tBodies[0],a);c.setGlobalManager(this.globalManager),c.setValue(r);var h=1;return a&&a.step&&(h=a.step),c.sliderElement.step=c.stepperElement.step=h,this.addEventListener(c,"change",(function(e){o(e)})),this.addControl(e,c)},a.prototype.addSliderV2=function(e,t,i,n,r,o,s,a){(a=a||{}).hideStepper=!0,a.hideCaption=!0;const l=[];return l.push(this.addRow(e,t,i,a)),l.push(this.addSlider(e,t,n,r,o,s,a)),l},a.prototype.addDropDownMenu=function(e,t,i,n,r,o){if(void 0===this.tabIdToIndex[e])return null;var a=this.getDocument().getElementById(this.expandID(e+"-table")),l=new s.OptionDropDown(t,a.tBodies[0],i,n,null,this.globalManager,o);return l.setGlobalManager(this.globalManager),this.addEventListener(l,"change",(function(e){r(e)})),this.addControl(e,l)},a.prototype.addControl=function(e,t,i){if(void 0===this.tabIdToIndex[e])return null;if(!Object.prototype.hasOwnProperty.call(t,"sliderRow")){var n=i&&i.insertAtIndex?i.insertAtIndex:-1,o=i&&i.caption?i.caption:null,s=this.getDocument(),a=s.getElementById(this.expandID(e+"-table"));n>a.length&&(n=-1);var l=a.tBodies[0].insertRow(n),c=l.insertCell(0);if(o){var h=s.createElement("div");h.setAttribute("data-i18n",o),h.textContent=r.Z.t(o),c.appendChild(h),c=l.insertCell(1)}else c.colSpan=3;c.appendChild(t),t.sliderRow=l,t.tbody=a.tBodies[0]}var u=this.expandID("adsk_settings_control_id_"+this.controlIdCount.toString());return this.controlIdCount=this.controlIdCount+1,this.controls[u]=t,t.parent=this,u},a.prototype.removeButton=function(e){return this.removeControl(e)},a.prototype.removeCheckbox=function(e){return this.removeControl(e)},a.prototype.removeSlider=function(e){return this.removeControl(e)},a.prototype.removeDropdownMenu=function(e){return this.removeControl(e)},a.prototype.removeControl=function(e){var t;if("object"==typeof e&&e.tbody){for(var i in t=e,this.controls)if(this.controls[i]===t){e=i;break}}else t=this.controls[e];if(void 0===t)return!1;if(t.removeFromParent)t.removeFromParent();else{var n=t.tbody,r=t.sliderRow.rowIndex;n.deleteRow(r)}return delete this.controls[e],t.parent=void 0,!0},a.prototype.getControl=function(e){return this.controls[e]||null},a.prototype.getContentSize=function(){for(var e=this.heightAdjustment,t=0,i=this.getDocument(),n=0;n<this.panelTabs.length;n++){var r=this.panelTabs[n],o=i.getElementById(this.expandID(r._id+"-table")),s=o?o.clientHeight:0;t=Math.max(t,s)}return{height:e+t,width:this.container.clientWidth}},a.prototype.sizeToContent=function(e){var t=this.getContentSize().height+this.heightAdjustment,i=e.clientHeight-this.heightAdjustment,n=Math.min(t,i);this.container.style.height=parseInt(n)+"px"},a.prototype.addSimpleList=function(e,t,i){var n=new s.SimpleList(e,t,i);return n.setGlobalManager(this.globalManager),n},a.prototype.removeSimpleList=function(e){return!!e&&(e.removeFromParent(),!0)}},19742:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Tree:()=>a});var n=i(16840),r=i(30126),o=i(27293);const s=i(35255);function a(e,t,i,n){this.myDelegate=e,this.mySelectedNodes=[],this.myOptions=n||{},this.parentContainer=i;this.groupClassName=this.myOptions.groupClassName||"expanded",this.leafClassName=this.myOptions.leafClassName||"expanded",this.selectedClassName=this.myOptions.selectedClassName||"selected",this.myGroupNodes=[],this.nodeToElement={},this.nodeIdToNode={};var r=this.myRootContainer=this.createHtmlElement_(i,"div","treeview"),o=this.rootElem=this.createElement_(t,r,n,0);this.setInputHandlers_(),n&&n.excludeRoot&&o.classList.add("exclude")}a.prototype.constructor=a,o.GlobalManagerMixin.call(a.prototype),a.prototype.destroy=function(){this.myDelegate=null,this.parentContainer&&(this.parentContainer.removeChild(this.myRootContainer),this.myRootContainer=null,this.parentContainer=null)},a.prototype.show=function(e){var t=this.myRootContainer;t.style.display=e?"block":"none"},a.prototype.getRootContainer=function(){return this.myRootContainer},a.prototype.getElementForNode=function(e){return"number"!=typeof e&&"string"!=typeof e&&(e=this.myDelegate.getTreeNodeId(e)),this.nodeToElement[e]},a.prototype.delegate=function(){return this.myDelegate},a.prototype.isCollapsed=function(e){return this.hasClass(e,"collapsed")},a.prototype.setCollapsed=function(e,t,i){t?(this.addClass(e,"collapsed",i),this.removeClass(e,"expanded",i)):(this.addClass(e,"expanded",i),this.removeClass(e,"collapsed",i))},a.prototype.setAllCollapsed=function(e){var t,i;e?(t=function(e){return e.classList.contains("expanded")},i=function(e){e.classList.add("collapsed"),e.classList.remove("expanded")}):(t=function(e){return e.classList.contains("collapsed")},i=function(e){e.classList.add("expanded"),e.classList.remove("collapsed")});for(var n=0;n<this.myGroupNodes.length;++n){var r=this.myGroupNodes[n];t(r)&&i(r)}},a.prototype.addToSelection=function(e){var t=this;function i(e){return-1===t.mySelectedNodes.indexOf(e)&&(t.mySelectedNodes.push(e),!0)}for(var n=e.length,r=0;r<n;++r){var o=e[r];i(o)&&this.addClass(o,this.selectedClassName)}},a.prototype.removeFromSelection=function(e){var t=this;function i(e){var i=t.mySelectedNodes.indexOf(e);return-1!==i&&(t.mySelectedNodes.splice(i,1),!0)}for(var n=e.length-1;n>=0;--n){var r=e[n];i(r)&&this.removeClass(r,this.selectedClassName)}},a.prototype.setSelection=function(e){return this.removeFromSelection(this.mySelectedNodes),this.addToSelection(e),this.mySelectedNodes},a.prototype.getSelection=function(){return this.mySelectedNodes.concat()},a.prototype.clearSelection=function(){this.removeFromSelection(this.mySelectedNodes)},a.prototype.isSelected=function(e){return this.hasClass(e,this.selectedClassName)},a.prototype.scrollTo=function(e){var t=this.getElementForNode(e);if(t){var i=t.offsetTop;for(t=t.parentNode;t&&t!=this.myRootContainer;)i+=t.offsetTop,t=t.parentNode;var n=this.myRootContainer.parentNode;this.myDelegate.getScrollContainer()&&(n=this.myDelegate.getScrollContainer()),n.scrollTop=i}},a.prototype.addClass=function(e,t,i){var n=this.getElementForNode(e);if(n){if(i){n=n.parentNode;for(var r=this.myOptions.excludeRoot?this.rootElem:this.myRootContainer;n&&n!==r;)n.classList.add(t),n=n.parentNode}else n.classList.add(t);return!0}return!1},a.prototype.removeClass=function(e,t,i){var n=this.getElementForNode(e);if(n){if(i){n=n.parentNode;for(var r=this.myOptions.excludeRoot?this.rootElem:this.myRootContainer;n&&n!==r;)n.classList.remove(t),n=n.parentNode}else n.classList.remove(t);return!0}return!1},a.prototype.hasClass=function(e,t){return this.getElementForNode(e).classList.contains(t)},a.prototype.clear=function(){for(var e=this.myRootContainer;e.hasChildNodes();)e.removeChild(e.lastChild);this.nodeToElement={},this.nodeIdToNode={}},a.prototype.createElement_=function(e,t,i,n){if(null==e)return null;if(!this.myDelegate.shouldCreateTreeNode(e))return null;var r,o=this;function s(t,r,s,a){var l=o.createHtmlElement_(t,r,s),c=o.myDelegate.getTreeNodeId(a);l.setAttribute("lmv-nodeId",c);var h=o.createHtmlElement_(l,"lmvheader"),u=o.createHtmlElement_(h,"icon");return u.addEventListener("mousedown",(function(e){e.stopPropagation(),e.preventDefault()}),!1),u.addEventListener("click",(function(t){o.myDelegate.onTreeNodeIconClick(o,e,t),t.stopPropagation(),t.preventDefault()}),!1),o.myDelegate.createTreeNode(e,h,i,r,n),l}var a=this.myDelegate.getTreeNodeId(e),l=o.myOptions.excludeRoot?1:0;o.myDelegate.isTreeNodeGroup(e)?(r=s(t,"group",o.groupClassName,e),o.nodeToElement[a]=r,o.nodeIdToNode[a]=e,n==l&&(r.style.left="0px"),o.myGroupNodes.push(r),o.myDelegate.forEachChild(e,(function(e){o.createElement_(e,r,i,n+1)}))):(r=s(t,"leaf",o.leafClassName,e),o.nodeToElement[a]=r,o.nodeIdToNode[a]=e,n==l&&(r.style.marginLeft="0px"));var c=o.myDelegate.getTreeNodeClass(e);return c&&r.classList.add(c),r},a.prototype.setInputHandlers_=function(){var e=this,t=this.myRootContainer,i=null,o=function(n){var r=null,o=!1;do{n&&n!==t?n.hasAttribute("lmv-nodeId")?(r=n,o=!0):n=n.parentElement:(r=null,o=!0)}while(!o);if(r){var s=r.getAttribute("lmv-nodeId");return e.nodeIdToNode[s]||i}return i};(0,n.isTouchDevice)()&&(this.hammer=new s.Manager(t,{recognizers:[r.GestureRecognizers.doubletap,r.GestureRecognizers.press],handlePointerEventMouse:!1,inputClass:n.isIE11?s.PointerEventInput:s.TouchInput}),this.hammer.on("doubletap",(function(t){var n=o(t.target);n!==i&&e.myDelegate.onTreeNodeDoubleClick(e,n,t)})),this.hammer.on("press",(function(t){var n=o(t.target);n!==i&&e.myDelegate.onTreeNodeRightClick(e,n,t)}))),t.addEventListener("click",(function(t){var n=o(t.target);n!==i&&(e.myDelegate.onTreeNodeClick(e,n,t),t.stopPropagation(),t.target.classList.contains("propertyLink")||t.preventDefault())}),!1),t.addEventListener("dblclick",(function(t){var n=o(t.target);n!==i&&(e.myDelegate.onTreeNodeDoubleClick(e,n,t),t.stopPropagation(),t.preventDefault())}),!1),t.addEventListener("contextmenu",(function(t){var n=o(t.target);n!==i&&(e.myDelegate.onTreeNodeRightClick(e,n,t),t.stopPropagation(),t.preventDefault())}),!1),t.addEventListener("mouseover",(function(t){var n=o(t.target);n!==i&&(e.myDelegate.onTreeNodeHover(e,n,t),t.stopPropagation(),t.preventDefault())}),!1),t.addEventListener("mouseout",(function(t){var i=t.toElement||t.relatedTarget;if(o(t.target)!=o(i)){e.myDelegate.onTreeNodeHover(e,-1,t),t.stopPropagation(),t.preventDefault()}}),!1)},a.prototype.createHtmlElement_=function(e,t,i){var n=this.getDocument().createElement(t);return e.appendChild(n),i&&(n.className=i),n},a.prototype.iterate=function(e,t){if(null!=e&&this.myDelegate.shouldCreateTreeNode(e)){var i=this.getElementForNode(e);if(i){t(e,i);var n=this;this.myDelegate.forEachChild(e,(function(e){n.iterate(e,t)}))}}}},9178:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TreeDelegate:()=>r});var n=i(71224);function r(){}i(27293).GlobalManagerMixin.call(r.prototype),r.prototype.constructor=r,r.prototype.isTreeNodeGroup=function(e){throw"isTreeNodeGroup is not implemented."},r.prototype.getTreeNodeId=function(e){throw"getTreeNodeId is not implemented."},r.prototype.getTreeNodeIndex=function(e){throw"getTreeNodeIndex is not implemented."},r.prototype.getTreeNodeParentId=function(e){throw"getTreeNodeParentId is not implemented."},r.prototype.getTreeNodeLabel=function(e){return e.name},r.prototype.getTreeNodeCount=function(){throw"getTreeNodeCount is not implemented."},r.prototype.shouldCreateTreeNode=function(e){return!0},r.prototype.forEachChild=function(e,t){for(var i=e.children?e.children.length:0,n=0;n<i;++n){t(e.children[n])}},r.prototype.createTreeNode=function(e,t,i,r,o){var s=this.getDocument().createElement("label");t.appendChild(s);var a=this.getTreeNodeLabel(e);return i&&i.localize&&(s.setAttribute("data-i18n",a),a=n.Z.t(a)),s.textContent=a,s},r.prototype.onTreeNodeClick=function(e,t,i){},r.prototype.onTreeNodeIconClick=function(e,t,i){e.delegate().isTreeNodeGroup(t)&&e.setCollapsed(t,!e.isCollapsed(t))},r.prototype.onTreeNodeDoubleClick=function(e,t,i){},r.prototype.onTreeNodeRightClick=function(e,t,i){},r.prototype.onTreeNodeReized=function(e){},r.prototype.getTreeNodeClass=function(e){return""},r.prototype.getTreeNodeParentMaxSize=function(e){return{width:0,height:0}},r.prototype.getTreeNodeClientHeight=function(e){return 0},r.prototype.getTreeNodeDepthOffset=function(e,t){return 0},r.prototype.onTreeNodeHover=function(e,t,i){},r.prototype.getScrollContainer=function(){return null}},63988:(e,t,i)=>{"use strict";i.r(t),i.d(t,{TreeOnDemand:()=>h});var n=i(16840),r=i(30126),o=i(95420),s=i(71224),a=i(27293);const l=i(35255);var c=300;function h(e,t){this.dirty=!1,this.nextFrameId=0,this.scrollY=0,this.delegates=[],this.idToDelegate={},this.options=t;var i=this.getDocument();this.rootContainer=i.createElement("div"),this.rootContainer.classList.add("docking-panel-container-gradient"),this.rootContainer.classList.add("treeview"),this.rootContainer.classList.add("on-demand"),e.appendChild(this.rootContainer),this.paddingDiv=i.createElement("div"),this.paddingDiv.style.border=0,this.paddingDiv.style.margin=0,this.paddingDiv.style.padding=0,this.sizedDiv=e.parentNode,this.nodeCssTable=[[],["group"],["leaf"]],this.cssStringToNodeCssTable={"":0,group:1,leaf:2},this.nodeIndexToNodeCssTables={};for(var s=[],a=0;a<150;++a){var c=x(i);s[a]=c}this.elementsPool=s,this.elementsUsed=0,this.spinner=new o.LoadingSpinner(e),this.spinner.setGlobalManager(this.globalManager),this.spinner.addClass("tree-loading-spinner");var h=(0,n.isTouchDevice)();h&&(this.hammer=new l.Manager(this.rootContainer,{recognizers:[r.GestureRecognizers.doubletap,r.GestureRecognizers.press],handlePointerEventMouse:!1,inputClass:n.isIE11?l.PointerEventInput:l.TouchInput}));for(a=0;a<150;++a){c=s[a];h&&(this.hammer.on("doubletap",_.bind(this)),this.hammer.on("press",E.bind(this))),c.addEventListener("click",A.bind(this)),c.addEventListener("dblclick",S.bind(this)),c.addEventListener("contextmenu",w.bind(this)),c.icon.addEventListener("click",M.bind(this)),c.icon.addEventListener("mousedown",T.bind(this))}f(this)}var u=h.prototype;function d(e){if(e.dirty=!1,function(e){for(var t=e.elementsUsed,i=e.elementsPool,n=0;n<t;++n){var r=i[n];r.setAttribute("lmv-nodeId",""),r.className="";for(var o=r.header,s=o.childNodes.length-1,a=0;a<s;++a)o.removeChild(o.lastChild)}e.clear()}(e),e.displayNoProperties(!1),0!==e.delegates.length)if(1===e.delegates.length&&e.delegates[0].isLoading())e.spinner.setVisible(!0);else{if(1===e.delegates.length&&e.delegates[0].isNotAvailable())return e.spinner.setVisible(!1),void e.displayNoProperties(!0);e.spinner.setVisible(!1),function(e){var t=e.rootContainer,i=function(e){return{width:0|e.sizedDiv.clientWidth,height:0|e.sizedDiv.clientHeight}}(e).height,n=0,r=0,o=!0;t.appendChild(e.paddingDiv);var s=e.delegates.slice(0),a=e.isExcludeRoot();for(;s.length;){var l=s.shift(),h=l.modelDiv;t.appendChild(h);for(var u=[l.getRootId()],d={curr:a?-1:0,popIds:[]};u.length&&o;){if(n>e.scrollY+i+c){o=!1;break}if(e.elementsUsed===e.elementsPool.length){o=!1;break}var f=u.shift(),m=n+(w=-1===d.curr?0:l.getTreeNodeClientHeight(f));if(w>0&&m+c>=e.scrollY){var g=e.elementsPool[e.elementsUsed++];g.setAttribute("lmv-nodeId",f),l.createTreeNode(f,g.header);var v=l.getTreeNodeClass(f);v&&g.classList.add(v);var b=y(e,l,f);if(b)for(var x=b.length,_=0;_<x;++_)g.classList.add(b[_]);var E=l.getTreeNodeDepthOffset(f,d.curr);g.header.style.paddingLeft=E+"px",h.appendChild(g)}if(m+c<e.scrollY&&(r=m),n=m,(M=p(e,l,f,0===w))&&M.length>0){d.curr++;for(var A=M[M.length-1],S=d.popIds.length-1;S>=0&&d.popIds[S]===f;)d.popIds[S--]=A;d.popIds.push(A),u=M.concat(u)}for(;d.popIds.length>0&&f===d.popIds[d.popIds.length-1];)d.popIds.pop(),d.curr--}for(e.paddingDiv.style.height=r+"px";u.length;){var w,M;f=u.shift();n=m=n+(w=-1===d.curr?0:l.getTreeNodeClientHeight(f)),(M=p(e,l,f))&&M.length&&(u=M.concat(u))}}t.style.height=n+"px"}(e)}else e.spinner.setVisible(!1)}function p(e,t,i,n){if(!t.isTreeNodeGroup(i))return null;if(!n&&e.isCollapsed(t,i))return null;var r=[];return t.forEachChild(i,(function(e){r.push(e)})),r}function f(e,t){e.dirty&&!t||(t?d(e):(e.dirty=!0,e.nextFrameId=requestAnimationFrame((function(){d(e)}))))}function m(e,t){return"number"!=typeof t&&"string"!=typeof t?e.threeDelegate.getTreeNodeId(0|t):t}function g(e,t){for(var i=null;t&&t!==e.rootContainer;){if(t.hasAttribute("lmv-nodeId")){i=t;break}t=t.parentElement}if(!i)return null;var n=i.getAttribute("lmv-nodeId");return parseFloat(n)}function v(e,t){for(var i=null;t&&t!==e.rootContainer;){if(t.hasAttribute("lmv-modelId")){i=t;break}t=t.parentElement}if(!i)return null;var n=i.getAttribute("lmv-modelId");return parseInt(n)}function y(e,t,i){if(t.isControlId(i))return t.getControlIdCss(i);var n=t.getTreeNodeIndex(i);return e.nodeCssTable[e.nodeIndexToNodeCssTables[t.model.id][n]]}function b(e,t,i,n){var r=n.join(" "),o=e.cssStringToNodeCssTable[r]||e.nodeCssTable.length;o===e.nodeCssTable.length&&(e.nodeCssTable.push(n),e.cssStringToNodeCssTable[r]=o);var s=t.getTreeNodeIndex(i);e.nodeIndexToNodeCssTables[t.model.id][s]=o}function x(e,t,i){var n=e.createElement("lmvheader"),r=e.createElement("icon");n.appendChild(r);var o=e.createElement("div");return o.header=n,o.icon=r,o.appendChild(n),o}function _(e){var t=g(this,e.target);if(t){var i=v(this,e.target),n=this.getDelegate(i);n&&n.onTreeNodeDoubleClick(this,t,e)}}function E(e){var t=g(this,e.target);if(t){var i=v(this,e.target),n=this.getDelegate(i);n&&n.onTreeNodeRightClick(this,t,e)}}function A(e){if(!e.target.classList.contains("group")&&!e.target.classList.contains("leaf")){var t=g(this,e.target);if(t){var i=v(this,e.target),n=this.getDelegate(i);n&&(n.onTreeNodeClick(this,t,e),e.stopPropagation(),e.preventDefault())}}}function S(e){if(!e.target.classList.contains("group")&&!e.target.classList.contains("leaf")){var t=g(this,e.target);if(t){var i=v(this,e.target),n=this.getDelegate(i);n&&(n.onTreeNodeDoubleClick(this,t,e),e.stopPropagation(),e.preventDefault())}}}function w(e){if(!e.target.classList.contains("group")&&!e.target.classList.contains("leaf")){var t=g(this,e.target);if(t){var i=v(this,e.target),n=this.getDelegate(i);n&&(n.onTreeNodeRightClick(this,t,e),e.stopPropagation(),e.preventDefault())}}}function M(e){var t=g(this,e.target);if(t){var i=v(this,e.target),n=this.getDelegate(i);n&&(n.onTreeNodeIconClick(this,t,e),e.stopPropagation(),e.preventDefault())}}function T(e){e.stopPropagation(),e.preventDefault()}u.constructor=h,a.GlobalManagerMixin.call(u),u.pushDelegate=function(e){this.delegates.push(e),this.idToDelegate[e.model.id]=e,f(this)},u.removeDelegate=function(e){for(var t=0;t<this.delegates.length;++t){if(this.delegates[t].model.id===e)return this.delegates.splice(t,1),delete this.idToDelegate[e],delete this.nodeIndexToNodeCssTables[e],f(this),!0}return!1},u.setInstanceTree=function(e,t){if(e.setInstanceTree(t),f(this),t){var i=new Uint8Array(e.getTreeNodeCount()),n=e.instanceTree.getRootId();e.forEachChild(n,(function(t){var n=e.getTreeNodeIndex(t);i[n]=e.isTreeNodeGroup(t)?1:2}),!0);var r=e.model.id;this.nodeIndexToNodeCssTables[r]=i;var o=0,s=0;t.enumNodeChildren(n,(function(e){s||(o=e),s++})),this.setAllCollapsed(e,!0);var a=this.options.excludeRoot,l=this.options.startCollapsed;a?(this.setCollapsed(e,n,!1),l||this.setCollapsed(e,o,!1)):l||this.setCollapsed(e,e.rootId,!1),f(this,!0)}},u.show=function(e){this.rootContainer.style.display=block},u.getRootContainer=function(){return this.rootContainer},u.getDelegate=function(e){return this.idToDelegate[parseInt(e)]},u.isCollapsed=function(e,t){var i=y(this,e,t);return i&&-1!==i.indexOf("collapsed")},u.setCollapsed=function(e,t,i,n){i?(this.addClass(e,t,"collapsed",n),this.removeClass(e,t,"expanded",n)):(this.addClass(e,t,"expanded",n),this.removeClass(e,t,"collapsed",n))},u.setAllCollapsed=function(e,t){var i=function(t){this.addClass(e,t,"collapsed",!1),this.removeClass(e,t,"expanded",!1)}.bind(this),n=e.instanceTree.getRootId();this.iterate(e,n,(function(t){return e.isTreeNodeGroup(t)&&i(t),!0}))},u.addToSelection=function(e,t){for(var i=t.length,n=0;n<i;++n)this.addClass(e,t[n],"selected",!1);f(this)},u.removeFromSelection=function(e,t){for(var i=t.length,n=0;n<i;++n)this.removeClass(e,t[n],"selected",!1);f(this)},u.setSelection=function(e,t){return this.clearSelection(e),this.addToSelection(e,t),this.selectedNodes},u.clearSelection=function(e){var t=[],i=function(i){var n=y(this,e,i);n&&-1!==n.indexOf("selected")&&(t[0]=i,this.removeFromSelection(e,t))}.bind(this),n=e.instanceTree.getRootId();e.forEachChild(n,i,!0)},u.isSelected=function(e){var t=y(this,delegate,e);return t&&-1!==t.indexOf("selected")},u.scrollTo=function(e,t){var i=this.getDelegate(t.id);if(!i||!i.isNotAvailable()){var n=!1,r=[],o=function(t,i){if(!(n=n||e===t)){r.push(i.getTreeNodeClientHeight(t));var s=r.length,a=i.isTreeNodeGroup(t)&&-1!==y(this,i,t).indexOf("expanded");i.forEachChild(t,(function(e){o(e,i)})),a||n||r.length>s&&r.splice(s)}}.bind(this);this.setCollapsed(i,e,!1,!0);var s=i.getRootId();if(o(s,i),!n)return-1;for(var a=0,l=r.length,c=this.isExcludeRoot()?1:0;c<l;++c)a+=r[c];if(1===this.delegates.length)return f(this,!0),a;for(c=0;c<this.delegates.length;++c){var h=this.delegates[c];if(h===i)break;r=[],e=-1,n=!1,s=h.getRootId(),o(s,h),l=r.length;for(var u=0,d=0;d<l;++d)u+=r[d];a+=u}return f(this,!0),a}},u.addClass=function(e,t,i,n){function r(t,i,n){var r=y(t,e,i);r&&(-1===r.indexOf(n)&&((r=r.slice(0)).push(n),r.sort(),b(t,e,i,r)))}if(n)for(var o=e.getTreeNodeParentId(m(this,t));o;)r(this,o,i),o=e.getTreeNodeParentId(o);else r(this,t,i);return f(this),!0},u.removeClass=function(e,t,i,n){function r(t,i,n){var r=y(t,e,i);if(r){var o=r.indexOf(n);-1!==o&&((r=r.slice(0)).splice(o,1),b(t,e,i,r))}}if(n)for(var o=e.getTreeNodeParentId(m(this,t));o;)r(this,o,i),o=e.getTreeNodeParentId(o);else r(this,t,i);return f(this),!0},u.hasClass=function(e,t){return 1!==y(this,delegate,e).indexOf(t)},u.clear=function(){for(var e,t=this.rootContainer;e=t.lastChild;)t.removeChild(e);for(var i=0;i<this.delegates.length;++i)this.delegates[i].clean();this.elementsUsed=0},u.iterate=function(e,t,i){null!=t&&e.shouldCreateTreeNode(t)&&i(t)&&e.forEachChild(t,function(t){this.iterate(e,t,i)}.bind(this))},u.forEachDelegate=function(e){for(var t=0;t<this.delegates.length;++t)e(this.delegates[t])},u.destroy=function(){this.clear(),cancelAnimationFrame(this.nextFrameId),this.rootContainer.parentNode.removeChild(this.rootContainer),this.rootContainer=null,this.rootId=-1,this.nodeCssTable=null,this.nodeIndexToNodeCssTables=null,this.cssStringToNodeCssTable=null,this.elementsPool=null,this.elementsUsed=-1,this.scrollY=-1,this.hammer&&(this.hammer.destroy(),this.hammer=null)},u.setScroll=function(e){Math.abs(this.scrollY-e)>c&&(this.scrollY=e,f(this))},u.displayNoProperties=function(e){var t=this.getDocument();if(e){if(!this.divNoProps){this.divNoProps=t.createElement("div");var i="Model Browser is not available";this.divNoProps.innerText=s.Z.t(i),this.divNoProps.setAttribute("data-i18n",i),this.divNoProps.classList.add("lmv-no-properties")}if(!this.divNoProps.parentNode)this.rootContainer.parentNode.appendChild(this.divNoProps)}else this.divNoProps&&this.divNoProps.parentNode&&this.divNoProps.parentNode.removeChild(this.divNoProps)},u.isExcludeRoot=function(){return 1===this.delegates.length&&this.options.excludeRoot},u.getDelegateCount=function(){return this.delegates.length}},25230:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ViewerModelStructurePanel:()=>d,generateDefaultViewerHandlerOptions:()=>c});var n=i(44355),r=i(55318),o=i(33423),s=i(8022),a=i(49720),l=i(55390);const c=e=>({onSearchSelected:function(t){var i=t.id,n=e.impl.findModel(t.modelId);e.isolate(i,n)},onVisibilityIconClick:function(t,i){e.toggleVisibility(t,i)},onCreateUI:function(t){e.resizePanels&&e.resizePanels({dockingPanels:[t]}),t.scrollContainer.addEventListener("contextmenu",function(t){e.contextMenu.show(t)}.bind(t))},onIsolate:function(t,i){if(e.isolate(t,i),e.fitToView([t],i,!1),i){var n={type:o.SHOW_PROPERTIES_EVENT,dbId:t,model:i};e.dispatchEvent(n)}},onToggleMultipleOverlayedSelection:function(t){e.impl.selector.setAggregateSelection(t.map((t=>({model:e.impl.findModel(parseInt(t.modelId)),ids:t.ids}))));var i=e.getAggregateSelection();e.fitToView(i)},onToggleOverlayedSelection:function(t,i,n){n?e.select([],void 0,i):(e.select(t,i),e.fitToView([t],i,!1))},onTreeNodeRightClick:function(t){e.contextMenu.show(t)},onSelectOnly:function(t,i){e.select(t,i)},onDeselectAll:function(){e.clearSelection()},onSelectToggle:function(t,i){e.toggleSelect(t,i)},onShowAll:function(){e.showAll()},onFocus:function(){e.fitToView()},onHide:function(t,i){e.hide(t,i)},onShow:function(t,i){e.show(t,i)},onToggleVisibility:function(t,i){e.toggleVisibility(t,i)},getAggregateIsolation:e.getAggregateIsolation.bind(e),getAggregateHiddenNodes:e.getAggregateHiddenNodes.bind(e),getAggregateSelection:e.getAggregateSelection.bind(e),globalManager:e.globalManager,container:e.container,removeEventListener:e.removeEventListener.bind(e),addEventListener:e.addEventListener.bind(e)}),h=Autodesk.Viewing.Private;var u={click:{onObject:["isolate"]},clickShift:{onObject:["toggleMultipleOverlayedSelection"]},clickCtrl:{onObject:["toggleVisibility"]}};function d(e,t,i){let o={...i}||{},l=t;e instanceof Autodesk.Viewing.GuiViewer3D||e instanceof Autodesk.Viewing.Viewer3D?(a.logger.warn("Deprecated use of Viewer as parameter. Use options callbacks instead"),o={...o,...c(e)}):o={...e},this.visible=!1,this._trackNodeClick=!0,o.defaultTitle="Model",o.excludeRoot=void 0===o.excludeRoot||o.excludeRoot,o.startCollapsed=void 0!==o.startCollapsed&&o.startCollapsed,o.scrollEaseCurve=o.scrollEaseCurve||[0,0,.29,1],o.scrollEaseSpeed=void 0!==o.scrollEaseSpeed?o.scrollEaseSpeed:.003,o.addFooter=void 0===o.addFooter||o.addFooter,this.clickConfig=o&&o.docStructureConfig?o.docStructureConfig:u,this.isMac=-1!==navigator.userAgent.search("Mac OS"),o.hideSearch?(o.heightAdjustment=70,n.ModelStructurePanel.call(this,o.container,o.container.id+"ViewerModelStructurePanel",l,o),this.scrollContainer.classList.add("no-search")):(o.heightAdjustment=104,n.ModelStructurePanel.call(this,o.container,o.container.id+"ViewerModelStructurePanel",l,o),this.searchbox=new s.Searchbox(o.container.id+"ViewerModelStructurePanel-Searchbox",o.container,{excludeRoot:o.excludeRoot,searchFunction:p.bind(this)}),this.searchbox.setGlobalManager(this.globalManager),o.onSearchSelected&&this.searchbox.addEventListener(r.J,o.onSearchSelected),this.container.appendChild(this.searchbox.container)),this.setGlobalManager(o.globalManager),this._ignoreScroll=!1,this.selectedNodes={},this.onViewerSelect=this.onViewerSelect.bind(this),this.onViewerIsolate=this.onViewerIsolate.bind(this),this.onViewerHide=this.onViewerHide.bind(this),this.onViewerShow=this.onViewerShow.bind(this)}function p(e){var t=this.tree,i=e.toLowerCase(),n=[];return t.forEachDelegate((function(e){var r=e.getRootId(),o=[];t.iterate(e,r,(function(t){var n=e.instanceTree&&e.instanceTree.getNodeName(t);return n&&-1!==n.toLowerCase().indexOf(i)&&o.push(t),!0})),n.push({ids:o,delegate:e})})),h.analytics.track("viewer.model_browser",{from:"Panel",action:"Search"}),n}d.prototype=Object.create(n.ModelStructurePanel.prototype),d.prototype.constructor=d,l.ViewerPanelMixin.call(d.prototype),d.prototype.uninitialize=function(){var e,t,i,r,s,a,l,c;null===(e=(t=this.options).removeEventListener)||void 0===e||e.call(t,o.AGGREGATE_SELECTION_CHANGED_EVENT,this.onViewerSelect),null===(i=(r=this.options).removeEventListener)||void 0===i||i.call(r,o.AGGREGATE_ISOLATION_CHANGED_EVENT,this.onViewerIsolate),null===(s=(a=this.options).removeEventListener)||void 0===s||s.call(a,o.HIDE_EVENT,this.onViewerHide),null===(l=(c=this.options).removeEventListener)||void 0===l||l.call(c,o.SHOW_EVENT,this.onViewerShow),this.searchResults&&(this.searchResults.uninitialize(),this.searchResults=null),n.ModelStructurePanel.prototype.uninitialize.call(this)},d.prototype.resizeToContent=function(){var e=this.scrollContainer,t=this.tree?this.tree.getRootContainer():null;if(e&&t){var i="calc(100% + "+e.scrollLeft+"px)";t.style.width=i}},d.prototype.createUI=function(){var e,t,i,r,s,a,l,c,h,u;if(!this.uiCreated){n.ModelStructurePanel.prototype.createUI.call(this),this.scrollContainer.classList.remove("left");var d=function(){this.visible&&this.resizeToContent(),requestAnimationFrame(d)}.bind(this);d(),null===(e=(t=this.options).onCreateUI)||void 0===e||e.call(t,this);var p=this.options,f=p.maxHeight?p.maxHeight:"calc("+this.container.style.maxHeight+" - 30px)";this.container.style.top="10px",this.container.style.left="10px",this.container.style.height=f,this.container.style.maxHeight=f,null===(i=(r=this.options).addEventListener)||void 0===i||i.call(r,o.AGGREGATE_SELECTION_CHANGED_EVENT,this.onViewerSelect),null===(s=(a=this.options).addEventListener)||void 0===s||s.call(a,o.AGGREGATE_ISOLATION_CHANGED_EVENT,this.onViewerIsolate),null===(l=(c=this.options).addEventListener)||void 0===l||l.call(c,o.HIDE_EVENT,this.onViewerHide),null===(h=(u=this.options).addEventListener)||void 0===h||h.call(u,o.SHOW_EVENT,this.onViewerShow)}},d.prototype.onViewerSelect=function(e){this.setSelection(e.selections),this._ignoreScroll||this.scrollToSelection(e.selections),this._ignoreScroll=!1},d.prototype.onViewerIsolate=function(e){this.setIsolation(e.isolation)},d.prototype.onViewerHide=function(e){this.setHidden(e.nodeIdArray.slice(),e.model,!0)},d.prototype.onViewerShow=function(e){this.setHidden(e.nodeIdArray.slice(),e.model,!1)},d.prototype.setVisible=function(e){n.ModelStructurePanel.prototype.setVisible.call(this,e),this.visible!==e&&(this.visible=e,this.visible&&this.sync())},d.prototype.sync=function(){var e,t,i,n,r,o,s=(null===(e=(t=this.options).getAggregateIsolation)||void 0===e?void 0:e.call(t))||[],a=(null===(i=(n=this.options).getAggregateHiddenNodes)||void 0===i?void 0:i.call(n))||[],l=(null===(r=(o=this.options).getAggregateSelection)||void 0===r?void 0:r.call(o))||[];if(this.setIsolation(s),0===s.length)for(var c=0;c<a.length;++c){var h=a[c].model,u=a[c].ids;this.setHidden(u,h,!0)}this.setSelection(l),this.scrollToSelection(l)},d.prototype.removeTreeUI=function(e){delete this.selectedNodes[e.id],n.ModelStructurePanel.prototype.removeTreeUI.call(this,e)},d.prototype.setHidden=function(e,t,i){for(var n=this.tree,r=n.getDelegate(t.id),o=i?function(e){return n.addClass(r,e,"dim",!1),n.removeClass(r,e,"visible",!1),!0}:function(e){return n.removeClass(r,e,"dim",!1),n.addClass(r,e,"visible",!1),!0},s=0;s<e.length;++s)n.iterate(r,e[s],o)},d.prototype.setIsolation=function(e){var t=this.tree;if(0!==e.length){var i=[];e.length&&this.tree.forEachDelegate(function(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].model===t.model){n=r;break}-1===n&&i.push(t)}.bind(this));for(let i=0;i<e.length;++i){const r=e[i].model,o=r.getData().instanceTree;if(!o)continue;const s=o.getRootId(),a=t.getDelegate(r.id);t.iterate(a,s,(function(e){return t.removeClass(a,e,"dim",!1),t.removeClass(a,e,"visible",!1),!0}));var n=e[i].ids;if(0!==n.length){if(1===n.length&&n[0]===s)return;this.setHidden([s],r,!0),this.setHidden(n,r,!1)}}for(let e=0;e<i.length;++e){const n=i[e],r=n.model,o=n.instanceTree;if(!o)continue;const s=o.getRootId();t.iterate(n,s,(function(e){return t.removeClass(n,e,"dim",!1),t.removeClass(n,e,"visible",!1),!0})),this.setHidden([s],r,!0)}}else t.forEachDelegate(function(e){var i=e.model,n=e.instanceTree;if(n){var r=n.getRootId();t.iterate(e,r,(function(i){return t.removeClass(e,i,"dim",!1),t.removeClass(e,i,"visible",!1),!0})),this.setHidden([r],i,!1)}}.bind(this))},d.prototype.setSelection=function(e){var t,i,n,r,o,s,a,l=this.tree;for(var c in this.selectedNodes)if(o=this.selectedNodes[c],(s=l.getDelegate(c))&&(a=s.instanceTree)){for(i=0;i<o.length;++i)for(n=a.getNodeParentId(o[t]);n;)l.removeClass(s,n,"ancestor-selected"),n=a.getNodeParentId(n);l.clearSelection(s)}for(this.selectedNodes={},t=0;t<e.length;++t)if(r=e[t].model,o=e[t].dbIdArray||e[t].selection,(s=l.getDelegate(r.id))&&(a=s.instanceTree)){for(i=0;i<o.length;++i)for(n=a.getNodeParentId(o[t]);n;)l.addClass(s,n,"ancestor-selected"),n=a.getNodeParentId(n);l.setSelection(s,o),this.selectedNodes[r.id]=o.concat()}},d.prototype.scrollToSelection=function(e){var t=e[0];if(t){var i=t.model,n=t.dbIdArray||t.selection,r=this.tree.scrollTo(n[0],i),o=this.scrollContainer.scrollTop;this.scrollContainer.scrollTop=r;var s=this.scrollContainer.scrollTop;this.scrollContainer.scrollTop=o,this.options.scrollEaseSpeed>0?this.animateScroll(o,s,function(e){this.tree.setScroll(e)}.bind(this)):(this.scrollContainer.scrollTop=s,this.tree.setScroll(s))}},d.prototype.onEyeIcon=function(e,t){var i,n;null===(i=(n=this.options).onVisibilityIconClick)||void 0===i||i.call(n,e,t),h.analytics.track("viewer.model_browser",{from:"Panel",action:"Toggle Visibility"})},d.prototype.onTreeNodeClick=function(e,t,i,n){if(this._trackNodeClick&&(a.logger.track({category:"node_selected",name:"model_browser_tool"}),this._trackNodeClick=!1),!this.isMac||!n.ctrlKey){var r="click";this.ctrlDown(n)&&(r+="Ctrl"),n.shiftKey&&(r+="Shift"),n.altKey&&(r+="Alt");var o=["toggleOverlayedSelection"],s=this.clickConfig[r];s&&(o=s.onObject),h.analytics.track("viewer.model_browser",{from:"Panel",action:"Select"}),this.handleAction(o,t,i)}},d.prototype.onTreeNodeRightClick=function(e,t,i,n){if(this.isMac&&n.ctrlKey&&0===n.button)return this.clickConfig&&this.clickConfig.clickCtrl&&this.handleAction(this.clickConfig.clickCtrl.onObject,t,i),null;this.options.onTreeNodeRightClick&&this.options.onTreeNodeRightClick(n)},d.prototype.handleAction=function(e,t,i){var n,r,o,s,a,l,c,h,u,d,p,f,m,g,v,y;for(var b in e)switch(e[b]){case"toggleOverlayedSelection":this.toggleOverlayedSelection(t,i);break;case"toggleMultipleOverlayedSelection":this.toggleMultipleOverlayedSelection(t,i);break;case"selectOnly":this.options.onSelectOnly&&this.options.onSelectOnly(t,i);break;case"deselectAll":null===(n=(r=this.options).onDeselectAll)||void 0===n||n.call(r,t,i);break;case"selectToggle":null===(o=(s=this.options).onSelectToggle)||void 0===o||o.call(s,t,i);break;case"isolate":null===(a=(l=this.options).onIsolate)||void 0===a||a.call(l,t,i);break;case"showAll":null===(c=(h=this.options).onShowAll)||void 0===c||c.call(h,t,i);break;case"focus":null===(u=(d=this.options).onFocus)||void 0===u||u.call(d,t,i);break;case"hide":null===(p=(f=this.options).onHide)||void 0===p||p.call(f,t,i);break;case"show":null===(m=(g=this.options).onShow)||void 0===m||m.call(g,t,i);break;case"toggleVisibility":null===(v=(y=this.options).onToggleVisibility)||void 0===v||v.call(y,t,i)}},d.prototype.toggleOverlayedSelection=function(e,t){var i,n,r=this.selectedNodes[t.id],o=r?r.indexOf(e):-1;this._ignoreScroll=!0,null===(i=(n=this.options).onToggleOverlayedSelection)||void 0===i||i.call(n,e,t,-1!==o)},d.prototype.toggleMultipleOverlayedSelection=function(e,t){var i=this.selectedNodes[t.id],n=i?i.indexOf(e):-1;if(-1===n?(i||(i=this.selectedNodes[t.id]=[]),i.push(e)):i.splice(n,1),this.options.onToggleMultipleOverlayedSelection){var r=[];for(var o in this.selectedNodes)if(Object.prototype.hasOwnProperty.call(this.selectedNodes,o)){var s=this.selectedNodes[o];r.push({modelId:o,ids:s})}this.options.onToggleMultipleOverlayedSelection(r)}this._ignoreScroll=!0},d.prototype.ctrlDown=function(e){return this.isMac&&e.metaKey||!this.isMac&&e.ctrlKey}},26523:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ViewerObjectContextMenu:()=>o});var n=i(38329),r=i(49720);function o(e){n.ObjectContextMenu.call(this,e)}o.prototype=Object.create(n.ObjectContextMenu.prototype),o.prototype.constructor=o,o.prototype.buildMenu=function(e,t){if(!this.viewer.model)return;var i=this,n=[],o=this.viewer.navigation,s=this.viewer.model.is2d();const a=Autodesk.Viewing.Private.analytics;t.hasSelected&&(n.push({title:"Isolate",target:function(){var e=i.viewer.getAggregateSelection();i.viewer.clearSelection(),i.viewer.impl.visibilityManager.aggregateIsolate(e),r.logger.track({name:"isolate_count",aggregate:"count"}),a.track("viewer.object.visibility",{action:"Isolate"})}}),t.hasVisible&&n.push({title:"Hide Selected",target:function(){const e=i.viewer.impl.selector.getAggregateSelection();i.viewer.clearSelection(),i.viewer.impl.visibilityManager.aggregateHide(e),a.track("viewer.object.visibility",{action:"Hide Selected"})}}),t.hasHidden&&n.push({title:"Show Selected",target:function(){var e=i.viewer.getSelection();i.viewer.clearSelection(),i.viewer.show(e),a.track("viewer.object.visibility",{action:"Show Selected"})}})),s&&n.push({title:"Show All Layers",target:function(){i.viewer.setLayerVisible(null,!0),a.track("viewer.object.visibility",{action:"Show All Layers"})}}),n.push({title:"Show All Objects",target:function(){i.viewer.showAll(),r.logger.track({name:"showall",aggregate:"count"}),a.track("viewer.object.visibility",{action:"Show All Objects"})}});var l=i.viewer.getAggregateSelection();if(!s&&1===l.length&&o.isActionEnabled("gotoview")&&n.push({title:"Focus",target:function(){if((l=i.viewer.getAggregateSelection()).length>0){var e=l[0];i.viewer.fitToView(e.selection,e.model)}else 0===l.length&&i.viewer.fitToView();r.logger.track({name:"fittoview",aggregate:"count"})}}),!s){var c=this.viewer.impl.getCanvasBoundingClientRect(),h=e.clientX-c.left,u=e.clientY-c.top,d=this.viewer.clientToWorld(h,u,!1);d&&n.push({title:"Pivot",target:()=>{this.viewer.navigation.setPivotPoint(d.point)}})}return t.hasSelected&&n.push({title:"Clear Selection",target:function(){i.viewer.clearSelection(),r.logger.track({name:"clearselection",aggregate:"count"})}}),n}},55390:(e,t,i)=>{"use strict";function n(){this.getContainerBoundingRect=function(){var e=this.parentContainer.getBoundingClientRect(),t={height:0,width:0,left:0,bottom:0,right:0,top:0},i=this.getDocument().getElementsByClassName("toolbar-menu");return i&&i.length>0&&(t=i[0].getBoundingClientRect()),{height:e.height-t.height,width:e.width,left:e.left,bottom:e.bottom-t.height,right:e.right,top:e.top}}}i.r(t),i.d(t,{ViewerPanelMixin:()=>n})},12194:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ViewerPropertyPanel:()=>l});var n=i(58927),r=i(55390),o=i(33423),s=i(94577),a=i(49720);function l(e){this.viewer=e,this.setGlobalManager(e.globalManager),this.currentNodeIds=[],this.currentModel=null,this.currentSelections=[],this.isDirty=!0,this.propertyNodeId=null,this.normalTitle="Properties",this.loadingTitle="Object Properties Loading",this._viewDbId=null,this.onProperties=this.onProperties.bind(this),this.onPropertySet=this.onPropertySet.bind(this),this.onPropError=this.onPropError.bind(this),this.setPropertiesIntoUI=this.setPropertiesIntoUI.bind(this),this.setAggregatedPropertiesIntoUI=this.setAggregatedPropertiesIntoUI.bind(this),this._onDisplayUnitPreferenceChanged=this._onDisplayUnitPreferenceChanged.bind(this),n.PropertyPanel.call(this,e.container,"ViewerPropertyPanel",this.loadingTitle)}function c(e){var t=e.getDocumentNode(),i=t&&t.findViewableParent();return!(!i||-1===i.name().toLocaleLowerCase().indexOf(".sld"))}l.prototype=Object.create(n.PropertyPanel.prototype),l.prototype.constructor=l,r.ViewerPanelMixin.call(l.prototype),l.prototype._onDisplayUnitPreferenceChanged=function(){this.isDirty=!0;const e=this.currentModel?this.currentModel.getRootId():null;if(null!==this.propertyNodeId&&this.propertyNodeId!==e){const e={model:this.currentModel};e.selection=Array.isArray(this.propertyNodeId)?this.propertyNodeId:[this.propertyNodeId],this.requestAggregatedNodeProperties(e)}else this.requestProperties()},l.prototype.initialize=function(){n.PropertyPanel.prototype.initialize.call(this);var e=this;this.viewer.prefs.addListeners(Autodesk.Viewing.Private.Prefs.DISPLAY_UNITS,this._onDisplayUnitPreferenceChanged),this.viewer.prefs.addListeners(Autodesk.Viewing.Private.Prefs.DISPLAY_UNITS_PRECISION,this._onDisplayUnitPreferenceChanged),e.addEventListener(e.viewer,o.AGGREGATE_SELECTION_CHANGED_EVENT,(function(t){t.selections&&t.selections.length?(e.currentNodeIds=t.selections[0].dbIdArray,e.currentModel=t.selections[0].model,e.currentSelections=[],t.selections.forEach((t=>{e.currentSelections.push({model:t.model,selection:t.dbIdArray})}))):e.resetCurrentModel(),e.isDirty=!0,e.requestProperties()})),e.addEventListener(e.viewer,o.SHOW_PROPERTIES_EVENT,(function(t){t&&t.dbId&&(e.currentModel=t.model,e.requestAggregatedNodeProperties({model:t.model,selection:[t.dbId]}))})),e.addEventListener(e.viewer,o.HIDE_EVENT,(function(t){e.isDirty=!0,e.requestProperties()})),e.addEventListener(e.viewer,o.OBJECT_TREE_CREATED_EVENT,(function(t){e.currentModel===t.model&&(e.isDirty=!0,e.requestProperties())})),e.addEventListener(e.viewer,o.SHOW_EVENT,(function(t){e.isDirty=!0,e.requestProperties()}));var t=this.viewer.getAggregateSelection();t.length?(this.currentModel=t[0].model,this.currentNodeIds=t[0].selection,this.currentSelections=t):this.resetCurrentModel()},l.prototype.resetCurrentModel=function(){var e=this.viewer?this.viewer.getVisibleModels():[];this.currentModel=1===e.length?e[0]:null,this.currentNodeIds=[],this.currentSelections=[]},l.prototype.setTitle=function(e,t){e||(e="Object Properties",(t=t||{}).localizeTitle=!0),n.PropertyPanel.prototype.setTitle.call(this,e,t)},l.prototype.setVisible=function(e){s.DockingPanel.prototype.setVisible.call(this,e),this.requestProperties()},l.prototype.visibilityChanged=function(){s.DockingPanel.prototype.visibilityChanged.call(this),this.isVisible()&&this.requestProperties()},l.prototype.requestProperties=function(){this.isVisible()&&this.isDirty&&(this.currentSelections.length>0?this.requestAggregatedNodeProperties(this.currentSelections):this.showDefaultProperties(),this.isDirty=!1)},l.prototype.onProperties=function(e){if(!this.viewer||!this.currentModel)return;if(e.dbId!==this.propertyNodeId)return;var t,i=[],n=e.properties;if(n)for(var r=0,o=n.length;r<o;++r){var s=n[r];"__internalref__"===s.displayCategory&&i.push(s.displayValue)}const a=this.currentModel;t=a.is3d()&&c(a)&&i.length>0?function(e,t,i){return new Promise((function(n,r){e.getBulkProperties2(t,{ignoreHidden:!0},(function(e){for(var t=0,r=e.length;t<r;++t)for(var o=e[t],s=0,a=o.properties.length;s<a;++s){for(var l=o.properties[s],c=!0,h=0,u=i.properties.length;h<u;++h)i.properties[h].displayName===l.displayName&&(c=!1,h=u);c&&i.properties.push(l)}n(i)}))}))}(a,i,e):Promise.resolve(e),t.then(this.setPropertiesIntoUI).catch((()=>{this.setProperties([]),this.highlight(""),this.resizeToContent(),this.respositionPanel()}))},l.prototype.onPropertySet=function(e){if(!this.viewer||!this.currentModel)return;if(0===e.getVisibleKeys().length)return this.onPropError(),this.resizeToContent(),void this.respositionPanel();const t=e.map,i=[];let n;e.getValidIds(null,"__internalref__").forEach((e=>{t[e].forEach((e=>{i.includes(e.displayValue)||i.push(e.displayValue)}))}));const r=this.currentModel;n=r.is3d()&&c(r)&&i.length>0?function(e,t,i){return new Promise(((n,r)=>{e.getPropertySet(t,(e=>{n(i.merge(e))}),r,{ignoreHidden:!0})}))}(r,i,e):Promise.resolve(e),n.then(this.setAggregatedPropertiesIntoUI).catch((e=>{a.logger.error(e),this.setProperties([]),this.highlight(""),this.resizeToContent(),this.respositionPanel()}))},l.prototype.setAggregatedPropertiesIntoUI=function(e){const t=e.getDbIds().length;if(1===t){let t=Object.prototype.hasOwnProperty.call(e.map,"Name"),i=t?e.map.Name[0]:this.normalTitle;"object"==typeof i&&Object.prototype.hasOwnProperty.call(i,"displayValue")&&(t=!0,i=i.displayValue),this.setTitle(i,{localizeTitle:!t})}else this.setTitle("Properties %(value)",{localizeTitle:!0,i18nOpts:{value:`(${t})`}});this.setAggregatedProperties(e),this.highlight(this.viewer.searchText),this.resizeToContent(),this.respositionPanel()},l.prototype.setPropertiesIntoUI=function(e){var t=e.name||this.normalTitle,i=!e.name;this.setTitle(t,{localizeTitle:i}),"name"in e&&e.properties&&e.properties.splice(0,0,{displayName:"Name",displayValue:e.name,displayCategory:null,attributeName:"Name",type:20,units:null,hidden:!1,precision:0}),this.setProperties(e.properties),this.highlight(this.viewer.searchText),this.resizeToContent(),this.respositionPanel()},l.prototype.onPropError=function(){this.setTitle(this.normalTitle,{localizeTitle:!0}),this.showNoProperties()},l.prototype.requestAggregatedNodeProperties=function(e){var t;1===(e=Array.isArray(e)?e:[e]).length&&1===(null===(t=e[0].selection)||void 0===t?void 0:t.length)&&(this.propertyNodeId=e[0].selection[0]);const i=[];e.forEach((e=>{var t,n,r,o;i.push(e.model.getPropertySetAsync(e.selection,{fileType:null===(t=e.model.getData())||void 0===t||null===(n=t.loadOptions)||void 0===n?void 0:n.fileExt,needsExternalId:null===(r=e.model.getData())||void 0===r||null===(o=r.loadOptions)||void 0===o?void 0:o.needsExternalId}))})),Promise.all(i).then((e=>{const t=e[0];for(let i=1;i<e.length;i++)t.merge(e[i]);this.onPropertySet(t)})).catch(this.onPropError)},l.prototype.requestNodeProperties=function(e){const t=this.currentModel;this.propertyNodeId=e;const i=Array.isArray(e);(i?t.getPropertySet.bind(t):t.getProperties2.bind(t))(e,(e=>{this.viewer&&t===this.currentModel&&(i?this.onPropertySet(e):this.onProperties(e))}),this.onPropError)},l.prototype.setNodeProperties=l.prototype.requestNodeProperties,l.prototype.requestViewProperties=function(e){if(null!==this._viewDbId){const e={model:this.currentModel,selection:[this._viewDbId]};return void this.requestAggregatedNodeProperties(e)}const t=this.currentModel,i=t.getRootId();this.propertyNodeId=i,t.getPropertySet([i],(n=>{if(!this.viewer)return;if(t!==this.currentModel)return;this._viewDbId=i;const r=e.name(),o=e.isSheet(),s=[],a=[],l=n.getValidIds("Sheet"),c=n.getValidIds("View");l.forEach((e=>{n.map[e].forEach((e=>{a.push(e.displayValue)}))})),c.forEach((e=>{n.map[e].forEach((e=>{s.push(e.displayValue)}))}));const h=o?a:s;if(0!==h.length){var u=this;t.getBulkProperties2(h,{propFilter:["name","dbId"],ignoreHidden:!0},(function(e){const s=[];for(let t=0;t<e.length;++t)if(-1!==r.indexOf(e[t].name)){const i=e[t].dbId;if(!o)return u._viewDbId=i,void u.requestAggregatedNodeProperties({model:u.currentModel,selection:[i]});s.push(i)}0!==s.length?function(e,t,i){return new Promise((function(n,r){i=i||e.myData.metadata.title,e.getBulkProperties2(t,{ignoreHidden:!0},(function(e){for(var t=0,r=e.length;t<r;++t){var o=e[t];if(o.name&&-1!==i.indexOf(o.name))for(var s=0,a=o.properties.length;s<a;++s){var l=o.properties[s];if("Sheet Number"===l.displayName&&-1!==i.indexOf(l.displayValue))return n(o)}}return n(null)}))}))}(t,s,r).then((function(e){e&&e.dbId&&e.dbId!==i?(u._viewDbId=e.dbId,u.requestAggregatedNodeProperties({model:u.currentModel,selection:[e.dbId]})):u.onPropertySet(n)})):u.onPropertySet(n)}))}else this.onPropertySet(n)}),this.onPropError)},l.prototype.respositionPanel=function(){if(this.isVisible()){var e=this.viewer.toolController,t=e.lastClickX,i=e.lastClickY,n=this.container.getBoundingClientRect(),r=n.left,o=n.top,s=n.width,a=n.height,l=this.viewer.impl.getCanvasBoundingClientRect(),c=l.left,h=l.top,u=l.width,d=l.height;r<=t&&t<r+s&&o<=i&&i<o+a&&(t<r+s/2&&t+s<c+u?(this.container.style.left=Math.round(t-c)+"px",this.container.dockRight=!1):c<=t-s?(this.container.style.left=Math.round(t-c-s)+"px",this.container.dockRight=!1):t+s<c+u?(this.container.style.left=Math.round(t-c)+"px",this.container.dockRight=!1):i+a<h+d?(this.container.style.top=Math.round(i-h)+"px",this.container.dockBottom=!1):h<=i-a&&(this.container.style.top=Math.round(i-h-a)+"px",this.container.dockBottom=!1))}},l.prototype.showDefaultProperties=function(){var e=this.currentModel?this.currentModel.getRootId():null;if(e){const t=this.currentModel.getDocumentNode();t&&!t.isMasterView()?this.requestViewProperties(t):this.requestAggregatedNodeProperties({model:this.currentModel,selection:[e]})}else this.propertyNodeId=null,this.setTitle(this.normalTitle,{localizeTitle:!0}),n.PropertyPanel.prototype.showDefaultProperties.call(this)},l.prototype.areDefaultPropertiesShown=function(){if(!this.currentModel)return!1;var e=this.currentModel.getRootId();return this.propertyNodeId===e},l.prototype.uninitialize=function(){n.PropertyPanel.prototype.uninitialize.call(this),this.viewer.prefs.removeListeners(Autodesk.Viewing.Private.Prefs.DISPLAY_UNITS,this._onDisplayUnitPreferenceChanged),this.viewer.prefs.removeListeners(Autodesk.Viewing.Private.Prefs.DISPLAY_UNITS_PRECISION,this._onDisplayUnitPreferenceChanged),this.viewer=null,this._viewDbId=null,this.currentModel=null,this.currentSelections=[],this.propertyNodeId=null,this.currentNodeIds=null},l.prototype.onCategoryClick=function(e,t){n.PropertyPanel.prototype.onCategoryClick.call(this,e,t),this.resizeToContent()},l.prototype.onCategoryIconClick=function(e,t){n.PropertyPanel.prototype.onCategoryIconClick.call(this,e,t),this.resizeToContent()}},48155:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ViewerSettingTab:()=>E,ViewerSettingsPanel:()=>S});var n=i(47710),r=i(33423),o=i(49720),s=i(34345),a=i(71224),l=i(16840),c=i(55390),h=i(27293);class u{constructor(e,t){this._width=e||60,this._height=t||60}createThumbnail(e,t){return new Promise((t=>{var i=this.getDocument().createElement("canvas");i.width=this._width,i.height=this._height;var n=i.getContext("2d"),r=n.createLinearGradient(0,0,0,i.height),o=e.bgColorGradient,s=d(o[0],o[1],o[2]),a=d(o[3],o[4],o[5]);r.addColorStop(0,s),r.addColorStop(1,a),n.fillStyle=r,n.fillRect(0,0,i.width,i.height),i.toBlob((function(e){var i=URL.createObjectURL(e);t(i)}))}))}}function d(e,t,i){return e=parseInt(e),t=parseInt(t),i=parseInt(i),"#"+p(e)+p(t)+p(i)}function p(e){if(0===e)return"00";for(var t="",i=e>255?255:e;0!==i;){var n=i%16;i=i/16|0,t=f[n.toString()]+t}return t.length>1?t:"0"+t}h.GlobalManagerMixin.call(u.prototype);const f={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"};var m=i(23279),g=i.n(m),v=i(59991),y=i(50467),b=i(85552);const x=Autodesk.Viewing.Private;let _=0,E={Navigation:"navigationtab",Configuration:"performancetab",Appearance:"appearance",Environment:"environment"};var A=0;function S(e,t){let i={...e};if(e instanceof Autodesk.Viewing.GuiViewer3D||e instanceof Autodesk.Viewing.Viewer3D){const n=e;i={preferences:n.prefs,globalManager:n.globalManager,addEventListener:n.addEventListener.bind(n),removeEventListener:n.removeEventListener.bind(n),container:n.container,version:n.config.viewerVersion,onRestoreDefaults:n.restoreDefaultSettings.bind(n),detectIfModelsHaveEdge:()=>{if(t.is2d())return!1;let e=!1;const i=n.impl.modelQueue().getModels();for(let t=0;t<i.length;t++){if(i[t].hasEdges){e=!0;break}}return e},loadExtension:e=>{n.loadExtension(e)},unloadExtension:e=>{n.unloadExtension(e)},width:400,heightAdjustment:110}}this.options=i,this.preferences=i.preferences,this.is3dMode=!t.is2d(),this.visible=!1,this._externalButtonIds=[],this._externalButtonsLabel=null,n.SettingsPanel.call(this,this.options.container,"ViewerSettingsPanel"+_+++"-"+A++,"Settings",i),this.container.classList.add("viewer-settings-panel"),this.setGlobalManager(this.options.globalManager),this.addTab(E.Configuration,"Configuration",{className:"performance"}),this.addTab(E.Navigation,"Navigation",{className:"navigation"}),this.addTab(E.Appearance,"Appearance",{className:"appearance"}),this.is3dMode?this.addTab(E.Environment,"Environment",{className:"environment"}):this.container.classList.add("for-2d-model"),this.createRestoreDefaultSettingsButton(),this.modelPreferenceCount=0,this.createNavigationPanel(),this.createConfigurationPanel(),this.createAppearancePanel(),this.modelPreferenceCount&&o.logger.log("Model locked ("+this.modelPreferenceCount+") render settings in UI."),this.selectTab(E.Configuration),this.footer=this.createFooter(),this.createVersionLabel(this.footer),this.syncUI=this.syncUI.bind(this),this.options.addEventListener(r.RESTORE_DEFAULT_SETTINGS_EVENT,this.syncUI),this.options.addEventListener(r.VIEWER_STATE_RESTORED_EVENT,this.syncUI),this.updateEdgeToggle=this.updateEdgeToggle.bind(this),this.options.addEventListener(r.GEOMETRY_LOADED_EVENT,this.updateEdgeToggle),this.sendAnalyticsDebounced=g()(((e,t)=>{x.analytics.track("viewer.settings.changed",{setting_name:e,setting_value:t})}),500)}function w(e,t,i){e.createThumbnail(i).then((e=>{t.src=e,t.onload=function(){URL.revokeObjectURL(e)}}))}S.prototype=Object.create(n.SettingsPanel.prototype),S.prototype.constructor=S,c.ViewerPanelMixin.call(S.prototype),S.prototype.uninitialize=function(){var e,t,i,o,s,a;this._onBgEnvironmentChange&&this._onBgEnvironmentReset&&(this.preferences.removeListeners(x.Prefs3D.LIGHT_PRESET,this._onBgEnvironmentChange,this._onBgEnvironmentReset),this._onBgEnvironmentChange=null,this._onBgEnvironmentReset=null),null===(e=(t=this.options).removeEventListener)||void 0===e||e.call(t,r.RESTORE_DEFAULT_SETTINGS_EVENT,this.syncUI),null===(i=(o=this.options).removeEventListener)||void 0===i||i.call(o,r.VIEWER_STATE_RESTORED_EVENT,this.syncUI),null===(s=(a=this.options).removeEventListener)||void 0===s||s.call(a,r.GEOMETRY_LOADED_EVENT,this.updateEdgeToggle),n.SettingsPanel.prototype.uninitialize.call(this),this.envSelect=null},S.prototype.setVisible=function(e){this.visible=e,n.SettingsPanel.prototype.setVisible.call(this,e),e&&this.sizeToContent(),e&&this.createEnvironmentPanel()},S.prototype.addCheckbox=function(e,t,i,r,o,s){const{preferences:a}=this;var l=a[s];r="boolean"==typeof l?l:r;var c=n.SettingsPanel.prototype.addCheckbox.call(this,e,t,r,(function(e){s&&(a.set(s,e),x.analytics.track("viewer.settings.changed",{setting_name:s,setting_value:e})),o&&o(e)}),i),h=this.getControl(c);return h.saveKey=s,s?a.addListeners(s,(function(e){h.setValue(e)}),(function(e){h.setValue(e),o&&o(e)})):h.sliderRow.classList.add("logical-group"),a.hasTag(s,"no-storage")&&(h.sliderRow.classList.add("no-storage"),this.modelPreferenceCount++),c},S.prototype.addDropDownMenu=function(e,t,i,r,o,s,a){const{preferences:l}=this;s&&(o=r.indexOf(l.get(s)));const c=n.SettingsPanel.prototype.addDropDownMenu.call(this,e,t,i,o,(function(e){s&&("displayUnits"==s?l.set(s,new y.EnumType(b.displayUnitsEnum,r[e.detail.value])):"displayUnitsPrecision"==s?l.set(s,new y.EnumType(b.displayUnitsPrecisionEnum,r[e.detail.value])):l.set(s,r[e.detail.value]),x.analytics.track("viewer.settings.changed",{setting_name:s,setting_value:r[e.detail.value]}))}),a),h=this.getControl(c);return s?l.addListeners(s,(function(e){h.setSelectedIndex(r.indexOf(e))}),(function(e){h.setSelectedIndex(r.indexOf(e))})):h.sliderRow.classList.add("logical-group"),l.hasTag(s,"no-storage")&&(h.sliderRow.classList.add("no-storage"),this.modelPreferenceCount++),c},S.prototype.addSliderV2=function(e,t,i,r,o,s,a,l){const{preferences:c}=this;var h=c.get(l);s="number"==typeof h?h:s,l&&!Object.prototype.hasOwnProperty.call(c,l)&&c.add(l,s,["2d","3d"]);var u=n.SettingsPanel.prototype.addSliderV2.call(this,e,t,i,r,o,s,(function(e){var t="number"==typeof e?e:Number(e.detail.value);l&&c.set(l,t)}),a),d=this.getControl(u[1]);return d.saveKey=l,l?c.addListeners(l,(function(e){d.setValue(e)})):d.sliderRow.classList.add("logical-group"),c.hasTag(l,"no-storage")&&(d.sliderRow.classList.add("no-storage"),this.modelPreferenceCount++),u},S.prototype.addGrid=function(e,t,i,n){const{preferences:r}=this;var o=e,s=this.getDocument(),l=s.createElement("div");l.classList.add("environments-container"),o.appendChild(l);var c=s.createElement("div");c.classList.add("environments-lighting-table"),l.appendChild(c);var h=new u(42,26);h.setGlobalManager(this.globalManager);for(var d=0;d<t.length;d++){let e=t[d];var p=s.createElement("div");p.classList.add("settings-environment-cell"),p.index=d;var f=s.createElement("img");f.classList.add("settings-environment-image"),w(h,f,e),p.appendChild(f);var m=s.createElement("span");m.textContent=a.Z.t(e.name),m.classList.add("settings-environment-name"),m.setAttribute("data-i18n",e.name),p.appendChild(m),p.addEventListener("click",(function(){r.set(n,this.index)})),c.appendChild(p)}return this.preferences.addListeners(n,i),c},S.prototype.updateEnvironmentSelection=function(){if(this.is3dMode&&this.envTabCreated){var e=this.preferences.get("lightPreset");if("string"==typeof e){e=s.LightPresets.map((e=>e.name)).indexOf(e)}for(var t=this.gridTable.querySelectorAll(".settings-environment-cell"),i=0;i<t.length;i++)t[i].index===e?t[i].classList.add("border-select"):t[i].classList.remove("border-select")}},S.prototype.removeCheckbox=function(e){return this.preferences.removeListeners(e.saveKey),this.removeEventListener(e,"change",e.changeListener),n.SettingsPanel.prototype.removeCheckbox.call(this,e)},S.prototype.createNavigationPanel=function(){var e=E.Navigation;function t(){return this.addSliderV2(e,"Drag Speed","Changes sensitivity of mouse movement with the zoom tool",5,300,this.options.initialZoomDragSpeed,{step:5},v.Prefs.ZOOM_DRAG_SPEED)[1]}function i(){return this.addSliderV2(e,"Scroll Speed","Changes sensitivity of the mouse scroll wheel when zooming",.1,3,this.options.initialZoomScrollScale,{step:.1},v.Prefs.ZOOM_SCROLL_SPEED)[1]}this.is3dMode&&(this.addLabel(e,"ViewCube"),this.addCheckbox(e,"Show ViewCube","Toggles availability of the ViewCube navigation control",!0,void 0,v.Prefs3D.VIEW_CUBE),(0,l.isMobileDevice)()||this.addCheckbox(e,"ViewCube acts on pivot","When enabled, the ViewCube orbits the view around the active pivot point When disabled, it orbits around the center of the view",!1,void 0,v.Prefs3D.ALWAYS_USE_PIVOT),this.addLabel(e,"Orbit"),this.addCheckbox(e,"Fusion style orbit","Enables Fusion-style orbit overlay and gives the ability to lock orbit axis",!1,(e=>{e?this.options.loadExtension("Autodesk.Viewing.FusionOrbit",null):this.options.unloadExtension("Autodesk.Viewing.FusionOrbit",null)}),v.Prefs.FUSION_ORBIT),this.addCheckbox(e,"Orbit past world poles","Allows view rotation to continue past the model’s North Pole",!0,void 0,v.Prefs3D.ORBIT_PAST_WORLD_POLES),this.addLabel(e,"Zoom"),(0,l.isMobileDevice)()||(this.addCheckbox(e,"Zoom towards pivot","When disabled, zooming operations are centered at the current cursor location",!1,void 0,v.Prefs3D.ZOOM_TOWARDS_PIVOT),this.addCheckbox(e,"Reverse mouse zoom direction","Toggles direction of zooming in and out",!1,void 0,v.Prefs.REVERSE_MOUSE_ZOOM_DIR),this.scrollSpeed=i.call(this)),this.dragSpeed=t.call(this),this.addLabel(e,"Mouse"),(0,l.isMobileDevice)()||(this.addCheckbox(e,"Left handed mouse setup","Swaps the buttons on the mouse",!1,void 0,v.Prefs.LEFT_HANDED_MOUSE_SETUP),this.addCheckbox(e,"Set pivot with left mouse button","Change left-click behavior to set new pivot point (overrides select object)",!1,void 0,v.Prefs3D.CLICK_TO_SET_COI)),this.addCheckbox(e,"Open properties on select","Always show properties upon selecting object",!0,void 0,v.Prefs.OPEN_PROPERTIES_ON_SELECT)),this.is3dMode||(this.addLabel(e,"Zoom"),this.addCheckbox(e,"Reverse mouse zoom direction","Toggles direction of zooming in and out",!1,void 0,v.Prefs.REVERSE_MOUSE_ZOOM_DIR),(0,l.isMobileDevice)()||(this.scrollSpeed=i.call(this)),this.dragSpeed=t.call(this),this.addLabel(e,"Mouse"),this.addCheckbox(e,"Open properties on select","Always show properties upon selecting object",!0,void 0,v.Prefs.OPEN_PROPERTIES_ON_SELECT),(0,l.isMobileDevice)()||this.addCheckbox(e,"Left handed mouse setup","Swaps the buttons on the mouse",!1,void 0,v.Prefs.LEFT_HANDED_MOUSE_SETUP))},S.prototype.addConfigButton=function(e,t){if(!t)throw new Error("Must register a function callback.");this._externalButtonsLabel||(this._externalButtonsLabel=this.addLabel(E.Configuration,"More"));var i=this.addButton(E.Configuration,e);return this.getControl(i).setOnClick((()=>{this.setVisible(!1),t()})),this._externalButtonIds.push(i),i},S.prototype.removeConfigButton=function(e){var t=this._externalButtonIds.indexOf(e);if(-1===t)return!1;var i=this.getControl(e);return!!i&&(this.removeControl(i),this._externalButtonIds.splice(t,1),0===this._externalButtonIds.length&&null!==this._externalButtonsLabel&&(this._externalButtonsLabel.removeFromParent(),this._externalButtonsLabel=null),!0)},S.prototype.updateEdgeToggle=function(){const e=document.getElementById(this.edgeCheckboxName+"_check");if(!e)return;if(!this.is3dMode)return;this.options.detectIfModelsHaveEdge()?e.disabled=!1:(e.disabled=!0,e.checked=!1)},S.prototype.createConfigurationPanel=function(){var e=E.Configuration;this.is3dMode?(this.addLabel(e,"Performance Optimization"),this.optimizeNavigationhkBoxId=this.addCheckbox(e,"Smooth navigation","Provides faster response(but degrades quality) while navigating",(0,l.isMobileDevice)(),void 0,v.Prefs3D.OPTIMIZE_NAVIGATION),this.progressiveRenderChkBoxId=this.addCheckbox(e,"Progressive display","Shows incremental updates of the view and allows for more responsive interaction with the model (some elements may flicker) This improves perceived waiting time",!0,void 0,v.Prefs.PROGRESSIVE_RENDERING),this.addLabel(e,"Display"),this.ghosthiddenChkBoxId=this.addCheckbox(e,"Ghost hidden objects","Leave hidden objects slightly visible",!0,void 0,v.Prefs3D.GHOSTING),this.displayLinesId=this.addCheckbox(e,"Display Lines","Toggles display of line objects",!0,void 0,v.Prefs3D.LINE_RENDERING),this.displayPointsId=this.addCheckbox(e,"Display Points","Toggles display of point objects",!0,void 0,v.Prefs.POINT_RENDERING),this.edgeCheckboxName="Display edges",this.displayEdgesId=this.addCheckbox(e,this.edgeCheckboxName,"Shows outline of model surfaces",!1,(e=>{this.getControl(this.displayEdgesId).setValue(e),this.updateEdgeToggle()}),v.Prefs3D.EDGE_RENDERING),this.updateEdgeToggle(),this.displaySectionHatchesId=this.addCheckbox(e,"Display Section Hatches","Shows hatch pattern for section planes this does not apply to section boxes",!0,null,x.Prefs3D.DISPLAY_SECTION_HATCHES)):(this.addLabel(e,"Performance Optimization"),this.progressiveRenderChkBoxId=this.addCheckbox(e,"Progressive display","Shows incremental updates of the view and allows for more responsive interaction with the model (some elements may flicker) This improves perceived waiting time",!0,void 0,v.Prefs.PROGRESSIVE_RENDERING),this.addLabel(e,"Display")),this.displayUnitsId=this.addDropDownMenu(e,"Display Units",x.displayUnits,x.displayUnitsEnum,null,x.Prefs.DISPLAY_UNITS),this.displayUnitsPrecisionId=this.addDropDownMenu(e,"Precision",x.displayUnitsPrecision,x.displayUnitsPrecisionEnum,null,x.Prefs.DISPLAY_UNITS_PRECISION),this.is3dMode&&this._addSelectionModeOption()},S.prototype._addSelectionModeOption=function(){const e=E.Configuration;this.addLabel(e,"Selection");const t=[],i=[];let n=0;for(let e in Autodesk.Viewing.SelectionMode)t[n]=e,i[n]=Autodesk.Viewing.SelectionMode[e],n++;const r=t.map((e=>e.split("_").map((e=>e.charAt(0)+e.slice(1).toLowerCase())).join(" ")));this.selectionModeId=this.addDropDownMenu(e,"Selection Mode",r,i,null,x.Prefs3D.SELECTION_MODE)},S.prototype.createAppearancePanel=function(){var e=E.Appearance;this.is3dMode?(this.addLabel(e,"Visual Quality Optimization"),this.antialiasingChkBoxId=this.addCheckbox(e,"Anti-aliasing","Remove jagged edges from lines",!0,void 0,v.Prefs3D.ANTIALIASING),this.ambientshadowsChkBoxId=this.addCheckbox(e,"Ambient shadows","Improve shading of occluded surfaces",!0,void 0,v.Prefs3D.AMBIENT_SHADOWS),this.groundShadowChkBoxId=this.addCheckbox(e,"Ground shadow","Add simulated ground surface shadows",!0,void 0,v.Prefs3D.GROUND_SHADOW),this.groundReflectionChkBoxId=this.addCheckbox(e,"Ground reflection","Add simulated ground surface reflections",!1,void 0,v.Prefs3D.GROUND_REFLECTION)):(this.addLabel(e,"Existing behavior"),this.swapBlackAndWhiteChkBoxId=this.addCheckbox(e,"2D Sheet Color","Switch sheet color white to black",!0,void 0,v.Prefs2D.SWAP_BLACK_AND_WHITE),this.loadingAnimationChkBoxId=this.addCheckbox(e,"Loading Animation","Animate lines during loading",!0,void 0,v.Prefs2D.LOADING_ANIMATION))},S.prototype.createEnvironmentPanel=function(){if(this.is3dMode&&!this.envTabCreated){this.envTabCreated=!0;var e=E.Environment,t=this.tablesContainer.childNodes[3];this.gridTable=t,this.addLabel(e,"Environment"),this.envMapBackgroundChkBoxId=this.addCheckbox(e,"Environment Image Visible","Shows lighting environment as background",!0,void 0,v.Prefs3D.ENV_MAP_BACKGROUND);var i=t.tBodies[0].insertRow(-1).insertCell(0),n=this.getDocument();this.caption=n.createElement("div"),this.caption.setAttribute("data-i18n","Environments and Lighting Selection"),this.caption.textContent=a.Z.t("Environments and Lighting Selection"),this.caption.classList.add("settings-row-title"),i.appendChild(this.caption),i.colSpan="3",this.envSelect=this.addGrid(t,s.LightPresets,this.updateEnvironmentSelection.bind(this),x.Prefs3D.LIGHT_PRESET),this.updateEnvironmentSelection(),this.envSelect.classList.add("with-environment")}},S.prototype.createVersionLabel=function(e){if(e){var t=this.getDocument();this.versionDiv=t.createElement("div"),this.versionDiv.textContent=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:LMV_VIEWER_VERSION;"@"===e.charAt(0)&&(e="0.0.0");return"v"+e}(this.options.version),this.versionDiv.className="docking-panel-version-label",this.addEventListener(this.versionDiv,"click",(e=>{e.shiftKey&&navigator.clipboard.writeText(this.versionDiv.textContent)})),e.appendChild(this.versionDiv)}},S.prototype.createRestoreDefaultSettingsButton=function(){var e=this.getDocument();this.restoreDiv=e.createElement("div"),this.restoreDiv.classList.add("docking-panel-container-solid-color-b"),this.restoreDiv.classList.add("restore-defaults-container"),this.restoreButton=e.createElement("div"),this.restoreButton.className="docking-panel-tertiary-button",this.restoreButton.setAttribute("data-i18n","Restore all default settings"),this.restoreButton.textContent=a.Z.t("Restore all default settings"),this.restoreDiv.appendChild(this.restoreButton),this.addEventListener(this.restoreDiv,"touchstart",l.touchStartToClick),this.addEventListener(this.restoreDiv,"click",(()=>{var e,t;null===(e=(t=this.options).onRestoreDefaults)||void 0===e||e.call(t),x.analytics.track("viewer.settings.default")}),!1),this.scrollContainer.appendChild(this.restoreDiv)},S.prototype.selectTab=function(e){n.SettingsPanel.prototype.selectTab.call(this,e),this.sizeToContent()},S.prototype.sizeToContent=function(){n.SettingsPanel.prototype.sizeToContent.call(this,this.options.container)},S.prototype.onViewerResize=function(e,t,i,n,r,o){this.sizeToContent()},S.prototype.syncUI=function(){var e=this.preferences;this.setControlValue(this.antialiasingChkBoxId,e.get("antialiasing")),this.setControlValue(this.ambientshadowsChkBoxId,e.get("ambientShadows")),this.setControlValue(this.groundShadowChkBoxId,e.get("groundShadow")),this.setControlValue(this.groundReflectionChkBoxId,e.get("groundReflection")),this.setControlValue(this.envMapBackgroundChkBoxId,e.get("envMapBackground")),this.setControlValue(this.progressiveRenderChkBoxId,e.get("progressiveRendering")),this.setControlValue(this.swapBlackAndWhiteChkBoxId,e.get("swapBlackAndWhite")),this.setControlValue(this.loadingAnimationChkBoxId,e.get("loadingAnimation")),this.setControlValue(this.ghosthiddenChkBoxId,e.get("ghosting")),this.setControlValue(this.displayLinesId,e.get("lineRendering")),this.setControlValue(this.displayPointsId,e.get("pointRendering")),this.setControlValue(this.displayEdgesId,e.get("edgeRendering")),this.setControlValue(this.displaySectionHatchesId,e.get("displaySectionHatches")),this.setControlValue(this.scrollSpeed,e.get("zoomScrollSpeed")),this.setControlValue(this.dragSpeed,e.get("zoomDragSpeed")),this.updateEnvironmentSelection()},S.prototype.setControlValue=function(e,t){var i=this.getControl(e);i&&i.setValue(t)}},74057:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Browser:()=>c,BrowserDelegate:()=>l});var n=i(38215),r=i(82079),o=i(49720);let s=(0,i(16840).getGlobal)(),a=s.document;function l(){}function c(e,t,i){this.myDelegate=e,this.mySelectedIds=[];var n="browserview";this.myRootContainerId=i+"-"+n,this.idToElement={},this.myRootContainer=a.createElement("div"),this.myRootContainer.id=this.myRootContainerId,this.myRootContainer.classList.add(n),a.getElementById(i).appendChild(this.myRootContainer),this.createElements(t,this.myRootContainer)}l.prototype.constructor=l,l.prototype.getNodeId=function(e){throw"getId is not implemented."},l.prototype.getNodeLabel=function(e){return e.name},l.prototype.getNodeClass=function(e){return""},l.prototype.hasThumbnail=function(e){return!1},l.prototype.getThumbnailOptions=function(e){return null},l.prototype.getThumbnail=function(e){return null},l.prototype.onNodeClick=function(e,t,i){},l.prototype.onNodeHover=function(e,t,i){},l.prototype.selectItem=function(e){},l.prototype.deselectItem=function(e){},l.prototype.hasContent=function(e){return!1},l.prototype.addContent=function(e,t){},c.prototype.constructor=c,c.prototype.show=function(e){e?(this.myRootContainer.classList.remove("browserHidden"),this.myRootContainer.classList.add("browserVisible"),this.myRootContainer.style.display="block"):(this.myRootContainer.classList.remove("browserVisible"),this.myRootContainer.classList.add("browserHidden"),this.myRootContainer.style.display="none")},c.prototype.getRootContainer=function(){return this.myRootContainer},c.prototype.delegate=function(){return this.myDelegate},c.prototype.addToSelection=function(e){var t=this;function i(e){return-1==t.mySelectedIds.indexOf(e)&&(t.mySelectedIds.push(e),!0)}for(var n=0,r=e.length;n<r;++n){var o=e[n];if(i(o)){var s=t.idToElement[o];void 0===s?t.myDelegate.selectItem(o):s.classList.add("selected")}}},c.prototype.removeFromSelection=function(e){var t=this;function i(e){var i=t.mySelectedIds.indexOf(e);return-1!=i&&(t.mySelectedIds.splice(i,1),!0)}for(var n=e.length-1;n>=0;--n){var r=e[n];if(i(r)){var o=this.idToElement[r];void 0===o?t.myDelegate.deselectItem(r):o.classList.remove("selected")}}},c.prototype.setSelection=function(e){return this.removeFromSelection(this.mySelectedIds),this.addToSelection(e),this.mySelectedIds},c.prototype.clearSelection=function(){this.removeFromSelection(this.mySelectedIds)},c.prototype.createElements=function(e,t){if(e)for(var i=0;i<e.length;i++){var n=e[i];this.createElement(n,t)}},c.prototype.createElement=function(e,t){var i=this,l=i.myDelegate.getNodeId(e),c=a.createElement("item");t.appendChild(c),this.idToElement[l]=c,c.onmouseover=function(){i.myDelegate.onNodeHover(i,e)},c.onclick=function(t){i.myRootContainer.querySelector(".flipped").removeClass("flipped"),i.myDelegate.onNodeClick(i,e,t)};var h=a.createElement("div");h.classList.add("card"),c.appendChild(h);var u=a.createElement("div");u.classList.add("browserElement"),h.appendChild(u);var d=i.myDelegate.getNodeLabel(e),p=a.createElement("label");p.innerHTML=d,u.appendChild(p),p.onclick=function(t){i.myDelegate.onNodeClick(i,e,t)};var f=i.myDelegate.getThumbnail(e);if(f){var m=a.createElement("img");m.classList.add("thumb");var g=i.myDelegate.getThumbnailOptions(e);n.Document.requestThumbnailWithSecurity(g,(function(e,t){e?o.logger.error("Failed to load thumbnail: "+f,(0,r.errorCodeString)(r.ErrorCodes.NETWORK_FAILURE)):(m.src=s.URL.createObjectURL(t),m.onload=function(){s.URL.revokeObjectURL(m.src)})})),u.appendChild(m),m.onclick=function(t){i.myDelegate.onNodeClick(i,e,t)}}i.myDelegate.hasContent(e)&&i.myDelegate.addContent(e,h),c.classList.add(i.myDelegate.getNodeClass(e))}},62421:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Button:()=>a});var n,r,o=i(22031),s=i(16840);function a(e,t){o.Control.call(this,e,t);var i=this;this._state=a.State.INACTIVE;var n=this.getDocument();this.icon=n.createElement("div"),this.icon.classList.add("adsk-button-icon"),this.container.appendChild(this.icon),this.container.addEventListener("click",(function(e){i.getState()!==a.State.DISABLED&&(i.dispatchEvent(a.Event.CLICK),i.onClick&&i.onClick(e)),e.stopPropagation()})),(0,s.isTouchDevice)()?this.container.addEventListener("touchstart",s.touchStartToClick):(this.container.addEventListener("mouseover",(function(e){i.onMouseOver(e)})),this.container.addEventListener("mouseout",(function(e){i.onMouseOut(e)}))),this.addClass("adsk-button"),this.addClass(a.StateToClassMap[this._state])}a.Event={VISIBILITY_CHANGED:o.Control.Event.VISIBILITY_CHANGED,COLLAPSED_CHANGED:o.Control.Event.COLLAPSED_CHANGED,STATE_CHANGED:"Button.StateChanged",CLICK:"click"},a.State={ACTIVE:0,INACTIVE:1,DISABLED:2},a.StateToClassMap=(n=a.State,(r={})[n.ACTIVE]="active",r[n.INACTIVE]="inactive",r[n.DISABLED]="disabled",r),a.prototype=Object.create(o.Control.prototype),a.prototype.constructor=a,a.prototype.setState=function(e){if(e===this._state)return!1;this.removeClass(a.StateToClassMap[this._state]),this.addClass(a.StateToClassMap[e]),this._state=e;var t={type:a.Event.STATE_CHANGED,state:e};return this.dispatchEvent(t),!0},a.prototype.setIcon=function(e){this.iconClass&&this.icon.classList.remove(this.iconClass),this.iconClass=e,this.icon.classList.add(e)},a.prototype.getState=function(){return this._state},a.prototype.onClick=function(e){},a.prototype.onMouseOver=function(e){},a.prototype.onMouseOut=function(e){}},56905:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ComboButton:()=>s});var n=i(62421),r=i(84220),o=i(43644);function s(e,t){n.Button.call(this,e,t),this.arrowButton=new n.Button(e+"arrow"),this.arrowButton.addClass("adsk-button-arrow"),this.arrowButton.removeClass("adsk-button"),this.subMenu=new r.RadioButtonGroup(e+"SubMenu"),this.subMenu.addClass("toolbar-vertical-group"),this.subMenu.setVisible(!1),this.container.insertBefore(this.subMenu.container,this.container.firstChild),this.container.insertBefore(this.arrowButton.container,this.container.firstChild);var i=this;this.arrowButton.onClick=function(){i.subMenu.setVisible(!i.subMenu.isVisible())},this.toggleFlyoutVisible=function(){i.subMenu.setVisible(!i.subMenu.isVisible())},this.onClick=function(){i.subMenu.setVisible(!i.subMenu.isVisible())},this.subMenuActiveButtonChangedHandler=function(e){e.isActiveButton?(i.setIcon(e.target.getActiveButton().iconClass),i.setToolTip(e.target.getActiveButton().getToolTip()),i.setState(n.Button.State.ACTIVE),i.onClick=e.button.onClick):i.setState(n.Button.State.INACTIVE)},this.subMenu.addEventListener(r.RadioButtonGroup.Event.ACTIVE_BUTTON_CHANGED,this.subMenuActiveButtonChangedHandler);var s=(0,o.stringToDOM)('<div class="clickoff" style="position:fixed; top:0; left:0; width:100vw; height:100vh;"></div>');this.subMenu.container.insertBefore(s,this.subMenu.container.firstChild),s.addEventListener("click",(function(e){i.subMenu.setVisible(!1),e.stopPropagation()}))}s.prototype=Object.create(n.Button.prototype),s.prototype.constructor=s,s.prototype.addControl=function(e){this.subMenu.addControl(e),e.addEventListener(n.Button.Event.CLICK,this.toggleFlyoutVisible)},s.prototype.removeControl=function(e){this.subMenu.removeControl(e),e.removeEventListener(n.Button.Event.CLICK,this.toggleFlyoutVisible)},s.prototype.setState=function(e){if(e===n.Button.State.INACTIVE){var t=this.subMenu.getActiveButton();t&&t.setState(n.Button.State.INACTIVE)}n.Button.prototype.setState.call(this,e)},s.prototype.saveAsDefault=function(){this.defaultState={},this._toolTipElement&&this._toolTipElement.getAttribute("tooltipText")&&(this.defaultState.tooltip=this._toolTipElement.getAttribute("tooltipText")),this.defaultState.icon=this.iconClass,this.defaultState.onClick=this.onClick},s.prototype.restoreDefault=function(){this.defaultState&&(this.defaultState.tooltip&&this.setToolTip(this.defaultState.tooltip),this.defaultState.icon&&this.setIcon(this.defaultState.icon),this.onClick=this.defaultState.onClick,this.setState(n.Button.State.INACTIVE))}},22031:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Control:()=>r});var n=i(78443);function r(e,t){this._id=e,this._isCollapsible=!t||t.collapsible,this._toolTipElement=null,this._listeners={},this.container=this.getDocument().createElement("div"),this.container.id=e,this.addClass("adsk-control")}i(27293).GlobalManagerMixin.call(r.prototype),r.Event={VISIBILITY_CHANGED:"Control.VisibilityChanged",COLLAPSED_CHANGED:"Control.CollapsedChanged"},n.EventDispatcher.prototype.apply(r.prototype),r.prototype.constructor=r,r.prototype.container=null,r.prototype.getId=function(){return this._id},r.prototype.setVisible=function(e){if(!this.container.classList.contains("adsk-hidden")===e)return!1;e?this.container.classList.remove("adsk-hidden"):this.container.classList.add("adsk-hidden");var t={type:r.Event.VISIBILITY_CHANGED,target:this,controlId:this._id,isVisible:e};return this.dispatchEvent(t),!0},r.prototype.isVisible=function(){return!this.container.classList.contains("adsk-hidden")},r.prototype.setToolTip=function(e){return(!this._toolTipElement||this._toolTipElement.getAttribute("tooltipText")!==e)&&(this._toolTipElement||(this._toolTipElement=this.getDocument().createElement("div"),this._toolTipElement.id=this._id+"-tooltip",this._toolTipElement.classList.add("adsk-control-tooltip"),this.container.appendChild(this._toolTipElement)),this._toolTipElement.setAttribute("data-i18n",e),this._toolTipElement.setAttribute("tooltipText",e),this._toolTipElement.textContent=Autodesk.Viewing.i18n.translate(e,{defaultValue:e}),!0)},r.prototype.getToolTip=function(){return this._toolTipElement&&this._toolTipElement.getAttribute("tooltipText")},r.prototype.setCollapsed=function(e){if(!this._isCollapsible||this.isCollapsed()===e)return!1;e?this.container.classList.add("collapsed"):this.container.classList.remove("collapsed");var t={type:r.Event.COLLAPSED_CHANGED,isCollapsed:e};return this.dispatchEvent(t),!0},r.prototype.isCollapsed=function(){return!!this.container.classList.contains("collapsed")},r.prototype.isCollapsible=function(){return this._isCollapsible},r.prototype.addClass=function(e){this.container.classList.add(e)},r.prototype.removeClass=function(e){this.container.classList.remove(e)},r.prototype.getPosition=function(){var e=this.container.getBoundingClientRect();return{top:e.top,left:e.left}},r.prototype.getDimensions=function(){var e=this.container.getBoundingClientRect();return{width:e.width,height:e.height}},r.prototype.setDisplay=function(e){this.container.style.display=e},r.prototype.removeFromParent=function(){return!!this.parent&&this.parent.removeControl(this)}},3434:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ControlGroup:()=>r});var n=i(22031);function r(e,t){n.Control.call(this,e,t);var i=this;this._controls=[],this.addClass("adsk-control-group"),this.handleChildSizeChanged=function(e){var t={type:r.Event.SIZE_CHANGED,childEvent:e};i.dispatchEvent(t)}}r.Event={VISIBILITY_CHANGED:n.Control.Event.VISIBILITY_CHANGED,COLLAPSED_CHANGED:n.Control.Event.COLLAPSED_CHANGED,SIZE_CHANGED:"ControlGroup.SizeChanged",CONTROL_ADDED:"ControlGroup.ControlAdded",CONTROL_REMOVED:"ControlGroup.ControlRemoved"},r.prototype=Object.create(n.Control.prototype),r.prototype.constructor=r,r.prototype.addControl=function(e,t){e.setGlobalManager(this.globalManager);var i=t&&void 0!==t.index?t.index:this._controls.length;if(null!==this.getControl(e.getId()))return!1;var o={type:r.Event.CONTROL_ADDED,control:e,index:i};return i<this._controls.length?(this.container.insertBefore(e.container,this._controls[i].container),this._controls.splice(i,0,e)):(this.container.appendChild(e.container),this._controls.push(e)),e.addEventListener(n.Control.Event.VISIBILITY_CHANGED,this.handleChildSizeChanged),e.addEventListener(n.Control.Event.COLLAPSED_CHANGED,this.handleChildSizeChanged),e instanceof r&&e.addEventListener(r.Event.SIZE_CHANGED,this.handleChildSizeChanged),e.parent=this,this.dispatchEvent(o),this.dispatchEvent(r.Event.SIZE_CHANGED),!0},r.prototype.indexOf=function(e){for(var t=0;t<this._controls.length;t++){var i=this._controls[t];if(i===e||"string"==typeof e&&e===i.getId())return t}return-1},r.prototype.removeControl=function(e){var t="string"==typeof e?this.getControl(e):e;if(!t)return!1;var i=this._controls.indexOf(t);if(-1===i)return!1;this._controls.splice(i,1),this.container.removeChild(t.container);var o={type:r.Event.CONTROL_REMOVED,control:t,index:i};return t.removeEventListener(n.Control.Event.VISIBILITY_CHANGED,this.handleChildSizeChanged),t.removeEventListener(n.Control.Event.COLLAPSED_CHANGED,this.handleChildSizeChanged),t instanceof r&&t.removeEventListener(r.Event.SIZE_CHANGED,this.handleChildSizeChanged),t.parent=void 0,this.dispatchEvent(o),this.dispatchEvent(r.Event.SIZE_CHANGED),!0},r.prototype.getControl=function(e){for(var t=0;t<this._controls.length;t++)if(e===this._controls[t].getId())return this._controls[t];return null},r.prototype.getControlId=function(e){return e<0||e>=this._controls.length?null:this._controls[e].getId()},r.prototype.getNumberOfControls=function(){return this._controls.length},r.prototype.setCollapsed=function(e){if(!this._isCollapsible)return!1;var t=!1;return this._controls.forEach((function(i){i.isCollapsible()&&i.setCollapsed(e)&&(t=!0)})),t&&(e?this.container.classList.add("collapsed"):this.container.classList.remove("collapsed"),this.dispatchEvent({type:r.Event.COLLAPSED_CHANGED,isCollapsed:e})),t}},41595:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Filterbox:()=>o});var n=i(22031),r=i(71224);function o(e,t){this._id=e,this._listeners={},this._options=t||{},this._filterFunction=this._options.filterFunction||function(){};var i=this.getDocument();this.container=i.createElement("div"),this.container.id=e,this.addClass("adsk-control"),this.addClass("adsk-filterbox"),this.addClass("empty");var n=i.createElement("input");n.classList.add("filter-box"),n.classList.add("docking-panel-delimiter-shadow"),n.type="search",n.placeholder=r.Z.t("Enter filter term"),n.setAttribute("data-i18n","Enter filter term"),n.incremental="incremental",n.autosave=this.container.id+"filter",this.container.appendChild(n),this.filterbox=n;var o=this,s=function(e){0===(e=e.trim()).length?o.container.classList.add("empty"):o.container.classList.remove("empty"),o._filterFunction&&o._filterFunction(e)},a=i.createElement("div");a.className="filter-box-icon",this.container.insertBefore(a,n.nextSibling);var l=i.createElement("div");l.className="filter-box-close",l.addEventListener("click",(function(){o.filterbox.value="",o.addClass("empty")})),this.container.appendChild(l),n.addEventListener("keydown",(function(e){var t=o.getWindow();13===(e=e||t.event).keyCode&&o.filterbox.blur()})),n.addEventListener("input",(function(){s(this.value)})),n.addEventListener("change",(function(){s(this.value)})),n.addEventListener("focus",(function(){a.classList.add("focused")})),n.addEventListener("blur",(function(){a.classList.remove("focused")}))}o.prototype=Object.create(n.Control.prototype),o.prototype.constructor=o},84220:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RadioButtonGroup:()=>s});var n=i(3434),r=i(62421),o=i(22031);function s(e,t){n.ControlGroup.call(this,e,t);var i=this;this._activeButton=null,this._handleButtonStateChange=function(e){var t=r.Button.State;e.state===t.ACTIVE?(i._activeButton=e.target,i.dispatchEvent({type:s.Event.ACTIVE_BUTTON_CHANGED,button:e.target,isActiveButton:!0}),i._controls.forEach((function(i){i!==e.target&&i.getState()!==t.DISABLED&&i.setState(t.INACTIVE)}))):e.target===i._activeButton&&(i._activeButton=null,i.dispatchEvent({type:s.Event.ACTIVE_BUTTON_CHANGED,button:e.target,isActiveButton:!1}))}}s.Event={ACTIVE_BUTTON_CHANGED:"RadioButtonGroup.ActiveButtonChanged",VISIBILITY_CHANGED:o.Control.Event.VISIBILITY_CHANGED,COLLAPSED_CHANGED:o.Control.Event.COLLAPSED_CHANGED,CONTROL_ADDED:n.ControlGroup.Event.CONTROL_ADDED,CONTROL_REMOVED:n.ControlGroup.Event.CONTROL_REMOVED,SIZE_CHANGED:n.ControlGroup.Event.SIZE_CHANGED},s.prototype=Object.create(n.ControlGroup.prototype),s.prototype.constructor=s,s.prototype.addControl=function(e,t){return e instanceof r.Button&&(!!n.ControlGroup.prototype.addControl.call(this,e,t)&&(e.addEventListener(r.Button.Event.STATE_CHANGED,this._handleButtonStateChange),!0))},s.prototype.removeControl=function(e){var t="string"==typeof e?this.getControl(e):e;return!(null===t||!n.ControlGroup.prototype.removeControl.call(this,t))&&(t.removeEventListener(r.Button.Event.STATE_CHANGED,this._handleButtonStateChange),!0)},s.prototype.getActiveButton=function(){return this._activeButton}},55318:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});let n="search-selected"},8022:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Searchbox:()=>E});var n=i(22031),r=i(55318),o=i(49720),s=i(78443),a=i(79976),l=i(27293),c=50,h=100;function u(e,t,i){let n=i;this.excludeRoot=t,(n instanceof Autodesk.Viewing.GuiViewer3D||n instanceof Autodesk.Viewing.Viewer3D)&&(o.logger.warn("Deprecated use of Viewer as parameter. Provide container instead"),n=i.container),this.results=[],this.resultCount=0,this.selectedIndex=-1;let r=this.getDocument();this.container=r.createElement("div"),this.container.classList.add("docking-panel"),this.container.classList.add("adsk-search-results"),this.container.results=r.createElement("div"),this.container.results.classList.add("docking-panel-scroll"),this.container.results.classList.add("docking-panel-container-solid-color-b"),this.container.results.addEventListener("scroll",p.bind(this)),this.container.appendChild(this.container.results),e.insertBefore(this.container,e.firstChild),this.scrollingContainer=r.createElement("div"),this.scrollingContainer.classList.add("adsk-search-results-scrolling-panel"),this.scrollingContainer.addEventListener("click",d.bind(this)),this.container.results.appendChild(this.scrollingContainer),this.footer=new a.ResizeFooter(this.container,function(){var e=this.container.getBoundingClientRect(),t=n.getBoundingClientRect();t.right<e.right&&(this.container.style.width=t.right-e.left+"px"),t.bottom<e.bottom&&(this.container.style.height=t.bottom-e.top+"px")}.bind(this)),this.footer.setGlobalManager(this.globalManager),this.divNoResults=function(e){var t=e.createElement("div"),i=e.createElement("div"),n=e.createElement("div");t.classList.add("no-results-container"),t.style.display="none";var r="No Results";i.setAttribute("data-i18n",r),i.textContent=Autodesk.Viewing.i18n.translate(r),i.classList.add("no-results-title");var o="Try another term";return n.setAttribute("data-i18n",o),n.textContent=Autodesk.Viewing.i18n.translate(o),n.classList.add("no-results-description"),t.appendChild(i),t.appendChild(n),t.domTitle=i,t.domMessage=n,t}(r),this.scrollingContainer.appendChild(this.divNoResults),this.scrollY=0,this.dirty=!1,this.nextFrameId=0,this.it={init:function(e){return this.isDone=!1,this.results=e,this.indexRs=0,this.indexId=-1,this},done:function(){return this.isDone},next:function(){if(this.isDone)return this;for(this.indexId++;this.results.length!==this.indexRs&&this.indexId===this.results[this.indexRs].ids.length;)this.indexId=0,this.indexRs++;return this.isDone=this.indexRs===this.results.length,this},id:function(){return this.results[this.indexRs].ids[this.indexId]},delegate:function(){return this.results[this.indexRs].delegate}},this.elementsPool=[],this.elementsUsed=0;for(var s=0;s<150;++s)this.elementsPool[s]=v(r);this.setVisible(!1)}function d(e){var t=e.target,i=this._getNodeAndModelIds(t);i&&(this.fireEvent({type:r.J,id:i.nodeId,modelId:i.modelId}),e.preventDefault())}function p(){var e=this.container.results.scrollTop;Math.abs(this.scrollY-e)>=100&&(this.scrollY=e,f(this))}function f(e,t){e.dirty&&!t||(t?m(e):(e.dirty=!0,e.nextFrameId=requestAnimationFrame((function(){m(e)}))))}function m(e){e.dirty=!1,function(e){for(var t=e.elementsUsed,i=e.elementsPool,n=0;n<t;++n){y(i[n])}e.elementsUsed=0}(e),0!==e.resultCount?(e.setDisplayNoResults(!1),function(e){var t=e.container.results,i=0,n=t.clientHeight,r=e.scrollY,o=e.it.init(e.results),s=Math.max(0,e.scrollY-h),a=0|Math.floor(s/c),l=0;i=a*c;for(;a;)a--,l++,o.next();var u=e.elementsPool[e.elementsUsed++];u.style.height=i+"px",e.scrollingContainer.appendChild(u);var d=!0;for(;d;){if(o.next(),o.done()){d=!1;break}if(i>r+n+h){d=!1;break}if(e.elementsUsed===e.elementsPool.length){d=!1;break}var p=o.id(),f=o.delegate(),m=i+c,v=e.elementsPool[e.elementsUsed++];g(p,f,v,e,l===e.selectedIndex),e.scrollingContainer.appendChild(v),i=m,l++}var y=e.resultCount*c;e.scrollingContainer.style.height=y+"px"}(e)):e.setDisplayNoResults(!0)}function g(e,t,i,n,r){i.classList.add("search-result"),r?i.classList.add("selected"):i.classList.remove("selected"),i.setAttribute("lmv-nodeId",e),i.setAttribute("lmv-modelId",t.model.id),i.style.height="50px";var o=t.instanceTree.getNodeName(e),s=n.searchString,a=o.toLowerCase().indexOf(s.toLowerCase()),l=o.substr(0,a),c=o.substr(a,s.length),h=o.substr(a+s.length);i.domPrefix.innerText=l,i.domMatch.innerText=c,i.domSufix.innerText=h;var u=function(e,t,i){var n=[],r=t.getRootId(),o=i.isRootExcluded(),s=t.instanceTree,a=e,l=!1;for(;a&&!l&&(a!==r||(l=!0,!o));){var c=s.getNodeName(a);n.unshift(c),a=s.getNodeParentId(a)}return n}(e,t,n);i.domPath.innerText=u.join(" > ")}function v(e){var t=e.createElement("div"),i=e.createElement("div"),n=e.createElement("span"),r=e.createElement("span"),o=e.createElement("span"),s=e.createElement("span");return i.classList.add("search-result-container"),r.classList.add("search-match"),s.classList.add("search-path"),i.appendChild(n),i.appendChild(r),i.appendChild(o),i.appendChild(s),t.appendChild(i),t.domPrefix=n,t.domMatch=r,t.domSufix=o,t.domPath=s,t.domContainer=i,t}function y(e){e.setAttribute("lmv-nodeId",""),e.setAttribute("lmv-modelId",""),e.domPrefix.innerText="",e.domMatch.innerText="",e.domSufix.innerText="",e.domPath.innerText="",e.style.height="0"}function b(e,t){e.scrollTop+e.clientHeight<(t+1)*c&&(e.scrollTop+=(t+1)*c-(e.scrollTop+e.clientHeight)),e.scrollTop/c>t&&(e.scrollTop=t*c)}u.prototype.constructor=u,s.EventDispatcher.prototype.apply(u.prototype),l.GlobalManagerMixin.call(u.prototype),u.prototype.setPosition=function(e,t){this.container.style.left=e+"px",this.container.style.top=t+"px"},u.prototype.setMinWidth=function(e){this.container.style.width=e+"px"},u.prototype.setMaxWidth=function(e){this.container.style.maxHeight=e+"px"},u.prototype.setVisible=function(e){this.container.style.display=e?"":"none"},u.prototype.setResults=function(e,t){this.searchString=e,this.results=t,this.resultCount=function(e){for(var t=0,i=0;i<e.length;++i){t+=e[i].ids.length}return t}(t),this.selectedIndex=0==this.resultCount?-1:0,this.container.style.height=this.resultCount*c+20+"px",this.container.results.scrollTop=0,this.scrollY=0,0===this.resultCount?this.container.classList.add("no-content"):this.container.classList.remove("no-content"),f(this)},u.prototype.getSelection=function(){var e=this.scrollingContainer.querySelector(".selected");if(!e)return null;var t=this._getNodeAndModelIds(e);return t||null},u.prototype.isRootExcluded=function(){return!(this.results&&this.results.length>1)&&(!(this.modelCount>1)&&this.excludeRoot)},u.prototype.uninitialize=function(){this.setVisible(!1),this.container=null,this.container.parentNode&&this.container.parentNode.removeChild(this.container),cancelAnimationFrame(this.nextFrameId),this.clearListeners()},u.prototype.setDisplayNoResults=function(e){this.divNoResults.style.display=e?"":"none"},u.prototype.selectNext=function(){0!==this.resultCount&&(this.selectedIndex=Math.min(this.resultCount-1,this.selectedIndex+1),b(this.container.results,this.selectedIndex),f(this))},u.prototype.selectPrevious=function(){0!==this.resultCount&&(this.selectedIndex=Math.max(0,this.selectedIndex-1),b(this.container.results,this.selectedIndex),f(this))},u.prototype._getNodeAndModelIds=function(e){for(;!e.hasAttribute("lmv-nodeId");)if(!(e=e.parentNode)||e===this.scrollingContainer)return;return{nodeId:parseInt(e.getAttribute("lmv-nodeId")),modelId:parseInt(e.getAttribute("lmv-modelId"))}};var x=i(71224);const _=i(23279);function E(e,t,i){this._id=e,this._listeners={},this._options=i||{},this._searchFunction=this._options.searchFunction||function(){};var n=this.getDocument();this.container=n.createElement("div"),this.container.id=e,this.addClass("adsk-control"),this.addClass("adsk-searchbox"),this.addClass("empty");var s=n.createElement("input");s.classList.add("search-box"),s.classList.add("docking-panel-delimiter-shadow"),s.type="search",s.results=[],s.placeholder=x.Z.t("Search"),s.setAttribute("data-i18n","Search"),s.incremental="incremental",s.autosave=this.container.id+"search_autosave",this.container.insertBefore(s,this.scrollContainer),this.searchbox=s;var a=function(){d.searchbox.value="",d.addClass("empty")},l=function(){d.searchbox.classList.remove("searching"),d.searchResults.setVisible(!1)},c=n.createElement("div");c.className="search-box-icon",this.container.insertBefore(c,s.nextSibling);var h=n.createElement("div");h.className="search-box-close",h.addEventListener("click",(function(){a(),l()})),this.container.appendChild(h),this.searchResults=new u(this.container,i.excludeRoot,t),this.searchResults.addEventListener(r.J,(function(e){a(),l(),d.fireEvent(e)}));var d=this,p=!0;s.addEventListener("keydown",(function(e){var t=d.getWindow();if(38===(e=e||t.event).keyCode&&(d.searchResults.selectPrevious(),e.preventDefault()),40===e.keyCode&&(d.searchResults.selectNext(),e.preventDefault()),13===e.keyCode){var i=d.searchResults.getSelection();if(!i)return!1;a(),l(),d.fireEvent({type:E.Events.ON_SEARCH_SELECTED,id:i.nodeId,modelId:i.modelId}),e.preventDefault()}}));var f=_((()=>{if(0===s.value.length)return d.container.classList.add("empty"),void l();d.container.classList.remove("empty"),s.value.length<3||function(){var e=s.value.trim();if(0!==e.length){p&&(o.logger.track({category:"search_node",name:"model_browser_tool"}),p=!1),s.classList.add("searching");var t=d._searchFunction(e);d.searchResults.setResults(e,t),d.searchResults.setVisible(!0)}else l()}()}),800);s.addEventListener("input",(function(){f()})),s.addEventListener("change",(function(e){var t=d.getDocument();e.target===t.activeElement&&f()})),s.addEventListener("focus",(function(){c.classList.add("focused")})),s.addEventListener("blur",(function(){c.classList.remove("focused")}))}E.prototype=Object.create(n.Control.prototype),E.prototype.constructor=E,E.Events={ON_SEARCH_SELECTED:r.J}},73484:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SplitViewLayout:()=>c});const n={down:{pointer:"pointerdown",mouse:"mousedown",touch:"touchstart"},up:{pointer:"pointerup",mouse:"mouseup",touch:"touchend"},move:{pointer:"pointermove",mouse:"mousemove",touch:"touchmove"}};function r(e){if(Autodesk.Viewing.isIE11)return[n[e].pointer];const t=[];return Autodesk.Viewing.isMobileDevice()||t.push(n[e].mouse),Autodesk.Viewing.isTouchDevice()&&t.push(n[e].touch),t}function o(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=(n?"remove":"add")+"EventListener",s=r(t);for(const t of s)e[o](t,i)}class s{constructor(e,t){this.container=e,this.isDragging=!1,this.resizeHandlerElement=null,this.onMoveCB=t,this.panelSizeThreshold=20,this.margin=16,this.initResizeHandlerElement()}onDown(e){this.isDragging=!0,e.preventDefault()}onUp(e){this.isDragging=!1}onMove(e){if(this.isDragging){"touchmove"===e.type&&(e.pageX=e.touches[0].pageX,e.pageY=e.touches[0].pageY);const t=this.container.getBoundingClientRect(),i=this.getTargetWidthPercentage(e,t);this.panelSizeThreshold<i&&i<100-this.panelSizeThreshold&&this.onMoveCB(i)}}getTargetWidthPercentage(e,t){}initResizeHandlerElement(){this.resizeHandlerElement=document.createElement("div"),this.handlerSplitLine=document.createElement("div"),this.resizeHandlerElement.appendChild(this.handlerSplitLine),o(this.resizeHandlerElement,"down",this.onDown.bind(this)),this.onUpBinded=this.onUp.bind(this),this.onMoveBinded=this.onMove.bind(this),o(document,"move",this.onMoveBinded),o(document,"up",this.onUpBinded),this.resizeHandlerElement.className="resize-handler",this.handlerSplitLine.className="resize-handler-center-mark"}setPosition(e){}terminate(){this.resizeHandlerElement.parentNode.removeChild(this.resizeHandlerElement),this.resizeHandlerElement=null,o(document,"up",this.onUpBinded,!0),o(document,"move",this.onMoveBinded,!0)}}class a extends s{initResizeHandlerElement(){super.initResizeHandlerElement(),this.resizeHandlerElement.classList.add("vertical"),this.handlerSplitLine.classList.add("vertical"),this.resizeHandlerElement.style.width=`${this.margin}px`}getTargetWidthPercentage(e,t){return(e.pageX-t.left)/t.width*100}setPosition(e){this.resizeHandlerElement.style.left=`calc(${e}% - ${this.margin/2}px)`}}class l extends s{initResizeHandlerElement(){super.initResizeHandlerElement(),this.resizeHandlerElement.classList.add("horizontal"),this.handlerSplitLine.classList.add("horizontal"),this.resizeHandlerElement.style.height=`${this.margin}px`}getTargetWidthPercentage(e,t){return(e.pageY-t.top)/t.height*100}setPosition(e){this.resizeHandlerElement.style.top=`calc(${e}% - ${this.margin/2}px)`}}class c{constructor(e){this._splitType=e||c.SplitType.Vertical,this.onResizeHandlerMove=this.onResizeHandlerMove.bind(this)}createSplitViewLayout(e,t,i){if(this.targetContainer=e,this.splitViewContainer=document.createElement("div"),this.splitViewContainer.classList.add("split-view-container"),this.targetContainer.parentNode.replaceChild(this.splitViewContainer,this.targetContainer),this.firstViewerContainer=this.wrapViewerContainer(t),this._splitType===c.SplitType.Vertical)this._resizeHandler=new a(this.splitViewContainer,this.onResizeHandlerMove);else{if(this._splitType!==c.SplitType.Horizontal)return void console.error("unknown splitType");this._resizeHandler=new l(this.splitViewContainer,this.onResizeHandlerMove)}this._resizeHandler&&this.splitViewContainer.appendChild(this._resizeHandler.resizeHandlerElement),this.secondViewerContainer=this.wrapViewerContainer(i),this.onResizeHandlerMove(50)}wrapViewerContainer(e){const t=document.createElement("div");return t.className="split-view-viewer-container",e&&t.appendChild(e),this.splitViewContainer.appendChild(t),t}restoreMainViewer(){this._resizeHandler&&(this._resizeHandler.terminate(),this._resizeHandler=null),this.splitViewContainer&&(this.splitViewContainer.parentNode.replaceChild(this.targetContainer,this.splitViewContainer),this.splitViewContainer=null,this.targetContainer=null,this.firstViewerContainer=null,this.secondViewerContainer=null)}onResizeHandlerMove(e){this._resizeHandler&&this._resizeHandler.setPosition(e),this._splitType===c.SplitType.Vertical?(this.firstViewerContainer.style.width=`${e}%`,this.secondViewerContainer.style.width=100-e+"%",this.secondViewerContainer.style.left=`${e}%`):this._splitType===c.SplitType.Horizontal&&(this.firstViewerContainer.style.height=`${e}%`,this.secondViewerContainer.style.height=100-e+"%",this.secondViewerContainer.style.top=`${e}%`)}}c.SplitType={Vertical:"vertical",Horizontal:"horizontal"}},34358:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ToolBar:()=>o});var n=i(3434),r=i(22031);function o(e,t){n.ControlGroup.call(this,e,t),this.removeClass("adsk-control-group"),this.addClass("adsk-toolbar"),t&&t.alignVertically&&this.addClass("adsk-toolbar-vertical")}o.Event={VISIBILITY_CHANGED:r.Control.Event.VISIBILITY_CHANGED,COLLAPSED_CHANGED:r.Control.Event.COLLAPSED_CHANGED,CONTROL_ADDED:n.ControlGroup.Event.CONTROL_ADDED,CONTROL_REMOVED:n.ControlGroup.Event.CONTROL_REMOVED,SIZE_CHANGED:n.ControlGroup.Event.SIZE_CHANGED},o.prototype=Object.create(n.ControlGroup.prototype),o.prototype.constructor=o},82933:(e,t,i)=>{"use strict";i.r(t)},96288:(e,t,i)=>{function n(t,i){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e.exports[n]=t[n],i&&(e.exports[i][n]=t[n]))}i(92087),i(83475),i(46273),i(51568),i(26349),i(10072),i(99137),i(71957),i(96306),i(103),i(8582),i(90618),i(74592),i(88440),i(58276),i(35082),i(12813),i(18222),i(24838),i(38563),i(50336),i(7512),i(46603),i(70100),i(10490),i(13187),i(60092),i(19041),i(30666),i(51638),i(62975),i(15728),i(46056),i(44299),i(5162),i(50292),i(1025),i(77479),i(34582),i(47896),i(12647),i(98558),i(84018),i(97507),i(61605),i(49076),i(34999),i(88921),i(96248),i(13599),i(11477),i(64362),i(15389),i(46006),i(90401),i(45164),i(91238),i(54837),i(87485),i(56767),i(69916),i(76651),i(61437),i(35285),i(39865),i(86035),i(67501),i(21568),i(48824),i(44130),i(78206),i(76478),i(79715),i(43561),i(32049),i(86020),i(56585),i(84633),e.exports.Autodesk=i(17168).Autodesk;var r=Object.assign||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])};e.exports.THREE=i(41434),e.exports.av={},e.exports.avp={},e.exports.avu={},e.exports.ave={},n({Hammer:i(35255)},"av"),n(i(16840),"av"),n(i(16840),"avp"),n(i(43644),"avp"),n(i(43644),"av"),n(i(19531),"avp"),n(i(36291),"avp"),n(i(53005),"avp"),n(i(53005),"av"),n(i(73993),"avp");const o=i(71224).Z;o.translate=o.t.bind(o),o.localize=()=>{},n({i18n:o},"av"),n(i(63740),"avp"),n(i(67494),"avp"),n(i(49720),"avp"),n(i(29996),"avp"),n(i(76428),"avp"),n(i(40424),"avp"),n(i(85660),"avp"),n(i(86146),"avp"),n(i(81212),"avp"),n(i(50437),"avp"),n(i(83539),"avp"),n(i(41839),"avp"),n(i(29480),"avp"),n(i(68539),"avp"),n(i(54924),"avp"),n(i(82089),"avp"),n(i(10940),"avp"),n(i(51044),"avp"),n(i(38074),"avp"),n(i(47243),"avp"),n(i(57865),"avp"),n(i(20657),"avp"),n(i(63855),"avp"),n(i(40582),"avp"),n(i(84807),"avp"),n(i(2285),"avp"),n(i(12156),"avp"),n(i(419),"avp"),n(i(41723),"avp"),n(i(34423),"avp"),n(i(11613),"avp"),n(i(27957),"avp"),n(i(98500),"avp"),n(i(39651),"avp"),n(i(5394),"avp"),n(i(23850),"avp"),n(i(54604),"avp"),n(i(20806),"avp"),n(i(1454),"avp"),n(i(42198),"avp"),n(i(91128),"avp"),n(i(70422),"avp"),n(i(22769),"avp"),n(i(62206),"avp"),n(i(9038),"avp"),n(i(33526),"avp"),n(i(60485),"avp"),n(i(10834),"avp"),n(i(14021),"avp"),n(i(55339),"avp"),n(i(4123),"av"),n(i(14936),"avp"),n(i(87100),"avp"),n(i(5120),"avp"),n(i(35797),"avp"),n(i(24201),"avp"),n(i(97818),"avp"),n(i(16697),"avp"),n(i(88816),"avp"),n(i(48531),"avp"),n(i(29865),"avp"),n(i(754),"avp"),n(i(78293),"avp"),n(i(73098),"avp"),n(i(75968),"avp"),n(i(19157),"avp"),n(i(82079),"av"),n(i(75121),"av"),n(i(32154),"avp"),n(i(22907),"avp"),n(i(76063),"avp"),n(i(93033),"avp"),n(i(62868),"avp"),n(i(51187),"avp"),n(i(11236),"avp"),n(i(30110),"avp"),n(i(47929),"avp");const s=e.exports.av.SceneBuilder={};r(s,i(93033)),r(s,i(62868)),r(s,i(51187)),r(s,i(11236)),r(s,i(30110)),r(s,i(47929)),n(i(72614),"av"),n(i(77693),"av"),n(i(78443),"av"),n(i(20457),"av"),n(i(9749),"av"),n(i(66033),"av"),n(i(33423),"av"),n(i(21553),"av"),n(i(53427),"av"),n(i(34345),"avp"),n(i(22038),"avp"),n(i(83833),"avp"),n(i(18989),"av"),n(i(38215),"av"),n(i(52208),"avp"),n(i(59991),"avp"),n(i(51968),"av"),n(i(50467),"av"),n(i(83368),"av"),n(i(54372),"avp"),n(i(63946),"avp"),n(i(43095),"av"),n(i(84670),"av"),n(i(16526),"av"),n(i(60301),"av"),n(i(13138),"av"),n(i(62383),"av"),n(i(88364),"av"),n(i(7452),"av"),n(i(64432),"av"),n(i(97967),"avp"),e.exports.av.ModelUnits=i(97967).ModelUnits,n(i(1669),"avp"),n(i(93293),"av"),n(i(85552),"avp");var a=e.exports.av.MeasureCommon={};r(a,i(78364)),a.MeasurementTypes=i(67886).o,a.MeasurementTypesToAnalytics=i(67886).D,a.SnapType=i(16310).t,a.Events=i(21980).n,a.Measurement=i(51979).g,a.SnapResult=i(38970).N,n(i(5073),"av"),n(i(27293),"av"),n(i(37231),"avp"),n(i(86788),"avp"),n(i(99946),"avp"),n(i(76052),"av"),n(i(44822),"av"),n(i(31255),"avp"),n(i(25590),"av"),n(i(29156),"avp"),n(i(89853),"av"),n(i(42502),"av"),n(i(27587),"av"),n(i(85623),"av"),n(i(82877),"av"),n(i(30126),"av"),n(i(79002),"av"),n(i(88762),"av"),n(i(34808),"av"),n(i(16274),"av"),n(i(21609),"av"),n(i(37804),"av"),n(i(93642),"avp"),n(i(92617),"avp"),n(i(24264),"avp"),n(i(94163),"avp"),n(i(47899),"avp"),n(i(79291),"avp"),n(i(77298),"avp"),n(i(63560),"avp"),n(i(94094),"avp"),n(i(85218),"avp"),n(i(91531),"av"),n(i(49027),"av"),n(i(72336),"avp"),n(i(41099),"avp"),i(82933),n(i(95420),"avu"),n(i(19742),"avu"),n(i(9178),"avu"),n(i(63988),"avu"),n(i(79976),"avp"),n(i(160),"avu"),n(i(94577),"avu"),n(i(18008),"avp"),n(i(74057),"avp"),n(i(22343),"avp"),n(i(52671),"avp"),n(i(44355),"avu"),n(i(58927),"avu"),n(i(38329),"avu"),n(i(85523),"avp"),n(i(55390),"ave"),n(i(22031),"avu"),n(i(3434),"avu"),n(i(62421),"avu"),n(i(84220),"avu"),n(i(56905),"avu"),n(i(34358),"avu"),n(i(99902),"avp"),n(i(47710),"avu"),n(i(41595),"avu"),n(i(8022),"avu"),n(i(58847),"avp"),n(i(25230),"ave"),n(i(12194),"ave"),n(i(48155),"ave"),n(i(26523),"ave"),n(i(5442),"av"),n(i(38780),"av"),n(i(73484),"avu"),n(i(35150),"av"),n(i(830),"av"),n(i(91708),"av"),n(i(29742),"av"),n(i(86783),"avp"),n(i(41112),"av"),i(71947).i(e.exports)},29742:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CrossViewerInteractionCommon:()=>r});var n=i(33423);const r={onSelectionChanged:{eventName:n.AGGREGATE_SELECTION_CHANGED_EVENT,cb:(e,t,i)=>{const n=e.getAggregateSelection();if(t.impl.model)if(n.length>0)for(let e=0;e<n.length;e++){const i=n[e],r=i.model,o=i.selection;for(let e=0;e<t.impl.modelQueue().getModels().length;e++){const i=t.impl.modelQueue().getModels()[e];i&&i.getDocumentNode()&&r.getDocumentNode()&&i.getDocumentNode().originModel===r.getDocumentNode().originModel?(t.impl.is2d?t.select(o,i):(t.showAll(),t.select(o,i),t.isolate(o,i)),t.fitToView(o)):!t.impl.is2d&&i.visibilityManager&&i.visibilityManager.setAllVisibility(!1)}}else t.clearSelection(),t.impl.is2d||t.showAll()}}}},91708:(e,t,i)=>{"use strict";i.r(t),i.d(t,{createLeechViewer:()=>P});var n=i(2285);function r(e){Autodesk.Viewing.Private.RenderContext.call(this),this.originalInit=this.init.bind(this),this.init=function(t,i,n){var r;let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.canvas=e,this.ctx2D=this.canvas.getContext("2d");const s=!0!==(null===(r=o.webglInitParams)||void 0===r?void 0:r.alpha),a=Object.assign({},o,{offscreen:!0,removeAlphaInOutput:s});this.originalInit(t,i,n,a),this.glrenderer=t;const l=this.glrenderer.getPixelRatio();this.setSize(i/l,n/l)},this.renderToCanvas=function(){this.ctx2D&&(this.getOffscreenTarget()||0!=this.widthWithPixelRatio&&0!=this.heightWithPixelRatio&&(this.ctx2D.clearRect(0,0,this.widthWithPixelRatio,this.heightWithPixelRatio),this.ctx2D.drawImage(this.glrenderer.domElement,0,this.glrenderer.domElement.height-this.heightWithPixelRatio,this.widthWithPixelRatio,this.heightWithPixelRatio,0,0,this.widthWithPixelRatio,this.heightWithPixelRatio)))},this.originalSetSize=this.setSize.bind(this),this.setSize=function(e,t,i,n){if(!n){const i=this.glrenderer.getPixelRatio();this.width=e,this.height=t,this.widthWithPixelRatio=e*i,this.heightWithPixelRatio=t*i,this.canvas.width=this.widthWithPixelRatio,this.canvas.height=this.heightWithPixelRatio,this.canvas.style.width=`${this.width}px`,this.canvas.style.height=`${this.height}px`}this.prepareViewport(i,n),this.restoreViewport()},this.prepareViewport=function(e,t){this.glrenderer.pushViewport();const i=this.glrenderer.getPixelRatio(),n=this.glrenderer.domElement.width/i,r=this.glrenderer.domElement.height/i;(n<this.width||r<this.height)&&this.glrenderer.setSize(Math.max(this.width,n),Math.max(this.height,r)),this.originalSetSize(this.width,this.height,e,t)},this.restoreViewport=function(){this.glrenderer.popViewport()}}r.prototype=Object.create(n.RenderContext.prototype),r.prototype.constructor=r;var o=i(34345),s=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var i=-1;return e.some((function(e,n){return e[0]===t&&(i=n,!0)})),i}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var i=e(this.__entries__,t),n=this.__entries__[i];return n&&n[1]},t.prototype.set=function(t,i){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=i:this.__entries__.push([t,i])},t.prototype.delete=function(t){var i=this.__entries__,n=e(i,t);~n&&i.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var i=0,n=this.__entries__;i<n.length;i++){var r=n[i];e.call(t,r[1],r[0])}},t}()}(),a="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,l=void 0!==i.g&&i.g.Math===Math?i.g:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),c="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(l):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)};var h=["top","right","bottom","left","width","height","size","weight"],u="undefined"!=typeof MutationObserver,d=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var i=!1,n=!1,r=0;function o(){i&&(i=!1,e()),n&&a()}function s(){c(o)}function a(){var e=Date.now();if(i){if(e-r<2)return;n=!0}else i=!0,n=!1,setTimeout(s,t);r=e}return a}(this.refresh.bind(this),20)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,i=t.indexOf(e);~i&&t.splice(i,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){a&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){a&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,i=void 0===t?"":t;h.some((function(e){return!!~i.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),p=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];Object.defineProperty(e,r,{value:t[r],enumerable:!1,writable:!1,configurable:!0})}return e},f=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||l},m=_(0,0,0,0);function g(e){return parseFloat(e)||0}function v(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];return t.reduce((function(t,i){return t+g(e["border-"+i+"-width"])}),0)}function y(e){var t=e.clientWidth,i=e.clientHeight;if(!t&&!i)return m;var n=f(e).getComputedStyle(e),r=function(e){for(var t={},i=0,n=["top","right","bottom","left"];i<n.length;i++){var r=n[i],o=e["padding-"+r];t[r]=g(o)}return t}(n),o=r.left+r.right,s=r.top+r.bottom,a=g(n.width),l=g(n.height);if("border-box"===n.boxSizing&&(Math.round(a+o)!==t&&(a-=v(n,"left","right")+o),Math.round(l+s)!==i&&(l-=v(n,"top","bottom")+s)),!function(e){return e===f(e).document.documentElement}(e)){var c=Math.round(a+o)-t,h=Math.round(l+s)-i;1!==Math.abs(c)&&(a-=c),1!==Math.abs(h)&&(l-=h)}return _(r.left,r.top,a,l)}var b="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof f(e).SVGGraphicsElement}:function(e){return e instanceof f(e).SVGElement&&"function"==typeof e.getBBox};function x(e){return a?b(e)?function(e){var t=e.getBBox();return _(0,0,t.width,t.height)}(e):y(e):m}function _(e,t,i,n){return{x:e,y:t,width:i,height:n}}var E=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=x(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),A=function(e,t){var i=function(e){var t=e.x,i=e.y,n=e.width,r=e.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return p(s,{x:t,y:i,width:n,height:r,top:i,right:t+n,bottom:r+i,left:t}),s}(t);p(this,{target:e,contentRect:i})},S=function(){function e(e,t,i){if(this.activeObservations_=[],this.observations_=new s,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=i}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof f(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new E(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof f(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new A(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),w="undefined"!=typeof WeakMap?new WeakMap:new s,M=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=d.getInstance(),n=new S(t,i,this);w.set(this,n)};["observe","unobserve","disconnect"].forEach((function(e){M.prototype[e]=function(){var t;return(t=w.get(this))[e].apply(t,arguments)}}));const T=void 0!==l.ResizeObserver?l.ResizeObserver:M,C=new Map;function P(e,t,i,n){if(C.has(n)){return new(C.get(n))(e,t,i)}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;this.sharedResources=i,n.call(this,e,t),this.renderContext=new r(this.canvas),this.sharedResources.mrtFlags?this.renderContext.mrtFlags=this.sharedResources.mrtFlags:this.sharedResources.mrtFlags=this.renderContext.mrtFlags,this.resizeObserver=new T((e=>{const t=e[0].contentRect,i=Math.floor(t.width),n=Math.floor(t.height);i&&n&&(this.impl.resize(i,n,!0),this.dispatchEvent({type:Autodesk.Viewing.VIEWER_RESIZE_EVENT,width:i,height:n}),this.impl.tick(performance.now()))})),this.resizeObserver.observe(this.container)}function a(e,t){let i=e.getModelKey();i+=".ref:"+!!t.applyRefPoint;return i+=".g:"+(t.globalOffset?[t.globalOffset.x,t.globalOffset.y,t.globalOffset.z]:[0,0,0]).toString(),t.placementTransform&&(i+=".p:"+t.placementTransform.toArray().toString()),t.customHash&&(i+=".h:"+t.customHash),i}s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.prototype.initialize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={glrenderer:this.sharedResources.glrenderer,materialManager:this.sharedResources.materialManager,renderer:this.renderContext},i=Object.assign({},e,t),r=n.prototype.initialize.call(this,i);return this.overrideAPIs(),this.sharedResources.geomCache&&this.sharedResources.geomCache.initialized&&this.impl.setGeomCache(this.sharedResources.geomCache),r},s.prototype.uninitialize=function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.originalLoadDocumentNode=null,this.loadDocumentNode=n.prototype.loadDocumentNode,n.prototype.uninitialize.call(this)},s.prototype.overrideAPIs=function(){var e=this;const t=this.impl.tick.bind(this.impl);this.impl.tick=()=>{if(!this.impl||!this.impl.glrenderer())return;this.impl.renderer().prepareViewport(),this.restoreViewerState();const e=performance.now();t(e),this.impl.renderer().restoreViewport()},this.addEventListener(Autodesk.Viewing.RENDER_PRESENTED_EVENT,(()=>{this.renderContext.renderToCanvas()}),{priority:-1e3});const i=this.impl.setLightPreset.bind(this.impl);this.impl.setLightPreset=(e,t,n)=>{if(this.impl.is2d){this.impl.initLights();const t=Autodesk.Viewing.Private.LightPresets[e].bgColorGradient;this.setBackgroundColor(...t),this.impl.setCurrentLightPreset(e);const i=this.impl.loadCubeMapFromColors(this.impl.clearColorTop,this.impl.clearColorBottom);this.impl.renderer().setCubeMap(i)}else i(e,t,n)};const n=this.toolController.__invokeStack.bind(this.toolController);this.toolController.__invokeStack=function(){return e.restoreViewerState(),n(...arguments)};const r=this.impl.unloadModel.bind(this.impl);this.impl.unloadModel=(e,t)=>{const i=e.leechViewerKey;let n=!1;const o=this.sharedResources.loadedModels[i];return o&&(o.usedByViewersCounter--,n=t||o.forceKeepResources||o.usedByViewersCounter>0,n||delete this.sharedResources.loadedModels[i]),r(e,t=t||n)},this.originalLoadDocumentNode=this.loadDocumentNode.bind(this),this.loadDocumentNode=function(t,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(((r,o)=>{const s=a(i,n),l=e.sharedResources.loadedModels[s];if(l){const t=e.onModelLoaded(l.model,n);r(t)}else e.originalLoadDocumentNode(t,i,n).then((t=>{t.leechViewerKey=s,e.sharedResources.loadedModels[s]={model:t,usedByViewersCounter:1,loadingViewer:e},r(t)})).catch(o)}))};const o=this.impl.geomCache.bind(this.impl);this.impl.geomCache=()=>(this.sharedResources.geomCache&&this.sharedResources.geomCache.initialized||(this.sharedResources.geomCache=o()),this.sharedResources.geomCache)},s.prototype.setViewerProfile=function(e,t){if(t.loadAsHidden)return;t.isAEC=e.isAEC();const i=this.chooseProfile(t);delete i.settings.lineRendering,delete i.settings.pointRendering,this.setProfile(i)},s.prototype.setViewerLight=function(e,t){if(!t.loadAsHidden)if(this.impl.is2d){this.impl.setLightPreset(o.DefaultLightPreset2d);const e=this.impl.clearColorTop.clone().multiplyScalar(255),i=this.impl.clearColorBottom.clone().multiplyScalar(255);t.isAEC?this.impl.setLightPresetForAec():this.impl.setLightPreset(o.DefaultLightPreset),this.impl.toggleEnvMapBackground(!1),this.setBackgroundColor(e.x,e.y,e.z,i.x,i.y,i.z)}else this.impl.toggleEnvMapBackground(this.profile.settings.envMapBackground)},s.prototype.cleanViewerBeforeLoadModel=function(e){if(!e.keepCurrentModels&&this.impl.hasModels()){let e=this.config;this.tearDown(),this.setUp(e)}!this.impl.hasModels()&&this._loadingSpinner&&this._loadingSpinner.show()};const l=new THREE.Vector4(0,0,-1,-1e20);function c(e){const t=!e,i=e&&!e.isLoadDone(),n=e&&e.getPropertyDb()&&!e.getPropertyDb().isLoadDone();return!(t||i||n)}return s.prototype.syncCutPlanes=function(){const e=this.impl.getAllCutPlanes()||[l],t=this.impl.matman(),i=Math.max(e.length,t._cutplanes.length);t._cutplanes.length=0;let n=0;for(;n<e.length;n++)t._cutplanes.push(e[n].clone());for(;n<i;n++)t._cutplanes.push(l);t.forEach((e=>{e.doNotCut||(e.cutplanes=t._cutplanes)}),!1,!0)},s.prototype.restoreViewerState=function(){this.sharedResources.lastRenderedViewer!==this&&(this.syncCutPlanes(),this.impl.is2d&&this.impl.updateCameraMatrices(),this.sharedResources.lastRenderedViewer=this)},s.prototype.onModelLoaded=function(e,t){const i=e.leechViewerKey;this.sharedResources.loadedModels[i].forceKeepResources=!0,this.cleanViewerBeforeLoadModel(t);const n=this.cloneModelToViewer(e);return this.addModelToViewer(n,t),delete this.sharedResources.loadedModels[i].forceKeepResources,n},s.prototype.addModelToViewer=function(e,t){this.impl.modelQueue().addHiddenModel(e),t.loadAsHidden||(this.setViewerProfile(e,t),this.showModel(e),this.setViewerLight(e,t),!t.headlessViewer&&this.createUI&&this.createUI(e)),this._loadingSpinner&&this._loadingSpinner.hide()},s.prototype.cloneModelToViewer=function(e){const t=e.clone(),i=e.leechViewerKey;t.leechViewerKey=i;const n=this.sharedResources.loadedModels[i];n.usedByViewersCounter++;const r=n.loadingViewer,o=()=>this.impl.invalidate(!1,!0,!1);return r.addEventListener(Autodesk.Viewing.LOADER_REPAINT_REQUEST_EVENT,o,{priority:-1e3}),function(e,t){return new Promise((i=>{c(t)&&i();const n=()=>{c(t)&&(e.removeEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT,n),e.removeEventListener(Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT,n),i())};e.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT,n),e.addEventListener(Autodesk.Viewing.OBJECT_TREE_CREATED_EVENT,n)}))}(r,t).then((()=>{setTimeout((()=>{t.setInnerAttributes(e.getInnerAttributes()),this.impl.onLoadComplete(t)}),1),r.removeEventListener(Autodesk.Viewing.LOADER_REPAINT_REQUEST_EVENT,o)})),t},C.set(n,s),new s(e,t,i,n)}},830:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MultiViewerFactory:()=>o});var n=i(91708),r=i(84807);class o{constructor(){const e=Autodesk.Viewing.Private.createRenderer(void 0,{alpha:!0}),t=new r.MaterialManager(e);this.sharedResources={glrenderer:e,materialManager:t,loadedModels:{}}}createViewer(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Autodesk.Viewing.Viewer3D;return(0,n.createLeechViewer)(e,t,this.sharedResources,i)}destroy(){this.sharedResources=null}}},49720:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LogLevels:()=>l,Logger:()=>c,logger:()=>p,setLogger:()=>f});var n=i(16840),r=i(75121),o=i(36291);const s=(0,n.getGlobal)(),a=s,l={DEBUG:5,LOG:4,INFO:3,WARNING:2,ERROR:1,NONE:0};function c(){this.runtimeStats={},this.level=-1,this.setLevel(l.ERROR),this._reportError=this._reportError.bind(this)}function h(e,t){let i;"string"==typeof t?i={message:t}:"object"==typeof t&&(i=t),o.analytics.track(e,i)}function u(){return"undefined"!=typeof window?encodeURI(a.location.href):""}function d(){}c.prototype.initialize=function(e){if(e.eventCallback&&(this.callback=e.eventCallback),this.sessionId=e.sessionId,!this.sessionId){var t=Date.now()+"";this.sessionId=parseFloat((1e4*Math.random()|0)+""+t.substring(4))}"number"==typeof e.logLevel&&this.setLevel(e.logLevel),this.environmentInfo={touch:(0,n.isTouchDevice)(),env:(0,r.getEnv)(),referer:u(),version:s.LMV_VIEWER_VERSION,build_type:s.LMV_BUILD_TYPE};var i={category:"viewer_start",touch:this.environmentInfo.touch,env:this.environmentInfo.env,referer:this.environmentInfo.referer,version:this.environmentInfo.version,build_type:this.environmentInfo.build_type};this.track(i);var o=this;this.interval=setInterval((function(){o.reportRuntimeStats()}),6e4)},c.prototype.shutdown=function(){clearInterval(this.interval),this.interval=void 0},c.prototype.track=function(e){this.updateRuntimeStats(e),!(0,r.isOffline)()&&this.sessionId&&(this.callback&&(e.timestamp=Date.now(),e.sessionId=this.sessionId,this.callback(e)),"error"===(null==e?void 0:e.category)&&h("viewer.error.tracked",e))},c.prototype.updateRuntimeStats=function(e){if(Object.prototype.hasOwnProperty.call(e,"aggregate"))switch(e.aggregate){case"count":this.runtimeStats[e.name]>0?this.runtimeStats[e.name]++:this.runtimeStats[e.name]=1,this.runtimeStats._nonempty=!0;break;case"last":this.runtimeStats[e.name]=e.value,this.runtimeStats._nonempty=!0;break;default:this.warn("unknown log aggregate type")}},c.prototype.reportRuntimeStats=function(){this.runtimeStats._nonempty&&(delete this.runtimeStats._nonempty,this.runtimeStats.category="misc_stats",this.track(this.runtimeStats),this.runtimeStats={})},c.prototype.setLevel=function(e){this.level!==e&&(this.level=e,this.debug=e>=l.DEBUG?console.log:d,this.log=e>=l.LOG?console.log:d,this.info=e>=l.INFO?console.info:d,this.warn=e>=l.WARNING?console.warn:d,this.error=e>=l.ERROR?this._reportError:d)},c.prototype._reportError=function(){console.error.apply(console,arguments);const e=Array.prototype.slice.call(arguments).join(" ");this.callback&&this.callback({category:"error",message:e}),h("viewer.error.logged",e)};let p=new c;function f(e){p=e}},85552:(e,t,i)=>{"use strict";i.r(t),i.d(t,{displayUnits:()=>s,displayUnitsEnum:()=>a,displayUnitsPrecision:()=>l,displayUnitsPrecisionEnum:()=>c,getUnitEnum:()=>u});var n=i(71224);const r=[{name:"File units",type:""},{name:"Millimeters",type:"mm",matches:["millimeter","millimeters"]},{name:"Centimeters",type:"cm",matches:["centimeter","centimeters"]},{name:"Meters",type:"m"},{name:"Inches",type:"in",matches:["inch","inches"]},{name:"Feet",type:"ft",matches:["foot"]},{name:"Feet and fractional inches",type:"ft-and-fractional-in"},{name:"Feet and decimal inches",type:"ft-and-decimal-in"},{name:"Decimal inches",type:"decimal-in"},{name:"Decimal feet",type:"decimal-ft"},{name:"Fractional inches",type:"fractional-in"},{name:"Meters and centimeters",type:"m-and-cm"},{name:"Points",type:"pt",matches:["point","points"]}],o=[{name:"File precision",value:""},{name:"0 (1)",value:0},{name:"0.1 (1/2)",value:1},{name:"0.01 (1/4)",value:2},{name:"0.001 (1/8)",value:3},{name:"0.0001 (1/16)",value:4},{name:"0.00001 (1/32)",value:5},{name:"0.000001 (1/64)",value:6}],s=r.map((e=>e.name)),a=r.map((e=>e.type)),l=o.map((e=>e.name)),c=o.map((e=>e.value));r.forEach((e=>{if(e.matches){const t=e.matches.map((e=>n.Z.t(e)));e.matches=e.matches.concat(t)}}));const h=new Set(a);function u(e){if(e=e&&e.toLocaleLowerCase(),h.has(e))return e;for(let t in r){const i=r[t],n=i.matches;if(n&&n.indexOf(e)>-1)return i.type}return null}},78364:(e,t,i)=>{"use strict";i.r(t),i.d(t,{EPSILON:()=>a,angleVectorToVector:()=>M,calculateDistance:()=>h,computeResult:()=>v,correctPerpendicularPicks:()=>c,createCommonOverlay:()=>L,getCircularArcRadius:()=>b,getEndPointsInEdge:()=>w,getFaceArea:()=>y,getSnapResultPosition:()=>l,inverseProject:()=>_,isEqualVectors:()=>S,isParallel:()=>C,isPerpendicular:()=>P,nearestPointInPointToLine:()=>E,nearestPointInPointToSegment:()=>A,nearestVertexInVertexToEdge:()=>D,project:()=>x,safeToggle:()=>I});var n=i(41434),r=i(16310),o=i(67886),s=i(97967);new n.Vector3;const a=1e-4;function l(e,t){if(!e)return null;if(e.isPerpendicular)return e.intersectPoint;switch(e.geomType){case r.t.SNAP_VERTEX:case r.t.RASTER_PIXEL:case r.t.SNAP_MIDPOINT:case r.t.SNAP_CIRCLE_CENTER:return e.getGeometry();case r.t.SNAP_EDGE:var i=w(e.getGeometry()),n=i[0].clone(),o=i[1].clone();return E(e.intersectPoint,n,o);case r.t.SNAP_FACE:return T(e.intersectPoint,e.getGeometry().vertices[0],e.faceNormal);case r.t.SNAP_CIRCULARARC:if(t&&t.model&&t.model.is2d()){var s=e.snapPoint;return e.geomType=r.t.SNAP_VERTEX,e.geomVertex=s,s}return e.circularArcCenter;case r.t.SNAP_CURVEDEDGE:return D(e.intersectPoint,e.getGeometry());case r.t.SNAP_CURVEDFACE:return e.intersectPoint;case r.t.SNAP_INTERSECTION:return e.snapPoint;default:return null}}function c(e,t,i,o){if(!(e&&t&&e.getGeometry()&&t.getGeometry()))return!1;var s=l(e,i);if(o&&i)if(t.geomType===r.t.SNAP_EDGE){var a=new n.Vector3,c=new n.Vector3,h=t.getGeometry();if(a.subVectors(t.intersectPoint,s).normalize(),c.subVectors(h.vertices[0],h.vertices[1]).normalize(),P(a,c,.05))if(d=A(s,h.vertices[0],h.vertices[1],!0))return o.onMouseMove(x(d,i))&&o.setPerpendicular(!0),t.geomVertex=d,t.intersectPoint=d,!0}else if(t.geomType===r.t.SNAP_FACE){var u=new n.Vector3;let e;if(e=t.getGeometry().vertices[0],u.subVectors(t.intersectPoint,s).normalize(),C(t.faceNormal,u,.05)){var d=T(s,e,t.faceNormal);return o.onMouseMove(x(d,i))&&o.setPerpendicular(!0),t.geomVertex=d,t.intersectPoint=d,!0}}}function h(e,t,i,n){var r,s;if(!(e&&t&&e.getGeometry()&&t.getGeometry()))return null;var c=l(e,n),h=l(t,n);if(!c||!h)return null;if(S(c,h,a))return null;let u;n.model.is2d()&&(c=c.clone(),h=h.clone(),n.model.pageToModel(c,h,e.viewportIndex2d));const d=e.viewportIndex2d,p=null==n||null===(r=n.model)||void 0===r||null===(s=r.getData())||void 0===s?void 0:s.viewports;var f;p&&void 0!==d&&(u=null===(f=p[d])||void 0===f?void 0:f.units);if(i){i=m(i);var v=c.distanceTo(h);return{distanceXYZ:g(v,i),distanceX:g(v=Math.abs(c.x-h.x),i),distanceY:g(v=Math.abs(c.y-h.y),i),distanceZ:0,type:o.o.MEASUREMENT_DISTANCE,units:u}}return{distanceXYZ:c.distanceTo(h),distanceX:Math.abs(c.x-h.x),distanceY:Math.abs(c.y-h.y),distanceZ:Math.abs(c.z-h.z),type:o.o.MEASUREMENT_DISTANCE,units:u}}function u(e,t){if(e.is3d())return 0;if(e.isPdf())return 0;var i=e.getMetadata("page_dimensions","page_width",null),r=e.getMetadata("page_dimensions","logical_width",null),o=e.getMetadata("page_dimensions","page_height",null),s=e.getMetadata("page_dimensions","logical_height",null);if(!(i&&r&&o&&s))return 0;var a=i/r,l=o/s,c=new n.Vector3(0,0,0),h=new n.Vector3(a,l,0);return e.pageToModel(c,h,t),c.distanceTo(h)}function d(e,t){var i=[];for(var r in e)if(e.hasOwnProperty(r)){var o=l(e[r],t);o&&i.push(o)}if(3!==i.length||function(e){for(var t=0;t<e.length;t++)for(var i=0;i<e.length;i++)if(t!==i&&S(e[t],e[i],a))return!0;return!1}(i))return null;var s=new n.Vector3,c=new n.Vector3;return s.subVectors(i[0],i[1]),c.subVectors(i[2],i[1]),M(s,c)}function p(e,t){var i=[];for(var n in e)if(e.hasOwnProperty(n)){var r=l(e[n],t);r&&i.push(r.clone())}var o=l(e[1],t);o&&i.push(o.clone());for(var s=0;s<i.length;s+=2)t.model.pageToModel(i[s],i[s+1],e[1].viewportIndex2d);var a=0,c=0;for(s=0;s<i.length-1;s++)a+=i[s].x*i[s+1].y,c+=i[s].y*i[s+1].x;return Math.abs((a-c)/2)}function f(e,t,i,r){if(!(e&&t&&e.getGeometry()&&t.getGeometry()))return null;if(!e.circularArcRadius)return null;var o=l(e,r).clone(),s=l(t,r).clone();const c=e.circularArcCenter;var h=c instanceof n.Vector3?c.clone():new n.Vector3(c.x,c.y,c.z);if(!o||!s)return null;if(S(o,s,a))return 0;r.model.is2d()&&(r.model.pageToModel(o,s,e.viewportIndex2d),r.model.pageToModel(h,null,e.viewportIndex2d));var u=function(){var e=new n.Vector3,t=new n.Vector3;e.subVectors(o,h),t.subVectors(s,h);var i=e.length()*t.length(),r=e.dot(t);return Math.acos(r/i)*e.length()}();return i?g(u,i=m(i)):u}function m(e){var t=Math.log(e)/Math.log(10),i=Math.floor(t);return 1<e/Math.pow(10,i)&&i++,Math.pow(10,i)}function g(e,t){return Math.floor(e/t+.5)*t}function v(e,t,i,n){switch(t){case o.o.MEASUREMENT_DISTANCE:return h(s=e[1],e[2],u(i.model,s.viewportIndex2d),i);case o.o.MEASUREMENT_ANGLE:var r=d(e,i);return r?{angle:n&&n.angleOuter?360-r:r,type:t}:null;case o.o.MEASUREMENT_AREA:return{area:p(e,i),type:t};case o.o.MEASUREMENT_ARC:var s;return{arc:f(s=e[1],e[2],u(i.model,s.viewportIndex2d),i),type:t};case o.o.MEASUREMENT_LOCATION:return{location:l(e[1],i),type:t};default:return null}}function y(e,t,i,r,o,a){var l=0;let c,h,u,d;var p=new n.Vector3,f=new n.Vector3;c=i.vertices.length;for(var m=0;m<c;m+=3)h=i.vertices[m],u=i.vertices[m+1],d=i.vertices[m+2],p.subVectors(u,h),f.subVectors(d,h),l+=p.length()*f.length()*Math.sin(p.angleTo(f))/2;return l=(0,s.convertUnits)(e.model.getUnitString(),r,a,l,"square"),r?(0,s.formatValueWithUnits)(l,r+"^2",3,o):(0,s.formatValueWithUnits)(l,null,3,o)}function b(e,t,i,n,r,o){var a=i.radius;if(a){if(e.model.is2d()){var l=i.center.clone();let n;n=i.vertices[0].clone(),e.model.pageToModel(l,n,t.getPick(1).viewportIndex2d),a=l.distanceTo(n)}return a=(0,s.convertUnits)(e.model.getUnitString(),n,o,a),(0,s.formatValueWithUnits)(a,n,3,r)}}function x(e,t,i){var r=t.navigation.getCamera(),o=t.navigation.getScreenViewport(),s=new n.Vector3(e.x,e.y,e.z);return s=s.project(r),i=i||0,new n.Vector2(Math.round((s.x+1)/2*o.width)+i,Math.round((1-s.y)/2*o.height)+i)}function _(e,t){var i=t.navigation.getCamera(),r=t.navigation.getScreenViewport(),o=new n.Vector3;return o.x=e.x/r.width*2-1,o.y=-(e.y/r.height*2-1),o.z=0,o=o.unproject(i)}function E(e,t,i){var r,o=new n.Vector3,s=new n.Vector3;return o.subVectors(t,e),s.subVectors(i,t),r=o.dot(s),o.subVectors(i,t),r=-r/o.dot(o),o.subVectors(i,t),o.multiplyScalar(r),o.add(t)}function A(e,t,i,r){var o,s,a=new n.Vector3,l=new n.Vector3;return a.subVectors(t,e),l.subVectors(i,t),s=a.dot(l),a.subVectors(i,t),(s=-s/a.dot(a))<0?o=r?null:t:s>1?o=r?null:i:(a.subVectors(i,t),a.multiplyScalar(s),o=a.add(t)),o}function S(e,t,i){return!(!e||!t)&&(Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i)}function w(e){let t;var i=[];let n;t=e.vertices,n=t.length;for(var r=0;r<n;++r){var o=!1;let e;e=t[r];for(var s=0;s<n;++s){let i;if(i=t[s],s!==r&&i.equals(e)){o=!0;break}}o||i.push(e)}return i.length<2&&(i[0]=t[0],i[1]=t[1]),i}function M(e,t){return 180*e.angleTo(t)/Math.PI}function T(e,t,i){var r=new n.Vector3,o=i.clone(),s=new n.Vector3;s.subVectors(e,t);var a=-o.dot(s)/o.dot(o);return r.addVectors(e,o.multiplyScalar(a)),r}function C(e,t,i){return i=i||a,1-Math.abs(e.dot(t))<i}function P(e,t,i){return i=i||a,Math.abs(e.dot(t))<i}function D(e,t){var i,n=Number.MAX_VALUE;let r;r=t.vertices.length;for(var o=0;o<r;o++){let r;r=t.vertices[o];var s=e.distanceTo(r);n>s&&(i=r,n=s)}return i}function L(e,t){e.impl.overlayScenes[t]||e.impl.createOverlayScene(t)}function I(e,t,i){(e.classList.contains(t)&&!i||!e.classList.contains(t)&&i)&&e.classList.toggle(t,i)}},21980:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});var n={MEASUREMENT_CHANGED_EVENT:"measurement-changed",MEASUREMENT_COMPLETED_EVENT:"measurement-completed",UNITS_CALIBRATION_STARTS_EVENT:"units_calibration_starts_event",FINISHED_CALIBRATION_FOR_DIMENSION_EVENT:"finished_calibration_for_dimension_event",CALIBRATION_REQUIRED_EVENT:"calibration-required",OPEN_CALIBRATION_PANEL_EVENT:"open-calibration-panel",CLOSE_CALIBRATION_PANEL_EVENT:"close-calibration-panel",CLEAR_CALIBRATION_SIZE_EVENT:"clear-calibration-size",FINISHED_CALIBRATION:"finished-calibration",DISPLAY_UNITS_CHANGED:"display-units-changed",PRECISION_CHANGED:"precision-changed",MEASUREMENT_MODE_ENTER:"measure-mode-enter",MEASUREMENT_MODE_LEAVE:"measure-mode-leave",DELETE_MEASUREMENT:"delete-measurement",SELECT_MEASUREMENT:"select-measurement"}},51979:(e,t,i)=>{"use strict";i.d(t,{g:()=>s});var n=i(38970),r=i(67886),o=i(78364);function s(e,t,i){this.measurementType=e,this.id=t,this.picks=[],this.closedArea=!1,this.isRestored=!1,this.options=i,this.resetMeasureValues()}s.prototype.clone=function(){var e;const t=new s(this.measurementType,this.id,this.options);return t.closedArea=this.closedArea,t.isRestored=this.isRestored,t.picks=this.clonePicks(),t.angle=this.angle,t.distanceX=this.distanceX,t.distanceY=this.distanceY,t.distanceZ=this.distanceZ,t.distanceXYZ=this.distanceXYZ,t.arc=this.arc,t.location=null===(e=this.location)||void 0===e?void 0:e.clone(),t.result=Object.assign({},this.result),t},s.prototype.resetMeasureValues=function(){this.angle=0,this.distanceX=0,this.distanceY=0,this.distanceZ=0,this.distanceXYZ=0,this.arc=0,this.location=null,this.result=null},s.prototype.setPick=function(e,t){var i=this.picks[e]=t;return i.id=parseInt(e),i},s.prototype.getPick=function(e){var t=this.picks[e];return t||(t=this.setPick(e,new n.N)),t},s.prototype.clonePicks=function(e){var t=[];for(var i in this.picks)if(Object.prototype.hasOwnProperty.call(this.picks,i)){var n=this.picks[i];t.push(n.clone())}return t},s.prototype.countPicks=function(){return Object.keys(this.picks).length},s.prototype.getMaxNumberOfPicks=function(){switch(this.measurementType){case r.o.MEASUREMENT_DISTANCE:case r.o.MEASUREMENT_LOCATION:case r.o.MEASUREMENT_CALLOUT:case r.o.MEASUREMENT_ARC:return 2;case r.o.MEASUREMENT_ANGLE:return 3;case r.o.MEASUREMENT_AREA:return this.closedArea?this.countPicks():Number.MAX_VALUE-1}},s.prototype.hasPick=function(e){return this.picks[e]&&!this.picks[e].isEmpty()||this.isRestored},s.prototype.isComplete=function(){var e=this.countPicks()===this.getMaxNumberOfPicks();for(var t in this.picks)if(Object.prototype.hasOwnProperty.call(this.picks,t)&&!(e=e&&this.hasPick(t)))break;return e},s.prototype.isEmpty=function(){var e=!0;for(var t in this.picks)if(Object.prototype.hasOwnProperty.call(this.picks,t)&&!(e=e&&!this.hasPick(t)))break;return e},s.prototype.clearPick=function(e){this.picks[e]&&this.picks[e].clear(),this.resetMeasureValues()},s.prototype.clearAllPicks=function(){for(var e in this.picks)Object.prototype.hasOwnProperty.call(this.picks,e)&&this.clearPick(e)},s.prototype.hasEqualPicks=function(e,t){if(!e||!t)return!1;if(e.geomType===t.geomType){var i=(0,o.getSnapResultPosition)(e),n=(0,o.getSnapResultPosition)(t);return(0,o.isEqualVectors)(i,n,o.EPSILON)}return!1},s.prototype.computeResult=function(e,t){if(this.resetMeasureValues(),!t.model)return this.result=null,!1;var i=this.result=(0,o.computeResult)(e,this.measurementType,t,this.options);if(null===i)return!this.isComplete();switch(i.type){case r.o.MEASUREMENT_DISTANCE:return this.distanceXYZ=i.distanceXYZ,this.distanceX=i.distanceX,this.distanceY=i.distanceY,this.distanceZ=i.distanceZ,!0;case r.o.MEASUREMENT_ANGLE:return this.angle=isNaN(i.angle)?0:i.angle,!0;case r.o.MEASUREMENT_AREA:return this.area=i.area,!0;case r.o.MEASUREMENT_ARC:return this.arc=i.arc,!0;case r.o.MEASUREMENT_LOCATION:return this.location=i.location,!0;case r.o.MEASUREMENT_CALLOUT:return!0;default:return!1}},s.prototype.getGeometry=function(e){return{type:this.picks[e].geomType,geometry:this.picks[e].getGeometry()}},s.prototype.attachIndicator=function(e,t,i){this.indicator=new i(e,this,t),this.indicator.init()}},67886:(e,t,i)=>{"use strict";i.d(t,{D:()=>r,o:()=>n});var n={MEASUREMENT_DISTANCE:1,MEASUREMENT_ANGLE:2,MEASUREMENT_AREA:3,CALIBRATION:4,MEASUREMENT_CALLOUT:5,MEASUREMENT_LOCATION:6,MEASUREMENT_ARC:7},r={[n.MEASUREMENT_DISTANCE]:"Distance",[n.MEASUREMENT_ANGLE]:"Angle",[n.MEASUREMENT_AREA]:"Area",[n.CALIBRATION]:"Calibration",[n.MEASUREMENT_CALLOUT]:"Callout",[n.MEASUREMENT_LOCATION]:"Location",[n.MEASUREMENT_ARC]:"Arc"}},93293:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PDFUtils:()=>a});var n=i(35797);function r(e){var t;const i=e.impl.model.getDocumentNode(),n=null==i||null===(t=i.search(Autodesk.Viewing.BubbleNode.LEAFLET_NODE)[0])||void 0===t?void 0:t._raw();if(!n)return null;const r={};return new Autodesk.Viewing.Document(i.getRootNode()._raw(),"").getLeafletParams(r,i,n),r}function o(e){const t=new Autodesk.Viewing.Private.TexQuadConfig,i=r(e);if(!i)return null;t.initFromLoadOptions(null,i);return t.getBBox()}function s(e){const t=o(e);if(!t)return null;return n.SceneMath.getNormalizingMatrix(null,t)}var a={leafletToPdfWorld:function(e,t){const i=s(e);if(!i)return null;let r;if(t.applyMatrix4(i),e.model.isLeaflet()){const t=e.model.getMetadata("page_dimensions"),i=new THREE.Box3(new THREE.Vector3,new THREE.Vector3(t.page_width,t.page_height,0));r=n.SceneMath.getNormalizingMatrix(void 0,i)}else r=n.SceneMath.getNormalizingMatrix(e.model);return t.applyMatrix4(r.invert()),t},pdfToLeafletWorld:function(e,t){const i=n.SceneMath.getNormalizingMatrix(e.model);t.applyMatrix4(i);let r=s(e);return r?(t.applyMatrix4(r.invert()),t):null},getLeafletLoadOptions:r,getLeafletBoundingBox:o,getLeafletNormalizingMatrix:s}},38970:(e,t,i)=>{"use strict";i.d(t,{N:()=>r});var n=i(16310);function r(){this.clear()}r.prototype.clear=function(){this.geomType=null,this.modelId=null,this.snapNode=null,this.geomVertex=null,this.geomEdge=null,this.geomFace=null,this.radius=null,this.intersectPoint=null,this.faceNormal=null,this.viewportIndex2d=null,this.circularArcCenter=null,this.circularArcRadius=null,this.fromTopology=!1,this.isPerpendicular=!1,this.snapPoint=null},r.prototype.copyTo=function(e){e.modelId=this.modelId,e.snapNode=this.snapNode,e.geomVertex=this.geomVertex,e.geomFace=this.geomFace,e.geomEdge=this.geomEdge,e.radius=this.radius,e.geomType=this.geomType,e.intersectPoint=this.intersectPoint,e.faceNormal=this.faceNormal,e.viewportIndex2d=this.viewportIndex2d,e.circularArcCenter=this.circularArcCenter,e.circularArcRadius=this.circularArcRadius,e.fromTopology=this.fromTopology,e.isPerpendicular=this.isPerpendicular,e.snapPoint=this.snapPoint},r.prototype.clone=function(){var e=new r;return this.copyTo(e),e},r.prototype.isEmpty=function(){return!this.getGeometry()};let o=null,s=null,a=null;const l=(e,t)=>(s=s||new THREE.Vector3,a=a||new THREE.Vector3,s.set(0,0,0),a.set(e,0,0),s.applyMatrix4(t),a.applyMatrix4(t),s.distanceTo(a));r.prototype.applyMatrix4=function(e){if(this.geomEdge&&this.geomEdge.applyMatrix4(e),this.geomFace&&this.geomFace.applyMatrix4(e),this.geomVertex&&this.geomVertex.applyMatrix4(e),this.intersectPoint&&this.intersectPoint.applyMatrix4(e),this.circularArcCenter&&this.circularArcCenter.applyMatrix4(e),this.snapPoint&&this.snapPoint.applyMatrix4(e),this.faceNormal){o=o||new THREE.Matrix4;const t=o.getNormalMatrix(e);this.faceNormal.applyMatrix4(t)}this.radius=l(this.radius,e),this.circularArcRadius=l(this.circularArcRadius,e)},r.prototype.getFace=function(){return this.geomFace},r.prototype.getEdge=function(){return this.geomEdge},r.prototype.getVertex=function(){return this.geomVertex},r.prototype.getGeometry=function(){switch(this.geomType){case n.t.SNAP_VERTEX:case n.t.SNAP_MIDPOINT:case n.t.SNAP_INTERSECTION:case n.t.SNAP_CIRCLE_CENTER:case n.t.RASTER_PIXEL:return this.geomVertex;case n.t.SNAP_EDGE:return this.geomEdge;case n.t.SNAP_FACE:return this.geomFace;case n.t.SNAP_CIRCULARARC:case n.t.SNAP_CURVEDEDGE:return this.geomEdge;case n.t.SNAP_CURVEDFACE:return this.geomFace}return null},r.prototype.setGeometry=function(e,t){switch(e){case n.t.SNAP_VERTEX:case n.t.SNAP_MIDPOINT:case n.t.SNAP_INTERSECTION:case n.t.SNAP_CIRCLE_CENTER:case n.t.RASTER_PIXEL:this.geomVertex=t;break;case n.t.SNAP_EDGE:this.geomEdge=t;break;case n.t.SNAP_FACE:this.geomFace=t;break;case n.t.SNAP_CIRCULARARC:case n.t.SNAP_CURVEDEDGE:this.geomEdge=t;break;case n.t.SNAP_CURVEDFACE:this.geomFace=t;break;default:return}this.geomType=e}},16310:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});var n={SNAP_VERTEX:0,SNAP_MIDPOINT:1,SNAP_CIRCLE_CENTER:2,SNAP_EDGE:3,SNAP_FACE:4,SNAP_CIRCULARARC:5,SNAP_CURVEDEDGE:6,SNAP_CURVEDFACE:7,RASTER_PIXEL:8,SNAP_INTERSECTION:9}},97967:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ModelUnits:()=>s,calculatePrecision:()=>x,convertToDisplayUnits:()=>_,convertUnits:()=>b,fixUnitString:()=>v,formatValueWithUnits:()=>g,getMainUnit:()=>E,getUnitData:()=>y});var n=i(71224),r=i(85552);const o=i(30325);var s={METER:"m",CENTIMETER:"cm",MILLIMETER:"mm",FOOT:"ft",INCH:"in",POINT:"pt"};const a={[s.METER]:1,[s.CENTIMETER]:.01,[s.MILLIMETER]:.001,[s.FOOT]:.3048,[s.INCH]:.0254,[s.POINT]:.0254/72};function l(e){let t="";return 2===e?t=String.fromCharCode(178):3===e&&(t=String.fromCharCode(179)),t}function c(e){var t=0<=e?Math.floor(e):Math.ceil(e);return{intPart:t,fracPart:e-t}}function h(e,t,i){var n="";return i&&0===e&&(n+="-"),n+=0<t?e.toFixed(t):e.toFixed(0)}function u(e,t,i,n){for(var r,o,s="",a=1,l=e<0,u=0;u<t;++u)a*=2;e>0?e+=.5/a:e-=.5/a,i?o=e:(s+=h(r=c(e/12).intPart,0,l)+n.feet+" ",(o=e-12*r)<0&&(o=-o));var d=c(o).intPart,p=c((o-d)*a).intPart;if(0!==p&&0===d||(s+=h(d,0)),0!==p){for(d<0&&p<0&&(p=-p);p%2==0;)p/=2,a/=2;0!==d&&(s+="-"),s+=h(p,0)+"/"+h(a,0)}return s+=n.inches}function d(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;var n="";e<0&&(n="-",e=Math.abs(e));var r=c(e),o=r.intPart,s=r.fracPart*Math.pow(100,i);const a=l(i);let u=h(o,0),d=h(s,t);return d.startsWith(Math.pow(100,i).toString())&&(u=h(o+1,0),d=h(0,t)),n+u+` m${a} `+d+` cm${a}`}function p(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;var r="";e<0&&(r="-",e=Math.abs(e));var o=c(e),s=o.intPart,a=o.fracPart*Math.pow(12,n);const u=l(n);let d=h(s,0),p=h(a,t);return p.startsWith(Math.pow(12,n).toString())&&(d=h(s+1,0),p=h(0,t)),r+d+i.feet+u+" "+p+i.inches+u}const f={feetFractionalInches:"ft-and-fractional-in",fractionalInches:"fractional-in",feet:"feet",inches:"inches",stationingFeet:"feet"};function m(e){if(!e||!e.startsWith("autodesk.unit.unit:"))return e;let t=e.split(":")[1].split("-")[0],i=o.unit[t];if(!i)return console.warn("Failed to find Forge unit schema for",e),e;{let e=f[t];if(e)return e;if(!i.symbols)return console.warn("Unit without symbols.",i),"";if(i.defaultSymbol&&i.symbols[i.defaultSymbol])return i.symbols[i.defaultSymbol];for(let e in i.symbols)return i.symbols[e]}}function g(e,t,i,r,o){var s;null==r&&(r=3);const a=(o=o||{}).preferLetters?{feet:" ft",inches:" in"}:{feet:"'",inches:'"'};t=m(t);try{if(1===i)s=n.Z.t(e?"Yes":"No");else if(24===i){var c=e.split(" ");s=[];for(var f=0;f<c.length;++f)s.push(g(parseFloat(c[f]),t,3,r));s=s.join(", ")}else if(2!==i&&3!==i||!isNaN(e))if("ft-and-fractional-in"===t)s=u(12*e,r,!1,a);else if("ft-and-fractional-in^2"===t)s=o.noMixedArea?h(e,r)+" ft"+l(2):u(12*e,r,!1,a)+" "+l(2);else if("ft-and-fractional-in^3"===t)s=o.noMixedVolume?h(e,r)+" ft"+l(3):u(12*e,r,!1,a)+" "+l(3);else if("ft-and-decimal-in"===t)s=p(e,r,a);else if("ft-and-decimal-in^2"===t)s=o.noMixedArea?h(e,r)+" ft"+l(2):p(e,r,a,2);else if("ft-and-decimal-in^3"===t)s=o.noMixedVolume?h(e,r)+" ft"+l(3):p(e,r,a,3);else if("decimal-in"===t||"in"===t||"inch"===t||"inches"===t)s=h(e,r)+a.inches;else if("decimal-in^2"===t||"in^2"===t||"inch^2"===t)s=h(e,r)+" in"+l(2);else if("decimal-in^3"===t||"in^3"===t||"inch^3"===t)s=h(e,r)+" in"+l(3);else if("decimal-in-sq"===t||"fractional-in-sq"===t)s=h(e,r)+" sq. in";else if("decimal-ft"===t||"ft"===t||"feet"===t||"foot"===t)s=h(e,r)+a.feet;else if("decimal-ft^2"===t||"ft^2"===t||"feet^2"===t||"foot^2"===t)s=h(e,r)+" ft"+l(2);else if("decimal-ft^3"===t||"ft^3"===t||"feet^3"===t||"foot^3"===t)s=h(e,r)+" ft"+l(3);else if("decimal-ft-sq"===t||"ft-and-fractional-in-sq"===t||"ft-and-decimal-in-sq"===t)s=h(e,r)+" sq. ft";else if("fractional-in"===t)s=u(e,r,!0,a);else if("fractional-in^2"===t)s=u(e,r,!0,a)+l(2);else if("fractional-in^3"===t)s=u(e,r,!0,a)+l(3);else if("m-and-cm"===t)s=d(e,r);else if("m-and-cm^2"===t)s=o.noMixedArea?h(e,r)+" m"+l(2):d(e,r,2);else if("m-and-cm^3"===t)s=o.noMixedVolume?h(e,r)+" m"+l(3):d(e,r,3);else if(t&&t.text){s=function(e,t){const i=t.space?" ":"";return"Prefix"===t.placement?t.text+i+e:e+i+t.text}(3===i?h(e,r):e,t)}else 3===i&&t?(t=(t=t.replace("^2",l(2))).replace("^3",l(3)),s=h(e,r)+" "+t):s=t?e+" "+t:3===i?h(e,r):e;else s="NaN"}catch(i){s=t?e+" "+t:e}return s}function v(e){var t;switch(e=null===(t=e)||void 0===t?void 0:t.toLowerCase()){case"meter":case"meters":case"m":return s.METER;case"foot":case"feet":case"ft":return s.FOOT;case"feet and inches":case"inch":case"inches":case"in":return s.INCH;case"centimeter":case"centimeters":case"cm":return s.CENTIMETER;case"millimeter":case"millimeters":case"mm":return s.MILLIMETER;case"point":case"points":case"pt":return s.POINT;default:return e}}function y(e){let t=v(e);return{unitString:t,unitScale:a[t]||1}}function b(e,t,i,n,r,o){if(i=i||1,o=o||72,(e=v(e))===(t=v(t))&&1===i)return n;const l=s,c=a;var h=1;switch(t){case l.MILLIMETER:h=1/c[l.MILLIMETER];break;case l.CENTIMETER:h=1/c[l.CENTIMETER];break;case l.METER:h=1;break;case l.INCH:h=1/c[l.INCH];break;case l.FOOT:case"ft-and-fractional-in":case"ft-and-decimal-in":h=1/c[l.FOOT];break;case"decimal-in":h=1/c[l.INCH];break;case"decimal-ft":h=1/c[l.FOOT];break;case"fractional-in":h=1/c[l.INCH];break;case"m-and-cm":h=1;break;case l.POINT:h=1/c[l.INCH]*o}var u=1;switch(e){case l.MILLIMETER:u=c[l.MILLIMETER];break;case l.CENTIMETER:u=c[l.CENTIMETER];break;case l.METER:u=c[l.METER];break;case l.INCH:u=c[l.INCH];break;case l.FOOT:case"ft-and-fractional-in":case"ft-and-decimal-in":u=c[l.FOOT];break;case"decimal-in":u=c[l.INCH];break;case"decimal-ft":u=c[l.FOOT];break;case"fractional-in":u=c[l.INCH];break;case"m-and-cm":u=1;break;case l.POINT:u=c[l.INCH]/o}return"square"===r?n?n*Math.pow(h*u*i,2):0:"cube"===r?n?n*Math.pow(h*u*i,3):0:n?n*h*u*i:0}function x(e){if(!e)return 0;var t=e.toString().split(".")[1];if(!t){var i=e.toString().split("/")[1],n=i&&i.match(/\d+/);if(n){var r=parseFloat(n);if(r&&!isNaN(r))return Math.floor(Math.log2(r))}return 0}return(t=t.match(/\d+/))&&t[0]&&t[0].length||0}function _(e,t,i,n){if(!i||!n)return{displayValue:e,displayUnits:i};let o=i,s=n;const a=m(o);let l;if("object"==typeof a&&"text"in a&&(o=a.text),o&&(o=o.replace(/²$/,"^2").replace(/³$/,"^3")),/\^2$/.test(o)?(o=o.replace("^2",""),s+="^2",l="square"):/\^3$/.test(o)&&(o=o.replace("^3",""),s+="^3",l="cube"),o=(0,r.getUnitEnum)(o),null===o)return{displayValue:e,displayUnits:i};if(2===t||3===t){return{displayValue:b(o,n,1,e,l,null),displayUnits:s}}if(24===t){return{displayValue:e.split(" ").map((e=>b(o,n,1,e,l,null))).join(" "),displayUnits:s}}return{displayValue:e,displayUnits:i}}function E(e){switch(e){case"decimal-ft":case"ft-and-fractional-in":case"ft-and-decimal-in":return"ft";case"decimal-in":case"fractional-in":return"in";case"m-and-cm":return"m"}return e}},1669:(e,t,i)=>{"use strict";i.r(t),i.d(t,{UnitParser:()=>n});var n={};function r(e,t,i,n){if(!e)return NaN;var r,o=(e=e.toString()).trim();if(0==o.length)return NaN;var s=i.join("| *"),a=n.join("| *");if(r=o.match(new RegExp("^([+-]?\\d+)(?: *)/(?: *)(\\d+)(?: *)(?:"+a+") *$")))return parseFloat(r[1])/parseFloat(r[2])/t;if(r=o.match(new RegExp("^([+-]?\\d+)(?: *)/(?: *)(\\d+)(?: *)(?:"+s+")? *$")))return parseFloat(r[1])/parseFloat(r[2]);var l;if(!(r=o.match(/^[+-]? *(?:\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?/i)))return NaN;if(l=parseFloat(r[0].replace(/ */g,"")),0==(o=(o=o.slice(r[0].length)).replace("-"," ")).length||isNaN(l))return l;var c=Math.sign(l);return 0===c&&(c=1),o.match(new RegExp("^(?: *)(?:"+a+") *$","i"))?l/t:(r=o.match(new RegExp("^ +(\\d+)(?: *)/(?: *)(\\d+)(?: *)(?:"+a+") *$","i")))?(l+c*parseFloat(r[1])/parseFloat(r[2]))/t:(r=o.match(new RegExp("^(?: *)(?:"+s+"|-| +-?) *","i")))?0==(o=o.slice(r[0].length).trim()).length?r[0].match(/-/)?NaN:l:(r=o.match(new RegExp("^(\\d+(?:\\.\\d*)?)(?: *)(?:"+a+")? *$")))?l+c*parseFloat(r[1])/t:(r=o.match(new RegExp("^(\\d+)(?: *)/(?: *)(\\d+)(?: *)(?:"+a+")? *$")))?l+c*(parseFloat(r[1])/parseFloat(r[2]))/t:(r=o.match(new RegExp("^(\\d+) +(\\d+)(?: *)/(?: *)(\\d+)(?: *)(?:"+a+")? *$")))?l+c*(parseFloat(r[1])+parseFloat(r[2])/parseFloat(r[3]))/t:NaN:NaN}n.parseFeet=function(e){return r(e,12,["ft","feet","'","`","‘","’"],["in","inch",'\\"',"''","``","‘‘","’’"])},n.parseMeter=function(e){return r(e,100,["m","meter"],["cm","centimeter"])},n.parseNumber=function(e,t){switch(t){case"ft":case"decimal-ft":case"ft-and-fractional-in":case"ft-and-decimal-in":case"decimal-in":case"fractional-in":return n.parseFeet(e);default:return n.parseMeter(e)}},n.parsePositiveNumber=function(e,t){var i=n.parseNumber(e,t);return i>=0?i:NaN}},49027:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MobileCallbacks:()=>r});const n=(0,i(16840).getGlobal)();function r(){this.ios=n.webkit,this.android=n.JSINTERFACE,this.iosSend=function(e,t){return n.webkit.messageHandlers.callbackHandler.postMessage({command:e,data:t})},this.androidSend=n.JSINTERFACE}var o=r.prototype;o.animationReady=function(){this.ios?this.iosSend("animationReady"):this.android&&this.androidSend.animationReady()},o.onSelectionChanged=function(e){this.ios?this.iosSend("selectionChanged",e):this.android&&this.androidSend.onSelectionChanged(e)},o.onLongTap=function(e,t){this.ios?this.iosSend("onLongTap",[e,t]):this.android&&this.androidSend.onLongTap(e,t)},o.onSingleTap=function(e,t){this.ios?this.iosSend("onSingleTap",[e,t]):this.android&&this.androidSend.onSingleTap(e,t)},o.onDoubleTap=function(e,t){this.ios?this.iosSend("onDoubleTap",[e,t]):this.android&&this.androidSend.onDoubleTap(e,t)},o.setRTCSession=function(e){this.ios?this.iosSend("setRTCSession",{id:e}):this.android&&this.androidSend.setRTCSessionID(e)},o.putProperties=function(e,t){this.ios?this.iosSend("putProperties",{name:e,value:t}):this.android&&this.androidSend.putProperties(e,t)},o.onPropertyRetrievedSuccess=function(){this.ios?this.iosSend("onPropertyRetrievedSuccess"):this.android&&this.androidSend.onPropertyRetrievedSuccess()},o.onPropertyRetrievedFailOrEmptyProperties=function(){this.ios?this.iosSend("onPropertyRetrievedFailOrEmptyProperties"):this.android&&this.androidSend.onPropertyRetrievedFailOrEmptyProperties()},o.resetAnimationStatus=function(){this.ios?this.iosSend("resetAnimationStatus"):this.android&&this.androidSend.resetAnimationStatus()},o.setPauseUI=function(){this.ios?this.iosSend("setPauseUI"):this.android&&this.androidSend.setToPaused()},o.getDeviceAvailableMemory=function(){return this.ios?this.iosSend("getDeviceAvailableMemory"):this.android?this.androidSend.getDeviceAvailableMemory():void 0},o.onDeviceMemoryInsufficient=function(){return this.ios?this.iosSend("onDeviceMemoryInsufficient"):this.android?this.androidSend.onDeviceMemoryInsufficient():void 0},o.updateAnimationTime=function(e){this.ios?this.iosSend("updateAnimationTime",e):this.android&&this.androidSend.updateAnimationTime(e)},o.setLoadingProgress=function(e,t){this.ios?this.iosSend("setLoadingProgress",{state:e,progress:t}):this.android&&this.androidSend.setLoadingProgress(e,t)},o.objectTreeCreated=function(){this.ios?this.iosSend("objectTreeCreated"):this.android&&this.androidSend.objectTreeCreated()},o.geometryLoaded=function(){this.ios?this.iosSend("geometryLoaded"):this.android&&this.androidSend.geometryLoaded()},o.putSheets=function(e,t){this.ios?this.iosSend("putSheets",[e,t]):this.android&&this.androidSend.putSheets(e,t)},o.putAllSheets=function(e){this.ios?this.iosSend("putAllSheets",e):this.android&&this.androidSend.putAllSheets(e)},o.hideLoadingView=function(){this.android&&this.androidSend.hideLoadingView()},o.instanceTree=function(e){this.ios?this.iosSend("instanceTree",e):this.android&&this.androidSend.instanceTree(e)},o.loadSheetFailed=function(){this.ios?this.iosSend("loadSheetFailed"):this.android&&this.androidSend.loadSheetFailed()},o.sheetSelected=function(e){this.ios?this.iosSend("sheetSelected",e):this.android&&this.androidSend.sheetSelected(e)},"undefined"!=typeof window&&(n.MobileCallbacks=r)},17168:(e,t,i)=>{function n(){return"undefined"!=typeof window&&null!==window?window:"undefined"!=typeof self&&null!==self?self:i.g}function r(e){for(var t=n(),i=e.split("."),r=0;r<i.length;++r)t[i[r]]=t[i[r]]||{},t=t[i[r]];return t}r("Autodesk.Viewing.Private"),r("Autodesk.Viewing.Extensions"),r("Autodesk.Extensions"),r("Autodesk.Viewing.Shaders"),r("Autodesk.Viewing.UI"),r("Autodesk.LMVTK"),Autodesk.Viewing.getGlobal=n,Autodesk.Viewing.AutodeskNamespace=r,n().AutodeskNamespace=r;var o=n().Autodesk.Viewing.Private;o.LMV_WORKER_URL="lmvworker.min.js",o.ENABLE_DEBUG=o.ENABLE_DEBUG||!1,n().ENABLE_DEBUG=o.ENABLE_DEBUG,o.ENABLE_INLINE_WORKER=!0,e.exports.Autodesk=n().Autodesk},71947:(e,t,i)=>{"use strict";function n(e){var t=Autodesk.Viewing,i=t.Private,n=t.UI,r=t.Extensions;for(let i in e.av)t[i]=e.av[i];for(let t in e.avp)i[t]=e.avp[t];for(let t in e.avu)n[t]=e.avu[t];for(let t in e.ave)r[t]=e.ave[t];t.getGlobal().THREE=e.THREE,t.getGlobal().LMV=e,i.isRightClick=t.isRightClick,i.isMiddleClick=t.isMiddleClick}i.d(t,{i:()=>n})},73993:(e,t,i)=>{"use strict";i.r(t),i.d(t,{loadDependency:()=>a,theResourceLoader:()=>s});var n=i(43644);const r=(0,i(16840).getGlobal)(),o=r.document;const s=new class{constructor(){this.loadPromises={}}getResourceUrl(e){return e.indexOf("://")>0?e:(0,n.getResourceUrl)(e)}loadScriptIntoDom(e,t,i){const n=o.createElement("SCRIPT");n.src=e;const r=function(){n.onerror=null,n.onload=null};n.onload=function(){r(),t()},n.onerror=function(t){r(),i&&i(new Error(`Error loading script ${e}, with error ${t}`))},o.head.appendChild(n)}loadScript(e,t){if(t&&void 0!==r[t])return Promise.resolve();const i=(e=this.getResourceUrl(e)).toLowerCase();if(i in this.loadPromises)return this.loadPromises[i];const o=(0,n.getScript)(e);return this.loadPromises[i]=o?Promise.resolve():new Promise(((t,i)=>{this.loadScriptIntoDom(e,t,i)})),this.loadPromises[i]}_getLink(e){const t=o.getElementsByTagName("link");for(let i=0,n=t.length;i<n;i++)if(t[i].href===e)return t[i];return null}};function a(e,t,i,n){s.loadScript(t,e).then((()=>{i&&i()})).catch((e=>{n&&n(e)}))}Object.freeze(s)},41112:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SearchManager:()=>r});class n{constructor(e){this.viewer=e}search(e){return new Promise(((e,t)=>{}))}getProviderId(){return"Search Provider Id"}}class r{constructor(e){this.viewer=e,this.searchProviders=new Map}addSearchProvider(e){this.searchProviders.has(e)||this.searchProviders.set(e,new e(this.viewer))}search(e){return new Promise(((t,i)=>{const n=this.prepareSearchInput(e),r=[];this.searchProviders.forEach((e=>{const t=e.search(n),i=e.getProviderId();t.id=i,r.push(t)})),Promise.all(r).then((e=>{const i={};e.forEach(((e,t)=>{const n=r[t].id;i[n]=e})),t(i)})).catch(i)}))}removeAllProviders(){this.searchProviders.clear()}removeProvider(e){this.searchProviders.delete(e)}prepareSearchInput(e){return e.toLowerCase()}}const o=AutodeskNamespace("Autodesk.Viewing.Search");o.SearchManager=r,o.ModelPartsSearchProvider=class extends n{constructor(e){super(e)}search(e){return new Promise(((t,i)=>{const n=this.viewer.getVisibleModels(),r=[];0===n.length&&t(r);for(let t=0;t<n.length;t++){const i=n[t],o=[],s=i.getInstanceTree();i.getObjectTree((t=>{t.enumNodeChildren(t.getRootId(),(t=>{const i=s&&s.getNodeName(t);i&&-1!==i.toLowerCase().indexOf(e)&&o.push(t)}),!0)})),r.push({ids:o,model:i})}t(r)}))}getProviderId(){return"ModelPartsSearchProvider"}},o.PropertiesSearchProvider=class extends n{constructor(e){super(e)}search(e){return new Promise(((t,i)=>{const n=this.viewer.getVisibleModels(),r=[];0===n.length&&t(r);for(let o=0;o<n.length;o++){const s=n[o];s.search(e,(e=>{r.push({ids:e,model:s}),r.length===n.length&&t(r)}),i)}}))}getProviderId(){return"PropertiesSearchProvider"}},o.TextSearchProvider=class extends n{constructor(e){super(e),e.loadExtension("Autodesk.StringExtractor")}search(e){return new Promise((t=>{this.viewer.getExtensionAsync("Autodesk.StringExtractor").then((i=>i.getDocumentStrings().then((i=>{const n=[],r=this.viewer.impl.get2DModels();for(let t=0;t<r.length;t++){const o=r[t].id,s=!r[t].isLeaflet(),a=i[o];if(!a)continue;const l=a.strings,c=this.searchStrings(l,e,o,s);n.push({modelId:o,searchResult:c})}t(n)}))))}))}searchStrings(e,t,i,n){let r=[];if(n)for(let n=0;n<e.length;n++){let o=0;const s=[];for(;-1!==o;)o=e[n].string.toLowerCase().indexOf(t,o),-1!==o&&(s.push(o),o+=1);if(s.length>0){const o=this.splitOccurrences(e[n],s,t,i);r=r.concat(o)}}else for(let i=0;i<e.length;i++)-1!==e[i].string.toLowerCase().indexOf(t)&&r.push(e[i]);return r}splitOccurrences(e,t,i,n){const r=this.viewer.impl.findModel(n),o=[];let s=1/72;const a=r.getData();function l(t,i){const n=e.stringCharWidths.slice(t,i);if(!n.length)return 0;return n.reduce(((e,t)=>e+t))}if(r){const n=a.metadata.page_dimensions.page_units;s*=Autodesk.Viewing.Private.convertUnits(Autodesk.Viewing.Private.ModelUnits.INCH,n,1,1);const c=a.scaleX,h=(r.getData().scaleY||s)*e.stringHeight;for(let n=0;n<t.length;n++){const r={string:i};let a=l(0,t[n]),u=l(t[n],t[n]+i.length);if(e.stringWidth){const t=l(0,e.string.length),i=e.stringWidth/t*s;a*=i,u*=i}else a*=c,u*=c;const d=e.angle||0,p=Math.cos(d)*a,f=Math.sin(d)*a;let m=e.stringPosition[0]+p,g=e.stringPosition[1]+f,v=m+u,y=g+h;const b=new THREE.Vector2(m,g),x=new THREE.Vector2(v,y),_=new THREE.Box2(b,x);r.boundingBox=_,r.angle=e.angle,o.push(r)}}return o}getProviderId(){return"TextSearchProvider"}}},85623:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DefaultHandler:()=>r});i(41434);var n=i(16840);function r(e,t,i){this.clickConfig=null,this.getNames=function(){return["default"]},this.getName=function(){return this.getNames()[0]},this.setClickBehavior=function(e){this.clickConfig=e},this.getClickBehavior=function(){return this.clickConfig},this.activate=function(e){},this.deactivate=function(e){},this.handleAction=function(t,n,r){for(var o=0;o<t.length;++o)switch(t[o]){case"selectOnly":e.selector&&n&&e.selector.setSelection([n.dbId],n.model,void 0,r);break;case"deselectAll":e.selector&&e.selector.setSelection([]);break;case"selectToggle":e.selector&&n&&e.selector.toggleSelection(n.dbId,n.model);break;case"isolate":n&&e.isolate(n.dbId);break;case"showAll":e.showAll();break;case"setCOI":n&&n.intersectPoint&&(i.setPivotPoint(n.intersectPoint,!0,!0),i.pivotActive(!0,!0));break;case"hide":n&&e.hide(n.dbId);break;case"show":n&&e.show(n.dbId);break;case"toggleVisibility":n&&e.toggleVisibility(n.dbId);break;case"focus":e.selector&&(n?e.selector.setSelection([n.dbId],n.model):e.selector.setSelection([]),i.fitToView())}},this.handleSingleClick=function(t,r){if((0,n.isMobileDevice)())return!1;const o=e.isRightBtnSelectionEnabled();var s=t.ctrlKey||t.metaKey,a=t.shiftKey,l=t.altKey;if(0===r||2===r&&o){var c=e.clientToViewport(t.canvasX,t.canvasY),h="click";s&&(h+="Ctrl"),a&&(h+="Shift"),l&&(h+="Alt");var u=(d=e.hitTestViewport(c,!1))?"onObject":"offObject";if(this.clickConfig&&this.clickConfig[h]&&this.clickConfig[h][u])return this.handleAction(this.clickConfig[h][u],d,r),!0}else if(1===r&&a&&!l&&!s){var d;c=e.clientToViewport(t.canvasX,t.canvasY);if((d=e.hitTestViewport(c,!1))&&d.intersectPoint)return i.setPivotPoint(d.intersectPoint,!0,!0),i.pivotActive(!0,!0),!0}return!1},this.handleDoubleClick=function(n,r){if(e.selector&&0===r){var o=e.clientToViewport(n.canvasX,n.canvasY),s=e.hitTestViewport(o,!1);return s?e.selector.setSelection([s.dbId],s.model):e.selector.clearSelection(),i.fitToView(),!0}return 1===r&&(t.fitBounds(!1,i.getBoundingBox(!0)),t.setPivotSetFlag(!1),!0)},this.handleSingleTap=function(i){if(i.clientX=i.pointers[0].clientX,i.clientY=i.pointers[0].clientY,e.api.triggerSingleTapCallback(i),i.hasOwnProperty("pointers")&&2===i.pointers.length)return t.setRequestHomeView(!0),!0;if(e.selector&&!e.selector.selectionDisabled){var n=e.clientToViewport(i.canvasX,i.canvasY),r=e.hitTestViewport(n,!1);return r?(e.selector.setSelection([r.dbId],r.model),e.api.triggerSelectionChanged([r.dbId])):(e.selector.clearSelection(),e.api.triggerSelectionChanged(null)),!0}return!1},this.handleDoubleTap=function(t){t.clientX=t.pointers[0].clientX,t.clientY=t.pointers[0].clientY,e.api.triggerDoubleTapCallback(t);var n=this.handleSingleTap(t,0);return i.fitToView(),n},this.handlePressHold=function(t){return"press"===t.type&&(t.clientX=t.pointers[0].clientX,t.clientY=t.pointers[0].clientY,e.api.triggerContextMenu(t))},this.handleGesture=function(t){return!!t.type.includes("swipe")&&(t.clientX=t.pointers[0].clientX,t.clientY=t.pointers[0].clientY,e.api.triggerSwipeCallback(t))}}},16274:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FovTool:()=>r});var n=i(41434);function r(e){var t=.001,i=e.navigation,r=i.getCamera(),o=["fov"],s=!1,a=0,l=null,c=null,h=!1,u=0,d=-5,p=-1,f=d,m=new n.Vector3,g=new n.Vector3,v=new n.Vector3,y=null;function b(e){return e<0&&e>-3?-3:e>0&&e<3?3:e}this.getNames=function(){return o},this.getName=function(){return o[0]},this.activate=function(e){u=0},this.deactivate=function(e){f=d},this.getCursor=function(){return 0!==u&&f===d?null:"url(data:image/x-icon;base64,AAACAAEAGBgAAAAAAACICQAAFgAAACgAAAAYAAAAMAAAAAEAIAAAAAAAYAkAABMLAAATCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlgAAAP8AAAD/AAAAlgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAACEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnAwMD/yEhIf8AAABmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAGknJyf/goKC/8/Pz/8aGhr/AAAALQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////AAAA/wAAAAAAAAAAAAAAAAAAAAAAAABTFBQU/2lpaf/MzMz///////////+Wlpb/AAAAlgAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAlgAAAP8AAAD/AAAAlgAAAAAAAAAAAAAAOAAAAKFTU1P/t7e3////////////8PDw////////////AQEB/wAAAAEAAAAAAAAAFAAAAH0KCgr/AAAAYwAAAAAAAAAAAAAAlgAAAP8AAAD/AAAAlgAAAAAAAAAjCwsL/6Ghof/t7e3///////Dw8P9MTEz/LS0t//Pz8///////Ghoa/wAAABoAAAANDQ0N/319ff+rq6v/Y2Nj/wAAAK8AAABGAAAA////////////AAAA/wAAAF0hISH/jIyM////////////sLCw/xEREf8AAACHAAAArKysrP//////V1dX/wAAAFcAAABSUlJS//f39///////8PDw/6+vr/86Ojr/LS0t////////////FRUV/1xcXP/Gxsb/+Pj4//Hx8f9MTEz/AAAAsAAAAEcAAAAAAAAAZ2dnZ///////pKSk/wAAAKQAAACtra2t///////////////////////m5ub/kZGR/wAAAP8AAAD/q6ur//Hx8f//////vb29/x0dHf8AAACIAAAAAAAAAAAAAAAAAAAAOjo6Ov//////5+fn/wAAAOcAAADd3d3d////////////////////////////+/v7/9bW1v/i4uL//v7+//Pz8/9hYWH/AAAAvQAAAFQAAAAAAAAAAAAAAAAAAAAAAAAAJycnJ//6+vr//////wMDA/8AAADv7+/v/////////////////////////////////////////////////7y8vP8ODg7/AAAAKwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJiYmJv/6+vr//////wkJCf8AAADv7+/v//////////////////////////////////f39//9/f3//////+np6f+UlJT/GBgY/wAAAH0AAAACAAAAAAAAAAAAAAAAAAAAKSkpKf///////v7+/w0NDf8AAADd3d3d////////////////////////////29vb/39/f/+Xl5f/5+fn////////////5ubm/1RUVP8CAgL/AAAAPwAAAAAAAAAAAAAAOTk5Of//////8PDw/wgICP8AAAChoaGh/////////////////+np6f+YmJj/QkJC/wAAAP8AAAD/UFBQ/7e3t//39/f///////////+oqKj/EBAQ/wAAAIgAAAAAAAAAZ2dnZ///////29vb/wEBAf8AAAA4NTU1/9zc3P/t7e3/tbW1/01NTf8AAACYAAAA////////////AwMD/wsLC/9oaGj/y8vL////////////8fHx/zg4OP8AAACWAAAApaWlpf//////n5+f/wAAAJ8AAAAAAAAAczg4OP9LS0v/EhIS/wAAAE0AAAAAAAAA////////////FRUV/wAAABUAAABoJSUl/4GBgf/i4uL///////////9+fn7/Pz8///b29v//////SkpK/wAAAEoAAAAAAAAAAAAAADgAAABLAAAAEgAAAAAAAAAAAAAAlgAAAP8AAAD/AAAAlgAAAAAAAAAAAAAAJQAAAIE8PDz/np6e//z8/P/////////////////8/Pz/CQkJ/wAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlgAAAP8AAAD/AAAAlgAAAAAAAAAAAAAAAAAAAAAAAAA8DAwM/09PT/+7u7v///////////+QkJD/AAAAkwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////Dw8P/wAAAA8AAAAAAAAAAAAAAAAAAAAAAAAADAAAAFIYGBj/aGho/729vf8WFhb/AAAAJwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////FRUV/wAAABUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAQEB/w8PD/8AAABUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////////////DAwM/wAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlgAAAP8AAAD/AAAAlgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8x/h/nO/4fw1D+HwFy/h4BRu4YAHOGEABkAAAAXAAAIFwAAOBnAAHgIAAD4GUAAOB4AABgXAAAIGMAAABtggAAVMYYAHT+HgE7/g8BcP4Pw2/+D+dc/h//XP///2c=), auto"},this.getMotionDelta=function(e){var i=g.x-m.x,n=g.y-m.y,r=g.z-m.z;Math.abs(i)<t&&(i=0),Math.abs(n)<t&&(n=0),Math.abs(r)<t&&(r=0),e.set(i,n,r)},this.stepMotionDelta=function(e,t){t?(m.x+=.6*e.x,m.y+=.6*e.y,m.z+=.6*e.z):m.copy(g)},this.getAccumulatedWheelDelta=function(){var e=Date.now(),t=0;return c&&e-c>100?(t=b(a),a=0,l=null,c=null,h=!1):l&&e-l>100&&(h?Math.abs(a)>=3&&(t=a,a=0):(t=b(a),h=!0,a=0)),t},this.update=function(){var e=!1,t=f>d;if(f>d){this.controller.setIsLocked(!0),this.getMotionDelta(v);var n=v.x,o=v.y,a=v.z;if(0!==n||0!==o||0!==a)if(t=!0,f>=0)o=-o,0!==(a=Math.abs(n)>Math.abs(o)?n:o)&&(a*=-1,i.setVerticalFov(i.getVerticalFov()*(1+a),!0));else{var l=this.getAccumulatedWheelDelta()/3;0!==l&&i.setFocalLength(i.getFocalLength()+l,!0)}this.stepMotionDelta(v,!0),f===p&&Math.abs(a)<1e-5&&(this.interactionEnd(p),e=!0)}return t?this.utilities.pivotActive(i.getPivotSetFlag(),!0):this.utilities.pivotUpdate(),!s&&(e||f>d)&&(f>p&&m.copy(g),f=d,this.controller.setIsLocked(!1)),r.dirty},this.interactionStart=function(e,t){(t||e>f)&&(f=e,s=!0),i.toPerspective()},this.interactionEnd=function(e){e===f&&(e!==p&&this.utilities.pivotActive(!1),s=!1)},this.handleWheelInput=function(e){if(f>p)return!1;i.getReverseZoomDirection()&&(e*=-1),g.z+=e,a+=e;var t=Date.now();return l||(l=t),c=t,0!=e&&this.interactionStart(p),!0},this.handleGesture=function(e){switch(e.type){case"dragstart":return this.handleButtonDown(e,0);case"dragmove":return this.handleMouseMove(e);case"dragend":return this.handleButtonUp(e,0);case"drag3start":return y="drag",this.handleButtonDown(e,0);case"drag3move":return"drag"===y&&this.handleMouseMove(e);case"drag3end":return"drag"===y&&this.handleButtonUp(e,0),y=null,!1}return!1},this.handleButtonDown=function(e,t){return u+=1<<t,2!==t&&(m.x=.5*(e.normalizedX+1),m.y=1-.5*(e.normalizedY+1),g.copy(m),this.interactionStart(t),!0)},this.handleButtonUp=function(e,t){return u-=1<<t,2!==t&&(g.x=.5*(e.normalizedX+1),g.y=1-.5*(e.normalizedY+1),this.interactionEnd(t),!0)},this.handleMouseMove=function(e){return g.x=.5*(e.normalizedX+1),g.y=1-.5*(e.normalizedY+1),f>p},this.handleBlur=function(e){return this.interactionEnd(f),!1}}},30126:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GestureHandler:()=>s,GestureRecognizers:()=>o});var n=i(16840);let r;(0,n.isNodeJS)()||(r=i(35255));const o={};function s(e){var t=e.navigation,i=["gestures"],s=this,a=!0,l=!1,c=!0,h=null,u=!1,d=(0,n.isTouchDevice)();t.setIsTouchDevice(d),d&&((h=new r.Manager(e.canvasWrap,{recognizers:[o.drag,o.doubletap,o.doubletap2,o.singletap,o.singletap2,o.press,o.drag3,o.swipe,o.pan,o.pinch,o.rotate],handlePointerEventMouse:!1,inputClass:n.isIE11?r.PointerEventInput:r.TouchInput})).get("pinch").recognizeWith([h.get("drag")]),e.canvasWrap.addEventListener("touchstart",this.onTouchStart,!1)),this.onTouchStart=function(e){e.preventDefault()},this.getNames=function(){return i},this.getName=function(){return i[0]},this.isActive=function(){return u},this.__clientToCanvasCoords=function(t){var i,n,r=e.impl.getCanvasBoundingClientRect(),o=r.width,s=r.height;t.hasOwnProperty("center")?(i=t.center.x-r.left,n=t.center.y-r.top):(i=t.pointers[0].clientX-r.left,n=t.pointers[0].clientY-r.top),t.canvasX=i,t.canvasY=n,t.normalizedX=i/o*2-1,t.normalizedY=(s-n)/s*2-1},this.distributeGesture=function(e){s.__clientToCanvasCoords(e),s.controller.distributeEvent("handleGesture",e)&&e.preventDefault()},this.onSingleTap=function(e){s.__clientToCanvasCoords(e),s.controller.distributeEvent("handleSingleTap",e)&&e.preventDefault()},this.onDoubleTap=function(e){s.__clientToCanvasCoords(e),s.controller.distributeEvent("handleDoubleTap",e)&&e.preventDefault()},this.onPressHold=function(e){s.__clientToCanvasCoords(e),s.controller.distributeEvent("handlePressHold",e)&&e.preventDefault()},this.onHammerInput=function(e){s.setMouseDisabledWhenTouching(e)},this.setMouseDisabledWhenTouching=function(e){e.isFirst&&!l?(a=s.controller.enableMouseButtons(!1),l=!0):e.isFinal&&setTimeout((function(){s.controller.enableMouseButtons(a),l=!1}),10)},this.activate=function(e){h&&!u&&(h.on("dragstart dragmove dragend",this.distributeGesture),h.on("singletap",this.onSingleTap),h.on("singletap2",this.onSingleTap),h.on("doubletap",this.onDoubleTap),h.on("doubletap2",this.onDoubleTap),h.on("press pressup",this.onPressHold),h.on("drag3start drag3move drag3end",this.distributeGesture),h.on("swipeleft swiperight swipeup swipedown",this.distributeGesture),c&&(h.on("panstart panmove panend",this.distributeGesture),h.on("pinchstart pinchmove pinchend",this.distributeGesture),h.on("rotatestart rotatemove rotateend",this.distributeGesture)),h.on("hammer.input",this.onHammerInput),h.get("doubletap2").recognizeWith("doubletap"),h.get("singletap2").recognizeWith("singletap"),h.get("singletap").requireFailure("doubletap"),h.get("swipe").recognizeWith("drag")),u=!0},this.deactivate=function(e){h&&u&&(h.off("dragstart dragmove dragend",this.distributeGesture),h.off("singletap",this.onSingleTap),h.off("singletap2",this.onSingleTap),h.off("doubletap",this.onDoubleTap),h.off("doubletap2",this.onDoubleTap),h.off("press pressup",this.onPressHold),h.off("drag3start drag3move drag3end",this.distributeGesture),h.off("swipeleft swiperight swipeup swipedown",this.distributeGesture),c&&(h.off("panstart panmove panend",this.distributeGesture),h.off("pinchstart pinchmove pinchend",this.distributeGesture),h.off("rotatestart rotatemove rotateend",this.distributeGesture)),h.off("hammer.input",this.onHammerInput)),u=!1},this.update=function(){return!1},this.handleBlur=function(e){return!1},this.disableTwoFingerSwipe=function(){c=!1,h&&(h.remove(r.Pan),h.remove(r.Pinch),h.remove(r.Rotate),h.off("panstart panmove panend",this.distributeGesture),h.off("pinchstart pinchmove pinchend",this.distributeGesture),h.off("rotatestart rotatemove rotateend",this.distributeGesture))},this.setGestureParameter=function(e,t,i){const n=h&&h.get(e);return!!n&&(n.options[t]=i,!0)},this.restoreGestureParameterDefault=function(e,t){const i=h&&h.get(e);if(!i)return!1;const n=o[e][1];return i.options[t]=n.hasOwnProperty(t)?n[t]:i.defaults[t],!0}}r&&function(){if(!o.singletap){var e=o;e.singletap=[r.Tap,{event:"singletap",threshold:7,time:400}],e.singletap2=[r.Tap,{event:"singletap2",pointers:2,threshold:7,time:400}],e.press=[r.Press,{event:"press",time:500,threshold:50}],e.doubletap=[r.Tap,{event:"doubletap",taps:2,interval:300,threshold:6,posThreshold:30}],e.doubletap2=[r.Tap,{event:"doubletap2",pointers:2,taps:2,interval:300,threshold:6,posThreshold:40}],e.swipe=[r.Swipe,{event:"swipe",pointers:1,threshold:200,velocity:1.7}],e.drag=[r.Pan,{event:"drag",pointers:1}],e.drag3=[r.Pan,{event:"drag3",pointers:3,threshold:15}],e.pan=[r.Pan,{event:"pan",pointers:2,threshold:20}],e.pinch=[r.Pinch,{event:"pinch",pointers:2,enable:!0,threshold:.05}],e.rotate=[r.Rotate,{event:"rotate",pointers:2,enable:!0,threshold:7}]}}()},34808:(e,t,i)=>{"use strict";function n(e){var t=["hottouch"],i={SHIFT:0,ALT:0,CONTROL:0},n=null,r=null,o=!1,s=!1,a=null,l=16,c=17,h=18;this.active=!1,this.getNames=function(){return t},this.getName=function(){return t[0]},this.activate=function(e){this.active=!0},this.deactivate=function(e){this.active=!1},this.isActive=function(){return this.active},this.__checkStart=function(){a&&(this.controller.distributeEvent("handleGesture",a),a=null)},this.update=function(){if(this.controller.getIsLocked())return!1;var t=e.getActiveNavigationTool(),i=!1===o&&!0===s;if(i||!0===o&&!1===s){var a=i?"worldup":"fov";if(t===a)return!1;if(t===n)return e.setActiveNavigationTool(a),n=a,this.__checkStart(),!1;r=t,e.setActiveNavigationTool(a),n=a,this.__checkStart()}else n&&(e.setActiveNavigationTool(r),n=null,r=null);return!1},this.resetKeys=function(){i.SHIFT=0,i.CONTROL=0,i.ALT=0},this.updateModifierState=function(e){i.CONTROL=e.ctrlKey?1:0,i.SHIFT=e.shiftKey?1:0,i.ALT=e.altKey?1:0},this.handleGesture=function(t){if(t===a)return!1;switch(t.type){case"drag3start":e.navigation.isActionEnabled("fov")&&(a=t,o=!0);break;case"drag3move":case"rotatemove":break;case"drag3end":o=!1;break;case"rotatestart":e.navigation.isActionEnabled("roll")&&(a=t,s=!0);break;case"rotateend":s=!1}return!1},this.handleKeyDown=function(e,t){switch(this.updateModifierState(e),t){case l:i.SHIFT=1;break;case c:i.CONTROL=1;break;case h:i.ALT=1}return!1},this.handleKeyUp=function(e,t){switch(this.updateModifierState(e),t){case l:i.SHIFT=0;break;case c:i.CONTROL=0;break;case h:i.ALT=0}return!1},this.handleButtonDown=function(e,t){return this.updateModifierState(e),!1},this.handleButtonUp=function(e,t){return this.updateModifierState(e),!1},this.handleMouseMove=function(e){return this.updateModifierState(e),!1},this.handleBlur=function(e){return this.resetKeys(),!1}}i.r(t),i.d(t,{HotGestureTool:()=>n})},27587:(e,t,i)=>{"use strict";i.r(t),i.d(t,{HotkeyManager:()=>r});const n=function(e,t){return e-t};function r(){var e=[],t=[],i=[],r=[],o=["hotkeys"];this.getNames=function(){return o},this.getName=function(){return o[0]},this.pushHotkeys=function(t,i,r){if(e.some((function(e){return e.id===t})))return!1;for(var o=0;o<i.length;o++)e.push({id:t,keys:i[o].keycodes.sort(n).join(),onPress:i[o].onPress,onRelease:i[o].onRelease,options:r||{}});return!0},this.popHotkeys=function(t){for(var i=!1,n=e.length-1;n>=0;n--)e[n].id===t&&(e.splice(n,1),i=!0);return i};const s=function(){var e,n=t.join();for(e=0;e<r.length;)r[e].keys===n?r.splice(e,1):e++;for(e=0;e<i.length;)i[e].keys!==n?i.splice(e,1):e++};this.handleKeyDown=function(n,o){if(-1===t.indexOf(o)){for(var a=t.join(),l=t.slice(0),c=0;c<t.length&&t[c]<o;)c++;t.splice(c,0,o);var h=t.join(),u=t.slice(0);s();var d,p=[],f=[];for(c=e.length-1;c>=0;c--)(d=e[c]).keys===a&&d.onRelease?p.unshift(d):d.keys===h&&d.onPress&&f.unshift(d);for(c=p.length-1;c>=0&&!(d=p[c]).onRelease(l);c--)d.options.tryUntilSuccess&&r.unshift(d);for(c=f.length-1;c>=0&&!(d=f[c]).onPress(u);c--)d.options.tryUntilSuccess&&i.unshift(d)}},this.handleKeyUp=function(n,o){var a=t.join(),l=t.slice(0),c=t.indexOf(o);c>-1&&t.splice(c,1);var h=t.join(),u=t.slice(0);s();var d,p=[],f=[];for(c=e.length-1;c>=0;c--)(d=e[c]).keys===a&&d.onRelease?p.unshift(d):d.keys===h&&d.onPress&&f.unshift(d);for(c=p.length-1;c>=0&&!(d=p[c]).onRelease(l);c--)d.options.tryUntilSuccess&&r.unshift(d);for(c=f.length-1;c>=0&&!(d=f[c]).onPress(u);c--)d.options.tryUntilSuccess&&i.unshift(d)},this.update=function(){var e,t;for(t=0;t<r.length;)!0===(e=r[t]).onRelease(e.keys.split())?r.splice(t,1):t++;for(t=0;t<i.length;)!0===(e=i[t]).onPress(e.keys.split())?i.splice(t,1):t++;return!1},this.handleBlur=function(){for(var e=t.length-1;e>=0;e--)this.handleKeyUp(null,t[e])},this.activate=function(){},this.deactivate=function(){}}},89853:(e,t,i)=>{"use strict";i.r(t),i.d(t,{KeyCode:()=>n});const n={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CONTROL:17,ALT:18,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46,ZERO:48,SEMICOLONMOZ:59,EQUALSMOZ:61,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,LCOMMAND:91,RCOMMAND:93,PLUS:107,PLUSMOZ:171,DASHMOZ:109,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,DASHMOZNEW:173,SEMICOLON:186,EQUALS:187,COMMA:188,DASH:189,PERIOD:190,SLASH:191,LBRACKET:219,RBRACKET:221,SINGLEQUOTE:222,COMMANDMOZ:224}},76052:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Navigation:()=>a});var n=i(41434),r=i(49720),o=i(78443);const s={TRANSITION_ACTIVE_FLAG_CHANGED:"transitionActiveFlagChanged"};function a(e){var t=6.88,i=1e-6;this.__options={dollyToPivot:!1,orbitPastPoles:!0,reverseDolly:!1,reverseHorizontalLook:!1,reverseVerticalLook:!1,useLeftHandedInput:!1,usePivotAlways:!1,lockNavigation:!1},this.__lockSettings={orbit:!1,pan:!1,zoom:!1,roll:!1,fov:!1,gotoview:!1,walk:!1},this.FIT_TO_VIEW_VERTICAL_MARGIN=.05,this.FIT_TO_VIEW_VERTICAL_OFFSET=0,this.FIT_TO_VIEW_HORIZONTAL_MARGIN=.05,this.FIT_TO_VIEW_HORIZONTAL_OFFSET=0,this.__pivotIsSetFlag=!1,this.__fitToViewRequested=!1,this.__homeViewRequested=!1,this.__transitionActive=!1,this.__destinationView=null,this.__is2D=!1,this.__isTouchDevice=!1,this.__kEpsilon=i,this.__minDistance=1e-5;var r=void 0,o=void 0,s=2,a=200,l=null,c={left:0,top:0,width:1,height:1},h=Number.MAX_VALUE;this.uninitialize=function(){this.setCamera(null)},this.setMinimumLineWidth=function(e){h=e||Number.MAX_VALUE},this.setCamera=function(e){e!==l&&(l=e,e&&(Object.prototype.hasOwnProperty.call(e,"target")||(e.target=new n.Vector3(0,0,0)),Object.prototype.hasOwnProperty.call(e,"pivot")||(e.pivot=new n.Vector3(0,0,0)),e.worldup=e.up.clone(),e.dirty=!0))},this.getCamera=function(){return l},this.setScreenViewport=function(e){c=e},this.getScreenViewport=function(){return c},this.__setUp=function(e){if(e&&l&&0!==e.clone().normalize().sub(l.worldup).lengthSq())return l.worldup.copy(e).normalize(),l.dirty=!0,!0;return!1},this.__getUp=function(){return l?l.worldup:new n.Vector3(0,1,0)},this.setView=function(e,t){l&&e&&t&&(l.position.copy(e),l.target.copy(t),l.dirty=!0)},this.orientCameraUp=function(e){l&&(this.isActionEnabled("roll")||e)&&(l.up.copy(this.getAlignedUpVector()),l.dirty=!0)},this.getPivotPoint=function(){return l?l.pivot.clone():new n.Vector3(0,0,0)},this.setPivotPoint=function(e){l&&e&&l.pivot.copy(e)},this.getPosition=function(){return l?l.position.clone():new n.Vector3(0,0,1)},this.setPosition=function(e){l&&e&&(l.position.copy(e),l.dirty=!0)},this.setTarget=function(e){l&&e&&(l.target.copy(e),l.dirty=!0)},this.getTarget=function(){return l?l.target.clone():new n.Vector3(0,0,0)},this.getEyeVector=function(){return l?l.target.clone().sub(l.position):new n.Vector3(0,0,-1)},this.getEyeToCenterOfBoundsVec=function(e){return l?e.getCenter(new n.Vector3).sub(l.position):new n.Vector3(0,0,-1)},this.getFovMin=function(){return t},this.getFovMax=function(){return 100},this.setZoomInLimitFactor=function(e){a=e},this.getZoomInLimitFactor=function(){return a},this.setZoomOutLimitFactor=function(e){s=e},this.getZoomOutLimitFactor=function(){return s},this.isPointVisible=function(e){return(new n.Frustum).setFromProjectionMatrix(l.projectionMatrix.clone().multiply(l.matrixWorldInverse)).containsPoint(e)},this.setVerticalFov=function(e,r){if((!l||l.isPerspective)&&(e<t?e=t:e>100&&(e=100),l&&this.isActionEnabled("fov"))){if(Math.abs(l.fov-e)<=i)return;if(r){var o=this.__pivotIsSetFlag&&this.isPointVisible(this.getPivotPoint()),s=this.getPosition(),a=this.getEyeVector(),c=n.Math.degToRad(l.fov),h=n.Math.degToRad(e),u=o?this.getPivotPlaneDistance():a.length(),d=u*Math.tan(.5*c)/Math.tan(.5*h),p=a.normalize().multiplyScalar(u-d);this.setPosition(s.add(p)),o&&this.setTarget(this.getTarget().add(p))}l.setFov(e),l.dirty=!0}},this.applyRotation=(e,t,i,n)=>{e.sub(i),e.applyAxisAngle(n,t),e.add(i)},this.getSignedAngle=(e,t,i)=>{var n=e.angleTo(t),r=e.clone().cross(t).normalize();return n*(i.dot(r)>0?1:-1)},this.computeFit=function(t,i,r,o,s){if(!o||o.isEmpty())return{position:t,target:i};s=void 0===s?1:s;for(var a=o.getCenter(new n.Vector3),l=o.getSize(new n.Vector3),c=t.clone().sub(i).normalize(),h=Math.tan(n.Math.degToRad(.5*r)),u=0,d=this.computeOrthogonalUp(t,i),p=c.clone().cross(d).normalize(),f=new n.Vector3,m=0===l.z?4:8,g=0;g<m;g++){f.set(0==(1&g)?-.5*l.x:.5*l.x,0==(2&g)?-.5*l.y:.5*l.y,0==(4&g)?-.5*l.z:.5*l.z);var v=0;e.isPerspective&&(v=f.dot(c));var y=Math.abs(f.dot(d)),b=Math.abs(f.dot(p)),x=v+(1+2*this.FIT_TO_VIEW_VERTICAL_MARGIN/(1-2*this.FIT_TO_VIEW_VERTICAL_MARGIN))*y/h;u<x&&(u=x),u<(x=v+(1+2*this.FIT_TO_VIEW_HORIZONTAL_MARGIN/(1-2*this.FIT_TO_VIEW_HORIZONTAL_MARGIN))*b/(s*h))&&(u=x)}return a.add(d.multiplyScalar(-u*this.FIT_TO_VIEW_VERTICAL_OFFSET)),a.add(p.multiplyScalar(u*this.FIT_TO_VIEW_HORIZONTAL_OFFSET)),c.multiplyScalar(u),{position:a.clone().add(c),target:a}},this.computeOrthogonalUp=function(e,t){var i=this.__getUp(),n=t.clone().sub(e);if(0===n.lengthSq())return n.copy(i);var r=n.clone().cross(i);return 0===r.lengthSq()&&(i.z>i.y?n.y-=1e-4:n.z-=1e-4,r.crossVectors(n,i)),r.cross(n).normalize()},this.fitBounds=function(e,t,i,n){const r=this.getTarget(),o=this.getPosition();if(!this.isActionEnabled("gotoview")&&!n||!t||t.isEmpty())return{position:o,target:r};const s=this.getVerticalFov();i||(t=this.rotateBoundsToCamera(t,o,r));const a=this.computeFit(o,r,s,t,l.aspect),c=i?this.computeOrthogonalUp(o,r):l.up;return e?(l.up.copy(c),this.setView(a.position,a.target)):this.setRequestTransitionWithUp(!0,a.position,a.target,s,c),this.setPivotPoint(a.target),this.setPivotSetFlag(!0),a},this.rotateBoundsToCamera=function(e,t,i){const r=(e=e.clone()).getCenter(new n.Vector3),o=t.clone().sub(i).normalize(),s=this.getSignedAngle(this.getCameraUpVector(),this.getAlignedUpVector(),o);return this.applyRotation(e.min,s,r,o),this.applyRotation(e.max,s,r,o),e.setFromPoints([e.min.clone(),e.max.clone()]),e},this.computeOverviewDistance=function(e){var t=e.getSize(new n.Vector3);if(this.__is2D){var i=l.aspect,r=t.x/i,o=t.y;return Math.max(r,o)}var s=this.getVerticalFov(),a=t.length();return 0===a&&(a=2),l.isPerspective?.5*a/Math.tan(n.Math.degToRad(.5*s)):a},this.applyDollyConstraint=function(e,t){if(!(r||o||s)||!this.__is2D)return e;var i=e;if(r&&s&&t&&e>1){var n,c=l.isPerspective?this.getEyeToCenterOfBoundsVec(t):this.getEyeVector();n=r?s*this.computeOverviewDistance(r):s*this.computeOverviewDistance(t);var u=Math.abs(n/c.length());u=Math.max(u,1),i=Math.min(i,u)}if(o||a&&t){var d=(o?l.clientHeight/o:Math.min(h,this.computeOverviewDistance(t)/a))/-this.getEyeVector().z;d=Math.min(d,1),i=Math.max(i,d)}return i},this.applyPanningConstraint2D=function(e){if(this.__is2D&&r){var t=l.position.x+e.x,i=l.position.y+e.y;t=n.Math.clamp(t,r.min.x,r.max.x),i=n.Math.clamp(i,r.min.y,r.max.y);var o=t-l.position.x,s=i-l.position.y,a=Math.min(e.x,0),c=Math.min(e.y,0),h=Math.max(e.x,0),u=Math.max(e.y,0);o=n.Math.clamp(o,a,h),s=n.Math.clamp(s,c,u),e.x=o,e.y=s}},this.updateCamera=function(){l&&(l.updateProjectionMatrix(),this.orient(l,l.target,l.position,l.up),l.dirty=!1)},this.setCamera(e),this.setConstraints2D=function(e,t){r=e,o=t},this.getConstrains2D=function(){return{maxViewRegion:r,maxPixelPerUnit:o}}}a.prototype.constructor=a,a.prototype.setIs2D=function(e){this.__is2D=!!e},a.prototype.getIs2D=function(){return this.__is2D},a.prototype.setIsTouchDevice=function(e){this.__isTouchDevice=!!e},a.prototype.getIsTouchDevice=function(){return this.__isTouchDevice},a.prototype.orient=function(){var e,t,i,r;return function(o,s,a,l){e||(e=new n.Matrix4,t=new n.Vector3,i=new n.Vector3,r=new n.Vector3);var c=e.elements;r.subVectors(a,s).normalize(),0===r.lengthSq()&&(r.z=1),t.crossVectors(l,r).normalize(),0===t.lengthSq()&&(l.z>l.y?r.y-=1e-4:r.z+=1e-4,t.crossVectors(l,r).normalize()),i.crossVectors(r,t),c[0]=t.x,c[4]=i.x,c[8]=r.x,c[1]=t.y,c[5]=i.y,c[9]=r.y,c[2]=t.z,c[6]=i.z,c[10]=r.z,o.setRotationFromMatrix(e)}}(),a.prototype.fov2fl=function(e){var t=n.Math.degToRad(e);return t<=0&&(t=1e-4),Math.round(12/Math.tan(.5*t))},a.prototype.fl2fov=function(e){e<=0&&(e=1e-4);var t=2*Math.atan(12/e);return n.Math.radToDeg(t)},a.prototype.setCameraUpVector=function(e,t){if(this.isActionEnabled("roll")||t){var i=this.getCamera();i.up.copy(e),i.dirty=!0}},a.prototype.getCameraUpVector=function(){var e=this.getCameraRightVector(!1),t=this.getEyeVector();return e.cross(t).normalize()},a.prototype.getAlignedUpVector=function(){var e=this.getCameraRightVector(!0),t=this.getEyeVector();return e.cross(t).normalize()},a.prototype.getCameraRightVector=function(e){var t=new n.Vector3,i=e?this.getWorldUpVector():this.getCamera().up,r=this.getEyeVector();return t.crossVectors(r,i),0===t.lengthSq()&&(Math.abs(r.z)>=Math.abs(r.y)?i.set(0,1,0):i.set(0,0,1),t.crossVectors(r,i)),t.normalize()},a.prototype.setWorldUpVector=function(e,t,i){(this.isActionEnabled("roll")||i)&&(this.__setUp(e),t&&this.orientCameraUp(i))},a.prototype.getWorldUpVector=function(){return this.__getUp().clone()},a.prototype.getWorldRightVector=function(){var e=new n.Vector3;return e.copy(this.__getUp()),Math.abs(e.z)<=Math.abs(e.y)?e.set(e.y,-e.x,0):e.z>=0?e.set(e.z,0,-e.x):e.set(-e.z,0,e.x),e.normalize()},a.prototype.getVerticalFov=function(){return this.getCamera().fov},a.prototype.getHorizontalFov=function(){var e=this.getScreenViewport();return this.getCamera().fov*(e.width/e.height)},a.prototype.getFocalLength=function(){return this.fov2fl(this.getVerticalFov())},a.prototype.setFocalLength=function(e,t){this.setVerticalFov(this.fl2fov(e),t)},a.prototype.setReverseZoomDirection=function(e){this.__options.reverseDolly=!!e},a.prototype.setReverseHorizontalLookDirection=function(e){this.getIs2D()?r.logger.warn("Autodesk.Viewing.Navigation.setReverseHorizontalLookDirection is not applicable to 2D"):this.__options.reverseHorizontalLookDirection=!!e},a.prototype.setReverseVerticalLookDirection=function(e){this.getIs2D()?r.logger.warn("Autodesk.Viewing.Navigation.setReverseVerticalLookDirection is not applicable to 2D"):this.__options.reverseVerticalLookDirection=!!e},a.prototype.getReverseZoomDirection=function(){return this.__options.reverseDolly},a.prototype.getReverseHorizontalLookDirection=function(){return this.getIs2D()?(r.logger.warn("Autodesk.Viewing.Navigation.getReverseHorizontalLookDirection is not applicable to 2D"),!1):this.__options.reverseHorizontalLookDirection},a.prototype.getReverseVerticalLookDirection=function(){return this.getIs2D()?(r.logger.warn("Autodesk.Viewing.Navigation.getReverseVerticalLookDirection is not applicable to 2D"),!1):this.__options.reverseVerticalLookDirection},a.prototype.setZoomTowardsPivot=function(e){this.__options.dollyToPivot=!!e},a.prototype.getZoomTowardsPivot=function(){return this.__options.dollyToPivot},a.prototype.setOrbitPastWorldPoles=function(e){this.getIs2D()?r.logger.warn("Autodesk.Viewing.Navigation.setOrbitPastWorldPoles is not applicable to 2D"):this.__options.orbitPastPoles=!!e},a.prototype.getOrbitPastWorldPoles=function(){return this.getIs2D()?(r.logger.warn("Autodesk.Viewing.Navigation.orbitPastWorldPoles is not applicable to 2D"),!1):this.__options.orbitPastPoles},a.prototype.setUsePivotAlways=function(e){this.__options.usePivotAlways=!!e},a.prototype.getUsePivotAlways=function(){return this.__options.usePivotAlways},a.prototype.setUseLeftHandedInput=function(e){this.__options.useLeftHandedInput=!!e},a.prototype.getUseLeftHandedInput=function(){return this.__options.useLeftHandedInput},a.prototype.setWheelSetsPivot=function(e){this.__options.wheelSetsPivot=!!e},a.prototype.getWheelSetsPivot=function(){return this.__options.wheelSetsPivot},a.prototype.setSelectionSetsPivot=function(e){this.__options.SelectionSetsPivot=!!e},a.prototype.getSelectionSetsPivot=function(){return this.__options.SelectionSetsPivot},a.prototype.setIsLocked=function(e){this.__options.lockNavigation=!!e},a.prototype.getIsLocked=function(){return this.__options.lockNavigation},a.prototype.setLockSettings=function(e){for(var t in this.__lockSettings)Object.prototype.hasOwnProperty.call(e,t)&&(this.__lockSettings[t]=e[t])},a.prototype.getLockSettings=function(){var e={};for(var t in this.__lockSettings)e[t]=this.__lockSettings[t];return e},a.prototype.isActionEnabled=function(e){return!this.__options.lockNavigation||!0===this.__lockSettings[e]},a.prototype.setPivotSetFlag=function(e){this.__pivotIsSetFlag=!!e},a.prototype.getPivotSetFlag=function(){return this.__pivotIsSetFlag},a.prototype.setRequestFitToView=function(e){this.isActionEnabled("gotoview")&&(this.__fitToViewRequested=!!e)},a.prototype.getRequestFitToView=function(){return this.__fitToViewRequested},a.prototype.setRequestHomeView=function(e){this.isActionEnabled("gotoview")&&(this.__homeViewRequested=!!e)},a.prototype.getRequestHomeView=function(){return this.__homeViewRequested},a.prototype.setRequestTransition=function(e,t,i,n,r,o){this.__destinationView=e?{position:t.clone(),coi:i.clone(),fov:n,up:this.getCamera().up.clone(),worldUp:this.getWorldUpVector(),reorient:r,pivot:o?o.clone():i.clone()}:null},a.prototype.setRequestTransitionWithUp=function(e,t,i,n,r,o,s){this.__destinationView=e?{position:t.clone(),coi:i.clone(),fov:n,up:r.clone(),worldUp:o||this.getWorldUpVector(),reorient:!1,pivot:s?s.clone():i.clone()}:null},a.prototype.getRequestTransition=function(){return this.__destinationView},a.prototype.setTransitionActive=function(e){const t=this.__transitionActive!=e;this.__transitionActive=!!e,t&&this.fireEvent({type:s.TRANSITION_ACTIVE_FLAG_CHANGED,transitionActive:!!e})},a.prototype.getTransitionActive=function(){return this.__transitionActive},a.prototype.getWorldSize=function(e){var t=this.getCamera(),i=t.aspect,r=2*e*Math.tan(n.Math.degToRad(.5*t.fov)),o=r*i;return new n.Vector2(o,r)},a.prototype.screenToViewport=function(e,t){return e=2*e-1,t=2*(t=1-t)-1,new n.Vector3(e,t,1)},a.prototype.viewportToScreen=function(e,t){return e=(e+1)/2,t=1-(t=(t+1)/2),new n.Vector2(e,t)},a.prototype.getWorldPoint=function(e,t){var i=this.screenToViewport(e,t);e=i.x,t=i.y;var r,o=this.getCamera();o.isPerspective&&(r=(r=new n.Vector3(e,t,1)).unproject(o));var s,a,l=this.getEyeVector(),c=this.getPosition();if(!o.isPerspective||isNaN(r.x)){var h=this.getWorldSize(l.length()),u=this.getCameraRightVector(!1).multiplyScalar(.5*e*h.x),d=this.getCameraUpVector().multiplyScalar(.5*t*h.y);s=l.clone().add(u).add(d).normalize()}else s=r.sub(c).normalize();var p=this.getPivotPoint(),f=s.dot(l);return a=this.__pivotIsSetFlag&&(this.getIs2D()||o.isPerspective&&f>0)?0!==f?Math.abs(p.sub(c).dot(l))/f:p.sub(c).length():o.isPerspective?.5*(o.near+o.far):o.orthoScale,s.multiplyScalar(a).add(c)},a.prototype.getPivotPlaneDistance=function(){var e=this.getPivotPoint(),t=this.getEyeVector(),i=this.getPosition();return e.sub(i).dot(t.normalize())},a.prototype.panRelative=function(e,t,i){if(this.isActionEnabled("pan")){var n=this.getScreenViewport(),r=this.getCamera(),o=this.getWorldSize(i),s=e*o.x*n.width/r.clientWidth,a=t*o.y*n.height/r.clientHeight,l=this.getCameraRightVector(!1).multiplyScalar(s),c=this.getCameraUpVector().multiplyScalar(a),h=l.add(c);this.applyPanningConstraint2D(h),this.setView(this.getPosition().add(h),this.getTarget().add(h))}},a.prototype.dollyFromPoint=function(e,t,i){if(this.isActionEnabled("zoom")&&!(Math.abs(e)<=this.__kEpsilon)){var n=this.getPosition(),r=this.getEyeVector();if(!this.getCamera().isPerspective){var o=r.lengthSq(),s=r.dot(this.getTarget().sub(t));t=r.clone().multiplyScalar(s/o).add(t)}var a=t.clone().sub(n),l=a.length(),c=l+e;c<this.__minDistance&&(c=this.__minDistance);var h=c/l;if(h=this.applyDollyConstraint(h,i),Math.abs(h-1)>this.__kEpsilon){a.multiplyScalar(h),a.set(-a.x,-a.y,-a.z);var u=a.add(t);r=this.getEyeVector(),this.getCamera().isPerspective||r.multiplyScalar(h),this.setView(u,r.add(u))}}},a.prototype.toPerspective=function(){if(this.getIs2D())r.logger.warn("Autodesk.Viewing.Navigation.toPerspective is not applicable to 2D");else{var e=this.getCamera();e.isPerspective||(e.toPerspective(),e.dirty=!0)}},a.prototype.toOrthographic=function(){var e=this.getCamera();e.isPerspective&&(e.toOrthographic(),e.dirty=!0)},a.snapToAxis=function(e){var t=new n.Vector3(Math.abs(e.x),Math.abs(e.y),Math.abs(e.z));return t.x>t.y&&t.x>t.z?e.set(e.x>0?1:-1,0,0):t.y>t.x&&t.y>t.z?e.set(0,e.y>0?1:-1,0):e.set(0,0,e.z>0?1:-1),e},o.EventDispatcher.prototype.apply(a.prototype),a.Events=s},88762:(e,t,i)=>{"use strict";i.r(t),i.d(t,{OrbitDollyPanTool:()=>s});var n=i(33423),r=i(27293),o=i(59991);function s(e,t,i){this.setGlobalManager(t.globalManager);var r,s,a=this,l=.001,c=.01,h=i&&i.hasOwnProperty("dollyDragScale")?i.dollyDragScale:100,u=-1!=navigator.userAgent.search("Mac OS"),d=i&&i.disablePinchRotation,p=t.navigation,f=p.getCamera(),m=["orbit","freeorbit","dolly","pan"],g=m[0],v=[g],y=g,b=null,x=1,_=0,E=0,A=0,S=0,w=!0,M=!1,T=null,C=!1,P=33,D=34,L=37,I=38,R=39,O=40,N=48,k=187,F=189,V=-4,U=-1,B=-5,z=new THREE.Vector3,G=new THREE.Vector3,H=new THREE.Vector2,W=new THREE.Vector2,j=new THREE.Vector2,X=new THREE.Vector2,q=new THREE.Vector3,Y=new THREE.Vector3,K=new THREE.Vector3,Z=new THREE.Vector3,Q=new THREE.Vector3,J=new THREE.Vector3,$=new THREE.Vector3,ee=new THREE.Vector3,te=new THREE.Vector3,ie=new THREE.Quaternion,ne=new THREE.Plane,re=[!1,!1,!1,!1,!1,!1],oe={SHIFT:0,ALT:0,CONTROL:0,SPACE:0};this.active=!1;var se,ae=function(t){e.renderer().rolloverObjectId(0,null,0)},le=.01,ce=i&&i.hasOwnProperty("dollyScrollScale")?i.dollyScrollScale:.6,he=1,ue=5,de=.025;function pe(e,t){var i=a.getWindow(),n=0,r=0,o=i.innerWidth,s=i.innerHeight;ee.set((e-.5*o-n)/(.5*o),(.5*s+r-t)/(.5*s),0);var l=ee.length();return l>1?ee.normalize():ee.z=Math.sqrt(1-l*l),Z.copy(f.position).sub(f.pivot),J.copy(f.up).setLength(ee.y),J.add($.copy(f.up).cross(Z).setLength(ee.x)),J.add(Z.setLength(ee.z)),J}this.getNames=function(){return m},this.getName=function(){return m[0]},this.activate=function(i){this.active=!0,v.push(i),y=i,w=t.prefs.get(o.Prefs3D.ENABLE_CUSTOM_ORBIT_TOOL_CURSOR),t.prefs.addListeners(o.Prefs3D.ENABLE_CUSTOM_ORBIT_TOOL_CURSOR,this._onPrefCursor),e.canvas.addEventListener("mouseout",ae),t.addEventListener(n.ESCAPE_EVENT,this.handleBlur)},this.deactivate=function(i){this.active=!1,t.prefs.removeListeners(o.Prefs3D.ENABLE_CUSTOM_ORBIT_TOOL_CURSOR,this._onPrefCursor);var r=v.length-1;r>0&&v[r]===i&&(v.pop(),y=v[r-1]),e.canvas.removeEventListener("mouseout",ae),t.removeEventListener(n.ESCAPE_EVENT,this.handleBlur)},this.isActive=function(){return this.active},this.adjustDollyLookSpeed=function(e){0===e?(de=.025,ue=5):((de*=e>0?1.1:.9)<1e-6&&(de=1e-6),(ue*=e>0?1.1:.9)<1e-6&&(ue=1e-6))},this.getDollySpeed=function(e,t){var i;if(!p.getZoomTowardsPivot()&&!p.getWheelSetsPivot()||f.isPerspective||p.getIs2D()){var n=p.getEyeVector(),r=p.getPosition();o=e.clone().sub(r).dot(n.normalize())*de;i=Math.abs(o)<le?o<0?-.01:le:o}else{var o=f.orthoScale*de;i=Math.abs(o)<5e-4&&t?0:o}return i},this.setPivotPointFromInput=function(t,i){if(!p.getIs2D()&&p.getWheelSetsPivot()){var n=e.hitTest(t,i,!0);if(n&&n.intersectPoint)this.utilities.setPivotPoint(n.intersectPoint,!0,!0);else{const n=p.getPivotPoint(),r=p.getEyeVector().normalize(),o=-n.dot(r);ne.set(r,o);let s=e.viewportToRay(e.clientToViewport(t,i)).intersectPlane(ne);this.utilities.setPivotPoint(s,!0,!0)}}},this.getDollyScrollScale=function(){return ce},this.setDollyScrollScale=function(e){ce=e},this.getDollyDragScale=function(){return h},this.setDollyDragScale=function(e){h=e},this.getLookSpeed=function(){return ue},this.coiIsActive=function(){return p.getPivotSetFlag()&&p.isPointVisible(p.getPivotPoint())},this.adjustSpeed=function(e){this.adjustDollyLookSpeed(e),this.utilities.autocam&&(this.utilities.autocam.orbitMultiplier=this.getLookSpeed())},this.getTriggeredMode=function(){return 1===B&&oe.SHIFT?v[1]:(e=oe,2===B&&e.SHIFT&&!e.ALT&&!e.CONTROL||2===B&&e.ALT&&!e.SHIFT&&!e.CONTROL||"dolly"===y&&!e.ALT&&"pinch"!==b||0!==q.z?function(){var e=oe;return!(e.CONTROL||e.ALT||e.SHIFT||2!==B&&1!==B)}()?"pan":"dolly":function(){var e=oe;return 2===B&&!e.SHIFT&&!(e.ALT^e.CONTROL)||2===B&&e.SHIFT&&e.CONTROL||1===B&&!e.SHIFT&&!e.CONTROL||1===B&&e.ALT||1===B&&e.CONTROL&&!e.ALT||0===B&&e.SHIFT&&!e.CONTROL&&!e.ALT||"pan"===y&&1!==B&&!e.ALT&&!("pinch"===b)||e.SPACE}()?"pan":"pan"===b||"pinch"===b?"dollypan":y);var e},this.initTracking=function(e,t){var i;if(f.isPerspective){i=.5*(f.near+f.far);var n=this.utilities.getHitPoint(e,t),r=p.getPosition();if(n&&n.sub){var o=n.sub(r),s=p.getEyeVector().normalize();i=Math.abs(s.dot(o))}else{if(p.getPivotSetFlag()&&p.isPointVisible(p.getPivotPoint())){var a=p.getPivotPlaneDistance();a>.01&&(i=a)}}}else i=p.getEyeVector().length();he=i},this.initOrbit=function(){this.utilities.setTemporaryPivot(f.isPerspective&&p.getPivotPoint().sub(p.getPosition()).dot(p.getEyeVector())<=0?p.getTarget():null)},this.getActiveMode=function(){return g},this.getCursor=function(){if(!w)return null;switch(g){case"freeorbit":case"orbit":return"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAt1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AAAAzMzP6+vri4uISEhKKioqtra2dnZ2EhIR9fX10dHRkZGQdHR3t7e3Hx8e5ubm1tbWoqKhWVlZKSko4ODgICAjv7+/o6OjMzMyxsbFOTk4pKSkXFxcEBAT29vbW1tZ6enpISEgLCwvhzeX+AAAAGXRSTlMANRO0nHRJHfnskIxQRKh89syDVwTWZjEJxPFEswAAAOFJREFUKM+1j+lygkAQhIflEAJe0Rw9u4CCeKKoSTTX+z9XoMJWWeX+ssrvZ3f19DQ5zOw/0DUMQPlmQ72bE2adBp8/Rp3CQUi3ILx+bxj4fjDs9T1Bmo6bbPPN8aDU4bjJt4nb+de789kSFyxn826jW3ICLNZZKU8nWWbrBTCRVm04U8TpjquRFf1Go0d7l8aYOrUR7FGEFr1S9LGymwthgX2gE/Kl0cHPOtF2xOWZ5QpIC93RflW4InkDoPRXesd5LJIMQPzV7tCMa7f6BvhJL79AVDmYTNQ1NhnxbI/uwB8H5Bjd4zQPBAAAAABJRU5ErkJggg==), auto";case"dolly":return"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAgVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8mJiYAAADNzc2/v7+fn59paWlPT08MDAwICAj6+vqpqak7Ozv29vby8vLp6em2traAgIBkZGRZWVlAQEAaGhpISEgkS7tbAAAAFHRSTlMAOvhpZD8mkQWegMy9qY1YVE01EYiqlE0AAADZSURBVCjPbY9ZloMgEAAbEbfsmRZZXbJn7n/AAX2RQVN/VD26AXLOeZLDGo6IbfI9tHq8cdxuj1HwvgCoaiHqKoRk+M3hB9jueUW8PnfsE/bJ3vms7nCkq7NoE3s99AXxoh8vFoXCpknrn5faAuJCenT0xPkYqnxQFJaU0gdZrsKm8aHZrAIffBj40mc1jsTfIJRWegq6opTMvlfqLqYg7kr1ZB7jFgeaMC59N//8O4WZ1IiPF8b5wMHcJn8zB4g4mc77zpxgAbMSUVoGK4iV0hL4wrksz+H0Bw5+E+HrniDQAAAAAElFTkSuQmCC), auto";case"pan":return"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAABHVBMVEUAAABPTk4AAAAAAAAJCQkRERE0MzQQEBAODg4QEBB4d3dbWlo9PDw/Pj4vLy8sLCwZGBgWFhYcHBwKCgoSEhIAAAAKCgoICAgKCgoQEBAODg4EBAQICAgPDw8REREMDAx2dnY0NDQvLy9QUFAaGhomJSYjIyM7OjokJCQNDA0mJiYNDQ0AAAAUFBQJCQkQEBAEBAQNDQ0PDw8VFRX///+amJkAAAD5+fnz8/PKycn9/f339vbi4eLR0dDNzMyAgIB8e3xycHH7+/vw7+/o6OjX1ta7urq4t7iwsLCnp6eioqKbmppva21OTk74+Pjl5eXc3Nzb29vLy8vDw8PDwsKrqqqdnZ2WlpaSkpKTkZKMiouEg4NkZGRISEgxLzBpgbsEAAAANHRSTlMA+fiQXgngKSYG/vX17uvBuqackpCNg3BpUkpAPBwTDvj18+vl0s/NwrOwoZZ+TDg4NBkBGrzX8QAAAP5JREFUKM99j9Vuw0AQRdeuKZyGkyZNmbnXDLHDVGb8/8/oy7paK1bO0+oc7WiGnGiaxq+QRTQAOh8f9Jv4H/Ge8PZPrCdlvkxfYluUT2WyyCq3mZ7unwlKVLcqOzA/Mf71j0TWJ/Ym6rPeca05Ni4iIevYc7yoUD2zQFhq71BdI9nvBeBabFDSPe8DswlUc1Riw3VxbH0NHBUPQ0jrbDnPYDjALQBMq9E7nkC5y7VDKTZlUg8Q0lmjvl74zlYErgvKa42GPKf3/a0kQmYCDY1SYMDosqMoiWrGwz/uAbNvc/fNon4kXRKGq+PUo2Mb96afV0iUxqGU2s4VBbKUP65NL/LKF+7ZAAAAAElFTkSuQmCC), auto"}return null},this.getMotionDelta=function(e,t){var i=p&&p.getReverseZoomDirection()?-1.5:1.5;u&&(i*=-1),re[0]&&(G.x+=c,j.x+=20),re[1]&&(G.x-=c,j.x-=20),re[2]&&(G.y+=c,j.y+=20),re[3]&&(G.y-=c,j.y-=20),re[4]&&(G.z+=i),re[5]&&(G.z-=i);var n=G.x-z.x,r=G.y-z.y,o=G.z-z.z;Math.abs(n)<l&&(n=0),Math.abs(r)<l&&(r=0),Math.abs(o)<l&&(o=0),e.set(n,r,o),t&&t.set(j.x-W.x,j.y-W.y)},this.stepMotionDelta=function(e,t){t?(z.x+=.6*e.x,z.y+=.6*e.y,z.z+=.6*e.z):z.copy(G),W.copy(j)},this.getFitBounds=function(){return this.utilities.viewerImpl.zoomBoundsChanged&&(se=this.utilities.viewerImpl.getVisibleBounds(!0),this.utilities.viewerImpl.zoomBoundsChanged=!1),se},this.update=function(){var e,i=!1,n=!1;this.getMotionDelta(q,X);var o=q.x,a=q.y,l=q.z;if(M||this.checkInteractionMode(),(M=B>U)&&this.controller.setIsLocked(!0),0!==o||0!==a||0!==l){switch(g){case"orbit":this.utilities.autocam&&this.utilities.autocam.startState&&(X.x=-X.x,T&&this.utilities.autocam.orbit(j,T,X.multiplyScalar(2),this.utilities.autocam.startState));break;case"freeorbit":!function(){if(p.isActionEnabled("orbit")){Z.subVectors(f.position,f.pivot),Q.subVectors(f.position,f.target);var e=Q.length();Q.normalize();var t=Math.acos(Y.dot(K)/Y.length()/K.length());t&&(t*=2,te.crossVectors(Y,K).normalize(),ie.setFromAxisAngle(te,-t),Z.applyQuaternion(ie),f.up.applyQuaternion(ie),K.applyQuaternion(ie),Q.applyQuaternion(ie),Y.copy(K)),f.position.addVectors(f.pivot,Z),f.target.subVectors(f.position,Q.multiplyScalar(e)),f.dirty=!0}}();break;case"dolly":var c,u=new THREE.Vector2;l*=ce,B>=0?(a=-a,l=Math.abs(o)>Math.abs(a)?o:a,p.getReverseZoomDirection()&&(l*=-1),l*=h,o=0,a=0,u=p.viewportToScreen(0,0)):(e=p.getScreenViewport(),r&&s?(u.x=r/e.width,u.y=s/e.height):u=p.viewportToScreen(0,0)),!p.getIs2D()&&p.getZoomTowardsPivot()?this.coiIsActive()?c=p.getPivotPoint():(u=p.viewportToScreen(0,0),c=p.getWorldPoint(u.x,u.y)):c=p.getWorldPoint(u.x,u.y),p.dollyFromPoint(l*this.getDollySpeed(c,l<0),c,this.getFitBounds());break;case"pan":p.panRelative(-o,a,he);break;case"dollypan":0===o&&0===a||p.panRelative(-o,a,he),e=p.getScreenViewport(),c=p.getWorldPoint(r/e.width,s/e.height);var v=p.getPosition(),y=p.getIs2D()?v.sub(c).length():he,S=(_/E-1)*y;p.dollyFromPoint(S,c,this.getFitBounds());var w=new THREE.Vector3,P=new THREE.Quaternion,D=p.getCameraUpVector(),L=w.copy(f.position).sub(f.target).normalize();P.setFromAxisAngle(L,1.2*A),D.applyQuaternion(P),p.getIs2D()||d&&("pinch"===b||"pan"===b)||p.setCameraUpVector(D),_=E,x,he=y+S}n=!0}return this.stepMotionDelta(q,"pan"!==g&&"dollypan"!==g),B===U&&Math.abs(l)<.01&&(this.interactionEnd(U),G.z=0,z.z=0,i=!0,n=!0),(oe.SHIFT||oe.ALT)&&-1!==m.indexOf(t.getActiveNavigationTool())&&(n=!0),!C&&(i||B>-5)&&(B>U&&(z.copy(G),this.utilities.removeTemporaryPivot()),this.utilities.autocam.endInteraction(),B=-5,M&&this.controller.setIsLocked(!1),M=!1,T=null,b=null),n?this.utilities.pivotActive(p.getPivotSetFlag(),B<=U):this.utilities.pivotUpdate(),f.dirty},this.checkInteractionMode=function(){var e=this.getTriggeredMode();e!==g&&("pan"===(g=e)&&B>U||"dollypan"===g)&&this.initTracking(z.x,z.y)},this.interactionStart=function(e,t){(t||e>B)&&(B=e,C=!0,e>U&&("pan"===g&&this.initTracking(z.x,z.y),"orbit"===g&&this.initOrbit()),!p.getSelectionSetsPivot()&&this.utilities.pivotActive(p.getPivotSetFlag(),e===U),this.utilities.autocam&&(this.utilities.autocam.sync(f),this.utilities.autocam.startInteraction(W.x,W.y),T=W.clone()))},this.interactionCheck=function(){(re[0]||re[1]||re[2]||re[3]||re[4]||re[5]||oe.SHIFT||oe.CONTROL||oe.ALT||oe.SPACE)&&this.interactionStart(V,!0)},this.interactionEnd=function(e){e===B&&(e!==U&&this.utilities.pivotActive(!1),C=!1)},this.isInteractionActive=function(){return C},this.handleWheelInput=function(t,i){if(r=i.canvasX,s=i.canvasY,this.isDragging)return!1;if(p.getIs2D()){var n=p.getScreenViewport(),o=e.intersectGround(r+n.width,s+n.height);this.utilities.setPivotPoint(o,!0,!0)}else this.setPivotPointFromInput(r,s);return p.getReverseZoomDirection()&&(t*=-1),G.z+=t,0!=t&&this.interactionStart(U),!0},this.resetKeys=function(){this.autoMove(-1,!1),oe.SHIFT=0,oe.CONTROL=0,oe.ALT=0,oe.SPACE=0},this.autoMove=function(e,t){t&&this.isDragging||(e<0?re[0]=re[1]=re[2]=re[3]=re[4]=re[5]=t:re[e]=t,t||this.interactionEnd(V),this.interactionCheck())},this.updateModifierState=function(e){oe.CONTROL=u&&e.metaKey||e.ctrlKey?1:0,oe.SHIFT=e.shiftKey?1:0,oe.ALT=e.altKey?1:0},this.handleKeyDown=function(e,t){this.updateModifierState(e);var i=!1;if(u&&oe.CONTROL)return this.autoMove(-1,!1),this.interactionEnd(V),!1;switch(t){case k:this.adjustSpeed(1),i=!0;break;case F:this.adjustSpeed(-1),i=!0;break;case N:this.adjustSpeed(0),i=!0;break;case L:this.autoMove(0,!0),i=!0;break;case R:this.autoMove(1,!0),i=!0;break;case P:this.autoMove(2,!0),i=!0;break;case D:this.autoMove(3,!0),i=!0;break;case I:this.autoMove(4,!0),i=!0;break;case O:this.autoMove(5,!0),i=!0;break;default:return!1}return this.isDragging||this.interactionStart(V),i},this.handleKeyUp=function(e,t){this.updateModifierState(e);var i=!1;if(u&&oe.CONTROL)return this.autoMove(-1,!1),this.interactionEnd(V),!1;switch(t){case L:this.autoMove(0,!1),i=!0;break;case R:this.autoMove(1,!1),i=!0;break;case P:this.autoMove(2,!1),i=!0;break;case D:this.autoMove(3,!1),i=!0;break;case I:this.autoMove(4,!1),i=!0;break;case O:this.autoMove(5,!1),i=!0;break;default:return!1}return i&&(this.interactionEnd(V),C||this.interactionCheck()),i},this.handleDollyPan=function(e){r=e.canvasX,s=e.canvasY;var t=p.getScreenViewport();j.x=r,j.y=s,G.x=j.x/t.width,G.y=j.y/t.height,E=function(e){var t=e.pointers[1].clientX-e.pointers[0].clientX,i=e.pointers[1].clientY-e.pointers[0].clientY;return Math.sqrt(t*t+i*i)}(e);var i,n,o=THREE.Math.degToRad(e.rotation);A=o-S,Math.abs(A)>1&&(A=0),S=o,i=e.type,n="start",-1!==i.indexOf(n,i.length-n.length)&&(_=E,1,A=0,S=o),x=e.scale},this.handleGesture=function(e){switch(e.type){case"dragstart":return b="drag",this.handleButtonDown(e,0);case"dragmove":return"drag"!==b&&(this.handleButtonDown(e,0),b="drag"),this.handleMouseMove(e);case"dragend":return"drag"===b&&(this.handleButtonUp(e,0),b=null,!0);case"panstart":return b="pan",this.handlePanStart(e),this.handleDollyPan(e),!0;case"panmove":return"pan"!==b&&(b="pan",this.handlePanStart(e)),this.handleDollyPan(e);case"panend":return"pan"===b&&(this.isDragging=!1,this.handleDollyPan(e),this.interactionEnd(3),!0);case"pinchstart":return this.setPivotPointFromInput(e.center.x,e.center.y),this.isDragging=!0,b="pinch",z.x=.5*(e.normalizedX+1),z.y=1-.5*(e.normalizedY+1),H.set(e.canvasX,e.canvasY),W.set(e.canvasX,e.canvasY),M=!1,this.interactionStart(3),this.handleDollyPan(e),!0;case"pinchmove":return"pinch"===b&&this.handleDollyPan(e);case"pinchend":return"pinch"===b&&(this.isDragging=!1,this.handleDollyPan(e),this.interactionEnd(3),!0)}return!1},this.handleButtonDown=function(e,t){return this.updateModifierState(e),z.x=.5*(e.normalizedX+1),z.y=1-.5*(e.normalizedY+1),W.set(e.canvasX,e.canvasY),G.copy(z),j.copy(W),Y.copy(pe(e.canvasX,e.canvasY)),K.copy(Y),r=e.canvasX,s=e.canvasY,this.isDragging=!0,this.interactionStart(t),!0},this.handlePanStart=function(e){return this.isDragging=!0,z.x=.5*(e.normalizedX+1),z.y=1-.5*(e.normalizedY+1),H.set(e.canvasX,e.canvasY),W.set(e.canvasX,e.canvasY),this.interactionStart(3),!0},this.handleButtonUp=function(e,t){return this.updateModifierState(e),G.x=.5*(e.normalizedX+1),G.y=1-.5*(e.normalizedY+1),j.set(e.canvasX,e.canvasY),K.copy(pe(e.canvasX,e.canvasY)),Y.copy(K),r=e.canvasX,s=e.canvasY,this.interactionEnd(t),this.isDragging=!1,!0},this.handleMouseMove=function(t){return this.updateModifierState(t),this.isDragging?(G.x=.5*(t.normalizedX+1),G.y=1-.5*(t.normalizedY+1),j.set(t.canvasX,t.canvasY),K.copy(pe(t.canvasX,t.canvasY)),r=t.canvasX,s=t.canvasY,!0):(z.x=.5*(t.normalizedX+1),z.y=1-.5*(t.normalizedY+1),W.set(t.canvasX,t.canvasY),G.x=z.x,G.y=z.y,j.copy(W),r=t.canvasX,s=t.canvasY,t.target===e.canvas&&e.rolloverObject(r,s),!1)},this.handleBlur=e=>{this.resetKeys(),this.interactionEnd(B)},this._onPrefCursor=function(e){w=e}.bind(this)}r.GlobalManagerMixin.call(s.prototype)},25590:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SelectionType:()=>n});var n={MIXED:1,REGULAR:2,OVERLAYED:3}},31255:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MultiModelSelector:()=>h,Selector:()=>c});var n=i(4123),r=i(25590),o=i(82079),s=i(49720),a=i(33423),l=i(41434);function c(e,t){var i=this;this.selectedObjectIds={},this.selectionCount=0,this.selectionMode=n.SelectionMode.LEAF_OBJECT,this.lockedNodes=[];var a={};function c(){return t.getData().instanceTree}function h(i){var n=c();if(a[i]>0)a[i]--,0==a[i]&&e.highlightObjectNode(t,i,!1);else if(a[i]<0)throw"Selection State machine broken. Negatively selected object!";n&&n.enumNodeChildren(i,(function(e){h(e)}),!1)}function u(i,n,o){var s=c();if(a[i])a[i]++;else{switch(o){default:case r.SelectionType.MIXED:e.highlightObjectNode(t,i,!0,n);break;case r.SelectionType.REGULAR:e.highlightObjectNode(t,i,!0,!0);break;case r.SelectionType.OVERLAYED:e.highlightObjectNode(t,i,!0,!1)}a[i]=1}s&&s.enumNodeChildren(i,(function(e){u(e,!0,o)}),!1)}function d(e){if(void 0!==e&&i.selectedObjectIds[e])return!0}function p(n,o){if(!i.isNodeSelectionLocked(n)){var s=c();if(o=o||r.SelectionType.MIXED,s){const r=function(){var n,r;const o="ifc"===(null===(n=t.getData())||void 0===n||null===(r=n.loadOptions)||void 0===r?void 0:r.fileExt),s=void 0!==e.api.prefs.getPrefFromLocalStorage(Autodesk.Viewing.Private.Prefs3D.SELECTION_MODE);return o&&!s?Autodesk.Viewing.SelectionMode.FIRST_OBJECT:i.selectionMode}();if(n=s.findNodeForSelection(n,r),!s.isNodeSelectable(n))return}d(n)||(i.selectedObjectIds[n]=o,i.selectionCount++,u(n,!1,o))}}function f(e){d(e)&&(h(e),i.selectedObjectIds[e]=0,i.selectionCount--)}this.getInstanceTree=c,this.hasSelection=function(){return i.selectionCount>0},this.getSelectionLength=function(){return i.selectionCount},this.getSelection=function(){var e=[],t=i.selectedObjectIds;for(var n in t)if(t[n]){var r=parseInt(n);e.push(r)}return e},this.isSelected=function(e){return d(e)},this.clearNodeSelection=function(e){return void 0!==e&&0!==this.selectionCount&&(h(e),delete i.selectedObjectIds[e],!0)},this.clearSelection=function(e){if(this.selectionCount>0){var t=i.selectedObjectIds;for(var n in t){var r=parseInt(n);void 0!==r&&h(r)}return i.selectedObjectIds={},i.selectionCount=0,!0}},this.deselectInvisible=function(){var n=!1,r=i.selectedObjectIds,o=e.visibilityManager;for(var s in r){var a=parseInt(s);a&&!o.isNodeVisible(t,a)&&(f(a),n=!0)}return n},this.toggleSelection=function(e,i){e||t.isLeaflet()?d(e)?f(e):p(e,i):s.logger.error("Attempting to select node 0.",(0,o.errorCodeString)(o.ErrorCodes.VIEWER_INTERNAL_ERROR))},this.setSelectionMode=function(e){this.clearSelection(!0),this.selectionMode=e},this.isNodeSelectionLocked=function(e){if(-1===e)return!1;var t=c();return t?t.isNodeSelectionLocked(e):-1!==i.lockedNodes.indexOf(e)},this.lockSelection=function(e,t){var n=c();function r(e,t){if(e&&-1!==e)if(t)-1===i.lockedNodes.indexOf(e)&&(i.lockedNodes.push(e),i.clearNodeSelection(e));else{const t=i.lockedNodes.indexOf(e);i.lockedNodes.splice(t,1)}}e=Array.isArray(e)?e:[e],n?e.forEach((function(e){n.enumNodeChildren(e,(function(e){n.lockNodeSelection(e,!1),r(e,t),t&&n.lockNodeSelection(e,t)}),!0)})):e.forEach((e=>{r(e,t)}))},this.setSelection=function(e,t){if(!function(e){if(i.selectionCount!==e.length)return!1;for(var t=0;t<e.length;t++)if(!d(e[t]))return!1;return!0}(e)&&(this.clearSelection(!0),null!=e&&0!==e.length))for(var n=0;n<e.length;n++)p(e[n],t)},this.getSelectionBounds=function(){var e=new l.Box3,n=new l.Box3,r=c();if(r){var o=t.getFragmentList(),s=i.selectedObjectIds;for(var a in s){var h=parseInt(a);r.enumNodeFragments(h,(function(t){o.getWorldBounds(t,n),e.union(n)}),!0)}}return e},this.getSelectionVisibility=function(){var e=!1,n=!1,r=i.selectedObjectIds;for(var o in r){var s=parseInt(o);if(s){var a=c();if(a&&a.isNodeHidden(s)?n=!0:e=!0,e&&n)break}}return{hasVisible:e,hasHidden:n,model:t}},this.update2DSelectionHighlighting=function(){if(i._2DSelectionHighlightingUpdated)return;if(!t.isLoadDone())return;var n=t.getPropertyDb();if(n&&!n.isLoadDone())return;if(!e.overlayScenes[e.selection2dOverlayName(t)])return;for(var r=i.getSelection(),o=0;o<r.length;o++){h(a=r[o])}const s={};Object.keys(i.selectedObjectIds).forEach((e=>{s[t.remapDbId(e)]=i.selectedObjectIds[e]})),i.selectedObjectIds=s;for(o=0;o<r.length;o++){var a;u(a=r[o],!1,i.selectedObjectIds[a])}i._2DSelectionHighlightingUpdated=!0},this.dtor=function(){this.selectedObjectIds=null}}function h(e){var t=[];function i(){t.length>1&&s.logger.warn("This selection call does not yet support multiple models.")}function n(i){for(var n,r=[],o=0;o<t.length;o++){var s=[],l=[],c=t[o].selector.selectedObjectIds,h=t[o].selector.getInstanceTree();for(var u in c)if(c[u]){var d=parseInt(u);d&&(s.push(d),h&&h.enumNodeFragments(d,(function(e){l.push(e)}),!1))}s.length&&r.push({fragIdsArray:l,dbIdArray:s,nodeArray:s,model:t[o]})}1===t.length&&(n={type:a.SELECTION_CHANGED_EVENT,fragIdsArray:r[0]?r[0].fragIdsArray:[],dbIdArray:r[0]?r[0].dbIdArray:[],nodeArray:r[0]?r[0].dbIdArray:[],model:t[0],mouseButton:i},e.api.dispatchEvent(n)),n={type:a.AGGREGATE_SELECTION_CHANGED_EVENT,selections:r,mouseButton:i},e.api.dispatchEvent(n)}function r(){for(var e=!1,i=0;i<t.length;i++)e=t[i].selector.deselectInvisible()||e;e&&n()}function o(e){e.model.is2d()&&e.model.selector&&e.model.selector.update2DSelectionHighlighting()}this.highlightDisabled=!1,this.highlightPaused=!1,this.selectionDisabled=!1,this.addModel=function(i){-1==t.indexOf(i)&&(i.selector=new c(e,i),t.push(i))},this.removeModel=function(e){var i=t.indexOf(e);e.selector.getSelection();e.selector.clearSelection(),e.selector=null,t.splice(i,1)},this.hasSelection=function(){for(var e=0;e<t.length;e++)if(t[e].selector.hasSelection())return!0;return!1},this.getSelectionLength=function(){for(var e=0,i=0;i<t.length;i++)e+=t[i].selector.getSelectionLength();return e},this.getSelection=function(){return i(),t.length>1&&s.logger.warn("Use getAggregateSelection instead of getSelection when there are multiple models in the scene."),t[0]?t[0].selector.getSelection():[]},this.getAggregateSelection=function(){for(var e=[],i=0;i<t.length;i++){var n=t[i].selector.getSelection();n&&n.length&&e.push({model:t[i],selection:n})}return e},this.clearSelection=function(e){let i;for(var r=0;r<t.length;r++)t[r].selector.clearSelection(e)&&(i=!0);!e&&i&&n()},this.toggleSelection=function(e,r,o){this.selectionDisabled||(r||(i(),r=t[0]),r.selector.toggleSelection(e,o),n())},this.setSelectionMode=function(e){for(var i=0;i<t.length;i++)t[i].selector.setSelectionMode(e)},this.isNodeSelectionLocked=function(e,n){return n||(i(),n=t[0]),n&&n.selector.isNodeSelectionLocked(e)},this.lockSelection=function(e,n,r){r||(i(),r=t[0]),r&&r.selector.lockSelection(e,n)},this.unlockSelection=function(e,n){e||n?(n||(i(),n=t[0]),e=e||n.selector.lockedNodes.slice(),this.lockSelection(e,!1,n)):t.forEach((e=>{const t=e.selector.lockedNodes.slice();this.lockSelection(t,!1,e)}))},this.setSelection=function(e,r,o,s){if(!this.selectionDisabled){if(e&&0!==e.length){if(r)for(var a=0;a<t.length;a++)t[a]!==r&&t[a].selector.clearSelection();else i(),r=t[0];r.selector.setSelection(e,o)}else this.clearSelection(!0);n(s)}},this.setAggregateSelection=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.selectionDisabled){if(e&&0!==e.length)for(var i=0;i<e.length;++i){var r=e[i].model,o=e[i].ids,s=e[i].selectionType;r.selector.setSelection(o,s)}else this.clearSelection(!0);t&&n()}},this.getSelectionBounds=function(){if(1==t.length)return t[0].selector.getSelectionBounds();for(var e=new l.Box3,i=0;i<t.length;i++){var n=t[i].selector.getSelectionBounds();e.union(n)}return e},this.getSelectionVisibility=function(){for(var e={hasVisible:!1,hasHidden:!1,details:[]},i=0;i<t.length;i++){var n=t[i].selector.getSelectionVisibility();e.hasVisible=e.hasVisible||n.hasVisible,e.hasHidden=e.hasHidden||n.hasHidden,e.details.push(n)}return e},this.dtor=function(){for(var e=0;e<t.length;e++)t[e].selector.dtor()},e.api.addEventListener(a.ISOLATE_EVENT,(function(e){r()})),e.api.addEventListener(a.HIDE_EVENT,(function(e){r()})),e.api.addEventListener(a.GEOMETRY_LOADED_EVENT,o),e.api.addEventListener(a.OBJECT_TREE_CREATED_EVENT,o),e.api.addEventListener(a.OBJECT_TREE_UNAVAILABLE_EVENT,o)}},42502:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ToolController:()=>l});var n=i(16840),r=i(49720),o=i(33423),s=i(89853),a=i(27293);function l(e,t,i,a,c){this.setGlobalManager(t.globalManager),this.domElement=t.canvasWrap,this.selector=e.selector,this.autocam=i,this.lastClickX=-1,this.lastClickY=-1,this.scrollInputEnabled=!0,this.keyMapCmd=!0,this.propagateInputEventTypes=[];var h=-1!==navigator.userAgent.search("Mac OS"),u=-1!==navigator.userAgent.search("Firefox"),d=-1!==navigator.userAgent.search("Chrome"),p=-1!==navigator.userAgent.search("Safari")&&!d,f={},m={},g={},v=[],y=!1,b=-1,x=-1,_=!1,E=null,A=!1,S={},w=this;function M(e){return e.getPriority instanceof Function&&e.getPriority()||0}function T(e,i){return t.navigation.getUseLeftHandedInput()&&0===e||u&&1===e||h&&!p&&0===e&&i.ctrlKey}this.__registerToolByName=function(e,t){f[t]=e},this.registerTool=function(e,t){var i=e.getNames();if(!i||0===i.length)return r.logger.warn("Cannot register tool with no name."),!1;for(var n=!1,o=0;o<i.length;++o)if("default"!==i[o]){this.__registerToolByName(e,i[o]);const r=t=>{const i=e.getName();t?this.activateTool(i):this.deactivateTool(i)};g[i[o]]=t&&t instanceof Function?t:r,n=!0}return e.utilities=a,e.controller=this,e.register&&e.register(),n},this.deregisterTool=function(e){this.deactivateTool(e.getName());var t=e.getNames();if(!t||0===t.length)return!1;for(var i=t.length;--i>=0;)this.__deregisterToolName(t[i]);return e.deregister&&e.deregister(),e.utilities=null,e.controller=null,!0},this.__deregisterToolName=function(e){e in f&&(!function(e){for(var t=v.length;--t>=0;)v[t].activeName===e&&(f[e].deactivate(e),v.splice(t,1))}(e),delete f[e])},this.getTool=function(e){return f[e]},this.getActiveToolName=function(){var e=v.length;return e>0?v[e-1].activeName:"default"},this.getActiveTool=function(){var e=v.length;return e>0?v[e-1]:f.default},this.getActiveTools=function(){return v.slice()},this.isToolActivated=function(e){for(var t=0;t<v.length;t++)if(v[t].activeName===e)return!0;return!1},this.setToolActiveName=function(e){var t=f[e];t&&(t.activeName=e)},this.rearrangeByPriorities=function(){v.sort((function(e,t){return M(e)-M(t)}))},this.activateToolModality=function(e){const t=this.getToolModality(e);for(let e in t){const i=t[e],n=g[e];i!==this.isToolActivated(e)&&n&&n(i,e)}},this.activateTool=function(e){if(y)return!1;var i=f[e];if(this.activateToolModality(e),i){void 0===i.count&&(i.count=0);var n=null;v.length&&"intercept"===v[v.length-1].activeName&&(n=v.pop());for(var s=0,a=0;a<v.length;a++)v[a]===i&&i.count++,M(v[a])<=M(i)&&(s=a+1);return i.activeName=e,0===i.count&&(i.count++,v.splice(s,0,i)),i.activate(e,t),n&&v.push(n),t.dispatchEvent({type:o.TOOL_CHANGE_EVENT,toolName:e,tool:i,active:!0}),!0}return r.logger.warn("activateTool not found: "+e),!1},this.deactivateTool=function(e){if(y)return!1;for(var i=v.length;--i>=0;)if(v[i].activeName===e){const n=f[e];return 1===n.count&&v.splice(i,1),n.count--,n.deactivate(e),t.dispatchEvent({type:o.TOOL_CHANGE_EVENT,toolName:e,tool:n,active:!1}),!0}return r.logger.warn("deactivateTool not found: "+e),!1},this.getToolNames=function(){return Object.keys(f)},this.setDefaultTool=function(e){var t=this.getDefaultTool();return!(!e||e===t)&&(this.__registerToolByName(e,"default"),t&&t.deactivate("default"),e.activate("default"),!0)},this.getDefaultTool=function(){return f.default},this.setDefaultTool(c),this.setIsLocked=function(e){var t=y;return y=!!e,t},this.getIsLocked=function(){return y},this.__checkCursor=function(){for(var e=null,i=v.length;--i>=0;){var n=v[i];if(n.getCursor&&(e=n.getCursor()))break}e||(e="auto"),E!=e&&(t.canvas.style.cursor=e,E=e)},this.update=function(e){this.__checkCursor();var i=!1;a&&a.update()&&(i=!0);for(var n=v.length;--n>=0;){var r=v[n];r.update&&r.update(e)&&(i=!0)}if(t.navigation.getCamera().dirty?(t.navigation.updateCamera(),i=!0,this.cameraUpdated=!0):this.cameraUpdated=!1,i)t.navigation.updateCamera(),this.moveDelay=Date.now()+150;else if(0!==this.moveDelay){this.moveDelay-Date.now()>0?i=!0:this.moveDelay=0}return i},this.__clientToCanvasCoords=function(t,i,n){var r=e.getCanvasBoundingClientRect(),o=r.width,s=r.height,a=t.clientX-r.left,l=t.clientY-r.top;t.canvasX=a,t.canvasY=l,t.normalizedX=a/o*2-1,t.normalizedY=(s-l)/s*2-1,i&&i.set(a/o,l/s,0),n&&n.set(a,l)},this.__invokeStack=function(e,t,i){for(var n=v.length;--n>=0;){var r=v[n];if(r&&r[e]&&r[e](t,i))return!0}var o=this.getDefaultTool();return!(!o[e]||!o[e](t,i))},this.distributeEvent=function(e,t,i){return this.__invokeStack(e,t,i)},this.handleResize=function(){t.navigation.setScreenViewport(t.container.getBoundingClientRect());for(var e=v.length;--e>=0;){var i=v[e];i.handleResize&&i.handleResize()}},this.handleSingleClick=function(e){var t=this.applyButtonMappings(e);this.lastClickX=e.clientX,this.lastClickY=e.clientY,this.__invokeStack("handleSingleClick",e,t)&&this.__onEventHandled(e)},this.handleDoubleClick=function(e){var t=this.applyButtonMappings(e);this.__invokeStack("handleDoubleClick",e,t)&&this.__onEventHandled(e)},this.handleSingleTap=function(e){this.lastClickX=e.canvasX,this.lastClickY=e.canvasY,this.__invokeStack("handleSingleTap",e)&&this.__onEventHandled(e)},this.handleDoubleTap=function(e){this.lastClickX=e.canvasX,this.lastClickY=e.canvasY,this.__invokeStack("handleDoubleTap",e)&&this.__onEventHandled(e)},this.handleWheelInput=function(e,t){this.__invokeStack("handleWheelInput",e,t)&&this.__onEventHandled(t)},this.applyButtonMappings=function(e){var i=e.button;return"buttons"in e&&(e.firefoxSpoof?i=0:!_||1&e.buttons?2===i&&1&e.buttons&&(i=0,e.firefoxSpoof=_=!0):(e.firefoxSpoof=!0,_=!1,i=0)),t.navigation.getUseLeftHandedInput()&&(i=0===i?2:2===i?0:i),i},this.applyKeyMappings=function(e){switch(e.keyCode){case s.KeyCode.EQUALSMOZ:return s.KeyCode.EQUALS;case s.KeyCode.DASHMOZNEW:case s.KeyCode.DASHMOZ:return s.KeyCode.DASH}return e.keyCode},this.handleKeyDown=function(e){let t;!this.keyMapCmd||!h||"MetaLeft"!=e.code&&"MetaRight"!=e.code?(t=this.applyKeyMappings(e),t&&this.__invokeStack("handleKeyDown",e,t)&&this.__onEventHandled(e)):this.handleCmdKeyEvent(e,"keydown")},this.handleKeyUp=function(e){let t;!this.keyMapCmd||!h||"MetaLeft"!=e.code&&"MetaRight"!=e.code?(t=this.applyKeyMappings(e),t&&this.__invokeStack("handleKeyUp",e,t)&&this.__onEventHandled(e)):this.handleCmdKeyEvent(e,"keyup")},this.handleCmdKeyEvent=function(e,t){this.__onEventHandled(e);var i=new KeyboardEvent(t,{key:"Control",code:"MetaLeft"==e.code?"ControlLeft":"ControlRight",location:e.location,ctrlKey:!0,metaKey:!1,repeat:e.repeat,isComposing:e.isComposing,charCode:0,keyCode:17,which:17});window.dispatchEvent(i)},this.handleButtonDown=function(e,t){this.__invokeStack("handleButtonDown",e,t)&&this.__onEventHandled(e)},this.handleButtonUp=function(e,t){this.__invokeStack("handleButtonUp",e,t)&&this.__onEventHandled(e)},this.handleMouseMove=function(e){this.__invokeStack("handleMouseMove",e)&&this.__onEventHandled(e)},this.handleBlur=function(e){this.__invokeStack("handleBlur",e)&&this.__onEventHandled(e)},this.keydown=function(e){if(!l._lastTouchedElement||w.domElement.contains(l._lastTouchedElement)){var t=w.getDocument();if(!(t.activeElement instanceof HTMLInputElement||t.activeElement instanceof HTMLTextAreaElement||t.activeElement instanceof HTMLSelectElement)){if(t.activeElement){var i=t.activeElement.getAttribute("contenteditable");if("true"===i||""===i)return}w.handleKeyDown(e)}}},this.keyup=function(e){w.handleKeyUp(e)},this.mousedown=function(e){var t=w.getDocument();n.isIE11&&(0,n.inFullscreen)(t)||t.activeElement&&t.activeElement.blur&&t.activeElement.blur(),w.__clientToCanvasCoords(e);var i=w.applyButtonMappings(e);if(w.handleButtonDown(e,i),b=e.canvasX,x=e.canvasY,T(i,e)){var r=S,o=void 0!==r.time&&e.timeStamp-r.time<500,s=void 0!==r.x&&void 0!==r.y&&Math.abs(r.x-e.canvasX)<=2&&Math.abs(r.y-e.canvasY)<=2;(!o||!s||r.clickCount&&2<=r.clickCount)&&(r.clickCount=0),r.clickCount?1===r.clickCount&&(r.clickCount=2):(r.clickCount=1,r.x=e.canvasX,r.y=e.canvasY,r.time=e.timeStamp)}w.addDocumentEventListener("mouseup",(function e(t){w.applyButtonMappings(t)===i&&(w.removeDocumentEventListener("mouseup",e),w.mouseup(t))}),!1),w.registerWindowMouseMove()},this.mousemove=function(e){w.__clientToCanvasCoords(e);var t=b-e.canvasX,i=x-e.canvasY;(Math.abs(t)>2||Math.abs(i)>2)&&(b=-1,x=-1),w.handleMouseMove(e)},this.mouseup=function(e){w.__clientToCanvasCoords(e);var t=w.applyButtonMappings(e);w.handleButtonUp(e,t);var i=b-e.canvasX,n=x-e.canvasY;if(b=-1,x=-1,Math.abs(i)<=2&&Math.abs(n)<=2&&w.handleSingleClick(e),T(t,e)){var r=S;2===r.clickCount&&(w.handleDoubleClick(e),r.clickCount=0,r.x=void 0,r.y=void 0,r.time=void 0)}w.unregisterWindowMouseMove()},this.doubleclick=function(e){w.__clientToCanvasCoords(e),b=e.canvasX,x=e.canvasY,w.handleDoubleClick(e)},this.mousewheel=function(e){if(w.scrollInputEnabled){w.__clientToCanvasCoords(e);var t=0;if(e.wheelDelta)t=e.wheelDelta/40;else if(e.detail)t=-e.detail;else if(e.deltaY){var i=u?1:40;t=-e.deltaY/i}w.handleWheelInput(t,e)}},this.blur=function(e){w.handleBlur(e)},this.mouseover=function(e){l._lastTouchedElement=e.target},this.registerWindowMouseMove=function(){w.addWindowEventListener("mousemove",w.mousemove),w.addWindowEventListener("mouseover",w.mouseover),w.domElement.removeEventListener("mousemove",w.mousemove),w.domElement.removeEventListener("mouseover",w.mouseover)},this.unregisterWindowMouseMove=function(){w.removeWindowEventListener("mousemove",w.mousemove),w.removeWindowEventListener("mouseover",w.mouseover),w.domElement.addEventListener("mousemove",w.mousemove),w.domElement.addEventListener("mouseover",w.mouseover)},this.enableMouseButtons=function(e){e&&!A?(this.domElement.addEventListener("mousedown",this.mousedown),this.domElement.addEventListener("dblclick",this.doubleclick),this.domElement.addEventListener("mousemove",this.mousemove),this.domElement.addEventListener("mouseover",this.mouseover)):!e&&A&&(this.domElement.removeEventListener("mousedown",this.mousedown),this.domElement.removeEventListener("dblclick",this.doubleclick),this.domElement.removeEventListener("mousemove",this.mousemove),this.domElement.removeEventListener("mouseover",this.mouseover));var t=A;return A=e,t},this.domElement.addEventListener("mousewheel",this.mousewheel,!1),this.domElement.addEventListener("DOMMouseScroll",this.mousewheel,!1),w.addWindowEventListener("keydown",this.keydown,!1),w.addWindowEventListener("keyup",this.keyup,!1),w.addWindowEventListener("blur",this.blur,!1),this.uninitialize=function(){for(this.domElement.removeEventListener("mousemove",this.mousemove),this.domElement.removeEventListener("mouseover",this.mouseover),this.removeWindowEventListener("mousemove",this.mousemove),this.removeWindowEventListener("mouseover",this.mouseover),this.removeWindowEventListener("keydown",this.keydown),this.removeWindowEventListener("keyup",this.keyup),this.removeWindowEventListener("blur",this.blur),this.domElement=null,this.selector=null,this.autocam=null,y=!1;v.length>0;)this.deactivateTool(v[v.length-1].activeName);f=null,v=null,w=null,a=null,t=null,e=null,l._lastTouchedElement=null},this.set2DMode=function(){},this.setAutocam=function(){},this.syncCamera=function(){},this.recordHomeView=function(){var e=t.navigation.getCamera();i.sync(e),i.setHomeViewFrom(e)},this.setMouseWheelInputEnabled=function(e){this.scrollInputEnabled=e},this.setModalityMap=function(e){m={};for(let t in e)this.setToolModality(t,e[t])},this.getModalityMap=function(){return Object.assign({},m)},this.getToolModality=function(e){return m[e]},this.setToolModality=function(e,t){e?t?m[e]=t:r.logger.warn("Cannot add tool modality. Missing tool map."):r.logger.warn("Cannot add tool modality. Missing tool name.")},this.__onEventHandled=function(e){this.propagateInputEventTypes.includes(e.type)||(e.preventDefault(),e.stopPropagation())}}Object.defineProperty(l,"_lastTouchedElement",{value:null,writable:!0}),a.GlobalManagerMixin.call(l.prototype)},79002:(e,t,i)=>{"use strict";function n(){this.names=["unnamed"],this.getNames=function(){return this.names},this.getName=function(){return this.names[0]},this.getPriority=function(){return 0},this.register=function(){},this.deregister=function(){},this.activate=function(e,t){},this.deactivate=function(e){},this.update=function(e){return!1},this.handleSingleClick=function(e,t){return!1},this.handleDoubleClick=function(e,t){return!1},this.handleSingleTap=function(e){return!1},this.handleDoubleTap=function(e){return!1},this.handleKeyDown=function(e,t){return!1},this.handleKeyUp=function(e,t){return!1},this.handleWheelInput=function(e){return!1},this.handleButtonDown=function(e,t){return!1},this.handleButtonUp=function(e,t){return!1},this.handleMouseMove=function(e){return!1},this.handleGesture=function(e){return!1},this.handleBlur=function(e){return!1},this.handleResize=function(){}}i.r(t),i.d(t,{ToolInterface:()=>n})},44822:(e,t,i)=>{"use strict";i.r(t),i.d(t,{UnifiedCamera:()=>o});var n=i(41434),r=i(49720);class o extends n.Camera{constructor(e,t){super(),this.fov=45,this.near=.1,this.far=1e5,this.aspect=e/t,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2,this.clientWidth=e,this.clientHeight=t,this.target=new n.Vector3(0,0,-1),this.worldup=new n.Vector3(0,1,0),this.viewInverseEnv=new n.Matrix4,this.projScreenMatrix=new n.Matrix4,this.orthographicCamera=new n.OrthographicCamera(this.left,this.right,this.top,this.bottom,this.near,this.far),this.perspectiveCamera=new n.PerspectiveCamera(this.fov,this.aspect,this.near,this.far),this.zoom=1,this.disableXr=!1,this.globalOffset=new n.Vector3,this.toPerspective()}clone(e){return e=e||new o(2*this.right,2*this.top),n.Camera.prototype.clone.call(this,e),e.position.copy(this.position),e.up.copy(this.up),this.target&&(e.target=this.target.clone()),this.worldup&&(e.worldup=this.worldup.clone()),this.worldUpTransform&&(e.worldUpTransform=this.worldUpTransform.clone()),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e.fov=this.fov,e.aspect=this.aspect,e.zoom=this.zoom,e.clientWidth=this.clientWidth,e.clientHeight=this.clientHeight,e.isPerspective=this.isPerspective,e.globalOffset=this.globalOffset.clone(),e.orthoScale=this.orthoScale,this.updateProjectionMatrix(),e}__computeFovPosition(e){if(Math.abs(this.fov-e)<=1e-4)return this.position.clone();var t,i,r=this.target.clone().sub(this.position),o=r.clone().normalize(),s=n.Math.degToRad(this.fov),a=n.Math.degToRad(e),l=Math.tan(.5*s)/Math.tan(.5*a);this.pivot?(t=(new n.Plane).setFromNormalAndCoplanarPoint(o.clone().negate(),this.pivot).distanceToPoint(this.position),i=o.clone().multiplyScalar(t).add(this.position)):(t=r.length(),i=this.target);t*=l;var c=o.multiplyScalar(-t);return i.clone().add(c)}toPerspective(){!this.isPerspective&&this.saveFov&&(this.position.copy(this.__computeFovPosition(this.saveFov)),this.fov=this.saveFov),this.perspectiveCamera.aspect=this.aspect,this.perspectiveCamera.near=this.near,this.perspectiveCamera.far=this.far,this.perspectiveCamera.fov=this.fov/this.zoom,this.perspectiveCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspectiveCamera.projectionMatrix,this.isPerspective=!0}toOrthographic(){if(this.isPerspective){this.saveFov=this.fov;var e=o.ORTHO_FOV;this.position.copy(this.__computeFovPosition(e)),this.fov=e}this.orthoScale=this.target.clone().sub(this.position).length();var t=.5*this.orthoScale,i=t*this.aspect;this.left=this.orthographicCamera.left=-i,this.right=this.orthographicCamera.right=i,this.top=this.orthographicCamera.top=t,this.bottom=this.orthographicCamera.bottom=-t,this.orthographicCamera.near=this.near,this.orthographicCamera.far=this.far,this.orthographicCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthographicCamera.projectionMatrix,this.isPerspective=!1}updateProjectionMatrix(){this.isPerspective?this.toPerspective():this.toOrthographic()}setSize(e,t){this.aspect=e/t,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2}setFov(e){this.fov=e,this.updateProjectionMatrix()}setLens(e,t){void 0===t&&(t=24);var i=2*n.Math.radToDeg(Math.atan(t/(2*e)));return this.setFov(i),i}setViewFromBox(e,t){o.getViewParamsFromBox(e,t,this.aspect,this.up,this.fov,this),this.updateCameraMatrices()}updateCameraMatrices(){this.lookAt(this.target),this.updateProjectionMatrix(),this.updateMatrixWorld()}setView(e){e.position&&this.position.copy(e.position),e.target&&this.target.copy(e.target),e.up&&this.up.copy(e.up),void 0!==e.isPerspective&&(this.isPerspective=e.isPerspective),void 0!==e.orthoScale&&(this.orthoScale=e.orthoScale),this.updateCameraMatrices()}pixelsPerUnitAtDistance(e){if(!this.isPerspective)return this.clientHeight/this.orthoScale;const t=2*e*Math.tan(n.Math.degToRad(.5*this.fov));return this.clientHeight/t}UnifpixelsPerUnitAtPoint(e){const t=this.position.distanceTo(e);return this.pixelsPerUnitAtDistance(t)}setGlobalOffset(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i;(e!==this.position&&e!==this.target&&e!==this.pivot||(e=e.clone()),t)&&(this.position.add(this.globalOffset).sub(e),this.target.add(this.globalOffset).sub(e),null===(i=this.pivot)||void 0===i||i.add(this.globalOffset).sub(e));this.globalOffset.copy(e)}getGlobalPosition(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new n.Vector3).copy(this.position).add(this.globalOffset)}viewportToRay(e,t){e.z=-1;var i=new n.Vector3(e.x,e.y,1);return e=e.unproject(this),(i=i.unproject(this)).sub(e).normalize(),t||(t=new n.Ray),t.set(this.isPerspective?this.position:e,i),t}transformCurrentView(e){o.transformViewParams(this,e)}}o.ORTHO_FOV=2*Math.atan(.5)*180/Math.PI,o.getViewParamsFromBox=function(e,t,i,r,o,s){var a=s||{},l=e.getSize(new n.Vector3);if(a.target=e.getCenter(new n.Vector3),a.position||(a.position=new n.Vector3),a.up||(a.up=new n.Vector3),t){a.isPerspective=!1;var c=l.x/l.y,h=i;a.orthoScale=h>c?l.y:l.x/h,a.up.set(0,1,0),a.position.copy(a.target),a.position.z+=a.orthoScale,a.target.y+=1e-6*l.y}else a.isPerspective=!0,a.fov=o,a.up.copy(r),a.position.copy(a.target),a.position.z+=1.5*Math.max(l.x,l.y,l.z);return a},o.copyViewParams=function(e,t){return(t=t||{}).position=(t.position||new n.Vector3).copy(e.position),t.target=(t.target||new n.Vector3).copy(e.target),t.up=(t.up||new n.Vector3).copy(e.up),t.aspect=e.aspect,t.fov=e.fov,t.isPerspective=e.isPerspective,t.orthoScale=e.orthoScale,t},o.transformViewParams=function(e,t){var i;e.position.applyMatrix4(t),e.target.applyMatrix4(t),null===(i=e.pivot)||void 0===i||i.applyMatrix4(t),e.up.transformDirection(t)},o.adjustOrthoCamera=function(e,t){if(!e.isPerspective){var i=t.getSize(new n.Vector3),o=e.target.clone().sub(e.position),s=o.length();if(s>1e3*i.length()&&!t.isEmpty()){var a=e.position.distanceTo(t.getCenter(new n.Vector3));e.target.copy(e.position).add(o.normalize().multiplyScalar(a))}else{if(Math.abs(s-e.orthoScale)/s>1e-5)r.logger.warn("Ortho scale does not match eye-target distance. One of them is likely wrong, but which one?"),!(0===e.fov&&1===e.orthoScale)&&e.position.copy(e.target).add(o.normalize().multiplyScalar(-e.orthoScale))}}},o.prototype.isUnifiedCamera=!0},82877:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ViewingUtilities:()=>r});var n=i(41434);function r(e,t,i){this.autocam=t,this.viewerImpl=e,this.setGlobalManager(this.viewerImpl.globalManager);var r=i.getCamera(),o={},s={};var a=new function(e){var t=.6,i=0,r=new n.SphereGeometry(1),o=new n.MeshPhongMaterial({color:32512,opacity:t,transparent:!0}),s=new n.Mesh(r,o),a=e,l=1;a.createOverlayScene("pivot"),s.visible=!1,this.shown=function(){return s.visible},this.show=function(e,n,r){s.scale.x=n*l,s.scale.y=n*l,s.scale.z=n*l,s.position.set(e.x,e.y,e.z),o.opacity=t,s.visible=!0,a.addOverlay("pivot",s),a.invalidate(!1,!1,!0),i=r?Date.now()+500:0},this.hide=function(){s.visible&&(s.visible=!1,a.removeOverlay("pivot",s),a.invalidate(!1,!1,!0),i=0)},this.fade=function(){if(i>0){var e=i-Date.now();if(e<=0)return this.hide(),!0;var n=e/500*t;return o.opacity=n,!0}return!1},this.fading=function(){return i>0},this.setSize=function(e){l=e},this.setColor=function(e,i){o.color=new n.Color(e),void 0!==i&&(t=i,o.opacity=t)}}(this.viewerImpl);this.transitionView=function(e,n,o,s,a,l,c){a=a||i.getWorldUpVector();var h=l?function(e,t,i){var n=t.clone().sub(e);if(0===n.lengthSq())return n.copy(i);var r=n.clone().cross(i);return 0===r.lengthSq()&&(i.z>i.y?n.y-=1e-4:n.z-=1e-4,r.crossVectors(n,i)),r.cross(n).normalize()}(e,n,a):s;h||(h=r.up);var u={position:e,center:n,pivot:c=c||n,fov:o,up:h,worldUp:a,isOrtho:!1===r.isPerspective};t.goToView(u)},this.goHome=function(){this.viewerImpl.track({name:"navigation/home",aggregate:"count"}),t.goHome()},this.getHitPoint=function(e,t){var n=this.viewerImpl.hitTestViewport(i.screenToViewport(e,t),!1);return n?n.intersectPoint:null},this.activatePivot=function(e){if(this.viewerImpl.model&&!this.viewerImpl.model.is2d()){var t=r.isPerspective?i.getPivotPlaneDistance():i.getEyeVector().length(),o=i.getVerticalFov(),s=2*t*Math.tan(n.Math.degToRad(.5*o)),l=i.getScreenViewport(),c=this.getWindow().devicePixelRatio||1,h=5*s/(l.height*c);a.show(i.getPivotPoint(),h,e)}},this.pivotActive=function(e,t){t=t||!1,(e=e&&!i.getIs2D())||!a.shown()?e&&this.activatePivot(t):a.hide()},this.pivotUpdate=function(){a.shown()&&a.fade()&&this.viewerImpl.invalidate(!1,!1,!0)},this.setPivotPoint=function(e,t,n){i.setPivotPoint(e),t||i.setTarget(e),n&&i.setPivotSetFlag(!0),this.setTemporaryPivot(null),i.getIs2D()||a.shown()&&this.activatePivot(a.fading())},this.savePivot=function(e){e||(e="default"),o[e]=i.getPivotPoint(),s[e]=i.getPivotSetFlag()},this.restorePivot=function(e){if(e||(e="default"),o[e]){var t=s[e];this.setPivotPoint(o[e],!0,t),t||i.setPivotSetFlag(!1),delete o[e],delete s[e]}},this.setTemporaryPivot=function(e){if(e){var t=i.getPivotPoint(),n=i.getPivotSetFlag();this.setPivotPoint(e,!0,n),o.TEMP=t,s.TEMP=n}else delete o.TEMP,delete s.TEMP},this.removeTemporaryPivot=function(){this.restorePivot("TEMP")},this.setPivotSize=function(e){a.setSize(e)},this.setPivotColor=function(e,t){a.setColor(e,t)},this.getBoundingBox=function(e){return this.viewerImpl.getFitBounds(e)},this.fitToView=function(e){this.viewerImpl.track({name:"navigation/fit",aggregate:"count"}),this.viewerImpl.fitToView(this.viewerImpl.selector.getAggregateSelection(),e),this.activatePivot(!0)},this.update=function(){i.getRequestFitToView()&&!i.getTransitionActive()&&(i.setRequestFitToView(!1),this.fitToView()),i.getRequestHomeView()&&!i.getTransitionActive()&&(i.setRequestHomeView(!1),this.goHome());var e=i.getRequestTransition();return e&&!i.getTransitionActive()&&(i.setRequestTransition(!1),this.transitionView(e.position,e.coi,e.fov,e.up,e.worldUp,e.reorient,e.pivot)),!1}}i(27293).GlobalManagerMixin.call(r.prototype)},29156:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MultiModelVisibilityManager:()=>s,VisibilityManager:()=>o});var n=i(49720),r=i(33423);function o(e,t){this.viewerImpl=e,this.model=t,this.isolatedNodes=[],this.hiddenNodes=[]}function s(e){this.viewerImpl=e,this.models=[]}function a(e){var t=e.getAggregateIsolatedNodes();if(1===e.models.length){var i={type:r.ISOLATE_EVENT,nodeIdArray:t.length?t[0].ids:[],model:e.models[0]};e.viewerImpl.api.dispatchEvent(i)}i={type:r.AGGREGATE_ISOLATION_CHANGED_EVENT,isolation:t};e.viewerImpl.api.dispatchEvent(i)}o.prototype.getInstanceTree=function(){return this.model?this.model.getData().instanceTree:null},o.prototype.getIsolatedNodes=function(){return this.isolatedNodes.slice(0)},o.prototype.getHiddenNodes=function(){return this.hiddenNodes.slice(0)},o.prototype.setAllVisibility=function(e){var t=this.model?this.model.getRootId():null;t&&this.setVisibilityOnNode(t,e),this.model.getData().is2d&&this.model.setAllVisibility(e)},o.prototype.isNodeVisible=function(e){var t=this.getInstanceTree();return t?!t.isNodeHidden(e):-1==this.hiddenNodes.indexOf(e)&&(0==this.isolatedNodes.length||-1!=this.isolatedNodes.indexOf(e))},o.prototype.isolate=function(e){var t=this.getInstanceTree(),i=t?t.getRootId():null,n="number"==typeof e&&e===i||"object"==typeof e&&e.dbId===i;e&&!n?this.isolateMultiple(Array.isArray(e)?e:[e]):this.isolateNone()},o.prototype.isolateNone=function(){this.model.setAllVisibility(!0),this.viewerImpl.sceneUpdated(!0),this.setAllVisibility(!0),this.hiddenNodes=[],this.isolatedNodes=[],this.viewerImpl.invalidate(!0)},o.prototype.isolateMultiple=function(e){if(e&&0!=e.length){this.model.getData().is2d||(this.model.setAllVisibility(!1),this.viewerImpl.sceneUpdated(!0)),this.setAllVisibility(!1),this.isolatedNodes=e.slice(0),this.hiddenNodes=[];for(var t=0;t<e.length;t++)this.setVisibilityOnNode(e[t],!0)}else this.isolateNone();this.viewerImpl.invalidate(!0)},o.prototype.hide=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i;if(Array.isArray(e)){for(var n=0;n<e.length;++n)this.setVisibilityOnNode(e[n],!1);e.length>0&&(i={type:r.HIDE_EVENT,nodeIdArray:e,model:this.model})}else this.setVisibilityOnNode(e,!1),i={type:r.HIDE_EVENT,nodeIdArray:[e],model:this.model};i&&t&&this.viewerImpl.api.dispatchEvent(i)},o.prototype.show=function(e){var t;if(Array.isArray(e)){for(var i=0;i<e.length;++i)this.setVisibilityOnNode(e[i],!0);e.length>0&&(t={type:r.SHOW_EVENT,nodeIdArray:e,model:this.model})}else this.setVisibilityOnNode(e,!0),t={type:r.SHOW_EVENT,nodeIdArray:[e],model:this.model};t&&this.viewerImpl.api.dispatchEvent(t)},o.prototype.toggleVisibility=function(e){var t=this.getInstanceTree();if(t){var i=t.isNodeHidden(e);this.setVisibilityOnNode(e,i);var n={type:i?r.SHOW_EVENT:r.HIDE_EVENT,nodeIdArray:[e],model:this.model};this.viewerImpl.api.dispatchEvent(n)}},o.prototype.setVisibilityOnNode=function(e,t){var i,n=this.viewerImpl,r=this.model,o=this.getInstanceTree(),s=!t,a=r.getData().is2d;this.viewerImpl.matman();o?o.enumNodeChildren(e,(function(e){var i=o.isNodeVisibleLocked(e);if(o.setNodeHidden(e,s&&!i),a){var n=r.reverseMapDbIdFor2D(e);r.getFragmentList().setObject2DGhosted(n,!t&&!i)}else o.enumNodeFragments(e,(function(e){r.setVisibility(e,t||i)}),!1)}),!0):a?r.isLeaflet()?r.setVisibility(null,t):null===(i=r.getFragmentList())||void 0===i||i.setObject2DGhosted(e,!t):r.setVisibility(e,t);n.sceneUpdated(!0),this.updateNodeVisibilityTracking(e,t)},o.prototype.updateNodeVisibilityTracking=function(e,t){var i=t;if(this.isolatedNodes.length>0){var n=this.isolatedNodes.indexOf(e);i&&-1===n?this.isolatedNodes.push(e):i||-1===n||(this.isolatedNodes.splice(n,1),0===this.isolatedNodes.length&&(this.hiddenNodes=[this.model.getRootId()]))}else{var r=this.hiddenNodes.indexOf(e);i||-1!==r?i&&-1!==r&&this.hiddenNodes.splice(r,1):this.hiddenNodes.push(e)}var o=this.getInstanceTree();o&&o.root&&o.root.dbId===e&&(t?(this.isolatedNodes=[],this.hiddenNodes=[]):(this.isolatedNodes=[],this.hiddenNodes=[e]))},o.prototype.toggleNodeVisibleLocked=function(e){var t=this.getInstanceTree().isNodeVisbileLocked(e);this.lockNodeVisible(e,!t)},o.prototype.lockNodeVisible=function(e,t){var i=this.viewerImpl,n=this.model,r=this.getInstanceTree(),o=n.getData().is2d;if(r){var s=e=>{r.enumNodeChildren(e,(function(e){if(r.lockNodeVisible(e,t),t)if(r.setNodeHidden(e,!1),o){var i=n.reverseMapDbIdFor2D(e);n.getFragmentList().setObject2DGhosted(i,!1)}else r.enumNodeFragments(e,(function(e){n.setVisibility(e,!0)}),!1)}),!0),t&&(i.sceneUpdated(!0),this.updateNodeVisibilityTracking(e,t))};Array.isArray(e)?e.forEach(s):s(e)}},o.prototype.isNodeVisibleLocked=function(e){var t=this.getInstanceTree();return t&&t.isNodeVisibleLocked(e)},o.prototype.setNodeOff=function(e,t,i,n){var r=this.viewerImpl,o=this.model,s=this.getInstanceTree(),a=o.getData().is2d;if(!s)return a?o.getFragmentList().setObject2DVisible(e,!t):o.getFragmentList().setFragOff(e,t),void r.sceneUpdated(!0);if(i&&n){let e,r;if(a)for(let n=0;n<i.length;++n){e=i[n],s.setNodeOff(e,t);var l=o.reverseMapDbIdFor2D(e);o.getFragmentList().setObject2DVisible(l,!t)}else{for(let n=0;n<i.length;++n)e=i[n],s.setNodeOff(e,t);for(let e=0;e<n.length;++e)r=n[e],o.getFragmentList().setFragOff(r,t)}}else s.enumNodeChildren(e,(function(e){if(s.setNodeOff(e,t),a){var i=o.reverseMapDbIdFor2D(e);o.getFragmentList().setObject2DVisible(i,!t)}else s.enumNodeFragments(e,(function(e){o.getFragmentList().setFragOff(e,t)}),!1)}),!0);r.sceneUpdated(!0)},s.prototype.addModel=function(e){-1==this.models.indexOf(e)&&(e.visibilityManager=new o(this.viewerImpl,e),this.models.push(e))},s.prototype.removeModel=function(e){var t=this.models.indexOf(e);e.visibilityManager.isolateNone(),e.visibilityManager=null,this.models.splice(t,1)},s.prototype.warn=function(){this.models.length>1&&n.logger.warn("This selection call does not yet support multiple models.")},s.prototype.getAggregateIsolatedNodes=function(){for(var e=[],t=this.models,i=0;i<t.length;i++){var n=t[i].visibilityManager.getIsolatedNodes();n&&n.length&&e.push({model:t[i],ids:n})}return e},s.prototype.getIsolatedNodes=function(e){return e||(this.warn(),e=this.models[0]),e.visibilityManager.getIsolatedNodes()},s.prototype.getAggregateHiddenNodes=function(){for(var e=[],t=this.models,i=0;i<t.length;i++){var n=t[i].visibilityManager.getHiddenNodes();n&&n.length&&e.push({model:t[i],ids:n})}return e},s.prototype.getHiddenNodes=function(e){return e||(this.warn(),e=this.models[0]),e.visibilityManager.getHiddenNodes()},s.prototype.isNodeVisible=function(e,t){return e||(this.warn(),e=this.models[0]),e.visibilityManager.isNodeVisible(t)},s.prototype.isolate=function(e,t){t||(this.warn(),t=this.models[0]),t.visibilityManager.isolate(e),a(this)},s.prototype.aggregateIsolate=function(e,t){if(e&&0!==e.length){var i=this.models.concat();for(l=0;l<e.length;++l){var n=e[l].model,r=e[l].ids||e[l].selection,o=i.indexOf(n);i.splice(o,1),n.visibilityManager.isolate(r)}for(var s=!t||void 0!==t.hideLoadedModels&&t.hideLoadedModels;i.length&&s;)i.pop().visibilityManager.setAllVisibility(!1)}else for(var l=0;l<this.models.length;++l)this.models[l].visibilityManager.isolateNone();a(this)},s.prototype.hide=function(e,t){t||(this.warn(),t=this.models[0]),t.visibilityManager.hide(e)},s.prototype.aggregateHide=function(e){if(e&&0!==e.length){for(var t=0;t<e.length;++t){var i=e[t].model,n=e[t].ids||e[t].selection;i.visibilityManager.hide(n,1===this.models.length)}var o=this.getAggregateHiddenNodes(),s={type:r.AGGREGATE_HIDDEN_CHANGED_EVENT,hidden:o};this.viewerImpl.api.dispatchEvent(s)}},s.prototype.show=function(e,t){t||(this.warn(),t=this.models[0]),t.visibilityManager.show(e)},s.prototype.toggleVisibility=function(e,t){t||(this.warn(),t=this.models[0]),t.visibilityManager.toggleVisibility(e)},s.prototype.setVisibilityOnNode=function(e,t,i){i||(this.warn(),i=this.models[0]),i.visibilityManager.setVisibilityOnNode(e,t)},s.prototype.toggleVisibleLocked=function(e,t){t||(this.warn(),t=this.models[0]),t.visibilityManager.toggleVisibleLocked(e)},s.prototype.lockNodeVisible=function(e,t,i){i||(this.warn(),i=this.models[0]),i.visibilityManager.lockNodeVisible(e,t)},s.prototype.isNodeVisibleLocked=function(e,t){return t||(this.warn(),t=this.models[0]),t.visibilityManager.isNodeVisibleLocked(e,t)},s.prototype.setNodeOff=function(e,t,i,n,r){i||(this.warn(),i=this.models[0]),i.visibilityManager.setNodeOff(e,t,n,r)}},21609:(e,t,i)=>{"use strict";i.r(t),i.d(t,{WorldUpTool:()=>o});var n=i(41434),r=i(33423);function o(e,t){var i,o=t.navigation,s=o.getCamera(),a=["worldup"],l=this,c=(i=new n.Vector3,function(e,t,r,o){var s=new n.Vector3(e,t,r),a=o.dot(s);return i.copy(o),i.multiplyScalar(a),s.sub(i)});var h=2*Math.PI,u=.001,d=1e-5,p=!1,f=!1,m=!1,g=new function(e,t){var i=2*Math.tan(n.Math.degToRad(15)),r=new n.MeshPhongMaterial({color:12303291,opacity:.5,transparent:!0,depthTest:!1,depthWrite:!1}),s=new n.Vector3,a=new n.Vector3,l=new n.Quaternion,u=new n.PerspectiveCamera(30,t.aspect,t.near,t.far),p=t,f=1,m=1,g=null,v=null,y=null,b=null,x=null,_=null,E=null,A=null,S=null,w=new Array(6),M=0,T=!1,C=!0,P=0,D=5*Math.PI/180,L=7*Math.PI/180,I=1,R=1e3;function O(e,t){var i=Math.abs(e-t);return i>h?i:Math.min(h-i,i)}function N(e,t){var i=U(e);return i.distanceToSquared(t)<d||(a.set(-t.x,-t.y,-t.z),i.distanceToSquared(a)<d)}function k(e){return e>h?e:e<=0?e+Math.PI:e-Math.PI}function F(e,t,i){var n,r=e.clone().normalize(),o=new Array(3),s=new Array(6);o[0]=c(1,0,0,r),o[1]=c(0,1,0,r),o[2]=c(0,0,1,r);var h=t.clone().cross(r).normalize();for(n=0;n<3;++n){var u=o[n];s[n]=u.length(),s[n]<.1?w[n]=R:(u.multiplyScalar(1/s[n]),w[n]=Math.atan2(h.dot(u),t.dot(u)))}for(w[3]=k(w[0]),w[4]=k(w[1]),w[5]=k(w[2]),s[3]=s[0],s[4]=s[1],s[5]=s[2],function(e,t){for(var i=D+L+2*Math.PI/180,n=0;n<6;++n)if(w[n]!==R)for(var r=n+1;r<6;++r)if(w[r]!==R&&O(w[n],w[r])<i){if(e[n]<e[r]&&!N(n,t)||N(r,t)){w[n]=R;break}w[r]=R}}(s,i),n=0;n<6;++n)if(w[n]!==R){var d=a.set(0,0,1);l.setFromAxisAngle(d,w[n]);var p=a.set(0,.54,0);p.applyQuaternion(l),A[n].position.copy(p),A[n].visible=!0}else A[n].visible=!1}function V(e,t,i,s,a){return _||(_=function(){_=new n.Object3D;var e=new n.RingGeometry(.5-.01*f,.5,60),t=new n.Mesh(e,r);v=t;var i=.007*f,o=new n.BoxGeometry(.93,i,i),s=new n.BoxGeometry(i,.93,i),a=new n.BoxGeometry(i,i,.93);y=new n.Mesh(o,r),b=new n.Mesh(s,r),x=new n.Mesh(a,r),_.add(y),_.add(b),_.add(x),E=new n.Mesh(new n.CircleGeometry(.005),r),_.add(E),A=new Array(6),S=new Array(6);for(var l=0;l<6;++l){var c=.005*f,h=.0025*f;A[l]=new n.Mesh(new n.CircleGeometry(c,16),r),S[l]=new n.Mesh(new n.CircleGeometry(h,16),r),S[l].visible=!1,A[l].add(S[l]),t.add(A[l])}return _.add(t),_}()),o.orient(v,t,u.position,s),F(i,a,s),_.scale.x=e,_.scale.y=e,_.scale.z=e,_.position.copy(t),_}function U(e){if(s.set(0,0,0),e>=0){var t=e>=3?-1:1;0===(e%=3)&&(s.x=t),1===e&&(s.y=t),2===e&&(s.z=t)}return T&&s.multiplyScalar(-1),s}function B(e,t){for(var i=O(w[0],e),n=0,r=1;r<6;++r){var o=O(w[r],e);o<i&&(i=o,n=r)}return i,i<t?n:-1}function z(e){o.setWorldUpVector(e,!0)}function G(e){if(0!==e){var t=30*Math.PI/180,i=a.copy(u.position).sub(g).normalize();l.setFromAxisAngle(i,e);var n=o.getWorldUpVector(),r=Math.abs(i.angleTo(n));(r<t||Math.PI-r<t)&&n.copy(o.getCameraUpVector()),n.applyQuaternion(l),z(n)}}function H(e,t,i,n){return e<t&&U(i).distanceToSquared(n)<d}function W(e,t){e.dot(t)<0&&(t=t.clone().multiplyScalar(-1)),o.orient(E,g,u.position,t),E.position.copy(t.multiplyScalar(.495));for(var i=!1,n=C?L:D,r=0;r<6;++r){var s=O(w[r],M),a=H(s,n,r,e);a&&(i=!0);var l=a?4:3*(1-3*s/Math.PI);l<1&&(l=1),l*=f,S[r].visible=a;var c=A[r];c.scale.x=l,c.scale.y=l,c.scale.z=l}return y.visible=i,b.visible=i,x.visible=i,i}function j(e){(M+=e)>Math.PI?M-=h:M<=-Math.PI&&(M=h+M);var t=function(){if(!C){var e=B(M,D);if(e>=0)return 0,C=!0,M=w[e],U(e)}return!1}();if(t)P=M,z(t);else if(function(){if(C){if(B(M,L)<0)return C=!1,!0;0}return!1}()){G(M-P),P=0}else{if(C)return!1;G(e)}return!0}e.createOverlayScene("roll",null,null,u),this.updateRollCamera=function(e,t){u.position.copy(p.position),u.quaternion.copy(p.quaternion),u.up.copy(p.up),u.aspect=p.aspect,e&&t&&(u.near=t-e,u.far=t+e),u.updateProjectionMatrix()},this.isSnapped=function(){return C},this.resize=function(){var e=I*i,t=e*p.aspect,n=(p.aspect<1?t:e)*m;_.scale.x=n,_.scale.y=n,_.scale.z=n},this.start=function(t,i){this.updateHUD(t,i),e.addOverlay("roll",_)},this.updateHUD=function(e,t){g=e,t<.35?t=.35:t>.8&&(t=.8),m=t,f=.8/t;var n=s.copy(e).sub(p.position),r=(I=n.length())*i,a=r*p.aspect,l=(p.aspect<1?a:r)*t;this.updateRollCamera(l,I);var c=o.getWorldUpVector(),h=o.getCameraUpVector();V(l,e,n,c,h),M=0,P=0;var u=c.dot(h);T=u<0,C=W(c,h)},this.handleRoll=function(e,t,i){if(this.updateRollCamera(),W(o.getWorldUpVector(),o.getCameraUpVector()),0!==e||0!==t){var n=i.x-e-.5,r=i.y-t-.5,s=i.x-.5,a=i.y-.5;return j(Math.atan2(a,s)-Math.atan2(r,n))}return!1},this.handleRollTouch=function(e){this.updateRollCamera(),W(o.getWorldUpVector(),o.getCameraUpVector());var t=e-M;return Math.abs(t)>.001&&j(t)},this.end=function(){e.removeOverlay("roll",_)}}(e,s),v=new n.Vector3,y=new n.Vector3,b=new n.Vector3,x=null,_=0;this.getNames=function(){return a},this.getName=function(){return a[0]},this.activate=function(e){t.addEventListener(r.CAMERA_CHANGE_EVENT,this.handleCameraChange),m=!1},this.deactivate=function(e){g.end(),t.removeEventListener(r.CAMERA_CHANGE_EVENT,this.handleCameraChange),this.utilities.restorePivot(),x=null,p=!1,m=!1},this.getCursor=function(){return"auto"},this.getMotionDelta=function(e){var t=y.x-v.x,i=y.y-v.y,n=y.z-v.z;Math.abs(t)<u&&(t=0),Math.abs(i)<u&&(i=0),Math.abs(n)<u&&(n=0),e.set(t,i,n)},this.stepMotionDelta=function(){v.copy(y)},this.update=function(){if(!m){var e=o.getEyeVector(),t=.5*(s.near+s.far);e.normalize().multiplyScalar(t);var i=e.add(s.position);this.utilities.savePivot(),this.utilities.setPivotPoint(i,!0,!0),this.utilities.pivotActive(!0);g.start(i,.65),m=!0}var n=f;this.getMotionDelta(b);var r=b.x,a=b.y,l=b.z;return(f||"roll"===x||p&&(0!==r||0!==a||0!==l))&&(f="roll"===x?g.handleRollTouch(_):g.handleRoll(r,a,y)),this.stepMotionDelta(),s.dirty&&(n=!0),n},this.handleResize=function(){g.resize(),f=!0},this.handleGesture=function(e){switch(e.type){case"dragstart":return x="drag",this.handleButtonDown(e,0);case"dragmove":return this.handleMouseMove(e);case"dragend":return x=null,this.handleButtonUp(e,0);case"rotatestart":return t.removeEventListener(r.CAMERA_CHANGE_EVENT,this.handleCameraChange),x="roll",_=n.Math.degToRad(e.rotation),{x:.5*(e.normalizedX+1),y:1-.5*(e.normalizedY+1)},function(e){var t=e.pointers[1].clientX-e.pointers[0].clientX,i=e.pointers[1].clientY-e.pointers[0].clientY,n=Math.sqrt(t*t+i*i),r=o.getScreenViewport();return n/Math.min(r.width,r.height)}(e),!0;case"rotatemove":return _=n.Math.degToRad(e.rotation),"roll"===x;case"rotateend":return t.addEventListener(r.CAMERA_CHANGE_EVENT,this.handleCameraChange),_=n.Math.degToRad(e.rotation),x=null,!1}return!1},this.handleWheelInput=function(e){return!0},this.handleCameraChange=function(){var e=o.getEyeVector(),t=.5*(s.near+s.far);e.normalize().multiplyScalar(t);var i=e.add(s.position);g.updateHUD(i,.65)},this.handleButtonDown=function(e,i){return v.x=.5*(e.normalizedX+1),v.y=1-.5*(e.normalizedY+1),y.copy(v),p=!0,x=null,this.controller.setIsLocked(!0),t.removeEventListener(r.CAMERA_CHANGE_EVENT,l.handleCameraChange),!0},this.handleButtonUp=function(e,i){return y.x=.5*(e.normalizedX+1),y.y=1-.5*(e.normalizedY+1),p=!1,f=!0,this.controller.setIsLocked(!1),t.addEventListener(r.CAMERA_CHANGE_EVENT,l.handleCameraChange),!0},this.handleMouseMove=function(e){return y.x=.5*(e.normalizedX+1),y.y=1-.5*(e.normalizedY+1),!0},this.handleBlur=function(e){return p=!1,x=null,!1}}},37804:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Autocam:()=>h});var n=i(41434),r=i(71224),o=i(27293),s=i(59991);const a=Number.MIN_VALUE||3e-308,l=1e-5;function c(e){const t=1e-12;Math.abs(e.x)<t&&Math.abs(e.y)<t?e.set(0,0,e.z>0?1:-1):Math.abs(e.y)<t&&Math.abs(e.z)<t?e.set(e.x>0?1:-1,0,0):Math.abs(e.z)<t&&Math.abs(e.x)<t&&e.set(0,e.y>0?1:-1,0)}function h(e,t,i){var o=this,h=null,u=!1;this.cube=null,this.camera=e,this.renderer="WEBGL",this.startState={},this.navApi=t,this.orthographicFaces=!1,this.canvas=i,this.cameraChangedCallback=function(){},this.pivotDisplayCallback=function(){},this.transitionCompletedCallback=function(){};var d,p=Date.now(),f=!1;function m(t){u=!0,e.target.copy(o.center),e.pivot.copy(o.pivot),e.worldup?e.worldup.copy(o.sceneUpDirection):e.up.copy(o.sceneUpDirection),o.cameraChangedCallback(t),u=!1}function g(e,t){e.position.copy(e.globalPosition).sub(t),e.center.copy(e.globalCenter).sub(t),e.pivot.copy(e.globalPivot).sub(t)}this.recordTime=!0,this.dtor=function(){this.cube=null,this.cameraChangedCallback=null,this.pivotDisplayCallback=null,this.transitionCompletedCallback=null,this.canvas=null,this.recordTime=!1,this.afAnimateTransition&&cancelAnimationFrame(this.afAnimateTransition)},this.registerCallbackCameraChanged=function(e){this.cameraChangedCallback=e},this.registerCallbackPivotDisplay=function(e){this.pivotDisplayCallback=e},this.registerCallbackTransitionCompleted=function(e){this.transitionCompletedCallback=e},this.showPivot=function(e){this.pivotDisplayCallback(e)},this.setWorldUpVector=function(e){u||e&&e.lengthSq()>0&&!e.normalize().equals(this.sceneUpDirection)&&(this.sceneUpDirection.copy(e),this.sceneFrontDirection.copy(this.getWorldFrontVector()),this.cubeFront.copy(this.sceneFrontDirection).cross(this.sceneUpDirection).normalize(),this.cube&&requestAnimationFrame(this.cube.render))},this.getWorldUpVector=function(){return this.sceneUpDirection.clone()},this.getWorldRightVector=function(){var e=this.sceneUpDirection.clone();return Math.abs(e.z)<=Math.abs(e.y)?e.set(e.y,-e.x,0):e.z>=0?e.set(e.z,0,-e.x):e.set(-e.z,0,e.x),e.normalize()},this.getWorldFrontVector=function(){return this.getWorldUpVector().cross(this.getWorldRightVector()).normalize()},this.goToView=function(e){if(this.navApi.isActionEnabled("gotoview")){var t={position:e.position.clone(),up:e.up.clone(),center:e.center.clone(),pivot:e.pivot.clone(),fov:e.fov,worldUp:e.worldUp.clone(),isOrtho:e.isOrtho};this.addGlobalPositions(t),o.elapsedTime=0,this.animateTransition(t)}},this.getCurrentView=function(){return{position:e.position.clone(),up:e.up.clone(),center:this.center.clone(),pivot:this.pivot.clone(),fov:e.fov,worldUp:this.sceneUpDirection.clone(),isOrtho:!1===e.isPerspective}},this.setCurrentViewAsHome=function(e){e?(this.navApi.setRequestFitToView(!0),f=!0):this.homeVector=this.getCurrentView()},this.setHomeViewFrom=function(e){var t=e.pivot?e.pivot:this.center,i=e.target?e.target:this.pivot,n=e.worldup?e.worldup:this.sceneUpDirection;this.homeVector={position:e.position.clone(),up:e.up.clone(),center:i.clone(),pivot:t.clone(),fov:e.fov,worldUp:n.clone(),isOrtho:!1===e.isPerspective},this.originalHomeVector={position:e.position.clone(),up:e.up.clone(),center:i.clone(),pivot:t.clone(),fov:e.fov,worldUp:n.clone(),worldFront:this.sceneFrontDirection.clone(),isOrtho:!1===e.isPerspective},this.addGlobalPositions(this.homeVector),this.addGlobalPositions(this.originalHomeVector)},this.toPerspective=function(){e.isPerspective||(e.toPerspective(),m(!1))},this.toOrthographic=function(){e.isPerspective&&(e.toOrthographic(),m(!1))},this.setOrthographicFaces=function(e){this.orthographicFaces=e},this.getViewType=function(){return this.orthographicFaces?s.VIEW_TYPES.PERSPECTIVE_ORTHO_FACES:e.isPerspective?s.VIEW_TYPES.PERSPECTIVE:s.VIEW_TYPES.ORTHOGRAPHIC},this.setViewType=function(e,t){switch(e){case s.VIEW_TYPES.ORTHOGRAPHIC:return this.setOrthographicFaces(!1),this.toOrthographic(),!0;case s.VIEW_TYPES.PERSPECTIVE:return this.setOrthographicFaces(!1),this.toPerspective(),!0;case s.VIEW_TYPES.PERSPECTIVE_ORTHO_FACES:return this.setOrthographicFaces(!0),void 0===t&&(t=this.isFaceView()),t?this.toOrthographic():this.toPerspective(),!0;default:return!1}},this.goHome=function(){this.navApi.isActionEnabled("gotoview")&&(this.navApi.setPivotSetFlag(!1),this.goToView(this.homeVector))},this.resetHome=function(){this.homeVector.position.copy(this.originalHomeVector.position),this.homeVector.up.copy(this.originalHomeVector.up),this.homeVector.center.copy(this.originalHomeVector.center),this.homeVector.pivot.copy(this.originalHomeVector.pivot),this.homeVector.fov=this.originalHomeVector.fov,this.homeVector.worldUp.copy(this.originalHomeVector.worldUp),this.homeVector.isOrtho=this.originalHomeVector.isOrtho,this.goHome()},this.getView=function(){return this.center.clone().sub(e.position)},this.setCameraUp=function(t){var i=this.dir.clone(),n=i.cross(t).normalize();0===n.lengthSq()&&(i.copy(this.dir),t.z>t.y?i.y+=1e-4:i.z+=1e-4,n=i.cross(t).normalize()),e.up.copy(n).cross(this.dir).normalize()},this.addGlobalPositions=function(e){var t=this.camera.globalOffset;e.globalPosition=e.position.clone().add(t),e.globalCenter=e.center.clone().add(t),e.globalPivot=e.pivot.clone().add(t)},this.onGlobalOffsetChanged=function(e){g(this.homeVector,e),g(this.originalHomeVector,e),this.camera.setGlobalOffset(e)};var v,b,_,E,A=this;!function e(){A.recordTime&&requestAnimationFrame(e);var t=Date.now();d=t-p,p=t}(),this.ortho=!1,this.center=e.target?e.target.clone():new n.Vector3(0,0,0),this.pivot=e.pivot?e.pivot.clone():this.center.clone(),this.sceneUpDirection=e.worldup?e.worldup.clone():e.up.clone(),this.sceneFrontDirection=this.getWorldFrontVector(),this.dir=this.getView(),this.setCameraUp(e.up),this.saveCenter=this.center.clone(),this.savePivot=this.pivot.clone(),this.saveEye=e.position.clone(),this.saveUp=e.up.clone(),this.cubeFront=this.sceneFrontDirection.clone().cross(this.sceneUpDirection).normalize(),this.setHomeViewFrom(e);var S,w,M=new n.Quaternion,T=new n.Quaternion,C=new n.Quaternion,P=new n.Quaternion;this.userPanSpeed=.5,this.userLookSpeed=2,this.userHeightSpeed=5,this.walkMultiplier=1,this.userZoomSpeed=1.015,this.orbitMultiplier=5,this.currentlyAnimating=!1,e.keepSceneUpright=!0,this.preserveOrbitUpDirection=!0,this.alignOrbitUpDirection=!0,this.constrainOrbitHorizontal=!1,this.constrainOrbitVertical=!1,this.doCustomOrbit=!1,this.snapOrbitDeadZone=.045,this.snapOrbitThresholdH=this.snapOrbitThresholdV=n.Math.degToRad(15),this.snapOrbitAccelerationAX=this.snapOrbitAccelerationAY=1.5,this.snapOrbitAccelerationBX=this.snapOrbitAccelerationBY=2,this.snapOrbitAccelerationPointX=this.snapOrbitAccelerationPointY=.5,this.combined=!1,this.useSnap=!1,this.lockDeltaX=0,this.lockedX=!1,this.lastSnapRotateX=0,this.lockDeltaY=0,this.lockedY=!1,this.lastSnapRotateY=0,this.lastSnapDir=new n.Vector3(0,0,0),this.topLimit=!1,this.bottomLimit=!1,this.minSceneBound=0,this.maxSceneBound=0;var D,L,I={destinationPercent:1,duration:1,zoomToFitScene:!0,useOffAxis:!1};this.shotParams=I,this.zoomDelta=new n.Vector2;var R;function O(e,t,i){if(e<=t)return 0;if(e>=i)return 1;var n=(e-t)/(i-t);return.5*(Math.sin((n-.5)*Math.PI)+1)}function N(e){return Math.round(10*e)/10}function k(e,t){var i=new n.Vector2(0,0),r=o.getWindow();return i.x=e/r.innerWidth,i.y=t/r.innerHeight,i}function F(e,t,i){var n,r,s,a;n=r=s=a=0;var l=0,c=null,h=null,u=o.snapOrbitDeadZone,d=o.orbitMultiplier;return"h"==e?(n=o.snapOrbitThresholdH,r=o.snapOrbitAccelerationAX,s=o.snapOrbitAccelerationBX,a=1-o.snapOrbitAccelerationPointX,h=o.lockDeltaX,c=o.lockedX):(n=o.snapOrbitThresholdV,r=o.snapOrbitAccelerationAY,s=o.snapOrbitAccelerationBY,a=1-o.snapOrbitAccelerationPointY,h=o.lockDeltaY,c=o.lockedY),c?(h+=i)<-u?(l=(h+u)*d*1/s,c=!1):h>u&&(l=(h-u)*d*1/s,c=!1):(l=Math.abs(t)>n?i*d:Math.abs(t)>a*n?i*t>0?i*d*r:i*d*1/r:i*t>0?i*d*s:i*d*1/s)*t>0&&Math.abs(l)>Math.abs(t)&&(this.lockDeltaX=this.lockDeltaY=0,c=!0,l=t),l}function V(){return o.combined}function U(e,t){var i=!1,n=o.getWindow(),r=n.innerWidth,s=e.x%r,a=n.innerHeight,l=e.y%a,c=s>0?s-t.x:r+s-t.x,h=l>0?l-t.y:a+l-t.y;return Math.abs(c)<30&&Math.abs(h)<30&&(i=!0),i}function B(e,t,i){var r=o.getWindow();if(!R||!e){if(e){var s=new n.Vector2,a=t.x,l=t.y;!function(e,t,i){var n=o.getWindow();i.x=(e.x-t.x)/n.innerWidth,e.x=t.x+(e.x-t.x)%n.innerWidth,i.y=(e.y-t.y)/n.innerHeight,e.y=t.y+(e.y-t.y)%n.innerHeight}(t,i,s),r.innerWidth*s.x,r.innerHeight*s.y,a<i.x?a-=60:a+=60,l<i.y?l-=60:l+=60}R=e}}function z(e){var t=Math.pow(e,2);e<0&&(t=-t);var i=k(0,t),n=.01*(o.maxSceneBound-o.minSceneBound);i.y*=n;var r=o.userHeightSpeed*i.y;return r=function(e,t,i){if(0===t)return 0;var n=e,r=o.saveEye.clone().sub(worldUp.clone().multiplyScalar(i+n)),s=o.saveEye.clone().sub(worldUp.clone().multiplyScalar(i)),a=0,l=(o.maxSceneBound-o.minSceneBound)/1e3;o.topLimit&&t>0?(a=o.maxSceneBound-l,o.topLimit=!1):o.bottomLimit&&t<0?(a=o.minSceneBound+l,o.bottomLimit=!1):a=r.dot(worldUp);var c=s.dot(worldUp);return a<o.minSceneBound?c<o.minSceneBound&&(o.bottomLimit=!0,n=0):a>o.maxSceneBound&&c>o.maxSceneBound&&(o.topLimit=!0,n=0),n}(r,e,o.m_amount),r}function G(e){var t=o.sceneFrontDirection.clone().cross(o.sceneUpDirection),i=Math.abs(Math.abs(e.dot(o.sceneUpDirection))-1),n=Math.abs(Math.abs(e.dot(o.sceneFrontDirection))-1),r=Math.abs(Math.abs(e.dot(t))-1);return i<l||n<l||r<l}this.viewCubeMenuOpen=!1,this.menuSize=new n.Vector2(0,0),this.menuOrigin=new n.Vector2(0,0),e.lookAt(this.center),this.setCube=function(e){this.cube=e},this.sync=function(t){t.isPerspective!==e.isPerspective&&(t.isPerspective?e.toPerspective():(e.toOrthographic(),t.saveFov&&(e.saveFov=t.saveFov))),e.fov=t.fov,e.position.copy(t.position),t.target&&(this.center.copy(t.target),e.target.copy(t.target)),t.pivot&&(this.pivot.copy(t.pivot),e.pivot.copy(t.pivot)),this.dir.copy(this.center).sub(e.position),this.setCameraUp(t.up);var i=t.worldup?t.worldup:t.up;i.distanceToSquared(this.sceneUpDirection)>1e-4&&this.setWorldUpVector(i),f&&!this.navApi.getTransitionActive()&&(f=!1,this.setCurrentViewAsHome(!1)),this.cube&&requestAnimationFrame(this.cube.render)},this.refresh=function(){this.cube&&this.cube.refreshCube()},n.Matrix3.prototype.makeRotationFromQuaternion=function(e){var t=this.elements,i=e.x,n=e.y,r=e.z,o=e.w,s=i+i,a=n+n,l=r+r,c=i*s,h=i*a,u=i*l,d=n*a,p=n*l,f=r*l,m=o*s,g=o*a,v=o*l;return t[0]=1-(d+f),t[3]=h-v,t[6]=u+g,t[1]=h+v,t[4]=1-(c+f),t[7]=p-m,t[2]=u-g,t[5]=p+m,t[8]=1-(c+d),this},n.Quaternion.prototype.setFromRotationMatrix3=function(e){var t,i=e.elements,n=i[0],r=i[3],o=i[6],s=i[1],a=i[4],l=i[7],c=i[2],h=i[5],u=i[8],d=n+a+u;return d>0?(t=.5/Math.sqrt(d+1),this.w=.25/t,this.x=(h-l)*t,this.y=(o-c)*t,this.z=(s-r)*t):n>a&&n>u?(t=2*Math.sqrt(1+n-a-u),this.w=(h-l)/t,this.x=.25*t,this.y=(r+s)/t,this.z=(o+c)/t):a>u?(t=2*Math.sqrt(1+a-n-u),this.w=(o-c)/t,this.x=(r+s)/t,this.y=.25*t,this.z=(l+h)/t):(t=2*Math.sqrt(1+u-n-a),this.w=(s-r)/t,this.x=(o+c)/t,this.y=(l+h)/t,this.z=.25*t),this},n.Quaternion.prototype.rotate=function(e){var t=(new n.Matrix4).makeRotationFromQuaternion(this).elements,i=(new n.Matrix3).set(t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]);return e.applyMatrix3(i)},this.animateTransition=function(t){if(g(t,e.globalOffset),t){var i=!1,n=0;if(this.setCameraOrtho(t.isOrtho),o.elapsedTime>=I.duration)return n=1,o.center.copy(t.center),o.pivot.copy(t.pivot),e.position.copy(t.position),e.up.copy(t.up),e.target.copy(t.center),t.isOrtho||(e.fov=t.fov),e.dirty=!0,(i=!t.worldUp.equals(this.sceneUpDirection))&&this.setWorldUpVector(t.worldUp),this.currentlyAnimating=!1,m(i),this.showPivot(!1),this.cube&&requestAnimationFrame(this.cube.render),this.navApi.setTransitionActive(!1),void this.transitionCompletedCallback();this.currentlyAnimating=!0,this.showPivot(!0),this.navApi.setTransitionActive(!0);var r=I.destinationPercent,s=1-(n=O(o.elapsedTime/I.duration,0,r));o.elapsedTime+=d/500;var a=o.center.clone().multiplyScalar(s).add(t.center.clone().multiplyScalar(n)),l=e.position.clone().multiplyScalar(s).add(t.position.clone().multiplyScalar(n)),c=e.up.clone().multiplyScalar(s).add(t.up.clone().multiplyScalar(n)),h=e.pivot.clone().multiplyScalar(s).add(t.pivot.clone().multiplyScalar(n)),u=this.sceneUpDirection.clone().multiplyScalar(s).add(t.worldUp.clone().multiplyScalar(n)),p=e.fov*s+t.fov*n;o.center.copy(a),o.pivot.copy(h),e.position.copy(l),e.up.copy(c),e.target.copy(a),t.isOrtho||(e.fov=p),e.dirty=!0,(i=u.distanceToSquared(this.sceneUpDirection)>1e-4)&&this.setWorldUpVector(u),e.lookAt(o.center),m(i),this.cube&&requestAnimationFrame(this.cube.render),o.afAnimateTransition=requestAnimationFrame((function(){o.animateTransition(t)}))}},this.sphericallyInterpolateTransition=function(t){var i,r,s,a,l=0;if(this.currentlyAnimating=!0,this.navApi.setTransitionActive(!0),o.elapsedTime>=I.duration)l=1,this.currentlyAnimating=!1;else{var c=I.destinationPercent;l=O(o.elapsedTime/I.duration,0,c),o.elapsedTime+=d/500}if(1===l)r=L.position,i=L.center,s=L.up;else{var h=new n.Matrix3,u=M.clone();u.slerp(T,l),h.makeRotationFromQuaternion(u);var p=S*(1-(a=l))+w*a,f=h.elements;r=(i=D.center.clone().multiplyScalar(1-l).add(L.center.clone().multiplyScalar(l))).clone().sub(new n.Vector3(f[0],f[1],f[2]).multiplyScalar(p)),s=new n.Vector3(f[3],f[4],f[5])}o.center.copy(i),e.position.copy(r),e.up.copy(s),o.navApi.getUsePivotAlways()||o.pivot.copy(i),e.lookAt(o.center),!0===this.currentlyAnimating?(this.showPivot(!0),requestAnimationFrame((function(){o.sphericallyInterpolateTransition(t)}))):(this.navApi.setTransitionActive(!1),this.showPivot(!1),this.orthographicFaces&&this.isFaceView()&&this.setCameraOrtho(!0),t&&t()),m(!1),this.cube&&requestAnimationFrame(this.cube.render)},this.getOrientation=function(){if(this.cube){var t=N(e.up.x),i=N(e.up.y),n=N(e.up.z),r=this.sceneFrontDirection.clone(),o=this.sceneUpDirection.clone(),s=this.sceneFrontDirection.clone().cross(this.sceneUpDirection).normalize();r.x=N(r.x),r.y=N(r.y),r.z=N(r.z),o.x=N(o.x),o.y=N(o.y),o.z=N(o.z),s.x=N(s.x),s.y=N(s.y),s.z=N(s.z);var a=s.clone().multiplyScalar(-1),l=o.clone().multiplyScalar(-1),c=r.clone().multiplyScalar(-1);switch(this.cube.currentFace){case"front":if(o.x==t&&o.y==i&&o.z==n)return"up";if(l.x==t&&l.y==i&&l.z==n)return"down";if(s.x==t&&s.y==i&&s.z==n)return"right";if(a.x==t&&a.y==i&&a.z==n)return"left";break;case"right":if(o.x==t&&o.y==i&&o.z==n)return"up";if(l.x==t&&l.y==i&&l.z==n)return"down";if(c.x==t&&c.y==i&&c.z==n)return"left";if(r.x==t&&r.y==i&&r.z==n)return"right";break;case"left":if(o.x==t&&o.y==i&&o.z==n)return"up";if(l.x==t&&l.y==i&&l.z==n)return"down";if(r.x==t&&r.y==i&&r.z==n)return"left";if(c.x==t&&c.y==i&&c.z==n)return"right";break;case"back":if(o.x==t&&o.y==i&&o.z==n)return"up";if(l.x==t&&l.y==i&&l.z==n)return"down";if(a.x==t&&a.y==i&&a.z==n)return"right";if(s.x==t&&s.y==i&&s.z==n)return"left";break;case"top":if(c.x==t&&c.y==i&&c.z==n)return"down";if(r.x==t&&r.y==i&&r.z==n)return"up";if(s.x==t&&s.y==i&&s.z==n)return"right";if(a.x==t&&a.y==i&&a.z==n)return"left";break;case"bottom":if(r.x==t&&r.y==i&&r.z==n)return"down";if(c.x==t&&c.y==i&&c.z==n)return"up";if(s.x==t&&s.y==i&&s.z==n)return"right";if(a.x==t&&a.y==i&&a.z==n)return"left"}}},this.setCameraOrtho=function(t){t&&e.isPerspective&&e.toOrthographic(),t||e.isPerspective||e.toPerspective()},this.resetOrientation=function(){this.cube&&this.cube.showCompass(this.cube.prevRenderCompass),this.setCameraOrtho(this.originalHomeVector.isOrtho),this.sceneUpDirection.copy(this.originalHomeVector.worldUp),this.sceneFrontDirection.copy(this.originalHomeVector.worldFront),this.cubeFront.copy(this.sceneFrontDirection).cross(this.sceneUpDirection).normalize(),this.setCameraUp(this.sceneUpDirection),m(!0)},this.setCurrentViewAsFront=function(){this.cube&&(this.cube.currentFace="front",this.cube.showCompass(!1)),this.sceneUpDirection.copy(e.up.clone()),c(this.sceneUpDirection),this.sceneFrontDirection.copy(this.getView()).normalize(),c(this.sceneFrontDirection),this.cubeFront.copy(this.sceneFrontDirection).cross(this.sceneUpDirection).normalize(),c(this.cubeFront),this.orthographicFaces&&this.setCameraOrtho(!0),m(!0)},this.setCurrentViewAsTop=function(){this.cube&&(this.cube.currentFace="top",this.cube.showCompass(!1)),this.sceneUpDirection.copy(this.getView()).multiplyScalar(-1).normalize(),c(this.sceneUpDirection),this.sceneFrontDirection.copy(e.up),c(this.sceneFrontDirection),this.cubeFront.copy(this.sceneFrontDirection).cross(this.sceneUpDirection).normalize(),c(this.cubeFront),m(!0)},this.calculateCubeTransform=function(t){var i=this.sceneUpDirection.clone(),r=this.sceneFrontDirection.clone(),s=this.sceneFrontDirection.clone().cross(this.sceneUpDirection).normalize();(D=e.clone()).center=o.center.clone(),D.pivot=o.pivot.clone(),(L=e.clone()).center=o.center.clone(),L.pivot=o.pivot.clone();var l=new n.Vector3(0,0,0);t.indexOf("back")>=0&&(l=l.add(r)),t.indexOf("front")>=0&&(l=l.sub(r)),t.indexOf("top")>=0&&(l=l.add(i)),t.indexOf("bottom")>=0&&(l=l.sub(i)),t.indexOf("right")>=0&&(l=l.add(s)),t.indexOf("left")>=0&&(l=l.sub(s));var c=i,h=l.clone().normalize();if(1-Math.abs(h.dot(i))<a)for(var u=this.getView().normalize(),d=[r.clone(),r.clone().negate(),s.clone(),s.clone().negate()],p=h.dot(i)>0?1:-1,f=u.clone().add(e.up.clone().multiplyScalar(p)).normalize(),m=-2,g=0;g<4;g++){var v=f.dot(d[g]);v>m&&(m=v,c=d[g].multiplyScalar(p))}w=S=this.getView().length(),L.position.copy(L.center.clone().add(l.multiplyScalar(w/l.length()))),L.up.copy(c);var y=D.center.clone().sub(D.position).normalize(),b=y.clone().cross(D.up).normalize(),x=b.clone().cross(y).normalize(),_=new n.Matrix3;_.set(y.x,x.x,b.x,y.y,x.y,b.y,y.z,x.z,b.z),M.setFromRotationMatrix3(_),x=(b=(y=L.center.clone().sub(L.position).normalize()).clone().cross(L.up).normalize()).clone().cross(y).normalize(),_.set(y.x,x.x,b.x,y.y,x.y,b.y,y.z,x.z,b.z),C.setFromAxisAngle(y,0),P.setFromAxisAngle(x,0),T.setFromRotationMatrix3(_),T.multiply(C).multiply(P).normalize()},this.drawDropdownMenu=function(e,t,i,n,o,s,a){var l=0,c=this.getDocument();if(h)s.appendChild(h);else{(h=c.createElement("div")).className="dropDownMenu",h.style.top="100px",h.style.left="-400px";for(var u=0,d=0,p=0;p<e.length;p++){var f;if(null===e[p])(f=c.createElement("li")).style.height="1px",u+=1,f.style.backgroundColor="#E0E0E0";else{var m=r.Z.t(e[p]);if(d=m.length>d?m.length:d,i[p]){f=c.createElement("div");var g=c.createElement("input"),v=c.createElement("label");g.type="radio",g.className="dropDownMenuCheck",v.innerHTML=m,v.className="dropDownMenuCheckText",f.appendChild(g),f.appendChild(v),f.className="dropDownMenuCheckbox"}else(f=c.createElement("li")).textContent=m,f.className=t[p]?"dropDownMenuItem":"dropDownMenuItemDisabled";f.id="menuItem"+l,l++,u+=25,f.setAttribute("data-i18n",e[p])}h.appendChild(f)}s.appendChild(h),h.style.minWidth=Math.max(256,7.4*d)+"px";var y=h.getBoundingClientRect().width;this.menuSize.x=y,this.menuSize.y=u}l=0;for(p=0;p<e.length;p++)if(null!==e[p]){if(i[p]){var b="menuItem"+l,x=c.getElementById(b);x&&(x.children[0].checked=i[p]())}l++}var _=o-15,E=n+1,A=this.canvas.getBoundingClientRect();E+this.menuSize.x>A.right&&(E=n-this.menuSize.x-1),_+this.menuSize.y>A.bottom&&(_=A.bottom-this.menuSize.y),_-=a.y,E-=a.x,h.style.top=_+"px",h.style.left=E+"px",this.menuOrigin.x=E,this.menuOrigin.y=_},this.removeDropdownMenu=function(e){e.removeChild(h)},this.isFaceView=function(){return G(this.center.clone().sub(e.position).normalize())&&G(e.up)},this.startInteraction=function(e,t){this.startCursor=new n.Vector2(e,t),this.startState={saveCenter:this.center.clone(),saveEye:this.camera.position.clone(),savePivot:this.pivot.clone(),saveUp:this.camera.up.clone()},this.lockDeltaX=0,this.lockedX=!1,this.lastSnapRotateX=0,this.lockDeltaY=0,this.lockedY=!1,this.lastSnapRotateY=0,this.lastSnapDir=new n.Vector3(0,0,0),this.navApi.setTransitionActive(!0)},this.orbit=function(t,i,r,s){if(this.navApi.isActionEnabled("orbit")&&!0!==this.currentlyAnimating){var a="wheel";if(o.orthographicFaces&&!e.isPerspective&&(e.toPerspective(),s&&s.saveEye.copy(this.camera.position)),s&&(a="cube"),"cube"==a?(this.saveCenter.copy(s.saveCenter),this.saveEye.copy(s.saveEye),this.savePivot.copy(s.savePivot),this.saveUp.copy(s.saveUp),this.useSnap=!0,this.doCustomOrbit=!0):(this.saveCenter.copy(this.center),this.savePivot.copy(this.pivot),this.saveEye.copy(e.position),this.saveUp.copy(e.up),this.useSnap=!1,this.doCustomOrbit=!1),V()&&null==b&&(b=this.saveCenter.clone(),v=this.saveEye.clone(),E=this.savePivot.clone(),_=this.saveUp.clone()),this.preserveOrbitUpDirection){var l=k(t.x-i.x,t.y-i.y),c=k(r.x,r.y),h=this.sceneUpDirection.clone(),u=this.sceneFrontDirection.clone(),d=this.sceneFrontDirection.clone().cross(this.sceneUpDirection).normalize(),p=V()?E:this.savePivot,f=V()?v:this.saveEye,g=V()?b:this.saveCenter,y=V()?_:this.saveUp,x=p.clone().sub(f).normalize(),A=g.clone().sub(f).normalize(),S=A.clone().cross(y),w=f.clone().sub(p).length(),M=f.clone().sub(g).length(),T=x.clone().multiplyScalar(-1),C=A.clone().multiplyScalar(-1),P=S,D=y.clone();if(!this.constrainOrbitHorizontal){h.dot(this.saveUp)<-.009&&(l.x=-l.x,c.x=-c.x);var L=0;L=V()?c.x*this.orbitMultiplier:this.useSnap?this.lastSnapRotateX+F("h",0,-c.x):l.x*this.orbitMultiplier,this.lastSnapRotateX=L;var I=(new n.Quaternion).setFromAxisAngle(h,-L);T.applyQuaternion(I),C.applyQuaternion(I),P.applyQuaternion(I),D.applyQuaternion(I)}if(!this.constrainOrbitVertical){var R=u.clone().multiplyScalar(u.dot(P)),O=d.clone().multiplyScalar(d.dot(P)),N=R.clone().add(O);N.clone().normalize();var U=0;if(V())U=c.y*this.orbitMultiplier;else{var B=F("v",0,c.y);U=this.useSnap?this.lastSnapRotateY+B:l.y*this.orbitMultiplier}var z=(new n.Quaternion).setFromAxisAngle(N,-U);if(this.navApi.getOrbitPastWorldPoles())T.applyQuaternion(z).normalize(),C.applyQuaternion(z).normalize(),D.applyQuaternion(z).normalize();else{var G=D.clone();if(G.applyQuaternion(z).normalize(),h.dot(G)<0){var H=C.clone();H.applyQuaternion(z).normalize();var W=H.angleTo(h);Math.abs(W)>.5*Math.PI&&(W-=W>0?Math.PI:-Math.PI),U-=W,z.setFromAxisAngle(N,-U),T.applyQuaternion(z).normalize(),C.applyQuaternion(z).normalize(),D.applyQuaternion(z).normalize()}else T.applyQuaternion(z).normalize(),C.applyQuaternion(z).normalize(),D.applyQuaternion(z).normalize()}this.lastSnapRotateY=U}var j=T.multiplyScalar(w).add(p);e.position.copy(j),e.up.copy(D),this.center.copy(j),this.center.sub(C.multiplyScalar(M)),V()&&(b.copy(this.center),v.copy(e.position),E.copy(this.pivot),_.copy(e.up))}e.lookAt(this.center),m(!1)}},this.endInteraction=function(){this.navApi.setTransitionActive(!1)},this.look=function(t){if(this.navApi.isActionEnabled("walk")){var i=k(t.x,t.y),r=this.userLookSpeed,o=this.getView(),s=e.up,a=o.clone().cross(s).normalize(),l=this.sceneUpDirection.clone(),c=i.clone();c.x*=Math.PI,c.y*=Math.PI/e.aspect,c.multiplyScalar(r);var h=(new n.Quaternion).setFromAxisAngle(a,-c.y);if(e.keepSceneUpright&&!this.navApi.getOrbitPastWorldPoles()){var u=s.clone();if(u.applyQuaternion(h).normalize(),u.dot(l)<0){var d=o.clone();d.applyQuaternion(h);var p=d.angleTo(l);Math.abs(p)>.5*Math.PI&&(p-=p>0?Math.PI:-Math.PI),c.y-=p,h.setFromAxisAngle(a,-c.y)}}o=h.clone().rotate(o),(s=h.clone().rotate(s)).normalize();var f=e.keepSceneUpright?l:s,g=(new n.Quaternion).setFromAxisAngle(f,-c.x);o=g.clone().rotate(o),s=g.clone().rotate(s),this.center.copy(o.add(e.position)),e.up.copy(s),e.lookAt(this.center),m(!1)}},this.pan=function(t){if(this.navApi.isActionEnabled("pan")){t=k(t.x,t.y);var i=this.getView(),r=e.up.clone().cross(i),o=i.clone().cross(r);r.normalize(),o.normalize(),i.normalize();var s=this.pivot.clone().sub(e.position),a=i.clone().dot(s),l=a*(Math.tan(n.Math.degToRad(e.leftFov))+Math.tan(n.Math.degToRad(e.rightFov))),c=a*(Math.tan(n.Math.degToRad(e.topFov))+Math.tan(n.Math.degToRad(e.bottomFov))),h=t.x*Math.abs(l),u=t.y*Math.abs(c),d=new n.Vector3,p=r.clone().multiplyScalar(h),f=o.clone().multiplyScalar(u);d=p.clone().add(f).clone().multiplyScalar(this.userPanSpeed),e.position.add(d),this.center.add(d),e.lookAt(this.center),m(!1)}},this.zoom=function(t){if(this.navApi.isActionEnabled("zoom")){var i=this.userZoomSpeed,n=Number.MAX_VALUE,r=t.x+t.y,s=Math.pow(i,r),a=this.pivot.clone().sub(this.pivot.clone().sub(this.saveEye).clone().multiplyScalar(s)),l=a.clone().add(o.D.clone().multiplyScalar(o.D.clone().dot(this.pivot.clone().sub(a).clone())));if(!(s>=n)){if(r>0){Math.pow(i,r-0);if(r<0)return void 0;e.position.copy(a),this.center.copy(l);var c=a.clone().sub(this.saveEye).dot(o.D);c>n?(e.position.copy(this.saveEye.sub(o.D).clone().multiplyScalar(n)),n>0?-1:0):-c/n}else e.position.copy(a),this.center.copy(l);e.lookAt(this.center),m(!1)}}},this.walk=function(t,i,r,o,s){if(this.navApi.isActionEnabled("walk")){var l=this.sceneUpDirection.clone(),c=this.sceneFrontDirection.clone(),h=this.sceneFrontDirection.clone().cross(this.sceneUpDirection);U(t,i)?(wheel.cursorImage("SWWalk"),B(!0,t,i),x=i.x,y=i.y):B(!1,t,i),x=t.x,y=t.y;var u=k(x-i.x,y-i.y),d=-u.x,p=-u.y,f=d<0?-1:1,g=p<0?-1:1,v=Math.abs(d),b=Math.abs(p),_=new n.Vector2(30,30);_=k(_.x,_.y),v=U(t,i)?0:Math.abs(d)-_.x,b=U(t,i)?0:Math.abs(p)-_.y;b/=.25;var E=(v=(v/=.25)<1?O(v,0,1):Math.pow(v,1))>0?v*f:0,A=(b=b<1?O(b,0,1):Math.pow(b,1))>0?b*g:0,S=this.getView(),w=S.length();S.normalize(),S.clone().cross(e.up).normalize();var M=h.clone().multiplyScalar(h.clone().dot(S)),T=c.clone().multiplyScalar(c.clone().dot(S)).clone().add(M);T=T.clone().length()>a?T.normalize():e.up;var C=A*(1*this.walkMultiplier),P=T,D=Math.cos(.65);1!=D&&(l.clone().dot(e.up)<-a&&l.clone().dot(S)<-D||l.clone().dot(e.up)>a&&l.clone().dot(S)>D)&&(P=-P);var L=-E*this.walkMultiplier*.05,I=e.up;(l.clone().dot(e.up)<-a||Math.abs(l.clone().dot(e.up))<a&&l.clone().dot(S)>a)&&(L=-L),I=l;var R=(new n.Quaternion).setFromAxisAngle(I,L);R.normalize(),(S=R.clone().rotate(S)).normalize(),e.up.copy(R.clone().rotate(e.up)),e.up.normalize(),e.position.add(P.clone().multiplyScalar(C)),this.center.copy(e.position.clone().add(S.clone().multiplyScalar(w))),(P=l).normalize(),0===C&&(C=.01),e.lookAt(this.center),m(!1)}},this.updown=function(t){if(!this.navApi.getIsLocked()){var i=z(t);o.m_amount+=i;var r=new n.Vector3(0,1,0),s=o.saveEye.clone().sub(r.clone().multiplyScalar(o.m_amount)),a=s.clone().dot(r);e.position.copy(s),a<o.minSceneBound&&e.position.add(r.clone().multiplyScalar(o.minSceneBound-a)),a>o.maxSceneBound&&e.position.add(r.clone().multiplyScalar(o.maxSceneBound-a)),this.center.copy(e.position.clone().add(o.saveCenter.clone().sub(o.saveEye))),e.lookAt(this.center),m(!1)}}}o.GlobalManagerMixin.call(h.prototype)},93642:(e,t,i)=>{"use strict";const{getGlobal:n}=i(16840),r=n();function o(){this.stop=null,this.isRunning=!0}function s(e,t,i,n,s){var a=performance.now(),l=1e3*i,c=0,h=new o;h.stop=function(){c&&r.cancelAnimationFrame(c),h.isRunning=!1},h.skip=function(){h.isRunning&&(n(t),h.stop(),s&&s())};var u=function(i){var o=(i-a)/l;o=Math.max(o,0),o=Math.min(o,1),n(e+o*(t-e)),o<1?c=r.requestAnimationFrame(u):(h.isRunning=!1,s&&s())};return u(a),h}function a(e,t,i){return(1-i)*e+i*t}function l(e){return THREE.Math.smootherstep(e,0,1)}function c(e){var t=new THREE.Vector3,i=new THREE.Vector3,n=new THREE.Vector3,r=new THREE.Vector3,o=new THREE.Vector3,s=new THREE.Vector3,c=0,h=0,u=new THREE.Quaternion,d=new THREE.Quaternion,p=new THREE.Vector3,f=new THREE.Quaternion,m=new THREE.Object3D;new THREE.Matrix4;function g(e,t,i,n){Autodesk.Viewing.Navigation.prototype.orient(m,i,t,n),e.copy(m.quaternion)}function v(){g(u,t,i,n),g(d,r,o,s)}this.init=function(e,a,l,u){let d=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];t.copy(e.position),i.copy(e.target),n.copy(d?e.worldup:e.up),r.copy(a),o.copy(l),s.copy(d?e.worldup:u),c=t.distanceTo(i),h=r.distanceTo(o),v()},this.updateCamera=function(e,i){var n=l(e);i.position.lerpVectors(t,r,n),f.slerpQuaternions(u,d,n),f.normalize();var o=a(c,h,n);!function(e,t,i){p.set(0,0,-i).applyQuaternion(t),e.target.addVectors(e.position,p),p.set(0,1,0).applyQuaternion(t),e.up.copy(p)}(i,f,o),i.dirty=!0},this.updateViewerCamera=function(e,t){this.updateCamera(e,t.impl.camera),t.impl.syncCamera(),t.impl.invalidate(!0,!0)}}var h;e.exports={flyToView:function(e,t,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];h||(h=new c),i=i||2;var o=e.impl.camera;h.init(o,t.position,t.target,t.up,r);var a=function(t){h.updateViewerCamera(t,e)};return s(0,1,i,a,n)},ShadowFader:function(e,t,i){var n=1,r=null,o=t,a=void 0,l=i;function c(t){n=t,e.impl.setGroundShadowAlpha(t)}function h(){r=null,l&&l(a)}this.shadowOn=function(){r&&a||(r&&!a&&(r.stop(),r=null),n>=1||(r=s(n,1,o*(1-n),c,h),a=!0))},this.shadowOff=function(){r&&!a||(r&&a&&(r.stop(),r=null),n<=0||(r=s(n,0,o*n,c,h),a=!1))},this.isFading=function(){return r&&r.isRunning}},lerp:a,smootherStep:l,fadeValue:s,AnimatedParam:class{constructor(e,t,i){this.setValueCb=t,this.animTime=i,this.fadeAnim=null,this.targetValue=e,this.curValue=e,t(e),this.pendingFinishedCallbacks=[]}stopAnim(){this.fadeAnim&&(this.fadeAnim.stop(),this.fadeAnim=null)}_onAnimEnded(){this.pendingFinishedCallbacks.forEach((e=>e())),this.pendingFinishedCallbacks.length=0}fadeTo(e,t){const i=this.fadeAnim&&this.fadeAnim.isRunning;if(!i&&this.curValue==e)return void(t&&t());if(t&&this.pendingFinishedCallbacks.push(t),i&&e===this.targetValue)return;this.stopAnim();this.targetValue=e,this.fadeAnim=s(this.curValue,this.targetValue,this.animTime,(e=>{e=l(e),this.curValue=e,this.setValueCb(e)}),(()=>this._onAnimEnded()))}skipAnim(){this.fadeAnim&&this.fadeAnim.skip()}setValue(e){this.stopAnim(),this.curValue=e,this.setValueCb(e)}}}},41099:(e,t,i)=>{"use strict";function n(e,t){try{WebAssembly.instantiateStreaming||(WebAssembly.instantiateStreaming=async(e,t)=>{const i=await(await e).arrayBuffer();return await WebAssembly.instantiate(i,t)})}catch(e){throw new Error("WebAssembly is not supported for the current browser.")}if(!e)throw new Error("Expecting a wasm file path.");let i=256,n=256;t&&t.memory&&(i=t.memory.initial,n=t.memory.maximum),this._wasmPath=e,this._memory=new WebAssembly.Memory({initial:i,maximum:n})}i.r(t),i.d(t,{Wasm:()=>n}),n.prototype.constructor=n,n.prototype.instantiate=function(){const e={env:{abortStackOverflow:e=>{throw new Error("overflow")},table:new WebAssembly.Table({initial:0,maximum:0,element:"anyfunc"}),__table_base:0,memory:this._memory,__memory_base:1024,STACKTOP:0,STACK_MAX:this.getBuffer().byteLength}};return new Promise(((t,i)=>{try{WebAssembly.instantiateStreaming(fetch(this._wasmPath),e).then((e=>{const i=e.instance.exports;this.proxy=i,t(i)}))}catch(e){i(e)}}))},n.prototype.getBuffer=function(){return this._memory.buffer}},29996:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DataTextureSingleChannelFormat:()=>h,ENABLE_PIXEL_CULLING:()=>f,GEOMETRY_OVERHEAD:()=>d,GPU_MEMORY_LIMIT:()=>s,GPU_OBJECT_LIMIT:()=>a,PIXEL_CULLING_THRESHOLD:()=>p,USE_VAO:()=>u,disableGpuObjectLimit:()=>l,memoryOptimizedLoading:()=>o,useGpuGeometryList:()=>c});var n=i(41434),r=i(16840);let o=!0,s=1024*((0,r.isMobileDevice)()?64:256)*1024,a=(0,r.isMobileDevice)()?2500:1e4;const l=function(){a=4294967295};let c=!1,h=n.LuminanceFormat;c=!1;let u=!(0,r.isMobileDevice)();const d=336,p=.75,f=!0},18745:(e,t,i)=>{"use strict";i.d(t,{Q:()=>l});var n=i(41434),r=i(59047),o=i.n(r),s=i(2867),a=i.n(s);let l={uniforms:{color1:{type:"v3",value:new n.Vector3(41/255,76/255,120/255)},color2:{type:"v3",value:new n.Vector3(1/255,2/255,3/255)},opacity:{type:"f",value:1},envMap:{type:"t",value:null},envRotationSin:{type:"f",value:0},envRotationCos:{type:"f",value:1},exposureBias:{type:"f",value:1},envMapExposure:{type:"f",value:1},uCamDir:{type:"v3",value:new n.Vector3},uCamUp:{type:"v3",value:new n.Vector3},uResolution:{type:"v2",value:new n.Vector2(600,400)},uHalfFovTan:{type:"f",value:.5},envMapBackground:{type:"i",value:0},backgroundTexture:{type:"t",value:null}},vertexShader:o(),fragmentShader:a()}},81212:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BasicShader:()=>c});var n=i(41434),r=i(83539),o=i(75101),s=i.n(o),a=i(48544),l=i.n(a);let c={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,n.UniformsLib.shadowmap,r.ShaderChunks.CutPlanesUniforms,r.ShaderChunks.IdUniforms,r.ShaderChunks.ThemingUniform,r.ShaderChunks.PointSizeUniforms,r.ShaderChunks.WideLinesUniforms,r.ShaderChunks.DepthTextureTestUniforms]),vertexShader:s(),fragmentShader:l()};n.ShaderLib.firefly_basic=c},68539:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CelShader:()=>c});var n=i(41434),r=i(83539),o=i(66209),s=i.n(o),a=i(40518),l=i.n(a);let c={uniforms:n.UniformsUtils.merge([r.ShaderChunks.DepthTextureUniforms,{tDiffuse:{type:"t",value:null},tID:{type:"t",value:null},resolution:{type:"v2",value:new n.Vector2(1/1024,1/512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},tFill:{type:"t",value:null},tPaper:{type:"t",value:null},style:{type:"i",value:0},idEdges:{type:"i",value:1},normalEdges:{type:"i",value:1},depthEdges:{type:"i",value:1},brightness:{type:"f",value:0},contrast:{type:"f",value:0},grayscale:{type:"i",value:0},preserveColor:{type:"i",value:0},levels:{type:"f",value:6},repeats:{type:"f",value:3},rotation:{type:"f",value:0},outlineRadius:{type:"f",value:1},outlineNoise:{type:"i",value:0},tGraphite1:{type:"t",value:null},tGraphite2:{type:"t",value:null},tGraphite3:{type:"t",value:null},tGraphite4:{type:"t",value:null},tGraphite5:{type:"t",value:null},tGraphite6:{type:"t",value:null},tGraphite7:{type:"t",value:null},tGraphite8:{type:"t",value:null}}]),vertexShader:s(),fragmentShader:l()}},54924:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CopyShader:()=>a});var n=i(66209),r=i.n(n),o=i(67086),s=i.n(o);let a={uniforms:{tDiffuse:{type:"t",value:null}},vertexShader:r(),fragmentShader:s()}},50437:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CreateCubeMapFromColors:()=>s,DecodeEnvMap:()=>p});var n=i(41434),r=i(51044),o=i(49720);function s(e,t){for(var i=255*e.x,r=255*e.y,o=255*e.z,s=255*t.x,a=255*t.y,l=255*t.z,c=new Uint8Array(16),h=new Uint8Array(16),u=new Uint8Array(16),d=0;d<4;d++)c[4*d]=i,c[4*d+1]=r,c[4*d+2]=o,c[4*d+3]=255,h[4*d]=s,h[4*d+1]=a,h[4*d+2]=l,h[4*d+3]=255,d>1?(u[4*d]=i,u[4*d+1]=r,u[4*d+2]=o,u[4*d+3]=255):(u[4*d]=s,u[4*d+1]=a,u[4*d+2]=l,u[4*d+3]=255);var p=new n.DataTexture(u,2,2,n.RGBAFormat),f=new n.DataTexture(u,2,2,n.RGBAFormat),m=new n.DataTexture(h,2,2,n.RGBAFormat),g=new n.DataTexture(c,2,2,n.RGBAFormat),v=new n.DataTexture(u,2,2,n.RGBAFormat),y=new n.DataTexture(u,2,2,n.RGBAFormat),b=new n.Texture(null,n.CubeReflectionMapping,n.RepeatWrapping,n.RepeatWrapping,n.LinearFilter,n.LinearFilter,n.RGBAFormat);return b.image=[f,p,g,m,y,v],b.needsUpdate=!0,b}var a=[6.0014,-2.7008,-1.7996,-1.332,3.1029,-5.7721,.3008,-1.0882,5.6268];function l(e,t){var i=255*t[2]+t[3],n=Math.pow(2,(i-127)/2),r=n/t[1],o=t[0]*r,s=a[0]*o+a[3]*n+a[6]*r,l=a[1]*o+a[4]*n+a[7]*r,c=a[2]*o+a[5]*n+a[8]*r;s<0&&(s=0),l<0&&(l=0),c<0&&(c=0),e[0]=s,e[1]=l,e[2]=c}function c(e,t,i){var n=.0625*Math.sqrt(t[0]*i),r=.0625*Math.sqrt(t[1]*i),o=.0625*Math.sqrt(t[2]*i),s=Math.max(Math.max(n,r),Math.max(o,1e-6));s>1&&(s=1);var a=Math.ceil(255*s)/255;n>1&&(n=1),r>1&&(r=1),o>1&&(o=1),e[3]=a;var l=1/a;e[0]=n*l,e[1]=r*l,e[2]=o*l}function h(e,t,i){var n=Math.sqrt(t[0]*i),r=Math.sqrt(t[1]*i),o=Math.sqrt(t[2]*i),s=65504;n>s&&(n=s),r>s&&(r=s),o>s&&(o=s),e[0]=n,e[1]=r,e[2]=o}var u=new Float32Array(4),d=new Float32Array(4);function p(e,t,i,s){if(e.LogLuv){for(var a=Math.pow(2,t),p=Array.isArray(e.image)?e.image:[e.image],f=0;f<p.length;f++)for(var m=p[f],g=0;g<m.mipmaps.length;g++){var v,y=m.mipmaps[g],b=y.data;i?(v=new Uint16Array(b.length/4*3),y.data=v):v=b.buffer;for(var x=0,_=0;_<b.length;_+=4)u[0]=b[_]/255,u[1]=b[_+1]/255,u[2]=b[_+2]/255,u[3]=b[_+3]/255,l(d,u),i?(h(u,d,a),v[x++]=(0,r.FloatToHalf)(u[0]),v[x++]=(0,r.FloatToHalf)(u[1]),v[x++]=(0,r.FloatToHalf)(u[2])):(c(u,d,a),b[_]=Math.round(255*u[0]),b[_+1]=Math.round(255*u[1]),b[_+2]=Math.round(255*u[2]),b[_+3]=Math.round(255*u[3]))}e.LogLuv=!1,i?(e.type=n.HalfFloatType,e.format=n.RGBFormat,e.RGBM=!1,e.GammaEncoded=!0):e.RGBM=!0,s&&s(e)}else o.logger.warn("Environment map expected to be in LogLuv format.")}},49310:(e,t,i)=>{"use strict";i.d(t,{D:()=>h});var n=i(41434),r=i(3911),o=i.n(r),s=i(93285),a=i.n(s),l=i(29480),c={uniforms:{tDiffuse:{type:"t",value:null},uColor:{type:"v4",value:new n.Vector4(1,1,1,1)}},vertexShader:o(),fragmentShader:a()};let h=function(e,t,i,r,o){var s,a,h,u=e,d=t,p=i||3,f=r||1,m=o.hasAlpha||!1,g=o.blending||!1,v=o.flipUV||!1;this.render=function(e,t,i){s.render(e,h,i),a.render(e,t,h)},this.setSize=function(e,t){this.cleanup(),u=e,d=t,(h=new n.WebGLRenderTarget(e,t,{minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:void 0!==o.format?o.format:n.RGBAFormat,type:void 0!==o.type?o.type:n.UnsignedByteType,stencilBuffer:!1})).texture.generateMipmaps=!1,s.material.defines.KERNEL_SCALE_H=a.material.defines.KERNEL_SCALE_H=(f/u).toFixed(4),s.material.defines.KERNEL_SCALE_V=a.material.defines.KERNEL_SCALE_V=(f/d).toFixed(4),s.material.needsUpdate=a.material.needsUpdate=!0},this.cleanup=function(){h&&h.dispose()},this.setColor=function(e){a.material.uniforms.uColor.value.x=e.r,a.material.uniforms.uColor.value.y=e.g,a.material.uniforms.uColor.value.z=e.b},this.setAlpha=function(e){a.material.uniforms.uColor.value.w=e},s=new l.ShaderPass(c),a=new l.ShaderPass(c),this.setSize(e,t),s.material.blending=a.material.blending=n.NoBlending,s.material.depthWrite=a.material.depthWrite=!1,s.material.depthTest=a.material.depthTest=!1,s.material.defines.HORIZONTAL=1,s.material.defines.KERNEL_RADIUS=a.material.defines.KERNEL_RADIUS=p.toFixed(1),g&&(a.material.transparent=!0,a.material.blending=n.NormalBlending),m&&(s.material.defines.HAS_ALPHA=a.material.defines.HAS_ALPHA=""),v&&(s.material.defines.FLIP_UV="")}},70209:(e,t,i)=>{"use strict";i.d(t,{S:()=>n});class n{needsClear(e,t){if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e[i]!=t[i])return!0}}},419:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GroundFlags:()=>n});var n={GROUND_UNFINISHED:0,GROUND_FINISHED:1,GROUND_RENDERED:2}},76428:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GroundReflection:()=>f});var n=i(29480),r=i(49310),o=i(18745),s=i(66209),a=i.n(s),l=i(24687),c=i.n(l),h=i(70209),u=i(419),d=i(41434),p={uniforms:{tDiffuse:{type:"t",value:null}},vertexShader:a(),fragmentShader:c()};let f=function(e,t,i,s){var a,l,c,h,f,m,g=e,v=g.getContext(),y=t||512,b=i||512,x=!1,_=new d.Color(0,0,0),E=!1,A=!1;this.inTarget=void 0,this.outTarget=void 0;var S,w,M,T,C,P=!0,D=u.GroundFlags.GROUND_UNFINISHED,L={color:new d.Color(1,1,1),alpha:.3,texScale:.5,blurRadius:2,blurTexScale:.5,fadeAngle:Math.PI/18};if(this.setTransform=function(e,t,i){h=e,c.normal=t,c.constant=-e.dot(t)},this.cleanup=function(){a&&a.cleanup(),this.inTarget&&this.inTarget.dispose(),this.outTarget&&this.outTarget.dispose()},this.setSize=function(e,t){y=e,b=t,this.cleanup(),this.inTarget=new d.WebGLRenderTarget(y*L.texScale,b*L.texScale,{magFilter:d.LinearFilter,minFilter:d.LinearFilter,format:d.RGBAFormat,stencilBuffer:!1}),this.inTarget.texture.generateMipmaps=!1,this.inTarget.name="GroundReflection inTarget",this.outTarget=new d.WebGLRenderTarget(y*L.texScale,b*L.texScale,{magFilter:d.LinearFilter,minFilter:d.LinearFilter,format:d.RGBAFormat,stencilBuffer:!1}),this.outTarget.texture.generateMipmaps=!1,this.outTarget.name="GroundReflection outTarget",a?a.setSize(y*L.texScale*L.blurTexScale,b*L.texScale*L.blurTexScale):a=new r.D(y*L.texScale*L.blurTexScale,b*L.texScale*L.blurTexScale,L.blurRadius,1,{hasAlpha:!0,blending:!0,flipUV:!0})},this.updateCamera=function(e){var t;t=e.isPerspective?h.clone():e.target.clone();var i=e.position.clone().sub(t).normalize(),n=Math.PI/2-i.angleTo(c.normal);if(!(x=n<0)){if(L.fadeAngle>0){var r=Math.min(L.fadeAngle,n)/L.fadeAngle;a.setAlpha(r*L.alpha)}var o,s,l,u=(s=(o=c).normal,l=o.constant,(new d.Matrix4).set(1-2*s.x*s.x,-2*s.y*s.x,-2*s.x*s.z,-2*l*s.x,-2*s.x*s.y,1-2*s.y*s.y,-2*s.y*s.z,-2*l*s.y,-2*s.x*s.z,-2*s.y*s.z,1-2*s.z*s.z,-2*l*s.z,0,0,0,1));(f=e.clone()).applyMatrix4(u),f.projectionMatrix.elements[5]*=-1,f.matrixWorldNeedsUpdate=!0,e.worldUpTransform?f.worldUpTransform=e.worldUpTransform.clone():f.worldUpTransform=new d.Matrix4}},this.renderIntoReflection=function(e){x||(g.setRenderTarget(this.inTarget),g.render(e,f))},this.prepareGroundReflection=(w=[],M=0,T=0,C=0,function(e,t,i,n,r,o){var s=t.modelQueue();if(D!==u.GroundFlags.GROUND_UNFINISHED||s.isEmpty())return D=u.GroundFlags.GROUND_FINISHED,r;const a=s.getGeomScenesPerModel();if(P=this.needsClear(w,a)||P){if(P=!1,this.updateCamera(t.camera),this.isGroundCulled())return D=u.GroundFlags.GROUND_FINISHED,r;this.clear(),w=a,S=s.getGeomScenes(),M=S.length,T=0,C=n?Math.max(Math.ceil(M/100),n):M,D=u.GroundFlags.GROUND_UNFINISHED}else{if(D!==u.GroundFlags.GROUND_UNFINISHED)return D=u.GroundFlags.GROUND_FINISHED,r;0===n&&(C=M)}var l,c,h;r&&(l=performance.now(),c=(o=void 0===o?1:o)*r);for(var d=0;d<C&&T<M;){var p=S[T++];if(p&&(d++,p.forceVisible=!0,this.renderIntoReflection(p),p.forceVisible=!1,r)){var f=performance.now()-l;if(c<f&&T<M){D=u.GroundFlags.GROUND_UNFINISHED,h=r-f;break}}}return T<M&&(D=u.GroundFlags.GROUND_UNFINISHED,h=r?r-performance.now()+l:1),void 0===h||i?(this.postprocess(t.camera,t.matman()),e&&e.enabled&&t.renderGroundShadow(this.outTarget),this.renderReflection(t.camera,t.renderer().getColorTarget()),void 0===h&&(D=u.GroundFlags.GROUND_RENDERED),r?r-performance.now()+l:1):h}),this.renderReflection=function(e,t){x||(v.depthRange(.999999,1),l.render(g,t,this.outTarget),v.depthRange(0,1))},this.toggleEnvMapBackground=function(e){A=e,m.uniforms.envMapBackground.value=e},this.postprocess=function(e){if(!x){if(E||A){const t=m.uniforms.uCamDir.value||new d.Vector3;m.uniforms.uCamDir.value=e.worldUpTransform?e.getWorldDirection(t).applyMatrix4(e.worldUpTransform):e.getWorldDirection(t),m.uniforms.uCamUp.value=e.worldUpTransform?e.up.clone().applyMatrix4(e.worldUpTransform):e.up,m.uniforms.uResolution.value.set(y,b),m.uniforms.uHalfFovTan.value=Math.tan(d.Math.degToRad(.5*e.fov)),m.render(g,this.outTarget),g.setRenderTarget(this.outTarget),g.clear(!1,!0,!1)}else g.setClearColor(_,1),g.setRenderTarget(this.outTarget),g.clear(!0,!0,!1);a.render(g,this.outTarget,this.inTarget)}},this.clear=function(){g.setClearColor(_,0),g.setRenderTarget(this.inTarget),g.clear(!0,!0,!1),g.clearBlend()},this.setClearColors=function(e,t,i){t?(_.setRGB(.5*(e.x+t.x),.5*(e.y+t.y),.5*(e.z+t.z)),E=!e.equals(t)&&!i):(_.copy(e),E=!1),E&&(m.uniforms.color1.value.copy(e),m.uniforms.color2.value.copy(t))},this.setEnvRotation=function(e){m.material.envRotationSin=Math.sin(e),m.material.envRotationCos=Math.cos(e)},this.isGroundCulled=function(){return x},this.getStatus=function(){return D},this.setDirty=function(){P=!0,D=u.GroundFlags.GROUND_UNFINISHED},this.setColor=function(e){a.setColor(L.color),L.color.set(e)},this.setAlpha=function(e){a.setAlpha(L.alpha),L.alpha=e},s)for(var I in L)L[I]=void 0!==s[I]?s[I]:L[I];(l=new n.ShaderPass(p)).material.blending=d.NoBlending,l.material.depthTest=!0,l.material.depthWrite=!1,l.scene.position.z=-.999999,s.clearPass?m=s.clearPass:((m=new n.ShaderPass(o.Q)).material.blending=d.NoBlending,m.material.depthWrite=!1,m.material.depthTest=!1),this.setSize(y,b),a.setAlpha(L.color),a.setAlpha(L.alpha),c=new d.Plane(new d.Vector3(0,1,0),0),h=new d.Vector3(0,0,0)};f.prototype=h.S.prototype,f.prototype.constructor=f},40424:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GroundShadow:()=>O,createGroundShape:()=>I,setGroundShapeTransform:()=>R});var n=i(38074),r=i(29480),o=i(40520),s=i.n(o),a=i(57165),l=i.n(a),c=i(66209),h=i.n(c),u=i(24009),d=i.n(u),p=i(8242),f=i.n(p),m=i(14810),g=i.n(m),v=i(70209),y=i(419),b=i(29996),x=i(10834),_=i(39651),E=i(41723),A=i(41434);var S={uniforms:{cutplanes:{type:"v4v",value:[]}},vertexShader:s(),fragmentShader:l()},w={uniforms:{tDepth:{type:"t",value:null},worldSize:{type:"v3",value:new A.Vector3(1,1,1)}},defines:{},vertexShader:h(),fragmentShader:d()},M={uniforms:{tDepth:{type:"t",value:null}},defines:{},vertexShader:h(),fragmentShader:f()},T={uniforms:{tDepth:{type:"t",value:null},uShadowColor:{type:"v4",value:new A.Vector4(0,0,0,1)}},vertexShader:h(),fragmentShader:g()};let C,P,D,L=new _.LmvBox3;function I(e){var t=new A.PlaneBufferGeometry(1,1);if(t.index.array.reverse)t.index.array.reverse();else for(var i,n=t.index.array,r=Math.floor(n.length/2),o=0,s=n.length;o<r;++o)i=n[o],n[o]=n[s-1-o],n[s-1-o]=i;return new A.Mesh(t,e)}function R(e,t,i,n,r){C||(C=new A.Matrix4),P||(P=new A.Vector3),D||(D=new A.Vector3),P.subVectors(t,n),C.lookAt(P,t,r),D.copy(n).multiplyScalar(-.5*i.y).add(t),e.position.copy(D),e.rotation.setFromRotationMatrix(C),e.scale.set(i.z,i.x,i.y)}function O(e,t){var i,o=e;const s=new x.FrustumIntersector;var a,l,c,h,u,d,p,f,m,g,v,_,C,P,D,O,N,k,F,V=!1,U=!0,B=y.GroundFlags.GROUND_FINISHED,z={texSize:64,pixScale:1,blurRadius:7,debug:!1};if(this.setTransform=(v=new A.Vector3(0,0,0),_=new A.Vector3(0,0,0),C=new A.Vector3(0,0,0),P=new A.Vector3(0,0,0),function(e,t,n,r){e.equals(v)&&t.equals(_)&&n.equals(C)&&r.equals(P)||(v.copy(e),_.copy(t),C.copy(n),P.copy(r),this.setDirty(),i.left=-t.z/2,i.right=t.z/2,i.top=t.x/2,i.bottom=-t.x/2,i.near=1,i.far=t.y+i.near,i.updateProjectionMatrix(),R(l,e,t,n,r),i.position.addVectors(e,n.clone().multiplyScalar(-t.y/2-i.near)),r&&i.up.set(r.x,r.y,r.z),i.lookAt(e),z.debug&&(g.position.set(e.x,e.y,e.z),g.rotation.set(i.rotation.x,i.rotation.y,i.rotation.z),g.scale.set(t.z,t.x,t.y)),m.uniforms.worldSize.value.copy(t),i.orthoScale=t.x,i.clientHeight=z.texSize,s.reset(i),s.areaCullThreshold=2)}),this.renderIntoShadow=function(e){if(!e.overrideMaterial||!e.overrideMaterial.transparent){e.forEachNoMesh&&b.ENABLE_PIXEL_CULLING&&(e.forEachNoMesh((t=>{e.frags.getWorldBounds(t,L);const i=e.frags.vizflags[t]&E.MeshFlags.MESH_VISIBLE,n=s.estimateProjectedDiameter(L)<s.areaCullThreshold;e.frags.setFlagFragment(t,E.MeshFlags.MESH_RENDERFLAG,i&&!n)})),e.forceVisible=!1);var t=e.overrideMaterial;e.overrideMaterial=u,o.setRenderTarget(c),o.render(e,i),e.overrideMaterial=t}},this.prepareGroundShadow=(O=[],N=0,k=0,F=0,function(e,t,i,n){if(!this.enabled||e.isEmpty())return B=y.GroundFlags.GROUND_FINISHED,i;const r=e.getGeomScenesPerModel();if(U=this.needsClear(O,r)||U)this.clear(),U=!1,O=r,D=e.getGeomScenes(),N=D.length,k=0,F=t?Math.max(Math.ceil(N/100),t):N;else{if(B===y.GroundFlags.GROUND_RENDERED||B===y.GroundFlags.GROUND_FINISHED)return B=y.GroundFlags.GROUND_FINISHED,i;0===t&&(F=N)}var o,a,l;i&&(o=performance.now(),a=(n=void 0===n?1:n)*i);for(var c=0;c<F&&k<N;){var h=D[k++];if(h&&(!(b.ENABLE_PIXEL_CULLING&&h.getBoundingBox&&s.estimateProjectedDiameter(h.getBoundingBox())<s.areaCullThreshold)&&(c++,h.forceVisible=!0,this.renderIntoShadow(h),h.forceVisible=!1,i))){var u=performance.now()-o;if(a<u){B=y.GroundFlags.GROUND_UNFINISHED,l=i-u;break}}}return k<N&&(B=y.GroundFlags.GROUND_UNFINISHED,l=i?i-performance.now()+o:1),void 0!==l?l:(this.postprocess(),B=y.GroundFlags.GROUND_RENDERED,i?i-performance.now()+o:1)}),this.renderShadow=function(e,t){V&&(t&&o.setRenderTarget(t),o.render(a,e))},this.postprocess=function(){f.render(o,h,c),p.render(o,c,h),V=!0},this.clear=function(){var e=o.getClearColor(new A.Color).getHex(),t=o.getClearAlpha();o.setClearColor(0,0),o.setRenderTarget(c),o.clear(!0,!0,!1),o.setClearColor(e,t),o.clearBlend(),V=!1},this.setColor=function(e){d.uniforms.uShadowColor.value.x=e.r,d.uniforms.uShadowColor.value.y=e.g,d.uniforms.uShadowColor.value.z=e.b},this.getColor=function(){return new A.Color(d.uniforms.uShadowColor.value.x,d.uniforms.uShadowColor.value.y,d.uniforms.uShadowColor.value.z)},this.setAlpha=function(e){d.uniforms.uShadowColor.value.w=e},this.getAlpha=function(){return d.uniforms.uShadowColor.value.w},this.isValid=function(){return V},this.getStatus=function(){return B},this.setDirty=function(){U=!0,B=y.GroundFlags.GROUND_UNFINISHED},this.getDepthMaterial=function(){return u},t)for(var G in z)z[G]=t[G]||z[G];a=new A.Scene,i=new A.OrthographicCamera,(c=new A.WebGLRenderTarget(z.texSize,z.texSize,{minFilter:A.LinearFilter,magFilter:A.LinearFilter,format:A.RGBAFormat,stencilBuffer:!1})).texture.generateMipmaps=!1,c.name="GroundShadow targetH",(h=new A.WebGLRenderTarget(z.texSize,z.texSize,{minFilter:A.LinearFilter,magFilter:A.LinearFilter,format:A.RGBAFormat,stencilBuffer:!1})).texture.generateMipmaps=!1,h.name="GroundShadow targetV",(u=(0,n.createShaderMaterial)(S)).type="GroundDepthShader",u.side=A.DoubleSide,u.blending=A.NoBlending,p=new r.ShaderPass(M,"tDepth"),f=new r.ShaderPass(M,"tDepth"),m=new r.ShaderPass(w,"tDepth"),p.material.defines.KERNEL_SCALE=f.material.defines.KERNEL_SCALE=(z.pixScale/z.texSize).toFixed(4),p.material.defines.KERNEL_RADIUS=f.material.defines.KERNEL_RADIUS=z.blurRadius.toFixed(2),m.material.blending=p.material.blending=f.material.blending=A.NoBlending,m.material.depthWrite=p.material.depthWrite=f.material.depthWrite=!1,m.material.depthTest=p.material.depthTest=f.material.depthTest=!1,p.material.defines.HORIZONTAL=1,(d=(0,n.createShaderMaterial)(T)).uniforms.tDepth.value=c.texture,d.depthWrite=!1,d.transparent=!0,l=I(d),a.add(l),z.debug&&(g=new A.Mesh(new A.BoxGeometry(1,1,1),new A.MeshBasicMaterial({color:65280,wireframe:!0})),a.add(g)),this.setTransform(new A.Vector3(0,0,0),new A.Vector3(1,1,1),new A.Vector3(0,1,0),A.Object3D.DefaultUp)}O.prototype=v.S.prototype,O.prototype.constructor=O},51044:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FloatToHalf:()=>a,HALF_INT_MAX:()=>c,HalfTest:()=>d,HalfToFloat:()=>l,HalfToInt:()=>u,IntToHalf:()=>h});var n=new Float32Array(1),r=new Uint32Array(n.buffer),o=new Uint16Array(1),s=new Uint16Array(1);let a=function(e){n[0]=e;var t=r[0],i=0;if(0==(2147483647&t))s[i++]=t>>16;else{var a=2147483648&t,l=2139095040&t,c=8388607&t;if(0===l)s[i++]=a>>16;else if(2139095040==l)s[i++]=0===c?a>>16|31744:65024;else{var h,u,d=a>>16,p=(0|l>>23)-127+15;p>=31?s[i++]=a>>16|31744:p<=0?(14-p>24?h=0:(h=(c|=8388608)>>14-p,o[0]=h,h=o[0],c>>13-p&1&&(h+=1)),s[i++]=d|h):(u=p<<10,o[0]=u,u=o[0],h=c>>13,o[0]=h,h=o[0],s[i++]=4096&c?1+(d|u|h):d|u|h)}}return s[0]},l=function(e){var t,i=65535&e;if(0==(32767&i))t=i<<16;else{var o=32768&i,s=31744&i,a=1023&i;if(0===s){var l=-1;do{l++,a<<=1}while(0==(1024&a));var c=o<<16,h=(s<<16>>26)-15+127-l,u=h<<23,d=(1023&a)<<13;t=c|u|d}else t=31744==s?0===a?o<<16|2139095040:4290772992:(c=o<<16)|(u=(h=(s<<16>>26)-15+127)<<23)|(d=a<<13)}return r[0]=t,n[0]},c=59390,h=function(e){if(e>c-1||e<0)return console.log("out of range"),a(NaN);if(0===e)return 0;var t=!1;e>c/2-1&&(t=!0,e-=c/2-1);var i=0|Math.abs(e/1024),n=Math.pow(2,i-13),r=n+(e-1024*i)*n/1024;return t&&(r=-r),a(r)},u=function(e){if(0===e)return 0;var t=l(e),i=!1;t<0&&(i=!0,t=-t);var n=0|Math.floor(Math.log(t)/Math.log(2)),r=Math.pow(2,n),o=(t-r)/r*1024+1024*(n+13);return i&&(o+=c/2-1),o},d=function(){for(var e=[-1/255,-.17,-75,-1789,-.005],t=0;t<e.length;t++)console.log("input",e[t],"encoded",a(e[t]),"decoded",l(a(e[t])));for(let e=0;e<c;e++){var i=u(h(e));i!==e&&console.log("Roundtrip failed for",e,i)}}},62868:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LMVMaterial:()=>s});var n=i(41434),r=i(69539),o=function(e,t,i,n,r){var o=n?"1.0-":"",s="texture2D("+e+", (UV))",a="";return r=r||"vec4(0.0)",t&&i?a="((UV).x < 0.0 || (UV).x > 1.0 || (UV).y < 0.0 || (UV).y > 1.0) ? "+r+" : ":t?a="((UV).x < 0.0 || (UV).x > 1.0) ? "+r+" : ":i&&(a="((UV).y < 0.0 || (UV).y > 1.0) ? "+r+" : "),"#define GET_"+e.toUpperCase()+"(UV) ("+a+o+s+")"};class s extends n.ShaderMaterial{constructor(){super(...arguments),this.linewidth=void 0,this.extensions.drawBuffers=!0,this.extensions.derivatives=!0,this.extensions.shaderTextureLOD=!0}refreshUniforms(e){(0,r.HM)(e,this),(0,r.U7)(e,this)}onBeforeCompile(e,t){var i;e.isWebGL2&&(e.glslVersion=n.GLSL3,this.defines._LMVWEBGL2_="",this.defines.gl_FragColor="pc_fragColor"),(e.isWebGL2||e.extensionShaderTextureLOD)&&(this.defines.HAVE_TEXTURE_LOD=""),this.defines.TONEMAP_OUTPUT=`${this.tonemapOutput||0}`,void 0!==this.tonemapOutput&&0!==this.tonemapOutput||t.lmvGammaInput?this.defines.GAMMA_INPUT="":delete this.defines.GAMMA_INPUT,this.defines.NUM_CUTPLANES=this.cutplanes?this.cutplanes.length:0,this.hatchPattern?this.defines.HATCH_PATTERN="":delete this.defines.HATCH_PATTERN,this.vertexIds?this.defines.USE_VERTEX_ID="":delete this.defines.USE_VERTEX_ID,this.packedNormals?this.defines.UNPACK_NORMALS="":delete this.defines.UNPACK_NORMALS,this.mrtNormals?this.defines.MRT_NORMALS="":delete this.defines.MRT_NORMALS,this.mrtIdBuffer?this.defines.MRT_ID_BUFFER="":delete this.defines.MRT_ID_BUFFER,this.mrtIdBuffer>1?this.defines.MODEL_COLOR="":delete this.defines.MODEL_COLOR,this.wideLines?this.defines.WIDE_LINES="":delete this.defines.WIDE_LINES,this.unpackPositions?this.defines.UNPACK_POSITIONS="":delete this.defines.UNPACK_POSITIONS,this.useInstancing?this.defines.USE_LMV_INSTANCING="":delete this.defines.USE_LMV_INSTANCING,this.map&&this.map.invert?this.defines.MAP_INVERT="":delete this.defines.MAP_INVERT,this.useTiling?(this.defines.USE_TILING="",this.defines.TILE_RANGE_X_MIN=this.tilingRepeatRange[0],this.defines.TILE_RANGE_Y_MIN=this.tilingRepeatRange[1],this.defines.TILE_RANGE_X_MAX=this.tilingRepeatRange[2],this.defines.TILE_RANGE_Y_MAX=this.tilingRepeatRange[3]):(delete this.defines.USE_TILING,delete this.defines.TILE_RANGE_X_MIN,delete this.defines.TILE_RANGE_Y_MIN,delete this.defines.TILE_RANGE_X_MAX,delete this.defines.TILE_RANGE_Y_MAX),this.envMap&&this.envMap.RGBM?this.defines.ENV_RGBM="":delete this.defines.ENV_RGBM,this.envMap&&this.envMap.GammaEncoded?this.defines.ENV_GAMMA="":delete this.defines.ENV_GAMMA,this.irradianceMap?this.defines.USE_IRRADIANCEMAP="":delete this.defines.USE_IRRADIANCEMAP,this.irradianceMap&&this.irradianceMap.RGBM?this.defines.IRR_RGBM="":delete this.defines.IRR_RGBM,this.irradianceMap&&this.irradianceMap.GammaEncoded?this.defines.IRR_GAMMA="":delete this.defines.IRR_GAMMA,this.hasRoundCorner?this.defines.USE_TILING_NORMAL="":delete this.defines.USE_TILING_NORMAL,this.useRandomOffset?this.defines.USE_TILING_RANDOM="":delete this.defines.USE_TILING_RANDOM,(null===(i=t.getLoadingAnimationDuration)||void 0===i?void 0:i.call(t))>0?this.defines.LOADING_ANIMATION="":delete this.defines.LOADING_ANIMATION,this.metal?this.defines.METAL="":delete this.defines.METAL,this.useBackgroundTexture?this.defines.USE_BACKGROUND_TEXTURE="":delete this.defines.USE_BACKGROUND_TEXTURE,Autodesk.Viewing.Private.patchShader(e,{fragmentHeader:[e.isWebGL2?"layout(location=0) out highp vec4 pc_fragColor;":"",o("map",e.mapClampS,e.mapClampT),o("bumpMap",e.bumpMapClampS,e.bumpMapClampT),o("normalMap",e.normalMapClampS,e.normalMapClampT),o("specularMap",e.specularMapClampS,e.specularMapClampT),o("alphaMap",e.alphaMapClampS,e.alphaMapClampT,e.alphaMapInvert),"uniform mat4 projectionMatrix;","#if defined(USE_ENVMAP) || defined(USE_IRRADIANCEMAP)","uniform mat4 viewMatrixInverse;","#endif"].join("\n")})}customProgramCacheKey(){var e,t,i,n,r;return[this.tonemapOutput,null===(e=this.renderer)||void 0===e?void 0:e.lmvGammaInput,null===(t=this.cutplanes)||void 0===t?void 0:t.length,this.hatchPattern,!!this.vertexIds,this.packedNormals,this.mrtNormals,this.mrtIdBuffer,this.map&&this.map.invert,this.useTiling,null===(i=this.tilingRepeatRange)||void 0===i?void 0:i.toString(),this.irradianceMap&&this.irradianceMap.RGBM,this.envMap&&this.envMap.RGBM,this.envMap&&this.envMap.GammaEncoded,!!this.irradianceMap,this.hasRoundCorner,this.useRandomOffset,(null===(n=this.renderer)||void 0===n||null===(r=n.getLoadingAnimationDuration)||void 0===r?void 0:r.call(n))>0,this.metal,this.useBackgroundTexture,this.wideLines,this.unpackPositions,this.useInstancing].concat(",")}_updateUniform(e,t){return!(!this.uniforms[e]||this.uniforms[e].value===t)&&(this.uniforms[e].value=t,!0)}get cutplanes(){var e,t;return null===(e=this.uniforms)||void 0===e||null===(t=e.cutplanes)||void 0===t?void 0:t.value}set cutplanes(e){this._updateUniform("cutplanes",e)&&(this.needsUpdate=!0)}get hatchParams(){var e,t;return null===(e=this.uniforms)||void 0===e||null===(t=e.hatchParams)||void 0===t?void 0:t.value}set hatchParams(e){this._updateUniform("hatchParams",e)}get hatchTintColor(){var e,t;return null===(e=this.uniforms)||void 0===e||null===(t=e.hatchTintColor)||void 0===t?void 0:t.value}set hatchTintColor(e){this._updateUniform("hatchTintColor",e)}get hatchTintIntensity(){var e,t;return null===(e=this.uniforms)||void 0===e||null===(t=e.hatchTintIntensity)||void 0===t?void 0:t.value}set hatchTintIntensity(e){this._updateUniform("hatchTintIntensity",e)}}s.prototype.isLmvMaterial=!0},93033:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LMVMesh:()=>r});var n=i(41434);let r;r=n.Mesh},30110:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LMVLineBasicMaterial:()=>r});var n=i(41434);let r;r=n.LineBasicMaterial},10940:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineStyleDefs:()=>r,createLinePatternForDef:()=>l,createLinePatternTexture:()=>a,createLinePatternTextureData:()=>o,createLinePatternTextureFromDefs:()=>s});var n=i(41434);let r=[{id:"SOLID",name:"Solid",ascii_art:"_______________________________________",def:[1]},{id:"BORDER",name:"Border",ascii_art:"__ __ . __ __ . __ __ . __ __ . __ __ .",def:[.5,-.25,.5,-.25,0,-.25]},{id:"BORDER2",name:"Border (.5x)",ascii_art:"__ __ . __ __ . __ __ . __ __ . __ __ .",def:[.25,-.125,.25,-.125,0,-.125]},{id:"BORDERX2",name:"Border (2x)",ascii_art:"____ ____ . ____ ____ . ___",def:[1,-.5,1,-.5,0,-.5]},{id:"CENTER",name:"Center",ascii_art:"____ _ ____ _ ____ _ ____ _ ____ _ ____",def:[1.25,-.25,.25,-.25]},{id:"CENTER2",name:"Center (.5x)",ascii_art:"___ _ ___ _ ___ _ ___ _ ___ _ ___",def:[.75,-.125,.125,-.125]},{id:"CENTERX2",name:"Center (2x)",ascii_art:"________ __ ________ __ _____",def:[2.5,-.5,.5,-.5]},{id:"DASHDOT",name:"Dash dot",ascii_art:"__ . __ . __ . __ . __ . __ . __ . __",def:[.5,-.25,0,-.25]},{id:"DASHDOT2",name:"Dash dot (.5x)",ascii_art:"_._._._._._._._._._._._._._._.",def:[.25,-.125,0,-.125]},{id:"DASHDOTX2",name:"Dash dot (2x)",ascii_art:"____ . ____ . ____ . ___",def:[1,-.5,0,-.5]},{id:"DASHED",name:"Dashed",ascii_art:"__ __ __ __ __ __ __ __ __ __ __ __ __ _",def:[.5,-.25]},{id:"DASHED2",name:"Dashed (.5x)",ascii_art:"_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _",def:[.25,-.125]},{id:"DASHEDX2",name:"Dashed (2x)",ascii_art:"____ ____ ____ ____ ____ ___",def:[1,-.5]},{id:"DIVIDE",name:"Divide",ascii_art:"____ . . ____ . . ____ . . ____ . . ____",def:[.5,-.25,0,-.25,0,-.25]},{id:"DIVIDE2",name:"Divide (.5x)",ascii_art:"__..__..__..__..__..__..__..__.._",def:[.25,-.125,0,-.125,0,-.125]},{id:"DIVIDEX2",name:"Divide (2x)",ascii_art:"________ . . ________ . . _",def:[1,-.5,0,-.5,0,-.5]},{id:"DOT",name:"Dot",ascii_art:". . . . . . . . . . . . . . . . . . . . . . . .",def:[0,-.25]},{id:"DOT2",name:"Dot (.5x)",ascii_art:"........................................",def:[0,-.125]},{id:"DOTX2",name:"Dot (2x)",ascii_art:". . . . . . . . . . . . . .",def:[0,-.5]},{id:"HIDDEN",name:"Hidden",ascii_art:"__ __ __ __ __ __ __ __ __ __ __ __ __ __",def:[.25,-.125]},{id:"HIDDEN2",name:"Hidden (.5x)",ascii_art:"_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _",def:[.125,-.0625]},{id:"HIDDENX2",name:"Hidden (2x)",ascii_art:"____ ____ ____ ____ ____ ____ ____",def:[.5,-.25]},{id:"PHANTOM",name:"Phantom",ascii_art:"______ __ __ ______ __ __ ______",def:[1.25,-.25,.25,-.25,.25,-.25]},{id:"PHANTOM2",name:"Phantom (.5x)",ascii_art:"___ _ _ ___ _ _ ___ _ _ ___ _ _",def:[.625,-.125,.125,-.125,.125,-.125]},{id:"PHANTOMX2",name:"Phantom (2x)",ascii_art:"____________ ____ ____ _",def:[2.5,-.5,.5,-.5,.5,-.5]},{id:"ACAD_ISO02W100",name:"ISO dash",ascii_art:"__ __ __ __ __ __ __ __ __ __ __ __ __",def:[12,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO03W100",name:"ISO dash space",ascii_art:"__ __ __ __ __ __",def:[12,-18],pen_width:1,unit:"mm"},{id:"ACAD_ISO04W100",name:"ISO long-dash dot",ascii_art:"____ . ____ . ____ . ____ . _",def:[24,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO05W100",name:"ISO long-dash double-dot",ascii_art:"____ .. ____ .. ____ .",def:[24,-3,.5,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO06W100",name:"ISO long-dash triple-dot",ascii_art:"____ ... ____ ... ____",def:[24,-3,.5,-3,.5,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO07W100",name:"ISO dot",ascii_art:". . . . . . . . . . . . . . . . . . . .",def:[.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO08W100",name:"ISO long-dash short-dash",ascii_art:"____ __ ____ __ ____ _",def:[24,-3,6,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO09W100",name:"ISO long-dash double-short-dash",ascii_art:"____ __ __ ____",def:[24,-3,6,-3,6,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO10W100",name:"ISO dash dot",ascii_art:"__ . __ . __ . __ . __ . __ . __ . ",def:[12,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO11W100",name:"ISO double-dash dot",ascii_art:"__ __ . __ __ . __ __ . __ _",def:[12,-3,12,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO12W100",name:"ISO dash double-dot",ascii_art:"__ . . __ . . __ . . __ . .",def:[12,-3,.5,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO13W100",name:"ISO double-dash double-dot",ascii_art:"__ __ . . __ __ . . _",def:[12,-3,12,-3,.5,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO14W100",name:"ISO dash triple-dot",ascii_art:"__ . . . __ . . . __ . . . _",def:[12,-3,.5,-3,.5,-3,.5,-3],pen_width:1,unit:"mm"},{id:"ACAD_ISO15W100",name:"ISO double-dash triple-dot",ascii_art:"__ __ . . . __ __ . .",def:[12,-3,12,-3,.5,-3,.5,-3,.5,-3],pen_width:1,unit:"mm"},{id:"FENCELINE1",name:"Fenceline circle",ascii_art:"----0-----0----0-----0----0-----0--",def:[.25,-.1,["CIRC1","ltypeshp.shx","x=-.1","s=.1"],-.1,1]},{id:"FENCELINE2",name:"Fenceline square",ascii_art:"----[]-----[]----[]-----[]----[]---",def:[.25,-.1,["BOX","ltypeshp.shx","x=-.1","s=.1"],-.1,1]},{id:"TRACKS",name:"Tracks",ascii_art:"-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-",def:[.15,["TRACK1","ltypeshp.shx","s=.25"],.15]},{id:"BATTING",name:"Batting",ascii_art:"SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",def:[1e-4,-.1,["BAT","ltypeshp.shx","x=-.1","s=.1"],-.2,["BAT","ltypeshp.shx","r=180","x=.1","s=.1"],-.1]},{id:"HOT_WATER_SUPPLY",name:"Hot water supply",ascii_art:"---- HW ---- HW ---- HW ----",def:[.5,-.2,["HW","STANDARD","S=.1","R=0.0","X=-0.1","Y=-.05"],-.2]},{id:"GAS_LINE",name:"Gas line",ascii_art:"----GAS----GAS----GAS----GAS----GAS----GAS--",def:[.5,-.2,["GAS","STANDARD","S=.1","R=0.0","X=-0.1","Y=-.05"],-.25]},{id:"ZIGZAG",name:"Zig zag",ascii_art:"/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/",def:[1e-4,-.2,["ZIG","ltypeshp.shx","x=-.2","s=.2"],-.4,["ZIG","ltypeshp.shx","r=180","x=.2","s=.2"],-.2]}],o=function(e,t){for(var i=e+3,r=t,o=1;o<i;)o*=2;for(i=o,o=1;o<r;)o*=2;r=o;var s=new Uint8Array(i*r),a=new n.DataTexture(s,i,r,Autodesk.Viewing.Private.DataTextureSingleChannelFormat,n.UnsignedByteType,n.UVMapping,n.ClampToEdgeWrapping,n.ClampToEdgeWrapping,n.NearestFilter,n.NearestFilter,0);return a.generateMipmaps=!1,a.flipY=!1,a.needsUpdate=!0,{tex:s,pw:i,ph:r,lineStyleTex:a}},s=function(e){for(var t=e.length,i=0,n=0;n<t;n++){var r=e[n];r.def.length>i&&(i=r.def.length)}let{tex:s,pw:a,lineStyleTex:c}=o(i,t);for(var h=0;h<t;h++){let t=e[h];l(t,s,h,a)}return c},a=function(){return s(r)},l=function(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:96;for(var o=i*n,s=e.unit&&"mm"==e.unit?1/25.4:1,a=e.pen_width||0,l=e.def,c=0,h=0;h<l.length;h++){var u=Math.abs(l[h]),d=u<=.5*a;d&&(u=0);var p=0|u*r*s;c+=p,t[o+h+2]=p||1}t[o]=c%256,t[o+1]=c/256,t[o+l.length+2]=0}},69539:(e,t,i)=>{"use strict";function n(e,t){e.envMap&&(e.envMap.value=t.envMap),e.irradianceMap&&(e.irradianceMap.value=t.irradianceMap),e.envMapExposure&&(e.envMapExposure.value=t.envMapExposure),e.envRotationSin&&e.envRotationCos&&(e.envRotationSin.value=t.envRotationSin,e.envRotationCos.value=t.envRotationCos)}function r(e,t){e.envMap&&(e.envMap.needsUpdate=t),e.irradianceMap&&(e.irradianceMap.needsUpdate=t),e.envMapExposure&&(e.envMapExposure.needsUpdate=t)}function o(e,t){function i(e,t,i){var n=i.offset,r=i.repeat;if(t){var o=t.value;i.matrix?o.copy(i.matrix):o.identity(),o.elements[6]+=n.x,o.elements[7]+=n.y,o.elements[0]*=r.x,o.elements[3]*=r.x,o.elements[1]*=r.y,o.elements[4]*=r.y}else e.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}var n,r;Object.prototype.hasOwnProperty.call(t,"opacity")&&e.opacity&&(e.opacity.value=t.opacity),t.color&&e.diffuse.value.copy(t.color),t.map&&(e.map.value=t.map),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.specularMap&&(e.specularMap.value=t.specularMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.alphaMap&&i(e,e.texMatrixAlpha,t.alphaMap),t.normalMap?n=t.normalMap:t.bumpMap&&(n=t.bumpMap),void 0!==n&&i(e,e.texMatrixBump,n),t.map?r=t.map:t.specularMap&&(r=t.specularMap),void 0!==r&&i(e,e.texMatrix,r),t.envMap&&(e.envMap.value=t.envMap),e.irradianceMap&&(e.irradianceMap.value=t.irradianceMap),t.reflectivity&&t.envMap&&(e.reflectivity.value=t.reflectivity),t.refractionRatio&&t.envMap&&(e.refractionRatio.value=t.refractionRatio)}i.d(t,{Bl:()=>r,HM:()=>o,U7:()=>n})},64:(e,t,i)=>{"use strict";i.d(t,{I5:()=>r,ZP:()=>n,p1:()=>o});class n{constructor(){this.webglContextId=1}onContextRestored(){this.webglContextId++}refreshTargetIfNeeded(e){this.refreshIfNeeded(e);const t=null==e?void 0:e.shareDepthFrom;this.refreshIfNeeded(t)}refreshTargetsIfNeeded(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.refreshTargetIfNeeded(e[t]);else this.refreshTargetIfNeeded(e)}refreshIfNeeded(e){if(!e||e.__webglContextId===this.webglContextId)return!1;this._refreshGlData(e),e.__webglContextId=this.webglContextId}_refreshGlData(e){e instanceof THREE.Mesh&&this._refreshMeshGlData(e),e instanceof THREE.BufferGeometry&&this._refreshBufferGeometryGlData(e),e instanceof THREE.WebGLRenderTarget&&this._refreshTargetGlData(e),e instanceof THREE.Texture&&this._refreshTextureGlData(e),e instanceof THREE.Material&&this._refreshMaterialGlData(e)}_refreshMeshGlData(e){var t;e.__webglActive&&(e.__webglActive=void 0),null!==(t=e.geometry)&&void 0!==t&&t.__webglInit&&(e.geometry.__webglInit=void 0)}_refreshBufferGeometryGlData(e){e.__webglInit&&(e.__webglInit=void 0,e.needsUpdate=!0),e.vbbuffer&&(e.vbbuffer=void 0,e.needsUpdate=!0),e.ibbuffer&&(e.ibbuffer=void 0,e.needsUpdate=!0),e.iblinesbuffer&&(e.iblinesbuffer=void 0,e.needsUpdate=!0),e.vaos&&(e.vaos=void 0,e.needsUpdate=!0);for(let t in e.attributes){const i=e.attributes[t];i.buffer&&(i.buffer=void 0,e.needsUpdate=!0)}}_refreshTargetGlData(e){e.__webglFramebuffer&&(e.__webglFramebuffer=null),e.__webglRenderbuffer&&(e.__webglRenderbuffer=null),e.__webglBoundBuffers&&(e.__webglBoundBuffers=null),e.__webglTexture&&(e.__webglTexture=null)}_refreshTextureGlData(e){e.__webglInit&&(e.__webglInit=void 0,e.needsUpdate=!0),e.__webglTexture&&(e.__webglTexture=void 0,e.needsUpdate=!0),e.__webglTextureCube&&(e.__webglTextureCube=null,e.needsUpdate=!0)}_refreshMaterialGlData(e){(e.program||e.programs)&&(e.program=null,e.programs=[],e.needsUpdate=!0)}}const r=e=>{const t={};return e.getAllModels().forEach((e=>{e.isConsolidated()&&(e.unconsolidate(),t[e.id]=!0)})),t},o=(e,t)=>{e.getAllModels().forEach((i=>{t[i.id]&&e.impl.consolidateModel(i)}))}},40582:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MaterialConverter:()=>a});var n=i(41434),r=i(11236),o=i(63855);const s=Autodesk.Viewing;let a={convertMaterial:async function(e,t,i,s){if(h(e))return await l(),i=a.convertPrismMaterial(e,t,i,s),e.transparent=i.transparent,i;s=s||e.userassets;var u,d,p=e.materials,f=p[s],m=f.properties;if(i){if(!(i instanceof r.LMVMeshPhongMaterial))return null;i.needsUpdate=!0}else i=new r.LMVMeshPhongMaterial;if(i.proteinMat=e,i.proteinCategories=f.categories,i.packedNormals=!0,f&&"SimplePhong"===f.definition){i.tag=f.tag,i.proteinType=f.proteinType,void 0===i.proteinType&&(i.proteinType=null);var g=(0,o.parseMaterialBoolean)(m,"generic_baked_lighting",!1);i.disableEnvMap=g;var v=i.ambient=(0,o.parseMaterialColor)(m,"generic_ambient"),y=i.color=(0,o.parseMaterialColor)(m,"generic_diffuse"),b=i.specular=(0,o.parseMaterialColor)(m,"generic_specular"),x=i.emissive=(0,o.parseMaterialColor)(m,"generic_emissive");i.shininess=(0,o.parseMaterialScalar)(m,"generic_glossiness",30),i.opacity=1-(0,o.parseMaterialScalar)(m,"generic_transparency",0),i.reflectivity=(0,o.parseMaterialScalar)(m,"generic_reflectivity_at_0deg",0);var _=(0,o.parseMaterialBoolean)(m,"generic_bump_is_normal"),E=(0,o.parseMaterialScalar)(m,"generic_bump_amount",0);null==E&&(E=1),_?(E>1&&(E=1),i.normalScale=new n.Vector2(E,E)):(E>=1&&(E=.03),i.bumpScale=E);var A=(0,o.parseMaterialBoolean)(m,"generic_is_metal");void 0!==A&&(i.metal=A);var S=(0,o.parseMaterialBoolean)(m,"generic_backface_cull");void 0===S||S||(i.side=n.DoubleSide),i.transparent=f.transparent,i.textureMaps={};var w=f.textures;for(var M in w)if((u={}).textureObj=p[w[M].connections[0]],d=u.textureObj.properties,u.textureObj.matrix=c(u.textureObj),u.uriPointer=d.uris.unifiedbitmap_Bitmap.values,u.uri=u.uriPointer[0],u.uri){if("generic_diffuse"==M)u.mapName="map",(!i.color||0===i.color.r&&0===i.color.g&&0===i.color.b)&&i.color.setRGB(1,1,1);else if("generic_bump"==M)u.mapName=_?"normalMap":"bumpMap";else if("generic_specular"==M)u.mapName="specularMap";else{if("generic_alpha"!=M)continue;u.mapName="alphaMap",i.side=n.DoubleSide,i.transparent=!0}i.textureMaps[u.mapName]=u}0===y.r&&0===y.g&&0===y.b&&0===b.r&&0===b.g&&0===b.b&&0===v.r&&0===v.g&&0===v.b&&0===x.r&&0===x.g&&0===x.b&&(y.r=y.g=y.b=.4),i.extraDepthOffset=(0,o.parseMaterialScalar)(m,"generic_depth_offset"),i.extraDepthOffset&&(i.polygonOffset=!0,i.polygonOffsetFactor=i.extraDepthOffset,i.polygonOffsetUnits=0)}else i.ambient=new n.Color(197379),i.color=new n.Color(7829367),i.specular=new n.Color(3355443),i.shininess=30,i.shading=n.SmoothShading;return e.transparent=i.transparent,i},convertTexture:function(e,t,i,r){"bumpMap"==e.mapName||"normalMap"==e.mapName?t.anisotropy=0:t.anisotropy=r||0;t.flipY=void 0===e.flipY||e.flipY,t.invert=!1,t.wrapS=n.RepeatWrapping,t.wrapT=n.RepeatWrapping,e.isPrism?a.convertPrismTexture(e.textureObj,t,i):function(e,t){if(!e)return;var i=e.properties;t.invert=(0,o.parseMaterialBoolean)(i,"unifiedbitmap_Invert"),t.clampS=!(0,o.parseMaterialBoolean)(i,"texture_URepeat",!0),t.clampT=!(0,o.parseMaterialBoolean)(i,"texture_VRepeat",!0),t.wrapS=t.clampS?n.ClampToEdgeWrapping:n.RepeatWrapping,t.wrapT=t.clampT?n.ClampToEdgeWrapping:n.RepeatWrapping,t.matrix=e.matrix||(e.matrix=(0,o.Get2DSimpleMapTransform)(i))}(e.textureObj,t)},isPrismMaterial:h,convertMaterialGltf:function(e,t){var i=new r.LMVMeshPhongMaterial;i.packedNormals=!0,i.textureMaps={},i.reflectivity=0;var o=e.pbrMetallicRoughness||{},s=o.baseColorTexture||o.baseColorFactor;if(s)if(Array.isArray(s))i.color=new n.Color(s[0],s[1],s[2]),i.opacity=s[3];else if("object"==typeof s){i.color=new n.Color(1,1,1);var a={mapName:"map"},l=t.gltf.textures[s.index];a.uri=t.gltf.images[l.source].uri,a.flipY=!1,i.textureMaps[a.mapName]=a}var c=o.metallicRoughnessTexture;if(c){a={mapName:"metallicRoughnessTexture"},l=t.gltf.textures[c.index];a.uri=t.gltf.images[l.source].uri,a.flipY=!1,i.textureMaps[a.mapName]=a}else i.metalness=void 0!==o.metallicFactor?o.metallicFactor:1,i.roughness=void 0!==o.roughnessFactor?o.roughnessFactor:1;!0===e.doubleSided&&(i.side=n.DoubleSide);var h=e.alphaMode||u;h===p?(i.transparent=!0,i.depthWrite=!1):(i.transparent=!1,h===d&&(i.alphaTest=void 0!==e.alphaCutoff?e.alphaCutoff:.5));if(void 0!==e.normalTexture){a={mapName:"normalTexture"},l=t.gltf.textures[e.normalTexture.index];a.uri=l.source,a.flipY=!1,a.uri=t.gltf.images[l.source].uri,i.normalScale=new n.Vector2(1,1),void 0!==e.normalTexture.scale&&i.normalScale.set(e.normalTexture.scale,e.normalTexture.scale)}if(void 0!==e.occlusionTexture){a={mapName:"occlusionTexture"},l=t.gltf.textures[e.occlusionTexture.index];a.uri=t.gltf.images[l.source].uri,a.flipY=!1,i.textureMaps[a.mapName]=a,void 0!==e.occlusionTexture.strength&&(i.aoMapIntensity=e.occlusionTexture.strength)}void 0!==e.emissiveFactor&&(i.emissive=(new n.Color).fromArray(e.emissiveFactor));if(void 0!==e.emissiveTexture){a={mapName:"emissiveTexture"},l=t.gltf.textures[e.emissiveTexture.index];a.uri=t.gltf.images[l.source].uri,a.flipY=!1,i.textureMaps[a.mapName]=a}return i},applyAppearanceHeuristics:function(e,t,i){var r=e.proteinMat?e.proteinMat:null,o=e.prismType&&-1!==e.prismType.indexOf("Prism");o&&e.transparent&&(e.side===n.FrontSide&&"PrismGlazing"!==e.prismType&&(e.side=n.DoubleSide),e.side===n.DoubleSide&&e.depthTest&&(e.twoPassTransparency=!0));var s=e.textureMaps||{};if(!t){var a,l,c=e.proteinType&&-1!==e.proteinType.indexOf("Prism");if(e.metal)e.reflectivity||(e.reflectivity=f(e.specular)),r&&(1===e.reflectivity&&(e.reflectivity=f(e.specular)),0===e.color.r&&0===e.color.g&&0===e.color.b||(e.color.r*=.1,e.color.g*=.1,e.color.b*=.1));else if(c){var h=!1;if("PrismLayered"===e.proteinType){e.clearcoat=!0,e.reflectivity=.06;var u=e.proteinCategories;u&&u.length&&-1!=u[0].indexOf("Metal")&&(h=!0)}e.reflectivity=Math.sqrt(e.reflectivity),h?e.specular.copy(e.color):(e.specular.r=e.reflectivity,e.specular.g=e.reflectivity,e.specular.b=e.reflectivity)}else e.reflectivity?e.reflectivity>.3?(e.metal=!0,e.specular.r=e.color.r,e.specular.g=e.color.g,e.specular.b=e.color.b,e.color.r*=.1,e.color.g*=.1,e.color.b*=.1):(e.specular.r*=e.reflectivity,e.specular.g*=e.reflectivity,e.specular.b*=e.reflectivity):1!==e.color.r||1!==e.color.g||1!==e.color.b||1!==e.specular.r||1!==e.specular.g||1!==e.specular.b||s.map||s.specularMap?(e.reflectivity=.01+.06*f(e.specular),e.specular.r*=e.reflectivity,e.specular.g*=e.reflectivity,e.specular.b*=e.reflectivity):(e.metal=!0,e.reflectivity=.7,e.color.r*=.1,e.color.g*=.1,e.color.b*=.1),e.opacity<1&&(e.reflectivity=1);(e.transparent||-1!==(null===(a=s.map)||void 0===a||null===(l=a.uri)||void 0===l?void 0:l.toLowerCase().indexOf(".png"))||s.alphaMap)&&(e.alphaTest=.01)}if(s.normalMap){var d=e.bumpScale;(void 0===d||d>=1)&&(d=1),e.normalScale=new n.Vector2(d,d)}else(void 0===e.bumpScale&&(s.map||s.bumpMap)||e.bumpScale>=1)&&(e.bumpScale=.03);if((!t||o)&&e.transparent){if(o)e.lmv_depthWriteTransparent=!0,e.depthWrite=!!i;else if(e.opacity>=1)s.alphaMap||(e.transparency=!1);else e.lmv_depthWriteTransparent=!0,e.depthWrite=!!i}void 0!==e.shininess&&(e.shininess*=.25)},applyGeometryFlagsToMaterial:function(e,t){t.attributes.color&&(e.vertexColors=n.VertexColors,e.needsUpdate=!0);if(!e.proteinType&&t.attributes.uv&&t.attributes.uv.isPattern){var i=!1;e.map&&!e.bumpMap&&(e.bumpMap=e.map,e.needsUpdate=!0,i=!0),e.textureMaps&&e.textureMaps.map&&!e.textureMaps.bumpMap&&(e.textureMaps.bumpMap=e.textureMaps.map,e.needsUpdate=!0,i=!0),i&&void 0===e.bumpScale&&(e.bumpScale=.03)}},hasTiling:function(e){var t=e.materials[e.userassets[0]];if(t){if("TilingPattern"===t.definition)return!0}return!1},loadMaterialConverterPrismLibrary:l};async function l(){if(s.MaterialConverterPrism&&s.MaterialConverterPrism.convertPrismMaterial||await s.theExtensionManager.downloadExtension("Autodesk.Viewing.MaterialConverterPrism"),!a.convertPrismMaterial)for(let e in s.MaterialConverterPrism)a[e]=s.MaterialConverterPrism[e]}function c(e){return e.matrix||(e.matrix=(0,o.Get2DSimpleMapTransform)(e.properties)),e.matrix}function h(e){var t=e.materials,i=t[e.userassets[0]];if(i){var n=i.definition;if("TilingPattern"===n)(i=t[i.properties.references.grout_material.connections[0]])&&(n=i.definition);return"PrismLayered"===n||"PrismMetal"===n||"PrismOpaque"===n||"PrismTransparent"===n||"PrismGlazing"===n||"PrismWood"===n}return!1}var u="OPAQUE",d="MASK",p="BLEND";function f(e){return.299*e.r+.587*e.g+.114*e.b}},63855:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Get2DSimpleMapTransform:()=>h,MaterialConverterCommon:()=>u,SRGBToLinear:()=>c,SRGBToLinearFloat:()=>l,parseMaterialBoolean:()=>s,parseMaterialColor:()=>r,parseMaterialGeneric:()=>a,parseMaterialScalar:()=>o});var n=i(41434);function r(e,t,i){if(!e||!e.colors)return new n.Color(1,0,0);var r=e.colors[t];if(!r)return new n.Color(0,0,0);var o=r.values;if(!o||!o.length)return new n.Color(1,0,0);var s=o[0];return new n.Color(s.r,s.g,s.b)}function o(e,t,i){if(!e||!e.scalars)return i;var n=e.scalars[t];return n?n.values[0]:i}function s(e,t,i){if(!e||!e.booleans)return i;var n=e.booleans[t];return void 0===n?i:n}function a(e,t,i,n){if(!e||!e[t])return n;var r=e[t][i];return r?r.values[0]:n}function l(e){var t=e;return t<=.04045?t/=12.92:t=Math.pow((t+.055)/1.055,2.4),t}function c(e){var t,i,r;return t=l(e.r),i=l(e.g),r=l(e.b),new n.Color(t,i,r)}function h(e){var t=o(e,"texture_UScale",1),i=o(e,"texture_VScale",1),n=o(e,"texture_UOffset",0),r=o(e,"texture_VOffset",0),s=o(e,"texture_WAngle",0);return{elements:[Math.cos(s)*t,Math.sin(s)*i,0,-Math.sin(s)*t,Math.cos(s)*i,0,n,r,1]}}let u={parseMaterialColor:r,parseMaterialScalar:o,parseMaterialBoolean:s,parseMaterialGeneric:a,SRGBToLinearFloat:l,SRGBToLinear:c,Get2DSimpleMapTransform:h}},84807:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MATERIAL_VARIANT:()=>C,MaterialManager:()=>D});var n=i(41434),r=i(79291),o=i(49720),s=(i(62868),i(71519)),a=i.n(s),l=i(18350),c=i.n(l),h=i(83539);let u={uniforms:n.UniformsUtils.merge([h.ShaderChunks.CutPlanesUniforms,{pixelsPerUnit:{type:"f",value:1},aaRange:{type:"f",value:.5},tLayerMask:{type:"t",value:null},tLineStyle:{type:"t",value:null},vLineStyleTexSize:{type:"v2",value:new n.Vector2(13,70)},tRaster:{type:"t",value:null},tSelectionTexture:{type:"t",value:null},vSelTexSize:{type:"v2",value:new n.Vector2(4096,1)},displayPixelRatio:{type:"f",value:1},opacity:{type:"f",value:1},selectionColor:{type:"v4",value:new n.Vector4(0,0,1,1)},modelId:{type:"v3",value:new n.Vector3(0,0,0)},viewportId:{type:"f",value:0},swap:{type:"f",value:0},grayscale:{type:"f",value:0},viewportBounds:{type:"v4",value:new n.Vector4(0,0,1,1)},unpackXform:{type:"v4",value:new n.Vector4(1,1,0,0),perObject:!0},tIdColor:{type:"t",value:null,perObject:!0},vIdColorTexSize:{type:"v2",value:new n.Vector2(256,1),perObject:!0},meshAnimTime:{type:"f",value:0,perObject:!0}}]),vertexShader:a(),fragmentShader:c()};var d=i(84325),p=i.n(d),f=i(59191),m=i.n(f);let g,v={uniforms:n.UniformsUtils.merge([u.uniforms,{aaRange:{type:"f",value:1},size:{type:"v2",value:new n.Vector2(1024,768)},cameraPos:{type:"v3",value:new n.Vector3},tanHalfFov:{type:"f",value:0},miterLimit:{type:"f",value:6},miterScaleFactor:{type:"f",value:1023},miterCP:{type:"f",value:65536}}]),vertexShader:p(),fragmentShader:m()};g=n.ShaderMaterial;class y extends g{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(e.isScreenSpace?{uniforms:n.UniformsUtils.clone(v.uniforms),vertexShader:v.vertexShader,fragmentShader:v.fragmentShader}:{uniforms:n.UniformsUtils.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}),this.isScreenSpace=!!e.isScreenSpace,e.hasLineStyles&&(this.hasLineStyles=!0),this.is2d=!0,this.supportsViewportBounds=!0,this.depthWrite=!1,this.depthTest=!1,this.side=n.DoubleSide,this.transparent=!0,this.blending=n.NormalBlending,this.type="LMVLineMaterial"+(this.isScreenSpace?"SS":""),"multiply"==e.compositeOperation?this.blending=n.MultiplyBlending:"min"==e.compositeOperation||"darken"==e.compositeOperation?(this.blending=n.CustomBlending,this.blendEquation=n.MinEquation,this.blendEquationAlpha=n.AddEquation,this.blendSrcAlpha=n.SrcAlphaFactor,this.blendDstAlpha=n.DstAlphaFactor):"max"!=e.compositeOperation&&"lighten"!=e.compositeOperation||(this.blending=n.CustomBlending,this.blendEquation=n.MaxEquation,this.blendEquationAlpha=n.AddEquation,this.blendSrcAlpha=n.SrcAlphaFactor,this.blendDstAlpha=n.DstAlphaFactor)}}var b=i(10940),x=i(40582),_=i(47929),E=i(51187),A=i(11236),S=i(30110);function w(e,t,i){e.x=t.r,e.y=t.g,e.z=t.b,e.w=i}var M=new n.Color("#0000FF"),T=.6;const C={INSTANCED:0,VERTEX_IDS:1},P=(e,t,i)=>{e[t]=i,e.needsUpdate=!0};function D(e){this._renderer=e,this._textures={},this._texturesToUpdate=[],this._materials={},this._materialsNonHDR={},this._exposureBias=0,this._tonemapMethod=0,this._envMapExposure=1,this._envRotationSin=0,this._envRotationCos=1,this._reflectionMap=null,this._irradianceMap=null,this._cutplanes=[],this._mrtNormals=!1,this._mrtIdBuffer=void 0,this._polygonOffsetOn=!1,this._pixelsPerUnit=1,this._lineStyleTex=null,this._swapBlackAndWhite=0,this._grayscaleLines=0,this._depthWriteTransparent=!0,this._needsTwoSided=!1,this._hasTransparentMaterial=!1,this.hasPrism=!1,this._forceDoubleSided=!1,this._layerMaskTextures={},this._layerMaps={},this._selectionTextures={},this._prismWoodTextures=void 0,this.defaultMaterial=new A.LMVMeshPhongMaterial({color:7829367,specular:3355443,shininess:30,reflectivity:0}),this.addMaterial("__defaultMaterial__",this.defaultMaterial),this.initLineStyleTexture(),this.refCount=0}D.prototype.dtor=function(){this.cleanup(),n.Cache.clear(),this._renderer=null},D.prototype._getModelHash=function(e){const t=e&&("number"==typeof e?e:e.id);return"model:"+(t||"")+"|"},D.prototype._getMaterialHash=function(e,t){return e&&e.isOTG()?t:this._getModelHash(e)+"mat:"+t},D.prototype._getTextureHash=function(e,t,i){return this._getModelHash(e)+"tex:"+t+"|map:"+i},D.prototype.addNonHDRMaterial=function(e,t){t.doNotCut||(t.cutplanes=this._cutplanes),this._applyMRTFlags(t),this._materialsNonHDR[e]=t},D.prototype.removeNonHDRMaterial=function(e){delete this._materialsNonHDR[e]},D.prototype.addMaterialNonHDR=function(e,t){this.addNonHDRMaterial(e,t)},D.prototype.addHDRMaterial=function(e,t){this._reflectionMap&&!t.disableEnvMap&&(t.envMap=this._reflectionMap),this._irradianceMap&&(t.irradianceMap=this._irradianceMap),t.exposureBias=Math.pow(2,this._exposureBias),t.tonemapOutput=this._tonemapMethod,t.envMapExposure=this._envMapExposure,t.envRotationSin=this._envRotationSin,t.envRotationCos=this._envRotationCos,this._applyCutPlanes(t),this._applyMRTFlags(t),this._applyPolygonOffset(t,this._polygonOffsetOn),this._materials[e]=t},D.prototype._applyCutPlanes=function(e){e.doNotCut?e.cutplanes=null:(e.cutplanes=this._cutplanes,e.needsUpdate=!0,this._cutplanes&&this._cutplanes.length>0?e.side=n.DoubleSide:this._needsTwoSided||e.is2d||this._forceDoubleSided||(e.side=n.FrontSide))},D.prototype.addMaterial=function(e,t,i){var r=t.prismType&&-1!==t.prismType.indexOf("Prism");this.hasPrism=r||this.hasPrism,x.MaterialConverter.applyAppearanceHeuristics(t,r||i,this.isDepthWriteTransparentEnabled()),t.side===n.DoubleSide&&(this._needsTwoSided=!0),this.addHDRMaterial(e,t)},D.prototype.addLineMaterial=function(e,t,i){var n=i&&this._layerMaskTextures[i];n&&(t.defines.HAS_LAYERS=1,t.uniforms.tLayerMask.value=n),t.hasLineStyles&&(t.defines.HAS_LINESTYLES=1,t.defines.MAX_LINESTYLE_LENGTH=this._lineStyleTex.image.width,t.uniforms.tLineStyle.value=this._lineStyleTex,t.uniforms.vLineStyleTexSize.value.set(this._lineStyleTex.image.width,this._lineStyleTex.image.height)),t.uniforms.swap.value=this._swapBlackAndWhite,t.uniforms.grayscale.value=this._grayscaleLines,t.doNotCut||(t.cutplanes=this._cutplanes),this._updatePixelScaleForMaterial(t),this._materials[e]=t,this._applyMRTFlags(t)},D.prototype.addOverrideMaterial=function(e,t){if(this.addNonHDRMaterial(e,t),t.variants)for(var i=0;i<t.variants.length;i++){var n=t.variants[i];if(n){var r=e+"_variant_"+i;this.addNonHDRMaterial(r,n)}}},D.prototype.getMaterialVariant=function(e,t,i){var n=!!e.hash,r=(n?e.hash:this._getModelHash(i)+e.id)+"|"+t,o=this._materials[r];return o||(o=this.cloneMaterial(e,i),t===C.INSTANCED?(o.useInstancing=!0,o.vertexIds=!0):t===C.VERTEX_IDS&&(o.vertexIds=!0),this.addHDRMaterial(r,o)),n&&this._addMaterialRef(o,i.id),o},D.prototype.addInstancingSupport=function(e){var t=e.clone();t.useInstancing=!0,t.packedNormals=e.packedNormals;var i=e.clone();i.wideLines=!0,i.packedNormals=e.packedNormals,e.variants=[t,i],e.getCustomOverrideMaterial=function(e){return e.useInstancing?this.variants[0]:e.wideLines?(this.variants[1].linewidth=e.linewidth,this.variants[1]):null}},D.prototype.addCompactLayoutSupport=function(e){var t=function(t){var i=t.clone();return e.uniforms.tSelectionTexture.value&&(i.uniforms.tSelectionTexture.value=e.uniforms.tSelectionTexture.value),e.uniforms.tLayerMask.value&&(i.uniforms.tLayerMask.value=e.uniforms.tLayerMask.value),i.is2d=e.is2d,i.supportsViewportBounds=e.supportsViewportBounds,i.modelScale=e.modelScale,i.defines=Object.assign({},e.defines),i.attributes=Object.assign({},e.attributes),i},i=t(e);i.defines.UNPACK_POSITIONS=1;var n=t(e);n.defines.USE_INSTANCING=1;var r=t(e);r.defines.UNPACK_POSITIONS=1,r.defines.USE_INSTANCING=1,e.variants=[i,n,r],e.getCustomOverrideMaterial=function(e){if(e.defines){var t=(e.defines.UNPACK_POSITIONS?1:0)+(e.defines.USE_INSTANCING?2:0);if(t>0)return this.variants[t-1]}return null}},D.prototype.removeMaterial=function(e){delete this._materials[e]},D.prototype.findMaterial=function(e,t){var i=this._getMaterialHash(e,t);return this._materials[i]},D.prototype.convertSharedMaterial=async function(e,t,i){var n=this.findMaterial(e,i);return n||((n=await this.convertOneMaterial(e,t,i)).hash=i),this._addMaterialRef(n,e.id),n},D.prototype.convertOneMaterial=async function(e,t,i){var r=x.MaterialConverter.isPrismMaterial(t);r&&await x.MaterialConverter.loadMaterialConverterPrismLibrary();var s=e.getData(),a=s&&s.materials?s.materials.scene.SceneUnit:"inch",l=r&&x.MaterialConverter.swapPrismWoodTextures(this._prismWoodTextures);l&&o.logger.warn("Unexpected wood textures converting a material");var c=await x.MaterialConverter.convertMaterial(t,a);if(s.doubleSided&&(c.side=n.DoubleSide),this.addMaterial(i,c),this._hasTransparentMaterial=this._hasTransparentMaterial||c.transparent,x.MaterialConverter.hasTiling(t)){c.decals=[];var h=t.materials,u=h[t.userassets[0]];let e=u.properties.references.base_materials.connections,n=u.properties.references.tiles.connections,r=[];for(let o=0;o<n.length;o++){let s=h[n[o]];r.push(s),(m=await x.MaterialConverter.convertMaterial(t,a,null,e[o])).useTiling=!0,m.transparent=!0,c.decals.push({uv:0,material:m}),this.addMaterial(i+"|tile|"+o,m)}x.MaterialConverter.materialTilingPattern(t,u,r,c.decals,a)}if(t.decals){c.decals||(c.decals=[]);for(var d=0,p=t.decals.length;d<p;d++){var f=t.decals[d],m=await x.MaterialConverter.convertMaterial(f.material,a);c.decals.push({uv:f.uv||0,material:m}),this.addMaterial(i+"|decal|"+d,m)}}return this._prismWoodTextures=r&&x.MaterialConverter.swapPrismWoodTextures(l),c},D.prototype.forEach=function(e,t,i,n){for(var r in n=n||this._materials){var o=n[r];t&&o.is2d||(e(o,r),i&&o.variants&&o.variants.forEach((function(t){t&&e(t)})))}},D.prototype.forEachInModel=function(e,t,i){const n=this._getModelHash(e),r=(e,t)=>{-1!==t.indexOf(n)&&i(e)};this.forEach(r,!1,t),this.forEach(r,!1,t,this._materialsNonHDR)};var L={needsClear:!1,needsRender:!1,overlayDirty:!1};function I(e,t,i){let n=e.slots[i];n?-1==n.indexOf(t)&&n.push(t):e.slots[i]=[t]}D.prototype.updateMaterials=function(){for(L.needsRender=!1;this._texturesToUpdate.length;){var e=this._texturesToUpdate.pop();for(let i in e.slots){let n=e.slots[i];for(var t=0;t<n.length;t++)n[t][i]=e.tex,n[t].needsUpdate=!0,L.needsRender=!0}}return L},D.prototype.setTextureInCache=function(e,t,i){var n=this._getTextureHash(e,t.uri,t.mapName),r=this._textures[n];if(r){for(var o in r.tex||(r.tex=i),r.slots)for(var s=r.slots[o],a=0;a<s.length;a++)s[a][o]=i;this._texturesToUpdate.push(r)}},D.prototype.loadTextureFromCache=function(e,t,i,n){var r=this._getTextureHash(e,i.uri,i.mapName),o=this._textures[r];if(o)o.tex?(t[n]=o.tex,t.needsUpdate=!0):(o.slots[n]||(o.slots[n]=[]),o.slots[n].push(t));else{var s={};s[n]=[t],this._textures[r]={slots:s,tex:null}}return!!o},D.prototype.getOtgMaterials=function(e){const t=(e,t)=>{const i=t.indexOf(e);if(-1!==i)return{hash:e,idx:i};const n=e+"|"+C.INSTANCED,r=t.indexOf(n);if(-1!==r)return{hash:n,idx:r};const o=e+"|"+C.VERTEX_IDS,s=t.indexOf(o);return-1!==s?{hash:o,idx:s}:void 0};let i={};const n=e.getData(),r=n.fragments.materials,o=Object.keys(this._materials);for(let e=0;e<r.length;e++){const s=r[e],a=t(n.getMaterialHash(s),o);a&&(i[a.hash]=this._materials[a.hash],o.splice(a.idx,1))}return i},D.prototype.getModelMaterials=function(e,t){var i=this._getModelHash(e);let n={};const r={};t&&e.isOTG()&&(n=this.getOtgMaterials(e));for(let e in this._materials)if(-1!==e.indexOf(i)){var o=this._materials[e];o.defines&&o.defines.hasOwnProperty("SELECTION_RENDERER")?r[e]=o:n[e]=o}var s={};for(let e in this._materialsNonHDR)-1!==e.indexOf(i)&&(s[e]=this._materialsNonHDR[e]);var a={};for(let e in this._textures)-1!==e.indexOf(i)&&(a[e]=this._textures[e]);return{mats:n,selectionMats:r,matsNonHDR:s,textures:a}},D.prototype.exportModelMaterials=function(e,t){const i=this.getModelMaterials(e);return this.cleanup(e),i},D.prototype.importModelMaterials=function(e,t){for(var i in e.mats){var n=e.mats[i];n.is2d?this.addLineMaterial(i,n,t):this.addHDRMaterial(i,n)}for(var i in e.matsNonHDR)this.addMaterialNonHDR(i,e.matsNonHDR[i]);for(var r in e.textures)this._textures[r]=e.textures[r]},D.prototype.cloneMaterial=function(e,t){var i=e.clone();if(e.defines&&(i.defines=Object.assign({},e.defines)),(i instanceof A.LMVMeshPhongMaterial||i.isPrismMaterial)&&(i.packedNormals=e.packedNormals,i.exposureBias=e.exposureBias,i.irradianceMap=e.irradianceMap,i.envMapExposure=e.envMapExposure,i.envRotationSin=e.envRotationSin,i.envRotationCos=e.envRotationCos,i.proteinType=e.proteinType,i.proteinMat=e.proteinMat,i.proteinCategories=e.proteinCategories,i.tonemapOutput=e.tonemapOutput,i.cutplanes=e.cutplanes,i.textureMaps=e.textureMaps,i.texturesLoaded=e.texturesLoaded),e.doNotCut&&(i.doNotCut=!0),e.is2d&&(i.is2d=!0),e.disableEnvMap&&(i.disableEnvMap=!0),e.supportsViewportBounds&&(i.supportsViewportBounds=!0),e.textureMaps)for(var n in e.textureMaps)if(e[n])i[n]=e[n];else if(t){var r=i.textureMaps[n],s=r.uri,a=r.mapName,l=this._getTextureHash(t,s,a),c=this._textures[l];c?I(c,i,n):o.logger.error("Missing texture receiver",l)}else o.logger.error("Cannot connect pending texture maps because cloneMaterial was called without a model");return this._applyMRTFlags(i),i},D.prototype.setupMaterial=function(e,t,i){var n=e.getData(),r=this.findMaterial(e,i);if(!r){r=this.cloneMaterial(this.defaultMaterial,e);var s=this._getMaterialHash(e,i);this._materials[s]=r,o.logger.warn("Material ("+i+") missing, using default material instead.")}if(t.isLines||t.isWideLines||t.isPoints){var a=!!t.attributes.color,l=r;if(l||(l=this.defaultMaterial.clone()),t.isPoints)r=new _.LMVPointCloudMaterial({vertexColors:a,size:t.pointSize});else{var c=a?"cachedLineMaterialVC":"cachedLineMaterial";r=l[c],t.isWideLines?(r||((r=l[c]=new E.LMVMeshBasicMaterial({vertexColors:a})).wideLines=!0),t.isLines=!1,r.polygonOffset=l.polygonOffset,r.polygonOffsetFactor=l.polygonOffsetFactor,r.polygonOffsetUnits=l.polygonOffsetUnits,r.linewidth=l.linewidth):r||(r=l[c]=new S.LMVLineBasicMaterial({vertexColors:a}))}a||(r.color=l.color),r.svfMatId=i;var h=this._getMaterialHash(e,i+"_line_"+r.id);this.addMaterialNonHDR(h,r),n.hasLines=!0}else r.svfMatId=i,x.MaterialConverter.applyGeometryFlagsToMaterial(r,t);return r},D.prototype._addMaterialRef=function(e,t){e._sharedBy||(e._sharedBy=[]);var i=e._sharedBy;-1===i.indexOf(t)&&i.push(t)},D.prototype._removeMaterialRef=function(e,t){var i=e._sharedBy,n=i?i.indexOf(t):-1;-1!==n&&i.splice(n,1)},D.prototype.cleanup=function(e){var t=this._getModelHash(e),i={};for(var r in this._textures){var o=this._textures[r];-1===r.indexOf(t)?i[r]=o:o.tex&&(o.tex.dispose(),o.tex.needsUpdate=!0)}this._textures=i;var s={},a={type:"dispose"};for(var l in this._materials){var c=this._materials[l],h=!e||-1!==l.indexOf(t);if(c._sharedBy&&(h?c._sharedBy.length=0:(this._removeMaterialRef(c,e.id),0===c._sharedBy.length&&(h=!0))),h){if((c=this._materials[l]).dispatchEvent(a),c.needsUpdate=!0,c.envMap=null,c.is2d){c.uniforms.tLayerMask.value=null,c.uniforms.tLineStyle.value=null;var u=c.uniforms.tRaster;u&&u.value instanceof n.Texture&&(u.value.dispose(),u.value.needsUpdate=!0)}}else s[l]=this._materials[l]}this._materials=s;var d={};for(var l in this._materialsNonHDR){if(e&&-1===l.indexOf(t))d[l]=this._materialsNonHDR[l];else(c=this._materialsNonHDR[l]).dispatchEvent(a),c.needsUpdate=!0}this._materialsNonHDR=d;var p=(e,t)=>{var i=this._selectionTextures[e];i&&(i.dispose(),i.needsUpdate=!0,t&&delete this._selectionTextures[e])},f=(e,t)=>{const i=this._layerMaskTextures[e];void 0!==i&&(i.dispose(),i.needsUpdate=!0,t&&delete this._layerMaskTextures[e])};if(this._prismWoodTextures&&x.MaterialConverter.disposePrismWoodTextures(this._prismWoodTextures),this._prismWoodTextures=void 0,e)p(e.id,!0),f(e.id,!0),delete this._layerMaps[e.id];else{for(var m in this._selectionTextures)this._selectionTextures.hasOwnProperty(m)&&p(m,!1);for(var m in this._selectionTextures={},this._layerMaskTextures)this._layerMaskTextures.hasOwnProperty(m)&&f(m,!1);this._layerMaskTextures={},this._layerMaps={},this._reflectionMap=null,this._irradianceMap=null}},D.prototype.toggleDepthWriteTransparent=function(e){this._depthWriteTransparent!=e&&(this._depthWriteTransparent=e,this.forEach((function(t){t.lmv_depthWriteTransparent&&(t.depthWrite=e)}),!1,!0))},D.prototype.isDepthWriteTransparentEnabled=function(){return this._depthWriteTransparent},D.prototype.hasTwoSidedMaterials=function(){return this._needsTwoSided},D.prototype.hasTransparentMaterial=function(){return this._hasTransparentMaterial},D.prototype.texturesLoaded=function(){return 0===this._texturesToUpdate.length},D.prototype.renderer=function(){return this._renderer},D.prototype.setTonemapExposureBias=function(e){this._exposureBias=e;var t=Math.pow(2,e);this.forEach((function(e){P(e,"exposureBias",t)}),!0,!0)},D.prototype.setTonemapMethod=function(e){this._tonemapMethod=e,this.forEach((function(t){t.tonemapOutput=e,t.needsUpdate=!0}),!0,!0)},D.prototype.setEnvExposure=function(e){var t=Math.pow(2,e);this._envMapExposure=t,this.forEach((function(e){P(e,"envMapExposure",t)}),!0,!0)},D.prototype.setEnvRotation=function(e){var t=this._envRotationSin=Math.sin(e),i=this._envRotationCos=Math.cos(e);this.forEach((function(e){e.envRotationSin=t,e.envRotationCos=i,e.needsUpdate=!0}),!0,!0)},D.prototype.setReflectionMap=function(e){this._reflectionMap=e,this.forEach((function(t){t.disableEnvMap||P(t,"envMap",e)}),!0,!0)},D.prototype.setIrradianceMap=function(e){this._irradianceMap=e,this.forEach((function(t){P(t,"irradianceMap",e)}),!0,!0)},D.prototype.setDoubleSided=function(e,t){this._forceDoubleSided=e;let i={};i=t?this.getModelMaterials(t,!0).mats:this._materials,this.forEach((function(t){t.side=e?n.DoubleSide:n.FrontSide,t.needsUpdate=!0}),!0,!0,i)},D.prototype.setCutPlanes=function(e){for(var t=!1,i=this._cutplanes.length!==(e&&e.length||0);this._cutplanes.length>0;)this._cutplanes.pop();if(e)for(var r=0;r<e.length;r++)this._cutplanes.push(e[r].clone());if(i)for(var o in this.forEach((e=>{this._applyCutPlanes(e),t=t||e.side==n.DoubleSide}),!1,!0),this._materialsNonHDR)this._materialsNonHDR[o].doNotCut||(this._materialsNonHDR[o].needsUpdate=!0);return t||this._needsTwoSided},D.prototype.getCutPlanes=function(){return this._cutplanes.slice()},D.prototype.getCutPlanesRaw=function(){return this._cutplanes},D.prototype._applyPolygonOffset=function(e){(e instanceof A.LMVMeshPhongMaterial||e.isPrismMaterial)&&(e.polygonOffset=this._polygonOffsetOn,e.polygonOffsetFactor=this._polygonOffsetFactor,e.polygonOffsetUnits=this._polygonOffsetUnits,e.extraDepthOffset&&(e.polygonOffsetFactor+=e.extraDepthOffset),e.needsUpdate=!0)},D.prototype.getPolygonOffsetOn=function(){return this._polygonOffsetOn},D.prototype.getPolygonOffsetFactor=function(){return this._polygonOffsetFactor},D.prototype.getPolygonOffsetUnits=function(){return this._polygonOffsetUnits},D.prototype.togglePolygonOffset=function(e,t,i){this._polygonOffsetOn=e,this._polygonOffsetFactor=e?t||1:0,this._polygonOffsetUnits=e?i||.1:0;var n=this;this.forEach((function(e){n._applyPolygonOffset(e)}),!1,!0)},D.prototype._applyMRTFlags=function(e){var t,i=e.supportsMrtNormals||e instanceof A.LMVMeshPhongMaterial||e.isPrismMaterial||e instanceof E.LMVMeshBasicMaterial||e instanceof S.LMVLineBasicMaterial||e instanceof _.LMVPointCloudMaterial||e instanceof _.LMVPointsMaterial,n=e.mrtNormals,r=e.mrtIdBuffer;t=this._renderer&&this._renderer.supportsMRT(),e.skipMrtNormals||(e.mrtNormals=i&&t&&this._mrtNormals),e.mrtIdBuffer=t?this._mrtIdBuffer:void 0,e.mrtNormals===n&&e.mrtIdBuffer===r||(e.needsUpdate=!0)},D.prototype.toggleMRTSetting=function(e){this._mrtNormals=e.mrtNormals,this._mrtIdBuffer=e.mrtIdBuffer;var t=this;function i(e){t._applyMRTFlags(e)}this.forEach(i,!1,!0),this.forEach(i,!1,!0,this._materialsNonHDR)},D.prototype.adjustMaterialMRTSetting=function(e){this._applyMRTFlags(e)},D.prototype.initLineStyleTexture=function(){this._lineStyleTex=(0,b.createLinePatternTexture)()},D.prototype.setLineStyleTexture=function(e){this._lineStyleTex=e},D.prototype.initLayersTexture=function(e,t,i){for(var r=this._layerMaskTextures[i],o=r?r.image.data:new Uint8Array(65536),s=0,a=e;s<a;s++)o[s]=255;(r=r||new n.DataTexture(o,256,256,Autodesk.Viewing.Private.DataTextureSingleChannelFormat,n.UnsignedByteType,n.UVMapping,n.ClampToEdgeWrapping,n.ClampToEdgeWrapping,n.NearestFilter,n.NearestFilter,0)).generateMipmaps=!1,r.flipY=!1,r.needsUpdate=!0,this._layerMaskTextures[i]=r,this._layerMaps[i]=t},D.prototype.setLayerVisible=function(e,t,i){for(var n=this._layerMaskTextures[i],r=n.image.data,o=this._layerMaps[i],s=t?255:0,a=0;a<e.length;++a){r[o[e[a]]]=s}n.needsUpdate=!0,this.forEach((function(e){e.is2d&&(e.needsUpdate=!0)}))},D.prototype.initSelectionTexture=function(e,t){if(this._selectionTextures[t])return this._selectionTextures[t];for(var i=e||1,r=4096,o=0|Math.ceil(i/r),s=1;s<o;)s*=2;o=s;for(var a=new Uint8Array(r*o),l=0;l<i;l++)a[l]=0;var c=new n.DataTexture(a,r,o,Autodesk.Viewing.Private.DataTextureSingleChannelFormat,n.UnsignedByteType,n.UVMapping,n.ClampToEdgeWrapping,n.ClampToEdgeWrapping,n.NearestFilter,n.NearestFilter,0);return c.generateMipmaps=!1,c.flipY=!1,c.needsUpdate=!0,this._selectionTextures[t]=c,c},D.prototype.highlightObject2D=function(e,t,i){var n=this._selectionTextures[i];n&&(n.image.data[e]=t?255:0,n.needsUpdate=!0)},D.prototype._updatePixelScaleForMaterial=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._camera,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._deviceWidth,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this._deviceHeight,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this._pixelsPerUnit,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;if(e.is2d){if(e.isScreenSpace)if(e.uniforms.size.value.set(i,n),e.uniforms.aaRange.value=.5,null!=t&&t.isPerspective){e.uniforms.cameraPos.value.copy(t.position);const i=t.fov*Math.PI/180;e.uniforms.tanHalfFov.value=Math.tan(.5*i)}else e.uniforms.tanHalfFov.value=0;else e.uniforms.aaRange.value=.5/(r*e.modelScale*o);e.uniforms.pixelsPerUnit.value=r*e.modelScale*o}},D.prototype.updatePixelScale=function(e,t,i,n){this._pixelsPerUnit=e,this._deviceWidth=t,this._deviceHeight=i,this._camera=n,this.forEach((r=>this._updatePixelScaleForMaterial(r,n,t,i,e)))},D.prototype.updatePixelScaleForModel=function(e,t,i,n,r,o){const s=this.getModelMaterials(e),a=e=>this._updatePixelScaleForMaterial(e,o,i,n,t,r);Object.values(s.mats).forEach(a),Object.values(s.matsNonHDR).forEach(a),Object.values(s.selectionMats).forEach(a)},D.prototype.updateSwapBlackAndWhite=function(e){var t=this._swapBlackAndWhite=e?1:0;this.forEach((function(e){e.is2d&&(e.uniforms.swap.value=t)}))},D.prototype.setGrayscale=function(e){var t=this._grayscaleLines=e?1:0;this.forEach((function(e){e.is2d&&(e.uniforms.grayscale.value=t)}))},D.prototype.updateViewportId=function(e){this.forEach((function(t){t.is2d&&(t.uniforms.viewportId.value=e,t.needsUpdate=!0)}))},D.prototype.create2DMaterial=function(e,t,i,o,s){var a=e?e.getData():null,l="__lineMaterial__";t.image&&(l+="|image:"+t.image.name),t.clip&&(l+="|clip:"+JSON.stringify(t.clip)),i&&(l+="|id"),o&&(l+="|selection"),t.skipEllipticals&&(l+="|skipEllipticals"),t.skipCircles&&(l+="|skipCircles"),t.skipTriangleGeoms&&(l+="|skipTriangleGeoms"),t.skipMiterLines&&(l+="|skipMiterLines"),t.useInstancing&&(l+="|useInstancing"),t.isScreenSpace&&(l+="|isScreenSpace"),t.unpackPositions&&(l+="|unpackPositions"),t.hasLineStyles&&(l+="|hasLineStyles"),t.compositeOperation&&(l+="|"+t.compositeOperation),t.hasOpacity&&(l+="|hasOpacity"),t.noIdOutput&&(l+="|noIdOutput");var c=this._getMaterialHash(e,l);if(!this._materials.hasOwnProperty(c)){var h=new y(t);if(i)h.defines.ID_COLOR=1,h.blending=n.NoBlending;else if(o)h.uniforms.tSelectionTexture.value=o,h.uniforms.vSelTexSize.value.set(o.image.width,o.image.height),h.defines.SELECTION_RENDERER=1,this.get2dSelectionColor(h.uniforms.selectionColor);else{this.get2dSelectionColor(h.uniforms.selectionColor),this.renderer()&&this.renderer().supportsMRT()&&(h.mrtIdBuffer=this._mrtIdBuffer)}if(t.skipEllipticals||(h.defines.HAS_ELLIPTICALS=1),t.skipCircles||(h.defines.HAS_CIRCLES=1),t.skipTriangleGeoms||(h.defines.HAS_TRIANGLE_GEOMS=1),t.skipMiterLines||(h.defines.HAS_MITER_LINES=1),t.noIdOutput&&(h.defines.NO_ID_OUTPUT=1),t.useInstancing&&(h.defines.USE_INSTANCING=1),t.unpackPositions&&!i&&(h.defines.UNPACK_POSITIONS=1),t.msdfFontTexture&&(h.defines.MSDF_TEXTURE_FONT=1),t.imageUVTexture&&(h.defines.IMAGE_UV_TEXTURE=1),t.viewportBounds&&(h.uniforms.viewportBounds.value=t.viewportBounds.clone(),h.defines.VIEWPORT_CLIPPING=1),"number"==typeof t.opacity&&(h.uniforms.opacity.value=t.opacity),t.image){var u=function(i,r){i?(i.wrapS=n.ClampToEdgeWrapping,i.wrapT=n.ClampToEdgeWrapping,i.minFilter=r?n.LinearFilter:n.LinearMipMapLinearFilter,i.magFilter=n.LinearFilter,i.anisotropy=1,i.flipY=!0,i.generateMipmaps=!0,i.needsUpdate=!0,t.msdfFontTexture||t.imageUVTexture||(h.defines.HAS_RASTER_QUADS=1),h.uniforms.tRaster.value=i,h.needsUpdate=!0,s&&s(i,e)):s&&s(i,e,t)};if("undefined"!=typeof HTMLCanvasElement&&t.image instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&t.image instanceof HTMLImageElement)u(new n.Texture(r.TextureLoader.imageToCanvas(t.image,"multiply"==t.compositeOperation,t.compositeCanvasColor),n.UVMapping),!0);else r.TextureLoader.loadTextureWithSecurity(t.image.dataURI,n.UVMapping,u,null,a.acmSessionId)}h.modelScale=t.modelScale||1,t.doNotCut&&(h.doNotCut=!0),h.textureMaps={},this.addLineMaterial(c,h,e&&e.id),(i||o)&&this.addCompactLayoutSupport(h)}return l},D.prototype.set2dSelectionColor=function(e,t){M=new n.Color(e),T=null==t?T:t,this.forEach((function(e){if(e.is2d&&e.uniforms){var t=e.uniforms.selectionColor;t&&(w(t.value,M,T),e.needsUpdate=!0)}}))},D.prototype.get2dSelectionColor=function(e){return e&&w(e.value,M,T),M},D.prototype.get2dSelectionOpacity=function(){return T},D.prototype.setMaterialViewportBounds=function(e,t){e.supportsViewportBounds&&(t?e.defines.VIEWPORT_CLIPPING?e.uniforms.viewportBounds.value.set(t.min.x,t.min.y,t.max.x,t.max.y):(e.uniforms.viewportBounds.value=new n.Vector4(t.min.x,t.min.y,t.max.x,t.max.y),e.defines.VIEWPORT_CLIPPING=1,e.needsUpdate=!0):e.defines.VIEWPORT_CLIPPING&&(delete e.defines.VIEWPORT_CLIPPING,e.needsUpdate=!0))},D.prototype.setViewportBoundsForModel=function(e,t){this.forEachInModel(e,!1,(e=>{this.setMaterialViewportBounds(e,t)}))}},51187:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LMVMeshBasicMaterial:()=>r});var n=i(41434);let r;r=n.MeshBasicMaterial},11236:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LMVMeshPhongMaterial:()=>r});var n=i(41434);let r;r=n.MeshPhongMaterial},86146:(e,t,i)=>{"use strict";i.r(t),i.d(t,{PhongShader:()=>c});var n=i(41434),r=i(83539),o=i(4352),s=i.n(o),a=i(83039),l=i.n(a);let c={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.bump,n.UniformsLib.normalmap,n.UniformsLib.lights,n.UniformsLib.fog,r.ShaderChunks.CutPlanesUniforms,r.ShaderChunks.IdUniforms,r.ShaderChunks.ThemingUniform,r.ShaderChunks.ShadowMapUniforms,r.ShaderChunks.WideLinesUniforms,{emissive:{type:"c",value:new n.Color(0)},specular:{type:"c",value:new n.Color(1118481)},shininess:{type:"f",value:30},reflMipIndex:{type:"f",value:0},texMatrix:{type:"m3",value:new n.Matrix3},texMatrixBump:{type:"m3",value:new n.Matrix3},texMatrixAlpha:{type:"m3",value:new n.Matrix3},irradianceMap:{type:"t",value:null},exposureBias:{type:"f",value:1},envMapExposure:{type:"f",value:1},envRotationSin:{type:"f",value:0},envRotationCos:{type:"f",value:1}}]),vertexShader:s(),fragmentShader:l()};n.ShaderLib.firefly_phong=c},47929:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LMVPointCloudMaterial:()=>r,LMVPointsMaterial:()=>r});var n=i(41434);let r;r=n.PointCloudMaterial},57865:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GetPrismMapUniforms:()=>r,PrismUtil:()=>o});var n=i(41434);function r(e){var t=e+"_texMatrix",i=e+"_invert",r={};return r[e]={type:"t",value:null},r[t]={type:"m3",value:new n.Matrix3},r[i]={type:"i",value:0},r}let o={GetPrismMapUniforms:r}},2285:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RenderContext:()=>le});var n=i(41434);Object.freeze({THREE_SCENE_BEFORE:Symbol("ENUM_THREE_SCENE_BEFORE"),THREE_SCENE_AFTER:Symbol("ENUM_THREE_SCENE_AFTER")});var r=i(16840),o=i(82079),s=i(49720),a=i(18745),l=i(83539),c=i(66209),h=i.n(c),u=i(20505),d=i.n(u);let p={uniforms:n.UniformsUtils.merge([l.ShaderChunks.DepthTextureUniforms,{tDiffuse:{type:"t",value:null},tAO:{type:"t",value:null},useAO:{type:"i",value:0},aoOpacity:{type:"f",value:.625},tOverlay:{type:"t",value:null},useOverlay:{type:"i",value:0},useOverlayAlpha:{type:"i",value:1},tID:{type:"t",value:null},tID2:{type:"t",value:null},objIDv4:{type:"v4",value:new n.Vector4(0,0,0,0)},modelIDv2:{type:"v2",value:new n.Vector2(0,0)},modelIDsv2v:{type:"v2v",value:[]},edgeObjIDv4:{type:"v4",value:new n.Vector4(0,0,0,0)},edgeModelIDv2:{type:"v2",value:new n.Vector2(0,0)},highlightIntensity:{type:"f",value:1},highlightColor:{type:"c",value:new n.Color(1,1,1)},resolution:{type:"v2",value:new n.Vector2(1/1024,1/512)},selectionColor:{type:"c",value:new n.Color(0,0,0)},expand2dSelection:{type:"f",value:.5},tCrossFadeTex0:{type:"t",value:null},tCrossFadeTex1:{type:"t",value:null},crossFadeOpacity0:{type:"f",value:0},crossFadeOpacity1:{type:"f",value:0},tCompanionsColor:{type:"t",value:null},tCompanionsDepth:{type:"t",value:null},tSourceDepth:{type:"t",value:null},highlightFullModel:{type:"f",value:0}}]),vertexShader:h(),fragmentShader:d()};var f=i(54924),m=i(63332),g=i.n(m),v=i(49510),y=i.n(v);let b={uniforms:{tDiffuse:{type:"t",value:null},uResolution:{type:"v2",value:new n.Vector2(1/1024,1/512)}},vertexShader:g(),fragmentShader:y()};var x=i(79282),_=i.n(x),E=i(6750),A=i.n(E);let S={uniforms:{color:{type:"v4",value:new n.Vector4(0,0,0,.3)},cutplanes:{type:"v4v",value:[]}},vertexShader:_(),fragmentShader:A()};var w=i(5030),M=i.n(w),T=i(74957),C=i.n(T);let P={uniforms:{cutplanes:{type:"v4v",value:[]}},vertexShader:M(),fragmentShader:C()};var D=i(38074);const L=1,I=2,R=3,O=4,N=5,k=6,F=7,V=8;function U(e,t,i,r,o){var s=new n.WebGLRenderTarget(e,t,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:i,type:r,stencilBuffer:!1});return o&&(s.shareDepthFrom=o),s.name="depthTarget",s}const B=new n.Vector4(1,1,1,.5),z=new n.Vector4(1,1,1,1);function G(e,t){var i=new n.WebGLRenderTarget(e,t,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:n.RGBAFormat,type:n.UnsignedByteType,stencilBuffer:!1});return i.texture.generateMipmaps=!1,i.canReadPixels=!0,i}function H(e){e.material.blending=n.NoBlending,e.material.depthWrite=!1,e.material.depthTest=!1}function W(e,t){if(e&&t){t.length=0;for(let i=0;i<e.length;i++)t[i]=e[i]}}var j=i(82089),X=i(50410),q=i.n(X);let Y={uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new n.Vector2(512,512)},resolution:{type:"v2",value:new n.Vector2(1/512,1/512)},axis:{type:"v2",value:new n.Vector2(1,0)},radius:{type:"f",value:50}},vertexShader:h(),fragmentShader:q()};var K=i(11342),Z=i.n(K),Q=i(92003),J=i.n(Q),$=i(3819),ee=i.n($);const te={uniforms:{tDiffuse:{type:"t",value:null},cameraNear:{type:"f",value:1},cameraInvNearFar:{type:"f",value:100},resolution:{type:"v2",value:new n.Vector2(1/512,1/512)}},vertexShader:Z(),fragmentShader:J()},ie={uniforms:{tDiffuse:{type:"t",value:null},resolution:{type:"v2",value:new n.Vector2(1/512,1/512)}},vertexShader:Z(),fragmentShader:ee()};var ne=i(41839),re=i(29480);const oe=(0,r.getGlobal)().document,se=new n.Color(16777215),ae=new n.Color(0);function le(){var e,t,i,l,c,h,u,d,m,g,v,y,x,_,E,A=!1,w=new j.RenderContextPostProcessManager;this.postShadingManager=function(){return w};var M,T,C,X,q={},K=null,Z=null,Q=null,J=null,$=null,ee=null,le=null,ce=null,he=[],ue=null,de=0,pe=0,fe=0,me=0,ge=1,ve=!1,ye=!1;let be=!1;var xe={},_e={},Ee=[0,0],Ae=new n.Vector4(0,0,0,.3),Se=null,we=1,Me=1,Te=!1,Ce={isRenderingHidden:!1,isRenderingOverlays:!1},Pe=!1,De=!1,Le=n.RGBAFormat,Ie=n.FloatType,Re=!1,Oe=(n.FloatType,0),Ne=0,ke=0,Fe=[.42,0,1,1],Ve=!0,Ue={antialias:!0,sao:!1,useHdrTarget:!1,haveTwoSided:!1,useSSAA:!1,idbuffer:!0,customPresentPass:!1,envMapBg:!1,numIdTargets:1,renderEdges:!1,useIdBufferSelection:!1,copyDepth:!1},Be={},ze=null,Ge=null;function He(t){try{var i=U(2,2,t.format,t.type);i.texture.generateMipmaps=!1,e.setRenderTarget(i);var n=e.getContext(),r=n.checkFramebufferStatus(n.FRAMEBUFFER);return e.setRenderTarget(null),i.dispose(),r===n.FRAMEBUFFER_COMPLETE}catch(e){return!1}}function We(){var e=(Te?[{format:n.RGBAFormat,type:n.HalfFloatType},{format:n.RGBAFormat,type:n.FloatType}]:[{format:n.RGBAFormat,type:n.FloatType},{format:n.RGBAFormat,type:n.HalfFloatType}]).find(He);e?(Re=!0,Le=e.format,Ie=e.type):(Re=!1,s.logger.warn("Depth target is unsupported for this device."))}function je(e){Ue.useIdBufferSelection=e,e?_.material.defines.USE_IDBUFFER_SELECTION="1":delete _.material.defines.USE_IDBUFFER_SELECTION}function Xe(e){e(t);for(var i=1;i<t.variants.length;i++)e(t.variants[i])}function qe(e){t=function(){var e=P;const t=(0,D.createShaderMaterial)(e);t.blending=n.NoBlending,t.packedNormals=!0,t.depthWrite=!1;var i=1,r=2,o=4,s=8,a=[];a[0]=null;for(var l=1;l<s;l++){var c=t.clone();c.packedNormals=t.packedNormals,l&i&&(c.cutplanes=null,c.doNotCut=!0),l&r&&(c.useInstancing=!0),l&o&&(c.packedNormals=!1),a[l]=c}return t.variants=a,t.getCustomOverrideMaterial=function(e){var t=!e||!e.cutplanes||0==e.cutplanes.length,n=e.useInstancing,s=!e.packedNormals,a=(t?i:0)|(n?r:0)|(s?o:0);return this.variants[a]},t}(),i=function(e,t){var i=S;const o=(0,D.createShaderMaterial)(i);o.depthWrite=!0,o.depthTest=!0,o.isEdgeMaterial=!0,o.transparent=!0,o.blending=n.NormalBlending,o.supportsMrtNormals=!0;var s=1,a=2,l=4,c=[];c[0]=null;for(var h=1;h<l;h++){var u=o.clone();u.defines=(0,r.ObjectAssign)({},o.defines),u.isEdgeMaterial=!0,u.supportsMrtNormals=!0,h&s&&(u.useInstancing=!0),h&a&&(u.doNotCut=!0,u.cutplanes=[]),c[h]=u}return o.variants=c,o.getCustomOverrideMaterial=function(i){var n=i.useInstancing?s:0;i.doNotCut&&(n|=a);var r=this.variants[n]||o;return e.isRenderingOverlays?e.isRenderingHidden?r.uniforms.color.value.copy(B):r.uniforms.color.value.copy(z):r.uniforms.color.value.copy(t),void 0!==i.edgeOpacity&&(r.uniforms.color.value.w=i.edgeOpacity),r.uniforms.color.needsUpdate=!0,r},o}(Ce,Ae),H(g=new re.ShaderPass(ne.SAOShader)),H(m=new re.ShaderPass(Y)),H(y=new re.ShaderPass(te)),H(v=new re.ShaderPass(ie)),H(x=new re.ShaderPass(b)),H(_=new re.ShaderPass(p)),H(d=new re.ShaderPass(a.Q)),H(E=new re.ShaderPass(f.CopyShader))}function Ye(e){switch(e){case L:return!0;case I:return Re&&(Ue.sao||w.isPostProcShaded());case R:return Ue.idbuffer;case O:return!0;case F:return Ue.sao;case N:return Ue.antialias||Ue.sao||Ue.customPresentPass||w.isPostProcShaded();case k:return w.isPostProcShaded()||Ue.customPresentPass;case V:return Ue.antialias&&w.isPostProcShaded()}}function Ke(){var t=$,i=Z;if(_.uniforms.useAO.value){const r=function(){var e=[_.uniforms.useOverlay.value,_.uniforms.objIDv4.value];return _.uniforms.useOverlay.value=0,_.uniforms.objIDv4.value=new n.Vector4,e}();_.render(e,t,i),i=t,t=ce,function(e){_.uniforms.useOverlay.value=e[0],_.uniforms.objIDv4.value=e[1]}(r)}var r=t===$?ce:$;if(t=(i=w.render(e,t,i,r,!1))===$?ce:$,_.uniforms.useOverlay.value||_.uniforms.objIDv4.value){const n=function(){var e=_.uniforms.useAO.value;return _.uniforms.useAO.value=0,e}();_.render(e,t,i),i=t,function(e){_.uniforms.useAO.value=e}(n)}return r=(t=i===$?ce:$)===$?ce:$,i=w.render(e,t,i,r,!0)}function Ze(e,t){return(t=t||new n.Vector2).set((255&e)/255,(e>>8&255)/255),t}function Qe(e,t,i){t=t||0;const n=function(e){return e!==Ne&&(Ne=e,-1===e&&(e=0),_.uniforms.objIDv4.value.set((255&e)/255,(e>>8&255)/255,(e>>16&255)/255,(e>>24&255)/255),!0)}(e),r=function(e){if(Array.isArray(e)&&1==e.length&&(e=e[0]),e===ke)return!1;const t=Array.isArray(ke)?ke.length:1,i=Array.isArray(e)?e.length:1;return!(i>1&&(e.sort(),i==t&&!ke.some(((t,i)=>t!==e[i])))||(i!=t&&(1==i?delete _.material.defines.HIGHLIGHT_MODEL_ID_COUNT:_.material.defines.HIGHLIGHT_MODEL_ID_COUNT=i.toString(),_.material.needsUpdate=!0),ke=e,1==i?Ze(e=Array.isArray(e)?e[0]:e,_.uniforms.modelIDv2.value):_.uniforms.modelIDsv2v.value=e.map((e=>Ze(e))),0))}(t);if(n||r)return _.uniforms.highlightIntensity.value=0,Oe=performance.now(),_.uniforms.highlightFullModel.value=i?1:0,!0}this.settings=Ue,this.depthTargetSupported=function(){return Re},this.isRolloverHighlightEnabled=function(){return _enableRolloverHighlight},this.isWeakDevice=function(){return Te},this.init=function(t,i,a){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const c=l.offscreen,h=void 0!==l.useIdBufferSelection&&l.useIdBufferSelection;qe(t),t?(Te=(0,r.isMobileDevice)(),Ue.idbuffer=!Te,h&&(Ue.idbuffer=!0,Ue.numIdTargets=2,_.material.defines.USE_MODEL_ID="1",je(!0)),C=i,X=a,e=t,ye=!!c,be=!!l.removeAlphaInOutput,e.capabilities.isWebGL2?n.FloatType:n.HalfFloatType,We()):(0,r.isNodeJS)()||s.logger.error("You need a gl context to make a renderer. Things will go downhill from here.",(0,o.errorCodeString)(o.ErrorCodes.BROWSER_WEBGL_NOT_SUPPORTED))},this.setDepthMaterialOffset=function(e,t,i){Xe((function(n){n.polygonOffset=e,n.polygonOffsetFactor=t,n.polygonOffsetUnits=i,n.extraDepthOffset&&(n.polygonOffsetFactor+=n.extraDepthOffset),n.needsUpdate=!0}))},this.setNoDepthNoBlend=H,this.overlayUpdate=function(){if(0===Ne||-1===Ne)return!1;var e=_.uniforms.highlightIntensity.value,t=1;if(Ve){var i=.004*(performance.now()-Oe);i=Math.min(i,1),t=function(e,t){var i=3*e[1],n=3*(e[3]-e[1])-i;return(((1-i-n)*t+n)*t+i)*t}(Fe,i)}return e!=t&&(_.uniforms.highlightIntensity.value=t,!0)},this.setRollOverFadeEnabled=function(e){Ve=e},this.beginScene=function(t,i,a,l){if(c=i,u=t.fog,h=a,A=!1,q={},!Z&&C)this.initPostPipeline(Ue.sao,Ue.antialias);else if(!Z&&!C)return void(ve||(0,r.isNodeJS)()||(s.logger.error("Rendering to a canvas that was resized to zero. If you see this message you may be accidentally leaking a viewer instance.",(0,o.errorCodeString)(o.ErrorCodes.VIEWER_INTERNAL_ERROR)),ve=!0));if(l&&function(){var t=Ue.envMapBg&&!!d.material.envMap,i=!!d.material.useBackgroundTexture;if(!Se||t||i){const t=d.uniforms.uCamDir.value||new n.Vector3;d.uniforms.uCamDir.value=c.worldUpTransform?c.getWorldDirection(t).applyMatrix4(c.worldUpTransform):c.getWorldDirection(t),d.uniforms.uCamUp.value=c.worldUpTransform?c.up.clone().applyMatrix4(c.worldUpTransform):c.up,d.uniforms.uResolution.value.set(C,X),d.uniforms.uHalfFovTan.value=Math.tan(n.Math.degToRad(.5*c.fov)),d.uniforms.opacity.value=we,e.setRenderTarget(Z),e.clear(!1,!0,!1),d.render(e,Z,null)}else e.setClearColor(Se,we),e.setRenderTarget(Z),e.clear(!0,!0,!1);ze&&ze.clearTarget(e);for(var r=0;r<he.length;r++)e.setClearColor(se,1),e.setRenderTarget(he[r]),e.clear(!0,!1,!1);Ye(I)&&(e.setClearColor(ae,0),e.setRenderTarget(T),e.clear(!0,!1,!1))}(),Ye(I)){var p=i.near,f=i.far;g.uniforms.cameraNear.value=p,g.uniforms.cameraFar.value=f,y.uniforms.cameraNear.value=p,y.uniforms.cameraInvNearFar.value=1/(p-f);var m=i.projectionMatrix.elements;i.isPerspective?g.uniforms.projInfo.value.set(-2/(Z.width*m[0]),-2/(Z.height*m[5]),(1-m[8])/m[0],(1+m[9])/m[5]):g.uniforms.projInfo.value.set(-2/(Z.width*m[0]),-2/(Z.height*m[5]),(1-m[12])/m[0],(1-m[13])/m[5]),_.uniforms.projInfo.value.copy(g.uniforms.projInfo.value);var v=i.isPerspective?0:1;g.uniforms.isOrtho.value=v,_.uniforms.isOrtho.value=v;if(g.uniforms.projScale.value=Z.height*m[5]*.125,_.uniforms.worldMatrix_mainPass.value=i.matrixWorld,w.isPostProcShaded()){const e=Autodesk.Viewing.Navigation.prototype.fov2fl(i.fov);w.updateUniformValue("focalLength",e),w.updateUniformValue("unitScale",ge),w.updateUniformValue("worldMatrix_mainPass",i.matrixWorld,!0),w.updateUniformValue("cameraPos",i.position,!0),w.updateUniformValue("cameraNear",p),w.updateUniformValue("cameraFar",f),w.updateUniformValue("projInfo",g.uniforms.projInfo.value,!0),w.updateUniformValue("isOrtho",v)}}Ue.sao||(_.uniforms.useAO.value=0),this.renderScenePart(t,!0,!0,!0,!0)},this._render=function(e,t,i,n,r){e.setRenderTarget(t),e.render(i,n,r)},this._renderDepthTarget=function(i,n,r,o){if(n&&!i.sortObjects&&r){const n=i.overrideMaterial;i.overrideMaterial=t,t.depthWrite!==o&&function(e,t){e.depthWrite=t;for(var i=0;i<e.variants.length;i++){var n=e.variants[i];n&&(n.depthWrite=t)}}(t,o),this._render(e,r,i,c),i.overrideMaterial=n}},this.renderScenePart=function(t,n,r,o,s){void 0!==t.skipColorTarget&&(n=!t.skipColorTarget),void 0!==t.skipDepthTarget&&(r=!t.skipDepthTarget),void 0!==t.skipIdTarget&&(o=!t.skipIdTarget),n&&Ue.renderEdges&&(t.edgeMaterial=i);var a=r&&Ye(I),d=Z,p=T,f=!1;ze&&(d=ze.chooseColorTarget(t,d),f=(p=ze.getRenderSao(t)?T:null)&&T.shareDepthFrom!==d),A=!1,q={};var m,g,v=s?h:void 0;t.fog=u,Pe&&De?(m=Ye(R)&&o&&a?[d,p].concat(he):a?[d,p]:Ye(R)&&o?[d].concat(he):d,this._render(e,m,t,c,v)):De?(m=Ye(R)&&o?[d].concat(he):d,this._render(e,m,t,c,v),this._renderDepthTarget(t,a,p,f)):(n?(m=d,this._render(e,d,t,c,v)):f=!0,Ye(R)&&o&&(l?(g=t.overrideMaterial,t.overrideMaterial=l,this._render(e,he[0],t,c),t.overrideMaterial=g):(e.setProgramPrefix(1,"#define ID_COLOR","#define ID_COLOR"),this._render(e,he[0],t,c),e.setProgramPrefix(0,"","")),f=!1),this._renderDepthTarget(t,a,p,f)),t.edgeMaterial=void 0},this.clearAllOverlays=function(){e.setRenderTarget(Q),e.clear(!0,!1,!1)},this.renderOverlays=function(t,r,o){var s=0;Ce.isRenderingOverlays=!0;let a=!1,l=!1,h=Object.values(t).sort(((e,t)=>e.needSeparateDepth==t.needSeparateDepth?0:1==e.needSeparateDepth?1:1==t.needSeparateDepth?-1:void 0));for(let t=0;t<h.length;++t){var u=h[t],d=u.scene,p=u.camera?u.camera:c,f=e;if(d.children.filter((e=>"lmvInternal"!==e.name)).length){let e=Q;if(f.setRenderTarget(e),s||(s=1,o||(f.setClearColor(ae,0),f.clear(!0,!1,!1))),u.materialPre&&(d.overrideMaterial=u.materialPre),u.needSeparateDepth&&!l?(e=Q,e.shareDepthFrom=null,f.setRenderTarget(e),f.clear(!1,!0,!1),l=!0):e.shareDepthFrom=Z,De&&u.needIdTarget&&Ye(R)){ue||((ue=G(e.width,e.height)).shareDepthFrom=Z,ue.name="overlayId"),0==a&&(f.setRenderTarget(ue),f.clear(!0,!1,!1),a=!0);var m=[e];u.needIdTarget&&m.push(ue),this._render(f,m,d,p,r)}else this._render(f,e,d,p,r),u.needIdTarget&&(ue||((ue=G(e.width,e.height)).shareDepthFrom=Z,ue.name="overlayId"),f.setProgramPrefix(1,"#define ID_COLOR","#define ID_COLOR"),this._render(f,ue,d,p,r),f.setProgramPrefix(0,"",""));u.materialPost&&(Ce.isRenderingHidden=!0,f.getContext().depthFunc(f.getContext().GREATER),u.materialPost.depthFunc=n.GreaterDepth,Ue.renderEdges&&(i.depthWrite=!1,i.depthTest=!1,d.overrideMaterial=i,this._render(f,e,d,p)),d.overrideMaterial=u.materialPost,this._render(f,e,d,p,r),f.getContext().depthFunc(f.getContext().LEQUAL),u.materialPost.depthFunc=n.LessEqualDepth,Ce.isRenderingHidden=!1),Ue.renderEdges&&u.materialPre&&(i.depthWrite=!1,i.depthTest=!0,d.overrideMaterial=i,this._render(f,e,d,p)),d.overrideMaterial=null}}Ce.isRenderingOverlays=!1,i.depthWrite=!0,i.depthTest=!0,_.uniforms.useOverlay.value=s,s&&(_.uniforms.useOverlayAlpha.value=Me)},this.computeSSAO=function(t){if(!t&&Ue.sao){if(!A){if(K&&K.length){var i=K[0];y.uniforms.resolution.value.set(1/i.width,1/i.height),y.render(e,i,T);for(var n=1;n<K.length;n++){var r=K[n];v.uniforms.resolution.value.set(1/r.width,1/r.height),v.render(e,r,i),i=r}}g.render(e,le,Z),m.uniforms.axis.value.set(1,0),m.render(e,$,le),m.uniforms.axis.value.set(0,1),m.render(e,le,$),A=!0}_.uniforms.useAO.value=1}else _.uniforms.useAO.value=0},this.getFinalTarget=function(){return Ge||null},this.presentBuffer=function(t){if(e){var i=this.getFinalTarget();if(!(_.uniforms.useAO.value||_.uniforms.useOverlay.value||_.material.defines.BLEND_COMPANIONS||ze||0!==Ne&&-1!==Ne||0!==ke&&-1!==ke))if(Ue.antialias)if(t)x.render(e,$,Z),t.render(e,i,$);else if(w.isPostProcShaded()){const t=w.render(e,$,Z,ce);E.render(e,ee,t),x.render(e,i,ee)}else x.render(e,i,Z);else if(t)t.render(e,i,Z);else if(w.isPostProcShaded()){const t=w.render(e,$,Z,ce);E.render(e,i,t)}else E.render(e,i,Z);else if(Ue.antialias)if(t)_.render(e,$,Z),x.render(e,ce,$),t.render(e,i,ce);else if(w.isPostProcShaded()){var n=Ke();E.render(e,ee,n),x.render(e,i,ee)}else _.render(e,$,Z),x.render(e,i,$);else if(t)_.render(e,$,Z),t.render(e,i,$);else if(w.isPostProcShaded()){n=Ke();E.render(e,i,n)}else _.render(e,i,Z);if(be){const t=e.getContext(),n=t.getParameter(t.COLOR_WRITEMASK)||[!0,!0,!0,!0],r=e.getClearAlpha();e.setRenderTarget(i),t.colorMask(!1,!1,!1,!0),e.setClearAlpha(1),e.clear(),t.colorMask(...n),e.setClearAlpha(r)}}},this.composeFinalFrame=function(e,t){this.computeSSAO(e),t||this.presentBuffer()},this.cleanup=function(){if(e&&e.setRenderTarget(null),Z&&(Z.dispose(),Z=null),T&&(T.dispose(),T=null),Q&&(Q.dispose(),Q=null),ue&&(ue.dispose(),ue=null),J&&(J.dispose(),J=null),M&&(M.dispose(),M=null),ze&&ze.disposeTargets(),$&&($.dispose(),$=null),le&&(le.dispose(),le=null),ce&&(ce.dispose(),ce=null),K){for(var t=0;t<K.length;t++)K[t].dispose();K=[]}for(t=0;t<he.length;t++)he[t]&&he[t].dispose();he=[],q={},xe={},_e={}},this.setSize=function(t,i,r,o){var a,l,c,h,u,d;if(null!==(a=this._renderer)&&void 0!==a&&null!==(l=a.xr)&&void 0!==l&&l.isPresenting)return void console.warn("RenderContext: Can't change size while XR device is presenting.");if(C=t,X=i,Ue.logicalWidth=t,Ue.logicalHeight=i,0===t&&0===i||!e)return void this.cleanup();const p=e.getPixelRatio();let f=Math.max(0,t*p),v=Math.max(0,i*p);var y;Ue.deviceWidth=f,Ue.deviceHeight=v,o||(ye?e.setViewport(0,0,t,i):e.setSize(t,i));var b=f,E=v;(Ue.useSSAA||w.isPostProcShaded()&&!Te&&e.getPixelRatio()<=1&&w.postProcessEdgesOn())&&(f*=2,v*=2);var A=1/f,S=1/v;if(r||!Z||Z.width!=f||Z.height!=v){const t="undefined"!=typeof _companionsTarget;s.logger.log("Reallocating render targets."),this.cleanup(),(Z=new n.WebGLRenderTarget(f,v,{minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat,type:Ue.useHdrTarget?n.FloatType:n.UnsignedByteType,stencilBuffer:!1})).texture.generateMipmaps=!1,Z.name="colorTarget",(Q=new n.WebGLRenderTarget(f,v,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:n.RGBAFormat,stencilBuffer:!1})).texture.generateMipmaps=!1,Q.name="overlayTarget",Q.shareDepthFrom=Z,t&&this.createOrResizeCompanionsTarget(),De=e.verifyMRTWorks([Z,Q]),T=null,$=null,ee=null,le=null,ce=null,K=[]}if(ze&&ze.updateTargets(f,v,r,Ue.useHdrTarget),Ye(N)&&(!r&&$&&$.width==f&&$.height==v||(($=new n.WebGLRenderTarget(f,v,{minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat,stencilBuffer:!1,depthBuffer:!1})).texture.generateMipmaps=!1,$.name="postTarget1")),!le&&Ye(F)&&((le=$.clone()).name="SSAO target"),!ce&&Ye(k)&&((ce=$.clone()).name="post target 2"),!ee&&Ye(V)&&((ee=new n.WebGLRenderTarget(b,E,{minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat,stencilBuffer:!1,depthBuffer:!1})).texture.generateMipmaps=!1,ee.name="postTargetNormal"),Ye(I)){if(r||!T||T.width!=f||T.height!=v){T=U(f,v,Le,Ie,Z),K=[];for(var M=0;M<5;M++){var P=0|f/(2<<M),D=0|v/(2<<M),L=null;P>=1&&D>=1&&((L=new n.WebGLRenderTarget(P,D,{minFilter:n.NearestFilter,magFilter:n.NearestFilter,format:n.RGBAFormat,depthBuffer:!1,stencilBuffer:!1})).texture.generateMipmaps=!1,K.push(L),L.name="depthTarget_mipmap "+M),g.uniforms["tDepth_mip"+(M+1)].value=L.texture}Pe=e.verifyMRTWorks([Z,T])}g.uniforms.size.value.set(f,v),g.uniforms.resolution.value.set(A,S),g.uniforms.tDepth.value=T.texture,m.uniforms.size.value.set(f,v),m.uniforms.resolution.value.set(A,S),w.updateUniformValue("tDepth",T),_.uniforms.tDepth.value=T.texture}if(Ye(R)){if(r||!he[0]||he[0].width!=f||he[0].height!=v){for(y=0;y<he.length;y++)he[y]&&he[y].dispose();for(he=[],y=0;y<Ue.numIdTargets;y++){var O=G(f,v);O.shareDepthFrom=Z,O.name="id "+y,he.push(O)}De||s.logger.warn("ID buffer requested, but MRT is not supported. Some features will not work.")}w.updateUniformValue("tID",he[0])}else if(he[0]){for(y=0;y<he.length;y++)he[y].dispose(),he[y]=null;he.length=0}x.uniforms.uResolution.value.set(A,S),w.changeResolution(A,S),_.uniforms.tOverlay.value=null===(c=Q)||void 0===c?void 0:c.texture,_.uniforms.tAO.value=null===(h=le)||void 0===h?void 0:h.texture,_.uniforms.useAO.value=Ue.sao?1:0,_.uniforms.resolution.value.set(A,S),_.uniforms.tID.value=(null===(u=he[0])||void 0===u?void 0:u.texture)||null,_.uniforms.tID2.value=(null===(d=he[1])||void 0===d?void 0:d.texture)||null,ze&&ze.updateBlendPass()},this.getMaxAnisotropy=function(){let t;return t=e?e.getMaxAnisotropy():0,t},this.mrtFlags=function(){return{mrtNormals:Pe&&Ye(I),mrtIdBuffer:De&&Ye(R)?Ue.numIdTargets:void 0}},this.setIdTargetCount=function(e){if(!(e>2||e<1)&&e!==Ue.numIdTargets&&(Ue.numIdTargets=e,0!==he.length&&2===e&&1===he.length)){var t=G(he[0].width,he[0].height);return t.shareDepthFrom=Z,t.name="id "+he.length,he.push(t),_.uniforms.tID2.value=t,_.material.defines.USE_MODEL_ID="1",_.material.needsUpdate=!0,!0}},this.getAntialiasing=function(){return Ue.antialias},this.initPostPipeline=function(e,t){Ue.sao=e&&!r.isIE11&&Re,Ue.antialias=t&&!r.isIE11,Ue.haveTwoSided&&Xe((function(e){e.side=n.DoubleSide})),Xe((function(e){e.needsUpdate=!0})),g.material.needsUpdate=!0,m.material.needsUpdate=!0,y.material.needsUpdate=!0,v.material.needsUpdate=!0,x.material.needsUpdate=!0,w.setMaterialNeedsUpdate(),_.material.needsUpdate=!0,d.material.needsUpdate=!0,E.material.needsUpdate=!0,this.setSize(C,X)},this.setClearColors=function(e,t){(Se=t?e.equals(t)||Te?new n.Color(.5*(e.x+t.x),.5*(e.y+t.y),.5*(e.z+t.z)):void 0:e.clone())||(d.uniforms.color1.value.copy(e),d.uniforms.color2.value.copy(t))},this.useOverlayAlpha=function(e){Me=e},this.setClearAlpha=function(e){we=e},this.setAOEnabled=function(e){Ue.sao=e&&Re,Be.sao=Ue.sao,this.setSize(C,X,!1,!0)},this.setAOOptions=function(e,t,i){void 0!==e&&(g.uniforms.radius.value=e,g.uniforms.bias.value=(0,r.isMobileDevice)()?.1:.01,m.uniforms.radius.value=e),void 0!==t&&(g.uniforms.intensity.value=t),_.uniforms.aoOpacity.value=void 0!==i?i:1,A=!1},this.getAOEnabled=function(){return Ue.sao},this.getAORadius=function(){return g.uniforms.radius.value},this.getAOIntensity=function(){return g.uniforms.intensity.value},this.setCubeMap=function(e){d.material.envMap=e,e||this.toggleEnvMapBackground(!1),e&&Ue.envMapBg&&(d.uniforms.envMapBackground.value=!0)},this.setBackgroundTexture=function(e){const t=d.material.useBackgroundTexture;d.uniforms.backgroundTexture.value=e,d.material.useBackgroundTexture=!!e,!!e!==t&&(d.material.needsUpdate=!0)},this.getCubeMap=function(){return d.material.envMap},this.setEnvRotation=function(e){fe=e,d.material.envRotationSin=Math.sin(e),d.material.envRotationCos=Math.cos(e)},this.getEnvRotation=function(){return fe},this.setEnvExposure=function(e){const t=d.material.envMapExposure,i=Math.pow(2,e);d.uniforms.envMapExposure.value=i,d.material.envMapExposure=i,i!==t&&(d.material.needsUpdate=!0),de=e},this.setTonemapExposureBias=function(e){pe=e,d.uniforms.exposureBias.value=Math.pow(2,e)},this.getExposureBias=function(){return pe},this.setCamera=function(e){c=e},this.setTonemapMethod=function(t){const i=me;me=t,e.gammaInput=0!==t,d.material.tonemapOutput=me,t!==i&&(d.material.needsUpdate=!0)},this.getToneMapMethod=function(){return me},this.toggleTwoSided=function(e){Ue.haveTwoSided!=e&&t&&Xe((function(t){t.side=e?n.DoubleSide:n.FrontSide,t.needsUpdate=!0})),Ue.haveTwoSided=e},this.toggleEdges=function(e){Ue.renderEdges=e,Be.renderEdges=e},this.getRenderEdges=function(){return Ue.renderEdges},this.toggleEnvMapBackground=function(e){Ue.envMapBg=e,d.uniforms.envMapBackground.value=e&&!!d.material.envMap},this.enter2DMode=function(e,t){l=e,Be.sao=Ue.sao,Be.antialias=Ue.antialias,Be.idbuffer=Ue.idbuffer,Be.renderEdges=Ue.renderEdges,Be.useIdBufferSelection=Ue.useIdBufferSelection,t&&(Be.selectionColor=Ue.selectionColor,this.setSelectionColor(t)),Ue.idbuffer=!0,Ue.renderEdges=!1,_.material.defines.IS_2D="",je(Ue.idbuffer),this.initPostPipeline(!1,!1)},this.exit2DMode=function(){l=null,Ue.idbuffer=Be.idbuffer,Ue.renderEdges=Be.renderEdges,Be.selectionColor&&this.setSelectionColor(Be.selectionColor),delete _.material.defines.IS_2D,je(Be.idbuffer),this.initPostPipeline(Be.sao,Be.antialias)},this.idAtPixel=function(e,t,i,n){return this.idAtPixels(e,t,1,i,n)},this.idAtPixels=function(t,i,n,r,o){if(o&&o[0]||(o=he),!o[0])return 0;let s,a;if(n%2==0&&(n+=1),s=.5*(t+1)*o[0].width-.5*(n-1),a=.5*(i+1)*o[0].height-.5*(n-1),q[n]&&s===q[n][4]&&a===q[n][5]&&q[n][6]==o[0].name)return W(q[n],r),q[n][0];const l=4*n*n;xe[l]||(xe[l]=new Uint8Array(l));const c=xe[l];let h;return e.readRenderTargetPixels(o[0],s,a,n,n,c),o[1]&&(_e[l]||(_e[l]=new Uint8Array(l)),h=_e[l],e.readRenderTargetPixels(o[1],s,a,n,n,h)),function(e,t,i,n,r,o,s){let a;s=s||he;let l=0,c=0,h=0,u=-1;q[i]=[-1,-1,null,null,e,t,s[0].name];for(let o=0;o<i*i;o++){const o=l+(i-1)/2,p=c+(i-1)/2;if(o>=0&&o<=i&&p>=0&&p<=i){const l=o+p*i;if(a=n[4*l+2]<<16|n[4*l+1]<<8|n[4*l],a=a<<8>>8,q[i][0]=a,r){var d=r[4*l+1]<<8|r[4*l];q[i][1]=d<<16>>16}if(q[i][2]=2*(e+o)/s[0].width-1,q[i][3]=2*(t+p)/s[0].height-1,-1!==a)break}if(l==c||l<0&&l==-c||l>0&&l==1-c){const e=h;h=-u,u=e}l+=h,c+=u}return W(q[i],o),a}(s,a,n,c,h,r,o)},this.idsAtPixelsBox=function(t,i,n,r,o,s){if((s=s||he)[0]){var a=n*s[0].width,l=r*s[0].height,c=0|.5*(t+1)*s[0].width,h=0|.5*(i+1)*s[0].height,u=new Uint8Array(4*a*l);e.readRenderTargetPixels(s[0],c,h,a,l,u);var d=void 0;o&&s[1]&&(d=new Uint8Array(4*a*l),e.readRenderTargetPixels(s[1],c,h,a,l,d));var p={};for(let e=0;e<u.length;e+=4){var f=u[4*e+2]<<16|u[4*e+1]<<8|u[4*e];if((f=f<<8>>8)>0){var m=0;d&&(m=(m=d[4*e+1]<<8|d[4*e])<<16>>16);var g=f+"-"+m;p[g]||(p[g]=!0,o.push([f,m]))}}}},this.readbackTargetId=function(){if(!he[0])return null;var t=new Uint8Array(4*he[0].width*he[0].height);return e.readRenderTargetPixels(he[0],0,0,he[0].width,he[0].height,t),{buffer:t,width:he[0].width,height:he[0].height}},this.rolloverObjectViewport=function(e,t){Ee[1]=0;var i=this.idAtPixel(e,t,Ee);return this.rolloverObjectId(i,null,Ee[1])},this.rolloverObjectId=function(e,t,i){return Qe(e,i,!1)},this.getRollOverDbId=function(){return Ne},this.getRollOverModelId=function(){return ke},this.rollOverModelId=function(e){return Qe(1,e,!0)},this.setRollOverHighlightColor=function(e){e?_.uniforms.highlightColor.value.copy(e):_.uniforms.highlightColor.value.setRGB(1,1,1)},this.setDbIdForEdgeDetection=function(e,t){_.uniforms.edgeObjIDv4.value.set((255&e)/255,(e>>8&255)/255,(e>>16&255)/255,(e>>24&255)/255),_.uniforms.edgeModelIDv2.value.set((255&t)/255,(t>>8&255)/255)},this.setSpatialFilterForRollOver=function(e){if(!e||this.spatialFilterForRollOverSupported()){var t="SPATIAL_FILTER";_.material.defines[t]!==e&&(e&&""!==e?_.material.defines[t]=e:delete _.material.defines[t],_.material.needsUpdate=!0,_.uniforms.highlightIntensity.value=0,Oe=performance.now())}else s.logger.warn("Spatial filter for mouse-over can only be used with depth target")},this.spatialFilterForRollOverSupported=function(){return Ye(I)},this.setEdgeColor=function(e){Ae.copy(e)},this.setSelectionColor=function(e){var t=new n.Color(e);t.r=Math.pow(t.r,2),t.g=Math.pow(t.g,2),t.b=Math.pow(t.b,2),_.uniforms.selectionColor.value.set(t),_.material.needsUpdate=!0,Ue.selectionColor=e},this.setUnitScale=function(e){ge=e},this.getUnitScale=function(){return ge},this.getBlendPass=function(){return _},this.getClearPass=function(){return d},this.getColorTarget=function(){return Z},this.getIDTargets=function(){return he},this.getDepthTarget=function(){return T},this.getIdTarget=function(){return he[0]},this.getOverlayIdTarget=function(){return ue},this.getDepthMaterial=function(){return t},this.getPostTarget=function(){return $},this.getEdgeMaterial=function(){return i},this.setCrossFade=function(e){ze=e},this.getCrossFade=function(){return ze},this.setOffscreenTarget=function(e){Ge=e},this.getOffscreenTarget=function(){return Ge},this.getNamedTarget=function(e){switch(e){case"color":return Z;case"overlay":return Q;case"companions":return _companionsTarget;case"id":return he[0];case"post1":return $;case"post2":return ce;case"postdisplay":return ee;case"ssao":return le;case"depth":return T}return null},this.getCurrentFramebuffer=function(){return e.getCurrentFramebuffer()},this.getConfig=function(){return{renderEdges:Ue.renderEdges,envMapBackground:Ue.envMapBg,envMap:d.material.envMap,envExposure:de,toneMapExposureBias:pe,envRotation:this.getEnvRotation(),tonemapMethod:me,clearColor:Se&&Se.clone(),clearColorTop:!Se&&d.uniforms.color1.value.clone(),clearColorBottom:!Se&&d.uniforms.color2.value.clone(),clearAlpha:we,useOverlayAlpha:Me,aoEnabled:this.getAOEnabled(),aoRadius:this.getAORadius(),aoIntensity:this.getAOIntensity(),twoSided:Ue.haveTwoSided,edgeColor:Ae.clone(),unitScale:this.getUnitScale(),is2D:!!_.material.defines.IS_2D,antialias:this.getAntialiasing(),idMaterial:l,selectionColor:Ue.selectionColor}},this.applyConfig=function(e){this.toggleEdges(e.renderEdges),this.toggleEnvMapBackground(e.envMapBackground),this.setCubeMap(e.envMap),this.setEnvExposure(e.envExposure),this.setTonemapExposureBias(e.toneMapExposureBias),this.setEnvRotation(e.envRotation),this.setTonemapMethod(e.tonemapMethod),this.toggleTwoSided(e.twoSided),this.setEdgeColor(e.edgeColor),this.setUnitScale(e.unitScale),e.clearColor?this.setClearColors(e.clearColor):this.setClearColors(e.clearColorTop,e.clearColorBottom),this.setClearAlpha(e.clearAlpha),this.useOverlayAlpha(e.useOverlayAlpha);var t=!!_.material.defines.IS_2D;e.is2D&&!t?this.enter2DMode(e.idMaterial,e.selectionColor):!e.is2D&&t&&(this.setSelectionColor(e.selectionColor),this.exit2DMode());var i=e.aoEnabled!=this.getAOEnabled(),n=e.antialias!=this.getAntialiasing();(i||n)&&this.initPostPipeline(e.aoEnabled,e.antialias)},this.targetToCanvas=function(t){var i=t.width,n=t.height,o=new Uint8Array(i*n*4);e.readRenderTargetPixels(t,0,0,i,n,o);var s=oe.createElement("canvas");s.width=i,s.height=n;var a,l=s.getContext("2d"),c=new Uint8ClampedArray(o);return r.isIE11?(a=l.createImageData(i,n)).data.set(c):a=new ImageData(c,i,n),l.putImageData(a,0,0),l.globalCompositeOperation="copy",l.translate(0,n),l.scale(1,-1),l.drawImage(s,0,0,i,n),l.globalCompositeOperation="source-over",{canvas:s,ctx:l}},this.resetRenderStats=function(){e.info.reset()},this.getRenderStats=function(){return Object.assign({},e.info.render)}}},82089:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RenderContextPostProcessExtension:()=>n,RenderContextPostProcessManager:()=>r});class n{constructor(e,t){this.viewer=t,this.renderContext=e,this.postProcPass=null,this.postProcShaded=!1,this.setGlobalManager(t.globalManager)}load(){}unload(){this.viewer=null,this.renderContext=null,this.postProcPass=null}enable(){this.setPostProcShaded(!0);const e=this.renderContext.settings;this.renderContext.initPostPipeline(e.sao,e.antialias),this.viewer.impl.fireRenderOptionChanged(),this.viewer.impl.invalidate(!0,!0,!0)}disable(){this.setPostProcShaded(!1),this.viewer.impl.invalidate(!1,!1,!0)}shouldRenderAfterOverlays(){return!1}render(e,t,i,n){const r=void 0===n||n===this.shouldRenderAfterOverlays();return!(!this.isPostProcShaded()||!r)&&(this.postProcPass.render(e,t,i),!0)}updateUniformValue(e,t,i){this.postProcPass.uniforms[e]&&(i?this.postProcPass.uniforms[e].value.copy(t):this.postProcPass.uniforms[e].value=t,this.viewer.impl.invalidate(!1,!1,!0))}updateDefineValue(e,t){this.postProcPass.material.defines[e]!==t&&(null!==t?this.postProcPass.material.defines[e]=t:delete this.postProcPass.material.defines[e],this.setMaterialNeedsUpdate())}getUniformValue(e){return this.postProcPass.uniforms[e].value}getDefineValue(e){return this.postProcPass.material.defines[e]}changeResolution(e,t){this.postProcPass.uniforms.resolution.value.set(e,t)}setMaterialNeedsUpdate(){this.postProcPass.material.needsUpdate=!0,this.viewer.impl.invalidate(!1,!1,!0)}postProcessEdgesOn(){return!1}setPostProcShaded(e){this.postProcShaded=e}isPostProcShaded(){return this.postProcShaded}getOrder(){return 0}}class r{constructor(){this.rcExtensions=[]}registerPostProcessingExtension(e){this.rcExtensions.push(e),this.rcExtensions.sort(((e,t)=>t.getOrder()-e.getOrder()))}removePostProcessingExtension(e){const t=this.rcExtensions.indexOf(e);-1!==t&&(e.unload(),this.rcExtensions.splice(t,1))}render(e,t,i,n,r){for(let o=0;o<this.rcExtensions.length;o++){if(this.rcExtensions[o].render(e,t,i,r)){i=t;const e=t;t=n,n=e}}return i}updateUniformValue(e,t,i){for(let n=0;n<this.rcExtensions.length;n++)this.rcExtensions[n].updateUniformValue(e,t,i)}changeResolution(e,t){for(let i=0;i<this.rcExtensions.length;i++)this.rcExtensions[i].changeResolution(e,t)}setMaterialNeedsUpdate(){for(let e=0;e<this.rcExtensions.length;e++)this.rcExtensions[e].setMaterialNeedsUpdate()}postProcessEdgesOn(){return this.rcExtensions.some((e=>e.postProcessEdgesOn()))}isPostProcShaded(){return this.rcExtensions.some((e=>e.isPostProcShaded()))}}},41839:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SAOShader:()=>c});var n=i(41434),r=i(83539),o=i(66209),s=i.n(o),a=i(6890),l=i.n(a);let c={uniforms:n.UniformsUtils.merge([r.ShaderChunks.DepthTextureUniforms,{size:{type:"v2",value:new n.Vector2(512,512)},resolution:{type:"v2",value:new n.Vector2(1/512,1/512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},radius:{type:"f",value:12},bias:{type:"f",value:.1},projScale:{type:"f",value:500},intensity:{type:"f",value:1},tDepth_mip1:{type:"t",value:null},tDepth_mip2:{type:"t",value:null},tDepth_mip3:{type:"t",value:null},tDepth_mip4:{type:"t",value:null},tDepth_mip5:{type:"t",value:null}}]),vertexShader:s(),fragmentShader:l()}},83539:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CutPlanesShaderChunk:()=>Le,CutPlanesUniforms:()=>fe,DepthTextureTestUniforms:()=>Ee,DepthTextureUniforms:()=>_e,EnvSamplingShaderChunk:()=>Oe,FinalOutputShaderChunk:()=>Ue,HatchPatternShaderChunk:()=>Re,IdFragmentDeclaration:()=>Fe,IdOutputShaderChunk:()=>Ve,IdUniforms:()=>me,IdVertexDeclaration:()=>Ne,IdVertexShaderChunk:()=>ke,InstancingVertexDeclaration:()=>Ge,OrderedDitheringShaderChunk:()=>De,PackDepthShaderChunk:()=>Ce,PackNormalsShaderChunk:()=>Ie,PointSizeDeclaration:()=>qe,PointSizeShaderChunk:()=>Ye,PointSizeUniforms:()=>be,ShaderChunks:()=>Ke,ShadowMapCommonUniforms:()=>ve,ShadowMapDeclareCommonUniforms:()=>He,ShadowMapFragmentDeclaration:()=>Xe,ShadowMapUniforms:()=>ye,ShadowMapVertexDeclaration:()=>We,ShadowMapVertexShaderChunk:()=>je,ThemingFragmentDeclaration:()=>Be,ThemingFragmentShaderChunk:()=>ze,ThemingUniform:()=>ge,TonemapShaderChunk:()=>Pe,WideLinesUniforms:()=>xe,resolve:()=>Te});var n=i(41434),r=i(23300),o=i.n(r),s=i(25334),a=i.n(s),l=i(73985),c=i.n(l),h=i(52035),u=i.n(h),d=i(32263),p=i.n(d),f=i(15931),m=i.n(f),g=i(52698),v=i.n(g),y=i(7246),b=i.n(y),x=i(7959),_=i.n(x),E=i(61539),A=i.n(E),S=i(74610),w=i.n(S),M=i(46223),T=i.n(M),C=i(53833),P=i.n(C),D=i(94005),L=i.n(D),I=i(25759),R=i.n(I),O=i(58121),N=i.n(O),k=i(4949),F=i.n(k),V=i(11458),U=i.n(V),B=i(36238),z=i.n(B),G=i(65080),H=i.n(G),W=i(72448),j=i.n(W),X=i(81456),q=i.n(X),Y=i(65355),K=i.n(Y),Z=i(58998),Q=i.n(Z),J=i(72438),$=i.n(J),ee=i(14227),te=i.n(ee),ie=i(16006),ne=i.n(ie),re=i(26649),oe=i.n(re),se=i(13458),ae=i.n(se),le=i(16017),ce=i.n(le),he=i(68643),ue=i.n(he),de=i(21600),pe=i.n(de);let fe={cutplanes:{type:"v4v",value:[]},hatchParams:{type:"v2",value:new n.Vector2(1,10)},hatchTintColor:{type:"c",value:new n.Color(16777215)},hatchTintIntensity:{type:"f",value:1}},me={dbId:{type:"v3",value:new n.Vector3(0,0,0)},modelId:{type:"v3",value:new n.Vector3(0,0,0)}},ge={themingColor:{type:"v4",value:new n.Vector4(0,0,0,0)}},ve={shadowESMConstant:{type:"f",value:0}},ye=n.UniformsUtils.merge([{shadowMap:{type:"t",value:null},shadowMapSize:{type:"v2",value:new n.Vector2(0,0)},shadowBias:{type:"f",value:0},shadowDarkness:{type:"f",value:0},shadowMatrix:{type:"m4",value:new n.Matrix4},shadowLightDir:{type:"v3",value:new n.Vector3}},ve]),be={point_size:{type:"f",value:1}},xe={view_size:{type:"v2",value:new n.Vector2(640,480)}},_e={tDepth:{type:"t",value:null},projInfo:{type:"v4",value:new n.Vector4},isOrtho:{type:"f",value:0},worldMatrix_mainPass:{type:"m4",value:new n.Matrix4}},Ee={tDepthTest:{type:"t",value:null},tDepthResolution:{type:"v2",value:new n.Vector2(1/1024,1/1024)}};var Ae={};for(var Se in n.ShaderChunk)Ae[Se]=n.ShaderChunk[Se];Ae.pack_depth=o(),Ae.depth_texture=a(),Ae.tonemap=c(),Ae.ordered_dither=u(),Ae.cutplanes=p(),Ae.pack_normals=m(),Ae.hatch_pattern=v(),Ae.env_sample=b(),Ae.id_decl_vert=_(),Ae.id_vert=A(),Ae.id_decl_frag=w(),Ae.id_frag=T(),Ae.final_frag=P(),Ae.theming_decl_frag=L(),Ae.theming_frag=R(),Ae.instancing_decl_vert=N(),Ae.shadowmap_decl_common=F(),Ae.shadowmap_decl_vert=U(),Ae.shadowmap_vert=z(),Ae.shadowmap_decl_frag=H(),Ae.float3_average=j(),Ae.line_decl_common=q(),Ae.prism_wood=K(),Ae.prism_glazing=Q(),Ae.prism_transparency=$(),Ae.normal_map=te(),Ae.decl_point_size=ne(),Ae.point_size=oe(),Ae.wide_lines_decl=ae(),Ae.wide_lines_vert=ce(),Ae.hsv=ue(),Ae.importance_sampling=pe();var we={},Me={};for(Se in we)Me[Se]=new RegExp("#"+Se+" *<([\\w\\d., ]*)>","g");let Te=function(e){for(var t in we){var i=Me[t];e=e.replace(i,(function(e,i){var n=i.split(",").map((function(e){return e.trim()}));return we[t].apply(null,n)}))}return e.replace(/#include *<([\w\d.]+)>/g,(function(e,t){if(!Ae[t])throw new Error("Cannot resolve #include<"+t+">");return Te(Ae[t])}))},Ce=Ae.pack_depth,Pe=Ae.tonemap,De=Ae.ordered_dither,Le=Ae.cutplanes,Ie=Ae.pack_normals,Re=Ae.hatch_pattern,Oe=Ae.env_sample,Ne=Ae.id_decl_vert,ke=Ae.id_vert,Fe=Ae.id_decl_frag,Ve=Ae.id_frag,Ue=Ae.final_frag,Be=Ae.theming_decl_frag,ze=Ae.theming_frag,Ge=Ae.instancing_decl_vert,He=Ae.shadowmap_decl_common,We=Ae.shadowmap_decl_vert,je=Ae.shadowmap_vert,Xe=Ae.shadowmap_decl_frag,qe=Ae.decl_point_size,Ye=Ae.point_size,Ke={IdUniforms:me,ThemingUniform:ge,CutPlanesUniforms:fe,ShadowMapCommonUniforms:ve,ShadowMapUniforms:ye,PointSizeUniforms:be,WideLinesUniforms:xe,DepthTextureUniforms:_e,DepthTextureTestUniforms:Ee,PackDepthShaderChunk:Ce,TonemapShaderChunk:Pe,OrderedDitheringShaderChunk:De,CutPlanesShaderChunk:Le,PackNormalsShaderChunk:Ie,HatchPatternShaderChunk:Re,EnvSamplingShaderChunk:Oe,IdVertexDeclaration:Ne,IdVertexShaderChunk:ke,IdFragmentDeclaration:Fe,IdOutputShaderChunk:Ve,FinalOutputShaderChunk:Ue,ThemingFragmentDeclaration:Be,ThemingFragmentShaderChunk:ze,InstancingVertexDeclaration:Ge,ShadowMapDeclareCommonUniforms:He,ShadowMapVertexDeclaration:We,ShadowMapVertexShaderChunk:je,ShadowMapFragmentDeclaration:Xe,PointSizeDeclaration:qe,PointSizeShaderChunk:Ye,...Ae,resolve:Te}},29480:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ShaderPass:()=>s});var n=i(38074),r=i(41434),o=i(93033);let s=function(e,t){this.textureID=void 0!==t?t:"tDiffuse",this.material=(0,n.createShaderMaterial)(e),this.uniforms=this.material.uniforms,this.renderToScreen=!1,this.enabled=!0,this.clear=!1,this.camera=new r.OrthographicCamera(-1,1,1,-1,0,1),this.camera.disableXr=!0;var i=new r.BufferGeometry,s=new Float32Array(9);s[0]=-1,s[1]=-1,s[2]=0,s[3]=3,s[4]=-1,s[5]=0,s[6]=-1,s[7]=3,s[8]=0;var a=new Float32Array(6);a[0]=0,a[1]=0,a[2]=2,a[3]=0,a[4]=0,a[5]=2;var l=new Float32Array(9);l[0]=0,l[1]=0,l[2]=1,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=1,i.setAttribute("position",new r.BufferAttribute(s,3)),i.setAttribute("normal",new r.BufferAttribute(l,3)),i.setAttribute("uv",new r.BufferAttribute(a,2)),this.quad=new o.LMVMesh(i,this.material),this.scene=new r.Scene,this.scene.add(this.quad)};s.prototype={render:function(e,t,i,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i),e.setRenderTarget(t),!this.renderToScreen&&this.clear&&e.clear(),e.render(this.scene,this.camera)}}},38074:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ShaderUtils:()=>l,cloneShader:()=>r,createShaderMaterial:()=>o,removeMacro:()=>a,setMacro:()=>s});var n=i(41434);i(62868);const r=function(e){let t={vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return e.uniforms&&(t.uniforms=n.UniformsUtils.clone(e.uniforms)),e.defines&&(t.defines=Object.assign({},e.defines)),e.extensions&&(t.extensions=Object.assign({},e.extensions)),t};let o=function(e){var t=r(e);let i;return e.attributes&&(t.attributes=e.attributes),i=new n.ShaderMaterial(t),i},s=function(e,t,i){i=i||"",e.defines||(e.defines={}),e.defines[t]!=i&&(e.defines[t]=i,e.needsUpdate=!0)},a=function(e,t){(e.defines||e.defines[t])&&(delete e.defines[t],e.needsUpdate=!0)};const l={cloneShader:r,createShaderMaterial:o,setMacro:s,removeMacro:a}},20657:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GroundShadowShader:()=>x,SHADOWMAP_INCOMPLETE:()=>S,SHADOWMAP_NEEDS_UPDATE:()=>A,SHADOWMAP_VALID:()=>w,ShadowConfig:()=>E,ShadowMapOverrideMaterials:()=>_,ShadowMapShader:()=>b,ShadowMaps:()=>C,ShadowRender:()=>P});var n=i(83539),r=i(38074),o=i(57865),s=i(40424),a=i(49310),l=i(34423),c=i(41434),h=i(47065),u=i.n(h),d=i(18214),p=i.n(d),f=i(2680),m=i.n(f),g=i(83159),v=i.n(g),y=i(11236);let b={uniforms:c.UniformsUtils.merge([n.ShaderChunks.ShadowMapCommonUniforms,{shadowMapRangeMin:{type:"f",value:0},shadowMapRangeSize:{type:"f",value:0},shadowMinOpacity:{type:"f",value:0},map:{type:"t",value:null},alphaMap:{type:"t",value:null},texMatrix:{type:"m3",value:new c.Matrix3},texMatrixAlpha:{type:"m3",value:new c.Matrix3}},(0,o.GetPrismMapUniforms)("surface_cutout_map")]),vertexShader:u(),fragmentShader:p()},x={uniforms:n.ShaderChunks.ShadowMapUniforms,vertexShader:m(),fragmentShader:v()};function _(){var e=[],t=(0,r.createShaderMaterial)(b),i=new c.Material;i.visible=!1;var n=[];var o=new function(){this.init=function(){this.isPrism=!1,this.alphaMap=!1,this.alphaClampS=!1,this.alphaClampT=!1,this.alphaInvert=!1,this.rgbaMap=!1,this.rgbaClampS=!1,this.rgbaClampT=!1,this.rgbaInvert=!1,this.instanced=!1,this.decalIndex=-1},this.init(),this.getMaterialIndex=function(){return(this.isPrism?1:0)|(this.alphaMap?2:0)|(this.alphaClampS?4:0)|(this.alphaClampT?8:0)|(this.alphaInvert?16:0)|(this.rgbaMap?32:0)|(this.rgbaClampS?64:0)|(this.rgbaClampT?128:0)|(this.rgbaInvert?256:0)|(this.instanced?512:0)|1024*(this.decalIndex+1)}};function s(n,s){if((a=n)instanceof y.LMVMeshPhongMaterial?a.opacity<E.ShadowMinOpacity:a.isPrismMaterial?"PrismTransparent"===a.prismType||"PrismGlazing"===a.prismType:!a.visible)return i;var a,l=n instanceof y.LMVMeshPhongMaterial,h=n.isPrismMaterial;if(!l&&!h)return null;var u=l?n.alphaMap:n.surface_cutout_map,d=l&&n.alphaTest?n.map:null;if(!u&&!d&&!n.useInstancing)return null;var p=o;p.init(),p.isPrism=h,p.alphaMap=!!u,p.rgbaMap=!!d,p.instanced=n.useInstancing,p.decalIndex=void 0===s?-1:s,u&&(p.alphaClampS=u.clampS,p.alphaClampT=u.clampT,p.alphaInvert=u.invert),d&&(p.rgbaClampS=d.clampS,p.rgbaClampT=d.clampT,p.rgbaInvert=d.invert);var f=function(i,n){var o,s,a,l,c,h=i.getMaterialIndex();if(!e[h]){var u=t.clone();i.isPrism&&i.alphaMap&&((0,r.setMacro)(u,"USE_SURFACE_CUTOUT_MAP"),u.fragmentShader=(o="surface_cutout",s=i.alphaClampS,a=i.alphaClampT,l="uv_"+o+"_map",c="",s&&a?c="if ("+l+".x < 0.0 || "+l+".x > 1.0 || "+l+".y < 0.0 || "+l+".y > 1.0) { discard; }":s?c="if ("+l+".x < 0.0 || "+l+".x > 1.0) { discard; }":a&&(c="if ("+l+".y < 0.0 || "+l+".y > 1.0) { discard; }"),"#define "+o.toUpperCase()+"_CLAMP_TEST "+c+"\n"+u.fragmentShader)),i.instanced&&(u.useInstancing=!0),e[h]=u}return e[h]}(p);return u&&(l?(f.uniforms.alphaMap.value=u,f.uniforms.texMatrixAlpha.value=u.matrix,f.alphaMap=u,f.side=n.side):(f.uniforms.surface_cutout_map.value=u,f.uniforms.surface_cutout_map_texMatrix.value.copy(u.matrix),f.uniforms.surface_cutout_map_invert.value=u.invert,f.side=c.DoubleSide)),d&&(f.uniforms.map.value=d,f.uniforms.texMatrix.value=d.matrix,f.map=d),f}this.forEachMaterial=function(i){for(var n=0;n<e.length;n++){var r=e[n];r&&i(r)}i(t)},this.getCustomOverrideMaterial=function(e){var t=s(e);if(!t)return null;if(!e.decals)return t.decals=null,t;if(e.decals){n.length=0;for(var i=0;i<e.decals.length;i++){var r=e.decals[i],o=s(r.material,i);if(!o)return null;n.push({uv:r.uv,material:o})}}return t.decals=n,t},this.dispose=function(){this.forEachMaterial((function(e){e.dispose()}))}}const E={ShadowMapSize:1024,ShadowESMConstant:80,ShadowBias:.001,ShadowDarkness:.7,ShadowMapBlurRadius:4,ShadowMinOpacity:.9,UseHardShadows:!1,BlurShadowMap:!0},A=0,S=1,w=2;function M(){this.shadowMap=void 0,this.shadowMapSize=void 0,this.shadowMatrix=void 0,this.shadowLightDir=void 0,this.init=function(e){this.shadowMap=e,this.shadowMapSize=new c.Vector2(e.width,e.height),this.shadowMatrix=new c.Matrix4,this.shadowLightDir=new c.Vector3},this.apply=function(e){e.shadowMap=this.shadowMap,e.shadowMatrix=this.shadowMatrix,e.shadowLightDir=this.shadowLightDir,this.shadowMap?((0,r.setMacro)(e,"USE_SHADOWMAP"),E.UseHardShadows&&(0,r.setMacro)(e,"USE_HARD_SHADOWS")):((0,r.removeMacro)(e,"USE_SHADOWMAP"),(0,r.removeMacro)(e,"USE_HARD_SHADOWS"))}}var T=new M;function C(e){var t=null,i=null,n=new c.OrthographicCamera,o=Math.exp(E.ShadowESMConstant),h=E.UseHardShadows?new c.Color(1,1,1):new c.Color(o,1,1),u=e,d=null,p=null,f=null,m=(0,r.createShaderMaterial)(b),g=new _;m.getCustomOverrideMaterial=g.getCustomOverrideMaterial;var v=null;function y(e,t){e.forEach((function(e){t.apply(e)}))}function C(e){var t=new c.WebGLRenderTarget(e,e,{minFilter:c.LinearFilter,magFilter:c.LinearFilter,format:c.RGBAFormat,type:c.FloatType,stencilBuffer:!1,generateMipmaps:!1});return t.texture.generateMipmaps=!1,t}function P(e){u.setRenderTarget(e),u.setClearColor(h,1),u.clear()}var D,L,I,R,O,N,k,F,V,U,B,z=(D=new c.Matrix4,L=new c.Matrix4,I=new c.Vector3(0,0,0),R=new c.Box3,O=new c.Vector3,N=new c.Vector3,function(e,t,i){e.position.copy(i),e.lookAt(I),D.makeRotationFromQuaternion(e.quaternion),L.copy(D).invert(),R.copy(t).applyMatrix4(L),N=R.getCenter(N),O.set(N.x,N.y,R.max.z),O.applyMatrix4(D),e.position.copy(O),N=R.size(N),e.left=-.5*N.x,e.right=.5*N.x,e.bottom=-.5*N.y,e.top=.5*N.y,e.near=0,e.far=N.z,e.updateMatrixWorld(),e.updateProjectionMatrix()});function G(e){e.uniforms.shadowMapRangeMin.value=n.near,e.uniforms.shadowMapRangeSize.value=n.far-n.near,e.uniforms.shadowESMConstant.value=E.ShadowESMConstant,e.uniforms.shadowMinOpacity.value=E.ShadowMinOpacity}this.init=function(){(t=new M).init(C(E.ShadowMapSize)),i=E.BlurShadowMap?new a.D(E.ShadowMapSize,E.ShadowMapSize,E.ShadowMapBlurRadius,1,{type:t.shadowMap.type,format:t.shadowMap.format}):void 0,(d=(0,r.createShaderMaterial)(x)).depthWrite=!1,d.transparent=!0,p=(0,s.createGroundShape)(d),(f=new c.Scene).add(p),this.groundShapeBox=new c.Box3,P(v=C(1))},this.init(),this.state=A,this.startUpdate=function(e,t,i,r,o){var s=e.getVisibleBounds(!0);return this.beginShadowMapUpdate(i,s,r),e.reset(n,l.RenderFlags.RENDER_SHADOWMAP,!0),this.state=S,t=this.continueUpdate(e,t,o)},this.continueUpdate=function(e,i,n){return i=e.renderSome(this.renderSceneIntoShadowMap,i),e.isDone()?(this.state=w,this.finishShadowMapUpdate(n)):function(e){var i=t.shadowMap;t.shadowMap=v,y(e,t),t.apply(d),t.shadowMap=i}(n),i},this.beginShadowMapUpdate=function(e,i,o){z(n,i,o),G(m),g.forEachMaterial(G),E.UseHardShadows&&((0,r.setMacro)(m,"USE_HARD_SHADOWS"),g.forEachMaterial((function(e){(0,r.setMacro)(e,"USE_HARD_SHADOWS")}))),P(t.shadowMap),this.renderSceneIntoShadowMap(f)},this.renderSceneIntoShadowMap=function(e){e.overrideMaterial=m,u.render(e,n,t.shadowMap),e.overrideMaterial=null},this.finishShadowMapUpdate=function(e){i&&!E.UseHardShadows&&i.render(u,t.shadowMap,t.shadowMap),t.shadowMatrix.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),t.shadowMapRangeMin=n.near,t.shadowMapRangeSize=n.far-n.near,t.shadowLightDir.copy(n.position).normalize(),y(e,t),t.apply(d),this.isValid=!0},this.cleanup=function(e){i&&i.cleanup(),t.shadowMap&&t.shadowMap.dispose(),y(e,T),m.dispose(),g.dispose(),d.dispose(),p.geometry.dispose()},this.setGroundShadowTransform=function(e,t,i,n){(0,s.setGroundShapeTransform)(p,e,t,i,n),this.groundShapeBox.setFromObject(p)},this.renderGroundShadow=function(e,t){u.render(f,e,t,!1)},this.expandByGroundShadow=(k=new c.Plane,F=new c.Ray,V=new c.Vector3,U=new c.Vector3,B=new c.Box3,function(e,t){k.normal.set(0,1,0),k.constant=-e.min.y,F.direction.copy(t).negate().normalize();var i,n,r,o=e.getCenter(V),s=100*o.distanceToSquared(e.min)*100;B.makeEmpty();for(var a=0;a<8;a++){F.origin=(i=e,n=a,r=void 0,(r=new c.Vector3).x=1&n?i.max.x:i.min.x,r.y=2&n?i.max.y:i.min.y,r.z=4&n?i.max.z:i.min.z,r);var l=F.intersectPlane(k,U);l&&(l.distanceToSquared(o)>=s||B.expandByPoint(l))}e.union(B)}),this.getShadowParams=function(){return t},this.getShadowCamera=function(){return n}}const P=function(){};P.RefreshUniformsShadow=function(e,t){e.shadowMap&&(e.shadowMap.value=t.shadowMap),e.shadowMatrix&&(e.shadowMatrix.value=t.shadowMatrix),e.shadowLightDir&&(e.shadowLightDir.value=t.shadowLightDir),e.shadowESMConstant&&(e.shadowESMConstant.value=E.ShadowESMConstant),e.shadowBias&&(e.shadowBias.value=E.ShadowBias),e.shadowMapSize&&(e.shadowMapSize.value=E.ShadowMapSize),e.shadowDarkness&&(e.shadowDarkness.value=E.ShadowDarkness)}},89135:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var n=i(70057),r=i.n(n),o=i(70125),s=i.n(o),a=i(93033);class l{constructor(e,t,i,n){this.viewerImpl=e,this.renderContext=t,this.glRenderer=i,this.materialManager=n,this.materialName="__material_2Don3D__",this.tmpVec=new THREE.Vector3,this.tmpBox=new THREE.Box3}createContext(){this.sheetContext=new Autodesk.Viewing.Private.RenderContext,this.sheetContext.init(this.glRenderer,this.renderContext.settings.logicalWidth,this.renderContext.settings.logicalHeight,{offscreen:!0});const e=this.renderContext.getConfig();e.antialias=!1,e.renderEdges=!1,e.clearAlpha=0,e.clearColor?e.clearColor.set(1,1,1):(e.clearColorBottom.set(1,1,1),e.clearColorTop.set(1,1,1)),this.sheetContext.applyConfig(e),this.prototypeScene=new THREE.Scene}setSize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.renderContext;this.sheetContext&&(this.sheetContext.setSize(e.settings.logicalWidth,e.settings.logicalHeight),this.updateMaterial())}createScene(){this.setSize(),this.scene=new THREE.Scene,this.planeGeometry=new THREE.PlaneBufferGeometry(1,1),this.material=new THREE.ShaderMaterial({uniforms:{sheetMap:{type:"t",value:this.sheetContext.getColorTarget()},idMap:{type:"t",value:this.sheetContext.getIDTargets()[0]},modelIDv2:{type:"v3",value:new THREE.Vector3},resolution:{type:"v2",value:new THREE.Vector2},alphaTest:{type:"f",value:0}},vertexShader:r(),fragmentShader:s(),side:THREE.DoubleSide,transparent:!0}),this.scene.skipDepthTarget=!0,this.updateMaterial(),this.materialManager.addMaterialNonHDR(this.materialName,this.material),this.mesh=new a.LMVMesh(this.planeGeometry,this.material),this.mesh.matrixAutoUpdate=!1,this.scene.add(this.mesh)}updateMaterial(){if(this.material){const e=this.sheetContext.getColorTarget();this.material.uniforms.sheetMap.value=e,this.material.uniforms.idMap.value=this.sheetContext.getIDTargets()[0],this.material.uniforms.resolution.value.set(1/(e.width||1),1/(e.height||1))}}renderScenePart(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.renderContext;if(!e.frags||!e.frags.is2d)return;this.sheetContext||this.createContext(),this.scene||this.createScene(),this.material.uniforms.alphaTest.value=!e.needsTwoPasses||e.isSecondPass?0:.9;const o=e.modelId,s=this.viewerImpl.modelQueue().findModel(o),a=this.tmpBox.copy(s.getBoundingBox(!0)),l=s.getViewportBounds();l&&a.intersect(l);const c=s.getModelToViewerTransform();this.material.uniforms.modelIDv2.value.set((255&o)/255,(o>>8&255)/255,(o>>16&255)/255),r.getAOEnabled()!==this.sheetContext.getAOEnabled()&&this.sheetContext.initPostPipeline(r.getAOEnabled(),!1),n=n&&s.areAllVisible(),i=!1;this.lastRenderedModel===s&&e.isSecondPass||(this.sheetContext.beginScene(this.prototypeScene,this.viewerImpl.camera,this.viewerImpl.noLights,!0),this.sheetContext.renderScenePart(e,t,false,n,!1),this.sheetContext.presentBuffer());const h=a.getSize(new THREE.Vector3);this.mesh.matrix.makeScale(h.x,h.y,1),a.getCenter(this.tmpVec),this.mesh.matrix.setPosition(this.tmpVec),c&&this.mesh.matrix.multiplyMatrices(c,this.mesh.matrix),this.mesh.matrixWorld.copy(this.mesh.matrix),this.scene.modelId=o,r.renderScenePart(this.scene,t,false,n),this.lastRenderedModel=s}destroy(){this.material&&(this.material.dispose(),this.materialManager.removeNonHDRMaterial(this.materialName),this.material=null),this.planeGeometry&&(this.planeGeometry.dispose(),this.planeGeometry=null),this.sheetContext&&(this.sheetContext.cleanup(),this.context=null),this.renderContext=null,this.glRenderer=null}}},47243:(e,t,i)=>{"use strict";i.r(t),i.d(t,{WebGLProgram:()=>h});var n=i(85660),r=i(83539),o=i(41434),s=i(16840);const a="#version 300 es\n #define _LMVWEBGL2_\n #define texture2D texture\n #define textureCube texture\n #define attribute in\n #define varying out\n",l="#version 300 es\n #define _LMVWEBGL2_\n #define texture2D texture\n #define textureCube texture\n #define textureCubeLodEXT textureLod\n #define gl_FragColor outFragColor\n #define varying in\n",c="\n #define gl_FragDepth gl_FragDepthEXT\n #extension GL_OES_standard_derivatives : enable\n";let h=(u=0,d=function(e){return""!==e},p=function(e,t,i,n,r){var o=n?"1.0-":"",s="texture2D("+e+", (UV))",a="";return r=r||"vec4(0.0)",t&&i?a="((UV).x < 0.0 || (UV).x > 1.0 || (UV).y < 0.0 || (UV).y > 1.0) ? "+r+" : ":t?a="((UV).x < 0.0 || (UV).x > 1.0) ? "+r+" : ":i&&(a="((UV).y < 0.0 || (UV).y > 1.0) ? "+r+" : "),"#define GET_"+e.toUpperCase()+"(UV) ("+a+o+s+")"},function(e,t,i,h,f){var m=e,g=m.context,v=m.capabilities.isWebGL2,y=i.defines,b=i.__webglShader.uniforms;let x={};x={...i.attributes,...f.attributes};var _=(0,r.resolve)(h.vertexShader),E=(0,r.resolve)(h.fragmentShader),A=i.index0AttributeName;void 0===A&&!0===h.morphTargets&&(A="position");var S,w,M="ENVMAP_MODE_REFLECTION",T=e.gammaFactor>0?e.gammaFactor:1,C=function(e){var t,i,n=[];for(var r in e)!1!==(t=e[r])&&(i="#define "+r+" "+t,n.push(i));return n.join("\n")}(y),P=g.createProgram();i instanceof o.RawShaderMaterial?((S=[v?a:"",C].filter(d).join("\n")).length>0&&(S+="\n"),(w=[v?l:c,"precision "+h.precisionFragment+" float;",C,v?"out vec4 outFragColor;":""].filter(d).join("\n")).length>0&&(w+="\n")):(S=[v?a:"","precision "+h.precision+" float;","precision "+h.precision+" int;",C,h.vertexPrefix,h.supportsVertexTextures?"#define VERTEX_TEXTURES":"",m.gammaInput?"#define GAMMA_INPUT":"",m.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+T,h.mrtNormals?"#define MRT_NORMALS":"",h.mrtIdBuffer?"#define MRT_ID_BUFFER":"","#define MAX_DIR_LIGHTS "+h.maxDirLights,"#define MAX_POINT_LIGHTS "+h.maxPointLights,"#define MAX_SPOT_LIGHTS "+h.maxSpotLights,"#define MAX_HEMI_LIGHTS "+h.maxHemiLights,"#define MAX_BONES "+h.maxBones,"#define NUM_CUTPLANES "+h.numCutplanes,h.loadingAnimationDuration>0?"#define LOADING_ANIMATION":"",h.map?"#define USE_MAP":"",h.envMap?"#define USE_ENVMAP":"",h.envMap?"#define "+M:"",h.irradianceMap?"#define USE_IRRADIANCEMAP":"",h.lightMap?"#define USE_LIGHTMAP":"",h.bumpMap?"#define USE_BUMPMAP":"",h.normalMap?"#define USE_NORMALMAP":"",h.specularMap?"#define USE_SPECULARMAP":"",h.alphaMap?"#define USE_ALPHAMAP":"",h.vertexColors?"#define USE_COLOR":"",h.vertexIds?"#define USE_VERTEX_ID":"",h.useTiling?"#define USE_TILING":"",h.useInstancing?"#define USE_INSTANCING":"",h.wideLines?"#define WIDE_LINES":"",h.skinning?"#define USE_SKINNING":"",h.useVertexTexture?"#define BONE_TEXTURE":"",h.morphTargets?"#define USE_MORPHTARGETS":"",h.morphNormals?"#define USE_MORPHNORMALS":"",h.wrapAround?"#define WRAP_AROUND":"",h.doubleSided?"#define DOUBLE_SIDED":"",h.flipSided?"#define FLIP_SIDED":"",h.sizeAttenuation?"#define USE_SIZEATTENUATION":"",h.packedNormals?"#define UNPACK_NORMALS":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","#ifdef UNPACK_NORMALS","attribute vec2 normal;","#else","attribute vec3 normal;","#endif","attribute vec2 uv;","attribute vec2 uv2;","#ifdef USE_COLOR"," attribute vec3 color;","#endif",""].join("\n"),w=[v?l:c,v||!h.bumpMap&&!h.normalMap?"":"#extension GL_OES_standard_derivatives : enable",v||!h.mrtIdBuffer&&!h.mrtNormals||s.isIE11?"":"#extension GL_EXT_draw_buffers : enable",!v&&h.mrtIdBuffer?"#define gl_FragColor gl_FragData[0]":"",h.haveTextureLod?"#define HAVE_TEXTURE_LOD":"",C,h.fragmentPrefix,"#define MAX_DIR_LIGHTS "+h.maxDirLights,"#define MAX_POINT_LIGHTS "+h.maxPointLights,"#define MAX_SPOT_LIGHTS "+h.maxSpotLights,"#define MAX_HEMI_LIGHTS "+h.maxHemiLights,"#define NUM_CUTPLANES "+h.numCutplanes,h.loadingAnimationDuration>0?"#define LOADING_ANIMATION":"",h.alphaTest?"#define ALPHATEST "+h.alphaTest:"",m.gammaInput?"#define GAMMA_INPUT":"",m.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+T,h.mrtNormals?"#define MRT_NORMALS":"",h.mrtIdBuffer?"#define MRT_ID_BUFFER":"",h.mrtIdBuffer>1?"#define MODEL_COLOR":"","#define TONEMAP_OUTPUT "+(h.tonemapOutput||0),h.useBackgroundTexture?"#define USE_BACKGROUND_TEXTURE":"",h.useFog&&h.fog?"#define USE_FOG":"",h.useFog&&h.fogExp?"#define FOG_EXP2":"",h.map?"#define USE_MAP":"",h.envMap?"#define USE_ENVMAP":"",h.envMap?"#define ENVMAP_TYPE_CUBE":"",h.envMap?"#define "+M:"",h.envMap?"#define ENVMAP_BLENDING_MULTIPLY":"",h.irradianceMap?"#define USE_IRRADIANCEMAP":"",h.envGammaEncoded?"#define ENV_GAMMA":"",h.irrGammaEncoded?"#define IRR_GAMMA":"",h.envRGBM?"#define ENV_RGBM":"",h.irrRGBM?"#define IRR_RGBM":"",h.lightMap?"#define USE_LIGHTMAP":"",h.bumpMap?"#define USE_BUMPMAP":"",h.normalMap?"#define USE_NORMALMAP":"",h.specularMap?"#define USE_SPECULARMAP":"",h.alphaMap?"#define USE_ALPHAMAP":"",h.vertexColors?"#define USE_COLOR":"",h.vertexIds?"#define USE_VERTEX_ID":"",h.metal?"#define METAL":"",h.clearcoat?"#define CLEARCOAT":"",h.wrapAround?"#define WRAP_AROUND":"",h.doubleSided?"#define DOUBLE_SIDED":"",h.flipSided?"#define FLIP_SIDED":"",h.hatchPattern?"#define HATCH_PATTERN":"",h.mapInvert?"#define MAP_INVERT":"",h.useTiling?"#define USE_TILING":"",h.useTiling?"#define TILE_RANGE_X_MIN "+h.tilingRepeatRange[0]:"",h.useTiling?"#define TILE_RANGE_Y_MIN "+h.tilingRepeatRange[1]:"",h.useTiling?"#define TILE_RANGE_X_MAX "+h.tilingRepeatRange[2]:"",h.useTiling?"#define TILE_RANGE_Y_MAX "+h.tilingRepeatRange[3]:"",h.hasRoundCorner?"#define USE_TILING_NORMAL":"",h.useRandomOffset?"#define USE_TILING_RANDOM":"",p("map",h.mapClampS,h.mapClampT),p("bumpMap",h.bumpMapClampS,h.bumpMapClampT),p("normalMap",h.normalMapClampS,h.normalMapClampT),p("specularMap",h.specularMapClampS,h.specularMapClampT),p("alphaMap",h.alphaMapClampS,h.alphaMapClampT,h.alphaMapInvert),"#ifdef USE_ENVMAP","#ifdef HAVE_TEXTURE_LOD",v?"":"#extension GL_EXT_shader_texture_lod : enable","#endif","#endif","precision "+h.precisionFragment+" float;","precision "+h.precisionFragment+" int;",v?"layout(location = 0) out vec4 outFragColor;":"","uniform highp mat4 viewMatrix;","uniform highp mat4 projectionMatrix;","uniform highp vec3 cameraPosition;","#if defined(USE_ENVMAP) || defined(USE_IRRADIANCEMAP)","uniform mat4 viewMatrixInverse;","#endif",""].join("\n"));var D=new n.WebGLShader(g,g.VERTEX_SHADER,S+_),L=new n.WebGLShader(g,g.FRAGMENT_SHADER,w+E);g.attachShader(P,D),g.attachShader(P,L),void 0!==A&&g.bindAttribLocation(P,0,A),g.linkProgram(P),"undefined"!=typeof DEBUG_SHADERS&&DEBUG_SHADERS&&(!1===g.getProgramParameter(P,g.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),console.error("gl.VALIDATE_STATUS",g.getProgramParameter(P,g.VALIDATE_STATUS)),console.error("gl.getError()",g.getError())),""!==g.getProgramInfoLog(P)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",g.getProgramInfoLog(P))),g.deleteShader(D),g.deleteShader(L);var I=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","modelMatrix","cameraPosition","viewMatrixInverse","mvpMatrix","dbId"];for(var R in b)I.push(R);for(var O in this.uniforms=function(e,t,i){for(var n={},r=0,o=i.length;r<o;r++){var s=i[r];n[s]=e.getUniformLocation(t,s)}return n}(g,P,I),I=["position","normal","uv","uv2","tangent","color","lineDistance","uvw","id","instOffset","instScaling","instRotation","prev","next","side","uvp","pointScale"],x)I.push(O);return this.attributes=function(e,t,i){for(var n={},r=0,o=i.length;r<o;r++){var s=i[r];n[s]=e.getAttribLocation(t,s)}return n}(g,P,I),this.attributesKeys=Object.keys(this.attributes),this.id=u++,this.code=t,this.usedTimes=1,this.program=P,this.vertexShader=D,this.fragmentShader=L,this});var u,d,p},12156:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DEBUG_TEXTURE_LOAD:()=>d,WebGLRenderer:()=>m});var n=i(47243),r=i(20657),o=i(64),s=i(42198),a=i(16840),l=i(41434),c=i(29996),h=i(24820),u=i(69539);let d=!1;const p=(0,a.getGlobal)(),f=p.document;let m=function(e){console.log("THREE.WebGLRenderer",l.REVISION);var t=void 0!==(e=e||{}).canvas?e.canvas:f.createElement("canvas"),i=null,a=void 0!==e.precision?e.precision:"highp",m=a,g=void 0!==e.alpha&&e.alpha,v=void 0===e.premultipliedAlpha||e.premultipliedAlpha,y=void 0!==e.antialias&&e.antialias,b=void 0===e.stencil||e.stencil,x=void 0===e.preserveDrawingBuffer||e.preserveDrawingBuffer,_=new l.Color(0),E=0,A=[],S={},w=new l.Matrix4,M=new l.Matrix3;this.highResTimeStamp=0;var T=[],C=[];this.domElement=t,this.context=null,this.refCount=0,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.gammaInput=!1,this.gammaOutput=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0},reset:function(){this.render.calls=0}};var P,D,L,I,R,O=this,N=[],k=null,F=null,V=null,U=null,B=-1,z=null,G="",H=0,W="",j="",X=0,q=0,Y=0,K=t.width,Z=t.height,Q=new l.Vector4,J={},$=new l.Frustum,ee=new l.Matrix4,te=new l.Matrix4,ie=new l.Vector3,ne=new l.Vector3,re=!0,oe={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};O.capabilities={};try{var se={alpha:g,premultipliedAlpha:v,antialias:y,stencil:b,powerPreference:"high-performance",preserveDrawingBuffer:x};if((P=!1!==e.useWebGL2?t.getContext("webgl2",se):null)?(O.capabilities.isWebGL2=!0,D=!0):P=t.getContext("webgl",se)||t.getContext("experimental-webgl",se),null===P)throw null!==t.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";const i=P.getExtension("WEBGL_debug_renderer_info");if(i){const e=P.getParameter(i.UNMASKED_VENDOR_WEBGL),t=P.getParameter(i.UNMASKED_RENDERER_WEBGL);console.log("WebGL Renderer: "+t),console.log("WebGL Vendor: "+e)}0==P.getShaderPrecisionFormat(P.FRAGMENT_SHADER,P.HIGH_FLOAT).precision&&(m="mediump"),t.addEventListener("webglcontextlost",(function(e){e.preventDefault(),pe(),de(),S={},wt={},Mt=0,fe.dispose(),N.length=0}),!1),t.addEventListener("webglcontextrestored",(function(e){e.preventDefault(),O.enableContextRestore&&(he(),Me(),O.lostContextRecovery=O.lostContextRecovery||new o.ZP,O.lostContextRecovery.onContextRestored(),k=null,F=null)}))}catch(e){return void console.error(e)}let ae,le,ce;function he(){ae=new l.WebGLExtensions(P),le=new l.WebGLState(P,Kt),ce=le,ae.get("EXT_texture_filter_anisotropic"),ae.get("WEBGL_compressed_texture_s3tc"),D?ae.get("EXT_color_buffer_float"):(ae.get("OES_texture_float"),ae.get("OES_texture_float_linear"),ae.get("OES_texture_half_float"),ae.get("OES_texture_half_float_linear"),ae.get("OES_standard_derivatives"),ae.get("EXT_shader_texture_lod"),L=ae.get("WEBGL_draw_buffers"),I=ae.get("ANGLE_instanced_arrays"),R=ae.get("OES_vertex_array_object")),O.extensions=ae}void 0===P.getShaderPrecisionFormat&&(P.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),he();var ue=function(e,t,i,n){!0===v&&(e*=n,t*=n,i*=n),P.clearColor(e,t,i,n)},de=function(){P.clearColor(0,0,0,1),P.clearDepth(1),P.clearStencil(0),P.enable(P.DEPTH_TEST),P.depthFunc(P.LEQUAL),P.frontFace(P.CCW),P.cullFace(P.BACK),P.enable(P.CULL_FACE),P.enable(P.BLEND),P.blendEquation(P.FUNC_ADD),P.blendFunc(P.SRC_ALPHA,P.ONE_MINUS_SRC_ALPHA),P.viewport(q,Y,K,Z),ue(_.r,_.g,_.b,E)},pe=function(){k=null,z=null,G="",B=-1,re=!0,le.reset(),ce.disableUnusedAttributes()};de(),this.context=P,this.state=le;for(var fe,me=P.getParameter(P.MAX_TEXTURE_IMAGE_UNITS),ge=P.getParameter(P.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ve=P.getParameter(P.MAX_TEXTURE_SIZE),ye=P.getParameter(P.MAX_CUBE_MAP_TEXTURE_SIZE),be=ge>0,xe=P.getShaderPrecisionFormat(P.VERTEX_SHADER,P.HIGH_FLOAT),_e=P.getShaderPrecisionFormat(P.VERTEX_SHADER,P.MEDIUM_FLOAT),Ee=P.getShaderPrecisionFormat(P.FRAGMENT_SHADER,P.HIGH_FLOAT),Ae=P.getShaderPrecisionFormat(P.FRAGMENT_SHADER,P.MEDIUM_FLOAT),Se=new Uint8Array(16),we=0;we<4;we++)d?1===we||2===we?(Se[4*we]=246,Se[4*we+1]=140,Se[4*we+2]=220):(Se[4*we]=48,Se[4*we+1]=195,Se[4*we+2]=3):Se[4*we]=Se[4*we+1]=Se[4*we+2]=0,Se[4*we+3]=255;function Me(){(fe=new l.DataTexture(Se,2,2,l.RGBAFormat,l.UnsignedByteType,l.UVMapping,l.RepeatWrapping,l.RepeatWrapping,l.NearestFilter,l.NearestFilter)).needsUpdate=!0}Me();var Te,Ce,Pe=function(){if(void 0!==Te)return Te;if(Te=[],ae.get("WEBGL_compressed_texture_pvrtc")||ae.get("WEBGL_compressed_texture_s3tc"))for(var e=P.getParameter(P.COMPRESSED_TEXTURE_FORMATS),t=0;t<e.length;t++)Te.push(e[t]);return Te},De=xe.precision>0,Le=_e.precision>0;"highp"!==a||De||(Le?(a="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(a="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp"))),"mediump"!==a||Le||(a="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp")),De=Ee.precision>0,Le=Ae.precision>0,"highp"!==m||De||(Le?(m="mediump",console.warn("WebGLRenderer: highp not supported, using mediump")):(m="lowp",console.warn("WebGLRenderer: highp and mediump not supported, using lowp"))),"mediump"!==m||Le||(m="lowp",console.warn("WebGLRenderer: mediump not supported, using lowp")),this.getContext=function(){return P},this.isWebGL2=function(){return D},this.forceContextLoss=function(){ae.get("WEBGL_lose_context").loseContext()},this.forceContextRestore=function(){ae.get("WEBGL_lose_context").restoreContext()},this.supportsVertexTextures=function(){return be},this.supportsFloatTextures=function(){return D||ae.get("OES_texture_float")},this.supportsHalfFloatTextures=function(){return D||ae.get("OES_texture_half_float_linear")},this.supportsStandardDerivatives=function(){return D||ae.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return D||ae.get("WEBGL_compressed_texture_s3tc")},this.supportsElementIndexUint=function(){return D||ae.get("OES_element_index_uint")},this.supportsInstancedArrays=function(){return D||!!I},this.supportsBlendMinMax=function(){return D||ae.get("EXT_blend_minmax")},this.getMaxAnisotropy=function(){if(void 0!==Ce)return Ce;var e=ae.get("EXT_texture_filter_anisotropic");return Ce=null!==e?P.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},this.getPixelRatio=function(){return i||p.devicePixelRatio||1},this.setPixelRatio=function(e){i=e},this.getCurrentFramebuffer=function(){return F},this.setSize=function(e,i,n){const r=this.getPixelRatio();t.width=e*r,t.height=i*r,!1!==n&&(t.style.width=e+"px",t.style.height=i+"px"),this.setViewport(0,0,e,i)},this.setViewport=function(e,t,i,n){const r=this.getPixelRatio();q=e*r,Y=t*r,K=i*r,Z=n*r,P.viewport(q,Y,K,Z)};var Ie=!1;this.enableViewportOnOffscreenTargets=function(e){Ie=e};var Re=[];function Oe(e){e.__webglVertexBuffer=P.createBuffer(),e.__webglNormalBuffer=P.createBuffer(),e.__webglTangentBuffer=P.createBuffer(),e.__webglColorBuffer=P.createBuffer(),e.__webglUVBuffer=P.createBuffer(),e.__webglUV2Buffer=P.createBuffer(),e.__webglSkinIndicesBuffer=P.createBuffer(),e.__webglSkinWeightsBuffer=P.createBuffer(),e.__webglFaceBuffer=P.createBuffer(),e.__webglLineBuffer=P.createBuffer(),O.info.memory.geometries++}this.pushViewport=function(){Re.push(q),Re.push(Y),Re.push(K),Re.push(Z)},this.popViewport=function(){var e=Re.length-4;q=Re[e],Y=Re[e+1],K=Re[e+2],Z=Re[e+3],P.viewport(q,Y,K,Z),Re.length=e},this.setScissor=function(e,t,i,n){const r=this.getPixelRatio();P.scissor(e*r,t*r,i*r,n*r)},this.enableScissorTest=function(e){e?P.enable(P.SCISSOR_TEST):P.disable(P.SCISSOR_TEST)},this.getClearColor=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getClearColor() now requires a Color as an argument"),e=new l.Color),e.copy(_)},this.setClearColor=function(e,t){_.set(e),E=void 0!==t?t:1,ue(_.r,_.g,_.b,E)},this.getClearAlpha=function(){return E},this.setClearAlpha=function(e){E=e,ue(_.r,_.g,_.b,E)},this.clear=function(e,t,i){var n=0;(void 0===e||e)&&(n|=P.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=P.DEPTH_BUFFER_BIT),(void 0===i||i)&&(n|=P.STENCIL_BUFFER_BIT),P.clear(n)},this.clearColor=function(){P.clear(P.COLOR_BUFFER_BIT)},this.clearDepth=function(){P.clear(P.DEPTH_BUFFER_BIT)},this.clearStencil=function(){P.clear(P.STENCIL_BUFFER_BIT)},this.clearTarget=function(e,t,i,n){this.setRenderTarget(e),this.clear(t,i,n)},this.resetGLState=pe;var Ne=function(e){e.target.traverse((function(e){e.removeEventListener("remove",Ne),function(e){(e instanceof l.Mesh||e instanceof l.PointCloud||e instanceof l.Line)&&delete S[e.id];delete e.__webglInit,delete e.__webglActive}(e)}))},ke=function(e){var t=e.target;t.removeEventListener("dispose",ke),ze(t)},Fe=function(e){var t=e.target;t.removeEventListener("dispose",Fe),Xe(t),O.info.memory.textures--},Ve=function(e){var t=e.target;t.removeEventListener("dispose",Ve),qe(t),O.info.memory.textures--},Ue=function(e){var t=e.target;t.removeEventListener("dispose",Ue),Ye(t)},Be=function(e){if(void 0!==e.__webglVertexBuffer&&(P.deleteBuffer(e.__webglVertexBuffer),e.__webglVertexBuffer=void 0),void 0!==e.__webglNormalBuffer&&(P.deleteBuffer(e.__webglNormalBuffer),e.__webglNormalBuffer=void 0),void 0!==e.__webglTangentBuffer&&(P.deleteBuffer(e.__webglTangentBuffer),e.__webglTangentBuffer=void 0),void 0!==e.__webglColorBuffer&&(P.deleteBuffer(e.__webglColorBuffer),e.__webglColorBuffer=void 0),void 0!==e.__webglUVBuffer&&(P.deleteBuffer(e.__webglUVBuffer),e.__webglUVBuffer=void 0),void 0!==e.__webglUV2Buffer&&(P.deleteBuffer(e.__webglUV2Buffer),e.__webglUV2Buffer=void 0),void 0!==e.__webglSkinIndicesBuffer&&(P.deleteBuffer(e.__webglSkinIndicesBuffer),e.__webglSkinIndicesBuffer=void 0),void 0!==e.__webglSkinWeightsBuffer&&(P.deleteBuffer(e.__webglSkinWeightsBuffer),e.__webglSkinWeightsBuffer=void 0),void 0!==e.__webglFaceBuffer&&(P.deleteBuffer(e.__webglFaceBuffer),e.__webglFaceBuffer=void 0),void 0!==e.__webglLineBuffer&&(P.deleteBuffer(e.__webglLineBuffer),e.__webglLineBuffer=void 0),void 0!==e.__webglLineDistanceBuffer&&(P.deleteBuffer(e.__webglLineDistanceBuffer),e.__webglLineDistanceBuffer=void 0),void 0!==e.__webglCustomAttributesList){for(var t in e.__webglCustomAttributesList)P.deleteBuffer(e.__webglCustomAttributesList[t].buffer);e.__webglCustomAttributesList=void 0}O.info.memory.geometries--},ze=function(e){var t,i,n,r;if(e.__webglInit=void 0,e instanceof l.BufferGeometry){if(void 0!==e.vbbuffer&&(P.deleteBuffer(e.vbbuffer),e.vbbuffer=void 0),void 0!==e.ibbuffer&&(P.deleteBuffer(e.ibbuffer),e.ibbuffer=void 0),void 0!==e.iblinesbuffer&&(P.deleteBuffer(e.iblinesbuffer),e.iblinesbuffer=void 0),e.vaos){for(t=0;t<e.vaos.length;t++)st(e.vaos[t].vao);e.vaos=void 0}var o=e.attributes;for(var s in o)void 0!==o[s].buffer&&(P.deleteBuffer(o[s].buffer),o[s].buffer=void 0);O.info.memory.geometries--}else{var a=wt[e.id];if(void 0!==a){for(t=0,i=a.length;t<i;t++){var c=a[t];if(void 0!==c.numMorphTargets){for(n=0,r=c.numMorphTargets;n<r;n++)P.deleteBuffer(c.__webglMorphTargetsBuffers[n]);delete c.__webglMorphTargetsBuffers}if(void 0!==c.numMorphNormals){for(n=0,r=c.numMorphNormals;n<r;n++)P.deleteBuffer(c.__webglMorphNormalsBuffers[n]);delete c.__webglMorphNormalsBuffers}Be(c)}delete wt[e.id]}else Be(e)}};this.deallocateGeometry=ze;var Ge,He,We,je,Xe=function(e){if(e.__webglTextureCube)P.deleteTexture(e.__webglTextureCube),e.__webglTextureCube=void 0;else{if(!e.__webglInit)return;P.deleteTexture(e.__webglTexture),e.__webglInit=void 0,e.__webglTexture=void 0}},qe=function(e){e&&e.__webglTexture&&(P.deleteTexture(e.__webglTexture),P.deleteFramebuffer(e.__webglFramebuffer),void 0!==e.__webglRenderbuffer&&P.deleteRenderbuffer(e.__webglRenderbuffer),void 0!==e.__webglRenderbufferOwn&&(P.deleteRenderbuffer(e.__webglRenderbufferOwn),e.__webglRenderbufferOwn=void 0))},Ye=function(e){var t=!1;e.program=void 0,e.programs.forEach((function(e){var i,n,r,o;if(void 0!==e&&null!=(i=e.program))for(n=0,r=N.length;n<r;n++)if((o=N[n])&&o.program===i){o.usedTimes--,0===o.usedTimes&&(N[n]=void 0,P.deleteProgram(i),O.info.memory.programs--,t=!0);break}}),!1),e.programs.length=0,t&&(N=N.filter((function(e){return void 0!==e})))};function Ke(e,t){var i=e.vertices.length,n=t.material;if(n.attributes)for(var r in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),n.attributes){var o=n.attributes[r];if(!o.__webglInitialized||o.createUniqueBuffers){o.__webglInitialized=!0;var s=1;"v2"===o.type?s=2:"v3"===o.type?s=3:"v4"===o.type?s=4:"c"===o.type&&(s=3),o.size=s,o.array=new Float32Array(i*s),o.buffer=P.createBuffer(),o.buffer.belongsToAttribute=r,o.needsUpdate=!0}e.__webglCustomAttributesList.push(o)}}function Ze(e,t){var i=t.geometry,n=e.faces3,r=3*n.length,o=1*n.length,s=3*n.length,a=Qe(t,e),l=et(a),c=Je(a),h=$e(a);e.__vertexArray=new Float32Array(3*r),c&&(e.__normalArray=new Float32Array(3*r)),i.hasTangents&&(e.__tangentArray=new Float32Array(4*r)),h&&(e.__colorArray=new Float32Array(3*r)),l&&(i.faceVertexUvs.length>0&&(e.__uvArray=new Float32Array(2*r)),i.faceVertexUvs.length>1&&(e.__uv2Array=new Float32Array(2*r))),t.geometry.skinWeights.length&&t.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*r),e.__skinWeightArray=new Float32Array(4*r));var u=(D||ae.get("OES_element_index_uint"))&&o>21845?Uint32Array:Uint16Array;if(e.__typeArray=u,e.__faceArray=new u(3*o),e.__lineArray=new u(2*s),e.__webglFaceCount=3*o,e.__webglLineCount=2*s,a.attributes)for(var d in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),a.attributes){var p=a.attributes[d],f={};for(var m in p)f[m]=p[m];if(!f.__webglInitialized||f.createUniqueBuffers){f.__webglInitialized=!0;var g=1;"v2"===f.type?g=2:"v3"===f.type?g=3:"v4"===f.type?g=4:"c"===f.type&&(g=3),f.size=g,f.array=new Float32Array(r*g),f.buffer=P.createBuffer(),f.buffer.belongsToAttribute=d,p.needsUpdate=!0,f.__original=p}e.__webglCustomAttributesList.push(f)}e.__inittedArrays=!0}function Qe(e,t){return e.material instanceof l.MeshFaceMaterial?e.material.materials[t.materialIndex]:e.material}function Je(e){return!(e instanceof l.MeshBasicMaterial&&!e.envMap||e instanceof l.MeshDepthMaterial)&&(function(e){return e&&(void 0!==e.shading&&e.shading===l.SmoothShading||void 0!==e.flatShading&&!1===e.flatShading)}(e)?l.SmoothShading:l.FlatShading)}function $e(e){return!!e.vertexColors&&e.vertexColors}function et(e){return!!(e.map||e.lightMap||e.bumpMap||e.normalMap||e.specularMap||e.alphaMap||e instanceof l.ShaderMaterial)}function tt(e){return!0===e.needsUpdate}function it(e){e.needsUpdate=!1}function nt(e,t,i,n,r){if(e.__inittedArrays){var o,s,a,c,h,u,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M,T,C,D,L,I,R=Je(r),O=$e(r),N=et(r),k=R===l.SmoothShading,F=0,V=0,U=0,B=0,z=0,G=0,H=0,W=0,j=0,X=0,q=e.__vertexArray,Y=e.__uvArray,K=e.__uv2Array,Z=e.__normalArray,Q=e.__tangentArray,J=e.__colorArray,$=e.__webglCustomAttributesList,ee=e.__faceArray,te=e.__lineArray,ie=t.geometry,ne=ie.verticesNeedUpdate,re=ie.elementsNeedUpdate,oe=ie.uvsNeedUpdate,se=ie.normalsNeedUpdate,ae=ie.tangentsNeedUpdate,le=ie.colorsNeedUpdate,ce=ie.vertices,he=e.faces3,ue=ie.faces,de=ie.faceVertexUvs[0],pe=ie.faceVertexUvs[1];if(ne){for(o=0,s=he.length;o<s;o++)g=ce[(a=ue[he[o]]).a],v=ce[a.b],y=ce[a.c],q[V]=g.x,q[V+1]=g.y,q[V+2]=g.z,q[V+3]=v.x,q[V+4]=v.y,q[V+5]=v.z,q[V+6]=y.x,q[V+7]=y.y,q[V+8]=y.z,V+=9;P.bindBuffer(P.ARRAY_BUFFER,e.__webglVertexBuffer),P.bufferData(P.ARRAY_BUFFER,q,i)}if(le&&O){for(o=0,s=he.length;o<s;o++)u=(a=ue[he[o]]).vertexColors,d=a.color,3===u.length&&O===l.VertexColors?(E=u[0],A=u[1],S=u[2]):(E=d,A=d,S=d),J[j]=E.r,J[j+1]=E.g,J[j+2]=E.b,J[j+3]=A.r,J[j+4]=A.g,J[j+5]=A.b,J[j+6]=S.r,J[j+7]=S.g,J[j+8]=S.b,j+=9;j>0&&(P.bindBuffer(P.ARRAY_BUFFER,e.__webglColorBuffer),P.bufferData(P.ARRAY_BUFFER,J,i))}if(ae&&ie.hasTangents){for(o=0,s=he.length;o<s;o++)b=(p=(a=ue[he[o]]).vertexTangents)[0],x=p[1],_=p[2],Q[H]=b.x,Q[H+1]=b.y,Q[H+2]=b.z,Q[H+3]=b.w,Q[H+4]=x.x,Q[H+5]=x.y,Q[H+6]=x.z,Q[H+7]=x.w,Q[H+8]=_.x,Q[H+9]=_.y,Q[H+10]=_.z,Q[H+11]=_.w,H+=12;P.bindBuffer(P.ARRAY_BUFFER,e.__webglTangentBuffer),P.bufferData(P.ARRAY_BUFFER,Q,i)}if(se&&R){for(o=0,s=he.length;o<s;o++)if(c=(a=ue[he[o]]).vertexNormals,h=a.normal,3===c.length&&k)for(w=0;w<3;w++)T=c[w],Z[G]=T.x,Z[G+1]=T.y,Z[G+2]=T.z,G+=3;else for(w=0;w<3;w++)Z[G]=h.x,Z[G+1]=h.y,Z[G+2]=h.z,G+=3;P.bindBuffer(P.ARRAY_BUFFER,e.__webglNormalBuffer),P.bufferData(P.ARRAY_BUFFER,Z,i)}if(oe&&de&&N){for(o=0,s=he.length;o<s;o++)if(void 0!==(f=de[he[o]]))for(w=0;w<3;w++)C=f[w],Y[U]=C.x,Y[U+1]=C.y,U+=2;U>0&&(P.bindBuffer(P.ARRAY_BUFFER,e.__webglUVBuffer),P.bufferData(P.ARRAY_BUFFER,Y,i))}if(oe&&pe&&N){for(o=0,s=he.length;o<s;o++)if(void 0!==(m=pe[he[o]]))for(w=0;w<3;w++)D=m[w],K[B]=D.x,K[B+1]=D.y,B+=2;B>0&&(P.bindBuffer(P.ARRAY_BUFFER,e.__webglUV2Buffer),P.bufferData(P.ARRAY_BUFFER,K,i))}if(re){for(o=0,s=he.length;o<s;o++)ee[z]=F,ee[z+1]=F+1,ee[z+2]=F+2,z+=3,te[W]=F,te[W+1]=F+1,te[W+2]=F,te[W+3]=F+2,te[W+4]=F+1,te[W+5]=F+2,W+=6,F+=3;P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),P.bufferData(P.ELEMENT_ARRAY_BUFFER,ee,i),P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),P.bufferData(P.ELEMENT_ARRAY_BUFFER,te,i)}if($)for(w=0,M=$.length;w<M;w++)if(tt((I=$[w]).__original)){if(X=0,1===I.size){if(void 0===I.boundTo||"vertices"===I.boundTo)for(o=0,s=he.length;o<s;o++)a=ue[he[o]],I.array[X]=I.value[a.a],I.array[X+1]=I.value[a.b],I.array[X+2]=I.value[a.c],X+=3;else if("faces"===I.boundTo)for(o=0,s=he.length;o<s;o++)L=I.value[he[o]],I.array[X]=L,I.array[X+1]=L,I.array[X+2]=L,X+=3}else if(2===I.size){if(void 0===I.boundTo||"vertices"===I.boundTo)for(o=0,s=he.length;o<s;o++)a=ue[he[o]],g=I.value[a.a],v=I.value[a.b],y=I.value[a.c],I.array[X]=g.x,I.array[X+1]=g.y,I.array[X+2]=v.x,I.array[X+3]=v.y,I.array[X+4]=y.x,I.array[X+5]=y.y,X+=6;else if("faces"===I.boundTo)for(o=0,s=he.length;o<s;o++)g=L=I.value[he[o]],v=L,y=L,I.array[X]=g.x,I.array[X+1]=g.y,I.array[X+2]=v.x,I.array[X+3]=v.y,I.array[X+4]=y.x,I.array[X+5]=y.y,X+=6}else if(3===I.size){var fe;if(fe="c"===I.type?["r","g","b"]:["x","y","z"],void 0===I.boundTo||"vertices"===I.boundTo)for(o=0,s=he.length;o<s;o++)a=ue[he[o]],g=I.value[a.a],v=I.value[a.b],y=I.value[a.c],I.array[X]=g[fe[0]],I.array[X+1]=g[fe[1]],I.array[X+2]=g[fe[2]],I.array[X+3]=v[fe[0]],I.array[X+4]=v[fe[1]],I.array[X+5]=v[fe[2]],I.array[X+6]=y[fe[0]],I.array[X+7]=y[fe[1]],I.array[X+8]=y[fe[2]],X+=9;else if("faces"===I.boundTo)for(o=0,s=he.length;o<s;o++)g=L=I.value[he[o]],v=L,y=L,I.array[X]=g[fe[0]],I.array[X+1]=g[fe[1]],I.array[X+2]=g[fe[2]],I.array[X+3]=v[fe[0]],I.array[X+4]=v[fe[1]],I.array[X+5]=v[fe[2]],I.array[X+6]=y[fe[0]],I.array[X+7]=y[fe[1]],I.array[X+8]=y[fe[2]],X+=9;else if("faceVertices"===I.boundTo)for(o=0,s=he.length;o<s;o++)g=(L=I.value[he[o]])[0],v=L[1],y=L[2],I.array[X]=g[fe[0]],I.array[X+1]=g[fe[1]],I.array[X+2]=g[fe[2]],I.array[X+3]=v[fe[0]],I.array[X+4]=v[fe[1]],I.array[X+5]=v[fe[2]],I.array[X+6]=y[fe[0]],I.array[X+7]=y[fe[1]],I.array[X+8]=y[fe[2]],X+=9}else if(4===I.size)if(void 0===I.boundTo||"vertices"===I.boundTo)for(o=0,s=he.length;o<s;o++)a=ue[he[o]],g=I.value[a.a],v=I.value[a.b],y=I.value[a.c],I.array[X]=g.x,I.array[X+1]=g.y,I.array[X+2]=g.z,I.array[X+3]=g.w,I.array[X+4]=v.x,I.array[X+5]=v.y,I.array[X+6]=v.z,I.array[X+7]=v.w,I.array[X+8]=y.x,I.array[X+9]=y.y,I.array[X+10]=y.z,I.array[X+11]=y.w,X+=12;else if("faces"===I.boundTo)for(o=0,s=he.length;o<s;o++)g=L=I.value[he[o]],v=L,y=L,I.array[X]=g.x,I.array[X+1]=g.y,I.array[X+2]=g.z,I.array[X+3]=g.w,I.array[X+4]=v.x,I.array[X+5]=v.y,I.array[X+6]=v.z,I.array[X+7]=v.w,I.array[X+8]=y.x,I.array[X+9]=y.y,I.array[X+10]=y.z,I.array[X+11]=y.w,X+=12;else if("faceVertices"===I.boundTo)for(o=0,s=he.length;o<s;o++)g=(L=I.value[he[o]])[0],v=L[1],y=L[2],I.array[X]=g.x,I.array[X+1]=g.y,I.array[X+2]=g.z,I.array[X+3]=g.w,I.array[X+4]=v.x,I.array[X+5]=v.y,I.array[X+6]=v.z,I.array[X+7]=v.w,I.array[X+8]=y.x,I.array[X+9]=y.y,I.array[X+10]=y.z,I.array[X+11]=y.w,X+=12;P.bindBuffer(P.ARRAY_BUFFER,I.buffer),P.bufferData(P.ARRAY_BUFFER,I.array,i)}n&&(delete e.__inittedArrays,delete e.__colorArray,delete e.__normalArray,delete e.__tangentArray,delete e.__uvArray,delete e.__uv2Array,delete e.__faceArray,delete e.__vertexArray,delete e.__lineArray,delete e.__skinIndexArray,delete e.__skinWeightArray)}}function rt(e){var t;if(e.streamingDraw){if(!e.streamingIndex){var i=e.index;i&&(i.buffer=P.createBuffer(),P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,i.buffer),P.bufferData(P.ELEMENT_ARRAY_BUFFER,i.array||e.ib,P.STATIC_DRAW))}return}e.vb&&void 0===e.vbbuffer&&(e.vbbuffer=P.createBuffer(),e.vbNeedsUpdate=!0);const n=e.ib||(null===(t=e.index)||void 0===t?void 0:t.array);n&&void 0===e.ibbuffer&&(e.ibbuffer=P.createBuffer(),e.ibNeedsUpdate=!0),e.iblines&&void 0===e.iblinesbuffer&&(e.iblinesbuffer=P.createBuffer(),e.iblinesNeedsUpdate=!0);for(var r=e.attributes,o=Object.keys(e.attributes),s=0,a=o.length;s<a;s++){var l=o[s],c=r[l],h="index"===l;if(c.array&&void 0===c.buffer&&(c.buffer=P.createBuffer(),c.needsUpdate=!0),tt(c)){var u=h?P.ELEMENT_ARRAY_BUFFER:P.ARRAY_BUFFER;P.bindBuffer(u,c.buffer),P.bufferData(u,c.array,P.STATIC_DRAW),it(c)}}e.vbNeedsUpdate&&(P.bindBuffer(P.ARRAY_BUFFER,e.vbbuffer),P.bufferData(P.ARRAY_BUFFER,e.vb,P.STATIC_DRAW),e.vbNeedsUpdate=!1,e.discardAfterUpload&&(e.vbLength=e.vb.length,e.vb=null)),e.ibNeedsUpdate&&(P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,e.ibbuffer),P.bufferData(P.ELEMENT_ARRAY_BUFFER,n,P.STATIC_DRAW),e.ibNeedsUpdate=!1,e.discardAfterUpload&&(e.ibLength=e.ib.length,e.ibByteSize=e.ib instanceof Uint32Array?4:2,e.ib=null)),e.iblinesNeedsUpdate&&(P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,e.iblinesbuffer),P.bufferData(P.ELEMENT_ARRAY_BUFFER,e.iblines,P.STATIC_DRAW),e.iblinesNeedsUpdate=!1,e.discardAfterUpload&&(e.iblinesLength=e.iblines.length,e.iblinesByteSize=e.iblines instanceof Uint32Array?4:2,e.iblines=null))}function ot(e){D?P.bindVertexArray(e):R.bindVertexArrayOES(e)}function st(e){D?P.deleteVertexArray(e):R.deleteVertexArrayOES(e)}function at(e,t,i){D?P.vertexAttribDivisor(e,t&&i||0):I&&I.vertexAttribDivisorANGLE(e,t&&i||0)}function lt(e,t,i,n,r){D?P.drawElementsInstanced(e,t,i,n,r):I.drawElementsInstancedANGLE(e,t,i,n,r)}function ct(e,t,i,n){var r,o,s;if(!c.USE_VAO||i.streamingDraw)return i.vaos=null,!1;if(!D&&!R)return i.vaos=null,!1;if(void 0===i.vaos&&(i.vaos=[]),s=D?P.createVertexArray():R.createVertexArrayOES(),i.vaos.push({geomhash:t.id,uv:n,vao:s}),ot(s),e.isEdgeMaterial)P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,i.iblinesbuffer);else{var a=i.index;a&&P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,a.buffer||i.ibbuffer)}for(var l=null,h=t.attributes,u=t.attributesKeys,d=i.vbstride,p=null!==(r=i.groups)&&void 0!==r&&r.length?i.groups[0].index:0,f=null!==(o=i.groups)&&void 0!==o&&o.length&&i.groups[0].instanceStart||0,m=0,g=u.length;m<g;m++){var v=u[m],y=h[v];if(y>=0){var b=i.attributes[v];if("uv"===v&&n&&(b=i.attributes["uv"+(n+1)]),!b){ot(null);for(var x=0;x<i.vaos.length;x++)st(i.vaos[x].vao);return i.vaos=null,!1}var _=P.FLOAT,E=b.bytesPerItem||4;1===E?_=P.UNSIGNED_BYTE:2===E&&(_=P.UNSIGNED_SHORT),P.enableVertexAttribArray(y);var A=p;b.divisor&&(A+=f),void 0!==b.itemOffset?(l!=i.vbbuffer&&(P.bindBuffer(P.ARRAY_BUFFER,i.vbbuffer),l=i.vbbuffer),P.vertexAttribPointer(y,b.itemSize,_,b.normalized,4*d,4*(b.itemOffset+A*d))):(P.bindBuffer(P.ARRAY_BUFFER,b.buffer),l=b.buffer,P.vertexAttribPointer(y,b.itemSize,_,b.normalized,0,A*b.itemSize*E)),at(y,i.numInstances,b.divisor)}}return!0}function ht(e,t){var i=J[e];return i||(i=P.createBuffer(),J[e]=i),P.bindBuffer(P.ARRAY_BUFFER,i),P.bufferData(P.ARRAY_BUFFER,t,P.DYNAMIC_DRAW),i}function ut(e,t,i,n,r,o,s){var a,l=t.attributes,c=t.attributesKeys,h=0;if(r)if(!r.buffer&&i.streamingDraw){var u=J.index;u||(u=P.createBuffer(),J.index=u),P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,u),e.isEdgeMaterial?P.bufferData(P.ELEMENT_ARRAY_BUFFER,i.iblines,P.DYNAMIC_DRAW):P.bufferData(P.ELEMENT_ARRAY_BUFFER,r.array||i.ib,P.DYNAMIC_DRAW)}else e.isEdgeMaterial?P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,i.iblinesbuffer):P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,r.buffer||i.ibbuffer);for(var d=0,p=c.length;d<p;d++){var f=c[d],m=l[f];if(m>=0){var g=i.attributes[f];if("uv"===f&&o&&(g=i.attributes["uv"+(o+1)]),g){var v,y,b=void 0!==g.itemOffset;b?(v=i.vbstride,y=g.itemOffset,h!==a&&(i.streamingDraw?h=ht("interleavedVB",i.vb):(h=i.vbbuffer,P.bindBuffer(P.ARRAY_BUFFER,h)),a=h)):(v=g.itemSize,y=0,i.streamingDraw?h=ht(f,g.array):(h=g.buffer,P.bindBuffer(P.ARRAY_BUFFER,h)));var x=P.FLOAT,_=g.bytesPerItem||4;1===_?x=P.UNSIGNED_BYTE:2===_&&(x=P.UNSIGNED_SHORT),b&&(_=4),ce.enableAttribute(m);var E=n;g.divisor&&(E+=s),P.vertexAttribPointer(m,g.itemSize,x,g.normalized,v*_,(y+E*v)*_),at(m,i.numInstances,g.divisor)}else if(e.defaultAttributeValues){var A=e.defaultAttributeValues[f];A&&2===A.length?P.vertexAttrib2fv(m,e.defaultAttributeValues[f]):A&&3===A.length?P.vertexAttrib3fv(m,e.defaultAttributeValues[f]):A&&4===A.length&&P.vertexAttrib4fv(m,e.defaultAttributeValues[f])}}}ce.disableUnusedAttributes()}function dt(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.z!==t.z?e.z-t.z:e.id-t.id}function pt(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?t.z-e.z:e.id-t.id}function ft(e){gt(e,!0)}function mt(e){gt(e,!1)}function gt(e,t,i){var n,r;if(i||!1!==e.visible){if(e instanceof l.Scene||e instanceof l.Group);else if(e instanceof s.RenderBatch)e.forEach(t?ft:mt);else if(function(e){O.lostContextRecovery&&O.lostContextRecovery.refreshIfNeeded(e),void 0===e.__webglInit&&(e.__webglInit=!0,e.addEventListener("removed",Ne));var t=e.geometry;void 0===t||void 0===t.__webglInit&&(t.__webglInit=!0,t.addEventListener("dispose",ke),t instanceof l.BufferGeometry||(e instanceof l.Mesh?Tt(e,t):e instanceof l.Line?void 0===t.__webglVertexBuffer&&(!function(e){e.__webglVertexBuffer=P.createBuffer(),e.__webglColorBuffer=P.createBuffer(),e.__webglLineDistanceBuffer=P.createBuffer(),O.info.memory.geometries++}(t),function(e,t){var i=e.vertices.length;e.__vertexArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__lineDistanceArray=new Float32Array(1*i),e.__webglLineCount=i,Ke(e,t)}(t,e),t.verticesNeedUpdate=!0,t.colorsNeedUpdate=!0,t.lineDistancesNeedUpdate=!0):e instanceof l.PointCloud&&void 0===t.__webglVertexBuffer&&(!function(e){e.__webglVertexBuffer=P.createBuffer(),e.__webglColorBuffer=P.createBuffer(),O.info.memory.geometries++}(t),function(e,t){var i=e.vertices.length;e.__vertexArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__webglPointCount=i,Ke(e,t)}(t,e),t.verticesNeedUpdate=!0,t.colorsNeedUpdate=!0)));if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof l.Mesh){if(t instanceof l.BufferGeometry)Ct(S,t,e);else if(t instanceof l.Geometry)for(var i=wt[t.id],n=0,r=i.length;n<r;n++)Ct(S,i[n],e)}else(e instanceof l.Line||e instanceof l.PointCloud)&&Ct(S,t,e)}(e),e instanceof l.Light)A.push(e);else{var o=S[e.id];if(o&&(!1===e.frustumCulled||!0===$.intersectsObject(e)))for(n=0,r=o.length;n<r;n++){var a=o[n];St(a),a.render=!0,!0===t&&(ie.setFromMatrixPosition(e.matrixWorld),ie=(0,h.r)(ie,ee),a.z=ie.z)}}if(e.children)for(n=0,r=e.children.length;n<r;n++)gt(e.children[n],t,i)}}function vt(e,t){if(!t.getCustomOverrideMaterial)return t;var i=t.getCustomOverrideMaterial(e);return i||t}function yt(e,t,i,n,r,o,s){if(e.twoPassTransparency){var a=e.side;e.side=l.BackSide,xt(e,t,i,n,r,o,s),e.side=l.FrontSide,xt(e,t,i,n,r,o,s),e.side=a}else xt(e,t,i,n,r,o,s)}function bt(e,t,i,n,r){for(var o,s=0,a=e.length;s<a;s++){var l=e[s],c=l.object,h=l.buffer;if(r)o=vt(l.material,r);else{if(!(o=l.material))continue;Rt(o)}if(t.isArrayCamera){const e=t.cameras;for(let t=0,s=e.length;t<s;t++){const s=e[t];c.layers.test(s.layers)&&(le.viewport(Q.copy(s.viewport)),P.viewport(Q.x,Q.y,Q.z,Q.w),yt(o,s,i,n,h,r,c))}}else yt(o,t,i,n,h,r,c)}}function xt(e,t,i,n,r,o,s){if(O.setMaterialFaces(e),r instanceof l.BufferGeometry?O.renderBufferDirect(t,i,n,e,r,s):O.renderBuffer(t,i,n,e,r,s),e.decals)for(var a=e.decals,c=0,h=a.length;c<h;c++){var u=a[c];Rt(e=u.material),O.setMaterialFaces(e),r instanceof l.BufferGeometry&&O.renderBufferDirect(t,i,n,e,r,s,u.uv)}}function _t(e,t){if(e.visible&&!e.hide){var i;if(je)i=vt(e.material,je);else{if(!(i=e.material))return;Rt(i)}if(i.twoPassTransparency){var n=i.side;i.side=l.BackSide,Et(e,i),i.side=l.FrontSide,Et(e,i),i.side=n}else Et(e,i)}}function Et(e,t){if(O.setMaterialFaces(t),O.renderBufferDirect(Ge,He,We,t,e.geometry,e),t.decals)for(var i=t.decals,n=0,r=i.length;n<r;n++){var o=i[n];Rt(t=o.material),O.setMaterialFaces(t),O.renderBufferDirect(Ge,He,We,t,e.geometry,e,o.uv)}}function At(e,t,i,n,r,o){if(He=n,We=r,je=o||null,i.isArrayCamera)for(var s=0;s<i.cameras.length;s++)Ge=i.cameras[s],le.viewport(Q.copy(Ge.viewport)),P.viewport(Q.x,Q.y,Q.z,Q.w),e.forEach(_t,e.forceVisible?1:32,!1);else Ge=i,e.forEach(_t,e.forceVisible?1:32,!1)}function St(e){var t=e.object,i=e.buffer,n=t.geometry,r=t.material;if(r instanceof l.MeshFaceMaterial){var o=n instanceof l.BufferGeometry?0:i.materialIndex;r=r.materials[o],e.material=r,r.transparent?C.push(e):T.push(e)}else r&&(e.material=r,r.transparent?C.push(e):T.push(e))}this.renderBufferDirect=function(e,t,i,n,r,o,s){var a;if(O.lostContextRecovery&&O.lostContextRecovery.refreshIfNeeded(r),!1!==n.visible&&(!n.isEdgeMaterial||r.iblines||r.iblinesbuffer)){rt(o.geometry);var c=Ot(e,t,i,n,o),h=!1,u=n.wireframe?1:0,d="direct_"+r.id+(s?"/"+s:"")+"_"+c.id+"_"+u;d!==G&&(G=d,h=!0);var p,f=null===(a=r.groups)||void 0===a?void 0:a.length,m=f&&r.groups.some((function(e){return e.index>=0||e.instanceStart>=0}));m?h=!0:(p=function(e,t,i,n){var r=i.vaos;if(r)for(var o=0,s=r.length;o<s;o++){var a=r[o];if(a.geomhash===t.id&&a.uv===n)return ot(a.vao),!0}else if(null===r)return!1;return ct(e,t,i,n)}(n,c,r,s||0),h=h&&!p),h&&ce.initAttributes();var g,v=r.index;if(v){var y,b=r.ibByteSize,x=v.array?v.array:r.ib;let e=r.ibLength;n.isEdgeMaterial&&(v=r.attributes.indexlines,x=r.iblines,e=r.iblinesLength,b=r.iblinesByteSize),v.bytesPerItem?4===(b=v.bytesPerItem)&&!D&&ae.get("OES_element_index_uint"):x&&(b=x instanceof Uint32Array&&(D||ae.get("OES_element_index_uint"))?4:2),y=4===b?P.UNSIGNED_INT:P.UNSIGNED_SHORT;var _=r.groups;f&&n.isEdgeMaterial&&!Object.prototype.hasOwnProperty.call(_[0],"edgeStart")&&(_=null);var E=0;do{var A,S,w,M,T;if(f){var C,L=_[E];A=L.index,S=n.isEdgeMaterial?L.edgeStart||0:L.start,w=n.isEdgeMaterial?L.edgeCount||(null===(C=x)||void 0===C?void 0:C.length)||e:L.count,M=L.instanceStart||0,T=L.numInstances||r.numInstances;var R=n.program.uniforms;if(R.themingColor&&"themingColor"in L){var N=L.themingColor;N instanceof l.Vector4?P.uniform4f(R.themingColor,N.x,N.y,N.z,N.w):P.uniform4f(R.themingColor,0,0,0,0)}}else{var k;A=0,S=0,w=(null===(k=x)||void 0===k?void 0:k.length)||e,M=0,T=r.numInstances}h&&(ut(n,c,r,A,v,s,M),m||(h=!1)),g=P.TRIANGLES,r.isPoints||o instanceof l.PointCloud?g=P.POINTS:(r.isLines||n.isEdgeMaterial||o instanceof l.Line)&&(g=P.LINES),T?lt(g,w,y,S*b,T):P.drawElements(g,w,y,S*b),++this.info.render.calls}while(_&&++E<_.length)}else{var F;(null===(F=r.groups)||void 0===F?void 0:F.length)>1&&console.error("Geometry with draw calls and no index buffer"),h&&ut(n,c,r,0,void 0,s,0);var V=r.attributes.position;g=P.TRIANGLES,r.isPoints||o instanceof l.PointCloud?g=P.POINTS:(r.isLines||n.isEdgeMaterial||o instanceof l.Line)&&(g=P.LINES),r.numInstances?function(e,t,i,n){D?P.drawArraysInstanced(e,t,i,n):I.drawArraysInstancedANGLE(e,t,i,n)}(g,0,V.array.length/3,r.numInstances):P.drawArrays(g,0,V.array.length/V.itemSize),++this.info.render.calls}p&&ot(null)}},this.renderBuffer=function(e,t,i,n,r,o){if(!1!==n.visible&&!n.isEdgeMaterial){!function(e){var t,i,n=e.geometry;if(n instanceof l.BufferGeometry)rt(n);else if(e instanceof l.Mesh){!0===n.groupsNeedUpdate&&Tt(e,n);for(var r=wt[n.id],o=0,s=r.length;o<s;o++){var a=r[o];t=(i=Qe(e,a)).attributes&&Pt(i),(n.verticesNeedUpdate||n.morphTargetsNeedUpdate||n.elementsNeedUpdate||n.uvsNeedUpdate||n.normalsNeedUpdate||n.colorsNeedUpdate||n.tangentsNeedUpdate||t)&&nt(a,e,P.DYNAMIC_DRAW,!n.dynamic,i)}n.verticesNeedUpdate=!1,n.morphTargetsNeedUpdate=!1,n.elementsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.tangentsNeedUpdate=!1,i.attributes&&Dt(i)}else e instanceof l.Line?(t=(i=Qe(e,n)).attributes&&Pt(i),(n.verticesNeedUpdate||n.colorsNeedUpdate||n.lineDistancesNeedUpdate||t)&&function(e,t){var i,n,r,o,s,a,l,c,h,u,d,p,f=e.vertices,m=e.colors,g=e.lineDistances,v=f.length,y=m.length,b=g.length,x=e.__vertexArray,_=e.__colorArray,E=e.__lineDistanceArray,A=e.verticesNeedUpdate,S=e.colorsNeedUpdate,w=e.lineDistancesNeedUpdate,M=e.__webglCustomAttributesList;if(A){for(i=0;i<v;i++)o=f[i],x[s=3*i]=o.x,x[s+1]=o.y,x[s+2]=o.z;P.bindBuffer(P.ARRAY_BUFFER,e.__webglVertexBuffer),P.bufferData(P.ARRAY_BUFFER,x,t)}if(S){for(n=0;n<y;n++)a=m[n],_[s=3*n]=a.r,_[s+1]=a.g,_[s+2]=a.b;P.bindBuffer(P.ARRAY_BUFFER,e.__webglColorBuffer),P.bufferData(P.ARRAY_BUFFER,_,t)}if(w){for(r=0;r<b;r++)E[r]=g[r];P.bindBuffer(P.ARRAY_BUFFER,e.__webglLineDistanceBuffer),P.bufferData(P.ARRAY_BUFFER,E,t)}if(M)for(l=0,c=M.length;l<c;l++)if(tt(p=M[l])&&(void 0===p.boundTo||"vertices"===p.boundTo)){if(s=0,u=p.value.length,1===p.size)for(h=0;h<u;h++)p.array[h]=p.value[h];else if(2===p.size)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,s+=2;else if(3===p.size)if("c"===p.type)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.r,p.array[s+1]=d.g,p.array[s+2]=d.b,s+=3;else for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,p.array[s+2]=d.z,s+=3;else if(4===p.size)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,p.array[s+2]=d.z,p.array[s+3]=d.w,s+=4;P.bindBuffer(P.ARRAY_BUFFER,p.buffer),P.bufferData(P.ARRAY_BUFFER,p.array,t)}}(n,P.DYNAMIC_DRAW),n.verticesNeedUpdate=!1,n.colorsNeedUpdate=!1,n.lineDistancesNeedUpdate=!1,i.attributes&&Dt(i)):e instanceof l.PointCloud&&(t=(i=Qe(e,n)).attributes&&Pt(i),(n.verticesNeedUpdate||n.colorsNeedUpdate||t)&&function(e,t){var i,n,r,o,s,a,l,c,h,u,d,p=e.vertices,f=e.colors,m=p.length,g=f.length,v=e.__vertexArray,y=e.__colorArray,b=e.verticesNeedUpdate,x=e.colorsNeedUpdate,_=e.__webglCustomAttributesList;if(b){for(i=0;i<m;i++)r=p[i],v[o=3*i]=r.x,v[o+1]=r.y,v[o+2]=r.z;P.bindBuffer(P.ARRAY_BUFFER,e.__webglVertexBuffer),P.bufferData(P.ARRAY_BUFFER,v,t)}if(x){for(n=0;n<g;n++)s=f[n],y[o=3*n]=s.r,y[o+1]=s.g,y[o+2]=s.b;P.bindBuffer(P.ARRAY_BUFFER,e.__webglColorBuffer),P.bufferData(P.ARRAY_BUFFER,y,t)}if(_)for(a=0,l=_.length;a<l;a++)if(tt(d=_[a])&&(void 0===d.boundTo||"vertices"===d.boundTo)){if(o=0,h=d.value.length,1===d.size)for(c=0;c<h;c++)d.array[c]=d.value[c];else if(2===d.size)for(c=0;c<h;c++)u=d.value[c],d.array[o]=u.x,d.array[o+1]=u.y,o+=2;else if(3===d.size)if("c"===d.type)for(c=0;c<h;c++)u=d.value[c],d.array[o]=u.r,d.array[o+1]=u.g,d.array[o+2]=u.b,o+=3;else for(c=0;c<h;c++)u=d.value[c],d.array[o]=u.x,d.array[o+1]=u.y,d.array[o+2]=u.z,o+=3;else if(4===d.size)for(c=0;c<h;c++)u=d.value[c],d.array[o]=u.x,d.array[o+1]=u.y,d.array[o+2]=u.z,d.array[o+3]=u.w,o+=4;P.bindBuffer(P.ARRAY_BUFFER,d.buffer),P.bufferData(P.ARRAY_BUFFER,d.array,t)}}(n,P.DYNAMIC_DRAW),n.verticesNeedUpdate=!1,n.colorsNeedUpdate=!1,i.attributes&&Dt(i))}(o);var s=Ot(e,t,i,n,o),a=s.attributes,c=!1,h=n.wireframe?1:0,u=r.id+"_"+s.id+"_"+h;if(u!==G&&(G=u,c=!0),c&&ce.initAttributes(),!n.morphTargets&&a.position>=0&&c&&(P.bindBuffer(P.ARRAY_BUFFER,r.__webglVertexBuffer),ce.enableAttribute(a.position),v(a.position,3,P.FLOAT,!1,0,0)),c){if(r.__webglCustomAttributesList)for(var d=0,p=r.__webglCustomAttributesList.length;d<p;d++){var f=r.__webglCustomAttributesList[d];a[f.buffer.belongsToAttribute]>=0&&(P.bindBuffer(P.ARRAY_BUFFER,f.buffer),ce.enableAttribute(a[f.buffer.belongsToAttribute]),v(a[f.buffer.belongsToAttribute],f.size,P.FLOAT,!1,0,0))}a.color>=0&&(o.geometry.colors.length>0||o.geometry.faces.length>0?(P.bindBuffer(P.ARRAY_BUFFER,r.__webglColorBuffer),ce.enableAttribute(a.color),v(a.color,3,P.FLOAT,!1,0,0)):n.defaultAttributeValues&&P.vertexAttrib3fv(a.color,n.defaultAttributeValues.color)),a.normal>=0&&(P.bindBuffer(P.ARRAY_BUFFER,r.__webglNormalBuffer),ce.enableAttribute(a.normal),v(a.normal,3,P.FLOAT,!1,0,0)),a.tangent>=0&&(P.bindBuffer(P.ARRAY_BUFFER,r.__webglTangentBuffer),ce.enableAttribute(a.tangent),v(a.tangent,4,P.FLOAT,!1,0,0)),a.uv>=0&&(o.geometry.faceVertexUvs[0]?(P.bindBuffer(P.ARRAY_BUFFER,r.__webglUVBuffer),ce.enableAttribute(a.uv),v(a.uv,2,P.FLOAT,!1,0,0)):n.defaultAttributeValues&&P.vertexAttrib2fv(a.uv,n.defaultAttributeValues.uv)),a.uv2>=0&&(o.geometry.faceVertexUvs[1]?(P.bindBuffer(P.ARRAY_BUFFER,r.__webglUV2Buffer),ce.enableAttribute(a.uv2),v(a.uv2,2,P.FLOAT,!1,0,0)):n.defaultAttributeValues&&P.vertexAttrib2fv(a.uv2,n.defaultAttributeValues.uv2)),a.lineDistance>=0&&(P.bindBuffer(P.ARRAY_BUFFER,r.__webglLineDistanceBuffer),ce.enableAttribute(a.lineDistance),v(a.lineDistance,1,P.FLOAT,!1,0,0))}if(ce.disableUnusedAttributes(),o instanceof l.Mesh){var m=r.__typeArray===Uint32Array?P.UNSIGNED_INT:P.UNSIGNED_SHORT;n.wireframe?(le.setLineWidth(n.wireframeLinewidth*this.getPixelRatio()),c&&P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,r.__webglLineBuffer),P.drawElements(P.LINES,r.__webglLineCount,m,0)):(c&&P.bindBuffer(P.ELEMENT_ARRAY_BUFFER,r.__webglFaceBuffer),P.drawElements(P.TRIANGLES,r.__webglFaceCount,m,0)),++this.info.render.calls}else if(o instanceof l.Line){var g=o.mode===l.LineStrip?P.LINE_STRIP:P.LINES;le.setLineWidth(n.linewidth*this.getPixelRatio()),P.drawArrays(g,0,r.__webglLineCount),++this.info.render.calls}else o instanceof l.PointCloud&&(P.drawArrays(P.POINTS,0,r.__webglPointCount),++this.info.render.calls)}function v(e,t,i,n,r,o){P.vertexAttribPointer(e,t,i,n,r,o),I&&I.vertexAttribDivisorANGLE(e,0)}},this.render=function(e,t,i,n){var r,o,a,c;let h,u=i,d=n;if(arguments.length>2&&(i instanceof l.WebGLRenderTarget||Array.isArray(i))&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),h=i,u=n,d=arguments[4]),t instanceof l.Camera!=!1){if(!P.isContextLost()){G="",B=-1,z=null,void 0!==d&&(A.length=0,re=!0);var p=e.fog;!0===e.autoUpdate&&e.updateMatrixWorld(),void 0!==t.parent&&null!==t.parent||t.updateMatrixWorld(),t.worldUpTransform?te.multiplyMatrices(t.worldUpTransform,t.matrixWorld):te.copy(t.matrixWorld),ee.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromProjectionMatrix(ee);var f=e instanceof s.RenderBatch&&e.renderImmediate;if(f||(T.length=0,C.length=0,gt(e,!0===O.sortObjects,!0===e.forceVisible),!0===O.sortObjects&&(T.sort(pt),C.sort(dt))),re&&(d&&d.length&&(A=d.slice()),Ut(A)),void 0!==h&&this.setRenderTarget(h),this.resetGLState(),(this.autoClear||u)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),e.overrideMaterial){let i=e.overrideMaterial;Rt(i),f?At(e,"",t,A,p,i):(bt(T,t,A,p,i),bt(C,t,A,p,i))}else f?At(e,"",t,A,p,null):(le.setBlending(l.NoBlending),bt(T,t,A,p,null),bt(C,t,A,p,null));if(e.edgeMaterial){P.depthFunc(P.LESS);let i=e.edgeMaterial;Rt(i),f?At(e,"",t,A,p,i):(bt(T,t,A,p,i),bt(C,t,A,p,i)),P.depthFunc(P.LEQUAL)}!U&&null!==(r=V)&&void 0!==r&&null!==(o=r.texture)&&void 0!==o&&o.generateMipmaps&&(null===(a=V)||void 0===a?void 0:a.texture.minFilter)!==l.NearestFilter&&(null===(c=V)||void 0===c?void 0:c.texture.minFilter)!==l.LinearFilter&&Xt(V),this.resetGLState(),le.setDepthTest(!0),le.setDepthWrite(!0)}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setProgramPrefix=function(e,t,i){H=e,W=t,j=i},this.getProgramPrefix=function(){return{programPrefix:H,vertexPrefix:W,fragmentPrefix:j}};var wt={},Mt=0;function Tt(e,t){var i=e.material,n=!1;void 0!==wt[t.id]&&!0!==t.groupsNeedUpdate||(delete S[e.id],wt[t.id]=function(e,t){for(var i,n,r=D||ae.get("OES_element_index_uint")?4294967296:65535,o={},s=e.morphTargets?e.morphTargets.length:0,a=e.morphNormals?e.morphNormals.length:0,l={},c=[],h=0,u=e.faces.length;h<u;h++){var d=e.faces[h],p=t?d.materialIndex:0;p in o||(o[p]={hash:p,counter:0}),(i=o[p].hash+"_"+o[p].counter)in l||(n={id:Mt++,faces3:[],materialIndex:p,vertices:0,numMorphTargets:s,numMorphNormals:a},l[i]=n,c.push(n)),l[i].vertices+3>r&&(o[p].counter+=1,(i=o[p].hash+"_"+o[p].counter)in l||(n={id:Mt++,faces3:[],materialIndex:p,vertices:0,numMorphTargets:s,numMorphNormals:a},l[i]=n,c.push(n))),l[i].faces3.push(h),l[i].vertices+=3}return c}(t,i instanceof l.MeshFaceMaterial),t.groupsNeedUpdate=!1);for(var r=wt[t.id],o=0,s=r.length;o<s;o++){var a=r[o];void 0===a.__webglVertexBuffer?(Oe(a),Ze(a,e),t.verticesNeedUpdate=!0,t.morphTargetsNeedUpdate=!0,t.elementsNeedUpdate=!0,t.uvsNeedUpdate=!0,t.normalsNeedUpdate=!0,t.tangentsNeedUpdate=!0,t.colorsNeedUpdate=!0,n=!0):n=!1,(n||void 0===e.__webglActive)&&Ct(S,a,e)}e.__webglActive=!0}function Ct(e,t,i){var n=i.id;e[n]=e[n]||[],e[n].push({id:n,buffer:t,object:i,material:null,z:0})}function Pt(e){for(var t in e.attributes)if(tt(e.attributes[t]))return!0;return!1}function Dt(e){for(var t in e.attributes)it(e.attributes[t])}var Lt={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshLambertMaterial:"lambert",LineDashedMaterial:"dashed",MeshBasicMaterial:"firefly_basic",LineBasicMaterial:"firefly_basic",PointCloudMaterial:"firefly_basic",PointsMaterial:"firefly_basic",MeshPhongMaterial:"firefly_phong"};function It(e,t,i,r){e.addEventListener("dispose",Ue);var o=Lt[e.type];if(o){var s=l.ShaderLib[o];let t=l.UniformsUtils.clone(s.uniforms);e.uniforms&&(t=l.UniformsUtils.merge([t,e.uniforms])),e.__webglShader={uniforms:t,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader}}else e.__webglShader={uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};var c,h,u=function(e){for(var t=0,i=0,n=0,r=0,o=0,s=e.length;o<s;o++){var a=e[o];a.onlyShadow||(a instanceof l.DirectionalLight&&t++,a instanceof l.PointLight&&i++,a instanceof l.SpotLight&&n++,a instanceof l.HemisphereLight&&r++)}return{directional:t,point:i,spot:n,hemi:r}}(t),d={vertexShader:e.__webglShader.vertexShader,fragmentShader:e.__webglShader.fragmentShader,precision:a,precisionFragment:m,supportsVertexTextures:be,haveTextureLod:D||!!ae.get("EXT_shader_texture_lod"),loadingAnimationDuration:O.loadingAnimationDuration,map:!!e.map,envMap:!!e.envMap,irradianceMap:!!e.irradianceMap,envIsSpherical:e.envMap&&e.envMap.mapping==l.SphericalReflectionMapping,envGammaEncoded:e.envMap&&e.envMap.GammaEncoded,irrGammaEncoded:e.irradianceMap&&e.irradianceMap.GammaEncoded,envRGBM:e.envMap&&e.envMap.RGBM,irrRGBM:e.irradianceMap&&e.irradianceMap.RGBM,lightMap:!!e.lightMap,bumpMap:(D||ae.get("OES_standard_derivatives"))&&!!e.bumpMap,normalMap:(D||ae.get("OES_standard_derivatives"))&&!!e.normalMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,vertexColors:e.vertexColors,vertexIds:e.vertexIds,useInstancing:e.useInstancing,wideLines:e.wideLines,fog:i,useFog:e.fog,useBackgroundTexture:e.useBackgroundTexture,sizeAttenuation:e.sizeAttenuation,maxDirLights:u.directional,maxPointLights:u.point,maxSpotLights:u.spot,maxHemiLights:u.hemi,alphaTest:e.alphaTest,metal:e.metal,clearcoat:e.clearcoat,wrapAround:e.wrapAround,doubleSided:e.side===l.DoubleSide,flipSided:e.side===l.BackSide,mrtNormals:e.mrtNormals,mrtIdBuffer:e.mrtIdBuffer,vertexPrefix:W,fragmentPrefix:j,tonemapOutput:e.tonemapOutput,packedNormals:e.packedNormals,hatchPattern:!!e.hatchParams,numCutplanes:e.cutplanes?e.cutplanes.length:0,useTiling:e.useTiling,tilingRepeatRange:e.useTiling&&e.tilingRepeatRange,hasRoundCorner:e.hasRoundCorner,useRandomOffset:e.useRandomOffset,mapInvert:e.map&&e.map.invert,mapClampS:e.map&&e.map.clampS,mapClampT:e.map&&e.map.clampT,bumpMapClampS:e.bumpMap&&e.bumpMap.clampS,bumpMapClampT:e.bumpMap&&e.bumpMap.clampT,normalMapClampS:e.normalMap&&e.normalMap.clampS,normalMapClampT:e.normalMap&&e.normalMap.clampT,specularMapClampS:e.specularMap&&e.specularMap.clampS,specularMapClampT:e.specularMap&&e.specularMap.clampT,alphaMapInvert:e.alphaMap&&e.alphaMap.invert,alphaMapClampS:e.alphaMap&&e.alphaMap.clampS,alphaMapClampT:e.alphaMap&&e.alphaMap.clampT},p=[];for(var f in o?p.push(o):(p.push(e.fragmentShader),p.push(e.vertexShader)),e.defines)p.push(f),p.push(e.defines[f]);for(c in d)p.push(c),p.push(d[c]);var g,v=p.join();for(c=0,h=N.length;c<h;c++){var y=N[c];if(y.code===v){(g=y).usedTimes++;break}}for(var b in void 0===g&&(e.onBeforeCompile(d,O),g=new n.WebGLProgram(O,v,e,d,r.geometry),N.push(g),O.info.memory.programs=N.length),e.programs||(e.programs=[]),e.programs[H]=g,e.uniformsLists||(e.uniformsLists=[]),e.uniformsList=e.uniformsLists[H]=[],e.__webglShader.uniforms){var x=g.uniforms[b];x&&e.uniformsList.push([e.__webglShader.uniforms[b],x])}}function Rt(e){!0===e.transparent?le.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha):le.setBlending(l.NoBlending),le.setDepthTest(e.depthTest),le.setDepthWrite(e.depthWrite),le.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function Ot(e,i,n,o,s){X=0,O.lostContextRecovery&&O.lostContextRecovery.refreshIfNeeded(o),tt(o)?(o.program&&Ye(o),It(o,i,n,s),it(o)):o.programs&&o.programs[H]||It(o,i,n,s);var a=!1,c=!1,h=!1;o.uniformsList=o.uniformsLists[H];var d,p=o.program=o.programs[H],f=p.uniforms,m=o.__webglShader.uniforms;if(p.id!==k&&(P.useProgram(p.program),k=p.id,a=!0,c=!0,h=!0),o.id!==B&&(-1===B&&(h=!0),B=o.id,c=!0),f.meshAnimTime){var g=1;s.geometry.creationTime&&O.loadingAnimationDuration>0&&(g=Math.min((O.highResTimeStamp-s.geometry.creationTime)/O.loadingAnimationDuration,1)),P.uniform1f(f.meshAnimTime,g)}if((a||e!==z)&&(P.uniformMatrix4fv(f.projectionMatrix,!1,e.projectionMatrix.elements),e!==z&&(z=e),(o instanceof l.ShaderMaterial||o instanceof l.MeshPhongMaterial&&!o.isLmvMaterial||o.envMap)&&null!==f.cameraPosition&&(ie.setFromMatrixPosition(e.matrixWorld),P.uniform3f(f.cameraPosition,ie.x,ie.y,ie.z)),(o instanceof l.MeshPhongMaterial&&!o.isLmvMaterial||o instanceof l.MeshLambertMaterial||o instanceof l.ShaderMaterial||o.skinning)&&(null!==f.viewMatrix&&P.uniformMatrix4fv(f.viewMatrix,!1,e.matrixWorldInverse.elements),null!==f.viewMatrixInverse&&P.uniformMatrix4fv(f.viewMatrixInverse,!1,te.elements),f.mvpMatrix&&P.uniformMatrix4fv(f.mvpMatrix,!1,ee.elements),h?((0,u.U7)(m,o),(0,u.Bl)(m,!0)):(0,u.Bl)(m,!1))),f.unpackXform){var v=s.geometry,y=v.unpackXform;if(y?P.uniform4f(f.unpackXform,y.x,y.y,y.z,y.w):P.uniform4f(f.unpackXform,1,1,0,0),f.tIdColor){P.uniform2f(f.vIdColorTexSize,v.vIdColorTexSize.x,v.vIdColorTexSize.y);var b=Ft();P.uniform1i(f.tIdColor,b),O.setTexture(v.tIdColor,b)}}if(c){if((o instanceof l.MeshPhongMaterial&&!o.isLmvMaterial||o instanceof l.MeshLambertMaterial||o.lights)&&(re&&(h=!0,Ut(i),re=!1),h?(!function(e,t){e.ambientLightColor.value=t.ambient,e.directionalLightColor.value=t.directional.colors,e.directionalLightDirection.value=t.directional.positions,e.pointLightColor.value=t.point.colors,e.pointLightPosition.value=t.point.positions,e.pointLightDistance.value=t.point.distances,e.spotLightColor.value=t.spot.colors,e.spotLightPosition.value=t.spot.positions,e.spotLightDistance.value=t.spot.distances,e.spotLightDirection.value=t.spot.directions,e.spotLightAngleCos.value=t.spot.anglesCos,e.spotLightExponent.value=t.spot.exponents,e.hemisphereLightSkyColor.value=t.hemi.skyColors,e.hemisphereLightGroundColor.value=t.hemi.groundColors,e.hemisphereLightDirection.value=t.hemi.positions}(m,oe),kt(m,!0)):kt(m,!1)),(o instanceof l.MeshBasicMaterial&&!o.isLmvMaterial||o instanceof l.MeshLambertMaterial||o instanceof l.MeshPhongMaterial&&!o.isLmvMaterial)&&(!function(e,t){e.opacity.value=t.opacity,e.diffuse.value.copy(t.color),e.map.value=t.map,e.lightMap.value=t.lightMap,e.specularMap.value=t.specularMap,e.alphaMap.value=t.alphaMap,t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale);t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));function i(e,t,i){var n=i.offset,r=i.repeat;if(t){var o=t.value;i.matrix?o.copy(i.matrix):o.identity(),o.elements[6]+=n.x,o.elements[7]+=n.y,o.elements[0]*=r.x,o.elements[3]*=r.x,o.elements[1]*=r.y,o.elements[4]*=r.y}else e.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}t.alphaMap&&i(e,e.texMatrixAlpha,t.alphaMap);var n,r;t.normalMap?n=t.normalMap:t.bumpMap&&(n=t.bumpMap);void 0!==n&&i(e,e.texMatrixBump,n);t.map?r=t.map:t.specularMap&&(r=t.specularMap);void 0!==r&&i(e,e.texMatrix,r);e.envMap.value=t.envMap,e.irradianceMap&&(e.irradianceMap.value=t.irradianceMap);e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio}(m,o),(0,u.U7)(m,o)),(o instanceof l.PointCloudMaterial||o instanceof l.PointsMaterial)&&!o.isLmvMaterial?function(e,t){Nt(e,t),e.point_size.value=t.size,e.map.value=t.map}(m,o):o instanceof l.LineBasicMaterial&&!o.isLmvMaterial?Nt(m,o):o instanceof l.LineDashedMaterial?(Nt(m,o),function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(m,o)):o instanceof l.MeshPhongMaterial&&!o.isLmvMaterial?function(e,t){if(e.shininess.value=t.shininess,e.reflMipIndex){var i=Math.log(Math.max(1+1e-10,t.shininess));e.reflMipIndex.value=Math.max(0,-.72134752*i+5.5)}e.emissive&&e.emissive.value.copy(t.emissive);e.specular.value.copy(t.specular),e.exposureBias&&(e.exposureBias.value=t.exposureBias)}(m,o):o instanceof l.MeshLambertMaterial?function(e,t){e.emissive.value.copy(t.emissive),t.wrapAround&&e.wrapRGB.value.copy(t.wrapRGB)}(m,o):o instanceof l.MeshDepthMaterial?(m.mNear.value=e.near,m.mFar.value=e.far,m.opacity.value=o.opacity):o instanceof l.MeshNormalMaterial?m.opacity.value=o.opacity:"function"==typeof o.refreshUniforms&&o.refreshUniforms(m),o.wideLines){var x=s.geometry.lineWidth;void 0!==o.linewidth&&(x=o.linewidth);const e=1/Math.max(Number.EPSILON,x);m.view_size.value=new l.Vector2(t.width*e,t.height*e)}r.ShadowRender&&o.shadowMap&&r.ShadowRender.RefreshUniformsShadow(m,o);var _=m.cutplanes;o.cutplanes&&o.cutplanes.length>0&&_&&(_.value=o.cutplanes,_._array&&_._array.length!=4*o.cutplanes&&(_._array=void 0)),o.hatchParams&&m.hatchParams&&(m.hatchParams.value.copy(o.hatchParams),m.hatchTintColor.value.copy(o.hatchTintColor),m.hatchTintIntensity.value=o.hatchTintIntensity),function(e){for(var t,i,n,r=0,o=e.length;r<o;r++){var s=e[r][0];if(!1!==s.needsUpdate&&!s.perObject){var a,c,h=s.type,u=s.value,d=e[r][1];switch(h){case"1i":case"i":P.uniform1i(d,u);break;case"1f":case"f":P.uniform1f(d,u);break;case"2f":P.uniform2f(d,u[0],u[1]);break;case"3f":P.uniform3f(d,u[0],u[1],u[2]);break;case"4f":P.uniform4f(d,u[0],u[1],u[2],u[3]);break;case"1iv":case"iv1":P.uniform1iv(d,u);break;case"3iv":case"iv":P.uniform3iv(d,u);break;case"1fv":case"fv1":P.uniform1fv(d,u);break;case"2fv":P.uniform2fv(d,u);break;case"3fv":case"fv":P.uniform3fv(d,u);break;case"4fv":P.uniform4fv(d,u);break;case"Matrix3fv":P.uniformMatrix3fv(d,!1,u);break;case"Matrix4fv":P.uniformMatrix4fv(d,!1,u);break;case"v2":P.uniform2f(d,u.x,u.y);break;case"v3":P.uniform3f(d,u.x,u.y,u.z);break;case"v4":P.uniform4f(d,u.x,u.y,u.z,u.w);break;case"c":P.uniform3f(d,u.r,u.g,u.b);break;case"v2v":for(void 0===s._array&&(s._array=new Float32Array(2*u.length)),a=0,c=u.length;a<c;a++)n=2*a,s._array[n]=u[a].x,s._array[n+1]=u[a].y;P.uniform2fv(d,s._array);break;case"v3v":for(void 0===s._array&&(s._array=new Float32Array(3*u.length)),a=0,c=u.length;a<c;a++)n=3*a,s._array[n]=u[a].x,s._array[n+1]=u[a].y,s._array[n+2]=u[a].z;P.uniform3fv(d,s._array);break;case"v4v":for(void 0===s._array&&(s._array=new Float32Array(4*u.length)),a=0,c=u.length;a<c;a++)n=4*a,s._array[n]=u[a].x,s._array[n+1]=u[a].y,s._array[n+2]=u[a].z,s._array[n+3]=u[a].w;P.uniform4fv(d,s._array);break;case"m3":P.uniformMatrix3fv(d,!1,u.elements);break;case"m3v":for(void 0===s._array&&(s._array=new Float32Array(9*u.length)),a=0,c=u.length;a<c;a++)u[a].flattenToArrayOffset(s._array,9*a);P.uniformMatrix3fv(d,!1,s._array);break;case"m4":P.uniformMatrix4fv(d,!1,u.elements);break;case"m4v":for(void 0===s._array&&(s._array=new Float32Array(16*u.length)),a=0,c=u.length;a<c;a++)u[a].flattenToArrayOffset(s._array,16*a);P.uniformMatrix4fv(d,!1,s._array);break;case"t":if(t=u,i=Ft(),P.uniform1i(d,i),!t){P.activeTexture(P.TEXTURE0+i),P.bindTexture(P.TEXTURE_2D,fe.__webglTexture);continue}O.lostContextRecovery&&O.lostContextRecovery.refreshIfNeeded(t),Array.isArray(t.image)&&6===t.image.length||t instanceof l.CubeTexture?tt(t)?Gt(t,i):(P.activeTexture(P.TEXTURE0+i),P.bindTexture(P.TEXTURE_CUBE_MAP,t.__webglTextureCube)):t instanceof l.WebGLRenderTargetCube?Ht(t,i):O.setTexture(t,i);break;case"tv":for(void 0===s._array&&(s._array=[]),a=0,c=s.value.length;a<c;a++)s._array[a]=Ft();for(P.uniform1iv(d,s._array),a=0,c=s.value.length;a<c;a++)t=s.value[a],i=s._array[a],t&&(O.lostContextRecovery&&O.lostContextRecovery.refreshIfNeeded(t),O.setTexture(t,i));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+h)}}}}(o.uniformsList)}if(function(e,t,i){w.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),P.uniformMatrix4fv(e.modelViewMatrix,!1,w.elements),e.normalMatrix&&(M.getNormalMatrix(w),P.uniformMatrix3fv(e.normalMatrix,!1,M.elements));null!==e.modelMatrix&&P.uniformMatrix4fv(e.modelMatrix,!1,t.matrixWorld.elements);e.modelLocalMatrix&&P.uniformMatrix4fv(e.modelLocalMatrix,!1,t.matrix.elements)}(f,s,e),f.modelId){f.dbId&&(d=s.dbId||s.fragId||0,P.uniform3f(f.dbId,(255&d)/255,(d>>8&255)/255,(d>>16&255)/255));var E=s.modelId;P.uniform3f(f.modelId,(255&E)/255,(E>>8&255)/255,(d>>24&255)/255)}else null!==f.dbId&&(d=s.dbId||s.fragId||0,P.uniform3f(f.dbId,(255&d)/255,(d>>8&255)/255,(d>>16&255)/255));if(f.themingColor){var A=s.themingColor;A instanceof l.Vector4?P.uniform4f(f.themingColor,A.x,A.y,A.z,A.w):P.uniform4f(f.themingColor,0,0,0,0)}return p}function Nt(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function kt(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLightColor.needsUpdate=t,e.directionalLightDirection.needsUpdate=t,e.pointLightColor.needsUpdate=t,e.pointLightPosition.needsUpdate=t,e.pointLightDistance.needsUpdate=t,e.spotLightColor.needsUpdate=t,e.spotLightPosition.needsUpdate=t,e.spotLightDistance.needsUpdate=t,e.spotLightDirection.needsUpdate=t,e.spotLightAngleCos.needsUpdate=t,e.spotLightExponent.needsUpdate=t,e.hemisphereLightSkyColor.needsUpdate=t,e.hemisphereLightGroundColor.needsUpdate=t,e.hemisphereLightDirection.needsUpdate=t}function Ft(){var e=X;return e>=me&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+me),X+=1,e}function Vt(e,t,i,n){e[t]=i.r*n,e[t+1]=i.g*n,e[t+2]=i.b*n}function Ut(e){var t,i,n,r,o,s,a,c,h=0,u=0,d=0,p=oe,f=p.directional.colors,m=p.directional.positions,g=p.point.colors,v=p.point.positions,y=p.point.distances,b=p.spot.colors,x=p.spot.positions,_=p.spot.distances,E=p.spot.directions,A=p.spot.anglesCos,S=p.spot.exponents,w=p.hemi.skyColors,M=p.hemi.groundColors,T=p.hemi.positions,C=0,P=0,D=0,L=0,I=0,R=0,O=0,N=0,k=0,F=0,V=0,U=0;for(t=0,i=e.length;t<i;t++)if(!(n=e[t]).onlyShadow)if(r=n.color,a=n.intensity,c=n.distance,n instanceof l.AmbientLight){if(!n.visible)continue;h+=r.r,u+=r.g,d+=r.b}else if(n instanceof l.DirectionalLight){if(I+=1,!n.visible)continue;ne.setFromMatrixPosition(n.matrixWorld),ie.setFromMatrixPosition(n.target.matrixWorld),ne.sub(ie),ne.normalize(),m[k=3*C]=ne.x,m[k+1]=ne.y,m[k+2]=ne.z,Vt(f,k,r,a),C+=1}else if(n instanceof l.PointLight){if(R+=1,!n.visible)continue;Vt(g,F=3*P,r,a),ie.setFromMatrixPosition(n.matrixWorld),v[F]=ie.x,v[F+1]=ie.y,v[F+2]=ie.z,y[P]=c,P+=1}else if(n instanceof l.SpotLight){if(O+=1,!n.visible)continue;Vt(b,V=3*D,r,a),ie.setFromMatrixPosition(n.matrixWorld),x[V]=ie.x,x[V+1]=ie.y,x[V+2]=ie.z,_[D]=c,ne.copy(ie),ie.setFromMatrixPosition(n.target.matrixWorld),ne.sub(ie),ne.normalize(),E[V]=ne.x,E[V+1]=ne.y,E[V+2]=ne.z,A[D]=Math.cos(n.angle),S[D]=n.exponent,D+=1}else if(n instanceof l.HemisphereLight){if(N+=1,!n.visible)continue;ne.setFromMatrixPosition(n.matrixWorld),ne.normalize(),T[U=3*L]=ne.x,T[U+1]=ne.y,T[U+2]=ne.z,o=n.color,s=n.groundColor,Vt(w,U,o,a),Vt(M,U,s,a),L+=1}for(t=3*C,i=Math.max(f.length,3*I);t<i;t++)f[t]=0;for(t=3*P,i=Math.max(g.length,3*R);t<i;t++)g[t]=0;for(t=3*D,i=Math.max(b.length,3*O);t<i;t++)b[t]=0;for(t=3*L,i=Math.max(w.length,3*N);t<i;t++)w[t]=0;for(t=3*L,i=Math.max(M.length,3*N);t<i;t++)M[t]=0;p.directional.length=C,p.point.length=P,p.spot.length=D,p.hemi.length=L,p.ambient[0]=h,p.ambient[1]=u,p.ambient[2]=d}function Bt(e,t,i){var n;i?(P.texParameteri(e,P.TEXTURE_WRAP_S,Kt(t.wrapS)),P.texParameteri(e,P.TEXTURE_WRAP_T,Kt(t.wrapT)),P.texParameteri(e,P.TEXTURE_MAG_FILTER,Kt(t.magFilter)),P.texParameteri(e,P.TEXTURE_MIN_FILTER,Kt(t.minFilter))):(P.texParameteri(e,P.TEXTURE_WRAP_S,P.CLAMP_TO_EDGE),P.texParameteri(e,P.TEXTURE_WRAP_T,P.CLAMP_TO_EDGE),t.wrapS===l.ClampToEdgeWrapping&&t.wrapT===l.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+t.sourceFile+" )"),P.texParameteri(e,P.TEXTURE_MAG_FILTER,qt(t.magFilter)),P.texParameteri(e,P.TEXTURE_MIN_FILTER,qt(t.minFilter)),t.minFilter!==l.NearestFilter&&t.minFilter!==l.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+t.sourceFile+" )")),(n=ae.get("EXT_texture_filter_anisotropic"))&&t.type!==l.FloatType&&t.type!==l.HalfFloatType&&(t.anisotropy>1||t.__oldAnisotropy)&&(P.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,O.getMaxAnisotropy())),t.__oldAnisotropy=t.anisotropy)}function zt(e,t){if(e.width<=t&&e.height<=t)return e;if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var i=t/Math.max(e.width,e.height),n=Math.max(Math.floor(e.width*i),1),r=Math.max(Math.floor(e.height*i),1),o=f.createElement("canvas");return o.width=n,o.height=r,o.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,n,r),o}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}function Gt(e,t){if(6===e.image.length)if(tt(e)){e.__webglTextureCube||(e.addEventListener("dispose",Fe),e.__webglTextureCube=P.createTexture(),O.info.memory.textures++),P.activeTexture(P.TEXTURE0+t),P.bindTexture(P.TEXTURE_CUBE_MAP,e.__webglTextureCube),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,e.flipY);var i,n=e instanceof l.CompressedTexture,r=e.image[0]instanceof l.DataTexture,o=[];for(i=0;i<6;i++)!O.autoScaleCubemaps||n||r?o[i]=r?e.image[i].image:e.image[i]:o[i]=zt(e.image[i],ye);var s=o[0],a=l.Math.isPowerOfTwo(s.width)&&l.Math.isPowerOfTwo(s.height),c=Kt(e.format),h=Kt(e.type);for(Bt(P.TEXTURE_CUBE_MAP,e,a),i=0;i<6;i++)if(n)for(var u,d=o[i].mipmaps,p=0,f=d.length;p<f;p++)u=d[p],e.format!==l.RGBAFormat&&e.format!==l.RGBFormat?Pe().indexOf(c)>-1?P.compressedTexImage2D(P.TEXTURE_CUBE_MAP_POSITIVE_X+i,p,c,u.width,u.height,0,u.data):console.warn("Attempt to load unsupported compressed texture format"):P.texImage2D(P.TEXTURE_CUBE_MAP_POSITIVE_X+i,p,c,u.width,u.height,0,c,h,u.data);else r?P.texImage2D(P.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,c,o[i].width,o[i].height,0,c,h,o[i].data):P.texImage2D(P.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,c,c,h,o[i]);e.generateMipmaps&&a&&P.generateMipmap(P.TEXTURE_CUBE_MAP),it(e),e.onUpdate&&e.onUpdate()}else P.activeTexture(P.TEXTURE0+t),P.bindTexture(P.TEXTURE_CUBE_MAP,e.__webglTextureCube)}function Ht(e,t){P.activeTexture(P.TEXTURE0+t),P.bindTexture(P.TEXTURE_CUBE_MAP,e.__webglTexture)}function Wt(e){var t=D?P.COLOR_ATTACHMENT0:L.COLOR_ATTACHMENT0_WEBGL,i=[t];for(we=1;we<e.length;we++)i.push(t+we);D?P.drawBuffers(i):L.drawBuffersWEBGL(i)}function jt(e){var t=l.Math.isPowerOfTwo(e.width)&&l.Math.isPowerOfTwo(e.height),i=Kt(e.texture.format),n=Kt(e.texture.type),r=Yt(e.texture.format,e.texture.type);e.addEventListener("dispose",Ve),e.__webglTexture=P.createTexture(),O.info.memory.textures++,P.bindTexture(P.TEXTURE_2D,e.__webglTexture),Bt(P.TEXTURE_2D,e.texture,t),P.texImage2D(P.TEXTURE_2D,0,r,e.width,e.height,0,i,n,null),t&&e.texture.generateMipmaps&&P.generateMipmap(P.TEXTURE_2D)}function Xt(e){P.bindTexture(P.TEXTURE_2D,e.__webglTexture),P.generateMipmap(P.TEXTURE_2D),P.bindTexture(P.TEXTURE_2D,null)}function qt(e){return e===l.NearestFilter||e===l.NearestMipMapNearestFilter||e===l.NearestMipMapLinearFilter?P.NEAREST:P.LINEAR}function Yt(e,t){if(D){if(e===l.RGBFormat)switch(t){case l.UnsignedByteType:return P.RGB8;case l.FloatType:return P.RGB32F;case l.HalfFloatType:return P.RGB16F}else if(e===l.RGBAFormat)switch(t){case l.UnsignedByteType:return P.RGBA8;case l.FloatType:return P.RGBA32F;case l.HalfFloatType:return P.RGBA16F}else if(e===l.LuminanceFormat&&t===l.UnsignedByteType)return P.LUMINANCE;console.error("failed to map texture format and type to internalformat")}return Kt(e)}function Kt(e){var t;if(e===l.RepeatWrapping)return P.REPEAT;if(e===l.ClampToEdgeWrapping)return P.CLAMP_TO_EDGE;if(e===l.MirroredRepeatWrapping)return P.MIRRORED_REPEAT;if(e===l.NearestFilter)return P.NEAREST;if(e===l.NearestMipMapNearestFilter)return P.NEAREST_MIPMAP_NEAREST;if(e===l.NearestMipMapLinearFilter)return P.NEAREST_MIPMAP_LINEAR;if(e===l.LinearFilter)return P.LINEAR;if(e===l.LinearMipMapNearestFilter)return P.LINEAR_MIPMAP_NEAREST;if(e===l.LinearMipMapLinearFilter)return P.LINEAR_MIPMAP_LINEAR;if(e===l.UnsignedByteType)return P.UNSIGNED_BYTE;if(e===l.UnsignedShort4444Type)return P.UNSIGNED_SHORT_4_4_4_4;if(e===l.UnsignedShort5551Type)return P.UNSIGNED_SHORT_5_5_5_1;if(e===l.UnsignedShort565Type)return P.UNSIGNED_SHORT_5_6_5;if(e===l.ByteType)return P.BYTE;if(e===l.ShortType)return P.SHORT;if(e===l.UnsignedShortType)return P.UNSIGNED_SHORT;if(e===l.IntType)return P.INT;if(e===l.UnsignedIntType)return P.UNSIGNED_INT;if(e===l.FloatType)return P.FLOAT;if(e===l.HalfFloatType)return D?P.HALF_FLOAT:36193;if(e===l.AlphaFormat)return P.ALPHA;if(e===l.RGBFormat)return P.RGB;if(e===l.RGBAFormat)return P.RGBA;if(e===l.LuminanceFormat)return P.LUMINANCE;if(e===l.LuminanceAlphaFormat)return P.LUMINANCE_ALPHA;if(e===l.AddEquation)return P.FUNC_ADD;if(e===l.MinEquation)return P.MIN;if(e===l.MaxEquation)return P.MAX;if(e===l.SubtractEquation)return P.FUNC_SUBTRACT;if(e===l.ReverseSubtractEquation)return P.FUNC_REVERSE_SUBTRACT;if(e===l.ZeroFactor)return P.ZERO;if(e===l.OneFactor)return P.ONE;if(e===l.SrcColorFactor)return P.SRC_COLOR;if(e===l.OneMinusSrcColorFactor)return P.ONE_MINUS_SRC_COLOR;if(e===l.SrcAlphaFactor)return P.SRC_ALPHA;if(e===l.OneMinusSrcAlphaFactor)return P.ONE_MINUS_SRC_ALPHA;if(e===l.DstAlphaFactor)return P.DST_ALPHA;if(e===l.OneMinusDstAlphaFactor)return P.ONE_MINUS_DST_ALPHA;if(e===l.DstColorFactor)return P.DST_COLOR;if(e===l.OneMinusDstColorFactor)return P.ONE_MINUS_DST_COLOR;if(e===l.SrcAlphaSaturateFactor)return P.SRC_ALPHA_SATURATE;if(null!==(t=ae.get("WEBGL_compressed_texture_s3tc"))){if(e===l.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===l.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===l.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===l.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(t=ae.get("WEBGL_compressed_texture_pvrtc"))){if(e===l.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===l.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===l.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===l.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(t=ae.get("EXT_blend_minmax"))){if(e===l.MinEquation)return t.MIN_EXT;if(e===l.MaxEquation)return t.MAX_EXT}return 0}this.setFaceCulling=function(e,t){e===l.CullFaceNone?P.disable(P.CULL_FACE):(t===l.FrontFaceDirectionCW?P.frontFace(P.CW):P.frontFace(P.CCW),e===l.CullFaceBack?P.cullFace(P.BACK):e===l.CullFaceFront?P.cullFace(P.FRONT):P.cullFace(P.FRONT_AND_BACK),P.enable(P.CULL_FACE))},this.setMaterialFaces=function(e){le.setDoubleSided(e.side===l.DoubleSide),le.setFlipSided(e.side===l.BackSide)},this.uploadTexture=function(e){void 0===e.__webglInit&&(e.__webglInit=!0,e.addEventListener("dispose",Fe),e.__webglTexture=P.createTexture(),O.info.memory.textures++),P.bindTexture(P.TEXTURE_2D,e.__webglTexture),P.pixelStorei(P.UNPACK_FLIP_Y_WEBGL,e.flipY),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),P.pixelStorei(P.UNPACK_ALIGNMENT,e.unpackAlignment),e.image=zt(e.image,ve);var t=e.image,i=l.Math.isPowerOfTwo(t.width)&&l.Math.isPowerOfTwo(t.height),n=Kt(e.format),r=Kt(e.type),o=Yt(e.format,e.type);Bt(P.TEXTURE_2D,e,i);var s,a,c,h=e.mipmaps;if(e instanceof l.DataTexture)if(h.length>0&&i){for(a=0,c=h.length;a<c;a++)s=h[a],P.texImage2D(P.TEXTURE_2D,a,o,s.width,s.height,0,n,r,s.data);e.generateMipmaps=!1}else P.texImage2D(P.TEXTURE_2D,0,o,t.width,t.height,0,n,r,t.data);else if(e instanceof l.CompressedTexture){for(a=0,c=h.length;a<c;a++)s=h[a],e.format!==l.RGBAFormat&&e.format!==l.RGBFormat?Pe().indexOf(n)>-1?P.compressedTexImage2D(P.TEXTURE_2D,a,o,s.width,s.height,0,s.data):console.warn("Attempt to load unsupported compressed texture format"):P.texImage2D(P.TEXTURE_2D,a,o,s.width,s.height,0,n,r,s.data);if(h.length>1&&Pe().indexOf(n)>-1)for(var u,d=s.width>>1,p=s.height>>1,f=h.length;d>=1||p>=1;)u=4==s.width&&4==s.height?s.data:new DataView(s.data.buffer,s.data.byteOffset,s.data.byteLength*(Math.max(d,4)*Math.max(p,4))/(s.width*s.height)),P.compressedTexImage2D(P.TEXTURE_2D,f,o,Math.max(d,1),Math.max(p,1),0,u),d>>=1,p>>=1,++f}else if(h.length>0&&i){for(a=0,c=h.length;a<c;a++)P.texImage2D(P.TEXTURE_2D,a,o,n,r,h[a]);e.generateMipmaps=!1}else P.texImage2D(P.TEXTURE_2D,0,o,n,r,e.image);e.generateMipmaps&&i&&P.generateMipmap(P.TEXTURE_2D),it(e),e.onUpdate&&e.onUpdate()},this.setTexture=function(e,t){P.activeTexture(P.TEXTURE0+t),tt(e)?O.uploadTexture(e):e.__webglTexture?P.bindTexture(P.TEXTURE_2D,e.__webglTexture):P.bindTexture(P.TEXTURE_2D,fe.__webglTexture)},O.uploadTexture(fe),this.initFrameBufferMRT=function(e,t){var i=e[0],n=!1;if(i&&!i.__webglFramebuffer){var r;if(void 0===i.depthBuffer&&(i.depthBuffer=!0),void 0===i.stencilBuffer&&(i.stencilBuffer=!0),i.__webglFramebuffer=P.createFramebuffer(),P.bindFramebuffer(P.FRAMEBUFFER,i.__webglFramebuffer),i.shareDepthFrom)r=i.__webglRenderbuffer=i.shareDepthFrom.__webglRenderbuffer,i.__isUsingShared=!0;else if(r=i.__webglRenderbuffer,i.__isUsingShared=!1,i.depthBuffer){let e;r||(r=i.__webglRenderbuffer=P.createRenderbuffer(),i.__webglRenderbufferOwn=r),P.bindRenderbuffer(P.RENDERBUFFER,r),e=i.stencilBuffer?D?P.DEPTH24_STENCIL8:P.DEPTH_STENCIL:D?P.DEPTH_COMPONENT32F:P.DEPTH_COMPONENT16,P.renderbufferStorage(P.RENDERBUFFER,e,i.width,i.height)}if(i.depthBuffer){const e=i.stencilBuffer?P.DEPTH_STENCIL_ATTACHMENT:P.DEPTH_ATTACHMENT;P.framebufferRenderbuffer(P.FRAMEBUFFER,e,P.RENDERBUFFER,r)}n=!0}else if(i)if(i.shareDepthFrom&&0==i.__isUsingShared){if(r=i.shareDepthFrom.__webglRenderbuffer,i.__isUsingShared=!0,i.depthBuffer){const e=i.stencilBuffer?P.DEPTH_STENCIL_ATTACHMENT:P.DEPTH_ATTACHMENT;P.framebufferRenderbuffer(P.FRAMEBUFFER,e,P.RENDERBUFFER,r)}}else if(null==i.shareDepthFrom&&1==i.__isUsingShared){if(r=i.__webglRenderbufferOwn,i.__isUsingShared=!1,null==r&&i.depthBuffer){let e;r=i.__webglRenderbuffer=P.createRenderbuffer(),i.__webglRenderbufferOwn=r,P.bindRenderbuffer(P.RENDERBUFFER,r),e=i.stencilBuffer?D?P.DEPTH24_STENCIL8:P.DEPTH_STENCIL:D?P.DEPTH_COMPONENT32F:P.DEPTH_COMPONENT16,P.renderbufferStorage(P.RENDERBUFFER,e,i.width,i.height)}if(i.depthBuffer){const e=i.stencilBuffer?P.DEPTH_STENCIL_ATTACHMENT:P.DEPTH_ATTACHMENT;P.framebufferRenderbuffer(P.FRAMEBUFFER,e,P.RENDERBUFFER,r)}}var o=F;if(P.bindFramebuffer(P.FRAMEBUFFER,i.__webglFramebuffer),function(e,t){let i=e.__webglBoundBuffers;if(!i)return!0;if(i.length!==t.length)return!0;for(let e=0;e<t.length;e++)if(t[e]!==i[e])return!0;return!1}(i,e)){var s;for(s=0;s<e.length;s++){var a=e[s];a&&!a.__webglTexture&&jt(a),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0+s,P.TEXTURE_2D,a&&a.__webglTexture,0)}s=e.length;for(var l=i.__webglBoundBuffers&&i.__webglBoundBuffers.length||s;s<l;)P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0+s,P.TEXTURE_2D,null,0),s++;i.__webglBoundBuffers=e.slice()}if(this.supportsMRT()&&Wt(e),t){var c=P.checkFramebufferStatus(P.FRAMEBUFFER);c!==P.FRAMEBUFFER_COMPLETE&&(console.log("Can't use multiple render targets. Falling back to two passes. "+c),o===i.__webglFramebuffer&&(o=F=null),P.bindFramebuffer(P.FRAMEBUFFER,o),P.deleteFramebuffer(i.__webglFramebuffer),delete i.__webglFramebuffer,t=!1)}return P.bindFramebuffer(P.FRAMEBUFFER,o),n&&(P.bindTexture(P.TEXTURE_2D,null),P.bindRenderbuffer(P.RENDERBUFFER,null),P.bindFramebuffer(P.FRAMEBUFFER,null)),t},this.getRenderTarget=function(){return V},this.setRenderTarget=function(e){var t,i,n,r,o,s;if(Array.isArray(e)&&e.length>0?(V=e[0],U=!0):(V=e,U=!1),O.lostContextRecovery&&O.lostContextRecovery.refreshTargetsIfNeeded(e),Array.isArray(e))this.initFrameBufferMRT(e),(t=e[0]).initForMRT=!0;else if(e){var a=e.__webglFramebuffer;a&&F===a&&!e.initForMRT&&null!=e.shareDepthFrom==!!e.__isUsingShared||this.initFrameBufferMRT([e]),(t=e).initForMRT=!1}!t||Ie?(n=K,r=Z,o=q,s=Y):(n=t.width,r=t.height,o=0,s=0),(i=t?t.__webglFramebuffer:null)!==F&&(P.bindFramebuffer(P.FRAMEBUFFER,i),F=i),P.viewport(o,s,n,r)},this.readRenderTargetPixels=function(e,t,i,n,r,o){if(e instanceof l.WebGLRenderTarget){if(O.lostContextRecovery&&O.lostContextRecovery.refreshTargetsIfNeeded(e),e.__webglFramebuffer){if(e.texture.format!==l.RGBAFormat&&e.texture.format!==l.RGBFormat||e.texture.type!==l.UnsignedByteType)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not a readable format.");var s=!1;e.__webglFramebuffer!==F&&(P.bindFramebuffer(P.FRAMEBUFFER,e.__webglFramebuffer),s=!0),e.canReadPixels||P.checkFramebufferStatus(P.FRAMEBUFFER)===P.FRAMEBUFFER_COMPLETE?P.readPixels(t,i,n,r,P.RGBA,P.UNSIGNED_BYTE,o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),s&&P.bindFramebuffer(P.FRAMEBUFFER,F)}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")}}},85660:(e,t,i)=>{"use strict";i.r(t),i.d(t,{WebGLShader:()=>n});function n(e,t,i){var n=e.createShader(t);return e.shaderSource(n,i),e.compileShader(n),"undefined"!=typeof DEBUG_SHADERS&&DEBUG_SHADERS&&(!1===e.getShaderParameter(n,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e.getShaderInfoLog(n),function(e){for(var t=e.split("\n"),i=0;i<t.length;i++)t[i]=i+1+": "+t[i];return t.join("\n")}(i))),n}},5120:(e,t,i)=>{"use strict";function n(e,t){var i,n;this.bytes_per_node=t?32:36,e instanceof ArrayBuffer?(i=e.byteLength/this.bytes_per_node,n=e,this.nodeCount=i):(i=0|e,n=new ArrayBuffer(this.bytes_per_node*i),this.nodeCount=0),this.nodeCapacity=i,this.nodesRaw=n,this.is_lean_node=t,this.node_stride=this.bytes_per_node/4,this.node_stride_short=this.bytes_per_node/2,this.nodesF=new Float32Array(this.nodesRaw),this.nodesI=new Int32Array(this.nodesRaw),this.nodesS=new Uint16Array(this.nodesRaw)}i.r(t),i.d(t,{BVHBuilder:()=>s,NodeArray:()=>n}),n.prototype.setLeftChild=function(e,t){this.nodesI[e*this.node_stride+6]=t},n.prototype.getLeftChild=function(e){return this.nodesI[e*this.node_stride+6]},n.prototype.setPrimStart=function(e,t){this.is_lean_node?this.nodesI[e*this.node_stride+6]=t:this.nodesI[e*this.node_stride+8]=t},n.prototype.getPrimStart=function(e){return this.is_lean_node?this.nodesI[e*this.node_stride+6]:this.nodesI[e*this.node_stride+8]},n.prototype.setPrimCount=function(e,t){this.nodesS[e*this.node_stride_short+14]=t},n.prototype.getPrimCount=function(e){return this.nodesS[e*this.node_stride_short+14]},n.prototype.setFlags=function(e,t,i,n){this.nodesS[e*this.node_stride_short+15]=n<<3|i<<2|3&t},n.prototype.getFlags=function(e){return this.nodesS[e*this.node_stride_short+15]},n.prototype.setBox0=function(e,t){var i=e*this.node_stride,n=this.nodesF;n[i]=t[0],n[i+1]=t[1],n[i+2]=t[2],n[i+3]=t[3],n[i+4]=t[4],n[i+5]=t[5]},n.prototype.getBoxThree=function(e,t){var i=e*this.node_stride,n=this.nodesF;t.min.x=n[i],t.min.y=n[i+1],t.min.z=n[i+2],t.max.x=n[i+3],t.max.y=n[i+4],t.max.z=n[i+5]},n.prototype.getBoxArray=function(e,t,i){var n=e*this.node_stride,r=this.nodesF;t[0+(i=i||0)]=r[n],t[1+i]=r[n+1],t[2+i]=r[n+2],t[3+i]=r[n+3],t[4+i]=r[n+4],t[5+i]=r[n+5]},n.prototype.setBoxThree=function(e,t){var i=e*this.node_stride,n=this.nodesF;n[i]=t.min.x,n[i+1]=t.min.y,n[i+2]=t.min.z,n[i+3]=t.max.x,n[i+4]=t.max.y,n[i+5]=t.max.z},n.prototype.makeEmpty=function(e){var t=e*this.node_stride,i=this.nodesI;i[t+6]=-1,i[t+7]=0,this.is_lean_node||(i[t+8]=-1)},n.prototype.realloc=function(e){if(this.nodeCount+e>this.nodeCapacity){var t=0|3*this.nodeCapacity/2;t<this.nodeCount+e&&(t=this.nodeCount+e);var i=new ArrayBuffer(t*this.bytes_per_node),n=new Int32Array(i);n.set(this.nodesI),this.nodeCapacity=t,this.nodesRaw=i,this.nodesF=new Float32Array(i),this.nodesI=n,this.nodesS=new Uint16Array(i)}},n.prototype.nextNodes=function(e){this.realloc(e);var t=this.nodeCount;this.nodeCount+=e;for(var i=0;i<e;i++)this.makeEmpty(t+i);return t},n.prototype.getRawData=function(){return this.nodesRaw.slice(0,this.nodeCount*this.bytes_per_node)};var r=function(){function e(e,t,i){e[0]>t[i]&&(e[0]=t[i]),e[3]<t[i]&&(e[3]=t[i]),e[1]>t[i+1]&&(e[1]=t[i+1]),e[4]<t[i+1]&&(e[4]=t[i+1]),e[2]>t[i+2]&&(e[2]=t[i+2]),e[5]<t[i+2]&&(e[5]=t[i+2])}function t(e,t,i){e[0]>t[i]&&(e[0]=t[i]),e[1]>t[i+1]&&(e[1]=t[i+1]),e[2]>t[i+2]&&(e[2]=t[i+2]),e[3]<t[i+3]&&(e[3]=t[i+3]),e[4]<t[i+4]&&(e[4]=t[i+4]),e[5]<t[i+5]&&(e[5]=t[i+5])}function i(e,t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]>t[2]&&(e[2]=t[2]),e[3]<t[3]&&(e[3]=t[3]),e[4]<t[4]&&(e[4]=t[4]),e[5]<t[5]&&(e[5]=t[5])}function n(e,t,i,n){for(var r=0;r<3;r++)e[t+r]=i[n+3+r]-i[n+r]}function r(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5]}var o=1/0;function s(e){e[0]=o,e[1]=o,e[2]=o,e[3]=-1/0,e[4]=-1/0,e[5]=-1/0}function a(e){var t=e[3]-e[0],i=e[4]-e[1],n=e[5]-e[2];return t<0||i<0||n<0?0:2*(t*i+i*n+n*t)}function l(){this.vb_left=new Float32Array(6),this.vb_right=new Float32Array(6),this.cb_left=new Float32Array(6),this.cb_right=new Float32Array(6),this.num_left=0,this.best_split=-1,this.best_cost=-1,this.num_bins=-1}function c(){this.box_bbox=new Float32Array(6),this.box_centroid=new Float32Array(6),this.num_prims=0}function h(){this.BL=new Float32Array(6),this.CL=new Float32Array(6),this.NL=0,this.AL=0}l.prototype.reset=function(){this.num_left=0,this.best_split=-1,this.best_cost=-1,this.num_bins=-1},c.prototype.reset=function(){this.num_prims=0,s(this.box_bbox),s(this.box_centroid)},h.prototype.reset=function(){this.NL=0,this.AL=0,s(this.BL),s(this.CL)};var u,d=[];for(u=0;u<16;u++)d.push(new c);var p=[];for(u=0;u<15;u++)p.push(new h);var f=new Float32Array(6),m=new Float32Array(6);function g(n,o,s,l,c,h,u){if(h[l]<n.scene_epsilon)u.best_cost=1/0;else{var g,v,y=16;for(y>s-o+1&&(y=s-o+1),g=0;g<y;g++)d[g].reset();for(g=0;g<y-1;g++)p[g].reset();for(u.num_bins=y,function(i,n,r,o,s,a,l){for(var c=i.centroids,h=i.primitives,u=i.finfo.boxes,p=i.finfo.boxStride,f=.99999*l/a[o],m=s[o],g=i.sort_prims,v=n;v<=r;v++){var y=0|h[v],b=0|f*(c[3*y+o]-m);b<0?b=0:b>=l&&(b=l-1),g[v]=b,d[b].num_prims++,t(d[b].box_bbox,u,y*p),e(d[b].box_centroid,c,3*y)}}(n,o,s,l,c,h,y),r(p[0].BL,d[0].box_bbox),r(p[0].CL,d[0].box_centroid),p[0].AL=a(p[0].BL),p[0].NL=d[0].num_prims,g=1;g<y-1;g++){v=d[g];var b=p[g];r(b.BL,p[g-1].BL),i(b.BL,v.box_bbox),b.AL=a(b.BL),r(b.CL,p[g-1].CL),i(b.CL,v.box_centroid),b.NL=p[g-1].NL+v.num_prims}r(f,d[g=y-1].box_bbox),r(m,d[g].box_centroid);var x=a(f),_=d[g].num_prims,E=g,A=x*_+p[g-1].AL*p[g-1].NL;for(r(u.vb_right,f),r(u.cb_right,d[g].box_centroid),r(u.vb_left,p[g-1].BL),r(u.cb_left,p[g-1].CL),u.num_left=p[g-1].NL,g-=1;g>=1;g--){v=d[g],i(f,v.box_bbox),i(m,v.box_centroid);var S=(x=a(f))*(_+=v.num_prims)+p[g-1].AL*p[g-1].NL;S<=A&&(A=S,E=g,r(u.vb_right,f),r(u.cb_right,m),r(u.vb_left,p[g-1].BL),r(u.cb_left,p[g-1].CL),u.num_left=p[g-1].NL)}u.best_split=E,u.best_cost=A}}var v=new Float32Array(3);return{bvh_subdivide:function(t,i,r,o,a,c,h,u){n(v,0,c,0);var d=t.nodes,p=h?t.frags_per_leaf_node_transparent:t.frags_per_leaf_node,f=h?t.frags_per_inner_node_transparent:t.frags_per_inner_node,m=t.max_polys_per_node,y=0;v[1]>v[0]&&(y=1),v[2]>v[y]&&(y=2),d.setBox0(i,a);var b=0,x=0,_=o-r+1;if(t.finfo.hasPolygonCounts&&t.frags_per_inner_node)for(var E=_<=t.frags_per_inner_node?o:r+t.frags_per_inner_node-1,A=r;A<=E&&(x++,!((b+=t.finfo.getPolygonCount(t.primitives[A]))>m));A++);if(_<=p&&b<m||1===_||u>15||v[y]<t.scene_epsilon)return d.setLeftChild(i,-1),d.setPrimStart(i,r),d.setPrimCount(i,o-r+1),void d.setFlags(i,0,0,h?1:0);f&&(y=function(t,i,r,o,a,l,c,h){var u=t.primitives,d=t.centroids,p=a-o+1;p>t.frags_per_inner_node&&(p=t.frags_per_inner_node),p>h&&(p=h),i.setPrimStart(r,o),i.setPrimCount(r,p),o+=p,s(l);for(var f=o;f<=a;f++)e(l,d,3*u[f]);n(c,0,l,0);var m=0;return c[1]>c[0]&&(m=1),c[2]>c[m]&&(m=2),m}(t,d,i,r,o,c,v,x),r+=d.getPrimCount(i));var S=new l;if(g(t,r,o,y,c,v,S),S.num_bins<0)d.setPrimCount(i,d.getPrimCount(i)+o-r+1);else{!function(e,t,i,n,r,o,s){var a,l,c=e.primitives,h=e.sort_prims,u=0,d=0|t,p=0|s.best_split;for(a=t;a<=i;a++){var f=0|c[a];h[a]<p?c[d++]=f:h[u++]=f}for(l=0;l<u;l++)c[d+l]=h[l]}(t,r,o,0,0,0,S);var w=d.nextNodes(2),M=.5*(S.vb_left[3+y]+S.vb_left[y]),T=.5*(S.vb_right[3+y]+S.vb_right[y]);d.setFlags(i,y,M<T?0:1,h?1:0),d.setLeftChild(i,w),t.recursion_stack.push([t,w+1,r+S.num_left,o,S.vb_right,S.cb_right,h,u+1]),t.recursion_stack.push([t,w,r,r+S.num_left-1,S.vb_left,S.cb_left,h,u+1])}},compute_boxes:function(i){var r=i.boxv_o,o=i.boxc_o,a=i.boxv_t,l=i.boxc_t;s(r),s(o),s(a),s(l);for(var c,h,u,d,p=i.centroids,f=i.finfo.boxes,m=i.finfo.boxStride,g=0,y=i.prim_count;g<y;g++){var b=i.primitives[g];u=f,d=m*b,(c=p)[h=3*b]=.5*(u[d]+u[d+3]),c[h+1]=.5*(u[d+1]+u[d+4]),c[h+2]=.5*(u[d+2]+u[d+5]),g>=i.first_transparent?(e(l,p,3*b),t(a,f,m*b)):(e(o,p,3*b),t(r,f,m*b))}n(v,0,i.boxv_o,0);var x=Math.max(v[0],v[1],v[2]);i.scene_epsilon=1e-5*x},box_area:function(e,t){var i=e[t+3]-e[t],n=e[t+4]-e[t+1],r=e[t+5]-e[t+2];return i<0||n<0||r<0?0:2*(i*n+n*r+r*i)}}}();function o(e,t){this.boxes=e.boxes,this.polygonCounts=e.polygonCounts,this.hasPolygonCounts=!!this.polygonCounts,this.materials=e.materials,this.materialDefs=t,this.count=e.length,this.boxStride=6,this.wantSort=!0}function s(e,t,i){this.finfo=i||new o(e,t),this.prim_count=this.finfo.getCount(),this.frags_per_leaf_node=-1,this.frags_per_inner_node=-1,this.nodes=null,this.work_buf=new ArrayBuffer(4*this.prim_count),this.sort_prims=new Int32Array(this.work_buf),this.primitives=new Int32Array(this.prim_count),this.centroids=new Float32Array(3*this.prim_count),this.boxv_o=new Float32Array(6),this.boxc_o=new Float32Array(6),this.boxv_t=new Float32Array(6),this.boxc_t=new Float32Array(6),this.recursion_stack=[]}o.prototype.getCount=function(){return this.count},o.prototype.isTransparent=function(e){return!(!this.materialDefs||!this.materialDefs[this.materials[e]])&&this.materialDefs[this.materials[e]].transparent},o.prototype.getPolygonCount=function(e){return this.polygonCounts[e]},s.prototype.sortPrimitives=function(e){var t,i,n=new Float32Array(this.work_buf),o=this.primitives,s=0,a=e;for(t=0,i=this.prim_count;t<i;t++){o[t]=t;var l=this.finfo.isTransparent(t);l&&s++,a?(n[t]=r.box_area(this.finfo.boxes,this.finfo.boxStride*t),l&&(n[t]=-n[t])):n[t]=l?-1:1}if(a)Array.prototype.sort.call(this.primitives,(function(e,t){return n[t]-n[e]}));else if(s&&s<this.prim_count){var c=new Int32Array(s),h=0,u=0;for(t=0,i=this.prim_count;t<i;t++)n[t]>=0?o[h++]=o[t]:c[u++]=o[t];o.set(c,this.prim_count-s)}this.first_transparent=this.prim_count-s},s.prototype.build=function(e){var t=e&&!!e.useSlimNodes,i=this;function o(t,n){e.hasOwnProperty(t)?i[t]=e[t]:i[t]=n}if(t)o("frags_per_leaf_node",1),o("frags_per_inner_node",0),o("frags_per_leaf_node_transparent",1),o("frags_per_inner_node_transparent",0),o("max_polys_per_node",1/0);else{var s=e.isWeakDevice?.5:1;o("frags_per_leaf_node",0|256*s),o("frags_per_inner_node",0|this.frags_per_leaf_node),o("frags_per_leaf_node_transparent",this.frags_per_leaf_node),o("frags_per_inner_node_transparent",0),o("max_polys_per_node",0|2e4*s)}if(this.nodes&&this.nodes.is_lean_node==t)this.nodes.nodeCount=0;else{for(var a=this.prim_count/this.frags_per_leaf_node,l=1;l<a;)l*=2;this.nodes=new n(l,!!e&&e.useSlimNodes)}this.sortPrimitives(this.finfo.wantSort),r.compute_boxes(this);var c,h=this.nodes.nextNodes(2);for(r.bvh_subdivide(this,h,0,this.first_transparent-1,this.boxv_o,this.boxc_o,!1,0);this.recursion_stack.length;)c=this.recursion_stack.pop(),r.bvh_subdivide(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7]);for(r.bvh_subdivide(this,h+1,this.first_transparent,this.prim_count-1,this.boxv_t,this.boxc_t,!0,0);this.recursion_stack.length;)c=this.recursion_stack.pop(),r.bvh_subdivide(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7])}},22769:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BufferGeometryUtils:()=>v,createBufferGeometry:()=>f,createInstancedBufferGeometry:()=>m,findBufferAttribute:()=>l,meshToGeometry:()=>g});var n=i(29996),r=i(16840),o=i(41434),s=i(49720),a={};function l(e,t,i,n){var r,l=t.normalize||t.normalized;if(!t.isInterleavedBufferAttribute&&t.array)r=new o.BufferAttribute(t.array,t.itemSize);else{var c=e+"|"+t.bytesPerItem+"|"+l+"|"+t.isPattern+"|"+t.divisor+"|"+t.offset;if(r=a[c])return r;r=new o.BufferAttribute(void 0,t.itemSize),a[c]=r}return r.normalized=l,r.bytesPerItem=t.bytesPerItem,r.isPattern=t.isPattern,i&&(r.divisor=t.divisor),!t.isInterleavedBufferAttribute&&t.array||(t.hasOwnProperty("offset")?r.offset=t.offset:s.logger.warn("VB attribute is neither interleaved nor separate. Something is wrong with the buffer specificaiton.")),r}var c,h,u={};var d=1,p=function(){this.id=d++,this.attributes={},this.__webglInit=void 0};function f(e){return c||((c=new o.BufferAttribute(void 0,1)).bytesPerItem=2,(h=new o.BufferAttribute(void 0,1)).bytesPerItem=4),new p}function m(){return f()}function g(e){var t=e.mesh,i=f(t.numInstances);for(var s in(0,r.isNodeJS)()&&(i.packId=e.packId,i.meshIndex=e.meshIndex),i.byteSize=0,i.vb=t.vb,i.vbbuffer=void 0,i.vbNeedsUpdate=!0,i.vbstride=t.vbstride,i.byteSize+=t.vb.byteLength,i.hash=e.hash,t.isLines&&(i.isLines=t.isLines),t.isWideLines&&(i.isWideLines=!0,i.lineWidth=t.lineWidth),t.isPoints&&(i.isPoints=t.isPoints,i.pointSize=t.pointSize),e.is2d&&(i.is2d=!0),i.numInstances=t.numInstances,t.vblayout){var a=t.vblayout[s];i.attributes[s]=l(s,a,t.numInstances)}if(n.memoryOptimizedLoading)i.index=t.indices instanceof Uint32Array?h:c,i.ib=t.indices,i.ibbuffer=void 0,t.iblines&&(i.attributes.indexlines=t.iblines instanceof Uint32Array?h:c,i.iblines=t.iblines,i.iblinesbuffer=void 0);else{var d=new o.BufferAttribute(t.indices,1);d.bytesPerItem=t.indices instanceof Uint32Array?4:2,i.setIndex(d)}i.attributesKeys=function(e){var t="";for(var i in e.attributes)t+=i+"|";var n=u[t];return n||(n=Object.keys(e.attributes),u[t]=n,n)}(i),i.byteSize+=t.indices.byteLength,i.boundingBox=(new o.Box3).copy(t.boundingBox),i.boundingSphere=(new o.Sphere).copy(t.boundingSphere),e.geometry=i,e.mesh=null}(p.prototype=Object.create(o.BufferGeometry.prototype)).clone=function(){const e=new p;e.ib=this.ib,e.vb=this.vb,e.vbstride=this.vbstride,e.byteSize=this.byteSize,e.isLines=this.isLines,e.isWideLines=this.isWideLines,e.lineWidth=this.lineWidth,e.isPoints=this.isPoints,e.pointSize=this.pointSize,e.index=this.index;for(const t in this.attributes){const i=this.attributes[t],n=i.array?new i.array.constructor(this.array):void 0,r=new o.BufferAttribute(n,i.itemSize);r.itemOffset=i.itemOffset,r.bytesPerItem=i.bytesPerItem,r.normalized=i.normalized,e.setAttribute(t,r)}if(this.offsets)for(var t=0,i=this.offsets.length;t<i;t++){var n=this.offsets[t];e.offsets.push({start:n.start,index:n.index,count:n.count})}return e},p.prototype.constructor=p;let v={meshToGeometry:g,createBufferGeometry:f,findBufferAttribute:l}},62206:(e,t,i)=>{"use strict";function n(e){let t;return t=!!e.vb,t}function r(e){let t;return t=e.ib,t}function o(e){let t;return t=e.iblines,t}function s(e){var t;if(!e)return 0;let i=0;return i=((null===(t=e.attributes.index)||void 0===t?void 0:t.array)||e.ib).length,i/3||0}i.r(t),i.d(t,{getIndexBufferArray:()=>r,getLineIndexBufferArray:()=>o,getPolygonCount:()=>s,isInterleavedGeometry:()=>n})},54604:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MeshAccessor:()=>f,createWireframe:()=>m});var n=i(5394),r=i(27957),o=i(39651);const s=1e-6;const a={x:0,y:0,z:0};class l{constructor(e,t,i){this.getVertex=e,this.bbox=t,this.boxSize=this.bbox.getSize().length(),i||(i=s),i>0?(this.precisionTolerance=i,this.scale=1/this.precisionTolerance):(this.precisionTolerance=-i*this.boxSize,this.scale=1/this.precisionTolerance),this.snapBaseX=this.bbox.min.x,this.snapBaseY=this.bbox.min.y,this.snapBaseZ=this.bbox.min.z,this.xymap={}}findOrAddPoint(e,t,i,n){let r,o=0|(e-this.snapBaseX)*this.scale,s=0|(t-this.snapBaseY)*this.scale,l=0|(i-this.snapBaseZ)*this.scale,c=1/0;for(let n=o-1;n<=o+1;n++){let o=this.xymap[n];if(o)for(let n=s-1;n<=s+1;n++){let s=o[n];if(s)for(let n=l-1;n<=l+1;n++){let o=s[n];if(void 0===o)continue;this.getVertex(o,a);let l=a,h=(l.x-e)*(l.x-e)+(l.y-t)*(l.y-t)+(l.z-i)*(l.z-i);h<c&&(r=o,c=h)}}}if(Math.sqrt(c)>this.precisionTolerance&&(r=void 0),void 0===r){let e=this.xymap[o];e||(e=this.xymap[o]={});let t=e[s];return t||(t=e[s]={}),t[l]=n,n}return r}}let c=new r.LmvVector3,h=new r.LmvVector3,u=new r.LmvVector3,d=new r.LmvVector3,p=new r.LmvVector3;class f{constructor(e,t,i){let s=e.boundingBox||i,a=new o.LmvBox3;s&&a.copy(s),this.geom=e,this.myVerts=function(e,t){var i=new Float32Array(3*(0,n.getVertexCount)(e));return(0,n.enumMeshVertices)(e,(function(e,n,r,o){t&&t.expandByPoint(e),i[3*o]=e.x,i[3*o+1]=e.y,i[3*o+2]=e.z})),i}(e,s?null:a);let c=new l(this.getV.bind(this),a,-1/65536);this.remap=new Array((0,n.getVertexCount)(e));for(let e=0,t=0;e<this.myVerts.length;e+=3,t++)this.remap[t]=c.findOrAddPoint(this.myVerts[e],this.myVerts[e+1],this.myVerts[e+2],t);t&&function(e,t){let i=new r.LmvVector3;for(let n=0;n<e.length;n+=3)i.x=e[n],i.y=e[n+1],i.z=e[n+2],i.applyMatrix4(t),e[n]=i.x,e[n+1]=i.y,e[n+2]=i.z}(this.myVerts,t)}getV(e,t){t.x=this.myVerts[3*e],t.y=this.myVerts[3*e+1],t.z=this.myVerts[3*e+2]}getNormal(e,t,i,n){this.getV(e,c),this.getV(t,h),this.getV(i,u),h.sub(c),u.sub(c),h.cross(u),n.copy(h).normalize()}}function m(e,t,i,r){if("isLines"in e&&e.isLines||"indexlines"in e||"iblines"in e)return;let o=new f(e,t,i);var s={},a=[];function l(e,t,i){var n=o.remap[e],l=o.remap[t],c=o.remap[i];if(n!==l&&n!==c&&l!==c){var h=!1;if(n>l){var u=n;n=l,l=u,h=!0}var f=s[n];if(f){var m=f[l];if(void 0===m)f[l]=h?-i-1:i;else{if(r)a.push(e),a.push(t);else{o.getNormal(e,t,i,d),m<0?o.getNormal(l,n,o.remap[-m-1],p):o.getNormal(n,l,o.remap[m],p);var g=d.dot(p);Math.abs(g)<.25&&(a.push(e),a.push(t))}delete f[l]}}else s[n]={},s[n][l]=i}}for(var c in(0,n.enumMeshTriangles)(e,(function(e,t,i,n,r,o){l(n,r,o),l(r,o,n),l(o,n,r)})),s)for(var h in s[c])a.push(parseInt(c)),a.push(parseInt(h));a.length<2||(e.iblines=new Uint16Array(a.length),e.iblines.set(a))}},14021:(e,t,i)=>{"use strict";function n(){let e,t,i,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=0;const s=[],a=[];let l,c,h,u;const d=r.timeSlice||15,p=r.sliceDelay||0,f=r.delay??-1;function m(e){o&&clearTimeout(o),o=0,i=e,s.length=0,a.length=0,l=null,c=-1,h=0,u=0}function g(){o=0;const r=performance.now()+d;for(;performance.now()<r;){var l;if(!x())return m(null),void(null===(l=t)||void 0===l||l());e(a[u],s[h],n,u+1>=a.length,!i||c>=i.length)}o=setTimeout((()=>g()),p)}function v(){if(i&&c<i.length)for(;++c<i.length;){if(l=i[c].getInstanceTree(),s.length=0,l)l.enumNodeChildren(i[c].getRootId(),(function(e){s.push(e)}),!0);else{var e;const t=i[c].getFragmentList();null!=t&&null!==(e=t.fragments)&&void 0!==e&&e.dbId2fragId&&s.push(...Object.keys(t.fragments.dbId2fragId).map((e=>parseInt(e))))}if(s.length>0)return n=i[c],n}return n=null,!1}function y(e){if(l)return!l.isNodeHidden(e)&&!l.isNodeOff(e);return!i[c].getFragmentList().dbIdIsGhosted[e]}function b(){if(h>=s.length)return!1;for(;++h<s.length;){const e=s[h];if(r.includeHidden||y(e)){if(a.length=0,l)l.enumNodeFragments(e,(function(e){a.push(e)}),!1);else{const t=i[c].getFragmentList();if(t){let i=t.fragments.dbId2fragId[e];Array.isArray(i)||(i=[i]),a.push(...i)}}if(a.length>0)return!0}}return!1}function x(){if(++u<a.length)return!0;for(u=0;;){if(b())return!0;if(!v())return!1;h=-1}}this.start=function(i,n,r){Array.isArray(i)||(i=[i]),m(i),e=n,t=r,n&&(f>=0?o=setTimeout((()=>g()),f):g())},this.stop=function(){m(null)}}i.r(t),i.d(t,{FragmentIterator:()=>n})},55339:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FragmentList:()=>y,FragmentPointer:()=>C});var n=i(29996),r=i(41434),o=i(41723),s=i(49720),a=i(57639),l=i(23850),c=new Uint32Array(1);function h(e){var t,i;this.geometry=e,this.vb=e.vb.buffer,this.stride=e.vbstride,this.vbi=new Int32Array(this.vb),this.vbs=new Uint16Array(this.vb),this.vcount=this.vbi.length/this.stride,this.useCompactBuffers=e.unpackXform,this.texData=this.useCompactBuffers&&(null===(t=e.tIdColor)||void 0===t||null===(i=t.image)||void 0===i?void 0:i.data)&&new Uint32Array(e.tIdColor.image.data.buffer),this.texColMap=(()=>{if(!this.texData)return null;const e={},t=new Set;for(let i=0;i<this.vcount;++i){const n=this.vbs[i*this.stride*2+6];t.has(n)||(e[this.texData[n]]=n,t.add(n))}return e})()}h.prototype.setColorAt=function(e,t){if(this.texData){if(n=t,c[0]=n,!((t=c[0])in this.texColMap)){const e=this.texData;if(e.length+1>65536)return void s.logger.warn("setColorAt() cannot add new color as size limit reached");const n=new Uint32Array(e.length+1);n.set(e,0),n[e.length]=t,this.texColMap[t]=e.length;var i=new THREE.DataTexture(new Uint8Array(n.buffer),n.length,1,THREE.RGBAFormat,THREE.UnsignedByteType,THREE.UVMapping,THREE.ClampToEdgeWrapping,THREE.ClampToEdgeWrapping,THREE.NearestFilter,THREE.NearestFilter,0);i.generateMipmaps=!1,i.flipY=!1,i.needsUpdate=!0,this.geometry.tIdColor.dispose(),this.geometry.tIdColor=i,this.texData=new Uint32Array(i.image.data.buffer),this.geometry.vIdColorTexSize=new THREE.Vector2(n.length,1)}this.vbs[e*this.stride*2+6]=this.texColMap[t]}else this.vbi[e*this.stride+6]=t;var n},h.prototype.setVertexFlagsAt=function(e,t){this.texData?this.vbi[e*this.stride+4]=t:this.vbi[e*this.stride+8]=t};var u=i(62206),d=i(93033),p=new r.Matrix4,f=new r.Box3,m=new r.Quaternion,g=new r.Vector3,v=new r.Vector3;function y(e){this.is2d=e.is2d(),this.modelId=e.getModelId(),this.fragments=e.getData().fragments,this.geoms=e.getGeometryList(),this.isFixedSize=this.fragments.length>0,this.isFixedSize?(this.boxes=this.fragments.boxes,this.transforms=this.fragments.transforms,this.useThreeMesh=!n.memoryOptimizedLoading):(this.boxes=null,this.transforms=null,this.useThreeMesh=!0);var t=this.fragments.length;if(this.vizflags=new Uint16Array(t),this.useThreeMesh&&(this.vizmeshes=new Array(t)),e.isOTG()){var i=e.getData().metadata.stats,r=i.num_materials,o=i.num_geoms;this.materialids=(0,a.R)(t,r),this.geomids=(0,a.R)(t,o)}else this.geomids=new Int32Array(t),this.materialids=new Int32Array(t);this.materialmap={},this.materialIdMap={},this.nextMaterialId=1,this.materialIdMapOriginal=null,this.db2ThemingColor=[],this.originalColors=[],this.themingOrGhostingNeedsUpdate={},this.themingOrGhostingNeedsUpdateByDbId={},this.dbIdOpacity=[],this.dbIdIsGhosted=[],this.animxforms=null;for(var s=0;s<t;s++)this.vizflags[s]=1;!e.isOTG()&&this.fragments.visibilityFlags&&this.vizflags.set(this.fragments.visibilityFlags),this.allVisible=!0,this.allVisibleDirty=!0,this.nextAvailableFragID=t,this.linesHidden=!1,this.pointsHidden=!1,this.matrix=null,this.viewBounds=null}function b(e){var t=e.r;return e.r=e.b,e.b=t,e}y.prototype.getNextAvailableFragmentId=function(){return this.nextAvailableFragID++},y.prototype.fragmentsHaveBeenAdded=function(){return this.vizflags.length>this.fragments.length},y.prototype.getSvfMaterialId=function(e){var t=this.getMaterial(e);return t?t.svfMatId:void 0},y.prototype.setMesh=function(e,t,i,n){if(this.vizmeshes){var r=this.vizmeshes[e];r&&r.parent&&r.parent.remove(r)}if(this.vizflags.length<=e){this.isFixedSize&&(s.logger.warn("Attempting to resize a fragments list that was initialized with fixed data. This will have a performance impact."),this.isFixedSize=!1);var a=Math.ceil(1.5*Math.max(this.vizflags.length,e))||1;this.useThreeMesh&&a<this.vizmeshes.length&&(a=this.vizmeshes.length);var l=new Uint16Array(a);if(l.set(this.vizflags),this.vizflags=l,this.transforms){var c=new Float32Array(12*a);c.set(this.transforms),this.transforms=c}if(this.boxes){var h=new Float32Array(6*a);h.set(this.boxes),this.boxes=h}if(this.geomids){var u=new Int32Array(a);u.set(this.geomids),this.geomids=u}if(this.materialids){var p=new Int32Array(a);p.set(this.materialids),this.materialids=p}}if(this.useThreeMesh){var m;n&&t instanceof d.LMVMesh?(m=t,t.matrix&&m.matrixWorld.copy(t.matrix),m.dbId=m.dbId||0):(m=new d.LMVMesh(t.geometry,t.material),t.matrix&&(m.matrix&&m.matrix.copy(t.matrix),m.matrixWorld.copy(t.matrix)),m.is2d=t.is2d,m.isLine=t.isLine,m.isWideLine=t.isWideLine,m.isPoint=t.isPoint,m.dbId=0|this.fragments.fragId2dbId[e]),m.matrixAutoUpdate=!1,m.frustumCulled=!1,m.fragId=e,m.modelId=this.modelId,this.matrix&&m.matrixWorld.multiplyMatrices(this.matrix,m.matrix),this.vizmeshes[e]=m}else{var g=void 0;t.geometry.hash?(void 0===t.geomId&&console.error("meshInfo must provide geomId"),g=t.geomId):g=t.geometry.svfid,this.geomids[e]=g,this.setMaterial(e,t.material)}var v=0;if(t.isLine?v=o.MeshFlags.MESH_ISLINE:t.isWideLine?v=o.MeshFlags.MESH_ISWIDELINE:t.isPoint&&(v=o.MeshFlags.MESH_ISPOINT),this.isFixedSize?this.vizflags[e]|=v:this.vizflags[e]|=o.MeshFlags.MESH_VISIBLE|v,i&&this.transforms&&this.boxes){var y=t.matrix,b=12*e,x=y.elements,_=this.transforms;if(_[b]=x[0],_[b+1]=x[1],_[b+2]=x[2],_[b+3]=x[4],_[b+4]=x[5],_[b+5]=x[6],_[b+6]=x[8],_[b+7]=x[9],_[b+8]=x[10],_[b+9]=x[12],_[b+10]=x[13],_[b+11]=x[14],!this.fragments.boxesLoaded){t.bbox?f.copy(t.bbox):(t.geometry&&t.geometry.boundingBox?f.copy(t.geometry.boundingBox):this.geoms.getModelBox(this.geomids[e],f),f.isEmpty()||f.applyMatrix4(y));var E=6*e,A=this.boxes;A[E]=f.min.x,A[E+1]=f.min.y,A[E+2]=f.min.z,A[E+3]=f.max.x,A[E+4]=f.max.y,A[E+5]=f.max.z}}!function(e,t){if(e.is2d&&!function(e){for(let t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.themingOrGhostingNeedsUpdateByDbId)){let i=e.getDbIds(t);i=Array.isArray(i)?i:[i],i=i.filter((t=>e.themingOrGhostingNeedsUpdateByDbId[t])),i.length&&(w(e,t),i.forEach((t=>{delete e.themingOrGhostingNeedsUpdateByDbId[t]})))}}(this,e)},y.prototype.isFlagSet=function(e,t){return!!(this.vizflags[e]&t)},y.prototype.setFlagFragment=function(e,t,i){var n=this.vizflags[e];return!!(n&t)!=i&&(this.vizflags[e]=i?n|t:n&~t,!0)},y.prototype.setFlagGlobal=function(e,t){var i=this.vizflags,n=0,r=i.length;if(t)for(;n<r;n++)i[n]=i[n]|e;else for(var o=~e;n<r;n++)i[n]=i[n]&o},y.prototype.hideLines=function(e){this.linesHidden=e},y.prototype.hidePoints=function(e){this.pointsHidden=e},y.prototype.hideFragments=function(e,t){var i=o.MeshFlags.MESH_HIDE,n=this.vizflags,r=0,s=n.length;if(t)for(;r<s;r++)n[r]&e&&(n[r]=n[r]|i);else for(var a=~i;r<s;r++)n[r]&e&&(n[r]=n[r]&a);this.allVisibleDirty=!0},y.prototype.isFragVisible=function(e){var t=this.linesHidden&&(this.isLine(e)||this.isWideLine(e)),i=this.pointsHidden&&this.isPoint(e);return 1==(7&this.vizflags[e])&&!t&&!i},y.prototype.isFragOff=function(e){return!!(this.vizflags[e]&o.MeshFlags.MESH_HIDE)},y.prototype.isNotLoaded=function(e){return this.vizflags[e]&o.MeshFlags.MESH_NOTLOADED},y.prototype.isLine=function(e){return!!(this.vizflags[e]&o.MeshFlags.MESH_ISLINE)},y.prototype.isWideLine=function(e){return this.isFlagSet(e,o.MeshFlags.MESH_ISWIDELINE)},y.prototype.isPoint=function(e){return this.isFlagSet(e,o.MeshFlags.MESH_ISPOINT)},y.prototype.areAllVisible=function(){if(this.allVisibleDirty){for(var e=this.vizflags,t=!0,i=0,n=e.length;i<n;i++)if(0==(1&e[i])){t=!1;break}this.allVisible=t,this.allVisibleDirty=!1}return this.allVisible};var x,_,E,A,S=(x=null,_=null,E=parseInt("00FFFFFF",16),A=parseInt("FF000000",16),function(e,t){return x||(x=new r.Color,_=new r.Color),x.set(e&E),b(x),t&&(_.setRGB(t.x,t.y,t.z),x.lerp(_,t.w)),b(x).getHex()|e&A});function w(e,t){var i=e.originalColors[t],n=e.getGeometry(t);if(!(0,u.isInterleavedGeometry)(n))return void console.error("Unexpected non-interleaved vertex buffer");const r=new l.VertexBufferReader(n),o=new h(n);if(r.isInterleavedVb){for(var s=!1,a=r.vcount,c=0;c<a;c++){var d=r.getDbIdAt(c),p=i?i[c]:r.getColorAt(c),f=r.getLayerIndexAt(c),m=-1===(d=d<<8>>8)&&0===f,g=e.db2ThemingColor[d],v=0===e.dbIdOpacity[d];if(g||v){if(!i){i=new Uint32Array(a);for(var y=0;y<a;y++)i[y]=r.getColorAt(y);e.originalColors[t]=i}p=v?0:S(p,g),s=!0}else i&&(p=i[c]);if(!v){let t=e.dbIdOpacity[d];if(!isNaN(t)){const e=parseInt("00FFFFFF",16);t=255*t<<24,p=p&e|t}}o.setColorAt(c,p);var b=e.dbIdIsGhosted[d]&&!m,x=r.getVertexFlagsAt(c);b?x|=255<<24:x&=16777215,o.setVertexFlagsAt(c,x)}s||(e.originalColors[t]=null),n.vbNeedsUpdate=!0}}var M;function T(e,t){if(e.is2d){var i=e.fragments.dbId2fragId[t];if(Array.isArray(i))for(var n=0;n<i.length;n++)e.themingOrGhostingNeedsUpdate[i[n]]=!0;else"number"==typeof i?e.themingOrGhostingNeedsUpdate[i]=!0:e.themingOrGhostingNeedsUpdateByDbId[t]=!0}}function C(e,t){this.frags=e,this.fragId=t,this.scale=null,this.quaternion=null,this.position=null}y.prototype.getVizmesh=function(e){if(this.is2d&&function(e,t){e.themingOrGhostingNeedsUpdate[t]&&(w(e,t),e.themingOrGhostingNeedsUpdate[t]=!1)}(this,e),this.useThreeMesh){var t=this.vizmeshes[e];return t&&(t.themingColor=this.db2ThemingColor[t.dbId]),t}{const t=this.scratchMesh=this.scratchMesh||(()=>{var e=new d.LMVMesh;return e.isTemp=!0,e.dbId=0,e.modelId=0,e.fragId=-1,e.hide=!1,e.isLine=!1,e.isWideLine=!1,e.isPoint=!1,e.frustumCulled=!1,e})();return t.geometry=this.getGeometry(e),t.material=this.getMaterial(e),t.dbId=this.getDbIds(e),t.modelId=this.modelId,t.fragId=e,t.visible=!0,t.isLine=this.isLine(e),t.isWideLine=this.isWideLine(e),t.isPoint=this.isPoint(e),t.hide=this.isFragOff(e),t.themingColor=this.db2ThemingColor[t.dbId],this.getWorldMatrix(e,t.matrixWorld),t}},y.prototype.getMaterialId=function(e){var t=this.getMaterial(e);return t?t.id:0},y.prototype.getMaterial=function(e){return this.useThreeMesh?this.vizmeshes[e].material:this.materialIdMap[this.materialids[e]]},y.prototype.storeOriginalMaterials=function(){let e,t;this.materialIdMapOriginal=[];for(let i=0;i<this.fragments.length;i++)e=this.getMaterial(i),t=e.id,this.materialIdMapOriginal.push(t)},y.prototype.restoreOriginalMaterials=function(e){let t;for(let e=0;e<this.materialIdMapOriginal.length;e++)t=this.materialIdMapOriginal[e],this.setMaterial(e,this.materialIdMap[this.materialmap[t]])},y.prototype.getGeometry=function(e){var t;return this.useThreeMesh?(t=this.vizmeshes[e])?t.geometry:null:this.geoms.getGeometry(this.geomids[e])},y.prototype.getGeometryId=function(e){return this.useThreeMesh?e:this.geomids[e]},y.prototype.setMaterial=function(e,t){if(this.useThreeMesh)this.vizmeshes[e].material=t;else{var i=this.materialmap[t.id];i||(i=this.nextMaterialId++,this.materialids=(0,a.W)(this.materialids,i),this.materialIdMap[i]=t,this.materialmap[t.id]=i),this.materialids[e]=i}},y.prototype.getCount=function(){return this.vizmeshes?this.vizmeshes.length:this.vizflags.length},y.prototype.getDbIds=function(e){return this.fragments.fragId2dbId[e]},y.prototype.dispose=function(e){if(this.useThreeMesh)for(var t={type:"dispose"},i={type:"removed"},n=0;n<this.vizmeshes.length;n++){var r=this.vizmeshes[n];r&&(r.dispatchEvent(i),r.geometry.dispatchEvent(t))}else this.geoms.dispose(e)},y.prototype.dtor=function(e){this.dispose(e),this.scratchMesh=null,this.fragments=null,this.geoms=null,this.boxes=null,this.transforms=null,this.vizflags=null,this.vizmeshes=null,this.geomids=null,this.materialids=null,this.materialmap=null,this.materialIdMap=null,this.db2ThemingColor=null,this.originalColors=null,this.themingOrGhostingNeedsUpdate=null,this.themingOrGhostingNeedsUpdateByDbId=null,this.dbIdOpacity=null,this.dbIdIsGhosted=null,this.animxforms=null,this.matrix=null,this.viewBounds=null},y.prototype.setVisibility=function(e,t){this.setFlagFragment(e,o.MeshFlags.MESH_VISIBLE,t),this.allVisibleDirty=!0},y.prototype.setFragOff=function(e,t){this.setFlagFragment(e,o.MeshFlags.MESH_HIDE,t),this.allVisibleDirty=!0},y.prototype.setAllVisibility=function(e){if(this.is2d){var t=this.fragments;if(t&&t.dbId2fragId)for(var i in t.dbId2fragId)this.setObject2DGhosted(parseInt(i),!e)}else this.setFlagGlobal(o.MeshFlags.MESH_VISIBLE,e);this.allVisible=e,this.allVisibleDirty=!1},y.prototype.updateAnimTransform=function(e,t,i,n){var r,s=this.animxforms;if(!s){var a=this.getCount();s=this.animxforms=new Float32Array(10*a);for(var l=0;l<a;l++)s[r=10*l]=1,s[r+1]=1,s[r+2]=1,s[r+3]=0,s[r+4]=0,s[r+5]=0,s[r+6]=1,s[r+7]=0,s[r+8]=0,s[r+9]=0}r=10*e;var c=!1;t&&(s[r]=t.x,s[r+1]=t.y,s[r+2]=t.z,c=!0),i&&(s[r+3]=i.x,s[r+4]=i.y,s[r+5]=i.z,s[r+6]=i.w,c=!0),n&&(s[r+7]=n.x,s[r+8]=n.y,s[r+9]=n.z,c=!0),this.setFlagFragment(e,o.MeshFlags.MESH_MOVED,c),c||(s[r]=1,s[r+1]=1,s[r+2]=1,s[r+3]=0,s[r+4]=0,s[r+5]=0,s[r+6]=1,s[r+7]=0,s[r+8]=0,s[r+9]=0)},y.prototype.getAnimTransform=function(e,t,i,n){if(!this.animxforms)return!1;if(!this.isFlagSet(e,o.MeshFlags.MESH_MOVED))return!1;var r=10*e,s=this.animxforms;return t&&(t.x=s[r],t.y=s[r+1],t.z=s[r+2]),i&&(i.x=s[r+3],i.y=s[r+4],i.z=s[r+5],i.w=s[r+6]),n&&(n.x=s[r+7],n.y=s[r+8],n.z=s[r+9]),!0},y.prototype.getOriginalWorldMatrix=function(e,t){var i=12*e,n=t.elements,r=this.transforms;if(r)n[0]=r[i],n[1]=r[i+1],n[2]=r[i+2],n[3]=0,n[4]=r[i+3],n[5]=r[i+4],n[6]=r[i+5],n[7]=0,n[8]=r[i+6],n[9]=r[i+7],n[10]=r[i+8],n[11]=0,n[12]=r[i+9],n[13]=r[i+10],n[14]=r[i+11],n[15]=1;else if(this.useThreeMesh){var o=this.vizmeshes[e];o?t.copy(o.matrix):t.identity()}else t.identity()},y.prototype.getWorldMatrix=(M=new r.Matrix4,function(e,t){this.getOriginalWorldMatrix(e,t),this.isFlagSet(e,o.MeshFlags.MESH_MOVED)&&(this.getAnimTransform(e,v,m,g),M.compose(g,m,v),t.multiplyMatrices(M,t)),this.matrix&&t.multiplyMatrices(this.matrix,t)}),y.prototype.setModelMatrix=function(e){e?(this.matrix=this.matrix||new r.Matrix4,this.matrix.copy(e),this.useThreeMesh&&this.vizmeshes.forEach((e=>{e.matrixWorld.multiplyMatrices(this.matrix,e.matrix)}))):(this.matrix=null,this.useThreeMesh&&this.vizmeshes.forEach((e=>{e.matrixWorld.copy(e.matrix)}))),this.invMatrix=null},y.prototype.getInverseModelMatrix=function(){return this.matrix?(this.invMatrix||(this.invMatrix=this.matrix.clone().invert()),this.invMatrix):null},y.prototype.getWorldBounds=function(e,t){if(this.boxes&&!this.isFlagSet(e,o.MeshFlags.MESH_MOVED)){var i=this.boxes,n=6*e;return t.min.x=i[n],t.min.y=i[n+1],t.min.z=i[n+2],t.max.x=i[n+3],t.max.y=i[n+4],t.max.z=i[n+5],void(this.matrix&&t.applyMatrix4(this.matrix))}if(this.useThreeMesh){var r=this.vizmeshes[e];r&&r.geometry&&t.copy(r.geometry.boundingBox)}else this.geoms.getModelBox(this.geomids[e],t);this.viewBounds&&t.intersect(this.viewBounds),t.isEmpty()?t.makeEmpty():(this.getWorldMatrix(e,p),t.applyMatrix4(p))},y.prototype.getOriginalWorldBounds=function(e,t){if(this.boxes){var i=this.boxes,n=6*e;return t[0]=i[n],t[1]=i[n+1],t[2]=i[n+2],t[3]=i[n+3],t[4]=i[n+4],void(t[5]=i[n+5])}if(this.useThreeMesh){var r=this.vizmeshes[e];r&&r.geometry&&f.copy(r.geometry.boundingBox)}else this.geoms.getModelBox(this.geomids[e],f);f.isEmpty()||(this.getOriginalWorldMatrix(e,p),f.applyMatrix4(p)),t[0]=f.min.x,t[1]=f.min.y,t[2]=f.min.z,t[3]=f.max.x,t[4]=f.max.y,t[5]=f.max.z},y.prototype.setThemingColor=function(e,t){var i=this.db2ThemingColor[e];i===t||i&&t&&i.equals(t)||(this.db2ThemingColor[e]=t||void 0,T(this,e))},y.prototype.clearThemingColors=function(){if(this.is2d){for(var e in this.fragments.dbId2fragId)T(this,parseInt(e));delete this.db2ThemingColor[-1]}this.db2ThemingColor.length=0},y.prototype.setObject2DGhosted=function(e,t){!!t!=!!this.dbIdIsGhosted[e]&&(this.dbIdIsGhosted[e]=t,T(this,e))},y.prototype.setObject2DOpacity=function(e,t){t!==this.dbIdOpacity[e]&&(this.dbIdOpacity[e]=t,T(this,e))},y.prototype.setObject2DVisible=function(e,t){t!==(0!==this.dbIdOpacity[e])&&(this.dbIdOpacity[e]=0|t,T(this,e))},y.prototype.getViewBounds=function(){return this.viewBounds},y.prototype.setViewBounds=function(e){e?(this.viewBounds=this.viewBounds||new r.Box3,this.viewBounds.copy(e),e.max.hasOwnProperty("z")||(this.viewBounds.max.z=1/0,this.viewBounds.min.z=-1/0)):this.viewBounds=null},y.prototype.getDoNotCut=function(){return this.doNotCut},y.prototype.setDoNotCut=function(e){this.doNotCut=e},C.prototype.getWorldMatrix=function(e){this.frags.getWorldMatrix(this.fragId,e)},C.prototype.getOriginalWorldMatrix=function(e){this.frags.getOriginalWorldMatrix(this.fragId,e)},C.prototype.getWorldBounds=function(e){return this.frags.getWorldBounds(this.fragId,e)},C.prototype.getAnimTransform=function(){return this.scale||(this.scale=new r.Vector3(1,1,1),this.quaternion=new r.Quaternion(0,0,0,1),this.position=new r.Vector3(0,0,0)),this.frags.getAnimTransform(this.fragId,this.scale,this.quaternion,this.position)},C.prototype.updateAnimTransform=function(){this.scale||(this.scale=new r.Vector3(1,1,1),this.quaternion=new r.Quaternion(0,0,0,1),this.position=new r.Vector3(0,0,0)),this.frags.updateAnimTransform(this.fragId,this.scale,this.quaternion,this.position)},C.prototype.getMaterial=function(){return this.frags.getMaterial(this.fragId)},C.prototype.setMaterial=function(e){return this.frags.setMaterial(this.fragId,e)}},10834:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CONTAINMENT_UNKNOWN:()=>c,CONTAINS:()=>l,FrustumIntersector:()=>o,INTERSECTS:()=>a,OUTSIDE:()=>s});var n=i(41434),r=[[1,5,4,7,3,2,6],[0,3,2,1,5,4,6],[0,3,2,6,5,4,6],[0,4,7,3,2,1,6],[0,3,2,1,-1,-1,4],[0,3,2,6,5,1,6],[0,4,7,6,2,1,6],[0,3,7,6,2,1,6],[0,3,7,6,5,1,6],[0,1,5,4,7,3,6],[0,1,5,4,-1,-1,4],[0,1,2,6,5,4,6],[0,4,7,3,-1,-1,4],[-1,-1,-1,-1,-1,-1,0],[1,2,6,5,-1,-1,4],[0,4,7,6,2,3,6],[2,3,7,6,-1,-1,4],[1,2,3,7,6,5,6],[0,1,5,6,7,3,6],[0,1,5,6,7,4,6],[0,1,2,6,7,4,6],[0,4,5,6,7,3,6],[4,5,6,7,-1,-1,4],[1,2,6,7,4,5,6],[0,4,5,6,2,3,6],[2,3,7,4,5,6,6],[1,2,3,7,4,5,6]];function o(){this.frustum=new n.Frustum,this.viewProj=new n.Matrix4,this.viewDir=[0,0,1],this.ar=1,this.viewport=new n.Vector3(1,1,1),this.areaConv=1,this.areaCullThreshold=1,this.eye=new n.Vector3,this.perspective=!1,this.projScale=1}const s=0,a=1,l=2,c=-1;var h,u;function d(e,t,i){return i.x=1&t?e.max.x:e.min.x,i.y=2&t?e.max.y:e.min.y,i.z=4&t?e.max.z:e.min.z,i}o.OUTSIDE=s,o.INTERSECTS=a,o.CONTAINS=l,o.CONTAINMENT_UNKNOWN=c,o.prototype.reset=function(e,t){this.viewProj.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this.perspective=e.isPerspective,this.frustum.setFromProjectionMatrix(this.viewProj);var i=e.matrixWorldInverse.elements;this.ar=e.aspect,this.viewDir[0]=-i[2],this.viewDir[1]=-i[6],this.viewDir[2]=-i[10],this.eye.x=e.position.x,this.eye.y=e.position.y,this.eye.z=e.position.z,this.areaConv=e.clientWidth*e.clientHeight/4,this.cutPlanes=t,this.perspective?this.projScale=e.clientHeight/(2*Math.tan(n.Math.degToRad(e.fov/2))):this.projScale=e.clientHeight/e.orthoScale},o.prototype.projectedArea=function(){var e=[new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3,new n.Vector3],t=new n.Box2;function i(e,t){var i=e.x,n=e.y,r=e.z,o=t.elements,s=o[3]*i+o[7]*n+o[11]*r+o[15];s<0&&(s=-s);var a=1/s;e.x=(o[0]*i+o[4]*n+o[8]*r+o[12])*a,e.y=(o[1]*i+o[5]*n+o[9]*r+o[13])*a}return function(n){if(n.isEmpty())return 0;var r=this.viewProj;e[0].set(n.min.x,n.min.y,n.min.z),e[1].set(n.min.x,n.min.y,n.max.z),e[2].set(n.min.x,n.max.y,n.min.z),e[3].set(n.min.x,n.max.y,n.max.z),e[4].set(n.max.x,n.min.y,n.min.z),e[5].set(n.max.x,n.min.y,n.max.z),e[6].set(n.max.x,n.max.y,n.min.z),e[7].set(n.max.x,n.max.y,n.max.z);for(var o=0;o<8;o++)i(e[o],r);return t.makeEmpty(),t.setFromPoints(e),t.min.x<-1&&(t.min.x=-1),t.min.x>1&&(t.min.x=1),t.min.y<-1&&(t.min.y=-1),t.min.y>1&&(t.min.y=1),t.max.x>1&&(t.max.x=1),t.max.x<-1&&(t.max.x=-1),t.max.y>1&&(t.max.y=1),t.max.y<-1&&(t.max.y=-1),(t.max.x-t.min.x)*(t.max.y-t.min.y)}}(),o.prototype.projectedBoxArea=function(){for(var e,t=[],i=[],o=0;o<10;o++)t.push(new n.Vector3),i.push(new n.Vector3);function s(e,t){var i=e.x,n=e.y,r=e.z,o=t.elements,s=o[3]*i+o[7]*n+o[11]*r+o[15];s<0&&(s=-s);var a=1/s;e.x=(o[0]*i+o[4]*n+o[8]*r+o[12])*a,e.y=(o[1]*i+o[5]*n+o[9]*r+o[13])*a}return function(n,o){if(n.isEmpty())return 0;var a,l=this.viewProj;if(this.perspective?(a=this.eye.x>=n.min.x?this.eye.x>n.max.x?2:1:0,this.eye.y>=n.min.y&&(a+=this.eye.y>n.max.y?6:3),this.eye.z>=n.min.z&&(a+=this.eye.z>n.max.z?18:9)):(a=this.viewDir[0]<=0?this.viewDir[0]<0?2:1:0,this.viewDir[1]<=0&&(a+=this.viewDir[1]<0?6:3),this.viewDir[2]<=0&&(a+=this.viewDir[2]<0?18:9)),13===a)return 4;var c,h=r[a][6];for(c=0;c<h;c++){var u=r[a][c];t[c].set((u+1)%4<2?n.min.x:n.max.x,u%4<2?n.min.y:n.max.y,u<4?n.min.z:n.max.z),s(t[c],l)}var d=0;if(o)for(d=(t[h-1].x-t[0].x)*(t[h-1].y+t[0].y),c=0;c<h-1;c++)d+=(t[c].x-t[c+1].x)*(t[c].y+t[c+1].y);else{var p=function(t,n){var r,o,s,a,l,c,h,u,d=t,p=i,f=function(e){switch(h){case 0:return e.x>=-1;case 1:return e.x<=1;case 2:return e.y>=-1;case 3:return e.y<=1}},m=function(e){p[u].x=e.x,p[u++].y=e.y},g=function(){var e,t;switch(h){case 0:e=-1,t=o.y+(s.y-o.y)*(e-o.x)/(s.x-o.x);break;case 1:e=1,t=o.y+(s.y-o.y)*(e-o.x)/(s.x-o.x);break;case 2:t=-1,e=o.x+(s.x-o.x)*(t-o.y)/(s.y-o.y);break;case 3:t=1,e=o.x+(s.x-o.x)*(t-o.y)/(s.y-o.y)}p[u].x=e,p[u++].y=t};for(h=0;h<4&&n>2;h++){for(u=0,a=f(o=d[n-1]),c=0;c<n;c++)l=f(s=d[c]),a?l?m(s):g():l&&(g(),m(s)),o=s,a=l;n=u,r=d,d=p,p=r}return e=n,d}(t,h);if(e>=3)for(d=(p[e-1].x-p[0].x)*(p[e-1].y+p[0].y),c=0;c<e-1;c++)d+=(p[c].x-p[c+1].x)*(p[c].y+p[c+1].y)}return Math.abs(.5*d)}}(),o.prototype.estimateDepth=function(e){var t=this.viewProj.elements,i=(e.min.x+e.max.x)/2,n=(e.min.y+e.max.y)/2,r=(e.min.z+e.max.z)/2,o=1/(t[3]*i+t[7]*n+t[11]*r+t[15]);return(t[2]*i+t[6]*n+t[10]*r+t[14])*o},o.prototype.estimateProjectedDiameter=function(e){const t=(e.min.x+e.max.x)/2,i=(e.min.y+e.max.y)/2,n=(e.min.z+e.max.z)/2,r=Math.max(e.max.x-e.min.x,e.max.y-e.min.y,e.max.z-e.min.z);if(this.perspective){const e=(t-this.eye.x)*this.viewDir[0]+(i-this.eye.y)*this.viewDir[1]+(n-this.eye.z)*this.viewDir[2];return r<e?r*this.projScale/e:this.projScale}return r*this.projScale},o.prototype.intersectsBox=(h=new n.Vector3,u=new n.Vector3,function(e){for(var t=this.frustum.planes,i=0,n=0;n<6;n++){var r=t[n];h.x=r.normal.x>0?e.min.x:e.max.x,u.x=r.normal.x>0?e.max.x:e.min.x,h.y=r.normal.y>0?e.min.y:e.max.y,u.y=r.normal.y>0?e.max.y:e.min.y,h.z=r.normal.z>0?e.min.z:e.max.z,u.z=r.normal.z>0?e.max.z:e.min.z;var s=r.distanceToPoint(h),a=r.distanceToPoint(u);if(s<0&&a<0)return o.OUTSIDE;s>0&&a>0&&i++}return 6==i?o.CONTAINS:o.INTERSECTS});var p,f=function(e,t){p||(p=new n.Vector3);for(var i=0;i<8;i++){var r=d(e,i,p);if(s=t,!((o=r).x*s.x+o.y*s.y+o.z*s.z+s.w>1e-6))return!1}var o,s;return!0};o.prototype.boxOutsideCutPlanes=function(e){if(!this.cutPlanes)return!1;for(var t=0;t<this.cutPlanes.length;t++){var i=this.cutPlanes[t];if(f(e,i))return!0}return!1}},1454:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GeometryList:()=>a});var n=i(29996),r=i(16840),o=i(41434),s=i(62206);function a(e,t,i,n){this.geoms=[null],this.numGeomsInMemory=0,this.geomMemory=0,this.gpuMeshMemory=0,this.gpuNumMeshes=0,this.geomPolyCount=0,this.instancePolyCount=0,this.is2d=t,this.geomBoxes=n?null:new Float32Array(6*Math.max(1,e+1)),this.numObjects=e,this.disableStreaming=!!i}a.prototype.getGeometry=function(e){return this.geoms[e]},a.prototype.chooseMemoryType=function(e,t,i,r){var o=n.GPU_MEMORY_LIMIT,s=2*o,a=n.GPU_OBJECT_LIMIT;if(0===o)return e.streamingDraw=!0,void(e.streamingIndex=!0);if(this.disableStreaming||r<o&&i<a)e.streamingDraw=!1,e.streamingIndex=!1;else if(r>=s)e.streamingDraw=!0,e.streamingIndex=!0;else{(this.is2d?100001:e.byteSize*(t||1))<1e5&&(e.streamingDraw=!0,e.streamingIndex=!0)}},a.prototype.addGeometry=function(e,t,i){this.chooseMemoryType(e,t,this.gpuNumMeshes,this.gpuMeshMemory);var a=e.byteSize+n.GEOMETRY_OVERHEAD;if(e.streamingDraw||((0,r.isMobileDevice)()&&(a+=e.byteSize),this.gpuMeshMemory+=e.byteSize,this.gpuNumMeshes+=1),this.numGeomsInMemory++,(void 0===i||i<=0)&&(i=this.geoms.length),this.geoms[i]=e,this.geomBoxes){var l=this.geomBoxes.length/6|0;if(l<this.geoms.length){var c=3*this.geoms.length/2|0,h=new Float32Array(6*c);h.set(this.geomBoxes);var u=new o.Box3;for(u.makeEmpty();l<c;)h[6*l]=u.min.x,h[6*l+1]=u.min.y,h[6*l+2]=u.min.z,h[6*l+3]=u.max.x,h[6*l+4]=u.max.y,h[6*l+++5]=u.max.z;this.geomBoxes=h}var d=e.boundingBox;d?(this.geomBoxes[6*i]=d.min.x,this.geomBoxes[6*i+1]=d.min.y,this.geomBoxes[6*i+2]=d.min.z,this.geomBoxes[6*i+3]=d.max.x,this.geomBoxes[6*i+4]=d.max.y,this.geomBoxes[6*i+5]=d.max.z):(e.hash||console.error("Mesh without bbox and without hash should not be."),this.geomBoxes[6*i]=-.5,this.geomBoxes[6*i+1]=-.5,this.geomBoxes[6*i+2]=-.5,this.geomBoxes[6*i+3]=.5,this.geomBoxes[6*i+4]=.5,this.geomBoxes[6*i+5]=.5)}n.memoryOptimizedLoading&&!this.is2d&&(e.boundingBox=null,e.boundingSphere=null),this.geomMemory+=a;const p=(0,s.getIndexBufferArray)(e);var f,m=e.isLines?2:3;return f=p?p.length/m:(0,s.isInterleavedGeometry)(e)?e.vb.length/(m*e.vbstride):e.attributes.position.array.length/(3*m),this.geomPolyCount+=f,this.instancePolyCount+=f*(t||1),e.polyCount=f,e.internalInstanceCount=t||1,e.svfid=i,i},a.prototype.removeGeometry=function(e,t){var i=this.getGeometry(e);if(!i)return 0;var o=i.byteSize+n.GEOMETRY_OVERHEAD;return t&&t.deallocateGeometry(i),i.streamingDraw||((0,r.isMobileDevice)()&&(o+=i.byteSize),this.gpuMeshMemory-=i.byteSize,this.gpuNumMeshes-=1),this.geoms[e]=null,this.geomMemory-=o,this.numGeomsInMemory--,this.geomPolyCount-=i.polyCount,this.instancePolyCount-=i.internalInstanceCount*i.polyCount,o},a.prototype.getModelBox=function(e,t){if(this.geomBoxes)if(0===e||this.geomBoxes.length/6<=e)t.makeEmpty();else{var i=6*e,n=this.geomBoxes;t.min.x=n[i],t.min.y=n[i+1],t.min.z=n[i+2],t.max.x=n[i+3],t.max.y=n[i+4],t.max.z=n[i+5]}else e>=1&&e<=this.numObjects?(t.min.x=-.5,t.min.y=-.5,t.min.z=-.5,t.max.x=.5,t.max.y=.5,t.max.z=.5):t.makeEmpty()},a.prototype.dispose=function(e){if(e)for(var t=0,i=this.geoms.length;t<i;t++)this.geoms[t]&&e.deallocateGeometry(this.geoms[t])},a.prototype.printStats=function(){console.log("Total geometry size: "+this.geomMemory/1048576+" MB"),console.log("Number of meshes: "+(this.geoms.length-1)),console.log("Num Meshes on GPU: "+this.gpuNumMeshes),console.log("Net GPU geom memory used: "+this.gpuMeshMemory)}},14936:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InstanceTree:()=>l,NODE_TYPE:()=>o});var n=i(4123),r=i(49720);const o={NODE_TYPE_ASSEMBLY:0,NODE_TYPE_INSERT:1,NODE_TYPE_LAYER:2,NODE_TYPE_COLLECTION:3,NODE_TYPE_COMPOSITE:4,NODE_TYPE_MODEL:5,NODE_TYPE_GEOMETRY:6,NODE_TYPE_BITS:7};var s=1073741824,a=2147483648;function l(e,t,i){this.nodeAccess=e,this.maxDepth=i,this.objectCount=t,this.numHidden=0,this.numOff=0,this.fragList=null}l.prototype.dtor=function(){this.nodeAccess.dtor(),this.nodeAccess=null,this.fragList=null},l.prototype.setFlagNode=function(e,t,i){var n=this.nodeAccess.getNodeFlags(e);return!!(n&t)!=i&&(i?this.nodeAccess.setNodeFlags(e,n|t):this.nodeAccess.setNodeFlags(e,n&~t),!0)},l.prototype.setFlagGlobal=function(e,t){var i=this.nodeAccess,n=0,r=i.numNodes;if(t)for(;n<r;n++)i.setNodeFlags(n,i.getNodeFlags(n)|e);else for(var o=~e;n<r;n++)i.setNodeFlags(n,i.getNodeFlags(n)&o)},l.prototype.setNodeOff=function(e,t){var i=this.setFlagNode(e,s,t);return i&&(t?this.numOff++:this.numOff--),i},l.prototype.isNodeOff=function(e){return!!(this.nodeAccess.getNodeFlags(e)&s)},l.prototype.setNodeHidden=function(e,t){var i=this.setFlagNode(e,a,t);return i&&(t?this.numHidden++:this.numHidden--),i},l.prototype.isNodeHidden=function(e){return!!(this.nodeAccess.getNodeFlags(e)&a)},l.prototype.lockNodeSelection=function(e,t){return this.setFlagNode(e,16384,t)},l.prototype.isNodeSelectionLocked=function(e){return!!(16384&this.nodeAccess.getNodeFlags(e))},l.prototype.lockNodeVisible=function(e,t){return this.setFlagNode(e,4096,t)},l.prototype.isNodeVisibleLocked=function(e){return!!(4096&this.nodeAccess.getNodeFlags(e))},l.prototype.isNodeExplodeLocked=function(e){return!!(8192&this.nodeAccess.getNodeFlags(e))},l.prototype.lockNodeExplode=function(e,t){return this.setFlagNode(e,8192,t)},l.prototype.getNodeType=function(e){return this.nodeAccess.getNodeFlags(e)&o.NODE_TYPE_BITS},l.prototype.isNodeSelectable=function(e){return!(536870912&this.nodeAccess.getNodeFlags(e))},l.prototype.getNodeParentId=function(e){return this.nodeAccess.getParentId(e)},l.prototype.getRootId=function(){return this.nodeAccess.rootId},l.prototype.getNodeName=function(e,t){return this.nodeAccess.name(e,t)},l.prototype.getChildCount=function(e){return this.nodeAccess.getNumChildren(e)};var c=new Array(6);l.prototype.getNodeBox=function(e,t){if(!this.nodeAccess.nodeBoxes)return this.fragList?(t[0]=t[1]=t[2]=1/0,t[3]=t[4]=t[5]=-1/0,void this.enumNodeFragments(e,(e=>{this.fragList.getOriginalWorldBounds(e,c),t[0]=Math.min(t[0],c[0]),t[1]=Math.min(t[1],c[1]),t[2]=Math.min(t[2],c[2]),t[3]=Math.max(t[3],c[3]),t[4]=Math.max(t[4],c[4]),t[5]=Math.max(t[5],c[5])}),!0)):void r.logger.error("getNodeBox() requires fragBoxes or nodeBoxes");this.nodeAccess.getNodeBox(e,t)},l.prototype.getNodeIndex=function(e){return this.nodeAccess.getIndex(e)},l.prototype.enumNodeFragments=function(e,t,i){var n;"number"==typeof e?n=e:e&&(n=e.dbId);const r=e=>{var n=this.nodeAccess.enumNodeFragments(e,t);return n||(i&&(n=this.enumNodeChildren(e,(e=>r(e))))?n:void 0)};return r(n)},l.prototype.enumNodeChildren=function(e,t,i){var n;if("number"==typeof e?n=e:e&&(n=e.dbId),i&&t(n))return n;const r=e=>{var n=this.nodeAccess.enumNodeChildren(e,(e=>t(e)?e:i?r(e):void 0));if(n)return n};return r(n)},l.prototype.findNodeForSelection=function(e,t){if(t===n.SelectionMode.LEAF_OBJECT)return e;var i,r,s=e;if(t===n.SelectionMode.FIRST_OBJECT){var a=[];for(i=e;i;)a.push(i),i=this.getNodeParentId(i);for(var l=a.length-1;l>=0;l--)if((r=this.getNodeType(a[l]))!==o.NODE_TYPE_MODEL&&r!==o.NODE_TYPE_LAYER&&r!==o.NODE_TYPE_COLLECTION){s=a[l];break}}else if(t===n.SelectionMode.LAST_OBJECT)for(i=e;i;){if((r=this.getNodeType(i))===o.NODE_TYPE_COMPOSITE){s=i;break}i=this.getNodeParentId(i)}return s},l.prototype.setFragmentList=function(e){this.fragList=e}},87100:(e,t,i)=>{"use strict";i.r(t),i.d(t,{FlatStringStorage:()=>r,InstanceTreeAccess:()=>a,InstanceTreeStorage:()=>o});var n=i(2283);class r{constructor(e){e?(this.buf=e.buf,this.idx=e.idx,this.next=e.next):(this.buf=new Uint8Array(256),this.next=0,this.idx=[0])}allocate(e){if(this.buf.length-this.next<e){var t=Math.max(3*this.buf.length/2,this.buf.length+e),i=new Uint8Array(t);i.set(this.buf),this.buf=i}}add(e){if(null==e)return 0;if(!e.length)return this.idx.push(this.next),this.idx.length-1;var t=(0,n.Ss)(e,null);return this.allocate(t),this.next+=(0,n.Ss)(e,this.buf,this.next),this.idx.push(this.next),this.idx.length-1}get(e){if(e){var t=this.idx[e-1],i=this.idx[e];return t===i?"":(0,n.MA)(this.buf,t,i-t)}}flatten(){this.idx=s(this.idx)}}function o(){this.nodes=[],this.nextNode=0,this.children=[],this.nextChild=0,this.dbIdToIndex={},this.names=[],this.s2i={},this.strings=new r,this.nameSuffixes=[],this.getIndex(0)}function s(e){var t=new Int32Array(e.length);return t.set(e),t}function a(e,t,i){this.nodes=e.nodes,this.children=e.children,this.dbIdToIndex=e.dbIdToIndex,this.names=e.names,this.nameSuffixes=e.nameSuffixes,this.strings=new r(e.strings),this.rootId=t,this.numNodes=this.nodes.length/5,this.visibleIds=null,this.nodeBoxes=i}o.prototype.getIndex=function(e){var t=this.dbIdToIndex[e];if(t)return t;t=this.nextNode++,this.nodes.push(e);for(var i=1;i<5;i++)this.nodes.push(0);return this.dbIdToIndex[e]=t,t},o.prototype.setNode=function(e,t,i,n,r,o){var s,a=this.getIndex(e),l=5*a,c=r.length,h=o&&o.length;for(h&&(c+=o.length),this.nodes[l+1]=t,this.nodes[l+2]=this.nextChild,this.nodes[l+3]=h?-c:c,this.nodes[l+4]=n,s=0;s<r.length;s++)this.children[this.nextChild++]=this.getIndex(r[s]);if(h)for(s=0;s<o.length;s++)this.children[this.nextChild++]=-o[s]-1;this.nextChild>this.children.length&&console.error("Child index out of bounds -- should not happen"),this.processName(a,i)},o.prototype.processName=function(e,t){var i,n,r=-1,o=-1;if(t&&(o=t.lastIndexOf("]"),-1!==(r=t.lastIndexOf("["))&&-1!==o||(r=t.lastIndexOf(":"),o=t.length)),r>=0&&o>r){i=t.slice(0,r+1);var s=t.slice(r+1,o);(n=parseInt(s,10))&&n+""===s||(i=t,n=0)}else i=t,n=0;var a=this.s2i[i];void 0===a&&(a=this.strings.add(i),this.s2i[i]=a),this.names[e]=a,this.nameSuffixes[e]=n},o.prototype.flatten=function(){this.nodes=s(this.nodes),this.children=s(this.children),this.names=s(this.names),this.nameSuffixes=s(this.nameSuffixes),this.strings.flatten(),this.s2i=null},a.prototype.dtor=function(){this.nodes=null,this.children=null,this.dbIdToIndex=null,this.names=null,this.nameSuffixes=null,this.strings=null,this.visibleIds=null,this.nodeBoxes=null},a.prototype.getNumNodes=function(){return this.numNodes},a.prototype.getIndex=function(e){return this.dbIdToIndex[e]},a.prototype.name=function(e,t){var i,n=this.dbIdToIndex[e],r=this.strings.get(this.names[n]),o=this.nameSuffixes[n];o?i="["===r.charAt(r.length-1)?r+o+"]":r+o:i=r;return t&&(this.childCounts||this.computeChildCounts(),this.childCounts[e]>0&&(i+=" ("+this.childCounts[e]+")")),i},a.prototype.getParentId=function(e){var t=this.dbIdToIndex[e];return this.nodes[5*t+1]},a.prototype.getNodeFlags=function(e){var t=this.dbIdToIndex[e];return this.nodes[5*t+4]},a.prototype.setNodeFlags=function(e,t){var i=this.dbIdToIndex[e];i&&(this.nodes[5*i+4]=t)},a.prototype.getNumChildren=function(e){var t=this.dbIdToIndex[e],i=this.nodes[5*t+3];if(i>=0)return i;var n=this.nodes[5*t+2];i=Math.abs(i);for(var r=0,o=0;o<i;o++){if(this.children[n+o]<0)break;r++}return r},a.prototype.getNumFragments=function(e){var t=this.dbIdToIndex[e],i=this.nodes[5*t+3];if(i>=0)return 0;for(var n=this.nodes[5*t+2],r=0,o=(i=Math.abs(i))-1;o>=0;o--){if(this.children[n+o]>=0)break;r++}return r},a.prototype.getNodeBox=function(e,t){for(var i=6*this.getIndex(e),n=0;n<6;n++)t[n]=this.nodeBoxes[i+n]},a.prototype.getVisibleIds=function(){return this.visibleIds||(this.visibleIds=Object.keys(this.dbIdToIndex).map((function(e){return parseInt(e)}))),this.visibleIds},a.prototype.enumNodeChildren=function(e,t){var i=this.dbIdToIndex[e],n=this.nodes[5*i+2],r=this.nodes[5*i+3];r=Math.abs(r);for(var o=0;o<r;o++){var s=this.children[n+o];if(s<0)break;if(t(this.nodes[5*s+0],e,i))return e}},a.prototype.enumNodeFragments=function(e,t){var i=this.dbIdToIndex[e],n=this.nodes[5*i+2],r=this.nodes[5*i+3];if(r<0){r=-r;for(var o=0;o<r;o++){var s=this.children[n+o];if(!(s>0)&&t(-s-1,e,i))return e}}},a.prototype.computeBoxes=function(e){this.nodeBoxes||(this.nodeBoxes=new Float32Array(6*this.numNodes));var t=this,i=t.getIndex(t.rootId),n=t.nodeBoxes;function r(e,i,r){var o=t.getIndex(e);s(e,o);for(var a=6*r,l=6*o,c=0;c<3;c++)n[a+c]>n[l+c]&&(n[a+c]=n[l+c]),n[a+c+3]<n[l+c+3]&&(n[a+c+3]=n[l+c+3])}function o(t,i,r){for(var o=6*t,s=6*r,a=0;a<3;a++)n[s+a]>e[o+a]&&(n[s+a]=e[o+a]),n[s+a+3]<e[o+a+3]&&(n[s+a+3]=e[o+a+3])}function s(e,i){var s=6*i;n[s]=n[s+1]=n[s+2]=1/0,n[s+3]=n[s+4]=n[s+5]=-1/0,t.getNumChildren(e)&&t.enumNodeChildren(e,r,!0),t.getNumFragments(e)&&t.enumNodeFragments(e,o)}s(t.rootId,i)},a.prototype.computeChildCounts=function(){this.childCounts||(this.childCounts=new Uint32Array(this.numNodes));var e=this,t=(e.getIndex(e.rootId),e.childCounts);function i(i,r,o){let s=n(i,e.getIndex(i));t[r]+=s}function n(n,r){let o=0;return 4===e.getNodeFlags(n)?o=1:(e.getNumChildren(n)&&e.enumNodeChildren(n,i,!0),e.getNumFragments(n)&&(o=1)),o+t[n]}n(e.rootId)}},57639:(e,t,i)=>{"use strict";function n(e,t){return t<=255?new Uint8Array(e):t<=65535?new Uint16Array(e):new Uint32Array(e)}function r(e,t){if(t<=255)return e;if(t<=65535&&e instanceof Uint8Array){let t=new Uint16Array(e.length);return t.set(e),t}if(!e instanceof Uint32Array){let t=new Uint32Array(e.length);return t.set(e),t}return e}i.d(t,{R:()=>n,W:()=>r})},39651:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LmvBox3:()=>r});var n=i(27957);let r=function(e,t){this.min=void 0!==e?e:new n.LmvVector3(1/0,1/0,1/0),this.max=void 0!==t?t:new n.LmvVector3(-1/0,-1/0,-1/0)};var o,s;r.prototype={constructor:r,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromArray:function(e,t){return this.min.x=e[t],this.min.y=e[t+1],this.min.z=e[t+2],this.max.x=e[t+3],this.max.y=e[t+4],this.max.z=e[t+5],this},copyToArray:function(e,t){e[t]=this.min.x,e[t+1]=this.min.y,e[t+2]=this.min.z,e[t+3]=this.max.x,e[t+4]=this.max.y,e[t+5]=this.max.z},setFromCenterAndSize:(s=new n.LmvVector3,function(e,t){var i=s.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},isEmpty:function(){return this.empty()},center:function(e){return console.warn("LmvBox3.center() is deprecated. Use LmvBox3.getCenter() instead."),this.getCenter(e)},getCenter:function(e){return(e||new n.LmvVector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){return(e||new n.LmvVector3).subVectors(this.max,this.min)},getSize:function(e){return(e||new n.LmvVector3).subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return(t||new n.LmvVector3).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsBox:function(e){return this.isIntersectionBox(e)},clampPoint:function(e,t){return(t||new n.LmvVector3).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new n.LmvVector3;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(o=[new n.LmvVector3,new n.LmvVector3,new n.LmvVector3,new n.LmvVector3,new n.LmvVector3,new n.LmvVector3,new n.LmvVector3,new n.LmvVector3],function(e){return o[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),o[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),o[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),o[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),o[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),o[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),o[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),o[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.makeEmpty(),this.setFromPoints(o),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}},98500:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LmvMatrix4:()=>r});var n=i(27957);let r=function(e){this.elements=e?new Float64Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]):new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.isDoublePrecision=!!e};r.prototype={constructor:r,set:function(e,t,i,n,r,o,s,a,l,c,h,u,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(e){return this.elements.set(e.elements),this},makeRotationFromQuaternion:function(e){var t=this.elements,i=e.x,n=e.y,r=e.z,o=e.w,s=i+i,a=n+n,l=r+r,c=i*s,h=i*a,u=i*l,d=n*a,p=n*l,f=r*l,m=o*s,g=o*a,v=o*l;return t[0]=1-(d+f),t[4]=h-v,t[8]=u+g,t[1]=h+v,t[5]=1-(c+f),t[9]=p-m,t[2]=u-g,t[6]=p+m,t[10]=1-(c+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},multiply:function(e){return this.multiplyMatrices(this,e)},multiplyMatrices:function(e,t){var i=e.elements,n=t.elements,r=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],b=i[11],x=i[15],_=n[0],E=n[4],A=n[8],S=n[12],w=n[1],M=n[5],T=n[9],C=n[13],P=n[2],D=n[6],L=n[10],I=n[14],R=n[3],O=n[7],N=n[11],k=n[15];return r[0]=o*_+s*w+a*P+l*R,r[4]=o*E+s*M+a*D+l*O,r[8]=o*A+s*T+a*L+l*N,r[12]=o*S+s*C+a*I+l*k,r[1]=c*_+h*w+u*P+d*R,r[5]=c*E+h*M+u*D+d*O,r[9]=c*A+h*T+u*L+d*N,r[13]=c*S+h*C+u*I+d*k,r[2]=p*_+f*w+m*P+g*R,r[6]=p*E+f*M+m*D+g*O,r[10]=p*A+f*T+m*L+g*N,r[14]=p*S+f*C+m*I+g*k,r[3]=v*_+y*w+b*P+x*R,r[7]=v*E+y*M+b*D+x*O,r[11]=v*A+y*T+b*L+x*N,r[15]=v*S+y*C+b*I+x*k,this},multiplyToArray:function(e,t,i){var n=this.elements;return this.multiplyMatrices(e,t),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[7]=n[7],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[11]=n[11],i[12]=n[12],i[13]=n[13],i[14]=n[14],i[15]=n[15],this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],o=e[1],s=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*a*h-n*l*h-r*s*u+i*l*u+n*s*d-i*a*d)+e[7]*(+t*a*d-t*l*u+r*o*u-n*o*d+n*l*c-r*a*c)+e[11]*(+t*l*h-t*s*d-r*o*h+i*o*d+r*s*c-i*l*c)+e[15]*(-n*s*c-t*a*h+t*s*u+n*o*h-i*o*u+i*a*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},flattenToArrayOffset:function(e,t){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},invert:function(e){const t=this.elements,i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],v=t[15],y=u*g*c-m*d*c+m*l*p-a*g*p-u*l*v+a*d*v,b=f*d*c-h*g*c-f*l*p+s*g*p+h*l*v-s*d*v,x=h*m*c-f*u*c+f*a*p-s*m*p-h*a*v+s*u*v,_=f*u*l-h*m*l-f*a*d+s*m*d+h*a*g-s*u*g,E=i*y+n*b+r*x+o*_;if(0===E)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/E;return t[0]=y*A,t[1]=(m*d*o-u*g*o-m*r*p+n*g*p+u*r*v-n*d*v)*A,t[2]=(a*g*o-m*l*o+m*r*c-n*g*c-a*r*v+n*l*v)*A,t[3]=(u*l*o-a*d*o-u*r*c+n*d*c+a*r*p-n*l*p)*A,t[4]=b*A,t[5]=(h*g*o-f*d*o+f*r*p-i*g*p-h*r*v+i*d*v)*A,t[6]=(f*l*o-s*g*o-f*r*c+i*g*c+s*r*v-i*l*v)*A,t[7]=(s*d*o-h*l*o+h*r*c-i*d*c-s*r*p+i*l*p)*A,t[8]=x*A,t[9]=(f*u*o-h*m*o-f*n*p+i*m*p+h*n*v-i*u*v)*A,t[10]=(s*m*o-f*a*o+f*n*c-i*m*c-s*n*v+i*a*v)*A,t[11]=(h*a*o-s*u*o-h*n*c+i*u*c+s*n*p-i*a*p)*A,t[12]=_*A,t[13]=(h*m*r-f*u*r+f*n*d-i*m*d-h*n*g+i*u*g)*A,t[14]=(f*a*r-s*m*r-f*n*l+i*m*l+s*n*g-i*a*g)*A,t[15]=(s*u*r-h*a*r+h*n*l-i*u*l-s*n*d+i*a*d)*A,this},getInverse:function(e,t){if(console.warn("LmvMatrix4.getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert(),0===this.determinant()){const e="Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(e);console.warn(e),this.identity()}return this},scale:function(e){var t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,Math.max(i,n)))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),n=Math.sin(t),r=1-i,o=e.x,s=e.y,a=e.z,l=r*o,c=r*s;return this.set(l*o+i,l*s-n*a,l*a+n*s,0,l*s+n*a,c*s+i,c*a-n*o,0,l*a-n*s,c*a+n*o,r*a*a+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},compose:function(e,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(e),this},decompose:function(){var e=new n.LmvVector3,t=new r(!0);return function(i,n,r){var o=this.elements,s=e.set(o[0],o[1],o[2]).length(),a=e.set(o[4],o[5],o[6]).length(),l=e.set(o[8],o[9],o[10]).length();this.determinant()<0&&(s=-s),i.x=o[12],i.y=o[13],i.z=o[14],t.elements.set(this.elements);var c=1/s,h=1/a,u=1/l;return t.elements[0]*=c,t.elements[1]*=c,t.elements[2]*=c,t.elements[4]*=h,t.elements[5]*=h,t.elements[6]*=h,t.elements[8]*=u,t.elements[9]*=u,t.elements[10]*=u,n.setFromRotationMatrix(t),r.x=s,r.y=a,r.z=l,this}}(),transformPoint:function(e){var t=e.x,i=e.y,n=e.z,r=this.elements;return e.x=r[0]*t+r[4]*i+r[8]*n+r[12],e.y=r[1]*t+r[5]*i+r[9]*n+r[13],e.z=r[2]*t+r[6]*i+r[10]*n+r[14],e},transformDirection:function(e){var t=e.x,i=e.y,n=e.z,r=this.elements;e.x=r[0]*t+r[4]*i+r[8]*n,e.y=r[1]*t+r[5]*i+r[9]*n,e.z=r[2]*t+r[6]*i+r[10]*n;var o=Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z);if(o>0){var s=1/o;e.x*=s,e.y*=s,e.z*=s}return e},equals(e){const t=this.elements,i=e.elements;for(var n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},clone:function(){return new r(this.isDoublePrecision).fromArray(this.elements)}}},27957:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LmvVector3:()=>n});let n=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0};var r,o,s,a;n.prototype={constructor:n,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyMatrix3:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n+r[12],this.y=r[1]*t+r[5]*i+r[9]*n+r[13],this.z=r[2]*t+r[6]*i+r[10]*n+r[14],this},applyProjection:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*o,this},applyQuaternion:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,o=e.y,s=e.z,a=e.w,l=a*t+o*n-s*i,c=a*i+s*t-r*n,h=a*n+r*i-o*t,u=-r*t-o*i-s*n;return this.x=l*a+u*-r+c*-s-h*-o,this.y=c*a+u*-o+h*-r-l*-s,this.z=h*a+u*-s+l*-o-c*-r,this},transformDirection:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this},clampScalar:function(e,t){return void 0===s&&(s=new n,a=new n),s.set(e,e,e),a.set(t,t,t),this.clamp(s,a)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var i=this.x,n=this.y,r=this.z;return this.x=n*e.z-r*e.y,this.y=r*e.x-i*e.z,this.z=i*e.y-n*e.x,this},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,o=t.x,s=t.y,a=t.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this},projectOnVector:function(e){return void 0===r&&(r=new n),r.copy(e).normalize(),o=this.dot(r),this.copy(r).multiplyScalar(o)},projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new n),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new n),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n},setEulerFromRotationMatrix:function(e,t){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(e,t){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},setFromMatrixPosition:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length(),i=this.set(e.elements[4],e.elements[5],e.elements[6]).length(),n=this.set(e.elements[8],e.elements[9],e.elements[10]).length();return this.x=t,this.y=i,this.z=n,this},setFromMatrixColumn:function(e,t){var i=4*e,n=t.elements;return this.x=n[i],this.y=n[i+1],this.z=n[i+2],this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this}}},41723:(e,t,i)=>{"use strict";i.r(t),i.d(t,{MeshFlags:()=>n});let n={MESH_VISIBLE:1,MESH_HIGHLIGHTED:2,MESH_HIDE:4,MESH_ISLINE:8,MESH_MOVED:16,MESH_RENDERFLAG:32,MESH_NOTLOADED:64,MESH_ISPOINT:128,MESH_ISWIDELINE:256,MESH_TRAVERSED:512,MESH_DRAWN:1024}},84302:(e,t,i)=>{"use strict";i.d(t,{i:()=>l});var n=i(41434),r=new n.Vector3,o=new Float32Array(6);const s="hierarchy";var a=s;class l{constructor(){}static setStrategy(e){if(a!==e)return a=e,!0}static getStrategy(){return a}static explode(e,t){var i=e.getData().instanceTree,l=e.getFragmentList(),c=e.getVisibleBounds(!0).getCenter(new n.Vector3);a===s&&i&&0!==t?function(e,t,i,n){var s=(i*=2)*(e.maxDepth-1)+1;1===e.maxDepth&&(s=i);var a=0|s,l=s-a;function c(n,s,h,u,d,p,f,m){var g=2*i;s==a&&(g*=l),e.getNodeBox(n,o);var v=.5*(o[0]+o[3]),y=.5*(o[1]+o[4]),b=.5*(o[2]+o[5]);s>0&&s<=a&&(p+=(v-h)*g,f+=(y-u)*g,m+=(b-d)*g);e.isNodeExplodeLocked(n)&&(p=f=m=0),e.enumNodeChildren(n,(function(e){c(e,s+1,v,y,b,p,f,m)}),!1),r.x=p,r.y=f,r.z=m,e.enumNodeFragments(n,(function(e){t.updateAnimTransform(e,null,null,r)}),!1)}c(e.getRootId(),0,n.x,n.y,n.z,0,0,0)}(i,l,t,c):function(e,t,i,n){var o,s,a=e.fragments.boxes;e.useThreeMesh?o=e.vizmeshes:s=e.fragments.fragId2dbId;for(var l=0,c=e.getCount();l<c;l++)if(0==i||t&&t.isNodeExplodeLocked(o?o[l]&&o[l].dbId:s[l]))e.updateAnimTransform(l);else{var h=6*l,u=.5*(a[h]+a[h+3]),d=.5*(a[h+1]+a[h+4]),p=.5*(a[h+2]+a[h+5]);r.x=i*(u-n.x),r.y=i*(d-n.y),r.z=i*(p-n.z),e.updateAnimTransform(l,null,null,r)}}(l,i,t,c)}}},70422:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ModelIteratorBVH:()=>o});var n=i(10834),r=i(41434);function o(){var e,t,i,s,a,l=null,c=null,h=null,u=null,d=null,p=null,f=!0,m=!1,g=!1,v=new r.Box3,y=new r.Box3,b=!1,x=!0,_=null,E=null;function A(e){var n=p[e],r=i;for(1;r>t&&p[d[r-1]]>n;)d[r]=d[r-1],r--;d[r]=e,i++}function S(e){var t=l.getLeftChild(e);-1!==t&&(S(t),S(t+1)),v.makeEmpty(),-1!==t&&(l.getBoxThree(t,y),v.union(y),l.getBoxThree(t+1,y),v.union(y)),l.getPrimCount(e)&&(v.union(h[e].getBoundingBox()),v.union(h[e].getBoundingBoxHidden())),l.setBoxThree(e,v)}this.initialize=function(t,i,n,r){_=t,E=r,e=t.getFragmentList(),a=t.RenderBatch,r&&r.hasOwnProperty("prioritize_screen_size")&&(f=r.prioritize_screen_size),c=n,h=new Array(i.nodeCount),u=new Int8Array(i.nodeCount),l=i,d=new Int32Array(i.nodeCount+1),p=new Float32Array(i.nodeCount);for(var o=0;o<i.nodeCount;o++){var s=i.getPrimCount(o);s&&(h[o]=new a(e,c,i.getPrimStart(o),s),h[o].lastItem=h[o].start+s,h[o].numAdded=s,h[o].nodeIndex=o,8&i.getFlags(o)&&(h[o].sortObjects=!0),i.getBoxArray(o,h[o].bboxes))}},this.dtor=function(){a=null,e=null,_=null},this.addFragment=function(e,t){},this.reset=function(e){if(s=e,t=0,i=0,u[0]=u[1]=n.FrustumIntersector.CONTAINMENT_UNKNOWN,d[i++]=0,m=!1,g=!1,b=!1,x){let e=h,t=e.length;for(let i=0;i<t;++i){var r=e[i];r&&r.resetVisStatus&&r.resetVisStatus()}x=!1}},this.nextBatch=function(){for(g||m||t!==i||(d[i++]=1,m=!0);t!==i;){var e=d[--i],r=u[e];if(r!==n.FrustumIntersector.CONTAINS&&(l.getBoxThree(e,v),r=s.intersectsBox(v)),r!==n.FrustumIntersector.OUTSIDE){var o,a,c=l.getLeftChild(e);if(-1!==c){var y=l.getFlags(e),x=s.viewDir[3&y]<0?1:0,_=y>>2&1,E=y>>3&1,S=0,w=0;f&&!m?(o=c+_,a=c+1-_,l.getBoxThree(o,v),p[o]=S=s.projectedBoxArea(v,r===n.FrustumIntersector.CONTAINS),l.getBoxThree(a,v),p[a]=w=s.projectedBoxArea(v,r===n.FrustumIntersector.CONTAINS),u[o]=u[a]=r,S>0&&A(o),w>0&&A(a)):(1^x^E&&(_=1-_),o=c+_,a=c+1-_,d[i++]=o,p[o]=-1,d[i++]=a,p[a]=-1,u[o]=u[a]=r)}if(0!==l.getPrimCount(e)){var M=h[e];return M.renderImportance=s.projectedBoxArea(M.getBoundingBox(),r===n.FrustumIntersector.CONTAINS),M}}m||g||t!==i||(d[i++]=1,m=!0)}return b=!0,null},this.skipOpaqueShapes=function(){m||g||(t=0,i=0,d[i++]=1,g=!0)},this.getVisibleBounds=function(e,t){for(var i=0;i<h.length;i++){var n=h[i];if(n){n.calculateBounds();var r=n.getBoundingBox();e.union(r),t.union(r),t.union(n.getBoundingBoxHidden())}}S(0),S(1)},this.rayCast=function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var o=[1,0],s=new r.Vector3;o.length;){var a=o.pop();if(l.getBoxThree(a,v),v.expandByScalar(.5),!(n.maxDistance&&v.distanceToPoint(e.ray.origin)>n.maxDistance)){var c=e.ray.intersectBox(v,s);if(null!==c){var u=l.getLeftChild(a);-1!==u&&(o.push(u),o.push(u+1));var d=l.getPrimCount(a);if(0!==d){var p=h[a];p.raycast(e,t,i,n)}}}}},this.intersectFrustum=function(e,t){for(var i=[1,n.FrustumIntersector.CONTAINMENT_UNKNOWN,0,n.FrustumIntersector.CONTAINMENT_UNKNOWN];i.length;){var r,o=i.pop(),s=i.pop();if(o===n.FrustumIntersector.CONTAINS?r=n.FrustumIntersector.CONTAINS:(l.getBoxThree(s,v),r=e.intersectsBox(v)),r!==n.FrustumIntersector.OUTSIDE){var a=l.getLeftChild(s);if(-1!==a&&(i.push(a),i.push(r),i.push(a+1),i.push(r)),0!==l.getPrimCount(s)){var c=h[s];c&&c.intersectFrustum(e,t,r===n.FrustumIntersector.CONTAINS)}}}},this.getSceneCount=function(){return h.length},this.getGeomScenes=function(){return h},this.done=function(){return b},this.resetVisStatus=function(){x=!0},this.clone=function(){const e=new o;return e.initialize(_,l,c,E),e}}},91128:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ModelIteratorLinear:()=>o});i(42198);var n=i(16840),r=i(10834);class o{constructor(e){this._frags=e.getFragmentList(),this._RenderBatch=e.RenderBatch,this._model=e,this._is2d=this._model.is2d(),this._fragsPerScene=function(e){let t=500;return e&&(t/=6),(0,n.isMobileDevice)()&&(t/=3),t=Math.floor(t),t>0?t:500}(e.is2d()),this._fragOrder=[],this._geomScenes=[],this._secondPassIndex=null;const t=this._frags.getCount();this._currentScene=0;let i=new Int32Array(t);for(let e=0;e<t;e++)i[e]=e;this.setFragmentOrder(i,t)}dtor(){this.model=null,this._RenderBatch=null,this._frags=null}setFragmentOrder(e,t){this._fragCount=t,this._fragOrder[0]=e;var i=Math.floor((this._fragCount+this._fragsPerScene-1)/this._fragsPerScene);this._geomScenes.length=i;for(let e=0;e<i;e++){let t=e*this._fragsPerScene,i=this._geomScenes[e]=new this._RenderBatch(this._frags,this._fragOrder,t,this._fragsPerScene),n=t+this._fragsPerScene;n>this._fragCount&&(n=this._fragCount),i.lastItem=n,i.count=i.lastItem-t}}addFragment(e){if(this._fragOrder[0].length<=e){var t=2*this._fragOrder[0].length;t<=e&&(t=e+1);var i=new Int32Array(t);i.set(this._fragOrder[0]),this._fragOrder[0]=i,this.visibleBoundsDirty=!0}this._fragOrder[0][e]=e;var n=Math.floor(e/this._fragsPerScene);if(this._geomScenes){var r=this._geomScenes[n];r&&!r.isSecondPass||(r=new this._RenderBatch(this._frags,this._fragOrder,n*this._fragsPerScene,this._fragsPerScene),null===this._secondPassIndex?this._geomScenes[n]=r:this.insertSceneToSecondPass(n,r)),r&&(r.onFragmentAdded(e),null!==this._secondPassIndex&&this._geomScenes[this._secondPassIndex+n].onFragmentAdded(e))}}insertSceneToSecondPass(e,t){const i=this._geomScenes.slice(0,this._secondPassIndex),n=this._geomScenes.slice(this._secondPassIndex);i[e]=t,n[e]=this.cloneForSecondPass(t),this._secondPassIndex=i.length,this._geomScenes=i.concat(n)}reset(e,t){if(this._currentScene=0,this._is2d&&this._geomScenes[0]&&(this._geomScenes[0].drawEnd=0,null!==this._secondPassIndex&&(this._geomScenes[this._secondPassIndex].drawEnd=0)),this._resetVisStatus){let e=this._geomScenes,t=e.length;for(let n=0;n<t;++n){var i=e[n];i&&i.resetVisStatus&&i.resetVisStatus()}this._resetVisStatus=!1}}getSceneCount(){return this._geomScenes.length}getGeomScenes(){return this._geomScenes}resetVisStatus(){this._resetVisStatus=!0}done(){return!(this._is2d&&!this._model.isLoadDone())&&(this._currentScene>=this._geomScenes.length-1&&(!(e=this._geomScenes[this._currentScene])||e.drawStart>=e.lastItem));var e}nextBatch(){if(this._currentScene>=this.getSceneCount())return null;let e=this._geomScenes[this._currentScene];if(this._is2d){const t=this.areTwoPassesNeeded();if(e.lastItem>=e.start+e.count&&(++this._currentScene,this._geomScenes[this._currentScene]&&(this._geomScenes[this._currentScene].drawEnd=this._geomScenes[this._currentScene].start)),e.drawStart=e.drawEnd,e.drawEnd=e.lastItem,e.hasOwnProperty("drawStart")&&e.lastItem<=e.drawStart){return t&&!this._isSecondPass?(this._currentScene=this._secondPassIndex,this.nextBatch()):null}const i=!this._model.areAllVisible()||this._isSecondPass;e.renderImportance=i?-1:1e20,e.needsTwoPasses=t}else e.renderImportance=0,++this._currentScene;return e}areTwoPassesNeeded(){const e=this._model.hasPaperTransparency();return e&&null===this._secondPassIndex&&this.addSecondPassScenes(),this._isSecondPass=!!(e&&this._currentScene>=this._secondPassIndex),e}cloneForSecondPass(e){if(!e)return;const t=e.clone();return t.isSecondPass=!0,t}addSecondPassScenes(){const e=this._geomScenes.length;e&&(this._geomScenes=this._geomScenes.concat(this._geomScenes.map(this.cloneForSecondPass)),this._secondPassIndex=e)}getVisibleBounds(e,t){for(var i=this.getSceneCount(),n=0;n<i;n++){this._geomScenes[n].calculateBounds();var r=this._geomScenes[n].getBoundingBox();e.union(r),t.union(r),t.union(this._geomScenes[n].getBoundingBoxHidden())}}rayCast(e,t,i){for(var n=this.getSceneCount(),r=0;r<n;r++)this._geomScenes[r].raycast(e,t,i)}intersectFrustum(e,t){for(let i of this._geomScenes){if(!i)continue;let n=e.intersectsBox(i.getBoundingBox());n!==r.FrustumIntersector.OUTSIDE&&i.intersectFrustum(e,t,n===r.FrustumIntersector.CONTAINS)}}clone(){return new o(this._model)}}},42198:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RenderBatch:()=>d});var n=i(20806),r=i(10834),o=i(41723),s=i(34423),a=i(49720),l=i(39651),c=(i(41434),i(93033),i(51187),i(29996)),h=new l.LmvBox3,u=null;function d(e,t,i,n){this.frags=e,this.indices=t,this.start=i,this.count=n,this.lastItem=i,this.overrideMaterial=null,this.sortDone=!1,this.numAdded=0,this.avgFrameTime=void 0,this.nodeIndex=void 0,this.bboxes=new Array(12),this.bboxes[0]=this.bboxes[1]=this.bboxes[2]=1/0,this.bboxes[3]=this.bboxes[4]=this.bboxes[5]=-1/0,this.bboxes[6]=this.bboxes[7]=this.bboxes[8]=1/0,this.bboxes[9]=this.bboxes[10]=this.bboxes[11]=-1/0,this.sortObjects=!1,this.sortDone=!1,this.sortByShaderDone=!1,this.frustumCulled=!0,this.forceVisible=!1,this.renderImmediate=!e.useThreeMesh,this.renderImportance=0}function p(e,t,i,n,r){var a,l=o.MeshFlags.MESH_RENDERFLAG,c=t[i]&~l;switch(e){case s.RenderFlags.RENDER_HIDDEN:a=!(c&o.MeshFlags.MESH_VISIBLE);break;case s.RenderFlags.RENDER_HIGHLIGHTED:a=c&o.MeshFlags.MESH_HIGHLIGHTED;break;default:a=1==(c&(o.MeshFlags.MESH_VISIBLE|o.MeshFlags.MESH_HIGHLIGHTED|o.MeshFlags.MESH_HIDE))}if(n){var h=c&(o.MeshFlags.MESH_ISLINE|o.MeshFlags.MESH_ISWIDELINE);a=a&&!h}if(r){var u=c&o.MeshFlags.MESH_ISPOINT;a=a&&!u}return t[i]=c|(a?l:0),a}function f(e,t,i,n,r){var o=!1;return i.getWorldBounds(n,h),e&&!t.intersectsBox(h)&&(o=!0),c.ENABLE_PIXEL_CULLING&&!o&&t.estimateProjectedDiameter(h)<t.areaCullThreshold&&(o=!0),o||r||!t.boxOutsideCutPlanes(h)||(o=!0),o}d.prototype.clone=function(){const e=new d(this.frags,this.indices,this.start,this.count);return e.sortDone=this.sortDone,e.sortByShaderDone=this.sortByShaderDone,e.lastItem=this.lastItem,e.visibleStats=this.visibleStats,e.numAdded=this.numAdded,e.bboxes=this.bboxes.slice(),e},d.prototype.getIndices=function(){return Array.isArray(this.indices)?this.indices[0]:this.indices},d.prototype.sortByMaterial=function(){if(!(this.numAdded<this.count)){var e=this.frags,t=this.getIndices();if(t){var i=t.subarray(this.start,this.start+this.count);Array.prototype.sort.call(i,(function(t,i){var n=e.getMaterialId(t),r=e.getMaterialId(i);return void 0===n?r?1:0:void 0===r?-1:n-r})),this.numAdded=0,this.sortDone=!0}else a.logger.warn("Only indexed RenderSubsets can be sorted.")}},d.prototype.sortByShader=function(){if(this.sortDone&&!this.sortByShaderDone){var e=this.frags,t=this.getIndices().subarray(this.start,this.start+this.count);Array.prototype.sort.call(t,(function(t,i){var n=e.getMaterial(t),r=e.getMaterial(i),o=n.program.id-r.program.id;return o||n.id-r.id})),this.numAdded=0,this.sortByShaderDone=!0}},d.prototype.sortByDepth=function(e){var t=this.frags,i=this.getIndices(),n=e,r=h;if(i){(!u||u.length<this.count)&&(u=new Float32Array(this.count));var o,s,l=u,c=this.start;this.forEachNoMesh(((e,i)=>{t.getGeometry(e)?(t.getWorldBounds(e,r),l[i]=n.estimateDepth(r)):l[i]=-1/0}));for(var d=1;d<this.count;d++)for(var p=d;p>0&&l[p-1]<l[p];)o=l[p-1],l[p-1]=l[p],l[p]=o,s=i[c+p-1],i[c+p-1]=i[c+p],i[c+p]=s,p--}else a.logger.warn("Only indexed RenderSubsets can be sorted.")},d.prototype.addToBox=function(e,t){var i=t?6:0,n=this.bboxes;n[0+i]=Math.min(n[0+i],e.min.x),n[1+i]=Math.min(n[1+i],e.min.y),n[2+i]=Math.min(n[2+i],e.min.z),n[3+i]=Math.max(n[3+i],e.max.x),n[4+i]=Math.max(n[4+i],e.max.y),n[5+i]=Math.max(n[5+i],e.max.z)},d.prototype.getBoundingBox=function(e){e=e||h;var t=this.bboxes;return e.min.x=t[0],e.min.y=t[1],e.min.z=t[2],e.max.x=t[3],e.max.y=t[4],e.max.z=t[5],e},d.prototype.getBoundingBoxHidden=function(e){e=e||h;var t=this.bboxes;return e.min.x=t[6],e.min.y=t[7],e.min.z=t[8],e.max.x=t[9],e.max.y=t[10],e.max.z=t[11],e},d.prototype.onFragmentAdded=function(e){this.frags.getWorldBounds(e,h),this.addToBox(h,!1),this.sortDone=!1,this.lastItem<=e&&(this.lastItem=e+1,void 0!==this.visibleStats&&(this.visibleStats=0)),this.numAdded++},d.prototype.forEach=function(e,t,i){var n,r,s,a=this.getIndices(),l=this.frags,h=!this.sortByShaderDone;if(t||i||h)for(n=t===o.MeshFlags.MESH_RENDERFLAG&&this.hasOwnProperty("drawStart")?this.drawStart:this.start,r=this.lastItem;n<r;n++){s=a?a[n]:n;u=l.getVizmesh(s);if(!h||u&&u.material&&u.material.program&&!u.geometry_proxy||(h=!1),(i||u&&u.geometry)&&(!t||l.isFlagSet(s,t))){if(c.useGpuGeometryList&&u.geometry){const e=l.geoms.getGpuGeometry(l.geomids[s],!0);e&&(u.geometry=e)}e(u,s)}}else for(n=this.start,r=this.lastItem;n<r;n++){var u;s=a?a[n]:n,(u=l.getVizmesh(s))&&u.geometry&&e(u,s)}h&&this.sortByShader()},d.prototype.forEachNoMesh=function(e,t,i){for(var n=this.getIndices(),r=this.frags,o=this.start,s=this.lastItem;o<s;o++){var a,l=n?n[o]:o;if(r.useThreeMesh){var c=r.getVizmesh(l);c&&(a=c.geometry)}else a=r.getGeometry(l);!i&&!a||t&&!r.isFlagSet(l,t)||e(l,o-this.start)}},d.prototype.raycast=function(e,t,i,r){!1!==e.ray.intersectsBox(this.getBoundingBox())&&this.forEach(((s,a)=>{if(!this.frags.isFlagSet(a,o.MeshFlags.MESH_HIDE)){if(i&&i.length){var l=0|this.frags.getDbIds(a);if(-1===i.indexOf(l))return}this.frags.getWorldBounds(a,h),h.expandByScalar(.5),e.ray.intersectsBox(h)&&n.VBIntersector.rayCast(s,e,t,r)}}),o.MeshFlags.MESH_VISIBLE)},d.prototype.intersectFrustum=function(e,t,i){if(!i){let t=e.intersectsBox(this.getBoundingBox());if(t===r.FrustumIntersector.OUTSIDE)return;t===r.FrustumIntersector.CONTAINS&&(i=!0)}this.forEach(((n,s)=>{if(this.frags.isFlagSet(s,o.MeshFlags.MESH_HIDE))return;if(i)return void t(s,i);this.frags.getWorldBounds(s,h);let a=e.intersectsBox(h);a!==r.FrustumIntersector.OUTSIDE&&t(s,a===r.FrustumIntersector.CONTAINS)}),o.MeshFlags.MESH_VISIBLE)},d.prototype.calculateBounds=function(){this.bboxes[0]=this.bboxes[1]=this.bboxes[2]=1/0,this.bboxes[3]=this.bboxes[4]=this.bboxes[5]=-1/0,this.bboxes[6]=this.bboxes[7]=this.bboxes[8]=1/0,this.bboxes[9]=this.bboxes[10]=this.bboxes[11]=-1/0,this.forEachNoMesh((e=>{this.frags.getWorldBounds(e,h);var t=this.frags.vizflags[e];this.addToBox(h,!(1&t))}),0,!0)},d.prototype.applyVisibility=function(){var e,t,i,n,l,h,u;function d(r,s){if((r||!e.useThreeMesh)&&r.geometry){if(f(l,i,e,s,u))return r?r.visible=!1:a.logger.warn("Unexpected null mesh"),void(t[s]=t[s]&~o.MeshFlags.MESH_RENDERFLAG);var c=p(n,t,s,e.linesHidden,e.pointsHidden);r&&(r.visible=!!c),h=h&&!c}}function m(r){if(e.getGeometryId(r))if(f(l,i,e,r,u))t[r]=t[r]&~o.MeshFlags.MESH_RENDERFLAG;else{var s=p(n,t,r,e.linesHidden,e.pointsHidden);h=h&&!s}}return function(o,a){h=!0,i=a;var p=(n=o)===s.RenderFlags.RENDER_HIDDEN?this.getBoundingBoxHidden():this.getBoundingBox(),f=i.intersectsBox(p);return f===r.FrustumIntersector.OUTSIDE||c.ENABLE_PIXEL_CULLING&&i.estimateProjectedDiameter(p)<i.areaCullThreshold||!(u=this.frags.doNotCut)&&a.boxOutsideCutPlanes(p)||(t=this.frags.vizflags,e=this.frags,l=f!==r.FrustumIntersector.CONTAINS,e.useThreeMesh?this.forEach(d,null):this.forEachNoMesh(m,0,!1),e=null),h}}()},34423:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RenderFlags:()=>n});var n={RENDER_NORMAL:0,RENDER_HIGHLIGHTED:1,RENDER_HIDDEN:2,RENDER_SHADOWMAP:3,RENDER_FINISHED:4}},60485:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RenderModel:()=>A});var n=i(29996),r=i(1454),o=i(22769),s=i(29865);class a extends r.GeometryList{constructor(e,t,i,r){super(e,t,i,r),this.geomid2gpuRange=[null],this.gpuGeoms=[],this.scratchGeoms=[],this.vlayoutId=0,(0,n.disableGpuObjectLimit)()}addGeometry(e,t,i){if(i=super.addGeometry(e,t,i),e.ignoreForBatching=!this.canHandleGeom(e),e.ignoreForBatching||e.streamingDraw)return;const n=this.getScratchGeom(e);let r,o,s,a,l,c;this.hasEnoughRoom(n,e)||this.flushGeom(n),r=n.vbstride,o=n.vb,s=e.vb,a=n.ib,l=e.ib,c=e.iblines,o.set(s,n.vCount*r);for(let e=0;e<l.length;e++)a[n.iCount+e]=l[e]+n.vCount;for(let e=0;e<(null===(h=c)||void 0===h?void 0:h.length);e++){var h;n.iblinesShadow[n.ilCount+e]=c[e]+n.vCount}const u={vlayoutId:n.vlayoutId,gpuGeomId:n.gpuGeomId,iStart:n.iCount,iCount:l.length,ilStart:c?n.ilCount:void 0,ilCount:c?c.length:void 0};this.geomid2gpuRange[i]=u,n.vCount+=s.length/r,n.iCount+=l.length,n.vbNeedsUpdate=!0,n.ibNeedsUpdate=!0,c&&(n.ilCount+=c.length,n.iblines=n.iblinesShadow,n.iblinesNeedsUpdate=!0,e.attributes.indexlines&&!n.attributes.indexlines&&(n.attributes.indexlines=e.attributes.indexlines))}printStats(){this.finish(),super.printStats()}finish(){for(const e of this.scratchGeoms)e.vCount>0&&this.flushGeom(e);for(let e=0;e<this.gpuGeoms.length;e++){this.gpuGeoms[e].pop().dispose()}this.scratchGeoms=[],this.vlayoutId=0}canHandleGeom(e){var t,i,n,r;let o,s;return o=null===(t=e.attributes)||void 0===t||null===(i=t.index)||void 0===i?void 0:i.bytesPerItem,s=null===(n=e.attributes)||void 0===n||null===(r=n.indexlines)||void 0===r?void 0:r.bytesPerItem,2==o&&(!s||2==s)}getScratchGeom(e){for(const t of this.scratchGeoms)if((0,s.canBeMerged)(t,e))return t;const t=this.createNewScratchGeom(e);return this.scratchGeoms.push(t),this.gpuGeoms[t.vlayoutId]=[t],t}createNewScratchGeom(e){const t=(0,o.createBufferGeometry)();let i,n,r;t.vlayoutId=this.vlayoutId++,t.gpuGeomId=0,t.isLines=e.isLines,t.attributesKeys=e.attributesKeys,i=e.vbstride;const s=65536;return n=new Float32Array(s*i),r=new Uint16Array(262144),t.iblinesShadow=new Uint16Array(131072),t.attributes=Object.assign({},e.attributes),t.vbstride=i,t.vb=n,t.ib=r,t.vCount=0,t.iCount=0,t.ilCount=0,t}hasEnoughRoom(e,t){let i,n,r,o,s,a;return i=e.vbstride,n=e.vb,r=t.vb,o=e.ib,s=t.ib,a=t.iblines,e.vCount*i+r.length<n.length&&e.iCount+s.length<o.length&&(!a||e.ilCount+a.length<e.iblinesShadow.length)}flushGeom(e){var t=(0,o.createBufferGeometry)();return t.vlayoutId=e.vlayoutId,t.isLines=e.isLines,t.vbstride=e.vbstride,t.attributes=Object.assign({},e.attributes),t.vb=e.vb.slice(0,e.vCount*t.vbstride),t.ib=e.ib.slice(0,e.iCount),e.ilCount&&(t.iblines=e.iblines.slice(0,e.ilCount)),this.gpuGeoms[t.vlayoutId].splice(-1,0,t),e.vCount=0,e.iCount=0,e.ilCount=0,e.iblines=null,delete e.attributes.indexlines,++e.gpuGeomId,t}getGpuGeometrySortKey(e){const t=this.geomid2gpuRange[e];return t?65536*t.vlayoutId+t.gpuGeomId:4294967295}getGpuGeometry(e,t){const i=this.geomid2gpuRange[e];if(!i)return null;const n=this.gpuGeoms[i.vlayoutId][i.gpuGeomId];if(!n)return null;if(t){n.groups=n.groups||[];const e=n.groups[0]=n.groups[0]||{materialIndex:0,index:0};e.start=i.iStart,e.count=i.iCount,e.edgeStart=i.ilStart,e.edgeCount=i.ilCount}return n.starts=[],n.counts=[],n.edgeStarts=[],n.edgeCounts=[],n}addGpuGroup(e,t){const i=this.geomid2gpuRange[t];i&&(e.starts.push(2*i.iStart),e.counts.push(i.iCount),i.ilCount>0&&(e.edgeStarts.push(2*i.ilStart),e.edgeCounts.push(i.ilCount)))}hasEdges(e){const t=this.geomid2gpuRange[e];return!!t&&t.ilCount>0}}var l=i(55339),c=i(42198),h=i(16697),u=i(88816),d=i(91128),p=i(70422),f=i(20806),m=i(41434),g=i(41723),v=i(34423),y=i(49720),b=i(98500),x=i(7452);var _=(()=>{const e=new m.Vector4;return(t,i)=>{e.copy(t);for(let t=0;t<i.length;t++)if(i[t].dot(e)>1e-6)return!0;return!1}})(),E=1;function A(){var e=new m.Box3,t=new m.Box3,i=new m.Box3;this.visibleBoundsDirty=!1,this.enforceBvh=!1;var o=0;this.id=E++;var s=null,A=null,S=null,w=null,M=null,T=null,C=null,P=null,D=0,L=null,I=v.RenderFlags.RENDER_NORMAL,R=!1;let O=null,N=null,k=null;this._placementTransform,this._globalOffset,this._invPlacementWithOffset,this.getGeometryList=function(){return s},this.getFragmentList=function(){return A},this.getModelId=function(){return this.id},this.RenderBatch=c.RenderBatch;let F=!1;this.initialize=function(){var i=this.getData(),o=i.numGeoms||0,c=!function(e,t,i){return!(e&&e-3*t*2<=n.GPU_MEMORY_LIMIT&&i<n.GPU_OBJECT_LIMIT)}(i.packFileTotalSize,i.primitiveCount,o);s=n.useGpuGeometryList?new a(o,this.is2d(),c,this.isOTG()):new r.GeometryList(o,this.is2d(),c,this.isOTG()),A=new l.FragmentList(this);var h=this.getBoundingBox();h&&(e.copy(h),t.copy(h)),M=S=new d.ModelIteratorLinear(this)},this.getIterator=function(){return M},this.initFromCustomIterator=function(e){M=e,this.visibleBoundsDirty=!0},this.dtor=function(e){s=null,A&&(A.dtor(e),A=null),M&&M.dtor&&(M.dtor(),M=null),S&&(S.dtor(),S=null),C&&(C.dispose(),C=null),this.dispose()},this.activateFragment=function(n,r,o){A&&(A.setMesh(n,r,o),M.addFragment(n),A.getWorldBounds(n,i),e.union(i),t.union(i))},this.setFragment=function(n,r,o){return void 0===n&&(n=this.getFragmentList().getNextAvailableFragmentId()),A.setMesh(n,r,!0,o),S&&S.addFragment(n),w&&!A.fragmentsHaveBeenAdded()&&w.addFragment(n),A.getWorldBounds(n,i),e.union(i),t.union(i),n},this.setBVH=function(e,t,i){var n;(M=w=new p.ModelIteratorBVH).initialize(this,e,t,i),null!==(n=A)&&void 0!==n&&n.matrix&&this.invalidateBBoxes()},this.resetIterator=function(e,t,i){return R=!1,w&&!A.fragmentsHaveBeenAdded()&&(R=!0),R?M=w:S&&(M=S),D=0,I=i,L=t,M.reset(t,e),C&&C.reset(),M},this.setRaycastIterator=function(i){var n;null===(n=T=i)||void 0===n||n.getVisibleBounds(e,t,!0)},this.getRaycastIterator=function(){return T},this.nextBatch=function(){for(;;){var e=M.nextBatch();if(D++,!e)return null;if(!(C&&e instanceof c.RenderBatch)||(e=C.consolidateNextBatch(e,L,I))){if(e.modelId=this.id,e instanceof m.Scene)return e;if(!this.applyVisibility(e,I,L))return e}}},this.applyVisibility=function(e,t,i){var n=e.applyVisibility(t,i);return n||this.is2d()||(e.sortObjects&&!this.getFragmentList().useThreeMesh?e.sortByDepth(i):e.sortDone||e.sortByMaterial()),n},this.trimPageShadowGeometry=function(e){if(this.hasPageShadow()){const t=Autodesk.Viewing.Private.F2dShadowRatio;e=e.clone();const i=this.getMetadata("page_dimensions","page_width");e.max.x-=i*t,e.min.y+=i*t}return e},this.getVisibleBounds=function(i,n){var r;this.visibleBoundsDirty&&(e.makeEmpty(),t.makeEmpty(),M.getVisibleBounds(e,t,i),null===(r=T)||void 0===r||r.getVisibleBounds(e,t,i),this.visibleBoundsDirty=!1);let o=i?t:e;return n&&(o=this.trimPageShadowGeometry(o)),o},this.rayIntersect2D=(()=>{const e=new m.Plane,t=new m.Vector3;return(i,n,r,o)=>{const s=this.getBoundingBox(!0),a=s.getCenter(new m.Vector3);let l=new m.Vector3;e.normal.set(0,0,1),e.constant=-a.z;const c=this.getModelToViewerTransform();if(c&&e.applyMatrix4(c),l=i.ray.intersectPlane(e,l),l){t.copy(l);const e=this.getInverseModelToViewerTransform();if(e&&(t.applyMatrix4(e),t.z=a.z),s.containsPoint(t)){var h,u;const e=null===(h=A)||void 0===h||null===(u=h.getMaterial(0))||void 0===u?void 0:u.cutplanes;if(e&&_(l,e))return;const t=i.ray.origin.distanceTo(l);if(t<i.near||t>i.far)return;let s,a;if(o){const e=o(l);if(s=e[0],n&&n.length>0&&!n.includes(s))return;const t=e[1];if(0!==t&&t!==this.id)return;var d;a=null===(d=A)||void 0===d?void 0:d.fragments.dbId2fragId[s]}const c={intersectPoint:l,point:l,distance:t,dbId:s&&this.remapDbIdFor2D(s),fragId:a,model:this};return r&&r.push(c),c}}}})(),this.rayIntersect=function(e,t,i,n,r,o){if(this.ignoreRayIntersect)return null;if(this.is2d())return this.rayIntersect2D(e,i,n,r);this.visibleBoundsDirty&&this.getVisibleBounds();var s,a=[];if(i&&i.length>0){var l=this.getInstanceTree(),c=[];if(l)for(s=0;s<i.length;s++)l.enumNodeFragments(i[s],(function(e){c.push(e)}),!0);else c=i;if(c.length>2){(T||M).rayCast(e,a,i)}else for(s=0;s<c.length;s++){var h=A.getVizmesh(c[s]);if(h){var u=f.VBIntersector.rayCast(h,e,a,o);u&&a.push(u)}}}else{(T||M).rayCast(e,a,void 0,o)}if(!a.length)return null;a.sort((function(e,t){return e.distance-t.distance}));var d=!!n;for(n=n||[],s=0;s<a.length;s++){var p=a[s].fragId;if(this.isFragVisible(p)){var m=A.getMaterial(p);if(t&&m.transparent)continue;var g=a[s],v=!1;if(m&&m.cutplanes&&(v=_(g.point,m.cutplanes)),v||n.push(g),g.model=this,!d&&n.length>0)break}}var y=n[0]||null;return y&&(y.model=this),y},this.setHighlighted=function(e,t){if(!A)return!1;var i=A.setFlagFragment(e,g.MeshFlags.MESH_HIGHLIGHTED,t);return i&&(t?o++:o--),i},this.setVisibility=function(e,t){A?A.setVisibility(e,t):this.isLeaflet()&&M.setVisibility(t),this.invalidateBBoxes()},this.setAllVisibility=function(e){A?A.setAllVisibility(e):this.isLeaflet()&&M.setVisibility(e),this.invalidateBBoxes()},this.hideLines=function(e){A&&A.hideLines(e)},this.hidePoints=function(e){A&&A.hidePoints(e)},this.hasHighlighted=function(){return!!o},this.isFragVisible=function(e){return A.isFragVisible(e)},this.areAllVisible=function(){return!A||A.areAllVisible()},this.getGeomScenes=function(){return M&&M.getGeomScenes?M.getGeomScenes():[]},this.getRenderProgress=function(){var e=D/M.getSceneCount();return e>1?1:e},this.update=function(e){return!(!M||!M.update)&&M.update(e)},this.setThemingColor=function(e,t,i){if(A){e=this.reverseMapDbIdFor2D(e);var n=this.getInstanceTree();i&&n?n.enumNodeChildren(e,(function(e){A.setThemingColor(e,t)}),!0):A.setThemingColor(e,t)}else M.isModelIteratorTexQuad?M.setThemingColor(t):y.logger.warn("Theming colors are not supported by this model type.")},this.clearThemingColors=function(){A?A.clearThemingColors():M.isModelIteratorTexQuad&&M.clearThemingColor()},this.getLeaflet=function(){return M.isModelIteratorTexQuad?M:null},this.consolidate=function(e,t,i){var n=(0,h.consolidateFragmentList)(this,e,t,i,P);C=new u.ConsolidationIterator(A,n),P=n.consolidationMap},this.unconsolidate=function(){C&&(C.dispose(),C=null)},this.isConsolidated=function(){return!!C},this.getConsolidation=function(){return C?C.getConsolidation():null},this.setDbIdRemap=function(e){this.idRemap=e},this.remapDbId=function(e){return this.idRemap&&e>0&&e<this.idRemap.length?this.idRemap[e]:e},this.remapDbIdFor2D=function(e){return this.is2d()?this.remapDbId(e):e},this.reverseMapDbId=function(e){if(!this.idRemap||e<=0)return e;if(!this.reverseMap){this.reverseMap={};for(var t=0;t<this.idRemap.length;t++)this.reverseMap[this.idRemap[t]]=t}return this.reverseMap[e]},this.reverseMapDbIdFor2D=function(e){return this.is2d()?this.reverseMapDbId(e):e},this.updateRenderProxy=function(e,t){C&&C.updateRenderProxy(e,t)},this.skipOpaqueShapes=function(){M&&M.skipOpaqueShapes&&M.skipOpaqueShapes()},this.invalidateBBoxes=function(){this.visibleBoundsDirty=!0},this.changePaperVisibility=function(e){var t;this.is2d()&&(null===(t=A)||void 0===t||t.setObject2DVisible(-1,e))},this.hasPaperTransparency=function(){var e;if(!this.is2d())return!1;const t=(null===(e=A)||void 0===e?void 0:e.dbIdOpacity[-1])??1;return t>0&&t<1},this.setModelTransform=function(e){M.isModelIteratorTexQuad?M.setModelMatrix(e):(A.setModelMatrix(e),C&&C.modelMatrixChanged()),this.invalidateBBoxes(),this.getVisibleBounds(!0),N=null,k=null},this.getModelTransform=function(){var e,t;return null!==(e=M)&&void 0!==e&&e.isModelIteratorTexQuad?M.getModelMatrix():null===(t=A)||void 0===t?void 0:t.matrix},this.getInverseModelTransform=function(){var e,t;return null!==(e=M)&&void 0!==e&&e.isModelIteratorTexQuad?M.getInverseModelMatrix():null===(t=A)||void 0===t?void 0:t.getInverseModelMatrix()},this.getPlacementTransform=function(){return O=O||new b.LmvMatrix4(!0),this._placementTransform||this.getData().placementTransform||O},this.getGlobalOffset=function(){return this._globalOffset||this.getData().globalOffset},this.setPlacementTransform=function(e){this._placementTransform=(this._placementTransform||new b.LmvMatrix4(!0)).copy(e),x.DynamicGlobalOffset.updateModelMatrix(this,e,this.getGlobalOffset())},this.setGlobalOffset=function(e){this._globalOffset=this._globalOffset||new m.Vector3,this._globalOffset.copy(e);var t=this.getPlacementTransform();x.DynamicGlobalOffset.updateModelMatrix(this,t,e)},this.getModelToViewerTransform=function(){var e;if(N)return N;const t=this.getModelTransform(),i=null===(e=this.getData())||void 0===e?void 0:e.placementWithOffset;return(t||i)&&(N=new m.Matrix4,t&&N.multiply(t),i&&N.multiply(i)),N},this.getInverseModelToViewerTransform=function(){if(k)return k;const e=this.getModelToViewerTransform();return e&&(k=e.clone().invert()),k},this.getInversePlacementWithOffset=function(){return this.myData.placementWithOffset?(this._invPlacementWithOffset||(this._invPlacementWithOffset=new b.LmvMatrix4(!0).copy(this.myData.placementWithOffset).invert()),this._invPlacementWithOffset):null},this.setInnerAttributes=function(n){var r;(this.id=n._id,e=n._visibleBounds,t=n._visibleBoundsWithHidden,i=n._tmpBox,this.enforceBvh=n._enforceBvh,o=n._numHighlighted,s=n._geoms,A=n._frags,P=n._consolidationMap,D=n._renderCounter,L=n._frustum,I=n._drawMode,R=n._bvhOn,this.idRemap=n._idRemap,this._reverseMap=n._reverseMap,!S&&n._linearIterator&&(S=n._linearIterator.clone(),n._linearIterator===n._iterator&&(M=S)),!w&&n._bvhIterator&&(w=n._bvhIterator.clone(),n._bvhIterator===n._iterator&&(M=w)),!C&&n._consolidationIterator&&(C=n._consolidationIterator.clone()),M)||(M=null!==(r=n._iterator)&&void 0!==r&&r.clone?n._iterator.clone():n._iterator)},this.getInnerAttributes=function(){return{_id:this.id,_visibleBounds:e,_visibleBoundsWithHidden:t,_tmpBox:i,_enforceBvh:this.enforceBvh,_numHighlighted:o,_geoms:s,_frags:A,_linearIterator:S,_bvhIterator:w,_iterator:M,_consolidationIterator:C,_consolidationMap:P,_renderCounter:D,_frustum:L,_drawMode:I,_bvhOn:R,_idRemap:this.idRemap,_reverseMap:this.reverseMap}},this.setDoNotCut=function(e,t){if(F===t)return;F=t,A?A.setDoNotCut(t):this.isLeaflet()&&M.setDoNotCut(t);e.forEachInModel(this,!1,(i=>{var n;i.doNotCut=t;(null===(n=i.cutplanes)||void 0===n?void 0:n.length)>0===t&&(e._applyCutPlanes(i),i.needsUpdate=!0)}))},this.getDoNotCut=function(){return F},this.setViewportBounds=function(e,t){this.isLeaflet()?M.setViewBounds(t):A&&(t=t||this.isPdf()&&this.getBoundingBox(!0,!0),A.setViewBounds(t),e.setViewportBoundsForModel(this,t)),this.invalidateBBoxes()},this.getViewportBounds=function(){var e;return this.isLeaflet()?M.getViewBounds():null===(e=A)||void 0===e?void 0:e.getViewBounds()}}},9038:(e,t,i)=>{"use strict";i.r(t),i.d(t,{RenderScene:()=>c});var n=i(29996),r=i(10834),o=i(41434),s=i(34423),a=i(11613),l=i(84302);function c(){var e=!1,t=!1,i=[],c=[],h=[],u=new o.Box3,d=[],p=new r.FrustumIntersector,f=new o.Raycaster,m=performance;this.enableNonResumableFrames=!1,this.budgetForTransparent=.1;var g=!1,v=[],y=null;function b(e,t){for(var i=0;i<e.length;i++){var n=e[i];if(n&&n.id===t)return n}return null}function x(e,t){void 0===e.avgFrameTime?e.avgFrameTime=t:e.avgFrameTime=.8*e.avgFrameTime+.2*t}this.frustum=function(){return p},this.findModel=function(e){return b(i,e)},this.findHiddenModel=function(e){return b(d,e)},this.addModel=function(e){-1===i.indexOf(e)&&(i.push(e),c.length=i.length,h.length=i.length,this.recomputeLinePrecision())},this.removeModel=function(e){var t=i.indexOf(e);return t>=0&&i.splice(t,1),c.length=i.length,h.length=i.length,this.recomputeLinePrecision(),t>=0},this.addHiddenModel=function(e){var t=d.indexOf(e);return t<0&&d.push(e),t<0},this.removeHiddenModel=function(e){var t=d.indexOf(e);return t>=0&&d.splice(t,1),t>=0},this.isEmpty=function(){return 0===i.length},this.needsRender=function(){return e},this.resetNeedsRender=function(){e=!1},this.recomputeLinePrecision=function(){var e=1;const t=new o.Vector3;for(var n=0,r=i.length;n<r;++n){var s=i[n].getData().bbox;if(0!==s.getSize(t).length()){var a=.001*o.Box3.prototype.getBoundingSphere.call(s,new o.Sphere).radius;e=Math.min(e,a)}}f.params.Line.threshold=e},this.frameResumePossible=function(){return!g},this.renderSome=function(e,n){for(var r,o,s=m.now(),a=this.budgetForTransparent*n;;){for(var l=0,h=null,u=0;u<c.length;u++){var d=c[u];if(o=i[u],d||(c[u]=d=o.nextBatch()),g&&n<a)d&&!d.sortObjects&&(o.skipOpaqueShapes(),c[u]=d=o.nextBatch());if(null===d)continue;h||(l=u,h=d);const e=d.sortObjects==h.sortObjects&&d.renderImportance>h.renderImportance,t=!d.sortObjects&&h.sortObjects;(e||t)&&(l=u,h=d)}if(!h){t=!0;break}if(c[l]=i[l].nextBatch(),h.sortObjects&&g)v.push(h),n-=void 0===h.avgFrameTime?.05:h.avgFrameTime;else{e(h),h.hasOwnProperty("drawEnd")&&(h.drawEnd=h.lastItem);var p=(r=m.now())-s;s=r,x(h,p),n-=h.avgFrameTime}if(n<=0)break}return v.length>0&&(!function(e,t,i){var n,r;for(n=0;n<e.length;n++){var o=(r=e[n]).boundingBox||r.getBoundingBox();r.cameraDistance=o.distanceToPoint(t.position)}e.sort((function(e,t){return t.cameraDistance-e.cameraDistance}));var s=performance.now();for(n=0;n<e.length;n++){i(r=e[n]);var a=performance.now(),l=a-s;s=a,x(r,l)}}(v,y,e),v.length=0),n},this.reset=function(e,r,o,l){if(t=!1,this.resetNeedsRender(),p.reset(e,l),p.areaCullThreshold=n.PIXEL_CULLING_THRESHOLD,i.length){g=this.enableNonResumableFrames&&o==a.ResetFlags.RESET_RELOAD&&r===s.RenderFlags.RENDER_NORMAL,y=e;for(var u=0;u<i.length;u++)i[u].resetIterator(e,p,r,o),c[u]=i[u].nextBatch(),h[u]=null}},this.isDone=function(){return t||this.isEmpty()},this.setAllVisibility=function(e){for(var t=0;t<i.length;t++)i[t].setAllVisibility(e)},this.hideLines=function(e){for(var t=0;t<i.length;t++)i[t].hideLines(e)},this.hidePoints=function(e){for(var t=0;t<i.length;t++)i[t].hidePoints(e)},this.hasHighlighted=function(){for(var e=0;e<i.length;e++)if(i[e].hasHighlighted())return!0;return!1},this.areAllVisible=function(){for(var e=0;e<i.length;e++)if(!i[e].areAllVisible())return!1;return!0},this.areAll2D=function(){for(var e=0;e<i.length;e++)if(!i[e].is2d())return!1;return!0},this.areAll3D=function(){for(var e=0;e<i.length;e++)if(!i[e].is3d())return!1;return!0},this.invalidateVisibleBounds=function(){for(var e=0;e<i.length;e++)i[e].visibleBoundsDirty=!0},this.getVisibleBounds=function(e,t,n){u.makeEmpty();for(var r=0;r<i.length;r++){var o=i[r].getVisibleBounds(e,n);t&&!t(o)||u.union(o)}return u},this.rayIntersect=function(e,t,n,r,o,s,a,l){if(f.set(e,t),i.length>1){const e=[];if(o)for(let t=0;t<o.length;t++){const i=this.findModel(o[t]);if(i){const o=r&&r[t],c=i.rayIntersect(f,n,o,s,a,l);c&&e.push(c)}}else for(let t=0;t<i.length;t++){const o=i[t].rayIntersect(f,n,r,s,a,l);o&&e.push(o)}return e.length?(e.sort((function(e,t){return e.distance-t.distance})),e[0]):null}{if(!i.length)return null;const e=i[0];return o&&-1===o.indexOf(e.id)?null:e.rayIntersect(f,n,r,s,a,l)}},this.getRenderProgress=function(){return i[0].getRenderProgress()},this.getModels=function(){return i},this.getHiddenModels=function(){return d},this.getAllModels=function(){return i.concat(d)},this.getFragmentList=function(){return i[0].getFragmentList()},this.getGeometryList=function(){return i[0].getGeometryList()},this.getSceneCount=function(){return i[0].getSceneCount()},this.getGeomScenes=function(){for(var e=[],t=0;t<i.length;t++)for(var n=i[t].getGeomScenes(),r=0;r<n.length;r++){var o=n[r];o&&e.push(o)}return e},this.getGeomScenesPerModel=function(){return i.reduce(((e,t)=>(e.push(t.getGeomScenes()),e)),[])},this.explode=function(e){if(i.length){for(var t=0;t<i.length;t++){var n=i[t];l.i.explode(n,e)}this.invalidateVisibleBounds()}},this.update=function(e){for(var t=!1,n=0;n<i.length;n++){var r=i[n];t=t||r.update(e)}return t},this.hideModel=function(e){for(var t=0;t<i.length;t++){var n=i[t];if(n&&n.id===e)return this.removeModel(n),d.push(n),!0}return!1},this.showModel=function(e){for(var t=0;t<d.length;++t){var i=d[t];if(i&&i.id===e)return this.addModel(i),d.splice(t,1),!0}return!1}}},11613:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ResetFlags:()=>n});var n={RESET_NORMAL:0,RESET_REDRAW:1,RESET_RELOAD:2}},35797:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SceneMath:()=>c});var n=i(41434);const r=[new n.Vector3(1,0,0),new n.Vector3(0,1,0),new n.Vector3(0,0,1),new n.Vector3(-1,0,0),new n.Vector3(0,-1,0),new n.Vector3(0,0,-1)];let o=new n.Plane;new n.Vector3;function s(e,t,i,r){var o=e;o.z=-1;var s=new n.Vector3(o.x,o.y,1);o=o.unproject(t),(s=s.unproject(t)).sub(o).normalize();var a,l=s;if(Math.abs(l[i])<1e-6)return null;a=t.isPerspective?t.position:o;var c=((r?r.min[i]:0)-a[i])/l[i];return l.multiplyScalar(c),l.add(a),l}function a(e,t,i){var n=e.clone();return n.max(t),n.min(i),n.distanceToSquared(e)}function l(e,t){return a(e,t.min,t.max)}let c={box2CutPlanes:function(e,t){let i=[];for(let s=0;s<r.length;s++){o.normal.copy(r[s]);const a=s<3?e.max:e.min;o.constant=-o.normal.dot(a),t&&o.applyMatrix4(t),i.push(new n.Vector4(o.normal.x,o.normal.y,o.normal.z,o.constant))}return i},getPixelsPerUnit:function(e,t,i,r,o,a){if(!e.isPerspective)return r/e.orthoScale;let c,h=i.getCenter(new n.Vector3);if(t)if(a)c=Math.sqrt(l(e.position,a));else{const t="z",i=s(new n.Vector3(0,0,1),e,t);i&&(h=i),c=e.position.distanceTo(h)}else{if(o){const t=o,n=e.target.clone().sub(e.position).normalize(),r=n.dot(t);if(0!==r){const o=-(e.position.clone().dot(t)+t.w)/r;h=i.clampPoint(n.multiplyScalar(o).add(e.position),h)}}c=e.position.distanceTo(h)}return r/(2*c*Math.tan(n.Math.degToRad(.5*e.fov)))},intersectGroundViewport:s,getNormalizingMatrix:function(e,t){t=t||e.getData().bbox;var i=new n.Matrix4;i.makeTranslation(-t.min.x,-t.min.y,-t.min.z);var r=new n.Vector3(0,0,0).subVectors(t.max,t.min),o=new n.Matrix4;o.makeScale(1/r.x,1/r.y,1);var s=new n.Matrix4;return s.multiplyMatrices(o,i),s},pointToMinMaxBoxDistance2:a,pointToBoxDistance2:l}},4123:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SelectionMode:()=>n});let n={LEAF_OBJECT:0,FIRST_OBJECT:1,LAST_OBJECT:2}},33526:(e,t,i)=>{"use strict";function n(e){var t=e||function(e,t){return e<t},i=[],n=[];function r(e,o,s){if(o||(o=0),s||(s=n.length),o>=s)return s;if(s===o+1){var a=i[n[o]];return t(a,e)?s:o}var l=parseInt(o+(s-o)/2),c=i[n[l-1]];return t(e,c)?r(e,o,l):t(c,e)?r(e,l,s):l-1}this.add=function(e){var t=r(e);if(t==n.length)return i.push(e),void n.push(i.length-1);i.push(e),n.splice(t,0,i.length-1)},this.size=function(){return n.length},this.get=function(e){return i[n[e]]},this.removeAt=function(e){var t=n[e];i[t]=void 0,n.splice(e,1)},this.toString=function(){for(var e="",t=0,i=this.size();t<i;++t)e+=this.get(t),t<i-1&&(e+=", ");return e}}i.r(t),i.d(t,{SortedList:()=>n})},20806:(e,t,i)=>{"use strict";i.r(t),i.d(t,{VBIntersector:()=>m});var n,r,o,s,a=i(5394),l=i(41434);function c(){n||(n=new l.Matrix4,r=new l.Ray,new l.Vector3,new l.Vector3,new l.Vector3,o=new l.Vector3,s=new l.Vector3)}function h(e,t,i){c();var h=e.geometry;if(h){var u=e.material,d=u?u.side:l.FrontSide;n.copy(e.matrixWorld).invert(),r.copy(t.ray).applyMatrix4(n);var p,f,m=t.precision||1e-4;(0,a.enumMeshTriangles)(h,(function(n,a,c,h,u,g,v,y,b,x){null!==(p=d===l.BackSide?r.intersectTriangle(c,a,n,!0,o):r.intersectTriangle(n,a,c,d!==l.DoubleSide,o))&&(p.applyMatrix4(e.matrixWorld),(f=t.ray.origin.distanceTo(p))<m||f<t.near||f>t.far||(l.Triangle.getNormal(n,a,c,s),i.push({distance:f,point:p.clone(),face:new l.Face3(h,u,g,s.clone()),faceIndex:x,fragId:e.fragId,dbId:e.dbId,object:e,modelId:e.modelId})))}))}}function u(e,t,i,o){c();var s=e.geometry;if(s){var h=t.params.Line.threshold;e.isWideLine&&(e.material.linewidth?h=e.material.linewidth:e.geometry.lineWidth&&(h=e.geometry.lineWidth));var u=h*h;n.copy(e.matrixWorld).invert(),r.copy(t.ray).applyMatrix4(n);var d=new l.Vector3,p=new l.Vector3;s instanceof l.BufferGeometry&&(0,a.enumMeshLines)(s,(function(n,s,a,l,c){var h,f;if(r.distanceSqToSegment(n,s,p,d),d.applyMatrix4(e.matrixWorld),p.applyMatrix4(e.matrixWorld),(f=d.distanceToSquared(p))>u)return;if((h=t.ray.origin.distanceTo(d))<t.near||h>t.far)return;let m={distance:h,point:d.clone(),face:{a,b:l},faceIndex:c,fragId:e.fragId,dbId:e.dbId,object:e,distanceToRay:Math.sqrt(f)};o&&o.filter&&!o.filter(m)||i.push(m)}))}}function d(e,t,i,o){e.isLine||e.isWideLine?null!=o&&o.skipLines||u(e,t,i,o):e.isPoint?null!=o&&o.skipPoints||function(e,t,i){c();var o=e.geometry;if(o){n.copy(e.matrixWorld).invert(),r.copy(t.ray).applyMatrix4(n);var s=t.precision||1e-4,h=t.params.PointCloud.threshold;h||(h=1),h*=Math.max(3,o.pointSize),h/=4,o instanceof l.BufferGeometry&&(0,a.enumMeshVertices)(o,(function(n,o,a,l){if(!(r.distanceToPoint(n)>h)){var c=r.closestPointToPoint(n);if(null!==c){c.applyMatrix4(e.matrixWorld);var u=t.ray.origin.distanceTo(c);u<s||u<t.near||u>t.far||i.push({distance:u,point:n,face:{a:l},faceIndex:l,fragId:e.fragId,dbId:e.dbId,object:e})}}}))}}(e,t,i):null!=o&&o.skipMeshes||h(e,t,i)}function p(e,t,i,n){if(e instanceof l.Mesh?d(e,t,i):e.raycast(t,i),!0===n)for(var r=e.children,o=0,s=r.length;o<s;o++)p(r[o],t,i,!0)}var f=function(e,t){return e.distance-t.distance};let m={meshRayCast:h,lineRayCast:u,rayCast:d,intersectObject:function(e,t,i,n){p(e,t,i,n),i.sort(f)}}},23850:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BoundsCallback:()=>s,VertexBufferReader:()=>o});var n=i(41434),r=2*Math.PI;function o(e){var t,i;this.vb=e.vb.buffer,this.stride=e.vbstride,this.vbf=new Float32Array(this.vb),this.vbi=new Int32Array(this.vb),this.vbs=new Uint16Array(this.vb),this.ib=e.ib,this.vcount=this.vbf.length/this.stride,this.useInstancing=e.numInstances>0,this.useCompactBuffers=e.unpackXform,this.texData=this.useCompactBuffers&&(null===(t=e.tIdColor)||void 0===t||null===(i=t.image)||void 0===i?void 0:i.data)&&new Uint32Array(e.tIdColor.image.data.buffer),this.isInterleavedVb=(()=>{const t=e.attributes;if(!t)return!1;const i=t.layerVp4b,n=t.flags4b;if(this.useCompactBuffers){return t.uvIdColor&&i&&n}{const e=t.color4b,r=t.dbId4b;return e&&r&&i&&n}})()}function s(e){this.bounds=e,this.point=new n.Vector4,this.point.z=0,this.point.w=1}o.prototype.getDbIdAt=function(e){return this.texData?this.texData[this.vbs[e*this.stride*2+7]]:this.vbi[e*this.stride+7]},o.prototype.getColorAt=function(e){return this.texData?this.texData[this.vbs[e*this.stride*2+6]]:this.vbi[e*this.stride+6]},o.prototype.getVertexFlagsAt=function(e){return this.texData?this.vbi[e*this.stride+4]:this.vbi[e*this.stride+8]},o.prototype.getLayerIndexAt=function(e){return this.texData?65535&this.vbi[e*this.stride+5]:65535&this.vbi[e*this.stride+9]},o.prototype.getViewportIndexAt=function(e){return this.texData?this.vbi[e*this.stride+5]>>16&65535:this.vbi[e*this.stride+9]>>16&65535},o.prototype.decodeLineAt=function(e,t,i,n){if(n.onLineSegment){if(this.useCompactBuffers)var o=this.stride*e*2,s=this.useCompactBuffers.x*this.vbs[o]/65535+this.useCompactBuffers.z,a=this.useCompactBuffers.y*this.vbs[o+1]/65535+this.useCompactBuffers.w,l=this.vbs[o+2]/65535*r-Math.PI,c=this.vbs[o+3]/65535*Math.max(this.useCompactBuffers.x,this.useCompactBuffers.y),h=this.vbs[o+4]/32767*Math.max(this.useCompactBuffers.x,this.useCompactBuffers.y)*2;else{var u=this.stride*e;s=this.vbf[u],a=this.vbf[u+1],l=this.vbf[u+2]*r-Math.PI,c=this.vbf[u+3],h=2*this.vbf[u+4]}var d=s+c*Math.cos(l),p=a+c*Math.sin(l);n.onLineSegment(s,a,d,p,i,h)}},o.prototype.decodeCircularArcAt=function(e,t,i,n){if(n.onCircularArc){if(this.useCompactBuffers)var o=this.stride*e*2,s=this.useCompactBuffers.x*this.vbs[o]/65535+this.useCompactBuffers.z,a=this.useCompactBuffers.y*this.vbs[o+1]/65535+this.useCompactBuffers.w,l=this.vbs[o+2]/65535*r,c=this.vbs[o+3]/65535*r,h=this.vbs[o+5]/65535*Math.max(this.useCompactBuffers.x,this.useCompactBuffers.y);else{var u=this.stride*e;s=this.vbf[u],a=this.vbf[u+1],l=this.vbf[u+2]*r,c=this.vbf[u+3]*r,h=this.vbf[u+5]}n.onCircularArc(s,a,l,c,h,i)}},o.prototype.decodeEllipticalArcAt=function(e,t,i,n){if(n.onEllipticalArc){var o=this.stride*e,s=this.vbf[o],a=this.vbf[o+1],l=this.vbf[o+2]*r,c=this.vbf[o+3]*r,h=this.vbf[o+5],u=this.vbf[o+10],d=this.vbf[o+11];n.onEllipticalArc(s,a,l,c,h,u,d,i)}},o.prototype.decodeTexQuadAt=function(e,t,i,n){if(n.onTexQuad){if(this.useCompactBuffers)var o=this.stride*e*2,s=this.useCompactBuffers.x*this.vbs[o]/65535+this.useCompactBuffers.z,a=this.useCompactBuffers.y*this.vbs[o+1]/65535+this.useCompactBuffers.w,l=this.vbs[o+2]/65535*r,c=this.vbs[o+3]/65535*Math.max(this.useCompactBuffers.x,this.useCompactBuffers.y),h=this.vbs[o+4]/65535*Math.max(this.useCompactBuffers.x,this.useCompactBuffers.y);else{var u=this.stride*e;s=this.vbf[u],a=this.vbf[u+1],l=this.vbf[u+2]*r,c=this.vbf[u+3],h=this.vbf[u+4]}n.onTexQuad(s,a,c,h,l,i)}},o.prototype.decodeOneTriangleAt=function(e,t,i,n){if(n.onOneTriangle){if(this.useCompactBuffers)var r=this.stride*e*2,o=this.useCompactBuffers.x*this.vbs[r]/65535+this.useCompactBuffers.z,s=this.useCompactBuffers.y*this.vbs[r+1]/65535+this.useCompactBuffers.w,a=this.useCompactBuffers.x*this.vbs[r+2]/65535+this.useCompactBuffers.z,l=this.useCompactBuffers.y*this.vbs[r+3]/65535+this.useCompactBuffers.w,c=this.useCompactBuffers.x*this.vbs[r+4]/65535+this.useCompactBuffers.z,h=this.useCompactBuffers.y*this.vbs[r+5]/65535+this.useCompactBuffers.w;else{var u=this.stride*e;o=this.vbf[u],s=this.vbf[u+1],a=this.vbf[u+2],l=this.vbf[u+3],c=this.vbf[u+4],h=this.vbf[u+5]}n.onOneTriangle(o,s,a,l,c,h,i)}},o.prototype.decodeTriangleIndexed=function(e,t,i,n,r,o){if(o.onOneTriangle){if(this.useCompactBuffers){var s=this.stride*e*2,a=this.useCompactBuffers.x*this.vbs[s]/65535+this.useCompactBuffers.z,l=this.useCompactBuffers.y*this.vbs[s+1]/65535+this.useCompactBuffers.w;s=this.stride*t*2;var c=this.useCompactBuffers.x*this.vbs[s]/65535+this.useCompactBuffers.z,h=this.useCompactBuffers.y*this.vbs[s+1]/65535+this.useCompactBuffers.w;s=this.stride*i*2;var u=this.useCompactBuffers.x*this.vbs[s]/65535+this.useCompactBuffers.z,d=this.useCompactBuffers.y*this.vbs[s+1]/65535+this.useCompactBuffers.w}else{var p=this.stride*e;a=this.vbf[p],l=this.vbf[p+1];p=this.stride*t;c=this.vbf[p],h=this.vbf[p+1];p=this.stride*i;u=this.vbf[p],d=this.vbf[p+1]}o.onOneTriangle(a,l,c,h,u,d,r)}},o.prototype.decodeByType=function(e,t,i,n,r){switch(e){case 11:case 1:this.decodeLineAt(t,i,n,r);break;case 2:this.decodeCircularArcAt(t,i,n,r);break;case 3:this.decodeEllipticalArcAt(t,i,n,r);break;case 4:this.decodeTexQuadAt(t,i,n,r);break;case 5:this.decodeOneTriangleAt(t,i,n,r)}},o.prototype.enumGeomsForObject=function(e,t){if(this.useInstancing)for(var i=0;i<this.vcount;){var n=this.getVertexFlagsAt(i)>>8&255,r=this.getLayerIndexAt(i),o=this.getViewportIndexAt(i);(a=this.getDbIdAt(i)===e)&&this.decodeByType(n,i,r,o,t),i+=1}else for(i=0;i<this.ib.length;){var s=this.ib[i],a=(n=this.getVertexFlagsAt(s)>>8&255,r=this.getLayerIndexAt(s),o=this.getViewportIndexAt(s),this.getDbIdAt(s)===e);0===n?(a&&this.decodeTriangleIndexed(this.ib[i],this.ib[i+1],this.ib[i+2],r,o,t),i+=3):(a&&this.decodeByType(n,s,r,o,t),i+=6)}},o.prototype.enumGeomsForVisibleLayer=function(e,t){this.enumGeoms((function(t,i,n){return!e||0!==i&&-1!==e.indexOf(i)}),t)},o.prototype.enumGeoms=function(e,t){if(this.useInstancing)for(var i=0;i<this.vcount;){var n=this.getVertexFlagsAt(i)>>8&255,r=this.getLayerIndexAt(i),o=this.getViewportIndexAt(i),s=this.getDbIdAt(i);(l=!e||e(s,r,o))&&this.decodeByType(n,i,r,o,t),i+=1}else for(i=0;i<this.ib.length;){var a=this.ib[i],l=(n=this.getVertexFlagsAt(a)>>8&255,r=this.getLayerIndexAt(a),o=this.getViewportIndexAt(a),s=this.getDbIdAt(a),!e||e(s,r,o));0===n?(l&&this.decodeTriangleIndexed(this.ib[i],this.ib[i+1],this.ib[i+2],r,o,t),i+=3):(l&&this.decodeByType(n,a,r,o,t),i+=6)}},s.prototype.onVertex=function(e,t,i){this.point.x=e,this.point.y=t,this.bounds.expandByPoint(this.point)},s.prototype.onLineSegment=function(e,t,i,n,r){this.onVertex(e,t),this.onVertex(i,n)},s.prototype.onCircularArc=function(e,t,i,n,r,o){this.onEllipticalArc(e,t,i,n,r,r,0,o)},s.prototype.onEllipticalArc=function(e,t,i,n,r,o,s,a){0==s?i<=0&&n>=2*Math.PI-1e-5?this.onTexQuad(e,t,2*r,2*o,s,a):(this.point.x=e+Math.cos(i)*r,this.point.y=t+Math.sin(i)*o,this.bounds.expandByPoint(this.point),this.point.x=e+Math.cos(n)*r,this.point.y=t+Math.sin(n)*o,this.bounds.expandByPoint(this.point),i>n&&(this.point.x=e+r,this.point.y=t,this.bounds.expandByPoint(this.point),i-=2*Math.PI),i<.5*Math.PI&&n>.5*Math.PI&&(this.point.x=e,this.point.y=t+o,this.bounds.expandByPoint(this.point)),i<Math.PI&&n>Math.PI&&(this.point.x=e-r,this.point.y=t,this.bounds.expandByPoint(this.point)),i<1.5*Math.PI&&n>1.5*Math.PI&&(this.point.x=e,this.point.y=t-o,this.bounds.expandByPoint(this.point))):this.onTexQuad(e,t,2*r,2*o,s,a)},s.prototype.onTexQuad=function(e,t,i,r,o,s){var a=.5*i,l=.5*i;if(0==o)this.onVertex(e-a,t-l),this.onVertex(e+a,t+l);else{var c=new n.Matrix4,h=new n.Matrix4;c.makeRotationZ(o),h.makeTranslation(e,t,0),h.multiply(c);for(var u=0;u<4;u++)this.point.x=u%2==1?a:-a,this.point.y=u>=2?l:-l,this.point.applyMatrix4(h),this.bounds.expandByPoint(this.point)}},s.prototype.onOneTriangle=function(e,t,i,n,r,o,s){this.onVertex(e,t),this.onVertex(i,n),this.onVertex(r,o)}},5394:(e,t,i)=>{"use strict";i.r(t),i.d(t,{VertexEnumerator:()=>w,enumMeshEdges:()=>S,enumMeshIndices:()=>_,enumMeshLines:()=>A,enumMeshTriangles:()=>E,enumMeshVertices:()=>x,getIndicesCount:()=>g,getVertexCount:()=>m});var n,r,o,s,a,l,c,h,u,d,p,f=i(27957);function m(e){return e.vb?e.vb.length/e.vbstride:e.attributes.position?e.attributes.position.array.length/3:0}function g(e){const t=b(e);if(t){var i=e.groups;if(!i||0===i.length)return t.length;let o=0;for(var n=0,r=i.length;n<r;++n)o+=i[n].count;return o}return m(e)}function v(e){let t={};return t=function(e){const t=e.attributes;let i,n,r;if(e.vblayout){if(!e.vblayout.position)return{positions:void 0,poffset:void 0};r=e.vblayout.position.offset}else{if(!t.position)return{positions:void 0,poffset:void 0};r=t.position.offset||0}return i=e.vb||t.position.array,n=e.vb?e.vbstride:3,{positions:i,stride:n,poffset:r}}(e),t}function y(e){const t=e.attributes;let i,n,r=0;return i=e.vb||t.normal&&t.normal.array,n=e.vblayout?e.vblayout.normal:t.normal||null,n?(r=n.offset||0,r*=1):i=null,!n||n.array||3===n.itemSize&&4===n.bytesPerItem||(i=null),{normals:i,noffset:r}}function b(e){let t;return t=e.ib||e.indices||(e.index?e.index.array:null),t}function x(e,t,i){e.attributes;n||(n=new f.LmvVector3,r=new f.LmvVector3,new f.LmvVector3),i&&(o||(o=new THREE.Matrix3),o.getNormalMatrix(i));const{positions:s,stride:a,poffset:l}=v(e),{normals:c,noffset:h}=y(e);if(s)for(var u=m(e),d=l,p=h,g=0;g<u;g++,d+=a,p+=a)n.set(s[d],s[d+1],s[d+2]),i&&n.applyMatrix4(i),c&&(r.set(c[p],c[p+1],c[p+2]),i&&r.applyMatrix3(o)),t(n,c?r:null,null,g)}function _(e,t){const i=b(e);if(i){let n=e.groups;n&&0!==n.length||(n=[{start:0,count:i.length,index:0}]);for(let e=0,r=n.length;e<r;++e){let r=n[e].start,o=n[e].count,s=0;s=n[e].index;for(let e=r,n=r+o;e<n;e+=3){t(s+i[e],s+i[e+1],s+i[e+2])}}}else{let i=m(e);for(let e=0;e<i;e++){t(3*e,3*e+1,3*e+2)}}}function E(e,t){var i,n,r;s||(s=new f.LmvVector3,a=new f.LmvVector3,l=new f.LmvVector3,c=new f.LmvVector3,h=new f.LmvVector3,u=new f.LmvVector3);const{positions:o,stride:d,poffset:p}=v(e),{normals:g,noffset:x}=y(e),_=b(e);if(o)if(_){var E=e.groups;E&&0!==E.length||(E=[{start:0,count:_.length,index:0}]);for(var A=0,S=E.length;A<S;++A){var w,M=E[A].start,T=E[A].count;w=E[A].index;for(var C=M,P=M+T;C<P;C+=3){var D=(i=w+_[C])*d+p,L=(n=w+_[C+1])*d+p,I=(r=w+_[C+2])*d+p;if(s.x=o[D],s.y=o[D+1],s.z=o[D+2],a.x=o[L],a.y=o[L+1],a.z=o[L+2],l.x=o[I],l.y=o[I+1],l.z=o[I+2],g){var R=i*d+x,O=n*d+x,N=r*d+x;c.x=g[R],c.y=g[R+1],c.z=g[R+2],h.x=g[O],h.y=g[O+1],h.z=g[O+2],u.x=g[N],u.y=g[N+1],u.z=g[N+2],t(s,a,l,i,n,r,c,h,u,C/3)}else t(s,a,l,i,n,r,null,null,null,C/3)}}}else{var k=m(e);for(C=0;C<k;C+=3){D=(i=C)*d+p,L=(n=C+1)*d+p,I=(r=C+2)*d+p;if(s.x=o[D],s.y=o[D+1],s.z=o[D+2],a.x=o[L],a.y=o[L+1],a.z=o[L+2],l.x=o[I],l.y=o[I+1],l.z=o[I+2],g){R=i*d+x,O=n*d+x,N=r*d+x;c.x=g[R],c.y=g[R+1],c.z=g[R+2],h.x=g[O],h.y=g[O+1],h.z=g[O+2],u.x=g[N],u.y=g[N+1],u.z=g[N+2],t(s,a,l,i,n,r,c,h,u,C/3)}else t(s,a,l,i,n,r,null,null,null,C/3)}}}function A(e,t){var i,n,r=e.attributes;d||(d=new f.LmvVector3,p=new f.LmvVector3);var o=2;e.lineWidth&&(o=6);const s=b(e);if(s){let f,b;f=e.vb?e.vb:r.position.array,b=e.vb?e.vbstride:3;var a=e.groups;a&&0!==a.length||(a=[{start:0,count:s.length,index:0}]);for(var l=0,c=a.length;l<c;++l){var h,u=a[l].start,m=a[l].count;h=a[l].index;for(var g=u,v=u+m,y=u/o;g<v;g+=o,y++)i=h+s[g],n=h+s[g+1],d.x=f[i*b],d.y=f[i*b+1],d.z=f[i*b+2],p.x=f[n*b],p.y=f[n*b+1],p.z=f[n*b+2],t(d,p,i,n,y)}}else{let s,a;s=e.vb?e.vb:r.position.array,a=e.vb?e.vbstride:3;for(g=0,v=s.length/a,y=0;g<v;g+=o,y++)i=g,n=g+1,d.x=s[i*a],d.y=s[i*a+1],d.z=s[i*a+2],p.x=s[n*a],p.y=s[n*a+1],p.z=s[n*a+2],t(d,p,i,n,y)}}function S(e,t){var i,n;d||(d=new f.LmvVector3,p=new f.LmvVector3);let r,o,s;if(r=e.iblines,r){o=e.vb?e.vb:attributes.position.array,s=e.vb?e.vbstride:3;var a=e.groups;a&&0!==a.length||(a=[{start:0,count:r.length,index:0}]);for(var l=0,c=a.length;l<c;++l){var h,u=a[l].start,m=a[l].count;h=a[l].index;for(var g=u,v=u+m;g<v;g+=2)i=h+r[g],n=h+r[g+1],d.x=o[i*s],d.y=o[i*s+1],d.z=o[i*s+2],p.x=o[n*s],p.y=o[n*s+1],p.z=o[n*s+2],t(d,p,i,n)}}}let w={getVertexCount:m,enumMeshVertices:x,enumMeshIndices:_,enumMeshTriangles:E,enumMeshLines:A,enumMeshEdges:S}},29865:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Consolidation:()=>B,ConsolidationBuilder:()=>z,canBeMerged:()=>U,copyPrimitiveProps:()=>F,copyVertexFormat:()=>k,isVisible:()=>R,mergeGeometries:()=>V});var n=i(41434),r=i(5394),o=i(22769),s=i(62206),a=i(754),l=i(85218),c=i(98500),h=i(27957);function u(e,t,i,n){var o=function(e){for(var t=new Uint16Array(e.length+1),i=0,n=0;n<e.length;n++)t[n]=i,i+=(0,r.getVertexCount)(e[n]);return t[n]=i,t}(e),s=new a.GeomMergeTask;return s.vb=t.vb,s.vbstride=t.vbstride,s.posOffset=t.attributes.position.offset,s.normalOffset=t.attributes.normal?t.attributes.normal.offset:-1,s.matrices=i,s.ranges=o,s.dbIds=n,s}function d(e,t){t.vb=e.vb,t.attributes.id.array=e.vertexIds,t.needsUpdate=!0}function p(e){var t=0,i={},n=[],r=e,o=new Array(2);function s(e){for(var n=e.data,s=0;s<n.length;s++){var a=n[s],l=a.taskId;d(a,i[l]),delete i[l]}if(0===--t)for(r.inProgress=!1,s=0;s<o.length;s++)o[s].clearAllEventListenerWithIntercept(),o[s].terminate(),o[s]=null}this.addMergeTask=function(e,t,r,o){var s=u(e,t,r,o);n.push(s),i[s.id]=t},this.runTasks=function(){for(var e=0;e<2;e++)o[e]=p.createWorker(),o[e].addEventListenerWithIntercept(s);for(var i=n.length,a=Math.floor(i/2),l=0;l<2;l++){var c=l*a,h=1===l?i:c+a,u=[],d=new Array(4*(h-c)),f=0;for(e=c;e<h;e++){var m=n[e];d[f++]=m.vb.buffer,d[f++]=m.matrices.buffer,d[f++]=m.ranges.buffer,d[f++]=m.dbIds.buffer,u.push(m)}var g={operation:"MERGE_GEOMETRY",tasks:u};o[l].doOperation(g,d),t++}r.inProgress=!0}}p.createWorker=l.createWorkerWithIntercept;var f=i(49720),m=i(84807),g=i(41723),v=i(34423),y=i(93033),b=1,x=2,_=3,E=4;function A(e){return e.isLines?x:e.isPoints?E:e.isWideLines?_:b}function S(e,t){switch(!0===e.isLines&&(e.isLines=void 0),!0===e.isWideLines&&(e.isWideLines=void 0),!0===e.isPoints&&(e.isPoints=void 0),t){case x:e.isLines=!0;break;case _:e.isWideLines=!0;break;case E:e.isPoints=!0}}var w=g.MeshFlags.MESH_HIGHLIGHTED,M=g.MeshFlags.MESH_VISIBLE|g.MeshFlags.MESH_HIDE|w,T=g.MeshFlags.MESH_VISIBLE,C=g.MeshFlags.MESH_VISIBLE|g.MeshFlags.MESH_HIDE,P=g.MeshFlags.MESH_HIGHLIGHTED|g.MeshFlags.MESH_HIDE,D=g.MeshFlags.MESH_HIGHLIGHTED,L=v.RenderFlags.RENDER_HIDDEN,I=v.RenderFlags.RENDER_HIGHLIGHTED;function R(e,t){switch(t){case L:return 0==(e&C);case I:return(e&P)===D}return(e&M)==T}const O=new n.Matrix4;function N(e){this.geoms=[],this.matrices=[],this.vertexCount=0,this.material=e,this.fragIds=[],this.worldBox=new n.Box3}function k(e,t,i,n,r){for(var o in(0,s.isInterleavedGeometry)(e)||f.logger.warn("copyVertexFormat() supports only interleaved buffers"),t.vbstride=e.vbstride,e.attributes)t.attributes[o]=e.attributes[o];t.attributesKeys=e.attributesKeys.slice(0)}function F(e,t){S(t,A(e)),t.lineWidth=e.lineWidth,t.pointSize=e.pointSize}function V(e,t,i,s,a){var l=function(e){let t;t=e[0].vbstride;var i=0,s=0;let a,l=0;for(let t=0;t<e.length;t++){const n=e[t];s+=(0,r.getVertexCount)(n),i+=n.ib.length,a=n.iblines,a&&(l+=a.length)}var c=(0,o.createBufferGeometry)();c.byteSize=0;const h=new Float32Array(s*t),u=new Uint16Array(i);c.vb=h,c.ib=u,l>0&&(a=new Uint16Array(l),c.byteSize+=a.byteLength,c.iblines=a),c.byteSize+=h.byteLength+u.byteLength,F(e[0],c),k(e[0],c);var d=new n.BufferAttribute(new Float32Array,3);d.normalized=!0,d.bytesPerItem=1,c.setAttribute("id",d);var p=e[0];return S(c,A(p)),p.isPoints&&(c=p.pointSize),p.isWideLines&&(c=p.lineWidth),c}(e);return l.boundingBox=s.clone(),function(e,t){var i=0,n=0,o=0,s=0;let a,l,c,h,u,d;for(var p=0;p<e.length;p++){var f,m=e[p],g=(0,r.getVertexCount)(m);let v,y;a=m.vb,l=m.ib,v=l.length,h=t.vb,u=t.ib,c=m.iblines,y=(null===(f=c)||void 0===f?void 0:f.length)??0,d=t.iblines;for(let e=0;e<v;e++)u[o+e]=l[e]+n;for(let e=0;e<y;e++)d[s+e]=c[e]+n;s+=y,h.set(a,i),i+=a.length,n+=g,o+=v}}(e,l),a?a.addMergeTask(e,l,t,i):function(e,t,i,n){var r=u(e,t,i,n),o=new h.LmvVector3,s=new c.LmvMatrix4;d(r.run(s,o),t)}(e,l,t,i),l}function U(e,t){let i,n;if(i=e.vbstride,n=t.vbstride,i!=n)return!1;if(A(e)!==A(t))return!1;if(e.isPoints&&e.pointSize!==t.pointSize)return!1;if(e.isWideLines&&e.lineWidth!==t.lineWidth)return!1;if(e.attributesKeys.length!=t.attributesKeys.length)return!1;for(var r=0,o=e.attributesKeys.length;r<o;r++){var s=e.attributesKeys[r],a=e.attributes[s],l=t.attributes[s];if(!l)return!1;if(a===l)continue;let i;if(i=a.bytesPerItem!==l.bytesPerItem,a.offset!==l.offset||a.normalized!==l.normalized||a.itemSize!==l.itemSize||i||a.isPattern!==l.isPattern)return!1}return!0}function B(e){this.meshes=[],this.fragId2MeshIndex=new Int32Array(e);for(var t=0;t<this.fragId2MeshIndex.length;t++)this.fragId2MeshIndex[t]=-1;this.byteSize=0,this.consolidationMap=null}function z(){this.buckets={},this.bucketCount=0,this.costs=0}function G(e,t){this.fragOrder=new Uint32Array(e),this.ranges=new Uint32Array(t),this.boxes=new Array(t),this.numConsolidated=-1}N.prototype={constructor:N,addGeom:function(e,t,i){this.geoms.push(e),this.fragIds.push(i),this.worldBox.union(t),this.vertexCount+=(0,r.getVertexCount)(e);var n=this.geoms.length;return 1==n?0:(void 0===e.byteSize&&f.logger.warn("Error in consolidation: Geometry must contain byteSize."),e.byteSize+(2==n?this.geoms[0].byteSize:0))}},B.prototype={constructor:B,addContainerMesh:function(e,t,i,n,r){var o=new y.LMVMesh(e,t);this.meshes.push(o),this.byteSize+=e.byteSize;var s=n||0,a=s+(r||i.length);o.frustumCulled=!1;for(var l=this.meshes.length-1,c=s;c<a;c++){var h=i[c];this.fragId2MeshIndex[h]=l}},addSingleMesh:function(e,t,i,n,r){var o=new y.LMVMesh(e,t);o.matrix.copy(n),o.matrixAutoUpdate=!1,o.dbId=r,o.fragId=i,this.meshes.push(o),o.frustumCulled=!1,this.fragId2MeshIndex[i]=this.meshes.length-1},addSingleFragment:function(e,t){var i=e.getVizmesh(t);e.getOriginalWorldMatrix(t,O),this.addSingleMesh(i.geometry,i.material,t,O,i.dbId)},applyAttributes:function(e,t,i,n){var r,o,s,a=this.meshes[e],l=a.geometry,c=t.vizflags,h=this.consolidationMap,u=h.fragOrder,d=l.numInstances,p=t.db2ThemingColor,f=p.length>0||void 0;if(d?o=(r=a.rangeStart)+a.geometry.numInstances:l.attributes.id?(r=h.ranges[e],o=e+1>=h.ranges.length?h.numConsolidated:h.ranges[e+1]):s=a.fragId,!n||void 0!==s)return l.groups&&void 0===s&&(l.groups=void 0),a.visible=R(c[void 0===s?u[r]:s],i),a.themingColor=f&&p[t.fragments.fragId2dbId[s]],a;var m,g,v=0,y=0,b=0,x=0,_=0;function E(){if(m){l.groups=l.groups||[];var e=l.groups[_]||{index:0};l.groups[_++]=e,d?(e.start=0,e.count=l.ib?l.ib.length:l.ibLength,(l.iblines||l.iblinesLength)&&(e.edgeStart=0,e.edgeCount=l.iblines?l.iblines.length:l.iblinesLength),e.instanceStart=v,e.numInstances=y-v):(e.start=v,e.count=y-v,(l.iblines||l.iblinesLength)&&(e.edgeStart=b,e.edgeCount=x-b)),e.themingColor=g}}for(var A=r;A<o;++A){var S=R(c[s=u[A]],i),w=f&&t.db2ThemingColor[t.fragments.fragId2dbId[s]];if((S!==m||S&&w!==g)&&(y>v&&E(),v=y,b=x,m=S,g=w),d)y+=1;else{var M=t.getGeometry(s);y+=M.ib?M.ib.length:M.ibLength,(M.iblines||M.iblinesLength)&&(x+=M.iblines?M.iblines.length:M.iblinesLength)}}return 0===v?(a.themingColor=g,a.visible=m):(a.visible=!0,E()),l.groups&&(l.groups.length=_),a}},z.prototype={addGeom:function(e,t,i,n){var o=null,s=this.buckets[t.id];if(s)for(var a=0;a<s.length;a++){var l=s[a];if(U(l.geoms[0],e))if(!((0,r.getVertexCount)(e)+l.vertexCount>65535)){o=l;break}}o||(o=new N(t),this.bucketCount++,this.buckets[t.id]?this.buckets[t.id].push(o):this.buckets[t.id]=[o]),this.costs+=o.addGeom(e,i,n)},createConsolidationMap:function(e,t){var i=new G(e.length,this.bucketCount),n=0,r=0;for(var o in this.buckets)for(var s=this.buckets[o],a=0;a<s.length;a++){var l=s[a];i.ranges[r]=n,i.boxes[r]=l.worldBox,i.fragOrder.set(l.fragIds,n),n+=l.fragIds.length,r++}i.numConsolidated=t;for(var c=t;c<e.length;c++)i.fragOrder[c]=e[c];return i}},G.prototype={buildConsolidation:function(e,t,i){var r=this.fragOrder,o=e.getCount(),s=this.ranges.length,a=new B(o),l=null;p.createWorker&&(l=new p(a));for(var c=[],h=new n.Matrix4,u=0;u<s;u++){var d=this.ranges[u],f=(u===s-1?this.numConsolidated:this.ranges[u+1])-d;if(1!==f){c.length=f;for(var g=new Float32Array(16*f),v=new Uint32Array(f),y=0;y<f;y++)S=r[d+y],c[y]=e.getGeometry(S),e.getOriginalWorldMatrix(S,h),g.set(h.elements,16*y),v[y]=e.getDbIds(S);var b=this.boxes[u],x=r[d],_=e.getMaterial(x),E=V(c,g,v,b,l),A=t.getMaterialVariant(_,m.MATERIAL_VARIANT.VERTEX_IDS,i);a.addContainerMesh(E,A,r,d,f)}else{var S=r[d];a.addSingleFragment(e,S,a)}}return l&&l.runTasks(),a.consolidationMap=this,a}},B.applyBVHDefaults=function(e){e.frags_per_leaf_node=512,e.max_polys_per_node=1e5},B.getDefaultBVHOptions=function(){var e={};return B.applyBVHDefaults(e),e}},88816:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ConsolidationIterator:()=>u});var n=i(29865),r=i(48531),o=i(41434),s=i(10834),a=i(41723),l=i(34423),c=i(49720),h=i(29996);function u(e,t){var i=e,d=t,p=[],f=!1,m=[],g=[],v=new o.Matrix4,y=new o.Box3;function b(e){const t=i.matrix;t?(e.matrixWorld.copy(t),e.matrixAutoUpdate=!1):e.matrixWorld.identity()}function x(){const e=d.meshes;for(let t=0;t<e.length;t++)e[t].matrixWorldNeedsUpdate=!0}x(),this.modelMatrixChanged=function(){for(let e=0;e<m.length;e++){const t=m[e];t&&b(t)}x()},this.getConsolidation=function(){return d},this.reset=function(){p.length=null,g.length=0;var e=i.getCount(),t=a.MeshFlags.MESH_MOVED,n=a.MeshFlags.MESH_VISIBLE,r=n|a.MeshFlags.MESH_HIDE|a.MeshFlags.MESH_HIGHLIGHTED,o=i.vizflags,s=d.fragId2MeshIndex;d.meshes;f=!1;for(var l=i.db2ThemingColor.length>0,c=0;c<e;c++){var h,u=o[c];if(u&t){f=!0;break}if(l){var m=i.fragments.fragId2dbId[c];h=i.db2ThemingColor[m]}var v=s[c];g[v]=g[v]||!!(h||u&r^n)}},this.dispose=function(){for(var e={type:"dispose"},t={type:"removed"},i=0;i<d.meshes.length;i++){var n=d.meshes[i],r=n.geometry;r&&(n.dispatchEvent(t),r.dispatchEvent(e),r.needsUpdate=!0)}},this.consolidateNextBatch=function(e,t,n){var r=e.nodeIndex;if(f||void 0===r)return e;if(d.inProgress)return e;const a=n===l.RenderFlags.RENDER_HIDDEN?e.getBoundingBoxHidden():e.getBoundingBox(),u=t.intersectsBox(a);if(u===s.FrustumIntersector.OUTSIDE)return null;if(h.ENABLE_PIXEL_CULLING&&t.estimateProjectedDiameter(a)<t.areaCullThreshold)return null;const v=u!==s.FrustumIntersector.CONTAINS;for(var x=function(e){m[e]||(m[e]=new o.Scene,b(m[e]));var t=m[e];return t.children.length=0,t}(r),_=e.start;_<e.lastItem;_++){var E,A=e.indices?e.indices[_]:_,S=d.fragId2MeshIndex[A];if(-1===S){if(!i.getGeometry(A))continue;return c.logger.warn("Warning: Missing fragment in consolidation. Consolidation disabled."),e}if(!p[S]&&(i.getWorldBounds(A,y),(!v||t.intersectsBox(y))&&!(h.ENABLE_PIXEL_CULLING&&t.estimateProjectedDiameter(y)<t.areaCullThreshold)&&(p[S]=!0,(E=d.applyAttributes(S,i,n,g[S])).visible))){var w=E&&E.geometry,M=w&&(w.isLines||w.isWideLines),T=w&&w.isPoints;i.linesHidden&&M||i.pointsHidden&&T||x.add(E)}}return x.boundingBox||(x.boundingBox=new o.Box3),e.getBoundingBox(x.boundingBox),x.renderImportance=e.renderImportance,x.sortObjects=e.sortObjects,e.lights&&x.children.push(e.lights),x};var _=1,E=2,A=3;function S(e){if(e){if(e.numInstances)return E;if(e.attributes.id)return _}return A}this.updateRenderProxy=function(e,t){if(e.geometry&&e.geometry.attributes){var o=function(e){if(f)return A;var t=d.fragId2MeshIndex[e],i=d.meshes[t];return S(null==i?void 0:i.geometry)}(t),s=S(e.geometry);if(e.needsUpdate||s!=o){var a=i.getGeometry(t),l=d.fragId2MeshIndex[t],c=d.meshes[l];if(o===A)e.geometry=a,e.material=i.getMaterial(t),i.getWorldMatrix(t,e.matrix);else if(o===E){i.getWorldMatrix(t,v);var h=i.fragments.fragId2dbId[t],u=new r.InstanceBufferBuilder(a,1);u.addInstance(v,h),e.geometry=u.finish(),e.material=Array.isArray(c.material)?c.material[0]:c.material,e.matrix.identity()}else i.getWorldMatrix(t,v),i.getWorldBounds(t,y),h=i.fragments.fragId2dbId[t],e.geometry=(0,n.mergeGeometries)([a],v.elements,[h],y),e.material=Array.isArray(c.material)?c.material[0]:c.material,e.matrix.identity();e.needsUpdate=!1,e.dispatchEvent({type:"removed"})}}},this.clone=function(){return new u(i,d)}}},16697:(e,t,i)=>{"use strict";i.r(t),i.d(t,{consolidateFragmentList:()=>c});var n=i(29865),r=i(48531),o=i(84807),s=i(41434);var a,l=(a=null,function(e,t,i,n,l,c){var h=e.getFragmentList();a||(a=new s.Matrix4);var u=i[n],d=h.getGeometry(u),p=h.getMaterial(u),f=l-n;if(1!=f){for(var m=l-1,g=new r.InstanceBufferBuilder(d,f),v=n;v<=m;v++){var y=i[v];h.getOriginalWorldMatrix(y,a);var b=h.fragments.fragId2dbId[y];if(!g.addInstance(a,b)){var x=i[m];i[m]=y,i[v]=x,--v,--m}}var _=g.finish();if(_){var E=t.getMaterialVariant(p,o.MATERIAL_VARIANT.INSTANCED,e);c.addContainerMesh(_,E,i,n,f),c.meshes[c.meshes.length-1].rangeStart=n}for(v=m+1;v<l;v++)y=i[v],c.addSingleFragment(h,y)}else c.addSingleFragment(h,u)});function c(e,t,i,r,o){var a=e.getFragmentList(),c=r.supportsInstancedArrays();i=i||100<<20;var h=function(e){for(var t=e.getCount(),i=[],n=0;n<t;n++){var r=e.getGeometryId(n),o=0|i[r];i[r]=o+1}return i}(a);if(!o){var u=function(e,t){function i(i,n){var r=e.getGeometry(i),o=e.getGeometry(n),s=e.getGeometryId(i),a=e.getGeometryId(n),l=t[s],c=t[a],h=l*r.byteSize,u=c*o.byteSize;return h!=u?h-u:r.id!=o.id?r.id-o.id:e.getMaterialId(i)-e.getMaterialId(n)}for(var n=0,r=e.getCount(),o=new Int32Array(r),s=0;s<r;s++)e.getGeometry(s)&&(o[n]=s,n++);if(n<r&&(o=new Int32Array(o.buffer,o.byteOffset,n)),o.sort)o.sort(i);else{var a=new Array(r);for(s=0;s<r;s++)a[s]=o[s];for(a.sort(i),s=0;s<o.length;s++)o[s]=a[s]}return o}(a,h);o=function(e,t,i,r){for(var o=new s.Box3,a=new n.ConsolidationBuilder,l=0;l<i.length&&!(a.costs>=r);l++){var c=i[l];e.getWorldBounds(c,o);var h=e.getGeometry(c),u=e.getMaterial(c);a.addGeom(h,u,o,c)}return a.createConsolidationMap(i,l)}(a,0,u,i)}var d=o.buildConsolidation(a,t,e),p=o.fragOrder,f=o.numConsolidated;if(c)!function(e,t,i,n,r){var o=e.getFragmentList();if(!(n>=i.length)){for(var s=n,a=-1,c=-1,h=n;h<i.length;h++){var u=i[h],d=o.getGeometryId(u),p=o.getMaterialId(u);d==a&&p==c||(h!=n&&l(e,t,i,s,h,r),s=h,a=d,c=p)}l(e,t,i,s,i.length,r)}}(e,t,p,f,d);else for(var m=f;m<p.length;m++){var g=p[m];d.addSingleFragment(a,g)}!function(e,t,i,n){for(var r=e.geoms,o=[],s=0,a=0,l=0;l<t.meshes.length;l++){var c=t.meshes[l],h=c.geometry;h.byteSize||(h.byteSize=(h.vb.byteLength||0)+(h.ib.byteLength||0));var u=Number.isInteger(c.fragId);r.chooseMemoryType(h,h.numInstances,s,a),h.streamingDraw||(a+=h.byteSize,s+=1,u||(h.discardAfterUpload=!0)),u&&(o[h.id]=!0)}for(l=1;l<r.geoms.length;l++)if((h=r.geoms[l])&&!o[l]){var d=i[l];r.chooseMemoryType(h,d,s,a),h.streamingDraw&&n.deallocateGeometry(h),h.streamingDraw||(a+=h.byteSize,s+=1)}}(a,d,h,r);var v=e.getModelId();for(m=0;m<d.meshes.length;m++){d.meshes[m].modelId=v}return d}},754:(e,t,i)=>{"use strict";i.r(t),i.d(t,{GeomMergeTask:()=>r,writeIdToBuffer:()=>s});var n=1;function r(){this.vb=null,this.vbstride=0,this.posOffset=0,this.normalOffset=0,this.matrices=null,this.ranges=null,this.dbIds=null,this.id=n++}function o(e){e.x=.5*(1+Math.atan2(e.y,e.x)/Math.PI),e.y=.5*(1+e.z),e.z=0}function s(e,t,i){t[i++]=255&e,t[i++]=e>>8&255,t[i++]=e>>16&255,t[i]=0}var a=function(e,t,i,n,r,s,a){for(var l,c,h,u,d,p,f,m=e.posOffset,g=n;g<r;g++){var v=g*e.vbstride+m;a.set(e.vb[v],e.vb[v+1],e.vb[v+2]),a.applyMatrix4(i),e.vb[v]=a.x,e.vb[v+1]=a.y,e.vb[v+2]=a.z}if(-1!==e.normalOffset){var y=2*e.vbstride,b=2*e.normalOffset,x=function(e,t){return t.copy(e),t[12]=0,t[13]=0,t[14]=0,t.invert().transpose()}(i,s);for(g=n;g<r;g++){var _=g*y+b;a.set(t[_],t[_+1],0),a.divideScalar(65535),c=void 0,h=void 0,u=void 0,d=void 0,p=void 0,f=void 0,c=2*(l=a).x-1,h=2*l.y-1,u=Math.sin(c*Math.PI),d=Math.cos(c*Math.PI),p=Math.sqrt(1-h*h),f=h,l.x=d*p,l.y=u*p,l.z=f,a.applyMatrix4(x),a.normalize(),o(a),a.multiplyScalar(65535),t[_]=a.x,t[_+1]=a.y}}};function l(e,t,i){for(var n=16*e,r=0;r<16;r++)i.elements[r]=t[r+n]}r.prototype.run=function(e,t){for(var i=this.vb,n=i.length/this.vbstride,r=e.clone(),o=new Uint8Array(3*n),c=-1!==this.normalOffset?new Uint16Array(i.buffer,i.byteOffset,2*i.length):null,h=this.ranges,u=this.matrices,d=h.length-1,p=0;p<d;p++){var f=h[p],m=h[p+1];l(p,u,e),a(this,c,e,f,m,r,t);for(var g=3*f,v=m-f,y=this.dbIds[p],b=0;b<v;b++)s(y,o,g),g+=3}return{taskId:this.id,vb:this.vb,vertexIds:o}}},48531:(e,t,i)=>{"use strict";i.r(t),i.d(t,{InstanceBufferBuilder:()=>l});var n=i(29865),r=i(754),o=i(22769),s=i(49720),a=i(41434);function l(e,t){const i=(0,o.createInstancedBufferGeometry)();let l,c,h;c=i.ib=e.ib,l=i.vb=e.vb,h=i.iblines=e.iblines,(0,n.copyVertexFormat)(e,i,l,c,h),(0,n.copyPrimitiveProps)(e,i);this.offsets=new Float32Array(3*t),this.rotations=new Float32Array(4*t),this.scalings=new Float32Array(3*t),this.ids=new Uint8Array(3*t);var u=new a.Vector3,d=new a.Quaternion,p=new a.Vector3,f=new a.Matrix4,m=0,g=t;this.addInstance=function(e,t){return m>=g?(s.logger.warn("Instance buffer is already full."),!1):(e.decompose(u,d,p),!!function(e,t,i,n){f.compose(t,i,n);for(var r=e.elements,o=f.elements,s=0;s<16;s++){var a=r[s],l=o[s];if(Math.abs(l-a)>1e-4*Math.max(1,Math.min(Math.abs(a),Math.abs(l))))return!1}return!0}(e,u,d,p)&&(this.offsets[3*m]=u.x,this.offsets[3*m+1]=u.y,this.offsets[3*m+2]=u.z,this.rotations[4*m]=d.x,this.rotations[4*m+1]=d.y,this.rotations[4*m+2]=d.z,this.rotations[4*m+3]=d.w,this.scalings[3*m]=p.x,this.scalings[3*m+1]=p.y,this.scalings[3*m+2]=p.z,(0,r.writeIdToBuffer)(t,this.ids,3*m),m++,!0))},this.finish=function(){if(0==m)return null;let e,t,n,r;return m<g&&(this.offsets=new Float32Array(this.offsets.buffer,0,3*m),this.rotations=new Float32Array(this.rotations.buffer,0,4*m),this.scalings=new Float32Array(this.scalings.buffer,0,3*m),this.ids=new Uint8Array(this.ids.buffer,0,3*m)),e=new a.BufferAttribute(this.offsets,3),t=new a.BufferAttribute(this.rotations,4),n=new a.BufferAttribute(this.scalings,3),r=new a.BufferAttribute(this.ids,3),r.normalized=!0,r.bytesPerItem=1,e.divisor=1,t.divisor=1,n.divisor=1,r.divisor=1,i.setAttribute("instOffset",e),i.setAttribute("instRotation",t),i.setAttribute("instScaling",n),i.setAttribute("id",r),i.numInstances=m,i.byteSize=l.byteLength+c.byteLength+this.offsets.byteLength+this.rotations.byteLength+this.scalings.byteLength,i}}},97818:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ModelIteratorTexQuad:()=>A,TexQuadConfig:()=>E});var n=i(16840),r=i(24201),o=i(33526),s=i(98500),a=i(41434);function l(){this.offsetX=0,this.offsetY=0,this.scaleX=1,this.scaleY=1}function c(){var e=[],t=0;const i=new l;function n(e,t){var n=t||i;const r=[n.offsetX,n.offsetY,n.offsetX+n.scaleX,n.offsetY,n.offsetX+n.scaleX,n.offsetY+n.scaleY,n.offsetX,n.offsetY+n.scaleY],o=e.getAttribute("uv");if(o){for(let e=0;e<r.length;e+=2){const t=e/2;o.setXY(t,r[e],r[e+1])}o.needsUpdate=!0}else e.setAttribute("uv",new a.BufferAttribute(new Float32Array(r),2))}this.acquireQuadGeom=function(i){var r=e[t];return r?n(r,i):(r=this.createQuadGeom(i),e[t]=r),t++,r},this.createQuadGeom=function(e){var t=new a.BufferGeometry;return t.setAttribute("position",new a.BufferAttribute(new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0]),3)),t.setIndex([0,1,2,0,2,3]),t.computeVertexNormals(),n(t,e),t},this.reset=function(){t=0},this.dispose=function(){for(var t=0;t<e.length;t++){var i=e[t];i&&(i.dispose(),i.needsUpdate=!0)}e=[]}}l.prototype.toVec4=function(){return new a.Vector4(this.offsetX,this.offsetY,this.scaleX,this.scaleY)},l.prototype.copyTo=function(e){e.offsetX=this.offsetX,e.offsetY=this.offsetY,e.scaleX=this.scaleX,e.scaleY=this.scaleY};var h=i(49720),u=i(35797),d=i(38074),p=i(34722),f=i.n(p),m=i(13518),g=i.n(m),v=i(83539);let y={uniforms:a.UniformsUtils.merge([a.UniformsLib.common,v.ShaderChunks.CutPlanesUniforms,v.ShaderChunks.IdUniforms,v.ShaderChunks.ThemingUniform,{selectionColor:{type:"v4",value:new a.Vector4(0,0,1,0)},viewportBounds:{type:"v4",value:new a.Vector4(0,0,1,1)},modelLocalMatrix:{type:"m4",value:new a.Matrix4}}]),vertexShader:f(),fragmentShader:g()};var b=i(93033);const x=(0,n.getGlobal)().document;var _=function(e,t){this.timeStamps=e,this.mesh=t,this.state=0};function E(){this.urlPattern=null,this.tileSize=null,this.maxLevel=null,this.skippedLevels=[],this.textureLoader=null,this.texWidth=0,this.texHeight=0,this.maxActiveTiles=(0,n.isMobileDevice)()?0:400,this.cacheSize=(0,n.isMobileDevice)()?0:150,this.onRootLoaded=null,this.levelOffset=0,this.getRootTileSize=function(){return 1*(this.tileSize<<this.maxLevel)},this.getQuadWidth=function(){return this.scale*this.texWidth/this.getRootTileSize()},this.getQuadHeight=function(){return this.scale*this.texHeight/this.getRootTileSize()},this.getPageToModelTransform=function(e,t){var i=e/this.getQuadWidth(),n=t/this.getQuadHeight();return new s.LmvMatrix4(!0).set(i,0,0,0,0,n,0,0,0,0,1,0,0,0,0,1)},this.getBBox=function(){var e=this.getQuadWidth(),t=this.getQuadHeight();if(this.fitPaperSize)return new a.Box3(new a.Vector3,new a.Vector3(e,t,0));var i=1-t;return new a.Box3(new a.Vector3(0,i,0),new a.Vector3(e,1,0))},this.valid=function(){return"string"==typeof this.urlPattern&&this.urlPattern.length>0&&"number"==typeof this.tileSize&&this.tileSize>0&&"number"==typeof this.maxLevel&&this.maxLevel>0&&"number"==typeof this.texWidth&&this.texWidth>0&&"number"==typeof this.texHeight&&this.texHeight>0},this.initForSimpleImage=function(e){this.urlPattern=decodeURIComponent(e),this.maxLevel=0,this.levelOffset=0,this.scale=1,this.tileSize=-1,this.texWidth=-1,this.texHeight=-1,this.isSimpleImage=!0},this.isLevelPresent=function(e){return!this.skippedLevels[e]},this.initFromLoadOptions=function(e,t,i,n){if(this.urlPattern=decodeURIComponent(e),this.textureLoader=i,this.options=n,t){this.tileSize=t.tileSize,this.maxLevel=(r=t.texWidth,o=t.texHeight,s=t.tileSize,a=Math.ceil(Math.log2(r)),l=Math.ceil(Math.log2(o)),Math.max(a,l)-Math.log2(s)),this.texWidth=t.texWidth,this.texHeight=t.texHeight,this.levelOffset=t.levelOffset,this.zips=t.zips;const e=!(!t.paperWidth||!t.paperHeight);this.fitPaperSize=t.fitPaperSize&&e,this.paperHeight=t.paperHeight,this.scale=this.fitPaperSize?t.paperWidth*this.getRootTileSize()/this.texWidth:1,this.skippedLevels=function(e){var t=[];if(e.zips){i=(i=(i=(i=e.urlPattern.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).replace(/\\{x\\}/,"[0-9]+")).replace(/\\{y\\}/,"[0-9]+")).replace(/\\{z\\}/,"([0-9]+)");var i=new RegExp("^"+i+"$");t.length=e.maxLevel+1,t.fill(!0);var n=0;e.zips.forEach((function(r){Object.keys(r.fileTable).forEach((function(r){var o=i.exec(r);if(o&&o[1]){var s=parseInt(o[1])-e.levelOffset;s>=0&&s<=e.maxLevel&&(t[s]=!1,++n)}}))})),0===n&&(t.length=0,h.logger.info("No leaflet levels found - assume all are present"))}return t}(this),"number"==typeof t.maxLevel&&function(e,t,i){for(;i>0&&e.skippedLevels[i];)--i;var n=t-i;n>0&&(e.texWidth>>=n,e.texHeight>>=n,e.maxLevel=i)}(this,this.maxLevel,t.maxLevel),this.maxActiveTiles=t.maxActiveTiles||this.maxActiveTiles,this.cacheSize=t.cacheSize||this.cacheSize}else this.options&&(this.options.loadOptions={});var r,o,s,a,l}}function A(e,t){this.isModelIteratorTexQuad=!0;var i=e,n=1,s=e.getBBox(),h=[];let p=null,f=null;const m=new a.Matrix4,g=new a.Matrix4,v=new a.Matrix4,E=new a.Vector3,A=new a.Quaternion,S=new a.Vector3,w=new Autodesk.Viewing.Private.FrustumIntersector;let M,T=1,C=1;const P=new a.Vector4(0,0,0,0),D=(new a.Vector4).copy(P);let L=0;var I=t,R=null,O=!1,N=!1,k=!1,F=new a.Color,V=[],U=[],B=[];this.registerView=function(){var e=h.indexOf(void 0);-1===e&&(e=h.length);var t=new a.Scene;return t.ignoreFadeMaterial=!0,i.placementTransform&&t.matrix.copy(i.placementTransform),t.matrixAutoUpdate=!1,h[e]=t,B[e]=0,V[e]=!0,e},this.registerView();var z=0,G=0,H=!1,W=[],j=null,X=!1,q=new c;function Y(e){var t=i.maxLevel-e;return i.texWidth>>t}function K(e){var t=i.maxLevel-e;return i.texHeight>>t}function Z(e){var t=Y(e.level),n=K(e.level),r=e.x*i.tileSize,o=e.y*i.tileSize;return r>=t||o>=n}function Q(e){var t=Y(e.level),n=K(e.level),r=e.x*i.tileSize,o=e.y*i.tileSize,s=Math.max(0,Math.min(i.tileSize,t-r)),l=Math.max(0,Math.min(i.tileSize,n-o)),c=1*i.tileSize;return new a.Vector2(s/c,l/c)}function J(e){return i.scale/(1<<e)}function $(e){return J(e.level)*e.x*n}function ee(e){var t=J(e.level);return(i.fitPaperSize?i.paperHeight:1)-(e.y+1)*t*n}function te(e){return U[(0,r.tile2Index)(e)]}function ie(e){var t=te(e);return t instanceof _&&2===t.state}function ne(e,t,i){var r;if(t)j||(j=q.createQuadGeom()),r=j;else{var o=function(e,t){for(var i=e.getParent();i;){var n=te(i),r=n&&2===n.state;if(r&&t&&n.mesh.material.map.needsUpdate&&i.level>0&&(r=!1),r)break;i=i.getParent()}return i}(e);t=se(o).material;var s=function(e,t){var i=1<<e.level-t.level,n=1/i,r=n,o=Q(t);n/=o.x,r/=o.y;var s=t.x*i,a=t.y*i,c=e.x-s,h=e.y-a,u=Q(e);c*=n,h=1-(h*=r)-r*u.y;var d=new l;return d.offsetX=c,d.offsetY=h,d.scaleX=n*u.x,d.scaleY=r*u.y,d}(e,o);r=q.acquireQuadGeom(s)}var a=new b.LMVMesh(r,t);a.tile=e,a.modelId=L,a.themingColor=D;var c=J(e.level),h=Q(e),u=(1-h.y)*c*n,d=$(e),p=ee(e);return a.position.set(d,p+u,0),a.scale.set(c*h.x*n,c*h.y*n,1),t.uniforms.offsetRepeat.value.set(t.map.offset.x,t.map.offset.y,t.map.repeat.x,t.map.repeat.y),a}this.setAggressivePrefetching=function(e){X=e},this.getScene=function(e){return h[e=e||0]},this.getModelMatrix=function(){return p},this.getInverseModelMatrix=function(){return p?(f||(f=p.clone().invert()),f):null},this.setModelMatrix=function(e){e?(p=p||new a.Matrix4,p.copy(e)):p=null,f=null},this.nextBatch=function(e){return V[e=e||0]?null:(V[e]=!0,h[0].renderImportance=N?-1:void 0,h[0])},this.getSceneCount=function(){return 1},this.done=function(e){return V[e||0]},this.rayCast=function(e,t){return null},this.getVisibleBounds=function(e,t){let n=s;R&&(n=n.clone().intersect(R)),e&&(e.copy(n),i.placementTransform&&e.applyMatrix4(i.placementTransform),p&&e.applyMatrix4(p)),t&&(t.copy(n),i.placementTransform&&t.applyMatrix4(i.placementTransform),p&&t.applyMatrix4(p))},this.setViewBounds=function(e){R=e,I.setViewportBoundsForModel(L,R)},this.getViewBounds=function(){return R},this.setDoNotCut=function(e){return O=e},this.getDoNotCut=function(){return O};var re=this;function oe(t){var n=(0,r.tile2Index)(t),o=U[n];if(!o||0===o.state){o||(o=new _(B.slice()),U[n]=o),o.state=1;var l=function(e){var t=i.levelOffset?i.levelOffset:0;return i.urlPattern.replace("{x}",e.x).replace("{y}",e.y).replace("{z}",e.level+t)}(t),c=function(n){if(!re||!n)return;0===i.maxLevel&&(-1===i.texWidth&&(i.texWidth=n.image.width),-1===i.texHeight&&(i.texHeight=n.image.height),-1===i.tileSize&&(i.tileSize=Math.max(n.image.width,n.image.height)),i.options&&(i.options.loadOptions.texWidth=i.texWidth,i.options.loadOptions.texHeight=i.texHeight),s=e.getBBox()),function(e){for(var t=e.image,i=1;(i*=2)<t.width;);for(var n=1;(n*=2)<t.height;);if(i!==t.width||n!==t.height){var r=x.createElement("canvas");r.width=i,r.height=n;var o=r.getContext("2d");o.drawImage(t,0,0);var s,a,l=o.getImageData(0,0,i,n),c=new Uint32Array(l.data.buffer,0,i*n);if(t.height<n){var h=t.height*i;for(s=t.height;s<n;++s,h+=i)for(a=0;a<t.width;++a)c[h+a]=c[h+a-i]}if(t.width<i){var u=0;for(s=0;s<n;++s,u+=i)for(a=t.width;a<i;++a)c[u+a]=c[u+a-1]}o.putImageData(l,0,0),e.image=r,e.flipY&&e.offset.set(0,1-t.height/n),e.repeat.set(t.width/i,t.height/n)}}(n),n.minFilter=a.LinearMipMapLinearFilter,n.magFilter=a.LinearFilter,n.anisotropy=Math.min(4,Math.max(i.maxAnisotropy,1));const r=(0,d.createShaderMaterial)(y);r.supportsMrtNormals=!0,r.supportsViewportBounds=!0,r.map=r.uniforms.map.value=n,r.side=a.DoubleSide,r.doNotCut=re.getDoNotCut(),r.tile=t,r.disableEnvMap=!0,-1!==l.toLowerCase().indexOf(".png")&&(r.transparent=!0,r.alphaTest=.01);var c=ne(t,r);o.mesh=c,o.state=2,G--,H=!0;var h=n&&n.image?n.image.src:null;h&&a.Cache&&a.Cache.get(h)&&a.Cache.remove(h),0===t.level&&i.onRootLoaded&&(L=i.onRootLoaded()),c.themingColor=D,c.modelId=L,r.name=`model:${L}|${l}`,I.addMaterial(r.name,r,!0),I.setMaterialViewportBounds(r,R),re._updateMaterialVisibility(r),re._updateMaterialSelection(r)};G++,i.textureLoader(l,(function(e,t){c(e)}),(function(e){i.onDone(e,null),console.error(e)}))}}function se(e){var t=(0,r.tile2Index)(e),i=U[t];return i&&2===i.state?i.mesh:null}function ae(e,t){var i=$(e)*T,n=ee(e)*C;t.set(i,n,0)}function le(e,t){var i=J(e.level),n=($(e)+i)*T,r=(ee(e)+i)*C;t.set(n,r,0)}this.requestRootTile=function(){oe(new r.TileCoords(0,0,0))};var ce,he,ue,de=(ce=new a.Vector3,he=new a.Vector3,ue=new a.Box3,function(e,t){return ae(e,ce),le(e,he),ue.set(ce,he),t.intersectsBox(ue)>0}),pe=function(){var e=new a.Vector3,t=new a.Vector3;return function(i,n,r){var o=J(i.level);ae(i,e),le(i,t);var s=u.SceneMath.pointToMinMaxBoxDistance2(r,e,t);return(de(i,n)?100:1)*(o*o)/(s=Math.max(s,1e-4))}}(),fe=function(){const e=new a.Vector3,t=new a.Vector3;return function(n,r,o){ae(n,e),le(n,t);const s=Math.abs(function(e,t,i,n){var r=e.clone();return r.max(i),r.min(n),r.sub(e).dot(t)}(r.position,o,e,t)),a=i.getPixelRatio(),l=r.pixelsPerUnitAtDistance(s)*a;return(t.y-e.y)*l}}();function me(e,t){this.tile=e,this.prio=t}function ge(e,t){return e.prio>t.prio}function ve(e,t){var i=U[(0,r.tile2Index)(e)];i&&i.timeStamps[t]!==B[t]&&(i.timeStamps[t]=B[t],z++)}function ye(e,t,i){e.sort((function(e,n){var r=pe(e,t,i);return pe(n,t,i)-r}));for(var n=0,r=0;r<e.length;r++){var o=te(e[r]);if(!o||1!==o.state){if(G>=5)break;oe(e[r]),n++}}return n}function be(e){if(e&&e.mesh&&e.mesh.material){var t=e.mesh.material;I.removeMaterial(t.name),t.map.dispose(),t.map.needsUpdate=!0;t.dispatchEvent({type:"dispose"}),t.needsUpdate=!0}}function xe(e){for(var t=0;t<B.length;t++){if(!!h[t]&&e.timeStamps[t]===B[t])return!0}return!1}this.dispose=function(){var e;for(e in U)be(U[e]);j&&(j.dispose(),j.needsUpdate=!0),q.dispose()},this.dtor=function(){this.dispose(),re=null,I=null},this.reset=function(e,t,n){const s=(n=n||0)>0,l=h[n];var c,u;for(({camera:t,frustum:e}=function(e,t,i){const n=e.matrixWorld;if(p?n.multiplyMatrices(p,e.matrix):n.copy(e.matrix),n.equals(v))T=1,C=1;else{n.decompose(E,A,S),m.makeRotationFromQuaternion(A),m.setPosition(E),T=S.x,C=S.y,M=i.clone(M),g.copy(m).invert(),M.transformCurrentView(g),M.updateCameraMatrices();const e=t.cutPlanes,r=t.areaCullThreshold;(t=w).areaCullThreshold=r,t.reset(M,e),i=M}return{camera:i,frustum:t}}(l,e,t)),c=0;c<l.children.length;c++){l.children[c].dispatchEvent({type:"removed"})}if(l.children.length=0,B[n]++,z=0,q.reset(),!ie(new r.TileCoords(0,0,0)))return V[n]=!0,!1;var d=new o.SortedList(ge),f=new r.TileCoords(0,0,0),y=pe(f,e,t.position);d.add(new me(f,y));for(var b=t.getWorldDirection(new a.Vector3),x=[],_=[],P=[];d.size()>0;){if(u=d.get(0).tile,d.removeAt(0),Z(u))continue;var D=!0;u.level===i.maxLevel&&(D=!1);fe(u,t,b)<i.tileSize&&i.isLevelPresent(u.level)&&(D=!1);var L=de(u,e);if(L&&(!ie(u)&&i.isLevelPresent(u.level)&&P.push(u),ve(u,n)),!L&&x.length+_.length>i.maxActiveTiles&&(D=!1),D)for(let i=0;i<4;i++){const n=u.getChild(i);y=pe(n,e,t.position),d.add(new me(n,y))}else L?x.push(u):_.push(u)}var I=0;H=!1;var R=!0;for(c=0;c<x.length;++c){var O=se(u=x[c]);O&&O.material.map.needsUpdate&&!X&&(I<5||s?I++:(O=ne(u,null),H=!0,R=!1)),O||(O=ne(u,null),R=!1),l.add(O)}V[n]=!1;var N=ye(P,e,t.position);z+=G;var k=[];for(c=0;c<_.length&&!(z>=i.maxActiveTiles);c++)if(ie(u=_[c]))for(let e=0;e<=u.level;e++){if(ve(u.getParentAtLevel(e),n),z>i.maxActiveTiles)break}else k.push(u),z++;if(N+=ye(k,e,t.position),X){for(k=[],c=0;c<x.length;++c)if((u=x[c]).level!==i.maxLevel&&i.isLevelPresent(u.level+1))for(let t=0;t<4;t++){const i=u.getChild(t);!Z(i)&&de(i,e)&&(ie(i)||(k.push(i),z++))}N+=ye(k,e,t.position)}if(s||function(e,t,n){var o=Object.keys(U),s=o.length,a=e-(i.cacheSize-s);if(!(a<=0)){o.sort((function(e,i){var o=U[e].timeStamps[0],s=U[i].timeStamps[0];if(o!==s)return o-s;var a=(0,r.index2Tile)(e),l=(0,r.index2Tile)(i);return pe(a,t,n)-pe(l,t,n)}));for(var l=Math.min(a,o.length),c=0;c<l;c++){var h=o[c];if(0!==(0,r.index2Tile)(h).level){var u=U[h];if(2===u.state){if(xe(u))break;be(u),delete U[h]}}}}}(N,e,t.position),R&&W.length>0){var F=W.splice(0,W.length);setTimeout((function(){for(var e=0;e<F.length;e++)F[e](n)}),1)}return R},this.callWhenRefined=function(e){W.push(e)},this.update=function(){return H},this.setDpiScale=function(e){n=e},this.getDpiScale=function(){return n},this.setThemingColor=function(e){D.copy(e)},this.clearThemingColor=function(){D.copy(P)},this.unregisterView=function(e){h[e]=void 0,B[e]=void 0,V[e]=void 0;for(var t=h.length;t>0&&!h[t-1];)t--;h.length=t,B.length=t,V.length=t},this._updateMaterialVisibility=function(e){!e.defines.GHOSTED^!N&&(N?e.defines.GHOSTED=1:delete e.defines.GHOSTED,e.needsUpdate=!0)},this.setVisibility=function(e){N=!e,I.forEachInModel(L,!1,(e=>{this._updateMaterialVisibility(e)}))},this._updateMaterialSelection=function(e){e.uniforms.selectionColor.value.set(F.r,F.g,F.b,k?.6:0)},this.highlightSelection=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F;k=e,F=t,I.forEachInModel(L,!1,(e=>{this._updateMaterialSelection(e)}))}}},24201:(e,t,i)=>{"use strict";function n(e,t,i){this.level=e,this.x=t,this.y=i}function r(e){var t=((1<<2*e.level)-1)/3,i=1<<e.level;return t+e.y*i+e.x}function o(e){for(var t=new n(0,0,0);r(t)<=e;)t.level++;t.level--;var i=e-r(t),o=1<<t.level;return t.y=Math.floor(i/o),t.x=i%o,t}i.r(t),i.d(t,{TileCoords:()=>n,index2Tile:()=>o,tile2Index:()=>r}),n.prototype={constructor:n,copy:function(){return new n(this.level,this.x,this.y)},isValid:function(){return Number.isInteger(this.level)&&this.level>=0&&Number.isInteger(this.x)&&Number.isInteger(this.y)},getChild:function(e){var t=1&e?1:0,i=2&e?1:0;return new n(this.level+1,2*this.x+t,2*this.y+i)},getParent:function(){return 0===this.level?null:new n(this.level-1,Math.floor(this.x/2),Math.floor(this.y/2))},getParentAtLevel:function(e){if(e<0||e>this.level)return null;var t=this.level-e;return new n(e,Math.floor(this.x>>t),Math.floor(this.y>>t))},toString:function(){return"("+this.level+", "+this.x+", "+this.y+")"},equals:function(e,t,i){return e instanceof n?this.equals(e.level,e.x,e.y):this.level===e&&this.x===t&&this.y===i}}},35255:(e,t,i)=>{var n;
  19. /*! Hammer.JS - v2.0.8 - 2016-04-23
  20. * http://hammerjs.github.io/
  21. *
  22. * Copyright (c) 2016 Jorik Tangelder;
  23. * Licensed under the MIT license */!function(r,o,s,a){"use strict";var l=["","webkit","Moz","MS","ms","o"],c=o.createElement("div"),h=Math.round,u=Math.abs,d=Date.now;function p(e,t,i){return setTimeout(_(e,i),t)}function f(e,t,i){return!!Array.isArray(e)&&(m(e,i[t],i),!0)}function m(e,t,i){var n;if(e)if(e.forEach)e.forEach(t,i);else if(e.length!==a)for(n=0;n<e.length;)t.call(i,e[n],n,e),n++;else for(n in e)e.hasOwnProperty(n)&&t.call(i,e[n],n,e)}function g(e,t,i){var n="DEPRECATED METHOD: "+t+"\n"+i+" AT \n";return function(){var t=new Error("get-stack-trace"),i=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,n,i),e.apply(this,arguments)}}var v=function(e){if(e===a||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==a&&null!==n)for(var r in n)n.hasOwnProperty(r)&&(t[r]=Array.isArray(n[r])?n[r].slice(0):n[r])}return t},y=g((function(e,t,i){for(var n=Object.keys(t),r=0;r<n.length;)(!i||i&&e[n[r]]===a)&&(e[n[r]]=t[n[r]]),r++;return e}),"extend","Use `assign`."),b=g((function(e,t){return y(e,t,!0)}),"merge","Use `assign`.");function x(e,t,i){var n,r=t.prototype;(n=e.prototype=Object.create(r)).constructor=e,n._super=r,i&&v(n,i)}function _(e,t){return function(){return e.apply(t,arguments)}}function E(e,t){return"function"==typeof e?e.apply(t&&t[0]||a,t):e}function A(e,t){return e===a?t:e}function S(e,t,i){m(C(t),(function(t){e.addEventListener(t,i,!1)}))}function w(e,t,i){m(C(t),(function(t){e.removeEventListener(t,i,!1)}))}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function T(e,t){return e.indexOf(t)>-1}function C(e){return e.trim().split(/\s+/g)}function P(e,t,i){if(e.indexOf&&!i)return e.indexOf(t);for(var n=0;n<e.length;){if(i&&e[n][i]==t||!i&&e[n]===t)return n;n++}return-1}function D(e){return Array.prototype.slice.call(e,0)}function L(e,t,i){for(var n=[],r=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];P(r,s)<0&&n.push(e[o]),r[o]=s,o++}return i&&(n=t?n.sort((function(e,i){return e[t]>i[t]})):n.sort()),n}function I(e,t){for(var i,n,r=t[0].toUpperCase()+t.slice(1),o=0;o<l.length;){if((n=(i=l[o])?i+r:t)in e)return n;o++}return a}var R=1;function O(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||r}var N="ontouchstart"in r,k=I(r,"PointerEvent")!==a,F=N&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),V="touch",U="mouse",B=24,z=["x","y"],G=["clientX","clientY"];function H(e,t){var i=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){E(e.options.enable,[e])&&i.handler(t)},this.init()}function W(e,t,i){var n=i.pointers.length,r=i.changedPointers.length,o=1&t&&n-r==0,s=12&t&&n-r==0;i.isFirst=!!o,i.isFinal=!!s,o&&(e.session={}),i.eventType=t,function(e,t){var i=e.session,n=t.pointers,r=n.length;i.firstInput||(i.firstInput=j(t));r>1&&!i.firstMultiple?i.firstMultiple=j(t):1===r&&(i.firstMultiple=!1);var o=i.firstInput,s=i.firstMultiple,l=s?s.center:o.center,c=t.center=X(n);t.timeStamp=d(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=Z(l,c),t.distance=K(l,c),function(e,t){var i=t.center,n=e.offsetDelta||{},r=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(r=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=e.offsetDelta={x:i.x,y:i.y});t.deltaX=r.x+(i.x-n.x),t.deltaY=r.y+(i.y-n.y)}(i,t),t.offsetDirection=Y(t.deltaX,t.deltaY);var h=q(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=u(h.x)>u(h.y)?h.x:h.y,t.scale=s?(p=s.pointers,f=n,K(f[0],f[1],G)/K(p[0],p[1],G)):1,t.rotation=s?function(e,t){return Z(t[1],t[0],G)-Z(e[1],e[0],G)}(s.pointers,n):0,t.maxPointers=i.prevInput?t.pointers.length>i.prevInput.maxPointers?t.pointers.length:i.prevInput.maxPointers:t.pointers.length,function(e,t){var i,n,r,o,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===a)){var c=t.deltaX-s.deltaX,h=t.deltaY-s.deltaY,d=q(l,c,h);n=d.x,r=d.y,i=u(d.x)>u(d.y)?d.x:d.y,o=Y(c,h),e.lastInterval=t}else i=s.velocity,n=s.velocityX,r=s.velocityY,o=s.direction;t.velocity=i,t.velocityX=n,t.velocityY=r,t.direction=o}(i,t);var p,f;var m=e.element;M(t.srcEvent.target,m)&&(m=t.srcEvent.target);t.target=m}(e,i),e.emit("hammer.input",i),e.recognize(i),e.session.prevInput=i}function j(e){for(var t=[],i=0;i<e.pointers.length;)t[i]={clientX:h(e.pointers[i].clientX),clientY:h(e.pointers[i].clientY)},i++;return{timeStamp:d(),pointers:t,center:X(t),deltaX:e.deltaX,deltaY:e.deltaY}}function X(e){var t=e.length;if(1===t)return{x:h(e[0].clientX),y:h(e[0].clientY)};for(var i=0,n=0,r=0;r<t;)i+=e[r].clientX,n+=e[r].clientY,r++;return{x:h(i/t),y:h(n/t)}}function q(e,t,i){return{x:t/e||0,y:i/e||0}}function Y(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function K(e,t,i){i||(i=z);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return Math.sqrt(n*n+r*r)}function Z(e,t,i){i||(i=z);var n=t[i[0]]-e[i[0]],r=t[i[1]]-e[i[1]];return 180*Math.atan2(r,n)/Math.PI}H.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)}};var Q={mousedown:1,mousemove:2,mouseup:4},J="mousedown",$="mousemove mouseup";function ee(){this.evEl=J,this.evWin=$,this.pressed=!1,H.apply(this,arguments)}x(ee,H,{handler:function(e){var t=Q[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:U,srcEvent:e}))}});var te={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},ie={2:V,3:"pen",4:U,5:"kinect"},ne="pointerdown",re="pointermove pointerup pointercancel";function oe(){this.evEl=ne,this.evWin=re,H.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ne="MSPointerDown",re="MSPointerMove MSPointerUp MSPointerCancel"),x(oe,H,{handler:function(e){var t=this.store,i=!1,n=e.type.toLowerCase().replace("ms",""),r=te[n],o=ie[e.pointerType]||e.pointerType,s=o===V,a=o===U,l=P(t,e.pointerId,"pointerId");1&r&&(0===e.button||s)?l<0&&(t.push(e),l=t.length-1):12&r&&(i=!0),l<0||(t[l]=e,a&&!this.manager.options.handlePointerEventMouse||this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),i&&t.splice(l,1))}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart",le="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ae,this.evWin=le,this.started=!1,H.apply(this,arguments)}function he(e,t){var i=D(e.touches),n=D(e.changedTouches);return 12&t&&(i=L(i.concat(n),"identifier",!0)),[i,n]}x(ce,H,{handler:function(e){var t=se[e.type];if(1===t&&(this.started=!0),this.started){var i=he.call(this,e,t);12&t&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:V,srcEvent:e})}}});var ue={touchstart:1,touchmove:2,touchend:4,touchcancel:8},de="touchstart touchmove touchend touchcancel";function pe(){this.evTarget=de,this.targetIds={},H.apply(this,arguments)}function fe(e,t){var i=D(e.touches),n=this.targetIds;if(3&t&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=D(e.changedTouches),a=[],l=this.target;if(o=i.filter((function(e){return M(e.target,l)})),1===t)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;for(r=0;r<s.length;)n[s[r].identifier]&&a.push(s[r]),12&t&&delete n[s[r].identifier],r++;return a.length?[L(o.concat(a),"identifier",!0),a]:void 0}x(pe,H,{handler:function(e){var t=ue[e.type],i=fe.call(this,e,t);i&&this.callback(this.manager,t,{pointers:i[0],changedPointers:i[1],pointerType:V,srcEvent:e})}});function me(){H.apply(this,arguments);var e=_(this.handler,this);this.touch=new pe(this.manager,e),this.mouse=new ee(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function ge(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,ve.call(this,t)):12&e&&ve.call(this,t)}function ve(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var i={x:t.clientX,y:t.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var e=n.indexOf(i);e>-1&&n.splice(e,1)}),2500)}}function ye(e){for(var t=e.srcEvent.clientX,i=e.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(t-r.x),s=Math.abs(i-r.y);if(o<=25&&s<=25)return!0}return!1}x(me,H,{handler:function(e,t,i){var n=i.pointerType==V,r=i.pointerType==U;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)ge.call(this,t,i);else if(r&&ye.call(this,i))return;this.callback(e,t,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var be=I(c.style,"touchAction"),xe=be!==a,_e="compute",Ee="auto",Ae="manipulation",Se="none",we="pan-x",Me="pan-y",Te=function(){if(!xe)return!1;var e={},t=r.CSS&&r.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){e[i]=!t||r.CSS.supports("touch-action",i)})),e}();function Ce(e,t){this.manager=e,this.set(t)}Ce.prototype={set:function(e){e==_e&&(e=this.compute()),xe&&this.manager.element.style&&Te[e]&&(this.manager.element.style[be]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return m(this.manager.recognizers,(function(t){E(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(T(e,Se))return Se;var t=T(e,we),i=T(e,Me);if(t&&i)return Se;if(t||i)return t?we:Me;if(T(e,Ae))return Ae;return Ee}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,i=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var n=this.actions,r=T(n,Se)&&!Te.none,o=T(n,Me)&&!Te["pan-y"],s=T(n,we)&&!Te["pan-x"];if(r){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&6&i||s&&i&B?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Pe=32;function De(e){this.options=v({},this.defaults,e||{}),this.id=R++,this.manager=null,this.options.enable=A(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Le(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ie(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Re(e,t){var i=t.manager;return i?i.get(e):e}function Oe(){De.apply(this,arguments)}function Ne(){Oe.apply(this,arguments),this.pX=null,this.pY=null}function ke(){Oe.apply(this,arguments)}function Fe(){De.apply(this,arguments),this._timer=null,this._input=null}function Ve(){Oe.apply(this,arguments)}function Ue(){Oe.apply(this,arguments)}function Be(){De.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ze(e,t){return(t=t||{}).recognizers=A(t.recognizers,ze.defaults.preset),new Ge(e,t)}De.prototype={defaults:{},set:function(e){return v(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Re(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Re(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===P(t,e=Re(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Re(e,this);var t=P(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,i=this.state;function n(i){t.manager.emit(i,e)}i<8&&n(t.options.event+Le(i)),n(t.options.event),e.additionalEvent&&n(e.additionalEvent),i>=8&&n(t.options.event+Le(i))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Pe},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=v({},e);if(!E(this.options.enable,[this,t]))return this.reset(),void(this.state=Pe);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},x(Oe,De,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,i=e.eventType,n=6&t,r=this.attrTest(e);return n&&(8&i||!r)?16|t:n||r?4&i?8|t:2&t?4|t:2:Pe}}),x(Ne,Oe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Me),e&B&&t.push(we),t},directionTest:function(e){var t=this.options,i=!0,n=e.distance,r=e.direction,o=e.deltaX,s=e.deltaY;return r&t.direction||(6&t.direction?(r=0===o?1:o<0?2:4,i=o!=this.pX,n=Math.abs(e.deltaX)):(r=0===s?1:s<0?8:16,i=s!=this.pY,n=Math.abs(e.deltaY))),e.direction=r,i&&n>t.threshold&&r&t.direction},attrTest:function(e){return Oe.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ie(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),x(ke,Oe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),x(Fe,De,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ee]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime>t.time;if(this._input=e,!n||!i||12&e.eventType&&!r)this.reset();else if(1&e.eventType)this.reset(),this._timer=p((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Pe},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),x(Ve,Oe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),x(Ue,Oe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ne.prototype.getTouchAction.call(this)},attrTest:function(e){var t,i=this.options.direction;return 30&i?t=e.overallVelocity:6&i?t=e.overallVelocityX:i&B&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&i&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ie(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),x(Be,De,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,i=e.pointers.length===t.pointers,n=e.distance<t.threshold,r=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(n&&r&&i){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||K(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=p((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Pe},failTimeout:function(){return this._timer=p((function(){this.state=Pe}),this.options.interval,this),Pe},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ze.VERSION="2.0.8",ze.defaults={domEvents:!1,touchAction:_e,enable:!0,handlePointerEventMouse:!0,inputTarget:null,inputClass:null,preset:[[Ve,{enable:!1}],[ke,{enable:!1},["rotate"]],[Ue,{direction:6}],[Ne,{direction:6},["swipe"]],[Be],[Be,{event:"doubletap",taps:2},["tap"]],[Fe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Ge(e,t){var i;this.options=v({},ze.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((i=this).options.inputClass||(k?oe:F?pe:N?me:ee))(i,W),this.touchAction=new Ce(this,this.options.touchAction),He(this,!0),m(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function He(e,t){var i,n=e.element;n.style&&(m(e.options.cssProps,(function(r,o){i=I(n.style,o),t?(e.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=e.oldCssProps[i]||""})),t||(e.oldCssProps={}))}Ge.prototype={set:function(e){return v(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var i;this.touchAction.preventDefaults(e);var n=this.recognizers,r=t.curRecognizer;(!r||r&&8&r.state)&&(r=t.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===t.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(e),!r&&14&i.state&&(r=t.curRecognizer=i),o++}},get:function(e){if(e instanceof De)return e;for(var t=this.recognizers,i=0;i<t.length;i++)if(t[i].options.event==e)return t[i];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,i=P(t,e);-1!==i&&(t.splice(i,1),this.touchAction.update())}return this},on:function(e,t){if(e!==a&&t!==a){var i=this.handlers;return m(C(e),(function(e){i[e]=i[e]||[],i[e].push(t)})),this}},off:function(e,t){if(e!==a){var i=this.handlers;return m(C(e),(function(e){t?i[e]&&i[e].splice(P(i[e],t),1):delete i[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var i=o.createEvent("Event");i.initEvent(e,!0,!0),i.gesture=t,t.target.dispatchEvent(i)}(e,t);var i=this.handlers[e]&&this.handlers[e].slice();if(i&&i.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()},t.stopPropagation=function(){t.srcEvent.stopPropagation()};for(var n=0;n<i.length;)i[n](t),n++}},destroy:function(){this.element&&He(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},v(ze,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Pe,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:B,DIRECTION_ALL:30,Manager:Ge,Input:H,TouchAction:Ce,TouchInput:pe,MouseInput:ee,PointerEventInput:oe,TouchMouseInput:me,SingleTouchInput:ce,Recognizer:De,AttrRecognizer:Oe,Tap:Be,Pan:Ne,Swipe:Ue,Pinch:ke,Rotate:Ve,Press:Fe,on:S,off:w,each:m,merge:b,extend:y,assign:v,inherit:x,bindFn:_,prefixed:I}),(void 0!==r?r:"undefined"!=typeof self?self:{}).Hammer=ze,(n=function(){return ze}.call(t,i,t,e))===a||(e.exports=n)}(window,document)},22907:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DDSLoader:()=>r});var n=i(41434),r=function(){this._parser=r.parse};r.prototype=Object.create(n.CompressedTextureLoader.prototype),r.prototype.constructor=r,r.parse=function(e,t){var i={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};function r(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function o(e,t,i,n){for(var r=i*n*4,o=new Uint8Array(e,t,r),s=new Uint8Array(r),a=0,l=0,c=0;c<n;c++)for(var h=0;h<i;h++){var u=o[l],d=o[++l],p=o[++l],f=o[++l];l++,s[a]=p,s[++a]=d,s[++a]=u,s[++a]=f,a++}return s}var s=r("DXT1"),a=r("DXT3"),l=r("DXT5");if(e.byteLength<124)return console.error("THREE.DDSLoader.parse: File is empty or incomplete."),i;var c,h=new Int32Array(e,0,31);if(542327876!==h[0])return console.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),i;if(4&!h[20])return console.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),i;var u,d=h[21],p=!1;switch(d){case s:c=8,i.format=n.RGB_S3TC_DXT1_Format;break;case a:c=16,i.format=n.RGBA_S3TC_DXT3_Format;break;case l:c=16,i.format=n.RGBA_S3TC_DXT5_Format;break;default:if(!(32==h[22]&&16711680&h[23]&&65280&h[24]&&255&h[25]&&4278190080&h[26]))return console.error("THREE.DDSLoader.parse: Unsupported FourCC code ",(u=d,String.fromCharCode(255&u,u>>8&255,u>>16&255,u>>24&255))),i;p=!0,c=64,i.format=n.RGBAFormat}i.mipmapCount=1,h[7]>0&&!1!==t&&(i.mipmapCount=Math.max(1,h[7])),i.isCubemap=!!(512&h[28]),i.width=h[4],i.height=h[3];for(var f=h[1]+4,m=i.width,g=i.height,v=i.isCubemap?6:1,y=0;y<v;y++){for(var b=0;b<i.mipmapCount;b++){if(p)var x=(_=o(e,f,m,g)).length;else{x=Math.max(4,m)/4*Math.max(4,g)/4*c;var _=new Uint8Array(e,f,x)}var E={data:_,width:m,height:g};i.mipmaps.push(E),f+=x,m=Math.max(.5*m,1),g=Math.max(.5*g,1)}m=i.width,g=i.height}return i}},76063:(e,t,i)=>{"use strict";
  24. /*!
  25. MIT License
  26. Copyright (c) 2019 Fyrestar
  27. Permission is hereby granted, free of charge, to any person obtaining a copy
  28. of this software and associated documentation files (the "Software"), to deal
  29. in the Software without restriction, including without limitation the rights
  30. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  31. copies of the Software, and to permit persons to whom the Software is
  32. furnished to do so, subject to the following conditions:
  33. The above copyright notice and this permission notice shall be included in all
  34. copies or substantial portions of the Software.
  35. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  36. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  37. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  38. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  39. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  40. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  41. SOFTWARE.
  42. */
  43. function n(e,t){for(let i in t){const n=t[i];if("@"===i[0]){const t=i.substr(1);e=e.replace(t,n)}else if("?"===i[0]){const t=i.substr(1);e=e.replace(t,n+"\n"+t)}else e=e.replace(i,i+"\n"+n)}return e}function r(e,t){const i=(t.header||"")+"\n";let r=(t.vertexHeader||"")+"\n"+e.vertexShader,o=(t.fragmentHeader||"")+"\n"+e.fragmentShader;return t.vertexEnd&&(r=r.replace(/\}(?=[^\}]*$)/g,t.vertexEnd+"\n}")),t.fragmentEnd&&(o=o.replace(/\}(?=[^\}]*$)/g,t.fragmentEnd+"\n}")),void 0!==t.vertex&&(r=n(r,t.vertex)),void 0!==t.fragment&&(o=n(o,t.fragment)),e.vertexShader=i+r,e.fragmentShader=i+o,e}i.r(t),i.d(t,{patchShader:()=>r})},31802:(e,t,i)=>{"use strict";i.r(t),i.d(t,{polyfillTHREE:()=>d});const n=(e,t,i)=>{"object"!=typeof e&&"function"!=typeof e||Object.prototype.hasOwnProperty.call(e,t)||(e[t]=i)},r=(e,t,i)=>{"object"==typeof e&&Object.defineProperty(e,t,i)},o=e=>{const t=parseInt(e.REVISION)>=72;n(e,"BoxBufferGeometry",class extends e.BufferGeometry{constructor(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;super(),this.type="BoxGeometry",this.parameters={width:i,height:n,depth:r,widthSegments:o,heightSegments:s,depthSegments:a};const l=this;o=Math.floor(o),s=Math.floor(s),a=Math.floor(a);const c=[],h=[],u=[],d=[];let p=0,f=0;function m(i,n,r,o,s,a,m,g,v,y,b){const x=a/v,_=m/y,E=a/2,A=m/2,S=g/2,w=v+1,M=y+1;let T=0,C=0;const P=new e.Vector3;for(let e=0;e<M;e++){const t=e*_-A;for(let a=0;a<w;a++){const l=a*x-E;P[i]=l*o,P[n]=t*s,P[r]=S,h.push(P.x,P.y,P.z),P[i]=0,P[n]=0,P[r]=g>0?1:-1,u.push(P.x,P.y,P.z),d.push(a/v),d.push(1-e/y),T+=1}}for(let e=0;e<y;e++)for(let t=0;t<v;t++){const i=p+t+w*e,n=p+t+w*(e+1),r=p+(t+1)+w*(e+1),o=p+(t+1)+w*e;c.push(i,n,o),c.push(n,r,o),C+=6}t||(b=0),l.addGroup(f,C,b),f+=C,p+=T}m("z","y","x",-1,-1,r,n,i,a,s,0),m("z","y","x",1,-1,r,n,-i,a,s,1),m("x","z","y",1,1,i,r,n,o,a,2),m("x","z","y",1,-1,i,r,-n,o,a,3),m("x","y","z",1,-1,i,n,r,o,s,4),m("x","y","z",-1,-1,i,n,-r,o,s,5),this.setIndex(c),this.setAttribute("position",new e.Float32BufferAttribute(h,3)),this.setAttribute("normal",new e.Float32BufferAttribute(u,3)),this.setAttribute("uv",new e.Float32BufferAttribute(d,2))}})},s=e=>{n(e,"CircleBufferGeometry",class extends e.BufferGeometry{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI;super(),this.type="CircleGeometry",this.parameters={radius:t,segments:i,thetaStart:n,thetaLength:r},i=Math.max(3,i);const o=[],s=[],a=[],l=[],c=new e.Vector3,h=new e.Vector2;s.push(0,0,0),a.push(0,0,1),l.push(.5,.5);for(let e=0,o=3;e<=i;e++,o+=3){const u=n+e/i*r;c.x=t*Math.cos(u),c.y=t*Math.sin(u),s.push(c.x,c.y,c.z),a.push(0,0,1),h.x=(s[o]/t+1)/2,h.y=(s[o+1]/t+1)/2,l.push(h.x,h.y)}for(let e=1;e<=i;e++)o.push(e,e+1,0);this.setIndex(o),this.setAttribute("position",new e.Float32BufferAttribute(s,3)),this.setAttribute("normal",new e.Float32BufferAttribute(a,3)),this.setAttribute("uv",new e.Float32BufferAttribute(l,2))}})},a=e=>{const t=parseInt(e.REVISION)>=72;n(e,"CylinderBufferGeometry",class extends e.BufferGeometry{constructor(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:2*Math.PI;super(),this.type="CylinderGeometry",this.parameters={radiusTop:i,radiusBottom:n,height:r,radialSegments:o,heightSegments:s,openEnded:a,thetaStart:l,thetaLength:c};const h=this;o=Math.floor(o),s=Math.floor(s);const u=[],d=[],p=[],f=[];let m=0;const g=[],v=r/2;let y=0;function b(r){const s=m,a=new e.Vector2,g=new e.Vector3;let b=0;const x=!0===r?i:n,_=!0===r?1:-1;for(let e=1;e<=o;e++)d.push(0,v*_,0),p.push(0,_,0),f.push(.5,.5),m++;const E=m;for(let e=0;e<=o;e++){const t=e/o*c+l,i=Math.cos(t),n=Math.sin(t);g.x=x*n,g.y=v*_,g.z=x*i,d.push(g.x,g.y,g.z),p.push(0,_,0),a.x=.5*i+.5,a.y=.5*n*_+.5,f.push(a.x,a.y),m++}for(let e=0;e<o;e++){const t=s+e,i=E+e;!0===r?u.push(i,i+1,t):u.push(i+1,i,t),b+=3}const A=t?!0===r?1:2:0;h.addGroup(y,b,A),y+=b}!function(){const t=new e.Vector3,a=new e.Vector3;let b=0;const x=(n-i)/r;for(let e=0;e<=s;e++){const h=[],u=e/s,y=u*(n-i)+i;for(let e=0;e<=o;e++){const i=e/o,n=i*c+l,s=Math.sin(n),g=Math.cos(n);a.x=y*s,a.y=-u*r+v,a.z=y*g,d.push(a.x,a.y,a.z),t.set(s,x,g).normalize(),p.push(t.x,t.y,t.z),f.push(i,1-u),h.push(m++)}g.push(h)}for(let e=0;e<o;e++)for(let t=0;t<s;t++){const i=g[t][e],n=g[t+1][e],r=g[t+1][e+1],o=g[t][e+1];u.push(i,n,o),u.push(n,r,o),b+=6}h.addGroup(y,b,0),y+=b}(),!1===a&&(i>0&&b(!0),n>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new e.Float32BufferAttribute(d,3)),this.setAttribute("normal",new e.Float32BufferAttribute(p,3)),this.setAttribute("uv",new e.Float32BufferAttribute(f,2))}})},l=e=>{n(e,"PolyhedronBufferGeometry",class extends e.BufferGeometry{constructor(t,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:i,radius:n,detail:r};const o=[],s=[];function a(e,t,i,n){const r=n+1,o=[];for(let n=0;n<=r;n++){o[n]=[];const s=e.clone().lerp(i,n/r),a=t.clone().lerp(i,n/r),l=r-n;for(let e=0;e<=l;e++)o[n][e]=0===e&&n===r?s:s.clone().lerp(a,e/l)}for(let e=0;e<r;e++)for(let t=0;t<2*(r-e)-1;t++){const i=Math.floor(t/2);t%2==0?(l(o[e][i+1]),l(o[e+1][i]),l(o[e][i])):(l(o[e][i+1]),l(o[e+1][i+1]),l(o[e+1][i]))}}function l(e){o.push(e.x,e.y,e.z)}function c(e,i){const n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function h(e,t,i,n){n<0&&1===e.x&&(s[t]=e.x-1),0===i.x&&0===i.z&&(s[t]=n/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}function d(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(t){const n=new e.Vector3,r=new e.Vector3,o=new e.Vector3;for(let e=0;e<i.length;e+=3)c(i[e+0],n),c(i[e+1],r),c(i[e+2],o),a(n,r,o,t)}(r),function(t){const i=new e.Vector3;for(let e=0;e<o.length;e+=3)i.x=o[e+0],i.y=o[e+1],i.z=o[e+2],i.normalize().multiplyScalar(t),o[e+0]=i.x,o[e+1]=i.y,o[e+2]=i.z}(n),function(){const t=new e.Vector3;for(let e=0;e<o.length;e+=3){t.x=o[e+0],t.y=o[e+1],t.z=o[e+2];const i=u(t)/2/Math.PI+.5,n=d(t)/Math.PI+.5;s.push(i,1-n)}(function(){const t=new e.Vector3,i=new e.Vector3,n=new e.Vector3,r=new e.Vector3,a=new e.Vector2,l=new e.Vector2,c=new e.Vector2;for(let e=0,d=0;e<o.length;e+=9,d+=6){t.set(o[e+0],o[e+1],o[e+2]),i.set(o[e+3],o[e+4],o[e+5]),n.set(o[e+6],o[e+7],o[e+8]),a.set(s[d+0],s[d+1]),l.set(s[d+2],s[d+3]),c.set(s[d+4],s[d+5]),r.copy(t).add(i).add(n).divideScalar(3);const p=u(r);h(a,d+0,t,p),h(l,d+2,i,p),h(c,d+4,n,p)}})(),function(){for(let e=0;e<s.length;e+=6){const t=s[e+0],i=s[e+2],n=s[e+4],r=Math.max(t,i,n),o=Math.min(t,i,n);r>.9&&o<.1&&(t<.2&&(s[e+0]+=1),i<.2&&(s[e+2]+=1),n<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new e.Float32BufferAttribute(o,3)),this.setAttribute("normal",new e.Float32BufferAttribute(o.slice(),3)),this.setAttribute("uv",new e.Float32BufferAttribute(s,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}})},c=e=>{n(e,"OctahedronBufferGeometry",class extends e.PolyhedronBufferGeometry{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}})},h=e=>{n(e,"SphereBufferGeometry",class extends e.BufferGeometry{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Math.PI;super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:n,phiStart:r,phiLength:o,thetaStart:s,thetaLength:a},i=Math.max(3,Math.floor(i)),n=Math.max(2,Math.floor(n));const l=Math.min(s+a,Math.PI);let c=0;const h=[],u=new e.Vector3,d=new e.Vector3,p=[],f=[],m=[],g=[];for(let e=0;e<=n;e++){const p=[],v=e/n;let y=0;0==e&&0==s?y=.5/i:e==n&&l==Math.PI&&(y=-.5/i);for(let e=0;e<=i;e++){const n=e/i;u.x=-t*Math.cos(r+n*o)*Math.sin(s+v*a),u.y=t*Math.cos(s+v*a),u.z=t*Math.sin(r+n*o)*Math.sin(s+v*a),f.push(u.x,u.y,u.z),d.copy(u).normalize(),m.push(d.x,d.y,d.z),g.push(n+y,1-v),p.push(c++)}h.push(p)}for(let e=0;e<n;e++)for(let t=0;t<i;t++){const i=h[e][t+1],r=h[e][t],o=h[e+1][t],a=h[e+1][t+1];(0!==e||s>0)&&p.push(i,r,a),(e!==n-1||l<Math.PI)&&p.push(r,o,a)}this.setIndex(p),this.setAttribute("position",new e.Float32BufferAttribute(f,3)),this.setAttribute("normal",new e.Float32BufferAttribute(m,3)),this.setAttribute("uv",new e.Float32BufferAttribute(g,2))}})},u=e=>{n(e,"TorusBufferGeometry",class extends e.BufferGeometry{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.4,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:2*Math.PI;super(),this.type="TorusGeometry",this.parameters={radius:t,tube:i,radialSegments:n,tubularSegments:r,arc:o},n=Math.floor(n),r=Math.floor(r);const s=[],a=[],l=[],c=[],h=new e.Vector3,u=new e.Vector3,d=new e.Vector3;for(let e=0;e<=n;e++)for(let s=0;s<=r;s++){const p=s/r*o,f=e/n*Math.PI*2;u.x=(t+i*Math.cos(f))*Math.cos(p),u.y=(t+i*Math.cos(f))*Math.sin(p),u.z=i*Math.sin(f),a.push(u.x,u.y,u.z),h.x=t*Math.cos(p),h.y=t*Math.sin(p),d.subVectors(u,h).normalize(),l.push(d.x,d.y,d.z),c.push(s/r),c.push(e/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const i=(r+1)*e+t-1,n=(r+1)*(e-1)+t-1,o=(r+1)*(e-1)+t,a=(r+1)*e+t;s.push(i,n,a),s.push(n,o,a)}this.setIndex(s),this.setAttribute("position",new e.Float32BufferAttribute(a,3)),this.setAttribute("normal",new e.Float32BufferAttribute(l,3)),this.setAttribute("uv",new e.Float32BufferAttribute(c,2))}})},d=e=>{var t,i,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M,T,C,P,D,L,I,R,O,N,k,F,V,U,B;const z=new e.Vector3;n(null==e||null===(t=e.Camera)||void 0===t?void 0:t.prototype,"updateMatrixWorld",(function(t){e.Object3D.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()})),n(null==e||null===(i=e.Box2)||void 0===i?void 0:i.prototype,"getSize",(function(e){return this.isEmpty()?e.set(0,0):this.size(e)})),n(null==e||null===(d=e.Box3)||void 0===d?void 0:d.prototype,"getSize",(function(e){return this.isEmpty()?e.set(0,0,0):this.size(e)})),n(null==e||null===(p=e.Box2)||void 0===p?void 0:p.prototype,"intersectsBox",(function(e){return this.isIntersectionBox(e)})),n(null==e||null===(f=e.Box3)||void 0===f?void 0:f.prototype,"intersectsBox",(function(e){return this.isIntersectionBox(e)})),n(null==e||null===(m=e.Ray)||void 0===m?void 0:m.prototype,"intersectsBox",(function(e){return this.isIntersectionBox(e)})),n(null==e||null===(g=e.BufferAttribute)||void 0===g?void 0:g.prototype,"applyMatrix4",(function(e){for(let t=0,i=this.count;t<i;t++)z.x=this.getX(t),z.y=this.getY(t),z.z=this.getZ(t),z.applyMatrix4(e),this.setXYZ(t,z.x,z.y,z.z);return this})),n(null==e||null===(v=e.BufferAttribute)||void 0===v?void 0:v.prototype,"getX",(function(e){return this.array[e*this.itemSize]})),n(null==e||null===(y=e.BufferAttribute)||void 0===y?void 0:y.prototype,"getY",(function(e){return this.array[e*this.itemSize+1]})),n(null==e||null===(b=e.BufferAttribute)||void 0===b?void 0:b.prototype,"getZ",(function(e){return this.array[e*this.itemSize+2]})),r(null==e||null===(x=e.BufferAttribute)||void 0===x?void 0:x.prototype,"itemOffset",{get:function(){return this.offset},set:function(e){this.offset=e}}),"function"==typeof(null==e?void 0:e.BufferAttribute)&&(n(e,"Float32BufferAttribute",class extends e.BufferAttribute{constructor(e,t,i){super(new Float32Array(e),t,i)}}),n(e,"Uint16BufferAttribute",class extends e.BufferAttribute{constructor(e,t,i){super(new Uint16Array(e),t,i)}}),n(e,"Uint32BufferAttribute",class extends e.BufferAttribute{constructor(e,t,i){super(new Uint32Array(e),t,i)}})),n(null==e||null===(_=e.BufferGeometry)||void 0===_?void 0:_.prototype,"applyMatrix4",(function(e){return this.applyMatrix(e),this})),r(null==e||null===(E=e.BufferGeometry)||void 0===E?void 0:E.prototype,"groups",{get:function(){return this.offsets},set:function(e){this.offsets=e,this.drawcalls=e}}),n(null==e||null===(A=e.BufferGeometry)||void 0===A?void 0:A.prototype,"addGroup",(function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return void 0!==i&&0!==i&&console.warn("THREE.BufferGeometry: .addGroup() with `materialIndex !== 0` is not supported in this Three.js version. Ignoring the `materialIndex` parameter."),this.addDrawCall(e,t)})),r(null==e||null===(S=e.BufferGeometry)||void 0===S?void 0:S.prototype,"index",{get:function(){return this.attributes.index},set:function(e){this.attributes.index=e}}),n(null==e||null===(w=e.BufferGeometry)||void 0===w?void 0:w.prototype,"setFromPoints",(function(t){const i=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];i.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new e.Float32BufferAttribute(i,3)),this})),n(null==e||null===(M=e.BufferGeometry)||void 0===M?void 0:M.prototype,"setIndex",(function(t){return Array.isArray(t)?this.index=new((e=>{if(0===e.length)return-1/0;for(var t=e[0],i=1,n=e.length;i<n;++i)e[i]>t&&(t=e[i]);return t})(t)>65535?e.Uint32BufferAttribute:e.Uint16BufferAttribute)(t,1):this.index=t,this})),"function"==typeof(null==e?void 0:e.BufferGeometry)&&(o(e),s(e),a(e),l(e),c(e),h(e),u(e)),n(null==e||null===(T=e.Frustum)||void 0===T?void 0:T.prototype,"setFromProjectionMatrix",(function(e){return this.setFromMatrix(e)})),n(null==e||null===(C=e.Geometry)||void 0===C?void 0:C.prototype,"applyMatrix4",(function(e){return this.applyMatrix(e),this})),n(e,"Interpolant",(()=>{})),"function"==typeof e.Line&&n(e,"LineSegments",class extends e.Line{constructor(t,i){super(t,i,e.LinePieces),this.isLineSegments=!0,this.type="LineSegments"}}),n(null==e||null===(P=e.Line)||void 0===P?void 0:P.prototype,"computeLineDistances",(function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,i=[0];for(let e=1,n=t.count;e<n;e++)_start.fromBufferAttribute(t,e-1),_end.fromBufferAttribute(t,e),i[e]=i[e-1],i[e]+=_start.distanceTo(_end);e.setAttribute("lineDistance",new Float32BufferAttribute(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this})),n(null==e||null===(D=e.Matrix3)||void 0===D?void 0:D.prototype,"invert",(function(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],h=c*o-s*l,u=s*a-c*r,d=l*r-o*a,p=t*h+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=h*f,e[1]=(n*l-c*i)*f,e[2]=(s*i-n*o)*f,e[3]=u*f,e[4]=(c*t-n*a)*f,e[5]=(n*r-s*t)*f,e[6]=d*f,e[7]=(i*a-l*t)*f,e[8]=(o*t-i*r)*f,this})),n(null==e||null===(L=e.Matrix4)||void 0===L?void 0:L.prototype,"invert",(function(){const e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=h*m*l-f*u*l+f*a*d-s*m*d-h*a*g+s*u*g,y=p*u*l-c*m*l-p*a*d+o*m*d+c*a*g-o*u*g,b=c*f*l-p*h*l+p*s*d-o*f*d-c*s*g+o*h*g,x=p*h*a-c*f*a-p*s*u+o*f*u+c*s*m-o*h*m,_=t*v+i*y+n*b+r*x;if(0===_)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const E=1/_;return e[0]=v*E,e[1]=(f*u*r-h*m*r-f*n*d+i*m*d+h*n*g-i*u*g)*E,e[2]=(s*m*r-f*a*r+f*n*l-i*m*l-s*n*g+i*a*g)*E,e[3]=(h*a*r-s*u*r-h*n*l+i*u*l+s*n*d-i*a*d)*E,e[4]=y*E,e[5]=(c*m*r-p*u*r+p*n*d-t*m*d-c*n*g+t*u*g)*E,e[6]=(p*a*r-o*m*r-p*n*l+t*m*l+o*n*g-t*a*g)*E,e[7]=(o*u*r-c*a*r+c*n*l-t*u*l-o*n*d+t*a*d)*E,e[8]=b*E,e[9]=(p*h*r-c*f*r-p*i*d+t*f*d+c*i*g-t*h*g)*E,e[10]=(o*f*r-p*s*r+p*i*l-t*f*l-o*i*g+t*s*g)*E,e[11]=(c*s*r-o*h*r-c*i*l+t*h*l+o*i*d-t*s*d)*E,e[12]=x*E,e[13]=(c*f*n-p*h*n+p*i*u-t*f*u-c*i*m+t*h*m)*E,e[14]=(p*s*n-o*f*n-p*i*a+t*f*a+o*i*m-t*s*m)*E,e[15]=(o*h*n-c*s*n+c*i*a-t*h*a-o*i*u+t*s*u)*E,this})),r(null==e||null===(I=e.MeshPhongMaterial)||void 0===I?void 0:I.prototype,"flatShading",{get:function(){return this.shading===e.FlatShading},set:function(t){this.shading=!0===t?e.FlatShading:e.SmoothShading}}),n(e,"MeshStandardMaterial",e.MeshBasicMaterial),n(null==e||null===(R=e.Object3D)||void 0===R?void 0:R.prototype,"applyMatrix4",(function(e){return this.applyMatrix(e)})),n(e,"PointsMaterial",e.PointCloudMaterial),n(null==e||null===(O=e.Quaternion)||void 0===O?void 0:O.prototype,"invert",(function(){return this.inverse()})),n(null==e||null===(N=e.Quaternion)||void 0===N?void 0:N.prototype,"slerpQuaternions",(function(e,t,i){return this.copy(e).slerp(t,i)})),n(null==e?void 0:e.Triangle,"getNormal",(function(e,t,i,n){return this.normal(e,t,i,n)})),n(null==e||null===(k=e.Vector2)||void 0===k?void 0:k.prototype,"fromBufferAttribute",(function(e,t,i){return this.fromAttribute(e,t,i)})),n(null==e||null===(F=e.Vector3)||void 0===F?void 0:F.prototype,"fromBufferAttribute",(function(e,t,i){return this.fromAttribute(e,t,i)})),n(null==e||null===(V=e.Vector4)||void 0===V?void 0:V.prototype,"fromBufferAttribute",(function(e,t,i){return this.fromAttribute(e,t,i)})),r(null==e||null===(U=e.WebGLRenderTarget)||void 0===U?void 0:U.prototype,"texture",{get:function(){return this}}),n(null==e||null===(B=e.Material)||void 0===B?void 0:B.prototype,"onBeforeCompile",(function(){}))}},24820:(e,t,i)=>{"use strict";i.d(t,{r:()=>n});const n=(e,t)=>e.applyProjection(t)},41434:(e,t,i)=>{var n,r,o,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M,T,C,P,D,L,I,R,O,N,k,F,V,U,B,z,G,H,W,j,X,q,Y,K=e.exports={REVISION:"71"};void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),K.log=function(){console.log.apply(console,arguments)},K.warn=function(){console.warn.apply(console,arguments)},K.error=function(){console.error.apply(console,arguments)},K.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},K.CullFaceNone=0,K.CullFaceBack=1,K.CullFaceFront=2,K.CullFaceFrontBack=3,K.FrontFaceDirectionCW=0,K.FrontFaceDirectionCCW=1,K.BasicShadowMap=0,K.PCFShadowMap=1,K.PCFSoftShadowMap=2,K.FrontSide=0,K.BackSide=1,K.DoubleSide=2,K.NoShading=0,K.FlatShading=1,K.SmoothShading=2,K.NoColors=0,K.FaceColors=1,K.VertexColors=2,K.NoBlending=0,K.NormalBlending=1,K.AdditiveBlending=2,K.SubtractiveBlending=3,K.MultiplyBlending=4,K.CustomBlending=5,K.AddEquation=100,K.SubtractEquation=101,K.ReverseSubtractEquation=102,K.MinEquation=103,K.MaxEquation=104,K.ZeroFactor=200,K.OneFactor=201,K.SrcColorFactor=202,K.OneMinusSrcColorFactor=203,K.SrcAlphaFactor=204,K.OneMinusSrcAlphaFactor=205,K.DstAlphaFactor=206,K.OneMinusDstAlphaFactor=207,K.DstColorFactor=208,K.OneMinusDstColorFactor=209,K.SrcAlphaSaturateFactor=210,K.MultiplyOperation=0,K.MixOperation=1,K.AddOperation=2,K.UVMapping=300,K.CubeReflectionMapping=301,K.CubeRefractionMapping=302,K.EquirectangularReflectionMapping=303,K.EquirectangularRefractionMapping=304,K.SphericalReflectionMapping=305,K.RepeatWrapping=1e3,K.ClampToEdgeWrapping=1001,K.MirroredRepeatWrapping=1002,K.NearestFilter=1003,K.NearestMipMapNearestFilter=1004,K.NearestMipMapLinearFilter=1005,K.LinearFilter=1006,K.LinearMipMapNearestFilter=1007,K.LinearMipMapLinearFilter=1008,K.UnsignedByteType=1009,K.ByteType=1010,K.ShortType=1011,K.UnsignedShortType=1012,K.IntType=1013,K.UnsignedIntType=1014,K.FloatType=1015,K.HalfFloatType=1025,K.UnsignedShort4444Type=1016,K.UnsignedShort5551Type=1017,K.UnsignedShort565Type=1018,K.AlphaFormat=1019,K.RGBFormat=1020,K.RGBAFormat=1021,K.LuminanceFormat=1022,K.LuminanceAlphaFormat=1023,K.RGBEFormat=K.RGBAFormat,K.RGB_S3TC_DXT1_Format=2001,K.RGBA_S3TC_DXT1_Format=2002,K.RGBA_S3TC_DXT3_Format=2003,K.RGBA_S3TC_DXT5_Format=2004,K.RGB_PVRTC_4BPPV1_Format=2100,K.RGB_PVRTC_2BPPV1_Format=2101,K.RGBA_PVRTC_4BPPV1_Format=2102,K.RGBA_PVRTC_2BPPV1_Format=2103,K.Projector=function(){K.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){K.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){K.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(e,t){K.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},K.CanvasRenderer=function(){K.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},K.Color=function(e){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(e)},K.Color.prototype={constructor:K.Color,r:1,g:1,b:1,set:function(e){return e instanceof K.Color?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(e,t,i){if(0===t)this.r=this.g=this.b=i;else{var n=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e},r=i<=.5?i*(1+t):i+t-i*t,o=2*i-r;this.r=n(o,r,e+1/3),this.g=n(o,r,e),this.b=n(o,r,e-1/3)}return this},setStyle:function(e){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(e)){var t=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(e);return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this}if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(e)){t=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(e);return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this}if(/^\#([0-9a-f]{6})$/i.test(e)){t=/^\#([0-9a-f]{6})$/i.exec(e);return this.setHex(parseInt(t[1],16)),this}if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(e)){t=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e);return this.setHex(parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3],16)),this}if(/^(\w+)$/i.test(e))return this.setHex(K.ColorKeywords[e]),this},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this},convertGammaToLinear:function(){var e=this.r,t=this.g,i=this.b;return this.r=e*e,this.g=t*t,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,i,n=e||{h:0,s:0,l:0},r=this.r,o=this.g,s=this.b,a=Math.max(r,o,s),l=Math.min(r,o,s),c=(l+a)/2;if(l===a)t=0,i=0;else{var h=a-l;switch(i=c<=.5?h/(a+l):h/(2-a-l),a){case r:t=(o-s)/h+(o<s?6:0);break;case o:t=(s-r)/h+2;break;case s:t=(r-o)/h+4}t/=6}return n.h=t,n.s=i,n.l=c,n},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,i){var n=this.getHSL();return n.h+=e,n.s+=t,n.l+=i,this.setHSL(n.h,n.s,n.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e){return this.r=e[0],this.g=e[1],this.b=e[2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},clone:function(){return(new K.Color).setRGB(this.r,this.g,this.b)}},K.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},K.Quaternion=function(e,t,i,n){this._x=e||0,this._y=t||0,this._z=i||0,this._w=void 0!==n?n:1},K.Quaternion.prototype={constructor:K.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get w(){return this._w},set w(e){this._w=e,this.onChangeCallback()},set:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this.onChangeCallback(),this},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(e instanceof K.Euler==!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var i=Math.cos(e._x/2),n=Math.cos(e._y/2),r=Math.cos(e._z/2),o=Math.sin(e._x/2),s=Math.sin(e._y/2),a=Math.sin(e._z/2);return"XYZ"===e.order?(this._x=o*n*r+i*s*a,this._y=i*s*r-o*n*a,this._z=i*n*a+o*s*r,this._w=i*n*r-o*s*a):"YXZ"===e.order?(this._x=o*n*r+i*s*a,this._y=i*s*r-o*n*a,this._z=i*n*a-o*s*r,this._w=i*n*r+o*s*a):"ZXY"===e.order?(this._x=o*n*r-i*s*a,this._y=i*s*r+o*n*a,this._z=i*n*a+o*s*r,this._w=i*n*r-o*s*a):"ZYX"===e.order?(this._x=o*n*r-i*s*a,this._y=i*s*r+o*n*a,this._z=i*n*a-o*s*r,this._w=i*n*r+o*s*a):"YZX"===e.order?(this._x=o*n*r+i*s*a,this._y=i*s*r+o*n*a,this._z=i*n*a-o*s*r,this._w=i*n*r-o*s*a):"XZY"===e.order&&(this._x=o*n*r-i*s*a,this._y=i*s*r-o*n*a,this._z=i*n*a+o*s*r,this._w=i*n*r+o*s*a),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var i=t/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,i=e.elements,n=i[0],r=i[4],o=i[8],s=i[1],a=i[5],l=i[9],c=i[2],h=i[6],u=i[10],d=n+a+u;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(h-l)*t,this._y=(o-c)*t,this._z=(s-r)*t):n>a&&n>u?(t=2*Math.sqrt(1+n-a-u),this._w=(h-l)/t,this._x=.25*t,this._y=(r+s)/t,this._z=(o+c)/t):a>u?(t=2*Math.sqrt(1+a-n-u),this._w=(o-c)/t,this._x=(r+s)/t,this._y=.25*t,this._z=(l+h)/t):(t=2*Math.sqrt(1+u-n-a),this._w=(s-r)/t,this._x=(o+c)/t,this._y=(l+h)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(e,t){return void 0===n&&(n=new K.Vector3),(r=e.dot(t)+1)<1e-6?(r=0,Math.abs(e.x)>Math.abs(e.z)?n.set(-e.y,e.x,0):n.set(0,-e.z,e.y)):n.crossVectors(e,t),this._x=n.x,this._y=n.y,this._z=n.z,this._w=r,this.normalize(),this},inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(K.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e._x,n=e._y,r=e._z,o=e._w,s=t._x,a=t._y,l=t._z,c=t._w;return this._x=i*c+o*s+n*l-r*a,this._y=n*c+o*a+r*s-i*l,this._z=r*c+o*l+i*a-n*s,this._w=o*c-i*s-n*a-r*l,this.onChangeCallback(),this},multiplyVector3:function(e){return K.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,n=this._y,r=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+r*e._z;if(s<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),s>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;var a=Math.acos(s),l=Math.sqrt(1-s*s);if(Math.abs(l)<.001)return this._w=.5*(o+this._w),this._x=.5*(i+this._x),this._y=.5*(n+this._y),this._z=.5*(r+this._z),this;var c=Math.sin((1-t)*a)/l,h=Math.sin(t*a)/l;return this._w=o*c+this._w*h,this._x=i*c+this._x*h,this._y=n*c+this._y*h,this._z=r*c+this._z*h,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){},clone:function(){return new K.Quaternion(this._x,this._y,this._z,this._w)}},K.Quaternion.slerp=function(e,t,i,n){return i.copy(e).slerp(t,n)},K.Vector2=function(e,t){this.x=e||0,this.y=t||0},K.Vector2.prototype={constructor:K.Vector2,set:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(K.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},sub:function(e,t){return void 0!==t?(K.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t}else this.x=0,this.y=0;return this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this},clampScalar:function(e,t){return void 0===o&&(o=new K.Vector2,s=new K.Vector2),o.set(e,e),s.set(t,t),this.clamp(o,s)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this},clone:function(){return new K.Vector2(this.x,this.y)}},K.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},K.Vector3.prototype={constructor:K.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(K.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},sub:function(e,t){return void 0!==t?(K.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(K.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e instanceof K.Euler==0&&K.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===l&&(l=new K.Quaternion),this.applyQuaternion(l.setFromEuler(e)),this},applyAxisAngle:function(){var e;return function(t,i){return void 0===e&&(e=new K.Quaternion),this.applyQuaternion(e.setFromAxisAngle(t,i)),this}}(),applyMatrix3:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[3]*i+r[6]*n,this.y=r[1]*t+r[4]*i+r[7]*n,this.z=r[2]*t+r[5]*i+r[8]*n,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n+r[12],this.y=r[1]*t+r[5]*i+r[9]*n+r[13],this.z=r[2]*t+r[6]*i+r[10]*n+r[14],this},applyProjection:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements,o=1/(r[3]*t+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*t+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*t+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*t+r[6]*i+r[10]*n+r[14])*o,this},applyQuaternion:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,o=e.y,s=e.z,a=e.w,l=a*t+o*n-s*i,c=a*i+s*t-r*n,h=a*n+r*i-o*t,u=-r*t-o*i-s*n;return this.x=l*a+u*-r+c*-s-h*-o,this.y=c*a+u*-o+h*-r-l*-s,this.z=h*a+u*-s+l*-o-c*-r,this},project:function(e){return void 0===a&&(a=new K.Matrix4),a.multiplyMatrices(e.projectionMatrix,a.getInverse(e.matrixWorld)),this.applyProjection(a)},unproject:function(){var e;return function(t){return void 0===e&&(e=new K.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,i=this.y,n=this.z,r=e.elements;return this.x=r[0]*t+r[4]*i+r[8]*n,this.y=r[1]*t+r[5]*i+r[9]*n,this.z=r[2]*t+r[6]*i+r[10]*n,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this},clampScalar:function(){var e,t;return function(i,n){return void 0===e&&(e=new K.Vector3,t=new K.Vector3),e.set(i,i,i),t.set(n,n,n),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},cross:function(e,t){if(void 0!==t)return K.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var i=this.x,n=this.y,r=this.z;return this.x=n*e.z-r*e.y,this.y=r*e.x-i*e.z,this.z=i*e.y-n*e.x,this},crossVectors:function(e,t){var i=e.x,n=e.y,r=e.z,o=t.x,s=t.y,a=t.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this},projectOnVector:function(){var e,t;return function(i){return void 0===e&&(e=new K.Vector3),e.copy(i).normalize(),t=this.dot(e),this.copy(e).multiplyScalar(t)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new K.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new K.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/(this.length()*e.length());return Math.acos(K.Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return t*t+i*i+n*n},setEulerFromRotationMatrix:function(e,t){K.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(e,t){K.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return K.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return K.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return K.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},setFromMatrixPosition:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length(),i=this.set(e.elements[4],e.elements[5],e.elements[6]).length(),n=this.set(e.elements[8],e.elements[9],e.elements[10]).length();return this.x=t,this.y=i,this.z=n,this},setFromMatrixColumn:function(e,t){var i=4*e,n=t.elements;return this.x=n[i],this.y=n[i+1],this.z=n[i+2],this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this},clone:function(){return new K.Vector3(this.x,this.y,this.z)}},K.Vector4=function(e,t,i,n){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==n?n:1},K.Vector4.prototype={constructor:K.Vector4,set:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(K.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},sub:function(e,t){return void 0!==t?(K.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*t+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*t+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*t+o[7]*i+o[11]*n+o[15]*r,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t,this.z*=t,this.w*=t}else this.x=0,this.y=0,this.z=0,this.w=1;return this},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,i,n,r,o=.01,s=.1,a=e.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)<o&&Math.abs(h-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+u)<s&&Math.abs(h+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;t=Math.PI;var v=(l+1)/2,y=(d+1)/2,b=(g+1)/2,x=(c+u)/4,_=(h+f)/4,E=(p+m)/4;return v>y&&v>b?v<o?(i=0,n=.707106781,r=.707106781):(n=x/(i=Math.sqrt(v)),r=_/i):y>b?y<o?(i=.707106781,n=0,r=.707106781):(i=x/(n=Math.sqrt(y)),r=E/n):b<o?(i=.707106781,n=.707106781,r=0):(i=_/(r=Math.sqrt(b)),n=E/r),this.set(i,n,r,t),this}var A=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(A)<.001&&(A=1),this.x=(m-p)/A,this.y=(h-f)/A,this.z=(u-c)/A,this.w=Math.acos((l+d+g-1)/2),this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this.w>e.w&&(this.w=e.w),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this.w<e.w&&(this.w=e.w),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this.w<e.w?this.w=e.w:this.w>t.w&&(this.w=t.w),this},clampScalar:function(){var e,t;return function(i,n){return void 0===e&&(e=new K.Vector4,t=new K.Vector4),e.set(i,i,i,i),t.set(n,n,n,n),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e),this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromAttribute:function(e,t,i){return void 0===i&&(i=0),t=t*e.itemSize+i,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this.w=e.array[t+3],this},clone:function(){return new K.Vector4(this.x,this.y,this.z,this.w)}},K.Euler=function(e,t,i,n){this._x=e||0,this._y=t||0,this._z=i||0,this._order=n||K.Euler.DefaultOrder},K.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],K.Euler.DefaultOrder="XYZ",K.Euler.prototype={constructor:K.Euler,_x:0,_y:0,_z:0,_order:K.Euler.DefaultOrder,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e,this.onChangeCallback()},set:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._order=n||this._order,this.onChangeCallback(),this},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,i){var n=K.Math.clamp,r=e.elements,o=r[0],s=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(n(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0)):"YXZ"===t?(this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,o),this._z=0)):"ZXY"===t?(this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o))):"ZYX"===t?(this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c))):"YZX"===t?(this._z=Math.asin(n(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,p))):"XZY"===t?(this._z=Math.asin(-n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,p),this._y=0)):K.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(){var e;return function(t,i,n){return void 0===e&&(e=new K.Matrix4),e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,i,n),this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:(c=new K.Quaternion,function(e){c.setFromEuler(this),this.setFromQuaternion(c,e)}),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new K.Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){},clone:function(){return new K.Euler(this._x,this._y,this._z,this._order)}},K.Line3=function(e,t){this.start=void 0!==e?e:new K.Vector3,this.end=void 0!==t?t:new K.Vector3},K.Line3.prototype={constructor:K.Line3,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},center:function(e){return(e||new K.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return(e||new K.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var i=t||new K.Vector3;return this.delta(i).multiplyScalar(e).add(this.start)},closestPointToPointParameter:(h=new K.Vector3,u=new K.Vector3,function(e,t){h.subVectors(e,this.start),u.subVectors(this.end,this.start);var i=u.dot(u),n=u.dot(h)/i;return t&&(n=K.Math.clamp(n,0,1)),n}),closestPointToPoint:function(e,t,i){var n=this.closestPointToPointParameter(e,t),r=i||new K.Vector3;return this.delta(r).multiplyScalar(n).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},clone:function(){return(new K.Line3).copy(this)}},K.Box2=function(e,t){this.min=void 0!==e?e:new K.Vector2(1/0,1/0),this.max=void 0!==t?t:new K.Vector2(-1/0,-1/0)},K.Box2.prototype={constructor:K.Box2,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new K.Vector2;return function(t,i){var n=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},empty:function(){return console.warn("Box2.empty has been deprecated. Use Box2.isEmpty instead"),this.isEmpty()},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(e){return console.warn("Box2.center() is deprecated. Use Box2.getCenter() instead."),this.getCenter(e)},getCenter:function(e){return(e||new K.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){return(e||new K.Vector2).subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return(t||new K.Vector2).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return(t||new K.Vector2).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new K.Vector2;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new K.Box2).copy(this)}},K.Box3=function(e,t){this.min=void 0!==e?e:new K.Vector3(1/0,1/0,1/0),this.max=void 0!==t?t:new K.Vector3(-1/0,-1/0,-1/0)},K.Box3.prototype={constructor:K.Box3,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new K.Vector3;return function(t,i){var n=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),setFromObject:function(){var e=new K.Vector3;return function(t){var i=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse((function(t){var n=t.geometry;if(void 0!==n)if(n instanceof K.Geometry)for(var r=n.vertices,o=0,s=r.length;o<s;o++)e.copy(r[o]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e);else if(n instanceof K.BufferGeometry&&void 0!==n.attributes.position){var a=n.attributes.position.array;for(o=0,s=a.length;o<s;o+=3)e.set(a[o],a[o+1],a[o+2]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e)}})),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return console.warn("Box3.empty has been deprecated. Use Box3.isEmpty instead"),this.isEmpty()},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(e){return console.warn("Box3.center() is deprecated. Use Box3.getCenter() instead."),this.getCenter(e)},getCenter:function(e){return e=e||new K.Vector3,this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){return(e||new K.Vector3).subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return(t||new K.Vector3).set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},clampPoint:function(e,t){return(t||new K.Vector3).copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new K.Vector3;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new K.Vector3;return function(t){var i=t||new K.Sphere;return i.center=this.getCenter(),i.radius=.5*this.size(e).length(),i}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:(d=[new K.Vector3,new K.Vector3,new K.Vector3,new K.Vector3,new K.Vector3,new K.Vector3,new K.Vector3,new K.Vector3],function(e){return d[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),d[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),d[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),d[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),d[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),d[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),d[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),d[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.makeEmpty(),this.setFromPoints(d),this}),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new K.Box3).copy(this)}},K.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&K.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},K.Matrix3.prototype={constructor:K.Matrix3,set:function(e,t,i,n,r,o,s,a,l){var c=this.elements;return c[0]=e,c[3]=t,c[6]=i,c[1]=n,c[4]=r,c[7]=o,c[2]=s,c[5]=a,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},multiplyVector3:function(e){return K.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(e){return K.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},applyToVector3Array:function(){var e=new K.Vector3;return function(t,i,n){void 0===i&&(i=0),void 0===n&&(n=t.length);for(var r=0,o=i;r<n;r+=3,o+=3)e.x=t[o],e.y=t[o+1],e.z=t[o+2],e.applyMatrix3(this),t[o]=e.x,t[o+1]=e.y,t[o+2]=e.z;return t}}(),multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[1],n=e[2],r=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8];return t*o*c-t*s*l-i*r*c+i*s*a+n*r*l-n*o*a},getInverse:function(e,t){var i=e.elements,n=this.elements;n[0]=i[10]*i[5]-i[6]*i[9],n[1]=-i[10]*i[1]+i[2]*i[9],n[2]=i[6]*i[1]-i[2]*i[5],n[3]=-i[10]*i[4]+i[6]*i[8],n[4]=i[10]*i[0]-i[2]*i[8],n[5]=-i[6]*i[0]+i[2]*i[4],n[6]=i[9]*i[4]-i[5]*i[8],n[7]=-i[9]*i[0]+i[1]*i[8],n[8]=i[5]*i[0]-i[1]*i[4];var r=i[0]*n[0]+i[1]*n[3]+i[2]*n[6];if(0===r){var o="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(o);return K.warn(o),this.identity(),this}return this.multiplyScalar(1/r),this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},flattenToArrayOffset:function(e,t){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e},getNormalMatrix:function(e){return this.getInverse(e).transpose(),this},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},clone:function(){return(new K.Matrix3).fromArray(this.elements)}},K.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&K.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},K.Matrix4.prototype={constructor:K.Matrix4,set:function(e,t,i,n,r,o,s,a,l,c,h,u,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(e){return this.elements.set(e.elements),this},extractPosition:function(e){return K.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},copyPosition:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(e,t,i){var n=this.elements;return e.set(n[0],n[1],n[2]),t.set(n[4],n[5],n[6]),i.set(n[8],n[9],n[10]),this},makeBasis:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(){var e=new K.Vector3;return function(t){var i=this.elements,n=t.elements,r=1/e.set(n[0],n[1],n[2]).length(),o=1/e.set(n[4],n[5],n[6]).length(),s=1/e.set(n[8],n[9],n[10]).length();return i[0]=n[0]*r,i[1]=n[1]*r,i[2]=n[2]*r,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,this}}(),makeRotationFromEuler:function(e){e instanceof K.Euler==!1&&K.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=e.x,n=e.y,r=e.z,o=Math.cos(i),s=Math.sin(i),a=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r);if("XYZ"===e.order){var u=o*c,d=o*h,p=s*c,f=s*h;t[0]=a*c,t[4]=-a*h,t[8]=l,t[1]=d+p*l,t[5]=u-f*l,t[9]=-s*a,t[2]=f-u*l,t[6]=p+d*l,t[10]=o*a}else if("YXZ"===e.order){var m=a*c,g=a*h,v=l*c,y=l*h;t[0]=m+y*s,t[4]=v*s-g,t[8]=o*l,t[1]=o*h,t[5]=o*c,t[9]=-s,t[2]=g*s-v,t[6]=y+m*s,t[10]=o*a}else if("ZXY"===e.order){m=a*c,g=a*h,v=l*c,y=l*h;t[0]=m-y*s,t[4]=-o*h,t[8]=v+g*s,t[1]=g+v*s,t[5]=o*c,t[9]=y-m*s,t[2]=-o*l,t[6]=s,t[10]=o*a}else if("ZYX"===e.order){u=o*c,d=o*h,p=s*c,f=s*h;t[0]=a*c,t[4]=p*l-d,t[8]=u*l+f,t[1]=a*h,t[5]=f*l+u,t[9]=d*l-p,t[2]=-l,t[6]=s*a,t[10]=o*a}else if("YZX"===e.order){var b=o*a,x=o*l,_=s*a,E=s*l;t[0]=a*c,t[4]=E-b*h,t[8]=_*h+x,t[1]=h,t[5]=o*c,t[9]=-s*c,t[2]=-l*c,t[6]=x*h+_,t[10]=b-E*h}else if("XZY"===e.order){b=o*a,x=o*l,_=s*a,E=s*l;t[0]=a*c,t[4]=-h,t[8]=l*c,t[1]=b*h+E,t[5]=o*c,t[9]=x*h-_,t[2]=_*h-x,t[6]=s*c,t[10]=E*h+b}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},setRotationFromQuaternion:function(e){return K.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},makeRotationFromQuaternion:function(e){var t=this.elements,i=e.x,n=e.y,r=e.z,o=e.w,s=i+i,a=n+n,l=r+r,c=i*s,h=i*a,u=i*l,d=n*a,p=n*l,f=r*l,m=o*s,g=o*a,v=o*l;return t[0]=1-(d+f),t[4]=h-v,t[8]=u+g,t[1]=h+v,t[5]=1-(c+f),t[9]=p-m,t[2]=u-g,t[6]=p+m,t[10]=1-(c+d),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new K.Vector3,t=new K.Vector3,i=new K.Vector3;return function(n,r,o){var s=this.elements;return i.subVectors(n,r).normalize(),0===i.length()&&(i.z=1),e.crossVectors(o,i).normalize(),0===e.length()&&(i.x+=1e-4,e.crossVectors(o,i).normalize()),t.crossVectors(i,e),s[0]=e.x,s[4]=t.x,s[8]=i.x,s[1]=e.y,s[5]=t.y,s[9]=i.y,s[2]=e.z,s[6]=t.z,s[10]=i.z,this}}(),multiply:function(e,t){return void 0!==t?(K.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},multiplyMatrices:function(e,t){var i=e.elements,n=t.elements,r=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],b=i[11],x=i[15],_=n[0],E=n[4],A=n[8],S=n[12],w=n[1],M=n[5],T=n[9],C=n[13],P=n[2],D=n[6],L=n[10],I=n[14],R=n[3],O=n[7],N=n[11],k=n[15];return r[0]=o*_+s*w+a*P+l*R,r[4]=o*E+s*M+a*D+l*O,r[8]=o*A+s*T+a*L+l*N,r[12]=o*S+s*C+a*I+l*k,r[1]=c*_+h*w+u*P+d*R,r[5]=c*E+h*M+u*D+d*O,r[9]=c*A+h*T+u*L+d*N,r[13]=c*S+h*C+u*I+d*k,r[2]=p*_+f*w+m*P+g*R,r[6]=p*E+f*M+m*D+g*O,r[10]=p*A+f*T+m*L+g*N,r[14]=p*S+f*C+m*I+g*k,r[3]=v*_+y*w+b*P+x*R,r[7]=v*E+y*M+b*D+x*O,r[11]=v*A+y*T+b*L+x*N,r[15]=v*S+y*C+b*I+x*k,this},multiplyToArray:function(e,t,i){var n=this.elements;return this.multiplyMatrices(e,t),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[7]=n[7],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[11]=n[11],i[12]=n[12],i[13]=n[13],i[14]=n[14],i[15]=n[15],this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},multiplyVector3:function(e){return K.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),e.applyProjection(this)},multiplyVector4:function(e){return K.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(e){return K.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},applyToVector3Array:function(){var e=new K.Vector3;return function(t,i,n){void 0===i&&(i=0),void 0===n&&(n=t.length);for(var r=0,o=i;r<n;r+=3,o+=3)e.x=t[o],e.y=t[o+1],e.z=t[o+2],e.applyMatrix4(this),t[o]=e.x,t[o+1]=e.y,t[o+2]=e.z;return t}}(),rotateAxis:function(e){K.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return K.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},determinant:function(){var e=this.elements,t=e[0],i=e[4],n=e[8],r=e[12],o=e[1],s=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+r*a*h-n*l*h-r*s*u+i*l*u+n*s*d-i*a*d)+e[7]*(+t*a*d-t*l*u+r*o*u-n*o*d+n*l*c-r*a*c)+e[11]*(+t*l*h-t*s*d-r*o*h+i*o*d+r*s*c-i*l*c)+e[15]*(-n*s*c-t*a*h+t*s*u+n*o*h-i*o*u+i*a*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},flattenToArrayOffset:function(e,t){var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e},getPosition:function(){var e=new K.Vector3;return function(){K.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var i=this.elements,n=e.elements,r=n[0],o=n[4],s=n[8],a=n[12],l=n[1],c=n[5],h=n[9],u=n[13],d=n[2],p=n[6],f=n[10],m=n[14],g=n[3],v=n[7],y=n[11],b=n[15];i[0]=h*m*v-u*f*v+u*p*y-c*m*y-h*p*b+c*f*b,i[4]=a*f*v-s*m*v-a*p*y+o*m*y+s*p*b-o*f*b,i[8]=s*u*v-a*h*v+a*c*y-o*u*y-s*c*b+o*h*b,i[12]=a*h*p-s*u*p-a*c*f+o*u*f+s*c*m-o*h*m,i[1]=u*f*g-h*m*g-u*d*y+l*m*y+h*d*b-l*f*b,i[5]=s*m*g-a*f*g+a*d*y-r*m*y-s*d*b+r*f*b,i[9]=a*h*g-s*u*g-a*l*y+r*u*y+s*l*b-r*h*b,i[13]=s*u*d-a*h*d+a*l*f-r*u*f-s*l*m+r*h*m,i[2]=c*m*g-u*p*g+u*d*v-l*m*v-c*d*b+l*p*b,i[6]=a*p*g-o*m*g-a*d*v+r*m*v+o*d*b-r*p*b,i[10]=o*u*g-a*c*g+a*l*v-r*u*v-o*l*b+r*c*b,i[14]=a*c*d-o*u*d-a*l*p+r*u*p+o*l*m-r*c*m,i[3]=h*p*g-c*f*g-h*d*v+l*f*v+c*d*y-l*p*y,i[7]=o*f*g-s*p*g+s*d*v-r*f*v-o*d*y+r*p*y,i[11]=s*c*g-o*h*g-s*l*v+r*h*v+o*l*y-r*c*y,i[15]=o*h*d-s*c*d+s*l*p-r*h*p-o*l*f+r*c*f;var x=r*i[0]+l*i[4]+d*i[8]+g*i[12];if(0==x){var _="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(_);return K.warn(_),this.identity(),this}return this.multiplyScalar(1/x),this},translate:function(e){K.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(e){K.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(e){K.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(e){K.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(e,t){K.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(e){var t=this.elements,i=e.x,n=e.y,r=e.z;return t[0]*=i,t[4]*=n,t[8]*=r,t[1]*=i,t[5]*=n,t[9]*=r,t[2]*=i,t[6]*=n,t[10]*=r,t[3]*=i,t[7]*=n,t[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,Math.max(i,n)))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),n=Math.sin(t),r=1-i,o=e.x,s=e.y,a=e.z,l=r*o,c=r*s;return this.set(l*o+i,l*s-n*a,l*a+n*s,0,l*s+n*a,c*s+i,c*a-n*o,0,l*a-n*s,c*a+n*o,r*a*a+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},compose:function(e,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(e),this},decompose:function(){var e=new K.Vector3,t=new K.Matrix4;return function(i,n,r){var o=this.elements,s=e.set(o[0],o[1],o[2]).length(),a=e.set(o[4],o[5],o[6]).length(),l=e.set(o[8],o[9],o[10]).length();this.determinant()<0&&(s=-s),i.x=o[12],i.y=o[13],i.z=o[14],t.elements.set(this.elements);var c=1/s,h=1/a,u=1/l;return t.elements[0]*=c,t.elements[1]*=c,t.elements[2]*=c,t.elements[4]*=h,t.elements[5]*=h,t.elements[6]*=h,t.elements[8]*=u,t.elements[9]*=u,t.elements[10]*=u,n.setFromRotationMatrix(t),r.x=s,r.y=a,r.z=l,this}}(),makeFrustum:function(e,t,i,n,r,o){var s=this.elements,a=2*r/(t-e),l=2*r/(n-i),c=(t+e)/(t-e),h=(n+i)/(n-i),u=-(o+r)/(o-r),d=-2*o*r/(o-r);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=h,s[13]=0,s[2]=0,s[6]=0,s[10]=u,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makePerspective:function(e,t,i,n){var r=i*Math.tan(K.Math.degToRad(.5*e)),o=-r,s=o*t,a=r*t;return this.makeFrustum(s,a,o,r,i,n)},makeOrthographic:function(e,t,i,n,r,o){var s=this.elements,a=t-e,l=i-n,c=o-r,h=(t+e)/a,u=(i+n)/l,d=(o+r)/c;return s[0]=2/a,s[4]=0,s[8]=0,s[12]=-h,s[1]=0,s[5]=2/l,s[9]=0,s[13]=-u,s[2]=0,s[6]=0,s[10]=-2/c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals(e){const t=this.elements,i=e.elements;for(var n=0;n<16;n++)if(t[n]!==i[n])return!1;return!0},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},clone:function(){return(new K.Matrix4).fromArray(this.elements)}},K.Ray=function(e,t){this.origin=void 0!==e?e:new K.Vector3,this.direction=void 0!==t?t:new K.Vector3},K.Ray.prototype={constructor:K.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new K.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new K.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var i=t||new K.Vector3;i.subVectors(e,this.origin);var n=i.dot(this.direction);return n<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(){var e=new K.Vector3;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceTo(t):(e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceTo(t))}}(),distanceSqToSegment:(f=new K.Vector3,m=new K.Vector3,g=new K.Vector3,function(e,t,i,n){f.copy(e).add(t).multiplyScalar(.5),m.copy(t).sub(e).normalize(),g.copy(this.origin).sub(f);var r,o,s,a,l=.5*e.distanceTo(t),c=-this.direction.dot(m),h=g.dot(this.direction),u=-g.dot(m),d=g.lengthSq(),p=Math.abs(1-c*c);if(p>0)if(o=c*h-u,a=l*p,(r=c*u-h)>=0)if(o>=-a)if(o<=a){var v=1/p;s=(r*=v)*(r+c*(o*=v)+2*h)+o*(c*r+o+2*u)+d}else o=l,s=-(r=Math.max(0,-(c*o+h)))*r+o*(o+2*u)+d;else o=-l,s=-(r=Math.max(0,-(c*o+h)))*r+o*(o+2*u)+d;else o<=-a?s=-(r=Math.max(0,-(-c*l+h)))*r+(o=r>0?-l:Math.min(Math.max(-l,-u),l))*(o+2*u)+d:o<=a?(r=0,s=(o=Math.min(Math.max(-l,-u),l))*(o+2*u)+d):s=-(r=Math.max(0,-(c*l+h)))*r+(o=r>0?l:Math.min(Math.max(-l,-u),l))*(o+2*u)+d;else o=c>0?-l:l,s=-(r=Math.max(0,-(c*o+h)))*r+o*(o+2*u)+d;return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(m).multiplyScalar(o).add(f),s}),isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},intersectSphere:function(){var e=new K.Vector3;return function(t,i){e.subVectors(t.center,this.origin);var n=e.dot(this.direction),r=e.dot(e)-n*n,o=t.radius*t.radius;if(r>o)return null;var s=Math.sqrt(o-r),a=n-s,l=n+s;return a<0&&l<0?null:a<0?this.at(l,i):this.at(a,i)}}(),isIntersectionPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0==t)return 0==e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null},intersectPlane:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)},isIntersectionBox:(p=new K.Vector3,function(e){return null!==this.intersectBox(e,p)}),intersectBox:function(e,t){var i,n,r,o,s,a,l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(e.min.x-u.x)*l,n=(e.max.x-u.x)*l):(i=(e.max.x-u.x)*l,n=(e.min.x-u.x)*l),c>=0?(r=(e.min.y-u.y)*c,o=(e.max.y-u.y)*c):(r=(e.max.y-u.y)*c,o=(e.min.y-u.y)*c),i>o||r>n?null:((r>i||i!=i)&&(i=r),(o<n||n!=n)&&(n=o),h>=0?(s=(e.min.z-u.z)*h,a=(e.max.z-u.z)*h):(s=(e.max.z-u.z)*h,a=(e.min.z-u.z)*h),i>a||s>n?null:((s>i||i!=i)&&(i=s),(a<n||n!=n)&&(n=a),n<0?null:this.at(i>=0?i:n,t)))},intersectTriangle:function(){var e=new K.Vector3,t=new K.Vector3,i=new K.Vector3,n=new K.Vector3;return function(r,o,s,a,l){t.subVectors(o,r),i.subVectors(s,r),n.crossVectors(t,i);var c,h=this.direction.dot(n);if(h>0){if(a)return null;c=1}else{if(!(h<0))return null;c=-1,h=-h}e.subVectors(this.origin,r);var u=c*this.direction.dot(i.crossVectors(e,i));if(u<0)return null;var d=c*this.direction.dot(t.cross(e));if(d<0)return null;if(u+d>h)return null;var p=-c*e.dot(n);return p<0?null:this.at(p/h,l)}}(),applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},clone:function(){return(new K.Ray).copy(this)}},K.Sphere=function(e,t){this.center=void 0!==e?e:new K.Vector3,this.radius=void 0!==t?t:0},K.Sphere.prototype={constructor:K.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:(v=new K.Box3,function(e,t){var i=this.center;void 0!==t?i.copy(t):v.setFromPoints(e).getCenter(i);for(var n=0,r=0,o=e.length;r<o;r++)n=Math.max(n,i.distanceToSquared(e[r]));return this.radius=Math.sqrt(n),this}),copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},clampPoint:function(e,t){var i=this.center.distanceToSquared(e),n=t||new K.Vector3;return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(e){var t=e||new K.Box3;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return(new K.Sphere).copy(this)}},K.Frustum=function(e,t,i,n,r,o){this.planes=[void 0!==e?e:new K.Plane,void 0!==t?t:new K.Plane,void 0!==i?i:new K.Plane,void 0!==n?n:new K.Plane,void 0!==r?r:new K.Plane,void 0!==o?o:new K.Plane]},K.Frustum.prototype={constructor:K.Frustum,set:function(e,t,i,n,r,o){var s=this.planes;return s[0].copy(e),s[1].copy(t),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(o),this},copy:function(e){for(var t=this.planes,i=0;i<6;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements,n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return t[0].setComponents(s-n,h-a,f-u,y-m).normalize(),t[1].setComponents(s+n,h+a,f+u,y+m).normalize(),t[2].setComponents(s+r,h+l,f+d,y+g).normalize(),t[3].setComponents(s-r,h-l,f-d,y-g).normalize(),t[4].setComponents(s-o,h-c,f-p,y-v).normalize(),t[5].setComponents(s+o,h+c,f+p,y+v).normalize(),this},intersectsObject:(x=new K.Sphere,function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),x.copy(t.boundingSphere),x.applyMatrix4(e.matrixWorld),this.intersectsSphere(x)}),intersectsSphere:function(e){for(var t=this.planes,i=e.center,n=-e.radius,r=0;r<6;r++){if(t[r].distanceToPoint(i)<n)return!1}return!0},intersectsBox:(y=new K.Vector3,b=new K.Vector3,function(e){for(var t=this.planes,i=0;i<6;i++){var n=t[i];y.x=n.normal.x>0?e.min.x:e.max.x,b.x=n.normal.x>0?e.max.x:e.min.x,y.y=n.normal.y>0?e.min.y:e.max.y,b.y=n.normal.y>0?e.max.y:e.min.y,y.z=n.normal.z>0?e.min.z:e.max.z,b.z=n.normal.z>0?e.max.z:e.min.z;var r=n.distanceToPoint(y),o=n.distanceToPoint(b);if(r<0&&o<0)return!1}return!0}),containsPoint:function(e){for(var t=this.planes,i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0},clone:function(){return(new K.Frustum).copy(this)}},K.Plane=function(e,t){this.normal=void 0!==e?e:new K.Vector3(1,0,0),this.constant=void 0!==t?t:0},K.Plane.prototype={constructor:K.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new K.Vector3,t=new K.Vector3;return function(i,n,r){var o=e.subVectors(r,n).cross(t.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var i=this.distanceToPoint(e);return(t||new K.Vector3).copy(this.normal).multiplyScalar(i)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0},intersectLine:function(){var e=new K.Vector3;return function(t,i){var n=i||new K.Vector3,r=t.delta(e),o=this.normal.dot(r);if(0==o)return 0==this.distanceToPoint(t.start)?n.copy(t.start):void 0;var s=-(t.start.dot(this.normal)+this.constant)/o;return s<0||s>1?void 0:n.copy(r).multiplyScalar(s).add(t.start)}}(),coplanarPoint:function(e){return(e||new K.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new K.Vector3,t=new K.Vector3,i=new K.Matrix3;return function(n,r){var o=r||i.getNormalMatrix(n),s=e.copy(this.normal).applyMatrix3(o);s.normalize();var a=this.coplanarPoint(t);return a.applyMatrix4(n),this.setFromNormalAndCoplanarPoint(s,a),this}}(),translate:function(e){return this.constant=this.constant-e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant==this.constant},clone:function(){return(new K.Plane).copy(this)}},K.Math={generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),n=0;return function(){for(var r=0;r<36;r++)8==r||13==r||18==r||23==r?i[r]="-":14==r?i[r]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),e=15&n,n>>=4,i[r]=t[19==r?3&e|8:e]);return i.join("")}}(),clamp:function(e,t,i){return e<t?t:e>i?i:e},clampBottom:function(e,t){return e<t?t:e},mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(e,t){return Math.floor(this.randFloat(e,t))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:(E=Math.PI/180,function(e){return e*E}),radToDeg:(_=180/Math.PI,function(e){return e*_}),isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}},K.Spline=function(e){this.points=e;var t,i,n,r,o,s,a,l,c,h=[],u={x:0,y:0,z:0};function d(e,t,i,n,r,o,s){var a=.5*(i-e),l=.5*(n-t);return(2*(t-i)+a+l)*s+(-3*(t-i)-2*a-l)*o+a*r+t}this.initFromArray=function(e){this.points=[];for(var t=0;t<e.length;t++)this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}},this.getPoint=function(e){return t=(this.points.length-1)*e,i=Math.floor(t),n=t-i,h[0]=0===i?i:i-1,h[1]=i,h[2]=i>this.points.length-2?this.points.length-1:i+1,h[3]=i>this.points.length-3?this.points.length-1:i+2,s=this.points[h[0]],a=this.points[h[1]],l=this.points[h[2]],c=this.points[h[3]],o=n*(r=n*n),u.x=d(s.x,a.x,l.x,c.x,n,r,o),u.y=d(s.y,a.y,l.y,c.y,n,r,o),u.z=d(s.z,a.z,l.z,c.z,n,r,o),u},this.getControlPointsArray=function(){var e,t,i=this.points.length,n=[];for(e=0;e<i;e++)t=this.points[e],n[e]=[t.x,t.y,t.z];return n},this.getLength=function(e){var t,i,n,r,o=0,s=0,a=0,l=new K.Vector3,c=new K.Vector3,h=[],u=0;for(h[0]=0,e||(e=100),n=this.points.length*e,l.copy(this.points[0]),t=1;t<n;t++)i=t/n,r=this.getPoint(i),c.copy(r),u+=c.distanceTo(l),l.copy(r),o=(this.points.length-1)*i,(s=Math.floor(o))!=a&&(h[s]=u,a=s);return h[h.length]=u,{chunks:h,total:u}},this.reparametrizeByArcLength=function(e){var t,i,n,r,o,s,a,l,c=[],h=new K.Vector3,u=this.getLength();for(c.push(h.copy(this.points[0]).clone()),t=1;t<this.points.length;t++){for(s=u.chunks[t]-u.chunks[t-1],a=Math.ceil(e*s/u.total),r=(t-1)/(this.points.length-1),o=t/(this.points.length-1),i=1;i<a-1;i++)n=r+i*(1/a)*(o-r),l=this.getPoint(n),c.push(h.copy(l).clone());c.push(h.copy(this.points[t]).clone())}this.points=c}},K.Triangle=function(e,t,i){this.a=void 0!==e?e:new K.Vector3,this.b=void 0!==t?t:new K.Vector3,this.c=void 0!==i?i:new K.Vector3},K.Triangle.normal=(A=new K.Vector3,function(e,t,i,n){var r=n||new K.Vector3;r.subVectors(i,t),A.subVectors(e,t),r.cross(A);var o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}),K.Triangle.barycoordFromPoint=function(){var e=new K.Vector3,t=new K.Vector3,i=new K.Vector3;return function(n,r,o,s,a){e.subVectors(s,r),t.subVectors(o,r),i.subVectors(n,r);var l=e.dot(e),c=e.dot(t),h=e.dot(i),u=t.dot(t),d=t.dot(i),p=l*u-c*c,f=a||new K.Vector3;if(0==p)return f.set(-2,-1,-1);var m=1/p,g=(u*h-c*d)*m,v=(l*d-c*h)*m;return f.set(1-g-v,v,g)}}(),K.Triangle.containsPoint=function(){var e=new K.Vector3;return function(t,i,n,r){var o=K.Triangle.barycoordFromPoint(t,i,n,r,e);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}(),K.Triangle.prototype={constructor:K.Triangle,set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new K.Vector3,t=new K.Vector3;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){return(e||new K.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return K.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){return(e||new K.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return K.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return K.Triangle.containsPoint(e,this.a,this.b,this.c)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)},clone:function(){return(new K.Triangle).copy(this)}},K.Clock=function(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1},K.Clock.prototype={constructor:K.Clock,start:function(){this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.oldTime=this.startTime,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();e=.001*(t-this.oldTime),this.oldTime=t,this.elapsedTime+=e}return e}},K.EventDispatcher=function(){},K.EventDispatcher.prototype={constructor:K.EventDispatcher,apply:function(e){e.addEventListener=K.EventDispatcher.prototype.addEventListener,e.hasEventListener=K.EventDispatcher.prototype.hasEventListener,e.removeEventListener=K.EventDispatcher.prototype.removeEventListener,e.dispatchEvent=K.EventDispatcher.prototype.dispatchEvent},addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),-1===i[e].indexOf(t)&&i[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&-1!==i[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var i=this._listeners[e];if(void 0!==i){var n=i.indexOf(t);-1!==n&&i.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var i=[],n=t.length,r=0;r<n;r++)i[r]=t[r];for(r=0;r<n;r++)i[r].call(this,e)}}}},function(e){e.Raycaster=function(t,i,n,r){this.ray=new e.Ray(t,i),this.near=n||0,this.far=r||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{threshold:1}}};var t=function(e,t){return e.distance-t.distance},i=function(e,t,n,r){if(e.raycast(t,n),!0===r)for(var o=e.children,s=0,a=o.length;s<a;s++)i(o[s],t,n,!0)};e.Raycaster.prototype={constructor:e.Raycaster,precision:1e-4,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(t,i){i instanceof e.PerspectiveCamera?(this.ray.origin.copy(i.position),this.ray.direction.set(t.x,t.y,.5).unproject(i).sub(i.position).normalize()):i instanceof e.OrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(i),this.ray.direction.set(0,0,-1).transformDirection(i.matrixWorld)):e.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,n){var r=[];return i(e,this,r,n),r.sort(t),r},intersectObjects:function(n,r){var o=[];if(n instanceof Array==!1)return e.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),o;for(var s=0,a=n.length;s<a;s++)i(n[s],this,o,r);return o.sort(t),o}},Object.defineProperty(e.Raycaster.prototype,"linePrecision",{get:function(){return console.warn("THREE.Raycaster: .linePrecision is now .params.Line.threshold."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision is now .params.Line.threshold."),this.params.Line.threshold=e}})}(K),K.Object3D=function(){Object.defineProperty(this,"id",{value:K.Object3DIdCount++}),this.uuid=K.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=K.Object3D.DefaultUp.clone();var e=new K.Vector3,t=new K.Euler,i=new K.Quaternion,n=new K.Vector3(1,1,1);t.onChange((function(){i.setFromEuler(t,!1)})),i.onChange((function(){t.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:n}}),this.rotationAutoUpdate=!0,this.matrix=new K.Matrix4,this.matrixWorld=new K.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},K.Object3D.DefaultUp=new K.Vector3(0,1,0),K.Object3D.prototype={constructor:K.Object3D,get eulerOrder(){return K.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(e){K.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=e},get useQuaternion(){K.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(e){K.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:(T=new K.Quaternion,function(e,t){return T.setFromAxisAngle(e,t),this.quaternion.multiply(T),this}),rotateX:function(){var e=new K.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new K.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new K.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new K.Vector3;return function(t,i){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(i)),this}}(),translate:function(e,t){return K.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},translateX:function(){var e=new K.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new K.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new K.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:(M=new K.Matrix4,function(e){return e.applyMatrix4(M.getInverse(this.matrixWorld))}),lookAt:function(){var e=new K.Matrix4;return function(t){e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(K.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e instanceof K.Object3D?(void 0!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):K.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1)for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);var i=this.children.indexOf(e);-1!==i&&(e.parent=void 0,e.dispatchEvent({type:"removed"}),this.children.splice(i,1))},getChildByName:function(e){return K.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var i=0,n=this.children.length;i<n;i++){var r=this.children[i].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){var t=e||new K.Vector3;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(S=new K.Vector3,w=new K.Vector3,function(e){var t=e||new K.Quaternion;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(S,t,w),t}),getWorldRotation:function(){var e=new K.Quaternion;return function(t){var i=t||new K.Euler;return this.getWorldQuaternion(e),i.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new K.Vector3,t=new K.Quaternion;return function(i){var n=i||new K.Vector3;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,n),n}}(),getWorldDirection:function(){var e=new K.Quaternion;return function(t){var i=t||new K.Vector3;return this.getWorldQuaternion(e),i.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=0,i=this.children.length;t<i;t++)this.children[t].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=0,i=this.children.length;t<i;t++)this.children[t].traverseVisible(e)}},traverseAncestors:function(e){this.parent&&(e(this.parent),this.parent.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==e||(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,i=this.children.length;t<i;t++)this.children[t].updateMatrixWorld(e)},toJSON:function(){var e={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},t={},i={},n=function(t){if(void 0===e.materials&&(e.materials=[]),void 0===i[t.uuid]){var n=t.toJSON();delete n.metadata,i[t.uuid]=n,e.materials.push(n)}return t.uuid},r=function(i){var o={};if(o.uuid=i.uuid,o.type=i.type,""!==i.name&&(o.name=i.name),"{}"!==JSON.stringify(i.userData)&&(o.userData=i.userData),!0!==i.visible&&(o.visible=i.visible),i instanceof K.PerspectiveCamera?(o.fov=i.fov,o.aspect=i.aspect,o.near=i.near,o.far=i.far):i instanceof K.OrthographicCamera?(o.left=i.left,o.right=i.right,o.top=i.top,o.bottom=i.bottom,o.near=i.near,o.far=i.far):i instanceof K.AmbientLight?o.color=i.color.getHex():i instanceof K.DirectionalLight?(o.color=i.color.getHex(),o.intensity=i.intensity):i instanceof K.PointLight?(o.color=i.color.getHex(),o.intensity=i.intensity,o.distance=i.distance,o.decay=i.decay):i instanceof K.SpotLight?(o.color=i.color.getHex(),o.intensity=i.intensity,o.distance=i.distance,o.angle=i.angle,o.exponent=i.exponent,o.decay=i.decay):i instanceof K.HemisphereLight?(o.color=i.color.getHex(),o.groundColor=i.groundColor.getHex()):i instanceof K.Mesh||i instanceof K.Line||i instanceof K.PointCloud?(o.geometry=function(i){if(void 0===e.geometries&&(e.geometries=[]),void 0===t[i.uuid]){var n=i.toJSON();delete n.metadata,t[i.uuid]=n,e.geometries.push(n)}return i.uuid}(i.geometry),o.material=n(i.material),i instanceof K.Line&&(o.mode=i.mode)):i instanceof K.Sprite&&(o.material=n(i.material)),o.matrix=i.matrix.toArray(),i.children.length>0){o.children=[];for(var s=0;s<i.children.length;s++)o.children.push(r(i.children[s]))}return o};return e.object=r(this),e},clone:function(e,t){if(void 0===e&&(e=new K.Object3D),void 0===t&&(t=!0),e.name=this.name,e.up.copy(this.up),e.position.copy(this.position),e.quaternion.copy(this.quaternion),e.scale.copy(this.scale),e.rotationAutoUpdate=this.rotationAutoUpdate,e.matrix.copy(this.matrix),e.matrixWorld.copy(this.matrixWorld),e.matrixAutoUpdate=this.matrixAutoUpdate,e.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,e.visible=this.visible,e.castShadow=this.castShadow,e.receiveShadow=this.receiveShadow,e.frustumCulled=this.frustumCulled,e.userData=JSON.parse(JSON.stringify(this.userData)),!0===t)for(var i=0;i<this.children.length;i++){var n=this.children[i];e.add(n.clone())}return e}},K.EventDispatcher.prototype.apply(K.Object3D.prototype),K.Object3DIdCount=0,K.Face3=function(e,t,i,n,r,o){this.a=e,this.b=t,this.c=i,this.normal=n instanceof K.Vector3?n:new K.Vector3,this.vertexNormals=n instanceof Array?n:[],this.color=r instanceof K.Color?r:new K.Color,this.vertexColors=r instanceof Array?r:[],this.vertexTangents=[],this.materialIndex=void 0!==o?o:0},K.Face3.prototype={constructor:K.Face3,clone:function(){var e=new K.Face3(this.a,this.b,this.c);e.normal.copy(this.normal),e.color.copy(this.color),e.materialIndex=this.materialIndex;for(var t=0,i=this.vertexNormals.length;t<i;t++)e.vertexNormals[t]=this.vertexNormals[t].clone();for(t=0,i=this.vertexColors.length;t<i;t++)e.vertexColors[t]=this.vertexColors[t].clone();for(t=0,i=this.vertexTangents.length;t<i;t++)e.vertexTangents[t]=this.vertexTangents[t].clone();return e}},K.Face4=function(e,t,i,n,r,o,s){return K.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new K.Face3(e,t,i,r,o,s)},K.BufferAttribute=function(e,t){this.array=e,this.itemSize=t,this.count=null!=e?e.length/t:0,this.needsUpdate=!1},K.BufferAttribute.prototype={constructor:K.BufferAttribute,get length(){return this.array.length},copyAt:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var n=0,r=this.itemSize;n<r;n++)this.array[e+n]=t.array[i+n];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},setX:function(e,t){return this.array[e*this.itemSize]=t,this},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},setXY:function(e,t,i){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=i,this},setXYZ:function(e,t,i,n){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=i,this.array[e+2]=n,this},setXYZW:function(e,t,i,n,r){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=i,this.array[e+2]=n,this.array[e+3]=r,this},clone:function(){return new K.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},K.Int8Attribute=function(e,t){return K.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Uint8Attribute=function(e,t){return K.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Uint8ClampedAttribute=function(e,t){return K.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Int16Attribute=function(e,t){return K.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Uint16Attribute=function(e,t){return K.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Int32Attribute=function(e,t){return K.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Uint32Attribute=function(e,t){return K.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Float32Attribute=function(e,t){return K.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.Float64Attribute=function(e,t){return K.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new K.BufferAttribute(e,t)},K.DynamicBufferAttribute=function(e,t){K.BufferAttribute.call(this,e,t),this.updateRange={offset:0,count:-1}},K.DynamicBufferAttribute.prototype=Object.create(K.BufferAttribute.prototype),K.DynamicBufferAttribute.prototype.constructor=K.DynamicBufferAttribute,K.DynamicBufferAttribute.prototype.clone=function(){return new K.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)},K.BufferGeometry=function(){Object.defineProperty(this,"id",{value:K.GeometryIdCount++}),this.uuid=K.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.drawcalls=[],this.offsets=this.drawcalls,this.boundingBox=null,this.boundingSphere=null},K.BufferGeometry.prototype={constructor:K.BufferGeometry,addAttribute:function(e,t){console.warn("BufferGeometry.addAttribute() is deprecated. Use BufferGeometry.setAttribute() instead."),this.setAttribute(e,t)},setAttribute:function(e,t){if(t instanceof K.BufferAttribute==!1)return K.warn("THREE.BufferGeometry: .setAttribute() now expects ( name, attribute )."),void(this.attributes[e]={array:arguments[1],itemSize:arguments[2]});this.attributes[e]=t,this.attributesKeys=Object.keys(this.attributes)},getAttribute:function(e){return this.attributes[e]},addDrawCall:function(e,t,i){this.drawcalls.push({start:e,count:t,index:void 0!==i?i:0})},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToVector3Array(t.array),t.needsUpdate=!0);var i=this.attributes.normal;void 0!==i&&((new K.Matrix3).getNormalMatrix(e).applyToVector3Array(i.array),i.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.applyMatrix((new K.Matrix4).setPosition(e)),e},fromGeometry:function(e,t){t=t||{vertexColors:K.NoColors};var i=e.vertices,n=e.faces,r=e.faceVertexUvs,o=t.vertexColors,s=r[0].length>0,a=3==n[0].vertexNormals.length,l=new Float32Array(3*n.length*3);this.setAttribute("position",new K.BufferAttribute(l,3));var c=new Float32Array(3*n.length*3);if(this.setAttribute("normal",new K.BufferAttribute(c,3)),o!==K.NoColors){var h=new Float32Array(3*n.length*3);this.setAttribute("color",new K.BufferAttribute(h,3))}if(!0===s){var u=new Float32Array(3*n.length*2);this.setAttribute("uv",new K.BufferAttribute(u,2))}for(var d=0,p=0,f=0;d<n.length;d++,p+=6,f+=9){var m=n[d],g=i[m.a],v=i[m.b],y=i[m.c];if(l[f]=g.x,l[f+1]=g.y,l[f+2]=g.z,l[f+3]=v.x,l[f+4]=v.y,l[f+5]=v.z,l[f+6]=y.x,l[f+7]=y.y,l[f+8]=y.z,!0===a){var b=m.vertexNormals[0],x=m.vertexNormals[1],_=m.vertexNormals[2];c[f]=b.x,c[f+1]=b.y,c[f+2]=b.z,c[f+3]=x.x,c[f+4]=x.y,c[f+5]=x.z,c[f+6]=_.x,c[f+7]=_.y,c[f+8]=_.z}else{var E=m.normal;c[f]=E.x,c[f+1]=E.y,c[f+2]=E.z,c[f+3]=E.x,c[f+4]=E.y,c[f+5]=E.z,c[f+6]=E.x,c[f+7]=E.y,c[f+8]=E.z}if(o===K.FaceColors){var A=m.color;h[f]=A.r,h[f+1]=A.g,h[f+2]=A.b,h[f+3]=A.r,h[f+4]=A.g,h[f+5]=A.b,h[f+6]=A.r,h[f+7]=A.g,h[f+8]=A.b}else if(o===K.VertexColors){var S=m.vertexColors[0],w=m.vertexColors[1],M=m.vertexColors[2];h[f]=S.r,h[f+1]=S.g,h[f+2]=S.b,h[f+3]=w.r,h[f+4]=w.g,h[f+5]=w.b,h[f+6]=M.r,h[f+7]=M.g,h[f+8]=M.b}if(!0===s){var T=r[0][d][0],C=r[0][d][1],P=r[0][d][2];u[p]=T.x,u[p+1]=T.y,u[p+2]=C.x,u[p+3]=C.y,u[p+4]=P.x,u[p+5]=P.y}}return this.computeBoundingSphere(),this},computeBoundingBox:function(){var e=new K.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new K.Box3);var t=this.attributes.position.array;if(t){var i=this.boundingBox;i.makeEmpty();for(var n=0,r=t.length;n<r;n+=3)e.set(t[n],t[n+1],t[n+2]),i.expandByPoint(e)}void 0!==t&&0!==t.length||(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&K.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var e=new K.Box3,t=new K.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new K.Sphere);var i=this.attributes.position.array;if(i){e.makeEmpty();for(var n=this.boundingSphere.center,r=0,o=i.length;r<o;r+=3)t.set(i[r],i[r+1],i[r+2]),e.expandByPoint(t);e.getCenter(n);var s=0;for(r=0,o=i.length;r<o;r+=3)t.set(i[r],i[r+1],i[r+2]),s=Math.max(s,n.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&K.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.attributes;if(e.position){var t=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new K.BufferAttribute(new Float32Array(t.length),3));else for(var i=0,n=(a=e.normal.array).length;i<n;i++)a[i]=0;var r,o,s,a=e.normal.array,l=new K.Vector3,c=new K.Vector3,h=new K.Vector3,u=new K.Vector3,d=new K.Vector3;if(e.index)for(var p=e.index.array,f=this.offsets.length>0?this.offsets:[{start:0,count:p.length,index:0}],m=0,g=f.length;m<g;++m){var v=f[m].start,y=f[m].count,b=f[m].index;for(i=v,n=v+y;i<n;i+=3)r=3*(b+p[i]),o=3*(b+p[i+1]),s=3*(b+p[i+2]),l.fromArray(t,r),c.fromArray(t,o),h.fromArray(t,s),u.subVectors(h,c),d.subVectors(l,c),u.cross(d),a[r]+=u.x,a[r+1]+=u.y,a[r+2]+=u.z,a[o]+=u.x,a[o+1]+=u.y,a[o+2]+=u.z,a[s]+=u.x,a[s+1]+=u.y,a[s+2]+=u.z}else for(i=0,n=t.length;i<n;i+=9)l.fromArray(t,i),c.fromArray(t,i+3),h.fromArray(t,i+6),u.subVectors(h,c),d.subVectors(l,c),u.cross(d),a[i]=u.x,a[i+1]=u.y,a[i+2]=u.z,a[i+3]=u.x,a[i+4]=u.y,a[i+5]=u.z,a[i+6]=u.x,a[i+7]=u.y,a[i+8]=u.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},computeTangents:function(){if(void 0!==this.attributes.index&&void 0!==this.attributes.position&&void 0!==this.attributes.normal&&void 0!==this.attributes.uv){var e=this.attributes.index.array,t=this.attributes.position.array,i=this.attributes.normal.array,n=this.attributes.uv.array,r=t.length/3;void 0===this.attributes.tangent&&this.setAttribute("tangent",new K.BufferAttribute(new Float32Array(4*r),4));for(var o=this.attributes.tangent.array,s=[],a=[],l=0;l<r;l++)s[l]=new K.Vector3,a[l]=new K.Vector3;var c,h,u,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M,T=new K.Vector3,C=new K.Vector3,P=new K.Vector3,D=new K.Vector2,L=new K.Vector2,I=new K.Vector2,R=new K.Vector3,O=new K.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,e.length,0);var N,k,F,V=this.drawcalls;for(E=0,A=V.length;E<A;++E){var U=V[E].start,B=V[E].count,z=V[E].index;for(x=U,_=U+B;x<_;x+=3)S=z+e[x],w=z+e[x+1],M=z+e[x+2],N=S,k=w,F=M,T.fromArray(t,3*N),C.fromArray(t,3*k),P.fromArray(t,3*F),D.fromArray(n,2*N),L.fromArray(n,2*k),I.fromArray(n,2*F),c=C.x-T.x,h=P.x-T.x,u=C.y-T.y,d=P.y-T.y,p=C.z-T.z,f=P.z-T.z,m=L.x-D.x,g=I.x-D.x,v=L.y-D.y,y=I.y-D.y,b=1/(m*y-g*v),R.set((y*c-v*h)*b,(y*u-v*d)*b,(y*p-v*f)*b),O.set((m*h-g*c)*b,(m*d-g*u)*b,(m*f-g*p)*b),s[N].add(R),s[k].add(R),s[F].add(R),a[N].add(O),a[k].add(O),a[F].add(O)}var G,H,W,j=new K.Vector3,X=new K.Vector3,q=new K.Vector3,Y=new K.Vector3;for(E=0,A=V.length;E<A;++E){U=V[E].start,B=V[E].count,z=V[E].index;for(x=U,_=U+B;x<_;x+=3)S=z+e[x],w=z+e[x+1],M=z+e[x+2],Z(S),Z(w),Z(M)}}else K.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function Z(e){q.fromArray(i,3*e),Y.copy(q),H=s[e],j.copy(H),j.sub(q.multiplyScalar(q.dot(H))).normalize(),X.crossVectors(Y,H),W=X.dot(a[e]),G=W<0?-1:1,o[4*e]=j.x,o[4*e+1]=j.y,o[4*e+2]=j.z,o[4*e+3]=G}},computeOffsets:function(e){void 0===e&&(e=65535);for(var t=this.attributes.index.array,i=this.attributes.position.array,n=t.length/3,r=new Uint16Array(t.length),o=0,s=0,a=[{start:0,count:0,index:0}],l=a[0],c=0,h=new Int32Array(6),u=new Int32Array(i.length),d=new Int32Array(i.length),p=0;p<i.length;p++)u[p]=-1,d[p]=-1;for(var f=0;f<n;f++){c=0;for(var m=0;m<3;m++){-1==u[b=t[3*f+m]]?(h[2*m]=b,h[2*m+1]=-1,c++):u[b]<l.index?(h[2*m]=b,h[2*m+1]=-1):(h[2*m]=b,h[2*m+1]=u[b])}if(s+c>l.index+e){var g={start:o,count:0,index:s};a.push(g),l=g;for(var v=0;v<6;v+=2){(y=h[v+1])>-1&&y<l.index&&(h[v+1]=-1)}}for(v=0;v<6;v+=2){var y,b=h[v];-1===(y=h[v+1])&&(y=s++),u[b]=y,d[y]=b,r[o++]=y-l.index,l.count++}}return this.reorderBuffers(r,d,s),this.offsets=a,this.drawcalls=a,a},merge:function(e,t){if(e instanceof K.BufferGeometry!=!1){void 0===t&&(t=0);var i=this.attributes;for(var n in i)if(void 0!==e.attributes[n])for(var r=i[n].array,o=e.attributes[n],s=o.array,a=0,l=o.itemSize*t;a<s.length;a++,l++)r[l]=s[a];return this}K.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e,t,i,n,r=this.attributes.normal.array,o=0,s=r.length;o<s;o+=3)e=r[o],t=r[o+1],i=r[o+2],n=1/Math.sqrt(e*e+t*t+i*i),r[o]*=n,r[o+1]*=n,r[o+2]*=n},reorderBuffers:function(e,t,i){var n={};for(var r in this.attributes)if("index"!=r){var o=this.attributes[r].array;n[r]=new o.constructor(this.attributes[r].itemSize*i)}for(var s=0;s<i;s++){var a=t[s];for(var r in this.attributes)if("index"!=r)for(var l=this.attributes[r].array,c=this.attributes[r].itemSize,h=n[r],u=0;u<c;u++)h[s*c+u]=l[a*c+u]}for(var r in this.attributes.index.array=e,this.attributes)"index"!=r&&(this.attributes[r].array=n[r],this.attributes[r].numItems=this.attributes[r].itemSize*i)},toJSON:function(){var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},t=this.attributes,i=this.offsets,n=this.boundingSphere;for(var r in t){var o=t[r],s=Array.prototype.slice.call(o.array);e.data.attributes[r]={itemSize:o.itemSize,type:o.array.constructor.name,array:s}}return i.length>0&&(e.data.offsets=JSON.parse(JSON.stringify(i))),null!==n&&(e.data.boundingSphere={center:n.center.toArray(),radius:n.radius}),e},clone:function(){var e=new K.BufferGeometry;for(var t in this.attributes){var i=this.attributes[t];e.setAttribute(t,i.clone())}for(var n=0,r=this.offsets.length;n<r;n++){var o=this.offsets[n];e.offsets.push({start:o.start,index:o.index,count:o.count})}return e},dispose:function(){this.dispatchEvent({type:"dispose"})}},K.EventDispatcher.prototype.apply(K.BufferGeometry.prototype),K.Geometry=function(){Object.defineProperty(this,"id",{value:K.GeometryIdCount++}),this.uuid=K.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.hasTangents=!1,this.dynamic=!0,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.tangentsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1},K.Geometry.prototype={constructor:K.Geometry,applyMatrix:function(e){for(var t=(new K.Matrix3).getNormalMatrix(e),i=0,n=this.vertices.length;i<n;i++){this.vertices[i].applyMatrix4(e)}for(i=0,n=this.faces.length;i<n;i++){var r=this.faces[i];r.normal.applyMatrix3(t).normalize();for(var o=0,s=r.vertexNormals.length;o<s;o++)r.vertexNormals[o].applyMatrix3(t).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0},fromBufferGeometry:function(e){for(var t=this,i=e.attributes,n=i.position.array,r=void 0!==i.index?i.index.array:void 0,o=void 0!==i.normal?i.normal.array:void 0,s=void 0!==i.color?i.color.array:void 0,a=void 0!==i.uv?i.uv.array:void 0,l=[],c=[],h=0,u=0;h<n.length;h+=3,u+=2)t.vertices.push(new K.Vector3(n[h],n[h+1],n[h+2])),void 0!==o&&l.push(new K.Vector3(o[h],o[h+1],o[h+2])),void 0!==s&&t.colors.push(new K.Color(s[h],s[h+1],s[h+2])),void 0!==a&&c.push(new K.Vector2(a[u],a[u+1]));var d=function(e,i,n){var r=void 0!==o?[l[e].clone(),l[i].clone(),l[n].clone()]:[],h=void 0!==s?[t.colors[e].clone(),t.colors[i].clone(),t.colors[n].clone()]:[];t.faces.push(new K.Face3(e,i,n,r,h)),void 0!==a&&t.faceVertexUvs[0].push([c[e].clone(),c[i].clone(),c[n].clone()])};if(void 0!==r){var p=e.drawcalls;if(p.length>0)for(h=0;h<p.length;h++)for(var f=p[h],m=f.start,g=f.count,v=f.index,y=(u=m,m+g);u<y;u+=3)d(v+r[u],v+r[u+1],v+r[u+2]);else for(h=0;h<r.length;h+=3)d(r[h],r[h+1],r[h+2])}else for(h=0;h<n.length/3;h+=3)d(h,h+1,h+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.applyMatrix((new K.Matrix4).setPosition(e)),e},computeFaceNormals:function(){for(var e=new K.Vector3,t=new K.Vector3,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],o=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];e.subVectors(a,s),t.subVectors(o,s),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,i,n,r,o,s;for(s=new Array(this.vertices.length),t=0,i=this.vertices.length;t<i;t++)s[t]=new K.Vector3;if(e){var a,l,c,h=new K.Vector3,u=new K.Vector3;for(n=0,r=this.faces.length;n<r;n++)o=this.faces[n],a=this.vertices[o.a],l=this.vertices[o.b],c=this.vertices[o.c],h.subVectors(c,l),u.subVectors(a,l),h.cross(u),s[o.a].add(h),s[o.b].add(h),s[o.c].add(h)}else for(n=0,r=this.faces.length;n<r;n++)s[(o=this.faces[n]).a].add(o.normal),s[o.b].add(o.normal),s[o.c].add(o.normal);for(t=0,i=this.vertices.length;t<i;t++)s[t].normalize();for(n=0,r=this.faces.length;n<r;n++)(o=this.faces[n]).vertexNormals[0]=s[o.a].clone(),o.vertexNormals[1]=s[o.b].clone(),o.vertexNormals[2]=s[o.c].clone()},computeMorphNormals:function(){var e,t,i,n,r;for(i=0,n=this.faces.length;i<n;i++)for((r=this.faces[i]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var o=new K.Geometry;for(o.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var s=this.morphNormals[e].faceNormals,a=this.morphNormals[e].vertexNormals;for(i=0,n=this.faces.length;i<n;i++)l=new K.Vector3,c={a:new K.Vector3,b:new K.Vector3,c:new K.Vector3},s.push(l),a.push(c)}var l,c,h=this.morphNormals[e];for(o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals(),i=0,n=this.faces.length;i<n;i++)r=this.faces[i],l=h.faceNormals[i],c=h.vertexNormals[i],l.copy(r.normal),c.a.copy(r.vertexNormals[0]),c.b.copy(r.vertexNormals[1]),c.c.copy(r.vertexNormals[2])}for(i=0,n=this.faces.length;i<n;i++)(r=this.faces[i]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeTangents:function(){var e,t,i,n,r,o,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M,T,C,P,D,L,I,R,O=[],N=[],k=new K.Vector3,F=new K.Vector3,V=new K.Vector3,U=new K.Vector3,B=new K.Vector3;for(i=0,n=this.vertices.length;i<n;i++)O[i]=new K.Vector3,N[i]=new K.Vector3;for(e=0,t=this.faces.length;e<t;e++)s=this.faces[e],a=this.faceVertexUvs[0][e],T=this,C=s.a,P=s.b,D=s.c,L=0,I=1,R=2,l=T.vertices[C],c=T.vertices[P],h=T.vertices[D],u=a[L],d=a[I],p=a[R],f=c.x-l.x,m=h.x-l.x,g=c.y-l.y,v=h.y-l.y,y=c.z-l.z,b=h.z-l.z,x=d.x-u.x,_=p.x-u.x,E=d.y-u.y,A=p.y-u.y,S=1/(x*A-_*E),k.set((A*f-E*m)*S,(A*g-E*v)*S,(A*y-E*b)*S),F.set((x*m-_*f)*S,(x*v-_*g)*S,(x*b-_*y)*S),O[C].add(k),O[P].add(k),O[D].add(k),N[C].add(F),N[P].add(F),N[D].add(F);var z=["a","b","c","d"];for(e=0,t=this.faces.length;e<t;e++)for(s=this.faces[e],r=0;r<Math.min(s.vertexNormals.length,3);r++)B.copy(s.vertexNormals[r]),o=s[z[r]],w=O[o],V.copy(w),V.sub(B.multiplyScalar(B.dot(w))).normalize(),U.crossVectors(s.vertexNormals[r],w),M=U.dot(N[o])<0?-1:1,s.vertexTangents[r]=new K.Vector4(V.x,V.y,V.z,M);this.hasTangents=!0},computeLineDistances:function(){for(var e=0,t=this.vertices,i=0,n=t.length;i<n;i++)i>0&&(e+=t[i].distanceTo(t[i-1])),this.lineDistances[i]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new K.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new K.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,i){if(e instanceof K.Geometry!=!1){var n,r=this.vertices.length,o=this.vertices,s=e.vertices,a=this.faces,l=e.faces,c=this.faceVertexUvs[0],h=e.faceVertexUvs[0];void 0===i&&(i=0),void 0!==t&&(n=(new K.Matrix3).getNormalMatrix(t));for(var u=0,d=s.length;u<d;u++){var p=s[u].clone();void 0!==t&&p.applyMatrix4(t),o.push(p)}for(u=0,d=l.length;u<d;u++){var f,m,g,v=l[u],y=v.vertexNormals,b=v.vertexColors;(f=new K.Face3(v.a+r,v.b+r,v.c+r)).normal.copy(v.normal),void 0!==n&&f.normal.applyMatrix3(n).normalize();for(var x=0,_=y.length;x<_;x++)m=y[x].clone(),void 0!==n&&m.applyMatrix3(n).normalize(),f.vertexNormals.push(m);f.color.copy(v.color);for(x=0,_=b.length;x<_;x++)g=b[x],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+i,a.push(f)}for(u=0,d=h.length;u<d;u++){var E=h[u],A=[];if(void 0!==E){for(x=0,_=E.length;x<_;x++)A.push(E[x].clone());c.push(A)}}}else K.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e instanceof K.Mesh!=!1?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):K.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,i,n,r,o,s,a,l={},c=[],h=[],u=Math.pow(10,4);for(i=0,n=this.vertices.length;i<n;i++)e=this.vertices[i],void 0===l[t=Math.round(e.x*u)+"_"+Math.round(e.y*u)+"_"+Math.round(e.z*u)]?(l[t]=i,c.push(this.vertices[i]),h[i]=c.length-1):h[i]=h[l[t]];var d=[];for(i=0,n=this.faces.length;i<n;i++){(r=this.faces[i]).a=h[r.a],r.b=h[r.b],r.c=h[r.c],o=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(o[p]==o[(p+1)%3]){p,d.push(i);break}}for(i=d.length-1;i>=0;i--){var f=d[i];for(this.faces.splice(f,1),s=0,a=this.faceVertexUvs.length;s<a;s++)this.faceVertexUvs[s].splice(f,1)}var m=this.vertices.length-c.length;return this.vertices=c,m},toJSON:function(){var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};if(""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}for(var n=[],r=0;r<this.vertices.length;r++){var o=this.vertices[r];n.push(o.x,o.y,o.z)}var s=[],a=[],l={},c=[],h={},u=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=p.normal.length()>0,g=p.vertexNormals.length>0,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,b=0;if(b=A(b,0,0),b=A(b,1,!1),b=A(b,2,!1),b=A(b,3,f),b=A(b,4,m),b=A(b,5,g),b=A(b,6,v),b=A(b,7,y),s.push(b),s.push(p.a,p.b,p.c),f){var x=this.faceVertexUvs[0][r];s.push(M(x[0]),M(x[1]),M(x[2]))}if(m&&s.push(S(p.normal)),g){var _=p.vertexNormals;s.push(S(_[0]),S(_[1]),S(_[2]))}if(v&&s.push(w(p.color)),y){var E=p.vertexColors;s.push(w(E[0]),w(E[1]),w(E[2]))}}function A(e,t,i){return i?e|1<<t:e&~(1<<t)}function S(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]||(l[t]=a.length/3,a.push(e.x,e.y,e.z)),l[t]}function w(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]||(h[t]=c.length,c.push(e.getHex())),h[t]}function M(e){var t=e.x.toString()+e.y.toString();return void 0!==d[t]||(d[t]=u.length/2,u.push(e.x,e.y)),d[t]}return e.data={},e.data.vertices=n,e.data.normals=a,c.length>0&&(e.data.colors=c),u.length>0&&(e.data.uvs=[u]),e.data.faces=s,e},clone:function(){for(var e=new K.Geometry,t=this.vertices,i=0,n=t.length;i<n;i++)e.vertices.push(t[i].clone());var r=this.faces;for(i=0,n=r.length;i<n;i++)e.faces.push(r[i].clone());for(i=0,n=this.faceVertexUvs.length;i<n;i++){var o=this.faceVertexUvs[i];void 0===e.faceVertexUvs[i]&&(e.faceVertexUvs[i]=[]);for(var s=0,a=o.length;s<a;s++){for(var l=o[s],c=[],h=0,u=l.length;h<u;h++){var d=l[h];c.push(d.clone())}e.faceVertexUvs[i].push(c)}}return e},dispose:function(){this.dispatchEvent({type:"dispose"})}},K.EventDispatcher.prototype.apply(K.Geometry.prototype),K.GeometryIdCount=0,K.Camera=function(){K.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new K.Matrix4,this.projectionMatrix=new K.Matrix4},K.Camera.prototype=Object.create(K.Object3D.prototype),K.Camera.prototype.constructor=K.Camera,K.Camera.prototype.getWorldDirection=function(){var e=new K.Quaternion;return function(t){var i=t||new K.Vector3;return this.getWorldQuaternion(e),i.set(0,0,-1).applyQuaternion(e)}}(),K.Camera.prototype.lookAt=function(){var e=new K.Matrix4;return function(t){e.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(e)}}(),K.Camera.prototype.clone=function(e){return void 0===e&&(e=new K.Camera),K.Object3D.prototype.clone.call(this,e),e.matrixWorldInverse.copy(this.matrixWorldInverse),e.projectionMatrix.copy(this.projectionMatrix),e},K.CubeCamera=function(e,t,i){K.Object3D.call(this),this.type="CubeCamera";var n=90,r=new K.PerspectiveCamera(n,1,e,t);r.up.set(0,-1,0),r.lookAt(new K.Vector3(1,0,0)),this.add(r);var o=new K.PerspectiveCamera(n,1,e,t);o.up.set(0,-1,0),o.lookAt(new K.Vector3(-1,0,0)),this.add(o);var s=new K.PerspectiveCamera(n,1,e,t);s.up.set(0,0,1),s.lookAt(new K.Vector3(0,1,0)),this.add(s);var a=new K.PerspectiveCamera(n,1,e,t);a.up.set(0,0,-1),a.lookAt(new K.Vector3(0,-1,0)),this.add(a);var l=new K.PerspectiveCamera(n,1,e,t);l.up.set(0,-1,0),l.lookAt(new K.Vector3(0,0,1)),this.add(l);var c=new K.PerspectiveCamera(n,1,e,t);c.up.set(0,-1,0),c.lookAt(new K.Vector3(0,0,-1)),this.add(c),this.renderTarget=new K.WebGLRenderTargetCube(i,i,{format:K.RGBFormat,magFilter:K.LinearFilter,minFilter:K.LinearFilter}),this.updateCubeMap=function(e,t){var i=this.renderTarget,n=i.generateMipmaps;i.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,r,i),i.activeCubeFace=1,e.render(t,o,i),i.activeCubeFace=2,e.render(t,s,i),i.activeCubeFace=3,e.render(t,a,i),i.activeCubeFace=4,e.render(t,l,i),i.generateMipmaps=n,i.activeCubeFace=5,e.render(t,c,i)}},K.CubeCamera.prototype=Object.create(K.Object3D.prototype),K.CubeCamera.prototype.constructor=K.CubeCamera,K.OrthographicCamera=function(e,t,i,n,r,o){K.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=e,this.right=t,this.top=i,this.bottom=n,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()},K.OrthographicCamera.prototype=Object.create(K.Camera.prototype),K.OrthographicCamera.prototype.constructor=K.OrthographicCamera,K.OrthographicCamera.prototype.updateProjectionMatrix=function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(i-e,i+e,n+t,n-t,this.near,this.far)},K.OrthographicCamera.prototype.clone=function(){var e=new K.OrthographicCamera;return K.Camera.prototype.clone.call(this,e),e.zoom=this.zoom,e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e.projectionMatrix.copy(this.projectionMatrix),e},K.PerspectiveCamera=function(e,t,i,n){K.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==e?e:50,this.aspect=void 0!==t?t:1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.updateProjectionMatrix()},K.PerspectiveCamera.prototype=Object.create(K.Camera.prototype),K.PerspectiveCamera.prototype.constructor=K.PerspectiveCamera,K.PerspectiveCamera.prototype.setLens=function(e,t){void 0===t&&(t=24),this.fov=2*K.Math.radToDeg(Math.atan(t/(2*e))),this.updateProjectionMatrix()},K.PerspectiveCamera.prototype.setViewOffset=function(e,t,i,n,r,o){this.fullWidth=e,this.fullHeight=t,this.x=i,this.y=n,this.width=r,this.height=o,this.updateProjectionMatrix()},K.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var e=K.Math.radToDeg(2*Math.atan(Math.tan(.5*K.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var t=this.fullWidth/this.fullHeight,i=Math.tan(K.Math.degToRad(.5*e))*this.near,n=-i,r=t*n,o=t*i,s=Math.abs(o-r),a=Math.abs(i-n);this.projectionMatrix.makeFrustum(r+this.x*s/this.fullWidth,r+(this.x+this.width)*s/this.fullWidth,i-(this.y+this.height)*a/this.fullHeight,i-this.y*a/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(e,this.aspect,this.near,this.far)},K.PerspectiveCamera.prototype.clone=function(){var e=new K.PerspectiveCamera;return K.Camera.prototype.clone.call(this,e),e.zoom=this.zoom,e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e.projectionMatrix.copy(this.projectionMatrix),e},K.Light=function(e){K.Object3D.call(this),this.type="Light",this.color=new K.Color(e)},K.Light.prototype=Object.create(K.Object3D.prototype),K.Light.prototype.constructor=K.Light,K.Light.prototype.clone=function(e){return void 0===e&&(e=new K.Light),K.Object3D.prototype.clone.call(this,e),e.color.copy(this.color),e},K.AmbientLight=function(e){K.Light.call(this,e),this.type="AmbientLight"},K.AmbientLight.prototype=Object.create(K.Light.prototype),K.AmbientLight.prototype.constructor=K.AmbientLight,K.AmbientLight.prototype.clone=function(){var e=new K.AmbientLight;return K.Light.prototype.clone.call(this,e),e},K.AreaLight=function(e,t){K.Light.call(this,e),this.type="AreaLight",this.normal=new K.Vector3(0,-1,0),this.right=new K.Vector3(1,0,0),this.intensity=void 0!==t?t:1,this.width=1,this.height=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},K.AreaLight.prototype=Object.create(K.Light.prototype),K.AreaLight.prototype.constructor=K.AreaLight,K.DirectionalLight=function(e,t){K.Light.call(this,e),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new K.Object3D,this.intensity=void 0!==t?t:1,this.castShadow=!1,this.onlyShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraRight=500,this.shadowCameraTop=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapWidth=512,this.shadowMapHeight=512,this.shadowCascade=!1,this.shadowCascadeOffset=new K.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMap=null,this.shadowMapSize=null,this.shadowCamera=null,this.shadowMatrix=null},K.DirectionalLight.prototype=Object.create(K.Light.prototype),K.DirectionalLight.prototype.constructor=K.DirectionalLight,K.DirectionalLight.prototype.clone=function(){var e=new K.DirectionalLight;return K.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e.shadowCameraNear=this.shadowCameraNear,e.shadowCameraFar=this.shadowCameraFar,e.shadowCameraLeft=this.shadowCameraLeft,e.shadowCameraRight=this.shadowCameraRight,e.shadowCameraTop=this.shadowCameraTop,e.shadowCameraBottom=this.shadowCameraBottom,e.shadowCameraVisible=this.shadowCameraVisible,e.shadowBias=this.shadowBias,e.shadowDarkness=this.shadowDarkness,e.shadowMapWidth=this.shadowMapWidth,e.shadowMapHeight=this.shadowMapHeight,e.shadowCascade=this.shadowCascade,e.shadowCascadeOffset.copy(this.shadowCascadeOffset),e.shadowCascadeCount=this.shadowCascadeCount,e.shadowCascadeBias=this.shadowCascadeBias.slice(0),e.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),e.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),e.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),e.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),e},K.HemisphereLight=function(e,t,i){K.Light.call(this,e),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new K.Color(t),this.intensity=void 0!==i?i:1},K.HemisphereLight.prototype=Object.create(K.Light.prototype),K.HemisphereLight.prototype.constructor=K.HemisphereLight,K.HemisphereLight.prototype.clone=function(){var e=new K.HemisphereLight;return K.Light.prototype.clone.call(this,e),e.groundColor.copy(this.groundColor),e.intensity=this.intensity,e},K.PointLight=function(e,t,i,n){K.Light.call(this,e),this.type="PointLight",this.intensity=void 0!==t?t:1,this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1},K.PointLight.prototype=Object.create(K.Light.prototype),K.PointLight.prototype.constructor=K.PointLight,K.PointLight.prototype.clone=function(){var e=new K.PointLight;return K.Light.prototype.clone.call(this,e),e.intensity=this.intensity,e.distance=this.distance,e.decay=this.decay,e},K.SpotLight=function(e,t,i,n,r,o){K.Light.call(this,e),this.type="SpotLight",this.position.set(0,1,0),this.target=new K.Object3D,this.intensity=void 0!==t?t:1,this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.exponent=void 0!==r?r:10,this.decay=void 0!==o?o:1,this.castShadow=!1,this.onlyShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapWidth=512,this.shadowMapHeight=512,this.shadowMap=null,this.shadowMapSize=null,this.shadowCamera=null,this.shadowMatrix=null},K.SpotLight.prototype=Object.create(K.Light.prototype),K.SpotLight.prototype.constructor=K.SpotLight,K.SpotLight.prototype.clone=function(){var e=new K.SpotLight;return K.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.distance=this.distance,e.angle=this.angle,e.exponent=this.exponent,e.decay=this.decay,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e.shadowCameraNear=this.shadowCameraNear,e.shadowCameraFar=this.shadowCameraFar,e.shadowCameraFov=this.shadowCameraFov,e.shadowCameraVisible=this.shadowCameraVisible,e.shadowBias=this.shadowBias,e.shadowDarkness=this.shadowDarkness,e.shadowMapWidth=this.shadowMapWidth,e.shadowMapHeight=this.shadowMapHeight,e},K.Cache={files:{},add:function(e,t){this.files[e]=t},get:function(e){return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},K.Loader=function(e){this.showStatus=e,this.statusDomElement=e?K.Loader.prototype.addStatusElement():null,this.imageLoader=new K.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},K.Loader.prototype={constructor:K.Loader,crossOrigin:void 0,addStatusElement:function(){var e=document.createElement("div");return e.style.position="absolute",e.style.right="0px",e.style.top="0px",e.style.fontSize="0.8em",e.style.textAlign="left",e.style.background="rgba(0,0,0,0.25)",e.style.color="#fff",e.style.width="120px",e.style.padding="0.5em 0.5em 0.5em 0.5em",e.style.zIndex=1e3,e.innerHTML="Loading ...",e},updateProgress:function(e){var t="Loaded ";e.total?t+=(100*e.loaded/e.total).toFixed(0)+"%":t+=(e.loaded/1024).toFixed(2)+" KB",this.statusDomElement.innerHTML=t},extractUrlBase:function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(e,t){for(var i=[],n=0;n<e.length;++n)i[n]=this.createMaterial(e[n],t);return i},needsTangents:function(e){for(var t=0,i=e.length;t<i;t++){if(e[t]instanceof K.ShaderMaterial)return!0}return!1},createMaterial:function(e,t){var i=this;function n(e){var t=Math.log(e)/Math.LN2;return Math.pow(2,Math.round(t))}function r(e,r,o,s,a,l,c){var h,u=t+o,d=K.Loader.Handlers.get(u);if(null!==d?h=d.load(u):(h=new K.Texture,(d=i.imageLoader).crossOrigin=i.crossOrigin,d.load(u,(function(e){if(!1===K.Math.isPowerOfTwo(e.width)||!1===K.Math.isPowerOfTwo(e.height)){var t=n(e.width),i=n(e.height),r=document.createElement("canvas");r.width=t,r.height=i,r.getContext("2d").drawImage(e,0,0,t,i),h.image=r}else h.image=e;h.needsUpdate=!0}))),h.sourceFile=o,s&&(h.repeat.set(s[0],s[1]),1!==s[0]&&(h.wrapS=K.RepeatWrapping),1!==s[1]&&(h.wrapT=K.RepeatWrapping)),a&&h.offset.set(a[0],a[1]),l){var p={repeat:K.RepeatWrapping,mirror:K.MirroredRepeatWrapping};void 0!==p[l[0]]&&(h.wrapS=p[l[0]]),void 0!==p[l[1]]&&(h.wrapT=p[l[1]])}c&&(h.anisotropy=c),e[r]=h}function o(e){return(255*e[0]<<16)+(255*e[1]<<8)+255*e[2]}var s="MeshLambertMaterial",a={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(e.shading){var l=e.shading.toLowerCase();"phong"===l?s="MeshPhongMaterial":"basic"===l&&(s="MeshBasicMaterial")}void 0!==e.blending&&void 0!==K[e.blending]&&(a.blending=K[e.blending]),void 0!==e.transparent&&(a.transparent=e.transparent),void 0!==e.opacity&&e.opacity<1&&(a.transparent=!0),void 0!==e.depthTest&&(a.depthTest=e.depthTest),void 0!==e.depthWrite&&(a.depthWrite=e.depthWrite),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.flipSided&&(a.side=K.BackSide),void 0!==e.doubleSided&&(a.side=K.DoubleSide),void 0!==e.wireframe&&(a.wireframe=e.wireframe),void 0!==e.vertexColors&&("face"===e.vertexColors?a.vertexColors=K.FaceColors:e.vertexColors&&(a.vertexColors=K.VertexColors)),e.colorDiffuse?a.color=o(e.colorDiffuse):e.DbgColor&&(a.color=e.DbgColor),e.colorSpecular&&(a.specular=o(e.colorSpecular)),e.colorEmissive&&(a.emissive=o(e.colorEmissive)),void 0!==e.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),e.opacity=e.transparency),void 0!==e.opacity&&(a.opacity=e.opacity),e.specularCoef&&(a.shininess=e.specularCoef),e.mapDiffuse&&t&&r(a,"map",e.mapDiffuse,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy),e.mapLight&&t&&r(a,"lightMap",e.mapLight,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy),e.mapBump&&t&&r(a,"bumpMap",e.mapBump,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy),e.mapNormal&&t&&r(a,"normalMap",e.mapNormal,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy),e.mapSpecular&&t&&r(a,"specularMap",e.mapSpecular,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy),e.mapAlpha&&t&&r(a,"alphaMap",e.mapAlpha,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy),e.mapBumpScale&&(a.bumpScale=e.mapBumpScale),e.mapNormalFactor&&(a.normalScale=new K.Vector2(e.mapNormalFactor,e.mapNormalFactor));var c=new K[s](a);return void 0!==e.DbgName&&(c.name=e.DbgName),c}},K.Loader.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=0,i=this.handlers.length;t<i;t+=2){var n=this.handlers[t],r=this.handlers[t+1];if(n.test(e))return r}return null}},K.XHRLoader=function(e){this.manager=void 0!==e?e:K.DefaultLoadingManager},K.XHRLoader.prototype={constructor:K.XHRLoader,load:function(e,t,i,n){var r=this,o=K.Cache.get(e);if(void 0===o){var s=new XMLHttpRequest;s.open("GET",e,!0),s.addEventListener("load",(function(i){K.Cache.add(e,this.response),t&&t(this.response),r.manager.itemEnd(e)}),!1),void 0!==i&&s.addEventListener("progress",(function(e){i(e)}),!1),void 0!==n&&s.addEventListener("error",(function(e){n(e)}),!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(s.responseType=this.responseType),s.send(null),r.manager.itemStart(e)}else t&&t(o)},setResponseType:function(e){this.responseType=e},setCrossOrigin:function(e){this.crossOrigin=e}},K.ImageLoader=function(e){this.manager=void 0!==e?e:K.DefaultLoadingManager},K.ImageLoader.prototype={constructor:K.ImageLoader,load:function(e,t,i,n){var r=this,o=K.Cache.get(e);if(void 0===o){var s=document.createElement("img");return s.addEventListener("load",(function(i){K.Cache.add(e,this),t&&t(this),r.manager.itemEnd(e)}),!1),void 0!==i&&s.addEventListener("progress",(function(e){i(e)}),!1),void 0!==n&&s.addEventListener("error",(function(e){n(e)}),!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),s.src=e,r.manager.itemStart(e),s}t(o)},setCrossOrigin:function(e){this.crossOrigin=e}},K.JSONLoader=function(e){K.Loader.call(this,e),this.withCredentials=!1},K.JSONLoader.prototype=Object.create(K.Loader.prototype),K.JSONLoader.prototype.constructor=K.JSONLoader,K.JSONLoader.prototype.load=function(e,t,i){i=i&&"string"==typeof i?i:this.extractUrlBase(e),this.onLoadStart(),this.loadAjaxJSON(this,e,t,i)},K.JSONLoader.prototype.loadAjaxJSON=function(e,t,i,n,r){var o=new XMLHttpRequest,s=0;o.onreadystatechange=function(){if(o.readyState===o.DONE)if(200===o.status||0===o.status){if(o.responseText){var a=JSON.parse(o.responseText),l=a.metadata;if(void 0!==l){if("object"===l.type)return void K.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===l.type)return void K.error("THREE.JSONLoader: "+t+" seems to be a Scene. Use THREE.SceneLoader instead.")}var c=e.parse(a,n);i(c.geometry,c.materials)}else K.error("THREE.JSONLoader: "+t+" seems to be unreachable or the file is empty.");e.onLoadComplete()}else K.error("THREE.JSONLoader: Couldn't load "+t+" ("+o.status+")");else o.readyState===o.LOADING?r&&(0===s&&(s=o.getResponseHeader("Content-Length")),r({total:s,loaded:o.responseText.length})):o.readyState===o.HEADERS_RECEIVED&&void 0!==r&&(s=o.getResponseHeader("Content-Length"))},o.open("GET",t,!0),o.withCredentials=this.withCredentials,o.send(null)},K.JSONLoader.prototype.parse=function(e,t){var i=new K.Geometry,n=void 0!==e.scale?1/e.scale:1;if(function(t){function n(e,t){return e&1<<t}var r,o,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M,T,C,P,D,L=e.faces,I=e.vertices,R=e.normals,O=e.colors,N=0;if(void 0!==e.uvs){for(r=0;r<e.uvs.length;r++)e.uvs[r].length&&N++;for(r=0;r<N;r++)i.faceVertexUvs[r]=[]}a=0,l=I.length;for(;a<l;)(_=new K.Vector3).x=I[a++]*t,_.y=I[a++]*t,_.z=I[a++]*t,i.vertices.push(_);a=0,l=L.length;for(;a<l;)if(p=L[a++],f=n(p,0),m=n(p,1),g=n(p,3),v=n(p,4),y=n(p,5),b=n(p,6),x=n(p,7),f){if((A=new K.Face3).a=L[a],A.b=L[a+1],A.c=L[a+3],(S=new K.Face3).a=L[a+1],S.b=L[a+2],S.c=L[a+3],a+=4,m&&(d=L[a++],A.materialIndex=d,S.materialIndex=d),s=i.faces.length,g)for(r=0;r<N;r++)for(T=e.uvs[r],i.faceVertexUvs[r][s]=[],i.faceVertexUvs[r][s+1]=[],o=0;o<4;o++)u=L[a++],P=T[2*u],D=T[2*u+1],C=new K.Vector2(P,D),2!==o&&i.faceVertexUvs[r][s].push(C),0!==o&&i.faceVertexUvs[r][s+1].push(C);if(v&&(h=3*L[a++],A.normal.set(R[h++],R[h++],R[h]),S.normal.copy(A.normal)),y)for(r=0;r<4;r++)h=3*L[a++],M=new K.Vector3(R[h++],R[h++],R[h]),2!==r&&A.vertexNormals.push(M),0!==r&&S.vertexNormals.push(M);if(b&&(c=L[a++],w=O[c],A.color.setHex(w),S.color.setHex(w)),x)for(r=0;r<4;r++)c=L[a++],w=O[c],2!==r&&A.vertexColors.push(new K.Color(w)),0!==r&&S.vertexColors.push(new K.Color(w));i.faces.push(A),i.faces.push(S)}else{if((E=new K.Face3).a=L[a++],E.b=L[a++],E.c=L[a++],m&&(d=L[a++],E.materialIndex=d),s=i.faces.length,g)for(r=0;r<N;r++)for(T=e.uvs[r],i.faceVertexUvs[r][s]=[],o=0;o<3;o++)u=L[a++],P=T[2*u],D=T[2*u+1],C=new K.Vector2(P,D),i.faceVertexUvs[r][s].push(C);if(v&&(h=3*L[a++],E.normal.set(R[h++],R[h++],R[h])),y)for(r=0;r<3;r++)h=3*L[a++],M=new K.Vector3(R[h++],R[h++],R[h]),E.vertexNormals.push(M);if(b&&(c=L[a++],E.color.setHex(O[c])),x)for(r=0;r<3;r++)c=L[a++],E.vertexColors.push(new K.Color(O[c]));i.faces.push(E)}}(n),function(){var t=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var n=0,r=e.skinWeights.length;n<r;n+=t){var o=e.skinWeights[n],s=t>1?e.skinWeights[n+1]:0,a=t>2?e.skinWeights[n+2]:0,l=t>3?e.skinWeights[n+3]:0;i.skinWeights.push(new K.Vector4(o,s,a,l))}if(e.skinIndices)for(n=0,r=e.skinIndices.length;n<r;n+=t){var c=e.skinIndices[n],h=t>1?e.skinIndices[n+1]:0,u=t>2?e.skinIndices[n+2]:0,d=t>3?e.skinIndices[n+3]:0;i.skinIndices.push(new K.Vector4(c,h,u,d))}i.bones=e.bones,i.bones&&i.bones.length>0&&(i.skinWeights.length!==i.skinIndices.length||i.skinIndices.length!==i.vertices.length)&&K.warn("THREE.JSONLoader: When skinning, number of vertices ("+i.vertices.length+"), skinIndices ("+i.skinIndices.length+"), and skinWeights ("+i.skinWeights.length+") should match.");i.animation=e.animation,i.animations=e.animations}(),function(t){var n,r,o,s,a,l,c,h,u,d,p;if(void 0!==e.morphTargets)for(a=0,l=e.morphTargets.length;a<l;a++)for(i.morphTargets[a]={},i.morphTargets[a].name=e.morphTargets[a].name,i.morphTargets[a].vertices=[],o=i.morphTargets[a].vertices,s=e.morphTargets[a].vertices,n=0,r=s.length;n<r;n+=3){var f=new K.Vector3;f.x=s[n]*t,f.y=s[n+1]*t,f.z=s[n+2]*t,o.push(f)}if(void 0!==e.morphColors)for(a=0,l=e.morphColors.length;a<l;a++)for(i.morphColors[a]={},i.morphColors[a].name=e.morphColors[a].name,i.morphColors[a].colors=[],u=i.morphColors[a].colors,d=e.morphColors[a].colors,c=0,h=d.length;c<h;c+=3)(p=new K.Color(16755200)).setRGB(d[c],d[c+1],d[c+2]),u.push(p)}(n),i.computeFaceNormals(),i.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:i};var r=this.initMaterials(e.materials,t);return this.needsTangents(r)&&i.computeTangents(),{geometry:i,materials:r}},K.LoadingManager=function(e,t,i){var n=this,r=0,o=0;this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){o++},this.itemEnd=function(e){r++,void 0!==n.onProgress&&n.onProgress(e,r,o),r===o&&void 0!==n.onLoad&&n.onLoad()}},K.DefaultLoadingManager=new K.LoadingManager,K.BufferGeometryLoader=function(e){this.manager=void 0!==e?e:K.DefaultLoadingManager},K.BufferGeometryLoader.prototype={constructor:K.BufferGeometryLoader,load:function(e,t,i,n){var r=this,o=new K.XHRLoader(r.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,(function(e){t(r.parse(JSON.parse(e)))}),i,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=new K.BufferGeometry,i=e.data.attributes;for(var n in i){var r=i[n],o=new self[r.type](r.array);t.setAttribute(n,new K.BufferAttribute(o,r.itemSize))}var s=e.data.offsets;void 0!==s&&(t.offsets=JSON.parse(JSON.stringify(s)));var a=e.data.boundingSphere;if(void 0!==a){var l=new K.Vector3;void 0!==a.center&&l.fromArray(a.center),t.boundingSphere=new K.Sphere(l,a.radius)}return t}},K.MaterialLoader=function(e){this.manager=void 0!==e?e:K.DefaultLoadingManager},K.MaterialLoader.prototype={constructor:K.MaterialLoader,load:function(e,t,i,n){var r=this,o=new K.XHRLoader(r.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,(function(e){t(r.parse(JSON.parse(e)))}),i,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=new K[e.type];if(void 0!==e.color&&t.color.setHex(e.color),void 0!==e.emissive&&t.emissive.setHex(e.emissive),void 0!==e.specular&&t.specular.setHex(e.specular),void 0!==e.shininess&&(t.shininess=e.shininess),void 0!==e.uniforms&&(t.uniforms=e.uniforms),void 0!==e.vertexShader&&(t.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(t.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(t.vertexColors=e.vertexColors),void 0!==e.shading&&(t.shading=e.shading),void 0!==e.blending&&(t.blending=e.blending),void 0!==e.side&&(t.side=e.side),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.transparent&&(t.transparent=e.transparent),void 0!==e.wireframe&&(t.wireframe=e.wireframe),void 0!==e.size&&(t.size=e.size),void 0!==e.sizeAttenuation&&(t.sizeAttenuation=e.sizeAttenuation),void 0!==e.materials)for(var i=0,n=e.materials.length;i<n;i++)t.materials.push(this.parse(e.materials[i]));return t}},K.ObjectLoader=function(e){this.manager=void 0!==e?e:K.DefaultLoadingManager,this.texturePath=""},K.ObjectLoader.prototype={constructor:K.ObjectLoader,load:function(e,t,i,n){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var r=this,o=new K.XHRLoader(r.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,(function(e){r.parse(JSON.parse(e),t)}),i,n)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var i=this.parseGeometries(e.geometries),n=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),r=this.parseTextures(e.textures,n),o=this.parseMaterials(e.materials,r),s=this.parseObject(e.object,i,o);return void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseGeometries:function(e){var t={};if(void 0!==e)for(var i=new K.JSONLoader,n=new K.BufferGeometryLoader,r=0,o=e.length;r<o;r++){var s,a=e[r];switch(a.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new K[a.type](a.width,a.height,a.widthSegments,a.heightSegments);break;case"BoxGeometry":case"CubeGeometry":s=new K.BoxGeometry(a.width,a.height,a.depth,a.widthSegments,a.heightSegments,a.depthSegments);break;case"CircleGeometry":s=new K.CircleGeometry(a.radius,a.segments);break;case"CylinderGeometry":s=new K.CylinderGeometry(a.radiusTop,a.radiusBottom,a.height,a.radialSegments,a.heightSegments,a.openEnded);break;case"SphereGeometry":s=new K.SphereGeometry(a.radius,a.widthSegments,a.heightSegments,a.phiStart,a.phiLength,a.thetaStart,a.thetaLength);break;case"IcosahedronGeometry":s=new K.IcosahedronGeometry(a.radius,a.detail);break;case"TorusGeometry":s=new K.TorusGeometry(a.radius,a.tube,a.radialSegments,a.tubularSegments,a.arc);break;case"TorusKnotGeometry":s=new K.TorusKnotGeometry(a.radius,a.tube,a.radialSegments,a.tubularSegments,a.p,a.q,a.heightScale);break;case"BufferGeometry":s=n.parse(a);break;case"Geometry":s=i.parse(a.data).geometry}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),t[a.uuid]=s}return t},parseMaterials:function(e,t){var i={};if(void 0!==e)for(var n=function(e){return void 0===t[e]&&K.warn("THREE.ObjectLoader: Undefined texture",e),t[e]},r=new K.MaterialLoader,o=0,s=e.length;o<s;o++){var a=e[o],l=r.parse(a);l.uuid=a.uuid,void 0!==a.name&&(l.name=a.name),void 0!==a.map&&(l.map=n(a.map)),void 0!==a.bumpMap&&(l.bumpMap=n(a.bumpMap),a.bumpScale&&(l.bumpScale=new K.Vector2(a.bumpScale,a.bumpScale))),void 0!==a.alphaMap&&(l.alphaMap=n(a.alphaMap)),void 0!==a.envMap&&(l.envMap=n(a.envMap)),void 0!==a.normalMap&&(l.normalMap=n(a.normalMap),a.normalScale&&(l.normalScale=new K.Vector2(a.normalScale,a.normalScale))),void 0!==a.lightMap&&(l.lightMap=n(a.lightMap)),void 0!==a.specularMap&&(l.specularMap=n(a.specularMap)),i[a.uuid]=l}return i},parseImages:function(e,t){var i=this,n={};if(void 0!==e&&e.length>0){var r=new K.LoadingManager(t),o=new K.ImageLoader(r);o.setCrossOrigin(this.crossOrigin);for(var s=function(e){return i.manager.itemStart(e),o.load(e,(function(){i.manager.itemEnd(e)}))},a=0,l=e.length;a<l;a++){var c=e[a],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:i.texturePath+c.url;n[c.uuid]=s(h)}}return n},parseTextures:function(e,t){var i={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var o=e[n];void 0===o.image&&K.warn('THREE.ObjectLoader: No "image" speficied for',o.uuid),void 0===t[o.image]&&K.warn("THREE.ObjectLoader: Undefined image",o.image);var s=new K.Texture(t[o.image]);s.needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.repeat&&(s.repeat=new K.Vector2(o.repeat[0],o.repeat[1])),void 0!==o.minFilter&&(s.minFilter=K[o.minFilter]),void 0!==o.magFilter&&(s.magFilter=K[o.magFilter]),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),o.wrap instanceof Array&&(s.wrapS=K[o.wrap[0]],s.wrapT=K[o.wrap[1]]),i[o.uuid]=s}return i},parseObject:function(){var e=new K.Matrix4;return function(t,i,n){var r,o=function(e){return void 0===i[e]&&K.warn("THREE.ObjectLoader: Undefined geometry",e),i[e]},s=function(e){return void 0===n[e]&&K.warn("THREE.ObjectLoader: Undefined material",e),n[e]};switch(t.type){case"Scene":r=new K.Scene;break;case"PerspectiveCamera":r=new K.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);break;case"OrthographicCamera":r=new K.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":r=new K.AmbientLight(t.color);break;case"DirectionalLight":r=new K.DirectionalLight(t.color,t.intensity);break;case"PointLight":r=new K.PointLight(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":r=new K.SpotLight(t.color,t.intensity,t.distance,t.angle,t.exponent,t.decay);break;case"HemisphereLight":r=new K.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":r=new K.Mesh(o(t.geometry),s(t.material));break;case"Line":r=new K.Line(o(t.geometry),s(t.material),t.mode);break;case"PointCloud":r=new K.PointCloud(o(t.geometry),s(t.material));break;case"Sprite":r=new K.Sprite(s(t.material));break;case"Group":r=new K.Group;break;default:r=new K.Object3D}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.children)for(var a in t.children)r.add(this.parseObject(t.children[a],i,n));return r}}()},K.TextureLoader=function(e){this.manager=void 0!==e?e:K.DefaultLoadingManager},K.TextureLoader.prototype={constructor:K.TextureLoader,load:function(e,t,i,n){var r=new K.ImageLoader(this.manager);r.setCrossOrigin(this.crossOrigin),r.load(e,(function(e){var i=new K.Texture(e);i.needsUpdate=!0,void 0!==t&&t(i)}),i,n)},setCrossOrigin:function(e){this.crossOrigin=e}},K.DataTextureLoader=K.BinaryTextureLoader=function(){this._parser=null},K.BinaryTextureLoader.prototype={constructor:K.BinaryTextureLoader,load:function(e,t,i,n){var r=this,o=new K.DataTexture,s=new K.XHRLoader;return s.setResponseType("arraybuffer"),s.load(e,(function(e){var i=r._parser(e);i&&(void 0!==i.image?o.image=i.image:void 0!==i.data&&(o.image.width=i.width,o.image.height=i.height,o.image.data=i.data),o.wrapS=void 0!==i.wrapS?i.wrapS:K.ClampToEdgeWrapping,o.wrapT=void 0!==i.wrapT?i.wrapT:K.ClampToEdgeWrapping,o.magFilter=void 0!==i.magFilter?i.magFilter:K.LinearFilter,o.minFilter=void 0!==i.minFilter?i.minFilter:K.LinearMipMapLinearFilter,o.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(o.format=i.format),void 0!==i.type&&(o.type=i.type),void 0!==i.mipmaps&&(o.mipmaps=i.mipmaps),1===i.mipmapCount&&(o.minFilter=K.LinearFilter),o.needsUpdate=!0,t&&t(o,i))}),i,n),o}},K.CompressedTextureLoader=function(){this._parser=null},K.CompressedTextureLoader.prototype={constructor:K.CompressedTextureLoader,load:function(e,t,i){var n=this,r=[],o=new K.CompressedTexture;o.image=r;var s=new K.XHRLoader;if(s.setResponseType("arraybuffer"),e instanceof Array)for(var a=0,l=function(i){s.load(e[i],(function(e){var s=n._parser(e,!0);r[i]={width:s.width,height:s.height,format:s.format,mipmaps:s.mipmaps},6===(a+=1)&&(1==s.mipmapCount&&(o.minFilter=K.LinearFilter),o.format=s.format,o.needsUpdate=!0,t&&t(o))}))},c=0,h=e.length;c<h;++c)l(c);else s.load(e,(function(e){var i=n._parser(e,!0);if(i.isCubemap)for(var s=i.mipmaps.length/i.mipmapCount,a=0;a<s;a++){r[a]={mipmaps:[]};for(var l=0;l<i.mipmapCount;l++)r[a].mipmaps.push(i.mipmaps[a*i.mipmapCount+l]),r[a].format=i.format,r[a].width=i.width,r[a].height=i.height}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=K.LinearFilter),o.format=i.format,o.needsUpdate=!0,t&&t(o)}));return o}},K.Material=function(){Object.defineProperty(this,"id",{value:K.MaterialIdCount++}),this.uuid=K.Math.generateUUID(),this.name="",this.type="Material",this.side=K.FrontSide,this.opacity=1,this.transparent=!1,this.blending=K.NormalBlending,this.blendSrc=K.SrcAlphaFactor,this.blendDst=K.OneMinusSrcAlphaFactor,this.blendEquation=K.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthTest=!0,this.depthWrite=!0,this.colorWrite=!0,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.overdraw=0,this.visible=!0,this._needsUpdate=!0},K.Material.prototype={constructor:K.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){!0===e&&this.update(),this._needsUpdate=e},setValues:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){if(t in this){var n=this[t];n instanceof K.Color?n.set(i):n instanceof K.Vector3&&i instanceof K.Vector3?n.copy(i):this[t]="overdraw"==t?Number(i):i}}else K.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(){var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};return""!==this.name&&(e.name=this.name),this instanceof K.MeshBasicMaterial?(e.color=this.color.getHex(),this.vertexColors!==K.NoColors&&(e.vertexColors=this.vertexColors),this.blending!==K.NormalBlending&&(e.blending=this.blending),this.side!==K.FrontSide&&(e.side=this.side)):this instanceof K.MeshLambertMaterial?(e.color=this.color.getHex(),e.emissive=this.emissive.getHex(),this.vertexColors!==K.NoColors&&(e.vertexColors=this.vertexColors),this.shading!==K.SmoothShading&&(e.shading=this.shading),this.blending!==K.NormalBlending&&(e.blending=this.blending),this.side!==K.FrontSide&&(e.side=this.side)):this instanceof K.MeshPhongMaterial?(e.color=this.color.getHex(),e.emissive=this.emissive.getHex(),e.specular=this.specular.getHex(),e.shininess=this.shininess,this.vertexColors!==K.NoColors&&(e.vertexColors=this.vertexColors),this.shading!==K.SmoothShading&&(e.shading=this.shading),this.blending!==K.NormalBlending&&(e.blending=this.blending),this.side!==K.FrontSide&&(e.side=this.side)):this instanceof K.MeshNormalMaterial||this instanceof K.MeshDepthMaterial?(this.blending!==K.NormalBlending&&(e.blending=this.blending),this.side!==K.FrontSide&&(e.side=this.side)):this instanceof K.PointCloudMaterial?(e.size=this.size,e.sizeAttenuation=this.sizeAttenuation,e.color=this.color.getHex(),this.vertexColors!==K.NoColors&&(e.vertexColors=this.vertexColors),this.blending!==K.NormalBlending&&(e.blending=this.blending)):this instanceof K.ShaderMaterial?(e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader):this instanceof K.SpriteMaterial&&(e.color=this.color.getHex()),this.opacity<1&&(e.opacity=this.opacity),!1!==this.transparent&&(e.transparent=this.transparent),!1!==this.wireframe&&(e.wireframe=this.wireframe),e},clone:function(e){return void 0===e&&(e=new K.Material),e.name=this.name,e.side=this.side,e.opacity=this.opacity,e.transparent=this.transparent,e.blending=this.blending,e.blendSrc=this.blendSrc,e.blendDst=this.blendDst,e.blendEquation=this.blendEquation,e.blendSrcAlpha=this.blendSrcAlpha,e.blendDstAlpha=this.blendDstAlpha,e.blendEquationAlpha=this.blendEquationAlpha,e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.polygonOffset=this.polygonOffset,e.polygonOffsetFactor=this.polygonOffsetFactor,e.polygonOffsetUnits=this.polygonOffsetUnits,e.alphaTest=this.alphaTest,e.overdraw=this.overdraw,e.visible=this.visible,e},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},K.EventDispatcher.prototype.apply(K.Material.prototype),K.MaterialIdCount=0,K.LineBasicMaterial=function(e){K.Material.call(this),this.type="LineBasicMaterial",this.color=new K.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=K.NoColors,this.fog=!0,this.setValues(e)},K.LineBasicMaterial.prototype=Object.create(K.Material.prototype),K.LineBasicMaterial.prototype.constructor=K.LineBasicMaterial,K.LineBasicMaterial.prototype.clone=function(){var e=new K.LineBasicMaterial;return K.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.linecap=this.linecap,e.linejoin=this.linejoin,e.vertexColors=this.vertexColors,e.fog=this.fog,e},K.LineDashedMaterial=function(e){K.Material.call(this),this.type="LineDashedMaterial",this.color=new K.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(e)},K.LineDashedMaterial.prototype=Object.create(K.Material.prototype),K.LineDashedMaterial.prototype.constructor=K.LineDashedMaterial,K.LineDashedMaterial.prototype.clone=function(){var e=new K.LineDashedMaterial;return K.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.scale=this.scale,e.dashSize=this.dashSize,e.gapSize=this.gapSize,e.vertexColors=this.vertexColors,e.fog=this.fog,e},K.MeshBasicMaterial=function(e){K.Material.call(this),this.type="MeshBasicMaterial",this.color=new K.Color(16777215),this.map=null,this.lightMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=K.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=K.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(e)},K.MeshBasicMaterial.prototype=Object.create(K.Material.prototype),K.MeshBasicMaterial.prototype.constructor=K.MeshBasicMaterial,K.MeshBasicMaterial.prototype.clone=function(){var e=new K.MeshBasicMaterial;return K.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e},K.MeshLambertMaterial=function(e){K.Material.call(this),this.type="MeshLambertMaterial",this.color=new K.Color(16777215),this.emissive=new K.Color(0),this.wrapAround=!1,this.wrapRGB=new K.Vector3(1,1,1),this.map=null,this.lightMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=K.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=K.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},K.MeshLambertMaterial.prototype=Object.create(K.Material.prototype),K.MeshLambertMaterial.prototype.constructor=K.MeshLambertMaterial,K.MeshLambertMaterial.prototype.clone=function(){var e=new K.MeshLambertMaterial;return K.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},K.MeshPhongMaterial=function(e){K.Material.call(this),this.type="MeshPhongMaterial",this.color=new K.Color(16777215),this.emissive=new K.Color(0),this.specular=new K.Color(1118481),this.shininess=30,this.metal=!1,this.wrapAround=!1,this.wrapRGB=new K.Vector3(1,1,1),this.map=null,this.lightMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new K.Vector2(1,1),this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=K.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=K.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=K.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},K.MeshPhongMaterial.prototype=Object.create(K.Material.prototype),K.MeshPhongMaterial.prototype.constructor=K.MeshPhongMaterial,K.MeshPhongMaterial.prototype.clone=function(){var e=new K.MeshPhongMaterial;return K.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.emissive.copy(this.emissive),e.specular.copy(this.specular),e.shininess=this.shininess,e.metal=this.metal,e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.bumpMap=this.bumpMap,e.bumpScale=this.bumpScale,e.normalMap=this.normalMap,e.normalScale.copy(this.normalScale),e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},K.MeshDepthMaterial=function(e){K.Material.call(this),this.type="MeshDepthMaterial",this.morphTargets=!1,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)},K.MeshDepthMaterial.prototype=Object.create(K.Material.prototype),K.MeshDepthMaterial.prototype.constructor=K.MeshDepthMaterial,K.MeshDepthMaterial.prototype.clone=function(){var e=new K.MeshDepthMaterial;return K.Material.prototype.clone.call(this,e),e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},K.MeshNormalMaterial=function(e){K.Material.call(this,e),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(e)},K.MeshNormalMaterial.prototype=Object.create(K.Material.prototype),K.MeshNormalMaterial.prototype.constructor=K.MeshNormalMaterial,K.MeshNormalMaterial.prototype.clone=function(){var e=new K.MeshNormalMaterial;return K.Material.prototype.clone.call(this,e),e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},K.MeshFaceMaterial=function(e){this.uuid=K.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=e instanceof Array?e:[]},K.MeshFaceMaterial.prototype={constructor:K.MeshFaceMaterial,toJSON:function(){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},t=0,i=this.materials.length;t<i;t++)e.materials.push(this.materials[t].toJSON());return e},clone:function(){for(var e=new K.MeshFaceMaterial,t=0;t<this.materials.length;t++)e.materials.push(this.materials[t].clone());return e}},K.PointCloudMaterial=function(e){K.Material.call(this),this.type="PointCloudMaterial",this.color=new K.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=K.NoColors,this.fog=!0,this.setValues(e)},K.PointCloudMaterial.prototype=Object.create(K.Material.prototype),K.PointCloudMaterial.prototype.constructor=K.PointCloudMaterial,K.PointCloudMaterial.prototype.clone=function(){var e=new K.PointCloudMaterial;return K.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,this.defines&&(e.defines=Object.assign({},this.defines)),e.size=this.size,e.sizeAttenuation=this.sizeAttenuation,e.vertexColors=this.vertexColors,e.fog=this.fog,e},K.ParticleBasicMaterial=function(e){return K.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial."),new K.PointCloudMaterial(e)},K.ParticleSystemMaterial=function(e){return K.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial."),new K.PointCloudMaterial(e)},K.ShaderMaterial=function(e){K.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.attributes=null,this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=K.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.vertexColors=K.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.setValues(e)},K.ShaderMaterial.prototype=Object.create(K.Material.prototype),K.ShaderMaterial.prototype.constructor=K.ShaderMaterial,K.ShaderMaterial.prototype.clone=function(){var e=new K.ShaderMaterial;return K.Material.prototype.clone.call(this,e),e.fragmentShader=this.fragmentShader,e.vertexShader=this.vertexShader,e.uniforms=K.UniformsUtils.clone(this.uniforms),e.attributes=this.attributes,e.defines=this.defines,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.fog=this.fog,e.lights=this.lights,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},K.RawShaderMaterial=function(e){K.ShaderMaterial.call(this,e),this.type="RawShaderMaterial"},K.RawShaderMaterial.prototype=Object.create(K.ShaderMaterial.prototype),K.RawShaderMaterial.prototype.constructor=K.RawShaderMaterial,K.RawShaderMaterial.prototype.clone=function(){var e=new K.RawShaderMaterial;return K.ShaderMaterial.prototype.clone.call(this,e),e},K.SpriteMaterial=function(e){K.Material.call(this),this.type="SpriteMaterial",this.color=new K.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(e)},K.SpriteMaterial.prototype=Object.create(K.Material.prototype),K.SpriteMaterial.prototype.constructor=K.SpriteMaterial,K.SpriteMaterial.prototype.clone=function(){var e=new K.SpriteMaterial;return K.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.rotation=this.rotation,e.fog=this.fog,e},K.Texture=function(e,t,i,n,r,o,s,a,l){Object.defineProperty(this,"id",{value:K.TextureIdCount++}),this.uuid=K.Math.generateUUID(),this.name="",this.sourceFile="",this.image=void 0!==e?e:K.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:K.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:K.ClampToEdgeWrapping,this.wrapT=void 0!==n?n:K.ClampToEdgeWrapping,this.magFilter=void 0!==r?r:K.LinearFilter,this.minFilter=void 0!==o?o:K.LinearMipMapLinearFilter,this.anisotropy=void 0!==l?l:1,this.format=void 0!==s?s:K.RGBAFormat,this.type=void 0!==a?a:K.UnsignedByteType,this.offset=new K.Vector2(0,0),this.repeat=new K.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this._needsUpdate=!1,this.onUpdate=null},K.Texture.DEFAULT_IMAGE=void 0,K.Texture.DEFAULT_MAPPING=K.UVMapping,K.Texture.prototype={constructor:K.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){!0===e&&this.update(),this._needsUpdate=e},clone:function(e){return void 0===e&&(e=new K.Texture),e.image=this.image,e.mipmaps=this.mipmaps.slice(0),e.mapping=this.mapping,e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.format=this.format,e.type=this.type,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.generateMipmaps=this.generateMipmaps,e.premultiplyAlpha=this.premultiplyAlpha,e.flipY=this.flipY,e.unpackAlignment=this.unpackAlignment,e},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},K.EventDispatcher.prototype.apply(K.Texture.prototype),K.TextureIdCount=0,K.CubeTexture=function(e,t,i,n,r,o,s,a,l){t=void 0!==t?t:K.CubeReflectionMapping,K.Texture.call(this,e,t,i,n,r,o,s,a,l),this.images=e},K.CubeTexture.prototype=Object.create(K.Texture.prototype),K.CubeTexture.prototype.constructor=K.CubeTexture,K.CubeTexture.clone=function(e){return void 0===e&&(e=new K.CubeTexture),K.Texture.prototype.clone.call(this,e),e.images=this.images,e},K.CompressedTexture=function(e,t,i,n,r,o,s,a,l,c,h){K.Texture.call(this,null,o,s,a,l,c,n,r,h),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1},K.CompressedTexture.prototype=Object.create(K.Texture.prototype),K.CompressedTexture.prototype.constructor=K.CompressedTexture,K.CompressedTexture.prototype.clone=function(){var e=new K.CompressedTexture;return K.Texture.prototype.clone.call(this,e),e},K.DataTexture=function(e,t,i,n,r,o,s,a,l,c,h){K.Texture.call(this,null,o,s,a,l,c,n,r,h),this.image={data:e,width:t,height:i}},K.DataTexture.prototype=Object.create(K.Texture.prototype),K.DataTexture.prototype.constructor=K.DataTexture,K.DataTexture.prototype.clone=function(){var e=new K.DataTexture;return K.Texture.prototype.clone.call(this,e),e},K.VideoTexture=function(e,t,i,n,r,o,s,a,l){K.Texture.call(this,e,t,i,n,r,o,s,a,l),this.generateMipmaps=!1;var c=this,h=function(){requestAnimationFrame(h),e.readyState===e.HAVE_ENOUGH_DATA&&(c.needsUpdate=!0)};h()},K.VideoTexture.prototype=Object.create(K.Texture.prototype),K.VideoTexture.prototype.constructor=K.VideoTexture,K.Group=function(){K.Object3D.call(this),this.type="Group"},K.Group.prototype=Object.create(K.Object3D.prototype),K.Group.prototype.constructor=K.Group,K.PointCloud=function(e,t){K.Object3D.call(this),this.type="PointCloud",this.geometry=void 0!==e?e:new K.Geometry,this.material=void 0!==t?t:new K.PointCloudMaterial({color:16777215*Math.random()})},K.PointCloud.prototype=Object.create(K.Object3D.prototype),K.PointCloud.prototype.constructor=K.PointCloud,K.PointCloud.prototype.raycast=(C=new K.Matrix4,P=new K.Ray,function(e,t){var i=this,n=i.geometry,r=e.params.PointCloud.threshold;if(C.getInverse(this.matrixWorld),P.copy(e.ray).applyMatrix4(C),null===n.boundingBox||!1!==P.isIntersectionBox(n.boundingBox)){var o=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=new K.Vector3,a=function(n,r){var s=P.distanceToPoint(n);if(s<o){var a=P.closestPointToPoint(n);a.applyMatrix4(i.matrixWorld);var l=e.ray.origin.distanceTo(a);t.push({distance:l,distanceToRay:s,point:a.clone(),index:r,face:null,object:i})}};if(n instanceof K.BufferGeometry){var l=n.attributes,c=l.position.array;if(void 0!==l.index){var h=l.index.array,u=n.offsets;0===u.length&&(u=[{start:0,count:h.length,index:0}]);for(var d=0,p=u.length;d<p;++d)for(var f=u[d].start,m=u[d].count,g=u[d].index,v=f,y=f+m;v<y;v++){var b=g+h[v];s.fromArray(c,3*b),a(s,b)}}else{var x=c.length/3;for(v=0;v<x;v++)s.set(c[3*v],c[3*v+1],c[3*v+2]),a(s,v)}}else{var _=this.geometry.vertices;for(v=0;v<_.length;v++)a(_[v],v)}}}),K.PointCloud.prototype.clone=function(e){return void 0===e&&(e=new K.PointCloud(this.geometry,this.material)),K.Object3D.prototype.clone.call(this,e),e},K.ParticleSystem=function(e,t){return K.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud."),new K.PointCloud(e,t)},K.Line=function(e,t,i){K.Object3D.call(this),this.type="Line",this.geometry=void 0!==e?e:new K.Geometry,this.material=void 0!==t?t:new K.LineBasicMaterial({color:16777215*Math.random()}),this.mode=void 0!==i?i:K.LineStrip},K.LineStrip=0,K.LinePieces=1,K.Line.prototype=Object.create(K.Object3D.prototype),K.Line.prototype.constructor=K.Line,K.Line.prototype.raycast=function(){var e=new K.Matrix4,t=new K.Ray,i=new K.Sphere;return function(n,r){var o=n.linePrecision,s=o*o,a=this.geometry;if(null===a.boundingSphere&&a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(this.matrixWorld),!1!==n.ray.isIntersectionSphere(i)){e.getInverse(this.matrixWorld),t.copy(n.ray).applyMatrix4(e);var l=new K.Vector3,c=new K.Vector3,h=new K.Vector3,u=new K.Vector3,d=this.mode===K.LineStrip?1:2;if(a instanceof K.BufferGeometry){var p=a.attributes;if(void 0!==p.index){var f=p.index.array,m=p.position.array,g=a.offsets;0===g.length&&(g=[{start:0,count:f.length,index:0}]);for(var v=0;v<g.length;v++)for(var y=g[v].start,b=g[v].count,x=g[v].index,_=y;_<y+b-1;_+=d){var E=x+f[_],A=x+f[_+1];if(l.fromArray(m,3*E),c.fromArray(m,3*A),!(t.distanceSqToSegment(l,c,u,h)>s))(M=t.origin.distanceTo(u))<n.near||M>n.far||r.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:_,offsetIndex:v,face:null,faceIndex:null,object:this})}}else for(m=p.position.array,_=0;_<m.length/3-1;_+=d){if(l.fromArray(m,3*_),c.fromArray(m,3*_+3),!(t.distanceSqToSegment(l,c,u,h)>s))(M=t.origin.distanceTo(u))<n.near||M>n.far||r.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}else if(a instanceof K.Geometry){var S=a.vertices,w=S.length;for(_=0;_<w-1;_+=d){var M;if(!(t.distanceSqToSegment(S[_],S[_+1],u,h)>s))(M=t.origin.distanceTo(u))<n.near||M>n.far||r.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:_,face:null,faceIndex:null,object:this})}}}}}(),K.Line.prototype.clone=function(e){return void 0===e&&(e=new K.Line(this.geometry,this.material,this.mode)),K.Object3D.prototype.clone.call(this,e),e},K.Mesh=function(e,t){K.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new K.Geometry,this.material=void 0!==t?t:new K.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},K.Mesh.prototype=Object.create(K.Object3D.prototype),K.Mesh.prototype.constructor=K.Mesh,K.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetForcedOrder=[],this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;e<t;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}},K.Mesh.prototype.getMorphTargetIndexByName=function(e){return void 0!==this.morphTargetDictionary[e]?this.morphTargetDictionary[e]:(K.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0."),0)},K.Mesh.prototype.raycast=function(){var e=new K.Matrix4,t=new K.Ray,i=new K.Sphere,n=new K.Vector3,r=new K.Vector3,o=new K.Vector3;return function(s,a){var l=this.geometry;if(null===l.boundingSphere&&l.computeBoundingSphere(),i.copy(l.boundingSphere),i.applyMatrix4(this.matrixWorld),!1!==s.ray.isIntersectionSphere(i)&&(e.getInverse(this.matrixWorld),t.copy(s.ray).applyMatrix4(e),null===l.boundingBox||!1!==t.isIntersectionBox(l.boundingBox)))if(l instanceof K.BufferGeometry){if(void 0===(L=this.material))return;var c=l.attributes,h=s.precision;if(void 0!==c.index){var u=c.index.array,d=c.position.array,p=l.offsets;0===p.length&&(p=[{start:0,count:u.length,index:0}]);for(var f=0,m=p.length;f<m;++f)for(var g=p[f].start,v=p[f].count,y=p[f].index,b=g,x=g+v;b<x;b+=3){if(A=y+u[b],S=y+u[b+1],w=y+u[b+2],n.fromArray(d,3*A),r.fromArray(d,3*S),o.fromArray(d,3*w),L.side===K.BackSide)var _=t.intersectTriangle(o,r,n,!0);else _=t.intersectTriangle(n,r,o,L.side!==K.DoubleSide);if(null!==_)_.applyMatrix4(this.matrixWorld),(U=s.ray.origin.distanceTo(_))<h||U<s.near||U>s.far||a.push({distance:U,point:_,face:new K.Face3(A,S,w,K.Triangle.normal(n,r,o)),faceIndex:null,object:this})}}else{b=0;var E=0;for(x=(d=c.position.array).length;b<x;b+=3,E+=9){if(A=b,S=b+1,w=b+2,n.fromArray(d,E),r.fromArray(d,E+3),o.fromArray(d,E+6),L.side===K.BackSide)_=t.intersectTriangle(o,r,n,!0);else _=t.intersectTriangle(n,r,o,L.side!==K.DoubleSide);if(null!==_)_.applyMatrix4(this.matrixWorld),(U=s.ray.origin.distanceTo(_))<h||U<s.near||U>s.far||a.push({distance:U,point:_,face:new K.Face3(A,S,w,K.Triangle.normal(n,r,o)),faceIndex:null,object:this})}}}else if(l instanceof K.Geometry)for(var A,S,w,M=this.material instanceof K.MeshFaceMaterial,T=!0===M?this.material.materials:null,C=(h=s.precision,l.vertices),P=0,D=l.faces.length;P<D;P++){var L,I=l.faces[P];if(void 0!==(L=!0===M?T[I.materialIndex]:this.material)){if(A=C[I.a],S=C[I.b],w=C[I.c],!0===L.morphTargets){var R=l.morphTargets,O=this.morphTargetInfluences;n.set(0,0,0),r.set(0,0,0),o.set(0,0,0);for(var N=0,k=R.length;N<k;N++){var F=O[N];if(0!==F){var V=R[N].vertices;n.x+=(V[I.a].x-A.x)*F,n.y+=(V[I.a].y-A.y)*F,n.z+=(V[I.a].z-A.z)*F,r.x+=(V[I.b].x-S.x)*F,r.y+=(V[I.b].y-S.y)*F,r.z+=(V[I.b].z-S.z)*F,o.x+=(V[I.c].x-w.x)*F,o.y+=(V[I.c].y-w.y)*F,o.z+=(V[I.c].z-w.z)*F}}n.add(A),r.add(S),o.add(w),A=n,S=r,w=o}if(L.side===K.BackSide)_=t.intersectTriangle(w,S,A,!0);else _=t.intersectTriangle(A,S,w,L.side!==K.DoubleSide);var U;if(null!==_)_.applyMatrix4(this.matrixWorld),(U=s.ray.origin.distanceTo(_))<h||U<s.near||U>s.far||a.push({distance:U,point:_,face:I,faceIndex:P,object:this})}}}}(),K.Mesh.prototype.clone=function(e,t){return void 0===e&&(e=new K.Mesh(this.geometry,this.material)),K.Object3D.prototype.clone.call(this,e,t),e},K.Bone=function(e){K.Object3D.call(this),this.type="Bone",this.skin=e},K.Bone.prototype=Object.create(K.Object3D.prototype),K.Bone.prototype.constructor=K.Bone,K.Skeleton=function(e,t,i){var n;(this.useVertexTexture=void 0===i||i,this.identityMatrix=new K.Matrix4,e=e||[],this.bones=e.slice(0),this.useVertexTexture)?(n=this.bones.length>256?64:this.bones.length>64?32:this.bones.length>16?16:8,this.boneTextureWidth=n,this.boneTextureHeight=n,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new K.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,K.RGBAFormat,K.FloatType),this.boneTexture.minFilter=K.NearestFilter,this.boneTexture.magFilter=K.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{K.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var r=0,o=this.bones.length;r<o;r++)this.boneInverses.push(new K.Matrix4)}},K.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var i=new K.Matrix4;this.bones[e]&&i.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(i)}},K.Skeleton.prototype.pose=function(){for(var e,t=0,i=this.bones.length;t<i;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,i=this.bones.length;t<i;t++)(e=this.bones[t])&&(e.parent?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},K.Skeleton.prototype.update=(D=new K.Matrix4,function(){for(var e=0,t=this.bones.length;e<t;e++){var i=this.bones[e]?this.bones[e].matrixWorld:this.identityMatrix;D.multiplyMatrices(i,this.boneInverses[e]),D.flattenToArrayOffset(this.boneMatrices,16*e)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}),K.SkinnedMesh=function(e,t,i){K.Mesh.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new K.Matrix4,this.bindMatrixInverse=new K.Matrix4;var n=[];if(this.geometry&&void 0!==this.geometry.bones){for(var r,o,s,a,l,c=0,h=this.geometry.bones.length;c<h;++c)s=(o=this.geometry.bones[c]).pos,a=o.rotq,l=o.scl,r=new K.Bone(this),n.push(r),r.name=o.name,r.position.set(s[0],s[1],s[2]),r.quaternion.set(a[0],a[1],a[2],a[3]),void 0!==l?r.scale.set(l[0],l[1],l[2]):r.scale.set(1,1,1);for(c=0,h=this.geometry.bones.length;c<h;++c)-1!==(o=this.geometry.bones[c]).parent?n[o.parent].add(n[c]):this.add(n[c])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new K.Skeleton(n,void 0,i))},K.SkinnedMesh.prototype=Object.create(K.Mesh.prototype),K.SkinnedMesh.prototype.constructor=K.SkinnedMesh,K.SkinnedMesh.prototype.bind=function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},K.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},K.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof K.Geometry)for(var e=0;e<this.geometry.skinIndices.length;e++){var t=this.geometry.skinWeights[e],i=1/t.lengthManhattan();i!==1/0?t.multiplyScalar(i):t.set(1)}},K.SkinnedMesh.prototype.updateMatrixWorld=function(e){K.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):K.warn("THREE.SkinnedMesh unreckognized bindMode: "+this.bindMode)},K.SkinnedMesh.prototype.clone=function(e){return void 0===e&&(e=new K.SkinnedMesh(this.geometry,this.material,this.useVertexTexture)),K.Mesh.prototype.clone.call(this,e),e},K.MorphAnimMesh=function(e,t){K.Mesh.call(this,e,t),this.type="MorphAnimMesh",this.duration=1e3,this.mirroredLoop=!1,this.time=0,this.lastKeyframe=0,this.currentKeyframe=0,this.direction=1,this.directionBackwards=!1,this.setFrameRange(0,this.geometry.morphTargets.length-1)},K.MorphAnimMesh.prototype=Object.create(K.Mesh.prototype),K.MorphAnimMesh.prototype.constructor=K.MorphAnimMesh,K.MorphAnimMesh.prototype.setFrameRange=function(e,t){this.startKeyframe=e,this.endKeyframe=t,this.length=this.endKeyframe-this.startKeyframe+1},K.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1,this.directionBackwards=!1},K.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1,this.directionBackwards=!0},K.MorphAnimMesh.prototype.parseAnimations=function(){var e=this.geometry;e.animations||(e.animations={});for(var t,i=e.animations,n=/([a-z]+)_?(\d+)/,r=0,o=e.morphTargets.length;r<o;r++){var s=e.morphTargets[r].name.match(n);if(s&&s.length>1){var a=s[1];i[a]||(i[a]={start:1/0,end:-1/0});var l=i[a];r<l.start&&(l.start=r),r>l.end&&(l.end=r),t||(t=a)}}e.firstAnimation=t},K.MorphAnimMesh.prototype.setAnimationLabel=function(e,t,i){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[e]={start:t,end:i}},K.MorphAnimMesh.prototype.playAnimation=function(e,t){var i=this.geometry.animations[e];i?(this.setFrameRange(i.start,i.end),this.duration=(i.end-i.start)/t*1e3,this.time=0):K.warn("THREE.MorphAnimMesh: animation["+e+"] undefined in .playAnimation()")},K.MorphAnimMesh.prototype.updateAnimation=function(e){var t=this.duration/this.length;this.time+=this.direction*e,this.mirroredLoop?(this.time>this.duration||this.time<0)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),this.time<0&&(this.time=0,this.directionBackwards=!1)):(this.time=this.time%this.duration,this.time<0&&(this.time+=this.duration));var i=this.startKeyframe+K.Math.clamp(Math.floor(this.time/t),0,this.length-1);i!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[i]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=i);var n=this.time%t/t;this.directionBackwards&&(n=1-n),this.morphTargetInfluences[this.currentKeyframe]=n,this.morphTargetInfluences[this.lastKeyframe]=1-n},K.MorphAnimMesh.prototype.interpolateTargets=function(e,t,i){for(var n=this.morphTargetInfluences,r=0,o=n.length;r<o;r++)n[r]=0;e>-1&&(n[e]=1-i),t>-1&&(n[t]=i)},K.MorphAnimMesh.prototype.clone=function(e){return void 0===e&&(e=new K.MorphAnimMesh(this.geometry,this.material)),e.duration=this.duration,e.mirroredLoop=this.mirroredLoop,e.time=this.time,e.lastKeyframe=this.lastKeyframe,e.currentKeyframe=this.currentKeyframe,e.direction=this.direction,e.directionBackwards=this.directionBackwards,K.Mesh.prototype.clone.call(this,e),e},K.LOD=function(){K.Object3D.call(this),this.objects=[]},K.LOD.prototype=Object.create(K.Object3D.prototype),K.LOD.prototype.constructor=K.LOD,K.LOD.prototype.addLevel=function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var i=0;i<this.objects.length&&!(t<this.objects[i].distance);i++);this.objects.splice(i,0,{distance:t,object:e}),this.add(e)},K.LOD.prototype.getObjectForDistance=function(e){for(var t=1,i=this.objects.length;t<i&&!(e<this.objects[t].distance);t++);return this.objects[t-1].object},K.LOD.prototype.raycast=(L=new K.Vector3,function(e,t){L.setFromMatrixPosition(this.matrixWorld);var i=e.ray.origin.distanceTo(L);this.getObjectForDistance(i).raycast(e,t)}),K.LOD.prototype.update=function(){var e=new K.Vector3,t=new K.Vector3;return function(i){if(this.objects.length>1){e.setFromMatrixPosition(i.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var n=e.distanceTo(t);this.objects[0].object.visible=!0;for(var r=1,o=this.objects.length;r<o&&n>=this.objects[r].distance;r++)this.objects[r-1].object.visible=!1,this.objects[r].object.visible=!0;for(;r<o;r++)this.objects[r].object.visible=!1}}}(),K.LOD.prototype.clone=function(e){void 0===e&&(e=new K.LOD),K.Object3D.prototype.clone.call(this,e);for(var t=0,i=this.objects.length;t<i;t++){var n=this.objects[t].object.clone();n.visible=0===t,e.addLevel(n,this.objects[t].distance)}return e},K.Sprite=(I=new Uint16Array([0,1,2,0,2,3]),R=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),O=new Float32Array([0,0,1,0,1,1,0,1]),(N=new K.BufferGeometry).setAttribute("index",new K.BufferAttribute(I,1)),N.setAttribute("position",new K.BufferAttribute(R,3)),N.setAttribute("uv",new K.BufferAttribute(O,2)),function(e){K.Object3D.call(this),this.type="Sprite",this.geometry=N,this.material=void 0!==e?e:new K.SpriteMaterial}),K.Sprite.prototype=Object.create(K.Object3D.prototype),K.Sprite.prototype.constructor=K.Sprite,K.Sprite.prototype.raycast=function(){var e=new K.Vector3;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var n=t.ray.distanceToPoint(e);n>this.scale.x||i.push({distance:n,point:this.position,face:null,object:this})}}(),K.Sprite.prototype.clone=function(e){return void 0===e&&(e=new K.Sprite(this.material)),K.Object3D.prototype.clone.call(this,e),e},K.Particle=K.Sprite,K.LensFlare=function(e,t,i,n,r){K.Object3D.call(this),this.lensFlares=[],this.positionScreen=new K.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,i,n,r)},K.LensFlare.prototype=Object.create(K.Object3D.prototype),K.LensFlare.prototype.constructor=K.LensFlare,K.LensFlare.prototype.add=function(e,t,i,n,r,o){void 0===t&&(t=-1),void 0===i&&(i=0),void 0===o&&(o=1),void 0===r&&(r=new K.Color(16777215)),void 0===n&&(n=K.NormalBlending),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:e,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:1,opacity:o,color:r,blending:n})},K.LensFlare.prototype.updateLensFlares=function(){var e,t,i=this.lensFlares.length,n=2*-this.positionScreen.x,r=2*-this.positionScreen.y;for(e=0;e<i;e++)(t=this.lensFlares[e]).x=this.positionScreen.x+n*t.distance,t.y=this.positionScreen.y+r*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)},K.Scene=function(){K.Object3D.call(this),this.type="Scene",this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0},K.Scene.prototype=Object.create(K.Object3D.prototype),K.Scene.prototype.constructor=K.Scene,K.Scene.prototype.clone=function(e){return void 0===e&&(e=new K.Scene),K.Object3D.prototype.clone.call(this,e),null!==this.fog&&(e.fog=this.fog.clone()),null!==this.overrideMaterial&&(e.overrideMaterial=this.overrideMaterial.clone()),e.autoUpdate=this.autoUpdate,e.matrixAutoUpdate=this.matrixAutoUpdate,e},K.Fog=function(e,t,i){this.name="",this.color=new K.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3},K.Fog.prototype.clone=function(){return new K.Fog(this.color.getHex(),this.near,this.far)},K.FogExp2=function(e,t){this.name="",this.color=new K.Color(e),this.density=void 0!==t?t:25e-5},K.FogExp2.prototype.clone=function(){return new K.FogExp2(this.color.getHex(),this.density)},K.ShaderChunk={},K.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2 square( in vec2 a ) { return vec2( a.x*a.x, a.y*a.y ); }\nvec3 square( in vec3 a ) { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4 square( in vec4 a ) { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2 saturate( in vec2 a ) { return clamp( a, 0.0, 1.0 ); }\nvec3 saturate( in vec3 a ) { return clamp( a, 0.0, 1.0 ); }\nvec4 saturate( in vec4 a ) { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a ) { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a ) { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a ) { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2 whiteCompliment( in vec2 a ) { return saturate( vec2(1.0) - a ); }\nvec3 whiteCompliment( in vec3 a ) { return saturate( vec3(1.0) - a ); }\nvec4 whiteCompliment( in vec4 a ) { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n\tfloat distance = dot( planeNormal, point-pointOnPlane );\n\treturn point - distance * planeNormal;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n\tif ( decayExponent > 0.0 ) {\n\t return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n\t}\n\treturn 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\n",K.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",K.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack += ambientLightColor;\n\n#endif\n",K.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n\n#endif\n",K.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n\tvec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n\tvec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",K.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif",K.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n",K.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif",K.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif",K.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n\t#endif\n\n#else\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\ttotalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\ttotalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\ttotalDiffuseLight += hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\n#ifdef METAL\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",K.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif",K.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif",K.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif\n",K.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",K.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",K.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n",K.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif",K.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif",K.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif",K.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\n\tdiffuseColor *= texelColor;\n\n#endif",K.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif",K.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",K.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",K.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\tvColor.xyz = inputToLinear( color.xyz );\n\n#endif",K.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n\n#endif\n",K.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\n#endif\n",K.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",K.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif",K.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n",K.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n",K.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",K.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif",K.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif",K.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif",K.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif",K.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n\t\tfogFactor = whiteCompliment( fogFactor );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",K.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",K.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n\tvec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n\tvec3 objectNormal = morphedNormal;\n\n#else\n\n\tvec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",K.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n",K.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",K.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",K.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\toutgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",K.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",K.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif",K.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif",K.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t#else\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t#endif\n\n#endif\n",K.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t// NOTE: I am unsure if this is correct in linear space. -bhouston, Dec 29, 2014\n\tshadowColor = inputToLinear( shadowColor );\n\n\toutgoingLight = outgoingLight * shadowColor;\n\n#endif\n",K.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#elif defined( USE_MORPHTARGETS )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif\n",K.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif",K.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",K.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif",K.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",K.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",K.UniformsUtils={merge:function(e){for(var t={},i=0;i<e.length;i++){var n=this.clone(e[i]);for(var r in n)t[r]=n[r]}return t},clone:function(e){var t={};for(var i in e)for(var n in t[i]={},e[i]){var r=e[i][n];r instanceof K.Color||r instanceof K.Vector2||r instanceof K.Vector3||r instanceof K.Vector4||r instanceof K.Matrix4||r instanceof K.Texture?t[i][n]=r.clone():t[i][n]=r instanceof Array?r.slice():r}return t}},K.UniformsLib={common:{diffuse:{type:"c",value:new K.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new K.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98},morphTargetInfluences:{type:"f",value:0}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new K.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new K.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},pointLightDecay:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]},spotLightDecay:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new K.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new K.Vector4(0,0,1,1)},fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new K.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}},K.ShaderLib={basic:{uniforms:K.UniformsUtils.merge([K.UniformsLib.common,K.UniformsLib.fog,K.UniformsLib.shadowmap]),vertexShader:[K.ShaderChunk.common,K.ShaderChunk.map_pars_vertex,K.ShaderChunk.lightmap_pars_vertex,K.ShaderChunk.envmap_pars_vertex,K.ShaderChunk.color_pars_vertex,K.ShaderChunk.morphtarget_pars_vertex,K.ShaderChunk.skinning_pars_vertex,K.ShaderChunk.shadowmap_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",K.ShaderChunk.map_vertex,K.ShaderChunk.lightmap_vertex,K.ShaderChunk.color_vertex,K.ShaderChunk.skinbase_vertex,"\t#ifdef USE_ENVMAP",K.ShaderChunk.morphnormal_vertex,K.ShaderChunk.skinnormal_vertex,K.ShaderChunk.defaultnormal_vertex,"\t#endif",K.ShaderChunk.morphtarget_vertex,K.ShaderChunk.skinning_vertex,K.ShaderChunk.default_vertex,K.ShaderChunk.logdepthbuf_vertex,K.ShaderChunk.worldpos_vertex,K.ShaderChunk.envmap_vertex,K.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;",K.ShaderChunk.common,K.ShaderChunk.color_pars_fragment,K.ShaderChunk.map_pars_fragment,K.ShaderChunk.alphamap_pars_fragment,K.ShaderChunk.lightmap_pars_fragment,K.ShaderChunk.envmap_pars_fragment,K.ShaderChunk.fog_pars_fragment,K.ShaderChunk.shadowmap_pars_fragment,K.ShaderChunk.specularmap_pars_fragment,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",K.ShaderChunk.logdepthbuf_fragment,K.ShaderChunk.map_fragment,K.ShaderChunk.color_fragment,K.ShaderChunk.alphamap_fragment,K.ShaderChunk.alphatest_fragment,K.ShaderChunk.specularmap_fragment,"\toutgoingLight = diffuseColor.rgb;",K.ShaderChunk.lightmap_fragment,K.ShaderChunk.envmap_fragment,K.ShaderChunk.shadowmap_fragment,K.ShaderChunk.linear_to_gamma_fragment,K.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},lambert:{uniforms:K.UniformsUtils.merge([K.UniformsLib.common,K.UniformsLib.fog,K.UniformsLib.lights,K.UniformsLib.shadowmap,{emissive:{type:"c",value:new K.Color(0)},wrapRGB:{type:"v3",value:new K.Vector3(1,1,1)}}]),vertexShader:["#define LAMBERT","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","\tvarying vec3 vLightBack;","#endif",K.ShaderChunk.common,K.ShaderChunk.map_pars_vertex,K.ShaderChunk.lightmap_pars_vertex,K.ShaderChunk.envmap_pars_vertex,K.ShaderChunk.lights_lambert_pars_vertex,K.ShaderChunk.color_pars_vertex,K.ShaderChunk.morphtarget_pars_vertex,K.ShaderChunk.skinning_pars_vertex,K.ShaderChunk.shadowmap_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",K.ShaderChunk.map_vertex,K.ShaderChunk.lightmap_vertex,K.ShaderChunk.color_vertex,K.ShaderChunk.morphnormal_vertex,K.ShaderChunk.skinbase_vertex,K.ShaderChunk.skinnormal_vertex,K.ShaderChunk.defaultnormal_vertex,K.ShaderChunk.morphtarget_vertex,K.ShaderChunk.skinning_vertex,K.ShaderChunk.default_vertex,K.ShaderChunk.logdepthbuf_vertex,K.ShaderChunk.worldpos_vertex,K.ShaderChunk.envmap_vertex,K.ShaderChunk.lights_lambert_vertex,K.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform vec3 emissive;","uniform float opacity;","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED","\tvarying vec3 vLightBack;","#endif",K.ShaderChunk.common,K.ShaderChunk.color_pars_fragment,K.ShaderChunk.map_pars_fragment,K.ShaderChunk.alphamap_pars_fragment,K.ShaderChunk.lightmap_pars_fragment,K.ShaderChunk.envmap_pars_fragment,K.ShaderChunk.fog_pars_fragment,K.ShaderChunk.shadowmap_pars_fragment,K.ShaderChunk.specularmap_pars_fragment,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",K.ShaderChunk.logdepthbuf_fragment,K.ShaderChunk.map_fragment,K.ShaderChunk.color_fragment,K.ShaderChunk.alphamap_fragment,K.ShaderChunk.alphatest_fragment,K.ShaderChunk.specularmap_fragment,"\t#ifdef DOUBLE_SIDED","\t\tif ( gl_FrontFacing )","\t\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;","\t\telse","\t\t\toutgoingLight += diffuseColor.rgb * vLightBack + emissive;","\t#else","\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;","\t#endif",K.ShaderChunk.lightmap_fragment,K.ShaderChunk.envmap_fragment,K.ShaderChunk.shadowmap_fragment,K.ShaderChunk.linear_to_gamma_fragment,K.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},phong:{uniforms:K.UniformsUtils.merge([K.UniformsLib.common,K.UniformsLib.bump,K.UniformsLib.normalmap,K.UniformsLib.fog,K.UniformsLib.lights,K.UniformsLib.shadowmap,{emissive:{type:"c",value:new K.Color(0)},specular:{type:"c",value:new K.Color(1118481)},shininess:{type:"f",value:30},wrapRGB:{type:"v3",value:new K.Vector3(1,1,1)}}]),vertexShader:["#define PHONG","varying vec3 vViewPosition;","#ifndef FLAT_SHADED","\tvarying vec3 vNormal;","#endif",K.ShaderChunk.common,K.ShaderChunk.map_pars_vertex,K.ShaderChunk.lightmap_pars_vertex,K.ShaderChunk.envmap_pars_vertex,K.ShaderChunk.lights_phong_pars_vertex,K.ShaderChunk.color_pars_vertex,K.ShaderChunk.morphtarget_pars_vertex,K.ShaderChunk.skinning_pars_vertex,K.ShaderChunk.shadowmap_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",K.ShaderChunk.map_vertex,K.ShaderChunk.lightmap_vertex,K.ShaderChunk.color_vertex,K.ShaderChunk.morphnormal_vertex,K.ShaderChunk.skinbase_vertex,K.ShaderChunk.skinnormal_vertex,K.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED","\tvNormal = normalize( transformedNormal );","#endif",K.ShaderChunk.morphtarget_vertex,K.ShaderChunk.skinning_vertex,K.ShaderChunk.default_vertex,K.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = -mvPosition.xyz;",K.ShaderChunk.worldpos_vertex,K.ShaderChunk.envmap_vertex,K.ShaderChunk.lights_phong_vertex,K.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define PHONG","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;","uniform float opacity;",K.ShaderChunk.common,K.ShaderChunk.color_pars_fragment,K.ShaderChunk.map_pars_fragment,K.ShaderChunk.alphamap_pars_fragment,K.ShaderChunk.lightmap_pars_fragment,K.ShaderChunk.envmap_pars_fragment,K.ShaderChunk.fog_pars_fragment,K.ShaderChunk.lights_phong_pars_fragment,K.ShaderChunk.shadowmap_pars_fragment,K.ShaderChunk.bumpmap_pars_fragment,K.ShaderChunk.normalmap_pars_fragment,K.ShaderChunk.specularmap_pars_fragment,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",K.ShaderChunk.logdepthbuf_fragment,K.ShaderChunk.map_fragment,K.ShaderChunk.color_fragment,K.ShaderChunk.alphamap_fragment,K.ShaderChunk.alphatest_fragment,K.ShaderChunk.specularmap_fragment,K.ShaderChunk.lights_phong_fragment,K.ShaderChunk.lightmap_fragment,K.ShaderChunk.envmap_fragment,K.ShaderChunk.shadowmap_fragment,K.ShaderChunk.linear_to_gamma_fragment,K.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},particle_basic:{uniforms:K.UniformsUtils.merge([K.UniformsLib.particle,K.UniformsLib.shadowmap]),vertexShader:["uniform float size;","uniform float scale;",K.ShaderChunk.common,K.ShaderChunk.color_pars_vertex,K.ShaderChunk.shadowmap_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",K.ShaderChunk.color_vertex,"\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\t#ifdef USE_SIZEATTENUATION","\t\tgl_PointSize = size * ( scale / length( mvPosition.xyz ) );","\t#else","\t\tgl_PointSize = size;","\t#endif","\tgl_Position = projectionMatrix * mvPosition;",K.ShaderChunk.logdepthbuf_vertex,K.ShaderChunk.worldpos_vertex,K.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;","uniform float opacity;",K.ShaderChunk.common,K.ShaderChunk.color_pars_fragment,K.ShaderChunk.map_particle_pars_fragment,K.ShaderChunk.fog_pars_fragment,K.ShaderChunk.shadowmap_pars_fragment,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( psColor, opacity );",K.ShaderChunk.logdepthbuf_fragment,K.ShaderChunk.map_particle_fragment,K.ShaderChunk.color_fragment,K.ShaderChunk.alphatest_fragment,"\toutgoingLight = diffuseColor.rgb;",K.ShaderChunk.shadowmap_fragment,K.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},dashed:{uniforms:K.UniformsUtils.merge([K.UniformsLib.common,K.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;","attribute float lineDistance;","varying float vLineDistance;",K.ShaderChunk.common,K.ShaderChunk.color_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",K.ShaderChunk.color_vertex,"\tvLineDistance = scale * lineDistance;","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * mvPosition;",K.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform float dashSize;","uniform float totalSize;","varying float vLineDistance;",K.ShaderChunk.common,K.ShaderChunk.color_pars_fragment,K.ShaderChunk.fog_pars_fragment,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tif ( mod( vLineDistance, totalSize ) > dashSize ) {","\t\tdiscard;","\t}","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",K.ShaderChunk.logdepthbuf_fragment,K.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",K.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[K.ShaderChunk.common,K.ShaderChunk.morphtarget_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",K.ShaderChunk.morphtarget_vertex,K.ShaderChunk.default_vertex,K.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;",K.ShaderChunk.common,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",K.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;","\t#else","\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;","\t#endif","\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );","\tgl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",K.ShaderChunk.common,K.ShaderChunk.morphtarget_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvNormal = normalize( normalMatrix * normal );",K.ShaderChunk.morphtarget_vertex,K.ShaderChunk.default_vertex,K.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;",K.ShaderChunk.common,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",K.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",K.ShaderChunk.common,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",K.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;",K.ShaderChunk.common,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",K.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",K.ShaderChunk.common,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",K.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","uniform float tFlip;","varying vec3 vWorldPosition;",K.ShaderChunk.common,K.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","vec3 direction = normalize( vWorldPosition );","vec2 sampleUV;","sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );","sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","gl_FragColor = texture2D( tEquirect, sampleUV );",K.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[K.ShaderChunk.common,K.ShaderChunk.morphtarget_pars_vertex,K.ShaderChunk.skinning_pars_vertex,K.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",K.ShaderChunk.skinbase_vertex,K.ShaderChunk.morphtarget_vertex,K.ShaderChunk.skinning_vertex,K.ShaderChunk.default_vertex,K.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[K.ShaderChunk.common,K.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {","\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );","\tres -= res.xxyz * bit_mask;","\treturn res;","}","void main() {",K.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );","\t#else","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );","\t#endif","}"].join("\n")}},K.WebGLRenderer=function(e){console.log("THREE.WebGLRenderer",K.REVISION);var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElement("canvas"),i=void 0!==e.context?e.context:null,n=1,r=void 0!==e.precision?e.precision:"highp",o=void 0!==e.alpha&&e.alpha,s=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,l=void 0!==e.antialias&&e.antialias,c=void 0===e.premultipliedAlpha||e.premultipliedAlpha,h=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,u=void 0!==e.logarithmicDepthBuffer&&e.logarithmicDepthBuffer,d=new K.Color(0),p=0,f=[],m={},g=[],v=[],y=[],b=[],x=[];this.domElement=t,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.shadowMapEnabled=!1,this.shadowMapType=K.PCFShadowMap,this.shadowMapCullFace=K.CullFaceFront,this.shadowMapDebug=!1,this.shadowMapCascade=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var _,E=this,A=[],S=null,w=null,M=-1,T="",C=null,P=0,D=0,L=0,I=t.width,R=t.height,O=0,N=0,k=new K.Frustum,F=new K.Matrix4,V=new K.Vector3,U=new K.Vector3,B=!0,z={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var G={alpha:o,depth:s,stencil:a,antialias:l,premultipliedAlpha:c,preserveDrawingBuffer:h};if(null===(_=i||t.getContext("webgl",G)||t.getContext("experimental-webgl",G)))throw null!==t.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";t.addEventListener("webglcontextlost",(function(e){e.preventDefault(),q(),X(),m={}}),!1)}catch(e){K.error("THREE.WebGLRenderer: "+e)}var H=new K.WebGLState(_,st);void 0===_.getShaderPrecisionFormat&&(_.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var W=new K.WebGLExtensions(_);W.get("OES_texture_float"),W.get("OES_texture_float_linear"),W.get("OES_texture_half_float"),W.get("OES_texture_half_float_linear"),W.get("OES_standard_derivatives"),u&&W.get("EXT_frag_depth");var j=function(e,t,i,n){!0===c&&(e*=n,t*=n,i*=n),_.clearColor(e,t,i,n)},X=function(){_.clearColor(0,0,0,1),_.clearDepth(1),_.clearStencil(0),_.enable(_.DEPTH_TEST),_.depthFunc(_.LEQUAL),_.frontFace(_.CCW),_.cullFace(_.BACK),_.enable(_.CULL_FACE),_.enable(_.BLEND),_.blendEquation(_.FUNC_ADD),_.blendFunc(_.SRC_ALPHA,_.ONE_MINUS_SRC_ALPHA),_.viewport(D,L,I,R),j(d.r,d.g,d.b,p)},q=function(){S=null,C=null,T="",M=-1,B=!0,H.reset()};X(),this.context=_,this.state=H;var Y,Z=_.getParameter(_.MAX_TEXTURE_IMAGE_UNITS),Q=_.getParameter(_.MAX_VERTEX_TEXTURE_IMAGE_UNITS),J=_.getParameter(_.MAX_TEXTURE_SIZE),$=_.getParameter(_.MAX_CUBE_MAP_TEXTURE_SIZE),ee=Q>0,te=ee&&W.get("OES_texture_float"),ie=_.getShaderPrecisionFormat(_.VERTEX_SHADER,_.HIGH_FLOAT),ne=_.getShaderPrecisionFormat(_.VERTEX_SHADER,_.MEDIUM_FLOAT),re=_.getShaderPrecisionFormat(_.FRAGMENT_SHADER,_.HIGH_FLOAT),oe=_.getShaderPrecisionFormat(_.FRAGMENT_SHADER,_.MEDIUM_FLOAT),se=function(){if(void 0!==Y)return Y;if(Y=[],W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var e=_.getParameter(_.COMPRESSED_TEXTURE_FORMATS),t=0;t<e.length;t++)Y.push(e[t]);return Y},ae=ie.precision>0&&re.precision>0,le=ne.precision>0&&oe.precision>0;"highp"!==r||ae||(le?(r="mediump",K.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(r="lowp",K.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp."))),"mediump"!==r||le||(r="lowp",K.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var ce,he=new K.ShadowMapPlugin(this,f,m,g),ue=new K.SpritePlugin(this,b),de=new K.LensFlarePlugin(this,x);function pe(e){e.__webglVertexBuffer=_.createBuffer(),e.__webglNormalBuffer=_.createBuffer(),e.__webglTangentBuffer=_.createBuffer(),e.__webglColorBuffer=_.createBuffer(),e.__webglUVBuffer=_.createBuffer(),e.__webglUV2Buffer=_.createBuffer(),e.__webglSkinIndicesBuffer=_.createBuffer(),e.__webglSkinWeightsBuffer=_.createBuffer(),e.__webglFaceBuffer=_.createBuffer(),e.__webglLineBuffer=_.createBuffer();var t=e.numMorphTargets;if(t){e.__webglMorphTargetsBuffers=[];for(var i=0,n=t;i<n;i++)e.__webglMorphTargetsBuffers.push(_.createBuffer())}var r=e.numMorphNormals;if(r){e.__webglMorphNormalsBuffers=[];for(i=0,n=r;i<n;i++)e.__webglMorphNormalsBuffers.push(_.createBuffer())}E.info.memory.geometries++}this.getContext=function(){return _},this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()},this.supportsVertexTextures=function(){return ee},this.supportsFloatTextures=function(){return W.get("OES_texture_float")},this.supportsHalfFloatTextures=function(){return W.get("OES_texture_half_float")},this.supportsStandardDerivatives=function(){return W.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return W.get("WEBGL_compressed_texture_s3tc")},this.supportsCompressedTexturePVRTC=function(){return W.get("WEBGL_compressed_texture_pvrtc")},this.supportsBlendMinMax=function(){return W.get("EXT_blend_minmax")},this.getMaxAnisotropy=function(){if(void 0!==ce)return ce;var e=W.get("EXT_texture_filter_anisotropic");return ce=null!==e?_.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},this.getPrecision=function(){return r},this.getPixelRatio=function(){return n},this.setPixelRatio=function(e){n=e},this.setSize=function(e,i,r){t.width=e*n,t.height=i*n,!1!==r&&(t.style.width=e+"px",t.style.height=i+"px"),this.setViewport(0,0,e,i)},this.setViewport=function(e,t,i,r){D=e*n,L=t*n,I=i*n,R=r*n,_.viewport(D,L,I,R)},this.setScissor=function(e,t,i,r){_.scissor(e*n,t*n,i*n,r*n)},this.enableScissorTest=function(e){e?_.enable(_.SCISSOR_TEST):_.disable(_.SCISSOR_TEST)},this.getClearColor=function(){return d},this.setClearColor=function(e,t){d.set(e),p=void 0!==t?t:1,j(d.r,d.g,d.b,p)},this.getClearAlpha=function(){return p},this.setClearAlpha=function(e){p=e,j(d.r,d.g,d.b,p)},this.clear=function(e,t,i){var n=0;(void 0===e||e)&&(n|=_.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=_.DEPTH_BUFFER_BIT),(void 0===i||i)&&(n|=_.STENCIL_BUFFER_BIT),_.clear(n)},this.clearColor=function(){_.clear(_.COLOR_BUFFER_BIT)},this.clearDepth=function(){_.clear(_.DEPTH_BUFFER_BIT)},this.clearStencil=function(){_.clear(_.STENCIL_BUFFER_BIT)},this.clearTarget=function(e,t,i,n){this.setRenderTarget(e),this.clear(t,i,n)},this.resetGLState=q;var fe=function(e){e.target.traverse((function(e){e.removeEventListener("remove",fe),function(e){e instanceof K.Mesh||e instanceof K.PointCloud||e instanceof K.Line?delete m[e.id]:(e instanceof K.ImmediateRenderObject||e.immediateRenderCallback)&&function(e,t){for(var i=e.length-1;i>=0;i--)e[i].object===t&&e.splice(i,1)}(g,e);delete e.__webglInit,delete e._modelViewMatrix,delete e._normalMatrix,delete e.__webglActive}(e)}))},me=function(e){var t=e.target;t.removeEventListener("dispose",me),xe(t)},ge=function(e){var t=e.target;t.removeEventListener("dispose",ge),_e(t),E.info.memory.textures--},ve=function(e){var t=e.target;t.removeEventListener("dispose",ve),Ee(t),E.info.memory.textures--},ye=function(e){var t=e.target;t.removeEventListener("dispose",ye),Ae(t)},be=function(e){for(var t=["__webglVertexBuffer","__webglNormalBuffer","__webglTangentBuffer","__webglColorBuffer","__webglUVBuffer","__webglUV2Buffer","__webglSkinIndicesBuffer","__webglSkinWeightsBuffer","__webglFaceBuffer","__webglLineBuffer","__webglLineDistanceBuffer"],i=0,n=t.length;i<n;i++){void 0!==e[r=t[i]]&&(_.deleteBuffer(e[r]),delete e[r])}if(void 0!==e.__webglCustomAttributesList){for(var r in e.__webglCustomAttributesList)_.deleteBuffer(e.__webglCustomAttributesList[r].buffer);delete e.__webglCustomAttributesList}E.info.memory.geometries--},xe=function(e){if(delete e.__webglInit,e instanceof K.BufferGeometry){for(var t in e.attributes){var i=e.attributes[t];void 0!==i.buffer&&(_.deleteBuffer(i.buffer),delete i.buffer)}E.info.memory.geometries--}else{var n=Fe[e.id];if(void 0!==n){for(var r=0,o=n.length;r<o;r++){var s=n[r];if(void 0!==s.numMorphTargets){for(var a=0,l=s.numMorphTargets;a<l;a++)_.deleteBuffer(s.__webglMorphTargetsBuffers[a]);delete s.__webglMorphTargetsBuffers}if(void 0!==s.numMorphNormals){for(a=0,l=s.numMorphNormals;a<l;a++)_.deleteBuffer(s.__webglMorphNormalsBuffers[a]);delete s.__webglMorphNormalsBuffers}be(s)}delete Fe[e.id]}else be(e)}T=""},_e=function(e){if(e.image&&e.image.__webglTextureCube)_.deleteTexture(e.image.__webglTextureCube),delete e.image.__webglTextureCube;else{if(void 0===e.__webglInit)return;_.deleteTexture(e.__webglTexture),delete e.__webglTexture,delete e.__webglInit}},Ee=function(e){if(e&&void 0!==e.__webglTexture){if(_.deleteTexture(e.__webglTexture),delete e.__webglTexture,e instanceof K.WebGLRenderTargetCube)for(var t=0;t<6;t++)_.deleteFramebuffer(e.__webglFramebuffer[t]),_.deleteRenderbuffer(e.__webglRenderbuffer[t]);else _.deleteFramebuffer(e.__webglFramebuffer),_.deleteRenderbuffer(e.__webglRenderbuffer);delete e.__webglFramebuffer,delete e.__webglRenderbuffer}},Ae=function(e){var t=e.program.program;if(void 0!==t){var i,n,r;e.program=void 0;var o=!1;for(i=0,n=A.length;i<n;i++)if((r=A[i]).program===t){r.usedTimes--,0===r.usedTimes&&(o=!0);break}if(!0===o){var s=[];for(i=0,n=A.length;i<n;i++)(r=A[i]).program!==t&&s.push(r);A=s,_.deleteProgram(t),E.info.memory.programs--}}};function Se(e){var t=e.geometry,i=e.material,n=t.vertices.length;if(i.attributes)for(var r in void 0===t.__webglCustomAttributesList&&(t.__webglCustomAttributesList=[]),i.attributes){var o=i.attributes[r];if(!o.__webglInitialized||o.createUniqueBuffers){o.__webglInitialized=!0;var s=1;"v2"===o.type?s=2:"v3"===o.type?s=3:"v4"===o.type?s=4:"c"===o.type&&(s=3),o.size=s,o.array=new Float32Array(n*s),o.buffer=_.createBuffer(),o.buffer.belongsToAttribute=r,o.needsUpdate=!0}t.__webglCustomAttributesList.push(o)}}function we(e,t){var i=t.geometry,n=e.faces3,r=3*n.length,o=1*n.length,s=3*n.length,a=Me(t,e);e.__vertexArray=new Float32Array(3*r),e.__normalArray=new Float32Array(3*r),e.__colorArray=new Float32Array(3*r),e.__uvArray=new Float32Array(2*r),i.faceVertexUvs.length>1&&(e.__uv2Array=new Float32Array(2*r)),i.hasTangents&&(e.__tangentArray=new Float32Array(4*r)),t.geometry.skinWeights.length&&t.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*r),e.__skinWeightArray=new Float32Array(4*r));var l=null!==W.get("OES_element_index_uint")&&o>21845?Uint32Array:Uint16Array;e.__typeArray=l,e.__faceArray=new l(3*o),e.__lineArray=new l(2*s);var c=e.numMorphTargets;if(c){e.__morphTargetsArrays=[];for(var h=0,u=c;h<u;h++)e.__morphTargetsArrays.push(new Float32Array(3*r))}var d=e.numMorphNormals;if(d){e.__morphNormalsArrays=[];for(h=0,u=d;h<u;h++)e.__morphNormalsArrays.push(new Float32Array(3*r))}if(e.__webglFaceCount=3*o,e.__webglLineCount=2*s,a.attributes)for(var p in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),a.attributes){var f=a.attributes[p],m={};for(var g in f)m[g]=f[g];if(!m.__webglInitialized||m.createUniqueBuffers){m.__webglInitialized=!0;var v=1;"v2"===m.type?v=2:"v3"===m.type?v=3:"v4"===m.type?v=4:"c"===m.type&&(v=3),m.size=v,m.array=new Float32Array(r*v),m.buffer=_.createBuffer(),m.buffer.belongsToAttribute=p,f.needsUpdate=!0,m.__original=f}e.__webglCustomAttributesList.push(m)}e.__inittedArrays=!0}function Me(e,t){return e.material instanceof K.MeshFaceMaterial?e.material.materials[t.materialIndex]:e.material}function Te(e,t,i,n,r){if(e.__inittedArrays){var o,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,E,A,S,w,M,T,C,P,D,L,I,R,O,N,k,F,V,U,B,z,G,H,W,j,X,q=function(e){return e instanceof K.MeshPhongMaterial==0&&e.shading===K.FlatShading}(r),Y=0,Z=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,ne=0,re=0,oe=0,se=0,ae=e.__vertexArray,le=e.__uvArray,ce=e.__uv2Array,he=e.__normalArray,ue=e.__tangentArray,de=e.__colorArray,pe=e.__skinIndexArray,fe=e.__skinWeightArray,me=e.__morphTargetsArrays,ge=e.__morphNormalsArrays,ve=e.__webglCustomAttributesList,ye=e.__faceArray,be=e.__lineArray,xe=t.geometry,_e=xe.verticesNeedUpdate,Ee=xe.elementsNeedUpdate,Ae=xe.uvsNeedUpdate,Se=xe.normalsNeedUpdate,we=xe.tangentsNeedUpdate,Me=xe.colorsNeedUpdate,Te=xe.morphTargetsNeedUpdate,Ce=xe.vertices,Pe=e.faces3,De=xe.faces,Le=xe.faceVertexUvs[0],Ie=xe.faceVertexUvs[1],Re=xe.skinIndices,Oe=xe.skinWeights,Ne=xe.morphTargets,ke=xe.morphNormals;if(_e){for(o=0,s=Pe.length;o<s;o++)m=Ce[(a=De[Pe[o]]).a],g=Ce[a.b],v=Ce[a.c],ae[Z]=m.x,ae[Z+1]=m.y,ae[Z+2]=m.z,ae[Z+3]=g.x,ae[Z+4]=g.y,ae[Z+5]=g.z,ae[Z+6]=v.x,ae[Z+7]=v.y,ae[Z+8]=v.z,Z+=9;_.bindBuffer(_.ARRAY_BUFFER,e.__webglVertexBuffer),_.bufferData(_.ARRAY_BUFFER,ae,i)}if(Te)for(U=0,B=Ne.length;U<B;U++){for(oe=0,o=0,s=Pe.length;o<s;o++)a=De[H=Pe[o]],m=Ne[U].vertices[a.a],g=Ne[U].vertices[a.b],v=Ne[U].vertices[a.c],(z=me[U])[oe]=m.x,z[oe+1]=m.y,z[oe+2]=m.z,z[oe+3]=g.x,z[oe+4]=g.y,z[oe+5]=g.z,z[oe+6]=v.x,z[oe+7]=v.y,z[oe+8]=v.z,r.morphNormals&&(q?(A=E=ke[U].faceNormals[H],S=E):(E=(W=ke[U].vertexNormals[H]).a,A=W.b,S=W.c),(G=ge[U])[oe]=E.x,G[oe+1]=E.y,G[oe+2]=E.z,G[oe+3]=A.x,G[oe+4]=A.y,G[oe+5]=A.z,G[oe+6]=S.x,G[oe+7]=S.y,G[oe+8]=S.z),oe+=9;_.bindBuffer(_.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[U]),_.bufferData(_.ARRAY_BUFFER,me[U],i),r.morphNormals&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[U]),_.bufferData(_.ARRAY_BUFFER,ge[U],i))}if(Oe.length){for(o=0,s=Pe.length;o<s;o++)C=Oe[(a=De[Pe[o]]).a],P=Oe[a.b],D=Oe[a.c],fe[re]=C.x,fe[re+1]=C.y,fe[re+2]=C.z,fe[re+3]=C.w,fe[re+4]=P.x,fe[re+5]=P.y,fe[re+6]=P.z,fe[re+7]=P.w,fe[re+8]=D.x,fe[re+9]=D.y,fe[re+10]=D.z,fe[re+11]=D.w,L=Re[a.a],I=Re[a.b],R=Re[a.c],pe[re]=L.x,pe[re+1]=L.y,pe[re+2]=L.z,pe[re+3]=L.w,pe[re+4]=I.x,pe[re+5]=I.y,pe[re+6]=I.z,pe[re+7]=I.w,pe[re+8]=R.x,pe[re+9]=R.y,pe[re+10]=R.z,pe[re+11]=R.w,re+=12;re>0&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),_.bufferData(_.ARRAY_BUFFER,pe,i),_.bindBuffer(_.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),_.bufferData(_.ARRAY_BUFFER,fe,i))}if(Me){for(o=0,s=Pe.length;o<s;o++)h=(a=De[Pe[o]]).vertexColors,u=a.color,3===h.length&&r.vertexColors===K.VertexColors?(w=h[0],M=h[1],T=h[2]):(w=u,M=u,T=u),de[ne]=w.r,de[ne+1]=w.g,de[ne+2]=w.b,de[ne+3]=M.r,de[ne+4]=M.g,de[ne+5]=M.b,de[ne+6]=T.r,de[ne+7]=T.g,de[ne+8]=T.b,ne+=9;ne>0&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglColorBuffer),_.bufferData(_.ARRAY_BUFFER,de,i))}if(we&&xe.hasTangents){for(o=0,s=Pe.length;o<s;o++)y=(d=(a=De[Pe[o]]).vertexTangents)[0],b=d[1],x=d[2],ue[te]=y.x,ue[te+1]=y.y,ue[te+2]=y.z,ue[te+3]=y.w,ue[te+4]=b.x,ue[te+5]=b.y,ue[te+6]=b.z,ue[te+7]=b.w,ue[te+8]=x.x,ue[te+9]=x.y,ue[te+10]=x.z,ue[te+11]=x.w,te+=12;_.bindBuffer(_.ARRAY_BUFFER,e.__webglTangentBuffer),_.bufferData(_.ARRAY_BUFFER,ue,i)}if(Se){for(o=0,s=Pe.length;o<s;o++)if(l=(a=De[Pe[o]]).vertexNormals,c=a.normal,3===l.length&&!1===q)for(O=0;O<3;O++)k=l[O],he[ee]=k.x,he[ee+1]=k.y,he[ee+2]=k.z,ee+=3;else for(O=0;O<3;O++)he[ee]=c.x,he[ee+1]=c.y,he[ee+2]=c.z,ee+=3;_.bindBuffer(_.ARRAY_BUFFER,e.__webglNormalBuffer),_.bufferData(_.ARRAY_BUFFER,he,i)}if(Ae&&Le){for(o=0,s=Pe.length;o<s;o++)if(void 0!==(p=Le[Pe[o]]))for(O=0;O<3;O++)F=p[O],le[Q]=F.x,le[Q+1]=F.y,Q+=2;Q>0&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglUVBuffer),_.bufferData(_.ARRAY_BUFFER,le,i))}if(Ae&&Ie){for(o=0,s=Pe.length;o<s;o++)if(void 0!==(f=Ie[Pe[o]]))for(O=0;O<3;O++)V=f[O],ce[J]=V.x,ce[J+1]=V.y,J+=2;J>0&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglUV2Buffer),_.bufferData(_.ARRAY_BUFFER,ce,i))}if(Ee){for(o=0,s=Pe.length;o<s;o++)ye[$]=Y,ye[$+1]=Y+1,ye[$+2]=Y+2,$+=3,be[ie]=Y,be[ie+1]=Y+1,be[ie+2]=Y,be[ie+3]=Y+2,be[ie+4]=Y+1,be[ie+5]=Y+2,ie+=6,Y+=3;_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),_.bufferData(_.ELEMENT_ARRAY_BUFFER,ye,i),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),_.bufferData(_.ELEMENT_ARRAY_BUFFER,be,i)}if(ve)for(O=0,N=ve.length;O<N;O++)if((X=ve[O]).__original.needsUpdate){if(se=0,1===X.size){if(void 0===X.boundTo||"vertices"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)a=De[Pe[o]],X.array[se]=X.value[a.a],X.array[se+1]=X.value[a.b],X.array[se+2]=X.value[a.c],se+=3;else if("faces"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)j=X.value[Pe[o]],X.array[se]=j,X.array[se+1]=j,X.array[se+2]=j,se+=3}else if(2===X.size){if(void 0===X.boundTo||"vertices"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)a=De[Pe[o]],m=X.value[a.a],g=X.value[a.b],v=X.value[a.c],X.array[se]=m.x,X.array[se+1]=m.y,X.array[se+2]=g.x,X.array[se+3]=g.y,X.array[se+4]=v.x,X.array[se+5]=v.y,se+=6;else if("faces"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)m=j=X.value[Pe[o]],g=j,v=j,X.array[se]=m.x,X.array[se+1]=m.y,X.array[se+2]=g.x,X.array[se+3]=g.y,X.array[se+4]=v.x,X.array[se+5]=v.y,se+=6}else if(3===X.size){var Fe;if(Fe="c"===X.type?["r","g","b"]:["x","y","z"],void 0===X.boundTo||"vertices"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)a=De[Pe[o]],m=X.value[a.a],g=X.value[a.b],v=X.value[a.c],X.array[se]=m[Fe[0]],X.array[se+1]=m[Fe[1]],X.array[se+2]=m[Fe[2]],X.array[se+3]=g[Fe[0]],X.array[se+4]=g[Fe[1]],X.array[se+5]=g[Fe[2]],X.array[se+6]=v[Fe[0]],X.array[se+7]=v[Fe[1]],X.array[se+8]=v[Fe[2]],se+=9;else if("faces"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)m=j=X.value[Pe[o]],g=j,v=j,X.array[se]=m[Fe[0]],X.array[se+1]=m[Fe[1]],X.array[se+2]=m[Fe[2]],X.array[se+3]=g[Fe[0]],X.array[se+4]=g[Fe[1]],X.array[se+5]=g[Fe[2]],X.array[se+6]=v[Fe[0]],X.array[se+7]=v[Fe[1]],X.array[se+8]=v[Fe[2]],se+=9;else if("faceVertices"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)m=(j=X.value[Pe[o]])[0],g=j[1],v=j[2],X.array[se]=m[Fe[0]],X.array[se+1]=m[Fe[1]],X.array[se+2]=m[Fe[2]],X.array[se+3]=g[Fe[0]],X.array[se+4]=g[Fe[1]],X.array[se+5]=g[Fe[2]],X.array[se+6]=v[Fe[0]],X.array[se+7]=v[Fe[1]],X.array[se+8]=v[Fe[2]],se+=9}else if(4===X.size)if(void 0===X.boundTo||"vertices"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)a=De[Pe[o]],m=X.value[a.a],g=X.value[a.b],v=X.value[a.c],X.array[se]=m.x,X.array[se+1]=m.y,X.array[se+2]=m.z,X.array[se+3]=m.w,X.array[se+4]=g.x,X.array[se+5]=g.y,X.array[se+6]=g.z,X.array[se+7]=g.w,X.array[se+8]=v.x,X.array[se+9]=v.y,X.array[se+10]=v.z,X.array[se+11]=v.w,se+=12;else if("faces"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)m=j=X.value[Pe[o]],g=j,v=j,X.array[se]=m.x,X.array[se+1]=m.y,X.array[se+2]=m.z,X.array[se+3]=m.w,X.array[se+4]=g.x,X.array[se+5]=g.y,X.array[se+6]=g.z,X.array[se+7]=g.w,X.array[se+8]=v.x,X.array[se+9]=v.y,X.array[se+10]=v.z,X.array[se+11]=v.w,se+=12;else if("faceVertices"===X.boundTo)for(o=0,s=Pe.length;o<s;o++)m=(j=X.value[Pe[o]])[0],g=j[1],v=j[2],X.array[se]=m.x,X.array[se+1]=m.y,X.array[se+2]=m.z,X.array[se+3]=m.w,X.array[se+4]=g.x,X.array[se+5]=g.y,X.array[se+6]=g.z,X.array[se+7]=g.w,X.array[se+8]=v.x,X.array[se+9]=v.y,X.array[se+10]=v.z,X.array[se+11]=v.w,se+=12;_.bindBuffer(_.ARRAY_BUFFER,X.buffer),_.bufferData(_.ARRAY_BUFFER,X.array,i)}n&&(delete e.__inittedArrays,delete e.__colorArray,delete e.__normalArray,delete e.__tangentArray,delete e.__uvArray,delete e.__uv2Array,delete e.__faceArray,delete e.__vertexArray,delete e.__lineArray,delete e.__skinIndexArray,delete e.__skinWeightArray)}}function Ce(e,t,i,n){for(var r=i.attributes,o=t.attributes,s=t.attributesKeys,a=0,l=s.length;a<l;a++){var c=s[a],h=o[c];if(h>=0){var u=r[c];if(void 0!==u){var d=u.itemSize;_.bindBuffer(_.ARRAY_BUFFER,u.buffer),H.enableAttribute(h),_.vertexAttribPointer(h,d,_.FLOAT,!1,0,n*d*4)}else void 0!==e.defaultAttributeValues&&(2===e.defaultAttributeValues[c].length?_.vertexAttrib2fv(h,e.defaultAttributeValues[c]):3===e.defaultAttributeValues[c].length&&_.vertexAttrib3fv(h,e.defaultAttributeValues[c]))}}H.disableUnusedAttributes()}function Pe(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function De(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Le(e,t){return t[0]-e[0]}function Ie(e){if(!1!==e.visible){if(e instanceof K.Scene||e instanceof K.Group);else if(function(e){void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new K.Matrix4,e._normalMatrix=new K.Matrix3,e.addEventListener("removed",fe));var t=e.geometry;void 0===t||void 0===t.__webglInit&&(t.__webglInit=!0,t.addEventListener("dispose",me),t instanceof K.BufferGeometry?E.info.memory.geometries++:e instanceof K.Mesh?Ue(e,t):e instanceof K.Line?void 0===t.__webglVertexBuffer&&(!function(e){e.__webglVertexBuffer=_.createBuffer(),e.__webglColorBuffer=_.createBuffer(),e.__webglLineDistanceBuffer=_.createBuffer(),E.info.memory.geometries++}(t),function(e,t){var i=e.vertices.length;e.__vertexArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__lineDistanceArray=new Float32Array(1*i),e.__webglLineCount=i,Se(t)}(t,e),t.verticesNeedUpdate=!0,t.colorsNeedUpdate=!0,t.lineDistancesNeedUpdate=!0):e instanceof K.PointCloud&&void 0===t.__webglVertexBuffer&&(!function(e){e.__webglVertexBuffer=_.createBuffer(),e.__webglColorBuffer=_.createBuffer(),E.info.memory.geometries++}(t),function(e,t){var i=e.vertices.length;e.__vertexArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__webglParticleCount=i,Se(t)}(t,e),t.verticesNeedUpdate=!0,t.colorsNeedUpdate=!0));if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof K.Mesh){if(t instanceof K.BufferGeometry)Be(m,t,e);else if(t instanceof K.Geometry)for(var i=Fe[t.id],n=0,r=i.length;n<r;n++)Be(m,i[n],e)}else e instanceof K.Line||e instanceof K.PointCloud?Be(m,t,e):(e instanceof K.ImmediateRenderObject||e.immediateRenderCallback)&&function(e,t){e.push({id:null,object:t,opaque:null,transparent:null,z:0})}(g,e)}(e),e instanceof K.Light)f.push(e);else if(e instanceof K.Sprite)b.push(e);else if(e instanceof K.LensFlare)x.push(e);else{var t=m[e.id];if(t&&(!1===e.frustumCulled||!0===k.intersectsObject(e)))for(var i=0,n=t.length;i<n;i++){var r=t[i];ke(r),r.render=!0,!0===E.sortObjects&&(V.setFromMatrixPosition(e.matrixWorld),V.applyProjection(F),r.z=V.z)}}for(i=0,n=e.children.length;i<n;i++)Ie(e.children[i])}}function Re(e,t,i,n,r){for(var o,s=0,a=e.length;s<a;s++){var l=e[s],c=l.object,h=l.buffer;if(Qe(c,t),r)o=r;else{if(!(o=l.material))continue;Xe(o)}E.setMaterialFaces(o),h instanceof K.BufferGeometry?E.renderBufferDirect(t,i,n,o,h,c):E.renderBuffer(t,i,n,o,h,c)}}function Oe(e,t,i,n,r,o){for(var s,a=0,l=e.length;a<l;a++){var c=e[a],h=c.object;if(h.visible){if(o)s=o;else{if(!(s=c[t]))continue;Xe(s)}E.renderImmediateObject(i,n,r,s,h)}}}function Ne(e){var t=e.object.material;t.transparent?(e.transparent=t,e.opaque=null):(e.opaque=t,e.transparent=null)}function ke(e){var t=e.object,i=e.buffer,n=t.geometry,r=t.material;if(r instanceof K.MeshFaceMaterial){var o=n instanceof K.BufferGeometry?0:i.materialIndex;r=r.materials[o],e.material=r,r.transparent?y.push(e):v.push(e)}else r&&(e.material=r,r.transparent?y.push(e):v.push(e))}this.renderBufferImmediate=function(e,t,i){if(H.initAttributes(),e.hasPositions&&!e.__webglVertexBuffer&&(e.__webglVertexBuffer=_.createBuffer()),e.hasNormals&&!e.__webglNormalBuffer&&(e.__webglNormalBuffer=_.createBuffer()),e.hasUvs&&!e.__webglUvBuffer&&(e.__webglUvBuffer=_.createBuffer()),e.hasColors&&!e.__webglColorBuffer&&(e.__webglColorBuffer=_.createBuffer()),e.hasPositions&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglVertexBuffer),_.bufferData(_.ARRAY_BUFFER,e.positionArray,_.DYNAMIC_DRAW),H.enableAttribute(t.attributes.position),_.vertexAttribPointer(t.attributes.position,3,_.FLOAT,!1,0,0)),e.hasNormals){if(_.bindBuffer(_.ARRAY_BUFFER,e.__webglNormalBuffer),i instanceof K.MeshPhongMaterial==!1&&i.shading===K.FlatShading){var n,r,o,s,a,l,c,h,u,d,p,f=3*e.count;for(p=0;p<f;p+=9)s=(d=e.normalArray)[p],l=d[p+1],h=d[p+2],a=d[p+3],c=d[p+4],u=d[p+5],n=(s+a+d[p+6])/3,r=(l+c+d[p+7])/3,o=(h+u+d[p+8])/3,d[p]=n,d[p+1]=r,d[p+2]=o,d[p+3]=n,d[p+4]=r,d[p+5]=o,d[p+6]=n,d[p+7]=r,d[p+8]=o}_.bufferData(_.ARRAY_BUFFER,e.normalArray,_.DYNAMIC_DRAW),H.enableAttribute(t.attributes.normal),_.vertexAttribPointer(t.attributes.normal,3,_.FLOAT,!1,0,0)}e.hasUvs&&i.map&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglUvBuffer),_.bufferData(_.ARRAY_BUFFER,e.uvArray,_.DYNAMIC_DRAW),H.enableAttribute(t.attributes.uv),_.vertexAttribPointer(t.attributes.uv,2,_.FLOAT,!1,0,0)),e.hasColors&&i.vertexColors!==K.NoColors&&(_.bindBuffer(_.ARRAY_BUFFER,e.__webglColorBuffer),_.bufferData(_.ARRAY_BUFFER,e.colorArray,_.DYNAMIC_DRAW),H.enableAttribute(t.attributes.color),_.vertexAttribPointer(t.attributes.color,3,_.FLOAT,!1,0,0)),H.disableUnusedAttributes(),_.drawArrays(_.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,i,r,o,s){if(!1!==r.visible){ze(s);var a=qe(e,t,i,r,s),l=!1,c=r.wireframe?1:0,h="direct_"+o.id+"_"+a.id+"_"+c;if(h!==T&&(T=h,l=!0),l&&H.initAttributes(),s instanceof K.Mesh){var u=!0===r.wireframe?_.LINES:_.TRIANGLES;if(g=o.attributes.index){if(g.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(v=_.UNSIGNED_INT,y=4):(v=_.UNSIGNED_SHORT,y=2),0===(b=o.offsets).length)l&&(Ce(r,a,o,0),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,g.buffer)),_.drawElements(u,g.array.length,v,0),E.info.render.calls++,E.info.render.vertices+=g.array.length,E.info.render.faces+=g.array.length/3;else{l=!0;for(var d=0,p=b.length;d<p;d++){var f=b[d].index;l&&(Ce(r,a,o,f),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,g.buffer)),_.drawElements(u,b[d].count,v,b[d].start*y),E.info.render.calls++,E.info.render.vertices+=b[d].count,E.info.render.faces+=b[d].count/3}}}else{l&&Ce(r,a,o,0);var m=o.attributes.position;_.drawArrays(u,0,m.array.length/m.itemSize),E.info.render.calls++,E.info.render.vertices+=m.array.length/m.itemSize,E.info.render.faces+=m.array.length/(3*m.itemSize)}}else if(s instanceof K.PointCloud){u=_.POINTS;if(g=o.attributes.index){if(g.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(v=_.UNSIGNED_INT,y=4):(v=_.UNSIGNED_SHORT,y=2),0===(b=o.offsets).length)l&&(Ce(r,a,o,0),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,g.buffer)),_.drawElements(u,g.array.length,v,0),E.info.render.calls++,E.info.render.points+=g.array.length;else{b.length>1&&(l=!0);for(d=0,p=b.length;d<p;d++){f=b[d].index;l&&(Ce(r,a,o,f),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,g.buffer)),_.drawElements(u,b[d].count,v,b[d].start*y),E.info.render.calls++,E.info.render.points+=b[d].count}}}else{l&&Ce(r,a,o,0);m=o.attributes.position;if(0===(b=o.offsets).length)_.drawArrays(u,0,m.array.length/3),E.info.render.calls++,E.info.render.points+=m.array.length/3;else for(d=0,p=b.length;d<p;d++)_.drawArrays(u,b[d].index,b[d].count),E.info.render.calls++,E.info.render.points+=b[d].count}}else if(s instanceof K.Line){var g;u=s.mode===K.LineStrip?_.LINE_STRIP:_.LINES;if(H.setLineWidth(r.linewidth*n),g=o.attributes.index){var v,y;if(g.array instanceof Uint32Array?(v=_.UNSIGNED_INT,y=4):(v=_.UNSIGNED_SHORT,y=2),0===(b=o.offsets).length)l&&(Ce(r,a,o,0),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,g.buffer)),_.drawElements(u,g.array.length,v,0),E.info.render.calls++,E.info.render.vertices+=g.array.length;else{b.length>1&&(l=!0);for(d=0,p=b.length;d<p;d++){f=b[d].index;l&&(Ce(r,a,o,f),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,g.buffer)),_.drawElements(u,b[d].count,v,b[d].start*y),E.info.render.calls++,E.info.render.vertices+=b[d].count}}}else{l&&Ce(r,a,o,0);var b;m=o.attributes.position;if(0===(b=o.offsets).length)_.drawArrays(u,0,m.array.length/3),E.info.render.calls++,E.info.render.vertices+=m.array.length/3;else for(d=0,p=b.length;d<p;d++)_.drawArrays(u,b[d].index,b[d].count),E.info.render.calls++,E.info.render.vertices+=b[d].count}}}},this.renderBuffer=function(e,t,i,r,o,s){if(!1!==r.visible){ze(s);var a=qe(e,t,i,r,s),l=a.attributes,c=!1,h=r.wireframe?1:0,u=o.id+"_"+a.id+"_"+h;if(u!==T&&(T=u,c=!0),c&&H.initAttributes(),!r.morphTargets&&l.position>=0?c&&(_.bindBuffer(_.ARRAY_BUFFER,o.__webglVertexBuffer),H.enableAttribute(l.position),_.vertexAttribPointer(l.position,3,_.FLOAT,!1,0,0)):s.morphTargetBase&&function(e,t,i){var n=e.program.attributes;-1!==i.morphTargetBase&&n.position>=0?(_.bindBuffer(_.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[i.morphTargetBase]),H.enableAttribute(n.position),_.vertexAttribPointer(n.position,3,_.FLOAT,!1,0,0)):n.position>=0&&(_.bindBuffer(_.ARRAY_BUFFER,t.__webglVertexBuffer),H.enableAttribute(n.position),_.vertexAttribPointer(n.position,3,_.FLOAT,!1,0,0));if(i.morphTargetForcedOrder.length)for(var r=0,o=i.morphTargetForcedOrder,s=i.morphTargetInfluences;r<e.numSupportedMorphTargets&&r<o.length;)(a=n["morphTarget"+r])>=0&&(_.bindBuffer(_.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[o[r]]),H.enableAttribute(a),_.vertexAttribPointer(a,3,_.FLOAT,!1,0,0)),(a=n["morphNormal"+r])>=0&&e.morphNormals&&(_.bindBuffer(_.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[o[r]]),H.enableAttribute(a),_.vertexAttribPointer(a,3,_.FLOAT,!1,0,0)),i.__webglMorphTargetInfluences[r]=s[o[r]],r++;else{var a,l=[],c=(s=i.morphTargetInfluences,i.geometry.morphTargets);s.length>c.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),s.length=c.length);for(var h=0,u=s.length;h<u;h++){var d=s[h];l.push([d,h])}l.length>e.numSupportedMorphTargets?(l.sort(Le),l.length=e.numSupportedMorphTargets):l.length>e.numSupportedMorphNormals?l.sort(Le):0===l.length&&l.push([0,0]);r=0;for(var p=e.numSupportedMorphTargets;r<p;r++)if(l[r]){var f=l[r][1];(a=n["morphTarget"+r])>=0&&(_.bindBuffer(_.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[f]),H.enableAttribute(a),_.vertexAttribPointer(a,3,_.FLOAT,!1,0,0)),(a=n["morphNormal"+r])>=0&&e.morphNormals&&(_.bindBuffer(_.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[f]),H.enableAttribute(a),_.vertexAttribPointer(a,3,_.FLOAT,!1,0,0)),i.__webglMorphTargetInfluences[r]=s[f]}else i.__webglMorphTargetInfluences[r]=0}null!==e.program.uniforms.morphTargetInfluences&&_.uniform1fv(e.program.uniforms.morphTargetInfluences,i.__webglMorphTargetInfluences)}(r,o,s),c){if(o.__webglCustomAttributesList)for(var d=0,p=o.__webglCustomAttributesList.length;d<p;d++){var f=o.__webglCustomAttributesList[d];l[f.buffer.belongsToAttribute]>=0&&(_.bindBuffer(_.ARRAY_BUFFER,f.buffer),H.enableAttribute(l[f.buffer.belongsToAttribute]),_.vertexAttribPointer(l[f.buffer.belongsToAttribute],f.size,_.FLOAT,!1,0,0))}l.color>=0&&(s.geometry.colors.length>0||s.geometry.faces.length>0?(_.bindBuffer(_.ARRAY_BUFFER,o.__webglColorBuffer),H.enableAttribute(l.color),_.vertexAttribPointer(l.color,3,_.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&_.vertexAttrib3fv(l.color,r.defaultAttributeValues.color)),l.normal>=0&&(_.bindBuffer(_.ARRAY_BUFFER,o.__webglNormalBuffer),H.enableAttribute(l.normal),_.vertexAttribPointer(l.normal,3,_.FLOAT,!1,0,0)),l.tangent>=0&&(_.bindBuffer(_.ARRAY_BUFFER,o.__webglTangentBuffer),H.enableAttribute(l.tangent),_.vertexAttribPointer(l.tangent,4,_.FLOAT,!1,0,0)),l.uv>=0&&(s.geometry.faceVertexUvs[0]?(_.bindBuffer(_.ARRAY_BUFFER,o.__webglUVBuffer),H.enableAttribute(l.uv),_.vertexAttribPointer(l.uv,2,_.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&_.vertexAttrib2fv(l.uv,r.defaultAttributeValues.uv)),l.uv2>=0&&(s.geometry.faceVertexUvs[1]?(_.bindBuffer(_.ARRAY_BUFFER,o.__webglUV2Buffer),H.enableAttribute(l.uv2),_.vertexAttribPointer(l.uv2,2,_.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&_.vertexAttrib2fv(l.uv2,r.defaultAttributeValues.uv2)),r.skinning&&l.skinIndex>=0&&l.skinWeight>=0&&(_.bindBuffer(_.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),H.enableAttribute(l.skinIndex),_.vertexAttribPointer(l.skinIndex,4,_.FLOAT,!1,0,0),_.bindBuffer(_.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),H.enableAttribute(l.skinWeight),_.vertexAttribPointer(l.skinWeight,4,_.FLOAT,!1,0,0)),l.lineDistance>=0&&(_.bindBuffer(_.ARRAY_BUFFER,o.__webglLineDistanceBuffer),H.enableAttribute(l.lineDistance),_.vertexAttribPointer(l.lineDistance,1,_.FLOAT,!1,0,0))}if(H.disableUnusedAttributes(),s instanceof K.Mesh){var m=o.__typeArray===Uint32Array?_.UNSIGNED_INT:_.UNSIGNED_SHORT;r.wireframe?(H.setLineWidth(r.wireframeLinewidth*n),c&&_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),_.drawElements(_.LINES,o.__webglLineCount,m,0)):(c&&_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),_.drawElements(_.TRIANGLES,o.__webglFaceCount,m,0)),E.info.render.calls++,E.info.render.vertices+=o.__webglFaceCount,E.info.render.faces+=o.__webglFaceCount/3}else if(s instanceof K.Line){var g=s.mode===K.LineStrip?_.LINE_STRIP:_.LINES;H.setLineWidth(r.linewidth*n),_.drawArrays(g,0,o.__webglLineCount),E.info.render.calls++}else s instanceof K.PointCloud&&(_.drawArrays(_.POINTS,0,o.__webglParticleCount),E.info.render.calls++,E.info.render.points+=o.__webglParticleCount)}},this.render=function(e,t,i,n){if(t instanceof K.Camera!=!1){var r=e.fog;T="",M=-1,C=null,B=!0,!0===e.autoUpdate&&e.updateMatrixWorld(),void 0===t.parent&&t.updateMatrixWorld(),e.traverse((function(e){e instanceof K.SkinnedMesh&&e.skeleton.update()})),t.matrixWorldInverse.getInverse(t.matrixWorld),F.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),k.setFromMatrix(F),f.length=0,v.length=0,y.length=0,b.length=0,x.length=0,Ie(e),!0===E.sortObjects&&(v.sort(Pe),y.sort(De)),he.render(e,t),E.info.render.calls=0,E.info.render.vertices=0,E.info.render.faces=0,E.info.render.points=0,this.setRenderTarget(i),(this.autoClear||n)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);for(var o=0,s=g.length;o<s;o++){var a=g[o],l=a.object;l.visible&&(Qe(l,t),Ne(a))}if(e.overrideMaterial){var c=e.overrideMaterial;Xe(c),Re(v,t,f,r,c),Re(y,t,f,r,c),Oe(g,"",t,f,r,c)}else H.setBlending(K.NoBlending),Re(v,t,f,r,null),Oe(g,"opaque",t,f,r,null),Re(y,t,f,r,null),Oe(g,"transparent",t,f,r,null);ue.render(e,t),de.render(e,t,O,N),i&&i.generateMipmaps&&i.minFilter!==K.NearestFilter&&i.minFilter!==K.LinearFilter&&function(e){e instanceof K.WebGLRenderTargetCube?(_.bindTexture(_.TEXTURE_CUBE_MAP,e.__webglTexture),_.generateMipmap(_.TEXTURE_CUBE_MAP),_.bindTexture(_.TEXTURE_CUBE_MAP,null)):(_.bindTexture(_.TEXTURE_2D,e.__webglTexture),_.generateMipmap(_.TEXTURE_2D),_.bindTexture(_.TEXTURE_2D,null))}(i),H.setDepthTest(!0),H.setDepthWrite(!0),H.setColorWrite(!0)}else K.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.renderImmediateObject=function(e,t,i,n,r){var o=qe(e,t,i,n,r);T="",E.setMaterialFaces(n),r.immediateRenderCallback?r.immediateRenderCallback(o,_,k):r.render((function(e){E.renderBufferImmediate(e,o,n)}))};var Fe={},Ve=0;function Ue(e,t){var i=e.material,n=!1;void 0!==Fe[t.id]&&!0!==t.groupsNeedUpdate||(delete m[e.id],Fe[t.id]=function(e,t){for(var i,n,r=W.get("OES_element_index_uint")?4294967296:65535,o={},s=e.morphTargets.length,a=e.morphNormals.length,l={},c=[],h=0,u=e.faces.length;h<u;h++){var d=e.faces[h],p=t?d.materialIndex:0;p in o||(o[p]={hash:p,counter:0}),(i=o[p].hash+"_"+o[p].counter)in l||(n={id:Ve++,faces3:[],materialIndex:p,vertices:0,numMorphTargets:s,numMorphNormals:a},l[i]=n,c.push(n)),l[i].vertices+3>r&&(o[p].counter+=1,(i=o[p].hash+"_"+o[p].counter)in l||(n={id:Ve++,faces3:[],materialIndex:p,vertices:0,numMorphTargets:s,numMorphNormals:a},l[i]=n,c.push(n))),l[i].faces3.push(h),l[i].vertices+=3}return c}(t,i instanceof K.MeshFaceMaterial),t.groupsNeedUpdate=!1);for(var r=Fe[t.id],o=0,s=r.length;o<s;o++){var a=r[o];void 0===a.__webglVertexBuffer?(pe(a),we(a,e),t.verticesNeedUpdate=!0,t.morphTargetsNeedUpdate=!0,t.elementsNeedUpdate=!0,t.uvsNeedUpdate=!0,t.normalsNeedUpdate=!0,t.tangentsNeedUpdate=!0,t.colorsNeedUpdate=!0,n=!0):n=!1,(n||void 0===e.__webglActive)&&Be(m,a,e)}e.__webglActive=!0}function Be(e,t,i){var n=i.id;e[n]=e[n]||[],e[n].push({id:n,buffer:t,object:i,material:null,z:0})}function ze(e){var t=e.geometry;if(t instanceof K.BufferGeometry)for(var i=t.attributes,n=t.attributesKeys,r=0,o=n.length;r<o;r++){var s=n[r],a=i[s],l="index"===s?_.ELEMENT_ARRAY_BUFFER:_.ARRAY_BUFFER;void 0===a.buffer?(a.buffer=_.createBuffer(),_.bindBuffer(l,a.buffer),_.bufferData(l,a.array,a instanceof K.DynamicBufferAttribute?_.DYNAMIC_DRAW:_.STATIC_DRAW),a.needsUpdate=!1):!0===a.needsUpdate&&(_.bindBuffer(l,a.buffer),void 0===a.updateRange||-1===a.updateRange.count?_.bufferSubData(l,0,a.array):0===a.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(_.bufferSubData(l,a.updateRange.offset*a.array.BYTES_PER_ELEMENT,a.array.subarray(a.updateRange.offset,a.updateRange.offset+a.updateRange.count)),a.updateRange.count=0),a.needsUpdate=!1)}else if(e instanceof K.Mesh){!0===t.groupsNeedUpdate&&Ue(e,t);for(var c=Fe[t.id],h=(r=0,c.length);r<h;r++){var u=c[r],d=(p=Me(e,u)).attributes&&Ge(p);(t.verticesNeedUpdate||t.morphTargetsNeedUpdate||t.elementsNeedUpdate||t.uvsNeedUpdate||t.normalsNeedUpdate||t.colorsNeedUpdate||t.tangentsNeedUpdate||d)&&Te(u,e,_.DYNAMIC_DRAW,!t.dynamic,p)}t.verticesNeedUpdate=!1,t.morphTargetsNeedUpdate=!1,t.elementsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.tangentsNeedUpdate=!1,p.attributes&&He(p)}else if(e instanceof K.Line){d=(p=Me(e,t)).attributes&&Ge(p);(t.verticesNeedUpdate||t.colorsNeedUpdate||t.lineDistancesNeedUpdate||d)&&function(e,t){var i,n,r,o,s,a,l,c,h,u,d,p,f=e.vertices,m=e.colors,g=e.lineDistances,v=f.length,y=m.length,b=g.length,x=e.__vertexArray,E=e.__colorArray,A=e.__lineDistanceArray,S=e.verticesNeedUpdate,w=e.colorsNeedUpdate,M=e.lineDistancesNeedUpdate,T=e.__webglCustomAttributesList;if(S){for(i=0;i<v;i++)o=f[i],x[s=3*i]=o.x,x[s+1]=o.y,x[s+2]=o.z;_.bindBuffer(_.ARRAY_BUFFER,e.__webglVertexBuffer),_.bufferData(_.ARRAY_BUFFER,x,t)}if(w){for(n=0;n<y;n++)a=m[n],E[s=3*n]=a.r,E[s+1]=a.g,E[s+2]=a.b;_.bindBuffer(_.ARRAY_BUFFER,e.__webglColorBuffer),_.bufferData(_.ARRAY_BUFFER,E,t)}if(M){for(r=0;r<b;r++)A[r]=g[r];_.bindBuffer(_.ARRAY_BUFFER,e.__webglLineDistanceBuffer),_.bufferData(_.ARRAY_BUFFER,A,t)}if(T)for(l=0,c=T.length;l<c;l++)if((p=T[l]).needsUpdate&&(void 0===p.boundTo||"vertices"===p.boundTo)){if(s=0,u=p.value.length,1===p.size)for(h=0;h<u;h++)p.array[h]=p.value[h];else if(2===p.size)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,s+=2;else if(3===p.size)if("c"===p.type)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.r,p.array[s+1]=d.g,p.array[s+2]=d.b,s+=3;else for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,p.array[s+2]=d.z,s+=3;else if(4===p.size)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,p.array[s+2]=d.z,p.array[s+3]=d.w,s+=4;_.bindBuffer(_.ARRAY_BUFFER,p.buffer),_.bufferData(_.ARRAY_BUFFER,p.array,t),p.needsUpdate=!1}}(t,_.DYNAMIC_DRAW),t.verticesNeedUpdate=!1,t.colorsNeedUpdate=!1,t.lineDistancesNeedUpdate=!1,p.attributes&&He(p)}else if(e instanceof K.PointCloud){var p;d=(p=Me(e,t)).attributes&&Ge(p);(t.verticesNeedUpdate||t.colorsNeedUpdate||d)&&function(e,t,i){var n,r,o,s,a,l,c,h,u,d,p,f=e.vertices,m=f.length,g=e.colors,v=g.length,y=e.__vertexArray,b=e.__colorArray,x=e.verticesNeedUpdate,E=e.colorsNeedUpdate,A=e.__webglCustomAttributesList;if(x){for(n=0;n<m;n++)o=f[n],y[s=3*n]=o.x,y[s+1]=o.y,y[s+2]=o.z;_.bindBuffer(_.ARRAY_BUFFER,e.__webglVertexBuffer),_.bufferData(_.ARRAY_BUFFER,y,t)}if(E){for(r=0;r<v;r++)a=g[r],b[s=3*r]=a.r,b[s+1]=a.g,b[s+2]=a.b;_.bindBuffer(_.ARRAY_BUFFER,e.__webglColorBuffer),_.bufferData(_.ARRAY_BUFFER,b,t)}if(A)for(l=0,c=A.length;l<c;l++){if((p=A[l]).needsUpdate&&(void 0===p.boundTo||"vertices"===p.boundTo))if(u=p.value.length,s=0,1===p.size)for(h=0;h<u;h++)p.array[h]=p.value[h];else if(2===p.size)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,s+=2;else if(3===p.size)if("c"===p.type)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.r,p.array[s+1]=d.g,p.array[s+2]=d.b,s+=3;else for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,p.array[s+2]=d.z,s+=3;else if(4===p.size)for(h=0;h<u;h++)d=p.value[h],p.array[s]=d.x,p.array[s+1]=d.y,p.array[s+2]=d.z,p.array[s+3]=d.w,s+=4;_.bindBuffer(_.ARRAY_BUFFER,p.buffer),_.bufferData(_.ARRAY_BUFFER,p.array,t),p.needsUpdate=!1}}(t,_.DYNAMIC_DRAW),t.verticesNeedUpdate=!1,t.colorsNeedUpdate=!1,p.attributes&&He(p)}}function Ge(e){for(var t in e.attributes)if(e.attributes[t].needsUpdate)return!0;return!1}function He(e){for(var t in e.attributes)e.attributes[t].needsUpdate=!1}var We={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};function je(e,t,i,n){e.addEventListener("dispose",ye);var o=We[e.type];if(o){var s=K.ShaderLib[o];e.__webglShader={uniforms:K.UniformsUtils.clone(s.uniforms),vertexShader:s.vertexShader,fragmentShader:s.fragmentShader}}else e.__webglShader={uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};var a=function(e){for(var t=0,i=0,n=0,r=0,o=0,s=e.length;o<s;o++){var a=e[o];a.onlyShadow||!1===a.visible||(a instanceof K.DirectionalLight&&t++,a instanceof K.PointLight&&i++,a instanceof K.SpotLight&&n++,a instanceof K.HemisphereLight&&r++)}return{directional:t,point:i,spot:n,hemi:r}}(t),l=function(e){for(var t=0,i=0,n=e.length;i<n;i++){var r=e[i];r.castShadow&&(r instanceof K.SpotLight&&t++,r instanceof K.DirectionalLight&&!r.shadowCascade&&t++)}return t}(t),c=function(e){if(te&&e&&e.skeleton&&e.skeleton.useVertexTexture)return 1024;var t=_.getParameter(_.MAX_VERTEX_UNIFORM_VECTORS),i=Math.floor((t-20)/4);return void 0!==e&&e instanceof K.SkinnedMesh&&(i=Math.min(e.skeleton.bones.length,i))<e.skeleton.bones.length&&K.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+i+" (try OpenGL instead of ANGLE)"),i}(n),h={precision:r,supportsVertexTextures:ee,map:!!e.map,envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,lightMap:!!e.lightMap,bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,combine:e.combine,vertexColors:e.vertexColors,fog:i,useFog:e.fog,fogExp:i instanceof K.FogExp2,flatShading:e.shading===K.FlatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:u,skinning:e.skinning,maxBones:c,useVertexTexture:te&&n&&n.skeleton&&n.skeleton.useVertexTexture,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:E.maxMorphTargets,maxMorphNormals:E.maxMorphNormals,maxDirLights:a.directional,maxPointLights:a.point,maxSpotLights:a.spot,maxHemiLights:a.hemi,maxShadows:l,shadowMapEnabled:E.shadowMapEnabled&&n.receiveShadow&&l>0,shadowMapType:E.shadowMapType,shadowMapDebug:E.shadowMapDebug,shadowMapCascade:E.shadowMapCascade,alphaTest:e.alphaTest,metal:e.metal,wrapAround:e.wrapAround,doubleSided:e.side===K.DoubleSide,flipSided:e.side===K.BackSide},d=[];if(o?d.push(o):(d.push(e.fragmentShader),d.push(e.vertexShader)),void 0!==e.defines)for(var p in e.defines)d.push(p),d.push(e.defines[p]);for(var p in h)d.push(p),d.push(h[p]);for(var f,m=d.join(),g=0,v=A.length;g<v;g++){var y=A[g];if(y.code===m){(f=y).usedTimes++;break}}void 0===f&&(f=new K.WebGLProgram(E,m,e,h),A.push(f),E.info.memory.programs=A.length),e.program=f;var b=f.attributes;if(e.morphTargets){e.numSupportedMorphTargets=0;for(var x="morphTarget",S=0;S<E.maxMorphTargets;S++)b[x+S]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;x="morphNormal";for(S=0;S<E.maxMorphNormals;S++)b[x+S]>=0&&e.numSupportedMorphNormals++}for(var w in e.uniformsList=[],e.__webglShader.uniforms){var M=e.program.uniforms[w];M&&e.uniformsList.push([e.__webglShader.uniforms[w],M])}}function Xe(e){!0===e.transparent?H.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha):H.setBlending(K.NoBlending),H.setDepthTest(e.depthTest),H.setDepthWrite(e.depthWrite),H.setColorWrite(e.colorWrite),H.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function qe(e,i,n,r,o){P=0,r.needsUpdate&&(r.program&&Ae(r),je(r,i,n,o),r.needsUpdate=!1),r.morphTargets&&(o.__webglMorphTargetInfluences||(o.__webglMorphTargetInfluences=new Float32Array(E.maxMorphTargets)));var s=!1,a=!1,l=!1,c=r.program,h=c.uniforms,d=r.__webglShader.uniforms;if(c.id!==S&&(_.useProgram(c.program),S=c.id,s=!0,a=!0,l=!0),r.id!==M&&(-1===M&&(l=!0),M=r.id,a=!0),(s||e!==C)&&(_.uniformMatrix4fv(h.projectionMatrix,!1,e.projectionMatrix.elements),u&&_.uniform1f(h.logDepthBufFC,2/(Math.log(e.far+1)/Math.LN2)),e!==C&&(C=e),(r instanceof K.ShaderMaterial||r instanceof K.MeshPhongMaterial||r.envMap)&&null!==h.cameraPosition&&(V.setFromMatrixPosition(e.matrixWorld),_.uniform3f(h.cameraPosition,V.x,V.y,V.z)),(r instanceof K.MeshPhongMaterial||r instanceof K.MeshLambertMaterial||r instanceof K.MeshBasicMaterial||r instanceof K.ShaderMaterial||r.skinning)&&null!==h.viewMatrix&&_.uniformMatrix4fv(h.viewMatrix,!1,e.matrixWorldInverse.elements)),r.skinning)if(o.bindMatrix&&null!==h.bindMatrix&&_.uniformMatrix4fv(h.bindMatrix,!1,o.bindMatrix.elements),o.bindMatrixInverse&&null!==h.bindMatrixInverse&&_.uniformMatrix4fv(h.bindMatrixInverse,!1,o.bindMatrixInverse.elements),te&&o.skeleton&&o.skeleton.useVertexTexture){if(null!==h.boneTexture){var p=Ze();_.uniform1i(h.boneTexture,p),E.setTexture(o.skeleton.boneTexture,p)}null!==h.boneTextureWidth&&_.uniform1i(h.boneTextureWidth,o.skeleton.boneTextureWidth),null!==h.boneTextureHeight&&_.uniform1i(h.boneTextureHeight,o.skeleton.boneTextureHeight)}else o.skeleton&&o.skeleton.boneMatrices&&null!==h.boneGlobalMatrices&&_.uniformMatrix4fv(h.boneGlobalMatrices,!1,o.skeleton.boneMatrices);return a&&(n&&r.fog&&function(e,t){e.fogColor.value=t.color,t instanceof K.Fog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t instanceof K.FogExp2&&(e.fogDensity.value=t.density)}(d,n),(r instanceof K.MeshPhongMaterial||r instanceof K.MeshLambertMaterial||r.lights)&&(B&&(l=!0,function(e){var t,i,n,r,o,s,a,l,c=0,h=0,u=0,d=z,p=d.directional.colors,f=d.directional.positions,m=d.point.colors,g=d.point.positions,v=d.point.distances,y=d.point.decays,b=d.spot.colors,x=d.spot.positions,_=d.spot.distances,E=d.spot.directions,A=d.spot.anglesCos,S=d.spot.exponents,w=d.spot.decays,M=d.hemi.skyColors,T=d.hemi.groundColors,C=d.hemi.positions,P=0,D=0,L=0,I=0,R=0,O=0,N=0,k=0,F=0,B=0,G=0,H=0;for(t=0,i=e.length;t<i;t++)if(!(n=e[t]).onlyShadow)if(r=n.color,a=n.intensity,l=n.distance,n instanceof K.AmbientLight){if(!n.visible)continue;c+=r.r,h+=r.g,u+=r.b}else if(n instanceof K.DirectionalLight){if(R+=1,!n.visible)continue;U.setFromMatrixPosition(n.matrixWorld),V.setFromMatrixPosition(n.target.matrixWorld),U.sub(V),U.normalize(),f[F=3*P]=U.x,f[F+1]=U.y,f[F+2]=U.z,Je(p,F,r,a),P+=1}else if(n instanceof K.PointLight){if(O+=1,!n.visible)continue;Je(m,B=3*D,r,a),V.setFromMatrixPosition(n.matrixWorld),g[B]=V.x,g[B+1]=V.y,g[B+2]=V.z,v[D]=l,y[D]=0===n.distance?0:n.decay,D+=1}else if(n instanceof K.SpotLight){if(N+=1,!n.visible)continue;Je(b,G=3*L,r,a),U.setFromMatrixPosition(n.matrixWorld),x[G]=U.x,x[G+1]=U.y,x[G+2]=U.z,_[L]=l,V.setFromMatrixPosition(n.target.matrixWorld),U.sub(V),U.normalize(),E[G]=U.x,E[G+1]=U.y,E[G+2]=U.z,A[L]=Math.cos(n.angle),S[L]=n.exponent,w[L]=0===n.distance?0:n.decay,L+=1}else if(n instanceof K.HemisphereLight){if(k+=1,!n.visible)continue;U.setFromMatrixPosition(n.matrixWorld),U.normalize(),C[H=3*I]=U.x,C[H+1]=U.y,C[H+2]=U.z,o=n.color,s=n.groundColor,Je(M,H,o,a),Je(T,H,s,a),I+=1}for(t=3*P,i=Math.max(p.length,3*R);t<i;t++)p[t]=0;for(t=3*D,i=Math.max(m.length,3*O);t<i;t++)m[t]=0;for(t=3*L,i=Math.max(b.length,3*N);t<i;t++)b[t]=0;for(t=3*I,i=Math.max(M.length,3*k);t<i;t++)M[t]=0;for(t=3*I,i=Math.max(T.length,3*k);t<i;t++)T[t]=0;d.directional.length=P,d.point.length=D,d.spot.length=L,d.hemi.length=I,d.ambient[0]=c,d.ambient[1]=h,d.ambient[2]=u}(i),B=!1),l?(!function(e,t){e.ambientLightColor.value=t.ambient,e.directionalLightColor.value=t.directional.colors,e.directionalLightDirection.value=t.directional.positions,e.pointLightColor.value=t.point.colors,e.pointLightPosition.value=t.point.positions,e.pointLightDistance.value=t.point.distances,e.pointLightDecay.value=t.point.decays,e.spotLightColor.value=t.spot.colors,e.spotLightPosition.value=t.spot.positions,e.spotLightDistance.value=t.spot.distances,e.spotLightDirection.value=t.spot.directions,e.spotLightAngleCos.value=t.spot.anglesCos,e.spotLightExponent.value=t.spot.exponents,e.spotLightDecay.value=t.spot.decays,e.hemisphereLightSkyColor.value=t.hemi.skyColors,e.hemisphereLightGroundColor.value=t.hemi.groundColors,e.hemisphereLightDirection.value=t.hemi.positions}(d,z),Ke(d,!0)):Ke(d,!1)),(r instanceof K.MeshBasicMaterial||r instanceof K.MeshLambertMaterial||r instanceof K.MeshPhongMaterial)&&function(e,t){e.opacity.value=t.opacity,e.diffuse.value=t.color,e.map.value=t.map,e.lightMap.value=t.lightMap,e.specularMap.value=t.specularMap,e.alphaMap.value=t.alphaMap,t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale);t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));var i;t.map?i=t.map:t.specularMap?i=t.specularMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.alphaMap&&(i=t.alphaMap);if(void 0!==i){var n=i.offset,r=i.repeat;e.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap instanceof K.WebGLRenderTargetCube?1:-1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio}(d,r),r instanceof K.LineBasicMaterial?Ye(d,r):r instanceof K.LineDashedMaterial?(Ye(d,r),function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(d,r)):r instanceof K.PointCloudMaterial?function(e,i){if(e.psColor.value=i.color,e.opacity.value=i.opacity,e.size.value=i.size,e.scale.value=t.height/2,e.map.value=i.map,null!==i.map){var n=i.map.offset,r=i.map.repeat;e.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}}(d,r):r instanceof K.MeshPhongMaterial?function(e,t){e.shininess.value=t.shininess,e.emissive.value=t.emissive,e.specular.value=t.specular,t.wrapAround&&e.wrapRGB.value.copy(t.wrapRGB)}(d,r):r instanceof K.MeshLambertMaterial?function(e,t){e.emissive.value=t.emissive,t.wrapAround&&e.wrapRGB.value.copy(t.wrapRGB)}(d,r):r instanceof K.MeshDepthMaterial?(d.mNear.value=e.near,d.mFar.value=e.far,d.opacity.value=r.opacity):r instanceof K.MeshNormalMaterial&&(d.opacity.value=r.opacity),o.receiveShadow&&!r._shadowPass&&function(e,t){if(e.shadowMatrix)for(var i=0,n=0,r=t.length;n<r;n++){var o=t[n];o.castShadow&&((o instanceof K.SpotLight||o instanceof K.DirectionalLight&&!o.shadowCascade)&&(e.shadowMap.value[i]=o.shadowMap,e.shadowMapSize.value[i]=o.shadowMapSize,e.shadowMatrix.value[i]=o.shadowMatrix,e.shadowDarkness.value[i]=o.shadowDarkness,e.shadowBias.value[i]=o.shadowBias,i++))}}(d,i),function(e){for(var t,i,n,r=0,o=e.length;r<o;r++){var s=e[r][0];if(!1!==s.needsUpdate){var a=s.type,l=s.value,c=e[r][1];switch(a){case"1i":case"i":_.uniform1i(c,l);break;case"1f":case"f":_.uniform1f(c,l);break;case"2f":_.uniform2f(c,l[0],l[1]);break;case"3f":_.uniform3f(c,l[0],l[1],l[2]);break;case"4f":_.uniform4f(c,l[0],l[1],l[2],l[3]);break;case"1iv":case"iv1":_.uniform1iv(c,l);break;case"3iv":case"iv":_.uniform3iv(c,l);break;case"1fv":case"fv1":_.uniform1fv(c,l);break;case"2fv":_.uniform2fv(c,l);break;case"3fv":case"fv":_.uniform3fv(c,l);break;case"4fv":_.uniform4fv(c,l);break;case"Matrix3fv":_.uniformMatrix3fv(c,!1,l);break;case"Matrix4fv":_.uniformMatrix4fv(c,!1,l);break;case"v2":_.uniform2f(c,l.x,l.y);break;case"v3":_.uniform3f(c,l.x,l.y,l.z);break;case"v4":_.uniform4f(c,l.x,l.y,l.z,l.w);break;case"c":_.uniform3f(c,l.r,l.g,l.b);break;case"v2v":void 0===s._array&&(s._array=new Float32Array(2*l.length));for(var h=0,u=l.length;h<u;h++)n=2*h,s._array[n]=l[h].x,s._array[n+1]=l[h].y;_.uniform2fv(c,s._array);break;case"v3v":void 0===s._array&&(s._array=new Float32Array(3*l.length));for(h=0,u=l.length;h<u;h++)n=3*h,s._array[n]=l[h].x,s._array[n+1]=l[h].y,s._array[n+2]=l[h].z;_.uniform3fv(c,s._array);break;case"v4v":void 0===s._array&&(s._array=new Float32Array(4*l.length));for(h=0,u=l.length;h<u;h++)n=4*h,s._array[n]=l[h].x,s._array[n+1]=l[h].y,s._array[n+2]=l[h].z,s._array[n+3]=l[h].w;_.uniform4fv(c,s._array);break;case"m3":_.uniformMatrix3fv(c,!1,l.elements);break;case"m3v":void 0===s._array&&(s._array=new Float32Array(9*l.length));for(h=0,u=l.length;h<u;h++)l[h].flattenToArrayOffset(s._array,9*h);_.uniformMatrix3fv(c,!1,s._array);break;case"m4":_.uniformMatrix4fv(c,!1,l.elements);break;case"m4v":void 0===s._array&&(s._array=new Float32Array(16*l.length));for(h=0,u=l.length;h<u;h++)l[h].flattenToArrayOffset(s._array,16*h);_.uniformMatrix4fv(c,!1,s._array);break;case"t":if(t=l,i=Ze(),_.uniform1i(c,i),!t)continue;t instanceof K.CubeTexture||t.image instanceof Array&&6===t.image.length?tt(t,i):t instanceof K.WebGLRenderTargetCube?it(t,i):E.setTexture(t,i);break;case"tv":void 0===s._array&&(s._array=[]);for(h=0,u=s.value.length;h<u;h++)s._array[h]=Ze();_.uniform1iv(c,s._array);for(h=0,u=s.value.length;h<u;h++)t=s.value[h],i=s._array[h],t&&E.setTexture(t,i);break;default:K.warn("THREE.WebGLRenderer: Unknown uniform type: "+a)}}}}(r.uniformsList)),function(e,t){_.uniformMatrix4fv(e.modelViewMatrix,!1,t._modelViewMatrix.elements),e.normalMatrix&&_.uniformMatrix3fv(e.normalMatrix,!1,t._normalMatrix.elements)}(h,o),null!==h.modelMatrix&&_.uniformMatrix4fv(h.modelMatrix,!1,o.matrixWorld.elements),c}function Ye(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function Ke(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLightColor.needsUpdate=t,e.directionalLightDirection.needsUpdate=t,e.pointLightColor.needsUpdate=t,e.pointLightPosition.needsUpdate=t,e.pointLightDistance.needsUpdate=t,e.pointLightDecay.needsUpdate=t,e.spotLightColor.needsUpdate=t,e.spotLightPosition.needsUpdate=t,e.spotLightDistance.needsUpdate=t,e.spotLightDirection.needsUpdate=t,e.spotLightAngleCos.needsUpdate=t,e.spotLightExponent.needsUpdate=t,e.spotLightDecay.needsUpdate=t,e.hemisphereLightSkyColor.needsUpdate=t,e.hemisphereLightGroundColor.needsUpdate=t,e.hemisphereLightDirection.needsUpdate=t}function Ze(){var e=P;return e>=Z&&K.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+Z),P+=1,e}function Qe(e,t){e._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld),e._normalMatrix.getNormalMatrix(e._modelViewMatrix)}function Je(e,t,i,n){e[t]=i.r*n,e[t+1]=i.g*n,e[t+2]=i.b*n}function $e(e,t,i){var n;i?(_.texParameteri(e,_.TEXTURE_WRAP_S,st(t.wrapS)),_.texParameteri(e,_.TEXTURE_WRAP_T,st(t.wrapT)),_.texParameteri(e,_.TEXTURE_MAG_FILTER,st(t.magFilter)),_.texParameteri(e,_.TEXTURE_MIN_FILTER,st(t.minFilter))):(_.texParameteri(e,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(e,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),t.wrapS===K.ClampToEdgeWrapping&&t.wrapT===K.ClampToEdgeWrapping||K.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+t.sourceFile+" )"),_.texParameteri(e,_.TEXTURE_MAG_FILTER,ot(t.magFilter)),_.texParameteri(e,_.TEXTURE_MIN_FILTER,ot(t.minFilter)),t.minFilter!==K.NearestFilter&&t.minFilter!==K.LinearFilter&&K.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+t.sourceFile+" )")),(n=W.get("EXT_texture_filter_anisotropic"))&&t.type!==K.FloatType&&t.type!==K.HalfFloatType&&(t.anisotropy>1||t.__currentAnisotropy)&&(_.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,E.getMaxAnisotropy())),t.__currentAnisotropy=t.anisotropy)}function et(e,t){if(e.width>t||e.height>t){var i=t/Math.max(e.width,e.height),n=document.createElement("canvas");return n.width=Math.floor(e.width*i),n.height=Math.floor(e.height*i),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height),K.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+n.width+"x"+n.height,e),n}return e}function tt(e,t){if(6===e.image.length)if(e.needsUpdate){e.image.__webglTextureCube||(e.addEventListener("dispose",ge),e.image.__webglTextureCube=_.createTexture(),E.info.memory.textures++),_.activeTexture(_.TEXTURE0+t),_.bindTexture(_.TEXTURE_CUBE_MAP,e.image.__webglTextureCube),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var i=e instanceof K.CompressedTexture,n=e.image[0]instanceof K.DataTexture,r=[],o=0;o<6;o++)!E.autoScaleCubemaps||i||n?r[o]=n?e.image[o].image:e.image[o]:r[o]=et(e.image[o],$);var s=r[0],a=K.Math.isPowerOfTwo(s.width)&&K.Math.isPowerOfTwo(s.height),l=st(e.format),c=st(e.type);$e(_.TEXTURE_CUBE_MAP,e,a);for(o=0;o<6;o++)if(i)for(var h,u=r[o].mipmaps,d=0,p=u.length;d<p;d++)h=u[d],e.format!==K.RGBAFormat&&e.format!==K.RGBFormat?se().indexOf(l)>-1?_.compressedTexImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+o,d,l,h.width,h.height,0,h.data):K.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+o,d,l,h.width,h.height,0,l,c,h.data);else n?_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,l,r[o].width,r[o].height,0,l,c,r[o].data):_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,l,l,c,r[o]);e.generateMipmaps&&a&&_.generateMipmap(_.TEXTURE_CUBE_MAP),e.needsUpdate=!1,e.onUpdate&&e.onUpdate()}else _.activeTexture(_.TEXTURE0+t),_.bindTexture(_.TEXTURE_CUBE_MAP,e.image.__webglTextureCube)}function it(e,t){_.activeTexture(_.TEXTURE0+t),_.bindTexture(_.TEXTURE_CUBE_MAP,e.__webglTexture)}function nt(e,t,i){_.bindFramebuffer(_.FRAMEBUFFER,e),_.framebufferTexture2D(_.FRAMEBUFFER,_.COLOR_ATTACHMENT0,i,t.__webglTexture,0)}function rt(e,t){_.bindRenderbuffer(_.RENDERBUFFER,e),t.depthBuffer&&!t.stencilBuffer?(_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_COMPONENT16,t.width,t.height),_.framebufferRenderbuffer(_.FRAMEBUFFER,_.DEPTH_ATTACHMENT,_.RENDERBUFFER,e)):t.depthBuffer&&t.stencilBuffer?(_.renderbufferStorage(_.RENDERBUFFER,_.DEPTH_STENCIL,t.width,t.height),_.framebufferRenderbuffer(_.FRAMEBUFFER,_.DEPTH_STENCIL_ATTACHMENT,_.RENDERBUFFER,e)):_.renderbufferStorage(_.RENDERBUFFER,_.RGBA4,t.width,t.height)}function ot(e){return e===K.NearestFilter||e===K.NearestMipMapNearestFilter||e===K.NearestMipMapLinearFilter?_.NEAREST:_.LINEAR}function st(e){var t;if(e===K.RepeatWrapping)return _.REPEAT;if(e===K.ClampToEdgeWrapping)return _.CLAMP_TO_EDGE;if(e===K.MirroredRepeatWrapping)return _.MIRRORED_REPEAT;if(e===K.NearestFilter)return _.NEAREST;if(e===K.NearestMipMapNearestFilter)return _.NEAREST_MIPMAP_NEAREST;if(e===K.NearestMipMapLinearFilter)return _.NEAREST_MIPMAP_LINEAR;if(e===K.LinearFilter)return _.LINEAR;if(e===K.LinearMipMapNearestFilter)return _.LINEAR_MIPMAP_NEAREST;if(e===K.LinearMipMapLinearFilter)return _.LINEAR_MIPMAP_LINEAR;if(e===K.UnsignedByteType)return _.UNSIGNED_BYTE;if(e===K.UnsignedShort4444Type)return _.UNSIGNED_SHORT_4_4_4_4;if(e===K.UnsignedShort5551Type)return _.UNSIGNED_SHORT_5_5_5_1;if(e===K.UnsignedShort565Type)return _.UNSIGNED_SHORT_5_6_5;if(e===K.ByteType)return _.BYTE;if(e===K.ShortType)return _.SHORT;if(e===K.UnsignedShortType)return _.UNSIGNED_SHORT;if(e===K.IntType)return _.INT;if(e===K.UnsignedIntType)return _.UNSIGNED_INT;if(e===K.FloatType)return _.FLOAT;if(null!==(t=W.get("OES_texture_half_float"))&&e===K.HalfFloatType)return t.HALF_FLOAT_OES;if(e===K.AlphaFormat)return _.ALPHA;if(e===K.RGBFormat)return _.RGB;if(e===K.RGBAFormat)return _.RGBA;if(e===K.LuminanceFormat)return _.LUMINANCE;if(e===K.LuminanceAlphaFormat)return _.LUMINANCE_ALPHA;if(e===K.AddEquation)return _.FUNC_ADD;if(e===K.SubtractEquation)return _.FUNC_SUBTRACT;if(e===K.ReverseSubtractEquation)return _.FUNC_REVERSE_SUBTRACT;if(e===K.ZeroFactor)return _.ZERO;if(e===K.OneFactor)return _.ONE;if(e===K.SrcColorFactor)return _.SRC_COLOR;if(e===K.OneMinusSrcColorFactor)return _.ONE_MINUS_SRC_COLOR;if(e===K.SrcAlphaFactor)return _.SRC_ALPHA;if(e===K.OneMinusSrcAlphaFactor)return _.ONE_MINUS_SRC_ALPHA;if(e===K.DstAlphaFactor)return _.DST_ALPHA;if(e===K.OneMinusDstAlphaFactor)return _.ONE_MINUS_DST_ALPHA;if(e===K.DstColorFactor)return _.DST_COLOR;if(e===K.OneMinusDstColorFactor)return _.ONE_MINUS_DST_COLOR;if(e===K.SrcAlphaSaturateFactor)return _.SRC_ALPHA_SATURATE;if(null!==(t=W.get("WEBGL_compressed_texture_s3tc"))){if(e===K.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===K.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===K.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===K.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(t=W.get("WEBGL_compressed_texture_pvrtc"))){if(e===K.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===K.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===K.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===K.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(t=W.get("EXT_blend_minmax"))){if(e===K.MinEquation)return t.MIN_EXT;if(e===K.MaxEquation)return t.MAX_EXT}return 0}this.setFaceCulling=function(e,t){e===K.CullFaceNone?_.disable(_.CULL_FACE):(t===K.FrontFaceDirectionCW?_.frontFace(_.CW):_.frontFace(_.CCW),e===K.CullFaceBack?_.cullFace(_.BACK):e===K.CullFaceFront?_.cullFace(_.FRONT):_.cullFace(_.FRONT_AND_BACK),_.enable(_.CULL_FACE))},this.setMaterialFaces=function(e){H.setDoubleSided(e.side===K.DoubleSide),H.setFlipSided(e.side===K.BackSide)},this.uploadTexture=function(e){void 0===e.__webglInit&&(e.__webglInit=!0,e.addEventListener("dispose",ge),e.__webglTexture=_.createTexture(),E.info.memory.textures++),_.bindTexture(_.TEXTURE_2D,e.__webglTexture),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,e.flipY),_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),_.pixelStorei(_.UNPACK_ALIGNMENT,e.unpackAlignment),e.image=et(e.image,J);var t=e.image,i=K.Math.isPowerOfTwo(t.width)&&K.Math.isPowerOfTwo(t.height),n=st(e.format),r=st(e.type);$e(_.TEXTURE_2D,e,i);var o,s=e.mipmaps;if(e instanceof K.DataTexture)if(s.length>0&&i){for(var a=0,l=s.length;a<l;a++)o=s[a],_.texImage2D(_.TEXTURE_2D,a,n,o.width,o.height,0,n,r,o.data);e.generateMipmaps=!1}else _.texImage2D(_.TEXTURE_2D,0,n,t.width,t.height,0,n,r,t.data);else if(e instanceof K.CompressedTexture)for(a=0,l=s.length;a<l;a++)o=s[a],e.format!==K.RGBAFormat&&e.format!==K.RGBFormat?se().indexOf(n)>-1?_.compressedTexImage2D(_.TEXTURE_2D,a,n,o.width,o.height,0,o.data):K.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):_.texImage2D(_.TEXTURE_2D,a,n,o.width,o.height,0,n,r,o.data);else if(s.length>0&&i){for(a=0,l=s.length;a<l;a++)o=s[a],_.texImage2D(_.TEXTURE_2D,a,n,n,r,o);e.generateMipmaps=!1}else _.texImage2D(_.TEXTURE_2D,0,n,n,r,e.image);e.generateMipmaps&&i&&_.generateMipmap(_.TEXTURE_2D),e.needsUpdate=!1,e.onUpdate&&e.onUpdate()},this.setTexture=function(e,t){_.activeTexture(_.TEXTURE0+t),e.needsUpdate?E.uploadTexture(e):_.bindTexture(_.TEXTURE_2D,e.__webglTexture)},this.setRenderTarget=function(e){var t,i,n,r,o,s=e instanceof K.WebGLRenderTargetCube;if(e&&void 0===e.__webglFramebuffer){void 0===e.depthBuffer&&(e.depthBuffer=!0),void 0===e.stencilBuffer&&(e.stencilBuffer=!0),e.addEventListener("dispose",ve),e.__webglTexture=_.createTexture(),E.info.memory.textures++;var a=K.Math.isPowerOfTwo(e.width)&&K.Math.isPowerOfTwo(e.height),l=st(e.format),c=st(e.type);if(s){e.__webglFramebuffer=[],e.__webglRenderbuffer=[],_.bindTexture(_.TEXTURE_CUBE_MAP,e.__webglTexture),$e(_.TEXTURE_CUBE_MAP,e,a);for(var h=0;h<6;h++)e.__webglFramebuffer[h]=_.createFramebuffer(),e.__webglRenderbuffer[h]=_.createRenderbuffer(),_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,l,e.width,e.height,0,l,c,null),nt(e.__webglFramebuffer[h],e,_.TEXTURE_CUBE_MAP_POSITIVE_X+h),rt(e.__webglRenderbuffer[h],e);a&&_.generateMipmap(_.TEXTURE_CUBE_MAP)}else e.__webglFramebuffer=_.createFramebuffer(),e.shareDepthFrom?e.__webglRenderbuffer=e.shareDepthFrom.__webglRenderbuffer:e.__webglRenderbuffer=_.createRenderbuffer(),_.bindTexture(_.TEXTURE_2D,e.__webglTexture),$e(_.TEXTURE_2D,e,a),_.texImage2D(_.TEXTURE_2D,0,l,e.width,e.height,0,l,c,null),nt(e.__webglFramebuffer,e,_.TEXTURE_2D),e.shareDepthFrom?e.depthBuffer&&!e.stencilBuffer?_.framebufferRenderbuffer(_.FRAMEBUFFER,_.DEPTH_ATTACHMENT,_.RENDERBUFFER,e.__webglRenderbuffer):e.depthBuffer&&e.stencilBuffer&&_.framebufferRenderbuffer(_.FRAMEBUFFER,_.DEPTH_STENCIL_ATTACHMENT,_.RENDERBUFFER,e.__webglRenderbuffer):rt(e.__webglRenderbuffer,e),a&&_.generateMipmap(_.TEXTURE_2D);s?_.bindTexture(_.TEXTURE_CUBE_MAP,null):_.bindTexture(_.TEXTURE_2D,null),_.bindRenderbuffer(_.RENDERBUFFER,null),_.bindFramebuffer(_.FRAMEBUFFER,null)}e?(t=s?e.__webglFramebuffer[e.activeCubeFace]:e.__webglFramebuffer,i=e.width,n=e.height,r=0,o=0):(t=null,i=I,n=R,r=D,o=L),t!==w&&(_.bindFramebuffer(_.FRAMEBUFFER,t),_.viewport(r,o,i,n),w=t),O=i,N=n},this.readRenderTargetPixels=function(e,t,i,n,r,o){if(e instanceof K.WebGLRenderTarget){if(e.__webglFramebuffer){if(e.format!==K.RGBAFormat)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");var s=!1;e.__webglFramebuffer!==w&&(_.bindFramebuffer(_.FRAMEBUFFER,e.__webglFramebuffer),s=!0),_.checkFramebufferStatus(_.FRAMEBUFFER)===_.FRAMEBUFFER_COMPLETE?_.readPixels(t,i,n,r,_.RGBA,_.UNSIGNED_BYTE,o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),s&&_.bindFramebuffer(_.FRAMEBUFFER,w)}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.initMaterial=function(){K.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){K.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){K.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){K.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},K.WebGLRenderTarget=function(e,t,i){this.width=e,this.height=t,i=i||{},this.wrapS=void 0!==i.wrapS?i.wrapS:K.ClampToEdgeWrapping,this.wrapT=void 0!==i.wrapT?i.wrapT:K.ClampToEdgeWrapping,this.magFilter=void 0!==i.magFilter?i.magFilter:K.LinearFilter,this.minFilter=void 0!==i.minFilter?i.minFilter:K.LinearMipMapLinearFilter,this.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,this.offset=new K.Vector2(0,0),this.repeat=new K.Vector2(1,1),this.format=void 0!==i.format?i.format:K.RGBAFormat,this.type=void 0!==i.type?i.type:K.UnsignedByteType,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.generateMipmaps=!0,this.shareDepthFrom=void 0!==i.shareDepthFrom?i.shareDepthFrom:null},K.WebGLRenderTarget.prototype={constructor:K.WebGLRenderTarget,setSize:function(e,t){this.width=e,this.height=t},clone:function(){var e=new K.WebGLRenderTarget(this.width,this.height);return e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.format=this.format,e.type=this.type,e.depthBuffer=this.depthBuffer,e.stencilBuffer=this.stencilBuffer,e.generateMipmaps=this.generateMipmaps,e.shareDepthFrom=this.shareDepthFrom,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},K.EventDispatcher.prototype.apply(K.WebGLRenderTarget.prototype),K.WebGLRenderTargetCube=function(e,t,i){K.WebGLRenderTarget.call(this,e,t,i),this.activeCubeFace=0},K.WebGLRenderTargetCube.prototype=Object.create(K.WebGLRenderTarget.prototype),K.WebGLRenderTargetCube.prototype.constructor=K.WebGLRenderTargetCube,K.WebGLExtensions=function(e){var t={};this.get=function(i){if(void 0!==t[i])return t[i];var n;switch(i){case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(i)}return null===n&&K.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=n,n}},K.WebGLProgram=(k=0,function(e,t,i,n){var r=e,o=r.context,s=i.defines,a=i.__webglShader.uniforms,l=i.attributes,c=i.__webglShader.vertexShader,h=i.__webglShader.fragmentShader,u=i.index0AttributeName;void 0===u&&!0===n.morphTargets&&(u="position");var d="SHADOWMAP_TYPE_BASIC";n.shadowMapType===K.PCFShadowMap?d="SHADOWMAP_TYPE_PCF":n.shadowMapType===K.PCFSoftShadowMap&&(d="SHADOWMAP_TYPE_PCF_SOFT");var p="ENVMAP_TYPE_CUBE",f="ENVMAP_MODE_REFLECTION",m="ENVMAP_BLENDING_MULTIPLY";if(n.envMap){switch(i.envMap.mapping){case K.CubeReflectionMapping:case K.CubeRefractionMapping:p="ENVMAP_TYPE_CUBE";break;case K.EquirectangularReflectionMapping:case K.EquirectangularRefractionMapping:p="ENVMAP_TYPE_EQUIREC";break;case K.SphericalReflectionMapping:p="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case K.CubeRefractionMapping:case K.EquirectangularRefractionMapping:f="ENVMAP_MODE_REFRACTION"}switch(i.combine){case K.MultiplyOperation:m="ENVMAP_BLENDING_MULTIPLY";break;case K.MixOperation:m="ENVMAP_BLENDING_MIX";break;case K.AddOperation:m="ENVMAP_BLENDING_ADD"}}var g,v,y=e.gammaFactor>0?e.gammaFactor:1,b=function(e){var t,i,n=[];for(var r in e)!1!==(t=e[r])&&(i="#define "+r+" "+t,n.push(i));return n.join("\n")}(s),x=o.createProgram();i instanceof K.RawShaderMaterial?(g="",v=""):(g=["precision "+n.precision+" float;","precision "+n.precision+" int;",b,n.supportsVertexTextures?"#define VERTEX_TEXTURES":"",r.gammaInput?"#define GAMMA_INPUT":"",r.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+y,"#define MAX_DIR_LIGHTS "+n.maxDirLights,"#define MAX_POINT_LIGHTS "+n.maxPointLights,"#define MAX_SPOT_LIGHTS "+n.maxSpotLights,"#define MAX_HEMI_LIGHTS "+n.maxHemiLights,"#define MAX_SHADOWS "+n.maxShadows,"#define MAX_BONES "+n.maxBones,n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals?"#define USE_MORPHNORMALS":"",n.wrapAround?"#define WRAP_AROUND":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",n.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","attribute vec2 uv2;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif",""].join("\n"),v=["precision "+n.precision+" float;","precision "+n.precision+" int;",n.bumpMap||n.normalMap||n.flatShading?"#extension GL_OES_standard_derivatives : enable":"",b,"#define MAX_DIR_LIGHTS "+n.maxDirLights,"#define MAX_POINT_LIGHTS "+n.maxPointLights,"#define MAX_SPOT_LIGHTS "+n.maxSpotLights,"#define MAX_HEMI_LIGHTS "+n.maxHemiLights,"#define MAX_SHADOWS "+n.maxShadows,n.alphaTest?"#define ALPHATEST "+n.alphaTest:"",r.gammaInput?"#define GAMMA_INPUT":"",r.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+y,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.envMap?"#define "+f:"",n.envMap?"#define "+m:"",n.lightMap?"#define USE_LIGHTMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.flatShading?"#define FLAT_SHADED":"",n.metal?"#define METAL":"",n.wrapAround?"#define WRAP_AROUND":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",n.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].join("\n"));var _=new K.WebGLShader(o,o.VERTEX_SHADER,g+c),E=new K.WebGLShader(o,o.FRAGMENT_SHADER,v+h);o.attachShader(x,_),o.attachShader(x,E),void 0!==u&&o.bindAttribLocation(x,0,u),o.linkProgram(x);var A=o.getProgramInfoLog(x);!1===o.getProgramParameter(x,o.LINK_STATUS)&&K.error("THREE.WebGLProgram: shader error: "+o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(x,o.VALIDATE_STATUS),"gl.getPRogramInfoLog",A),""!==A&&K.warn("THREE.WebGLProgram: gl.getProgramInfoLog()"+A),o.deleteShader(_),o.deleteShader(E);var S=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","modelMatrix","cameraPosition","morphTargetInfluences","bindMatrix","bindMatrixInverse"];for(var w in n.useVertexTexture?(S.push("boneTexture"),S.push("boneTextureWidth"),S.push("boneTextureHeight")):S.push("boneGlobalMatrices"),n.logarithmicDepthBuffer&&S.push("logDepthBufFC"),a)S.push(w);this.uniforms=function(e,t,i){for(var n={},r=0,o=i.length;r<o;r++){var s=i[r];n[s]=e.getUniformLocation(t,s)}return n}(o,x,S),S=["position","normal","uv","uv2","tangent","color","skinIndex","skinWeight","lineDistance"];for(var M=0;M<n.maxMorphTargets;M++)S.push("morphTarget"+M);for(M=0;M<n.maxMorphNormals;M++)S.push("morphNormal"+M);for(var T in l)S.push(T);return this.attributes=function(e,t,i){for(var n={},r=0,o=i.length;r<o;r++){var s=i[r];n[s]=e.getAttribLocation(t,s)}return n}(o,x,S),this.attributesKeys=Object.keys(this.attributes),this.id=k++,this.code=t,this.usedTimes=1,this.program=x,this.vertexShader=_,this.fragmentShader=E,this}),K.WebGLShader=function(e,t,i){var n=e.createShader(t);return e.shaderSource(n,i),e.compileShader(n),!1===e.getShaderParameter(n,e.COMPILE_STATUS)&&K.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&K.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e.getShaderInfoLog(n),function(e){for(var t=e.split("\n"),i=0;i<t.length;i++)t[i]=i+1+": "+t[i];return t.join("\n")}(i)),n},K.WebGLState=function(e,t){var i=new Uint8Array(16),n=new Uint8Array(16),r=null,o=null,s=null,a=null,l=null,c=null,h=null,u=null,d=null,p=null,f=null,m=null,g=null,v=null,y=null,b=null;this.initAttributes=function(){for(var e=0,t=i.length;e<t;e++)i[e]=0},this.enableAttribute=function(t){i[t]=1,0===n[t]&&(e.enableVertexAttribArray(t),n[t]=1)},this.disableUnusedAttributes=function(){for(var t=0,r=n.length;t<r;t++)n[t]!==i[t]&&(e.disableVertexAttribArray(t),n[t]=0)},this.setBlending=function(i,n,u,d,p,f,m){i!==r&&(i===K.NoBlending?e.disable(e.BLEND):i===K.AdditiveBlending?(e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)):i===K.SubtractiveBlending?(e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR)):i===K.MultiplyBlending?(e.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR)):i===K.CustomBlending?e.enable(e.BLEND):(e.enable(e.BLEND),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)),r=i),i===K.CustomBlending?(p=p||n,f=f||u,m=m||d,n===o&&p===l||(e.blendEquationSeparate(t(n),t(p)),o=n,l=p),u===s&&d===a&&f===c&&m===h||(e.blendFuncSeparate(t(u),t(d),t(f),t(m)),s=u,a=d,c=f,h=m)):(o=null,s=null,a=null,l=null,c=null,h=null)},this.setDepthTest=function(t){u!==t&&(t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),u=t)},this.setDepthWrite=function(t){d!==t&&(e.depthMask(t),d=t)},this.setColorWrite=function(t){p!==t&&(e.colorMask(t,t,t,t),p=t)},this.setDoubleSided=function(t){f!==t&&(t?e.disable(e.CULL_FACE):e.enable(e.CULL_FACE),f=t)},this.setFlipSided=function(t){m!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),m=t)},this.setLineWidth=function(t){t!==g&&(e.lineWidth(t),g=t)},this.setPolygonOffset=function(t,i,n){v!==t&&(t?e.enable(e.POLYGON_OFFSET_FILL):e.disable(e.POLYGON_OFFSET_FILL),v=t),!t||y===i&&b===n||(e.polygonOffset(i,n),y=i,b=n)},this.reset=function(){for(var e=0;e<n.length;e++)n[e]=0;r=null,u=null,d=null,p=null,f=null,m=null}},K.LensFlarePlugin=function(e,t){var i,n,r,o,s,a,l,c,h=e.context,u=function(){var t,u=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),d=new Uint16Array([0,1,2,0,2,3]);i=h.createBuffer(),n=h.createBuffer(),h.bindBuffer(h.ARRAY_BUFFER,i),h.bufferData(h.ARRAY_BUFFER,u,h.STATIC_DRAW),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,n),h.bufferData(h.ELEMENT_ARRAY_BUFFER,d,h.STATIC_DRAW),l=h.createTexture(),c=h.createTexture(),h.bindTexture(h.TEXTURE_2D,l),h.texImage2D(h.TEXTURE_2D,0,h.RGB,16,16,0,h.RGB,h.UNSIGNED_BYTE,null),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.NEAREST),h.bindTexture(h.TEXTURE_2D,c),h.texImage2D(h.TEXTURE_2D,0,h.RGBA,16,16,0,h.RGBA,h.UNSIGNED_BYTE,null),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_S,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_WRAP_T,h.CLAMP_TO_EDGE),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MAG_FILTER,h.NEAREST),h.texParameteri(h.TEXTURE_2D,h.TEXTURE_MIN_FILTER,h.NEAREST),t=(a=h.getParameter(h.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0)?{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")}:{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["precision mediump float;","uniform lowp int renderType;","uniform sampler2D map;","uniform sampler2D occlusionMap;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;","visibility = ( 1.0 - visibility / 4.0 );","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * visibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},r=function(t){var i=h.createProgram(),n=h.createShader(h.FRAGMENT_SHADER),r=h.createShader(h.VERTEX_SHADER),o="precision "+e.getPrecision()+" float;\n";return h.shaderSource(n,o+t.fragmentShader),h.shaderSource(r,o+t.vertexShader),h.compileShader(n),h.compileShader(r),h.attachShader(i,n),h.attachShader(i,r),h.linkProgram(i),i}(t),o={vertex:h.getAttribLocation(r,"position"),uv:h.getAttribLocation(r,"uv")},s={renderType:h.getUniformLocation(r,"renderType"),map:h.getUniformLocation(r,"map"),occlusionMap:h.getUniformLocation(r,"occlusionMap"),opacity:h.getUniformLocation(r,"opacity"),color:h.getUniformLocation(r,"color"),scale:h.getUniformLocation(r,"scale"),rotation:h.getUniformLocation(r,"rotation"),screenPosition:h.getUniformLocation(r,"screenPosition")}};this.render=function(d,p,f,m){if(0!==t.length){var g=new K.Vector3,v=m/f,y=.5*f,b=.5*m,x=16/m,_=new K.Vector2(x*v,x),E=new K.Vector3(1,1,0),A=new K.Vector2(1,1);void 0===r&&u(),h.useProgram(r),h.enableVertexAttribArray(o.vertex),h.enableVertexAttribArray(o.uv),h.uniform1i(s.occlusionMap,0),h.uniform1i(s.map,1),h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(o.vertex,2,h.FLOAT,!1,16,0),h.vertexAttribPointer(o.uv,2,h.FLOAT,!1,16,8),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,n),h.disable(h.CULL_FACE),h.depthMask(!1);for(var S=0,w=t.length;S<w;S++){x=16/m,_.set(x*v,x);var M=t[S];if(g.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),g.applyMatrix4(p.matrixWorldInverse),g.applyProjection(p.projectionMatrix),E.copy(g),A.x=E.x*y+y,A.y=E.y*b+b,a||A.x>0&&A.x<f&&A.y>0&&A.y<m){h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,l),h.copyTexImage2D(h.TEXTURE_2D,0,h.RGB,A.x-8,A.y-8,16,16,0),h.uniform1i(s.renderType,0),h.uniform2f(s.scale,_.x,_.y),h.uniform3f(s.screenPosition,E.x,E.y,E.z),h.disable(h.BLEND),h.enable(h.DEPTH_TEST),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,c),h.copyTexImage2D(h.TEXTURE_2D,0,h.RGBA,A.x-8,A.y-8,16,16,0),h.uniform1i(s.renderType,1),h.disable(h.DEPTH_TEST),h.activeTexture(h.TEXTURE1),h.bindTexture(h.TEXTURE_2D,l),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0),M.positionScreen.copy(E),M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares(),h.uniform1i(s.renderType,2),h.enable(h.BLEND);for(var T=0,C=M.lensFlares.length;T<C;T++){var P=M.lensFlares[T];P.opacity>.001&&P.scale>.001&&(E.x=P.x,E.y=P.y,E.z=P.z,x=P.size*P.scale/m,_.x=x*v,_.y=x,h.uniform3f(s.screenPosition,E.x,E.y,E.z),h.uniform2f(s.scale,_.x,_.y),h.uniform1f(s.rotation,P.rotation),h.uniform1f(s.opacity,P.opacity),h.uniform3f(s.color,P.color.r,P.color.g,P.color.b),e.state.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),e.setTexture(P.texture,1),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0))}}}h.enable(h.CULL_FACE),h.enable(h.DEPTH_TEST),h.depthMask(!0),e.resetGLState()}}},K.ShadowMapPlugin=function(e,t,i,n){var r,o,s,a,l=e.context,c=new K.Frustum,h=new K.Matrix4,u=new K.Vector3,d=new K.Vector3,p=new K.Vector3,f=[],m=K.ShaderLib.depthRGBA,g=K.UniformsUtils.clone(m.uniforms);function v(e,t,n){if(t.visible){var r=i[t.id];if(r&&t.castShadow&&(!1===t.frustumCulled||!0===c.intersectsObject(t)))for(var o=0,s=r.length;o<s;o++){var a=r[o];t._modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),f.push(a)}for(o=0,s=t.children.length;o<s;o++)v(e,t.children[o],n)}}function y(e,t){var i=new K.DirectionalLight;i.isVirtual=!0,i.onlyShadow=!0,i.castShadow=!0,i.shadowCameraNear=e.shadowCameraNear,i.shadowCameraFar=e.shadowCameraFar,i.shadowCameraLeft=e.shadowCameraLeft,i.shadowCameraRight=e.shadowCameraRight,i.shadowCameraBottom=e.shadowCameraBottom,i.shadowCameraTop=e.shadowCameraTop,i.shadowCameraVisible=e.shadowCameraVisible,i.shadowDarkness=e.shadowDarkness,i.shadowBias=e.shadowCascadeBias[t],i.shadowMapWidth=e.shadowCascadeWidth[t],i.shadowMapHeight=e.shadowCascadeHeight[t],i.pointsWorld=[],i.pointsFrustum=[];for(var n=i.pointsWorld,r=i.pointsFrustum,o=0;o<8;o++)n[o]=new K.Vector3,r[o]=new K.Vector3;var s=e.shadowCascadeNearZ[t],a=e.shadowCascadeFarZ[t];return r[0].set(-1,-1,s),r[1].set(1,-1,s),r[2].set(-1,1,s),r[3].set(1,1,s),r[4].set(-1,-1,a),r[5].set(1,-1,a),r[6].set(-1,1,a),r[7].set(1,1,a),i}function b(e,t){var i=e.shadowCascadeArray[t];i.position.copy(e.position),i.target.position.copy(e.target.position),i.lookAt(i.target),i.shadowCameraVisible=e.shadowCameraVisible,i.shadowDarkness=e.shadowDarkness,i.shadowBias=e.shadowCascadeBias[t];var n=e.shadowCascadeNearZ[t],r=e.shadowCascadeFarZ[t],o=i.pointsFrustum;o[0].z=n,o[1].z=n,o[2].z=n,o[3].z=n,o[4].z=r,o[5].z=r,o[6].z=r,o[7].z=r}function x(e,t){var i=t.shadowCamera,n=t.pointsFrustum,r=t.pointsWorld;u.set(1/0,1/0,1/0),d.set(-1/0,-1/0,-1/0);for(var o=0;o<8;o++){var s=r[o];s.copy(n[o]),s.unproject(e),s.applyMatrix4(i.matrixWorldInverse),s.x<u.x&&(u.x=s.x),s.x>d.x&&(d.x=s.x),s.y<u.y&&(u.y=s.y),s.y>d.y&&(d.y=s.y),s.z<u.z&&(u.z=s.z),s.z>d.z&&(d.z=s.z)}i.left=u.x,i.right=d.x,i.top=d.y,i.bottom=u.y,i.updateProjectionMatrix()}function _(e){return e.material instanceof K.MeshFaceMaterial?e.material.materials[0]:e.material}r=new K.ShaderMaterial({uniforms:g,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader}),o=new K.ShaderMaterial({uniforms:g,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0}),s=new K.ShaderMaterial({uniforms:g,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,skinning:!0}),a=new K.ShaderMaterial({uniforms:g,vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,morphTargets:!0,skinning:!0}),r._shadowPass=!0,o._shadowPass=!0,s._shadowPass=!0,a._shadowPass=!0,this.render=function(i,u){if(!1!==e.shadowMapEnabled){var d,m,g,E,A,S,w,M,T,C,P,D,L,I=[],R=0,O=null;for(l.clearColor(1,1,1,1),l.disable(l.BLEND),l.enable(l.CULL_FACE),l.frontFace(l.CCW),e.shadowMapCullFace===K.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.BACK),e.state.setDepthTest(!0),d=0,m=t.length;d<m;d++)if((L=t[d]).castShadow)if(L instanceof K.DirectionalLight&&L.shadowCascade)for(A=0;A<L.shadowCascadeCount;A++){var N;if(L.shadowCascadeArray[A])N=L.shadowCascadeArray[A];else{(N=y(L,A)).originalCamera=u;var k=new K.Gyroscope;k.position.copy(L.shadowCascadeOffset),k.add(N),k.add(N.target),u.add(k),L.shadowCascadeArray[A]=N}b(L,A),I[R]=N,R++}else I[R]=L,R++;for(d=0,m=I.length;d<m;d++){if(!(L=I[d]).shadowMap){var F=K.LinearFilter;e.shadowMapType===K.PCFSoftShadowMap&&(F=K.NearestFilter);var V={minFilter:F,magFilter:F,format:K.RGBAFormat};L.shadowMap=new K.WebGLRenderTarget(L.shadowMapWidth,L.shadowMapHeight,V),L.shadowMapSize=new K.Vector2(L.shadowMapWidth,L.shadowMapHeight),L.shadowMatrix=new K.Matrix4}if(!L.shadowCamera){if(L instanceof K.SpotLight)L.shadowCamera=new K.PerspectiveCamera(L.shadowCameraFov,L.shadowMapWidth/L.shadowMapHeight,L.shadowCameraNear,L.shadowCameraFar);else{if(!(L instanceof K.DirectionalLight)){K.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",L);continue}L.shadowCamera=new K.OrthographicCamera(L.shadowCameraLeft,L.shadowCameraRight,L.shadowCameraTop,L.shadowCameraBottom,L.shadowCameraNear,L.shadowCameraFar)}i.add(L.shadowCamera),!0===i.autoUpdate&&i.updateMatrixWorld()}var U,B,z;for(L.shadowCameraVisible&&!L.cameraHelper&&(L.cameraHelper=new K.CameraHelper(L.shadowCamera),i.add(L.cameraHelper)),L.isVirtual&&N.originalCamera==u&&x(u,L),S=L.shadowMap,w=L.shadowMatrix,(M=L.shadowCamera).position.setFromMatrixPosition(L.matrixWorld),p.setFromMatrixPosition(L.target.matrixWorld),M.lookAt(p),M.updateMatrixWorld(),M.matrixWorldInverse.getInverse(M.matrixWorld),L.cameraHelper&&(L.cameraHelper.visible=L.shadowCameraVisible),L.shadowCameraVisible&&L.cameraHelper.update(),w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(M.projectionMatrix),w.multiply(M.matrixWorldInverse),h.multiplyMatrices(M.projectionMatrix,M.matrixWorldInverse),c.setFromMatrix(h),e.setRenderTarget(S),e.clear(),f.length=0,v(i,i,M),g=0,E=f.length;g<E;g++)D=(P=f[g]).object,T=P.buffer,U=_(D),B=void 0!==D.geometry.morphTargets&&D.geometry.morphTargets.length>0&&U.morphTargets,z=D instanceof K.SkinnedMesh&&U.skinning,C=D.customDepthMaterial?D.customDepthMaterial:z?B?a:s:B?o:r,e.setMaterialFaces(U),T instanceof K.BufferGeometry?e.renderBufferDirect(M,t,O,C,T,D):e.renderBuffer(M,t,O,C,T,D);for(g=0,E=n.length;g<E;g++)(D=(P=n[g]).object).visible&&D.castShadow&&(D._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,D.matrixWorld),e.renderImmediateObject(M,t,O,r,D))}var G=e.getClearColor(),H=e.getClearAlpha();l.clearColor(G.r,G.g,G.b,H),l.enable(l.BLEND),e.shadowMapCullFace===K.CullFaceFront&&l.cullFace(l.BACK),e.resetGLState()}}},K.SpritePlugin=function(e,t){var i,n,r,o,s,a,l=e.context,c=new K.Vector3,h=new K.Quaternion,u=new K.Vector3,d=function(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),c=new Uint16Array([0,1,2,0,2,3]);i=l.createBuffer(),n=l.createBuffer(),l.bindBuffer(l.ARRAY_BUFFER,i),l.bufferData(l.ARRAY_BUFFER,t,l.STATIC_DRAW),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,n),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),r=function(){var t=l.createProgram(),i=l.createShader(l.VERTEX_SHADER),n=l.createShader(l.FRAGMENT_SHADER);return l.shaderSource(i,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),l.shaderSource(n,["precision "+e.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),l.compileShader(i),l.compileShader(n),l.attachShader(t,i),l.attachShader(t,n),l.linkProgram(t),t}(),o={position:l.getAttribLocation(r,"position"),uv:l.getAttribLocation(r,"uv")},s={uvOffset:l.getUniformLocation(r,"uvOffset"),uvScale:l.getUniformLocation(r,"uvScale"),rotation:l.getUniformLocation(r,"rotation"),scale:l.getUniformLocation(r,"scale"),color:l.getUniformLocation(r,"color"),map:l.getUniformLocation(r,"map"),opacity:l.getUniformLocation(r,"opacity"),modelViewMatrix:l.getUniformLocation(r,"modelViewMatrix"),projectionMatrix:l.getUniformLocation(r,"projectionMatrix"),fogType:l.getUniformLocation(r,"fogType"),fogDensity:l.getUniformLocation(r,"fogDensity"),fogNear:l.getUniformLocation(r,"fogNear"),fogFar:l.getUniformLocation(r,"fogFar"),fogColor:l.getUniformLocation(r,"fogColor"),alphaTest:l.getUniformLocation(r,"alphaTest")};var h=document.createElement("canvas");h.width=8,h.height=8;var u=h.getContext("2d");u.fillStyle="white",u.fillRect(0,0,8,8),(a=new K.Texture(h)).needsUpdate=!0};function p(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}this.render=function(f,m){if(0!==t.length){void 0===r&&d(),l.useProgram(r),l.enableVertexAttribArray(o.position),l.enableVertexAttribArray(o.uv),l.disable(l.CULL_FACE),l.enable(l.BLEND),l.bindBuffer(l.ARRAY_BUFFER,i),l.vertexAttribPointer(o.position,2,l.FLOAT,!1,16,0),l.vertexAttribPointer(o.uv,2,l.FLOAT,!1,16,8),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,n),l.uniformMatrix4fv(s.projectionMatrix,!1,m.projectionMatrix.elements),l.activeTexture(l.TEXTURE0),l.uniform1i(s.map,0);var g=0,v=0,y=f.fog;y?(l.uniform3f(s.fogColor,y.color.r,y.color.g,y.color.b),y instanceof K.Fog?(l.uniform1f(s.fogNear,y.near),l.uniform1f(s.fogFar,y.far),l.uniform1i(s.fogType,1),g=1,v=1):y instanceof K.FogExp2&&(l.uniform1f(s.fogDensity,y.density),l.uniform1i(s.fogType,2),g=2,v=2)):(l.uniform1i(s.fogType,0),g=0,v=0);for(var b=0,x=t.length;b<x;b++){(E=t[b])._modelViewMatrix.multiplyMatrices(m.matrixWorldInverse,E.matrixWorld),E.z=-E._modelViewMatrix.elements[14]}t.sort(p);var _=[];for(b=0,x=t.length;b<x;b++){var E,A=(E=t[b]).material;l.uniform1f(s.alphaTest,A.alphaTest),l.uniformMatrix4fv(s.modelViewMatrix,!1,E._modelViewMatrix.elements),E.matrixWorld.decompose(c,h,u),_[0]=u.x,_[1]=u.y;var S=0;f.fog&&A.fog&&(S=v),g!==S&&(l.uniform1i(s.fogType,S),g=S),null!==A.map?(l.uniform2f(s.uvOffset,A.map.offset.x,A.map.offset.y),l.uniform2f(s.uvScale,A.map.repeat.x,A.map.repeat.y)):(l.uniform2f(s.uvOffset,0,0),l.uniform2f(s.uvScale,1,1)),l.uniform1f(s.opacity,A.opacity),l.uniform3f(s.color,A.color.r,A.color.g,A.color.b),l.uniform1f(s.rotation,A.rotation),l.uniform2fv(s.scale,_),e.state.setBlending(A.blending,A.blendEquation,A.blendSrc,A.blendDst),e.state.setDepthTest(A.depthTest),e.state.setDepthWrite(A.depthWrite),A.map&&A.map.image&&A.map.image.width?e.setTexture(A.map,0):e.setTexture(a,0),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0)}l.enable(l.CULL_FACE),e.resetGLState()}}},K.GeometryUtils={merge:function(e,t,i){var n;K.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t instanceof K.Mesh&&(t.matrixAutoUpdate&&t.updateMatrix(),n=t.matrix,t=t.geometry),e.merge(t,n,i)},center:function(e){return K.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},K.ImageUtils={crossOrigin:void 0,loadTexture:function(e,t,i,n){var r=new K.ImageLoader;r.crossOrigin=this.crossOrigin;var o=new K.Texture(void 0,t);return r.load(e,(function(e){o.image=e,o.needsUpdate=!0,i&&i(o)}),void 0,(function(e){n&&n(e)})),o.sourceFile=e,o},loadTextureCube:function(e,t,i,n){var r=new K.ImageLoader;r.crossOrigin=this.crossOrigin;var o=new K.CubeTexture([],t);o.flipY=!1;for(var s=0,a=function(t){r.load(e[t],(function(e){o.images[t]=e,6===(s+=1)&&(o.needsUpdate=!0,i&&i(o))}),void 0,n)},l=0,c=e.length;l<c;++l)a(l);return o},loadCompressedTexture:function(){K.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){K.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(e,t){var i=function(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]},n=function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]};t|=1;var r=e.width,o=e.height,s=document.createElement("canvas");s.width=r,s.height=o;var a=s.getContext("2d");a.drawImage(e,0,0);for(var l,c,h=a.getImageData(0,0,r,o).data,u=a.createImageData(r,o),d=u.data,p=0;p<r;p++)for(var f=0;f<o;f++){var m=f-1<0?0:f-1,g=f+1>o-1?o-1:f+1,v=p-1<0?0:p-1,y=p+1>r-1?r-1:p+1,b=[],x=[0,0,h[4*(f*r+p)]/255*t];b.push([-1,0,h[4*(f*r+v)]/255*t]),b.push([-1,-1,h[4*(m*r+v)]/255*t]),b.push([0,-1,h[4*(m*r+p)]/255*t]),b.push([1,-1,h[4*(m*r+y)]/255*t]),b.push([1,0,h[4*(f*r+y)]/255*t]),b.push([1,1,h[4*(g*r+y)]/255*t]),b.push([0,1,h[4*(g*r+p)]/255*t]),b.push([-1,1,h[4*(g*r+v)]/255*t]);for(var _=[],E=b.length,A=0;A<E;A++){var S=b[A],w=b[(A+1)%E];S=i(S,x),w=i(w,x),_.push(n((c=w,[(l=S)[1]*c[2]-l[2]*c[1],l[2]*c[0]-l[0]*c[2],l[0]*c[1]-l[1]*c[0]])))}var M=[0,0,0];for(A=0;A<_.length;A++)M[0]+=_[A][0],M[1]+=_[A][1],M[2]+=_[A][2];M[0]/=_.length,M[1]/=_.length,M[2]/=_.length;var T=4*(f*r+p);d[T]=(M[0]+1)/2*255|0,d[T+1]=(M[1]+1)/2*255|0,d[T+2]=255*M[2]|0,d[T+3]=255}return a.putImageData(u,0,0),s},generateDataTexture:function(e,t,i){for(var n=e*t,r=new Uint8Array(3*n),o=Math.floor(255*i.r),s=Math.floor(255*i.g),a=Math.floor(255*i.b),l=0;l<n;l++)r[3*l]=o,r[3*l+1]=s,r[3*l+2]=a;var c=new K.DataTexture(r,e,t,K.RGBFormat);return c.needsUpdate=!0,c}},K.SceneUtils={createMultiMaterialObject:function(e,t){for(var i=new K.Object3D,n=0,r=t.length;n<r;n++)i.add(new K.Mesh(e,t[n]));return i},detach:function(e,t,i){e.applyMatrix(t.matrixWorld),t.remove(e),i.add(e)},attach:function(e,t,i){var n=new K.Matrix4;n.getInverse(i.matrixWorld),e.applyMatrix(n),t.remove(e),i.add(e)}},K.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(e){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(e){var t=e.familyName.toLowerCase(),i=this;return i.faces[t]=i.faces[t]||{},i.faces[t][e.cssFontWeight]=i.faces[t][e.cssFontWeight]||{},i.faces[t][e.cssFontWeight][e.cssFontStyle]=e,i.faces[t][e.cssFontWeight][e.cssFontStyle]=e,e},drawText:function(e){var t,i=this.getFace(),n=this.size/i.resolution,r=0,o=String(e).split(""),s=o.length,a=[];for(t=0;t<s;t++){var l=new K.Path,c=this.extractGlyphPoints(o[t],i,n,r,l);r+=c.offset,a.push(c.path)}return{paths:a,offset:r/2}},extractGlyphPoints:function(e,t,i,n,r){var o,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,_,E,A=[],S=t.glyphs[e]||t.glyphs["?"];if(S){if(S.o)for(c=(l=S._cachedOutline||(S._cachedOutline=S.o.split(" "))).length,h=i,u=i,o=0;o<c;)switch(l[o++]){case"m":d=l[o++]*h+n,p=l[o++]*u,r.moveTo(d,p);break;case"l":d=l[o++]*h+n,p=l[o++]*u,r.lineTo(d,p);break;case"q":if(f=l[o++]*h+n,m=l[o++]*u,y=l[o++]*h+n,b=l[o++]*u,r.quadraticCurveTo(y,b,f,m),E=A[A.length-1])for(g=E.x,v=E.y,s=1,a=this.divisions;s<=a;s++){var w=s/a;K.Shape.Utils.b2(w,g,y,f),K.Shape.Utils.b2(w,v,b,m)}break;case"b":if(f=l[o++]*h+n,m=l[o++]*u,y=l[o++]*h+n,b=l[o++]*u,x=l[o++]*h+n,_=l[o++]*u,r.bezierCurveTo(y,b,x,_,f,m),E=A[A.length-1])for(g=E.x,v=E.y,s=1,a=this.divisions;s<=a;s++){w=s/a;K.Shape.Utils.b3(w,g,y,x,f),K.Shape.Utils.b3(w,v,b,_,m)}}return{offset:S.ha*i,path:r}}}},K.FontUtils.generateShapes=function(e,t){var i=void 0!==(t=t||{}).size?t.size:100,n=void 0!==t.curveSegments?t.curveSegments:4,r=void 0!==t.font?t.font:"helvetiker",o=void 0!==t.weight?t.weight:"normal",s=void 0!==t.style?t.style:"normal";K.FontUtils.size=i,K.FontUtils.divisions=n,K.FontUtils.face=r,K.FontUtils.weight=o,K.FontUtils.style=s;for(var a=K.FontUtils.drawText(e).paths,l=[],c=0,h=a.length;c<h;c++)Array.prototype.push.apply(l,a[c].toShapes());return l},F=K.FontUtils,V=1e-10,U=function(e){for(var t=e.length,i=0,n=t-1,r=0;r<t;n=r++)i+=e[n].x*e[r].y-e[r].x*e[n].y;return.5*i},B=function(e,t,i,n,r,o){var s,a,l,c,h,u,d,p,f,m,g,v,y,b,x;if(a=e[o[t]].x,l=e[o[t]].y,c=e[o[i]].x,h=e[o[i]].y,u=e[o[n]].x,d=e[o[n]].y,V>(c-a)*(d-l)-(h-l)*(u-a))return!1;for(m=u-c,g=d-h,v=a-u,y=l-d,b=c-a,x=h-l,s=0;s<r;s++)if(p=e[o[s]].x,f=e[o[s]].y,!(p===a&&f===l||p===c&&f===h||p===u&&f===d)&&m*(f-h)-g*(p-c)>=-1e-10&&v*(f-d)-y*(p-u)>=-1e-10&&b*(f-l)-x*(p-a)>=-1e-10)return!1;return!0},F.Triangulate=function(e,t){var i=e.length;if(i<3)return null;var n,r,o,s=[],a=[],l=[];if(U(e)>0)for(r=0;r<i;r++)a[r]=r;else for(r=0;r<i;r++)a[r]=i-1-r;var c=i,h=2*c;for(r=c-1;c>2;){if(h--<=0)return K.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()"),t?l:s;if(c<=(n=r)&&(n=0),c<=(r=n+1)&&(r=0),c<=(o=r+1)&&(o=0),B(e,n,r,o,c,a)){var u,d,p,f,m;for(u=a[n],d=a[r],p=a[o],s.push([e[u],e[d],e[p]]),l.push([a[n],a[r],a[o]]),f=r,m=r+1;m<c;f++,m++)a[f]=a[m];h=2*--c}}return t?l:s},F.Triangulate.area=U,K.Audio=function(e){K.Object3D.call(this),this.type="Audio",this.context=e.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},K.Audio.prototype=Object.create(K.Object3D.prototype),K.Audio.prototype.constructor=K.Audio,K.Audio.prototype.load=function(e){var t=this,i=new XMLHttpRequest;return i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(e){t.context.decodeAudioData(this.response,(function(e){t.source.buffer=e,t.autoplay&&t.play()}))},i.send(),this},K.Audio.prototype.play=function(){if(!0!==this.isPlaying){var e=this.context.createBufferSource();e.buffer=this.source.buffer,e.loop=this.source.loop,e.onended=this.source.onended,e.connect(this.panner),e.start(0,this.startTime),this.isPlaying=!0,this.source=e}else K.warn("THREE.Audio: Audio is already playing.")},K.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},K.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},K.Audio.prototype.onEnded=function(){this.isPlaying=!1},K.Audio.prototype.setLoop=function(e){this.source.loop=e},K.Audio.prototype.setRefDistance=function(e){this.panner.refDistance=e},K.Audio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e},K.Audio.prototype.setVolume=function(e){this.gain.gain.value=e},K.Audio.prototype.updateMatrixWorld=function(){var e=new K.Vector3;return function(t){K.Object3D.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}(),K.AudioListener=function(){K.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},K.AudioListener.prototype=Object.create(K.Object3D.prototype),K.AudioListener.prototype.constructor=K.AudioListener,K.AudioListener.prototype.updateMatrixWorld=function(){var e=new K.Vector3,t=new K.Quaternion,i=new K.Vector3,n=new K.Vector3,r=new K.Vector3,o=new K.Vector3;return function(s){K.Object3D.prototype.updateMatrixWorld.call(this,s);var a=this.context.listener,l=this.up;this.matrixWorld.decompose(e,t,i),n.set(0,0,-1).applyQuaternion(t),r.subVectors(e,o),a.setPosition(e.x,e.y,e.z),a.setOrientation(n.x,n.y,n.z,l.x,l.y,l.z),a.setVelocity(r.x,r.y,r.z),o.copy(e)}}(),K.Curve=function(){},K.Curve.prototype.getPoint=function(e){return K.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},K.Curve.prototype.getPointAt=function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},K.Curve.prototype.getPoints=function(e){e||(e=5);var t,i=[];for(t=0;t<=e;t++)i.push(this.getPoint(t/e));return i},K.Curve.prototype.getSpacedPoints=function(e){e||(e=5);var t,i=[];for(t=0;t<=e;t++)i.push(this.getPointAt(t/e));return i},K.Curve.prototype.getLength=function(){var e=this.getLengths();return e[e.length-1]},K.Curve.prototype.getLengths=function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,n=[],r=this.getPoint(0),o=0;for(n.push(0),i=1;i<=e;i++)o+=(t=this.getPoint(i/e)).distanceTo(r),n.push(o),r=t;return this.cacheArcLengths=n,n},K.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},K.Curve.prototype.getUtoTmapping=function(e,t){var i,n=this.getLengths(),r=0,o=n.length;i=t||e*n[o-1];for(var s,a=0,l=o-1;a<=l;)if((s=n[r=Math.floor(a+(l-a)/2)]-i)<0)a=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(n[r=l]==i)return r/(o-1);var c=n[r];return(r+(i-c)/(n[r+1]-c))/(o-1)},K.Curve.prototype.getTangent=function(e){var t=1e-4,i=e-t,n=e+t;i<0&&(i=0),n>1&&(n=1);var r=this.getPoint(i);return this.getPoint(n).clone().sub(r).normalize()},K.Curve.prototype.getTangentAt=function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},K.Curve.Utils={tangentQuadraticBezier:function(e,t,i,n){return 2*(1-e)*(i-t)+2*e*(n-i)},tangentCubicBezier:function(e,t,i,n,r){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*n*(1-e)-3*e*e*n+3*e*e*r},tangentSpline:function(e,t,i,n,r){return 6*e*e-6*e+(3*e*e-4*e+1)+(-6*e*e+6*e)+(3*e*e-2*e)},interpolate:function(e,t,i,n,r){var o=.5*(i-e),s=.5*(n-t),a=r*r;return(2*t-2*i+o+s)*(r*a)+(-3*t+3*i-2*o-s)*a+o*r+t}},K.Curve.create=function(e,t){return e.prototype=Object.create(K.Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},K.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},K.CurvePath.prototype=Object.create(K.Curve.prototype),K.CurvePath.prototype.constructor=K.CurvePath,K.CurvePath.prototype.add=function(e){this.curves.push(e)},K.CurvePath.prototype.checkConnection=function(){},K.CurvePath.prototype.closePath=function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new K.LineCurve(t,e))},K.CurvePath.prototype.getPoint=function(e){for(var t,i=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=i){var o=1-(n[r]-i)/(t=this.curves[r]).getLength();return t.getPointAt(o)}r++}return null},K.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]},K.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var e,t=[],i=0,n=this.curves.length;for(e=0;e<n;e++)i+=this.curves[e].getLength(),t.push(i);return this.cacheLengths=t,t},K.CurvePath.prototype.getBoundingBox=function(){var e,t,i,n,r,o,s,a,l,c,h=this.getPoints();e=t=Number.NEGATIVE_INFINITY,n=r=Number.POSITIVE_INFINITY;var u=h[0]instanceof K.Vector3;for(c=u?new K.Vector3:new K.Vector2,a=0,l=h.length;a<l;a++)(s=h[a]).x>e?e=s.x:s.x<n&&(n=s.x),s.y>t?t=s.y:s.y<r&&(r=s.y),u&&(s.z>i?i=s.z:s.z<o&&(o=s.z)),c.add(s);var d={minX:n,minY:r,maxX:e,maxY:t};return u&&(d.maxZ=i,d.minZ=o),d},K.CurvePath.prototype.createPointsGeometry=function(e){var t=this.getPoints(e,!0);return this.createGeometry(t)},K.CurvePath.prototype.createSpacedPointsGeometry=function(e){var t=this.getSpacedPoints(e,!0);return this.createGeometry(t)},K.CurvePath.prototype.createGeometry=function(e){for(var t=new K.Geometry,i=0;i<e.length;i++)t.vertices.push(new K.Vector3(e[i].x,e[i].y,e[i].z||0));return t},K.CurvePath.prototype.addWrapPath=function(e){this.bends.push(e)},K.CurvePath.prototype.getTransformedPoints=function(e,t){var i,n,r=this.getPoints(e);for(t||(t=this.bends),i=0,n=t.length;i<n;i++)r=this.getWrapPoints(r,t[i]);return r},K.CurvePath.prototype.getTransformedSpacedPoints=function(e,t){var i,n,r=this.getSpacedPoints(e);for(t||(t=this.bends),i=0,n=t.length;i<n;i++)r=this.getWrapPoints(r,t[i]);return r},K.CurvePath.prototype.getWrapPoints=function(e,t){var i,n,r,o,s,a,l=this.getBoundingBox();for(i=0,n=e.length;i<n;i++){o=(r=e[i]).x,s=r.y,a=o/l.maxX,a=t.getUtoTmapping(a,o);var c=t.getPoint(a),h=t.getTangent(a);h.set(-h.y,h.x).multiplyScalar(s),r.x=c.x+h.x,r.y=c.y+h.y}return e},K.Gyroscope=function(){K.Object3D.call(this)},K.Gyroscope.prototype=Object.create(K.Object3D.prototype),K.Gyroscope.prototype.constructor=K.Gyroscope,K.Gyroscope.prototype.updateMatrixWorld=(z=new K.Vector3,G=new K.Quaternion,H=new K.Vector3,W=new K.Vector3,j=new K.Quaternion,X=new K.Vector3,function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(W,j,X),this.matrix.decompose(z,G,H),this.matrixWorld.compose(W,G,X)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,i=this.children.length;t<i;t++)this.children[t].updateMatrixWorld(e)}),K.Path=function(e){K.CurvePath.call(this),this.actions=[],e&&this.fromPoints(e)},K.Path.prototype=Object.create(K.CurvePath.prototype),K.Path.prototype.constructor=K.Path,K.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},K.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y)},K.Path.prototype.moveTo=function(e,t){var i=Array.prototype.slice.call(arguments);this.actions.push({action:K.PathActions.MOVE_TO,args:i})},K.Path.prototype.lineTo=function(e,t){var i=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args,r=n[n.length-2],o=n[n.length-1],s=new K.LineCurve(new K.Vector2(r,o),new K.Vector2(e,t));this.curves.push(s),this.actions.push({action:K.PathActions.LINE_TO,args:i})},K.Path.prototype.quadraticCurveTo=function(e,t,i,n){var r=Array.prototype.slice.call(arguments),o=this.actions[this.actions.length-1].args,s=o[o.length-2],a=o[o.length-1],l=new K.QuadraticBezierCurve(new K.Vector2(s,a),new K.Vector2(e,t),new K.Vector2(i,n));this.curves.push(l),this.actions.push({action:K.PathActions.QUADRATIC_CURVE_TO,args:r})},K.Path.prototype.bezierCurveTo=function(e,t,i,n,r,o){var s=Array.prototype.slice.call(arguments),a=this.actions[this.actions.length-1].args,l=a[a.length-2],c=a[a.length-1],h=new K.CubicBezierCurve(new K.Vector2(l,c),new K.Vector2(e,t),new K.Vector2(i,n),new K.Vector2(r,o));this.curves.push(h),this.actions.push({action:K.PathActions.BEZIER_CURVE_TO,args:s})},K.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments),i=this.actions[this.actions.length-1].args,n=i[i.length-2],r=i[i.length-1],o=[new K.Vector2(n,r)];Array.prototype.push.apply(o,e);var s=new K.SplineCurve(o);this.curves.push(s),this.actions.push({action:K.PathActions.CSPLINE_THRU,args:t})},K.Path.prototype.arc=function(e,t,i,n,r,o){var s=this.actions[this.actions.length-1].args,a=s[s.length-2],l=s[s.length-1];this.absarc(e+a,t+l,i,n,r,o)},K.Path.prototype.absarc=function(e,t,i,n,r,o){this.absellipse(e,t,i,i,n,r,o)},K.Path.prototype.ellipse=function(e,t,i,n,r,o,s){var a=this.actions[this.actions.length-1].args,l=a[a.length-2],c=a[a.length-1];this.absellipse(e+l,t+c,i,n,r,o,s)},K.Path.prototype.absellipse=function(e,t,i,n,r,o,s){var a=Array.prototype.slice.call(arguments),l=new K.EllipseCurve(e,t,i,n,r,o,s);this.curves.push(l);var c=l.getPoint(1);a.push(c.x),a.push(c.y),this.actions.push({action:K.PathActions.ELLIPSE,args:a})},K.Path.prototype.getSpacedPoints=function(e,t){e||(e=40);for(var i=[],n=0;n<e;n++)i.push(this.getPoint(n/e));return i},K.Path.prototype.getPoints=function(e,t){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(e,t);e=e||12;var i,n,r,o,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x=[];for(i=0,n=this.actions.length;i<n;i++)switch(o=(r=this.actions[i]).action,s=r.args,o){case K.PathActions.MOVE_TO:case K.PathActions.LINE_TO:x.push(new K.Vector2(s[0],s[1]));break;case K.PathActions.QUADRATIC_CURVE_TO:for(a=s[2],l=s[3],u=s[0],d=s[1],x.length>0?(p=(m=x[x.length-1]).x,f=m.y):(p=(m=this.actions[i-1].args)[m.length-2],f=m[m.length-1]),g=1;g<=e;g++)v=g/e,y=K.Shape.Utils.b2(v,p,u,a),b=K.Shape.Utils.b2(v,f,d,l),x.push(new K.Vector2(y,b));break;case K.PathActions.BEZIER_CURVE_TO:for(a=s[4],l=s[5],u=s[0],d=s[1],c=s[2],h=s[3],x.length>0?(p=(m=x[x.length-1]).x,f=m.y):(p=(m=this.actions[i-1].args)[m.length-2],f=m[m.length-1]),g=1;g<=e;g++)v=g/e,y=K.Shape.Utils.b3(v,p,u,c,a),b=K.Shape.Utils.b3(v,f,d,h,l),x.push(new K.Vector2(y,b));break;case K.PathActions.CSPLINE_THRU:m=this.actions[i-1].args;var _=[new K.Vector2(m[m.length-2],m[m.length-1])],E=e*s[0].length;_=_.concat(s[0]);var A=new K.SplineCurve(_);for(g=1;g<=E;g++)x.push(A.getPointAt(g/E));break;case K.PathActions.ARC:var S=s[0],w=s[1],M=s[2],T=s[3],C=s[4],P=!!s[5],D=C-T,L=2*e;for(g=1;g<=L;g++)v=g/L,P||(v=1-v),I=T+v*D,y=S+M*Math.cos(I),b=w+M*Math.sin(I),x.push(new K.Vector2(y,b));break;case K.PathActions.ELLIPSE:S=s[0],w=s[1];var I,R=s[2],O=s[3];T=s[4],C=s[5],P=!!s[6],D=C-T,L=2*e;for(g=1;g<=L;g++)v=g/L,P||(v=1-v),I=T+v*D,y=S+R*Math.cos(I),b=w+O*Math.sin(I),x.push(new K.Vector2(y,b))}var N=x[x.length-1];return Math.abs(N.x-x[0].x)<1e-10&&Math.abs(N.y-x[0].y)<1e-10&&x.splice(x.length-1,1),t&&x.push(x[0]),x},K.Path.prototype.toShapes=function(e,t){function i(e){for(var t=[],i=0,n=e.length;i<n;i++){var r=e[i],o=new K.Shape;o.actions=r.actions,o.curves=r.curves,t.push(o)}return t}function n(e,t){for(var i=t.length,n=!1,r=i-1,o=0;o<i;r=o++){var s=t[r],a=t[o],l=a.x-s.x,c=a.y-s.y;if(Math.abs(c)>1e-10){if(c<0&&(s=t[o],l=-l,a=t[r],c=-c),e.y<s.y||e.y>a.y)continue;if(e.y==s.y){if(e.x==s.x)return!0}else{var h=c*(e.x-s.x)-l*(e.y-s.y);if(0==h)return!0;if(h<0)continue;n=!n}}else{if(e.y!=s.y)continue;if(a.x<=e.x&&e.x<=s.x||s.x<=e.x&&e.x<=a.x)return!0}}return n}var r=function(e){var t,i,n,r,o,s=[],a=new K.Path;for(t=0,i=e.length;t<i;t++)o=(n=e[t]).args,(r=n.action)==K.PathActions.MOVE_TO&&0!=a.actions.length&&(s.push(a),a=new K.Path),a[r].apply(a,o);return 0!=a.actions.length&&s.push(a),s}(this.actions);if(0==r.length)return[];if(!0===t)return i(r);var o,s,a,l=[];if(1==r.length)return s=r[0],(a=new K.Shape).actions=s.actions,a.curves=s.curves,l.push(a),l;var c=!K.Shape.Utils.isClockWise(r[0].getPoints());c=e?!c:c;var h,u,d,p,f,m,g=[],v=[],y=[],b=0;for(v[b]=void 0,y[b]=[],u=0,d=r.length;u<d;u++)h=(s=r[u]).getPoints(),o=K.Shape.Utils.isClockWise(h),(o=e?!o:o)?(!c&&v[b]&&b++,v[b]={s:new K.Shape,p:h},v[b].s.actions=s.actions,v[b].s.curves=s.curves,c&&b++,y[b]=[]):y[b].push({h:s,p:h[0]});if(!v[0])return i(r);if(v.length>1){for(var x=!1,_=[],E=0,A=v.length;E<A;E++)g[E]=[];for(E=0,A=v.length;E<A;E++)for(var S=y[E],w=0;w<S.length;w++){for(var M=S[w],T=!0,C=0;C<v.length;C++)n(M.p,v[C].p)&&(E!=C&&_.push({froms:E,tos:C,hole:w}),T?(T=!1,g[C].push(M)):x=!0);T&&g[E].push(M)}_.length>0&&(x||(y=g))}for(u=0,d=v.length;u<d;u++)for(a=v[u].s,l.push(a),f=0,m=(p=y[u]).length;f<m;f++)a.holes.push(p[f].h);return l},K.Shape=function(){K.Path.apply(this,arguments),this.holes=[]},K.Shape.prototype=Object.create(K.Path.prototype),K.Shape.prototype.constructor=K.Shape,K.Shape.prototype.extrude=function(e){return new K.ExtrudeGeometry(this,e)},K.Shape.prototype.makeGeometry=function(e){return new K.ShapeGeometry(this,e)},K.Shape.prototype.getPointsHoles=function(e){var t,i=this.holes.length,n=[];for(t=0;t<i;t++)n[t]=this.holes[t].getTransformedPoints(e,this.bends);return n},K.Shape.prototype.getSpacedPointsHoles=function(e){var t,i=this.holes.length,n=[];for(t=0;t<i;t++)n[t]=this.holes[t].getTransformedSpacedPoints(e,this.bends);return n},K.Shape.prototype.extractAllPoints=function(e){return{shape:this.getTransformedPoints(e),holes:this.getPointsHoles(e)}},K.Shape.prototype.extractPoints=function(e){return this.useSpacedPoints?this.extractAllSpacedPoints(e):this.extractAllPoints(e)},K.Shape.prototype.extractAllSpacedPoints=function(e){return{shape:this.getTransformedSpacedPoints(e),holes:this.getSpacedPointsHoles(e)}},K.Shape.Utils={triangulateShape:function(e,t){function i(e,t,i){return e.x!=t.x?e.x<t.x?e.x<=i.x&&i.x<=t.x:t.x<=i.x&&i.x<=e.x:e.y<t.y?e.y<=i.y&&i.y<=t.y:t.y<=i.y&&i.y<=e.y}function n(e,t,n,r,o){var s=t.x-e.x,a=t.y-e.y,l=r.x-n.x,c=r.y-n.y,h=e.x-n.x,u=e.y-n.y,d=a*l-s*c,p=a*h-s*u;if(Math.abs(d)>1e-10){var f;if(d>0){if(p<0||p>d)return[];if((f=c*h-l*u)<0||f>d)return[]}else{if(p>0||p<d)return[];if((f=c*h-l*u)>0||f<d)return[]}if(0==f)return!o||0!=p&&p!=d?[e]:[];if(f==d)return!o||0!=p&&p!=d?[t]:[];if(0==p)return[n];if(p==d)return[r];var m=f/d;return[{x:e.x+m*s,y:e.y+m*a}]}if(0!=p||c*h!=l*u)return[];var g,v,y,b,x,_,E,A,S=0==s&&0==a,w=0==l&&0==c;return S&&w?e.x!=n.x||e.y!=n.y?[]:[e]:S?i(n,r,e)?[e]:[]:w?i(e,t,n)?[n]:[]:(0!=s?(e.x<t.x?(g=e,y=e.x,v=t,b=t.x):(g=t,y=t.x,v=e,b=e.x),n.x<r.x?(x=n,E=n.x,_=r,A=r.x):(x=r,E=r.x,_=n,A=n.x)):(e.y<t.y?(g=e,y=e.y,v=t,b=t.y):(g=t,y=t.y,v=e,b=e.y),n.y<r.y?(x=n,E=n.y,_=r,A=r.y):(x=r,E=r.y,_=n,A=n.y)),y<=E?b<E?[]:b==E?o?[]:[x]:b<=A?[x,v]:[x,_]:y>A?[]:y==A?o?[]:[g]:b<=A?[g,v]:[g,_])}function r(e,t,i,n){var r=t.x-e.x,o=t.y-e.y,s=i.x-e.x,a=i.y-e.y,l=n.x-e.x,c=n.y-e.y,h=r*a-o*s,u=r*c-o*l;if(Math.abs(h)>1e-10){var d=l*a-c*s;return h>0?u>=0&&d>=0:u>=0||d>=0}return u>0}for(var o,s,a,l,c,h,u={},d=e.concat(),p=0,f=t.length;p<f;p++)Array.prototype.push.apply(d,t[p]);for(o=0,s=d.length;o<s;o++)void 0!==u[c=d[o].x+":"+d[o].y]&&K.warn("THREE.Shape: Duplicate point",c),u[c]=o;var m=function(e,t){var i,o=e.concat();function s(e,t){var n=o.length-1,s=e-1;s<0&&(s=n);var a=e+1;a>n&&(a=0);var l=r(o[e],o[s],o[a],i[t]);if(!l)return!1;var c=i.length-1,h=t-1;h<0&&(h=c);var u=t+1;return u>c&&(u=0),!!(l=r(i[t],i[h],i[u],o[e]))}function a(e,t){var i,r;for(i=0;i<o.length;i++)if(r=i+1,r%=o.length,n(e,t,o[i],o[r],!0).length>0)return!0;return!1}var l=[];function c(e,i){var r,o,s,a;for(r=0;r<l.length;r++)for(o=t[l[r]],s=0;s<o.length;s++)if(a=s+1,a%=o.length,n(e,i,o[s],o[a],!0).length>0)return!0;return!1}for(var h,u,d,p,f,m,g,v,y,b,x=[],_=0,E=t.length;_<E;_++)l.push(_);for(var A=0,S=2*l.length;l.length>0;){if(--S<0){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(u=A;u<o.length;u++){d=o[u],h=-1;for(_=0;_<l.length;_++)if(f=l[_],void 0===x[m=d.x+":"+d.y+":"+f]){i=t[f];for(var w=0;w<i.length;w++)if(p=i[w],s(u,w)&&!a(d,p)&&!c(d,p)){h=w,l.splice(_,1),g=o.slice(0,u+1),v=o.slice(u),y=i.slice(h),b=i.slice(0,h+1),o=g.concat(y).concat(b).concat(v),A=u;break}if(h>=0)break;x[m]=!0}if(h>=0)break}}return o}(e,t),g=K.FontUtils.Triangulate(m,!1);for(o=0,s=g.length;o<s;o++)for(l=g[o],a=0;a<3;a++)void 0!==(h=u[c=l[a].x+":"+l[a].y])&&(l[a]=h);return g.concat()},isClockWise:function(e){return K.FontUtils.Triangulate.area(e)<0},b2p0:function(e,t){var i=1-e;return i*i*t},b2p1:function(e,t){return 2*(1-e)*e*t},b2p2:function(e,t){return e*e*t},b2:function(e,t,i,n){return this.b2p0(e,t)+this.b2p1(e,i)+this.b2p2(e,n)},b3p0:function(e,t){var i=1-e;return i*i*i*t},b3p1:function(e,t){var i=1-e;return 3*i*i*e*t},b3p2:function(e,t){return 3*(1-e)*e*e*t},b3p3:function(e,t){return e*e*e*t},b3:function(e,t,i,n,r){return this.b3p0(e,t)+this.b3p1(e,i)+this.b3p2(e,n)+this.b3p3(e,r)}},K.LineCurve=function(e,t){this.v1=e,this.v2=t},K.LineCurve.prototype=Object.create(K.Curve.prototype),K.LineCurve.prototype.constructor=K.LineCurve,K.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},K.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)},K.LineCurve.prototype.getTangent=function(e){return this.v2.clone().sub(this.v1).normalize()},K.QuadraticBezierCurve=function(e,t,i){this.v0=e,this.v1=t,this.v2=i},K.QuadraticBezierCurve.prototype=Object.create(K.Curve.prototype),K.QuadraticBezierCurve.prototype.constructor=K.QuadraticBezierCurve,K.QuadraticBezierCurve.prototype.getPoint=function(e){var t=new K.Vector2;return t.x=K.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),t.y=K.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),t},K.QuadraticBezierCurve.prototype.getTangent=function(e){var t=new K.Vector2;return t.x=K.Curve.Utils.tangentQuadraticBezier(e,this.v0.x,this.v1.x,this.v2.x),t.y=K.Curve.Utils.tangentQuadraticBezier(e,this.v0.y,this.v1.y,this.v2.y),t.normalize()},K.CubicBezierCurve=function(e,t,i,n){this.v0=e,this.v1=t,this.v2=i,this.v3=n},K.CubicBezierCurve.prototype=Object.create(K.Curve.prototype),K.CubicBezierCurve.prototype.constructor=K.CubicBezierCurve,K.CubicBezierCurve.prototype.getPoint=function(e){var t,i;return t=K.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),i=K.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new K.Vector2(t,i)},K.CubicBezierCurve.prototype.getTangent=function(e){var t,i;t=K.Curve.Utils.tangentCubicBezier(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),i=K.Curve.Utils.tangentCubicBezier(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y);var n=new K.Vector2(t,i);return n.normalize(),n},K.SplineCurve=function(e){this.points=null==e?[]:e},K.SplineCurve.prototype=Object.create(K.Curve.prototype),K.SplineCurve.prototype.constructor=K.SplineCurve,K.SplineCurve.prototype.getPoint=function(e){var t=this.points,i=(t.length-1)*e,n=Math.floor(i),r=i-n,o=t[0==n?n:n-1],s=t[n],a=t[n>t.length-2?t.length-1:n+1],l=t[n>t.length-3?t.length-1:n+2],c=new K.Vector2;return c.x=K.Curve.Utils.interpolate(o.x,s.x,a.x,l.x,r),c.y=K.Curve.Utils.interpolate(o.y,s.y,a.y,l.y,r),c},K.EllipseCurve=function(e,t,i,n,r,o,s){this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=s},K.EllipseCurve.prototype=Object.create(K.Curve.prototype),K.EllipseCurve.prototype.constructor=K.EllipseCurve,K.EllipseCurve.prototype.getPoint=function(e){var t,i=this.aEndAngle-this.aStartAngle;i<0&&(i+=2*Math.PI),i>2*Math.PI&&(i-=2*Math.PI),t=!0===this.aClockwise?this.aEndAngle+(1-e)*(2*Math.PI-i):this.aStartAngle+e*i;var n=new K.Vector2;return n.x=this.aX+this.xRadius*Math.cos(t),n.y=this.aY+this.yRadius*Math.sin(t),n},K.ArcCurve=function(e,t,i,n,r,o){K.EllipseCurve.call(this,e,t,i,i,n,r,o)},K.ArcCurve.prototype=Object.create(K.EllipseCurve.prototype),K.ArcCurve.prototype.constructor=K.ArcCurve,K.LineCurve3=K.Curve.create((function(e,t){this.v1=e,this.v2=t}),(function(e){var t=new K.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t})),K.QuadraticBezierCurve3=K.Curve.create((function(e,t,i){this.v0=e,this.v1=t,this.v2=i}),(function(e){var t=new K.Vector3;return t.x=K.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),t.y=K.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),t.z=K.Shape.Utils.b2(e,this.v0.z,this.v1.z,this.v2.z),t})),K.CubicBezierCurve3=K.Curve.create((function(e,t,i,n){this.v0=e,this.v1=t,this.v2=i,this.v3=n}),(function(e){var t=new K.Vector3;return t.x=K.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t.y=K.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t.z=K.Shape.Utils.b3(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z),t})),K.SplineCurve3=K.Curve.create((function(e){this.points=null==e?[]:e}),(function(e){var t=this.points,i=(t.length-1)*e,n=Math.floor(i),r=i-n,o=t[0==n?n:n-1],s=t[n],a=t[n>t.length-2?t.length-1:n+1],l=t[n>t.length-3?t.length-1:n+2],c=new K.Vector3;return c.x=K.Curve.Utils.interpolate(o.x,s.x,a.x,l.x,r),c.y=K.Curve.Utils.interpolate(o.y,s.y,a.y,l.y,r),c.z=K.Curve.Utils.interpolate(o.z,s.z,a.z,l.z,r),c})),K.ClosedSplineCurve3=K.Curve.create((function(e){this.points=null==e?[]:e}),(function(e){var t=this.points,i=(t.length-0)*e,n=Math.floor(i),r=i-n,o=t[((n+=n>0?0:(Math.floor(Math.abs(n)/t.length)+1)*t.length)-1)%t.length],s=t[n%t.length],a=t[(n+1)%t.length],l=t[(n+2)%t.length],c=new K.Vector3;return c.x=K.Curve.Utils.interpolate(o.x,s.x,a.x,l.x,r),c.y=K.Curve.Utils.interpolate(o.y,s.y,a.y,l.y,r),c.z=K.Curve.Utils.interpolate(o.z,s.z,a.z,l.z,r),c})),K.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){K.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){K.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){K.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(e){if(!0===e.initialized)return e;for(var t=0;t<e.hierarchy.length;t++){for(var i=0;i<e.hierarchy[t].keys.length;i++)if(e.hierarchy[t].keys[i].time<0&&(e.hierarchy[t].keys[i].time=0),void 0!==e.hierarchy[t].keys[i].rot&&!(e.hierarchy[t].keys[i].rot instanceof K.Quaternion)){var n=e.hierarchy[t].keys[i].rot;e.hierarchy[t].keys[i].rot=(new K.Quaternion).fromArray(n)}if(e.hierarchy[t].keys.length&&void 0!==e.hierarchy[t].keys[0].morphTargets){var r={};for(i=0;i<e.hierarchy[t].keys.length;i++)for(var o=0;o<e.hierarchy[t].keys[i].morphTargets.length;o++){r[a=e.hierarchy[t].keys[i].morphTargets[o]]=-1}e.hierarchy[t].usedMorphTargets=r;for(i=0;i<e.hierarchy[t].keys.length;i++){var s={};for(var a in r){for(o=0;o<e.hierarchy[t].keys[i].morphTargets.length;o++)if(e.hierarchy[t].keys[i].morphTargets[o]===a){s[a]=e.hierarchy[t].keys[i].morphTargetsInfluences[o];break}o===e.hierarchy[t].keys[i].morphTargets.length&&(s[a]=0)}e.hierarchy[t].keys[i].morphTargetsInfluences=s}}for(i=1;i<e.hierarchy[t].keys.length;i++)e.hierarchy[t].keys[i].time===e.hierarchy[t].keys[i-1].time&&(e.hierarchy[t].keys.splice(i,1),i--);for(i=0;i<e.hierarchy[t].keys.length;i++)e.hierarchy[t].keys[i].index=i}return e.initialized=!0,e},parse:function(e){var t=function(e,i){i.push(e);for(var n=0;n<e.children.length;n++)t(e.children[n],i)},i=[];if(e instanceof K.SkinnedMesh)for(var n=0;n<e.skeleton.bones.length;n++)i.push(e.skeleton.bones[n]);else t(e,i);return i},play:function(e){-1===this.animations.indexOf(e)&&this.animations.push(e)},stop:function(e){var t=this.animations.indexOf(e);-1!==t&&this.animations.splice(t,1)},update:function(e){for(var t=0;t<this.animations.length;t++)this.animations[t].resetBlendWeights();for(t=0;t<this.animations.length;t++)this.animations[t].update(e)}},K.Animation=function(e,t){this.root=e,this.data=K.AnimationHandler.init(t),this.hierarchy=K.AnimationHandler.parse(e),this.currentTime=0,this.timeScale=1,this.isPlaying=!1,this.loop=!0,this.weight=0,this.interpolationType=K.AnimationHandler.LINEAR},K.Animation.prototype={constructor:K.Animation,keyTypes:["pos","rot","scl"],play:function(e,t){this.currentTime=void 0!==e?e:0,this.weight=void 0!==t?t:1,this.isPlaying=!0,this.reset(),K.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1,K.AnimationHandler.stop(this)},reset:function(){for(var e=0,t=this.hierarchy.length;e<t;e++){var i=this.hierarchy[e];void 0===i.animationCache&&(i.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var n=this.data.name,r=i.animationCache.animations,o=r[n];void 0===o&&(o={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:i.matrix},r[n]=o);for(var s=0;s<3;s++){for(var a=this.keyTypes[s],l=this.data.hierarchy[e].keys[0],c=this.getNextKeyWith(a,e,1);c.time<this.currentTime&&c.index>l.index;)l=c,c=this.getNextKeyWith(a,e,c.index+1);o.prevKey[a]=l,o.nextKey[a]=c}}},resetBlendWeights:function(){for(var e=0,t=this.hierarchy.length;e<t;e++){var i=this.hierarchy[e].animationCache;if(void 0!==i){var n=i.blending;n.positionWeight=0,n.quaternionWeight=0,n.scaleWeight=0}}},update:function(){var e=[],t=new K.Vector3,i=new K.Vector3,n=new K.Quaternion,r=function(e,t){var i,n,r,s,a,l,c,h,u,d=[],p=[];return r=(i=(e.length-1)*t)-(n=Math.floor(i)),d[0]=0===n?n:n-1,d[1]=n,d[2]=n>e.length-2?n:n+1,d[3]=n>e.length-3?n:n+2,l=e[d[0]],c=e[d[1]],h=e[d[2]],u=e[d[3]],a=r*(s=r*r),p[0]=o(l[0],c[0],h[0],u[0],r,s,a),p[1]=o(l[1],c[1],h[1],u[1],r,s,a),p[2]=o(l[2],c[2],h[2],u[2],r,s,a),p},o=function(e,t,i,n,r,o,s){var a=.5*(i-e),l=.5*(n-t);return(2*(t-i)+a+l)*s+(-3*(t-i)-2*a-l)*o+a*r+t};return function(o){if(!1!==this.isPlaying&&(this.currentTime+=o*this.timeScale,0!==this.weight)){var s=this.data.length;(this.currentTime>s||this.currentTime<0)&&(this.loop?(this.currentTime%=s,this.currentTime<0&&(this.currentTime+=s),this.reset()):this.stop());for(var a=0,l=this.hierarchy.length;a<l;a++)for(var c=this.hierarchy[a],h=c.animationCache.animations[this.data.name],u=c.animationCache.blending,d=0;d<3;d++){var p=this.keyTypes[d],f=h.prevKey[p],m=h.nextKey[p];if(this.timeScale>0&&m.time<=this.currentTime||this.timeScale<0&&f.time>=this.currentTime){for(f=this.data.hierarchy[a].keys[0],m=this.getNextKeyWith(p,a,1);m.time<this.currentTime&&m.index>f.index;)f=m,m=this.getNextKeyWith(p,a,m.index+1);h.prevKey[p]=f,h.nextKey[p]=m}var g=(this.currentTime-f.time)/(m.time-f.time),v=f[p],y=m[p];if(g<0&&(g=0),g>1&&(g=1),"pos"===p){if(this.interpolationType===K.AnimationHandler.LINEAR){i.x=v[0]+(y[0]-v[0])*g,i.y=v[1]+(y[1]-v[1])*g,i.z=v[2]+(y[2]-v[2])*g;var b=this.weight/(this.weight+u.positionWeight);c.position.lerp(i,b),u.positionWeight+=this.weight}else if(this.interpolationType===K.AnimationHandler.CATMULLROM||this.interpolationType===K.AnimationHandler.CATMULLROM_FORWARD){e[0]=this.getPrevKeyWith("pos",a,f.index-1).pos,e[1]=v,e[2]=y,e[3]=this.getNextKeyWith("pos",a,m.index+1).pos;var x=r(e,g=.33*g+.33);b=this.weight/(this.weight+u.positionWeight);u.positionWeight+=this.weight;var _=c.position;if(_.x=_.x+(x[0]-_.x)*b,_.y=_.y+(x[1]-_.y)*b,_.z=_.z+(x[2]-_.z)*b,this.interpolationType===K.AnimationHandler.CATMULLROM_FORWARD){var E=r(e,1.01*g);t.set(E[0],E[1],E[2]),t.sub(_),t.y=0,t.normalize();var A=Math.atan2(t.x,t.z);c.rotation.set(0,A,0)}}}else if("rot"===p)if(K.Quaternion.slerp(v,y,n,g),0===u.quaternionWeight)c.quaternion.copy(n),u.quaternionWeight=this.weight;else{b=this.weight/(this.weight+u.quaternionWeight);K.Quaternion.slerp(c.quaternion,n,c.quaternion,b),u.quaternionWeight+=this.weight}else if("scl"===p){i.x=v[0]+(y[0]-v[0])*g,i.y=v[1]+(y[1]-v[1])*g,i.z=v[2]+(y[2]-v[2])*g;b=this.weight/(this.weight+u.scaleWeight);c.scale.lerp(i,b),u.scaleWeight+=this.weight}}return!0}}}(),getNextKeyWith:function(e,t,i){var n=this.data.hierarchy[t].keys;for(this.interpolationType===K.AnimationHandler.CATMULLROM||this.interpolationType===K.AnimationHandler.CATMULLROM_FORWARD?i=i<n.length-1?i:n.length-1:i%=n.length;i<n.length;i++)if(void 0!==n[i][e])return n[i];return this.data.hierarchy[t].keys[0]},getPrevKeyWith:function(e,t,i){var n=this.data.hierarchy[t].keys;for(i=this.interpolationType===K.AnimationHandler.CATMULLROM||this.interpolationType===K.AnimationHandler.CATMULLROM_FORWARD?i>0?i:0:i>=0?i:i+n.length;i>=0;i--)if(void 0!==n[i][e])return n[i];return this.data.hierarchy[t].keys[n.length-1]}},K.KeyFrameAnimation=function(e){this.root=e.node,this.data=K.AnimationHandler.init(e),this.hierarchy=K.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.isPaused=!0,this.loop=!0;for(var t=0,i=this.hierarchy.length;t<i;t++){var n=this.data.hierarchy[t].keys,r=this.data.hierarchy[t].sids,o=this.hierarchy[t];if(n.length&&r){for(var s=0;s<r.length;s++){var a=r[s],l=this.getNextKeyWith(a,t,0);l&&l.apply(a)}o.matrixAutoUpdate=!1,this.data.hierarchy[t].node.updateMatrix(),o.matrixWorldNeedsUpdate=!0}}},K.KeyFrameAnimation.prototype={constructor:K.KeyFrameAnimation,play:function(e){if(this.currentTime=void 0!==e?e:0,!1===this.isPlaying){this.isPlaying=!0;var t,i,n,r=this.hierarchy.length;for(t=0;t<r;t++){i=this.hierarchy[t],void 0===(n=this.data.hierarchy[t]).animationCache&&(n.animationCache={},n.animationCache.prevKey=null,n.animationCache.nextKey=null,n.animationCache.originalMatrix=i.matrix);var o=this.data.hierarchy[t].keys;o.length&&(n.animationCache.prevKey=o[0],n.animationCache.nextKey=o[1],this.startTime=Math.min(o[0].time,this.startTime),this.endTime=Math.max(o[o.length-1].time,this.endTime))}this.update(0)}this.isPaused=!1,K.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1,this.isPaused=!1,K.AnimationHandler.stop(this);for(var e=0;e<this.data.hierarchy.length;e++){var t=this.hierarchy[e],i=this.data.hierarchy[e];if(void 0!==i.animationCache){var n=i.animationCache.originalMatrix;n.copy(t.matrix),t.matrix=n,delete i.animationCache}}},update:function(e){if(!1!==this.isPlaying){this.currentTime+=e*this.timeScale;var t=this.data.length;!0===this.loop&&this.currentTime>t&&(this.currentTime%=t),this.currentTime=Math.min(this.currentTime,t);for(var i=0,n=this.hierarchy.length;i<n;i++){var r=this.hierarchy[i],o=this.data.hierarchy[i],s=o.keys,a=o.animationCache;if(s.length){var l=a.prevKey,c=a.nextKey;if(c.time<=this.currentTime){for(;c.time<this.currentTime&&c.index>l.index;)c=s[(l=c).index+1];a.prevKey=l,a.nextKey=c}c.time>=this.currentTime?l.interpolate(c,this.currentTime):l.interpolate(c,c.time),this.data.hierarchy[i].node.updateMatrix(),r.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(e,t,i){var n=this.data.hierarchy[t].keys;for(i%=n.length;i<n.length;i++)if(n[i].hasTarget(e))return n[i];return n[0]},getPrevKeyWith:function(e,t,i){var n=this.data.hierarchy[t].keys;for(i=i>=0?i:i+n.length;i>=0;i--)if(n[i].hasTarget(e))return n[i];return n[n.length-1]}},K.MorphAnimation=function(e){this.mesh=e,this.frames=e.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.lastFrame=0,this.currentFrame=0,this.isPlaying=!1},K.MorphAnimation.prototype={constructor:K.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(e){if(!1!==this.isPlaying){this.currentTime+=e,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration);var t=this.duration/this.frames,i=Math.floor(this.currentTime/t),n=this.mesh.morphTargetInfluences;i!=this.currentFrame&&(n[this.lastFrame]=0,n[this.currentFrame]=1,n[i]=0,this.lastFrame=this.currentFrame,this.currentFrame=i),n[i]=this.currentTime%t/t,n[this.lastFrame]=1-n[i]}}},K.BoxGeometry=function(e,t,i,n,r,o){K.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:o},this.widthSegments=n||1,this.heightSegments=r||1,this.depthSegments=o||1;var s=this,a=e/2,l=t/2,c=i/2;function h(e,t,i,n,r,o,a,l){var c,h,u,d=s.widthSegments,p=s.heightSegments,f=r/2,m=o/2,g=s.vertices.length;"x"===e&&"y"===t||"y"===e&&"x"===t?c="z":"x"===e&&"z"===t||"z"===e&&"x"===t?(c="y",p=s.depthSegments):("z"===e&&"y"===t||"y"===e&&"z"===t)&&(c="x",d=s.depthSegments);var v=d+1,y=p+1,b=r/d,x=o/p,_=new K.Vector3;for(_[c]=a>0?1:-1,u=0;u<y;u++)for(h=0;h<v;h++){var E=new K.Vector3;E[e]=(h*b-f)*i,E[t]=(u*x-m)*n,E[c]=a,s.vertices.push(E)}for(u=0;u<p;u++)for(h=0;h<d;h++){var A=h+v*u,S=h+v*(u+1),w=h+1+v*(u+1),M=h+1+v*u,T=new K.Vector2(h/d,1-u/p),C=new K.Vector2(h/d,1-(u+1)/p),P=new K.Vector2((h+1)/d,1-(u+1)/p),D=new K.Vector2((h+1)/d,1-u/p),L=new K.Face3(A+g,S+g,M+g);L.normal.copy(_),L.vertexNormals.push(_.clone(),_.clone(),_.clone()),L.materialIndex=l,s.faces.push(L),s.faceVertexUvs[0].push([T,C,D]),(L=new K.Face3(S+g,w+g,M+g)).normal.copy(_),L.vertexNormals.push(_.clone(),_.clone(),_.clone()),L.materialIndex=l,s.faces.push(L),s.faceVertexUvs[0].push([C.clone(),P,D.clone()])}}h("z","y",-1,-1,i,t,a,0),h("z","y",1,-1,i,t,-a,1),h("x","z",1,1,e,i,l,2),h("x","z",1,-1,e,i,-l,3),h("x","y",1,-1,e,t,c,4),h("x","y",-1,-1,e,t,-c,5),this.mergeVertices()},K.BoxGeometry.prototype=Object.create(K.Geometry.prototype),K.BoxGeometry.prototype.constructor=K.BoxGeometry,K.CircleGeometry=function(e,t,i,n){K.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:n},e=e||50,t=void 0!==t?Math.max(3,t):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;var r,o=[],s=new K.Vector3,a=new K.Vector2(.5,.5);for(this.vertices.push(s),o.push(a),r=0;r<=t;r++){var l=new K.Vector3,c=i+r/t*n;l.x=e*Math.cos(c),l.y=e*Math.sin(c),this.vertices.push(l),o.push(new K.Vector2((l.x/e+1)/2,(l.y/e+1)/2))}var h=new K.Vector3(0,0,1);for(r=1;r<=t;r++)this.faces.push(new K.Face3(r,r+1,0,[h.clone(),h.clone(),h.clone()])),this.faceVertexUvs[0].push([o[r].clone(),o[r+1].clone(),a.clone()]);this.computeFaceNormals(),this.boundingSphere=new K.Sphere(new K.Vector3,e)},K.CircleGeometry.prototype=Object.create(K.Geometry.prototype),K.CircleGeometry.prototype.constructor=K.CircleGeometry,K.CubeGeometry=function(e,t,i,n,r,o){return K.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new K.BoxGeometry(e,t,i,n,r,o)},K.CylinderGeometry=function(e,t,i,n,r,o,s,a){K.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a},e=void 0!==e?e:20,t=void 0!==t?t:20,i=void 0!==i?i:100,n=n||8,r=r||1,o=void 0!==o&&o,s=void 0!==s?s:0,a=void 0!==a?a:2*Math.PI;var l,c,h=i/2,u=[],d=[];for(c=0;c<=r;c++){var p=[],f=[],m=c/r,g=m*(t-e)+e;for(l=0;l<=n;l++){var v=l/n,y=new K.Vector3;y.x=g*Math.sin(v*a+s),y.y=-m*i+h,y.z=g*Math.cos(v*a+s),this.vertices.push(y),p.push(this.vertices.length-1),f.push(new K.Vector2(v,1-m))}u.push(p),d.push(f)}var b,x,_=(t-e)/i;for(l=0;l<n;l++)for(0!==e?(b=this.vertices[u[0][l]].clone(),x=this.vertices[u[0][l+1]].clone()):(b=this.vertices[u[1][l]].clone(),x=this.vertices[u[1][l+1]].clone()),b.setY(Math.sqrt(b.x*b.x+b.z*b.z)*_).normalize(),x.setY(Math.sqrt(x.x*x.x+x.z*x.z)*_).normalize(),c=0;c<r;c++){var E=u[c][l],A=u[c+1][l],S=u[c+1][l+1],w=u[c][l+1],M=b.clone(),T=b.clone(),C=x.clone(),P=x.clone(),D=d[c][l].clone(),L=d[c+1][l].clone(),I=d[c+1][l+1].clone(),R=d[c][l+1].clone();this.faces.push(new K.Face3(E,A,w,[M,T,P])),this.faceVertexUvs[0].push([D,L,R]),this.faces.push(new K.Face3(A,S,w,[T.clone(),C,P.clone()])),this.faceVertexUvs[0].push([L.clone(),I,R.clone()])}if(!1===o&&e>0)for(this.vertices.push(new K.Vector3(0,h,0)),l=0;l<n;l++){E=u[0][l],A=u[0][l+1],S=this.vertices.length-1,M=new K.Vector3(0,1,0),T=new K.Vector3(0,1,0),C=new K.Vector3(0,1,0),D=d[0][l].clone(),L=d[0][l+1].clone(),I=new K.Vector2(L.x,0);this.faces.push(new K.Face3(E,A,S,[M,T,C])),this.faceVertexUvs[0].push([D,L,I])}if(!1===o&&t>0)for(this.vertices.push(new K.Vector3(0,-h,0)),l=0;l<n;l++){E=u[r][l+1],A=u[r][l],S=this.vertices.length-1,M=new K.Vector3(0,-1,0),T=new K.Vector3(0,-1,0),C=new K.Vector3(0,-1,0),D=d[r][l+1].clone(),L=d[r][l].clone(),I=new K.Vector2(L.x,1);this.faces.push(new K.Face3(E,A,S,[M,T,C])),this.faceVertexUvs[0].push([D,L,I])}this.computeFaceNormals()},K.CylinderGeometry.prototype=Object.create(K.Geometry.prototype),K.CylinderGeometry.prototype.constructor=K.CylinderGeometry,K.ExtrudeGeometry=function(e,t){void 0!==e?(K.Geometry.call(this),this.type="ExtrudeGeometry",e=e instanceof Array?e:[e],this.addShapeList(e,t),this.computeFaceNormals()):e=[]},K.ExtrudeGeometry.prototype=Object.create(K.Geometry.prototype),K.ExtrudeGeometry.prototype.constructor=K.ExtrudeGeometry,K.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var i=e.length,n=0;n<i;n++){var r=e[n];this.addShape(r,t)}},K.ExtrudeGeometry.prototype.addShape=function(e,t){var i,n,r,o,s,a,l,c,h=void 0!==t.amount?t.amount:100,u=void 0!==t.bevelThickness?t.bevelThickness:6,d=void 0!==t.bevelSize?t.bevelSize:u-2,p=void 0!==t.bevelSegments?t.bevelSegments:3,f=void 0===t.bevelEnabled||t.bevelEnabled,m=void 0!==t.curveSegments?t.curveSegments:12,g=void 0!==t.steps?t.steps:1,v=t.extrudePath,y=!1,b=t.material,x=t.extrudeMaterial,_=void 0!==t.UVGenerator?t.UVGenerator:K.ExtrudeGeometry.WorldUVGenerator;v&&(i=v.getSpacedPoints(g),y=!0,f=!1,n=void 0!==t.frames?t.frames:new K.TubeGeometry.FrenetFrames(v,g,!1),r=new K.Vector3,o=new K.Vector3,s=new K.Vector3),f||(p=0,u=0,d=0);var E=this,A=this.vertices.length,S=e.extractPoints(m),w=S.shape,M=S.holes,T=!K.Shape.Utils.isClockWise(w);if(T){for(w=w.reverse(),l=0,c=M.length;l<c;l++)a=M[l],K.Shape.Utils.isClockWise(a)&&(M[l]=a.reverse());T=!1}var C=K.Shape.Utils.triangulateShape(w,M),P=w;for(l=0,c=M.length;l<c;l++)a=M[l],w=w.concat(a);function D(e,t,i){return t||K.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}var L,I,R,O,N,k,F=w.length,V=C.length;function U(e,t,i){var n,r,o=1e-10,s=1,a=e.x-t.x,l=e.y-t.y,c=i.x-e.x,h=i.y-e.y,u=a*a+l*l,d=a*h-l*c;if(Math.abs(d)>o){var p=Math.sqrt(u),f=Math.sqrt(c*c+h*h),m=t.x-l/p,g=t.y+a/p,v=((i.x-h/f-m)*h-(i.y+c/f-g)*c)/(a*h-l*c),y=(n=m+a*v-e.x)*n+(r=g+l*v-e.y)*r;if(y<=2)return new K.Vector2(n,r);s=Math.sqrt(y/2)}else{var b=!1;a>o?c>o&&(b=!0):a<-1e-10?c<-1e-10&&(b=!0):Math.sign(l)==Math.sign(h)&&(b=!0),b?(n=-l,r=a,s=Math.sqrt(u)):(n=a,r=l,s=Math.sqrt(u/2))}return new K.Vector2(n/s,r/s)}for(var B=[],z=0,G=P.length,H=G-1,W=z+1;z<G;z++,H++,W++)H===G&&(H=0),W===G&&(W=0),B[z]=U(P[z],P[H],P[W]);var j,X,q=[],Y=B.concat();for(l=0,c=M.length;l<c;l++){for(a=M[l],j=[],z=0,H=(G=a.length)-1,W=z+1;z<G;z++,H++,W++)H===G&&(H=0),W===G&&(W=0),j[z]=U(a[z],a[H],a[W]);q.push(j),Y=Y.concat(j)}for(L=0;L<p;L++){for(O=u*(1-(R=L/p)),I=d*Math.sin(R*Math.PI/2),z=0,G=P.length;z<G;z++)Q((N=D(P[z],B[z],I)).x,N.y,-O);for(l=0,c=M.length;l<c;l++)for(a=M[l],j=q[l],z=0,G=a.length;z<G;z++)Q((N=D(a[z],j[z],I)).x,N.y,-O)}for(I=d,z=0;z<F;z++)N=f?D(w[z],Y[z],I):w[z],y?(o.copy(n.normals[0]).multiplyScalar(N.x),r.copy(n.binormals[0]).multiplyScalar(N.y),s.copy(i[0]).add(o).add(r),Q(s.x,s.y,s.z)):Q(N.x,N.y,0);for(X=1;X<=g;X++)for(z=0;z<F;z++)N=f?D(w[z],Y[z],I):w[z],y?(o.copy(n.normals[X]).multiplyScalar(N.x),r.copy(n.binormals[X]).multiplyScalar(N.y),s.copy(i[X]).add(o).add(r),Q(s.x,s.y,s.z)):Q(N.x,N.y,h/g*X);for(L=p-1;L>=0;L--){for(O=u*(1-(R=L/p)),I=d*Math.sin(R*Math.PI/2),z=0,G=P.length;z<G;z++)Q((N=D(P[z],B[z],I)).x,N.y,h+O);for(l=0,c=M.length;l<c;l++)for(a=M[l],j=q[l],z=0,G=a.length;z<G;z++)N=D(a[z],j[z],I),y?Q(N.x,N.y+i[g-1].y,i[g-1].x+O):Q(N.x,N.y,h+O)}function Z(e,t){var i,n;for(z=e.length;--z>=0;){i=z,(n=z-1)<0&&(n=e.length-1);var r=0,o=g+2*p;for(r=0;r<o;r++){var s=F*r,a=F*(r+1);$(t+i+s,t+n+s,t+n+a,t+i+a,e,r,o,i,n)}}}function Q(e,t,i){E.vertices.push(new K.Vector3(e,t,i))}function J(e,t,i){e+=A,t+=A,i+=A,E.faces.push(new K.Face3(e,t,i,null,null,b));var n=_.generateTopUV(E,e,t,i);E.faceVertexUvs[0].push(n)}function $(e,t,i,n,r,o,s,a,l){e+=A,t+=A,i+=A,n+=A,E.faces.push(new K.Face3(e,t,n,null,null,x)),E.faces.push(new K.Face3(t,i,n,null,null,x));var c=_.generateSideWallUV(E,e,t,i,n);E.faceVertexUvs[0].push([c[0],c[1],c[3]]),E.faceVertexUvs[0].push([c[1],c[2],c[3]])}!function(){if(f){var e=0,t=F*e;for(z=0;z<V;z++)J((k=C[z])[2]+t,k[1]+t,k[0]+t);for(t=F*(e=g+2*p),z=0;z<V;z++)J((k=C[z])[0]+t,k[1]+t,k[2]+t)}else{for(z=0;z<V;z++)J((k=C[z])[2],k[1],k[0]);for(z=0;z<V;z++)J((k=C[z])[0]+F*g,k[1]+F*g,k[2]+F*g)}}(),function(){var e=0;for(Z(P,e),e+=P.length,l=0,c=M.length;l<c;l++)Z(a=M[l],e),e+=a.length}()},K.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,i,n){var r=e.vertices,o=r[t],s=r[i],a=r[n];return[new K.Vector2(o.x,o.y),new K.Vector2(s.x,s.y),new K.Vector2(a.x,a.y)]},generateSideWallUV:function(e,t,i,n,r){var o=e.vertices,s=o[t],a=o[i],l=o[n],c=o[r];return Math.abs(s.y-a.y)<.01?[new K.Vector2(s.x,1-s.z),new K.Vector2(a.x,1-a.z),new K.Vector2(l.x,1-l.z),new K.Vector2(c.x,1-c.z)]:[new K.Vector2(s.y,1-s.z),new K.Vector2(a.y,1-a.z),new K.Vector2(l.y,1-l.z),new K.Vector2(c.y,1-c.z)]}},K.ShapeGeometry=function(e,t){K.Geometry.call(this),this.type="ShapeGeometry",e instanceof Array==!1&&(e=[e]),this.addShapeList(e,t),this.computeFaceNormals()},K.ShapeGeometry.prototype=Object.create(K.Geometry.prototype),K.ShapeGeometry.prototype.constructor=K.ShapeGeometry,K.ShapeGeometry.prototype.addShapeList=function(e,t){for(var i=0,n=e.length;i<n;i++)this.addShape(e[i],t);return this},K.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var i,n,r,o=void 0!==t.curveSegments?t.curveSegments:12,s=t.material,a=void 0===t.UVGenerator?K.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator,l=this.vertices.length,c=e.extractPoints(o),h=c.shape,u=c.holes,d=!K.Shape.Utils.isClockWise(h);if(d){for(h=h.reverse(),i=0,n=u.length;i<n;i++)r=u[i],K.Shape.Utils.isClockWise(r)&&(u[i]=r.reverse());d=!1}var p=K.Shape.Utils.triangulateShape(h,u);for(i=0,n=u.length;i<n;i++)r=u[i],h=h.concat(r);var f,m,g=h.length,v=p.length;for(i=0;i<g;i++)f=h[i],this.vertices.push(new K.Vector3(f.x,f.y,0));for(i=0;i<v;i++){var y=(m=p[i])[0]+l,b=m[1]+l,x=m[2]+l;this.faces.push(new K.Face3(y,b,x,null,null,s)),this.faceVertexUvs[0].push(a.generateTopUV(this,y,b,x))}},K.LatheGeometry=function(e,t,i,n){K.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:n},t=t||12,i=i||0,n=n||2*Math.PI;for(var r=1/(e.length-1),o=1/t,s=0,a=t;s<=a;s++)for(var l=i+s*o*n,c=Math.cos(l),h=Math.sin(l),u=0,d=e.length;u<d;u++){var p=e[u],f=new K.Vector3;f.x=c*p.x-h*p.y,f.y=h*p.x+c*p.y,f.z=p.z,this.vertices.push(f)}var m=e.length;for(s=0,a=t;s<a;s++)for(u=0,d=e.length-1;u<d;u++){var g=u+m*s,v=g,y=g+m,b=(c=g+1+m,g+1),x=s*o,_=u*r,E=x+o,A=_+r;this.faces.push(new K.Face3(v,y,b)),this.faceVertexUvs[0].push([new K.Vector2(x,_),new K.Vector2(E,_),new K.Vector2(x,A)]),this.faces.push(new K.Face3(y,c,b)),this.faceVertexUvs[0].push([new K.Vector2(E,_),new K.Vector2(E,A),new K.Vector2(x,A)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},K.LatheGeometry.prototype=Object.create(K.Geometry.prototype),K.LatheGeometry.prototype.constructor=K.LatheGeometry,K.PlaneGeometry=function(e,t,i,n){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),K.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new K.PlaneBufferGeometry(e,t,i,n))},K.PlaneGeometry.prototype=Object.create(K.Geometry.prototype),K.PlaneGeometry.prototype.constructor=K.PlaneGeometry,K.PlaneBufferGeometry=function(e,t,i,n){K.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:n};for(var r=e/2,o=t/2,s=i||1,a=n||1,l=s+1,c=a+1,h=e/s,u=t/a,d=new Float32Array(l*c*3),p=new Float32Array(l*c*3),f=new Float32Array(l*c*2),m=0,g=0,v=0;v<c;v++)for(var y=v*u-o,b=0;b<l;b++){var x=b*h-r;d[m]=x,d[m+1]=-y,p[m+2]=1,f[g]=b/s,f[g+1]=1-v/a,m+=3,g+=2}m=0;var _=new(d.length/3>65535?Uint32Array:Uint16Array)(s*a*6);for(v=0;v<a;v++)for(b=0;b<s;b++){var E=b+l*v,A=b+l*(v+1),S=b+1+l*(v+1),w=b+1+l*v;_[m]=E,_[m+1]=A,_[m+2]=w,_[m+3]=A,_[m+4]=S,_[m+5]=w,m+=6}this.setAttribute("index",new K.BufferAttribute(_,1)),this.setAttribute("position",new K.BufferAttribute(d,3)),this.setAttribute("normal",new K.BufferAttribute(p,3)),this.setAttribute("uv",new K.BufferAttribute(f,2))},K.PlaneBufferGeometry.prototype=Object.create(K.BufferGeometry.prototype),K.PlaneBufferGeometry.prototype.constructor=K.PlaneBufferGeometry,K.RingGeometry=function(e,t,i,n,r,o){K.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:o},e=e||0,t=t||50,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8;var s,a,l=[],c=e,h=(t-e)/(n=void 0!==n?Math.max(1,n):8);for(s=0;s<n+1;s++){for(a=0;a<i+1;a++){var u=new K.Vector3,d=r+a/i*o;u.x=c*Math.cos(d),u.y=c*Math.sin(d),this.vertices.push(u),l.push(new K.Vector2((u.x/t+1)/2,(u.y/t+1)/2))}c+=h}var p=new K.Vector3(0,0,1);for(s=0;s<n;s++){var f=s*(i+1);for(a=0;a<i;a++){var m=d=a+f,g=d+i+1,v=d+i+2;this.faces.push(new K.Face3(m,g,v,[p.clone(),p.clone(),p.clone()])),this.faceVertexUvs[0].push([l[m].clone(),l[g].clone(),l[v].clone()]),m=d,g=d+i+2,v=d+1,this.faces.push(new K.Face3(m,g,v,[p.clone(),p.clone(),p.clone()])),this.faceVertexUvs[0].push([l[m].clone(),l[g].clone(),l[v].clone()])}}this.computeFaceNormals(),this.boundingSphere=new K.Sphere(new K.Vector3,c)},K.RingGeometry.prototype=Object.create(K.Geometry.prototype),K.RingGeometry.prototype.constructor=K.RingGeometry,K.SphereGeometry=function(e,t,i,n,r,o,s){K.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:n,phiLength:r,thetaStart:o,thetaLength:s},e=e||50,t=Math.max(3,Math.floor(t)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,s=void 0!==s?s:Math.PI;var a,l,c=[],h=[];for(l=0;l<=i;l++){var u=[],d=[];for(a=0;a<=t;a++){var p=a/t,f=l/i,m=new K.Vector3;m.x=-e*Math.cos(n+p*r)*Math.sin(o+f*s),m.y=e*Math.cos(o+f*s),m.z=e*Math.sin(n+p*r)*Math.sin(o+f*s),this.vertices.push(m),u.push(this.vertices.length-1),d.push(new K.Vector2(p,1-f))}c.push(u),h.push(d)}for(l=0;l<i;l++)for(a=0;a<t;a++){var g=c[l][a+1],v=c[l][a],y=c[l+1][a],b=c[l+1][a+1],x=this.vertices[g].clone().normalize(),_=this.vertices[v].clone().normalize(),E=this.vertices[y].clone().normalize(),A=this.vertices[b].clone().normalize(),S=h[l][a+1].clone(),w=h[l][a].clone(),M=h[l+1][a].clone(),T=h[l+1][a+1].clone();Math.abs(this.vertices[g].y)===e?(S.x=(S.x+w.x)/2,this.faces.push(new K.Face3(g,y,b,[x,E,A])),this.faceVertexUvs[0].push([S,M,T])):Math.abs(this.vertices[y].y)===e?(M.x=(M.x+T.x)/2,this.faces.push(new K.Face3(g,v,y,[x,_,E])),this.faceVertexUvs[0].push([S,w,M])):(this.faces.push(new K.Face3(g,v,b,[x,_,A])),this.faceVertexUvs[0].push([S,w,T]),this.faces.push(new K.Face3(v,y,b,[_.clone(),E,A.clone()])),this.faceVertexUvs[0].push([w.clone(),M,T.clone()]))}this.computeFaceNormals(),this.boundingSphere=new K.Sphere(new K.Vector3,e)},K.SphereGeometry.prototype=Object.create(K.Geometry.prototype),K.SphereGeometry.prototype.constructor=K.SphereGeometry,K.TextGeometry=function(e,t){t=t||{};var i=K.FontUtils.generateShapes(e,t);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),K.ExtrudeGeometry.call(this,i,t),this.type="TextGeometry"},K.TextGeometry.prototype=Object.create(K.ExtrudeGeometry.prototype),K.TextGeometry.prototype.constructor=K.TextGeometry,K.TorusGeometry=function(e,t,i,n,r){K.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,arc:r},e=e||100,t=t||40,i=i||8,n=n||6,r=r||2*Math.PI;for(var o=new K.Vector3,s=[],a=[],l=0;l<=i;l++)for(var c=0;c<=n;c++){var h=c/n*r,u=l/i*Math.PI*2;o.x=e*Math.cos(h),o.y=e*Math.sin(h);var d=new K.Vector3;d.x=(e+t*Math.cos(u))*Math.cos(h),d.y=(e+t*Math.cos(u))*Math.sin(h),d.z=t*Math.sin(u),this.vertices.push(d),s.push(new K.Vector2(c/n,l/i)),a.push(d.clone().sub(o).normalize())}for(l=1;l<=i;l++)for(c=1;c<=n;c++){var p=(n+1)*l+c-1,f=(n+1)*(l-1)+c-1,m=(n+1)*(l-1)+c,g=(n+1)*l+c,v=new K.Face3(p,f,g,[a[p].clone(),a[f].clone(),a[g].clone()]);this.faces.push(v),this.faceVertexUvs[0].push([s[p].clone(),s[f].clone(),s[g].clone()]),v=new K.Face3(f,m,g,[a[f].clone(),a[m].clone(),a[g].clone()]),this.faces.push(v),this.faceVertexUvs[0].push([s[f].clone(),s[m].clone(),s[g].clone()])}this.computeFaceNormals()},K.TorusGeometry.prototype=Object.create(K.Geometry.prototype),K.TorusGeometry.prototype.constructor=K.TorusGeometry,K.TorusKnotGeometry=function(e,t,i,n,r,o,s){K.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:n,p:r,q:o,heightScale:s},e=e||100,t=t||40,i=i||64,n=n||8,r=r||2,o=o||3,s=s||1;for(var a=new Array(i),l=new K.Vector3,c=new K.Vector3,h=new K.Vector3,u=0;u<i;++u){a[u]=new Array(n);var d=u/i*2*r*Math.PI,p=D(d,o,r,e,s),f=D(d+.01,o,r,e,s);l.subVectors(f,p),c.addVectors(f,p),h.crossVectors(l,c),c.crossVectors(h,l),h.normalize(),c.normalize();for(var m=0;m<n;++m){var g=m/n*2*Math.PI,v=-t*Math.cos(g),y=t*Math.sin(g),b=new K.Vector3;b.x=p.x+v*c.x+y*h.x,b.y=p.y+v*c.y+y*h.y,b.z=p.z+v*c.z+y*h.z,a[u][m]=this.vertices.push(b)-1}}for(u=0;u<i;++u)for(m=0;m<n;++m){var x=(u+1)%i,_=(m+1)%n,E=a[u][m],A=a[x][m],S=a[x][_],w=a[u][_],M=new K.Vector2(u/i,m/n),T=new K.Vector2((u+1)/i,m/n),C=new K.Vector2((u+1)/i,(m+1)/n),P=new K.Vector2(u/i,(m+1)/n);this.faces.push(new K.Face3(E,A,w)),this.faceVertexUvs[0].push([M,T,P]),this.faces.push(new K.Face3(A,S,w)),this.faceVertexUvs[0].push([T.clone(),C,P.clone()])}function D(e,t,i,n,r){var o=Math.cos(e),s=Math.sin(e),a=t/i*e,l=Math.cos(a),c=n*(2+l)*.5*o,h=n*(2+l)*s*.5,u=r*n*Math.sin(a)*.5;return new K.Vector3(c,h,u)}this.computeFaceNormals(),this.computeVertexNormals()},K.TorusKnotGeometry.prototype=Object.create(K.Geometry.prototype),K.TorusKnotGeometry.prototype.constructor=K.TorusKnotGeometry,K.TubeGeometry=function(e,t,i,n,r,o){K.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:e,segments:t,radius:i,radialSegments:n,closed:r},t=t||64,i=i||1,n=n||8,r=r||!1,o=o||K.TubeGeometry.NoTaper;var s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M=[],T=this,C=t+1,P=new K.Vector3,D=new K.TubeGeometry.FrenetFrames(e,t,r),L=D.tangents,I=D.normals,R=D.binormals;function O(e,t,i){return T.vertices.push(new K.Vector3(e,t,i))-1}for(this.tangents=L,this.normals=I,this.binormals=R,f=0;f<C;f++)for(M[f]=[],l=f/(C-1),p=e.getPointAt(l),L[f],s=I[f],a=R[f],h=i*o(l),m=0;m<n;m++)c=m/n*2*Math.PI,u=-h*Math.cos(c),d=h*Math.sin(c),P.copy(p),P.x+=u*s.x+d*a.x,P.y+=u*s.y+d*a.y,P.z+=u*s.z+d*a.z,M[f][m]=O(P.x,P.y,P.z);for(f=0;f<t;f++)for(m=0;m<n;m++)g=r?(f+1)%t:f+1,v=(m+1)%n,y=M[f][m],b=M[g][m],x=M[g][v],_=M[f][v],E=new K.Vector2(f/t,m/n),A=new K.Vector2((f+1)/t,m/n),S=new K.Vector2((f+1)/t,(m+1)/n),w=new K.Vector2(f/t,(m+1)/n),this.faces.push(new K.Face3(y,b,_)),this.faceVertexUvs[0].push([E,A,w]),this.faces.push(new K.Face3(b,x,_)),this.faceVertexUvs[0].push([A.clone(),S,w.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},K.TubeGeometry.prototype=Object.create(K.Geometry.prototype),K.TubeGeometry.prototype.constructor=K.TubeGeometry,K.TubeGeometry.NoTaper=function(e){return 1},K.TubeGeometry.SinusoidalTaper=function(e){return Math.sin(Math.PI*e)},K.TubeGeometry.FrenetFrames=function(e,t,i){var n,r,o,s,a,l,c,h=new K.Vector3,u=[],d=[],p=[],f=new K.Vector3,m=new K.Matrix4,g=t+1;for(this.tangents=u,this.normals=d,this.binormals=p,l=0;l<g;l++)c=l/(g-1),u[l]=e.getTangentAt(c),u[l].normalize();for(function(){d[0]=new K.Vector3,p[0]=new K.Vector3,r=Number.MAX_VALUE,o=Math.abs(u[0].x),s=Math.abs(u[0].y),a=Math.abs(u[0].z),o<=r&&(r=o,h.set(1,0,0));s<=r&&(r=s,h.set(0,1,0));a<=r&&h.set(0,0,1);f.crossVectors(u[0],h).normalize(),d[0].crossVectors(u[0],f),p[0].crossVectors(u[0],d[0])}(),l=1;l<g;l++)d[l]=d[l-1].clone(),p[l]=p[l-1].clone(),f.crossVectors(u[l-1],u[l]),f.length()>1e-4&&(f.normalize(),n=Math.acos(K.Math.clamp(u[l-1].dot(u[l]),-1,1)),d[l].applyMatrix4(m.makeRotationAxis(f,n))),p[l].crossVectors(u[l],d[l]);if(i)for(n=Math.acos(K.Math.clamp(d[0].dot(d[g-1]),-1,1)),n/=g-1,u[0].dot(f.crossVectors(d[0],d[g-1]))>0&&(n=-n),l=1;l<g;l++)d[l].applyMatrix4(m.makeRotationAxis(u[l],n*l)),p[l].crossVectors(u[l],d[l])},K.PolyhedronGeometry=function(e,t,i,n){K.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:n},i=i||1,n=n||0;for(var r=this,o=0,s=e.length;o<s;o+=3)x(new K.Vector3(e[o],e[o+1],e[o+2]));var a=this.vertices,l=[],c=(o=0,0);for(s=t.length;o<s;o+=3,c++){var h=a[t[o]],u=a[t[o+1]],d=a[t[o+2]];l[c]=new K.Face3(h.index,u.index,d.index,[h.clone(),u.clone(),d.clone()])}var p=new K.Vector3;for(o=0,s=l.length;o<s;o++)E(l[o],n);for(o=0,s=this.faceVertexUvs[0].length;o<s;o++){var f=this.faceVertexUvs[0][o],m=f[0].x,g=f[1].x,v=f[2].x,y=Math.max(m,Math.max(g,v)),b=Math.min(m,Math.min(g,v));y>.9&&b<.1&&(m<.2&&(f[0].x+=1),g<.2&&(f[1].x+=1),v<.2&&(f[2].x+=1))}for(o=0,s=this.vertices.length;o<s;o++)this.vertices[o].multiplyScalar(i);function x(e){var t=e.normalize().clone();t.index=r.vertices.push(t)-1;var i=A(e)/2/Math.PI+.5,n=function(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}(e)/Math.PI+.5;return t.uv=new K.Vector2(i,1-n),t}function _(e,t,i){var n=new K.Face3(e.index,t.index,i.index,[e.clone(),t.clone(),i.clone()]);r.faces.push(n),p.copy(e).add(t).add(i).divideScalar(3);var o=A(p);r.faceVertexUvs[0].push([S(e.uv,e,o),S(t.uv,t,o),S(i.uv,i,o)])}function E(e,t){for(var i=Math.pow(2,t),n=x(r.vertices[e.a]),o=x(r.vertices[e.b]),s=x(r.vertices[e.c]),a=[],l=0;l<=i;l++){a[l]=[];for(var c=x(n.clone().lerp(s,l/i)),h=x(o.clone().lerp(s,l/i)),u=i-l,d=0;d<=u;d++)a[l][d]=0==d&&l==i?c:x(c.clone().lerp(h,d/u))}for(l=0;l<i;l++)for(d=0;d<2*(i-l)-1;d++){var p=Math.floor(d/2);d%2==0?_(a[l][p+1],a[l+1][p],a[l][p]):_(a[l][p+1],a[l+1][p+1],a[l+1][p])}}function A(e){return Math.atan2(e.z,-e.x)}function S(e,t,i){return i<0&&1===e.x&&(e=new K.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new K.Vector2(i/2/Math.PI+.5,e.y)),e.clone()}this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new K.Sphere(new K.Vector3,i)},K.PolyhedronGeometry.prototype=Object.create(K.Geometry.prototype),K.PolyhedronGeometry.prototype.constructor=K.PolyhedronGeometry,K.DodecahedronGeometry=function(e,t){this.parameters={radius:e,detail:t};var i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n];K.PolyhedronGeometry.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t)},K.DodecahedronGeometry.prototype=Object.create(K.Geometry.prototype),K.DodecahedronGeometry.prototype.constructor=K.DodecahedronGeometry,K.IcosahedronGeometry=function(e,t){var i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1];K.PolyhedronGeometry.call(this,n,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}},K.IcosahedronGeometry.prototype=Object.create(K.Geometry.prototype),K.IcosahedronGeometry.prototype.constructor=K.IcosahedronGeometry,K.OctahedronGeometry=function(e,t){this.parameters={radius:e,detail:t};K.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}},K.OctahedronGeometry.prototype=Object.create(K.Geometry.prototype),K.OctahedronGeometry.prototype.constructor=K.OctahedronGeometry,K.TetrahedronGeometry=function(e,t){K.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}},K.TetrahedronGeometry.prototype=Object.create(K.Geometry.prototype),K.TetrahedronGeometry.prototype.constructor=K.TetrahedronGeometry,K.ParametricGeometry=function(e,t,i){K.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i};var n,r,o,s,a,l,c,h,u,d,p,f,m=this.vertices,g=this.faces,v=this.faceVertexUvs[0],y=t+1;for(n=0;n<=i;n++)for(s=n/i,r=0;r<=t;r++)o=e(r/t,s),m.push(o);for(n=0;n<i;n++)for(r=0;r<t;r++)a=n*y+r,l=n*y+r+1,c=(n+1)*y+r+1,h=(n+1)*y+r,u=new K.Vector2(r/t,n/i),d=new K.Vector2((r+1)/t,n/i),p=new K.Vector2((r+1)/t,(n+1)/i),f=new K.Vector2(r/t,(n+1)/i),g.push(new K.Face3(a,l,h)),v.push([u,d,f]),g.push(new K.Face3(l,c,h)),v.push([d.clone(),p,f.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},K.ParametricGeometry.prototype=Object.create(K.Geometry.prototype),K.ParametricGeometry.prototype.constructor=K.ParametricGeometry,K.AxisHelper=function(e){e=e||1;var t=new Float32Array([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e]),i=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]),n=new K.BufferGeometry;n.setAttribute("position",new K.BufferAttribute(t,3)),n.setAttribute("color",new K.BufferAttribute(i,3));var r=new K.LineBasicMaterial({vertexColors:K.VertexColors});K.Line.call(this,n,r,K.LinePieces)},K.AxisHelper.prototype=Object.create(K.Line.prototype),K.AxisHelper.prototype.constructor=K.AxisHelper,K.ArrowHelper=function(){var e=new K.Geometry;e.vertices.push(new K.Vector3(0,0,0),new K.Vector3(0,1,0));var t=new K.CylinderGeometry(0,.5,1,5,1);return t.applyMatrix((new K.Matrix4).makeTranslation(0,-.5,0)),function(i,n,r,o,s,a){K.Object3D.call(this),void 0===o&&(o=16776960),void 0===r&&(r=1),void 0===s&&(s=.2*r),void 0===a&&(a=.2*s),this.position.copy(n),this.line=new K.Line(e,new K.LineBasicMaterial({color:o})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new K.Mesh(t,new K.MeshBasicMaterial({color:o})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(i),this.setLength(r,s,a)}}(),K.ArrowHelper.prototype=Object.create(K.Object3D.prototype),K.ArrowHelper.prototype.constructor=K.ArrowHelper,K.ArrowHelper.prototype.setDirection=(Y=new K.Vector3,function(e){e.y>.99999?this.quaternion.set(0,0,0,1):e.y<-.99999?this.quaternion.set(1,0,0,0):(Y.set(e.z,0,-e.x).normalize(),q=Math.acos(e.y),this.quaternion.setFromAxisAngle(Y,q))}),K.ArrowHelper.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,e-t,1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},K.ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},K.BoxHelper=function(e){var t=new K.BufferGeometry;t.setAttribute("position",new K.BufferAttribute(new Float32Array(72),3)),K.Line.call(this,t,new K.LineBasicMaterial({color:16776960}),K.LinePieces),void 0!==e&&this.update(e)},K.BoxHelper.prototype=Object.create(K.Line.prototype),K.BoxHelper.prototype.constructor=K.BoxHelper,K.BoxHelper.prototype.update=function(e){var t=e.geometry;null===t.boundingBox&&t.computeBoundingBox();var i=t.boundingBox.min,n=t.boundingBox.max,r=this.geometry.attributes.position.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=i.x,r[4]=n.y,r[5]=n.z,r[6]=i.x,r[7]=n.y,r[8]=n.z,r[9]=i.x,r[10]=i.y,r[11]=n.z,r[12]=i.x,r[13]=i.y,r[14]=n.z,r[15]=n.x,r[16]=i.y,r[17]=n.z,r[18]=n.x,r[19]=i.y,r[20]=n.z,r[21]=n.x,r[22]=n.y,r[23]=n.z,r[24]=n.x,r[25]=n.y,r[26]=i.z,r[27]=i.x,r[28]=n.y,r[29]=i.z,r[30]=i.x,r[31]=n.y,r[32]=i.z,r[33]=i.x,r[34]=i.y,r[35]=i.z,r[36]=i.x,r[37]=i.y,r[38]=i.z,r[39]=n.x,r[40]=i.y,r[41]=i.z,r[42]=n.x,r[43]=i.y,r[44]=i.z,r[45]=n.x,r[46]=n.y,r[47]=i.z,r[48]=n.x,r[49]=n.y,r[50]=n.z,r[51]=n.x,r[52]=n.y,r[53]=i.z,r[54]=i.x,r[55]=n.y,r[56]=n.z,r[57]=i.x,r[58]=n.y,r[59]=i.z,r[60]=i.x,r[61]=i.y,r[62]=n.z,r[63]=i.x,r[64]=i.y,r[65]=i.z,r[66]=n.x,r[67]=i.y,r[68]=n.z,r[69]=n.x,r[70]=i.y,r[71]=i.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},K.BoundingBoxHelper=function(e,t){var i=void 0!==t?t:8947848;this.object=e,this.box=new K.Box3,K.Mesh.call(this,new K.BoxGeometry(1,1,1),new K.MeshBasicMaterial({color:i,wireframe:!0}))},K.BoundingBoxHelper.prototype=Object.create(K.Mesh.prototype),K.BoundingBoxHelper.prototype.constructor=K.BoundingBoxHelper,K.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.getCenter(this.position)},K.CameraHelper=function(e){var t=new K.Geometry,i=new K.LineBasicMaterial({color:16777215,vertexColors:K.FaceColors}),n={},r=16755200,o=16711680,s=43775,a=3355443;function l(e,t,i){c(e,i),c(t,i)}function c(e,i){t.vertices.push(new K.Vector3),t.colors.push(new K.Color(i)),void 0===n[e]&&(n[e]=[]),n[e].push(t.vertices.length-1)}l("n1","n2",r),l("n2","n4",r),l("n4","n3",r),l("n3","n1",r),l("f1","f2",r),l("f2","f4",r),l("f4","f3",r),l("f3","f1",r),l("n1","f1",r),l("n2","f2",r),l("n3","f3",r),l("n4","f4",r),l("p","n1",o),l("p","n2",o),l("p","n3",o),l("p","n4",o),l("u1","u2",s),l("u2","u3",s),l("u3","u1",s),l("c","t",16777215),l("p","c",a),l("cn1","cn2",a),l("cn3","cn4",a),l("cf1","cf2",a),l("cf3","cf4",a),K.Line.call(this,t,i,K.LinePieces),this.camera=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=n,this.update()},K.CameraHelper.prototype=Object.create(K.Line.prototype),K.CameraHelper.prototype.constructor=K.CameraHelper,K.CameraHelper.prototype.update=function(){var e,t,i=new K.Vector3,n=new K.Camera,r=function(r,o,s,a){i.set(o,s,a).unproject(n);var l=t[r];if(void 0!==l)for(var c=0,h=l.length;c<h;c++)e.vertices[l[c]].copy(i)};return function(){e=this.geometry,t=this.pointMap;n.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),e.verticesNeedUpdate=!0}}(),K.DirectionalLightHelper=function(e,t){K.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,t=t||1;var i=new K.Geometry;i.vertices.push(new K.Vector3(-t,t,0),new K.Vector3(t,t,0),new K.Vector3(t,-t,0),new K.Vector3(-t,-t,0),new K.Vector3(-t,t,0));var n=new K.LineBasicMaterial({fog:!1});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new K.Line(i,n),this.add(this.lightPlane),(i=new K.Geometry).vertices.push(new K.Vector3,new K.Vector3),(n=new K.LineBasicMaterial({fog:!1})).color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new K.Line(i,n),this.add(this.targetLine),this.update()},K.DirectionalLightHelper.prototype=Object.create(K.Object3D.prototype),K.DirectionalLightHelper.prototype.constructor=K.DirectionalLightHelper,K.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},K.DirectionalLightHelper.prototype.update=function(){var e=new K.Vector3,t=new K.Vector3,i=new K.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(t,e),this.lightPlane.lookAt(i),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(i),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),K.EdgesHelper=function(e,t,i){var n=void 0!==t?t:16777215;i=void 0!==i?i:1;var r,o=Math.cos(K.Math.degToRad(i)),s=[0,0],a={},l=function(e,t){return e-t},c=["a","b","c"],h=new K.BufferGeometry;e.geometry instanceof K.BufferGeometry?(r=new K.Geometry).fromBufferGeometry(e.geometry):r=e.geometry.clone(),r.mergeVertices(),r.computeFaceNormals();for(var u=r.vertices,d=r.faces,p=0,f=0,m=d.length;f<m;f++)for(var g=d[f],v=0;v<3;v++){s[0]=g[c[v]],s[1]=g[c[(v+1)%3]],s.sort(l),void 0===a[x=s.toString()]?(a[x]={vert1:s[0],vert2:s[1],face1:f,face2:void 0},p++):a[x].face2=f}var y=new Float32Array(2*p*3),b=0;for(var x in a){var _=a[x];if(void 0===_.face2||d[_.face1].normal.dot(d[_.face2].normal)<=o){var E=u[_.vert1];y[b++]=E.x,y[b++]=E.y,y[b++]=E.z,E=u[_.vert2],y[b++]=E.x,y[b++]=E.y,y[b++]=E.z}}h.setAttribute("position",new K.BufferAttribute(y,3)),K.Line.call(this,h,new K.LineBasicMaterial({color:n}),K.LinePieces),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},K.EdgesHelper.prototype=Object.create(K.Line.prototype),K.EdgesHelper.prototype.constructor=K.EdgesHelper,K.FaceNormalsHelper=function(e,t,i,n){this.object=e,this.size=void 0!==t?t:1;for(var r=void 0!==i?i:16776960,o=void 0!==n?n:1,s=new K.Geometry,a=0,l=this.object.geometry.faces.length;a<l;a++)s.vertices.push(new K.Vector3,new K.Vector3);K.Line.call(this,s,new K.LineBasicMaterial({color:r,linewidth:o}),K.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new K.Matrix3,this.update()},K.FaceNormalsHelper.prototype=Object.create(K.Line.prototype),K.FaceNormalsHelper.prototype.constructor=K.FaceNormalsHelper,K.FaceNormalsHelper.prototype.update=function(){var e=this.geometry.vertices,t=this.object,i=t.geometry.vertices,n=t.geometry.faces,r=t.matrixWorld;t.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(r);for(var o=0,s=0,a=n.length;o<a;o++,s+=2){var l=n[o];e[s].copy(i[l.a]).add(i[l.b]).add(i[l.c]).divideScalar(3).applyMatrix4(r),e[s+1].copy(l.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(e[s])}return this.geometry.verticesNeedUpdate=!0,this},K.GridHelper=function(e,t){var i=new K.Geometry,n=new K.LineBasicMaterial({vertexColors:K.VertexColors});this.color1=new K.Color(4473924),this.color2=new K.Color(8947848);for(var r=-e;r<=e;r+=t){i.vertices.push(new K.Vector3(-e,0,r),new K.Vector3(e,0,r),new K.Vector3(r,0,-e),new K.Vector3(r,0,e));var o=0===r?this.color1:this.color2;i.colors.push(o,o,o,o)}K.Line.call(this,i,n,K.LinePieces)},K.GridHelper.prototype=Object.create(K.Line.prototype),K.GridHelper.prototype.constructor=K.GridHelper,K.GridHelper.prototype.setColors=function(e,t){this.color1.set(e),this.color2.set(t),this.geometry.colorsNeedUpdate=!0},K.HemisphereLightHelper=function(e,t){K.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new K.Color,new K.Color];var i=new K.SphereGeometry(t,4,2);i.applyMatrix((new K.Matrix4).makeRotationX(-Math.PI/2));for(var n=0;n<8;n++)i.faces[n].color=this.colors[n<4?0:1];var r=new K.MeshBasicMaterial({vertexColors:K.FaceColors,wireframe:!0});this.lightSphere=new K.Mesh(i,r),this.add(this.lightSphere),this.update()},K.HemisphereLightHelper.prototype=Object.create(K.Object3D.prototype),K.HemisphereLightHelper.prototype.constructor=K.HemisphereLightHelper,K.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},K.HemisphereLightHelper.prototype.update=function(){var e=new K.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),K.PointLightHelper=function(e,t){this.light=e,this.light.updateMatrixWorld();var i=new K.SphereGeometry(t,4,2),n=new K.MeshBasicMaterial({wireframe:!0,fog:!1});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),K.Mesh.call(this,i,n),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},K.PointLightHelper.prototype=Object.create(K.Mesh.prototype),K.PointLightHelper.prototype.constructor=K.PointLightHelper,K.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},K.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},K.SkeletonHelper=function(e){this.bones=this.getBoneList(e);for(var t=new K.Geometry,i=0;i<this.bones.length;i++){this.bones[i].parent instanceof K.Bone&&(t.vertices.push(new K.Vector3),t.vertices.push(new K.Vector3),t.colors.push(new K.Color(0,0,1)),t.colors.push(new K.Color(0,1,0)))}var n=new K.LineBasicMaterial({vertexColors:K.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});K.Line.call(this,t,n,K.LinePieces),this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.update()},K.SkeletonHelper.prototype=Object.create(K.Line.prototype),K.SkeletonHelper.prototype.constructor=K.SkeletonHelper,K.SkeletonHelper.prototype.getBoneList=function(e){var t=[];e instanceof K.Bone&&t.push(e);for(var i=0;i<e.children.length;i++)t.push.apply(t,this.getBoneList(e.children[i]));return t},K.SkeletonHelper.prototype.update=function(){for(var e=this.geometry,t=(new K.Matrix4).getInverse(this.root.matrixWorld),i=new K.Matrix4,n=0,r=0;r<this.bones.length;r++){var o=this.bones[r];o.parent instanceof K.Bone&&(i.multiplyMatrices(t,o.matrixWorld),e.vertices[n].setFromMatrixPosition(i),i.multiplyMatrices(t,o.parent.matrixWorld),e.vertices[n+1].setFromMatrixPosition(i),n+=2)}e.verticesNeedUpdate=!0,e.computeBoundingSphere()},K.SpotLightHelper=function(e){K.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;var t=new K.CylinderGeometry(0,1,1,8,1,!0);t.applyMatrix((new K.Matrix4).makeTranslation(0,-.5,0)),t.applyMatrix((new K.Matrix4).makeRotationX(-Math.PI/2));var i=new K.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new K.Mesh(t,i),this.add(this.cone),this.update()},K.SpotLightHelper.prototype=Object.create(K.Object3D.prototype),K.SpotLightHelper.prototype.constructor=K.SpotLightHelper,K.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},K.SpotLightHelper.prototype.update=function(){var e=new K.Vector3,t=new K.Vector3;return function(){var i=this.light.distance?this.light.distance:1e4,n=i*Math.tan(this.light.angle);this.cone.scale.set(n,n,i),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),K.VertexNormalsHelper=function(e,t,i,n){this.object=e,this.size=void 0!==t?t:1;for(var r=void 0!==i?i:16711680,o=void 0!==n?n:1,s=new K.Geometry,a=e.geometry.faces,l=0,c=a.length;l<c;l++)for(var h=0,u=a[l].vertexNormals.length;h<u;h++)s.vertices.push(new K.Vector3,new K.Vector3);K.Line.call(this,s,new K.LineBasicMaterial({color:r,linewidth:o}),K.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new K.Matrix3,this.update()},K.VertexNormalsHelper.prototype=Object.create(K.Line.prototype),K.VertexNormalsHelper.prototype.constructor=K.VertexNormalsHelper,K.VertexNormalsHelper.prototype.update=function(e){var t=new K.Vector3;return function(e){var i=["a","b","c","d"];this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var n=this.geometry.vertices,r=this.object.geometry.vertices,o=this.object.geometry.faces,s=this.object.matrixWorld,a=0,l=0,c=o.length;l<c;l++)for(var h=o[l],u=0,d=h.vertexNormals.length;u<d;u++){var p=r[h[i[u]]],f=h.vertexNormals[u];n[a].copy(p).applyMatrix4(s),t.copy(f).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),t.add(n[a]),n[a+=1].copy(t),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),K.VertexTangentsHelper=function(e,t,i,n){this.object=e,this.size=void 0!==t?t:1;for(var r=void 0!==i?i:255,o=void 0!==n?n:1,s=new K.Geometry,a=e.geometry.faces,l=0,c=a.length;l<c;l++)for(var h=0,u=a[l].vertexTangents.length;h<u;h++)s.vertices.push(new K.Vector3),s.vertices.push(new K.Vector3);K.Line.call(this,s,new K.LineBasicMaterial({color:r,linewidth:o}),K.LinePieces),this.matrixAutoUpdate=!1,this.update()},K.VertexTangentsHelper.prototype=Object.create(K.Line.prototype),K.VertexTangentsHelper.prototype.constructor=K.VertexTangentsHelper,K.VertexTangentsHelper.prototype.update=function(e){var t=new K.Vector3;return function(e){var i=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var n=this.geometry.vertices,r=this.object.geometry.vertices,o=this.object.geometry.faces,s=this.object.matrixWorld,a=0,l=0,c=o.length;l<c;l++)for(var h=o[l],u=0,d=h.vertexTangents.length;u<d;u++){var p=r[h[i[u]]],f=h.vertexTangents[u];n[a].copy(p).applyMatrix4(s),t.copy(f).transformDirection(s).multiplyScalar(this.size),t.add(n[a]),n[a+=1].copy(t),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),K.WireframeHelper=function(e,t){var i=void 0!==t?t:16777215,n=[0,0],r={},o=function(e,t){return e-t},s=["a","b","c"],a=new K.BufferGeometry;if(e.geometry instanceof K.Geometry){for(var l=e.geometry.vertices,c=e.geometry.faces,h=0,u=new Uint32Array(6*c.length),d=0,p=c.length;d<p;d++)for(var f=c[d],m=0;m<3;m++){n[0]=f[s[m]],n[1]=f[s[(m+1)%3]],n.sort(o),void 0===r[M=n.toString()]&&(u[2*h]=n[0],u[2*h+1]=n[1],r[M]=!0,h++)}var g=new Float32Array(2*h*3);for(d=0,p=h;d<p;d++)for(m=0;m<2;m++){var v=l[u[2*d+m]];g[(S=6*d+3*m)+0]=v.x,g[S+1]=v.y,g[S+2]=v.z}a.setAttribute("position",new K.BufferAttribute(g,3))}else if(e.geometry instanceof K.BufferGeometry)if(void 0!==e.geometry.attributes.index){l=e.geometry.attributes.position.array;var y=e.geometry.attributes.index.array,b=e.geometry.drawcalls;h=0;0===b.length&&(b=[{count:y.length,index:0,start:0}]);u=new Uint32Array(2*y.length);for(var x=0,_=b.length;x<_;++x)for(var E=b[x].start,A=b[x].count,S=b[x].index,w=(d=E,E+A);d<w;d+=3)for(m=0;m<3;m++){var M;n[0]=S+y[d+m],n[1]=S+y[d+(m+1)%3],n.sort(o),void 0===r[M=n.toString()]&&(u[2*h]=n[0],u[2*h+1]=n[1],r[M]=!0,h++)}for(g=new Float32Array(2*h*3),d=0,p=h;d<p;d++)for(m=0;m<2;m++){S=6*d+3*m;var T=3*u[2*d+m];g[S+0]=l[T],g[S+1]=l[T+1],g[S+2]=l[T+2]}a.setAttribute("position",new K.BufferAttribute(g,3))}else{var C=(h=(l=e.geometry.attributes.position.array).length/3)/3;for(g=new Float32Array(2*h*3),d=0,p=C;d<p;d++)for(m=0;m<3;m++){var P=9*d+3*m;g[(S=18*d+6*m)+0]=l[P],g[S+1]=l[P+1],g[S+2]=l[P+2];T=9*d+(m+1)%3*3;g[S+3]=l[T],g[S+4]=l[T+1],g[S+5]=l[T+2]}a.setAttribute("position",new K.BufferAttribute(g,3))}K.Line.call(this,a,new K.LineBasicMaterial({color:i}),K.LinePieces),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},K.WireframeHelper.prototype=Object.create(K.Line.prototype),K.WireframeHelper.prototype.constructor=K.WireframeHelper,K.ImmediateRenderObject=function(){K.Object3D.call(this),this.render=function(e){}},K.ImmediateRenderObject.prototype=Object.create(K.Object3D.prototype),K.ImmediateRenderObject.prototype.constructor=K.ImmediateRenderObject,K.MorphBlendMesh=function(e,t){K.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length,n="__default",r=i-1,o=i/1;this.createAnimation(n,0,r,o),this.setAnimationWeight(n,1)},K.MorphBlendMesh.prototype=Object.create(K.Mesh.prototype),K.MorphBlendMesh.prototype.constructor=K.MorphBlendMesh,K.MorphBlendMesh.prototype.createAnimation=function(e,t,i,n){var r={startFrame:t,endFrame:i,length:i-t+1,fps:n,duration:(i-t)/n,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=r,this.animationsList.push(r)},K.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,i=/([a-z]+)_?(\d+)/,n={},r=this.geometry,o=0,s=r.morphTargets.length;o<s;o++){var a=r.morphTargets[o].name.match(i);if(a&&a.length>1)n[l=a[1]]||(n[l]={start:1/0,end:-1/0}),o<(c=n[l]).start&&(c.start=o),o>c.end&&(c.end=o),t||(t=l)}for(var l in n){var c=n[l];this.createAnimation(l,c.start,c.end,e)}this.firstAnimation=t},K.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)},K.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)},K.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var i=this.animationsMap[e];i&&(i.fps=t,i.duration=(i.end-i.start)/i.fps)},K.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var i=this.animationsMap[e];i&&(i.duration=t,i.fps=(i.end-i.start)/i.duration)},K.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var i=this.animationsMap[e];i&&(i.weight=t)},K.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var i=this.animationsMap[e];i&&(i.time=t)},K.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0,i=this.animationsMap[e];return i&&(t=i.time),t},K.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1,i=this.animationsMap[e];return i&&(t=i.duration),t},K.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):K.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")},K.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];t&&(t.active=!1)},K.MorphBlendMesh.prototype.update=function(e){for(var t=0,i=this.animationsList.length;t<i;t++){var n=this.animationsList[t];if(n.active){var r=n.duration/n.length;n.time+=n.direction*e,n.mirroredLoop?(n.time>n.duration||n.time<0)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),n.time<0&&(n.time=0,n.directionBackwards=!1)):(n.time=n.time%n.duration,n.time<0&&(n.time+=n.duration));var o=n.startFrame+K.Math.clamp(Math.floor(n.time/r),0,n.length-1),s=n.weight;o!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*s,this.morphTargetInfluences[o]=0,n.lastFrame=n.currentFrame,n.currentFrame=o);var a=n.time%r/r;n.directionBackwards&&(a=1-a),this.morphTargetInfluences[n.currentFrame]=a*s,this.morphTargetInfluences[n.lastFrame]=(1-a)*s}}};const{polyfillTHREE:Z}=i(31802);Z(K)},52072:e=>{e.exports=function(){"use strict";var e=function(){for(var e=3,t=document.createElement("b"),i=t.all||[];t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i><![endif]--\x3e",i[0];);return e>4?e:document.documentMode}(),t=navigator.platform.toLowerCase().indexOf("mac")+1,i=function(e){if(!(this instanceof i))return new i(e);var s=this,a={rows_in_block:50,blocks_in_cluster:4,tag:null,show_no_data_row:!0,no_data_class:"clusterize-no-data",no_data_text:"No data",keep_parity:!0,callbacks:{}};s.options={};for(var l,c=["rows_in_block","blocks_in_cluster","show_no_data_row","no_data_class","no_data_text","keep_parity","tag","callbacks"],h=0;l=c[h];h++)s.options[l]=void 0!==e[l]&&null!=e[l]?e[l]:a[l];var u,d=["scroll","content"];for(h=0;u=d[h];h++)if(s[u+"_elem"]=e[u+"Id"]?document.getElementById(e[u+"Id"]):e[u+"Elem"],!s[u+"_elem"])throw new Error("Error! Could not find "+u+" element");s.content_elem.hasAttribute("tabindex")||s.content_elem.setAttribute("tabindex",0);var p=o(e.rows)?e.rows:s.fetchMarkup(),f={},m=s.scroll_elem.scrollTop;s.insertToDOM(p,f),s.scroll_elem.scrollTop=m;var g=!1,v=0,y=!1,b=function(){t&&(y||(s.content_elem.style.pointerEvents="none"),y=!0,clearTimeout(v),v=setTimeout((function(){s.content_elem.style.pointerEvents="auto",y=!1}),50)),g!=(g=s.getClusterNum())&&s.insertToDOM(p,f),s.options.callbacks.scrollingProgress&&s.options.callbacks.scrollingProgress(s.getScrollProgress())},x=0,_=function(){clearTimeout(x),x=setTimeout(s.refresh,100)};n("scroll",s.scroll_elem,b),n("resize",window,_),s.destroy=function(e){r("scroll",s.scroll_elem,b),r("resize",window,_),s.html((e?s.generateEmptyRow():p).join(""))},s.refresh=function(e){(s.getRowsHeight(p)||e)&&s.update(p)},s.update=function(e){p=o(e)?e:[];var t=s.scroll_elem.scrollTop;p.length*s.options.item_height<t&&(s.scroll_elem.scrollTop=0,g=0),s.insertToDOM(p,f),s.scroll_elem.scrollTop=t},s.clear=function(){s.update([])},s.getRowsAmount=function(){return p.length},s.getScrollProgress=function(){return this.options.scroll_top/(p.length*this.options.item_height)*100||0};var E=function(e,t){var i=o(t)?t:[];i.length&&(p="append"==e?p.concat(i):i.concat(p),s.insertToDOM(p,f))};s.append=function(e){E("append",e)},s.prepend=function(e){E("prepend",e)}};function n(e,t,i){return t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent("on"+e,i)}function r(e,t,i){return t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent("on"+e,i)}function o(e){return"[object Array]"===Object.prototype.toString.call(e)}function s(e,t){return window.getComputedStyle?window.getComputedStyle(t)[e]:t.currentStyle[e]}return i.prototype={constructor:i,fetchMarkup:function(){for(var e=[],t=this.getChildNodes(this.content_elem);t.length;)e.push(t.shift().outerHTML);return e},exploreEnvironment:function(t,i){var n=this.options;n.content_tag=this.content_elem.tagName.toLowerCase(),t.length&&(e&&e<=9&&!n.tag&&(n.tag=t[0].match(/<([^>\s/]*)/)[1].toLowerCase()),this.content_elem.children.length<=1&&(i.data=this.html(t[0]+t[0]+t[0])),n.tag||(n.tag=this.content_elem.children[0].tagName.toLowerCase()),this.getRowsHeight(t))},getRowsHeight:function(e){var t=this.options,i=t.item_height;if(t.cluster_height=0,e.length){var n=this.content_elem.children;if(n.length){var r=n[Math.floor(n.length/2)];if(t.item_height=r.offsetHeight,"tr"==t.tag&&"collapse"!=s("borderCollapse",this.content_elem)&&(t.item_height+=parseInt(s("borderSpacing",this.content_elem),10)||0),"tr"!=t.tag){var o=parseInt(s("marginTop",r),10)||0,a=parseInt(s("marginBottom",r),10)||0;t.item_height+=Math.max(o,a)}return t.block_height=t.item_height*t.rows_in_block,t.rows_in_cluster=t.blocks_in_cluster*t.rows_in_block,t.cluster_height=t.blocks_in_cluster*t.block_height,i!=t.item_height}}},getClusterNum:function(){return this.options.scroll_top=this.scroll_elem.scrollTop,Math.floor(this.options.scroll_top/(this.options.cluster_height-this.options.block_height))||0},generateEmptyRow:function(){var e=this.options;if(!e.tag||!e.show_no_data_row)return[];var t,i=document.createElement(e.tag),n=document.createTextNode(e.no_data_text);return i.className=e.no_data_class,"tr"==e.tag&&((t=document.createElement("td")).colSpan=100,t.appendChild(n)),i.appendChild(t||n),[i.outerHTML]},generate:function(e,t){var i=this.options,n=e.length;if(n<i.rows_in_block)return{top_offset:0,bottom_offset:0,rows_above:0,rows:n?e:this.generateEmptyRow()};var r=Math.max((i.rows_in_cluster-i.rows_in_block)*t,0),o=r+i.rows_in_cluster,s=Math.max(r*i.item_height,0),a=Math.max((n-o)*i.item_height,0),l=[],c=r;s<1&&c++;for(var h=r;h<o;h++)e[h]&&l.push(e[h]);return{top_offset:s,bottom_offset:a,rows_above:c,rows:l}},renderExtraTag:function(e,t){var i=document.createElement(this.options.tag),n="clusterize-";return i.className=[n+"extra-row",n+e].join(" "),t&&(i.style.height=t+"px"),i.outerHTML},insertToDOM:function(e,t){this.options.cluster_height||this.exploreEnvironment(e,t);var i=this.generate(e,this.getClusterNum()),n=i.rows.join(""),r=this.checkChanges("data",n,t),o=this.checkChanges("top",i.top_offset,t),s=this.checkChanges("bottom",i.bottom_offset,t),a=this.options.callbacks,l=[];r||o?(i.top_offset&&(this.options.keep_parity&&l.push(this.renderExtraTag("keep-parity")),l.push(this.renderExtraTag("top-space",i.top_offset))),l.push(n),i.bottom_offset&&l.push(this.renderExtraTag("bottom-space",i.bottom_offset)),a.clusterWillChange&&a.clusterWillChange(),this.html(l.join("")),"ol"==this.options.content_tag&&this.content_elem.setAttribute("start",i.rows_above),this.content_elem.style["counter-increment"]="clusterize-counter "+(i.rows_above-1),a.clusterChanged&&a.clusterChanged()):s&&(this.content_elem.lastChild.style.height=i.bottom_offset+"px")},html:function(t){var i=this.content_elem;if(e&&e<=9&&"tr"==this.options.tag){var n,r=document.createElement("div");for(r.innerHTML="<table><tbody>"+t+"</tbody></table>";n=i.lastChild;)i.removeChild(n);for(var o=this.getChildNodes(r.firstChild.firstChild);o.length;)i.appendChild(o.shift())}else i.innerHTML=t},getChildNodes:function(e){for(var t=e.children,i=[],n=0,r=t.length;n<r;n++)i.push(t[n]);return i},checkChanges:function(e,t,i){var n=t!=i[e];return i[e]=t,n}},i}()},19662:(e,t,i)=>{var n=i(60614),r=i(66330),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(r(e)+" is not a function")}},39483:(e,t,i)=>{var n=i(4411),r=i(66330),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(r(e)+" is not a constructor")}},96077:(e,t,i)=>{var n=i(60614),r=String,o=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw o("Can't set "+r(e)+" as a prototype")}},51223:(e,t,i)=>{var n=i(5112),r=i(70030),o=i(3070).f,s=n("unscopables"),a=Array.prototype;null==a[s]&&o(a,s,{configurable:!0,value:r(null)}),e.exports=function(e){a[s][e]=!0}},25787:(e,t,i)=>{var n=i(47976),r=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw r("Incorrect invocation")}},19670:(e,t,i)=>{var n=i(70111),r=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw o(r(e)+" is not an object")}},7556:(e,t,i)=>{var n=i(47293);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},41318:(e,t,i)=>{var n=i(45656),r=i(51400),o=i(26244),s=function(e){return function(t,i,s){var a,l=n(t),c=o(l),h=r(s,c);if(e&&i!=i){for(;c>h;)if((a=l[h++])!=a)return!0}else for(;c>h;h++)if((e||h in l)&&l[h]===i)return e||h||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},42092:(e,t,i)=>{var n=i(49974),r=i(1702),o=i(68361),s=i(47908),a=i(26244),l=i(65417),c=r([].push),h=function(e){var t=1==e,i=2==e,r=3==e,h=4==e,u=6==e,d=7==e,p=5==e||u;return function(f,m,g,v){for(var y,b,x=s(f),_=o(x),E=n(m,g),A=a(_),S=0,w=v||l,M=t?w(f,A):i||d?w(f,0):void 0;A>S;S++)if((p||S in _)&&(b=E(y=_[S],S,x),e))if(t)M[S]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return S;case 2:c(M,y)}else switch(e){case 4:return!1;case 7:c(M,y)}return u?-1:r||h?h:M}};e.exports={forEach:h(0),map:h(1),filter:h(2),some:h(3),every:h(4),find:h(5),findIndex:h(6),filterReject:h(7)}},41589:(e,t,i)=>{var n=i(51400),r=i(26244),o=i(86135),s=Array,a=Math.max;e.exports=function(e,t,i){for(var l=r(e),c=n(t,l),h=n(void 0===i?l:i,l),u=s(a(h-c,0)),d=0;c<h;c++,d++)o(u,d,e[c]);return u.length=d,u}},50206:(e,t,i)=>{var n=i(1702);e.exports=n([].slice)},77475:(e,t,i)=>{var n=i(43157),r=i(4411),o=i(70111),s=i(5112)("species"),a=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(r(t)&&(t===a||n(t.prototype))||o(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?a:t}},65417:(e,t,i)=>{var n=i(77475);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},60956:(e,t,i)=>{"use strict";var n=i(35005),r=i(1702),o=i(19662),s=i(68554),a=i(26244),l=i(47908),c=i(65417),h=n("Map"),u=h.prototype,d=r(u.forEach),p=r(u.has),f=r(u.set),m=r([].push);e.exports=function(e){var t,i,n,r=l(this),u=a(r),g=c(r,0),v=new h,y=s(e)?function(e){return e}:o(e);for(t=0;t<u;t++)n=y(i=r[t]),p(v,n)||f(v,n,i);return d(v,(function(e){m(g,e)})),g}},17072:(e,t,i)=>{var n=i(5112)("iterator"),r=!1;try{var o=0,s={next:function(){return{done:!!o++}},return:function(){r=!0}};s[n]=function(){return this},Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!r)return!1;var i=!1;try{var o={};o[n]=function(){return{next:function(){return{done:i=!0}}}},e(o)}catch(e){}return i}},84326:(e,t,i)=>{var n=i(1702),r=n({}.toString),o=n("".slice);e.exports=function(e){return o(r(e),8,-1)}},70648:(e,t,i)=>{var n=i(51694),r=i(60614),o=i(84326),s=i(5112)("toStringTag"),a=Object,l="Arguments"==o(function(){return arguments}());e.exports=n?o:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=a(e),s))?i:l?o(t):"Object"==(n=o(t))&&r(t.callee)?"Arguments":n}},31501:(e,t,i)=>{"use strict";var n=i(46916),r=i(19662),o=i(19670);e.exports=function(){for(var e=o(this),t=r(e.add),i=0,s=arguments.length;i<s;i++)n(t,e,arguments[i]);return e}},34092:(e,t,i)=>{"use strict";var n=i(46916),r=i(19662),o=i(19670);e.exports=function(){for(var e,t=o(this),i=r(t.delete),s=!0,a=0,l=arguments.length;a<l;a++)e=n(i,t,arguments[a]),s=s&&e;return!!s}},27296:(e,t,i)=>{"use strict";var n=i(49974),r=i(46916),o=i(19662),s=i(39483),a=i(68554),l=i(20408),c=[].push;e.exports=function(e){var t,i,h,u,d=arguments.length,p=d>1?arguments[1]:void 0;return s(this),(t=void 0!==p)&&o(p),a(e)?new this:(i=[],t?(h=0,u=n(p,d>2?arguments[2]:void 0),l(e,(function(e){r(c,i,u(e,h++))}))):l(e,c,{that:i}),new this(i))}},82044:(e,t,i)=>{"use strict";var n=i(50206);e.exports=function(){return new this(n(arguments))}},95631:(e,t,i)=>{"use strict";var n=i(3070).f,r=i(70030),o=i(89190),s=i(49974),a=i(25787),l=i(68554),c=i(20408),h=i(51656),u=i(76178),d=i(96340),p=i(19781),f=i(62423).fastKey,m=i(29909),g=m.set,v=m.getterFor;e.exports={getConstructor:function(e,t,i,h){var u=e((function(e,n){a(e,d),g(e,{type:t,index:r(null),first:void 0,last:void 0,size:0}),p||(e.size=0),l(n)||c(n,e[h],{that:e,AS_ENTRIES:i})})),d=u.prototype,m=v(t),y=function(e,t,i){var n,r,o=m(e),s=b(e,t);return s?s.value=i:(o.last=s={index:r=f(t,!0),key:t,value:i,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),p?o.size++:e.size++,"F"!==r&&(o.index[r]=s)),e},b=function(e,t){var i,n=m(e),r=f(t);if("F"!==r)return n.index[r];for(i=n.first;i;i=i.next)if(i.key==t)return i};return o(d,{clear:function(){for(var e=m(this),t=e.index,i=e.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete t[i.index],i=i.next;e.first=e.last=void 0,p?e.size=0:this.size=0},delete:function(e){var t=this,i=m(t),n=b(t,e);if(n){var r=n.next,o=n.previous;delete i.index[n.index],n.removed=!0,o&&(o.next=r),r&&(r.previous=o),i.first==n&&(i.first=r),i.last==n&&(i.last=o),p?i.size--:t.size--}return!!n},forEach:function(e){for(var t,i=m(this),n=s(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:i.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!b(this,e)}}),o(d,i?{get:function(e){var t=b(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),p&&n(d,"size",{get:function(){return m(this).size}}),u},setStrong:function(e,t,i){var n=t+" Iterator",r=v(t),o=v(n);h(e,t,(function(e,t){g(this,{type:n,target:e,state:r(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,i=e.last;i&&i.removed;)i=i.previous;return e.target&&(e.last=i=i?i.next:e.state.first)?u("keys"==t?i.key:"values"==t?i.value:[i.key,i.value],!1):(e.target=void 0,u(void 0,!0))}),i?"entries":"values",!i,!0),d(t)}}},29320:(e,t,i)=>{"use strict";var n=i(1702),r=i(89190),o=i(62423).getWeakData,s=i(25787),a=i(19670),l=i(68554),c=i(70111),h=i(20408),u=i(42092),d=i(92597),p=i(29909),f=p.set,m=p.getterFor,g=u.find,v=u.findIndex,y=n([].splice),b=0,x=function(e){return e.frozen||(e.frozen=new _)},_=function(){this.entries=[]},E=function(e,t){return g(e.entries,(function(e){return e[0]===t}))};_.prototype={get:function(e){var t=E(this,e);if(t)return t[1]},has:function(e){return!!E(this,e)},set:function(e,t){var i=E(this,e);i?i[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,(function(t){return t[0]===e}));return~t&&y(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,i,n){var u=e((function(e,r){s(e,p),f(e,{type:t,id:b++,frozen:void 0}),l(r)||h(r,e[n],{that:e,AS_ENTRIES:i})})),p=u.prototype,g=m(t),v=function(e,t,i){var n=g(e),r=o(a(t),!0);return!0===r?x(n).set(t,i):r[n.id]=i,e};return r(p,{delete:function(e){var t=g(this);if(!c(e))return!1;var i=o(e);return!0===i?x(t).delete(e):i&&d(i,t.id)&&delete i[t.id]},has:function(e){var t=g(this);if(!c(e))return!1;var i=o(e);return!0===i?x(t).has(e):i&&d(i,t.id)}}),r(p,i?{get:function(e){var t=g(this);if(c(e)){var i=o(e);return!0===i?x(t).get(e):i?i[t.id]:void 0}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),u}}},77710:(e,t,i)=>{"use strict";var n=i(82109),r=i(17854),o=i(1702),s=i(54705),a=i(98052),l=i(62423),c=i(20408),h=i(25787),u=i(60614),d=i(68554),p=i(70111),f=i(47293),m=i(17072),g=i(58003),v=i(79587);e.exports=function(e,t,i){var y=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),x=y?"set":"add",_=r[e],E=_&&_.prototype,A=_,S={},w=function(e){var t=o(E[e]);a(E,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return b&&!p(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:function(e,i){return t(this,0===e?0:e,i),this})};if(s(e,!u(_)||!(b||E.forEach&&!f((function(){(new _).entries().next()})))))A=i.getConstructor(t,e,y,x),l.enable();else if(s(e,!0)){var M=new A,T=M[x](b?{}:-0,1)!=M,C=f((function(){M.has(1)})),P=m((function(e){new _(e)})),D=!b&&f((function(){for(var e=new _,t=5;t--;)e[x](t,t);return!e.has(-0)}));P||((A=t((function(e,t){h(e,E);var i=v(new _,e,A);return d(t)||c(t,i[x],{that:i,AS_ENTRIES:y}),i}))).prototype=E,E.constructor=A),(C||D)&&(w("delete"),w("has"),y&&w("get")),(D||T)&&w(x),b&&E.clear&&delete E.clear}return S[e]=A,n({global:!0,constructor:!0,forced:A!=_},S),g(A,e),b||i.setStrong(A,e,y),A}},10313:(e,t,i)=>{i(51532),i(4129);var n=i(35005),r=i(70030),o=i(70111),s=Object,a=TypeError,l=n("Map"),c=n("WeakMap"),h=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=r(null)};h.prototype.get=function(e,t){return this[e]||(this[e]=t())},h.prototype.next=function(e,t,i){var n=i?this.objectsByIndex[e]||(this.objectsByIndex[e]=new c):this.primitives||(this.primitives=new l),r=n.get(t);return r||n.set(t,r=new h),r};var u=new h;e.exports=function(){var e,t,i=u,n=arguments.length;for(e=0;e<n;e++)o(t=arguments[e])&&(i=i.next(e,t,!0));if(this===s&&i===u)throw a("Composite keys must contain a non-primitive component");for(e=0;e<n;e++)o(t=arguments[e])||(i=i.next(e,t,!1));return i}},99920:(e,t,i)=>{var n=i(92597),r=i(53887),o=i(31236),s=i(3070);e.exports=function(e,t,i){for(var a=r(t),l=s.f,c=o.f,h=0;h<a.length;h++){var u=a[h];n(e,u)||i&&n(i,u)||l(e,u,c(t,u))}}},49920:(e,t,i)=>{var n=i(47293);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},76178:e=>{e.exports=function(e,t){return{value:e,done:t}}},68880:(e,t,i)=>{var n=i(19781),r=i(3070),o=i(79114);e.exports=n?function(e,t,i){return r.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},79114:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},86135:(e,t,i)=>{"use strict";var n=i(34948),r=i(3070),o=i(79114);e.exports=function(e,t,i){var s=n(t);s in e?r.f(e,s,o(0,i)):e[s]=i}},47045:(e,t,i)=>{var n=i(56339),r=i(3070);e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),r.f(e,t,i)}},98052:(e,t,i)=>{var n=i(60614),r=i(3070),o=i(56339),s=i(13072);e.exports=function(e,t,i,a){a||(a={});var l=a.enumerable,c=void 0!==a.name?a.name:t;if(n(i)&&o(i,c,a),a.global)l?e[t]=i:s(t,i);else{try{a.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:r.f(e,t,{value:i,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},89190:(e,t,i)=>{var n=i(98052);e.exports=function(e,t,i){for(var r in t)n(e,r,t[r],i);return e}},13072:(e,t,i)=>{var n=i(17854),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},19781:(e,t,i)=>{var n=i(47293);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4154:e=>{var t="object"==typeof document&&document.all,i=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:i}},80317:(e,t,i)=>{var n=i(17854),r=i(70111),o=n.document,s=r(o)&&r(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},6833:(e,t,i)=>{var n=i(88113);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},35268:(e,t,i)=>{var n=i(84326),r=i(17854);e.exports="process"==n(r.process)},88113:(e,t,i)=>{var n=i(35005);e.exports=n("navigator","userAgent")||""},7392:(e,t,i)=>{var n,r,o=i(17854),s=i(88113),a=o.process,l=o.Deno,c=a&&a.versions||l&&l.version,h=c&&c.v8;h&&(r=(n=h.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},80748:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},82109:(e,t,i)=>{var n=i(17854),r=i(31236).f,o=i(68880),s=i(98052),a=i(13072),l=i(99920),c=i(54705);e.exports=function(e,t){var i,h,u,d,p,f=e.target,m=e.global,g=e.stat;if(i=m?n:g?n[f]||a(f,{}):(n[f]||{}).prototype)for(h in t){if(d=t[h],u=e.dontCallGetSet?(p=r(i,h))&&p.value:i[h],!c(m?h:f+(g?".":"#")+h,e.forced)&&void 0!==u){if(typeof d==typeof u)continue;l(d,u)}(e.sham||u&&u.sham)&&o(d,"sham",!0),s(i,h,d,e)}}},47293:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},76677:(e,t,i)=>{var n=i(47293);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},22104:(e,t,i)=>{var n=i(34374),r=Function.prototype,o=r.apply,s=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},49974:(e,t,i)=>{var n=i(1702),r=i(19662),o=i(34374),s=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},34374:(e,t,i)=>{var n=i(47293);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},46916:(e,t,i)=>{var n=i(34374),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},76530:(e,t,i)=>{var n=i(19781),r=i(92597),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=r(o,"name"),l=a&&"something"===function(){}.name,c=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:l,CONFIGURABLE:c}},1702:(e,t,i)=>{var n=i(34374),r=Function.prototype,o=r.bind,s=r.call,a=n&&o.bind(s,s);e.exports=n?function(e){return e&&a(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},35005:(e,t,i)=>{var n=i(17854),r=i(60614),o=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e]):n[e]&&n[e][t]}},71246:(e,t,i)=>{var n=i(70648),r=i(58173),o=i(68554),s=i(97497),a=i(5112)("iterator");e.exports=function(e){if(!o(e))return r(e,a)||r(e,"@@iterator")||s[n(e)]}},18554:(e,t,i)=>{var n=i(46916),r=i(19662),o=i(19670),s=i(66330),a=i(71246),l=TypeError;e.exports=function(e,t){var i=arguments.length<2?a(e):t;if(r(i))return o(n(i,e));throw l(s(e)+" is not iterable")}},54647:(e,t,i)=>{var n=i(46916);e.exports=function(e){return n(Map.prototype.entries,e)}},58173:(e,t,i)=>{var n=i(19662),r=i(68554);e.exports=function(e,t){var i=e[t];return r(i)?void 0:n(i)}},96767:(e,t,i)=>{var n=i(46916);e.exports=function(e){return n(Set.prototype.values,e)}},17854:(e,t,i)=>{var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||function(){return this}()||Function("return this")()},92597:(e,t,i)=>{var n=i(1702),r=i(47908),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(r(e),t)}},3501:e=>{e.exports={}},842:(e,t,i)=>{var n=i(17854);e.exports=function(e,t){var i=n.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}},60490:(e,t,i)=>{var n=i(35005);e.exports=n("document","documentElement")},64664:(e,t,i)=>{var n=i(19781),r=i(47293),o=i(80317);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},68361:(e,t,i)=>{var n=i(1702),r=i(47293),o=i(84326),s=Object,a=n("".split);e.exports=r((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a(e,""):s(e)}:s},79587:(e,t,i)=>{var n=i(60614),r=i(70111),o=i(27674);e.exports=function(e,t,i){var s,a;return o&&n(s=t.constructor)&&s!==i&&r(a=s.prototype)&&a!==i.prototype&&o(e,a),e}},42788:(e,t,i)=>{var n=i(1702),r=i(60614),o=i(5465),s=n(Function.toString);r(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},62423:(e,t,i)=>{var n=i(82109),r=i(1702),o=i(3501),s=i(70111),a=i(92597),l=i(3070).f,c=i(8006),h=i(1156),u=i(52050),d=i(69711),p=i(76677),f=!1,m=d("meta"),g=0,v=function(e){l(e,m,{value:{objectID:"O"+g++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=c.f,t=r([].splice),i={};i[m]=1,e(i).length&&(c.f=function(i){for(var n=e(i),r=0,o=n.length;r<o;r++)if(n[r]===m){t(n,r,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h.f}))},fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,m)){if(!u(e))return"F";if(!t)return"E";v(e)}return e[m].objectID},getWeakData:function(e,t){if(!a(e,m)){if(!u(e))return!0;if(!t)return!1;v(e)}return e[m].weakData},onFreeze:function(e){return p&&f&&u(e)&&!a(e,m)&&v(e),e}};o[m]=!0},29909:(e,t,i)=>{var n,r,o,s=i(94811),a=i(17854),l=i(1702),c=i(70111),h=i(68880),u=i(92597),d=i(5465),p=i(6200),f=i(3501),m="Object already initialized",g=a.TypeError,v=a.WeakMap;if(s||d.state){var y=d.state||(d.state=new v),b=l(y.get),x=l(y.has),_=l(y.set);n=function(e,t){if(x(y,e))throw g(m);return t.facade=e,_(y,e,t),t},r=function(e){return b(y,e)||{}},o=function(e){return x(y,e)}}else{var E=p("state");f[E]=!0,n=function(e,t){if(u(e,E))throw g(m);return t.facade=e,h(e,E,t),t},r=function(e){return u(e,E)?e[E]:{}},o=function(e){return u(e,E)}}e.exports={set:n,get:r,has:o,enforce:function(e){return o(e)?r(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!c(t)||(i=r(t)).type!==e)throw g("Incompatible receiver, "+e+" required");return i}}}},97659:(e,t,i)=>{var n=i(5112),r=i(97497),o=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||s[o]===e)}},43157:(e,t,i)=>{var n=i(84326);e.exports=Array.isArray||function(e){return"Array"==n(e)}},60614:(e,t,i)=>{var n=i(4154),r=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===r}:function(e){return"function"==typeof e}},4411:(e,t,i)=>{var n=i(1702),r=i(47293),o=i(60614),s=i(70648),a=i(35005),l=i(42788),c=function(){},h=[],u=a("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=n(d.exec),f=!d.exec(c),m=function(e){if(!o(e))return!1;try{return u(c,h,e),!0}catch(e){return!1}},g=function(e){if(!o(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(d,l(e))}catch(e){return!0}};g.sham=!0,e.exports=!u||r((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?g:m},54705:(e,t,i)=>{var n=i(47293),r=i(60614),o=/#|\.prototype\./,s=function(e,t){var i=l[a(e)];return i==h||i!=c&&(r(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",h=s.POLYFILL="P";e.exports=s},68554:e=>{e.exports=function(e){return null==e}},70111:(e,t,i)=>{var n=i(60614),r=i(4154),o=r.all;e.exports=r.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===o}:function(e){return"object"==typeof e?null!==e:n(e)}},31913:e=>{e.exports=!1},52190:(e,t,i)=>{var n=i(35005),r=i(60614),o=i(47976),s=i(43307),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&o(t.prototype,a(e))}},20408:(e,t,i)=>{var n=i(49974),r=i(46916),o=i(19670),s=i(66330),a=i(97659),l=i(26244),c=i(47976),h=i(18554),u=i(71246),d=i(99212),p=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,i){var g,v,y,b,x,_,E,A=i&&i.that,S=!(!i||!i.AS_ENTRIES),w=!(!i||!i.IS_RECORD),M=!(!i||!i.IS_ITERATOR),T=!(!i||!i.INTERRUPTED),C=n(t,A),P=function(e){return g&&d(g,"normal",e),new f(!0,e)},D=function(e){return S?(o(e),T?C(e[0],e[1],P):C(e[0],e[1])):T?C(e,P):C(e)};if(w)g=e.iterator;else if(M)g=e;else{if(!(v=u(e)))throw p(s(e)+" is not iterable");if(a(v)){for(y=0,b=l(e);b>y;y++)if((x=D(e[y]))&&c(m,x))return x;return new f(!1)}g=h(e,v)}for(_=w?e.next:g.next;!(E=r(_,g)).done;){try{x=D(E.value)}catch(e){d(g,"throw",e)}if("object"==typeof x&&x&&c(m,x))return x}return new f(!1)}},99212:(e,t,i)=>{var n=i(46916),r=i(19670),o=i(58173);e.exports=function(e,t,i){var s,a;r(e);try{if(!(s=o(e,"return"))){if("throw"===t)throw i;return i}s=n(s,e)}catch(e){a=!0,s=e}if("throw"===t)throw i;if(a)throw s;return r(s),i}},63061:(e,t,i)=>{"use strict";var n=i(13383).IteratorPrototype,r=i(70030),o=i(79114),s=i(58003),a=i(97497),l=function(){return this};e.exports=function(e,t,i,c){var h=t+" Iterator";return e.prototype=r(n,{next:o(+!c,i)}),s(e,h,!1,!0),a[h]=l,e}},51656:(e,t,i)=>{"use strict";var n=i(82109),r=i(46916),o=i(31913),s=i(76530),a=i(60614),l=i(63061),c=i(79518),h=i(27674),u=i(58003),d=i(68880),p=i(98052),f=i(5112),m=i(97497),g=i(13383),v=s.PROPER,y=s.CONFIGURABLE,b=g.IteratorPrototype,x=g.BUGGY_SAFARI_ITERATORS,_=f("iterator"),E="keys",A="values",S="entries",w=function(){return this};e.exports=function(e,t,i,s,f,g,M){l(i,t,s);var T,C,P,D=function(e){if(e===f&&N)return N;if(!x&&e in R)return R[e];switch(e){case E:case A:case S:return function(){return new i(this,e)}}return function(){return new i(this)}},L=t+" Iterator",I=!1,R=e.prototype,O=R[_]||R["@@iterator"]||f&&R[f],N=!x&&O||D(f),k="Array"==t&&R.entries||O;if(k&&(T=c(k.call(new e)))!==Object.prototype&&T.next&&(o||c(T)===b||(h?h(T,b):a(T[_])||p(T,_,w)),u(T,L,!0,!0),o&&(m[L]=w)),v&&f==A&&O&&O.name!==A&&(!o&&y?d(R,"name",A):(I=!0,N=function(){return r(O,this)})),f)if(C={values:D(A),keys:g?N:D(E),entries:D(S)},M)for(P in C)(x||I||!(P in R))&&p(R,P,C[P]);else n({target:t,proto:!0,forced:x||I},C);return o&&!M||R[_]===N||p(R,_,N,{name:f}),m[t]=N,C}},13383:(e,t,i)=>{"use strict";var n,r,o,s=i(47293),a=i(60614),l=i(70111),c=i(70030),h=i(79518),u=i(98052),d=i(5112),p=i(31913),f=d("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(r=h(h(o)))!==Object.prototype&&(n=r):m=!0),!l(n)||s((function(){var e={};return n[f].call(e)!==e}))?n={}:p&&(n=c(n)),a(n[f])||u(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},97497:e=>{e.exports={}},26244:(e,t,i)=>{var n=i(17466);e.exports=function(e){return n(e.length)}},56339:(e,t,i)=>{var n=i(47293),r=i(60614),o=i(92597),s=i(19781),a=i(76530).CONFIGURABLE,l=i(42788),c=i(29909),h=c.enforce,u=c.get,d=Object.defineProperty,p=s&&!n((function(){return 8!==d((function(){}),"length",{value:8}).length})),f=String(String).split("String"),m=e.exports=function(e,t,i){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!o(e,"name")||a&&e.name!==t)&&(s?d(e,"name",{value:t,configurable:!0}):e.name=t),p&&i&&o(i,"arity")&&e.length!==i.arity&&d(e,"length",{value:i.arity});try{i&&o(i,"constructor")&&i.constructor?s&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);return o(n,"source")||(n.source=f.join("string"==typeof t?t:"")),e};Function.prototype.toString=m((function(){return r(this)&&u(this).source||l(this)}),"toString")},26130:(e,t,i)=>{var n=i(64310),r=Math.abs,o=Math.pow,s=o(2,-52),a=o(2,-23),l=o(2,127)*(2-a),c=o(2,-126);e.exports=Math.fround||function(e){var t,i,o=+e,h=r(o),u=n(o);return h<c?u*function(e){return e+1/s-1/s}(h/c/a)*c*a:(i=(t=(1+a/s)*h)-(t-h))>l||i!=i?u*(1/0):u*i}},47103:e=>{e.exports=Math.scale||function(e,t,i,n,r){var o=+e,s=+t,a=+i,l=+n,c=+r;return o!=o||s!=s||a!=a||l!=l||c!=c?NaN:o===1/0||o===-1/0?o:(o-s)*(c-l)/(a-s)+l}},64310:e=>{e.exports=Math.sign||function(e){var t=+e;return 0==t||t!=t?t:t<0?-1:1}},74758:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},78523:(e,t,i)=>{"use strict";var n=i(19662),r=TypeError,o=function(e){var t,i;this.promise=new e((function(e,n){if(void 0!==t||void 0!==i)throw r("Bad Promise constructor");t=e,i=n})),this.resolve=n(t),this.reject=n(i)};e.exports.f=function(e){return new o(e)}},77023:(e,t,i)=>{var n=i(17854).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},83009:(e,t,i)=>{var n=i(17854),r=i(47293),o=i(1702),s=i(41340),a=i(53111).trim,l=i(81361),c=n.parseInt,h=n.Symbol,u=h&&h.iterator,d=/^[+-]?0x/i,p=o(d.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||u&&!r((function(){c(Object(u))}));e.exports=f?function(e,t){var i=a(s(e));return c(i,t>>>0||(p(d,i)?16:10))}:c},70030:(e,t,i)=>{var n,r=i(19670),o=i(36048),s=i(80748),a=i(3501),l=i(60490),c=i(80317),h=i(6200),u=h("IE_PROTO"),d=function(){},p=function(e){return"<script>"+e+"</"+"script>"},f=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t;m="undefined"!=typeof document?document.domain&&n?f(n):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):f(n);for(var i=s.length;i--;)delete m.prototype[s[i]];return m()};a[u]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(d.prototype=r(e),i=new d,d.prototype=null,i[u]=e):i=m(),void 0===t?i:o.f(i,t)}},36048:(e,t,i)=>{var n=i(19781),r=i(3353),o=i(3070),s=i(19670),a=i(45656),l=i(81956);t.f=n&&!r?Object.defineProperties:function(e,t){s(e);for(var i,n=a(t),r=l(t),c=r.length,h=0;c>h;)o.f(e,i=r[h++],n[i]);return e}},3070:(e,t,i)=>{var n=i(19781),r=i(64664),o=i(3353),s=i(19670),a=i(34948),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",p="writable";t.f=n?o?function(e,t,i){if(s(e),t=a(t),s(i),"function"==typeof e&&"prototype"===t&&"value"in i&&p in i&&!i.writable){var n=h(e,t);n&&n.writable&&(e[t]=i.value,i={configurable:d in i?i.configurable:n.configurable,enumerable:u in i?i.enumerable:n.enumerable,writable:!1})}return c(e,t,i)}:c:function(e,t,i){if(s(e),t=a(t),s(i),r)try{return c(e,t,i)}catch(e){}if("get"in i||"set"in i)throw l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},31236:(e,t,i)=>{var n=i(19781),r=i(46916),o=i(55296),s=i(79114),a=i(45656),l=i(34948),c=i(92597),h=i(64664),u=Object.getOwnPropertyDescriptor;t.f=n?u:function(e,t){if(e=a(e),t=l(t),h)try{return u(e,t)}catch(e){}if(c(e,t))return s(!r(o.f,e,t),e[t])}},1156:(e,t,i)=>{var n=i(84326),r=i(45656),o=i(8006).f,s=i(41589),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return a&&"Window"==n(e)?function(e){try{return o(e)}catch(e){return s(a)}}(e):o(r(e))}},8006:(e,t,i)=>{var n=i(16324),r=i(80748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,r)}},25181:(e,t)=>{t.f=Object.getOwnPropertySymbols},79518:(e,t,i)=>{var n=i(92597),r=i(60614),o=i(47908),s=i(6200),a=i(49920),l=s("IE_PROTO"),c=Object,h=c.prototype;e.exports=a?c.getPrototypeOf:function(e){var t=o(e);if(n(t,l))return t[l];var i=t.constructor;return r(i)&&t instanceof i?i.prototype:t instanceof c?h:null}},52050:(e,t,i)=>{var n=i(47293),r=i(70111),o=i(84326),s=i(7556),a=Object.isExtensible,l=n((function(){a(1)}));e.exports=l||s?function(e){return!!r(e)&&((!s||"ArrayBuffer"!=o(e))&&(!a||a(e)))}:a},47976:(e,t,i)=>{var n=i(1702);e.exports=n({}.isPrototypeOf)},16324:(e,t,i)=>{var n=i(1702),r=i(92597),o=i(45656),s=i(41318).indexOf,a=i(3501),l=n([].push);e.exports=function(e,t){var i,n=o(e),c=0,h=[];for(i in n)!r(a,i)&&r(n,i)&&l(h,i);for(;t.length>c;)r(n,i=t[c++])&&(~s(h,i)||l(h,i));return h}},81956:(e,t,i)=>{var n=i(16324),r=i(80748);e.exports=Object.keys||function(e){return n(e,r)}},55296:(e,t)=>{"use strict";var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!i.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},27674:(e,t,i)=>{var n=i(1702),r=i(19670),o=i(96077);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{(e=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),t=i instanceof Array}catch(e){}return function(i,n){return r(i),o(n),t?e(i,n):i.__proto__=n,i}}():void 0)},90515:(e,t,i)=>{var n=i(17854),r=i(60614),o=i(5112)("observable"),s=n.Observable,a=s&&s.prototype;e.exports=!(r(s)&&r(s.from)&&r(s.of)&&r(a.subscribe)&&r(a[o]))},92140:(e,t,i)=>{var n=i(46916),r=i(60614),o=i(70111),s=TypeError;e.exports=function(e,t){var i,a;if("string"===t&&r(i=e.toString)&&!o(a=n(i,e)))return a;if(r(i=e.valueOf)&&!o(a=n(i,e)))return a;if("string"!==t&&r(i=e.toString)&&!o(a=n(i,e)))return a;throw s("Can't convert object to primitive value")}},53887:(e,t,i)=>{var n=i(35005),r=i(1702),o=i(8006),s=i(25181),a=i(19670),l=r([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),i=s.f;return i?l(t,i(e)):t}},40857:(e,t,i)=>{var n=i(17854);e.exports=n},12534:e=>{e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},38845:(e,t,i)=>{i(51532),i(4129);var n=i(35005),r=i(1702),o=i(72309),s=n("Map"),a=n("WeakMap"),l=r([].push),c=o("metadata"),h=c.store||(c.store=new a),u=function(e,t,i){var n=h.get(e);if(!n){if(!i)return;h.set(e,n=new s)}var r=n.get(t);if(!r){if(!i)return;n.set(t,r=new s)}return r};e.exports={store:h,getMap:u,has:function(e,t,i){var n=u(t,i,!1);return void 0!==n&&n.has(e)},get:function(e,t,i){var n=u(t,i,!1);return void 0===n?void 0:n.get(e)},set:function(e,t,i,n){u(i,n,!0).set(e,t)},keys:function(e,t){var i=u(e,t,!1),n=[];return i&&i.forEach((function(e,t){l(n,t)})),n},toKey:function(e){return void 0===e||"symbol"==typeof e?e:String(e)}}},67066:(e,t,i)=>{"use strict";var n=i(19670);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},84488:(e,t,i)=>{var n=i(68554),r=TypeError;e.exports=function(e){if(n(e))throw r("Can't call method on "+e);return e}},46465:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},96340:(e,t,i)=>{"use strict";var n=i(35005),r=i(3070),o=i(5112),s=i(19781),a=o("species");e.exports=function(e){var t=n(e),i=r.f;s&&t&&!t[a]&&i(t,a,{configurable:!0,get:function(){return this}})}},58003:(e,t,i)=>{var n=i(3070).f,r=i(92597),o=i(5112)("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!r(e,o)&&n(e,o,{configurable:!0,value:t})}},6200:(e,t,i)=>{var n=i(72309),r=i(69711),o=n("keys");e.exports=function(e){return o[e]||(o[e]=r(e))}},5465:(e,t,i)=>{var n=i(17854),r=i(13072),o="__core-js_shared__",s=n[o]||r(o,{});e.exports=s},72309:(e,t,i)=>{var n=i(31913),r=i(5465);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.3",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE",source:"https://github.com/zloirock/core-js"})},36707:(e,t,i)=>{var n=i(19670),r=i(39483),o=i(68554),s=i(5112)("species");e.exports=function(e,t){var i,a=n(e).constructor;return void 0===a||o(i=n(a)[s])?t:r(i)}},28710:(e,t,i)=>{var n=i(1702),r=i(19303),o=i(41340),s=i(84488),a=n("".charAt),l=n("".charCodeAt),c=n("".slice),h=function(e){return function(t,i){var n,h,u=o(s(t)),d=r(i),p=u.length;return d<0||d>=p?e?"":void 0:(n=l(u,d))<55296||n>56319||d+1===p||(h=l(u,d+1))<56320||h>57343?e?a(u,d):n:e?c(u,d,d+2):h-56320+(n-55296<<10)+65536}};e.exports={codeAt:h(!1),charAt:h(!0)}},53111:(e,t,i)=>{var n=i(1702),r=i(84488),o=i(41340),s=i(81361),a=n("".replace),l="["+s+"]",c=RegExp("^"+l+l+"*"),h=RegExp(l+l+"*$"),u=function(e){return function(t){var i=o(r(t));return 1&e&&(i=a(i,c,"")),2&e&&(i=a(i,h,"")),i}};e.exports={start:u(1),end:u(2),trim:u(3)}},36293:(e,t,i)=>{var n=i(7392),r=i(47293);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},20261:(e,t,i)=>{var n,r,o,s,a=i(17854),l=i(22104),c=i(49974),h=i(60614),u=i(92597),d=i(47293),p=i(60490),f=i(50206),m=i(80317),g=i(48053),v=i(6833),y=i(35268),b=a.setImmediate,x=a.clearImmediate,_=a.process,E=a.Dispatch,A=a.Function,S=a.MessageChannel,w=a.String,M=0,T={},C="onreadystatechange";try{n=a.location}catch(e){}var P=function(e){if(u(T,e)){var t=T[e];delete T[e],t()}},D=function(e){return function(){P(e)}},L=function(e){P(e.data)},I=function(e){a.postMessage(w(e),n.protocol+"//"+n.host)};b&&x||(b=function(e){g(arguments.length,1);var t=h(e)?e:A(e),i=f(arguments,1);return T[++M]=function(){l(t,void 0,i)},r(M),M},x=function(e){delete T[e]},y?r=function(e){_.nextTick(D(e))}:E&&E.now?r=function(e){E.now(D(e))}:S&&!v?(s=(o=new S).port2,o.port1.onmessage=L,r=c(s.postMessage,s)):a.addEventListener&&h(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!d(I)?(r=I,a.addEventListener("message",L,!1)):r=C in m("script")?function(e){p.appendChild(m("script")).onreadystatechange=function(){p.removeChild(this),P(e)}}:function(e){setTimeout(D(e),0)}),e.exports={set:b,clear:x}},51400:(e,t,i)=>{var n=i(19303),r=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?r(i+t,0):o(i,t)}},45656:(e,t,i)=>{var n=i(68361),r=i(84488);e.exports=function(e){return n(r(e))}},19303:(e,t,i)=>{var n=i(74758);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},17466:(e,t,i)=>{var n=i(19303),r=Math.min;e.exports=function(e){return e>0?r(n(e),9007199254740991):0}},47908:(e,t,i)=>{var n=i(84488),r=Object;e.exports=function(e){return r(n(e))}},57593:(e,t,i)=>{var n=i(46916),r=i(70111),o=i(52190),s=i(58173),a=i(92140),l=i(5112),c=TypeError,h=l("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var i,l=s(e,h);if(l){if(void 0===t&&(t="default"),i=n(l,e,t),!r(i)||o(i))return i;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},34948:(e,t,i)=>{var n=i(57593),r=i(52190);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},51694:(e,t,i)=>{var n={};n[i(5112)("toStringTag")]="z",e.exports="[object z]"===String(n)},41340:(e,t,i)=>{var n=i(70648),r=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return r(e)}},66330:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},69711:(e,t,i)=>{var n=i(1702),r=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++r+o,36)}},43307:(e,t,i)=>{var n=i(36293);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3353:(e,t,i)=>{var n=i(19781),r=i(47293);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},48053:e=>{var t=TypeError;e.exports=function(e,i){if(e<i)throw t("Not enough arguments");return e}},94811:(e,t,i)=>{var n=i(17854),r=i(60614),o=n.WeakMap;e.exports=r(o)&&/native code/.test(String(o))},26800:(e,t,i)=>{var n=i(40857),r=i(92597),o=i(6061),s=i(3070).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});r(t,e)||s(t,e,{value:o.f(e)})}},6061:(e,t,i)=>{var n=i(5112);t.f=n},5112:(e,t,i)=>{var n=i(17854),r=i(72309),o=i(92597),s=i(69711),a=i(36293),l=i(43307),c=r("wks"),h=n.Symbol,u=h&&h.for,d=l?h:h&&h.withoutSetter||s;e.exports=function(e){if(!o(c,e)||!a&&"string"!=typeof c[e]){var t="Symbol."+e;a&&o(h,e)?c[e]=h[e]:c[e]=l&&u?u(t):d(t)}return c[e]}},81361:e=>{e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},69098:(e,t,i)=>{"use strict";i(77710)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),i(95631))},51532:(e,t,i)=>{i(69098)},92087:(e,t,i)=>{var n=i(17854),r=i(19781),o=i(47045),s=i(67066),a=i(47293),l=n.RegExp,c=l.prototype;r&&a((function(){var e=!0;try{l(".","d")}catch(t){e=!1}var t={},i="",n=e?"dgimsy":"gimsy",r=function(e,n){Object.defineProperty(t,e,{get:function(){return i+=n,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var s in e&&(o.hasIndices="d"),o)r(s,o[s]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(t)!==n||i!==n}))&&o(c,"flags",{configurable:!0,get:s})},41202:(e,t,i)=>{"use strict";var n,r=i(17854),o=i(1702),s=i(89190),a=i(62423),l=i(77710),c=i(29320),h=i(70111),u=i(52050),d=i(29909).enforce,p=i(94811),f=!r.ActiveXObject&&"ActiveXObject"in r,m=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},g=l("WeakMap",m,c);if(p&&f){n=c.getConstructor(m,"WeakMap",!0),a.enable();var v=g.prototype,y=o(v.delete),b=o(v.has),x=o(v.get),_=o(v.set);s(v,{delete:function(e){if(h(e)&&!u(e)){var t=d(this);return t.frozen||(t.frozen=new n),y(this,e)||t.frozen.delete(e)}return y(this,e)},has:function(e){if(h(e)&&!u(e)){var t=d(this);return t.frozen||(t.frozen=new n),b(this,e)||t.frozen.has(e)}return b(this,e)},get:function(e){if(h(e)&&!u(e)){var t=d(this);return t.frozen||(t.frozen=new n),b(this,e)?x(this,e):t.frozen.get(e)}return x(this,e)},set:function(e,t){if(h(e)&&!u(e)){var i=d(this);i.frozen||(i.frozen=new n),b(this,e)?_(this,e,t):i.frozen.set(e,t)}else _(this,e,t);return this}})}},4129:(e,t,i)=>{i(41202)},83475:(e,t,i)=>{"use strict";var n=i(19781),r=i(51223),o=i(47908),s=i(26244),a=i(47045);n&&(a(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=o(this),t=s(e);return 0==t?0:t-1}}),r("lastIndex"))},46273:(e,t,i)=>{"use strict";var n=i(19781),r=i(51223),o=i(47908),s=i(26244),a=i(47045);n&&(a(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=o(this),t=s(e);return 0==t?void 0:e[t-1]},set:function(e){var t=o(this),i=s(t);return t[0==i?0:i-1]=e}}),r("lastItem"))},51568:(e,t,i)=>{var n=i(82109),r=i(22104),o=i(10313),s=i(35005),a=i(70030),l=Object,c=function(){var e=s("Object","freeze");return e?e(a(null)):a(null)};n({global:!0,forced:!0},{compositeKey:function(){return r(o,l,arguments).get("object",c)}})},26349:(e,t,i)=>{var n=i(82109),r=i(10313),o=i(35005),s=i(22104);n({global:!0,forced:!0},{compositeSymbol:function(){return 1==arguments.length&&"string"==typeof arguments[0]?o("Symbol").for(arguments[0]):s(r,null,arguments).get("symbol",o("Symbol"))}})},10072:(e,t,i)=>{"use strict";i(82109)({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:i(34092)})},99137:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(49974),s=i(54647),a=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{every:function(e){var t=r(this),i=s(t),n=o(e,arguments.length>1?arguments[1]:void 0);return!a(i,(function(e,i,r){if(!n(i,e,t))return r()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},71957:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(49974),s=i(46916),a=i(19662),l=i(19670),c=i(36707),h=i(54647),u=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{filter:function(e){var t=l(this),i=h(t),n=o(e,arguments.length>1?arguments[1]:void 0),d=new(c(t,r("Map"))),p=a(d.set);return u(i,(function(e,i){n(i,e,t)&&s(p,d,e,i)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),d}})},103:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(49974),s=i(54647),a=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(e){var t=r(this),i=s(t),n=o(e,arguments.length>1?arguments[1]:void 0);return a(i,(function(e,i,r){if(n(i,e,t))return r(e)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},96306:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(49974),s=i(54647),a=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{find:function(e){var t=r(this),i=s(t),n=o(e,arguments.length>1?arguments[1]:void 0);return a(i,(function(e,i,r){if(n(i,e,t))return r(i)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},8582:(e,t,i)=>{i(82109)({target:"Map",stat:!0,forced:!0},{from:i(27296)})},90618:(e,t,i)=>{"use strict";var n=i(82109),r=i(46916),o=i(1702),s=i(19662),a=i(18554),l=i(20408),c=o([].push);n({target:"Map",stat:!0,forced:!0},{groupBy:function(e,t){s(t);var i=a(e),n=new this,o=s(n.has),h=s(n.get),u=s(n.set);return l(i,(function(e){var i=t(e);r(o,n,i)?c(r(h,n,i),e):r(u,n,i,[e])}),{IS_ITERATOR:!0}),n}})},74592:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(54647),s=i(46465),a=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{includes:function(e){return a(o(r(this)),(function(t,i,n){if(s(i,e))return n()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},88440:(e,t,i)=>{"use strict";var n=i(82109),r=i(46916),o=i(20408),s=i(19662);n({target:"Map",stat:!0,forced:!0},{keyBy:function(e,t){var i=new this;s(t);var n=s(i.set);return o(e,(function(e){r(n,i,t(e),e)})),i}})},58276:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(54647),s=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(e){return s(o(r(this)),(function(t,i,n){if(i===e)return n(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},35082:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(49974),s=i(46916),a=i(19662),l=i(19670),c=i(36707),h=i(54647),u=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(e){var t=l(this),i=h(t),n=o(e,arguments.length>1?arguments[1]:void 0),d=new(c(t,r("Map"))),p=a(d.set);return u(i,(function(e,i){s(p,d,n(i,e,t),i)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),d}})},12813:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(49974),s=i(46916),a=i(19662),l=i(19670),c=i(36707),h=i(54647),u=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function(e){var t=l(this),i=h(t),n=o(e,arguments.length>1?arguments[1]:void 0),d=new(c(t,r("Map"))),p=a(d.set);return u(i,(function(e,i){s(p,d,e,n(i,e,t))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),d}})},18222:(e,t,i)=>{"use strict";var n=i(82109),r=i(19662),o=i(19670),s=i(20408);n({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(e){for(var t=o(this),i=r(t.set),n=arguments.length,a=0;a<n;)s(arguments[a++],i,{that:t,AS_ENTRIES:!0});return t}})},24838:(e,t,i)=>{i(82109)({target:"Map",stat:!0,forced:!0},{of:i(82044)})},38563:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(19662),s=i(54647),a=i(20408),l=TypeError;n({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=r(this),i=s(t),n=arguments.length<2,c=n?void 0:arguments[1];if(o(e),a(i,(function(i,r){n?(n=!1,c=r):c=e(c,r,i,t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),n)throw l("Reduce of empty map with no initial value");return c}})},50336:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(49974),s=i(54647),a=i(20408);n({target:"Map",proto:!0,real:!0,forced:!0},{some:function(e){var t=r(this),i=s(t),n=o(e,arguments.length>1?arguments[1]:void 0);return a(i,(function(e,i,r){if(n(i,e,t))return r()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},7512:(e,t,i)=>{"use strict";var n=i(82109),r=i(46916),o=i(19670),s=i(19662),a=TypeError;n({target:"Map",proto:!0,real:!0,forced:!0},{update:function(e,t){var i=o(this),n=s(i.get),l=s(i.has),c=s(i.set),h=arguments.length;s(t);var u=r(l,i,e);if(!u&&h<3)throw a("Updating absent value");var d=u?r(n,i,e):s(h>2?arguments[2]:void 0)(e,i);return r(c,i,e,t(d,e,i)),i}})},46603:(e,t,i)=>{var n=i(82109),r=Math.min,o=Math.max;n({target:"Math",stat:!0,forced:!0},{clamp:function(e,t,i){return r(i,o(t,e))}})},70100:(e,t,i)=>{i(82109)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{DEG_PER_RAD:Math.PI/180})},10490:(e,t,i)=>{var n=i(82109),r=180/Math.PI;n({target:"Math",stat:!0,forced:!0},{degrees:function(e){return e*r}})},13187:(e,t,i)=>{var n=i(82109),r=i(47103),o=i(26130);n({target:"Math",stat:!0,forced:!0},{fscale:function(e,t,i,n,s){return o(r(e,t,i,n,s))}})},60092:(e,t,i)=>{i(82109)({target:"Math",stat:!0,forced:!0},{iaddh:function(e,t,i,n){var r=e>>>0,o=i>>>0;return(t>>>0)+(n>>>0)+((r&o|(r|o)&~(r+o>>>0))>>>31)|0}})},19041:(e,t,i)=>{i(82109)({target:"Math",stat:!0,forced:!0},{imulh:function(e,t){var i=65535,n=+e,r=+t,o=n&i,s=r&i,a=n>>16,l=r>>16,c=(a*s>>>0)+(o*s>>>16);return a*l+(c>>16)+((o*l>>>0)+(c&i)>>16)}})},30666:(e,t,i)=>{i(82109)({target:"Math",stat:!0,forced:!0},{isubh:function(e,t,i,n){var r=e>>>0,o=i>>>0;return(t>>>0)-(n>>>0)-((~r&o|~(r^o)&r-o>>>0)>>>31)|0}})},51638:(e,t,i)=>{i(82109)({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},62975:(e,t,i)=>{var n=i(82109),r=Math.PI/180;n({target:"Math",stat:!0,forced:!0},{radians:function(e){return e*r}})},15728:(e,t,i)=>{i(82109)({target:"Math",stat:!0,forced:!0},{scale:i(47103)})},46056:(e,t,i)=>{var n=i(82109),r=i(19670),o=i(77023),s=i(63061),a=i(76178),l=i(29909),c="Seeded Random",h="Seeded Random Generator",u=l.set,d=l.getterFor(h),p=TypeError,f=s((function(e){u(this,{type:h,seed:e%2147483647})}),c,(function(){var e=d(this),t=e.seed=(1103515245*e.seed+12345)%2147483647;return a((1073741823&t)/1073741823,!1)}));n({target:"Math",stat:!0,forced:!0},{seededPRNG:function(e){var t=r(e).seed;if(!o(t))throw p('Math.seededPRNG() argument should have a "seed" field with a finite value.');return new f(t)}})},44299:(e,t,i)=>{i(82109)({target:"Math",stat:!0,forced:!0},{signbit:function(e){var t=+e;return t==t&&0==t?1/t==-1/0:t<0}})},5162:(e,t,i)=>{i(82109)({target:"Math",stat:!0,forced:!0},{umulh:function(e,t){var i=65535,n=+e,r=+t,o=n&i,s=r&i,a=n>>>16,l=r>>>16,c=(a*s>>>0)+(o*s>>>16);return a*l+(c>>>16)+((o*l>>>0)+(c&i)>>>16)}})},50292:(e,t,i)=>{"use strict";var n=i(82109),r=i(1702),o=i(19303),s=i(83009),a="Invalid number representation",l=RangeError,c=SyntaxError,h=TypeError,u=/^[\da-z]+$/,d=r("".charAt),p=r(u.exec),f=r(1..toString),m=r("".slice);n({target:"Number",stat:!0,forced:!0},{fromString:function(e,t){var i,n,r=1;if("string"!=typeof e)throw h(a);if(!e.length)throw c(a);if("-"==d(e,0)&&(r=-1,!(e=m(e,1)).length))throw c(a);if((i=void 0===t?10:o(t))<2||i>36)throw l("Invalid radix");if(!p(u,e)||f(n=s(e,i),i)!==e)throw c(a);return r*n}})},39769:(e,t,i)=>{"use strict";var n=i(82109),r=i(46916),o=i(19781),s=i(96340),a=i(19662),l=i(19670),c=i(25787),h=i(60614),u=i(68554),d=i(70111),p=i(58173),f=i(98052),m=i(89190),g=i(47045),v=i(842),y=i(5112),b=i(29909),x=i(90515),_=y("observable"),E="Observable",A="Subscription",S="SubscriptionObserver",w=b.getterFor,M=b.set,T=w(E),C=w(A),P=w(S),D=function(e){this.observer=l(e),this.cleanup=void 0,this.subscriptionObserver=void 0};D.prototype={type:A,clean:function(){var e=this.cleanup;if(e){this.cleanup=void 0;try{e()}catch(e){v(e)}}},close:function(){if(!o){var e=this.facade,t=this.subscriptionObserver;e.closed=!0,t&&(t.closed=!0)}this.observer=void 0},isClosed:function(){return void 0===this.observer}};var L=function(e,t){var i,n=M(this,new D(e));o||(this.closed=!1);try{(i=p(e,"start"))&&r(i,e,this)}catch(e){v(e)}if(!n.isClosed()){var s=n.subscriptionObserver=new I(n);try{var l=t(s),c=l;u(l)||(n.cleanup=h(l.unsubscribe)?function(){c.unsubscribe()}:a(l))}catch(e){return void s.error(e)}n.isClosed()&&n.clean()}};L.prototype=m({},{unsubscribe:function(){var e=C(this);e.isClosed()||(e.close(),e.clean())}}),o&&g(L.prototype,"closed",{configurable:!0,get:function(){return C(this).isClosed()}});var I=function(e){M(this,{type:S,subscriptionState:e}),o||(this.closed=!1)};I.prototype=m({},{next:function(e){var t=P(this).subscriptionState;if(!t.isClosed()){var i=t.observer;try{var n=p(i,"next");n&&r(n,i,e)}catch(e){v(e)}}},error:function(e){var t=P(this).subscriptionState;if(!t.isClosed()){var i=t.observer;t.close();try{var n=p(i,"error");n?r(n,i,e):v(e)}catch(e){v(e)}t.clean()}},complete:function(){var e=P(this).subscriptionState;if(!e.isClosed()){var t=e.observer;e.close();try{var i=p(t,"complete");i&&r(i,t)}catch(e){v(e)}e.clean()}}}),o&&g(I.prototype,"closed",{configurable:!0,get:function(){return P(this).subscriptionState.isClosed()}});var R=function(e){c(this,O),M(this,{type:E,subscriber:a(e)})},O=R.prototype;m(O,{subscribe:function(e){var t=arguments.length;return new L(h(e)?{next:e,error:t>1?arguments[1]:void 0,complete:t>2?arguments[2]:void 0}:d(e)?e:{},T(this).subscriber)}}),f(O,_,(function(){return this})),n({global:!0,constructor:!0,forced:x},{Observable:R}),s(E)},93532:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(46916),s=i(19670),a=i(4411),l=i(18554),c=i(58173),h=i(20408),u=i(5112),d=i(90515),p=u("observable");n({target:"Observable",stat:!0,forced:d},{from:function(e){var t=a(this)?this:r("Observable"),i=c(s(e),p);if(i){var n=s(o(i,e));return n.constructor===t?n:new t((function(e){return n.subscribe(e)}))}var u=l(e);return new t((function(e){h(u,(function(t,i){if(e.next(t),e.closed)return i()}),{IS_ITERATOR:!0,INTERRUPTED:!0}),e.complete()}))}})},1025:(e,t,i)=>{i(39769),i(93532),i(88170)},88170:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(4411),s=i(90515),a=r("Array");n({target:"Observable",stat:!0,forced:s},{of:function(){for(var e=o(this)?this:r("Observable"),t=arguments.length,i=a(t),n=0;n<t;)i[n]=arguments[n++];return new e((function(e){for(var n=0;n<t;n++)if(e.next(i[n]),e.closed)return;e.complete()}))}})},77479:(e,t,i)=>{"use strict";var n=i(82109),r=i(78523),o=i(12534);n({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=r.f(this),i=o(e);return(i.error?t.reject:t.resolve)(i.value),t.promise}})},34582:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=r.toKey,a=r.set;n({target:"Reflect",stat:!0},{defineMetadata:function(e,t,i){var n=arguments.length<4?void 0:s(arguments[3]);a(e,t,o(i),n)}})},47896:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=r.toKey,a=r.getMap,l=r.store;n({target:"Reflect",stat:!0},{deleteMetadata:function(e,t){var i=arguments.length<3?void 0:s(arguments[2]),n=a(o(t),i,!1);if(void 0===n||!n.delete(e))return!1;if(n.size)return!0;var r=l.get(t);return r.delete(i),!!r.size||l.delete(t)}})},98558:(e,t,i)=>{var n=i(82109),r=i(1702),o=i(38845),s=i(19670),a=i(79518),l=r(i(60956)),c=r([].concat),h=o.keys,u=o.toKey,d=function(e,t){var i=h(e,t),n=a(e);if(null===n)return i;var r=d(n,t);return r.length?i.length?l(c(i,r)):r:i};n({target:"Reflect",stat:!0},{getMetadataKeys:function(e){var t=arguments.length<2?void 0:u(arguments[1]);return d(s(e),t)}})},12647:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=i(79518),a=r.has,l=r.get,c=r.toKey,h=function(e,t,i){if(a(e,t,i))return l(e,t,i);var n=s(t);return null!==n?h(e,n,i):void 0};n({target:"Reflect",stat:!0},{getMetadata:function(e,t){var i=arguments.length<3?void 0:c(arguments[2]);return h(e,o(t),i)}})},97507:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=r.keys,a=r.toKey;n({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(e){var t=arguments.length<2?void 0:a(arguments[1]);return s(o(e),t)}})},84018:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=r.get,a=r.toKey;n({target:"Reflect",stat:!0},{getOwnMetadata:function(e,t){var i=arguments.length<3?void 0:a(arguments[2]);return s(e,o(t),i)}})},61605:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=i(79518),a=r.has,l=r.toKey,c=function(e,t,i){if(a(e,t,i))return!0;var n=s(t);return null!==n&&c(e,n,i)};n({target:"Reflect",stat:!0},{hasMetadata:function(e,t){var i=arguments.length<3?void 0:l(arguments[2]);return c(e,o(t),i)}})},49076:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=r.has,a=r.toKey;n({target:"Reflect",stat:!0},{hasOwnMetadata:function(e,t){var i=arguments.length<3?void 0:a(arguments[2]);return s(e,o(t),i)}})},34999:(e,t,i)=>{var n=i(82109),r=i(38845),o=i(19670),s=r.toKey,a=r.set;n({target:"Reflect",stat:!0},{metadata:function(e,t){return function(i,n){a(e,t,o(i),s(n))}}})},88921:(e,t,i)=>{"use strict";i(82109)({target:"Set",proto:!0,real:!0,forced:!0},{addAll:i(31501)})},96248:(e,t,i)=>{"use strict";i(82109)({target:"Set",proto:!0,real:!0,forced:!0},{deleteAll:i(34092)})},13599:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(46916),s=i(19662),a=i(19670),l=i(36707),c=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){var t=a(this),i=new(l(t,r("Set")))(t),n=s(i.delete);return c(e,(function(e){o(n,i,e)})),i}})},11477:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(49974),s=i(96767),a=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=r(this),i=s(t),n=o(e,arguments.length>1?arguments[1]:void 0);return!a(i,(function(e,i){if(!n(e,e,t))return i()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},64362:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(46916),s=i(19662),a=i(19670),l=i(49974),c=i(36707),h=i(96767),u=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=a(this),i=h(t),n=l(e,arguments.length>1?arguments[1]:void 0),d=new(c(t,r("Set"))),p=s(d.add);return u(i,(function(e){n(e,e,t)&&o(p,d,e)}),{IS_ITERATOR:!0}),d}})},15389:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(49974),s=i(96767),a=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=r(this),i=s(t),n=o(e,arguments.length>1?arguments[1]:void 0);return a(i,(function(e,i){if(n(e,e,t))return i(e)}),{IS_ITERATOR:!0,INTERRUPTED:!0}).result}})},46006:(e,t,i)=>{i(82109)({target:"Set",stat:!0,forced:!0},{from:i(27296)})},90401:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(46916),s=i(19662),a=i(19670),l=i(36707),c=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){var t=a(this),i=new(l(t,r("Set"))),n=s(t.has),h=s(i.add);return c(e,(function(e){o(n,t,e)&&o(h,i,e)})),i}})},45164:(e,t,i)=>{"use strict";var n=i(82109),r=i(46916),o=i(19662),s=i(19670),a=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){var t=s(this),i=o(t.has);return!a(e,(function(e,n){if(!0===r(i,t,e))return n()}),{INTERRUPTED:!0}).stopped}})},91238:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(46916),s=i(19662),a=i(60614),l=i(19670),c=i(18554),h=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){var t=c(this),i=l(e),n=i.has;return a(n)||(i=new(r("Set"))(e),n=s(i.has)),!h(t,(function(e,t){if(!1===o(n,i,e))return t()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},54837:(e,t,i)=>{"use strict";var n=i(82109),r=i(46916),o=i(19662),s=i(19670),a=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){var t=s(this),i=o(t.has);return!a(e,(function(e,n){if(!1===r(i,t,e))return n()}),{INTERRUPTED:!0}).stopped}})},87485:(e,t,i)=>{"use strict";var n=i(82109),r=i(1702),o=i(19670),s=i(41340),a=i(96767),l=i(20408),c=r([].join),h=[].push;n({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=o(this),i=a(t),n=void 0===e?",":s(e),r=[];return l(i,h,{that:r,IS_ITERATOR:!0}),c(r,n)}})},56767:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(49974),s=i(46916),a=i(19662),l=i(19670),c=i(36707),h=i(96767),u=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=l(this),i=h(t),n=o(e,arguments.length>1?arguments[1]:void 0),d=new(c(t,r("Set"))),p=a(d.add);return u(i,(function(e){s(p,d,n(e,e,t))}),{IS_ITERATOR:!0}),d}})},69916:(e,t,i)=>{i(82109)({target:"Set",stat:!0,forced:!0},{of:i(82044)})},76651:(e,t,i)=>{"use strict";var n=i(82109),r=i(19662),o=i(19670),s=i(96767),a=i(20408),l=TypeError;n({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=o(this),i=s(t),n=arguments.length<2,c=n?void 0:arguments[1];if(r(e),a(i,(function(i){n?(n=!1,c=i):c=e(c,i,i,t)}),{IS_ITERATOR:!0}),n)throw l("Reduce of empty set with no initial value");return c}})},61437:(e,t,i)=>{"use strict";var n=i(82109),r=i(19670),o=i(49974),s=i(96767),a=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=r(this),i=s(t),n=o(e,arguments.length>1?arguments[1]:void 0);return a(i,(function(e,i){if(n(e,e,t))return i()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},35285:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(46916),s=i(19662),a=i(19670),l=i(36707),c=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){var t=a(this),i=new(l(t,r("Set")))(t),n=s(i.delete),h=s(i.add);return c(e,(function(e){o(n,i,e)||o(h,i,e)})),i}})},39865:(e,t,i)=>{"use strict";var n=i(82109),r=i(35005),o=i(19662),s=i(19670),a=i(36707),l=i(20408);n({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){var t=s(this),i=new(a(t,r("Set")))(t);return l(e,o(i.add),{that:i}),i}})},86035:(e,t,i)=>{"use strict";var n=i(82109),r=i(28710).charAt,o=i(84488),s=i(19303),a=i(41340);n({target:"String",proto:!0,forced:!0},{at:function(e){var t=a(o(this)),i=t.length,n=s(e),l=n>=0?n:i+n;return l<0||l>=i?void 0:r(t,l)}})},67501:(e,t,i)=>{"use strict";var n=i(82109),r=i(63061),o=i(76178),s=i(84488),a=i(41340),l=i(29909),c=i(28710),h=c.codeAt,u=c.charAt,d="String Iterator",p=l.set,f=l.getterFor(d),m=r((function(e){p(this,{type:d,string:e,index:0})}),"String",(function(){var e,t=f(this),i=t.string,n=t.index;return n>=i.length?o(void 0,!0):(e=u(i,n),t.index+=e.length,o({codePoint:h(e,0),position:n},!1))}));n({target:"String",proto:!0,forced:!0},{codePoints:function(){return new m(a(s(this)))}})},21568:(e,t,i)=>{i(26800)("dispose")},48824:(e,t,i)=>{i(26800)("observable")},44130:(e,t,i)=>{i(26800)("patternMatch")},78206:(e,t,i)=>{"use strict";i(82109)({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:i(34092)})},76478:(e,t,i)=>{i(82109)({target:"WeakMap",stat:!0,forced:!0},{from:i(27296)})},79715:(e,t,i)=>{i(82109)({target:"WeakMap",stat:!0,forced:!0},{of:i(82044)})},43561:(e,t,i)=>{"use strict";i(82109)({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:i(31501)})},32049:(e,t,i)=>{"use strict";i(82109)({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:i(34092)})},86020:(e,t,i)=>{i(82109)({target:"WeakSet",stat:!0,forced:!0},{from:i(27296)})},56585:(e,t,i)=>{i(82109)({target:"WeakSet",stat:!0,forced:!0},{of:i(82044)})},11091:(e,t,i)=>{var n=i(82109),r=i(17854),o=i(20261).clear;n({global:!0,bind:!0,enumerable:!0,forced:r.clearImmediate!==o},{clearImmediate:o})},84633:(e,t,i)=>{i(11091),i(12986)},12986:(e,t,i)=>{var n=i(82109),r=i(17854),o=i(20261).set;n({global:!0,bind:!0,enumerable:!0,forced:r.setImmediate!==o},{setImmediate:o})},54098:function(e,t){var i="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();!function(e){!function(t){var i="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,r="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,i){e.onload=function(){t(e.result)},e.onerror=function(){i(e.error)}}))}function m(e){var t=new FileReader,i=f(t);return t.readAsArrayBuffer(e),i}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&r&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e,t,i,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,i=f(t),t.readAsText(e),i;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),i=new Array(t.length),n=0;n<t.length;n++)i[n]=String.fromCharCode(t[n]);return i.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=h(t);var i=this.map[e];this.map[e]=i?i+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=h(t)},d.prototype.forEach=function(e,t){for(var i in this.map)this.map.hasOwnProperty(i)&&e.call(t,this.map[i],i,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,i){e.push(i)})),u(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),u(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,i){e.push([i,t])})),u(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var i,n,r=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(i=t.method||this.method||"GET",n=i.toUpperCase(),y.indexOf(n)>-1?n:i),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var i=e.split("="),n=i.shift().replace(/\+/g," "),r=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(r))}})),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];_.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var i=Error(e);this.stack=i.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function A(e,i){return new Promise((function(n,o){var s=new b(e,i);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,i={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var i=e.split(":"),n=i.shift().trim();if(n){var r=i.join(":").trim();t.append(n,r)}})),t)};i.url="responseURL"in a?a.responseURL:i.headers.get("X-Request-URL");var r="response"in a?a.response:a.responseText;n(new _(r,i))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&r&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",l)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}A.polyfill=!0,e.fetch||(e.fetch=A,e.Headers=d,e.Request=b,e.Response=_),t.Headers=d,t.Request=b,t.Response=_,t.fetch=A,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var r=n;(t=r.fetch).default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t},24414:function(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(33242),s=i(5076);t.backOff=function(e,t){return void 0===t&&(t={}),n(this,void 0,void 0,(function(){var i;return r(this,(function(n){switch(n.label){case 0:return i=o.getSanitizedOptions(t),[4,new a(e,i).execute()];case 1:return[2,n.sent()]}}))}))};var a=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return n(this,void 0,void 0,(function(){var e;return r(this,(function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}}))}))},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return n(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,s.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}}))}))},e}()},79966:function(e,t,i){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i(21617).Delay);t.AlwaysDelay=o},21617:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(16755),r=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise((function(t){return setTimeout(t,e.jitteredDelay)}))},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return n.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var e=this.options.startingDelay,t=this.options.timeMultiple,i=this.numOfDelayedAttempts,n=e*Math.pow(t,i);return Math.min(n,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();t.Delay=r},5076:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(21954),r=i(79966);t.DelayFactory=function(e,t){var i=function(e){if(!e.delayFirstAttempt)return new n.SkipFirstDelay(e);return new r.AlwaysDelay(e)}(e);return i.setAttemptNumber(t),i}},21954:function(e,t,i){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},n(e,t)},function(e,t){function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}l((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.apply=function(){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]}))}))},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(i(21617).Delay);t.SkipFirstDelay=a},59813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullJitter=function(e){var t=Math.random()*e;return Math.round(t)}},16755:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(59813),r=i(20478);t.JitterFactory=function(e){return"full"===e.jitter?n.fullJitter:r.noJitter}},20478:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noJitter=function(e){return e}},33242:function(e,t){"use strict";var i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var n={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};t.getSanitizedOptions=function(e){var t=i(i({},n),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}},71224:(e,t,i)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function o(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(i).filter((function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach((function(t){r(e,t,i[t])}))}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}i.d(t,{Z:()=>j});var f={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},m=new(function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.init(t,i)}return l(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||f,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,i,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(i).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,o({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),g=function(){function e(){s(this,e),this.observers={}}return l(e,[{key:"on",value:function(e,t){var i=this;return e.split(" ").forEach((function(e){i.observers[e]=i.observers[e]||[],i.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if(this.observers[e]){var r=[].concat(this.observers[e]);r.forEach((function(e){e.apply(void 0,i)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(i))}))}}}]),e}();function v(){var e,t,i=new Promise((function(i,n){e=i,t=n}));return i.resolve=e,i.reject=t,i}function y(e){return null==e?"":""+e}function b(e,t,i){e.forEach((function(e){t[e]&&(i[e]=t[e])}))}function x(e,t,i){function n(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function r(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(r())return{};var s=n(o.shift());!e[s]&&i&&(e[s]=new i),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return r()?{}:{obj:e,k:n(o.shift())}}function _(e,t,i){var n=x(e,t,Object);n.obj[n.k]=i}function E(e,t){var i=x(e,t),n=i.obj,r=i.k;if(n)return n[r]}function A(e,t,i){var n=E(e,i);return void 0!==n?n:E(t,i)}function S(e,t,i){for(var n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?i&&(e[n]=t[n]):S(e[n],t[n],i):e[n]=t[n]);return e}function w(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function T(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return M[e]})):e}var C="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;function P(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var n=t.split(i),r=e,o=0;o<n.length;++o){if(!r)return;if("string"==typeof r[n[o]]&&o+1<n.length)return;if(void 0===r[n[o]]){for(var s=2,a=n.slice(o,o+s).join(i),l=r[a];void 0===l&&n.length>o+s;)s++,l=r[a=n.slice(o,o+s).join(i)];if(void 0===l)return;if("string"==typeof l)return l;if(a&&"string"==typeof l[a])return l[a];var c=n.slice(o+s).join(i);return c?P(l,c,i):void 0}r=r[n[o]]}return r}}var D=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return s(this,t),i=h(this,u(t).call(this)),C&&g.call(c(i)),i.data=e||{},i.options=n,void 0===i.options.keySeparator&&(i.options.keySeparator="."),void 0===i.options.ignoreJSONStructure&&(i.options.ignoreJSONStructure=!0),i}return p(t,e),l(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[e,t];i&&"string"!=typeof i&&(s=s.concat(i)),i&&"string"==typeof i&&(s=s.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(s=e.split("."));var a=E(this.data,s);return a||!o||"string"!=typeof i?a:P(this.data&&this.data[e]&&this.data[e][t],i,r)}},{key:"addResource",value:function(e,t,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];i&&(s=s.concat(o?i.split(o):i)),e.indexOf(".")>-1&&(n=t,t=(s=e.split("."))[1]),this.addNamespaces(t),_(this.data,s,n),r.silent||this.emit("added",e,t,i,n)}},{key:"addResources",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in i)"string"!=typeof i[r]&&"[object Array]"!==Object.prototype.toString.apply(i[r])||this.addResource(e,t,r,i[r],{silent:!0});n.silent||this.emit("added",e,t,i)}},{key:"addResourceBundle",value:function(e,t,i,n,r){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(n=i,i=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var l=E(this.data,a)||{};n?S(l,i,r):l=o({},l,i),_(this.data,a,l),s.silent||this.emit("added",e,t,i)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(g),L={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,i,n,r){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,i,n,r))})),t}},I={},R=function(e){function t(e){var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,t),i=h(this,u(t).call(this)),C&&g.call(c(i)),b(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,c(i)),i.options=n,void 0===i.options.keySeparator&&(i.options.keySeparator="."),i.logger=m.create("translator"),i}return p(t,e),l(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var i=this.resolve(e,t);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(e,t){var i=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS;if(i&&e.indexOf(i)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:r};var s=e.split(i);(i!==n||i===n&&this.options.ns.indexOf(s[0])>-1)&&(r=s.shift()),e=s.join(n)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:"translate",value:function(e,i,r){var s=this;if("object"!==n(i)&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,l=this.extractFromKey(e[e.length-1],i),c=l.key,h=l.namespaces,u=h[h.length-1],d=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(p){var f=i.nsSeparator||this.options.nsSeparator;return u+f+c}return c}var m=this.resolve(e,i),g=m&&m.res,v=m&&m.usedKey||c,y=m&&m.exactUsedKey||c,b=Object.prototype.toString.apply(g),x=["[object Number]","[object Function]","[object RegExp]"],_=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,A="string"!=typeof g&&"boolean"!=typeof g&&"number"!=typeof g;if(E&&g&&A&&x.indexOf(b)<0&&("string"!=typeof _||"[object Array]"!==b)){if(!i.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,g,o({},i,{ns:h})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(a){var S="[object Array]"===b,w=S?[]:{},M=S?y:v;for(var T in g)if(Object.prototype.hasOwnProperty.call(g,T)){var C="".concat(M).concat(a).concat(T);w[T]=this.translate(C,o({},i,{joinArrays:!1,ns:h})),w[T]===C&&(w[T]=g[T])}g=w}}else if(E&&"string"==typeof _&&"[object Array]"===b)(g=g.join(_))&&(g=this.extendTranslation(g,e,i,r));else{var P=!1,D=!1,L=void 0!==i.count&&"string"!=typeof i.count,I=t.hasDefaultValue(i),R=L?this.pluralResolver.getSuffix(d,i.count):"",O=i["defaultValue".concat(R)]||i.defaultValue;!this.isValidLookup(g)&&I&&(P=!0,g=O),this.isValidLookup(g)||(D=!0,g=c);var N=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,k=N&&D?void 0:g,F=I&&O!==g&&this.options.updateMissing;if(D||P||F){if(this.logger.log(F?"updateKey":"missingKey",d,u,c,F?O:g),a){var V=this.resolve(c,o({},i,{keySeparator:!1}));V&&V.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var U=[],B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&B&&B[0])for(var z=0;z<B.length;z++)U.push(B[z]);else"all"===this.options.saveMissingTo?U=this.languageUtils.toResolveHierarchy(i.lng||this.language):U.push(i.lng||this.language);var G=function(e,t,n){s.options.missingKeyHandler?s.options.missingKeyHandler(e,u,t,F?n:k,F,i):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(e,u,t,F?n:k,F,i),s.emit("missingKey",e,u,t,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&L?U.forEach((function(e){s.pluralResolver.getSuffixes(e).forEach((function(t){G([e],c+t,i["defaultValue".concat(t)]||O)}))})):G(U,c,O))}g=this.extendTranslation(g,e,i,m,r),D&&g===c&&this.options.appendNamespaceToMissingKey&&(g="".concat(u,":").concat(c)),(D||P)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(g))}return g}},{key:"extendTranslation",value:function(e,t,i,n,r){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,i,n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(o({},i,{interpolation:o({},this.options.interpolation,i.interpolation)}));var a,l=i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(l){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var h=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(h=o({},this.options.interpolation.defaultVariables,h)),e=this.interpolator.interpolate(e,h,i.lng||this.language,i),l){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(i.nest=!1)}!1!==i.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return r&&r[0]===n[0]&&!i.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(n[0]," in key: ").concat(t[0])),null):s.translate.apply(s,n.concat([t]))}),i)),i.interpolation&&this.interpolator.reset()}var d=i.postProcess||this.options.postProcess,p="string"==typeof d?[d]:d;return null!=e&&p&&p.length&&!1!==i.applyPostProcessor&&(e=L.handle(p,e,t,this.options&&this.options.postProcessPassResolved?o({i18nResolved:n},i):i,this)),e}},{key:"resolve",value:function(e){var t,i,n,r,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var l=s.extractFromKey(e,a),c=l.key;i=c;var h=l.namespaces;s.options.fallbackNS&&(h=h.concat(s.options.fallbackNS));var u=void 0!==a.count&&"string"!=typeof a.count,d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,p=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);h.forEach((function(e){s.isValidLookup(t)||(o=e,!I["".concat(p[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(I["".concat(p[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(i){if(!s.isValidLookup(t)){r=i;var o,l,h=c,p=[h];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(p,c,i,e,a);else u&&(o=s.pluralResolver.getSuffix(i,a.count)),u&&d&&p.push(h+o),d&&p.push(h+="".concat(s.options.contextSeparator).concat(a.context)),u&&p.push(h+=o);for(;l=p.pop();)s.isValidLookup(t)||(n=l,t=s.getResource(i,e,l,a))}})))}))}})),{res:t,usedKey:i,exactUsedKey:n,usedLng:r,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,n):this.resourceStore.getResource(e,t,i,n)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&void 0!==e[i])return!0;return!1}}]),t}(g);function O(e){return e.charAt(0).toUpperCase()+e.slice(1)}var N=function(){function e(t){s(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=m.create("languageUtils")}return l(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],i=e.split("-");return this.options.lowerCaseLng?i=i.map((function(e){return e.toLowerCase()})):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=O(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=O(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=O(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,i=this;return e?(e.forEach((function(e){if(!t){var n=i.formatLanguageCode(e);i.options.supportedLngs&&!i.isSupportedCode(n)||(t=n)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var n=i.getLanguagePartFromCode(e);if(i.isSupportedCode(n))return t=n;t=i.options.supportedLngs.find((function(e){if(0===e.indexOf(n))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}},{key:"toResolveHierarchy",value:function(e,t){var i=this,n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=function(e){e&&(i.isSupportedCode(e)?r.push(e):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach((function(e){r.indexOf(e)<0&&o(i.formatLanguageCode(e))})),r}}]),e}(),k=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],F={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function V(){var e={};return k.forEach((function(t){t.lngs.forEach((function(i){e[i]={numbers:t.nr,plurals:F[t.fc]}}))})),e}var U=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.languageUtils=t,this.options=i,this.logger=m.create("pluralResolver"),this.rules=V()}return l(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,i=this.getRule(e);return i?i.numbers.map((function(i){return t.getSuffix(e,i)})):[]}},{key:"getSuffix",value:function(e,t){var i=this,n=this.getRule(e);if(n){var r=n.noAbs?n.plurals(t):n.plurals(Math.abs(t)),o=n.numbers[r];this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===n.numbers.length&&1===n.numbers[0]?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),B=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.logger=m.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return l(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:T,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?w(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?w(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?w(t.nestingPrefix):t.nestingPrefixEscaped||w("$t("),this.nestingSuffix=t.nestingSuffix?w(t.nestingSuffix):t.nestingSuffixEscaped||w(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(e,t,i,n){var r,s,a,l=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(l.formatSeparator)<0){var r=A(t,c,e);return l.alwaysFormat?l.format(r,void 0,i,o({},n,t,{interpolationkey:e})):r}var s=e.split(l.formatSeparator),a=s.shift().trim(),h=s.join(l.formatSeparator).trim();return l.format(A(t,c,a),h,i,o({},n,t,{interpolationkey:a}))};this.resetRegExp();var d=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return h(e)}},{regex:this.regexp,safeValue:function(e){return l.escapeValue?h(l.escape(e)):h(e)}}].forEach((function(t){for(a=0;r=t.regex.exec(e);){if(void 0===(s=u(r[1].trim())))if("function"==typeof d){var i=d(e,r,n);s="string"==typeof i?i:""}else{if(p){s=r[0];continue}l.logger.warn("missed to pass in variable ".concat(r[1]," for interpolating ").concat(e)),s=""}else"string"==typeof s||l.useRawValueToEscape||(s=y(s));var o=t.safeValue(s);if(e=e.replace(r[0],o),p?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++a>=l.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var i,n,r=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o({},s);function l(e,t){var i=this.nestingOptionsSeparator;if(e.indexOf(i)<0)return e;var n=e.split(new RegExp("".concat(i,"[ ]*{"))),r="{".concat(n[1]);e=n[0],r=(r=this.interpolate(r,a)).replace(/'/g,'"');try{a=JSON.parse(r),t&&(a=o({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(i).concat(r)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;i=this.nestingRegexp.exec(e);){var c=[],h=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){var u=i[1].split(this.formatSeparator).map((function(e){return e.trim()}));i[1]=u.shift(),c=u,h=!0}if((n=t(l.call(this,i[1].trim(),a),a))&&i[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=y(n)),n||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(e)),n=""),h&&(n=c.reduce((function(e,t){return r.format(e,t,s.lng,o({},s,{interpolationkey:i[1].trim()}))}),n.trim())),e=e.replace(i[0],n),this.regexp.lastIndex=0}return e}}]),e}();var z=function(e){function t(e,i,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s(this,t),r=h(this,u(t).call(this)),C&&g.call(c(r)),r.backend=e,r.store=i,r.services=n,r.languageUtils=n.languageUtils,r.options=o,r.logger=m.create("backendConnector"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(n,o.backend,o),r}return p(t,e),l(t,[{key:"queueLoad",value:function(e,t,i,n){var r=this,o=[],s=[],a=[],l=[];return e.forEach((function(e){var n=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!i.reload&&r.store.hasResourceBundle(e,t)?r.state[a]=2:r.state[a]<0||(1===r.state[a]?s.indexOf(a)<0&&s.push(a):(r.state[a]=1,n=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),l.indexOf(t)<0&&l.push(t)))})),n||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:n}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,i){var n=e.split("|"),r=n[0],o=n[1];t&&this.emit("failedLoading",r,o,t),i&&this.store.addResourceBundle(r,o,i),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(i){var n,a,l,c,h,u;n=i.loaded,a=o,c=x(n,[r],Object),h=c.obj,u=c.k,h[u]=h[u]||[],l&&(h[u]=h[u].concat(a)),l||h[u].push(a),function(e,t){for(var i=e.indexOf(t);-1!==i;)e.splice(i,1),i=e.indexOf(t)}(i.pending,e),t&&i.errors.push(t),0!==i.pending.length||i.done||(Object.keys(i.loaded).forEach((function(e){s[e]||(s[e]=[]),i.loaded[e].length&&i.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,i){var n=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[i](e,t,(function(a,l){a&&l&&r<5?setTimeout((function(){n.read.call(n,e,t,i,r+1,2*o,s)}),o):s(a,l)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((function(e){i.loadOne(e)}))}},{key:"load",value:function(e,t,i){this.prepareLoading(e,t,{},i)}},{key:"reload",value:function(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}},{key:"loadOne",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(function(n,s){n&&t.logger.warn("".concat(i,"loading namespace ").concat(o," for language ").concat(r," failed"),n),!n&&s&&t.logger.log("".concat(i,"loaded namespace ").concat(o," for language ").concat(r),s),t.loaded(e,n,s)}))}},{key:"saveMissing",value:function(e,t,i,n,r){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=i&&""!==i&&(this.backend&&this.backend.create&&this.backend.create(e,t,i,n,null,o({},s,{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,i,n))}}]),t}(g);function G(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===n(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===n(e[2])||"object"===n(e[3])){var i=e[3]||e[2];Object.keys(i).forEach((function(e){t[e]=i[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,i,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}}}function H(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function W(){}const j=new(function(e){function t(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(s(this,t),e=h(this,u(t).call(this)),C&&g.call(c(e)),e.options=H(i),e.services={},e.logger=m,e.modules={external:[]},n&&!e.isInitialized&&!i.isClone){if(!e.options.initImmediate)return e.init(i,n),h(e,c(e));setTimeout((function(){e.init(i,n)}),0)}return e}return p(t,e),l(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;function n(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(i=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=o({},G(),this.options,H(t)),this.format=this.options.interpolation.format,i||(i=W),!this.options.isClone){this.modules.logger?m.init(n(this.modules.logger),this.options):m.init(null,this.options);var r=new N(this.options);this.store=new D(this.options.resources,this.options);var s=this.services;s.logger=m,s.resourceStore=this.store,s.languageUtils=r,s.pluralResolver=new U(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new B(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new z(n(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.emit.apply(e,[t].concat(n))})),this.modules.languageDetector&&(s.languageDetector=n(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=n(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new R(this.services,this.options),this.translator.on("*",(function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.emit.apply(e,[t].concat(n))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var l=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];l.forEach((function(t){e[t]=function(){var i;return(i=e.store)[t].apply(i,arguments)}}));var c=["addResource","addResources","addResourceBundle","removeResourceBundle"];c.forEach((function(t){e[t]=function(){var i;return(i=e.store)[t].apply(i,arguments),e}}));var h=v(),u=function(){var t=function(t,n){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),h.resolve(n),i(t,n)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),h}},{key:"loadResources",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,n=i,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(r)s(r);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,i){var n=v();return e||(e=this.languages),t||(t=this.options.ns),i||(i=W),this.services.backendConnector.reload(e,t,(function(e){n.resolve(),i(e)})),n}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&L.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var i=this;this.isLanguageChangingTo=e;var n=v();this.emit("languageChanging",e);var r=function(r){e||r||!i.services.languageDetector||(r=[]);var o="string"==typeof r?r:i.services.languageUtils.getBestMatchFromCodes(r);o&&(i.language||(i.language=o,i.languages=i.services.languageUtils.toResolveHierarchy(o)),i.translator.language||i.translator.changeLanguage(o),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(o)),i.loadResources(o,(function(e){!function(e,r){r?(i.language=r,i.languages=i.services.languageUtils.toResolveHierarchy(r),i.translator.changeLanguage(r),i.isLanguageChangingTo=void 0,i.emit("languageChanged",r),i.logger.log("languageChanged",r)):i.isLanguageChangingTo=void 0,n.resolve((function(){return i.t.apply(i,arguments)})),t&&t(e,(function(){return i.t.apply(i,arguments)}))}(e,o)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),n}},{key:"getFixedT",value:function(e,t,i){var r=this,s=function e(t,s){var a;if("object"!==n(s)){for(var l=arguments.length,c=new Array(l>2?l-2:0),h=2;h<l;h++)c[h-2]=arguments[h];a=r.options.overloadTranslationOptionHandler([t,s].concat(c))}else a=o({},s);a.lng=a.lng||e.lng,a.lngs=a.lngs||e.lngs,a.ns=a.ns||e.ns;var u=r.options.keySeparator||".",d=i?"".concat(i).concat(u).concat(t):t;return r.t(d,a)};return"string"==typeof e?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=i,s}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var n=this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;var s=function(e,i){var n=t.services.backendConnector.state["".concat(e,"|").concat(i)];return-1===n||2===n};if(i.precheck){var a=i.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(n,e)||(!this.services.backendConnector.backend||!(!s(n,e)||r&&!s(o,e)))}},{key:"loadNamespaces",value:function(e,t){var i=this,n=v();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){i.options.ns.indexOf(e)<0&&i.options.ns.push(e)})),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var i=v();"string"==typeof e&&(e=[e]);var n=this.options.preload||[],r=e.filter((function(e){return n.indexOf(e)<0}));return r.length?(this.options.preload=n.concat(r),this.loadResources((function(e){i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new t(e,i)}},{key:"cloneInstance",value:function(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W,r=o({},this.options,i,{isClone:!0}),s=new t(r),a=["store","services","language"];return a.forEach((function(t){s[t]=e[t]})),s.services=o({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new R(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];s.emit.apply(s,[e].concat(i))})),s.init(r,n),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages}}}]),t}(g))},62705:(e,t,i)=>{var n=i(55639).Symbol;e.exports=n},44239:(e,t,i)=>{var n=i(62705),r=i(89607),o=i(2333),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?r(e):o(e)}},27561:(e,t,i)=>{var n=i(67990),r=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(r,""):e}},31957:(e,t,i)=>{var n="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=n},89607:(e,t,i)=>{var n=i(62705),r=Object.prototype,o=r.hasOwnProperty,s=r.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),i=e[a];try{e[a]=void 0;var n=!0}catch(e){}var r=s.call(e);return n&&(t?e[a]=i:delete e[a]),r}},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:(e,t,i)=>{var n=i(31957),r="object"==typeof self&&self&&self.Object===Object&&self,o=n||r||Function("return this")();e.exports=o},67990:e=>{var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},23279:(e,t,i)=>{var n=i(13218),r=i(7771),o=i(14841),s=Math.max,a=Math.min;e.exports=function(e,t,i){var l,c,h,u,d,p,f=0,m=!1,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var i=l,n=c;return l=c=void 0,f=t,u=e.apply(n,i)}function b(e){return f=e,d=setTimeout(_,t),m?y(e):u}function x(e){var i=e-p;return void 0===p||i>=t||i<0||g&&e-f>=h}function _(){var e=r();if(x(e))return E(e);d=setTimeout(_,function(e){var i=t-(e-p);return g?a(i,h-(e-f)):i}(e))}function E(e){return d=void 0,v&&l?y(e):(l=c=void 0,u)}function A(){var e=r(),i=x(e);if(l=arguments,c=this,p=e,i){if(void 0===d)return b(p);if(g)return clearTimeout(d),d=setTimeout(_,t),y(p)}return void 0===d&&(d=setTimeout(_,t)),u}return t=o(t)||0,n(i)&&(m=!!i.leading,h=(g="maxWait"in i)?s(o(i.maxWait)||0,t):h,v="trailing"in i?!!i.trailing:v),A.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=p=c=d=void 0},A.flush=function(){return void 0===d?u:E(r())},A}},13218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},33448:(e,t,i)=>{var n=i(44239),r=i(37005);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==n(e)}},7771:(e,t,i)=>{var n=i(55639);e.exports=function(){return n.Date.now()}},14841:(e,t,i)=>{var n=i(27561),r=i(13218),o=i(33448),s=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var i=a.test(e);return i||l.test(e)?c(e.slice(2),i?2:8):s.test(e)?NaN:+e}},99591:(e,t,i)=>{"use strict";var n={};(0,i(24236).assign)(n,i(24555),i(78843),i(71619)),e.exports=n},24555:(e,t,i)=>{"use strict";var n=i(30405),r=i(24236),o=i(29373),s=i(48898),a=i(62292),l=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==i)throw new Error(s[i]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var h;if(h="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(i=n.deflateSetDictionary(this.strm,h)))throw new Error(s[i]);this._dict_set=!0}}function h(e,t){var i=new c(t);if(i.push(e,!0),i.err)throw i.msg||s[i.err];return i.result}c.prototype.push=function(e,t){var i,s,a=this.strm,c=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=o.string2buf(e):"[object ArrayBuffer]"===l.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(c),a.next_out=0,a.avail_out=c),1!==(i=n.deflate(a,s))&&0!==i)return this.onEnd(i),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==i);return 4===s?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==s||(this.onEnd(0),a.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=h,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,h(e,t)}},78843:(e,t,i)=>{"use strict";var n=i(27948),r=i(24236),o=i(29373),s=i(71619),a=i(48898),l=i(62292),c=i(42401),h=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,t.windowBits);if(i!==s.Z_OK)throw new Error(a[i]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===h.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(a[i])}function d(e,t){var i=new u(t);if(i.push(e,!0),i.err)throw i.msg||a[i.err];return i.result}u.prototype.push=function(e,t){var i,a,l,c,u,d=this.strm,p=this.options.chunkSize,f=this.options.dictionary,m=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new r.Buf8(p),d.next_out=0,d.avail_out=p),(i=n.inflate(d,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&f&&(i=n.inflateSetDictionary(this.strm,f)),i===s.Z_BUF_ERROR&&!0===m&&(i=s.Z_OK,m=!1),i!==s.Z_STREAM_END&&i!==s.Z_OK)return this.onEnd(i),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&i!==s.Z_STREAM_END&&(0!==d.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(d.output,d.next_out),c=d.next_out-l,u=o.buf2string(d.output,l),d.next_out=c,d.avail_out=p-c,c&&r.arraySet(d.output,d.output,l,c,0),this.onData(u)):this.onData(r.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&i!==s.Z_STREAM_END);return i===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),d.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=u,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},24236:(e,t)=>{"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)n(i,r)&&(e[r]=i[r])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),r);else for(var o=0;o<n;o++)e[r+o]=t[i+o]},flattenChunks:function(e){var t,i,n,r,o,s;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(s=new Uint8Array(n),r=0,t=0,i=e.length;t<i;t++)o=e[t],s.set(o,r),r+=o.length;return s}},o={arraySet:function(e,t,i,n,r){for(var o=0;o<n;o++)e[r+o]=t[i+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,r)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(i)},29373:(e,t,i)=>{"use strict";var n=i(24236),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var i="",s=0;s<t;s++)i+=String.fromCharCode(e[s]);return i}s[254]=s[254]=1,t.string2buf=function(e){var t,i,r,o,s,a=e.length,l=0;for(o=0;o<a;o++)55296==(64512&(i=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=e.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),l+=i<128?1:i<2048?2:i<65536?3:4;for(t=new n.Buf8(l),s=0,o=0;s<l;o++)55296==(64512&(i=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=e.charCodeAt(o+1)))&&(i=65536+(i-55296<<10)+(r-56320),o++),i<128?t[s++]=i:i<2048?(t[s++]=192|i>>>6,t[s++]=128|63&i):i<65536?(t[s++]=224|i>>>12,t[s++]=128|i>>>6&63,t[s++]=128|63&i):(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63,t[s++]=128|i>>>6&63,t[s++]=128|63&i);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),i=0,r=t.length;i<r;i++)t[i]=e.charCodeAt(i);return t},t.buf2string=function(e,t){var i,n,r,o,a=t||e.length,c=new Array(2*a);for(n=0,i=0;i<a;)if((r=e[i++])<128)c[n++]=r;else if((o=s[r])>4)c[n++]=65533,i+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&i<a;)r=r<<6|63&e[i++],o--;o>1?c[n++]=65533:r<65536?c[n++]=r:(r-=65536,c[n++]=55296|r>>10&1023,c[n++]=56320|1023&r)}return l(c,n)},t.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+s[e[i]]>t?i:t}},66069:e=>{"use strict";e.exports=function(e,t,i,n){for(var r=65535&e|0,o=e>>>16&65535|0,s=0;0!==i;){i-=s=i>2e3?2e3:i;do{o=o+(r=r+t[n++]|0)|0}while(--s);r%=65521,o%=65521}return r|o<<16|0}},71619:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:e=>{"use strict";var t=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();e.exports=function(e,i,n,r){var o=t,s=r+n;e^=-1;for(var a=r;a<s;a++)e=e>>>8^o[255&(e^i[a])];return-1^e}},30405:(e,t,i)=>{"use strict";var n,r=i(24236),o=i(10342),s=i(66069),a=i(2869),l=i(48898),c=-2,h=258,u=262,d=103,p=113,f=666;function m(e,t){return e.msg=l[t],t}function g(e){return(e<<1)-(e>4?9:0)}function v(e){for(var t=e.length;--t>=0;)e[t]=0}function y(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(r.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))}function b(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,y(e.strm)}function x(e,t){e.pending_buf[e.pending++]=t}function _(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function E(e,t){var i,n,r=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-u?e.strstart-(e.w_size-u):0,c=e.window,d=e.w_mask,p=e.prev,f=e.strstart+h,m=c[o+s-1],g=c[o+s];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(i=t)+s]===g&&c[i+s-1]===m&&c[i]===c[o]&&c[++i]===c[o+1]){o+=2,i++;do{}while(c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&c[++o]===c[++i]&&o<f);if(n=h-(f-o),o=f-h,n>s){if(e.match_start=t,s=n,n>=a)break;m=c[o+s-1],g=c[o+s]}}}while((t=p[t&d])>l&&0!=--r);return s<=e.lookahead?s:e.lookahead}function A(e){var t,i,n,o,l,c,h,d,p,f,m=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-u)){r.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=i=e.hash_size;do{n=e.head[--t],e.head[t]=n>=m?n-m:0}while(--i);t=i=m;do{n=e.prev[--t],e.prev[t]=n>=m?n-m:0}while(--i);o+=m}if(0===e.strm.avail_in)break;if(c=e.strm,h=e.window,d=e.strstart+e.lookahead,p=o,f=void 0,(f=c.avail_in)>p&&(f=p),i=0===f?0:(c.avail_in-=f,r.arraySet(h,c.input,c.next_in,f,d),1===c.state.wrap?c.adler=s(c.adler,h,f,d):2===c.state.wrap&&(c.adler=a(c.adler,h,f,d)),c.next_in+=f,c.total_in+=f,f),e.lookahead+=i,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<u&&0!==e.strm.avail_in)}function S(e,t){for(var i,n;;){if(e.lookahead<u){if(A(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-u&&(e.match_length=E(e,i)),e.match_length>=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function w(e,t){for(var i,n,r;;){if(e.lookahead<u){if(A(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-u&&(e.match_length=E(e,i),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(b(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&b(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function M(e,t,i,n,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=r}function T(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),v(this.dyn_ltree),v(this.dyn_dtree),v(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),v(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),v(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function C(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:p,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):m(e,c)}function P(e){var t,i=C(e);return 0===i&&((t=e.state).window_size=2*t.w_size,v(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i}function D(e,t,i,n,o,s){if(!e)return c;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>9||8!==i||n<8||n>15||t<0||t>9||s<0||s>4)return m(e,c);8===n&&(n=9);var l=new T;return e.state=l,l.strm=e,l.wrap=a,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new r.Buf8(2*l.w_size),l.head=new r.Buf16(l.hash_size),l.prev=new r.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new r.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=s,l.method=i,P(e)}n=[new M(0,0,0,0,(function(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(A(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,b(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-u&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(b(e,!1),e.strm.avail_out),1)})),new M(4,4,8,4,S),new M(4,5,16,8,S),new M(4,6,32,32,S),new M(4,4,16,16,w),new M(8,16,32,32,w),new M(8,16,128,128,w),new M(8,32,128,256,w),new M(32,128,258,1024,w),new M(32,258,258,4096,w)],t.deflateInit=function(e,t){return D(e,t,8,15,8,0)},t.deflateInit2=D,t.deflateReset=P,t.deflateResetKeep=C,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var i,r,s,l;if(!e||!e.state||t>5||t<0)return e?m(e,c):c;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||r.status===f&&4!==t)return m(e,0===e.avail_out?-5:c);if(r.strm=e,i=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,x(r,31),x(r,139),x(r,8),r.gzhead?(x(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),x(r,255&r.gzhead.time),x(r,r.gzhead.time>>8&255),x(r,r.gzhead.time>>16&255),x(r,r.gzhead.time>>24&255),x(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),x(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(x(r,255&r.gzhead.extra.length),x(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=a(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(x(r,0),x(r,0),x(r,0),x(r,0),x(r,0),x(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),x(r,3),r.status=p);else{var u=8+(r.w_bits-8<<4)<<8;u|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(u|=32),u+=31-u%31,r.status=p,_(r,u),0!==r.strstart&&(_(r,e.adler>>>16),_(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(e.adler=a(e.adler,r.pending_buf,r.pending-s,s)),y(e),s=r.pending,r.pending!==r.pending_buf_size));)x(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(e.adler=a(e.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=a(e.adler,r.pending_buf,r.pending-s,s)),y(e),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,x(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>s&&(e.adler=a(e.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(e.adler=a(e.adler,r.pending_buf,r.pending-s,s)),y(e),s=r.pending,r.pending===r.pending_buf_size)){l=1;break}l=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,x(r,l)}while(0!==l);r.gzhead.hcrc&&r.pending>s&&(e.adler=a(e.adler,r.pending_buf,r.pending-s,s)),0===l&&(r.status=d)}else r.status=d;if(r.status===d&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&y(e),r.pending+2<=r.pending_buf_size&&(x(r,255&e.adler),x(r,e.adler>>8&255),e.adler=0,r.status=p)):r.status=p),0!==r.pending){if(y(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&g(t)<=g(i)&&4!==t)return m(e,-5);if(r.status===f&&0!==e.avail_in)return m(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&r.status!==f){var E=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(A(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,i=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var i,n,r,s,a=e.window;;){if(e.lookahead<=h){if(A(e),e.lookahead<=h&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[r=e.strstart-1])===a[++r]&&n===a[++r]&&n===a[++r]){s=e.strstart+h;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<s);e.match_length=h-(s-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(r,t):n[r.level].func(r,t);if(3!==E&&4!==E||(r.status=f),1===E||3===E)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===E&&(1===t?o._tr_align(r):5!==t&&(o._tr_stored_block(r,0,0,!1),3===t&&(v(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),y(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(x(r,255&e.adler),x(r,e.adler>>8&255),x(r,e.adler>>16&255),x(r,e.adler>>24&255),x(r,255&e.total_in),x(r,e.total_in>>8&255),x(r,e.total_in>>16&255),x(r,e.total_in>>24&255)):(_(r,e.adler>>>16),_(r,65535&e.adler)),y(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==d&&t!==p&&t!==f?m(e,c):(e.state=null,t===p?m(e,-3):0):c},t.deflateSetDictionary=function(e,t){var i,n,o,a,l,h,u,d,p=t.length;if(!e||!e.state)return c;if(2===(a=(i=e.state).wrap)||1===a&&42!==i.status||i.lookahead)return c;for(1===a&&(e.adler=s(e.adler,t,p,0)),i.wrap=0,p>=i.w_size&&(0===a&&(v(i.head),i.strstart=0,i.block_start=0,i.insert=0),d=new r.Buf8(i.w_size),r.arraySet(d,t,p-i.w_size,i.w_size,0),t=d,p=i.w_size),l=e.avail_in,h=e.next_in,u=e.input,e.avail_in=p,e.next_in=0,e.input=t,A(i);i.lookahead>=3;){n=i.strstart,o=i.lookahead-2;do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+3-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++}while(--o);i.strstart=n,i.lookahead=2,A(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=h,e.input=u,e.avail_in=l,i.wrap=a,0},t.deflateInfo="pako deflate (from Nodeca project)"},42401:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},94264:e=>{"use strict";e.exports=function(e,t){var i,n,r,o,s,a,l,c,h,u,d,p,f,m,g,v,y,b,x,_,E,A,S,w,M;i=e.state,n=e.next_in,w=e.input,r=n+(e.avail_in-5),o=e.next_out,M=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),l=i.dmax,c=i.wsize,h=i.whave,u=i.wnext,d=i.window,p=i.hold,f=i.bits,m=i.lencode,g=i.distcode,v=(1<<i.lenbits)-1,y=(1<<i.distbits)-1;e:do{f<15&&(p+=w[n++]<<f,f+=8,p+=w[n++]<<f,f+=8),b=m[p&v];t:for(;;){if(p>>>=x=b>>>24,f-=x,0===(x=b>>>16&255))M[o++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=m[(65535&b)+(p&(1<<x)-1)];continue t}if(32&x){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}_=65535&b,(x&=15)&&(f<x&&(p+=w[n++]<<f,f+=8),_+=p&(1<<x)-1,p>>>=x,f-=x),f<15&&(p+=w[n++]<<f,f+=8,p+=w[n++]<<f,f+=8),b=g[p&y];i:for(;;){if(p>>>=x=b>>>24,f-=x,!(16&(x=b>>>16&255))){if(0==(64&x)){b=g[(65535&b)+(p&(1<<x)-1)];continue i}e.msg="invalid distance code",i.mode=30;break e}if(E=65535&b,f<(x&=15)&&(p+=w[n++]<<f,(f+=8)<x&&(p+=w[n++]<<f,f+=8)),(E+=p&(1<<x)-1)>l){e.msg="invalid distance too far back",i.mode=30;break e}if(p>>>=x,f-=x,E>(x=o-s)){if((x=E-x)>h&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(A=0,S=d,0===u){if(A+=c-x,x<_){_-=x;do{M[o++]=d[A++]}while(--x);A=o-E,S=M}}else if(u<x){if(A+=c+u-x,(x-=u)<_){_-=x;do{M[o++]=d[A++]}while(--x);if(A=0,u<_){_-=x=u;do{M[o++]=d[A++]}while(--x);A=o-E,S=M}}}else if(A+=u-x,x<_){_-=x;do{M[o++]=d[A++]}while(--x);A=o-E,S=M}for(;_>2;)M[o++]=S[A++],M[o++]=S[A++],M[o++]=S[A++],_-=3;_&&(M[o++]=S[A++],_>1&&(M[o++]=S[A++]))}else{A=o-E;do{M[o++]=M[A++],M[o++]=M[A++],M[o++]=M[A++],_-=3}while(_>2);_&&(M[o++]=M[A++],_>1&&(M[o++]=M[A++]))}break}}break}}while(n<r&&o<a);n-=_=f>>3,p&=(1<<(f-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=o<a?a-o+257:257-(o-a),i.hold=p,i.bits=f}},27948:(e,t,i)=>{"use strict";var n=i(24236),r=i(66069),o=i(2869),s=i(94264),a=i(9241),l=-2,c=12,h=30;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):l}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):l}function m(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,f(e))):l}function g(e,t){var i,n;return e?(n=new d,e.state=n,n.window=null,0!==(i=m(e,t))&&(e.state=null),i):l}var v,y,b=!0;function x(e){if(b){var t;for(v=new n.Buf32(512),y=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,v,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,y,0,e.work,{bits:5}),b=!1}e.lencode=v,e.lenbits=9,e.distcode=y,e.distbits=5}function _(e,t,i,r){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),r>=s.wsize?(n.arraySet(s.window,t,i-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>r&&(o=r),n.arraySet(s.window,t,i-r,o,s.wnext),(r-=o)?(n.arraySet(s.window,t,i-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}t.inflateReset=f,t.inflateReset2=m,t.inflateResetKeep=p,t.inflateInit=function(e){return g(e,15)},t.inflateInit2=g,t.inflate=function(e,t){var i,d,p,f,m,g,v,y,b,E,A,S,w,M,T,C,P,D,L,I,R,O,N,k,F=0,V=new n.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;(i=e.state).mode===c&&(i.mode=13),m=e.next_out,p=e.output,v=e.avail_out,f=e.next_in,d=e.input,g=e.avail_in,y=i.hold,b=i.bits,E=g,A=v,O=0;e:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;b<16;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(2&i.wrap&&35615===y){i.check=0,V[0]=255&y,V[1]=y>>>8&255,i.check=o(i.check,V,2,0),y=0,b=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",i.mode=h;break}if(8!=(15&y)){e.msg="unknown compression method",i.mode=h;break}if(b-=4,R=8+(15&(y>>>=4)),0===i.wbits)i.wbits=R;else if(R>i.wbits){e.msg="invalid window size",i.mode=h;break}i.dmax=1<<R,e.adler=i.check=1,i.mode=512&y?10:c,y=0,b=0;break;case 2:for(;b<16;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(i.flags=y,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=h;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=h;break}i.head&&(i.head.text=y>>8&1),512&i.flags&&(V[0]=255&y,V[1]=y>>>8&255,i.check=o(i.check,V,2,0)),y=0,b=0,i.mode=3;case 3:for(;b<32;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}i.head&&(i.head.time=y),512&i.flags&&(V[0]=255&y,V[1]=y>>>8&255,V[2]=y>>>16&255,V[3]=y>>>24&255,i.check=o(i.check,V,4,0)),y=0,b=0,i.mode=4;case 4:for(;b<16;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}i.head&&(i.head.xflags=255&y,i.head.os=y>>8),512&i.flags&&(V[0]=255&y,V[1]=y>>>8&255,i.check=o(i.check,V,2,0)),y=0,b=0,i.mode=5;case 5:if(1024&i.flags){for(;b<16;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}i.length=y,i.head&&(i.head.extra_len=y),512&i.flags&&(V[0]=255&y,V[1]=y>>>8&255,i.check=o(i.check,V,2,0)),y=0,b=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((S=i.length)>g&&(S=g),S&&(i.head&&(R=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,d,f,S,R)),512&i.flags&&(i.check=o(i.check,d,S,f)),g-=S,f+=S,i.length-=S),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===g)break e;S=0;do{R=d[f+S++],i.head&&R&&i.length<65536&&(i.head.name+=String.fromCharCode(R))}while(R&&S<g);if(512&i.flags&&(i.check=o(i.check,d,S,f)),g-=S,f+=S,R)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===g)break e;S=0;do{R=d[f+S++],i.head&&R&&i.length<65536&&(i.head.comment+=String.fromCharCode(R))}while(R&&S<g);if(512&i.flags&&(i.check=o(i.check,d,S,f)),g-=S,f+=S,R)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;b<16;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(y!==(65535&i.check)){e.msg="header crc mismatch",i.mode=h;break}y=0,b=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=c;break;case 10:for(;b<32;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}e.adler=i.check=u(y),y=0,b=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=m,e.avail_out=v,e.next_in=f,e.avail_in=g,i.hold=y,i.bits=b,2;e.adler=i.check=1,i.mode=c;case c:if(5===t||6===t)break e;case 13:if(i.last){y>>>=7&b,b-=7&b,i.mode=27;break}for(;b<3;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}switch(i.last=1&y,b-=1,3&(y>>>=1)){case 0:i.mode=14;break;case 1:if(x(i),i.mode=20,6===t){y>>>=2,b-=2;break e}break;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=h}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if((65535&y)!=(y>>>16^65535)){e.msg="invalid stored block lengths",i.mode=h;break}if(i.length=65535&y,y=0,b=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(S=i.length){if(S>g&&(S=g),S>v&&(S=v),0===S)break e;n.arraySet(p,d,f,S,m),g-=S,f+=S,v-=S,m+=S,i.length-=S;break}i.mode=c;break;case 17:for(;b<14;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(i.nlen=257+(31&y),y>>>=5,b-=5,i.ndist=1+(31&y),y>>>=5,b-=5,i.ncode=4+(15&y),y>>>=4,b-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=h;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;b<3;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}i.lens[U[i.have++]]=7&y,y>>>=3,b-=3}for(;i.have<19;)i.lens[U[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},O=a(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,O){e.msg="invalid code lengths set",i.mode=h;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;C=(F=i.lencode[y&(1<<i.lenbits)-1])>>>16&255,P=65535&F,!((T=F>>>24)<=b);){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(P<16)y>>>=T,b-=T,i.lens[i.have++]=P;else{if(16===P){for(k=T+2;b<k;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(y>>>=T,b-=T,0===i.have){e.msg="invalid bit length repeat",i.mode=h;break}R=i.lens[i.have-1],S=3+(3&y),y>>>=2,b-=2}else if(17===P){for(k=T+3;b<k;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}b-=T,R=0,S=3+(7&(y>>>=T)),y>>>=3,b-=3}else{for(k=T+7;b<k;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}b-=T,R=0,S=11+(127&(y>>>=T)),y>>>=7,b-=7}if(i.have+S>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=h;break}for(;S--;)i.lens[i.have++]=R}}if(i.mode===h)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=h;break}if(i.lenbits=9,N={bits:i.lenbits},O=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,O){e.msg="invalid literal/lengths set",i.mode=h;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},O=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,O){e.msg="invalid distances set",i.mode=h;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(g>=6&&v>=258){e.next_out=m,e.avail_out=v,e.next_in=f,e.avail_in=g,i.hold=y,i.bits=b,s(e,A),m=e.next_out,p=e.output,v=e.avail_out,f=e.next_in,d=e.input,g=e.avail_in,y=i.hold,b=i.bits,i.mode===c&&(i.back=-1);break}for(i.back=0;C=(F=i.lencode[y&(1<<i.lenbits)-1])>>>16&255,P=65535&F,!((T=F>>>24)<=b);){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(C&&0==(240&C)){for(D=T,L=C,I=P;C=(F=i.lencode[I+((y&(1<<D+L)-1)>>D)])>>>16&255,P=65535&F,!(D+(T=F>>>24)<=b);){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}y>>>=D,b-=D,i.back+=D}if(y>>>=T,b-=T,i.back+=T,i.length=P,0===C){i.mode=26;break}if(32&C){i.back=-1,i.mode=c;break}if(64&C){e.msg="invalid literal/length code",i.mode=h;break}i.extra=15&C,i.mode=22;case 22:if(i.extra){for(k=i.extra;b<k;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}i.length+=y&(1<<i.extra)-1,y>>>=i.extra,b-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;C=(F=i.distcode[y&(1<<i.distbits)-1])>>>16&255,P=65535&F,!((T=F>>>24)<=b);){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(0==(240&C)){for(D=T,L=C,I=P;C=(F=i.distcode[I+((y&(1<<D+L)-1)>>D)])>>>16&255,P=65535&F,!(D+(T=F>>>24)<=b);){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}y>>>=D,b-=D,i.back+=D}if(y>>>=T,b-=T,i.back+=T,64&C){e.msg="invalid distance code",i.mode=h;break}i.offset=P,i.extra=15&C,i.mode=24;case 24:if(i.extra){for(k=i.extra;b<k;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}i.offset+=y&(1<<i.extra)-1,y>>>=i.extra,b-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=h;break}i.mode=25;case 25:if(0===v)break e;if(S=A-v,i.offset>S){if((S=i.offset-S)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=h;break}S>i.wnext?(S-=i.wnext,w=i.wsize-S):w=i.wnext-S,S>i.length&&(S=i.length),M=i.window}else M=p,w=m-i.offset,S=i.length;S>v&&(S=v),v-=S,i.length-=S;do{p[m++]=M[w++]}while(--S);0===i.length&&(i.mode=21);break;case 26:if(0===v)break e;p[m++]=i.length,v--,i.mode=21;break;case 27:if(i.wrap){for(;b<32;){if(0===g)break e;g--,y|=d[f++]<<b,b+=8}if(A-=v,e.total_out+=A,i.total+=A,A&&(e.adler=i.check=i.flags?o(i.check,p,A,m-A):r(i.check,p,A,m-A)),A=v,(i.flags?y:u(y))!==i.check){e.msg="incorrect data check",i.mode=h;break}y=0,b=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;b<32;){if(0===g)break e;g--,y+=d[f++]<<b,b+=8}if(y!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=h;break}y=0,b=0}i.mode=29;case 29:O=1;break e;case h:O=-3;break e;case 31:return-4;default:return l}return e.next_out=m,e.avail_out=v,e.next_in=f,e.avail_in=g,i.hold=y,i.bits=b,(i.wsize||A!==e.avail_out&&i.mode<h&&(i.mode<27||4!==t))&&_(e,e.output,e.next_out,A-e.avail_out)?(i.mode=31,-4):(E-=e.avail_in,A-=e.avail_out,e.total_in+=E,e.total_out+=A,i.total+=A,i.wrap&&A&&(e.adler=i.check=i.flags?o(i.check,p,A,e.next_out-A):r(i.check,p,A,e.next_out-A)),e.data_type=i.bits+(i.last?64:0)+(i.mode===c?128:0)+(20===i.mode||15===i.mode?256:0),(0===E&&0===A||4===t)&&0===O&&(O=-5),O)},t.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var i;return e&&e.state?0==(2&(i=e.state).wrap)?l:(i.head=t,t.done=!1,0):l},t.inflateSetDictionary=function(e,t){var i,n=t.length;return e&&e.state?0!==(i=e.state).wrap&&11!==i.mode?l:11===i.mode&&r(1,t,n,0)!==i.check?-3:_(e,t,n,n)?(i.mode=31,-4):(i.havedict=1,0):l},t.inflateInfo="pako inflate (from Nodeca project)"},9241:(e,t,i)=>{"use strict";var n=i(24236),r=15,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],l=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,i,c,h,u,d,p){var f,m,g,v,y,b,x,_,E,A=p.bits,S=0,w=0,M=0,T=0,C=0,P=0,D=0,L=0,I=0,R=0,O=null,N=0,k=new n.Buf16(16),F=new n.Buf16(16),V=null,U=0;for(S=0;S<=r;S++)k[S]=0;for(w=0;w<c;w++)k[t[i+w]]++;for(C=A,T=r;T>=1&&0===k[T];T--);if(C>T&&(C=T),0===T)return h[u++]=20971520,h[u++]=20971520,p.bits=1,0;for(M=1;M<T&&0===k[M];M++);for(C<M&&(C=M),L=1,S=1;S<=r;S++)if(L<<=1,(L-=k[S])<0)return-1;if(L>0&&(0===e||1!==T))return-1;for(F[1]=0,S=1;S<r;S++)F[S+1]=F[S]+k[S];for(w=0;w<c;w++)0!==t[i+w]&&(d[F[t[i+w]]++]=w);if(0===e?(O=V=d,b=19):1===e?(O=o,N-=257,V=s,U-=257,b=256):(O=a,V=l,b=-1),R=0,w=0,S=M,y=u,P=C,D=0,g=-1,v=(I=1<<C)-1,1===e&&I>852||2===e&&I>592)return 1;for(;;){x=S-D,d[w]<b?(_=0,E=d[w]):d[w]>b?(_=V[U+d[w]],E=O[N+d[w]]):(_=96,E=0),f=1<<S-D,M=m=1<<P;do{h[y+(R>>D)+(m-=f)]=x<<24|_<<16|E|0}while(0!==m);for(f=1<<S-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,w++,0==--k[S]){if(S===T)break;S=t[i+d[w]]}if(S>C&&(R&v)!==g){for(0===D&&(D=C),y+=M,L=1<<(P=S-D);P+D<T&&!((L-=k[P+D])<=0);)P++,L<<=1;if(I+=1<<P,1===e&&I>852||2===e&&I>592)return 1;h[g=R&v]=C<<24|P<<16|y-u|0}}return 0!==R&&(h[y+R]=S-D<<24|64<<16|0),p.bits=C,0}},48898:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},10342:(e,t,i)=>{"use strict";var n=i(24236);function r(e){for(var t=e.length;--t>=0;)e[t]=0}var o=256,s=286,a=30,l=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],h=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);r(p);var f=new Array(60);r(f);var m=new Array(512);r(m);var g=new Array(256);r(g);var v=new Array(29);r(v);var y,b,x,_=new Array(a);function E(e,t,i,n,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}function A(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function S(e){return e<256?m[e]:m[256+(e>>>7)]}function w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function M(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,w(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function T(e,t,i){M(e,i[2*t],i[2*t+1])}function C(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1}function P(e,t,i){var n,r,o=new Array(16),s=0;for(n=1;n<=l;n++)o[n]=s=s+i[n-1]<<1;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=C(o[a]++,a))}}function D(e){var t;for(t=0;t<s;t++)e.dyn_ltree[2*t]=0;for(t=0;t<a;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function L(e){e.bi_valid>8?w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function I(e,t,i,n){var r=2*t,o=2*i;return e[r]<e[o]||e[r]===e[o]&&n[t]<=n[i]}function R(e,t,i){for(var n=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&I(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!I(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function O(e,t,i){var n,r,s,a,l=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],r=e.pending_buf[e.l_buf+l],l++,0===n?T(e,r,t):(T(e,(s=g[r])+o+1,t),0!==(a=c[s])&&M(e,r-=v[s],a),T(e,s=S(--n),i),0!==(a=h[s])&&M(e,n-=_[s],a))}while(l<e.last_lit);T(e,256,t)}function N(e,t){var i,n,r,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,c=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<c;i++)0!==o[2*i]?(e.heap[++e.heap_len]=h=i,e.depth[i]=0):o[2*i+1]=0;for(;e.heap_len<2;)o[2*(r=e.heap[++e.heap_len]=h<2?++h:0)]=1,e.depth[r]=0,e.opt_len--,a&&(e.static_len-=s[2*r+1]);for(t.max_code=h,i=e.heap_len>>1;i>=1;i--)R(e,o,i);r=c;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],R(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=n,o[2*r]=o[2*i]+o[2*n],e.depth[r]=(e.depth[i]>=e.depth[n]?e.depth[i]:e.depth[n])+1,o[2*i+1]=o[2*n+1]=r,e.heap[1]=r++,R(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,n,r,o,s,a,c=t.dyn_tree,h=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,m=t.stat_desc.max_length,g=0;for(o=0;o<=l;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)(o=c[2*c[2*(n=e.heap[i])+1]+1]+1)>m&&(o=m,g++),c[2*n+1]=o,n>h||(e.bl_count[o]++,s=0,n>=f&&(s=p[n-f]),a=c[2*n],e.opt_len+=a*(o+s),d&&(e.static_len+=a*(u[2*n+1]+s)));if(0!==g){do{for(o=m-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[m]--,g-=2}while(g>0);for(o=m;0!==o;o--)for(n=e.bl_count[o];0!==n;)(r=e.heap[--i])>h||(c[2*r+1]!==o&&(e.opt_len+=(o-c[2*r+1])*c[2*r],c[2*r+1]=o),n--)}}(e,t),P(o,h,e.bl_count)}function k(e,t,i){var n,r,o=-1,s=t[1],a=0,l=7,c=4;for(0===s&&(l=138,c=3),t[2*(i+1)+1]=65535,n=0;n<=i;n++)r=s,s=t[2*(n+1)+1],++a<l&&r===s||(a<c?e.bl_tree[2*r]+=a:0!==r?(r!==o&&e.bl_tree[2*r]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=r,0===s?(l=138,c=3):r===s?(l=6,c=3):(l=7,c=4))}function F(e,t,i){var n,r,o=-1,s=t[1],a=0,l=7,c=4;for(0===s&&(l=138,c=3),n=0;n<=i;n++)if(r=s,s=t[2*(n+1)+1],!(++a<l&&r===s)){if(a<c)do{T(e,r,e.bl_tree)}while(0!=--a);else 0!==r?(r!==o&&(T(e,r,e.bl_tree),a--),T(e,16,e.bl_tree),M(e,a-3,2)):a<=10?(T(e,17,e.bl_tree),M(e,a-3,3)):(T(e,18,e.bl_tree),M(e,a-11,7));a=0,o=r,0===s?(l=138,c=3):r===s?(l=6,c=3):(l=7,c=4)}}r(_);var V=!1;function U(e,t,i,r){M(e,0+(r?1:0),3),function(e,t,i,r){L(e),r&&(w(e,i),w(e,~i)),n.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}(e,t,i,!0)}t._tr_init=function(e){V||(!function(){var e,t,i,n,r,o=new Array(16);for(i=0,n=0;n<28;n++)for(v[n]=i,e=0;e<1<<c[n];e++)g[i++]=n;for(g[i-1]=n,r=0,n=0;n<16;n++)for(_[n]=r,e=0;e<1<<h[n];e++)m[r++]=n;for(r>>=7;n<a;n++)for(_[n]=r<<7,e=0;e<1<<h[n]-7;e++)m[256+r++]=n;for(t=0;t<=l;t++)o[t]=0;for(e=0;e<=143;)p[2*e+1]=8,e++,o[8]++;for(;e<=255;)p[2*e+1]=9,e++,o[9]++;for(;e<=279;)p[2*e+1]=7,e++,o[7]++;for(;e<=287;)p[2*e+1]=8,e++,o[8]++;for(P(p,287,o),e=0;e<a;e++)f[2*e+1]=5,f[2*e]=C(e,5);y=new E(p,c,257,s,l),b=new E(f,h,0,a,l),x=new E(new Array(0),u,0,19,7)}(),V=!0),e.l_desc=new A(e.dyn_ltree,y),e.d_desc=new A(e.dyn_dtree,b),e.bl_desc=new A(e.bl_tree,x),e.bi_buf=0,e.bi_valid=0,D(e)},t._tr_stored_block=U,t._tr_flush_block=function(e,t,i,n){var r,s,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),N(e,e.l_desc),N(e,e.d_desc),a=function(e){var t;for(k(e,e.dyn_ltree,e.l_desc.max_code),k(e,e.dyn_dtree,e.d_desc.max_code),N(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==t?U(e,t,i,n):4===e.strategy||s===r?(M(e,2+(n?1:0),3),O(e,p,f)):(M(e,4+(n?1:0),3),function(e,t,i,n){var r;for(M(e,t-257,5),M(e,i-1,5),M(e,n-4,4),r=0;r<n;r++)M(e,e.bl_tree[2*d[r]+1],3);F(e,e.dyn_ltree,t-1),F(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),O(e,e.dyn_ltree,e.dyn_dtree)),D(e),n&&L(e)},t._tr_tally=function(e,t,i){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(g[i]+o+1)]++,e.dyn_dtree[2*S(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){M(e,2,3),T(e,256,p),function(e){16===e.bi_valid?(w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},62292:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},79916:e=>{function t(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}function i(e){e.pending+=1;var t=!1;return function(r){if(t)throw new Error("callback called twice");if(t=!0,e.error=e.error||r,e.pending-=1,e.waiting.length>0&&e.pending<e.max)n(e,e.waiting.shift());else if(0===e.pending){var o=e.listeners;e.listeners=[],o.forEach(i)}};function i(t){t(e.error)}}function n(e,t){t(i(e))}e.exports=t,t.prototype.go=function(e){this.pending<this.max?n(this,e):this.waiting.push(e)},t.prototype.wait=function(e){0===this.pending?e(this.error):this.listeners.push(e)},t.prototype.hold=function(){return i(this)}},62587:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,i,n,r){i=i||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(i);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var l=e.length;a>0&&l>a&&(l=a);for(var c=0;c<l;++c){var h,u,d,p,f=e[c].replace(s,"%20"),m=f.indexOf(n);m>=0?(h=f.substr(0,m),u=f.substr(m+1)):(h=f,u=""),d=decodeURIComponent(h),p=decodeURIComponent(u),t(o,d)?Array.isArray(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o}},12361:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,i,n,r){return i=i||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(r){var o=encodeURIComponent(t(r))+n;return Array.isArray(e[r])?e[r].map((function(e){return o+encodeURIComponent(t(e))})).join(i):o+encodeURIComponent(t(e[r]))})).join(i):r?encodeURIComponent(t(r))+n+encodeURIComponent(t(e)):""}},17673:(e,t,i)=>{"use strict";t.decode=t.parse=i(62587),t.encode=t.stringify=i(12361)},52511:function(e,t,i){var n;/*! https://mths.be/punycode v1.3.2 by @mathias */e=i.nmd(e),function(r){t&&t.nodeType,e&&e.nodeType;var o="object"==typeof i.g&&i.g;o.global!==o&&o.window!==o&&o.self;var s,a=2147483647,l=36,c=/^xn--/,h=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,f=String.fromCharCode;function m(e){throw RangeError(d[e])}function g(e,t){for(var i=e.length,n=[];i--;)n[i]=t(e[i]);return n}function v(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),n+g((e=e.replace(u,".")).split("."),t).join(".")}function y(e){for(var t,i,n=[],r=0,o=e.length;r<o;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<o?56320==(64512&(i=e.charCodeAt(r++)))?n.push(((1023&t)<<10)+(1023&i)+65536):(n.push(t),r--):n.push(t);return n}function b(e){return g(e,(function(e){var t="";return e>65535&&(t+=f((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=f(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function _(e,t,i){var n=0;for(e=i?p(e/700):e>>1,e+=p(e/t);e>455;n+=l)e=p(e/35);return p(n+36*e/(e+38))}function E(e){var t,i,n,r,o,s,c,h,u,d,f,g=[],v=e.length,y=0,x=128,E=72;for((i=e.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)e.charCodeAt(n)>=128&&m("not-basic"),g.push(e.charCodeAt(n));for(r=i>0?i+1:0;r<v;){for(o=y,s=1,c=l;r>=v&&m("invalid-input"),((h=(f=e.charCodeAt(r++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:l)>=l||h>p((a-y)/s))&&m("overflow"),y+=h*s,!(h<(u=c<=E?1:c>=E+26?26:c-E));c+=l)s>p(a/(d=l-u))&&m("overflow"),s*=d;E=_(y-o,t=g.length+1,0==o),p(y/t)>a-x&&m("overflow"),x+=p(y/t),y%=t,g.splice(y++,0,x)}return b(g)}function A(e){var t,i,n,r,o,s,c,h,u,d,g,v,b,E,A,S=[];for(v=(e=y(e)).length,t=128,i=0,o=72,s=0;s<v;++s)(g=e[s])<128&&S.push(f(g));for(n=r=S.length,r&&S.push("-");n<v;){for(c=a,s=0;s<v;++s)(g=e[s])>=t&&g<c&&(c=g);for(c-t>p((a-i)/(b=n+1))&&m("overflow"),i+=(c-t)*b,t=c,s=0;s<v;++s)if((g=e[s])<t&&++i>a&&m("overflow"),g==t){for(h=i,u=l;!(h<(d=u<=o?1:u>=o+26?26:u-o));u+=l)A=h-d,E=l-d,S.push(f(x(d+A%E,0))),h=p(A/E);S.push(f(x(h,0))),o=_(i,b,n==r),i=0,++n}++i,++t}return S.join("")}s={version:"1.3.2",ucs2:{decode:y,encode:b},decode:E,encode:A,toASCII:function(e){return v(e,(function(e){return h.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return v(e,(function(e){return c.test(e)?E(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return s}.call(t,i,t,e))||(e.exports=n)}()},8575:(e,t,i)=>{var n=i(52511);function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){y(e)&&(e=v(e));return e instanceof r?e.format():r.prototype.format.call(e)},t.Url=r;var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(a),c=["%","/","?",";","#"].concat(l),h=["/","?","#"],u=/^[a-z0-9A-Z_-]{0,63}$/,d=/^([a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=i(17673);function v(e,t,i){if(e&&b(e)&&e instanceof r)return e;var n=new r;return n.parse(e,t,i),n}function y(e){return"string"==typeof e}function b(e){return"object"==typeof e&&null!==e}function x(e){return null===e}r.prototype.parse=function(e,t,i){if(!y(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e;r=r.trim();var s=o.exec(r);if(s){var a=(s=s[0]).toLowerCase();this.protocol=a,r=r.substr(s.length)}if(i||s||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===r.substr(0,2);!v||s&&f[s]||(r=r.substr(2),this.slashes=!0)}if(!f[s]&&(v||s&&!m[s])){for(var b,x,_=-1,E=0;E<h.length;E++){-1!==(A=r.indexOf(h[E]))&&(-1===_||A<_)&&(_=A)}-1!==(x=-1===_?r.lastIndexOf("@"):r.lastIndexOf("@",_))&&(b=r.slice(0,x),r=r.slice(x+1),this.auth=decodeURIComponent(b)),_=-1;for(E=0;E<c.length;E++){var A;-1!==(A=r.indexOf(c[E]))&&(-1===_||A<_)&&(_=A)}-1===_&&(_=r.length),this.host=r.slice(0,_),r=r.slice(_),this.parseHost(),this.hostname=this.hostname||"";var S="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!S)for(var w=this.hostname.split(/\./),M=(E=0,w.length);E<M;E++){var T=w[E];if(T&&!T.match(u)){for(var C="",P=0,D=T.length;P<D;P++)T.charCodeAt(P)>127?C+="x":C+=T[P];if(!C.match(u)){var L=w.slice(0,E),I=w.slice(E+1),R=T.match(d);R&&(L.push(R[1]),I.unshift(R[2])),I.length&&(r="/"+I.join(".")+r),this.hostname=L.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!S){var O=this.hostname.split("."),N=[];for(E=0;E<O.length;++E){var k=O[E];N.push(k.match(/[^A-Za-z0-9_-]/)?"xn--"+n.encode(k):k)}this.hostname=N.join(".")}var F=this.port?":"+this.port:"",V=this.hostname||"";this.host=V+F,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==r[0]&&(r="/"+r))}if(!p[a])for(E=0,M=l.length;E<M;E++){var U=l[E],B=encodeURIComponent(U);B===U&&(B=escape(U)),r=r.split(U).join(B)}var z=r.indexOf("#");-1!==z&&(this.hash=r.substr(z),r=r.slice(0,z));var G=r.indexOf("?");if(-1!==G?(this.search=r.substr(G),this.query=r.substr(G+1),t&&(this.query=g.parse(this.query)),r=r.slice(0,G)):t&&(this.search="",this.query={}),r&&(this.pathname=r),m[a]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"",k=this.search||"";this.path=F+k}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",i=this.pathname||"",n=this.hash||"",r=!1,o="";this.host?r=e+this.host:this.hostname&&(r=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&b(this.query)&&Object.keys(this.query).length&&(o=g.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||m[t])&&!1!==r?(r="//"+(r||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):r||(r=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+r+(i=i.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+n},r.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(y(e)){var t=new r;t.parse(e,!1,!0),e=t}var i=new r;if(Object.keys(this).forEach((function(e){i[e]=this[e]}),this),i.hash=e.hash,""===e.href)return i.href=i.format(),i;if(e.slashes&&!e.protocol)return Object.keys(e).forEach((function(t){"protocol"!==t&&(i[t]=e[t])})),m[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i;if(e.protocol&&e.protocol!==i.protocol){if(!m[e.protocol])return Object.keys(e).forEach((function(t){i[t]=e[t]})),i.href=i.format(),i;if(i.protocol=e.protocol,e.host||f[e.protocol])i.pathname=e.pathname;else{for(var n=(e.pathname||"").split("/");n.length&&!(e.host=n.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),i.pathname=n.join("/")}if(i.search=e.search,i.query=e.query,i.host=e.host||"",i.auth=e.auth,i.hostname=e.hostname||e.host,i.port=e.port,i.pathname||i.search){var o=i.pathname||"",s=i.search||"";i.path=o+s}return i.slashes=i.slashes||e.slashes,i.href=i.format(),i}var a=i.pathname&&"/"===i.pathname.charAt(0),l=e.host||e.pathname&&"/"===e.pathname.charAt(0),c=l||a||i.host&&e.pathname,h=c,u=i.pathname&&i.pathname.split("/")||[],d=(n=e.pathname&&e.pathname.split("/")||[],i.protocol&&!m[i.protocol]);if(d&&(i.hostname="",i.port=null,i.host&&(""===u[0]?u[0]=i.host:u.unshift(i.host)),i.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===n[0]?n[0]=e.host:n.unshift(e.host)),e.host=null),c=c&&(""===n[0]||""===u[0])),l)i.host=e.host||""===e.host?e.host:i.host,i.hostname=e.hostname||""===e.hostname?e.hostname:i.hostname,i.search=e.search,i.query=e.query,u=n;else if(n.length)u||(u=[]),u.pop(),u=u.concat(n),i.search=e.search,i.query=e.query;else if(null!=e.search){if(d)i.hostname=i.host=u.shift(),(_=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=_.shift(),i.host=i.hostname=_.shift());return i.search=e.search,i.query=e.query,x(i.pathname)&&x(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!u.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var p=u.slice(-1)[0],g=(i.host||e.host)&&("."===p||".."===p)||""===p,v=0,b=u.length;b>=0;b--)"."==(p=u[b])?u.splice(b,1):".."===p?(u.splice(b,1),v++):v&&(u.splice(b,1),v--);if(!c&&!h)for(;v--;v)u.unshift("..");!c||""===u[0]||u[0]&&"/"===u[0].charAt(0)||u.unshift(""),g&&"/"!==u.join("/").substr(-1)&&u.push("");var _,E=""===u[0]||u[0]&&"/"===u[0].charAt(0);d&&(i.hostname=i.host=E?"":u.length?u.shift():"",(_=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=_.shift(),i.host=i.hostname=_.shift()));return(c=c||i.host&&u.length)&&!E&&u.unshift(""),u.length?i.pathname=u.join("/"):(i.pathname=null,i.path=null),x(i.pathname)&&x(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},r.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},15523:e=>{"use strict";e.exports="DELETED_WORKERNODE"},74617:()=>{},75725:()=>{},80959:()=>{},78322:()=>{},83154:(e,t,i)=>{var n;if("function"==typeof fetch&&(n=void 0!==i.g&&i.g.fetch?i.g.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),"undefined"==typeof window||void 0===window.document){var r=n||i(54098);r.default&&(r=r.default),t.default=r,e.exports=t.default}},30325:e=>{"use strict";e.exports=JSON.parse('{"globals":{"dimension":{},"factor":{"factor":1},"factor.derived":{"parentFactors":{}},"quantity":{"units":[]},"symbol":{"doc":"http://docs.adskunits.apiary.io/#introduction/definitions/unit-symbols","unit":{"typeid":"unit","description":"Measurement unit this symbol applies to."}},"symbol.placement":{"Prefix":{"value":0},"Suffix":1},"symbol.prefixOrSuffix":{"text":{"typeid":"String","description":"Text to annotate the value."},"placement":{"typeid":"symbol.placement","description":"Placement of the annotation text."},"space":{"typeid":"Bool","description":"Specifies whether the annotation should be separated from the value by a space."}},"system":{"Metric":{"value":0,"description":"Metric system of measurement units."},"Imperial":1},"unit":{"doc":"http://docs.adskunits.apiary.io/#introduction/definitions/measurement-units","unitSystem":{"typeid":"system"}},"unit.absolute":{"parentUnit":{"typeid":"unit.relative","description":"Relative unit from which this absolute unit is derived."},"offset":{"typeid":"Float64","value":0,"description":"An offset used to position an absolute scale of measurement on the number line."}},"unit.derived":{"parentFactors":{},"parentUnits":{}},"unit.primitive":{},"unit.primitive.dimensional":{"dimension":{"typeid":"dimension"}},"unit.relative":{}},"factor":{"nineFifths":{"factor":1.8},"pi":{"factor":3.14159265358979},"atto":{"parentFactors":{"ten":-18}},"centi":{"parentFactors":{"ten":-2}},"deci":{"parentFactors":{"ten":-1}},"deka":{"parentFactors":{"ten":1}},"exa":{"parentFactors":{"ten":18}},"femto":{"parentFactors":{"ten":-15}},"giga":{"parentFactors":{"ten":9}},"hecto":{"parentFactors":{"ten":2}},"kilo":{"parentFactors":{"ten":3}},"mega":{"parentFactors":{"ten":6}},"micro":{"parentFactors":{"ten":-6}},"milli":{"parentFactors":{"ten":-3}},"nano":{"parentFactors":{"ten":-9}},"peta":{"parentFactors":{"ten":15}},"pico":{"parentFactors":{"ten":-12}},"tera":{"parentFactors":{"ten":12}},"yocto":{"parentFactors":{"ten":-24}},"yotta":{"parentFactors":{"ten":24}},"zepto":{"parentFactors":{"ten":-21}},"zetta":{"parentFactors":{"ten":21}},"ten":{"factor":10},"threeHundredSixty":{"factor":360},"threeThousandNineHundredThirtySeven":{"factor":3937},"twelve":{"factor":12}},"dimension":{"currency":{},"electricCurrent":{},"length":{},"luminousIntensity":{},"mass":{},"temperature":{},"time":{}},"unit":{"1ToRatio":{"unitSystem":"Metric","parentUnits":{"ratioTo1":-1},"symbols":{"1Colon":{"text":"1:","placement":"Prefix","space":false}}},"acres":{"unitSystem":"Imperial","factor":4840,"parentUnits":{"squareYards":1},"symbols":{"acres":{"text":"acres","placement":"Suffix","space":true}}},"ampereHours":{"unitSystem":"Metric","parentUnits":{"amperes":1,"hours":1},"symbols":{"aDashH":{"text":"A-h","placement":"Suffix","space":true}}},"ampereSeconds":{"unitSystem":"Metric","parentUnits":{"amperes":1,"seconds":1},"symbols":{"aDashS":{"text":"A-s","placement":"Suffix","space":true}}},"amperes":{"unitSystem":"Metric","dimension":"electricCurrent","symbols":{"ampere":{"text":"A","placement":"Suffix","space":true}}},"atmospheres":{"unitSystem":"Imperial","factor":101325,"parentUnits":{"pascals":1},"symbols":{"atm":{"text":"atm","placement":"Suffix","space":true}}},"bars":{"unitSystem":"Metric","factor":100,"parentUnits":{"kilopascals":1},"symbols":{"bar":{"text":"bar","placement":"Suffix","space":true}}},"britishThermalUnits":{"unitSystem":"Imperial","factor":1055.05585262,"parentUnits":{"joules":1},"symbols":{"btu":{"text":"Btu","placement":"Suffix","space":true}}},"britishThermalUnitsPerDegreeFahrenheit":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnits":1,"fahrenheitInterval":-1},"symbols":{"btuPerDegreeF":{"text":"BTU/°F","placement":"Suffix","space":true}}},"britishThermalUnitsPerHour":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnits":1,"hours":-1},"symbols":{"btuPerH":{"text":"Btu/h","placement":"Suffix","space":true}}},"britishThermalUnitsPerHourCubicFoot":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnitsPerHour":1,"cubicFeet":-1},"symbols":{"btuPerHFtSup3":{"text":"Btu/(h·ft³)","placement":"Suffix","space":true}}},"britishThermalUnitsPerHourFootDegreeFahrenheit":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnitsPerHour":1,"feet":-1,"fahrenheitInterval":-1},"symbols":{"btuPerHFtDegreeF":{"text":"BTU/(h·ft·°F)","placement":"Suffix","space":true}}},"britishThermalUnitsPerHourSquareFoot":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnitsPerHour":1,"squareFeet":-1},"symbols":{"btuPerHFtSup2":{"text":"Btu/(h·ft²)","placement":"Suffix","space":true}}},"britishThermalUnitsPerHourSquareFootDegreeFahrenheit":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnitsPerHourSquareFoot":1,"fahrenheitInterval":-1},"symbols":{"btuPerHFtSup2DegreeF":{"text":"BTU/(h·ft²·°F)","placement":"Suffix","space":true}}},"britishThermalUnitsPerPound":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnits":1,"poundsMass":-1},"symbols":{"btuPerLb":{"text":"BTU/lb","placement":"Suffix","space":true}}},"britishThermalUnitsPerPoundDegreeFahrenheit":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnitsPerPound":1,"fahrenheitInterval":-1},"symbols":{"btuPerLbDegreeF":{"text":"BTU/(lb·°F)","placement":"Suffix","space":true}}},"britishThermalUnitsPerSecond":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnits":1,"seconds":-1},"symbols":{"btuPerS":{"text":"Btu/s","placement":"Suffix","space":true}}},"britishThermalUnitsPerSquareFootDegreeFahrenheit":{"unitSystem":"Imperial","parentUnits":{"britishThermalUnits":1,"squareFeet":-1,"fahrenheitInterval":-1},"symbols":{"btuPerFtSup2DegreeF":{"text":"BTU/(ft²·°F)","placement":"Suffix","space":true}}},"calories":{"unitSystem":"Metric","factor":4.1868,"parentUnits":{"joules":1},"symbols":{"cal":{"text":"cal","placement":"Suffix","space":true}}},"caloriesPerSecond":{"unitSystem":"Metric","parentUnits":{"calories":1,"seconds":-1},"symbols":{"calPerS":{"text":"cal/s","placement":"Suffix","space":true}}},"candelas":{"unitSystem":"Metric","dimension":"luminousIntensity","symbols":{"cd":{"text":"cd","placement":"Suffix","space":true}}},"candelasPerSquareFoot":{"unitSystem":"Imperial","parentUnits":{"candelas":1,"squareFeet":-1},"symbols":{"cdPerFtSup2":{"text":"cd/ft²","placement":"Suffix","space":true}}},"candelasPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"candelas":1,"squareMeters":-1},"symbols":{"cdPerMSup2":{"text":"cd/m²","placement":"Suffix","space":true}}},"celsius":{"unitSystem":"Metric","parentUnit":"celsiusInterval","offset":273.15,"symbols":{"degreeC":{"text":"°C","placement":"Suffix","space":true}}},"celsiusInterval":{"unitSystem":"Metric","parentUnits":{"kelvinInterval":1},"symbols":{"degreeCInterval":{"text":"°C","placement":"Suffix","space":true},"deltaDegreeC":{"text":"delta°C","placement":"Suffix","space":true}}},"centimeters":{"unitSystem":"Metric","parentFactors":{"centi":1},"parentUnits":{"meters":1},"symbols":{"cm":{"text":"cm","placement":"Suffix","space":true}}},"centimetersPerMinute":{"unitSystem":"Metric","parentUnits":{"centimeters":1,"minutes":-1},"symbols":{"cmPerMin":{"text":"cm/min","placement":"Suffix","space":true}}},"centimetersToTheFourthPower":{"unitSystem":"Metric","parentUnits":{"centimeters":4},"symbols":{"cmSup4":{"text":"cm⁴","placement":"Suffix","space":true}}},"centimetersToTheSixthPower":{"unitSystem":"Metric","parentUnits":{"centimeters":6},"symbols":{"cmSup6":{"text":"cm⁶","placement":"Suffix","space":true}}},"centipoises":{"unitSystem":"Metric","parentFactors":{"centi":1},"parentUnits":{"poises":1},"symbols":{"cP":{"text":"cP","placement":"Suffix","space":true}}},"circularMils":{"unitSystem":"Imperial","factor":0.25,"parentFactors":{"pi":1},"parentUnits":{"squareMils":1},"symbols":{"cMil":{"text":"cmil","placement":"Suffix","space":true}}},"coulombs":{"unitSystem":"Metric","parentUnits":{"ampereSeconds":1},"symbols":{"coulomb":{"text":"C","placement":"Suffix","space":true}}},"cubicCentimeters":{"defaultSymbol":"cmSup3","unitSystem":"Metric","parentUnits":{"centimeters":3},"symbols":{"cmCaret3":{"text":"cm^3","placement":"Suffix","space":true},"cmSup3":{"text":"cm³","placement":"Suffix","space":true}}},"cubicFeet":{"defaultSymbol":"ftSup3","unitSystem":"Imperial","parentUnits":{"feet":3},"symbols":{"cf":{"text":"CF","placement":"Suffix","space":true},"ftCaret3":{"text":"ft^3","placement":"Suffix","space":true},"ftSup3":{"text":"ft³","placement":"Suffix","space":true}}},"cubicFeetPerHour":{"defaultSymbol":"ftSup3PerHour","unitSystem":"Imperial","parentUnits":{"cubicFeet":1,"hours":-1},"symbols":{"cfh":{"text":"CFH","placement":"Suffix","space":true},"ftSup3PerH":{"text":"ft³/h","placement":"Suffix","space":true}}},"cubicFeetPerKip":{"unitSystem":"Imperial","parentUnits":{"cubicFeet":1,"kips":-1},"symbols":{"ftSup3PerKip":{"text":"ft³/kip","placement":"Suffix","space":true}}},"cubicFeetPerMinute":{"defaultSymbol":"ftSup3PerMin","unitSystem":"Imperial","parentUnits":{"cubicFeet":1,"minutes":-1},"symbols":{"cfm":{"text":"CFM","placement":"Suffix","space":true},"ftSup3PerMin":{"text":"ft³/min","placement":"Suffix","space":true}}},"cubicFeetPerMinuteCubicFoot":{"defaultSymbol":"cfmPerFtSup3","unitSystem":"Imperial","parentUnits":{"cubicFeetPerMinute":1,"cubicFeet":-1},"symbols":{"cfmPerCf":{"text":"CFM/CF","placement":"Suffix","space":true},"cfmPerFtSup3":{"text":"CFM/ft³","placement":"Suffix","space":true}}},"cubicFeetPerMinutePerBritishThermalUnitPerHour":{"unitSystem":"Imperial","parentUnits":{"cubicFeetPerMinute":1,"britishThermalUnitsPerHour":-1},"symbols":{"ftSup3HPerMinBtu":{"text":"ft³·h/(min·Btu)","placement":"Suffix","space":true}}},"cubicFeetPerMinuteSquareFoot":{"defaultSymbol":"cfmPerFtSup2","unitSystem":"Imperial","parentUnits":{"cubicFeetPerMinute":1,"squareFeet":-1},"symbols":{"cfmPerFtSup2":{"text":"CFM/ft²","placement":"Suffix","space":true},"cfmPerSf":{"text":"CFM/SF","placement":"Suffix","space":true}}},"cubicFeetPerMinuteSquareMeter":{"unitSystem":"Metric","parentUnits":{"cubicFeetPerMinute":1,"squareMeters":-1}},"cubicFeetPerMinuteTonOfRefrigeration":{"unitSystem":"Imperial","parentUnits":{"cubicFeetPerMinute":1,"tonsOfRefrigeration":-1},"symbols":{"cfmPerTon":{"text":"CFM/ton","placement":"Suffix","space":true}}},"cubicFeetPerPoundMass":{"unitSystem":"Imperial","parentUnits":{"cubicFeet":1,"poundsMass":-1},"symbols":{"ftSup3PerLbMass":{"text":"ft³/lb","placement":"Suffix","space":true}}},"cubicInches":{"defaultSymbol":"inSup3","unitSystem":"Imperial","parentUnits":{"inches":3},"symbols":{"inCaret3":{"text":"in^3","placement":"Suffix","space":true},"inSup3":{"text":"in³","placement":"Suffix","space":true}}},"cubicMeters":{"defaultSymbol":"mSup3","unitSystem":"Metric","parentUnits":{"meters":3},"symbols":{"mCaret3":{"text":"m^3","placement":"Suffix","space":true},"mSup3":{"text":"m³","placement":"Suffix","space":true}}},"cubicMetersPerHour":{"defaultSymbol":"mSup3PerH","unitSystem":"Metric","parentUnits":{"cubicMeters":1,"hours":-1},"symbols":{"cmh":{"text":"CMH","placement":"Suffix","space":true},"mSup3PerH":{"text":"m³/h","placement":"Suffix","space":true}}},"cubicMetersPerHourCubicMeter":{"unitSystem":"Metric","parentUnits":{"cubicMetersPerHour":1,"cubicMeters":-1},"symbols":{"mSup3PerHMSup3":{"text":"m³/(h·m³)","placement":"Suffix","space":true}}},"cubicMetersPerHourSquareMeter":{"unitSystem":"Metric","parentUnits":{"cubicMetersPerHour":1,"squareMeters":-1},"symbols":{"mSup3PerHMSup2":{"text":"m³/(h·m²)","placement":"Suffix","space":true}}},"cubicMetersPerKilogram":{"unitSystem":"Metric","parentUnits":{"cubicMeters":1,"kilograms":-1},"symbols":{"mSup3PerKg":{"text":"m³/kg","placement":"Suffix","space":true}}},"cubicMetersPerKilonewton":{"unitSystem":"Metric","parentUnits":{"cubicMeters":1,"kilonewtons":-1},"symbols":{"mSup3PerKN":{"text":"m³/kN","placement":"Suffix","space":true}}},"cubicMetersPerSecond":{"defaultSymbol":"mSup3PerS","unitSystem":"Metric","parentUnits":{"cubicMeters":1,"seconds":-1},"symbols":{"cms":{"text":"CMS","placement":"Suffix","space":true},"mSup3PerS":{"text":"m³/s","placement":"Suffix","space":true}}},"cubicMetersPerWattSecond":{"unitSystem":"Metric","parentUnits":{"cubicMeters":1,"watts":-1,"seconds":-1},"symbols":{"mSup3PerWS":{"text":"m³/(W·s)","placement":"Suffix","space":true}}},"cubicMillimeters":{"defaultSymbol":"mmSup3","unitSystem":"Metric","parentUnits":{"millimeters":3},"symbols":{"mmCaret3":{"text":"mm^3","placement":"Suffix","space":true},"mmSup3":{"text":"mm³","placement":"Suffix","space":true}}},"cubicYards":{"unitSystem":"Imperial","parentUnits":{"yards":3},"symbols":{"cy":{"text":"CY","placement":"Suffix","space":true}}},"currency":{"defaultSymbol":"usDollar","unitSystem":"Imperial","dimension":"currency","symbols":{"baht":{"description":"Baht is the official currency of Thailand.","text":"฿","placement":"Prefix","space":false},"chineseHongKongDollar":{"description":"Hong Kong Dollar is the official currency of Hong Kong..","text":"HK$","placement":"Prefix","space":false},"dong":{"description":"Dong is the official currency of Vietnam.","text":"₫","placement":"Suffix","space":false},"euroPrefix":{"text":"€","placement":"Prefix","space":false},"euroSuffix":{"text":"€","placement":"Suffix","space":false},"krone":{"description":"Krone is the official currency of Denmark, Greenland, and the Faroe Islands.","text":"kr","placement":"Suffix","space":true},"shekel":{"description":"Shekel is the official currency of Israel.","text":"₪","placement":"Prefix","space":false},"ukPound":{"text":"£","placement":"Prefix","space":false},"usDollar":{"text":"$","placement":"Prefix","space":false},"won":{"description":"Won is the official currency of South Korea.","text":"₩","placement":"Prefix","space":false},"yen":{"text":"¥","placement":"Prefix","space":false}}},"currencyPerBritishThermalUnit":{"unitSystem":"Imperial","parentUnits":{"currency":1,"britishThermalUnits":-1},"symbols":{"dollarPerBtu":{"text":"$/Btu","placement":"Suffix","space":true}}},"currencyPerBritishThermalUnitPerHour":{"unitSystem":"Imperial","parentUnits":{"currency":1,"britishThermalUnitsPerHour":-1},"symbols":{"dollarHPerBtu":{"text":"$·h/Btu","placement":"Suffix","space":true}}},"currencyPerSquareFoot":{"unitSystem":"Imperial","parentUnits":{"currency":1,"squareFeet":-1},"symbols":{"dollarPerFtSup2":{"text":"$/ft²","placement":"Suffix","space":true}}},"currencyPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"currency":1,"squareMeters":-1},"symbols":{"dollarPerMSup2":{"text":"$/m²","placement":"Suffix","space":true}}},"currencyPerWatt":{"unitSystem":"Metric","parentUnits":{"currency":1,"watts":-1},"symbols":{"dollarPerW":{"text":"$/W","placement":"Suffix","space":true}}},"currencyPerWattHour":{"unitSystem":"Metric","parentUnits":{"currency":1,"watts":-1,"hours":-1},"symbols":{"dollarPerWH":{"text":"$/(W·h)","placement":"Suffix","space":true}}},"cyclesPerSecond":{"unitSystem":"Metric","parentUnits":{"seconds":-1},"symbols":{"cps":{"text":"cps","placement":"Suffix","space":true}}},"decimeters":{"unitSystem":"Metric","parentFactors":{"deci":1},"parentUnits":{"meters":1},"symbols":{"dm":{"text":"dm","placement":"Suffix","space":true}}},"degrees":{"defaultSymbol":"degree","unitSystem":"Metric","parentFactors":{"threeHundredSixty":-1},"parentUnits":{"turns":1},"symbols":{"degree":{"text":"°","placement":"Suffix","space":false},"degreesMinutesSeconds":{"inherits":"symbol"}}},"dekanewtonMeters":{"unitSystem":"Metric","parentUnits":{"dekanewtons":1,"meters":1},"symbols":{"daNDashM":{"text":"daN-m","placement":"Suffix","space":true}}},"dekanewtonMetersPerMeter":{"unitSystem":"Metric","parentUnits":{"dekanewtonMeters":1,"meters":-1},"symbols":{"daNDashMPerM":{"text":"daN-m/m","placement":"Suffix","space":true}}},"dekanewtons":{"unitSystem":"Metric","parentFactors":{"deka":1},"parentUnits":{"newtons":1},"symbols":{"daN":{"text":"daN","placement":"Suffix","space":true}}},"dekanewtonsPerMeter":{"unitSystem":"Metric","parentUnits":{"dekanewtons":1,"meters":-1},"symbols":{"daNPerM":{"text":"daN/m","placement":"Suffix","space":true}}},"dekanewtonsPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"dekanewtons":1,"squareMeters":-1},"symbols":{"daNPerMSup2":{"text":"daN/m²","placement":"Suffix","space":true}}},"dynes":{"unitSystem":"Metric","factor":10,"parentFactors":{"micro":1},"parentUnits":{"newtons":1},"symbols":{"dyn":{"text":"dyn","placement":"Suffix","space":true}}},"ergs":{"unitSystem":"Metric","parentFactors":{"ten":-7},"parentUnits":{"joules":1},"symbols":{"erg":{"text":"erg","placement":"Suffix","space":true}}},"fahrenheit":{"unitSystem":"Imperial","parentUnit":"fahrenheitInterval","offset":459.67,"symbols":{"degreeF":{"text":"°F","placement":"Suffix","space":true}}},"fahrenheitInterval":{"defaultSymbol":"degreeFInterval","unitSystem":"Imperial","parentUnits":{"rankineInterval":1},"symbols":{"degreeFInterval":{"text":"°F","placement":"Suffix","space":true},"deltaDegreeF":{"text":"delta°F","placement":"Suffix","space":true}}},"farads":{"unitSystem":"Metric","parentUnits":{"coulombs":1,"volts":-1},"symbols":{"farad":{"text":"F","placement":"Suffix","space":true}}},"feet":{"defaultSymbol":"feetAndInches","unitSystem":"Imperial","factor":12,"parentUnits":{"inches":1},"symbols":{"feetAndInches":{"inherits":"symbol"},"footSingleQuote":{"text":"\'","placement":"Suffix","space":false},"ft":{"text":"ft","placement":"Suffix","space":true},"lf":{"text":"LF","placement":"Suffix","space":true}}},"feetOfWater39.2DegreesFahrenheit":{"defaultSymbol":"feetOfWater","unitSystem":"Imperial","factor":2988.98,"parentUnits":{"pascals":1},"symbols":{"feetOfWater":{"text":"Feet","placement":"Suffix","space":true},"ftH2O":{"text":"ftH2O","placement":"Suffix","space":true},"ftOfWater":{"text":"FT","placement":"Suffix","space":true}}},"feetOfWater39.2DegreesFahrenheitPer100Feet":{"defaultSymbol":"feetOfWaterPer100ft","unitSystem":"Imperial","factor":0.01,"parentUnits":{"feetOfWater39.2DegreesFahrenheit":1,"feet":-1},"symbols":{"feetOfWaterPer100ft":{"text":"Feet/100ft","placement":"Suffix","space":true},"ftH2OPer100ft":{"text":"ftH2O/100ft","placement":"Suffix","space":true},"ftOfWaterPer100ft":{"text":"FT/100ft","placement":"Suffix","space":true}}},"feetPerKip":{"unitSystem":"Imperial","parentUnits":{"feet":1,"kips":-1},"symbols":{"ftPerKip":{"text":"ft/kip","placement":"Suffix","space":true}}},"feetPerKipFoot":{"unitSystem":"Imperial","parentUnits":{"feet":1,"kipFeet":-1},"symbols":{"ftPerKipDashFt":{"text":"ft/kip-ft","placement":"Suffix","space":true}}},"feetPerMinute":{"defaultSymbol":"fpm","unitSystem":"Imperial","parentUnits":{"feet":1,"minutes":-1},"symbols":{"fpm":{"text":"FPM","placement":"Suffix","space":true},"ftPerMin":{"text":"ft/min","placement":"Suffix","space":true}}},"feetPerSecond":{"defaultSymbol":"fps","unitSystem":"Imperial","parentUnits":{"feet":1,"seconds":-1},"symbols":{"fps":{"text":"FPS","placement":"Suffix","space":true},"ftPerS":{"text":"ft/s","placement":"Suffix","space":true}}},"feetPerSecondSquared":{"unitSystem":"Imperial","parentUnits":{"feetPerSecond":1,"seconds":-1},"symbols":{"ftPerSSup2":{"text":"ft/s²","placement":"Suffix","space":true}}},"feetToTheFourthPower":{"unitSystem":"Imperial","parentUnits":{"feet":4},"symbols":{"ftSup4":{"text":"ft⁴","placement":"Suffix","space":true}}},"feetToTheSixthPower":{"unitSystem":"Imperial","parentUnits":{"feet":6},"symbols":{"ftSup6":{"text":"ft⁶","placement":"Suffix","space":true}}},"fixed":{"unitSystem":"Metric","parentUnits":{"ratioTo1":1}},"footcandles":{"defaultSymbol":"fc","unitSystem":"Imperial","parentUnits":{"lumens":1,"squareFeet":-1},"symbols":{"fc":{"text":"fc","placement":"Suffix","space":true},"ftc":{"text":"Ftc","placement":"Suffix","space":true}}},"footlamberts":{"defaultSymbol":"fL","unitSystem":"Imperial","parentFactors":{"pi":-1},"parentUnits":{"candelas":1,"squareFeet":-1},"symbols":{"fL":{"text":"fL","placement":"Suffix","space":true},"flLowercase":{"text":"fl","placement":"Suffix","space":true},"ftL":{"text":"ftL","placement":"Suffix","space":true}}},"gammas":{"unitSystem":"Metric","parentFactors":{"nano":1},"parentUnits":{"teslas":1},"symbols":{"gamma":{"text":"gamma","placement":"Suffix","space":true}}},"gauss":{"unitSystem":"Metric","parentFactors":{"ten":-4},"parentUnits":{"teslas":1},"symbols":{"gs":{"text":"Gs","placement":"Suffix","space":true}}},"general":{"unitSystem":"Metric","parentUnits":{"ratioTo1":1}},"gigajoules":{"unitSystem":"Metric","parentFactors":{"giga":1},"parentUnits":{"joules":1}},"gradians":{"unitSystem":"Metric","factor":0.9,"parentUnits":{"degrees":1},"symbols":{"grad":{"text":"grad","placement":"Suffix","space":true}}},"grains":{"unitSystem":"Imperial","factor":64.79891,"parentUnits":{"milligrams":1},"symbols":{"gr":{"text":"gr","placement":"Suffix","space":true}}},"grainsPerHourSquareFootInchMercury":{"unitSystem":"Imperial","parentUnits":{"grains":1,"hours":-1,"squareFeet":-1,"inchesOfMercury32DegreesFahrenheit":-1},"symbols":{"grPerHFtSup2InHg":{"text":"gr/(h·ft²·inHg)","placement":"Suffix","space":true}}},"grams":{"unitSystem":"Metric","factor":0.001,"parentUnits":{"kilograms":1},"symbols":{"gram":{"text":"g","placement":"Suffix","space":true}}},"hectares":{"unitSystem":"Metric","parentUnits":{"squareHectometers":1},"symbols":{"hectare":{"text":"hectare","placement":"Suffix","space":true}}},"hectometers":{"unitSystem":"Metric","parentFactors":{"hecto":1},"parentUnits":{"meters":1},"symbols":{"hm":{"text":"hm","placement":"Suffix","space":true}}},"henries":{"unitSystem":"Metric","parentUnits":{"ohms":1,"seconds":1},"symbols":{"henry":{"text":"H","placement":"Suffix","space":true}}},"hertz":{"unitSystem":"Metric","parentUnits":{"cyclesPerSecond":1},"symbols":{"hz":{"text":"Hz","placement":"Suffix","space":true}}},"horsepower":{"unitSystem":"Imperial","factor":33000,"parentUnits":{"poundForceFeet":1,"minutes":-1},"symbols":{"hp":{"text":"hp","placement":"Suffix","space":true}}},"hourSquareFootDegreesFahrenheitPerBritishThermalUnit":{"unitSystem":"Imperial","parentUnits":{"hours":1,"squareFeet":1,"fahrenheitInterval":1,"britishThermalUnits":-1},"symbols":{"hFtSup2DegreeFPerBtu":{"text":"(h·ft²·°F)/BTU","placement":"Suffix","space":true}}},"hours":{"unitSystem":"Metric","factor":60,"parentUnits":{"minutes":1},"symbols":{"hour":{"text":"h","placement":"Suffix","space":true}}},"inches":{"defaultSymbol":"in","unitSystem":"Imperial","factor":2.54,"parentUnits":{"centimeters":1},"symbols":{"in":{"text":"in","placement":"Suffix","space":true},"inchDoubleQuote":{"text":"\\"","placement":"Suffix","space":false}}},"inchesOfMercury32DegreesFahrenheit":{"unitSystem":"Imperial","factor":3386.389,"parentUnits":{"pascals":1},"symbols":{"inHg":{"text":"inHg","placement":"Suffix","space":true}}},"inchesOfWater60DegreesFahrenheit":{"unitSystem":"Imperial","factor":248.84,"parentUnits":{"pascals":1},"symbols":{"inDashWg":{"text":"in-wg","placement":"Suffix","space":true}}},"inchesOfWater60DegreesFahrenheitPer100Feet":{"unitSystem":"Imperial","factor":0.01,"parentUnits":{"inchesOfWater60DegreesFahrenheit":1,"feet":-1},"symbols":{"inDashWgPer100ft":{"text":"in-wg/100ft","placement":"Suffix","space":true}}},"inchesPerSecond":{"unitSystem":"Imperial","parentUnits":{"inches":1,"seconds":-1},"symbols":{"inPerS":{"text":"in/s","placement":"Suffix","space":true}}},"inchesPerSecondSquared":{"unitSystem":"Imperial","parentUnits":{"inchesPerSecond":1,"seconds":-1},"symbols":{"inPerSSup2":{"text":"in/s²","placement":"Suffix","space":true}}},"inchesToTheFourthPower":{"unitSystem":"Imperial","parentUnits":{"inches":4},"symbols":{"inSup4":{"text":"in⁴","placement":"Suffix","space":true}}},"inchesToTheSixthPower":{"unitSystem":"Imperial","parentUnits":{"inches":6},"symbols":{"inSup6":{"text":"in⁶","placement":"Suffix","space":true}}},"inverseDegreesCelsius":{"unitSystem":"Metric","parentUnits":{"celsiusInterval":-1},"symbols":{"invDegreeC":{"text":"1/°C","placement":"Suffix","space":true}}},"inverseDegreesFahrenheit":{"unitSystem":"Imperial","parentUnits":{"fahrenheitInterval":-1},"symbols":{"invDegreeF":{"text":"1/°F","placement":"Suffix","space":true}}},"inverseKilonewtons":{"unitSystem":"Metric","parentUnits":{"kilonewtons":-1},"symbols":{"invKN":{"text":"1/kN","placement":"Suffix","space":true}}},"inverseKips":{"unitSystem":"Imperial","parentUnits":{"kips":-1},"symbols":{"invKip":{"text":"1/kip","placement":"Suffix","space":true}}},"joules":{"unitSystem":"Metric","parentUnits":{"newtonMeters":1},"symbols":{"joule":{"text":"J","placement":"Suffix","space":true}}},"joulesPerGram":{"unitSystem":"Metric","parentUnits":{"joules":1,"grams":-1},"symbols":{"jPerG":{"text":"J/g","placement":"Suffix","space":true}}},"joulesPerGramDegreeCelsius":{"unitSystem":"Metric","parentUnits":{"joulesPerGram":1,"celsiusInterval":-1},"symbols":{"jPerGDegreeC":{"text":"J/(g·°C)","placement":"Suffix","space":true}}},"joulesPerKelvin":{"unitSystem":"Metric","parentUnits":{"joules":1,"kelvinInterval":-1},"symbols":{"jPerK":{"text":"J/K","placement":"Suffix","space":true}}},"joulesPerKilogram":{"unitSystem":"Metric","parentUnits":{"joules":1,"kilograms":-1},"symbols":{"jPerKg":{"text":"J/kg","placement":"Suffix","space":true}}},"joulesPerKilogramDegreeCelsius":{"unitSystem":"Metric","parentUnits":{"joulesPerKilogram":1,"celsiusInterval":-1},"symbols":{"jPerKgDegreeC":{"text":"J/(kg·°C)","placement":"Suffix","space":true}}},"joulesPerSquareMeterKelvin":{"unitSystem":"Metric","parentUnits":{"joules":1,"squareMeters":-1,"kelvinInterval":-1},"symbols":{"jPerMSup2K":{"text":"J/(m²·K)","placement":"Suffix","space":true}}},"kelvin":{"unitSystem":"Metric","parentUnit":"kelvinInterval","symbols":{"kelvin":{"text":"K","placement":"Suffix","space":true}}},"kelvinInterval":{"defaultSymbol":"deltaK","unitSystem":"Metric","dimension":"temperature","symbols":{"deltaK":{"text":"deltaK","placement":"Suffix","space":true},"kelvinInterval":{"text":"K","placement":"Suffix","space":true}}},"kiloamperes":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"amperes":1},"symbols":{"kA":{"text":"kA","placement":"Suffix","space":true}}},"kilocalories":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"calories":1},"symbols":{"kcal":{"text":"kcal","placement":"Suffix","space":true}}},"kilocaloriesPerSecond":{"unitSystem":"Metric","parentUnits":{"kilocalories":1,"seconds":-1},"symbols":{"kcalPerS":{"text":"kcal/s","placement":"Suffix","space":true}}},"kilogramForceMeters":{"unitSystem":"Metric","parentUnits":{"kilogramsForce":1,"meters":1},"symbols":{"kgfDashM":{"text":"kgf-m","placement":"Suffix","space":true}}},"kilogramForceMetersPerMeter":{"unitSystem":"Metric","parentUnits":{"kilogramForceMeters":1,"meters":-1},"symbols":{"kgfDashMPerM":{"text":"kgf-m/m","placement":"Suffix","space":true}}},"kilogramKelvins":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"kelvinInterval":1},"symbols":{"kgK":{"text":"kg·K","placement":"Suffix","space":true}}},"kilograms":{"unitSystem":"Metric","dimension":"mass","symbols":{"kg":{"text":"kg","placement":"Suffix","space":true}}},"kilogramsForce":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"standardGravity":1},"symbols":{"kgf":{"text":"kgf","placement":"Suffix","space":true}}},"kilogramsForcePerMeter":{"unitSystem":"Metric","parentUnits":{"kilogramsForce":1,"meters":-1},"symbols":{"kgfPerM":{"text":"kgf/m","placement":"Suffix","space":true}}},"kilogramsForcePerSquareMeter":{"unitSystem":"Metric","parentUnits":{"kilogramsForce":1,"squareMeters":-1},"symbols":{"kgfPerMSup2":{"text":"kgf/m²","placement":"Suffix","space":true}}},"kilogramsPerCubicCentimeter":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"cubicCentimeters":-1}},"kilogramsPerCubicMeter":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"cubicMeters":-1},"symbols":{"kgPerMSup3":{"text":"kg/m³","placement":"Suffix","space":true}}},"kilogramsPerHour":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"hours":-1},"symbols":{"kgPerH":{"text":"kg/h","placement":"Suffix","space":true}}},"kilogramsPerKilogramKelvin":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"kilogramKelvins":-1},"symbols":{"kgPerKgK":{"text":"kg/(kg·K)","placement":"Suffix","space":true}}},"kilogramsPerMeter":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"meters":-1},"symbols":{"kgPerM":{"text":"kg/m","placement":"Suffix","space":true}}},"kilogramsPerMeterHour":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"meters":-1,"hours":-1},"symbols":{"kgPerMH":{"text":"kg/(m·h)","placement":"Suffix","space":true}}},"kilogramsPerMeterSecond":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"meters":-1,"seconds":-1},"symbols":{"kgPerMS":{"text":"kg/(m·s)","placement":"Suffix","space":true}}},"kilogramsPerMinute":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"minutes":-1},"symbols":{"kgPerMin":{"text":"kg/min","placement":"Suffix","space":true}}},"kilogramsPerSecond":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"seconds":-1},"symbols":{"kgPerS":{"text":"kg/s","placement":"Suffix","space":true}}},"kilogramsPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"squareMeters":-1},"symbols":{"kgPerMSup2":{"text":"kg/m²","placement":"Suffix","space":true}}},"kilojoules":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"joules":1},"symbols":{"kJ":{"text":"kJ","placement":"Suffix","space":true}}},"kilojoulesPerKelvin":{"unitSystem":"Metric","parentUnits":{"kilojoules":1,"kelvinInterval":-1},"symbols":{"kJPerK":{"text":"kJ/K","placement":"Suffix","space":true}}},"kilojoulesPerSquareMeterKelvin":{"unitSystem":"Metric","parentUnits":{"kilojoules":1,"squareMeters":-1,"kelvinInterval":-1},"symbols":{"kJPerMSup2K":{"text":"kJ/(m²·K)","placement":"Suffix","space":true}}},"kilometers":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"meters":1},"symbols":{"km":{"text":"km","placement":"Suffix","space":true}}},"kilometersPerHour":{"unitSystem":"Metric","parentUnits":{"kilometers":1,"hours":-1},"symbols":{"kmPerH":{"text":"km/h","placement":"Suffix","space":true}}},"kilometersPerSecond":{"unitSystem":"Metric","parentUnits":{"kilometers":1,"seconds":-1},"symbols":{"kmPerS":{"text":"km/s","placement":"Suffix","space":true}}},"kilometersPerSecondSquared":{"unitSystem":"Metric","parentUnits":{"kilometersPerSecond":1,"seconds":-1},"symbols":{"kmPerSSup2":{"text":"km/s²","placement":"Suffix","space":true}}},"kilonewtonMeters":{"unitSystem":"Metric","parentUnits":{"kilonewtons":1,"meters":1},"symbols":{"kNDashM":{"text":"kN-m","placement":"Suffix","space":true}}},"kilonewtonMetersPerDegree":{"unitSystem":"Metric","parentUnits":{"kilonewtonMeters":1,"degrees":-1},"symbols":{"kNDashMPerDegree":{"text":"kN-m/°","placement":"Suffix","space":true}}},"kilonewtonMetersPerDegreePerMeter":{"unitSystem":"Metric","parentUnits":{"kilonewtonMetersPerDegree":1,"meters":-1},"symbols":{"kNDashMPerDegreePerM":{"text":"kN-m/°/m","placement":"Suffix","space":true}}},"kilonewtonMetersPerMeter":{"unitSystem":"Metric","parentUnits":{"kilonewtonMeters":1,"meters":-1},"symbols":{"kNDashMPerM":{"text":"kN-m/m","placement":"Suffix","space":true}}},"kilonewtons":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"newtons":1},"symbols":{"kN":{"text":"kN","placement":"Suffix","space":true}}},"kilonewtonsPerCubicMeter":{"unitSystem":"Metric","parentUnits":{"kilonewtons":1,"cubicMeters":-1},"symbols":{"kNPerMSup3":{"text":"kN/m³","placement":"Suffix","space":true}}},"kilonewtonsPerMeter":{"unitSystem":"Metric","parentUnits":{"kilonewtons":1,"meters":-1},"symbols":{"kNPerM":{"text":"kN/m","placement":"Suffix","space":true}}},"kilonewtonsPerSquareCentimeter":{"unitSystem":"Metric","parentUnits":{"kilonewtons":1,"squareCentimeters":-1},"symbols":{"kNPerCmSup2":{"text":"kN/cm²","placement":"Suffix","space":true}}},"kilonewtonsPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"kilonewtons":1,"squareMeters":-1},"symbols":{"kNPerMSup2":{"text":"kN/m²","placement":"Suffix","space":true}}},"kilonewtonsPerSquareMillimeter":{"unitSystem":"Metric","parentUnits":{"kilonewtons":1,"squareMillimeters":-1},"symbols":{"kNPerMmSup2":{"text":"kN/mm²","placement":"Suffix","space":true}}},"kilopascals":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"pascals":1},"symbols":{"kPa":{"text":"kPa","placement":"Suffix","space":true}}},"kilovoltAmperes":{"unitSystem":"Metric","parentUnits":{"kilovolts":1,"amperes":1},"symbols":{"kVA":{"text":"kVA","placement":"Suffix","space":true}}},"kilovolts":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"volts":1},"symbols":{"kV":{"text":"kV","placement":"Suffix","space":true}}},"kilowattHours":{"unitSystem":"Metric","parentUnits":{"kilowatts":1,"hours":1},"symbols":{"kWh":{"text":"kWh","placement":"Suffix","space":true}}},"kilowattHoursPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"kilowattHours":1,"squareMeters":-1},"symbols":{"kWhPerMSup2":{"text":"kWh/m²","placement":"Suffix","space":true}}},"kilowatts":{"unitSystem":"Metric","parentFactors":{"kilo":1},"parentUnits":{"watts":1},"symbols":{"kW":{"text":"kW","placement":"Suffix","space":true}}},"kipFeet":{"unitSystem":"Imperial","parentUnits":{"kips":1,"feet":1},"symbols":{"kipDashFt":{"text":"kip-ft","placement":"Suffix","space":true}}},"kipFeetPerDegree":{"unitSystem":"Imperial","parentUnits":{"kipFeet":1,"degrees":-1},"symbols":{"kipDashFtPerDegree":{"text":"kip-ft/°","placement":"Suffix","space":true}}},"kipFeetPerDegreePerFoot":{"unitSystem":"Imperial","parentUnits":{"kipFeetPerDegree":1,"feet":-1},"symbols":{"kipDashFtPerDegreePerFt":{"text":"kip-ft/°/ft","placement":"Suffix","space":true}}},"kipFeetPerFoot":{"unitSystem":"Imperial","parentUnits":{"kipFeet":1,"feet":-1},"symbols":{"kipDashFtPerFt":{"text":"kip-ft/ft","placement":"Suffix","space":true}}},"kips":{"unitSystem":"Imperial","parentFactors":{"kilo":1},"parentUnits":{"poundsForce":1},"symbols":{"kip":{"text":"kip","placement":"Suffix","space":true}}},"kipsPerCubicFoot":{"unitSystem":"Imperial","parentUnits":{"kips":1,"cubicFeet":-1},"symbols":{"kipPerFtSup3":{"text":"kip/ft³","placement":"Suffix","space":true}}},"kipsPerCubicInch":{"unitSystem":"Imperial","parentUnits":{"kips":1,"cubicInches":-1},"symbols":{"kipPerInSup3":{"text":"kip/in³","placement":"Suffix","space":true}}},"kipsPerFoot":{"unitSystem":"Imperial","parentUnits":{"kips":1,"feet":-1},"symbols":{"kipPerFt":{"text":"kip/ft","placement":"Suffix","space":true}}},"kipsPerInch":{"unitSystem":"Imperial","parentUnits":{"kips":1,"inches":-1},"symbols":{"kipPerIn":{"text":"kip/in","placement":"Suffix","space":true}}},"kipsPerSquareFoot":{"defaultSymbol":"kipPerFtSup2","unitSystem":"Imperial","parentUnits":{"kips":1,"squareFeet":-1},"symbols":{"kipPerFtSup2":{"text":"kip/ft²","placement":"Suffix","space":true},"ksf":{"text":"ksf","placement":"Suffix","space":true}}},"kipsPerSquareInch":{"defaultSymbol":"kipPerInSup2","unitSystem":"Imperial","parentUnits":{"kips":1,"squareInches":-1},"symbols":{"kipPerInSup2":{"text":"kip/in²","placement":"Suffix","space":true},"ksi":{"text":"ksi","placement":"Suffix","space":true}}},"liters":{"unitSystem":"Metric","parentUnits":{"decimeters":3},"symbols":{"liter":{"text":"L","placement":"Suffix","space":true}}},"litersPerHour":{"unitSystem":"Metric","parentUnits":{"liters":1,"hours":-1},"symbols":{"lPerH":{"text":"L/h","placement":"Suffix","space":true}}},"litersPerMinute":{"defaultSymbol":"lPerMin","unitSystem":"Metric","parentUnits":{"liters":1,"minutes":-1},"symbols":{"lPerMin":{"text":"L/min","placement":"Suffix","space":true},"lpm":{"text":"LPM","placement":"Suffix","space":true}}},"litersPerSecond":{"defaultSymbol":"lPerS","unitSystem":"Metric","parentUnits":{"liters":1,"seconds":-1},"symbols":{"lPerS":{"text":"L/s","placement":"Suffix","space":true},"lps":{"text":"LPS","placement":"Suffix","space":true}}},"litersPerSecondCubicMeter":{"unitSystem":"Metric","parentUnits":{"litersPerSecond":1,"cubicMeters":-1},"symbols":{"lPerSMSup3":{"text":"L/(s·m³)","placement":"Suffix","space":true}}},"litersPerSecondKilowatt":{"unitSystem":"Metric","parentUnits":{"litersPerSecond":1,"kilowatts":-1},"symbols":{"lPerSKw":{"text":"L/(s·kW)","placement":"Suffix","space":true}}},"litersPerSecondSquareMeter":{"defaultSymbol":"lPerSMSup2","unitSystem":"Metric","parentUnits":{"litersPerSecond":1,"squareMeters":-1},"symbols":{"lPerSMSup2":{"text":"L/(s·m²)","placement":"Suffix","space":true},"lpsPerMSup2":{"text":"LPS/m²","placement":"Suffix","space":true}}},"lumens":{"unitSystem":"Metric","parentUnits":{"candelas":1,"steradians":1},"symbols":{"lm":{"text":"lm","placement":"Suffix","space":true}}},"lumensPerWatt":{"unitSystem":"Metric","parentUnits":{"lumens":1,"watts":-1},"symbols":{"lmPerW":{"text":"lm/W","placement":"Suffix","space":true}}},"lux":{"unitSystem":"Metric","parentUnits":{"lumens":1,"squareMeters":-1},"symbols":{"lx":{"text":"lx","placement":"Suffix","space":true}}},"maxwells":{"unitSystem":"Metric","parentFactors":{"ten":-8},"parentUnits":{"webers":1},"symbols":{"mx":{"text":"Mx","placement":"Suffix","space":true}}},"megajoules":{"unitSystem":"Metric","parentFactors":{"mega":1},"parentUnits":{"joules":1}},"megajoulesPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"megajoules":1,"squareMeters":-1}},"meganewtonMeters":{"unitSystem":"Metric","parentUnits":{"meganewtons":1,"meters":1},"symbols":{"mNDashM":{"text":"MN-m","placement":"Suffix","space":true}}},"meganewtonMetersPerMeter":{"unitSystem":"Metric","parentUnits":{"meganewtonMeters":1,"meters":-1},"symbols":{"mNDashMPerM":{"text":"MN-m/m","placement":"Suffix","space":true}}},"meganewtons":{"unitSystem":"Metric","parentFactors":{"mega":1},"parentUnits":{"newtons":1},"symbols":{"mN":{"text":"MN","placement":"Suffix","space":true}}},"meganewtonsPerMeter":{"unitSystem":"Metric","parentUnits":{"meganewtons":1,"meters":-1},"symbols":{"mNPerM":{"text":"MN/m","placement":"Suffix","space":true}}},"meganewtonsPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"meganewtons":1,"squareMeters":-1},"symbols":{"mNPerMSup2":{"text":"MN/m²","placement":"Suffix","space":true}}},"megapascals":{"unitSystem":"Metric","parentFactors":{"mega":1},"parentUnits":{"pascals":1},"symbols":{"mPa":{"text":"MPa","placement":"Suffix","space":true}}},"megawattHours":{"unitSystem":"Metric","parentUnits":{"megawatts":1,"hours":1},"symbols":{"mWh":{"text":"mWh","placement":"Suffix","space":true}}},"megawatts":{"unitSystem":"Metric","parentFactors":{"mega":1},"parentUnits":{"watts":1}},"meters":{"defaultSymbol":"meter","unitSystem":"Metric","dimension":"length","symbols":{"meter":{"text":"m","placement":"Suffix","space":true},"metersAndCentimeters":{"inherits":"symbol"}}},"metersOfWaterColumn":{"unitSystem":"Metric","parentUnits":{"meters":1,"standardGravity":1,"waterDensity4DegreesCelsius":1},"symbols":{"mH2O":{"text":"mH2O","placement":"Suffix","space":true}}},"metersOfWaterColumnPerMeter":{"unitSystem":"Metric","parentUnits":{"metersOfWaterColumn":1,"meters":-1},"symbols":{"mH2OPerM":{"text":"mH2O/m","placement":"Suffix","space":true}}},"metersPerKilonewton":{"unitSystem":"Metric","parentUnits":{"meters":1,"kilonewtons":-1},"symbols":{"mPerKN":{"text":"m/kN","placement":"Suffix","space":true}}},"metersPerKilonewtonMeter":{"unitSystem":"Metric","parentUnits":{"meters":1,"kilonewtonMeters":-1},"symbols":{"mPerKNDashM":{"text":"m/kN-m","placement":"Suffix","space":true}}},"metersPerSecond":{"unitSystem":"Metric","parentUnits":{"meters":1,"seconds":-1},"symbols":{"mPerS":{"text":"m/s","placement":"Suffix","space":true}}},"metersPerSecondSquared":{"unitSystem":"Metric","parentUnits":{"metersPerSecond":1,"seconds":-1},"symbols":{"mPerSSup2":{"text":"m/s²","placement":"Suffix","space":true}}},"metersToTheFourthPower":{"unitSystem":"Metric","parentUnits":{"meters":4},"symbols":{"mSup4":{"text":"m⁴","placement":"Suffix","space":true}}},"metersToTheSixthPower":{"unitSystem":"Metric","parentUnits":{"meters":6},"symbols":{"mSup6":{"text":"m⁶","placement":"Suffix","space":true}}},"mhos":{"unitSystem":"Metric","parentUnits":{"ohms":-1},"symbols":{"mho":{"text":"mho","placement":"Suffix","space":true}}},"microinches":{"unitSystem":"Imperial","parentFactors":{"micro":1},"parentUnits":{"inches":1},"symbols":{"uin":{"text":"µin","placement":"Suffix","space":true}}},"microinchesPerInchDegreeFahrenheit":{"unitSystem":"Imperial","parentFactors":{"micro":1},"parentUnits":{"inverseDegreesFahrenheit":1},"symbols":{"uinPerInDegreeF":{"text":"µin/(in·°F)","placement":"Suffix","space":true}}},"micrometersPerMeterDegreeCelsius":{"unitSystem":"Metric","parentFactors":{"micro":1},"parentUnits":{"inverseDegreesCelsius":1},"symbols":{"umPerMDegreeC":{"text":"µm/(m·°C)","placement":"Suffix","space":true}}},"microns":{"unitSystem":"Metric","parentFactors":{"micro":1},"parentUnits":{"meters":1},"symbols":{"micron":{"text":"micron","placement":"Suffix","space":true}}},"miles":{"unitSystem":"Imperial","factor":1760,"parentUnits":{"yards":1},"symbols":{"mi":{"text":"mi","placement":"Suffix","space":true}}},"milesPerHour":{"unitSystem":"Imperial","parentUnits":{"miles":1,"hours":-1},"symbols":{"mph":{"text":"mph","placement":"Suffix","space":true}}},"milesPerSecond":{"unitSystem":"Imperial","parentUnits":{"miles":1,"seconds":-1},"symbols":{"miPerS":{"text":"mi/s","placement":"Suffix","space":true}}},"milesPerSecondSquared":{"unitSystem":"Imperial","parentUnits":{"milesPerSecond":1,"seconds":-1},"symbols":{"miPerSSup2":{"text":"mi/s²","placement":"Suffix","space":true}}},"milliamperes":{"unitSystem":"Metric","parentFactors":{"milli":1},"parentUnits":{"amperes":1},"symbols":{"mA":{"text":"mA","placement":"Suffix","space":true}}},"milligrams":{"unitSystem":"Metric","parentFactors":{"milli":1},"parentUnits":{"grams":1},"symbols":{"mg":{"text":"mg","placement":"Suffix","space":true}}},"millimeters":{"unitSystem":"Metric","parentFactors":{"milli":1},"parentUnits":{"meters":1},"symbols":{"mm":{"text":"mm","placement":"Suffix","space":true}}},"millimetersOfMercury":{"unitSystem":"Metric","factor":133.3224,"parentUnits":{"pascals":1},"symbols":{"mmHg":{"text":"mmHg","placement":"Suffix","space":true}}},"millimetersOfWaterColumn":{"unitSystem":"Metric","parentFactors":{"milli":1},"parentUnits":{"metersOfWaterColumn":1},"symbols":{"mmH2O":{"text":"mmH2O","placement":"Suffix","space":true}}},"millimetersOfWaterColumnPerMeter":{"unitSystem":"Metric","parentUnits":{"millimetersOfWaterColumn":1,"meters":-1},"symbols":{"mmH2OPerM":{"text":"mmH2O/m","placement":"Suffix","space":true}}},"millimetersToTheFourthPower":{"unitSystem":"Metric","parentUnits":{"millimeters":4},"symbols":{"mmSup4":{"text":"mm⁴","placement":"Suffix","space":true}}},"millimetersToTheSixthPower":{"unitSystem":"Metric","parentUnits":{"millimeters":6},"symbols":{"mmSup6":{"text":"mm⁶","placement":"Suffix","space":true}}},"milliseconds":{"unitSystem":"Metric","parentFactors":{"milli":1},"parentUnits":{"seconds":1},"symbols":{"ms":{"text":"ms","placement":"Suffix","space":true}}},"millivolts":{"unitSystem":"Metric","parentFactors":{"milli":1},"parentUnits":{"volts":1},"symbols":{"mV":{"text":"mV","placement":"Suffix","space":true}}},"mils":{"unitSystem":"Imperial","parentFactors":{"milli":1},"parentUnits":{"inches":1},"symbols":{"mil":{"text":"mil","placement":"Suffix","space":true}}},"minutes":{"unitSystem":"Metric","factor":60,"parentUnits":{"seconds":1},"symbols":{"min":{"text":"min","placement":"Suffix","space":true}}},"nanograms":{"unitSystem":"Metric","parentFactors":{"nano":1},"parentUnits":{"grams":1},"symbols":{"ng":{"text":"ng","placement":"Suffix","space":true}}},"nanogramsPerPascalSecondSquareMeter":{"unitSystem":"Metric","parentUnits":{"nanograms":1,"seconds":-1,"squareMeters":-1,"pascals":-1},"symbols":{"ngPerPaSMSup2":{"text":"ng/(Pa·s·m²)","placement":"Suffix","space":true}}},"nanometers":{"unitSystem":"Metric","parentFactors":{"nano":1},"parentUnits":{"meters":1},"symbols":{"nm":{"text":"nm","placement":"Suffix","space":true}}},"nauticalMiles":{"unitSystem":"Imperial","factor":1852,"parentUnits":{"meters":1},"symbols":{"nauticalMile":{"text":"M","placement":"Suffix","space":true}}},"newtonMeters":{"unitSystem":"Metric","parentUnits":{"newtons":1,"meters":1},"symbols":{"nDashM":{"text":"N-m","placement":"Suffix","space":true}}},"newtonMetersPerMeter":{"unitSystem":"Metric","parentUnits":{"newtonMeters":1,"meters":-1},"symbols":{"nDashMPerM":{"text":"N-m/m","placement":"Suffix","space":true}}},"newtonSecondsPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"newtons":1,"seconds":1,"squareMeters":-1},"symbols":{"nSPerMSup2":{"text":"N·s/m²","placement":"Suffix","space":true}}},"newtons":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"metersPerSecondSquared":1},"symbols":{"newton":{"text":"N","placement":"Suffix","space":true}}},"newtonsPerMeter":{"unitSystem":"Metric","parentUnits":{"newtons":1,"meters":-1},"symbols":{"nPerM":{"text":"N/m","placement":"Suffix","space":true}}},"newtonsPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"newtons":1,"squareMeters":-1},"symbols":{"nPerMSup2":{"text":"N/m²","placement":"Suffix","space":true}}},"newtonsPerSquareMillimeter":{"unitSystem":"Metric","parentUnits":{"newtons":1,"squareMillimeters":-1},"symbols":{"nPerMmSup2":{"text":"N/mm²","placement":"Suffix","space":true}}},"oersteds":{"unitSystem":"Metric","factor":250,"parentFactors":{"pi":-1},"parentUnits":{"amperes":1,"meters":-1},"symbols":{"oe":{"text":"Oe","placement":"Suffix","space":true}}},"ohmMeters":{"unitSystem":"Metric","parentUnits":{"ohms":1,"meters":1},"symbols":{"ohmM":{"text":"ohm·m","placement":"Suffix","space":true}}},"ohms":{"defaultSymbol":"omega","unitSystem":"Metric","parentUnits":{"volts":1,"amperes":-1},"symbols":{"ohm":{"text":"ohm","placement":"Suffix","space":true},"omega":{"text":"Ω","placement":"Suffix","space":true}}},"ouncesForce":{"unitSystem":"Imperial","factor":0.0625,"parentUnits":{"poundsForce":1},"symbols":{"ozf":{"text":"ozf","placement":"Suffix","space":true}}},"ouncesMass":{"unitSystem":"Imperial","factor":0.0625,"parentUnits":{"poundsMass":1},"symbols":{"oz":{"text":"oz","placement":"Suffix","space":true}}},"pascalSeconds":{"unitSystem":"Metric","parentUnits":{"pascals":1,"seconds":1},"symbols":{"paDashS":{"text":"Pa-s","placement":"Suffix","space":true}}},"pascals":{"unitSystem":"Metric","parentUnits":{"newtonsPerSquareMeter":1},"symbols":{"pa":{"text":"Pa","placement":"Suffix","space":true}}},"pascalsPerMeter":{"unitSystem":"Metric","parentUnits":{"pascals":1,"meters":-1},"symbols":{"paPerM":{"text":"Pa/m","placement":"Suffix","space":true}}},"perMille":{"unitSystem":"Metric","parentFactors":{"milli":1},"parentUnits":{"ratioTo1":1},"symbols":{"perMille":{"text":"‰","placement":"Suffix","space":false}}},"percentage":{"unitSystem":"Metric","parentFactors":{"centi":1},"parentUnits":{"ratioTo1":1},"symbols":{"percent":{"text":"%","placement":"Suffix","space":false}}},"pi":{"unitSystem":"Imperial","parentFactors":{"pi":1},"parentUnits":{"radians":1},"symbols":{"pi":{"text":"π","placement":"Suffix","space":true}}},"poises":{"unitSystem":"Metric","parentUnits":{"grams":1,"centimeters":-1,"seconds":-1},"symbols":{"poise":{"text":"P","placement":"Suffix","space":true}}},"poundForceFeet":{"defaultSymbol":"lbForceDashFt","unitSystem":"Imperial","parentUnits":{"poundsForce":1,"feet":1},"symbols":{"lbForceDashFt":{"text":"lb-ft","placement":"Suffix","space":true},"lbfDashFt":{"text":"lbf-ft","placement":"Suffix","space":true}}},"poundForceFeetPerFoot":{"defaultSymbol":"lbForceDashFtPerFt","unitSystem":"Imperial","parentUnits":{"poundForceFeet":1,"feet":-1},"symbols":{"lbForceDashFtPerFt":{"text":"lb-ft/ft","placement":"Suffix","space":true},"lbfDashFtPerFt":{"text":"lbf-ft/ft","placement":"Suffix","space":true}}},"poundForceSecondsPerSquareFoot":{"unitSystem":"Imperial","parentUnits":{"poundsForce":1,"seconds":1,"squareFeet":-1},"symbols":{"lbForceSPerFtSup2":{"text":"lb·s/ft²","placement":"Suffix","space":true}}},"poundMassDegreesFahrenheit":{"unitSystem":"Imperial","parentUnits":{"poundsMass":1,"fahrenheitInterval":1},"symbols":{"lbMassDegreeF":{"text":"lb·°F","placement":"Suffix","space":true}}},"poundsForce":{"defaultSymbol":"lbForce","unitSystem":"Imperial","parentUnits":{"poundsMass":1,"standardGravity":1},"symbols":{"lbForce":{"text":"lb","placement":"Suffix","space":true},"lbf":{"text":"lbf","placement":"Suffix","space":true}}},"poundsForcePerCubicFoot":{"defaultSymbol":"lbForcePerFtSup3","unitSystem":"Imperial","parentUnits":{"poundsForce":1,"cubicFeet":-1},"symbols":{"lbForcePerFtSup3":{"text":"lb/ft³","placement":"Suffix","space":true},"lbfPerFtSup3":{"text":"lbf/ft³","placement":"Suffix","space":true}}},"poundsForcePerFoot":{"defaultSymbol":"lbForcePerFt","unitSystem":"Imperial","parentUnits":{"poundsForce":1,"feet":-1},"symbols":{"lbForcePerFt":{"text":"lb/ft","placement":"Suffix","space":true},"lbfPerFt":{"text":"lbf/ft","placement":"Suffix","space":true}}},"poundsForcePerSquareFoot":{"defaultSymbol":"lbForcePerFtSup2","unitSystem":"Imperial","parentUnits":{"poundsForce":1,"squareFeet":-1},"symbols":{"lbForcePerFtSup2":{"text":"lb/ft²","placement":"Suffix","space":true},"lbfPerFtSup2":{"text":"lbf/ft²","placement":"Suffix","space":true},"psf":{"text":"psf","placement":"Suffix","space":true}}},"poundsForcePerSquareInch":{"defaultSymbol":"lbForcePerInSup2","unitSystem":"Imperial","parentUnits":{"poundsForce":1,"squareInches":-1},"symbols":{"lbForcePerInSup2":{"text":"lb/in²","placement":"Suffix","space":true},"lbfPerInSup2":{"text":"lbf/in²","placement":"Suffix","space":true},"psi":{"text":"psi","placement":"Suffix","space":true},"psia":{"text":"psia","placement":"Suffix","space":true},"psig":{"text":"psig","placement":"Suffix","space":true}}},"poundsMass":{"defaultSymbol":"lbMass","unitSystem":"Imperial","factor":0.45359237,"parentUnits":{"kilograms":1},"symbols":{"lbMass":{"text":"lb","placement":"Suffix","space":true},"lbm":{"text":"lbm","placement":"Suffix","space":true}}},"poundsMassPerCubicFoot":{"defaultSymbol":"lbMassPerFtSup3","unitSystem":"Imperial","parentUnits":{"poundsMass":1,"cubicFeet":-1},"symbols":{"lbMassPerFtSup3":{"text":"lb/ft³","placement":"Suffix","space":true},"lbmPerFtSup3":{"text":"lbm/ft³","placement":"Suffix","space":true}}},"poundsMassPerCubicInch":{"defaultSymbol":"lbMassPerInSup3","unitSystem":"Imperial","parentUnits":{"poundsMass":1,"cubicInches":-1},"symbols":{"lbMassPerInSup3":{"text":"lb/in³","placement":"Suffix","space":true},"lbmPerInSup3":{"text":"lbm/in³","placement":"Suffix","space":true}}},"poundsMassPerFoot":{"defaultSymbol":"lbMassPerFt","unitSystem":"Imperial","parentUnits":{"poundsMass":1,"feet":-1},"symbols":{"lbMassPerFt":{"text":"lb/ft","placement":"Suffix","space":true},"lbmPerFt":{"text":"lbm/ft","placement":"Suffix","space":true}}},"poundsMassPerFootHour":{"defaultSymbol":"lbMassPerFtDashH","unitSystem":"Imperial","parentUnits":{"poundsMassPerFoot":1,"hours":-1},"symbols":{"lbMassPerFtDashH":{"text":"lb/ft-h","placement":"Suffix","space":true},"lbmPerFtDashH":{"text":"lbm/ft-h","placement":"Suffix","space":true}}},"poundsMassPerFootSecond":{"defaultSymbol":"lbMassPerFtDashS","unitSystem":"Imperial","parentUnits":{"poundsMassPerFoot":1,"seconds":-1},"symbols":{"lbMassPerFtDashS":{"text":"lb/ft-s","placement":"Suffix","space":true},"lbmPerFtDashS":{"text":"lbm/ft-s","placement":"Suffix","space":true}}},"poundsMassPerHour":{"unitSystem":"Imperial","parentUnits":{"poundsMass":1,"hours":-1},"symbols":{"lbMassPerH":{"text":"lb/h","placement":"Suffix","space":true}}},"poundsMassPerMinute":{"unitSystem":"Imperial","parentUnits":{"poundsMass":1,"minutes":-1},"symbols":{"lbMassPerMin":{"text":"lb/min","placement":"Suffix","space":true}}},"poundsMassPerPoundDegreeFahrenheit":{"unitSystem":"Imperial","parentUnits":{"poundsMass":1,"poundMassDegreesFahrenheit":-1},"symbols":{"lbMassPerLbDegreeF":{"text":"lb/(lb·°F)","placement":"Suffix","space":true}}},"poundsMassPerSecond":{"unitSystem":"Imperial","parentUnits":{"poundsMass":1,"seconds":-1},"symbols":{"lbMassPerS":{"text":"lb/s","placement":"Suffix","space":true}}},"poundsMassPerSquareFoot":{"unitSystem":"Imperial","parentUnits":{"poundsMass":1,"squareFeet":-1},"symbols":{"lbMassPerFtSup2":{"text":"lb/ft²","placement":"Suffix","space":true}}},"radians":{"unitSystem":"Metric","symbols":{"rad":{"text":"rad","placement":"Suffix","space":true}}},"radiansPerSecond":{"unitSystem":"Metric","parentUnits":{"radians":1,"seconds":-1},"symbols":{"radPerS":{"text":"rad/s","placement":"Suffix","space":true}}},"rankine":{"unitSystem":"Imperial","parentUnit":"rankineInterval","symbols":{"degreeR":{"text":"°R","placement":"Suffix","space":true}}},"rankineInterval":{"defaultSymbol":"degreeRInterval","unitSystem":"Imperial","parentFactors":{"nineFifths":-1},"parentUnits":{"kelvinInterval":1},"symbols":{"degreeRInterval":{"text":"°R","placement":"Suffix","space":true},"deltaDegreeR":{"text":"delta°R","placement":"Suffix","space":true}}},"ratioTo1":{"unitSystem":"Metric","symbols":{"colon1":{"text":":1","placement":"Suffix","space":false}}},"ratioTo10":{"unitSystem":"Metric","parentFactors":{"ten":-1},"parentUnits":{"ratioTo1":1},"symbols":{"colon10":{"text":":10","placement":"Suffix","space":false}}},"ratioTo12":{"unitSystem":"Imperial","parentFactors":{"twelve":-1},"parentUnits":{"ratioTo1":1},"symbols":{"colon12":{"text":":12","placement":"Suffix","space":false}}},"revolutionsPerMinute":{"unitSystem":"Imperial","parentUnits":{"turns":1,"minutes":-1},"symbols":{"rpm":{"text":"RPM","placement":"Suffix","space":true}}},"revolutionsPerSecond":{"unitSystem":"Metric","parentUnits":{"turns":1,"seconds":-1},"symbols":{"rps":{"text":"RPS","placement":"Suffix","space":true}}},"riseDividedBy1000Millimeters":{"unitSystem":"Metric","parentUnits":{"perMille":1}},"riseDividedBy10Feet":{"unitSystem":"Imperial","parentUnits":{"ratioTo10":1}},"riseDividedBy120Inches":{"unitSystem":"Imperial","parentFactors":{"ten":-1},"parentUnits":{"riseDividedBy12Inches":1}},"riseDividedBy12Inches":{"unitSystem":"Imperial","parentUnits":{"ratioTo12":1}},"riseDividedBy1Foot":{"unitSystem":"Imperial","parentUnits":{"ratioTo1":1}},"seconds":{"unitSystem":"Metric","dimension":"time","symbols":{"second":{"text":"s","placement":"Suffix","space":true}}},"siemens":{"unitSystem":"Metric","parentUnits":{"mhos":1},"symbols":{"siemens":{"text":"S","placement":"Suffix","space":true}}},"slugs":{"unitSystem":"Imperial","parentUnits":{"poundsForce":1,"seconds":2,"feet":-1},"symbols":{"slug":{"text":"slug","placement":"Suffix","space":true}}},"squareCentimeters":{"defaultSymbol":"cmSup2","unitSystem":"Metric","parentUnits":{"centimeters":2},"symbols":{"cmCaret2":{"text":"cm^2","placement":"Suffix","space":true},"cmSup2":{"text":"cm²","placement":"Suffix","space":true}}},"squareCentimetersPerMeter":{"unitSystem":"Metric","parentUnits":{"squareCentimeters":1,"meters":-1},"symbols":{"cmSup2PerM":{"text":"cm²/m","placement":"Suffix","space":true}}},"squareFeet":{"defaultSymbol":"ftSup2","unitSystem":"Imperial","parentUnits":{"feet":2},"symbols":{"ftCaret2":{"text":"ft^2","placement":"Suffix","space":true},"ftSup2":{"text":"ft²","placement":"Suffix","space":true},"sf":{"text":"SF","placement":"Suffix","space":true}}},"squareFeetPer1000BritishThermalUnitsPerHour":{"defaultSymbol":"ftSup2HPerKbtu","unitSystem":"Imperial","factor":0.001,"parentUnits":{"squareFeet":1,"britishThermalUnitsPerHour":-1},"symbols":{"ftSup2HPerKbtu":{"text":"ft²·h/kBtu","placement":"Suffix","space":true},"ftSup2PerMbh":{"text":"ft²/MBh","placement":"Suffix","space":true},"sfHPerKbtu":{"text":"SF·h/kBtu","placement":"Suffix","space":true},"sfPerMbh":{"text":"SF/MBh","placement":"Suffix","space":true}}},"squareFeetPerFoot":{"unitSystem":"Imperial","parentUnits":{"squareFeet":1,"feet":-1},"symbols":{"ftSup2PerFt":{"text":"ft²/ft","placement":"Suffix","space":true}}},"squareFeetPerKip":{"unitSystem":"Imperial","parentUnits":{"squareFeet":1,"kips":-1},"symbols":{"ftSup2PerKip":{"text":"ft²/kip","placement":"Suffix","space":true}}},"squareFeetPerKipFoot":{"unitSystem":"Imperial","parentUnits":{"squareFeet":1,"kipFeet":-1},"symbols":{"ftSup2PerKipDashFt":{"text":"ft²/kip-ft","placement":"Suffix","space":true}}},"squareFeetPerSecond":{"unitSystem":"Imperial","parentUnits":{"squareFeet":1,"seconds":-1},"symbols":{"ftSup2PerS":{"text":"ft²/s","placement":"Suffix","space":true}}},"squareFeetPerTonOfRefrigeration":{"defaultSymbol":"ftSup2PerTon","unitSystem":"Imperial","parentUnits":{"squareFeet":1,"tonsOfRefrigeration":-1},"symbols":{"ftSup2PerTon":{"text":"ft²/ton","placement":"Suffix","space":true},"sfPerTon":{"text":"SF/ton","placement":"Suffix","space":true}}},"squareHectometers":{"unitSystem":"Metric","parentUnits":{"hectometers":2},"symbols":{"hmSup2":{"text":"hm²","placement":"Suffix","space":true}}},"squareInches":{"defaultSymbol":"inSup2","unitSystem":"Imperial","parentUnits":{"inches":2},"symbols":{"inCaret2":{"text":"in^2","placement":"Suffix","space":true},"inSup2":{"text":"in²","placement":"Suffix","space":true}}},"squareInchesPerFoot":{"unitSystem":"Imperial","parentUnits":{"squareInches":1,"feet":-1},"symbols":{"inSup2PerFt":{"text":"in²/ft","placement":"Suffix","space":true}}},"squareMeterKelvinsPerWatt":{"unitSystem":"Metric","parentUnits":{"squareMeters":1,"kelvinInterval":1,"watts":-1},"symbols":{"mSup2KPerW":{"text":"(m²·K)/W","placement":"Suffix","space":true}}},"squareMeters":{"defaultSymbol":"mSup2","unitSystem":"Metric","parentUnits":{"meters":2},"symbols":{"mCaret2":{"text":"m^2","placement":"Suffix","space":true},"mSup2":{"text":"m²","placement":"Suffix","space":true}}},"squareMetersPerKilonewton":{"unitSystem":"Metric","parentUnits":{"squareMeters":1,"kilonewtons":-1},"symbols":{"mSup2PerKN":{"text":"m²/kN","placement":"Suffix","space":true}}},"squareMetersPerKilonewtonMeter":{"unitSystem":"Metric","parentUnits":{"squareMeters":1,"kilonewtonMeters":-1},"symbols":{"mSup2PerKNDashM":{"text":"m²/kN-m","placement":"Suffix","space":true}}},"squareMetersPerKilowatt":{"unitSystem":"Metric","parentUnits":{"squareMeters":1,"kilowatts":-1},"symbols":{"mSup2PerKw":{"text":"m²/kW","placement":"Suffix","space":true}}},"squareMetersPerMeter":{"unitSystem":"Metric","parentUnits":{"squareMeters":1,"meters":-1},"symbols":{"mSup2PerM":{"text":"m²/m","placement":"Suffix","space":true}}},"squareMetersPerSecond":{"unitSystem":"Metric","parentUnits":{"squareMeters":1,"seconds":-1},"symbols":{"mSup2PerS":{"text":"m²/s","placement":"Suffix","space":true}}},"squareMillimeters":{"defaultSymbol":"mmSup2","unitSystem":"Metric","parentUnits":{"millimeters":2},"symbols":{"mmCaret2":{"text":"mm^2","placement":"Suffix","space":true},"mmSup2":{"text":"mm²","placement":"Suffix","space":true}}},"squareMillimetersPerMeter":{"unitSystem":"Metric","parentUnits":{"squareMillimeters":1,"meters":-1},"symbols":{"mmSup2PerM":{"text":"mm²/m","placement":"Suffix","space":true}}},"squareMils":{"defaultSymbol":"milSup2","unitSystem":"Imperial","parentUnits":{"mils":2},"symbols":{"milCaret2":{"text":"mil^2","placement":"Suffix","space":true},"milSup2":{"text":"mil²","placement":"Suffix","space":true}}},"squareYards":{"unitSystem":"Imperial","parentUnits":{"yards":2},"symbols":{"ydSup2":{"text":"yd²","placement":"Suffix","space":true}}},"standardGravity":{"unitSystem":"Metric","factor":9.80665,"parentUnits":{"metersPerSecondSquared":1},"symbols":{"gravity":{"text":"𝘨","placement":"Suffix","space":true}}},"steradians":{"unitSystem":"Metric","symbols":{"sr":{"text":"sr","placement":"Suffix","space":true}}},"teslas":{"unitSystem":"Metric","parentUnits":{"webers":1,"meters":-2},"symbols":{"tesla":{"text":"T","placement":"Suffix","space":true}}},"therms":{"unitSystem":"Imperial","factor":100000,"parentUnits":{"britishThermalUnits":1},"symbols":{"therm":{"text":"therm","placement":"Suffix","space":true}}},"thousandBritishThermalUnits":{"unitSystem":"Imperial","parentFactors":{"kilo":1},"parentUnits":{"britishThermalUnits":1},"symbols":{"kBtu":{"text":"kBtu","placement":"Suffix","space":true}}},"thousandBritishThermalUnitsPerHour":{"unitSystem":"Imperial","factor":1000,"parentUnits":{"britishThermalUnitsPerHour":1},"symbols":{"mbh":{"text":"MBH","placement":"Suffix","space":true}}},"thousandBritishThermalUnitsPerSquareFoot":{"unitSystem":"Imperial","parentUnits":{"thousandBritishThermalUnits":1,"squareFeet":-1},"symbols":{"kBtuPerFtSup2":{"text":"kBtu/ft²","placement":"Suffix","space":true}}},"tonneForceMeters":{"unitSystem":"Metric","parentUnits":{"tonnesForce":1,"meters":1},"symbols":{"tfDashM":{"text":"Tf-m","placement":"Suffix","space":true}}},"tonneForceMetersPerMeter":{"unitSystem":"Metric","parentUnits":{"tonneForceMeters":1,"meters":-1},"symbols":{"tfDashMPerM":{"text":"Tf-m/m","placement":"Suffix","space":true}}},"tonnes":{"unitSystem":"Metric","factor":1000,"parentUnits":{"kilograms":1},"symbols":{"tonne":{"text":"t","placement":"Suffix","space":true}}},"tonnesForce":{"unitSystem":"Metric","parentUnits":{"tonnes":1,"standardGravity":1},"symbols":{"tf":{"text":"Tf","placement":"Suffix","space":true}}},"tonnesForcePerMeter":{"unitSystem":"Metric","parentUnits":{"tonnesForce":1,"meters":-1},"symbols":{"tfPerM":{"text":"Tf/m","placement":"Suffix","space":true}}},"tonnesForcePerSquareMeter":{"unitSystem":"Metric","parentUnits":{"tonnesForce":1,"squareMeters":-1},"symbols":{"tfPerMSup2":{"text":"Tf/m²","placement":"Suffix","space":true}}},"tonsOfRefrigeration":{"defaultSymbol":"ton","unitSystem":"Imperial","factor":12000,"parentUnits":{"britishThermalUnitsPerHour":1},"symbols":{"ton":{"text":"ton","placement":"Suffix","space":true},"tonOfRefrigeration":{"text":"ton of refrigeration","placement":"Suffix","space":true}}},"turns":{"unitSystem":"Metric","factor":2,"parentFactors":{"pi":1},"parentUnits":{"radians":1},"symbols":{"tr":{"text":"tr","placement":"Suffix","space":true}}},"usGallons":{"unitSystem":"Imperial","factor":231,"parentUnits":{"cubicInches":1},"symbols":{"gal":{"text":"gal","placement":"Suffix","space":true}}},"usGallonsPerHour":{"defaultSymbol":"galPerH","unitSystem":"Imperial","parentUnits":{"usGallons":1,"hours":-1},"symbols":{"galPerH":{"text":"gal/h","placement":"Suffix","space":true},"gph":{"text":"GPH","placement":"Suffix","space":true},"usgph":{"text":"usgph","placement":"Suffix","space":true}}},"usGallonsPerMinute":{"defaultSymbol":"galPerMin","unitSystem":"Imperial","parentUnits":{"usGallons":1,"minutes":-1},"symbols":{"galPerMin":{"text":"gal/min","placement":"Suffix","space":true},"gpm":{"text":"GPM","placement":"Suffix","space":true},"usgpm":{"text":"usgpm","placement":"Suffix","space":true}}},"usSurveyFeet":{"unitSystem":"Imperial","factor":1200,"parentFactors":{"threeThousandNineHundredThirtySeven":-1},"parentUnits":{"meters":1},"symbols":{"usft":{"text":"USft","placement":"Suffix","space":true}}},"usTonnesForce":{"defaultSymbol":"stf","unitSystem":"Imperial","parentUnits":{"usTonnesMass":1,"standardGravity":1},"symbols":{"stf":{"text":"STf","placement":"Suffix","space":true},"tonsf":{"text":"Tonsf","placement":"Suffix","space":true},"usTonnesForceSt":{"text":"ST","placement":"Suffix","space":true},"usTonnesForceT":{"text":"T","placement":"Suffix","space":true},"usTonnesForceTons":{"text":"Tons","placement":"Suffix","space":true}}},"usTonnesMass":{"defaultSymbol":"usTonnesMassSt","unitSystem":"Imperial","factor":2000,"parentUnits":{"poundsMass":1},"symbols":{"usTonnesMassSt":{"text":"ST","placement":"Suffix","space":true},"usTonnesMassT":{"text":"T","placement":"Suffix","space":true},"usTonnesMassTons":{"text":"Tons","placement":"Suffix","space":true}}},"voltAmperes":{"unitSystem":"Metric","parentUnits":{"volts":1,"amperes":1},"symbols":{"vA":{"text":"VA","placement":"Suffix","space":true}}},"voltAmperesPerSquareFoot":{"unitSystem":"Imperial","parentUnits":{"voltAmperes":1,"squareFeet":-1},"symbols":{"vAPerFtSup2":{"text":"VA/ft²","placement":"Suffix","space":true}}},"voltAmperesPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"voltAmperes":1,"squareMeters":-1},"symbols":{"vAPerMSup2":{"text":"VA/m²","placement":"Suffix","space":true}}},"volts":{"unitSystem":"Metric","parentUnits":{"watts":1,"amperes":-1},"symbols":{"volt":{"text":"V","placement":"Suffix","space":true}}},"waterDensity4DegreesCelsius":{"unitSystem":"Metric","parentUnits":{"kilograms":1,"liters":-1}},"watts":{"unitSystem":"Metric","parentUnits":{"joules":1,"seconds":-1},"symbols":{"watt":{"text":"W","placement":"Suffix","space":true}}},"wattsPerCubicFoot":{"unitSystem":"Imperial","parentUnits":{"watts":1,"cubicFeet":-1},"symbols":{"wPerFtSup3":{"text":"W/ft³","placement":"Suffix","space":true}}},"wattsPerCubicFootPerMinute":{"unitSystem":"Imperial","parentUnits":{"watts":1,"cubicFeetPerMinute":-1},"symbols":{"wMinPerFtSup3":{"text":"W·min/ft³","placement":"Suffix","space":true}}},"wattsPerCubicMeter":{"unitSystem":"Metric","parentUnits":{"watts":1,"cubicMeters":-1},"symbols":{"wPerMSup3":{"text":"W/m³","placement":"Suffix","space":true}}},"wattsPerCubicMeterPerSecond":{"unitSystem":"Metric","parentUnits":{"watts":1,"cubicMetersPerSecond":-1},"symbols":{"wSPerMSup3":{"text":"W·s/m³","placement":"Suffix","space":true}}},"wattsPerFoot":{"unitSystem":"Imperial","parentUnits":{"watts":1,"feet":-1},"symbols":{"wPerFt":{"text":"W/ft","placement":"Suffix","space":true}}},"wattsPerMeter":{"unitSystem":"Metric","parentUnits":{"watts":1,"meters":-1},"symbols":{"wPerM":{"text":"W/m","placement":"Suffix","space":true}}},"wattsPerMeterKelvin":{"unitSystem":"Metric","parentUnits":{"watts":1,"meters":-1,"kelvinInterval":-1},"symbols":{"wPerMK":{"text":"W/(m·K)","placement":"Suffix","space":true}}},"wattsPerSquareFoot":{"unitSystem":"Imperial","parentUnits":{"watts":1,"squareFeet":-1},"symbols":{"wPerFtSup2":{"text":"W/ft²","placement":"Suffix","space":true}}},"wattsPerSquareMeter":{"unitSystem":"Metric","parentUnits":{"watts":1,"squareMeters":-1},"symbols":{"wPerMSup2":{"text":"W/m²","placement":"Suffix","space":true}}},"wattsPerSquareMeterKelvin":{"unitSystem":"Metric","parentUnits":{"wattsPerSquareMeter":1,"kelvinInterval":-1},"symbols":{"wPerMSup2K":{"text":"W/(m²·K)","placement":"Suffix","space":true}}},"webers":{"unitSystem":"Metric","parentUnits":{"volts":1,"seconds":1},"symbols":{"wb":{"text":"Wb","placement":"Suffix","space":true}}},"yards":{"unitSystem":"Imperial","factor":3,"parentUnits":{"feet":1},"symbols":{"yd":{"text":"yd","placement":"Suffix","space":true}}},"feetFractionalInches":{"defaultSymbol":"feetAndInches","unitSystem":"Imperial","factor":12,"parentUnits":{"inches":1},"symbols":{"feetAndInches":{"inherits":"symbol"},"footSingleQuote":{"text":"\'","placement":"Suffix","space":false},"ft":{"text":"ft","placement":"Suffix","space":true},"lf":{"text":"LF","placement":"Suffix","space":true}}},"fractionalInches":{"defaultSymbol":"in","unitSystem":"Imperial","factor":2.54,"parentUnits":{"centimeters":1},"symbols":{"in":{"text":"in","placement":"Suffix","space":true},"inchDoubleQuote":{"text":"\\"","placement":"Suffix","space":false}}},"metersCentimeters":{"defaultSymbol":"meter","unitSystem":"Metric","dimension":"length","symbols":{"meter":{"text":"m","placement":"Suffix","space":true},"metersAndCentimeters":{"inherits":"symbol"}}},"degreesMinutes":{"defaultSymbol":"degree","unitSystem":"Metric","parentFactors":{"threeHundredSixty":-1},"parentUnits":{"turns":1},"symbols":{"degree":{"text":"°","placement":"Suffix","space":false},"degreesMinutesSeconds":{"inherits":"symbol"}}},"slopeDegrees":{"defaultSymbol":"slopeDegree","unitSystem":"Metric","parentFactors":{"threeHundredSixty":-1},"parentUnits":{"turns":1},"symbols":{"slopeDegree":{"text":"°","placement":"Suffix","space":false}}},"stationingFeet":{"defaultSymbol":"feetAndInches","unitSystem":"Imperial","factor":12,"parentUnits":{"inches":1},"symbols":{"feetAndInches":{"inherits":"symbol"},"footSingleQuote":{"text":"\'","placement":"Suffix","space":false},"ft":{"text":"ft","placement":"Suffix","space":true},"lf":{"text":"LF","placement":"Suffix","space":true}}},"stationingMeters":{"defaultSymbol":"meter","unitSystem":"Metric","dimension":"length","symbols":{"meter":{"text":"m","placement":"Suffix","space":true},"metersAndCentimeters":{"inherits":"symbol"}}},"stationingSurveyFeet":{"unitSystem":"Imperial","factor":1200,"parentFactors":{"threeThousandNineHundredThirtySeven":-1},"parentUnits":{"meters":1},"symbols":{"usft":{"text":"USft","placement":"Suffix","space":true}}},"dateTime":{"symbols":{"date":{"text":"Date"},"dateTime":{"text":"ISODate","description":"default"},"dateAndTime":{"text":"Date, Time"}}}},"quantity":{"acceleration":{"units":["metersPerSecondSquared","kilometersPerSecondSquared","inchesPerSecondSquared","feetPerSecondSquared","milesPerSecondSquared","standardGravity"]},"angle":{"units":["degrees","radians","gradians","turns"]},"angularLineSpringCoefficient":{"units":["kipFeetPerDegreePerFoot","kilonewtonMetersPerDegreePerMeter"]},"angularPointSpringCoefficient":{"units":["kipFeetPerDegree","kilonewtonMetersPerDegree"]},"angularSpeed":{"units":["radiansPerSecond","revolutionsPerMinute"]},"area":{"units":["squareFeet","squareInches","squareMeters","squareCentimeters","squareHectometers","squareMillimeters","acres","hectares","squareYards","circularMils","squareMils"]},"areaPerLength":{"units":["squareFeetPerFoot","squareCentimetersPerMeter","squareMillimetersPerMeter","squareInchesPerFoot","squareMetersPerMeter"]},"areaPerPower":{"units":["squareFeetPerTonOfRefrigeration","squareMetersPerKilowatt","squareFeetPer1000BritishThermalUnitsPerHour"]},"areaPerTorque":{"units":["squareFeetPerKipFoot","squareMetersPerKilonewtonMeter"]},"colorTemperature":{"units":["kelvin"]},"costPerArea":{"units":["currencyPerSquareFoot","currencyPerSquareMeter"]},"currency":{"units":["currency"]},"density":{"units":["kilogramsPerCubicMeter","poundsMassPerCubicInch","poundsMassPerCubicFoot"]},"diffusivity":{"units":["squareFeetPerSecond","squareMetersPerSecond"]},"dynamicViscosity":{"units":["centipoises","kilogramsPerMeterHour","kilogramsPerMeterSecond","newtonSecondsPerSquareMeter","pascalSeconds","poises","poundForceSecondsPerSquareFoot","poundsMassPerFootHour","poundsMassPerFootSecond"]},"electricCapacitance":{"units":["farads"]},"electricCharge":{"units":["coulombs","ampereHours","ampereSeconds"]},"electricConductance":{"units":["mhos","siemens"]},"electricCurrent":{"units":["amperes","kiloamperes","milliamperes"]},"electricInductance":{"units":["henries"]},"electricPotential":{"units":["volts","kilovolts","millivolts"]},"electricResistance":{"units":["ohms"]},"electricResistivity":{"units":["ohmMeters"]},"energy":{"units":["joules","newtonMeters","kilogramForceMeters","poundForceFeet","kilojoules","britishThermalUnits","calories","kilocalories","kilowattHours","therms","ergs"]},"flow":{"units":["cubicFeetPerMinute","cubicFeetPerHour","cubicMetersPerSecond","cubicMetersPerHour","litersPerHour","litersPerMinute","litersPerSecond","usGallonsPerMinute","usGallonsPerHour"]},"flowPerArea":{"units":["cubicFeetPerMinuteSquareFoot","litersPerSecondSquareMeter"]},"flowPerPower":{"units":["cubicFeetPerMinutePerBritishThermalUnitPerHour","cubicFeetPerMinuteTonOfRefrigeration","cubicMetersPerWattSecond","litersPerSecondKilowatt","squareFeetPerKip","squareMetersPerKilonewton"]},"flowPerVolume":{"units":["cubicFeetPerMinuteCubicFoot","litersPerSecondCubicMeter"]},"force":{"units":["newtons","dekanewtons","kilonewtons","meganewtons","kips","kilogramsForce","tonnesForce","usTonnesForce","poundsForce","dynes","ouncesForce"]},"forceDensity":{"units":["kilonewtonsPerCubicMeter","poundsForcePerCubicFoot","kipsPerCubicInch","kipsPerCubicFoot"]},"forcePerLength":{"units":["newtonsPerMeter","dekanewtonsPerMeter","kilonewtonsPerMeter","meganewtonsPerMeter","kipsPerFoot","kilogramsForcePerMeter","tonnesForcePerMeter","poundsForcePerFoot","kipsPerInch"]},"frequency":{"units":["hertz","cyclesPerSecond"]},"friction":{"units":["pascalsPerMeter","feetOfWater39.2DegreesFahrenheitPer100Feet","inchesOfWater60DegreesFahrenheitPer100Feet"]},"heatCapacity":{"units":["britishThermalUnitsPerDegreeFahrenheit","joulesPerKelvin","kilojoulesPerKelvin"]},"heatTransferCoefficient":{"units":["wattsPerSquareMeterKelvin","britishThermalUnitsPerHourSquareFootDegreeFahrenheit"]},"illuminance":{"units":["lux","footcandles"]},"length":{"units":["centimeters","decimeters","feet","hectometers","inches","kilometers","meters","microinches","microns","miles","millimeters","mils","nanometers","nauticalMiles","usSurveyFeet","yards"]},"lengthPerTorque":{"units":["metersPerKilonewtonMeter","feetPerKipFoot"]},"lightingEfficacy":{"units":["lumensPerWatt"]},"luminance":{"units":["footlamberts","candelasPerSquareFoot","candelasPerSquareMeter"]},"luminousFlux":{"units":["lumens"]},"luminousIntensity":{"units":["candelas"]},"magneticFieldStrength":{"units":["oersteds"]},"magneticFlux":{"units":["webers","maxwells"]},"magneticFluxDensity":{"units":["teslas","gauss","gammas"]},"mass":{"units":["kilograms","tonnes","poundsMass","grams","milligrams","nanograms","grains","usTonnesMass","slugs","ouncesMass"]},"massPerArea":{"units":["kilogramsPerSquareMeter","poundsMassPerSquareFoot"]},"massPerLength":{"units":["kilogramsPerMeter","poundsMassPerFoot"]},"massPerTime":{"units":["poundsMassPerHour","poundsMassPerMinute","poundsMassPerSecond","kilogramsPerHour","kilogramsPerMinute","kilogramsPerSecond"]},"number":{"units":["general","fixed","percentage"]},"permeability":{"units":["nanogramsPerPascalSecondSquareMeter","grainsPerHourSquareFootInchMercury"]},"power":{"units":["watts","kilowatts","britishThermalUnitsPerSecond","britishThermalUnitsPerHour","caloriesPerSecond","kilocaloriesPerSecond","voltAmperes","kilovoltAmperes","horsepower","thousandBritishThermalUnitsPerHour","tonsOfRefrigeration"]},"powerDensity":{"units":["wattsPerCubicFoot","wattsPerCubicMeter","britishThermalUnitsPerHourCubicFoot"]},"powerPerArea":{"units":["wattsPerSquareFoot","wattsPerSquareMeter","britishThermalUnitsPerHourSquareFoot"]},"powerPerFlow":{"units":["wattsPerCubicFootPerMinute","wattsPerCubicMeterPerSecond"]},"powerPerLength":{"units":["wattsPerFoot","wattsPerMeter"]},"pressure":{"units":["pascals","kilopascals","megapascals","poundsForcePerSquareInch","inchesOfMercury32DegreesFahrenheit","millimetersOfMercury","atmospheres","bars","feetOfWater39.2DegreesFahrenheit","inchesOfWater60DegreesFahrenheit"]},"ratio":{"units":["fixed","percentage","perMille","ratioTo1","ratioTo10","ratioTo12","1ToRatio"]},"secondMomentOfArea":{"units":["feetToTheFourthPower","inchesToTheFourthPower","millimetersToTheFourthPower","centimetersToTheFourthPower","metersToTheFourthPower"]},"slope":{"units":["percentage","ratioTo1","ratioTo10","ratioTo12","riseDividedBy12Inches","riseDividedBy1Foot","riseDividedBy1000Millimeters","riseDividedBy120Inches","1ToRatio","riseDividedBy10Feet","perMille"]},"solidAngle":{"units":["steradians"]},"specificEnergy":{"units":["joulesPerGram","joulesPerKilogram","britishThermalUnitsPerPound"]},"specificHeatCapacity":{"units":["joulesPerGramDegreeCelsius","britishThermalUnitsPerPoundDegreeFahrenheit","joulesPerKilogramDegreeCelsius"]},"stress":{"units":["pascals","kilopascals","megapascals","poundsForcePerSquareInch","bars","newtonsPerSquareMeter","dekanewtonsPerSquareMeter","kilonewtonsPerSquareMeter","meganewtonsPerSquareMeter","kipsPerSquareFoot","kilogramsForcePerSquareMeter","tonnesForcePerSquareMeter","poundsForcePerSquareFoot","kipsPerSquareInch","kilonewtonsPerSquareCentimeter","newtonsPerSquareMillimeter","kilonewtonsPerSquareMillimeter"]},"temperature":{"units":["fahrenheit","celsius","kelvin","rankine"]},"temperatureInterval":{"units":["fahrenheitInterval","celsiusInterval","kelvinInterval","rankineInterval"]},"thermalConductivity":{"units":["wattsPerMeterKelvin","britishThermalUnitsPerHourFootDegreeFahrenheit"]},"thermalExpansionCoefficient":{"units":["inverseDegreesFahrenheit","inverseDegreesCelsius","micrometersPerMeterDegreeCelsius","microinchesPerInchDegreeFahrenheit"]},"thermalInsulance":{"units":["hourSquareFootDegreesFahrenheitPerBritishThermalUnit","squareMeterKelvinsPerWatt"]},"time":{"units":["milliseconds","seconds","minutes","hours"]},"torque":{"units":["newtonMeters","dekanewtonMeters","kilonewtonMeters","meganewtonMeters","kipFeet","kilogramForceMeters","tonneForceMeters","poundForceFeet"]},"torquePerLength":{"units":["newtonMetersPerMeter","dekanewtonMetersPerMeter","kilonewtonMetersPerMeter","meganewtonMetersPerMeter","kipFeetPerFoot","kilogramForceMetersPerMeter","tonneForceMetersPerMeter","poundForceFeetPerFoot"]},"velocity":{"units":["feetPerMinute","centimetersPerMinute","inchesPerSecond","metersPerSecond","feetPerSecond","kilometersPerSecond","milesPerSecond","kilometersPerHour","milesPerHour"]},"volume":{"units":["cubicYards","cubicFeet","cubicInches","cubicMeters","cubicCentimeters","cubicMillimeters","liters","usGallons"]},"volumePerForce":{"units":["cubicFeetPerKip","cubicMetersPerKilonewton"]},"warpingCoefficient":{"units":["feetToTheSixthPower","inchesToTheSixthPower","millimetersToTheSixthPower","centimetersToTheSixthPower","metersToTheSixthPower"]}}}')}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return i[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(i,n){if(1&n&&(i=this(i)),8&n)return i;if("object"==typeof i&&i){if(4&n&&i.__esModule)return i;if(16&n&&"function"==typeof i.then)return i}var o=Object.create(null);r.r(o);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&i;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>i[e]));return s.default=()=>i,r.d(o,s),o},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o=r(96288);LMV=o})();
  44. //# sourceMappingURL=viewer3D.min.js.map