{"version":3,"file":"ShareOnFacebook.BqCP227s.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/7JOszn06VBvBoDduhLyd/vLoZGOENhAq6ecL6Eyu1/OpenGraphMetadata.js","https:/framerusercontent.com/modules/wstFb6aEPBBkaGNZ4DRZ/qifL8H1AJFAAFaRKsG6e/ShareOnFacebook.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function OpenGraphMetadata({title=\"\",description=\"\",image=\"\",slug=\"\"}){useEffect(()=>{function setMeta(property,content){if(!content||content===\"undefined\"||content===\"\")return;let element=document.querySelector(`meta[property=\"${property}\"]`);if(!element){element=document.createElement(\"meta\");element.setAttribute(\"property\",property);document.head.appendChild(element);}element.setAttribute(\"content\",content);}// Oppdater Open Graph-metadataene med riktige verdier\nsetMeta(\"og:title\",title||\"Standard tittel\");setMeta(\"og:description\",description||\"Standard beskrivelse\");setMeta(\"og:image\",image||\"https://www.legedom.no/default-image.jpg\");setMeta(\"og:url\",slug?`https://www.legedom.no/${slug}`:\"https://www.legedom.no/\");setMeta(\"og:type\",\"article\");console.log(\"✅ Open Graph metadata oppdatert!\",{title,description,image,slug});},[title,description,image,slug]);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"},children:\"OpenGraphMetadata aktiv!\"});}// 📌 Property Controls for å koble til CMS i Framer\naddPropertyControls(OpenGraphMetadata,{title:{type:ControlType.String,title:\"Title\"},description:{type:ControlType.String,title:\"Description\"},image:{type:ControlType.String,title:\"Image URL\"},slug:{type:ControlType.String,title:\"Slug\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"OpenGraphMetadata\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OpenGraphMetadata.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export default function ShareOnFacebook({slug}){const[currentUrl,setCurrentUrl]=useState(\"https://legedom.no/\");useEffect(()=>{if(typeof window!==\"undefined\"){setCurrentUrl(window.location.href);}},[]);const shareUrl=slug?`https://legedom.no/${slug}`:currentUrl;return /*#__PURE__*/_jsx(\"button\",{onClick:()=>{if(typeof window!==\"undefined\"){window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(shareUrl)}`,\"_blank\");}},style:{padding:\"10px 15px\",backgroundColor:\"#1877F2\",color:\"white\",border:\"none\",borderRadius:\"5px\",cursor:\"pointer\",fontWeight:\"bold\",fontSize:\"18px\"},children:\"Del p\\xe5 Facebook\"});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShareOnFacebook\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShareOnFacebook.map"],"mappings":"kTAA4H,SAAwB,EAAkB,CAAC,QAAM,GAAG,cAAY,GAAG,QAAM,GAAG,OAAK,GAAG,CAAC,CACgM,OAD/L,MAAc,CAAC,SAAS,EAAQ,EAAS,EAAQ,CAAC,GAAG,CAAC,GAAS,IAAU,aAAa,IAAU,GAAG,OAAO,IAAI,EAAQ,SAAS,cAAc,kBAAkB,EAAS,KAAS,IAAS,EAAQ,SAAS,cAAc,QAAQ,EAAQ,aAAa,WAAW,GAAU,SAAS,KAAK,YAAY,MAAkB,aAAa,UAAU,EAAU,CAC1iB,EAAQ,WAAW,GAAO,mBAAmB,EAAQ,iBAAiB,GAAa,wBAAwB,EAAQ,WAAW,GAAO,4CAA4C,EAAQ,SAAS,EAAK,0BAA0B,IAAO,2BAA2B,EAAQ,UAAU,WAAW,QAAQ,IAAI,mCAAmC,CAAC,QAAM,cAAY,QAAM,OAAK,CAAG,EAAC,CAAC,EAAM,EAAY,EAAM,EAAK,EAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO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