'use client';
import{jsxs as e,Fragment as i,jsx as r}from"react/jsx-runtime";import{useEditorMode as s,isEmptyChildren as m}from"@gem-sdk/core";import o from"next/head";import t from"../../grid/components/ChildrenDroppable.js";import"react";import{ELEMENT_Z_INDEX as a}from"../../common/const.js";import d from"../hooks/useSticky.js";import{createStyle as l,createClass as c}from"@gem-sdk/system";import{getContentStyles as n}from"../common/styles.js";import{getContainerClasses as p}from"../common/classes.js";let Sticky=({children:g,builderAttrs:f,setting:u,style:k,builderProps:h,advanced:y,pageContext:j})=>{let b=s(),{background:x,preloadBgImage:C,isScrollToTop:S}=u??{},{positionStyle:v,displayStyle:I,makeDisplaySettingStyles:q,getCSSAlign:z,w:D}=d(u),K=l({margin:"0 auto",...I,...z,...v,zIndex:a.STICKY,..."edit"!==b&&q}),L=l(n({setting:u,style:k,uid:h?.uid,pageContext:j??{}})),N=c(p({uid:h?.uid,isScrollToTop:S,cssClass:y?.cssClass,isLiquid:!1}));return e(i,{children:[!!C&&e(o,{children:[!!x?.desktop?.image?.src&&r("link",{rel:"preload",href:x.desktop.image.src,as:"image"}),!!x?.tablet?.image?.src&&r("link",{rel:"preload",href:x.tablet.image.src,as:"image"}),!!x?.mobile?.image?.src&&r("link",{rel:"preload",href:x.mobile.image.src,as:"image"})]}),r("div",{className:N,id:h?.uid,style:{...D,...K},children:r("div",{...f,"data-id":h?.uid,style:L,children:m(g)?r(t,{}):g})})]})};export{Sticky as default};
