import{cls as e,WrapRenderChildren as s,RenderChildren as t,template as i,RenderIf as r,isLocalEnv as o,baseAssetURL as d}from"@gem-sdk/core";import a from"./MarqueeBase.liquid.js";import{useMarqueeLiquidStyles as m}from"../common/helpers.js";import{createClass as l,createStyle as p,createStateOrContext as c,If as u}from"@gem-sdk/system";import{getMarqueeStyles as n,getAlignStyles as $,getContentStyles as v,getFastMarqueeChildrenIconStyles as g}from"../common/styles.js";import{getAlignClasses as f,getContentClasses as S,getWrapperClasses as h,getFastMarqueeContentClasses as y,getFastMarqueeClasses as q,getFastMarqueeContentChildrenClasses as j,getFastMarqueeChildrenIconClasses as k}from"../common/classes.js";let w=({children:w,style:B,builderAttrs:C,rawChildren:b,advanced:E,...O})=>{let{styles:I,setting:M,builderProps:P}=O,{iconSeparatorColor:x,backgroundColor:A}=I||{},{iconSeparatorSvg:F,isShowIconSeparator:G}=M||{},H=b.length,{isFullWidth:N,getIsFullWidthValue:R}=m(M,I),{styleHeight:_,styleWidth:J,getWidthForWrapperItem:T,getHeightOfIconSeparatorSize:V,getWidthOfIconSeparatorSize:W,getIconPosition:z,getItemPaddingRightSpacingValue:D,getWidthForItem:K}=n({itemSize:H,setting:M,styles:I}),L=l(f),Q=p($(I)),U=p(v({style:B,backgroundColor:A,styleWidth:J,styleHeight:_})),X=l(S),Y=l(h(P?.uid)),Z=l(y),ee=l(q),es=l(j(N)),et=e=>p(g({index:e,itemSize:H,iconSeparatorColor:x,getHeightOfIconSeparatorSize:V,getWidthOfIconSeparatorSize:W,getIconPosition:z})),ei=l(k),er=e=>p({...D(e),"text-wrap":"wrap",...T()}),eo=p(K()),ed=c({setting:{...M,uid:P?.uid},styles:I});return i`
  ${r(o,'<script src="{{ \'gp-marquee-v7-5.js\' | asset_url }}" defer="defer"></script>',`<script src="${d}/assets-v2/gp-marquee-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  <gp-marquee data-id="${P?.uid}" gp-data='${JSON.stringify(ed)}'
   class="${e(P?.uid,E?.cssClass)}">
   <div class="${L}" style="${Q}">
      <div class="${X}" style="${U}">
         <div class="${Y}">
            <div class="${ee}">
               ${a({autoFill:!0,direction:O.setting?.direction,play:(O.setting?.speed??0)>0,pauseOnHover:O.setting?.stopOnHover,isFullWidthResponsive:{desktop:R("desktop"),tablet:R("tablet"),mobile:R("mobile")},children:`
               <div class="${Z}">
                  ${b?.length?s({uid:P?.uid??"",customProps:b[0]?.customProps},b.map((e,s)=>{if(e)return i`
                  <div class="${es}"
                     style="${er(s)}">
                     ${t({...e,index:s,itemBorderStyle:I?.itemBorderStyle,itemCorner:I?.itemCorner,itemBackgroundColor:I?.itemBackgroundColor,hasItemShadow:M?.hasItemShadow,itemShadow:I?.itemShadow,itemStyles:eo})}
                     ${u(!!(G&&F),i`<span style="${et(s)}"
                        class="${ei}">
                        ${F}
                     </span>`)}
                  </div>
                  `})):w}
               </div>
               `})}
            </div>
         </div>
      </div>
   </div>
</gp-marquee>
`};export{w as default};
