'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),Row=require("../../../grid/components/row/Row.js"),system=require("@gem-sdk/system"),classes=require("./common/classes.js"),styles=require("./common/styles.js"),helpers=require("./common/helpers.js"),Link=require("../../../link/components/Link.js");const CollectionBanner=({builderAttrs:e,builderProps:s,setting:t,style:l,children:r,advanced:a})=>{let n=core.useCollection(),{isPreviewSharePageMode:i,isEditMode:o}=core.useRenderMode(),{link:c,layout:m,width:u,verticalGutter:y,verticalAlign:d,horizontalAlign:g}=t??{};helpers.updateBackroundImageSrc({setting:t,collectionSrc:n?.collectionMedia?.src});let j=system.createClass({...classes.getClassContainerBanner({builderProps:s,setting:t,advanced:a})}),C=system.createClass({...classes.getClassContainerBackgoundImage({setting:t})}),k=system.createClass({...classes.getClassOverlayBanner({setting:t})}),x=system.createClass({...classes.getClassLinkBanner()}),p=system.createStyle({...styles.getDimension({setting:t,style:l})}),R=system.createStyle({...styles.getStyleOverlay({setting:t})}),B=system.createStyle({...styles.getStyleContainerBackgoundImage({setting:t,hasCollectionImage:!1})}),h=!!c?.link&&!o&&!i;return jsxRuntime.jsxs("div",{...e,className:j,style:p,children:[jsxRuntime.jsx("div",{"aria-label":"Background Image",role:"banner",className:C,style:B}),jsxRuntime.jsx("div",{"aria-label":"Overlay",role:"banner",className:k,style:R}),system.If(h,jsxRuntime.jsx(Link.default,{setting:{href:c?.link,target:c?.target},className:x})),jsxRuntime.jsx(Row.default,{setting:{layout:m,horizontalAlign:g,verticalAlign:d},styles:{verticalGutter:y,width:u,fullWidth:{desktop:!1,tablet:!1,mobile:!1}},style:l,children:r})]})};exports.default=CollectionBanner;
