1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4665],{83991:function(e,t,n){Promise.resolve().then(n.bind(n,34995))},34995:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return v}});var r=n(57437),a=n(2265),i=n(99376),o=n(18547),s=n(94646),l=n(98734),c=n(71837),d=n(56334),u=n(92827),h=n(51817),g=n(76858),p=n(73547),m=n(88185),f=n.n(m),b=n(94371);let _=()=>(0,r.jsxs)("svg",{viewBox:"0 0 24 24",className:"w-5 h-5",children:[(0,r.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,r.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,r.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,r.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]});function x(){let e=(0,i.useRouter)(),t=(0,i.useSearchParams)(),{isAuthenticated:n,isLoading:m,login:x}=(0,l.a)(),v=t.get("error"),y=(0,p._G)(t.get("next"));(0,a.useEffect)(()=>{t.has("next")&&(0,p.cZ)(y)},[y,t]);let[w,A]=(0,a.useState)(()=>"signup"===t.get("mode")?"signup":"signin"),[k,N]=(0,a.useState)(!0),[S,j]=(0,a.useState)("email"),[C,I]=(0,a.useState)(""),[E,P]=(0,a.useState)(""),[L,O]=(0,a.useState)(""),[D,G]=(0,a.useState)(""),[T,z]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!m&&n){let t=(0,p.fN)();e.replace(y||t)}},[n,m,e,y]),(0,a.useEffect)(()=>{(0,b.L9)(b.s6.VIEW_LOGIN,{mode:w})},[]);let R="signup"===w,U=R&&!k,M=(e,t)=>{if(s.default.isAxiosError(e)){var n;let t=null===(n=e.response)||void 0===n?void 0:n.data;if(null==t?void 0:t.error)return t.error}return t},F=async e=>{if(e.preventDefault(),!U){O(""),G(""),z(!0);try{await c.h.requestEmailOtp(C.trim().toLowerCase()),j("code"),P(""),G("We sent a 6-digit code to ".concat(C.trim().toLowerCase(),"."))}catch(e){O(M(e,"Could not send the code. Please try again."))}finally{z(!1)}}},B=async e=>{if(e.preventDefault(),!U){O(""),z(!0);try{let{access_token:e,refresh_token:t,created:n}=await c.h.verifyEmailOtp(C.trim().toLowerCase(),E.trim());if(R)try{localStorage.setItem("pp_signup_consent",JSON.stringify({accepted:!0,acceptedAt:new Date().toISOString()}))}catch(e){}(0,o.BV)(e,t),(0,b.L9)(n?b.s6.SIGN_UP:b.s6.LOGIN,{method:"otp"}),window.location.href=(0,p.fN)(y||"/dashboard")}catch(e){O(M(e,"Invalid or expired code. Please try again.")),z(!1)}}},W=async()=>{O(""),G(""),z(!0);try{await c.h.requestEmailOtp(C.trim().toLowerCase()),G("A new code has been sent.")}catch(e){O(M(e,"Could not resend the code. Please try again."))}finally{z(!1)}};return m||n?(0,r.jsxs)("div",{role:"status",className:f().loading,children:[(0,r.jsx)(h.Z,{"aria-hidden":"true",className:"animate-spin"}),(0,r.jsx)("span",{children:"Opening your workspaceâ¦"})]}):(0,r.jsxs)("div",{className:f().form,children:[(0,r.jsx)("div",{className:f().modeSwitch,"aria-label":"Choose how to continue",children:["signin","signup"].map(e=>(0,r.jsx)("button",{type:"button","aria-pressed":w===e,onClick:()=>{A(e),O("")},children:"signin"===e?"Sign in":"Create an account"},e))}),(0,r.jsxs)("div",{className:f().heading,children:[(0,r.jsx)("p",{children:R?"YOUR NEXT CAMPAIGN STARTS HERE":"YOUR WORKSPACE, READY WHEN YOU ARE"}),(0,r.jsx)("h1",{children:"code"===S?"Check your inbox.":R?"Give them a reason to return.":"Welcome back."}),(0,r.jsx)("div",{children:"code"===S?"Enter the six-digit code sent to ".concat(C.trim().toLowerCase(),"."):R?"Preview your first notification. Connect your provider when youâre ready to build a campaign.":"Pick up your campaigns, review whatâs next, and keep your audience coming back."})]}),v&&(0,r.jsx)("p",{role:"alert",className:f().error,children:"no_code"===v?"Sign-in was cancelled. Choose a method below to try again.":"We couldnât complete sign-in. Please try again."}),R&&(0,r.jsxs)("label",{className:f().consent,children:[(0,r.jsx)("input",{type:"checkbox",checked:k,onChange:e=>N(e.target.checked)}),(0,r.jsxs)("span",{children:["I agree to the ",(0,r.jsx)("a",{href:"/policies/terms-of-use",target:"_blank",rel:"noopener noreferrer",children:"Terms of Use"})," and ",(0,r.jsx)("a",{href:"/policies/privacy-policy",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"."]})]}),"email"===S?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(d.z,{variant:"outline",disabled:U,className:"w-full h-12",onClick:()=>
1{if(!U){if((0,p.cZ)(y||(0,p.fK)()),(0,b.MI)(R?"signup":"signin"),(0,b.L9)(b.s6.AUTH_STARTED,{method:"google",mode:R?"signup":"signin"}),R)try{localStorage.setItem("pp_signup_consent",JSON.stringify({accepted:!0,acceptedAt:new Date().toISOString()}))}catch(e){}x()}},children:[(0,r.jsx)(_,{}),R?"Sign up with Google":"Continue with Google"]}),(0,r.jsx)("div",{className:f().divider,children:(0,r.jsx)("span",{children:"or use your email"})}),(0,r.jsxs)("form",{onSubmit:F,className:f().emailForm,children:[(0,r.jsx)(u.I,{id:"login-email",label:"Email address",type:"email",autoComplete:"email",required:!0,value:C,onChange:e=>I(e.target.value),placeholder:"[email protected]",disabled:T,className:"h-12 md:h-12"}),L&&(0,r.jsx)("p",{role:"alert",className:f().error,children:L}),(0,r.jsxs)(d.z,{type:"submit",isLoading:T,disabled:U,className:"w-full h-12",children:[T?"Sending codeâ¦":"Continue with email",!T&&(0,r.jsx)(g.Z,{"aria-hidden":"true"})]}),(0,r.jsx)("p",{className:f().helper,children:"Weâll email you a sign-in code. No password to remember."})]})]}):(0,r.jsxs)("form",{onSubmit:B,className:f().emailForm,children:[(0,r.jsx)(u.I,{id:"login-code",label:"Verification code",type:"text",inputMode:"numeric",autoComplete:"one-time-code",pattern:"[0-9]{6}",maxLength:6,required:!0,autoFocus:!0,value:E,onChange:e=>P(e.target.value.replace(/\D/g,"")),placeholder:"000000",className:"h-14 md:h-14 tracking-[.45em] text-center text-xl md:text-xl",error:L,disabled:T}),D&&(0,r.jsx)("p",{role:"status",className:f().helper,children:D}),(0,r.jsx)(d.z,{type:"submit",isLoading:T,disabled:U||6!==E.length,className:"w-full h-12",children:T?"Verifyingâ¦":R?"Create account":"Sign in"}),(0,r.jsxs)("div",{className:f().codeActions,children:[(0,r.jsx)("button",{type:"button",disabled:T,onClick:()=>{j("email"),P(""),O(""),G("")},children:"Use a different email"}),(0,r.jsx)("button",{type:"button",onClick:W,disabled:T,children:"Resend code"})]})]}),U&&(0,r.jsx)("p",{role:"status",className:f().helper,children:"Accept the Terms of Use and Privacy Policy to continue."}),!R&&(0,r.jsxs)("p",{className:f().legal,children:["By signing in, you agree to our ",(0,r.jsx)("a",{href:"/policies/terms-of-use",target:"_blank",rel:"noopener noreferrer",children:"Terms of Use"})," and ",(0,r.jsx)("a",{href:"/policies/privacy-policy",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"."]})]})}function v(){return(0,r.jsx)(a.Suspense,{fallback:(0,r.jsxs)("div",{role:"status",className:f().loading,children:[(0,r.jsx)(h.Z,{"aria-hidden":"true",className:"animate-spin"}),"Loading sign-inâ¦"]}),children:(0,r.jsx)(x,{})})}},56334:function(e,t,n){"use strict";n.d(t,{z:function(){return d}});var r=n(57437),a=n(2265),i=n(37053),o=n(90535),s=n(51150),l=n(93448);let c=(0,o.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-[14px] font-medium transition-all duration-150 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-[0_1px_0_rgba(108,0,252,0.18)]",dark:"bg-stone-900 text-white hover:bg-stone-800 shadow-[0_1px_0_rgba(28,25,23,0.18)]",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border! border-[#e5e5e9]! bg-white hover:bg-[#fafafa] hover:border-stone-300! text-stone-800",secondary:"bg-[#f3f3f5] text-stone-800 hover:bg-[#ebebef]",ghost:"hover:bg-[#f3f3f5] hover:text-stone-900 text-stone-600",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-[0_1px_0_rgba(108,0,252,0.18)]",danger:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",md:"h-10 px-4 py-2 has-[>svg]:px-3",lg:"h-11 rounded-lg px-6 has-[>svg]:px-4",pill:"h-10 rounded-full px-5 has-[>svg]:px-4","pill-sm":"h-8 rounded-full px-3.5 text-[12.5px] has-[>svg]:px-3",icon:"size-10","icon-sm":"size-8","icon-lg":"size-11"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef(function(e,t){let{className:n,variant:o="default",size:d="default",asChild:u=!1,isLoading:h=!1,children:g,disabled:p,onClick:m,...f}=e,b=p||h,_=(0,r.jsx)(s.zM5,{"aria-hidden":"true",className:"h-4 w-4 animate-spin"}),x=(0,l.cn)(c({variant:o,size:d,className:n}));if(u){let e=a.Children.only(g);return(0,r.jsx)(i.g7,{ref:t,"data-slot":"button","data-variant":
1o,"data-size":d,className:(0,l.cn)(x,b&&"pointer-events-none opacity-50"),"aria-disabled":b||void 0,"aria-busy":h||void 0,...f,tabIndex:b?-1:f.tabIndex,onClick:e=>{if(b){e.preventDefault();return}null==m||m(e)},children:b?a.cloneElement(e,{onClick:e=>{e.preventDefault(),e.stopPropagation()},tabIndex:-1},h?(0,r.jsxs)(r.Fragment,{children:[_,e.props.children]}):e.props.children):e})}return(0,r.jsxs)("button",{ref:t,"data-slot":"button","data-variant":o,"data-size":d,className:x,disabled:b,"aria-busy":h||void 0,onClick:m,...f,children:[h&&_,g]})})},92827:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(57437),a=n(2265),i=n(93448);function o(e){let{className:t,type:n,label:o,error:s,id:l,...c}=e,d=a.useId(),u=l||d,h="".concat(u,"-error"),g=[c["aria-describedby"],s?h:void 0].filter(Boolean).join(" ")||void 0;return(0,r.jsxs)("div",{className:"w-full",children:[o&&(0,r.jsx)("label",{htmlFor:u,className:"flex items-center gap-2 text-[13px] leading-none font-medium select-none mb-1.5 text-foreground",children:o}),(0,r.jsx)("input",{type:n,id:u,"data-slot":"input",className:(0,i.cn)("file:text-foreground placeholder:text-stone-500 selection:bg-stone-900 selection:text-white border! border-[#d4d4da]! h-11 md:h-10 w-full min-w-0 rounded-lg bg-white px-3 py-1 text-base md:text-sm transition-colors outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:bg-stone-50 disabled:opacity-60","focus-visible:border-primary! focus-visible:ring-2 focus-visible:ring-primary/15","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",s&&"border-destructive! focus-visible:border-destructive! focus-visible:ring-destructive/20",t),...c,"aria-invalid":!!s||c["aria-invalid"],"aria-describedby":g}),s&&(0,r.jsx)("p",{id:h,role:"alert",className:"mt-1.5 text-[13px] text-destructive",children:s})]})}},98734:function(e,t,n){"use strict";n.d(t,{a:function(){return d}});var r=n(2265),a=n(29827),i=n(11713),o=n(21770),s=n(18547),l=n(71837);function c(){return(0,s.Kz)()}function d(){let e=(0,a.NL)(),[t,n]=(0,r.useState)(!1),[d,u]=(0,r.useState)(c);(0,r.useEffect)(()=>{u((0,s.Kz)()),n(!0)},[]);let{data:h,isLoading:g,error:p}=(0,i.a)({queryKey:["user"],queryFn:()=>l.h.getMe(),enabled:d,retry:!1}),m=!t||d&&g,f=(0,o.D)({mutationFn:()=>l.h.logout(),onSuccess:()=>{e.clear(),u(!1),window.location.href="/login"}});return{user:h,isLoading:m,isAuthenticated:d,error:p,login:()=>{let e="347556150545-eie1mq85laq4rptu38nl4j6t0pb6e8ti.apps.googleusercontent.com";if(!e){console.error("Google Client ID is not configured");return}let t=new URLSearchParams({client_id:e,redirect_uri:"".concat(window.location.origin,"/api/auth/google/callback"),response_type:"code",scope:"openid email profile https://www.googleapis.com/auth/firebase.readonly",access_type:"offline",prompt:"consent"});window.location.href="https://accounts.google.com/o/oauth2/v2/auth?".concat(t.toString())},logout:()=>{f.mutate()}}}},94371:function(e,t,n){"use strict";n.d(t,{D_:function(){return i},L9:function(){return a},MI:function(){return s},s6:function(){return r},wb:function(){return l}});let r={VIEW_LOGIN:"view_login",AUTH_STARTED:"auth_started",LOGIN:"login",SIGN_UP:"sign_up",ONBOARDING_STEP:"onboarding_step",ONBOARDING_COMPLETED:"onboarding_completed",CAMPAIGN_BUILDER_OPENED:"campaign_builder_opened",CAMPAIGN_TEMPLATE_SELECTED:"campaign_template_selected",CAMPAIGN_THREAD_STARTED:"campaign_thread_started",CAMPAIGN_MESSAGE_SENT:"campaign_message_sent",CAMPAIGN_SAMPLES_GENERATED:"campaign_samples_generated",CAMPAIGN_CREATED:"campaign_created",CAMPAIGN_ACTIVATED:"campaign_activated"};function a(e,t){var n,r;let a=t?Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return null!=t})):{};try{null===(n=(r=window).gtag)||void 0===n||n.call(r,"event",e,a),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:e,...a})}catch(e){}}function i(e,t){try{var n,r;null===(n=(r=window).gtag)||void 0===n||n.call(r,"event","page_view",{page_path:e,page_location:window.location.href,page_title:null!=t?t:document.title})}catch(e){}}let o="pp_auth_intent";function s(e){try{window.sessionStorage.setItem(o,e)}catch(e){}}function l(){try{let e=window.sessionStorage.getItem(o);return e&&window.sessionStorage.removeItem(o),"signup"===e||"signin"===e?e:null}catch(e){return null}}},18547:function(e,t,n){"use strict";n.d(t,{BV:function(){return a},Kz:function(){return i}});var r=n(64131);function a(e,t){r.Z.set("access_token",e,{expires:1}),r.Z.set("refresh_token",t,{expires:365})}function i(){return!!(r.Z.get("access_token")||r.Z.get("refresh_token"))}},73547:function(e,t,n){"use strict";n.d(t,{_G:function(){return a},cZ:function(){return i},fK:function(){return o},fN:function(){return s}});let r="pp_auth_destination";function a(e){if(!e||!/^\/(dashboard|super-admin)(?:[/?#]|$)/.test(e)||/[\\\u0000-\u0020]/.test(e))return null;try{let t=new URL(e,"https://pushpilot.local");if(decodeURIComponent(t.pathname)!==t.pathname||!/^\/(dashboard|super-admin)(?:\/|$)/.test(t.pathname))return null;return"".concat(t.pathname).concat(t.search).concat(t.hash)}catch(e){return null}}function i(e){try{let t=a(e);t?sessionStorage.setItem(r,JSON.stringify({path:t,at:Date.now()})):sessionStorage.removeItem(r)}catch(e){}}function o(){try{let e=JSON.parse(sessionStorage.getItem(r)||"null");if(!e||"number"!=typeof e.at||Date.now()-e.at>18e5||e.at>Date.now())return null;return a(e.path)}catch(e){return null}}function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/dashboard",t=o();try{sessionStorage.removeItem(r)}catch(e){}return t||a(e)||"/dashboard"}},93448:function(e,t,n){"use strict";n.d(t,{Qm:function(){return h},cn:function(){return i},o0:function(){return s},p6:function(){return o},rl:function(){return u},uf:function(){return d},xG:function(){return l},yV:function(){return c},z2:function(){return g}});var r=n(61994),a=n(53335);function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,a.m6)((0,r.W)(t))}function o(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}
1function s(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD";return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e/100)}function c(e){let t=e.trim();try{let e=t.startsWith("market://")?t.replace("market://","https://market.android.com/"):t,n=new URL(e),r=n.searchParams.get("id");if(r&&("play.google.com"===n.hostname||"market.android.com"===n.hostname))return r}catch(e){}return t}function d(e){return new Intl.NumberFormat("en-US").format(e)}function u(e){return"".concat(e.toFixed(1),"%")}function h(e){return e.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)}function g(e){return({active:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",draft:"bg-stone-100 text-stone-600 dark:bg-stone-800 dark:text-stone-400",paused:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",completed:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",scheduled:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",sent:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",failed:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",cancelled:"bg-stone-100 text-stone-500 dark:bg-stone-800 dark:text-stone-400",paid:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400"}
1)[e.toLowerCase()]||"bg-stone-100 text-stone-600 dark:bg-stone-800 dark:text-stone-400"}},88185:function(e){e.exports={shell:"Auth_shell__PoP9k",entry:"Auth_entry__bbOQA",logo:"Auth_logo__a9GCR",content:"Auth_content__tGKOj",form:"Auth_form__vzY7a",modeSwitch:"Auth_modeSwitch__UG_1b",codeActions:"Auth_codeActions__OOj2z",heading:"Auth_heading__aWPR3",consent:"Auth_consent__Wt09Z",legal:"Auth_legal__fKksn",divider:"Auth_divider__JVIqF",emailForm:"Auth_emailForm__WPLTx",helper:"Auth_helper__l3UAo",error:"Auth_error__F7aZ2",footer:"Auth_footer__z2dtb",scene:"Auth_scene__PvyX2",landscape:"Auth_landscape__oMzIo",sceneCopy:"Auth_sceneCopy__P3539",campaign:"Auth_campaign__ML6GH",campaignTop:"Auth_campaignTop__Gmxln",campaignBrief:"Auth_campaignBrief__CQt4h",campaignSteps:"Auth_campaignSteps__BwseH",notification:"Auth_notification__kRuqa",appIcon:"Auth_appIcon__sU10I",sceneNote:"Auth_sceneNote__fCvoq",loading:"Auth_loading__OyGhY"}}},function(e){e.O(0,[3354,6137,5607,9919,1713,1866,1150,1837,2971,2117,1744],function(){return e(e.s=83991)}),_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.