1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8c44c779-eb2a-5f7b-9cb8-8ae8e60132b0")}catch(e){}}(); 3(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,697971,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(58718).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},206223,e=>{"use strict";e.s(["X",()=>t.default]);var t=e.i(697971)},946416,e=>{"use strict";e.s(["QUERY_KEYS",()=>t]);let t={AUTH:{USER:["auth-user"],USER_DETAILS:e=>["user-details",e],CONNECTED_ACCOUNTS:e=>["user",e,"connected-accounts"],PENDING_INVITATIONS:["user","pending-invitations"]},USER:{TAGS:e=>["user",e,"tags"],CREDITS:["user","credits"]},TAGS:{RECOMMENDED:(e,t)=>["tags","recommended",e,t]},LOOPS:{ALL:(e,t)=>["loops",e,t,"all"],ACTIVE:(e,t)=>["loops",e,t,"active"],PAUSED:(e,t)=>["loops",e,t,"paused"],COMPLETED:(e,t)=>["loops",e,t,"completed"]},NOTIFICATIONS:{ALL:(e,t)=>["notifications",e,t]},EMAIL_PREFERENCES:e=>["email-preferences",e],POSTS:{ALL:(e,t)=>["posts",e,t,"all"],RECENT:(e,t)=>{var r,a;return["posts",e,"recent",null==t||null==(r=t.from)?void 0:r.toISOString(),null==t||null==(a=t.to)?void 0:a.toISOString()]},ANALYTICS:(e,t)=>{var r,a;return["posts",e,"analytics",null==t||null==(r=t.from)?void 0:r.toISOString(),null==t||null==(a=t.to)?void 0:a.toISOString()]},CALENDAR:(e,t)=>["posts",e,t,"calendar"],CALENDAR_RANGE:(e,t,r,a)=>["posts",e,t,"calendar",r,a],FREQUENCY:e=>["posts",e,"frequency"]},INSIGHTS:(e,t)=>["insights",e,t],THREADS:{DETAILS:(e,t)=>["threads-details",e,t],REPLIES:{LIST:(e,t)=>["threads","replies","list",e,t],CONVERSATION:(e,t)=>["threads","replies","conversation",e,t],CREATE:(e,t)=>["threads","replies","create",e,t],HIDE:(e,t)=>["threads","replies","hide",e,t],REPOST:(e,t)=>["threads","replies","repost",e,t],QUOTE:(e,t)=>["threads","replies","quote",e,t]}},TRENDING:{TOPICS:e=>["trending","topics",e],KEYWORDS:e=>["trending","keywords",e],FILTERS:(e,t,r,a,n,i,o)=>["trending","filters",e,t,r,a,n,i,o]},DEV_AGENT_NOTIFICATION_CATALOG:["dev","agent-notification-catalog"]}},471585,555370,e=>{"use strict";e.s(["AuthProvider",()=>M,"useAuth",()=>D],471585);var t=e.i(991741),r=e.i(337884);e.s(["applyUserDetailsOverride",()=>y,"applyWorkspaceRoleOverride",()=>E,"clearDebugErrors",()=>u,"disableDebugToolbar",()=>l,"enableDebugToolbar",()=>s,"formatBytes",()=>c,"getWorkspaceRoleOverride",()=>I,"hasUserDetailsOverride",()=>S,"hasWorkspaceRoleOverride",()=>b,"initializeDebugHooks",()=>g,"isDebuggerRegistered",()=>o,"isForceOnboardingModeEnabled",()=>A,"isMobile",()=>h,"isPWA",()=>f,"isProduction",()=>m,"isSafari",()=>p,"logDebugError",()=>d,"registerDebugger",()=>n,"restoreUserDetailsOverride",()=>w,"restoreWorkspaceRoleOverride",()=>_,"unregisterDebugger",()=>i],555370);var a=e.i(946416);let n=e=>{try{localStorage.setItem("enable".concat(e,"Debugger"),"true")}catch(t){console.error("Failed to register ".concat(e," debugger:"),t)}},i=e=>{try{localStorage.removeItem("enable".concat(e,"Debugger"))}catch(t){console.error("Failed to unregister ".concat(e," debugger:"),t)}},o=e=>{try{return"true"===localStorage.getItem("enable".concat(e,"Debugger"))}catch(t){return console.error("Failed to check if ".concat(e," debugger is registered:"),t),!1}},s=()=>{try{localStorage.setItem("enableDebugTools","true")}catch(e){console.error("Failed to enable debug toolbar:",e)}},l=()=>{try{localStorage.removeItem("enableDebugTools")}catch(e){console.error("Failed to disable debug toolbar:",e)}},c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(void 0===e)return"N/A";if(0===e)return"0 Bytes";let r=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,r)).toFixed(t<0?0:t))+" "+["Bytes","KB","MB","GB","TB"][r]},d=(e,t)=>{try{let r=localStorage.getItem("auth_errors"),a=[];if(r)try{a=JSON.parse(r)}catch(e){a=[]}a.unshift({type:e,timestamp:new Date().toISOString(),details:t}),a=a.slice(0,50),localStorage.setItem("auth_errors",JSON.stringify(a));let n=localStorage.getItem("auth_errors_count"),i=1;if(n)try{i=parseInt(n,10)+1}catch(e){i=1}localStorage.setItem("auth_errors_count",i.toString())}catch(e){console.error("Failed to log debug error:",e)}},u=()=>{try{localStorage.removeItem("auth_errors"),localStorage.removeItem("auth_errors_count")}catch(e){console.error("Failed to clear debug errors:",e)}},p=()=>
3{if("undefined"==typeof navigator)return!1;let e=navigator.userAgent.toLowerCase();return -1!==e.indexOf("safari")&&-1===e.indexOf("chrome")&&-1===e.indexOf("android")},f=()=>window.matchMedia("(display-mode: standalone)").matches||!0===window.navigator.standalone,h=()=>{let e="ontouchstart"in window||navigator.maxTouchPoints>0,t=window.innerWidth<=768,r=navigator.userAgent.toLowerCase(),a=/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(r);return e&&(t||a)},m=()=>{t.default.env.VERCEL_ENV;let e=window.location.hostname;return"bolta.ai"===e||"www.bolta.ai"===e||!e.endsWith(".bolta.ai")||e.includes("staging")||e.includes("dev")||e.includes("localhost"),!0},y=(e,t,r)=>{try{localStorage.setItem("debug_original_user_".concat(e),JSON.stringify(t)),localStorage.setItem("debug_user_override_".concat(e),JSON.stringify(r)),n("Auth");try{window.__BOLTA_DEBUG&&window.__BOLTA_DEBUG.updateUserDetails(r)}catch(e){console.error("[Debug] Failed to update React Query cache:",e)}}catch(e){console.error("Failed to apply user details override:",e)}},g=(e,t)=>{window.__BOLTA_DEBUG={queryClient:e,updateUserDetails:r=>{if(!(null==t?void 0:t.id))return;let n={__emptyConnectedAccounts:!0===r.__emptyConnectedAccounts,__emptyPosts:!0===r.__emptyPosts};n.__emptyConnectedAccounts||n.__emptyPosts?localStorage.setItem("debug_ui_flags_".concat(t.id),JSON.stringify(n)):localStorage.removeItem("debug_ui_flags_".concat(t.id));let i={...r};delete i.__emptyConnectedAccounts,delete i.__emptyPosts,e.setQueryData(a.QUERY_KEYS.AUTH.USER_DETAILS(t.id),i),setTimeout(()=>{e.invalidateQueries({queryKey:a.QUERY_KEYS.AUTH.USER_DETAILS(t.id),refetchType:"none"})},50)},getUIFlags:()=>{try{let e=localStorage.getItem("debug_ui_flags_".concat(t.id));return e?JSON.parse(e):{}}catch(e){return console.error("[Debug] Failed to get UI flags:",e),{}}}};try{let e=localStorage.getItem("debug_user_override_".concat(t.id));if(e&&S(t.id)){let t=JSON.parse(e);window.__BOLTA_DEBUG.updateUserDetails(t)}}catch(e){console.error("[Debug] Failed to apply stored overrides:",e)}},w=e=>{try{localStorage.removeItem("debug_user_override_".concat(e)),localStorage.removeItem("debug_original_user_".concat(e))}catch(e){console.error("Failed to restore original user details:",e)}},S=e=>{try{return!!localStorage.getItem("debug_user_override_".concat(e))}catch(e){return console.error("Failed to check user details override:",e),!1}},E=(e,t,r,a)=>{try{localStorage.setItem("debug_original_workspace_role_".concat(e,"_").concat(t),JSON.stringify(r)),localStorage.setItem("debug_workspace_role_override_".concat(e,"_").concat(t),JSON.stringify(a)),n("Auth")}catch(e){console.error("Failed to apply workspace role override:",e)}},_=(e,t)=>{try{localStorage.removeItem("debug_workspace_role_override_".concat(e,"_").concat(t)),localStorage.removeItem("debug_original_workspace_role_".concat(e,"_").concat(t))}catch(e){console.error("Failed to restore original workspace role:",e)}},b=(e,t)=>{try{return!!localStorage.getItem("debug_workspace_role_override_".concat(e,"_").concat(t))}catch(e){return console.error("Failed to check workspace role override:",e),!1}},I=(e,t)=>{try{let r=localStorage.getItem("debug_workspace_role_override_".concat(e,"_").concat(t));return r?JSON.parse(r):null}catch(e){return console.error("Failed to get workspace role override:",e),null}},A=()=>{try{return"true"===localStorage.getItem("debug_force_onboarding_mode")}catch(e){return console.error("Failed to check force onboarding mode:",e),!1}};
3var C=e.i(920755),k=e.i(161239),T=e.i(332978),U=e.i(548728),R=e.i(524910),O=e.i(796890),N=e.i(484264),P=e.i(870088);let x=(0,P.createContext)(void 0);function M(e){var t,a;let{children:n}=e,i=(0,P.useMemo)(()=>(0,C.createClient)(),[]),s=(0,O.useQueryClient)(),[l,c]=(0,P.useState)(!1),d=(0,N.useRouter)(),u=(0,N.usePathname)(),[p,f]=(0,P.useState)(null),[h,m]=(0,P.useState)(null),y=(0,P.useRef)(!1),w=(0,P.useRef)(!1),S=(0,P.useRef)(Date.now()),E=(0,P.useRef)({}),_=(0,P.useRef)({}),b=(0,P.useRef)(!1),I=e=>{var t,r,a,n,i,o;let s=null!=(o=null!=(i=null==e?void 0:e.status)?i:null==e||null==(t=e.response)?void 0:t.status)?o:null==e?void 0:e.statusCode,l=e instanceof Error&&(null==(r=e.message)?void 0:r.toLowerCase())||(null==e||null==(n=e.message)||null==(a=n.toLowerCase)?void 0:a.call(n))||"";return!!(401===s||l.includes("401")||l.includes("unauthorized"))||!!(403===s||l.includes("403")||l.includes("forbidden"))&&!(l.includes("permission denied")||l.includes("violates row-level security")||l.includes("workspace")||l.includes("rls"))},A=(0,P.useCallback)(async()=>{if(w.current)return!1;w.current=!0;try{let{data:{user:e}}=await i.auth.getUser();if((null==e?void 0:e.id)&&e.email)return await (0,U.syncUserWithBackend)(e.id,e.email),await Promise.allSettled([s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER_DETAILS(e.id)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(e.id)})]),!0}catch(e){console.error("Auth recovery via sync failed:",e)}return!1},[s,i]),M=(0,P.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Session expired. Please sign in again.";if(console.warn("[AuthProvider] handleAuthFailure triggered. Reason:",e),!w.current){if(await A()){y.current=!1,m(null);return}console.warn("[AuthProvider] Auth recovery failed.")}if(!y.current){console.error("[AuthProvider] Critical auth failure. Signing out user. Reason:",e),y.current=!0,m({code:403,message:e});try{localStorage.removeItem("supabase.auth.token")}catch(e){console.error("Failed clearing auth storage on auth failure",e)}try{await i.auth.signOut()}catch(e){console.error("Error signing out after auth failure:",e)}s.clear(),c(!1),f(null),d.replace("/signin?reason=session_expired")}},[A,s,d,i]);(0,P.useEffect)(()=>{(async()=>{if(window.location.hash){let r=new URLSearchParams(window.location.hash.substring(1)),a=r.get("access_token"),n=r.get("refresh_token");r.get("token_type");let o=r.get("type");if(a&&"magiclink"===o)try{let{data:r,error:o}=await i.auth.setSession({access_token:a,refresh_token:n||""});if(o)console.error("Error setting session from magic link:",o);else if(r.session){var e,t;f(r.session.access_token);let a=null==(e=r.session.user)?void 0:e.user_metadata,n=null==(t=r.session.user)?void 0:t.app_metadata;if((null==a?void 0:a.provider)==="linkedin"||(null==a?void 0:a.linkedin_id)||(null==n?void 0:n.provider)==="linkedin"||(null==a?void 0:a.full_name))try{localStorage.setItem("bolta_last_auth_method","linkedin")}catch(e){console.error("Failed to save last used auth method:",e)}window.history.replaceState(null,"",window.location.pathname);let i=window.location.search.includes("state=");if(("/signin"===window.location.pathname||"/register"===window.location.pathname)&&!i){try{await (0,U.syncUserWithBackend)(r.session.user.id,r.session.user.email)}catch(e){console.error("Magic-link sync failed (continuing to dashboard):",e)}d.replace("/dashboard")}}}catch(e){console.error("Magic link authentication error:",e)}}})()},[i,d]),(0,P.useEffect)(()=>{(async()=>{try{let{data:{session:e}}=await i.auth.getSession();if(f((null==e?void 0:e.access_token)||null),!(null==e?void 0:e.access_token)&&l){let{data:e}=await i.auth.refreshSession();e.session?f(e.session.access_token):c(!1)}}catch(e){console.error("Failed to get/refresh session:",e),c(!1),f(null),s.clear()}})();let{data:{subscription:e}}=i.auth.onAuthStateChange(async(e,t)=>{try{if(f((null==t?void 0:t.access_token)||null),!(null==t?void 0:t.access_token)&&l){let{data:e}=await i.auth.refreshSession();e.session&&f(e.session.access_token)}}catch(e){console.error("Auth state change error:",e)}});return()=>e.unsubscribe()},[i,l,s,d]);let{data:D,isLoading:L,error:q}=(0,R.useQuery)({queryKey:k.QUERY_KEYS.AUTH.USER,queryFn:async()=>{let e=Date.now(),{data:{user:t}}=await i.auth.getUser();return E.current.getUserMs=Date.now()-e,c(!0),t}});(0,P.useEffect)(()=>{S.current=Date.now(),E.current={},_.current={},b.current=!1},[null==D?void 0:D.id]),(0,P.useEffect)(()=>{D&&o("Auth")&&g(s,D)},[D,s]);let K=(0,R.useQuery)({queryKey:k.QUERY_KEYS.AUTH.USER_DETAILS(null==D?void 0:D.id),queryFn:async()=>{let e=Date.now();try{let t=await (0,U.fetchUserDetails)(null==D?void 0:D.id);E.current.userDetailsMs=Date.now()-e;let r=(0,U.getLatestAuthBootstrapRequestMeta)().userDetails;if(_.current.userDetailsRequestId=(null==r?void 0:r.requestId)||null,!t)throw Error("User details not found");return t}catch(e){throw console.error("Failed to fetch user details:",e),e}},enabled:!!(null==D?void 0:D.id),staleTime:18e4,gcTime:3e5,retry:(e,t)=>!I(t)&&e<2,retryDelay:e=>Math.min(3e3*2**e,15e3),refetchOnMount:!1,refetchOnWindowFocus:!1}),B=null!=(t=K.data)?t:null,Q=K.isLoading,Y=K.error;(0,P.useEffect)(()=>
3{(null==D?void 0:D.id)&&D.email&&(0,T.identifyUser)(D.id,{email:D.email})},[null==D?void 0:D.id,null==D?void 0:D.email]),(0,P.useEffect)(()=>{Y&&(console.error("User details query error:",Y),I(Y)&&M())},[Y,M]);let{data:F=[],isLoading:j}=(0,R.useQuery)({queryKey:k.QUERY_KEYS.AUTH.CONNECTED_ACCOUNTS(null==D?void 0:D.id),queryFn:async()=>{let e=Date.now(),t=await (0,U.fetchUserAccounts)(null==D?void 0:D.id);E.current.userAccountsMs=Date.now()-e;let r=(0,U.getLatestAuthBootstrapRequestMeta)().userAccounts;return _.current.userAccountsRequestId=(null==r?void 0:r.requestId)||null,t},enabled:!!(null==D?void 0:D.id),staleTime:12e4,gcTime:6e5,refetchOnWindowFocus:!1,retry:2,retryDelay:e=>Math.min(3e3*2**e,15e3)}),H=(0,R.useQuery)({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(null==D?void 0:D.id),queryFn:async()=>{let e=Date.now(),t=await (0,U.fetchUserWorkspaces)(null==D?void 0:D.id);E.current.workspacesMs=Date.now()-e;let r=(0,U.getLatestAuthBootstrapRequestMeta)().workspaces;return _.current.workspacesRequestId=(null==r?void 0:r.requestId)||null,t},enabled:!!(null==D?void 0:D.id),staleTime:12e4,gcTime:6e5,refetchOnWindowFocus:!1,retry:(e,t)=>!I(t)&&e<2,retryDelay:e=>Math.min(3e3*2**e,15e3)}),W=null!=(a=H.data)?a:[],$=H.isLoading,z=H.error;(0,P.useEffect)(()=>{z&&(console.error("Workspaces query error:",z),I(z)&&M())},[z,M]),(0,P.useEffect)(()=>{if(!(l&&D&&!L&&!Q&&!j&&!$&&B)||b.current)return;b.current=!0;let e=Date.now()-S.current;(0,T.captureEvent)("auth_bootstrap_complete",{userId:D.id,pathname:u,totalMs:e,...E.current,..._.current})},[l,D,B,L,Q,j,$,u]),(0,P.useEffect)(()=>{if((null==D?void 0:D.id)&&l&&1){let e=s.getQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(D.id)),t=s.getQueryData(k.QUERY_KEYS.AUTH.WORKSPACES(D.id)),r=!e||!t;(!sessionStorage.getItem("initial-refresh-".concat(D.id))||r)&&(r&&sessionStorage.removeItem("initial-refresh-".concat(D.id)),s.removeQueries({queryKey:k.QUERY_KEYS.AUTH.USER_DETAILS(D.id)}),s.removeQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(D.id)}),sessionStorage.setItem("initial-refresh-".concat(D.id),"true"),Promise.all([s.refetchQueries({queryKey:k.QUERY_KEYS.AUTH.USER_DETAILS(D.id),type:"active"}),s.refetchQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(D.id),type:"active"})]).catch(e=>{console.error("Error refetching user data on initial load:",e)}))}},[null==D?void 0:D.id,l,s]);let G=(0,P.useMemo)(()=>{if(Q||$||!B||!W||0===W.length)return null;let e=B.selected_workspace&&("object"==typeof B.selected_workspace?B.selected_workspace.id:B.selected_workspace);return e&&W.find(t=>String(t.id)===String(e))||null},[B,W,Q,$]);(0,P.useEffect)(()=>{(null==G?void 0:G.id)&&(0,T.groupWorkspace)(String(G.id))},[null==G?void 0:G.id]),(0,P.useEffect)(()=>{if(!l)return},[D,l,u,d]),(0,P.useEffect)(()=>{let{data:{subscription:e}}=i.auth.onAuthStateChange(async(e,t)=>{if("SIGNED_IN"===e&&(null==t?void 0:t.user)){var r,a,n;(null==(r=t.user.app_metadata)?void 0:r.provider)&&t.user.created_at!==t.user.updated_at?(0,T.captureEvent)("signin_completed",{userId:t.user.id,authProvider:(null==(n=t.user.app_metadata)?void 0:n.provider)||"email",isNewUser:!1}):(0,T.captureEvent)("signup_completed",{userId:t.user.id,authProvider:(null==(a=t.user.app_metadata)?void 0:a.provider)||"email",emailDomain:t.user.email?t.user.email.split("@")[1]:null}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER_DETAILS(t.user.id)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.CONNECTED_ACCOUNTS(t.user.id)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(t.user.id)}),(0,U.syncUserWithBackend)(t.user.id,t.user.email).then(()=>{s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER_DETAILS(t.user.id)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.CONNECTED_ACCOUNTS(t.user.id)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(t.user.id)})}).catch(e=>{console.error("Background user sync failed:",e)})}"SIGNED_OUT"===e&&(s.clear(),c(!1),f(null),(0,T.captureEvent)("user_signed_out",{location:u}))});return()=>e.unsubscribe()},[i,s,d,u]);let V=(0,P.useCallback)(()=>{(null==D?void 0:D.id)&&(s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER_DETAILS(D.id),refetchType:"all"}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.CONNECTED_ACCOUNTS(D.id),refetchType:"all"}),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(D.id),refetchType:"all"}),G&&(s.invalidateQueries({queryKey:k.QUERY_KEYS.TEAM.DETAILS(String(G.id)),refetchType:"all"}),s.invalidateQueries({queryKey:k.QUERY_KEYS.TEAM.MEMBERS(String(G.id)),refetchType:"all"}),s.invalidateQueries({queryKey:k.QUERY_KEYS.WORKSPACE.ACCOUNTS(String(G.id)),refetchType:"all"})),s.invalidateQueries({queryKey:k.QUERY_KEYS.AUTH.USER,refetchType:"all"}))},[null==D?void 0:D.id,null==G?void 0:G.id,s]),J=async(e,t)=>{try{await (0,U.switchSelectedAccount)(e,t),await V()}catch(e){throw console.error("Error switching account:",e),e}},Z=async(e,t)=>{var r,a,n,i;let o=s.getQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e)),l=s.getQueryData(k.QUERY_KEYS.AUTH.WORKSPACES(e)),c=null==o?void 0:o.selected_workspace,d=null==c?null:"string"==typeof c?c:"number"==typeof c?String(c):(null==c?void 0:c.id)!=null?String(c.id
3):null,u=null==l?void 0:l.find(e=>String(e.id)===String(t));if(o&&u&&s.setQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e),{...o,selected_workspace:u}),l&&Array.isArray(l)){let r=l.map(e=>({...e,isActive:String(e.id)===String(t)}));s.setQueryData(k.QUERY_KEYS.AUTH.WORKSPACES(e),r)}s.invalidateQueries({queryKey:k.QUERY_KEYS.WORKSPACE.POSTS(t)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.WORKSPACE.ACCOUNTS(t)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.WORKSPACE.ANALYTICS(t)}),d&&String(d)!==String(t)&&(s.invalidateQueries({queryKey:k.QUERY_KEYS.WORKSPACE.POSTS(d)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.WORKSPACE.ACCOUNTS(d)}),s.invalidateQueries({queryKey:k.QUERY_KEYS.WORKSPACE.ANALYTICS(d)}));try{let c=await (0,U.switchSelectedWorkspace)(t);if(c&&o){let t=u?{...u,id:c.id,name:c.name,type:null!=(r=c.type)?r:u.type,workspace_type:null!=(a=c.type)?a:u.workspace_type,isActive:!0}:{id:c.id,name:c.name,created_at:"",owner:"",safe_mode:!1,type:null!=(n=c.type)?n:"personal",workspace_type:null!=(i=c.type)?i:"personal",isActive:!0};s.setQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e),{...o,selected_workspace:t})}let d=()=>{var r;let a=s.getQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e));if(!a)return!0;let n="object"==typeof a.selected_workspace?null==(r=a.selected_workspace)?void 0:r.id:a.selected_workspace;return String(n)===String(t)};await Promise.all([(0,U.fetchUserDetails)(e,!0).then(t=>{s.setQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e),t)}),s.refetchQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(e),type:"active"})]);let p=d();if(p||(await new Promise(e=>setTimeout(e,400)),await Promise.all([(0,U.fetchUserDetails)(e,!0).then(t=>{s.setQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e),t)}),s.refetchQueries({queryKey:k.QUERY_KEYS.AUTH.WORKSPACES(e),type:"active"})]),p=d()),!p)throw o&&s.setQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e),o),l&&s.setQueryData(k.QUERY_KEYS.AUTH.WORKSPACES(e),l),Error("Workspace switch verification failed")}catch(t){throw o&&s.setQueryData(k.QUERY_KEYS.AUTH.USER_DETAILS(e),o),l&&s.setQueryData(k.QUERY_KEYS.AUTH.WORKSPACES(e),l),console.error("Error switching workspace:",t),t}},X=async()=>{(null==D?void 0:D.id)&&(0,T.captureEvent)("sign_out_initiated",{userId:D.id,pathname:u});try{localStorage.removeItem("supabase.auth.token"),(0,T.resetWorkspaceGroup)();try{await s.cancelQueries()}catch(e){}s.clear(),c(!1),f(null),m(null),y.current=!1,w.current=!1,await i.auth.signOut(),setTimeout(()=>{window.location.href="/"},100)}catch(e){console.error("Error during sign out:",e),window.location.href="/"}},ee={user:D,userDetails:B,connectedAccounts:F,workspaces:W,selectedWorkspace:G,accessToken:p,authFailure:h,isLoading:L||Q||j||$,isAuthenticated:!!D,error:q||Y,threadsDetails:(null==B?void 0:B.threadsDetails)||null,refreshUserDetails:V,handleAccountSwitch:J,handleWorkspaceSwitch:Z,initialized:l,signOut:X};return(0,r.jsx)(x.Provider,{value:ee,children:n})}let D=()=>{let e=(0,P.useContext)(x);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},184860,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(58718).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},66345,e=>{"use strict";e.s(["Zap",()=>t.default]);var t=e.i(184860)},469194,e=>{"use strict";e.s(["ctaLinkProps",()=>n,"readInternalCtaRef",()=>o,"writeInternalCtaClick",()=>i]);let t="bolta_iref",r=["ref","utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=e=>{if("string"!=typeof e)return null;let t=e.trim();return t?t.slice(0,120):null};function n(e,t,n){var i,o;let s=function(e){var t,n;if("string"!=typeof e||!(e.startsWith("/")&&!e.startsWith("//")))return{href:e,ref:null,medium:null};let i=e.indexOf("#"),o=i>=0?e.slice(i):"",s=i>=0?e.slice(0,i):e,l=s.indexOf("?");if(l<0)return{href:e,ref:null,medium:null};let c=s.slice(0,l),d=new URLSearchParams(s.slice(l+1)),u=null!=(n=null!=(t=a(d.get("ref")))?t:a(d.get("utm_campaign")))?n:a(d.get("utm_source")),p=a(d.get("utm_medium"));for(let e of r)d.delete(e);let f=d.toString();return{href:"".concat(c).concat(f?"?".concat(f):"").concat(o),ref:u,medium:p}}(e),l=null!=(i=a(t))?i:s.ref,c=null!=(o=a(n))?o:s.medium;return{href:s.href,...l?{"data-cta-ref":l}:{},...c?{"data-cta-medium":c}:{}}}function i(e){if("undefined"!=typeof document)try{let r=encodeURIComponent(JSON.stringify(e)),a="undefined"!=typeof location&&"https:"===location.protocol?"; Secure":"";document.cookie="".concat(t,"=").concat(r,"; Path=/; Max-Age=").concat(3600,"; SameSite=Lax").concat(a)}catch(e){}}function o(){var e,r;return null!=(r=null==(e=function(){if("undefined"==typeof document)return null;try{var e,r;let n=document.cookie.split("; ").find(e=>e.startsWith("".concat(t,"=")));if(!n)return null;let i=JSON.parse(decodeURIComponent(n.slice(t.length+1))),o=a(null==i?void 0:i.r);if(!o)return null;return{r:o,m:a(null!=(e=i.m)?e:null),from:a(null!=(r=i.from)?r:null),ts:"string"==typeof i.ts?i.ts:""}}catch(e){return null}}())?void 0:e.r)?r:null}},41533,e=>{"use strict";e.s(["default",()=>r]);var t=e.i(991741);let r={appName:"Bolta",appDescription:"Bolta is an AI social media manager â a team of AI social media agents that research, write, schedule and publish your content, with every post routed through your approval.",appShortDescription:"AI social media manager",domainName:"bolta.ai",logoUrl:"https://lh3.googleusercontent.com/d/1QHASvtBTssfVrqO-93UqIRFOZopl8qG1",crisp:{id:"cc10b31c-bb25-4938-9b21-c49358715e89",onlyShowOnRoutes:["/","/blog","/blog/*","/public-apps","/public-apps/*","/support"]},stripe:{plans:[{priceId:"price_1SB6uHFDBW2zVmqU9GtFJP08",name:"Explorer Monthly",description:"Ideal for Growing Creators.",price:8,priceAnchor:12,features:[{name:"5 Social Accounts Per Workspace"},{name:"250 Scheduled Posts / Month"},{name:"Social buckets (unlimited)"},{name:"Multi-profile Publishing"},{name:"5 GB Media Storage"},{name:"CSV Bulk Upload (unlimited)"},{name:"Personal Workspace"},{name:"AI Content Calendar (unlimited, no image generation)"},{name:"AI Brand Voice Builder (unlimited)"},{name:"Media Library"},{name:"AI Chat + AI Suggestions (unlimited)"}
3,{name:"Access to WAVE-1"},{name:"AI Humanizer Detector (unlimited)"},{name:"Know the Best Time to Post"},{name:"Access to Bolta University"},{name:"24/7 Customer Support"}]},{priceId:"price_1SB7S9FDBW2zVmqUFujU5zJH",isFeatured:!0,name:"Explorer Annual",description:"Ideal for Growing Creators.",price:80,priceAnchor:120,features:[{name:"5 Social Accounts Per Workspace"},{name:"250 Scheduled Posts / Month"},{name:"Social buckets (unlimited)"},{name:"Multi-profile Publishing"},{name:"5 GB Media Storage"},{name:"CSV Bulk Upload (unlimited)"},{name:"Personal Workspace"},{name:"AI Content Calendar (unlimited, no image generation)"},{name:"AI Brand Voice Builder (unlimited)"},{name:"Media Library"},{name:"AI Chat + AI Suggestions (unlimited)"},{name:"Access to WAVE-1"},{name:"AI Humanizer Detector (unlimited)"},{name:"Know the Best Time to Post"},{name:"Access to Bolta University"},{name:"24/7 Customer Support"}]},{priceId:"price_1SB6yyFDBW2zVmqUFGy0XNFN",isFeatured:!0,name:"Premium Monthly",description:"Perfect for Advanced Users and Small Agencies.",price:19,priceAnchor:24,features:[{name:"2 Workspaces"},{name:"20 Social Accounts Per Workspace"},{name:"Unlimited Scheduled Posts"},{name:"Automated Daily Content Packs (up to 100 posts/day)"},{name:"10 GB Media Storage"},{name:"Social Buckets (unlimited)"},{name:"AI Image Generation (unlimited)"},{name:"AI Content Calendar (unlimited with image generation)"},{name:"Advanced Analytics (unlimited)"},{name:"Automated Replies (unlimited)"},{name:"Toybox AI Creative Tools (unlimited)"},{name:"Multi-profile Publishing"},{name:"AI Insights Report (Competitor + Performance) (unlimited)"},{name:"Multi-threaded Posts"},{name:"Convert Podcasts to Posts (unlimited)"},{name:"Early Access to New Features"},{name:"24/7 Customer Support"}]},{priceId:"price_1SB7T8FDBW2zVmqUKlycV0Yw",isFeatured:!0,name:"Premium Annual",description:"Perfect for Advanced Users and Small Agencies.",price:190,priceAnchor:240,features:[{name:"2 Workspaces"},{name:"20 Social Accounts Per Workspace"},{name:"Unlimited Scheduled Posts"},{name:"Automated Daily Content Packs (up to 100 posts/day)"},{name:"10 GB Media Storage"},{name:"Social Buckets (unlimited)"},{name:"AI Image Generation (unlimited)"},{name:"AI Content Calendar (unlimited with image generation)"},{name:"Advanced Analytics (unlimited)"},{name:"Automated Replies (unlimited)"},{name:"Toybox AI Creative Tools (unlimited)"},{name:"Multi-profile Publishing"},{name:"AI Insights Report (Competitor + Performance) (unlimited)"},{name:"Multi-threaded Posts"},{name:"Convert Podcasts to Posts (unlimited)"},{name:"Early Access to New Features"},{name:"24/7 Customer Support"}]},{priceId:"price_1QSBnkFDBW2zVmqUJdudFtBn",isFeatured:!0,name:"Agency Monthly",description:"Best for Growing Agencies Managing 100+ Accounts",price:69,priceAnchor:74,features:[{name:"Unlimited Scheduled Posts and Drafts"},{name:"Team Collaboration"},{name:"Up to 100 Threads Accounts"},{name:"Advanced Insights and Analytics"},{name:"Dedicated Onboarding"},{name:"Custom Tagging and Reports"}]},{priceId:"price_1QSBnkFDBW2zVmqU58vIOFgV",isFeatured:!0,name:"Agency Annual",description:"Best for Growing Agencies Managing 100+ Accounts",price:690,priceAnchor:740,features:[{name:"Unlimited Scheduled Posts and Drafts"},{name:"Team Collaboration"},{name:"Up to 100 Threads Accounts"},{name:"Advanced Insights and Analytics"},{name:"Dedicated Onboarding"},{name:"Custom Tagging and Reports"}]},{priceId:"price_1QlkBkFDBW2zVmqUJoGwhdWP",name:"Custom Growth Blueprint",description:"One-time Strategy",price:299,type:"one-time",features:[{name:"1:1 strategy session"},{name:"90-day content system"},{name:"Content templates & hooks"}]},{priceId:"price_1QlkCcFDBW2zVmqUjm6PF3Sj",name:"Elite Creator Accelerator",description:"Monthly Coaching",price:199,type:"subscription",features:[{name:"2 coaching sessions monthly"},{name:"Bi-weekly optimization"},{name:"Group Q&A sessions"}]},{priceId:"price_1QlkDzFDBW2zVmqUgGMu27S9",name:"Complete Growth Bundle",description:"Best Value",price:599,type:"one-time",savings:326,features:[{name:"Growth Blueprint",value:299},{name:"2 months coaching",value:398},{name:"1 Year Premium",value:228}],additionalFeatures:[{name:"Complete growth strategy tailored to your niche"},{name:"4 private coaching sessions (first 2 months)"},{name:"Custom content calendar & templates"},{name:"Performance tracking & optimization"},{name:"Priority access to new features"},{name:"Group Q&A mastermind sessions"}],idealFor:[{name:"Creators ready to scale their presence"},{name:"Business owners building their brand"},{name:"Social media managers & agencies"}]}]},aws:{bucket:"bucket-name",bucketUrl:"https://bucket-name.s3.amazonaws.com/",cdn:"https://cdn-id.cloudfront.net/"},rapidapi:{key:t.default.env.RAPIDAPI_KEY,host:t.default.env.RAPIDAPI_HOST},cobalt:{instanceUrl:t.default.env.COBALT_INSTANCE_URL,turnstileSitekey:"0x4AAAAAACM39S39XjORCtDy",jwtSecret:t.default.env.COBALT_JWT_SECRET},colors:{theme:"dark"},supabase:{supabaseUrl:"https://hrhqjwtwoxxucqkvlgjg.supabase.co",supabaseAnonKey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImhyaHFqd3R3b3h4dWNxa3ZsZ2pnIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDQwMDM1MDgsImV4cCI6MjA1OTU3OTUwOH0.jHOxQAgJoxaeXxt24KRK-d_0U0wiw7K7SVbgWggf7UA"},auth:{loginUrl:"/signin",callbackUrl:"/dashboard"},calendar:{scheduleCallUrl:t.default.env.NEXT_PUBLIC_SCHEDULE_CALL_URL||"https://calendly.com/lucia_valdivia/30min"}}},417070,e=>{"use strict";e.s(["default",()=>t]);
3let t=(0,e.i(58718).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},502645,e=>{"use strict";e.s(["Copy",()=>t.default]);var t=e.i(417070)},678440,874268,e=>{"use strict";e.s(["AlertCircle",()=>t],678440),e.s(["default",()=>t],874268);let t=(0,e.i(58718).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},561054,285082,e=>{"use strict";e.s(["Download",()=>t],561054),e.s(["default",()=>t],285082);let t=(0,e.i(58718).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},150867,30139,e=>{"use strict";e.s(["RefreshCw",()=>t],150867),e.s(["default",()=>t],30139);let t=(0,e.i(58718).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},511731,e=>{"use strict";e.s(["Building2",()=>t],511731);let t=(0,e.i(58718).default)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]])},793726,111906,e=>{"use strict";e.s(["Clock",()=>t],793726),e.s(["default",()=>t],111906);let t=(0,e.i(58718).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},559197,e=>{"use strict";e.s(["Presence",()=>n]);var t=e.i(870088),r=e.i(754886),a=e.i(92751),n=e=>{let{present:n,children:o}=e,s=function(e){var r,n;let[o,s]=t.useState(),l=t.useRef(null),c=t.useRef(e),d=t.useRef("none"),[u,p]=(r=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},t.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},r));return t.useEffect(()=>{let e=i(l.current);d.current="mounted"===u?e:"none"},[u]),(0,a.useLayoutEffect)(()=>{let t=l.current,r=c.current;if(r!==e){let a=d.current,n=i(t);e?p("MOUNT"):"none"===n||(null==t?void 0:t.display)==="none"?p("UNMOUNT"):r&&a!==n?p("ANIMATION_OUT"):p("UNMOUNT"),c.current=e}},[e,p]),(0,a.useLayoutEffect)(()=>{if(o){var e;let t,r=null!=(e=o.ownerDocument.defaultView)?e:window,a=e=>{let a=i(l.current).includes(CSS.escape(e.animationName));if(e.target===o&&a&&(p("ANIMATION_END"),!c.current)){let e=o.style.animationFillMode;o.style.animationFillMode="forwards",t=r.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=e)})}},n=e=>{e.target===o&&(d.current=i(l.current))};return o.addEventListener("animationstart",n),o.addEventListener("animationcancel",a),o.addEventListener("animationend",a),()=>{r.clearTimeout(t),o.removeEventListener("animationstart",n),o.removeEventListener("animationcancel",a),o.removeEventListener("animationend",a)}}p("ANIMATION_END")},[o,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:t.useCallback(e=>{l.current=e?getComputedStyle(e):null,s(e)},[])}}(n),l="function"==typeof o?o({present:s.isPresent}):t.Children.only(o),c=(0,r.useComposedRefs)(s.ref,function(e){var t,r;let a=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,n=a&&"isReactWarning"in a&&a.isReactWarning;return n?e.ref:(n=(a=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get)&&"isReactWarning"in a&&a.isReactWarning)?e.props.ref:e.props.ref||e.ref}(l));return"function"==typeof o||s.isPresent?t.cloneElement(l,{ref:c}):null};function i(e){return(null==e?void 0:e.animationName)||"none"}n.displayName="Presence"},10857,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(58718).default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},442492,e=>{"use strict";e.s(["Users",()=>t.default]);var t=e.i(10857)},505892,e=>{"use strict";e.s(["Globe",()=>t],505892);let t=(0,e.i(58718).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},678692,e=>{"use strict";e.s(["AGENT_FIRST_VALUE_EXPERIMENT",()=>s,"BLUEPRINT_AUTOOPEN_SESSION_KEY",()=>a,"BLUEPRINT_COMPLETED_LOCAL_KEY",()=>i,"BLUEPRINT_DISMISSED_LOCAL_KEY",()=>n,"BLUEPRINT_INPROGRESS_SESSION_KEY",()=>o,"DASHBOARD_FIRST_LANDING_PATH",()=>r,"HUB_CREATE_MODES",()=>p,"ONBOARDING_SKIP_TO_DASHBOARD",()=>t,"ROUTINE_MIGRATION_POSTHOG_FLAGS",()=>l,"isRoutineSurfaceEnabled",()=>u]);let t=!0,r="/dashboard/agents",a="blueprint_modal_auto_opened_v1",n="blueprint_modal_dismissed_v1",i="blueprint_modal_completed_v1",o="bolta:blueprint_inprogress_v1",s="agent-first-value-experience",l={CONDUCTOR_SIMPLIFIED_HOME:"conductor-simplified-home",ROUTINE_LIBRARY_BUILDER:"routine-library-builder",ROUTINES_API_V1:"routines-api-v1",ROUTINES_SOURCE_DRIVEN:"routines-source-driven",ROUTINES_NAV_COMPRESSION:"routines-nav-compression",OUTREACH_ROUTINES:"outreach-routines"}
3,c={CONDUCTOR_SIMPLIFIED_HOME:!0,ROUTINE_LIBRARY_BUILDER:!1,ROUTINES_API_V1:!0,ROUTINES_SOURCE_DRIVEN:!1,ROUTINES_NAV_COMPRESSION:!1,OUTREACH_ROUTINES:!0},d={CONDUCTOR_SIMPLIFIED_HOME:!0,ROUTINES_API_V1:!0,OUTREACH_ROUTINES:!0},u=(e,t)=>!0===c[e]&&(!!d[e]||!0===t),p=!0},947627,e=>{"use strict";e.s(["Table",()=>n,"TableBody",()=>o,"TableCell",()=>c,"TableHead",()=>l,"TableHeader",()=>i,"TableRow",()=>s]);var t=e.i(337884),r=e.i(870088),a=e.i(647163);let n=r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("div",{className:"relative w-full overflow-auto scrollbar-thin scrollbar-thumb-primary scrollbar-muted",children:(0,t.jsx)("table",{ref:r,className:(0,a.cn)("w-full caption-bottom text-sm",n),...i})})});n.displayName="Table";let i=r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("thead",{ref:r,className:(0,a.cn)("[&_tr]:border-b",n),...i})});i.displayName="TableHeader";let o=r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("tbody",{ref:r,className:(0,a.cn)("[&_tr:last-child]:border-0",n),...i})});o.displayName="TableBody",r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("tfoot",{ref:r,className:(0,a.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",n),...i})}).displayName="TableFooter";let s=r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("tr",{ref:r,className:(0,a.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...i})});s.displayName="TableRow";let l=r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("th",{ref:r,className:(0,a.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",n),...i})});l.displayName="TableHead";let c=r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("td",{ref:r,className:(0,a.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",n),...i})});c.displayName="TableCell",r.default.forwardRef((e,r)=>{let{className:n,...i}=e;return(0,t.jsx)("caption",{ref:r,className:(0,a.cn)("mt-4 text-sm text-muted-foreground",n),...i})}).displayName="TableCaption"},351301,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(58718).default)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},763660,e=>{"use strict";e.s(["Filter",()=>t.default]);var t=e.i(351301)},733346,751385,e=>{"use strict";e.s(["Activity",()=>t],733346),e.s(["default",()=>t],751385);let t=(0,e.i(58718).default)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},661185,e=>{"use strict";e.s(["ModeProvider",()=>l,"useMode",()=>c],661185);var t=e.i(337884),r=e.i(920755),a=e.i(870088);function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)e[a]=r[a]}return e}var i=function e(t,r){function a(e,a,i){if("undefined"!=typeof document){"number"==typeof(i=n({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var s in i)i[s]&&(o+="; "+s,!0!==i[s]&&(o+="="+i[s].split(";")[0]));return document.cookie=e+"="+t.write(a,e)+o}}return Object.create({set:a,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],a={},n=0;n<r.length;n++){var i=r[n].split("="),o=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(a[s]=t.read(o,s),e===s)break}catch(e){}}return e?a[e]:a}},remove:function(e,t){a(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decode
3URIComponent)}},{path:"/"});async function o(e,t){let r={isClient:!1,isProvider:!1,hasProviders:!1,workspaceMode:null};try{let{data:a,error:n}=await e.from("users_user").select("isProvider, isClient, hasProviders, workspaceMode").eq("supabaseId",t).single();if(a){if(r.isProvider=a.isProvider||!1,r.isClient=a.isClient||!1,r.hasProviders=a.hasProviders||!1,r.workspaceMode=a.workspaceMode,r.isProvider){let{data:a}=await e.from("marketplace_profiles").select("id, updated_at").eq("user_id",t).in("approval_status",["approved","Approved"]).order("updated_at",{ascending:!1}).limit(1),n=Array.isArray(a)?a[0]:void 0;n?r.providerProfileId=n.id:r.isProvider=!1}else{let{data:a}=await e.from("marketplace_profiles").select("id, updated_at").eq("user_id",t).in("approval_status",["approved","Approved"]).order("updated_at",{ascending:!1}).limit(1),n=Array.isArray(a)?a[0]:void 0;n&&(r.isProvider=!0,r.providerProfileId=n.id)}if(r.isClient){let{data:a}=await e.from("client_profiles").select("id").eq("user_id",t).single();a?r.clientProfileId=a.id:r.isClient=!1}}else{let{data:a}=await e.from("marketplace_profiles").select("id, updated_at").eq("user_id",t).in("approval_status",["approved","Approved"]).order("updated_at",{ascending:!1}).limit(1),n=Array.isArray(a)?a[0]:void 0;n&&(r.isProvider=!0,r.providerProfileId=n.id);let{data:i}=await e.from("client_profiles").select("id").eq("user_id",t).single();if(i&&(r.isClient=!0,r.clientProfileId=i.id,i)){let{data:t}=await e.from("marketplace_bookings").select("id").eq("client_id",i.id).eq("payment_status","paid").neq("status","cancelled").limit(1);r.hasProviders=t&&t.length>0}r.isClient?r.workspaceMode="Client":r.isProvider&&(r.workspaceMode="Provider")}return r}catch(e){return console.error("Error getting user roles:",e),r}}let s=(0,a.createContext)(void 0);function l(e){let{children:n}=e,[l,c]=(0,a.useState)("client"),[d,u]=(0,a.useState)(!1),[p,f]=(0,a.useState)(null),[h,m]=(0,a.useState)(!0),[y,g]=(0,a.useState)(!1),w=(0,r.createClient)();(0,a.useEffect)(()=>{(async()=>{m(!0);try{let{data:{user:t}}=await w.auth.getUser();if(t){var e;let r=await o(w,t.id);g(!!(null==r?void 0:r.isProvider));let{data:a,error:n}=await w.from("marketplace_profiles").select("id, approval_status, updated_at").eq("user_id",t.id).order("updated_at",{ascending:!1}).limit(1);n&&console.error("Error fetching marketplace profile:",n);let s=Array.isArray(a)?a[0]:void 0;u(!!s),f((null==s?void 0:s.approval_status)||null);let l=localStorage.getItem("bolta-user-mode")||i.get("bolta-user-mode");"provider"===l&&(r.isProvider||(null==s||null==(e=s.approval_status)?void 0:e.toLowerCase())==="approved")?c("provider"):c("client")}}catch(e){console.error("Error checking provider profile:",e),u(!1),f(null),c("client")}finally{m(!1)}})()},[]);let S=e=>{if("provider"===e&&(!d||(null==p?void 0:p.toLowerCase())!=="approved"&&!y))return void(d&&(null==p?void 0:p.toLowerCase())==="pending"?console.warn("Cannot switch to provider mode: Provider application is pending approval"):console.warn("Cannot switch to provider mode: No approved provider profile found"));localStorage.setItem("bolta-user-mode",e),i.set("bolta-user-mode",e,{expires:30}),c(e)};return(0,t.jsx)(s.Provider,{value:{mode:l,setMode:S,toggleMode:()=>{S("client"===l?"provider":"client")},isProvider:"provider"===l,isClient:"client"===l,hasProviderProfile:d,providerStatus:p,isPendingProvider:d&&(null==p?void 0:p.toLowerCase())==="pending",isApprovedProvider:d&&((null==p?void 0:p.toLowerCase())==="approved"||y),isLoading:h},children:n})}let c=()=>{let e=(0,a.useContext)(s);if(void 0===e)throw Error("useMode must be used within a ModeProvider");return e}},922299,e=>{"use strict";e.s(["Database",()=>t],922299);let t=(0,e.i(58718).default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},105978,e=>{"use strict";e.s(["ChatboxColors",()=>r,"ChatboxPosition",()=>a,"Crisp",()=>d,"CrispClass",()=>c,"EventsColors",()=>t]);var t,r,a,n=function(){function e(e){this.parent=e}return e.prototype.setMessageText=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","message:text",[e]])},e.prototype.send=function(e,t){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:send",[e,t]])},e.prototype.sendText=function(e){this.send("text",e)},e.prototype.sendFile=function(e){this.send("file",e)}
3,e.prototype.sendAnimation=function(e){this.send("animation",e)},e.prototype.sendAudio=function(e){this.send("audio",e)},e.prototype.show=function(e,t){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:show",[e,t]])},e.prototype.showText=function(e){this.show("text",e)},e.prototype.showFile=function(e){this.show("file",e)},e.prototype.showAnimation=function(e){this.show("animation",e)},e.prototype.showAudio=function(e){this.show("audio",e)},e.prototype.showPicker=function(e){this.show("picker",e)},e.prototype.showField=function(e){this.show("field",e)},e.prototype.showCarousel=function(e){this.show("carousel",e)},e.prototype.markAsRead=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:read"])},e.prototype.startThread=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:thread:start",[e]])},e.prototype.endThread=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:thread:end",[e]])},e.prototype.onMessageSent=function(e){this.parent.createSingletonIfNecessary(),this.offMessageSent(),window.$crisp.push(["on","message:sent",e])},e.prototype.offMessageSent=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:sent"])},e.prototype.onMessageReceived=function(e){this.parent.createSingletonIfNecessary(),this.offMessageReceived(),window.$crisp.push(["on","message:received",e])},e.prototype.offMessageReceived=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:received"])},e.prototype.onMessageComposeSent=function(e){this.parent.createSingletonIfNecessary(),this.offMessageComposeSent(),window.$crisp.push(["on","message:compose:sent",e])},e.prototype.offMessageComposeSent=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:compose:sent"])},e.prototype.onMessageComposeReceived=function(e){this.parent.createSingletonIfNecessary(),this.offMessageComposeReceived(),window.$crisp.push(["on","message:compose:received",e])},e.prototype.offMessageComposeReceived=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:compose:received"])},e}(),i=function(){function e(e){this.parent=e}return e.prototype.setNickname=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:nickname",[e]])},e.prototype.setEmail=function(e,t){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:email",[e,t]])},e.prototype.setPhone=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:phone",[e]])},e.prototype.setAvatar=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:avatar",[e]])},e.prototype.setCompany=function(e,t){var r={};t&&(t.url&&(r.url=t.url),t.description&&(r.description=t.description),t.employment&&(r.employment=[t.employment.title],t.employment.role&&r.employment.push(t.employment.role))),this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:company",[e,r]])},e.prototype.getEmail=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:email"):null},e.prototype.getPhone=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:phone"):null},e.prototype.getNickname=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:nickname"):null},e.prototype.getAvatar=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:avatar"):null},e.prototype.getCompany=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:company"):null},e.prototype.onEmailChanged=function(e){this.parent.isCrispInjected()&&(this.offEmailChanged(),window.$crisp.push(["on","user:email:changed",e]))},e.prototype.offEmailChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:email:changed"])},e.prototype.onPhoneChanged=function(e){this.parent.isCrispInjected()&&(this.offPhoneChanged(),window.$crisp.push(["on","user:phone:changed",e]))},e.prototype.offPhoneChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:phone:changed"])},e.prototype.onNicknameChanged=function(e){this.parent.isCrispInjected()&&(this.offNicknameChanged(),window.$crisp.push(["on","user:nickname:changed",e]))},e.prototype.offNicknameChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:nickname:changed"])},e.prototype.onAvatarChanged=function(e){this.parent.isCrispInjected()&&(this.offAvatarChanged(),window.$crisp.push(["on","user:avatar:changed",e]))},e.prototype.offAvatarChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:avatar:changed"])},e}(),o=function(){function e(e){this.parent=e}return e.prototype.run=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","trigger:run",[e]])},e}();!function(e){e.Red="red",e.Orange="orange",e.Yellow="yellow",e.Green="green",e.Blue="blue",e.Purple="purple",e.Pink="pink",e.Brown="brown",e.Grey="grey",e.Black="black"}(t||(t={}));var s=function(){function e(e){this.parent=e}return e.prototype.reset=function(e){void 0===e&&(e=!1),this.parent.isCrispInjected()&&window.$crisp.push(["do","session:reset",[e]])},e.prototype.setSegments=function(e,t){this.parent.createSingletonIfNecessary(),$crisp.push(["set","session:segments",[e,t]])},e.prototype.setData=function(e){var t=this,r=[];Object.entries(e).forEach(function(e){t.isValidDataValue(e[0])&&r.push([e[0],e[1]])}),this.parent.createSingletonIfNecessary(),$crisp.push(["set","session:data",[r]])},e.prototype.pushEvent=function(e,r,a){void 0===r&&(r={}),void 0===a&&(a=t.Blue),this.parent.isCrispInjected()&&window.$crisp.push(["set","session:event",[[[e,r,a]]]])},e.prototype.getData=function(e){if(this.parent.isCrispInjected())return window.$crisp.get("session:data",e)},e.prototype.getIdentifier=function(){return this.parent.isCrispInjected()?window.$crisp.get("session:identifier"):null},e.prototype.onLoaded=function(e){this.parent.createSingletonIfNecessary(),this.offLoaded(),window.$crisp.push(["on","session:loaded",e])},e.prototype.offLoaded=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","session:loaded"])},e.prototype.isValidDataValue=function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e},e}(),l=function(){function e(e){this.parent=e}return e.prototype.show=function(){this.parent.autoInjectIfNecessary(),window.$crisp.push(["do","chat:show"])},e.prototype.hide=function(){this.parent.autoInjectIfNecessary(),window.$crisp.push(["do","chat:hide"])},e.prototype.open=function(){this.parent.autoInjectIfNecessary(),window.$crisp.push(["do","chat:open"])},e.prototype.close=function(){this.parent.isCrispInjected()&&window.$crisp.push(["do","chat:close"])},e.prototype.setHelpdeskView=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","helpdesk:search"])},e.prototype.openHelpdeskArticle=function(e,t,r,a){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","helpdesk:article:open",[e,t,r,a]])},e.prototype.queryHelpdesk=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","helpdesk:query",[e]])},e.prototype.unreadCount=function(){return this.parent.isCrispInjected()?window.$crisp.get("chat:unread:count"):0},e.prototype.isChatOpened=function(){return!!this.parent.isCrispInjected()&&window.$crisp.is("chat:opened")},e.prototype.isVisible=function(){return!!this.parent.isCrispInjected()&&window.$crisp.is("chat:visible")},e.prototype.onChatInitiated=function(e){this.parent.createSingletonIfNecessary(),this.offChatInitiated(),window.$crisp.push(["on","chat:initiated",e])},e.prototype.offChatInitiated=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","chat:initiated"])},e.prototype.onChatOpened=function(e){this.parent.createSingletonIfNecessary(),this.offChatOpened(),window.$crisp.push(["on","chat:opened",e])},e.prototype.offChatOpened=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","chat:opened"])},e.prototype.onChatClosed=function(e){this.parent.createSingletonIfNecessary(),this.offChatClosed(),window.$crisp.push(["on","chat:closed",e])},e.prototype.offChatClosed=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","chat:closed"])},e.prototype.onHelpdeskQueried=function(e){this.parent.createSingletonIfNecessary(),this.offHelpdeskQueried(),window.$crisp.push(["on","helpdesk:queried",e])},e.prototype.offHelpdeskQueried=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","helpdesk:queried"])},e}();!function(e){e.Default="default",e.Amber="amber",e.Black="black",e.Blue="blue",e.BlueGrey="blue_grey",e.LightBlue="light_blue",e.Brown="brown",e.Cyan="cyan",e.Green="green",e.LightGreen="light_green",e.Grey="grey",e.Indigo="indigo",e.Orange="orange",e.DeepOrange="deep_orange",e.Pink="pink",e.Purple="purple",e.DeepPurple="deep_purple",e.Red="red",e.Teal="teal"}(r||(r={})),function(e){e.Left="left",e.Right="right"}(a||(a={}));var c=function(){function e(){this.clientUrl="https://client.crisp.chat/l.js",this.websiteId="",this.autoload=!0,this.injected=!1,this.chat=new l(this),this.session=new s(this),this.user=new i(this),this.message=new n(this),this.trigger=new o(this)}return e.prototype.configure=function(e,t){void 0===t&&(t={}),this.websiteId=e,this.tokenId=t.tokenId,this.locale=t.locale,this.sessionMerge=t.sessionMerge,this.cookieDomain=t.cookieDomain,this.cookieExpire=t.cookieExpire,this.lockFullview=t.lockFullview,this.lockMaximized=t.lockMaximized,this.safeMode=t.safeMode,void 0!==t.clientUrl&&(this.clientUrl=t.clientUrl),void 0!==t.autoload&&(this.autoload=t.autoload),this.autoload&&this.load()},e.prototype.load=function(){var e=document.getElementsByTagName("head");if(this.createSingletonIfNecessary(),!0!==this.isCrispInjected()){if
3(!this.websiteId)throw Error("websiteId must be set before loading Crisp");if(window.CRISP_WEBSITE_ID=this.websiteId,window.CRISP_RUNTIME_CONFIG={},this.tokenId&&(window.CRISP_TOKEN_ID=this.tokenId),this.sessionMerge&&(window.CRISP_RUNTIME_CONFIG.session_merge=!0),this.locale&&(window.CRISP_RUNTIME_CONFIG.locale=this.locale),this.lockFullview&&(window.CRISP_RUNTIME_CONFIG.lock_full_view=!0),this.lockMaximized&&(window.CRISP_RUNTIME_CONFIG.lock_maximized=!0),this.cookieDomain&&(window.CRISP_COOKIE_DOMAIN=this.cookieDomain),this.cookieExpire&&(window.CRISP_COOKIE_EXPIRE=this.cookieExpire),!e||!e[0])return this.deferredLoading();!0===this.safeMode&&this.setSafeMode(!0);var t=document.createElement("script");t.src=this.clientUrl,t.async=!0,e[0].appendChild(t),this.injected=!0}},e.prototype.setTokenId=function(e){this.tokenId=e,!0===this.isCrispInjected()&&(e?window.CRISP_TOKEN_ID=e:delete window.CRISP_TOKEN_ID)},e.prototype.setZIndex=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","container:index",[e]])},e.prototype.setColorTheme=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","color:theme",[e]])},e.prototype.setHideOnAway=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","hide:on:away",[e]])},e.prototype.setHideOnMobile=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","hide:on:mobile",[e]])},e.prototype.setPosition=function(e){this.createSingletonIfNecessary(),$crisp.push(["config","position:reverse",[e===a.Left]])},e.prototype.setAvailabilityTooltip=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","availability:tooltip",[e]])},e.prototype.setVacationMode=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","hide:vacation",[e]])},e.prototype.setSafeMode=function(e){void 0===e&&(e=!0),this.createSingletonIfNecessary(),window.$crisp.push(["safe",e])},e.prototype.muteSound=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","sound:mute",[e]])},e.prototype.toggleOperatorCount=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","show:operator:count",[e]])},e.prototype.onWebsiteAvailabilityChanged=function(e){this.createSingletonIfNecessary(),this.offWebsiteAvailabilityChanged(),window.$crisp.push(["on","website:availability:changed",e])},e.prototype.offWebsiteAvailabilityChanged=function(){this.createSingletonIfNecessary(),window.$crisp.push(["off","website:availability:changed"])},e.prototype.createSingletonIfNecessary=function(){void 0===window.$crisp&&(window.$crisp=[])},e.prototype.autoInjectIfNecessary=function(){this.isCrispInjected()||this.load()},e.prototype.isCrispInjected=function(){return!0===this.injected||!!window.$crisp&&!!window.$crisp.is},e.prototype.deferredLoading=function(){var e=this;document.addEventListener("DOMContentLoaded",function(){e.load()})},e}(),d=new c},800378,e=>{"use strict";e.s(["CONCIERGE_MESSAGE_EVENT",()=>a,"openConcierge",()=>n]);var t=e.i(105978),r=e.i(332978);let a="bolta:open_concierge";function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(window.opener&&window.opener!==window)try{window.opener.postMessage({type:a,payload:e},window.location.origin),(0,r.captureEvent)("concierge_handoff_to_opener",{platform:e.platform});return}catch(e){}try{e.email&&t.Crisp.user.setEmail(e.email),e.name&&t.Crisp.user.setNickname(e.name),t.Crisp.session.setData({concierge_platform:e.platform||"",concierge_phase:e.phase||"",concierge_error:e.errorMessage||""}),t.Crisp.chat.show(),t.Crisp.chat.open(),t.Crisp.message.setMessageText(function(e){let t,r=(t=e.platform)?t.charAt(0).toUpperCase()+t.slice(1):"my account",a=["Hi Max â I hit a snag connecting ".concat(r," and could use a hand.")];return e.errorMessage&&a.push("(Error: ".concat(e.errorMessage,")")),a.join(" ")}(e)),(0,r.captureEvent)("concierge_crisp_opened",{platform:e.platform,phase:e.phase})}catch(t){(0,r.captureEvent)("concierge_crisp_unavailable",{platform:e.platform})}}},264458,(e,t,r)=>{!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=n(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)r.call(e,i)&&e[i]&&(t=n(t,i));return t}(i)))}return e}function n(e,t){return t?e?e+" "+t:e+t:e}if(t.exports)a.default=a,t.exports=a;else if("function"==typeof define&&"object"==typeof define.amd&&define.amd)void 0!==a&&e.v(a);else window.classNames=a}()},212393,e=>{"use strict";e.s(["LayoutDashboard",()=>t],212393);
3let t=(0,e.i(58718).default)("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]])},49877,e=>{"use strict";e.s(["posthog",()=>t.default]);var t=e.i(80781)},652587,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(58718).default)("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]])},98776,e=>{"use strict";e.s(["UserPlus",()=>t.default]);var t=e.i(652587)},869272,e=>{"use strict";e.s(["Key",()=>t],869272);let t=(0,e.i(58718).default)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},931825,e=>{"use strict";e.s(["hasNextPage",()=>i,"hasPreviousPage",()=>o,"infiniteQueryBehavior",()=>r]);var t=e.i(365054);function r(e){return{onFetch:(r,i)=>{var o,s,l,c,d;let u=r.options,p=null==(l=r.fetchOptions)||null==(s=l.meta)||null==(o=s.fetchMore)?void 0:o.direction,f=(null==(c=r.state.data)?void 0:c.pages)||[],h=(null==(d=r.state.data)?void 0:d.pageParams)||[],m={pages:[],pageParams:[]},y=0,g=async()=>{let i=!1,o=(0,t.ensureQueryFn)(r.options,r.fetchOptions),s=async(e,a,n)=>{if(i)return Promise.reject();if(null==a&&e.pages.length)return Promise.resolve(e);let s=(()=>{let e={client:r.client,queryKey:r.queryKey,pageParam:a,direction:n?"backward":"forward",meta:r.options.meta};return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r.signal.aborted?i=!0:r.signal.addEventListener("abort",()=>{i=!0}),r.signal)}),e})(),l=await o(s),{maxPages:c}=r.options,d=n?t.addToStart:t.addToEnd;return{pages:d(e.pages,l,c),pageParams:d(e.pageParams,a,c)}};if(p&&f.length){let e="backward"===p,t={pages:f,pageParams:h},r=(e?n:a)(u,t);m=await s(t,r,e)}else{let t=null!=e?e:f.length;do{var l;let e=0===y?null!=(l=h[0])?l:u.initialPageParam:a(u,m);if(y>0&&null==e)break;m=await s(m,e),y++}while(y<t)}return m};r.options.persister?r.fetchFn=()=>{var e,t;return null==(e=(t=r.options).persister)?void 0:e.call(t,g,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},i)}:r.fetchFn=g}}}function a(e,t){let{pages:r,pageParams:a}=t,n=r.length-1;return r.length>0?e.getNextPageParam(r[n],r,a[n],a):void 0}function n(e,t){var r;let{pages:a,pageParams:n}=t;return a.length>0?null==(r=e.getPreviousPageParam)?void 0:r.call(e,a[0],a,n[0],n):void 0}function i(e,t){return!!t&&null!=a(e,t)}function o(e,t){return!!t&&!!e.getPreviousPageParam&&null!=n(e,t)}},534258,e=>{"use strict";e.s(["applyBrandColors",()=>i,"applyCustomCSS",()=>n,"applyFavicon",()=>o,"useAgencyBranding",()=>a]);var t=e.i(870088);let r={appName:"Bolta",isAgencyDomain:!1,featureFlags:{},isLoading:!1};function a(){var e;let{initialAgencyId:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o="undefined"==typeof document?null:(null==(e=document.cookie.split("; ").find(e=>e.startsWith("bolta-agency-id=")))?void 0:e.split("=")[1])||null,s=a||o,l=!!s,c="undefined"!=typeof document&&!s,[d,u]=(0,t.useState)({...r,agencyId:s||void 0,isAgencyDomain:l,isLoading:l||c});(0,t.useEffect)(()=>{if(s){u(e=>({...e,agencyId:s,isAgencyDomain:!0,isLoading:!0})),p(s);return}s||(()=>{var e,t,r,a,o,s,l,c;let d=null==(e=document.cookie.split("; ").find(e=>e.startsWith("bolta-agency-id=")))?void 0:e.split("=")[1];if(d){u(e=>({...e,agencyId:d,isAgencyDomain:!0,isLoading:!0})),p(d);return}let f=new URLSearchParams(window.location.search),h=f.get("agency_id");if(h){u(e=>({...e,agencyId:h,isAgencyDomain:!0,isLoading:!0})),p(h);return}let m=null==(t=document.querySelector('meta[name="x-agency-name"]'))?void 0:t.getAttribute("content"),y=null==(r=document.querySelector('meta[name="x-agency-app-name"]'))?void 0:r.getAttribute("content"),g=null==(a=document.querySelector('meta[name="x-agency-logo"]'))?void 0:a.getAttribute("content"),w=null==(o=document.querySelector('meta[name="x-agency-brand-colors"]'))?void 0:o.getAttribute("content"),S=null==(s=document.querySelector('meta[name="x-agency-custom-css"]'))?void 0:s.getAttribute("content"),E=null==(l=document.querySelector('meta[name="x-agency-feature-flags"]'))?void 0:l.getAttribute("content"),_=null==(c=document.querySelector('meta[name="x-agency-tagline"]'))?void 0:c.getAttribute("content");
3if(m||y){let e,t;try{e=w?JSON.parse(w):void 0}catch(e){console.warn("[useAgencyBranding] Failed to parse brand colors:",e)}try{t=E?JSON.parse(E):void 0}catch(e){console.warn("[useAgencyBranding] Failed to parse feature flags:",e)}u({agencyId:f.get("agency_id")||void 0,agencyName:m||void 0,appName:y||"Bolta",logoUrl:g||void 0,brandColors:e,customCSS:S?decodeURIComponent(S):void 0,isAgencyDomain:!0,featureFlags:t,tagline:_||void 0,defaultLanguage:t&&"object"==typeof t?t.login_default_language:void 0,isLoading:!1}),S&&n(decodeURIComponent(S)),e&&i(e)}else u(e=>({...e,isLoading:!1}))})()},[s]);let p=async e=>{try{let r=await fetch("/api/agency/customization?agencyId=".concat(e)),a=await r.json();if(a.success&&a.customization){var t;let r=a.customization;u({agencyId:e,agencyName:r.agency_name,appName:r.app_name||"Bolta",logoUrl:r.logo_url,brandColors:r.brand_colors,customCSS:r.custom_css,isAgencyDomain:!0,featureFlags:r.feature_flags||{},tagline:r.tagline||void 0,defaultLanguage:null==(t=r.feature_flags)?void 0:t.login_default_language,isLoading:!1}),r.custom_css&&n(r.custom_css),r.brand_colors&&i(r.brand_colors)}else u(t=>({...t,isLoading:!1,isAgencyDomain:t.isAgencyDomain||!!e}))}catch(t){console.error("[useAgencyBranding] Failed to fetch agency branding:",t),u(t=>({...t,isLoading:!1,isAgencyDomain:t.isAgencyDomain||!!e}))}};return d}function n(e){let t=document.getElementById("agency-custom-css");if(t&&t.remove(),!e)return;let r=document.createElement("style");r.id="agency-custom-css",r.textContent=e,document.head.appendChild(r)}function i(e){let t=document.documentElement;if(!e||0===Object.keys(e).length)return void["--color-primary","--color-primary-rgb","--color-secondary","--color-secondary-rgb","--color-accent","--color-accent-rgb","--color-background","--color-foreground","--primary","--secondary","--accent","--background","--foreground","--card","--card-foreground","--popover","--popover-foreground","--muted","--muted-foreground","--border","--input","--ring","--destructive","--destructive-foreground","--sidebar-background","--sidebar-foreground","--sidebar-primary","--sidebar-primary-foreground","--sidebar-accent","--sidebar-accent-foreground","--sidebar-border","--sidebar-ring","--primary-foreground","--secondary-foreground","--accent-foreground","--radius"].forEach(e=>t.style.removeProperty(e));[["--color-primary",null==e?void 0:e.primary],["--color-primary-rgb",(null==e?void 0:e.primary)?s(e.primary):void 0],["--color-secondary",null==e?void 0:e.secondary],["--color-secondary-rgb",(null==e?void 0:e.secondary)?s(e.secondary):void 0],["--color-accent",null==e?void 0:e.accent],["--color-accent-rgb",(null==e?void 0:e.accent)?s(e.accent):void 0],["--color-background",null==e?void 0:e.background],["--color-foreground",null==e?void 0:e.foreground]].forEach(e=>{let[r,a]=e;a?t.style.setProperty(r,a):t.style.removeProperty(r)});let r=(null==e?void 0:e.primary)?c(e.primary):void 0,a=(null==e?void 0:e.secondary)?c(e.secondary):void 0,n=(null==e?void 0:e.accent)?c(e.accent):void 0,i=(null==e?void 0:e.background)?c(e.background):void 0,o=(null==e?void 0:e.foreground)?c(e.foreground):void 0,f=null!=e&&!!e.background&&function(e){let t=l(e);if(!t)return!1;let[r,a,n]=t.map(e=>e/255);return .2126*r+.7152*a+.0722*n<.5}(e.background),h=a?f?u(a,-10):u(a,15):i?f?u(i,5):u(i,-5):void 0,m=a?p(a,f?-20:-30):h?p(h,-10):void 0,y=o?f?u(o,20):u(o,-20):void 0;[["--primary",r],["--secondary",a],["--accent",n],["--background",i],["--foreground",o],["--card",i],["--card-foreground",o],["--popover",i],["--popover-foreground",o],["--muted",h],["--muted-foreground",y],["--border",m],["--input",m],["--ring",r],["--destructive","0 84.2% 60.2%"],["--destructive-foreground",o||"0 0% 98%"],["--sidebar-background",i],["--sidebar-foreground",o],["--sidebar-primary",r],["--sidebar-primary-foreground",(null==e?void 0:e.foreground)?o:(null==e?void 0:e.primary)?d(e.primary):void 0],["--sidebar-accent",n||a],["--sidebar-accent-foreground",(null==e?void 0:e.foreground)?o:(null==e?void 0:e.accent)?d(e.accent):(null==e?void 0:e.secondary)?d(e.secondary):void 0],["--sidebar-border",m],["--sidebar-ring",r],["--primary-foreground",(null==e?void 0:e.foreground)?o:(null==e?void 0:e.primary)?d(e.primary):void 0],["--secondary-foreground",(null==e?void 0:e.foreground)?o:(null==e?void 0:e.secondary)?d(e.secondary):void 0],["--accent-foreground",(null==e?void 0:e.foreground)?o:(null==e?void 0:e.accent)?d(e.accent):void 0],["--radius","0.5rem"]].forEac
3h(e=>{let[r,a]=e;a?t.style.setProperty(r,a):t.style.removeProperty(r)})}function o(e){if("undefined"==typeof document)return;let t=e||"/favicon.ico";document.querySelectorAll('link[rel="icon"], link[rel="shortcut icon"], link[rel="apple-touch-icon"]').forEach(e=>{e.remove()});let r=document.createElement("link");r.rel="icon",r.type="image/x-icon",r.href=t,document.head.appendChild(r);let a=document.createElement("link");if(a.rel="shortcut icon",a.type="image/x-icon",a.href=t,document.head.appendChild(a),e){let e=document.createElement("link");e.rel="apple-touch-icon",e.href=t,document.head.appendChild(e)}}function s(e){let t=l(e);if(!t)return;let[r,a,n]=t;return"".concat(r,", ").concat(a,", ").concat(n)}function l(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e.trim());return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:null}function c(e){let t=l(e);if(!t)return;let[r,a,n]=t.map(e=>e/255),i=Math.max(r,a,n),o=Math.min(r,a,n),s=0,c=0,d=(i+o)/2;if(i!==o){let e=i-o;switch(c=d>.5?e/(2-i-o):e/(i+o),i){case r:s=(a-n)/e+6*(a<n);break;case a:s=(n-r)/e+2;break;case n:s=(r-a)/e+4}s/=6}let u=Math.round(360*s*100)/100,p=Math.round(100*c*100)/100,f=Math.round(100*d*100)/100;return"".concat(u," ").concat(p,"% ").concat(f,"%")}function d(e){let t=l(e);if(!t)return"0 0% 98%";let[r,a,n]=t.map(e=>e/255);return .2126*r+.7152*a+.0722*n>.6?"0 0% 10%":"0 0% 98%"}function u(e,t){let r=e.match(/(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%/);if(!r)return e;let[,a,n,i]=r,o=Math.max(0,Math.min(100,parseFloat(i)+t));return"".concat(a," ").concat(n,"% ").concat(o,"%")}function p(e,t){let r=e.match(/(\d+(?:\.\d+)?)\s+(\d+(?:\.\d+)?)%\s+(\d+(?:\.\d+)?)%/);if(!r)return e;let[,a,n,i]=r,o=Math.max(0,Math.min(100,parseFloat(n)+t));return"".concat(a," ").concat(o,"% ").concat(i,"%")}},624292,e=>{"use strict";e.s(["AgencyThemeProvider",()=>l,"useAgencyTheme",()=>c]);var t=e.i(337884),r=e.i(534258),a=e.i(471585),n=e.i(870088);let i={isAgency:!1,isLoading:!1,appName:"Bolta"},o={...i,refresh:async()=>void 0},s=(0,n.createContext)(o);function l(e){let{children:o}=e,{initialized:l}=(0,a.useAuth)(),[c,d]=(0,n.useState)(i),u=(0,n.useRef)(!1),p=(0,n.useRef)(!1),f=(0,n.useRef)(null),h=(0,n.useRef)(void 0),m=(0,n.useRef)(async()=>void 0),y=(0,n.useCallback)(()=>{(0,r.applyBrandColors)(void 0),(0,r.applyCustomCSS)(void 0),h.current=void 0,d(i)},[]),g=(0,n.useCallback)(()=>!["localhost","127.0.0.1","app.bolta.ai","bolta.ai","staging.bolta.ai"].includes(window.location.hostname)&&!!document.cookie.split("; ").find(e=>e.startsWith("bolta-agency-id=")),[]),w=(0,n.useCallback)(async()=>{if(l&&!u.current){if(!g())return void y();u.current=!0,d(e=>({...e,isLoading:!0}));try{var e,t,a,n;let i=await fetch("/api/agency",{credentials:"include"});if(!i.ok){if(401===i.status||403===i.status)return void y();throw Error("Failed to load agency theme: ".concat(i.statusText))}let o=await i.json(),s=null!=(a=null==o?void 0:o.agency)?a:null==o||null==(e=o.agencies)?void 0:e[0];if(!s)return void y();let l=null!=(n=null==(t=s.agency_customizations)?void 0:t[0])?n:null,c={isAgency:!0,isLoading:!1,agencyId:s.id,appName:(null==l?void 0:l.app_name)||s.name||"Bolta",logoUrl:(null==l?void 0:l.logo_url)||s.logo_url||void 0,faviconUrl:(null==l?void 0:l.favicon_url)||void 0,brandColors:(null==l?void 0:l.brand_colors)||void 0,customCSS:(null==l?void 0:l.custom_css)||void 0,tagline:(null==l?void 0:l.tagline)||s.tagline||void 0,featureFlags:(null==l?void 0:l.feature_flags)||null};(0,r.applyBrandColors)(c.brandColors),(0,r.applyCustomCSS)(c.customCSS),d(c)}catch(e){y()}finally{u.current=!1,d(e=>({...e,isLoading:!1}))}}},[l,y]);(0,n.useEffect)(()=>{m.current=w},[w]);let S=(0,n.useCallback)(async()=>{await m.current()},[]),E=(0,n.useRef)(y);(0,n.useEffect)(()=>{E.current=y},[y]);let _=(0,n.useRef)(g);(0,n.useEffect)(()=>{_.current=g},[g]),(0,n.useEffect)(()=>{if(!l){E.current(),p.current=!1;return}!p.current&&_.current()&&m.current().then(()=>{p.current=!0})},[l]),(0,n.useLayoutEffect)(()=>(f.current&&(clearTimeout(f.current),f.current=null),c.faviconUrl!==h.current&&(f.current=setTimeout(()=>{(0,r.applyFavicon)(c.faviconUrl),h.current=c.faviconUrl,f.current=null},0)),()=>{f.current&&(clearTimeout(f.current),f.current=null)}),[c.faviconUrl]);let b=(0,n.useMemo)(()=>({...c,refresh:S}),[c,S]);return(0,t.jsx)(s.Provider,{value:b,children:o})}function c(){return(0,n.useContext)(s)}},529920,e=>{"use strict";e.s(["UserCheck",()=>t],529920);let t=(0,e.i(58718).default)("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},29043,e=>{"use strict";e.s(["Gauge",()=>t],29043);let t=(0,e.i(58718).default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]])},261288,e=>{"use strict";e.s(["Server",()=>t],261288);let t=(0,e.i(58718).default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},373383,e=>{"use strict";e.s(["default",()=>t]);let t=(0,e.i(58718).default)("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]])},951917,e=>{"use strict";e.s(["UploadCloud",()=>t.default]);var t=e.i(373383)},56561,(e,t,r)=>{"use strict";
3Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{cancelIdleCallback:function(){return n},requestIdleCallback:function(){return a}});let a="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},64611,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(r,{default:function(){return g},handleClientScriptLoad:function(){return h},initScriptLoader:function(){return m}});let a=e.r(481258),n=e.r(744066),i=e.r(337884),o=a._(e.r(404229)),s=n._(e.r(870088)),l=e.r(990576),c=e.r(667946),d=e.r(56561),u=new Map,p=new Set,f=e=>{let{src:t,id:r,onLoad:a=()=>{},onReady:n=null,dangerouslySetInnerHTML:i,children:s="",strategy:l="afterInteractive",onError:d,stylesheets:f}=e,h=r||t;if(h&&p.has(h))return;if(u.has(t)){p.add(h),u.get(t).then(a,d);return}let m=()=>{n&&n(),p.add(h)},y=document.createElement("script"),g=new Promise((e,t)=>{y.addEventListener("load",function(t){e(),a&&a.call(this,t),m()}),y.addEventListener("error",function(e){t(e)})}).catch(function(e){d&&d(e)});i?(y.innerHTML=i.__html||"",m()):s?(y.textContent="string"==typeof s?s:Array.isArray(s)?s.join(""):"",m()):t&&(y.src=t,u.set(t,g)),(0,c.setAttributesFromProps)(y,e),"worker"===l&&y.setAttribute("type","text/partytown"),y.setAttribute("data-nscript",l),f&&(e=>{if(o.default.preinit)return e.forEach(e=>{o.default.preinit(e,{as:"style"})});if("undefined"!=typeof window){let t=document.head;e.forEach(e=>{let r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,t.appendChild(r)})}})(f),document.body.appendChild(y)};function h(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,d.requestIdleCallback)(()=>f(e))}):f(e)}function m(e){e.forEach(h),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");p.add(t)})}function y(e){let{id:t,src:r="",onLoad:a=()=>{},onReady:n=null,strategy:c="afterInteractive",onError:u,stylesheets:h,...m}=e,{updateScripts:y,scripts:g,getIsSsr:w,appDir:S,nonce:E}=(0,s.useContext)(l.HeadManagerContext);E=m.nonce||E;let _=(0,s.useRef)(!1);(0,s.useEffect)(()=>{let e=t||r;_.current||(n&&e&&p.has(e)&&n(),_.current=!0)},[n,t,r]);let b=(0,s.useRef)(!1);if((0,s.useEffect)(()=>{if(!b.current){if("afterInteractive"===c)f(e);else"lazyOnload"===c&&("complete"===document.readyState?(0,d.requestIdleCallback)(()=>f(e)):window.addEventListener("load",()=>{(0,d.requestIdleCallback)(()=>f(e))}));b.current=!0}},[e,c]),("beforeInteractive"===c||"worker"===c)&&(y?(g[c]=(g[c]||[]).concat([{id:t,src:r,onLoad:a,onReady:n,onError:u,...m,nonce:E}]),y(g)):w&&w()?p.add(t||r):w&&!w()&&f({...e,nonce:E})),S){if(h&&h.forEach(e=>{o.default.preinit(e,{as:"style"})}),"beforeInteractive"===c)if(!r)return m.dangerouslySetInnerHTML&&(m.children=m.dangerouslySetInnerHTML.__html,delete m.dangerouslySetInnerHTML),(0,i.jsx)("script",{nonce:E,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...m,id:t}])+")"}});else return o.default.preload(r,m.integrity?{as:"script",integrity:m.integrity,nonce:E,crossOrigin:m.crossOrigin}:{as:"script",nonce:E,crossOrigin:m.crossOrigin}),(0,i.jsx)("script",{nonce:E,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([r,{...m,id:t}])+")"}});"afterInteractive"===c&&r&&o.default.preload(r,m.integrity?{as:"script",integrity:m.integrity,nonce:E,crossOrigin:m.crossOrigin}:{as:"script",nonce:E,crossOrigin:m.crossOrigin})}return null}Object.defineProperty(y,"__nextScript",{value:!0});let g=y;("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esMo
3dule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},4719,(e,t,r)=>{t.exports=e.r(64611)},394268,e=>{"use strict";e.s(["useAgencyTitle",()=>a]);var t=e.i(870088),r=e.i(624292);function a(e,a){let{isAgency:n,appName:i,isLoading:o}=(0,r.useAgencyTheme)();(0,t.useEffect)(()=>{if(o)return;let t=n&&i?i:"Bolta";e?document.title="".concat(e," | ").concat(t):a?document.title=t:document.title="".concat(t," - All In One AI-Powered Social Media Marketing Platform")},[n,i,e,a,o])}},648504,e=>{"use strict";e.s(["ClipboardCopy",()=>t],648504);let t=(0,e.i(58718).default)("clipboard-copy",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]])},346200,151406,e=>{"use strict";function t(e,t){if(t.set){if(!t.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in t||(t.__destrWrapper={set value(v){t.set.call(e,v)},get value(){return t.get.call(e)}}),t.__destrWrapper}if(!t.writable)throw TypeError("attempted to set read only private field");return t}e.s(["_",()=>a],346200),e.s(["_",()=>t],151406);var r=e.i(303069);function a(e,a){var n=(0,r._)(e,a,"update");return t(e,n)}},672111,e=>{"use strict";e.s(["ThemeProvider",()=>n]);var t=e.i(337884),r=e.i(730315),a=e.i(870088);function n(e){let{children:n,...i}=e;return(0,a.useEffect)(()=>{let e=localStorage.getItem("accent-theme")||"theme-purple";"theme-default"!==e&&(document.documentElement.classList.remove("theme-blue","theme-purple","theme-rose","theme-green"),document.documentElement.classList.add(e),localStorage.getItem("accent-theme")||localStorage.setItem("accent-theme",e))},[]),(0,t.jsx)(r.ThemeProvider,{attribute:"class",defaultTheme:"system",enableSystem:!0,...i,children:n})}},375252,e=>{"use strict";e.s(["SafariCaptchaFix",()=>i,"SafariDatePickerFix",()=>n,"SafariFixes",()=>r,"SafariScheduleFix",()=>a]);var t=e.i(870088);function r(){return(0,t.useEffect)(()=>{let e=window.navigator.userAgent.toLowerCase();if(-1===e.indexOf("safari")||-1!==e.indexOf("chrome")||-1!==e.indexOf("android"))return;document.documentElement.classList.add("safari");let t=()=>{document.querySelectorAll("button").forEach(e=>{e.hasAttribute("data-safari-button-fixed")||(e.setAttribute("data-safari-button-fixed","true"),e.addEventListener("touchstart",()=>{},{passive:!0}))})};t();let r=setInterval(t,2e3),a=new MutationObserver(e=>{let r=!1;e.forEach(e=>{"childList"===e.type&&e.addedNodes.length>0&&(r=!0)}),r&&t()});return a.observe(document.body,{childList:!0,subtree:!0}),()=>{clearInterval(r),a.disconnect()}},[]),null}function a(){return(0,t.useEffect)(()=>{let e=window.navigator.userAgent.toLowerCase();if(-1===e.indexOf("safari")||-1!==e.indexOf("chrome")||-1!==e.indexOf("android"))return;document.documentElement.classList.add("safari");let t=()=>document.querySelectorAll('[data-schedule-button="true"]'),r=new MutationObserver(e=>{for(let r of e)"childList"===r.type&&t().length});return r.observe(document.body,{childList:!0,subtree:!0}),()=>{r.disconnect()}},[]),null}function n(){return(0,t.useEffect)(()=>{let e=window.navigator.userAgent.toLowerCase();if(-1===e.indexOf("safari")||-1!==e.indexOf("chrome")||-1!==e.indexOf("android"))return;let t=()=>{document.querySelectorAll('.rdp, .react-datepicker, [data-safari-datepicker="true"]').forEach(e=>{e instanceof HTMLElement&&(e.style.visibility="visible",e.style.opacity="1",e.style.display="block",e.style.zIndex="9999",e.setAttribute("data-safari-fixed","true"))}),document.querySelectorAll("[data-radix-popper-content-wrapper]").forEach(e=>{e instanceof HTMLElement&&(e.style.visibility="visible",e.style.opacity="1",e.style.display="block",e.style.zIndex="9999",e.setAttribute("data-safari-fixed","true"))}),document.querySelectorAll('[data-calendar-trigger="true"], [data-schedule-button="true"]').forEach(e=>{e instanceof HTMLElement&&(e.style.cursor="pointer",e.hasAttribute("data-safari-trigger-fixed")||(e.setAttribute("data-safari-trigger-fixed","true"),e.addEventListener("touchstart",()=>{},{passive:!0})))})};t();let r=setInterval(t,1e3),a=new MutationObserver(e=>{let r=!1;
3e.forEach(e=>{"childList"===e.type&&e.addedNodes.length>0&&e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&((e.matches('.rdp, .react-datepicker, [data-safari-datepicker="true"]')||e.querySelector('.rdp, .react-datepicker, [data-safari-datepicker="true"]'))&&(r=!0),(e.matches('[data-calendar-trigger="true"], [data-schedule-button="true"]')||e.querySelector('[data-calendar-trigger="true"], [data-schedule-button="true"]'))&&(r=!0),(e.matches("[data-radix-popper-content-wrapper]")||e.querySelector("[data-radix-popper-content-wrapper]"))&&(r=!0))})}),r&&t()});return a.observe(document.body,{childList:!0,subtree:!0}),()=>{clearInterval(r),a.disconnect()}},[]),null}function i(){return(0,t.useEffect)(()=>{let e,t=window.navigator.userAgent.toLowerCase();if(-1===t.indexOf("safari")||-1!==t.indexOf("chrome")||-1!==t.indexOf("android"))return;let r=()=>{let e=0;document.querySelector('iframe[src*="challenges.cloudflare.com"], iframe[src*="turnstile"], iframe[src*="hcaptcha.com"], div[class*="hcaptcha-challenge"], div[class*="turnstile"], [data-cf-turnstile]')?(document.querySelectorAll('.relative.w-full, [class*="backdrop-blur"], .glow-card, [class*="rounded-3xl"]').forEach(t=>{t.style.zIndex="1",t.style.isolation="auto",t.style.transform="none",t.style.webkitTransform="none",t.setAttribute("data-safari-z-lowered","true"),e++}),document.querySelectorAll('.container, [class*="mx-auto"], [class*="max-w"]').forEach(e=>{let t=window.getComputedStyle(e);t.zIndex&&parseInt(t.zIndex)>10&&(e.style.zIndex="1",e.style.isolation="auto",e.setAttribute("data-safari-z-lowered","true"))})):document.querySelectorAll('[data-safari-z-lowered="true"]').forEach(e=>{e instanceof HTMLElement&&(e.style.zIndex="",e.style.isolation="",e.style.transform="",e.style.webkitTransform="",e.removeAttribute("data-safari-z-lowered"))});let t=document.querySelectorAll('iframe[src*="hcaptcha.com"], iframe[title*="hcaptcha"], iframe[title*="hCaptcha"], iframe[src*="js.hcaptcha.com"]');t.forEach(t=>{t instanceof HTMLElement&&(t.parentElement&&t.parentElement!==document.body&&t.parentElement.closest('.relative.w-full, [class*="backdrop-blur"]')&&document.body.appendChild(t),t.style.zIndex="2147483647",t.style.position="fixed",t.style.transform="translateZ(0)",t.style.webkitTransform="translateZ(0)",t.setAttribute("data-safari-captcha-fixed","true"),e++)});let r=document.querySelectorAll('iframe[src*="challenges.cloudflare.com"], iframe[src*="turnstile"]');r.forEach(t=>{t instanceof HTMLElement&&("fixed"===window.getComputedStyle(t).position&&(t.style.position=""),t.style.zIndex="2147483647",t.style.transform="translateZ(0)",t.style.webkitTransform="translateZ(0)",t.setAttribute("data-safari-captcha-fixed","true"),e++)});let a=document.querySelectorAll('div[class*="hcaptcha"], div[data-hcaptcha-widget-id], [data-hcaptcha-response], div[id*="hcaptcha"], .h-captcha, [class*="h-captcha"]');a.forEach(t=>{t instanceof HTMLElement&&(t.style.zIndex="2147483647",t.style.isolation="isolate",t.style.transform="translateZ(0)",t.style.webkitTransform="translateZ(0)",t.style.position="fixed",t.setAttribute("data-safari-captcha-fixed","true"),e++)});let n=document.querySelectorAll('div[class*="turnstile"]:not([class*="hcaptcha"]), [data-cf-turnstile], .turnstile-container, .turnstile-wrapper');n.forEach(t=>{t instanceof HTMLElement&&("fixed"===window.getComputedStyle(t).position&&(t.style.position=""),t.style.zIndex="2147483647",t.style.isolation="isolate",t.style.transform="translateZ(0)",t.style.webkitTransform="translateZ(0)",t.setAttribute("data-safari-captcha-fixed","true"),e++)}),document.querySelectorAll('div[class*="hcaptcha-challenge"], div[id*="hcaptcha-challenge"], [class*="hcaptcha-modal"], [id*="hcaptcha-modal"], .hcaptcha-challenge-container, .hcaptcha-challenge-overlay').forEach(t=>{t instanceof HTMLElement&&(t.closest('.relative.w-full, [class*="backdrop-blur"]')&&t.parentElement&&document.body.appendChild(t),t.style.zIndex="2147483647",t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t.style.transform="translateZ(0)",t.style.webkitTransform="translateZ(0)",t.style.isolation="isolate",t.setAttribute("data-safari-captcha-fixed","true"),e++)}),document.querySelectorAll(".hcaptcha-container, .hcaptcha-wrapper").forEach(t=>{t instanceof HTMLElement&&(t.style.zIndex="2147483647",t.style.isolation="isolate",t.style.position="fixed",t.style.transform="translateZ(0)",t.style.webkitTransform="translateZ(0)",t.setAttribute("data-safari-captcha-fixed","true"),e++)}),document.querySelectorAll('[id*="turnstile"], [class*="turnstile"], [data-cf-turnstile], [id*="hcaptcha"], [class*="hcaptcha"], [data-hcaptcha]').forEach(t=>{t instanceof HTMLElement&&!t.hasAttribute("data-safari-captcha-fixed")&&(t.style.zIndex="2147483647",t.setAttribute("data-safari-captcha-fixed","true"),e++)}
3),[...Array.from(t),...Array.from(r)].forEach(e=>{let t=e.parentElement,r=0;for(;t&&r<5;){if(t instanceof HTMLElement){let e=window.getComputedStyle(t);e.zIndex&&0x7fffffff>parseInt(e.zIndex)&&(t.style.zIndex="2147483647",t.style.isolation="isolate")}t=t.parentElement,r++}}),e>0&&(t.length,r.length,a.length,n.length)};r(),e=setInterval(()=>{document.querySelector('iframe[src*="challenges.cloudflare.com"], iframe[src*="turnstile"], iframe[src*="hcaptcha.com"], div[class*="hcaptcha-challenge"], div[class*="turnstile"], [data-cf-turnstile]')?(clearInterval(e),e=setInterval(()=>{r()},100)):(clearInterval(e),e=setInterval(()=>{r()},500)),r()},200);let a=new MutationObserver(e=>{let t=!1;e.forEach(e=>{"childList"===e.type&&e.addedNodes.length>0&&e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&(e.matches('iframe[src*="challenges.cloudflare.com"], iframe[src*="turnstile"], div[class*="turnstile"], [data-cf-turnstile], iframe[src*="hcaptcha.com"], iframe[title*="hcaptcha"], div[class*="hcaptcha"], [data-hcaptcha-widget-id], div[class*="hcaptcha-challenge"], div[id*="hcaptcha"], [class*="hcaptcha-modal"]')||e.querySelector('iframe[src*="challenges.cloudflare.com"], iframe[src*="turnstile"], div[class*="turnstile"], [data-cf-turnstile], iframe[src*="hcaptcha.com"], iframe[title*="hcaptcha"], div[class*="hcaptcha"], [data-hcaptcha-widget-id], div[class*="hcaptcha-challenge"], div[id*="hcaptcha"], [class*="hcaptcha-modal"]'))&&(t=!0)})}),t&&(r(),setTimeout(r,10),setTimeout(r,50),setTimeout(r,100))});return a.observe(document.body,{childList:!0,subtree:!0}),()=>{clearInterval(e),a.disconnect()}},[]),null}},770627,e=>{"use strict";e.s(["getSignupContext",()=>r]);let t=[{match:["reply","engager","comment"],context:{headline:"Reply faster, grow",highlight:"every day",subcopy:"You just saw how good AI replies can be. Bolta drafts on-brand replies and comments across every platform â so engagement never stalls.",bullets:["On-brand replies in your voice","Across X, LinkedIn, Instagram & Threads","Turn comments into conversations"]}},{match:["engagement","roi","calculator","cac","budget","pricing","audit","benchmark","analyzer","score"],context:{headline:"Know your numbers,",highlight:"then grow them",subcopy:"You measured it â now improve it. Bolta plans, creates, and schedules the content that actually moves these metrics.",bullets:["Content built to lift engagement","Consistent posting, automatically","See what's working at a glance"]}},{match:["caption","hashtag","bio","username","handle","thread","content","post","video-script","description","generator","optimizer","title"],context:{headline:"Create great content,",highlight:"on autopilot",subcopy:"That was one post. Bolta's AI writes, optimizes, and schedules a whole calendar of them â in your voice, across every platform.",bullets:["AI content in your brand voice","Optimized for each platform","Planned and published for you"]}},{match:["download","transcript","thumbnail","repurpose","clip"],context:{headline:"Turn one video into",highlight:"a week of posts",subcopy:"Downloading is step one. Bolta repurposes any video into platform-native posts and schedules them across your accounts automatically.",bullets:["One source â 10+ native posts","Auto-scheduled across platforms","No watermarks, no busywork"]}}];function r(e){if(!e)return null;let r=e.toLowerCase();for(let e of t)if(e.match.some(e=>r.includes(e)))return e.context;return null}},840267,e=>{e.v(e=>Promise.resolve().then(()=>e(337692)))},647540,e=>{e.v(t=>Promise.all(["static/chunks/09dc8e44cfd5aa94.js","static/chunks/f4e9b4b5a348faac.js","static/chunks/b824ff02f1bc38fe.js","static/chunks/7139f5b54a657036.js"].map(t=>e.l(t))).then(()=>t(97244)))},671782,e=>{e.v(t=>Promise.all(["static/chunks/cf000f62178d98bc.js","static/chunks/74f0e50410a70270.js","static/chunks/d9b72372da7654f8.js"].map(t=>e.l(t))).then(()=>t(634317)))},519850,e=>{e.v(t=>Promise.all(["static/chunks/63a37643872da1d0.js"].map(t=>e.l(t))).then(()=>t(677446)))},90015,e=>{e.v(e=>Promise.resolve().then(()=>e(920755)))},206605,e=>{e.v(t=>Promise.all(["static/chunks/14f1f914d50fc92f.js"].map(t=>e.l(t))).then(()=>t(401926)))},578291,e=>{e.v(t=>Promise.all(["static/chunks/ba7738f33890eef1.js"].map(t=>e.l(t))).then(()=>t(338753)))},896842,e=>{e.v(t=>Promise.all(["static/chunks/9c0e7061f58bfe7a.js"].map(t=>e.l(t))).then(()=>t(621822)))},817650,e=>{e.v(e=>Promise.resolve().then(()=>e(105978)))}]); 4 5//# sourceMappingURL=3d343afc074a8478.js.map 6//# debugId=8c44c779-eb2a-5f7b-9cb8-8ae8e60132b0
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.