import{r as t,h as s,H as i,a}from"./p-d55626d1.js";const r=class{constructor(s){t(this,s),this.w=12,this.maxWidth=100,this.lazy=!1,this.onIntersection=async t=>{for(const s of t)s.isIntersecting&&(this.observer&&this.observer.disconnect(),s.target.getAttribute("data-src")&&(s.target.setAttribute("src",s.target.getAttribute("data-src")),s.target.removeAttribute("data-src")))},this._relevantProps=["w","maxWidth","h","maxH","fit","rounded"]}componentDidLoad(){this.lazy&&this.setupObserver()}async componentWillLoad(){await this.computeStyles()}async computeStyles(){const t=await(await import("./p-a272a252.js").then((function(t){return t.s}))).calculateStyles(this);this.hash=t}setupObserver(){const t=this.el.shadowRoot.querySelector("img");t&&(this.observer=new IntersectionObserver(this.onIntersection),this.observer.observe(t))}render(){const t={};return this.lazy?t["data-src"]=this.src:t.src=this.src,s(i,{as:"image",alt:this.alt},s("img",Object.assign({},t,{alt:this.alt,class:this.hash})))}get el(){return a(this)}};export{r as corejam_image}