PageSourceSearch

https://app.beventi.co/_nuxt/DlOt-9UE.js

js beventi.co collected 2026-09-25 03:56:03 UTC 2,827 bytes, 1 lines download raw bytes

1import{cx as b,bL as C,aP as n,aZ as u,b_ as B}from"./DelUBm_W.js";import{useWholesaleStore as N}from"./B1YEKxs_.js";import{i as L}from"./i3xcsxtZ.js";import{w as h}from"./CVKoFnEm.js";import"./FQZYZ68A.js";import"./Cz2sUNRN.js";import"./BcepHHMa.js";import"./BGRkBnG2.js";import"./BTF41GTt.js";const i="wholesale_nav_state",R=300*1e3,s=u(null),o=u(null),a=u(null),r=u(!1),c=u(!1);function _(){s.value=null,o.value=null,a.value=null,r.value=!1,c.value=!1,typeof window<"u"&&localStorage.removeItem(i)}function J(){const f=b(),v=C(),p=n(()=>{const e=[],l=typeof v?.path=="string"&&v.path.startsWith("/wholesale/listing");if((o.value===!0||l)&&e.push({name:"Your Listing",href:"/wholesale/listing",route:"wholesale-listing"}),e.push({name:"Browse",href:h.browse,route:"wholesale-browse"},{name:"Sellers",href:h.sellers,route:"wholesale-sellers"},{name:"Bookstores",href:h.bookstores,route:"wholesale-bookstores"}),a.value===!0&&e.push({name:"Orders",href:"/wholesale/orders",route:"wholesale-orders"}),a.value===!0||s.value===!0){const t=f.totalUnreadCount;e.push({name:"Messages",href:"/wholesale/messages",route:"wholesale-messages",badge:t>0?t>99?"99+":t:void 0,badgeTone:t>0?"amber":void 0})}return e.push({name:"Guide",href:h.guide,route:"wholesale-guide"}),e}),g=n(()=>s.value===!0||a.value===!0),y=n(()=>s.value===null||a.value===null||o.value===null),W=n(()=>"/wholesale");function m(){if(!(typeof window>"u"))try{const e=localStorage.getItem(i);if(e){const l=JSON.parse(e);Date.now()-l.timestamp<R&&(s.value=l.hasWholesaleForms,o.value=typeof l.hasAnyWholesaleForm=="boolean"?l.hasAnyWholesaleForm:l.hasWholesaleForms,a.value=l.hasBuyerAccounts)}}catch(e){console.error("Failed to load wholesale nav cache:",e)}}function A(){if(!(typeof window>"u"))try{const e={hasWholesaleForms:s.value??!1,hasAnyWholesaleForm:o.value??!1,hasBuyerAccounts:a.value??!1,timestamp:Date.now()};localStorage.setItem(i,JSON.stringify(e))}catch(e){console.error("Failed to save wholesale nav cache:",e)}}async function d(){if(!r.value){r.value=!0;try{const e=N(),[l,t]=await Promise.all([B.getAll(),e.fetchWholesaleBuyers(!0)]),w=Array.isArray(l?.data)?l.data:[];s.value=w.some(F=>F?.status==="published"),o.value=w.length>0,a.value=(t||[]).some(L),(s.value||a.value)&&f.fetchUnreadCount().catch(()=>{}),A()}catch(e){console.error("Failed to refresh wholesale state:",e),s.value===null&&(s.value=!1),o.value===null&&(o.value=!1),a.value===null&&(a.value=!1)}finally{r.value=!1,c.value=!0}}}async function S(){c.value||(m(),await d())}return{hasWholesaleForms:s,hasAnyWholesaleForm:o,hasBuyerAccounts:a,isLoading:r,wholesaleNavItems:p,hasWholesaleAccess:g,isWholesaleLoading:y,wholesaleDefaultHref:W,initWholesaleNav:S,refreshWholesaleState:d,initFromCache:m,clearWholesaleNavState:_}}export{_ as clearWholesaleNavState,J as useWholesaleNav};

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.