chunk-OBMTYN3I.js 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992
  1. import {
  2. C,
  3. c as c3,
  4. i,
  5. o as o3,
  6. r as r6
  7. } from "./chunk-EPIK5VPD.js";
  8. import {
  9. e as e7
  10. } from "./chunk-YOPKLVID.js";
  11. import {
  12. r as r5
  13. } from "./chunk-T4GXZJ3D.js";
  14. import {
  15. O
  16. } from "./chunk-XXBIV3TZ.js";
  17. import {
  18. e as e5
  19. } from "./chunk-E3HOL2XO.js";
  20. import {
  21. e as e4
  22. } from "./chunk-SCXOTZ6Q.js";
  23. import {
  24. f as f2,
  25. n as n4
  26. } from "./chunk-G5AI6ZNE.js";
  27. import {
  28. r as r4
  29. } from "./chunk-6P6NA7JB.js";
  30. import {
  31. a as a2,
  32. q,
  33. w
  34. } from "./chunk-WNCU6BFU.js";
  35. import {
  36. n as n2,
  37. r as r3
  38. } from "./chunk-NTUXR253.js";
  39. import {
  40. n as n3
  41. } from "./chunk-H2KDMZTR.js";
  42. import {
  43. e as e6
  44. } from "./chunk-PJ7ZQ4VD.js";
  45. import {
  46. c as c2
  47. } from "./chunk-TERAW6FT.js";
  48. import {
  49. L,
  50. M,
  51. _,
  52. e as e3,
  53. o,
  54. o2,
  55. r2,
  56. s3,
  57. u,
  58. z
  59. } from "./chunk-XNLG7T2T.js";
  60. import {
  61. f,
  62. n
  63. } from "./chunk-IR4PV7VK.js";
  64. import {
  65. e4 as e2
  66. } from "./chunk-Y3WMVFTW.js";
  67. import {
  68. k
  69. } from "./chunk-ULGDPLM2.js";
  70. import {
  71. s,
  72. s3 as s2
  73. } from "./chunk-EMJ4ZSM2.js";
  74. import {
  75. a,
  76. c2 as c,
  77. e,
  78. p,
  79. r,
  80. t
  81. } from "./chunk-GZT4BVFP.js";
  82. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ShaderOutputOptions.js
  83. var o4;
  84. !function(o24) {
  85. o24[o24.Color = 0] = "Color", o24[o24.Depth = 1] = "Depth", o24[o24.Normal = 2] = "Normal", o24[o24.Shadow = 3] = "Shadow", o24[o24.Highlight = 4] = "Highlight", o24[o24.Draped = 5] = "Draped", o24[o24.Occlusion = 6] = "Occlusion", o24[o24.Alpha = 7] = "Alpha", o24[o24.COUNT = 8] = "COUNT";
  86. }(o4 || (o4 = {}));
  87. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/interfaces.js
  88. var t2 = class {
  89. };
  90. function n5(t10, ...n15) {
  91. let o24 = "";
  92. for (let r15 = 0; r15 < n15.length; r15++)
  93. o24 += t10[r15] + n15[r15];
  94. return o24 += t10[t10.length - 1], o24;
  95. }
  96. !function(t10) {
  97. function n15(t11) {
  98. return Math.round(t11).toString();
  99. }
  100. function o24(t11) {
  101. return t11.toPrecision(8);
  102. }
  103. t10.int = n15, t10.float = o24;
  104. }(n5 || (n5 = {}));
  105. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DecodeNormal.glsl.js
  106. function o5(o24) {
  107. const d8 = n5`vec3 decodeNormal(vec2 f) {
  108. float z = 1.0 - abs(f.x) - abs(f.y);
  109. return vec3(f + sign(f) * min(z, 0.0), z);
  110. }`;
  111. o24.fragment.code.add(d8), o24.vertex.code.add(d8);
  112. }
  113. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js
  114. function o6(o24, d8) {
  115. d8.normalType === i2.Attribute && (o24.attributes.add(O.NORMAL, "vec3"), o24.vertex.code.add(n5`vec3 normalModel() {
  116. return normal;
  117. }`)), d8.normalType === i2.CompressedAttribute && (o24.include(o5), o24.attributes.add(O.NORMALCOMPRESSED, "vec2"), o24.vertex.code.add(n5`vec3 normalModel() {
  118. return decodeNormal(normalCompressed);
  119. }`)), d8.normalType === i2.ScreenDerivative && (o24.extensions.add("GL_OES_standard_derivatives"), o24.fragment.code.add(n5`vec3 screenDerivativeNormal(vec3 positionView) {
  120. return normalize(cross(dFdx(positionView), dFdy(positionView)));
  121. }`));
  122. }
  123. var i2;
  124. !function(e24) {
  125. e24[e24.Attribute = 0] = "Attribute", e24[e24.CompressedAttribute = 1] = "CompressedAttribute", e24[e24.Ground = 2] = "Ground", e24[e24.ScreenDerivative = 3] = "ScreenDerivative", e24[e24.COUNT = 4] = "COUNT";
  126. }(i2 || (i2 = {}));
  127. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js
  128. var o7;
  129. function d(d8, a14) {
  130. switch (a14.textureCoordinateType) {
  131. case o7.Default:
  132. return d8.attributes.add(O.UV0, "vec2"), d8.varyings.add("vuv0", "vec2"), void d8.vertex.code.add(n5`void forwardTextureCoordinates() {
  133. vuv0 = uv0;
  134. }`);
  135. case o7.Atlas:
  136. return d8.attributes.add(O.UV0, "vec2"), d8.varyings.add("vuv0", "vec2"), d8.attributes.add(O.UVREGION, "vec4"), d8.varyings.add("vuvRegion", "vec4"), void d8.vertex.code.add(n5`void forwardTextureCoordinates() {
  137. vuv0 = uv0;
  138. vuvRegion = uvRegion;
  139. }`);
  140. case o7.None:
  141. return void d8.vertex.code.add(n5`void forwardTextureCoordinates() {}`);
  142. default:
  143. n3(a14.textureCoordinateType);
  144. case o7.COUNT:
  145. return;
  146. }
  147. }
  148. !function(e24) {
  149. e24[e24.None = 0] = "None", e24[e24.Default = 1] = "Default", e24[e24.Atlas = 2] = "Atlas", e24[e24.COUNT = 3] = "COUNT";
  150. }(o7 || (o7 = {}));
  151. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/BindType.js
  152. var a3;
  153. !function(a14) {
  154. a14[a14.Pass = 0] = "Pass", a14[a14.Draw = 1] = "Draw";
  155. }(a3 || (a3 = {}));
  156. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Uniform.js
  157. var i3 = class {
  158. constructor(i12, s9, t10, a14, n15 = null) {
  159. this.name = i12, this.type = s9, this.arraySize = n15, this.bind = { [a3.Pass]: null, [a3.Draw]: null }, r(t10) && r(a14) && (this.bind[t10] = a14);
  160. }
  161. equals(e24) {
  162. return this.type === e24.type && this.name === e24.name && this.arraySize === e24.arraySize;
  163. }
  164. };
  165. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js
  166. var e8 = class extends i3 {
  167. constructor(r15, e24) {
  168. super(r15, "vec3", a3.Pass, (s9, o24, t10) => s9.setUniform3fv(r15, e24(o24, t10)));
  169. }
  170. };
  171. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js
  172. var e9 = class extends i3 {
  173. constructor(r15, e24) {
  174. super(r15, "vec2", a3.Pass, (s9, o24, t10) => s9.setUniform2fv(r15, e24(o24, t10)));
  175. }
  176. };
  177. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js
  178. var c4 = class extends i3 {
  179. constructor(r15, s9) {
  180. super(r15, "sampler2D", a3.Pass, (o24, e24, t10) => o24.bindTexture(r15, s9(e24, t10)));
  181. }
  182. };
  183. function m(e24, n15, i12) {
  184. const m8 = [new c4(e24, n15)];
  185. if (i12) {
  186. const i13 = e24 + "Size";
  187. m8.push(new e9(i13, (e25, t10) => {
  188. const i14 = n15(e25, t10);
  189. return r(i14) ? r4(p2, i14.descriptor.width, i14.descriptor.height) : f2;
  190. }));
  191. }
  192. return m8;
  193. }
  194. var p2 = n4();
  195. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/TextureAtlasLookup.glsl.js
  196. function t3(t10) {
  197. t10.extensions.add("GL_EXT_shader_texture_lod"), t10.extensions.add("GL_OES_standard_derivatives"), t10.fragment.code.add(n5`#ifndef GL_EXT_shader_texture_lod
  198. float calcMipMapLevel(const vec2 ddx, const vec2 ddy) {
  199. float deltaMaxSqr = max(dot(ddx, ddx), dot(ddy, ddy));
  200. return max(0.0, 0.5 * log2(deltaMaxSqr));
  201. }
  202. #endif
  203. vec4 textureAtlasLookup(sampler2D texture, vec2 textureSize, vec2 textureCoordinates, vec4 atlasRegion) {
  204. vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
  205. vec2 uvAtlas = fract(textureCoordinates) * atlasScale + atlasRegion.xy;
  206. float maxdUV = 0.125;
  207. vec2 dUVdx = clamp(dFdx(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
  208. vec2 dUVdy = clamp(dFdy(textureCoordinates), -maxdUV, maxdUV) * atlasScale;
  209. #ifdef GL_EXT_shader_texture_lod
  210. return texture2DGradEXT(texture, uvAtlas, dUVdx, dUVdy);
  211. #else
  212. vec2 dUVdxAuto = dFdx(uvAtlas);
  213. vec2 dUVdyAuto = dFdy(uvAtlas);
  214. float mipMapLevel = calcMipMapLevel(dUVdx * textureSize, dUVdy * textureSize);
  215. float autoMipMapLevel = calcMipMapLevel(dUVdxAuto * textureSize, dUVdyAuto * textureSize);
  216. return texture2D(texture, uvAtlas, mipMapLevel - autoMipMapLevel);
  217. #endif
  218. }`);
  219. }
  220. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js
  221. function a4(a14, s9) {
  222. switch (a14.include(d, s9), a14.fragment.code.add(n5`
  223. struct TextureLookupParameter {
  224. vec2 uv;
  225. ${s9.supportsTextureAtlas ? "vec2 size;" : ""}
  226. } vtc;
  227. `), s9.textureCoordinateType) {
  228. case o7.Default:
  229. return void a14.fragment.code.add(n5`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
  230. return texture2D(texture, params.uv);
  231. }`);
  232. case o7.Atlas:
  233. return a14.include(t3), void a14.fragment.code.add(n5`vec4 textureLookup(sampler2D texture, TextureLookupParameter params) {
  234. return textureAtlasLookup(texture, params.size, params.uv, vuvRegion);
  235. }`);
  236. default:
  237. n3(s9.textureCoordinateType);
  238. case o7.None:
  239. case o7.COUNT:
  240. return;
  241. }
  242. }
  243. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float3DrawUniform.js
  244. var o8 = class extends i3 {
  245. constructor(r15, o24) {
  246. super(r15, "vec3", a3.Draw, (e24, s9, t10) => e24.setUniform3fv(r15, o24(s9, t10)));
  247. }
  248. };
  249. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float2DrawUniform.js
  250. var o9 = class extends i3 {
  251. constructor(r15, o24) {
  252. super(r15, "vec2", a3.Draw, (e24, s9, t10) => e24.setUniform2fv(r15, o24(s9, t10)));
  253. }
  254. };
  255. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js
  256. var c5 = class extends i3 {
  257. constructor(r15, o24) {
  258. super(r15, "sampler2D", a3.Draw, (s9, e24, t10) => s9.bindTexture(r15, o24(e24, t10)));
  259. }
  260. };
  261. function m2(e24, n15, i12) {
  262. const m8 = [new c5(e24, n15)];
  263. if (i12) {
  264. const i13 = e24 + "Size";
  265. m8.push(new o9(i13, (e25, t10) => {
  266. const i14 = n15(e25, t10);
  267. return r(i14) ? r4(p3, i14.descriptor.width, i14.descriptor.height) : f2;
  268. }));
  269. }
  270. return m8;
  271. }
  272. var p3 = n4();
  273. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLMaterial.js
  274. var t4 = class {
  275. constructor(e24) {
  276. this._material = e24.material, this._techniqueRepository = e24.techniqueRep, this._output = e24.output;
  277. }
  278. dispose() {
  279. this._techniqueRepository.release(this._technique);
  280. }
  281. get technique() {
  282. return this._technique;
  283. }
  284. ensureTechnique(e24, t10, i12 = this._output) {
  285. return this._technique = this._techniqueRepository.releaseAndAcquire(e24, this._material.getConfiguration(i12, t10), this._technique), this._technique;
  286. }
  287. ensureResources(t10) {
  288. return i.LOADED;
  289. }
  290. };
  291. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/GLTextureMaterial.js
  292. var h = class extends t4 {
  293. constructor(t10) {
  294. super(t10), this._numLoading = 0, this._disposed = false, this._textureRepository = t10.textureRep, this._textureId = t10.textureId, this._acquire(t10.textureId, (t11) => this._texture = t11), this._acquire(t10.normalTextureId, (t11) => this._textureNormal = t11), this._acquire(t10.emissiveTextureId, (t11) => this._textureEmissive = t11), this._acquire(t10.occlusionTextureId, (t11) => this._textureOcclusion = t11), this._acquire(t10.metallicRoughnessTextureId, (t11) => this._textureMetallicRoughness = t11);
  295. }
  296. dispose() {
  297. this._texture = p(this._texture), this._textureNormal = p(this._textureNormal), this._textureEmissive = p(this._textureEmissive), this._textureOcclusion = p(this._textureOcclusion), this._textureMetallicRoughness = p(this._textureMetallicRoughness), this._disposed = true;
  298. }
  299. ensureResources(t10) {
  300. return this._numLoading === 0 ? i.LOADED : i.LOADING;
  301. }
  302. get textureBindParameters() {
  303. return new o10(r(this._texture) ? this._texture.glTexture : null, r(this._textureNormal) ? this._textureNormal.glTexture : null, r(this._textureEmissive) ? this._textureEmissive.glTexture : null, r(this._textureOcclusion) ? this._textureOcclusion.glTexture : null, r(this._textureMetallicRoughness) ? this._textureMetallicRoughness.glTexture : null);
  304. }
  305. updateTexture(e24) {
  306. (t(this._texture) || e24 !== this._texture.id) && (this._texture = p(this._texture), this._textureId = e24, this._acquire(this._textureId, (t10) => this._texture = t10));
  307. }
  308. _acquire(e24, r15) {
  309. if (t(e24))
  310. return void r15(null);
  311. const u8 = this._textureRepository.acquire(e24);
  312. if (k(u8))
  313. return ++this._numLoading, void u8.then((e25) => {
  314. if (this._disposed)
  315. return p(e25), void r15(null);
  316. r15(e25);
  317. }).finally(() => --this._numLoading);
  318. r15(u8);
  319. }
  320. };
  321. var o10 = class extends t2 {
  322. constructor(t10 = null, e24 = null, s9 = null, i12 = null, r15 = null) {
  323. super(), this.texture = t10, this.textureNormal = e24, this.textureEmissive = s9, this.textureOcclusion = i12, this.textureMetallicRoughness = r15;
  324. }
  325. };
  326. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js
  327. var u2 = r5(0, 0.6, 0.2);
  328. var l;
  329. !function(e24) {
  330. e24[e24.Disabled = 0] = "Disabled", e24[e24.Normal = 1] = "Normal", e24[e24.Schematic = 2] = "Schematic", e24[e24.Water = 3] = "Water", e24[e24.WaterOnIntegratedMesh = 4] = "WaterOnIntegratedMesh", e24[e24.COUNT = 5] = "COUNT";
  331. }(l || (l = {}));
  332. function d2(e24, n15) {
  333. const u8 = e24.fragment, m8 = n15.hasMetalnessAndRoughnessTexture || n15.hasEmissionTexture || n15.hasOcclusionTexture;
  334. if (n15.pbrMode === l.Normal && m8 && e24.include(a4, n15), n15.pbrMode !== l.Schematic)
  335. if (n15.pbrMode !== l.Disabled) {
  336. if (n15.pbrMode === l.Normal) {
  337. u8.code.add(n5`vec3 mrr;
  338. vec3 emission;
  339. float occlusion;`);
  340. const e25 = n15.supportsTextureAtlas, s9 = n15.pbrTextureBindType;
  341. n15.hasMetalnessAndRoughnessTexture && (u8.uniforms.add(s9 === a3.Pass ? m("texMetallicRoughness", (e26) => e26.textureMetallicRoughness, e25) : m2("texMetallicRoughness", (e26) => e26.textureMetallicRoughness, e25)), u8.code.add(n5`void applyMetallnessAndRoughness(TextureLookupParameter params) {
  342. vec3 metallicRoughness = textureLookup(texMetallicRoughness, params).rgb;
  343. mrr[0] *= metallicRoughness.b;
  344. mrr[1] *= metallicRoughness.g;
  345. }`)), n15.hasEmissionTexture && (u8.uniforms.add(s9 === a3.Pass ? m("texEmission", (e26) => e26.textureEmissive, e25) : m2("texEmission", (e26) => e26.textureEmissive, e25)), u8.code.add(n5`void applyEmission(TextureLookupParameter params) {
  346. emission *= textureLookup(texEmission, params).rgb;
  347. }`)), n15.hasOcclusionTexture ? (u8.uniforms.add(s9 === a3.Pass ? m("texOcclusion", (e26) => e26.textureOcclusion, e25) : m2("texOcclusion", (e26) => e26.textureOcclusion, e25)), u8.code.add(n5`void applyOcclusion(TextureLookupParameter params) {
  348. occlusion *= textureLookup(texOcclusion, params).r;
  349. }
  350. float getBakedOcclusion() {
  351. return occlusion;
  352. }`)) : u8.code.add(n5`float getBakedOcclusion() { return 1.0; }`), u8.uniforms.add(s9 === a3.Pass ? [new e8("emissionFactor", (e26) => e26.emissiveFactor), new e8("mrrFactors", (e26) => e26.mrrFactors)] : [new o8("emissionFactor", (e26) => e26.emissiveFactor), new o8("mrrFactors", (e26) => e26.mrrFactors)]), u8.code.add(n5`
  353. void applyPBRFactors() {
  354. mrr = mrrFactors;
  355. emission = emissionFactor;
  356. occlusion = 1.0;
  357. ${m8 ? "vtc.uv = vuv0;" : ""}
  358. ${n15.hasMetalnessAndRoughnessTexture ? n15.supportsTextureAtlas ? "vtc.size = texMetallicRoughnessSize; applyMetallnessAndRoughness(vtc);" : "applyMetallnessAndRoughness(vtc);" : ""}
  359. ${n15.hasEmissionTexture ? n15.supportsTextureAtlas ? "vtc.size = texEmissionSize; applyEmission(vtc);" : "applyEmission(vtc);" : ""}
  360. ${n15.hasOcclusionTexture ? n15.supportsTextureAtlas ? "vtc.size = texOcclusionSize; applyOcclusion(vtc);" : "applyOcclusion(vtc);" : ""}
  361. }
  362. `);
  363. }
  364. } else
  365. u8.code.add(n5`float getBakedOcclusion() { return 1.0; }`);
  366. else
  367. u8.code.add(n5`vec3 mrr = vec3(0.0, 0.6, 0.2);
  368. vec3 emission = vec3(0.0);
  369. float occlusion = 1.0;
  370. void applyPBRFactors() {}
  371. float getBakedOcclusion() { return 1.0; }`);
  372. }
  373. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js
  374. function o11(o24) {
  375. o24.attributes.add(O.POSITION, "vec3"), o24.vertex.code.add(n5`vec3 positionModel() { return position; }`);
  376. }
  377. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4PassUniform.js
  378. var e10 = class extends i3 {
  379. constructor(r15, e24) {
  380. super(r15, "mat4", a3.Pass, (s9, o24, t10) => s9.setUniformMatrix4fv(r15, e24(o24, t10)));
  381. }
  382. };
  383. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DoublePrecision.glsl.js
  384. function i4({ code: e24 }, i12) {
  385. i12.doublePrecisionRequiresObfuscation ? e24.add(n5`vec3 dpPlusFrc(vec3 a, vec3 b) {
  386. return mix(a, a + b, vec3(notEqual(b, vec3(0))));
  387. }
  388. vec3 dpMinusFrc(vec3 a, vec3 b) {
  389. return mix(vec3(0), a - b, vec3(notEqual(a, b)));
  390. }
  391. vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
  392. vec3 t1 = dpPlusFrc(hiA, hiB);
  393. vec3 e = dpMinusFrc(t1, hiA);
  394. vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB;
  395. return t1 + t2;
  396. }`) : e24.add(n5`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) {
  397. vec3 t1 = hiA + hiB;
  398. vec3 e = t1 - hiA;
  399. vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB;
  400. return t1 + t2;
  401. }`);
  402. }
  403. function r7(c14) {
  404. return !!a("force-double-precision-obfuscation") || c14.driverTest.doublePrecisionRequiresObfuscation;
  405. }
  406. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js
  407. var o12 = class extends i3 {
  408. constructor(r15, o24) {
  409. super(r15, "mat3", a3.Draw, (e24, s9, t10) => e24.setUniformMatrix3fv(r15, o24(s9, t10)));
  410. }
  411. };
  412. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js
  413. var e11 = class extends i3 {
  414. constructor(r15, e24) {
  415. super(r15, "mat3", a3.Pass, (s9, o24, t10) => s9.setUniformMatrix3fv(r15, e24(o24, t10)));
  416. }
  417. };
  418. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js
  419. function F(r15, o24) {
  420. r15.include(o11);
  421. const e24 = r15.vertex;
  422. e24.include(i4, o24), r15.varyings.add("vPositionWorldCameraRelative", "vec3"), r15.varyings.add("vPosition_view", "vec3"), e24.uniforms.add([new e8("transformWorldFromViewTH", (r16) => r16.transformWorldFromViewTH), new e8("transformWorldFromViewTL", (r16) => r16.transformWorldFromViewTL), new e11("transformViewFromCameraRelativeRS", (r16) => r16.transformViewFromCameraRelativeRS), new e10("transformProjFromView", (r16) => r16.transformProjFromView), new o12("transformWorldFromModelRS", (r16) => r16.transformWorldFromModelRS), new o8("transformWorldFromModelTH", (r16) => r16.transformWorldFromModelTH), new o8("transformWorldFromModelTL", (r16) => r16.transformWorldFromModelTL)]), e24.code.add(n5`vec3 positionWorldCameraRelative() {
  423. vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel();
  424. vec3 transform_CameraRelativeFromModel = dpAdd(
  425. transformWorldFromModelTL,
  426. transformWorldFromModelTH,
  427. -transformWorldFromViewTL,
  428. -transformWorldFromViewTH
  429. );
  430. return transform_CameraRelativeFromModel + rotatedModelPosition;
  431. }`), e24.code.add(n5`
  432. void forwardPosition(float fOffset) {
  433. vPositionWorldCameraRelative = positionWorldCameraRelative();
  434. if (fOffset != 0.0) {
  435. vPositionWorldCameraRelative += fOffset * ${o24.spherical ? n5`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)` : n5`vec3(0.0, 0.0, 1.0)`};
  436. }
  437. vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative;
  438. gl_Position = transformProjFromView * vec4(vPosition_view, 1.0);
  439. }
  440. `), r15.fragment.uniforms.add(new e8("transformWorldFromViewTL", (r16) => r16.transformWorldFromViewTL)), e24.code.add(n5`vec3 positionWorld() {
  441. return transformWorldFromViewTL + vPositionWorldCameraRelative;
  442. }`), r15.fragment.code.add(n5`vec3 positionWorld() {
  443. return transformWorldFromViewTL + vPositionWorldCameraRelative;
  444. }`);
  445. }
  446. var c6 = class extends t2 {
  447. constructor() {
  448. super(...arguments), this.transformWorldFromViewTH = n(), this.transformWorldFromViewTL = n(), this.transformViewFromCameraRelativeRS = e4(), this.transformProjFromView = e5();
  449. }
  450. };
  451. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js
  452. function n7(r15, o24) {
  453. if (o24.normalType === i2.Attribute || o24.normalType === i2.CompressedAttribute) {
  454. r15.include(o6, o24), r15.varyings.add("vNormalWorld", "vec3"), r15.varyings.add("vNormalView", "vec3");
  455. r15.vertex.uniforms.add([new o12("transformNormalGlobalFromModel", (r16) => r16.transformNormalGlobalFromModel), new e11("transformNormalViewFromGlobal", (r16) => r16.transformNormalViewFromGlobal)]), r15.vertex.code.add(n5`void forwardNormal() {
  456. vNormalWorld = transformNormalGlobalFromModel * normalModel();
  457. vNormalView = transformNormalViewFromGlobal * vNormalWorld;
  458. }`);
  459. } else
  460. o24.normalType === i2.Ground ? (r15.include(F, o24), r15.varyings.add("vNormalWorld", "vec3"), r15.vertex.code.add(n5`
  461. void forwardNormal() {
  462. vNormalWorld = ${o24.spherical ? n5`normalize(vPositionWorldCameraRelative);` : n5`vec3(0.0, 0.0, 1.0);`}
  463. }
  464. `)) : r15.vertex.code.add(n5`void forwardNormal() {}`);
  465. }
  466. var f3 = class extends c6 {
  467. constructor() {
  468. super(...arguments), this.transformNormalViewFromGlobal = e4();
  469. }
  470. };
  471. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaCutoff.js
  472. var o13 = 0.1;
  473. var t5 = 1e-3;
  474. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js
  475. function t6(t10, i12) {
  476. i12.output === o4.Color && i12.receiveShadows ? (t10.varyings.add("linearDepth", "float"), t10.vertex.code.add(n5`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)) : i12.output === o4.Depth || i12.output === o4.Shadow ? (t10.include(F, i12), t10.varyings.add("linearDepth", "float"), t10.vertex.uniforms.add(new e9("nearFar", (e24, r15) => r15.camera.nearFar)), t10.vertex.code.add(n5`void forwardLinearDepth() {
  477. linearDepth = (-vPosition_view.z - nearFar[0]) / (nearFar[1] - nearFar[0]);
  478. }`)) : t10.vertex.code.add(n5`void forwardLinearDepth() {}`);
  479. }
  480. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Offset.glsl.js
  481. function e12(e24) {
  482. e24.vertex.code.add(n5`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
  483. vec3 camToVert = posWorld - camPosWorld;
  484. bool isBackface = dot(camToVert, normalWorld) > 0.0;
  485. if (isBackface) {
  486. posClip.z += 0.0000003 * posClip.w;
  487. }
  488. return posClip;
  489. }`);
  490. }
  491. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js
  492. function u3(s9, i12) {
  493. H(s9, i12, [new o8("slicePlaneOrigin", (e24, s10) => v(i12, e24, s10)), new o8("slicePlaneBasis1", (s10, a14) => B(i12, s10, a14, e(a14.slicePlane)?.basis1)), new o8("slicePlaneBasis2", (s10, a14) => B(i12, s10, a14, e(a14.slicePlane)?.basis2))]);
  494. }
  495. function H(e24, s9, i12) {
  496. if (!s9.hasSlicePlane) {
  497. const i13 = n5`#define rejectBySlice(_pos_) false
  498. #define discardBySlice(_pos_) {}
  499. #define highlightSlice(_color_, _pos_) (_color_)`;
  500. return s9.hasSliceInVertexProgram && e24.vertex.code.add(i13), void e24.fragment.code.add(i13);
  501. }
  502. e24.extensions.add("GL_OES_standard_derivatives"), s9.hasSliceInVertexProgram && e24.vertex.uniforms.add(i12), e24.fragment.uniforms.add(i12);
  503. const a14 = n5`struct SliceFactors {
  504. float front;
  505. float side0;
  506. float side1;
  507. float side2;
  508. float side3;
  509. };
  510. SliceFactors calculateSliceFactors(vec3 pos) {
  511. vec3 rel = pos - slicePlaneOrigin;
  512. vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2);
  513. float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin);
  514. float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1);
  515. float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2);
  516. float basis1Dot = dot(slicePlaneBasis1, rel);
  517. float basis2Dot = dot(slicePlaneBasis2, rel);
  518. return SliceFactors(
  519. dot(slicePlaneNormal, pos) + slicePlaneW,
  520. -basis1Dot - basis1Len2,
  521. basis1Dot - basis1Len2,
  522. -basis2Dot - basis2Len2,
  523. basis2Dot - basis2Len2
  524. );
  525. }
  526. bool sliceByFactors(SliceFactors factors) {
  527. return factors.front < 0.0
  528. && factors.side0 < 0.0
  529. && factors.side1 < 0.0
  530. && factors.side2 < 0.0
  531. && factors.side3 < 0.0;
  532. }
  533. bool sliceEnabled() {
  534. return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
  535. }
  536. bool sliceByPlane(vec3 pos) {
  537. return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
  538. }
  539. #define rejectBySlice(_pos_) sliceByPlane(_pos_)
  540. #define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`, o24 = n5`vec4 applySliceHighlight(vec4 color, vec3 pos) {
  541. SliceFactors factors = calculateSliceFactors(pos);
  542. const float HIGHLIGHT_WIDTH = 1.0;
  543. const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3);
  544. factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front);
  545. factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0);
  546. factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1);
  547. factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2);
  548. factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3);
  549. if (sliceByFactors(factors)) {
  550. return color;
  551. }
  552. float highlightFactor = (1.0 - step(0.5, factors.front))
  553. * (1.0 - step(0.5, factors.side0))
  554. * (1.0 - step(0.5, factors.side1))
  555. * (1.0 - step(0.5, factors.side2))
  556. * (1.0 - step(0.5, factors.side3));
  557. return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a);
  558. }`, c14 = s9.hasSliceHighlight ? n5`
  559. ${o24}
  560. #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_))
  561. ` : n5`#define highlightSlice(_color_, _pos_) (_color_)`;
  562. s9.hasSliceInVertexProgram && e24.vertex.code.add(a14), e24.fragment.code.add(a14), e24.fragment.code.add(c14);
  563. }
  564. function g(e24, s9, i12) {
  565. return e24.instancedDoublePrecision ? o(S, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]) : s9.slicePlaneLocalOrigin;
  566. }
  567. function I(e24, s9) {
  568. return r(e24) ? e3(L2, s9.origin, e24) : s9.origin;
  569. }
  570. function b(e24, s9, o24) {
  571. return e24.hasSliceTranslatedView ? r(s9) ? c2(T, o24.camera.viewMatrix, s9) : o24.camera.viewMatrix : null;
  572. }
  573. function v(e24, a14, o24) {
  574. if (t(o24.slicePlane))
  575. return f;
  576. const c14 = g(e24, a14, o24), r15 = I(c14, o24.slicePlane), t10 = b(e24, c14, o24);
  577. return r(t10) ? L(L2, r15, t10) : r15;
  578. }
  579. function B(e24, a14, o24, c14) {
  580. if (t(c14) || t(o24.slicePlane))
  581. return f;
  582. const f7 = g(e24, a14, o24), d8 = I(f7, o24.slicePlane), _3 = b(e24, f7, o24);
  583. return r(_3) ? (u(G, c14, d8), L(L2, d8, _3), L(G, G, _3), e3(G, G, L2)) : c14;
  584. }
  585. var S = n();
  586. var L2 = n();
  587. var G = n();
  588. var T = e5();
  589. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/Transform.glsl.js
  590. function r8(r15, o24 = { hasModelTransformation: false, linearDepth: false }) {
  591. if (o24.hasModelTransformation)
  592. return o24.linearDepth ? void r15.vertex.code.add(n5`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {
  593. vec4 eye = view * (model * vec4(pos, 1.0));
  594. depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;
  595. return proj * eye;
  596. }`) : void r15.vertex.code.add(n5`vec4 transformPosition(mat4 proj, mat4 view, mat4 model, vec3 pos) {
  597. return proj * (view * (model * vec4(pos, 1.0)));
  598. }`);
  599. o24.linearDepth ? r15.vertex.code.add(n5`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) {
  600. vec4 eye = view * vec4(pos, 1.0);
  601. depth = (-eye.z - nearFar[0]) / (nearFar[1] - nearFar[0]) ;
  602. return proj * eye;
  603. }`) : r15.vertex.code.add(n5`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) {
  604. return proj * (view * vec4(pos, 1.0));
  605. }`);
  606. }
  607. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js
  608. function m3(r15, m8) {
  609. m8.instanced && m8.instancedDoublePrecision && (r15.attributes.add(O.MODELORIGINHI, "vec3"), r15.attributes.add(O.MODELORIGINLO, "vec3"), r15.attributes.add(O.MODEL, "mat3"), r15.attributes.add(O.MODELNORMAL, "mat3"));
  610. const u8 = r15.vertex;
  611. m8.instancedDoublePrecision && (u8.include(i4, m8), u8.uniforms.add(new o8("viewOriginHi", (r16, i12) => o3(o(l2, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]), l2))), u8.uniforms.add(new o8("viewOriginLo", (r16, i12) => r6(o(l2, i12.camera.viewInverseTransposeMatrix[3], i12.camera.viewInverseTransposeMatrix[7], i12.camera.viewInverseTransposeMatrix[11]), l2)))), u8.code.add(n5`
  612. vec3 calculateVPos() {
  613. ${m8.instancedDoublePrecision ? "return model * localPosition().xyz;" : "return localPosition().xyz;"}
  614. }
  615. `), u8.code.add(n5`
  616. vec3 subtractOrigin(vec3 _pos) {
  617. ${m8.instancedDoublePrecision ? n5`
  618. vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);
  619. return _pos - originDelta;` : "return vpos;"}
  620. }
  621. `), u8.code.add(n5`
  622. vec3 dpNormal(vec4 _normal) {
  623. ${m8.instancedDoublePrecision ? "return normalize(modelNormal * _normal.xyz);" : "return normalize(_normal.xyz);"}
  624. }
  625. `), m8.output === o4.Normal && (u8.uniforms.add(new e10("viewNormal", (e24, r16) => r16.camera.viewInverseTransposeMatrix)), u8.code.add(n5`
  626. vec3 dpNormalView(vec4 _normal) {
  627. ${m8.instancedDoublePrecision ? "return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);" : "return normalize((viewNormal * _normal).xyz);"}
  628. }
  629. `)), m8.hasVertexTangents && u8.code.add(n5`
  630. vec4 dpTransformVertexTangent(vec4 _tangent) {
  631. ${m8.instancedDoublePrecision ? "return vec4(modelNormal * _tangent.xyz, _tangent.w);" : "return _tangent;"}
  632. }
  633. `);
  634. }
  635. var l2 = n();
  636. // node_modules/@arcgis/core/views/3d/layers/support/symbolColorUtils.js
  637. var r9;
  638. !function(t10) {
  639. t10[t10.Multiply = 1] = "Multiply", t10[t10.Ignore = 2] = "Ignore", t10[t10.Replace = 3] = "Replace", t10[t10.Tint = 4] = "Tint";
  640. }(r9 || (r9 = {}));
  641. var a5 = 85;
  642. var u4 = 2 * a5;
  643. // node_modules/@arcgis/core/views/3d/webgl-engine/collections/Component/Material/shader/DecodeSymbolColor.glsl.js
  644. function e13(e24) {
  645. e24.vertex.code.add(n5`
  646. vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) {
  647. float symbolAlpha = 0.0;
  648. const float maxTint = 85.0;
  649. const float maxReplace = 170.0;
  650. const float scaleAlpha = 3.0;
  651. if (symbolColor.a > maxReplace) {
  652. colorMixMode = ${n5.int(r9.Multiply)};
  653. symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace);
  654. } else if (symbolColor.a > maxTint) {
  655. colorMixMode = ${n5.int(r9.Replace)};
  656. symbolAlpha = scaleAlpha * (symbolColor.a - maxTint);
  657. } else if (symbolColor.a > 0.0) {
  658. colorMixMode = ${n5.int(r9.Tint)};
  659. symbolAlpha = scaleAlpha * symbolColor.a;
  660. } else {
  661. colorMixMode = ${n5.int(r9.Multiply)};
  662. symbolAlpha = 0.0;
  663. }
  664. return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha);
  665. }
  666. `);
  667. }
  668. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js
  669. var e14 = class extends i3 {
  670. constructor(r15, e24) {
  671. super(r15, "int", a3.Pass, (s9, o24, i12) => s9.setUniform1i(r15, e24(o24, i12)));
  672. }
  673. };
  674. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/screenSizePerspectiveUtils.js
  675. function l4(e24) {
  676. return Math.abs(e24 * e24 * e24);
  677. }
  678. function s4(e24, t10, a14) {
  679. const i12 = a14.parameters, r15 = a14.paddingPixelsOverride;
  680. return x.scale = Math.min(i12.divisor / (t10 - i12.offset), 1), x.factor = l4(e24), x.minPixelSize = i12.minPixelSize, x.paddingPixels = r15, x;
  681. }
  682. function c7(e24, t10) {
  683. return e24 === 0 ? t10.minPixelSize : t10.minPixelSize * (1 + 2 * t10.paddingPixels / e24);
  684. }
  685. function o14(t10, a14) {
  686. return Math.max(s3(t10 * a14.scale, t10, a14.factor), c7(t10, a14));
  687. }
  688. function m4(e24, t10, a14, i12) {
  689. return o14(e24, s4(t10, a14, i12));
  690. }
  691. var h2 = { curvatureDependent: { min: { curvature: M(10), tiltAngle: M(12), scaleFallOffFactor: 0.5 }, max: { curvature: M(70), tiltAngle: M(40), scaleFallOffFactor: 0.8 } }, scaleStart: 0.3, scaleFallOffRange: 0.65, minPixelSize: 0 };
  692. var x = { scale: 0, factor: 0, minPixelSize: 0, paddingPixels: 0 };
  693. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/renderers/utils.js
  694. function u6(t10) {
  695. return !!r(t10) && !t10.visible;
  696. }
  697. var g2 = new Float64Array(3);
  698. var b2 = new Float32Array(6);
  699. var j = e5();
  700. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/MaterialUtil.js
  701. var g3 = a2();
  702. function x2(t10, n15, e24, o24, i12, r15, s9) {
  703. if (!u6(n15))
  704. if (t10.boundingInfo) {
  705. e7(t10.primitiveType === c3.Triangle);
  706. const n16 = e24.tolerance;
  707. M2(t10.boundingInfo, o24, i12, n16, r15, s9);
  708. } else {
  709. const n16 = t10.indices.get(O.POSITION), e25 = t10.vertexAttributes.get(O.POSITION);
  710. v2(o24, i12, 0, n16.length / 3, n16, e25, void 0, r15, s9);
  711. }
  712. }
  713. var b3 = n();
  714. function M2(t10, n15, i12, r15, s9, c14) {
  715. if (t(t10))
  716. return;
  717. const f7 = N(n15, i12, b3);
  718. if (q(g3, t10.getBBMin()), w(g3, t10.getBBMax()), r(s9) && s9.applyToAabb(g3), O2(g3, n15, f7, r15)) {
  719. const { primitiveIndices: e24, indices: o24, position: f8 } = t10, a14 = e24 ? e24.length : o24.length / 3;
  720. if (a14 > W2) {
  721. const e25 = t10.getChildren();
  722. if (e25 !== void 0) {
  723. for (let t11 = 0; t11 < 8; ++t11)
  724. e25[t11] !== void 0 && M2(e25[t11], n15, i12, r15, s9, c14);
  725. return;
  726. }
  727. }
  728. v2(n15, i12, 0, a14, o24, f8, e24, s9, c14);
  729. }
  730. }
  731. var y = n();
  732. function v2(t10, n15, e24, i12, r15, s9, c14, f7, a14) {
  733. if (c14)
  734. return I2(t10, n15, e24, i12, r15, s9, c14, f7, a14);
  735. const l8 = s9.data, u8 = s9.stride || s9.size, m8 = t10[0], p4 = t10[1], h8 = t10[2], d8 = n15[0] - m8, g5 = n15[1] - p4, x3 = n15[2] - h8;
  736. for (let b4 = e24, M4 = 3 * e24; b4 < i12; ++b4) {
  737. let t11 = u8 * r15[M4++], n16 = l8[t11++], e25 = l8[t11++], i13 = l8[t11];
  738. t11 = u8 * r15[M4++];
  739. let s10 = l8[t11++], c15 = l8[t11++], v5 = l8[t11];
  740. t11 = u8 * r15[M4++];
  741. let I3 = l8[t11++], T3 = l8[t11++], j4 = l8[t11];
  742. r(f7) && ([n16, e25, i13] = f7.applyToVertex(n16, e25, i13, b4), [s10, c15, v5] = f7.applyToVertex(s10, c15, v5, b4), [I3, T3, j4] = f7.applyToVertex(I3, T3, j4, b4));
  743. const N2 = s10 - n16, O3 = c15 - e25, V2 = v5 - i13, L4 = I3 - n16, S3 = T3 - e25, B3 = j4 - i13, E2 = g5 * B3 - S3 * x3, P3 = x3 * L4 - B3 * d8, U2 = d8 * S3 - L4 * g5, W3 = N2 * E2 + O3 * P3 + V2 * U2;
  744. if (Math.abs(W3) <= Number.EPSILON)
  745. continue;
  746. const z2 = m8 - n16, k2 = p4 - e25, R = h8 - i13, C2 = z2 * E2 + k2 * P3 + R * U2;
  747. if (W3 > 0) {
  748. if (C2 < 0 || C2 > W3)
  749. continue;
  750. } else if (C2 > 0 || C2 < W3)
  751. continue;
  752. const H2 = k2 * V2 - O3 * R, X = R * N2 - V2 * z2, Y = z2 * O3 - N2 * k2, Z = d8 * H2 + g5 * X + x3 * Y;
  753. if (W3 > 0) {
  754. if (Z < 0 || C2 + Z > W3)
  755. continue;
  756. } else if (Z > 0 || C2 + Z < W3)
  757. continue;
  758. const _3 = (L4 * H2 + S3 * X + B3 * Y) / W3;
  759. if (_3 >= 0) {
  760. a14(_3, A(N2, O3, V2, L4, S3, B3, y), b4, false);
  761. }
  762. }
  763. }
  764. function I2(t10, n15, e24, i12, r15, s9, c14, f7, a14) {
  765. const l8 = s9.data, u8 = s9.stride || s9.size, m8 = t10[0], p4 = t10[1], h8 = t10[2], d8 = n15[0] - m8, g5 = n15[1] - p4, x3 = n15[2] - h8;
  766. for (let b4 = e24; b4 < i12; ++b4) {
  767. const t11 = c14[b4];
  768. let n16 = 3 * t11, e25 = u8 * r15[n16++], i13 = l8[e25++], s10 = l8[e25++], M4 = l8[e25];
  769. e25 = u8 * r15[n16++];
  770. let v5 = l8[e25++], I3 = l8[e25++], T3 = l8[e25];
  771. e25 = u8 * r15[n16];
  772. let j4 = l8[e25++], N2 = l8[e25++], O3 = l8[e25];
  773. r(f7) && ([i13, s10, M4] = f7.applyToVertex(i13, s10, M4, b4), [v5, I3, T3] = f7.applyToVertex(v5, I3, T3, b4), [j4, N2, O3] = f7.applyToVertex(j4, N2, O3, b4));
  774. const V2 = v5 - i13, L4 = I3 - s10, S3 = T3 - M4, B3 = j4 - i13, E2 = N2 - s10, P3 = O3 - M4, U2 = g5 * P3 - E2 * x3, W3 = x3 * B3 - P3 * d8, z2 = d8 * E2 - B3 * g5, k2 = V2 * U2 + L4 * W3 + S3 * z2;
  775. if (Math.abs(k2) <= Number.EPSILON)
  776. continue;
  777. const R = m8 - i13, C2 = p4 - s10, H2 = h8 - M4, X = R * U2 + C2 * W3 + H2 * z2;
  778. if (k2 > 0) {
  779. if (X < 0 || X > k2)
  780. continue;
  781. } else if (X > 0 || X < k2)
  782. continue;
  783. const Y = C2 * S3 - L4 * H2, Z = H2 * V2 - S3 * R, _3 = R * L4 - V2 * C2, q3 = d8 * Y + g5 * Z + x3 * _3;
  784. if (k2 > 0) {
  785. if (q3 < 0 || X + q3 > k2)
  786. continue;
  787. } else if (q3 > 0 || X + q3 < k2)
  788. continue;
  789. const w2 = (B3 * Y + E2 * Z + P3 * _3) / k2;
  790. if (w2 >= 0) {
  791. a14(w2, A(V2, L4, S3, B3, E2, P3, y), t11, false);
  792. }
  793. }
  794. }
  795. var T2 = n();
  796. var j2 = n();
  797. function A(t10, n15, e24, o24, c14, f7, a14) {
  798. return o(T2, t10, n15, e24), o(j2, o24, c14, f7), _(a14, T2, j2), z(a14, a14), a14;
  799. }
  800. function N(t10, n15, e24) {
  801. return o(e24, 1 / (n15[0] - t10[0]), 1 / (n15[1] - t10[1]), 1 / (n15[2] - t10[2]));
  802. }
  803. function O2(t10, n15, e24, o24) {
  804. return V(t10, n15, e24, o24, 1 / 0);
  805. }
  806. function V(t10, n15, e24, o24, i12) {
  807. const r15 = (t10[0] - o24 - n15[0]) * e24[0], s9 = (t10[3] + o24 - n15[0]) * e24[0];
  808. let c14 = Math.min(r15, s9), f7 = Math.max(r15, s9);
  809. const a14 = (t10[1] - o24 - n15[1]) * e24[1], l8 = (t10[4] + o24 - n15[1]) * e24[1];
  810. if (f7 = Math.min(f7, Math.max(a14, l8)), f7 < 0)
  811. return false;
  812. if (c14 = Math.max(c14, Math.min(a14, l8)), c14 > f7)
  813. return false;
  814. const u8 = (t10[2] - o24 - n15[2]) * e24[2], m8 = (t10[5] + o24 - n15[2]) * e24[2];
  815. return f7 = Math.min(f7, Math.max(u8, m8)), !(f7 < 0) && (c14 = Math.max(c14, Math.min(u8, m8)), !(c14 > f7) && c14 < i12);
  816. }
  817. function L3(t10, e24, i12, r15, s9) {
  818. let c14 = (i12.screenLength || 0) * t10.pixelRatio;
  819. r(s9) && (c14 = m4(c14, r15, e24, s9));
  820. const f7 = c14 * Math.tan(0.5 * t10.fovY) / (0.5 * t10.fullHeight);
  821. return o2(f7 * e24, i12.minWorldLength || 0, i12.maxWorldLength != null ? i12.maxWorldLength : 1 / 0);
  822. }
  823. function S2(t10, n15) {
  824. const e24 = n15 ? S2(n15) : {};
  825. for (const o24 in t10) {
  826. let n16 = t10[o24];
  827. n16 && n16.forEach && (n16 = P(n16)), n16 == null && o24 in e24 || (e24[o24] = n16);
  828. }
  829. return e24;
  830. }
  831. function B2(n15, e24) {
  832. let o24 = false;
  833. for (const i12 in e24) {
  834. const r15 = e24[i12];
  835. r15 !== void 0 && (Array.isArray(r15) ? n15[i12] === null ? (n15[i12] = r15.slice(), o24 = true) : c(n15[i12], r15) && (o24 = true) : n15[i12] !== r15 && (o24 = true, n15[i12] = r15));
  836. }
  837. return o24;
  838. }
  839. function P(t10) {
  840. const n15 = [];
  841. return t10.forEach((t11) => n15.push(t11)), n15;
  842. }
  843. var U = { multiply: 1, ignore: 2, replace: 3, tint: 4 };
  844. var W2 = 1e3;
  845. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js
  846. function i5(i12, t10) {
  847. t10.hasSymbolColors ? (i12.include(e13), i12.attributes.add(O.SYMBOLCOLOR, "vec4"), i12.varyings.add("colorMixMode", "mediump float"), i12.vertex.code.add(n5`int symbolColorMixMode;
  848. vec4 getSymbolColor() {
  849. return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451;
  850. }
  851. void forwardColorMixMode() {
  852. colorMixMode = float(symbolColorMixMode) + 0.5;
  853. }`)) : (i12.fragment.uniforms.add(new e14("colorMixMode", (o24) => U[o24.colorMixMode])), i12.vertex.code.add(n5`vec4 getSymbolColor() { return vec4(1.0); }
  854. void forwardColorMixMode() {}`));
  855. }
  856. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js
  857. function e15(e24, d8) {
  858. d8.hasVertexColors ? (e24.attributes.add(O.COLOR, "vec4"), e24.varyings.add("vColor", "vec4"), e24.vertex.code.add(n5`void forwardVertexColor() { vColor = color; }`), e24.vertex.code.add(n5`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)) : e24.vertex.code.add(n5`void forwardVertexColor() {}
  859. void forwardNormalizedVertexColor() {}`);
  860. }
  861. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4PassUniform.js
  862. var e16 = class extends i3 {
  863. constructor(r15, e24) {
  864. super(r15, "vec4", a3.Pass, (s9, o24, t10) => s9.setUniform4fv(r15, e24(o24, t10)));
  865. }
  866. };
  867. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4DrawUniform.js
  868. var o16 = class extends i3 {
  869. constructor(r15, o24) {
  870. super(r15, "mat4", a3.Draw, (e24, s9, t10) => e24.setUniformMatrix4fv(r15, o24(s9, t10)));
  871. }
  872. };
  873. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js
  874. function c8(r15, e24) {
  875. e24.instancedDoublePrecision ? r15.constants.add("cameraPosition", "vec3", f) : r15.uniforms.add(new o8("cameraPosition", (r16, e25) => o(f4, e25.camera.viewInverseTransposeMatrix[3] - r16.origin[0], e25.camera.viewInverseTransposeMatrix[7] - r16.origin[1], e25.camera.viewInverseTransposeMatrix[11] - r16.origin[2])));
  876. }
  877. function d3(e24, i12) {
  878. if (e24.vertex.uniforms.add(new e10("proj", (r15, e25) => e25.camera.projectionMatrix)), i12.instancedDoublePrecision) {
  879. const i13 = (r15, e25) => o(f4, e25.camera.viewInverseTransposeMatrix[3], e25.camera.viewInverseTransposeMatrix[7], e25.camera.viewInverseTransposeMatrix[11]);
  880. e24.vertex.uniforms.add(new e10("view", (e25, a14) => c2(v3, a14.camera.viewMatrix, i13(e25, a14))));
  881. const s10 = new e8("localOrigin", i13);
  882. return e24.vertex.uniforms.add(s10), s10;
  883. }
  884. e24.vertex.uniforms.add(new o16("view", (e25, a14) => c2(v3, a14.camera.viewMatrix, e25.origin)));
  885. const s9 = new o8("localOrigin", (r15) => r15.origin);
  886. return e24.vertex.uniforms.add(s9), s9;
  887. }
  888. var v3 = e6();
  889. var f4 = n();
  890. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js
  891. function c9(e24) {
  892. e24.vertex.code.add(n5`float screenSizePerspectiveMinSize(float size, vec4 factor) {
  893. float nonZeroSize = 1.0 - step(size, 0.0);
  894. return (
  895. factor.z * (
  896. 1.0 +
  897. nonZeroSize *
  898. 2.0 * factor.w / (
  899. size + (1.0 - nonZeroSize)
  900. )
  901. )
  902. );
  903. }`), e24.vertex.code.add(n5`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
  904. return absCosAngle * absCosAngle * absCosAngle;
  905. }`), e24.vertex.code.add(n5`vec4 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec4 params) {
  906. return vec4(
  907. min(params.x / (distanceToCamera - params.y), 1.0),
  908. screenSizePerspectiveViewAngleDependentFactor(absCosAngle),
  909. params.z,
  910. params.w
  911. );
  912. }`), e24.vertex.code.add(n5`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec4 factor) {
  913. return max(mix(size * factor.x, size, factor.y), screenSizePerspectiveMinSize(size, factor));
  914. }`), e24.vertex.code.add(n5`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec4 params) {
  915. return applyScreenSizePerspectiveScaleFactorFloat(
  916. size,
  917. screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
  918. );
  919. }`), e24.vertex.code.add(n5`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec4 factor) {
  920. return mix(size * clamp(factor.x, screenSizePerspectiveMinSize(size.y, factor) / max(1e-5, size.y), 1.0), size, factor.y);
  921. }`), e24.vertex.code.add(n5`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec4 params) {
  922. return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
  923. }`);
  924. }
  925. function i6(e24) {
  926. e24.uniforms.add(new e16("screenSizePerspectiveAlignment", (e25) => o17(e25.screenSizePerspectiveAlignment || e25.screenSizePerspective)));
  927. }
  928. function o17(a14) {
  929. return r2(n9, a14.parameters.divisor, a14.parameters.offset, a14.parameters.minPixelSize, a14.paddingPixelsOverride);
  930. }
  931. var n9 = n2();
  932. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js
  933. function a6(e24, r15) {
  934. const c14 = e24.vertex;
  935. r15.hasVerticalOffset ? (f5(c14), r15.hasScreenSizePerspective && (e24.include(c9), i6(c14), c8(e24.vertex, r15)), c14.code.add(n5`
  936. vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) {
  937. float viewDistance = length((view * vec4(worldPos, 1.0)).xyz);
  938. ${r15.spherical ? n5`vec3 worldNormal = normalize(worldPos + localOrigin);` : n5`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`}
  939. ${r15.hasScreenSizePerspective ? n5`
  940. float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition));
  941. float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);` : n5`
  942. float verticalOffsetScreenHeight = verticalOffset.x;`}
  943. // Screen sized offset in world space, used for example for line callouts
  944. float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w);
  945. return worldNormal * worldOffset;
  946. }
  947. vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) {
  948. return worldPos + calculateVerticalOffset(worldPos, localOrigin);
  949. }
  950. `)) : c14.code.add(n5`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`);
  951. }
  952. var i7 = n2();
  953. function f5(r15) {
  954. r15.uniforms.add(new e16("verticalOffset", (r16, t10) => {
  955. const { minWorldLength: l8, maxWorldLength: o24, screenLength: c14 } = r16.verticalOffset, s9 = Math.tan(0.5 * t10.camera.fovY) / (0.5 * t10.camera.fullViewport[3]), a14 = t10.camera.pixelRatio || 1;
  956. return r2(i7, c14 * a14, s9, l8, o24);
  957. }));
  958. }
  959. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Float4sPassUniform.js
  960. var e17 = class extends i3 {
  961. constructor(r15, e24, o24) {
  962. super(r15, "vec4", a3.Pass, (s9, o25, t10) => s9.setUniform4fv(r15, e24(o25, t10)), o24);
  963. }
  964. };
  965. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js
  966. var o18 = class extends i3 {
  967. constructor(r15, o24, e24) {
  968. super(r15, "float", a3.Pass, (s9, e25, t10) => s9.setUniform1fv(r15, o24(e25, t10)), e24);
  969. }
  970. };
  971. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObject.js
  972. var r10 = class {
  973. constructor() {
  974. this.id = e2();
  975. }
  976. unload() {
  977. }
  978. };
  979. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/ContentObjectType.js
  980. var e18;
  981. !function(e24) {
  982. e24[e24.Layer = 0] = "Layer", e24[e24.Object = 1] = "Object", e24[e24.Geometry = 2] = "Geometry", e24[e24.Material = 3] = "Material", e24[e24.Texture = 4] = "Texture", e24[e24.COUNT = 5] = "COUNT";
  983. }(e18 || (e18 = {}));
  984. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js
  985. var E = new Map([[O.POSITION, 0], [O.NORMAL, 1], [O.UV0, 2], [O.COLOR, 3], [O.SIZE, 4], [O.TANGENT, 4], [O.AUXPOS1, 5], [O.SYMBOLCOLOR, 5], [O.AUXPOS2, 6], [O.FEATUREATTRIBUTE, 6], [O.INSTANCEFEATUREATTRIBUTE, 6], [O.INSTANCECOLOR, 7], [O.MODEL, 8], [O.MODELNORMAL, 12], [O.MODELORIGINHI, 11], [O.MODELORIGINLO, 15]]);
  986. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Material.js
  987. var d4 = class extends r10 {
  988. constructor(e24, r15) {
  989. super(), this.type = e18.Material, this.supportsEdges = false, this._visible = true, this._renderPriority = 0, this._insertOrder = 0, this._vertexAttributeLocations = E, this._parameters = S2(e24, r15), this.validateParameters(this._parameters);
  990. }
  991. dispose() {
  992. }
  993. get parameters() {
  994. return this._parameters;
  995. }
  996. update(e24) {
  997. return false;
  998. }
  999. setParameters(e24, r15 = true) {
  1000. B2(this._parameters, e24) && (this.validateParameters(this._parameters), r15 && this.parametersChanged());
  1001. }
  1002. validateParameters(e24) {
  1003. }
  1004. get visible() {
  1005. return this._visible;
  1006. }
  1007. set visible(e24) {
  1008. e24 !== this._visible && (this._visible = e24, this.parametersChanged());
  1009. }
  1010. shouldRender(e24) {
  1011. return this.isVisible() && this.isVisibleInPass(e24.pass) && (this.renderOccluded & e24.renderOccludedMask) != 0;
  1012. }
  1013. isVisibleInPass(e24) {
  1014. return true;
  1015. }
  1016. get renderOccluded() {
  1017. return this.parameters.renderOccluded;
  1018. }
  1019. get renderPriority() {
  1020. return this._renderPriority;
  1021. }
  1022. set renderPriority(e24) {
  1023. e24 !== this._renderPriority && (this._renderPriority = e24, this.parametersChanged());
  1024. }
  1025. get insertOrder() {
  1026. return this._insertOrder;
  1027. }
  1028. set insertOrder(e24) {
  1029. e24 !== this._insertOrder && (this._insertOrder = e24, this.parametersChanged());
  1030. }
  1031. get vertexAttributeLocations() {
  1032. return this._vertexAttributeLocations;
  1033. }
  1034. isVisible() {
  1035. return this._visible;
  1036. }
  1037. parametersChanged() {
  1038. r(this.repository) && this.repository.materialChanged(this);
  1039. }
  1040. };
  1041. var h5;
  1042. !function(e24) {
  1043. e24[e24.Occlude = 1] = "Occlude", e24[e24.Transparent = 2] = "Transparent", e24[e24.OccludeAndTransparent = 4] = "OccludeAndTransparent", e24[e24.OccludeAndTransparentStencil = 8] = "OccludeAndTransparentStencil", e24[e24.Opaque = 16] = "Opaque";
  1044. }(h5 || (h5 = {}));
  1045. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/VisualVariablePassParameters.js
  1046. var o20 = 8;
  1047. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js
  1048. function s5(s9, n15) {
  1049. n15.hasVvInstancing && (n15.vvSize || n15.vvColor) && s9.attributes.add(O.INSTANCEFEATUREATTRIBUTE, "vec4");
  1050. const l8 = s9.vertex;
  1051. n15.vvSize ? (l8.uniforms.add(new e8("vvSizeMinSize", (e24) => e24.vvSizeMinSize)), l8.uniforms.add(new e8("vvSizeMaxSize", (e24) => e24.vvSizeMaxSize)), l8.uniforms.add(new e8("vvSizeOffset", (e24) => e24.vvSizeOffset)), l8.uniforms.add(new e8("vvSizeFactor", (e24) => e24.vvSizeFactor)), l8.uniforms.add(new e11("vvSymbolRotationMatrix", (e24) => e24.vvSymbolRotationMatrix)), l8.uniforms.add(new e8("vvSymbolAnchor", (e24) => e24.vvSymbolAnchor)), l8.code.add(n5`vec3 vvScale(vec4 _featureAttribute) {
  1052. return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize);
  1053. }
  1054. vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) {
  1055. return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0);
  1056. }`), l8.code.add(n5`
  1057. const float eps = 1.192092896e-07;
  1058. vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) {
  1059. vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize);
  1060. return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0);
  1061. }
  1062. ${n15.hasVvInstancing ? n5`
  1063. vec4 vvLocalNormal(vec3 _normal) {
  1064. return vvTransformNormal(_normal, instanceFeatureAttribute);
  1065. }
  1066. vec4 localPosition() {
  1067. return vvTransformPosition(position, instanceFeatureAttribute);
  1068. }` : ""}
  1069. `)) : l8.code.add(n5`vec4 localPosition() { return vec4(position, 1.0); }
  1070. vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`), n15.vvColor ? (l8.constants.add("vvColorNumber", "int", o20), n15.hasVvInstancing && l8.uniforms.add([new o18("vvColorValues", (e24) => e24.vvColorValues, o20), new e17("vvColorColors", (e24) => e24.vvColorColors, o20)]), l8.code.add(n5`
  1071. vec4 vvGetColor(vec4 featureAttribute, float values[vvColorNumber], vec4 colors[vvColorNumber]) {
  1072. float value = featureAttribute.y;
  1073. if (value <= values[0]) {
  1074. return colors[0];
  1075. }
  1076. for (int i = 1; i < vvColorNumber; ++i) {
  1077. if (values[i] >= value) {
  1078. float f = (value - values[i-1]) / (values[i] - values[i-1]);
  1079. return mix(colors[i-1], colors[i], f);
  1080. }
  1081. }
  1082. return colors[vvColorNumber - 1];
  1083. }
  1084. ${n15.hasVvInstancing ? n5`
  1085. vec4 vvColor() {
  1086. return vvGetColor(instanceFeatureAttribute, vvColorValues, vvColorColors);
  1087. }` : ""}
  1088. `)) : l8.code.add(n5`vec4 vvColor() { return vec4(1.0); }`);
  1089. }
  1090. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js
  1091. var o21 = class extends i3 {
  1092. constructor(r15, o24) {
  1093. super(r15, "float", a3.Pass, (s9, e24, t10) => s9.setUniform1f(r15, o24(e24, t10)));
  1094. }
  1095. };
  1096. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlphaBlend.glsl.js
  1097. function d5(d8) {
  1098. d8.fragment.code.add(n5`
  1099. #define discardOrAdjustAlpha(color) { if (color.a < ${n5.float(t5)}) { discard; } }
  1100. `);
  1101. }
  1102. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/AlphaDiscard.glsl.js
  1103. function s6(a14, e24) {
  1104. l5(a14, e24, new o21("textureAlphaCutoff", (a15) => a15.textureAlphaCutoff));
  1105. }
  1106. function l5(e24, r15, s9) {
  1107. const t10 = e24.fragment;
  1108. switch (r15.alphaDiscardMode !== C.Mask && r15.alphaDiscardMode !== C.MaskBlend || t10.uniforms.add(s9), r15.alphaDiscardMode) {
  1109. case C.Blend:
  1110. return e24.include(d5);
  1111. case C.Opaque:
  1112. t10.code.add(n5`void discardOrAdjustAlpha(inout vec4 color) {
  1113. color.a = 1.0;
  1114. }`);
  1115. break;
  1116. case C.Mask:
  1117. t10.code.add(n5`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);
  1118. break;
  1119. case C.MaskBlend:
  1120. e24.fragment.code.add(n5`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`);
  1121. }
  1122. }
  1123. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/RgbaFloatEncoding.glsl.js
  1124. function a7(a14) {
  1125. a14.code.add(n5`const float MAX_RGBA_FLOAT =
  1126. 255.0 / 256.0 +
  1127. 255.0 / 256.0 / 256.0 +
  1128. 255.0 / 256.0 / 256.0 / 256.0 +
  1129. 255.0 / 256.0 / 256.0 / 256.0 / 256.0;
  1130. const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0);
  1131. vec4 float2rgba(const float value) {
  1132. float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT);
  1133. vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0);
  1134. const float toU8AsFloat = 1.0 / 255.0;
  1135. return fixedPointU8 * toU8AsFloat;
  1136. }
  1137. const vec4 RGBA_2_FLOAT_FACTORS = vec4(
  1138. 255.0 / (256.0),
  1139. 255.0 / (256.0 * 256.0),
  1140. 255.0 / (256.0 * 256.0 * 256.0),
  1141. 255.0 / (256.0 * 256.0 * 256.0 * 256.0)
  1142. );
  1143. float rgba2float(vec4 rgba) {
  1144. return dot(rgba, RGBA_2_FLOAT_FACTORS);
  1145. }`);
  1146. }
  1147. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js
  1148. function e20(e24, l8) {
  1149. e24.fragment.include(a7), l8.output === o4.Shadow ? (e24.extensions.add("GL_OES_standard_derivatives"), e24.fragment.code.add(n5`float _calculateFragDepth(const in float depth) {
  1150. const float SLOPE_SCALE = 2.0;
  1151. const float BIAS = 2.0 * .000015259;
  1152. float m = max(abs(dFdx(depth)), abs(dFdy(depth)));
  1153. float result = depth + SLOPE_SCALE * m + BIAS;
  1154. return clamp(result, .0, .999999);
  1155. }
  1156. void outputDepth(float _linearDepth) {
  1157. gl_FragColor = float2rgba(_calculateFragDepth(_linearDepth));
  1158. }`)) : l8.output === o4.Depth && e24.fragment.code.add(n5`void outputDepth(float _linearDepth) {
  1159. gl_FragColor = float2rgba(_linearDepth);
  1160. }`);
  1161. }
  1162. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js
  1163. var d6 = r3(1, 1, 0, 1);
  1164. var g4 = r3(1, 0, 1, 1);
  1165. function a8(e24) {
  1166. e24.fragment.uniforms.add(new c4("depthTex", (e25, o24) => o24.highlightDepthTexture)), e24.fragment.uniforms.add(new e9("highlightViewportPixelSz", (e25, o24) => o24.inverseViewport)), e24.fragment.constants.add("occludedHighlightFlag", "vec4", d6).add("unoccludedHighlightFlag", "vec4", g4), e24.fragment.code.add(n5`void outputHighlight() {
  1167. vec4 fragCoord = gl_FragCoord;
  1168. float sceneDepth = texture2D(depthTex, fragCoord.xy * highlightViewportPixelSz.xy).r;
  1169. if (fragCoord.z > sceneDepth + 5e-7) {
  1170. gl_FragColor = occludedHighlightFlag;
  1171. }
  1172. else {
  1173. gl_FragColor = unoccludedHighlightFlag;
  1174. }
  1175. }`);
  1176. }
  1177. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js
  1178. function f6(f7, h8) {
  1179. const g5 = f7.vertex.code, x3 = f7.fragment.code, j4 = h8.hasModelTransformation;
  1180. h8.output !== o4.Depth && h8.output !== o4.Shadow || (d3(f7, h8), f7.include(r8, { linearDepth: true, hasModelTransformation: j4 }), f7.include(d, h8), f7.include(s5, h8), f7.include(e20, h8), f7.include(u3, h8), f7.vertex.uniforms.add(new e9("nearFar", (o24, r15) => r15.camera.nearFar)), f7.varyings.add("depth", "float"), h8.hasColorTexture && f7.fragment.uniforms.add(new c4("tex", (o24) => o24.texture)), g5.add(n5`
  1181. void main(void) {
  1182. vpos = calculateVPos();
  1183. vpos = subtractOrigin(vpos);
  1184. vpos = addVerticalOffset(vpos, localOrigin);
  1185. gl_Position = transformPositionWithDepth(proj, view, ${j4 ? "model," : ""} vpos, nearFar, depth);
  1186. forwardTextureCoordinates();
  1187. }
  1188. `), f7.include(s6, h8), x3.add(n5`
  1189. void main(void) {
  1190. discardBySlice(vpos);
  1191. ${h8.hasColorTexture ? n5`
  1192. vec4 texColor = texture2D(tex, vuv0);
  1193. discardOrAdjustAlpha(texColor);` : ""}
  1194. outputDepth(depth);
  1195. }
  1196. `)), h8.output === o4.Normal && (d3(f7, h8), f7.include(r8, { linearDepth: false, hasModelTransformation: j4 }), f7.include(o6, h8), f7.include(n7, h8), f7.include(d, h8), f7.include(s5, h8), h8.hasColorTexture && f7.fragment.uniforms.add(new c4("tex", (o24) => o24.texture)), f7.varyings.add("vPositionView", "vec3"), g5.add(n5`
  1197. void main(void) {
  1198. vpos = calculateVPos();
  1199. vpos = subtractOrigin(vpos);
  1200. ${h8.normalType === i2.Attribute ? n5`
  1201. vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));` : ""}
  1202. vpos = addVerticalOffset(vpos, localOrigin);
  1203. gl_Position = transformPosition(proj, view, ${j4 ? "model," : ""} vpos);
  1204. forwardTextureCoordinates();
  1205. }
  1206. `), f7.include(u3, h8), f7.include(s6, h8), x3.add(n5`
  1207. void main() {
  1208. discardBySlice(vpos);
  1209. ${h8.hasColorTexture ? n5`
  1210. vec4 texColor = texture2D(tex, vuv0);
  1211. discardOrAdjustAlpha(texColor);` : ""}
  1212. ${h8.normalType === i2.ScreenDerivative ? n5`
  1213. vec3 normal = screenDerivativeNormal(vPositionView);` : n5`
  1214. vec3 normal = normalize(vNormalWorld);
  1215. if (gl_FrontFacing == false) normal = -normal;`}
  1216. gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);
  1217. }
  1218. `)), h8.output === o4.Highlight && (d3(f7, h8), f7.include(r8, { linearDepth: false, hasModelTransformation: j4 }), f7.include(d, h8), f7.include(s5, h8), h8.hasColorTexture && f7.fragment.uniforms.add(new c4("tex", (o24) => o24.texture)), g5.add(n5`
  1219. void main(void) {
  1220. vpos = calculateVPos();
  1221. vpos = subtractOrigin(vpos);
  1222. vpos = addVerticalOffset(vpos, localOrigin);
  1223. gl_Position = transformPosition(proj, view, ${j4 ? "model," : ""} vpos);
  1224. forwardTextureCoordinates();
  1225. }
  1226. `), f7.include(u3, h8), f7.include(s6, h8), f7.include(a8), x3.add(n5`
  1227. void main() {
  1228. discardBySlice(vpos);
  1229. ${h8.hasColorTexture ? n5`
  1230. vec4 texColor = texture2D(tex, vuv0);
  1231. discardOrAdjustAlpha(texColor);` : ""}
  1232. outputHighlight();
  1233. }
  1234. `));
  1235. }
  1236. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js
  1237. function a9(o24, a14) {
  1238. const l8 = o24.fragment;
  1239. a14.receiveAmbientOcclusion ? (l8.uniforms.add([new c4("ssaoTex", (e24, o25) => o25.ssaoHelper.colorTexture), new e16("viewportPixelSz", (o25, r15) => r2(i8, r15.camera.fullViewport[0], r15.camera.fullViewport[1], 1 / r15.ssaoHelper.width, 1 / r15.ssaoHelper.height))]), l8.code.add(n5`float evaluateAmbientOcclusion() {
  1240. return 1.0 - texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;
  1241. }
  1242. float evaluateAmbientOcclusionInverse() {
  1243. return texture2D(ssaoTex, (gl_FragCoord.xy - viewportPixelSz.xy) * viewportPixelSz.zw).a;
  1244. }`)) : l8.code.add(n5`float evaluateAmbientOcclusion() { return 0.0; }
  1245. float evaluateAmbientOcclusionInverse() { return 1.0; }`);
  1246. }
  1247. var i8 = n2();
  1248. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js
  1249. function t8(t10) {
  1250. const a14 = t10.fragment.code;
  1251. a14.add(n5`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG)
  1252. {
  1253. return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5;
  1254. }`), a14.add(n5`float integratedRadiance(float cosTheta2, float roughness)
  1255. {
  1256. return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0);
  1257. }`), a14.add(n5`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness)
  1258. {
  1259. float cosTheta2 = 1.0 - RdotNG * RdotNG;
  1260. float intRadTheta = integratedRadiance(cosTheta2, roughness);
  1261. float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta;
  1262. float sky = 2.0 - ground;
  1263. return (ground * ambientGround + sky * ambientSky) * 0.5;
  1264. }`);
  1265. }
  1266. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js
  1267. function t9(t10) {
  1268. t10.vertex.code.add(n5`const float PI = 3.141592653589793;`), t10.fragment.code.add(n5`const float PI = 3.141592653589793;
  1269. const float LIGHT_NORMALIZATION = 1.0 / PI;
  1270. const float INV_PI = 0.3183098861837907;
  1271. const float HALF_PI = 1.570796326794897;`);
  1272. }
  1273. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js
  1274. function n10(n15, r15) {
  1275. const l8 = n15.fragment.code;
  1276. n15.include(t9), r15.pbrMode === l.Water || r15.pbrMode === l.WaterOnIntegratedMesh ? (l8.add(n5`
  1277. struct PBRShadingWater
  1278. {
  1279. float NdotL; // cos angle between normal and light direction
  1280. float NdotV; // cos angle between normal and view direction
  1281. float NdotH; // cos angle between normal and half vector
  1282. float VdotH; // cos angle between view direction and half vector
  1283. float LdotH; // cos angle between light direction and half vector
  1284. float VdotN; // cos angle between view direction and normal vector
  1285. };
  1286. float dtrExponent = ${r15.useCustomDTRExponentForWater ? "2.2" : "2.0"};
  1287. `), l8.add(n5`vec3 fresnelReflection(float angle, vec3 f0, float f90) {
  1288. return f0 + (f90 - f0) * pow(1.0 - angle, 5.0);
  1289. }`), l8.add(n5`float normalDistributionWater(float NdotH, float roughness)
  1290. {
  1291. float r2 = roughness * roughness;
  1292. float NdotH2 = NdotH * NdotH;
  1293. float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI;
  1294. return r2 / denom;
  1295. }`), l8.add(n5`float geometricOcclusionKelemen(float LoH)
  1296. {
  1297. return 0.25 / (LoH * LoH);
  1298. }`), l8.add(n5`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max)
  1299. {
  1300. vec3 F = fresnelReflection(props.VdotH, F0, F0Max);
  1301. float dSun = normalDistributionWater(props.NdotH, roughness);
  1302. float V = geometricOcclusionKelemen(props.LdotH);
  1303. float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH);
  1304. float strengthSunHaze = 1.2;
  1305. float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze;
  1306. return ((dSun + dSunHaze) * V) * F;
  1307. }
  1308. vec3 tonemapACES(const vec3 x) {
  1309. return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
  1310. }`)) : r15.pbrMode !== l.Normal && r15.pbrMode !== l.Schematic || (n15.include(t8), l8.add(n5`struct PBRShadingInfo
  1311. {
  1312. float NdotL;
  1313. float NdotV;
  1314. float NdotH;
  1315. float VdotH;
  1316. float LdotH;
  1317. float NdotNG;
  1318. float RdotNG;
  1319. float NdotAmbDir;
  1320. float NdotH_Horizon;
  1321. vec3 skyRadianceToSurface;
  1322. vec3 groundRadianceToSurface;
  1323. vec3 skyIrradianceToSurface;
  1324. vec3 groundIrradianceToSurface;
  1325. float averageAmbientRadiance;
  1326. float ssao;
  1327. vec3 albedoLinear;
  1328. vec3 f0;
  1329. vec3 f90;
  1330. vec3 diffuseColor;
  1331. float metalness;
  1332. float roughness;
  1333. };`), l8.add(n5`float normalDistribution(float NdotH, float roughness)
  1334. {
  1335. float a = NdotH * roughness;
  1336. float b = roughness / (1.0 - NdotH * NdotH + a * a);
  1337. return b * b * INV_PI;
  1338. }`), l8.add(n5`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
  1339. const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040);
  1340. const vec2 c2 = vec2(-1.04, 1.04);
  1341. vec2 prefilteredDFGAnalytical(float roughness, float NdotV) {
  1342. vec4 r = roughness * c0 + c1;
  1343. float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y;
  1344. return c2 * a004 + r.zw;
  1345. }`), l8.add(n5`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) {
  1346. vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG);
  1347. vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness);
  1348. vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI;
  1349. vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV);
  1350. vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y;
  1351. vec3 specularComponent = specularColor * indirectSpecular;
  1352. return (diffuseComponent + specularComponent);
  1353. }`), l8.add(n5`float gamutMapChanel(float x, vec2 p){
  1354. return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) );
  1355. }`), l8.add(n5`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){
  1356. vec3 outColor;
  1357. vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance));
  1358. outColor.x = gamutMapChanel(inColor.x, p) ;
  1359. outColor.y = gamutMapChanel(inColor.y, p) ;
  1360. outColor.z = gamutMapChanel(inColor.z, p) ;
  1361. return outColor;
  1362. }`));
  1363. }
  1364. // node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SphericalHarmonics.js
  1365. var P2 = n();
  1366. // node_modules/@arcgis/core/views/3d/webgl-engine/lighting/SceneLighting.js
  1367. var c11 = 0.4;
  1368. var a10 = n();
  1369. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js
  1370. function m5(n15, g5) {
  1371. const m8 = n15.fragment, o24 = g5.lightingSphericalHarmonicsOrder !== void 0 ? g5.lightingSphericalHarmonicsOrder : 2;
  1372. o24 === 0 ? (m8.uniforms.add(new e8("lightingAmbientSH0", (n16, t10) => o(a11, t10.lighting.sh.r[0], t10.lighting.sh.g[0], t10.lighting.sh.b[0]))), m8.code.add(n5`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
  1373. vec3 ambientLight = 0.282095 * lightingAmbientSH0;
  1374. return ambientLight * (1.0 - ambientOcclusion);
  1375. }`)) : o24 === 1 ? (m8.uniforms.add([new e16("lightingAmbientSH_R", (i12, n16) => r2(r14, n16.lighting.sh.r[0], n16.lighting.sh.r[1], n16.lighting.sh.r[2], n16.lighting.sh.r[3])), new e16("lightingAmbientSH_G", (i12, n16) => r2(r14, n16.lighting.sh.g[0], n16.lighting.sh.g[1], n16.lighting.sh.g[2], n16.lighting.sh.g[3])), new e16("lightingAmbientSH_B", (i12, n16) => r2(r14, n16.lighting.sh.b[0], n16.lighting.sh.b[1], n16.lighting.sh.b[2], n16.lighting.sh.b[3]))]), m8.code.add(n5`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
  1376. vec4 sh0 = vec4(
  1377. 0.282095,
  1378. 0.488603 * normal.x,
  1379. 0.488603 * normal.z,
  1380. 0.488603 * normal.y
  1381. );
  1382. vec3 ambientLight = vec3(
  1383. dot(lightingAmbientSH_R, sh0),
  1384. dot(lightingAmbientSH_G, sh0),
  1385. dot(lightingAmbientSH_B, sh0)
  1386. );
  1387. return ambientLight * (1.0 - ambientOcclusion);
  1388. }`)) : o24 === 2 && (m8.uniforms.add([new e8("lightingAmbientSH0", (n16, t10) => o(a11, t10.lighting.sh.r[0], t10.lighting.sh.g[0], t10.lighting.sh.b[0])), new e16("lightingAmbientSH_R1", (i12, n16) => r2(r14, n16.lighting.sh.r[1], n16.lighting.sh.r[2], n16.lighting.sh.r[3], n16.lighting.sh.r[4])), new e16("lightingAmbientSH_G1", (i12, n16) => r2(r14, n16.lighting.sh.g[1], n16.lighting.sh.g[2], n16.lighting.sh.g[3], n16.lighting.sh.g[4])), new e16("lightingAmbientSH_B1", (i12, n16) => r2(r14, n16.lighting.sh.b[1], n16.lighting.sh.b[2], n16.lighting.sh.b[3], n16.lighting.sh.b[4])), new e16("lightingAmbientSH_R2", (i12, n16) => r2(r14, n16.lighting.sh.r[5], n16.lighting.sh.r[6], n16.lighting.sh.r[7], n16.lighting.sh.r[8])), new e16("lightingAmbientSH_G2", (i12, n16) => r2(r14, n16.lighting.sh.g[5], n16.lighting.sh.g[6], n16.lighting.sh.g[7], n16.lighting.sh.g[8])), new e16("lightingAmbientSH_B2", (i12, n16) => r2(r14, n16.lighting.sh.b[5], n16.lighting.sh.b[6], n16.lighting.sh.b[7], n16.lighting.sh.b[8]))]), m8.code.add(n5`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
  1389. vec3 ambientLight = 0.282095 * lightingAmbientSH0;
  1390. vec4 sh1 = vec4(
  1391. 0.488603 * normal.x,
  1392. 0.488603 * normal.z,
  1393. 0.488603 * normal.y,
  1394. 1.092548 * normal.x * normal.y
  1395. );
  1396. vec4 sh2 = vec4(
  1397. 1.092548 * normal.y * normal.z,
  1398. 0.315392 * (3.0 * normal.z * normal.z - 1.0),
  1399. 1.092548 * normal.x * normal.z,
  1400. 0.546274 * (normal.x * normal.x - normal.y * normal.y)
  1401. );
  1402. ambientLight += vec3(
  1403. dot(lightingAmbientSH_R1, sh1),
  1404. dot(lightingAmbientSH_G1, sh1),
  1405. dot(lightingAmbientSH_B1, sh1)
  1406. );
  1407. ambientLight += vec3(
  1408. dot(lightingAmbientSH_R2, sh2),
  1409. dot(lightingAmbientSH_G2, sh2),
  1410. dot(lightingAmbientSH_B2, sh2)
  1411. );
  1412. return ambientLight * (1.0 - ambientOcclusion);
  1413. }`), g5.pbrMode !== l.Normal && g5.pbrMode !== l.Schematic || m8.code.add(n5`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0);
  1414. vec3 calculateAmbientRadiance(float ambientOcclusion)
  1415. {
  1416. vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2;
  1417. return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance;
  1418. }`));
  1419. }
  1420. var a11 = n();
  1421. var r14 = n2();
  1422. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js
  1423. function o22(o24, a14) {
  1424. const g5 = o24.fragment;
  1425. a14.isGround ? g5.uniforms.add(new o21("lightingFixedFactor", (i12, n15) => (1 - n15.lighting.groundLightingFactor) * (1 - n15.lighting.globalFactor))) : g5.constants.add("lightingFixedFactor", "float", 0), g5.uniforms.add([new e8("lightingMainDirection", (i12, n15) => n15.lighting.lightingMainDirection), new e8("lightingMainIntensity", (i12, n15) => n15.lighting.mainLight.intensity)]), g5.code.add(n5`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) {
  1426. float dotVal = clamp(dot(normal_global, lightingMainDirection), 0.0, 1.0);
  1427. dotVal = mix(dotVal, 1.0, lightingFixedFactor);
  1428. return lightingMainIntensity * ((1.0 - shadowing) * dotVal);
  1429. }`);
  1430. }
  1431. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js
  1432. var s7 = class extends i3 {
  1433. constructor(o24, s9) {
  1434. super(o24, "bool", a3.Pass, (r15, e24, t10) => r15.setUniform1b(o24, s9(e24, t10)));
  1435. }
  1436. };
  1437. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js
  1438. function m6(m8, g5) {
  1439. const h8 = m8.fragment;
  1440. m8.include(a9, g5), g5.pbrMode !== l.Disabled && m8.include(n10, g5), m8.include(m5, g5), h8.constants.add("ambientBoostFactor", "float", c11), m8.include(t9), h8.code.add(n5`
  1441. const float GAMMA_SRGB = 2.1;
  1442. const float INV_GAMMA_SRGB = 0.4761904;
  1443. ${g5.pbrMode === l.Disabled ? "" : "const vec3 GROUND_REFLECTANCE = vec3(0.2);"}
  1444. `), h8.uniforms.add(new e8("lightingMainDirection", (i12, n15) => n15.lighting.lightingMainDirection)), h8.code.add(n5`
  1445. float additionalDirectedAmbientLight(vec3 vPosWorld) {
  1446. float vndl = dot(${g5.spherical ? n5`normalize(vPosWorld)` : n5`vec3(0.0, 0.0, 1.0)`}, lightingMainDirection);
  1447. return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0));
  1448. }
  1449. `), h8.uniforms.add([new o21("lightingGlobalFactor", (i12, n15) => n15.lighting.globalFactor), new e8("lightingMainIntensity", (i12, n15) => n15.lighting.mainLight.intensity)]), h8.code.add(n5`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) {
  1450. float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld);
  1451. return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * lightingMainIntensity;
  1452. }`), g5.pbrMode === l.Disabled || g5.pbrMode === l.WaterOnIntegratedMesh ? (m8.include(o22, g5), h8.code.add(n5`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight)
  1453. {
  1454. vec3 mainLighting = evaluateMainLighting(normalWorld, shadow);
  1455. vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao);
  1456. vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
  1457. vec3 totalLight = mainLighting + ambientLighting + additionalLight;
  1458. totalLight = min(totalLight, vec3(PI));
  1459. vec3 outColor = vec3((albedoLinear / PI) * totalLight);
  1460. return pow(outColor, vec3(INV_GAMMA_SRGB));
  1461. }`)) : g5.pbrMode !== l.Normal && g5.pbrMode !== l.Schematic || (h8.code.add(n5`const float fillLightIntensity = 0.25;
  1462. const float horizonLightDiffusion = 0.4;
  1463. const float additionalAmbientIrradianceFactor = 0.02;
  1464. vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance)
  1465. {
  1466. vec3 viewDirection = -viewDir;
  1467. vec3 mainLightDirection = lightingMainDirection;
  1468. vec3 h = normalize(viewDirection + mainLightDirection);
  1469. PBRShadingInfo inputs;
  1470. inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0);
  1471. inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0);
  1472. inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0);
  1473. inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0);
  1474. inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0);
  1475. vec3 reflectedView = normalize(reflect(viewDirection, normal));
  1476. inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0);
  1477. inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB));
  1478. inputs.ssao = ssao;
  1479. inputs.metalness = mrr[0];
  1480. inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`), h8.code.add(n5`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness;
  1481. inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0));
  1482. inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`), g5.useFillLights ? h8.uniforms.add(new s7("hasFillLights", (i12, n15) => n15.enableFillLights)) : h8.constants.add("hasFillLights", "bool", false), h8.code.add(n5`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]);
  1483. ambientDir = ambientDir != vec3(0.0)? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0));
  1484. inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0;
  1485. vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * lightingMainIntensity;
  1486. vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * lightingMainIntensity * fillLightIntensity;
  1487. vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight;
  1488. inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;
  1489. inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`), h8.uniforms.add([new o21("lightingSpecularStrength", (i12, n15) => n15.lighting.mainLight.specularStrength), new o21("lightingEnvironmentStrength", (i12, n15) => n15.lighting.mainLight.environmentStrength)]), h8.code.add(n5`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView;
  1490. vec3 horizonRingH = normalize(viewDirection + horizonRingDir);
  1491. inputs.NdotH_Horizon = dot(normal, horizonRingH);
  1492. vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * lightingMainIntensity * (1.0 - shadow);
  1493. vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * lightingMainIntensity * fillLightIntensity;
  1494. vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight;
  1495. inputs.skyRadianceToSurface = ambientLightRadianceComponent + mainLightRadianceComponent + horizonLightRadianceComponent;
  1496. inputs.groundRadianceToSurface = GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) + mainLightRadianceComponent;
  1497. inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`), h8.code.add(n5`
  1498. vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs);
  1499. vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance;
  1500. vec3 emissionComponent = pow(_emission, vec3(GAMMA_SRGB));
  1501. vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent;
  1502. ${g5.pbrMode === l.Schematic ? n5`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));` : n5`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`}
  1503. return outColor;
  1504. }
  1505. `));
  1506. }
  1507. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/output/ReadLinearDepth.glsl.js
  1508. function a12(a14) {
  1509. a14.include(a7), a14.code.add(n5`float linearDepthFromFloat(float depth, vec2 nearFar) {
  1510. return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);
  1511. }
  1512. float linearDepthFromTexture(sampler2D depthTex, vec2 uv, vec2 nearFar) {
  1513. return linearDepthFromFloat(rgba2float(texture2D(depthTex, uv)), nearFar);
  1514. }`);
  1515. }
  1516. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js
  1517. function n13(n15, o24) {
  1518. o24.hasMultipassTerrain && (n15.fragment.include(a12), n15.fragment.uniforms.add(new c4("terrainDepthTexture", (e24, r15) => r15.multipassTerrain.linearDepthTexture)), n15.fragment.uniforms.add(new e9("nearFar", (e24, r15) => r15.camera.nearFar)), n15.fragment.uniforms.add(new e9("inverseViewport", (e24, r15) => r15.inverseViewport)), n15.fragment.code.add(n5`
  1519. void terrainDepthTest(vec4 fragCoord, float fragmentDepth){
  1520. float terrainDepth = linearDepthFromTexture(terrainDepthTexture, fragCoord.xy * inverseViewport, nearFar);
  1521. if(fragmentDepth ${o24.cullAboveGround ? ">" : "<="} terrainDepth){
  1522. discard;
  1523. }
  1524. }
  1525. `));
  1526. }
  1527. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/Matrix4sUniform.js
  1528. var e22 = class extends i3 {
  1529. constructor(r15, e24, t10, i12) {
  1530. switch (e24) {
  1531. case a3.Pass:
  1532. return void super(r15, "mat4", e24, (s9, e25, i13) => s9.setUniformMatrix4fv(r15, t10(e25, i13)), i12);
  1533. case a3.Draw:
  1534. return void super(r15, "mat4", e24, (s9, e25, i13) => s9.setUniformMatrix4fv(r15, t10(e25, i13)), i12);
  1535. }
  1536. }
  1537. };
  1538. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js
  1539. function h6(e24, a14) {
  1540. a14.receiveShadows && (e24.fragment.uniforms.add(new e22("shadowMapMatrix", a3.Pass, (e25, a15) => a15.shadowMap.getShadowMapMatrices(e25.origin), 4)), v4(e24));
  1541. }
  1542. function c12(e24, a14) {
  1543. a14.receiveShadows && (e24.fragment.uniforms.add(new e22("shadowMapMatrix", a3.Draw, (e25, a15) => a15.shadowMap.getShadowMapMatrices(e25.origin), 4)), v4(e24));
  1544. }
  1545. function v4(e24) {
  1546. const i12 = e24.fragment;
  1547. i12.include(a7), i12.uniforms.add([new c4("shadowMapTex", (e25, a14) => a14.shadowMap.depthTexture), new e14("numCascades", (e25, a14) => a14.shadowMap.numCascades), new e16("cascadeDistances", (e25, a14) => a14.shadowMap.cascadeDistances), new o21("depthHalfPixelSz", (e25, a14) => 0.5 / a14.shadowMap.textureSize)]), i12.code.add(n5`int chooseCascade(float depth, out mat4 mat) {
  1548. vec4 distance = cascadeDistances;
  1549. int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3;
  1550. mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3];
  1551. return i;
  1552. }
  1553. vec3 lightSpacePosition(vec3 _vpos, mat4 mat) {
  1554. vec4 lv = mat * vec4(_vpos, 1.0);
  1555. lv.xy /= lv.w;
  1556. return 0.5 * lv.xyz + vec3(0.5);
  1557. }
  1558. vec2 cascadeCoordinates(int i, vec3 lvpos) {
  1559. return vec2(float(i - 2 * (i / 2)) * 0.5, float(i / 2) * 0.5) + 0.5 * lvpos.xy;
  1560. }
  1561. float readShadowMapDepth(vec2 uv, sampler2D _depthTex) {
  1562. return rgba2float(texture2D(_depthTex, uv));
  1563. }
  1564. float posIsInShadow(vec2 uv, vec3 lvpos, sampler2D _depthTex) {
  1565. return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0;
  1566. }
  1567. float filterShadow(vec2 uv, vec3 lvpos, float halfPixelSize, sampler2D _depthTex) {
  1568. float texSize = 0.5 / halfPixelSize;
  1569. vec2 st = fract((vec2(halfPixelSize) + uv) * texSize);
  1570. float s00 = posIsInShadow(uv + vec2(-halfPixelSize, -halfPixelSize), lvpos, _depthTex);
  1571. float s10 = posIsInShadow(uv + vec2(halfPixelSize, -halfPixelSize), lvpos, _depthTex);
  1572. float s11 = posIsInShadow(uv + vec2(halfPixelSize, halfPixelSize), lvpos, _depthTex);
  1573. float s01 = posIsInShadow(uv + vec2(-halfPixelSize, halfPixelSize), lvpos, _depthTex);
  1574. return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
  1575. }
  1576. float readShadowMap(const in vec3 _vpos, float _linearDepth) {
  1577. mat4 mat;
  1578. int i = chooseCascade(_linearDepth, mat);
  1579. if (i >= numCascades) { return 0.0; }
  1580. vec3 lvpos = lightSpacePosition(_vpos, mat);
  1581. if (lvpos.z >= 1.0) { return 0.0; }
  1582. if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; }
  1583. vec2 uv = cascadeCoordinates(i, lvpos);
  1584. return filterShadow(uv, lvpos, depthHalfPixelSz, shadowMapTex);
  1585. }`);
  1586. }
  1587. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/ColorConversion.glsl.js
  1588. function e23(e24) {
  1589. e24.code.add(n5`vec4 premultiplyAlpha(vec4 v) {
  1590. return vec4(v.rgb * v.a, v.a);
  1591. }
  1592. vec3 rgb2hsv(vec3 c) {
  1593. vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
  1594. vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy);
  1595. vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx);
  1596. float d = q.x - min(q.w, q.y);
  1597. float e = 1.0e-10;
  1598. return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x);
  1599. }
  1600. vec3 hsv2rgb(vec3 c) {
  1601. vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
  1602. vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
  1603. return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
  1604. }
  1605. float rgb2v(vec3 c) {
  1606. return max(c.x, max(c.y, c.z));
  1607. }`);
  1608. }
  1609. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js
  1610. function i10(i12) {
  1611. i12.include(e23), i12.code.add(n5`
  1612. vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
  1613. // workaround for artifacts in OSX using Intel Iris Pro
  1614. // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
  1615. vec3 internalMixed = internalColor * textureColor;
  1616. vec3 allMixed = internalMixed * externalColor;
  1617. if (mode == ${n5.int(r9.Multiply)}) {
  1618. return allMixed;
  1619. }
  1620. if (mode == ${n5.int(r9.Ignore)}) {
  1621. return internalMixed;
  1622. }
  1623. if (mode == ${n5.int(r9.Replace)}) {
  1624. return externalColor;
  1625. }
  1626. // tint (or something invalid)
  1627. float vIn = rgb2v(internalMixed);
  1628. vec3 hsvTint = rgb2hsv(externalColor);
  1629. vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z);
  1630. return hsv2rgb(hsvOut);
  1631. }
  1632. float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
  1633. // workaround for artifacts in OSX using Intel Iris Pro
  1634. // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475
  1635. float internalMixed = internalOpacity * textureOpacity;
  1636. float allMixed = internalMixed * externalOpacity;
  1637. if (mode == ${n5.int(r9.Ignore)}) {
  1638. return internalMixed;
  1639. }
  1640. if (mode == ${n5.int(r9.Replace)}) {
  1641. return externalOpacity;
  1642. }
  1643. // multiply or tint (or something invalid)
  1644. return allMixed;
  1645. }
  1646. `);
  1647. }
  1648. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js
  1649. var n14 = s.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");
  1650. var s8 = class {
  1651. constructor() {
  1652. this.includedModules = new Map();
  1653. }
  1654. include(e24, r15) {
  1655. if (this.includedModules.has(e24)) {
  1656. const t10 = this.includedModules.get(e24);
  1657. if (t10 !== r15) {
  1658. n14.error("Trying to include shader module multiple times with different sets of options.");
  1659. const r16 = new Set();
  1660. for (const n15 of Object.keys(t10))
  1661. t10[n15] !== e24[n15] && r16.add(n15);
  1662. for (const n15 of Object.keys(e24))
  1663. t10[n15] !== e24[n15] && r16.add(n15);
  1664. r16.forEach((r17) => console.error(` ${r17}: current ${t10[r17]} new ${e24[r17]}`));
  1665. }
  1666. } else
  1667. this.includedModules.set(e24, r15), e24(this.builder, r15);
  1668. }
  1669. };
  1670. var i11 = class extends s8 {
  1671. constructor() {
  1672. super(...arguments), this.vertex = new c13(), this.fragment = new c13(), this.attributes = new u7(), this.varyings = new m7(), this.extensions = new h7(), this.constants = new d7();
  1673. }
  1674. get fragmentUniforms() {
  1675. return this.fragment.uniforms.entries;
  1676. }
  1677. get builder() {
  1678. return this;
  1679. }
  1680. generate(e24) {
  1681. const r15 = this.extensions.generateSource(e24), t10 = this.attributes.generateSource(e24), n15 = this.varyings.generateSource(), s9 = e24 === "vertex" ? this.vertex : this.fragment, i12 = s9.uniforms.generateSource(), o24 = s9.code.generateSource(), a14 = e24 === "vertex" ? _2 : l7, c14 = this.constants.generateSource().concat(s9.constants.generateSource());
  1682. return `
  1683. ${r15.join("\n")}
  1684. ${a14}
  1685. ${c14.join("\n")}
  1686. ${i12.join("\n")}
  1687. ${t10.join("\n")}
  1688. ${n15.join("\n")}
  1689. ${o24.join("\n")}`;
  1690. }
  1691. generateBind(e24, r15) {
  1692. const n15 = new Map();
  1693. this.vertex.uniforms.entries.forEach((r16) => {
  1694. const s10 = r16.bind[e24];
  1695. r(s10) && n15.set(r16.name, s10);
  1696. }), this.fragment.uniforms.entries.forEach((r16) => {
  1697. const s10 = r16.bind[e24];
  1698. r(s10) && n15.set(r16.name, s10);
  1699. });
  1700. const s9 = Array.from(n15.values()), i12 = s9.length;
  1701. return (e25, t10) => {
  1702. for (let n16 = 0; n16 < i12; ++n16)
  1703. s9[n16](r15, e25, t10);
  1704. };
  1705. }
  1706. };
  1707. var o23 = class {
  1708. constructor() {
  1709. this._entries = new Map();
  1710. }
  1711. add(e24) {
  1712. if (!Array.isArray(e24))
  1713. return this._add(e24);
  1714. for (const r15 of e24)
  1715. this._add(r15);
  1716. }
  1717. _add(r15) {
  1718. if (this._entries.has(r15.name) && !this._entries.get(r15.name).equals(r15))
  1719. throw new s2(`Duplicate uniform name ${r15.name} for different uniform type`);
  1720. this._entries.set(r15.name, r15);
  1721. }
  1722. generateSource() {
  1723. return Array.from(this._entries.values()).map((e24) => r(e24.arraySize) ? `uniform ${e24.type} ${e24.name}[${e24.arraySize}];` : `uniform ${e24.type} ${e24.name};`);
  1724. }
  1725. get entries() {
  1726. return Array.from(this._entries.values());
  1727. }
  1728. };
  1729. var a13 = class {
  1730. constructor() {
  1731. this._entries = new Array();
  1732. }
  1733. add(e24) {
  1734. this._entries.push(e24);
  1735. }
  1736. generateSource() {
  1737. return this._entries;
  1738. }
  1739. };
  1740. var c13 = class extends s8 {
  1741. constructor() {
  1742. super(...arguments), this.uniforms = new o23(), this.code = new a13(), this.constants = new d7();
  1743. }
  1744. get builder() {
  1745. return this;
  1746. }
  1747. };
  1748. var u7 = class {
  1749. constructor() {
  1750. this._entries = new Array();
  1751. }
  1752. add(e24, r15) {
  1753. this._entries.push([e24, r15]);
  1754. }
  1755. generateSource(e24) {
  1756. return e24 === "fragment" ? [] : this._entries.map((e25) => `attribute ${e25[1]} ${e25[0]};`);
  1757. }
  1758. };
  1759. var m7 = class {
  1760. constructor() {
  1761. this._entries = new Array();
  1762. }
  1763. add(e24, r15) {
  1764. this._entries.push([e24, r15]);
  1765. }
  1766. generateSource() {
  1767. return this._entries.map((e24) => `varying ${e24[1]} ${e24[0]};`);
  1768. }
  1769. };
  1770. var h7 = class {
  1771. constructor() {
  1772. this._entries = new Set();
  1773. }
  1774. add(e24) {
  1775. this._entries.add(e24);
  1776. }
  1777. generateSource(e24) {
  1778. const r15 = e24 === "vertex" ? h7.ALLOWLIST_VERTEX : h7.ALLOWLIST_FRAGMENT;
  1779. return Array.from(this._entries).filter((e25) => r15.includes(e25)).map((e25) => `#extension ${e25} : enable`);
  1780. }
  1781. };
  1782. h7.ALLOWLIST_FRAGMENT = ["GL_EXT_shader_texture_lod", "GL_OES_standard_derivatives"], h7.ALLOWLIST_VERTEX = [];
  1783. var d7 = class {
  1784. constructor() {
  1785. this._entries = new Set();
  1786. }
  1787. add(e24, r15, t10) {
  1788. let n15 = "ERROR_CONSTRUCTOR_STRING";
  1789. switch (r15) {
  1790. case "float":
  1791. n15 = d7._numberToFloatStr(t10);
  1792. break;
  1793. case "int":
  1794. n15 = d7._numberToIntStr(t10);
  1795. break;
  1796. case "bool":
  1797. n15 = t10.toString();
  1798. break;
  1799. case "vec2":
  1800. n15 = `vec2(${d7._numberToFloatStr(t10[0])}, ${d7._numberToFloatStr(t10[1])})`;
  1801. break;
  1802. case "vec3":
  1803. n15 = `vec3(${d7._numberToFloatStr(t10[0])}, ${d7._numberToFloatStr(t10[1])}, ${d7._numberToFloatStr(t10[2])})`;
  1804. break;
  1805. case "vec4":
  1806. n15 = `vec4(${d7._numberToFloatStr(t10[0])}, ${d7._numberToFloatStr(t10[1])}, ${d7._numberToFloatStr(t10[2])}, ${d7._numberToFloatStr(t10[3])})`;
  1807. break;
  1808. case "ivec2":
  1809. n15 = `ivec2(${d7._numberToIntStr(t10[0])}, ${d7._numberToIntStr(t10[1])})`;
  1810. break;
  1811. case "ivec3":
  1812. n15 = `ivec3(${d7._numberToIntStr(t10[0])}, ${d7._numberToIntStr(t10[1])}, ${d7._numberToIntStr(t10[2])})`;
  1813. break;
  1814. case "ivec4":
  1815. n15 = `ivec4(${d7._numberToIntStr(t10[0])}, ${d7._numberToIntStr(t10[1])}, ${d7._numberToIntStr(t10[2])}, ${d7._numberToIntStr(t10[3])})`;
  1816. break;
  1817. case "mat2":
  1818. case "mat3":
  1819. case "mat4":
  1820. n15 = `${r15}(${Array.prototype.map.call(t10, (e25) => d7._numberToFloatStr(e25)).join(", ")})`;
  1821. }
  1822. return this._entries.add(`const ${r15} ${e24} = ${n15};`), this;
  1823. }
  1824. static _numberToIntStr(e24) {
  1825. return e24.toFixed(0);
  1826. }
  1827. static _numberToFloatStr(e24) {
  1828. return Number.isInteger(e24) ? e24.toFixed(1) : e24.toString();
  1829. }
  1830. generateSource() {
  1831. return Array.from(this._entries);
  1832. }
  1833. };
  1834. var l7 = "#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump sampler2D;\n#endif";
  1835. var _2 = "precision highp float;\nprecision highp sampler2D;";
  1836. export {
  1837. r10 as r,
  1838. e18 as e,
  1839. E,
  1840. o4 as o,
  1841. n5 as n,
  1842. o6 as o2,
  1843. i2 as i,
  1844. o7 as o3,
  1845. d,
  1846. a4 as a,
  1847. a3 as a2,
  1848. i3 as i2,
  1849. e8 as e2,
  1850. m2 as m,
  1851. c4 as c,
  1852. m as m2,
  1853. h,
  1854. l,
  1855. d2,
  1856. x2 as x,
  1857. L3 as L,
  1858. d4 as d3,
  1859. h5 as h2,
  1860. o11 as o4,
  1861. r7 as r2,
  1862. e10 as e3,
  1863. n7 as n2,
  1864. f3 as f,
  1865. o13 as o5,
  1866. t5 as t,
  1867. t6 as t2,
  1868. e12 as e4,
  1869. u3 as u,
  1870. r8 as r3,
  1871. m3,
  1872. i5 as i3,
  1873. e15 as e5,
  1874. e16 as e6,
  1875. c8 as c2,
  1876. d3 as d4,
  1877. a6 as a3,
  1878. s5 as s,
  1879. o21 as o6,
  1880. s6 as s2,
  1881. f6 as f2,
  1882. a9 as a4,
  1883. n10 as n3,
  1884. c11 as c3,
  1885. m6 as m4,
  1886. n13 as n4,
  1887. h6 as h3,
  1888. c12 as c4,
  1889. i10 as i4,
  1890. i11 as i5
  1891. };
  1892. //# sourceMappingURL=chunk-OBMTYN3I.js.map