'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("@gem-sdk/core"),t=require("react"),r=require("../hooks/useMarqueeStyles.js"),a=require("../hooks/useMarqueeScrollToItem.js"),l=require("./MarqueeBase.js"),i=require("../hooks/useMarquee.js"),o=require("@gem-sdk/system"),d=require("../common/classes.js"),u=require("../common/styles.js");exports.default=({children:c,style:n,builderAttrs:m,advanced:y,...C})=>{let{styles:h,setting:q,builderProps:S}=C,{iconSeparatorSvg:v,isShowIconSeparator:j,stopOnHover:g,speed:p}=q||{},{backgroundColor:x,iconSeparatorColor:M}=h||{},I=t.useMemo(()=>t.Children.count(s.filterToolbarPreview(c)),[c]),{isFullWidth:w}=r.useMarqueeStyles({setting:q,styles:h,itemSize:I}),{styleHeight:N,styleWidth:f,getWidthForWrapperItem:k,getHeightOfIconSeparatorSize:F,getWidthOfIconSeparatorSize:T,getIconPosition:P,getItemPaddingRightSpacingValue:B,getWidthForItem:b}=u.getMarqueeStyles({setting:q,styles:h,itemSize:I}),{rate:_,wrapperElement:A,scrollTime:H,hoverItem:E,setHoverItem:O,setActiveItem:W,activeItem:L,direction:V,isPause:z,scrollToItemClass:D}=a.useMarqueeScrollToItem({...C}),{isPlay:G,rateUse:J}=i.useMarquee({children:c,isPause:z,isPreview:S?.isPreview,rate:_,speed:p}),K=o.createClass(d.getAlignClasses),Q=o.createStyle(u.getAlignStyles(h)),R=o.createStyle(u.getContentStyles({style:n,backgroundColor:x,styleWidth:f,styleHeight:N})),U=o.createClass(d.getContentClasses),X=o.createClass(d.getWrapperClasses(S?.uid)),Y=o.createClass(d.getFastMarqueeClasses),Z=o.createClass(d.getFastMarqueeContentClasses),$=o.createClass(d.getFastMarqueeContentChildrenClasses(w)),ee=e=>o.createStyle(u.getFastMarqueeChildrenIconStyles({index:e,itemSize:I,iconSeparatorColor:M,getHeightOfIconSeparatorSize:F,getWidthOfIconSeparatorSize:T,getIconPosition:P})),es=o.createClass(d.getFastMarqueeChildrenIconClasses),et=e=>o.createStyle({...B(e),"text-wrap":"wrap",...k()}),er=o.createStyle(b());return e.jsx("div",{"data-id":S?.uid,className:s.cls(S?.uid,y?.cssClass),children:e.jsx("div",{className:K,style:Q,children:e.jsxs("div",{"data-id":S?.uid,className:U,style:R,...m,children:[e.jsx("div",{className:X,ref:A,children:e.jsx("div",{className:Y,children:e.jsx(l.default,{autoFill:!0,play:G,speed:J,isFullWidth:w,pauseOnHover:g,direction:V,uniqueId:S?.uid,style:{...f,width:"100%"},children:e.jsx("div",{className:Z,children:s.isEmptyChildren(c)?e.jsx("div",{children:"No Slider"}):t.Children.map(s.filterToolbarPreview(c),(s,r)=>t.isValidElement(s)?e.jsxs("div",{className:$,style:et(r),children:[e.jsx(s.type,{...s.props,index:r,activeItem:L,hoverItem:E,timeToScroll:H,setHoverItem:O,setActiveItem:W,className:D(r),itemBorderStyle:h?.itemBorderStyle,itemCorner:h?.itemCorner,itemBackgroundColor:h?.itemBackgroundColor,hasItemShadow:q?.hasItemShadow,itemShadow:h?.itemShadow,itemStyle:er}),o.If(!!(j&&v),e.jsx("span",{style:ee(r),className:es,dangerouslySetInnerHTML:{__html:v??""}}))]},s.key):null)})})})}),s.filterToolbarPreview(c,!0)]})})})};
