"use strict";const f=require("./index.cjs36.js"),c=require("react"),a=require("./index.cjs67.js"),n={accepted:"accepted",notSet:"not_set",rejected:"rejected"},y=i=>e=>{const[t,s]=c.useState(),l=o=>localStorage.getItem(o)||n.notSet,u=(o,d)=>localStorage.setItem(o,d),r=c.useCallback(()=>s(n.accepted),[]),g=c.useCallback(()=>s(n.rejected),[]);return c.useEffect(()=>{s(l(e.storageKey))},[e.storageKey]),c.useEffect(()=>{u(e.storageKey,t||"")},[t,e.storageKey]),c.useEffect(()=>{e.location&&t===n.accepted&&a.send("pageview")},[t,e.location]),c.useEffect(()=>{t===n.accepted&&a.initialize(e.id)},[t]),!e.id||!e.storageKey||t!==n.notSet?null:f.jsxRuntimeExports.jsx(i,{...e,onAccept:r,onDecline:g})};module.exports=y;
//# sourceMappingURL=index.cjs4.js.map
