"use strict";var e=require("@gem-sdk/core"),t=require("react"),r=require("../common/common.js");exports.useFeatureImageWithGallery=u=>{let{setting:s,styles:i}=u,n={...s,...i},c=e.useCurrentDevice(),o=t.useRef(null),l=t.useRef(null),[a,f]=t.useState(""),[d,g]=t.useState(100),[m,h]=t.useState(),v=e.getResponsiveValueByScreen(n?.position,c),p="slider"===r.getTypeWidthDevice(n?.type)[c]||["left","right","inside-left","inside-right"].includes(v);return t.useEffect(()=>{let e=l?.current;if(!e)return;let t=new ResizeObserver(()=>{g(e.offsetHeight||200)});return t.observe(e),()=>{t.disconnect()}}),{isShowCarousel:p,featureImageHeight:d,featureWrapperImage:l,onClickFeatureArrow:a,activeIndexFromFeatureImage:m,setOnClickFeatureArrow:f,onHandleLoadedFeatureImage:(e,t=200)=>{e&&(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>g(l?.current?.offsetHeight||200),t))},setActiveIndexFromFeatureImage:h}};
