"use strict";var e=require("react"),r=require("@gem-sdk/core");exports.useCheckProductsSubscriptionExistence=({productId:t,elementUid:i,isSubscription:s,hasNoSellingPlanOptions:u,isDynamicProduct:c})=>{let o=r.usePageStore(e=>e.setSubscriptionVisible),n=r.usePageStore(e=>e.getSubscriptionVisible);e.useEffect(()=>{if(!t||!s)return;let e=`${i}-${t}`,r=!(u||c),b=n()??{};if(!r){o({...b,[t]:(b[t]??[]).filter(r=>r!==e)});return}o({...b,[t]:[...b[t]??[],e]})},[i,n,u,c,s,t,o])};
