/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../core/has","../../core/maybe"],(function(e,t,o){"use strict";var r;function n(e,t,r={}){const n=i(e);for(;n.length>1;){const e=l(t,n.shift(),r);if(o.isSome(e))return e}return c(t,n.shift(),r)}function i(o){const r=t("esri-force-webgl");if(r===e.ContextType.WEBGL1||r===e.ContextType.WEBGL2)return[r];switch(o){case"2d":return t("mac")?[e.ContextType.WEBGL1,e.ContextType.WEBGL2]:[e.ContextType.WEBGL2,e.ContextType.WEBGL1];case"3d":return[e.ContextType.WEBGL2,e.ContextType.WEBGL1]}}function c(e,t,r={}){if(!window.WebGLRenderingContext)return s(e,a),null;const n=l(e,t,r);return o.isNone(n)&&s(e,u),n}function l(t,o,r={}){const n=o===e.ContextType.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let i=null;for(const e of n){try{i=t.getContext(e,r)}catch(c){}if(i)break}return i}function s(e,t){const o=e.parentNode;o&&(o.innerHTML='<table style="background-color: #8CE; width: 100%; height: 100%;"><tr><td align="center"><div style="display: table-cell; vertical-align: middle;"><div style="">'+t+"</div></div></td></tr></table>")}e.ContextType=void 0,(r=e.ContextType||(e.ContextType={}))[r.WEBGL1=1]="WEBGL1",r[r.WEBGL2=2]="WEBGL2";const a='This page requires a browser that supports WebGL.<br/><a href="http://get.webgl.org">Click here to upgrade your browser.</a>',u='It doesn\'t appear your computer can support WebGL.<br/><a href="http://get.webgl.org/troubleshooting/">Click here for more information.</a>';e.createContext=l,e.createContextOrErrorHTML=n,e.getContextTypes=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
