var __extends=this&&this.__extends||function(){var n=function(t,o){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var r in o)o.hasOwnProperty(r)&&(t[r]=o[r])})(t,o)};return function(t,o){function r(){this.constructor=t}n(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}();import BaseObject from"../Object.js";import SourceState from"./State.js";import{abstract}from"../util.js";import{get as getProjection}from"../proj.js";var Source=function(r){function t(t){var o=r.call(this)||this;return o.projection_=getProjection(t.projection),o.attributions_=adaptAttributions(t.attributions),o.attributionsCollapsible_=void 0===t.attributionsCollapsible||t.attributionsCollapsible,o.loading=!1,o.state_=void 0!==t.state?t.state:SourceState.READY,o.wrapX_=void 0!==t.wrapX&&t.wrapX,o}return __extends(t,r),t.prototype.getAttributions=function(){return this.attributions_},t.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolutions=function(){return abstract()},t.prototype.getState=function(){return this.state_},t.prototype.getWrapX=function(){return this.wrapX_},t.prototype.getContextOptions=function(){},t.prototype.refresh=function(){this.changed()},t.prototype.setAttributions=function(t){this.attributions_=adaptAttributions(t),this.changed()},t.prototype.setState=function(t){this.state_=t,this.changed()},t}(BaseObject);function adaptAttributions(o){return o?Array.isArray(o)?function(t){return o}:"function"==typeof o?o:function(t){return[o]}:null}export default Source;