{"version":3,"file":"SimulatorButton.DVCPSZ4Y.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/liW3yPhzQPyodp5gWHDB/XnPh42QGayMpAaFfATzd/SimulatorButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useTracking}from\"framer\";import{useSimulatorURL}from\"https://framerusercontent.com/modules/6yTW9nDSqM7wcBWAdnDT/IiCOToR85aboVCTCweHa/useSimulatorURL.js\";import{useCreditStore}from\"https://framerusercontent.com/modules/SwnDQm82Xt81SD83IHNA/sIfV2WMlF4kx8NLFkZvH/CreditStore.js\";export default function SimulatorButton(props){const{text,tracking,destinyURL,staticURL,extraParams,groupId,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);const[store]=useCreditStore(groupId);const credit=store.credit;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;return /*#__PURE__*/_jsx(\"div\",{style:{...style,height:buttonHeight,minHeight:buttonHeight,maxHeight:buttonHeight,width:style?.width??\"100%\",display:\"block\"},children:/*#__PURE__*/_jsx(\"a\",{href:targetUrl,rel:\"noopener noreferrer\",onClick:()=>track(tracking||\"simulador\"),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\",textDecoration:\"none\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\"},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:\"\"},groupId:{type:ControlType.String,title:\"Group ID\",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":"sPAAkY,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,aAAW,YAAU,cAAY,UAAQ,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,EAAO,CAAC,GAAO,EAAe,CAAO,EAAQ,EAAO,EAAM,OAAa,EAAU,EAAgB,CAAC,aAAW,YAAU,cAAY,QAAM,CAAC,EAAQ,EAAQ,GAAO,CAAC,EAAc,EAAkB,EAAQ,EAAkB,EAAQ,EAAgB,EAAiB,EAAa,EAAQ,EAAe,EAAQ,EAAa,EAAc,EAAmB,EAAQ,EAAc,EAAQ,EAAY,EAAa,EAAa,EAAQ,EAAa,EAAE,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,OAAO,EAAa,UAAU,EAAa,UAAU,EAAa,MAAM,GAAO,OAAO,OAAO,QAAQ,OAAO,EAAE,SAAsB,E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