{"version":3,"sources":["../src/core/client.ts","../src/utils/errors.ts"],"names":["FluidPayments","config","FluidError","code","message","FluidAPIError","statusCode","body","PaymentError","options","PaymentCancelledError","UnsupportedError","method"],"mappings":"aAkBO,IAAMA,CAAAA,CAAN,KAAoB,CACR,MAAA,CAEjB,YAAYC,CAAAA,CAAqB,CAC/B,IAAA,CAAK,MAAA,CAASA,EAChB,CAKA,IAAI,OAAA,EAAkB,CACpB,OAAO,OACT,CAKA,IAAI,WAAA,EAAwC,CAC1C,OAAO,IAAA,CAAK,MAAA,CAAO,WACrB,CAKA,MAAM,eAAA,EAAgD,CAEpD,OAAO,CACL,QAAA,CAAU,KAAA,CACV,SAAA,CAAW,MACX,MAAA,CAAQ,IACV,CACF,CACF,EC/CO,IAAMC,CAAAA,CAAN,cAAyB,KAAM,CAC3B,IAAA,CAET,WAAA,CAAYC,CAAAA,CAAcC,EAAiB,CACzC,KAAA,CAAMA,CAAO,CAAA,CACb,KAAK,IAAA,CAAO,YAAA,CACZ,IAAA,CAAK,IAAA,CAAOD,EACd,CACF,CAAA,CAKaE,CAAAA,CAAN,cAA4BH,CAAW,CACnC,UAAA,CACA,OAAA,CAET,WAAA,CACEI,EACAC,CAAAA,CACA,CACA,KAAA,CAAMA,CAAAA,CAAK,KAAMA,CAAAA,CAAK,OAAO,CAAA,CAC7B,IAAA,CAAK,IAAA,CAAO,eAAA,CACZ,IAAA,CAAK,UAAA,CAAaD,EAClB,IAAA,CAAK,OAAA,CAAUC,CAAAA,CAAK,QACtB,CACF,CAAA,CAKaC,CAAAA,CAAN,cAA2BN,CAAW,CAClC,SAAA,CACA,WAAA,CAET,WAAA,CAAYO,CAAAA,CAKT,CACD,KAAA,CAAMA,CAAAA,CAAQ,IAAA,CAAMA,CAAAA,CAAQ,OAAO,CAAA,CACnC,IAAA,CAAK,IAAA,CAAO,cAAA,CACZ,KAAK,SAAA,CAAYA,CAAAA,CAAQ,SAAA,CACzB,IAAA,CAAK,YAAcA,CAAAA,CAAQ,YAC7B,CACF,CAAA,CAKaC,CAAAA,CAAN,cAAoCR,CAAW,CACpD,aAAc,CACZ,KAAA,CAAM,mBAAA,CAAqB,+BAA+B,EAC1D,IAAA,CAAK,IAAA,CAAO,wBACd,CACF,EAKaS,CAAAA,CAAN,cAA+BT,CAAW,CACtC,OAET,WAAA,CAAYU,CAAAA,CAAgB,CAC1B,KAAA,CAAM,cAAe,CAAA,EAAGA,CAAM,CAAA,iCAAA,CAAmC,CAAA,CACjE,KAAK,IAAA,CAAO,kBAAA,CACZ,IAAA,CAAK,MAAA,CAASA,EAChB,CACF","file":"index.cjs","sourcesContent":["import type { FluidConfig, PaymentCapabilities } from \"./types\";\n\n/**\n * Main FluidPayments SDK class\n *\n * @example\n * ```typescript\n * import { FluidPayments } from '@fluid-app/fluid-payments';\n *\n * const fluid = new FluidPayments({\n *   apiKey: 'pk_live_xxx',\n *   environment: 'production',\n * });\n *\n * // Check capabilities\n * const capabilities = await fluid.getCapabilities();\n * ```\n */\nexport class FluidPayments {\n  private readonly config: FluidConfig;\n\n  constructor(config: FluidConfig) {\n    this.config = config;\n  }\n\n  /**\n   * Get the current SDK version\n   */\n  get version(): string {\n    return \"0.1.0\";\n  }\n\n  /**\n   * Get the configured environment\n   */\n  get environment(): \"production\" | \"sandbox\" {\n    return this.config.environment;\n  }\n\n  /**\n   * Detect which payment methods are available in the current browser\n   */\n  async getCapabilities(): Promise<PaymentCapabilities> {\n    // TODO: Implement actual capability detection\n    return {\n      applePay: false,\n      googlePay: false,\n      paypal: true,\n    };\n  }\n}\n","/**\n * Base error class for all Fluid SDK errors\n */\nexport class FluidError extends Error {\n  readonly code: string;\n\n  constructor(code: string, message: string) {\n    super(message);\n    this.name = \"FluidError\";\n    this.code = code;\n  }\n}\n\n/**\n * API errors (4xx, 5xx responses)\n */\nexport class FluidAPIError extends FluidError {\n  readonly statusCode: number;\n  readonly details: unknown;\n\n  constructor(\n    statusCode: number,\n    body: { code: string; message: string; details?: unknown },\n  ) {\n    super(body.code, body.message);\n    this.name = \"FluidAPIError\";\n    this.statusCode = statusCode;\n    this.details = body.details;\n  }\n}\n\n/**\n * Payment-specific errors\n */\nexport class PaymentError extends FluidError {\n  readonly paymentId?: string;\n  readonly declineCode?: string;\n\n  constructor(options: {\n    code: string;\n    message: string;\n    paymentId?: string;\n    declineCode?: string;\n  }) {\n    super(options.code, options.message);\n    this.name = \"PaymentError\";\n    this.paymentId = options.paymentId;\n    this.declineCode = options.declineCode;\n  }\n}\n\n/**\n * User cancelled the payment flow\n */\nexport class PaymentCancelledError extends FluidError {\n  constructor() {\n    super(\"payment_cancelled\", \"Payment was cancelled by user\");\n    this.name = \"PaymentCancelledError\";\n  }\n}\n\n/**\n * Payment method not supported\n */\nexport class UnsupportedError extends FluidError {\n  readonly method: string;\n\n  constructor(method: string) {\n    super(\"unsupported\", `${method} is not supported in this browser`);\n    this.name = \"UnsupportedError\";\n    this.method = method;\n  }\n}\n"]}