# LiveAndAiChat SDK — consumer ProGuard / R8 rules.
#
# Applied automatically to any app that depends on this AAR; consumers
# don't need to copy these into their own proguard-rules.pro.

# ── Public API surface ─────────────────────────────────────────────
# Keep every public type so reflective access (StateFlow.collect from
# Compose, listener interface dispatch, kotlinx.serialization codecs)
# and Kotlin reflection see them intact.
-keep public class cloud.newinstance.liveandaichat.** { public *; }
-keep public interface cloud.newinstance.liveandaichat.** { *; }

# ── Kotlinx Serialization (used for GraphQL JSON parsing) ──────────
# Serializers are generated as nested classes; both must be kept.
-keepclassmembers,allowobfuscation class * {
    @kotlinx.serialization.Serializable <methods>;
}
-keepattributes InnerClasses
-keepattributes Signature
-if @kotlinx.serialization.Serializable class **
-keepclassmembers class <1> {
    static <1>$Companion Companion;
}
-if @kotlinx.serialization.Serializable class ** {
    static **$* *;
}
-keepclassmembers class <2>$<3> {
    kotlinx.serialization.KSerializer serializer(...);
}

# ── Compose Composable functions referenced reflectively ───────────
# (Material 3 + lifecycle-runtime-compose use reflection for
# previews / saver mechanisms.)
-keep @androidx.compose.runtime.Composable class * { *; }

# ── OkHttp / SSE event source (transport internals) ────────────────
# Already covered by OkHttp's own consumer-rules.pro shipped in the
# okhttp AAR; nothing extra needed here.
