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