"use strict";var e=require("react"),r=require("@gem-sdk/core"),t=require("../helpers/scanSubscriptionBlocks.js");exports.useProductOfferSubscriptionBlocksObserver=s=>{let[i,c]=e.useState(()=>({hasOneTimeBlock:!1,hasSubscriptionBlock:!1,hasBoth:!1}));return r.useIsomorphicLayoutEffect(()=>{let e=s.current;if(!e)return;let r=()=>{c(r=>{let s=t.scanSubscriptionBlocks(e);return r.hasOneTimeBlock===s.hasOneTimeBlock&&r.hasSubscriptionBlock===s.hasSubscriptionBlock?r:s})};r();let i=new MutationObserver(r);return i.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-selling-type"]}),()=>{i.disconnect()}},[s]),i};
