{"ast":null,"code":"import { r as registerInstance, e as createEvent, h, H as Host, i as getElement } from \"./index-7a8b7a1c.js\";\nimport { b as getIonMode } from \"./ionic-global-63a97a32.js\";\nvar imgCss = \":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}\";\n\nvar Img = function () {\n  function t(t) {\n    var i = this;\n    registerInstance(this, t);\n    this.ionImgWillLoad = createEvent(this, \"ionImgWillLoad\", 7);\n    this.ionImgDidLoad = createEvent(this, \"ionImgDidLoad\", 7);\n    this.ionError = createEvent(this, \"ionError\", 7);\n\n    this.onLoad = function () {\n      i.ionImgDidLoad.emit();\n    };\n\n    this.onError = function () {\n      i.ionError.emit();\n    };\n  }\n\n  t.prototype.srcChanged = function () {\n    this.addIO();\n  };\n\n  t.prototype.componentDidLoad = function () {\n    this.addIO();\n  };\n\n  t.prototype.addIO = function () {\n    var t = this;\n\n    if (this.src === undefined) {\n      return;\n    }\n\n    if (typeof window !== \"undefined\" && \"IntersectionObserver\" in window && \"IntersectionObserverEntry\" in window && \"isIntersecting\" in window.IntersectionObserverEntry.prototype) {\n      this.removeIO();\n      this.io = new IntersectionObserver(function (i) {\n        if (i[0].isIntersecting) {\n          t.load();\n          t.removeIO();\n        }\n      });\n      this.io.observe(this.el);\n    } else {\n      setTimeout(function () {\n        return t.load();\n      }, 200);\n    }\n  };\n\n  t.prototype.load = function () {\n    this.loadError = this.onError;\n    this.loadSrc = this.src;\n    this.ionImgWillLoad.emit();\n  };\n\n  t.prototype.removeIO = function () {\n    if (this.io) {\n      this.io.disconnect();\n      this.io = undefined;\n    }\n  };\n\n  t.prototype.render = function () {\n    return h(Host, {\n      class: getIonMode(this)\n    }, h(\"img\", {\n      decoding: \"async\",\n      src: this.loadSrc,\n      alt: this.alt,\n      onLoad: this.onLoad,\n      onError: this.loadError,\n      part: \"image\"\n    }));\n  };\n\n  Object.defineProperty(t.prototype, \"el\", {\n    get: function () {\n      return getElement(this);\n    },\n    enumerable: false,\n    configurable: true\n  });\n  Object.defineProperty(t, \"watchers\", {\n    get: function () {\n      return {\n        src: [\"srcChanged\"]\n      };\n    },\n    enumerable: false,\n    configurable: true\n  });\n  return t;\n}();\n\nImg.style = imgCss;\nexport { Img as ion_img };","map":{"version":3,"sources":["/Users/adekanbidansteve/github/klasha/react-klasha/ionic-test/node_modules/@ionic/core/dist/esm-es5/ion-img.entry.js"],"names":["r","registerInstance","e","createEvent","h","H","Host","i","getElement","b","getIonMode","imgCss","Img","t","ionImgWillLoad","ionImgDidLoad","ionError","onLoad","emit","onError","prototype","srcChanged","addIO","componentDidLoad","src","undefined","window","IntersectionObserverEntry","removeIO","io","IntersectionObserver","isIntersecting","load","observe","el","setTimeout","loadError","loadSrc","disconnect","render","class","decoding","alt","part","Object","defineProperty","get","enumerable","configurable","style","ion_img"],"mappings":"AAAA,SAAOA,CAAC,IAAIC,gBAAZ,EAA6BC,CAAC,IAAIC,WAAlC,EAA8CC,CAA9C,EAAgDC,CAAC,IAAIC,IAArD,EAA0DC,CAAC,IAAIC,UAA/D,QAA8E,qBAA9E;AAAoG,SAAOC,CAAC,IAAIC,UAAZ,QAA2B,4BAA3B;AAAwD,IAAIC,MAAM,GAAC,oMAAX;;AAAgN,IAAIC,GAAG,GAAC,YAAU;AAAC,WAASC,CAAT,CAAWA,CAAX,EAAa;AAAC,QAAIN,CAAC,GAAC,IAAN;AAAWN,IAAAA,gBAAgB,CAAC,IAAD,EAAMY,CAAN,CAAhB;AAAyB,SAAKC,cAAL,GAAoBX,WAAW,CAAC,IAAD,EAAM,gBAAN,EAAuB,CAAvB,CAA/B;AAAyD,SAAKY,aAAL,GAAmBZ,WAAW,CAAC,IAAD,EAAM,eAAN,EAAsB,CAAtB,CAA9B;AAAuD,SAAKa,QAAL,GAAcb,WAAW,CAAC,IAAD,EAAM,UAAN,EAAiB,CAAjB,CAAzB;;AAA6C,SAAKc,MAAL,GAAY,YAAU;AAACV,MAA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;AAAS,CAA/6C,EAAR;;AAA07CD,GAAG,CAACqC,KAAJ,GAAUtC,MAAV;AAAiB,SAAOC,GAAG,IAAIsC,OAAd","sourcesContent":["import{r as registerInstance,e as createEvent,h,H as Host,i as getElement}from\"./index-7a8b7a1c.js\";import{b as getIonMode}from\"./ionic-global-63a97a32.js\";var imgCss=\":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}\";var Img=function(){function t(t){var i=this;registerInstance(this,t);this.ionImgWillLoad=createEvent(this,\"ionImgWillLoad\",7);this.ionImgDidLoad=createEvent(this,\"ionImgDidLoad\",7);this.ionError=createEvent(this,\"ionError\",7);this.onLoad=function(){i.ionImgDidLoad.emit()};this.onError=function(){i.ionError.emit()}}t.prototype.srcChanged=function(){this.addIO()};t.prototype.componentDidLoad=function(){this.addIO()};t.prototype.addIO=function(){var t=this;if(this.src===undefined){return}if(typeof window!==\"undefined\"&&\"IntersectionObserver\"in window&&\"IntersectionObserverEntry\"in window&&\"isIntersecting\"in window.IntersectionObserverEntry.prototype){this.removeIO();this.io=new IntersectionObserver((function(i){if(i[0].isIntersecting){t.load();t.removeIO()}}));this.io.observe(this.el)}else{setTimeout((function(){return t.load()}),200)}};t.prototype.load=function(){this.loadError=this.onError;this.loadSrc=this.src;this.ionImgWillLoad.emit()};t.prototype.removeIO=function(){if(this.io){this.io.disconnect();this.io=undefined}};t.prototype.render=function(){return h(Host,{class:getIonMode(this)},h(\"img\",{decoding:\"async\",src:this.loadSrc,alt:this.alt,onLoad:this.onLoad,onError:this.loadError,part:\"image\"}))};Object.defineProperty(t.prototype,\"el\",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,\"watchers\",{get:function(){return{src:[\"srcChanged\"]}},enumerable:false,configurable:true});return t}();Img.style=imgCss;export{Img as ion_img};"]},"metadata":{},"sourceType":"module"}