PageSourceSearch

https://www.vibepair.ai/_next/static/chunks/476-6802bcb07c91126a.js?dpl=dpl_HoTRX7FfCo3eBp16xzNLVqTTk1g3

js vibepair.ai collected 2026-10-05 13:14:55 UTC 6,990 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[476],{1476:(e,t,n)=>{n.d(t,{hG:()=>I,BG:()=>R});var r=n(2432),l=n(647),a=n(1170),o=n(364);let i=Object.prototype.toString,u=e=>"[object Error]"===i.call(e),s=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]),c=[500,2e3],d=(0,o.createContext)(void 0),h=(0,o.createContext)(void 0);function g(){return(0,o.useContext)(h)}let f=(0,o.createContext)(null),w="__convexAuthOAuthVerifier",v="__convexAuthJWT",k="__convexAuthRefreshToken",m="__convexAuthServerStateFetchTime";function y({client:e,serverState:t,onChange:n,shouldHandleCode:l,storage:a,storageNamespace:i,replaceURL:g,children:y}){let _=(0,o.useRef)(t?._state.token??null),[x,C]=(0,o.useState)(null===_.current),[S,R]=(0,o.useState)(_.current),I=e.verbose??!1,T=(0,o.useCallback)(t=>{I&&(console.debug(`${new Date().toISOString()} ${t}`),e.logger?.logVerbose(t))},[I]),{storageSet:$,storageGet:E,storageRemove:M,storageKey:P}=function(e,t){let n=function(){let[e,t]=(0,o.useState)({});return()=>({getItem:t=>e[t],setItem:(e,n)=>{t(t=>({...t,[e]:n}))},removeItem:e=>{t(t=>{let{[e]:n,...r}=t;return r})}})}(),r=(0,o.useMemo)(()=>e??n(),[e]),l=t.replace(/[^a-zA-Z0-9]/g,""),a=(0,o.useCallback)(e=>`${e}_${l}`,[t]),i=(0,o.useCallback)((e,t)=>r.setItem(a(e),t),[r,a]);return{storageSet:i,storageGet:(0,o.useCallback)(e=>r.getItem(a(e)),[r,a]),storageRemove:(0,o.useCallback)(e=>r.removeItem(a(e)),[r,a]),storageKey:a}}(a,i),[L,j]=(0,o.useState)(!1),N=(0,o.useCallback)(async e=>{let t;let r=null!==_.current;if(null===e.tokens)_.current=null,e.shouldStore&&(await M(v),await M(k)),t=null;else{let{token:n}=e.tokens;if(_.current=n,e.shouldStore){let{refreshToken:t}=e.tokens;await $(v,n),await $(k,t)}t=n}r!==(null!==t)&&await n?.(),R(t),C(!1)},[$,M]);(0,o.useEffect)(()=>{let e=async e=>{if(L)return e.preventDefault(),e.returnValue=!0,"Are you sure you want to leave? Your changes may not be saved."};return p("beforeunload",e),()=>{A("beforeunload",e)}}),(0,o.useEffect)(()=>{let e=e=>{(async()=>{if(e.storageArea===a&&e.key===P(v)){let t=e.newValue;T(`synced access token, is null: ${null===t}`),await N({shouldStore:!1,tokens:null===t?null:{token:t}})}})()};return p("storage",e),()=>A("storage",e)},[N]);let F=(0,o.useCallback)(async t=>{let n;let r=0;for(;r<c.length;)try{return await e.unauthenticatedCall("auth:signIn","code"in t?{params:{code:t.code},verifier:t.verifier}:t)}catch(t){if(n=t,!(t&&u(t)&&"TypeError"===t.name&&"string"==typeof t.message&&("Load failed"===t.message?void 0===t.stack:s.has(t.message))))break;let e=c[r]+100*Math.random();r++,T(`verifyCode failed with network error, retry ${r} of ${c.length} in ${e}ms`),await new Promise(t=>setTimeout(t,e))}throw n},[e]),O=(0,o.useCallback)(async e=>{let{tokens:t}=await F(e);return T(`retrieved tokens, is null: ${null===t}`),await N({shouldStore:!0,tokens:t??null}),null!==t},[e,N]),U=(0,o.useCallback)(async(t,n)=>{let r=n instanceof FormData?Array.from(n.entries()).reduce((e,[t,n])=>(e[t]=n,e),{}):n??{},l=await E(w)??void 0;await M(w);let a=await e.authenticatedCall("auth:signIn",{provider:t,params:r,verifier:l});if(void 0!==a.redirect){let e=new URL(a.redirect);return await $(w,a.verifier),"ReactNative"!==navigator.product&&(window.location.href=e.toString()),{signingIn:!1,redirect:e}}if(void 0!==a.tokens){let{tokens:e}=a;return T(`signed in and got tokens, is null: ${null===e}`),await N({shouldStore:!0,tokens:e}),{signingIn:null!==a.tokens}}return{signingIn:!1}},[e,N,E]),V=(0,o.useCallback)(async()=>{try{await e.authenticatedCall("auth:signOut")}catch(e){}T("signed out, erasing tokens"),await N({shouldStore:!0,tokens:null})},[N,e]),D=(0,o.useCallback)(async({forceRefreshToken:e})=>{if(e){let e=_.current;return await b(k,async()=>{let t=_.current;if(t!==e)return T(`returning synced token, is null: ${null===t}`),t;let n=await E(k)??null;return null!==n?(j(!0),await O({refreshToken:n}).finally(()=>{j(!1)}),T(`returning retrieved token, is null: ${null===t}`),_.current):(j(!1),T("returning null, there is no refresh token"),null)})}return _.current},[O,V,E]),G=(0,o.useRef)(!1);(0,o.useEffect)(()=>
1{if(void 0===a)throw Error("`localStorage` is not available in this environment, set the `storage` prop on `ConvexAuthProvider`!");let e=async()=>{let e=await E(v)??null;T(`retrieved token from storage, is null: ${null===e}`),await N({shouldStore:!1,tokens:null===e?null:{token:e}})};if(void 0!==t){let n=E(m),r=n=>{if(!n||t._timeFetched>+n){let{token:e,refreshToken:n}=t._state;$(m,t._timeFetched.toString()),N({tokens:null===e||null===n?null:{token:e,refreshToken:n},shouldStore:!0})}else e()};n instanceof Promise?n.then(r):r(n);return}let n=void 0!==window?.location?.search?new URLSearchParams(window.location.search).get("code"):null;if(G.current||n){if(n&&!G.current&&(!l||l())){G.current=!0;let e=new URL(window.location.href);e.searchParams.delete("code"),(async()=>{await g(e.pathname+e.search+e.hash),await U(void 0,{code:n}),G.current=!1})()}}else e()},[e,E]);let q=(0,o.useMemo)(()=>({signIn:U,signOut:V}),[U,V]),z=null!==S,B=(0,o.useMemo)(()=>({isLoading:x,isAuthenticated:z,fetchAccessToken:D}),[D,x,z]);return(0,r.jsx)(h.Provider,{value:B,children:(0,r.jsx)(d.Provider,{value:q,children:(0,r.jsx)(f.Provider,{value:S,children:y})})})}async function b(e,t){let n=window?.navigator?.locks;return void 0!==n?await n.request(e,t):await S(e,t)}function _(e){void 0===globalThis.__convexAuthMutexes&&(globalThis.__convexAuthMutexes={});let t=globalThis.__convexAuthMutexes[e];return void 0===t&&(globalThis.__convexAuthMutexes[e]={currentlyRunning:null,waiting:[]}),t=globalThis.__convexAuthMutexes[e]}function x(e,t){globalThis.__convexAuthMutexes[e]=t}async function C(e,t){let n=_(e);null===n.currentlyRunning?x(e,{currentlyRunning:t().finally(()=>{let t=_(e).waiting.shift();_(e).currentlyRunning=null,x(e,{..._(e),currentlyRunning:void 0===t?null:C(e,t)})}),waiting:[]}):x(e,{...n,waiting:[...n.waiting,t]})}async function S(e,t){return new Promise((n,r)=>{C(e,()=>t().then(e=>n(e)).catch(e=>r(e)))})}function p(e,t,n){window.addEventListener?.(e,t,n)}function A(e,t,n){window.removeEventListener?.(e,t,n)}function R(){return(0,o.useContext)(d)}function I(e){var t;let{client:n,storage:i,storageNamespace:u,replaceURL:s,shouldHandleCode:c,children:d}=e,h=(0,o.useMemo)(()=>{var e;return{authenticatedCall:(e,t)=>n.action(e,t),unauthenticatedCall:(e,t)=>new l.Tb(n.address,{logger:n.logger}).action(e,t),verbose:null===(e=n.options)||void 0===e?void 0:e.verbose,logger:n.logger}},[n]);return(0,r.jsx)(y,{client:h,storage:null!=i?i:"undefined"==typeof window?void 0:null===(t=window)||void 0===t?void 0:t.localStorage,storageNamespace:null!=u?u:n.address,replaceURL:null!=s?s:e=>{window.history.replaceState({},"",e)},shouldHandleCode:c,children:(0,r.jsx)(a.N2,{client:n,useAuth:g,children:d})})}}}]);

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.