{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/EefyPMUDLuwV7JJELrdL/RnbEDbmn1Oq9o5jub5nE/AspectRatioLogo.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Logo Uploader with Aspect Ratio\n *\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-auto\n * @framerSupportedLayoutHeight any-prefer-auto\n */export default function AspectRatioLogo(props){const{logoFile=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",fixedHeight=80,invertColors=false,noColor=false,style}=props;const[aspectRatio,setAspectRatio]=useState(1);const[isSVG,setIsSVG]=useState(false);const[svgSize,setSvgSize]=useState({width:1,height:1});const imgRef=useRef(null);const[isLoading,setIsLoading]=useState(true);useEffect(()=>{if(!logoFile){startTransition(()=>{setAspectRatio(1);setIsSVG(false);setIsLoading(false);});return;}const isSvgFile=logoFile.endsWith(\".svg\");startTransition(()=>{setIsLoading(true);setIsSVG(isSvgFile);});if(isSvgFile){fetch(logoFile).then(res=>res.text()).then(svgText=>{const parser=new DOMParser;const doc=parser.parseFromString(svgText,\"image/svg+xml\");const svg=doc.querySelector(\"svg\");let newAspectRatio=1;if(svg){let width=parseFloat(svg.getAttribute(\"width\")||\"0\");let height=parseFloat(svg.getAttribute(\"height\")||\"0\");if(!width||!height){const viewBox=svg.getAttribute(\"viewBox\");if(viewBox){const parts=viewBox.split(\" \").map(Number);if(parts.length===4){width=parts[2];height=parts[3];}}}if(width&&height){setSvgSize({width,height});newAspectRatio=width/height;}}startTransition(()=>{setAspectRatio(newAspectRatio);setIsLoading(false);});}).catch(()=>{startTransition(()=>{setAspectRatio(1);setIsLoading(false);});});}},[logoFile]);useEffect(()=>{if(isSVG||!logoFile){return;}const img=imgRef.current;if(img){const handleLoad=()=>{if(img.naturalWidth&&img.naturalHeight){startTransition(()=>{setAspectRatio(img.naturalWidth/img.naturalHeight);setIsLoading(false);});}else{startTransition(()=>{setAspectRatio(1);setIsLoading(false);});}};const handleError=()=>{startTransition(()=>{setAspectRatio(1);setIsLoading(false);});};img.addEventListener(\"load\",handleLoad);img.addEventListener(\"error\",handleError);if(img.complete){img.removeEventListener(\"load\",handleLoad);img.removeEventListener(\"error\",handleError);if(img.naturalWidth&&img.naturalHeight){handleLoad();}else{handleError();}}return()=>{img.removeEventListener(\"load\",handleLoad);img.removeEventListener(\"error\",handleError);};}},[isSVG,logoFile]);const width=Math.round(fixedHeight*aspectRatio);const height=fixedHeight;const containerStyle={...style,width:style&&style.width===\"100%\"?\"100%\":width,height:style&&style.height===\"100%\"?\"100%\":height,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",background:\"transparent\",position:\"relative\",userSelect:\"none\",WebkitUserSelect:\"none\",MozUserSelect:\"none\",msUserSelect:\"none\",pointerEvents:\"auto\",opacity:isLoading?0:1,visibility:isLoading?\"hidden\":\"visible\",transition:\"opacity 0.2s ease-in-out\"};const imageStyle={width:\"100%\",height:\"100%\",objectFit:\"contain\",pointerEvents:\"none\",userSelect:\"none\",WebkitUserDrag:\"none\",MozUserSelect:\"none\",msUserSelect:\"none\",display:\"block\"};// Modified filter style to use contrast and grayscale instead of brightness\nconst filterStyle={filter:noColor?`contrast(600%) grayscale(100%) ${invertColors?\"invert(1)\":\"\"}`:invertColors?\"invert(1) hue-rotate(180deg)\":\"\"};return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,\"aria-label\":\"Logo Container\",children:isSVG?/*#__PURE__*/_jsx(\"img\",{src:logoFile,alt:\"Logo\",style:{...imageStyle,...filterStyle},draggable:false,\"aria-label\":\"Logo\"}):/*#__PURE__*/_jsx(\"img\",{ref:imgRef,src:logoFile,alt:\"Logo\",style:{...imageStyle,...filterStyle},draggable:false,\"aria-label\":\"Logo\"})});}addPropertyControls(AspectRatioLogo,{logoFile:{type:ControlType.File,allowedFileTypes:[\"svg\",\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\"],title:\"Logo\"},fixedHeight:{type:ControlType.Number,title:\"Height\",defaultValue:80,min:1,max:512,step:1,unit:\"px\",displayStepper:true},noColor:{type:ControlType.Boolean,title:\"No Color\",description:\"Makes the logo black and white.\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},invertColors:{type:ControlType.Boolean,title:\"Invert\",description:\"Use this to invert the colors.\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"}});AspectRatioLogo.displayName=\"Aspect Ratio Logo\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AspectRatioLogo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-auto\",\"framerSupportedLayoutWidth\":\"any-prefer-auto\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AspectRatioLogo.map"],
  "mappings": "qHAOkB,SAARA,EAAiCC,EAAM,CAAC,GAAK,CAAC,SAAAC,EAAS,sEAAsE,YAAAC,EAAY,GAAG,aAAAC,EAAa,GAAM,QAAAC,EAAQ,GAAM,MAAAC,CAAK,EAAEL,EAAW,CAACM,EAAYC,CAAc,EAAEC,EAAS,CAAC,EAAO,CAACC,EAAMC,CAAQ,EAAEF,EAAS,EAAK,EAAO,CAACG,EAAQC,CAAU,EAAEJ,EAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAQK,EAAOC,EAAO,IAAI,EAAO,CAACC,EAAUC,CAAY,EAAER,EAAS,EAAI,EAAES,EAAU,IAAI,CAAC,GAAG,CAAChB,EAAS,CAACiB,EAAgB,IAAI,CAACX,EAAe,CAAC,EAAEG,EAAS,EAAK,EAAEM,EAAa,EAAK,CAAE,CAAC,EAAE,MAAO,CAAC,IAAMG,EAAUlB,EAAS,SAAS,MAAM,EAAEiB,EAAgB,IAAI,CAACF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EAAeC,EAAK,MAAM,CAAC,IAAIrB,EAAO,IAAIZ,EAAS,IAAI,OAAO,MAAM,CAAC,GAAG+B,EAAW,GAAGC,CAAW,EAAE,UAAU,GAAM,aAAa,MAAM,CAAC,CAAC,CAAC,CAAE,CAACE,EAAoBpC,EAAgB,CAAC,SAAS,CAAC,KAAKqC,EAAY,KAAK,iBAAiB,CAAC,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,YAAY,CAAC,KAAKA,EAAY,OAAO,MAAM,SAAS,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,KAAK,KAAK,eAAe,EAAI,EAAE,QAAQ,CAAC,KAAKA,EAAY,QAAQ,MAAM,WAAW,YAAY,kCAAkC,aAAa,GAAM,aAAa,MAAM,cAAc,IAAI,EAAE,aAAa,CAAC,KAAKA,EAAY,QAAQ,MAAM,SAAS,YAAY,iCAAiC,aAAa,GAAM,aAAa,MAAM,cAAc,IAAI,CAAC,CAAC,EAAErC,EAAgB,YAAY",
  "names": ["AspectRatioLogo", "props", "logoFile", "fixedHeight", "invertColors", "noColor", "style", "aspectRatio", "setAspectRatio", "ye", "isSVG", "setIsSVG", "svgSize", "setSvgSize", "imgRef", "pe", "isLoading", "setIsLoading", "ue", "Z", "isSvgFile", "res", "svgText", "svg", "newAspectRatio", "width", "height", "viewBox", "parts", "img", "handleLoad", "handleError", "containerStyle", "imageStyle", "filterStyle", "p", "addPropertyControls", "ControlType"]
}
