import { v as validateAuth } from './auth-DeCdZ83n.js';
import { t as toErrorMessage } from './error-DDXB3duW.js';
import { j as json } from './shared-server-sSGG17Df.js';
import 'crypto';

const POST = async ({ request }) => {
  try {
    const authError = validateAuth(request);
    if (authError) {
      return authError;
    }
    const body = await request.json();
    console.log("Webhook received:", {
      body,
      timestamp: (/* @__PURE__ */ new Date()).toISOString()
    });
    return json({
      message: "Webhook received successfully",
      success: true,
      timestamp: (/* @__PURE__ */ new Date()).toISOString()
    });
  } catch (error) {
    console.error("[webhook] Failed to process webhook:", toErrorMessage(error));
    return json(
      {
        error: "Failed to process webhook"
      },
      { status: 500 }
    );
  }
};

export { POST };
//# sourceMappingURL=_server.ts-BStnNIcq.js.map
