PageSourceSearch

https://www.tracklib.com/assets/subscribe-BtUDn_T_.js

js tracklib.com collected 2026-10-02 06:49:24 UTC 21,637 bytes, 1 lines download raw bytes

1import{r as i,j as e,b as Pe}from"./react-CaZ3b-uf.js";import{g as me,h as ue,L as ee}from"./tanstack-router-DdV6ARKN.js";import{au as C,L as P,bI as O,aD as fe,ay as _e,K as X,M as T,U as pe,$ as he,aL as $,fV as Ae,b2 as Te,ed as te,fW as Ce,fX as R}from"./tanstack-start-BzM2Ciq7.js";import{s as se,F as Ee,a as De,p as Me,n as Ie}from"./flow-step-navigation-BjsNxqMF.js";import{u as z,P as Le}from"./use-pricing-state-DhvIibeE.js";import{u as Re,A as $e}from"./Addons-C5gEDSCL.js";import{O as Fe,n as xe,Y as W,ak as We,al as ye,am as Oe,a1 as ze,y as Ve,an as Be,h as Ye,L as Ue,a0 as Ge,A as He,ac as qe,d as Ke}from"./shell--root-CfSXB45t.js";import{t as F}from"./sonner-D-uFVvD1.js";import{P as Qe,A as Xe,N as Je}from"./PayPalForm-5sBogSsG.js";import{P as Ze}from"./PaymentMethod-Nf-Vdygd.js";import{A as ae,b as ne,a as ie}from"./alert-C3EWs691.js";import{b as et,c as tt}from"./order-CaPtDSdE.js";import{D as re}from"./payment-method-utils-CSuVIkpf.js";import{T as oe}from"./types-8MKXqvHQ.js";import{m as J}from"./motion-C2Q5rmiN.js";import{S as st}from"./spinner-DKC4IU2c.js";import{u as at}from"./profile-Ckd0CrmP.js";import{u as nt,d as it,g as rt}from"./desktop-app-CS37uu83.js";import{u as ot}from"./public-stats-BR2yTDQJ.js";import{C as lt,a as ct}from"./card-BeWJ-FK-.js";import{u as dt}from"./use-media-query-C5zUKr1b.js";import"./tanstack-CzaH6mfd.js";import"./radix-accordion-B9Cw5kfI.js";import"./radix-dialog-CRaAAOVD.js";import"./radix-menu-D_9sKf4A.js";import"./radix-select-Cz5S0Opm.js";import"./radix-navigation-menu-DkxGYPh1.js";import"./lucide-CqZJRsZM.js";import"./tanstack-query-CWWMDizP.js";import"./ui-utils-Bj2vDxdV.js";import"./unpic-CfMFyugp.js";import"./Reveal-PCaWov7S.js";import"./use-in-view-BPgmbiBa.js";import"./radio-group-Bhc3Gpjg.js";import"./tier-periods-CYe6lSLh.js";import"./check-animated-6PGqM86E.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"[email protected]"};var n=new s.Error().stack;
1n&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[n]="465cfecf-c490-486b-9729-3b27c094f675",s._sentryDebugIdIdentifier="sentry-dbid-465cfecf-c490-486b-9729-3b27c094f675")}catch{}})();const mt=({onNext:s})=>{const{data:n}=Fe(),{addon:t,hasAddon:c}=Re({tierOffering:n}),r=xe(),[o,f]=i.useState(!1),[x,l]=i.useState(null),d=i.useRef(!1),m=i.useRef(s);return i.useEffect(()=>{m.current=s},[s]),i.useEffect(()=>{n&&!c&&s()},[n,c,s]),i.useEffect(()=>{if(x===null||t.addonSelected!==x||d.current)return;if(d.current=!0,x!==!0){m.current();return}const a=setTimeout(()=>m.current(),1e3);return()=>clearTimeout(a)},[x,t.addonSelected]),n?c?e.jsxs("div",{className:"flex w-full flex-col gap-6",children:[e.jsx($e,{addon:t}),e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row",children:[t.addonSelected&&!o?e.jsx(P,{className:"cursor-pointer",color:"accent",onClick:s,size:"lg",children:"Continue"}):e.jsxs(O,{className:"cursor-pointer",color:"accent",isLoading:o,onClick:()=>{f(!0),t.setAddon(!0),l(!0),r("double-credits-chosen",{doublingcredit_true:!0})},size:"lg",children:[e.jsx(fe,{name:"add"}),"Add upgrade and continue"]}),e.jsx(P,{className:"cursor-pointer",color:"secondary","data-testid":"subscribe-addon-skip-button",onClick:()=>{t.setAddon(!1),l(!1),r("double-credits-chosen",{doublingcredit_true:!1})},size:"lg",children:"Continue without upgrade"})]})]}):null:e.jsxs("div",{className:"flex w-full flex-col gap-6",children:[e.jsx(C,{className:"h-32 w-full rounded-md"}),e.jsx(C,{className:"h-12 w-full rounded-sm"})]})},le=e.jsx(fe,{name:"lock",size:24}),ce=e.jsx(We,{className:"size-6"}),ut=e.jsx(Oe,{className:"size-6"}),ft=864e5,pt=s=>{const n=new Date,t=new Date(n);return t.setMonth(t.getMonth()+s),Math.round((t.getTime()-n.getTime())/ft)},ht=({onNext:s})=>{const{selectedPeriod:n,currency:t,profile:c,offersTrial:r,trialOffer:o,trialDurationLabel:f,period:x}=z(),l=x==="yearly",m=_e()?pt(l?12:1):null;if(!n)return e.jsxs("div",{className:"flex w-full flex-col gap-8",children:[e.jsx(C,{className:"h-8 w-3/4"}),e.jsx(C,{className:"h-48 w-full"}),e.jsx(C,{className:"h-12 w-full"})]});const a=W(c,n.price,t,n.price_inc_vat),h=n.fall_back_period??n,g=W(c,h.price,t,h.price_inc_vat),p=n.price!==h.price,b=n.tier.months_before_fallback??1,j=r&&o?o.free_months*30+o.free_days:0,N=p&&!l&&b===1?g:a,u=r?[{title:"Today",description:"Try out Tracklib today for free!",icon:le},{title:`In ${j} days`,description:`Your trial ends and you will be charged ${N}`,icon:ce}]:[{title:"Today",description:`Pay ${a} today and get full access to Tracklib`,icon:le},{title:m===null?`Every ${l?"year":"month"}`:`In ${m} days`,description:`Your plan will renew and you will be charged ${N}`,icon:ce}];p&&b>1&&(r||!l)&&u.push({title:`In ${ye(b)}`,description:`Your plan will transition to ${g}/month`,icon:ut});const v=r?`How your ${f??""} free trial works`:`How your ${a} offer works`;return e.jsxs("div",{className:"flex w-full flex-col gap-8",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h1",{className:"font-heading text-heading-lg uppercase",children:v}),e.jsx("p",{className:"text-body-lg text-muted-foreground",children:"Straightforward."})]}),e.jsx("ol",{className:"flex flex-col",children:u.map((k,w)=>{const _=w===u.length-1;return e.jsxs("li",{className:"flex gap-5",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-md bg-card text-foreground",children:k.icon}),!_&&e.jsx("div",{className:"my-1 w-px flex-1 bg-border"})]}),e.jsx("div",{className:X("flex flex-1 flex-col",!_&&"pb-10"),children:e.jsxs("div",{className:"flex min-h-12 flex-col justify-center gap-0.5",children:[e.jsx("p",{className:"font-bold text-body-md",children:k.title}),e.jsx("p",{className:"text-body-sm text-muted-foreground",children:k.description})]})})]},k.title)})}),e.jsx(P,{className:"w-full cursor-pointer",color:"accent","data-testid":"subscribe-how-it-works-continue-button",onClick:s,size:"lg",children:"Continue"})]})},xt=({onNext:s})=>{const n=z(),{selectedPeriod:t,currency:c,profile:r,offersTrial:o,trialOffer:f,trialDurationLabel:x,addonSelected:l}=n,{data:d}=ze(),{data:m,refetch:a}=Ve(),{mutateAsync:h,isPending:g,error:p}=et(),{mutateAsync:b,isPending:j,error:N}=Be(),{data:u,isLoading:y}=tt(),v=!!(u&&[oe.PENDING,oe.WAITING].includes(u.state)),k=v||y,[w,_]=i.useState(!1),A=Ye(),V=xe(),[B,M]=i.useState(!1),[S,I]=i.useState(!1),ge=i.useMemo(()=>d?[d.paypal]:void 0,[d]),be=i.useMemo(()=>d?.applePay?[d.applePay]:void 0,[d]),je=i.useMemo(()=>d?[d.creditCards]:void 0,[d]),Y=p??N,U=g||j||B,ve=!!m&&!S,G=async()=>{await a(),_(!1),I(!1)},we=async()=>
1{if(!(t&&m)||U||k)return;M(!0);const E=!!(o&&f);try{if(o&&f){await b({trialOfferId:f.id,period:t,paymentMethodVariant:m.variant});const K={eventCategory:"plans",eventLabel:t.tier.label||"unknown",eventValue:Math.ceil(t.price_inc_vat||0),currency:r?.currency,paymentMethod:String(m.variant)};A("trialStarted",{...K,eventAction:"trial started"}),t.months===1?A("trialStartedMonthly",{...K,eventAction:"trial started monthly"}):t.months===12&&A("trialStartedYearly",{...K,eventAction:"trial started yearly"})}else await h(t.id);A("Subscribe",{eventCategory:"plans",eventLabel:t.tier.label||"unknown",eventValue:E?0:t.price_inc_vat,value:String(E?0:t.price_inc_vat),currency:r?.currency}),V(E?"trial-started":"subscription-started",{subscription_period:Ge(t.months),price:t.price_inc_vat,currency:c??"",selected_tier:t.tier.label||"unknown",tier_id:t.tier.id,paymentMethod:String(m.variant),doublingcredit_true:l}),r?.currency&&!E&&A("purchase",{transaction_id:`sub_${Date.now()}_${t.id}`,eventValue:t.price_inc_vat,currency:r.currency,items:[{item_id:String(t.tier.id),item_name:t.tier.label,item_category:t.label,price:t.price_inc_vat,quantity:1}]}),s()}catch{M(!1),F.error(o?"Could not start your trial. Please try again.":"Payment could not be completed. Please try again.")}},H=t?W(r,t.price,c,t.price_inc_vat):"",q=t?.months===12?"year":"month",L=t?.fall_back_period??t,Se=L?W(r,L.price,c,L.price_inc_vat):"",Z=!!t&&!!L&&t.price!==L.price,Ne=t?.tier.months_before_fallback??1,ke=ye(Ne);return e.jsxs("div",{className:"flex w-full flex-col gap-8",children:[e.jsxs("div",{className:"flex flex-col gap-2 rounded-md bg-card p-6",children:[e.jsx("div",{className:"flex items-center justify-between gap-4",children:t?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-bold text-body-lg",children:o?`Free for ${x}`:`${t.label} ${t.tier.label}`}),!(Z&&!o)&&e.jsx("span",{className:"font-bold text-body-xl",children:o?Ue(0,c):H})]}):e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"h-6 w-28"}),e.jsx(C,{className:"h-7 w-20"})]})}),o&&e.jsx("p",{className:"text-body-sm text-muted-foreground",children:`Then ${H}/${q}. Cancel anytime.`}),!o&&Z&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-body-sm text-green",children:`${H}/${q} for ${ke}`}),e.jsx("p",{className:"text-body-sm text-muted-foreground",children:`${Se}/${q} after`})]})]}),Y&&e.jsxs(ae,{variant:"destructive",children:[e.jsx(ne,{children:o?"Could not start trial":"Payment failed"}),e.jsx(ie,{children:Y instanceof Error?Y.message:re})]}),v&&e.jsxs(ae,{"data-testid":"payment-pending",variant:"info",children:[e.jsx(ne,{children:"Payment pending"}),e.jsx(ie,{children:"A payment has been initiated, but is not yet complete. When it has been fully processed, your subscription will be activated automatically. If you have any further questions, please contact support."})]}),ve?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Ze,{onClick:()=>I(!0)}),e.jsx(O,{className:"w-full cursor-pointer",color:"accent","data-testid":"start-subscription-button",disabled:!t||U||k,isLoading:U,onClick:we,size:"lg",children:o?"Start trial":"Subscribe"})]}):e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Qe,{onError:()=>F.error(re),onSuccess:G,paymentMethods:ge}),e.jsx(Xe,{onError:E=>F.error(E),onSuccess:G,paymentMethods:be}),e.jsx(J.div,{animate:w?{height:0,opacity:0}:{height:"auto",opacity:1},"aria-hidden":w,inert:w,initial:!1,style:{overflow:"hidden"},transition:{duration:.3,ease:"easeOut"},children:e.jsx(P,{className:"w-full",color:"secondary","data-testid":"subscribe-pay-with-card-button",onClick:()=>_(!0),size:"lg",children:"Add Card"})}),e.jsx(J.div,{animate:w?{height:"auto",opacity:1}:{height:0,opacity:0},"aria-hidden":!w,inert:!w,initial:!1,style:{overflow:"hidden"},transition:{duration:.3,ease:"easeOut"},children:e.jsx(Je,{onSuccess:G,paymentMethods:je})}),m&&S&&e.jsx(P,{className:"w-full cursor-pointer",color:"secondary",onClick:()=>{I(!1),_(!1)},size:"lg",children:"Cancel"})]})]})},yt=s=>{const n=me(),t=ue({from:"/_marketing/subscribe"}),c=i.useState(t.period??null),r=z(c),{period:o,isLoading:f,hasAddon:x}=r,l=()=>{n({to:T({name:"subscribe"}),search:d=>({...d,period:o,step:x?"addon":"howitworks"}),replace:!0,resetScroll:!0})};return e.jsx(Le,{cta:e.jsx(P,{color:"accent",disabled:f,onClick:l,size:"lg",children:"Continue"}),pricing:r})}
1,gt=4e3,bt=2e3,jt=({onNext:s})=>{const{data:n,refetch:t}=pe(),{mutate:c,isPending:r}=at(),[o,f]=i.useState(!1),[x,l]=i.useState(!1),[d,m]=i.useState(!1),a=n?.emails.find(p=>p.primary)??n?.emails[0],h=!!a?.verified;i.useEffect(()=>{if(h||d)return;const p=()=>{document.visibilityState==="visible"&&t()},b=setInterval(p,gt);return document.addEventListener("visibilitychange",p),()=>{clearInterval(b),document.removeEventListener("visibilitychange",p)}},[h,d,t]),i.useEffect(()=>{h&&m(!0)},[h]),i.useEffect(()=>{if(!(d&&h))return;const p=setTimeout(s,bt);return()=>clearTimeout(p)},[d,h,s]);const g=async()=>{l(!1),m(!0);const{data:p}=await t();(p?.emails.find(j=>j.primary)??p?.emails[0])?.verified||(m(!1),l(!0))};return d?e.jsxs("div",{className:"mx-auto flex w-full max-w-md flex-col items-center gap-4 text-center",children:[e.jsx(st,{className:"h-auto w-auto"}),e.jsx("p",{className:"text-body-lg text-muted-foreground",children:h?"Email verified - taking you to your plan...":"Checking your email..."})]}):e.jsxs("div",{className:"mx-auto flex w-full max-w-md flex-col items-center gap-6 text-center",children:[e.jsx("h1",{className:"font-heading text-foreground text-heading-xl uppercase md:text-heading-lg",children:"Check your inbox"}),e.jsxs("p",{className:"text-body-lg text-muted-foreground",children:["We sent a verification link to"," ",e.jsx("span",{className:"break-words font-bold text-foreground",children:a?.email??"your email"}),". Click it to continue - we'll pick up where you left off automatically."]}),e.jsxs("div",{className:"flex w-full flex-col-reverse justify-center gap-3 sm:flex-row",children:[e.jsx(O,{color:"secondary",disabled:!a||r||o,isLoading:r,isSuccess:o,onClick:()=>{a&&c(a.email,{onSuccess:()=>f(!0)})},size:"lg",successText:"Email sent",children:"Resend verification email"}),e.jsx(P,{color:"primary",disabled:!a,onClick:g,size:"lg",children:"I've verified my email"})]}),x?e.jsx("p",{className:"text-body-sm text-muted-foreground",children:"We couldn't confirm it yet. Click the link in your email, then try again."}):e.jsx("p",{className:"text-body-sm text-muted-foreground",children:"Didn't get it? Check your spam folder."})]})},D=150,vt={contain:{image:"object-contain scale-[0.9]"},bleed:{image:"object-cover",wrapper:"md:-mr-8 md:ml-8"}},Q=({isTrial:s,planLabel:n,className:t,style:c})=>e.jsxs(He,{className:t,style:c,variant:"success",children:[e.jsx(qe,{className:"line-clamp-none shrink-0 whitespace-nowrap",children:s?"Your trial has started!":"Payment successful!"}),e.jsx(Ke,{children:s?"Enjoy Tracklib for free until your trial ends. We won't charge you before then - cancel anytime.":`You're now on a Premium ${n} plan.`})]}),wt="https://apps.apple.com/us/app/tracklib-beatmaker-samples/id6737972647",St=()=>{const{data:s}=he(),{songs:n,sounds:t}=ot(),c=nt(),r=dt("(max-width: 1023px)",!0),o=s?.state===$.TRIAL,f=s?.renewal_period?.months===12?"yearly":"monthly",x=[{title:"Browse & Discover",description:`Explore and sync ${n} original songs and ${t} royalty-free sounds.`,image:"/static/images/subscribe-feature-browse.webp",layout:"contain"},{title:"Sync Collections",description:"Access and manage your saved samples seamlessly.",image:"/static/images/subscribe-feature-sync.webp",layout:"contain"},{title:"Drag & Drop",description:"Instantly add samples to your DAW for faster music creation.",image:"/static/images/subscribe-feature-drag.webp",layout:"bleed"},{title:"Preview & Create Loops",description:"Create custom loops, adjust pitch, and drag & drop directly into your DAW projects.",image:"/static/images/subscribe-feature-loops.webp",layout:"contain"}],[l,d]=i.useState(null),[m,a]=i.useState(!1),h=i.useRef(!1),[g,p]=i.useState(!1);i.useEffect(()=>p(!0),[]),i.useEffect(()=>{let u=!0;return it().then(y=>{u&&d(y)}),()=>{u=!1}},[]);const b=l?rt(l.os):"installer",j=i.useCallback(()=>{l&&(a(!0),c(l.os,l.arch,{preferUniversal:!0}).catch(()=>{F.error("Could not start the download. Please try again.")}).finally(()=>a(!1)))},[c,l]);i.useEffect(()=>{h.current||!l||r||(h.current=!0,j())},[l,r,j]);const N=[{id:"install",node:e.jsxs(e.Fragment,{children:["Install the ",e.jsx("span",{className:"font-bold",children:b})," from your downloads"]})},{id:"scan",node:"Scan for VSTs in your DAW"},{id:"login",node:"Login into your account in the Desktop App"}];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-11 lg:hidden",children:[e.jsx(Q,{isTrial:o,planLabel:f}),e.jsx("h1",{className:"font-heading text-heading-2xl uppercase",children:"Welcome to Tracklib"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"font-bold text-body-xl",children:"Get the Tracklib Mobile App"}),e.jsx("p",{className:"text-body-md text-muted-foreground",children:"It is super fun and included in your plan."}),e.jsx("a",{className:"w-fit cursor-pointer transition-opacity hover:opacity-80",href:wt,rel:"noreferrer",target:"_blank",children:e.jsx("img",{alt:"Download on the App Store",className:"h-12 w-auto",height:40,src:"/static/app-store-badge.svg",width:120})})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"font-bold text-body-xl",children:"Start digging on Web"}),e.jsx("p",{className:"text-body-md text-muted-foreground",children:"Endless catalogue of gems."}),e.jsx(P,{asChild:!0,className:"w-full cursor-pointer",color:"accent",size:"lg",children:e.jsx(ee,{to:T({name:"discover"}),children:"Continue to Web"})})]})]}),g&&Pe.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-4 z-50 hidden h-16 items-center justify-center px-4 xl:flex",children:e.jsx(Q,{className:"slide-in-from-top-2 fade-in pointer-events-auto animate-in fill-mode-both duration-500 ease-out",isTrial:o,planLabel:f,style:{animationDelay:`${D}ms`}})}),e.jsx("div",{className:"pointer-events-none fixed inset-x-0 top-4 z-50 hidden h-16 px-4 lg:block",children:e.jsx("div",{className:"mx-auto flex h-16 max-w-screen-xl items-center justify-end lg:px-6",children:e.jsx(P,{asChild:!0,className:"fade-in pointer-events-auto animate-in cursor-pointer fill-mode-both duration-500 ease-out",color:"secondary",style:{animationDelay:`${D}ms`},children:e.jsx(ee,{to:T({name:"discover"}),children:"Browse on web"})})})})]}),document.body),e.jsxs("div",{className:"hidden lg:flex lg:flex-1 lg:flex-col lg:gap-8 lg:pt-20",children:[e.jsx("div",{className:"hidden lg:-mt-14 lg:mb-2.5 lg:block xl:hidden",children:e.jsx(Q,{isTrial:o,planLabel:f})}),e.jsx("div",{className:"flex flex-1 flex-col items-center justify-center",children:e.jsxs("div",{className:"flex max-w-xl flex-col items-center gap-4 text-center",children:[e.jsx("h1",{className:"fade-in animate-in fill-mode-both text-heading-lg duration-500 ease-out",style:{animationDelay:`${D+100}ms`},children:"INSTALL THE DESKTOP APP"}),e.jsx("ol",{className:"flex flex-col items-start gap-2",children:N.map((u,y)=>e.jsxs("li",{className:"fade-in flex animate-in items-center gap-4 fill-mode-both duration-500 ease-out",style:{animationDelay:`${D+200+y*80}ms`},children:[e.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-accent font-bold text-body-sm text-primary",children:y+1}),e.jsx("span",{className:"text-body-md leading-tight",children:u.node})]},u.id))}),l&&e.jsx(O,{className:"fade-in mt-2 animate-in cursor-pointer fill-mode-both duration-500 ease-out",disabled:m,isLoading:m,onClick:j,size:"lg",style:{animationDelay:`${D+450}ms`},children:l.os==="win"?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{}),"Download for Windows"]}):e.jsxs(e.Fragment,{children:[e.jsx(Te,{}),"Download for Mac"]})})]})}),e.jsx("div",{className:"grid w-full grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:x.map((u,y)=>{const v=vt[u.layout];return e.jsxs(lt,{className:"fade-in animate-in gap-0 overflow-hidden fill-mode-both p-0 duration-500 ease-out md:p-0",style:{animationDelay:`${D+500+y*100}ms`},children:[e.jsx("div",{className:X("relative aspect-[4/3]",v.wrapper),children:e.jsx("img",{alt:u.title,className:X("absolute inset-0 size-full",v.image),decoding:"async",loading:"lazy",src:u.image})}),e.jsxs(ct,{className:"flex flex-col gap-2 p-6",children:[e.jsx("h3",{className:"font-bold text-body-lg",children:u.title}),e.jsx("p",{className:"text-body-sm text-muted-foreground",children:u.description})]})]},u.title)})})]})]})},Nt={verify:{Component:jt},plan:{maxWidth:"max-w-screen-xl",Component:yt},addon:{title:"Maximize your creativity",description:"Downloads on Tracklib are based on credits. More credits mean fewer limits and more room to follow your ideas.",maxWidth:"max-w-3xl",Component:mt},howitworks:{Component:ht},payment:{title:"Confirm subscription",Component:xt},welcome:{maxWidth:"max-w-screen-xl",fillContent:!0,Component:St}},kt="plan",Pt="welcome",de=[$.ACTIVE,$.TRIAL,$.PAUSED],_t=s=>s==="addon"||s==="howitworks"||s==="payment",At=(s,n)=>s===void 0&&n?"addon":s??kt,Tt=()=>{const s=me(),n=ue({from:"/_marketing/subscribe"}),t=te(S=>S.isAuthenticated),c=te(S=>S.authReady),{data:r,isPending:o}=he(),{data:f,isPending:x}=pe(),{hasAddon:l,offersTrial:d}=z(),m=Ce(n.step)?n.step:void 0,a=At(m,!!n.period),g=!!(f?.emails.find(S=>S.primary)??f?.emails[0])?.verified,p=!!r&&de.includes(r.state)&&a!=="welcome"&&a!=="payment",j=c&&t&&!
1o&&!x&&!p&&!(t&&!!f&&!g&&a!=="verify"),N=i.useRef(a),u=se(R,a)>=se(R,N.current)?"forward":"backward";i.useEffect(()=>{N.current=a},[a]);const y=S=>{s({to:T({name:"subscribe"}),search:I=>({...I,step:S}),replace:!1,resetScroll:!0})};i.useEffect(()=>{!c||!t||!f||a!=="verify"&&(g||y("verify"))},[c,t,f,g,a]),i.useEffect(()=>{c&&(t||s({to:T({name:"signup"}),search:n.period?{period:n.period}:{},replace:!0,resetScroll:!0}))},[c,t,s,n.period]),i.useEffect(()=>{!r||a==="welcome"||a==="payment"||de.includes(r.state)&&s({to:T({name:"discover"}),replace:!0,resetScroll:!0})},[r,a,s]);const v=Nt[a],{Component:k,description:w,maxWidth:_,fillContent:A}=v,V=a==="payment"&&d?"Start trial":v.title,B=()=>{if(a===Pt){s({to:T({name:"discover"}),resetScroll:!0});return}if(a==="verify"){y(n.period?"addon":"plan");return}y(Ie(R,a))},M=()=>{if(a==="howitworks"&&!l){y("plan");return}y(Me(R,a))};return e.jsx(Ee,{direction:u,isReady:j,children:e.jsx(J.div,{animate:{opacity:1},exit:{opacity:0},initial:{opacity:0},transition:{duration:.24,ease:"easeOut"},children:e.jsx(De,{canGoBack:_t(a),description:w,direction:u,fillContent:A,maxWidthClass:_??"max-w-xl",onBack:M,slide:!1,step:a,title:V,children:e.jsx(k,{onBack:M,onNext:B})})},a)})},us=Tt;export{us as component};

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.