1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="5a76c6d6-e24d-1cd2-4304-647cdb465977")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,635644,e=>{"use strict";var t=e.i(480384);e.i(225922);var r=e.i(273266),a=e.i(993934),s=e.i(739036);e.i(631597);let i=(0,e.i(593529).default)((0,t.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"}),"Apple");e.i(573993);var o=e.i(933885),n=e.i(743893);e.s(["default",0,({authenticationSession:e,returnTo:l,signup:u,variant:c})=>{let d=(0,a.usePostHog)(),p=(0,r.useAuthSessionStart)(),{toast:g}=(0,s.useToast)(),h=async()=>{let t="global:user:login:submit";if(u&&(t="global:user:signup:submit"),d.capture(t,{method:"apple"}),!e)try{await p.mutateAsync(l)}catch{g({title:"Sign in failed",description:"Could not start authentication session. Please try again."});return}window.location.href=(0,n.getAppleAuthorizeURL)()};return(0,t.jsx)("a",{onClick:h,children:(0,t.jsxs)(o.Button,{variant:c,wrapperClassNames:"space-x-2",fullWidth:!0,children:[(0,t.jsx)(i,{}),(0,t.jsx)("div",{children:u?"Sign up with Apple":"Sign in with Apple"})]})})}],635644)},587192,683197,e=>{"use strict";var t=e.i(480384),r=e.i(631597),a=e.i(704215),s=e.i(838385),i=e.i(635644);let o=()=>(0,t.jsxs)("div",{className:"dark:text-polar-500 mt-6 text-center text-xs text-balance text-gray-400",children:["By using Polar, you agree to our"," ",(0,t.jsx)("a",{className:"dark:text-polar-300 text-gray-600",href:"https://polar.sh/legal/master-services-terms",rel:"noopener noreferrer",children:"Terms of Service"})," ","&"," ",(0,t.jsx)("a",{className:"dark:text-polar-300 text-gray-600",href:"https://polar.sh/legal/privacy-policy",rel:"noopener noreferrer",children:"Privacy Policy"}),"."]});var n=e.i(625622),l=e.i(372957),u=e.i(993934);let c=({event:e,enabled:t=!0,build:a})=>{let s=(0,u.usePostHog)(),i=(0,r.useRef)(!1);(0,r.useEffect)(()=>{!t||i.current||(i.current=!0,s.capture(e,a()))},[t])};e.s(["useImpressionEvent",0,c],683197);let d=["apple","github","google"],p=e=>!!e&&d.includes(e),g=({show:e,children:r})=>(0,t.jsxs)("div",{className:"relative",children:[e&&(0,t.jsx)("span",{className:"dark:bg-polar-900 dark:border-polar-600 absolute -top-3 -right-2 z-20 rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs text-black dark:text-white",children:"Last used"}),r]});e.s(["default",0,({authenticationSession:e,lastLoginMethod:u,returnTo:h,signup:m})=>{let f=(0,l.usePathname)(),x=(0,l.useSearchParams)(),b=m?"global:user:signup:view":"global:user:login:view",y=m?{signup:{path:f,host:window.location.host,campaign:x.get("campaign")??"",utm_source:x.get("utm_source")??"",utm_medium:x.get("utm_medium")??"",utm_campaign:x.get("utm_campaign")??""}}:{};c({event:b,build:()=>y});let S=p(u)?u:"google",v=[S,...d.filter(e=>p(e)&&e!==S)];return(0,t.jsxs)("div",{className:"flex flex-col gap-y-4",children:[(0,t.jsxs)("div",{className:"flex w-full flex-col gap-y-4",children:[v.map((s,o)=>(0,t.jsx)(r.Fragment,{children:(0,t.jsx)(g,{show:u===s,children:((r,s)=>{let o=s?"default":"secondary";switch(r){case"apple":return(0,t.jsx)(i.default,{authenticationSession:e,variant:o,returnTo:h,signup:m});case"github":return(0,t.jsx)(n.default,{authenticationSession:e,variant:o,returnTo:h,signup:m});case"google":return(0,t.jsx)(a.default,{authenticationSession:e,variant:o,returnTo:h,signup:m})}})(s,0===o)})},s)),(0,t.jsxs)("div",{className:"flex w-full flex-row items-center gap-6",children:[(0,t.jsx)("div",{className:"dark:border-polar-700 grow border-t border-gray-200"}),(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"or"}),(0,t.jsx)("div",{className:"dark:border-polar-700 grow border-t border-gray-200"})]}),(0,t.jsx)(g,{show:"email_otp"===u,children:(0,t.jsx)(s.default,{authenticationSession:e,returnTo:h,signup:m})})]}),(0,t.jsx)(o,{})]})}],587192)},929638,e=>{"use strict";var t=e.i(480384),r=e.i(587192);e.s(["AuthModal",0,({returnTo:e,signup:a})=>{let s="u">typeof document?document.cookie.match(/polar_last_login_method=(\w+)/)?.[1]??null:null;return(0,t.jsx)("div",{className:"overflow-y-auto p-12",children:(0,t.jsxs)("div",{className:"flex flex-col justify-between gap-y-12",children:[void 0!==a&&(0,t.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,t.jsx)("h1",{className:"text-xl font-medium",children:"Welcome to Polar"}),(0,t.jsx)("p",{className:"dark:text-polar-500 text-sm text-gray-500",children:"A billing platform for the intelligence era."})]}),(0,t.jsx)("div",{className:"flex flex-col gap-y-12",children:(0,t.jsx)(r.default,{authenticationSession:null,returnTo:e,signup:a,lastLoginMethod:s})})]})})}])},838385,e=>{"use strict";var t=e.i(480384);e.i(225922);
2var r=e.i(273266),a=e.i(993934),s=e.i(182558),i=e.i(942137),o=e.i(631597);let n=s.default.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY||("development"===i.CONFIG.ENVIRONMENT?"1x00000000000000000000BB":"0x4AAAAAAD7cBrbpX3kX8K9g");var l=e.i(994083),u=e.i(513036);e.i(573993);var c=e.i(933885),d=e.i(591703);e.i(204040);var p=e.i(854899),g=e.i(702480),h=e.i(845437),m=e.i(345272),f=e.i(604210),x=e.i(372957),b=e.i(903301),y=e.i(919363);e.s(["default",0,({authenticationSession:e,returnTo:s,signup:i})=>{var S;let v,w,j,_,T,A,P,k,C,R,L=(0,y.useForm)({defaultValues:{email:""}}),{control:N,handleSubmit:O,setError:E}=L,[$,U]=(0,o.useState)(!1),{containerRef:M,render:F,execute:z,getToken:I,reset:G}=(S="turnstile-spin-v2",v=(0,o.useRef)(null),w=(0,o.useRef)(null),j=(0,o.useRef)(!1),_=(0,o.useRef)(null),T=(0,o.useRef)([]),A=(0,o.useCallback)(e=>{_.current=e;let t=T.current;for(let r of(T.current=[],t))r(e)},[]),P=(0,o.useCallback)(()=>{let e=window.turnstile,t=w.current;_.current=null,j.current=!1,e&&t&&e.reset(t)},[]),k=(0,o.useCallback)(()=>{let e=window.turnstile,t=v.current;e&&t&&!w.current&&(w.current=e.render(t,{sitekey:n,action:S,appearance:"interaction-only",execution:"execute",size:"flexible",callback:A,"error-callback":()=>(A(null),P(),!0),"expired-callback":P}))},[S,A,P]),(0,o.useEffect)(()=>(k(),()=>{let e=window.turnstile,t=w.current;e&&t&&e.remove(t),w.current=null,j.current=!1,_.current=null,T.current=[]}),[k]),C=(0,o.useCallback)(()=>{let e=window.turnstile,t=w.current;e&&t&&!j.current&&(j.current=!0,e.execute(t))},[]),R=(0,o.useCallback)(()=>new Promise(e=>{if(_.current)return void e(_.current);C();let t=setTimeout(()=>e(null),15e3);T.current.push(r=>{clearTimeout(t),e(r)})}),[C]),{containerRef:v,render:k,execute:C,getToken:R,reset:P}),B=(0,r.useAuthSessionStart)(),D=(0,r.useEmailOTPRequest)(),H=(0,a.usePostHog)(),V=(0,x.useRouter)(),q=async({email:t})=>{U(!0);try{let r=await I();if(!r)return void E("email",{message:"Verification failed. Please try again."});let a="global:user:login:submit";i&&(a="global:user:signup:submit"),H.capture(a,{method:"email_otp"}),e||await B.mutateAsync(s);let{error:o}=await D.mutateAsync({email:t,turnstileToken:r});if(o){if("error"in o&&"SSORequired"===o.error)return void window.location.assign(o.redirect_url);(0,u.isValidationError)(o.detail)?(0,l.setValidationErrors)(o.detail,E):o.detail&&E("email",{message:o.detail});return}let n=new URLSearchParams({email:t,intent:i?"signup":"login"});V.push(`/auth/email-otp?${n.toString()}`)}catch{E("email",{message:"An unexpected error occurred. Please try again."})}finally{G(),U(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(b.default,{src:"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",strategy:"afterInteractive",onLoad:F,onReady:F}),(0,t.jsx)(p.Form,{...L,children:(0,t.jsxs)("form",{className:"flex w-full flex-col",onSubmit:O(q),children:[(0,t.jsx)(h.FormField,{control:N,name:"email",render:({field:e})=>(0,t.jsxs)(m.FormItem,{className:"mb-2",children:[(0,t.jsx)(g.FormControl,{children:(0,t.jsx)(d.Input,{type:"email",required:!0,placeholder:"Email",autoComplete:"off","data-1p-ignore":!0,...e,onFocus:z})}),(0,t.jsx)(f.FormMessage,{})]})}),(0,t.jsx)("div",{ref:M}),(0,t.jsx)(c.Button,{type:"submit",variant:"secondary",fullWidth:!0,loading:$,disabled:$,children:i?"Sign up with email":"Sign in with email"})]})})]})}],838385)},330192,e=>{"use strict";var t=e.i(480384),r=e.i(993934),a=e.i(942137),s=e.i(349666);e.i(573993);var i=e.i(933885),o=e.i(631597),n=e.i(119870),l=e.i(367602),u=e.i(738016),c=e.i(929638);function d({onSandbox:e,onGetStarted:r}){return(0,t.jsxs)("div",{className:"flex flex-col gap-y-12 p-12",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,t.jsx)("h1",{className:"text-xl font-medium",children:"Welcome to Polar"}),(0,t.jsx)("p",{className:"dark:text-polar-500 text-sm text-gray-500",children:"A billing platform for the intelligence era."})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Button,{fullWidth:!0,onClick:r,children:"Get started"}),(0,t.jsx)("p",{className:"dark:text-polar-500 mt-2 text-center text-xs text-gray-400",children:"Create your organization and start accepting payments."})]}),(0,t.jsxs)("div",{className:"flex w-full flex-row items-center gap-6",children:[(0,t.jsx)("div",{className:"dark:border-polar-700 grow border-t border-gray-200"}),(0,t.jsx)("div",{className:"text-sm text-gray-500",children:"or"}),(0,t.jsx)("div",{className:"dark:border-polar-700 grow border-t border-gray-200"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Button,{fullWidth:!0,variant:"secondary",onClick:e,children:"Try the sandbox"}),(0,t.jsx)("p",{className:"dark:text-polar-500 mt-2 text-center text-xs text-gray-400",children:"Test data and mock payments. No setup required."})]})]})]})}e.s(["default",0,({text:e,wrapperClassNames:p,size:g="lg",...h})=>{let m=(0,r.usePostHog)(),{isShown:f,hide:x,show:b}=(0,u.useModal)(),[y,S]=(0,o.useState)("choose"),v=(0,o.useCallback)(()=>{m.capture("global:user:signup:click"),S("choose"),b()},[m,b]),w=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),v()},[v]),j={choose:(0,t.jsx)(d,{onSandbox:()=>{m.capture("dashboard:onboarding:mode:click",{mode:"sandbox",source:"landing_modal"},{send_instantly:!0}),window.location.href=`${a.CONFIG.SANDBOX_FRONTEND_BASE_URL}/auth?return_to=/onboarding/start`},onGetStarted:()=>{m.capture("dashboard:onboarding:mode:click",{mode:"production",source:"landing_modal"}),S("signup")},onLogin:()=>S("login")}
2),signup:(0,t.jsx)(c.AuthModal,{returnTo:"/onboarding/personal",signup:!0}),login:(0,t.jsx)(c.AuthModal,{returnTo:"/dashboard"})}[y];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(i.Button,{wrapperClassNames:(0,n.twMerge)("flex flex-row items-center gap-x-2 ",p),size:g,onClick:v,onSubmit:w,...h,children:[(0,t.jsx)("div",{children:e||"Get Started"}),(0,t.jsx)(s.default,{className:"lg"===g?"text-lg":"text-md",fontSize:"inherit"})]}),(0,t.jsx)(l.Modal,{title:{choose:"Get started",signup:"Get started",login:"Sign in"}[y],isShown:f,hide:x,modalContent:j,className:"lg:w-full lg:max-w-[480px]"})]})}])},625622,e=>{"use strict";var t=e.i(480384);e.i(225922);var r=e.i(273266),a=e.i(993934),s=e.i(739036),i=e.i(580509);e.i(573993);var o=e.i(933885),n=e.i(743893);e.s(["default",0,({authenticationSession:e,returnTo:l,signup:u,variant:c})=>{let d=(0,a.usePostHog)(),p=(0,r.useAuthSessionStart)(),{toast:g}=(0,s.useToast)(),h=async()=>{let t="global:user:login:submit";if(u&&(t="global:user:signup:submit"),d.capture(t,{method:"github"}),!e)try{await p.mutateAsync(l)}catch{g({title:"Sign in failed",description:"Could not start authentication session. Please try again."});return}window.location.href=(0,n.getGitHubAuthorizeLoginURL)()};return(0,t.jsx)("a",{onClick:h,children:(0,t.jsxs)(o.Button,{variant:c,wrapperClassNames:"space-x-2",fullWidth:!0,children:[(0,t.jsx)(i.default,{}),(0,t.jsx)("div",{children:u?"Sign up with GitHub":"Sign in with GitHub"})]})})}])},704215,e=>{"use strict";var t=e.i(480384);e.i(225922);var r=e.i(273266),a=e.i(993934),s=e.i(739036),i=e.i(316090);e.i(573993);var o=e.i(933885),n=e.i(743893);e.s(["default",0,({authenticationSession:e,returnTo:l,signup:u,variant:c})=>{let d=(0,a.usePostHog)(),p=(0,r.useAuthSessionStart)(),{toast:g}=(0,s.useToast)(),h=async()=>{let t="global:user:login:submit";if(u&&(t="global:user:signup:submit"),d.capture(t,{method:"google"}),!e)try{await p.mutateAsync(l)}catch{g({title:"Sign in failed",description:"Could not start authentication session. Please try again."});return}window.location.href=(0,n.getGoogleAuthorizeLoginURL)()};return(0,t.jsx)("a",{onClick:h,children:(0,t.jsxs)(o.Button,{variant:c,wrapperClassNames:"space-x-2",fullWidth:!0,children:[(0,t.jsx)(i.default,{}),(0,t.jsx)("div",{children:u?"Sign up with Google":"Sign in with Google"})]})})}])},739036,e=>{"use strict";var t=e.i(431634),r=e.i(631597);let a=0,s=new Map,i=e=>{if(s.has(e))return;let t=setTimeout(()=>{s.delete(e),l({type:"REMOVE_TOAST",toastId:e})},1e6);s.set(e,t)},o=[],n={toasts:[]};function l(e){n=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?i(r):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===r||void 0===r?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(n,e),o.forEach(e=>{e(n)})}function u({...e}){let s=(a=(a+1)%Number.MAX_VALUE).toString(),i=e.description;("string"==typeof i&&i.includes("[object Object]")||"object"==typeof i&&null!==i&&!r.isValidElement(i))&&t.captureMessage("Toast displayed with [object Object]",{level:"warning",extra:{title:e.title,description:String(i)}});let o=()=>l({type:"DISMISS_TOAST",toastId:s});return l({type:"ADD_TOAST",toast:{...e,id:s,open:!0,onOpenChange:e=>{e||o()}}}),{id:s,dismiss:o,update:e=>l({type:"UPDATE_TOAST",toast:{...e,id:s}})}}e.s(["toast",0,u,"useToast",0,function(){let[e,t]=r.useState(n);return r.useEffect(()=>(o.push(t),()=>{let e=o.indexOf(t);e>-1&&o.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>l({type:"DISMISS_TOAST",toastId:e})}}])},273266,e=>{"use strict";var t=e.i(993934),r=e.i(725980),a=e.i(614769),s=e.i(942137),i=e.i(513036),o=e.i(431634),n=e.i(372957),l=e.i(942972),u=e.i(148031),c=e.i(631597);e.s(["useAuth",0,()=>{let e=(0,t.usePostHog)(),{user:s,setUser:n,userOrganizations:l,setUserOrganizations:u}=(0,c.useContext)(r.AuthContext),d=async()=>{try{let e=await (0,i.unwrap)(a.api.GET("/v1/users/me"));n(e),u(e.organizations??[])}catch(e){o.captureException(e)}};return(0,c.useEffect)(()=>{s?(o.setUser({id:s.id}),e.identify(s)):o.setUser(null)},[s,e]),{currentUser:s,authenticated:void 0!==s,reloadUser:d,userOrganizations:l,setUserOrganizations:u}},"useAuthSessionStart",0,()=>
2{let e="false"!==(0,n.useSearchParams)().get("sso_discovery");return(0,l.useMutation)({mutationFn:t=>a.api.POST("/v1/auth/start",{body:{return_to:t,sso_discovery:e}})})},"useBackupCodesEnroll",0,()=>(0,l.useMutation)({mutationFn:()=>a.api.POST("/v1/auth/backup-codes",{})}),"useBackupCodesStatus",0,()=>(0,u.useQuery)({queryKey:["backup-codes","status"],queryFn:async()=>{let{data:e,response:t}=await a.api.GET("/v1/auth/backup-codes");if(404===t.status)return null;if(!t.ok)throw Error("Failed to fetch backup codes status");return e},retry:!1}),"useBackupCodesVerify",0,()=>(0,l.useMutation)({mutationFn:e=>a.api.POST("/v1/auth/backup-codes/verify",{body:e})}),"useEmailOTPRequest",0,()=>(0,l.useMutation)({mutationFn:({email:e,turnstileToken:t})=>a.api.POST("/v1/auth/email-otp/request",{body:{email:e,"cf-turnstile-response":t}})}),"useEmailOTPVerify",0,()=>(0,l.useMutation)({mutationFn:e=>a.api.POST("/v1/auth/email-otp/verify",{body:{code:e}})}),"useLogout",0,()=>{let e=(0,t.usePostHog)();return(0,c.useCallback)(()=>{e.reset(),window.location.href=`${s.CONFIG.BASE_URL}/v1/auth/logout`},[e])},"useOrgAuthSessionStart",0,e=>(0,l.useMutation)({mutationFn:t=>a.api.POST("/v1/auth/{slug}/start",{params:{path:{slug:e}},body:{return_to:t}})}),"useTOTPDelete",0,()=>(0,l.useMutation)({mutationFn:()=>a.api.DELETE("/v1/auth/totp")}),"useTOTPEnable",0,()=>(0,l.useMutation)({mutationFn:e=>a.api.POST("/v1/auth/totp/enable",{body:{code:e}})}),"useTOTPEnroll",0,()=>(0,l.useMutation)({mutationFn:()=>a.api.POST("/v1/auth/totp",{})}),"useTOTPStatus",0,()=>(0,u.useQuery)({queryKey:["totp","status"],queryFn:async()=>{let{data:e,response:t}=await a.api.GET("/v1/auth/totp");if(404===t.status)return{enabled:!1};if(!t.ok)throw Error("Failed to fetch TOTP status");return e??{enabled:!1}},retry:!1}),"useTOTPVerify",0,()=>(0,l.useMutation)({mutationFn:e=>a.api.POST("/v1/auth/totp/verify",{body:{code:e}})})])},225922,632289,853183,e=>{"use strict";e.s([],225922),e.s(["useDisconnectOAuthAccount",()=>u,"useGitHubAccount",()=>n,"useGoogleAccount",()=>l],632289);var t=e.i(273266),r=e.i(614769),a=e.i(942972),s=e.i(110792),i=e.i(631597);let o=e=>{let r=(()=>{let{currentUser:e}=(0,t.useAuth)();return e?.oauth_accounts||[]})();return(0,i.useMemo)(()=>r.find(t=>t.platform===e),[r,e])},n=()=>o("github"),l=()=>o("google"),u=()=>{let e=(0,s.useQueryClient)(),{reloadUser:i}=(0,t.useAuth)();return(0,a.useMutation)({mutationFn:e=>r.api.DELETE("/v1/users/me/oauth-accounts/{platform}",{params:{path:{platform:e}}}),onSuccess:async()=>{await i(),e.invalidateQueries({queryKey:["user"]})}})};var c=e.i(942137),d=e.i(426813);let p="polar_onboarding_session",g=()=>{if("u"<typeof document)return null;let e=document.cookie.split("; ").find(e=>e.startsWith(`${p}=`))?.split("=")[1];if(!e)return null;try{return JSON.parse(decodeURIComponent(e))}catch{return null}},h=e=>{if("u"<typeof document)return;let t=encodeURIComponent(JSON.stringify(e));document.cookie=`${p}=${t}; max-age=86400; path=/; SameSite=Lax`},m=()=>{"u">typeof document&&(document.cookie=`${p}=; max-age=0; path=/`)};e.s(["useOnboardingTracking",0,()=>{let e=(0,d.usePostHog)(),t=c.CONFIG.IS_SANDBOX?"sandbox":"production",r=(0,i.useCallback)((r,a)=>{e?.capture(r,{...a,mode:t})},[e,t]),a=(0,i.useCallback)(e=>{let t=g();if(t)return t;let a=crypto.randomUUID(),s=new Date().toISOString();r("dashboard:onboarding:started",{onboarding_session_id:a,signup_method:e});let i={session_id:a,started_at:s,current_step:"org",steps_completed:0,signup_method:e};return h(i),i},[r]),s=(0,i.useCallback)((e,t)=>{let a=g();a&&a.current_step!==e&&(r(`dashboard:onboarding:step:${e}:started`,{onboarding_session_id:a.session_id,step:e,organization_id:t}),h({...a,current_step:e}))},[r]),o=(0,i.useCallback)((e,t)=>{let a=g();a&&(r(`dashboard:onboarding:step:${e}:completed`,{onboarding_session_id:a.session_id,step:e,organization_id:t}),h({...a,steps_completed:a.steps_completed+1}))},[r]),n=(0,i.useCallback)((e,t)=>{let a=g();a&&r(`dashboard:onboarding:step:${e}:skipped`,{onboarding_session_id:a.session_id,step:e,organization_id:t})},[r]),l=(0,i.useCallback)(e=>{let t=g();t&&(r("dashboard:onboarding:completed",{onboarding_session_id:t.session_id,organization_id:e}),m())},[r]),u=(0,i.useCallback)(()=>g(),[]),p=(0,i.useCallback)(()=>{m()},[]);return(0,i.useMemo)(()=>({startOnboarding:a,trackStepStarted:s,trackStepCompleted:o,trackStepSkipped:n,trackCompleted:l,getSession:u,clearSession:p}),[a,s,o,n,l,u,p])}],853183)},834602,e=>{"use strict";e.s(["getPublicServerURL",0,e=>(e=e||"",`https://api.polar.sh${e}`),"getServerURL",0,e=>(e=e||"",`https://api.polar.sh${e}`)])},743893,e=>{"use strict";var t=e.i(834602),r=e.i(942137);e.i(372957),e.s(["getAppleAuthorizeURL",0,()=>`${(0,t.getPublicServerURL)()}
2/v1/auth/apple/authorize`,"getBotDiscordAuthorizeURL",0,e=>{let r=new URLSearchParams;return e.return_to&&r.set("return_to",e.return_to),r.set("organization_id",e.organization_id),`${(0,t.getPublicServerURL)()}/v1/integrations/discord/bot/authorize?${r}`},"getGitHubAuthorizeLinkURL",0,e=>{let r=new URLSearchParams;return e&&r.set("return_to",e),`${(0,t.getPublicServerURL)()}/v1/auth/github/link/authorize?${r}`},"getGitHubAuthorizeLoginURL",0,()=>`${(0,t.getPublicServerURL)()}/v1/auth/github/authorize`,"getGitHubRepositoryBenefitAuthorizeURL",0,e=>{let r=new URLSearchParams;return e.return_to&&r.set("return_to",e.return_to),`${(0,t.getPublicServerURL)()}/v1/integrations/github_repository_benefit/user/authorize?${r}`},"getGoogleAuthorizeLinkURL",0,e=>{let r=new URLSearchParams;return e&&r.set("return_to",e),`${(0,t.getPublicServerURL)()}/v1/auth/google/link/authorize?${r}`},"getGoogleAuthorizeLoginURL",0,()=>`${(0,t.getPublicServerURL)()}/v1/auth/google/authorize`,"getSSOAuthorizeLoginURL",0,(e,r)=>`${(0,t.getPublicServerURL)()}/v1/auth/${e}/sso/${r}/authorize`,"getSSOCallbackURL",0,e=>`${(0,t.getPublicServerURL)()}/v1/auth/${e}/sso/callback`,"getSSOJwksURL",0,()=>`${(0,t.getPublicServerURL)()}/.well-known/jwks.json`,"getSSOLoginURL",0,e=>`${r.CONFIG.FRONTEND_BASE_URL}/auth/sso/${e}`])},614769,e=>{"use strict";var t=e.i(128387),r=e.i(739036),a=e.i(994083),s=e.i(513036);let i={onError:async()=>{(0,r.toast)({title:"A network error occurred",description:"Please try again later"})}},o={onResponse:async({response:e})=>{if(403!==e.status)return;let r=await e.clone().json().catch(()=>null);(0,a.isSessionNotFreshError)(r)&&(0,t.promptSessionRefresh)()}},n={"X-Polar-Client-Version":`web/${"85c0d2dcf3cb93e67704bb38d656a25ac2a36127".slice(0,8)??"dev"}`,"Polar-Version":s.API_VERSION},l=e=>{let t=(0,s.createClient)("https://api.polar.sh",e,n);return t.use(i),t.use(o),t},u=l();e.s(["api",0,u,"createClientSideAPI",0,l])},580509,e=>{"use strict";e.i(631597);var t=e.i(593529),r=e.i(480384);let a=(0,t.default)((0,r.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");e.s(["default",0,a])},316090,e=>{"use strict";e.i(631597);var t=e.i(593529),r=e.i(480384);let a=(0,t.default)((0,r.jsx)("path",{d:"M12.545,10.239v3.821h5.445c-0.712,2.315-2.647,3.972-5.445,3.972c-3.332,0-6.033-2.701-6.033-6.032s2.701-6.032,6.033-6.032c1.498,0,2.866,0.549,3.921,1.453l2.814-2.814C17.503,2.988,15.139,2,12.545,2C7.021,2,2.543,6.477,2.543,12s4.478,10,10.002,10c8.396,0,10.249-7.85,9.426-11.748L12.545,10.239z"}),"Google");e.s(["default",0,a])},349666,e=>{"use strict";var t=e.i(593529),r=e.i(480384);let a=(0,t.default)((0,r.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight");e.s(["default",0,a])},514075,(e,t,r)=>{"use strict";var a=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.view_transition"),f=Symbol.for("react.client.reference");function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case i:case n:case o:case d:case p:case m:return e;default:switch(e=e&&e.$$typeof){case u:case c:case h:case g:case l:return e;default:return t}}case s:return t}}}r.ContextConsumer=l,r.ContextProvider=u,r.Element=a,r.ForwardRef=c,r.Fragment=i,r.Lazy=h,r.Memo=g,r.Portal=s,r.Profiler=n,r.StrictMode=o,r.Suspense=d,r.SuspenseList=p,r.isContextConsumer=function(e){return x(e)===l},r.isContextProvider=function(e){return x(e)===u},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},r.isForwardRef=function(e){return x(e)===c},r.isFragment=function(e){return x(e)===i},r.isLazy=function(e){return x(e)===h},r.isMemo=function(e){return x(e)===g},r.isPortal=function(e){return x(e)===s},r.isProfiler=function(e){return x(e)===n},r.isStrictMode=function(e){return x(e)===o},r.isSuspense=function(e){return x(e)===d},r.isSuspenseList=function(e){return x(e)===p},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===n||e===o||e===d||e===p||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===g||e.$$typeof===u||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||void 0!==e.getModuleId)||!1},r.typeOf=x},13e3,(e,t,r)=>{"use strict";
2t.exports=e.r(514075)}]); 3 4//# debugId=5a76c6d6-e24d-1cd2-4304-647cdb465977
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.