{"version":3,"file":"OptInIFrame.DDdxx1Cz.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/LDnsUFBYDoLpDVIdecxS/ZK65AUXEkXi3VyeHnUrk/OptInIFrame.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import*as React from\"react\";import{ConsentManagerZeitgewinn}from\"https://framerusercontent.com/modules/tS2xqHklkOx720cdpKhx/hnmbXra5FlGpgnm0p86g/ConsentManagerZeitgewinn.js\";export function OptInIFrame(props){// Set default values for props\nconst{backgroundColor=\"#000000\",hoverColor=\"#8B572A\",textColor=\"#FFFFFF\",buttonText=\"Jetzt Feature aktivieren\",fontFamily=\"Inter\",linkUrl=\"#\",width=100,cookieName=\"cookie_consent\",featureFrameId=\"featureFrame\",featureFrameSrc=\"https://example.com/feature\",optInBoxId=\"optInBox\",featureBoxId=\"featureBox\"}=props;// Create a style for the container div\nconst containerStyle={width:typeof width===\"number\"?`${width}%`:width,backgroundColor:backgroundColor,display:\"block\",padding:\"16px 24px\",textAlign:\"center\",transition:\"background-color 0.3s ease\"};// Create a style for the link\nconst linkStyle={color:textColor,textDecoration:\"none\",fontFamily:fontFamily,fontSize:\"16px\",fontWeight:500,display:\"block\",width:\"100%\"};// 2. Functional-Consent prüfen\nconst hasFunctionalConsent=ConsentManagerZeitgewinn.isFunctionalConsentGiven();// 3. Text für den Button festlegen\nconst displayText=hasFunctionalConsent?buttonText:\"Cookie-Einstellungen\";// Handle hover state with React's useState hook\nconst[isHovering,setIsHovering]=React.useState(false);// Update the background color based on hover state\nconst dynamicContainerStyle={...containerStyle,backgroundColor:isHovering?hoverColor:backgroundColor};const handleClick=e=>{// If linkUrl is \"#\", prevent default behavior to avoid page jump\nif(linkUrl===\"#\"){e.preventDefault();}// You could add any additional click handling here\n};return /*#__PURE__*/_jsx(\"button\",{// className=\"cky-banner-element\"\nstyle:{...dynamicContainerStyle,cursor:\"pointer\",border:\"none\",outline:\"none\",color:textColor,fontFamily:fontFamily,fontSize:\"16px\",fontWeight:500},onMouseEnter:()=>setIsHovering(true),onMouseLeave:()=>setIsHovering(false),onClick:e=>{if(!ConsentManagerZeitgewinn.isFunctionalConsentGiven()){return;}e.preventDefault();// Set the cookie with the specified name\ndocument.cookie=`${cookieName}=true; path=/; max-age=31536000`// valid for 1 year\n;// Set the src attribute of the iframe\nconst featureFrame=document.getElementById(featureFrameId);if(featureFrame){featureFrame.src=featureFrameSrc;}// Hide the opt-in box\nconst optInBox=document.getElementById(optInBoxId);if(optInBox){optInBox.style.display=\"none\";}// Show the feature box\nconst featureBox=document.getElementById(featureBoxId);if(featureBox){featureBox.style.display=\"flex\";}},children:displayText});}// Add property controls to make the component customizable in Framer\naddPropertyControls(OptInIFrame,{backgroundColor:{type:ControlType.Color,title:\"Hintergrundfarbe\",defaultValue:\"#000000\"},hoverColor:{type:ControlType.Color,title:\"Hover Farbe\",defaultValue:\"#8B572A\"},textColor:{type:ControlType.Color,title:\"Textfarbe\",defaultValue:\"#FFFFFF\"},buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Jetzt feature aktivieren\"},fontFamily:{type:ControlType.Enum,title:\"Schriftart\",options:[\"Inter\",\"Arial\",\"Helvetica\",\"Roboto\",\"Open Sans\",\"Montserrat\",\"Verdana\",\"Georgia\",\"Times New Roman\"],optionTitles:[\"Inter\",\"Arial\",\"Helvetica\",\"Roboto\",\"Open Sans\",\"Montserrat\",\"Verdana\",\"Georgia\",\"Times New Roman\"],defaultValue:\"Inter\"},linkUrl:{type:ControlType.String,title:\"Link URL\",defaultValue:\"#\"},width:{type:ControlType.Number,title:\"Breite\",defaultValue:100,unit:\"%\",min:10,max:100,step:1,displayStepper:true},cookieName:{type:ControlType.String,title:\"Cookie Name\",defaultValue:\"cookie_consent\"},featureFrameId:{type:ControlType.String,title:\"Feature Frame ID\",defaultValue:\"featureFrame\"},featureFrameSrc:{type:ControlType.String,title:\"Feature Frame Source URL\",defaultValue:\"https://example.com/feature\"},optInBoxId:{type:ControlType.String,title:\"Opt-In Box ID\",defaultValue:\"optInBox\"},featureBoxId:{type:ControlType.String,title:\"Feature Box ID\",defaultValue:\"featureBox\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"OptInIFrame\":{\"type\":\"reactComponent\",\"name\":\"OptInIFrame\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"gXAA6Q,SAAgB,EAAY,EAAM,CAC/S,GAAK,CAAC,kBAAgB,UAAU,aAAW,UAAU,YAAU,UAAU,aAAW,2BAA2B,aAAW,QAAQ,UAAQ,IAAI,QAAM,IAAI,aAAW,iBAAiB,iBAAe,eAAe,kBAAgB,8BAA8B,aAAW,WAAW,eAAa,cAAc,EAC3S,EAAe,CAAC,MAAM,OAAO,GAAQ,SAAS,GAAG,EAAM,GAAG,EAAsB,kBAAgB,QAAQ,QAAQ,QAAQ,YAAY,UAAU,SAAS,WAAW,6BAA6B,CAG/L,EADqB,EAAyB,0BAA0B,CACvC,EAAW,uBAC7C,CAAC,EAAW,GAAeA,EAAe,GAAM,CAC/C,EAAsB,CAAC,GAAG,EAAe,gBAAgB,EAAW,EAAW,EAAgB,CAEnG,OAAoB,EAAK,SAAS,CACpC,MAAM,CAAC,GAAG,EAAsB,OAAO,UAAU,OAAO,OAAO,QAAQ,OAAO,MAAM,EAAqB,aAAW,SAAS,OAAO,WAAW,IAAI,CAAC,iBAAiB,EAAc,GAAK,CAAC,iBAAiB,EAAc,GAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC,EAAyB,0BAA0B,CAAE,OAAQ,EAAE,gBAAgB,CAC9T,SAAS,OAAO,GAAG,EAAW,iCAE9B,IAAM,EAAa,SAAS,eAAe,EAAe,CAAI,IAAc,EAAa,IAAI,GAC7F,IAAM,EAAS,SAAS,eAAe,EAAW,CAAI,IAAU,EAAS,MAAM,QAAQ,QACvF,IAAM,EAAW,SAAS,eAAe,EAAa,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