1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5126],{4586:(e,t,s)=>{"use strict";s(37876),s(14232)},5945:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(37876);s(14232);let r=e=>{let{classes:t,text:s}=e;return(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex flow-row",role:"status",children:[(0,a.jsxs)("svg",{"aria-hidden":"true",className:"mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600 ".concat(t),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,a.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),(0,a.jsx)("span",{className:"sr-only",children:"Loading..."}),s&&(0,a.jsx)("span",{className:"ml-2 text-gray-500 text-xs",children:s})]})})}},51287:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var a=s(14232);function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e}).apply(this,arguments)}var l=["cdnSuffix","cdnUrl","countryCode","style","svg"];let o=function(e){var t=e.cdnSuffix,s=e.cdnUrl,o=e.countryCode,i=e.style,n=e.svg,c=function(e,t){if(null==e)return{};var s,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)s=l[a],t.indexOf(s)>=0||(r[s]=e[s]);return r}(e,l);if("string"!=typeof o)return null;if(void 0!==n&&n){var d=""+(void 0===s?"https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/":s)+o.toLowerCase()+"."+(void 0===t?"svg":t);return(0,a.createElement)("img",Object.assign({},c,{src:d,style:r({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},i)}))}var u=o.toUpperCase().replace(/./g,function(e){return String.fromCodePoint(e.charCodeAt(0)+127397)});return(0,a.createElement)("span",Object.assign({role:"img"},c,{style:r({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},i)}),u)}},66866:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/signin",function(){return s(86914)}])},76771:()=>{},86914:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var a=s(37876),r=s(14232);s(48230);var l=s(86209),o=s(92145),i=s(89099),n=s(55108);s(51287),s(76771),s(4586);var c=s(5945),d=s(46408);s(98836);var u=s(49834);let m=()=>{let e=(0,i.useRouter)(),[t,s]=(0,r.useState)(""),{user:m,setUpRecaptha:g,updateUserProfile:h,sendEmailSignInLink:f,completeEmailSignIn:x,isSignInWithEmailLink:p,auth:b,logIn:w,signUp:y}=(0,l.r)(),[v,j]=(0,r.useState)(""),[S,C]=(0,r.useState)(!1),[N,I]=(0,r.useState)(!1),[k,F]=(0,r.useState)(""),[E,A]=(0,r.useState)(""),[U,O]=(0,r.useState)(""),[_,T]=(0,r.useState)(""),[P,q]=(0,r.useState)(""),[M,z]=(0,r.useState)(),[B,G]=(0,r.useState)(!1),[H,L]=(0,r.useState)(!1),[J,R]=(0,r.useState)(!1),[W,Z]=(0,r.useState)(!1),[D,X]=r.useState(null),[K,Q]=r.useState(!0),[V,Y]=r.useState(!1),[$,ee]=r.useState(!0),[et,es]=r.useState(!1),[ea,er]=r.useState(12.5),[el,eo]=r.useState(!1),[ei,en]=r.useState(!1),[ec,ed]=(0,r.useState)(!1),[eu,em]=(0,r.useState)([]),{handleStripeCheckout:eg,checkoutLoading:eh}=(0,n.n)(),[ef,ex]=(0,r.useState)("email"),[ep,eb]=(0,r.useState)(!1),[ew,ey]=(0,r.useState)(""),[ev,ej]=(0,r.useState)(!0),{isFreeUserMode:eS,freeUsersRemaining:eC,loading:eN,markUserAsEligibleForFree:eI}=(0,o.x)();(0,r.useEffect)(()=>
1{if(console.log("isSignInWithEmailLink",p),p(b,window.location.href)){let t=window.localStorage.getItem("emailForSignIn");console.log("email",t),t?x(t,window.location.href).then(t=>{window.localStorage.removeItem("emailForSignIn"),I(!0),ex("email"),ee(!1),t.user.email&&t.user.displayName&&(e.query.checkoutFlow?(sessionStorage.setItem("isCheckoutAllowed","true"),e.push("/onboarding")):e.push("/profile"))}).catch(e=>{console.error("Error during sign-in:",e)}):(Y(!0),ex("email"),ee(!1)),er(35)}else ee(!1)},[]);let[ek,eF]=r.useState([]);async function eE(){try{let e=localStorage.getItem("userCountryCode");if(!e){let t=await fetch("http://api.ipstack.com/check?access_key=beb6097fac8d0a88bdf388d4a455db62");e=(await t.json()).country_code,localStorage.setItem("userCountryCode",e)}let t=ek.find(t=>t.code===e);t?X(t):X(ek[0]),Q(!1)}catch(e){console.error("Error fetching user country:",e),Q(!1)}}r.useEffect(()=>{N&&console.log("fetching countries")},[N]),r.useEffect(()=>{ek.length>0&&eE()},[ek]);let eA=async t=>{t.preventDefault(),en(!0);try{if(!U||!P)return void s("Email and password are required");let t=await w(U,P);if(t.user)if(eS&&eC>0&&eI(),e.query.checkoutFlow){var a;sessionStorage.setItem("isCheckoutAllowed","true");let s="true"===localStorage.getItem("freeUserEligible"),r=await fetch("/api/create-job",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:t.user.uid,isFreeUserEligible:s})}),l=await r.json();l.shouldClearFreeUserFlag&&localStorage.removeItem("freeUserEligible");let o=(null==(a=l.job)?void 0:a.isFreeUser)?"&isFreeUser=true":"";e.push("/onboarding?checkoutFlow=true&jobId=".concat(l.jobId,"&uploadedImageId=").concat(l.uploadedImageId).concat(o))}else e.push("/profile")}catch(e){console.log("err",e),s(e.message)}finally{en(!1)}},eU=async()=>{e_(!0);try{console.log("Starting Google Sign In...");let s=new u.HF;s.addScope("https://www.googleapis.com/auth/userinfo.email"),s.addScope("https://www.googleapis.com/auth/userinfo.profile"),s.setCustomParameters({prompt:"select_account"});let a=await (0,u.df)(b,s);console.log("Google Sign In Result:",a);let r=a.user;if(r)if(console.log("User signed in successfully:",r),eS&&eC>0&&eI(),e.query.checkoutFlow){var t;sessionStorage.setItem("isCheckoutAllowed","true");let s="true"===localStorage.getItem("freeUserEligible"),a=await fetch("/api/create-job",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:r.uid,isFreeUserEligible:s})}),l=await a.json();l.shouldClearFreeUserFlag&&localStorage.removeItem("freeUserEligible");let o=(null==(t=l.job)?void 0:t.isFreeUser)?"&isFreeUser=true":"";e.push("/onboarding?checkoutFlow=true&jobId=".concat(l.jobId,"&uploadedImageId=").concat(l.uploadedImageId).concat(o))}else e.push("/profile")}catch(e){console.error("Google Sign In Error:",e),s(e.message),"auth/popup-blocked"===e.code?s("Please allow popups for this website"):"auth/popup-closed-by-user"===e.code&&s("Sign-in popup was closed")}finally{e_(!1)}},[eO,e_]=(0,r.useState)(!1),eT=async t=>{t.preventDefault(),en(!0);try{if(!U||!P)return void s("Email and password are required");let t=await y(U,P);if(t.user)if(eS&&eC>0&&eI(),e.query.checkoutFlow){var a;sessionStorage.setItem("isCheckoutAllowed","true");let s="true"===localStorage.getItem("freeUserEligible"),r=await fetch("/api/create-job",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:t.user.uid,isFreeUserEligible:s})}),l=await r.json();l.shouldClearFreeUserFlag&&localStorage.removeItem("freeUserEligible");let o=(null==(a=l.job)?void 0:a.isFreeUser)?"&isFreeUser=true":"";e.push("/onboarding?checkoutFlow=true&jobId=".concat(l.jobId,"&uploadedImageId=").concat(l.uploadedImageId).concat(o))}else e.push("/profile")}catch(e){console.log("err",e),s(e.message)}finally{en(!1)}};return $?(0,a.jsx)("div",{className:"mt-24 xl:mx-auto xl:max-w-7xl px-4 xl:px-8 flex justify-center items-center",children:(0,a.jsx)(c.A,{classes:"w-8 h-8"})}):(0,a.jsx)(d.A,{children:(0,a.jsx)("div",{className:"mt-24 xl:mx-auto xl:max-w-7xl px-4 xl:px-8",children:(0,a.jsxs)("div",{className:"flex flex-col lg:flex-row gap-8 items-center",children:[(0,a.jsx)("div",{className:"w-full lg:w-1/2 hidden lg:block",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("h3",{className:"text-xl font-semibold mb-4 text-gray-800",children:"Create stunning AI portraits like these"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("img",{src:"/business-headshots-webp/52.webp",alt:"AI generated portrait",className:"rounded-lg shadow-md w-full h-64 object-cover transform hover:scale-[1.02] transition-transform"}),(0,a.jsx)("img",{src:"/business-headshots-webp/54.webp",alt:"AI generated portrait",className:"rounded-lg shadow-md w-full h-48 object-cover transform hover:scale-[1.02] transition-transform"})]}),(0,a.jsxs)("div",{className:"space-y-4 pt-6",children:[(0,a.jsx)("img",{src:"/business-headshots-webp/2.webp",alt:"AI generated portrait",className:"rounded-lg shadow-md w-full h-48 object-cover transform hover:scale-[1.02] transition-transform"}),(0,a.jsx)("img",{src:"/business-headshots-webp/3.webp",alt:"AI generated portrait",className:"rounded-lg shadow-md w-full h-64 object-cover transform hover:scale-[1.02] transition-transform"})]})]})]})}),(0,a.jsxs)("div",{className:"w-full lg:w-1/2",children:[(0,a.jsxs)("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[(0,a.jsxs)("div",{className:"my-8 text-center",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold leading-9 tracking-tight text-gray-900",children:ev?"Create your account":"Sign in to your account"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:ev?"Join Biopik and create beautiful AI images in minutes":"Welcome back to Biopik"})]}),(0,a.jsxs)("div",{className:"bg-white p-6 shadow rounded-lg",children:[(0,a.jsxs)("div",{className:"flex border-b border-gray-200 mb-6",children:[(0,a.jsx)("button",{type:"button",onClick:()=>ej(!0),className:"flex-1 py-2 px-4 text-sm font-medium ".concat(ev?"text-indigo-600 border-b-2 border-indigo-600":"text-gray-500 hover:text-gray-700"),children:"Sign Up"}),(0,a.jsx)("button",{type:"button",onClick:()=>ej(!1),className:"flex-1 py-2 px-4 text-sm font-medium ".concat(ev?"text-gray-500 hover:text-gray-700":"text-indigo-600 border-b-2 border-indigo-600"),children:"Sign In"})]}),(0,a.jsx)("button",{onClick:async()=>{e_(!0);try{await eU()}finally{e_(!1)}},disabled:eO,className:"mb-6 flex w-full justify-center items-center rounded-md px-4 py-2.5 text-sm font-medium leading-6 shadow-sm border ".concat(eO?"bg-gray-100 text-gray-500 cursor-not-allowed":"bg-white text-gray-700 hover:bg-gray-50 border-gray-300"),children:eO?(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(c.A,{classes:"w-4 h-4 mr-2"}),"Signing in..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mr-3 w-5 h-5",children:(0,a.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",style:{display:"block",width:"100%",height:"100%"},children:[(0,a.jsx)("path",{fill:"#EA4335",d:"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"}),(0,a.jsx)("path",{fill:"#4285F4",d:"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"}),(0,a.jsx)("path",{fill:"#FBBC05",d:"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"}),(0,a.jsx)("path",{fill:"#34A853",d:"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"}),(0,a.jsx)("path",{fill:"none",d:"M0 0h48v48H0z"})]})}),ev?"Sign up with Google":"Sign in with Google"]})}),(0,a.jsxs)("div",{className:"flex items-center my-5",children:[(0,a.jsx)("div",{className:"flex-grow border-t border-gray-300"}),(0,a.jsx)("div",{className:"px-4 text-xs text-gray-500",children:"OR CONTINUE WITH EMAIL"}),(0,a.jsx)("div",{className:"flex-grow border-t border-gray-300"})]}),(0,a.jsxs)("form",{onSubmit:ev?eT:eA,className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium leading-6 text-gray-900",children:"Email address"}),(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsx)("input",{id:"email",name:"email",type:"email",autoComplete:"email",value:U,onChange:e=>O(e.target.value),required:!0,className:"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"password",className:"block text-sm font-medium leading-6 text-gray-900",children:"Password"}),(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsx)("input",{id:"password",name:"password",type:"password",autoComplete:ev?"new-password":"current-password",value:P,onChange:e=>q(e.target.value),required:!0,className:"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"})})]}),(0,a.jsx)("button",{type:"submit",className:"mt-4 flex w-full justify-center rounded-md px-4 py-2.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 ".concat(ei?"bg-gray-500":ev?"bg-green-600 hover:bg-green-500":"bg-indigo-600"),children:ei?"Loading...":ev?"Create account":"Sign in"})]})]})]}),(0,a.jsxs)("div",{className:"mt-8 p-4 bg-gray-50 rounded-lg border border-gray-100 hidden lg:block",children:[(0,a.jsx)("p",{className:"text-sm italic text-gray-600",children:'"I created amazing portraits for my entire team in minutes. The quality is incredible!"'}),(0,a.jsx)("p",{className:"text-xs font-medium text-gray-800 mt-2",children:"â Sarah K, Biopik user"})]})]})]})})})}},98836:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(37876);s(14232);let r=e=>{let{imageUrl:t,selected:s}=e;return(0,a.jsx)("div",{className:"max-w-full h-full md:w-52 md:max-h-64 overflow-hidden",children:(0,a.jsx)("img",{className:"aspect-[2/3] w-full h-full object-cover rounded-md rounded-b-none sm:rounded-md sm:rounded-b-none transform transition-all duration-500 ".concat(""," hover:scale-105"),src:t,alt:""})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[8230,4215,2436,6408,636,6593,8792],()=>t(66866)),_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.