{"version":3,"file":"CustomCookieBanner.COGIM4Vm.mjs","names":["React.useState","React.useCallback","React.useMemo","React.startTransition"],"sources":["https:/framerusercontent.com/modules/TANasMX71wpJ5PrEDRFn/ZQRIityDGtecQq2DSXxy/CustomCookieBanner.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,Link,useIsStaticRenderer}from\"framer\";const storageKey=\"customCookieConsentChoice\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CustomCookieBanner(props){const{title,bodyText,policyPrefix,policyLabel,policyUrl,acceptLabel,necessaryOnlyLabel,panelBackground,titleColor,bodyColor,linkColor,primaryButtonBackground,primaryButtonTextColor,secondaryButtonBackground,secondaryButtonTextColor,borderColor,borderRadius,panelWidth,panelPadding,panelBlur,backdropColor,textFont,showInCanvasPreview,forceShowBanner,resetStoredChoice}=props;const isStatic=useIsStaticRenderer();const[visible,setVisible]=React.useState(false);const[focusedElement,setFocusedElement]=React.useState(\"\");const[isNarrow,setIsNarrow]=React.useState(false);const refreshViewport=React.useCallback(()=>{if(typeof window!==\"undefined\"){React.startTransition(()=>setIsNarrow(window.innerWidth<520));}else{React.startTransition(()=>setIsNarrow(false));}},[]);React.useEffect(()=>{if(typeof window!==\"undefined\"){refreshViewport();window.addEventListener(\"resize\",refreshViewport);return()=>window.removeEventListener(\"resize\",refreshViewport);}},[refreshViewport]);React.useEffect(()=>{if(typeof window!==\"undefined\"){if(resetStoredChoice){window.localStorage.removeItem(storageKey);}const savedChoice=window.localStorage.getItem(storageKey);const hasValidChoice=savedChoice===\"acceptAll\"||savedChoice===\"necessaryOnly\";React.startTransition(()=>setVisible(!hasValidChoice));}else{React.startTransition(()=>setVisible(false));}},[resetStoredChoice]);const saveChoice=React.useCallback(choice=>{if(typeof window!==\"undefined\"){window.localStorage.setItem(storageKey,choice);}React.startTransition(()=>setVisible(false));},[]);const shouldShow=React.useMemo(()=>{if(forceShowBanner)return true;if(isStatic)return showInCanvasPreview;return visible;},[forceShowBanner,isStatic,showInCanvasPreview,visible]);if(!shouldShow)return null;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",minHeight:\"100%\",minWidth:\"100%\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",inset:0,background:backdropColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"16px\",zIndex:2147483647},children:/*#__PURE__*/_jsxs(\"section\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-labelledby\":\"custom-cookie-banner-title\",style:{width:\"min(100%, 100vw - 32px)\",maxWidth:`${panelWidth}px`,background:panelBackground,border:`1px solid ${borderColor}`,borderRadius,padding:panelPadding,backdropFilter:`blur(${panelBlur}px)`,WebkitBackdropFilter:`blur(${panelBlur}px)`,boxSizing:\"border-box\",boxShadow:\"0 12px 32px rgba(0, 0, 0, 0.28)\"},children:[/*#__PURE__*/_jsx(\"h2\",{id:\"custom-cookie-banner-title\",style:{margin:\"0 0 10px 0\",color:titleColor,fontFamily:textFont.fontFamily,fontSize:24,lineHeight:1.2,letterSpacing:\"-0.02em\",fontWeight:700},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 10px 0\",color:bodyColor,fontFamily:textFont.fontFamily,fontSize:textFont.fontSize,lineHeight:textFont.lineHeight,letterSpacing:textFont.letterSpacing,fontWeight:textFont.fontWeight,fontStyle:textFont.fontStyle},children:bodyText}),/*#__PURE__*/_jsxs(\"p\",{style:{margin:\"0 0 18px 0\",color:bodyColor,fontFamily:textFont.fontFamily,fontSize:textFont.fontSize,lineHeight:textFont.lineHeight,letterSpacing:textFont.letterSpacing,fontWeight:textFont.fontWeight,fontStyle:textFont.fontStyle},children:[policyPrefix,\" \",/*#__PURE__*/_jsx(\"span\",{onFocusCapture:()=>React.startTransition(()=>setFocusedElement(\"policyLink\")),onBlurCapture:()=>React.startTransition(()=>setFocusedElement(\"\")),style:{display:\"inline-block\",outline:focusedElement===\"policyLink\"?`2px solid ${linkColor}`:\"none\",outlineOffset:\"2px\",borderRadius:4},children:/*#__PURE__*/_jsx(Link,{href:policyUrl,style:{color:linkColor,textDecoration:\"underline\",textUnderlineOffset:\"2px\"},children:policyLabel})}),\".\"]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:isNarrow?\"column\":\"row\",gap:\"10px\"},children:[/*#__PURE__*/_jsx(\"button\",{type:\"button\",onFocus:()=>React.startTransition(()=>setFocusedElement(\"accept\")),onBlur:()=>React.startTransition(()=>setFocusedElement(\"\")),onClick:()=>saveChoice(\"acceptAll\"),style:{flex:1,border:\"none\",borderRadius:\"10px\",padding:\"12px 14px\",background:primaryButtonBackground,color:primaryButtonTextColor,cursor:\"pointer\",fontFamily:textFont.fontFamily,fontSize:14,fontWeight:600,lineHeight:1.2,boxShadow:\"2px 2px 0 rgba(255, 255, 255, 0.9), 0 4px 10px rgba(0, 0, 0, 0.18)\",outline:focusedElement===\"accept\"?`2px solid ${primaryButtonTextColor}`:\"none\",outlineOffset:\"2px\"},children:acceptLabel}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onFocus:()=>React.startTransition(()=>setFocusedElement(\"necessary\")),onBlur:()=>React.startTransition(()=>setFocusedElement(\"\")),onClick:()=>saveChoice(\"necessaryOnly\"),style:{flex:1,border:`1px solid ${borderColor}`,borderRadius:\"10px\",padding:\"12px 14px\",background:secondaryButtonBackground,color:secondaryButtonTextColor,cursor:\"pointer\",fontFamily:textFont.fontFamily,fontSize:14,fontWeight:600,lineHeight:1.2,outline:focusedElement===\"necessary\"?`2px solid ${secondaryButtonTextColor}`:\"none\",outlineOffset:\"2px\"},children:necessaryOnlyLabel})]})]})})});}addPropertyControls(CustomCookieBanner,{title:{type:ControlType.String,title:\"Titel\",defaultValue:\"Cookie-Einstellungen\"},bodyText:{type:ControlType.String,title:\"Text\",displayTextArea:true,defaultValue:\"Wir verwenden notwendige Cookies, damit unsere Website zuverl\\xe4ssig funktioniert. Mit deiner Zustimmung verwenden wir au\\xdferdem Cookies f\\xfcr Statistik und Marketing. Du kannst deine Einwilligung jederzeit widerrufen.\"},policyPrefix:{type:ControlType.String,title:\"Policy Prefix\",defaultValue:\"Weitere Informationen findest du unter\"},policyLabel:{type:ControlType.String,title:\"Policy Label\",defaultValue:\"Datenschutz\"},policyUrl:{type:ControlType.Link,title:\"Policy URL\",defaultValue:\"/datenschutz\"},acceptLabel:{type:ControlType.String,title:\"Accept\",defaultValue:\"Alle akzeptieren\"},necessaryOnlyLabel:{type:ControlType.String,title:\"Necessary\",defaultValue:\"Nur notwendige\"},panelBackground:{type:ControlType.Color,title:\"Panel BG\",defaultValue:\"rgba(255, 255, 255, 0.14)\"},titleColor:{type:ControlType.Color,title:\"Title\",defaultValue:\"#FFFFFF\"},bodyColor:{type:ControlType.Color,title:\"Body\",defaultValue:\"rgba(255, 255, 255, 0.86)\"},linkColor:{type:ControlType.Color,title:\"Link\",defaultValue:\"#FFFFFF\"},primaryButtonBackground:{type:ControlType.Color,title:\"Primary BG\",defaultValue:\"#E50914\"},primaryButtonTextColor:{type:ControlType.Color,title:\"Primary Text\",defaultValue:\"#FFFFFF\"},secondaryButtonBackground:{type:ControlType.Color,title:\"Secondary BG\",defaultValue:\"rgba(255, 255, 255, 0.12)\"},secondaryButtonTextColor:{type:ControlType.Color,title:\"Secondary Text\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(255, 255, 255, 0.3)\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"16px\"},panelWidth:{type:ControlType.Number,title:\"Panel Width\",defaultValue:620,min:320,max:900,step:1,unit:\"px\"},panelPadding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"24px\"},panelBlur:{type:ControlType.Number,title:\"Panel Blur\",defaultValue:38,min:0,max:80,step:1,unit:\"px\"},backdropColor:{type:ControlType.Color,title:\"Backdrop\",defaultValue:\"rgba(0, 0, 0, 0.62)\"},textFont:{type:ControlType.Font,title:\"Text Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},showInCanvasPreview:{type:ControlType.Boolean,title:\"Show Canvas\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},forceShowBanner:{type:ControlType.Boolean,title:\"Force Show\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},resetStoredChoice:{type:ControlType.Boolean,title:\"Reset Choice\",defaultValue:false,enabledTitle:\"Reset\",disabledTitle:\"Keep\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomCookieBanner\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomCookieBanner.map"],"mappings":"0OAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,QAAM,WAAS,eAAa,cAAY,YAAU,cAAY,qBAAmB,kBAAgB,aAAW,YAAU,YAAU,0BAAwB,yBAAuB,4BAA0B,2BAAyB,cAAY,eAAa,aAAW,eAAa,YAAU,gBAAc,WAAS,sBAAoB,kBAAgB,qBAAmB,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAe,GAAmBA,EAAe,EAAE,EAAO,CAAC,EAAS,GAAaA,EAAe,EAAK,EAAQ,EAAgBC,MAAsB,CAAqG,EAA1F,IAAS,WAA2G,EAAY,EAAK,MAArF,EAAY,EAAO,WAAW,GAAG,CAAqD,CAAG,EAAE,CAAC,CAAC,EAAE,MAAoB,CAAC,GAAU,IAAS,OAAiF,OAApE,EAAgB,EAAE,EAAO,iBAAiB,SAAS,CAAe,MAAY,EAAO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