"use strict";var e=require("../../../helpers/product.js"),t=require("../../product-images/common/productFeaturedImage.js"),o=require("../../../../carousel/components/dot/common/helpers.js");const r="gid://shopify/Collection/",d="gid://shopify/Product/";exports.PREFIX_COLLECTION_ID=r,exports.PREFIX_PRODUCT_ID=d,exports.getData=t=>{let{setting:r,styles:d}=t,c=r?.productSetting??{},l="RelatedProduct"===c.productSrc,i=o.getUpdatedDotStyle(r?.dot,r?.dotStyle),u={dotSize:{desktop:12},dotGapToCarousel:{desktop:16},arrowIconSize:{desktop:24},showWhenHover:!1,rtl:!1,...r};delete u.childItem;let n={...d,sizeSetting:{...e.getSizeSetting({adaptiveHeight:d?.adaptiveHeight,height:d?.height,fullWidth:{desktop:!0}})},spacing:d?.spacing};return delete n.backgroundColor,delete n.backgroundImage,{isRelatedProduct:l,productSetting:c,dotStyle:i,carouselConfigSetting:u,carouselConfigStyle:n}},exports.getDataLiquid=e=>{let{setting:o,styles:c}=e,l=o?.productSetting,i=l?.relatedTag,u=l?.hasRelatedExclude,n=(i&&"collection"===i[0]?l?.relatedCollectionExclude:l?.relatedTagsExclude)??"",a=n?.split(",").map(e=>e.trim()).toString(),p=l?.productSrc??"Collection",s=l?.collectionId?.replace(r,"")??"latest",g=l?.productSrc==="PickProduct"&&l?.productIds?.length===0,h=c?.layout==="grid",m=t.convertUnitToNumber(o?.numberOfProducts,4),S="PickProduct"===p&&l?.productIds?.length?l?.productIds.map(e=>e.replace(d,"")):[],P="PickProduct"===p&&l?.productHandles?.length?l?.productHandles:[],I=o?.orderBy&&o?.orderBy!=="none",C=(l?.productSrc==="Collection"||l?.productSrc==="DynamicCollection")&&I?o?.orderBy?.split("_"):"none",k=I&&C?.[0]==="TITLE"?"| sort: 'title'":"| sort: 'updated_at'",y=C?.[C.length-1]==="DESC";return{hasRelatedExclude:u,relatedExcludeTrim:a,collectionID:s,isLatestProducts:g,isGrid:h,numberOfProducts:m,productListId:S,productListHandles:P,sortedBy:k,isReverse:y,productSrc:p,productSetting:l,isSorted:I,relatedTag:i,productNumber:"PickProduct"===p?g?4:l?.numOfSelectedProducts??4:m,collectionHandle:l?.collectionHandle}};
