PageSourceSearch

https://viddler.com/assets/signup-Bx067sw3.js

js viddler.com collected 2026-10-02 02:15:29 UTC 5,067 bytes, 3 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f726-7de4-77f0-9b8a-d54b4ab8f828")}catch(e){}}();import{d as A,b as O,e as U,h as _,r as m,k as $,j as e,o as B,q as p,B as H,L as K,f as Q,ab as V}from"./index-DCg2N-ax.js";import{S as D}from"./selected-plan-summary-DhCLU1Hl.js";import{u as G,F as J,a as S,b as C,c as P,d as k,e as F,t as M}from"./form-CA0J5IKE.js";import{I as N}from"./input-DF5Vgg2m.js";import{C as z,a as W,b as X,e as Y,c as Z,d as ee}from"./card-4KC-09AD.js";import{G as te}from"./google-sign-in-button-Bl3wtQXk.js";import{s as se,i as ae,E as oe,b as re}from"./safe-auth-redirect-CerVSZzR.js";import{p as ie}from"./onboarding-BOzETF2j.js";import{i as ne,c as ce}from"./plan-display-_vAA_tY5.js";import{E as le}from"./eye-DfqvcIGT.js";import{o as de,s as I}from"./types-BcSRQYL6.js";import"./label-CIYHSsxI.js";const ue=de({email:I().email({message:"Please enter a valid email address"}),password:I().min(8,"Password must be at least 8 characters")}),Pe=()=>{A();const[me,h]=O(),{toast:o}=U(),{logEvent:E}=_(),[f,x]=m.useState(!1),[r,L]=m.useState(!1),g=$(),i=new URLSearchParams(g),a=i.get("redirect"),y=se(a,"/upload"),R=ae(a),l=i.get("checkout")==="1",q=i.get("upgrade")==="1"&&y==="/pricing",d=i.get("claim"),n=d&&/^[0-9a-f-]{36}$/i.test(d)?d:void 0,u=ne(g);m.useLayoutEffect(()=>{if(u)try{ce()}catch{}},[u]);const c=G({resolver:M(ue),defaultValues:{email:"",password:""}}),T=async t=>{try{x(!0),await Q("POST","/api/auth/signup",{...t,checkoutIntentId:n,attribution:V()}),await j(!0)}catch(s){let v="Something went wrong. Please try again.";if(s instanceof Error){const w=s.message.indexOf("{");if(w!==-1)try{const b=JSON.parse(s.message.slice(w));b.message&&(v=b.message)}catch{}}o({title:"signup failed",description:v,variant:"destructive"})}finally{x(!1)}},j=async t=>{p.removeQueries({queryKey:["/api/videos"]}),await p.refetchQueries({queryKey:["/api/auth/me"]}),o({title:t?"account created":"welcome back",description:"welcome to viddler!"});const s=ie(t,a?y:null);t&&E("signup_completed",void 0,{destination:s,hadRedirect:!!a}),sessionStorage.removeItem("viddler_checkout_email"),h(s)};return e.jsx("div",{className:"max-w-md mx-auto px-4 sm:px-6 py-12 opus-home",style:B,children:e.jsxs(z,{children:[e.jsxs(W,{className:"space-y-1",children:[e.jsx(X,{className:"text-2xl font-bold",children:"create an account"}),e.jsx(Y,{children:l?"Use the same email address you entered at checkout to attach your plan.":q?"Create an account to continue to secure checkout.":R?"Create an account, then continue importing your saved video link.":a?"create an account, then choose and upload your video":"enter your information to create a viddler account"})]}),e.jsxs(Z,{children:[!u&&e.jsx(D,{}),e.jsx("div",{className:"mb-4",children:e.jsx(te,{context:"signup_with",checkoutIntentId:n,onSuccess:async(t,s)=>{if(l&&s){await p.refetchQueries({queryKey:["/api/auth/me"]}),o({title:"Plan not attached",description:"Use the same email address entered at checkout, or contact support.",variant:"destructive"}),h("/billing");return}await j(t)},onError:t=>o({title:"signup failed",description:t,variant:"destructive"})})}),e.jsx(J,{...c,children:e.jsxs("form",{onSubmit:c.handleSubmit(T),className:"space-y-4",children:[e.jsx(S,{control:c.control,name:"email",render:({field:t})=>e.jsxs(C,{children:[e.jsx(P,{children:"Email"}),e.jsx(k,{children:e.jsx(N,{type:"email",autoComplete:"email",placeholder:"[email protected]",...t})}),e.jsx(F,{})]})}),e.jsx(S,{control:c.control,name:"password",render:({field:t})=>e.jsxs(C,{children:[e.jsx(P,{children:"Password"}),e.jsx("p",{id:"password-help",className:"text-sm text-muted-foreground",children:"Use at least 8 characters."}),e.jsx(k,{children:e.jsxs("div",{className:"relative",children:[e.jsx(N,{type:r?"text":"password",autoComplete:"new-password",minLength:8,"aria-describedby":"password-help",placeholder:"••••••••",className:"pr-10",...t}),e.jsx("button",{type:"button",onClick:()=>L(s=>!s),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground","aria-label":r?"Hide password":"Show password","aria-pressed":r,children:r?e.jsx(oe,{className:"h-4 w-4"}):e.jsx(le,{className:"h-4 w-4"})})]})}),e.jsx(F,{})]})}),e.jsx(H,{type:"submit",className:"w-full",disabled:f,children:f?"creating account...":"sign up"})]})})]}),e.jsx(ee,{className:"flex flex-col space-y-4",children:e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["already have an account?"," ",e.jsx(K,{href:l?`/login?redirect=%2Fupload&checkout=1${n?`&claim=${encodeURIComponent(n)}`:""}`:re("/login",a),className:"text-primary underline underline-offset-4 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4",children:"log in"})]})})]})})};export{Pe as default};
2
3//# chunkId=01a0f726-7de4-77f0-9b8a-d54b4ab8f828

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.