1import{n as e}from"./client-DvcF3-9R.js";var t=[[/lovable\s*ai\s*gateway/gi,`the service`],[/lovable\s*ai/gi,`the service`],[/lovable\.dev/gi,`the service`],[/openai|gpt-?\d+(\.\d+)?|chatgpt/gi,`the service`],[/anthropic|claude(-[a-z0-9.-]+)?/gi,`the service`],[/gemini|google\s*ai|vertex/gi,`the service`],[/mistral|llama|grok|xai/gi,`the service`],[/dashscope|alibaba|qwen[-a-z0-9.]*|tongyi/gi,`the service`],[/openrouter|replicate|fal\.ai|fireworks|together\.ai|deepinfra|groq/gi,`the service`],[/runway|pika|luma|kling|minimax|veo|sora|stability|stable\s*diffusion|midjourney/gi,`the service`],[/serper|firecrawl|pexels|tavily|brave\s*search/gi,`the service`],[/supabase|postgres|pgsql/gi,`the database`],[/resend|sendgrid|mailgun|postmark/gi,`the email service`],[/e2b|sandbox\.dev/gi,`the runtime`],[/edge\s*function(s)?( returned)?( a)?( non-?2xx)?( status)?( code)?/gi,`the service`],[/functionshttperror|functionsfetcherror|functionsrelayerror/gi,`the service`],[/sk-[a-z0-9-]{20,}/gi,`[redacted]`],[/bearer\s+[a-z0-9._-]+/gi,`[redacted]`]];function n(e){let n=((e instanceof Error?e.message:typeof e==`string`?e:(()=>{try{return JSON.stringify(e)}catch{return String(e)}})())??``).toString().slice(0,1e3);for(let[e,r]of t)n=n.replace(e,r);return n}function r(e,t=`Something went wrong. Please try again.`){let r=n(e).toLowerCase();return r?r.includes(`insufficient`)||r.includes(`credit`)||r.includes(`402`)?`You're out of credits. Top up to continue.`:r.includes(`429`)||r.includes(`rate`)||r.includes(`too many`)?`Too many requests. Please wait a moment and try again.`:r.includes(`401`)||r.includes(`403`)||r.includes(`unauthor`)?`You're not signed in or don't have access to this action.`:r.includes(`network`)||r.includes(`fetch`)||r.includes(`timeout`)||r.includes(`econn`)||r.includes(`offline`)?`Network issue. Check your connection and try again.`:r.includes(`non-2xx`)||r.includes(`the service`)||r.includes(`status code`)?`The service is busy right now. Please try again in a moment.`:r.includes(`empty response`)||r.includes(`could not parse`)?`We couldn't complete this. Please rephrase your request and try again.`:t:t}async function i(t,r){try{let i=n(t),a=t instanceof Error&&t.stack?n(t.stack):null;await e.functions.invoke(`report-error`,{body:{source:r.source,route:r.route??(typeof window<`u`?window.location.pathname:null),message:i,raw_error:a,context:r.context??{},user_agent:typeof navigator<`u`?navigator.userAgent:null}})}catch{}}export{i as n,r as t};
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.