PageSourceSearch

https://www.adsflo.ai/_next/static/chunks/1348-a6982a930294cd51.js

js adsflo.ai collected 2026-10-05 15:26:52 UTC 8,881 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1348],{41841:function(e,t,r){r.d(t,{Y:function(){return i},k:function(){return s}});var n=r(57437),a=r(2265);let o=(0,a.createContext)({isTransitioning:!1,phase:"idle",progress:0,statusMessage:"",userName:"",variant:"login",startTransition:()=>{},signalDataReady:()=>{},cancelTransition:()=>{}});function s(e){let{children:t}=e,[r,s]=(0,a.useState)("idle"),[i,c]=(0,a.useState)(0),[u,l]=(0,a.useState)(""),[d,g]=(0,a.useState)("login"),w=(0,a.useRef)(0),m=(0,a.useRef)(null),p=(0,a.useRef)(null),h=(0,a.useRef)(null),y=(0,a.useRef)(!1),C=(0,a.useRef)(0),f="idle"!==r,E=(0,a.useCallback)(()=>{m.current&&(clearInterval(m.current),m.current=null),p.current&&(clearTimeout(p.current),p.current=null),h.current&&(clearTimeout(h.current),h.current=null)},[]),b=(0,a.useCallback)(()=>{E(),s("idle"),c(0),y.current=!1},[E]),v=(0,a.useCallback)(e=>{C.current===e&&(E(),c(100),s("completing"),h.current=setTimeout(()=>{C.current===e&&(s("exiting"),h.current=setTimeout(()=>{C.current===e&&b()},400))},200))},[E,b]),S=(0,a.useCallback)(()=>{y.current=!0;let e=Math.max(0,1e3-(Date.now()-w.current)),t=C.current;e<=0?v(t):h.current=setTimeout(()=>{v(t)},e)},[v]),k=(0,a.useCallback)(()=>{C.current+=1,b()},[b]),T=(0,a.useCallback)(e=>{var t;E(),y.current=!1;let r=++C.current;l((null==e?void 0:null===(t=e.userName)||void 0===t?void 0:t.split(" ")[0])||""),g((null==e?void 0:e.variant)||"login"),c(0),s("entering"),w.current=Date.now(),setTimeout(()=>{C.current===r&&s("loading")},300);let n=0;m.current=setInterval(()=>{C.current===r&&(n<40?n+=3:n<70?n+=1.5:n<85&&(n+=.5),c(n=Math.min(n,85)))},100),p.current=setTimeout(()=>{C.current===r&&v(r)},8e3)},[E,v]);(0,a.useEffect)(()=>{let e=()=>{"idle"!==r&&k()};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[r,k]),(0,a.useEffect)(()=>()=>E(),[E]);let x=(0,a.useMemo)(()=>i>=85?"signup"===d?"Welcome to AdsFLO!":"Welcome back, ".concat(u||"there","!"):i>=50?"Preparing your dashboard...":i>=20?"Loading your workspace...":"signup"===d?"Setting up your account...":"Securing your session...",[d,i,u]),A=(0,a.useMemo)(()=>({isTransitioning:f,phase:r,progress:i,statusMessage:x,userName:u,variant:d,startTransition:T,signalDataReady:S,cancelTransition:k}),[f,r,i,x,u,d,T,S,k]);return(0,n.jsx)(o.Provider,{value:A,children:t})}let i=()=>(0,a.useContext)(o)},94125:function(e,t,r){r.d(t,{C:function(){return o}});var n=r(5662);async function a(e,t){let{token:r,...a}=t||{},o=await fetch((0,n.h)(e),{...a,headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer ".concat(r)}:{},...(null==a?void 0:a.headers)||{}},cache:"no-store"}),s=await o.text(),i=s?JSON.parse(s):null;if(!o.ok){let e=Error((null==i?void 0:i.message)||"HTTP ".concat(o.status));throw e.status=o.status,e.payload=i,e}return i}let o={getCategories:async e=>{try{let t=await a("/api/brand/categories",{token:e});return null==t||t.length,t}catch(e){throw e}},getState:async e=>{try{return await a("/api/onboarding/state",{token:e})}catch(e){throw e}},updateState:async(e,t)=>{try{return await a("/api/onboarding/state",{method:"PUT",token:t,body:JSON.stringify(e)})}catch(e){throw e}},complete:async e=>{try{return await a("/api/onboarding/complete",{method:"POST",token:e})}catch(e){throw e}},getUserProfile:async e=>{try{var t;let r=await a("/user/me",{token:e});return null==r||r.id,null==r||null===(t=r.onboarding)||void 0===t||t.status,r}catch(e){throw e}},updateCategories:async(e,t,r)=>{try{e.length,e||(e=[]);let n=await o.getState(r),a=n.addCategories||[],s=e.filter(e=>!a.includes(e)),i=a.filter(t=>!e.includes(t));n.extensionInstalled,n.instagramConnected;let c={currentStep:t,addCategories:s,removeCategories:i,extensionInstalled:n.extensionInstalled,instagramConnected:n.instagramConnected};return await o.updateState(c,r)}catch(e){throw Error("Failed to update categories: ".concat(e instanceof Error?e.message:"Unknown error"))}},updateExtension:async(e,t,r)=>{try{let n=await o.getState(r),a={currentStep:t,addCategories:n.addCategories||[],removeCategories:n.removeCategories||[],extensionInstalled:e,instagramConnected:n.instagramConnected};return await o.updateState(a,r)}catch(e){throw Error("Failed to update extension status: ".concat(e instanceof Error?e.message:"Unknown error"))}},updateInstagram:async(e,t,r)=>{try{let n=await o.getState(r),a={currentStep:t,addCategories:n.addCategories||[],removeCategories:n.removeCategories||[],extensionInstalled:n.extensionInstalled,instagramConnected:e};return await o.updateState(a,r)}catch(e){throw Error("Failed to update Instagram status: ".concat(e instanceof Error?e.message:"Unknown error"))}},skipStep:async(e,t)=>{try{let r=await o.getState(t),n={currentStep:e,addCategories:r.addCategories||[],removeCategories:r.removeCategories||[],extensionInstalled:r.extensionInstalled,instagramConnected:r.instagramConnected};return await o.updateState(n,t)}catch(e){throw Error("Failed to skip step: ".concat(e instanceof Error?e.message:"Unknown error"))}},goBackStep:async(e,t)=>{try{let r=await o.getState(t),n={currentStep:function(e){let t=["CATEGORIES","BRANDS","EXTENSION","INSTAGRAM"],r=t.indexOf(e)-1;return r<0?"CATEGORIES":t.slice(0,r+1).join(" | ")}(e),addCategories:r.addCategories||[],removeCategories:r.removeCategories||[],extensionInstalled:r.extensionInstalled,instagramConnected:r.instagramConnected};return await o.updateState(n,t)}catch(e){throw Error("Failed to go back step: ".concat(e instanceof Error?e.message:"Unknown error"))}},resetOnboarding:async e=>{try{return await o.updateState({currentStep:"CATEGORIES",addCategories:[],removeCategories:[],extensionInstalled:!1,instagramConnected:!1},e)}catch(e){throw Error("Failed to reset onboarding: ".concat(e instanceof Error?e.message:"Unknown error"))}},checkOnboardingStatus:async e=>{try{let t=(await o.getUserProfile(e)).onboarding;if(!t)return{completed:!1,currentStep:"CATEGORIES",shouldShow:!0,progress:null};return{completed:"COMPLETED"===t.status,currentStep:t.current_step,shouldShow:t.should_show,progress:{selectedCategories:t.selected_category_ids||[],categoriesCount:t.selected_category_count||0,brandsCount:t.followed_brand_count||0,extensionInstalled:t.extension_
1installed||!1,instagramConnected:t.instagram_connected||!1}}}catch(e){throw e}}}},92506:function(e,t,r){r.d(t,{Wp:function(){return c},yj:function(){return u}});let n=e=>{let t=new Uint8Array(e),r="";for(let e=0;e<t.length;e+=1024)r+=String.fromCharCode(...t.subarray(e,e+1024));return window.btoa(r)},a=e=>{let t=window.atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer},o=async(e,t)=>{try{let t=await s(),r=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},t,new TextEncoder().encode(e)),o=new Uint8Array(r.byteLength+a.byteLength);return o.set(new Uint8Array(r),0),o.set(new Uint8Array(a),r.byteLength),n(o.buffer)}catch(e){throw console.error("Encryption failed:",e),Error("Failed to encrypt token")}},s=async()=>{let e="gKYzDyUJy+HJXTzVYQJ99UqNCIsujO67fwun6DX87D4=";if(!e)throw Error("Missing encryption key");return crypto.subtle.importKey("raw",a(e),{name:"AES-GCM"},!1,["encrypt","decrypt"])};r(94125);let i=async(e,t)=>new Promise(r=>{var n,a;let o=!1;(null===(a=window.chrome)||void 0===a?void 0:null===(n=a.runtime)||void 0===n?void 0:n.sendMessage)&&window.chrome.runtime.sendMessage("pdnmbhbfkipgkeeaffaibdbadiieobce",{action:"secureAuth",payload:{token:e,userData:t,timestamp:Date.now()}},e=>{window.chrome.runtime.lastError&&console.error("[Extension] Runtime error:",window.chrome.runtime.lastError.message),(null==e?void 0:e.status)==="received"&&(o=!0),r()}),setTimeout(()=>{o||(console.warn("[Extension] Using fallback postMessage."),window.postMessage({type:"FALLBACK_AUTH",payload:{token:e,userData:t}},"*")),r()},220)}),c=async()=>new Promise(e=>{var t,r;let n=!1;(null===(r=window.chrome)||void 0===r?void 0:null===(t=r.runtime)||void 0===t?void 0:t.sendMessage)&&window.chrome.runtime.sendMessage("pdnmbhbfkipgkeeaffaibdbadiieobce",{action:"LOGOUT"},t=>{window.chrome.runtime.lastError&&console.warn("[Extension] Runtime logout error:",window.chrome.runtime.lastError.message),(null==t?void 0:t.status)==="logged_out"&&(n=!0),e()}),setTimeout(()=>{n||(console.warn("[Extension] Using fallback logout via postMessage."),window.postMessage({type:"FALLBACK_LOGOUT"},"*")),e()},220)}),u=async e=>{let{token:t,user:r,redirectUri:n,router:a,fallbackRedirectPath:s="/discover",delay:c=180}=e;try{try{let e=await o(t,r);await i(e,r)}catch(e){console.error("[AuthUtils] Failed to sync token with extension:",e)}let e=s;n&&n.startsWith("/")&&!n.includes("/login")&&!n.includes("/signup")&&(e=n),setTimeout(()=>{a.replace(e)},c)}catch(e){console.error("[authUtils] Error in redirect:",e),setTimeout(()=>{a.replace(s)},c)}}}}]);

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.