"use strict";var React=require("react");const useSellingPlanChange=({defaultValue:e,selectedSellingPlan:l,setSelectedSellingPlan:t,sellingPlanOptions:a})=>{let n=React.useRef(!0);React.useEffect(()=>{if(n.current){if(!l){let l=e||a[0]?.value||"";l&&t(l)}n.current=!1;return}if(l){let n=a.some(e=>e.value===l);if(!n&&a.length>0){let l=e||a[0]?.value||"";l&&t(l)}}},[e,a,l,t]);let u=e=>{t(e)},r=l||e||a[0]?.value||"";return{selectedValue:r,handleSellingPlanChange:u}};exports.useSellingPlanChange=useSellingPlanChange;
