'use client';
import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useEditorMode as m}from"@gem-sdk/core";import{createStyleReact as t,createStyle as r,createClass as o,createAttr as a,If as i}from"@gem-sdk/system";import l from"./AdaptiveImage.js";import p from"./NextImage.js";import{getWrapperStyles as c,getImageStyles as d,getContainerStyles as n}from"../common/styles.js";import{getWrapperClasses as f,getImageClasses as g,getContainerClasses as j}from"../common/classes.js";import{getContainerAttrs as u,getAdaptiveImageAttrs as y,getNextImageAttrs as N,getLinkWrapperAttrs as h}from"../common/attrs.js";import{getLinkData as I}from"../../helpers.js";let Image=({style:k,styles:v,setting:x,children:C,advanced:W,className:A,builderAttrs:L,builderProps:b,onLoad:q,onClick:w})=>{let{imageLink:z,isAdaptive:B,enableImageLink:D}=x??{},E=m(),{Wrapper:F,urlData:G}=I({defaultWrap:"div",setting:z,enableImageLink:D}),H=t(c(v)),J=r(d(v,b)),K=r(n(k,v)),M=o(f()),O=o(g(A,v)),P=o(j(b?.uid,W?.cssClass,v?.shape)),Q=a(u(L,b?.uid)),R=h({urlData:G,imageLink:z,title:x?.title}),S=y({styles:v,setting:x,mode:E}),T=N({styles:v,setting:x}),U=()=>i(B,s(l,{...S,style:J,className:O}),s(p,{...T,style:J,className:O,onLoad:q}));return e("div",{role:"presentation",...Q,style:K,className:P,onClick:w,children:[s(F,{...R,style:H,className:M,children:U()}),C]})};export{Image as default};
