import{findBestPlanFromList as e}from"./calculateBestSellingPlan.js";import{convertDecimalToNumber as t}from"@gem-sdk/core";let i=i=>{let{validPlans:l,extractedSettings:r,currentVariant:n,plans:a}=i;if(r.defaultOptions){let e=l.find(e=>e.baseID===r.defaultOptions),t=l.find(e=>e.id===r.defaultOptions),i=e?.baseID??t?.baseID;if(i)return i}if(l.length>0){let i="number"==typeof n?.price?String(n.price):n?.price??void 0,r=t(i)??0,a=e({plans:l,variantPrice:r});if(a)return a.baseID}return a[0]?.value};export{i as findDefaultValue};
