chunk-DHDOH23F.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import {
  2. h
  3. } from "./chunk-JH3PLIM6.js";
  4. import {
  5. r
  6. } from "./chunk-GZT4BVFP.js";
  7. // node_modules/@arcgis/core/core/NestedMap.js
  8. var t = class {
  9. constructor() {
  10. this._outer = new Map();
  11. }
  12. clear() {
  13. this._outer.clear();
  14. }
  15. get empty() {
  16. return this._outer.size === 0;
  17. }
  18. get(t2, e2) {
  19. return this._outer.get(t2)?.get(e2);
  20. }
  21. set(t2, e2, r2) {
  22. const s2 = this._outer.get(t2);
  23. s2 ? s2.set(e2, r2) : this._outer.set(t2, new Map([[e2, r2]]));
  24. }
  25. delete(t2, e2) {
  26. const r2 = this._outer.get(t2);
  27. r2 && (r2.delete(e2), r2.size === 0 && this._outer.delete(t2));
  28. }
  29. forEach(t2) {
  30. this._outer.forEach((e2, r2) => t2(e2, r2));
  31. }
  32. };
  33. // node_modules/@arcgis/core/views/webgl/ProgramCache.js
  34. var s = class {
  35. constructor(r2) {
  36. this._rctx = r2, this._store = new t();
  37. }
  38. dispose() {
  39. this._store.forEach((r2) => r2.forEach((r3) => r3.dispose())), this._store.clear();
  40. }
  41. acquire(t2, s2, o, c) {
  42. const i = this._store.get(t2, s2);
  43. if (r(i))
  44. return i.ref(), i;
  45. const h2 = new h(this._rctx, t2, s2, o, c);
  46. return h2.ref(), this._store.set(t2, s2, h2), h2;
  47. }
  48. get test() {
  49. let r2 = 0;
  50. return this._store.forEach((t2) => t2.forEach((t3) => r2 += t3.hasGLName ? 2 : 1)), { cachedWebGLObjects: r2 };
  51. }
  52. };
  53. // node_modules/@arcgis/core/views/webgl/programUtils.js
  54. function e(e2) {
  55. const { options: n2, value: o } = e2;
  56. return typeof n2[o] == "number";
  57. }
  58. function n(n2) {
  59. let o = "";
  60. for (const t2 in n2) {
  61. const i = n2[t2];
  62. if (typeof i == "boolean")
  63. i && (o += `#define ${t2}
  64. `);
  65. else if (typeof i == "number")
  66. o += `#define ${t2} ${i.toFixed()}
  67. `;
  68. else if (typeof i == "object")
  69. if (e(i)) {
  70. const { value: e2, options: n3, namespace: f } = i, s2 = f ? `${f}_` : "";
  71. for (const t3 in n3)
  72. o += `#define ${s2}${t3} ${n3[t3].toFixed()}
  73. `;
  74. o += `#define ${t2} ${s2}${e2}
  75. `;
  76. } else {
  77. const e2 = i.options;
  78. let n3 = 0;
  79. for (const t3 in e2)
  80. o += `#define ${e2[t3]} ${(n3++).toFixed()}
  81. `;
  82. o += `#define ${t2} ${e2[i.value]}
  83. `;
  84. }
  85. }
  86. return o;
  87. }
  88. export {
  89. s,
  90. n
  91. };
  92. //# sourceMappingURL=chunk-DHDOH23F.js.map