import{F as n,z as i}from"./zod-U2NFpcFA.js";var s=n({detail:i()}),c=n({error:i()});function u(r){if(!r)return"Unknown error";if(r instanceof Error){let t=s.safeParse(r.cause);return t.success?t.data.detail:o(r.message)}if(typeof r=="object"){let t=s.safeParse(r);if(t.success)return t.data.detail;let e=c.safeParse(r);if(e.success)return e.data.error}try{return JSON.stringify(r)}catch{return String(r)}}function o(r){let t=f(r);if(!t)return r;let e=s.safeParse(t);if(e.success)return e.data.detail;let a=c.safeParse(t);return a.success?a.data.error:r}function f(r){try{return JSON.parse(r)}catch{return r}}var l=class extends Error{constructor(r="The cell containing this UI element has not been run yet. Please run the cell first."){super(r),this.name="CellNotInitializedError"}};export{u as n,l as t};
