{"version":3,"file":"Utils.Dxh72Pyt.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/ruY9qHH9jFOgSnjcnW2c/Ck9SkWrGBlRmv6dfnhGc/Utils.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({background:\"#0099FF\",subscriptionExpanded:false});// Diese Funktion prüft, ob die Web Share API verfügbar ist\nfunction canShare(){return navigator.share!==undefined;}function copyToClipboard(url){const textarea=document.createElement(\"textarea\");textarea.value=url;document.body.appendChild(textarea);textarea.select();document.execCommand(\"copy\");document.body.removeChild(textarea);alert(\"URL kopiert: \"+url);}// Fallback für Browser, die die Web Share API nicht unterstützen\nfunction fallbackShare(){copyToClipboard(window.location.href);// Hier können Sie auch Social-Media-Sharing-Links einfügen\n}// Diese Funktion wird aufgerufen, wenn der Benutzer auf die Schaltfläche \"Teilen\" klickt\nfunction shareContent(title){// Prüfen, ob die Web Share API verfügbar ist\nif(canShare()){navigator.share({title,text:\"Schauen Sie sich diesen gro\\xdfartigen Artikel an!\",url:window.location.href}).then(()=>{console.log(\"Erfolgreich geteilt!\");}).catch(error=>{console.log(\"Teilen fehlgeschlagen\",error);});}else{fallbackShare();// Fallback für Browser, die die Web Share API nicht unterstützen\nconsole.log(\"Web Share API wird in diesem Browser nicht unterst\\xfctzt.\");}}export function replaceStudioTextWithGetParams(Component){return props=>{const text=props?.children?.props?.children?.props?.children;console.log(\"props\",props);if(text){const urlParams=new URLSearchParams(window?.location?.search);const studio=urlParams.get(\"studio\")?urlParams.get(\"studio\")+\" \":\"\";props.children.props.children.props.children=text.replace(\"[STUDIO] \",studio);console.log(\"replacedText\",props.children.props.children.props.children);}return /*#__PURE__*/_jsx(Component,{...props});};}function addQueryParam(url,param,value){// Prüft, ob die URL bereits Query-Parameter enthält\nif(url.includes(\"?\")){// Wenn ja, fügt den neuen Parameter mit einem '&' hinzu\nurl+=\"&\"+encodeURIComponent(param)+\"=\"+encodeURIComponent(value);}else{// Wenn nicht, startet den Query-String mit '?'\nurl+=\"?\"+encodeURIComponent(param)+\"=\"+encodeURIComponent(value);}return url;}export function addExpanded(Component){return props=>{const[frameHeight,setFrameHeight]=useState(625);const frameRef=useRef(null);const changeParentStyle=()=>{if(frameRef.current&&frameRef.current.parentElement){frameRef.current.parentElement.style.height=\"fit-content\";console.log(\"Parent height set to fit-content\");}};useEffect(()=>{const handleMessage=e=>{if(e?.data?.frameHeight){console.log(\"e\",e?.data?.frameHeight+300);setFrameHeight(e.data.frameHeight);}};window.addEventListener(\"message\",handleMessage);changeParentStyle();return()=>{window.removeEventListener(\"message\",handleMessage);};},[]);useEffect(()=>{changeParentStyle();},[frameRef.current]);props.height=\"fit-content\";props.style.height=\"fit-content\";return /*#__PURE__*/_jsx(\"div\",{ref:frameRef,style:{height:frameHeight,width:\"100%\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}export function setSubscriptionExpanded(Component){return props=>{const[{subscriptionExpanded},setStore]=useStore();return!subscriptionExpanded&&/*#__PURE__*/_jsx(Component,{...props,onClick:()=>setStore({subscriptionExpanded:true})});};}export function withShare(Component){return props=>{console.log(props);return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>shareContent(props.title)});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withShare\":{\"type\":\"reactHoc\",\"name\":\"withShare\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"replaceStudioTextWithGetParams\":{\"type\":\"reactHoc\",\"name\":\"replaceStudioTextWithGetParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"setSubscriptionExpanded\":{\"type\":\"reactHoc\",\"name\":\"setSubscriptionExpanded\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addExpanded\":{\"type\":\"reactHoc\",\"name\":\"addExpanded\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":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