diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 65ba1739..e9c20543 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,12 +18,18 @@ jobs: - run: npm ci - run: npm test - # The shared Kotlin tests (tests/kotlin, on the JVM host). The runner image - # already carries the JDK 17 and Android SDK the build needs. + # The shared Kotlin tests (tests/kotlin, on the JVM host). Pinned to + # ubuntu-24.04 for the Android SDK its image carries; the JDK is pinned + # explicitly because Gradle 8.14 can't run on the JDK 25 that is the default + # on ubuntu-26.04 (now ubuntu-latest), failing with just "25.0.5". test-kotlin: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' - run: npm ci - run: npm run test:kotlin diff --git a/.gitignore b/.gitignore index 95246319..6659b26a 100644 --- a/.gitignore +++ b/.gitignore @@ -44,9 +44,9 @@ __pycache__ !.vscode/launch.json !.vscode/extensions.json -# pull_config.sh output: the phone's live settings, including API keys +# pull_config*.sh output: the phone's live settings, including API keys faceclaw_settings.xml -faceclaw_settings.ios.json +faceclaw_settings*.json # Developer configs build_paths.sh diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md index fe2fac36..a054eae1 100644 --- a/ACKNOWLEDGEMENTS.md +++ b/ACKNOWLEDGEMENTS.md @@ -13,6 +13,13 @@ and others who contributed to documenting the G2's bluetooth protocol and firmwa G2 microphone LC3 decoding uses Google's liblc3: https://github.com/google/liblc3 +iPhone notification icons are Pebble's notification and timeline icons, from +https://github.com/pebble-dev/iconography: the original Pebble Technology icons +and Rebble community additions. They are licensed under the Apache License 2.0; +see app/graphics/pebble-icons.LICENSE. Faceclaw's table of the iPhone apps they +stand for builds on the one in the PebbleOS firmware, +https://github.com/coredevices/PebbleOS (also Apache License 2.0). + Weather data outside the US is by Open-Meteo.com: https://open-meteo.com/. It is licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/AndroidSessionLink.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/AndroidSessionLink.kt index 4e145be7..2921e222 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/AndroidSessionLink.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/AndroidSessionLink.kt @@ -17,6 +17,10 @@ class AndroidSessionLink(private val bleManager: FaceclawBleManager) : SessionLi bleManager.requestConnectionPriority(address, BluetoothGatt.CONNECTION_PRIORITY_HIGH) } + override fun requestLe2mPhy(address: String) = bleManager.requestLe2mPhy(address) + + override fun describePhy(address: String): String? = bleManager.describePhy(address) + override fun requestMtu(address: String, mtu: Int, timeoutMs: Int): Boolean = bleManager.requestMtu(address, mtu, timeoutMs) diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt index 89baca33..fd303744 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawBleManager.kt @@ -18,6 +18,8 @@ import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.CountDownLatch import java.util.concurrent.ExecutorService import java.util.concurrent.Executors +import java.util.concurrent.ScheduledExecutorService +import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicLong @@ -27,6 +29,10 @@ class FaceclawBleManager(context: Context) { private const val TAG = "FaceclawBle" private val WRITE_RETRY_DELAYS_MS = intArrayOf(1, 1, 1, 2, 4, 8, 12, 20, 35, 100, 200) + // Gap after each LE 2M PHY request before checking whether it landed and asking + // again; the request gives up once these run out (see requestLe2mPhy). + private val PHY_RETRY_DELAYS_MS = longArrayOf(1_000, 2_000, 4_000, 8_000, 15_000) + // Handed to an operation waiter whose link dropped before its completion // callback arrived; never a real GATT status. private const val STATUS_LINK_LOST = -1 @@ -47,6 +53,19 @@ class FaceclawBleManager(context: Context) { Thread(runnable, "FaceclawBleCallbacks").apply { isDaemon = true } } + // Runs the LE 2M PHY request loops. Each step takes the global lock, so it must not + // run on the binder thread or the callback executor. + private val phyScheduler: ScheduledExecutorService = Executors.newSingleThreadScheduledExecutor { runnable -> + Thread(runnable, "FaceclawBlePhy").apply { isDaemon = true } + } + + private fun phyName(phy: Int): String = when (phy) { + BluetoothDevice.PHY_LE_1M -> "1M" + BluetoothDevice.PHY_LE_2M -> "2M" + BluetoothDevice.PHY_LE_CODED -> "Coded" + else -> "?" + } + // Process-wide outbound-traffic totals, sampled by the phone UI's BLE // bandwidth indicator. Static so counts from every manager instance and // isolate land in the same totals. @@ -76,6 +95,16 @@ class FaceclawBleManager(context: Context) { @Volatile var gatt: BluetoothGatt? = null @Volatile var connected = false val connectLatch = CountDownLatch(1) + + // The PHY pair Android last reported for this connection (BluetoothDevice.PHY_LE_*), + // 0 until a report arrives. + @Volatile var txPhy = 0 + @Volatile var rxPhy = 0 + + // The 2M request loop's next step; only touched on phyScheduler. + var phyStep: ScheduledFuture<*>? = null + + fun on2mPhy(): Boolean = txPhy == BluetoothDevice.PHY_LE_2M && rxPhy == BluetoothDevice.PHY_LE_2M } private enum class OpKind { MTU, SERVICES, DESCRIPTOR, WRITE } @@ -252,13 +281,72 @@ class FaceclawBleManager(context: Context) { val accepted = gatt.requestConnectionPriority(BluetoothGatt.CONNECTION_PRIORITY_HIGH) Log.i(TAG, "benchmark HIGH address=$address submitted=$accepted") } - if ((mode and 2) != 0) { - Log.i(TAG, "benchmark request 2M address=$address") - gatt.setPreferredPhy(BluetoothDevice.PHY_LE_2M_MASK, - BluetoothDevice.PHY_LE_2M_MASK, BluetoothDevice.PHY_OPTION_NO_PREFERRED) - } gatt.readPhy() } + if ((mode and 2) != 0) { + Log.i(TAG, "benchmark request 2M address=$address") + requestLe2mPhy(address) + } + } + + /** + * Ask for the LE 2M PHY in both directions, then keep checking and re-asking until it + * lands or [PHY_RETRY_DELAYS_MS] runs out. A single request is unreliable: right after + * connecting, Android can reject it as unsupported before it has read the peer's feature + * bits, and an on-air PHY update can lose a collision with the peer's own + * connection-parameter request. Our preference stays 2M-only, so a granted 2M link + * shouldn't drift back; the loop ends with the connection. + */ + fun requestLe2mPhy(address: String) { + val link = links[address] ?: return + phyScheduler.execute { + link.phyStep?.cancel(false) + runPhyStep(address, link, 0) + } + } + + private fun runPhyStep(address: String, link: GattLink, attempt: Int) { + link.phyStep = null + if (links[address] !== link || !link.connected) { + return + } + if (link.on2mPhy()) { + Log.i(TAG, "LE 2M PHY active: address=$address requests=$attempt") + return + } + if (attempt >= PHY_RETRY_DELAYS_MS.size) { + Log.w(TAG, "LE 2M PHY not granted after $attempt requests: address=$address" + + " tx=${phyName(link.txPhy)} rx=${phyName(link.rxPhy)}") + return + } + synchronized(bluetoothApiLock) { + val gatt = link.gatt + if (links[address] !== link || !link.connected || gatt == null) { + return + } + Log.i(TAG, "requesting LE 2M PHY: address=$address attempt=${attempt + 1}") + gatt.setPreferredPhy(BluetoothDevice.PHY_LE_2M_MASK, + BluetoothDevice.PHY_LE_2M_MASK, BluetoothDevice.PHY_OPTION_NO_PREFERRED) + // The update-complete event can be skipped when nothing changes; a read always + // reports, so the next step sees the PHY even then. + gatt.readPhy() + } + link.phyStep = phyScheduler.schedule( + { runPhyStep(address, link, attempt + 1) }, + PHY_RETRY_DELAYS_MS[attempt], + TimeUnit.MILLISECONDS + ) + } + + /** The link's PHY for diagnostics: "2M", "1M", "tx/rx" when they differ, "?" before a report; null when not connected. */ + fun describePhy(address: String): String? { + val link = links[address] + if (link == null || !link.connected) { + return null + } + val tx = link.txPhy + val rx = link.rxPhy + return if (tx == rx) phyName(tx) else phyName(tx) + "/" + phyName(rx) } fun getNegotiatedMtu(address: String): Int { @@ -600,11 +688,23 @@ class FaceclawBleManager(context: Context) { override fun onPhyRead(gatt: BluetoothGatt, txPhy: Int, rxPhy: Int, status: Int) { Log.i(TAG, "onPhyRead: address=" + gatt.device.address + " txPhy=" + txPhy + " rxPhy=" + rxPhy + " status=" + status) + recordPhy(gatt, txPhy, rxPhy, status) } override fun onPhyUpdate(gatt: BluetoothGatt, txPhy: Int, rxPhy: Int, status: Int) { Log.i(TAG, "onPhyUpdate: address=" + gatt.device.address + " txPhy=" + txPhy + " rxPhy=" + rxPhy + " status=" + status) + recordPhy(gatt, txPhy, rxPhy, status) + } + + private fun recordPhy(gatt: BluetoothGatt, txPhy: Int, rxPhy: Int, status: Int) { + // A failed request reports the PHYs it asked for, not the ones in use. + if (status != BluetoothGatt.GATT_SUCCESS) return + val link = links[gatt.device.address] ?: return + val current = link.gatt + if (current != null && current !== gatt) return + link.txPhy = txPhy + link.rxPhy = rxPhy } override fun onDescriptorWrite(gatt: BluetoothGatt, descriptor: BluetoothGattDescriptor, status: Int) { diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawMediaNotificationListenerService.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawMediaNotificationListenerService.kt index 83c294be..dd03f339 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawMediaNotificationListenerService.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawMediaNotificationListenerService.kt @@ -35,6 +35,8 @@ class FaceclawMediaNotificationListenerService : NotificationListenerService() { companion object { private const val TAG = "FaceclawNotify" private const val EXTRA_SUBSTITUTE_APP_NAME = "android.substName" + /** MessagingStyle's conversation icon (Notification.EXTRA_CONVERSATION_ICON, hidden). */ + private const val EXTRA_CONVERSATION_ICON = "android.conversationIcon" /** * How long notification access can be granted with no listener * connected before the watchdog forces a rebind: longer than a @@ -47,6 +49,8 @@ class FaceclawMediaNotificationListenerService : NotificationListenerService() { private const val LISTENER_STUCK_MS = 30_000L /** Notifications posted while disconnected alert on reconnect only if this recent. */ private const val RECONNECT_ALERT_WINDOW_MS = 5 * 60_000L + /** Large icons are drawn at no more than this many pixels a side before scaling down. */ + private const val LARGE_ICON_MAX_SOURCE = 512 /** The connected listener; null until onListenerConnected and after onListenerDisconnected. */ @Volatile @@ -366,6 +370,48 @@ class FaceclawMediaNotificationListenerService : NotificationListenerService() { halveToward(picture, maxWidth, maxHeight), maxWidth, maxHeight, gamma, dither, invertLightBackground) } + /** + * One active notification's large icon (largeIconOf: a sender's avatar, a site's logo) + * scaled to fit size x size as a gray packet, a light background shown as its negative + * like a picture's; empty when the notification or its icon is unavailable. + */ + @JvmStatic + fun getNotificationLargeIconGray(key: String?, size: Int, gamma: Float, dither: Boolean): ByteArray { + val service = activeService + if (service == null || size <= 0) { + return ByteArray(0) + } + val statusBarNotification = findActiveNotificationByKey(service, key) + val icon = statusBarNotification?.notification?.let { largeIconOf(it) } ?: return ByteArray(0) + try { + val drawable = icon.loadDrawable(service) ?: return ByteArray(0) + val width = if (drawable.intrinsicWidth > 0) Math.min(drawable.intrinsicWidth, LARGE_ICON_MAX_SOURCE) else size * 4 + val height = if (drawable.intrinsicHeight > 0) Math.min(drawable.intrinsicHeight, LARGE_ICON_MAX_SOURCE) else size * 4 + val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) + drawable.setBounds(0, 0, width, height) + drawable.draw(Canvas(bitmap)) + return ImageFileLoader.bitmapToGrayPacket(halveToward(bitmap, size, size), size, size, gamma, dither, true) + } catch (t: Throwable) { + Log.w(TAG, "failed to load large icon for " + statusBarNotification.packageName, t) + return ByteArray(0) + } + } + + /** + * One active notification's custom layout (hasCustomView in its JSON) drawn to fit + * maxWidth x maxHeight as a gray packet; see NotificationCustomViews.renderGray. Empty + * when the notification or its layout is unavailable. + */ + @JvmStatic + fun getNotificationCustomViewGray(key: String?, maxWidth: Int, maxHeight: Int, gamma: Float, dither: Boolean): ByteArray { + val service = activeService ?: return ByteArray(0) + val statusBarNotification = findActiveNotificationByKey(service, key) + val notification = statusBarNotification?.notification ?: return ByteArray(0) + val hasPicture = notification.extras?.let { hasNotificationPicture(it) } ?: false + return NotificationCustomViews.renderGray( + service, statusBarNotification, !hasPicture, maxWidth, maxHeight, gamma, dither) + } + @JvmStatic fun getActiveNotificationsJson(maxNotifications: Int): String { val service = activeService @@ -672,6 +718,32 @@ class FaceclawMediaNotificationListenerService : NotificationListenerService() { return null } + /** + * The picture a notification shows beside its text: its large icon (Gmail's sender + * avatar or logo), else from Android 11 its conversation's icon, else the icon of its + * latest message's sender. + */ + @Suppress("DEPRECATION") + private fun largeIconOf(notification: Notification): Icon? { + notification.getLargeIcon()?.let { return it } + val extras = notification.extras + if (extras == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { + return null + } + try { + val conversationIcon: Icon? = extras.getParcelable(EXTRA_CONVERSATION_ICON) + if (conversationIcon != null) { + return conversationIcon + } + val messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES) ?: return null + return Notification.MessagingStyle.Message.getMessagesFromBundleArray(messages) + .lastOrNull()?.senderPerson?.icon + } catch (t: Throwable) { + Log.w(TAG, "failed to read conversation icons", t) + return null + } + } + /** Hardware bitmaps can't be read back pixel by pixel or drawn on a software canvas; copy those. */ private fun softwareBitmap(bitmap: Bitmap): Bitmap { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && bitmap.config == Bitmap.Config.HARDWARE) { @@ -687,7 +759,7 @@ class FaceclawMediaNotificationListenerService : NotificationListenerService() { * (NotificationIconLoader.renderArgb), one filtered pass from a much larger source * samples too sparsely: a graph's thin lines break up into dots. */ - private fun halveToward(source: Bitmap, maxWidth: Int, maxHeight: Int): Bitmap { + internal fun halveToward(source: Bitmap, maxWidth: Int, maxHeight: Int): Bitmap { var bitmap = source while ((bitmap.width >= maxWidth * 2 || bitmap.height >= maxHeight * 2) && bitmap.width >= 2 && bitmap.height >= 2) { val halved = Bitmap.createScaledBitmap(bitmap, bitmap.width / 2, bitmap.height / 2, true) @@ -759,6 +831,17 @@ class FaceclawMediaNotificationListenerService : NotificationListenerService() { out.put("lines", JSONArray()) out.put("hasPicture", false) } + out.put("hasLargeIcon", largeIconOf(notification) != null) + val hasCustomView = NotificationCustomViews.hasCustomView(notification) + out.put("hasCustomView", hasCustomView) + val customText = JSONArray() + // Only needed (and only worth inflating the layout for) when there's no title or text to show instead. + if (hasCustomView && out.optString("title").isEmpty() && out.optString("text").isEmpty()) { + for (text in NotificationCustomViews.texts(service, statusBarNotification)) { + customText.put(text) + } + } + out.put("customText", customText) val actionsJson = JSONArray() val actions: Array? = notification.actions diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawResourceUsage.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawResourceUsage.kt index c5a94b4c..22ac9848 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawResourceUsage.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawResourceUsage.kt @@ -13,7 +13,7 @@ class FaceclawResourceUsage private constructor() { companion object { /** * Returns elapsedMs, processCpuMs, rssKb, nativeHeapKb, javaHeapKb, - * javaHeapCommittedKb, and threadCount. Reading /proc/self/status avoids + * javaHeapCommittedKb, threadCount, and peakRssKb. Reading /proc/self/status avoids * the considerably heavier full Debug.MemoryInfo/PSS collection once per * second while still reporting the RSS that Android records at exit. */ @@ -30,30 +30,34 @@ class FaceclawResourceUsage private constructor() { javaUsedBytes / 1024L, runtime.totalMemory() / 1024L, status[1], + status[2], ) } - /** Returns {VmRSS in KiB, thread count}; unavailable values are zero. */ + /** Returns {VmRSS in KiB, thread count, VmHWM in KiB}; unavailable values are zero. */ private fun readProcessStatus(): LongArray { var rssKb = 0L var threadCount = 0L + var peakRssKb = 0L try { BufferedReader(FileReader("/proc/self/status")).use { reader -> var line: String? while (reader.readLine().also { line = it } != null) { val current = line!! - if (current.startsWith("VmRSS:")) { + if (current.startsWith("VmHWM:")) { + peakRssKb = firstNumber(current) + } else if (current.startsWith("VmRSS:")) { rssKb = firstNumber(current) } else if (current.startsWith("Threads:")) { threadCount = firstNumber(current) } - if (rssKb > 0 && threadCount > 0) break + if (rssKb > 0 && threadCount > 0 && peakRssKb > 0) break } } } catch (ignored: IOException) { // The graph remains useful with the runtime heap counters alone. } - return longArrayOf(rssKb, threadCount) + return longArrayOf(rssKb, threadCount, peakRssKb) } private fun firstNumber(line: String): Long { diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettings.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettings.kt index 6a6b1450..f48315fe 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettings.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettings.kt @@ -25,13 +25,23 @@ class FaceclawSettings private constructor(context: Context) { private val prefs: SharedPreferences = context.applicationContext .getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE) private val hub = SettingsChangeHub(object : SettingsStorage { - override fun getString(key: String?, defaultValue: String?): String? = prefs.getString(key, defaultValue) + // An imported or hand-edited config can store a setting as a different type than the + // app reads it as (iOS is lenient about this); read it as text rather than crash. + override fun getString(key: String?, defaultValue: String?): String? = try { + prefs.getString(key, defaultValue) + } catch (_: ClassCastException) { + prefs.all[key]?.toString() ?: defaultValue + } override fun putString(key: String?, value: String?) { prefs.edit().putString(key, value).apply() } - override fun getBoolean(key: String?, defaultValue: Boolean): Boolean = prefs.getBoolean(key, defaultValue) + override fun getBoolean(key: String?, defaultValue: Boolean): Boolean = try { + prefs.getBoolean(key, defaultValue) + } catch (_: ClassCastException) { + prefs.all[key]?.toString()?.toBooleanStrictOrNull() ?: defaultValue + } override fun putBoolean(key: String?, value: Boolean) { prefs.edit().putBoolean(key, value).apply() diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettingsPortReceiver.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettingsPortReceiver.kt index 788c93a1..d8fc8abf 100644 --- a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettingsPortReceiver.kt +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawSettingsPortReceiver.kt @@ -3,52 +3,68 @@ package com.faceclaw.app import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import android.content.SharedPreferences import android.os.Handler import android.os.Looper +import android.util.AtomicFile import android.util.Log -import android.util.Xml - -import org.xmlpull.v1.XmlPullParser import java.io.File -import java.io.FileInputStream -import java.io.FileOutputStream import java.io.IOException -import java.io.InputStream -import java.io.OutputStream /** - * adb-triggered export/import of the faceclaw_settings SharedPreferences - * file, so configuration (API keys, device addresses, ...) can be moved off a - * release build, where run-as is unavailable. See scripts/pull_config.sh and - * scripts/push_config.sh, which use run-as on debuggable builds and fall back - * to this receiver otherwise. + * adb-triggered export/import of Faceclaw's settings as the JSON document shared with iOS + * (SettingsTransfer; see scripts/config-transfer.md). scripts/pull_config.sh and + * scripts/push_config.sh drive it; it works on release builds, where run-as is unavailable. * - * adb shell am broadcast -n com.faceclaw.app/.FaceclawSettingsPortReceiver \ - * -a com.faceclaw.app.SETTINGS_EXPORT - * adb pull /sdcard/Android/data/com.faceclaw.app/files/faceclaw-settings-export.xml + * adb shell am broadcast --include-stopped-packages \ + * -n com.faceclaw.app/.FaceclawSettingsPortReceiver -a com.faceclaw.app.SETTINGS_EXPORT + * adb pull /sdcard/Android/data/com.faceclaw.app/files/faceclaw-settings-export.json * - * adb push settings.xml /sdcard/Android/data/com.faceclaw.app/files/faceclaw-settings-import.xml - * adb shell am broadcast -n com.faceclaw.app/.FaceclawSettingsPortReceiver \ - * -a com.faceclaw.app.SETTINGS_IMPORT + * adb push settings.json /sdcard/Android/data/com.faceclaw.app/files/faceclaw-settings-import.json + * adb shell am broadcast --include-stopped-packages \ + * -n com.faceclaw.app/.FaceclawSettingsPortReceiver -a com.faceclaw.app.SETTINGS_IMPORT * - * Security: the settings file contains API tokens, so the manifest guards - * this receiver with android.permission.DUMP — a development permission the - * adb shell holds but ordinary apps cannot obtain without adb's help, keeping - * the trigger reachable from adb only. The transfer file lives in - * getExternalFilesDir(), which other apps cannot read on Android 11+ (and - * which the scripts delete as soon as the transfer completes); on the - * Android 7-10 devices minSdk still admits, apps holding READ_EXTERNAL_STORAGE - * could read it during that window. + * Settings live in two SharedPreferences files: FaceclawSettings' own, and NativeScript's + * ApplicationSettings file (prefs.db), which still holds the pairing, onboarding and EvenHub + * localStorage keys. Both are exported, and each imported key is written to the file the app + * reads it from. An import merges: settings missing from the document are left alone. + * It writes through the process's live SharedPreferences, so a running app cannot flush stale + * values over it, then exits so the next launch starts from the imported settings. + * + * Security: the settings contain API tokens, so the manifest guards this receiver with + * android.permission.DUMP — a development permission the adb shell holds but ordinary apps + * cannot obtain without adb's help, keeping the trigger reachable from adb only. The transfer + * file lives in getExternalFilesDir(), which other apps cannot read on Android 11+ (and which + * the scripts delete as soon as the transfer completes); on the Android 7-10 devices minSdk + * still admits, apps holding READ_EXTERNAL_STORAGE could read it during that window. */ class FaceclawSettingsPortReceiver : BroadcastReceiver() { companion object { private const val TAG = "FaceclawSettingsPort" const val ACTION_EXPORT = "com.faceclaw.app.SETTINGS_EXPORT" const val ACTION_IMPORT = "com.faceclaw.app.SETTINGS_IMPORT" - private const val PREFS_FILE = "faceclaw_settings.xml" - private const val EXPORT_NAME = "faceclaw-settings-export.xml" - private const val IMPORT_NAME = "faceclaw-settings-import.xml" + private const val PLATFORM = "android" + private const val SETTINGS_PREFS = "faceclaw_settings" // FaceclawSettings + private const val NATIVESCRIPT_PREFS = "prefs.db" // NativeScript ApplicationSettings + private const val EXPORT_NAME = "faceclaw-settings-export.json" + private const val IMPORT_NAME = "faceclaw-settings-import.json" + private const val BACKUP_NAME = "faceclaw-settings-previous.json" + + private enum class StoredAs { STRING, BOOLEAN, NUMBER } + + /** + * Keys the app reads through NativeScript's ApplicationSettings rather than FaceclawSettings, + * and the getter it uses (device-addresses.ts, onboarding-state.ts, evenhub/session.ts; + * tests/settings-transfer.test.cjs keeps this list in step with them). prefs.db also holds + * settings abandoned when FaceclawSettings took over, so nothing else is read from it. + */ + private fun nativeScriptKey(key: String): StoredAs? = when { + key == "onboarding.complete" || key == "onboarding.previewOnly" -> StoredAs.BOOLEAN + key == "deviceIdentity.pairedAtMs" -> StoredAs.NUMBER + key.startsWith("deviceAddress.") || key.startsWith("deviceIdentity.") || key.startsWith("evenhub:") -> StoredAs.STRING + else -> null + } } override fun onReceive(context: Context, intent: Intent?) { @@ -57,11 +73,10 @@ class FaceclawSettingsPortReceiver : BroadcastReceiver() { if (ACTION_EXPORT == action) { resultData = exportSettings(context) } else if (ACTION_IMPORT == action) { - resultData = importSettings(context) - // Exit once the broadcast result has been delivered: this - // process may hold stale in-memory SharedPreferences that a - // later apply() would flush over the imported file, and the - // next launch must re-read from disk. + val result = importSettings(context) + resultData = result + if (!result.startsWith("imported:")) return + // Restart cleanly: running code may hold settings it read before the import. Handler(Looper.getMainLooper()).postDelayed({ Log.i(TAG, "Exiting after settings import") System.exit(0) @@ -69,13 +84,15 @@ class FaceclawSettingsPortReceiver : BroadcastReceiver() { } } catch (e: Exception) { Log.e(TAG, "Settings $action failed", e) - resultData = "error: $e" + resultData = "error: ${e.message ?: e}" } } - private fun prefsFile(context: Context): File { - return File(context.applicationInfo.dataDir, "shared_prefs/$PREFS_FILE") - } + private fun settingsPrefs(context: Context): SharedPreferences = + context.getSharedPreferences(SETTINGS_PREFS, Context.MODE_PRIVATE) + + private fun nativeScriptPrefs(context: Context): SharedPreferences = + context.getSharedPreferences(NATIVESCRIPT_PREFS, Context.MODE_PRIVATE) @Throws(IOException::class) private fun externalFile(context: Context, name: String): File { @@ -84,63 +101,111 @@ class FaceclawSettingsPortReceiver : BroadcastReceiver() { return File(dir, name) } - @Throws(IOException::class) - private fun exportSettings(context: Context): String { - val prefs = prefsFile(context) - if (!prefs.exists()) { - return "error: no settings file yet ($prefs)" + private fun appVersion(context: Context): String? = + runCatching { context.packageManager.getPackageInfo(context.packageName, 0).versionName }.getOrNull() + + /** Every setting, from the file the app reads it from, as SettingsTransfer values. */ + private fun currentSettings(context: Context): Map { + val values = linkedMapOf() + for ((key, value) in settingsPrefs(context).all) { + if (key == null || nativeScriptKey(key) != null) continue + val exported = exportable(value) + if (exported != null) values[key] = exported else Log.w(TAG, "Not exporting $key: unsupported type") } + for ((key, value) in nativeScriptPrefs(context).all) { + val storedAs = nativeScriptKey(key ?: continue) ?: continue + // NativeScript stores numbers as the raw bits of a double in a long. + val exported = if (storedAs == StoredAs.NUMBER && value is Long) { + Double.fromBits(value).takeIf { it.isFinite() }?.let { JsonNumber.of(it) } + } else { + exportable(value) + } + if (exported != null) values[key] = exported else Log.w(TAG, "Not exporting $key: unsupported value") + } + return values + } + + private fun exportable(value: Any?): Any? = when (value) { + is String, is Boolean -> value + is Int, is Long -> JsonNumber(value.toString()) + is Float -> value.toDouble().takeIf { it.isFinite() }?.let { JsonNumber.of(it) } + else -> null // string sets are unused + } + + private fun exportSettings(context: Context): String { + val document = SettingsTransfer.export(currentSettings(context), PLATFORM, appVersion(context)) val out = externalFile(context, EXPORT_NAME) - copy(prefs, out) + writeAtomically(out, document) return "exported: $out" } - @Throws(Exception::class) private fun importSettings(context: Context): String { val staged = externalFile(context, IMPORT_NAME) if (!staged.exists()) { return "error: nothing staged at $staged" } - validatePrefsXml(staged) - val prefs = prefsFile(context) - prefs.parentFile?.mkdirs() - if (prefs.exists()) { - copy(prefs, File(prefs.path + ".bak")) + val plan = try { + SettingsTransfer.planImport(staged.readText(), PLATFORM) + } finally { + staged.delete() // holds API tokens } - copy(staged, prefs) - staged.delete() - return "imported: $prefs (previous settings in $PREFS_FILE.bak)" - } - /** Reject files that are not a SharedPreferences document. */ - @Throws(Exception::class) - private fun validatePrefsXml(file: File) { - FileInputStream(file).use { input -> - val parser = Xml.newPullParser() - parser.setInput(input, null) - var event = parser.next() - while (event != XmlPullParser.START_TAG && event != XmlPullParser.END_DOCUMENT) { - event = parser.next() - } - if (event != XmlPullParser.START_TAG || "map" != parser.name) { - throw IOException("not a SharedPreferences document") - } - // Walk the rest so malformed XML is caught before it replaces - // the live settings file. - while (parser.next() != XmlPullParser.END_DOCUMENT) { } - } - } - - @Throws(IOException::class) - private fun copy(from: File, to: File) { - FileInputStream(from).use { input: InputStream -> - FileOutputStream(to).use { out: OutputStream -> - val buffer = ByteArray(8192) - var n: Int - while (input.read(buffer).also { n = it } > 0) { - out.write(buffer, 0, n) + // Convert everything before writing anything, so a bad value leaves settings untouched. + val settingsWrites = ArrayList<(SharedPreferences.Editor) -> Unit>() + val nativeScriptWrites = ArrayList<(SharedPreferences.Editor) -> Unit>() + for ((key, value) in plan.values) { + when (nativeScriptKey(key)) { + // FaceclawSettings only has string and boolean getters. + null -> if (value is Boolean) { + settingsWrites.add { e -> e.putBoolean(key, value) } + } else { + settingsWrites.add { e -> e.putString(key, text(value)) } + } + StoredAs.STRING -> nativeScriptWrites.add { e -> e.putString(key, text(value)) } + StoredAs.BOOLEAN -> { + val flag = value as? Boolean ?: (value as? String)?.toBooleanStrictOrNull() + ?: throw IllegalArgumentException("Setting $key must be a boolean") + nativeScriptWrites.add { e -> e.putBoolean(key, flag) } + } + StoredAs.NUMBER -> { + val number = text(value).toDoubleOrNull()?.takeIf { it.isFinite() } + ?: throw IllegalArgumentException("Setting $key must be a number") + nativeScriptWrites.add { e -> e.putLong(key, number.toRawBits()) } } } } + + val backup = File(context.filesDir, BACKUP_NAME) + writeAtomically(backup, SettingsTransfer.export(currentSettings(context), PLATFORM, appVersion(context))) + commit(settingsPrefs(context), settingsWrites) + commit(nativeScriptPrefs(context), nativeScriptWrites) + + val skipped = if (plan.skipped.isEmpty()) "" else + " (left out ${plan.skipped.size} ${plan.sourcePlatform ?: "other-platform"}-only settings)" + return "imported: ${plan.values.size} settings$skipped; previous settings saved in $backup" + } + + private fun text(value: Any): String = when (value) { + is JsonNumber -> value.text + else -> value.toString() + } + + private fun commit(prefs: SharedPreferences, writes: List<(SharedPreferences.Editor) -> Unit>) { + if (writes.isEmpty()) return + val editor = prefs.edit() + for (write in writes) write(editor) + if (!editor.commit()) throw IOException("Could not save settings") + } + + private fun writeAtomically(file: File, text: String) { + val atomic = AtomicFile(file) + val stream = atomic.startWrite() + try { + stream.write(text.toByteArray(Charsets.UTF_8)) + atomic.finishWrite(stream) + } catch (e: IOException) { + atomic.failWrite(stream) + throw e + } } } diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawWebSignIn.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawWebSignIn.kt new file mode 100644 index 00000000..088a0b9c --- /dev/null +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/FaceclawWebSignIn.kt @@ -0,0 +1,194 @@ +package com.faceclaw.app + +import android.content.ActivityNotFoundException +import android.content.Context +import android.content.Intent +import android.net.Uri +import android.os.Handler +import android.os.Looper +import android.util.Base64 +import android.util.Log +import java.io.ByteArrayOutputStream +import java.io.IOException +import java.net.BindException +import java.net.InetAddress +import java.net.InetSocketAddress +import java.net.ServerSocket +import java.net.Socket +import java.security.MessageDigest +import java.security.SecureRandom + +/** + * OAuth sign-in in the phone's browser with a loopback redirect + * (http://127.0.0.1:, the redirect providers such as Spotify + * accept from native apps): Android's counterpart of the iOS + * FaceclawWebSignIn / FaceclawLoopbackRedirect. A receiver on the loopback + * interface answers the browser's request for the path with a short "signed + * in" page and hands back the full redirect URL, query included; any other + * path (a favicon) gets a 404. + * + * Android blocks activity starts from the background, so the TypeScript side + * (app/native/spotify.ts) calls start(), then openBrowser() from Faceclaw's + * activity once it is in front. The code exchange needs no foreground, so the + * user can stay in the browser afterwards. + */ +class FaceclawWebSignIn private constructor() { + companion object { + private const val TAG = "FaceclawWebSignIn" + /** Request heads beyond this are not a browser's redirect; stop reading. */ + private const val MAX_REQUEST_BYTES = 16384 + private const val CLIENT_TIMEOUT_MS = 3000 + private const val DONE_PAGE = + "" + + "Faceclaw" + + "" + + "

Signed in

You can close this page and return to Faceclaw.

" + + private val INSTANCE = FaceclawWebSignIn() + private val random = SecureRandom() + + @JvmStatic fun shared(): FaceclawWebSignIn = INSTANCE + + /** byteCount random bytes, base64url without padding (PKCE verifiers, OAuth state). */ + @JvmStatic + fun randomBase64Url(byteCount: Int): String { + val bytes = ByteArray(byteCount.coerceIn(1, 256)) + random.nextBytes(bytes) + return base64Url(bytes) + } + + /** SHA-256 of the string's UTF-8 bytes, base64url without padding (a PKCE S256 challenge). */ + @JvmStatic + fun sha256Base64Url(value: String): String = + base64Url(MessageDigest.getInstance("SHA-256").digest(value.toByteArray(Charsets.UTF_8))) + + /** The target ("/path?query") of a GET request head; null for anything else. */ + @JvmStatic + fun requestTarget(head: String): String? { + val parts = head.substringBefore("\r\n").split(' ') + return if (parts.size >= 3 && parts[0] == "GET" && parts[1].startsWith("/")) parts[1] else null + } + + private fun base64Url(bytes: ByteArray): String = + Base64.encodeToString(bytes, Base64.URL_SAFE or Base64.NO_PADDING or Base64.NO_WRAP) + } + + private val mainHandler = Handler(Looper.getMainLooper()) + private val lock = Any() + /** The receiver of the sign-in in progress; null when none is. */ + private var server: ServerSocket? = null + private var listener: FaceclawWebSignInListener? = null + + /** + * Listen for the redirect to http://127.0.0.1:, ending any + * sign-in in progress. Returns null, or why the receiver couldn't start + * (and then the listener never hears). Otherwise the listener hears + * exactly once, on the main thread. + */ + fun start(port: Int, path: String, listener: FaceclawWebSignInListener): String? { + cancel() + if (port <= 0 || port > 65535 || !path.startsWith("/")) return "Invalid redirect address" + val socket = ServerSocket() + try { + socket.reuseAddress = true + socket.bind(InetSocketAddress(InetAddress.getByName("127.0.0.1"), port), 8) + } catch (e: IOException) { + try { socket.close() } catch (ignored: IOException) {} + return if (e is BindException) "Another app is using port $port; close it and try again" + else "Could not listen on port $port: ${e.message}" + } + synchronized(lock) { + server = socket + this.listener = listener + } + val thread = Thread({ acceptLoop(socket, port, path) }, "FaceclawWebSignIn") + thread.isDaemon = true + thread.start() + return null + } + + /** Open the sign-in page in the phone's browser; null, or why not. Call while Faceclaw is in front. */ + fun openBrowser(context: Context, url: String): String? { + val uri = Uri.parse(url) + if (uri.scheme != "https") return "Invalid sign-in address" + val intent = Intent(Intent.ACTION_VIEW, uri) + .addCategory(Intent.CATEGORY_BROWSABLE) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + return try { + context.startActivity(intent) + null + } catch (e: ActivityNotFoundException) { + "No browser on this phone can open the sign-in page" + } catch (e: Exception) { + Log.w(TAG, "could not open the sign-in page", e) + "Could not open the sign-in page: ${e.message}" + } + } + + /** End the sign-in in progress, if any; its listener hears "cancelled". */ + fun cancel() = fail("cancelled") + + /** End the sign-in in progress, if any, with this error. */ + fun fail(error: String) = finish(null, null, error) + + private fun acceptLoop(socket: ServerSocket, port: Int, path: String) { + while (true) { + // finish() closes the socket, which ends accept() with an exception. + val client = try { socket.accept() } catch (e: IOException) { return } + val target = try { + serve(client, path) + } catch (e: IOException) { + null + } finally { + try { client.close() } catch (ignored: IOException) {} + } + if (target != null) { + finish(socket, "http://127.0.0.1:$port$target", null) + return + } + } + } + + /** Read one request head and answer it; returns its target when it is the redirect. */ + private fun serve(client: Socket, path: String): String? { + client.soTimeout = CLIENT_TIMEOUT_MS + val input = client.getInputStream() + val head = ByteArrayOutputStream() + val buffer = ByteArray(2048) + while (head.size() < MAX_REQUEST_BYTES) { + val count = input.read(buffer) + if (count <= 0) break + head.write(buffer, 0, count) + if (head.toString("ISO-8859-1").contains("\r\n\r\n")) break + } + val target = requestTarget(head.toString("UTF-8")) + val matched = target != null && target.substringBefore('?') == path + val body = (if (matched) DONE_PAGE else "Not found").toByteArray(Charsets.UTF_8) + val headers = "HTTP/1.1 ${if (matched) "200 OK" else "404 Not Found"}\r\n" + + "Content-Type: text/html; charset=utf-8\r\nContent-Length: ${body.size}\r\n" + + "Cache-Control: no-store\r\nConnection: close\r\n\r\n" + val output = client.getOutputStream() + output.write(headers.toByteArray(Charsets.US_ASCII)) + output.write(body) + output.flush() + return if (matched) target else null + } + + /** + * Report the outcome once and stop listening. `socket` limits it to that + * receiver's sign-in (a late redirect after a newer start() is dropped); + * null ends whichever is in progress. + */ + private fun finish(socket: ServerSocket?, url: String?, error: String?) { + val ended = synchronized(lock) { + val current = server + if (current == null || (socket != null && socket !== current)) return + val pending = listener + server = null + listener = null + try { current.close() } catch (ignored: IOException) {} + pending + } ?: return + mainHandler.post { ended.onFinished(url, if (url != null) null else error) } + } +} diff --git a/App_Resources/Android/src/main/java/com/faceclaw/app/NotificationCustomViews.kt b/App_Resources/Android/src/main/java/com/faceclaw/app/NotificationCustomViews.kt new file mode 100644 index 00000000..42773246 --- /dev/null +++ b/App_Resources/Android/src/main/java/com/faceclaw/app/NotificationCustomViews.kt @@ -0,0 +1,200 @@ +package com.faceclaw.app + +import android.app.Notification +import android.content.Context +import android.graphics.Bitmap +import android.graphics.Canvas +import android.graphics.Picture +import android.os.Build +import android.service.notification.StatusBarNotification +import android.util.Log +import android.view.View +import android.view.ViewGroup +import android.widget.FrameLayout +import android.widget.RemoteViews +import android.widget.TextView + +import kotlin.math.ceil +import kotlin.math.max +import kotlin.math.min +import kotlin.math.roundToInt + +/** + * A notification's custom layout (RemoteViews), which can carry what its standard fields leave + * out: Dexcom's G7 notification has no title or text at all, just a layout with the glucose + * reading and trend arrow. Inflated here the way the shade does it, for its text (a stand-in + * title in lists) and to draw it as a picture. + */ +internal object NotificationCustomViews { + private const val TAG = "FaceclawNotifyView" + /** Set by Notification.Builder when the app gave it a custom layout (Notification.EXTRA_CONTAINS_CUSTOM_VIEW, hidden). */ + private const val EXTRA_CONTAINS_CUSTOM_VIEW = "android.contains.customView" + private const val VIEW_CACHE_MAX_ENTRIES = 8 + private const val TEXT_CACHE_MAX_ENTRIES = 64 + /** Layouts are cut off below this height, in dp; the shade caps an expanded notification at 256. */ + private const val MAX_HEIGHT_DP = 320 + + /** Inflated layouts by notification post and layout; null when inflating failed, so it isn't retried every paint. */ + private val views = Lru(VIEW_CACHE_MAX_ENTRIES) + private val texts = Lru>(TEXT_CACHE_MAX_ENTRIES) + + /** + * Whether the app gave the notification a custom layout. The flag tells one apart from the + * standard template that Notification.Builder stores in contentView for apps targeting + * Android 6 and older, which only repeats the title and text. + */ + @Suppress("DEPRECATION") + fun hasCustomView(notification: Notification): Boolean { + val extras = notification.extras ?: return false + return extras.getBoolean(EXTRA_CONTAINS_CUSTOM_VIEW) + && (notification.contentView != null || notification.bigContentView != null || notification.headsUpContentView != null) + } + + /** + * The text of the custom layout as collapsed in the shade, one entry per visible TextView in + * layout order; empty without a custom layout. Cached per post of the notification. + */ + @Synchronized + fun texts(context: Context, statusBarNotification: StatusBarNotification): List { + val notification = statusBarNotification.notification ?: return emptyList() + val (name, layout) = layoutFor(notification, expanded = false) ?: return emptyList() + return texts.getOrPut(postKey(statusBarNotification, name)) { + inflate(context, statusBarNotification, name, layout)?.let { collectTexts(it, ArrayList()) } ?: emptyList() + } + } + + /** + * The custom layout drawn as a gray packet fitting maxWidth x maxHeight; empty without one + * or when it can't be drawn. It is laid out maxWidth dp wide and shown at no more than a + * glasses pixel per dp, where the shade's text sizes land near the glasses' UI font, then + * trimmed to what it draws. The collapsed layout is used when the notification has a + * picture to show under it (an expanded layout tends to repeat the picture, as Dexcom's + * does), else the expanded one. Ink drawn for a light background comes out light on dark. + */ + @Synchronized + fun renderGray( + context: Context, statusBarNotification: StatusBarNotification, expanded: Boolean, + maxWidth: Int, maxHeight: Int, gamma: Float, dither: Boolean, + ): ByteArray { + val notification = statusBarNotification.notification ?: return ByteArray(0) + if (maxWidth <= 0 || maxHeight <= 0) return ByteArray(0) + val (name, layout) = layoutFor(notification, expanded) ?: return ByteArray(0) + val view = inflate(context, statusBarNotification, name, layout) ?: return ByteArray(0) + try { + val density = context.resources.displayMetrics.density + val widthPx = max(1, (maxWidth * density).roundToInt()) + val maxHeightPx = max(1, (MAX_HEIGHT_DP * density).roundToInt()) + view.measure( + View.MeasureSpec.makeMeasureSpec(widthPx, View.MeasureSpec.EXACTLY), + View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)) + if (view.measuredHeight > maxHeightPx) { + view.measure( + View.MeasureSpec.makeMeasureSpec(widthPx, View.MeasureSpec.EXACTLY), + View.MeasureSpec.makeMeasureSpec(maxHeightPx, View.MeasureSpec.AT_MOST)) + } + val heightPx = min(view.measuredHeight, maxHeightPx) + if (heightPx <= 0) return ByteArray(0) + view.layout(0, 0, widthPx, heightPx) + + val drawn = drawView(view, widthPx, heightPx) + val pixels = IntArray(widthPx * heightPx) + drawn.getPixels(pixels, 0, widthPx, 0, 0, widthPx, heightPx) + drawn.recycle() + val bounds = GrayPacket.inkBounds(pixels, widthPx, heightPx) ?: return ByteArray(0) + val cropWidth = bounds[2] - bounds[0] + val cropHeight = bounds[3] - bounds[1] + val cropped = IntArray(cropWidth * cropHeight) + for (y in 0 until cropHeight) { + System.arraycopy(pixels, (bounds[1] + y) * widthPx + bounds[0], cropped, y * cropWidth, cropWidth) + } + GrayPacket.lightenDarkInk(cropped, cropWidth, cropHeight) + val art = Bitmap.createBitmap(cropped, cropWidth, cropHeight, Bitmap.Config.ARGB_8888) + // A dp per glasses pixel at most: bitmapToGrayPacket otherwise blows a narrow layout up to the box. + val fitWidth = min(maxWidth, ceil(cropWidth / density).toInt()) + val fitHeight = min(maxHeight, ceil(cropHeight / density).toInt()) + Log.i(TAG, "rendered $name layout of ${statusBarNotification.packageName}: ${cropWidth}x$cropHeight px" + + " into ${fitWidth}x$fitHeight") + return ImageFileLoader.bitmapToGrayPacket( + FaceclawMediaNotificationListenerService.halveToward(art, fitWidth, fitHeight), + fitWidth, fitHeight, gamma, dither, true) + } catch (t: Throwable) { + Log.w(TAG, "failed to draw the $name layout of ${statusBarNotification.packageName}", t) + return ByteArray(0) + } + } + + /** + * The custom layout to use, with the field it came from: the collapsed one (contentView) + * or the expanded one (bigContentView), falling back on the other, then on the heads-up one. + */ + @Suppress("DEPRECATION") + private fun layoutFor(notification: Notification, expanded: Boolean): Pair? { + if (!hasCustomView(notification)) return null + val collapsed = notification.contentView?.let { "content" to it } + val big = notification.bigContentView?.let { "big" to it } + val first = if (expanded) big ?: collapsed else collapsed ?: big + return first ?: notification.headsUpContentView?.let { "headsUp" to it } + } + + /** A notification is reposted (with a new postTime) whenever its app updates it. */ + private fun postKey(statusBarNotification: StatusBarNotification, layoutName: String): String = + "${statusBarNotification.key}|${statusBarNotification.postTime}|$layoutName" + + private fun inflate(context: Context, statusBarNotification: StatusBarNotification, name: String, layout: RemoteViews): View? = + views.getOrPut(postKey(statusBarNotification, name)) { + try { + // RemoteViews loads the layout and its resources from the posting app's package. + layout.apply(context, FrameLayout(context)) + } catch (t: Throwable) { + Log.w(TAG, "failed to inflate the $name layout of ${statusBarNotification.packageName}", t) + null + } + } + + private fun collectTexts(view: View, out: MutableList): List { + if (view.visibility != View.VISIBLE) return out + if (view is TextView) { + val text = view.text?.toString()?.replace(Regex("\\s+"), " ")?.trim() ?: "" + if (text.isNotEmpty()) out.add(text) + } else if (view is ViewGroup) { + for (index in 0 until view.childCount) { + collectTexts(view.getChildAt(index), out) + } + } + return out + } + + /** + * Draws a laid-out view to a software bitmap. From Android 9 this goes through a Picture, + * which (unlike a bitmap's Canvas) accepts the hardware bitmaps a layout's images can + * arrive as; Bitmap.createBitmap then renders it on the GPU and reads it back if it has to. + */ + private fun drawView(view: View, width: Int, height: Int): Bitmap { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + val picture = Picture() + view.draw(picture.beginRecording(width, height)) + picture.endRecording() + return Bitmap.createBitmap(picture, width, height, Bitmap.Config.ARGB_8888) + } + val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) + view.draw(Canvas(bitmap)) + return bitmap + } + + /** A small LRU map; values may be null. Callers hold the object's lock. */ + private class Lru(private val maxEntries: Int) { + private val entries = object : LinkedHashMap(16, 0.75f, true) { + override fun removeEldestEntry(eldest: MutableMap.MutableEntry): Boolean = size > maxEntries + } + + fun getOrPut(key: String, compute: () -> V): V { + if (entries.containsKey(key)) { + @Suppress("UNCHECKED_CAST") + return entries[key] as V + } + val value = compute() + entries[key] = value + return value + } + } +} diff --git a/App_Resources/Android/src/main/res/drawable/ic_input_history.xml b/App_Resources/Android/src/main/res/drawable/ic_input_history.xml new file mode 100644 index 00000000..fac2b0c3 --- /dev/null +++ b/App_Resources/Android/src/main/res/drawable/ic_input_history.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/App_Resources/Android/src/main/res/drawable/ic_show_glasses.xml b/App_Resources/Android/src/main/res/drawable/ic_show_glasses.xml new file mode 100644 index 00000000..885a3245 --- /dev/null +++ b/App_Resources/Android/src/main/res/drawable/ic_show_glasses.xml @@ -0,0 +1,17 @@ + + + + + + diff --git a/App_Resources/Android/src/main/res/drawable/ic_show_phone.xml b/App_Resources/Android/src/main/res/drawable/ic_show_phone.xml new file mode 100644 index 00000000..c4c24609 --- /dev/null +++ b/App_Resources/Android/src/main/res/drawable/ic_show_phone.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/Contents.json b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/Contents.json new file mode 100644 index 00000000..78660545 --- /dev/null +++ b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "ic_input_history@3x.png", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/ic_input_history@3x.png b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/ic_input_history@3x.png new file mode 100644 index 00000000..3fdd7b0a Binary files /dev/null and b/App_Resources/iOS/Assets.xcassets/ic_input_history.imageset/ic_input_history@3x.png differ diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/Contents.json b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/Contents.json new file mode 100644 index 00000000..a85e2333 --- /dev/null +++ b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "ic_show_glasses@3x.png", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/ic_show_glasses@3x.png b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/ic_show_glasses@3x.png new file mode 100644 index 00000000..ebf50663 Binary files /dev/null and b/App_Resources/iOS/Assets.xcassets/ic_show_glasses.imageset/ic_show_glasses@3x.png differ diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/Contents.json b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/Contents.json new file mode 100644 index 00000000..575cf544 --- /dev/null +++ b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images": [ + { + "idiom": "universal", + "filename": "ic_show_phone@3x.png", + "scale": "3x" + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/ic_show_phone@3x.png b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/ic_show_phone@3x.png new file mode 100644 index 00000000..96e58794 Binary files /dev/null and b/App_Resources/iOS/Assets.xcassets/ic_show_phone.imageset/ic_show_phone@3x.png differ diff --git a/App_Resources/iOS/Info.plist b/App_Resources/iOS/Info.plist index 61957b6e..99f28b6b 100644 --- a/App_Resources/iOS/Info.plist +++ b/App_Resources/iOS/Info.plist @@ -13,7 +13,7 @@ CFBundleDisplayName Faceclaw CFBundleShortVersionString - 0.8.4 + 0.8.5 CFBundleVersion 1 LSRequiresIPhoneOS diff --git a/App_Resources/iOS/build.xcconfig b/App_Resources/iOS/build.xcconfig index 03805280..331a8be9 100644 --- a/App_Resources/iOS/build.xcconfig +++ b/App_Resources/iOS/build.xcconfig @@ -3,7 +3,9 @@ TARGETED_DEVICE_FAMILY = 1; CODE_SIGN_STYLE = Automatic; // Set IOS_TEAM_ID in build_paths.sh (or pass --teamId) to choose the signing team. -OTHER_LDFLAGS = $(inherited) -framework CoreBluetooth -framework CoreLocation -framework CoreText -framework Speech -framework AVFoundation -framework WebKit -framework SafariServices -framework UniformTypeIdentifiers -framework ImageIO -framework EventKit -framework MediaPlayer +// FoundationModels (the on-phone LLM, FaceclawSystemLanguageModel.swift) only exists on iOS 26+, +// so it is weak-linked: the app still launches on older iOS and reports the model unavailable. +OTHER_LDFLAGS = $(inherited) -framework CoreBluetooth -framework CoreLocation -framework CoreText -framework Speech -framework AVFoundation -framework WebKit -framework SafariServices -framework UniformTypeIdentifiers -framework ImageIO -framework EventKit -framework MediaPlayer -framework AuthenticationServices -framework Security -weak_framework FoundationModels ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; diff --git a/App_Resources/iOS/src/FaceclawAppleMusic.m b/App_Resources/iOS/src/FaceclawAppleMusic.m index d6b8cef0..9d8e63ce 100644 --- a/App_Resources/iOS/src/FaceclawAppleMusic.m +++ b/App_Resources/iOS/src/FaceclawAppleMusic.m @@ -1,4 +1,5 @@ #import "FaceclawAppleMusic.h" +#import "FaceclawGraphics.h" #import #import #import @@ -219,30 +220,7 @@ static NSDictionary *BrowseRow(NSString *mediaId, NSString *title, NSString *sub - (NSData *)albumArt:(NSInteger)maxSize { if (maxSize <= 0 || maxSize > 1024 || ![self hasPermission]) return nil; MPMediaItemArtwork *artwork = MPMusicPlayerController.systemMusicPlayer.nowPlayingItem.artwork; - UIImage *image = [artwork imageWithSize:CGSizeMake(maxSize, maxSize)]; - CGImageRef source = image.CGImage; - if (!source) return nil; - double sourceWidth = CGImageGetWidth(source), sourceHeight = CGImageGetHeight(source); - if (sourceWidth <= 0 || sourceHeight <= 0) return nil; - double scale = MIN(1.0, MIN(maxSize / sourceWidth, maxSize / sourceHeight)); - NSInteger width = MAX(1, lround(sourceWidth * scale)), height = MAX(1, lround(sourceHeight * scale)); - NSMutableData *packet = [NSMutableData dataWithLength:4 + width * height * 4]; - uint8_t *bytes = packet.mutableBytes; - bytes[0] = width & 255; bytes[1] = (width >> 8) & 255; - bytes[2] = height & 255; bytes[3] = (height >> 8) & 255; - uint8_t *pixels = bytes + 4; - CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); - // Memory order B, G, R, A: one little-endian ARGB word per pixel. - CGContextRef context = CGBitmapContextCreate(pixels, width, height, 8, width * 4, space, - kCGBitmapByteOrder32Little | (CGBitmapInfo)kCGImageAlphaPremultipliedFirst); - CGColorSpaceRelease(space); - if (!context) return nil; - CGContextSetInterpolationQuality(context, kCGInterpolationHigh); - CGContextDrawImage(context, CGRectMake(0, 0, width, height), source); - CGContextRelease(context); - // Composited over black (the display's see-through background); now opaque. - for (NSInteger i = 0; i < width * height; i++) pixels[i * 4 + 3] = 255; - return packet; + return [FaceclawGraphics bgraPacket:[artwork imageWithSize:CGSizeMake(maxSize, maxSize)].CGImage maxSize:maxSize]; } #pragma mark - Queue diff --git a/App_Resources/iOS/src/FaceclawConfigPort.h b/App_Resources/iOS/src/FaceclawConfigPort.h index 768f5cd5..fb48fec7 100644 --- a/App_Resources/iOS/src/FaceclawConfigPort.h +++ b/App_Resources/iOS/src/FaceclawConfigPort.h @@ -1,6 +1,17 @@ #import -/** Developer config transfer through the app container, before workers start. */ +NS_ASSUME_NONNULL_BEGIN +/** Converts between this phone's settings and the transfer document (Kotlin SettingsTransfer). */ +@protocol FaceclawConfigCodec +/** valuesJson is a JSON object of the settings; nil when they cannot be exported. */ +- (nullable NSString *)exportValuesJson:(NSString *)valuesJson platform:(NSString *)platform appVersion:(nullable NSString *)appVersion; +/** A JSON object: {"ok":true,"settings":{...},"skipped":[...],"sourcePlatform":...} or {"ok":false,"message":...}. */ +- (NSString *)importPlanDocument:(NSString *)document platform:(NSString *)platform; +@end + +/** Developer config transfer through the app container, before workers start (scripts/config-transfer.md). */ @interface FaceclawConfigPort : NSObject + (void)processPendingRequest; -+ (void)processDirectory:(NSString *)directory defaults:(NSUserDefaults *)defaults domain:(NSString *)domain; ++ (void)processDirectory:(NSString *)directory defaults:(NSUserDefaults *)defaults domain:(NSString *)domain + codec:(id)codec appVersion:(nullable NSString *)appVersion; @end +NS_ASSUME_NONNULL_END diff --git a/App_Resources/iOS/src/FaceclawConfigPort.m b/App_Resources/iOS/src/FaceclawConfigPort.m index 7da8efa2..15ada8bc 100644 --- a/App_Resources/iOS/src/FaceclawConfigPort.m +++ b/App_Resources/iOS/src/FaceclawConfigPort.m @@ -1,57 +1,112 @@ #import "FaceclawConfigPort.h" +#include +// The app links FaceclawKit; tests/ios-config-native.cjs builds this file for macOS without it +// and supplies its own codec. +#if __has_include() +#import +@interface FaceclawKitConfigCodec : NSObject +@end +@implementation FaceclawKitConfigCodec +- (NSString *)exportValuesJson:(NSString *)valuesJson platform:(NSString *)platform appVersion:(NSString *)appVersion { + return [FaceclawKitSettingsTransfer.shared exportValuesJson:valuesJson platform:platform appVersion:appVersion]; +} +- (NSString *)importPlanDocument:(NSString *)document platform:(NSString *)platform { + return [FaceclawKitSettingsTransfer.shared importPlanDocument:document platform:platform]; +} +@end +#define FACECLAW_CONFIG_CODEC [FaceclawKitConfigCodec new] +#endif + +static NSString *const kPlatform = @"ios"; +static NSString *const kChangeToken = @"ios.settings.changeToken"; + @implementation FaceclawConfigPort + (void)processPendingRequest { +#ifdef FACECLAW_CONFIG_CODEC NSString *library = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES).firstObject; [self processDirectory:[library stringByAppendingPathComponent:@"FaceclawConfigPort"] - defaults:NSUserDefaults.standardUserDefaults domain:NSBundle.mainBundle.bundleIdentifier]; + defaults:NSUserDefaults.standardUserDefaults domain:NSBundle.mainBundle.bundleIdentifier + codec:FACECLAW_CONFIG_CODEC + appVersion:NSBundle.mainBundle.infoDictionary[@"CFBundleShortVersionString"]]; +#endif } -+ (BOOL)validSettings:(id)settings { - if (![settings isKindOfClass:NSDictionary.class] || [settings count] > 4096) return NO; - for (id key in settings) { +// Typed locals, not messages to id: FaceclawKit declares other `count`/`length` properties. ++ (BOOL)validSettings:(id)candidate { + if (![candidate isKindOfClass:NSDictionary.class]) return NO; + NSDictionary *settings = candidate; + if (settings.count > 4096) return NO; + for (id candidateKey in settings) { + if (![candidateKey isKindOfClass:NSString.class]) return NO; + NSString *key = candidateKey; id value = settings[key]; - if (![key isKindOfClass:NSString.class] || ![key length] || [key length] > 512 || + if (!key.length || key.length > 512 || !([value isKindOfClass:NSString.class] || [value isKindOfClass:NSNumber.class])) return NO; } return YES; } -+ (void)processDirectory:(NSString *)directory defaults:(NSUserDefaults *)defaults domain:(NSString *)domain { +/** The app's settings: strings and finite numbers (booleans included) in its persistent domain. */ ++ (NSDictionary *)exportableSettings:(NSDictionary *)domain { + NSMutableDictionary *settings = [NSMutableDictionary new]; + for (NSString *key in domain) { + id value = domain[key]; + if ([value isKindOfClass:NSString.class] || + ([value isKindOfClass:NSNumber.class] && isfinite([value doubleValue]))) settings[key] = value; + } + [settings removeObjectForKey:kChangeToken]; + return settings; +} ++ (void)processDirectory:(NSString *)directory defaults:(NSUserDefaults *)defaults domain:(NSString *)domain + codec:(id)codec appVersion:(NSString *)appVersion { NSString *requestPath = [directory stringByAppendingPathComponent:@"request.json"]; NSData *data = [NSData dataWithContentsOfFile:requestPath]; if (!data) return; NSFileManager *fm = NSFileManager.defaultManager; // Consume once. A failed import must never be replayed at a later launch. [fm removeItemAtPath:requestPath error:nil]; - id request = data.length <= 2 * 1024 * 1024 ? [NSJSONSerialization JSONObjectWithData:data options:0 error:nil] : nil; + // A push embeds a document of up to 2 MiB as a JSON string, which escaping can enlarge. + id request = data.length <= 8 * 1024 * 1024 ? [NSJSONSerialization JSONObjectWithData:data options:0 error:nil] : nil; BOOL valid = [request isKindOfClass:NSDictionary.class]; NSString *identifier = valid && [request[@"id"] isKindOfClass:NSString.class] ? request[@"id"] : @""; NSMutableDictionary *reply = [@{@"id":identifier, @"ok":@NO, @"message":@"Invalid config request"} mutableCopy]; [defaults synchronize]; NSDictionary *before = [defaults persistentDomainForName:domain] ?: @{}; if (valid && [request[@"operation"] isEqual:@"pull"]) { - NSMutableDictionary *settings = [NSMutableDictionary new]; - for (NSString *key in before) { - id value = before[key]; - if ([value isKindOfClass:NSString.class] || [value isKindOfClass:NSNumber.class]) settings[key] = value; + NSDictionary *settings = [self exportableSettings:before]; + NSData *values = [NSJSONSerialization dataWithJSONObject:settings options:0 error:nil]; + NSString *document = values ? [codec exportValuesJson:[[NSString alloc] initWithData:values encoding:NSUTF8StringEncoding] + platform:kPlatform appVersion:appVersion] : nil; + if (document) { + reply[@"ok"] = @YES; reply[@"message"] = @"Config exported"; + reply[@"document"] = document; reply[@"count"] = @(settings.count); + } else reply[@"message"] = @"Could not encode settings"; + } else if (valid && [request[@"operation"] isEqual:@"push"] && [request[@"document"] isKindOfClass:NSString.class]) { + NSData *planData = [[codec importPlanDocument:request[@"document"] platform:kPlatform] dataUsingEncoding:NSUTF8StringEncoding]; + id plan = planData ? [NSJSONSerialization JSONObjectWithData:planData options:0 error:nil] : nil; + NSDictionary *settings = [plan isKindOfClass:NSDictionary.class] ? plan[@"settings"] : nil; + if (![plan isKindOfClass:NSDictionary.class] || ![plan[@"ok"] isEqual:@YES]) { + id message = [plan isKindOfClass:NSDictionary.class] ? plan[@"message"] : nil; + reply[@"message"] = [message isKindOfClass:NSString.class] ? message : @"Invalid config"; + } else if (![self validSettings:settings]) { + reply[@"message"] = @"Invalid config"; + } else { + NSError *error = nil; + NSData *backup = [NSPropertyListSerialization dataWithPropertyList:before format:NSPropertyListBinaryFormat_v1_0 options:0 error:&error]; + if (backup && [backup writeToFile:[directory stringByAppendingPathComponent:@"previous.plist"] options:NSDataWritingAtomic error:&error]) { + NSMutableDictionary *next = [before mutableCopy]; + [next addEntriesFromDictionary:settings]; + next[kChangeToken] = NSUUID.UUID.UUIDString; + [defaults setPersistentDomain:next forName:domain]; + if ([defaults synchronize]) { + reply[@"ok"] = @YES; reply[@"message"] = @"Config imported"; + reply[@"count"] = @(settings.count); + if ([plan[@"skipped"] isKindOfClass:NSArray.class]) reply[@"skipped"] = plan[@"skipped"]; + if ([plan[@"sourcePlatform"] isKindOfClass:NSString.class]) reply[@"sourcePlatform"] = plan[@"sourcePlatform"]; + } else { + [defaults setPersistentDomain:before forName:domain]; [defaults synchronize]; + reply[@"message"] = @"Could not persist config; restored previous settings"; + } + } else reply[@"message"] = @"Could not back up existing settings; import skipped"; } - [settings removeObjectForKey:@"ios.settings.changeToken"]; - reply[@"config"] = @{@"schema":@1, @"settings":settings}; reply[@"ok"] = @YES; - reply[@"message"] = @"Config exported"; - } else if (valid && [request[@"operation"] isEqual:@"push"] && [self validSettings:request[@"settings"]]) { - NSError *error = nil; - NSData *backup = [NSPropertyListSerialization dataWithPropertyList:before format:NSPropertyListBinaryFormat_v1_0 options:0 error:&error]; - if (backup && [backup writeToFile:[directory stringByAppendingPathComponent:@"previous.plist"] options:NSDataWritingAtomic error:&error]) { - NSMutableDictionary *next = [before mutableCopy]; - [next addEntriesFromDictionary:request[@"settings"]]; - next[@"ios.settings.changeToken"] = NSUUID.UUID.UUIDString; - [defaults setPersistentDomain:next forName:domain]; - if ([defaults synchronize]) { - reply[@"ok"] = @YES; reply[@"message"] = @"Config imported"; - reply[@"count"] = @([request[@"settings"] count]); - } else { - [defaults setPersistentDomain:before forName:domain]; [defaults synchronize]; - reply[@"message"] = @"Could not persist config; restored previous settings"; - } - } else reply[@"message"] = @"Could not back up existing settings; import skipped"; } NSData *response = [NSJSONSerialization dataWithJSONObject:reply options:NSJSONWritingPrettyPrinted error:nil]; [response writeToFile:[directory stringByAppendingPathComponent:@"response.json"] options:NSDataWritingAtomic error:nil]; diff --git a/App_Resources/iOS/src/FaceclawCrypto.h b/App_Resources/iOS/src/FaceclawCrypto.h index c0eb02ba..cdd6ffc4 100644 --- a/App_Resources/iOS/src/FaceclawCrypto.h +++ b/App_Resources/iOS/src/FaceclawCrypto.h @@ -2,4 +2,8 @@ @interface FaceclawCrypto : NSObject + (NSString *)hmacSha256:(NSString *)secret message:(NSString *)message; + (NSString *)sha256:(NSData *)data; +/** byteCount bytes from the system CSPRNG, base64url without padding (an OAuth state or PKCE verifier). */ ++ (NSString *)randomBase64Url:(NSInteger)byteCount; +/** SHA-256 of the text's UTF-8, base64url without padding (a PKCE S256 code challenge). */ ++ (NSString *)sha256Base64Url:(NSString *)text; @end diff --git a/App_Resources/iOS/src/FaceclawCrypto.m b/App_Resources/iOS/src/FaceclawCrypto.m index 6814fb3c..2e968a65 100644 --- a/App_Resources/iOS/src/FaceclawCrypto.m +++ b/App_Resources/iOS/src/FaceclawCrypto.m @@ -1,6 +1,15 @@ #import "FaceclawCrypto.h" #import #import +#import + +static NSString *Base64Url(NSData *data) { + NSString *base64 = [data base64EncodedStringWithOptions:0]; + base64 = [base64 stringByReplacingOccurrencesOfString:@"+" withString:@"-"]; + base64 = [base64 stringByReplacingOccurrencesOfString:@"/" withString:@"_"]; + return [base64 stringByReplacingOccurrencesOfString:@"=" withString:@""]; +} + @implementation FaceclawCrypto + (NSString *)hmacSha256:(NSString *)secret message:(NSString *)message { NSData *key = [secret dataUsingEncoding:NSUTF8StringEncoding]; @@ -16,4 +25,16 @@ for (NSUInteger i = 0; i < sizeof(digest); i++) [hex appendFormat:@"%02x", digest[i]]; return hex; } ++ (NSString *)randomBase64Url:(NSInteger)byteCount { + if (byteCount <= 0 || byteCount > 1024) return nil; + NSMutableData *bytes = [NSMutableData dataWithLength:(NSUInteger)byteCount]; + if (SecRandomCopyBytes(kSecRandomDefault, bytes.length, bytes.mutableBytes) != errSecSuccess) return nil; + return Base64Url(bytes); +} ++ (NSString *)sha256Base64Url:(NSString *)text { + NSData *data = [text dataUsingEncoding:NSUTF8StringEncoding]; + unsigned char digest[CC_SHA256_DIGEST_LENGTH]; + CC_SHA256(data.bytes, (CC_LONG)data.length, digest); + return Base64Url([NSData dataWithBytes:digest length:sizeof(digest)]); +} @end diff --git a/App_Resources/iOS/src/FaceclawGraphics.h b/App_Resources/iOS/src/FaceclawGraphics.h index 64614bdf..2f71ddcd 100644 --- a/App_Resources/iOS/src/FaceclawGraphics.h +++ b/App_Resources/iOS/src/FaceclawGraphics.h @@ -7,4 +7,11 @@ + (NSData *)renderSVG:(NSString *)svg size:(NSInteger)size; + (NSData *)decodeImage:(NSData *)data width:(NSInteger)width height:(NSInteger)height; + (NSData *)decodeImageFile:(NSString *)path maxWidth:(NSInteger)maxWidth maxHeight:(NSInteger)maxHeight; +/** + * [widthLo, widthHi, heightLo, heightHi, BGRA...] fitted within maxSize (never upscaled), + * composited over black; the input of the shared Kotlin gray tone curve and dither. + */ ++ (NSData *)bgraPacket:(CGImageRef)image maxSize:(NSInteger)maxSize; +/** bgraPacket of encoded image bytes (JPEG, PNG, ...); nil when undecodable. */ ++ (NSData *)bgraPacketFromImageData:(NSData *)data maxSize:(NSInteger)maxSize; @end diff --git a/App_Resources/iOS/src/FaceclawGraphics.m b/App_Resources/iOS/src/FaceclawGraphics.m index 84e7a453..cd8f3f16 100644 --- a/App_Resources/iOS/src/FaceclawGraphics.m +++ b/App_Resources/iOS/src/FaceclawGraphics.m @@ -120,4 +120,42 @@ CGColorSpaceRelease(space); return gray; } ++ (NSData *)bgraPacket:(CGImageRef)image maxSize:(NSInteger)maxSize { + if (!image || maxSize <= 0 || maxSize > 1024) return nil; + double sourceWidth = CGImageGetWidth(image), sourceHeight = CGImageGetHeight(image); + if (sourceWidth <= 0 || sourceHeight <= 0) return nil; + double scale = MIN(1.0, MIN(maxSize / sourceWidth, maxSize / sourceHeight)); + NSInteger width = MAX(1, lround(sourceWidth * scale)), height = MAX(1, lround(sourceHeight * scale)); + NSMutableData *packet = [NSMutableData dataWithLength:4 + width * height * 4]; + uint8_t *bytes = packet.mutableBytes; + bytes[0] = width & 255; bytes[1] = (width >> 8) & 255; + bytes[2] = height & 255; bytes[3] = (height >> 8) & 255; + uint8_t *pixels = bytes + 4; + CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); + // Memory order B, G, R, A: one little-endian ARGB word per pixel. + CGContextRef context = CGBitmapContextCreate(pixels, width, height, 8, width * 4, space, + kCGBitmapByteOrder32Little | (CGBitmapInfo)kCGImageAlphaPremultipliedFirst); + CGColorSpaceRelease(space); + if (!context) return nil; + CGContextSetInterpolationQuality(context, kCGInterpolationHigh); + CGContextDrawImage(context, CGRectMake(0, 0, width, height), image); + CGContextRelease(context); + // Composited over black (the display's see-through background); now opaque. + for (NSInteger i = 0; i < width * height; i++) pixels[i * 4 + 3] = 255; + return packet; +} ++ (NSData *)bgraPacketFromImageData:(NSData *)data maxSize:(NSInteger)maxSize { + if (!data.length || maxSize <= 0 || maxSize > 1024) return nil; + CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); + if (!source) return nil; + NSDictionary *options = @{(id)kCGImageSourceCreateThumbnailFromImageAlways: @YES, + (id)kCGImageSourceCreateThumbnailWithTransform: @YES, + (id)kCGImageSourceThumbnailMaxPixelSize: @(maxSize)}; + CGImageRef image = CGImageSourceCreateThumbnailAtIndex(source, 0, (__bridge CFDictionaryRef)options); + CFRelease(source); + if (!image) return nil; + NSData *packet = [self bgraPacket:image maxSize:maxSize]; + CGImageRelease(image); + return packet; +} @end diff --git a/App_Resources/iOS/src/FaceclawLoopbackRedirect.h b/App_Resources/iOS/src/FaceclawLoopbackRedirect.h new file mode 100644 index 00000000..f5c81d5f --- /dev/null +++ b/App_Resources/iOS/src/FaceclawLoopbackRedirect.h @@ -0,0 +1,16 @@ +#import + +/** + * Catches an OAuth redirect to http://127.0.0.1: (the loopback redirect that + * providers such as Spotify accept from native apps): listens on the loopback interface + * only, answers the browser's request for the path with a short "return to Faceclaw" + * page and hands back the full redirect URL, query included. Any other path (a favicon) + * gets a 404. Foundation-only, so the macOS test builds it as is. + */ +@interface FaceclawLoopbackRedirect : NSObject +/** Called on the main queue with each redirect to the path. */ +@property(nonatomic, copy) void (^redirectHandler)(NSString *url); +/** Start listening; nil on success, otherwise why not (e.g. another app holds the port). */ +- (NSString *)startOnPort:(NSInteger)port path:(NSString *)path; +- (void)stop; +@end diff --git a/App_Resources/iOS/src/FaceclawLoopbackRedirect.m b/App_Resources/iOS/src/FaceclawLoopbackRedirect.m new file mode 100644 index 00000000..3f9fca8a --- /dev/null +++ b/App_Resources/iOS/src/FaceclawLoopbackRedirect.m @@ -0,0 +1,128 @@ +#import "FaceclawLoopbackRedirect.h" +#import +#import +#import +#import +#import +#import + +/** Request heads beyond this are not a browser's redirect; stop reading. */ +static const NSUInteger kMaxRequestBytes = 16384; + +static NSString *const kDonePage = + @"" + @"Faceclaw" + @"" + @"

Signed in

You can return to Faceclaw.

"; + +@interface FaceclawLoopbackRedirect () +@property(nonatomic, strong) dispatch_queue_t queue; +@property(nonatomic, strong) dispatch_source_t acceptSource; +@property(nonatomic) NSInteger port; +@property(nonatomic, copy) NSString *path; +@end + +@implementation FaceclawLoopbackRedirect +- (instancetype)init { + if ((self = [super init])) { + _queue = dispatch_queue_create("com.faceclaw.loopback-redirect", DISPATCH_QUEUE_SERIAL); + } + return self; +} + +- (void)dealloc { + [self stop]; +} + +- (NSString *)startOnPort:(NSInteger)port path:(NSString *)path { + [self stop]; + if (port <= 0 || port > 65535 || ![path hasPrefix:@"/"]) return @"Invalid redirect address"; + int fd = socket(AF_INET, SOCK_STREAM, 0); + if (fd < 0) return [NSString stringWithFormat:@"Could not open a socket (errno %d)", errno]; + int yes = 1; + setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)); + struct sockaddr_in address = {0}; + address.sin_len = sizeof(address); + address.sin_family = AF_INET; + address.sin_port = htons((uint16_t)port); + address.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + if (bind(fd, (struct sockaddr *)&address, sizeof(address)) != 0 || listen(fd, 8) != 0) { + int error = errno; + close(fd); + return error == EADDRINUSE + ? [NSString stringWithFormat:@"Another app is using port %ld; close it and try again", (long)port] + : [NSString stringWithFormat:@"Could not listen on port %ld (errno %d)", (long)port, error]; + } + fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); + self.port = port; + self.path = path; + dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, (uintptr_t)fd, 0, self.queue); + __weak typeof(self) weakSelf = self; + dispatch_source_set_event_handler(source, ^{ + int client = accept(fd, NULL, NULL); + if (client < 0) return; + FaceclawLoopbackRedirect *strongSelf = weakSelf; + if (strongSelf) [strongSelf serve:client]; + else close(client); + }); + dispatch_source_set_cancel_handler(source, ^{ close(fd); }); + self.acceptSource = source; + dispatch_resume(source); + return nil; +} + +- (void)stop { + if (self.acceptSource) dispatch_source_cancel(self.acceptSource); + self.acceptSource = nil; +} + +/** Read one request head and answer it; runs on the receiver's queue (blocking, with timeouts). */ +- (void)serve:(int)client { + // BSD sockets inherit O_NONBLOCK from the listener. + fcntl(client, F_SETFL, fcntl(client, F_GETFL) & ~O_NONBLOCK); + int yes = 1; + setsockopt(client, SOL_SOCKET, SO_NOSIGPIPE, &yes, sizeof(yes)); + struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 }; + setsockopt(client, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); + setsockopt(client, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); + + NSMutableData *head = [NSMutableData data]; + NSData *terminator = [@"\r\n\r\n" dataUsingEncoding:NSASCIIStringEncoding]; + char buffer[2048]; + while (head.length < kMaxRequestBytes) { + ssize_t count = recv(client, buffer, sizeof(buffer), 0); + if (count <= 0) break; + [head appendBytes:buffer length:(NSUInteger)count]; + if ([head rangeOfData:terminator options:0 range:NSMakeRange(0, head.length)].location != NSNotFound) break; + } + NSString *text = [[NSString alloc] initWithData:head encoding:NSUTF8StringEncoding] ?: @""; + NSArray *requestLine = [[text componentsSeparatedByString:@"\r\n"].firstObject componentsSeparatedByString:@" "]; + NSString *target = requestLine.count >= 3 && [requestLine[0] isEqualToString:@"GET"] ? requestLine[1] : nil; + BOOL matched = target && [[target componentsSeparatedByString:@"?"].firstObject isEqualToString:self.path]; + [self respond:client status:matched ? @"200 OK" : @"404 Not Found" body:matched ? kDonePage : @"Not found"]; + close(client); + if (!matched) return; + + NSString *url = [NSString stringWithFormat:@"http://127.0.0.1:%ld%@", (long)self.port, target]; + void (^handler)(NSString *) = self.redirectHandler; + dispatch_async(dispatch_get_main_queue(), ^{ + if (handler) handler(url); + }); +} + +- (void)respond:(int)client status:(NSString *)status body:(NSString *)body { + NSData *bodyData = [body dataUsingEncoding:NSUTF8StringEncoding]; + NSString *headers = [NSString stringWithFormat: + @"HTTP/1.1 %@\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %lu\r\n" + @"Cache-Control: no-store\r\nConnection: close\r\n\r\n", status, (unsigned long)bodyData.length]; + NSMutableData *response = [[headers dataUsingEncoding:NSASCIIStringEncoding] mutableCopy]; + [response appendData:bodyData]; + const uint8_t *bytes = response.bytes; + NSUInteger sent = 0; + while (sent < response.length) { + ssize_t count = send(client, bytes + sent, response.length - sent, 0); + if (count <= 0) break; + sent += (NSUInteger)count; + } +} +@end diff --git a/App_Resources/iOS/src/FaceclawResourceUsage.h b/App_Resources/iOS/src/FaceclawResourceUsage.h new file mode 100644 index 00000000..3c29e87b --- /dev/null +++ b/App_Resources/iOS/src/FaceclawResourceUsage.h @@ -0,0 +1,16 @@ +#import + +/** Lightweight process counters for the on-glasses resource-usage monitor. */ +@interface FaceclawResourceUsage : NSObject +/** + * One sample as a JSON object: atMs (monotonic clock, counting sleep), cpuMs + * (user+system time of every thread, alive or exited), footprintKb (the + * phys_footprint that jetsam limits and Xcode's memory gauge shows), + * footprintPeakKb (lifetime peak), residentKb, mallocKb (bytes in use across + * malloc zones), availableKb (headroom before the jetsam limit; 0 when there + * is none, as on the simulator), threads, thermalState + * (NSProcessInfoThermalState) and lowPower. Fields whose query fails are + * omitted. + */ ++ (NSString *)sample; +@end diff --git a/App_Resources/iOS/src/FaceclawResourceUsage.m b/App_Resources/iOS/src/FaceclawResourceUsage.m new file mode 100644 index 00000000..d75fe897 --- /dev/null +++ b/App_Resources/iOS/src/FaceclawResourceUsage.m @@ -0,0 +1,60 @@ +#import "FaceclawResourceUsage.h" +#import +#import +#import +#import +#import +#if TARGET_OS_IPHONE +#import +#endif + +static NSNumber *kib(uint64_t bytes) { return @(bytes / 1024); } + +@implementation FaceclawResourceUsage ++ (NSString *)sample { + NSMutableDictionary *out = [NSMutableDictionary new]; + out[@"atMs"] = @(clock_gettime_nsec_np(CLOCK_MONOTONIC) / 1000000ULL); + + struct rusage usage; + if (getrusage(RUSAGE_SELF, &usage) == 0) { + double seconds = (double)usage.ru_utime.tv_sec + (double)usage.ru_stime.tv_sec; + double micros = (double)usage.ru_utime.tv_usec + (double)usage.ru_stime.tv_usec; + out[@"cpuMs"] = @(seconds * 1000.0 + micros / 1000.0); + } + + // The kernel fills as much of the struct as it knows and shrinks count to + // match, so later-revision fields are read only when count covers them. + task_vm_info_data_t vm; + mach_msg_type_number_t count = TASK_VM_INFO_COUNT; + if (task_info(mach_task_self(), TASK_VM_INFO, (task_info_t)&vm, &count) == KERN_SUCCESS) { + out[@"residentKb"] = kib(vm.resident_size); + if (count >= TASK_VM_INFO_REV1_COUNT) out[@"footprintKb"] = kib(vm.phys_footprint); + if (count >= TASK_VM_INFO_REV3_COUNT && vm.ledger_phys_footprint_peak > 0) { + out[@"footprintPeakKb"] = kib((uint64_t)vm.ledger_phys_footprint_peak); + } + } + + malloc_statistics_t heap = {0}; + malloc_zone_statistics(NULL, &heap); + out[@"mallocKb"] = kib(heap.size_in_use); + +#if TARGET_OS_IPHONE + out[@"availableKb"] = kib(os_proc_available_memory()); +#endif + + thread_act_array_t threads = NULL; + mach_msg_type_number_t threadCount = 0; + if (task_threads(mach_task_self(), &threads, &threadCount) == KERN_SUCCESS) { + for (mach_msg_type_number_t i = 0; i < threadCount; i++) mach_port_deallocate(mach_task_self(), threads[i]); + vm_deallocate(mach_task_self(), (vm_address_t)threads, threadCount * sizeof(thread_act_t)); + out[@"threads"] = @(threadCount); + } + + NSProcessInfo *process = NSProcessInfo.processInfo; + out[@"thermalState"] = @(process.thermalState); + out[@"lowPower"] = @(process.lowPowerModeEnabled); + + NSData *json = [NSJSONSerialization dataWithJSONObject:out options:0 error:nil]; + return json ? [[NSString alloc] initWithData:json encoding:NSUTF8StringEncoding] : @"{}"; +} +@end diff --git a/App_Resources/iOS/src/FaceclawSpeechAnalyzer.swift b/App_Resources/iOS/src/FaceclawSpeechAnalyzer.swift new file mode 100644 index 00000000..d9624ed3 --- /dev/null +++ b/App_Resources/iOS/src/FaceclawSpeechAnalyzer.swift @@ -0,0 +1,273 @@ +@preconcurrency import AVFoundation +import CoreMedia +import Foundation +import Speech + +/// Long-form on-device transcription with SpeechAnalyzer and SpeechTranscriber +/// (iOS 26+), for continuous capture (Transcribe, Teleprompter, Calculator): +/// FaceclawSpeech's SFSpeechRecognizer only handles short dictations. It takes +/// the same 16 kHz mono PCM16LE the cloud providers get (see +/// app/native/speech-analyzer-stt.ios.ts) and reports JSON events on the main +/// queue through eventHandler: +/// +/// {"kind":"status","message":String} +/// {"kind":"ready","locale":String} audio is accepted from here on +/// {"kind":"transcript","text":String,"final":Bool, +/// "start":Double?,"end":Double?, the result's audio range +/// "speechEnd":Double?} when its last word ends +/// {"kind":"finished"} after finish(), once the last result is in +/// {"kind":"error","message":String} +/// +/// Times are seconds of audio since start. Volatile results (final: false) +/// cover all audio not finalized yet, replacing the previous volatile one; +/// their word times are only as fine as the result's range. A final's first +/// word reaches back into the silence before it, so only word ends are +/// reported. +/// +/// There is no way to settle text at a pause: on macOS 26.4 any mid-stream +/// SpeechAnalyzer.finalize(through:) left the next phrase's final as dots, +/// while the model splits its finals at pauses on its own. +/// Called from JavaScript, so on the main thread. +@MainActor +@objc(FaceclawSpeechAnalyzer) +@objcMembers +public class FaceclawSpeechAnalyzer: NSObject { + public var eventHandler: ((String) -> Void)? + // An AnalyzerEngine, typed loosely so the class itself loads before iOS 26. + private var engine: AnyObject? + + /// Whether this device can transcribe with SpeechTranscriber (iOS 26 and supported hardware). + public static func isSupported() -> Bool { + if #available(iOS 26.0, *) { return SpeechTranscriber.isAvailable } + return false + } + + /// `language` is a locale identifier ("en", "en-US"), or "" for the device's preferred language. + public func start(language: String) { + cancel() + guard #available(iOS 26.0, *) else { + emit(["kind": "error", "message": "On-device transcription needs iOS 26 or later."]) + return + } + let engine = AnalyzerEngine { [weak self] event in self?.emit(event) } + self.engine = engine + engine.start(language: language) + } + + /// 16 kHz mono PCM16LE; ignored until "ready". + public func acceptPcm(_ pcm: Data) { + if #available(iOS 26.0, *) { (engine as? AnalyzerEngine)?.accept(pcm) } + } + + /// End of audio: finalize the rest, then report "finished". + public func finish() { + if #available(iOS 26.0, *) { (engine as? AnalyzerEngine)?.finish() } + } + + /// Abandon the session without further events. + public func cancel() { + if #available(iOS 26.0, *) { (engine as? AnalyzerEngine)?.cancel() } + engine = nil + } + + private func emit(_ event: [String: Any]) { + // JSONSerialization raises (not throws) on NaN and other invalid values. + guard JSONSerialization.isValidJSONObject(event), + let data = try? JSONSerialization.data(withJSONObject: event), + let json = String(data: data, encoding: .utf8) else { return } + eventHandler?(json) + } +} + +@available(iOS 26.0, *) +@MainActor +private final class AnalyzerEngine { + private static let sampleRate = 16000.0 + private let emit: ([String: Any]) -> Void + private let pcmFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: AnalyzerEngine.sampleRate, channels: 1, interleaved: true)! + private var analyzer: SpeechAnalyzer? + private var input: AsyncStream.Continuation? + private var analyzerFormat: AVAudioFormat? + // Nil when the analyzer takes the input format as it is. + private var converter: AVAudioConverter? + private var ready = false + private var finishing = false + private var closed = false + private var setup: Task? + private var results: Task? + + init(emit: @escaping ([String: Any]) -> Void) { self.emit = emit } + + func start(language: String) { + setup = Task { [weak self] in await self?.prepare(language: language) } + } + + /// Events stop once the session is cancelled, even from work still winding down. + private func send(_ event: [String: Any]) { + if !closed { emit(event) } + } + + private func prepare(language: String) async { + send(["kind": "status", "message": "Preparing on-device transcription…"]) + let identifier = language.isEmpty ? (Locale.preferredLanguages.first ?? "en-US") : language + guard let locale = await SpeechTranscriber.supportedLocale(equivalentTo: Locale(identifier: identifier)) else { + fail("On-device transcription doesn't support \(identifier). Choose a cloud or Whisper server transcription provider (Settings > Voice).") + return + } + if closed { return } + let transcriber = SpeechTranscriber(locale: locale, transcriptionOptions: [], + reportingOptions: [.volatileResults], attributeOptions: [.audioTimeRange]) + do { + // Keep the model installed between sessions (best effort). + if !(await AssetInventory.reservedLocales).contains(locale) { + _ = try? await AssetInventory.reserve(locale: locale) + } + if closed { return } + if let request = try await AssetInventory.assetInstallationRequest(supporting: [transcriber]) { + if closed { return } + try await download(request) + } + if closed { return } + guard let format = await SpeechAnalyzer.bestAvailableAudioFormat(compatibleWith: [transcriber]) else { + fail("On-device transcription has no usable audio format.") + return + } + if closed { return } + if format != pcmFormat { + guard let converter = AVAudioConverter(from: pcmFormat, to: format) else { + fail("On-device transcription can't convert the microphone audio.") + return + } + self.converter = converter + } + analyzerFormat = format + let analyzer = SpeechAnalyzer(modules: [transcriber]) + let (stream, input) = AsyncStream.makeStream() + self.analyzer = analyzer + self.input = input + results = Task { [weak self] in await self?.collect(transcriber) } + try await analyzer.prepareToAnalyze(in: format) + try await analyzer.start(inputSequence: stream) + if closed { return } + ready = true + send(["kind": "ready", "locale": locale.identifier]) + if finishing { await finishAnalysis() } + } catch { + fail("On-device transcription: \(error.localizedDescription)") + } + } + + /// Fetch the locale's model, reporting progress while it downloads. + private func download(_ request: AssetInstallationRequest) async throws { + let progress = request.progress + let reporter = Task { [weak self] in + while !Task.isCancelled { + let percent = Int((progress.fractionCompleted * 100).rounded()) + self?.send(["kind": "status", "message": "Downloading on-device speech model… \(percent)%"]) + try? await Task.sleep(nanoseconds: 1_000_000_000) + } + } + defer { reporter.cancel() } + try await request.downloadAndInstall() + } + + func accept(_ pcm: Data) { + guard ready, !finishing, !closed, let input, let analyzerFormat else { return } + let frames = AVAudioFrameCount(pcm.count / 2) + guard frames > 0, let buffer = AVAudioPCMBuffer(pcmFormat: pcmFormat, frameCapacity: frames), + let channel = buffer.int16ChannelData else { return } + buffer.frameLength = frames + pcm.withUnsafeBytes { raw in + if let base = raw.baseAddress { memcpy(channel[0], base, Int(frames) * 2) } + } + guard let converter else { + input.yield(AnalyzerInput(buffer: buffer)) + return + } + let capacity = AVAudioFrameCount((Double(frames) * analyzerFormat.sampleRate / AnalyzerEngine.sampleRate).rounded(.up)) + 32 + guard let converted = AVAudioPCMBuffer(pcmFormat: analyzerFormat, frameCapacity: capacity) else { return } + var consumed = false + var error: NSError? + // noDataNow, not endOfStream: the converter keeps its resampling state for the next chunk. + converter.convert(to: converted, error: &error) { _, status in + if consumed { + status.pointee = .noDataNow + return nil + } + consumed = true + status.pointee = .haveData + return buffer + } + if error == nil && converted.frameLength > 0 { input.yield(AnalyzerInput(buffer: converted)) } + } + + func finish() { + guard !finishing, !closed else { return } + finishing = true + // Before "ready", prepare() finishes once the analyzer is running. + if ready { Task { await finishAnalysis() } } + } + + private func finishAnalysis() async { + input?.finish() + input = nil + do { + try await analyzer?.finalizeAndFinishThroughEndOfInput() + } catch { + fail("On-device transcription: \(error.localizedDescription)") + } + // collect() reports "finished" once the results sequence ends. + } + + func cancel() { + guard !closed else { return } + closed = true + input?.finish() + input = nil + setup?.cancel() + results?.cancel() + if let analyzer { Task { await analyzer.cancelAndFinishNow() } } + analyzer = nil + } + + private func collect(_ transcriber: SpeechTranscriber) async { + do { + for try await result in transcriber.results { + if closed { return } + send(event(for: result)) + } + send(["kind": "finished"]) + } catch { + fail("On-device transcription: \(error.localizedDescription)") + } + } + + private func event(for result: SpeechTranscriber.Result) -> [String: Any] { + let text = result.text + var speechEnd: Double? + for run in text.runs { + guard let range = run.audioTimeRange, + !String(text[run.range].characters).trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else { continue } + speechEnd = finite(range.end) ?? speechEnd + } + return [ + "kind": "transcript", + "text": String(text.characters), + "final": result.isFinal, + "start": finite(result.range.start) ?? NSNull(), + "end": finite(result.range.end) ?? NSNull(), + "speechEnd": speechEnd ?? NSNull(), + ] + } + + private func finite(_ time: CMTime) -> Double? { + let seconds = time.seconds + return seconds.isFinite ? seconds : nil + } + + private func fail(_ message: String) { + guard !closed else { return } + emit(["kind": "error", "message": message]) + cancel() + } +} diff --git a/App_Resources/iOS/src/FaceclawSystemLanguageModel.swift b/App_Resources/iOS/src/FaceclawSystemLanguageModel.swift new file mode 100644 index 00000000..ed9d3778 --- /dev/null +++ b/App_Resources/iOS/src/FaceclawSystemLanguageModel.swift @@ -0,0 +1,694 @@ +import Foundation +#if canImport(FoundationModels) +import FoundationModels +#endif + +/// The on-phone LLM on iOS: Apple's Foundation Models framework (the Apple +/// Intelligence system model, iOS 26+, eligible hardware). It runs out of +/// process on the Neural Engine, so it costs the app no model download or +/// memory, and unlike Metal work it is allowed (within a system budget) while +/// Faceclaw is in the background driving the glasses. +/// +/// JavaScript (app/native/local-llm.ios.ts) drives the same provider-neutral +/// agent loop as the cloud models: each start() is one loop iteration. The +/// request is JSON: +/// +/// {"system":String, +/// "tools":[{"name","description","parameters":}], +/// "history":[{"type":"prompt"|"response","text"} | +/// {"type":"toolCalls","calls":[{"id","name","arguments":}]} | +/// {"type":"toolOutput","id","name","text"}], +/// "prompt":String, "maxTokens":Int, "permissive":Bool} +/// +/// and events arrive on the main queue through eventHandler: +/// +/// {"kind":"delta","text":String} streamed reply text +/// {"kind":"toolCalls","calls":[{"id","name","arguments":}]} +/// {"kind":"done"} +/// {"kind":"error","code":String,"message":String} +/// {"kind":"log","message":String} +/// +/// The framework runs tools itself, mid-response. When the model calls one, +/// the call is reported as "toolCalls" and the generation stays suspended +/// inside the tool until resolveToolCalls() hands back the results that +/// JavaScript's tool loop produced; the reply then continues on the same +/// instance. +/// +/// The model's context window is small (4096 tokens on iOS 26, shared by input +/// and reply) and the framework spends ~50 tokens on each tool before its +/// parameters, so the assistant's full tool list (30+ tools, ~5000 tokens) can't +/// be offered at once. When the tools don't fit their share of the window, a +/// quick schema-constrained routing request first asks the model which few +/// tools the request needs. History is then trimmed to fit before each start(). +/// Called from JavaScript, so on the main thread. +@MainActor +@objc(FaceclawSystemLanguageModel) +@objcMembers +public class FaceclawSystemLanguageModel: NSObject { + public var eventHandler: ((String) -> Void)? + // A LanguageModelEngine, typed loosely so the class itself loads before iOS 26. + private var engine: AnyObject? + + /// "available", or why not: "unsupportedOS", "deviceNotEligible", + /// "appleIntelligenceNotEnabled", "modelNotReady" (still downloading), "unavailable". + /// Nonisolated: worker isolates load the model-choice list too, off the main thread. + nonisolated public static func availability() -> String { + #if canImport(FoundationModels) + if #available(iOS 26.0, *) { + switch SystemLanguageModel.default.availability { + case .available: + return "available" + case .unavailable(let reason): + switch reason { + case .deviceNotEligible: return "deviceNotEligible" + case .appleIntelligenceNotEnabled: return "appleIntelligenceNotEnabled" + case .modelNotReady: return "modelNotReady" + @unknown default: return "unavailable" + } + } + } + #endif + return "unsupportedOS" + } + + /// The model's context window in tokens (input and output share it), or 0 when unavailable. + nonisolated public static func contextSize() -> Int { + #if canImport(FoundationModels) + if #available(iOS 26.0, *) { return SystemLanguageModel.default.contextSize } + #endif + return 0 + } + + public func start(_ requestJson: String) { + cancel() + #if canImport(FoundationModels) + if #available(iOS 26.0, *) { + guard let data = requestJson.data(using: .utf8), + let request = (try? JSONSerialization.jsonObject(with: data)) as? [String: Any] else { + emit(["kind": "error", "code": "other", "message": "Invalid on-device model request"]) + return + } + let engine = LanguageModelEngine { [weak self] event in self?.emit(event) } + self.engine = engine + engine.start(request) + return + } + #endif + emit(["kind": "error", "code": "unavailable", "message": "The on-device model needs iOS 26 or later."]) + } + + /// `[{"id","content","isError"}]` for the calls of the last "toolCalls" event. + public func resolveToolCalls(_ resultsJson: String) { + #if canImport(FoundationModels) + if #available(iOS 26.0, *) { + let data = resultsJson.data(using: .utf8) ?? Data() + let results = ((try? JSONSerialization.jsonObject(with: data)) as? [[String: Any]]) ?? [] + (engine as? LanguageModelEngine)?.resolve(results) + } + #endif + } + + /// Abandon the generation (and any suspended tool calls) without further events. + public func cancel() { + #if canImport(FoundationModels) + if #available(iOS 26.0, *) { (engine as? LanguageModelEngine)?.cancel() } + #endif + engine = nil + } + + private func emit(_ event: [String: Any]) { + // JSONSerialization raises (not throws) on NaN and other invalid values. + guard JSONSerialization.isValidJSONObject(event), + let data = try? JSONSerialization.data(withJSONObject: event), + let json = String(data: data, encoding: .utf8) else { return } + eventHandler?(json) + } +} + +#if canImport(FoundationModels) + +/// A JavaScript-side tool: the framework calls it mid-response, and the +/// engine parks the call until JavaScript resolves it. +@available(iOS 26.0, *) +private struct BridgedTool: Tool { + typealias Arguments = GeneratedContent + typealias Output = String + + let name: String + let description: String + let parameters: GenerationSchema + let handler: @Sendable (String, String) async throws -> String + + func call(arguments: GeneratedContent) async throws -> String { + try await handler(name, arguments.jsonString) + } +} + +/// One tool from the request, convertible at two levels of verbosity. +@available(iOS 26.0, *) +private struct ToolSpec { + let name: String + let description: String + let parameters: [String: Any] +} + +@available(iOS 26.0, *) +@MainActor +final class LanguageModelEngine { + private struct PendingCall { + let id: String + let name: String + let arguments: String + let continuation: CheckedContinuation + } + + /// How long a call waits for any parallel calls before they're reported together. + private static let toolBatchDelayNs: UInt64 = 30_000_000 + /// Tokens kept free beyond the reply budget: the framework's own framing and rounding. + private static let contextMargin = 64 + /// Share of the context window tool definitions may take before tools are routed. + private static let toolBudgetFraction = 0.4 + /// Most tools a routing request picks. + private static let maxRoutedTools = 5 + /// Tools used in the latest exchanges stay offered, for follow-ups ("make it ten minutes"). + private static let keptRecentTools = 2 + + private let emit: ([String: Any]) -> Void + private var task: Task? + // Calls not yet reported, then reported calls awaiting results. + private var unreported: [PendingCall] = [] + private var awaiting: [String: PendingCall] = [:] + private var flushScheduled = false + private var closed = false + + init(emit: @escaping ([String: Any]) -> Void) { self.emit = emit } + + func start(_ request: [String: Any]) { + task = Task { [weak self] in await self?.run(request) } + } + + func resolve(_ results: [[String: Any]]) { + for result in results { + guard let id = result["id"] as? String, let call = awaiting.removeValue(forKey: id) else { continue } + let content = (result["content"] as? String) ?? "" + let isError = (result["isError"] as? Bool) ?? false + // An error goes back to the model as text: a thrown error would end the whole response. + call.continuation.resume(returning: isError ? "Error: \(content)" : (content.isEmpty ? "(no output)" : content)) + } + // A call JavaScript didn't answer can't be left hanging. + for (_, call) in awaiting { + call.continuation.resume(returning: "Error: the tool returned no result") + } + awaiting.removeAll() + } + + func cancel() { + closed = true + task?.cancel() + task = nil + for call in unreported { call.continuation.resume(throwing: CancellationError()) } + for (_, call) in awaiting { call.continuation.resume(throwing: CancellationError()) } + unreported.removeAll() + awaiting.removeAll() + } + + /// Events stop once the session is cancelled, even from work still winding down. + private func send(_ event: [String: Any]) { + if !closed { emit(event) } + } + + private func run(_ request: [String: Any]) async { + let system = (request["system"] as? String) ?? "" + let prompt = (request["prompt"] as? String) ?? "" + let maxTokens = (request["maxTokens"] as? NSNumber)?.intValue ?? 512 + let permissive = (request["permissive"] as? Bool) ?? false + let toolSpecs: [ToolSpec] = ((request["tools"] as? [[String: Any]]) ?? []).compactMap { tool in + guard let name = tool["name"] as? String else { return nil } + return ToolSpec(name: name, description: (tool["description"] as? String) ?? "", + parameters: (tool["parameters"] as? [String: Any]) ?? [:]) + } + let history = (request["history"] as? [[String: Any]]) ?? [] + + // Transformations of user text (translate, summarize) get the permissive + // guardrails; they apply to plain string replies, which tool-free requests are. + let model = SystemLanguageModel(useCase: .general, + guardrails: permissive ? .permissiveContentTransformations : .default) + var offered = toolSpecs + if !toolSpecs.isEmpty { + switch await selectTools(model: model, specs: toolSpecs, history: history, prompt: prompt) { + case .tools(let specs): offered = specs + case .failed(let event): + send(event) + return + } + if closed { return } + } + let fitted = await fit(model: model, system: system, tools: offered, history: history, + prompt: prompt, maxTokens: maxTokens) + if closed { return } + + let handler: @Sendable (String, String) async throws -> String = { [weak self] name, arguments in + guard let self = self else { throw CancellationError() } + return try await self.toolInvoked(name: name, arguments: arguments) + } + let tools: [any Tool] = fitted.tools.map { + BridgedTool(name: $0.name, description: $0.description, parameters: $0.schema, handler: handler) + } + let session = LanguageModelSession(model: model, tools: tools, transcript: Transcript(entries: fitted.entries)) + let options = GenerationOptions(maximumResponseTokens: maxTokens) + var last = "" + do { + for try await snapshot in session.streamResponse(to: prompt, options: options) { + if closed { return } + let text = snapshot.content + // Snapshots are cumulative; one that doesn't extend the last is a new segment. + let delta = text.hasPrefix(last) ? String(text.dropFirst(last.count)) : text + last = text + if !delta.isEmpty { send(["kind": "delta", "text": delta]) } + } + send(["kind": "done"]) + } catch { + if closed || error is CancellationError { return } + send(describe(error)) + } + } + + // MARK: - Tool calls + + private func toolInvoked(name: String, arguments: String) async throws -> String { + if closed { throw CancellationError() } + return try await withCheckedThrowingContinuation { continuation in + if closed { + continuation.resume(throwing: CancellationError()) + return + } + let id = "fm_" + UUID().uuidString.replacingOccurrences(of: "-", with: "").prefix(16).lowercased() + unreported.append(PendingCall(id: id, name: name, arguments: arguments, continuation: continuation)) + scheduleFlush() + } + } + + /// Report calls in one event, after a moment for any parallel calls to arrive. + private func scheduleFlush() { + if flushScheduled { return } + flushScheduled = true + Task { [weak self] in + try? await Task.sleep(nanoseconds: LanguageModelEngine.toolBatchDelayNs) + self?.flush() + } + } + + private func flush() { + flushScheduled = false + if closed || unreported.isEmpty { return } + let calls = unreported + unreported.removeAll() + for call in calls { awaiting[call.id] = call } + send(["kind": "toolCalls", + "calls": calls.map { ["id": $0.id, "name": $0.name, "arguments": $0.arguments] }]) + } + + // MARK: - Tool routing + + private enum Selection { + case tools([ToolSpec]) + case failed([String: Any]) + } + + /// All tools when their definitions fit their share of the context window; + /// otherwise the few the model picks for this request, plus recently used ones. + private func selectTools(model: SystemLanguageModel, specs: [ToolSpec], history: [[String: Any]], + prompt: String) async -> Selection { + let budget = Int(Double(model.contextSize) * LanguageModelEngine.toolBudgetFraction) + let cost = await toolTokens(model, buildTools(specs, compact: false)) + if cost <= budget { return .tools(specs) } + + let names = specs.map { $0.name } + let catalog = specs.map { "- \($0.name): \(SchemaBuilder.shorten($0.description, sentences: 1, limit: 100))" } + .joined(separator: "\n") + let instructions = "You pick the tools a voice assistant needs to handle the user's latest request. " + + "Choose at most \(LanguageModelEngine.maxRoutedTools) tools from this list that the assistant should be able to use, " + + "most important first. Choose none for small talk or questions it can answer from general knowledge.\n\n" + catalog + var query = prompt + if let previous = lastPromptText(history) { + query = "Previous request: \(SchemaBuilder.shorten(previous, sentences: 3, limit: 300))\n\nLatest request: \(prompt)" + } + do { + let schema = try GenerationSchema(root: DynamicGenerationSchema(name: "ToolSelection", properties: [ + DynamicGenerationSchema.Property( + name: "tools", description: "Names of the tools needed, most important first.", + schema: DynamicGenerationSchema(arrayOf: DynamicGenerationSchema(type: String.self, guides: [.anyOf(names)]), + minimumElements: 0, + maximumElements: LanguageModelEngine.maxRoutedTools)), + ]), dependencies: []) + let session = LanguageModelSession(model: model, instructions: instructions) + let response = try await session.respond(to: query, schema: schema, + options: GenerationOptions(sampling: .greedy, maximumResponseTokens: 100)) + var chosen = Set(try response.content.value([String].self, forProperty: "tools")) + let recent = recentToolNames(history).prefix(LanguageModelEngine.keptRecentTools) + chosen.formUnion(recent) + let selected = specs.filter { chosen.contains($0.name) } + send(["kind": "log", "message": "routed \(specs.count) tools (\(cost) tokens) to: " + + (selected.isEmpty ? "none" : selected.map { $0.name }.joined(separator: ", "))]) + return .tools(selected) + } catch { + if let generationError = error as? LanguageModelSession.GenerationError { + switch generationError { + case .rateLimited, .concurrentRequests, .assetsUnavailable, .guardrailViolation, .refusal, + .unsupportedLanguageOrLocale: + // The real request would fail the same way. + return .failed(describe(error)) + default: + break + } + } + send(["kind": "log", "message": "tool routing failed (\(error.localizedDescription)); offering tools in order"]) + return .tools(specs) + } + } + + private func toolTokens(_ model: SystemLanguageModel, _ tools: [BuiltTool]) async -> Int { + let definitions = tools.map { + Transcript.ToolDefinition(name: $0.name, description: $0.description, parameters: $0.schema) + } + let instructions = Transcript.Entry.instructions(Transcript.Instructions(segments: [], toolDefinitions: definitions)) + let schemaCharacters = tools.reduce(0) { total, tool in total + tool.schema.debugDescription.count } + return await tokenCount(model, [instructions], extraCharacters: schemaCharacters + 150 * tools.count) + } + + private func lastPromptText(_ history: [[String: Any]]) -> String? { + for item in history.reversed() where item["type"] as? String == "prompt" { + if let text = item["text"] as? String, !text.isEmpty { return text } + } + return nil + } + + /// Tool names from the newest tool calls back, without repeats. + private func recentToolNames(_ history: [[String: Any]]) -> [String] { + var names: [String] = [] + for item in history.reversed() where item["type"] as? String == "toolCalls" { + for call in (item["calls"] as? [[String: Any]]) ?? [] { + if let name = call["name"] as? String, !names.contains(name) { names.append(name) } + } + } + return names + } + + // MARK: - Context fitting + + private struct BuiltTool { + let name: String + let description: String + let schema: GenerationSchema + } + + private struct Fitted { + let tools: [BuiltTool] + let entries: [Transcript.Entry] + } + + /// Instructions + tool definitions + history + prompt must leave the reply + /// budget free. In order, until it fits: shorten tool descriptions, drop the + /// oldest exchanges, then drop the last-registered tools. + private func fit(model: SystemLanguageModel, system: String, tools specs: [ToolSpec], + history: [[String: Any]], prompt: String, maxTokens: Int) async -> Fitted { + let contextSize = model.contextSize + let reserve = min(maxTokens, contextSize / 3) + LanguageModelEngine.contextMargin + var tools = buildTools(specs, compact: false) + var past = transcriptEntries(history) + let promptEntry = Transcript.Entry.prompt(Transcript.Prompt(segments: [.text(Transcript.TextSegment(content: prompt))])) + + func entries() -> [Transcript.Entry] { + let definitions = tools.map { + Transcript.ToolDefinition(name: $0.name, description: $0.description, parameters: $0.schema) + } + let instructions = Transcript.Instructions(segments: [.text(Transcript.TextSegment(content: system))], + toolDefinitions: definitions) + return [.instructions(instructions)] + past + } + func overBudget() async -> Bool { + // The tokenizer can't see tool schemas' size from a ToolDefinition; the fallback estimate adds them. + let schemaCharacters = tools.reduce(0) { total, tool in total + tool.schema.debugDescription.count } + let used = await tokenCount(model, entries() + [promptEntry], extraCharacters: schemaCharacters) + return used + reserve > contextSize + } + + if !tools.isEmpty, await overBudget() { + tools = buildTools(specs, compact: true) + send(["kind": "log", "message": "shortened tool descriptions to fit the context window"]) + } + var droppedEntries = 0 + while !past.isEmpty, await overBudget() { + // Drop the oldest exchange: through to the next user prompt. + past.removeFirst() + droppedEntries += 1 + while let first = past.first, !isPrompt(first) { + past.removeFirst() + droppedEntries += 1 + } + } + if droppedEntries > 0 { + send(["kind": "log", "message": "dropped \(droppedEntries) history entries to fit the context window"]) + } + var droppedTools: [String] = [] + while !tools.isEmpty, await overBudget() { + droppedTools.append(tools.removeLast().name) + } + if !droppedTools.isEmpty { + send(["kind": "log", "message": "dropped tools to fit the context window: \(droppedTools.joined(separator: ", "))"]) + } + return Fitted(tools: tools, entries: entries()) + } + + private func tokenCount(_ model: SystemLanguageModel, _ entries: [Transcript.Entry], extraCharacters: Int) async -> Int { + if #available(iOS 26.4, macOS 26.4, *) { + if let count = try? await model.tokenCount(for: entries) { return count } + } + // Before iOS 26.4 there's no tokenizer API: estimate conservatively. + var characters = extraCharacters + for entry in entries { characters += estimateCharacters(entry) + 16 } + return characters / 3 + } + + private func estimateCharacters(_ entry: Transcript.Entry) -> Int { + func segments(_ list: [Transcript.Segment]) -> Int { + list.reduce(0) { total, segment in + switch segment { + case .text(let text): return total + text.content.count + case .structure(let structure): return total + structure.content.jsonString.count + @unknown default: return total + } + } + } + switch entry { + case .instructions(let instructions): + var total = segments(instructions.segments) + for definition in instructions.toolDefinitions { + total += definition.name.count + definition.description.count + } + return total + case .prompt(let prompt): return segments(prompt.segments) + case .response(let response): return segments(response.segments) + case .toolCalls(let calls): return calls.reduce(0) { $0 + $1.toolName.count + $1.arguments.jsonString.count } + case .toolOutput(let output): return segments(output.segments) + @unknown default: return 0 + } + } + + private func isPrompt(_ entry: Transcript.Entry) -> Bool { + if case .prompt = entry { return true } + return false + } + + // MARK: - Request conversion + + private func transcriptEntries(_ history: [[String: Any]]) -> [Transcript.Entry] { + var entries: [Transcript.Entry] = [] + for item in history { + let text = (item["text"] as? String) ?? "" + switch item["type"] as? String { + case "prompt": + entries.append(.prompt(Transcript.Prompt(segments: [.text(Transcript.TextSegment(content: text))]))) + case "response": + entries.append(.response(Transcript.Response(assetIDs: [], segments: [.text(Transcript.TextSegment(content: text))]))) + case "toolCalls": + let calls: [Transcript.ToolCall] = ((item["calls"] as? [[String: Any]]) ?? []).compactMap { call in + guard let id = call["id"] as? String, let name = call["name"] as? String else { return nil } + let arguments = (try? GeneratedContent(json: (call["arguments"] as? String) ?? "{}")) + ?? GeneratedContent(properties: [:]) + return Transcript.ToolCall(id: id, toolName: name, arguments: arguments) + } + if !calls.isEmpty { entries.append(.toolCalls(Transcript.ToolCalls(calls))) } + case "toolOutput": + guard let id = item["id"] as? String else { continue } + entries.append(.toolOutput(Transcript.ToolOutput( + id: id, toolName: (item["name"] as? String) ?? "tool", + segments: [.text(Transcript.TextSegment(content: text))]))) + default: + continue + } + } + return entries + } + + private func buildTools(_ specs: [ToolSpec], compact: Bool) -> [BuiltTool] { + specs.map { spec in + var builder = SchemaBuilder(compact: compact) + let schema: GenerationSchema + do { + schema = try GenerationSchema(root: builder.object(spec.parameters, name: "\(spec.name)_arguments"), + dependencies: []) + } catch { + send(["kind": "log", "message": "tool \(spec.name): unusable parameter schema (\(error)); offering it without parameters"]) + schema = (try? GenerationSchema(root: DynamicGenerationSchema(name: "\(spec.name)_arguments", properties: []), + dependencies: [])) + ?? GenerationSchema(type: GeneratedContent.self, properties: []) + } + let description = compact ? SchemaBuilder.shorten(spec.description, sentences: 1, limit: 160) : spec.description + return BuiltTool(name: spec.name, description: description, schema: schema) + } + } + + // MARK: - Errors + + private func describe(_ error: Error) -> [String: Any] { + if let error = error as? LanguageModelSession.GenerationError { + switch error { + case .exceededContextWindowSize: + return failure("context", "That conversation is too long for the on-device model. Start a new conversation and try again.") + case .assetsUnavailable: + return failure("unavailable", "The Apple Intelligence model isn't available right now. Check that Apple Intelligence is on and finished downloading.") + case .guardrailViolation, .refusal: + return failure("refusal", "The on-device model declined this request.") + case .unsupportedLanguageOrLocale: + return failure("language", "The on-device model doesn't support this language.") + case .rateLimited: + return failure("rateLimited", "iOS is limiting the on-device model while Faceclaw is in the background. Try again in a moment, or with the phone unlocked.") + case .concurrentRequests: + return failure("busy", "The on-device model is busy with another request. Try again in a moment.") + case .decodingFailure, .unsupportedGuide: + return failure("other", "The on-device model produced an unreadable reply: \(error.localizedDescription)") + @unknown default: + return failure("other", "On-device model failed: \(error.localizedDescription)") + } + } + if let error = error as? LanguageModelSession.ToolCallError { + return failure("other", "On-device model tool call failed: \(error.underlyingError.localizedDescription)") + } + return failure("other", "On-device model failed: \(error.localizedDescription)") + } + + private func failure(_ code: String, _ message: String) -> [String: Any] { + ["kind": "error", "code": code, "message": message] + } +} + +/// JSON Schema (the subset our tool definitions use: objects of string, number, +/// integer, boolean, enum and array properties) to a DynamicGenerationSchema, so +/// the framework constrains tool arguments to valid values while decoding. +/// Anything it doesn't understand becomes a string rather than failing. +@available(iOS 26.0, *) +private struct SchemaBuilder { + let compact: Bool + private var names = Set() + + init(compact: Bool) { self.compact = compact } + + mutating func object(_ json: [String: Any], name: String) -> DynamicGenerationSchema { + let properties = (json["properties"] as? [String: Any]) ?? [:] + let required = Set((json["required"] as? [String]) ?? []) + // JSON objects lose declaration order; keep required properties first, then by name. + let keys = properties.keys.sorted { a, b in + let ra = required.contains(a), rb = required.contains(b) + return ra != rb ? ra : a < b + } + let members: [DynamicGenerationSchema.Property] = keys.compactMap { key in + guard let property = properties[key] as? [String: Any] else { return nil } + return DynamicGenerationSchema.Property( + name: key, + description: describe(property), + schema: value(property, name: "\(name)_\(key)"), + isOptional: !required.contains(key)) + } + return DynamicGenerationSchema(name: unique(name), description: nil, properties: members) + } + + private mutating func value(_ json: [String: Any], name: String) -> DynamicGenerationSchema { + if let choices = json["enum"] as? [Any], !choices.isEmpty { + let strings = choices.compactMap { $0 as? String } + if strings.count == choices.count { + // A guide renders as one compact JSON Schema enum; an anyOf schema lists + // every choice as its own subschema, at over twice the tokens. + return DynamicGenerationSchema(type: String.self, guides: [.anyOf(strings)]) + } + } + switch schemaType(json) { + case "integer": + var guides: [GenerationGuide] = [] + if let minimum = (json["minimum"] as? NSNumber)?.intValue { guides.append(.minimum(minimum)) } + if let maximum = (json["maximum"] as? NSNumber)?.intValue { guides.append(.maximum(maximum)) } + return DynamicGenerationSchema(type: Int.self, guides: guides) + case "number": + var guides: [GenerationGuide] = [] + if let minimum = (json["minimum"] as? NSNumber)?.doubleValue { guides.append(.minimum(minimum)) } + if let maximum = (json["maximum"] as? NSNumber)?.doubleValue { guides.append(.maximum(maximum)) } + return DynamicGenerationSchema(type: Double.self, guides: guides) + case "boolean": + return DynamicGenerationSchema(type: Bool.self) + case "array": + let items = (json["items"] as? [String: Any]) ?? ["type": "string"] + return DynamicGenerationSchema(arrayOf: value(items, name: "\(name)_item"), + minimumElements: (json["minItems"] as? NSNumber)?.intValue, + maximumElements: (json["maxItems"] as? NSNumber)?.intValue) + case "object": + return object(json, name: name) + default: + return DynamicGenerationSchema(type: String.self) + } + } + + private func schemaType(_ json: [String: Any]) -> String { + if let type = json["type"] as? String { return type } + if let types = json["type"] as? [String], let type = types.first(where: { $0 != "null" }) { return type } + return json["properties"] != nil ? "object" : "string" + } + + private func describe(_ json: [String: Any]) -> String? { + guard let text = json["description"] as? String, !text.isEmpty else { return nil } + return compact ? SchemaBuilder.shorten(text, sentences: 1, limit: 80) : text + } + + /// Schema names must be unique within one GenerationSchema. + private mutating func unique(_ base: String) -> String { + var name = base + var suffix = 2 + while names.contains(name) { + name = "\(base)_\(suffix)" + suffix += 1 + } + names.insert(name) + return name + } + + /// The first `sentences` sentences, cut to `limit` characters. + static func shorten(_ text: String, sentences: Int, limit: Int) -> String { + var result = "" + var count = 0 + var remainder = Substring(text) + while count < sentences, !remainder.isEmpty { + if let end = remainder.range(of: ". ") { + result += remainder[.. limit { result = String(result.prefix(limit - 1)) + "…" } + return result + } +} + +#endif diff --git a/App_Resources/iOS/src/FaceclawWebSignIn.h b/App_Resources/iOS/src/FaceclawWebSignIn.h new file mode 100644 index 00000000..fd0274a4 --- /dev/null +++ b/App_Resources/iOS/src/FaceclawWebSignIn.h @@ -0,0 +1,21 @@ +#import + +/** + * OAuth sign-in in the system browser sheet (ASWebAuthenticationSession, which shares + * Safari's cookies, so a provider the user is already signed in to needs only a consent + * tap) for providers that redirect to a loopback address: a FaceclawLoopbackRedirect + * catches the redirect, then the sheet is closed. Presenting needs Faceclaw in the + * foreground, so a sign-in started from the glasses waits until the user opens the app. + * One sign-in at a time; starting another cancels the first. Call from the main thread. + */ +@interface FaceclawWebSignIn : NSObject ++ (instancetype)shared; +/** + * completion(redirectUrl, nil) once the provider redirects to http://127.0.0.1:; + * (nil, "cancelled") when the user closes the sheet or cancel is called; (nil, message) + * when the sheet or the receiver cannot start. Called once, on the main queue. + */ +- (void)signIn:(NSString *)authorizeUrl port:(NSInteger)port path:(NSString *)path + completion:(void (^)(NSString *redirectUrl, NSString *error))completion; +- (void)cancel; +@end diff --git a/App_Resources/iOS/src/FaceclawWebSignIn.m b/App_Resources/iOS/src/FaceclawWebSignIn.m new file mode 100644 index 00000000..3c1d76e2 --- /dev/null +++ b/App_Resources/iOS/src/FaceclawWebSignIn.m @@ -0,0 +1,110 @@ +#import "FaceclawWebSignIn.h" +#import "FaceclawLoopbackRedirect.h" +#import +#import + +/** Never reached: the loopback receiver ends the session before any custom-scheme redirect. */ +static NSString *const kUnusedCallbackScheme = @"faceclaw-signin"; + +@interface FaceclawWebSignIn () +@property(nonatomic, strong) FaceclawLoopbackRedirect *receiver; +@property(nonatomic, strong) ASWebAuthenticationSession *session; +@property(nonatomic, copy) void (^completion)(NSString *redirectUrl, NSString *error); +/** The sign-in page waiting for Faceclaw to come to the foreground. */ +@property(nonatomic, copy) NSURL *pendingUrl; +@property(nonatomic, strong) id activeObserver; +@end + +@implementation FaceclawWebSignIn ++ (instancetype)shared { + static FaceclawWebSignIn *instance; + static dispatch_once_t once; + dispatch_once(&once, ^{ instance = [FaceclawWebSignIn new]; }); + return instance; +} + +- (void)signIn:(NSString *)authorizeUrl port:(NSInteger)port path:(NSString *)path + completion:(void (^)(NSString *, NSString *))completion { + [self finishWithUrl:nil error:@"cancelled"]; + NSURL *url = [NSURL URLWithString:authorizeUrl]; + if (!url || ![url.scheme isEqualToString:@"https"]) { + if (completion) completion(nil, @"Invalid sign-in address"); + return; + } + FaceclawLoopbackRedirect *receiver = [FaceclawLoopbackRedirect new]; + NSString *error = [receiver startOnPort:port path:path]; + if (error) { + if (completion) completion(nil, error); + return; + } + __weak typeof(self) weakSelf = self; + receiver.redirectHandler = ^(NSString *redirectUrl) { + [weakSelf finishWithUrl:redirectUrl error:nil]; + }; + self.receiver = receiver; + self.completion = completion; + if (UIApplication.sharedApplication.applicationState == UIApplicationStateActive) { + [self present:url]; + return; + } + self.pendingUrl = url; + self.activeObserver = [NSNotificationCenter.defaultCenter addObserverForName:UIApplicationDidBecomeActiveNotification + object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *note) { + FaceclawWebSignIn *strongSelf = weakSelf; + NSURL *pending = strongSelf.pendingUrl; + if (!pending) return; + [strongSelf removeActiveObserver]; + [strongSelf present:pending]; + }]; +} + +- (void)cancel { + [self finishWithUrl:nil error:@"cancelled"]; +} + +- (void)present:(NSURL *)url { + __weak typeof(self) weakSelf = self; + ASWebAuthenticationSession *session = [[ASWebAuthenticationSession alloc] initWithURL:url + callbackURLScheme:kUnusedCallbackScheme completionHandler:^(NSURL *callbackURL, NSError *error) { + // The sheet closed: the user dismissed it, or finishing already cancelled it. + BOOL dismissed = !error || ([error.domain isEqualToString:ASWebAuthenticationSessionErrorDomain] + && error.code == ASWebAuthenticationSessionErrorCodeCanceledLogin); + [weakSelf finishWithUrl:callbackURL.absoluteString + error:callbackURL ? nil : dismissed ? @"cancelled" : error.localizedDescription]; + }]; + session.presentationContextProvider = self; + session.prefersEphemeralWebBrowserSession = NO; + self.session = session; + if (![session start]) [self finishWithUrl:nil error:@"Could not open the sign-in page"]; +} + +/** Report the outcome once; tear down the receiver and close the sheet. */ +- (void)finishWithUrl:(NSString *)url error:(NSString *)error { + void (^completion)(NSString *, NSString *) = self.completion; + ASWebAuthenticationSession *session = self.session; + self.completion = nil; + self.session = nil; + self.pendingUrl = nil; + [self removeActiveObserver]; + [self.receiver stop]; + self.receiver = nil; + // Re-enters through the session's completion handler, which then finds nothing to report. + [session cancel]; + if (completion) completion(url, url ? nil : error); +} + +- (void)removeActiveObserver { + if (self.activeObserver) [NSNotificationCenter.defaultCenter removeObserver:self.activeObserver]; + self.activeObserver = nil; +} + +- (ASPresentationAnchor)presentationAnchorForWebAuthenticationSession:(ASWebAuthenticationSession *)session { + for (UIScene *scene in UIApplication.sharedApplication.connectedScenes) { + if (![scene isKindOfClass:UIWindowScene.class]) continue; + NSArray *windows = ((UIWindowScene *)scene).windows; + for (UIWindow *window in windows) if (window.isKeyWindow) return window; + if (windows.firstObject) return windows.firstObject; + } + return [UIWindow new]; +} +@end diff --git a/App_Resources/iOS/src/module.modulemap b/App_Resources/iOS/src/module.modulemap index 02935284..2ef469f1 100644 --- a/App_Resources/iOS/src/module.modulemap +++ b/App_Resources/iOS/src/module.modulemap @@ -11,5 +11,8 @@ module FaceclawGraphics { header "FaceclawEvenHubWebView.h" header "FaceclawCrypto.h" header "FaceclawQrScanner.h" + header "FaceclawLoopbackRedirect.h" + header "FaceclawWebSignIn.h" + header "FaceclawResourceUsage.h" export * } diff --git a/CHANGELOG b/CHANGELOG index 8bbbd05c..15db3649 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,17 +1,36 @@ # Changelog -## 0.8.5 - Future +## 0.8.6 - Future + +* Add a distance unit option +* Make BLE benchmark work on iOS +* Ensure connection is re-set to 2M on reconnect +* Add support for embedded icons and custom layouts in Android notifications +* Port the Developer app's resource-usage monitor and various test pages to iOS +* iOS: Support Apple Intelligence as an on-device model for voice assistant/etc +* iOS: Notifications are selectable via the task switcher +* Android: Optionally sign in to Spotify's Web API for library browsing and other features +* Mark stock firmware 2.4.0 as validated for installing custom firmware over + +## 0.8.5 - 2026-10-25 ### Features * Use Open-Meteo for weather in regions that the US National Weather Service doesn't cover * Android: Show pictures attached to notifications (such as Dexcom's glucose graph) in the notification view * Add an Apple Music integration on iOS +* Add a Spotify integration on iOS by voice (needs your own Spotify developer client ID and Spotify Premium) +* Add a Translate app ### Bug fixes * Inverting Android notification-icons to indicate selectionis now gamma-correct * Android notification icons that are full-color pictures rather than shapes no longer show as blank blocks +* Fix missing R1 ring battery indicator on iOS +* Fix a bug on iOS that would cause corrupted installs of EvenHub apps +* EvenHub apps can use the glasses microphone on iOS (such as Chess's voice moves, which said "Mic unavailable") +* EvenHub apps on iOS should now be able to use the mic +* Fix a bug that caused fade-in on wake to be shown at the wrong depth on iOS ## 0.8.4 - 2026-10-17 diff --git a/PRIVACY b/PRIVACY index fd667185..f906afdf 100644 --- a/PRIVACY +++ b/PRIVACY @@ -116,12 +116,30 @@ provider; Faceclaw does not manage accounts or process billing information. ## AI Assistant Transcripts -Faceclaw has a builtin AI voice assistant. Using the voice assistant requires -providing an API key for a model provider such as Anthropic or OpenAI. Prompts -and responses are subject to that model provider's privacy policy: +Faceclaw has a builtin AI voice assistant. Using a cloud model requires +providing an API key for a model provider such as Anthropic, OpenAI, or Venice, +or configuring an OpenAI-compatible endpoint such as a private Open WebUI +server. Prompts and responses are subject to the selected provider or server +operator's privacy policy: OpenAI: https://openai.com/policies/row-privacy-policy/ Anthropic: https://www.anthropic.com/legal/privacy + Venice: https://venice.ai/privacy + +With an OpenAI-compatible provider, the configured server receives the +assistant system prompt, conversation history, available tool definitions, and +tool results needed to answer. Its URL, model ID, and optional API key are +stored on the phone. Faceclaw does not operate that server and cannot make +representations about its logging or retention; for a private Open WebUI +server, the server's operator controls those policies. If you choose Discover +models, Faceclaw also requests that server's model catalog using the same +configured URL and optional API key. + +If you enable **Venice web search** for the official Venice API URL, supported +models may generate web-search queries from your assistant conversation. Those +queries and their results are processed by Venice's search service and are +subject to Venice's privacy policy and any applicable charges. This setting is +off by default and is never sent to Open WebUI or other compatible providers. AI conversation histories and memory files may be stored on your phone. Faceclaw does not transmit voice-assistant prompts or responses to any party @@ -153,6 +171,20 @@ Apple's on iOS) for the name of the place. Open-Meteo: https://open-meteo.com/en/terms +## Spotify + +On iOS, the Music app, Glanceboard and the voice assistant can show and +control Spotify through Spotify's Web API, once the user has created their own +Spotify developer app and signed in. Signing in happens on Spotify's website in +the system's sign-in sheet; Faceclaw never sees the password, and stores the +resulting sign-in tokens on the phone. While Spotify is shown or used, +Faceclaw requests the user's playback state, queue, library and search results +from Spotify and sends it playback commands, directly from the phone. This is +subject to Spotify's privacy policy. + + Spotify: https://www.spotify.com/legal/privacy-policy/ + + ## EvenHub The EvenHub app store is subject to Even Realities' privacy policy: diff --git a/README.md b/README.md index 355a206e..39655e62 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ walk you through pairing with the glasses and installing custom firmware. For the NativeScript iOS port, see [iOS development](notes/ios-development.md). Use `scripts/pull_config_ios.sh` and `scripts/push_config_ios.sh` to transfer iPhone -settings; see [iOS config transfer](scripts/ios-config.md) for options and Android XML support. +settings. Android and iOS share one JSON config format, so a config pulled from either +platform can be pushed to the other; see [config transfer](scripts/config-transfer.md). The instructions below build the Android app. If you want to customize faceclaw, the best way to do it is to download the @@ -54,7 +55,7 @@ port into your computer, authorize access on the phone, and run Note that if you have installed a signed release build, you will have to uninstall it before installing a customized version. Use scripts/pull_config.sh to export a copy of your configuration first, and scripts/push_config.sh to -import it into the new version. +import it into the new version (see [config transfer](scripts/config-transfer.md)). ## Features @@ -64,8 +65,10 @@ import it into the new version. * **A voice assistant** that wakes up when you say "Hey Even", transcribes text with an on-device model, OpenAI Whisper, ElevenLabs, or Soniox API, and responds to queries and commands using an onboard model (Qwen3 4B, - slow) or with an Anthropic or OpenAI model (requires an API key), or using - your own long-running OpenClaw agent. + slow) or with an Anthropic, OpenAI, or OpenAI-compatible Chat Completions + model (including Venice and private Open WebUI servers; model ID and + usually an API key required), with optional Venice web search for supported + models, or using your own long-running OpenClaw agent. * **Multitasking**, with an app-switcher sidebar and app launcher. * **Glanceboard**, a dashboard with widgets that you can quickly view with a * **Mostly-compatible with EvenHub.** Install and runapps from the Even app @@ -95,6 +98,51 @@ import it into the new version. the glasses, and you can use the phone touchscreen as an input device.. +## OpenAI-compatible assistant providers (Venice / Open WebUI) + +The assistant can call an OpenAI-compatible **Chat Completions** endpoint directly +from the phone. This uses the same conversation history and glasses tool loop as +the built-in cloud providers; it does not require different glasses firmware. + +In **Settings > Assistant**: + +1. **Assistant model** — choose **OpenAI-compatible**. Auto never selects it. + The settings in steps 2–4 appear only while it is selected. +2. **Compatible API URL** — the explicit API root. +3. **Compatible API key** — optional; when set, it is sent only to the configured + compatible endpoint as a Bearer token, not to OpenAI's Whisper service. +4. **Compatible model ID** — the exact model identifier accepted by the server. + Or choose **Discover models** and pick one from the server catalog. The + picker shows tool capability when advertised and hides offline models by + default. Refresh never changes the saved model by itself. + +Provider examples: + +| Provider | Compatible API URL | Notes | +| --- | --- | --- | +| Venice | `https://api.venice.ai/api/v1` | Use a current Venice model ID. Choose one with function-calling support if you want glasses tools. | +| Open WebUI | `https://your-openwebui-host/api` | This produces `/api/chat/completions`. Use the model ID exposed by your server and an Open WebUI API key if required. | + +You may paste the full `/chat/completions` endpoint instead; Faceclaw removes +that suffix. It otherwise preserves the path you enter and does not guess `/v1` +or `/api`. Discovery requests `{API root}/models` only when you choose it; there +is no background discovery or automatic model selection. Manual model entry +remains available for servers without a compatible model-list endpoint. + +When **OpenAI-compatible** is the assistant model and its URL is the official +Venice URL, **Settings > Assistant** also shows **Venice web search**. It is off +by default and hidden otherwise. When enabled, supported Venice models may +search the web for current information; the search model must support the +feature. Open WebUI and other compatible servers never receive Venice-specific +parameters, including after an endpoint switch. + +The same provider can supply Calculator's rewrite fallback and Translate. +Actual tool calling depends on the selected model and server. Use HTTPS where +possible; mobile cleartext policies may block plain HTTP. For a private server, +make it reachable from the phone (for example through your tailnet) without +exposing it publicly. Exported settings contain API keys and must be treated as +secrets. + ## Watch remote (Wear OS) The `wear/` directory holds a companion app for Wear OS 3+ watches that turns diff --git a/app/app.css b/app/app.css index 007ace07..b59200cd 100644 --- a/app/app.css +++ b/app/app.css @@ -154,6 +154,60 @@ Button.-primary { color: #222222; } +/* Keyboard-input panel: tighter than the setting editor, with the text + * box's edges in line with the title and the one-strip buttons (the theme's + * 16dp TextView side margins doubled the inset). */ +.system-name-modal.keyboard-input-panel { + margin: 8; + padding: 8 16 12 16; +} + +.keyboard-input-panel TextView { + margin: 4 0 0 0; + padding: 6; +} + +/* Glasses-only: the field stays focused for the IME but is an invisible + * sliver; the hint line takes its place. */ +.keyboard-input-panel TextView.keyboard-input-field-hidden { + opacity: 0; + height: 1; + min-height: 0; + margin: 0; + padding: 0; +} + +.system-name-modal Label.keyboard-input-hidden-hint, +.ns-dark .system-name-modal Label.keyboard-input-hidden-hint { + color: #666666; + padding: 8 0; +} + +.keyboard-input-buttons { + margin-top: 8; +} + +.keyboard-input-panel Button, +.keyboard-input-panel Button.-primary { + margin: 0; + font-size: 16; +} + +.keyboard-input-panel Button.keyboard-input-gap { + margin-left: 8; +} + +/* Flat icon buttons in the panel's title row (the modal stays light in dark + * mode, so one tint). */ +.panel-icon-button { + padding: 6 8; +} + +.panel-icon { + height: 20; + tint-color: #333333; +} + /* Modal behind the action bar's warning triangle: the problem-status warnings * that used to sit inline on the main page, each with its fix-it button. * The width is set from the view model (near-full-width on phones, capped on diff --git a/app/app.ios.css b/app/app.ios.css index fbed4e8e..4245407f 100644 --- a/app/app.ios.css +++ b/app/app.ios.css @@ -56,6 +56,9 @@ Page.main-page { color: #222222; padding: 16; } +/* The modal stays light in dark mode; outgun the theme's `.ns-dark .h2` + * (white) so the title doesn't go white-on-light-gray. */ +.main-page .system-name-modal .h2 { color: #222222; } .main-page .system-name-modal TextView { margin: 0; padding: 4; @@ -67,3 +70,15 @@ Page.main-page { .main-landscape .system-name-modal { padding: 6 12; } .main-landscape .system-name-modal .h2 { visibility: collapse; } .main-landscape .system-name-modal Button { padding: 6 8; margin-top: 0; margin-bottom: 0; } + +/* Keyboard-input panel: the one-strip buttons and title-row icons (see app.css). */ +.main-page .system-name-modal.keyboard-input-panel { padding: 8 16 12 16; } +.main-landscape .system-name-modal.keyboard-input-panel { padding: 6 12; } +.main-page .keyboard-input-panel TextView { margin: 4 0 0 0; padding: 6; } +.main-page .keyboard-input-panel TextView.keyboard-input-field-hidden { opacity: 0; height: 1; min-height: 0; margin: 0; padding: 0; } +.main-page .keyboard-input-hidden-hint { color: #666666; padding: 8 0; } +.main-page .keyboard-input-buttons { margin-top: 8; } +.main-page .keyboard-input-panel Button { margin: 0; } +.main-page .keyboard-input-panel Button.keyboard-input-gap { margin-left: 8; } +.main-page .panel-icon-button { padding: 6 8; } +.main-page .panel-icon { height: 20; tint-color: #333333; } diff --git a/app/apps/ai-chat/ai-chat-app.ts b/app/apps/ai-chat/ai-chat-app.ts index 83b176e4..2c897fd6 100644 --- a/app/apps/ai-chat/ai-chat-app.ts +++ b/app/apps/ai-chat/ai-chat-app.ts @@ -4,7 +4,7 @@ import { truncateText, wrapText } from "../../graphics/textwrap"; import { ASSISTANT_MODEL_CHOICES, assistantModelLabel, resolveAssistantModel } from "../../assistant/models"; import type { AssistantTranscriptEntry } from "../../assistant/session"; import type { AssistantConversations, ReasoningLevel } from "../../assistant/conversations"; -import { anthropicApiKeySetting, assistantBackendSetting, openAiApiKeySetting } from "../../ui/dashboard-settings"; +import { anthropicApiKeySetting, assistantBackendSetting, assistantOpenAiCompatibleKeySetting, assistantOpenAiCompatibleModelSetting, assistantOpenAiCompatibleUrlSetting, openAiApiKeySetting } from "../../ui/dashboard-settings"; import { GESTURE_CLICK, GESTURE_DOUBLE_CLICK, GESTURE_LONG_PRESS, gestureHints, type InputEvent } from "../../ui/gestures"; import type { Layer, LayerContext } from "../../ui/layers"; import type { MenuItem } from "../../ui/menu"; @@ -102,7 +102,7 @@ class AiChatLayer implements Layer { } case "long-press": if (!this.conversations.current().session?.isTurnActive()) { - if (!shell.isAssistantAvailable()) { shell.showAlert(global.isIOS ? "Set an OpenAI or Anthropic API key in Settings." : "Set an API key or download the on-phone model in Settings."); return; } + if (!shell.isAssistantAvailable()) { shell.showAlert(shell.assistantSetupHint()); return; } void this.draft.start(); } return; @@ -133,7 +133,12 @@ class AiChatLayer implements Layer { onSelect: (pickCtx) => { if (this.conversations.configure(model, record.reasoning)) pickCtx.stack.clearToBase(); }, }))) }, { label: `Reasoning: ${record.reasoning}`, disabled: () => { - const llm = resolveAssistantModel(record.model, { anthropic: anthropicApiKeySetting.get(), openai: openAiApiKeySetting.get() }); + const llm = resolveAssistantModel(record.model, { + anthropic: anthropicApiKeySetting.get(), openai: openAiApiKeySetting.get(), + openAiCompatibleUrl: assistantOpenAiCompatibleUrlSetting.get(), + openAiCompatibleKey: assistantOpenAiCompatibleKeySetting.get(), + openAiCompatibleModel: assistantOpenAiCompatibleModelSetting.get(), + }); return external || busy() || !llm?.effort; }, onSelect: (ctx) => submenu(ctx, "Reasoning", (["default", "low", "medium", "high"] as ReasoningLevel[]).map((reasoning) => ({ label: `${reasoning === record.reasoning ? "✓ " : ""}${reasoning === "default" ? "Model default" : reasoning}`, diff --git a/app/apps/calculator/calculator-llm.ts b/app/apps/calculator/calculator-llm.ts index 2254c5cc..7669a641 100644 --- a/app/apps/calculator/calculator-llm.ts +++ b/app/apps/calculator/calculator-llm.ts @@ -7,13 +7,17 @@ * surfacing a transport error. */ import { streamAnthropicMessage } from "../../native/anthropic"; -import { streamLocalQwen } from "../../native/llama"; +import { streamLocalModel } from "../../native/local-llm"; import { streamOpenAiResponse } from "../../native/openai"; +import { streamOpenAiCompatibleChat } from "../../native/openai-chat"; import { resolveAssistantModel } from "../../assistant/models"; import { type LlmStreamOptions } from "../../assistant/llm-protocol"; import { anthropicApiKeySetting, assistantModelSetting, + assistantOpenAiCompatibleKeySetting, + assistantOpenAiCompatibleModelSetting, + assistantOpenAiCompatibleUrlSetting, openAiApiKeySetting, } from "../../ui/dashboard-settings"; import { CALCULATOR_REWRITE_SYSTEM_PROMPT, buildCalculatorRewriteUserMessage } from "../../prompts"; @@ -22,6 +26,9 @@ export function rewriteSpokenProblem(spoken: string): Promise { const resolved = resolveAssistantModel(assistantModelSetting.get(), { anthropic: anthropicApiKeySetting.get(), openai: openAiApiKeySetting.get(), + openAiCompatibleUrl: assistantOpenAiCompatibleUrlSetting.get(), + openAiCompatibleKey: assistantOpenAiCompatibleKeySetting.get(), + openAiCompatibleModel: assistantOpenAiCompatibleModelSetting.get(), }); if (!resolved) return Promise.resolve(null); @@ -40,8 +47,11 @@ export function rewriteSpokenProblem(spoken: string): Promise { case "openai": streamOpenAiResponse(options); break; + case "openai-compatible": + streamOpenAiCompatibleChat({ ...options, baseUrl: resolved.baseUrl ?? "" }); + break; case "local": - streamLocalQwen(options); + streamLocalModel(options); break; default: streamAnthropicMessage(options); diff --git a/app/apps/developer/bandwidth-benchmark.ts b/app/apps/developer/bandwidth-benchmark.ts index 192b967e..73310aa6 100644 --- a/app/apps/developer/bandwidth-benchmark.ts +++ b/app/apps/developer/bandwidth-benchmark.ts @@ -14,6 +14,9 @@ import { const MESSAGE_SIZES = [250, 500, 1000, 2000, 3800]; const WINDOW_SIZES = [1, 2, 3, 4, 6]; const LINK_MODES = ["Current", "Request HIGH", "Request 2M", "HIGH + 2M"]; +// CoreBluetooth has no connection-priority or PHY request API (iOS's +// prepareBenchmarkLink is a no-op), so iOS always runs on the current link. +const LINK_REQUESTS_SUPPORTED = !global.isIOS; const DURATION_MS = 15_000; // After painting the "running" screen, wait for that frame to reach the // glasses before the benchmark blocks normal image sends — otherwise the @@ -40,7 +43,7 @@ type ConfigRow = "size" | "window" | "link" | "start"; export class BandwidthBenchmarkLayer implements Layer { private phase: Phase = "config"; private readonly menu = new Menu({ - items: ["size", "window", "link", "start"], + items: LINK_REQUESTS_SUPPORTED ? ["size", "window", "link", "start"] : ["size", "window", "start"], wrap: false, rowGap: 1, highlight: { radius: 4 }, @@ -134,7 +137,8 @@ export class BandwidthBenchmarkLayer implements Layer { font, LIST_X, HEADER_HEIGHT + 30, - `${MESSAGE_SIZES[this.sizeIndex]} B, window ${WINDOW_SIZES[this.windowIndex]}, ${LINK_MODES[this.linkModeIndex]}`, + `${MESSAGE_SIZES[this.sizeIndex]} B, window ${WINDOW_SIZES[this.windowIndex]}` + + (LINK_REQUESTS_SUPPORTED ? `, ${LINK_MODES[this.linkModeIndex]}` : ""), 150, ); image.drawText(font, LIST_X, HEADER_HEIGHT + 52, "Display updates pause until the run finishes.", 110); @@ -161,8 +165,11 @@ export class BandwidthBenchmarkLayer implements Layer { `Throughput: ${(payloadRate / 1024).toFixed(2)} KB/s payload (${(wireRate / 1024).toFixed(2)} KB/s wire)`, `Messages: ${r.messagesAcked}/${r.messagesSent} acked, ${r.timeouts} timeouts`, `Elapsed: ${seconds.toFixed(1)} s` + (r.aborted ? " (aborted early)" : ""), - `Link request: ${LINK_MODES[r.linkMode] ?? "Current"}`, ]; + if (LINK_REQUESTS_SUPPORTED) { + const phy = r.leftPhy || r.rightPhy ? `; PHY L ${r.leftPhy ?? "?"}, R ${r.rightPhy ?? "?"}` : ""; + lines.push(`Link request: ${LINK_MODES[r.linkMode] ?? "Current"}${phy}`); + } for (const line of lines) { image.drawText(font, LIST_X, y, line, 190); y += 20; diff --git a/app/apps/developer/developer-app.ts b/app/apps/developer/developer-app.ts index 42c0ef4a..a7faf8cd 100644 --- a/app/apps/developer/developer-app.ts +++ b/app/apps/developer/developer-app.ts @@ -51,24 +51,18 @@ function debugTestsMenu(openInputEvents: OpenPage, openMicrophones: OpenPage): M }, { label: "Buzzer demo", - disabled: global.isIOS, - description: global.isIOS ? "Glasses sound playback is not available on iOS yet." : undefined, onSelect: (ctx) => { ctx.stack.push(new BuzzerDemoLayer()); }, }, { label: "Accelerometer demo", - disabled: global.isIOS, - description: global.isIOS ? "Not available on iOS yet." : undefined, onSelect: (ctx) => { ctx.stack.push(new AccelerometerDemoLayer(DEVELOPER_WINDOW_ID, ctx.actions.requestRender)); }, }, { label: "Light sensor", - disabled: global.isIOS, - description: global.isIOS ? "Not available on iOS yet." : undefined, onSelect: (ctx) => { ctx.stack.push(new LightSensorDemoLayer(DEVELOPER_WINDOW_ID, ctx.actions.requestRender)); }, @@ -83,8 +77,6 @@ function debugTestsMenu(openInputEvents: OpenPage, openMicrophones: OpenPage): M }, { label: "Microphones", - disabled: global.isIOS, - description: global.isIOS ? "Not available on iOS yet." : undefined, onSelect: openMicrophones, }, { @@ -131,8 +123,6 @@ export function createDeveloperAppWindow(appContext: AppContext, options: InProc }, { label: "Show resource usage", - disabled: global.isIOS, - description: global.isIOS ? "Not available on iOS yet." : undefined, onSelect: (ctx) => { ctx.stack.push(new ResourceUsageLayer(DEVELOPER_WINDOW_ID, ctx.actions.requestRender)); }, diff --git a/app/apps/developer/resource-usage.ts b/app/apps/developer/resource-usage.ts index 6bd6d6e8..70f0c8f8 100644 --- a/app/apps/developer/resource-usage.ts +++ b/app/apps/developer/resource-usage.ts @@ -4,25 +4,23 @@ import { clamp } from "../../util/numeric-util"; import { GESTURE_DOUBLE_CLICK, type InputEvent } from "../../ui/gestures"; import { Layer, type LayerContext } from "../../ui/layers"; import { shell } from "../../ui/shell/shell"; - -declare const com: any; +import { + MEMORY_SERIES, + formatMb, + sampleResourceUsage, + type ResourceSample, +} from "../../native/resource-usage"; const SAMPLE_INTERVAL_MS = 1_000; const HISTORY_MS = 60_000; const MAX_SAMPLES = Math.ceil(HISTORY_MS / SAMPLE_INTERVAL_MS) + 2; +/** Line brightness per memory series, headline first. */ +const MEMORY_SHADES = [240, 155, 80]; -type ResourceSample = { - atMs: number; - rssMb: number; - nativeMb: number; - javaMb: number; - javaCommittedMb: number; - cpuPercent: number; - threads: number; -}; +type ChartSample = ResourceSample & { cpuPercent: number }; type Series = { - value: (sample: ResourceSample) => number; + value: (sample: ChartSample) => number; shade: number; }; @@ -30,9 +28,10 @@ type Series = { * One-minute process monitor. Sampling deliberately continues while another * window is foreground so switching back reveals the resource cost of that * workload. Repaints remain visibility-gated to avoid creating hidden frames. + * Which memory figures are charted is up to the platform (MEMORY_SERIES). */ export class ResourceUsageLayer implements Layer { - private readonly samples: ResourceSample[] = []; + private readonly samples: ChartSample[] = []; private timer: ReturnType | null = null; private removed = false; private previousElapsedMs = 0; @@ -68,34 +67,34 @@ export class ResourceUsageLayer implements Layer { return image; } + const cpuText = `CPU ${formatPercent(latest.cpuPercent)} ${latest.threads} threads`; + image.drawText(font, width - 16 - font.measureText(cpuText), 5, cpuText, 200); + image.drawText(font, 16, 21, this.sampleError || latest.status, this.sampleError ? 170 : 140); + + const memorySeries = MEMORY_SERIES.map((label, index) => ({ + label, + shade: MEMORY_SHADES[index] ?? 80, + value: (sample: ChartSample) => sample.memoryMb[index] ?? 0, + })); + const memoryPeak = Math.max(...this.samples.flatMap((sample) => sample.memoryMb), 64); + const memoryScale = roundUp(memoryPeak * 1.08, 64); + const legendLeft = drawLegend( + image, + font, + width, + 48, + memorySeries.map((series) => [`${series.label} ${formatMb(series.value(latest))}`, series.shade] as const), + ); + const scaleLabel = `Memory 0–${formatMb(memoryScale)}`; + const shortScaleLabel = `0–${formatMb(memoryScale)}`; image.drawText( font, 16, - 21, - `RSS ${formatMb(latest.rssMb)} native ${formatMb(latest.nativeMb)} Java ${formatMb(latest.javaMb)}/${formatMb(latest.javaCommittedMb)}`, - 190, + 48, + 16 + font.measureText(scaleLabel) + 8 <= legendLeft ? scaleLabel : shortScaleLabel, + 140, ); - image.drawText( - font, - width - 16 - font.measureText(`CPU ${formatPercent(latest.cpuPercent)} threads ${latest.threads}`), - 47 - font.lineHeight, - `CPU ${formatPercent(latest.cpuPercent)} threads ${latest.threads}`, - 155, - ); - - const memoryPeak = Math.max(...this.samples.map((sample) => sample.rssMb), 64); - const memoryScale = roundUp(memoryPeak * 1.08, 64); - image.drawText(font, 16, 48, `Memory 0–${formatMb(memoryScale)}`, 140); - drawLegend(image, font, width, 48, [ - ["RSS", 240], - ["native", 155], - ["Java", 80], - ]); - drawChart(image, this.samples, latest.atMs, { x: 16, y: 64, width: width - 32, height: 70 }, memoryScale, [ - { value: (sample) => sample.rssMb, shade: 240 }, - { value: (sample) => sample.nativeMb, shade: 155 }, - { value: (sample) => sample.javaMb, shade: 80 }, - ]); + drawChart(image, this.samples, latest.atMs, { x: 16, y: 64, width: width - 32, height: 70 }, memoryScale, memorySeries); const cpuPeak = Math.max(...this.samples.map((sample) => sample.cpuPercent), 100); const cpuScale = roundUp(cpuPeak * 1.08, 25); @@ -119,26 +118,16 @@ export class ResourceUsageLayer implements Layer { private takeSample(): void { if (this.removed) return; try { - const raw = com.faceclaw.app.FaceclawResourceUsage.sample(); - const atMs = Number(raw[0]); - const cpuMs = Number(raw[1]); - const elapsedDelta = atMs - this.previousElapsedMs; - const cpuDelta = cpuMs - this.previousCpuMs; + const sample = sampleResourceUsage(); + const elapsedDelta = sample.atMs - this.previousElapsedMs; + const cpuDelta = sample.cpuMs - this.previousCpuMs; const cpuPercent = this.previousElapsedMs > 0 && elapsedDelta > 0 ? Math.max(0, cpuDelta / elapsedDelta * 100) : 0; - this.previousElapsedMs = atMs; - this.previousCpuMs = cpuMs; - this.samples.push({ - atMs, - cpuPercent, - rssMb: kbToMb(Number(raw[2])), - nativeMb: kbToMb(Number(raw[3])), - javaMb: kbToMb(Number(raw[4])), - javaCommittedMb: kbToMb(Number(raw[5])), - threads: Number(raw[6]), - }); - const cutoff = atMs - HISTORY_MS; + this.previousElapsedMs = sample.atMs; + this.previousCpuMs = sample.cpuMs; + this.samples.push({ ...sample, cpuPercent }); + const cutoff = sample.atMs - HISTORY_MS; while (this.samples.length > 1 && this.samples[0]!.atMs < cutoff) this.samples.shift(); while (this.samples.length > MAX_SAMPLES) this.samples.shift(); this.sampleError = ""; @@ -153,7 +142,7 @@ export class ResourceUsageLayer implements Layer { function drawChart( image: GrayImage, - samples: readonly ResourceSample[], + samples: readonly ChartSample[], nowMs: number, bounds: { x: number; y: number; width: number; height: number }, scale: number, @@ -163,7 +152,8 @@ function drawChart( const midY = bounds.y + Math.round((bounds.height - 1) / 2); image.drawLine(bounds.x + 1, midY, bounds.x + bounds.width - 2, midY, 24); const startMs = nowMs - HISTORY_MS; - for (const item of series) { + // Back to front, so the headline series is drawn on top where lines cross. + for (const item of [...series].reverse()) { let previous: { x: number; y: number } | null = null; for (const sample of samples) { if (sample.atMs < startMs) continue; @@ -177,36 +167,30 @@ function drawChart( } } +/** Right-aligned legend of line swatches and labels; returns its left edge. */ function drawLegend( image: GrayImage, font: ReturnType, width: number, y: number, entries: ReadonlyArray, -): void { +): number { const totalWidth = entries.reduce((sum, [label]) => sum + font.measureText(label) + 14, 0); - let x = width - 16 - totalWidth; + const left = width - 16 - totalWidth; + let x = left; for (const [label, shade] of entries) { image.drawLine(x, y + 6, x + 8, y + 6, shade); x += 12; image.drawText(font, x, y, label, shade); x += font.measureText(label) + 2; } -} - -function kbToMb(kb: number): number { - return Math.max(0, kb) / 1024; + return left; } function roundUp(value: number, step: number): number { return Math.max(step, Math.ceil(value / step) * step); } -function formatMb(value: number): string { - if (value >= 1024) return `${(value / 1024).toFixed(1)}G`; - return `${Math.round(value)}M`; -} - function formatPercent(value: number): string { return `${value < 10 ? value.toFixed(1) : Math.round(value)}%`; } diff --git a/app/apps/evenhub/installed-apps.ts b/app/apps/evenhub/installed-apps.ts index a785f34f..bf6dfc43 100644 --- a/app/apps/evenhub/installed-apps.ts +++ b/app/apps/evenhub/installed-apps.ts @@ -176,6 +176,21 @@ export function readEvenHubPackageManifestBytes(bytes: Uint8Array): EvenHubManif } } +/** + * Delete an installed EHPK that is all zeros, keeping its registry entry and + * icon so the store treats it as missing and offers Reinstall. iOS builds + * before the binary-http.ios.ts copy fix could store a large download that + * way. Returns whether the package was discarded. + */ +export function discardZeroedEvenHubPackage(packageId: string): boolean { + const path = installedEvenHubPackagePath(packageId); + const bytes = readBinaryFile(path); + if (!bytes || bytes.length === 0) return false; + for (let i = 0; i < bytes.length; i++) if (bytes[i] !== 0) return false; + deletePathRecursively(path); + return true; +} + /** Remove the stored EHPK, unpacked runtime files, and registry entry. */ export function uninstallEvenHubPackage(packageId: string): boolean { const apps = getInstalledEvenHubApps(); diff --git a/app/apps/evenhub/mic-router.ts b/app/apps/evenhub/mic-router.ts index 76f7fe15..bf7d7d57 100644 --- a/app/apps/evenhub/mic-router.ts +++ b/app/apps/evenhub/mic-router.ts @@ -27,6 +27,7 @@ export type EvenHubMicClient = { deliverAudioPcm(pcm: Uint8Array): void; }; +/** Android's session for the raw tap; iOS binds its own to the bridge (setRawSession). */ function activeCommunicator(): any { if (!global.isAndroid) return null; try { diff --git a/app/apps/evenhub/session.ts b/app/apps/evenhub/session.ts index 53289885..bdbdd92d 100644 --- a/app/apps/evenhub/session.ts +++ b/app/apps/evenhub/session.ts @@ -726,7 +726,6 @@ export class EvenHubSession implements EvenHubMicClient, EvenHubImuClient, EvenH * flows (foreground + screen on + no assistant modal). */ private audioControl(data: Record): boolean { - if (global.isIOS) return false; // EvenHub PCM routing is not ported yet. if (!permissionsIncludeMicrophone(this.manifest.permissions)) { this.log("evenhub: audioControl denied (app declares no microphone permission)"); return false; diff --git a/app/apps/glanceboard/widgets/system-card.ts b/app/apps/glanceboard/widgets/system-card.ts index e823cb5e..2ef3515a 100644 --- a/app/apps/glanceboard/widgets/system-card.ts +++ b/app/apps/glanceboard/widgets/system-card.ts @@ -9,6 +9,7 @@ import { import { type GrayImage, type UiFont } from "../../../graphics/image"; import { ensureLocationPermission, hasLocationPermission } from "../../../native/location-permissions"; import { onAndroidNotificationsChanged, readActiveNotificationIcons } from "../../../native/notification-icons"; +import { NOTIFICATION_ICON_SIZE } from "../../../native/notification-types"; import { readPhoneBatteryState } from "../../../native/phone-battery"; import { weatherBridge } from "../../../native/weather"; import { formatClockDate, formatClockTime } from "../../../ui/clock-format"; @@ -37,7 +38,6 @@ import { glanceFont } from "../glance-font"; import { type GlanceWidget } from "../widget"; const PAD = 8; -const NOTIFICATION_ICON_SIZE = 24; const NOTIFICATION_ICON_GAP = 4; const BATTERY_ITEM_GAP = 12; const BATTERY_LABEL_VALUE = 150; diff --git a/app/apps/microphones/conversation-qa.ts b/app/apps/microphones/conversation-qa.ts index c3300c2e..8f38088f 100644 --- a/app/apps/microphones/conversation-qa.ts +++ b/app/apps/microphones/conversation-qa.ts @@ -1,6 +1,6 @@ import { Utils } from "@nativescript/core"; -import { isLocalModelReady, streamLocalQwen } from "../../native/llama"; +import { isLocalModelReady, streamLocalModel } from "../../native/local-llm"; import type { LlmStreamHandle } from "../../assistant/llm-protocol"; import { parseConversationQuery } from "../../phone-ui/conversation-search"; @@ -245,7 +245,7 @@ export function askConversations( setTimeout(() => callbacks.onError(`Could not read the conversation store: ${String(error)}`), 0); return { cancel: () => {} }; } - return streamLocalQwen({ + return streamLocalModel({ apiKey: "", model: "local", system: diff --git a/app/apps/microphones/mic-control.ts b/app/apps/microphones/mic-control.ts index 3ac8ddca..6f62b3ad 100644 --- a/app/apps/microphones/mic-control.ts +++ b/app/apps/microphones/mic-control.ts @@ -1,7 +1,6 @@ import { getStringSetting, setStringSetting } from "../../native/settings-store"; import { useMicControlSetting } from "../../ui/dashboard-settings"; -import { toJavaBytes } from "../../native/cloud-stt"; -import { toUint8Array } from "../../util/array-util"; +import { addMicStatusListener, micControlSession, sendMicControlRecord } from "../../native/mic-control-link"; import { MIC_LEASE_MS, decodeMicStatus, @@ -14,8 +13,6 @@ import { type MicStatus, } from "./mic-protocol"; -declare const com: any; - /** * Host-side controller for the CFW mic_control array: sends the same config * to both temples (each temple is its own endpoint and its own 2-mic array), @@ -30,15 +27,6 @@ const LEASE_RENEW_MS = Math.floor(MIC_LEASE_MS / 3); export type MicArrayStatuses = { left: MicStatus | null; right: MicStatus | null }; -function activeCommunicator(): any { - if (!global.isAndroid) return null; - try { - return com.faceclaw.app.FaceclawBleCommunicator.getActive(); - } catch { - return null; - } -} - /** * True when the "Use microphone control" developer setting is on. With the * setting off, Faceclaw behaves exactly as it would on firmware without the @@ -71,9 +59,9 @@ export function saveMicConfig(config: MicConfig): void { class MicArrayController { private readonly statusListeners = new Set<(statuses: MicArrayStatuses) => void>(); private statuses: MicArrayStatuses = { left: null, right: null }; - // The Java listener proxy must stay referenced or it gets GC'd. - private statusProxy: any = null; - private proxyCommunicator: any = null; + // Holds the native listener proxy, which must stay referenced or it gets GC'd. + private unsubscribeStatus: (() => void) | null = null; + private statusSession: unknown = null; private leaseTimer: ReturnType | null = null; private armed = false; @@ -158,39 +146,28 @@ class MicArrayController { rightTemple = true, leftTemple = true, ): boolean { - const communicator = activeCommunicator(); - if (!communicator) return false; + const session = micControlSession(); + if (!session) return false; try { - this.ensureStatusProxy(communicator); - const record = encodeMicControl(op, config); - // False when the session wasn't ready and nothing was queued. - return communicator.sendFaceclawMicControl(toJavaBytes(record), label, rightTemple, leftTemple) !== false; + this.ensureStatusListener(session); + return sendMicControlRecord(session, encodeMicControl(op, config), label, rightTemple, leftTemple); } catch (error) { console.warn(`mic control ${label} failed: ${error}`); return false; } } - private ensureStatusProxy(communicator: any): void { - if (this.statusProxy && this.proxyCommunicator === communicator) return; - if (this.statusProxy && this.proxyCommunicator) { - try { - this.proxyCommunicator.removeMicStatusListener(this.statusProxy); - } catch { - // The old communicator instance may be gone after a reconnect. - } - } - this.statusProxy = new com.faceclaw.app.FaceclawMicStatusListener({ - onMicStatus: (body: any, arm: string) => { - const status = decodeMicStatus(toUint8Array(body)); - if (!status) return; - const side: MicSide = String(arm) === "L" ? "left" : "right"; - this.statuses = { ...this.statuses, [side]: { ...status, side } }; - this.statusListeners.forEach((listener) => listener(this.statuses)); - }, + private ensureStatusListener(session: unknown): void { + if (this.unsubscribeStatus && this.statusSession === session) return; + this.unsubscribeStatus?.(); + this.statusSession = session; + this.unsubscribeStatus = addMicStatusListener(session, (body, arm) => { + const status = decodeMicStatus(body); + if (!status) return; + const side: MicSide = arm === "L" ? "left" : "right"; + this.statuses = { ...this.statuses, [side]: { ...status, side } }; + this.statusListeners.forEach((listener) => listener(this.statuses)); }); - this.proxyCommunicator = communicator; - communicator.addMicStatusListener(this.statusProxy); } private syncLeaseTimer(): void { diff --git a/app/apps/microphones/mic-session.ts b/app/apps/microphones/mic-session.ts index 5139f09b..88aedc2d 100644 --- a/app/apps/microphones/mic-session.ts +++ b/app/apps/microphones/mic-session.ts @@ -64,6 +64,7 @@ import { analyzeLine, searchableMetadata } from "./sentiment"; import { generateSessionInsights } from "./speaker-insights"; import { speakerRegistry, type SpeakerMatch } from "./speakers"; import { postAmbientCard } from "../../ui/shell/ambient-cards"; +import { pcmLevel, rmsToLevel } from "../../util/audio-level"; import { formatRelativeTime } from "../../util/date-util"; import { deviceLanguage, identifyLanguage, translateText } from "./translate"; @@ -1669,31 +1670,12 @@ function wireConfig(config: MicConfig): MicConfig { return { ...config, channelMask: 0b11 }; } -function pcmLevel(pcm: Uint8Array): number { - let sumSquares = 0; - const count = pcm.length / 2; - if (count === 0) return 0; - for (let i = 0; i < count; i++) { - let value = pcm[i * 2]! | (pcm[i * 2 + 1]! << 8); - if (value >= 0x8000) value -= 0x10000; - sumSquares += value * value; - } - return rmsToLevel(Math.sqrt(sumSquares / count) / 32768); -} - function floatLevel(samples: Float32Array): number { let sumSquares = 0; for (let i = 0; i < samples.length; i++) sumSquares += samples[i]! * samples[i]!; return rmsToLevel(Math.sqrt(sumSquares / Math.max(1, samples.length))); } -/** Map RMS in [0,1] to a meter position with a log-ish curve (mic peaks ~0.1 FS). */ -function rmsToLevel(rms: number): number { - if (rms <= 0) return 0; - const db = 20 * Math.log10(rms); - return Math.max(0, Math.min(1, (db + 60) / 60)); -} - function floatToPcm16(samples: Float32Array): Uint8Array { const out = new Uint8Array(samples.length * 2); for (let i = 0; i < samples.length; i++) { diff --git a/app/apps/microphones/name-verify.ts b/app/apps/microphones/name-verify.ts index 87acb77e..4cb01128 100644 --- a/app/apps/microphones/name-verify.ts +++ b/app/apps/microphones/name-verify.ts @@ -1,4 +1,4 @@ -import { isLocalModelReady, streamLocalQwen } from "../../native/llama"; +import { isLocalModelReady, streamLocalModel } from "../../native/local-llm"; import type { NameInference } from "./name-guess"; /** @@ -38,7 +38,7 @@ export function verifyIntroducedName( }; const timer = setTimeout(() => finish(null), VERDICT_TIMEOUT_MS); try { - streamLocalQwen({ + streamLocalModel({ apiKey: "", model: "local", system: diff --git a/app/apps/microphones/speaker-insights.ts b/app/apps/microphones/speaker-insights.ts index 0c9401ce..b4044645 100644 --- a/app/apps/microphones/speaker-insights.ts +++ b/app/apps/microphones/speaker-insights.ts @@ -1,6 +1,6 @@ import { Utils } from "@nativescript/core"; -import { isLocalModelReady, streamLocalQwen } from "../../native/llama"; +import { isLocalModelReady, streamLocalModel } from "../../native/local-llm"; import { speakerRegistry } from "./speakers"; declare const com: any; @@ -124,7 +124,7 @@ function generateForSpeaker( }; const timer = setTimeout(() => finish(null), GENERATION_TIMEOUT_MS); try { - streamLocalQwen({ + streamLocalModel({ apiKey: "", model: "local", system: diff --git a/app/apps/music/music-app.ts b/app/apps/music/music-app.ts index f35a1130..4a32c2db 100644 --- a/app/apps/music/music-app.ts +++ b/app/apps/music/music-app.ts @@ -8,8 +8,10 @@ import { Menu, type MenuDrawArgs } from "../../ui/menu-core"; import { centeredTextY, lineStep, tightRowHeight } from "../../ui/metrics"; import { mediaControllerBridge, type MediaControllerState, type MediaQueueItem } from "../../native/media-controller"; import { mediaBrowserBridge, type MediaBrowserApp } from "../../native/media-browser"; +import { spotifyService } from "../../native/spotify"; import { MediaBrowseLayer } from "./media-browse"; import { MusicSettingsLayer } from "./music-settings"; +import { spotifyMenuItem } from "./spotify-menu"; import { Layer, type LayerContext, type PaintBelow } from "../../ui/layers"; import { createInProcessWindow, YieldAtRootLayer, type InProcessAppOptions, type InProcessWindow } from "../../ui/shell/in-process-window"; @@ -33,6 +35,8 @@ const QUEUE_X = 204; /** Horizontal inset of row text from its selection box. */ const LIST_TEXT_INSET = 6; const PLAYLIST_ACTION_INDEX = 1; +/** Minimum room for the dim artist after a queue row's title; less and it is left off. */ +const QUEUE_SUBTITLE_MIN_WIDTH = 40; type MusicAction = | { kind: "play-pause"; label: string; enabled: boolean } @@ -40,14 +44,19 @@ type MusicAction = | { kind: "next"; label: string; enabled: boolean } | { kind: "volume"; label: string; enabled: boolean } | { kind: "playlist"; label: string; enabled: boolean } - | { kind: "browse"; label: string; enabled: boolean }; + | { kind: "browse"; label: string; enabled: boolean } + /** A player-specific action from the state's customActions (Spotify's shuffle / repeat / like). */ + | { kind: "custom"; label: string; enabled: boolean; action: string }; type FocusColumn = "actions" | "playlist"; /** * Music controller app: metadata + album art + transport controls for the * active Android media session (any player that publishes one) or, on iOS, - * the Apple Music system player, plus the player's queue when it exposes one + * the Apple Music system player; on both, Spotify through its Web API once + * signed in from the window menu (optional on Android, where it adds + * library browsing, shuffle / repeat / like and Spotify on other devices), + * plus the player's queue when it exposes one * (scroll to a track, click to jump). With no session, the front page lists * the apps whose library can be browsed (click one to open its * MediaBrowseLayer). @@ -110,7 +119,7 @@ class MusicAppLayer implements Layer { const apps = mediaBrowserBridge.listBrowsableApps(!this.libraryAppsFresh); this.libraryAppsFresh = true; this.libraryMenu.setItems(apps); - image.drawText(font, 24, 16, global.isIOS ? "Nothing is playing in Apple Music." : "No active media session.", 180); + image.drawText(font, 24, 16, global.isIOS ? media.status || "Nothing is playing." : "No active media session.", 180); const prompt = global.isIOS ? "Browse your library, or start playback on the phone." : apps.length @@ -121,6 +130,11 @@ class MusicAppLayer implements Layer { image.drawText(font, 24, y, line, 150); y += lineStep(font); } + // Why the last command failed (e.g. playing from the Spotify library with no device open). + for (const line of media.notice ? wrapText(font, media.notice, width - 48) : []) { + image.drawText(font, 24, y, line, 200); + y += lineStep(font); + } if (apps.length) { const listTop = y + 6; const listHeight = height - listTop - LIST_BOTTOM_MARGIN; @@ -156,12 +170,13 @@ class MusicAppLayer implements Layer { if (media.album) { image.drawText(font, META_X, metaTop + 4 + (titleSlots + 1) * metaStep, truncateText(font, media.album, metaWidth), 150); } + // The player line, or for a few seconds why a command failed. image.drawText( font, META_X, metaTop + 4 + (titleSlots + 2) * metaStep, - truncateText(font, media.appName || media.packageName, metaWidth), - 110, + truncateText(font, media.notice || media.appName || media.packageName, metaWidth), + media.notice ? 200 : 110, ); this.drawProgress(image, media, metaWidth); @@ -212,7 +227,16 @@ class MusicAppLayer implements Layer { private drawQueueItem({ image, item, x, y, width, height, selected }: MenuDrawArgs): void { const font = getDefaultSmallFont(); const label = `${item.active ? "> " : " "}${item.title || "(untitled)"}`; - image.drawText(font, x + LIST_TEXT_INSET, centeredTextY(font, y, height), truncateText(font, label, width - 2 * LIST_TEXT_INSET), selected ? 255 : 200); + const textWidth = width - 2 * LIST_TEXT_INSET; + const textY = centeredTextY(font, y, height); + const title = truncateText(font, label, textWidth); + image.drawText(font, x + LIST_TEXT_INSET, textY, title, selected ? 255 : 200); + // The artist, dimmer, in whatever room the title leaves. + const subtitleX = font.measureText(`${label} `); + if (item.subtitle && title === label && textWidth - subtitleX >= QUEUE_SUBTITLE_MIN_WIDTH) { + image.drawText(font, x + LIST_TEXT_INSET + subtitleX, textY, + truncateText(font, item.subtitle, textWidth - subtitleX), selected ? 150 : 110); + } } async handleInput(event: InputEvent, ctx: LayerContext): Promise { @@ -278,6 +302,7 @@ class MusicAppLayer implements Layer { else if (action.kind === "previous") await mediaControllerBridge.skipPrevious(); else if (action.kind === "next") await mediaControllerBridge.skipNext(); else if (action.kind === "browse") this.openBrowse(ctx); + else if (action.kind === "custom") await mediaControllerBridge.sendCustomAction?.(action.action); else if (action.kind === "volume") { ctx.stack.push(new VolumeModalLayer(mediaControllerBridge.getMediaVolumePercent())); } else if (action.kind === "playlist") { @@ -342,6 +367,12 @@ class MusicAppLayer implements Layer { { kind: "volume", label: volume >= 0 ? `Volume (${volume})` : "Volume", enabled: volume >= 0 }, { kind: "next", label: "Next track", enabled: media.canSkipNext }, { kind: "previous", label: "Previous track", enabled: media.canSkipPrevious }, + ...(mediaControllerBridge.sendCustomAction ? media.customActions ?? [] : []).map((custom): MusicAction => ({ + kind: "custom", + label: custom.name, + enabled: true, + action: custom.action, + })), ]; } @@ -496,14 +527,22 @@ export function createMusicAppWindow(options: InProcessAppOptions): InProcessWin iconLetter: "M", icon: "music", closeable: true, - // Music settings choose among Android media apps; iOS has only Apple Music. - menuItems: () => global.isIOS ? [] : [{ - label: "Music settings", - onSelect: (ctx) => { - ctx.stack.pop(); - ctx.stack.push(new MusicSettingsLayer()); - }, - }], + // Music settings choose among Android media apps (iOS has Apple Music + // alone); Spotify's sign-in is optional on Android, where its media + // session works without it. + menuItems: () => { + const spotify = spotifyService(); + return [ + ...(global.isIOS ? [] : [{ + label: "Music settings", + onSelect: (ctx: LayerContext) => { + ctx.stack.pop(); + ctx.stack.push(new MusicSettingsLayer()); + }, + }]), + ...(spotify ? [spotifyMenuItem(spotify)] : []), + ]; + }, actions: options.actions, baseLayer: new MusicRootLayer(musicLayer), submitFrame: options.submitFrame, diff --git a/app/apps/music/spotify-menu.ts b/app/apps/music/spotify-menu.ts new file mode 100644 index 00000000..54776cf0 --- /dev/null +++ b/app/apps/music/spotify-menu.ts @@ -0,0 +1,113 @@ +import type { GrayImage } from "../../graphics/image"; +import { isValidSpotifyClientId, SPOTIFY_DASHBOARD_URL, SPOTIFY_REDIRECT_URI } from "../../native/spotify-auth"; +import type { SpotifyService } from "../../native/spotify-service"; +import { spotifyClientIdSetting, textSettingMenuItem } from "../../ui/dashboard-settings"; +import { type InputEvent } from "../../ui/gestures"; +import { type LayerContext, type PaintBelow } from "../../ui/layers"; +import { submenuItem, TextPageLayer, type MenuItem } from "../../ui/menu"; +import { WindowMenuLayer } from "../../ui/window-menu"; +import { TextViewerLayer } from "../files/text-viewer"; + +const SETUP_INTRO = global.isIOS + ? "Faceclaw controls Spotify through Spotify's Web API, which needs a Spotify developer app of your own. Creating one is free; Spotify requires its owner to have Premium, and controlling playback needs Premium too." + : "Faceclaw already shows and controls Spotify on this phone, like any music app. Signing in to Spotify's Web API is optional and adds browsing your Spotify library, playing from Spotify by voice, shuffle / repeat / like, and Spotify playing on your other devices. It needs a Spotify developer app of your own: creating one is free, Spotify requires its owner to have Premium, and controlling playback through it needs Premium too."; + +const SETUP_HELP = [ + SETUP_INTRO, + "", + `1. On a computer, open ${SPOTIFY_DASHBOARD_URL.replace("https://", "")} and sign in with your Spotify account.`, + "2. Create an app. Any name and description will do.", + `3. Add this Redirect URI exactly: ${SPOTIFY_REDIRECT_URI}`, + "4. Under \"Which API/SDKs are you planning to use?\", tick Web API, then save.", + "5. Open the app's settings, copy its Client ID, and enter it as Client ID here.", + "6. Choose Sign in, then finish on your phone: Faceclaw opens Spotify's sign-in page there (once Faceclaw is open on the phone, if it was in the background).", + "", + "Spotify plays on whichever of your devices is open (this phone, a computer, a speaker). To start music when nothing is playing, Spotify must be open on one of them.", + "", + "Others can sign in with your client ID once you add their Spotify email under User Management in the dashboard (up to five people).", +].join("\n"); + +/** The Music app menu's Spotify row: sign in, sign out, client ID, setup help. */ +export function spotifyMenuItem(service: SpotifyService): MenuItem { + return submenuItem("Spotify", (ctx) => ctx.stack.push(new SpotifyMenuLayer(service)), { + description: global.isIOS + ? "Sign in to Spotify to show and control it from the glasses." + : "Optional: sign in to Spotify to browse its library and play from it by voice.", + }); +} + +/** + * Rows rebuilt every paint and input from the account and sign-in progress, + * which change asynchronously. A WindowMenuLayer, so the shell's system menu + * closes it like the window menu it opens from. + */ +class SpotifyMenuLayer extends WindowMenuLayer { + private unsubscribe: (() => void) | null = null; + + constructor(private readonly service: SpotifyService) { + super("Spotify", []); + } + + paint(ctx: LayerContext, paintBelow: PaintBelow): GrayImage { + this.unsubscribe ??= this.service.onChange(() => ctx.actions.requestRender()); + this.setItems(this.rows()); + return super.paint(ctx, paintBelow); + } + + async handleInput(event: InputEvent, ctx: LayerContext): Promise { + this.setItems(this.rows()); + await super.handleInput(event, ctx); + } + + onRemoved(): void { + this.unsubscribe?.(); + this.unsubscribe = null; + } + + private rows(): MenuItem[] { + const service = this.service; + const account = service.account(); + const status = service.signInStatus(); + const help: MenuItem = { + label: "Setup help", + onSelect: (ctx) => ctx.stack.push(new TextViewerLayer(SETUP_HELP, "Spotify setup")), + }; + if (account) { + return [ + info(`Signed in as ${account.displayName || account.userId}`), + ...(account.product && account.product !== "premium" ? [info("Playback control needs Premium")] : []), + { label: "Sign out", onSelect: () => service.signOut() }, + textSettingMenuItem(spotifyClientIdSetting), + help, + ]; + } + if (status.phase === "waiting") { + return [ + info("Finish signing in on the phone"), + { label: "Cancel sign-in", onSelect: () => service.cancelSignIn() }, + help, + ]; + } + const failure: MenuItem[] = status.error + ? [{ + label: "Sign-in failed (details)", + onSelect: (ctx) => ctx.stack.push(new TextPageLayer("Spotify sign-in failed", status.error)), + }] + : []; + return [ + { + label: "Sign in", + description: "Opens Spotify's sign-in page on the phone.", + disabled: () => !isValidSpotifyClientId(spotifyClientIdSetting.get()), + onSelect: () => void service.signIn(), + }, + textSettingMenuItem(spotifyClientIdSetting), + help, + ...failure, + ]; + } +} + +function info(label: string): MenuItem { + return { label, disabled: true, onSelect: () => {} }; +} diff --git a/app/apps/navigate/navigate-app.worker.ts b/app/apps/navigate/navigate-app.worker.ts index b79b09b1..142cef5e 100644 --- a/app/apps/navigate/navigate-app.worker.ts +++ b/app/apps/navigate/navigate-app.worker.ts @@ -28,6 +28,7 @@ import { WindowMenu, WindowMenuLayer } from "../../ui/window-menu"; import type { LayerContext } from "../../ui/layers"; import { truncateText, wrapText } from "../../graphics/textwrap"; import { onSettingsStoreChanged } from "../../native/settings-store"; +import { formatClockTime } from "../../ui/clock-format"; import { openUrlOnPhone } from "../../native/open-url"; import { navigateDestinationAddressDraftSetting, @@ -35,6 +36,9 @@ import { navigateRememberRecentSetting, navigateDisplayLayoutSetting, mapboxApiKeySetting, + distanceUnitSetting, + DISTANCE_UNIT_SETTING_KEY, + TIME_FORMAT_SETTING_KEY, enumSettingMenuItem, type ConfigSettingString, } from "../../ui/dashboard-settings"; @@ -266,8 +270,15 @@ function post(message: WorkerAppReply): void { // the edit screen live. onSettingsStoreChanged((key) => { // The token key repaints too: the phone editor writes it live during - // Edit token, and the idle page changes shape once one is set. - if (key.startsWith("navigate.") || key === MAPBOX_TOKEN_SETTING_KEY) render(); + // Edit token, and the idle page changes shape once one is set. So do the + // distance unit and time format (Settings > Customization), for the + // guidance panel. + if ( + key.startsWith("navigate.") || + key === MAPBOX_TOKEN_SETTING_KEY || + key === DISTANCE_UNIT_SETTING_KEY || + key === TIME_FORMAT_SETTING_KEY + ) render(); }); // The host queues messages until this arrives: posts to a worker whose bundle @@ -1569,15 +1580,33 @@ function drawFooter(image: GrayImage, text: string, x = 16): void { } // --------------------------------------------------------------------------- -// Formatting (imperial; matches the rest of the UI) +// Formatting (distances and clock times follow Settings > Customization) + +function metricDistances(): boolean { + return distanceUnitSetting.get() === "kilometers"; +} + +/** Under a kilometer: 10 m steps up to 100 m, then 50 m steps. */ +function formatMeters(meters: number): string { + const step = meters < 100 ? 10 : 50; + return `${Math.max(0, Math.round(meters / step) * step)} m`; +} function formatDistanceShort(meters: number): string { + if (metricDistances()) { + return meters < 950 ? formatMeters(meters) : `${(meters / 1000).toFixed(1)} km`; + } const feet = meters * 3.28084; if (feet < 900) return `${Math.max(0, Math.round(feet / 50) * 50)} ft`; return `${(feet / 5280).toFixed(1)} mi`; } function formatDistance(meters: number): string { + if (metricDistances()) { + if (meters < 950) return formatMeters(meters); + const km = meters / 1000; + return km >= 10 ? `${Math.round(km)} km` : `${km.toFixed(1)} km`; + } const feet = meters * 3.28084; if (feet < 1000) return `${Math.max(0, Math.round(feet / 50) * 50)} ft`; const miles = feet / 5280; @@ -1597,14 +1626,9 @@ function formatDurationLong(seconds: number): string { return `${hours}h ${minutes % 60}m`; } +/** "14:05" / "2:05 PM", as the top-bar clock shows it. */ function formatClock(timestampMs: number): string { - const date = new Date(timestampMs); - let hours = date.getHours(); - const minutes = String(date.getMinutes()).padStart(2, "0"); - const meridiem = hours >= 12 ? "PM" : "AM"; - hours = hours % 12; - if (hours === 0) hours = 12; - return `${hours}:${minutes} ${meridiem}`; + return formatClockTime(new Date(timestampMs)); } // --------------------------------------------------------------------------- diff --git a/app/apps/transcribe/transcribe-app.ts b/app/apps/transcribe/transcribe-app.ts index 71c1b4c6..900af357 100644 --- a/app/apps/transcribe/transcribe-app.ts +++ b/app/apps/transcribe/transcribe-app.ts @@ -78,7 +78,7 @@ export function createTranscribeAppWindow(options: TranscribeAppOptions): InProc }); // Wire async state changes to this window's renderer, rather than the // controller action from which the window-specific actions were derived. - layer.start(app.requestRender); + layer.start(app.requestRender, () => shell.isWindowVisible(TRANSCRIBE_WINDOW_ID)); options.startContinuousVoiceCapture({ recordAs: `transcribe-${stamp}` }); shell.setTrayIcon(TRAY_ICON_ID, MIC_ICON); return app; diff --git a/app/apps/transcribe/transcribe.ts b/app/apps/transcribe/transcribe.ts index 251b1807..2fd35a6c 100644 --- a/app/apps/transcribe/transcribe.ts +++ b/app/apps/transcribe/transcribe.ts @@ -1,6 +1,7 @@ import { GrayImage } from "../../graphics/image"; import { getDefaultSmallFont } from "../../graphics/ui-fonts"; import { lineStep } from "../../ui/metrics"; +import { MicLevelMeter, paintListeningHeader } from "../../ui/listening-header"; import { writeTextToDownloads } from "../../native/file-access"; import { voiceControlBridge } from "../../native/voice-control"; import { Layer, type LayerContext } from "../../ui/layers"; @@ -18,6 +19,7 @@ export class TranscribeLayer implements Layer { private detail = ""; private readonly transcript = new TranscriptModel(); private readonly scroll = new TranscriptScroll(); + private readonly meter = new MicLevelMeter(); private saveNotice = ""; private unsubscribeTranscript: (() => void) | null = null; private unsubscribePause: (() => void) | null = null; @@ -26,7 +28,9 @@ export class TranscribeLayer implements Layer { /** `stamp` names the saved transcript, matching the session's audio recording. */ constructor(private readonly stamp: string = transcriptTimestamp()) {} - start(requestRender: () => void): void { + /** `isVisible` says whether the window is on screen (the level meter repaints only then). */ + start(requestRender: () => void, isVisible: () => boolean): void { + this.meter.start(requestRender, isVisible); this.unsubscribeTranscript = voiceControlBridge.onTranscript((event) => { this.transcript.accept(event); requestRender(); @@ -48,11 +52,8 @@ export class TranscribeLayer implements Layer { const text = this.transcript.text || (this.listening ? "Listening..." : this.detail); const wrapped = wrapTranscribeText((line) => font.measureText(line), text, width - 64); - image.drawText(font, 24, 20, "Transcribe", 200); - image.drawText(font, 24, 40, this.saveNotice || this.status, 110); - + const bodyTop = paintListeningHeader(image, font, "Transcribe", this.saveNotice || this.status, this.listening ? this.meter : null); const step = lineStep(font) + 2; - const bodyTop = 62; const bodyLines = Math.max(1, Math.floor((height - 6 - bodyTop - font.lineHeight) / step) + 1); const firstLine = this.scroll.layout(wrapped.length, bodyLines); for (let index = firstLine; index < Math.min(wrapped.length, firstLine + bodyLines); index++) { @@ -82,6 +83,7 @@ export class TranscribeLayer implements Layer { } onRemoved(): void { + this.meter.stop(); this.unsubscribePause?.(); this.unsubscribePause = null; this.unsubscribeTranscript?.(); diff --git a/app/apps/translate/translate-app.ts b/app/apps/translate/translate-app.ts index 7cbd57e3..dd0800ab 100644 --- a/app/apps/translate/translate-app.ts +++ b/app/apps/translate/translate-app.ts @@ -1,6 +1,12 @@ import { TranslateLayer } from "./translate"; import { resolveTranslationModel } from "./translate-llm"; -import { resolveTranslateProvider, translateProviderSetting, translateShowOriginalSetting } from "./translate-settings"; +import { + resolveTranslateLanguage, + resolveTranslateProvider, + translateLanguageSetting, + translateProviderSetting, + translateShowOriginalSetting, +} from "./translate-settings"; import { MIC_ICON } from "../transcribe/transcribe-app"; import { transcriptTimestamp } from "../transcribe/transcribe"; import { type ContinuousCaptureOptions } from "../../ui/layers"; @@ -22,8 +28,8 @@ const TRAY_ICON_ID = "translate"; const NO_PROVIDER_PROBLEM = "Translate needs a transcription provider that understands any language: add an ElevenLabs, OpenAI, or Soniox API key (Settings > API Keys), or a Whisper server URL (Settings > Voice)."; const NO_MODEL_PROBLEM = global.isIOS - ? "Translate needs a language model: add an Anthropic or OpenAI API key (Settings > API Keys)." - : "Translate needs a language model: add an Anthropic or OpenAI API key (Settings > API Keys), or download the on-phone model (Settings > Assistant)."; + ? "Translate needs a language model: configure a cloud or OpenAI-compatible model in Settings > Assistant." + : "Translate needs a language model: configure one in Settings > Assistant, or download the on-phone model."; export type TranslateAppOptions = InProcessAppOptions & { /** Begin (or retarget) continuous mic capture, kept on while the window is open. */ @@ -38,8 +44,9 @@ export type TranslateAppOptions = InProcessAppOptions & { * provider (Translate settings), which a shared capture switches to. */ export function createTranslateAppWindow(options: TranslateAppOptions): InProcessWindow { - // Checks the setup and (re)starts capture with the chosen provider: at - // launch, when the provider setting changes, and on a tap after a problem. + // Checks the setup and (re)starts capture with the chosen provider and + // language: at launch, when either setting changes, and on a tap after a + // problem. const startCapture = () => { const provider = resolveTranslateProvider(); const problem = !provider ? NO_PROVIDER_PROBLEM : !resolveTranslationModel() ? NO_MODEL_PROBLEM : null; @@ -49,7 +56,7 @@ export function createTranslateAppWindow(options: TranslateAppOptions): InProces shell.setTrayIcon(TRAY_ICON_ID, null); return; } - options.startContinuousVoiceCapture({ multilingualProvider: provider }); + options.startContinuousVoiceCapture({ transcription: { provider, language: resolveTranslateLanguage() } }); shell.setTrayIcon(TRAY_ICON_ID, MIC_ICON); }; const layer = new TranslateLayer(transcriptTimestamp(), startCapture); @@ -75,6 +82,7 @@ export function createTranslateAppWindow(options: TranslateAppOptions): InProces onSelect: (ctx) => { ctx.stack.pop(); openSettingsSubMenu(ctx, "Translate settings", [ + enumSettingMenuItem(translateLanguageSetting, { onChange: startCapture }), enumSettingMenuItem(translateProviderSetting, { onChange: startCapture }), toggleSettingMenuItem(translateShowOriginalSetting), ]); @@ -93,7 +101,7 @@ export function createTranslateAppWindow(options: TranslateAppOptions): InProces }); // Wire async state changes to this window's renderer, rather than the // controller action from which the window-specific actions were derived. - layer.start(app.requestRender); + layer.start(app.requestRender, () => shell.isWindowVisible(TRANSLATE_WINDOW_ID)); startCapture(); return app; } diff --git a/app/apps/translate/translate-llm.ts b/app/apps/translate/translate-llm.ts index 26021899..e3447d38 100644 --- a/app/apps/translate/translate-llm.ts +++ b/app/apps/translate/translate-llm.ts @@ -4,11 +4,15 @@ * TranslationModel for how stretches are batched and given context. */ import { streamAnthropicMessage } from "../../native/anthropic"; -import { streamLocalQwen } from "../../native/llama"; +import { streamLocalModel } from "../../native/local-llm"; import { streamOpenAiResponse } from "../../native/openai"; +import { streamOpenAiCompatibleChat } from "../../native/openai-chat"; import { resolveAssistantModel, type ResolvedAssistantModel } from "../../assistant/models"; import { type LlmStreamHandle, type LlmStreamOptions } from "../../assistant/llm-protocol"; -import { anthropicApiKeySetting, assistantModelSetting, openAiApiKeySetting } from "../../ui/dashboard-settings"; +import { + anthropicApiKeySetting, assistantModelSetting, assistantOpenAiCompatibleKeySetting, + assistantOpenAiCompatibleModelSetting, assistantOpenAiCompatibleUrlSetting, openAiApiKeySetting, +} from "../../ui/dashboard-settings"; import { TRANSLATE_SYSTEM_PROMPT, buildTranslateUserMessage } from "../../prompts"; import { type TranslationTurn } from "./translation-model"; @@ -23,12 +27,17 @@ export function resolveTranslationModel(): ResolvedAssistantModel | null { return resolveAssistantModel(selection === "hermes" ? "auto" : selection, { anthropic: anthropicApiKeySetting.get(), openai: openAiApiKeySetting.get(), + openAiCompatibleUrl: assistantOpenAiCompatibleUrlSetting.get(), + openAiCompatibleKey: assistantOpenAiCompatibleKeySetting.get(), + openAiCompatibleModel: assistantOpenAiCompatibleModelSetting.get(), }); } export type TranslationRequest = { speech: string; context: TranslationTurn[]; + /** English name of the spoken language when the user set one, else "". */ + language: string; onProgress: (textSoFar: string) => void; onDone: (translation: string) => void; onError: (message: string) => void; @@ -41,7 +50,7 @@ export function streamTranslation(model: ResolvedAssistantModel, request: Transl system: TRANSLATE_SYSTEM_PROMPT, effort: model.effort, maxTokens: 1024, - messages: [{ role: "user", content: buildTranslateUserMessage(request.speech, request.context) }], + messages: [{ role: "user", content: buildTranslateUserMessage(request.speech, request.context, request.language) }], onTextDelta: (_delta, textSoFar) => request.onProgress(cleanTranslation(textSoFar)), onDone: (result) => { if (result.stopReason === "refusal") request.onError("The model declined to translate this."); @@ -52,8 +61,10 @@ export function streamTranslation(model: ResolvedAssistantModel, request: Transl switch (model.provider) { case "openai": return streamOpenAiResponse(options); + case "openai-compatible": + return streamOpenAiCompatibleChat({ ...options, baseUrl: model.baseUrl ?? "" }); case "local": - return streamLocalQwen(options); + return streamLocalModel(options); default: return streamAnthropicMessage(options); } diff --git a/app/apps/translate/translate-settings.ts b/app/apps/translate/translate-settings.ts index c75d1ef3..802419e1 100644 --- a/app/apps/translate/translate-settings.ts +++ b/app/apps/translate/translate-settings.ts @@ -47,6 +47,58 @@ export const translateProviderSetting = new ConfigSettingEnum "Speech-to-text for Translate. Only cloud providers recognize any language (the on-device engines don't), so each needs its API key in Settings > API Keys, or a Whisper server URL in Settings > Voice. Auto uses the main Transcription Provider when it is one of these.", }); +/** + * Spoken languages Translate can be told to expect, by ISO 639-1 code (the + * form every multilingual provider accepts), in picker order. + */ +const SPOKEN_LANGUAGES = { + ar: "Arabic", + zh: "Chinese", + nl: "Dutch", + fr: "French", + de: "German", + el: "Greek", + he: "Hebrew", + hi: "Hindi", + id: "Indonesian", + it: "Italian", + ja: "Japanese", + ko: "Korean", + pl: "Polish", + pt: "Portuguese", + ru: "Russian", + es: "Spanish", + sv: "Swedish", + th: "Thai", + tr: "Turkish", + uk: "Ukrainian", + vi: "Vietnamese", +} as const; + +export type SpokenLanguage = keyof typeof SPOKEN_LANGUAGES; + +export const translateLanguageSetting = new ConfigSettingEnum<"auto" | SpokenLanguage>({ + id: "translate-language", + label: "Spoken language", + storageKey: "translate.language", + defaultValue: "auto", + values: ["auto", ...(Object.keys(SPOKEN_LANGUAGES) as SpokenLanguage[])], + formatValue: (value) => (value === "auto" ? "Auto-detect" : SPOKEN_LANGUAGES[value]), + description: + "The language being spoken. Auto-detect can mistake it, especially in short or noisy speech, and then transcribes nonsense in the wrong language; naming it makes transcription much more reliable. ElevenLabs then transcribes only that language.", +}); + +/** The language to tell the transcription provider (ISO 639-1), or "" to let it detect one. */ +export function resolveTranslateLanguage(): SpokenLanguage | "" { + const value = translateLanguageSetting.get(); + return value === "auto" ? "" : value; +} + +/** The English name of a spoken language, for the translation prompt. */ +export function spokenLanguageName(language: SpokenLanguage): string { + return SPOKEN_LANGUAGES[language]; +} + export const translateShowOriginalSetting = new ConfigSettingBoolean({ id: "translate-show-original", label: "Show original", diff --git a/app/apps/translate/translate.ts b/app/apps/translate/translate.ts index 252da0d4..e747be2d 100644 --- a/app/apps/translate/translate.ts +++ b/app/apps/translate/translate.ts @@ -1,6 +1,7 @@ import { GrayImage } from "../../graphics/image"; import { getDefaultSmallFont } from "../../graphics/ui-fonts"; import { lineStep } from "../../ui/metrics"; +import { MicLevelMeter, paintListeningHeader } from "../../ui/listening-header"; import { writeTextToDownloads } from "../../native/file-access"; import { voiceControlBridge } from "../../native/voice-control"; import { Layer, type LayerContext } from "../../ui/layers"; @@ -9,15 +10,16 @@ import { type LlmStreamHandle } from "../../assistant/llm-protocol"; import { TranscriptScroll, wrapTranscribeText } from "../transcribe/transcript-model"; import { TranslationModel, type TranslationJob, type TranslationLine } from "./translation-model"; import { resolveTranslationModel, streamTranslation } from "./translate-llm"; -import { translateShowOriginalSetting } from "./translate-settings"; +import { resolveTranslateLanguage, spokenLanguageName, translateShowOriginalSetting } from "./translate-settings"; const NO_MODEL_NOTICE = "No language model is set up."; /** * Live translation view. Continuous mic capture is owned by the app wrapper - * (createTranslateAppWindow); this layer feeds finalized speech to the - * assistant's model one stretch at a time, shows the English as it streams - * in, and saves the session to Downloads from the app menu. + * (createTranslateAppWindow); this layer feeds speech to the assistant's + * model one block at a time (provisionally while a block is still being + * spoken), shows the English as it streams in, and saves the session to + * Downloads from the app menu. */ export class TranslateLayer implements Layer { private status = "Starting microphone..."; @@ -30,7 +32,8 @@ export class TranslateLayer implements Layer { private problem: string | null = null; private readonly model = new TranslationModel(); private readonly scroll = new TranscriptScroll(); - private activeJob: TranslationJob | null = null; + private readonly meter = new MicLevelMeter(); + // The request in flight (the model tracks which job it is). private activeHandle: LlmStreamHandle | null = null; private requestRender: () => void = () => {}; private removed = false; @@ -40,10 +43,16 @@ export class TranslateLayer implements Layer { /** `stamp` names the saved transcript; `retry` re-runs the app's setup check. */ constructor(private readonly stamp: string, private readonly retry: () => void) {} - start(requestRender: () => void): void { + /** `isVisible` says whether the window is on screen (the level meter repaints only then). */ + start(requestRender: () => void, isVisible: () => boolean): void { this.requestRender = requestRender; + this.meter.start(requestRender, isVisible); this.unsubscribeTranscript = voiceControlBridge.onTranscript((event) => { - this.model.accept(event); + if (this.model.accept(event)) { + // The request in flight translates text the transcript has replaced. + this.activeHandle?.cancel(); + this.activeHandle = null; + } this.pump(); requestRender(); }); @@ -68,9 +77,9 @@ export class TranslateLayer implements Layer { const measure = (line: string) => font.measureText(line); const maxWidth = width - 64; - image.drawText(font, 24, 20, "Translate", 200); const status = this.problem ? "Setup needed" : this.translationError || this.status; - image.drawText(font, 24, 40, this.saveNotice || status, 110); + const meter = this.listening && !this.problem ? this.meter : null; + const bodyTop = paintListeningHeader(image, font, "Translate", this.saveNotice || status, meter); let lines: TranslationLine[]; if (this.problem) { @@ -84,7 +93,6 @@ export class TranslateLayer implements Layer { } const step = lineStep(font) + 2; - const bodyTop = 62; const bodyLines = Math.max(1, Math.floor((height - 6 - bodyTop - font.lineHeight) / step) + 1); const firstLine = this.scroll.layout(lines.length, bodyLines); for (let index = firstLine; index < Math.min(lines.length, firstLine + bodyLines); index++) { @@ -119,7 +127,7 @@ export class TranslateLayer implements Layer { onRemoved(): void { this.removed = true; - this.activeJob = null; + this.meter.stop(); this.activeHandle?.cancel(); this.activeHandle = null; this.unsubscribeTranscript?.(); @@ -139,7 +147,10 @@ export class TranslateLayer implements Layer { this.saveNotice = path ? `Saved ${filename}` : "Save failed (check file access)."; } - /** Start translating the next waiting stretch of speech, unless one is in flight. */ + /** + * Start the next translation request (a final block, else the live block's + * provisional one), unless one is in flight. + */ private pump(): void { if (this.removed) return; const job = this.model.nextJob(); @@ -147,36 +158,34 @@ export class TranslateLayer implements Layer { const llm = resolveTranslationModel(); if (!llm) { // The model went away mid-session (a key was cleared): keep the original. - this.model.fail(job.segment); + this.model.fail(job); this.translationError = NO_MODEL_NOTICE; this.pump(); return; } - this.activeJob = job; + const language = resolveTranslateLanguage(); const handle = streamTranslation(llm, { - speech: job.segment.source, + speech: job.source, context: job.context, + language: language ? spokenLanguageName(language) : "", onProgress: (textSoFar) => { - if (this.activeJob !== job) return; - this.model.progress(job.segment, textSoFar); - this.requestRender(); + if (this.model.progress(job, textSoFar)) this.requestRender(); }, onDone: (translation) => this.settle(job, () => { - this.model.complete(job.segment, translation); + this.model.complete(job, translation); this.translationError = ""; }), onError: (message) => this.settle(job, () => { - this.model.fail(job.segment); + this.model.fail(job); this.translationError = `Translation failed: ${message}`; }), }); // A provider that fails synchronously has already settled (and moved on). - if (this.activeJob === job) this.activeHandle = handle; + if (this.model.isActive(job)) this.activeHandle = handle; } private settle(job: TranslationJob, apply: () => void): void { - if (this.activeJob !== job) return; - this.activeJob = null; + if (!this.model.isActive(job)) return; this.activeHandle = null; apply(); this.pump(); diff --git a/app/apps/translate/translation-model.ts b/app/apps/translate/translation-model.ts index ea0e9204..2a1fc9da 100644 --- a/app/apps/translate/translation-model.ts +++ b/app/apps/translate/translation-model.ts @@ -2,21 +2,32 @@ import { wrapTranscribeText } from "../transcribe/transcript-model"; type TranscriptEvent = { text: string; isFinal: boolean }; -export type TranslationState = "pending" | "translating" | "done" | "failed"; - -/** One stretch of finalized speech and its English translation. */ +/** + * One block of speech (up to a pause) and its English translation. The last + * block may still be live, its transcript revising; it is translated + * provisionally as it grows, then again once final if its text changed. + */ export type TranslationSegment = { source: string; - /** The translation so far (streamed while translating). */ + /** Committed by the transcriber; a live block's source still revises. */ + final: boolean; + /** The latest finished translation, of `translatedSource`. */ translation: string; - state: TranslationState; + /** What `translation` translates: null until one finishes, behind `source` while provisional. */ + translatedSource: string | null; + /** The text streamed so far by the request in flight for this block, else null. */ + streaming: string | null; + /** A source whose translation failed; not retried until the source changes. */ + failedSource: string | null; }; export type TranslationTurn = { source: string; translation: string }; -/** A segment handed to the model, with the finished turns before it. */ +/** A request: a block's source as sent, with the finished turns before it. */ export type TranslationJob = { segment: TranslationSegment; + /** The source sent (a live block's moves on while the request is in flight). */ + source: string; /** Earlier translated turns, oldest first. */ context: TranslationTurn[]; }; @@ -27,59 +38,123 @@ export type TranslationLine = { text: string; gray: number }; // over between requests; bounded so a long session's requests stay small. const CONTEXT_TURNS = 4; const CONTEXT_CHARS = 800; +// A live block is translated again once its text has changed length by this +// much since the last request, so a trickle of revisions (punctuation, one +// corrected word) doesn't spend a request each. A final is always redone. +const PROVISIONAL_MIN_CHANGE = 3; const TRANSLATION_GRAY = 230; +const PROVISIONAL_GRAY = 170; const ORIGINAL_GRAY = 120; const LIVE_GRAY = 90; +function newSegment(source: string, final: boolean): TranslationSegment { + return { source, final, translation: "", translatedSource: null, streaming: null, failedSource: null }; +} + +/** Whether a block's current source still needs a translation request. */ +function wantsTranslation(segment: TranslationSegment): boolean { + const { source, translatedSource } = segment; + if (!source || source === translatedSource || source === segment.failedSource) return false; + return segment.final || translatedSource === null || Math.abs(source.length - translatedSource.length) >= PROVISIONAL_MIN_CHANGE; +} + /** - * The Translate app's conversation: finalized speech segments with their - * translations, plus the live partial of the utterance in progress. + * The Translate app's conversation: blocks of speech with their translations. * Translation is serial (one request at a time, in order, so each can carry - * the turns before it as context); finals that arrive while a request is in - * flight merge into one pending segment, so a slow model batches the backlog - * instead of falling further behind one request per pause. + * the turns before it as context): final blocks first, then the live one. + * Finals that arrive while a request is in flight merge into one waiting + * block, so a slow model batches the backlog instead of falling further + * behind one request per pause. */ export class TranslationModel { readonly segments: TranslationSegment[] = []; - /** The utterance in progress (replace semantics), not yet final. */ - live = ""; + private active: TranslationJob | null = null; - accept(event: TranscriptEvent): void { + /** + * Take a transcript event (replace semantics within the live block). + * Returns true when it made the request in flight moot (its block was + * finalized as other text, or dropped); that request is abandoned here, and + * the caller should cancel it. + */ + accept(event: TranscriptEvent): boolean { const text = event.text.trim(); - if (!event.isFinal) { - this.live = text; - return; - } - const finalText = text || this.live; - this.live = ""; - if (!finalText) return; const last = this.segments[this.segments.length - 1]; - if (last?.state === "pending") last.source = `${last.source} ${finalText}`; - else this.segments.push({ source: finalText, translation: "", state: "pending" }); + const live = last && !last.final ? last : null; + if (!event.isFinal) { + if (live) live.source = text; + else if (text) this.segments.push(newSegment(text, false)); + return false; + } + const finalText = text || live?.source || ""; + if (!live) { + if (finalText && !this.mergeIntoWaiting(finalText)) this.segments.push(newSegment(finalText, true)); + return false; + } + const moot = this.active?.segment === live && this.active.source !== finalText; + if (moot) this.abandonActive(); + if (!finalText || (this.active?.segment !== live && live.translatedSource === null && this.mergeIntoWaiting(finalText, live))) { + this.segments.pop(); + return moot; + } + live.source = finalText; + live.final = true; + return moot; } - /** Take the next segment to translate, or null while one is in flight or none waits. */ + /** Take the next request to make, or null while one is in flight or nothing waits. */ nextJob(): TranslationJob | null { - if (this.segments.some((segment) => segment.state === "translating")) return null; - const segment = this.segments.find((candidate) => candidate.state === "pending"); + if (this.active) return null; + const segment = this.segments.find((candidate) => wantsTranslation(candidate)); if (!segment) return null; - segment.state = "translating"; - return { segment, context: this.contextBefore(segment) }; + segment.streaming = ""; + this.active = { segment, source: segment.source, context: this.contextBefore(segment) }; + return this.active; } - progress(segment: TranslationSegment, textSoFar: string): void { - if (segment.state === "translating") segment.translation = textSoFar; + isActive(job: TranslationJob): boolean { + return this.active === job; } - complete(segment: TranslationSegment, translation: string): void { - segment.translation = translation; - segment.state = "done"; + /** Streamed text for the request in flight; false when `job` isn't it any more. */ + progress(job: TranslationJob, textSoFar: string): boolean { + if (this.active !== job) return false; + job.segment.streaming = textSoFar; + return true; } - fail(segment: TranslationSegment): void { - segment.translation = ""; - segment.state = "failed"; + complete(job: TranslationJob, translation: string): void { + if (this.active !== job) return; + this.active = null; + job.segment.streaming = null; + job.segment.translation = translation; + job.segment.translatedSource = job.source; + } + + fail(job: TranslationJob): void { + if (this.active !== job) return; + this.active = null; + job.segment.streaming = null; + job.segment.failedSource = job.source; + } + + private abandonActive(): void { + if (this.active) this.active.segment.streaming = null; + this.active = null; + } + + /** + * Append a final to the block before `before` (default: the end) when that + * block is final but still waiting for its first request. Returns whether + * it did. + */ + private mergeIntoWaiting(finalText: string, before?: TranslationSegment): boolean { + const index = (before ? this.segments.indexOf(before) : this.segments.length) - 1; + const waiting = this.segments[index]; + if (!waiting?.final || waiting.translatedSource !== null || waiting.failedSource !== null) return false; + if (this.active?.segment === waiting) return false; + waiting.source = `${waiting.source} ${finalText}`; + return true; } private contextBefore(segment: TranslationSegment): TranslationTurn[] { @@ -87,7 +162,7 @@ export class TranslationModel { let chars = 0; for (let index = this.segments.indexOf(segment) - 1; index >= 0 && turns.length < CONTEXT_TURNS; index--) { const earlier = this.segments[index]!; - if (earlier.state !== "done" || !earlier.translation) continue; + if (!earlier.final || earlier.translatedSource !== earlier.source || !earlier.translation) continue; chars += earlier.source.length + earlier.translation.length; if (turns.length && chars > CONTEXT_CHARS) break; turns.unshift({ source: earlier.source, translation: earlier.translation }); @@ -96,9 +171,11 @@ export class TranslationModel { } /** - * Display lines: each segment's translation, bright; its original, dim, - * above it when `showOriginal` is on and in its place until a translation - * arrives (or when it failed); then the live partial, dimmer. + * Display lines: each block's translation, bright once settled (final, and + * of its final text) and dimmer while provisional; its original, dim, above + * it when `showOriginal` is on and in its place until a translation + * arrives. A redo streams in over the translation it replaces only once it + * is as long, so the text doesn't shrink and regrow. */ lines(measure: (text: string) => number, maxWidth: number, showOriginal: boolean): TranslationLine[] { const lines: TranslationLine[] = []; @@ -106,21 +183,25 @@ export class TranslationModel { for (const line of wrapTranscribeText(measure, text, maxWidth)) lines.push({ text: line, gray }); }; for (const segment of this.segments) { - const translation = segment.translation.trim(); - // A finished, empty translation is noise the model chose to drop. - if (showOriginal || (!translation && segment.state !== "done")) push(segment.source, ORIGINAL_GRAY); - if (translation) push(translation, TRANSLATION_GRAY); + if (!segment.source) continue; + const settled = segment.final && segment.translatedSource === segment.source; + const finished = segment.translation.trim(); + const streaming = segment.streaming?.trim() ?? ""; + const translation = streaming.length >= finished.length ? streaming : finished; + // A settled, empty translation is noise the model chose to drop. + if (showOriginal || (!translation && !settled)) push(segment.source, segment.final ? ORIGINAL_GRAY : LIVE_GRAY); + if (translation) push(translation, settled ? TRANSLATION_GRAY : PROVISIONAL_GRAY); } - if (this.live) push(this.live, LIVE_GRAY); return lines; } - /** Plain-text transcript for saving: each original, then its translation. */ + /** Plain-text transcript for saving: each final original, then its translation. */ savedText(): string { return this.segments + .filter((segment) => segment.final) .map((segment) => { const translation = segment.translation.trim(); - if (segment.state === "failed") return `${segment.source}\n→ (not translated)`; + if (!translation && segment.failedSource === segment.source) return `${segment.source}\n→ (not translated)`; if (!translation || translation === segment.source.trim()) return segment.source; return `${segment.source}\n→ ${translation}`; }) diff --git a/app/apps/weather/weather.ts b/app/apps/weather/weather.ts index d6c1e2af..156bcb55 100644 --- a/app/apps/weather/weather.ts +++ b/app/apps/weather/weather.ts @@ -6,6 +6,7 @@ import { GESTURE_CLICK, type InputEvent } from "../../ui/gestures"; import { type Layer, type LayerContext } from "../../ui/layers"; import { Menu, type MenuDrawArgs } from "../../ui/menu-core"; import { centeredTextY, lineStep, tightRowHeight } from "../../ui/metrics"; +import { distanceUnitSetting } from "../../ui/dashboard-settings"; import { renderWeatherIcon } from "./weather-icons"; import { formatTemperature, widestTemperatureSample } from "./temperature-format"; @@ -142,7 +143,7 @@ export class WeatherLayer implements Layer { const details: string[] = []; if (current.humidityPercent !== null) details.push(`Humidity ${Math.round(current.humidityPercent)}%`); if (current.windSpeedMph !== null) { - details.push(`Wind ${current.windDirection ? `${current.windDirection} ` : ""}${Math.round(current.windSpeedMph)} mph`); + details.push(`Wind ${current.windDirection ? `${current.windDirection} ` : ""}${formatWindSpeed(current.windSpeedMph)}`); } image.drawText(small, textX, cy, details.join(" ") || "Current forecast", 170); cy += lineStep(small); @@ -247,6 +248,11 @@ function forecastRowHeight(font: UiFont): number { return Math.max(FORECAST_MIN_ROW_HEIGHT, tightRowHeight(font) + 3); } +/** A wind speed (weather data is kept in mph) in the Distance unit setting's speed unit: "12 mph" / "19 km/h". */ +function formatWindSpeed(mph: number): string { + return distanceUnitSetting.get() === "kilometers" ? `${Math.round(mph * 1.609344)} km/h` : `${Math.round(mph)} mph`; +} + function formatAge(ageMs: number): string { const minutes = Math.max(0, Math.round(ageMs / 60_000)); if (minutes < 1) return "just now"; diff --git a/app/assistant/direct-backend.ts b/app/assistant/direct-backend.ts index 20c6b2e6..766a6237 100644 --- a/app/assistant/direct-backend.ts +++ b/app/assistant/direct-backend.ts @@ -1,7 +1,8 @@ import { streamAnthropicMessage } from "../native/anthropic"; import { streamHermesChat } from "../native/hermes"; -import { streamLocalQwen } from "../native/llama"; +import { streamLocalModel } from "../native/local-llm"; import { streamOpenAiResponse } from "../native/openai"; +import { streamOpenAiCompatibleChat } from "../native/openai-chat"; import type { LlmContentBlock, LlmMessage, @@ -40,6 +41,8 @@ export type DirectTurnOptions = { effort?: "low" | "medium" | "high"; /** Hermes: the API root, and the server-side session this conversation maps to. */ baseUrl?: string; + /** Venice-only web search for this interactive turn. */ + webSearch?: boolean; sessionId?: string; system: string; /** Owned by the session; this loop appends assistant + tool_result messages. */ @@ -85,11 +88,12 @@ export class DirectAssistantBackend { return; } - const streamOptions: LlmStreamOptions = { + const streamOptions: LlmStreamOptions & { webSearch?: boolean } = { apiKey: options.apiKey, model: options.model, system: options.system, effort: options.effort, + webSearch: options.webSearch, messages: options.messages, // Hermes runs its own tools; Faceclaw's are not offered to it. tools: options.provider === "hermes" ? [] : options.buildTools(), @@ -143,10 +147,12 @@ export class DirectAssistantBackend { streamHandle = options.provider === "hermes" ? streamHermesChat({ ...streamOptions, baseUrl: options.baseUrl ?? "", sessionId: options.sessionId ?? "" }) + : options.provider === "openai-compatible" + ? streamOpenAiCompatibleChat({ ...streamOptions, baseUrl: options.baseUrl ?? "" }) : options.provider === "openai" ? streamOpenAiResponse(streamOptions) : options.provider === "local" - ? streamLocalQwen(streamOptions) + ? streamLocalModel(streamOptions) : streamAnthropicMessage(streamOptions); }; diff --git a/app/assistant/llm-protocol.ts b/app/assistant/llm-protocol.ts index e351c90f..edca9b3d 100644 --- a/app/assistant/llm-protocol.ts +++ b/app/assistant/llm-protocol.ts @@ -15,7 +15,7 @@ export type LlmContentBlock = } | { type: "tool_result"; tool_use_id: string; content: string; is_error?: boolean } /** Opaque state required to continue a provider's stateless conversation. */ - | { type: "provider_item"; provider: "openai"; item: any }; + | { type: "provider_item"; provider: "openai" | "openai-compatible"; item: any }; export type LlmMessage = { role: "user" | "assistant"; diff --git a/app/assistant/models.ts b/app/assistant/models.ts index 567de0ad..67944dfc 100644 --- a/app/assistant/models.ts +++ b/app/assistant/models.ts @@ -1,4 +1,5 @@ -import { isLocalModelReady, LOCAL_MODEL } from "../native/llama"; +import { isLocalModelReady, isLocalModelSupported, LOCAL_MODEL } from "../native/local-llm"; +import { isVeniceApiBaseUrl } from "../native/openai-chat"; export const ASSISTANT_MODEL_VALUES = [ "auto", @@ -11,17 +12,23 @@ export const ASSISTANT_MODEL_VALUES = [ "sol", "qwen", "hermes", + "openai-compatible", ] as const; +/** + * "qwen" is the on-phone model, whatever it is on this platform: Qwen3-4B on + * Android, the Apple Intelligence system model on iOS (the ID predates iOS + * support and stays for saved settings and conversations). + */ export type AssistantModel = (typeof ASSISTANT_MODEL_VALUES)[number]; /** Keep saved model IDs portable, while offering only supported choices. */ export const ASSISTANT_MODEL_CHOICES: readonly AssistantModel[] = - global.isIOS ? ASSISTANT_MODEL_VALUES.filter(value => value !== "qwen") : ASSISTANT_MODEL_VALUES; + isLocalModelSupported() ? ASSISTANT_MODEL_VALUES : ASSISTANT_MODEL_VALUES.filter(value => value !== "qwen"); export function supportedAssistantModel(value: AssistantModel): AssistantModel { - return global.isIOS && value === "qwen" ? "auto" : value; + return value === "qwen" && !isLocalModelSupported() ? "auto" : value; } -export type AssistantProvider = "anthropic" | "openai" | "local" | "hermes"; +export type AssistantProvider = "anthropic" | "openai" | "local" | "hermes" | "openai-compatible"; export type AssistantApiKeys = { anthropic: string; @@ -29,6 +36,11 @@ export type AssistantApiKeys = { /** A Hermes Agent API server; only the voice assistant passes these. */ hermesUrl?: string; hermesKey?: string; + openAiCompatibleUrl?: string; + openAiCompatibleKey?: string; + openAiCompatibleModel?: string; + /** Venice web search, applied only when the resolved root is Venice. */ + veniceWebSearch?: boolean; }; export type ResolvedAssistantModel = { @@ -37,8 +49,10 @@ export type ResolvedAssistantModel = { model: string; apiKey: string; effort?: "low" | "medium" | "high"; - /** API root for providers that are not fixed services (Hermes). */ + /** API root for Hermes or an OpenAI-compatible provider. */ baseUrl?: string; + /** Whether Venice web search is enabled for this interactive assistant turn. */ + webSearch?: boolean; }; type ModelDefinition = { @@ -58,11 +72,13 @@ const MODEL_DEFINITIONS: Record, ModelDefinition luna: { label: "Luna", provider: "openai", model: "gpt-5.6-luna", effort: "low" }, terra: { label: "Terra", provider: "openai", model: "gpt-5.6-terra", effort: "low" }, sol: { label: "Sol", provider: "openai", model: "gpt-5.6-sol", effort: "low" }, - // Runs on the phone itself (llama.cpp); needs the downloaded model file, - // not an API key. The default for users who haven't set any key. + // Runs on the phone itself (Android: llama.cpp with the downloaded model + // file; iOS: Apple Intelligence), not an API key. The default for users who + // haven't set any key. qwen: { label: `${LOCAL_MODEL.label} (on-phone)`, provider: "local", model: LOCAL_MODEL.id }, // Your own Hermes Agent (its API server), with its own tools and memory. hermes: { label: "Hermes agent", provider: "hermes", model: "hermes-agent" }, + "openai-compatible": { label: "OpenAI-compatible", provider: "openai-compatible", model: "custom" }, }; export function assistantModelLabel(value: AssistantModel): string { @@ -76,8 +92,8 @@ export function assistantModelProvider(value: AssistantModel): AssistantProvider /** * Resolve Auto and attach the credential needed by the chosen provider. * Auto intentionally prefers Terra over Sonnet when both keys are available, - * and falls back to the on-phone model when no key is set but the model file - * has been downloaded. + * and falls back to the on-phone model when no key is set but that model is + * ready (downloaded on Android; Apple Intelligence on and ready on iOS). */ export function resolveAssistantModel( selection: AssistantModel, @@ -106,6 +122,19 @@ export function resolveAssistantModel( if (!baseUrl) return null; return { selection, provider: "hermes", model: definition.model, apiKey: keys.hermesKey?.trim() ?? "", baseUrl }; } + if (definition.provider === "openai-compatible") { + const baseUrl = keys.openAiCompatibleUrl?.trim() ?? ""; + const model = keys.openAiCompatibleModel?.trim() ?? ""; + if (!baseUrl || !model) return null; + return { + selection, + provider: definition.provider, + model, + apiKey: keys.openAiCompatibleKey?.trim() ?? "", + baseUrl, + webSearch: isVeniceApiBaseUrl(baseUrl) && keys.veniceWebSearch === true, + }; + } if (definition.provider === "local") { if (!isLocalModelReady()) return null; return { diff --git a/app/assistant/session.ts b/app/assistant/session.ts index 148d5e79..c64e5983 100644 --- a/app/assistant/session.ts +++ b/app/assistant/session.ts @@ -95,14 +95,20 @@ export class AssistantSession { // original model. Preserve visible conversation when switching engines. if (this.config.kind !== config.kind || (this.config.kind === "direct" && config.kind === "direct" && - (this.config.llm.model !== config.llm.model || this.config.llm.provider !== config.llm.provider))) { + (this.config.llm.model !== config.llm.model || this.config.llm.provider !== config.llm.provider || + (this.config.llm.baseUrl ?? "") !== (config.llm.baseUrl ?? "")))) { this.rebuildTextHistory(); } this.config = config; } private engine(): string { - return this.config.kind === "direct" ? `${this.config.llm.provider}:${this.config.llm.model}` : "external"; + if (this.config.kind !== "direct") return "external"; + const llm = this.config.llm; + // Keep the legacy engine ID for built-in providers so upgrading does not + // discard their opaque history. Custom endpoints need endpoint isolation. + const endpoint = llm.provider === "openai-compatible" ? `:${llm.baseUrl ?? ""}` : ""; + return `${llm.provider}:${llm.model}${endpoint}`; } private rebuildTextHistory(): void { @@ -192,6 +198,7 @@ export class AssistantSession { model: llm.model, effort: llm.effort, baseUrl: llm.baseUrl, + webSearch: llm.webSearch, sessionId: this.hermesSessionId, system: llm.provider === "hermes" ? HERMES_SYSTEM_PROMPT : isLocal ? ASSISTANT_SYSTEM_PROMPT_BASE : buildAssistantSystemPrompt(ctx), diff --git a/app/assistant/system-tools.ts b/app/assistant/system-tools.ts index 9baacf56..4e3f17f3 100644 --- a/app/assistant/system-tools.ts +++ b/app/assistant/system-tools.ts @@ -1,6 +1,7 @@ import { readUpcomingEventsAsync, type CalendarEvent } from "../native/calendar"; import { hasCalendarPermission } from "../native/calendar-permissions"; import { mediaControllerBridge } from "../native/media-controller"; +import { spotifyService } from "../native/spotify"; import { dismissNotification, readActiveNotifications } from "../native/notification-icons"; import { shell } from "../ui/shell/shell"; import { toolRegistry, type ToolRegistry, type ToolResult } from "./tool-registry"; @@ -93,7 +94,11 @@ export function registerSystemTools(registry: ToolRegistry = toolRegistry): void inputSchema: { type: "object", properties: {}, additionalProperties: false }, proactive: true, }, - () => ok(describeNowPlaying()), + async () => { + // Spotify's state is polled only while something shows it. + await mediaControllerBridge.refresh?.(); + return ok(describeNowPlaying()); + }, ); registry.registerSystemTool( @@ -103,6 +108,7 @@ export function registerSystemTools(registry: ToolRegistry = toolRegistry): void inputSchema: { type: "object", properties: {}, additionalProperties: false }, }, async () => { + await mediaControllerBridge.refresh?.(); const state = mediaControllerBridge.snapshot(); if (!state.canPlayPause) return err("No media session can be controlled right now."); await mediaControllerBridge.playPause(); @@ -117,6 +123,7 @@ export function registerSystemTools(registry: ToolRegistry = toolRegistry): void inputSchema: { type: "object", properties: {}, additionalProperties: false }, }, async () => { + await mediaControllerBridge.refresh?.(); const state = mediaControllerBridge.snapshot(); if (!state.canSkipNext) return err("The current media session can't skip to the next track."); await mediaControllerBridge.skipNext(); @@ -124,6 +131,45 @@ export function registerSystemTools(registry: ToolRegistry = toolRegistry): void }, ); + const spotify = spotifyService(); + if (spotify) { + registry.register({ + spec: { + name: "media.spotify_play", + description: + "Search Spotify and start playing the best match on the user's Spotify (this phone or another of their Spotify devices). Use for requests like \"play Daft Punk\" (artist), \"play the album Discovery\" (album) or \"play Harder Better Faster Stronger\" (track).", + inputSchema: { + type: "object", + properties: { + query: { type: "string", description: "What to search for, e.g. an artist, album, song or playlist name." }, + kind: { + type: "string", + enum: ["track", "album", "artist", "playlist"], + description: "What kind of thing to play (default track).", + }, + }, + required: ["query"], + additionalProperties: false, + }, + availability: "always", + // Search, then play (with a device lookup when none is active). + timeoutMs: 20_000, + }, + handler: async (args) => { + const query = String(args?.query ?? "").trim(); + if (!query) return err("media.spotify_play requires a query"); + const kind = ["track", "album", "artist", "playlist"].includes(args?.kind) ? args.kind : "track"; + try { + return ok(`Playing ${await spotify.playSearch(query, kind)} on Spotify.`); + } catch (error) { + return err(String((error as Error)?.message ?? error)); + } + }, + // Offered once signed in from the Music app menu. + isAvailable: () => spotify.account() !== null, + }); + } + // Android notification tools are still platform-specific. if (global.isIOS) return; @@ -198,8 +244,8 @@ function formatEvent(event: CalendarEvent): string { return `- ${event.title || "(untitled)"} — ${when}${location}`; } -function formatNotification(notification: { key: string; appName: string; title: string; text: string }): string { - const title = notification.title || "(no title)"; +function formatNotification(notification: { key: string; appName: string; title: string; text: string; customText?: string[] }): string { + const title = notification.title || notification.customText?.join(" ") || "(no title)"; const body = notification.text ? `: ${notification.text}` : ""; return `- [${notification.appName}] ${title}${body} (key: ${notification.key})`; } diff --git a/app/g2/dashboard-controller.ts b/app/g2/dashboard-controller.ts index 0d24ecf4..6021c118 100644 --- a/app/g2/dashboard-controller.ts +++ b/app/g2/dashboard-controller.ts @@ -76,9 +76,9 @@ import { type AppContext, type AppDefinition, type AppLaunchParams, type TextEdi import { type InProcessAppOptions, type InProcessWindow } from "../ui/shell/in-process-window"; import { loadPersistedOpenApps, savePersistedOpenApps } from "../ui/shell/open-apps-persistence"; import { appViewportRect, isOnSwitcherEdge, sidebarStripVisible, type ScreenRect, type WindowHeightMode } from "../ui/shell/geometry"; -import { type ContinuousCaptureOptions, type LayerActions, type TextSettingsEditToggle } from "../ui/layers"; +import { type ContinuousCaptureOptions, type LayerActions, type TextSettingsEditToggle, type TranscriptionChoice } from "../ui/layers"; import { type KeyboardInputSession } from "../ui/shell/keyboard-input"; -import { appSwitcherPositionSetting, statusBarPositionSetting, statusBarVisibilitySetting, windowBorderSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayLayoutSetting, navigateDisplayLayoutSetting, terminalDisplayLayoutSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, whisperServerApiKeySetting, whisperServerLanguageSetting, whisperServerModelSetting, whisperServerUrlSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, ringConnectionModeSetting, type RingConnectionMode, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString, type VoiceProvider } from "../ui/dashboard-settings"; +import { appSwitcherPositionSetting, statusBarPositionSetting, statusBarVisibilitySetting, windowBorderSetting, assistantAllowProactiveSetting, assistantBackendSetting, assistantBridgeHostSetting, assistantBridgePortSetting, assistantBridgeTokenSetting, getBrightnessPreferences, displayLayoutSetting, navigateDisplayLayoutSetting, terminalDisplayLayoutSetting, elevenLabsApiKeySetting, getStringSettingById, openAiApiKeySetting, nightscoutApiTokenSetting, firmwareDebugFlagsSetting, whisperServerApiKeySetting, whisperServerLanguageSetting, whisperServerModelSetting, whisperServerUrlSetting, lockScreenEnabledSetting, nightscoutSiteUrlSetting, onAnySettingChanged, previewColorSetting, ringConnectionModeSetting, type RingConnectionMode, saveVoiceRecordingsSetting, sonioxApiKeySetting, screenTimeoutSetting, screenTimeoutSettingToMs, suspendEvenHubWhenScreenOffSetting, voiceProviderSetting, wakeWordActionSetting, type ConfigSettingString } from "../ui/dashboard-settings"; import { isIgnoringBatteryOptimizations, requestIgnoreBatteryOptimizations } from "../native/battery-optimization"; import { getInstalledEvenHubAppById, @@ -126,12 +126,10 @@ export type DashboardSnapshot = { activeTextEditorToggleValue: boolean; activeTextEditorToggleVisible: boolean; /** - * The keyboard dialog is up on the glasses (opened by the phone's keyboard - * button): the phone shows its typing panel, with a send button per - * destination in the glasses menu's row order. + * The keyboard dialog is open (opened by the phone's keyboard button): the + * phone shows its typing panel, driven by keyboardInputSession. */ keyboardInputActive: boolean; - keyboardInputTargets: ReadonlyArray<{ id: string; label: string }>; evenAppConflictMessage: string; evenAppConflictWarningVisible: boolean; firmwareWarningMessage: string; @@ -1148,7 +1146,6 @@ class DashboardController { activeTextEditorToggleValue: this.activeTextEditorToggle?.setting.get() ?? false, activeTextEditorToggleVisible: this.activeTextEditorToggle !== null, keyboardInputActive: this.keyboardInput !== null, - keyboardInputTargets: this.keyboardInput?.targets ?? [], evenAppConflictMessage: this.evenAppConflictMessage, evenAppConflictWarningVisible: this.evenAppConflictMessage.length > 0, firmwareWarningMessage: this.firmwareWarningMessage, @@ -1347,23 +1344,9 @@ class DashboardController { shell.startKeyboardInput(); } - /** The phone's typing panel changed: mirror the text on the glasses. */ - setKeyboardInputText(text: string): void { - shell.noteUserActivity(); - this.keyboardInput?.setText(text); - } - - /** Send to one destination, or (no id: the IME's send key) the one highlighted on the glasses. */ - sendKeyboardInput(targetId?: string): void { - if (targetId) { - this.keyboardInput?.sendTo(targetId); - } else { - this.keyboardInput?.send(); - } - } - - discardKeyboardInput(): void { - this.keyboardInput?.discard(); + /** The open keyboard dialog, for the phone's typing panel (KeyboardInputViewModel). */ + get keyboardInputSession(): KeyboardInputSession | null { + return this.keyboardInput; } setActiveTextEditorToggleValue(value: boolean): void { @@ -2150,10 +2133,10 @@ class DashboardController { voiceControlBridge.retargetContinuousCapture(this.voiceCaptureOptions(this.communicator)); } - /** The provider a continuous-capture window needs (Translate's multilingual one), if any. */ - private multilingualProvider(): VoiceProvider | undefined { + /** The provider and language a continuous-capture window needs (Translate's), if any. */ + private transcriptionChoice(): TranscriptionChoice | undefined { for (const options of this.continuousClients.values()) { - if (options.multilingualProvider) return options.multilingualProvider; + if (options.transcription) return options.transcription; } return undefined; } @@ -2178,20 +2161,21 @@ class DashboardController { * stands in for the G2 mic. */ private voiceCaptureOptions(communicator: FaceclawCommunicatorBridge | null) { - // A window that needs a multilingual provider sets it for every capture - // while it is open, so push-to-talk still shares its stream. - const multilingual = this.multilingualProvider(); + // A window that needs its own provider and language sets them for every + // capture while it is open, so push-to-talk still shares its stream. + // Otherwise only Whisper server is told a language (its own setting). + const choice = this.transcriptionChoice(); + const provider = choice?.provider ?? voiceProviderSetting.get(); return { communicator: communicator?.getNativeCommunicator() ?? null, usePhoneMic: communicator === null, - provider: multilingual ?? voiceProviderSetting.get(), + provider, + language: choice ? choice.language : provider === "whisper-server" ? whisperServerLanguageSetting.get() : "", elevenLabsApiKey: elevenLabsApiKeySetting.get(), openAiApiKey: openAiApiKeySetting.get(), sonioxApiKey: sonioxApiKeySetting.get(), whisperServerUrl: whisperServerUrlSetting.get(), whisperServerModel: whisperServerModelSetting.get(), - // Whisper detects the language itself when the speech may be in any. - whisperServerLanguage: multilingual ? "" : whisperServerLanguageSetting.get(), whisperServerApiKey: whisperServerApiKeySetting.get(), saveRecording: saveVoiceRecordingsSetting.get(), // "My voice only" (Microphones app): verify command utterances diff --git a/app/g2/firmware-compat.ts b/app/g2/firmware-compat.ts index 147af2ca..71ee5c91 100644 --- a/app/g2/firmware-compat.ts +++ b/app/g2/firmware-compat.ts @@ -26,7 +26,7 @@ export type FirmwareInfo = { }; /** The Faceclaw firmware revision this build of the app needs. */ -export const REQUIRED_FACECLAW_FIRMWARE_VERSION = 37; +export const REQUIRED_FACECLAW_FIRMWARE_VERSION = 38; const FACECLAW_PREFIX = "Faceclaw/"; const LEGACY_PREFIX = "EVENCFW"; @@ -36,7 +36,7 @@ const LEGACY_PREFIX = "EVENCFW"; // unrecognized (its layout may differ from what our patch set targets). export const BASE_STOCK_VERSION = [2, 3, 0, 24]; export const BASE_STOCK_VERSION_TEXT = BASE_STOCK_VERSION.join("."); -export const VALIDATED_STOCK_VERSION = [2, 3, 2, 14]; +export const VALIDATED_STOCK_VERSION = [2, 4, 0, 24]; export const VALIDATED_STOCK_VERSION_TEXT = VALIDATED_STOCK_VERSION.join("."); export type FirmwareExtension = diff --git a/app/g2/firmware/cfw-patches.ts b/app/g2/firmware/cfw-patches.ts index 9a34aa95..86f17ae6 100644 --- a/app/g2/firmware/cfw-patches.ts +++ b/app/g2/firmware/cfw-patches.ts @@ -19,12 +19,12 @@ export type FirmwarePatchSet = { export const CFW_PATCH_SET: FirmwarePatchSet = { "base": "g2_2.3.0.24.bin", "baseSha256": "187ccf2bcc5c17a212106e8a376745511e8289c4232b634a7ea94b9bf25a0979", - "outputSha256": "90b932552e987fc554e6f748e50989503aaff0a93a3915702eacd96e3bd99e9b", + "outputSha256": "4aac023f49ec6965186d9106e328a516f20a2915ab400d561f662f984023a432", "patches": [ { "offset": 1045797, "old": "38b584b0", - "new": "5cf377bb", + "new": "5cf371bb", "desc": "ring receiver entry: timestamped unfiltered reports under framebuffer lease" }, { @@ -36,43 +36,43 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 1437923, "old": "fef788ff", - "new": "fdf292f8", + "new": "fdf2a2f8", "desc": "cfw_ancs_event" }, { "offset": 1437951, "old": "fef7e8fb", - "new": "fcf2c0fd", + "new": "fcf2d0fd", "desc": "cfw_ancs_open" }, { "offset": 1437969, "old": "fef7e7fb", - "new": "fcf2dbfd", + "new": "fcf2ebfd", "desc": "cfw_ancs_close" }, { "offset": 1388387, "old": "39694d00", - "new": "05597d00", + "new": "25597d00", "desc": "connection-bound ANCS EUS write callback" }, { "offset": 971497, "old": "fff717f8", - "new": "6ef3a7fc", + "new": "6ef3a1fc", "desc": "bl faceclaw_input_bridge_received (ring relay and ordered private transport before worker pool)" }, { "offset": 971845, "old": "fef769ff", - "new": "6ef3f9fb", + "new": "6ef3f3fb", "desc": "bl faceclaw_input_bridge_received (ring relay and ordered private transport before worker pool)" }, { "offset": 979579, "old": "fdf74ef8", - "new": "6cf3defc", + "new": "6cf3d8fc", "desc": "bl faceclaw_input_bridge_received (ring relay and ordered private transport before worker pool)" }, { @@ -99,6 +99,12 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { "new": "a325", "desc": "_connectParamReq_impl: force requested mode to fast (0xa3); disables idle slow requests" }, + { + "offset": 1058287, + "old": "fff754fb", + "new": "59f342fb", + "desc": "bl ble_classify_link (only a <= 11.25 ms / latency-0 link is 'already fast')" + }, { "offset": 1130227, "old": "5ff43432", @@ -132,31 +138,31 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 975103, "old": "07f085fb", - "new": "6df3acfc", - "desc": "bl headup_gate (head-up sensor event -> EvenHub sys event 12 under lease)" + "new": "6df3a6fc", + "desc": "bl headup_gate (idle input gate: tap/long/release -> field-102 events, stock result kept)" }, { "offset": 830549, "old": "19f03efb", - "new": "90f35bfe", - "desc": "bl gesture_ring_press_mode (observe ring touch-down, preserve stock dispatch)" + "new": "90f37bfe", + "desc": "bl gesture_ring_press_mode (ring touch-down 14, head up 12 / down 15; stock dispatch preserved)" }, { "offset": 830795, "old": "1ff071ff", - "new": "90f314fe", + "new": "90f334fe", "desc": "bl gesture_press (owned event 9 before stock menu gate)" }, { "offset": 830887, "old": "1ff043ff", - "new": "90f30efe", + "new": "90f32efe", "desc": "bl gesture_short_long (Faceclaw lease gates event 11 vs stock Menu path)" }, { "offset": 831763, "old": "1ff08dfd", - "new": "90f344fc", + "new": "90f364fc", "desc": "bl gesture_release (owned event 10 before stock menu gate)" }, { @@ -210,43 +216,43 @@ export const CFW_PATCH_SET: FirmwarePatchSet = { { "offset": 4537963, "old": "", - "new": "b0b581ea00039b0701d0034637e0c2b110f0030315d000f1010ca2f1010e0023cc5c9e45c45403f1010404d0634413f003032346f4d121440319121b102a14d302e00346102a10d3d1f800c0d1f804e0cc688d68103adc609d60c3f804e043f810cb0f2a01f11001eed8042a07d300bf51f8045b043a032a43f8045bf8d8002a08bfb0bd0139013b11f8015f013a03f8015ff9d1b0bd00bf884218bf002a00d1704710b50b1a38bf431a934207d288420ad281ea00039b0726d0034669e0fff79fffbde81040704781ea000300eb020c9b0701eb020e42d15fea8c732bd0a0f1010c00bf8b1813f801ec8418531e04f801ec04d0624412f003021a46f2d101eb030e00eb030c17e0830736d0a2f1010c00f1010e002300bfcc5c9c45c45403f1010404d0734413f003032346f4d1121b2144031922e01346042b0ed3aef10402acf1040152f80449043b032b41f80449f8d802f1040e01f1040c1a4653b1aef10101acf1010300bf11f80149013a03f80149f9d1bde8104070470346042a06d351f8044b043a032a43f8044bf8d8002af0d00139013b00bf11f8014f013a03f8014ff9d1e6e700bf80b5002a18bf10f0030301d186460ce000f1010c864600bf013a0ef8011b04d01cf003030cf1010cf6d1102a11d35ffa81fc4ff001330cfb03fc00bf103acef80cc0cef808c0cef804c04ef810cb0f2af4d8042a0bd35ffa81fc4ff001330cfb03fc00bf043a032a4ef804cbfad8002a08bf80bdaef10103013a03f8011ffbd180bd00bf2de9f04fc7b04ff29c5bc2f2290b4ff6ff754ff47d7400274ff0010847f67f7a7f261191cde90f3007e000bf48f2a351c0f24501bff32f8f8847dbf80090bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14068b0f57d7f00f096804ff47d7006f004fd002800f0cb814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff010160446080f80e80a0f8c4a180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001f49457ff452afbff35f8f4be8000121b15be8001f4945f8d047e74ff47d7800274ff0010a47f67f797f2607e000bf48f2a351c0f24501bff32f8f8847dbf80040bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f098804ff47d7006f042fc002800f009814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff010160c0f8048080f80ea0a0f8c49180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001fa1427ff451afbff35f8f00bf4be8000121b15be8001fa142f8d045e7d0f8948242f6f76ac0f2440ab8f1000fbff35f8f4ad00af19a0240464ff0ff314ff0ff379047002840f090811198002861d010980778a7f1170002285bd811980c2840f07d81109c6078a178084300f07781e0780138022800f27281a279e379667a42ea0322237a207942ea034242ea0663a27ae67a6179192f42ea062200f0de81172f40f0f481002a40f05981fe2800f0b086812800f0a386002840f0b68651ea030040f04c8100f000bf04460020d047e8b104f5257151e8008fb8f1000f0cd1bff35f8f00bf41e80002002a00f0e58051e8008fb8f1000ff5d00021bff32f8f0029bff35f8f00f0d480804692e74ff0ff372ae147f6df40c0f24f00cdf83880804700274ff47d784ff0010947f67f744ff07f0a1397adf8507007e000bf48f2a351c0f24501bff32f8f8847dbf80060bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f09f804ff47d7006f0f8fa002800f097804ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff010160c0f8048080f80e90a0f8c44180f8c3a1058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb1427ff451afbff35f8f00bf4be8000159b15be8001fb142f8d045e70af5a9718847bce6012120e70020109f42f6f76addf83880c0f2440a9fb1119989b1397801f07f02b2f10b0418bf0124b2f11c0618bf01268a2924dc0b2926d01c2924d03ce00f9012a803f045ff4ff0ff3701249df85100002812a818bf4ff0ff3704f05ff8054644b99df8500028b94af21f30c0f247004c3080470f98002818bf056114e09c2901d08b2918d168b14af21f31c0f247010746884797f8681121b997f824133846109f49b14ff0ff370af5807140468847384647b0bde8f08f0f9012a8344003f007ff387800f07f061e2e05d11199384607f084fe0746b9e71d2e00f07e0018bf1a2819d1dbf800100322cff680720a40b2f1005fbff35f8f12d10a684ef66c63ccf2ff039a420bd14a68b2f57d7f04bf002281f8a12303e0a6f115010129e1d90f2e2cdd142e40f31082152e00f05d83162e00f069831f2e40f02c841198012840f0fc8438781f2840f0f88445f64d55c0f24605a847012841f0828140f22c71c0f2010105f5e2777944e02029220023b8470746002818bf4ff0ff3766e7092e00f3fe80052e00f03e82072e40f0028400274ff0010947f67f764ff07f080d943ae000294ff0ff3708bf002b7ff47caf1328bff479af102a4ff0000138bf01211228b2fa82f218bf510901297ff46caf00f01ebd182f4ff0ff3708bf00297ff463af002b7ff460af352800f30884002800f0f684012800f00285312840f0f484082abff451af00f003bd48f2a351c0f24501bff32f8f8847dbf80040bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f05a864ff47d7006f035f9002800f052864ff60c41cff6ff7142182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff0101604ff47d71416080f80e90a0f8c46180f8c381058445848584c584058545858585c585058645868586c586058745878587c5875be8001fa1427ff451afbff35f8f4be80001002900f0c6855be8001fa142f6d044e70a2e00f00a820b2e40f00483dbf800500320cff680702840b0f1005fbff35f8f41f05e8028684ef66c61ccf2ff01884241f0568068680027b0f57d7f7ff446aed5f8900342f68d49c0f244090028a5f8a07318bfc8470021a5f8d013c5f8cc13c5f86c1185f86a1185f86811d5f87001c5f8641185f86911c5f87011c5f82013a5f88c1320b148f2a351c0f245018847d5f89802002818bf03f0deff0026c5f89862d5f8880320b148f2a351c0f245018847c5f88863a5f88c63686ca5f8486040b1c847686c09f166018847002804bf002068644bf63940c0f251008047dbf800700320cff680703840b0f1005fbff35f8f48d138684ef66c61ccf2ff01884241d17868b0f57d7f3dd197f87b014ff00008c7f8848100b387f87b8197f8750149f259620138b0fa80f04109c0f2590240f20b1090474ef6e37610f1800fd8bf6ff07f00c0f25a067e28a8bf7e2087f8c401b04706f1bc008047d7f8880187f8748142f6f76addf83880c0f2440a50b1c847d7f8880109f166018847002804bf0020c7f88801dbf800000321cff680710140b1f1005fbff35f8f40f03b8701684ef66c62ccf2ff02914240f033874168b1f57d7f40f02e8790f8cc11002900f0238706f0cbfb00f025bf102e00f05581112e40f01f821198022840f0ef823878112840f0eb827878002840f0e78245f64d50c0f24600804701284ff000077ff465ad40f20830c0f210003790ff208df8d80044f25220c0f20100359040f2c960c0f24800cde93877804798b148f27e30c2f2070000880122c1b264298df8d72008d80721b0f5807f38bf03218df8d7108df8d80040f2d260adf8e000052037ae8df8e200f01d35a90522fff713f94ff22507c0f247070120092132460c23b847074600f0b9be11980d944ff47d7800244ff0010a47f67f797f2602282cbf7878ff200c9006e048f2a351c0f24501bff32f8f8847dbf80070bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f09f814ff47d7005f027ff002800f084844ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ef66c61ccf2ff010160c0f8048080f80ea0a0f8c49180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb9427ff452afbff35f8f4be80001002900f00c815be8001fb942f6d045e711980228c0f0cd8100f06ffe002800f0c8817e78002e00f08d83022e00f2c18140f0b585014611980628c0f03185109fb878fa783b797f7940ea022043ea072232283790389280f09a85322000f09dbd1199781c013907f04afb0746fff729bc1199384606f07ffb0746fff722bc119801380228c0f095817878b9784ff0ff3740ea0120b0f5007f3ff613ac0321119a01eb400191427ff40cac002700288df8dc708df8dd708df8de708df8df708df8e0708df8e1708df8e2708df8e3708df8e4708df8e5708df8e6708df8e7708df8e8708df8e9708df8ea708df8eb708df8ec708df8ed708df8ee708df8ef708df8f0708df8f1708df8f2708df8f3708df8f4708df8f5708df8f6708df8f7708df8f8708df8f9708df8fa708df8fb708df8fc708df8fd708df8fe708df8ff708df800718df801718df802718df803718df804718df805718df806718df807718df808718df809718df80a718df80b718df80c718df80d718df80e718df80f718df810718df811718df812718df813718df814718df815718df816718df817718df818718df819718df81a718df81b713ff488ab109937aa03314ff0010c4b78012b00f2f7800f7847ea0323db08d65c07f007070cfa07f7374240f0eb80d65c013847ea060701f10201d754e7d10d9404f04afe002800f06d844ff47d7800244ff0010a47f67f797f2608e31d2e60d11199781c013907f061ff0746fff752bb90f8481042f6f76addf83880109fdde90c64c0f2440a61b1416c39b142f68d42c0f244020546084690472846002180f848100121119a032a1ad3ceb9b878082800f23a854bf63941c0f25101963188470027fff727bb362800f00681462800f00081572840f0ec80002e7ff449abfbe0119a052ac0f0d580012e40f0d280b8783e46411e06294ff000073ff60babf17803293ff607ab3279002a3ff403ab4bf63943c0f2510303f59a7398470027fff7f9ba1a2818bf1c2e6cd104f0d5fd002868d000f00bfd814608f0eef9b9f1000f4ff0ff3718bf00283ff4e4aa834647f63400c2f20700d0f81806d9f894131b2ea0eb0100c9f89c0300f0a2831a2e40f0c383109900254f1c11994ff4f072a1f1010a4ff4a071cde93d5037a84ff420764ff48058cde90950cde901214846394652465b46cde937853f95cde90755cde90555cde90355009608f0eefc002840f09883d9f89c033946cde93e0537a80a90012009904ff4a07002904ff4f0700190484652465b464ff42077cde937853d95cde90755cde90555cde90355009708f0cbfc61e54ff0ff37fff784ba0c294ff0ff377ff4adaab3f5005f5dd3fff7a8ba481e1f284ff0ff373ff6a2aac1f51630834251d9fff79cba002b7ff497aa421f18bf0122b0f1350318bf01231a40b0f1590318bf01231a40b0f1470318bf0123134208bf012937d0b0f1370218bf0122b0f1c10318bf01231a4208bf02292bd09f284ff0ff377ff473aa042924d0fff76fba022e40f044814bf63940c0f2510080470027fff736ba022abff461aa13e0002a7ff45daaa0f1fd0102290cd397287ff456aa08e06ff0780002427ff450aa02e0402abff44caa45f64d50c0f24600804710990128c9784ff0010008bf022008424ff000073ff43baacdf838804ff47d7847f67f797f2406e048f2a351c0f24501bff32f8f8847dbf80060bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f096804ff47d7005f019fc002800f030814ff60c41cff6ff7142182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff0101600121c0f804808173a0f8c49180f8c341058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb1427ff452afbff35f8f4be8000121b15be8001fb142f8d047e74af21f35c0f247050446a84794f86801ddf83880109f00287ff46ba994f82403214600287ff465a93878172812d0d1f8840320b904f05ff9c4f8840360b342f68d41c0f24401a1f140024ff47a719047214608bb01f226300e4639460c22fef700fd0f98002186f825030120bff35f8f86f824034ff4f07001904ff4207005f5106600900020002200230027b04700283ff431a984f8247305f14c0080474ff0ff37fff728b9119a072ac0f05581032e40f05281b878fa783e4640ea022039797f79b57901284ff0010698bf304644f62062904228bf10464bf63942c0f2510202f5e272642928bf6421904747f63400c2f207000068002800f0d98247ea0521012988bf0e4642f68d41c0f24401a1f14002314690470027fff7bfb8002780f8477145f64d50c0f24600804701287ff4b4a843f2a310c0f2560080470746fff7acb8ddf838804ff0ff37fff7d4b800201199dde90d48022910992cbf4978ff21002800f0a48202294ff000072cd0012926d000297ff491a84cf67e21caf2101187778783cbf8041087818760058445848584c584058545858585c585058645868586c586058745878587c58780f8407080f8d17380f8d073c0f8cc73fff76db801218173fff769b88773fff766b842f6f76addf83880109fdde90c6400210020c0f2440a21e548f2a351c0f24501bff32f8f8847dbf80070bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f0e0804ff47d7005f06efa002800f039814ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ef66c61ccf2ff010160c0f8048080f80ea0a0f8c49180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb9427ff452afbff35f8f4be8000100294dd05be8001fb942f7d046e780461198a14603284ff0000738d3301fb0fa80f04009084032d01198109a4cf6cd410338ccf6cc419578a0fb0101b5eb910f88bf8d082e46302d28bf302608f14a00d11c06eb8602fef75ffb002788f8486088f849709db1d8f8440038b9404600f0a7fa0028c8f8440000f07c8142f68d41c0f24401a1f1400201219047002742f6f76addf83880c0f2440a4c46fef758bfd0f870110027002900f0b0804ff400624ff0ff3c0df1dc0e04e033681a44b2f5403f50d28e18b568b7eb552ff5d1ec081ef8044005f0070324fa03f3db071ebf41f82570c6f808c0f760e6e71198032840f0c48010994ff4f077487889785a4640ea012600200890cde90600cde90400cde902004ff4a0700190484631464ff42073009707f05aff002800f01e814ff0ff37a3e01198012840f0a08009f57970bff35f8f50e8001f013140e80012002af8d113a94846012207f07afffff7d2b94ff0ff3752e04ff0000c4ff400634ff0000ec0f820c305e077463344b3f5403fbe4642d2cf18ba68ce580132f4d1f418220c022a2fd80a19956801352bd115682e443e6012681444220c022a23d80a19956801351fd115682e443e6012681444220c022a17d80a199568013513d115682e443e6012681444220c022a0bd80a199568013507d115682e443e6012681444b4f5403fcfd3bef1000fc7f804c00cbfc0f82033cef80430b7e7002742f6f76adde90d48c0f2440afef79abeb0f5fa6f084603d94ff4fa60379008460121054680f8471145f64d50c0f24600804701281bd143f2a318c0f25608a8f188008047022e074608bf002f01d057b90de04bf2110237a9c0f24b020220904728b10746c047002085f8470100e0002742f6f76addf83880c0f2440afef762be90f8cd11002918bf05f0a4fcdbf800000321cff680710140b1f1005fbff35f8f24d101684ef66c62ccf2ff0291421dd14168b1f57d7f19d1d0f8d813b1b14ff00041bff35f8fc0f8d4134af21f30c0f2470000f510674ff4f07001904ff4207600200021002200230096b84795f84701002785f8477158b145f64d50c0f246008047012804d143f2a310c0f256008047d5f8400195f84661c5f83c7185f84671a5f8447150b1c847d5f8400109f166018847002804bf0020c5f840010120a87356b14af27366c0f246060021002200230027b047fef7f6bd0027fef7f3bd701ca9f88c03002783e74bf639400027c0f2510088f84870804783e600bf2de9f04f81b04ef66c644ff29c55ccf2ff04c2f229054ff6ff7600274ff0010a47f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d5f80090bff35f8f2868bff35f8f01466ff39601b1f1005f07d10168a14204d14168b1f57d7f00f095804ff47d7004f0e8ff002800f08d804ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ff47d710460416080f80ea0a0f8c4b180f8c381068446848684c684068546858685c685068646868686c686068746878687c68755e8001f49457ff45aafbff35f8f45e8000129b155e8001f4945f8d04fe7002001b0bde8f08f70b500284dd001684ef66c62ccf2ff02914218bf70bd90f8481090f849504bf6394c8d42c0f2510c2ad205eb8501014491f84d2091f84e4091f84ae091f84b3091f84c1042ea0424012c4ff0010298bf14466e1c054680f84960b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f84810bde870406047e047686c38b142f64d42c0f244022146bde87040104770bd02464ff64b70cff6ff7042f6653c7844c0f2440c00210023604700bf2de9f04fcdb04ff29c57c2f229073c6840f2030b20464ef66c696ff39600cff6807bccf2ff09b0f1005fbff35f8f40f0e9812068484540f0e5816068b0f57d7f40f0e08194f8710347f64c65c2f2070504f5497628b347f61800c2f20700016d4bf67c52c0f2720291421ad1406cc0b1d4f87c032968401a012802db03f05cff78b93046b8460df01bf950b142f69570c0f25b0080474746002084f8720384f8710394f8700368b1d4f880032968401a012802db03f040ff20b9002084f8700384f86a013078bff35f8f70b194f86fa3ac46baf1000f00961cd094f8250394f83e13091a18bf012115e094f87103002840f0888194f87003002840f08381d4f88403002800f07e8142f68d41c0f24401884777e1012194f8270394f83133059094f8280394f83d23069094f8265394f82a0394f82b9394f82ce394f82db394f82e8394f82f63934235d194f8302394f83c339a422fd194f83b2396422bd194f83a23904527d194f83923934523d194f8382396451fd194f8372391451bd194f83623904217d194f8292394f835339a4211d194f83423069b93420cd194f83323059b934207d194f83223954203d111b994f82583a9e00023012284f8403384f8433384f8443384f8453384f8463384f8473384f8483384f8493384f84a3384f84b3384f84c3384f84d3384f84e3384f84f3384f8503384f8513384f8523384f8533384f8543384f8553384f8563384f8573384f8583384f8593384f85a3384f85b3384f85c3384f85d3384f85e3384f85f3384f8603384f8613384f8623384f8633384f8643384f8653384f8663384f8673384f8683384f8693384f86a3384f86b3384f86c3384f86d3384f86e3384f83f2384f8415384f84203dcf8002047f61803170a84f8432384f84473170c120e84f846230822c2f2070384f8457384f86f231a6d4bf67c57c0f2720704f22631ba4204f2323a1bd15a6ccab140f6b803c2f200031a689ab1182d00f02984172d40f03584fe2804f2473c0d4600f05684002840f0608400980df09cf8294602e0022084f8400350460c22fdf71fff94f8258394f86fa384f83e8345f64d50c0f246008047811eb1fa81f14fea511b012808bf4ff0020bbaf1000f5ad004f23f3007a9049040f261400631c0f2470003910aa9023100254ff00309a0f5b84000240291019015e000bf029807a91a468df828908df82980fdf7e9fe47f00802019ff0200aa90023b8470334e0b25045b1462fd2aaeb0400c7b20420032f28bf4f468df81c0005983a468df81d0006988df81fb08df81e0004988df8204050fa84f103988df821a08df822508df823508df82450fdf7bbfeb81dc345c3b24ff00306c2d14ef60b670120f02107aac0f24707c9e7bff35f8f00994ff29c574ef66c6940f2030b0020c2f22907ccf2ff09cff6807b08703d68bff35f8f05ea0b00b0f1005f59d12868484556d16868b0f57d7f52d105f575700021bff35f8f50e8006f40e80012002af9d147f64c60bff35f8fc2f207000468b6f1004f0fd0b84603f073fd58b1002e00f04d8195f8ec03320a002800f0e38195f8ed13ece195f8ec03e8b147f61800c2f207000068b8b145f60960c2f207000478002040f261430a9007900aa907aac0f247032046984707990a9a43f69b53c0f24e0320469847002085f8ee0385f8ec03d5f8d80320b142f68d41c0f244018847d7f800a0bff35f8f0aea0b00b0f1005f40f00481daf80000484540f0ff80daf80400b0f57d7f40f0f9809af8700338b100208af86801caf864014db0bde8f08f9af86801002800f0d780daf86441002c00f0d28040f6b800c2f20000056807a802f066f9002d00f0d781284621464ff416324e464ff6ff770695fdf7fbfd002547f67f744ff07f0806e048f2a351c0f24501bff32f8f88474ff29c50c2f22900d0f80090bff35f8f0068bff35f8f00ea0b01b1f1005f07d10168b14204d14168b1f57d7f00f0b8804ff47d7004f028fc002802f00c814ff60c41cff6ff7100bf42182e3182f8f45382f8f55382f8f65382f8f75382f8f85382f8f95382f8fa5382f8fb5382f8fc5382f8fd5382f8fe5382f8ff5382f8005482f8015482f8025482f8035482f8045482f8055482f8065482f8075482f8085482f8095482f80a5482f80b5482f80c5482f80d5482f80e5482f80f5482f8105482f8115482f8125482f8135482f8145482f8155482f8165482f8175482f8185482f8195482f81a5482f81b5482f81c5482f81d5482f81e5482f81f5482f8205482f82154a0d14ff47d71416001214ff29c5206608173a0f8c44180f8c381078447848784c784078547858785c785078647868786c786078747878787c787c2f2290252e8001f49457ff453afbff35f8f42e8000121b352e8001f4945f8d048e79af86a0170b1daf86c0140b147f64c61c2f207010968401a002802f3848000208af86a0140f6a120c0f2470080474db0bde8f08f95f8ec03002840f0db80e3e6817b002942f05780027f0021002a8df8281000f028824ff29c550aaac2f22905535c002b00f0928253185f78002f00f050829f78002f00f04e82df78002f00f04c821f79002f00f04a825f79002f00f048829f79002f00f04682df79002f00f044821f7a002f00f042825f7a002f00f040829f7a002f00f03e82df7a002f00f03c821f7b002f00f03a825f7b002f00f038829f7b002f00f03682df7b002f00f034821f7c002f00f032825f7c002f00f030829f7c002f00f02e82df7c002f00f02c821f7d002f00f02a825f7d002f00f028829f7d002f00f02682df7d002f00f024821f7e002f00f022825f7e002f00f020829f7e002f00f01e82df7e002f00f01c821f7f002f00f01a825f7f002f00f018829f7f002f00f01682db7f002b00f01482203160297ff47baf33e20120a5f8ec0340f20220a5f8f0030220002185f8ef03c5f8e01302f00103c6f300208b42c6f34b2206d123b395f8f233f7b2bb421fd00ce05bb995f8ef13a5f8ea2385f8f013022185f8f113c5f8dc4311e095f8ef3385f8f03385f8f163a5f8ea23c5f8dc4331b9012185f8ee13c6f34951a5f8e813002804bf002185f8ee1385f8ed0385f8f26395f8ee1341b395f8680160b1d5f8e403bff35f8fb5f8e8136ff39f20884216d195f8ee13c1b195f8ef6340e000208af86801caf864018af86a0101208af8690140f6a120c0f24700804701f06dbf002085f8ee03c5f8dc43d5f8dc13b5f8ea0395f8f163611a814220d28902b1fbf0f04ff4406395f8f01300fb00f2a3eb40005043000d721a00fb02f34ff60c47002b4ff40073cff6ff7748bf07f5fa7310fb0230c21700eb925001eb9026002147f61800c2f207000068e0b1d5f8e003f4b2a0421ad0002040f261430a9007900aa907aac0f247032046984707990a9a43f69b53c0f24e0320469847c5f8e04395f8ee1302e00020c5f8e003d5f8d80385f8ef6311b14ff47a7108e095f8f113f2b28a424ff0280108bf4ff47a7142f68d42c0f24402403a904795f8ee034746c8b13868bff35f8f00ea0b01b1f1005f41f0f8860168494541f0f4864168b1f57d7f41f0ef86002180f86811c0f864114db0bde8f08f95f8ed0300287ff453adf0b20228ddd140f6b800c2f2000001680029d6d001684ff416322139002301f8403f403a01f81f3c01f81e3c01f81d3c01f81c3c01f81b3c01f81a3c01f8193c01f8183c01f8173c01f8163c01f8153c01f8143c01f8133c01f8123c01f8113c01f8103c01f80f3c01f80e3c01f80d3c01f80c3c01f80b3c01f80a3c01f8093c01f8083c01f8073c01f8063c01f8053c01f8043c01f8033c01f8023c01f8013c4b708b70cb700b714b718b71cb710b724b728b72cb720b734b738b73cb730b744b748b74cb740b754b758b75cb750b764b768b76cb760b774b778b77cb7781f820309cd100684ef217310a904ff416300b900aa8c0f247018847474661e700980d460cf0e2fd10b302304ff0030008bf022084f840032946fff7dcbb84f87003dcf800204ef660231a44c4f88023b8b100980d460cf0a7ff0cf07bff294660b9fff7c8bb4ff29c55c2f2290595e00cf070ff002829463ff4bdab0320fff7b8bb002084f86a01fff7b5bb18684a4600eb0b20704400eb084000eb06616046fdf7ccfa0ee04eea0b2141ea084141ea066361464a460cf06ffd00281cbf032084f8400309f1080084f86f032946fff792bb01313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2921d84ff0520353541dd00a4445235e29537018d04f235d29937014d052235c29d37010d044235b2913710cd045235a29537108d052235929937104d020235829d37141f0c48200218df887100121427f002a00f0c28000220aab9f5c002f00f0a0809f187e78002e5ed0be78002e5dd0fe78002e5cd03e79002e5bd07e79002e5ad0be79002e59d0fe79002e58d03e7a002e57d07e7a002e56d0be7a002e55d0fe7a002e54d03e7b002e53d07e7b002e52d0be7b002e51d0fe7b002e50d03e7c002e4fd07e7c002e4ed0be7c002e4dd0fe7c002e4cd03e7d002e4bd07e7d002e4ad0be7d002e49d0fe7d002e48d03e7e002e47d07e7e002e46d0be7e002e45d0fe7e002e44d03e7f002e43d07e7f002e42d0be7f002e41d0ff7f002f40d02032602a7ff49aaf54e001323ae0023238e0033236e0043234e0053232e0063230e007322ee008322ce009322ae00a3228e00b3226e00c3224e00d3222e00e3220e00f321ee010321ce011321ae0123218e0133216e0143214e0153212e0163210e017320ee018320ce019320ae01a3208e01b3206e01c3204e01d3202e01e3200e01f325f2a15d84ff053079f5411d013444b275e2a5f700cd049275d2a9f7008d050275c2adf7004d020275b2a1f7140f0f08100228df887200131827f002a00f0be8000210aaa535c002b00f0a08053185f78002f5ed09f78002f5dd0df78002f5cd01f79002f5bd05f79002f5ad09f79002f59d0df79002f58d01f7a002f57d05f7a002f56d09f7a002f55d0df7a002f54d01f7b002f53d05f7b002f52d09f7b002f51d0df7b002f50d01f7c002f4fd05f7c002f4ed09f7c002f4dd0df7c002f4cd01f7d002f4bd05f7d002f4ad09f7d002f49d0df7d002f48d01f7e002f47d05f7e002f46d09f7e002f45d0df7e002f44d01f7f002f43d05f7f002f42d09f7f002f41d0db7f002b40d0203160297ff49aaf50e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2911d84ff0440353540dd00a4455235e29537008d050235d29937004d020235c29d37040f0098100218df8871001216a6846f23f53c5f28803b3eb520f40f08b80d20700f08d8000210aaa535c002b00f0858153185f78002f00f0f9809f78002f00f0f980df78002f00f0f9801f79002f00f0f9805f79002f00f0f9809f79002f00f0f980df79002f00f0f9801f7a002f00f0fc805f7a002f00f0fc809f7a002f00f0fc80df7a002f00f0fc801f7b002f00f0fc805f7b002f00f0fc809f7b002f00f0fc80df7b002f00f0fc801f7c002f00f0fc805f7c002f00f0fc809f7c002f00f0fc80df7c002f00f0fc801f7d002f00f0fc805f7d002f00f0fc809f7d002f00f0fc80df7d002f00f0fc801f7e002f00f0fc805f7e002f00f0fc809f7e002f00f0fc80df7e002f00f0fc801f7f002f00f00d815f7f002f00f00b819f7f002f00f00981db7f002b00f00781203160297ff47baf1de14cf67e22caf210126a60002940f0198100210aaa535c002b00f0dc8053185f78002f61d09f78002f60d0df78002f5fd01f79002f5ed05f79002f5fd09f79002f60d0df79002f61d01f7a002f62d05f7a002f63d09f7a002f64d0df7a002f68d01f7b002f69d05f7b002f6ad09f7b002f6bd0df7b002f6cd01f7c002f6dd05f7c002f6ed09f7c002f6fd0df7c002f70d01f7d002f71d05f7d002f72d09f7d002f73d0df7d002f74d01f7e002f75d05f7e002f76d09f7e002f77d0df7e002f78d01f7f002f79d05f7f002f7ad09f7f002f7bd0db7f002b7cd0203160297ff49aaface000211171f6e6013173e0023171e003316fe004316de0013184e0053169e0023180e0063165e003317ce0073161e0043178e008315de0053174e0093159e0063170e00a3155e007316ce000225a710fe60b314ee0083165e00c314ae0093161e00d3146e00a315de00e3142e00b3159e00f313ee00c3155e010313ae00d3151e0113136e00e314de0123132e00f3149e013312ee0103145e014312ae0113141e0153126e012313de0163122e0133139e017311ee0143135e018311ae0153131e0193116e016312de01a3112e0173129e01b310ee0183125e01c310ae0193121e01d3106e01a311de01e3102e01b3119e01f315f2931d84ff04f0353542dd00a444b235e29537028d020235d29937024d00021d17024e01c3104e01d3102e01e3100e01f315f2918d84ff04103535414d00a444c235e2953700fd05d2993700cd04f235c29d37008d043235b29137104d020235a29537140f0828700218df8871000220aafb95c002900f0a080bb18597800295ed0997800295dd0d97800295cd0197900295bd0597900295ad09979002959d0d979002958d0197a002957d0597a002956d0997a002955d0d97a002954d0197b002953d0597b002952d0997b002951d0d97b002950d0197c00294fd0597c00294ed0997c00294dd0d97c00294cd0197d00294bd0597d00294ad0997d002949d0d97d002948d0197e002947d0597e002946d0997e002945d0d97e002944d0197f002943d0597f002942d0997f002941d0d97f002940d02032602a7ff49aaf42e001323ae0023238e0033236e0043234e0053232e0063230e007322ee008322ce009322ae00a3228e00b3226e00c3224e00d3222e00e3220e00f321ee010321ce011321ae0123218e0133216e0143214e0153212e0163210e017320ee018320ce019320ae01a3208e01b3206e01c3204e01d3202e01e3200e01f325f2a03d84ff07701b95403d100218df8871002e0b91800224a7004694ff0000917f80910002900f0c48007eb09025178002962d09178002962d0d178002962d01179002962d05179002962d09179002962d0d179002962d0117a002962d0517a002962d0917a002962d0d17a002962d0117b002962d0517b002962d0917b002962d0d17b002962d0117c002962d0517c002962d0917c002962d0d17c002962d0117d002962d0517d002962d0917d002962d0d17d002962d0117e002962d0517e002962d0917e002962d0d17e002962d0117f002962d0517f002962d0917f002962d0d17f002962d009f12009b9f1600f7ff496af4ff060095be009f1010958e009f1020955e009f1030952e009f104094fe009f105094ce009f1060949e009f1070946e009f1080943e009f1090940e009f10a093de009f10b093ae009f10c0937e009f10d0934e009f10e0931e009f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f0901250a2c1ed364214ff47a7242f2107305eb85077f00b4fbf7f60a2e11d305fb01f7b4fbf7f60a2e0bd305fb02f7b4fbf7f60a2e05d35d43b4fbf5f7092fe7d800e03d464946b9f15f0f98bf5f21c1f1000e05911eeb090b54d0b4fbf5f30aa903f1300201f809204cf6cd41ccf6cc410a2da5fb017248d31bf1010742d003fb154cd608bcfbf6f80aa901eb090448f21f5108f13002c5f2eb116270642da5fb013235d31bf102032cd008fb16c65309b6fbf3f244f6d35102f13007c1f26201a770b5f57a7fa5fb011724d31bf1030118d002fb1361ba0941f25977b1fbf2f3cdf2b717a5fb077603f13007e77003fb121442f2107109f104098d424fea5635a8d20ae0ddf8149007e009f1010904e009f1020901e009f1030900240aab03f80940195d002900f0a0801f19797800295ed0b97800295dd0f97800295cd0397900295bd0797900295ad0b979002959d0f979002958d0397a002957d0797a002956d0b97a002955d0f97a002954d0397b002953d0797b002952d0b97b002951d0f97b002950d0397c00294fd0797c00294ed0b97c00294dd0f97c00294cd0397d00294bd0797d00294ad0b97d002949d0f97d002948d0397e002947d0797e002946d0b97e002945d0f97e002944d0397f002943d0797f002942d0b97f002941d0f97f002940d02034602c7ff49aaf50e001343ae0023438e0033436e0043434e0053432e0063430e007342ee008342ce009342ae00a3428e00b3426e00c3424e00d3422e00e3420e00f341ee010341ce011341ae0123418e0133416e0143414e0153412e0163410e017340ee018340ce019340ae01a3408e01b3406e01c3404e01d3402e01e3400e01f345f2c11d84ff0750119550dd0191973225e2c4a7008d020225d2c8a7004d070225c2cca7040f09d8000218df8871044694ff0000e13f80e10002900f0c78003eb0e056978002962d0a978002962d0e978002962d02979002962d06979002962d0a979002962d0e979002962d0297a002962d0697a002962d0a97a002962d0e97a002962d0297b002962d0697b002962d0a97b002962d0e97b002965d0297c002965d0697c002965d0a97c002965d0e97c002965d0297d002965d0697d002965d0a97d002965d0e97d002965d0297e002965d0697e002965d0a97e002965d0e97e002965d0297f002965d0697f002965d0a97f002965d0e97f002965d00ef1200ebef1600f7ff496af4ff0600e5ee00ef1010e5be00ef1020e58e00ef1030e55e00ef1040e52e00ef1050e4fe00ef1060e4ce00ef1070e49e00ef1080e46e00ef1090e43e00ef10a0e40e00ef10b0e3de00ef10c0e3ae00ef10d0e37e00ef10e0e34e000220a7162e70ef10f0e2ee00ef1100e2be00ef1110e28e00ef1120e25e00ef1130e22e00ef1140e1fe00ef1150e1ce00ef1160e19e00ef1170e16e00ef1180e13e00ef1190e10e00ef11a0e0de00ef11b0e0ae00ef11c0e07e00ef11d0e04e00ef11e0e01e00ef11f0e01250a2c1ed364214ff47a7242f2107305eb85077f00b4fbf7f60a2e11d305fb01f7b4fbf7f60a2e0bd305fb02f7b4fbf7f60a2e05d35d43b4fbf5f7092fe7d800e03d46f446bef15f0f98bf4ff05f0cccf1000842f2107b18eb0e0952d0b4fbf5f20aa902f1300301f80e304cf6cd41ccf6cc410a2da5fb016345d319f1010640d002fb1546db08b6fbf3f20aa901eb0e0448f21f5102f13007c5f2eb116770642da5fb011732d319f102012ad002fb13637a09b3fbf2f6b5f57a7f06f13001a17044f6d351c1f26201a5fb011721d319f1030116d006fb1231ba0941f25976b1fbf2f3cdf2b716a5fb066703f13006e67003fb12140ef1040e5d454fea5735aad209e0e64607e00ef1010e04e00ef1020e01e00ef1030e00240df1280b0bf80e401bf80410002900f0a1800beb0405697800295ed0a97800295dd0e97800295cd0297900295bd0697900295ad0a979002959d0e979002958d0297a002957d0697a002956d0a97a002955d0e97a002954d0297b002953d0697b002952d0a97b002951d0e97b002950d0297c00294fd0697c00294ed0a97c00294dd0e97c00294cd0297d00294bd0697d00294ad0a97d002949d0e97d002948d0297e002947d0697e002946d0a97e002945d0e97e002944d0297f002943d0697f002942d0a97f002941d0e97f002940d02034602c7ff498af5ee001343ae0023438e0033436e0043434e0053432e0063430e007342ee008342ce009342ae00a3428e00b3426e00c3424e00d3422e00e3420e00f341ee010341ce011341ae0123418e0133416e0143414e0153412e0163410e017340ee018340ce019340ae01a3408e01b3406e01c3404e01d3402e01e3400e01f345f2c1fd84ff075010bf804101ad00beb040173225e2c4a7014d020225d2c8a7010d074225c2cca700cd031225b2c0a7108d030225a2c4a7104d02022592c8a7140f0898200218df88710d0f8cc734ff000091bf80910002900f0c4800beb09046178002962d0a178002962d0e178002962d02179002962d06179002962d0a179002962d0e179002962d0217a002962d0617a002962d0a17a002962d0e17a002962d0217b002962d0617b002962d0a17b002962d0e17b002962d0217c002962d0617c002962d0a17c002962d0e17c002962d0217d002962d0617d002962d0a17d002962d0e17d002962d0217e002962d0617e002962d0a17e002962d0e17e002962d0217f002962d0617f002962d0a17f002962d0e17f002962d009f12009b9f1600f7ff496af4ff060095be009f1010958e009f1020955e009f1030952e009f104094fe009f105094ce009f1060949e009f1070946e009f1080943e009f1090940e009f10a093de009f10b093ae009f10c0937e009f10d0934e009f10e0931e009f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f0901240a2f1ed364214ff47a7242f2107304eb84067600b7fbf6f50a2d11d304fb01f6b7fbf6f50a2d0bd304fb02f6b7fbf6f50a2d05d35c43b7fbf4f6092ee7d800e03446c846b9f15f0f98bf4ff05f08c8f1000e42f2107c1eeb09054dd0b7fbf4f14cf6cd4001f13002ccf6cc400bf809200a2ca4fb002341d36a1c3dd001fb1476d908b6fbf1f348f21f5003f130020beb0907c5f2eb107a70642ca4fb000230d3a81c29d003fb11615309b1fbf3f6b4f57a7f06f13000b87044f6d350c1f26200a4fb000220d3e81c16d006fb1310910941f25973b0fbf1f2cdf2b713a4fb033502f13003fb7002fb110709f1040964454fea5534afd209e0c14607e009f1010904e009f1020901e009f10309069d40f6b8060022c2f200060bf809201bf80200002800f0a1800beb0200417800295ed0817800295dd0c17800295cd0017900295bd0417900295ad08179002959d0c179002958d0017a002957d0417a002956d0817a002955d0c17a002954d0017b002953d0417b002952d0817b002951d0c17b002950d0017c00294fd0417c00294ed0817c00294dd0c17c00294cd0017d00294bd0417d00294ad0817d002949d0c17d002948d0017e002947d0417e002946d0817e002945d0c17e002944d0017f002943d0417f002942d0817f002941d0c07f002840d02032602a7ff498af49e001323ae0023238e0033236e0043234e0053232e0063230e007322ee008322ce009322ae00a3228e00b3226e00c3224e00d3222e00e3220e00f321ee010321ce011321ae0123218e0133216e0143214e0153212e0163210e017320ee018320ce019320ae01a3208e01b3206e01c3204e01d3202e01e3200e01f325f2a0ad84ff075000bf8020005d00beb020073215e2a41705dd100208df887000aaf42f2941845f29c14284602213a46c2f22008c2f213040bf093fd00208df8280038460bf00bff28460e213a460bf088fd4ff6a420cff6ff703058a0426ad14ff6b020cff6ff703058b0f54d2f62d14ff6b420cff6ff703058a0425bd145f610634ff0000ec2f213034cf6394408f1040c00274ff0ff3263454cd8186830f003051bd0984528bf0c2846d3a8eb03018d424ff0ff3142d8bd42394688bf2946c00703eb05001cbf0f46ae44013c00f10403e1d12fe000218170a1e70421b7f5807f21d300223d46b5f5007f17d3b5f5806f16d3b5f5006f15d30901b2eb153f4fea1515f0d10fe00022ca7176e500219171fff77db800211172fef73bbd490002e0890000e0c900634504d1484207ea0002714603e04ff0ff324ff0ff3147f64c60c2f20700d0f8840008f1080342f6941c9842c2f2270c4dd142f610674ff0000bc2f2200746f6b9700cf1040e00244ff0ff384ff0ff3977453cd83e6836f0030515d0bc4528bf0c2e36d3aceb07039d4234d82346a54288bf2b46f6071cbf1c46ab447b19013803f10407e4d122e00420b4f5807f17d34ff000082546b5f5007f0cd3b5f5806f0bd3b5f5006f0ad30001b8eb153f4fea1515f0d104e0400002e0800000e0c000774504d1404204ea0008d94603e04ff0ff384ff0ff394ff6882040f6b807cff6ff70c2f200073b580cf10800834264d14ff69423cff6ff73fb58b3f5333f5cd14ff69823cff6ff73fb58834255d14ff29c5043f21063c2f229004ff0000bc2f2270342f6f935a0f1040ca0f1080e0024634542d81e6836f003071ad09e454ff0ff30059028bf0c2e3ad3aeeb030087424ff0ff3034d82046a74288bf3846f6071cbf0446bb44d819013d00f10403dfd123e00427b4f5807f17d34ff0000e2546b5f5007f0cd3b5f5806f0bd3b5f5006f0ad33f01beeb153f4fea1515f0d104e07f0002e0bf0000e0ff00634505d17b4204ea03000590584602e04ff0ff300590064666208df8280072208df8290065208df82a008df82b002f208df82c006d204b238df82d0061208df8313069238df82e0078208df83230422356278df82f0020208df833303a238df8377047270aac8df830008df834308df835004c238df838708df83a00002720468df836308df839308df83b700bf0cafe069de05d002800f0a080e019417800295ed0817800295dd0c17800295cd0017900295bd0417900295ad08179002959d0c179002958d0017a002957d0417a002956d0817a002955d0c17a002954d0017b002953d0417b002952d0817b002951d0c17b002950d0017c00294fd0417c00294ed0817c00294dd0c17c00294cd0017d00294bd0417d00294ad0817d002949d0c17d002948d0017e002947d0417e002946d0817e002945d0c17e002944d0017f002943d0417f002942d0817f002941d0c07f002840d02037602f7ff49aaf64e001373ae0023738e0033736e0043734e0053732e0063730e007372ee008372ce009372ae00a3728e00b3726e00c3724e00d3722e00e3720e00f371ee010371ce011371ae0123718e0133716e0143714e0153712e0163710e017370ee018370ce019370ae01a3708e01b3706e01c3704e01d3702e01e3700e01f375f2f25d84ff02000e05521d0e01945215e2f41701cd076215d2f817018d065215c2fc17014d06e215b2f017110d048215a2f41710cd07521592f817108d06221582fc17104d02021572f017240f0f88000208df887002046494642460bf0f5fd0020215c002900f0a08021184a78002a5ed08a78002a5dd0ca78002a5cd00a79002a5bd04a79002a5ad08a79002a59d0ca79002a58d00a7a002a57d04a7a002a56d08a7a002a55d0ca7a002a54d00a7b002a53d04a7b002a52d08a7b002a51d0ca7b002a50d00a7c002a4fd04a7c002a4ed08a7c002a4dd0ca7c002a4cd00a7d002a4bd04a7d002a4ad08a7d002a49d0ca7d002a48d00a7e002a47d04a7e002a46d08a7e002a45d0ca7e002a44d00a7f002a43d04a7f002a42d08a7f002a41d0c97f002940d0203060287ff49aaf5be001303ae0023038e0033036e0043034e0053032e0063030e007302ee008302ce009302ae00a3028e00b3026e00c3024e00d3022e00e3020e00f301ee010301ce011301ae0123018e0133016e0143014e0153012e0163010e017300ee018300ce019300ae01a3008e01b3006e01c3004e01d3002e01e3000e01f305f281cd84ff02001215418d021184f225e284a7013d074225d288a700fd068225c28ca700bd065225b280a7107d072225a284a7103d0202259288a7128d100208df887000aac059a204631460bf028fd28461a2122460bf059fa00208af86801caf8640106984ef217310a904ff416300b900aa8c0f24701884701208af86a0107a800f031f9caf814004db0bde8f08f0020c871d6e70021417207e72de9f04f81b0009041f204024cf65560cef20002ccf2ac50c2f8ac0f4ef6fc50cef2000001684ef66c6641f08071016052f8040c4ff29c57ccf2ff06c2f229074ff6ff7440f0010000254ff0010847f67f794ff07f0a42f8040c06e048f2a351c0f24501bff32f8f8847d7f800b0bff35f8f3868bff35f8f01466ff39601b1f1005f07d10168b14204d14168b1f57d7f00f094804ff47d7002f0aafa002800f0ca804ff60c41cff6ff7100bf42182e3182f8f45382f8f55382f8f65382f8f75382f8f85382f8f95382f8fa5382f8fb5382f8fc5382f8fd5382f8fe5382f8ff5382f8005482f8015482f8025482f8035482f8045482f8055482f8065482f8075482f8085482f8095482f80a5482f80b5482f80c5482f80d5482f80e5482f80f5482f8105482f8115482f8125482f8135482f8145482f8155482f8165482f8175482f8185482f8195482f81a5482f81b5482f81c5482f81d5482f81e5482f81f5482f8205482f82154a0d14ff47d710660416080f80e80a0f8c49180f8c3a1048444848484c484048544858485c485048644868486c486048744878487c48757e8001f59457ff45aafbff35f8f47e8000121b157e8001f5945f8d04fe78169d1bb47f64c6245f6e466c2f20702cff6f8761368314617689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f421ed041f20401cef200010b6817681168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94206d041f20401cef200010968c91a816141f20400cef2000000680099086001b0bde8f08f00bf2de9f04f83b041f20401cef200014ef66c674ff29c5609680068ccf2ff07c2f229064ff6ff744ff000084ff0010947f67f7a4ff07f0b0291019006e048f2a351c0f24501bff32f8f88473568bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168b94204d14168b1f57d7f00f093804ff47d7002f095f9002800f0e7804ff60c41cff6ff7142182e3182f8f48382f8f58382f8f68382f8f78382f8f88382f8f98382f8fa8382f8fb8382f8fc8382f8fd8382f8fe8382f8ff8382f8008482f8018482f8028482f8038482f8048482f8058482f8068482f8078482f8088482f8098482f80a8482f80b8482f80c8482f80d8482f80e8482f80f8482f8108482f8118482f8128482f8138482f8148482f8158482f8168482f8178482f8188482f8198482f81a8482f81b8482f81c8482f81d8482f81e8482f81f8482f8208482f82184a0d14ff47d710760416080f80e90a0f8c4a180f8c3b1048444848484c484048544858485c485048644868486c486048744878487c48756e8001fa9427ff45cafbff35f8f46e8000121b156e8001fa942f8d051e7816961b144f6d350c1f26200a1fb0001880901284ff0010088bf88094ce047f64c6245f6e466c2f20702cff6f8761368314600bf17689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f422ed041f20401cef200010b6817681168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94216d041f20401cef20001096844f6d357ca1ac1f26207a2fb07768261b00901284ff0010088bfb009994208bffa2000e0fa20dde90121891ab1fbf0f003b0bde8f08f2ab1a2fb0103002b1cbf0020704702fb01f0ffe7b0b54ff2a054c2f229040146206846f23f52c5f28802b2eb500f40f258304df681124cf67e25c2f20000c0f24802caf2101518bf25609047002804bf691c2160b0bd00bf0846ffe7014640f258304df69f22c2f20000c0f248021047002855d1002953d0082a51d30b78aa2b4ed18b79f02b4bd12de9f04182b045f64d550b2ac0f2460547d3c878a2f10803834242d14878212841d1087901283ed1487901283bd1c879c8bb0c4614f8080f10f03c0f33d18818884610f8021c10f8010c164641ea0027a2f10a0081b220460af022f9874222d1a847811eb1fa81f14f09012808bf0227002f4ad0207887f00301084247d0012039464246334600f07ff90446002898f8080018bf06243be04ff27143c0f24c0318470b2400e00a24a847811eb1fa81f14e09012808bf02261eb3304600f090f8f8b10546407ce0b10027284631463246032300970af09cf9686840b14bf69b71c0f25d0188476868fff774ff6f602868af75002818bffff76dff00202860a8602882204602b0bde8f0810624f9e700243842f6d0404631463a463b4600f056f9002818bf0446ece70b291dd3c278a1f10803934218d10278aa2a13d14278212a10d10279012a0dd14279012a0ad18279f02a07d1c2792ab9024612f8083f13f03c0f03d00a2070470b20704710b5084410f8023c10f8010c43ea0024a1f10a0081b210460af08cf8201a18bf0a2010bd002808bf7047b0b582b00446407cd0b100252046032300950af032f9606840b14bf69b71c0f25d0188476068fff70aff65602068a575002818bffff703ff00202060a060208202b0bde8b040704700bf2de9f04f81b04ef66c654ff29c56ccf2ff05c2f229064ff6ff7700244ff0010b47f67f784ff07f09009006e048f2a351c0f24501bff32f8f8847d6f800a0bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168a94204d14168b1f57d7f00f095804ff47d7001f038ff002800f08d804ff60c41cff6ff7100bf42182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d710560416080f80eb0a0f8c48180f8c391078447848784c784078547858785c785078647868786c786078747878787c78756e8001f51457ff45aafbff35f8f46e8000129b156e8001f5145f8d04fe700200099002801eb410100eb011118bf01f51b7001b0bde8f08f00bfb0b5c4b0dc08202c03d94ff0ff3044b0b0bd0df107048df807008df80810a01c11461a461d46fbf72ff8a81c4af6610582b2c0f24605f02021460023a84744b0b0bd00bf2de9f04f89b0064618469a4617468946fff700ff002800f09983044696f908000796b0f1ff3f00f003050add264616f8110f00283fd12068002818bffff7e4fd2de3207c10b3607c00b34ff000082046394652460323cdf8008009f0f3ff606848b14bf69b71c0f25d0188476068fff7cbfdc4f80480206884f81680002818bffff7c2fd00202060a06020822068002818bffff7b9fd4ff480710020218207992060a0608978a081092004f11106e174a174257560760799a07c8978884240f0d382217da94240f0cf82411ca9f10b00627e01961e2828bf1e209042a17488bf6076a9f10200039787b20a2f4ff00005c0f0db82092241f2210809200497cdf808a017e02068049f002818bffff77cfda089002d00f10100069d26602674a660a08118bf0625059e06eb0b0082b2ba4280f0bb82217c80b20429064600f28080079b461c9a5c4b1c0129237405dd022906d0032968d1e28106e021b9627503e0238943ea02222281be4280f09e82042966d0079a831c925d8f1c0129277406dd049fff290bd003290bd11e464ce000291cbf278947ea0222049f228102e0627500e0e281bb4280f08082022935d8079ac61cd25ccb1c0129237405dd022933d0fe2905d1627506e021b9238943ea0222228100e0e281be4280f0678202292fd0079a031d925d41f00407fc2927740add049ffd290cd0fe2903d0278947ea0222049f228105e0049f0029bed1e28100e06275bb4280f0498209b11e4610e0461d0798c25c05202074e189208941ea0221e18128b1fff7c4fc0028206000f06682b4f808906089a9eb00011ffa81fbb1b27a1a5a45b8bf93465fea0b420ad022681044079a11441ffa8bf2faf7ebfe6089b4f80890584481b2494560817ff454afd4f800a0607dbaf1000f05964ff000060df1230108bf8a460f288df8236006d8217d00f00302511ab1fa81f14e0900074ff0000706d4217e607e814238bf20760fe000bf606840b14bf69b71c0f25d0188476068fff798fc6760607e20760120e0820695a6b1607da67d400715d4002e4ff0000500f089811ffa89f100294ff6ff7300f00a8101295cd10020cfe000bf607d400750d4002577e14ff48030fff74ffc002e824600f06f81a07d002800f06b81baf1000f00f067816668002e00f0fb8020890428c0f05f8121680a1812f8043c002b40f0588112f8033c002b40f0538112f8023cff2b40f04e8112f8012cff2a40f049814ff4803531607060c6f80ca03561002800f0648107464bf69b70c0f25d0000f5857230460021904740b9316931b170688d420d46ebd187420d46e8d15546002728e14ff48030fff700fc054622e14ff6fe7000ea0900ac4642426ff001000aeb0007be78ff7883ea06231eb25d002db208ead63686ea430308ead5355e0085ea430336b25d002db208ead63686ea430308ead5355e0085ea430336b25d002db208ead63686ea430308ead5355e0085ea430336b25d002db208ead63686ea430308ead53686ea430383ea07231fb25e0036b208ead73787ea430308ead6365f0086ea43033fb25e0036b208ead73787ea430308ead6365f0086ea43033fb25e0036b208ead73787ea430308ead6365f0086ea43033fb25e0036b208ead737023087ea430308ead6371618023687ea430395d10230002765465feac97232d01af8000083ea002002b243001bb208ead23282ea400008ead333420083ea400012b243001bb208ead23282ea400008ead333420083ea400012b243001bb208ead23282ea400008ead333420083ea400012b243001bb208ead23282ea400008ead33282ea4003e0899ab2824273d15046ddf808a05346faf7a1fe00286bd10026012378e03820fff741fb002862d00646077047708770c770077147718771c771077247728772c772077347738773c773077447748774c774077547758775c775077647768776c776077747778777c77780f8287080f8297080f82a7080f82b7080f82c7080f82d7080f82e7080f82f7080f8307080f8317080f8327080f8337080f8347080f8357080f8367080f837704ff2dd50cff6ff70784430624ff22960cff6ff70784470624bf69b70c0f25d0045f6e46200f13c0730460f21c0f27c0238230025b84738b33046fff703fb2f46554600e05546606840b14bf69b71c0f25d0188476068fff7f5fa6760ddf808a000260323a77503991ffa89f720465246009709f005fd002d294605463ff460ad0846fff7dffa5be50027666077e6c5f580390027b5f5803f55463760f7607ff649aed0e700252046394652460323009509f0e6fc606840b14bf69b71c0f25d0188476068fff7befa65602068a575002818bffff7b7fa0020307000202060a06020820a2551e00798007a40064dd5207c00b301980078e0b103990025204652460323009509f0bcfc606840b14bf69b71c0f25d0188476068fff794fa65602068a575002818bffff78dfa00202060a06020820b252068002818bffff783fa00202060a060208220e001980078e0b103990025204652460323009509f091fc606840b14bf69b71c0f25d0188476068fff769fa65602068a575002818bffff762fa00202060a06020820625284609b0bde8f08f00bf2de9f041f0284bd100294ff00b0000f07f80022a7cd345f64d50c0f246000e4617468047811eb1fa81f14c09012808bf0224002c4ff00a006ad07578e91ec9b2fe2938bfbde8f081307833463946032860d002282dd001281cbf0a20bde8f081ac4204bf0020bde8f0814808842884bf0b20bde8f081881e03f1020887b240463946fff7bffa002869d006462846fff715fb21462a46fff7e9fa3046bde8f08145f64d57c0f2460707f5e27cbde8f0416047ac421cbf0020bde8f081a1f1210010f1160f48d36ff0480048432330c0b2242841d81a4612f8020f40f00207032f4bd19b796340032b47d10b2904d0032804bf0b20bde8f081881e4ef60b6783b2c0f247070120f021b847002818bf0620bde8f081ac422dd1a1f10c0010f1030f1ad31a4612f8020f042815d158796040032811d1d879a0f1310717f1300f0bd39b79984208d9a1f10807c01a874284bf0b20bde8f081cfe70b20bde8f081b07a204207d04046394622462b46bde8f041fff79abb0020bde8f0810a20bde8f08140f20d00c0f2000042f6653c7844c0f2440c012100220023604700bf80b582b04ff4f0704af61f4e01904ff4207cc0f2470e0020002100220023cdf800c0f04702b080bd4ff29c51c2f229010968bff35f8f0a466ff39602b2f1005f19d10a684ef66c63ccf2ff039a4212d14a68b2f57d7f0ed1d1f86c1159b147f64c62c2f207021268891a012903db0178042938bf7047002101707047b0b541f23154c0f252041d46a0474ff29c51c2f229010968bff35f8f0a466ff39602b2f1005f0cd10a684ef66c63ccf2ff039a4205d14a68b2f57d7f18bf002100e00021421c18bf002900d1b0bd95f84d20002afad091f84721002a08bfb0bd46f25863c2f206031a68132aeed8c2ebc20403eb04135b6801ebc2014ff40042c1f8e431a1f8ea212a7a01f5f271002a0fbf802248f20112ca808122ab7c33b1ab7d23b1022342f002028b71ca7195f820303bb195f8243023b1032342f004028b71ca7195f846304bb195f8443042f008020b7195f84530ca714b71b0bd48f27342c2f207021378002b14bf9378ff230b711378002b14bf5278ff224a71b0bdf0b589b048f66502c0f24b020c46054690474ff29c51c2f229010e68bff35f8f31466ff39601b1f1005f0cd131684ef66c62ccf2ff02914205d17168b1f57d7f08bf092d01d009b0f0bde1082c29fad896f847110029f6d045f64d51c0f2460107468847014638460129ecd1ff22079244f6435246f258610020cff60172c2f20601089006920b685a1e132a4fd8c3ebc30501eb05111a1fa1f5de7191f85451ad0618d4d51c42d091f8e450ad0616d4951c3cd091f87450ad0613d4551c36d00d79ad0610d4043aa1f5e071151da3f10403e3d12be05a1e01f5a87104e09a1ee03101e0da1e703106ebc203096893f9eb21b2f1ff3f1adc03f5f2731e688e4215d11e798df81b605e798df81c609b798df81e200a0a8df820108df821200a0c090e8df81d308df822208df823100f228df8012010228df80220522208218df80420b4f5804f4ff080028df800108df8061038bf4ff48042b4f5001f6ff07f0604f07f0138bf0026802c28bf80318df807109df809509df80a108df8030004d29df808200223002415e0c4f3c610b4f5804f024403d20323012400200be0b4f5001f03d204230224012003e0052303240120002135468df8053004f108038df808208df809508df80a1070b96846a222c118c254062048700c208870c81c06a90c22faf7f7f904f117034ff225066a46c0f2470601200821b047384609b0f0bd70b582b00546ff208df8040044f25220c0f20100009040f2c960c0f2480016460c46804798b148f27e30c2f2070000880122c1b264298df8032008d80721b0f5807f38bf03218df803108df80400301b28bf08280cd3d221281929550621417005218170033069460522faf7b3f90834204602b070bd00bf024600284ff0ff3009d0022918bf70471078112801d1507810b14ff0ff30704710b586b045f64d50c0f24600804701284ff000003ed1cde9020040f20830c0f210000190ff208df8140044f25220c0f20100049040f2c960c0f24800804798b148f27e30c2f2070000880122c1b264298df8132008d80721b0f5807f38bf03218df813108df8140040f2d260adf80800052001ac8df80a00e01d04a90522faf75df94ff2250cc0f2470c0120092122460c23e04706b010bd024600284ff0ff3021d0012918bf704710781f2819d110b545f64d54c0f24604a04701281cbf002010bd4bf2ee21c0f2000104f5e2747944e02029220023a047002818bf4ff0ff3010bd4ff0ff3070474ff29c50c2f22900016808466ff39600b0f1005f1ad108684ef66c62ccf2ff02904213d14868b0f57d7f0fd1d1f83c0160b147f64c62c2f207021268801a0028cebf01200020c1f83c017047002070474ff29c50c2f22900026810466ff39600b0f1005f32d110684ef66c61ccf2ff0188422bd15068b0f57d7f27d1d2f86c0120b347f64c61c2f207010968401a0028c4bf01207047d2f8701100200029c2f86c0182f86a01c2f87001c2f82003a2f88c0308bf704780b548f2a352c0f24502084690470020bde88040704700207047f0b101684ef66c62ccf2ff02914218bf704790f8461199b110b54af273644ff0000cc0f24604864680f846c10120002100220023aef844c1a446bde810406047704700bf02464ff6ab70cff6ff7042f6653c7844c0f2440c00210023604700bf70b5002866d0044600796179a279e37940ea012040ea024050ea036007d00e2803d0032856d1032502e0042500e00225fff74eff00284dd04ff29c50c2f22900066830466ff39600b0f1005f42d130684ef66c61ccf2ff0188423bd17068b0f57d7f18bf70bd45f64d50a478c0f24600804701282ed1082086f88402032086f88502102086f88602b22086f88802062086f8890286f88a02462086f88b0243204ff0000e86f88c0201204ef6057c06f5217286f887e286f88d0286f88e5286f88f42c0f2470c09210d2386f890e2bde87040604770bd00bf2de9f04f81b04ef66c6a4ff29c560446ccf2ff0ac2f229064ff6ff77002547f67f784ff07f0906e048f2a351c0f24501bff32f8f8847d6f800b0bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168514504d14168b1f57d7f00f096804ff47d7000f048fe002800f0bb804ff60c41cff6ff7100bf42182e3182f8f45382f8f55382f8f65382f8f75382f8f85382f8f95382f8fa5382f8fb5382f8fc5382f8fd5382f8fe5382f8ff5382f8005482f8015482f8025482f8035482f8045482f8055482f8065482f8075482f8085482f8095482f80a5482f80b5482f80c5482f80d5482f80e5482f80f5482f8105482f8115482f8125482f8135482f8145482f8155482f8165482f8175482f8185482f8195482f81a5482f81b5482f81c5482f81d5482f81e5482f81f5482f8205482f82154a0d14ff47d7141600121c0f800a08173a0f8c48180f8c391078447848784c784078547858785c785078647868786c786078747878787c78756e8001f59457ff459afbff35f8f00bf46e8000121b156e8001f5945f8d04de7002780f85b712a270821032380f85c71042780f8581180f85931102380f85d7180f85e1101214ff2250c074600f5ac7280f85a3180f85f1180f86031002c18bf0124c0f2470c012010210a2387f8614101b0bde8f04f604701b0bde8f08f00bf80b582b04ff0010ccdf800c000f002f802b080bd2de9f04381b04ff29c57c2f229073f68ddf820803c466ff39604b4f1005f10d13e684ef66c65ccf2ff05ae424ff0000904d17e68b6f57d7f08bfb946012804d013e04ff0000901280fd11c4615460e460746fff7d1fd2346044631462a463846002c18bfb9f1000f07d14af2736cc0f2460c01b0bde8f043604799f8460180b1b8f1010f7cd1d9f84001002189f84611a9f84411a0b342f68d41c0f2440188472ee0b9f844010121013080b2012898bf0846a9f84401d9f8400142f68d44c0f2440489f8461128b94846fff71ffec9f8400140b1a047d9f84001a4f140024ff4c8719047a8b199f84601002848d0d9f84001002189f84611a9f8441100b1a0474af2736cc0f2460c0120002100220023afe745f64d50c0f24600804701282fd1082089f84801032089f84901102089f84a01002089f84b01b22089f84c01062089f84d0189f84e01462089f84f01432089f85001012089f85101b9f844014ef6057c070a09f5a47289f8528189f85301c0f2470c012009210d2389f8547178e701b0bde8f08300bf80b582b04ff0050ccdf800c0fff734ff02b080bd2de9f04f83b04468002c00f0ba828368002b00f0b68204eb030b4ff000090027002614e047f64c63c2f207031b6845f69077c0f201073b44c6f83c310ceb0a0300275b451c464ff0000680f09a82a04618f9013b03f07f05bd40002b46ea050610d406f00703012b16dc0bb3012b40f08882abeb0803082bc0f0838204f10903dee700bfd84580f07c82182f07f107074446dcd975e200bf022b3ad0052b40f07082abeb0803042bc0f06b82631dc7e7d84580f0668294f90130002b04f10203bed55b4580f05d8294f90230b3f1ff3f04f10303b4dc5b4580f0538294f90330b3f1ff3f04f10403aadc5b4580f0498294f90430b3f1ff3f04f10503a0dc5b4580f03f8294f90530002b00f13a82a31d96e7d84580f0358294f9013004f1020c002b03f07f0a1fd5dc4580f02a8294f90270e31c07f07f05b7f1ff3f4aeac51a02dde0469c460fe05b4580f01a8294f9037004f1040c07f07f05b7f1ff3f4aea853a40f3ff809846abeb0c039a4500f20882f308672b1dd0652b7ff45fafbaf1060ffff45baf9cf80030462b7ff456af98f80230432b7ff451af98f80330012b7ff44caf4ff29c54c2f229040290cde9002118e0044660460e4651461746654600f036fcac4631463a46204636e748f2a3513046c0f24501bff32f8f8847dde900210298ac462768bff35f8f2668bff35f8f33466ff39603b3f1005f0bd133684ef66c65ccf2ff05ab4204d17368b3f57d7f00f0c2804ff47d70654600f09efbdde9002106460298ac46002e3ff406af4ff60c43cff6ff73f4182e3384f8f49384f8f59384f8f69384f8f79384f8f89384f8f99384f8fa9384f8fb9384f8fc9384f8fd9384f8fe9384f8ff9384f8009484f8019484f8029484f8039484f8049484f8059484f8069484f8079484f8089484f8099484f80a9484f80b9484f80c9484f80d9484f80e9484f80f9484f8109484f8119484f8129484f8139484f8149484f8159484f8169484f8179484f8189484f8199484f81a9484f81b9484f81c9484f81d9484f81e9484f81f9484f8209484f82194a0d14ef66c63ccf2ff0333604ff47d7373600123b37347f67f73a6f8c4317f2386f8c3314ff6ff734ff29c5433847384b384f38433857385b385f38533867386b386f38633877387b387f387c2f2290454e8003fbb427ff440afbff35f8f00bf44e80063fbb154e8003fbb42f8d034e7dc4580f00c8194f90470631d07f07f05b7f1ff3f4aea455a3ff7e1ae5b4580f0fe8094f90570002f00f1f98004f1060c4aea077ae5e698f8043098f8057098f80650032b47ea052837dd052b58dc042b78d0052b7ff440aed6f86c313bb147f64c67c2f207073f68db1b002b18dcd6f8703186f86a91c6f87091c6f82093a6f88c936bb10c4648f2a35180461846c0f24501174665468847ac4621463a46404647f64c63c2f207031b6845f69077c0f201073b44c6f86c310ee6012b3ff400ae022b00f08780032b7ff406ae17460c466546fff711fb03460298ac4621463a46002b3ff4f9ad96f84631002b3ff4f4ad304641f28831a6f8448109f0a1f947e0062b4ad0072b7ff4e7ad80464df6db50c0f24a0016460f466446804703465d1ea446394632464046012d3ff6d5ad981eb0fa80f04009fff7e3fba446394632464046c9e517460c466546fff7d5fa03460298ac4621463a46002b3ff4bdad96f84631002b3ff4b8adb6f8443143457ff4b3add6f8403186f84691002ba6f844913ff4aaad42f68d411846c0f2440188470298ac4621463a469ee5d6f87031c6f86c91002b86f86a91c6f87091c6f82093a6f88c933ff490ad0f4648f2a35104461846c0f24501164665468847ac463946324648e696f84631c6f83c91002b3ff47bad0446d6f8400165468846174686f84691a6f8449120b142f68d41c0f2440188474af273660120002100220023c0f24606b04720463a464146ac465ce54ff2a513c0f2490303b0bde8f04f184700bf7fb50646002806d1fff75efa002807d19de80f00064649f29b1cc0f24f0c60477fbd00bff0b583b01d46144609294ed106460f46f22d10d8a22160196155062141700b2181704af27571c0f20001033079440b22f9f762fb0e35204629464ff4807200f03df80546ff208df8080044f25220c0f20100019040f2c960c0f24800804798b148f27e30c2f2070000880122c1b264298df8072008d80721b0f5807f38bf03218df807108df80800f82d0cd8d221601961550621417005218170033001a90522f9f72afb0835394630464ef60577c0f2470722462b46b84703b0f0bd70b58ab00c464ff29c51c2f229010b68bff35f8f19466ff39601b1f1005f16d119684ef66c66ccf2ff06b1420fd15968b1f57d7f0bd1694605461846164600f039fc324628462825a24231d244e04d218df8001043218df8011001218df80210002115258df803108df804108df805108df806108df807108df808108df809108df80a108df80b108df80c108df80d108df80e108df80f108df810108df811108df812108df813108df81410a24213d3111b022910d30fd003398d420cd8c22201190255062048708d70c81c69462a46f9f7b4fa6019c41c20460ab070bd00bf46f65450c2f20700016840f2230cc0f2000cfc44c26861454ff001034ff0040008bf0223624508bf0820002a08bf1046002918bf184370472de9f04f81b04ff29c53c2f229031c68bff35f8f23466ff39603b3f1005f40f0cc8023684ef66c67ccf2ff07bb4240f0c4806368b3f57d7f40f0bf80d4f8bc310133c4f8bc314ff6ff739a4238bf134694f87471a4f8c03184f8c2011fb1002a18bf002907d1b4f8c6010130a4f8c60101b0bde8f08f94f87b010028f3d0d4f8840170b147f64c69c2f20709d9f80030c01a002805dd94f87501012809d101270ce0b4f8c8010130a4f8c80101b0bde8f08f94f87771012f18bf022794f87a510020eb0793468846adf80200adf8000012d0022f10d194f8790168b90df1020641f281556b46c0f25b05404611463246a84794f87a515a461646b2f5c86f28bf4ff4c86606f1150a504600f061f8002856d0bbf5c86f88bf45f08005d9f80010d4f8802153230271120a42710a0a8171c2710a0c090e03704d234172a02143700123c17200218370c57002728772017394f87911bdf802204173bdf800108373c173090a0174110a8174310a017500f115014274c6740746084641463246f9f7d1f94ff27d12c0f2470238465146904710f1800fd8bf6ff07f007e28a8bf7e20d4f8801184f8c501481c48f2a351c4f88001c0f245013846884701b0bde8f08fb4f8ca010130a4f8ca0101b0bde8f08fb0b54ff2a054c2f22904216846f23f52c5f28802b2eb510f48f25f514cf67e25c0f24501caf2101518bf25608847002804bf691c2160b0bd10b301684ef66c62ccf2ff0291421bd190f87b11c1b1d0f88411b1b147f64c62c2f207021368cb1a012b0edb1268d0f88801002808bf7047891a42f64d42c0f2440208bf01211047704710b590f875210021c0f8841180f87b11511eb1fa81f149f259624909c0f25902044640f20b10904710f1800fd8bf6ff07f007e28a8bf7e2084f8c4014ef6e374c0f25a04a04704f1bc00bde81040004700bf2de9f04f81b00429c0f0e980834600784d2840f0e4809bf80100432840f0df809bf80200012840f0da804ef66c684ff29c570d46ccf2ff08c2f229074ff6ff7600244ff07f0906e048f2a351c0f24501bff32f8f8847d7f800a0bff35f8f3868bff35f8f01466ff39601b1f1005f07d10168414504d14168b1f57d7f00f098804ff47d70fff752ff002800f0a8804ff60c41cff6ff7100bf42182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d7141600121817347f67f71c0f80080a0f8c41180f8c391068446848684c684068546858685c685068646868686c686068746878687c68757e8001f51457ff457afbff35f8f00bf47e8000121b157e8001f5145f8d04be79bf80310022905dc01290ed0022900f09e800ce003290dd0042908d190f8741129b101b0bde8f04fdce00d2d06d201b0bde8f08f044600f031f987e090f87b1119b390f87521002180f87b11511eb1fa81f149f259624909c0f25902044640f20b1090474ef6e37510f1800fd8bf6ff07f00c0f25a057e28a8bf7e2084f8c401a84705f1bc00804720469bf804100446012988bf002180f875119bf8051001f00302012a4ff0010198bf0a4680f877219bf80630012b88bf002380f878319bf80730022b88bf002380f879319bf808309bf8097043ea0723502b98bf5023b3f5f07f28bf4ff4f073a0f87c319bf80a309bf80b7043ea072341f28837bb4238bf1f46a0f87e719bf80c3080f8741103f0030380f87a3102f00103002103eb5202c0f88011c0f8bc11a0f8c01180f8c211c0f8c811a0f8c6117f2180f8762180f8c51100f009f8204600f04cf8204601b0bde8f04f78e000bfb0b5044690f87a01800758bfb0bd94f875014ef633750128c0f25a0507d105f1b000804705f58b71002088470ee005f5b670804794f87501012801d1002004e094f87701013818bf0120a84794f875014ff6ed120138b0fa80f0cff6ff7249f2015341097a44c0f2590340f20b10984710f1800fd8bf6ff07f007e28a8bf7e2084f8c301012084f87b01b0bd70b5044647f64c60c2f20700006894f87b1145f69075c0f2010500292844c4f8840108bf70bdd4f8880142f66536c0f2440658b94ff69130cff6ff707844002122460023b047c4f8880150b106f594718847d4f8880106f1e8022946bde87040104770bdb0b5044600f5c675082084f88c01032084f88d01102084f88e01002084f88f01c22084f89001062084f8910104f29311204600f065f84ff0280e4ef6057cc0f2470c012009212a462f2384f892e1bde8b040604770b54ff29c50c2f229000468bff35f8f20466ff39600b0f1005f46d120684ef66c61ccf2ff0188423fd16068b0f57d7f18bf70bd94f87b010025c4f8845100b394f8750149f259620138b0fa80f04109c0f2590240f20b1084f87b5190474ef6e37610f1800fd8bf6ff07f00c0f25a067e28a8bf7e2084f8c401b04706f1bc008047d4f8880184f8745170b142f68d45c0f24405a847d4f8880105f166018847002804bf0020c4f8880170bd70b505464d200870432048700120887095f874010c46c87095f87501087195f87701487195f87801887195f87901c87195f87c01087295f87d01487295f87e01887295f87f01c87295f87a01087395f87b01487345f64d50c0f246008047a073d5f880010026e073d5f88001000a2074b5f88201607495f883012675a074a020e074d5f8bc016075d5f8bc01000aa075b5f8be01e07595f8bf01207695f8c001607695f8c101a07695f8c201e07695f8c601207795f8c701607795f8c801a07795f8c901e07795f8ca0184f8200095f8cb0184f8210095f8c30184f8220095f8c40184f8230095f8c50184f82400fff79dfb84f82500d5f88401a0b147f64c61c2f207010a68821a012a0bdb0968401a44f6d35100f2e730c1f26201a0fb01018e0900e00026300a84f8266084f8270070bd00bf2de9f04182b04ff29c51c2f229010c68bff35f8f21466ff39601b1f1005f79d121684ef66c62ccf2ff02914272d16168b1f57d7f6ed194f8cc1179b394f8ce01c0070ad0d4f86c0178b347f64c61c2f207010968401a002827dd47f24c45c2f2070555f8040c002854d042f29707c0f24c074af6e908002607f5437101a8c0f24b0801968847a8b1032084f8cf612860b4f8d001c04702b0bde8f081d4f8d811c1b302b0bde8f0410847204602b0bde8f04133e0019841f60d56c0f24c06a861b04706f5af708047e861b847012084f8cf0103202860b4f8d001c047d4f8e001a0b10199d4f8dc21b4f8d271531a38bf8b1abb420ad2b4f8d41159b147f64c62c2f207021268101a884203d32046022100f078f802b0bde8f08100bfb0b590f8cc41002c4cd044f28442c2f200021188082911462cd0114631f8083f082b27d0114631f8103f082b22d0114631f8183f082b1dd0114631f8203f082b18d0114631f8283f082b13d0114631f8303f082b0ed0114631f8383f082b09d0114631f8403f082b04d032f8481f0829114614d14a68b2f5870f10d36ff35602012a0cd14a684ff65363cff6ff737b449a4204d1d0f8d821002a18bf4a60002180f8cc1190f8cd11b1b1002180f8cd1145f60a61c2f20701097869b947f24841c2f20701096839b14af68171c0f24b010546042088472846002c08bfb0bd0321bde8b04000e000bfb0b588b0044645f64d50c0f246000d468047012840f08f8008208df8010003208df8020010208df8030000208df80400ca208df8050006208df8060018208df8070047f26440c2f2070050f81c2c94f8cc11002a18bf0122002945f60961c2f207014b7818bf0232002b94f8cf3118bf0432002b4ff0410318bf08328df808304c238df8093001238df80a308df80b508df80c2050f8182c4ef605758df80d200268c0f24705130a8df80e208df80f30130c120e8df810308df811204268130a8df812208df81330130c120e8df814308df8152002698df81620120a8df8172009788df8181081688df819106821c2f2000109688df81a10090a8df81b1047f64c61c2f207010a68130a8df81c208df81d30130c120e8df81e308df81f2000680df10102c4f8dc0108680921c4f8e00101201f23a84708b0b0bd00bf2de9f04f83b0022902d24ff0ff35ece0cde901100120cff680704ef66c644ff29c56ccf2ff04c2f229064ff6ff77851c4ff0000947f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d6f800a0bff35f8f3068bff35f8f00ea0501b1f1005f07d10168a14204d14168b1f57d7f00f093804ff47d70fff7a1fa0028c3d04ff60c41cff6ff7100bf42182e3182f8f49382f8f59382f8f69382f8f79382f8f89382f8f99382f8fa9382f8fb9382f8fc9382f8fd9382f8fe9382f8ff9382f8009482f8019482f8029482f8039482f8049482f8059482f8069482f8079482f8089482f8099482f80a9482f80b9482f80c9482f80d9482f80e9482f80f9482f8109482f8119482f8129482f8139482f8149482f8159482f8169482f8179482f8189482f8199482f81a9482f81b9482f81c9482f81d9482f81e9482f81f9482f8209482f82194a0d14ff47d714160012104608173a0f8c4b180f8c381078447848784c784078547858785c785078647868786c786078747878787c78756e8001f51457ff45cafbff35f8f46e8000121b156e8001f5145f8d051e7044645f64d50c0f24600804701281dd1029d6978022916d00129204607d000297ff425af00210025fff77efe0fe0019f41f28831022f0ed14ff4fa730022012741f2883624e02046fff7fafd0025284603b0bde8f08faa78052f11d3eb782e79072f43ea062310d395f805c0ae79092f4cea0627e4d3ee792d7a46ea052607e041f288364ff4fa7301e041f288360127642b98bf64238b4228bf0b4690f8cc1180f8ce21a0f8d031a0f8d271a0f8d46171b147f24841c2f20701096800295ed001210446fff730fe0025c4f8e051bee744f28442c2f200021188082911462cd0114631f8083f082b27d0114631f8103f082b22d0114631f8183f082b1dd0114631f8203f082b18d0114631f8283f082b13d0114631f8303f082b0ed0114631f8383f082b09d0114631f8403f082b04d032f8481f0829114632d14a686ff00105b2f5870ffff483af0123cff680731a40012a7ff47caf4b684ff6c112cff6ff727a44934214bfc0f8d831d0f8d831002b3ff46daf4a60012180f8cc1199e74af60771c0f24b010420884720b105462046fff756fd5be70121204684f8cd118fe76ff0010553e700bf10b582b00c464df6cb61c0f24501884724b12178042901d1617809b102b010bda1780d29fad1e1780029f7d121790029f4d161790029f1d10028efd00168e029ecd10446fef7c2f9014620460029e5d004204ff6591e01904ff0000cc0f24e0e0020002100220e23cdf800c0f047204602b010bd3146fff7c3bf00bfb0b582b00c460546fef7a2f90146002d4ff0000018bf002901d102b0b0bd47f2fc70c2f2070000684df6cb61c0f24501884790b10068e0284ff00000edd129784ff6591c0191c0f24e0c0021002223460090e047012002b0b0bd002002b0b0bd08b530460921fff7cbff002805d002b045f28310c0f24400004744f62703c0f24603984708bd00bf08b530460a21fff7b7ff002805d002b045f28310c0f24400004744f62703c0f24603984708bd00bf08b530460b21fff7a3ff002805d002b045f28310c0f24400004744f62703c0f24603984708bd00bf10b589b38968012805d104460846fef7a3f9204628e039b30a794b798c79c97942ea032242ea044242ea016106291bd147f29121c0f24601044688470146204691b144f2e970c0f24400804701462046002918bf10bd49f2d340c0f2000078440c21fff761ffd4e710bd00bf10b5059c4ff20340c0f2460080472146fff7c0ff10bd00bfb0b5c4b0044600284ff0000000f0c78089b20b2940f0c380207838b96078092804d1a078612801d1e07810b1002044b0b0bdfef7dff80028f8d045f64d50c0f24600804701281cd00228efd103208df8070001200df107058df80800a81c21460b22f8f7c9f94af66104c0f24604f02029460d220023a047b0fa80f0400944b0b0bd4ff29c50c2f22900006801466ff39601b1f1005fc9d101684ef66c62ccf2ff029142c2d14168b1f57d7fbed122797f21042a06dc012a0cdcbab1012a08bf00211ae0082a0bdc052a11d0082a08bf0a2112e0022a0dd0042a08bf01210ce0092a09d00a2a08bf0e2106e0092104e0022102e0032100e00b2180f80b1310216a2580f80c13a22180f80653152580f80e13062180f807531a2580f80f130c2180f80853132580f8101352210822022380f8095380f811134921012580f8042380f8053380f80a2380f80d3380f8121380f8135380f81453217900f5417280f815136179192380f81613a17980f81713002180f81813e17980f81913217a80f81a13617a80f81b13a17a4ff2250480f81c13c0f247040120e021a047284644b0b0bd00bf1fb5fff72bff002803d0bde81f4000207047bde81f4038b584b049f21f13c0f24703184710b5f0281bd1d1b1cab10c78032c16d10d2a1cbf0b2010bd487801281cbf0a2010bd45f64d50c0f246000c468047012803d1a01c0b21fff7fffe002010bdbde81040fdf77fbc00bf4ff29c52c2f229021268bff35f8f13466ff39603b3f1005f10d1d2f800c04ef66c63ccf2ff039c4508d15368b3f57d7f02bf0023c2f8fc32c2f8003347f2c942c0f24d02104700bf4ff29c50c2f229000068bff35f8f01466ff39601b1f1005f0fd101684ef66c62ccf2ff02914208d14168b1f57d7f02bf0021c0f8fc12c0f8001347f2d940c0f24d0000472de9f04184b0dde90a76022f16d340f64705a94212d08eb13578412d0ed175784e2d0bd1014602f0bf0012284ff00d0008bf002b0ed004b0bde8f0810c9d0097cde9016546f63916c0f24d06b04704b0bde8f081082feed3b078012802d1f078022803d90d2004b0bde8f081002953d045f6f444c2f2060414f8040c81424bd12068002848d048f22732c0f254020d4608460221904700283ed024682088d8b36088c8b3a088b8b3e088a8b330797179b279f37940ea012040ea024050ea0368d0d04ff29c50c2f229000068bff35f8f01466ff39601b1f1005f1bd101684ef66c62ccf2ff02914214d14168b1f57d7f10d1f178a1b190f8fc22aa420cd1d0f80023424508d101295bd1082faad100f09bf875e0f07818b1082004b0bde8f081082f9fd1f9f752fec8b10646d0f86c010028f1d047f64c61c2f207010968401a0128e9db96f8fc0268b196f8fd02032809d00628e0d1304600f076f8dce7112004b0bde8f08146f63917c0f24d0707f53a60804707f539622846214690470120002786f8fd020df10f02304600210123a6f8fe7286f8fc52c6f800838df80f70adf80c7000f07ef861884af2bd6603abc0f24c0628460222b047384604b0bde8f081a7f1510189b24ff6b87291424ff00d0119d390f8fd02032808467ff42baf334613f8080fa7f108018ab280b9052a0ed9a1884af2bd67c0f24c072846b847002004b0bde8f081084604b0bde8f08101280dd1042a0bd3981810f8021c00297ff420af10f8010c00287ff41bafe0e702284ff00d0008bf062a7ff4fcae707b01283ff60fafd4e790f8fd120a1f022a38bf7047022905d0012907d1042180f8fd127047052180f8fd12704780b582b0052180f8fd120121adf8061045f6f441c2f2060190f8fc0209684af2bd6c49880df10603c0f24c0c0222e04702b0bde8804070472de9f04fc7b0054690f8fc0203920591d8b145f6f041c2f206010978884214d148f22732c0f2540202211c46904760b195f8fc0240f66502c0f255020021904718b100690088172802d247b0bde8f08f033880b2f42828bff42007af0b3807f101084ff000094ff0000a01900495029414e000bf0699cde94509adf810112121adf8121143f23d5144a8c0f255018847049d029c1ffa8af0a042d6d2a4eb0a01019a1ffa81fbb5f8fe1241235a45b8bf93468df81c304e234a1c8df81d300123a5f8fe22d5f800238df81e30059b1ffa8af08df81f30130a8df82410090a8df820208df82130130c120e8df82510b0fa80f18df823204a091ffa8bf111fa8afaa2458df8223008bf0232bbf1000f8df826202fd001390329039901eb000c01d2002115e04ff6fc700bea00020cf10103002100bf5e1816f8014c7d187078ec725c5cb67804318a422c736873ae73f1d1049d1bf003020dd01cf80160cb19012ade7207d00ceb01004178022a19731cbf8078587395f8fc020bf10b0406900b2010fa84f649f6cd713046c0f24c01884700283ff47eaf26f003031ffa84fc06f003025e426ff00303c1180433f518043581f8049081f8059081f8069081f80790f2d152b10344012a83f8049005d0022a83f8059018bf83f806900bf10e0202701b22442108230272220480f801908170c370417283723ff43dafbcf1040f01d2002214e047f6fc710cea0103002200bfb95c8618f17218f8021008eb020531736978ad78043293427173b573f0d11cf003033ff41fafbe5c00f10b01012b8e543ff418af561cbd5d022b8d553ff412af0232bb5c8b540de7f0b583b04ff29c51c2f229010c68bff35f8f21466ff39601b1f1005f4bd121684ef66c62ccf2ff02914244d16168b1f57d7f40d194f8fc12e9b3002840d002888a423dd145f6f446c2f2060616f8041c8a4235d1316899b3356894f8fd12032919d8d4f86c1139b147f64c62c2f207021268891a00290edc02218df80b100df10b020746204600210123fff78dfe2046fff75cfe38468278092a1bd141896b8894f8fd72994217d1032f3adc012f6ad0022f3dd004e018b181780939022901d203b0f0bd47f6ed31c0f24d0103b0bde8f040084794f8fd72032ff1d8a2f10d0102290cd2c178d1b302208df8040001aa204600210123fff757fe03b0f0bd092a08bf032fdcd14189aa889142d8d1c078002800f0818002200df105028df80500e6e7052f04d0042fcad1c07805262fe0c078002848d0062084f8fd0202208df807000df10702204600210123fff72cfe052fb5d02046fff7f9fd03b0f0bd4268002aadd00389a3f2012189b2b1f57e4fa6d34089082b48d12988884245d12046012108234ce0c0780526002808bf022650b102208df80a000df10a02204600210123fff701fe6988012294f8fc024af2bd67adf8082002abc0f24c07022284f8fd62b84703b0f0bd052f15d1002094f8fc523668c4f8fc02c4f8000347f2c944c0f24d0404f11000804728463146224603b0bde8f0401047032084f8fd0201208df806000df1060272e7e98888427ff457af2046022103e0204603210022002303b0bde8f040bfe506290ad14178012907d18178653911f1630f02d3c178012902d94ff0ff307047f0b581b00179427941ea022540f6b8318d421fd80646fdf7fdfbd8b1f9f734fbc0b10446d0f8d80342f66537c0f2440758b941f26f60c0f200007844012100220023b847c4f8d80320b107f1e8022821904718b14ff0ff3001b0f0bdb078f178d4f8e4230023c7f6e07340ea452003ea425240ea0120bff35f8f1043bff35f8fc4f8d403002001b0f0bd00bf02293cbf4ff0ff3070472de9f04f9bb00278437842ea0325b5f5007f04d94ff0ff301bb0bde8f08f4ef66c6a4ff29c56ccf2ff0ac2f229064ff6ff774ff0000b4ff07f090791099008e000bf48f2a3512046c0f24501bff32f8f8847d6f80080bff35f8f3468bff35f8f20466ff39600b0f1005f07d12068504504d16068b0f57d7f00f09a804ff47d70fef7d5fa002800f0928004464ff60c40cff6ff7000bf21182e3081f8f4b381f8f5b381f8f6b381f8f7b381f8f8b381f8f9b381f8fab381f8fbb381f8fcb381f8fdb381f8feb381f8ffb381f800b481f801b481f802b481f803b481f804b481f805b481f806b481f807b481f808b481f809b481f80ab481f80bb481f80cb481f80db481f80eb481f80fb481f810b481f811b481f812b481f813b481f814b481f815b481f816b481f817b481f818b481f819b481f81ab481f81bb481f81cb481f81db481f81eb481f81fb481f820b481f821b4a0d14ff47d7060600120a07347f67f70c4f800a0a4f8c40184f8c39127846784a784e78427856785a785e78527866786a786e78627876787a787e78756e8000f40457ff455afbff35f8f00bf46e8004028b156e8000f4045f8d049e70024ddf824805db1fdf7e2fa0146002c4ff0ff3018bf002902d11bb0bde8f08fb5fa85f040094ff000098df82c908df82d908df82e908df82f908df830908df831908df832908df833908df834908df835908df836908df837908df838908df839908df83a908df83b908df83c908df83d908df83e908df83f908df840908df841908df842908df843908df844908df845908df846908df847908df848908df849908df84a908df84b908df84c908df84d908df84e908df84f908df850908df851908df852908df853908df854908df855908df856908df857908df858908df859908df85a908df85b908df85c908df85d908df85e908df85f908df860908df861908df862908df863908df864908df865908df866908df867908df868908df869908df86a908df86b90bcb1d4f87021a2b14ff4006304e03f683b44b3f5403f0cd2d718be680136f6d07e68033626f0030609eb060101f11009ede7002d4ff0020a039500f00581ddf81cc0acf102020a2ac0f00081002608eb0a0b9bf801504ff0ff30012d3ff648af9bf802209bf803309bf8047042ea03229bf8053042ea074747ea0361a1f1011212f5803f0a91fff433af9bf808109bf809e0029141ea0e210af10a020497aceb02034f1e9f42bff423afcde905269bf806209bf807300a9e42ea032cb6eb0c07fff416afb9423ff613af18f80a70089147ea052a4feada000ba90e5c07f00705012707fa05f5354240f001830e5c45ea06050d5407994ff6ff75c0f20205b4b3d4f8700198b317461a0201924fea0e264ff4006200eb0208d8f8083053454bd0d8f800301a44aa4221d800eb0208d8f80830534540d0d8f800301a44aa4216d800eb0208d8f80830534535d0d8f800301a44aa420bd800eb0208d8f8083053452ad0d8f800301a44aa42d3d900bfbcf1000f40f0bc8204980a464ff6fc710330c0f2030108404844944600f1100908980599069e00eb010a0398013686424ff0000028bf0120ddf824804fd2aceb0a02092a3ff64caf49e0d8f804000a9a904240f09582d8f80c006045c0f0908236d9089aa0eb0c00824200f289827ab3029831180198c1f1000cc2199044a1f1010e002208eb02050beb0203287c9e7ab04240f0758296451cd06e7cdf7abe4240f06e820ceb0207be1c13d0ae7c187b864240f06582079ef81c07d0e87c5b7b984240f05d8204329142dbd1b446a7e78c46a5e7ddf81cc0a2e7ddf81cc0002800f04e82baeb0c004ff0000118bf0120b9f53e3f88bf0121014303980028c1f100003ff43eae00297ff43baed4f870b1bbf1000f40f08b804ff44030fef764f8002800f02d82834600206ff0200100220beb02030bf8020040320beb0107b2f5006f01f1400158709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d87618775877987787f8400087f8410087f8420083f8220083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f0093d14ff43e30cbf800080020cbf804084ff0ff31cbf80c084ff40060c4f870b1cbf80818c4f820034ff6ff760221c0f202064ff000090ae00aeb080109f10109ddf8248099454ff000003ff497ad08eb010518f801006f78cdf81c900a9195f802c0eb7895f804906a7995f806a0e97995f808e06d7a40ea072808955cb3012f29d84ff400670beb0705a868404500f0a28028680744b7421dd80beb0705a868404500f0988028680744b74213d80beb0705a868404500f08e8028680744b74209d80beb0705a868404500f0848028680744b742d7d94cea032040ea094040ea0267f81c20f00300d4f82093cdf818a000f1100a0020cde904e10297b9f1000f26d00beb09035bf809105a68514580f09b80eab10beb02005bf80210d0f80490514580f08c80b9f1000f11d00beb09035bf809105a68514580f0868042b10beb02005bf80210d0f804905145d6d376e000204ff400694ff4006504e000bf3d44b5f5403f23d20beb05018a685bf805700132f4d04868ca68033020f0030000f110060beb09001032f7f721f94168c2684bf809608368d4f870b18a424ff00001b14408bf00f110014bf82310d7e7c9f540310f294ff00002c4f8202310d90beb09004bf809104ff0ff3142608160c260c4f820930ae0e868039b0a9a089f60e010b10268114401604ff000090020b9f1000f7ad00beb09035bf809105a68514522d2002a71d00beb02005bf80210d0f80490514513d2b9f1000f66d00beb09035bf809105a6851450ed2002a5dd00beb02005bf80210d0f804905145d7d30546cc469146184601e01d469446a1eb0a0110290fd309eb0a020beb02034bf802104ff0ff31c3f804c0996000219446d960c5f800a0039b0a9addf818a0dde904e1089f00280cbfc4f820c3c0f804c002984ff6ff7668600020c0f20206c5f80880e8604aea0121ddf81c904eea072a814202f10a087ff4c0ae05f1100778180999524641449b46f7f736f8e9685b466868aa68d4f870b15144e96081424ff0000018bf07464bf82270a6e600204ff400684ff4006703e02f44b7f5403f23d20beb07018a685bf807500132f4d04868ca68033020f0030000f110060beb08001032f7f755f84168c2684bf808608368d4f870b18a424ff00001b04408bf00f110014bf82310d7e7c8f5403200210f2ac4f820130dd90beb08034ff0ff304bf8082059609860d960c4f820831bb0bde8f08f00281ebf0168114401604ff0ff301bb0bde8f08f00bf02293cbf4ff0ff3070472de9f04f8bb00278437842ea0325b5f5007f00f2f08005eb4502022303eb4202914240f0e8800590fcf7bbfe002800f0e2804ef66c694ff29c56ccf2ff09c2f229064ff6ff77002447f67f784ff07f0b06e048f2a351c0f24501bff32f8f8847d6f800a0bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168494504d14168b1f57d7f00f096804ff47d70fdf7e0fd002800f0af804ff60c41cff6ff7100bf42182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d7141600121c0f800908173a0f8c48180f8c3b1078447848784c784078547858785c785078647868786c786078747878787c78756e8001f51457ff459afbff35f8f00bf46e8000121b156e8001f5145f8d04de7d0f870c10495bcf1000f20d000234ff4006104e03f683944b1f5403f0bd20ceb0107be680136f5d07e68033626f0030633441033eee775b9b3f53e3f40f2e0804ff0ff310bb0bde8f04f08467047002d00f0d680002305994ff0000901f1020a153103914ff0ff31059109eb49060aeb46056c784ff0ff31012ce3d8af78ea7857ea022e1ebf2a796d7952ea0528d9d0bef5207fd6d8b8f5f07fd3d80ef10102520802fb08fb4ff6fb724ff6ff779345c0f20207c6d81af81610059e41ea0421039cb9f1000f28d014f8132c14f8125c42ea05228a42b3d0feb114f80d2c14f80c5c42ea05228a42aad0012e15d014f8072c14f8065c42ea05228a42a0d0022e0bd014f8012c257842ea05228a4297d0043e721c04f11804d6d15646bcf1000f2fd00bf105054ff400640ceb040adaf808208a4230d0daf800201444bc4220d80ceb040adaf808208a4225d0daf800201444bc4215d80ceb040adaf808208a421ad0daf800201444bc420ad80ceb040adaf808208a420fd0daf800201444bc42d3d94ff6fc720bf10801c0f201021140194401f1100320e0daf80410a9427ff44fafdaf80c10a9427ff44aaf9af8101004297ff445af9af811109af8122041ea022171457ff43caf9af813109af8142041ea022141457ff433af049909f1010989450599b24601f1010105917ff43dafb3f53e3f3ff624af00240025019019e000211fe7d0f870c14a688b684ff6ff7793454ff00002c0f20207c1f80cb008bf01f110024cf82320013575454ff000013ff408af05eb45000aeb40011af8100091f8018091f802e091f803b091f804904979bcf1000f40ea082605912cd0b8f1010f29d84ff400610ceb01039a68b24200f0a8801a681144b9421dd80ceb01039a68b24200f09e801a681144b94213d80ceb01039a68b24200f094801a681144b94209d80ceb01039a68b24200f08a801a681144b942d7d94eea0b21059b013149ea0322490801fb02f75a4607f1050b8df81d004fea1b208df820004fea1b408df8210005208df82500042001218df8270048468df81b1003908df82a000df11b0011218df81c408df81e808df81fb08df822408df824408df823408df82640cdf808e08df828e091468df829208df82b30fff797f800287ff482ae01980021d0f870c1bcf1000f3fd0ddf810e0b8f1010f3cd84ff400630ceb03018a68b24235d009680b444ff6ff71c0f202018b4226d80ceb03018a68b24228d009680b444ff6ff71c0f202018b4219d80ceb03018a68b2421bd009680b444ff6ff71c0f202018b420cd80ceb03018a68b2420ed009680b444ff6ff71c0f202018b42cbd9002104e0ddf810e02ee7ddf810e0002f3ff41aaf4fea0922029f059b42f001023a44039f1b0252083b4353435a1e032a01d200220ae023f0030700228e18043297427475b475f4753476f7d113f003033ff4f8ae01f11507012bbc543ff4f2ae3a44022b547018bf9470ebe62de9f04f81b04ef66c644ff29c55ccf2ff04c2f229054ff6ff7600274ff0010a47f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d5f80090bff35f8f2868bff35f8f01466ff39601b1f1005f07d10168a14204d14168b1f57d7f00f094804ff47d70fdf702fb002800f005814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ff47d710460416080f80ea0a0f8c4b180f8c381068446848684c684068546858685c685068646868686c686068746878687c68755e8001f49457ff45aafbff35f8f45e8000121b155e8001f4945f8d04fe7d0f88813002974d104464ff41630fdf769fa014600284ff0000069d0002200bf8b1888544032b2f5163f58709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d876187758779877d87783f8200083f8210083f8220083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f009ad1c4f8881300e00021084601b0bde8f08f00bf2de9f04f93b04ff6ff75a9424ff0000c2cd0dde91c874ff4805ecde90aecd0f89ce3cde90087229fdde920a9dde91e6b249c0697239f0aadcdf840c0cde911eccde90845cde9026bcde904a90546079704f0b8fe84464cb1bcf1000f06d19df8480095f8a013084385f8a003604613b0bde8f08f2de9f04f93b00446002047f64c65a4f8a003c2f207052868002a89461abfc4f894030146d4f89413401ac4f89c03fcf749fa002800f05a81d4f88803002800f0558104f0e7ff002800f050810646b4f88c03002853d0a0f10108d4f89c0300254ff4a0714ff4f0774ff4805acde911050df1280bcde901152046414632464ff42073cde90aa51095cdf824b0cde90755cde90555cde90355009704f059fe002840f02481d4f89c034146cde91105012008904ff4a0700190204632464ff420734ff4f077cde90aa51095cdf824b0cde90655cde90455cde90255009704f038fe002840f003819df8480094f8a01347f64c65084384f8a003c2f2070506e0d4f8881330464ff41632f6f7defa4ef66c684ff29c57ccf2ff08c2f229074ff6ff764ff0000a07e000bf48f2a351c0f24501bff32f8f8847d7f800b0bff35f8f3868bff35f8f01466ff39601b1f1005f07d10168414504d14168b1f57d7f00f098804ff47d70fdf706f9002800f0c4804ff60c41cff6ff7100bf42182e3182f8f4a382f8f5a382f8f6a382f8f7a382f8f8a382f8f9a382f8faa382f8fba382f8fca382f8fda382f8fea382f8ffa382f800a482f801a482f802a482f803a482f804a482f805a482f806a482f807a482f808a482f809a482f80aa482f80ba482f80ca482f80da482f80ea482f80fa482f810a482f811a482f812a482f813a482f814a482f815a482f816a482f817a482f818a482f819a482f81aa482f81ba482f81ca482f81da482f81ea482f81fa482f820a482f821a4a0d14ff47d7141600121817347f67f71a0f8c4117f21c0f8008080f8c311068446848684c684068546858685c685068646868686c686068746878687c68757e8001f59457ff456afbff35f8f47e8000121b157e8001f5945f8d04be7064604f0bffe002e18bf002803d1012089f8050022e0c6f864014ff0010a4ff4f07086f868a101904ff420704af61f4c0090c0f2470c00200021002200230027e04730b186f86871c6f8647189f805a004e099f8050089f804a030b14ff0ff3013b0bde8f08f0026cbe794f8a00384f8a10338b3d4f8900342f66536c0f2440620b129682d31c4f8981310e044f6dd70c0f200007844002122460023b047c4f89003296801f12d01c4f8981320b106f1e8022d21904728b1002084f8a10313b0bde8f08f002013b0bde8f08f80b582b04ff4f0704af61f4e01904ff4207cc0f2470e0020002100220023cdf800c0f04702b080bd022a3cbf4ff0ff3070472de9f04fadf2345d239008784f780a4450ea072001f10207249002f04483259300232292974202f03883781c904202f0348338787978be1c40ea0121901b81422c962f9102f229832598ddf880253690ddf85805ddf878153790ddf85c053f913890ddf8600527933990ddf864053a90ddf868053b90ddf86c053c90ddf870053d90ddf874053e901068411e0028116002f003832f98002802f0ff822f98841c032c02f0fa82fe78072e02f2f6822c9890f80090f00702d107f1040e27e02f9820f00100022802f0e88297f804a07d7923984aea052b594636aa02f0ecfa002842f0db82ddf8640507f1060e012d3a900dd8ddf88005806948b14feadb020af00701835c012505fa01f119438154b00707eb0408cdf8a08005d44ff0000a042e29d2a1e000bfc64505d01ef9014b4ff0000af34603e000244ff0010ac34645f64d55c0f24605a847012808bf0134601e81b2670800ebd130002c48bf4710a84701283a9808bf7f42ddf8a0803844de463a90042e78d3baf1000f42d1c64540d0724612f8011b3a9842453dd09ef801200ef10203120642ea0141434500eb214c3ed00ef103029ef80210424534d09ef803200ef10403120642ea014143454fea214129d00ef105039ef80420434500f0ac869ef805700ef10603434542ea072200f0a3860ef107079ef80630474501f0dc829ef807700ef1080e3f024ff0000a15e03a98002100e0c64600eb010c4ff0010a0022002108e04ff0010a002203e04ff0010a00220021c646002300273b433b9f62440b447fb1dde93c76dde93e40bc45d8bfbc46b142d8bf3146a242a8bf22468342a8bf0346ddf8a0800120cde93cc1cde93e233b90baf1000f42f01582b9f1040f40f38380b9f1060f40f3f380b9f1070f00f0b982b9f1080f00f06c81b9f1090f42f00182c64502f0fe811ef801abc64542f0f981baf10f0f02f2f581ddf87c05002801f078833b993698dde93829002900f029863799dde93d733f9e994227eae775b8bf0b46b242b8bf1646b542359681f261833c994fea630c21eae17b4fea0a11339135990bf10104491b4fea5b0e4aea0a1211f003084fea54013494329100f0f7869b4581f2638205fb09045feacb7171465e4609d014f80e10349e01f0f00141ea0a0104f80e10329961452144319681f23f8204eb0c060c4604f8012bb44281f039828f1cb7424a7081f03582cf1cb7428a7081f030820f1dca70b7423946ead301f029ba00bfb9f1020f37dcb9f1010f00f06f81b9f1020f42f083813698dde937763490ddf88005dde939a1dde93b45dde93d32ddf8fcb0c0694ff00009c645cde946e8cdf820914290cdf80c91cde92a32cde928152e9400f07c820ef1010046909ef80090404500f074820ef1020046909ef80100b84604026fe2b9f1030f00f09681b9f1040f42f04b81dde936c0dde938633490ddf88005dde93aa2dde93c74dde93e59c0694ff0000bc645cde942e8cdf810b14090cdf804b1cde9323c3596cde92d74cde9305200f0af820ef1010042909ef800b0404500f0a7820ef1020042909ef801004fea0028a2e2b9f1050f00f0fa81b9f1060f42f01281c64502f00f810ef10100404502f00a810ef10200404502f005810ef10300404502f000810ef10400404502f0fb800ef10500404502f0f6800ef10600404502f0f1800ef10700404502f0ec800ef1080ca8eb0c001028c2f0e5800ef11800404542f0e0809ef804009ef8051050ea01261ebf9ef806009ef8071050ea012502f0d1809ef800009ef80120379940ea0224081bc2f0c780864202f2c4809ef802009ef80330389a40ea0327d01bc2f0ba80854202f2b780ddf87c05002801f03a8239980df1e80e369b34909ee8014fcdf8d4e0cde906478de8010f1846dde93437cdf828c0cde90865059704f0d7f801f021ba36983999339037983591349038983a9931904046cde94ee0ddf880053291c06900214eac46aedde93b7bdde93da5ddf8fc805091cde946012046314602f03ffb81462046314602f03afb5099002940f0ac82dde94ec2cdf8c080944500f0a5820cf10101914200f0a0820cf10201914200f09b820cf10301914200f096820cf10401914200f091820cf10501914200f08c820cf10601914200f087820cf10701914200f082822d909cf800009cf804102b909cf805003b4628900cf108005e46d646cdf8a8909cf801b09cf802709cf8039029919cf806a09cf80710a2eb0008b8f1010f2e9141f0fe80904200f05d829cf808100f2900f258820cf1090001f0f3b8c64502f01580724612f8010b012802f20f80369900283091dde93751359139993191dde93ac134913c992d913d992b913e992a913f99299100f0d982424501f0f7870ef10202424501f0f2870ef10302424501f0ed870ef10402424501f0e8870ef10502424501f0e3870ef10602424501f0de870ef10702424501f0d9870ef10802424501f0d4879ef801209ef802309ef8046042ea03239ef803209ef805409ef80610774642ea062e44ea012af9793a7a07f109041a9441ea0221b8e2a8eb0e06052ec1f0b4870ef10505454501f0af870ef1060b9ef80540a8eb0b00a042c1f0a6870beb0400404541f0a187369820903798359038982a9039981f90dde93a9034903c9831903d983290dde93e803390ecb14ff0000a04e000bf0af1010aa24515d21bf80a0001381e28f6d90beb0a00a4eb0a014eaa46ab774602f07cfe002801f075874e98be468244a245e9d3ddf87c05002801f0f3803498cdf8c090f146002800f0b283319820eae0703190329820eae070219035984045a8bf404635902a9833998842a8bf08462a90a0e3c64501f04d870ef10100404501f048870ef10200404541f04387704601784078dde93b5441ea0021ddf880050df1d80c0990ddf87c059ce80c10089004a8dde93976ddf8f490ddf8f8e0ddf8fc8080e810422398cde900c7cde90265cdf81c8004f0b2f8074659e1ddf880050df1f00adde936c1dde93853dde93a629ae89004ddf8fc90c0694ff0000bc645cde946e8cdf820b14290cdf80cb1cde9323ccde93451cde92d47cde93062cdf8ac9000f022810ef1010046909ef800b0404500f01a810ef1020046909ef801004fea002815e10120b8464890002446ad42af2846394602f0a3f935902846394602f09ef9489907460029cdf8b4b0cde9324a00f0148144460025002031900120bb464890002046af0df5847a30903846514602f085f980463846514602f080f94899002940f0f2800346dde946014ff0ff37884240f0ec80ddf8d4e0bef1000f00f1e680bbf1000f00f1e280ddf880254398116a329f08431062349847ea09074e904ff6fe7087423398dc46a246b3464f945096519000f0e5834ff6ff70874240f0c1832398d0f888934ff420704f904ff4f07050904ff4a0705190d4e3012044904ff0000842ac40ad2046294602f037f906462046294602f032f94499002940f0a480dde94212914200f09f8011f8014b914240f09a80ddf8803541991a6a1143239a1962002a00f09080d2f870114ff0ff37002900f08b8048ea0b030022b2eb532f40f0848051f82320002a00f07f80a2eb010e5fea8e7279d16ff4403240f60f057244cff6fd75aa4270d301eb0e0c5cf8081c99426ad15cf80c1ca1f1011212f5803f63d3bcf1000f60d05cf8042c8a425cd1cef54032914258d82b90ddf880051d46806950b1eb080bf0070e10f80380012202fa0ef242ea0802c2546046002246ab01f061fe00284ff0000708bf4ff0ff373bd0ddf87c05c0b3a6f1011010f1021f4ff0000731d92b98a0f1011010f1021f2bd93198002300284e9301f07f822d98349920eae0722e9820eae07330988142a8bf0146359834914845a8bf4846359001f06dba012048904ff0000846af42ac3846214602f091f881463846214602f08cf8489951b34ff0ff37229a279b002f00f0478701f0bbbddde9460188423ff4e7ae024612f8015b8a42469200f0bf82821c469243788a4245ea032500f0b782c21c469283788a42319300f03486011d4691c078bb4644460002d1e6dde946218a42d0d0134613f8014b8b42cbd0951c56784a1bb2424ff0ff37c6d3aa198a42c3d1ddf8803543991a6a1143239a1962002abad0d2f87021002ab6d048ea0b0e0021b1eb5e2fb0d152f82e100029acd0891a8b07a9d16ff44033bc4640f60f070b44cff6fd77bb4267469ed3531853f8082c724597d153f80cccacf1011212f5803f90d328aa002b4ff0ff3782e8604026903ff48aaf53f8040c60457ff485afc1f540302a9984453ff67fafddf880051d468069664640b1ca080bf0070c835c012101fa0cf119438154c12efff46daf287801287ff469af2998002801f02380dde928b8a5f13f0700f0bcbf424501f01e850ef10202424501f019850ef10302424501f014850ef10402424501f00f859ef801209ef80260714693004fea460eca780e7905314fea820a1a917100baf1000f1b9101f0fb841b99002901f0f784ea1ac1f0f484924501f2f1843599b1eb0e02c1f0ec841b99914201f2e884349903eb0c06084301d000230be05feacc704ff0000306d1002e04d40aeb0600a842d8bf01231a9f1b9aa8eb07001890ddf87c0502fb0af9b0fa80f0400918430024c0074ff0000b19931f902e95cdf8709022e0dde9303002fb003c4a081cf80230339803f00f0803f0f0030344c907329808bf48ea0003ddf8a0800cf8023026988344dde9200181424ff0000088bf01200443e00708bf0f44e10704d0d94507d801f095bc00bf474518bfd94540f2a281b8eb070001f08b8439780b0901d0012211e0012801f083847b780bb102220ae00428c1f07c84ba78fb7852ea032301f07684042200bf2192a9eb0b02934201f26e8420901f9826930028c0d101f00f003390269809010128cde91d7432912dd14ff0000c2698ddf8a0801e9cdde91c97c007acd00ceb0b00b0fbfaf101fb1a0001eb0e02811952ea0100a0d4a9429ed2359882429bd2349800283ff482af2d98814294db2b98824291db2a988142bff68eaf29988242fff674af88e720f001014ff0000c16e0dde93030339f04fb00305308c45cd20704f00f0504f0f0043c44329a08bf45ea02042e9dc4540cf1020c6145b7d00beb0c02b2fbfaf404fb1a2704eb0e0907eb060859ea080427d4a84525d23598814522d2349858b12d9880451ddb2b9881451adb2a98804517da2998814514dadde930304fea580709fb00343398e35d03f00f0503f0f00303445feac870329808bf45ea00032e9de355501cb0fbfaf202fb1a0002eb0e04821954ea0200bbd4aa42b9d235988442b6d234980028a0d02d988242b0db2b988442addb2a988242aada2998844294dba6e70aeb0a1109fb02f2f5f7defa00f040bd00234ff0010ac646fff77bb9002021903190052e01f0ac832098002801f0a883fbf7f4f8002801f0a38395f800a00af10600864241f09c8347f65420c2f207000768002f01f09483387b797bba7bfb7b40ea012040ea024040ea0365a5f1810010f1800fc1f08483387c797cfa7c40ea0120b97c40ea014040ea02601490813810f5817f41f27483baf1000f4ff000001b97339077d04ff0000e00270ae000bf00f100404ea941f826000137574506f1010e17d21bf807007646411e1e29efd90beb0700aaeb070146aa42ab02f054fa00283ff489ad469942984eaa0f4442f82600e3e7bef1000f329500f0df80aef1010b4ff0000a4ead09e0be46d3450af1010aa6f1010605f1040500f0cd804ea850f82a100029f1d40020534686421dd005eb80077a68b2f1ff3f18dc5a1c934514d0ba68b2f1ff3f11dc9a1c93450dd0fa68b2f1ff3f0adcda1c934506d03a690433002a00f10400e0d400e000221b9846ab42ac7746009402f092fa00283ff43bad42980028c0d04af20d3146a8c0f24e018847b9e7329501204ff0000e90e04446fff720bc474508bfd94541f0e882ddf87c05002818bf012019990840012840f06684dde9300318990efb03004fea5a0700eb56021b98009701901a9801f09ffb002840f0548401f0caba2f4600f04abc239839464eaa1e46644601f0cefa00287ff4f9acddf88005ddf8d4e08069a446334660b10021b1eb572f08d1fa0809f00701875c012606fa01f139438154ddf838912a46b9f1000f3ff4ddac002a4ff0ff371cbfdde9301050ea01003ff4d5ac4f997145fff4d1aca1eb0e018a423ff6ccac50996145fff4c8aca1eb0c0188423ff6c3acddf87c15002700293ff4bdaca8f101111d4611f1021f7ff6b6ac2e99002900f02b85299921eae1732a9921eae1742b998a45a8bf8a462d998b45a8bf8b4600f01dbd002002e04ff0000e012099f804200f21950602f00f0601eae575754389214d43ed0a99f800c08df808510e2599f801a099f8023099f80370349212f0200f08bf012506fb05f501fb05f54fead5258df809514ff00d0508bf022506fb05f501fb05f54fead5258df80a514ff00c0508bf032506fb05f501fb05f54fead5258df80b514ff00b0508bf042506fb05f501fb05f54fead5258df80c514ff00a0508bf052506fb05f501fb05f54fead5258df80d514ff0090508bf062506fb05f501fb05f54fead5258df80e514ff0080508bf072506fb05f501fb05f54fead5258df80f514ff0070508bf082506fb05f501fb05f54fead5258df810514ff0060508bf092506fb05f501fb05f54fead5258df811514ff0050508bf0a2506fb05f501fb05f54fead5258df812514ff0040508bf0b2506fb05f501fb05f54fead5258df813514ff0030508bf0c2506fb05f501fb05f54fead5258df814514ff0020508bf0d2506fb05f501fb05f54fead5258df815514ff0010508bf0e2506fb05f501fb05f54fead5258df816514ff0000508bf0f256e434e43f60a00288df8176140f024824fea0a6242ea0c41309a380602eb214b329940ea0340ddf88480ddf86ca0aef1010501eb204000261390cdf85ce0159507e001f01f000b3801367645834400f0f8814ea850f82610b1f1ff3ff1dd33469d421cd04ea800eb83004268b2f1ff3f16dc0133ab4212d08268b2f1ff3f0fdc0133ab420bd0c268b2f1ff3f08dc0133ab4204d002690133002ae1d400e00022504646ab40af009702f0d5f8002800f0d081409900291d9100f0ba819df820019df82111189650ea0125cdf868b000f09f819df824719df825613f0447ea0667149e9df81f019df81e112e444fea002c41ea00229df8220106eb2747139e9df823310004f71b1a9e40ea03604ff0010e06eb204b28920eeb520203141c920ceb010201f003000bf1010119910bf1020116911d992d97571e1e97f718f31a01312990101a2e910eeb5201319a3390d8074ff000093290f8072b913090269509e000bf2e982b9909f10109a94508442e9000f04e812d9809eb00034345f1db2a988342eeda28980028ebd0dde91f104ff0000a03fb01071e98032880f09c802998ddf88480269d0028dbd0dde91c10012309fb010c34984fea5a011cf8011000f0100083ea1014c8b201f00f035feaca7e08bf03091846002b18bf01202043012815d10aeb0b06964211db359886420eda7008395c42adeb5c01f00f0501f0f0011943f60708bf45ea0311269d395429980128a6d00af1010040081cf80000bef1000fc1b24fea111808bf00f00f085ffa88f0002818bf01202043012817d119980aeb0003934212db359883420fda5808395c42ae16f8086001f00f0501f0f0013143db0708bf45ea0611269d39542998ddf8848002283ff474af0af1020040081cf80000bef1000f00f00f03c1b208bf0b091846002b18bf0120204301287ff460af16980aeb00069642fff65aaf35988642bff656af7008395c42adeb5c01f00f0501f0f0011943f60708bf45ea0311269d395445e7ddf8b8c008e000bf33980af1040a50450cf1020c3ff458af34981cf8016c00f010030120f6b2002580ea13130f2e88bf01251d43012d0beb0a0815d1904513db3598804510da4fea58053609795d42a8865d01f00f0401f0f00131435feacb7008bf44ea061179551cf8010c10f00f0e704618bf01201843012818d108f10106964214db3598864211da7008395c42aa12f80e6001f00f05329c319a45ea061501f0f001002c08bf41ea06053d549cf80000c6b200200f2e88bf01201843012816d108f10205954212db359885420fda690830097e5c42ad285c06f00f0506f0f006309c0643002c08bf45ea00167e549cf8000010f00f06304618bf0120184301287ff481af08f103039342fff67caf35988342bff678af5808395c42ab9b5d01f00f06329d46ea031601f0f001002d08bf41ea03063e5466e74af20d3146a8c0f24e0188479df81c019df81d11dde91aba159ddde917e605e09df81c019df81d11ddf85ce040ea012002e6002007e000274ff0010ac646fef73cbd4ff0ff303390339ffff7aab94446fff79eb80f4600e04f1cd90708d03199994205da3978339c01f00f0121433970b8f1010f05f1010700f0d8809b4580f2968007fb09045feacb7171465e4609d014f80e10349e01f0f00141ea0a0104f80e10329961452144319614da04eb0c060c4604f8012bb4426dd28f1cb7424a706ad2cf1cb7428a7066d20f1dca70b7423946edd360e00f465ee0102190427ff45ea92b9ab84652ea0b2c4ff0ff373ff458a958ea092226923ff453a9bcf5207f3ff64fa9269ab2f5f07f3ff64aa9baf10f0f2191cdf87ca03ff643a92e9910293ff63fa9ddf88005479a016a1143ddf87c250162002a00f08a8332992a9a614449428a42c0f283833499329a0027891a2a9a8a42bff625a926992d9a49428a42fff61fa92d9a31988242bff61aa9002b00f0858326eae671209134992eeaee7ea942a8bf2946dde9303034919842a8bf1846319077e34f1cd90708d03199994205da3978339c01f00f0121433970b8f1020f05f1020739d09b4536da07fb09045feacb717146d8460ad014f80e10ddf8d08001f0f00141ea0a0104f80e1032996145214414da04eb0c060c4604f8012bb4420fd28f1cb7424a700cd2cf1cb7428a7008d20f1dca70b7423946edd302e00f4600e04f1cd90707d0984505da3978339c01f00f0121433970ef1c3599691a11f1040f11d9229a279b2498013383422c982f9900eb01077ef432ab00f071be00bf359904378f42edd09b4539da07fb09045feacb7171465d4609d014f80e10349d01f0f00141ea0a0104f80e1032996145214418da04eb0c060c4604f8012bb44280f0cd8001f10208b0454a700cd201f10308b0458a7007d201f10408ca70b0454146e9d300e08846d90709d09d4207da98f80010339c01f00f01214388f800109b4536da791c01fb09015feacb7474465d4609d011f80e40349d04f0f00444ea0a0401f80e40329c644501eb040615da01eb0c04314601f8012ba14280f09580b11ca14272700ad2f11ca142b27006d2311df270a1420e46ecd300e03146dc0707d09d4205da0c78339d04f00f042c430c709b4536dab91c01fb09015feacb7474465d4609d011f80e40349d04f0f00444ea0a0401f80e40329c644501eb040615da01eb0c0400bf314601f8012ba14260d2b11ca14272700ad2f11ca142b27006d2311df270a1420e46edd300e03146dc0707d09d4205da0c78339d04f00f042c430c709b45bff64baff91c01fb09015feacb7474465d4609d011f80e40349d04f0f00444ea0a0401f80e40329c644501eb040615da01eb0c0400bf314601f8012ba1422ad2b11ca14272700ad2f11ca142b27006d2311df270a1420e46edd300e03146dc073ff41baf9d42bff618af0c78339d04f00f042c430c7010e701f10108d9077ff442af4ae7711cdc077ff478af7ee7711cdc07acd1b3e7711cdc07e3d1fde6b8f1010860d01bf8010b411e1f29f7d341b22029fef698af07eb400117f81000497840ea0122c12afef48eaf284631464eab00f0a9fd0028e2d1fef785bf002400235345b8bf5c45bef680af289908eb01065645bef67aaf5d45bef677af991a8e427ef773af211a8d427ef76faf9f1b1946b8bf3146b342e0464ff0000cd8bf6746be44d31b671bd8bf6746c61ba542aaeb0100c8bf2c46834238bf1846abeb04039e422e9328bf1e46349b2b96994507eb080329932d9442d1299b2d9f9f422fdd4ff0010c3be0ddf87c05002800f09381a9f1011010f1021f4ff000077ef635af2698a0f1011010f1021f7ef62eaf3198002300284e9300f0cf842d9820eae0722e9820eae07335985045a8bf5046359034982b998842a8bf0846349000f0bdbc299b2d9f7145a7eb0303b3fa83f34fea53134ff00007c8bf012703ea070c2b9b002b00f058814ff0040a2aea8e071a970eeb000743184fea5e06013f01f0010203f001041b967e0819962aea8706171918963294c61bdde930745018274435920eeb02048eea01024908179159082d9b169179192e9dc91a4fea560ba94238bf0d4601212e95bbf1010f88bf710801f0030321f00301129161082691410821913499159301eb5000411c03381490d00720904ff0ff3000eb56002a906ff0010009eb540300eb56002890981e13906ff00200ddf844e11c9600eb5600339e4ff00008109111931f90cde91dec08e02e9808f10108339e80454ff000073ef495ae6fea08014046bcf1000f2b9a18bf50182999359b421802fb0e910bb9002305e01b9b1a9ccb5ce34003f00f033193329b0bb9002304e0199b189ccb5ce3401b0130932d9b209f03443498002f03fb060a2198269f504439441cd15a46f4f7c3fadde91dec359840b11799319a1af8010000f0f00010440af8010032980028b6d01699309a1af8010000f00f0010430af80100ace703fb06f4bcf1000f02fb0ef23ed01c980228ddd31398149910442144002200eb0b039c785f782a9dc4f3031444ea071701eb0b049542a770cad05f7810f80b50c7f3031747ea0517289d67709542bfd010f80b7013f8015cc7f3031747ea05171f9d01f80b709542b2d013f8017c13f8023cc7f30317043247ea031304389345a1f1040104f8013cc9d1a1e71c9b022b9ed31c9b082b01d200222be0119bddf848e003eb020c109a144400220ceb02077d781cf80260c5f3031545ea0616a51805f8016cbe787b78c6f3031646ea0313a354fb78be78c3f3031343ea06136b703b79ff780432c3f3031343ea07139645ab70dbd1159bdde91dec002b3ff468af531ccf5c8e5c159cc7f3031747ea0617012c87543ff45caf941c0f5dce5c159dc7f3031747ea0617022dc7543ff450af0a44d278095dc2f3031242ea0111015546e70027fef7a7bd00224ea8cde905402b9806eb0a0104903598cde902510190dde93210349f009701f089fb0746fef792bd00214ff0000e2091dde9280141ea0021b1eb5c0f28bf4fea5c01269ab1eb520f28bf51081c91013938bf394610912d99beeb0104d8bf3c463198411a9142a8bf11468c421e91bef66dad28984fea092a4fea002932982a994fea0b230f181c9920984a004943890028921b918742c8bf3846349d0ceb0702aa424ff000012a92b8bf1546bcf1030f38bf0121269e0022032e38bf012211431a91410819912b990aeb080219444b08b3eb520f219b1d9000f1010c4fea031015904fea520243ea031038bf4a08149029986910484429951891824228bf0246109b4ff0000a03fb03f080000d906ff0080000eb420016902d987045c8bf8646339835992b9701fb0e002e99309000203290701e1790b01e139058001290781c119008010f9041ea011026460e904fea5c00cdf830c00b9010e001780f9a01f00f0111430170359c319e30980136204430901e9800278642bef6e8ac2699f04308448642b8bf304628996fea400008440128319638db1b994ff0ff3200fb10101c99a1eb0a01012902eb41013bdb01fb01f2824237dd1699a1eb4a0202f10803032b02f1060126db01fb01f7874222dd052b02f1040121db01fb01f787421ddd072b02f102011cdb01fb01f7874218dd0af1040a092ba2f1080103db524382420a46dbdc08310ee02d983399359c219a4ff0000a39e00af1010a04e00af1020a01e00af1030abaf1010f29db08318a1f5243824224dcbaf1020f16db0a1f5243824215dcbaf1020f0fd08a1e5243824211dcbaf1040f08db01fb01f282420ddcbaf1040a01f10801e1d14ff0000a07e0aaf1010a04e0aaf1020a01e0aaf1030a2d983399359c219a319e30442b9b00fb04192a985344102aa0eb0a0800f08b8034988342b8bf18461d99814239da1d9f199af90739460ad0199f219a19f8071001f0f001114309f80710dde90b21b2eb600f09eb020715da149d09eb60063a4602f8015bb2420fd2ba1cb2427d700cd2fa1cb242bd7008d23a1dfd70b2421746edd302e03a4600e07a1c359c319ec70707d0814205da1078159900f00f0008431070ddf880c0e045c8bfc4462998844541da5feacc700bd04fea5c0019f80010219a01f0f00111430cf1010c09f800101898b0eb5c0f1add1898309e149d4fea5c0209eb0007b018044604f8015bbc4210d2811cb94225700fd2c41cbc420d700ad20436b118b9422570ecd305e009eb5c0102e0411c00e021462998359c319ec00708d02998844505da0878159a00f00f00104308702e9810280bd1012002901f982099349a01904846cdf8008002f0c7fbcae6b6fa86f01a99400908434ad11798864247d01399701e891b8842b8bf01466fea4100129908440128c0f29f800d99329a00fb101010998a1a4ff0ff31012a01eb42016ddb01fb01f7874269dd5100a1f1090202f10807032f02f1060157db01fb01f6864253dd052f02f1040152db01fb01f686424edd072f02f102014ddb01fb01f6864249dd3299092f01f104013291a2f1080103db524382420a46d9dc08313ee020988342d8bf034634988045a8bf80464345bff66daed80709d0580819f800102e9a01f0f0011143013309f800105908b1eb680f17da309f0e9d09eb68027c18264606f8015b96427ad2a01c904235707bd2e61c9642057076d20437781890423570ecd371e009eb53006ee0329a013204e0329a023201e0329a03323292329a012a23db08318a1f524382421edc329a022a19db0a1f5243824200f3ba80329a022a11d08a1e5243824200f3b580329a042a09db01fb01f2824200f3b080329a0831043a3292ded1002032901198329900eb010c20988342d8bf0346ddf8d0e0f445b8bfe646734543dad80709d0580819f800102e9a01f0f0011143013309f800105a08b2eb6e0f17da309e0e9d09eb6e07b018044604f8015bbc4212d2811cb94225701ad2c41cbc420d7015d20436b118b9422570ecd310e009eb53010de0601c02e0411c09e030465feac8713ff4cfad4345fff6c6adcae521465feace7007d0734505da08780f9a00f00f001043087032982a99c0430e18012002901f98209f349c01904846394622466346009602f0abfabe42d8bf3e46a045a8bfa0464645bff6a5adf00709d0700819f800102e9a01f0f0011143013609f800107108b1eb680f17da309b0e9d09eb68025c18274607f8015b974210d2a01c90423d700fd2e71c974205700ad20433581890423d70ecd305e009eb560002e0601c00e038465feac8713ff473ad4645fff66aad6ee53298013858e73298023855e73298033852e700223098359f09eb00014ea808902998009707902898cde905402698cde903102a98029034980190dde9321001f0c1fd0746fef73eba4ff0ff300df2345dbde8f08fb81a18bf4ff0ff300df2345dbde8f08fb0b586b008b3d0f87001f0b10023b3eb512f1ad150f82130bbb11b1a9d0714d16ff4403540f60f041d44cff6fd74a5420bd3184450f8085c8d4206d150f80c1ca1f1011515f5803f03d24ff0ff3006b0b0bd50f8045c8d42f7d1c3f540339942f3d80028f1d0037813f00b0fedd1144601ab0022002500f011f80028e5d00198dde903122060481c40086160a260e06028462561656106b0b0bd00bf91429cbf002070472de9f041855c4ff0050c6e0758bf4ff0030c15f0f30f02d1891a614502d20020bde8f0818418627894f802e0002e05d5e078267942ea0e2240ea062e002a4ff0000018bfbef1000fead0b2f5207fe7d8bef5f07f88bfbde8f081082d38bf0120072d18610ad8501c400800fb0ef0a1eb0c018842d3d804eb0c0828e004eb0c080efb02f5002000bf00eb0c04a142c6d008eb00073e78360903d00127b54213d2bde70c1b012cbad07e781eb10227b5420ad2b4e7042cb2d3bc78fe7854ea0626add00427b542aad3ad1b3844dcd158600120c3f800809a60c3f80ce0bde8f0812de9f04f89b0dde91257069005fb07f000294fea4007029100f0d48100200390089002984ff0010e00264ff0000b4ff000084ff0000c4ff000090497079205930be000bf4ff0000c4ff00308cdf80ca009f10109814500f0ba81bcf1000f40f0b4810699b8f1020f11f809a0ead0b8f1010f15d0ddf81cc0b8f1000f40f086805fea1a100af00f01089100f092800499814280f09a804ff0010c4ff0000882e1079abaf1000f00f07f800499514576d3a1eb0a010491089901eb01100901019114e000bfa15d089f01f0f0013943a1550136aaf1010a4ff0010eae4224bf00260bf1010bbaf1000f00f0598113998b45d1d20bfb0324bef1000fe3d0a91bb1eb5a0f88bf4fea5a0141b38d0804eb060817d0002208f10107a2eb850c6ff003057b1904350ceb05020432d870187158719871f5d1059b079a2f1d11f0030504d10ce0002711f0030508d0012d08f8070004d04744022d787018bfb870aaeb410abaf1000f0e440dd0129dae42b5d2a15d019f01f00f013943aaf1010a4ff0000ea155afe7129d4ff0000aa6e7039a52ea0a2213d004990392914280f08f804ff0010c4ff0000853e74ff0000c4ff002084ee74ff0000c4ff00108f4e000214ff0010c4ff00008039142e7089a091a049102eb02111201cdf80090019214e000bf1af80670089a07f0f00717440af80670013601384ff0010eae4224bf00260bf1010b002800f0d680139a934580f0cd800bfb03cabef1000fe2d0ad1bb5eb500ff14688bf45087db3ac080aeb06081ed0002308f10107a3eb840c6ff0030400bf07eb040e04340ceb040304338ef803108ef804108ef805108ef80610f0d1059bddf81cc0271d15f0030404d10ce0002715f0030408d0012c08f8071004d04744022c797018bfb970a0eb45002e4488b1129dae4210d21af80620019f02f00f023a430af8062001384ff0000e0028abd180e000bf129d0020ce469de7891a0491089901eb011009010191114613e000bf1af80620089c02f0f00222430af80620013601394ff0010eae4224bf00260bf1010b002953d0139a9345bff4ccae0bfb03cabef1000fe3d0ad1bb5eb510f88bf4d085db3ac080aeb060819d0002208f10107a2eb840c6ff0030400bf3a1904340ceb04030433d070107150719071f5d1059bddf81cc0271d15f0030404d10de0002715f0030409d0012c08f8070005d04744022c787018bfb87000bfa1eb45012e4489b1129dae42b6d21af80620019f02f00f023a4301394ff0000e0af806200029b0d103e000bf129d0021a4e74ff000084ff0000c029852e64ff0010c4ff0000803e04ff000084ff0000c0298ddf8009045e60120012107e04ff0010cb8fa88f0049f8cf001014009b7fa87f252091140084009b0bde8f08f00bf2de9f041826882b10121816007220020511e20fa01f1c90708bfbde8f0814ff0ff3191400843bde8f0818c46056841688d42e9d06b1c03602c78ff2c11d18b4200f0dc80ac1c046095f90120b2f1ff3fd6b200f3d080bf2e22d806f03f0602238fe062b2b2f1ff3f02dd07222046cfe7bf2c09d804f03f070e224ff0010e4ff000084ff0000c2ee0df2c0fd804f01f0715224ff0000c4ff001084ff0010e22e0df2e0fd806f01f0603236ae0ef2c0fd804f00f071c224ff0010c4ff000084ff0010e10e0ef2e58d806f00f06042358e0f02c40f093804ff0000820224ff0000c4ff0000e00278b424fea072603d0af1c07606d7803e00125856000251f46c02c45ea06046cd35b1a7d1ab3fa83f3b5fa85f55b096d092b434fea042403d001258560002503e07e1c06603d783746b8f1000f44ea050453d17d1ab5fa85f56d092b434fea042403d001258560002503e07e1c06603d783746bcf1000f44ea05043ed1791ab1fa81f1490919434fea042131d001238360002030e0f02e3ed1002605234ff0010e00250127ea074fea062617d18c4215d0621c0260247801379f4246ea040623d000bf8a424fea062609d0541c0460127801371643bb422246f3d116e02246013701254ff0000e9f4214468560dad112e07b1c0360387840ea0104bef1000f20467ff413afbde8f08114465feace7202d0091b8e4204d9012181600020bde8f081a11907462046002263463960bde8f041ffe78446081ab0f5806f01d90020704761454ff00000fad0002a18bf70472de9f04fabb09fed251a9fed250a9fed253a9e4600264ff0ff380df12c090df10c0ab7ee002ab0ee084ab6ee005ab1ee006ab9ee007a00206746019009e000bf49f826500af8064001368f42bc4600f0cb8217f8012b501e01280fd8012a23d18f4274d09cf901000cf10207b0f1ff3fc5b240f38f8000220724f5e1052a37d0042a30d0032a49d1002e00f0d982701e59f820501af8004093e200bf0000004f000000cf000000008f4254d00cf102079cf801008f4247d09cf802200cf103078f4240ea02203fd09cf803200cf104078f4240ea024037d09cf804200cf10507130600223ae0002e00f0aa82013eace7022ec0f0a582b21e59f82230701e59f8205049f820301af802301af800400af8003049f822500af8024096e702f0f80010281fd1002e00f08b82701e1af80030002b40f0858259f82050152a6fd16d420022002406463de20023012206e001220724002588e101220020002343ea000501242fe2a2f12000062827d8002e00f06782731e1af80300002800f0618259f82300242a40f0858080f00045012400221e4617e2bf2d5ad801220292002205f03f000e244ff0000b00928f4200f019819cf802300cf10308002215e1322a51d002f0fe0030284dd0402a40f0a380032ec0f03682701e1af80020002a00f03082b21e1af80230002b00f02a82033e1af80630002b00f0248209eb8202d2ed000a09eb860209eb8000d2ed001ad0ed002a70eee10a62eea00a71eea00acee1002800f00e82023e1af80600002840f0088259f82600122a58dc102a00f03081112a00f03381122a40f02c81454354e1df2d44d8002205f01f00152400924ff0010b0122bae0002e00f0eb81a2f13100013eb0fa80f01af806304009834240f0e08159f82600302a7bd100ee900af8eee00a94e1002b00f0d481023e1af80630002b00f0ce8159f82630212a40f3ed80222a00f02581232a00f02981252a40f03a8100ee903a01ee900af4ee610af1ee10fa48bff0ee601a11ee905a71e1ef2d72d805f00f001c24012274e0a2f11303022b80f0c480002d00f0a381b0f1004f08bf15f1010300f0eb80132a40f0f18090fbf5f5f1e0a2f1480010f1070f4ff00000c0f05f81002e00f05c81013e1af80600002800f0858109eb8600d0ed000af4ee420af1ee10faf5ee400ac8bff0ee420af1ee10fa48bff0ee430a432a72ee601a00f3b480412a00f0f380422a00f00f81432a40f0008161eea10a72ee600a1de1312a40f0948000ee900a20f00040b0f1ff4f4ff00002f4ee410aa8bf0122f1ee10fa4ff0000080f21c81f4ee400af1ee10fa00f11681002a40f01381fdeee00a10ee905a98e0f02d4ff0000040f00981002220244ff0000b009202928f427ff4e7ae00230122b8460002c02d43ea000535d3781aa8eb0103b0fa80f0b3fa83f340095b0918434fea05270ebf18f8013b00230122bbf1000f43ea07051fd1a8eb0103b3fa83f35b0918430ebf18f8013b002301222f02009d002d43ea07050ed1a8eb0103b3fa83f35b0918434fea05230ebf18f8010b0020012240ea0305474602984ff0ff3838b1601e25fa00f0c0071cbf08fa04f005430024a3e0162a10d1a842b8bf054637e0202a4cd0212a51d100ee903a01ee900a70eee10a8ee005442ae0a842c8bf054626e0451b24e0002800f1c680def800200546824238bf15469042019888bf0120019015e0442a48d0452a5fd0462a4ed161eea10a61e00025132a4ff0000208bf4ff00045002469e090fbf5f202fb15050022002462e000ee903a01ee900a61eea00a57e000ee900af5ee400af1ee10fa00f0928001ee903ac1eea00a4ae000ee903a01ee900a71eea00a43e000ee903a01ee900af4ee610af1ee10fac8bff0ee601a11ee905a37e060eea01a70eea00a74ee600a61eea00a2ce0f4ee450af1ee10fa18d570eea01a60eea10a22e0f4ee450af1ee10fa15d560ee861a60eea11a60eea10a16e060eea00a13e060eea01a60eea10a0ee071eea10a61eea00a72ee600a07e061ee870a61eea00a61eea00a70ee820a10ee905a012400224ff000005ab9202e09d0002c3ff436ad25f00040b0f1ff4ffff630ad00202bb0bde8f08f56b3701e1af8001059f82000d9b102ee100a20f00040b0f1ff4f4ff00001b4ee412aa8bf0121f1ee10fa4ff00000e4dab4ee402af1ee10fadfd40029ddd1bdeec20a10ee100a019adef804101143cef804102bb0bde8f08f00202bb0bde8f08f80b5002970d090f900c0bcf1200f5ffa8cfc07db012010604ff0010ec3f800c0704680bdacf1c20ebef11d0f0fd801295ad090f9011011f1410f55dc02211160407800f03f006cf38a108446e4e70cf0f00ebef1e00f23d1032945d390f901e01ef1410f40dc90f9021011f1410f3bdcbcf1e00f5ffa8ef101d1a02934d3bcf1ed0f01d19f292fd80321116042784fea0c3189b2807802f03f0241ea821136e004294ff0000ebbd3acf1f50111f1050fb6d390f901e01ef1410f15dc90f9021011f1410f10dc90f9031011f1410f0bdcbcf1f00f5ffa8ef101d1902904d3bcf1f40f03d18f2901d9002080bd042111604ff4e011427801ea8c4c817802f03f02c0784cea023201f03f0142ea811100f03f0001eb000c7fe72de9f04188b04af2bb261c46c0f24e0613460a46ddf83880002706f1ae05214627706770a770e77027716771a771e77127726772a772e77227736773a773e77327746774a774e77427756775a775e77527766776a776e77627776777a777e777a8470028c8f800705cd020786178a278e3780843104318434ff0010008d0e179a27911431ebf617a227a51ea020102d108b0bde8f081a07b14284ff00000f7d1217d8df8040041f0010121758df805008df806008df807008df808008df809008df80a008df80b008df80c008df80d008df80e008df80f008df810008df811008df812008df813008df814008df815008df816008df817008df818008df819008df81a008df81b008df81c008df81d008df81e008df81f0001a92046b047c8f8000018b1012008b0bde8f08106f1520120468847d8f80000002818bf012008b0bde8f081002804bf4ff0ff3070472de9f04f95b00df1200c8ce80f00f8f70efd002800f004824ef66c6a4ff29c5bccf2ff0ac2f2290b4ff6ff760024012547f67f797f2707e000bf48f2a351c0f24501bff32f8f8847dbf80080bff35f8fdbf80000bff35f8f01466ff39601b1f1005f07d10168514504d14168b1f57d7f00f093804ff47d70f9f731fc002800f0cf814ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d71c0f800a041608573a0f8c49180f8c371068446848684c684068546858685c685068646868686c686068746878687c6875be8001f41457ff45aafbff35f8f4be8000121b15be8001f4145f8d04fe7d0f87011209e4ff0ff3029b30022b2eb562f21d151f82600002800f03481431a98074ff0ff3017d16ff4403240f60f071a44cff6fd77ba420ed3ca1852f8080cb04240f0208152f80c1ca1f1011010f5803f04d24ff0ff3015b0bde8f08f002a4ff0ff30f8d052f8047c8f42f4d1c3f540339942f0d810ad104600222b460024fef716ff002800f0fe80239b0f22990603f00f0002eae17101fb00f289214a43d20a8df830200e2213f0200f08bf0f2408bf012200fb02f201fb02f24fead2228df831204ff00d0208bf022200fb02f201fb02f24fead2228df832204ff00c0208bf032200fb02f201fb02f24fead2228df833204ff00b0208bf042200fb02f201fb02f24fead2228df834204ff00a0208bf052200fb02f201fb02f24fead2228df835204ff0090208bf062200fb02f201fb02f24fead2228df836204ff0080208bf072200fb02f201fb02f24fead2228df837204ff0070208bf082200fb02f201fb02f24fead2228df838204ff0060208bf092200fb02f201fb02f24fead2228df839204ff0050208bf0a2200fb02f201fb02f24fead2228df83a204ff0040208bf0b2200fb02f201fb02f24fead2228df83b204ff0030208bf0c2200fb02f201fb02f24fead2228df83c204ff0020208bf0d2200fb02f201fb02f24fead2228df83d204ff0010208bf0e22424360434843c00a8df83f00c3f3001006900ca84a43cde9045008ac0b9dd20addf88890ddf884a0ddf87c8013cc1e9e8df83e2022462b46cdf80c90cdf808a0cdf80480009600f02df8dde91201a2455044c8bf5446a9454944c8bf4d46b042b8bf06464145b8bf8846a64211dd4146a8450edd249800680f280ad8249f491b321b07ebc0030130dc801d815a8199813860002015b0bde8f08f4ff0ff3015b0bde8f08f2de9f04f8fb0dde91c5a0e9129691e9eddf868c0002900f05c812f68002e40f05381874200f050819af80f100f2940f04b819af80e100e2940f046819af80d100d2940f041819af80c100c2940f03c819af80b100b2940f037819af80a100a2940f032819af80910092940f02d819af80810082940f028819af80710072940f023819af80610062940f01e819af80510052940f019819af80410042940f014819af80310032940f00f819af80210022940f00a819af80110012940f005819af80010002940f000811b9fb2eb0c044ff00001d8bf0c46db1bd8bf0b46d5f808e0ea681d46e919189fa444aeeb0403a7eb0c070694bb42b8bf1f46199b521b0b91591a8a42b8bf1146012f0c910797c0f2e5820c990129c0f2e1820ef101014c08069900eb6c000a9048100990042020ea81000590079801310138cde903014810029004fb05f000f102094ff0000acde9005c089407e000bf0c980af1010a8245a14400f0bb821c980e9b01680aeb050000fb04120b980a9f504400fb03705feacc7303d1099fdde9063810e0099b2e46d35c059d0778eb4007f0f00703f00f033b4400f8013b049bdde902783546d619da074fea580b0d9208d131465a466446f2f722fba446089c68e000bfb8f1020f64d3abf10102032a04d200211bf0030e35d15be06ff0030202ea58034f44b646c3f1000c3944471c8e18f578b478c5f3031545ea0415bc18e5703579f378c5f3031545ea0313237173793579c3f3031343ea05136371b3797679c3f30313043243ea06130ceb02060436a371dcd1dde9005c089c111d76461bf0030e26d04b1cf75c3246765cc7f30317ddf804c047ea06171646bef1010f475417d08f1cd65dd55cc6f3031646ea0516009dddf804c0bef1020fc654164608d03144c978f25dc1f3031141ea0211c15500bf5feac8713ff45aaf0d9a16f80b10002a4ff0000208bf042210f80b30d14003f00f0242ea011100f80b1047e7874200f095810026a1e16d68002d00f0018200244ff000090ae000bfdde90c14d8f804500c44ddf874a0ac4280f0f281ddf870800d94d8f800100f5d3e0903d001210c910ce000bf2e1b012e00f0e28121444d78002d00f0628102210c912e4617f00f011e9f1af801a0b7fa87f74fea571718bf012147ea010e1b9f4fea0a1b16f003014c4600f08980cde90a16d8f808100026b9fbf1f404fb119161449142a8bf012606ea0e06012e18d13c449c4215db189da94212da199dac420fda0e9d4e0804fb0504c907a75d6ff00f01554604bf0f215d4639401b9f2943a1550a990b9e012909f1010458d0d8f80810b4fbf1f606fb1141002461449142a8bf012404ea0e04012c18d1f4199c4215db189da94212da199dac420fda0e9d574604fb05044d08c907665d6ff00f0104bf0f215f46314039431b9f61550a990b9e022909f102042ad0d8f80810b4fbf1f505fb1141002461449142a8bf012404ea0e04012c19d1ec199c4216db189da94213da199dac4210da0e9d574604fb05044d08c907665d6ff00f0104bf0f215f4631400b9e39431b9f615509f10304711e0329b14405d23ae700bf0434a1453ff436afd8f808100026b4fbf1f505fb114161449142a8bf012606ea0e06012e1bd13d449d4218db189eb14215da199eb54212da0e9ed04605fb06054e08c907af5d6ff00f0104bf0f21d84639401b9f41ea0801ddf87080a955d8f80810661cb6fbf1f505fb1161002661449142a8bf012606ea0e06012e1cd13d449d4219db189eb14216da199eb54213da0e9e574605fb06054e08c90715f806806ff00f0104bf0f215f4601ea0801ddf8708039431b9fa955d8f80810a61cb6fbf1f505fb1161002661449142a8bf012606ea0e06012e1cd13d449d4219db189eb14216da199eb54213da0e9e574605fb06054e08c90715f806806ff00f0104bf0f215f4601ea0801ddf8708039431b9fa955d8f80810e61cb6fbf1f505fb1161002661449142a8bf012606ea0e06012e7ff466af3d449d42fff662af189eb142bff65eaf199eb542bff65aaf0e9e574605fb06054e08c90715f806806ff00f0104bf0f215f4601ea0801ddf8708039431b9fa95544e7042e78d38e78c97856ea012673d0042188e61b99002901dd012609e0b1fa81f149090027bcf1000fc8bf012707ea0106d5f808e0d5f80cb00bfb0ef9b9f1000f59d01e990024b1fa81f149094ff0ff380d91f1070c9107e000bf01340bfb0ef94c45a8f1010846d20c991c9e0029214618bf09eb0801b1fbfef536680ef1010705fb1e117f0805fb07664f08f65d042727ea8107fe4016f00f094f4618bf01270d9e3743012fd8d161449142d5db1b9f3d449d42d1db189fb942ceda199fbd42cbda0e9f1af8096005fb070e4d081ef80570c90707f00f0907f0f00747ea06071c9908bf49ea06170ef80570d1f808e0d1f80cb0b1e70fb0bde8f08f00bf002804bf4ff0ff3070472de9f04f99b01c461546cde90e01f7f782ff002800f0fb814ef66c6b4ff29c59cde90c54ccf2ff0bc2f229094ff6ff7a0024012547f67f787f2607e000bf48f2a351c0f24501bff32f8f8847d9f80070bff35f8fd9f80000bff35f8f01466ff39601b1f1005f07d10168594504d14168b1f57d7f00f0a3804ff47d70f8f7a3fe002800f0c4814ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d71c0f800b041608573a0f8c48180f8c361a0f820a0a0f822a0a0f824a0a0f826a0a0f828a0a0f82aa0a0f82ca0a0f82ea0a0f830a0a0f832a0a0f834a0a0f836a0a0f838a0a0f83aa0a0f83ca0a0f83ea059e8001fb9427ff44aafbff35f8f49e8000121b159e8001fb942f8d03fe7d0f87021279e249d4ff0ff302ab30021b1eb552f21d152f82500002800f01881811a88074ff0ff3017d16ff4403340f60f070b44cff6fd77bb420ed3571857f8080ca84240f0048157f80cacaaf1011010f5803f04d24ff0ff3019b0bde8f08f57f8040c50454ff0ff30f6d1c1f540318a45f2d8002ff0d0baf1c10fedd33878012840f0e580b0060f2206f00f0102eae070484389225043c00a8df854000e2016f0200f08bf012001fb00f002fb00f04fead0208df855004ff00d0008bf022001fb00f002fb00f04fead0208df856004ff00c0008bf032001fb00f002fb00f04fead0208df857004ff00b0008bf042001fb00f002fb00f04fead0208df858004ff00a0008bf052001fb00f002fb00f04fead0208df859004ff0090008bf062001fb00f002fb00f04fead0208df85a004ff0080008bf072001fb00f002fb00f04fead0208df85b004ff0070008bf082001fb00f002fb00f04fead0208df85c004ff0060008bf092001fb00f002fb00f04fead0208df85d004ff0050008bf0a2001fb00f002fb00f04fead0208df85e004ff0040008bf0b2001fb00f002fb00f04fead0208df85f004ff0030008bf0c2001fb00f002fb00f04fead0208df860004ff0020008bf0d2001fb00f002fb00f04fead0208df861004ff0010008bf0e2001fb00f002fb00f04fead0204ff000038df8620008bf0f235943299d51430020c90a002d8df863103ff427af289cc6f30010a7f13f0810ae0b9001e0013d1cd014f8010b411e1f29f8d341b220290fdb08eb400118f81000497840ea0122c12a06d3384651463346fef794f80028e5d14ff0ff3019b0bde8f08f0d9c2698ddf894b0a042c8bf04462a980894dde9289406300790cde909a704e058440b38013c834653d019f8010b1f28f6d908eb400118f81000497840ea0122c12ad8d3384651463346fef766f80028d1d00b980c9f069015a8cde90460ddf898a0229ddde90e010d9b239e3a46cde902ba00950196fff740fadde91201bb4558445144d8bfbb46a8422a46b8bf0246b142a8bf31465a4517dd089b994214dd2a9b1b680f2b10d8089ea2eb0b02a1eb060c079901ebc307ba802a9a21f833b0591c7e80a7f806c01160dde909a710aea8e7002019b0bde8f08f2de9f04fd3b0dde95ce5dde9648cdde9629a0d9075b1dde96050dde95e47a94224eae47b27eae774a8bf29468242a8bf024602e000244ff0000b09eb0e0008eb00055845c8bf83468d420ceb0a07b8bf2946a24588bf54469742b8bf3a468b45b8bf944202db53b0bde8f08f669804f0010701974fea5b07033809970bf101070090580008974e080c90002701200df14c0e0df10c0c02948ce80e00cde90a6b06e000bf0798012700284ff00000dad0c00707906698069708bf0830ddf800906ff007086ff004044ff0000b4ff0000a0f9018bf09f10809cdf838900f994fea5a00085c102300f0f002cc46a14610901194cdf8488000bf1cf8041f0eeb08001cf8014c9cf8015042ea141704f00f041443447242ea111401f00f01847211430eeb0904217242ea15119cf802600772617205f00f011143a17242ea1611817306f00f01114308f10808083b09f10809c173d1d11098ddf83890000110224b465d4600bf13f8041f0eeb050713f8014c5e7840ea141804f00f0404437c7440ea111401f00f010143f97440ea161193f802c0397506f00f010143797540ea1c11b9750cf00f010143083a05f1080587f81080bc74f975d5d1ddf84880119c0af1020a08f120082034baf1100f0bf1200b84d101980699049a48400299059b00eb01090399dde90a6b9145bff65baf0d9803fb090807e000bf0c9809f1020991458044bff64faf0d98dc4609fb03045feacb700bd0099dddf820c0605d1ef8007000f0f00007f00f0738446055b6eb5c0f28d94fea5c0a04eb060b464616f80a0006eb0a041ef80050204600f8015b58451dd205781ef80570a51c5d45077017d228781ef800002870e51c5d4510d2287804361ef80000287006eb0a055d45ddd306e000bf04eb5c05c80705d1b4e7651cdde90a6bc807afd08c45adda28781ef8007000f00f0007f0f00738442870a3e72de9f04f8bb01d9d6c68072c00f286802cb12f89b94200f08180012c7bd100287cd0d0f87061002e78d00027b7eb512f74d156f82170002f70d0a7eb060c5fea8c776bd16ff440370ceb070e40f60f07cff6fd77be4561d306eb0c0e5ef8086c8e425bd15ef80c6ca6f1011717f5803f54d35ef8047cb74250d1ccf54037be424cd8bef1000f49d0032e47d39ef80070022f43d19446aa69ddf86ca0dde91987dde917b9b2b14fead10801f00704da464ff0010b4f4612f808900bfa04f444ea090402f80840d346ddf86ca0b946dde919876c6805eb44021181721e1c9e01346c600996169e0ef101010396159e0a950296149ecde904b9cde900366346cde90687cdf820a0fbf795fa6968013969600bb0bde8f08f6f89b94204d14ff0ff300bb0bde8f08f022c3ff479afaf89b942f4d0032c3ff473afef89b942eed0042c3ff46daf2f8ab942e8d0052c3ff467af6f8ab942e2d0062c3ff461afaf8ab9427ff45dafdae700bf70b5049d8b42c8bf19469542b8bf2a46914205dadde905e3bef1000f01d103b170bdbef10f0c18bf9c46cb070ed04b10c45cbcf1000f03d004f00f05ae4504d904f0f00444ea0e04c45401314c1000eb61035510bcf1000f00eb620049d0ac425fda00bf1c78764604f00f05beeb141f38bf2609754598bf754645ea06141d4605f8014b854265d25c78764604f00f05beeb141f38bf2609754598bf75469c1c45ea061584425d7040d29c78764604f00f05beeb141f38bf2609754598bf7546dc1c45ea061584429d702fd2dc78764604f00f05beeb141f38bf2609754598bf754645ea06151c1ddd7084422346b9d31ce0ac4219da4eea0e1500bf1c4604f8015b844226d29c1c84425d700ed2dc1c84429d700ad21c1ddd7084422346edd304e01c46d00704d17ae71c46d0073ff477af9142bff674af2078bcf1000f03d0beeb101f98bf70bd00f00f0040ea0e10207070bd5c1cd007ebd161e72de9f04f81b04ef66c644ff29c55ccf2ff04c2f229054ff6ff7600274ff0010a47f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d5f80090bff35f8f2868bff35f8f01466ff39601b1f1005f07d10168a14204d14168b1f57d7f00f094804ff47d70f8f77af9002800f005814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ff47d710460416080f80ea0a0f8c4b180f8c381068446848684c684068546858685c685068646868686c686068746878687c68755e8001f49457ff45aafbff35f8f45e8000121b155e8001f4945f8d04fe7d0f89812002974d104464ff41630f6f749f8014600284ff0000069d0002200bf8b1888544032b2f5163f58709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d876187758779877d87783f8200083f8210083f8220083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f009ad1c4f8981200e00021084601b0bde8f08f00bf70b5044690f8a00384f8a10350b3d4f8900347f64c6642f66535c2f20706c0f2440520b131682d31c4f8981310e040f22f00c0f200007844002122460023a847c4f89003316801f12d01c4f8981330b105f1e8022d219047002808bf70bd002084f8a10370bd00bf2de9f047a4b0d0f89442bff35f8fa4b142f691760546c0f2440620460021b04770b1d5f8900340b142f64d42c0f244022d2124b0bde8f047104724b0bde8f08747f64c69c2f20709d9f8007095f8a10300283fd0f7f7b4f8e0b3d5f89813781a17d495f8680110b995f82403e0b395f8a00385f8a10380b3d5f8900342f64d48c0f2440878b1d9f800102d31c5f898131de0d5f8900300b342f64d42c91bc0f24402904719e04ff64b70cff6ff70a8f1e807784400212a460023b847c5f89003d9f8001001f12d01c5f8981310b12d21c04710b1002085f8a10306f16601204624b0bde8f04708474af21f37c0f2470700200290adf80c00b84795f8680110b995f8240318b12846fff746ffe5e70df104084046f5f7b4fc02a9284600224ff0000afaf7ebfd81464046f5f7cffdb9f1000f02d085f8a1a303e00146284600f009f89df80c000028c7d107f14c008047c3e700bf2de9f04f90f8d13300f5697c4cf82310591c41f69a134b4390f8d0b31b0c03eb8303a1eb4301bbf1090f80f8d1139cbf0bf1010b80f8d0b3bbf1040f0bf0030e05d200244ff000094ff0000a2ee00bf0fc0800244ff000094ff0000a00eb8406d6f8a473d6f8a853b7fbfbf3d6f8ac1303eb090203fb1b73b5fbfbf7d6f8b06307fb1b5553443a44b1fbfbf72b44b6fbfbf53a4407fb1b1105eb020905fb1b6219440434a04502eb010ad7d1bef1000f1dd05cf82450bef1010fb5fbfbf606fb1b55b144aa4412d00ceb84056e68bef1020fb6fbfbf404fb1b66a144b24406d0ae68b6fbfbf505fb1b66a944b244bafbfbf202eb0901c0f8cc13bde8f08f00bff0b500294ff6ff7e00f0af80012903d10022c90775d1a8e021f00102c2f1000c6ff0010241f221038418a578e7788eea05252cb26e0036b203ead43484ea450503ead6366c0086ea450624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead53585ea460686ea07273eb27d002db203ead63686ea470703ead5357e0085ea470736b27d002db203ead63686ea470703ead5357e0085ea470736b27d002db203ead63686ea470703ead5357e0085ea470736b27d002db203ead636023286ea470703ead5360ceb0205023586ea470e95d10232c90733d0805c41f221038eea002001b2420012b203ead13181ea400003ead232410082ea400009b2420012b203ead13181ea400003ead232410082ea400009b2420012b203ead13181ea400003ead232410082ea400009b2420012b203ead13181ea400003ead23181ea400e1ffa8ef0f0bd2de9f04fcbb00646c07c8b468df80600b08954998df80700000a8df808008df80a10080af1898df80b00080a17468df80d000020012b8df805308df809b08df80c108df80e008df80f008df810008df811008df812008df813008df814008df815008df816008df817008df818008df819008df81a008df81b008df81c008df81d008df81e008df81f008df820008df821008df822004cd1307e96f81780a0f1090144f62510c2f29240a1fb0002891a02eb510100970df10500b8eb910f88bf4fea9108c8ebc80706f11a0400f1010a00f10509093021463a46f0f791ff06f1210506f1280029460722f0f789ff284621460722f0f784ff20465146032207f10905f0f77dff06f11d0049460422f0f777fff07d02289cbf0130f075009fbb450cd0b8f1240f13d94ff0ff304bb0bde8f08fbb454ff00905f07509d14ef60b67abb20df10502c0f247070120f02115e002200df12304aab28df82300a01c0df105018df82470f0f74bffa81c4af6610782b2c0f24607f02021460023b8474bb0bde8f08f2de9f04184b0044690f84d0000284ff0000000f09a8094f84f1042f28b0701f078018df8071094f85010c0f25b0701f007018df80610cde9020002a906200022b847054670b9002002adcde902000df1070128460122f0f711ff012029460122b847054694f84e00a8b1002602a906200022cde90266b84760b9cde9026602ae04f1540130460122f0f7f8fe572031460122b8470543002602a906200022cde90266b84768b90df108080df1060140460122cde90266f0f7e1fe312041460122b847054302a906200022cde90266b84768b9002002ae04f15301cde9020030460122f0f7cbfe462031460122b8470543002602a906200022cde90266b84768b90df1080804f1510140460222cde90266f0f7b4fe362041460222b847054302a9a3200022cde90266b847054302a997200022cde90266b84742f62b310543c0f2440102208847284615b104b0bde8f081002184f84e1084f84d10a16504b0bde8f08100bf2de9f04f8bb00190233002254ff000080df10c0a4ff001094ff0000b002402900be000bf09fa0bf0002f0bf1010b08bf0443bbf1070f354426d042f20020c0f20000784410f80b0042f2fa11c0f20001794411f80b6042f2fb0351463246c0f25b03cde90988cde90788cde90588cde90388984707460028d4d10298514628443246f0f749fecde742f2fb00c0f25b004ff60073002600f1340703a9c0f21f0381200c22cde90966cde90766cde90566cde90366b84730b9029803a928440c22f0f72afe8026ddf804c040f6b80146ea0400220ac2f200018cf823008cf824200a68002a00f0ad8045f2fd774ff6ff766ff0020241f22103c0f202070d681544ed7886ea052635b203ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea46060d6824b2154403ead4342d7984ea460686ea052635b203ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea46060d6824b2154403ead4346d7984ea460686ea052635b2740024b203ead53585ea460603ead434750084ea46062db2740024b203ead53585ea460603ead434750084ea46062db2740024b203ead53585ea460603ead434750084ea46062db2740024b203ead53585ea460603ead4350332ba4285ea46067ff460afb1b2090a01e0ff26ff218cf83e109cf84c109cf84d208cf83f1026218cf83d608cf84020ff288cf84b101cbf04208cf81c000bb0bde8f08f70b588b042f2fb0514460e46c0f25b05002181280791cde90511cde90311cde90111009107d11b023435694681202246a84720b905e069462246a84708b108b070bd6946054630462246f0f72bfd284608b070bd2de9f0478cb08579972d17d00446fe2d0fd0fd2d2ad142f69570c0f25b008047002084f84e0084f84d00a0650cb0bde8f08720460cb0bde8f047cbe50020cde9040042f2fb00c0f25b00a0f1700304a9972000229847044642f62b31c0f244010220884720460cb0bde8f08742f2fb08002094f80c90677bc0f25b08cde90a00cde90800cde90600cde9040004a99f200422c047064620b901a804a90422f0f7d7fc002e6ff00100ddd19df80410bd29d9d19df805104029d5d19df806101029d1d194f84d00002852d047f64c60c2f20700006843f698210844a065002604a937200222cde90a66cde90866cde90666cde90466c047002840f0898002a804a90222f0f7a5fc04a947200122cde90a66cde90866cde90666cde90466c047002875d10df1030004a90122f0f791fc0020cde90a00cde90800cde90600cde9040004a905200122c047002860d10df1020004a9012249ea0726f0f77afc352d5bdc002d00f08180012d70d19df8020082e0002604a9052001228df80e60adf80c600296cde90a66cde90866cde90666cde90466c047d8bb0df1080a04a950460122f0f756fc04a935200122cde90a66cde90866cde90666cde90466c04738bb0af1010004a90122f0f743fc002604a937200222cde90a66cde90866cde90666cde90466c04798b90af1020004a90222f0f72ffc04a947200122cde90a66cde90866cde90666cde904660126c04778b14ff0ff300cb0bde8f087362d6ed0572d15d194f84e00002800f08580572039e00af1040004a90122f0f70bfc04f14f0051460722f0f705fc84f84d603ee700208df801006946284601228df8009000f04ef9312d044627d036e09df80200002e00f0380618bf4036704010f0380f10d09df808009df8091041f6f6430e22c0f2000302ea96027b449a5a41ea0020904239d8012000218df80110694601228df8006000f024f904460df103014620012200f01df9054602a93620022200f017f945ea040141ea00040025a8f1700604a9a3200022cde90455b047044304a997200022cde90455b0470443aee69df802000e2101ea900041f67e41c0f200017944085a864204d96ff001000cb0bde8f0876946362002228df800708df8019000f0e6f80446d0e70020cde90a00cde90800cde90600cde9040004a9592001220125c04700287ff45caf04f1540004a90122f0f777fb84f84e5060e740f6b800c2f200000168002904bf4ff0ff30704780b584b000684ef2173102904ff41630039002a8c0f2470188474ff4f07042f29f7e01904ff4207cc0f25b0e0020002100220023cdf800c0f04704b080bd00bf2de9f04340f6b801c2f2000109684ff0000e01f1020c4cf6cd4340f2762808e00ef1010ebef5f07f0cf5a07c08bfbde8f083aef1a0096ff00906644607e000bf07eb0711a170053445452e46e8d290f84c1006f10a054f1e112905fb03f208bf570d122908d1a6f1e6019f294ff000079cbfb9f19f0f077b07eb071104f8021c90f84c1006f10c024f1e112903fb02f208bf570d122908d1a6f1e4019f294ff000079cbfb9f19f0f077b07eb071104f8011c90f84c1006f10e024f1e112903fb02f208bf570d122908d1a6f1e2019f294ff000079cbfb9f19f0f077b07eb0711217090f84c1006f110024f1e112903fb02f208bf570d122908d1a6f1e0019f294ff000079cbfb9f19f0f077b07eb0711617090f84c1006f112024f1e112903fb02f208bf570d12298ad1a6f1de019f294ff000079cbfb9f19f0f077b80e700bf2de9f04383b042f28b0914460e460546c0f25b090027694606200022cde90077c84710b103b0bde8f083e846404631462246cde90077f0f78dfa284641462246c84703b0bde8f08370b50446d0f840010d4638b92046f6f7ddf90028c4f8400108bf70bd42f64d46c0f2440606f140018847d4f8400129463246bde8704010472de9f04f81b0934612788ab1022300bf0beb030717f8012c62b11bf8032062b17a784ab1ba780433002af1d1023b04e0002205e0013b00e0013303eb4302520042eae272931c02f1010c01eb810203f0030e23f0030a00eb8213a3f5a0784ff0ff3906e009f10109b9f10d0f08f5a0786bd009eb010202eb8202bcf1030f00eb821605d24ff0ff34bef1000f2ed1e9e70024474604e000bfa24507f1020721d0621cd209042a03d83a7802f0f0023a70a21cd209042a03d87a7802f00f027a70e21cd209042a03d87a7802f0f0027a700434e209042adfd86208b55c05f00f05b554d9e7013cbef1000fbbd0a21cd509042d08d85208b55ce7076ff00f0708bf0f273d40b554bef1010fabd0e21cd509042d09d85208b55ce7074ff00f0708bf6ff00f073d40b554bef1020f9ad0221dd509042d96d85208e407b55c6ff00f0408bf0f242c40b4548ce79bf80010cdf800b0002900f0ce80022041f2410a41f2420b41f2430808e0009a063012f8011f03330029009200f0bd80a1f17f0717f15f0ff1d341f2fa32c0f2000201eb41017a4402eb81014ff20014a1f5c079cff6ff7402e014f52074ded0494619f9027bc509042d09d8b7f1ff3f06dc1a1992f8016f46f0f00682f8016f5ffa87fe5fea4e6208d5042d06d81a1992f8017f47f00f0782f8017f5fea8e620ad540f27d22904206d81a1992f8027f47f0f00782f8027f5feace6209d5b0f51f7f06d81a1992f8027f47f00f0782f8027f5fea0e724fea900c09d5bcf19e0f06d81a1992f8036f46f0f00682f8036f5fea4e720ad540f27a22904206d81a1992f8037f47f00f0782f8037f91f90110042d09d8b1f1ff3f06dc1a1912f80a7047f0f00702f80a70c9b24a0608d5042d06d81a1912f80a7047f00f0702f80a708a060ad540f27d22904206d81a1912f80b7047f0f00702f80b70ca0609d5b0f51f7f06d81a1912f80b7047f00f0702f80b700a0709d5bcf19e0f06d81a1912f8087047f0f00702f8087049077ff565af40f27a2188423ff660af191911f8082042f00f0201f8082057e701b0bde8f08f00bf2de9f04381b04ff29c51c2f229010f68044638466ff39600b0f1005fbff35f8f0cd138684ef66c61ccf2ff01884205d17868b0f57d7f18bf002700e0002745f64d50c0f24600804741f2d161c0f2000141f2d662c0f2000279447a44022808bf0a4641f2b861c0f2000179440128204618bf114600f074fe47b197f87b0180b141f2b661c0f20001794419e041f2a361c0f200017944204601b0bde8f04300f05fbe97f8740141f29062c0f2000241f28d61c0f2000179447a44002808bf1146204600f04dfe97f8750141f26d62c0f2000241f27761c0f200017944012820467a4408bf114600f03bfe41f26561c0f200017944204600f033fe97f9c311204600f022ff41f25161c0f200017944204600f026fef6f7b2fd41f23368c0f2000841f23f66c0f200067e44054600f003003146f844012808bf414641f21d69c0f2000902282046f94408bf494600f008fea808012808bf4646022808bf4e462046314600f0fdfd41f2fb51c0f200017944204600f0f5fdd7f8840198b147f64c61c2f207010a68821a012a0bdb0968401a44f6d35100f2e730c1f26201a0fb0101890900e00021204600f0eafe41f2bd51c0f200017944204600f0d2fdd7f8bc11204600f0ddfe41f2aa51c0f200017944204600f0c5fdb7f8c011204600f0d0fe41f29251c0f200017944204600f0b8fd97f8c211204600f0c3fe41f27b51c0f200017944204600f0abfdb7f8c611204600f0b6fe41f26855c0f200057d442046294600f09dfdb7f8c811204600f0a8fe2046294600f094fdb7f8ca11204600f09ffe41f23c51c0f200017944204600f087fdd7f88011204600f092fe41f22751c0f200017944204600f07afd97f9c511204600f069fe41f21351c0f200017944204600f06dfd97f9c411204601b0bde8f04300f059be00bf2de9f04f81b0134681464a1c00f08f808e0a4ff0000b19f80b20002a00f0888109eb0b077a78002a00f00a81ba78002a00f00981fa78002a00f008813a79002a00f007817a79002a00f00681ba79002a00f00581fa79002a00f004813a7a002a00f003817a7a002a00f00281ba7a002a00f00181fa7a002a00f000813a7b002a00f0ff807a7b002a00f0fe80ba7b002a00f0fd80fa7b002a00f0fc803a7c002a00f0fb807a7c002a00f0fa80ba7c002a00f0fb80fa7c002a00f0fc803a7d002a00f0fd807a7d002a00f0fe80ba7d002a00f0ff80fa7d002a00f000813a7e002a00f001817a7e002a00f00281ba7e002a00f00381fa7e002a00f004813a7f002a00f005817a7f002a00f00681ba7f002a00f00781fa7f002a00f008810bf1200bbbf1600f7ff477af4ff0600b00e1002119f80120002a00f0af8109eb01056a78002a00f0b080aa78002a00f0b180ea78002a00f0b2802a79002a00f0b3806a79002a00f0b480aa79002a00f0b580ea79002a00f0b6802a7a002a00f0b7806a7a002a00f0b880aa7a002a00f0b980ea7a002a00f0ba802a7b002a00f0bb806a7b002a00f0bc80aa7b002a00f0bd80ea7b002a00f050812a7c002a00f04e816a7c002a00f04c81aa7c002a00f04a81ea7c002a00f048812a7d002a00f046816a7d002a00f04481aa7d002a00f04281ea7d002a00f040812a7e002a00f03e816a7e002a00f03c81aa7e002a00f03a81ea7e002a00f038812a7f002a00f036816a7f002a00f03481aa7f002a00f03281ea7f002a00f03081203160297ff479af32e10bf1010b74e00bf1020b71e00bf1030b6ee00bf1040b6be00bf1050b68e00bf1060b65e00bf1070b62e00bf1080b5fe00bf1090b5ce00bf10a0b59e00bf10b0b56e00bf10c0b53e00bf10d0b50e00bf10e0b4de00bf10f0b4ae00bf1100b47e00bf1110b44e00131f6e00bf1120b3fe00231f1e00bf1130b3ae00331ece00bf1140b35e00431e7e00bf1150b30e00531e2e00bf1160b2be00631dde00bf1170b26e00731d8e00bf1180b21e00831d3e00bf1190b1ce00931cee00bf11a0b17e00a31c9e00bf11b0b12e00b31c4e00bf11c0b0de00c31bfe00bf11d0b08e00d31bae00bf11e0b03e00e31b5e00bf11f0bb1f5205f4ff0010100931fd364234ff47a7442f2107700bf01eb81025200b6fbf2f50a2d11d301fb03f2b6fbf2f50a2d0bd301fb04f2b6fbf2f50a2d05d37943b6fbf1f2092ae7d800e011465846bbf15f0f98bf5f20c0f1000c1ceb0b0a53d0b6fbf1f74cf6cd4207f13003ccf6cc4209f80b300a29a1fb023547d31af1010342d007fb11674fead508b7fbf8fe48f21f520ef1300309eb0b06c5f2eb1273706429a1fb023434d31af102032cd00efb18776409b7fbf4f544f6d35205f13003c1f26202b370b1f57a7fa1fb022323d31af1030218d005fb14729b0941f25975b2fbf3f7cdf2b715a1fb055407f13005f57007fb132642f210720bf1040b91424fea5431a9d209e0834607e00bf1010b04e00bf1020b01e00bf1030b0020009b09f80b002de00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d849444ff03f020a7003d1002189f85f1001e000204870002119f80100002800f0a18009eb0105687800285ed0a87800285dd0e87800285cd0287900285bd0687900285ad0a879002859d0e879002858d0287a002857d0687a002856d0a87a002855d0e87a002854d0287b002853d0687b002852d0a87b002851d0e87b002850d0287c00284fd0687c00284ed0a87c00284dd0e87c00284cd0287d00284bd0687d00284ad0a87d002849d0e87d002848d0287e002847d0687e002846d0a87e002845d0e87e002844d0287f002843d0687f002842d0a87f002841d0e87f002840d0203160297ff498af44e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2905d849444ff02f00087040f09580002089f85f00581c00f094809d0a4ff0000e19f80e00002800f08d8109eb0e067078002800f00f81b078002800f00e81f078002800f00d813079002800f00c817079002800f00b81b079002800f00a81f079002800f00981307a002800f00881707a002800f00781b07a002800f00681f07a002800f00581307b002800f00481707b002800f00381b07b002800f00281f07b002800f00181307c002800f00081707c002800f0ff80b07c002800f00081f07c002800f00181307d002800f00281707d002800f00381b07d002800f00481f07d002800f00581307e002800f00681707e002800f00781b07e002800f00881f07e002800f00981307f002800f00a81707f002800f00b81b07f002800f00c81f07f002800f00d810ef1200ebef1600f7ff477af4ff0600e05e100204870581c7ff46caf002119f80100002800f0aa8109eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04b81107c002800f04981507c002800f04781907c002800f04581d07c002800f04381107d002800f04181507d002800f03f81907d002800f03d81d07d002800f03b81107e002800f03981507e002800f03781907e002800f03581d07e002800f03381107f002800f03181507f002800f02f81907f002800f02d81d07f002800f02b81203160297ff479af2de10ef1010e74e00ef1020e71e00ef1030e6ee00ef1040e6be00ef1050e68e00ef1060e65e00ef1070e62e00ef1080e5fe00ef1090e5ce00ef10a0e59e00ef10b0e56e00ef10c0e53e00ef10d0e50e00ef10e0e4de00ef10f0e4ae00ef1100e47e00ef1110e44e00131f1e00ef1120e3fe00231ece00ef1130e3ae00331e7e00ef1140e35e00431e2e00ef1150e30e00531dde00ef1160e2be00631d8e00ef1170e26e00731d3e00ef1180e21e00831cee00ef1190e1ce00931c9e00ef11a0e17e00a31c4e00ef11b0e12e00b31bfe00ef11c0e0de00c31bae00ef11d0e08e00d31b5e00ef11e0e03e00e31b0e00ef11f0e0122b3f5205f1ed364234ff47a7442f2107602eb82004100b5fbf1f00a2811d302fb03f1b5fbf1f00a280bd302fb04f1b5fbf1f00a2805d37243b5fbf2f00928e7d800e00a46f046bef15f0f98bf4ff05f08c8f1000c42f2107a1ceb0e074dd0b5fbf2f30a2a03f1300009f80e004cf6cd40ccf6cc40a2fb000641d3781c3dd003fb1253f608b3fbf6f409eb0e0504f13000687048f21f50c5f2eb10642aa2fb000130d3b81c29d004fb16334e09b3fbf6f4b2f57a7f04f13000a87044f6d350c1f26200a2fb000120d3f81c16d004fb1630890941f25974b0fbf1f3cdf2b714a2fb044603f13004ec7003fb11050ef1040e52454fea5632afd209e0c64607e00ef1010e04e00ef1020e01e00ef1030e002009f80e0001b0bde8f08f0f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d849444ff03f00087005d1002089f85f0001b0bde8f08f0020487001b0bde8f08f2de9f0411f22831813f81f7c002f00f0808013f81e7c002f7dd013f81d7c002f7bd013f81c7c002f79d013f81b7c002f77d013f81a7c002f75d013f8197c002f73d013f8187c002f71d013f8177c002f6fd013f8167c002f6dd013f8157c002f6bd013f8147c002f69d013f8137c002f67d013f8127c002f65d013f8117c002f63d013f8107c002f61d013f80f7c002f5fd013f80e7c002f5dd013f80d7c002f5bd013f80c7c002f59d013f80b7c002f57d013f80a7c002f55d013f8097c002f53d013f8087c002f51d013f8077c002f4fd013f8067c002f4dd013f8057c002f4bd013f8047c002f49d013f8037c002f47d013f8027c002f45d013f8013c002b43d0835c002b41d020327f2a7ff47baf64e01f3a3ae01e3a38e01d3a36e01c3a34e01b3a32e01a3a30e0193a2ee0183a2ce0173a2ae0163a28e0153a26e0143a24e0133a22e0123a20e0113a1ee0103a1ce00f3a1ae00e3a18e00d3a16e00c3a14e00b3a12e00a3a10e0093a0ee0083a0ce0073a0ae0063a08e0053a06e0043a04e0033a02e0023a00e0013a5f2a25d8c2f15d0cc2f15e0ec2f15f03c2f160080244002509e000bffc78002cf47008bfbde8f0810435a84510d04e5d565586b1ab420bd04f197c78561974704cb1ae4504d0bc78b47024b1ac45e5d1002180f85f10bde8f08100bf7f2905d140f61301c0f20001794403e7b1f1ff3fc8bf0fe0b0b540f2fd72c0f200027a440d4611460446fff7f5fe20466942bde8b040ffe72de9f04f4ff0000c10f80c20002a00f0c48000eb0c035a78002a62d09a78002a62d0da78002a62d01a79002a62d05a79002a62d09a79002a62d0da79002a62d01a7a002a62d05a7a002a62d09a7a002a62d0da7a002a62d01a7b002a62d05a7b002a62d09a7b002a62d0da7b002a62d01a7c002a62d05a7c002a62d09a7c002a62d0da7c002a62d01a7d002a62d05a7d002a62d09a7d002a62d0da7d002a62d01a7e002a62d05a7e002a62d09a7e002a62d0da7e002a62d01a7f002a62d05a7f002a62d09a7f002a62d0da7f002a62d00cf1200cbcf1600f7ff496af4ff0600c5be00cf1010c58e00cf1020c55e00cf1030c52e00cf1040c4fe00cf1050c4ce00cf1060c49e00cf1070c46e00cf1080c43e00cf1090c40e00cf10a0c3de00cf10b0c3ae00cf10c0c37e00cf10d0c34e00cf10e0c31e00cf10f0c2ee00cf1100c2be00cf1110c28e00cf1120c25e00cf1130c22e00cf1140c1fe00cf1150c1ce00cf1160c19e00cf1170c16e00cf1180c13e00cf1190c10e00cf11a0c0de00cf11b0c0ae00cf11c0c07e00cf11d0c04e00cf11e0c01e00cf11f0c01230a291fd364274ff47a7642f2107500bf03eb83025200b1fbf2f40a2c11d303fb07f2b1fbf2f40a2c0bd303fb06f2b1fbf2f40a2c05d36b43b1fbf3f2092ae7d800e01346e2464cf6cd49bcf15f0f98bf4ff05f0acaf1000eccf6cc491eeb0c0b4ed0b1fbf3f50a2b05f1300200f80c20a3fb092446d31bf1010241d005fb1316e508b6fbf5f800eb0c0108f130024a7048f21f52c5f2eb12642ba3fb022434d31bf102022cd008fb15656609b5fbf6f4b3f57a7f04f130028a7044f6d352c1f26202a3fb027223d31bf1030718d004fb1654920941f25976b4fbf2f5cdf2b716a3fb066705f13006ce7005fb124142f210720cf1040c93424fea5733aed209e0d44607e00cf1010c04e00cf1020c01e00cf1030c002100f80c10bde8f08f0000434d01ffff0000000000000052420100ff000000080310000000000000000000080010631a2308011a1c0800100018c00420a0024801520964617368626f617264580162012028904e46616365636c61772f3337000000000000000000000000000000002020202020002020000000505050000000000000000000005050f85050f85050000000002070a8a07028a8702000000048a85010202854480000000020505020689090680000002020200000000000000000000010204040404020100000000040201010101020400000000000005020f82050000000000000002020f82020000000000000000000000020204000000000000000f800000000000000000000000000202000000000080810102020404000000000708898a8c88888700000000020602020202020700000000070888808102040f8000000007088083008088870000000000818284888f8080800000000f88080f00808887000000000708080f08888887000000000f808081010202020000000007088887088888870000000007088888878080870000000000000202000002020000000000000202000002020400000000008102040201008000000000000f80000f8000000000000004020100810204000000000708888102000202000000000708898a8a89880780000000070888888f888888800000000f08888f0888888f000000000708880808080887000000000e0908888888890e000000000f88080f0808080f800000000f88080f0808080800000000070888080b888887000000000888888f888888888000000007020202020202070000000003810101010909060000000008890a0c0c0a090880000000080808080808080f80000000088d8a8a888888888000000008888c8a89888888800000000708888888888887000000000f0888888f080808000000000708888888888a87008000000f0888888f0a0908800000000708880700808887000000000f8202020202020200000000088888888888888700000000088888850505020200000000088888888a8a8d88800000000888850202050888800000000888850502020202000000000f8081020408080f8000000007040404040404070000000004040202010100808000000007010101010101070000000205088000000000000000000000000000000000000f80040200000000000000000000000000000700878888878000000008080f088888888f00000000000007088808088700000000008087888888888780000000000007088f8808078000000001820702020202020000000000000788888888878087000008080f08888888888000000202000602020202070000000080800180808080808483000004040485060605048000000006020202020202070000000000000f0a8a8a8a8a8000000000000f08888888888000000000000708888888870000000000000f088888888f0808000000000788888888878080800000000b8c0808080800000000000007880700808f00000000020207020202020180000000000008888888888780000000000008888505020200000000000008888a8a8a870000000000000885020205088000000000000888888888878087000000000f810204080f800000000182020402020201800000000202020202020202000000000601010081010106000000048a89000000000000000009f0535593747c181040101010201020c5353a829c51bd314a810260d5b0bfe096d6963205220006d6963204c20006d6963203f20006e6f206374780061726d200063666720006f6666200070646d00636f646563002072656720002074626c2000540053002d00206c65617365200073207461702000200042400020736b697020002f002066722000206e7466200020756e7265672000000000", + "new": "b0b581ea00039b0701d0034637e0c2b110f0030315d000f1010ca2f1010e0023cc5c9e45c45403f1010404d0634413f003032346f4d121440319121b102a14d302e00346102a10d3d1f800c0d1f804e0cc688d68103adc609d60c3f804e043f810cb0f2a01f11001eed8042a07d300bf51f8045b043a032a43f8045bf8d8002a08bfb0bd0139013b11f8015f013a03f8015ff9d1b0bd00bf884218bf002a00d1704710b50b1a38bf431a934207d288420ad281ea00039b0726d0034669e0fff79fffbde81040704781ea000300eb020c9b0701eb020e42d15fea8c732bd0a0f1010c00bf8b1813f801ec8418531e04f801ec04d0624412f003021a46f2d101eb030e00eb030c17e0830736d0a2f1010c00f1010e002300bfcc5c9c45c45403f1010404d0734413f003032346f4d1121b2144031922e01346042b0ed3aef10402acf1040152f80449043b032b41f80449f8d802f1040e01f1040c1a4653b1aef10101acf1010300bf11f80149013a03f80149f9d1bde8104070470346042a06d351f8044b043a032a43f8044bf8d8002af0d00139013b00bf11f8014f013a03f8014ff9d1e6e700bf80b5002a18bf10f0030301d186460ce000f1010c864600bf013a0ef8011b04d01cf003030cf1010cf6d1102a11d35ffa81fc4ff001330cfb03fc00bf103acef80cc0cef808c0cef804c04ef810cb0f2af4d8042a0bd35ffa81fc4ff001330cfb03fc00bf043a032a4ef804cbfad8002a08bf80bdaef10103013a03f8011ffbd180bd00bf2de9f04fc7b04ff29c5bc2f2290b4ff6ff754ff47d7400274ff0010847f67f7a7f261191cde90f3007e000bf48f2a351c0f24501bff32f8f8847dbf80090bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14068b0f57d7f00f096804ff47d7006f004fd002800f0cb814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff010160446080f80e80a0f8c4a180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001f49457ff452afbff35f8f4be8000121b15be8001f4945f8d047e74ff47d7800274ff0010a47f67f797f2607e000bf48f2a351c0f24501bff32f8f8847dbf80040bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f098804ff47d7006f042fc002800f009814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff010160c0f8048080f80ea0a0f8c49180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001fa1427ff451afbff35f8f00bf4be8000121b15be8001fa142f8d045e7d0f8948242f6f76ac0f2440ab8f1000fbff35f8f4ad00af19a0240464ff0ff314ff0ff379047002840f090811198002861d010980778a7f1170002285bd811980c2840f07d81109c6078a178084300f07781e0780138022800f27281a279e379667a42ea0322237a207942ea034242ea0663a27ae67a6179192f42ea062200f0de81172f40f0f481002a40f05981fe2800f0b086812800f0a386002840f0b68651ea030040f04c8100f000bf04460020d047e8b104f5257151e8008fb8f1000f0cd1bff35f8f00bf41e80002002a00f0e58051e8008fb8f1000ff5d00021bff32f8f0029bff35f8f00f0d480804692e74ff0ff372ae147f6df40c0f24f00cdf83880804700274ff47d784ff0010947f67f744ff07f0a1397adf8507007e000bf48f2a351c0f24501bff32f8f8847dbf80060bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f09f804ff47d7006f0f8fa002800f097804ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff010160c0f8048080f80e90a0f8c44180f8c3a1058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb1427ff451afbff35f8f00bf4be8000159b15be8001fb142f8d045e70af5a9718847bce6012120e70020109f42f6f76addf83880c0f2440a9fb1119989b1397801f07f02b2f10b0418bf0124b2f11c0618bf01268a2924dc0b2926d01c2924d03ce00f9012a803f045ff4ff0ff3701249df85100002812a818bf4ff0ff3704f05ff8054644b99df8500028b94af21f30c0f247004c3080470f98002818bf056114e09c2901d08b2918d168b14af21f31c0f247010746884797f8681121b997f824133846109f49b14ff0ff370af5807140468847384647b0bde8f08f0f9012a8344003f007ff387800f07f061e2e05d11199384607f094fe0746b9e71d2e00f07e0018bf1a2819d1dbf800100322cff680720a40b2f1005fbff35f8f12d10a684ef66c63ccf2ff039a420bd14a68b2f57d7f04bf002281f8a12303e0a6f115010129e1d90f2e2cdd142e40f31082152e00f05d83162e00f069831f2e40f02c841198012840f0fc8438781f2840f0f88445f64d55c0f24605a847012841f0828140f24c71c0f2010105f5e2777944e02029220023b8470746002818bf4ff0ff3766e7092e00f3fe80052e00f03e82072e40f0028400274ff0010947f67f764ff07f080d943ae000294ff0ff3708bf002b7ff47caf1328bff479af102a4ff0000138bf01211228b2fa82f218bf510901297ff46caf00f01ebd182f4ff0ff3708bf00297ff463af002b7ff460af352800f30884002800f0f684012800f00285312840f0f484082abff451af00f003bd48f2a351c0f24501bff32f8f8847dbf80040bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f05a864ff47d7006f035f9002800f052864ff60c41cff6ff7142182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff0101604ff47d71416080f80e90a0f8c46180f8c381058445848584c584058545858585c585058645868586c586058745878587c5875be8001fa1427ff451afbff35f8f4be80001002900f0c6855be8001fa142f6d044e70a2e00f00a820b2e40f00483dbf800500320cff680702840b0f1005fbff35f8f41f05e8028684ef66c61ccf2ff01884241f0568068680027b0f57d7f7ff446aed5f8900342f68d49c0f244090028a5f8a07318bfc8470021a5f8d013c5f8cc13c5f86c1185f86a1185f86811d5f87001c5f8641185f86911c5f87011c5f82013a5f88c1320b148f2a351c0f245018847d5f89802002818bf03f0deff0026c5f89862d5f8880320b148f2a351c0f245018847c5f88863a5f88c63686ca5f8486040b1c847686c09f166018847002804bf002068644bf63940c0f251008047dbf800700320cff680703840b0f1005fbff35f8f48d138684ef66c61ccf2ff01884241d17868b0f57d7f3dd197f87b014ff00008c7f8848100b387f87b8197f8750149f259620138b0fa80f04109c0f2590240f20b1090474ef6e37610f1800fd8bf6ff07f00c0f25a067e28a8bf7e2087f8c401b04706f1bc008047d7f8880187f8748142f6f76addf83880c0f2440a50b1c847d7f8880109f166018847002804bf0020c7f88801dbf800000321cff680710140b1f1005fbff35f8f40f03b8701684ef66c62ccf2ff02914240f033874168b1f57d7f40f02e8790f8cc11002900f0238706f0cbfb00f025bf102e00f05581112e40f01f821198022840f0ef823878112840f0eb827878002840f0e78245f64d50c0f24600804701284ff000077ff465ad40f20830c0f210003790ff208df8d80044f25220c0f20100359040f2c960c0f24800cde93877804798b148f27e30c2f2070000880122c1b264298df8d72008d80721b0f5807f38bf03218df8d7108df8d80040f2d260adf8e000052037ae8df8e200f01d35a90522fff713f94ff22507c0f247070120092132460c23b847074600f0b9be11980d944ff47d7800244ff0010a47f67f797f2602282cbf7878ff200c9006e048f2a351c0f24501bff32f8f8847dbf80070bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f09f814ff47d7005f027ff002800f084844ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ef66c61ccf2ff010160c0f8048080f80ea0a0f8c49180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb9427ff452afbff35f8f4be80001002900f00c815be8001fb942f6d045e711980228c0f0cd8100f06ffe002800f0c8817e78002e00f08d83022e00f2c18140f0b585014611980628c0f03185109fb878fa783b797f7940ea022043ea072232283790389280f09a85322000f09dbd1199781c013907f05afb0746fff729bc1199384606f07ffb0746fff722bc119801380228c0f095817878b9784ff0ff3740ea0120b0f5007f3ff613ac0321119a01eb400191427ff40cac002700288df8dc708df8dd708df8de708df8df708df8e0708df8e1708df8e2708df8e3708df8e4708df8e5708df8e6708df8e7708df8e8708df8e9708df8ea708df8eb708df8ec708df8ed708df8ee708df8ef708df8f0708df8f1708df8f2708df8f3708df8f4708df8f5708df8f6708df8f7708df8f8708df8f9708df8fa708df8fb708df8fc708df8fd708df8fe708df8ff708df800718df801718df802718df803718df804718df805718df806718df807718df808718df809718df80a718df80b718df80c718df80d718df80e718df80f718df810718df811718df812718df813718df814718df815718df816718df817718df818718df819718df81a718df81b713ff488ab109937aa03314ff0010c4b78012b00f2f7800f7847ea0323db08d65c07f007070cfa07f7374240f0eb80d65c013847ea060701f10201d754e7d10d9404f04afe002800f06d844ff47d7800244ff0010a47f67f797f2608e31d2e60d11199781c013907f071ff0746fff752bb90f8481042f6f76addf83880109fdde90c64c0f2440a61b1416c39b142f68d42c0f244020546084690472846002180f848100121119a032a1ad3ceb9b878082800f23a854bf63941c0f25101963188470027fff727bb362800f00681462800f00081572840f0ec80002e7ff449abfbe0119a052ac0f0d580012e40f0d280b8783e46411e06294ff000073ff60babf17803293ff607ab3279002a3ff403ab4bf63943c0f2510303f59a7398470027fff7f9ba1a2818bf1c2e6cd104f0d5fd002868d000f00bfd814608f0fef9b9f1000f4ff0ff3718bf00283ff4e4aa834647f63400c2f20700d0f81806d9f894131b2ea0eb0100c9f89c0300f0a2831a2e40f0c383109900254f1c11994ff4f072a1f1010a4ff4a071cde93d5037a84ff420764ff48058cde90950cde901214846394652465b46cde937853f95cde90755cde90555cde90355009608f0fefc002840f09883d9f89c033946cde93e0537a80a90012009904ff4a07002904ff4f0700190484652465b464ff42077cde937853d95cde90755cde90555cde90355009708f0dbfc61e54ff0ff37fff784ba0c294ff0ff377ff4adaab3f5005f5dd3fff7a8ba481e1f284ff0ff373ff6a2aac1f51630834251d9fff79cba002b7ff497aa421f18bf0122b0f1350318bf01231a40b0f1590318bf01231a40b0f1470318bf0123134208bf012937d0b0f1370218bf0122b0f1c10318bf01231a4208bf02292bd09f284ff0ff377ff473aa042924d0fff76fba022e40f044814bf63940c0f2510080470027fff736ba022abff461aa13e0002a7ff45daaa0f1fd0102290cd397287ff456aa08e06ff0780002427ff450aa02e0402abff44caa45f64d50c0f24600804710990128c9784ff0010008bf022008424ff000073ff43baacdf838804ff47d7847f67f797f2406e048f2a351c0f24501bff32f8f8847dbf80060bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f096804ff47d7005f019fc002800f030814ff60c41cff6ff7142182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ef66c61ccf2ff0101600121c0f804808173a0f8c49180f8c341058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb1427ff452afbff35f8f4be8000121b15be8001fb142f8d047e74af21f35c0f247050446a84794f86801ddf83880109f00287ff46ba994f82403214600287ff465a93878172812d0d1f8840320b904f05ff9c4f8840360b342f68d41c0f24401a1f140024ff47a719047214608bb01f226300e4639460c22fef700fd0f98002186f825030120bff35f8f86f824034ff4f07001904ff4207005f5106600900020002200230027b04700283ff431a984f8247305f14c0080474ff0ff37fff728b9119a072ac0f05581032e40f05281b878fa783e4640ea022039797f79b57901284ff0010698bf304644f62062904228bf10464bf63942c0f2510202f5e272642928bf6421904747f63400c2f207000068002800f0d98247ea0521012988bf0e4642f68d41c0f24401a1f14002314690470027fff7bfb8002780f8477145f64d50c0f24600804701287ff4b4a843f2a310c0f2560080470746fff7acb8ddf838804ff0ff37fff7d4b800201199dde90d48022910992cbf4978ff21002800f0a48202294ff000072cd0012926d000297ff491a84cf67e21caf2101187778783cbf8041087818760058445848584c584058545858585c585058645868586c586058745878587c58780f8407080f8d17380f8d073c0f8cc73fff76db801218173fff769b88773fff766b842f6f76addf83880109fdde90c6400210020c0f2440a21e548f2a351c0f24501bff32f8f8847dbf80070bff35f8fdbf800000321cff680710140b1f1005fbff35f8f0bd101684ef66c62ccf2ff02914204d14168b1f57d7f00f0e0804ff47d7005f06efa002800f039814ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ef66c61ccf2ff010160c0f8048080f80ea0a0f8c49180f8c361058445848584c584058545858585c585058645868586c586058745878587c5875be8001fb9427ff452afbff35f8f4be8000100294dd05be8001fb942f7d046e780461198a14603284ff0000738d3301fb0fa80f04009084032d01198109a4cf6cd410338ccf6cc419578a0fb0101b5eb910f88bf8d082e46302d28bf302608f14a00d11c06eb8602fef75ffb002788f8486088f849709db1d8f8440038b9404600f0a7fa0028c8f8440000f07c8142f68d41c0f24401a1f1400201219047002742f6f76addf83880c0f2440a4c46fef758bfd0f870110027002900f0b0804ff400624ff0ff3c0df1dc0e04e033681a44b2f5403f50d28e18b568b7eb552ff5d1ec081ef8044005f0070324fa03f3db071ebf41f82570c6f808c0f760e6e71198032840f0c48010994ff4f077487889785a4640ea012600200890cde90600cde90400cde902004ff4a0700190484631464ff42073009707f06aff002800f01e814ff0ff37a3e01198012840f0a08009f57970bff35f8f50e8001f013140e80012002af8d113a94846012207f08afffff7d2b94ff0ff3752e04ff0000c4ff400634ff0000ec0f820c305e077463344b3f5403fbe4642d2cf18ba68ce580132f4d1f418220c022a2fd80a19956801352bd115682e443e6012681444220c022a23d80a19956801351fd115682e443e6012681444220c022a17d80a199568013513d115682e443e6012681444220c022a0bd80a199568013507d115682e443e6012681444b4f5403fcfd3bef1000fc7f804c00cbfc0f82033cef80430b7e7002742f6f76adde90d48c0f2440afef79abeb0f5fa6f084603d94ff4fa60379008460121054680f8471145f64d50c0f24600804701281bd143f2a318c0f25608a8f188008047022e074608bf002f01d057b90de04bf2110237a9c0f24b020220904728b10746c047002085f8470100e0002742f6f76addf83880c0f2440afef762be90f8cd11002918bf05f0a4fcdbf800000321cff680710140b1f1005fbff35f8f24d101684ef66c62ccf2ff0291421dd14168b1f57d7f19d1d0f8d813b1b14ff00041bff35f8fc0f8d4134af21f30c0f2470000f510674ff4f07001904ff4207600200021002200230096b84795f84701002785f8477158b145f64d50c0f246008047012804d143f2a310c0f256008047d5f8400195f84661c5f83c7185f84671a5f8447150b1c847d5f8400109f166018847002804bf0020c5f840010120a87356b14af27366c0f246060021002200230027b047fef7f6bd0027fef7f3bd701ca9f88c03002783e74bf639400027c0f2510088f84870804783e600bf2de9f04f81b04ef66c644ff29c55ccf2ff04c2f229054ff6ff7600274ff0010a47f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d5f80090bff35f8f2868bff35f8f01466ff39601b1f1005f07d10168a14204d14168b1f57d7f00f095804ff47d7004f0e8ff002800f08d804ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ff47d710460416080f80ea0a0f8c4b180f8c381068446848684c684068546858685c685068646868686c686068746878687c68755e8001f49457ff45aafbff35f8f45e8000129b155e8001f4945f8d04fe7002001b0bde8f08f70b500284dd001684ef66c62ccf2ff02914218bf70bd90f8481090f849504bf6394c8d42c0f2510c2ad205eb8501014491f84d2091f84e4091f84ae091f84b3091f84c1042ea0424012c4ff0010298bf14466e1c054680f84960b9b164294eea032028bf6421012888bf024644f62060824228bf02460cf5e2731046984706e0002180f84810bde870406047e047686c38b142f64d42c0f244022146bde87040104770bd02464ff64b70cff6ff7042f6653c7844c0f2440c00210023604700bf2de9f04fcdb04ff29c57c2f229073c6840f2030b20464ef66c696ff39600cff6807bccf2ff09b0f1005fbff35f8f40f0e9812068484540f0e5816068b0f57d7f40f0e08194f8710347f64c65c2f2070504f5497628b347f61800c2f20700016d4bf67c52c0f2720291421ad1406cc0b1d4f87c032968401a012802db03f05cff78b93046b8460df02bf950b142f69570c0f25b0080474746002084f8720384f8710394f8700368b1d4f880032968401a012802db03f040ff20b9002084f8700384f86a013078bff35f8f70b194f86fa3ac46baf1000f00961cd094f8250394f83e13091a18bf012115e094f87103002840f0888194f87003002840f08381d4f88403002800f07e8142f68d41c0f24401884777e1012194f8270394f83133059094f8280394f83d23069094f8265394f82a0394f82b9394f82ce394f82db394f82e8394f82f63934235d194f8302394f83c339a422fd194f83b2396422bd194f83a23904527d194f83923934523d194f8382396451fd194f8372391451bd194f83623904217d194f8292394f835339a4211d194f83423069b93420cd194f83323059b934207d194f83223954203d111b994f82583a9e00023012284f8403384f8433384f8443384f8453384f8463384f8473384f8483384f8493384f84a3384f84b3384f84c3384f84d3384f84e3384f84f3384f8503384f8513384f8523384f8533384f8543384f8553384f8563384f8573384f8583384f8593384f85a3384f85b3384f85c3384f85d3384f85e3384f85f3384f8603384f8613384f8623384f8633384f8643384f8653384f8663384f8673384f8683384f8693384f86a3384f86b3384f86c3384f86d3384f86e3384f83f2384f8415384f84203dcf8002047f61803170a84f8432384f84473170c120e84f846230822c2f2070384f8457384f86f231a6d4bf67c57c0f2720704f22631ba4204f2323a1bd15a6ccab140f6b803c2f200031a689ab1182d00f02984172d40f03584fe2804f2473c0d4600f05684002840f0608400980df0acf8294602e0022084f8400350460c22fdf71fff94f8258394f86fa384f83e8345f64d50c0f246008047811eb1fa81f14fea511b012808bf4ff0020bbaf1000f5ad004f23f3007a9049040f261400631c0f2470003910aa9023100254ff00309a0f5b84000240291019015e000bf029807a91a468df828908df82980fdf7e9fe47f00802019ff0200aa90023b8470334e0b25045b1462fd2aaeb0400c7b20420032f28bf4f468df81c0005983a468df81d0006988df81fb08df81e0004988df8204050fa84f103988df821a08df822508df823508df82450fdf7bbfeb81dc345c3b24ff00306c2d14ef60b670120f02107aac0f24707c9e7bff35f8f00994ff29c574ef66c6940f2030b0020c2f22907ccf2ff09cff6807b08703d68bff35f8f05ea0b00b0f1005f59d12868484556d16868b0f57d7f52d105f575700021bff35f8f50e8006f40e80012002af9d147f64c60bff35f8fc2f207000468b6f1004f0fd0b84603f073fd58b1002e00f04d8195f8ec03320a002800f0e38195f8ed13ece195f8ec03e8b147f61800c2f207000068b8b145f60960c2f207000478002040f261430a9007900aa907aac0f247032046984707990a9a43f69b53c0f24e0320469847002085f8ee0385f8ec03d5f8d80320b142f68d41c0f244018847d7f800a0bff35f8f0aea0b00b0f1005f40f00481daf80000484540f0ff80daf80400b0f57d7f40f0f9809af8700338b100208af86801caf864014db0bde8f08f9af86801002800f0d780daf86441002c00f0d28040f6b800c2f20000056807a802f066f9002d00f0d781284621464ff416324e464ff6ff770695fdf7fbfd002547f67f744ff07f0806e048f2a351c0f24501bff32f8f88474ff29c50c2f22900d0f80090bff35f8f0068bff35f8f00ea0b01b1f1005f07d10168b14204d14168b1f57d7f00f0b8804ff47d7004f028fc002802f00c814ff60c41cff6ff7100bf42182e3182f8f45382f8f55382f8f65382f8f75382f8f85382f8f95382f8fa5382f8fb5382f8fc5382f8fd5382f8fe5382f8ff5382f8005482f8015482f8025482f8035482f8045482f8055482f8065482f8075482f8085482f8095482f80a5482f80b5482f80c5482f80d5482f80e5482f80f5482f8105482f8115482f8125482f8135482f8145482f8155482f8165482f8175482f8185482f8195482f81a5482f81b5482f81c5482f81d5482f81e5482f81f5482f8205482f82154a0d14ff47d71416001214ff29c5206608173a0f8c44180f8c381078447848784c784078547858785c785078647868786c786078747878787c787c2f2290252e8001f49457ff453afbff35f8f42e8000121b352e8001f4945f8d048e79af86a0170b1daf86c0140b147f64c61c2f207010968401a002802f3848000208af86a0140f6a120c0f2470080474db0bde8f08f95f8ec03002840f0db80e3e6817b002942f05780027f0021002a8df8281000f028824ff29c550aaac2f22905535c002b00f0928253185f78002f00f050829f78002f00f04e82df78002f00f04c821f79002f00f04a825f79002f00f048829f79002f00f04682df79002f00f044821f7a002f00f042825f7a002f00f040829f7a002f00f03e82df7a002f00f03c821f7b002f00f03a825f7b002f00f038829f7b002f00f03682df7b002f00f034821f7c002f00f032825f7c002f00f030829f7c002f00f02e82df7c002f00f02c821f7d002f00f02a825f7d002f00f028829f7d002f00f02682df7d002f00f024821f7e002f00f022825f7e002f00f020829f7e002f00f01e82df7e002f00f01c821f7f002f00f01a825f7f002f00f018829f7f002f00f01682db7f002b00f01482203160297ff47baf33e20120a5f8ec0340f20220a5f8f0030220002185f8ef03c5f8e01302f00103c6f300208b42c6f34b2206d123b395f8f233f7b2bb421fd00ce05bb995f8ef13a5f8ea2385f8f013022185f8f113c5f8dc4311e095f8ef3385f8f03385f8f163a5f8ea23c5f8dc4331b9012185f8ee13c6f34951a5f8e813002804bf002185f8ee1385f8ed0385f8f26395f8ee1341b395f8680160b1d5f8e403bff35f8fb5f8e8136ff39f20884216d195f8ee13c1b195f8ef6340e000208af86801caf864018af86a0101208af8690140f6a120c0f24700804701f06dbf002085f8ee03c5f8dc43d5f8dc13b5f8ea0395f8f163611a814220d28902b1fbf0f04ff4406395f8f01300fb00f2a3eb40005043000d721a00fb02f34ff60c47002b4ff40073cff6ff7748bf07f5fa7310fb0230c21700eb925001eb9026002147f61800c2f207000068e0b1d5f8e003f4b2a0421ad0002040f261430a9007900aa907aac0f247032046984707990a9a43f69b53c0f24e0320469847c5f8e04395f8ee1302e00020c5f8e003d5f8d80385f8ef6311b14ff47a7108e095f8f113f2b28a424ff0280108bf4ff47a7142f68d42c0f24402403a904795f8ee034746c8b13868bff35f8f00ea0b01b1f1005f41f0f8860168494541f0f4864168b1f57d7f41f0ef86002180f86811c0f864114db0bde8f08f95f8ed0300287ff453adf0b20228ddd140f6b800c2f2000001680029d6d001684ff416322139002301f8403f403a01f81f3c01f81e3c01f81d3c01f81c3c01f81b3c01f81a3c01f8193c01f8183c01f8173c01f8163c01f8153c01f8143c01f8133c01f8123c01f8113c01f8103c01f80f3c01f80e3c01f80d3c01f80c3c01f80b3c01f80a3c01f8093c01f8083c01f8073c01f8063c01f8053c01f8043c01f8033c01f8023c01f8013c4b708b70cb700b714b718b71cb710b724b728b72cb720b734b738b73cb730b744b748b74cb740b754b758b75cb750b764b768b76cb760b774b778b77cb7781f820309cd100684ef217310a904ff416300b900aa8c0f247018847474661e700980d460cf0f2fd10b302304ff0030008bf022084f840032946fff7dcbb84f87003dcf800204ef660231a44c4f88023b8b100980d460cf0b7ff0cf08bff294660b9fff7c8bb4ff29c55c2f2290595e00cf080ff002829463ff4bdab0320fff7b8bb002084f86a01fff7b5bb18684a4600eb0b20704400eb084000eb06616046fdf7ccfa0ee04eea0b2141ea084141ea066361464a460cf07ffd00281cbf032084f8400309f1080084f86f032946fff792bb01313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2921d84ff0520353541dd00a4445235e29537018d04f235d29937014d052235c29d37010d044235b2913710cd045235a29537108d052235929937104d020235829d37141f0c48200218df887100121427f002a00f0c28000220aab9f5c002f00f0a0809f187e78002e5ed0be78002e5dd0fe78002e5cd03e79002e5bd07e79002e5ad0be79002e59d0fe79002e58d03e7a002e57d07e7a002e56d0be7a002e55d0fe7a002e54d03e7b002e53d07e7b002e52d0be7b002e51d0fe7b002e50d03e7c002e4fd07e7c002e4ed0be7c002e4dd0fe7c002e4cd03e7d002e4bd07e7d002e4ad0be7d002e49d0fe7d002e48d03e7e002e47d07e7e002e46d0be7e002e45d0fe7e002e44d03e7f002e43d07e7f002e42d0be7f002e41d0ff7f002f40d02032602a7ff49aaf54e001323ae0023238e0033236e0043234e0053232e0063230e007322ee008322ce009322ae00a3228e00b3226e00c3224e00d3222e00e3220e00f321ee010321ce011321ae0123218e0133216e0143214e0153212e0163210e017320ee018320ce019320ae01a3208e01b3206e01c3204e01d3202e01e3200e01f325f2a15d84ff053079f5411d013444b275e2a5f700cd049275d2a9f7008d050275c2adf7004d020275b2a1f7140f0f08100228df887200131827f002a00f0be8000210aaa535c002b00f0a08053185f78002f5ed09f78002f5dd0df78002f5cd01f79002f5bd05f79002f5ad09f79002f59d0df79002f58d01f7a002f57d05f7a002f56d09f7a002f55d0df7a002f54d01f7b002f53d05f7b002f52d09f7b002f51d0df7b002f50d01f7c002f4fd05f7c002f4ed09f7c002f4dd0df7c002f4cd01f7d002f4bd05f7d002f4ad09f7d002f49d0df7d002f48d01f7e002f47d05f7e002f46d09f7e002f45d0df7e002f44d01f7f002f43d05f7f002f42d09f7f002f41d0db7f002b40d0203160297ff49aaf50e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2911d84ff0440353540dd00a4455235e29537008d050235d29937004d020235c29d37040f0098100218df8871001216a6846f23f53c5f28803b3eb520f40f08b80d20700f08d8000210aaa535c002b00f0858153185f78002f00f0f9809f78002f00f0f980df78002f00f0f9801f79002f00f0f9805f79002f00f0f9809f79002f00f0f980df79002f00f0f9801f7a002f00f0fc805f7a002f00f0fc809f7a002f00f0fc80df7a002f00f0fc801f7b002f00f0fc805f7b002f00f0fc809f7b002f00f0fc80df7b002f00f0fc801f7c002f00f0fc805f7c002f00f0fc809f7c002f00f0fc80df7c002f00f0fc801f7d002f00f0fc805f7d002f00f0fc809f7d002f00f0fc80df7d002f00f0fc801f7e002f00f0fc805f7e002f00f0fc809f7e002f00f0fc80df7e002f00f0fc801f7f002f00f00d815f7f002f00f00b819f7f002f00f00981db7f002b00f00781203160297ff47baf1de14cf67e22caf210126a60002940f0198100210aaa535c002b00f0dc8053185f78002f61d09f78002f60d0df78002f5fd01f79002f5ed05f79002f5fd09f79002f60d0df79002f61d01f7a002f62d05f7a002f63d09f7a002f64d0df7a002f68d01f7b002f69d05f7b002f6ad09f7b002f6bd0df7b002f6cd01f7c002f6dd05f7c002f6ed09f7c002f6fd0df7c002f70d01f7d002f71d05f7d002f72d09f7d002f73d0df7d002f74d01f7e002f75d05f7e002f76d09f7e002f77d0df7e002f78d01f7f002f79d05f7f002f7ad09f7f002f7bd0db7f002b7cd0203160297ff49aaface000211171f6e6013173e0023171e003316fe004316de0013184e0053169e0023180e0063165e003317ce0073161e0043178e008315de0053174e0093159e0063170e00a3155e007316ce000225a710fe60b314ee0083165e00c314ae0093161e00d3146e00a315de00e3142e00b3159e00f313ee00c3155e010313ae00d3151e0113136e00e314de0123132e00f3149e013312ee0103145e014312ae0113141e0153126e012313de0163122e0133139e017311ee0143135e018311ae0153131e0193116e016312de01a3112e0173129e01b310ee0183125e01c310ae0193121e01d3106e01a311de01e3102e01b3119e01f315f2931d84ff04f0353542dd00a444b235e29537028d020235d29937024d00021d17024e01c3104e01d3102e01e3100e01f315f2918d84ff04103535414d00a444c235e2953700fd05d2993700cd04f235c29d37008d043235b29137104d020235a29537140f0828700218df8871000220aafb95c002900f0a080bb18597800295ed0997800295dd0d97800295cd0197900295bd0597900295ad09979002959d0d979002958d0197a002957d0597a002956d0997a002955d0d97a002954d0197b002953d0597b002952d0997b002951d0d97b002950d0197c00294fd0597c00294ed0997c00294dd0d97c00294cd0197d00294bd0597d00294ad0997d002949d0d97d002948d0197e002947d0597e002946d0997e002945d0d97e002944d0197f002943d0597f002942d0997f002941d0d97f002940d02032602a7ff49aaf42e001323ae0023238e0033236e0043234e0053232e0063230e007322ee008322ce009322ae00a3228e00b3226e00c3224e00d3222e00e3220e00f321ee010321ce011321ae0123218e0133216e0143214e0153212e0163210e017320ee018320ce019320ae01a3208e01b3206e01c3204e01d3202e01e3200e01f325f2a03d84ff07701b95403d100218df8871002e0b91800224a7004694ff0000917f80910002900f0c48007eb09025178002962d09178002962d0d178002962d01179002962d05179002962d09179002962d0d179002962d0117a002962d0517a002962d0917a002962d0d17a002962d0117b002962d0517b002962d0917b002962d0d17b002962d0117c002962d0517c002962d0917c002962d0d17c002962d0117d002962d0517d002962d0917d002962d0d17d002962d0117e002962d0517e002962d0917e002962d0d17e002962d0117f002962d0517f002962d0917f002962d0d17f002962d009f12009b9f1600f7ff496af4ff060095be009f1010958e009f1020955e009f1030952e009f104094fe009f105094ce009f1060949e009f1070946e009f1080943e009f1090940e009f10a093de009f10b093ae009f10c0937e009f10d0934e009f10e0931e009f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f0901250a2c1ed364214ff47a7242f2107305eb85077f00b4fbf7f60a2e11d305fb01f7b4fbf7f60a2e0bd305fb02f7b4fbf7f60a2e05d35d43b4fbf5f7092fe7d800e03d464946b9f15f0f98bf5f21c1f1000e05911eeb090b54d0b4fbf5f30aa903f1300201f809204cf6cd41ccf6cc410a2da5fb017248d31bf1010742d003fb154cd608bcfbf6f80aa901eb090448f21f5108f13002c5f2eb116270642da5fb013235d31bf102032cd008fb16c65309b6fbf3f244f6d35102f13007c1f26201a770b5f57a7fa5fb011724d31bf1030118d002fb1361ba0941f25977b1fbf2f3cdf2b717a5fb077603f13007e77003fb121442f2107109f104098d424fea5635a8d20ae0ddf8149007e009f1010904e009f1020901e009f1030900240aab03f80940195d002900f0a0801f19797800295ed0b97800295dd0f97800295cd0397900295bd0797900295ad0b979002959d0f979002958d0397a002957d0797a002956d0b97a002955d0f97a002954d0397b002953d0797b002952d0b97b002951d0f97b002950d0397c00294fd0797c00294ed0b97c00294dd0f97c00294cd0397d00294bd0797d00294ad0b97d002949d0f97d002948d0397e002947d0797e002946d0b97e002945d0f97e002944d0397f002943d0797f002942d0b97f002941d0f97f002940d02034602c7ff49aaf50e001343ae0023438e0033436e0043434e0053432e0063430e007342ee008342ce009342ae00a3428e00b3426e00c3424e00d3422e00e3420e00f341ee010341ce011341ae0123418e0133416e0143414e0153412e0163410e017340ee018340ce019340ae01a3408e01b3406e01c3404e01d3402e01e3400e01f345f2c11d84ff0750119550dd0191973225e2c4a7008d020225d2c8a7004d070225c2cca7040f09d8000218df8871044694ff0000e13f80e10002900f0c78003eb0e056978002962d0a978002962d0e978002962d02979002962d06979002962d0a979002962d0e979002962d0297a002962d0697a002962d0a97a002962d0e97a002962d0297b002962d0697b002962d0a97b002962d0e97b002965d0297c002965d0697c002965d0a97c002965d0e97c002965d0297d002965d0697d002965d0a97d002965d0e97d002965d0297e002965d0697e002965d0a97e002965d0e97e002965d0297f002965d0697f002965d0a97f002965d0e97f002965d00ef1200ebef1600f7ff496af4ff0600e5ee00ef1010e5be00ef1020e58e00ef1030e55e00ef1040e52e00ef1050e4fe00ef1060e4ce00ef1070e49e00ef1080e46e00ef1090e43e00ef10a0e40e00ef10b0e3de00ef10c0e3ae00ef10d0e37e00ef10e0e34e000220a7162e70ef10f0e2ee00ef1100e2be00ef1110e28e00ef1120e25e00ef1130e22e00ef1140e1fe00ef1150e1ce00ef1160e19e00ef1170e16e00ef1180e13e00ef1190e10e00ef11a0e0de00ef11b0e0ae00ef11c0e07e00ef11d0e04e00ef11e0e01e00ef11f0e01250a2c1ed364214ff47a7242f2107305eb85077f00b4fbf7f60a2e11d305fb01f7b4fbf7f60a2e0bd305fb02f7b4fbf7f60a2e05d35d43b4fbf5f7092fe7d800e03d46f446bef15f0f98bf4ff05f0cccf1000842f2107b18eb0e0952d0b4fbf5f20aa902f1300301f80e304cf6cd41ccf6cc410a2da5fb016345d319f1010640d002fb1546db08b6fbf3f20aa901eb0e0448f21f5102f13007c5f2eb116770642da5fb011732d319f102012ad002fb13637a09b3fbf2f6b5f57a7f06f13001a17044f6d351c1f26201a5fb011721d319f1030116d006fb1231ba0941f25976b1fbf2f3cdf2b716a5fb066703f13006e67003fb12140ef1040e5d454fea5735aad209e0e64607e00ef1010e04e00ef1020e01e00ef1030e00240df1280b0bf80e401bf80410002900f0a1800beb0405697800295ed0a97800295dd0e97800295cd0297900295bd0697900295ad0a979002959d0e979002958d0297a002957d0697a002956d0a97a002955d0e97a002954d0297b002953d0697b002952d0a97b002951d0e97b002950d0297c00294fd0697c00294ed0a97c00294dd0e97c00294cd0297d00294bd0697d00294ad0a97d002949d0e97d002948d0297e002947d0697e002946d0a97e002945d0e97e002944d0297f002943d0697f002942d0a97f002941d0e97f002940d02034602c7ff498af5ee001343ae0023438e0033436e0043434e0053432e0063430e007342ee008342ce009342ae00a3428e00b3426e00c3424e00d3422e00e3420e00f341ee010341ce011341ae0123418e0133416e0143414e0153412e0163410e017340ee018340ce019340ae01a3408e01b3406e01c3404e01d3402e01e3400e01f345f2c1fd84ff075010bf804101ad00beb040173225e2c4a7014d020225d2c8a7010d074225c2cca700cd031225b2c0a7108d030225a2c4a7104d02022592c8a7140f0898200218df88710d0f8cc734ff000091bf80910002900f0c4800beb09046178002962d0a178002962d0e178002962d02179002962d06179002962d0a179002962d0e179002962d0217a002962d0617a002962d0a17a002962d0e17a002962d0217b002962d0617b002962d0a17b002962d0e17b002962d0217c002962d0617c002962d0a17c002962d0e17c002962d0217d002962d0617d002962d0a17d002962d0e17d002962d0217e002962d0617e002962d0a17e002962d0e17e002962d0217f002962d0617f002962d0a17f002962d0e17f002962d009f12009b9f1600f7ff496af4ff060095be009f1010958e009f1020955e009f1030952e009f104094fe009f105094ce009f1060949e009f1070946e009f1080943e009f1090940e009f10a093de009f10b093ae009f10c0937e009f10d0934e009f10e0931e009f10f092ee009f110092be009f1110928e009f1120925e009f1130922e009f114091fe009f115091ce009f1160919e009f1170916e009f1180913e009f1190910e009f11a090de009f11b090ae009f11c0907e009f11d0904e009f11e0901e009f11f0901240a2f1ed364214ff47a7242f2107304eb84067600b7fbf6f50a2d11d304fb01f6b7fbf6f50a2d0bd304fb02f6b7fbf6f50a2d05d35c43b7fbf4f6092ee7d800e03446c846b9f15f0f98bf4ff05f08c8f1000e42f2107c1eeb09054dd0b7fbf4f14cf6cd4001f13002ccf6cc400bf809200a2ca4fb002341d36a1c3dd001fb1476d908b6fbf1f348f21f5003f130020beb0907c5f2eb107a70642ca4fb000230d3a81c29d003fb11615309b1fbf3f6b4f57a7f06f13000b87044f6d350c1f26200a4fb000220d3e81c16d006fb1310910941f25973b0fbf1f2cdf2b713a4fb033502f13003fb7002fb110709f1040964454fea5534afd209e0c14607e009f1010904e009f1020901e009f10309069d40f6b8060022c2f200060bf809201bf80200002800f0a1800beb0200417800295ed0817800295dd0c17800295cd0017900295bd0417900295ad08179002959d0c179002958d0017a002957d0417a002956d0817a002955d0c17a002954d0017b002953d0417b002952d0817b002951d0c17b002950d0017c00294fd0417c00294ed0817c00294dd0c17c00294cd0017d00294bd0417d00294ad0817d002949d0c17d002948d0017e002947d0417e002946d0817e002945d0c17e002944d0017f002943d0417f002942d0817f002941d0c07f002840d02032602a7ff498af49e001323ae0023238e0033236e0043234e0053232e0063230e007322ee008322ce009322ae00a3228e00b3226e00c3224e00d3222e00e3220e00f321ee010321ce011321ae0123218e0133216e0143214e0153212e0163210e017320ee018320ce019320ae01a3208e01b3206e01c3204e01d3202e01e3200e01f325f2a0ad84ff075000bf8020005d00beb020073215e2a41705dd100208df887000aaf42f2941845f29c14284602213a46c2f22008c2f213040bf0a3fd00208df8280038460bf01bff28460e213a460bf098fd4ff6a420cff6ff703058a0426ad14ff6b020cff6ff703058b0f54d2f62d14ff6b420cff6ff703058a0425bd145f610634ff0000ec2f213034cf6394408f1040c00274ff0ff3263454cd8186830f003051bd0984528bf0c2846d3a8eb03018d424ff0ff3142d8bd42394688bf2946c00703eb05001cbf0f46ae44013c00f10403e1d12fe000218170a1e70421b7f5807f21d300223d46b5f5007f17d3b5f5806f16d3b5f5006f15d30901b2eb153f4fea1515f0d10fe00022ca7176e500219171fff77db800211172fef73bbd490002e0890000e0c900634504d1484207ea0002714603e04ff0ff324ff0ff3147f64c60c2f20700d0f8840008f1080342f6941c9842c2f2270c4dd142f610674ff0000bc2f2200746f6b9700cf1040e00244ff0ff384ff0ff3977453cd83e6836f0030515d0bc4528bf0c2e36d3aceb07039d4234d82346a54288bf2b46f6071cbf1c46ab447b19013803f10407e4d122e00420b4f5807f17d34ff000082546b5f5007f0cd3b5f5806f0bd3b5f5006f0ad30001b8eb153f4fea1515f0d104e0400002e0800000e0c000774504d1404204ea0008d94603e04ff0ff384ff0ff394ff6882040f6b807cff6ff70c2f200073b580cf10800834264d14ff69423cff6ff73fb58b3f5333f5cd14ff69823cff6ff73fb58834255d14ff29c5043f21063c2f229004ff0000bc2f2270342f6f935a0f1040ca0f1080e0024634542d81e6836f003071ad09e454ff0ff30059028bf0c2e3ad3aeeb030087424ff0ff3034d82046a74288bf3846f6071cbf0446bb44d819013d00f10403dfd123e00427b4f5807f17d34ff0000e2546b5f5007f0cd3b5f5806f0bd3b5f5006f0ad33f01beeb153f4fea1515f0d104e07f0002e0bf0000e0ff00634505d17b4204ea03000590584602e04ff0ff300590064666208df8280072208df8290065208df82a008df82b002f208df82c006d204b238df82d0061208df8313069238df82e0078208df83230422356278df82f0020208df833303a238df8377047270aac8df830008df834308df835004c238df838708df83a00002720468df836308df839308df83b700bf0dafe069de05d002800f0a080e019417800295ed0817800295dd0c17800295cd0017900295bd0417900295ad08179002959d0c179002958d0017a002957d0417a002956d0817a002955d0c17a002954d0017b002953d0417b002952d0817b002951d0c17b002950d0017c00294fd0417c00294ed0817c00294dd0c17c00294cd0017d00294bd0417d00294ad0817d002949d0c17d002948d0017e002947d0417e002946d0817e002945d0c17e002944d0017f002943d0417f002942d0817f002941d0c07f002840d02037602f7ff49aaf64e001373ae0023738e0033736e0043734e0053732e0063730e007372ee008372ce009372ae00a3728e00b3726e00c3724e00d3722e00e3720e00f371ee010371ce011371ae0123718e0133716e0143714e0153712e0163710e017370ee018370ce019370ae01a3708e01b3706e01c3704e01d3702e01e3700e01f375f2f25d84ff02000e05521d0e01945215e2f41701cd076215d2f817018d065215c2fc17014d06e215b2f017110d048215a2f41710cd07521592f817108d06221582fc17104d02021572f017240f0f88000208df887002046494642460bf005fe0020215c002900f0a08021184a78002a5ed08a78002a5dd0ca78002a5cd00a79002a5bd04a79002a5ad08a79002a59d0ca79002a58d00a7a002a57d04a7a002a56d08a7a002a55d0ca7a002a54d00a7b002a53d04a7b002a52d08a7b002a51d0ca7b002a50d00a7c002a4fd04a7c002a4ed08a7c002a4dd0ca7c002a4cd00a7d002a4bd04a7d002a4ad08a7d002a49d0ca7d002a48d00a7e002a47d04a7e002a46d08a7e002a45d0ca7e002a44d00a7f002a43d04a7f002a42d08a7f002a41d0c97f002940d0203060287ff49aaf5be001303ae0023038e0033036e0043034e0053032e0063030e007302ee008302ce009302ae00a3028e00b3026e00c3024e00d3022e00e3020e00f301ee010301ce011301ae0123018e0133016e0143014e0153012e0163010e017300ee018300ce019300ae01a3008e01b3006e01c3004e01d3002e01e3000e01f305f281cd84ff02001215418d021184f225e284a7013d074225d288a700fd068225c28ca700bd065225b280a7107d072225a284a7103d0202259288a7128d100208df887000aac059a204631460bf038fd28461a2122460bf069fa00208af86801caf8640106984ef217310a904ff416300b900aa8c0f24701884701208af86a0107a800f031f9caf814004db0bde8f08f0020c871d6e70021417207e72de9f04f81b0009041f204024cf65560cef20002ccf2ac50c2f8ac0f4ef6fc50cef2000001684ef66c6641f08071016052f8040c4ff29c57ccf2ff06c2f229074ff6ff7440f0010000254ff0010847f67f794ff07f0a42f8040c06e048f2a351c0f24501bff32f8f8847d7f800b0bff35f8f3868bff35f8f01466ff39601b1f1005f07d10168b14204d14168b1f57d7f00f094804ff47d7002f0aafa002800f0ca804ff60c41cff6ff7100bf42182e3182f8f45382f8f55382f8f65382f8f75382f8f85382f8f95382f8fa5382f8fb5382f8fc5382f8fd5382f8fe5382f8ff5382f8005482f8015482f8025482f8035482f8045482f8055482f8065482f8075482f8085482f8095482f80a5482f80b5482f80c5482f80d5482f80e5482f80f5482f8105482f8115482f8125482f8135482f8145482f8155482f8165482f8175482f8185482f8195482f81a5482f81b5482f81c5482f81d5482f81e5482f81f5482f8205482f82154a0d14ff47d710660416080f80e80a0f8c49180f8c3a1048444848484c484048544858485c485048644868486c486048744878487c48757e8001f59457ff45aafbff35f8f47e8000121b157e8001f5945f8d04fe78169d1bb47f64c6245f6e466c2f20702cff6f8761368314617689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f421ed041f20401cef200010b6817681168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94206d041f20401cef200010968c91a816141f20400cef2000000680099086001b0bde8f08f00bf2de9f04f83b041f20401cef200014ef66c674ff29c5609680068ccf2ff07c2f229064ff6ff744ff000084ff0010947f67f7a4ff07f0b0291019006e048f2a351c0f24501bff32f8f88473568bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168b94204d14168b1f57d7f00f093804ff47d7002f095f9002800f0e7804ff60c41cff6ff7142182e3182f8f48382f8f58382f8f68382f8f78382f8f88382f8f98382f8fa8382f8fb8382f8fc8382f8fd8382f8fe8382f8ff8382f8008482f8018482f8028482f8038482f8048482f8058482f8068482f8078482f8088482f8098482f80a8482f80b8482f80c8482f80d8482f80e8482f80f8482f8108482f8118482f8128482f8138482f8148482f8158482f8168482f8178482f8188482f8198482f81a8482f81b8482f81c8482f81d8482f81e8482f81f8482f8208482f82184a0d14ff47d710760416080f80e90a0f8c4a180f8c3b1048444848484c484048544858485c485048644868486c486048744878487c48756e8001fa9427ff45cafbff35f8f46e8000121b156e8001fa942f8d051e7816961b144f6d350c1f26200a1fb0001880901284ff0010088bf88094ce047f64c6245f6e466c2f20702cff6f8761368314600bf17689f420ed117689f420bd117689f4208d117689f4203d1002901f10401efd19f422ed041f20401cef200010b6817681168b9420ed11168b9420bd11168b94208d11168b94203d1002e06f10406efd1b94216d041f20401cef20001096844f6d357ca1ac1f26207a2fb07768261b00901284ff0010088bfb009994208bffa2000e0fa20dde90121891ab1fbf0f003b0bde8f08f2ab1a2fb0103002b1cbf0020704702fb01f0ffe7b0b54ff2a054c2f229040146206846f23f52c5f28802b2eb500f40f258304df681124cf67e25c2f20000c0f24802caf2101518bf25609047002804bf691c2160b0bd00bf0846ffe7014640f258304df69f22c2f20000c0f248021047002855d1002953d0082a51d30b78aa2b4ed18b79f02b4bd12de9f04182b045f64d550b2ac0f2460547d3c878a2f10803834242d14878212841d1087901283ed1487901283bd1c879c8bb0c4614f8080f10f03c0f33d18818884610f8021c10f8010c164641ea0027a2f10a0081b220460af032f9874222d1a847811eb1fa81f14f09012808bf0227002f4ad0207887f00301084247d0012039464246334600f07ff90446002898f8080018bf06243be04ff27143c0f24c0318470b2400e00a24a847811eb1fa81f14e09012808bf02261eb3304600f090f8f8b10546407ce0b10027284631463246032300970af0acf9686840b14bf69b71c0f25d0188476868fff774ff6f602868af75002818bffff76dff00202860a8602882204602b0bde8f0810624f9e700243842f6d0404631463a463b4600f056f9002818bf0446ece70b291dd3c278a1f10803934218d10278aa2a13d14278212a10d10279012a0dd14279012a0ad18279f02a07d1c2792ab9024612f8083f13f03c0f03d00a2070470b20704710b5084410f8023c10f8010c43ea0024a1f10a0081b210460af09cf8201a18bf0a2010bd002808bf7047b0b582b00446407cd0b100252046032300950af042f9606840b14bf69b71c0f25d0188476068fff70aff65602068a575002818bffff703ff00202060a060208202b0bde8b040704700bf2de9f04f81b04ef66c654ff29c56ccf2ff05c2f229064ff6ff7700244ff0010b47f67f784ff07f09009006e048f2a351c0f24501bff32f8f8847d6f800a0bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168a94204d14168b1f57d7f00f095804ff47d7001f038ff002800f08d804ff60c41cff6ff7100bf42182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d710560416080f80eb0a0f8c48180f8c391078447848784c784078547858785c785078647868786c786078747878787c78756e8001f51457ff45aafbff35f8f46e8000129b156e8001f5145f8d04fe700200099002801eb410100eb011118bf01f51b7001b0bde8f08f00bfb0b5c4b0dc08202c03d94ff0ff3044b0b0bd0df107048df807008df80810a01c11461a461d46fbf72ff8a81c4af6610582b2c0f24605f02021460023a84744b0b0bd00bf2de9f04f89b0064618469a4617468946fff700ff002800f09983044696f908000796b0f1ff3f00f003050add264616f8110f00283fd12068002818bffff7e4fd2de3207c10b3607c00b34ff000082046394652460323cdf800800af003f8606848b14bf69b71c0f25d0188476068fff7cbfdc4f80480206884f81680002818bffff7c2fd00202060a06020822068002818bffff7b9fd4ff480710020218207992060a0608978a081092004f11106e174a174257560760799a07c8978884240f0d382217da94240f0cf82411ca9f10b00627e01961e2828bf1e209042a17488bf6076a9f10200039787b20a2f4ff00005c0f0db82092241f2210809200497cdf808a017e02068049f002818bffff77cfda089002d00f10100069d26602674a660a08118bf0625059e06eb0b0082b2ba4280f0bb82217c80b20429064600f28080079b461c9a5c4b1c0129237405dd022906d0032968d1e28106e021b9627503e0238943ea02222281be4280f09e82042966d0079a831c925d8f1c0129277406dd049fff290bd003290bd11e464ce000291cbf278947ea0222049f228102e0627500e0e281bb4280f08082022935d8079ac61cd25ccb1c0129237405dd022933d0fe2905d1627506e021b9238943ea0222228100e0e281be4280f0678202292fd0079a031d925d41f00407fc2927740add049ffd290cd0fe2903d0278947ea0222049f228105e0049f0029bed1e28100e06275bb4280f0498209b11e4610e0461d0798c25c05202074e189208941ea0221e18128b1fff7c4fc0028206000f06682b4f808906089a9eb00011ffa81fbb1b27a1a5a45b8bf93465fea0b420ad022681044079a11441ffa8bf2faf7ebfe6089b4f80890584481b2494560817ff454afd4f800a0607dbaf1000f05964ff000060df1230108bf8a460f288df8236006d8217d00f00302511ab1fa81f14e0900074ff0000706d4217e607e814238bf20760fe000bf606840b14bf69b71c0f25d0188476068fff798fc6760607e20760120e0820695a6b1607da67d400715d4002e4ff0000500f089811ffa89f100294ff6ff7300f00a8101295cd10020cfe000bf607d400750d4002577e14ff48030fff74ffc002e824600f06f81a07d002800f06b81baf1000f00f067816668002e00f0fb8020890428c0f05f8121680a1812f8043c002b40f0588112f8033c002b40f0538112f8023cff2b40f04e8112f8012cff2a40f049814ff4803531607060c6f80ca03561002800f0648107464bf69b70c0f25d0000f5857230460021904740b9316931b170688d420d46ebd187420d46e8d15546002728e14ff48030fff700fc054622e14ff6fe7000ea0900ac4642426ff001000aeb0007be78ff7883ea06231eb25d002db208ead63686ea430308ead5355e0085ea430336b25d002db208ead63686ea430308ead5355e0085ea430336b25d002db208ead63686ea430308ead5355e0085ea430336b25d002db208ead63686ea430308ead53686ea430383ea07231fb25e0036b208ead73787ea430308ead6365f0086ea43033fb25e0036b208ead73787ea430308ead6365f0086ea43033fb25e0036b208ead73787ea430308ead6365f0086ea43033fb25e0036b208ead737023087ea430308ead6371618023687ea430395d10230002765465feac97232d01af8000083ea002002b243001bb208ead23282ea400008ead333420083ea400012b243001bb208ead23282ea400008ead333420083ea400012b243001bb208ead23282ea400008ead333420083ea400012b243001bb208ead23282ea400008ead33282ea4003e0899ab2824273d15046ddf808a05346faf7a1fe00286bd10026012378e03820fff741fb002862d00646077047708770c770077147718771c771077247728772c772077347738773c773077447748774c774077547758775c775077647768776c776077747778777c77780f8287080f8297080f82a7080f82b7080f82c7080f82d7080f82e7080f82f7080f8307080f8317080f8327080f8337080f8347080f8357080f8367080f837704ff2dd50cff6ff70784430624ff22960cff6ff70784470624bf69b70c0f25d0045f6e46200f13c0730460f21c0f27c0238230025b84738b33046fff703fb2f46554600e05546606840b14bf69b71c0f25d0188476068fff7f5fa6760ddf808a000260323a77503991ffa89f720465246009709f015fd002d294605463ff460ad0846fff7dffa5be50027666077e6c5f580390027b5f5803f55463760f7607ff649aed0e700252046394652460323009509f0f6fc606840b14bf69b71c0f25d0188476068fff7befa65602068a575002818bffff7b7fa0020307000202060a06020820a2551e00798007a40064dd5207c00b301980078e0b103990025204652460323009509f0ccfc606840b14bf69b71c0f25d0188476068fff794fa65602068a575002818bffff78dfa00202060a06020820b252068002818bffff783fa00202060a060208220e001980078e0b103990025204652460323009509f0a1fc606840b14bf69b71c0f25d0188476068fff769fa65602068a575002818bffff762fa00202060a06020820625284609b0bde8f08f00bf2de9f041f0284bd100294ff00b0000f07f80022a7cd345f64d50c0f246000e4617468047811eb1fa81f14c09012808bf0224002c4ff00a006ad07578e91ec9b2fe2938bfbde8f081307833463946032860d002282dd001281cbf0a20bde8f081ac4204bf0020bde8f0814808842884bf0b20bde8f081881e03f1020887b240463946fff7bffa002869d006462846fff715fb21462a46fff7e9fa3046bde8f08145f64d57c0f2460707f5e27cbde8f0416047ac421cbf0020bde8f081a1f1210010f1160f48d36ff0480048432330c0b2242841d81a4612f8020f40f00207032f4bd19b796340032b47d10b2904d0032804bf0b20bde8f081881e4ef60b6783b2c0f247070120f021b847002818bf0620bde8f081ac422dd1a1f10c0010f1030f1ad31a4612f8020f042815d158796040032811d1d879a0f1310717f1300f0bd39b79984208d9a1f10807c01a874284bf0b20bde8f081cfe70b20bde8f081b07a204207d04046394622462b46bde8f041fff79abb0020bde8f0810a20bde8f08140f20d00c0f2000042f6653c7844c0f2440c012100220023604700bf80b582b04ff4f0704af61f4e01904ff4207cc0f2470e0020002100220023cdf800c0f04702b080bd4ff29c51c2f229010968bff35f8f0a466ff39602b2f1005f19d10a684ef66c63ccf2ff039a4212d14a68b2f57d7f0ed1d1f86c1159b147f64c62c2f207021268891a012903db0178042938bf7047002101707047b0b541f23154c0f252041d46a0474ff29c51c2f229010968bff35f8f0a466ff39602b2f1005f0cd10a684ef66c63ccf2ff039a4205d14a68b2f57d7f18bf002100e00021421c18bf002900d1b0bd95f84d20002afad091f84721002a08bfb0bd46f25863c2f206031a68132aeed8c2ebc20403eb04135b6801ebc2014ff40042c1f8e431a1f8ea212a7a01f5f271002a0fbf802248f20112ca808122ab7c33b1ab7d23b1022342f002028b71ca7195f820303bb195f8243023b1032342f004028b71ca7195f846304bb195f8443042f008020b7195f84530ca714b71b0bd48f27342c2f207021378002b14bf9378ff230b711378002b14bf5278ff224a71b0bdf0b589b048f66502c0f24b020c46054690474ff29c51c2f229010e68bff35f8f31466ff39601b1f1005f0cd131684ef66c62ccf2ff02914205d17168b1f57d7f08bf092d01d009b0f0bde1082c29fad896f847110029f6d045f64d51c0f2460107468847014638460129ecd1ff22079244f6435246f258610020cff60172c2f20601089006920b685a1e132a4fd8c3ebc30501eb05111a1fa1f5de7191f85451ad0618d4d51c42d091f8e450ad0616d4951c3cd091f87450ad0613d4551c36d00d79ad0610d4043aa1f5e071151da3f10403e3d12be05a1e01f5a87104e09a1ee03101e0da1e703106ebc203096893f9eb21b2f1ff3f1adc03f5f2731e688e4215d11e798df81b605e798df81c609b798df81e200a0a8df820108df821200a0c090e8df81d308df822208df823100f228df8012010228df80220522208218df80420b4f5804f4ff080028df800108df8061038bf4ff48042b4f5001f6ff07f0604f07f0138bf0026802c28bf80318df807109df809509df80a108df8030004d29df808200223002415e0c4f3c610b4f5804f024403d20323012400200be0b4f5001f03d204230224012003e0052303240120002135468df8053004f108038df808208df809508df80a1070b96846a222c118c254062048700c208870c81c06a90c22faf7f7f904f117034ff225066a46c0f2470601200821b047384609b0f0bd70b582b00546ff208df8040044f25220c0f20100009040f2c960c0f2480016460c46804798b148f27e30c2f2070000880122c1b264298df8032008d80721b0f5807f38bf03218df803108df80400301b28bf08280cd3d221281929550621417005218170033069460522faf7b3f90834204602b070bd00bf024600284ff0ff3009d0022918bf70471078112801d1507810b14ff0ff30704710b586b045f64d50c0f24600804701284ff000003ed1cde9020040f20830c0f210000190ff208df8140044f25220c0f20100049040f2c960c0f24800804798b148f27e30c2f2070000880122c1b264298df8132008d80721b0f5807f38bf03218df813108df8140040f2d260adf80800052001ac8df80a00e01d04a90522faf75df94ff2250cc0f2470c0120092122460c23e04706b010bd024600284ff0ff3021d0012918bf704710781f2819d110b545f64d54c0f24604a04701281cbf002010bd4bf20e31c0f2000104f5e2747944e02029220023a047002818bf4ff0ff3010bd4ff0ff3070474ff29c50c2f22900016808466ff39600b0f1005f1ad108684ef66c62ccf2ff02904213d14868b0f57d7f0fd1d1f83c0160b147f64c62c2f207021268801a0028cebf01200020c1f83c017047002070474ff29c50c2f22900026810466ff39600b0f1005f32d110684ef66c61ccf2ff0188422bd15068b0f57d7f27d1d2f86c0120b347f64c61c2f207010968401a0028c4bf01207047d2f8701100200029c2f86c0182f86a01c2f87001c2f82003a2f88c0308bf704780b548f2a352c0f24502084690470020bde88040704700207047f0b101684ef66c62ccf2ff02914218bf704790f8461199b110b54af273644ff0000cc0f24604864680f846c10120002100220023aef844c1a446bde810406047704700bf02464ff6ab70cff6ff7042f6653c7844c0f2440c00210023604700bf70b5002866d0044600796179a279e37940ea012040ea024050ea036007d00e2803d0032856d1032502e0042500e00225fff74eff00284dd04ff29c50c2f22900066830466ff39600b0f1005f42d130684ef66c61ccf2ff0188423bd17068b0f57d7f18bf70bd45f64d50a478c0f24600804701282ed1082086f88402032086f88502102086f88602b22086f88802062086f8890286f88a02462086f88b0243204ff0000e86f88c0201204ef6057c06f5217286f887e286f88d0286f88e5286f88f42c0f2470c09210d2386f890e2bde87040604770bd00bf2de9f04f81b04ef66c6a4ff29c560446ccf2ff0ac2f229064ff6ff77002547f67f784ff07f0906e048f2a351c0f24501bff32f8f8847d6f800b0bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168514504d14168b1f57d7f00f096804ff47d7000f048fe002800f0bb804ff60c41cff6ff7100bf42182e3182f8f45382f8f55382f8f65382f8f75382f8f85382f8f95382f8fa5382f8fb5382f8fc5382f8fd5382f8fe5382f8ff5382f8005482f8015482f8025482f8035482f8045482f8055482f8065482f8075482f8085482f8095482f80a5482f80b5482f80c5482f80d5482f80e5482f80f5482f8105482f8115482f8125482f8135482f8145482f8155482f8165482f8175482f8185482f8195482f81a5482f81b5482f81c5482f81d5482f81e5482f81f5482f8205482f82154a0d14ff47d7141600121c0f800a08173a0f8c48180f8c391078447848784c784078547858785c785078647868786c786078747878787c78756e8001f59457ff459afbff35f8f00bf46e8000121b156e8001f5945f8d04de7002780f85b712a270821032380f85c71042780f8581180f85931102380f85d7180f85e1101214ff2250c074600f5ac7280f85a3180f85f1180f86031002c18bf0124c0f2470c012010210a2387f8614101b0bde8f04f604701b0bde8f08f00bf80b582b04ff0010ccdf800c000f002f802b080bd2de9f04381b04ff29c57c2f229073f68ddf820803c466ff39604b4f1005f10d13e684ef66c65ccf2ff05ae424ff0000904d17e68b6f57d7f08bfb946012804d013e04ff0000901280fd11c4615460e460746fff7d1fd2346044631462a463846002c18bfb9f1000f07d14af2736cc0f2460c01b0bde8f043604799f8460180b1b8f1010f7cd1d9f84001002189f84611a9f84411a0b342f68d41c0f2440188472ee0b9f844010121013080b2012898bf0846a9f84401d9f8400142f68d44c0f2440489f8461128b94846fff71ffec9f8400140b1a047d9f84001a4f140024ff4c8719047a8b199f84601002848d0d9f84001002189f84611a9f8441100b1a0474af2736cc0f2460c0120002100220023afe745f64d50c0f24600804701282fd1082089f84801032089f84901102089f84a01002089f84b01b22089f84c01062089f84d0189f84e01462089f84f01432089f85001012089f85101b9f844014ef6057c070a09f5a47289f8528189f85301c0f2470c012009210d2389f8547178e701b0bde8f08300bf80b582b04ff0050ccdf800c0fff734ff02b080bd2de9f04f83b04468002c00f0ba828368002b00f0b68204eb030b4ff000090027002614e047f64c63c2f207031b6845f69077c0f201073b44c6f83c310ceb0a0300275b451c464ff0000680f09a82a04618f9013b03f07f05bd40002b46ea050610d406f00703012b16dc0bb3012b40f08882abeb0803082bc0f0838204f10903dee700bfd84580f07c82182f07f107074446dcd975e200bf022b3ad0052b40f07082abeb0803042bc0f06b82631dc7e7d84580f0668294f90130002b04f10203bed55b4580f05d8294f90230b3f1ff3f04f10303b4dc5b4580f0538294f90330b3f1ff3f04f10403aadc5b4580f0498294f90430b3f1ff3f04f10503a0dc5b4580f03f8294f90530002b00f13a82a31d96e7d84580f0358294f9013004f1020c002b03f07f0a1fd5dc4580f02a8294f90270e31c07f07f05b7f1ff3f4aeac51a02dde0469c460fe05b4580f01a8294f9037004f1040c07f07f05b7f1ff3f4aea853a40f3ff809846abeb0c039a4500f20882f308672b1dd0652b7ff45fafbaf1060ffff45baf9cf80030462b7ff456af98f80230432b7ff451af98f80330012b7ff44caf4ff29c54c2f229040290cde9002118e0044660460e4651461746654600f036fcac4631463a46204636e748f2a3513046c0f24501bff32f8f8847dde900210298ac462768bff35f8f2668bff35f8f33466ff39603b3f1005f0bd133684ef66c65ccf2ff05ab4204d17368b3f57d7f00f0c2804ff47d70654600f09efbdde9002106460298ac46002e3ff406af4ff60c43cff6ff73f4182e3384f8f49384f8f59384f8f69384f8f79384f8f89384f8f99384f8fa9384f8fb9384f8fc9384f8fd9384f8fe9384f8ff9384f8009484f8019484f8029484f8039484f8049484f8059484f8069484f8079484f8089484f8099484f80a9484f80b9484f80c9484f80d9484f80e9484f80f9484f8109484f8119484f8129484f8139484f8149484f8159484f8169484f8179484f8189484f8199484f81a9484f81b9484f81c9484f81d9484f81e9484f81f9484f8209484f82194a0d14ef66c63ccf2ff0333604ff47d7373600123b37347f67f73a6f8c4317f2386f8c3314ff6ff734ff29c5433847384b384f38433857385b385f38533867386b386f38633877387b387f387c2f2290454e8003fbb427ff440afbff35f8f00bf44e80063fbb154e8003fbb42f8d034e7dc4580f00c8194f90470631d07f07f05b7f1ff3f4aea455a3ff7e1ae5b4580f0fe8094f90570002f00f1f98004f1060c4aea077ae5e698f8043098f8057098f80650032b47ea052837dd052b58dc042b78d0052b7ff440aed6f86c313bb147f64c67c2f207073f68db1b002b18dcd6f8703186f86a91c6f87091c6f82093a6f88c936bb10c4648f2a35180461846c0f24501174665468847ac4621463a46404647f64c63c2f207031b6845f69077c0f201073b44c6f86c310ee6012b3ff400ae022b00f08780032b7ff406ae17460c466546fff711fb03460298ac4621463a46002b3ff4f9ad96f84631002b3ff4f4ad304641f28831a6f8448109f0b1f947e0062b4ad0072b7ff4e7ad80464df6db50c0f24a0016460f466446804703465d1ea446394632464046012d3ff6d5ad981eb0fa80f04009fff7e3fba446394632464046c9e517460c466546fff7d5fa03460298ac4621463a46002b3ff4bdad96f84631002b3ff4b8adb6f8443143457ff4b3add6f8403186f84691002ba6f844913ff4aaad42f68d411846c0f2440188470298ac4621463a469ee5d6f87031c6f86c91002b86f86a91c6f87091c6f82093a6f88c933ff490ad0f4648f2a35104461846c0f24501164665468847ac463946324648e696f84631c6f83c91002b3ff47bad0446d6f8400165468846174686f84691a6f8449120b142f68d41c0f2440188474af273660120002100220023c0f24606b04720463a464146ac465ce54ff2a513c0f2490303b0bde8f04f184700bf7fb50646002806d1fff75efa002807d19de80f00064649f29b1cc0f24f0c60477fbd00bff0b583b01d46144609294ed106460f46f22d10d8a22160196155062141700b2181704af29571c0f20001033079440b22f9f762fb0e35204629464ff4807200f03df80546ff208df8080044f25220c0f20100019040f2c960c0f24800804798b148f27e30c2f2070000880122c1b264298df8072008d80721b0f5807f38bf03218df807108df80800f82d0cd8d221601961550621417005218170033001a90522f9f72afb0835394630464ef60577c0f2470722462b46b84703b0f0bd70b58ab00c464ff29c51c2f229010b68bff35f8f19466ff39601b1f1005f16d119684ef66c66ccf2ff06b1420fd15968b1f57d7f0bd1694605461846164600f039fc324628462825a24231d244e04d218df8001043218df8011001218df80210002115258df803108df804108df805108df806108df807108df808108df809108df80a108df80b108df80c108df80d108df80e108df80f108df810108df811108df812108df813108df81410a24213d3111b022910d30fd003398d420cd8c22201190255062048708d70c81c69462a46f9f7b4fa6019c41c20460ab070bd00bf46f65450c2f20700016840f2230cc0f2000cfc44c26861454ff001034ff0040008bf0223624508bf0820002a08bf1046002918bf184370472de9f04f81b04ff29c53c2f229031c68bff35f8f23466ff39603b3f1005f40f0cc8023684ef66c67ccf2ff07bb4240f0c4806368b3f57d7f40f0bf80d4f8bc310133c4f8bc314ff6ff739a4238bf134694f87471a4f8c03184f8c2011fb1002a18bf002907d1b4f8c6010130a4f8c60101b0bde8f08f94f87b010028f3d0d4f8840170b147f64c69c2f20709d9f80030c01a002805dd94f87501012809d101270ce0b4f8c8010130a4f8c80101b0bde8f08f94f87771012f18bf022794f87a510020eb0793468846adf80200adf8000012d0022f10d194f8790168b90df1020641f281556b46c0f25b05404611463246a84794f87a515a461646b2f5c86f28bf4ff4c86606f1150a504600f061f8002856d0bbf5c86f88bf45f08005d9f80010d4f8802153230271120a42710a0a8171c2710a0c090e03704d234172a02143700123c17200218370c57002728772017394f87911bdf802204173bdf800108373c173090a0174110a8174310a017500f115014274c6740746084641463246f9f7d1f94ff27d12c0f2470238465146904710f1800fd8bf6ff07f007e28a8bf7e20d4f8801184f8c501481c48f2a351c4f88001c0f245013846884701b0bde8f08fb4f8ca010130a4f8ca0101b0bde8f08fb0b54ff2a054c2f22904216846f23f52c5f28802b2eb510f48f25f514cf67e25c0f24501caf2101518bf25608847002804bf691c2160b0bd10b301684ef66c62ccf2ff0291421bd190f87b11c1b1d0f88411b1b147f64c62c2f207021368cb1a012b0edb1268d0f88801002808bf7047891a42f64d42c0f2440208bf01211047704710b590f875210021c0f8841180f87b11511eb1fa81f149f259624909c0f25902044640f20b10904710f1800fd8bf6ff07f007e28a8bf7e2084f8c4014ef6e374c0f25a04a04704f1bc00bde81040004700bf2de9f04f81b00429c0f0e980834600784d2840f0e4809bf80100432840f0df809bf80200012840f0da804ef66c684ff29c570d46ccf2ff08c2f229074ff6ff7600244ff07f0906e048f2a351c0f24501bff32f8f8847d7f800a0bff35f8f3868bff35f8f01466ff39601b1f1005f07d10168414504d14168b1f57d7f00f098804ff47d70fff752ff002800f0a8804ff60c41cff6ff7100bf42182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d7141600121817347f67f71c0f80080a0f8c41180f8c391068446848684c684068546858685c685068646868686c686068746878687c68757e8001f51457ff457afbff35f8f00bf47e8000121b157e8001f5145f8d04be79bf80310022905dc01290ed0022900f09e800ce003290dd0042908d190f8741129b101b0bde8f04fdce00d2d06d201b0bde8f08f044600f031f987e090f87b1119b390f87521002180f87b11511eb1fa81f149f259624909c0f25902044640f20b1090474ef6e37510f1800fd8bf6ff07f00c0f25a057e28a8bf7e2084f8c401a84705f1bc00804720469bf804100446012988bf002180f875119bf8051001f00302012a4ff0010198bf0a4680f877219bf80630012b88bf002380f878319bf80730022b88bf002380f879319bf808309bf8097043ea0723502b98bf5023b3f5f07f28bf4ff4f073a0f87c319bf80a309bf80b7043ea072341f28837bb4238bf1f46a0f87e719bf80c3080f8741103f0030380f87a3102f00103002103eb5202c0f88011c0f8bc11a0f8c01180f8c211c0f8c811a0f8c6117f2180f8762180f8c51100f009f8204600f04cf8204601b0bde8f04f78e000bfb0b5044690f87a01800758bfb0bd94f875014ef633750128c0f25a0507d105f1b000804705f58b71002088470ee005f5b670804794f87501012801d1002004e094f87701013818bf0120a84794f875014ff6ed120138b0fa80f0cff6ff7249f2015341097a44c0f2590340f20b10984710f1800fd8bf6ff07f007e28a8bf7e2084f8c301012084f87b01b0bd70b5044647f64c60c2f20700006894f87b1145f69075c0f2010500292844c4f8840108bf70bdd4f8880142f66536c0f2440658b94ff69130cff6ff707844002122460023b047c4f8880150b106f594718847d4f8880106f1e8022946bde87040104770bdb0b5044600f5c675082084f88c01032084f88d01102084f88e01002084f88f01c22084f89001062084f8910104f29311204600f065f84ff0280e4ef6057cc0f2470c012009212a462f2384f892e1bde8b040604770b54ff29c50c2f229000468bff35f8f20466ff39600b0f1005f46d120684ef66c61ccf2ff0188423fd16068b0f57d7f18bf70bd94f87b010025c4f8845100b394f8750149f259620138b0fa80f04109c0f2590240f20b1084f87b5190474ef6e37610f1800fd8bf6ff07f00c0f25a067e28a8bf7e2084f8c401b04706f1bc008047d4f8880184f8745170b142f68d45c0f24405a847d4f8880105f166018847002804bf0020c4f8880170bd70b505464d200870432048700120887095f874010c46c87095f87501087195f87701487195f87801887195f87901c87195f87c01087295f87d01487295f87e01887295f87f01c87295f87a01087395f87b01487345f64d50c0f246008047a073d5f880010026e073d5f88001000a2074b5f88201607495f883012675a074a020e074d5f8bc016075d5f8bc01000aa075b5f8be01e07595f8bf01207695f8c001607695f8c101a07695f8c201e07695f8c601207795f8c701607795f8c801a07795f8c901e07795f8ca0184f8200095f8cb0184f8210095f8c30184f8220095f8c40184f8230095f8c50184f82400fff79dfb84f82500d5f88401a0b147f64c61c2f207010a68821a012a0bdb0968401a44f6d35100f2e730c1f26201a0fb01018e0900e00026300a84f8266084f8270070bd00bf2de9f04182b04ff29c51c2f229010c68bff35f8f21466ff39601b1f1005f79d121684ef66c62ccf2ff02914272d16168b1f57d7f6ed194f8cc1179b394f8ce01c0070ad0d4f86c0178b347f64c61c2f207010968401a002827dd47f24c45c2f2070555f8040c002854d042f29707c0f24c074af6e908002607f5437101a8c0f24b0801968847a8b1032084f8cf612860b4f8d001c04702b0bde8f081d4f8d811c1b302b0bde8f0410847204602b0bde8f04133e0019841f60d56c0f24c06a861b04706f5af708047e861b847012084f8cf0103202860b4f8d001c047d4f8e001a0b10199d4f8dc21b4f8d271531a38bf8b1abb420ad2b4f8d41159b147f64c62c2f207021268101a884203d32046022100f078f802b0bde8f08100bfb0b590f8cc41002c4cd044f28442c2f200021188082911462cd0114631f8083f082b27d0114631f8103f082b22d0114631f8183f082b1dd0114631f8203f082b18d0114631f8283f082b13d0114631f8303f082b0ed0114631f8383f082b09d0114631f8403f082b04d032f8481f0829114614d14a68b2f5870f10d36ff35602012a0cd14a684ff65363cff6ff737b449a4204d1d0f8d821002a18bf4a60002180f8cc1190f8cd11b1b1002180f8cd1145f60a61c2f20701097869b947f24841c2f20701096839b14af68171c0f24b010546042088472846002c08bfb0bd0321bde8b04000e000bfb0b588b0044645f64d50c0f246000d468047012840f08f8008208df8010003208df8020010208df8030000208df80400ca208df8050006208df8060018208df8070047f26440c2f2070050f81c2c94f8cc11002a18bf0122002945f60961c2f207014b7818bf0232002b94f8cf3118bf0432002b4ff0410318bf08328df808304c238df8093001238df80a308df80b508df80c2050f8182c4ef605758df80d200268c0f24705130a8df80e208df80f30130c120e8df810308df811204268130a8df812208df81330130c120e8df814308df8152002698df81620120a8df8172009788df8181081688df819106821c2f2000109688df81a10090a8df81b1047f64c61c2f207010a68130a8df81c208df81d30130c120e8df81e308df81f2000680df10102c4f8dc0108680921c4f8e00101201f23a84708b0b0bd00bf2de9f04f83b0022902d24ff0ff35ece0cde901100120cff680704ef66c644ff29c56ccf2ff04c2f229064ff6ff77851c4ff0000947f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d6f800a0bff35f8f3068bff35f8f00ea0501b1f1005f07d10168a14204d14168b1f57d7f00f093804ff47d70fff7a1fa0028c3d04ff60c41cff6ff7100bf42182e3182f8f49382f8f59382f8f69382f8f79382f8f89382f8f99382f8fa9382f8fb9382f8fc9382f8fd9382f8fe9382f8ff9382f8009482f8019482f8029482f8039482f8049482f8059482f8069482f8079482f8089482f8099482f80a9482f80b9482f80c9482f80d9482f80e9482f80f9482f8109482f8119482f8129482f8139482f8149482f8159482f8169482f8179482f8189482f8199482f81a9482f81b9482f81c9482f81d9482f81e9482f81f9482f8209482f82194a0d14ff47d714160012104608173a0f8c4b180f8c381078447848784c784078547858785c785078647868786c786078747878787c78756e8001f51457ff45cafbff35f8f46e8000121b156e8001f5145f8d051e7044645f64d50c0f24600804701281dd1029d6978022916d00129204607d000297ff425af00210025fff77efe0fe0019f41f28831022f0ed14ff4fa730022012741f2883624e02046fff7fafd0025284603b0bde8f08faa78052f11d3eb782e79072f43ea062310d395f805c0ae79092f4cea0627e4d3ee792d7a46ea052607e041f288364ff4fa7301e041f288360127642b98bf64238b4228bf0b4690f8cc1180f8ce21a0f8d031a0f8d271a0f8d46171b147f24841c2f20701096800295ed001210446fff730fe0025c4f8e051bee744f28442c2f200021188082911462cd0114631f8083f082b27d0114631f8103f082b22d0114631f8183f082b1dd0114631f8203f082b18d0114631f8283f082b13d0114631f8303f082b0ed0114631f8383f082b09d0114631f8403f082b04d032f8481f0829114632d14a686ff00105b2f5870ffff483af0123cff680731a40012a7ff47caf4b684ff6c112cff6ff727a44934214bfc0f8d831d0f8d831002b3ff46daf4a60012180f8cc1199e74af60771c0f24b010420884720b105462046fff756fd5be70121204684f8cd118fe76ff0010553e700bf70b582b00c464df6cb61c0f245018847002c18bf002801d102b070bd0168e029fad10546fef7d2f9014628460029f3d0a278e3782679217842ea0322637942ea0642042942ea036604d16178002908bf0d2e1fd026f001010629ddd147f29120c0f246008047014628460029d4d04ff65914062e4ff00f034ff00006c0f24e044ff000004ff000014ff0000208bf0c2301960ae004204ff6591401900026c0f24e040020002100220e230096a047284602b070bd3146fff7a3bf00bfb0b582b00c460546fef782f90146002d4ff0000018bf002901d102b0b0bd47f2fc70c2f2070000684df6cb61c0f24501884790b10068e0284ff00000edd129784ff6591c0191c0f24e0c0021002223460090e047012002b0b0bd002002b0b0bd08b530460921fff7cbff002805d002b045f28310c0f24400004744f62703c0f24603984708bd00bf08b530460a21fff7b7ff002805d002b045f28310c0f24400004744f62703c0f24603984708bd00bf08b530460b21fff7a3ff002805d002b045f28310c0f24400004744f62703c0f24603984708bd00bf01280bd1002908bf704710b5896804460846fef781f92046bde81040704700bf10b5059c4ff20340c0f2460080472146fff7e6ff10bd00bfb0b5c4b0044600284ff0000000f0c78089b20b2940f0c380207838b96078092804d1a078612801d1e07810b1002044b0b0bdfef7e5f80028f8d045f64d50c0f24600804701281cd00228efd103208df8070001200df107058df80800a81c21460b22f8f7cff94af66104c0f24604f02029460d220023a047b0fa80f0400944b0b0bd4ff29c50c2f22900006801466ff39601b1f1005fc9d101684ef66c62ccf2ff029142c2d14168b1f57d7fbed122797f21042a06dc012a0cdcbab1012a08bf00211ae0082a0bdc052a11d0082a08bf0a2112e0022a0dd0042a08bf01210ce0092a09d00a2a08bf0e2106e0092104e0022102e0032100e00b2180f80b1310216a2580f80c13a22180f80653152580f80e13062180f807531a2580f80f130c2180f80853132580f8101352210822022380f8095380f811134921012580f8042380f8053380f80a2380f80d3380f8121380f8135380f81453217900f5417280f815136179192380f81613a17980f81713002180f81813e17980f81913217a80f81a13617a80f81b13a17a4ff2250480f81c13c0f247040120e021a047284644b0b0bd00bf1fb5fff72bff002803d0bde81f4000207047bde81f4038b584b049f21f13c0f24703184710b5f0281bd1d1b1cab10c78032c16d10d2a1cbf0b2010bd487801281cbf0a2010bd45f64d50c0f246000c468047012803d1a01c0b21fff7fffe002010bdbde81040fdf785bc00bf002804bfa3207047017e427e837ec07e41ea0221184300064ff0a40008bfa320a4220a2928bf1046704700bf4ff29c52c2f229021268bff35f8f13466ff39603b3f1005f10d1d2f800c04ef66c63ccf2ff039c4508d15368b3f57d7f02bf0023c2f8fc32c2f8003347f2c942c0f24d02104700bf4ff29c50c2f229000068bff35f8f01466ff39601b1f1005f0fd101684ef66c62ccf2ff02914208d14168b1f57d7f02bf0021c0f8fc12c0f8001347f2d940c0f24d0000472de9f04184b0dde90a76022f16d340f64705a94212d08eb13578412d0ed175784e2d0bd1014602f0bf0012284ff00d0008bf002b0ed004b0bde8f0810c9d0097cde9016546f63916c0f24d06b04704b0bde8f081082feed3b078012802d1f078022803d90d2004b0bde8f081002953d045f6f444c2f2060414f8040c81424bd12068002848d048f22732c0f254020d4608460221904700283ed024682088d8b36088c8b3a088b8b3e088a8b330797179b279f37940ea012040ea024050ea0368d0d04ff29c50c2f229000068bff35f8f01466ff39601b1f1005f1bd101684ef66c62ccf2ff02914214d14168b1f57d7f10d1f178a1b190f8fc22aa420cd1d0f80023424508d101295bd1082faad100f09bf875e0f07818b1082004b0bde8f081082f9fd1f9f742fec8b10646d0f86c010028f1d047f64c61c2f207010968401a0128e9db96f8fc0268b196f8fd02032809d00628e0d1304600f076f8dce7112004b0bde8f08146f63917c0f24d0707f53a60804707f539622846214690470120002786f8fd020df10f02304600210123a6f8fe7286f8fc52c6f800838df80f70adf80c7000f07ef861884af2bd6603abc0f24c0628460222b047384604b0bde8f081a7f1510189b24ff6b87291424ff00d0119d390f8fd02032808467ff42baf334613f8080fa7f108018ab280b9052a0ed9a1884af2bd67c0f24c072846b847002004b0bde8f081084604b0bde8f08101280dd1042a0bd3981810f8021c00297ff420af10f8010c00287ff41bafe0e702284ff00d0008bf062a7ff4fcae707b01283ff60fafd4e790f8fd120a1f022a38bf7047022905d0012907d1042180f8fd127047052180f8fd12704780b582b0052180f8fd120121adf8061045f6f441c2f2060190f8fc0209684af2bd6c49880df10603c0f24c0c0222e04702b0bde8804070472de9f04fc7b0054690f8fc0203920591d8b145f6f041c2f206010978884214d148f22732c0f2540202211c46904760b195f8fc0240f66502c0f255020021904718b100690088172802d247b0bde8f08f033880b2f42828bff42007af0b3807f101084ff000094ff0000a01900495029414e000bf0699cde94509adf810112121adf8121143f23d5144a8c0f255018847049d029c1ffa8af0a042d6d2a4eb0a01019a1ffa81fbb5f8fe1241235a45b8bf93468df81c304e234a1c8df81d300123a5f8fe22d5f800238df81e30059b1ffa8af08df81f30130a8df82410090a8df820208df82130130c120e8df82510b0fa80f18df823204a091ffa8bf111fa8afaa2458df8223008bf0232bbf1000f8df826202fd001390329039901eb000c01d2002115e04ff6fc700bea00020cf10103002100bf5e1816f8014c7d187078ec725c5cb67804318a422c736873ae73f1d1049d1bf003020dd01cf80160cb19012ade7207d00ceb01004178022a19731cbf8078587395f8fc020bf10b0406900b2010fa84f649f6cd713046c0f24c01884700283ff47eaf26f003031ffa84fc06f003025e426ff00303c1180433f518043581f8049081f8059081f8069081f80790f2d152b10344012a83f8049005d0022a83f8059018bf83f806900bf10e0202701b22442108230272220480f801908170c370417283723ff43dafbcf1040f01d2002214e047f6fc710cea0103002200bfb95c8618f17218f8021008eb020531736978ad78043293427173b573f0d11cf003033ff41fafbe5c00f10b01012b8e543ff418af561cbd5d022b8d553ff412af0232bb5c8b540de7f0b583b04ff29c51c2f229010c68bff35f8f21466ff39601b1f1005f4bd121684ef66c62ccf2ff02914244d16168b1f57d7f40d194f8fc12e9b3002840d002888a423dd145f6f446c2f2060616f8041c8a4235d1316899b3356894f8fd12032919d8d4f86c1139b147f64c62c2f207021268891a00290edc02218df80b100df10b020746204600210123fff78dfe2046fff75cfe38468278092a1bd141896b8894f8fd72994217d1032f3adc012f6ad0022f3dd004e018b181780939022901d203b0f0bd47f6ed31c0f24d0103b0bde8f040084794f8fd72032ff1d8a2f10d0102290cd2c178d1b302208df8040001aa204600210123fff757fe03b0f0bd092a08bf032fdcd14189aa889142d8d1c078002800f0818002200df105028df80500e6e7052f04d0042fcad1c07805262fe0c078002848d0062084f8fd0202208df807000df10702204600210123fff72cfe052fb5d02046fff7f9fd03b0f0bd4268002aadd00389a3f2012189b2b1f57e4fa6d34089082b48d12988884245d12046012108234ce0c0780526002808bf022650b102208df80a000df10a02204600210123fff701fe6988012294f8fc024af2bd67adf8082002abc0f24c07022284f8fd62b84703b0f0bd052f15d1002094f8fc523668c4f8fc02c4f8000347f2c944c0f24d0404f11000804728463146224603b0bde8f0401047032084f8fd0201208df806000df1060272e7e98888427ff457af2046022103e0204603210022002303b0bde8f040bfe506290ad14178012907d18178653911f1630f02d3c178012902d94ff0ff307047f0b581b00179427941ea022540f6b8318d421fd80646fdf7edfbd8b1f9f724fbc0b10446d0f8d80342f66537c0f2440758b941f26f60c0f200007844012100220023b847c4f8d80320b107f1e8022821904718b14ff0ff3001b0f0bdb078f178d4f8e4230023c7f6e07340ea452003ea425240ea0120bff35f8f1043bff35f8fc4f8d403002001b0f0bd00bf02293cbf4ff0ff3070472de9f04f9bb00278437842ea0325b5f5007f04d94ff0ff301bb0bde8f08f4ef66c6a4ff29c56ccf2ff0ac2f229064ff6ff774ff0000b4ff07f090791099008e000bf48f2a3512046c0f24501bff32f8f8847d6f80080bff35f8f3468bff35f8f20466ff39600b0f1005f07d12068504504d16068b0f57d7f00f09a804ff47d70fef7c5fa002800f0928004464ff60c40cff6ff7000bf21182e3081f8f4b381f8f5b381f8f6b381f8f7b381f8f8b381f8f9b381f8fab381f8fbb381f8fcb381f8fdb381f8feb381f8ffb381f800b481f801b481f802b481f803b481f804b481f805b481f806b481f807b481f808b481f809b481f80ab481f80bb481f80cb481f80db481f80eb481f80fb481f810b481f811b481f812b481f813b481f814b481f815b481f816b481f817b481f818b481f819b481f81ab481f81bb481f81cb481f81db481f81eb481f81fb481f820b481f821b4a0d14ff47d7060600120a07347f67f70c4f800a0a4f8c40184f8c39127846784a784e78427856785a785e78527866786a786e78627876787a787e78756e8000f40457ff455afbff35f8f00bf46e8004028b156e8000f4045f8d049e70024ddf824805db1fdf7d2fa0146002c4ff0ff3018bf002902d11bb0bde8f08fb5fa85f040094ff000098df82c908df82d908df82e908df82f908df830908df831908df832908df833908df834908df835908df836908df837908df838908df839908df83a908df83b908df83c908df83d908df83e908df83f908df840908df841908df842908df843908df844908df845908df846908df847908df848908df849908df84a908df84b908df84c908df84d908df84e908df84f908df850908df851908df852908df853908df854908df855908df856908df857908df858908df859908df85a908df85b908df85c908df85d908df85e908df85f908df860908df861908df862908df863908df864908df865908df866908df867908df868908df869908df86a908df86b90bcb1d4f87021a2b14ff4006304e03f683b44b3f5403f0cd2d718be680136f6d07e68033626f0030609eb060101f11009ede7002d4ff0020a039500f00581ddf81cc0acf102020a2ac0f00081002608eb0a0b9bf801504ff0ff30012d3ff648af9bf802209bf803309bf8047042ea03229bf8053042ea074747ea0361a1f1011212f5803f0a91fff433af9bf808109bf809e0029141ea0e210af10a020497aceb02034f1e9f42bff423afcde905269bf806209bf807300a9e42ea032cb6eb0c07fff416afb9423ff613af18f80a70089147ea052a4feada000ba90e5c07f00705012707fa05f5354240f001830e5c45ea06050d5407994ff6ff75c0f20205b4b3d4f8700198b317461a0201924fea0e264ff4006200eb0208d8f8083053454bd0d8f800301a44aa4221d800eb0208d8f80830534540d0d8f800301a44aa4216d800eb0208d8f80830534535d0d8f800301a44aa420bd800eb0208d8f8083053452ad0d8f800301a44aa42d3d900bfbcf1000f40f0bc8204980a464ff6fc710330c0f2030108404844944600f1100908980599069e00eb010a0398013686424ff0000028bf0120ddf824804fd2aceb0a02092a3ff64caf49e0d8f804000a9a904240f09582d8f80c006045c0f0908236d9089aa0eb0c00824200f289827ab3029831180198c1f1000cc2199044a1f1010e002208eb02050beb0203287c9e7ab04240f0758296451cd06e7cdf7abe4240f06e820ceb0207be1c13d0ae7c187b864240f06582079ef81c07d0e87c5b7b984240f05d8204329142dbd1b446a7e78c46a5e7ddf81cc0a2e7ddf81cc0002800f04e82baeb0c004ff0000118bf0120b9f53e3f88bf0121014303980028c1f100003ff43eae00297ff43baed4f870b1bbf1000f40f08b804ff44030fef754f8002800f02d82834600206ff0200100220beb02030bf8020040320beb0107b2f5006f01f1400158709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d87618775877987787f8400087f8410087f8420083f8220083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f0093d14ff43e30cbf800080020cbf804084ff0ff31cbf80c084ff40060c4f870b1cbf80818c4f820034ff6ff760221c0f202064ff000090ae00aeb080109f10109ddf8248099454ff000003ff497ad08eb010518f801006f78cdf81c900a9195f802c0eb7895f804906a7995f806a0e97995f808e06d7a40ea072808955cb3012f29d84ff400670beb0705a868404500f0a28028680744b7421dd80beb0705a868404500f0988028680744b74213d80beb0705a868404500f08e8028680744b74209d80beb0705a868404500f0848028680744b742d7d94cea032040ea094040ea0267f81c20f00300d4f82093cdf818a000f1100a0020cde904e10297b9f1000f26d00beb09035bf809105a68514580f09b80eab10beb02005bf80210d0f80490514580f08c80b9f1000f11d00beb09035bf809105a68514580f0868042b10beb02005bf80210d0f804905145d6d376e000204ff400694ff4006504e000bf3d44b5f5403f23d20beb05018a685bf805700132f4d04868ca68033020f0030000f110060beb09001032f7f711f94168c2684bf809608368d4f870b18a424ff00001b14408bf00f110014bf82310d7e7c9f540310f294ff00002c4f8202310d90beb09004bf809104ff0ff3142608160c260c4f820930ae0e868039b0a9a089f60e010b10268114401604ff000090020b9f1000f7ad00beb09035bf809105a68514522d2002a71d00beb02005bf80210d0f80490514513d2b9f1000f66d00beb09035bf809105a6851450ed2002a5dd00beb02005bf80210d0f804905145d7d30546cc469146184601e01d469446a1eb0a0110290fd309eb0a020beb02034bf802104ff0ff31c3f804c0996000219446d960c5f800a0039b0a9addf818a0dde904e1089f00280cbfc4f820c3c0f804c002984ff6ff7668600020c0f20206c5f80880e8604aea0121ddf81c904eea072a814202f10a087ff4c0ae05f1100778180999524641449b46f7f726f8e9685b466868aa68d4f870b15144e96081424ff0000018bf07464bf82270a6e600204ff400684ff4006703e02f44b7f5403f23d20beb07018a685bf807500132f4d04868ca68033020f0030000f110060beb08001032f7f745f84168c2684bf808608368d4f870b18a424ff00001b04408bf00f110014bf82310d7e7c8f5403200210f2ac4f820130dd90beb08034ff0ff304bf8082059609860d960c4f820831bb0bde8f08f00281ebf0168114401604ff0ff301bb0bde8f08f00bf02293cbf4ff0ff3070472de9f04f8bb00278437842ea0325b5f5007f00f2f08005eb4502022303eb4202914240f0e8800590fcf7abfe002800f0e2804ef66c694ff29c56ccf2ff09c2f229064ff6ff77002447f67f784ff07f0b06e048f2a351c0f24501bff32f8f8847d6f800a0bff35f8f3068bff35f8f01466ff39601b1f1005f07d10168494504d14168b1f57d7f00f096804ff47d70fdf7d0fd002800f0af804ff60c41cff6ff7100bf42182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d7141600121c0f800908173a0f8c48180f8c3b1078447848784c784078547858785c785078647868786c786078747878787c78756e8001f51457ff459afbff35f8f00bf46e8000121b156e8001f5145f8d04de7d0f870c10495bcf1000f20d000234ff4006104e03f683944b1f5403f0bd20ceb0107be680136f5d07e68033626f0030633441033eee775b9b3f53e3f40f2e0804ff0ff310bb0bde8f04f08467047002d00f0d680002305994ff0000901f1020a153103914ff0ff31059109eb49060aeb46056c784ff0ff31012ce3d8af78ea7857ea022e1ebf2a796d7952ea0528d9d0bef5207fd6d8b8f5f07fd3d80ef10102520802fb08fb4ff6fb724ff6ff779345c0f20207c6d81af81610059e41ea0421039cb9f1000f28d014f8132c14f8125c42ea05228a42b3d0feb114f80d2c14f80c5c42ea05228a42aad0012e15d014f8072c14f8065c42ea05228a42a0d0022e0bd014f8012c257842ea05228a4297d0043e721c04f11804d6d15646bcf1000f2fd00bf105054ff400640ceb040adaf808208a4230d0daf800201444bc4220d80ceb040adaf808208a4225d0daf800201444bc4215d80ceb040adaf808208a421ad0daf800201444bc420ad80ceb040adaf808208a420fd0daf800201444bc42d3d94ff6fc720bf10801c0f201021140194401f1100320e0daf80410a9427ff44fafdaf80c10a9427ff44aaf9af8101004297ff445af9af811109af8122041ea022171457ff43caf9af813109af8142041ea022141457ff433af049909f1010989450599b24601f1010105917ff43dafb3f53e3f3ff624af00240025019019e000211fe7d0f870c14a688b684ff6ff7793454ff00002c0f20207c1f80cb008bf01f110024cf82320013575454ff000013ff408af05eb45000aeb40011af8100091f8018091f802e091f803b091f804904979bcf1000f40ea082605912cd0b8f1010f29d84ff400610ceb01039a68b24200f0a8801a681144b9421dd80ceb01039a68b24200f09e801a681144b94213d80ceb01039a68b24200f094801a681144b94209d80ceb01039a68b24200f08a801a681144b942d7d94eea0b21059b013149ea0322490801fb02f75a4607f1050b8df81d004fea1b208df820004fea1b408df8210005208df82500042001218df8270048468df81b1003908df82a000df11b0011218df81c408df81e808df81fb08df822408df824408df823408df82640cdf808e08df828e091468df829208df82b30fff797f800287ff482ae01980021d0f870c1bcf1000f3fd0ddf810e0b8f1010f3cd84ff400630ceb03018a68b24235d009680b444ff6ff71c0f202018b4226d80ceb03018a68b24228d009680b444ff6ff71c0f202018b4219d80ceb03018a68b2421bd009680b444ff6ff71c0f202018b420cd80ceb03018a68b2420ed009680b444ff6ff71c0f202018b42cbd9002104e0ddf810e02ee7ddf810e0002f3ff41aaf4fea0922029f059b42f001023a44039f1b0252083b4353435a1e032a01d200220ae023f0030700228e18043297427475b475f4753476f7d113f003033ff4f8ae01f11507012bbc543ff4f2ae3a44022b547018bf9470ebe62de9f04f81b04ef66c644ff29c55ccf2ff04c2f229054ff6ff7600274ff0010a47f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d5f80090bff35f8f2868bff35f8f01466ff39601b1f1005f07d10168a14204d14168b1f57d7f00f094804ff47d70fdf7f2fa002800f005814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ff47d710460416080f80ea0a0f8c4b180f8c381068446848684c684068546858685c685068646868686c686068746878687c68755e8001f49457ff45aafbff35f8f45e8000121b155e8001f4945f8d04fe7d0f88813002974d104464ff41630fdf759fa014600284ff0000069d0002200bf8b1888544032b2f5163f58709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d876187758779877d87783f8200083f8210083f8220083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f009ad1c4f8881300e00021084601b0bde8f08f00bf2de9f04f93b04ff6ff75a9424ff0000c2cd0dde91c874ff4805ecde90aecd0f89ce3cde90087229fdde920a9dde91e6b249c0697239f0aadcdf840c0cde911eccde90845cde9026bcde904a90546079704f0b8fe84464cb1bcf1000f06d19df8480095f8a013084385f8a003604613b0bde8f08f2de9f04f93b00446002047f64c65a4f8a003c2f207052868002a89461abfc4f894030146d4f89413401ac4f89c03fcf739fa002800f05a81d4f88803002800f0558104f0e7ff002800f050810646b4f88c03002853d0a0f10108d4f89c0300254ff4a0714ff4f0774ff4805acde911050df1280bcde901152046414632464ff42073cde90aa51095cdf824b0cde90755cde90555cde90355009704f059fe002840f02481d4f89c034146cde91105012008904ff4a0700190204632464ff420734ff4f077cde90aa51095cdf824b0cde90655cde90455cde90255009704f038fe002840f003819df8480094f8a01347f64c65084384f8a003c2f2070506e0d4f8881330464ff41632f6f7cefa4ef66c684ff29c57ccf2ff08c2f229074ff6ff764ff0000a07e000bf48f2a351c0f24501bff32f8f8847d7f800b0bff35f8f3868bff35f8f01466ff39601b1f1005f07d10168414504d14168b1f57d7f00f098804ff47d70fdf7f6f8002800f0c4804ff60c41cff6ff7100bf42182e3182f8f4a382f8f5a382f8f6a382f8f7a382f8f8a382f8f9a382f8faa382f8fba382f8fca382f8fda382f8fea382f8ffa382f800a482f801a482f802a482f803a482f804a482f805a482f806a482f807a482f808a482f809a482f80aa482f80ba482f80ca482f80da482f80ea482f80fa482f810a482f811a482f812a482f813a482f814a482f815a482f816a482f817a482f818a482f819a482f81aa482f81ba482f81ca482f81da482f81ea482f81fa482f820a482f821a4a0d14ff47d7141600121817347f67f71a0f8c4117f21c0f8008080f8c311068446848684c684068546858685c685068646868686c686068746878687c68757e8001f59457ff456afbff35f8f47e8000121b157e8001f5945f8d04be7064604f0bffe002e18bf002803d1012089f8050022e0c6f864014ff0010a4ff4f07086f868a101904ff420704af61f4c0090c0f2470c00200021002200230027e04730b186f86871c6f8647189f805a004e099f8050089f804a030b14ff0ff3013b0bde8f08f0026cbe794f8a00384f8a10338b3d4f8900342f66536c0f2440620b129682d31c4f8981310e044f6dd70c0f200007844002122460023b047c4f89003296801f12d01c4f8981320b106f1e8022d21904728b1002084f8a10313b0bde8f08f002013b0bde8f08f80b582b04ff4f0704af61f4e01904ff4207cc0f2470e0020002100220023cdf800c0f04702b080bd022a3cbf4ff0ff3070472de9f04fadf2345d239008784f780a4450ea072001f10207249002f04483259300232292974202f03883781c904202f0348338787978be1c40ea0121901b81422c962f9102f229832598ddf880253690ddf85805ddf878153790ddf85c053f913890ddf8600527933990ddf864053a90ddf868053b90ddf86c053c90ddf870053d90ddf874053e901068411e0028116002f003832f98002802f0ff822f98841c032c02f0fa82fe78072e02f2f6822c9890f80090f00702d107f1040e27e02f9820f00100022802f0e88297f804a07d7923984aea052b594636aa02f0ecfa002842f0db82ddf8640507f1060e012d3a900dd8ddf88005806948b14feadb020af00701835c012505fa01f119438154b00707eb0408cdf8a08005d44ff0000a042e29d2a1e000bfc64505d01ef9014b4ff0000af34603e000244ff0010ac34645f64d55c0f24605a847012808bf0134601e81b2670800ebd130002c48bf4710a84701283a9808bf7f42ddf8a0803844de463a90042e78d3baf1000f42d1c64540d0724612f8011b3a9842453dd09ef801200ef10203120642ea0141434500eb214c3ed00ef103029ef80210424534d09ef803200ef10403120642ea014143454fea214129d00ef105039ef80420434500f0ac869ef805700ef10603434542ea072200f0a3860ef107079ef80630474501f0dc829ef807700ef1080e3f024ff0000a15e03a98002100e0c64600eb010c4ff0010a0022002108e04ff0010a002203e04ff0010a00220021c646002300273b433b9f62440b447fb1dde93c76dde93e40bc45d8bfbc46b142d8bf3146a242a8bf22468342a8bf0346ddf8a0800120cde93cc1cde93e233b90baf1000f42f01582b9f1040f40f38380b9f1060f40f3f380b9f1070f00f0b982b9f1080f00f06c81b9f1090f42f00182c64502f0fe811ef801abc64542f0f981baf10f0f02f2f581ddf87c05002801f078833b993698dde93829002900f029863799dde93d733f9e994227eae775b8bf0b46b242b8bf1646b542359681f261833c994fea630c21eae17b4fea0a11339135990bf10104491b4fea5b0e4aea0a1211f003084fea54013494329100f0f7869b4581f2638205fb09045feacb7171465e4609d014f80e10349e01f0f00141ea0a0104f80e10329961452144319681f23f8204eb0c060c4604f8012bb44281f039828f1cb7424a7081f03582cf1cb7428a7081f030820f1dca70b7423946ead301f029ba00bfb9f1020f37dcb9f1010f00f06f81b9f1020f42f083813698dde937763490ddf88005dde939a1dde93b45dde93d32ddf8fcb0c0694ff00009c645cde946e8cdf820914290cdf80c91cde92a32cde928152e9400f07c820ef1010046909ef80090404500f074820ef1020046909ef80100b84604026fe2b9f1030f00f09681b9f1040f42f04b81dde936c0dde938633490ddf88005dde93aa2dde93c74dde93e59c0694ff0000bc645cde942e8cdf810b14090cdf804b1cde9323c3596cde92d74cde9305200f0af820ef1010042909ef800b0404500f0a7820ef1020042909ef801004fea0028a2e2b9f1050f00f0fa81b9f1060f42f01281c64502f00f810ef10100404502f00a810ef10200404502f005810ef10300404502f000810ef10400404502f0fb800ef10500404502f0f6800ef10600404502f0f1800ef10700404502f0ec800ef1080ca8eb0c001028c2f0e5800ef11800404542f0e0809ef804009ef8051050ea01261ebf9ef806009ef8071050ea012502f0d1809ef800009ef80120379940ea0224081bc2f0c780864202f2c4809ef802009ef80330389a40ea0327d01bc2f0ba80854202f2b780ddf87c05002801f03a8239980df1e80e369b34909ee8014fcdf8d4e0cde906478de8010f1846dde93437cdf828c0cde90865059704f0d7f801f021ba36983999339037983591349038983a9931904046cde94ee0ddf880053291c06900214eac46aedde93b7bdde93da5ddf8fc805091cde946012046314602f03ffb81462046314602f03afb5099002940f0ac82dde94ec2cdf8c080944500f0a5820cf10101914200f0a0820cf10201914200f09b820cf10301914200f096820cf10401914200f091820cf10501914200f08c820cf10601914200f087820cf10701914200f082822d909cf800009cf804102b909cf805003b4628900cf108005e46d646cdf8a8909cf801b09cf802709cf8039029919cf806a09cf80710a2eb0008b8f1010f2e9141f0fe80904200f05d829cf808100f2900f258820cf1090001f0f3b8c64502f01580724612f8010b012802f20f80369900283091dde93751359139993191dde93ac134913c992d913d992b913e992a913f99299100f0d982424501f0f7870ef10202424501f0f2870ef10302424501f0ed870ef10402424501f0e8870ef10502424501f0e3870ef10602424501f0de870ef10702424501f0d9870ef10802424501f0d4879ef801209ef802309ef8046042ea03239ef803209ef805409ef80610774642ea062e44ea012af9793a7a07f109041a9441ea0221b8e2a8eb0e06052ec1f0b4870ef10505454501f0af870ef1060b9ef80540a8eb0b00a042c1f0a6870beb0400404541f0a187369820903798359038982a9039981f90dde93a9034903c9831903d983290dde93e803390ecb14ff0000a04e000bf0af1010aa24515d21bf80a0001381e28f6d90beb0a00a4eb0a014eaa46ab774602f07cfe002801f075874e98be468244a245e9d3ddf87c05002801f0f3803498cdf8c090f146002800f0b283319820eae0703190329820eae070219035984045a8bf404635902a9833998842a8bf08462a90a0e3c64501f04d870ef10100404501f048870ef10200404541f04387704601784078dde93b5441ea0021ddf880050df1d80c0990ddf87c059ce80c10089004a8dde93976ddf8f490ddf8f8e0ddf8fc8080e810422398cde900c7cde90265cdf81c8004f0b2f8074659e1ddf880050df1f00adde936c1dde93853dde93a629ae89004ddf8fc90c0694ff0000bc645cde946e8cdf820b14290cdf80cb1cde9323ccde93451cde92d47cde93062cdf8ac9000f022810ef1010046909ef800b0404500f01a810ef1020046909ef801004fea002815e10120b8464890002446ad42af2846394602f0a3f935902846394602f09ef9489907460029cdf8b4b0cde9324a00f0148144460025002031900120bb464890002046af0df5847a30903846514602f085f980463846514602f080f94899002940f0f2800346dde946014ff0ff37884240f0ec80ddf8d4e0bef1000f00f1e680bbf1000f00f1e280ddf880254398116a329f08431062349847ea09074e904ff6fe7087423398dc46a246b3464f945096519000f0e5834ff6ff70874240f0c1832398d0f888934ff420704f904ff4f07050904ff4a0705190d4e3012044904ff0000842ac40ad2046294602f037f906462046294602f032f94499002940f0a480dde94212914200f09f8011f8014b914240f09a80ddf8803541991a6a1143239a1962002a00f09080d2f870114ff0ff37002900f08b8048ea0b030022b2eb532f40f0848051f82320002a00f07f80a2eb010e5fea8e7279d16ff4403240f60f057244cff6fd75aa4270d301eb0e0c5cf8081c99426ad15cf80c1ca1f1011212f5803f63d3bcf1000f60d05cf8042c8a425cd1cef54032914258d82b90ddf880051d46806950b1eb080bf0070e10f80380012202fa0ef242ea0802c2546046002246ab01f061fe00284ff0000708bf4ff0ff373bd0ddf87c05c0b3a6f1011010f1021f4ff0000731d92b98a0f1011010f1021f2bd93198002300284e9301f07f822d98349920eae0722e9820eae07330988142a8bf0146359834914845a8bf4846359001f06dba012048904ff0000846af42ac3846214602f091f881463846214602f08cf8489951b34ff0ff37229a279b002f00f0478701f0bbbddde9460188423ff4e7ae024612f8015b8a42469200f0bf82821c469243788a4245ea032500f0b782c21c469283788a42319300f03486011d4691c078bb4644460002d1e6dde946218a42d0d0134613f8014b8b42cbd0951c56784a1bb2424ff0ff37c6d3aa198a42c3d1ddf8803543991a6a1143239a1962002abad0d2f87021002ab6d048ea0b0e0021b1eb5e2fb0d152f82e100029acd0891a8b07a9d16ff44033bc4640f60f070b44cff6fd77bb4267469ed3531853f8082c724597d153f80cccacf1011212f5803f90d328aa002b4ff0ff3782e8604026903ff48aaf53f8040c60457ff485afc1f540302a9984453ff67fafddf880051d468069664640b1ca080bf0070c835c012101fa0cf119438154c12efff46daf287801287ff469af2998002801f02380dde928b8a5f13f0700f0bcbf424501f01e850ef10202424501f019850ef10302424501f014850ef10402424501f00f859ef801209ef80260714693004fea460eca780e7905314fea820a1a917100baf1000f1b9101f0fb841b99002901f0f784ea1ac1f0f484924501f2f1843599b1eb0e02c1f0ec841b99914201f2e884349903eb0c06084301d000230be05feacc704ff0000306d1002e04d40aeb0600a842d8bf01231a9f1b9aa8eb07001890ddf87c0502fb0af9b0fa80f0400918430024c0074ff0000b19931f902e95cdf8709022e0dde9303002fb003c4a081cf80230339803f00f0803f0f0030344c907329808bf48ea0003ddf8a0800cf8023026988344dde9200181424ff0000088bf01200443e00708bf0f44e10704d0d94507d801f095bc00bf474518bfd94540f2a281b8eb070001f08b8439780b0901d0012211e0012801f083847b780bb102220ae00428c1f07c84ba78fb7852ea032301f07684042200bf2192a9eb0b02934201f26e8420901f9826930028c0d101f00f003390269809010128cde91d7432912dd14ff0000c2698ddf8a0801e9cdde91c97c007acd00ceb0b00b0fbfaf101fb1a0001eb0e02811952ea0100a0d4a9429ed2359882429bd2349800283ff482af2d98814294db2b98824291db2a988142bff68eaf29988242fff674af88e720f001014ff0000c16e0dde93030339f04fb00305308c45cd20704f00f0504f0f0043c44329a08bf45ea02042e9dc4540cf1020c6145b7d00beb0c02b2fbfaf404fb1a2704eb0e0907eb060859ea080427d4a84525d23598814522d2349858b12d9880451ddb2b9881451adb2a98804517da2998814514dadde930304fea580709fb00343398e35d03f00f0503f0f00303445feac870329808bf45ea00032e9de355501cb0fbfaf202fb1a0002eb0e04821954ea0200bbd4aa42b9d235988442b6d234980028a0d02d988242b0db2b988442addb2a988242aada2998844294dba6e70aeb0a1109fb02f2f5f7cefa00f040bd00234ff0010ac646fff77bb9002021903190052e01f0ac832098002801f0a883fbf7e4f8002801f0a38395f800a00af10600864241f09c8347f65420c2f207000768002f01f09483387b797bba7bfb7b40ea012040ea024040ea0365a5f1810010f1800fc1f08483387c797cfa7c40ea0120b97c40ea014040ea02601490813810f5817f41f27483baf1000f4ff000001b97339077d04ff0000e00270ae000bf00f100404ea941f826000137574506f1010e17d21bf807007646411e1e29efd90beb0700aaeb070146aa42ab02f054fa00283ff489ad469942984eaa0f4442f82600e3e7bef1000f329500f0df80aef1010b4ff0000a4ead09e0be46d3450af1010aa6f1010605f1040500f0cd804ea850f82a100029f1d40020534686421dd005eb80077a68b2f1ff3f18dc5a1c934514d0ba68b2f1ff3f11dc9a1c93450dd0fa68b2f1ff3f0adcda1c934506d03a690433002a00f10400e0d400e000221b9846ab42ac7746009402f092fa00283ff43bad42980028c0d04af20d3146a8c0f24e018847b9e7329501204ff0000e90e04446fff720bc474508bfd94541f0e882ddf87c05002818bf012019990840012840f06684dde9300318990efb03004fea5a0700eb56021b98009701901a9801f09ffb002840f0548401f0caba2f4600f04abc239839464eaa1e46644601f0cefa00287ff4f9acddf88005ddf8d4e08069a446334660b10021b1eb572f08d1fa0809f00701875c012606fa01f139438154ddf838912a46b9f1000f3ff4ddac002a4ff0ff371cbfdde9301050ea01003ff4d5ac4f997145fff4d1aca1eb0e018a423ff6ccac50996145fff4c8aca1eb0c0188423ff6c3acddf87c15002700293ff4bdaca8f101111d4611f1021f7ff6b6ac2e99002900f02b85299921eae1732a9921eae1742b998a45a8bf8a462d998b45a8bf8b4600f01dbd002002e04ff0000e012099f804200f21950602f00f0601eae575754389214d43ed0a99f800c08df808510e2599f801a099f8023099f80370349212f0200f08bf012506fb05f501fb05f54fead5258df809514ff00d0508bf022506fb05f501fb05f54fead5258df80a514ff00c0508bf032506fb05f501fb05f54fead5258df80b514ff00b0508bf042506fb05f501fb05f54fead5258df80c514ff00a0508bf052506fb05f501fb05f54fead5258df80d514ff0090508bf062506fb05f501fb05f54fead5258df80e514ff0080508bf072506fb05f501fb05f54fead5258df80f514ff0070508bf082506fb05f501fb05f54fead5258df810514ff0060508bf092506fb05f501fb05f54fead5258df811514ff0050508bf0a2506fb05f501fb05f54fead5258df812514ff0040508bf0b2506fb05f501fb05f54fead5258df813514ff0030508bf0c2506fb05f501fb05f54fead5258df814514ff0020508bf0d2506fb05f501fb05f54fead5258df815514ff0010508bf0e2506fb05f501fb05f54fead5258df816514ff0000508bf0f256e434e43f60a00288df8176140f024824fea0a6242ea0c41309a380602eb214b329940ea0340ddf88480ddf86ca0aef1010501eb204000261390cdf85ce0159507e001f01f000b3801367645834400f0f8814ea850f82610b1f1ff3ff1dd33469d421cd04ea800eb83004268b2f1ff3f16dc0133ab4212d08268b2f1ff3f0fdc0133ab420bd0c268b2f1ff3f08dc0133ab4204d002690133002ae1d400e00022504646ab40af009702f0d5f8002800f0d081409900291d9100f0ba819df820019df82111189650ea0125cdf868b000f09f819df824719df825613f0447ea0667149e9df81f019df81e112e444fea002c41ea00229df8220106eb2747139e9df823310004f71b1a9e40ea03604ff0010e06eb204b28920eeb520203141c920ceb010201f003000bf1010119910bf1020116911d992d97571e1e97f718f31a01312990101a2e910eeb5201319a3390d8074ff000093290f8072b913090269509e000bf2e982b9909f10109a94508442e9000f04e812d9809eb00034345f1db2a988342eeda28980028ebd0dde91f104ff0000a03fb01071e98032880f09c802998ddf88480269d0028dbd0dde91c10012309fb010c34984fea5a011cf8011000f0100083ea1014c8b201f00f035feaca7e08bf03091846002b18bf01202043012815d10aeb0b06964211db359886420eda7008395c42adeb5c01f00f0501f0f0011943f60708bf45ea0311269d395429980128a6d00af1010040081cf80000bef1000fc1b24fea111808bf00f00f085ffa88f0002818bf01202043012817d119980aeb0003934212db359883420fda5808395c42ae16f8086001f00f0501f0f0013143db0708bf45ea0611269d39542998ddf8848002283ff474af0af1020040081cf80000bef1000f00f00f03c1b208bf0b091846002b18bf0120204301287ff460af16980aeb00069642fff65aaf35988642bff656af7008395c42adeb5c01f00f0501f0f0011943f60708bf45ea0311269d395445e7ddf8b8c008e000bf33980af1040a50450cf1020c3ff458af34981cf8016c00f010030120f6b2002580ea13130f2e88bf01251d43012d0beb0a0815d1904513db3598804510da4fea58053609795d42a8865d01f00f0401f0f00131435feacb7008bf44ea061179551cf8010c10f00f0e704618bf01201843012818d108f10106964214db3598864211da7008395c42aa12f80e6001f00f05329c319a45ea061501f0f001002c08bf41ea06053d549cf80000c6b200200f2e88bf01201843012816d108f10205954212db359885420fda690830097e5c42ad285c06f00f0506f0f006309c0643002c08bf45ea00167e549cf8000010f00f06304618bf0120184301287ff481af08f103039342fff67caf35988342bff678af5808395c42ab9b5d01f00f06329d46ea031601f0f001002d08bf41ea03063e5466e74af20d3146a8c0f24e0188479df81c019df81d11dde91aba159ddde917e605e09df81c019df81d11ddf85ce040ea012002e6002007e000274ff0010ac646fef73cbd4ff0ff303390339ffff7aab94446fff79eb80f4600e04f1cd90708d03199994205da3978339c01f00f0121433970b8f1010f05f1010700f0d8809b4580f2968007fb09045feacb7171465e4609d014f80e10349e01f0f00141ea0a0104f80e10329961452144319614da04eb0c060c4604f8012bb4426dd28f1cb7424a706ad2cf1cb7428a7066d20f1dca70b7423946edd360e00f465ee0102190427ff45ea92b9ab84652ea0b2c4ff0ff373ff458a958ea092226923ff453a9bcf5207f3ff64fa9269ab2f5f07f3ff64aa9baf10f0f2191cdf87ca03ff643a92e9910293ff63fa9ddf88005479a016a1143ddf87c250162002a00f08a8332992a9a614449428a42c0f283833499329a0027891a2a9a8a42bff625a926992d9a49428a42fff61fa92d9a31988242bff61aa9002b00f0858326eae671209134992eeaee7ea942a8bf2946dde9303034919842a8bf1846319077e34f1cd90708d03199994205da3978339c01f00f0121433970b8f1020f05f1020739d09b4536da07fb09045feacb717146d8460ad014f80e10ddf8d08001f0f00141ea0a0104f80e1032996145214414da04eb0c060c4604f8012bb4420fd28f1cb7424a700cd2cf1cb7428a7008d20f1dca70b7423946edd302e00f4600e04f1cd90707d0984505da3978339c01f00f0121433970ef1c3599691a11f1040f11d9229a279b2498013383422c982f9900eb01077ef432ab00f071be00bf359904378f42edd09b4539da07fb09045feacb7171465d4609d014f80e10349d01f0f00141ea0a0104f80e1032996145214418da04eb0c060c4604f8012bb44280f0cd8001f10208b0454a700cd201f10308b0458a7007d201f10408ca70b0454146e9d300e08846d90709d09d4207da98f80010339c01f00f01214388f800109b4536da791c01fb09015feacb7474465d4609d011f80e40349d04f0f00444ea0a0401f80e40329c644501eb040615da01eb0c04314601f8012ba14280f09580b11ca14272700ad2f11ca142b27006d2311df270a1420e46ecd300e03146dc0707d09d4205da0c78339d04f00f042c430c709b4536dab91c01fb09015feacb7474465d4609d011f80e40349d04f0f00444ea0a0401f80e40329c644501eb040615da01eb0c0400bf314601f8012ba14260d2b11ca14272700ad2f11ca142b27006d2311df270a1420e46edd300e03146dc0707d09d4205da0c78339d04f00f042c430c709b45bff64baff91c01fb09015feacb7474465d4609d011f80e40349d04f0f00444ea0a0401f80e40329c644501eb040615da01eb0c0400bf314601f8012ba1422ad2b11ca14272700ad2f11ca142b27006d2311df270a1420e46edd300e03146dc073ff41baf9d42bff618af0c78339d04f00f042c430c7010e701f10108d9077ff442af4ae7711cdc077ff478af7ee7711cdc07acd1b3e7711cdc07e3d1fde6b8f1010860d01bf8010b411e1f29f7d341b22029fef698af07eb400117f81000497840ea0122c12afef48eaf284631464eab00f0a9fd0028e2d1fef785bf002400235345b8bf5c45bef680af289908eb01065645bef67aaf5d45bef677af991a8e427ef773af211a8d427ef76faf9f1b1946b8bf3146b342e0464ff0000cd8bf6746be44d31b671bd8bf6746c61ba542aaeb0100c8bf2c46834238bf1846abeb04039e422e9328bf1e46349b2b96994507eb080329932d9442d1299b2d9f9f422fdd4ff0010c3be0ddf87c05002800f09381a9f1011010f1021f4ff000077ef635af2698a0f1011010f1021f7ef62eaf3198002300284e9300f0cf842d9820eae0722e9820eae07335985045a8bf5046359034982b998842a8bf0846349000f0bdbc299b2d9f7145a7eb0303b3fa83f34fea53134ff00007c8bf012703ea070c2b9b002b00f058814ff0040a2aea8e071a970eeb000743184fea5e06013f01f0010203f001041b967e0819962aea8706171918963294c61bdde930745018274435920eeb02048eea01024908179159082d9b169179192e9dc91a4fea560ba94238bf0d4601212e95bbf1010f88bf710801f0030321f00301129161082691410821913499159301eb5000411c03381490d00720904ff0ff3000eb56002a906ff0010009eb540300eb56002890981e13906ff00200ddf844e11c9600eb5600339e4ff00008109111931f90cde91dec08e02e9808f10108339e80454ff000073ef495ae6fea08014046bcf1000f2b9a18bf50182999359b421802fb0e910bb9002305e01b9b1a9ccb5ce34003f00f033193329b0bb9002304e0199b189ccb5ce3401b0130932d9b209f03443498002f03fb060a2198269f504439441cd15a46f4f7b3fadde91dec359840b11799319a1af8010000f0f00010440af8010032980028b6d01699309a1af8010000f00f0010430af80100ace703fb06f4bcf1000f02fb0ef23ed01c980228ddd31398149910442144002200eb0b039c785f782a9dc4f3031444ea071701eb0b049542a770cad05f7810f80b50c7f3031747ea0517289d67709542bfd010f80b7013f8015cc7f3031747ea05171f9d01f80b709542b2d013f8017c13f8023cc7f30317043247ea031304389345a1f1040104f8013cc9d1a1e71c9b022b9ed31c9b082b01d200222be0119bddf848e003eb020c109a144400220ceb02077d781cf80260c5f3031545ea0616a51805f8016cbe787b78c6f3031646ea0313a354fb78be78c3f3031343ea06136b703b79ff780432c3f3031343ea07139645ab70dbd1159bdde91dec002b3ff468af531ccf5c8e5c159cc7f3031747ea0617012c87543ff45caf941c0f5dce5c159dc7f3031747ea0617022dc7543ff450af0a44d278095dc2f3031242ea0111015546e70027fef7a7bd00224ea8cde905402b9806eb0a0104903598cde902510190dde93210349f009701f089fb0746fef792bd00214ff0000e2091dde9280141ea0021b1eb5c0f28bf4fea5c01269ab1eb520f28bf51081c91013938bf394610912d99beeb0104d8bf3c463198411a9142a8bf11468c421e91bef66dad28984fea092a4fea002932982a994fea0b230f181c9920984a004943890028921b918742c8bf3846349d0ceb0702aa424ff000012a92b8bf1546bcf1030f38bf0121269e0022032e38bf012211431a91410819912b990aeb080219444b08b3eb520f219b1d9000f1010c4fea031015904fea520243ea031038bf4a08149029986910484429951891824228bf0246109b4ff0000a03fb03f080000d906ff0080000eb420016902d987045c8bf8646339835992b9701fb0e002e99309000203290701e1790b01e139058001290781c119008010f9041ea011026460e904fea5c00cdf830c00b9010e001780f9a01f00f0111430170359c319e30980136204430901e9800278642bef6e8ac2699f04308448642b8bf304628996fea400008440128319638db1b994ff0ff3200fb10101c99a1eb0a01012902eb41013bdb01fb01f2824237dd1699a1eb4a0202f10803032b02f1060126db01fb01f7874222dd052b02f1040121db01fb01f787421ddd072b02f102011cdb01fb01f7874218dd0af1040a092ba2f1080103db524382420a46dbdc08310ee02d983399359c219a4ff0000a39e00af1010a04e00af1020a01e00af1030abaf1010f29db08318a1f5243824224dcbaf1020f16db0a1f5243824215dcbaf1020f0fd08a1e5243824211dcbaf1040f08db01fb01f282420ddcbaf1040a01f10801e1d14ff0000a07e0aaf1010a04e0aaf1020a01e0aaf1030a2d983399359c219a319e30442b9b00fb04192a985344102aa0eb0a0800f08b8034988342b8bf18461d99814239da1d9f199af90739460ad0199f219a19f8071001f0f001114309f80710dde90b21b2eb600f09eb020715da149d09eb60063a4602f8015bb2420fd2ba1cb2427d700cd2fa1cb242bd7008d23a1dfd70b2421746edd302e03a4600e07a1c359c319ec70707d0814205da1078159900f00f0008431070ddf880c0e045c8bfc4462998844541da5feacc700bd04fea5c0019f80010219a01f0f00111430cf1010c09f800101898b0eb5c0f1add1898309e149d4fea5c0209eb0007b018044604f8015bbc4210d2811cb94225700fd2c41cbc420d700ad20436b118b9422570ecd305e009eb5c0102e0411c00e021462998359c319ec00708d02998844505da0878159a00f00f00104308702e9810280bd1012002901f982099349a01904846cdf8008002f0c7fbcae6b6fa86f01a99400908434ad11798864247d01399701e891b8842b8bf01466fea4100129908440128c0f29f800d99329a00fb101010998a1a4ff0ff31012a01eb42016ddb01fb01f7874269dd5100a1f1090202f10807032f02f1060157db01fb01f6864253dd052f02f1040152db01fb01f686424edd072f02f102014ddb01fb01f6864249dd3299092f01f104013291a2f1080103db524382420a46d9dc08313ee020988342d8bf034634988045a8bf80464345bff66daed80709d0580819f800102e9a01f0f0011143013309f800105908b1eb680f17da309f0e9d09eb68027c18264606f8015b96427ad2a01c904235707bd2e61c9642057076d20437781890423570ecd371e009eb53006ee0329a013204e0329a023201e0329a03323292329a012a23db08318a1f524382421edc329a022a19db0a1f5243824200f3ba80329a022a11d08a1e5243824200f3b580329a042a09db01fb01f2824200f3b080329a0831043a3292ded1002032901198329900eb010c20988342d8bf0346ddf8d0e0f445b8bfe646734543dad80709d0580819f800102e9a01f0f0011143013309f800105a08b2eb6e0f17da309e0e9d09eb6e07b018044604f8015bbc4212d2811cb94225701ad2c41cbc420d7015d20436b118b9422570ecd310e009eb53010de0601c02e0411c09e030465feac8713ff4cfad4345fff6c6adcae521465feace7007d0734505da08780f9a00f00f001043087032982a99c0430e18012002901f98209f349c01904846394622466346009602f0abfabe42d8bf3e46a045a8bfa0464645bff6a5adf00709d0700819f800102e9a01f0f0011143013609f800107108b1eb680f17da309b0e9d09eb68025c18274607f8015b974210d2a01c90423d700fd2e71c974205700ad20433581890423d70ecd305e009eb560002e0601c00e038465feac8713ff473ad4645fff66aad6ee53298013858e73298023855e73298033852e700223098359f09eb00014ea808902998009707902898cde905402698cde903102a98029034980190dde9321001f0c1fd0746fef73eba4ff0ff300df2345dbde8f08fb81a18bf4ff0ff300df2345dbde8f08fb0b586b008b3d0f87001f0b10023b3eb512f1ad150f82130bbb11b1a9d0714d16ff4403540f60f041d44cff6fd74a5420bd3184450f8085c8d4206d150f80c1ca1f1011515f5803f03d24ff0ff3006b0b0bd50f8045c8d42f7d1c3f540339942f3d80028f1d0037813f00b0fedd1144601ab0022002500f011f80028e5d00198dde903122060481c40086160a260e06028462561656106b0b0bd00bf91429cbf002070472de9f041855c4ff0050c6e0758bf4ff0030c15f0f30f02d1891a614502d20020bde8f0818418627894f802e0002e05d5e078267942ea0e2240ea062e002a4ff0000018bfbef1000fead0b2f5207fe7d8bef5f07f88bfbde8f081082d38bf0120072d18610ad8501c400800fb0ef0a1eb0c018842d3d804eb0c0828e004eb0c080efb02f5002000bf00eb0c04a142c6d008eb00073e78360903d00127b54213d2bde70c1b012cbad07e781eb10227b5420ad2b4e7042cb2d3bc78fe7854ea0626add00427b542aad3ad1b3844dcd158600120c3f800809a60c3f80ce0bde8f0812de9f04f89b0dde91257069005fb07f000294fea4007029100f0d48100200390089002984ff0010e00264ff0000b4ff000084ff0000c4ff000090497079205930be000bf4ff0000c4ff00308cdf80ca009f10109814500f0ba81bcf1000f40f0b4810699b8f1020f11f809a0ead0b8f1010f15d0ddf81cc0b8f1000f40f086805fea1a100af00f01089100f092800499814280f09a804ff0010c4ff0000882e1079abaf1000f00f07f800499514576d3a1eb0a010491089901eb01100901019114e000bfa15d089f01f0f0013943a1550136aaf1010a4ff0010eae4224bf00260bf1010bbaf1000f00f0598113998b45d1d20bfb0324bef1000fe3d0a91bb1eb5a0f88bf4fea5a0141b38d0804eb060817d0002208f10107a2eb850c6ff003057b1904350ceb05020432d870187158719871f5d1059b079a2f1d11f0030504d10ce0002711f0030508d0012d08f8070004d04744022d787018bfb870aaeb410abaf1000f0e440dd0129dae42b5d2a15d019f01f00f013943aaf1010a4ff0000ea155afe7129d4ff0000aa6e7039a52ea0a2213d004990392914280f08f804ff0010c4ff0000853e74ff0000c4ff002084ee74ff0000c4ff00108f4e000214ff0010c4ff00008039142e7089a091a049102eb02111201cdf80090019214e000bf1af80670089a07f0f00717440af80670013601384ff0010eae4224bf00260bf1010b002800f0d680139a934580f0cd800bfb03cabef1000fe2d0ad1bb5eb500ff14688bf45087db3ac080aeb06081ed0002308f10107a3eb840c6ff0030400bf07eb040e04340ceb040304338ef803108ef804108ef805108ef80610f0d1059bddf81cc0271d15f0030404d10ce0002715f0030408d0012c08f8071004d04744022c797018bfb970a0eb45002e4488b1129dae4210d21af80620019f02f00f023a430af8062001384ff0000e0028abd180e000bf129d0020ce469de7891a0491089901eb011009010191114613e000bf1af80620089c02f0f00222430af80620013601394ff0010eae4224bf00260bf1010b002953d0139a9345bff4ccae0bfb03cabef1000fe3d0ad1bb5eb510f88bf4d085db3ac080aeb060819d0002208f10107a2eb840c6ff0030400bf3a1904340ceb04030433d070107150719071f5d1059bddf81cc0271d15f0030404d10de0002715f0030409d0012c08f8070005d04744022c787018bfb87000bfa1eb45012e4489b1129dae42b6d21af80620019f02f00f023a4301394ff0000e0af806200029b0d103e000bf129d0021a4e74ff000084ff0000c029852e64ff0010c4ff0000803e04ff000084ff0000c0298ddf8009045e60120012107e04ff0010cb8fa88f0049f8cf001014009b7fa87f252091140084009b0bde8f08f00bf2de9f041826882b10121816007220020511e20fa01f1c90708bfbde8f0814ff0ff3191400843bde8f0818c46056841688d42e9d06b1c03602c78ff2c11d18b4200f0dc80ac1c046095f90120b2f1ff3fd6b200f3d080bf2e22d806f03f0602238fe062b2b2f1ff3f02dd07222046cfe7bf2c09d804f03f070e224ff0010e4ff000084ff0000c2ee0df2c0fd804f01f0715224ff0000c4ff001084ff0010e22e0df2e0fd806f01f0603236ae0ef2c0fd804f00f071c224ff0010c4ff000084ff0010e10e0ef2e58d806f00f06042358e0f02c40f093804ff0000820224ff0000c4ff0000e00278b424fea072603d0af1c07606d7803e00125856000251f46c02c45ea06046cd35b1a7d1ab3fa83f3b5fa85f55b096d092b434fea042403d001258560002503e07e1c06603d783746b8f1000f44ea050453d17d1ab5fa85f56d092b434fea042403d001258560002503e07e1c06603d783746bcf1000f44ea05043ed1791ab1fa81f1490919434fea042131d001238360002030e0f02e3ed1002605234ff0010e00250127ea074fea062617d18c4215d0621c0260247801379f4246ea040623d000bf8a424fea062609d0541c0460127801371643bb422246f3d116e02246013701254ff0000e9f4214468560dad112e07b1c0360387840ea0104bef1000f20467ff413afbde8f08114465feace7202d0091b8e4204d9012181600020bde8f081a11907462046002263463960bde8f041ffe78446081ab0f5806f01d90020704761454ff00000fad0002a18bf70472de9f04fabb09fed251a9fed250a9fed253a9e4600264ff0ff380df12c090df10c0ab7ee002ab0ee084ab6ee005ab1ee006ab9ee007a00206746019009e000bf49f826500af8064001368f42bc4600f0cb8217f8012b501e01280fd8012a23d18f4274d09cf901000cf10207b0f1ff3fc5b240f38f8000220724f5e1052a37d0042a30d0032a49d1002e00f0d982701e59f820501af8004093e200bf0000004f000000cf000000008f4254d00cf102079cf801008f4247d09cf802200cf103078f4240ea02203fd09cf803200cf104078f4240ea024037d09cf804200cf10507130600223ae0002e00f0aa82013eace7022ec0f0a582b21e59f82230701e59f8205049f820301af802301af800400af8003049f822500af8024096e702f0f80010281fd1002e00f08b82701e1af80030002b40f0858259f82050152a6fd16d420022002406463de20023012206e001220724002588e101220020002343ea000501242fe2a2f12000062827d8002e00f06782731e1af80300002800f0618259f82300242a40f0858080f00045012400221e4617e2bf2d5ad801220292002205f03f000e244ff0000b00928f4200f019819cf802300cf10308002215e1322a51d002f0fe0030284dd0402a40f0a380032ec0f03682701e1af80020002a00f03082b21e1af80230002b00f02a82033e1af80630002b00f0248209eb8202d2ed000a09eb860209eb8000d2ed001ad0ed002a70eee10a62eea00a71eea00acee1002800f00e82023e1af80600002840f0088259f82600122a58dc102a00f03081112a00f03381122a40f02c81454354e1df2d44d8002205f01f00152400924ff0010b0122bae0002e00f0eb81a2f13100013eb0fa80f01af806304009834240f0e08159f82600302a7bd100ee900af8eee00a94e1002b00f0d481023e1af80630002b00f0ce8159f82630212a40f3ed80222a00f02581232a00f02981252a40f03a8100ee903a01ee900af4ee610af1ee10fa48bff0ee601a11ee905a71e1ef2d72d805f00f001c24012274e0a2f11303022b80f0c480002d00f0a381b0f1004f08bf15f1010300f0eb80132a40f0f18090fbf5f5f1e0a2f1480010f1070f4ff00000c0f05f81002e00f05c81013e1af80600002800f0858109eb8600d0ed000af4ee420af1ee10faf5ee400ac8bff0ee420af1ee10fa48bff0ee430a432a72ee601a00f3b480412a00f0f380422a00f00f81432a40f0008161eea10a72ee600a1de1312a40f0948000ee900a20f00040b0f1ff4f4ff00002f4ee410aa8bf0122f1ee10fa4ff0000080f21c81f4ee400af1ee10fa00f11681002a40f01381fdeee00a10ee905a98e0f02d4ff0000040f00981002220244ff0000b009202928f427ff4e7ae00230122b8460002c02d43ea000535d3781aa8eb0103b0fa80f0b3fa83f340095b0918434fea05270ebf18f8013b00230122bbf1000f43ea07051fd1a8eb0103b3fa83f35b0918430ebf18f8013b002301222f02009d002d43ea07050ed1a8eb0103b3fa83f35b0918434fea05230ebf18f8010b0020012240ea0305474602984ff0ff3838b1601e25fa00f0c0071cbf08fa04f005430024a3e0162a10d1a842b8bf054637e0202a4cd0212a51d100ee903a01ee900a70eee10a8ee005442ae0a842c8bf054626e0451b24e0002800f1c680def800200546824238bf15469042019888bf0120019015e0442a48d0452a5fd0462a4ed161eea10a61e00025132a4ff0000208bf4ff00045002469e090fbf5f202fb15050022002462e000ee903a01ee900a61eea00a57e000ee900af5ee400af1ee10fa00f0928001ee903ac1eea00a4ae000ee903a01ee900a71eea00a43e000ee903a01ee900af4ee610af1ee10fac8bff0ee601a11ee905a37e060eea01a70eea00a74ee600a61eea00a2ce0f4ee450af1ee10fa18d570eea01a60eea10a22e0f4ee450af1ee10fa15d560ee861a60eea11a60eea10a16e060eea00a13e060eea01a60eea10a0ee071eea10a61eea00a72ee600a07e061ee870a61eea00a61eea00a70ee820a10ee905a012400224ff000005ab9202e09d0002c3ff436ad25f00040b0f1ff4ffff630ad00202bb0bde8f08f56b3701e1af8001059f82000d9b102ee100a20f00040b0f1ff4f4ff00001b4ee412aa8bf0121f1ee10fa4ff00000e4dab4ee402af1ee10fadfd40029ddd1bdeec20a10ee100a019adef804101143cef804102bb0bde8f08f00202bb0bde8f08f80b5002970d090f900c0bcf1200f5ffa8cfc07db012010604ff0010ec3f800c0704680bdacf1c20ebef11d0f0fd801295ad090f9011011f1410f55dc02211160407800f03f006cf38a108446e4e70cf0f00ebef1e00f23d1032945d390f901e01ef1410f40dc90f9021011f1410f3bdcbcf1e00f5ffa8ef101d1a02934d3bcf1ed0f01d19f292fd80321116042784fea0c3189b2807802f03f0241ea821136e004294ff0000ebbd3acf1f50111f1050fb6d390f901e01ef1410f15dc90f9021011f1410f10dc90f9031011f1410f0bdcbcf1f00f5ffa8ef101d1902904d3bcf1f40f03d18f2901d9002080bd042111604ff4e011427801ea8c4c817802f03f02c0784cea023201f03f0142ea811100f03f0001eb000c7fe72de9f04188b04af2bb261c46c0f24e0613460a46ddf83880002706f1ae05214627706770a770e77027716771a771e77127726772a772e77227736773a773e77327746774a774e77427756775a775e77527766776a776e77627776777a777e777a8470028c8f800705cd020786178a278e3780843104318434ff0010008d0e179a27911431ebf617a227a51ea020102d108b0bde8f081a07b14284ff00000f7d1217d8df8040041f0010121758df805008df806008df807008df808008df809008df80a008df80b008df80c008df80d008df80e008df80f008df810008df811008df812008df813008df814008df815008df816008df817008df818008df819008df81a008df81b008df81c008df81d008df81e008df81f0001a92046b047c8f8000018b1012008b0bde8f08106f1520120468847d8f80000002818bf012008b0bde8f081002804bf4ff0ff3070472de9f04f95b00df1200c8ce80f00f8f7fefc002800f004824ef66c6a4ff29c5bccf2ff0ac2f2290b4ff6ff760024012547f67f797f2707e000bf48f2a351c0f24501bff32f8f8847dbf80080bff35f8fdbf80000bff35f8f01466ff39601b1f1005f07d10168514504d14168b1f57d7f00f093804ff47d70f9f721fc002800f0cf814ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d71c0f800a041608573a0f8c49180f8c371068446848684c684068546858685c685068646868686c686068746878687c6875be8001f41457ff45aafbff35f8f4be8000121b15be8001f4145f8d04fe7d0f87011209e4ff0ff3029b30022b2eb562f21d151f82600002800f03481431a98074ff0ff3017d16ff4403240f60f071a44cff6fd77ba420ed3ca1852f8080cb04240f0208152f80c1ca1f1011010f5803f04d24ff0ff3015b0bde8f08f002a4ff0ff30f8d052f8047c8f42f4d1c3f540339942f0d810ad104600222b460024fef716ff002800f0fe80239b0f22990603f00f0002eae17101fb00f289214a43d20a8df830200e2213f0200f08bf0f2408bf012200fb02f201fb02f24fead2228df831204ff00d0208bf022200fb02f201fb02f24fead2228df832204ff00c0208bf032200fb02f201fb02f24fead2228df833204ff00b0208bf042200fb02f201fb02f24fead2228df834204ff00a0208bf052200fb02f201fb02f24fead2228df835204ff0090208bf062200fb02f201fb02f24fead2228df836204ff0080208bf072200fb02f201fb02f24fead2228df837204ff0070208bf082200fb02f201fb02f24fead2228df838204ff0060208bf092200fb02f201fb02f24fead2228df839204ff0050208bf0a2200fb02f201fb02f24fead2228df83a204ff0040208bf0b2200fb02f201fb02f24fead2228df83b204ff0030208bf0c2200fb02f201fb02f24fead2228df83c204ff0020208bf0d2200fb02f201fb02f24fead2228df83d204ff0010208bf0e22424360434843c00a8df83f00c3f3001006900ca84a43cde9045008ac0b9dd20addf88890ddf884a0ddf87c8013cc1e9e8df83e2022462b46cdf80c90cdf808a0cdf80480009600f02df8dde91201a2455044c8bf5446a9454944c8bf4d46b042b8bf06464145b8bf8846a64211dd4146a8450edd249800680f280ad8249f491b321b07ebc0030130dc801d815a8199813860002015b0bde8f08f4ff0ff3015b0bde8f08f2de9f04f8fb0dde91c5a0e9129691e9eddf868c0002900f05c812f68002e40f05381874200f050819af80f100f2940f04b819af80e100e2940f046819af80d100d2940f041819af80c100c2940f03c819af80b100b2940f037819af80a100a2940f032819af80910092940f02d819af80810082940f028819af80710072940f023819af80610062940f01e819af80510052940f019819af80410042940f014819af80310032940f00f819af80210022940f00a819af80110012940f005819af80010002940f000811b9fb2eb0c044ff00001d8bf0c46db1bd8bf0b46d5f808e0ea681d46e919189fa444aeeb0403a7eb0c070694bb42b8bf1f46199b521b0b91591a8a42b8bf1146012f0c910797c0f2e5820c990129c0f2e1820ef101014c08069900eb6c000a9048100990042020ea81000590079801310138cde903014810029004fb05f000f102094ff0000acde9005c089407e000bf0c980af1010a8245a14400f0bb821c980e9b01680aeb050000fb04120b980a9f504400fb03705feacc7303d1099fdde9063810e0099b2e46d35c059d0778eb4007f0f00703f00f033b4400f8013b049bdde902783546d619da074fea580b0d9208d131465a466446f2f712fba446089c68e000bfb8f1020f64d3abf10102032a04d200211bf0030e35d15be06ff0030202ea58034f44b646c3f1000c3944471c8e18f578b478c5f3031545ea0415bc18e5703579f378c5f3031545ea0313237173793579c3f3031343ea05136371b3797679c3f30313043243ea06130ceb02060436a371dcd1dde9005c089c111d76461bf0030e26d04b1cf75c3246765cc7f30317ddf804c047ea06171646bef1010f475417d08f1cd65dd55cc6f3031646ea0516009dddf804c0bef1020fc654164608d03144c978f25dc1f3031141ea0211c15500bf5feac8713ff45aaf0d9a16f80b10002a4ff0000208bf042210f80b30d14003f00f0242ea011100f80b1047e7874200f095810026a1e16d68002d00f0018200244ff000090ae000bfdde90c14d8f804500c44ddf874a0ac4280f0f281ddf870800d94d8f800100f5d3e0903d001210c910ce000bf2e1b012e00f0e28121444d78002d00f0628102210c912e4617f00f011e9f1af801a0b7fa87f74fea571718bf012147ea010e1b9f4fea0a1b16f003014c4600f08980cde90a16d8f808100026b9fbf1f404fb119161449142a8bf012606ea0e06012e18d13c449c4215db189da94212da199dac420fda0e9d4e0804fb0504c907a75d6ff00f01554604bf0f215d4639401b9f2943a1550a990b9e012909f1010458d0d8f80810b4fbf1f606fb1141002461449142a8bf012404ea0e04012c18d1f4199c4215db189da94212da199dac420fda0e9d574604fb05044d08c907665d6ff00f0104bf0f215f46314039431b9f61550a990b9e022909f102042ad0d8f80810b4fbf1f505fb1141002461449142a8bf012404ea0e04012c19d1ec199c4216db189da94213da199dac4210da0e9d574604fb05044d08c907665d6ff00f0104bf0f215f4631400b9e39431b9f615509f10304711e0329b14405d23ae700bf0434a1453ff436afd8f808100026b4fbf1f505fb114161449142a8bf012606ea0e06012e1bd13d449d4218db189eb14215da199eb54212da0e9ed04605fb06054e08c907af5d6ff00f0104bf0f21d84639401b9f41ea0801ddf87080a955d8f80810661cb6fbf1f505fb1161002661449142a8bf012606ea0e06012e1cd13d449d4219db189eb14216da199eb54213da0e9e574605fb06054e08c90715f806806ff00f0104bf0f215f4601ea0801ddf8708039431b9fa955d8f80810a61cb6fbf1f505fb1161002661449142a8bf012606ea0e06012e1cd13d449d4219db189eb14216da199eb54213da0e9e574605fb06054e08c90715f806806ff00f0104bf0f215f4601ea0801ddf8708039431b9fa955d8f80810e61cb6fbf1f505fb1161002661449142a8bf012606ea0e06012e7ff466af3d449d42fff662af189eb142bff65eaf199eb542bff65aaf0e9e574605fb06054e08c90715f806806ff00f0104bf0f215f4601ea0801ddf8708039431b9fa95544e7042e78d38e78c97856ea012673d0042188e61b99002901dd012609e0b1fa81f149090027bcf1000fc8bf012707ea0106d5f808e0d5f80cb00bfb0ef9b9f1000f59d01e990024b1fa81f149094ff0ff380d91f1070c9107e000bf01340bfb0ef94c45a8f1010846d20c991c9e0029214618bf09eb0801b1fbfef536680ef1010705fb1e117f0805fb07664f08f65d042727ea8107fe4016f00f094f4618bf01270d9e3743012fd8d161449142d5db1b9f3d449d42d1db189fb942ceda199fbd42cbda0e9f1af8096005fb070e4d081ef80570c90707f00f0907f0f00747ea06071c9908bf49ea06170ef80570d1f808e0d1f80cb0b1e70fb0bde8f08f00bf002804bf4ff0ff3070472de9f04f99b01c461546cde90e01f7f772ff002800f0fb814ef66c6b4ff29c59cde90c54ccf2ff0bc2f229094ff6ff7a0024012547f67f787f2607e000bf48f2a351c0f24501bff32f8f8847d9f80070bff35f8fd9f80000bff35f8f01466ff39601b1f1005f07d10168594504d14168b1f57d7f00f0a3804ff47d70f8f793fe002800f0c4814ff60c41cff6ff7142182e3182f8f44382f8f54382f8f64382f8f74382f8f84382f8f94382f8fa4382f8fb4382f8fc4382f8fd4382f8fe4382f8ff4382f8004482f8014482f8024482f8034482f8044482f8054482f8064482f8074482f8084482f8094482f80a4482f80b4482f80c4482f80d4482f80e4482f80f4482f8104482f8114482f8124482f8134482f8144482f8154482f8164482f8174482f8184482f8194482f81a4482f81b4482f81c4482f81d4482f81e4482f81f4482f8204482f82144a0d14ff47d71c0f800b041608573a0f8c48180f8c361a0f820a0a0f822a0a0f824a0a0f826a0a0f828a0a0f82aa0a0f82ca0a0f82ea0a0f830a0a0f832a0a0f834a0a0f836a0a0f838a0a0f83aa0a0f83ca0a0f83ea059e8001fb9427ff44aafbff35f8f49e8000121b159e8001fb942f8d03fe7d0f87021279e249d4ff0ff302ab30021b1eb552f21d152f82500002800f01881811a88074ff0ff3017d16ff4403340f60f070b44cff6fd77bb420ed3571857f8080ca84240f0048157f80cacaaf1011010f5803f04d24ff0ff3019b0bde8f08f57f8040c50454ff0ff30f6d1c1f540318a45f2d8002ff0d0baf1c10fedd33878012840f0e580b0060f2206f00f0102eae070484389225043c00a8df854000e2016f0200f08bf012001fb00f002fb00f04fead0208df855004ff00d0008bf022001fb00f002fb00f04fead0208df856004ff00c0008bf032001fb00f002fb00f04fead0208df857004ff00b0008bf042001fb00f002fb00f04fead0208df858004ff00a0008bf052001fb00f002fb00f04fead0208df859004ff0090008bf062001fb00f002fb00f04fead0208df85a004ff0080008bf072001fb00f002fb00f04fead0208df85b004ff0070008bf082001fb00f002fb00f04fead0208df85c004ff0060008bf092001fb00f002fb00f04fead0208df85d004ff0050008bf0a2001fb00f002fb00f04fead0208df85e004ff0040008bf0b2001fb00f002fb00f04fead0208df85f004ff0030008bf0c2001fb00f002fb00f04fead0208df860004ff0020008bf0d2001fb00f002fb00f04fead0208df861004ff0010008bf0e2001fb00f002fb00f04fead0204ff000038df8620008bf0f235943299d51430020c90a002d8df863103ff427af289cc6f30010a7f13f0810ae0b9001e0013d1cd014f8010b411e1f29f8d341b220290fdb08eb400118f81000497840ea0122c12a06d3384651463346fef794f80028e5d14ff0ff3019b0bde8f08f0d9c2698ddf894b0a042c8bf04462a980894dde9289406300790cde909a704e058440b38013c834653d019f8010b1f28f6d908eb400118f81000497840ea0122c12ad8d3384651463346fef766f80028d1d00b980c9f069015a8cde90460ddf898a0229ddde90e010d9b239e3a46cde902ba00950196fff740fadde91201bb4558445144d8bfbb46a8422a46b8bf0246b142a8bf31465a4517dd089b994214dd2a9b1b680f2b10d8089ea2eb0b02a1eb060c079901ebc307ba802a9a21f833b0591c7e80a7f806c01160dde909a710aea8e7002019b0bde8f08f2de9f04fd3b0dde95ce5dde9648cdde9629a0d9075b1dde96050dde95e47a94224eae47b27eae774a8bf29468242a8bf024602e000244ff0000b09eb0e0008eb00055845c8bf83468d420ceb0a07b8bf2946a24588bf54469742b8bf3a468b45b8bf944202db53b0bde8f08f669804f0010701974fea5b07033809970bf101070090580008974e080c90002701200df14c0e0df10c0c02948ce80e00cde90a6b06e000bf0798012700284ff00000dad0c00707906698069708bf0830ddf800906ff007086ff004044ff0000b4ff0000a0f9018bf09f10809cdf838900f994fea5a00085c102300f0f002cc46a14610901194cdf8488000bf1cf8041f0eeb08001cf8014c9cf8015042ea141704f00f041443447242ea111401f00f01847211430eeb0904217242ea15119cf802600772617205f00f011143a17242ea1611817306f00f01114308f10808083b09f10809c173d1d11098ddf83890000110224b465d4600bf13f8041f0eeb050713f8014c5e7840ea141804f00f0404437c7440ea111401f00f010143f97440ea161193f802c0397506f00f010143797540ea1c11b9750cf00f010143083a05f1080587f81080bc74f975d5d1ddf84880119c0af1020a08f120082034baf1100f0bf1200b84d101980699049a48400299059b00eb01090399dde90a6b9145bff65baf0d9803fb090807e000bf0c9809f1020991458044bff64faf0d98dc4609fb03045feacb700bd0099dddf820c0605d1ef8007000f0f00007f00f0738446055b6eb5c0f28d94fea5c0a04eb060b464616f80a0006eb0a041ef80050204600f8015b58451dd205781ef80570a51c5d45077017d228781ef800002870e51c5d4510d2287804361ef80000287006eb0a055d45ddd306e000bf04eb5c05c80705d1b4e7651cdde90a6bc807afd08c45adda28781ef8007000f00f0007f0f00738442870a3e72de9f04f8bb01d9d6c68072c00f286802cb12f89b94200f08180012c7bd100287cd0d0f87061002e78d00027b7eb512f74d156f82170002f70d0a7eb060c5fea8c776bd16ff440370ceb070e40f60f07cff6fd77be4561d306eb0c0e5ef8086c8e425bd15ef80c6ca6f1011717f5803f54d35ef8047cb74250d1ccf54037be424cd8bef1000f49d0032e47d39ef80070022f43d19446aa69ddf86ca0dde91987dde917b9b2b14fead10801f00704da464ff0010b4f4612f808900bfa04f444ea090402f80840d346ddf86ca0b946dde919876c6805eb44021181721e1c9e01346c600996169e0ef101010396159e0a950296149ecde904b9cde900366346cde90687cdf820a0fbf795fa6968013969600bb0bde8f08f6f89b94204d14ff0ff300bb0bde8f08f022c3ff479afaf89b942f4d0032c3ff473afef89b942eed0042c3ff46daf2f8ab942e8d0052c3ff467af6f8ab942e2d0062c3ff461afaf8ab9427ff45dafdae700bf70b5049d8b42c8bf19469542b8bf2a46914205dadde905e3bef1000f01d103b170bdbef10f0c18bf9c46cb070ed04b10c45cbcf1000f03d004f00f05ae4504d904f0f00444ea0e04c45401314c1000eb61035510bcf1000f00eb620049d0ac425fda00bf1c78764604f00f05beeb141f38bf2609754598bf754645ea06141d4605f8014b854265d25c78764604f00f05beeb141f38bf2609754598bf75469c1c45ea061584425d7040d29c78764604f00f05beeb141f38bf2609754598bf7546dc1c45ea061584429d702fd2dc78764604f00f05beeb141f38bf2609754598bf754645ea06151c1ddd7084422346b9d31ce0ac4219da4eea0e1500bf1c4604f8015b844226d29c1c84425d700ed2dc1c84429d700ad21c1ddd7084422346edd304e01c46d00704d17ae71c46d0073ff477af9142bff674af2078bcf1000f03d0beeb101f98bf70bd00f00f0040ea0e10207070bd5c1cd007ebd161e72de9f04f81b04ef66c644ff29c55ccf2ff04c2f229054ff6ff7600274ff0010a47f67f7b4ff07f0807e000bf48f2a351c0f24501bff32f8f8847d5f80090bff35f8f2868bff35f8f01466ff39601b1f1005f07d10168a14204d14168b1f57d7f00f094804ff47d70f8f76af9002800f005814ff60c41cff6ff7100bf42182e3182f8f47382f8f57382f8f67382f8f77382f8f87382f8f97382f8fa7382f8fb7382f8fc7382f8fd7382f8fe7382f8ff7382f8007482f8017482f8027482f8037482f8047482f8057482f8067482f8077482f8087482f8097482f80a7482f80b7482f80c7482f80d7482f80e7482f80f7482f8107482f8117482f8127482f8137482f8147482f8157482f8167482f8177482f8187482f8197482f81a7482f81b7482f81c7482f81d7482f81e7482f81f7482f8207482f82174a0d14ff47d710460416080f80ea0a0f8c4b180f8c381068446848684c684068546858685c685068646868686c686068746878687c68755e8001f49457ff45aafbff35f8f45e8000121b155e8001f4945f8d04fe7d0f89812002974d104464ff41630f6f739f8014600284ff0000069d0002200bf8b1888544032b2f5163f58709870d870187158719871d871187258729872d872187358739873d873187458749874d874187558759875d875187658769876d876187758779877d87783f8200083f8210083f8220083f8230083f8240083f8250083f8260083f8270083f8280083f8290083f82a0083f82b0083f82c0083f82d0083f82e0083f82f0083f8300083f8310083f8320083f8330083f8340083f8350083f8360083f8370083f8380083f8390083f83a0083f83b0083f83c0083f83d0083f83e0083f83f009ad1c4f8981200e00021084601b0bde8f08f00bf70b5044690f8a00384f8a10350b3d4f8900347f64c6642f66535c2f20706c0f2440520b131682d31c4f8981310e040f22f00c0f200007844002122460023a847c4f89003316801f12d01c4f8981330b105f1e8022d219047002808bf70bd002084f8a10370bd00bf2de9f047a4b0d0f89442bff35f8fa4b142f691760546c0f2440620460021b04770b1d5f8900340b142f64d42c0f244022d2124b0bde8f047104724b0bde8f08747f64c69c2f20709d9f8007095f8a10300283fd0f7f7a4f8e0b3d5f89813781a17d495f8680110b995f82403e0b395f8a00385f8a10380b3d5f8900342f64d48c0f2440878b1d9f800102d31c5f898131de0d5f8900300b342f64d42c91bc0f24402904719e04ff64b70cff6ff70a8f1e807784400212a460023b847c5f89003d9f8001001f12d01c5f8981310b12d21c04710b1002085f8a10306f16601204624b0bde8f04708474af21f37c0f2470700200290adf80c00b84795f8680110b995f8240318b12846fff746ffe5e70df104084046f5f7a4fc02a9284600224ff0000afaf7ebfd81464046f5f7bffdb9f1000f02d085f8a1a303e00146284600f009f89df80c000028c7d107f14c008047c3e700bf2de9f04f90f8d13300f5697c4cf82310591c41f69a134b4390f8d0b31b0c03eb8303a1eb4301bbf1090f80f8d1139cbf0bf1010b80f8d0b3bbf1040f0bf0030e05d200244ff000094ff0000a2ee00bf0fc0800244ff000094ff0000a00eb8406d6f8a473d6f8a853b7fbfbf3d6f8ac1303eb090203fb1b73b5fbfbf7d6f8b06307fb1b5553443a44b1fbfbf72b44b6fbfbf53a4407fb1b1105eb020905fb1b6219440434a04502eb010ad7d1bef1000f1dd05cf82450bef1010fb5fbfbf606fb1b55b144aa4412d00ceb84056e68bef1020fb6fbfbf404fb1b66a144b24406d0ae68b6fbfbf505fb1b66a944b244bafbfbf202eb0901c0f8cc13bde8f08f00bff0b500294ff6ff7e00f0af80012903d10022c90775d1a8e021f00102c2f1000c6ff0010241f221038418a578e7788eea05252cb26e0036b203ead43484ea450503ead6366c0086ea450624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead53585ea460686ea07273eb27d002db203ead63686ea470703ead5357e0085ea470736b27d002db203ead63686ea470703ead5357e0085ea470736b27d002db203ead63686ea470703ead5357e0085ea470736b27d002db203ead636023286ea470703ead5360ceb0205023586ea470e95d10232c90733d0805c41f221038eea002001b2420012b203ead13181ea400003ead232410082ea400009b2420012b203ead13181ea400003ead232410082ea400009b2420012b203ead13181ea400003ead232410082ea400009b2420012b203ead13181ea400003ead23181ea400e1ffa8ef0f0bd2de9f04fcbb00646c07c8b468df80600b08954998df80700000a8df808008df80a10080af1898df80b00080a17468df80d000020012b8df805308df809b08df80c108df80e008df80f008df810008df811008df812008df813008df814008df815008df816008df817008df818008df819008df81a008df81b008df81c008df81d008df81e008df81f008df820008df821008df822004cd1307e96f81780a0f1090144f62510c2f29240a1fb0002891a02eb510100970df10500b8eb910f88bf4fea9108c8ebc80706f11a0400f1010a00f10509093021463a46f0f781ff06f1210506f1280029460722f0f779ff284621460722f0f774ff20465146032207f10905f0f76dff06f11d0049460422f0f767fff07d02289cbf0130f075009fbb450cd0b8f1240f13d94ff0ff304bb0bde8f08fbb454ff00905f07509d14ef60b67abb20df10502c0f247070120f02115e002200df12304aab28df82300a01c0df105018df82470f0f73bffa81c4af6610782b2c0f24607f02021460023b8474bb0bde8f08f2de9f04184b0044690f84d0000284ff0000000f09a8094f84f1042f28b0701f078018df8071094f85010c0f25b0701f007018df80610cde9020002a906200022b847054670b9002002adcde902000df1070128460122f0f701ff012029460122b847054694f84e00a8b1002602a906200022cde90266b84760b9cde9026602ae04f1540130460122f0f7e8fe572031460122b8470543002602a906200022cde90266b84768b90df108080df1060140460122cde90266f0f7d1fe312041460122b847054302a906200022cde90266b84768b9002002ae04f15301cde9020030460122f0f7bbfe462031460122b8470543002602a906200022cde90266b84768b90df1080804f1510140460222cde90266f0f7a4fe362041460222b847054302a9a3200022cde90266b847054302a997200022cde90266b84742f62b310543c0f2440102208847284615b104b0bde8f081002184f84e1084f84d10a16504b0bde8f08100bf2de9f04f8bb00190233002254ff000080df10c0a4ff001094ff0000b002402900be000bf09fa0bf0002f0bf1010b08bf0443bbf1070f354426d042f2ff10c0f20000784410f80b0042f2f911c0f20001794411f80b6042f2fb0351463246c0f25b03cde90988cde90788cde90588cde90388984707460028d4d10298514628443246f0f739fecde742f2fb00c0f25b004ff60073002600f1340703a9c0f21f0381200c22cde90966cde90766cde90566cde90366b84730b9029803a928440c22f0f71afe8026ddf804c040f6b80146ea0400220ac2f200018cf823008cf824200a68002a00f0ad8045f2fd774ff6ff766ff0020241f22103c0f202070d681544ed7886ea052635b203ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea46060d6824b2154403ead4342d7984ea460686ea052635b203ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea460624b275002db203ead43484ea460603ead535740085ea46060d6824b2154403ead4346d7984ea460686ea052635b2740024b203ead53585ea460603ead434750084ea46062db2740024b203ead53585ea460603ead434750084ea46062db2740024b203ead53585ea460603ead434750084ea46062db2740024b203ead53585ea460603ead4350332ba4285ea46067ff460afb1b2090a01e0ff26ff218cf83e109cf84c109cf84d208cf83f1026218cf83d608cf84020ff288cf84b101cbf04208cf81c000bb0bde8f08f70b588b042f2fb0514460e46c0f25b05002181280791cde90511cde90311cde90111009107d11b023435694681202246a84720b905e069462246a84708b108b070bd6946054630462246f0f71bfd284608b070bd2de9f0478cb08579972d17d00446fe2d0fd0fd2d2ad142f69570c0f25b008047002084f84e0084f84d00a0650cb0bde8f08720460cb0bde8f047cbe50020cde9040042f2fb00c0f25b00a0f1700304a9972000229847044642f62b31c0f244010220884720460cb0bde8f08742f2fb08002094f80c90677bc0f25b08cde90a00cde90800cde90600cde9040004a99f200422c047064620b901a804a90422f0f7c7fc002e6ff00100ddd19df80410bd29d9d19df805104029d5d19df806101029d1d194f84d00002852d047f64c60c2f20700006843f698210844a065002604a937200222cde90a66cde90866cde90666cde90466c047002840f0898002a804a90222f0f795fc04a947200122cde90a66cde90866cde90666cde90466c047002875d10df1030004a90122f0f781fc0020cde90a00cde90800cde90600cde9040004a905200122c047002860d10df1020004a9012249ea0726f0f76afc352d5bdc002d00f08180012d70d19df8020082e0002604a9052001228df80e60adf80c600296cde90a66cde90866cde90666cde90466c047d8bb0df1080a04a950460122f0f746fc04a935200122cde90a66cde90866cde90666cde90466c04738bb0af1010004a90122f0f733fc002604a937200222cde90a66cde90866cde90666cde90466c04798b90af1020004a90222f0f71ffc04a947200122cde90a66cde90866cde90666cde904660126c04778b14ff0ff300cb0bde8f087362d6ed0572d15d194f84e00002800f08580572039e00af1040004a90122f0f7fbfb04f14f0051460722f0f7f5fb84f84d603ee700208df801006946284601228df8009000f04ef9312d044627d036e09df80200002e00f0380618bf4036704010f0380f10d09df808009df8091041f6f6430e22c0f2000302ea96027b449a5a41ea0020904239d8012000218df80110694601228df8006000f024f904460df103014620012200f01df9054602a93620022200f017f945ea040141ea00040025a8f1700604a9a3200022cde90455b047044304a997200022cde90455b0470443aee69df802000e2101ea900041f67e41c0f200017944085a864204d96ff001000cb0bde8f0876946362002228df800708df8019000f0e6f80446d0e70020cde90a00cde90800cde90600cde9040004a9592001220125c04700287ff45caf04f1540004a90122f0f767fb84f84e5060e740f6b800c2f200000168002904bf4ff0ff30704780b584b000684ef2173102904ff41630039002a8c0f2470188474ff4f07042f29f7e01904ff4207cc0f25b0e0020002100220023cdf800c0f04704b080bd00bf2de9f04340f6b801c2f2000109684ff0000e01f1020c4cf6cd4340f2762808e00ef1010ebef5f07f0cf5a07c08bfbde8f083aef1a0096ff00906644607e000bf07eb0711a170053445452e46e8d290f84c1006f10a054f1e112905fb03f208bf570d122908d1a6f1e6019f294ff000079cbfb9f19f0f077b07eb071104f8021c90f84c1006f10c024f1e112903fb02f208bf570d122908d1a6f1e4019f294ff000079cbfb9f19f0f077b07eb071104f8011c90f84c1006f10e024f1e112903fb02f208bf570d122908d1a6f1e2019f294ff000079cbfb9f19f0f077b07eb0711217090f84c1006f110024f1e112903fb02f208bf570d122908d1a6f1e0019f294ff000079cbfb9f19f0f077b07eb0711617090f84c1006f112024f1e112903fb02f208bf570d12298ad1a6f1de019f294ff000079cbfb9f19f0f077b80e700bf2de9f04383b042f28b0914460e460546c0f25b090027694606200022cde90077c84710b103b0bde8f083e846404631462246cde90077f0f77dfa284641462246c84703b0bde8f08370b50446d0f840010d4638b92046f6f7cdf90028c4f8400108bf70bd42f64d46c0f2440606f140018847d4f8400129463246bde8704010472de9f04f81b0934612788ab1022300bf0beb030717f8012c62b11bf8032062b17a784ab1ba780433002af1d1023b04e0002205e0013b00e0013303eb4302520042eae272931c02f1010c01eb810203f0030e23f0030a00eb8213a3f5a0784ff0ff3906e009f10109b9f10d0f08f5a0786bd009eb010202eb8202bcf1030f00eb821605d24ff0ff34bef1000f2ed1e9e70024474604e000bfa24507f1020721d0621cd209042a03d83a7802f0f0023a70a21cd209042a03d87a7802f00f027a70e21cd209042a03d87a7802f0f0027a700434e209042adfd86208b55c05f00f05b554d9e7013cbef1000fbbd0a21cd509042d08d85208b55ce7076ff00f0708bf0f273d40b554bef1010fabd0e21cd509042d09d85208b55ce7074ff00f0708bf6ff00f073d40b554bef1020f9ad0221dd509042d96d85208e407b55c6ff00f0408bf0f242c40b4548ce79bf80010cdf800b0002900f0ce80022041f2410a41f2420b41f2430808e0009a063012f8011f03330029009200f0bd80a1f17f0717f15f0ff1d341f2f932c0f2000201eb41017a4402eb81014ff20014a1f5c079cff6ff7402e014f52074ded0494619f9027bc509042d09d8b7f1ff3f06dc1a1992f8016f46f0f00682f8016f5ffa87fe5fea4e6208d5042d06d81a1992f8017f47f00f0782f8017f5fea8e620ad540f27d22904206d81a1992f8027f47f0f00782f8027f5feace6209d5b0f51f7f06d81a1992f8027f47f00f0782f8027f5fea0e724fea900c09d5bcf19e0f06d81a1992f8036f46f0f00682f8036f5fea4e720ad540f27a22904206d81a1992f8037f47f00f0782f8037f91f90110042d09d8b1f1ff3f06dc1a1912f80a7047f0f00702f80a70c9b24a0608d5042d06d81a1912f80a7047f00f0702f80a708a060ad540f27d22904206d81a1912f80b7047f0f00702f80b70ca0609d5b0f51f7f06d81a1912f80b7047f00f0702f80b700a0709d5bcf19e0f06d81a1912f8087047f0f00702f8087049077ff565af40f27a2188423ff660af191911f8082042f00f0201f8082057e701b0bde8f08f00bf2de9f04381b04ff29c51c2f229010f68044638466ff39600b0f1005fbff35f8f0cd138684ef66c61ccf2ff01884205d17868b0f57d7f18bf002700e0002745f64d50c0f24600804741f2d161c0f2000141f2d662c0f2000279447a44022808bf0a4641f2b861c0f2000179440128204618bf114600f074fe47b197f87b0180b141f2b661c0f20001794419e041f2a361c0f200017944204601b0bde8f04300f05fbe97f8740141f29062c0f2000241f28d61c0f2000179447a44002808bf1146204600f04dfe97f8750141f26d62c0f2000241f27761c0f200017944012820467a4408bf114600f03bfe41f26561c0f200017944204600f033fe97f9c311204600f022ff41f25161c0f200017944204600f026fef6f7a2fd41f23368c0f2000841f23f66c0f200067e44054600f003003146f844012808bf414641f21d69c0f2000902282046f94408bf494600f008fea808012808bf4646022808bf4e462046314600f0fdfd41f2fb51c0f200017944204600f0f5fdd7f8840198b147f64c61c2f207010a68821a012a0bdb0968401a44f6d35100f2e730c1f26201a0fb0101890900e00021204600f0eafe41f2bd51c0f200017944204600f0d2fdd7f8bc11204600f0ddfe41f2aa51c0f200017944204600f0c5fdb7f8c011204600f0d0fe41f29251c0f200017944204600f0b8fd97f8c211204600f0c3fe41f27b51c0f200017944204600f0abfdb7f8c611204600f0b6fe41f26855c0f200057d442046294600f09dfdb7f8c811204600f0a8fe2046294600f094fdb7f8ca11204600f09ffe41f23c51c0f200017944204600f087fdd7f88011204600f092fe41f22751c0f200017944204600f07afd97f9c511204600f069fe41f21351c0f200017944204600f06dfd97f9c411204601b0bde8f04300f059be00bf2de9f04f81b0134681464a1c00f08f808e0a4ff0000b19f80b20002a00f0888109eb0b077a78002a00f00a81ba78002a00f00981fa78002a00f008813a79002a00f007817a79002a00f00681ba79002a00f00581fa79002a00f004813a7a002a00f003817a7a002a00f00281ba7a002a00f00181fa7a002a00f000813a7b002a00f0ff807a7b002a00f0fe80ba7b002a00f0fd80fa7b002a00f0fc803a7c002a00f0fb807a7c002a00f0fa80ba7c002a00f0fb80fa7c002a00f0fc803a7d002a00f0fd807a7d002a00f0fe80ba7d002a00f0ff80fa7d002a00f000813a7e002a00f001817a7e002a00f00281ba7e002a00f00381fa7e002a00f004813a7f002a00f005817a7f002a00f00681ba7f002a00f00781fa7f002a00f008810bf1200bbbf1600f7ff477af4ff0600b00e1002119f80120002a00f0af8109eb01056a78002a00f0b080aa78002a00f0b180ea78002a00f0b2802a79002a00f0b3806a79002a00f0b480aa79002a00f0b580ea79002a00f0b6802a7a002a00f0b7806a7a002a00f0b880aa7a002a00f0b980ea7a002a00f0ba802a7b002a00f0bb806a7b002a00f0bc80aa7b002a00f0bd80ea7b002a00f050812a7c002a00f04e816a7c002a00f04c81aa7c002a00f04a81ea7c002a00f048812a7d002a00f046816a7d002a00f04481aa7d002a00f04281ea7d002a00f040812a7e002a00f03e816a7e002a00f03c81aa7e002a00f03a81ea7e002a00f038812a7f002a00f036816a7f002a00f03481aa7f002a00f03281ea7f002a00f03081203160297ff479af32e10bf1010b74e00bf1020b71e00bf1030b6ee00bf1040b6be00bf1050b68e00bf1060b65e00bf1070b62e00bf1080b5fe00bf1090b5ce00bf10a0b59e00bf10b0b56e00bf10c0b53e00bf10d0b50e00bf10e0b4de00bf10f0b4ae00bf1100b47e00bf1110b44e00131f6e00bf1120b3fe00231f1e00bf1130b3ae00331ece00bf1140b35e00431e7e00bf1150b30e00531e2e00bf1160b2be00631dde00bf1170b26e00731d8e00bf1180b21e00831d3e00bf1190b1ce00931cee00bf11a0b17e00a31c9e00bf11b0b12e00b31c4e00bf11c0b0de00c31bfe00bf11d0b08e00d31bae00bf11e0b03e00e31b5e00bf11f0bb1f5205f4ff0010100931fd364234ff47a7442f2107700bf01eb81025200b6fbf2f50a2d11d301fb03f2b6fbf2f50a2d0bd301fb04f2b6fbf2f50a2d05d37943b6fbf1f2092ae7d800e011465846bbf15f0f98bf5f20c0f1000c1ceb0b0a53d0b6fbf1f74cf6cd4207f13003ccf6cc4209f80b300a29a1fb023547d31af1010342d007fb11674fead508b7fbf8fe48f21f520ef1300309eb0b06c5f2eb1273706429a1fb023434d31af102032cd00efb18776409b7fbf4f544f6d35205f13003c1f26202b370b1f57a7fa1fb022323d31af1030218d005fb14729b0941f25975b2fbf3f7cdf2b715a1fb055407f13005f57007fb132642f210720bf1040b91424fea5431a9d209e0834607e00bf1010b04e00bf1020b01e00bf1030b0020009b09f80b002de00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d849444ff03f020a7003d1002189f85f1001e000204870002119f80100002800f0a18009eb0105687800285ed0a87800285dd0e87800285cd0287900285bd0687900285ad0a879002859d0e879002858d0287a002857d0687a002856d0a87a002855d0e87a002854d0287b002853d0687b002852d0a87b002851d0e87b002850d0287c00284fd0687c00284ed0a87c00284dd0e87c00284cd0287d00284bd0687d00284ad0a87d002849d0e87d002848d0287e002847d0687e002846d0a87e002845d0e87e002844d0287f002843d0687f002842d0a87f002841d0e87f002840d0203160297ff498af44e001313ae0023138e0033136e0043134e0053132e0063130e007312ee008312ce009312ae00a3128e00b3126e00c3124e00d3122e00e3120e00f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2905d849444ff02f00087040f09580002089f85f00581c00f094809d0a4ff0000e19f80e00002800f08d8109eb0e067078002800f00f81b078002800f00e81f078002800f00d813079002800f00c817079002800f00b81b079002800f00a81f079002800f00981307a002800f00881707a002800f00781b07a002800f00681f07a002800f00581307b002800f00481707b002800f00381b07b002800f00281f07b002800f00181307c002800f00081707c002800f0ff80b07c002800f00081f07c002800f00181307d002800f00281707d002800f00381b07d002800f00481f07d002800f00581307e002800f00681707e002800f00781b07e002800f00881f07e002800f00981307f002800f00a81707f002800f00b81b07f002800f00c81f07f002800f00d810ef1200ebef1600f7ff477af4ff0600e05e100204870581c7ff46caf002119f80100002800f0aa8109eb01025078002800f0b0809078002800f0b180d078002800f0b2801079002800f0b3805079002800f0b4809079002800f0b580d079002800f0b680107a002800f0b780507a002800f0b880907a002800f0b980d07a002800f0ba80107b002800f0bb80507b002800f0bc80907b002800f0bd80d07b002800f04b81107c002800f04981507c002800f04781907c002800f04581d07c002800f04381107d002800f04181507d002800f03f81907d002800f03d81d07d002800f03b81107e002800f03981507e002800f03781907e002800f03581d07e002800f03381107f002800f03181507f002800f02f81907f002800f02d81d07f002800f02b81203160297ff479af2de10ef1010e74e00ef1020e71e00ef1030e6ee00ef1040e6be00ef1050e68e00ef1060e65e00ef1070e62e00ef1080e5fe00ef1090e5ce00ef10a0e59e00ef10b0e56e00ef10c0e53e00ef10d0e50e00ef10e0e4de00ef10f0e4ae00ef1100e47e00ef1110e44e00131f1e00ef1120e3fe00231ece00ef1130e3ae00331e7e00ef1140e35e00431e2e00ef1150e30e00531dde00ef1160e2be00631d8e00ef1170e26e00731d3e00ef1180e21e00831cee00ef1190e1ce00931c9e00ef11a0e17e00a31c4e00ef11b0e12e00b31bfe00ef11c0e0de00c31bae00ef11d0e08e00d31b5e00ef11e0e03e00e31b0e00ef11f0e0122b3f5205f1ed364234ff47a7442f2107602eb82004100b5fbf1f00a2811d302fb03f1b5fbf1f00a280bd302fb04f1b5fbf1f00a2805d37243b5fbf2f00928e7d800e00a46f046bef15f0f98bf4ff05f08c8f1000c42f2107a1ceb0e074dd0b5fbf2f30a2a03f1300009f80e004cf6cd40ccf6cc40a2fb000641d3781c3dd003fb1253f608b3fbf6f409eb0e0504f13000687048f21f50c5f2eb10642aa2fb000130d3b81c29d004fb16334e09b3fbf6f4b2f57a7f04f13000a87044f6d350c1f26200a2fb000120d3f81c16d004fb1630890941f25974b0fbf1f3cdf2b714a2fb044603f13004ec7003fb11050ef1040e52454fea5632afd209e0c64607e00ef1010e04e00ef1020e01e00ef1030e002009f80e0001b0bde8f08f0f311ee010311ce011311ae0123118e0133116e0143114e0153112e0163110e017310ee018310ce019310ae01a3108e01b3106e01c3104e01d3102e01e3100e01f315f2904d849444ff03f00087005d1002089f85f0001b0bde8f08f0020487001b0bde8f08f2de9f0411f22831813f81f7c002f00f0808013f81e7c002f7dd013f81d7c002f7bd013f81c7c002f79d013f81b7c002f77d013f81a7c002f75d013f8197c002f73d013f8187c002f71d013f8177c002f6fd013f8167c002f6dd013f8157c002f6bd013f8147c002f69d013f8137c002f67d013f8127c002f65d013f8117c002f63d013f8107c002f61d013f80f7c002f5fd013f80e7c002f5dd013f80d7c002f5bd013f80c7c002f59d013f80b7c002f57d013f80a7c002f55d013f8097c002f53d013f8087c002f51d013f8077c002f4fd013f8067c002f4dd013f8057c002f4bd013f8047c002f49d013f8037c002f47d013f8027c002f45d013f8013c002b43d0835c002b41d020327f2a7ff47baf64e01f3a3ae01e3a38e01d3a36e01c3a34e01b3a32e01a3a30e0193a2ee0183a2ce0173a2ae0163a28e0153a26e0143a24e0133a22e0123a20e0113a1ee0103a1ce00f3a1ae00e3a18e00d3a16e00c3a14e00b3a12e00a3a10e0093a0ee0083a0ce0073a0ae0063a08e0053a06e0043a04e0033a02e0023a00e0013a5f2a25d8c2f15d0cc2f15e0ec2f15f03c2f160080244002509e000bffc78002cf47008bfbde8f0810435a84510d04e5d565586b1ab420bd04f197c78561974704cb1ae4504d0bc78b47024b1ac45e5d1002180f85f10bde8f08100bf7f2905d140f61301c0f20001794403e7b1f1ff3fc8bf0fe0b0b540f2fd72c0f200027a440d4611460446fff7f5fe20466942bde8b040ffe72de9f04f4ff0000c10f80c20002a00f0c48000eb0c035a78002a62d09a78002a62d0da78002a62d01a79002a62d05a79002a62d09a79002a62d0da79002a62d01a7a002a62d05a7a002a62d09a7a002a62d0da7a002a62d01a7b002a62d05a7b002a62d09a7b002a62d0da7b002a62d01a7c002a62d05a7c002a62d09a7c002a62d0da7c002a62d01a7d002a62d05a7d002a62d09a7d002a62d0da7d002a62d01a7e002a62d05a7e002a62d09a7e002a62d0da7e002a62d01a7f002a62d05a7f002a62d09a7f002a62d0da7f002a62d00cf1200cbcf1600f7ff496af4ff0600c5be00cf1010c58e00cf1020c55e00cf1030c52e00cf1040c4fe00cf1050c4ce00cf1060c49e00cf1070c46e00cf1080c43e00cf1090c40e00cf10a0c3de00cf10b0c3ae00cf10c0c37e00cf10d0c34e00cf10e0c31e00cf10f0c2ee00cf1100c2be00cf1110c28e00cf1120c25e00cf1130c22e00cf1140c1fe00cf1150c1ce00cf1160c19e00cf1170c16e00cf1180c13e00cf1190c10e00cf11a0c0de00cf11b0c0ae00cf11c0c07e00cf11d0c04e00cf11e0c01e00cf11f0c01230a291fd364274ff47a7642f2107500bf03eb83025200b1fbf2f40a2c11d303fb07f2b1fbf2f40a2c0bd303fb06f2b1fbf2f40a2c05d36b43b1fbf3f2092ae7d800e01346e2464cf6cd49bcf15f0f98bf4ff05f0acaf1000eccf6cc491eeb0c0b4ed0b1fbf3f50a2b05f1300200f80c20a3fb092446d31bf1010241d005fb1316e508b6fbf5f800eb0c0108f130024a7048f21f52c5f2eb12642ba3fb022434d31bf102022cd008fb15656609b5fbf6f4b3f57a7f04f130028a7044f6d352c1f26202a3fb027223d31bf1030718d004fb1654920941f25976b4fbf2f5cdf2b716a3fb066705f13006ce7005fb124142f210720cf1040c93424fea5733aed209e0d44607e00cf1010c04e00cf1020c01e00cf1030c002100f80c10bde8f08f0000434d01ffff0000000000000052420100ff000000080310000000000000000000080010631a2308011a1c0800100018c00420a0024801520964617368626f617264580162012028904e46616365636c61772f33380000000000000000000000000000002020202020002020000000505050000000000000000000005050f85050f85050000000002070a8a07028a8702000000048a85010202854480000000020505020689090680000002020200000000000000000000010204040404020100000000040201010101020400000000000005020f82050000000000000002020f82020000000000000000000000020204000000000000000f800000000000000000000000000202000000000080810102020404000000000708898a8c88888700000000020602020202020700000000070888808102040f8000000007088083008088870000000000818284888f8080800000000f88080f00808887000000000708080f08888887000000000f808081010202020000000007088887088888870000000007088888878080870000000000000202000002020000000000000202000002020400000000008102040201008000000000000f80000f8000000000000004020100810204000000000708888102000202000000000708898a8a89880780000000070888888f888888800000000f08888f0888888f000000000708880808080887000000000e0908888888890e000000000f88080f0808080f800000000f88080f0808080800000000070888080b888887000000000888888f888888888000000007020202020202070000000003810101010909060000000008890a0c0c0a090880000000080808080808080f80000000088d8a8a888888888000000008888c8a89888888800000000708888888888887000000000f0888888f080808000000000708888888888a87008000000f0888888f0a0908800000000708880700808887000000000f8202020202020200000000088888888888888700000000088888850505020200000000088888888a8a8d88800000000888850202050888800000000888850502020202000000000f8081020408080f8000000007040404040404070000000004040202010100808000000007010101010101070000000205088000000000000000000000000000000000000f80040200000000000000000000000000000700878888878000000008080f088888888f00000000000007088808088700000000008087888888888780000000000007088f8808078000000001820702020202020000000000000788888888878087000008080f08888888888000000202000602020202070000000080800180808080808483000004040485060605048000000006020202020202070000000000000f0a8a8a8a8a8000000000000f08888888888000000000000708888888870000000000000f088888888f0808000000000788888888878080800000000b8c0808080800000000000007880700808f00000000020207020202020180000000000008888888888780000000000008888505020200000000000008888a8a8a870000000000000885020205088000000000000888888888878087000000000f810204080f800000000182020402020201800000000202020202020202000000000601010081010106000000048a89000000000000000009f0535593747c181040101010201020c005353a829c51bd314a810260d5b0bfe096d6963205220006d6963204c20006d6963203f20006e6f206374780061726d200063666720006f6666200070646d00636f646563002072656720002074626c2000540053002d00206c65617365200073207461702000200042400020736b697020002f002066722000206e7466200020756e7265672000000000", "desc": "append injected blobs to main-app payload" }, { "offset": 779123, "old": "805a3900", - "new": "48703a00", + "new": "68703a00", "desc": "main-app subheader payload size (ps)" }, { "offset": 152, "old": "005b3900", - "new": "c8703a00", + "new": "e8703a00", "desc": "main-app TOC entry size (ps + 128)" }, { "offset": 779243, "old": "805a3904", - "new": "48703a04", + "new": "68703a04", "desc": "main-app preamble length (low 24 bits)" }, { "offset": 779247, "old": "effdbcea", - "new": "6a8cfe55", + "new": "0b0c48b0", "desc": "[5] ota/s200_firmware_ota.bin preamble crc32" }, { "offset": 156, "old": "c0c6322a", - "new": "7f295d98", + "new": "52937d21", "desc": "[5] ota/s200_firmware_ota.bin component crc32c (TOC)" }, { "offset": 779127, "old": "c0c6322a", - "new": "7f295d98", + "new": "52937d21", "desc": "[5] ota/s200_firmware_ota.bin component crc32c (subheader)" } ] diff --git a/app/g2/ios-preview-controller.ts b/app/g2/ios-preview-controller.ts index 982f0904..c10f984e 100644 --- a/app/g2/ios-preview-controller.ts +++ b/app/g2/ios-preview-controller.ts @@ -4,7 +4,7 @@ import { acceptInput, resetRingInputFilter } from "../ui/input-monitor"; import { bindIosNotifications, iosNotificationsChanged, onIosNotificationPopup, readActiveNotifications } from '../native/notification-icons.ios' import { shouldShowNotificationOnGlasses } from '../native/notification-sources' import { launcherEntries } from '../apps/launcher' -import { getInstalledEvenHubAppById, installedEvenHubPackageId, uninstallEvenHubPackage } from '../apps/evenhub/installed-apps' +import { discardZeroedEvenHubPackage, getInstalledEvenHubAppById, installedEvenHubPackageId, uninstallEvenHubPackage } from '../apps/evenhub/installed-apps' import { isInstalledPackagePresent } from '../apps/evenhub/updates' import { openEvenHubStoreForPackage } from '../apps/evenhub' import { launchInstalledPackage, closeRunningPackage, onPhoneShownChanged, phoneUiButton, showOnPhone, type PhoneUiButton } from '../apps/evenhub/manager' @@ -14,6 +14,7 @@ import { registerNavigateTools } from '../assistant/navigate-tools' import { registerRoamTools } from '../assistant/roam-tools' import { IosNavigationSensors } from '../native/ios-navigation-sensors' import { bindCompassSession, receiveCompassEvent } from '../native/compass.ios' +import { bindBandwidthBenchmarkSession } from '../native/bandwidth-benchmark.ios' import { Dialogs, File, knownFolders, path, Utils, type ImageSource } from '@nativescript/core' import { iosVoiceInput } from '../native/ios-voice-input' import { voiceActivity } from '../ui/shell/voice-activity' @@ -31,6 +32,7 @@ import { firmwareIncompatibilityMessage, hasCompatibleFirmware } from './firmwar import { isHaltedSessionPhase, suppressAutoReconnect } from './reconnect-policy' import { deviceAddressError } from './ios-peripheral-identity' import { createLauncherWindow, LAUNCHER_SURFACE_ID } from '../apps/launcher/launcher-app' +import { createNotificationsAppWindow, NOTIFICATIONS_SURFACE_ID, NOTIFICATIONS_WINDOW_ID } from '../apps/notifications/notifications-app' import { ALL_APPS } from '../apps/all-apps' import type { AppContext, AppDefinition, AppLaunchParams } from '../apps/app-definition' import { WorkerAppHost } from '../ui/shell/worker-window' @@ -65,7 +67,7 @@ const FRAME_TRANSMIT_BACKPRESSURE_TIMEOUT_MS = 2000 export type SessionPhase = 'disconnected' | 'connecting' | 'connected' | 'retrying' | 'disconnecting' | 'error' export type SessionState = { phase: SessionPhase; status: string; battery: number | null; charging: boolean | null; - ring: boolean; frames: number; capabilities: string; leftVersion: string; rightVersion: string; + ring: boolean; ringBattery: number | null; ringCharging: boolean | null; frames: number; capabilities: string; leftVersion: string; rightVersion: string; /** Why the connected firmware can't run Faceclaw (firmware-compat.ts), or '' when it can or is unknown. */ firmwareWarning: string } @@ -84,7 +86,7 @@ export class IosPreviewController { private communicator: FaceclawCommunicatorBridge | null = null private readonly startedCommunicators = new WeakSet() state: SessionState = { phase: 'disconnected', status: 'Preview only', battery: null, charging: null, ring: false, - frames: 0, capabilities: '', leftVersion: '', rightVersion: '', firmwareWarning: '' } + ringBattery: null, ringCharging: null, frames: 0, capabilities: '', leftVersion: '', rightVersion: '', firmwareWarning: '' } private notifications: AncsClient | null = null private readonly sessionOffs: (() => void)[] = [] private stopping: Promise | null = null @@ -131,6 +133,8 @@ export class IosPreviewController { private clockMinute = -1 private shellRenderInProgress = false private shellRenderQueued = false + /** The shell woke; the next shell render unblanks the compositor after submitting. */ + private unblankAfterShellRender = false private nextFrameId = 1 private nextWorkerFrame = 0 private inputQueue: Promise = Promise.resolve() @@ -149,11 +153,12 @@ export class IosPreviewController { private logLines: string[] = [] private logTimer: ReturnType | null = null // Windows that want continuous capture, and what each needs of it (a - // recording, a multilingual provider). They share one capture, which runs + // recording, a provider and language). They share one capture, which runs // while any of them wants it. private readonly continuousClients = new Map() - // transcriptionKey of the running continuous capture's provider; one that no - // longer matches what its windows need is drained and restarted. + // transcriptionKey of the running continuous capture (provider and + // language); one that no longer matches what its windows need is drained + // and restarted. private continuousTranscription = '' // Continuous capture should (re)start once audio is available: a window // asked, the glasses connected or disconnected, or the glasses lock or the @@ -198,11 +203,16 @@ export class IosPreviewController { send: () => { if (this.active && !this.glassesLocked) session.send() }, sendTo: id => { if (this.active && !this.glassesLocked) session.sendTo(id) }, discard: () => session.discard(), + get visibility() { return session.visibility }, + setVisibility: visibility => { if (this.active && !this.glassesLocked) session.setVisibility(visibility) }, + get history() { return session.history }, } : null), prepareVoiceCapture: () => this.prepareVoiceCapture(), getScreenTimeoutMs: () => null, requestShellRender: () => this.requestShellRender(), onWindowsChanged: () => { this.requestShellRender(); this.syncEvenHubPhoneUi() }, + openNotificationsWindow: () => + this.openInProcessAppInBackground(NOTIFICATIONS_WINDOW_ID, NOTIFICATIONS_SURFACE_ID, createNotificationsAppWindow), onSwitcherBarHeightChanged: () => { this.relayout() shell.foregroundWindow()?.requestRender() @@ -210,7 +220,12 @@ export class IosPreviewController { }, onScreenStateChanged: on => { if (on) this.glance.dismiss() - void this.display?.setScreenBlanked(!on).catch(error => this.fail(error)) + // A wake unblanks only once the next shell render has staged an awake + // scene: unblanking composites the retained one, painted while asleep + // with no chrome and depth 0, and that first frame is the one the + // brightness fade-in starts on. + this.unblankAfterShellRender = on + if (!on) void this.display?.setScreenBlanked(true).catch(error => this.fail(error)) this.requestShellRender() }, }) @@ -442,6 +457,7 @@ export class IosPreviewController { iosVoiceInput.handleSessionEnded('Glasses locked. Unlock your phone to start voice input again.', 'Glasses locked. Transcription resumes when you unlock your phone.') } else this.syncContinuousCapture() + this.syncRawMicSession() void (async () => { await this.displayReady const display = this.display @@ -519,10 +535,19 @@ export class IosPreviewController { await this.displayReady const display = this.display if (!display) return - const startedAt = Date.now() - const bytes = shell.paintScene() + // Taken with the paint, so a render that painted before the wake can't unblank. + const unblank = this.unblankAfterShellRender + this.unblankAfterShellRender = false const frameId = this.allocateFrameId() - await display.submitShellScene(bytes, Date.now() - startedAt, frameId) + try { + const startedAt = Date.now() + const bytes = shell.paintScene() + await display.submitShellScene(bytes, Date.now() - startedAt, frameId) + } finally { + // Even if the render failed, so the screen doesn't stay dark; not if it + // went back to sleep meanwhile (that sleep re-blanked). + if (unblank && shell.isScreenOn()) await display.setScreenBlanked(false) + } // Backpressure: the next shell render waits for this one to reach the // glasses (the preview target resolves immediately; nothing transmits). await display.waitForFrameFinished(frameId, FRAME_TRANSMIT_BACKPRESSURE_TIMEOUT_MS) @@ -601,6 +626,7 @@ export class IosPreviewController { const { nx, ny } = mirrorToPanelFraction(this.previewCrop, mirrorNx, mirrorNy) const x = Math.max(0, Math.min(639, Math.floor(nx * 640))) const y = Math.max(0, Math.min(479, Math.floor(ny * 480))) + if (!shell.hasOverlay() && shell.focusStatusItemAt(x, y)) { this.requestShellRender(); return } const window = shell.foregroundWindow() if (!shell.hasOverlay() && sidebarStripVisible(shell.getFocus(), window?.appId) && isOnSwitcherEdge(x, y, window?.heightMode ?? 'min', window?.appId)) { @@ -624,9 +650,15 @@ export class IosPreviewController { const host = ALL_APPS.find(candidate => candidate.appId === 'evenhub') if (installed && host) { try { - if (isInstalledPackagePresent(installed.packageId)) - await launchInstalledPackage(this.buildAppContext({ ...host, appId: id }), installed) - else await openEvenHubStoreForPackage(this.buildAppContext(host), installed) + if (isInstalledPackagePresent(installed.packageId)) { + try { await launchInstalledPackage(this.buildAppContext({ ...host, appId: id }), installed); return } + catch (error) { + // Checked only after a failure: it reads the whole package again. + if (!discardZeroedEvenHubPackage(installed.packageId)) throw error + console.log(`[ios-preview] Discarded zeroed package for ${installed.packageId}; opening store page`) + } + } + await openEvenHubStoreForPackage(this.buildAppContext(host), installed) } catch (error) { this.fail(error) } } @@ -656,6 +688,7 @@ export class IosPreviewController { appId: app.appId, apps: ALL_APPS, actions: this.actions, launchApp: (id, params) => this.launchApp(id, params), uninstallApp: id => this.uninstallApp(id), launchInProcessApp: (id, surface, create) => this.launchInProcessApp(id, surface, create), + openInProcessAppInBackground: (id, surface, create) => this.openInProcessAppInBackground(id, surface, create), ensureWorkerHost: create => this.ensureWorkerHost(app.appId, create), submitWindowFrame: (id, planes) => this.submit(id, planes), setWindowSurfaceVisible: (id, visible) => this.setWindowSurfaceVisible(id, visible), @@ -667,14 +700,44 @@ export class IosPreviewController { create: (options: InProcessAppOptions) => InProcessWindow): Promise { const existing = this.inProcessApps.get(windowId) if (existing) { shell.focusWindow(windowId); existing.requestRender(); this.requestShellRender(); return } - // Apps can request a render while their factory runs (Nightscout's tray - // subscription does). The surface only exists once the factory returns. - // The explicit render below supplies a fresh frame after configuration. - let surfaceReady = false + const { app, surface } = this.createInProcessApp(windowId, surfaceId, create) + await this.configureWindow(app.window) + surface.ready = true + shell.registerWindow(app.window); shell.focusWindow(windowId) + app.requestRender(); this.requestShellRender() + } + /** + * An in-process singleton app's window, opened in the background (neither + * foregrounded nor focused) unless it is open already, for the shell to + * bring forward itself: the Notifications window under a notification + * selected in the switcher, or an app widget's window under the widget. + * Display calls run in order and frames wait on displayReady before + * queueing, so the surface configure queued here lands ahead of any frame + * and of the shell foregrounding the window, which it may do at once. + */ + private openInProcessAppInBackground(windowId: string, surfaceId: string, + create: (options: InProcessAppOptions) => InProcessWindow): { window: InProcessWindow; opened: boolean } { + const existing = this.inProcessApps.get(windowId) + if (existing) return { window: existing, opened: false } + const { app, surface } = this.createInProcessApp(windowId, surfaceId, create) + void this.configureWindow(app.window).catch(error => this.fail(error)) + surface.ready = true + shell.registerWindow(app.window) + return { window: app, opened: true } + } + /** + * Create an in-process singleton app's window (not yet registered with the + * shell). Its frames reach the compositor only while `surface.ready`: apps + * can request a render while their factory runs (Nightscout's tray + * subscription does), before the caller has configured the surface. + */ + private createInProcessApp(windowId: string, surfaceId: string, + create: (options: InProcessAppOptions) => InProcessWindow): { app: InProcessWindow; surface: { ready: boolean } } { + const surface = { ready: false } const app = create({ - actions: this.actions, submitFrame: planes => surfaceReady ? this.submit(surfaceId, planes, () => surfaceReady) : Promise.resolve(), + actions: this.actions, submitFrame: planes => surface.ready ? this.submit(surfaceId, planes, () => surface.ready) : Promise.resolve(), setSurfaceVisible: visible => this.setWindowSurfaceVisible(surfaceId, visible), - removeSurface: () => { surfaceReady = false; this.removeWindowSurface(surfaceId) }, + removeSurface: () => { surface.ready = false; this.removeWindowSurface(surfaceId) }, reconfigureSurface: () => { const window = shell.getWindows().find(w => w.windowId === windowId) if (window) void this.configureWindow(window).catch(error => this.fail(error)) @@ -683,10 +746,7 @@ export class IosPreviewController { onClosed: () => { this.inProcessApps.delete(windowId) }, }) this.inProcessApps.set(windowId, app) - await this.configureWindow(app.window) - surfaceReady = true - shell.registerWindow(app.window); shell.focusWindow(windowId) - app.requestRender(); this.requestShellRender() + return { app, surface } } private ensureWorkerHost(appId: string, create: () => Worker): WorkerAppHost { const existing = this.appHosts.get(appId) @@ -738,14 +798,22 @@ export class IosPreviewController { this.pushBrightness() this.maybeLaunchOnboarding(this.state) if (this.state.phase !== 'connected' && this.state.phase !== 'connecting') this.glassesWorn = null + // Unbound first, so a speech capture ending below doesn't hand the mic back to the dead session. + this.syncRawMicSession() if (this.state.phase !== 'connected') iosVoiceInput.handleSessionEnded() this.syncContinuousSession() - shell.setBatteryLevels({ headset: this.state.battery, headsetCharging: this.state.charging }) + this.pushBatteryLevels() this.syncPresence() this.syncRuntime() if (this.active) this.onConnectionState({ ...this.state }) this.requestShellRender() } + /** The ring level arrives through the glasses, so like Android it is shown only while connected. */ + private pushBatteryLevels(): void { + const connected = this.state.phase === 'connected' + shell.setBatteryLevels({ headset: this.state.battery, headsetCharging: this.state.charging, + ring: connected ? this.state.ringBattery : null, ringCharging: connected ? this.state.ringCharging : null }) + } async connect(): Promise { if (!this.active || this.connecting || this.stopping) return if (this.communicator && ['connecting', 'connected', 'retrying', 'disconnecting'].includes(this.state.phase)) return @@ -754,7 +822,8 @@ export class IosPreviewController { this.connecting = true this.sessionCreated = true try { - this.state = { ...this.state, capabilities: '', leftVersion: '', rightVersion: '', firmwareWarning: '', battery: null, charging: null, ring: false } + this.state = { ...this.state, capabilities: '', leftVersion: '', rightVersion: '', firmwareWarning: '', battery: null, charging: null, ring: false, + ringBattery: null, ringCharging: null } this.firmwareCompatible = false this.update('connecting', 'Finding configured devices…') let identifiers @@ -796,16 +865,21 @@ export class IosPreviewController { this.notifications = notifications bindIosNotifications(notifications) bindCompassSession(communicator) + bindBandwidthBenchmarkSession(communicator) communicator.setRequiresAncs(true) this.sessionOffs.push( communicator.onStateChange(state => this.handleSessionState(communicator, state)), communicator.onRingEvent(input => this.handleRingEvent(input)), communicator.onBatteryState(state => { if (this.communicator !== communicator) return + // Unlike the headset level, an unavailable ring reading (-1: ring away or old + // firmware) clears the indicator, as on Android. + const ringBattery = state.ringBattery ?? -1, hasRingBattery = Number.isInteger(ringBattery) && ringBattery >= 0 && ringBattery <= 100 this.state = { ...this.state, battery: state.battery >= 0 && state.battery <= 100 ? state.battery : this.state.battery, charging: state.chargingStatus >= 0 ? state.chargingStatus > 0 : this.state.charging, - ring: (state.ringBattery ?? -1) >= 0 || this.state.ring } - shell.setBatteryLevels({ headset: this.state.battery, headsetCharging: this.state.charging }) + ring: hasRingBattery || this.state.ring, + ringBattery: hasRingBattery ? ringBattery : null, ringCharging: hasRingBattery ? state.ringChargingStatus === 1 : null } + this.pushBatteryLevels() if (this.active) this.onConnectionState({ ...this.state }) this.requestShellRender() }), @@ -934,6 +1008,9 @@ export class IosPreviewController { for (const off of this.sessionOffs.splice(0)) off() this.notifications = null this.communicator = null + bindBandwidthBenchmarkSession(null) + // Releases an EvenHub app's mic before the session closes. + this.syncRawMicSession() this.glance.reset() await communicator.close().catch(error => this.logBluetooth(`Close: ${String(error)}`)) } @@ -977,7 +1054,7 @@ export class IosPreviewController { this.continuousClients.set(client, options) if (!iosVoiceInput.supportsContinuous(this.voiceProvider())) { this.continuousClients.delete(client) - this.onError('Transcribe on iOS needs a cloud or Whisper server transcription provider (Settings > Voice > Transcription Provider).') + this.onError('On-device transcription for Transcribe needs iOS 26 or later; before that, choose a cloud or Whisper server transcription provider (Settings > Voice > Transcription Provider).') return } this.syncContinuousRecording() @@ -1047,6 +1124,15 @@ export class IosPreviewController { } if (current()) this.syncContinuousClaim() } + /** + * EvenHub apps' mic (the bridge's raw tap) listens through a connected, + * unlocked glasses session, as speech capture does; the EvenHub mic router + * decides which app hears it and when. + */ + private syncRawMicSession(): void { + const ready = this.state.phase === 'connected' && !this.glassesLocked + iosVoiceInput.setRawSession(ready ? this.communicator : null, message => this.logBluetooth(message)) + } /** Other mic users stand down while continuous capture really holds the mic, not merely while a window wants it. */ private syncContinuousClaim(): void { voiceActivity.setActive(this.continuousClients.size > 0 && iosVoiceInput.continuousActive, CONTINUOUS_CAPTURE_HOLDER) @@ -1058,15 +1144,17 @@ export class IosPreviewController { } /** * The transcription provider setting and the keys the cloud ones need. A - * window that needs a multilingual provider (Translate) sets it for every - * capture while it is open, with Whisper left to detect the language. + * window that needs its own provider and language (Translate) sets them for + * every capture while it is open; otherwise only Whisper server is told a + * language (its own setting). */ private voiceProvider(): VoiceProviderSelection { - const multilingual = [...this.continuousClients.values()].find(options => options.multilingualProvider)?.multilingualProvider - return { provider: multilingual ?? voiceProviderSetting.get(), elevenLabsApiKey: elevenLabsApiKeySetting.get(), - openAiApiKey: openAiApiKeySetting.get(), sonioxApiKey: sonioxApiKeySetting.get(), + const choice = [...this.continuousClients.values()].find(options => options.transcription)?.transcription + const provider = choice?.provider ?? voiceProviderSetting.get() + return { provider, language: choice ? choice.language : provider === 'whisper-server' ? whisperServerLanguageSetting.get() : '', + elevenLabsApiKey: elevenLabsApiKeySetting.get(), openAiApiKey: openAiApiKeySetting.get(), sonioxApiKey: sonioxApiKeySetting.get(), whisperServerUrl: whisperServerUrlSetting.get(), whisperServerModel: whisperServerModelSetting.get(), - whisperServerLanguage: multilingual ? '' : whisperServerLanguageSetting.get(), whisperServerApiKey: whisperServerApiKeySetting.get() } + whisperServerApiKey: whisperServerApiKeySetting.get() } } private logBluetooth(message: string): void { const line = `${new Date().toISOString()} [${this.active ? 'foreground' : 'background'}${UIApplication.sharedApplication.protectedDataAvailable ? '' : ',protected-data-unavailable'}] ${message}` diff --git a/app/graphics/evenhub-font.ts b/app/graphics/evenhub-font.ts index 737715ed..d80ca2bd 100644 --- a/app/graphics/evenhub-font.ts +++ b/app/graphics/evenhub-font.ts @@ -25,6 +25,7 @@ import { EVENHUB_RUNTIME_FONT_FILENAME, isEvenHubFontAsset } from "../g2/firmwar import { lvglMetrics, lvglGlyph } from "../native/lvgl-font"; import { GrayImage, grayToNibble, type FwTextFont, type PlacedFwText, type PlacedFwTextGlyph } from "./image"; import { TtfFont } from "./ttf-font"; +import { decodeBase64 } from "../util/base64"; const CJK_ASSET_PATH = "fonts/source-han-sans/SourceHanSansSC-Light-20.lvgl.bin"; @@ -55,25 +56,6 @@ type CjkGlyph = { bitmap: Uint8Array; }; -const BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -function base64Decode(text: string): Uint8Array { - const clean = text.replace(/[^A-Za-z0-9+/]/g, ""); - const out = new Uint8Array(Math.floor((clean.length * 3) / 4)); - let bits = 0; - let bitCount = 0; - let outIndex = 0; - for (let i = 0; i < clean.length; i++) { - bits = (bits << 6) | BASE64_ALPHABET.indexOf(clean[i]!); - bitCount += 6; - if (bitCount >= 8) { - bitCount -= 8; - out[outIndex++] = (bits >> bitCount) & 0xff; - } - } - return out.subarray(0, outIndex); -} - /** * Codepoint ranges whose glyphs the font asset merged from the flash CJK * font with a baseline-shifted ofsY (see scripts/build-evenhub-font.mjs). @@ -144,7 +126,7 @@ export class EvenHubFont implements FwTextFont { this.useTtfFallback = useTtfFallback; this.lineHeight = asset.lineHeight; this.baseline = asset.baseline; - this.bitmap = base64Decode(asset.bitmapBase64); + this.bitmap = decodeBase64(asset.bitmapBase64); this.glyphs = new Map(); for (const key of Object.keys(asset.glyphs)) { this.glyphs.set(Number(key), asset.glyphs[key]!); diff --git a/app/graphics/pebble-icons-data.ts b/app/graphics/pebble-icons-data.ts new file mode 100644 index 00000000..ae0188fd --- /dev/null +++ b/app/graphics/pebble-icons-data.ts @@ -0,0 +1,100 @@ +// Generated by scripts/generate-pebble-icons.cjs; do not edit by hand. +// +// Pebble notification icons from https://github.com/pebble-dev/iconography +// (commit 16a9ea42ea7ac079127af2ecc54f453dfbc314c8): the original Pebble Technology icons and +// Rebble community additions, licensed under the Apache License 2.0 (see +// app/graphics/pebble-icons.LICENSE). Modified: rasterized at 25x25 and +// inverted for a black display (Pebble draws them black on white). +// +// Each icon is SIZE x SIZE pixels at 2 bits each (0, 1, 2 = coverage 0, +// 128, 255), four pixels to a byte with the first in the high bits, +// row-major, base64-encoded. + +export const PEBBLE_ICON_SIZE = 25; + +export const PEBBLE_ICON_DATA = { + generic: "AAACgAAAAAAAoAAAAAAAKAAAAAACqqgAAAACqqqAAAACoACoAAACoAAKgAACoAAAqAAAoAAACgAAKAAAAoAACgAAAKAAAoAAACgAAKAAAAoAACgAAAKAACoAAACoACoAAAAKgCqqqAAAqAqqqgAACgKAAAAAAoCgAAAAAKAqqqqqqqgKqqqqqqoAAAAABkAAAAAAAKAAAAAAACgAAA==", // pebbleos/Pebble_25x25_Generic_notification.svg + activity: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAACkAGkAAAAqkKqQAAAKaqhqAAACgagqpAAAoAQaakAAKAABGqkACgAAClqkAoAAAUZqQKqpAAKBqSlWqqqgBooAFVWkAKKAAAAZACilVVValVpqqqqqqqqQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Activity.svg + alarmClock: "AAAAAAAAAAAAAAAAAAoAAACgAAqCqqgqAAqCqqqCoAqCoACoKgKCoAAKgoACoAoAqAACoAKACoACoACgAKgAoAAoAAoAKAAKAAKACgAKgACgAoAKgAAoAKAKgAAKACgKgAACgAqCgAACoACoAAACoAAKgAACoAACqAACqAABmoACpkAAZKqqoZAAKAqqoCgACgAAAAoAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Alarm_clock.svg + appStore: "AAAAAAAAAAACqoAAAAACqqgAAAACooqAAAACoKCoAAAAoCgKAAAAKAoCgAAACgKgoAAAAoAqKAAAAKgCqgAAAAqAKgAAAACqqgAAAAAKqgAABAAAAAAARpQAAAAFpGqqqqqqpAGqqqqqkAAoAAAAoAAKAAAAKAACgAAACgAAoAAAAoAAKAAAAKAACqqqqqgAAqqqqqoAAAAAAAAAAA==", // icons/25px_Appstore.svg + calendar: "AAKAAKAAAACgACgAAKqqqqqqgCqqqqqqoAoCgACgKAKAoAAoCgCiqoCqooAoqqAqqKAKAAAAACgCgAAAAAoAoAAAAAKAKAAACgCgCgAABoAoAoAABoAKAKAKBoACgCgCkpAAoAoAKpAAKAKABpAACgCgAKAAAoAoAAAAAKAKAAAAACgCgAAAAAoAqqqqqqqAKqqqqqqgAAAAAAAAAA==", // pebbleos/Pebble_25x25_Calendar.svg + car: "AAAAAAAAAAqqqqpAAAKqqqqgAAGQAAAoAACgAAAGQAAoAAAAoAAZAAAAKQAKAAAABkCqgAAAAKqqqqqqqqqgqqqqqqqAKAKACgCgCgCgAoAoAqqoAKqqAKqqACqqgCgAKqAAoAoACqgAKAKAAAAACgCqqqqqqoAqqqqqqqAAoKACgoAAKCgAoKAACgoAKCgCqqqqqqqqqqqqqqqqgA==", // pebbleos/Pebble_25x25_Car_rental.svg + contacts: "AAAAAAAAACqqqqqqAAqqqqqqgAKAAAAAoAqqAAAAKAKqgAAACgAKAAAAAoACgAAAAKAAoAApACgAKAAaQAoACgAGkAKAKqgAAACgCqoAGAAoACgAGoAKAAoAGqgCgAKACqpAoACgAAAAKAAoAAAACgCqoAAAAoAqqAAAAKAAoAAAACgAKAAAAAoACqqqqqqAAqqqqqqgAAAAAAAAAA==", // icons/25px_Contacts_book.svg + dinner: "AAAAAAAAAAAqqqAAAAAqqqoAAAKqAAKqAAKqAAAqoAKigAAKKgKgoAACgqCgKgACoCgoAqACoAoKACgAoAKCoAAAAAKgKgAAAAKgAqoAACqgACqAAAqgAACgAAKAAAAooCigAAAKKAooAAACigKKAAAAqqqqgAAAKqqqoAAACgAAKAAAAoAACgAAAKqqqoAAACqqqqAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Dinner_reservation.svg + email: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACqqqqqqqoqqqqqqqqKqAAAACqiioAAACoooKgAACoKKAqAACoCigCoACoAooAKgCoAKKAAqCoACigACqoAAooAoKoKAKKAqAoCoCigqAAAKgooqAAAAqKKqAAAACqiqAAAAAKoqqqqqqqqKqqqqqqqgAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Generic_e-mail.svg + flight: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaAAAAAABqoAAAAAWpagqoABqkCqKqQGqQCqpkpalAAoKZGqQAAACmQpAAAAAooAAAqoAKKAAAKqAChkAUAGQCoZAKACgCoGQCgAoCoAqqoAaqoAKqqAKqoAAACgCgAAAAAoBkAAAAAKqoAAAAACqqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Scheduled_flight.svg + glucose: "AAAAAAAAAAAAAAAAAKqqqqqqgCqqqqqqoAoAAAAAKAKAAAAACgCgAAAAooAoAAAAqKAKAAAAqCgCgAoAqAoAoAqgqAKAKAqqqACgCgqCqAAoAoqAKAAKAKKAAAACgCgAAAAAoAoAAAAAKAKKqoAACgCiqqAAAoAoAAAAAKAKAAAAACgCqqqqqqoAqqqqqqqAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Glucose_monitor.svg + heart: "AAAAAAAAAAKAACgAAAKoACqAAAKqgCqoAAKgqCoKgAKgCqoAqAKgAKoACoCgAAoAAKAoAAAAACgKAAAAAAoCgAAAAAKAoAAAAACgKAAAAAAoCoAAAAAqAKgAAAAqAAqAAAAqAACoAAAqAAAKgAAqAAAAqAAqAAAACoAqAAAAAKgqAAAAAAqqAAAAAACqAAAAAAAKAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Heart.svg + incomingCall: "AAAACgAAAAAAAoAAAAAAqqqqqAAAKqqqqgAACgAAAoAAAoqqqKAAAKKqqigAACigAooAAAooAKKCgAKKACigqACigAooCoAoqqqKAKgKKqqigAqCgAAAoACgoqiqKAAAKKoqiqqgCgAAAqqoAoqiqKAAAKKoqigAKCgAAAoAKgoAAAKAKgKAAACgKgCgAAAoKgAqqqqqCgAKqqqqgA==", // pebbleos/Pebble_25x25_Incoming_call.svg + location: "AAACqqqoAAAAqqqqAAAAKAAqAAAACgAqAAAAAoAqAAAAAKAKgAAAACgAqAAAAAoACoAAAAKqqqgAAACqqqoAAAAoAAAAAAAKAAAAAAACgAAAAAAAoAAAAAAAKAAAAAAACgAAAAAAAoAAAAACqqqqAAACqqqqoAACoAoAKgACoAKAAqACoACgACoCoAAAAAKiqqqqqqqqqqqqqqqqgA==", // pebbleos/Pebble_25x25_Location.svg + microphone: "AAAqqoAAAAAqqqgAAAAqCgqAAAAKBpSgAAACqqqoAAAAqmmqAAAAKAoCgAAACqqqoAAAAqqqqAAAAKAoCgAAACgKAoAAAAqmmqAAAAKqqqgAAACgaQoAAAAqCgqAAAACqqqAAACgKqqAoAAqAAAAqAACoAAAqAAAKqqqqAAAAqqqqAAAAAAoAAAAAAAKAAAAAAAqqAAAAAAKqgAAAA==", // icons/25px_Microphone.svg + missedCall: "AAAACgAAAAAAAoAAAAAAqqqqqAAAKqqqqiqoCgAAAoqqAoqqqKKoAKKqqiiqgCigAoooqAooAKKKCoKKACigAKiigAooACooqqqKACoKKqqigCoCgAAAoCoAoqiqKCoAKKoqiioACgAAAqoAAoqiqKoAAKKoqigAACgAAAoAAAoqiqKAAAKKoqigAACgAAAoAAAqqqqqAAAKqqqqgA==", // pebbleos/Pebble_25x25_Missed_call.svg + movie: "AAAAAAAAAAAAAAAAAKqqqqqqACqqqqqqgAoqACoAoAKCoAKgKACgKgAqCgAoAqACooAKqqqqqqACqqqqqqgAoAqACooAKAqACoKACgqACoCgAoqACoAoAKqqqqqqACqqqqqqgAoAAAAAoAKAAAAAKACgAAAACgAoAAAAAoAKqqqqqqACqqqqqqgAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Movie_event.svg + music: "AAKQAAAAAACqkAAAAAApqpAAAAAKAaqQAAACgAGqkAAApAABqoAAKqQAAaAACmqkACgAAoBqpAoKqqAAaqaCqqgAAGqgoAoAAABoKAKAAAAKCgCgAAACgoAoAAAAoKAKAAKqqCqqgACqqgqqoAAoAoAAAAAKAKAAAAACgCgAAAAAoAoAAAAAKAKAAAAACqqgAAAAAqqoAAAAAAAAAA==", // icons/25px_Music_note.svg + news: "AAAAAAAAAAAAAAAAAAAAAAAAACqqqqqqoAqqqqqqqAKAAAAACgCgAAAAAoAoKqqqoKAKCqqqqCgCgAAAAAoAoKqqqgKAKCqqqoCgCgAAAAAoAoKqqqAKAKCqqqgCgCgAAAAAoAoKqqAAKAKCqqgACgCgAAAAAoAoAAAAAKAKqqqqqqgCqqqqqqoAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_News_event.svg + payBill: "AAAAAAAAAAAAAAAAAAAAAAAAApQAAAAAWqqlAABaqplqqAKqpZZAWgClAGSgAZBkACgoACgoAAoKqqqpAAZCqqqqQAGQoAACgAGgKAACkAaoCgACpBqqAoACqmqSgKACoqpAoCgAqCoAKAoACqoACgKAAKoAAoCgAAoAAKAoAAAAACgKqqqqqqoCqqqqqqqAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Pay_bill.svg + phone: "AAAACgAAAAAAAoAAAAAAqqqqqAAAKqqqqgAACgAAAoAAAoqqqKAAAKKqqigAACigAooAAAooAKKCgAKKACigqACigAooCoAoqqqKAKgKKqqigAqCgAAAoACgoqiqKAAAKKoqiqqgCgAAAqqoAoqiqKAAAKKoqigAKCgAAAoAKgoAAAKAKgKAAACgKgCgAAAoKgAqqqqqCgAKqqqqgA==", // pebbleos/Pebble_25x25_During_phone_call.svg + podcast: "ACgAAAAAAAoAAAAAAAZAAAAAAAGQAAAAAACgAAAAAAAoAAAAAAAZAAAAAAAGQAAAAAAqqqqqqqoKqqqqqqqCgAAAAACgoAAAAAAoKAqoAqqKCgqqgKqigoqAqAAAoKKACgAAKCigAoAACgooAKAAAoKKgKgAAKCgqqgAACgoCqgAAAoKAAAAAAKCgAAAAACgqqqqqqqoKqqqqqqqAA==", // pebbleos/Pebble_25x25_Radio_show.svg + reminder: "AAAACqoAAAAAAqqCgAAAAKCioAAAACgqoAAAAAoKoAAAAAKqoAAAAACqqAAqqqqoKoAKqqqqCqgCgoKCgoqAoKCgoKCgKCgoKCgACgoKqqqAAoKCqqqgAKqqoAAoACqqqAAKAAqACqoGgACoAqqGgAAKgAACkAAAoAACkAAAKAAAoAAACgAAKAAAAoAACgAAAKqqqoAAACqqqqAAAA==", // pebbleos/Pebble_25x25_Generic_reminder.svg + settings: "AAAKqqAAAAACqqgAAAAAoAoAAqqqqAKqqqqqqgCqqoAAAoAoAAAAAKqqAAAAACqqgAAAAAAAAAAAqqoAAAAAKqqAAAAACgCgAAAAqoAqqqqqqqAKqqqqoCgCgAAAAAqqoAAAAAKqqAAAAAAAAAAKqqAAAAACqqgAAAAAoAqqqqqqqAKqqqqqqgCgAAAAAoAoAAAAAKqqAAAAACqqgA==", // pebbleos/Pebble_25x25_Settings.svg + shopping: "AAAAaAAAAAABqoAAAAACqaAAAAAApCgAAAAAKAoAAAAACgKAAACqqqqqqoAqqqqqqqAGgAAAAGQApAAAACgAGgAAAAoAApAAAAZAAGgAAAKAAAoAAACgAAZAAABkAAKAAABoAACgAAGqQABkAAKpoAAoAACkKQAKAAAABoAGQAAAAKQCqqqqqqoAqqqqqqqAAAAAAAAAAAAAAAAAAA==", // icons/25px_Shopping_bag.svg + sms: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACqqqqqqqAqqqqqqqoCoAAAAAKgKgAAAAAoAoAAAAAKAKCqqqqCgCgqqqqgoAoAAAAAKAKAAAAACgCgqqgAAoAoKqoAAKAKAAAAACgCgAAAAAoAqAAAAAqACqqqqqqAAKqqqqqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // icons/25px_SMS.svg + stocks: "AAAAAAAACgAAAAAAAoAAAAAAAKAAAAAAACgAAAAAAAoAAAAoAAKAAAAqigCgAAAqqqAoAAAqCqoKAoAqCoKigqgqAqCooqqqACqoKqCqAAKoCqAKAAAoAqAAAAAKAKAAAAACgCgAAAAAoAoAAAAAKAKAAAAACgCgAAAAAoAoAAAAAKAKAAAAACgCqqqqqqoAqqqqqqqAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Stocks_event.svg + tv: "AAAAAAoAAAAAAAqAAAAKAAqAAAACoAqAAAAAKgqAAAAAAqqAAAKqqqqqqqCqqqqqqqgoAAAAAAoKKqqqqqKCiqqqqqigooAAAAooKKAAAAKKCigAAACigooAAAAooKKAAAAKKCiqqqqqigoqqqqqooKAAAAAAKCgACqgACgoAAqoAAoKAAAAAAKCqqqqqqqgqqqqqqqoAAAAAAAAAA==", // pebbleos/Pebble_25x25_TV_show.svg + voicemail: "AABAUAAAAABkaAAAAAAZKQAAAAAKKQAAAAKCigEAAACoABaQAABqgCqQAAApqApAAAAKCoAAAAAGQKgAAAACgAqAAAAAoBqgAAAAZCqQAAAAKQqAAAAACoBpAKAAAKgGkGoAAAaQaSqgAABpBqoqAAAGkCpCoAAAaQKAKgAABpAABqAAAGkAGqgAAAKhqpAAAAAqqQAAAAACkAAAAA==", // icons/25px_Phone.svg + warning: "AAAAAAAAAAAAoAAAAAAAaQAAAAAAKoAAAAAAGqQAAAAACgoAAAAABkGQAAAAAoooAAAAAZKGQAAAAaCgpAAAAKQoGgAAAGgKApAAACkCgGgAABoAoApAAApAKAGgAAZAAAAZAAKAAoACgAGQAKAAZACgACgACgCkAAoAAaBoAAAAACkqqqqqqqqKqqqqqqqgAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Generic_warning.svg + weather: "AAAAAAKAAAAAAACgAAAACgAoAAAAAqAKAAAAACoAAAAAAAKKqgAAAAAKqqAAAAAKgCoAAKqCgAKAAKqooACgAKgKqAAoKqgAqqqqKqoACqqqqgKgAAACqgAoAAAAKoAAAAAACqAAAAAAAqgAAAAAAKqAAAAAAKiqqqqqqqgKqqqqqqgAAAAAAAAAKCgoAAAACgoKAAAAAoKCgAAAAA==", // pebbleos/Pebble_25x25_Generic_weather.svg + airmail: "AAAAAAAAAAAAAAAAAAAqqqoAAAAqqqqgAAAqAAAqAAAqAAACoAAqAAAAKgAqAAAAAqAKkAAAAagCqkAABqoApqkAGqaAKBqkapCgCgBqqkAoAoABqQAKAKAAAAACgCgAAAAAoAoAAAAAKAKgAAAAKgAaQAAAKgABpAAAKgAAGkAAKgAAAKqqqgAAAAqqqgAAAAAAAAAAAAAAAAAAAA==", // brand-logos/Airmail_25px.svg + amazon: "AACqqgAAAACqqqAAAACoACoAAACoAAKgAAAqqoAoAAAKqqgKAAAAAAqCgAAAAACgoAAAAqqoKAAAAqqqCgAAAqAAAoAAAqAAAKAAAKAqqCgAACgqqgoAAAoKAoKAAAKCgKCoAACgqqgKgAAoCqgAqAAKgAAoKgKAqAAqqgqoCqqqqgqKgKqqCgqAqAAAAAqACqqqqqqAAKqqqqqAAA==", // pebbleos/Pebble_25x25_Amazon.svg + appleShortcuts: "AAAKqAAAAAAKqoAAAAAKgKgAAAAKgAqAAAAKgACoAAAKgAAKgAAKgAAAqAAKgCqgCoACgCqqAKAAoCoCoCgAKgoAKioAAqAAAqoAACoAACoAACqgACqgACoqACoqAAoCoCoCgAKAKqoAoACoAqoAqAAKgAAAqAAAqAAAqAAACoAAqAAAAKgAqAAAAAqAqAAAAACqqAAAAAAKqAAAAA==", // brand-logos/Apple_Shortcuts_25px.svg + bbcNews: "qqqqqqqqoAAAAAAAKCqgqoCqCgqqKqiqooKCigooKKCqoqqKACgqqKqigAoKCigooKKCqoqqKqigqoKqAqgoAAAAAAAKAAAKqqACgAACqqgAoAAAoAoAKACqqAKACgAqqgCgAoAKAoAoAKACgKqqACgAoCqqgAoAKqoKAAKACqqCgACgAACqoAAoAAAqqAAKAAAAAAACqqqqqqqqgA==", // brand-logos/BBC_News_25px.svg + beeper: "AAqqqqAAAAqqqqoAAAqAAAKgAAqAAAAqAAqAAAACoAKAAAAAKACgAAAACgAoAAAAAoAKAAAAAKACoAAAAKgAKgAAAKgAAqAAAKgAAKqqoKgAACqqqKoAAAoAGaqgAAKACqgqAACgAqgCoAAoAagAKAAKAKgACgACgCgAAoAAoAAAAqAAKAAAAqAACgAAAqAAAqqqqqAAAKqqqqAAAA==", // brand-logos/Beeper_25px.svg + bluesky: "AAAAAAAAAGgAAAApAqqAAAAqqKWoAAAqWigKgAAqAooAqAAqAKKACoAqACigAKgqAAooAAqqAAKKAACqAACigAAKAAAopAAAAAAaGgAAAAAKQpAAAAAGgGqoAAKqkAqqAACqoAKpAAAGqACkAAAAGgAoAAAAAoAKAAKAAKACgAGkACgAqACqACoACoBqkCoAAKqpaqoAAAqqCqoAAA==", // brand-logos/Bluesky_25px.svg + discord: "AAAAAAAAAAAAAAAAAAAAAAAAAABoAACkAAKqqqqqoAClqqqpaABkAAAABkAoAAAAAKAKAAAAACgGQAAAAAZCgAAAAACgoCqgKqAoZAqoCqgGaAKKAooAqgCqgKqAKoAqoCqgCqAAAAAAAqkAAAAAAaqkCqqoBqhqmqqqmqQBqoAAqpAABoAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // brand-logos/Discord_25px.svg + duolingo: "AAAAAAAAAAAAAAAAAAoAAAAoAKagAAAqaCqqAAAqqhqmoAAqappoKgAqCmqAAqAqAAUKqCgKCqgKqoAACqqKgKgACoCqgAoAAoAKoKKAAKKCqCigACigqgooAAooKoKKAAKKCqCiiqiigqoCqqqqAqKqqoCqqqAqoqqqKqAAAKqqgAAAAAoCgAAAAAKqoAAAAAAqoAAAAAAAAAAAAA==", // brand-logos/Duolingo_25px.svg + ebay: "AAAqqgAAAAAqqqAAAAAqACoAAAAqAAKgAAAKAAAoAAACgAAKAAKqqqqqqqCqqqqqqqgoAKACgAoKACgAoAKCgAoAKACgoAKACgAoKACgAoAKCgAoAKACgoAKACgAoKACgAoAKCgAoAKACgoAKACgAoKACgAoAKCgAoAKACgoAKACgAoKgCgAoAqAqAoAKAqACqqqqqqAAKqqqqqAAA==", // brand-logos/eBay_25px.svg + element: "AACqqoAAAAAqqqgAAAAKAAqAAAACgACoAAAAqqgKAACqqqqCgACqqqCgoACoACgoKACoAAoKCqqoCqqCgqqqCqqgqqgqgoAAKqoKoKAAAAKCqCqqAACgqgqqgqqoKqqgoKqoCqqoKCgACoAKCgoACoACgoKqqoAAoKqqqoAAKAqqgAAACoAAoAAAAKgAKAAAAAqqqgAAAACqqoAAAA==", // brand-logos/Element_25px.svg + facebook: "AAAAAAAAAAAAAAAAAAAAAAAAAAqqqqqqgAKqqqqqoACgAAAAKAAoAAAACgAKAAAKgoACgAAKoKAAoAAKgCgAKAACgAoACgAAoAKAAoACqqCgAKAAqqgoACgAAoAKAAoAAKACgAKAACgAoACgAAoAKAAoAAKACgAKAACgAoACqqqqqqAAqqqqqqgAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Facebook_notification.svg + facetime: "AAAoAAAAAAAKAAAAAoACgAKAAKgAoAKgAAqAKAKgAACoCgKgAAAKgoKgAAAAoACgAAAAAAAAAAAAAAAAAAAAKqqqoACgKqqqqgCoKgAAAqCqKgCqgCqqigCqqAKoooCoCoCoKKAoAKAoCigKACgKAooCgAoCgKKAqAqAqCigCqqAKooqAKqAKqqCoAAAKgqgKqqqqgCoAqqqqgAKAA==", // pebbleos/Pebble_25x25_Facetime_incoming.svg + gmail: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKqqqqqqqiqqqqqqqooAqAAqAKKACoAqACigAKgqAAooKAqqAoKKCoCqAqCigqgKAqgooKqAAqoKKCioAqKCigoKgqCgooKCqqgoKKCiqqqKCigqoKCqgooKoAAKoKKCoAAAqCiqqqqqqqoqqqqqqqqAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Gmail_notification.svg + googleChat: "AAAAAAAAAAAAAAAAAKqqqqoAACqqqqqgAAoAAAAqAAKAAAACoACgAAAAKgAoCqqqgqAKAqqqoCgCgKAAKAoAoCgACgKAKAoAAoCgCgKAAKAoAoCqqqgKAKAqqqoCgCgKgAAAoAoCgAAAKAKAoAAACgCqqAqqqoAqqgqqqqAAAoqAAAAAAKqAAAAAACqAAAAAAAAAAAAAAAAAAAAAAA==", // brand-logos/Google_Chat_25px.svg + googleMaps: "AAAAAKqgAAAAAKqqAKqqqqgCoKqqqqgAKqgAACgAAqgKoAoAAKoKqAKAACqKgACgAAqigqgqAAqooKoCoAqKKgqAKgqCgqqAKoKgoCqAKmWoKAAAKgqqCgAAKgKqgoAAKgBpoKAAKqAKKCgAKioCigoAKgKgAoKAKgAqAKCgKgACoCgoKgAAKgoKqgAAAqqAqqqqqqqACqqqqqqAAA==", // pebbleos/Pebble_25x25_Google_Maps.svg + googlePhotos: "AAAAoAAAAAAAKgAAAAAACqAAAAAAAqoAAAAAAKKgAAAAqqgqAAAAqqoCoAAAqAKAKAAAqACgCgAAqACqAoAAqACqoKAAqqqoKqqqKqqqCqqqgAKCqoAKgACgKoAKgAAoAoAKgAAKAKAKgAACoCqqgAAAKgqqgAAAAqKAAAAAACqgAAAAAAKoAAAAAAAqAAAAAAACgAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Google_Photos.svg + googleTasks: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAqqqAqAAAqqqoqAAAqAAKqAAAqAAAqAAAqAAAqoAAKAAAqKAACgAAqCgAAooAqAoAAKKgqAKAACgqqACgAAoCqAAoAAKAKAAKAACoAAAKgAAKgAAKgAAAqAAKgAAACqqqgAAAAKqqgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // brand-logos/Google_Tasks_25px.svg + homeAssistant: "AAAAAAAAAAAAKAAAAAAAKoAAAAAAKqgAAAAAKgqAAAAAKgCoAAAAKgAKgAAAKgAAqAAAKgqqCoAAKgKqgKgAKgCgoAqAKgAoKACoKgAKqgAKigACqoAAooAACgqqKKAAAoKqiiiqoKCgoooqqCgoKKKKCgoKqiiigoKKqoooqqCqgAKKKqoqgACigAKqgAAoqqqqqqqqKqqqqqqqgA==", // brand-logos/Home_Assistant_25px.svg + instagram: "AAAAAAAAAAAAAAAAAKqqqqqqgCqqqqqqoAoAAAAAKAKAAAAqqgCgAAAKqoAoAKqoAKAKAKqqgCgCgKgAqAoAqqgACqqAKqgAAKqgCgoAACgoAoKAAAoKAKCgAAKCgCgoAACgoAoKgACoKAKAqACoCgCgCqqoAoAoAKqoAKAKAAAAACgCqqqqqqoAqqqqqqqAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Instagram.svg + iosPhotos: "AAAKqAAAAAAKqoAAAAqqgKqoAAqqgAqqgAqBoAKQqAKAKACgCgCgBkBkAoApAKAoAaAKpBkZBqgKqpaKWqqKgGqqqkCqgAGqqQAKoAAKqAACqAAaqpAAqoBqqqpAqKqpaKWqqAqkGRkGqAKQCgKAGgCgBkBkAoAoAoAKAKAKgaACkKgAqqgAqqgACqqAqqgAAACqqAAAAAAKqAAAAA==", // pebbleos/Pebble_25x25_iOS_Photos.svg + kakaoTalk: "AAAAAAAAAAAAAAAAAAKqqqqAAAKqqqqoAAKgAAAKgAKgAAAAqAKgAAAACoCgCqqqAKAoAqqqgCgKAACgAAoCgAAoAAKAoAAKAACgKAACgAAoCgAAoAAKAoAAKAACgKAACgAAoCoAAAAAqAKgAAAAqAAqAAAAqAACgKqqqAAAoaqqqAAAKaQAAAAACqQAAAAAAqQAAAAAAKAAAAAAAA==", // pebbleos/Pebble_25x25_KakaoTalk.svg + kik: "AoAAAAAAAqgAAAAAAqqAAAAAAKCgAAAAACgoAAAAAAoKAKqAAAKCgKqgAACgoKgoAAAoKKgKAAAKCqgKgCgCgqgKgGqQoKgKgKlqKCgKgCgCigAKgAoAooAKgAKAKKACoACpaigAKgAGqQoKAqAAKAKCoCoAAACgqgKgAAAoKqAqAAAKCioCgAACqoKgoAAAKoAqqAAAAoACqgAAAA==", // pebbleos/Pebble_25x25_Kik.svg + line: "AKqqqqqAAKqqqqqoAKgAAAAKgKgAAAAAqKgAAAAACqgAAAAAAKoKAoqoqiqCgKKqKoqgoCiiigKoKAoooqiqCgKKKKoqgoCiiigKoKooooqiqCqKKKKoqoAAAAAAKKgAAAAAKgqAAAAAKgCoAAAAKgAKqqqAKgAAqqqgKgAAAAAZKgAAAAAGagAAAAABqgAAAAAAKgAAAAAACgAAAA==", // pebbleos/Pebble_25x25_Line.svg + linkedIn: "AAAAAAAAAAAAAAAAAKqqqqqqgCqqqqqqoAoAAAAAKAKAAAAACgCgKAAAAoAoCgAAAKAKAAAAACgCgKAAAAoAoCgqqAKAKAoKqoCgCgKCgKAoAoCgoCgKAKAoKAoCgCgKCgKAoAoCgoCgKAKAoKAoCgCgAAAAAoAoAAAAAKAKAAAAACgCqqqqqqoAqqqqqqqAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_LinkedIn.svg + messenger: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAABqAACgAACqAABqQAGqQAApqAKqgAAZCpamkAAaAGqRoAAKQAKAoAAGgAAApAACgKAAaAACkapAKQABpqWoGQAAqqAKmgAAapAAakAAKoAAAoAAKkAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Facebook_messenger_notification.svg + omniFocus: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKgAAAAAAKqAAAAAAKioAAAAAKgKAAAAAKgKgAAAAKgKgACoAKgKgACqgKgKgACoqKgKgAAoCqgKgAAKgKgKgAAAqAQKgAAACoAKgAAAAKgKgAAAAAqKgAAAAACqgAAAAAAKgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // brand-logos/OmniFocus_25px.svg + outlook: "AAAAAAAAAAAAFAAAAAAAapAAAAABqqpAAAAGqQapAAAapAAapABqkAAAapCqQAAAAaopAAAAAAaKAAAAAACikAAAAABqqqqoAAGqqqqqAAaqqAACgBqkqiqooGqQKoqqKqpACqKCiqkAAqigopqkAKoqqKBqgCqKqigBoAqgAAoAKAKqqqqAKgKqqqqgKgKgCqqqqqqgAKqqqqqgAA==", // brand-logos/Outlook_25px.svg + reddit: "AAAAAAAAAAAAAAAAAAAAAAqgAAAAAAqqAAAAAAKCgAAAAACgoAAAAAKqqAAAAACmqAAAAABkAAAAAAAoAAAAqkaqpGqAqqqqqqqoqBpAAGkKqAAAAAAAqgAKACgAKqECgAoBKiqQoAKBqgKgAAAAKgAoAqqgCgAKQKqoBoACqQqoGqAAGqQAapAAAGqqqkAAAAGqqQAAAAAAAAAAAA==", // brand-logos/Reddit_25px.svg + signal: "AAqqCqgAAAqqgqqAAAKAAACoAAACqqoKAAoCqqqgAAqCoAAqAoqCoAACoKqCoAAAKgqioAAAAqKooAAAACigKAAAAAooCgAAAAKKooAAAACgKKAAAAAoCigAAAAKKooAAAACiqKAAAACoqigAAACoKBkAAACoKgoAAACoKgKBqqqoCgGqqqqoAACqkAAAKAApAqoKqgAAAKqCqgAAA==", // brand-logos/Signal_25px.svg + simplex: "AAAAAAAAAAAoAoAAAAAqgqgAAAAqqqqAAAAqCqCoAAAKgKAqAAAoqAAqKAAqipQqKoAqqqpKqqgqCqGQqgqKgKAoCgKgqAAqgAKgCoAqqAKgAqAKqgCoAqAAqgAKgqAoCgKAqKgqhkKoKgqqqpKqqgCqKlCoqgAKKgAKigAAKgKAqAAACoKoKgAAAKqqqgAAAAqgqgAAAACgCgAAAA==", // brand-logos/SimpleX_25px.svg + slack: "AAAAGgAAAAAAqoAAAAAAKWWgAAGgBkqoAAqoAaKWQAKWWqgBoABkqpAKqAAaKQGikACqgBqoZAApAKqWSgAGWikAooAAqoZAKGWgKWSgBkqoAAooAaKWQAKGWqgBoABkqpAKqAAaKQGikACqgBqoZAApAKqWWgAGWikAqoAAqoZAKQAAKWWgAAAAAAqoAAAAAAKQAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Slack.svg + snapchat: "AACqqgAAAACqqqAAAACoACoAAACoAAKgAAAoKCgoAAAKCgoKAAKqgoKCqoCqoKCgqqAoACgoACgKQAAAABoCqQAAAGqAGqAAAKpAAGgAACkAAAoAAAoAAAqAAAKgAAqAAAAqAAqAAAACoAqAAAAAKgqAAAAAAqKAAAAAACikAAAAABoqlAAAAWqAapAABqkAAWqqqpQAAAGqqkAAAA==", // pebbleos/Pebble_25x25_Snapchat.svg + steam: "AAAAAAAAAAAAAAAAAAAAACqqAAAAACqqoAAAACoAKgAAACoqoqAAAAoqqigAAAKKAooAAACigKKAAAAooCigAAAaKqooAAAKAqoqAAKqQAAqKQKqgCqqCqqgAGqqABqpAKkAAAAqqCgAAAAKGgoAAAACgAKAAAAAqAKgAAAACqqgAAAAAKqgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // brand-logos/Steam_25px.svg + substack: "AAAAAAAAAAAAAAAAACqqqqqqAAqqqqqqgAKAAAAAoACgAAAAKAAoAAAACgAKqqqqqoACqqqqqqAAoAAAACgAKAAAAAoACqqqqqqAAqqqqqqgAKAAAAAoACgAAAAKAAoAAAACgAKAAAAAoACgAAAAKAAoAGpACgAKAaqpAoAChqkapKAAqqQAaqgAKpAAAaoACkAAAAaAAAAAAAAAAA==", // brand-logos/Substack_25px.svg + swarm: "AAAAAKQAAAAAAKqAACkAAKmgACqpACgoACpaqAoKACoAGkKGgApAAaCmkAGgACkqoAApAAaKkAAGqqqgAAAAqqpABqkAAAAAaqqkAAACqqBqgAABpCgBoAAAqQoAKAAAakKACgAAKpBkAoAAGmgKAKAACkoCoCgABoKQKioAApApAqoAAKpGgGoAAAaqqqoAAAAaqqQAAAAAAAAAAA==", // brand-logos/Swarm_25px.svg + tapo: "AAABkAAAAAACqgAAAAACoqAAAAACoCoAAAACoCqgAAACoCoqAAACoAoCoAACoAKAKgACoACgAqACoAAoACoCoAAqAAKhoAAqoAApoAAqKgACqAAqAqAAqgAqACoAKoAKAAKACqACgACgAqgAoAAoAKoAKAAKACqACgACgAqgAoAAoAKoAKAAKACqACgACgAqqqoAAqqqqqqAAKqqgA==", // brand-logos/Tapo_25px.svg + teams: "AAKoAAAAAAKqgAAAAAKgqAAAAACgCgAAAAAoAoAqgAAKgqAqqAAAqqAKCgAACqACgoACqqqgqqACqqqqCqACoAACqqoCqqqoKqqgqqqqCgAqKAACgoACiiqooKAAooqqKCgAKKAoCgoACigKAoKAAooCgKCgAKKAoCgoACigAAoKAAoqqqqCoAKKqqqgKgKgCqqqqqqgAKqqqqqgAA==", // brand-logos/Teams_25px.svg + telegram: "AAAAAAAAAAAAAAAAAAAAAAAAaAAAAAABqgAAAAAWqkAAAABqkpAAAAGqQKAAAAapAGQAAGqQABkAAapAAAoABqkAGgKAWpQBaoGQqkAGqoCgKqRappAoAGqqUaAZAABpAKAGQAAGQKQCgAABkGqRoAAAKCmqpAAACikGqAAAAaoAGgAAAGoAAAAAAApAAAAAAAKAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Telegram_app.svg + threads: "AAKqqqgAAAKqqqqAAAKgAACoAAKgAAAKgAKgKqqAqAKgKqqoCoKgKgAKgqCgCoAAoqAoAKqoKqAKAKqqCqACgKgAACoAoKgAAAKgKCgqqAAoCgoKqgoKAoKCgoKCgKCgqqCgoCgoKqgoKAoKgAAqCgKAqAAqAoCoCqqqAqAKgKqqAqAAqAAAAqAACoAAAqAAAKqqqqAAAAqqqqAAAA==", // brand-logos/Threads_25px.svg + tiktok: "AAAAAAAAAAAAKqgAAAAACqpAAAAAAoGgAAAAAKAqAAAAACgCpQAAAAoAKoAAAAKAAKAACqigoCgACqooKkoACoKKCqqACoCigpqgCoGooKAAAoGqKCgAAKCkCgoAACgoAoKAAAoKAKCgAAKCkGgoAACgaqkKAAAqBqkKgAACoAAKgAAAKgAKgAAAAqqqgAAAACqqgAAAAAAAAAAAAA==", // brand-logos/TikTok_25px.svg + twitch: "AAqqqqqqAAqqqqqqgAqgAAAAoAqoAAAAKAqKAAAACgKCgCgKAoCgoAoCgKAoKAKAoCgKCgCgKAoCgoAoCgKAoKAKAoCgKCgAAAAoCgoAAAAqAoKAAAAqAKCgAAAqACgqqqqqAAoKqqqqAAKAAqAqAACgAKAqAAAqqgqqAAAKqoqqAAAAAKqAAAAAACqAAAAAAAqAAAAAAAKAAAAAAA==", // brand-logos/Twitch_25px.svg + twitter: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWgAKQAACqqFqqkAApSqqKqpAZAKaRpaqWQAGgKQGqgACkApABoAAoAGgAAAAKAAaAAAACgACkAAAAoAAaAAAAKAABoAAAGgABqAAAGgACpAAAGkAGoAAACkAKoAAAWkACqpQWqoAABaqqpQAAAAFpQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_Twitter_notification.svg + unifiProtect: "AAAAAAAAAAAaqkAAAAAqqqgAAAAqQBqAAAAaCqCkAAAKSqoaAAACgoKCgAAAoKCgoAAAKCqoKAAACgKoCgAAAoAAAoAAAKAAAKAAACgCgCgAAAoAoAoAAAKAKAKAAACgAACgAAAoAAAoAAAKAAAKAAACgAACgAAAoAAAoAAAKAAAKAAACoAAKgAAAKqqqgAAAAqqqgAAAAAAAAAAAA==", // brand-logos/Unifi_Protect_25px.svg + viber: "AAAAAAAAAAACqqgAAAAAqqqAAAAAAACoAAKAAAAKgAKoAKqAqAKqgCqoCoKgqAAKgKigCoAAqAooAKgoCoKKACoKgKCigCoAqCgooCoACgoKKAqAAAKCigCoAAAAoqAKgCgAACoAqCqAAAKgCqqoAAAqAKoKgAACoAoAqAAAKgAACoAAAqAAAqAAACoAAqAAAAKqqqAAAAAqqqAAAA==", // pebbleos/Pebble_25x25_Viber.svg + waze: "AAAAAAAAAAACqqoAAAACqqqgAAACoAAqAAACoAACoAACoAAAKgACoAFBQqAAoACgoCgAKAAoKAoACgAKCgKAAoABQUCgAKAAAAAoqqgCgCgKKqoAqqoCgqAACqoAoCoAAAAAqAKgAAAAqAAqqgAAqAACqqAAqAAAoCqqqAAAKAqqqgAACgKKAoAAAqqiqqAAACqgKqAAAAAAAAAAAA==", // brand-logos/Waze_25px.svg + weChat: "AAAAAAAAACqqqAAAACqqqoAAACoAAKgAACoAAAqAACoAAACoAAoKoKoKAAKCqCqCgACgAAAAoAAoAAAKqqgKAAAKqqqCgAAKgACoqAAKgAAKioACgAAAoKAAoqiqKCqqqKoqigqqqgAAAoKgAoAAAKCgAKgAAKgAAAqAACgAAACqqqoAAAAKqqqAAAAAAAKgAAAAAAAoAAAAAAAAAA==", // pebbleos/Pebble_25x25_WeChat.svg + whatsApp: "AAAAAAAAAAAAAAAAAAAKqqoAAAAKqqqgAAAKgAAqAAAKgAACoAAKigAAKgAKiqAAAqAKiqoAACoCgoKgAAKAoKCoAACgKCioAAAoCgoqAAAKAoKCoKACgKCoKqoAoCgKgqqgKAoAqCgqCgKgCoAKioBoAKqqioAZAAqqioAKAAAACoAGlqAACoACqqqqqoAAqVKqqoAAAAAAAAAAAA==", // pebbleos/Pebble_25x25_WhatsApp_notification.svg + whatsAppBusiness: "AAAAAKqgAAAAACqoAAAqqqoKAAAqqqqCqgAqACqgqoAqAAoAAKAqKAKAACgqKoCqgqoqKqgqoKqKCgqAKCoCgoKgCqqAoKKgAqqgKCioAAAoCgoKgoAKAoKgqqgCgKAqCqqAoCgCoKCoKAqAKgAqKgGgAqqqKgBkACqqKgAoAAAAKgAaWoAAKgAKqqqqqgACpUqqqgAAAAAAAAAAAA==", // brand-logos/WhatsApp_Business_25px.svg + yahooMail: "CqqqqqqgAqqqqqqoAKAAAAAKACgqoAACgAoKqKqAoAKAKiqgKACgAqqACgAoACqAAoAKAAKAAKACgAqqACgAoAKqgAoCqAAAAAKoqgACgACqKoACqAAqiqgCqoAqooqCoKgqKKCqoAqqCigKoACqAooCoAAKgKKCoAAAqCiioAAACooqoAAAAKqKqqqqqqqiqqqqqqqoAAAAAAAAAA==", // pebbleos/Pebble_25x25_Yahoo_mail.svg + youtube: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKqqqqqoAKqqqqqqgKgAAAAAqCgAAAAACgoACkAAAoKAAqkAAKCgAKqkACgoAChqgAoKAAoBoAKCgAKGqACgoACqpAAoKAAqkAAKCgAKQAACgoAAAAAAoKgAAAAAqAqqqqqqqACqqqqqqAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // brand-logos/Youtube_25px.svg + zoom: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKqqqqoABqqqqqqgGqoAAAAqaqqAAAACqkqgAAAAKQKoAAAAAACqAAAAAAAqgAAAAAAKoAAAAAACqAAAAAAAqgAAAAAAKoAAAAAACqgAAAApAoqAAAAKpKCoAAACqqgKqqqqoaoAqqqqqAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", // brand-logos/Zoom_25px.svg +} as const; + +export type PebbleIconName = keyof typeof PEBBLE_ICON_DATA; diff --git a/app/graphics/pebble-icons.LICENSE b/app/graphics/pebble-icons.LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/app/graphics/pebble-icons.LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/app/graphics/pebble-icons.ts b/app/graphics/pebble-icons.ts new file mode 100644 index 00000000..8069d480 --- /dev/null +++ b/app/graphics/pebble-icons.ts @@ -0,0 +1,28 @@ +import { GrayImage } from "./image"; +import { decodeBase64 } from "../util/base64"; +import { PEBBLE_ICON_DATA, PEBBLE_ICON_SIZE, type PebbleIconName } from "./pebble-icons-data"; + +export { PEBBLE_ICON_SIZE, type PebbleIconName }; + +// 2-bit codes in pebble-icons-data.ts -> coverage. +const LEVELS = [0, 128, 255, 255]; + +const cache = new Map(); + +/** + * One of the bundled Pebble notification icons (see pebble-icons-data.ts and + * scripts/generate-pebble-icons.cjs), as a PEBBLE_ICON_SIZE square coverage + * bitmap. Decoded once and shared: clone it before drawing on it. + */ +export function pebbleIcon(name: PebbleIconName): GrayImage { + let icon = cache.get(name); + if (!icon) { + const bytes = decodeBase64(PEBBLE_ICON_DATA[name]); + icon = new GrayImage(PEBBLE_ICON_SIZE, PEBBLE_ICON_SIZE, 0); + for (let i = 0; i < icon.pixels.length; i++) { + icon.pixels[i] = LEVELS[(bytes[i >> 2]! >> (6 - 2 * (i & 3))) & 3]!; + } + cache.set(name, icon); + } + return icon; +} diff --git a/app/graphics/textwrap.ts b/app/graphics/textwrap.ts index 3d2d4ff5..3f5622e4 100644 --- a/app/graphics/textwrap.ts +++ b/app/graphics/textwrap.ts @@ -11,6 +11,11 @@ export interface WrapFont { export type WrapTextOptions = { preserveLeadingWhitespace?: boolean; + /** + * A word too wide for a line of its own starts on the current line and is + * split at the width, rather than first being pushed to a line of its own. + * Words that fit on a line still wrap whole. + */ breakLongWords?: boolean; }; @@ -89,17 +94,20 @@ function wrapParagraph(font: WrapFont, paragraph: string, targetWidth: number, o while (start < paragraph.length) { let best = -1; + let overflow = -1; for (const candidate of wrapOffsets) { if (candidate <= start) continue; if (measureSpan(widths, candidate) - measureSpan(widths, start) <= targetWidth) { best = candidate; continue; } + overflow = candidate; break; } const splitOffset = furthestFittingOffset(widths, start, targetWidth); - if (opts.breakLongWords && splitOffset > start && (best < 0 || splitOffset > trimEndOffset(paragraph, best))) { + if (opts.breakLongWords && splitOffset > start && splitOffset > best + && (best < 0 || (overflow >= 0 && wordWidth(paragraph, widths, best, overflow) > targetWidth))) { best = splitOffset; } if (best < 0) { @@ -157,6 +165,11 @@ function measureSpan(widths: Map, offset: number): number { return widths.get(offset) ?? 0; } +/** Width of the word between two wrap offsets, without surrounding whitespace. */ +function wordWidth(text: string, widths: Map, from: number, to: number): number { + return measureSpan(widths, trimEndOffset(text, to)) - measureSpan(widths, skipLeadingWhitespace(text, from)); +} + function skipLeadingWhitespace(text: string, offset: number): number { let cursor = offset; while (cursor < text.length) { diff --git a/app/native/ambient-light-types.ts b/app/native/ambient-light-types.ts new file mode 100644 index 00000000..62ba1525 --- /dev/null +++ b/app/native/ambient-light-types.ts @@ -0,0 +1,93 @@ +/** + * Platform-neutral ambient-light types and the CFW report decoder (settings + * field 105), shared by ambient-light.ts and ambient-light.ios.ts. + */ + +export const ALS_REPORT_VERSION = 1; + +export type AmbientLightReason = "query" | "started" | "poll" | "stopped"; + +export type AmbientLightReport = { + reason: AmbientLightReason; + /** The sensor driver is open (readings are live). */ + opened: boolean; + /** CFW passive polling is installed (stock auto-brightness is not stepping). */ + passive: boolean; + /** The user's stock auto-brightness setting is on. */ + autoBrightness: boolean; + /** The last passive read succeeded (only meaningful while passive). */ + readOk: boolean; + /** Stock driver status: 1 start-read, 2 adjusting, 3 polling. */ + status: number; + /** Ambient light in the stock driver's units (roughly tenths of a lux). */ + alsValue: number; + /** Max of the last five readings (what the stock curve is applied to). */ + peak: number; + /** Brightness level (0..100) the stock curve would choose for `peak`. */ + stockTarget: number; + /** Current brightness setting (0..100). */ + brightness: number; + /** Row of the stock brightness curve (0..5) for `peak`. */ + gear: number; + /** Stock learned scale factor, Q10 (1024 = 1.0). */ + scaleQ10: number; + /** Firmware millisecond tick when the report was built. */ + tickMs: number; +}; + +const REASONS: AmbientLightReason[] = ["query", "started", "poll", "stopped"]; + +function rd16(b: Uint8Array, i: number): number { + return b[i] | (b[i + 1] << 8); +} + +function rd32(b: Uint8Array, i: number): number { + return (b[i] | (b[i + 1] << 8) | (b[i + 2] << 16) | (b[i + 3] << 24)) >>> 0; +} + +/** Decode a field-105 record body, or null when it isn't one. */ +export function decodeAmbientLightReport(body: Uint8Array): AmbientLightReport | null { + if (body.length < 24 || body[0] !== 0x41 || body[1] !== 0x4c || body[2] !== ALS_REPORT_VERSION) { + return null; + } + const flags = body[4]; + return { + reason: REASONS[body[3]] ?? "poll", + opened: (flags & 0x01) !== 0, + passive: (flags & 0x02) !== 0, + autoBrightness: (flags & 0x04) !== 0, + readOk: (flags & 0x08) !== 0, + status: body[5], + alsValue: rd32(body, 6), + peak: rd32(body, 10), + stockTarget: rd16(body, 14), + brightness: body[16], + gear: body[17], + scaleQ10: rd16(body, 18), + tickMs: rd32(body, 20), + }; +} + +export type AmbientLightPollingOptions = { + /** Poll period in ms; the firmware clamps to 100..5000. Default 500. */ + intervalMs?: number; + /** Report when the reading moved by at least this much. Default 1. */ + minDelta?: number; + /** Also report after this many ms without one (0 = never). Default 5000. */ + heartbeatMs?: number; + /** + * Stop automatically when the Faceclaw framebuffer lease is released or + * lapses (the phone went away). Default true. + */ + bindToLease?: boolean; +}; + +/** The options with their defaults filled in. */ +export function resolvePollingOptions(options: AmbientLightPollingOptions): Required { + return { + intervalMs: options.intervalMs ?? 500, + minDelta: options.minDelta ?? 1, + heartbeatMs: options.heartbeatMs ?? 5000, + bindToLease: options.bindToLease ?? true, + }; +} diff --git a/app/native/ambient-light.ios.ts b/app/native/ambient-light.ios.ts new file mode 100644 index 00000000..3a3c35ea --- /dev/null +++ b/app/native/ambient-light.ios.ts @@ -0,0 +1,51 @@ +import { FaceclawCommunicatorBridge } from "./faceclaw-communicator.ios"; +import { + decodeAmbientLightReport, + resolvePollingOptions, + type AmbientLightPollingOptions, + type AmbientLightReport, +} from "./ambient-light-types"; + +export * from "./ambient-light-types"; + +/** + * Ambient light sensor access on iOS: the same API as ambient-light.ts (see + * there for the CFW query and passive-polling semantics) over the running + * shared-Kotlin session. No-ops while no session is running. + */ + +/** Ask the firmware for one ambient-light report (delivered to listeners). */ +export function queryAmbientLight(): void { + try { + FaceclawCommunicatorBridge.getActive()?.queryAmbientLight(); + } catch (error) { + console.warn(`queryAmbientLight failed: ${error}`); + } +} + +/** Start or stop CFW passive light-sensor polling. */ +export function setAmbientLightPolling(enabled: boolean, options: AmbientLightPollingOptions = {}): void { + const { intervalMs, minDelta, heartbeatMs, bindToLease } = resolvePollingOptions(options); + try { + FaceclawCommunicatorBridge.getActive()?.setAmbientLightPolling(enabled, intervalMs, minDelta, heartbeatMs, bindToLease); + } catch (error) { + console.warn(`setAmbientLightPolling failed: ${error}`); + } +} + +/** Subscribe to decoded ambient-light reports. Delivered on the main thread. */ +export function addAmbientLightListener(listener: (report: AmbientLightReport) => void): () => void { + const active = FaceclawCommunicatorBridge.getActive(); + if (!active) return () => {}; + const unsubscribe = active.addAmbientLightListener((body) => { + const report = decodeAmbientLightReport(body); + if (report) listener(report); + }); + return () => { + try { + unsubscribe(); + } catch { + // The session may have been closed during a disconnect. + } + }; +} diff --git a/app/native/ambient-light.ts b/app/native/ambient-light.ts index 51334d46..412d926e 100644 --- a/app/native/ambient-light.ts +++ b/app/native/ambient-light.ts @@ -16,88 +16,17 @@ * Reports are 24-byte ['A','L',version,...] records on settings field 105. */ import { toUint8Array } from "../util/array-util"; +import { + decodeAmbientLightReport, + resolvePollingOptions, + type AmbientLightPollingOptions, + type AmbientLightReport, +} from "./ambient-light-types"; declare const com: any; declare const global: any; -export const ALS_REPORT_VERSION = 1; - -export type AmbientLightReason = "query" | "started" | "poll" | "stopped"; - -export type AmbientLightReport = { - reason: AmbientLightReason; - /** The sensor driver is open (readings are live). */ - opened: boolean; - /** CFW passive polling is installed (stock auto-brightness is not stepping). */ - passive: boolean; - /** The user's stock auto-brightness setting is on. */ - autoBrightness: boolean; - /** The last passive read succeeded (only meaningful while passive). */ - readOk: boolean; - /** Stock driver status: 1 start-read, 2 adjusting, 3 polling. */ - status: number; - /** Ambient light in the stock driver's units (roughly tenths of a lux). */ - alsValue: number; - /** Max of the last five readings (what the stock curve is applied to). */ - peak: number; - /** Brightness level (0..100) the stock curve would choose for `peak`. */ - stockTarget: number; - /** Current brightness setting (0..100). */ - brightness: number; - /** Row of the stock brightness curve (0..5) for `peak`. */ - gear: number; - /** Stock learned scale factor, Q10 (1024 = 1.0). */ - scaleQ10: number; - /** Firmware millisecond tick when the report was built. */ - tickMs: number; -}; - -const REASONS: AmbientLightReason[] = ["query", "started", "poll", "stopped"]; - -function rd16(b: Uint8Array, i: number): number { - return b[i] | (b[i + 1] << 8); -} - -function rd32(b: Uint8Array, i: number): number { - return (b[i] | (b[i + 1] << 8) | (b[i + 2] << 16) | (b[i + 3] << 24)) >>> 0; -} - -/** Decode a field-105 record body, or null when it isn't one. */ -export function decodeAmbientLightReport(body: Uint8Array): AmbientLightReport | null { - if (body.length < 24 || body[0] !== 0x41 || body[1] !== 0x4c || body[2] !== ALS_REPORT_VERSION) { - return null; - } - const flags = body[4]; - return { - reason: REASONS[body[3]] ?? "poll", - opened: (flags & 0x01) !== 0, - passive: (flags & 0x02) !== 0, - autoBrightness: (flags & 0x04) !== 0, - readOk: (flags & 0x08) !== 0, - status: body[5], - alsValue: rd32(body, 6), - peak: rd32(body, 10), - stockTarget: rd16(body, 14), - brightness: body[16], - gear: body[17], - scaleQ10: rd16(body, 18), - tickMs: rd32(body, 20), - }; -} - -export type AmbientLightPollingOptions = { - /** Poll period in ms; the firmware clamps to 100..5000. Default 500. */ - intervalMs?: number; - /** Report when the reading moved by at least this much. Default 1. */ - minDelta?: number; - /** Also report after this many ms without one (0 = never). Default 5000. */ - heartbeatMs?: number; - /** - * Stop automatically when the Faceclaw framebuffer lease is released or - * lapses (the phone went away). Default true. - */ - bindToLease?: boolean; -}; +export * from "./ambient-light-types"; function activeCommunicator(): any { if (!global.isAndroid) return null; @@ -123,14 +52,9 @@ export function queryAmbientLight(): void { * on every session start. */ export function setAmbientLightPolling(enabled: boolean, options: AmbientLightPollingOptions = {}): void { + const { intervalMs, minDelta, heartbeatMs, bindToLease } = resolvePollingOptions(options); try { - activeCommunicator()?.setAmbientLightPolling( - enabled, - options.intervalMs ?? 500, - options.minDelta ?? 1, - options.heartbeatMs ?? 5000, - options.bindToLease ?? true, - ); + activeCommunicator()?.setAmbientLightPolling(enabled, intervalMs, minDelta, heartbeatMs, bindToLease); } catch (error) { console.warn(`setAmbientLightPolling failed: ${error}`); } diff --git a/app/native/audio-monitor.ios.ts b/app/native/audio-monitor.ios.ts new file mode 100644 index 00000000..48cf3ac6 --- /dev/null +++ b/app/native/audio-monitor.ios.ts @@ -0,0 +1,50 @@ +import { FaceclawCommunicatorBridge } from "./faceclaw-communicator.ios"; + +/** + * Passive view of the glasses' audio traffic on iOS: the same API as + * audio-monitor.ts over the running shared-Kotlin session. Nothing here sends + * anything to the glasses. + */ + +export type AudioArm = "L" | "R" | "?"; + +/** The session listeners attach to; changes across reconnects. */ +export function audioMonitorCommunicator(): FaceclawCommunicatorBridge | null { + return FaceclawCommunicatorBridge.getActive(); +} + +/** True while Faceclaw itself is forwarding glasses audio to one of its apps. */ +export function isFaceclawAudioCaptureActive(): boolean { + try { + return Boolean(FaceclawCommunicatorBridge.getActive()?.isAudioCaptureActive()); + } catch { + return false; + } +} + +/** + * Subscribe `communicator` to every audio-characteristic packet and every + * field-104 mic status record body (undecoded). Delivered on the main thread. + * Returns an unsubscribe function. + */ +export function addAudioMonitorListeners( + communicator: FaceclawCommunicatorBridge | null, + onPacket: (data: Uint8Array, arm: AudioArm, arrivalMs: number) => void, + onStatus: (body: Uint8Array, arm: AudioArm) => void, +): () => void { + if (!communicator) return () => {}; + const offPackets = communicator.addAudioMonitorListener((data, arm, arrivalMs) => onPacket(data, toArm(arm), arrivalMs)); + const offStatus = communicator.addMicStatusListener((body, arm) => onStatus(body, toArm(arm))); + return () => { + try { + offPackets(); + offStatus(); + } catch { + // The session may have been closed during a disconnect. + } + }; +} + +function toArm(arm: string): AudioArm { + return arm === "L" || arm === "R" ? arm : "?"; +} diff --git a/app/native/bandwidth-benchmark.ios.ts b/app/native/bandwidth-benchmark.ios.ts new file mode 100644 index 00000000..277896a1 --- /dev/null +++ b/app/native/bandwidth-benchmark.ios.ts @@ -0,0 +1,49 @@ +import type { BandwidthBenchmarkStatus } from './bandwidth-benchmark' +export type { BandwidthBenchmarkStatus } from './bandwidth-benchmark' + +// The iOS twin of the Android benchmark bridge. iOS has no static active +// communicator, so the preview controller binds its session here on connect +// and unbinds it on close; the run itself is the same shared-Kotlin +// GlassesSessionCore stream as on Android. +type BenchmarkSession = { + startBandwidthBenchmark(messageSize: number, windowSize: number, durationMs: number, linkMode: number): boolean + cancelBandwidthBenchmark(): void + getBandwidthBenchmarkStatus(): string +} +let session: BenchmarkSession | null = null + +export function bindBandwidthBenchmarkSession(next: BenchmarkSession | null): void { + session = next +} + +/** Start a run. False if not connected or a run is already active. */ +export function startBandwidthBenchmark(messageSize: number, windowSize: number, durationMs: number, linkMode = 0): boolean { + if (!session) return false + try { + return session.startBandwidthBenchmark( + Math.round(messageSize), Math.round(windowSize), Math.round(durationMs), Math.round(linkMode)) + } catch (error) { + console.warn(`startBandwidthBenchmark failed: ${error}`) + return false + } +} + +/** Cancel an in-progress run. Safe to call when idle. */ +export function cancelBandwidthBenchmark(): void { + try { + session?.cancelBandwidthBenchmark() + } catch (error) { + console.warn(`cancelBandwidthBenchmark failed: ${error}`) + } +} + +/** Status of the current or most recent run; null when not connected. */ +export function getBandwidthBenchmarkStatus(): BandwidthBenchmarkStatus | null { + if (!session) return null + try { + return JSON.parse(session.getBandwidthBenchmarkStatus()) as BandwidthBenchmarkStatus + } catch (error) { + console.warn(`getBandwidthBenchmarkStatus failed: ${error}`) + return null + } +} diff --git a/app/native/bandwidth-benchmark.ts b/app/native/bandwidth-benchmark.ts index c480c7d3..ad1b7701 100644 --- a/app/native/bandwidth-benchmark.ts +++ b/app/native/bandwidth-benchmark.ts @@ -22,6 +22,9 @@ export type BandwidthBenchmarkStatus = { payloadBytesAcked: number; wireBytesAcked: number; aborted: boolean; + /** Each arm's current PHY ("2M", "1M", ...); null when the platform doesn't report it. */ + leftPhy?: string | null; + rightPhy?: string | null; }; function activeCommunicator(): any { diff --git a/app/native/binary-http.ios.ts b/app/native/binary-http.ios.ts index e65172ab..80eb7c1d 100644 --- a/app/native/binary-http.ios.ts +++ b/app/native/binary-http.ios.ts @@ -2,11 +2,18 @@ import { Http } from '@nativescript/core'; import { withUserAgent } from '../util/http'; import type { BinaryPostResponse, BinaryResponse } from './binary-http'; -/** Bulk NSData -> ArrayBuffer; bypass fetch's Blob/FileReader copies. */ +/** + * Bulk NSData -> ArrayBuffer; bypass fetch's Blob/FileReader copies. + * + * toArrayBuffer() is interop.bufferFromData, which in @nativescript/ios 9.0.3 + * views the NSData's bytes without retaining it: once the response is + * collected, the buffer is dangling (a store EHPK was saved as 41 MB of + * zeros). Copy while the response is still alive. + */ export async function downloadBinary(url: string, timeoutMs: number): Promise { const response = await Http.request({ url, method: 'GET', headers: withUserAgent(), timeout: timeoutMs }); const length = Object.entries(response.headers).find(([name]) => name.toLowerCase() === 'content-length')?.[1]; - return { status: response.statusCode, bytes: new Uint8Array(response.content.toArrayBuffer()), contentLength: Number(length ?? 0) }; + return { status: response.statusCode, bytes: new Uint8Array(response.content.toArrayBuffer()).slice(), contentLength: Number(length ?? 0) }; } /** POST a binary body and read the response as text; NativeScript hands an ArrayBuffer to NSURLRequest as one NSData. */ diff --git a/app/native/cloud-stt-provider.ts b/app/native/cloud-stt-provider.ts index 2ab6ea08..566cb1d7 100644 --- a/app/native/cloud-stt-provider.ts +++ b/app/native/cloud-stt-provider.ts @@ -12,13 +12,17 @@ import { normalizeWhisperServerUrl, WHISPER_SERVER_FINAL_TIMEOUT_MS, WhisperServ */ export type VoiceProviderSelection = { provider: VoiceProviderKind; + /** + * Spoken language the provider should expect (ISO 639-1); empty lets it + * detect the language. Cloud providers only. + */ + language?: string; elevenLabsApiKey: string; openAiApiKey: string; sonioxApiKey: string; /** Self-hosted Whisper ("whisper-server"); the key is optional there. */ whisperServerUrl?: string; whisperServerModel?: string; - whisperServerLanguage?: string; whisperServerApiKey?: string; }; @@ -58,7 +62,7 @@ const CLOUD_PROVIDERS: Partial> = { create: (options, selection) => new WhisperServerSttClient(options, { baseUrl: selection.whisperServerUrl ?? "", model: selection.whisperServerModel ?? "", - language: selection.whisperServerLanguage ?? "", + language: selection.language ?? "", }), finalTimeoutMs: WHISPER_SERVER_FINAL_TIMEOUT_MS, }, @@ -69,14 +73,11 @@ function isConfigured(provider: CloudProvider, selection: VoiceProviderSelection } /** - * What a capture transcribes with: the provider, and for Whisper server the - * language it is told to expect. A running capture is shared only by holders - * asking for the same. + * What a capture transcribes with: the provider and the language it is told + * to expect. A running capture is shared only by holders asking for the same. */ -export function transcriptionKey(selection: Pick): string { - return selection.provider === "whisper-server" - ? `whisper-server:${(selection.whisperServerLanguage ?? "").trim().toLowerCase()}` - : selection.provider; +export function transcriptionKey(selection: Pick): string { + return `${selection.provider}:${(selection.language ?? "").trim().toLowerCase()}`; } /** Whether createCloudSttClient would return a cloud client for this selection. */ @@ -105,7 +106,7 @@ export function createCloudSttClient( const apiKey = provider.apiKey(selection).trim(); return new ReconnectingSttClient( (clientOptions) => provider.create(clientOptions, selection), - { ...options, apiKey }, + { ...options, apiKey, language: (selection.language ?? "").trim() }, continuous, provider.finalTimeoutMs, ); diff --git a/app/native/cloud-stt.ts b/app/native/cloud-stt.ts index 2600f802..40d4629f 100644 --- a/app/native/cloud-stt.ts +++ b/app/native/cloud-stt.ts @@ -17,6 +17,8 @@ export type CloudSttTranscriptEvent = { export type CloudSttOptions = { apiKey: string; + /** Spoken language to expect (ISO 639-1); empty or absent lets the provider detect it. */ + language?: string; onTranscript: (event: CloudSttTranscriptEvent) => void; onStatus: (status: string) => void; onError: (message: string) => void; diff --git a/app/native/elevenlabs-stt.ts b/app/native/elevenlabs-stt.ts index bc493fb9..8b8ee545 100644 --- a/app/native/elevenlabs-stt.ts +++ b/app/native/elevenlabs-stt.ts @@ -33,7 +33,10 @@ export class ElevenLabsSttClient { start(): void { if (this.closed || this.ws) return; - const url = `${WS_URL}?model_id=${MODEL_ID}&audio_format=pcm_${SAMPLE_RATE}&commit_strategy=manual`; + // Without language_code the model detects the language, which can go + // badly wrong on short or noisy segments (Japanese heard as Russian). + const language = this.options.language ? `&language_code=${encodeURIComponent(this.options.language)}` : ""; + const url = `${WS_URL}?model_id=${MODEL_ID}&audio_format=pcm_${SAMPLE_RATE}&commit_strategy=manual${language}`; const listener = { onOpen: () => { if (this.closed) return; diff --git a/app/native/faceclaw-communicator.ios.ts b/app/native/faceclaw-communicator.ios.ts index 6a865fe8..377dbe07 100644 --- a/app/native/faceclaw-communicator.ios.ts +++ b/app/native/faceclaw-communicator.ios.ts @@ -2,6 +2,7 @@ import type { RingInput } from "../g2/ring-input"; import { File, knownFolders, path, type ImageSource } from "@nativescript/core"; import { REQUIRED_FACECLAW_FIRMWARE_VERSION, type FirmwareInfo } from "../g2/firmware-compat"; import { type CompassEvent } from "./compass-types"; +import { type ImuReading } from "./imu-types"; import { fromData, toData } from "./kotlin-data"; import { previewPixels } from "./ios-graphics"; import { iosBluetooth } from "./ios-bluetooth"; @@ -14,6 +15,9 @@ declare const FaceclawKitFaceclawBleCommunicatorListener: any; declare const FaceclawKitIosAncsListener: any; declare const FaceclawKitIosAudioPacketListener: any; declare const FaceclawKitFaceclawCompassListener: any; +declare const FaceclawKitFaceclawImuListener: any; +declare const FaceclawKitIosAmbientLightListener: any; +declare const FaceclawKitIosMicStatusListener: any; export type CommunicatorPhase = @@ -164,6 +168,29 @@ class CompassListener extends NSObject { } } +@NativeClass() +class ImuListener extends NSObject { + static ObjCProtocols = [FaceclawKitFaceclawImuListener]; + handler!: (reading: ImuReading) => void; + onImuDataXYZEventSource(x: number, y: number, z: number, eventSource: number): void { + this.handler({ x: Number(x), y: Number(y), z: Number(z), source: Number(eventSource) }); + } +} + +@NativeClass() +class AmbientLightListener extends NSObject { + static ObjCProtocols = [FaceclawKitIosAmbientLightListener]; + handler!: (body: Uint8Array) => void; + onNsDataAmbientLightBody(body: NSData): void { this.handler(fromData(body)); } +} + +@NativeClass() +class MicStatusListener extends NSObject { + static ObjCProtocols = [FaceclawKitIosMicStatusListener]; + handler!: (body: Uint8Array, arm: string) => void; + onNsDataMicStatusBodyArm(body: NSData, arm: string): void { this.handler(fromData(body), String(arm ?? "")); } +} + /** * The iOS twin of the Android communicator bridge: the same public API over * the shared Kotlin session (FaceclawKitIosGlassesSession, CoreBluetooth @@ -173,6 +200,8 @@ class CompassListener extends NSObject { * Android so callers never re-enter the bridge from a Kotlin frame. */ export class FaceclawCommunicatorBridge { + // The started, not yet closed bridge (see getActive). + private static active: FaceclawCommunicatorBridge | null = null; private readonly communicator: any; private readonly listenerProxy: SessionListener; private ancsProxy: AncsListener | null = null; @@ -200,6 +229,17 @@ export class FaceclawCommunicatorBridge { private audioListener: AudioPacketListener | null = null; private microphoneWork: Promise = Promise.resolve(); private microphoneToken = 0; + private closed = false; + + /** + * The bridge whose session is running, for modules that reach the glasses + * without the bridge threaded through (imu, ambient-light, audio-monitor): + * the iOS stand-in for Android's FaceclawBleCommunicator.getActive(). + * Set by start(), cleared by close(). + */ + static getActive(): FaceclawCommunicatorBridge | null { + return FaceclawCommunicatorBridge.active; + } constructor(addresses: { right: string; left: string; ring?: string; ringRole?: string }) { this.communicator = FaceclawKitIosGlassesSession.alloc().initWithRightAddressLeftAddressRingAddress( @@ -454,7 +494,9 @@ export class FaceclawCommunicatorBridge { // ----- session --------------------------------------------------------------------- async start(): Promise { - await this.enqueueNativeCall(() => { this.communicator.start(); }); + await this.enqueueNativeCall(() => { + if (this.communicator.start() && !this.closed) FaceclawCommunicatorBridge.active = this; + }); } async setG2ScreenOn(screenOn: boolean): Promise { @@ -644,6 +686,8 @@ export class FaceclawCommunicatorBridge { } async close(): Promise { + this.closed = true; + if (FaceclawCommunicatorBridge.active === this) FaceclawCommunicatorBridge.active = null; this.setAncsListeners(false); this.previewAnimationListeners.clear(); await this.enqueueNativeCall(() => { @@ -667,6 +711,85 @@ export class FaceclawCommunicatorBridge { return () => { this.communicator.removeCompassListenerListener(proxy); }; } + /** Developer > Debug tests > BLE bandwidth; see app/native/bandwidth-benchmark.ios.ts. */ + startBandwidthBenchmark(messageSize: number, windowSize: number, durationMs: number, linkMode: number): boolean { + return Boolean(this.communicator.startBandwidthBenchmarkWithLinkModeMessageSizeWindowSizeDurationMsLinkMode( + messageSize, windowSize, durationMs, linkMode)); + } + + cancelBandwidthBenchmark(): void { + this.communicator.cancelBandwidthBenchmark(); + } + + /** Status/results of the current or most recent run, as JSON. */ + getBandwidthBenchmarkStatus(): string { + return String(this.communicator.getBandwidthBenchmarkStatus()); + } + + // ----- sensors and passive audio, for the developer demos ----------------------------- + // Fire-and-forget, so they skip the native-call queue like the compass controls do. + + /** Enable/disable the accelerometer report stream (an ImuReportPace code, 100..1000). */ + setImuReportEnabled(enable: boolean, reportFrq: number): void { + this.communicator.setImuReportEnabledEnableReportFrq(Boolean(enable), Math.max(0, Math.round(reportFrq))); + } + + /** Accelerometer samples, delivered on the main queue. */ + addImuListener(listener: (reading: ImuReading) => void): () => void { + const proxy = ImuListener.new() as ImuListener; + proxy.handler = listener; + this.communicator.addImuListenerListener(proxy); + return () => { this.communicator.removeImuListenerListener(proxy); }; + } + + /** Ask the CFW for one ambient-light report (delivered to the ambient-light listeners). */ + queryAmbientLight(): void { + this.communicator.queryAmbientLight(); + } + + setAmbientLightPolling(enable: boolean, intervalMs: number, minDelta: number, heartbeatMs: number, bindToLease: boolean): void { + this.communicator.setAmbientLightPollingEnableIntervalMsMinDeltaHeartbeatMsBindToLease(Boolean(enable), + Math.round(intervalMs), Math.round(minDelta), Math.round(heartbeatMs), Boolean(bindToLease)); + } + + /** Raw field-105 ambient-light records, delivered on the main queue. */ + addAmbientLightListener(listener: (body: Uint8Array) => void): () => void { + const proxy = AmbientLightListener.new() as AmbientLightListener; + proxy.handler = listener; + const handle = this.communicator.addAmbientLightListenerNsDataListener(proxy); + return () => { this.communicator.removeAmbientLightListenerListener(handle); }; + } + + /** Raw field-104 mic_control status records and their temple ("L", "R" or "?"), on the main queue. */ + addMicStatusListener(listener: (body: Uint8Array, arm: string) => void): () => void { + const proxy = MicStatusListener.new() as MicStatusListener; + proxy.handler = listener; + const handle = this.communicator.addMicStatusListenerNsDataListener(proxy); + return () => { this.communicator.removeMicStatusListenerListener(handle); }; + } + + /** Queue a CFW mic_control record for the chosen temples; false when nothing was queued. */ + sendFaceclawMicControl(record: Uint8Array, label: string, rightTemple: boolean, leftTemple: boolean): boolean { + return Boolean(this.communicator.sendFaceclawMicControlRecordLabelRightTempleLeftTemple( + toData(new Uint8Array(record)), label, Boolean(rightTemple), Boolean(leftTemple))); + } + + /** + * Every audio-characteristic packet, whatever enabled the mics, on the + * main queue. Passive: sends nothing and doesn't affect capture. + */ + addAudioMonitorListener(listener: (packet: Uint8Array, arm: string, arrivalMs: number) => void): () => void { + const proxy = AudioPacketListener.new() as AudioPacketListener; + proxy.handler = listener; + const handle = this.communicator.addAudioMonitorListenerNsDataListener(proxy); + return () => { this.communicator.removeAudioMonitorListenerListener(handle); }; + } + + /** True while Faceclaw itself is forwarding glasses audio (speech capture or an app's mic). */ + isAudioCaptureActive(): boolean { + return Boolean(this.communicator.isAudioCaptureActive()); + } + /** * Serialized glasses microphone enable/disable (the voice bridge's * IosMicrophoneSession contract). A release while an enable awaits its ACK diff --git a/app/native/imu-types.ts b/app/native/imu-types.ts new file mode 100644 index 00000000..bc0eb693 --- /dev/null +++ b/app/native/imu-types.ts @@ -0,0 +1,17 @@ +/** Platform-neutral IMU types, shared by imu.ts and imu.ios.ts. */ + +export type ImuReading = { x: number; y: number; z: number; source: number }; + +/** Map an IMU sample's EventSource to a short label. */ +export function imuSourceLabel(source: number): string { + switch (source) { + case 1: + return "R arm"; + case 2: + return "ring"; + case 3: + return "L arm"; + default: + return "device"; + } +} diff --git a/app/native/imu.ios.ts b/app/native/imu.ios.ts new file mode 100644 index 00000000..32288335 --- /dev/null +++ b/app/native/imu.ios.ts @@ -0,0 +1,34 @@ +import { FaceclawCommunicatorBridge } from "./faceclaw-communicator.ios"; +import { type ImuReading } from "./imu-types"; + +export * from "./imu-types"; + +/** + * IMU (accelerometer) access on iOS: the same API as imu.ts over the running + * shared-Kotlin session. As there, the stream is experimental, the calls are + * no-ops while no session is running, and a listener stays with the session + * it subscribed to. + */ + +/** Enable/disable the accelerometer report stream. No-op if not connected. */ +export function setImuReportEnabled(enable: boolean, reportFreq: number): void { + try { + FaceclawCommunicatorBridge.getActive()?.setImuReportEnabled(enable, reportFreq); + } catch (error) { + console.warn(`setImuReportEnabled failed: ${error}`); + } +} + +/** Subscribe to IMU readings; returns an unsubscribe function. */ +export function addImuListener(listener: (reading: ImuReading) => void): () => void { + const active = FaceclawCommunicatorBridge.getActive(); + if (!active) return () => {}; + const unsubscribe = active.addImuListener(listener); + return () => { + try { + unsubscribe(); + } catch { + // The session may be gone after a disconnect; nothing to clean up. + } + }; +} diff --git a/app/native/imu.ts b/app/native/imu.ts index c01cd962..11a1cdc2 100644 --- a/app/native/imu.ts +++ b/app/native/imu.ts @@ -12,7 +12,9 @@ declare const com: any; * static, so it works from any isolate without threading the bridge through. */ -export type ImuReading = { x: number; y: number; z: number; source: number }; +import { type ImuReading } from "./imu-types"; + +export * from "./imu-types"; function activeCommunicator(): any { if (!global.isAndroid) return null; @@ -52,17 +54,3 @@ export function addImuListener(listener: (reading: ImuReading) => void): () => v } }; } - -/** Map an IMU sample's EventSource to a short label. */ -export function imuSourceLabel(source: number): string { - switch (source) { - case 1: - return "R arm"; - case 2: - return "ring"; - case 3: - return "L arm"; - default: - return "device"; - } -} diff --git a/app/native/llama.ts b/app/native/llama.ts index c60ad4bb..20225ae5 100644 --- a/app/native/llama.ts +++ b/app/native/llama.ts @@ -6,12 +6,14 @@ import type { LlmStreamOptions, } from "../assistant/llm-protocol"; import { buildQwenPrompt } from "../assistant/qwen-prompt"; +import type { LocalModelState } from "./local-llm-types"; declare const com: any; declare const java: any; /** - * On-phone LLM backend: model download management plus a streaming client + * Android's on-phone LLM backend (reached through local-llm.ts; iOS uses + * local-llm.ios.ts instead): model download management plus a streaming client * with the same LlmStreamOptions surface as the Anthropic/OpenAI clients, so * the direct assistant loop can treat "local" as just another provider. * Inference is llama.cpp on the CPU (FaceclawLlamaRunner over JNI). @@ -38,11 +40,7 @@ const TOP_K = 20; /** Free the ~3GB of model + KV this long after the last generation. */ const IDLE_UNLOAD_MS = 2 * 60 * 1000; -export type LocalModelState = { - status: "absent" | "downloading" | "ready"; - bytesDownloaded: number; - totalBytes: number; -}; +export type { LocalModelState } from "./local-llm-types"; let runner: any = null; let downloader: any = null; diff --git a/app/native/local-llm-types.ts b/app/native/local-llm-types.ts new file mode 100644 index 00000000..43b1d820 --- /dev/null +++ b/app/native/local-llm-types.ts @@ -0,0 +1,13 @@ +/** Shared shapes for the on-phone LLM (local-llm.ts on Android, local-llm.ios.ts on iOS). */ + +export type LocalModelState = { + /** + * Android downloads its model: absent → downloading → ready. iOS uses the + * system's Apple Intelligence model: ready, or unavailable (see detail). + */ + status: "absent" | "downloading" | "ready" | "unavailable"; + bytesDownloaded: number; + totalBytes: number; + /** Why the model can't be used, when status is "unavailable" (short, for a settings row). */ + detail?: string; +}; diff --git a/app/native/local-llm.ios.ts b/app/native/local-llm.ios.ts new file mode 100644 index 00000000..321cd0c7 --- /dev/null +++ b/app/native/local-llm.ios.ts @@ -0,0 +1,383 @@ +import type { + LlmContentBlock, + LlmMessage, + LlmStreamHandle, + LlmStreamOptions, +} from "../assistant/llm-protocol"; +import type { LocalModelState } from "./local-llm-types"; +export type { LocalModelState } from "./local-llm-types"; + +declare const FaceclawSystemLanguageModel: any; + +/** + * The on-phone LLM on iOS: Apple's Foundation Models system model (Apple + * Intelligence, iOS 26+), through FaceclawSystemLanguageModel.swift. Same + * surface as Android's local-llm.ts, so the direct assistant loop, Translate, + * Calculator and the Microphones helpers treat it as the "local" provider. + * + * Why not Android's Qwen3-4B on llama.cpp: iOS forbids GPU work in the + * background (where Faceclaw usually is, driving the glasses with the phone + * locked), CPU-only inference of a 4B model is far too slow on a phone, and a + * ~3 GB in-process model makes the app the first thing jetsam kills. The + * system model runs out of process on the Neural Engine, needs no download, + * and decodes tool arguments under a schema constraint (like our GBNF grammar + * on Android). Its costs: a 4096-token context (the Swift side fits history + * and tool definitions into it), Apple's guardrails, a background request + * budget, and Apple Intelligence-capable hardware. + * + * Tool calls: the framework runs tools itself, mid-response. The Swift side + * parks each call and reports it; here that ends the loop iteration with + * stopReason "tool_use", the direct backend executes the tools as for any + * provider, and its next request (ending in the matching tool_result blocks) + * resumes the parked generation instead of starting a new one. + */ + +export const LOCAL_MODEL = { + id: "apple-foundation-model", + label: "Apple Intelligence", + sizeBytes: 0, +}; + +const DEFAULT_MAX_TOKENS = 512; +/** A generation parked in a tool call is abandoned if the tool loop never returns. */ +const PARKED_TIMEOUT_MS = 3 * 60 * 1000; +/** + * Only used when tool results arrive with no parked generation to resume (it + * timed out, or the app restarted mid-turn): the framework has no way to + * continue after a tool output without a new prompt. + */ +export const CONTINUE_PROMPT = "Use the tool results above to finish answering my last request."; + +type Availability = + | "available" + | "unsupportedOS" + | "deviceNotEligible" + | "appleIntelligenceNotEnabled" + | "modelNotReady" + | "unavailable"; + +const UNAVAILABLE_DETAIL: Record, string> = { + unsupportedOS: "needs iOS 26", + deviceNotEligible: "not on this iPhone", + appleIntelligenceNotEnabled: "Apple Intelligence off", + modelNotReady: "downloading", + unavailable: "unavailable", +}; + +const UNAVAILABLE_MESSAGE: Record, string> = { + unsupportedOS: "The on-phone model needs iOS 26 or later with Apple Intelligence.", + deviceNotEligible: "This iPhone doesn't support Apple Intelligence, which the on-phone model uses.", + appleIntelligenceNotEnabled: + "Turn on Apple Intelligence (iOS Settings > Apple Intelligence & Siri) to use the on-phone model.", + modelNotReady: "Apple Intelligence is still downloading its model. Try again later.", + unavailable: "Apple Intelligence's on-device model is unavailable right now.", +}; + +export function localModelAvailability(): Availability { + try { + if (typeof FaceclawSystemLanguageModel === "undefined") return "unsupportedOS"; + const value = String(FaceclawSystemLanguageModel.availability()); + return value in UNAVAILABLE_MESSAGE || value === "available" ? (value as Availability) : "unavailable"; + } catch { + return "unsupportedOS"; + } +} + +/** Whether this iPhone can ever run the model (Apple Intelligence may still be off or downloading). */ +export function isLocalModelSupported(): boolean { + const availability = localModelAvailability(); + return availability !== "unsupportedOS" && availability !== "deviceNotEligible"; +} + +export function isLocalModelReady(): boolean { + return localModelAvailability() === "available"; +} + +export function localModelState(): LocalModelState { + const availability = localModelAvailability(); + if (availability === "available") return { status: "ready", bytesDownloaded: 0, totalBytes: 0 }; + return { status: "unavailable", bytesDownloaded: 0, totalBytes: 0, detail: UNAVAILABLE_DETAIL[availability] }; +} + +/** The user-facing reason the model can't run, or "" when it can. */ +export function localModelUnavailableMessage(): string { + const availability = localModelAvailability(); + return availability === "available" ? "" : UNAVAILABLE_MESSAGE[availability]; +} + +// iOS manages the system model itself: there is nothing to download, cancel, +// delete or unload, and no progress to watch. +export function onLocalModelStateChanged(_listener: (state: LocalModelState) => void): () => void { + return () => {}; +} +export function startLocalModelDownload(): void {} +export function cancelLocalModelDownload(): void {} +export function deleteLocalModel(): void {} +export function unloadLocalModel(): void {} + +type HistoryEntry = + | { type: "prompt" | "response"; text: string } + | { type: "toolCalls"; calls: Array<{ id: string; name: string; arguments: string }> } + | { type: "toolOutput"; id: string; name: string; text: string }; + +export type SystemModelRequest = { + system: string; + tools: Array<{ name: string; description: string; parameters: object }>; + history: HistoryEntry[]; + prompt: string; + maxTokens: number; + permissive: boolean; +}; + +type ToolResultBlock = Extract; + +/** + * Translate provider-neutral history into the Swift request: everything but + * the newest user prompt becomes Transcript entries, and that prompt is what + * the model answers. + */ +export function buildSystemModelRequest( + options: Pick, +): SystemModelRequest { + const messages = options.messages; + const last = messages[messages.length - 1]; + const endsWithPrompt = last?.role === "user" && !toolResultsOf(last).length; + const history: HistoryEntry[] = []; + const toolNames = new Map(); + for (const message of endsWithPrompt ? messages.slice(0, -1) : messages) { + appendHistory(history, message, toolNames); + } + const tools = (options.tools ?? []).map((tool) => ({ + name: tool.name, + description: tool.description, + parameters: tool.input_schema, + })); + return { + system: options.system?.trim() || "You are a helpful assistant.", + tools, + history, + prompt: endsWithPrompt ? textOf(last.content) : CONTINUE_PROMPT, + maxTokens: options.maxTokens ?? DEFAULT_MAX_TOKENS, + // Tool-free requests transform user text (translate, summarize, Q&A over transcripts). + permissive: tools.length === 0, + }; +} + +function appendHistory(history: HistoryEntry[], message: LlmMessage, toolNames: Map): void { + if (message.role === "user") { + for (const result of toolResultsOf(message)) { + const body = result.is_error ? `Error: ${result.content}` : result.content || "(no output)"; + history.push({ type: "toolOutput", id: result.tool_use_id, name: toolNames.get(result.tool_use_id) ?? "tool", text: body }); + } + const text = textOf(message.content); + if (text) history.push({ type: "prompt", text }); + return; + } + const text = textOf(message.content); + if (text) history.push({ type: "response", text }); + if (typeof message.content === "string") return; + const calls: Array<{ id: string; name: string; arguments: string }> = []; + for (const block of message.content) { + if (block.type !== "tool_use") continue; + toolNames.set(block.id, block.name); + calls.push({ id: block.id, name: block.name, arguments: JSON.stringify(block.input ?? {}) }); + } + if (calls.length) history.push({ type: "toolCalls", calls }); +} + +function textOf(content: string | LlmContentBlock[]): string { + if (typeof content === "string") return content.trim(); + return content + .filter((block): block is Extract => block.type === "text") + .map((block) => block.text.trim()) + .filter(Boolean) + .join("\n"); +} + +function toolResultsOf(message: LlmMessage | undefined): ToolResultBlock[] { + if (!message || message.role !== "user" || typeof message.content === "string") return []; + return message.content.filter((block): block is ToolResultBlock => block.type === "tool_result"); +} + +function parseArguments(json: string): any { + try { + const value = JSON.parse(json); + return value && typeof value === "object" ? value : {}; + } catch { + return {}; + } +} + +type NativeEvent = { + kind: string; + text?: string; + calls?: Array<{ id: string; name: string; arguments: string }>; + code?: string; + message?: string; +}; + +/** Generations parked in tool calls, by call id. */ +const parked = new Map(); +/** Every unfinished generation, so its native object outlives the caller's handle. */ +const live = new Set(); + +/** + * One native generation, possibly spanning several loop iterations: each + * iteration ends at a batch of tool calls (or the end of the reply), and the + * next one resumes it with the results. + */ +class Generation { + private readonly native: any; + private options: LlmStreamOptions | null; + private iteration = 0; + private text = ""; + private callIds: string[] = []; + private expiry: ReturnType | null = null; + private closed = false; + + constructor(options: LlmStreamOptions) { + this.options = options; + this.native = FaceclawSystemLanguageModel.new(); + this.native.eventHandler = (json: string) => this.onEvent(String(json)); + live.add(this); + } + + start(request: SystemModelRequest): LlmStreamHandle { + this.native.start(JSON.stringify(request)); + return this.handle(); + } + + /** Whether these results answer this generation's parked calls. */ + awaits(results: ToolResultBlock[]): boolean { + return !this.closed && results.some((result) => this.callIds.includes(result.tool_use_id)); + } + + resume(options: LlmStreamOptions, results: ToolResultBlock[]): LlmStreamHandle { + this.unpark(); + this.options = options; + this.iteration++; + this.text = ""; + this.native.resolveToolCalls( + JSON.stringify(results.map((result) => ({ id: result.tool_use_id, content: result.content, isError: Boolean(result.is_error) }))), + ); + return this.handle(); + } + + cancel(): void { + if (this.closed) return; + this.close(); + try { + this.native.cancel(); + } catch { + // ignore + } + } + + private handle(): LlmStreamHandle { + const iteration = this.iteration; + // A stale handle (an earlier iteration's) still cancels a generation parked + // since then: its owner gave up on the turn. + return { cancel: () => { if (this.iteration === iteration || this.options === null) this.cancel(); } }; + } + + private close(): void { + this.closed = true; + this.unpark(); + this.options = null; + this.native.eventHandler = null; + live.delete(this); + } + + private park(ids: string[]): void { + this.callIds = ids; + for (const id of ids) parked.set(id, this); + this.expiry = setTimeout(() => { + console.warn("[local-llm] abandoning an on-device generation whose tool results never came back"); + this.cancel(); + }, PARKED_TIMEOUT_MS); + } + + private unpark(): void { + for (const id of this.callIds) { + if (parked.get(id) === this) parked.delete(id); + } + this.callIds = []; + if (this.expiry !== null) clearTimeout(this.expiry); + this.expiry = null; + } + + private onEvent(json: string): void { + if (this.closed) return; + let event: NativeEvent; + try { + event = JSON.parse(json); + } catch { + return; + } + if (event.kind === "log") { + console.log(`[local-llm] ${event.message ?? ""}`); + return; + } + const options = this.options; + if (!options) return; + switch (event.kind) { + case "delta": { + const delta = event.text ?? ""; + this.text += delta; + options.onTextDelta?.(delta, this.text); + return; + } + case "toolCalls": { + const calls = event.calls ?? []; + const text = this.text.trim(); + const content: LlmContentBlock[] = text ? [{ type: "text", text }] : []; + for (const call of calls) { + content.push({ type: "tool_use", id: call.id, name: call.name, input: parseArguments(call.arguments) }); + } + this.options = null; + this.park(calls.map((call) => call.id)); + options.onDone({ text, content, stopReason: "tool_use" }); + return; + } + case "done": { + this.close(); + const text = this.text.trim(); + options.onDone({ text, content: text ? [{ type: "text", text }] : [], stopReason: "end_turn" }); + return; + } + case "error": { + this.close(); + if (event.code === "refusal") { + options.onDone({ text: this.text.trim(), content: [], stopReason: "refusal" }); + } else { + options.onError(event.message || "The on-device model failed"); + } + return; + } + } + } +} + +/** + * Stream a reply from the system model. A request whose history ends in tool + * results for a parked generation resumes it; anything else starts afresh. + */ +export function streamLocalModel(options: LlmStreamOptions): LlmStreamHandle { + const availability = localModelAvailability(); + if (availability !== "available") { + setTimeout(() => options.onError(UNAVAILABLE_MESSAGE[availability]), 0); + return { cancel: () => {} }; + } + const results = toolResultsOf(options.messages[options.messages.length - 1]); + const waiting = results.map((result) => parked.get(result.tool_use_id)).find(Boolean); + if (waiting?.awaits(results)) return waiting.resume(options, results); + let generation: Generation | null = null; + try { + generation = new Generation(options); + return generation.start(buildSystemModelRequest(options)); + } catch (error) { + generation?.cancel(); + setTimeout(() => options.onError(`On-device model failed: ${String((error as Error)?.message ?? error)}`), 0); + return { cancel: () => {} }; + } +} diff --git a/app/native/local-llm.ts b/app/native/local-llm.ts new file mode 100644 index 00000000..a308647e --- /dev/null +++ b/app/native/local-llm.ts @@ -0,0 +1,28 @@ +/** + * The on-phone LLM: one entry point for every feature that can run on the + * phone without an API key (the direct assistant's "local" provider, + * Translate, Calculator's rewrite fallback, the Microphones helpers). Each + * platform supplies a streaming client with the cloud clients' LlmStreamOptions + * contract, plus model status for Settings. + * + * - Android (this file): Qwen3-4B on llama.cpp, downloaded on demand (llama.ts). + * - iOS (local-llm.ios.ts): Apple's Foundation Models system model; nothing + * to download, available on Apple Intelligence devices running iOS 26+. + */ +export { + LOCAL_MODEL, + isLocalModelReady, + localModelState, + onLocalModelStateChanged, + startLocalModelDownload, + cancelLocalModelDownload, + deleteLocalModel, + unloadLocalModel, + streamLocalQwen as streamLocalModel, +} from "./llama"; +export type { LocalModelState } from "./local-llm-types"; + +/** Whether this phone can offer an on-phone model at all (Android: always, by download). */ +export function isLocalModelSupported(): boolean { + return true; +} diff --git a/app/native/media-browser.ios.ts b/app/native/media-browser.ios.ts index ac1ded94..c6ffcd43 100644 --- a/app/native/media-browser.ios.ts +++ b/app/native/media-browser.ios.ts @@ -6,6 +6,9 @@ import { type MediaBrowserApp, type MediaBrowserBridge, } from "./media-types"; +import { spotifyService } from "./spotify.ios"; +import type { SpotifyLibrary } from "./spotify-library"; +import { SPOTIFY_IOS_BUNDLE_ID } from "./spotify-player"; export type { MediaBrowseItem, MediaBrowserApp } from "./media-types"; @@ -30,7 +33,7 @@ export class AppleMusicBrowserBridge implements MediaBrowserBridge { connect(app: MediaBrowserApp): Promise { this.disconnect(); - if (app.packageName !== APPLE_MUSIC_PACKAGE) return Promise.reject(new Error("Only Apple Music can be browsed on iOS")); + if (app.packageName !== APPLE_MUSIC_PACKAGE) return Promise.reject(new Error("Not an Apple Music library")); if (!FaceclawAppleMusic.shared().hasPermission()) return Promise.reject(new Error("Apple Music access is not allowed")); this.connected = true; return Promise.resolve("root"); @@ -67,4 +70,42 @@ export class AppleMusicBrowserBridge implements MediaBrowserBridge { } } -export const mediaBrowserBridge: MediaBrowserBridge = new AppleMusicBrowserBridge(); +/** Apple Music's library, plus the Spotify library once signed in. */ +export class IosMediaBrowserBridge implements MediaBrowserBridge { + private current: MediaBrowserBridge | null = null; + + constructor( + private readonly appleMusic: AppleMusicBrowserBridge, + private readonly spotify: () => SpotifyLibrary | null, + ) {} + + listBrowsableApps(): MediaBrowserApp[] { + return [...this.appleMusic.listBrowsableApps(), ...(this.spotify()?.listBrowsableApps() ?? [])]; + } + + connect(app: MediaBrowserApp): Promise { + this.disconnect(); + const library = app.packageName === SPOTIFY_IOS_BUNDLE_ID ? this.spotify() : this.appleMusic; + if (!library) return Promise.reject(new Error(`${app.appName} can't be browsed`)); + this.current = library; + return library.connect(app); + } + + browse(parentId: string): Promise { + return this.current ? this.current.browse(parentId) : Promise.reject(new Error("Not connected")); + } + + playFromMediaId(mediaId: string): void { + this.current?.playFromMediaId(mediaId); + } + + disconnect(): void { + this.current?.disconnect(); + this.current = null; + } +} + +export const mediaBrowserBridge: MediaBrowserBridge = new IosMediaBrowserBridge( + new AppleMusicBrowserBridge(), + () => spotifyService()?.library ?? null, +); diff --git a/app/native/media-browser.ts b/app/native/media-browser.ts index 0061f9fe..34bd33a8 100644 --- a/app/native/media-browser.ts +++ b/app/native/media-browser.ts @@ -2,6 +2,9 @@ import { Utils } from "@nativescript/core"; import { ignoredMediaPackages, isMediaAppEnabled, MEDIA_APPS_KEY, rememberMediaApps } from "./media-apps"; import { onSettingsStoreChanged } from "./settings-store"; import { parseMediaBrowseItems, type MediaBrowseItem, type MediaBrowserApp, type MediaBrowserBridge } from "./media-types"; +import { spotifyService } from "./spotify"; +import type { SpotifyLibrary } from "./spotify-library"; +import { SPOTIFY_ANDROID_PACKAGE } from "./spotify-player"; declare const com: any; @@ -157,4 +160,54 @@ export class FaceclawMediaBrowserBridge implements MediaBrowserBridge { } } -export const mediaBrowserBridge: MediaBrowserBridge = new FaceclawMediaBrowserBridge(); +/** + * The Android libraries: apps' media browser services, with Spotify's + * library from its Web API instead. Spotify's own browser service admits + * only allowlisted callers (Android Auto, Wear, Assistant), so connecting to + * it always fails; signed in, its row opens the Web API library, and signed + * out, opening it says how to sign in. Signed in with Spotify not installed, + * the library is still offered (it plays on the user's other devices). + */ +export class AndroidMediaBrowserBridge implements MediaBrowserBridge { + private current: MediaBrowserBridge | null = null; + + constructor( + private readonly services: MediaBrowserBridge, + private readonly spotify: () => SpotifyLibrary | null, + private readonly isEnabled: (packageName: string) => boolean = isMediaAppEnabled, + ) {} + + listBrowsableApps(refresh = false): MediaBrowserApp[] { + const apps = this.services.listBrowsableApps(refresh); + const library = this.spotify(); + if (!library || apps.some((app) => app.packageName === SPOTIFY_ANDROID_PACKAGE) || !this.isEnabled(SPOTIFY_ANDROID_PACKAGE)) { + return apps; + } + return [...apps, ...library.listBrowsableApps()]; + } + + connect(app: MediaBrowserApp): Promise { + this.disconnect(); + const library = app.packageName === SPOTIFY_ANDROID_PACKAGE ? this.spotify() : null; + this.current = library ?? this.services; + return this.current.connect(library ? library.app : app); + } + + browse(parentId: string): Promise { + return this.current ? this.current.browse(parentId) : Promise.reject(new Error("Not connected")); + } + + playFromMediaId(mediaId: string): void { + this.current?.playFromMediaId(mediaId); + } + + disconnect(): void { + this.current?.disconnect(); + this.current = null; + } +} + +export const mediaBrowserBridge: MediaBrowserBridge = new AndroidMediaBrowserBridge( + new FaceclawMediaBrowserBridge(), + () => spotifyService()?.library ?? null, +); diff --git a/app/native/media-controller.ios.ts b/app/native/media-controller.ios.ts index 1200c7ce..e13a4252 100644 --- a/app/native/media-controller.ios.ts +++ b/app/native/media-controller.ios.ts @@ -11,6 +11,8 @@ import { type MediaPlaybackState, type MediaQueueItem, } from "./media-types"; +import { spotifyService } from "./spotify.ios"; +import type { SpotifyPlayer } from "./spotify-player"; export type { MediaControllerState, MediaPlaybackState, MediaQueueItem } from "./media-types"; @@ -88,7 +90,7 @@ export class AppleMusicControllerBridge implements MediaControllerBridge { onStateChange(listener: (state: MediaControllerState) => void): () => void { void this.start(); this.stateListeners.add(listener); - this.pollTimer ??= setInterval(() => this.refresh(), POLL_MS); + this.pollTimer ??= setInterval(() => this.publish(), POLL_MS); listener(this.snapshot()); return () => { this.stateListeners.delete(listener); @@ -142,7 +144,7 @@ export class AppleMusicControllerBridge implements MediaControllerBridge { if (this.hasAccess()) return Promise.resolve(true); this.pendingAccess ??= this.askForAccess().finally(() => { this.pendingAccess = null; - this.refresh(); + this.publish(); }); return this.pendingAccess; } @@ -187,12 +189,12 @@ export class AppleMusicControllerBridge implements MediaControllerBridge { const music = FaceclawAppleMusic.shared(); if (!this.bound) { this.bound = true; - music.changeHandler = () => this.refresh(); + music.changeHandler = () => this.publish(); } return music; } - private refresh(): void { + private publish(): void { if (!this.stateListeners.size) return; const state = this.snapshot(); const signature = stateSignature(state); @@ -228,4 +230,192 @@ export class AppleMusicControllerBridge implements MediaControllerBridge { } } -export const mediaControllerBridge: MediaControllerBridge = new AppleMusicControllerBridge(); +export type IosMediaSource = "apple-music" | "spotify"; + +/** + * Which player to follow: the one playing; with both playing, the current + * choice (no flapping); with neither, the one that played last, and before + * either has played this run, Spotify when it reports a session (its player + * reports only a recently active one, while the system Music player keeps + * its last item for days). + */ +export function chooseMediaSource( + current: IosMediaSource, + appleMusic: MediaControllerState, + spotify: MediaControllerState | null, + appleMusicLastPlayingAtMs: number, + spotifyLastPlayingAtMs: number, +): IosMediaSource { + if (!spotify?.accessEnabled) return "apple-music"; + if (!appleMusic.accessEnabled) return "spotify"; + const applePlaying = appleMusic.playbackState === "playing"; + const spotifyPlaying = spotify.playbackState === "playing"; + if (applePlaying && spotifyPlaying) return current; + if (applePlaying) return "apple-music"; + if (spotifyPlaying) return "spotify"; + if (appleMusicLastPlayingAtMs !== spotifyLastPlayingAtMs) { + return spotifyLastPlayingAtMs > appleMusicLastPlayingAtMs ? "spotify" : "apple-music"; + } + return spotify.available ? "spotify" : "apple-music"; +} + +/** + * The iOS Music bridge: Apple Music (the system player), plus Spotify once + * signed in (its Web API: playback on this phone or any Spotify Connect + * device). The state and every command follow one of them, by + * chooseMediaSource. + */ +export class IosMediaControllerBridge implements MediaControllerBridge { + readonly accessPrompt = + "Faceclaw needs access to Apple Music to show and control what's playing. Tap, then allow access on your phone. For Spotify, sign in from the app menu instead."; + readonly accessLabel: string; + readonly accessAction: string; + private source: IosMediaSource = "apple-music"; + private appleMusicLastPlayingAtMs = 0; + private readonly listeners = new Set<(state: MediaControllerState) => void>(); + private unsubscribeSources: Array<() => void> = []; + /** The source and its artVersion the composite artVersion was bumped for. */ + private artKey = ""; + private artVersion = 0; + + constructor( + private readonly appleMusic: AppleMusicControllerBridge, + private readonly spotify: () => SpotifyPlayer | null, + private readonly now: () => number = Date.now, + ) { + this.accessLabel = appleMusic.accessLabel; + this.accessAction = appleMusic.accessAction; + } + + get skipRebuildsQueue(): boolean { + return this.active().skipRebuildsQueue; + } + + onStateChange(listener: (state: MediaControllerState) => void): () => void { + if (!this.listeners.size) { + const update = () => this.emit(); + const spotify = this.spotify(); + this.unsubscribeSources = [this.appleMusic.onStateChange(update), ...(spotify ? [spotify.onStateChange(update)] : [])]; + } + this.listeners.add(listener); + listener(this.snapshot()); + return () => { + this.listeners.delete(listener); + if (this.listeners.size) return; + for (const unsubscribe of this.unsubscribeSources) unsubscribe(); + this.unsubscribeSources = []; + }; + } + + snapshot(): MediaControllerState { + const appleMusic = this.appleMusic.snapshot(); + const spotify = this.spotify()?.snapshot() ?? null; + this.select(appleMusic, spotify); + const state = this.source === "spotify" && spotify ? spotify : appleMusic; + // Changes with the source as well as with that source's art. + const artKey = `${this.source}:${state.artVersion}`; + if (artKey !== this.artKey) { + this.artKey = artKey; + this.artVersion++; + } + return { + ...state, + status: state.available ? state.status : idleStatus(appleMusic, spotify, state), + artVersion: this.artVersion, + // A Spotify command can fail while Apple Music is the one shown (playing from the Spotify library). + notice: spotify?.notice || state.notice || "", + }; + } + + async start(): Promise { + await this.appleMusic.start(); + } + + async stop(): Promise { + await this.appleMusic.stop(); + } + + playPause(): Promise { + return this.active().playPause(); + } + + skipNext(): Promise { + return this.active().skipNext(); + } + + skipPrevious(): Promise { + return this.active().skipPrevious(); + } + + /** Apple Music's media-library permission (what requestAccess asks for); Spotify signs in from the Music menu. */ + hasAccess(): boolean { + return this.appleMusic.hasAccess(); + } + + requestAccess(): Promise { + return this.appleMusic.requestAccess(); + } + + skipToQueueItem(id: number): Promise { + return this.active().skipToQueueItem(id); + } + + getMediaVolumePercent(): number { + return this.active().getMediaVolumePercent(); + } + + setMediaVolumePercent(volumePercent: number): void { + this.active().setMediaVolumePercent(volumePercent); + } + + getAlbumArt(maxSize: number): GrayImage | null { + return this.active().getAlbumArt(maxSize); + } + + getQueue(): MediaQueueItem[] { + return this.active().getQueue(); + } + + async sendCustomAction(action: string): Promise { + await this.active().sendCustomAction?.(action); + } + + async refresh(): Promise { + await this.spotify()?.refresh(); + } + + private active(): MediaControllerBridge { + const spotify = this.spotify(); + this.select(this.appleMusic.snapshot(), spotify?.snapshot() ?? null); + return this.source === "spotify" && spotify ? spotify : this.appleMusic; + } + + private select(appleMusic: MediaControllerState, spotify: MediaControllerState | null): void { + if (appleMusic.playbackState === "playing") this.appleMusicLastPlayingAtMs = this.now(); + this.source = chooseMediaSource(this.source, appleMusic, spotify, this.appleMusicLastPlayingAtMs, + this.spotify()?.lastPlayingAtMs ?? 0); + } + + /** + * Forward every source update: each source already drops repeats, and + * Spotify also signals changes that are not in the state (its queue). + */ + private emit(): void { + if (!this.listeners.size) return; + const state = this.snapshot(); + for (const listener of this.listeners) listener(state); + } +} + +/** The no-session line: which players were checked. */ +function idleStatus(appleMusic: MediaControllerState, spotify: MediaControllerState | null, shown: MediaControllerState): string { + if (appleMusic.accessEnabled && spotify?.accessEnabled) return "Nothing is playing."; + return shown.status; +} + +export const appleMusicControllerBridge = new AppleMusicControllerBridge(); + +export const mediaControllerBridge: MediaControllerBridge = new IosMediaControllerBridge( + appleMusicControllerBridge, + () => spotifyService()?.player ?? null, +); diff --git a/app/native/media-controller.ts b/app/native/media-controller.ts index c6baeb2e..b49967f6 100644 --- a/app/native/media-controller.ts +++ b/app/native/media-controller.ts @@ -12,11 +12,14 @@ import { type MediaPlaybackState, type MediaQueueItem, } from "./media-types"; +import { spotifyService } from "./spotify"; +import { SPOTIFY_ANDROID_PACKAGE, type SpotifyPlayer } from "./spotify-player"; declare const com: any; export type { MediaControllerState, MediaPlaybackState, MediaQueueItem } from "./media-types"; +/** Android media sessions (any player that publishes one), through FaceclawMediaController. */ export class FaceclawMediaControllerBridge implements MediaControllerBridge { readonly accessPrompt = "Notification access is required to control Android media sessions. Tap to open settings."; readonly accessLabel = "Notification access needed"; @@ -215,4 +218,251 @@ function normalizePlaybackState(value: string): MediaPlaybackState { } } -export const mediaControllerBridge: MediaControllerBridge = new FaceclawMediaControllerBridge(); +export type AndroidMediaSource = "session" | "spotify"; + +/** + * Which to follow: the media session (any player, Spotify included when it + * runs on this phone) or Spotify's Web API player (signed in; it also sees + * Spotify playing on a computer or speaker). The one playing; with both + * playing, the session when it is Spotify's own (the same playback), else the + * current choice (no flapping); with neither, a Spotify session, then the one + * that played last, then whichever has something. Without notification + * access the session shows its access prompt unless Spotify has something. + */ +export function chooseAndroidMediaSource( + current: AndroidMediaSource, + session: MediaControllerState, + spotify: MediaControllerState | null, + sessionLastPlayingAtMs: number, + spotifyLastPlayingAtMs: number, +): AndroidMediaSource { + if (!spotify?.accessEnabled) return "session"; + if (!session.accessEnabled) return spotify.available ? "spotify" : "session"; + const sessionIsSpotify = session.packageName === SPOTIFY_ANDROID_PACKAGE; + const sessionPlaying = session.playbackState === "playing"; + const spotifyPlaying = spotify.playbackState === "playing"; + if (sessionPlaying && spotifyPlaying) return sessionIsSpotify ? "session" : current; + if (sessionPlaying) return "session"; + if (spotifyPlaying) return "spotify"; + if (sessionIsSpotify && session.available) return "session"; + if (sessionLastPlayingAtMs !== spotifyLastPlayingAtMs) { + return spotifyLastPlayingAtMs > sessionLastPlayingAtMs ? "spotify" : "session"; + } + return session.available || !spotify.available ? "session" : "spotify"; +} + +/** + * The Android Music bridge: media sessions, plus Spotify's Web API once + * signed in (optional). Spotify playing on this phone stays the session's: + * its state, art, queue and transport come from the session (instant, no + * quota), and the Web API adds what the session lacks: shuffle / repeat / + * like rows and the volume of a Spotify Connect speaker or computer. Spotify + * playing on another device, with no session here, follows the Web API player. + */ +export class AndroidMediaControllerBridge implements MediaControllerBridge { + readonly accessPrompt: string; + readonly accessLabel: string; + readonly accessAction: string; + private source: AndroidMediaSource = "session"; + private sessionLastPlayingAtMs = 0; + private readonly listeners = new Set<(state: MediaControllerState) => void>(); + private unsubscribeSources: Array<() => void> = []; + /** The source and its artVersion the composite artVersion was bumped for. */ + private artKey = ""; + private artVersion = 0; + /** The player the last getQueue listed, so a jump goes to the same one. */ + private queueSource: MediaControllerBridge | null = null; + /** A Spotify session's item and play state, to re-read the Web API when they change. */ + private spotifySessionKey = ""; + + constructor( + private readonly session: MediaControllerBridge, + private readonly spotify: () => SpotifyPlayer | null, + private readonly now: () => number = Date.now, + ) { + this.accessPrompt = session.accessPrompt; + this.accessLabel = session.accessLabel; + this.accessAction = session.accessAction; + } + + get skipRebuildsQueue(): boolean { + return (this.queueSource ?? this.active()).skipRebuildsQueue; + } + + onStateChange(listener: (state: MediaControllerState) => void): () => void { + if (!this.listeners.size) { + const spotify = this.spotify(); + this.unsubscribeSources = [ + this.session.onStateChange((state) => this.sessionChanged(state)), + ...(spotify ? [spotify.onStateChange(() => this.emit())] : []), + ]; + } + this.listeners.add(listener); + listener(this.snapshot()); + return () => { + this.listeners.delete(listener); + if (this.listeners.size) return; + for (const unsubscribe of this.unsubscribeSources) unsubscribe(); + this.unsubscribeSources = []; + }; + } + + snapshot(): MediaControllerState { + const session = this.session.snapshot(); + const spotify = this.spotify()?.snapshot() ?? null; + this.select(session, spotify); + const state = this.source === "spotify" && spotify ? spotify : withSpotifyExtras(session, spotify); + // Changes with the source as well as with that source's art. + const artKey = `${this.source}:${state.artVersion}`; + if (artKey !== this.artKey) { + this.artKey = artKey; + this.artVersion++; + } + return { + ...state, + artVersion: this.artVersion, + // A Spotify command can fail while the session is the one shown (playing from the Spotify library). + notice: spotify?.notice || state.notice || "", + }; + } + + async start(): Promise { + await this.session.start(); + } + + async stop(): Promise { + await this.session.stop(); + } + + playPause(): Promise { + return this.active().playPause(); + } + + skipNext(): Promise { + return this.active().skipNext(); + } + + skipPrevious(): Promise { + return this.active().skipPrevious(); + } + + /** Notification access (what requestAccess opens); Spotify signs in from the Music menu. */ + hasAccess(): boolean { + return this.session.hasAccess(); + } + + requestAccess(): Promise { + return this.session.requestAccess(); + } + + skipToQueueItem(id: number): Promise { + return (this.queueSource ?? this.active()).skipToQueueItem(id); + } + + /** Spotify's own volume logic (a Connect device's volume, else this phone's) whenever Spotify is shown. */ + getMediaVolumePercent(): number { + return this.volumeSource().getMediaVolumePercent(); + } + + setMediaVolumePercent(volumePercent: number): void { + this.volumeSource().setMediaVolumePercent(volumePercent); + } + + getAlbumArt(maxSize: number): GrayImage | null { + return this.active().getAlbumArt(maxSize); + } + + /** The session's queue; for a Spotify session that lists none, the Web API's. */ + getQueue(): MediaQueueItem[] { + const active = this.active(); + const queue = active.getQueue(); + const spotify = this.spotifyExtras(); + if (queue.length || active !== this.session || !spotify) { + this.queueSource = active; + return queue; + } + this.queueSource = spotify; + return spotify.getQueue(); + } + + /** Spotify's actions (shown with a Spotify session too) go to the Web API player; any others to the session. */ + async sendCustomAction(action: string): Promise { + const spotify = this.spotify(); + if (spotify && spotify.snapshot().customActions?.some((custom) => custom.action === action)) { + await spotify.sendCustomAction(action); + } else { + await this.session.sendCustomAction?.(action); + } + } + + async refresh(): Promise { + await this.spotify()?.refresh(); + } + + private active(): MediaControllerBridge { + const spotify = this.spotify(); + this.select(this.session.snapshot(), spotify?.snapshot() ?? null); + return this.source === "spotify" && spotify ? spotify : this.session; + } + + /** The signed-in Web API player when it describes what the session shows (Spotify's own session); else null. */ + private spotifyExtras(): SpotifyPlayer | null { + const spotify = this.spotify(); + if (!spotify || this.session.snapshot().packageName !== SPOTIFY_ANDROID_PACKAGE) return null; + return spotify.snapshot().available ? spotify : null; + } + + private volumeSource(): MediaControllerBridge { + const active = this.active(); + return active === this.session ? this.spotifyExtras() ?? this.session : active; + } + + private select(session: MediaControllerState, spotify: MediaControllerState | null): void { + if (session.playbackState === "playing") this.sessionLastPlayingAtMs = this.now(); + this.source = chooseAndroidMediaSource(this.source, session, spotify, this.sessionLastPlayingAtMs, + this.spotify()?.lastPlayingAtMs ?? 0); + } + + private sessionChanged(state: MediaControllerState): void { + // Spotify's session changed track or started / stopped: re-read the Web + // API now, so its rows (like this song, shuffle) follow at once rather + // than at the next poll. Signed out, the player skips the request. + const key = state.packageName === SPOTIFY_ANDROID_PACKAGE ? `${state.title}\n${state.playbackState}` : ""; + if (key !== this.spotifySessionKey) { + this.spotifySessionKey = key; + if (key) void this.spotify()?.refresh(); + } + this.emit(); + } + + /** Forward every source update: each drops its own repeats, and Spotify also signals queue changes. */ + private emit(): void { + if (!this.listeners.size) return; + const state = this.snapshot(); + for (const listener of this.listeners) listener(state); + } +} + +/** + * Spotify's session state plus what only the Web API knows: its custom rows + * and, when it plays elsewhere, the device ("Spotify · Kitchen"). "Like + * song" names the Web API's current item, so it is left out until both agree + * on the track (the API lags a skip by up to a poll). + */ +export function withSpotifyExtras(session: MediaControllerState, spotify: MediaControllerState | null): MediaControllerState { + if (!spotify?.available || session.packageName !== SPOTIFY_ANDROID_PACKAGE) return session; + const sameItem = spotify.title === session.title; + const actions = (spotify.customActions ?? []).filter((custom) => sameItem || custom.action !== "like"); + return { + ...session, + appName: sameItem ? spotify.appName : session.appName, + customActions: [...(session.customActions ?? []), ...actions], + }; +} + +const sessionBridge = new FaceclawMediaControllerBridge(); + +export const mediaControllerBridge: MediaControllerBridge = new AndroidMediaControllerBridge( + sessionBridge, + () => spotifyService()?.player ?? null, +); diff --git a/app/native/media-types.ts b/app/native/media-types.ts index 84449b30..ff942647 100644 --- a/app/native/media-types.ts +++ b/app/native/media-types.ts @@ -3,7 +3,8 @@ import type { GrayImage } from "../graphics/image"; /** * Shapes shared by the media bridges: media-controller.ts / media-browser.ts * drive Android media sessions and MediaBrowserServices; their .ios.ts - * counterparts drive Apple Music through the MediaPlayer framework. + * counterparts drive Apple Music through the MediaPlayer framework. Both + * add Spotify through its Web API once signed in (spotify-*.ts). */ /** The player behind the iOS bridges: the system Music app. */ @@ -13,9 +14,19 @@ export const APPLE_MUSIC_PACKAGE = "com.apple.Music"; export type MediaQueueItem = { id: number; title: string; + /** Usually the artist; absent when the player gives none. */ + subtitle?: string; active: boolean; }; +/** A player-specific action beyond the transport controls (Spotify's shuffle, repeat, like). */ +export type MediaCustomAction = { + /** Stable id to send back with sendCustomAction. */ + action: string; + /** The row label, naming the current state where there is one ("Shuffle: on"). */ + name: string; +}; + export type MediaPlaybackState = | "notification-access-required" | "idle" @@ -47,6 +58,10 @@ export type MediaControllerState = { * players re-publish the same strings with a different bitmap. */ artVersion: number; + /** Player-specific actions (see sendCustomAction); absent when the player offers none. */ + customActions?: MediaCustomAction[]; + /** A short-lived message about a command that failed (Spotify needs Premium, ...); absent or "" otherwise. */ + notice?: string; }; export const DEFAULT_MEDIA_STATE: MediaControllerState = { @@ -113,6 +128,13 @@ export interface MediaControllerBridge { getAlbumArt(maxSize: number): GrayImage | null; /** The player's queue (playlist), empty when the player exposes none. */ getQueue(): MediaQueueItem[]; + /** Run one of the state's customActions. */ + sendCustomAction?(action: string): Promise; + /** + * Re-read the player now, for one-off readers (the assistant) when no + * listener keeps the state current; absent when snapshots are always live. + */ + refresh?(): Promise; } export type MediaBrowserApp = { diff --git a/app/native/mic-control-link.ios.ts b/app/native/mic-control-link.ios.ts new file mode 100644 index 00000000..e19ea4a6 --- /dev/null +++ b/app/native/mic-control-link.ios.ts @@ -0,0 +1,30 @@ +import { FaceclawCommunicatorBridge } from "./faceclaw-communicator.ios"; + +/** The iOS twin of mic-control-link.ts, over the running shared-Kotlin session. */ + +export function micControlSession(): unknown { + return FaceclawCommunicatorBridge.getActive(); +} + +/** Queue a record for the chosen temples; false when the session wasn't ready and nothing was queued. */ +export function sendMicControlRecord( + session: unknown, + record: Uint8Array, + label: string, + rightTemple: boolean, + leftTemple: boolean, +): boolean { + return (session as FaceclawCommunicatorBridge).sendFaceclawMicControl(record, label, rightTemple, leftTemple); +} + +/** Status record bodies (undecoded) and their temple: "L", "R" or "?". Returns an unsubscribe function. */ +export function addMicStatusListener(session: unknown, listener: (body: Uint8Array, arm: string) => void): () => void { + const unsubscribe = (session as FaceclawCommunicatorBridge).addMicStatusListener(listener); + return () => { + try { + unsubscribe(); + } catch { + // The session may have been closed during a reconnect. + } + }; +} diff --git a/app/native/mic-control-link.ts b/app/native/mic-control-link.ts new file mode 100644 index 00000000..1b5f238d --- /dev/null +++ b/app/native/mic-control-link.ts @@ -0,0 +1,46 @@ +import { toJavaBytes } from "./cloud-stt"; +import { toUint8Array } from "../util/array-util"; + +declare const com: any; + +/** + * Platform plumbing for the CFW mic_control channel (apps/microphones/mic-control.ts): + * the running session to send records on and to hear field-104 status replies + * from. The session is opaque and is a different object after a reconnect. + */ + +export function micControlSession(): unknown { + if (!global.isAndroid) return null; + try { + return com.faceclaw.app.FaceclawBleCommunicator.getActive(); + } catch { + return null; + } +} + +/** Queue a record for the chosen temples; false when the session wasn't ready and nothing was queued. */ +export function sendMicControlRecord( + session: unknown, + record: Uint8Array, + label: string, + rightTemple: boolean, + leftTemple: boolean, +): boolean { + return (session as any).sendFaceclawMicControl(toJavaBytes(record), label, rightTemple, leftTemple) !== false; +} + +/** Status record bodies (undecoded) and their temple: "L", "R" or "?". Returns an unsubscribe function. */ +export function addMicStatusListener(session: unknown, listener: (body: Uint8Array, arm: string) => void): () => void { + const communicator = session as any; + const proxy = new com.faceclaw.app.FaceclawMicStatusListener({ + onMicStatus: (body: any, arm: string) => listener(toUint8Array(body), String(arm)), + }); + communicator.addMicStatusListener(proxy); + return () => { + try { + communicator.removeMicStatusListener(proxy); + } catch { + // The old communicator instance may be gone after a reconnect. + } + }; +} diff --git a/app/native/notification-app-icons.ts b/app/native/notification-app-icons.ts new file mode 100644 index 00000000..cdd5e365 --- /dev/null +++ b/app/native/notification-app-icons.ts @@ -0,0 +1,203 @@ +import type { PebbleIconName } from "../graphics/pebble-icons"; + +/** + * Icons for notification sources that arrive without one: iPhone + * notifications over ANCS carry the app's bundle ID, its display name + * (fetched separately) and an ANCS category, but no icon. The icons are + * Pebble's (see scripts/generate-pebble-icons.cjs). + * + * The bundle IDs start from the Pebble firmware's own ANCS table (PebbleOS + * include/pbl/services/notifications/ancs/ancs_known_apps.h, minus retired + * apps), plus Apple's built-in apps and popular apps mapped to a generic + * pictogram. Every App Store bundle ID here was checked against Apple's + * iTunes lookup when it was added; Apple's built-in apps follow + * github.com/joeblau/apple-bundle-identifiers. + * + * Display names are a fallback for apps whose bundle ID varies per build: + * self-built apps such as Loop sign with their builder's team ID. They match + * the whole name, ignoring case, so generic words (an app called "United" + * or "Voice") are left out. Bundle prefixes catch regional variants + * (com.abbott.librelink.us, .gb, ...). + * + * Apple's Phone app is deliberately absent: its notifications are calls, + * missed calls and voicemail, which the ANCS category tells apart. + */ +type AppIcon = { + icon: PebbleIconName; + bundleIds: readonly string[]; + bundlePrefixes?: readonly string[]; + names?: readonly string[]; +}; + +const APP_ICONS: readonly AppIcon[] = [ + // Apple's built-in apps. + { icon: "sms", bundleIds: ["com.apple.MobileSMS"] }, + { icon: "email", bundleIds: ["com.apple.mobilemail"] }, + { icon: "calendar", bundleIds: ["com.apple.mobilecal"] }, + { icon: "reminder", bundleIds: ["com.apple.reminders"] }, + { icon: "facetime", bundleIds: ["com.apple.facetime"] }, + { icon: "iosPhotos", bundleIds: ["com.apple.mobileslideshow"] }, + { icon: "alarmClock", bundleIds: ["com.apple.mobiletimer"] }, + { icon: "weather", bundleIds: ["com.apple.weather"] }, + { icon: "location", bundleIds: ["com.apple.findmy", "com.apple.Maps"] }, + { icon: "settings", bundleIds: ["com.apple.Preferences"] }, + { icon: "heart", bundleIds: ["com.apple.Health"] }, + { icon: "activity", bundleIds: ["com.apple.Fitness"] }, + { icon: "news", bundleIds: ["com.apple.news"] }, + { icon: "podcast", bundleIds: ["com.apple.podcasts"] }, + { icon: "music", bundleIds: ["com.apple.Music"] }, + { icon: "tv", bundleIds: ["com.apple.tv"] }, + { icon: "payBill", bundleIds: ["com.apple.Passbook"] }, + { icon: "stocks", bundleIds: ["com.apple.stocks"] }, + { icon: "appStore", bundleIds: ["com.apple.AppStore"] }, + { icon: "appleShortcuts", bundleIds: ["com.apple.shortcuts"] }, + { icon: "microphone", bundleIds: ["com.apple.VoiceMemos"] }, + { icon: "contacts", bundleIds: ["com.apple.MobileAddressBook"] }, + { icon: "shopping", bundleIds: ["com.apple.store.Jolly"] }, + + // Apps with an icon of their own. + { icon: "airmail", bundleIds: ["com.airmailapp.iphone"], names: ["Airmail"] }, + { icon: "amazon", bundleIds: ["com.amazon.Amazon"], names: ["Amazon"] }, + { icon: "bbcNews", bundleIds: ["uk.co.bbc.news"], names: ["BBC News"] }, + { icon: "beeper", bundleIds: ["com.automattic.beeper"], names: ["Beeper"] }, + { icon: "bluesky", bundleIds: ["xyz.blueskyweb.app"], names: ["Bluesky"] }, + { icon: "discord", bundleIds: ["com.hammerandchisel.discord"], names: ["Discord"] }, + { icon: "duolingo", bundleIds: ["com.duolingo.DuolingoMobile"], names: ["Duolingo"] }, + { icon: "ebay", bundleIds: ["com.ebay.iphone"], names: ["eBay"] }, + { icon: "element", bundleIds: ["im.vector.app", "io.element.elementx"], names: ["Element", "Element X", "Element Classic"] }, + { icon: "facebook", bundleIds: ["com.facebook.Facebook"], names: ["Facebook"] }, + { icon: "gmail", bundleIds: ["com.google.Gmail"], names: ["Gmail"] }, + { icon: "googleChat", bundleIds: ["com.google.Dynamite"], names: ["Google Chat"] }, + { icon: "googleMaps", bundleIds: ["com.google.Maps"], names: ["Google Maps"] }, + { icon: "googlePhotos", bundleIds: ["com.google.photos"], names: ["Google Photos"] }, + { icon: "googleTasks", bundleIds: ["com.google.tasks"], names: ["Google Tasks"] }, + { icon: "homeAssistant", bundleIds: ["io.robbie.HomeAssistant"], names: ["Home Assistant"] }, + { icon: "instagram", bundleIds: ["com.burbn.instagram"], names: ["Instagram"] }, + { icon: "kakaoTalk", bundleIds: ["com.iwilab.KakaoTalk"], names: ["KakaoTalk"] }, + { icon: "kik", bundleIds: ["com.kik.chat"], names: ["Kik"] }, + { icon: "line", bundleIds: ["jp.naver.line"], names: ["LINE"] }, + { icon: "linkedIn", bundleIds: ["com.linkedin.LinkedIn"], names: ["LinkedIn"] }, + { icon: "messenger", bundleIds: ["com.facebook.Messenger"], names: ["Messenger"] }, + { icon: "omniFocus", bundleIds: ["com.omnigroup.OmniFocus4", "com.omnigroup.OmniFocus3.iOS"], names: ["OmniFocus"] }, + { icon: "outlook", bundleIds: ["com.microsoft.Office.Outlook"], names: ["Outlook"] }, + { icon: "reddit", bundleIds: ["com.reddit.Reddit"], names: ["Reddit"] }, + { icon: "signal", bundleIds: ["org.whispersystems.signal"], names: ["Signal"] }, + { icon: "simplex", bundleIds: ["chat.simplex.app"], names: ["SimpleX"] }, + { icon: "slack", bundleIds: ["com.tinyspeck.chatlyio"], names: ["Slack"] }, + { icon: "snapchat", bundleIds: ["com.toyopagroup.picaboo"], names: ["Snapchat"] }, + { icon: "steam", bundleIds: ["com.valvesoftware.Steam"], names: ["Steam"] }, + { icon: "substack", bundleIds: ["com.substack.Substack"], names: ["Substack"] }, + { icon: "swarm", bundleIds: ["com.foursquare.robin"], names: ["Swarm"] }, + { icon: "tapo", bundleIds: ["com.tplink.tapo"], names: ["Tapo"] }, + { icon: "teams", bundleIds: ["com.microsoft.skype.teams"], names: ["Teams", "Microsoft Teams"] }, + { icon: "telegram", bundleIds: ["ph.telegra.Telegraph"], names: ["Telegram"] }, + { icon: "threads", bundleIds: ["com.burbn.barcelona"], names: ["Threads"] }, + { icon: "tiktok", bundleIds: ["com.zhiliaoapp.musically"], names: ["TikTok"] }, + { icon: "twitch", bundleIds: ["tv.twitch"], names: ["Twitch"] }, + // X, still under Twitter's bundle ID and drawn with its bird, as on Pebble. + { icon: "twitter", bundleIds: ["com.atebits.Tweetie2"], names: ["X", "Twitter"] }, + { icon: "unifiProtect", bundleIds: ["com.ubnt.protect"], names: ["UniFi Protect"] }, + { icon: "viber", bundleIds: ["com.viber"], names: ["Viber"] }, + { icon: "waze", bundleIds: ["com.waze.iphone"], names: ["Waze"] }, + { icon: "weChat", bundleIds: ["com.tencent.xin"], names: ["WeChat"] }, + { icon: "whatsApp", bundleIds: ["net.whatsapp.WhatsApp"], names: ["WhatsApp"] }, + { icon: "whatsAppBusiness", bundleIds: ["net.whatsapp.WhatsAppSMB"], names: ["WA Business", "WhatsApp Business"] }, + { icon: "yahooMail", bundleIds: ["com.yahoo.Aerogram"], names: ["Yahoo Mail"] }, + { icon: "youtube", bundleIds: ["com.google.ios.youtube"], names: ["YouTube"] }, + { icon: "zoom", bundleIds: ["us.zoom.videomeetings"], names: ["Zoom"] }, + + // Apps drawn with a generic pictogram. + { icon: "calendar", bundleIds: ["com.google.calendar", "com.flexibits.fantastical2.iphone"], names: ["Google Calendar", "Fantastical"] }, + { icon: "email", bundleIds: ["com.readdle.smartemail", "ch.protonmail.protonmail"], names: ["Proton Mail"] }, + { icon: "sms", bundleIds: ["com.google.GVDialer", "ch.threema.iapp", "com.groupme.iphone-app"], names: ["Threema", "GroupMe"] }, + { icon: "reminder", bundleIds: ["com.todoist.ios", "com.culturedcode.ThingsiPhone", "com.microsoft.to-do"], names: ["Todoist"] }, + { icon: "car", bundleIds: ["com.ubercab.UberClient", "com.zimride.instant"], names: ["Uber", "Lyft"] }, + { icon: "dinner", bundleIds: ["com.ubercab.UberEats", "doordash.DoorDashConsumer", "com.grubhub.search"], names: ["Uber Eats", "DoorDash", "Grubhub"] }, + { + icon: "glucose", + bundleIds: [ + "com.dexcom.G6", "com.dexcom.g7app", "com.dexcom.dexcomone", "com.dexcom.stelo", "com.dexcom.followglobal", + "org.nativescript.LibreLinkUp", + ], + bundlePrefixes: ["com.abbott.librelink.", "com.abbott.libre3."], + names: ["Dexcom G6", "Dexcom G7", "Dexcom ONE", "LibreLink", "LibreLinkUp", "Loop", "Trio", "LoopFollow", "xDrip4iOS"], + }, + { icon: "music", bundleIds: ["com.spotify.client", "com.google.ios.youtubemusic", "com.pandora"], names: ["Spotify", "YouTube Music", "Pandora"] }, + { icon: "podcast", bundleIds: ["fm.overcast.overcast", "au.com.shiftyjelly.podcasts"], names: ["Overcast", "Pocket Casts"] }, + { + icon: "tv", + bundleIds: ["com.netflix.Netflix", "com.hulu.plus", "com.disney.disneyplus", "com.amazon.aiv.AIVApp"], + names: ["Netflix", "Hulu", "Disney+", "Prime Video"], + }, + { + icon: "payBill", + bundleIds: [ + "net.kortina.labs.Venmo", "com.squareup.cash", "com.yourcompany.PPClient", "com.chase", "com.bankofamerica.BofA", + "com.wf.mobilebanking", "com.capitalone.enterprisemobilebanking", + "com.revolut.revolut", "com.transferwise.Transferwise", "de.no26.Number26", "com.bunq.ios", + ], + names: ["Venmo", "Cash App", "PayPal", "Revolut", "N26", "bunq"], + }, + { icon: "stocks", bundleIds: ["com.robinhood.release.Robinhood", "com.vilcsak.bitcoin2"], names: ["Robinhood", "Coinbase"] }, + { + icon: "flight", + bundleIds: [ + "com.united.UnitedCustomerFacingIPhone", "com.delta.iphone.ver1", "com.aa.AmericanAirlines", + "com.southwest.iphoneprod", "com.flightyapp.flighty", + ], + names: ["Fly Delta", "Flighty"], + }, + { icon: "weather", bundleIds: ["com.weather.TWC", "com.grailr.CARROTweather"] }, + { icon: "activity", bundleIds: ["com.strava.stravaride", "com.nike.nikeplus-gps", "com.fitbit.FitbitMobile"], names: ["Strava", "Fitbit"] }, + { icon: "heart", bundleIds: ["com.ouraring.oura"], names: ["Oura"] }, + { icon: "news", bundleIds: ["com.nytimes.NYTimes", "com.google.GoogleDigitalEditions"], names: ["Google News"] }, +]; + +/** + * Icons for the ANCS categories (CategoryID: Other, IncomingCall, + * MissedCall, Voicemail, Social, Schedule, Email, News, HealthAndFitness, + * BusinessAndFinance, Location, Entertainment), for apps not listed above. + */ +const CATEGORY_ICONS: readonly PebbleIconName[] = [ + "generic", "incomingCall", "missedCall", "voicemail", "sms", "calendar", + "email", "news", "heart", "stocks", "location", "tv", +]; + +type Index = { bundleIds: Map; prefixes: [string, PebbleIconName][]; names: Map }; +let index: Index | null = null; + +function buildIndex(): Index { + const built: Index = { bundleIds: new Map(), prefixes: [], names: new Map() }; + for (const app of APP_ICONS) { + for (const id of app.bundleIds) built.bundleIds.set(id.toLowerCase(), app.icon); + for (const prefix of app.bundlePrefixes ?? []) built.prefixes.push([prefix.toLowerCase(), app.icon]); + for (const name of app.names ?? []) built.names.set(name.toLowerCase(), app.icon); + } + return built; +} + +/** + * The icon for a notification's source app, by bundle ID (ignoring case; + * Apple treats bundle IDs case-insensitively), else by its display name; + * null when the app isn't known. + */ +export function notificationAppIcon(bundleId: string, appName: string): PebbleIconName | null { + index ??= buildIndex(); + const id = bundleId.trim().toLowerCase(); + if (id) { + const byId = index.bundleIds.get(id) ?? index.prefixes.find(([prefix]) => id.startsWith(prefix))?.[1]; + if (byId) return byId; + } + const name = appName.trim().toLowerCase(); + return (name && index.names.get(name)) || null; +} + +/** The icon for an ANCS category (a CategoryID as a string); the bell for anything unknown. */ +export function notificationCategoryIcon(category: string): PebbleIconName { + return CATEGORY_ICONS[Number(category)] ?? "generic"; +} + +/** Every icon the table refers to, for tests. */ +export function allNotificationAppIcons(): PebbleIconName[] { + return Array.from(new Set(APP_ICONS.map((app) => app.icon).concat(CATEGORY_ICONS))); +} diff --git a/app/native/notification-icons.ios.ts b/app/native/notification-icons.ios.ts index c908c838..940656dc 100644 --- a/app/native/notification-icons.ios.ts +++ b/app/native/notification-icons.ios.ts @@ -1,10 +1,11 @@ -import { GrayImage } from '../graphics/image' -import { renderIcon, type IconName } from '../graphics/icons' +import type { GrayImage } from '../graphics/image' +import { pebbleIcon } from '../graphics/pebble-icons' import { AncsClient, ANCS_CONNECT_MESSAGE, type AncsState } from '../g2/ancs-client' +import { notificationAppIcon, notificationCategoryIcon } from './notification-app-icons' import { rememberNotificationSources } from './notification-sources' import type { AndroidNotification } from './notification-types' export type { AndroidNotification, AndroidNotificationAction } from './notification-types' -export type { NotificationIconsResult, NotificationIconResult, NotificationPictureResult } from './notification-icons' +export type { NotificationIconsResult, NotificationIconResult, NotificationImageResult } from './notification-icons' export const ALL_NOTIFICATIONS = 0x7fffffff let active: AncsClient | null = null @@ -32,36 +33,32 @@ export function onAndroidNotificationPosted(listener: (key: string) => void): () // (they hear every change), and an open popup closes on the repaint that follows. export function onAndroidNotificationRemoved(_listener: (key: string) => void): () => void { return () => {} } export function onAndroidNotificationsChanged(listener: () => void): () => void { return onAndroidNotificationPosted(listener) } -// ANCS does not provide app icons, so show one for the notification's ANCS -// category; never fetch notification sources or content from a third-party -// icon service. Indexed by CategoryID: Other, IncomingCall, MissedCall, -// Voicemail, Social, Schedule, Email, News, HealthAndFitness, -// BusinessAndFinance, Location, Entertainment. -const CATEGORY_ICONS: readonly IconName[] = ['bell','phone-incoming','phone-missed','voicemail','message-circle', - 'calendar','mail','newspaper','heart-pulse','briefcase','map-pin','tv'] -function categoryIcon(category: string): GrayImage { - return renderIcon(CATEGORY_ICONS[Number(category)] ?? 'bell',24)?.clone() ?? bell() -} -// Drawn fallback for when the SVG rasterizer fails. -function bell(): GrayImage { - const image = new GrayImage(24,24,0) - image.fillRoundedRect(6,5,12,13,220,5) - image.fillRect(4,17,16,2,220) - image.fillRect(10,20,4,2,220) - return image +// ANCS does not provide app icons, so show a bundled Pebble icon for the +// source app (by bundle ID or display name), else for the notification's +// ANCS category. Never fetch notification sources or content from a +// third-party icon service. +function notificationIcon(notification: AndroidNotification): GrayImage { + const name = notificationAppIcon(notification.packageName, notification.appName) ?? notificationCategoryIcon(notification.category) + return pebbleIcon(name).clone() } export function readActiveNotificationIcons(maxIcons: number, _allowStale: boolean) { // One icon per source, standing for its first notification. const sources = new Map() for (const n of readActiveNotifications(ALL_NOTIFICATIONS)) if (!sources.has(n.packageName)) sources.set(n.packageName, n) const shown = Array.from(sources.values()).slice(0,Math.max(0,maxIcons)) - return {icons: shown.map(n => categoryIcon(n.category)),keys: shown.map(n => n.key),stale:false} + return {icons: shown.map(notificationIcon),keys: shown.map(n => n.key),stale:false} } export function readNotificationIconByKey(key: string, _allowStale: boolean) { const notification = readActiveNotifications(ALL_NOTIFICATIONS).find(n => n.key === key) - return {icon: notification ? categoryIcon(notification.category) : null,stale:false} + return {icon: notification ? notificationIcon(notification) : null,stale:false} } -// ANCS carries no attachments. +// ANCS carries no attachments, avatars or custom layouts. export function readNotificationPicture(_notification: AndroidNotification, _maxWidth: number, _maxHeight: number, _allowStale: boolean) { - return {picture: null,stale:false} + return {image: null,stale:false} +} +export function readNotificationLargeIcon(_notification: AndroidNotification, _size: number, _allowStale: boolean) { + return {image: null,stale:false} +} +export function readNotificationCustomView(_notification: AndroidNotification, _maxWidth: number, _maxHeight: number, _allowStale: boolean) { + return {image: null,stale:false} } diff --git a/app/native/notification-icons.ts b/app/native/notification-icons.ts index aa652096..822360b5 100644 --- a/app/native/notification-icons.ts +++ b/app/native/notification-icons.ts @@ -3,11 +3,12 @@ import { logCurrent, spanCurrent } from "./frame-timings"; import { toUint8Array } from "../util/array-util"; import { rememberNotificationSources } from "./notification-sources"; import { PHOTO_TONE, grayImageFromPacket } from "./image-files"; +import { NOTIFICATION_ICON_SIZE } from "./notification-types"; declare const com: any; declare const java: any; -const ICON_SIZE = 24; +const ICON_SIZE = NOTIFICATION_ICON_SIZE; /** Ask the native listener for every active source, including those below the list's display limit. */ export const ALL_NOTIFICATIONS = 0x7fffffff; // Backstop TTL only: the icon caches are invalidated eagerly whenever a @@ -23,11 +24,6 @@ let cachedKeys: string[] = []; let cachedAtMs = 0; const keyedIconCache = new Map(); const KEYED_ICON_CACHE_MAX = 128; -/** Pictures are the size of a detail view, not 24px icons: keep just the recently viewed few. */ -const pictureCache = new Map(); -const PICTURE_CACHE_MAX = 8; let notificationListenerProxy: any = null; const notificationPostedListeners = new Set<(notificationKey: string) => void>(); const notificationRemovedListeners = new Set<(notificationKey: string) => void>(); @@ -159,48 +155,86 @@ export function readNotificationIconByKey(key: string, allowStale: boolean): Not return { icon: icon?.clone() ?? null, stale: false }; } -export type NotificationPictureResult = { +export type NotificationImageResult = { /** Shared with the cache: blit it, don't draw on it. */ - picture: GrayImage | null; + image: GrayImage | null; /** True when allowStale served an earlier fetch (or nothing) in place of a fetch for these arguments. */ stale: boolean; }; +/** + * Images belonging to one notification (its picture, large icon or custom + * layout), fetched to fit a box, under the allow-stale contract of + * readNotificationIconByKey. Cached per post of the notification: an ongoing + * notification updated in place (Dexcom redraws its graph and reading every + * few minutes) fires no posted event, but its postTime moves. ICON_CACHE_MS + * is the backstop here too. Under allowStale an earlier fetch stands in, if + * it fits. + */ +class NotificationImageCache { + private readonly entries = new Map(); + + constructor(private readonly maxEntries: number, private readonly span: string) {} + + read( + notification: AndroidNotification, + maxWidth: number, + maxHeight: number, + allowStale: boolean, + fetch: (width: number, height: number) => GrayImage | null, + ): NotificationImageResult { + const width = Math.round(maxWidth); + const height = Math.round(maxHeight); + if (!global.isAndroid || width <= 0 || height <= 0) return { image: null, stale: false }; + + const now = Date.now(); + const cached = this.entries.get(notification.key); + if ( + cached && cached.postTime === notification.postTime && cached.maxWidth === width + && cached.maxHeight === height && now - cached.atMs < ICON_CACHE_MS + ) { + return { image: cached.image, stale: false }; + } + if (allowStale) { + const fits = cached?.image && cached.image.width <= width && cached.image.height <= height; + return { image: fits ? cached!.image : null, stale: true }; + } + + const image = spanCurrent(this.span, () => fetch(width, height)); + this.entries.delete(notification.key); + this.entries.set(notification.key, { postTime: notification.postTime, maxWidth: width, maxHeight: height, image, atMs: now }); + while (this.entries.size > this.maxEntries) { + const oldestKey = this.entries.keys().next().value; + if (oldestKey === undefined) break; + this.entries.delete(oldestKey); + } + return { image, stale: false }; + } +} + +/** Pictures and custom layouts are the size of a detail view, not icons: keep just the recently viewed few. */ +const pictureCache = new NotificationImageCache(8, "fetch-notification-picture"); +const customViewCache = new NotificationImageCache(8, "fetch-notification-custom-view"); +/** Large icons show on every list card drawn, so keep a screenful and then some. */ +const largeIconCache = new NotificationImageCache(32, "fetch-notification-large-icon"); +/** Avatars and logos: photographic tone, but undithered, which at icon size reads as noise. */ +const LARGE_ICON_TONE = { gamma: PHOTO_TONE.gamma, dither: false }; + /** * The picture attached to a notification (hasPicture), scaled to fit * maxWidth x maxHeight with the photo tone and inverted if it is drawn on a - * light background (GrayPacket.hasLightBackground), under the allow-stale contract of - * readNotificationIconByKey. Cached per post of the notification: an ongoing - * notification updated in place (Dexcom redraws its graph every few minutes) - * fires no posted event, but its postTime moves. ICON_CACHE_MS is the - * backstop here too. Under allowStale an earlier fetch stands in, if it fits. + * light background (GrayPacket.hasLightBackground); see NotificationImageCache. */ export function readNotificationPicture( notification: AndroidNotification, maxWidth: number, maxHeight: number, allowStale: boolean, -): NotificationPictureResult { - const width = Math.round(maxWidth); - const height = Math.round(maxHeight); - if (!global.isAndroid || !notification.hasPicture || width <= 0 || height <= 0) { - return { picture: null, stale: false }; - } - - const now = Date.now(); - const cached = pictureCache.get(notification.key); - if ( - cached && cached.postTime === notification.postTime && cached.maxWidth === width - && cached.maxHeight === height && now - cached.atMs < ICON_CACHE_MS - ) { - return { picture: cached.picture, stale: false }; - } - if (allowStale) { - const fits = cached?.picture && cached.picture.width <= width && cached.picture.height <= height; - return { picture: fits ? cached!.picture : null, stale: true }; - } - - const picture = spanCurrent("fetch-notification-picture", () => +): NotificationImageResult { + if (!notification.hasPicture) return { image: null, stale: false }; + return pictureCache.read(notification, maxWidth, maxHeight, allowStale, (width, height) => grayImageFromPacket( com.faceclaw.app.FaceclawMediaNotificationListenerService.getNotificationPictureGray( notification.key, @@ -212,16 +246,56 @@ export function readNotificationPicture( // lit panel on the glasses: show it light-on-dark. true, ), - ), - ); - pictureCache.delete(notification.key); - pictureCache.set(notification.key, { postTime: notification.postTime, maxWidth: width, maxHeight: height, picture, atMs: now }); - while (pictureCache.size > PICTURE_CACHE_MAX) { - const oldestKey = pictureCache.keys().next().value; - if (oldestKey === undefined) break; - pictureCache.delete(oldestKey); - } - return { picture, stale: false }; + )); +} + +/** + * A notification's large icon (hasLargeIcon: a sender's avatar, a site's + * logo), scaled to fit size x size, a light background inverted as for + * pictures; see NotificationImageCache. + */ +export function readNotificationLargeIcon( + notification: AndroidNotification, + size: number, + allowStale: boolean, +): NotificationImageResult { + if (!notification.hasLargeIcon) return { image: null, stale: false }; + return largeIconCache.read(notification, size, size, allowStale, (width) => + grayImageFromPacket( + com.faceclaw.app.FaceclawMediaNotificationListenerService.getNotificationLargeIconGray( + notification.key, + width, + LARGE_ICON_TONE.gamma, + LARGE_ICON_TONE.dither, + ), + )); +} + +/** + * A notification's own layout (hasCustomView) drawn as the phone's shade + * draws it, at most a pixel per dp and trimmed to what it draws, so usually + * smaller than maxWidth x maxHeight; dark-on-light layouts come out + * light-on-dark. See NotificationCustomViews.renderGray and + * NotificationImageCache. + */ +export function readNotificationCustomView( + notification: AndroidNotification, + maxWidth: number, + maxHeight: number, + allowStale: boolean, +): NotificationImageResult { + if (!notification.hasCustomView) return { image: null, stale: false }; + return customViewCache.read(notification, maxWidth, maxHeight, allowStale, (width, height) => + grayImageFromPacket( + // Flat UI tone: it is mostly text and icons. + com.faceclaw.app.FaceclawMediaNotificationListenerService.getNotificationCustomViewGray( + notification.key, + width, + height, + 1, + false, + ), + )); } export function readActiveNotifications(maxNotifications = 50): AndroidNotification[] { @@ -354,6 +428,9 @@ function normalizeNotification(value: any): AndroidNotification | null { actions, foregroundService: Boolean(value.foregroundService), hasPicture: Boolean(value.hasPicture), + hasLargeIcon: Boolean(value.hasLargeIcon), + hasCustomView: Boolean(value.hasCustomView), + customText: Array.isArray(value.customText) ? value.customText.map((text: unknown) => String(text)).filter(Boolean) : [], }; } diff --git a/app/native/notification-types.ts b/app/native/notification-types.ts index 78d35ac0..84f05419 100644 --- a/app/native/notification-types.ts +++ b/app/native/notification-types.ts @@ -1,4 +1,13 @@ /** Shared notification model; Android names are retained for existing callers. */ + +/** + * Side of a notification's (square) source icon wherever one is drawn: the + * status bar, notification cards and views, the Glanceboard. 25 is the size + * of the Pebble icons iPhone notifications use (app/graphics/pebble-icons.ts), + * which are drawn on that pixel grid; Android's icons render at any size. + */ +export const NOTIFICATION_ICON_SIZE = 25; + export type AndroidNotificationAction = { index: number; title: string; enabled: boolean }; export type AndroidNotification = { key: string; packageName: string; appName: string; title: string; text: string; @@ -9,6 +18,15 @@ export type AndroidNotification = { foregroundService?: boolean; /** Carries a picture (Android BigPictureStyle), fetched separately by readNotificationPicture. */ hasPicture?: boolean; + /** Carries a large icon (Android: a sender's avatar or logo), fetched separately by readNotificationLargeIcon. */ + hasLargeIcon?: boolean; + /** Has its own layout (Android RemoteViews), drawn by readNotificationCustomView. */ + hasCustomView?: boolean; + /** + * The custom layout's text, one entry per text view, when the notification has no title or + * text of its own (Dexcom's glucose reading and units). + */ + customText?: string[]; /** Full message size reported by iOS, even when the fetched text is bounded. */ messageSize?: number; }; diff --git a/app/native/openai-chat-models.ts b/app/native/openai-chat-models.ts new file mode 100644 index 00000000..71d56e58 --- /dev/null +++ b/app/native/openai-chat-models.ts @@ -0,0 +1,159 @@ +import { fetchTextWithUserAgent, type TextResponse } from "../util/http"; +import { normalizeOpenAiCompatibleUrl } from "./openai-chat"; + +export type DiscoveredCompatibleModel = { + /** Exact identifier to send as model in Chat Completions. */ + id: string; + /** Human-friendly catalog name, or id when the server supplies no name. */ + name: string; + /** true/false when advertised; null means the server did not say. */ + supportsTools: boolean | null; + offline: boolean; + deprecated: boolean; + beta: boolean; +}; + +type DiscoveryOptions = { + baseUrl: string; + apiKey: string; + /** Bypass the short-lived successful-response cache. */ + forceRefresh?: boolean; +}; + +type DiscoveryResponse = Pick; +type DiscoveryHttp = (url: string, init: { + method: string; + headers: Record; + timeoutMs: number; + dontFollowRedirects: boolean; +}) => Promise; +type DiscoveryDependencies = { + http?: DiscoveryHttp; + now?: () => number; +}; + +type CacheEntry = { + apiKey: string; + fetchedAt: number; + models: DiscoveredCompatibleModel[]; +}; + +export const COMPATIBLE_MODEL_DISCOVERY_TIMEOUT_MS = 10_000; +const CACHE_TTL_MS = 60_000; +const MAX_MODELS = 500; +const MAX_DISCOVERY_BODY_CHARS = 2_000_000; +const cache = new Map(); + +/** + * Discover models from the configured server's own /models endpoint. No URL + * probing, inference calls, disk persistence, or automatic model selection. + */ +export async function discoverOpenAiCompatibleModels( + options: DiscoveryOptions, + dependencies: DiscoveryDependencies = {}, +): Promise { + const baseUrl = normalizeOpenAiCompatibleUrl(options.baseUrl); + if (!baseUrl) throw new Error("Set a valid compatible API URL first"); + const apiKey = options.apiKey.trim(); + const now = dependencies.now ?? Date.now; + const cached = cache.get(baseUrl); + if (!options.forceRefresh && cached && cached.apiKey === apiKey && now() - cached.fetchedAt < CACHE_TTL_MS) { + return cached.models; + } + + const http = dependencies.http ?? defaultHttp; + const headers: Record = {}; + if (apiKey) headers.Authorization = `Bearer ${apiKey}`; + let response: DiscoveryResponse; + try { + response = await http(`${baseUrl}/models`, { + method: "GET", + headers, + timeoutMs: COMPATIBLE_MODEL_DISCOVERY_TIMEOUT_MS, + // Do not forward a credential to a redirect target. + dontFollowRedirects: true, + }); + } catch { + throw new Error("Could not reach the configured server"); + } + if (response.status < 200 || response.status >= 300) { + throw new Error(describeHttpError(response.status)); + } + + let body: any; + let rawBody: string; + try { + rawBody = await response.text(); + if (rawBody.length > MAX_DISCOVERY_BODY_CHARS) throw new Error("too large"); + body = JSON.parse(rawBody); + } catch { + throw new Error("The server returned an invalid model list"); + } + if (!body || !Array.isArray(body.data)) { + throw new Error("The server did not return an OpenAI-compatible model list"); + } + + const models = parseModels(body.data); + cache.set(baseUrl, { apiKey, fetchedAt: now(), models }); + return models; +} + +/** Parse OpenAI data[] rows, retaining richer Venice metadata when present. */ +export function parseDiscoveredCompatibleModels(rows: any[]): DiscoveredCompatibleModel[] { + return parseModels(rows); +} + +function parseModels(rows: any[]): DiscoveredCompatibleModel[] { + const byId = new Map(); + for (const row of rows) { + if (!row || typeof row.id !== "string" || !row.id.trim()) continue; + const id = row.id.trim(); + if (byId.has(id)) continue; + const spec = row.model_spec && typeof row.model_spec === "object" ? row.model_spec : null; + const capabilities = spec?.capabilities && typeof spec.capabilities === "object" ? spec.capabilities : null; + const catalogName = typeof spec?.name === "string" ? spec.name.trim() : ""; + const genericName = typeof row.name === "string" ? row.name.trim() : ""; + byId.set(id, { + id, + name: catalogName || genericName || id, + supportsTools: typeof capabilities?.supportsFunctionCalling === "boolean" + ? capabilities.supportsFunctionCalling + : null, + offline: spec?.offline === true, + deprecated: Boolean(spec?.deprecation), + beta: spec?.betaModel === true || spec?.beta === true, + }); + if (byId.size >= MAX_MODELS) break; + } + return Array.from(byId.values()).sort((a, b) => { + if (a.offline !== b.offline) return a.offline ? 1 : -1; + const aTools = a.supportsTools === true ? 0 : a.supportsTools === null ? 1 : 2; + const bTools = b.supportsTools === true ? 0 : b.supportsTools === null ? 1 : 2; + if (aTools !== bTools) return aTools - bTools; + return (a.name || a.id).localeCompare(b.name || b.id) || a.id.localeCompare(b.id); + }); +} + +async function defaultHttp(url: string, init: { + method: string; + headers: Record; + timeoutMs: number; + dontFollowRedirects: boolean; +}): Promise { + return fetchTextWithUserAgent(url, init); +} + +function describeHttpError(status: number): string { + if (status === 401) return "The server rejected the API key (HTTP 401)"; + if (status === 403) return "The API key cannot list these models (HTTP 403)"; + if (status === 404) return "Model discovery is not supported at this URL (HTTP 404)"; + if (status === 429) return "The server is rate limiting requests (HTTP 429)"; + if (status >= 500) return `The server is unavailable (HTTP ${status})`; + if (status >= 300 && status < 400) return `The server redirected the request; use its direct API URL (HTTP ${status})`; + return `Model discovery failed (HTTP ${status})`; +} + +/** Test hook; does not affect any saved setting. */ +export function clearCompatibleModelDiscoveryCache(): void { + cache.clear(); +} diff --git a/app/native/openai-chat.ts b/app/native/openai-chat.ts new file mode 100644 index 00000000..745de2f6 --- /dev/null +++ b/app/native/openai-chat.ts @@ -0,0 +1,330 @@ +import type { + LlmContentBlock, + LlmStreamHandle, + LlmStreamOptions, +} from "../assistant/llm-protocol"; +import { openSseRequest, type SseListener } from "./sse"; + +/** True only for Venice's official API root, never for lookalike hosts. */ +export function isVeniceApiBaseUrl(input: string): boolean { + return normalizeOpenAiCompatibleUrl(input) === "https://api.venice.ai/api/v1"; +} + +/** Streaming client for OpenAI-compatible Chat Completions APIs. */ +export type OpenAiCompatibleStreamOptions = LlmStreamOptions & { + /** Explicit API root, for example https://api.venice.ai/api/v1 or https://host/api. */ + baseUrl: string; + /** Venice-only web search; never sent to other compatible providers. */ + webSearch?: boolean; +}; + +type PendingToolCall = { + id: string; + name: string; + inputJson: string; +}; + +/** Remove an optional endpoint suffix, but never guess a provider's /v1 or /api prefix. */ +export function normalizeOpenAiCompatibleUrl(input: string): string { + let url = input.trim().replace(/\/+$/, ""); + url = url.replace(/\/chat\/completions$/i, "").replace(/\/+$/, ""); + return /^https?:\/\/[^/\s?#@\\]+(?:\/[^\s?#\\]*)?$/i.test(url) ? url : ""; +} + +export function streamOpenAiCompatibleChat(options: OpenAiCompatibleStreamOptions): LlmStreamHandle { + const apiKey = options.apiKey.trim(); + const baseUrl = normalizeOpenAiCompatibleUrl(options.baseUrl); + let request: { cancel(): void } | null = null; + let settled = false; + let text = ""; + let finishReason: string | null = null; + const toolCalls = new Map(); + const providerMetadata: Record = {}; + const reasoningDetails = new ReasoningDetailsAccumulator(); + + const fail = (message: string) => { + if (settled) return; + settled = true; + request?.cancel(); + options.onError(message); + }; + + const done = () => { + if (settled) return; + const hasToolCalls = toolCalls.size > 0; + // Never execute calls from a truncated stream or a length-limited response. + if (hasToolCalls && finishReason !== "tool_calls" && finishReason !== "stop") { + fail("OpenAI-compatible stream ended before its tool calls completed"); + return; + } + if (!text && !hasToolCalls) { + fail("OpenAI-compatible provider ended the turn without a reply"); + return; + } + + const content: LlmContentBlock[] = []; + if (text) content.push({ type: "text", text }); + const details = reasoningDetails.entries(); + if (details.length) providerMetadata.reasoning_details = details; + if (Object.keys(providerMetadata).length) { + content.push({ type: "provider_item", provider: "openai-compatible", item: providerMetadata }); + } + for (const index of Array.from(toolCalls.keys()).sort((a, b) => a - b)) { + const call = toolCalls.get(index)!; + if (!call.name) { + fail("OpenAI-compatible provider returned a tool call without a name"); + return; + } + let input: any = {}; + if (call.inputJson.trim()) { + try { + input = JSON.parse(call.inputJson); + } catch { + fail("OpenAI-compatible provider returned malformed tool arguments"); + return; + } + } + content.push({ + type: "tool_use", + id: call.id || `call_${index + 1}`, + name: call.name, + input, + }); + } + + settled = true; + request?.cancel(); + options.onDone({ + text, + content, + stopReason: finishReason === "content_filter" ? "refusal" + : hasToolCalls ? "tool_use" + : finishReason === "length" ? "max_tokens" : "end_turn", + }); + }; + + if (!baseUrl || !options.model.trim()) { + setTimeout(() => fail(!baseUrl + ? "Set a valid OpenAI-compatible API URL" + : "Set an OpenAI-compatible model ID"), 0); + return { cancel: () => { settled = true; } }; + } + + const body: any = { + model: options.model.trim(), + messages: buildChatMessages(options), + stream: true, + }; + // Let the provider choose its default unless a one-shot feature supplies a cap. + if (options.maxTokens !== undefined) body.max_tokens = options.maxTokens; + if (options.tools?.length) { + body.tools = options.tools.map((tool) => ({ + type: "function", + function: { + name: tool.name, + description: tool.description, + parameters: tool.input_schema, + }, + })); + } + // Provider-specific parameters must never leak to another endpoint, even + // when a saved Venice preference is still enabled. + if (options.webSearch === true && isVeniceApiBaseUrl(baseUrl)) { + body.venice_parameters = { enable_web_search: "on" }; + } + // Do not send provider-specific reasoning fields by default. Compatible + // servers vary widely; advanced reasoning controls can be added separately. + + const headers: Record = { "Content-Type": "application/json" }; + if (apiKey) headers.Authorization = `Bearer ${apiKey}`; + + const listener: SseListener = { + onLine: (line: string) => { + if (settled || !line.startsWith("data:")) return; + const payload = line.slice(5).trim(); + if (!payload) return; + if (payload === "[DONE]") { + if (finishReason || (!toolCalls.size && text)) done(); + else fail("OpenAI-compatible stream ended before the response completed"); + return; + } + let event: any; + try { + event = JSON.parse(payload); + } catch { + return; + } + if (event?.error) { + fail(`OpenAI-compatible: ${String(event.error.message ?? event.error)}`); + return; + } + const choice = event?.choices?.[0]; + if (!choice) return; // Usage and provider-metadata chunks may have no choices. + const delta = choice.delta ?? {}; + if (typeof delta.content === "string" && delta.content) { + text += delta.content; + options.onTextDelta?.(delta.content, text); + } + // Reasoning is not displayed. Preserve provider metadata for replay in + // multi-turn tool loops when the service supplies it. + if (Array.isArray(delta.reasoning_details)) reasoningDetails.add(delta.reasoning_details); + if (delta.thought_signature !== undefined) providerMetadata.thought_signature = delta.thought_signature; + if (Array.isArray(delta.tool_calls)) { + delta.tool_calls.forEach((call: any, position: number) => { + const index = Number.isInteger(call?.index) ? Number(call.index) : position; + const pending = toolCalls.get(index) ?? { id: "", name: "", inputJson: "" }; + if (call?.id) pending.id = String(call.id); + if (call?.function?.name) pending.name = String(call.function.name); + if (typeof call?.function?.arguments === "string") pending.inputJson += call.function.arguments; + toolCalls.set(index, pending); + }); + } + if (choice.finish_reason) finishReason = String(choice.finish_reason); + }, + onHttpError: (code: number, errorBody: string) => fail(describeHttpError(Number(code), String(errorBody))), + onComplete: () => { + // Some compatible servers close after the finish chunk without [DONE]. + if (finishReason) done(); + else fail("OpenAI-compatible stream ended before the response completed"); + }, + onFailure: (message: string) => fail(`OpenAI-compatible connection failed: ${String(message)}`), + }; + + try { + request = openSseRequest(`${baseUrl}/chat/completions`, JSON.stringify(body), headers, listener); + } catch (error) { + setTimeout(() => fail(`OpenAI-compatible request failed: ${String((error as Error)?.message ?? error)}`), 0); + return { cancel: () => { settled = true; } }; + } + + return { + cancel: () => { + settled = true; + try { request?.cancel(); } catch { /* ignore */ } + }, + }; +} + +/** String fields of a reasoning_details entry that stream in pieces. */ +const REASONING_DETAIL_TEXT_FIELDS = ["text", "summary", "data"]; + +/** + * Rebuilds the complete reasoning_details array (OpenRouter's format) from + * streamed deltas. Each delta carries fragments; fragments with the same + * `index` belong to one entry, so their text, summary, and data concatenate + * and their other fields (e.g. a signature that arrives after the text) fill + * in. Entries without an index are kept as sent. The replayed array must + * match what the model produced, so it is reassembled whole rather than + * replaying only the latest chunk. + */ +class ReasoningDetailsAccumulator { + private readonly ordered: Record[] = []; + private readonly byIndex = new Map>(); + + add(fragments: any[]): void { + for (const fragment of fragments) { + if (!fragment || typeof fragment !== "object" || Array.isArray(fragment)) continue; + const index = Number.isInteger(fragment.index) ? Number(fragment.index) : null; + const existing = index === null ? undefined : this.byIndex.get(index); + if (!existing) { + const entry = { ...fragment }; + this.ordered.push(entry); + if (index !== null) this.byIndex.set(index, entry); + continue; + } + for (const [key, value] of Object.entries(fragment)) { + if (value === undefined || value === null) continue; + if (REASONING_DETAIL_TEXT_FIELDS.includes(key) && typeof value === "string" && typeof existing[key] === "string") { + existing[key] += value; + } else if (existing[key] === undefined || existing[key] === null) { + existing[key] = value; + } + } + } + } + + entries(): Record[] { + return this.ordered; + } +} + +/** Convert neutral conversation history to Chat Completions messages. */ +function buildChatMessages(options: OpenAiCompatibleStreamOptions): any[] { + const messages: any[] = []; + if (options.system) messages.push({ role: "system", content: options.system }); + + for (const message of options.messages) { + if (typeof message.content === "string") { + messages.push({ role: message.role, content: message.content }); + continue; + } + + if (message.role === "assistant") { + let text = ""; + const toolCalls: any[] = []; + let providerMetadata: Record = {}; + for (const block of message.content) { + if (block.type === "text") text += block.text; + else if (block.type === "tool_use") { + toolCalls.push({ + id: block.id, + type: "function", + function: { name: block.name, arguments: JSON.stringify(block.input ?? {}) }, + }); + } else if (block.type === "provider_item" && block.provider === "openai-compatible") { + providerMetadata = { ...providerMetadata, ...block.item }; + } + } + if (text || toolCalls.length) { + messages.push({ + role: "assistant", + content: text || (toolCalls.length ? null : ""), + ...(toolCalls.length ? { tool_calls: toolCalls } : {}), + ...providerMetadata, + }); + } + continue; + } + + let pendingText = ""; + const flushText = () => { + if (!pendingText) return; + messages.push({ role: "user", content: pendingText }); + pendingText = ""; + }; + for (const block of message.content) { + if (block.type === "text") pendingText += block.text; + else if (block.type === "tool_result") { + flushText(); + messages.push({ + role: "tool", + tool_call_id: block.tool_use_id, + content: block.is_error ? `Error: ${block.content}` : block.content, + }); + } + } + flushText(); + } + return messages; +} + +function describeHttpError(code: number, body: string): string { + let detail = ""; + try { + const parsed = JSON.parse(body); + detail = String(parsed?.error?.message ?? parsed?.error ?? parsed?.message ?? ""); + } catch { + // Non-JSON error body. + } + switch (code) { + case 401: return "OpenAI-compatible: invalid API key"; + case 403: return "OpenAI-compatible: API key lacks permission"; + case 429: return "OpenAI-compatible: rate limited, try again shortly"; + case 500: + case 502: + case 503: + case 504: + return "OpenAI-compatible: service unavailable, try again shortly"; + default: return `OpenAI-compatible: HTTP ${code}${detail ? ` (${detail})` : ""}`; + } +} diff --git a/app/native/openai-stt.ts b/app/native/openai-stt.ts index 063e0a39..24f109a1 100644 --- a/app/native/openai-stt.ts +++ b/app/native/openai-stt.ts @@ -40,7 +40,7 @@ export class OpenAiRealtimeSttClient implements CloudSttClient { onOpen: () => { if (this.closed) return; this.open = true; - this.trySend(JSON.stringify(sessionConfig())); + this.trySend(JSON.stringify(sessionConfig(this.options.language ?? ""))); for (const chunk of this.pendingChunks.splice(0)) { this.sendChunk(chunk); } @@ -201,7 +201,7 @@ export class OpenAiRealtimeSttClient implements CloudSttClient { } -function sessionConfig(): object { +function sessionConfig(language: string): object { return { type: "session.update", session: { @@ -209,7 +209,7 @@ function sessionConfig(): object { audio: { input: { format: { type: "audio/pcm", rate: TARGET_SAMPLE_RATE }, - transcription: { model: MODEL_ID }, + transcription: { model: MODEL_ID, ...(language ? { language } : {}) }, // Push-to-talk owns the utterance boundary; no server VAD. turn_detection: null, }, diff --git a/app/native/resource-usage-types.ts b/app/native/resource-usage-types.ts new file mode 100644 index 00000000..c56ffda5 --- /dev/null +++ b/app/native/resource-usage-types.ts @@ -0,0 +1,22 @@ +/** Platform-neutral process resource sample, shared by resource-usage.ts and resource-usage.ios.ts. */ + +export type ResourceSample = { + /** Monotonic clock (counting deep sleep), ms. */ + atMs: number; + /** Cumulative CPU time of every thread in the process, ms. */ + cpuMs: number; + threads: number; + /** One value per entry of the platform's MEMORY_SERIES, MiB. */ + memoryMb: number[]; + /** Platform-specific details for the latest sample (peaks, limits, thermal state). */ + status: string; +}; + +export function kbToMb(kb: number): number { + return Number.isFinite(kb) ? Math.max(0, kb) / 1024 : 0; +} + +export function formatMb(value: number): string { + if (value >= 1024) return `${(value / 1024).toFixed(1)}G`; + return `${Math.round(value)}M`; +} diff --git a/app/native/resource-usage.ios.ts b/app/native/resource-usage.ios.ts new file mode 100644 index 00000000..efd46ce9 --- /dev/null +++ b/app/native/resource-usage.ios.ts @@ -0,0 +1,37 @@ +import { formatMb, kbToMb, type ResourceSample } from "./resource-usage-types"; + +export * from "./resource-usage-types"; + +declare const FaceclawResourceUsage: any; + +/** + * Memory series charted by the resource monitor, headline first: the physical + * footprint (what jetsam enforces its limit against, and what Xcode's memory + * gauge shows), resident memory, and bytes in use across the malloc zones. + */ +export const MEMORY_SERIES: readonly string[] = ["footprint", "resident", "malloc"]; + +const THERMAL_STATES = ["nominal", "fair", "serious", "critical"]; + +export function sampleResourceUsage(): ResourceSample { + const raw = JSON.parse(String(FaceclawResourceUsage.sample())) as Record; + const kb = (key: string) => kbToMb(Number(raw[key] ?? 0)); + const footprintMb = kb("footprintKb"); + const peakMb = kb("footprintPeakKb"); + const availableMb = kb("availableKb"); + const thermal = THERMAL_STATES[Number(raw.thermalState)]; + return { + atMs: Number(raw.atMs), + cpuMs: Number(raw.cpuMs ?? 0), + threads: Number(raw.threads ?? 0), + memoryMb: [footprintMb, kb("residentKb"), kb("mallocKb")], + status: [ + // Footprint plus the remaining headroom is the jetsam limit. No headroom + // means no limit applies (the simulator) or it was just exceeded. + availableMb > 0 ? `limit ${formatMb(footprintMb + availableMb)}` : "", + peakMb > 0 ? `peak ${formatMb(peakMb)}` : "", + thermal ? `thermal ${thermal}` : "", + raw.lowPower === true ? "Low Power Mode" : "", + ].filter(Boolean).join(" · "), + }; +} diff --git a/app/native/resource-usage.ts b/app/native/resource-usage.ts new file mode 100644 index 00000000..2c15f33f --- /dev/null +++ b/app/native/resource-usage.ts @@ -0,0 +1,28 @@ +import { formatMb, kbToMb, type ResourceSample } from "./resource-usage-types"; + +export * from "./resource-usage-types"; + +declare const com: any; + +/** + * Memory series charted by the resource monitor, headline first: RSS from + * /proc/self/status (what Android records at exit), the native malloc heap, + * and the used Java heap. + */ +export const MEMORY_SERIES: readonly string[] = ["RSS", "native", "Java"]; + +export function sampleResourceUsage(): ResourceSample { + const raw = com.faceclaw.app.FaceclawResourceUsage.sample(); + const peakRssMb = kbToMb(Number(raw[7])); + const javaCommittedMb = kbToMb(Number(raw[5])); + return { + atMs: Number(raw[0]), + cpuMs: Number(raw[1]), + memoryMb: [kbToMb(Number(raw[2])), kbToMb(Number(raw[3])), kbToMb(Number(raw[4]))], + threads: Number(raw[6]), + status: [ + peakRssMb > 0 ? `peak RSS ${formatMb(peakRssMb)}` : "", + `Java heap ${formatMb(javaCommittedMb)} committed`, + ].filter(Boolean).join(" · "), + }; +} diff --git a/app/native/soniox-stt.ts b/app/native/soniox-stt.ts index aa0d210c..fc24f2e0 100644 --- a/app/native/soniox-stt.ts +++ b/app/native/soniox-stt.ts @@ -50,6 +50,8 @@ export class SonioxSttClient implements CloudSttClient { sample_rate: CLOUD_STT_SAMPLE_RATE, num_channels: 1, enable_speaker_diarization: true, + // A hint, not a restriction: other languages are still recognized. + ...(this.options.language ? { language_hints: [this.options.language] } : {}), }), ); if (this.closed) return; diff --git a/app/native/speech-analyzer-stt.ios.ts b/app/native/speech-analyzer-stt.ios.ts new file mode 100644 index 00000000..a7afa7f1 --- /dev/null +++ b/app/native/speech-analyzer-stt.ios.ts @@ -0,0 +1,193 @@ +import { CLOUD_STT_SAMPLE_RATE, type CloudSttClient, type CloudSttOptions } from "./cloud-stt"; +import { ReconnectingSttClient } from "./reconnecting-stt"; +import { TRANSCRIPT_PAUSE_MS } from "./speech-pause"; + +declare const FaceclawSpeechAnalyzer: any; + +/** + * How long finish() waits for the last results: the model only has to settle + * the few seconds of audio it hadn't finalized yet. + */ +export const SPEECH_ANALYZER_FINAL_TIMEOUT_MS = 10000; + +/** + * A pause is detected TRANSCRIPT_PAUSE_MS after the last loud audio. A final + * whose last word ends within this much before that (the model's word ends + * against the detector's level threshold) leaves nothing before the pause + * unfinalized, so its paragraph is complete. + */ +const PARAGRAPH_TAIL_S = TRANSCRIPT_PAUSE_MS / 1000 + 0.25; + +type AnalyzerEvent = { + kind: string; + message?: string; + locale?: string; + text?: string; + final?: boolean; + start?: number | null; + end?: number | null; + speechEnd?: number | null; +}; + +/** Whether Apple's SpeechAnalyzer (iOS 26+, supported hardware) can run continuous capture. */ +export function speechAnalyzerSupported(): boolean { + try { + return typeof FaceclawSpeechAnalyzer !== "undefined" && Boolean(FaceclawSpeechAnalyzer.isSupported()); + } catch { + return false; + } +} + +/** + * On-device long-form transcription for continuous capture, wrapped like a + * cloud provider: it buffers audio until the model is ready (downloading it on + * first use) and gets pause commits. + */ +export function createSpeechAnalyzerClient( + options: Omit, + continuous: () => boolean, +): ReconnectingSttClient { + return new ReconnectingSttClient( + (clientOptions) => new SpeechAnalyzerSttClient(clientOptions), + { ...options, apiKey: "", language: (options.language ?? "").trim() }, + continuous, + SPEECH_ANALYZER_FINAL_TIMEOUT_MS, + ); +} + +/** + * Transcribes PCM with FaceclawSpeechAnalyzer (FaceclawSpeechAnalyzer.swift). + * The model finalizes text in its own pieces, a few seconds behind, and can't + * be made to settle at a pause; this gathers its pieces into paragraphs ended + * by pauses, like the cloud providers' segments. A paragraph is shown as + * provisional text and sent as one final (paragraphBreakAfter) once a final + * reaches its pause, and the last one as a plain final when the audio ends. + * + * Only finals place breaks, by when their last word ends (the model's + * word-end times are accurate; first words' starts reach back into the + * silence before them, and volatile results only carry the range of all audio + * not finalized yet). + */ +export class SpeechAnalyzerSttClient implements CloudSttClient { + private native: any = null; + private samples = 0; + private finishing = false; + // Audio times (s) of pauses whose paragraph hasn't ended yet. + private pauses: number[] = []; + // Finalized text since the last paragraph break, when its last word ends, + // and the model's provisional rest. + private paragraph: string[] = []; + private paragraphEnd: number | null = null; + private volatile = ""; + + constructor(private readonly options: CloudSttOptions) {} + + start(): void { + if (this.native) return; + const native = FaceclawSpeechAnalyzer.new(); + native.eventHandler = (json: string) => { + if (this.native === native) this.receive(JSON.parse(json)); + }; + this.native = native; + native.startWithLanguage(this.options.language ?? ""); + } + + acceptPcm(pcm: Uint8Array): void { + if (!this.native || this.finishing || !pcm.length) return; + this.samples += pcm.length >> 1; + const copy = pcm.slice(); + this.native.acceptPcm(NSData.dataWithBytesLength(interop.handleof(copy.buffer), copy.byteLength)); + } + + /** A pause: it ends the paragraph once the words before it are final. */ + commitSegment(): void { + if (!this.native || this.finishing) return; + this.pauses.push(this.samples / CLOUD_STT_SAMPLE_RATE); + if (this.endCompleteParagraph() && this.volatile) this.options.onTranscript({ text: this.liveText(), isFinal: false }); + } + + finish(): void { + if (!this.native || this.finishing) return; + this.finishing = true; + this.native.finish(); + } + + stop(): void { + const native = this.native; + this.native = null; + native?.cancel(); + } + + private receive(event: AnalyzerEvent): void { + switch (event.kind) { + case "status": + this.options.onStatus(event.message ?? ""); + break; + case "ready": + this.options.onStatus("Listening (on-device)..."); + this.options.onReady?.(); + break; + case "transcript": + this.transcript(event); + break; + case "finished": { + const text = this.liveText(); + this.paragraph = []; + this.volatile = ""; + this.stop(); + this.options.onTranscript({ text, isFinal: true }); + break; + } + case "error": + this.stop(); + this.options.onError(event.message ?? "On-device transcription failed."); + break; + } + } + + private transcript(event: AnalyzerEvent): void { + const text = (event.text ?? "").trim(); + let ended = false; + if (!event.final) { + this.volatile = text; + } else { + this.volatile = ""; + if (text) { + const end = event.speechEnd ?? event.end ?? null; + // Words ending after a pause come after it. (One whose words run + // across it, if the model didn't split there, breaks a little early.) + if (end !== null && this.pauses.some((pause) => end > pause)) { + this.pauses = this.pauses.filter((pause) => pause >= end); + this.endParagraph(); + } + this.paragraph.push(text); + this.paragraphEnd = end; + ended = this.endCompleteParagraph(); + } + } + // The paragraph's final already cleared the provisional text. + if (!ended || this.volatile) this.options.onTranscript({ text: this.liveText(), isFinal: false }); + } + + /** End the paragraph if its last word ends just before a pause. */ + private endCompleteParagraph(): boolean { + const end = this.paragraphEnd; + if (!this.paragraph.length || end === null) return false; + const reached = (pause: number) => end >= pause - PARAGRAPH_TAIL_S; + if (!this.pauses.some(reached)) return false; + this.pauses = this.pauses.filter((pause) => !reached(pause)); + this.endParagraph(); + return true; + } + + private endParagraph(): void { + const text = this.paragraph.join(" "); + this.paragraph = []; + this.paragraphEnd = null; + if (text) this.options.onTranscript({ text, isFinal: true, paragraphBreakAfter: true }); + } + + private liveText(): string { + return [...this.paragraph, this.volatile].filter(Boolean).join(" "); + } +} diff --git a/app/native/spotify-auth.ts b/app/native/spotify-auth.ts new file mode 100644 index 00000000..956a5141 --- /dev/null +++ b/app/native/spotify-auth.ts @@ -0,0 +1,273 @@ +import { getStringSetting, setStringSetting } from "./settings-store"; +import { buildQuery, SpotifyApiError, SpotifyClient, type SpotifyFetch, type SpotifyTokenSource } from "./spotify-web-api"; + +/** + * Spotify sign-in: OAuth authorization code with PKCE against the user's own + * client ID (no client secret), redirected to a loopback address that the + * phone catches (FaceclawWebSignIn on iOS). Spotify accepts http only for + * loopback IP literals, and custom-scheme redirects fail with "insecure + * redirect URI" for apps created since 2025, so the redirect is + * http://127.0.0.1 on a fixed port the user registers in the dashboard. + * + * The tokens are stored with the client ID they were issued to; changing the + * client ID setting signs out. + */ + +export const SPOTIFY_ACCOUNTS_BASE = "https://accounts.spotify.com"; +export const SPOTIFY_REDIRECT_PORT = 43823; +export const SPOTIFY_REDIRECT_PATH = "/spotify-callback"; +export const SPOTIFY_REDIRECT_URI = `http://127.0.0.1:${SPOTIFY_REDIRECT_PORT}${SPOTIFY_REDIRECT_PATH}`; +export const SPOTIFY_DASHBOARD_URL = "https://developer.spotify.com/dashboard"; + +export const SPOTIFY_CLIENT_ID_KEY = "music.spotify.clientId"; +export const SPOTIFY_ACCOUNT_KEY = "music.spotify.account"; + +export const SPOTIFY_SCOPES = [ + "user-read-playback-state", + "user-modify-playback-state", + "user-read-currently-playing", + "user-read-recently-played", + "playlist-read-private", + "playlist-read-collaborative", + "user-library-read", + "user-library-modify", + "user-follow-read", +]; + +/** Refresh this long before Spotify's stated expiry (an hour), so a token never lapses mid-request. */ +const EXPIRY_MARGIN_MS = 60_000; + +export type SpotifyAccount = { + clientId: string; + accessToken: string; + refreshToken: string; + /** Epoch ms. */ + expiresAtMs: number; + userId: string; + displayName: string; + /** "premium", "free", ...; playback control needs premium. */ + product: string; +}; + +export type SpotifyTokens = { accessToken: string; refreshToken: string; expiresAtMs: number }; + +/** The phone side of a sign-in: PKCE material and the browser sheet that catches the loopback redirect. */ +export type WebSignIn = { + /** A fresh PKCE verifier and its S256 challenge. */ + createPkce(): { verifier: string; challenge: string }; + randomState(): string; + /** Show the provider's page; resolves to the redirect URL, rejects with "cancelled" or why it failed. */ + open(authorizeUrl: string, port: number, path: string): Promise; + cancel(): void; +}; + +export function spotifyClientId(): string { + return getStringSetting(SPOTIFY_CLIENT_ID_KEY, "").trim(); +} + +export function isValidSpotifyClientId(value: string): boolean { + return /^[0-9a-f]{32}$/i.test(value.trim()); +} + +/** The stored sign-in, or null when signed out or signed in with another client ID. */ +export function readSpotifyAccount(): SpotifyAccount | null { + let raw: any; + try { + raw = JSON.parse(getStringSetting(SPOTIFY_ACCOUNT_KEY, "") || "null"); + } catch { + return null; + } + if (!raw || typeof raw.refreshToken !== "string" || !raw.refreshToken) return null; + const clientId = spotifyClientId(); + if (!clientId || raw.clientId !== clientId) return null; + return { + clientId, + accessToken: String(raw.accessToken ?? ""), + refreshToken: raw.refreshToken, + expiresAtMs: Number(raw.expiresAtMs) || 0, + userId: String(raw.userId ?? ""), + displayName: String(raw.displayName ?? ""), + product: String(raw.product ?? ""), + }; +} + +export function saveSpotifyAccount(account: SpotifyAccount | null): void { + setStringSetting(SPOTIFY_ACCOUNT_KEY, account ? JSON.stringify(account) : ""); +} + +export function spotifyAuthorizeUrl(clientId: string, codeChallenge: string, state: string): string { + return `${SPOTIFY_ACCOUNTS_BASE}/authorize${buildQuery({ + response_type: "code", + client_id: clientId, + scope: SPOTIFY_SCOPES.join(" "), + redirect_uri: SPOTIFY_REDIRECT_URI, + state, + code_challenge_method: "S256", + code_challenge: codeChallenge, + })}`; +} + +/** The authorization code from Spotify's redirect; throws with a message for the glasses otherwise. */ +export function parseSpotifyRedirect(url: string, expectedState: string): string { + const params = parseQueryString(url); + if (params.error) { + throw new Error(params.error === "access_denied" ? "Spotify sign-in was declined." : `Spotify sign-in failed: ${params.error}`); + } + if (params.state !== expectedState) throw new Error("Spotify sign-in failed: the reply didn't match this sign-in. Try again."); + if (!params.code) throw new Error("Spotify sign-in failed: no authorization code in the reply."); + return params.code; +} + +/** Query parameters of a URL (not URLSearchParams, which the NativeScript runtime mishandles). */ +export function parseQueryString(url: string): Record { + const query = url.split("#")[0]!.split("?").slice(1).join("?"); + const params: Record = {}; + for (const part of query.split("&")) { + if (!part) continue; + const separator = part.indexOf("="); + const key = separator < 0 ? part : part.slice(0, separator); + const value = separator < 0 ? "" : part.slice(separator + 1); + try { + params[decodeURIComponent(key.replace(/\+/g, " "))] = decodeURIComponent(value.replace(/\+/g, " ")); + } catch { + // Malformed escapes: skip the parameter. + } + } + return params; +} + +/** POST to Spotify's token endpoint (authorization_code or refresh_token grant). */ +export async function requestSpotifyTokens( + fetchImpl: SpotifyFetch, + params: Record, + nowMs: number, +): Promise { + let status = 0; + let body = ""; + try { + const response = await fetchImpl(`${SPOTIFY_ACCOUNTS_BASE}/api/token`, { + method: "POST", + headers: { "Content-Type": "application/x-www-form-urlencoded", Accept: "application/json" }, + body: buildQuery(params).slice(1), + }); + status = response.status; + body = await response.text(); + } catch (error) { + throw new SpotifyApiError(`Can't reach Spotify: ${(error as Error)?.message ?? error}`, 0); + } + let parsed: any = null; + try { + parsed = JSON.parse(body); + } catch { + // Reported below. + } + if (status >= 200 && status < 300 && typeof parsed?.access_token === "string") { + const expiresIn = Number(parsed.expires_in); + return { + accessToken: parsed.access_token, + // Spotify may rotate the refresh token; "" keeps the current one. + refreshToken: typeof parsed.refresh_token === "string" ? parsed.refresh_token : "", + expiresAtMs: nowMs + (Number.isFinite(expiresIn) && expiresIn > 0 ? expiresIn : 3600) * 1000, + }; + } + const error = typeof parsed?.error === "string" ? parsed.error : ""; + const description = typeof parsed?.error_description === "string" ? parsed.error_description : ""; + if (error === "invalid_grant" && params.grant_type === "refresh_token") { + throw new SpotifyApiError("Spotify no longer accepts this sign-in. Sign in again from the Music app menu.", status, error); + } + if (error === "invalid_client") { + throw new SpotifyApiError("Spotify doesn't recognize the client ID. Check it under Spotify in the Music app menu.", status, error); + } + throw new SpotifyApiError(`Spotify sign-in failed: ${description || error || `HTTP ${status}`}`, status, error); +} + +/** + * Access tokens for the stored account: the current one until it nears + * expiry, then one refresh shared by every caller waiting on it. A refresh + * Spotify rejects (revoked access) signs out. + */ +export class SpotifySession implements SpotifyTokenSource { + private refreshing: Promise | null = null; + + constructor( + private readonly fetchImpl: SpotifyFetch, + private readonly now: () => number = Date.now, + ) {} + + accessToken(forceRefresh: boolean): Promise { + const account = readSpotifyAccount(); + if (!account) return Promise.reject(new SpotifyApiError("Not signed in to Spotify.", 401, "signed_out")); + if (!forceRefresh && account.accessToken && account.expiresAtMs - EXPIRY_MARGIN_MS > this.now()) { + return Promise.resolve(account.accessToken); + } + this.refreshing ??= this.refresh(account).finally(() => { + this.refreshing = null; + }); + return this.refreshing; + } + + private async refresh(account: SpotifyAccount): Promise { + let tokens: SpotifyTokens; + try { + tokens = await requestSpotifyTokens(this.fetchImpl, { + grant_type: "refresh_token", + refresh_token: account.refreshToken, + client_id: account.clientId, + }, this.now()); + } catch (error) { + if (error instanceof SpotifyApiError && error.reason === "invalid_grant" && readSpotifyAccount()?.refreshToken === account.refreshToken) { + saveSpotifyAccount(null); + } + throw error; + } + // A sign-out or another sign-in while this was in flight wins. + if (readSpotifyAccount()?.refreshToken !== account.refreshToken) { + throw new SpotifyApiError("Spotify sign-in changed; try again.", 401, "signed_out"); + } + saveSpotifyAccount({ + ...account, + accessToken: tokens.accessToken, + refreshToken: tokens.refreshToken || account.refreshToken, + expiresAtMs: tokens.expiresAtMs, + }); + return tokens.accessToken; + } +} + +/** + * The whole sign-in: the browser sheet, the code exchange and the profile + * lookup; stores and returns the account. Rejects with "cancelled" when the + * user closes the sheet. + */ +export async function signInToSpotify( + fetchImpl: SpotifyFetch, + webSignIn: WebSignIn, + now: () => number = Date.now, +): Promise { + const clientId = spotifyClientId(); + if (!isValidSpotifyClientId(clientId)) throw new Error("Enter your Spotify client ID first."); + const { verifier, challenge } = webSignIn.createPkce(); + const state = webSignIn.randomState(); + const redirect = await webSignIn.open(spotifyAuthorizeUrl(clientId, challenge, state), SPOTIFY_REDIRECT_PORT, SPOTIFY_REDIRECT_PATH); + const code = parseSpotifyRedirect(redirect, state); + const tokens = await requestSpotifyTokens(fetchImpl, { + grant_type: "authorization_code", + code, + redirect_uri: SPOTIFY_REDIRECT_URI, + client_id: clientId, + code_verifier: verifier, + }, now()); + const user = await new SpotifyClient(fetchImpl, { accessToken: async () => tokens.accessToken }).me(); + const account: SpotifyAccount = { + clientId, + accessToken: tokens.accessToken, + refreshToken: tokens.refreshToken, + expiresAtMs: tokens.expiresAtMs, + userId: user.id, + displayName: user.displayName, + product: user.product, + }; + if (!account.refreshToken) throw new Error("Spotify sign-in failed: no refresh token in the reply."); + saveSpotifyAccount(account); + return account; +} diff --git a/app/native/spotify-library.ts b/app/native/spotify-library.ts new file mode 100644 index 00000000..fd0627e2 --- /dev/null +++ b/app/native/spotify-library.ts @@ -0,0 +1,162 @@ +import type { MediaBrowseItem, MediaBrowserApp, MediaBrowserBridge } from "./media-types"; +import { SPOTIFY_APP_NAME, type SpotifyPlayer } from "./spotify-player"; +import type { SpotifyClient, SpotifyItem, SpotifyPlayRequest } from "./spotify-web-api"; + +const ROOT_ROWS: MediaBrowseItem[] = [ + { mediaId: "recent", title: "Recently played", subtitle: "", browsable: true, playable: false }, + { mediaId: "playlists", title: "Playlists", subtitle: "", browsable: true, playable: false }, + { mediaId: "liked", title: "Liked Songs", subtitle: "", browsable: true, playable: true }, + { mediaId: "albums", title: "Albums", subtitle: "", browsable: true, playable: false }, + { mediaId: "artists", title: "Artists", subtitle: "", browsable: true, playable: false }, +]; + +/** Separates a track's URI from the context it plays in ("" for none, "liked" for Liked Songs). */ +const TRACK_CONTEXT_SEPARATOR = "|"; + +export type SpotifyLibraryDeps = { + client: SpotifyClient; + /** Spotify's app id on this platform, which names the library in the browse picker. */ + packageName: string; + player: SpotifyPlayer; + isSignedIn(): boolean; + /** The signed-in user's id (Liked Songs' context URI names it). */ + userId(): string; +}; + +/** + * The signed-in user's Spotify library as a browse tree (Web API): + * + * root -> recent | playlists | liked | albums | artists + * playlist:, album: -> tracks (browsable and playable) + * artist: -> albums + * track:| -> plays the track within its context + * + * Only playlists the user owns or collaborates on can list their tracks + * (development-mode client IDs, since February 2026); others are play-only. + */ +export class SpotifyLibrary implements MediaBrowserBridge { + private connected = false; + /** Bumped on every connect/disconnect; answers to older requests are dropped. */ + private generation = 0; + + /** This library's row in the browse picker. */ + readonly app: MediaBrowserApp; + + constructor(private readonly deps: SpotifyLibraryDeps) { + this.app = { packageName: deps.packageName, serviceClass: "", appName: SPOTIFY_APP_NAME }; + } + + listBrowsableApps(): MediaBrowserApp[] { + return this.deps.isSignedIn() ? [this.app] : []; + } + + connect(app: MediaBrowserApp): Promise { + this.disconnect(); + if (app.packageName !== this.app.packageName) return Promise.reject(new Error("Not a Spotify library")); + if (!this.deps.isSignedIn()) return Promise.reject(new Error("Sign in under Spotify in the Music app menu first.")); + this.connected = true; + return Promise.resolve("root"); + } + + async browse(parentId: string): Promise { + if (!this.connected) throw new Error("Not connected"); + const generation = this.generation; + const rows = await this.list(parentId); + if (generation !== this.generation) throw new Error("Disconnected"); + return rows; + } + + playFromMediaId(mediaId: string): void { + if (!this.connected) return; + const request = this.playRequest(mediaId); + if (request) void this.deps.player.startPlayback(request); + } + + disconnect(): void { + this.connected = false; + this.generation++; + } + + /** What playing a browse row starts; null for rows that don't play. */ + playRequest(mediaId: string): SpotifyPlayRequest | null { + if (mediaId === "liked") return { contextUri: this.likedContextUri() }; + const [kind, ...rest] = mediaId.split(":"); + const id = rest.join(":"); + switch (kind) { + case "playlist": + case "album": + case "artist": + return id ? { contextUri: `spotify:${kind}:${id}` } : null; + case "track": { + const separator = id.lastIndexOf(TRACK_CONTEXT_SEPARATOR); + const uri = separator < 0 ? id : id.slice(0, separator); + const context = separator < 0 ? "" : id.slice(separator + 1); + if (!uri) return null; + if (context === "liked") return { contextUri: this.likedContextUri(), offsetUri: uri }; + return context ? { contextUri: context, offsetUri: uri } : { uris: [uri] }; + } + default: + return null; + } + } + + private async list(parentId: string): Promise { + const client = this.deps.client; + if (parentId === "root") return ROOT_ROWS; + if (parentId === "recent") { + // The history repeats tracks; keep each one's latest play. + const seen = new Set(); + return (await client.recentlyPlayed()) + .filter((played) => !seen.has(played.item.uri) && seen.add(played.item.uri)) + .map((played) => trackRow(played.item, played.contextUri)); + } + if (parentId === "playlists") { + const userId = this.deps.userId(); + return (await client.playlists()).map((playlist) => { + const listable = playlist.collaborative || playlist.ownerId === userId; + return { + mediaId: `playlist:${playlist.id}`, + title: playlist.name, + subtitle: listable ? "" : playlist.ownerName, + browsable: listable, + playable: true, + }; + }); + } + if (parentId === "liked") return (await client.savedTracks()).map((item) => trackRow(item, "liked")); + if (parentId === "albums") return (await client.savedAlbums()).map(albumRow); + if (parentId === "artists") { + return (await client.followedArtists()).map((artist) => ({ + mediaId: `artist:${artist.id}`, + title: artist.name, + subtitle: "", + browsable: true, + playable: true, + })); + } + const [kind, ...rest] = parentId.split(":"); + const id = rest.join(":"); + if (kind === "playlist") return (await client.playlistItems(id)).map((item) => trackRow(item, `spotify:playlist:${id}`)); + if (kind === "album") return (await client.albumTracks(id)).map((item) => trackRow(item, `spotify:album:${id}`)); + if (kind === "artist") return (await client.artistAlbums(id)).map(albumRow); + throw new Error(`Unknown Spotify library item: ${parentId}`); + } + + private likedContextUri(): string { + return `spotify:user:${this.deps.userId()}:collection`; + } +} + +function trackRow(item: SpotifyItem, contextUri: string): MediaBrowseItem { + return { + mediaId: `track:${item.uri}${contextUri ? `${TRACK_CONTEXT_SEPARATOR}${contextUri}` : ""}`, + title: item.name, + subtitle: item.artists, + browsable: false, + playable: true, + }; +} + +function albumRow(album: { id: string; name: string; artists: string }): MediaBrowseItem { + return { mediaId: `album:${album.id}`, title: album.name, subtitle: album.artists, browsable: true, playable: true }; +} diff --git a/app/native/spotify-player.ts b/app/native/spotify-player.ts new file mode 100644 index 00000000..9b281b8b --- /dev/null +++ b/app/native/spotify-player.ts @@ -0,0 +1,574 @@ +import type { GrayImage } from "../graphics/image"; +import { + DEFAULT_MEDIA_STATE, + interpolateMediaState, + type MediaControllerBridge, + type MediaControllerState, + type MediaCustomAction, + type MediaQueueItem, +} from "./media-types"; +import { + SpotifyApiError, + type SpotifyClient, + type SpotifyDevice, + type SpotifyItem, + type SpotifyPlayback, + type SpotifyPlayRequest, + type SpotifyRepeat, +} from "./spotify-web-api"; + +export const SPOTIFY_APP_NAME = "Spotify"; +/** Spotify's iOS bundle id: the player's packageName in the media state on iOS. */ +export const SPOTIFY_IOS_BUNDLE_ID = "com.spotify.client"; +/** Spotify's Android package: its media session's owner, which the Web API player reports too. */ +export const SPOTIFY_ANDROID_PACKAGE = "com.spotify.music"; + +/** + * Poll intervals while something listens. The Web API has no push channel, so + * a track change shows up within one interval (sooner at a track's end, which + * is polled for directly); requests count against the client ID's quota. + */ +const POLL_PLAYING_MS = 5_000; +const POLL_PAUSED_MS = 10_000; +const POLL_IDLE_MS = 20_000; +const POLL_ERROR_MS = 30_000; +/** Re-read soon after a command: Spotify takes a moment to report its effect. */ +const SETTLE_POLL_MS = 600; +const SETTLE_POLLS = 2; +const NOTICE_MS = 8_000; +/** Re-read the queue this often while the Music app shows it, besides on every track change. */ +const QUEUE_MAX_AGE_MS = 30_000; +/** At most this often, even on track changes (and after a failed read). */ +const QUEUE_MIN_INTERVAL_MS = 5_000; +/** Album art: the smallest of Spotify's sizes (640/300/64) at least this wide. */ +const ART_MIN_WIDTH = 128; + +const REPEAT_NEXT: Record = { off: "context", context: "track", track: "off" }; +const REPEAT_LABEL: Record = { off: "Repeat: off", context: "Repeat: all", track: "Repeat: one" }; + +export type SpotifyPlayerDeps = { + client: SpotifyClient; + /** The state's packageName: Spotify's app id on this platform. */ + packageName: string; + isSignedIn(): boolean; + /** Fetch an album-art image's encoded bytes; null on failure. */ + download(url: string): Promise; + /** Encoded image bytes to the shared photo tone, fitted within maxSize; null when undecodable. */ + decodeArt(bytes: Uint8Array, maxSize: number): GrayImage | null; + /** The phone's output volume, for playback on this phone (Spotify won't set a phone's volume). */ + systemVolume: { get(): number; set(percent: number): void }; + now?: () => number; +}; + +/** + * Spotify Connect playback (on this phone or any of the user's devices) + * through the Web API: state from polling GET /me/player while something + * listens, commands as API calls whose failures (no device, no Premium) + * become a short notice in the state. + */ +export class SpotifyPlayer implements MediaControllerBridge { + readonly accessPrompt = "Sign in to Spotify from the Music app menu to show and control Spotify."; + readonly accessLabel = "Spotify sign-in needed"; + readonly accessAction = "open the menu"; + /** Jumping skips forward through the queue, so the chosen track ends up first. */ + readonly skipRebuildsQueue = true; + /** When Spotify was last seen playing (epoch ms); 0 = not this run. */ + lastPlayingAtMs = 0; + + private readonly now: () => number; + private readonly listeners = new Set<(state: MediaControllerState) => void>(); + private playback: SpotifyPlayback | null = null; + private fetchedAtMs = 0; + private pollTimer: ReturnType | null = null; + private polling: Promise | null = null; + private pollAgain = false; + private settlePolls = 0; + private lastSignature = ""; + private notice = ""; + private noticeUntilMs = 0; + private noticeTimer: ReturnType | null = null; + private upcoming: SpotifyItem[] = []; + /** The item the queue was read with; "" = never read. */ + private queueCurrentUri = ""; + /** When the queue was last read, or a read failed. */ + private queueFetchedAtMs = 0; + private queueLoading = false; + private art: { url: string; bytes: Uint8Array | null; decoded: Map } | null = null; + private artVersion = 0; + private liked: { uri: string; value: boolean | null } | null = null; + private volumeTarget: number | null = null; + private volumeSending = false; + + constructor(private readonly deps: SpotifyPlayerDeps) { + this.now = deps.now ?? Date.now; + } + + onStateChange(listener: (state: MediaControllerState) => void): () => void { + this.listeners.add(listener); + listener(this.snapshot()); + if (this.listeners.size === 1) this.schedulePoll(0); + return () => { + this.listeners.delete(listener); + if (!this.listeners.size && !this.settlePolls) this.clearPollTimer(); + }; + } + + snapshot(): MediaControllerState { + const notice = this.currentNotice(); + if (!this.deps.isSignedIn()) { + return { ...DEFAULT_MEDIA_STATE, status: "Not signed in to Spotify.", notice }; + } + const playback = this.playback; + if (!playback) { + return { + ...DEFAULT_MEDIA_STATE, + accessEnabled: true, + packageName: this.deps.packageName, + appName: SPOTIFY_APP_NAME, + status: "Nothing is playing on Spotify.", + notice, + }; + } + const item = playback.item; + const restricted = playback.device?.restricted === true; + const allowed = (action: string) => !restricted && !playback.disallows.includes(action); + const state: MediaControllerState = { + available: true, + accessEnabled: true, + packageName: this.deps.packageName, + appName: spotifyAppName(playback.device), + playbackState: playback.playing ? "playing" : "paused", + title: item?.name ?? (playback.playingType === "ad" ? "Advertisement" : ""), + artist: item?.artists ?? "", + album: item?.album ?? "", + positionMs: item ? playback.progressMs : -1, + durationMs: item?.durationMs ?? -1, + playbackSpeed: playback.playing ? 1 : 0, + status: "", + canPlayPause: allowed(playback.playing ? "pausing" : "resuming"), + canSkipNext: allowed("skipping_next"), + canSkipPrevious: allowed("skipping_prev"), + artVersion: this.artVersion, + customActions: restricted ? [] : this.customActions(playback), + notice, + }; + return interpolateMediaState(state, this.fetchedAtMs, this.now()); + } + + async start(): Promise {} + + async stop(): Promise {} + + async playPause(): Promise { + const playback = this.playback; + if (!playback?.playing) { + await this.startPlayback({}); + return; + } + await this.command(() => this.deps.client.pause(), () => { + playback.progressMs = this.snapshot().positionMs; + playback.playing = false; + this.fetchedAtMs = this.now(); + }); + } + + async skipNext(): Promise { + await this.command(() => this.deps.client.next()); + } + + async skipPrevious(): Promise { + await this.command(() => this.deps.client.previous()); + } + + /** Signed in; whether anything is playing is in the state. */ + hasAccess(): boolean { + return this.deps.isSignedIn(); + } + + /** Sign-in happens from the Music app menu, which shows its progress. */ + async requestAccess(): Promise { + return this.hasAccess(); + } + + /** + * Queue ids are positions in getQueue (0 = the current item). The Web API + * has no jump, so this skips forward that many times. + */ + async skipToQueueItem(id: number): Promise { + const steps = Math.round(id); + if (steps <= 0 || steps > this.upcoming.length) return; + await this.command(async () => { + for (let step = 0; step < steps; step++) await this.deps.client.next(); + }, () => { + const target = this.upcoming[steps - 1]; + if (this.playback && target) { + this.playback.item = target; + this.playback.progressMs = 0; + this.fetchedAtMs = this.now(); + this.upcoming = this.upcoming.slice(steps); + this.queueCurrentUri = target.uri; + this.itemChanged(target); + } + }); + } + + getMediaVolumePercent(): number { + const device = this.playback?.device ?? null; + if (!usesDeviceVolume(device)) return this.deps.systemVolume.get(); + return this.volumeTarget ?? device!.volumePercent; + } + + setMediaVolumePercent(volumePercent: number): void { + const device = this.playback?.device ?? null; + const volume = Math.max(0, Math.min(100, Math.round(volumePercent))); + if (!usesDeviceVolume(device)) { + this.deps.systemVolume.set(volume); + return; + } + // Scrolling sends a value per step: keep one request in flight and send the latest after it. + device!.volumePercent = volume; + this.volumeTarget = volume; + if (!this.volumeSending) void this.sendVolume(device!.id); + } + + getAlbumArt(maxSize: number): GrayImage | null { + const art = this.art; + if (!art?.bytes) return null; + const size = Math.round(maxSize); + if (!art.decoded.has(size)) art.decoded.set(size, this.deps.decodeArt(art.bytes, size)); + return art.decoded.get(size) ?? null; + } + + /** + * The current item, then what Spotify will play next. Read on demand (the + * Music app asks while it paints), so nothing else pays for the request; a + * stale list stays up, minus the items already played, until the new one + * arrives. + */ + getQueue(): MediaQueueItem[] { + const current = this.playback?.item; + if (!current) return []; + const age = this.now() - this.queueFetchedAtMs; + if (!this.queueLoading && (age > QUEUE_MAX_AGE_MS || (this.queueCurrentUri !== current.uri && age > QUEUE_MIN_INTERVAL_MS))) { + void this.loadQueue(); + } + if (!this.queueCurrentUri) return []; + if (this.queueCurrentUri !== current.uri) { + const index = this.upcoming.findIndex((item) => item.uri === current.uri); + if (index >= 0) { + this.upcoming = this.upcoming.slice(index + 1); + this.queueCurrentUri = current.uri; + } + } + return [current, ...this.upcoming].map((item, index) => ({ + id: index, + title: item.name, + subtitle: item.artists, + active: index === 0, + })); + } + + async sendCustomAction(action: string): Promise { + const playback = this.playback; + if (!playback) return; + const client = this.deps.client; + if (action === "shuffle") { + const shuffle = !playback.shuffle; + await this.command(() => client.setShuffle(shuffle), () => { + playback.shuffle = shuffle; + // Shuffling reorders what comes next. + this.queueFetchedAtMs = 0; + }); + } else if (action === "repeat") { + const repeat = REPEAT_NEXT[playback.repeat]; + await this.command(() => client.setRepeat(repeat), () => { + playback.repeat = repeat; + }); + } else if (action === "like") { + const liked = this.liked; + if (!liked || liked.value === null) return; + const value = !liked.value; + await this.command(() => (value ? client.saveToLibrary([liked.uri]) : client.removeFromLibrary([liked.uri])), () => { + if (this.liked === liked) liked.value = value; + }); + } + } + + async refresh(): Promise { + await this.poll(); + } + + /** + * Play something (a browsed item, a search result) or, with an empty + * request, resume. With no active device, starts on one the account has + * open (preferring a phone). Resolves to whether it worked; a failure is + * left as the state's notice. + */ + async startPlayback(request: SpotifyPlayRequest): Promise { + const client = this.deps.client; + const playback = this.playback; + const ok = await this.command(async () => { + try { + await client.play(request); + } catch (error) { + if (!(error instanceof SpotifyApiError) || error.reason !== "NO_ACTIVE_DEVICE") throw error; + const device = pickDevice(await client.devices()); + if (!device) throw error; + await client.play(request, device.id); + } + }, () => { + this.lastPlayingAtMs = this.now(); + if (playback && this.playback === playback && !request.contextUri && !request.uris) { + playback.playing = true; + this.fetchedAtMs = this.now(); + } + }); + return ok; + } + + /** The account changed (signed in, out, or as someone else): forget the old account's state. */ + accountChanged(): void { + this.playback = null; + this.upcoming = []; + this.queueCurrentUri = ""; + this.art = null; + this.artVersion++; + this.liked = null; + this.lastPlayingAtMs = 0; + this.emit(true); + if (this.listeners.size) this.schedulePoll(0); + } + + /** Show a message about a failed command in the state's notice for a few seconds. */ + showNotice(message: string): void { + this.notice = message; + this.noticeUntilMs = this.now() + NOTICE_MS; + if (this.noticeTimer !== null) clearTimeout(this.noticeTimer); + this.noticeTimer = setTimeout(() => { + this.noticeTimer = null; + this.emit(true); + }, NOTICE_MS + 50); + this.emit(true); + } + + private currentNotice(): string { + return this.notice && this.now() < this.noticeUntilMs ? this.notice : ""; + } + + private customActions(playback: SpotifyPlayback): MediaCustomAction[] { + if (!playback.item) return []; + const actions: MediaCustomAction[] = []; + if (!playback.disallows.includes("toggling_shuffle")) { + actions.push({ action: "shuffle", name: playback.shuffle ? "Shuffle: on" : "Shuffle: off" }); + } + if (!playback.disallows.includes("toggling_repeat_context") || !playback.disallows.includes("toggling_repeat_track")) { + actions.push({ action: "repeat", name: REPEAT_LABEL[playback.repeat] }); + } + const liked = this.liked; + if (playback.item.type === "track" && liked?.uri === playback.item.uri && liked.value !== null) { + actions.push({ action: "like", name: liked.value ? "Unlike song" : "Like song" }); + } + return actions; + } + + /** Run a command; on success apply its expected effect at once, then re-read to confirm. */ + private async command(run: () => Promise, applied?: () => void): Promise { + let ok = false; + try { + await run(); + ok = true; + applied?.(); + this.emit(true); + } catch (error) { + this.showNotice(errorMessage(error)); + } + this.settlePolls = SETTLE_POLLS; + this.schedulePoll(SETTLE_POLL_MS); + return ok; + } + + private async sendVolume(deviceId: string): Promise { + this.volumeSending = true; + try { + while (this.volumeTarget !== null) { + const volume = this.volumeTarget; + try { + await this.deps.client.setVolume(volume, deviceId); + } catch (error) { + this.showNotice(errorMessage(error)); + } + if (this.volumeTarget === volume) this.volumeTarget = null; + } + } finally { + this.volumeSending = false; + } + } + + private poll(): Promise { + if (this.polling) { + this.pollAgain = true; + return this.polling; + } + this.polling = this.pollOnce().finally(() => { + this.polling = null; + if (this.pollAgain) { + this.pollAgain = false; + void this.poll(); + } + }); + return this.polling; + } + + private async pollOnce(): Promise { + this.clearPollTimer(); + if (!this.deps.isSignedIn()) { + if (this.playback) { + this.playback = null; + this.emit(true); + } + return; + } + let delay: number; + try { + const playback = await this.deps.client.playback(); + this.fetchedAtMs = this.now(); + this.applyPlayback(playback); + delay = this.nextPollDelay(playback); + } catch (error) { + if (!(error instanceof SpotifyApiError) || error.reason !== "signed_out") { + console.warn(`[spotify] playback read failed: ${error}`); + } + // Revoked access signs out (SpotifySession); the account listener resets the state. + delay = POLL_ERROR_MS; + } + if (this.settlePolls > 0) { + this.settlePolls--; + delay = Math.min(delay, 1_500); + } + this.emit(false); + this.schedulePoll(delay); + } + + private applyPlayback(playback: SpotifyPlayback | null): void { + const previousUri = this.playback?.item?.uri ?? ""; + this.playback = playback; + if (playback?.playing) this.lastPlayingAtMs = this.now(); + const item = playback?.item ?? null; + if ((item?.uri ?? "") !== previousUri) this.itemChanged(item); + } + + /** A new item: fetch its art and whether it is liked. */ + private itemChanged(item: SpotifyItem | null): void { + const url = item ? pickArtUrl(item) : ""; + if (url !== (this.art?.url ?? "")) { + this.artVersion++; + this.art = url ? { url, bytes: null, decoded: new Map() } : null; + if (url) void this.loadArt(url); + } + this.liked = item?.type === "track" ? { uri: item.uri, value: null } : null; + if (item?.type === "track") void this.loadLiked(item.uri); + } + + private async loadArt(url: string): Promise { + let bytes: Uint8Array | null = null; + try { + bytes = await this.deps.download(url); + } catch (error) { + console.warn(`[spotify] album art download failed: ${error}`); + } + if (!bytes?.length || this.art?.url !== url) return; + this.art.bytes = bytes; + this.artVersion++; + this.emit(true); + } + + private async loadLiked(uri: string): Promise { + try { + const [value] = await this.deps.client.libraryContains([uri]); + if (this.liked?.uri !== uri) return; + this.liked.value = Boolean(value); + this.emit(true); + } catch (error) { + console.warn(`[spotify] library check failed: ${error}`); + } + } + + private async loadQueue(): Promise { + this.queueLoading = true; + try { + const queue = await this.deps.client.queue(); + this.upcoming = queue.upcoming; + this.queueCurrentUri = queue.current?.uri ?? ""; + this.queueFetchedAtMs = this.now(); + this.emit(true); + } catch (error) { + console.warn(`[spotify] queue read failed: ${error}`); + this.queueFetchedAtMs = this.now(); + } finally { + this.queueLoading = false; + } + } + + private nextPollDelay(playback: SpotifyPlayback | null): number { + if (!playback) return POLL_IDLE_MS; + if (!playback.playing) return POLL_PAUSED_MS; + const durationMs = playback.item?.durationMs ?? -1; + // Catch the change to the next track as it happens. + const remaining = durationMs > 0 ? durationMs - playback.progressMs + 700 : POLL_PLAYING_MS; + return Math.max(1_000, Math.min(POLL_PLAYING_MS, remaining)); + } + + private schedulePoll(delayMs: number): void { + if (!this.listeners.size && !this.settlePolls) return; + this.clearPollTimer(); + this.pollTimer = setTimeout(() => { + this.pollTimer = null; + void this.poll(); + }, delayMs); + } + + private clearPollTimer(): void { + if (this.pollTimer !== null) clearTimeout(this.pollTimer); + this.pollTimer = null; + } + + /** Tell listeners; unforced, only when something they draw (other than the advancing position) changed. */ + private emit(force: boolean): void { + if (!this.listeners.size) return; + const state = this.snapshot(); + const signature = JSON.stringify({ ...state, positionMs: 0 }); + if (!force && signature === this.lastSignature) return; + this.lastSignature = signature; + for (const listener of this.listeners) listener(state); + } +} + +/** "Spotify", or "Spotify · " when it plays elsewhere than a phone. */ +export function spotifyAppName(device: SpotifyDevice | null): string { + if (!device?.name || device.type === "Smartphone") return SPOTIFY_APP_NAME; + return `${SPOTIFY_APP_NAME} · ${device.name}`; +} + +/** Spotify sets a speaker's or computer's volume; a phone's (this one) goes through the system volume. */ +function usesDeviceVolume(device: SpotifyDevice | null): boolean { + return Boolean(device && device.type !== "Smartphone" && device.supportsVolume && device.volumePercent >= 0 && device.id); +} + +/** A device to start playback on when none is active: an open one, a phone first. */ +export function pickDevice(devices: SpotifyDevice[]): SpotifyDevice | null { + const usable = devices.filter((device) => device.id && !device.restricted); + return usable.find((device) => device.active) + ?? usable.find((device) => device.type === "Smartphone") + ?? usable[0] + ?? null; +} + +function pickArtUrl(item: SpotifyItem): string { + const images = [...item.images].sort((a, b) => a.width - b.width); + return (images.find((image) => image.width >= ART_MIN_WIDTH) ?? images[images.length - 1])?.url ?? ""; +} + +export function errorMessage(error: unknown): string { + if (error instanceof Error) return error.message; + return String(error); +} diff --git a/app/native/spotify-service.ts b/app/native/spotify-service.ts new file mode 100644 index 00000000..53683e98 --- /dev/null +++ b/app/native/spotify-service.ts @@ -0,0 +1,163 @@ +import type { GrayImage } from "../graphics/image"; +import { onSettingsStoreChanged } from "./settings-store"; +import { + readSpotifyAccount, + saveSpotifyAccount, + signInToSpotify, + SPOTIFY_ACCOUNT_KEY, + SPOTIFY_CLIENT_ID_KEY, + SpotifySession, + type SpotifyAccount, + type WebSignIn, +} from "./spotify-auth"; +import { SpotifyLibrary } from "./spotify-library"; +import { errorMessage, SpotifyPlayer } from "./spotify-player"; +import { SpotifyClient, type SpotifyFetch, type SpotifySearchType } from "./spotify-web-api"; + +/** Give up on a sign-in nobody finished on the phone. */ +const SIGN_IN_TIMEOUT_MS = 10 * 60_000; + +/** What the platform supplies (spotify.ios.ts, spotify.ts). */ +export type SpotifyPlatform = { + /** Spotify's app id on this platform (SPOTIFY_IOS_BUNDLE_ID / SPOTIFY_ANDROID_PACKAGE). */ + packageName: string; + fetch: SpotifyFetch; + webSignIn: WebSignIn; + download(url: string): Promise; + decodeArt(bytes: Uint8Array, maxSize: number): GrayImage | null; + systemVolume: { get(): number; set(percent: number): void }; +}; + +export type SpotifySignInState = + | { phase: "idle"; error: string } + /** The sign-in sheet is open on the phone, or waiting for Faceclaw to come to the foreground. */ + | { phase: "waiting"; error: "" }; + +/** + * Spotify for the Music app, the media bridges and the assistant: the + * account and its sign-in, the Web API client, the player and the library. + */ +export class SpotifyService { + readonly client: SpotifyClient; + readonly player: SpotifyPlayer; + readonly library: SpotifyLibrary; + private signInState: SpotifySignInState = { phase: "idle", error: "" }; + private readonly listeners = new Set<() => void>(); + private accountKey: string; + + constructor(private readonly platform: SpotifyPlatform) { + const isSignedIn = () => readSpotifyAccount() !== null; + this.client = new SpotifyClient(platform.fetch, new SpotifySession(platform.fetch)); + this.player = new SpotifyPlayer({ + client: this.client, + packageName: platform.packageName, + isSignedIn, + download: (url) => platform.download(url), + decodeArt: (bytes, maxSize) => platform.decodeArt(bytes, maxSize), + systemVolume: platform.systemVolume, + }); + this.library = new SpotifyLibrary({ + client: this.client, + packageName: platform.packageName, + player: this.player, + isSignedIn, + userId: () => readSpotifyAccount()?.userId ?? "", + }); + this.accountKey = accountIdentity(readSpotifyAccount()); + onSettingsStoreChanged((key) => { + if (key !== SPOTIFY_ACCOUNT_KEY && key !== SPOTIFY_CLIENT_ID_KEY) return; + // Token refreshes rewrite the account too; only a different sign-in resets the player. + const identity = accountIdentity(readSpotifyAccount()); + if (identity !== this.accountKey) { + this.accountKey = identity; + this.player.accountChanged(); + } + this.emit(); + }); + } + + account(): SpotifyAccount | null { + return readSpotifyAccount(); + } + + signInStatus(): SpotifySignInState { + return this.signInState; + } + + /** Repaint hook for the sign-in menu: account or sign-in progress changed. */ + onChange(listener: () => void): () => void { + this.listeners.add(listener); + return () => this.listeners.delete(listener); + } + + /** + * Open Spotify's sign-in page on the phone (it waits for Faceclaw to be in + * the foreground); the outcome lands in signInStatus(). + */ + async signIn(): Promise { + if (this.signInState.phase === "waiting") return; + this.signInState = { phase: "waiting", error: "" }; + this.emit(); + const timer = setTimeout(() => this.platform.webSignIn.cancel(), SIGN_IN_TIMEOUT_MS); + try { + await signInToSpotify(this.platform.fetch, this.platform.webSignIn); + this.signInState = { phase: "idle", error: "" }; + } catch (error) { + const message = errorMessage(error); + this.signInState = { phase: "idle", error: message === "cancelled" ? "" : message }; + } finally { + clearTimeout(timer); + this.emit(); + } + } + + cancelSignIn(): void { + this.platform.webSignIn.cancel(); + } + + signOut(): void { + saveSpotifyAccount(null); + this.signInState = { phase: "idle", error: "" }; + this.emit(); + } + + /** + * Search Spotify and play the best match: a track, or the album, artist or + * playlist when the request names that kind. Resolves to what started, or + * rejects with why not. + */ + async playSearch(query: string, kind: SpotifySearchType = "track"): Promise { + if (!readSpotifyAccount()) throw new Error("Not signed in to Spotify. Sign in under Spotify in the Music app menu on the glasses."); + const results = await this.client.search(query, [kind], 3); + let request: { contextUri?: string; uris?: string[] } | null = null; + let description = ""; + if (kind === "track" && results.tracks[0]) { + const track = results.tracks[0]; + request = { uris: [track.uri] }; + description = `${track.name}${track.artists ? ` by ${track.artists}` : ""}`; + } else if (kind === "album" && results.albums[0]) { + const album = results.albums[0]; + request = { contextUri: album.uri }; + description = `the album ${album.name}${album.artists ? ` by ${album.artists}` : ""}`; + } else if (kind === "artist" && results.artists[0]) { + request = { contextUri: results.artists[0].uri }; + description = results.artists[0].name; + } else if (kind === "playlist" && results.playlists[0]) { + request = { contextUri: results.playlists[0].uri }; + description = `the playlist ${results.playlists[0].name}`; + } + if (!request) throw new Error(`Spotify found no ${kind} matching "${query}".`); + if (!(await this.player.startPlayback(request))) { + throw new Error(this.player.snapshot().notice || "Spotify didn't start playback."); + } + return description; + } + + private emit(): void { + for (const listener of this.listeners) listener(); + } +} + +function accountIdentity(account: SpotifyAccount | null): string { + return account ? `${account.clientId}/${account.userId}` : ""; +} diff --git a/app/native/spotify-web-api.ts b/app/native/spotify-web-api.ts new file mode 100644 index 00000000..82697c19 --- /dev/null +++ b/app/native/spotify-web-api.ts @@ -0,0 +1,474 @@ +/** + * Spotify Web API over HTTPS with the signed-in user's token: the player + * (what is playing on any of the user's Spotify Connect devices, and control + * of it), the user's library, and search, normalized into the small shapes + * the Music app uses. No NativeScript imports, so the Node tests drive it with + * a fake fetch. + * + * Every personal client ID is a development-mode app, which since February + * 2026 means: the client ID's owner needs Premium, playback control needs + * Premium, at most five allowlisted users, only owned or collaborative + * playlists list their items, no batch lookups, and search and artist albums + * return at most 10 results per page. + */ + +export const SPOTIFY_API_BASE = "https://api.spotify.com/v1"; + +const HTTP_TIMEOUT_MS = 12_000; +/** The most a library listing gathers (a page is 50); enough to scroll through on the glasses. */ +const MAX_LIST_ITEMS = 500; + +/** The subset of fetch this client needs (fetchTextWithUserAgent in the app). */ +export type SpotifyFetch = ( + url: string, + init: { method: string; headers: Record; body?: string }, +) => Promise<{ status: number; text(): Promise }>; + +/** Hands out a current access token, refreshing it when expired or when forced (after a 401). */ +export type SpotifyTokenSource = { + accessToken(forceRefresh: boolean): Promise; +}; + +/** A failed request; `reason` is Spotify's player error code (NO_ACTIVE_DEVICE, PREMIUM_REQUIRED, ...). */ +export class SpotifyApiError extends Error { + constructor( + message: string, + readonly status: number, + readonly reason = "", + ) { + super(message); + this.name = "SpotifyApiError"; + } +} + +export type SpotifyImage = { url: string; width: number; height: number }; + +export type SpotifyItem = { + uri: string; + type: "track" | "episode"; + name: string; + /** Track artists, comma-joined; for an episode, its show. */ + artists: string; + /** The track's album; for an episode, its show. "" when the API leaves it out (album track listings). */ + album: string; + durationMs: number; + images: SpotifyImage[]; +}; + +export type SpotifyDevice = { + id: string; + name: string; + /** "Smartphone", "Computer", "Speaker", ... */ + type: string; + active: boolean; + /** Restricted devices accept no Web API commands. */ + restricted: boolean; + /** -1 when the device reports none. */ + volumePercent: number; + supportsVolume: boolean; +}; + +export type SpotifyRepeat = "off" | "context" | "track"; + +export type SpotifyPlayback = { + device: SpotifyDevice | null; + playing: boolean; + progressMs: number; + shuffle: boolean; + repeat: SpotifyRepeat; + /** The playlist / album / artist playing from; "" for none (a queue of single tracks). */ + contextUri: string; + /** null during an ad, between items, or for content the API does not describe. */ + item: SpotifyItem | null; + /** "track", "episode", "ad" or "unknown". */ + playingType: string; + /** The player actions the context forbids, as Spotify names them: pausing, resuming, skipping_next, ... */ + disallows: string[]; +}; + +export type SpotifyQueue = { current: SpotifyItem | null; upcoming: SpotifyItem[] }; + +export type SpotifyUser = { id: string; displayName: string; product: string }; + +export type SpotifyPlaylist = { + id: string; + uri: string; + name: string; + ownerId: string; + ownerName: string; + collaborative: boolean; + total: number; +}; + +export type SpotifyAlbum = { id: string; uri: string; name: string; artists: string }; + +export type SpotifyArtist = { id: string; uri: string; name: string }; + +/** A played track and the context it played from ("" when none). */ +export type SpotifyPlayed = { item: SpotifyItem; contextUri: string }; + +export type SpotifySearchResults = { + tracks: SpotifyItem[]; + albums: SpotifyAlbum[]; + artists: SpotifyArtist[]; + playlists: SpotifyPlaylist[]; +}; + +export type SpotifySearchType = "track" | "album" | "artist" | "playlist"; + +/** + * What to play: a context (playlist, album, artist, show) optionally starting + * at one of its items, or a list of track URIs. Empty resumes the current + * playback. + */ +export type SpotifyPlayRequest = { + contextUri?: string; + uris?: string[]; + offsetUri?: string; + offsetPosition?: number; +}; + +type Query = Record; + +export class SpotifyClient { + constructor( + private readonly fetchImpl: SpotifyFetch, + private readonly tokens: SpotifyTokenSource, + ) {} + + /** The current playback on whichever device is active; null when nothing is. */ + async playback(): Promise { + const raw = await this.request("GET", "/me/player", { query: { additional_types: "episode" } }); + return raw ? parsePlayback(raw) : null; + } + + async queue(): Promise { + const raw = await this.request("GET", "/me/player/queue"); + return { + current: parseItem(raw?.currently_playing), + upcoming: asArray(raw?.queue).map(parseItem).filter(isPresent), + }; + } + + async devices(): Promise { + const raw = await this.request("GET", "/me/player/devices"); + return asArray(raw?.devices).map(parseDevice).filter(isPresent); + } + + async play(request: SpotifyPlayRequest = {}, deviceId = ""): Promise { + const body: Record = {}; + if (request.contextUri) body.context_uri = request.contextUri; + if (request.uris?.length) body.uris = request.uris; + if (request.offsetUri) body.offset = { uri: request.offsetUri }; + else if (request.offsetPosition !== undefined) body.offset = { position: request.offsetPosition }; + await this.request("PUT", "/me/player/play", { query: { device_id: deviceId || undefined }, body }); + } + + async pause(): Promise { + await this.request("PUT", "/me/player/pause"); + } + + async next(): Promise { + await this.request("POST", "/me/player/next"); + } + + async previous(): Promise { + await this.request("POST", "/me/player/previous"); + } + + async setShuffle(on: boolean): Promise { + await this.request("PUT", "/me/player/shuffle", { query: { state: on } }); + } + + async setRepeat(mode: SpotifyRepeat): Promise { + await this.request("PUT", "/me/player/repeat", { query: { state: mode } }); + } + + async setVolume(percent: number, deviceId = ""): Promise { + const volume = Math.max(0, Math.min(100, Math.round(percent))); + await this.request("PUT", "/me/player/volume", { query: { volume_percent: volume, device_id: deviceId || undefined } }); + } + + /** Move playback to a device (one that shows in devices() but is not active), optionally playing. */ + async transfer(deviceId: string, play: boolean): Promise { + await this.request("PUT", "/me/player", { body: { device_ids: [deviceId], play } }); + } + + async me(): Promise { + const raw = await this.request("GET", "/me"); + return { id: str(raw?.id), displayName: str(raw?.display_name) || str(raw?.id), product: str(raw?.product) }; + } + + /** Whether each URI is in the user's library (Liked Songs for tracks). */ + async libraryContains(uris: string[]): Promise { + const raw = await this.request("GET", "/me/library/contains", { query: { uris: uris.join(",") } }); + return asArray(raw).map(Boolean); + } + + async saveToLibrary(uris: string[]): Promise { + await this.request("PUT", "/me/library", { query: { uris: uris.join(",") } }); + } + + async removeFromLibrary(uris: string[]): Promise { + await this.request("DELETE", "/me/library", { query: { uris: uris.join(",") } }); + } + + playlists(): Promise { + return this.collect("/me/playlists", { limit: 50 }, (raw) => asArray(raw?.items).map(parsePlaylist)); + } + + /** Only playlists the user owns or collaborates on list their items (403 otherwise). */ + playlistItems(playlistId: string): Promise { + return this.collect(`/playlists/${encodeURIComponent(playlistId)}/items`, { limit: 50, additional_types: "track,episode" }, + (raw) => asArray(raw?.items).map((entry: any) => parseItem(entry?.item ?? entry?.track))); + } + + savedTracks(): Promise { + return this.collect("/me/tracks", { limit: 50 }, (raw) => asArray(raw?.items).map((entry: any) => parseItem(entry?.track))); + } + + savedAlbums(): Promise { + return this.collect("/me/albums", { limit: 50 }, (raw) => asArray(raw?.items).map((entry: any) => parseAlbum(entry?.album))); + } + + albumTracks(albumId: string): Promise { + return this.collect(`/albums/${encodeURIComponent(albumId)}/tracks`, { limit: 50 }, (raw) => asArray(raw?.items).map(parseItem)); + } + + followedArtists(): Promise { + // Cursor-paged, with the page wrapped in an "artists" object. + return this.collect("/me/following", { type: "artist", limit: 50 }, (raw) => asArray(raw?.artists?.items).map(parseArtist), + (raw) => str(raw?.artists?.next)); + } + + artistAlbums(artistId: string): Promise { + return this.collect(`/artists/${encodeURIComponent(artistId)}/albums`, { include_groups: "album,single,compilation", limit: 10 }, + (raw) => asArray(raw?.items).map(parseAlbum), undefined, 100); + } + + /** Recently played tracks, newest first (one page: the API keeps only the last 50). */ + async recentlyPlayed(): Promise { + const raw = await this.request("GET", "/me/player/recently-played", { query: { limit: 50 } }); + return asArray(raw?.items) + .map((entry: any) => { + const item = parseItem(entry?.track); + return item ? { item, contextUri: str(entry?.context?.uri) } : null; + }) + .filter(isPresent); + } + + async search(query: string, types: SpotifySearchType[], limit = 5): Promise { + const raw = await this.request("GET", "/search", { + query: { q: query, type: types.join(","), limit: Math.max(1, Math.min(10, Math.round(limit))) }, + }); + return { + tracks: asArray(raw?.tracks?.items).map(parseItem).filter(isPresent), + albums: asArray(raw?.albums?.items).map(parseAlbum).filter(isPresent), + artists: asArray(raw?.artists?.items).map(parseArtist).filter(isPresent), + // Search results include nulls for playlists the API can no longer return. + playlists: asArray(raw?.playlists?.items).map(parsePlaylist).filter(isPresent), + }; + } + + /** Gather a paged listing by following its `next` links, up to maxItems. */ + private async collect( + path: string, + query: Query, + parse: (raw: any) => Array, + nextOf: (raw: any) => string = (raw) => str(raw?.next), + maxItems = MAX_LIST_ITEMS, + ): Promise { + const items: T[] = []; + let raw = await this.request("GET", path, { query }); + for (;;) { + for (const item of parse(raw)) if (item) items.push(item); + const next = nextOf(raw); + if (!next || items.length >= maxItems) return items.slice(0, maxItems); + raw = await this.request("GET", next); + } + } + + /** + * One API call. `path` is relative to the API base, or an absolute `next` + * link from a page. Resolves to the parsed JSON body (null when empty); + * a 401 refreshes the token and retries once. + */ + private async request(method: string, path: string, options: { query?: Query; body?: unknown } = {}): Promise { + const url = path.startsWith("https://") ? path : `${SPOTIFY_API_BASE}${path}${buildQuery(options.query)}`; + const headers: Record = { Accept: "application/json" }; + if (options.body !== undefined) headers["Content-Type"] = "application/json"; + // A command without a body still sends an empty one: Spotify answers a + // PUT or POST with no Content-Length with 411. + const body = options.body !== undefined ? JSON.stringify(options.body) : method === "GET" ? undefined : ""; + for (let attempt = 0; ; attempt++) { + const authorization = `Bearer ${await this.tokens.accessToken(attempt > 0)}`; + const response = await withTimeout(this.fetchImpl(url, { method, headers: { ...headers, Authorization: authorization }, body })); + const text = await withTimeout(response.text()); + if (response.status === 401 && attempt === 0) continue; + if (response.status >= 200 && response.status < 300) { + if (!text.trim()) return null; + try { + return JSON.parse(text); + } catch { + // Commands answer 200 with a snapshot id or plain text; nothing to read. + return null; + } + } + throw apiError(response.status, text); + } + } +} + +/** Form / query encoding (not URLSearchParams, which the NativeScript runtime mishandles). */ +export function buildQuery(query: Query | undefined): string { + if (!query) return ""; + const parts = Object.keys(query) + .filter((key) => query[key] !== undefined && query[key] !== "") + .map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(String(query[key]))}`); + return parts.length ? `?${parts.join("&")}` : ""; +} + +async function withTimeout(promise: Promise): Promise { + let timer: ReturnType | null = null; + const timeout = new Promise((_resolve, reject) => { + timer = setTimeout(() => reject(new SpotifyApiError("Spotify didn't answer. Check the phone's connection.", 0)), HTTP_TIMEOUT_MS); + }); + try { + return await Promise.race([promise, timeout]); + } catch (error) { + if (error instanceof SpotifyApiError) throw error; + throw new SpotifyApiError(`Can't reach Spotify: ${(error as Error)?.message ?? error}`, 0); + } finally { + if (timer) clearTimeout(timer); + } +} + +/** A message for the glasses from Spotify's error body ({error: {status, message, reason}}). */ +function apiError(status: number, body: string): SpotifyApiError { + let message = ""; + let reason = ""; + try { + const parsed = JSON.parse(body); + message = str(parsed?.error?.message ?? parsed?.error_description); + reason = str(parsed?.error?.reason); + } catch { + // Not JSON (a gateway error page). + } + switch (reason) { + case "NO_ACTIVE_DEVICE": + return new SpotifyApiError("Spotify isn't open on any device. Open Spotify on your phone, then try again.", status, reason); + case "PREMIUM_REQUIRED": + return new SpotifyApiError("Controlling Spotify playback needs Spotify Premium.", status, reason); + } + if (status === 401) return new SpotifyApiError("Spotify no longer accepts this sign-in. Sign in again from the Music app menu.", status, reason); + if (status === 403 && /registered|developer dashboard/i.test(message)) { + return new SpotifyApiError("This Spotify account isn't on the client ID's user list (Developer Dashboard > User Management).", status, reason); + } + if (status === 429) return new SpotifyApiError("Spotify is limiting requests; try again in a minute.", status, reason); + return new SpotifyApiError(message ? `Spotify: ${message}` : `Spotify error (HTTP ${status}).`, status, reason); +} + +export function parsePlayback(raw: any): SpotifyPlayback { + const repeat = str(raw?.repeat_state); + const disallows = raw?.actions?.disallows; + return { + device: parseDevice(raw?.device), + playing: raw?.is_playing === true, + progressMs: num(raw?.progress_ms, 0), + shuffle: raw?.shuffle_state === true, + repeat: repeat === "context" || repeat === "track" ? repeat : "off", + contextUri: str(raw?.context?.uri), + item: parseItem(raw?.item), + playingType: str(raw?.currently_playing_type) || "unknown", + disallows: disallows && typeof disallows === "object" ? Object.keys(disallows).filter((key) => disallows[key] === true) : [], + }; +} + +export function parseItem(raw: any): SpotifyItem | null { + if (!raw || typeof raw !== "object" || typeof raw.uri !== "string" || !raw.uri) return null; + if (raw.type === "episode") { + const show = str(raw.show?.name); + return { + uri: raw.uri, + type: "episode", + name: str(raw.name), + artists: show || str(raw.show?.publisher), + album: show, + durationMs: num(raw.duration_ms, -1), + images: parseImages(raw.images?.length ? raw.images : raw.show?.images), + }; + } + return { + uri: raw.uri, + type: "track", + name: str(raw.name), + artists: joinNames(raw.artists), + album: str(raw.album?.name), + durationMs: num(raw.duration_ms, -1), + images: parseImages(raw.album?.images), + }; +} + +export function parseDevice(raw: any): SpotifyDevice | null { + if (!raw || typeof raw !== "object") return null; + const volume = raw.volume_percent; + return { + id: str(raw.id), + name: str(raw.name), + type: str(raw.type), + active: raw.is_active === true, + restricted: raw.is_restricted === true, + volumePercent: typeof volume === "number" && Number.isFinite(volume) ? volume : -1, + supportsVolume: raw.supports_volume === true, + }; +} + +function parsePlaylist(raw: any): SpotifyPlaylist | null { + if (!raw || typeof raw !== "object" || !raw.id) return null; + return { + id: str(raw.id), + uri: str(raw.uri) || `spotify:playlist:${raw.id}`, + name: str(raw.name), + ownerId: str(raw.owner?.id), + ownerName: str(raw.owner?.display_name) || str(raw.owner?.id), + collaborative: raw.collaborative === true, + // `items` replaced the deprecated `tracks` summary in 2026. + total: num(raw.items?.total ?? raw.tracks?.total, -1), + }; +} + +function parseAlbum(raw: any): SpotifyAlbum | null { + if (!raw || typeof raw !== "object" || !raw.id) return null; + return { id: str(raw.id), uri: str(raw.uri) || `spotify:album:${raw.id}`, name: str(raw.name), artists: joinNames(raw.artists) }; +} + +function parseArtist(raw: any): SpotifyArtist | null { + if (!raw || typeof raw !== "object" || !raw.id) return null; + return { id: str(raw.id), uri: str(raw.uri) || `spotify:artist:${raw.id}`, name: str(raw.name) }; +} + +function parseImages(raw: any): SpotifyImage[] { + return asArray(raw) + .filter((image: any) => image && typeof image.url === "string" && image.url) + .map((image: any) => ({ url: image.url, width: num(image.width, 0), height: num(image.height, 0) })); +} + +function joinNames(raw: any): string { + return asArray(raw).map((entry: any) => str(entry?.name)).filter(Boolean).join(", "); +} + +function asArray(value: unknown): any[] { + return Array.isArray(value) ? value : []; +} + +function str(value: unknown): string { + return typeof value === "string" ? value : ""; +} + +function num(value: unknown, fallback: number): number { + return typeof value === "number" && Number.isFinite(value) ? value : fallback; +} + +function isPresent(value: T | null | undefined): value is T { + return value !== null && value !== undefined; +} diff --git a/app/native/spotify.ios.ts b/app/native/spotify.ios.ts new file mode 100644 index 00000000..c6e6e07d --- /dev/null +++ b/app/native/spotify.ios.ts @@ -0,0 +1,65 @@ +import { fetchTextWithUserAgent } from "../util/http"; +import { downloadBinary } from "./binary-http.ios"; +import { grayImageFromPacket, PHOTO_TONE } from "./image-files"; +import { fromData, toData } from "./kotlin-data"; +import type { WebSignIn } from "./spotify-auth"; +import { SPOTIFY_IOS_BUNDLE_ID } from "./spotify-player"; +import { SpotifyService } from "./spotify-service"; + +declare const FaceclawAppleMusic: any; +declare const FaceclawCrypto: any; +declare const FaceclawGraphics: any; +declare const FaceclawKitIosProtocol: any; +declare const FaceclawWebSignIn: any; + +const ART_DOWNLOAD_TIMEOUT_MS = 10_000; + +/** Sign-in in the system browser sheet, which FaceclawWebSignIn closes once the loopback redirect arrives. */ +const webSignIn: WebSignIn = { + createPkce: () => { + // 64 URL-safe characters (RFC 7636 allows 43..128). + const verifier = String(FaceclawCrypto.randomBase64Url(48)); + return { verifier, challenge: String(FaceclawCrypto.sha256Base64Url(verifier)) }; + }, + randomState: () => String(FaceclawCrypto.randomBase64Url(16)), + open: (authorizeUrl, port, path) => + new Promise((resolve, reject) => { + FaceclawWebSignIn.shared().signInPortPathCompletion(authorizeUrl, port, path, (redirectUrl: string | null, error: string | null) => { + if (redirectUrl) resolve(String(redirectUrl)); + else reject(new Error(String(error || "Sign-in failed"))); + }); + }), + cancel: () => FaceclawWebSignIn.shared().cancel(), +}; + +let protocol: any = null; +let service: SpotifyService | null = null; + +/** The Spotify service, created on first use (main thread only: it owns timers and the sign-in sheet). */ +export function spotifyService(): SpotifyService | null { + service ??= new SpotifyService({ + packageName: SPOTIFY_IOS_BUNDLE_ID, + fetch: (url, init) => fetchTextWithUserAgent(url, init), + webSignIn, + download: async (url) => { + const response = await downloadBinary(url, ART_DOWNLOAD_TIMEOUT_MS); + return response.status === 200 ? response.bytes : null; + }, + decodeArt: (bytes, maxSize) => { + const packet = FaceclawGraphics.bgraPacketFromImageDataMaxSize(toData(bytes), Math.round(maxSize)); + if (!packet) return null; + // The shared Kotlin tone curve and dither, as for Apple Music's art. + protocol ??= FaceclawKitIosProtocol.new(); + return grayImageFromPacket(fromData(protocol.grayPacketBgraGammaDither(packet, PHOTO_TONE.gamma, PHOTO_TONE.dither))); + }, + // FaceclawAppleMusic's system output volume needs no media-library access. + systemVolume: { + get: () => { + const volume = Number(FaceclawAppleMusic.shared().volumePercent()); + return Number.isFinite(volume) ? Math.max(-1, Math.min(100, Math.round(volume))) : -1; + }, + set: (percent) => FaceclawAppleMusic.shared().setVolumePercent(Math.max(0, Math.min(100, Math.round(percent)))), + }, + }); + return service; +} diff --git a/app/native/spotify.ts b/app/native/spotify.ts new file mode 100644 index 00000000..0d33181e --- /dev/null +++ b/app/native/spotify.ts @@ -0,0 +1,124 @@ +import { Application, Utils } from "@nativescript/core"; +import { fetchTextWithUserAgent } from "../util/http"; +import { downloadBinary } from "./binary-http"; +import { grayImageFromPacket, PHOTO_TONE } from "./image-files"; +import { copyToJavaByteBuffer } from "./java-direct-buffer"; +import type { WebSignIn } from "./spotify-auth"; +import { SPOTIFY_ANDROID_PACKAGE } from "./spotify-player"; +import { SpotifyService } from "./spotify-service"; + +declare const android: any; +declare const com: any; + +const ART_DOWNLOAD_TIMEOUT_MS = 10_000; + +/** The sign-in's listener proxy, held while Java may still call it. */ +let signInListener: unknown = null; + +/** Faceclaw's activity is in front, so it may open the browser (Android blocks background activity starts). */ +function foregroundActivity(): any { + return Application.suspended ? null : Application.android?.foregroundActivity ?? null; +} + +/** + * Sign-in in the phone's browser, with FaceclawWebSignIn catching the + * loopback redirect. A sign-in started from the glasses while Faceclaw is in + * the background opens the page when Faceclaw next comes to the front, as on + * iOS. + */ +const webSignIn: WebSignIn = { + createPkce: () => { + // 64 URL-safe characters (RFC 7636 allows 43..128). + const verifier = String(com.faceclaw.app.FaceclawWebSignIn.randomBase64Url(48)); + return { verifier, challenge: String(com.faceclaw.app.FaceclawWebSignIn.sha256Base64Url(verifier)) }; + }, + randomState: () => String(com.faceclaw.app.FaceclawWebSignIn.randomBase64Url(16)), + open: (authorizeUrl, port, path) => + new Promise((resolve, reject) => { + const native = com.faceclaw.app.FaceclawWebSignIn.shared(); + let onResume: ((args: any) => void) | null = null; + const stopWaiting = () => { + if (onResume) Application.off(Application.resumeEvent, onResume); + onResume = null; + }; + const listener = new com.faceclaw.app.FaceclawWebSignInListener({ + onFinished: (redirectUrl: string | null, error: string | null) => { + if (signInListener === listener) signInListener = null; + stopWaiting(); + if (redirectUrl) resolve(String(redirectUrl)); + else reject(new Error(String(error || "Sign-in failed"))); + }, + }); + const startError = native.start(port, path, listener); + if (startError) { + reject(new Error(String(startError))); + return; + } + signInListener = listener; + const present = (activity: any) => { + stopWaiting(); + const openError = native.openBrowser(activity, authorizeUrl); + if (openError) native.fail(String(openError)); + }; + const activity = foregroundActivity(); + if (activity) { + present(activity); + return; + } + onResume = (args: any) => present(args?.activity ?? args?.android ?? Utils.android.getApplicationContext()); + Application.on(Application.resumeEvent, onResume); + }), + cancel: () => com.faceclaw.app.FaceclawWebSignIn.shared().cancel(), +}; + +/** The phone's media-stream volume, for Spotify playing on this phone (as the session bridge reports it). */ +function audioManager(): any { + return Utils.android.getApplicationContext()?.getSystemService(android.content.Context.AUDIO_SERVICE) ?? null; +} + +const systemVolume = { + get: (): number => { + const audio = audioManager(); + if (!audio) return -1; + const max = Number(audio.getStreamMaxVolume(android.media.AudioManager.STREAM_MUSIC)); + if (max <= 0) return 0; + return Math.max(0, Math.min(100, Math.round((Number(audio.getStreamVolume(android.media.AudioManager.STREAM_MUSIC)) * 100) / max))); + }, + set: (percent: number): void => { + const audio = audioManager(); + if (!audio) return; + const max = Number(audio.getStreamMaxVolume(android.media.AudioManager.STREAM_MUSIC)); + const volume = Math.round((Math.max(0, Math.min(100, percent)) * max) / 100); + audio.setStreamVolume(android.media.AudioManager.STREAM_MUSIC, volume, 0); + }, +}; + +let service: SpotifyService | null = null; + +/** + * The Spotify Web API service, created on first use (main thread only: it + * owns timers and the sign-in). Signing in is optional on Android: Spotify's + * media session already gives now-playing and transport control, and the + * media bridges add the Web API's extras once signed in (library browsing, + * search, shuffle / repeat / like, playback on other Spotify devices). + */ +export function spotifyService(): SpotifyService | null { + service ??= new SpotifyService({ + packageName: SPOTIFY_ANDROID_PACKAGE, + fetch: (url, init) => fetchTextWithUserAgent(url, init), + webSignIn, + download: async (url) => { + const response = await downloadBinary(url, ART_DOWNLOAD_TIMEOUT_MS); + return response.status === 200 ? response.bytes : null; + }, + decodeArt: (bytes, maxSize) => { + const size = Math.round(maxSize); + // The shared photo tone (gamma + dither), as for media-session art. + return grayImageFromPacket( + com.faceclaw.app.ImageFileLoader.loadGrayFromBytes(copyToJavaByteBuffer(bytes), size, size, PHOTO_TONE.gamma, PHOTO_TONE.dither), + ); + }, + systemVolume, + }); + return service; +} diff --git a/app/native/voice-control.ios.ts b/app/native/voice-control.ios.ts index 38dd996f..407ab3cd 100644 --- a/app/native/voice-control.ios.ts +++ b/app/native/voice-control.ios.ts @@ -2,7 +2,9 @@ import type { VoiceControlState, VoiceTranscriptEvent } from './voice-control' import type { CloudSttTranscriptEvent } from './cloud-stt' import type { ReconnectingSttClient } from './reconnecting-stt' import { createCloudSttClient, usesCloudStt, type VoiceProviderSelection } from './cloud-stt-provider' +import { createSpeechAnalyzerClient, speechAnalyzerSupported } from './speech-analyzer-stt.ios' import { WavRecorder } from './wav-recorder.ios' +import { pcmLevel } from '../util/audio-level' declare const FaceclawSpeech: any export type IosMicrophoneSession = { @@ -10,20 +12,26 @@ export type IosMicrophoneSession = { } /** How long a cloud provider gets, after the last audio, to send its final transcript. */ const CLOUD_FINAL_TIMEOUT_MS = 5000 +/** Retries of a failed raw-tap start (a new session's display path is usually still coming up). */ +const RAW_RETRY_MS = 3000 +const RAW_RETRY_LIMIT = 5 /** iOS implementation of the shared voice dialog's event bridge. Audio comes * from the glasses when connected, or the default phone input in preview mode, * and is transcribed by Apple's on-device recognizer or a cloud provider. - * Continuous capture (Transcribe, Teleprompter) needs a cloud provider: only - * the PCM capture runs open-ended, and pauses commit its segments. When the - * session or the app lifecycle cuts one short it is drained, not discarded; - * restarting it is the controller's call. + * Continuous capture (Transcribe, Teleprompter) runs on the PCM capture, which + * is open-ended and has pauses commit its segments, so it needs a cloud + * provider or, on-device, SpeechAnalyzer (iOS 26+): FaceclawSpeech's + * recognizer only handles short dictations. When the session or the app + * lifecycle cuts one short it is drained, not discarded; restarting it is the + * controller's call. */ export class IosVoiceControlBridge { private native: any = null private readonly statuses = new Set<(state: VoiceControlState) => void>() private readonly transcripts = new Set<(event: VoiceTranscriptEvent) => void>() private readonly ends = new Set<() => void>() + private readonly levels = new Set<(level: number) => void>() private status = 'Voice input ready.' private generation = 0 private session: IosMicrophoneSession | null = null @@ -35,10 +43,13 @@ export class IosVoiceControlBridge { private audioTimer: ReturnType | null = null private packets = 0 private log: (message: string) => void = () => {} - // Non-null while a cloud provider owns the transcript; FaceclawSpeech then + // Non-null while a PCM transcriber (a cloud provider, or SpeechAnalyzer for + // on-device continuous capture) owns the transcript; FaceclawSpeech then // only supplies PCM. cloudEndStatus is set once the audio has ended and the // provider was asked to finalize; it is the status shown when it does. private cloud: ReconnectingSttClient | null = null + // What transcribes the current capture, for the log. + private recognition = 'on-device' private cloudEndStatus: string | null = null private cloudTimer: ReturnType | null = null // Open-ended capture: runs until stopContinuousCapture, and push-to-talk @@ -51,6 +62,21 @@ export class IosVoiceControlBridge { // and it is created by the first audio, so a failed start leaves no file. private recordingName = '' private recorder: WavRecorder | null = null + // Raw-PCM tap (EvenHub mic apps): decode-only glasses audio, broadcast to + // rawListeners while any owner wants it, from the session setRawSession + // bound. It shares the one glasses mic with speech capture, which preempts + // it; it resumes on its own once that capture has ended. + private rawNative: any = null + private readonly rawListeners = new Set<(pcm: Uint8Array) => void>() + private readonly rawOwners = new Set() + private rawSession: IosMicrophoneSession | null = null + // The session the tap enabled the mic on, while it is starting or live. + private rawHeld: IosMicrophoneSession | null = null + private rawLive = false + private rawGeneration = 0 + private rawFailures = 0 + private rawRetryTimer: ReturnType | null = null + private rawLog: (message: string) => void = () => {} onStatus(listener: (state: VoiceControlState) => void): () => void { this.statuses.add(listener); listener({ status: this.status, listening: this.capturing, detail: '' }); return () => { this.statuses.delete(listener) } @@ -60,15 +86,19 @@ export class IosVoiceControlBridge { } onSpeechEnd(listener: () => void): () => void { this.ends.add(listener); return () => { this.ends.delete(listener) } } onSpeechPause(_listener: () => void): () => void { return () => {} } + /** The mic level (see pcmLevel) of each PCM chunk; only cloud captures and the raw tap supply PCM. */ + onMicLevel(listener: (level: number) => void): () => void { this.levels.add(listener); return () => { this.levels.delete(listener) } } private setStatus(status: string): void { this.status = status; for (const fn of [...this.statuses]) fn({ status, listening: this.capturing, detail: '' }) } private ensureNative(): any { if (!this.native) { this.native = FaceclawSpeech.new() this.native.eventHandler = (json: string) => this.receive(JSON.parse(json)) this.native.pcmHandler = (pcm: NSData) => { - const bytes = new Uint8Array(interop.bufferFromData(pcm)) + // Copied: bufferFromData doesn't retain pcm, and STT clients queue chunks. + const bytes = new Uint8Array(interop.bufferFromData(pcm)).slice() this.cloud?.acceptPcm(bytes) if (this.continuous) this.record(bytes) + if (this.levels.size) { const level = pcmLevel(bytes); for (const fn of [...this.levels]) fn(level) } } } return this.native @@ -96,6 +126,8 @@ export class IosVoiceControlBridge { get statusText(): string { return this.status } async startGlassesCapture(session: IosMicrophoneSession, voice: VoiceProviderSelection, log: (message: string) => void, endpointing = false, continuous = false): Promise { if (this.joinsContinuous(continuous)) return + // Speech capture preempts the raw tap; its mic release is queued before this enable, which wins. + this.endRawTap() this.stop() const generation = ++this.generation this.continuous = continuous @@ -111,7 +143,7 @@ export class IosVoiceControlBridge { this.native.acceptPacket(NSData.dataWithBytesLength(interop.handleof(copy.buffer), copy.byteLength)) }) if (generation !== this.generation || !this.capturing) return - log(`Voice: glasses microphone enabled; using ${this.cloud ? 'cloud' : 'on-device'} recognition`) + log(`Voice: glasses microphone enabled; using ${this.recognition} recognition`) this.audioTimer = setTimeout(() => { this.audioTimer = null if (generation === this.generation && this.capturing && !this.packets) { @@ -125,24 +157,34 @@ export class IosVoiceControlBridge { } async startPhoneCapture(voice: VoiceProviderSelection, log: (message: string) => void, endpointing = false, continuous = false): Promise { if (this.joinsContinuous(continuous)) return + this.endRawTap() this.stop() this.continuous = continuous this.log = log; this.source = 'phone'; this.capturing = true this.completion = new Promise(resolve => { this.resolveCompletion = resolve }) const error = this.startNative(voice, endpointing, true) if (error) { this.stop(); this.setStatus(error); this.emitEnd(); return } - log(`Voice: phone default microphone enabled; using ${this.cloud ? 'cloud' : 'on-device'} recognition`) + log(`Voice: phone default microphone enabled; using ${this.recognition} recognition`) } /** Starts the native capture for the chosen provider; returns an actionable error, or ''. */ private startNative(voice: VoiceProviderSelection, endpointing: boolean, phone: boolean): string { const native = this.ensureNative() const generation = this.generation const current = () => generation === this.generation - const cloud = createCloudSttClient(voice, { - onTranscript: event => { if (current()) this.receiveCloudTranscript(event) }, - onStatus: status => { if (current()) this.setStatus(status) }, - onError: message => { if (current()) { this.stop(); this.setStatus(message); this.emitEnd() } }, - }, () => this.continuous) + const options = { + language: voice.language, + onTranscript: (event: CloudSttTranscriptEvent) => { if (current()) this.receiveCloudTranscript(event) }, + onStatus: (status: string) => { if (current()) this.setStatus(status) }, + onError: (message: string) => { if (current()) { this.stop(); this.setStatus(message); this.emitEnd() } }, + } + const continuous = () => this.continuous + let cloud = createCloudSttClient(voice, options, continuous) + this.recognition = cloud ? 'cloud' : 'on-device' + // Continuous capture outlasts FaceclawSpeech's recognizer; SpeechAnalyzer takes the PCM instead. + if (!cloud && this.continuous && speechAnalyzerSupported()) { + cloud = createSpeechAnalyzerClient(options, continuous) + this.recognition = 'on-device (SpeechAnalyzer)' + } if (!cloud) return String((phone ? native.startPhoneWithEndpointing(endpointing) : native.startWithEndpointing(endpointing)) ?? '') const error = String(native.startPcmCaptureWithEndpointingPhone(endpointing, phone) ?? '') if (error) return error @@ -155,8 +197,11 @@ export class IosVoiceControlBridge { if (this.continuous) { if (this.capturing) void this.finalizeCapture('Paused while Faceclaw is in the background.'); return } this.stop(); this.setStatus('Phone voice input stopped.'); this.emitEnd() } - /** Whether continuous capture can run with this provider (Apple's recognizer can't). */ - supportsContinuous(voice: VoiceProviderSelection): boolean { return usesCloudStt(voice) } + /** + * Whether continuous capture can run with this provider: a cloud one, or + * on-device with SpeechAnalyzer (FaceclawSpeech's recognizer can't). + */ + supportsContinuous(voice: VoiceProviderSelection): boolean { return usesCloudStt(voice) || speechAnalyzerSupported() } get continuousActive(): boolean { return this.continuous && (this.capturing || this.finalizing) } /** Where a listening continuous capture gets its audio; null when none is listening. */ get continuousSource(): 'glasses' | 'phone' | null { return this.continuous && this.capturing ? this.source : null } @@ -222,6 +267,100 @@ export class IosVoiceControlBridge { if (this.continuous) { if (this.capturing) void this.finalizeCapture(continuousMessage); return } this.stop(); this.setStatus(message); this.emitEnd() } + /** Subscribe to the raw tap's decoded glasses PCM (16 kHz mono S16LE). */ + onRawPcm(listener: (pcm: Uint8Array) => void): () => void { + this.rawListeners.add(listener); return () => { this.rawListeners.delete(listener) } + } + /** + * The glasses session the raw tap captures from (connected and unlocked), + * or null. Owners outlive a change: the tap moves to the next session. + */ + setRawSession(session: IosMicrophoneSession | null, log: (message: string) => void): void { + this.rawLog = log + if (session === this.rawSession) return + this.endRawTap() + this.rawSession = session; this.rawFailures = 0 + this.syncRawTap() + } + /** + * Start the decode-only raw tap on behalf of `owner`; the communicator is + * the one setRawSession bound, not `options.communicator`. False while + * speech capture holds the mic or no session is bound: the owner stays + * registered and the tap starts once it can. Idempotent while running. + */ + startRawCapture(options: { communicator: any; owner: string }): boolean { + if (!this.rawOwners.has(options.owner)) { this.rawOwners.add(options.owner); this.rawFailures = 0 } + this.syncRawTap() + return this.rawHeld !== null + } + /** `owner` no longer wants the raw tap; it stops once no owner does. */ + stopRawCapture(owner: string): void { + if (this.rawOwners.delete(owner)) this.syncRawTap() + } + /** Whether the raw tap's glasses mic enable went through and still holds. */ + isRawCaptureLive(): boolean { return this.rawLive } + /** Run the tap while an owner wants it, a session is bound, and no speech capture holds the mic. */ + private syncRawTap(): void { + const session = this.rawSession + if (!session || !this.rawOwners.size || this.capturing || this.finalizing) { this.endRawTap(); return } + if (this.rawHeld || this.rawRetryTimer !== null) return + void this.beginRawTap(session) + } + private async beginRawTap(session: IosMicrophoneSession): Promise { + const generation = ++this.rawGeneration + const native = this.ensureRawNative() + const error = String(native.startPcmCaptureWithEndpointingPhone(false, false) ?? '') + if (error) { this.failRawTap(error); return } + this.rawHeld = session + try { + await session.setMicrophone(true, packet => { + if (generation !== this.rawGeneration) return + const copy = new Uint8Array(packet) + native.acceptPacket(NSData.dataWithBytesLength(interop.handleof(copy.buffer), copy.byteLength)) + }) + if (generation !== this.rawGeneration) return + this.rawLive = true + this.rawLog('EvenHub mic: glasses microphone enabled') + } catch (failure) { + if (generation === this.rawGeneration) this.failRawTap(failure instanceof Error ? failure.message : String(failure)) + } + } + private ensureRawNative(): any { + if (!this.rawNative) { + this.rawNative = FaceclawSpeech.new() + // A PCM capture only ends on its own when decoding failed or fell behind. + this.rawNative.eventHandler = (json: string) => { + const event = JSON.parse(json) + if (event.kind === 'ended' && this.rawHeld) this.failRawTap(String(event.message ?? 'audio ended')) + } + this.rawNative.pcmHandler = (pcm: NSData) => { + // Copied: bufferFromData doesn't retain pcm. + const bytes = new Uint8Array(interop.bufferFromData(pcm)).slice() + // Audio is flowing, so a later failure is a new problem worth retrying. + this.rawFailures = 0 + for (const fn of [...this.rawListeners]) fn(bytes) + if (this.levels.size) { const level = pcmLevel(bytes); for (const fn of [...this.levels]) fn(level) } + } + } + return this.rawNative + } + /** Drop the tap and retry it shortly, a bounded number of times. */ + private failRawTap(message: string): void { + this.rawLog(`EvenHub mic: ${message}`) + this.endRawTap() + if (++this.rawFailures >= RAW_RETRY_LIMIT) return + this.rawRetryTimer = setTimeout(() => { this.rawRetryTimer = null; this.syncRawTap() }, RAW_RETRY_MS) + } + /** Stop the tap; owners stay. Releases the mic only if the tap enabled it. */ + private endRawTap(): void { + ++this.rawGeneration + if (this.rawRetryTimer !== null) clearTimeout(this.rawRetryTimer) + this.rawRetryTimer = null + this.rawLive = false + this.rawNative?.cancel() + const session = this.rawHeld; this.rawHeld = null + if (session) void session.setMicrophone(false).catch(error => this.rawLog(`EvenHub mic cleanup: ${error}`)) + } private clearAudioTimer(): void { if (this.audioTimer !== null) clearTimeout(this.audioTimer); this.audioTimer = null } private releaseMicrophone(): void { const session = this.session; this.session = null @@ -255,7 +394,11 @@ export class IosVoiceControlBridge { // In continuous capture, earlier pause segments (paragraphBreakAfter) may still arrive. if (event.isFinal && this.cloudEndStatus !== null && !(this.continuous && event.paragraphBreakAfter)) this.completeCloud() } - private emitEnd(): void { for (const fn of [...this.ends]) fn() } + private emitEnd(): void { + for (const fn of [...this.ends]) fn() + // After the listeners: one may start the next capture, which keeps the mic. + this.syncRawTap() + } private finishCompletion(): void { const resolve = this.resolveCompletion; this.resolveCompletion = null; resolve?.() } diff --git a/app/native/voice-control.ts b/app/native/voice-control.ts index c80d98ca..038c8ceb 100644 --- a/app/native/voice-control.ts +++ b/app/native/voice-control.ts @@ -4,6 +4,7 @@ import { type CloudSttTranscriptEvent, CloudSttClient } from "./cloud-stt"; import { createCloudSttClient, transcriptionKey } from "./cloud-stt-provider"; import { SpeechPauseDetector } from "./speech-pause"; import { toUint8Array } from "../util/array-util"; +import { pcmLevel } from "../util/audio-level"; declare const com: any; @@ -56,8 +57,9 @@ export type PushToTalkOptions = { sonioxApiKey: string; whisperServerUrl?: string; whisperServerModel?: string; - whisperServerLanguage?: string; whisperServerApiKey?: string; + /** Spoken language for cloud providers (see VoiceProviderSelection.language). */ + language?: string; saveRecording: boolean; /** * Watch the mic and fire onSpeechEnd when the speaker stops. For hands-free @@ -138,6 +140,7 @@ export class FaceclawVoiceControlBridge { // stopped for its duration. private readonly rawPcmListeners = new Set(); private readonly frameMetaListeners = new Set(); + private readonly micLevelListeners = new Set<(level: number) => void>(); private rawActive = false; // Who wants the raw tap. It runs while any owner does, so one owner letting // go (an EvenHub app backgrounding) doesn't silence another. @@ -237,6 +240,16 @@ export class FaceclawVoiceControlBridge { return () => this.rawPcmListeners.delete(listener); } + /** + * Subscribe to the mic level (meter position in [0,1], see pcmLevel) of + * each decoded audio chunk, about every 50 ms, from any capture: STT in + * every mode, or the raw tap. + */ + onMicLevel(listener: (level: number) => void): () => void { + this.micLevelListeners.add(listener); + return () => this.micLevelListeners.delete(listener); + } + /** Subscribe to per-packet firmware DSP metadata (DOA angle + SSR). */ onFrameMeta(listener: FrameMetaListener): () => void { this.frameMetaListeners.add(listener); @@ -539,6 +552,10 @@ export class FaceclawVoiceControlBridge { if (this.rawPcmListeners.size > 0) { this.rawPcmListeners.forEach((listener) => listener(bytes)); } + if (this.micLevelListeners.size > 0) { + const level = pcmLevel(bytes); + this.micLevelListeners.forEach((listener) => listener(level)); + } }, onFrameMeta: (angleDegrees: number, ssr: number) => { if (this.frameMetaListeners.size === 0) return; diff --git a/app/phone-ui/keyboard-input-panel.xml b/app/phone-ui/keyboard-input-panel.xml index bd36734d..412f383f 100644 --- a/app/phone-ui/keyboard-input-panel.xml +++ b/app/phone-ui/keyboard-input-panel.xml @@ -1,18 +1,40 @@ -