1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2626],{4480:function(e,t,n){Promise.resolve().then(n.bind(n,66374))},66374:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(57437),o=n(2265),s=n(99376),a=n(27648),i=n(10970),c=n(14723),u=n(30401),l=n(51817),d=n(32489),f=n(21509);function m(){return(0,r.jsx)(o.Suspense,{fallback:(0,r.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,r.jsx)(l.Z,{className:"w-5 h-5 text-foreground animate-spin"})}),children:(0,r.jsx)(h,{})})}function h(){let e=(0,s.useRouter)(),t=(0,s.useSearchParams)(),[n,u]=(0,o.useState)(""),[m,h]=(0,o.useState)(""),[g,p]=(0,o.useState)(!1),[x,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(!1),[j,w]=(0,o.useState)(""),[N,k]=(0,o.useState)(0),[S,I]=(0,o.useState)(!0),_=(0,o.useRef)(null),C=(0,o.useRef)(null),[T,E]=(0,o.useState)(!1),R=(t.get("ctx")||"").slice(0,80),O=t.get("returnTo")||"",W=!O.startsWith("/")||O.startsWith("//")||O.startsWith("/\\")?"":O;(0,o.useEffect)(()=>{E(document.cookie.split("; ").some(e=>e.startsWith("talkshop_invite=")))},[]),(0,o.useEffect)(()=>{(async function(){let t=(0,i.e)(),{data:{user:n}}=await t.auth.getUser();if(n){try{let t=await fetch("/api/auth/me");if(t.ok){var r;let n=await t.json();if(null===(r=n.user)||void 0===r?void 0:r.username){if("canceled"===n.user.subscription_status||"past_due"===n.user.subscription_status){e.replace("/settings");return}e.replace(W||"/".concat(n.user.username));return}}}catch(e){}e.replace(W?"/setup?returnTo=".concat(encodeURIComponent(W)):"/setup");return}I(!1)})()},[e,!1]);let D=e=>{k(e),w(""),C.current&&clearInterval(C.current),C.current=setInterval(()=>{k(e=>e<=1?(C.current&&clearInterval(C.current),0):e-1)},1e3)},U=async()=>{v(!0),w("");let e=(0,i.e)(),{error:t}=await e.auth.signInWithOtp({email:n});if(t){let e=t.message,n=e.match(/(\d+)\s*second/);n?D(parseInt(n[1])):w(e),v(!1);return}p(!0),v(!1),(0,f.L)("login_email_sent"),setTimeout(()=>{var e;return null===(e=_.current)||void 0===e?void 0:e.focus()},100)},J=async e=>{e.preventDefault(),U()},L=e=>{let t=e.replace(/\D/g,"").slice(0,8);h(t),8===t.length&&M(t)},M=async t=>{if(8!==t.length||y)return;b(!0),w("");let r=(0,i.e)(),{error:o}=await r.auth.verifyOtp({email:n,token:t,type:"email"});if(o){w(o.message),h(""),b(!1);return}(0,f.L)("login_code_verified");try{let t=await fetch("/api/auth/me");if(t.ok){var s;let n=await t.json();if(null===(s=n.user)||void 0===s?void 0:s.username){if("canceled"===n.user.subscription_status||"past_due"===n.user.subscription_status){e.replace("/settings");return}e.replace(W||"/".concat(n.user.username));return}}}catch(e){}e.replace(W?"/setup?returnTo=".concat(encodeURIComponent(W)):"/setup")};return S?(0,r.jsx)("div",{className:"flex flex-col items-center justify-center gap-3 w-full h-full",children:(0,r.jsx)(l.Z,{className:"w-5 h-5 text-foreground animate-spin"})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>W?e.back():e.push("/"),className:"fixed top-1.5 right-1.5 z-50 w-8 h-8 rounded-full flex items-center justify-center text-black hover:bg-black/10 transition-colors","aria-label":"Close",children:(0,r.jsx)(d.Z,{className:"w-5 h-5",strokeWidth:2})}),(0,r.jsxs)("div",{id:"login-form",className:"w-full max-w-sm space-y-8 p-6",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(a.default,{href:"/",className:"inline-block",children:(0,r.jsx)("h1",{className:"text-2xl font-bold",children:"talkshop"})}),g?(0,r.jsxs)("p",{className:"text-sm text-muted-foreground animate-in fade-in duration-300",children:["Enter the code we sent to ",(0,r.jsx)("span",{className:"font-semibold text-foreground",children:n})]}):T?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"You've been invited. Enter your email to get started."}):(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:R?"Somebody here already owns the ".concat(R,". Talk to them about it."):/^\/b\/[^/]+\/p\//.test(W)?"Somebody here already owns the thing you were just looking at.":/^\/b\/[^/]+/.test(W)?"The people here have opinions about that brand. Yours is welcome too.":"Keep what catches your eye. Talk about it with people who get it."})]}),g?(0,r.jsxs)("div",{className:"space-y-4 animate-in fade-in duration-300",children:[(0,r.jsxs)("div",{className:"relative cursor-text",onClick:()=>{var e;return null===(e=_.current)||void 0===e?void 0:e.focus()},children:[(0,r.jsx)("input",{ref:_,type:"text",inputMode:"numeric",autoComplete:"one-time-code",autoFocus:!0,value:m,onChange:e=>L(e.target.value),className:"absolute opacity-0 w-0 h-0","aria-label":"Verification code"}),(0,r.jsx)("div",{className:"flex gap-2",children:Array.from({length:8}).map((e,t)=>(0,r.jsx)("div",{className:"w-9 h-12 flex items-center justify-center rounded-lg text-lg font-semibold bg-muted-foreground
1/15 transition-colors ".concat(t===m.length?"ring-1 ring-foreground/20":""),children:m[t]||""},t))})]}),N>0?(0,r.jsxs)("p",{className:"text-xs text-muted-foreground px-1",children:["Try again in ",N,"s"]}):j?(0,r.jsx)("p",{className:"text-sm text-destructive px-1 max-w-[260px]",children:j}):null,(0,r.jsx)(c.K,{type:"button",loading:y,loadingText:"Verifying...",disabled:m.length<8||y,onClick:()=>M(m),className:"w-full",children:"Verify"}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground pt-1",children:["Didn't get it?"," ",(0,r.jsx)("button",{onClick:U,disabled:x||N>0,className:"underline decoration-muted-foreground/30 underline-offset-2 hover:text-foreground hover:decoration-foreground/40 transition-colors duration-150 disabled:opacity-50",children:x?"Sending...":N>0?"Resend code (".concat(N,"s)"):"Resend code"})," ","or"," ",(0,r.jsx)("button",{onClick:()=>{p(!1),h(""),w("")},className:"underline decoration-muted-foreground/30 underline-offset-2 hover:text-foreground hover:decoration-foreground/40 transition-colors duration-150",children:"use a different email"}),"."]})]}):(0,r.jsxs)("form",{onSubmit:J,className:"space-y-4",children:[(0,r.jsx)("input",{type:"email",placeholder:"[email protected]",value:n,onChange:e=>u(e.target.value),required:!0,autoFocus:!0,className:"w-full text-base md:text-sm py-2.5 px-3 rounded-lg bg-muted-foreground/15 text-foreground placeholder:text-muted-foreground/50 outline-none focus:ring-1 focus:ring-foreground focus:bg-white transition-colors"}),N>0?(0,r.jsxs)("p",{className:"text-xs text-muted-foreground px-1",children:["Try again in ",N,"s"]}):j?(0,r.jsx)("p",{className:"text-sm text-destructive px-1 max-w-[260px]",children:j}):null,(0,r.jsx)(c.K,{type:"submit",loading:x,loadingText:"Sending...",disabled:x||N>0,className:"w-full",children:"Continue"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"We'll send you a sign-in code. No password needed."}),(0,r.jsxs)("p",{className:"text-[11px] text-muted-foreground/70 pt-2",children:["By continuing, you agree to our"," ",(0,r.jsx)("a",{href:"/terms",className:"underline decoration-muted-foreground/30 underline-offset-2 hover:text-foreground hover:decoration-foreground/40 transition-colors duration-150",children:"Terms"})," ","and"," ",(0,r.jsx)("a",{href:"/privacy",className:"underline decoration-muted-foreground/30 underline-offset-2 hover:text-foreground hover:decoration-foreground/40 transition-colors duration-150",children:"Privacy Policy"}),"."]})]})]})]})}},14723:function(e,t,n){"use strict";n.d(t,{K:function(){return s}});var r=n(57437),o=n(27648);function s(e){let{children:t,href:n,type:s="button",onClick:a,disabled:i=!1,loading:c=!1,loadingText:u,className:l=""}=e,d=["inline-flex items-center justify-center gap-2","h-11 px-8 rounded-full","bg-foreground text-background","text-sm font-medium","transition-all duration-150 ease-out","hover:bg-foreground
1/85 hover:shadow-sm","active:scale-[0.96] active:bg-foreground/80","disabled:opacity-50 disabled:pointer-events-none","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",l].join(" ");return n&&!i?(0,r.jsx)(o.default,{href:n,className:d,children:t}):(0,r.jsx)("button",{type:s,onClick:a,disabled:i||c,className:d,children:c&&void 0!==u?u:t})}},43314:function(e,t,n){"use strict";n.d(t,{MQ:function(){return i},wG:function(){return c},yQ:function(){return a}});let r="ts_aid",o="ts_sid",s="ts_sid_at";function a(){try{var e;let t=function(e){let t=document.cookie.match(new RegExp("(?:^|; )".concat(e,"=([^;]*)")));return t?t[1]:null}(r)||localStorage.getItem(r);return t||(t=crypto.randomUUID()),e=t,document.cookie="".concat(r,"=").concat(e,"; path=/; max-age=").concat(63072e3,"; SameSite=Lax"),localStorage.setItem(r,t),t}catch(e){return""}}function i(){try{let e=Date.now(),t=Number(sessionStorage.getItem(s)||0),n=sessionStorage.getItem(o);return(!n||e-t>18e5)&&(n=crypto.randomUUID(),sessionStorage.setItem(o,n)),sessionStorage.setItem(s,String(e)),n}catch(e){return""}}function c(e){try{let t="ts_identified_".concat(e);if(localStorage.getItem(t))return!1;return localStorage.setItem(t,"1"),!0}catch(e){return!1}}},17890:function(e,t,n){"use strict";n.d(t,{Qr:function(){return i},SP:function(){return u},jV:function(){return c}});var r=n(43314);let o=[],s=null,a=!1;function i(){try{return"1"===localStorage.getItem("ts_no_track")}catch(e){return!1}}function c(e){try{e?localStorage.setItem("ts_no_track","1"):localStorage.removeItem("ts_no_track")}catch(e){}}function u(e,t){i()||location.pathname.startsWith("/admin")||window.__talkshop_impersonating||(s||(s=setInterval(d,5e3),window.addEventListener("pagehide",f),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&f()})),o.push({name:e.slice(0,64),anonymous_id:(0,r.yQ)(),session_id:(0,r.MQ)(),path:location.pathname,referrer:document.referrer?document.referrer.slice(0,512):null,properties:function(e){if(!e)return;let t={};for(let n of Object.keys(e).slice(0,20))t[n.slice(0,64)]=String(e[n]).slice(0,256);return t}(t),ts:Date.now()}),o.length>=10&&d())}function l(){let e=o.slice(0,20);return o=o.slice(20),e}async function d(){for(;o.length>0;){let e=l();try{await fetch("/api/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:e}),keepalive:!0,credentials:"same-origin"}),a=!1}catch(t){a||(a=!0,o=e.concat(o));break}}}function f(){for(;o.length>0;){let e=l();try{let t=new Blob([JSON.stringify({events:e})],{type:"application/json"});navigator.sendBeacon("/api/track",t)}catch(e){break}}}},21509:function(e,t,n){"use strict";n.d(t,{L:function(){return s}});var r=n(72236),o=n(17890);function s(e,t){if(!window.location.pathname.startsWith("/admin")){try{(0,r.L9)(e,t)}catch(e){}try{(0,o.SP)(e,t)}catch(e){}}}},10970:function(e,t,n){"use strict";n.d(t,{e:function(){return o}});var r=n(11259);function o(){return(0,r.createBrowserClient)("https://yzcfwioigefmlojmvvun.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inl6Y2Z3aW9pZ2VmbWxvam12dnVuIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzExMDY1NDIsImV4cCI6MjA4NjY4MjU0Mn0.Rc0XYfzXuU3-D8mtq7i7RANL-wXRQFc0mrhj-44uy2I")}}},function(e){e.O(0,[2972,2555,1259,547,2971,2117,1744],function(){return e(e.s=4480)}),_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.