chunk-LGW7TID4.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import {
  2. a,
  3. r,
  4. t
  5. } from "./chunk-GZT4BVFP.js";
  6. // node_modules/@arcgis/core/views/webgl/context-util.js
  7. var o;
  8. function n(e, r2, o2 = {}) {
  9. const n2 = i(e);
  10. for (; n2.length > 1; ) {
  11. const e2 = l(r2, n2.shift(), o2);
  12. if (r(e2))
  13. return e2;
  14. }
  15. return c(r2, n2.shift(), o2);
  16. }
  17. function i(t2) {
  18. const r2 = a("esri-force-webgl");
  19. if (r2 === o.WEBGL1 || r2 === o.WEBGL2)
  20. return [r2];
  21. switch (t2) {
  22. case "2d":
  23. return a("mac") && a("chrome") ? [o.WEBGL1, o.WEBGL2] : [o.WEBGL2, o.WEBGL1];
  24. case "3d":
  25. return [o.WEBGL2, o.WEBGL1];
  26. }
  27. }
  28. function c(e, t2, o2 = {}) {
  29. if (!window.WebGLRenderingContext)
  30. return a2(e, s), null;
  31. const n2 = l(e, t2, o2);
  32. return t(n2) && a2(e, u), n2;
  33. }
  34. function l(e, t2, r2 = {}) {
  35. const n2 = t2 === o.WEBGL1 ? ["webgl", "experimental-webgl", "webkit-3d", "moz-webgl"] : ["webgl2"];
  36. let i2 = null;
  37. for (const o2 of n2) {
  38. try {
  39. i2 = e.getContext(o2, r2);
  40. } catch (c2) {
  41. }
  42. if (i2)
  43. break;
  44. }
  45. return i2;
  46. }
  47. function a2(e, t2) {
  48. const r2 = e.parentNode;
  49. r2 && (r2.innerHTML = '<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">' + t2 + "</div></div></td></tr></table>");
  50. }
  51. !function(e) {
  52. e[e.WEBGL1 = 1] = "WEBGL1", e[e.WEBGL2 = 2] = "WEBGL2";
  53. }(o || (o = {}));
  54. var s = 'This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>';
  55. var u = `It doesn't appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>`;
  56. export {
  57. o,
  58. n,
  59. i,
  60. l
  61. };
  62. //# sourceMappingURL=chunk-LGW7TID4.js.map