/*! * (C) Ionic http://ionicframework.com - MIT License */ import{r as i,d as t,h as s,f as e,i as o}from"./p-9ad82dba.js";import{h as r}from"./p-b51e4004.js";import{b as n}from"./p-6994c97a.js";const h=class{constructor(s){i(this,s),this.ionImgWillLoad=t(this,"ionImgWillLoad",7),this.ionImgDidLoad=t(this,"ionImgDidLoad",7),this.ionError=t(this,"ionError",7),this.inheritedAttributes={},this.onLoad=()=>{this.ionImgDidLoad.emit()},this.onError=()=>{this.ionError.emit()},this.loadSrc=void 0,this.loadError=void 0,this.alt=void 0,this.src=void 0}srcChanged(){this.addIO()}componentWillLoad(){this.inheritedAttributes=r(this.el,["draggable"])}componentDidLoad(){this.addIO()}addIO(){void 0!==this.src&&("undefined"!=typeof window&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype?(this.removeIO(),this.io=new IntersectionObserver((i=>{i[i.length-1].isIntersecting&&(this.load(),this.removeIO())})),this.io.observe(this.el)):setTimeout((()=>this.load()),200))}load(){this.loadError=this.onError,this.loadSrc=this.src,this.ionImgWillLoad.emit()}removeIO(){this.io&&(this.io.disconnect(),this.io=void 0)}render(){const{loadSrc:i,alt:t,onLoad:o,loadError:r,inheritedAttributes:h}=this,{draggable:d}=h;return s(e,{key:"fa0d0e73693f4d5454dde2397a333143ab00a145",class:n(this)},s("img",{key:"70198693643ab6a33816c6e1b0ed23b368208fbb",decoding:"async",src:i,alt:t,onLoad:o,onError:r,part:"image",draggable:a(d)}))}get el(){return o(this)}static get watchers(){return{src:["srcChanged"]}}},a=i=>{switch(i){case"true":return!0;case"false":return!1;default:return}};h.style=":host{display:block;-o-object-fit:contain;object-fit:contain}img{display:block;width:100%;height:100%;-o-object-fit:inherit;object-fit:inherit;-o-object-position:inherit;object-position:inherit}";export{h as ion_img}