{"version":3,"file":"GoBackButton.CDIdqD16.mjs","names":[],"sources":["https:/framerusercontent.com/modules/fLYH2uX4NIqU3F3myGNK/1RuZGujgzCWeIiULF7f5/GoBackButton.js"],"sourcesContent":["// Component that navigates back to the previous page when clicked\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function GoBackButton(props){const{label,backgroundColor,textColor,hoverColor,hoverTextColor,hasBackground,borderRadius,padding,font,showIcon,iconPosition}=props;const handleClick=()=>{if(typeof window!==\"undefined\"&&window.history){try{// Try to go back in history\nif(window.history.length>1){window.history.go(-1);}else{// If no history, try to close the window or go to a default page\nwindow.close();}}catch(error){console.warn(\"Could not navigate back:\",error);// Fallback: try to go to the previous page\nif(document.referrer){window.location.href=document.referrer;}}}};const iconSvg=/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:textColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"m15 18-6-6 6-6\"})});const isFixedWidth=props?.style&&props.style.width===\"100%\";return /*#__PURE__*/_jsxs(\"button\",{onClick:handleClick,style:{...props.style,...isFixedWidth?{}:{width:\"max-content\"},backgroundColor:hasBackground?backgroundColor:\"transparent\",color:textColor,borderRadius,padding:`${padding}px ${padding*1.5}px`,border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",gap:showIcon?\"8px\":\"0\",flexDirection:iconPosition===\"right\"?\"row-reverse\":\"row\",transition:\"all 0.2s ease\",...font},onMouseEnter:e=>{if(hasBackground){e.currentTarget.style.backgroundColor=hoverColor;}e.currentTarget.style.color=hoverTextColor;const icon=e.currentTarget.querySelector(\"svg\");if(icon){icon.style.stroke=hoverTextColor;}},onMouseLeave:e=>{if(hasBackground){e.currentTarget.style.backgroundColor=backgroundColor;}e.currentTarget.style.color=textColor;const icon=e.currentTarget.querySelector(\"svg\");if(icon){icon.style.stroke=textColor;}},onMouseDown:e=>{e.currentTarget.style.transform=\"scale(0.98)\";},onMouseUp:e=>{e.currentTarget.style.transform=\"scale(1)\";},children:[showIcon&&iconSvg,/*#__PURE__*/_jsx(\"span\",{children:label})]});}addPropertyControls(GoBackButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Voltar\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},hoverColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#333333\",hidden:({hasBackground})=>!hasBackground},hoverTextColor:{type:ControlType.Color,title:\"Hover Text Color\",defaultValue:\"#CCCCCC\"},hasBackground:{type:ControlType.Boolean,title:\"Background\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Text Only\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:12,min:4,max:32,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},showIcon:{type:ControlType.Boolean,title:\"Show Icon\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},iconPosition:{type:ControlType.Enum,title:\"Icon Position\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true,hidden:({showIcon})=>!showIcon}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GoBackButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"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