//#region src/auth/support-copilot-platforms.d.ts
/**
 * Single source of truth for the Support Copilot platform catalog.
 *
 * Consumed by:
 *   - the `SupportCopilotPlatformSchema` enum in validation/schemas.ts
 *   - the Manage UI dropdown (labels only)
 *   - the `GET /credential-gateway/.well-known/platforms` discovery endpoint
 *     (served to browser extensions so they can detect the current tab's platform)
 *
 * When a new platform is added here, everything else picks it up:
 *   - server-side `audience` validation accepts the new slug,
 *   - the manage UI dropdown gets the new option on next rebuild,
 *   - extensions get the new matcher on their next catalog fetch.
 */
interface SupportCopilotPageMatcher {
  /** Stable identifier for this page variant. Used by the extension for analytics
   *  and UI branching (ticket view vs. customer view vs. etc.). */
  pageType: string;
  /** Exact host (e.g., "secure.helpscout.net") or subdomain glob (e.g., "*.zendesk.com"). */
  hostGlob: string;
  /** Regex source applied to URL.pathname. Capture groups MUST be named via
   *  `(?<name>...)` — the extension reads them from `RegExp.exec(path)?.groups`.
   *  Named groups keep the names and the pattern in a single source of truth,
   *  so there's nothing for a separate `captures` array to go out-of-sync with. */
  pathPattern: string;
}
interface SupportCopilotPlatformEntry {
  /** Stable slug. Also the `audience` value sent to /credential-gateway/token. */
  slug: string;
  /** Human-readable label for the Manage UI dropdown. */
  label: string;
  /** URL matchers for the extension. Evaluated in order; first match wins. */
  pageMatchers: SupportCopilotPageMatcher[];
  /** Whether configuring this platform requires selecting a credential reference.
   *  True for platforms where the copilot relies on the credential gateway
   *  (Chrome extension flow). False for platforms where the copilot runs inside
   *  the host app's own iframe and receives auth from the host (e.g., Zendesk ZAF). */
  credentialRequired: boolean;
}
/**
 * Ordered alphabetically by label for deterministic UI rendering.
 */
declare const SUPPORT_COPILOT_PLATFORMS: readonly [{
  readonly slug: "atlas";
  readonly label: "Atlas";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "atlas_conversation";
    readonly hostGlob: "app.atlas.so";
    readonly pathPattern: "^/conversations/(?<ticketId>[a-zA-Z0-9-]+)";
  }];
}, {
  readonly slug: "freshdesk";
  readonly label: "Freshdesk";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "freshdesk_ticket";
    readonly hostGlob: "*.freshdesk.com";
    readonly pathPattern: "^/a/tickets/(?<ticketId>\\d+)";
  }];
}, {
  readonly slug: "front";
  readonly label: "Front";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "front_conversation";
    readonly hostGlob: "app.frontapp.com";
    readonly pathPattern: "^/inbox/.+/open/(?<ticketId>[a-z0-9]+)";
  }];
}, {
  readonly slug: "github";
  readonly label: "GitHub";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "github_issue";
    readonly hostGlob: "github.com";
    readonly pathPattern: "^/[^/]+/[^/]+/issues/(?<ticketId>\\d+)";
  }];
}, {
  readonly slug: "helpscout";
  readonly label: "Help Scout";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "helpscout_conversation";
    readonly hostGlob: "secure.helpscout.net";
    readonly pathPattern: "^/conversation/(?<ticketId>\\d+)";
  }];
}, {
  readonly slug: "intercom";
  readonly label: "Intercom";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "intercom_conversation";
    readonly hostGlob: "app.intercom.com";
    readonly pathPattern: "^/a/inbox/.+/conversation/(?<ticketId>\\d+)";
  }];
}, {
  readonly slug: "jira";
  readonly label: "Jira";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "jira_issue";
    readonly hostGlob: "*.atlassian.net";
    readonly pathPattern: "^/browse/(?<ticketId>[A-Z]+-\\d+)";
  }];
}, {
  readonly slug: "missive";
  readonly label: "Missive";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "missive_conversation";
    readonly hostGlob: "mail.missiveapp.com";
    readonly pathPattern: "^/(?<ticketId>[a-f0-9-]+)";
  }];
}, {
  readonly slug: "plain";
  readonly label: "Plain";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "plain_thread";
    readonly hostGlob: "app.plain.com";
    readonly pathPattern: "^/thread/(?<ticketId>[a-zA-Z0-9-]+)";
  }];
}, {
  readonly slug: "salesforce";
  readonly label: "Salesforce";
  readonly credentialRequired: true;
  readonly pageMatchers: [{
    readonly pageType: "salesforce_case";
    readonly hostGlob: "*.lightning.force.com";
    readonly pathPattern: "^/lightning/r/Case/(?<ticketId>[a-zA-Z0-9]+)";
  }];
}, {
  readonly slug: "zendesk";
  readonly label: "Zendesk";
  readonly credentialRequired: false;
  readonly pageMatchers: [{
    readonly pageType: "zendesk_ticket";
    readonly hostGlob: "*.zendesk.com";
    readonly pathPattern: "^/agent/tickets/(?<ticketId>\\d+)";
  }];
}];
type SupportCopilotPlatformSlug = (typeof SUPPORT_COPILOT_PLATFORMS)[number]['slug'];
declare const SUPPORT_COPILOT_PLATFORM_SLUGS: SupportCopilotPlatformSlug[];
//#endregion
export { SUPPORT_COPILOT_PLATFORMS, SUPPORT_COPILOT_PLATFORM_SLUGS, SupportCopilotPageMatcher, SupportCopilotPlatformEntry, SupportCopilotPlatformSlug };