1import{a as _,L as d}from"./auth.slice-Czr18Mk3.js";import{f as k,g as A}from"./deviceTokenGenerator-CIuoFpqf.js";import{c as p,i as P}from"./auth-Bhwx-eDv.js";const f="/api/core",y="/api/acc/v1",R="/api/chat",U="/api/inv/v1",b="/api/feed/v1",D="/api/order/v1",S="/api/core/v1",v="/api/jobs",g="/api/manob/v1",c={locked:!1,acquire:()=>new Promise(a=>{const e=()=>{c.locked?setTimeout(e,100):(c.locked=!0,a(()=>{c.locked=!1}))};e()}),isLocked:()=>c.locked,waitForUnlock:()=>new Promise(a=>{const e=()=>{c.locked?setTimeout(e,100):a(()=>{})};e()})},u=async(a,e,n)=>{const o=typeof a=="string"?f:a?.baseUrl||f;return k({baseUrl:o,prepareHeaders:s=>{const{deviceId:r,deviceType:l}=A(),i=typeof window<"u"?localStorage.getItem("p_aut"):null;return i&&(P(i)?s.set("Authorization",`Bearer ${i}`):s.set("Authorization",`Bearer ${i}`)),s.set("x-device-id",r),s.set("x-device-type",l),s.set("x-app-client","manob-web"),s.set("X-Requested-With","XMLHttpRequest"),typeof window<"u"&&s.set("x-page-url",window.location.href),s},credentials:"same-origin"})(a,e,n)},B=async(a,e,n)=>{let o=await u(a,e,n);if(o?.data?.statusCode===401||o?.error?.status===401)if(c.isLocked())await c.waitForUnlock(),o=await u(a,e,n);else{const s=await c.acquire();try{const r=e.getState().auth?.accessToken,i=await(await fetch(`${y}/auth/token`,{headers:{Authorization:`Bearer ${r}`}})).json();if(i?.data){const t=i?.data?.access_token;e.dispatch(_(t)),o=await u(a,e,n)}else if(e.dispatch(d()),p(),typeof window<"u"){const t=window.location.pathname;t==="/"||t.startsWith("/auth/")||t==="/pricing"||t.startsWith("/articles/")||t==="/help"||t.startsWith("/help/")||t==="/support-contact"||t==="/support-policy"||(window.location.href="/auth/sign-in")}}finally{s()}}else if(o?.data?.statusCode===403||o?.error?.status===403){const s=o?.error?.data,r=o?.data,l=s?.code||r?.code;if(!(typeof l=="string"&&["HOSTING_PLAN_LIMIT","DOMAIN_FORBIDDEN"].includes(l))){if(e.dispatch(d()),p(),typeof window<"u"){const t=window.location.pathname;t==="/"||t.startsWith("/auth/")||t==="/pricing"||t.startsWith("/articles/")||t==="/help"||t.startsWith("/help/")||t==="/support-contact"||t==="/support-policy"||(window.location.href="/auth/sign-in")}}}return o};export{y as A,D as a,B as b,U as c,S as d,b as e,g as f,v as g,R as h};
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.