{"version":3,"file":"SimulatorButton.BhdAzPBH.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/liW3yPhzQPyodp5gWHDB/eX5WQDeV11bfBfm915NW/SimulatorButton.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/Dn3v2txfpz3cdB4m0R8o/CreditStore.js\";import{useSimulatorURL}from\"https://framerusercontent.com/modules/6yTW9nDSqM7wcBWAdnDT/Kmp6WULrNb624rnrCLtN/useSimulatorURL.js\";export default function SimulatorButton(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:400,fontFamily:\"Stack Sans Text, sans-serif\",lineHeight:\"115%\",letterSpacing:\"-0.02em\",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,{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\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"iTAEkY,SAAwB,EAAgB,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,GAAa,CAAM,CAAC,EAAM,GAAUA,EAAe,GAAM,CAAM,CAAC,EAAQ,GAAYA,EAAe,GAAM,CAAK,EAAO,IAAI,GAAG,CAAC,IAAM,EAAW,KAAkB,CAAO,EAAM,MAAM,QAAQ,EAAW,CAAC,EAAW,GAAG,EAAc,GAAc,EAAM,SAAS,SAAY,EAAO,OAAO,EAAM,OAAO,EAAE,UAAa,CAAC,EAAO,IAAK,IAAM,EAAU,EAAgB,CAAC,aAAW,YAAU,cAAY,SAAO,CAAC,CAAO,EAAQ,GAAO,CAAC,EAAc,EAAkB,EAAQ,EAAkB,EAAQ,EAAgB,EAAiB,EAAa,EAAQ,EAAe,EAAQ,EAAa,EAAc,EAA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