PageSourceSearch

https://www.thanis.ai/_next/static/chunks/app/login/page-224f0993a…?dpl=dpl_8DWdSpGnmYcs5HBdnZ2UKaA9DsLC

js thanis.ai collected 2026-10-01 23:50:28 UTC 14,764 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{40021:(e,t,n)=>{"use strict";n.r(t),n.d(t,{EVENTS:()=>s,identifyUser:()=>m,resetAnalytics:()=>h,trackEvent:()=>d,trackScreen:()=>u});var a=n(8432);let s={APP_OPENED:"app_opened",SIGN_IN_STARTED:"sign_in_started",USER_SIGNED_IN:"user_signed_in",SIGN_IN_FAILED:"sign_in_failed",USER_SIGNED_OUT:"user_signed_out",ANALYSIS_STARTED:"analysis_started",ANALYSIS_COMPLETED:"analysis_completed",ANALYSIS_FAILED:"analysis_failed",DRAFT_SAVED:"draft_saved",HISTORY_VIEWED:"history_viewed",SAVED_DRAFT_OPENED:"saved_draft_opened",DRAFT_DELETED:"draft_deleted",REVISION_APPLIED:"revision_applied",CROSS_DEVICE_DRAFT_OPENED:"cross_device_draft_opened",APP_STORE_CLICKED:"app_store_clicked",GOOGLE_PLAY_CLICKED:"google_play_clicked",LANDING_PAGE_VIEWED:"landing_page_viewed",LANDING_SCROLL_DEPTH:"landing_scroll_depth",AUDIENCE_CARD_CLICKED:"audience_card_clicked",START_FREE_CLICKED:"start_free_clicked",PRICING_CLICKED:"pricing_clicked",SIGN_IN_CLICKED:"sign_in_clicked",INTERACTIVE_DEMO_ANALYZED:"interactive_demo_analyzed",PRESS_RELEASE_CLICKED:"press_release_clicked",PATENT_DOCUMENT_CLICKED:"patent_document_clicked",PATENT_EXTERNAL_DOCUMENT_CLICKED:"patent_external_document_clicked",LANDING_SECTION_REACHED:"landing_section_reached",EXECUTIVE_SAMPLE_PREVIEWED:"executive_sample_previewed",CHECKOUT_STARTED:"checkout_started",PURCHASE_COMPLETED:"purchase_completed"},r=new Set(["platform","plan","mode","auth_method","word_count","duration_ms","readiness_score","error_type","from_platform","to_platform","screen_name","store","section","scroll_depth","time_on_page_ms","device_type","utm_source","utm_medium","utm_campaign","utm_content","utm_term","referrer_host","hero_variant","returning_visitor","page","audience","cta_target","is_sample","destination","publication","press_category","promo"]),i=new Set(["platform","plan","auth_method"]);function l(){return!0===a.Ay.__loaded}function o(e,t){if(!e)return{};let n={};for(let[a,s]of Object.entries(e))t.has(a)&&null!=s&&(n[a]=s);return n}function c(e,t){try{e()}catch(e){"u">typeof console&&console.warn&&console.warn(`[analytics] ${t} failed silently`,e)}}function d(e,t){l()&&c(()=>{let n=o(t,r);a.Ay.capture(e,{platform:"web",...n})},`trackEvent(${e})`)}function u(e,t){l()&&c(()=>{let n=o(t,r);a.Ay.capture("$pageview",{platform:"web",screen_name:e,...n})},`trackScreen(${e})`)}function m(e,t){!l()||e&&c(()=>{let n=o(t,i);a.Ay.identify(e,{platform:"web",...n})},"identifyUser")}function h(){l()&&c(()=>{a.Ay.reset()},"resetAnalytics")}},57308:(e,t,n)=>{"use strict";n.d(t,{default:()=>h});var a=n(95155),s=n(19749),r=n(12115),i=n(79319),l=n(82222),o=n(40021);let c="/studio";function d(e){switch(e){case"OAuthAccountNotLinked":return"Thanis could not switch accounts safely. If another Thanis account is open, sign out before choosing a different Google account. Otherwise, use the sign-in method already linked to the intended account or contact support. No accounts were linked.";case"OAuthCallback":return"Provider sign-in could not finish. Return to sign-in and start a new attempt. If this continues, contact support.";case"OAuthSignin":return"Provider sign-in could not start. Please try again later or use your existing sign-in method.";case"Callback":return"Sign-in could not finish. Please use your existing sign-in method or contact support if this continues.";case null:return"";default:return"We could not complete sign-in. Please use your existing sign-in method or contact support."}}function u(e){let t,n,r,i=(0,s.c)(4),{show:l,onClick:o}=e;return l?(i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)("svg",{viewBox:"0 0 384 512",className:"w-4 h-4",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C64.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z"})}),n=(0,a.jsx)("span",{className:"text-sm",children:"Continue with Apple"}),i[0]=t,i[1]=n):(t=i[0],n=i[1]),i[2]!==o?(r=(0,a.jsxs)("button",{type:"button",onClick:o,"data-testid":"apple-signin-button","aria-label":"Continue with Apple",className:"w-full bg-black text-white font-medium py-3 rounded-full flex items-center justify-center gap-3 hover:bg-neutral-800 transition shadow-sm",children:[t,n]}),i[2]=o,i[3]=r):r=i[3],r):null}function m({appleEnabled:e}){let t=(0,l.useSearchParams)(),n=t.get("plan"),s=function(e){var t;if(!e||!e.startsWith("/")||(t=e).startsWith("//")||t.includes("\\")||/[\u0000-\u001f\u007f]/.test(t))return c;try{let t=new URL(e,"https://thanis.invalid");if("https://thanis.invalid"!==t.origin)return c;return`${t.pathname}${t.search}${t.hash}`}catch{return c}}(t.get("callbackUrl")),h=t.get("error"),x="student"===n,p="OTP_ACCOUNT_RECOVERY_REQUIRED"===t.get("error"),[_,f]=(0,r.useState)(""),g=(0,r.useMemo)(()=>_.trim().toLowerCase(),[_]),[E,b]=(0,r.useState)(""),[N,y]=(0,r.useState)("email"),[v,S]=(0,r.useState)(!1),[w,A]=(0,r.useState)(()=>d(h));(0,r.useEffect)(()=>{A(d(h))},[h]);let[j,I]=(0,r.useState)(""),[C,k]=(0,r.useState)(!1),D=()=>{(0,o.trackEvent)(o.EVENTS.SIGN_IN_STARTED,{auth_method:"google"}),(0,i.signIn)("google",{callbackUrl:s})},T=()=>{(0,o.trackEvent)(o.EVENTS.SIGN_IN_STARTED,{auth_method:"apple"}),(0,i.signIn)("apple",{callbackUrl:s})};async function P(){if(A(""),I(""),!g)return void A("Please enter your email address.");S(!0);try{(0,o.trackEvent)(o.EVENTS.SIGN_IN_STARTED,{auth_method:"otp"});let e=await fetch("/api/otp/request",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({email:g})}),t=await e.json().catch(()=>({}));if(!e.ok||!t.ok)throw Error(t.error||"Unable to send code. Please try again.");y("code"),I("Code sent. Check your email and enter it below.")}catch(e){(0,o.trackEvent)(o.EVENTS.SIGN_IN_FAILED,{auth_method:"otp",error_type:"otp_request_failed"}),A(e?.message||"Unable to send code. Please try again.")}finally{S(!1)}}let L=async e=>{e.preventDefault(),await P()},R=async e=>{if(e.preventDefault(),A(""),I(""),!g)return void A("Missing email.");if(!E.trim())return void A("Please enter the code.");S(!0);try{await (0,i.signIn)("otp",{email:g,code:E.trim(),callbackUrl:s,redirect:!0}),S(!1),(0,o.trackEvent)(o.EVENTS.SIGN_IN_FAILED,{auth_method:"otp",error_type:"otp_no_redirect"}),A("Sign-in did not complete. Try again.")}catch(e){console.error(e),S(!1),(0,o.trackEvent)(o.EVENTS.SIGN_IN_FAILED,{auth_method:"otp",error_type:"otp_verify_failed"}),A("Sign-in could not complete. Please try again later.")}},F=async e=>{if(e.preventDefault(),A(""),!g)return void A("Please enter your email address.");S(!0),(0,o.trackEvent)(o.EVENTS.SIGN_IN_STARTED,{auth_method:"email_magic_link"});let t=await (0,i.signIn)("email",{email:g,redirect:!1,callbackUrl:s});S(!1),t?.error?(console.error("Login Error:",t.error),(0,o.trackEvent)(o.EVENTS.SIGN_IN_FAILED,{auth_method:"email_magic_link",error_type:"magic_link_failed"}),A("Unable to sign in. Please try again.")):k(!0)};return(0,a.jsx)("div",{className:"min-h-screen bg-[#F2F6F5] flex items-center justify-center p-4 font-sans",children:(0,a.jsxs)("div",{className:"w-full max-w-[420px] bg-white rounded-xl border border-gray-200 shadow-sm p-10 flex flex-col items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center mb-8",children:[(0,a.jsx)("img",{src:"/thanis_logo.svg",alt:"Thanis",className:"h-10 w-auto mb-4"}),(0,a.jsx)("h1",{className:"text-xl font-bold text-[#1F3A33] font-mono",children:x?"Email code sign in":"Sign in"}),x&&(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-2 text-center",children:"This path uses a one-time numeric code instead of an email link. Available modes come from your verified plan."})]}),p&&(0,a.jsx)("p",{role:"alert",className:"w-full mb-6 rounded-lg border border-amber-200 bg-amber-50 p-4 text-sm text-amber-900",children:"Sign-in could not complete. Use your established sign-in method or contact support."}),x?(0,a.jsxs)("div",{className:"w-full flex flex-col gap-5 animate-fade-in",children:[(0,a.jsxs)("button",{onClick:D,className:"w-full bg-[#1F3A33] text-white font-medium py-3 rounded-full flex items-center justify-center gap-3 hover:bg-emerald-800 transition shadow-sm",children:[(0,a.jsx)("img",{src:"https://www.svgrepo.com/show/475656/google-color.svg",alt:"G",className:"w-4 h-4"}),(0,a.jsx)("span",{className:"text-sm",children:"Sign in with Google"})]}),(0,a.jsx)(u,{show:e,onClick:T}),(0,a.jsxs)("div",{className:"relative my-2",children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,a.jsx)("div",{className:"w-full border-t border-gray-200"})}),(0,a.jsx)("div",{className:"relative flex justify-center text-xs uppercase",children:(0,a.jsx)("span",{className:"bg-white px-2 text-gray-400",children:"or sign in with code"})})]}),"email"===N?(0,a.jsxs)("form",{onSubmit:L,className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{type:"email",placeholder:"[email protected]",value:_,onCh
1ange:e=>f(e.target.value),className:"w-full px-4 py-3 rounded-full border border-gray-300 text-sm outline-none focus:border-[#1F3A33] focus:ring-1 focus:ring-[#1F3A33] transition"}),w&&(0,a.jsx)("span",{role:"alert",className:"text-red-500 text-xs font-bold px-2 mt-1 block",children:w})]}),(0,a.jsx)("button",{type:"submit",disabled:v,className:"w-full bg-white border border-[#1F3A33] text-[#1F3A33] font-bold py-3 rounded-full hover:bg-gray-50 transition text-sm disabled:opacity-50",children:v?"Sending Code...":"Send Sign-In Code"}),(0,a.jsx)("div",{className:"text-center mt-2",children:(0,a.jsx)("a",{href:"/#plans",className:"text-xs text-[#1F3A33] font-bold hover:underline",children:"Back to plans"})})]}):(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col gap-4",children:[j&&(0,a.jsx)("div",{className:"bg-emerald-50 p-4 rounded-lg border border-emerald-100",children:(0,a.jsx)("p",{className:"text-xs text-emerald-800 font-medium",children:j})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{type:"text",inputMode:"numeric",placeholder:"6-digit code",value:E,onChange:e=>b(e.target.value),className:"w-full px-4 py-3 rounded-full border border-gray-300 text-sm outline-none focus:border-[#1F3A33] focus:ring-1 focus:ring-[#1F3A33] transition"}),w&&(0,a.jsx)("span",{role:"alert",className:"text-red-500 text-xs font-bold px-2 mt-1 block",children:w})]}),(0,a.jsx)("button",{type:"submit",disabled:v,className:"w-full bg-[#1F3A33] text-white font-bold py-3 rounded-full hover:bg-emerald-800 transition text-sm disabled:opacity-50",children:v?"Verifying...":"Verify & Sign In"}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs mt-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{y("email"),b(""),A(""),I("")},className:"text-gray-500 hover:text-[#1F3A33] underline",children:"Use a different email"}),(0,a.jsx)("button",{type:"button",disabled:v,onClick:P,className:"text-gray-500 hover:text-[#1F3A33] underline disabled:opacity-50",children:"Resend code"})]})]})]}):(0,a.jsx)(a.Fragment,{children:C?(0,a.jsxs)("div",{className:"w-full flex flex-col gap-6 animate-fade-in text-center",children:[(0,a.jsx)("div",{className:"text-5xl",children:"\uD83D\uDCE9"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-[#1F3A33] mb-2",children:"Check your inbox"}),(0,a.jsxs)("p",{className:"text-sm text-gray-600 leading-relaxed",children:["We sent a secure sign-in link to",(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"font-bold text-[#1F3A33]",children:g})]})]}),(0,a.jsx)("div",{className:"bg-emerald-50 p-4 rounded-lg border border-emerald-100",children:(0,a.jsx)("p",{className:"text-xs text-emerald-800 font-medium",children:"Click the link in the email to automatically sign in."})}),(0,a.jsx)("button",{onClick:()=>window.location.reload(),className:"text-xs text-gray-400 hover:text-[#1F3A33] underline mt-4",children:"Use a different email"})]}):(0,a.jsxs)("div",{className:"w-full flex flex-col gap-5 animate-fade-in",children:[(0,a.jsxs)("button",{onClick:D,className:"w-full bg-[#1F3A33] text-white font-medium py-3 rounded-full flex items-center justify-center gap-3 hover:bg-emerald-800 transition shadow-sm",children:[(0,a.jsx)("img",{src:"https://www.svgrepo.com/show/475656/google-color.svg",alt:"G",className:"w-4 h-4"}),(0,a.jsx)("span",{className:"text-sm",children:"Sign in with Google"})]}),(0,a.jsx)(u,{show:e,onClick:T}),(0,a.jsxs)("div",{className:"relative my-2",children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,a.jsx)("div",{className:"w-full border-t border-gray-200"})}),(0,a.jsx)("div",{className:"relative flex justify-center text-xs uppercase",children:(0,a.jsx)("span",{className:"bg-white px-2 text-gray-400",children:"or sign in with email"})})]}),(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{type:"email",placeholder:"[email protected]",value:_,onChange:e=>f(e.target.value),className:"w-full px-4 py-3 rounded-full border border-gray-300 text-sm outline-none focus:border-[#1F3A33] focus:ring-1 focus:ring-[#1F3A33] transition"}),w&&(0,a.jsx)("span",{role:"alert",className:"text-red-500 text-xs font-bold px-2 mt-1 block",children:w})]}),(0,a.jsx)("button",{type:"submit",disabled:v,className:"w-full bg-white border border-[#1F3A33] text-[#1F3A33] font-bold py-3 rounded-full hover:bg-gray-50 transition text-sm disabled:opacity-50",children:v?"Sending Link...":"Sign in with Email"})]}),(0,a.jsxs)("div",{className:"text-center mt-4",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"Don't have an account? "}),(0,a.jsx)("a",{href:"/#plans",className:"text-xs text-[#1F3A33] font-bold hover:underline",children:"Sign up"})]})]})})]})})}function h(e){let t,n,i=(0,s.c)(3),{appleEnabled:l}=e,o=void 0!==l&&l;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,a.jsx)("div",{children:"Loading..."}),i[0]=t):t=i[0],i[1]!==o?(n=(0,a.jsx)(r.Suspense,{fallback:t,children:(0,a.jsx)(m,{appleEnabled:o})}),i[1]=o,i[2]=n):n=i[2],n}},60490:(e,t,n)=>{Promise.resolve().then(n.bind(n,57308))},82222:(e,t,n)=>{"use strict";var a=n(55042);n.o(a,"usePathname")&&n.d(t,{usePathname:function(){return a.usePathname}}),n.o(a,"useRouter")&&n.d(t,{useRouter:function(){return a.useRouter}}),n.o(a,"useSearchParams")&&n.d(t,{useSearchParams:function(){return a.useSearchParams}})}},e=>{e.O(0,[8229,9375,8441,9826,7358],()=>e(e.s=60490)),_N_E=e.O()}]);

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.