{"version":3,"file":"ThentyErrorMessage.CaCTZAC1.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/qERhjgPA4cB5k1EvYnU6/bUzIcpTSLcSgaqGPHhzz/ThentyErrorMessage.js"],"sourcesContent":["import{jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget,withCSS}from\"framer\";import{useRef}from\"react\";import{textOptions,textOptionsToStyles,useThentyForm}from\"https://framerusercontent.com/modules/diyk5889JEo4mM5y5sJr/fojdC4wfG6J7NmzQMXnM/ThentyShared.js\";const CANVAS_HIDDEN_CLASS_NAME=\"thenty-error-canvas-hidden\";const HIDDEN_CLASS_NAME=\"thenty-error-hidden\";function ThentyFormErrorMessageComponent(props){const{font,color,prefix,suffix,style,textOptions}=props;const Tag=props.tag||\"p\";const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const{formError}=useThentyForm(ref);let className=\"\";if(isCanvas){className=CANVAS_HIDDEN_CLASS_NAME;}else if(!formError){className=HIDDEN_CLASS_NAME;}return /*#__PURE__*/_jsxs(Tag,{ref:ref,className:className,style:{color,margin:0,whiteSpace:style?.width?undefined:\"nowrap\",fontWeight:400,textAlign:\"center\",...textOptionsToStyles(textOptions),...font,...style},children:[prefix,isCanvas?\"Error message\":formError,suffix]});}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 300\n * @framerDisableUnlink\n */const ThentyFormErrorMessage=withCSS(ThentyFormErrorMessageComponent,[`[data-framer-component-container=\"true\"] div:has(> .${CANVAS_HIDDEN_CLASS_NAME}) { display: none !important; }`,`div:has(> .${HIDDEN_CLASS_NAME}) { display: none !important; }`,`.${HIDDEN_CLASS_NAME} { display: none !important; }`],\"\");export default ThentyFormErrorMessage;ThentyFormErrorMessage.displayName=\"Thenty Error Message\";addPropertyControls(ThentyFormErrorMessage,{font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:12,lineHeight:1.4,textAlign:\"center\"}},color:{type:ControlType.Color,defaultValue:\"#FF5A6F\"},prefix:{type:ControlType.String,defaultValue:\"\"},suffix:{type:ControlType.String,defaultValue:\"\"},textOptions:textOptions()});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ThentyFormErrorMessage\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"yPAAqZ,SAAS,EAAgC,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,SAAO,SAAO,QAAM,eAAa,EAAY,EAAI,EAAM,KAAK,IAAU,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAIA,EAAO,IAAI,EAAO,CAAC,aAAW,EAAc,CAAG,EAAM,EAAU,GAAqG,OAA/F,EAAU,EAAU,EAAmC,IAAW,EAAU,GAAuC,EAAM,EAAI,CAAK,MAAc,YAAU,MAAM,CAAC,QAAM,OAAO,EAAE,WAAW,GAAO,MAAM,IAAA,GAAU,SAAS,WAAW,IAAI,UAAU,SAAS,GAAG,EAAoB,CAAW,EAAE,GAAG,EAAK,GAAG,CAAK,EAAE,SAAS,CAAC,EAAO,EAAS,gBAAgB,EAAU,CAAM,CAAC,CAAC,CAAE,uBAAt+B,IAAyE,IAA0B,IAA2J,EAAO,EAAyB,6BAAmC,EAAkB,sBAKtX,EAAuB,EAAQ,EAAgC,CAAC,uDAAuD,EAAyB,iCAAiC,cAAc,EAAkB,iCAAiC,IAAI,EAAkB,+BAA+B,EAAE,EAAE,EAAwC,EAAuB,YAAY,uBAAuB,EAAoB,EAAuB,CAAC,KAAK,CAAC,KAAK,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,GAAG,WAAW,IAAI,UAAU,QAAQ,CAAC,EAAE,MAAM,CAAC,KAAK,EAAY,MAAM,aAAa,SAAS,EAAE,OAAO,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,EAAE,OAAO,CAAC,KAAK,EAAY,OAAO,aAAa,EAAE,EAAE,YAAY,EAAY,CAAC,CAAC"}