# Design: Post-Wise Flywheel Trigger Mode Simplification & Caption Keyword Auto-Extraction

## Component Changes & Data Contracts

### 1. Updated `PostWiseFlywheelRule` Interface (`resources/js/types/posting.ts`)
```typescript
export interface PostWiseFlywheelRule {
    enabled: boolean;
    triggerMode: 'any_comment' | 'keywords'; // NEW: trigger on all comments vs keyword matching
    triggerKeywords: string[];
    matchType: 'contains_any' | 'contains_all' | 'exact';
    publicReplyTemplate: string;
    sendPrivateDm: boolean;
    privateDmTemplate: string;
    resourceName?: string;
    resourceUrl?: string;
    discountCode?: string;
    totalTriggeredCount: number;
}
```

### 2. Caption Keyword Auto-Extraction (`PostWiseFlywheelConfig.vue`)
- Regex pattern matching quoted uppercase or title-case words in the caption:
  ```typescript
  const extractedFromCaption = computed(() => {
      if (!props.caption) return [];
      const matches = props.caption.match(/["'“]([A-Za-z0-9_]+)["'”]/g) || [];
      return [...new Set(matches.map((m) => m.replace(/["'“”]/g, '').toLowerCase()))];
  });
  ```

### 3. UI Redesign (`PostWiseFlywheelConfig.vue`)
- Two-mode segmented toggle:
  - **🔘 Any Comment** (*"Every comment receives the DM link automatically"*).
  - **🔘 Specific Keywords** (*"Only comments with matching trigger keywords receive the DM"*).
- When "Specific Keywords" is active:
  - Shows 1-click **"Auto-Extracted from Caption"** badge and quick preset pills.
  - Adding a keyword is as simple as clicking a preset chip or pressing Enter.
