{"version":3,"file":"error.mjs","sources":["../../../../../packages/utils/error.ts"],"sourcesContent":["import { isString } from 'sure-utils'\n\nclass SureUiError extends Error {\n  constructor(m: string) {\n    super(m)\n    this.name = 'SureUI Error'\n  }\n}\n\nexport function throwError(scope: string, m: string): never {\n  throw new SureUiError(`[${scope}] ${m}`)\n}\n\nexport function debugWarn(err: Error): void\nexport function debugWarn(scope: string, message: string): void\nexport function debugWarn(scope: string | Error, message?: string): void {\n  if (process.env.NODE_ENV !== 'production') {\n    const error: Error = isString(scope)\n      ? new SureUiError(`[${scope}] ${message}`)\n      : scope\n\n    console.warn(error)\n  }\n}\n"],"names":[],"mappings":";;AACA,MAAM,WAAW,SAAS,KAAK,CAAC;AAChC,EAAE,WAAW,CAAC,CAAC,EAAE;AACjB,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;AACb,IAAI,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;AAC/B,GAAG;AACH,CAAC;AACM,SAAS,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;AACrC,EAAE,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AACM,SAAS,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE;AAC1C,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;AAC7C,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;AACrF,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACxB,GAAG;AACH;;;;"}