{"version":3,"file":"utils.CofdtRVT.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/XdMlq8BFxPQOiB6k0MvB/rmTvfecX7dmLq7rJeWwf/Outseta.js","https:/framer.com/m/framer/icon-nullstate.js@0.7.0","https:/framerusercontent.com/modules/Ma20hU0GGRxLxZphbywl/OSpwWF91FHPVFyQJjMHt/utils.js"],"sourcesContent":["/// VERSION 0.0.2 — Sandbox-safe Outseta overrides (no alerts; lazy, guarded subscriptions)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";/* ──────────────────────────────────────────────────────────────────────────────\n   Button Overrides\n   ──────────────────────────────────────────────────────────────────────────── */export 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\"});}/* ──────────────────────────────────────────────────────────────────────────────\n   Visibility Overrides\n   ──────────────────────────────────────────────────────────────────────────── */export 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\"});}/* ──────────────────────────────────────────────────────────────────────────────\n   Visibility Based on Plan Uid (example)\n   ──────────────────────────────────────────────────────────────────────────── */export function showForSinglePlan_aWxYEbmV(Component){const validPlanUid=\"aWxYEbmV\";return props=>{try{const u=useUser();const value=u&&u[\"Account.CurrentSubscription.Plan.Uid\"];if(value===validPlanUid)return /*#__PURE__*/_jsx(Component,{...props});return null;}catch(err){log(\"error in showForSinglePlan\",validPlanUid,err?.message);return null;}};}/* ──────────────────────────────────────────────────────────────────────────────\n   Visibility Based on Account / Person Custom Property (examples)\n   ──────────────────────────────────────────────────────────────────────────── */export function showForPartyAccounts(Component){const validPropertyValue=\"PARTY\";return props=>{try{const u=useUser();const value=u&&u[\"Account.MyCustomAccountProperty\"]?.toUpperCase();if(value===validPropertyValue)return /*#__PURE__*/_jsx(Component,{...props});return null;}catch(err){log(\"error in showForPartyPlan\",validPropertyValue,err?.message);return null;}};}export function showForPartyPeople(Component){const validPropertyValue=\"PARTY\";return props=>{try{const u=useUser();const value=u&&u[\"MyCustomPersonProperty\"]?.toUpperCase();if(value===validPropertyValue)return /*#__PURE__*/_jsx(Component,{...props});return null;}catch(err){log(\"error in showForPartyPeople\",validPropertyValue,err?.message);return null;}};}/* ──────────────────────────────────────────────────────────────────────────────\n   Text Overrides\n   ──────────────────────────────────────────────────────────────────────────── */export const withUserFirstName=C=>withProperty(\"FirstName\",C);export const withUserLastName=C=>withProperty(\"LastName\",C);export const withUserFullName=C=>withProperty(\"FullName\",C);export const withUserEmail=C=>withProperty(\"Email\",C);export const withAccountName=C=>withProperty(\"Account.Name\",C);export const withAccountSubscriptionUid=C=>withProperty(\"Account.CurrentSubscription.Plan.Uid\",C);export const withAccountSubscriptionName=C=>withProperty(\"Account.CurrentSubscription.Plan.Name\",C);export const withAccountSubscriptionDescription=C=>withProperty(\"Account.CurrentSubscription.Plan.Description\",C);/* ──────────────────────────────────────────────────────────────────────────────\n   Image Overrides\n   ──────────────────────────────────────────────────────────────────────────── */export function withUserAvatar(Component){return withImageProperty(\"ProfileImageS3Url\",Component);}let cachedUser=null;const listeners=new Set;const OUTSETA_EVENTS_FETCH=[\"accessToken.set\",\"profile.update\",\"account.update\"];const OUTSETA_EVENTS_CLEAR=[\"logout\"];let subscriptionsInitialized=false;/** Safe accessor: returns Outseta or null; never alerts, never throws */function safeOutseta(){if(typeof window===\"undefined\")return null;return window.Outseta||null;}/** Bind Outseta event listeners once, only if Outseta is present */function initOutsetaSubscriptionsOnce(){if(subscriptionsInitialized)return;const O=safeOutseta();if(!O?.on)return;// nothing to wire yet\nsubscriptionsInitialized=true;OUTSETA_EVENTS_FETCH.forEach(ev=>{try{O.on(ev,()=>void fetchUser(ev));}catch{}});OUTSETA_EVENTS_CLEAR.forEach(ev=>{try{O.on(ev,()=>clearUser(ev));}catch{}});}/** Fetch/clear user (guarded) */async function fetchUser(event){try{const O=safeOutseta();if(!O?.getUser)return;log(\"fetch user\",event);const raw=await O.getUser();cachedUser=flattenObject(raw);log(\"fetch user fulfilled\",event,raw,cachedUser);notify();}catch(err){log(\"fetch user failed\",event,err?.message);}}function clearUser(event){cachedUser=null;log(\"cleared user\",event);notify();}function notify(){listeners.forEach(fn=>fn(cachedUser));}/** Public API for other modules (if needed) */export const subscribe=listener=>{listeners.add(listener);return()=>listeners.delete(listener);};export const getUser=()=>cachedUser;/* ──────────────────────────────────────────────────────────────────────────────\n   Hook\n   ──────────────────────────────────────────────────────────────────────────── */export function useUser(){const[user,setUser]=useState(getUser());useEffect(()=>{// Only on client\nconst O=safeOutseta();// Lazily bind event listeners if/when Outseta exists\ninitOutsetaSubscriptionsOnce();// Kick an initial fetch if possible\nif(O?.getUser)fetchUser(\"init\");const unsub=subscribe(setUser);return()=>unsub();},[]);return user;}/* ──────────────────────────────────────────────────────────────────────────────\n   Helpers\n   ──────────────────────────────────────────────────────────────────────────── */function withProperty(property,Component){return props=>{const u=useUser();if(!u)return null;return /*#__PURE__*/_jsx(Component,{...props,text:u[property]});};}function withImageProperty(property,Component){return props=>{const u=useUser();if(!u)return null;const imageSrc=u[property];log(\"avatar source\",u[property]);if(imageSrc){return /*#__PURE__*/_jsx(Component,{...props,background:{...props.background,src:imageSrc,srcSet:undefined}});}else if(props.background?.src){// keep the component's own image if present\nreturn /*#__PURE__*/_jsx(Component,{...props});}else{return null;}};}/** Quiet logger (no alerts, no errors if Outseta missing) */function log(...args){const O=safeOutseta();if(O?.debug){try{O.debug(\"outseta.framer.override.user\",...args);}catch{}}else{// keep noise low; use debug level so it’s hidden by default\nif(typeof window!==\"undefined\")console.debug(\"[Outseta]\",...args);}}/** Flattens nested Outseta user object to dot-notation keys */function flattenObject(obj,parent=\"\",res={}){if(!obj||typeof obj!==\"object\")return res;for(const key of Object.keys(obj)){const propName=parent?`${parent}.${key}`:key;const value=obj[key];if(Array.isArray(value)){value.forEach((item,index)=>flattenObject(item,`${propName}[${index}]`,res));}else if(value&&typeof value===\"object\"){flattenObject(value,propName,res);}else{res[propName]=value;}}return res;}\nexport const __FramerMetadata__ = {\"exports\":{\"withAccountSubscriptionUid\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForAnonymous\":{\"type\":\"reactHoc\",\"name\":\"showForAnonymous\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForAuthenticated\":{\"type\":\"reactHoc\",\"name\":\"showForAuthenticated\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getUser\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserLastName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForSinglePlan_aWxYEbmV\":{\"type\":\"reactHoc\",\"name\":\"showForSinglePlan_aWxYEbmV\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asLoginPopupButton\":{\"type\":\"reactHoc\",\"name\":\"asLoginPopupButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForPartyPeople\":{\"type\":\"reactHoc\",\"name\":\"showForPartyPeople\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserEmail\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserFullName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"subscribe\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForPartyAccounts\":{\"type\":\"reactHoc\",\"name\":\"showForPartyAccounts\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserFirstName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRegisterPopup\":{\"type\":\"reactHoc\",\"name\":\"withRegisterPopup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountSubscriptionDescription\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asProfilePopupButton\":{\"type\":\"reactHoc\",\"name\":\"asProfilePopupButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUserAvatar\":{\"type\":\"reactHoc\",\"name\":\"withUserAvatar\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useUser\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asLogoutButton\":{\"type\":\"reactHoc\",\"name\":\"asLogoutButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAccountSubscriptionName\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Outseta.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nexport const containerStyles = {\n    width: \"100%\",\n    height: \"100%\",\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nconst nullIconStyle = {\n    minWidth: \"10px\",\n    minHeight: \"10px\",\n    maxWidth: \"20px\",\n    maxHeight: \"20px\",\n    width: \"60%\",\n    height: \"60%\"\n};\nconst emptyStateStyle = {\n    ...containerStyles,\n    borderRadius: 6,\n    background: \"rgba(149, 149, 149, 0.1)\",\n    border: \"1px dashed rgba(149, 149, 149, 0.15)\",\n    color: \"#a5a5a5\",\n    flexDirection: \"column\"\n};\nexport const NullState = /*#__PURE__*/ React.forwardRef((_, ref)=>{\n    return(/*#__PURE__*/ _jsx(\"div\", {\n        style: emptyStateStyle,\n        ref: ref\n    }));\n}) /*\n\n<svg\n                xmlns=\"http://www.w3.org/2000/svg\"\n                viewBox=\"0 0 30 30\"\n                style={nullIconStyle}\n            >\n                <path\n                    d=\"M 12.857 0 C 19.958 0 25.714 5.756 25.714 12.857 C 25.714 19.958 19.958 25.714 12.857 25.714 C 5.756 25.714 0 19.958 0 12.857 C 0 5.756 5.756 0 12.857 0 Z\"\n                    fill=\"#FFFFFF\"\n                ></path>\n                <path\n                    d=\"M 20.357 20.357 L 27.857 27.857\"\n                    fill=\"transparent\"\n                    strokeWidth=\"4.28\"\n                    stroke=\"#FFFFFF\"\n                    strokeLinecap=\"round\"\n                ></path>\n                <g transform=\"translate(9.643 6.429)\">\n                    <path\n                        d=\"M 3.214 12.857 L 3.214 12.857\"\n                        fill=\"transparent\"\n                        strokeWidth=\"3.75\"\n                        stroke=\"currentColor\"\n                        strokeLinecap=\"round\"\n                    ></path>\n                    <path\n                        d=\"M 0 3.214 C 0 1.004 1.843 0 3.214 0 C 4.586 0 6.429 0.603 6.429 3.214 C 6.429 5.826 3.214 5.913 3.214 7.232 C 3.214 8.552 3.214 8.571 3.214 8.571\"\n                        fill=\"transparent\"\n                        strokeWidth=\"3.22\"\n                        stroke=\"currentColor\"\n                        strokeLinecap=\"round\"\n                        strokeLinejoin=\"round\"\n                    ></path>\n                </g>\n            </svg>\n            */ ;\n\nexport const __FramerMetadata__ = {\"exports\":{\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NullState\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./nullstate.map","import{useMemo}from\"react\";import{ControlType}from\"framer\";/*\n ** ICON UTILS\n ** Pull as much re-usable logic into here as possible\n ** This will make it easier to replace in all icon components\n */ export const containerStyles={width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"};export const defaultEvents={onClick:{type:ControlType.EventHandler},onMouseDown:{type:ControlType.EventHandler},onMouseUp:{type:ControlType.EventHandler},onMouseEnter:{type:ControlType.EventHandler},onMouseLeave:{type:ControlType.EventHandler}};const findByArray=(arr,search)=>arr.find(a=>a.toLowerCase().includes(search));export function getIconSelection(iconKeys,selectByList,iconSearch=\"\",iconSelection,lowercaseIconKeyPairs){// gotta get the exact match first THEN find\n// have a set and try to access ?\nif(selectByList)return iconSelection;if(iconSearch==null||(iconSearch===null||iconSearch===void 0?void 0:iconSearch.length)===0)return null;const iconSearchTerm=iconSearch.toLowerCase().replace(/-|\\s/g,\"\");var _iconSearchTerm;// check for exact match, otherwise use .find\nconst searchResult=(_iconSearchTerm=lowercaseIconKeyPairs[iconSearchTerm])!==null&&_iconSearchTerm!==void 0?_iconSearchTerm:findByArray(iconKeys,iconSearchTerm);return searchResult;}export function useIconSelection(iconKeys,selectByList,iconSearch=\"\",iconSelection,lowercaseIconKeyPairs){// Clean search term\nconst iconSearchResult=useMemo(()=>{if(iconSearch==null||(iconSearch===null||iconSearch===void 0?void 0:iconSearch.length)===0)return null;const iconSearchTerm=iconSearch.toLowerCase().replace(/-|\\s/g,\"\");var _iconSearchTerm;// check for exact match, otherwise use .find\nconst searchResult=(_iconSearchTerm=lowercaseIconKeyPairs[iconSearchTerm])!==null&&_iconSearchTerm!==void 0?_iconSearchTerm:findByArray(iconKeys,iconSearchTerm);return searchResult;},[iconSelection,iconSearch]);const name=selectByList?iconSelection:iconSearchResult;return name;}\nexport const __FramerMetadata__ = {\"exports\":{\"getIconSelection\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIconSelection\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultEvents\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\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