/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../core/lang","../../../core/maybe","../../support/utils"],(function(e,s,t){"use strict";function a(e,a,p){let n=null,o=null;if(a&&(n=t.getBasemapId(a,e,!1),n)){const e=t.getBasemapGroup(n);s.isSome(e)&&(o=e)}return!n&&p&&(n="dark"===p?"dark-gray":"gray",o=p),n||o||(n="gray",o="light"),{basemapId:n,basemapTheme:o}}return function(){function p(e){this.name=null,this.label=null,this.description=null,this.supportedBasemaps=null,this.basemapGroups=null,this.schemes=null;const{name:s,label:a,description:p,schemes:n}=e;this.name=s,this.label=a,this.description=p,this.schemes=n;const o=e.basemapGroups||t.defaultBasemapGroups;let i=[];if(o)for(const t in o)i=i.concat(o[t]);this.supportedBasemaps=i,this.basemapGroups=o}var n=p.prototype;return n.isBasemapSupported=function(e){const s=t.getBasemapId(e,this.supportedBasemaps);return!(!s||!this.supportedBasemaps.includes(s))},n.getRawSchemes=function(p){const{basemapId:n,basemapTheme:o}=a(this.supportedBasemaps,p.basemap,p.basemapTheme);let i=o;if(n){const e=t.getBasemapGroup(n,this.basemapGroups);s.isSome(e)&&(i=e)}let m=p.geometryType;"multipoint"===m?m="point":"mesh"===m&&(m="polygon");const r=this.schemes[m]||this.schemes.default;return{schemesInfo:e.clone(r[i]),basemapId:n,basemapTheme:o}},p}()}));
