1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="792d2f2f-48ec-84cd-97bf-02867dd90e60")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,557951,890610,178485,e=>{"use strict";var t=e.i(247167),r=e.i(843476),i=e.i(271645);e.i(151718);var n=e.i(618357),a=e.i(959141);function o(e){return e.toUpperCase().replace(/[\s-]/g,"")}function l(e){let t=o(e);return/^[A-Z0-9]{6}$/.test(t)&&/[A-Z]/.test(t)}function u(e){if(!e)return[];let t=e.ownerName?.trim(),r=(e.memberNames??[]).map(e=>e.trim()).filter(Boolean);if(!t)return r;let i=t.toLowerCase();return[t,...r.filter(e=>e.toLowerCase()!==i)]}function s(e){return e?.memberCount?Math.max(e.memberCount+ +!!e.ownerName?.trim()-u(e).length,0):0}e.s(["getHiddenInvitationMemberCount",()=>s,"getInvitationMemberNames",()=>u,"isCompanyInviteCode",()=>l,"normalizeInviteCode",()=>o],890610);let c="pending-signup-invitation-code";function d(e){if(!e)return null;let t=o(e);return l(t)?t:null}function p(e){return d(e.get("invite_code"))??d(e.get("inviteCode"))??d(e.get("code"))}function f(){try{let e=new URL(window.location.href),t=p(e.searchParams);if(t)return t;let r=e.pathname.split("/").filter(Boolean),i=r.indexOf("accept_invite");if(i<0)return null;return d(r[i+1])}catch{return null}}function m(e){let t=d(e);if(t)try{window.sessionStorage.setItem(c,t)}catch{}}function h(){try{let e=d(window.sessionStorage.getItem(c));return e||window.sessionStorage.removeItem(c),e}catch{return null}}function g(){try{window.sessionStorage.removeItem(c)}catch{}}e.s(["clearPendingSignupInvitationCode",()=>g,"getSignupInvitationCodeFromCurrentLocation",()=>f,"getSignupInvitationCodeFromSearchParams",()=>p,"readPendingSignupInvitationCode",()=>h,"storePendingSignupInvitationCode",()=>m],178485);var v=e.i(915998);let b=(0,i.createContext)(void 0),w="true"===t.default.env.NEXT_PUBLIC_E2E_AUTH,A="e2e-auth-session";async function N(e){var t,r,i;let n=await v.proApi.getPrimaryProContact({proHid:e.proHid,phoneNumber:e.phoneNumber});return t=n?.fullName??"",r=n?.trade??"",i=n?.contactId,{proHid:e.proHid,contactId:i,uid:e.uid,fullName:t,trade:r,email:e.email,phoneNumber:e.phoneNumber,onboardingStatus:e.onboardingStatus,appLanguage:e.appLanguage,isActive:e.isActive}}function y({children:e}){let[t,o]=(0,i.useState)(null),[l,u]=(0,i.useState)(null),[s,c]=(0,i.useState)(!0),[d,p]=(0,i.useState)(!1),[y,P]=(0,i.useState)(null),C=(0,i.useCallback)(async e=>{try{let t=await v.proApi.getProByUid(e);if(t&&t.proHid>0){let e=await N(t);return u(e),e}return t&&t.proHid<=0&&console.error("[Auth] getProByUid returned invalid proHid:",t.proHid),null}catch(e){return console.error("Error checking server user:",e),null}},[]);(0,i.useEffect)(()=>{let e=function(){if(!w)return null;let e=window.localStorage.getItem(A);if(!e)return null;try{return JSON.parse(e)}catch{return null}}();if(e){o({uid:e.uid,displayName:e.displayName??null,email:e.email??null,phoneNumber:e.phoneNumber??null}),P(null),u({proHid:12524,contactId:12524,uid:e.uid,fullName:e.displayName??"",trade:"",email:e.email??"",phoneNumber:e.phoneNumber??"",onboardingStatus:"active",appLanguage:"en",isActive:!0}),C(e.uid).finally(()=>{c(!1)});return}if(!(0,a.isFirebaseConfigured)()){o(null),u(null),p(!1),P(null),c(!1);return}let t=(0,a.getFirebaseAuth)(),r=(0,n.onAuthStateChanged)(t,async e=>{if(o(e),e){let t=await C(e.uid);if(t){if(g(),P(null),!t.fullName&&e.displayName){let r={...t,fullName:e.displayName};await v.proApi.updateProContactName({fullName:e.displayName,phoneNumber:t.phoneNumber,contactId:t.contactId,proHid:t.proHid})&&u(r)}}else{let t=h()??f();t&&m(t);let r=await v.proApi.createProContactBySignup(e.phoneNumber||"");if(!r){console.error("[Auth] Failed to create pro contact during signup"),c(!1);return}e.displayName&&await v.proApi.updateProContact({contactId:r,fullName:e.displayName});let i=await v.proApi.linkProContactToProHid(r);if(!i){console.error("[Auth] Failed to link pro contact to proHid during signup"),c(!1);return}let n=await v.proApi.createProAccount({proHid:i,uid:e.uid,email:e.email||"",phoneNumber:e.phoneNumber||"",inviteCode:t??void 0});if(n){g(),P(t);let i=await N(n);!(i={...i,contactId:i.contactId??r}).fullName&&e.displayName&&await v.proApi.updateProContactName({fullName:e.displayName,phoneNumber:i.phoneNumber,contactId:r,proHid:i.proHid})&&(i={...i,fullName:e.displayName}),u(i),p(!i.fullName||!i.trade)}}}else u(null),p(!1),P(null),g();c(!1)});return()=>r()},[C]);let S=async()=>
2{if(w&&1){window.localStorage.removeItem(A),g(),P(null),o(null),u(null),p(!1);return}if(!(0,a.isFirebaseConfigured)()){g(),P(null),o(null),u(null),p(!1);return}let e=(0,a.getFirebaseAuth)();await (0,n.signOut)(e),g(),P(null),u(null),p(!1)};return(0,r.jsx)(b.Provider,{value:{user:t,serverUser:l,loading:s,isNewUser:d,usedSignupInvitationCode:y,signOut:S,checkServerUser:C,setServerUser:u,setIsNewUser:p},children:e})}function P(){let e=(0,i.useContext)(b);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}e.s(["AuthProvider",()=>y,"useAuth",()=>P],557951)},265814,e=>{"use strict";e.i(557951),e.s([])},297618,e=>{"use strict";let t=/target_total_seats\s*\((\d+)\)\s*cannot be lower than active members\s*\((\d+)\)/i,r=/cannot switch to a non-team plan while company has\s+(\d+)\s+active members/i,i=/seat capacity exceeded\.\s*total seats:\s*(\d+),\s*active members:\s*(\d+)/i;function n(e){let t=Number(e);return Number.isInteger(t)&&t>0?t:null}function a(e){return e?.toLowerCase().includes("scheduled_plan_change_already_exists")??!1}function o(e){if(!e)return null;let a=t.exec(e);if(a){let e=n(a[1]),t=n(a[2]);if(e&&t)return{targetSeatCount:e,activeMemberCount:t}}let o=r.exec(e);if(o){let e=n(o[1]);if(e)return{targetSeatCount:1,activeMemberCount:e}}let l=i.exec(e);if(l){let e=n(l[1]),t=n(l[2]);if(e&&t)return{targetSeatCount:e,activeMemberCount:t}}return null}e.s(["isScheduledPlanChangeAlreadyExistsError",()=>a,"parseSeatMemberLimitError",()=>o])},250623,e=>{"use strict";var t=e.i(247167),r=e.i(843476),i=e.i(271645),n=e.i(557951),a=e.i(924944),o=e.i(919469),l=e.i(451065);let u=(0,i.createContext)(void 0),s="Unable to verify active plan";function c(){return"true"===t.default.env.NEXT_PUBLIC_E2E_AUTH}function d({children:e}){let{serverUser:t}=(0,n.useAuth)(),d=(0,i.useRef)(null),p=(0,i.useRef)(0),[f,m]=(0,i.useState)(null),[h,g]=(0,i.useState)(!1),[v,b]=(0,i.useState)(null);d.current=t?.proHid??null;let w=!!(t&&f&&!f.hasAccess&&!c()),A=(0,i.useCallback)(()=>{p.current+=1,m(null),g(!1),b(null),(0,o.setProWebWriteMode)("unknown")},[]),N=(0,i.useCallback)(async()=>{if(!t?.proHid||c())return A(),null;let e=t.proHid,r=p.current+1;p.current=r;let i=()=>p.current===r&&d.current===e;g(!0),b(null),(0,o.setProWebWriteMode)("checking","Checking subscription access");try{let[t,r]=await Promise.all([l.planApi.getSubscriptionAccess(e),l.planApi.getTrialStatus(e)]);if(!i())return null;if(!t)return m(null),(0,o.setProWebWriteMode)("read_only",s),null;let n=await l.planApi.getSubscriptionManagementDetails(e,t,r);if(!i())return null;let u={...(0,a.mergeSubscriptionAccessManagement)(t,n),hasActiveTrial:r?.hasActiveTrial===!0,trialRemainingDays:r?.hasActiveTrial===!0?r.trialRemainingDays:null};return m(u),(0,o.setProWebWriteMode)(u.hasAccess?"writable":"read_only",u.hasAccess?"":"No active plan"),u}catch(e){if(!i())return null;return console.error("[Subscription] Failed to refresh access:",e),b("Failed to load subscription access"),(0,o.setProWebWriteMode)("read_only",s),null}finally{i()&&g(!1)}},[A,t?.proHid]);return(0,i.useEffect)(()=>!t?.proHid||c()?void A():(N(),()=>{p.current+=1}),[A,N,t?.proHid]),(0,r.jsx)(u.Provider,{value:{access:f,loading:h,error:v,readOnlyMode:w,refreshAccess:N,clearAccess:A},children:e})}function p(){let e=(0,i.useContext)(u);if(void 0===e)throw Error("useSubscription must be used within a SubscriptionProvider");return e}e.s(["SubscriptionProvider",()=>d,"useSubscription",()=>p])},175696,e=>{"use strict";var t=e.i(861745),r=e.i(843476);function i({locale:e,...i}){if(!e)throw Error(void 0);return(0,r.jsx)(t.IntlProvider,{locale:e,...i})}e.s(["default",()=>i])},514950,e=>{"use strict";let t=!1;function r(){t=!0}function i(){let e=t;return t=!1,e}e.s(["consumeProAppHandoffArrival",()=>i,"markProAppHandoffArrival",()=>r])},544636,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(151718);var i=e.i(618357),n=e.i(557951),a=e.i(843094),o=e.i(250623);e.i(265814);var l=e.i(959141),u=e.i(514950),s=e.i(451065);function c({children:e}){let{checkServerUser:a}=(0,n.useAuth)(),[o,c]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{let e=new URL(window.location.href),t=e.searchParams.get("handoff")?.trim();if(!t){e.searchParams.has("handoff")&&(e.searchParams.delete("handoff"),window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`));return}let r=!1,n=()=>{e.searchParams.delete("handoff"),window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`)};return(async()=>{c(!0);try{if(!(0,l.isFirebaseConfigured)())throw Error("firebase_not_configured");let e=await s.planApi.exchangeProWebLoginSession(t);if(!e)throw Error("handoff_exchange_failed");let r=await (0,i.signInWithCustomToken)((0,l.getFirebaseAuth)(),e);if(!await a(r.user.uid))throw Error("handoff_user_missing");(0,u.markProAppHandoffArrival)(),n()}catch(e){console.error("[ProWeb] login handoff failed:",e),n()}finally{r||c(!1)}})(),()=>{r=!0}},[a]),o)?(0,t.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-white text-sm text-gray-500",children:"Loading..."}):(0,t.jsx)(t.Fragment,{children:e})}function d({children:e}){return(0,r.useEffect)(()=>{(0,l.initializeFirebaseAppCheck)()},[]),(0,t.jsx)(n.AuthProvider,{children:(0,t.jsx)(c,{children:(0,t.jsx)(o.SubscriptionProvider,{children:(0,t.jsx)(a.CompanyProvider,{children:e})})})})}e.s(["Providers",()=>d])},497570,e=>{e.v(t=>Promise.all(["static/chunks/e83106aa67871ac1.js"].map(t=>e.l(t))).then(()=>t(536241)))}]); 3 4//# debugId=792d2f2f-48ec-84cd-97bf-02867dd90e60
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.