import*as tslib_1 from"../polyfills/tslib.js";import{h}from"../webmapgl.core.js";import{a as _t}from"./chunk-cf921ba9.js";var BasemapSwitcher=function(){function e(){}return e.prototype.getBasemapStyles=function(){return Array.from(document.querySelectorAll("gl-style")).filter(function(e){return e.basemap})},e.prototype.setBasemap=function(e){this.getBasemapStyles().forEach(function(t){return t.enabled=t.url===e})},e.prototype.render=function(){var e=this,t=_t("webmapgl.basemap-switcher.header"),n=this.getBasemapStyles().map(function(e){return h("ion-item",null,e.thumbnail?h("ion-thumbnail",{slot:"start"},h("img",{src:e.thumbnail,alt:e.name})):null,h("ion-label",{"text-wrap":!0},e.name),h("ion-radio",{checked:e.enabled,value:e.url}))});return h("ion-content",null,h("ion-list",null,h("ion-radio-group",{onIonChange:function(t){return e.setBasemap(t.detail.value)}},h("ion-list-header",null,t),n)))},Object.defineProperty(e,"is",{get:function(){return"gl-basemap-switcher"},enumerable:!0,configurable:!0}),e}(),Basemaps=function(){function e(){}return e.prototype.openPopover=function(e){return tslib_1.__awaiter(this,void 0,void 0,function(){var t,n;return tslib_1.__generator(this,function(r){switch(r.label){case 0:return t={component:document.createElement("gl-basemap-switcher"),ev:e},[4,this.popoverCtrl.create(t)];case 1:return[4,(n=r.sent()).present()];case 2:return r.sent(),[2,n]}})})},e.prototype.render=function(){var e=this,t=_t("webmapgl.basemaps.title");return h("ion-button",{onClick:function(t){return e.openPopover(t)},title:t},h("ion-icon",{slot:"icon-only",name:"globe"}))},Object.defineProperty(e,"is",{get:function(){return"gl-basemaps"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{el:{elementRef:!0},popoverCtrl:{connect:"ion-popover-controller"}}},enumerable:!0,configurable:!0}),e}();export{BasemapSwitcher as GlBasemapSwitcher,Basemaps as GlBasemaps};