{"version":3,"file":"shared-lib.Cdfep8u6.mjs","names":["useState","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/ZVSmTNmDJVW6yRRw8c1j/nUCWG6r0aXuD8FdW1SbQ/LocalizedSignupCTA.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useLocaleInfo}from\"framer\";import{startTransition,useCallback,useMemo,useState}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LocalizedSignupCTA(props){const{fallbackLabel,backgroundColor,textColor,hoverColor,borderColor,borderWidth,ukrainianWidth,alignment,textFont,padding,cornerRadius}=props;const localeInfo=useLocaleInfo();const[isHovered,setIsHovered]=useState(false);const activeLocale=localeInfo?.activeLocale;const localeCode=activeLocale?.code;const normalizedLocaleCode=localeCode?.toLowerCase()??\"\";const isEstonian=normalizedLocaleCode===\"et\";const localeIdentity=useMemo(()=>{const candidates=[activeLocale?.code,activeLocale?.id,activeLocale?.name,activeLocale?.title,activeLocale?.slug,activeLocale?.displayName];return candidates.filter(value=>typeof value===\"string\").map(value=>value.toLowerCase().trim()).filter(Boolean);},[activeLocale?.code,activeLocale?.displayName,activeLocale?.id,activeLocale?.name,activeLocale?.slug,activeLocale?.title]);const isUkrainian=useMemo(()=>{return localeIdentity.some(value=>{const normalizedValue=value.toLowerCase();return normalizedValue===\"uk\"||normalizedValue===\"ua\"||normalizedValue.startsWith(\"uk-\")||normalizedValue.startsWith(\"ua-\")||normalizedValue.includes(\"ukrain\")||normalizedValue.includes(\"україн\")||normalizedValue.includes(\"украин\");});},[localeIdentity]);const hasExplicitFallbackLabel=useMemo(()=>{if(typeof fallbackLabel!==\"string\")return false;const trimmedFallbackLabel=fallbackLabel.trim();return trimmedFallbackLabel.length>0&&trimmedFallbackLabel!==\"Start Free Trial\";},[fallbackLabel]);const cta=useMemo(()=>{if(hasExplicitFallbackLabel){if(isEstonian){return{label:fallbackLabel,href:\"https://admin.hopitude.com/et/signup/\"};}if(isUkrainian){return{label:fallbackLabel,href:\"https://admin.hopitude.com/uk/signup/\"};}return{label:fallbackLabel,href:\"https://admin.hopitude.com/en/signup/\"};}if(isEstonian){return{label:\"Proovi tasuta\",href:\"https://admin.hopitude.com/et/signup/\"};}if(isUkrainian){return{label:\"Спробувати безкоштовно\",href:\"https://admin.hopitude.com/uk/signup/\"};}return{label:localeCode?\"Start Free Trial\":fallbackLabel,href:\"https://admin.hopitude.com/en/signup/\"};},[fallbackLabel,hasExplicitFallbackLabel,isEstonian,isUkrainian,localeCode]);const handleMouseEnter=useCallback(()=>{startTransition(()=>setIsHovered(true));},[]);const handleMouseLeave=useCallback(()=>{startTransition(()=>setIsHovered(false));},[]);const buttonStyle=useMemo(()=>({position:\"relative\",width:isUkrainian?`${ukrainianWidth}px`:\"fit-content\",minWidth:isUkrainian?`${ukrainianWidth}px`:\"max-content\",height:\"auto\",display:\"inline-flex\",alignItems:\"center\",justifyContent:alignment===\"left\"?\"flex-start\":alignment===\"right\"?\"flex-end\":\"center\",textDecoration:\"none\",boxSizing:\"border-box\",backgroundColor:isHovered?hoverColor:backgroundColor,color:textColor,borderRadius:cornerRadius,borderStyle:\"solid\",borderColor,borderWidth,padding,cursor:\"pointer\",transition:\"background-color 0.2s ease\",fontFamily:textFont.fontFamily||\"Inter, sans-serif\",fontSize:textFont.fontSize,fontWeight:textFont.fontWeight,lineHeight:textFont.lineHeight,letterSpacing:textFont.letterSpacing,fontStyle:textFont.fontStyle,textAlign:alignment,whiteSpace:\"nowrap\"}),[alignment,backgroundColor,borderColor,borderWidth,cornerRadius,hoverColor,isHovered,isUkrainian,padding,textColor,textFont.fontFamily,textFont.fontSize,textFont.fontStyle,textFont.fontWeight,textFont.letterSpacing,textFont.lineHeight,textFont.textAlign,ukrainianWidth]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:alignment===\"left\"?\"flex-start\":alignment===\"right\"?\"flex-end\":\"center\"},children:/*#__PURE__*/_jsx(\"a\",{href:cta.href,style:buttonStyle,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,\"aria-label\":cta.label,children:cta.label})});}addPropertyControls(LocalizedSignupCTA,{fallbackLabel:{title:\"Fallback Label\",type:ControlType.String,defaultValue:\"Start Free Trial\"},backgroundColor:{title:\"Background\",type:ControlType.Color,defaultValue:\"#8EF45C\"},hoverColor:{title:\"Hover Color\",type:ControlType.Color,defaultValue:\"#82E553\"},borderColor:{title:\"Border Color\",type:ControlType.Color,defaultValue:\"transparent\"},borderWidth:{title:\"Border Width\",type:ControlType.Number,defaultValue:0,min:0,max:20,unit:\"px\",step:1},ukrainianWidth:{title:\"UA Width\",type:ControlType.Number,defaultValue:220,min:100,max:500,unit:\"px\",step:1},alignment:{title:\"Alignment\",type:ControlType.Enum,defaultValue:\"center\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true},textColor:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#0E4A2C\"},textFont:{title:\"Text Font\",type:ControlType.Font,defaultValue:{fontSize:\"14px\",variant:\"Medium\",lineHeight:\"1em\",letterSpacing:\"-0.01em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},padding:{title:\"Padding\",type:ControlType.Padding,defaultValue:\"13px 20px\"},cornerRadius:{title:\"Radius\",type:ControlType.BorderRadius,defaultValue:\"999px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LocalizedSignupCTA\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LocalizedSignupCTA.map"],"mappings":"6LAGG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,g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