{"version":3,"file":"Outseta.DOJAkF0L.mjs","names":["useState","user"],"sources":["https:/framerusercontent.com/modules/gkef1zdBsvObttsXafvK/2laHpdzAjCQ1EALfUEte/Outseta.js"],"sourcesContent":["/// VERSION 0.0.4 (Cached User – Full Properties, No Flicker)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";/////////////////// Button Overrides\nexport function withRegisterPopup(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,\"data-o-anonymous\":\"1\",\"data-o-auth\":\"1\",\"data-mode\":\"popup\",\"data-widget-mode\":\"register\"});}export function asLoginPopupButton(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,\"data-o-anonymous\":\"1\",\"data-o-auth\":\"1\",\"data-mode\":\"popup\",\"data-widget-mode\":\"login\"});}export function asProfilePopupButton(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,\"data-o-authenticated\":\"1\",\"data-o-profile\":\"1\",\"data-mode\":\"popup\"});}export function asLogoutButton(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,\"data-o-authenticated\":\"1\",\"data-o-logout-link\":\"1\"});}/////////////////// Visibility Overrides\nexport function showForAuthenticated(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,\"data-o-authenticated\":\"1\"});}export function showForAnonymous(Component){return props=>/*#__PURE__*/_jsx(Component,{...props,\"data-o-anonymous\":\"1\"});}/////////// Visibility Overrides Based on Plan Uid\nexport function showForSinglePlan_aWxYEbmV(Component){const validPlanUid=\"aWxYEbmV\";return props=>{const user=useUser();const value=user?.[\"Account.CurrentSubscription.Plan.Uid\"];return value===validPlanUid?/*#__PURE__*/_jsx(Component,{...props}):null;};}/////////// Visibility Based on an Account Custom Property\nexport function showForPartyAccounts(Component){const validPropertyValue=\"PARTY\";return props=>{const user=useUser();const value=user?.[\"Account.MyCustomAccountProperty\"]?.toUpperCase();return value===validPropertyValue?/*#__PURE__*/_jsx(Component,{...props}):null;};}/////////// Visibility Based on a Person Custom Property\nexport function showForPartyPeople(Component){const validPropertyValue=\"PARTY\";return props=>{const user=useUser();const value=user?.[\"MyCustomPersonProperty\"]?.toUpperCase();return value===validPropertyValue?/*#__PURE__*/_jsx(Component,{...props}):null;};}/////////////////// Text Overrides (User)\nexport function withUserFirstName(Component){return withProperty(\"FirstName\",Component);}export function withUserLastName(Component){return withProperty(\"LastName\",Component);}export function withUserFullName(Component){return withProperty(\"FullName\",Component);}export function withUserEmail(Component){return withProperty(\"Email\",Component);}/////////////////// Text Overrides (Account)\nexport function withAccountName(Component){return withProperty(\"Account.Name\",Component);}export function withAccountSubscriptionUid(Component){return withProperty(\"Account.CurrentSubscription.Plan.Uid\",Component);}export function withAccountSubscriptionName(Component){return withProperty(\"Account.CurrentSubscription.Plan.Name\",Component);}export function withAccountSubscriptionDescription(Component){return withProperty(\"Account.CurrentSubscription.Plan.Description\",Component);}export function withAccountSectors(Component){return withProperty(\"Account.Sectors\",Component);}export function withAccountPlanType(Component){return withProperty(\"Account.PlanType\",Component);}export function withAccountSizeWallet(Component){return withProperty(\"Account.Size_wallet\",Component);}export function withAccountDealPipelineStage(Component){return withProperty(\"Account.DealPipelineStage\",Component);}export function withAccountOpportunitiesOfInterest(Component){return withProperty(\"Account.OpportunitiesOfInterest\",Component);}export function withAccountTypeOfAttention(Component){return withProperty(\"Account.TypeOfAttention\",Component);}export function withAccountCompany(Component){return withProperty(\"Account.Company\",Component);}export function withAccountProjectActivity(Component){return withProperty(\"Account.ProjectActivity\",Component);}export function withAccountCity(Component){return withProperty(\"Account.City\",Component);}export function withAccountProjectNumber(Component){return withProperty(\"Account.ProjectNumber\",Component);}export function withAccountEvaluation_Status(Component){return withProperty(\"Account.Evaluation_Status\",Component);}export function withAccountEvaluationFeedback(Component){return withProperty(\"Account.EvaluationFeedback\",Component);}export function withAccountLastUpdateDate(Component){return withProperty(\"Account.LastUpdateDate\",Component);}export function withAccountEvaluationScore(Component){return withProperty(\"Account.EvaluationScore\",Component);}export function withAccountOfferingType(Component){return withProperty(\"Account.OfferingType\",Component);}export function withAccountEvaluationResult(Component){return withProperty(\"Account.EvaluationResult\",Component);}export function withAccountFoundedDate(Component){return withProperty(\"Account.FoundedDate\",Component);}export function withAccountCommercialRegistrationNumber(Component){return withProperty(\"Account.CommercialRegistrationNumber\",Component);}export function withAccountBrandName(Component){return withProperty(\"Account.BrandName\",Component);}export function withAccountProposedService1(Component){return withProperty(\"Account.ProposedService1\",Component);}export function withAccountProposedService2(Component){return withProperty(\"Account.ProposedService2\",Component);}export function withAccountProposedService3(Component){return withProperty(\"Account.ProposedService3\",Component);}/////////////////// Image Overrides\nexport function withUserAvatar(Component){return withImageProperty(\"ProfileImageS3Url\",Component);}/* ========= Cached User ========= */function getCachedUser(){if(typeof window===\"undefined\")return null;try{const raw=localStorage.getItem(\"__os_user\");return raw?flattenObject(JSON.parse(raw)):null;}catch{return null;}}let user=getCachedUser();let userResolved=!!user;const listeners=new Set;const fetchUser=async()=>{try{const out=getOutseta();if(!out)return;const userObject=await out.getUser();const flat=flattenObject(userObject);user=flat;userResolved=true;localStorage.setItem(\"__os_user\",JSON.stringify(userObject));}catch(error){console.warn(\"fetchUser failed\",error);}finally{listeners.forEach(l=>l(user));}};const clearUser=()=>{user=null;userResolved=true;localStorage.removeItem(\"__os_user\");listeners.forEach(l=>l(user));};if(typeof window!==\"undefined\"){const setup=()=>{const out=getOutseta();if(!out)return;out.on(\"accessToken.set\",fetchUser);out.on(\"profile.update\",fetchUser);out.on(\"account.update\",fetchUser);out.on(\"logout\",clearUser);fetchUser();};if(window.Outseta)setup();else window.addEventListener(\"load\",setup);}function useUser(){const[userState,setUserState]=useState(user);useEffect(()=>{const fn=u=>setUserState(u);listeners.add(fn);return()=>listeners.delete(fn);},[]);return userState;}/////////////////// Helpers\nfunction withProperty(property,Component){return props=>{const user=useUser();if(!userResolved)return /*#__PURE__*/_jsx(Component,{...props});const value=user?.[property];if(value===undefined||value===null||value===\"\"){return /*#__PURE__*/_jsx(Component,{...props});}return /*#__PURE__*/_jsx(Component,{...props,text:String(value)});};}function withImageProperty(property,Component){return props=>{const user=useUser();if(!userResolved)return /*#__PURE__*/_jsx(Component,{...props});const imageSrc=user?.[property];if(!imageSrc)return /*#__PURE__*/_jsx(Component,{...props});return /*#__PURE__*/_jsx(Component,{...props,background:{...props.background,src:imageSrc,srcSet:undefined}});};}function getOutseta(){if(typeof window===\"undefined\")return null;return window.Outseta||null;}function flattenObject(obj,parent=\"\",res={}){for(let key in obj){const propName=parent?`${parent}.${key}`:key;if(typeof obj[key]===\"object\"&&obj[key]!==null){flattenObject(obj[key],propName,res);}else{res[propName]=obj[key];}}return res;}\nexport const __FramerMetadata__ = {\"exports\":{\"withAccountBrandName\":{\"type\":\"reactHoc\",\"name\":\"withAccountBrandName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserFirstName\":{\"type\":\"reactHoc\",\"name\":\"withUserFirstName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserAvatar\":{\"type\":\"reactHoc\",\"name\":\"withUserAvatar\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountTypeOfAttention\":{\"type\":\"reactHoc\",\"name\":\"withAccountTypeOfAttention\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountEvaluationResult\":{\"type\":\"reactHoc\",\"name\":\"withAccountEvaluationResult\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountEvaluation_Status\":{\"type\":\"reactHoc\",\"name\":\"withAccountEvaluation_Status\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountLastUpdateDate\":{\"type\":\"reactHoc\",\"name\":\"withAccountLastUpdateDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountOfferingType\":{\"type\":\"reactHoc\",\"name\":\"withAccountOfferingType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForAnonymous\":{\"type\":\"reactHoc\",\"name\":\"showForAnonymous\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountPlanType\":{\"type\":\"reactHoc\",\"name\":\"withAccountPlanType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountName\":{\"type\":\"reactHoc\",\"name\":\"withAccountName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForPartyPeople\":{\"type\":\"reactHoc\",\"name\":\"showForPartyPeople\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountProjectNumber\":{\"type\":\"reactHoc\",\"name\":\"withAccountProjectNumber\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountCompany\":{\"type\":\"reactHoc\",\"name\":\"withAccountCompany\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountSubscriptionName\":{\"type\":\"reactHoc\",\"name\":\"withAccountSubscriptionName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountSizeWallet\":{\"type\":\"reactHoc\",\"name\":\"withAccountSizeWallet\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserFullName\":{\"type\":\"reactHoc\",\"name\":\"withUserFullName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asLoginPopupButton\":{\"type\":\"reactHoc\",\"name\":\"asLoginPopupButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserLastName\":{\"type\":\"reactHoc\",\"name\":\"withUserLastName\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountEvaluationScore\":{\"type\":\"reactHoc\",\"name\":\"withAccountEvaluationScore\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRegisterPopup\":{\"type\":\"reactHoc\",\"name\":\"withRegisterPopup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asProfilePopupButton\":{\"type\":\"reactHoc\",\"name\":\"asProfilePopupButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountProjectActivity\":{\"type\":\"reactHoc\",\"name\":\"withAccountProjectActivity\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountEvaluationFeedback\":{\"type\":\"reactHoc\",\"name\":\"withAccountEvaluationFeedback\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asLogoutButton\":{\"type\":\"reactHoc\",\"name\":\"asLogoutButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForSinglePlan_aWxYEbmV\":{\"type\":\"reactHoc\",\"name\":\"showForSinglePlan_aWxYEbmV\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountProposedService3\":{\"type\":\"reactHoc\",\"name\":\"withAccountProposedService3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountSectors\":{\"type\":\"reactHoc\",\"name\":\"withAccountSectors\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserEmail\":{\"type\":\"reactHoc\",\"name\":\"withUserEmail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountProposedService2\":{\"type\":\"reactHoc\",\"name\":\"withAccountProposedService2\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountOpportunitiesOfInterest\":{\"type\":\"reactHoc\",\"name\":\"withAccountOpportunitiesOfInterest\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountProposedService1\":{\"type\":\"reactHoc\",\"name\":\"withAccountProposedService1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountSubscriptionUid\":{\"type\":\"reactHoc\",\"name\":\"withAccountSubscriptionUid\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountFoundedDate\":{\"type\":\"reactHoc\",\"name\":\"withAccountFoundedDate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountCity\":{\"type\":\"reactHoc\",\"name\":\"withAccountCity\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForAuthenticated\":{\"type\":\"reactHoc\",\"name\":\"showForAuthenticated\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountSubscriptionDescription\":{\"type\":\"reactHoc\",\"name\":\"withAccountSubscriptionDescription\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForPartyAccounts\":{\"type\":\"reactHoc\",\"name\":\"showForPartyAccounts\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountCommercialRegistrationNumber\":{\"type\":\"reactHoc\",\"name\":\"withAccountCommercialRegistrationNumber\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountDealPipelineStage\":{\"type\":\"reactHoc\",\"name\":\"withAccountDealPipelineStage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Outseta.map"],"mappings":"uIAEuiB,SAAgB,EAAe,EAAU,CAAC,MAAO,IAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,uBAAuB,IAAI,qBAAqB,IAAI,CAAC,CAK1rB,SAAgB,EAAkB,EAAU,CAAC,OAAO,EAAa,YAAY,EAAU,CAC4Y,SAAgB,EAAmB,EAAU,CAAC,OAAO,EAAa,kBAAkB,EAAU,CAAoG,SAAgB,EAAsB,EAAU,CAAC,OAAO,EAAa,sBAAsB,EAAU,CAAE,SAAgB,EAA6B,EAAU,CAAC,OAAO,EAAa,4BAA4B,EAAU,CAAE,SAAgB,EAAmC,EAAU,CAAC,OAAO,EAAa,kCAAkC,EAAU,CAAE,SAAgB,EAA2B,EAAU,CAAC,OAAO,EAAa,0BAA0B,EAAU,CAAE,SAAgB,EAAmB,EAAU,CAAC,OAAO,EAAa,kBAAkB,EAAU,CAAE,SAAgB,EAA2B,EAAU,CAAC,OAAO,EAAa,0BAA0B,EAAU,CAAE,SAAgB,EAAgB,EAAU,CAAC,OAAO,EAAa,eAAe,EAAU,CAAE,SAAgB,EAAyB,EAAU,CAAC,OAAO,EAAa,wBAAwB,EAAU,CAAE,SAAgB,EAA6B,EAAU,CAAC,OAAO,EAAa,4BAA4B,EAAU,CAAE,SAAgB,EAA8B,EAAU,CAAC,OAAO,EAAa,6BAA6B,EAAU,CAAE,SAAgB,EAA0B,EAAU,CAAC,OAAO,EAAa,yBAAyB,EAAU,CAAE,SAAgB,EAA2B,EAAU,CAAC,OAAO,EAAa,0BAA0B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