"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@gem-sdk/core"),system=require("@gem-sdk/system"),helpers=require("../../helpers.js"),AdaptiveImage_liquid=require("./AdaptiveImage.liquid.js"),NextImage_liquid=require("./NextImage.liquid.js"),styles=require("../common/styles.js"),classes=require("../common/classes.js"),attrs=require("../common/attrs.js");const Image=({style:e,styles:s,setting:t,advanced:a,className:r,pageContext:l,builderAttrs:i,builderProps:m})=>{let{imageLink:y,isAdaptive:g,enableImageLink:u}=t??{},{enableLazyLoadImage:d}=l??{},{Wrapper:c,urlData:p}=helpers.getLinkData({defaultWrap:"div",setting:y,enableImageLink:u,isLiquid:!0}),o=system.createStyle(styles.getWrapperStyles(s)),q=system.createStyle(styles.getImageStyles(s,m)),n=system.createStyle(styles.getContainerStyles(e,s)),I=system.createClass(classes.getWrapperClasses()),A=system.createClass(classes.getImageClasses(r,s)),C=system.createClass(classes.getContainerClasses(m?.uid,a?.cssClass,s?.shape)),v=system.createAttr(attrs.getContainerAttrs(i,m?.uid)),$=attrs.getLinkWrapperAttrs({urlData:p,imageLink:y,title:t?.title,isLiquid:!0}),j=attrs.getAdaptiveImageAttrs({styles:s,setting:t,isLiquid:!0}),f=attrs.getNextImageAttrs({styles:s,setting:t}),x=attrs.getImageLiquidAttrs({pageContext:l,enableLazyLoadImage:d}),L=()=>system.If(g,AdaptiveImage_liquid.default({...x,...j,style:q,className:A}),NextImage_liquid.default({...x,...f,style:q,className:A})),N=()=>L();return core.template`
    <div
      role="presentation"
      ${{...v}}
      style="${n}"
      class="${C}"
    >
      <${c}
        ${$}
        style="${o}"
        class="${I}"
      >
        ${N()}
      </${c}>
    </div>
  `};exports.default=Image;
