1import{a as e,i as t}from"./chunk-3598564-1-81-19.js";import{ot as r}from"./chunk-110844025-1-81-19.js";var n=new Set([r.Free,r.FreeProTrial,r.Custom]),o=new Set(Object.values(r).filter(e=>!n.has(e)));const parseCheckoutPlanId=e=>{if(e&&o.has(e))return e},parseCheckoutCouponCode=e=>e?.trim()||void 0,parseSubscriptionCheckoutParams=e=>({planId:parseCheckoutPlanId(e.get(t.plan)),couponCode:parseCheckoutCouponCode(e.get(t.coupon))});var withCheckoutSearch=(e,r)=>{const n=(({planId:e,couponCode:r})=>{const n=new URLSearchParams;return e&&n.set(t.plan,e),r&&n.set(t.coupon,r),n.toString()})(r);return n?`${e}?${n}`:e};const buildAccountUpgradeCheckoutUrl=(t={})=>withCheckoutSearch(e.accountUpgrade,t),buildOnboardingCheckoutUrl=(t={})=>withCheckoutSearch(e.onboarding,t);var l="authFlow:telemetry";let a=function(e){return e.Login="login",e.Signup="signup",e.Url="url",e.Redirect="redirect",e.Referral="referral",e.Cta="cta",e.PlanCard="planCard",e}({}),s=function(e){return e.Email="email",e.CodeLogin="codeLogin",e.Password="password",e.CodeSignup="codeSignup",e.PlanSelection="PlanSelection",e.Payment="Payment",e.ForgotPasswordCode="forgotPasswordCode",e.ResetPassword="resetPassword",e.MarketingEmail="marketingEmail",e.DesktopApp="desktopApp",e}({}),c=function(e){return e.Signup="signup",e.Login="login",e.PasswordReset="passwordReset",e.Empty="",e}({}),d=function(e){return e.Google="google",e.Email="email",e.Empty="",e}({}),i=function(e){return e.Free="free",e.Creator="creator",e.Studio="studio",e.Empty="",e}({}),u=function(e){return e.Monthly="monthly",e.Yearly="yearly",e.Empty="",e}({});var m={context:"",type:c.Empty,method:d.Empty,selectedPlan:i.Empty,selectedInterval:u.Empty};function selectedFieldsFromPlanId(e,t){return e?{selectedPlan:e.includes("studio")?i.Studio:e.includes("creator")?i.Creator:i.Free,selectedInterval:e.includes("year")?u.Yearly:e.includes("month")?u.Monthly:"year"===t?u.Yearly:"month"===t?u.Monthly:u.Empty}:{selectedPlan:i.Empty,selectedInterval:u.Empty}}function entryContextFromReferrer(){if("undefined"==typeof document||"undefined"==typeof window)return a.Url;const{referrer:e}=document;if(!e)return a.Url;try{return new URL(e).origin===window.location.origin?a.Redirect:a.Referral}catch{return a.Url}}function persistAuthFlowTelemetry(e){try{sessionStorage.setItem(l,JSON.stringify(e))}catch{}}function getAuthFlowTelemetry(){try{const e=sessionStorage.getItem(l);if(!e)return{...m};const t=JSON.parse(e);return{context:t.context??"",type:t.type??c.Empty,method:t.method??d.Empty,selectedPlan:t.selectedPlan??i.Empty,selectedInterval:t.selectedInterval??u.Empty}}catch{return{...m}}}function patchAuthFlowTelemetry(e){persistAuthFlowTelemetry({...getAuthFlowTelemetry(),...e})}function recordAuthFlowStart(e){persistAuthFlowTelemetry({context:e.context,type:c.Empty,method:d.Empty,...selectedFieldsFromPlanId(e.planId,e.
1interval)})}function ensureAuthFlowTelemetry(){const e=getAuthFlowTelemetry(),t=function selectedFieldsFromWindowLocation(){if("undefined"==typeof window)return{selectedPlan:i.Empty,selectedInterval:u.Empty};const{planId:e}=parseSubscriptionCheckoutParams(new URLSearchParams(window.location.search));return selectedFieldsFromPlanId(e)}(),r={...e,context:e.context||entryContextFromReferrer(),selectedPlan:e.selectedPlan||t.selectedPlan,selectedInterval:e.selectedInterval||t.selectedInterval};return r.context===e.context&&r.selectedPlan===e.selectedPlan&&r.selectedInterval===e.selectedInterval||persistAuthFlowTelemetry(r),r}function clearAuthFlowTelemetry(){try{sessionStorage.removeItem(l)}catch{}}function getAuthStepViewedEventProps(e){const t=ensureAuthFlowTelemetry(),r=e===s.Email;return{context:t.context||entryContextFromReferrer(),step:e,type:r?c.Empty:t.type,method:r?d.Empty:t.method,selectedPlan:t.selectedPlan,selectedInterval:t.selectedInterval}}export{clearAuthFlowTelemetry as a,recordAuthFlowStart as c,buildOnboardingCheckoutUrl as d,parseCheckoutCouponCode as f,s as i,selectedFieldsFromPlanId as l,parseSubscriptionCheckoutParams as m,d as n,getAuthStepViewedEventProps as o,parseCheckoutPlanId as p,c as r,patchAuthFlowTelemetry as s,a as t,buildAccountUpgradeCheckoutUrl as u}; 2//# sourceMappingURL=chunk-158249119-1-81-19.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.