{"version":3,"file":"SimulatorButton_old.BVT49DZi.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/U2lAUE0fUmM5i5Qeu1dk/wHB7ozljMeLCxDEtfC1E/SimulatorButton_old.js"],"sourcesContent":["// @framerSupportedLayoutWidth any\n// @framerSupportedLayoutHeight fixed\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useTracking}from\"framer\";import{useCreditStore}from\"https://framerusercontent.com/modules/SwnDQm82Xt81SD83IHNA/sIfV2WMlF4kx8NLFkZvH/CreditStore.js\";import{useSimulatorURL}from\"https://framerusercontent.com/modules/6yTW9nDSqM7wcBWAdnDT/IiCOToR85aboVCTCweHa/useSimulatorURL.js\";export default function SimulatorButton_old(props){const{text,tracking,destinyURL,staticURL,extraParams,buttonHeight,padding,radius,textSize,background,content,stroke,border,backgroundHover,contentHover,borderHover,backgroundPressed,contentPressed,borderPressed,pressedScale,style}=props;const track=useTracking();const[hover,setHover]=React.useState(false);const[pressed,setPressed]=React.useState(false);let credit=1e4;try{const storeTuple=useCreditStore?.();const store=Array.isArray(storeTuple)?storeTuple[0]:storeTuple;if(store&&typeof store.credit!==\"undefined\")credit=Number(store.credit)||1e4;}catch(e){credit=1e4;}const targetUrl=useSimulatorURL({destinyURL,staticURL,extraParams,credit});const isHover=hover&&!pressed;const currentBackground=pressed?backgroundPressed:isHover?backgroundHover:background;const currentColor=pressed?contentPressed:isHover?contentHover:content;const currentBorderColor=pressed?borderPressed:isHover?borderHover:border;const currentScale=pressed?pressedScale:1;function handleClick(){track(tracking||\"simulador\");if(typeof window!==\"undefined\")window.location.href=targetUrl;}return /*#__PURE__*/_jsx(\"div\",{style:{...style,height:buttonHeight,minHeight:buttonHeight,maxHeight:buttonHeight,width:style?.width??\"100%\",display:\"block\"},children:/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:handleClick,onMouseEnter:()=>setHover(true),onMouseLeave:()=>{setHover(false);setPressed(false);},onMouseDown:()=>setPressed(true),onMouseUp:()=>setPressed(false),onTouchStart:()=>setPressed(true),onTouchEnd:()=>setPressed(false),style:{width:\"100%\",height:\"100%\",background:currentBackground,color:currentColor,border:`${stroke}px solid ${currentBorderColor}`,fontSize:textSize,fontWeight:500,fontFamily:\"Red Hat Display, sans-serif\",lineHeight:\"115%\",padding:`0 ${padding}px`,borderRadius:radius,cursor:\"pointer\",outline:\"none\",appearance:\"none\",boxSizing:\"border-box\",userSelect:\"none\",transform:`scale(${currentScale})`,transition:\"background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease\"},children:text})});}addPropertyControls(SimulatorButton_old,{destinyURL:{type:ControlType.Enum,title:\"destinyURL\",options:[\"simulador\",\"seguro\",\"consorcio\",\"compraplanejada\"],optionTitles:[\"simulador\",\"seguro\",\"consorcio\",\"compraplanejada\"],defaultValue:\"simulador\"},staticURL:{type:ControlType.Enum,title:\"staticURL\",options:[\"none\",\"auto\",\"celular\",\"cnh\",\"computador\",\"games\",\"imovel\",\"moto\",\"pesado\",\"viagem\"],optionTitles:[\"none\",\"auto\",\"celular\",\"cnh\",\"computador\",\"games\",\"imovel\",\"moto\",\"pesado\",\"viagem\"],defaultValue:\"none\"},buttonHeight:{type:ControlType.Number,title:\"height\",defaultValue:48,min:24,max:64,unit:\"px\"},pressedScale:{type:ControlType.Number,title:\"pressedScale\",defaultValue:.98,min:.9,max:1,step:.01},padding:{type:ControlType.Number,title:\"padding\",defaultValue:20,min:8,max:80,unit:\"px\"},radius:{type:ControlType.Number,title:\"radius\",defaultValue:20,min:4,max:40},background:{type:ControlType.Color,title:\"background\",defaultValue:\"#FFB73F\"},backgroundHover:{type:ControlType.Color,title:\"backgroundHover\",defaultValue:\"#FFC360\"},backgroundPressed:{type:ControlType.Color,title:\"backgroundPressed\",defaultValue:\"#FFCF81\"},textSize:{type:ControlType.Number,title:\"textSize\",defaultValue:14,min:10,max:18},text:{type:ControlType.String,title:\"text\",defaultValue:\"Simular agora\"},extraParams:{type:ControlType.String,title:\"extraParams\",defaultValue:\"\"},tracking:{type:ControlType.String,title:\"tracking\",defaultValue:\"simulador\"},content:{type:ControlType.Color,title:\"content\",defaultValue:\"#1A1000\"},contentHover:{type:ControlType.Color,title:\"contentHover\",defaultValue:\"#1A1000\"},contentPressed:{type:ControlType.Color,title:\"contentPressed\",defaultValue:\"#1A1000\"},stroke:{type:ControlType.Number,title:\"stroke\",defaultValue:1,min:0,max:4,unit:\"px\"},border:{type:ControlType.Color,title:\"border\",defaultValue:\"#FFB73F\"},borderHover:{type:ControlType.Color,title:\"borderHover\",defaultValue:\"#FFB73F\"},borderPressed:{type:ControlType.Color,title:\"borderPressed\",defaultValue:\"#FFB73F\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SimulatorButton_old\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"+PAEkY,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,aAAW,YAAU,cAAY,eAAa,UAAQ,SAAO,WAAS,aAAW,UAAQ,SAAO,SAAO,kBAAgB,eAAa,cAAY,oBAAkB,iBAAe,gBAAc,eAAa,SAAO,EAAY,EAAM,EAAY,EAAO,CAAC,EAAM,GAAUA,EAAe,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAM,EAAO,IAAI,GAAG,CAAC,IAAM,EAAW,IAAiB,EAAQ,EAAM,MAAM,QAAQ,CAAU,EAAE,EAAW,GAAG,EAAc,GAAc,EAAM,SAAS,SAAY,EAAO,OAAO,EAAM,MAAM,GAAG,IAAI,MAAS,CAAC,EAAO,GAAI,CAAC,IAAM,EAAU,EAAgB,CAAC,aAAW,YAAU,cAAY,QAAM,CAAC,EAAQ,EAAQ,GAAO,CAAC,EAAc,EAAkB,EAAQ,EAAkB,EAAQ,EAAgB,EAAiB,EAAa,EAAQ,EAAe,EAAQ,EAAa,E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