1import{u as d,bd as f,bJ as s,bn as u}from"./hpAo83vz.js";function i(t){const a=s(t,"response._data")??s(t,"response.data")??s(t,"data"),n=s(a,"errors");if(n&&typeof n=="object"){const l=Object.values(n).flat().filter(Boolean)[0];if(l)return l}return s(a,"message")||s(a,"error.message")||null}function h(){const{$toast:t}=d(),a=f();return{handleRequestError:e=>{const o=s(e.config,"url");if(e.response){const r=s(e.response.data,"error.message")||"Error on request";throw u({statusCode:e.response.status,message:`API error: ${r}`})}else if(e.request){const r=`Client - The request was made but no response was received: ${o}`;throw u({statusCode:500,message:r})}else if(o){const r=`Client - Could not start the request to ${o}`;throw u({statusCode:500,message:r})}else throw u(e)},showErrorMessage:(e,o=null)=>{const r=s(e.config,"url");if(o)return t.error(o,{duration:5e3});if(e.response){let c=i(e)||`${e.response.status} - Error on request.`;a.path.startsWith("/profile")&&(c+=" Please contact support."),t.error(c,{duration:5e3})}else e.request?t.error(`The request was made but no response was received: ${r}`):t.error(`Could not start the request to ${r}`)},getErrorMessage:(e=null,o=null)=>{const r=o??"An error occurred, please try again";return i(e)||r}}}export{h as u};
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.