{"version":3,"file":"UserDataLabel.D31tkWRA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/mPGYIZ8yu9ABZPVltftl/52b3HZzAmwehp4C3O7gO/UserDataLabel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,withCSS}from\"framer\";import{textOptions,textOptionsToStyles,fetchUserData}from\"https://framerusercontent.com/modules/diyk5889JEo4mM5y5sJr/CxleeUEblAvnlnlj53Yz/ThentyShared.js\";function UserDataLabelComponent({type,customFieldName,font,color,prefix,suffix,whenEmpty,emptyText,textOptions,style}){const Tag=textOptions.tag||\"p\";const{loggedIn,userData}=fetchUserData();let text=\"\";if(loggedIn&&userData){switch(type){case\"firstName\":text=userData.name?.split(\" \")[0]??\"\";break;case\"lastName\":text=userData.name?.split(\" \").slice(1).join(\" \")??\"\";break;case\"fullName\":text=userData.name;break;case\"email\":text=userData.email;break;case\"customField\":text=userData[customFieldName.startsWith(\"custom:\")?customFieldName:`custom:${customFieldName}`];break;}}if(!text){if(whenEmpty===\"hide\"){return /*#__PURE__*/_jsx(\"div\",{className:\"thenty-hide-element\"});}else{text=emptyText;}}return /*#__PURE__*/_jsxs(Tag,{style:{color,margin:0,whiteSpace:style?.width?undefined:\"nowrap\",fontWeight:400,textAlign:\"center\",...textOptionsToStyles(textOptions),...font,...style},children:[prefix,text,suffix]});}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n */const UserDataLabel=withCSS(UserDataLabelComponent,[\".thenty-hide-element { display: none; }\",\"div:has(> .thenty-hide-element) { display: none; }\"],\"thenty\");export default UserDataLabel;UserDataLabel.displayName=\"User Data Label\";addPropertyControls(UserDataLabel,{type:{type:ControlType.Enum,options:[\"firstName\",\"lastName\",\"fullName\",\"email\",\"customField\"],optionTitles:[\"First Name\",\"Last Name\",\"Full Name\",\"Email\",\"Custom Field\"],defaultValue:\"firstName\"},customFieldName:{type:ControlType.String,defaultValue:\"custom:\",title:\"Field Name\",placeholder:\"Custom Field Name\",hidden:props=>props.type!==\"customField\"},font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.4,textAlign:\"center\"}},color:{type:ControlType.Color,defaultValue:\"#000000\"},prefix:{type:ControlType.String,defaultValue:\"\"},suffix:{type:ControlType.String,defaultValue:\"\"},whenEmpty:{type:ControlType.Enum,defaultValue:\"text\",options:[\"hide\",\"text\"],optionTitles:[\"Hide\",\"Text\"],displaySegmentedControl:true,title:\"Empty\"},emptyText:{type:ControlType.String,defaultValue:\"Empty\",title:\"Text\",placeholder:\"Empty State Text\",hidden:props=>props.whenEmpty!==\"text\"},textOptions:textOptions()});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UserDataLabel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"sOAAgR,SAAS,EAAuB,CAAC,OAAK,kBAAgB,OAAK,QAAM,SAAO,SAAO,YAAU,YAAU,cAAY,SAAO,CAAC,IAAM,EAAI,EAAY,KAAK,IAAS,CAAC,WAAS,YAAU,EAAc,EAAM,EAAK,GAAG,GAAG,GAAU,EAAU,OAAO,EAAP,CAAa,IAAI,YAAY,EAAK,EAAS,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,MAAM,IAAI,WAAW,EAAK,EAAS,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,GAAG,MAAM,IAAI,WAAW,EAAK,EAAS,KAAK,MAAM,IAAI,QAAQ,EAAK,EAAS,MAAM,MAAM,IAAI,cAAc,EAAK,EAAS,EAAgB,WAAW,SAAS,EAAE,EAAgB,UAAU,KAAmB,KAAM,CAAE,GAAG,CAA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