import { ChangeDetectionStrategy, Component, TemplateRef, ViewEncapsulation, contentChild, input, output } from '@angular/core'; import { NgTemplateOutlet } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; /** * Entitlement gate that renders an upgrade prompt over a feature. The protected * content is supplied as an and is instantiated ONLY when unlocked — * so when locked there is nothing behind it: no DOM nodes, no chart canvas, no * data binding, no triggered network call. This is the strict free-tier rule * (DASHBOARD.md): a locked card provably exposes no data. * * * * */ @Component({ selector: 'sail-locked-overlay', templateUrl: './locked_overlay.html', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgTemplateOutlet, MatButtonModule], }) export class LockedOverlayComponent { readonly locked = input.required(); readonly feature = input(''); readonly message = input('Upgrade to unlock this feature.'); readonly ctaLabel = input('Upgrade'); readonly upgrade = output(); /** The protected content, provided as a single by the consumer. */ readonly content = contentChild(TemplateRef); }