import{composeAdvanceStyle as T}from"@gem-sdk/core";let PRODUCT_ID_LATEST="latest",PREFIX_PRODUCT_ID="gid://shopify/Product/",PREFIX_PRODUCT_VARIANT_ID="gid://shopify/ProductVariant/",PREFIX_PRODUCT_OPTION_VALUE_ID="gid://shopify/ProductOptionValue/",STATIC_PRODUCT_STATUS="static",DYNAMIC_PRODUCT_STATUS="dynamic",getData=_=>{let{setting:I,advanced:D,styles:P}=_,{productSetting:R,quantity:t,readOnly:e,isAuto:O,isSyncProduct:U,...a}=I??{},{...C}=P??{},{pos:A,top:r}=D??{},o=T({pos:A,top:r}),S=R?.productHandle??"",i=R?.initialVariantBaseId,d=i?.replace(PREFIX_PRODUCT_VARIANT_ID,"")??"",E=R?.productId?.replace(PREFIX_PRODUCT_ID,"").toLowerCase()??PRODUCT_ID_LATEST,p=R?.productStatus??STATIC_PRODUCT_STATUS,c=R?.selectedOptions?.map(T=>T?.valueBaseID?.replace(PREFIX_PRODUCT_OPTION_VALUE_ID,""));return{formatVariantId:d,formatProductId:E,productStatus:p,preSelectedOptionIds:c,productHandle:S,advancedStyle:o,rowStyles:C,rowSetting:a}};export{DYNAMIC_PRODUCT_STATUS,PREFIX_PRODUCT_ID,PREFIX_PRODUCT_OPTION_VALUE_ID,PREFIX_PRODUCT_VARIANT_ID,PRODUCT_ID_LATEST,STATIC_PRODUCT_STATUS,getData};
