1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74520],{5360:(e,t,n)=>{"use strict";n.d(t,{Y:()=>a});let r="https://same-origin.invalid";function a(e){if(!e||!e.startsWith("/")||e.startsWith("//")||e.includes("\\")||/[\s\u0000-\u001f\u007f]/.test(e))return null;try{let t=new URL(e,r);if(t.origin!==r)return null;return"".concat(t.pathname).concat(t.search).concat(t.hash)}catch(e){return null}}},31966:(e,t,n)=>{Promise.resolve().then(n.bind(n,70017))},45698:(e,t,n)=>{"use strict";n.d(t,{aT:()=>o,g2:()=>i,qi:()=>s,r7:()=>l});var r=n(37555);let a=(0,n(34773).h)("lib/supabase/env");function i(){let e=(0,r.yt)(),t=(0,r.nq)(),n=(0,r.Nl)(e)||(0,r.Nl)(t);return a.debug("checked placeholder supabase config",{event:"supabase.env.placeholderCheck",phase:"state",branch:n?"placeholder":"real",route:"env"}),n}function o(){let e=(0,r.yt)(),t=(0,r.nq)();return{nodeEnv:"production",vercelUrlPresent:!!"btw-oydhzkw8u-samcraftscode02s-projects.vercel.app".trim(),urlPresent:!!e,urlLooksSupabase:e.includes(".supabase.co"),urlIsPlaceholder:(0,r.Nl)(e),keyPresent:!!t,keyIsPlaceholder:(0,r.Nl)(t),keyFormat:t.startsWith("eyJ")?"jwt":t.startsWith("sb_")?"publishable":"unknown_or_empty"}}function l(){return"Supabase configuration is missing or invalid. Local: set .env.local with NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY, then restart the dev server. Vercel: set the same variables in Project Settings -> Environment Variables and redeploy."}function s(e){let t=e.trim();return"Failed to fetch"===t||"NetworkError when attempting to fetch resource."===t||/load failed|networkerror|fetch/i.test(t)?"No connection to Supabase. First check internet/VPN/firewall/adblock and whether NEXT_PUBLIC_SUPABASE_URL + NEXT_PUBLIC_SUPABASE_ANON_KEY (or NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY) are set. Locally in apps/web/.env.local; on Vercel in Project Settings -> Environment Variables.":e}},70017:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>O});var r=n(95155),a=n(12115),i=n(52619),o=n.n(i),l=n(70532),s=n(57828),u=n(35299),c=n(45698),d=n(34773),p=n(3998),h=n(65142),m=n(18332),f=n(98886),g=n(92698),v=n(70562),b=n(96648),x=n(21529),w=n(46539),y=n(44980),S=n(18645),j=n(74130),N=n(92482),E=n(5150),P=n(91440),k=n(5360),C=n(27118),_=n(95704);let T=(0,d.h)("login-page"),A="h-12 rounded-[var(--brand-control-radius)] bg-input px-3.5 text-base text-[var(--brand-ink)] shadow-none hover:border-[var(--brand-ink)]/65 focus-visible:border-[var(--brand-focus-light)] focus-visible:ring-[var(--brand-focus-light)]",I="h-12 w-full rounded-[var(--brand-control-radius)] bg-[var(--brand-ink)] text-[var(--brand-paper)] shadow-none hover:translate-y-0 hover:shadow-none focus-visible:ring-[var(--brand-focus-light)]",L="rounded-sm text-[var(--brand-ink)] underline-offset-4 transition-colors hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--brand-focus-light)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--brand-paper)]",R="string"==typeof _.env.NEXT_PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY?_.env.NEXT_PUBLIC_CLOUDFLARE_TURNSTILE_SITE_KEY.trim():"";function M(){var e;let t=new URLSearchParams(window.location.search);return null!=(e=(0,k.Y)(t.get("redirect")))?e:"/dashboard"}function O(){let e=(0,a.useMemo)(()=>(0,d.r_)(),[]),[t,n]=(0,a.useState)(""),[i,k]=(0,a.useState)(""),[_,O]=(0,a.useState)(null),[F,U]=(0,a.useState)(!1),[B,D]=(0,a.useState)(null),[W,q]=(0,a.useState)(!1),[V,H]=(0,a.useState)("password"),[$,z]=(0,a.useState)(""),[K,X]=(0,a.useState)(null),[Y,G]=(0,a.useState)(null),[Q,J]=(0,a.useState)(!1),[Z,ee]=(0,a.useState)(null),[et,en]=(0,a.useState)(!1),[er,ea]=(0,a.useState)(!1);async function ei(n){n.preventDefault(),O(null),U(!0),T.debug("login submit started",{event:"auth.login.submit",phase:"start",requestId:e,route:"/login"});try{var r,a;let n=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,...Z?{turnstileToken:Z}:{}}),credentials:"include"}),o=await n.json().catch(t=>(T.warn("login response JSON parse failed",{event:"auth.login.submit",phase:"branch",branch:"jsonParseError",requestId:e,route:"/login",error:(0,d.P5)(t),status:n.status}),{}));if(U(!1),!n.ok){T.warn("login request not ok",{event:"auth.login.submit",phase:"branch",branch:"responseNotOk",requestId:e,route:"/login",status:n.status,error:"string"==typeof o.error?o.error:"unknown"});let r="string"==typeof o.error?o.error:"Login failed.",a="object"==typeof o&&null!==o&&"code"in o&&"string"==typeof o.code?o.code:void 0;if(403===n.status&&"CAPTCHA_REQUIRED"===a){J(!0),ee(null),O(R?"Please complete the verification below, then sign in again.":"Additional verification is needed, but it isn't set up correctly on our side. Please try again later or contact support.");return}if(400===n.status&&"CAPTCHA_INVALID"===a){O("Verification failed. Please try the check again."),ee(null);return}if(401===n.status){if((0,w.Fg)("authentication_failed",{failure_code:"auth",provider:"email"}),"EMAIL_NOT_CONFIRMED"===a)return void(0,v.b)("/auth/check-email?error=confirmation&email="+encodeURIComponent(t));O(r);return}if(n.status>=500)return void O("System error during login. Please try again later.");O((0,c.qi)(r));return}T.info("login request ok",{event:"auth.login.submit",phase:"success",requestId:e,route:"/login"}
1),(null==(r=o.user)?void 0:r.id)&&(0,w.ls)(o.user.id,{is_internal:(0,x.Pu)(o.user)}),(0,w.Fg)(y.R.loginCompleted),J(!1),ee(null);let l=(0,b.createClient)(),{data:s,error:u}=await l.auth.mfa.getAuthenticatorAssuranceLevel();if(u){T.warn("mfa aal check failed",{error:(0,d.P5)(u)}),(0,v.b)(M());return}if((null==s?void 0:s.currentLevel)!=="aal1"||(null==s?void 0:s.nextLevel)!=="aal2"){T.info("navigating to dashboard after login",{event:"auth.login.navigation",phase:"success",requestId:e,route:"/login"}),(0,v.b)(M());return}let{data:p,error:h}=await l.auth.mfa.listFactors();if(h)return void O("Could not load MFA status.");let m=null==p||null==(a=p.totp)?void 0:a.find(e=>"verified"===e.status);if(!m)return void(0,v.b)(M());let{data:f,error:g}=await l.auth.mfa.challenge({factorId:m.id});if(g||!f)return void O("Two-factor challenge failed.");X(m.id),G(f.id),H("mfa"),z("")}catch(n){U(!1);let t=n instanceof Error?n.message:"Unknown error";T.error("login submit exception",{event:"auth.login.submit",phase:"error",requestId:e,route:"/login",error:(0,d.P5)(n)}),O((0,c.qi)(t));return}}async function eo(t){if(t.preventDefault(),K&&Y){O(null),U(!0);try{let t=(0,b.createClient)(),{error:n}=await t.auth.mfa.verify({factorId:K,challengeId:Y,code:$.replace(/\s/g,"")});if(n){let{data:e}=await t.auth.mfa.challenge({factorId:K});e&&G(e.id),O("Code is invalid or expired. Please try again.");return}T.info("mfa verified, navigating to dashboard",{event:"auth.login.mfa",phase:"success",requestId:e,route:"/login"}),(0,v.b)(M())}catch(t){let e=t instanceof Error?t.message:"Unknown error";O((0,c.qi)(e))}finally{U(!1)}}}return(0,a.useEffect)(()=>{en(!0);let t=(0,c.g2)();T.info("mounted",{event:"auth.login.page",phase:"start",requestId:e,route:"/login",host:window.location.host,pathname:window.location.pathname,placeholderVisible:t,supabaseSnapshot:(0,c.aT)()});let r=new URLSearchParams(window.location.search),a=(0,P.C)(r.get("email"));if(a&&n(a),"1"===r.get("confirmed")){T.info("email confirmation hint shown",{event:"auth.login.page",phase:"branch",branch:"confirmedQueryParam",requestId:e,route:"/login"});let t=(0,P.C)(r.get("email"));D(t?"Please confirm ".concat(t," via the link in your email. After that you can sign in here."):"Please confirm your email using the link we sent you. After that you can sign in.")}let i=r.get("error");q("link"===i),"auth"===i&&(T.info("auth error query shown",{event:"auth.login.page",phase:"branch",branch:"errorQueryParam",requestId:e,route:"/login"}),O("This sign-in link could not be used. Request a new confirmation email or sign in with your existing account.")),"recovery"===i&&O("The password reset link is invalid or expired. Please use Forgot password again."),"oauth"===i&&(T.info("oauth error query shown",{event:"auth.login.page",phase:"branch",branch:"oauthErrorQueryParam",requestId:e,route:"/login"}),O("Google sign-in was cancelled or didn't complete. Please try again."))},[e]),(0,r.jsx)(S.AuthPageLayout,{children:(0,r.jsxs)("div",{className:"space-y-8 font-sans text-[var(--brand-ink)]",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-3xl leading-[1.12] font-medium tracking-[-0.035em] sm:text-[34px]",children:W?"This access link is unavailable":"Sign in"}),(0,r.jsx)("p",{className:"text-muted-foreground mt-3 text-[15px] leading-relaxed",children:W?"You can explore Behind The Workflow without signing in, or start your own workspace.":"Enter your credentials to continue."})]}),W?(0,r.jsxs)("div",{className:"border-border bg-muted/30 space-y-4 rounded-[var(--brand-control-radius)] border p-5",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)(p.$,{asChild:!0,size:"lg",className:I,children:(0,r.jsx)(o(),{href:"/how-it-works",children:"See how it works"})}),(0,r.jsx)(p.$,{asChild:!0,variant:"outline",size:"lg",className:"h-12 w-full rounded-[var(--brand-control-radius)]",children:(0,r.jsx)(o(),{href:"/signup",children:"Start your own workspace"})})]}),(0,r.jsx)("p",{className:"text-muted-foreground text-sm leading-relaxed",children:"For access to the prepared example, reply to the person who sent you the link. Already have an account? Sign in below."})]}):null,(0,c.g2)()?(0,r.jsx)(m.Fc,{children:(0,r.jsxs)(m.TN,{className:"text-muted-foreground text-sm",children:[(0,r.jsx)("strong",{children:"Configuration missing:"})," ",(0,c.r7)()]})}):null,"password"===V?(0,r.jsxs)("div",{className:"space-y-5",children:[(0,r.jsx)(j.m,{onError:O,onSuccess:e=>{let{firstLogin:t}=e;return(0,v.b)(t&&"/dashboard"===M()?"/dashboard?google_workspace_setup=1":M())}}),(0,r.jsx)(N.N,{}),(0,r.jsxs)("form",{method:"post",action:"/api/auth/login",onSubmit:ei,className:"space-y-5",children:[(0,r.jsxs)(f.D0,{id:"email",required:!0,children:[(0,r.jsx)(f.dh,{className:"text-sm font-medium text-[var(--brand-ink)]",children:"Email"}
1),(0,r.jsx)(h.p,{disabled:!et,id:"email","aria-label":"Email",name:"email",type:"email",autoComplete:"username",value:t,onChange:e=>{n(e.target.value),J(!1),ee(null)},required:!0,"aria-invalid":!!_||void 0,className:A})]}),(0,r.jsxs)(f.D0,{id:"password",required:!0,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,r.jsx)(f.dh,{className:"text-sm font-medium text-[var(--brand-ink)]",children:"Password"}),(0,r.jsx)(o(),{href:"/forgot-password",className:"".concat(L," text-[13px]"),children:"Forgot password?"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(h.p,{disabled:!et,id:"password","aria-label":"Password",name:"password",type:er?"text":"password",autoComplete:"current-password",value:i,onChange:e=>{k(e.target.value),J(!1),ee(null)},required:!0,"aria-invalid":!!_||void 0,className:"".concat(A," pr-12")}),(0,r.jsx)("button",{type:"button",onClick:()=>ea(e=>!e),"aria-pressed":er,"aria-label":er?"Hide password":"Show password",className:"text-muted-foreground absolute top-1/2 right-0.5 flex size-11 -translate-y-1/2 items-center justify-center rounded-[var(--brand-control-radius)] transition-colors hover:text-[var(--brand-ink)] focus-visible:ring-2 focus-visible:ring-[var(--brand-focus-light)] focus-visible:outline-none",children:er?(0,r.jsx)(l.A,{className:"h-4 w-4"}):(0,r.jsx)(s.A,{className:"h-4 w-4"})})]})]}),B?(0,r.jsx)(m.Fc,{className:"border-border bg-muted/30",children:(0,r.jsx)(m.TN,{className:"text-sm text-[var(--brand-ink)]",role:"status",children:B})}):null,_?(0,r.jsx)(m.Fc,{variant:"destructive",children:(0,r.jsx)(m.TN,{role:"alert",children:_})}):null,Q&&R?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,r.jsx)(C.Xs,{siteKey:R,onSuccess:e=>ee(e)}),(0,r.jsx)("p",{className:"text-muted-foreground text-center text-xs",children:"After verifying, press Sign in again."})]}):null,(0,r.jsx)(p.$,{type:"submit",size:"lg",className:I,disabled:F||!et||Q&&!!R&&!Z,children:F?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.A,{className:"mr-1.5 inline h-4 w-4 animate-spin"}),"Signing in"]}):"Sign in"}),(0,r.jsxs)("p",{className:"text-muted-foreground pt-2 text-center text-sm",children:["Don't have an account?"," ",(0,r.jsx)(o(),{href:"/signup",className:"".concat(L," font-medium"),children:"Create one"})]}),(0,r.jsx)("p",{className:"text-center",children:(0,r.jsx)(E.g,{})})]})]}):(0,r.jsxs)("form",{method:"post",onSubmit:eo,className:"space-y-5",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"Two-factor authentication"}),(0,r.jsx)("p",{className:"text-muted-foreground mt-1 text-sm",children:"Enter the 6-digit code from your authenticator app."})]}),(0,r.jsxs)(f.D0,{id:"mfa",required:!0,invalid:!!_,children:[(0,r.jsx)(f.dh,{className:"text-sm font-medium",children:"One-time code"}),(0,r.jsx)(g.UV,{id:"mfa",maxLength:6,inputMode:"numeric",autoComplete:"one-time-code","aria-invalid":!!_||void 0,value:$,onChange:z,containerClassName:"justify-center",children:(0,r.jsx)(g.NV,{children:[0,1,2,3,4,5].map(e=>(0,r.jsx)(g.sF,{index:e,invalid:!!_},e))})})]}),_?(0,r.jsx)(m.Fc,{variant:"destructive",children:(0,r.jsx)(m.TN,{role:"alert",children:_})}):null,(0,r.jsx)(p.$,{type:"submit",size:"lg",className:I,loading:F,loadingText:"Verifying",disabled:$.length<6,children:"Verify"}),(0,r.jsx)(p.$,{type:"button",variant:"ghost",className:"w-full",onClick:()=>{H("password"),z(""),X(null),G(null),O(null)},children:"Back to login"}),(0,r.jsx)("p",{className:"text-center",children:(0,r.jsx)(E.g,{})})]})]})})}},71753:(e,t,n)=>{"use strict";n.d(t,{dK:()=>d,wE:()=>p});var r=n(12115),a=Object.defineProperty,i=Object.defineProperties,o=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d=r.createContext({}),p=r.forwardRef((e,t)=>{var n,a,p,f,g,{value:v,onChange:b,maxLength:x,textAlign:w="left",pattern:y,placeholder:S,inputMode:j="numeric",onComplete:N,pushPasswordManagerStrategy:E="increase-width",pasteTransformer:P,containerClassName:k,noScriptCSSFallback:C=m,render:_,children:T}=e,A=((e,t)=>{var n={};for(var r in e)s.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&l)for(var r of l(e))0>t.indexOf(r)&&u.call(e,r)&&(n[r]=e[r]);return n})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[I,L]=r.useState("string"==typeof A.defaultValue?A.defaultValue:""),R=null!=v?v:I,M=function(e){let t=r.useRef();return r.useEffect(()=>{t.current=e}),t.current}(R),O=r.useCallback(e=>{null==b||b(e),L(e)},[b]),F=r.useMemo(()=>y?"string"==typeof y?new RegExp(y):y:null,[y]),U=r.useRef(null),B=r.useRef(null),D=r.useRef({value:R,onChange:O,isIOS:"undefined"!=typeof window&&(null==(a=null==(n=null==window?void 0:window.CSS)?void 0:n.supports)?void 0:a.call(n,"-webkit-touch-callout","none"))}),W=r.useRef({prev:[null==(p=U.current)?void 0:p.selectionStart,null==(f=U.current)?void 0:f.selectionEnd,null==(g=U.current)?void 0:g.selectionDirection]});r.useImperativeHandle(t,()=>U.current,[]),r.useEffect(()=>{let e=U.current,t=B.current;if(!e||!t)return;function n(){if(document.activeElement!==e){K(null),Y(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,a=e.maxLength,i=e.value,o=W.current.prev,l=-1,s=-1,u;if(0!==i.length&&null!==t&&null!==n){let e=t===n,r=t===i.length&&i.length<a;if(e&&!r){if(0===t)l=0,s=1,u="forward";else if(t===a)l=t-1,s=t,u="backward";else if(a>1&&i.length>1){let e=0;if(null!==o[0]&&null!==o[1]){u=t<o[1]?"backward":"forward";let n=o[0]===o[1]&&o[0]<a;"backward"!==u||n||(e=-1)}l=e+t,s=e+t+1}}-1!==l&&-1!==s&&l!==s&&U.current.setSelectionRange(l,s,u)}let c=-1!==l?l:t,d=-1!==s?s:n,p=null!=u?u:r;K(c),Y(d),W.current.prev=[c,d,p]}if(D.current.value!==e.value&&D.current.onChange(e.value),W.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",n,{
vendor: 4,698 bytes, line 1
1capture:!0}),n(),document.activeElement===e&&$(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";h(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),h(e.sheet,`[data-input-otp]:autofill { ${t} }`),h(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),h(e.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),h(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let r=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};r();let a=new ResizeObserver(r);return a.observe(e),()=>{document.removeEventListener("selectionchange",n,{capture:!0}),a.disconnect()}},[]);let[q,V]=r.useState(!1),[H,$]=r.useState(!1),[z,K]=r.useState(null),[X,Y]=r.useState(null);r.useEffect(()=>{!function(e){setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)}(()=>{var e,t,n,r;null==(e=U.current)||e.dispatchEvent(new Event("input"));let a=null==(t=U.current)?void 0:t.selectionStart,i=null==(n=U.current)?void 0:n.selectionEnd,o=null==(r=U.current)?void 0:r.selectionDirection;null!==a&&null!==i&&(K(a),Y(i),W.current.prev=[a,i,o])})},[R,H]),r.useEffect(()=>{void 0!==M&&R!==M&&M.length<x&&R.length===x&&(null==N||N(R))},[x,N,M,R]);let G=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:a}){let[i,o]=r.useState(!1),[l,s]=r.useState(!1),[u,c]=r.useState(!1),d=r.useMemo(()=>"none"!==n&&("increase-width"===n||"experimental-no-flickering"===n)&&i&&l,[i,l,n]),p=r.useCallback(()=>{let r=e.current,a=t.current;if(!r||!a||u||"none"===n)return;let i=r.getBoundingClientRect().left+r.offsetWidth,l=r.getBoundingClientRect().top+r.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(i-18,l)===r||(o(!0),c(!0))},[e,t,u,n]);return r.useEffect(()=>{let t=e.current;if(!t||"none"===n)return;function r(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}r();let a=setInterval(r,1e3);return()=>{clearInterval(a)}},[e,n]),r.useEffect(()=>{let e=a||document.activeElement===t.current;if("none"===n||!e)return;let r=setTimeout(p,0),i=setTimeout(p,2e3),o=setTimeout(p,5e3),l=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(r),clearTimeout(i),clearTimeout(o),clearTimeout(l)}},[t,a,n,p]),{hasPWMBadge:i,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:B,inputRef:U,pushPasswordManagerStrategy:E,isFocused:H}),Q=r.useCallback(e=>{let t=e.currentTarget.value.slice(0,x);if(t.length>0&&F&&!F.test(t))return void e.preventDefault();"string"==typeof M&&t.length<M.length&&document.dispatchEvent(new Event("selectionchange")),O(t)},[x,O,M,F]),J=r.useCallback(()=>{var e;if(U.current){let t=Math.min(U.current.value.length,x-1),n=U.current.value.length;null==(e=U.current)||e.setSelectionRange(t,n),K(t),Y(n)}$(!0)},[x]),Z=r.useCallback(e=>{var t,n;let r=U.current;if(!P&&(!D.current.isIOS||!e.clipboardData||!r))return;let a=e.clipboardData.getData("text/plain"),i=P?P(a):a;e.preventDefault();let o=null==(t=U.current)?void 0:t.selectionStart,l=null==(n=U.current)?void 0:n.selectionEnd,s=(o!==l?R.slice(0,o)+i+R.slice(l):R.slice(0,o)+i+R.slice(o)).slice(0,x);if(s.length>0&&F&&!F.test(s))return;r.value=s,O(s);let u=Math.min(s.length,x-1),c=s.length;r.setSelectionRange(u,c),K(u),Y(c)},[x,O,F,R]),ee=r.useMemo(()=>({position:"relative",cursor:A.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[A.disabled]),et=r.useMemo(()=>({position:"absolute",inset:0,width:G.willPushPWMBadge?`calc(100% + ${G.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:G.willPushPWMBadge?`inset(0 ${G.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:w,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[G.PWM_BADGE_SPACE_WIDTH,G.willPushPWMBadge,w]),en=r.useMemo(()=>r.createElement("input",i(((e,t)=>{for(var n in t||(t={}
1))s.call(t,n)&&c(e,n,t[n]);if(l)for(var n of l(t))u.call(t,n)&&c(e,n,t[n]);return e})({autoComplete:A.autoComplete||"one-time-code"},A),o({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===R.length||void 0,"data-input-otp-mss":z,"data-input-otp-mse":X,inputMode:j,pattern:null==F?void 0:F.source,"aria-placeholder":S,style:et,maxLength:x,value:R,ref:U,onPaste:e=>{var t;Z(e),null==(t=A.onPaste)||t.call(A,e)},onChange:Q,onMouseOver:e=>{var t;V(!0),null==(t=A.onMouseOver)||t.call(A,e)},onMouseLeave:e=>{var t;V(!1),null==(t=A.onMouseLeave)||t.call(A,e)},onFocus:e=>{var t;J(),null==(t=A.onFocus)||t.call(A,e)},onBlur:e=>{var t;$(!1),null==(t=A.onBlur)||t.call(A,e)}}))),[Q,J,Z,j,et,x,X,z,A,null==F?void 0:F.source,R]),er=r.useMemo(()=>({slots:Array.from({length:x}).map((e,t)=>{var n;let r=H&&null!==z&&null!==X&&(z===X&&t===z||t>=z&&t<X),a=void 0!==R[t]?R[t]:null;return{char:a,placeholderChar:void 0!==R[0]?null:null!=(n=null==S?void 0:S[t])?n:null,isActive:r,hasFakeCaret:r&&null===a}}),isFocused:H,isHovering:!A.disabled&&q}),[H,q,x,X,z,A.disabled,R]),ea=r.useMemo(()=>_?_(er):r.createElement(d.Provider,{value:er},T),[T,er,_]);return r.createElement(r.Fragment,null,null!==C&&r.createElement("noscript",null,r.createElement("style",null,C)),r.createElement("div",{ref:B,"data-input-otp-container":!0,style:ee,className:k},ea,r.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},en)))});function h(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}p.displayName="Input";var m=` 2[data-input-otp] { 3 --nojs-bg: white !important; 4 --nojs-fg: black !important; 5 6 background-color: var(--nojs-bg) !important; 7 color: var(--nojs-fg) !important; 8 caret-color: var(--nojs-fg) !important; 9 letter-spacing: .25em !important; 10 text-align: center !important; 11 border: 1px solid var(--nojs-fg) !important; 12 border-radius: 4px !important; 13 width: 100% !important; 14} 15@media (prefers-color-scheme: dark) { 16 [data-input-otp] { 17 --nojs-bg: black !important; 18 --nojs-fg: white !important; 19 } 20}`},91440:(e,t,n)=>{"use strict";function r(e){if(!e||e.length>320)return null;try{let t=decodeURIComponent(e.trim());if(t.length>254||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return null;return t.toLowerCase()}catch(e){return null}}n.d(t,{C:()=>r})},92698:(e,t,n)=>{"use strict";n.d(t,{NV:()=>u,UV:()=>s,sF:()=>c});var r=n(95155),a=n(12115),i=n(71753),o=n(7125),l=n(64269);let s=a.forwardRef((e,t)=>{let{className:n,containerClassName:a,...o}=e;return(0,r.jsx)(i.wE,{ref:t,"data-slot":"input-otp",containerClassName:(0,l.cn)("flex items-center gap-2 has-[:disabled]:opacity-40",a),className:(0,l.cn)("disabled:cursor-not-allowed",n),...o})});s.displayName="InputOTP";let u=a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,r.jsx)("div",{ref:t,"data-slot":"input-otp-group",className:(0,l.cn)("flex items-center",n),...a}
20)});u.displayName="InputOTPGroup";let c=a.forwardRef((e,t)=>{var n;let{index:o,className:s,invalid:u,...c}=e,d=a.useContext(i.dK),{char:p,hasFakeCaret:h,isActive:m}=null!=(n=null==d?void 0:d.slots[o])?n:{};return(0,r.jsxs)("div",{ref:t,"data-slot":"input-otp-slot","data-active":m||void 0,className:(0,l.cn)("relative flex h-11 w-10 items-center justify-center border-y border-r border-border bg-input text-[16px] font-medium text-foreground tabular-nums outline-none","transition-[border-color,box-shadow] duration-[var(--dur-quick)] ease-[var(--ease-snap)] motion-reduce:transition-none","first:rounded-l-[var(--rad-3)] first:border-l last:rounded-r-[var(--rad-3)]","data-[active]:z-10 data-[active]:border-ring data-[active]:ring-2 data-[active]:ring-ring data-[active]:ring-offset-1 data-[active]:ring-offset-background",u?"border-[var(--status-danger)]":"",s),...c,children:[p,h?(0,r.jsx)("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,r.jsx)("span",{className:"h-5 w-px bg-foreground [animation:anim-otp-caret_1s_step-end_infinite] motion-reduce:animate-none"})}):null]})});c.displayName="InputOTPSlot",a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,r.jsx)("div",{ref:t,"data-slot":"input-otp-separator",role:"separator",className:(0,l.cn)("text-muted-foreground",n),...a,children:(0,r.jsx)(o.A,{className:"size-4","aria-hidden":!0})})}).displayName="InputOTPSeparator"}},e=>{e.O(0,[24909,52619,35497,16010,10531,93409,76614,23982,1122,95221,46539,16905,49234,20891,17136,28441,31255,77358],()=>e(e.s=31966)),_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.