"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/app-image/gallery"],{1841:(e,t,s)=>{s.r(t),s.d(t,{default:()=>l});var i=s(85);class n extends i.Component{_initConfiguration(e){super._initConfiguration({locale:i.Locale.getSection("smb.controllers.app-image.gallery"),...e}),this._images=this._getConfigParam("images",[])}_initComponentElement(){super._initComponentElement(),this._componentElement.innerHTML=`<div class="topline"><span id="${this.getId()}-close" class="close"><a class="toplink" id="${this.getId()}-close">${this.lmsg("closeGallery")}</a></span><span id="${this.getId()}-navigation" class="navigation"><a class="toplink" id="${this.getId()}-prev">${this.lmsg("prevImage")}</a>&nbsp|&nbsp;<a class="toplink" id="${this.getId()}-next">${this.lmsg("nextImage")}</a>&nbsp;</span><span><span id="${this.getId()}-current"></span> ${this.lmsg("navigationOf")} <span id="${this.getId()}-total"></span> ${this.lmsg("typeScreenshot")}</span></div><div id="${this.getId()}-images" class="screenshots-images"><img id="${this.getId()}-image" /><div id="${this.getId()}-image_title" class="screenshots-title"></div></div>`}_addEvents(){this._componentElement.querySelectorAll(`#${this.getId()}-close`).forEach((e=>{e.addEventListener("click",this.close.bind(this))})),this._componentElement.querySelectorAll(`#${this.getId()}-prev`).forEach((e=>{e.addEventListener("click",this.prev.bind(this))})),this._componentElement.querySelectorAll(`#${this.getId()}-next`).forEach((e=>{e.addEventListener("click",this.next.bind(this))})),this.show(0)}getCount(){return this._images.length}show(e){this.getCount()<2&&this._componentElement.querySelectorAll(`[id="${this.getId()}-navigation"]`).forEach((e=>{e.style.display="none"})),this._componentElement.querySelectorAll(`[id="${this.getId()}-total"]`).forEach((e=>{e.innerHTML=this.getCount()})),0!==this.getCount()&&(e>=this.getCount()?e=0:e<0&&(e=this.getCount()-1),this._componentElement.querySelectorAll(`img[id="${this.getId()}-image"]`).forEach((t=>{t.src=this._images[e].href})),this._componentElement.querySelectorAll(`[id="${this.getId()}-image_title"]`).forEach((t=>{t.innerHTML=(0,i.escapeHtml)(this._images[e].name)})),this._componentElement.querySelectorAll(`[id="${this.getId()}-current"]`).forEach((t=>{t.innerHTML=e+1})),this.current=e)}next(){this.show(this.current+1)}prev(){this.show(this.current-1)}close(){window.close()}}const l=e=>new n(e)}}]);
//# sourceMappingURL=gallery.js.map?70014b113939522fd86a