const t=window.webmapgl.h;import{a as e}from"./chunk-cf921ba9.js";class o{async openPopover(t){const e={component:document.createElement("gl-download-list"),componentProps:{files:Array.from(this.el.querySelectorAll("gl-download-file"))},ev:t},o=await this.popoverCtrl.create(e);return await o.present(),o}render(){let o=e("webmapgl.download-button.title");return t("ion-button",{onClick:t=>this.openPopover(t),title:o},t("ion-icon",{slot:"icon-only",name:"download"}))}static get is(){return"gl-download-button"}static get properties(){return{el:{elementRef:!0},popoverCtrl:{connect:"ion-popover-controller"}}}}class l{render(){const o=e("webmapgl.download-list.header");let l=this.files.map(o=>{let l=[o.format,o.size].filter(t=>t).join(", ");return l&&(l=`(${l})`),t("ion-item",null,t("ion-label",{"text-wrap":!0},o.label," ",l),t("ion-button",{slot:"end",href:o.url,title:e("webmapgl.download-list.download",{file:o.label})},t("ion-icon",{slot:"icon-only",name:"download"})))});return t("ion-content",null,t("ion-list",null,t("ion-list-header",null,o),l))}static get is(){return"gl-download-list"}static get properties(){return{files:{type:"Any",attr:"files"}}}}export{o as GlDownloadButton,l as GlDownloadList};