{"version":3,"file":"Outseta.DO2osD7M.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/FVmCnCqw20xX4DJfDJYm/SFCB7H15XZWu6ihL6WN7/u5jXKuGDk.js","https:/framerusercontent.com/modules/KTeFNbBpd6rAxlrmCVtQ/SsbbaAtoi2PY0rG5r726/Outseta.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 6 17.251 L 6 11.251 L 10.5 11.251 L 10.5 17.251 L 16.5 17.251 L 16.5 8.251 C 16.5 8.052 16.421 7.861 16.281 7.72 L 8.781 0.22 C 8.64 0.079 8.449 0 8.25 0 C 8.051 0 7.86 0.079 7.719 0.22 L 0.219 7.72 C 0.079 7.861 0 8.052 0 8.251 L 0 17.251 Z\" fill-opacity=\"var(--1m6trwb, 0)\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"17.250589992311827px\" id=\"Zd1kfaYz1\" transform=\"translate(3.75 2.999)\" width=\"16.500000464425764px\"/><path d=\"M 6 17.251 L 6 11.251 L 10.5 11.251 L 10.5 17.251 L 16.5 17.251 L 16.5 8.251 C 16.5 8.052 16.421 7.861 16.281 7.72 L 8.781 0.22 C 8.64 0.079 8.449 0 8.25 0 C 8.051 0 7.86 0.079 7.719 0.22 L 0.219 7.72 C 0.079 7.861 0 8.052 0 8.251 L 0 17.251 Z\" fill=\"transparent\" height=\"17.250589992311827px\" id=\"U148LkUuz\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(3.75 2.999)\" width=\"16.500000464425764px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,ezTt3ayMo:color??props.ezTt3ayMo??\"rgb(0, 0, 0)\",lschgej4H:width1??props.lschgej4H??1.5,qxTvv_EBh:alpha??props.qxTvv_EBh};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,ezTt3ayMo,lschgej4H,qxTvv_EBh,...restProps}=getProps(props);const href=useSVGTemplate(\"4175524542\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-7ihGz\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m6trwb\":qxTvv_EBh,\"--21h8s6\":ezTt3ayMo,\"--pgex8v\":lschgej4H,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-7ihGz { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"ezTt3ayMo\":\"color\",\"lschgej4H\":\"width1\",\"qxTvv_EBh\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"House\",\"color\":{\"type\":\"variable\",\"value\":\"21h8s6\"},\"set\":{\"localId\":\"vectorSet/NGVKdicsm\",\"id\":\"NGVKdicsm\",\"moduleId\":\"omX0gWFPqDwhaiWwf6ab\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-7ihGz\");Icon.displayName=\"House\";export default Icon;addPropertyControls(Icon,{ezTt3ayMo:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},lschgej4H:{defaultValue:1.5,displayStepper:true,hidden:false,max:6,min:0,step:.5,title:\"Width\",type:ControlType.Number},qxTvv_EBh:{defaultValue:0,displayStepper:true,hidden:false,max:1,min:0,step:.1,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVector\":\"{\\\"name\\\":\\\"House\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"21h8s6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/NGVKdicsm\\\",\\\"id\\\":\\\"NGVKdicsm\\\",\\\"moduleId\\\":\\\"omX0gWFPqDwhaiWwf6ab\\\"}}\",\"framerImmutableVariables\":\"true\",\"framerDisableUnlink\":\"true\",\"framerVariables\":\"{\\\"ezTt3ayMo\\\":\\\"color\\\",\\\"lschgej4H\\\":\\\"width1\\\",\\\"qxTvv_EBh\\\":\\\"alpha\\\"}\",\"framerIntrinsicHeight\":\"24\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","/// VERSION 0.0.8\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";/////////////////// Configuration\n// Fill these in from Outseta:\n// - Free plan Uid: Billing → Plans → [free plan] → Uid is in the page URL\n// - Course add-on Uids: Billing → Add-ons → [each add-on] → Uid is in the page URL\nconst FREE_PLAN_UID=\"4968G4mX\";const COURSE_ADDON_UIDS=[\"EWBn0zWr\",\"B9lVOqm8\"];/////////////////// Shared access cache (module scope)\n// Persists across mount/unmount of individual components so reopening the\n// mobile menu doesn't trigger a fresh race against Outseta.\n// null = unknown/not yet checked, true/false = last known answer.\nlet cachedAccess=null;const accessSubscribers=new Set;let listenersAttached=false;function broadcastAccess(value){cachedAccess=value;accessSubscribers.forEach(fn=>fn(value));}async function evaluateAccess(){const Outseta=window.Outseta;if(!Outseta?.getUser)return;try{const user=await Outseta.getUser();if(!user?.Account?.CurrentSubscription){broadcastAccess(false);return;}const planUid=user.Account.CurrentSubscription.Plan?.Uid;const subscriptionAddOns=user.Account.CurrentSubscription.SubscriptionAddOns||[];const isOnPaidPlan=planUid&&planUid!==FREE_PLAN_UID;const hasCourseAddon=subscriptionAddOns.some(sa=>COURSE_ADDON_UIDS.includes(sa?.AddOn?.Uid));broadcastAccess(isOnPaidPlan||hasCourseAddon);}catch{broadcastAccess(false);}}// Attach Outseta auth listeners exactly once for the whole page, then keep\n// the cached value in sync. Subsequent component mounts just read the cache.\nasync function ensureAccessWatcher(){if(listenersAttached)return;listenersAttached=true;let attempts=0;while(typeof window!==\"undefined\"&&!window.Outseta?.getUser&&attempts<200){await new Promise(r=>setTimeout(r,25));attempts++;}const Outseta=window.Outseta;if(!Outseta){// Outseta never showed up; allow a future retry.\nlistenersAttached=false;return;}if(typeof Outseta.on===\"function\"){Outseta.on(\"accessToken.set\",evaluateAccess);Outseta.on(\"accessToken.removed\",()=>broadcastAccess(false));}// Initial check in case the user is already authenticated.\nevaluateAccess();}/////////////////// Button Overrides\nexport function withRegisterPopup(Component){return props=>{return /*#__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=>{return /*#__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=>{return /*#__PURE__*/_jsx(Component,{...props,\"data-o-authenticated\":\"1\",\"data-o-profile\":\"1\",\"data-mode\":\"popup\"});};}export function asLogoutButton(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,\"data-o-authenticated\":\"1\",\"data-o-logout-link\":\"1\"});};}/////////////////// Visibility Overrides\nexport function showForAuthenticated(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,\"data-o-authenticated\":\"1\"});};}export function showForAnonymous(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,\"data-o-anonymous\":\"1\"});};}/////////////////// Course Access Visibility\n// Shows the element if the user has access to course content:\n// - On any plan other than the free plan, OR\n// - Has at least one of the course add-ons\n// Hidden for: anonymous users, and free-plan users without any add-on.\nexport function showForCourseAccess(Component){return props=>{// Seed from the shared cache so a remount (e.g. reopening the mobile\n// menu) starts from the last known answer instead of re-racing Outseta.\nconst[hasAccess,setHasAccess]=useState(cachedAccess);useEffect(()=>{let cancelled=false;// Subscribe this instance to future access updates.\nconst subscriber=value=>{if(!cancelled)setHasAccess(value);};accessSubscribers.add(subscriber);// Make sure the page-level watcher is running, and pull whatever\n// the cache already knows right now.\nensureAccessWatcher();if(cachedAccess!==null)setHasAccess(cachedAccess);return()=>{cancelled=true;accessSubscribers.delete(subscriber);};},[]);// While checking, or if access denied, hide via CSS to avoid layout\n// shift and to keep the component mounted (safer for Framer rendering).\nif(hasAccess!==true){return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,display:\"none\"}});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"asProfilePopupButton\":{\"type\":\"reactHoc\",\"name\":\"asProfilePopupButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asLoginPopupButton\":{\"type\":\"reactHoc\",\"name\":\"asLoginPopupButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForCourseAccess\":{\"type\":\"reactHoc\",\"name\":\"showForCourseAccess\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForAuthenticated\":{\"type\":\"reactHoc\",\"name\":\"showForAuthenticated\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"asLogoutButton\":{\"type\":\"reactHoc\",\"name\":\"asLogoutButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRegisterPopup\":{\"type\":\"reactHoc\",\"name\":\"withRegisterPopup\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showForAnonymous\":{\"type\":\"reactHoc\",\"name\":\"showForAnonymous\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Outseta.map"],"mappings":"ySAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,SAAS,CAAC,EAAG,CAAO,EAAU,EAAO,OAAO,EAAK,CAAO,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,WAAS,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,WAAS,CAAC,EAAG,CAAO,EAAI,giCAAsiC,GAAU,CAAC,QAAM,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAO,EAAM,WAAW,eAAe,UAAU,GAAQ,EAAM,WAAW,IAAI,UAAU,GAAO,EAAM,UAAU,EAUt3D,EAAK,EAVi5D,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,YAAU,YAAU,GAAG,GAAW,EAAS,EAAM,CAAO,EAAK,EAAe,aAAa,EAAI,CAAC,OAAoB,EAAK,EAAI,CAAC,GAAG,EAAU,UAAU,EAAG,eAAe,EAAU,CAAU,WAAa,MAAI,KAAK,eAAe,MAAM,CAAC,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