{"version":3,"file":"Barn.BMCLmAwB.mjs","names":["React.useMemo"],"sources":["https:/framerusercontent.com/modules/cbxfwP4cozq0EqRKv2NV/JMfhTnjLddjULBaGEpC4/Barn.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function BarncancerfondenWidget(props){const{businessId,language}=props;// 1. Logic from the script: Clean the ID\nconst cleanId=businessId?businessId.toLowerCase():\"\";// 2. Logic from the script: Generate date for cache busting\n// We use useMemo so the image doesn't reload unnecessarily\nconst dateParam=React.useMemo(()=>new Date().toString(),[]);// 3. Logic from the script: Construct the URL\nlet imgSrc=\"\";if(language===\"en\"){imgSrc=`https://tmafiler.barncancerfonden.se/BCF-widget/companies/${cleanId}/barncancerfonden-widget-en?date=${dateParam}`;}else{imgSrc=`https://tmafiler.barncancerfonden.se/BCF-widget/companies/${cleanId}/barncancerfonden-widget?date=${dateParam}`;}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"div\",{\"data-bcf-business-id\":businessId,\"data-widget-language\":language,style:{width:\"55%\",height:\"55%\"},children:/*#__PURE__*/_jsx(\"a\",{href:\"https://www.barncancerfonden.se\",target:\"_blank\",rel:\"noopener noreferrer\"// Security best practice\n,style:linkStyle,children:cleanId?/*#__PURE__*/_jsx(\"img\",{src:imgSrc,alt:\"Barncancerfonden Widget\",style:imgStyle}):/*#__PURE__*/_jsx(\"div\",{style:placeholderStyle,children:\"Enter Business ID\"})})})});}// --- Styles ---\nconst containerStyle={display:\"flex\",justifyContent:\"center\",alignItems:\"center\",width:\"100%\",height:\"100%\",overflow:\"hidden\"};const linkStyle={display:\"block\",width:\"100%\",height:\"100%\",textDecoration:\"none\",border:\"none\"};const imgStyle={width:\"100%\",height:\"100%\",objectFit:\"contain\",display:\"block\"};const placeholderStyle={width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"#f0f0f0\",color:\"#888\",fontSize:\"12px\"};// --- Controls ---\naddPropertyControls(BarncancerfondenWidget,{businessId:{type:ControlType.String,title:\"Business ID\",defaultValue:\"Good Folks Sweden AB\",placeholder:\"e.g., Good Folks Sweden AB\"},language:{type:ControlType.Enum,title:\"Language\",options:[\"sv\",\"en\"],optionTitles:[\"Swedish\",\"English\"],defaultValue:\"sv\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BarncancerfondenWidget\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Barn.map"],"mappings":"qKAGG,SAAwB,EAAuB,EAAM,CAAC,GAAK,CAAC,aAAW,YAAU,EAC9E,EAAQ,EAAW,EAAW,YAAY,EAAE,GAE5C,EAAUA,MAAkB,IAAI,KAAK,CAAA,CAAE,SAAS,EAAE,CAAC,CAAC,EACtD,EAAO,GAAiR,MAA9Q,CAAqJ,EAAlJ,IAAW,KAAa,6DAA6D,EAAQ,mCAAmC,IAAyB,6DAA6D,EAAQ,gCAAgC,IAAiC,EAAK,MAAM,CAAC,MAAM,EAAe,SAAsB,EAAK,MAAM,CAAC,uBAAuB,EAAW,uBAAuB,EAAS,MAAM,CAAC,MAAM,MAAM,OAAO,KAAK,EAAE,SAAsB,EAAK,IAAI,CAAC,KAAK,kCAAkC,OAAO,SAAS,IAAI,sBAChjB,MAAM,EAAU,SAAS,EAAqB,EAAK,MAAM,CAAC,IAAI,EAAO,IAAI,0BAA0B,MAAM,CAAQ,CAAC,EAAe,EAAK,MAAM,CAAC,MAAM,EAAiB,SAAS,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,yBARhK,IAA4B,IAAoD,EASpH,EAAe,CAAC,QAAQ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