var __extends=this&&this.__extends||function(){var t=function(o,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,e){o.__proto__=e}||function(o,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(o[n]=e[n])})(o,e)};return function(o,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=o}t(o,e),o.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();import XYZ from"./XYZ.js";import{ATTRIBUTION as OSM_ATTRIBUTION}from"./OSM.js";var ATTRIBUTIONS=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',OSM_ATTRIBUTION],LayerConfig={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},ProviderConfig={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},Stamen=function(r){function o(o){var e=o.layer.indexOf("-"),e=-1==e?o.layer:o.layer.slice(0,e),e=ProviderConfig[e],n=LayerConfig[o.layer],t=void 0!==o.url?o.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+o.layer+"/{z}/{x}/{y}."+n.extension;return r.call(this,{attributions:ATTRIBUTIONS,cacheSize:o.cacheSize,crossOrigin:"anonymous",imageSmoothing:o.imageSmoothing,maxZoom:(null!=o.maxZoom?o:e).maxZoom,minZoom:(null!=o.minZoom?o:e).minZoom,opaque:n.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:t,wrapX:o.wrapX,zDirection:o.zDirection})||this}return __extends(o,r),o}(XYZ);export default Stamen;