commit e6fed6b18818a04934e48c6ba62e92eea6e4d7c9 Author: AppCakes Date: Fri Jun 26 08:12:59 2026 +0000 build: 444813b5-5daf-49b2-bf1a-7e4caeab4e17 diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..9fe4e25 Binary files /dev/null and b/.DS_Store differ diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz new file mode 100644 index 0000000..735c838 Binary files /dev/null and b/.yarn/install-state.gz differ diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 0000000..3186f3f --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/android/.DS_Store b/android/.DS_Store new file mode 100644 index 0000000..77e3856 Binary files /dev/null and b/android/.DS_Store differ diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..48354a3 --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,101 @@ +# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore + +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ +*.iml +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +# Android Studio 3 in .gitignore file. +.idea/caches +.idea/modules.xml +# Comment next line if keeping position of elements in Navigation Editor is relevant for you +.idea/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ + +# Android Profiling +*.hprof + +# Cordova plugins for Capacitor +capacitor-cordova-android-plugins + +# Copied web assets +app/src/main/assets/public + +# Generated Config files +app/src/main/assets/capacitor.config.json +app/src/main/assets/capacitor.plugins.json +app/src/main/res/xml/config.xml diff --git a/android/app/.gitignore b/android/app/.gitignore new file mode 100644 index 0000000..043df80 --- /dev/null +++ b/android/app/.gitignore @@ -0,0 +1,2 @@ +/build/* +!/build/.npmkeep diff --git a/android/app/build.gradle b/android/app/build.gradle new file mode 100644 index 0000000..65a966f --- /dev/null +++ b/android/app/build.gradle @@ -0,0 +1,55 @@ +apply plugin: 'com.android.application' + +android { + namespace = "io.ionic.starter" + compileSdk = rootProject.ext.compileSdkVersion + defaultConfig { + applicationId "com.kumusha.app" + minSdkVersion rootProject.ext.minSdkVersion + targetSdkVersion rootProject.ext.targetSdkVersion + versionCode 1 + versionName "1.0" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + manifestPlaceholders = [googleMapsApiKey: System.getenv("VITE_GOOGLE_MAPS_KEY") ?: ""] + aaptOptions { + // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. + // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 + ignoreAssetsPattern = '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' + } + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +repositories { + flatDir{ + dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' + } +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" + implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" + implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" + implementation project(':capacitor-android') + testImplementation "junit:junit:$junitVersion" + androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" + androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" + implementation project(':capacitor-cordova-android-plugins') +} + +apply from: 'capacitor.build.gradle' + +try { + def servicesJSON = file('google-services.json') + if (servicesJSON.text) { + apply plugin: 'com.google.gms.google-services' + } +} catch(Exception e) { + logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") +} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java new file mode 100644 index 0000000..f2c2217 --- /dev/null +++ b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.getcapacitor.myapp; + +import static org.junit.Assert.*; + +import android.content.Context; +import androidx.test.ext.junit.runners.AndroidJUnit4; +import androidx.test.platform.app.InstrumentationRegistry; +import org.junit.Test; +import org.junit.runner.RunWith; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + + @Test + public void useAppContext() throws Exception { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("com.getcapacitor.app", appContext.getPackageName()); + } +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ace79b0 --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/java/io/ionic/starter/MainActivity.java b/android/app/src/main/java/io/ionic/starter/MainActivity.java new file mode 100644 index 0000000..73e3a98 --- /dev/null +++ b/android/app/src/main/java/io/ionic/starter/MainActivity.java @@ -0,0 +1,5 @@ +package io.ionic.starter; + +import com.getcapacitor.BridgeActivity; + +public class MainActivity extends BridgeActivity {} diff --git a/android/app/src/main/res/drawable-land-hdpi/splash.png b/android/app/src/main/res/drawable-land-hdpi/splash.png new file mode 100644 index 0000000..e31573b Binary files /dev/null and b/android/app/src/main/res/drawable-land-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-mdpi/splash.png b/android/app/src/main/res/drawable-land-mdpi/splash.png new file mode 100644 index 0000000..f7a6492 Binary files /dev/null and b/android/app/src/main/res/drawable-land-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xhdpi/splash.png b/android/app/src/main/res/drawable-land-xhdpi/splash.png new file mode 100644 index 0000000..8077255 Binary files /dev/null and b/android/app/src/main/res/drawable-land-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxhdpi/splash.png new file mode 100644 index 0000000..14c6c8f Binary files /dev/null and b/android/app/src/main/res/drawable-land-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png new file mode 100644 index 0000000..244ca25 Binary files /dev/null and b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-hdpi/splash.png b/android/app/src/main/res/drawable-port-hdpi/splash.png new file mode 100644 index 0000000..74faaa5 Binary files /dev/null and b/android/app/src/main/res/drawable-port-hdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-mdpi/splash.png b/android/app/src/main/res/drawable-port-mdpi/splash.png new file mode 100644 index 0000000..e944f4a Binary files /dev/null and b/android/app/src/main/res/drawable-port-mdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xhdpi/splash.png b/android/app/src/main/res/drawable-port-xhdpi/splash.png new file mode 100644 index 0000000..564a82f Binary files /dev/null and b/android/app/src/main/res/drawable-port-xhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxhdpi/splash.png new file mode 100644 index 0000000..bfabe68 Binary files /dev/null and b/android/app/src/main/res/drawable-port-xxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png new file mode 100644 index 0000000..6929071 Binary files /dev/null and b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png differ diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..c7bd21d --- /dev/null +++ b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..d5fccc5 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png new file mode 100644 index 0000000..f7a6492 Binary files /dev/null and b/android/app/src/main/res/drawable/splash.png differ diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..b5ad138 --- /dev/null +++ b/android/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,12 @@ + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..c023e50 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..2127973 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..b441f37 Binary files /dev/null and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..72905b8 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..8ed0605 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..9502e47 Binary files /dev/null and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..4d1e077 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..df0f158 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..853db04 Binary files /dev/null and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..6cdf97c Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..2960cbb Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..8e3093a Binary files /dev/null and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..46de6e2 Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..d2ea9ab Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..a40d73e Binary files /dev/null and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml new file mode 100644 index 0000000..c5d5899 --- /dev/null +++ b/android/app/src/main/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..1b49c6c --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,7 @@ + + + kumusha + kumusha + io.ionic.starter + io.ionic.starter + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..be874e5 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/xml/file_paths.xml b/android/app/src/main/res/xml/file_paths.xml new file mode 100644 index 0000000..bd0c4d8 --- /dev/null +++ b/android/app/src/main/res/xml/file_paths.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java new file mode 100644 index 0000000..0297327 --- /dev/null +++ b/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java @@ -0,0 +1,18 @@ +package com.getcapacitor.myapp; + +import static org.junit.Assert.*; + +import org.junit.Test; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + + @Test + public void addition_isCorrect() throws Exception { + assertEquals(4, 2 + 2); + } +} diff --git a/android/build.gradle b/android/build.gradle new file mode 100644 index 0000000..f8f0e43 --- /dev/null +++ b/android/build.gradle @@ -0,0 +1,29 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:8.13.0' + classpath 'com.google.gms:google-services:4.4.4' + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } +} + +apply from: "variables.gradle" + +allprojects { + repositories { + google() + mavenCentral() + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..2e87c52 --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,22 @@ +# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx1536m + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..1b33c55 Binary files /dev/null and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..7705927 --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew new file mode 100755 index 0000000..23d15a9 --- /dev/null +++ b/android/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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 +# +# https://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. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat new file mode 100644 index 0000000..5eed7ee --- /dev/null +++ b/android/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/android/settings.gradle b/android/settings.gradle new file mode 100644 index 0000000..3b4431d --- /dev/null +++ b/android/settings.gradle @@ -0,0 +1,5 @@ +include ':app' +include ':capacitor-cordova-android-plugins' +project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/') + +apply from: 'capacitor.settings.gradle' \ No newline at end of file diff --git a/android/variables.gradle b/android/variables.gradle new file mode 100644 index 0000000..ff89f79 --- /dev/null +++ b/android/variables.gradle @@ -0,0 +1,18 @@ +ext { + minSdkVersion = 24 + compileSdkVersion = 36 + targetSdkVersion = 36 + androidxActivityVersion = '1.11.0' + androidxAppCompatVersion = '1.7.1' + androidxCoordinatorLayoutVersion = '1.3.0' + androidxCoreVersion = '1.17.0' + androidxFragmentVersion = '1.8.9' + coreSplashScreenVersion = '1.2.0' + androidxWebkitVersion = '1.14.0' + junitVersion = '4.13.2' + androidxJunitVersion = '1.3.0' + androidxEspressoCoreVersion = '3.7.0' + cordovaAndroidVersion = '14.0.1' + rgcfaIncludeGoogle = true + androidxCredentialsVersion = '1.3.0' +} \ No newline at end of file diff --git a/capacitor.config.ts b/capacitor.config.ts new file mode 100644 index 0000000..a425889 --- /dev/null +++ b/capacitor.config.ts @@ -0,0 +1,18 @@ +import type { CapacitorConfig } from '@capacitor/cli'; + +const config: CapacitorConfig = { + appId: 'com.kumusha.app', + appName: 'kumusha', + webDir: 'dist', + plugins: { + FirebaseAuthentication: { + skipNativeAuth: false, + providers: [], + }, + PushNotifications: { + presentationOptions: ['badge', 'sound', 'banner'], + }, + }, +}; + +export default config; diff --git a/codemagic.yaml b/codemagic.yaml new file mode 100644 index 0000000..96bfc2b --- /dev/null +++ b/codemagic.yaml @@ -0,0 +1,380 @@ +workflows: + android-debug: + name: Android – Debug APK + max_build_duration: 45 + instance_type: mac_mini_m2 + environment: + node: 22 + java: 21 + cache: + cache_paths: + - $HOME/.gradle/caches + - $HOME/.gradle/wrapper + scripts: + # Template ships with optional native plugins (maps, push, firebase auth) that most apps + # won't use. Keeping unused plugins in package.json adds SPM/Gradle deps and bloats the + # build. Strip any that have no import in src/ so only actually-used plugins are compiled. + - name: Strip unused scaffold packages + script: | + for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do + if ! grep -rq "$pkg" src/; then + node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));" + echo "Stripped $pkg (not used in src/)" + else + echo "Keeping $pkg (used in src/)" + fi + done + # Delete package-lock.json (generated if user ever ran npm locally) so it doesn't + # conflict with yarn.lock. --legacy-peer-deps silences peer dep warnings from older + # Ionic/React packages that haven't updated their peerDependencies for React 18/19. + - name: Install dependencies + script: rm -f package-lock.json && npm install --legacy-peer-deps + - name: Build web assets + script: npm run build + # Firebase config files are injected as base64 env vars by the Appcakes backend at + # build time. Decode them here so cap sync and Gradle can pick them up. Optional — + # builds without Firebase still succeed; native Firebase SDK just won't initialise. + - name: Write Firebase config + script: | + if [ -n "$GOOGLE_SERVICES_JSON" ]; then + echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json + echo "Wrote google-services.json ($(wc -c < android/app/google-services.json) bytes)" + else + echo "GOOGLE_SERVICES_JSON is empty — skipping" + fi + if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then + echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist + echo "Wrote GoogleService-Info.plist ($(wc -c < ios/App/App/GoogleService-Info.plist) bytes)" + fi + # cap sync copies the built web assets (dist/) into android/app/src/main/assets/public/ + # and updates Capacitor plugin registrations in MainActivity. Must run after npm build. + - name: Capacitor sync + script: npx cap sync android + - name: Set up debug keystore + script: | + if [ -n "$CM_DEBUG_KEYSTORE" ]; then + echo "$CM_DEBUG_KEYSTORE" | base64 --decode > /tmp/debug-keystore.p12 + fi + - name: Build debug APK + script: | + cd android + if [ -n "$CM_DEBUG_KEYSTORE" ]; then + ./gradlew assembleDebug \ + -Pandroid.injected.signing.store.file=/tmp/debug-keystore.p12 \ + -Pandroid.injected.signing.store.password=$CM_DEBUG_KEYSTORE_PASSWORD \ + -Pandroid.injected.signing.key.alias=debug \ + -Pandroid.injected.signing.key.password=$CM_DEBUG_KEYSTORE_PASSWORD \ + --no-daemon + else + ./gradlew assembleDebug --no-daemon + fi + artifacts: + - android/app/build/outputs/apk/debug/app-debug.apk + + android-release-apk: + name: Android – Release APK + max_build_duration: 45 + instance_type: mac_mini_m2 + environment: + node: 22 + java: 21 + cache: + cache_paths: + - $HOME/.gradle/caches + - $HOME/.gradle/wrapper + scripts: + - name: Strip unused scaffold packages + script: | + for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do + if ! grep -rq "$pkg" src/; then + node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));" + echo "Stripped $pkg (not used in src/)" + else + echo "Keeping $pkg (used in src/)" + fi + done + - name: Install dependencies + script: rm -f package-lock.json && npm install --legacy-peer-deps + - name: Build web assets + script: npm run build + - name: Write Firebase config + script: | + if [ -n "$GOOGLE_SERVICES_JSON" ]; then + echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json + fi + - name: Capacitor sync + script: npx cap sync android + - name: Set up keystore + script: echo "$CM_KEYSTORE" | base64 --decode > /tmp/keystore.jks + - name: Build Release APK + script: | + cd android + ./gradlew assembleRelease \ + -Pandroid.injected.signing.store.file=/tmp/keystore.jks \ + -Pandroid.injected.signing.store.password=$CM_KEYSTORE_PASSWORD \ + -Pandroid.injected.signing.key.alias=$CM_KEY_ALIAS \ + -Pandroid.injected.signing.key.password=$CM_KEY_PASSWORD \ + --no-daemon + artifacts: + - android/app/build/outputs/apk/release/app-release.apk + + android-release-aab: + name: Android – Release AAB + max_build_duration: 45 + instance_type: mac_mini_m2 + environment: + node: 22 + java: 21 + cache: + cache_paths: + - $HOME/.gradle/caches + - $HOME/.gradle/wrapper + scripts: + - name: Strip unused scaffold packages + script: | + for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do + if ! grep -rq "$pkg" src/; then + node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));" + echo "Stripped $pkg (not used in src/)" + else + echo "Keeping $pkg (used in src/)" + fi + done + - name: Install dependencies + script: rm -f package-lock.json && npm install --legacy-peer-deps + - name: Build web assets + script: npm run build + - name: Write Firebase config + script: | + if [ -n "$GOOGLE_SERVICES_JSON" ]; then + echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json + fi + - name: Capacitor sync + script: npx cap sync android + - name: Set up keystore + script: echo "$CM_KEYSTORE" | base64 --decode > /tmp/keystore.jks + - name: Build Release AAB + script: | + cd android + ./gradlew bundleRelease \ + -Pandroid.injected.signing.store.file=/tmp/keystore.jks \ + -Pandroid.injected.signing.store.password=$CM_KEYSTORE_PASSWORD \ + -Pandroid.injected.signing.key.alias=$CM_KEY_ALIAS \ + -Pandroid.injected.signing.key.password=$CM_KEY_PASSWORD \ + --no-daemon + artifacts: + - android/app/build/outputs/bundle/release/app-release.aab + + android-release: + name: Android – Publish to Google Play + max_build_duration: 60 + instance_type: mac_mini_m2 + environment: + node: 22 + java: 21 + cache: + cache_paths: + - $HOME/.gradle/caches + - $HOME/.gradle/wrapper + scripts: + - name: Strip unused scaffold packages + script: | + for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do + if ! grep -rq "$pkg" src/; then + node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));" + echo "Stripped $pkg (not used in src/)" + else + echo "Keeping $pkg (used in src/)" + fi + done + - name: Install dependencies + script: rm -f package-lock.json && npm install --legacy-peer-deps + - name: Build web assets + script: npm run build + - name: Write Firebase config + script: | + if [ -n "$GOOGLE_SERVICES_JSON" ]; then + echo "$GOOGLE_SERVICES_JSON" | base64 --decode > android/app/google-services.json + fi + - name: Capacitor sync + script: npx cap sync android + - name: Set up keystore + script: echo "$CM_KEYSTORE" | base64 --decode > /tmp/keystore.jks + - name: Build Release AAB + script: | + cd android + ./gradlew bundleRelease \ + -Pandroid.injected.signing.store.file=/tmp/keystore.jks \ + -Pandroid.injected.signing.store.password=$CM_KEYSTORE_PASSWORD \ + -Pandroid.injected.signing.key.alias=$CM_KEY_ALIAS \ + -Pandroid.injected.signing.key.password=$CM_KEY_PASSWORD \ + --no-daemon + publishing: + google_play: + credentials: $GOOGLE_PLAY_SERVICE_ACCOUNT_CREDENTIALS + track: $GOOGLE_PLAY_TRACK + submit_as_draft: false + artifacts: + - android/app/build/outputs/bundle/release/app-release.aab + + ios-debug: + name: iOS – Debug IPA + max_build_duration: 60 + instance_type: mac_mini_m2 + environment: + node: 22 + xcode: latest + scripts: + - name: Strip unused scaffold packages + script: | + for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do + if ! grep -rq "$pkg" src/; then + node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));" + echo "Stripped $pkg (not used in src/)" + else + echo "Keeping $pkg (used in src/)" + fi + done + - name: Install dependencies + script: rm -f package-lock.json && npm install --legacy-peer-deps + - name: Build web assets + script: npm run build + # First sync: regenerates CapApp-SPM/Package.swift with the correct plugin list. + # Note: this project uses Capacitor SPM (no CocoaPods/Podfile), so cap sync replaces + # pod install — it regenerates CapApp-SPM/Package.swift and copies web assets. + - name: Capacitor sync + script: npx cap sync ios + # Decode Firebase plist to disk so it is present during the second sync. + - name: Write Firebase config + script: | + if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then + echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist + fi + # Second sync ensures CapApp-SPM/Package.swift is consistent after the plist write. + - name: Capacitor sync + script: npx cap sync ios + # Run configure_xcode.rb after both syncs so its xcodeproj changes (plist file + # reference + SPM product linking) are not overwritten by a subsequent cap sync. + # configure_xcode.rb is stamped fresh from template on every build push. + - name: Configure Xcode project + script: ruby configure_xcode.rb + - name: Set up signing + script: | + keychain initialize + if [ -n "$APP_STORE_CONNECT_PRIVATE_KEY" ]; then + app-store-connect fetch-signing-files \ + $(xcode-project detect-bundle-id) \ + --type IOS_APP_DEVELOPMENT \ + --certificate-key=@env:APP_STORE_CONNECT_PRIVATE_KEY \ + --issuer-id=$APP_STORE_CONNECT_ISSUER_ID \ + --key-id=$APP_STORE_CONNECT_KEY_IDENTIFIER \ + --create + xcode-project use-profiles + elif [ -n "$CM_CERTIFICATE" ]; then + echo "$CM_CERTIFICATE" | base64 --decode > /tmp/cert.p12 + keychain add-certificates \ + --certificate /tmp/cert.p12 \ + --certificate-password "$CM_CERTIFICATE_PASSWORD" + mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles" + echo "$CM_PROVISIONING_PROFILE" | base64 --decode > "$HOME/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision" + xcode-project use-profiles + else + echo "No signing credentials configured — build will fail at signing" + exit 1 + fi + # --workspace: Capacitor SPM projects require workspace context for Xcode to resolve + # the CapApp-SPM local package. Using --project causes xcodebuild to fail on + # Xcode 26+ because SPM resolution requires workspace scope. App.xcworkspace is a + # static file committed to the template (not generated by cap sync) that wraps + # App.xcodeproj for this purpose. + # --no-show-build-settings: xcode-project runs xcodebuild -showBuildSettings as a + # pre-build diagnostic. Xcode 26 fails this step for SPM projects even with + # --workspace, so we skip it. The actual archive step still surfaces real errors. + # --disable-xcpretty: xcpretty reformats and filters xcodebuild output, swallowing + # the actual error lines when a build fails. Raw output makes failures debuggable. + - name: Build IPA + script: | + xcode-project build-ipa \ + --workspace ios/App/App.xcworkspace \ + --scheme App \ + --no-show-build-settings \ + --disable-xcpretty + artifacts: + - build/ios/ipa/*.ipa + + ios-release: + name: iOS – Release IPA + max_build_duration: 90 + instance_type: mac_mini_m2 + environment: + node: 22 + xcode: latest + scripts: + - name: Strip unused scaffold packages + script: | + for pkg in "@capacitor/google-maps" "@capacitor/push-notifications" "@capacitor-firebase/authentication"; do + if ! grep -rq "$pkg" src/; then + node -e "const fs=require('fs'),p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.dependencies['${pkg}'];fs.writeFileSync('package.json',JSON.stringify(p,null,2));" + echo "Stripped $pkg (not used in src/)" + else + echo "Keeping $pkg (used in src/)" + fi + done + - name: Install dependencies + script: rm -f package-lock.json && npm install --legacy-peer-deps + - name: Build web assets + script: npm run build + - name: Capacitor sync + script: npx cap sync ios + - name: Configure Xcode project + script: | + if [ -n "$GOOGLE_SERVICE_INFO_PLIST" ]; then + echo "$GOOGLE_SERVICE_INFO_PLIST" | base64 --decode > ios/App/App/GoogleService-Info.plist + fi + - name: Capacitor sync + script: npx cap sync ios + - name: Configure Xcode project + script: ruby configure_xcode.rb + - name: Set up signing + script: | + keychain initialize + if [ -n "$APP_STORE_CONNECT_PRIVATE_KEY" ]; then + app-store-connect fetch-signing-files \ + $(xcode-project detect-bundle-id) \ + --type IOS_APP_STORE \ + --certificate-key=@env:APP_STORE_CONNECT_PRIVATE_KEY \ + --issuer-id=$APP_STORE_CONNECT_ISSUER_ID \ + --key-id=$APP_STORE_CONNECT_KEY_IDENTIFIER \ + --create + xcode-project use-profiles + else + echo "$CM_CERTIFICATE" | base64 --decode > /tmp/cert.p12 + keychain add-certificates \ + --certificate /tmp/cert.p12 \ + --certificate-password "$CM_CERTIFICATE_PASSWORD" + mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles" + echo "$CM_PROVISIONING_PROFILE" | base64 --decode > "$HOME/Library/MobileDevice/Provisioning Profiles/profile.mobileprovision" + xcode-project use-profiles + fi + # See ios-debug Build IPA comments for --workspace, --no-show-build-settings, + # and --disable-xcpretty rationale — same reasons apply here. + - name: Build IPA + script: | + xcode-project build-ipa \ + --workspace ios/App/App.xcworkspace \ + --scheme App \ + --config Release \ + --no-show-build-settings \ + --disable-xcpretty + - name: Publish + script: | + if [ "$SUBMIT_TO_TESTFLIGHT" = "true" ] || [ "$SUBMIT_TO_APP_STORE" = "true" ]; then + app-store-connect publish \ + --certificate-key=@env:APP_STORE_CONNECT_PRIVATE_KEY \ + --issuer-id=$APP_STORE_CONNECT_ISSUER_ID \ + --key-id=$APP_STORE_CONNECT_KEY_IDENTIFIER \ + --submit-to-testflight=$SUBMIT_TO_TESTFLIGHT \ + --submit-to-app-store=$SUBMIT_TO_APP_STORE + fi + artifacts: + - build/ios/ipa/*.ipa diff --git a/configure_xcode.rb b/configure_xcode.rb new file mode 100644 index 0000000..85e1e40 --- /dev/null +++ b/configure_xcode.rb @@ -0,0 +1,118 @@ +#!/usr/bin/env ruby +# configure_xcode.rb — stamped fresh from template on every build (see gitea.service.ts) +# +# 1. Adds GoogleService-Info.plist to the Xcode target if present (xcodeproj gem) +# 2. Scans Swift sources for Firebase imports and injects matching products into +# CapApp-SPM/Package.swift — the correct approach for Capacitor SPM projects +# where all native linking goes through CapApp-SPM, not App.xcodeproj directly. + +require 'xcodeproj' + +PROJECT_PATH = 'ios/App/App.xcodeproj' +TARGET_NAME = 'App' +PLIST_SRC = 'ios/App/App/GoogleService-Info.plist' +CAP_APP_SPM = 'ios/App/CapApp-SPM/Package.swift' + +# ── 1. GoogleService-Info.plist ─────────────────────────────────────────────── +if File.exist?(PLIST_SRC) + project = Xcodeproj::Project.open(PROJECT_PATH) + target = project.targets.find { |t| t.name == TARGET_NAME } + if target + app_group = project.main_group['App'] + unless app_group&.files&.find { |f| f.path == 'GoogleService-Info.plist' } + file_ref = app_group.new_reference('GoogleService-Info.plist') + target.resources_build_phase.add_file_reference(file_ref) + project.save + puts "Added GoogleService-Info.plist to target" + end + end +end + +# ── 2. Scan Swift sources for Firebase imports ──────────────────────────────── +swift_files = Dir['ios/App/App/**/*.swift'] +firebase_imports = swift_files + .flat_map { |f| File.readlines(f) rescue [] } + .grep(/^\s*import\s+Firebase\w+/) + .map { |l| l.strip.split(/\s+/).last } + .uniq + .sort + +if firebase_imports.empty? + puts "No Firebase imports found — skipping CapApp-SPM update" + exit 0 +end + +puts "Firebase imports detected: #{firebase_imports.join(', ')}" + +unless File.exist?(CAP_APP_SPM) + warn "WARNING: #{CAP_APP_SPM} not found — was cap sync run?" + exit 0 +end + +# ── 3. Detect firebase-ios-sdk URL and version from node_modules ────────────── +# Read from the ACTUAL node_modules on this build machine (populated by npm install) +# so the version we inject matches what @capacitor-firebase/* already resolved. +firebase_url = nil +firebase_version = nil + +Dir['node_modules/@capacitor-firebase/**/Package.swift', + 'node_modules/@capacitor/push-notifications/**/Package.swift'].each do |f| + content = File.read(f) rescue next + url_m = content.match(/\.package\(url:\s*"(https:\/\/github\.com\/firebase\/firebase-ios-sdk[^"]*)"/) + ver_m = content.match(/firebase-ios-sdk[^)]+from:\s*"(\d+)\.(\d+)\.(\d+)"/) + next unless url_m && ver_m + + firebase_url = url_m[1] + major = ver_m[1].to_i + firebase_version = "#{major}.0.0" + puts "Detected firebase-ios-sdk from #{f}: url=#{firebase_url} → using from: \"#{firebase_version}\"" + break +end + +# Fallback — should rarely be needed +unless firebase_url + firebase_url = 'https://github.com/firebase/firebase-ios-sdk.git' + firebase_version = '11.0.0' + puts "Could not detect firebase-ios-sdk version from node_modules — using fallback #{firebase_version}" +end + +firebase_pkg = 'firebase-ios-sdk' + +lines = File.read(CAP_APP_SPM).split("\n") + +# ── 4. Inject firebase-ios-sdk as a direct package dependency if missing ────── +# Normalise URL check to handle both with and without .git suffix +firebase_url_base = firebase_url.sub(/\.git$/, '') +unless lines.any? { |l| l.include?(firebase_url_base) } + last_pkg_idx = lines.rindex { |l| l.include?('.package(') } + if last_pkg_idx + lines[last_pkg_idx] = lines[last_pkg_idx].rstrip + lines[last_pkg_idx] += ',' unless lines[last_pkg_idx].end_with?(',') + lines.insert(last_pkg_idx + 1, + " .package(url: \"#{firebase_url}\", from: \"#{firebase_version}\")") + puts "Added #{firebase_pkg} to CapApp-SPM package dependencies" + else + warn "WARNING: no .package( line found in #{CAP_APP_SPM} — cannot inject dependency" + end +end + +# ── 5. Inject each detected product into the target dependencies if missing ─── +firebase_imports.each do |product| + next if product == 'Firebase' # umbrella import — not a linkable SPM product + + product_str = ".product(name: \"#{product}\", package: \"#{firebase_pkg}\")" + next if lines.any? { |l| l.include?(product_str) } + + last_prod_idx = lines.rindex { |l| l.include?('.product(') } + if last_prod_idx + lines[last_prod_idx] = lines[last_prod_idx].rstrip + lines[last_prod_idx] += ',' unless lines[last_prod_idx].end_with?(',') + lines.insert(last_prod_idx + 1, " #{product_str}") + puts "Added #{product} to CapApp-SPM target dependencies" + else + warn "WARNING: no .product( line found in #{CAP_APP_SPM} — cannot inject #{product}" + end +end + +File.write(CAP_APP_SPM, lines.join("\n")) +puts "CapApp-SPM/Package.swift updated" diff --git a/index.html b/index.html new file mode 100644 index 0000000..e19807b --- /dev/null +++ b/index.html @@ -0,0 +1,28 @@ + + + + + Ionic App + + + + + + + + + + + + + + + + +
+ + + diff --git a/ionic.config.json b/ionic.config.json new file mode 100644 index 0000000..a1d1b22 --- /dev/null +++ b/ionic.config.json @@ -0,0 +1,5 @@ +{ + "name": "app", + "integrations": {}, + "type": "react-vite" +} diff --git a/ios/.DS_Store b/ios/.DS_Store new file mode 100644 index 0000000..b49404c Binary files /dev/null and b/ios/.DS_Store differ diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..f470299 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,13 @@ +App/build +App/Pods +App/output +App/App/public +DerivedData +xcuserdata + +# Cordova plugins for Capacitor +capacitor-cordova-ios-plugins + +# Generated Config files +App/App/capacitor.config.json +App/App/config.xml diff --git a/ios/App/.DS_Store b/ios/App/.DS_Store new file mode 100644 index 0000000..0864069 Binary files /dev/null and b/ios/App/.DS_Store differ diff --git a/ios/App/App.xcodeproj/project.pbxproj b/ios/App/App.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1bfcffd --- /dev/null +++ b/ios/App/App.xcodeproj/project.pbxproj @@ -0,0 +1,380 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 60; + objects = { + +/* Begin PBXBuildFile section */ + 2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; }; + 4D22ABE92AF431CB00220026 /* CapApp-SPM in Frameworks */ = {isa = PBXBuildFile; productRef = 4D22ABE82AF431CB00220026 /* CapApp-SPM */; }; + 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; }; + 504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; }; + 504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; }; + 504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; }; + 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; + 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = ""; }; + 50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = ""; }; + 504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1A4EB3C21FED79650016851F /* App.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = App.entitlements; sourceTree = ""; }; + 50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = ""; }; + 958DCC722DB07C7200EA8C5F /* debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../debug.xcconfig; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 504EC3011FED79650016851F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4D22ABE92AF431CB00220026 /* CapApp-SPM in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 504EC2FB1FED79650016851F = { + isa = PBXGroup; + children = ( + 958DCC722DB07C7200EA8C5F /* debug.xcconfig */, + 504EC3061FED79650016851F /* App */, + 504EC3051FED79650016851F /* Products */, + ); + sourceTree = ""; + }; + 504EC3051FED79650016851F /* Products */ = { + isa = PBXGroup; + children = ( + 504EC3041FED79650016851F /* App.app */, + ); + name = Products; + sourceTree = ""; + }; + 504EC3061FED79650016851F /* App */ = { + isa = PBXGroup; + children = ( + 50379B222058CBB4000EE86E /* capacitor.config.json */, + 504EC3071FED79650016851F /* AppDelegate.swift */, + 504EC30B1FED79650016851F /* Main.storyboard */, + 504EC30E1FED79650016851F /* Assets.xcassets */, + 504EC3101FED79650016851F /* LaunchScreen.storyboard */, + 504EC3131FED79650016851F /* Info.plist */, + 1A4EB3C21FED79650016851F /* App.entitlements */, + 2FAD9762203C412B000D30F8 /* config.xml */, + 50B271D01FEDC1A000F3C39B /* public */, + ); + path = App; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 504EC3031FED79650016851F /* App */ = { + isa = PBXNativeTarget; + buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */; + buildPhases = ( + 504EC3001FED79650016851F /* Sources */, + 504EC3011FED79650016851F /* Frameworks */, + 504EC3021FED79650016851F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = App; + packageProductDependencies = ( + 4D22ABE82AF431CB00220026 /* CapApp-SPM */, + ); + productName = App; + productReference = 504EC3041FED79650016851F /* App.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 504EC2FC1FED79650016851F /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + TargetAttributes = { + 504EC3031FED79650016851F = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 504EC2FB1FED79650016851F; + packageReferences = ( + D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */, + ); + productRefGroup = 504EC3051FED79650016851F /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 504EC3031FED79650016851F /* App */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 504EC3021FED79650016851F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */, + 50B271D11FEDC1A000F3C39B /* public in Resources */, + 504EC30F1FED79650016851F /* Assets.xcassets in Resources */, + 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, + 504EC30D1FED79650016851F /* Main.storyboard in Resources */, + 2FAD9763203C412B000D30F8 /* config.xml in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 504EC3001FED79650016851F /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 504EC3081FED79650016851F /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 504EC30B1FED79650016851F /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 504EC30C1FED79650016851F /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 504EC3101FED79650016851F /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 504EC3111FED79650016851F /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 504EC3141FED79650016851F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 958DCC722DB07C7200EA8C5F /* debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 504EC3151FED79650016851F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 504EC3171FED79650016851F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 958DCC722DB07C7200EA8C5F /* debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App/App.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + INFOPLIST_FILE = App/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; + PRODUCT_BUNDLE_IDENTIFIER = com.kumusha.app; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 504EC3181FED79650016851F /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = App/App.entitlements; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + INFOPLIST_FILE = App/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.kumusha.app; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ""; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 504EC3141FED79650016851F /* Debug */, + 504EC3151FED79650016851F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 504EC3171FED79650016851F /* Debug */, + 504EC3181FED79650016851F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = "CapApp-SPM"; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 4D22ABE82AF431CB00220026 /* CapApp-SPM */ = { + isa = XCSwiftPackageProductDependency; + package = D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */; + productName = "CapApp-SPM"; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 504EC2FC1FED79650016851F /* Project object */; +} diff --git a/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/App/App.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/App/App.xcworkspace/contents.xcworkspacedata b/ios/App/App.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b3795ee --- /dev/null +++ b/ios/App/App.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/App/App/App.entitlements b/ios/App/App/App.entitlements new file mode 100644 index 0000000..6631ffa --- /dev/null +++ b/ios/App/App/App.entitlements @@ -0,0 +1,6 @@ + + + + + + diff --git a/ios/App/App/AppDelegate.swift b/ios/App/App/AppDelegate.swift new file mode 100644 index 0000000..c41136c --- /dev/null +++ b/ios/App/App/AppDelegate.swift @@ -0,0 +1,66 @@ +import UIKit +import Capacitor +import FirebaseCore +import FirebaseMessaging + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + FirebaseApp.configure() + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { + // Called when the app was launched with a url. Feel free to add additional processing here, + // but if you want the App API to support tracking app url opens, make sure to keep this call + return ApplicationDelegateProxy.shared.application(app, open: url, options: options) + } + + func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { + // Called when the app was launched with an activity, including Universal Links. + // Feel free to add additional processing here, but if you want the App API to support + // tracking app url opens, make sure to keep this call + return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler) + } + + func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { + Messaging.messaging().apnsToken = deviceToken + Messaging.messaging().token { token, error in + if let error = error { + NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error) + } else if let token = token { + NotificationCenter.default.post(name: .capacitorDidRegisterForRemoteNotifications, object: token) + } + } + } + + func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { + NotificationCenter.default.post(name: .capacitorDidFailToRegisterForRemoteNotifications, object: error) + } + +} diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png new file mode 100644 index 0000000..adf6ba0 Binary files /dev/null and b/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png differ diff --git a/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9b7d382 --- /dev/null +++ b/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "AppIcon-512@2x.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/App/App/Assets.xcassets/Contents.json b/ios/App/App/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/ios/App/App/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json new file mode 100644 index 0000000..d7d96a6 --- /dev/null +++ b/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "splash-2732x2732-2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "splash-2732x2732-1.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "splash-2732x2732.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png new file mode 100644 index 0000000..33ea6c9 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png new file mode 100644 index 0000000..33ea6c9 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png differ diff --git a/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png new file mode 100644 index 0000000..33ea6c9 Binary files /dev/null and b/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png differ diff --git a/ios/App/App/Base.lproj/LaunchScreen.storyboard b/ios/App/App/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..e7ae5d7 --- /dev/null +++ b/ios/App/App/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/App/App/Base.lproj/Main.storyboard b/ios/App/App/Base.lproj/Main.storyboard new file mode 100644 index 0000000..b44df7b --- /dev/null +++ b/ios/App/App/Base.lproj/Main.storyboard @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/ios/App/App/Info.plist b/ios/App/App/Info.plist new file mode 100644 index 0000000..c6d0684 --- /dev/null +++ b/ios/App/App/Info.plist @@ -0,0 +1,66 @@ + + + + + CAPACITOR_DEBUG + $(CAPACITOR_DEBUG) + CFBundleDevelopmentRegion + en + CFBundleDisplayName + kumusha + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + NSPhotoLibraryUsageDescription + Kumusha needs access to your photo library so you can add profile and recipient photos. + NSCameraUsageDescription + Kumusha needs camera access so you can add profile and recipient photos. + CFBundleURLTypes + + + CFBundleURLName + com.kumusha.app + CFBundleURLSchemes + + com.kumusha.app + + + + + diff --git a/ios/App/CapApp-SPM/.gitignore b/ios/App/CapApp-SPM/.gitignore new file mode 100644 index 0000000..3b29812 --- /dev/null +++ b/ios/App/CapApp-SPM/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/ios/App/CapApp-SPM/Package.swift b/ios/App/CapApp-SPM/Package.swift new file mode 100644 index 0000000..5cde8b6 --- /dev/null +++ b/ios/App/CapApp-SPM/Package.swift @@ -0,0 +1,25 @@ +// swift-tools-version: 5.9 +import PackageDescription + +// DO NOT MODIFY THIS FILE - managed by Capacitor CLI commands +let package = Package( + name: "CapApp-SPM", + platforms: [.iOS(.v15)], + products: [ + .library( + name: "CapApp-SPM", + targets: ["CapApp-SPM"]) + ], + dependencies: [ + .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0") + ], + targets: [ + .target( + name: "CapApp-SPM", + dependencies: [ + .product(name: "Capacitor", package: "capacitor-swift-pm"), + .product(name: "Cordova", package: "capacitor-swift-pm") + ] + ) + ] +) diff --git a/ios/App/CapApp-SPM/README.md b/ios/App/CapApp-SPM/README.md new file mode 100644 index 0000000..03964db --- /dev/null +++ b/ios/App/CapApp-SPM/README.md @@ -0,0 +1,5 @@ +# CapApp-SPM + +This package is used to host SPM dependencies for your Capacitor project + +Do not modify the contents of it or there may be unintended consequences. diff --git a/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift b/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift new file mode 100644 index 0000000..945afec --- /dev/null +++ b/ios/App/CapApp-SPM/Sources/CapApp-SPM/CapApp-SPM.swift @@ -0,0 +1 @@ +public let isCapacitorApp = true diff --git a/ios/debug.xcconfig b/ios/debug.xcconfig new file mode 100644 index 0000000..53ce18d --- /dev/null +++ b/ios/debug.xcconfig @@ -0,0 +1 @@ +CAPACITOR_DEBUG = true diff --git a/package.json b/package.json new file mode 100644 index 0000000..26768e3 --- /dev/null +++ b/package.json @@ -0,0 +1,55 @@ +{ + "name": "app", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint" + }, + "dependencies": { + "@capacitor-firebase/authentication": "^8.0.0", + "@capacitor/android": "8.3.4", + "@capacitor/app": "8.1.0", + "@capacitor/core": "8.3.4", + "@capacitor/google-maps": "^8.0.0", + "@capacitor/haptics": "8.0.2", + "@capacitor/ios": "8.3.4", + "@capacitor/keyboard": "8.0.3", + "@capacitor/preferences": "^8.0.1", + "@capacitor/push-notifications": "^8.1.1", + "@capacitor/status-bar": "8.0.2", + "@hookform/resolvers": "^3.9.0", + "@ionic/pwa-elements": "^3.0.0", + "@ionic/react": "8.8.7", + "@ionic/react-router": "8.8.7", + "@supabase/supabase-js": "^2.108.1", + "firebase": "^11.0.0", + "ionicons": "^7.4.0", + "katex": "^0.16.0", + "qrcode.react": "^4.2.0", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-hook-form": "^7.54.0", + "react-katex": "^3.0.1", + "react-router": "^5.3.4", + "react-router-dom": "^5.3.4", + "zod": "^3.24.0", + "zustand": "^5.0.0" + }, + "devDependencies": { + "@capacitor/cli": "8.3.4", + "@types/katex": "^0.16.0", + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", + "@types/react-router": "^5.1.20", + "@types/react-router-dom": "^5.3.3", + "@vitejs/plugin-react": "^4.0.1", + "terser": "^5.4.0", + "typescript": "~5.9.0", + "vite": "^5.0.0" + }, + "description": "An Ionic project" +} diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..2ce8c03 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "Ionic App", + "name": "My Ionic App", + "icons": [ + { + "src": "assets/icon/favicon.png", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#ffffff", + "background_color": "#ffffff" +} diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..71ce1e6 Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 0000000..93fb14e --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,389 @@ +import React, { useEffect } from 'react'; +import { Redirect, Route, useHistory, useLocation } from 'react-router-dom'; +import { + IonApp, + IonIcon, + IonLabel, + IonRouterOutlet, + IonTabBar, + IonTabButton, + IonTabs, +} from '@ionic/react'; +import { IonReactRouter } from '@ionic/react-router'; +import { Capacitor } from '@capacitor/core'; +import { PushNotifications } from '@capacitor/push-notifications'; +import type { + ActionPerformed, + PushNotificationSchema, +} from '@capacitor/push-notifications'; +import { supabase } from './supabase'; +import { + heart, + heartOutline, + listOutline, + peopleOutline, + personOutline, +} from 'ionicons/icons'; + +import '@ionic/react/css/core.css'; +import '@ionic/react/css/normalize.css'; +import '@ionic/react/css/structure.css'; +import '@ionic/react/css/typography.css'; +import '@ionic/react/css/padding.css'; +import '@ionic/react/css/float-elements.css'; +import '@ionic/react/css/text-alignment.css'; +import '@ionic/react/css/text-transformation.css'; +import '@ionic/react/css/flex-utils.css'; +import '@ionic/react/css/display.css'; +import '@ionic/react/css/palettes/dark.system.css'; +import './theme/variables.css'; + +import { setStatusBarStyle, Style } from './utils/statusBar'; +import { AuthProvider, useAuth } from './contexts/AuthContext'; +import ProtectedRoute from './components/ProtectedRoute'; + +// Auth Pages +import AuthPage from './pages/AuthPage'; +import VerifyEmailPage from './pages/VerifyEmailPage'; +import ForgotPasswordPage from './pages/ForgotPasswordPage'; +import VerifyResetPage from './pages/VerifyResetPage'; +import SetupProfilePage from './pages/SetupProfilePage'; + +// Main App Pages +import HomePage from './pages/HomePage'; +import RecipientsPage from './pages/RecipientsPage'; +import RecipientFormPage from './pages/RecipientFormPage'; +import RecipientDetailPage from './pages/RecipientDetailPage'; +import SupportFlowPage from './pages/SupportFlowPage'; +import OrderDetailPage from './pages/OrderDetailPage'; +import VoucherDetailPage from './pages/VoucherDetailPage'; +import ActivityPage from './pages/ActivityPage'; +import NotificationsPage from './pages/NotificationsPage'; +import ProfilePage from './pages/ProfilePage'; +import EditProfilePage from './pages/EditProfilePage'; + +const BYPASS_AUTH = true; + +const SetupProfileRoute: React.FC = () => { + const { user } = useAuth(); + return ( + + BYPASS_AUTH ? ( + + ) : !user ? ( + + ) : ( + + ) + } + exact + /> + ); +}; + +const SendSupportFab: React.FC = () => { + const history = useHistory(); + const location = useLocation(); + const hiddenPaths = [ + '/auth', + '/verify-email', + '/forgot-password', + '/verify-reset', + '/setup-profile', + '/support/new', + ]; + const showOnPaths = ['/home', '/recipients', '/activity', '/profile']; + const isVisibleRoute = + showOnPaths.includes(location.pathname) || + /^\/recipients\/[0-9a-fA-F-]{36}$/.test(location.pathname); + + if (!isVisibleRoute || hiddenPaths.includes(location.pathname)) return null; + + return ( + + ); +}; + +const PushNotificationHandler: React.FC = () => { + const { user, profile } = useAuth(); + const history = useHistory(); + + useEffect(() => { + if (!Capacitor.isNativePlatform() || !user || !profile) return; + + const setupPush = async () => { + const handleNotificationTap = (notification: PushNotificationSchema) => { + const { orderId, voucherId, screen } = notification.data || {}; + if (voucherId) { + history.push(`/voucher/${voucherId}`, { parentRoot: '/home' }); + } else if (orderId) { + history.push(`/orders/${orderId}`, { parentRoot: '/home' }); + } else if (screen) { + history.push(screen, { parentRoot: '/home' }); + } + }; + + // Capacitor automatically triggers pushNotificationActionPerformed + // for the notification that launched the app once the listener is attached. + + // Check if user has explicitly enabled push notifications + if (!profile.notification_push_enabled) return; + + const status = await PushNotifications.checkPermissions(); + if (status.receive === 'granted') { + await PushNotifications.register(); + } else if (status.receive === 'prompt') { + const result = await PushNotifications.requestPermissions(); + if (result.receive === 'granted') { + await PushNotifications.register(); + } + } + + PushNotifications.addListener('registration', async (token) => { + await supabase + .from('profiles') + .update({ fcm_token: token.value }) + .eq('id', user.id); + }); + + PushNotifications.addListener('registrationError', (err) => { + console.error('Push registration error:', err); + }); + + PushNotifications.addListener('pushNotificationReceived', () => { + // Handled natively via presentationOptions banner + }); + + PushNotifications.addListener( + 'pushNotificationActionPerformed', + (action: ActionPerformed) => { + handleNotificationTap(action.notification); + } + ); + + await PushNotifications.removeAllDeliveredNotifications(); + }; + + setupPush(); + + return () => { + if (Capacitor.isNativePlatform()) { + PushNotifications.removeAllListeners(); + } + }; + }, [user, profile, history]); + + return null; +}; + +const App: React.FC = () => { + useEffect(() => { + setStatusBarStyle(Style.Light); + }, []); + + return ( + + + + + {/* Auth Routes */} + + BYPASS_AUTH ? : + } + exact + /> + + + + + {/* Setup Profile Route - Requires authenticated user but not necessarily complete profile */} + + + {/* Top-level Protected Routes (no tab bar) */} + + + + + BYPASS_AUTH ? ( + + ) : ( + + ) + } + exact + /> + + BYPASS_AUTH ? ( + + ) : ( + + ) + } + exact + /> + + + + + {/* Tab Routes */} + + BYPASS_AUTH ? ( + + + + + + + + + + + + Care + + + + Recipients + + + + + Activity + + + + Profile + + + + ) : ( + ( + + + + + + + + + + + + Care + + + + Recipients + + + + + Activity + + + + Profile + + + + )} + /> + ) + } + /> + + {/* Orders Redirect */} + } + /> + + {/* Root Redirect */} + } + /> + + + + + + + ); +}; + +export default App; diff --git a/src/assets/basket.png b/src/assets/basket.png new file mode 100644 index 0000000..019680d Binary files /dev/null and b/src/assets/basket.png differ diff --git a/src/assets/dad.jpg b/src/assets/dad.jpg new file mode 100644 index 0000000..5638be0 Binary files /dev/null and b/src/assets/dad.jpg differ diff --git a/src/assets/mom.jpg b/src/assets/mom.jpg new file mode 100644 index 0000000..dc87965 Binary files /dev/null and b/src/assets/mom.jpg differ diff --git a/src/assets/pill.png b/src/assets/pill.png new file mode 100644 index 0000000..609daa1 Binary files /dev/null and b/src/assets/pill.png differ diff --git a/src/assets/sarah.jpg b/src/assets/sarah.jpg new file mode 100644 index 0000000..3cc4b10 Binary files /dev/null and b/src/assets/sarah.jpg differ diff --git a/src/components/ActivityListItem.tsx b/src/components/ActivityListItem.tsx new file mode 100644 index 0000000..12c57f3 --- /dev/null +++ b/src/components/ActivityListItem.tsx @@ -0,0 +1,155 @@ +import React from 'react'; +import { IonIcon } from '@ionic/react'; +import { + medkitOutline, + flashOutline, + phonePortraitOutline, + chevronForwardOutline, +} from 'ionicons/icons'; +import momImage from '../assets/mom.jpg'; +import dadImage from '../assets/dad.jpg'; +import basketIcon from '../assets/basket.png'; + +interface ActivityListItemProps { + id: string; + eventType: string; + title: string; + subtitle: string; + amount?: number; + statusText?: string; + statusTone?: 'success' | 'warning' | 'partial'; + avatarLabel?: string; + avatarTone?: string; + avatarImage?: string; + onClick?: (id: string) => void; + onStatusClick?: () => void; +} + +const ActivityListItem: React.FC = ({ + id, + eventType, + title, + subtitle, + amount, + statusText, + statusTone = 'warning', + avatarLabel, + avatarTone = 'brand', + avatarImage, + onClick, + onStatusClick, +}) => { + const getIconAndColor = () => { + if ( + eventType.includes('grocery') || + title.toLowerCase().includes('grocer') + ) { + return { + iconSrc: basketIcon, + badgeClass: 'grocery', + }; + } + if ( + eventType.includes('medication') || + title.toLowerCase().includes('medic') + ) { + return { + icon: medkitOutline, + badgeClass: 'medication', + }; + } + if ( + eventType.includes('airtime') || + title.toLowerCase().includes('airtime') + ) { + return { + icon: phonePortraitOutline, + badgeClass: 'airtime', + }; + } + return { + icon: flashOutline, + badgeClass: 'electricity', + }; + }; + + const { icon, iconSrc, badgeClass } = getIconAndColor(); + + const avatarSearchText = + `${title} ${subtitle} ${avatarLabel ?? ''}`.toLowerCase(); + const resolvedAvatar = + avatarImage ?? + (avatarSearchText.includes('mum') || avatarSearchText.includes('mom') + ? momImage + : avatarSearchText.includes('dad') || avatarSearchText.includes('father') + ? dadImage + : undefined); + + return ( + + )} + + + + + ); +}; + +export default ActivityListItem; diff --git a/src/components/AuthFormFields.tsx b/src/components/AuthFormFields.tsx new file mode 100644 index 0000000..295e361 --- /dev/null +++ b/src/components/AuthFormFields.tsx @@ -0,0 +1,116 @@ +import React, { useState } from 'react'; +import { eyeOffOutline, eyeOutline } from 'ionicons/icons'; +import { IonIcon } from '@ionic/react'; + +interface AuthFormFieldsProps { + mode: 'login' | 'register'; + email: string; + password: string; + confirmPassword?: string; + onEmailChange: (val: string) => void; + onPasswordChange: (val: string) => void; + onConfirmPasswordChange?: (val: string) => void; + errors?: { [key: string]: string }; + disabled?: boolean; +} + +const AuthFormFields: React.FC = ({ + mode, + email, + password, + confirmPassword, + onEmailChange, + onPasswordChange, + onConfirmPasswordChange, + errors = {}, + disabled = false, +}) => { + const [showPassword, setShowPassword] = useState(false); + const [showConfirmPassword, setShowConfirmPassword] = useState(false); + + return ( +
+
+ + onEmailChange(e.target.value)} + disabled={disabled} + placeholder="you@example.com" + autoComplete="email" + /> + {errors.email ? ( +

{errors.email}

+ ) : null} +
+ +
+ +
+ onPasswordChange(e.target.value)} + disabled={disabled} + placeholder="Enter your password" + autoComplete={ + mode === 'login' ? 'current-password' : 'new-password' + } + /> + +
+ {errors.password ? ( +

{errors.password}

+ ) : null} +
+ + {mode === 'register' && onConfirmPasswordChange && ( +
+ +
+ onConfirmPasswordChange(e.target.value)} + disabled={disabled} + placeholder="Re-enter your password" + autoComplete="new-password" + /> + +
+ {errors.confirmPassword ? ( +

{errors.confirmPassword}

+ ) : null} +
+ )} +
+ ); +}; + +export default AuthFormFields; diff --git a/src/components/AvatarPicker.tsx b/src/components/AvatarPicker.tsx new file mode 100644 index 0000000..a128907 --- /dev/null +++ b/src/components/AvatarPicker.tsx @@ -0,0 +1,121 @@ +import React, { useRef } from 'react'; +import { IonIcon } from '@ionic/react'; +import { camera, personOutline } from 'ionicons/icons'; + +interface AvatarPickerProps { + previewUrl: string | null; + onFileChange: (e: React.ChangeEvent) => void; + initials?: string; + disabled?: boolean; +} + +const AvatarPicker: React.FC = ({ + previewUrl, + onFileChange, + initials, + disabled = false, +}) => { + const fileInputRef = useRef(null); + + const handleClick = () => { + if (!disabled) { + fileInputRef.current?.click(); + } + }; + + return ( +
+ + +
+ ); +}; + +export default AvatarPicker; diff --git a/src/components/CareAlertPill.tsx b/src/components/CareAlertPill.tsx new file mode 100644 index 0000000..d30d538 --- /dev/null +++ b/src/components/CareAlertPill.tsx @@ -0,0 +1,88 @@ +import React from 'react'; +import { IonIcon } from '@ionic/react'; +import { + chevronForwardOutline, + timeOutline, + flashOutline, + wifiOutline, + medkitOutline, +} from 'ionicons/icons'; + +interface CareAlertPillProps { + id: string; + type: string; + title: string; + severity: 'warning' | 'neutral'; + onClick: (id: string) => void; +} + +const CareAlertPill: React.FC = ({ + id, + type, + title, + severity, + onClick, +}) => { + const getIconForType = () => { + switch (type) { + case 'electricity_low': + return flashOutline; + case 'airtime_expiring': + return wifiOutline; + case 'medication_due': + return medkitOutline; + default: + return timeOutline; + } + }; + + const getColors = () => { + if (severity === 'warning') { + return { bg: 'rgba(245,158,11,0.08)', icon: '#f59e0b', text: '#111827' }; + } + return { bg: '#ffffff', icon: '#6d28d9', text: '#111827' }; + }; + + const colors = getColors(); + + return ( + + ); +}; + +export default CareAlertPill; diff --git a/src/components/DashboardSkeleton.tsx b/src/components/DashboardSkeleton.tsx new file mode 100644 index 0000000..59428a0 --- /dev/null +++ b/src/components/DashboardSkeleton.tsx @@ -0,0 +1,246 @@ +import React from 'react'; +import { IonSkeletonText } from '@ionic/react'; + +const DashboardSkeleton: React.FC = () => { + return ( +
+ {/* Top Greeting Row */} +
+
+ +
+ + +
+
+
+ + {/* Loved Ones Carousel */} +
+
+
+ +
+ + +
+
+ + +
+
+
+ +
+ + +
+
+ + +
+
+ + {/* Quick Actions */} +
+ +
+ {[1, 2, 3, 4].map((i) => ( +
+ + +
+ ))} +
+
+ + {/* Activity List */} +
+ +
+ {[1, 2, 3].map((i) => ( +
+ +
+ + +
+
+ ))} +
+
+
+ ); +}; + +export default DashboardSkeleton; diff --git a/src/components/ListSearchRow.tsx b/src/components/ListSearchRow.tsx new file mode 100644 index 0000000..828ebaa --- /dev/null +++ b/src/components/ListSearchRow.tsx @@ -0,0 +1,86 @@ +import React from 'react'; +import { IonIcon } from '@ionic/react'; +import { searchOutline, optionsOutline } from 'ionicons/icons'; + +interface ListSearchRowProps { + value: string; + onChange: (val: string) => void; + placeholder?: string; + onFilterClick?: () => void; + showFilter?: boolean; +} + +const ListSearchRow: React.FC = ({ + value, + onChange, + placeholder = 'Search...', + onFilterClick, + showFilter = false, +}) => { + return ( +
+
+ + onChange(e.target.value)} + placeholder={placeholder} + style={{ + flex: 1, + border: 'none', + outline: 'none', + backgroundColor: 'transparent', + padding: '0 12px', + fontSize: '15px', + color: '#111827', + }} + /> +
+ {showFilter && ( + + )} +
+ ); +}; + +export default ListSearchRow; diff --git a/src/components/OrderSummaryCard.tsx b/src/components/OrderSummaryCard.tsx new file mode 100644 index 0000000..b6ebb2e --- /dev/null +++ b/src/components/OrderSummaryCard.tsx @@ -0,0 +1,210 @@ +import React from 'react'; +import { IonIcon } from '@ionic/react'; +import { + chevronForwardOutline, + checkmarkCircleOutline, + timeOutline, + closeCircleOutline, +} from 'ionicons/icons'; + +export interface OrderSummary { + id: string; + recipientName: string; + serviceType: string; + merchantName?: string; + amount: number; + amountLabel?: string; + status: string; + createdAt: string; + avatarUrl?: string | null; +} + +interface OrderSummaryCardProps { + order: OrderSummary; + onClick: (id: string) => void; +} + +const OrderSummaryCard: React.FC = ({ + order, + onClick, +}) => { + const getStatusDisplay = (status: string) => { + switch (status) { + case 'paid': + return { + text: 'Paid', + color: '#3b82f6', + bg: 'rgba(59,130,246,0.1)', + icon: checkmarkCircleOutline, + }; + case 'ready_for_redemption': + return { + text: 'Ready', + color: '#16a34a', + bg: 'rgba(22,163,74,0.1)', + icon: checkmarkCircleOutline, + }; + case 'redeemed': + return { + text: 'Redeemed', + color: '#16a34a', + bg: 'rgba(22,163,74,0.1)', + icon: checkmarkCircleOutline, + }; + case 'delivered': + return { + text: 'Delivered', + color: '#16a34a', + bg: 'rgba(22,163,74,0.1)', + icon: checkmarkCircleOutline, + }; + case 'pending_payment': + return { + text: 'Pending', + color: '#f59e0b', + bg: 'rgba(245,158,11,0.1)', + icon: timeOutline, + }; + case 'failed': + case 'cancelled': + return { + text: 'Failed', + color: '#ef4444', + bg: 'rgba(239,68,68,0.1)', + icon: closeCircleOutline, + }; + default: + return { + text: status, + color: '#6b7280', + bg: '#f3f4f6', + icon: timeOutline, + }; + } + }; + + const statusDisplay = getStatusDisplay(order.status); + + return ( +
onClick(order.id)} + style={{ + display: 'flex', + alignItems: 'center', + backgroundColor: '#ffffff', + borderRadius: '24px', + padding: '16px', + margin: '0 20px 12px', + gap: '14px', + cursor: 'pointer', + }} + > +
+ {order.avatarUrl ? ( + {order.recipientName} + ) : ( + + {order.recipientName.charAt(0)} + + )} +
+
+
+ {order.serviceType} for {order.recipientName} +
+
+ {order.merchantName || 'Service provider'} +
+
+ {new Date(order.createdAt).toLocaleDateString()} +
+
+
+ + {order.amountLabel ?? `${order.amount.toFixed(2)}`} + +
+ + {statusDisplay.text} + + +
+
+ +
+ ); +}; + +export default OrderSummaryCard; diff --git a/src/components/OtpInputSlots.tsx b/src/components/OtpInputSlots.tsx new file mode 100644 index 0000000..924a99d --- /dev/null +++ b/src/components/OtpInputSlots.tsx @@ -0,0 +1,82 @@ +import React, { useRef } from 'react'; + +interface OtpInputSlotsProps { + value: string[]; + onChange: (index: number, val: string) => void; + onPaste: (e: React.ClipboardEvent) => void; + disabled?: boolean; +} + +const OtpInputSlots: React.FC = ({ + value, + onChange, + onPaste, + disabled = false, +}) => { + const inputRefs = useRef<(HTMLInputElement | null)[]>([]); + + const handleKeyDown = ( + index: number, + e: React.KeyboardEvent + ) => { + if (e.key === 'Backspace' && value[index] === '') { + if (index > 0) { + inputRefs.current[index - 1]?.focus(); + } + } + }; + + const handleInput = ( + index: number, + e: React.ChangeEvent + ) => { + const val = e.target.value.replace(/[^0-9]/g, ''); + const lastChar = val.slice(-1); + + onChange(index, lastChar); + + if (lastChar && index < 5) { + inputRefs.current[index + 1]?.focus(); + } + }; + + return ( +
+ {[0, 1, 2, 3, 4, 5].map((index) => ( + { + inputRefs.current[index] = el; + }} + type="text" + inputMode="numeric" + pattern="[0-9]*" + maxLength={1} + value={value[index] || ''} + onChange={(e) => handleInput(index, e)} + onKeyDown={(e) => handleKeyDown(index, e)} + onPaste={onPaste} + disabled={disabled} + style={{ + width: '44px', + height: '56px', + textAlign: 'center', + fontSize: '24px', + fontWeight: '700', + color: value[index] ? '#6d28d9' : '#111827', + backgroundColor: value[index] ? 'rgba(109,40,217,0.08)' : '#fafafa', + border: 'none', + borderRadius: '12px', + outline: 'none', + }} + className="otp-slot" + /> + ))} +
+ ); +}; + +export default OtpInputSlots; diff --git a/src/components/ProtectedRoute.tsx b/src/components/ProtectedRoute.tsx new file mode 100644 index 0000000..8f8308f --- /dev/null +++ b/src/components/ProtectedRoute.tsx @@ -0,0 +1,66 @@ +import React from 'react'; +import { Route, Redirect } from 'react-router-dom'; +import { IonContent, IonPage, IonSpinner } from '@ionic/react'; +import { useAuth } from '../contexts/AuthContext'; + +interface Props { + component: React.ComponentType; + path: string | string[]; + exact?: boolean; +} + +const BYPASS_AUTH = true; + +const ProtectedRouteLoader: React.FC = () => ( + + +
+ + Loading your profile... +
+
+
+); + +const ProtectedRoute: React.FC = ({ component: Component, ...rest }) => { + const { user, profileStatus } = useAuth(); + + return ( + { + if (BYPASS_AUTH) { + return ; + } + if (!user) { + return ; + } + if (profileStatus === 'loading') { + return ; + } + if (profileStatus === 'missing') { + return ; + } + return ; + }} + /> + ); +}; + +export default ProtectedRoute; diff --git a/src/components/QuickSupportActionCard.tsx b/src/components/QuickSupportActionCard.tsx new file mode 100644 index 0000000..16d430e --- /dev/null +++ b/src/components/QuickSupportActionCard.tsx @@ -0,0 +1,94 @@ +import React from 'react'; +import { IonIcon } from '@ionic/react'; +import { + cartOutline, + medkitOutline, + phonePortraitOutline, + flashOutline, +} from 'ionicons/icons'; + +interface QuickSupportActionCardProps { + serviceType: 'grocery' | 'medication' | 'airtime' | 'electricity'; + label: string; + onClick: () => void; +} + +const QuickSupportActionCard: React.FC = ({ + serviceType, + label, + onClick, +}) => { + const getIconAndColor = () => { + switch (serviceType) { + case 'grocery': + return { + icon: cartOutline, + color: '#6d28d9', + bg: 'rgba(109,40,217,0.1)', + }; + case 'medication': + return { + icon: medkitOutline, + color: '#ef4444', + bg: 'rgba(239,68,68,0.1)', + }; + case 'airtime': + return { + icon: phonePortraitOutline, + color: '#3b82f6', + bg: 'rgba(59,130,246,0.1)', + }; + case 'electricity': + return { + icon: flashOutline, + color: '#f59e0b', + bg: 'rgba(245,158,11,0.1)', + }; + default: + return { + icon: cartOutline, + color: '#6d28d9', + bg: 'rgba(109,40,217,0.1)', + }; + } + }; + + const { icon, color, bg } = getIconAndColor(); + + return ( + + ); +}; + +export default QuickSupportActionCard; diff --git a/src/components/RecipientCareCard.tsx b/src/components/RecipientCareCard.tsx new file mode 100644 index 0000000..2c7d9de --- /dev/null +++ b/src/components/RecipientCareCard.tsx @@ -0,0 +1,239 @@ +import React from 'react'; +import { IonIcon } from '@ionic/react'; +import { + cartOutline, + medkitOutline, + flashOutline, + timeOutline, + checkmarkCircleOutline, + ellipsisVertical, +} from 'ionicons/icons'; + +export interface CareStatus { + serviceType: 'grocery' | 'medication' | 'electricity' | 'airtime'; + label: string; + statusText: string; + isOk: boolean; +} + +export interface RecipientSummary { + id: string; + firstName: string; + lastName: string; + location: string; + avatarUrl: string | null; + statuses: CareStatus[]; +} + +interface RecipientCareCardProps { + recipient: RecipientSummary; + onSendSupport: (id: string) => void; + onMenuClick?: (id: string) => void; +} + +const getIconForService = (type: string) => { + switch (type) { + case 'grocery': + return cartOutline; + case 'medication': + return medkitOutline; + case 'electricity': + return flashOutline; + default: + return cartOutline; + } +}; + +const getColorForService = (type: string) => { + switch (type) { + case 'grocery': + return '#6d28d9'; + case 'medication': + return '#ef4444'; + case 'electricity': + return '#f59e0b'; + default: + return '#3b82f6'; + } +}; + +const RecipientCareCard: React.FC = ({ + recipient, + onSendSupport, + onMenuClick, +}) => { + return ( +
+
+
+
+ {recipient.avatarUrl ? ( + {recipient.firstName} + ) : ( + + {recipient.firstName.charAt(0)} + + )} +
+
+
+

+ {recipient.firstName} +

+
+
+

+ {recipient.location} +

+
+
+ +
+ +
+ {recipient.statuses.map((status, idx) => ( +
+
+ +
+
+ {status.label} +
+
+ {status.statusText} +
+
+
+ +
+ ))} +
+ + +
+ ); +}; + +export default RecipientCareCard; diff --git a/src/components/RecipientListCard.tsx b/src/components/RecipientListCard.tsx new file mode 100644 index 0000000..802f156 --- /dev/null +++ b/src/components/RecipientListCard.tsx @@ -0,0 +1,117 @@ +import React from 'react'; +import { IonIcon } from '@ionic/react'; +import { chevronForwardOutline } from 'ionicons/icons'; + +export interface RecipientListItem { + id: string; + firstName: string; + lastName: string; + relationship: string; + location: string; + lastActivityText?: string; + avatarUrl: string | null; +} + +interface RecipientListCardProps { + recipient: RecipientListItem; + onClick: (id: string) => void; +} + +const RecipientListCard: React.FC = ({ + recipient, + onClick, +}) => { + return ( +
onClick(recipient.id)} + style={{ + display: 'flex', + alignItems: 'center', + backgroundColor: '#ffffff', + borderRadius: '24px', + padding: '16px', + margin: '0 20px 12px', + gap: '14px', + cursor: 'pointer', + }} + > +
+ {recipient.avatarUrl ? ( + {recipient.firstName} + ) : ( + + {recipient.firstName.charAt(0)} + + )} +
+
+
+

+ {recipient.firstName} {recipient.lastName} +

+ + {recipient.relationship} + +
+
+ {recipient.location} +
+ {recipient.lastActivityText && ( +
+ Last activity: {recipient.lastActivityText} +
+ )} +
+ +
+ ); +}; + +export default RecipientListCard; diff --git a/src/components/SettingsRow.tsx b/src/components/SettingsRow.tsx new file mode 100644 index 0000000..7a96e51 --- /dev/null +++ b/src/components/SettingsRow.tsx @@ -0,0 +1,115 @@ +import React from 'react'; +import { IonIcon, IonToggle } from '@ionic/react'; +import { chevronForwardOutline } from 'ionicons/icons'; + +interface SettingsRowProps { + icon: string; + iconColor?: string; + iconBg?: string; + title: string; + subtitle?: string; + onClick?: () => void; + type?: 'link' | 'toggle' | 'button'; + checked?: boolean; + onToggle?: (checked: boolean) => void; + destructive?: boolean; +} + +const SettingsRow: React.FC = ({ + icon, + iconColor = '#6d28d9', + iconBg = 'rgba(109,40,217,0.1)', + title, + subtitle, + onClick, + type = 'link', + checked = false, + onToggle, + destructive = false, +}) => { + const content = ( + <> +
+ +
+
+
+ {title} +
+ {subtitle && ( +
+ {subtitle} +
+ )} +
+ {type === 'link' && ( + + )} + {type === 'toggle' && ( + onToggle && onToggle(e.detail.checked)} + style={{ padding: 0 }} + /> + )} + + ); + + const containerStyle: React.CSSProperties = { + display: 'flex', + alignItems: 'center', + padding: '12px 16px', + gap: '14px', + minHeight: '56px', + cursor: onClick || type === 'toggle' ? 'pointer' : 'default', + backgroundColor: 'transparent', + border: 'none', + width: '100%', + textAlign: 'left', + }; + + if (type === 'link' || type === 'button') { + return ( + + ); + } + + return
{content}
; +}; + +export default SettingsRow; diff --git a/src/components/SocialAuthButton.tsx b/src/components/SocialAuthButton.tsx new file mode 100644 index 0000000..88d81c2 --- /dev/null +++ b/src/components/SocialAuthButton.tsx @@ -0,0 +1,55 @@ +import React from 'react'; + +interface SocialAuthButtonProps { + provider: 'google' | 'apple'; + label: string; + onClick: () => void; + disabled?: boolean; +} + +const SocialAuthButton: React.FC = ({ + provider, + label, + onClick, + disabled = false, +}) => { + return ( + + ); +}; + +export default SocialAuthButton; diff --git a/src/contexts/AuthContext.tsx b/src/contexts/AuthContext.tsx new file mode 100644 index 0000000..ff2b5f9 --- /dev/null +++ b/src/contexts/AuthContext.tsx @@ -0,0 +1,293 @@ +import React, { + createContext, + useCallback, + useContext, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; +import type { User } from '@supabase/supabase-js'; +import { supabase } from '../supabase'; + +export interface Profile { + id: string; + first_name: string; + last_name: string; + full_name: string; + phone: string; + country_of_residence: string; + avatar_path: string | null; + fcm_token: string | null; + notification_push_enabled: boolean; + notification_email_enabled: boolean; + notification_sms_enabled: boolean; + created_at: string; + updated_at: string; +} + +export type ProfileStatus = 'idle' | 'loading' | 'loaded' | 'missing' | 'error'; + +interface AuthContextType { + user: User | null; + profile: Profile | null; + profileStatus: ProfileStatus; + refreshProfile: () => Promise; + setProfile: (profile: Profile | null) => void; + signOut: () => Promise; +} + +const BYPASS_AUTH = true; + +const AuthContext = createContext({ + user: null, + profile: null, + profileStatus: BYPASS_AUTH ? 'idle' : 'loading', + refreshProfile: async () => null, + setProfile: () => {}, + signOut: async () => {}, +}); + +const withTimeout = async ( + request: PromiseLike, + timeoutMs: number, + label: string +): Promise => { + let timeoutId: ReturnType | undefined; + + const timeout = new Promise((_, reject) => { + timeoutId = setTimeout(() => { + reject( + new Error( + `${label} timed out. Please check your connection and try again.` + ) + ); + }, timeoutMs); + }); + + try { + return await Promise.race([Promise.resolve(request), timeout]); + } finally { + if (timeoutId) clearTimeout(timeoutId); + } +}; + +export const useAuth = () => useContext(AuthContext); + +export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ + children, +}) => { + const [user, setUser] = useState(null); + const [profile, setProfileState] = useState(null); + const [profileStatus, setProfileStatus] = useState( + BYPASS_AUTH ? 'idle' : 'loading' + ); + const [initializing, setInitializing] = useState(!BYPASS_AUTH); + const activeProfileFetchRef = useRef(0); + const mountedRef = useRef(false); + const currentUserIdRef = useRef(null); + + const applyProfile = useCallback((nextProfile: Profile | null) => { + if (!mountedRef.current) return; + setProfileState(nextProfile); + setProfileStatus(nextProfile ? 'loaded' : 'missing'); + }, []); + + const setProfile = useCallback( + (nextProfile: Profile | null) => { + activeProfileFetchRef.current += 1; + applyProfile(nextProfile); + }, + [applyProfile] + ); + + const fetchProfile = useCallback( + async ( + userId: string, + options?: { showLoading?: boolean } + ): Promise => { + const fetchId = activeProfileFetchRef.current + 1; + activeProfileFetchRef.current = fetchId; + + if ((options?.showLoading ?? true) && mountedRef.current) { + setProfileStatus('loading'); + } + + try { + const { data, error } = await withTimeout( + supabase.from('profiles').select('*').eq('id', userId).maybeSingle(), + 8000, + 'Profile loading' + ); + + if ( + !mountedRef.current || + fetchId !== activeProfileFetchRef.current || + currentUserIdRef.current !== userId + ) { + return data ? (data as Profile) : null; + } + + if (error) { + console.error('[AuthProvider] Failed to fetch profile', error); + setProfileState(null); + setProfileStatus('error'); + return null; + } + + const nextProfile = data ? (data as Profile) : null; + applyProfile(nextProfile); + return nextProfile; + } catch (error) { + if ( + mountedRef.current && + fetchId === activeProfileFetchRef.current && + currentUserIdRef.current === userId + ) { + console.error('[AuthProvider] Profile fetch crashed', error); + setProfileState(null); + setProfileStatus('error'); + } + return null; + } + }, + [applyProfile] + ); + + useEffect(() => { + mountedRef.current = true; + + if (BYPASS_AUTH) { + setInitializing(false); + setProfileStatus('idle'); + return () => { + mountedRef.current = false; + activeProfileFetchRef.current += 1; + }; + } + + let cancelled = false; + + supabase.auth + .getSession() + .then(({ data }) => { + if (cancelled || !mountedRef.current) return; + const currentUser = data.session?.user ?? null; + currentUserIdRef.current = currentUser?.id ?? null; + setUser(currentUser); + }) + .catch((error) => { + console.error('[AuthProvider] Failed to initialise session', error); + if (!cancelled && mountedRef.current) { + currentUserIdRef.current = null; + setUser(null); + setProfileState(null); + setProfileStatus('missing'); + } + }) + .finally(() => { + if (!cancelled && mountedRef.current) { + setInitializing(false); + } + }); + + const { + data: { subscription }, + } = supabase.auth.onAuthStateChange((_event, session) => { + const nextUser = session?.user ?? null; + + // Supabase warns against running additional async Supabase calls directly + // inside onAuthStateChange. Keep this callback synchronous and let the + // profile-loading effect below react to the user change. Deferring the + // state write also prevents auth event deadlocks during sign-in. + setTimeout(() => { + if (!mountedRef.current) return; + currentUserIdRef.current = nextUser?.id ?? null; + setUser(nextUser); + }, 0); + }); + + return () => { + cancelled = true; + mountedRef.current = false; + activeProfileFetchRef.current += 1; + subscription.unsubscribe(); + }; + }, []); + + useEffect(() => { + if (BYPASS_AUTH || initializing) return; + + if (!user) { + activeProfileFetchRef.current += 1; + currentUserIdRef.current = null; + setProfileState(null); + setProfileStatus('missing'); + return; + } + + currentUserIdRef.current = user.id; + void fetchProfile(user.id, { showLoading: true }); + }, [fetchProfile, initializing, user?.id]); + + const signOut = useCallback(async () => { + activeProfileFetchRef.current += 1; + setProfileState(null); + setProfileStatus('missing'); + await supabase.auth.signOut(); + }, []); + + const refreshProfile = useCallback(() => { + return user + ? fetchProfile(user.id, { showLoading: false }) + : Promise.resolve(null); + }, [fetchProfile, user]); + + const contextValue = useMemo( + () => ({ + user, + profile, + profileStatus, + refreshProfile, + setProfile, + signOut, + }), + [profile, profileStatus, refreshProfile, setProfile, signOut, user] + ); + + if (initializing) { + return ( +
+
+ +
+ ); + } + + return ( + {children} + ); +}; diff --git a/src/database.types.ts b/src/database.types.ts new file mode 100644 index 0000000..f82126b --- /dev/null +++ b/src/database.types.ts @@ -0,0 +1,676 @@ +export type Json = + | string + | number + | boolean + | null + | { [key: string]: Json | undefined } + | Json[] + +export type Database = { + // Allows to automatically instantiate createClient with right options + // instead of createClient(URL, KEY) + __InternalSupabase: { + PostgrestVersion: "14.5" + } + public: { + Tables: { + activity_events: { + Row: { + amount: number | null + created_at: string + event_at: string + event_type: string + id: string + metadata: Json + order_id: string | null + recipient_id: string | null + subtitle: string + title: string + user_id: string + } + Insert: { + amount?: number | null + created_at?: string + event_at?: string + event_type: string + id?: string + metadata?: Json + order_id?: string | null + recipient_id?: string | null + subtitle: string + title: string + user_id: string + } + Update: { + amount?: number | null + created_at?: string + event_at?: string + event_type?: string + id?: string + metadata?: Json + order_id?: string | null + recipient_id?: string | null + subtitle?: string + title?: string + user_id?: string + } + Relationships: [] + } + care_alerts: { + Row: { + alert_type: string + body: string + created_at: string + dismissed_at: string | null + due_at: string | null + id: string + recipient_id: string + schedule_id: string | null + service_type: string | null + severity: string + title: string + user_id: string + } + Insert: { + alert_type: string + body: string + created_at?: string + dismissed_at?: string | null + due_at?: string | null + id?: string + recipient_id: string + schedule_id?: string | null + service_type?: string | null + severity: string + title: string + user_id: string + } + Update: { + alert_type?: string + body?: string + created_at?: string + dismissed_at?: string | null + due_at?: string | null + id?: string + recipient_id?: string + schedule_id?: string | null + service_type?: string | null + severity?: string + title?: string + user_id?: string + } + Relationships: [ + { + foreignKeyName: "care_alerts_schedule_id_fkey" + columns: ["schedule_id"] + isOneToOne: false + referencedRelation: "support_schedules" + referencedColumns: ["id"] + }, + ] + } + merchants: { + Row: { + branch_name: string | null + city: string + country: string + created_at: string + id: string + is_active: boolean + merchant_type: string + name: string + } + Insert: { + branch_name?: string | null + city: string + country: string + created_at?: string + id?: string + is_active?: boolean + merchant_type: string + name: string + } + Update: { + branch_name?: string | null + city?: string + country?: string + created_at?: string + id?: string + is_active?: boolean + merchant_type?: string + name?: string + } + Relationships: [] + } + notifications: { + Row: { + body: string + created_at: string + id: string + order_id: string | null + priority: string + read_at: string | null + recipient_id: string | null + title: string + type: string + user_id: string + voucher_id: string | null + } + Insert: { + body: string + created_at?: string + id?: string + order_id?: string | null + priority: string + read_at?: string | null + recipient_id?: string | null + title: string + type: string + user_id: string + voucher_id?: string | null + } + Update: { + body?: string + created_at?: string + id?: string + order_id?: string | null + priority?: string + read_at?: string | null + recipient_id?: string | null + title?: string + type?: string + user_id?: string + voucher_id?: string | null + } + Relationships: [ + { + foreignKeyName: "notifications_voucher_id_fkey" + columns: ["voucher_id"] + isOneToOne: false + referencedRelation: "vouchers" + referencedColumns: ["id"] + }, + ] + } + payment_methods: { + Row: { + brand: string | null + created_at: string + expiry_month: number | null + expiry_year: number | null + id: string + is_default: boolean + last4: string | null + provider: string + user_id: string + } + Insert: { + brand?: string | null + created_at?: string + expiry_month?: number | null + expiry_year?: number | null + id?: string + is_default?: boolean + last4?: string | null + provider: string + user_id: string + } + Update: { + brand?: string | null + created_at?: string + expiry_month?: number | null + expiry_year?: number | null + id?: string + is_default?: boolean + last4?: string | null + provider?: string + user_id?: string + } + Relationships: [] + } + profiles: { + Row: { + avatar_path: string | null + country_of_residence: string + created_at: string + fcm_token: string | null + first_name: string + full_name: string + id: string + last_name: string + notification_email_enabled: boolean + notification_push_enabled: boolean + notification_sms_enabled: boolean + phone: string + updated_at: string + } + Insert: { + avatar_path?: string | null + country_of_residence: string + created_at?: string + fcm_token?: string | null + first_name: string + full_name: string + id: string + last_name: string + notification_email_enabled?: boolean + notification_push_enabled?: boolean + notification_sms_enabled?: boolean + phone: string + updated_at?: string + } + Update: { + avatar_path?: string | null + country_of_residence?: string + created_at?: string + fcm_token?: string | null + first_name?: string + full_name?: string + id?: string + last_name?: string + notification_email_enabled?: boolean + notification_push_enabled?: boolean + notification_sms_enabled?: boolean + phone?: string + updated_at?: string + } + Relationships: [] + } + recipients: { + Row: { + city: string + country: string + created_at: string + first_name: string + id: string + is_active: boolean + last_name: string + mobile_number: string + photo_path: string | null + relationship: string + updated_at: string + user_id: string + } + Insert: { + city: string + country: string + created_at?: string + first_name: string + id?: string + is_active?: boolean + last_name: string + mobile_number: string + photo_path?: string | null + relationship: string + updated_at?: string + user_id: string + } + Update: { + city?: string + country?: string + created_at?: string + first_name?: string + id?: string + is_active?: boolean + last_name?: string + mobile_number?: string + photo_path?: string | null + relationship?: string + updated_at?: string + user_id?: string + } + Relationships: [] + } + support_orders: { + Row: { + amount: number + created_at: string + currency: string + delivery_channel: string + id: string + merchant_id: string | null + meter_number: string | null + network: string | null + note: string | null + payment_method: string | null + platform_fee: number + recipient_id: string + recurring_schedule_id: string | null + service_type: string + status: string + total_amount: number + updated_at: string + user_id: string + } + Insert: { + amount: number + created_at?: string + currency?: string + delivery_channel?: string + id?: string + merchant_id?: string | null + meter_number?: string | null + network?: string | null + note?: string | null + payment_method?: string | null + platform_fee: number + recipient_id: string + recurring_schedule_id?: string | null + service_type: string + status: string + total_amount: number + updated_at?: string + user_id: string + } + Update: { + amount?: number + created_at?: string + currency?: string + delivery_channel?: string + id?: string + merchant_id?: string | null + meter_number?: string | null + network?: string | null + note?: string | null + payment_method?: string | null + platform_fee?: number + recipient_id?: string + recurring_schedule_id?: string | null + service_type?: string + status?: string + total_amount?: number + updated_at?: string + user_id?: string + } + Relationships: [ + { + foreignKeyName: "support_orders_merchant_id_fkey" + columns: ["merchant_id"] + isOneToOne: false + referencedRelation: "merchants" + referencedColumns: ["id"] + }, + { + foreignKeyName: "support_orders_recipient_id_fkey" + columns: ["recipient_id"] + isOneToOne: false + referencedRelation: "recipients" + referencedColumns: ["id"] + }, + { + foreignKeyName: "support_orders_recurring_schedule_id_fkey" + columns: ["recurring_schedule_id"] + isOneToOne: false + referencedRelation: "support_schedules" + referencedColumns: ["id"] + }, + ] + } + support_schedules: { + Row: { + created_at: string | null + frequency_interval: number + frequency_unit: string + id: string + is_active: boolean + last_supported_at: string | null + next_due_at: string + recipient_id: string + service_type: string + updated_at: string | null + user_id: string + } + Insert: { + created_at?: string | null + frequency_interval: number + frequency_unit: string + id?: string + is_active?: boolean + last_supported_at?: string | null + next_due_at: string + recipient_id: string + service_type: string + updated_at?: string | null + user_id: string + } + Update: { + created_at?: string | null + frequency_interval?: number + frequency_unit?: string + id?: string + is_active?: boolean + last_supported_at?: string | null + next_due_at?: string + recipient_id?: string + service_type?: string + updated_at?: string | null + user_id?: string + } + Relationships: [ + { + foreignKeyName: "support_schedules_recipient_id_fkey" + columns: ["recipient_id"] + isOneToOne: false + referencedRelation: "recipients" + referencedColumns: ["id"] + }, + ] + } + voucher_redemptions: { + Row: { + created_at: string + id: string + merchant_id: string + order_id: string + receipt_reference: string | null + redeemed_amount: number + redeemed_at: string + voucher_id: string + } + Insert: { + created_at?: string + id?: string + merchant_id: string + order_id: string + receipt_reference?: string | null + redeemed_amount: number + redeemed_at?: string + voucher_id: string + } + Update: { + created_at?: string + id?: string + merchant_id?: string + order_id?: string + receipt_reference?: string | null + redeemed_amount?: number + redeemed_at?: string + voucher_id?: string + } + Relationships: [ + { + foreignKeyName: "voucher_redemptions_voucher_id_fkey" + columns: ["voucher_id"] + isOneToOne: false + referencedRelation: "vouchers" + referencedColumns: ["id"] + }, + ] + } + vouchers: { + Row: { + created_at: string + expires_at: string + id: string + order_id: string + qr_payload: string + redeemed_at: string | null + redeemed_merchant_id: string | null + status: string + voucher_code: string + voucher_type: string + } + Insert: { + created_at?: string + expires_at: string + id?: string + order_id: string + qr_payload: string + redeemed_at?: string | null + redeemed_merchant_id?: string | null + status: string + voucher_code: string + voucher_type: string + } + Update: { + created_at?: string + expires_at?: string + id?: string + order_id?: string + qr_payload?: string + redeemed_at?: string | null + redeemed_merchant_id?: string | null + status?: string + voucher_code?: string + voucher_type?: string + } + Relationships: [] + } + } + Views: { + [_ in never]: never + } + Functions: { + [_ in never]: never + } + Enums: { + [_ in never]: never + } + CompositeTypes: { + [_ in never]: never + } + } +} + +type DatabaseWithoutInternals = Omit + +type DefaultSchema = DatabaseWithoutInternals[Extract] + +export type Tables< + DefaultSchemaTableNameOrOptions extends + | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"]) + | { schema: keyof DatabaseWithoutInternals }, + TableName extends DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & + DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"]) + : never = never, +> = DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] & + DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends { + Row: infer R + } + ? R + : never + : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] & + DefaultSchema["Views"]) + ? (DefaultSchema["Tables"] & + DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends { + Row: infer R + } + ? R + : never + : never + +export type TablesInsert< + DefaultSchemaTableNameOrOptions extends + | keyof DefaultSchema["Tables"] + | { schema: keyof DatabaseWithoutInternals }, + TableName extends DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] + : never = never, +> = DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Insert: infer I + } + ? I + : never + : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] + ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { + Insert: infer I + } + ? I + : never + : never + +export type TablesUpdate< + DefaultSchemaTableNameOrOptions extends + | keyof DefaultSchema["Tables"] + | { schema: keyof DatabaseWithoutInternals }, + TableName extends DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] + : never = never, +> = DefaultSchemaTableNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends { + Update: infer U + } + ? U + : never + : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"] + ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends { + Update: infer U + } + ? U + : never + : never + +export type Enums< + DefaultSchemaEnumNameOrOptions extends + | keyof DefaultSchema["Enums"] + | { schema: keyof DatabaseWithoutInternals }, + EnumName extends DefaultSchemaEnumNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"] + : never = never, +> = DefaultSchemaEnumNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName] + : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"] + ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions] + : never + +export type CompositeTypes< + PublicCompositeTypeNameOrOptions extends + | keyof DefaultSchema["CompositeTypes"] + | { schema: keyof DatabaseWithoutInternals }, + CompositeTypeName extends PublicCompositeTypeNameOrOptions extends { + schema: keyof DatabaseWithoutInternals + } + ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"] + : never = never, +> = PublicCompositeTypeNameOrOptions extends { + schema: keyof DatabaseWithoutInternals +} + ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName] + : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"] + ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions] + : never + +export const Constants = { + public: { + Enums: {}, + }, +} as const diff --git a/src/main.tsx b/src/main.tsx new file mode 100644 index 0000000..7f9c5d2 --- /dev/null +++ b/src/main.tsx @@ -0,0 +1,113 @@ +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import { setupIonicReact } from '@ionic/react'; +import { Capacitor } from '@capacitor/core'; +import App from './App'; + +// ── Ionic initialisation ────────────────────────────────────────────────────── +// ?mode=md|ios overrides (used by Appcakes preview); otherwise follow the platform. +const _urlMode = new URLSearchParams(window.location.search).get('mode'); +const _platform = Capacitor.getPlatform(); // 'ios' | 'android' | 'web' +setupIonicReact({ + mode: (_urlMode === 'md' ? 'md' : _urlMode === 'ios' ? 'ios' : _platform === 'android' ? 'md' : 'ios'), +}); + +// Derive the studio parent origin dynamically so this works in both dev +// (parent at localhost:3000) and production (parent at studio.appcakes.dev). +const studioOrigin = (() => { + try { + if (document.referrer) return new URL(document.referrer).origin; + } catch {} + return 'http://localhost:3000'; +})(); + +// ── Safe area bridge ────────────────────────────────────────────────────────── +// Priority: URL params (first load) → sessionStorage (HMR full-reloads) → postMessage. +// Capacitor sets env() natively in compiled apps; these paths cover the browser preview. +function _applyInsets(sat: string | null, sab: string | null) { + if (sat) { document.documentElement.style.setProperty('--ion-safe-area-top', `${sat}px`); sessionStorage.setItem('__apsuite_sat', sat); } + if (sab) { document.documentElement.style.setProperty('--ion-safe-area-bottom', `${sab}px`); sessionStorage.setItem('__apsuite_sab', sab); } +} + +const _sp = new URLSearchParams(window.location.search); +_applyInsets( + _sp.get('sat') ?? sessionStorage.getItem('__apsuite_sat'), + _sp.get('sab') ?? sessionStorage.getItem('__apsuite_sab'), +); + +window.addEventListener('message', (e) => { + if (e.data?.type !== '__apsuite_insets') return; + const { sat, sab } = e.data as { sat?: number; sab?: number }; + _applyInsets(sat != null ? String(sat) : null, sab != null ? String(sab) : null); +}); + +// Re-apply after React Fast Refresh so insets survive soft HMR cycles. +if (import.meta.hot) { + import.meta.hot.on('vite:afterUpdate', () => { + _applyInsets(sessionStorage.getItem('__apsuite_sat'), sessionStorage.getItem('__apsuite_sab')); + }); +} + +// ── Session bridge ──────────────────────────────────────────────────────────── +// Post auth session to the Appcakes parent frame so the AI can test auth-protected +// Edge Functions. Uses import.meta.glob so Vite never errors if supabase.ts is absent. +(async () => { + const mods = import.meta.glob('./supabase.ts', { eager: false }); + if ('./supabase.ts' in mods) { + try { + const { supabase } = await mods['./supabase.ts']() as { supabase: any }; + // supabase.auth.onAuthStateChange((_event: unknown, session: any) => { + // setTimeout(() => { + // window.parent.postMessage( + // { + // type: '__apsuite_session', + // access_token: session?.access_token ?? null, + // email: session?.user?.email ?? null, + // }, + // studioOrigin, + // ); + // }, 0); + // }); + } catch { + // supabase client failed to initialise — session bridge unavailable + } + } +})(); + +// ── Runtime error reporting ─────────────────────────────────────────────────── +// Forward uncaught errors to the Appcakes dev server so the AI can read them. +// Extract projectId from the preview URL (/preview/{projectId}/) so errors are +// scoped per-project on the server rather than mixed into a global queue. +const _previewMatch = window.location.pathname.match(/\/preview\/([^/]+)/); +const _projectId = _previewMatch?.[1] ?? null; + +function reportError(message: string, stack?: string) { + fetch(`${studioOrigin}/api/agent/runtime-error`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ message, stack, projectId: _projectId }), + }).catch(() => {}); +} + +window.onerror = (_msg, _src, _line, _col, err) => { + reportError(String(_msg), err?.stack); + return false; +}; + +window.addEventListener('unhandledrejection', (e) => { + const err = e.reason as Error | undefined; + reportError(err?.message ?? String(e.reason), err?.stack); +}); + +// ── PWA Elements (Action Sheet, Camera, Toast etc. in browser preview) ──────── +import { defineCustomElements } from '@ionic/pwa-elements/loader'; +defineCustomElements(window); + +// ── App bootstrap ───────────────────────────────────────────────────────────── +const container = document.getElementById('root'); +const root = createRoot(container!); +root.render( + + + , +); diff --git a/src/pages/ActivityPage.tsx b/src/pages/ActivityPage.tsx new file mode 100644 index 0000000..257bbb7 --- /dev/null +++ b/src/pages/ActivityPage.tsx @@ -0,0 +1,684 @@ +import React, { useEffect, useMemo, useState } from 'react'; +import { + IonContent, + IonIcon, + IonPage, + IonRefresher, + IonRefresherContent, + IonSegment, + IonSegmentButton, + IonSkeletonText, + IonLabel, + useIonViewWillEnter, +} from '@ionic/react'; +import { fileTrayOutline } from 'ionicons/icons'; +import momImage from '../assets/mom.jpg'; +import dadImage from '../assets/dad.jpg'; +import { useHistory } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import ActivityListItem from '../components/ActivityListItem'; +import { setStatusBarStyle, Style } from '../utils/statusBar'; +import '../styles/activity.css'; +import '../styles/recipients.css'; + +type RecipientRow = { + id: string; + first_name: string; + last_name: string; + photo_path: string | null; +}; + +type MerchantRow = { + id: string; + name: string; + branch_name: string | null; +}; + +type OrderRow = { + id: string; + service_type: string; + amount: number; + status: string; + created_at: string; + recipient_id: string; + merchant_id: string | null; + recipients: RecipientRow | null; + merchants: MerchantRow | null; +}; + +type VoucherRow = { + id: string; + order_id: string; + status: string; + redeemed_at: string | null; + redeemed_merchant_id: string | null; +}; + +type RedemptionRow = { + id: string; + voucher_id: string; + order_id: string; + merchant_id: string; + redeemed_at: string; +}; + +type ActivityMetadata = { + statusText?: string; + avatarLabel?: string; + avatarTone?: string; + avatarImage?: string; + voucherId?: string; +}; + +type UnifiedActivityItem = { + kind: 'voucher' | 'order'; + id: string; + event_type: string; + service_type: string; + title: string; + subtitle: string; + amount: number | null; + event_at: string; + order_id: string; + metadata: ActivityMetadata; +}; + +type ActivityTypeFilter = + | 'all' + | 'orders' + | 'vouchers' + | 'completed' + | 'alerts'; + +type ActivityFilterRange = '7' | '30' | '90' | 'all'; + +type VoucherActivityStatus = 'created' | 'redeemed' | 'partially'; + +const previewUserId = '00000000-0000-0000-0000-000000000000'; + +const dayLabel = (dateText: string) => { + const date = new Date(dateText); + const today = new Date(); + const yesterday = new Date(); + yesterday.setDate(today.getDate() - 1); + + if (date.toDateString() === today.toDateString()) return 'Today'; + if (date.toDateString() === yesterday.toDateString()) return 'Yesterday'; + return date.toLocaleDateString(undefined, { + month: 'short', + day: 'numeric', + year: 'numeric', + }); +}; + +const getMerchantDisplayName = (merchant?: MerchantRow | null) => { + if (!merchant) return null; + return `${merchant.name}${merchant.branch_name ? ` ${merchant.branch_name}` : ''}`; +}; + +const getActivityContextLabel = ( + serviceType: string, + statusText: string, + merchantName?: string | null +) => { + const normalizedService = getNormalizedServiceType(serviceType); + const normalizedStatus = statusText.toLowerCase(); + + if (normalizedService === 'grocery' || normalizedService === 'medication') { + if (normalizedStatus.includes('redeemed')) { + return merchantName ? `Redeemed at ${merchantName}` : 'Voucher redeemed'; + } + if (normalizedStatus.includes('partial')) { + return merchantName + ? `Partially redeemed at ${merchantName}` + : 'Partially redeemed'; + } + return merchantName + ? `Ready at ${merchantName}` + : 'Voucher ready for collection'; + } + + if (normalizedService === 'electricity') { + return normalizedStatus.includes('completed') + ? 'Meter support delivered' + : 'Meter support sent'; + } + + if (normalizedService === 'airtime') { + return normalizedStatus.includes('completed') + ? 'Top-up delivered' + : 'Top-up sent'; + } + + return 'Support sent'; +}; + +const getRecipientDisplayName = (recipient?: RecipientRow | null) => { + if (!recipient) return 'Loved one'; + return `${recipient.first_name} ${recipient.last_name}`.trim(); +}; + +const getInitials = (name: string) => + name + .split(' ') + .map((part) => part.charAt(0)) + .join('') + .slice(0, 2) + .toUpperCase(); + +const getNormalizedServiceType = (value: string) => { + const normalized = value.toLowerCase(); + if (normalized.includes('grocery')) return 'grocery'; + if (normalized.includes('medication') || normalized.includes('pharmacy')) { + return 'medication'; + } + if (normalized.includes('airtime') || normalized.includes('data')) { + return 'airtime'; + } + if (normalized.includes('electricity') || normalized.includes('zesa')) { + return 'electricity'; + } + return normalized; +}; + +const getNormalizedServiceLabel = (serviceType: string) => { + const normalizedService = getNormalizedServiceType(serviceType); + if (normalizedService === 'grocery') return 'Grocery voucher'; + if (normalizedService === 'medication') return 'Medication voucher'; + if (normalizedService === 'airtime') return 'Airtime & Data'; + if (normalizedService === 'electricity') return 'Electricity'; + return serviceType.charAt(0).toUpperCase() + serviceType.slice(1); +}; + +const isVoucherService = (serviceType: string) => { + const normalizedService = getNormalizedServiceType(serviceType); + return normalizedService === 'grocery' || normalizedService === 'medication'; +}; + +const getVoucherStatus = ( + orderStatus: string, + voucher?: VoucherRow, + redemptions: RedemptionRow[] = [] +): VoucherActivityStatus => { + const combinedStatus = `${orderStatus} ${voucher?.status ?? ''}` + .toLowerCase() + .replace(/_/g, ' '); + + if (combinedStatus.includes('partial')) return 'partially'; + if ( + combinedStatus.includes('redeemed') || + Boolean(voucher?.redeemed_at) || + Boolean(voucher?.redeemed_merchant_id) || + redemptions.length > 0 + ) { + return 'redeemed'; + } + + return 'created'; +}; + +const getOrderStatus = (status: string) => { + const normalizedStatus = status.toLowerCase().replace(/_/g, ' '); + if ( + normalizedStatus.includes('completed') || + normalizedStatus.includes('delivered') || + normalizedStatus.includes('active') + ) { + return 'completed'; + } + return 'created'; +}; + +const getActivityStatusTone = (_serviceType: string, statusText?: string) => { + const normalizedStatus = statusText?.toLowerCase() ?? ''; + + if (normalizedStatus.includes('redeemed')) return 'success'; + if (normalizedStatus.includes('partial')) return 'partial'; + return 'warning'; +}; + +const getSeededRecipientImage = ( + firstName?: string | null, + photoPath?: string | null +) => { + const normalizedPath = photoPath?.trim().toLowerCase(); + if (normalizedPath === 'mom.jpg' || normalizedPath === 'mum.jpg') { + return momImage; + } + if (normalizedPath === 'dad.jpg' || normalizedPath === 'father.jpg') { + return dadImage; + } + + const normalizedName = firstName?.trim().toLowerCase(); + if (normalizedName === 'mum' || normalizedName === 'mom') return momImage; + if (normalizedName === 'dad' || normalizedName === 'father') return dadImage; + return undefined; +}; + +const getRecipientAvatarUrl = async (recipient?: RecipientRow | null) => { + if (!recipient) return undefined; + + const seededImage = getSeededRecipientImage( + recipient.first_name, + recipient.photo_path + ); + if (seededImage) return seededImage; + + if (!recipient.photo_path) return undefined; + + const { data } = await supabase.storage + .from('recipient-photos') + .createSignedUrl(recipient.photo_path, 3600); + + return data?.signedUrl; +}; + +const getAvatarTone = (serviceType: string) => { + const normalizedService = getNormalizedServiceType(serviceType); + if (normalizedService === 'medication') return 'mint'; + if (normalizedService === 'airtime') return 'sky'; + if (normalizedService === 'electricity') return 'gold'; + return 'lavender'; +}; + +const ActivityPage: React.FC = () => { + const history = useHistory(); + const { user } = useAuth(); + const [events, setEvents] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + const [range, setRange] = useState('all'); + const [typeFilter, setTypeFilter] = useState('all'); + + useIonViewWillEnter(() => { + setStatusBarStyle(Style.Light); + }); + + useEffect(() => { + void loadActivity(); + }, [user?.id]); + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const fetchOrdersForUser = async (userId: string) => { + return supabase + .from('support_orders') + .select( + 'id,service_type,amount,status,created_at,recipient_id,merchant_id,recipients(id,first_name,last_name,photo_path),merchants(id,name,branch_name)' + ) + .eq('user_id', userId) + .order('created_at', { ascending: false }); + }; + + const loadActivity = async () => { + setLoading(true); + setError(null); + + const activeUserId = user?.id ?? previewUserId; + let { data: ordersData, error: ordersError } = + await fetchOrdersForUser(activeUserId); + + if (!ordersError && user?.id && (ordersData ?? []).length === 0) { + const previewResult = await fetchOrdersForUser(previewUserId); + ordersData = previewResult.data; + ordersError = previewResult.error; + } + + if (ordersError) { + showError(ordersError.message || 'Failed to load activity'); + setEvents([]); + setLoading(false); + return; + } + + const orders = (ordersData ?? []) as unknown as OrderRow[]; + const orderIds = orders.map((order) => order.id); + const recipientIds = Array.from( + new Set(orders.map((order) => order.recipient_id).filter(Boolean)) + ); + + const [recipientsRes, vouchersRes, redemptionsRes, merchantsRes] = + await Promise.all([ + recipientIds.length > 0 + ? supabase + .from('recipients') + .select('id,first_name,last_name,photo_path') + .in('id', recipientIds) + : Promise.resolve({ data: [], error: null }), + orderIds.length > 0 + ? supabase + .from('vouchers') + .select('id,order_id,status,redeemed_at,redeemed_merchant_id') + .in('order_id', orderIds) + : Promise.resolve({ data: [], error: null }), + orderIds.length > 0 + ? supabase + .from('voucher_redemptions') + .select('id,voucher_id,order_id,merchant_id,redeemed_at') + .in('order_id', orderIds) + : Promise.resolve({ data: [], error: null }), + supabase.from('merchants').select('id,name,branch_name'), + ]); + + if ( + recipientsRes.error || + vouchersRes.error || + redemptionsRes.error || + merchantsRes.error + ) { + showError( + recipientsRes.error?.message || + vouchersRes.error?.message || + redemptionsRes.error?.message || + merchantsRes.error?.message || + 'Failed to load activity details' + ); + setEvents([]); + setLoading(false); + return; + } + + const recipientsById = new Map( + ((recipientsRes.data ?? []) as RecipientRow[]).map((recipient) => [ + recipient.id, + recipient, + ]) + ); + const vouchersByOrderId = new Map( + ((vouchersRes.data ?? []) as VoucherRow[]).map((voucher) => [ + voucher.order_id, + voucher, + ]) + ); + const redemptionsByOrderId = ( + (redemptionsRes.data ?? []) as RedemptionRow[] + ).reduce>((acc, redemption) => { + const existing = acc.get(redemption.order_id) ?? []; + existing.push(redemption); + acc.set(redemption.order_id, existing); + return acc; + }, new Map()); + const merchantsById = new Map( + ((merchantsRes.data ?? []) as MerchantRow[]).map((merchant) => [ + merchant.id, + merchant, + ]) + ); + + const mappedRows = await Promise.all( + orders.map(async (order) => { + const recipient = + order.recipients ?? recipientsById.get(order.recipient_id) ?? null; + const recipientName = getRecipientDisplayName(recipient); + const serviceType = getNormalizedServiceType(order.service_type); + const voucher = vouchersByOrderId.get(order.id); + const redemptions = redemptionsByOrderId.get(order.id) ?? []; + const latestRedemption = [...redemptions].sort( + (a, b) => + new Date(b.redeemed_at).getTime() - + new Date(a.redeemed_at).getTime() + )[0]; + const statusText = isVoucherService(serviceType) + ? getVoucherStatus(order.status, voucher, redemptions) + : getOrderStatus(order.status); + const redemptionMerchant = latestRedemption?.merchant_id + ? merchantsById.get(latestRedemption.merchant_id) + : null; + const voucherMerchant = voucher?.redeemed_merchant_id + ? merchantsById.get(voucher.redeemed_merchant_id) + : null; + const orderMerchant = + order.merchants ?? + (order.merchant_id ? merchantsById.get(order.merchant_id) : null); + const merchantName = + getMerchantDisplayName(redemptionMerchant) ?? + getMerchantDisplayName(voucherMerchant) ?? + getMerchantDisplayName(orderMerchant); + const subtitle = getActivityContextLabel( + serviceType, + statusText, + merchantName + ); + const avatarImage = await getRecipientAvatarUrl(recipient); + + return { + kind: isVoucherService(serviceType) ? 'voucher' : 'order', + id: order.id, + order_id: order.id, + event_type: serviceType, + service_type: serviceType, + title: getNormalizedServiceLabel(serviceType), + subtitle, + amount: Number(order.amount ?? 0), + event_at: order.created_at, + metadata: { + statusText, + avatarLabel: getInitials(recipientName), + avatarTone: getAvatarTone(serviceType), + avatarImage, + voucherId: voucher?.id, + }, + } satisfies UnifiedActivityItem; + }) + ); + + setEvents( + mappedRows.sort( + (a, b) => + new Date(b.event_at).getTime() - new Date(a.event_at).getTime() + ) + ); + setLoading(false); + }; + + const filteredEvents = useMemo(() => { + const threshold = new Date(); + if (range !== 'all') { + const days = Number(range); + threshold.setHours(0, 0, 0, 0); + threshold.setDate(threshold.getDate() - (days - 1)); + } + + return events.filter((item) => { + if ( + range !== 'all' && + new Date(item.event_at).getTime() < threshold.getTime() + ) { + return false; + } + + switch (typeFilter) { + case 'all': + return true; + case 'orders': + return item.kind === 'order'; + case 'vouchers': + return item.kind === 'voucher'; + case 'completed': { + const status = (item.metadata.statusText || '').toLowerCase(); + return ( + status.includes('completed') || + status.includes('redeemed') || + status.includes('partial') + ); + } + case 'alerts': + return false; + default: + return true; + } + }); + }, [events, range, typeFilter]); + + const groups = useMemo(() => { + return filteredEvents.reduce>( + (acc, event) => { + const label = dayLabel(event.event_at); + acc[label] = acc[label] ?? []; + acc[label].push(event); + return acc; + }, + {} + ); + }, [filteredEvents]); + + const handleRefresh = async (event: CustomEvent) => { + await loadActivity(); + event.detail.complete(); + }; + + const handleOpenEvent = (event: UnifiedActivityItem) => { + history.push(`/orders/${event.order_id}`, { parentRoot: '/activity' }); + }; + + return ( + + + + + + +
+
+

Activity

+

Orders & care timeline

+
+
+ +
+ {( + [ + 'all', + 'orders', + 'vouchers', + 'completed', + 'alerts', + ] as ActivityTypeFilter[] + ).map((type) => ( + + ))} +
+ +
+
+ + setRange((event.detail.value as ActivityFilterRange) ?? '30') + } + > + + All + + + 30 days + + + 90 days + + +
+
+ + {error && ( +

+ {error} +

+ )} + + {loading ? ( +
+ {[1, 2, 3].map((item) => ( +
+ +
+ + +
+
+ ))} +
+ ) : filteredEvents.length === 0 ? ( +
+ +

+ {typeFilter === 'all' + ? 'No activity in this range' + : 'No matching activity'} +

+

+ Try a longer date range or switch the activity filter. +

+
+ ) : ( + Object.entries(groups).map(([label, items]) => ( +
+

{label}

+
+ {items.map((item) => ( + handleOpenEvent(item)} + onStatusClick={() => handleOpenEvent(item)} + /> + ))} +
+
+ )) + )} +
+
+ ); +}; + +export default ActivityPage; diff --git a/src/pages/AuthPage.tsx b/src/pages/AuthPage.tsx new file mode 100644 index 0000000..54289e7 --- /dev/null +++ b/src/pages/AuthPage.tsx @@ -0,0 +1,355 @@ +import React, { useState, useEffect, useRef } from 'react'; +import { IonPage, IonContent, useIonViewWillEnter } from '@ionic/react'; +import { useHistory } from 'react-router-dom'; +import { supabase } from '../supabase'; +// import { useAuth } from '../contexts/AuthContext'; +import { Capacitor } from '@capacitor/core'; +import { FirebaseAuthentication } from '@capacitor-firebase/authentication'; +import AuthFormFields from '../components/AuthFormFields'; +import SocialAuthButton from '../components/SocialAuthButton'; +import '../styles/auth.css'; + +const AuthPage: React.FC = () => { + const history = useHistory(); + // const location = useLocation(); + // const { user, profile, profileStatus } = useAuth(); + const signInTimeoutRef = useRef | null>(null); + // const navigatedForUserRef = useRef(null); + + const [tab, setTab] = useState<'login' | 'register'>('login'); + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [confirmPassword, setConfirmPassword] = useState(''); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + + // useEffect(() => { + // if (!user) { + // navigatedForUserRef.current = null; + // return; + // } + + // if (signInTimeoutRef.current) { + // clearTimeout(signInTimeoutRef.current); + // signInTimeoutRef.current = null; + // } + + // if (location.pathname !== '/auth' || profileStatus === 'loading') return; + // if (navigatedForUserRef.current === user.id) return; + + // navigatedForUserRef.current = user.id; + // setLoading(false); + + // if ( + // !profile || + // !profile.first_name || + // !profile.last_name || + // !profile.phone || + // !profile.country_of_residence + // ) { + // history.replace('/setup-profile'); + // } else { + // history.replace('/home'); + // } + // }, [user, profile, profileStatus, location.pathname, history]); + + useEffect(() => { + return () => { + if (signInTimeoutRef.current) { + clearTimeout(signInTimeoutRef.current); + } + }; + }, []); + + useIonViewWillEnter(() => { + setTab('login'); + setError(null); + }); + + const showError = (msg: string) => { + setError(msg); + setTimeout(() => setError(null), 4000); + }; + + const handleTabChange = (nextTab: 'login' | 'register') => { + setTab(nextTab); + setError(null); + if (nextTab === 'login') { + setConfirmPassword(''); + } + }; + + const handleSignUp = async (e: React.FormEvent) => { + e.preventDefault(); + const normalizedEmail = email.trim().toLowerCase(); + + if (!normalizedEmail) { + showError('Please enter your email address.'); + return; + } + + if (password !== confirmPassword) { + showError('Passwords do not match'); + return; + } + setLoading(true); + setError(null); + + const { error: signUpError } = await supabase.auth.signUp({ + email: normalizedEmail, + password, + }); + + if (signUpError) { + showError(signUpError.message); + setLoading(false); + return; + } + + localStorage.setItem('kumusha_pending_verification_email', normalizedEmail); + setLoading(false); + history.replace('/verify-email', { state: { email: normalizedEmail } }); + }; + + const handleSignIn = async (e: React.FormEvent) => { + e.preventDefault(); + const normalizedEmail = email.trim().toLowerCase(); + + if (signInTimeoutRef.current) { + clearTimeout(signInTimeoutRef.current); + } + + setLoading(true); + setError(null); + + signInTimeoutRef.current = setTimeout(() => { + setLoading(false); + showError( + 'Sign in is taking too long. Please check your connection and try again.' + ); + }, 12000); + + const { error: signInError } = await supabase.auth.signInWithPassword({ + email: normalizedEmail, + password, + }); + + if (signInError) { + if (signInTimeoutRef.current) { + clearTimeout(signInTimeoutRef.current); + signInTimeoutRef.current = null; + } + + if (signInError.message.toLowerCase().includes('email not confirmed')) { + await supabase.auth.resend({ type: 'signup', email: normalizedEmail }); + localStorage.setItem( + 'kumusha_pending_verification_email', + normalizedEmail + ); + history.push('/verify-email', { + state: { email: normalizedEmail, resent: true }, + }); + } else { + showError(signInError.message); + } + setLoading(false); + return; + } + // Success: keep loading=true, wait for user/profile effect or timeout fallback + }; + + const handleGoogleSignIn = async () => { + if (!Capacitor.isNativePlatform()) { + showError( + 'Google Sign-In is only available in the native app. Use email to sign in here.' + ); + return; + } + try { + setLoading(true); + const result = await FirebaseAuthentication.signInWithGoogle(); + if (!result.credential?.idToken) throw new Error('Missing ID token'); + + const { error } = await supabase.auth.signInWithIdToken({ + provider: 'google', + token: result.credential.idToken, + }); + if (error) throw error; + // keep loading true + } catch (err: any) { + showError(err.message || 'Google sign in failed'); + setLoading(false); + } + }; + + const handleAppleSignIn = async () => { + if (!Capacitor.isNativePlatform()) { + showError( + 'Apple Sign-In is only available in the native app. Use email to sign in here.' + ); + return; + } + try { + setLoading(true); + const result = await FirebaseAuthentication.signInWithApple({ + skipNativeAuth: true, + }); + if (!result.credential?.idToken || !result.credential?.nonce) + throw new Error('Missing token or nonce'); + + const displayName = result.user?.displayName ?? null; + + const { data, error } = await supabase.auth.signInWithIdToken({ + provider: 'apple', + token: result.credential.idToken, + nonce: result.credential.nonce, + }); + if (error) throw error; + + if (displayName && data.user) { + const firstName = displayName.split(' ')[0] || 'Apple'; + const lastName = displayName.split(' ').slice(1).join(' ') || 'User'; + + await supabase.from('profiles').upsert( + { + id: data.user.id, + full_name: displayName, + first_name: firstName, + last_name: lastName, + phone: 'Pending', + country_of_residence: 'Pending', + }, + { onConflict: 'id' } + ); + } + } catch (err: any) { + showError(err.message || 'Apple sign in failed'); + setLoading(false); + } + }; + + return ( + + +
+
+

Kumusha

+

Take care of home from anywhere

+

+ Support your family with trusted vouchers, airtime, medication, + and electricity in just a few taps. +

+
+ +
+
+ + +
+ +
+ + + {error ? ( +
{error}
+ ) : null} + + {tab === 'login' && ( +
+ Secure email sign in + +
+ )} + + + + +
+ Or continue with +
+ +
+ + +
+
+
+
+
+ ); +}; + +export default AuthPage; diff --git a/src/pages/EditProfilePage.tsx b/src/pages/EditProfilePage.tsx new file mode 100644 index 0000000..fa7c383 --- /dev/null +++ b/src/pages/EditProfilePage.tsx @@ -0,0 +1,344 @@ +import React, { useEffect, useState } from 'react'; +import { + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonInput, + IonPage, + IonTitle, + IonToolbar, +} from '@ionic/react'; +import { chevronBackOutline } from 'ionicons/icons'; +import { useHistory } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import AvatarPicker from '../components/AvatarPicker'; +import '../styles/profile.css'; + +type Profile = { + id: string; + first_name: string; + last_name: string; + phone: string; + country_of_residence: string; + avatar_path: string | null; +}; + +type PreviewProfilePayload = { + first_name: string; + last_name: string; + phone: string; + country_of_residence: string; + avatar_url: string | null; + notification_push_enabled: boolean; + notification_email_enabled: boolean; + notification_sms_enabled: boolean; +}; + +const PREVIEW_PROFILE_STORAGE_KEY = 'kumusha-preview-profile'; + +const getPreviewProfilePayload = (): PreviewProfilePayload => { + const fallback: PreviewProfilePayload = { + first_name: 'Sarah', + last_name: 'Moyo', + phone: '+44 7123 456789', + country_of_residence: 'United Kingdom', + avatar_url: null, + notification_push_enabled: true, + notification_email_enabled: true, + notification_sms_enabled: false, + }; + + try { + const saved = localStorage.getItem(PREVIEW_PROFILE_STORAGE_KEY); + return saved ? { ...fallback, ...JSON.parse(saved) } : fallback; + } catch { + return fallback; + } +}; + +const savePreviewProfilePayload = (payload: PreviewProfilePayload) => { + localStorage.setItem(PREVIEW_PROFILE_STORAGE_KEY, JSON.stringify(payload)); +}; + +const EditProfilePage: React.FC = () => { + const history = useHistory(); + const { user, refreshProfile } = useAuth(); + const [firstName, setFirstName] = useState(''); + const [lastName, setLastName] = useState(''); + const [phone, setPhone] = useState(''); + const [country, setCountry] = useState(''); + const [avatarPath, setAvatarPath] = useState(null); + const [avatarPreview, setAvatarPreview] = useState(null); + const [avatarFile, setAvatarFile] = useState(null); + const [loading, setLoading] = useState(true); + const [saving, setSaving] = useState(false); + const [error, setError] = useState(null); + + useEffect(() => { + void loadProfile(); + }, [user?.id]); + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const loadProfile = async () => { + setLoading(true); + + if (!user) { + const preview = getPreviewProfilePayload(); + setFirstName(preview.first_name); + setLastName(preview.last_name); + setPhone(preview.phone); + setCountry(preview.country_of_residence); + setAvatarPath(null); + setAvatarPreview(preview.avatar_url); + setLoading(false); + return; + } + + const { data, error: loadError } = await supabase + .from('profiles') + .select('id,first_name,last_name,phone,country_of_residence,avatar_path') + .eq('id', user.id) + .single(); + + if (loadError || !data) { + showError(loadError?.message ?? 'Profile not found'); + const preview = getPreviewProfilePayload(); + setFirstName(preview.first_name); + setLastName(preview.last_name); + setPhone(preview.phone); + setCountry(preview.country_of_residence); + setAvatarPath(null); + setAvatarPreview(preview.avatar_url); + setLoading(false); + return; + } + + const profile = data as Profile; + setFirstName(profile.first_name ?? ''); + setLastName(profile.last_name ?? ''); + setPhone(profile.phone ?? ''); + setCountry(profile.country_of_residence ?? ''); + setAvatarPath(profile.avatar_path); + if (profile.avatar_path) { + const { data: signed } = await supabase.storage + .from('avatars') + .createSignedUrl(profile.avatar_path, 3600); + setAvatarPreview(signed?.signedUrl ?? null); + } + setLoading(false); + }; + + const handleGoBack = () => { + if (history.length > 1) { + history.goBack(); + } else { + history.replace('/profile'); + } + }; + + const handleAvatarChange = (event: React.ChangeEvent) => { + const file = event.target.files?.[0]; + if (!file) return; + + const reader = new FileReader(); + reader.onload = () => { + setAvatarFile(file); + setAvatarPreview( + typeof reader.result === 'string' ? reader.result : null + ); + }; + reader.onerror = () => { + showError( + 'We could not preview that image. Please choose another photo.' + ); + }; + reader.readAsDataURL(file); + }; + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + const cleanFirstName = firstName.trim(); + const cleanLastName = lastName.trim(); + const cleanPhone = phone.trim(); + const cleanCountry = country.trim(); + + if (!cleanFirstName || !cleanLastName || !cleanPhone || !cleanCountry) { + showError('Please complete all fields'); + return; + } + + if (!user) { + setSaving(true); + savePreviewProfilePayload({ + ...getPreviewProfilePayload(), + first_name: cleanFirstName, + last_name: cleanLastName, + phone: cleanPhone, + country_of_residence: cleanCountry, + avatar_url: avatarPreview, + }); + setSaving(false); + history.replace('/profile'); + return; + } + + setSaving(true); + let nextAvatarPath = avatarPath; + if (avatarFile) { + const extension = avatarFile.name.split('.').pop() || 'jpg'; + nextAvatarPath = `${user.id}/${Date.now()}.${extension}`; + const { error: uploadError } = await supabase.storage + .from('avatars') + .upload(nextAvatarPath, avatarFile); + if (uploadError) { + showError(uploadError.message); + setSaving(false); + return; + } + } + + const { error: updateError } = await supabase + .from('profiles') + .update({ + first_name: cleanFirstName, + last_name: cleanLastName, + full_name: `${cleanFirstName} ${cleanLastName}`, + phone: cleanPhone, + country_of_residence: cleanCountry, + avatar_path: nextAvatarPath, + updated_at: new Date().toISOString(), + }) + .eq('id', user.id); + + if (updateError) { + showError(updateError.message); + setSaving(false); + return; + } + + await refreshProfile(); + setSaving(false); + history.replace('/profile'); + }; + + const initials = `${firstName.charAt(0)}${lastName.charAt(0)}`.toUpperCase(); + + return ( + + + + + + + + + + Edit profile + + + + + +
+
+ + setFirstName(event.detail.value ?? '')} + /> + setLastName(event.detail.value ?? '')} + /> + setPhone(event.detail.value ?? '')} + /> + setCountry(event.detail.value ?? '')} + /> + {error && ( +

+ {error} +

+ )} +
+ + + {saving ? 'Saving...' : 'Save profile'} + +
+
+
+ ); +}; + +export default EditProfilePage; diff --git a/src/pages/ForgotPasswordPage.tsx b/src/pages/ForgotPasswordPage.tsx new file mode 100644 index 0000000..f39bc9a --- /dev/null +++ b/src/pages/ForgotPasswordPage.tsx @@ -0,0 +1,207 @@ +import React, { useState } from 'react'; +import { + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonInput, + IonPage, + IonTitle, + IonToolbar, +} from '@ionic/react'; +import { chevronBackOutline, keyOutline } from 'ionicons/icons'; +import { useHistory } from 'react-router-dom'; +import { supabase } from '../supabase'; +import '../styles/auth.css'; + +const ForgotPasswordPage: React.FC = () => { + const history = useHistory(); + const [email, setEmail] = useState(''); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + const [status, setStatus] = useState(null); + + const showMessage = (message: string, kind: 'error' | 'status') => { + if (kind === 'error') { + setError(message); + setStatus(null); + setTimeout(() => setError(null), 4000); + } else { + setStatus(message); + setError(null); + setTimeout(() => setStatus(null), 4000); + } + }; + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + + const normalizedEmail = email.trim().toLowerCase(); + if (!normalizedEmail) { + showMessage('Enter your email address to continue', 'error'); + return; + } + + setLoading(true); + setError(null); + setStatus(null); + + const { error: resetError } = + await supabase.auth.resetPasswordForEmail(normalizedEmail); + + if (resetError) { + showMessage(resetError.message, 'error'); + setLoading(false); + return; + } + + showMessage('Reset code sent', 'status'); + setLoading(false); + history.push('/verify-reset', { state: { email: normalizedEmail } }); + }; + + return ( + + + + + history.goBack()} + style={ + { + '--color': '#111827', + '--border-radius': '12px', + } as React.CSSProperties + } + aria-label="Go back" + > + + + + + Reset password + + + + + +
+
+
+ +
+
+

Forgot your password?

+

+ Enter your account email and we'll send you a 6-digit reset + code. +

+
+
+ +
+ setEmail(event.detail.value ?? '')} + disabled={loading} + placeholder="you@example.com" + style={ + { + '--background': '#fafafa', + '--border-radius': '12px', + '--padding-start': '14px', + '--padding-end': '14px', + '--highlight-color-focused': '#6d28d9', + } as React.CSSProperties + } + /> + + {error && ( +

+ {error} +

+ )} + {status && ( +

+ {status} +

+ )} + + + {loading ? 'Sending code...' : 'Send reset code'} + + + +
+

+ Remembered it?{' '} + +

+
+
+
+
+ ); +}; + +export default ForgotPasswordPage; diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx new file mode 100644 index 0000000..3a4203e --- /dev/null +++ b/src/pages/Home.tsx @@ -0,0 +1,30 @@ +import React from "react"; +import { + IonContent, + IonHeader, + IonPage, + IonTitle, + IonToolbar, +} from "@ionic/react"; + +const Home: React.FC = () => ( + + + + Home + + + +
+
+

Welcome to your new app

+

+ Chat with the assistant to start adding features and pages +

+
+
+
+
+); + +export default Home; diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx new file mode 100644 index 0000000..d9b5af8 --- /dev/null +++ b/src/pages/HomePage.tsx @@ -0,0 +1,1124 @@ +import React, { useState } from 'react'; +import { + IonContent, + IonIcon, + IonPage, + useIonViewWillEnter, +} from '@ionic/react'; +import { useHistory } from 'react-router-dom'; +import { + chevronForwardOutline, + ellipsisVertical, + flashOutline, + heart, + notificationsOutline, + phonePortraitOutline, + checkmarkCircleOutline, + timeOutline, + wifiOutline, + medkitOutline, +} from 'ionicons/icons'; +import sarahImage from '../assets/sarah.jpg'; +import momImage from '../assets/mom.jpg'; +import dadImage from '../assets/dad.jpg'; +import basketIcon from '../assets/basket.png'; +import { setStatusBarStyle, Style } from '../utils/statusBar'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import DashboardSkeleton from '../components/DashboardSkeleton'; +import '../styles/home.css'; + +type ActivityStatusTone = 'success' | 'warning' | 'info' | 'partial'; + +type HomeAlert = { + id: string; + scheduleId: string; + recipientId: string; + serviceType: string; + title: string; + subtitle: string; + icon: string; + iconType?: 'ion' | 'image'; + tone: 'grocery' | 'medication' | 'airtime' | 'electricity' | 'default'; + cta: string; +}; + +type HomeRenderableIcon = { + iconType: 'ion' | 'image'; + icon?: any; + iconSrc?: string; + iconAlt?: string; +}; + +type SupportCategoryTone = 'grocery' | 'medication' | 'airtime' | 'electricity'; + +const quickActions: Array< + HomeRenderableIcon & { + label: string; + helper: string; + tone: SupportCategoryTone; + } +> = [ + { + label: 'Grocery', + helper: 'Voucher for partner stores', + iconType: 'image', + iconSrc: basketIcon, + iconAlt: 'Groceries', + tone: 'grocery', + }, + { + label: 'Medication', + helper: 'Voucher for trusted pharmacies', + iconType: 'ion', + icon: medkitOutline, + tone: 'medication', + }, + { + label: 'Airtime & Data', + helper: 'Top up mobile credit quickly', + iconType: 'ion', + icon: wifiOutline, + tone: 'airtime', + }, + { + label: 'Electricity', + helper: 'Send ZESA meter support', + iconType: 'ion', + icon: flashOutline, + tone: 'electricity', + }, +]; + +const renderHomeIcon = (item: HomeRenderableIcon) => { + if (item.iconType === 'image' && item.iconSrc) { + const isPill = item.iconSrc.includes('pill'); + const isBasket = item.iconSrc.includes('basket'); + return ( + {item.iconAlt + ); + } + + return item.icon ? : null; +}; + +const HomePage: React.FC = () => { + const history = useHistory(); + const { user, profileStatus } = useAuth(); + const [alerts, setAlerts] = useState([]); + const [alertsLoading, setAlertsLoading] = useState(true); + const [alertsError, setAlertsError] = useState(null); + const [lovedOnes, setLovedOnes] = useState([]); + const [lovedOnesLoading, setLovedOnesLoading] = useState(true); + const [lovedOnesError, setLovedOnesError] = useState(null); + const [activities, setActivities] = useState([]); + const [activitiesLoading, setActivitiesLoading] = useState(true); + const [activitiesError, setActivitiesError] = useState(null); + + const formatRelativeSupportDate = (value?: string | null) => { + if (!value) return 'No support yet'; + + const date = new Date(value); + if (Number.isNaN(date.getTime())) return 'Recent support'; + + const today = new Date(); + const startOfToday = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + ); + const startOfDate = new Date( + date.getFullYear(), + date.getMonth(), + date.getDate() + ); + const diffDays = Math.floor( + (startOfToday.getTime() - startOfDate.getTime()) / 86_400_000 + ); + + if (diffDays <= 0) return 'Last support: today'; + if (diffDays === 1) return 'Last support: yesterday'; + if (diffDays < 30) return `Last support: ${diffDays} days ago`; + + return `Last support: ${date.toLocaleDateString(undefined, { + month: 'short', + day: 'numeric', + })}`; + }; + + const getSeededRecipientImage = ( + firstName?: string | null, + photoPath?: string | null + ) => { + const normalizedPath = photoPath?.trim().toLowerCase(); + if (normalizedPath === 'mom.jpg' || normalizedPath === 'mum.jpg') { + return momImage; + } + if (normalizedPath === 'dad.jpg' || normalizedPath === 'father.jpg') { + return dadImage; + } + + const normalizedName = firstName?.trim().toLowerCase(); + if (normalizedName === 'mum' || normalizedName === 'mom') return momImage; + if (normalizedName === 'dad' || normalizedName === 'father') { + return dadImage; + } + return null; + }; + + const getRecipientAvatarUrl = async ( + photoPath?: string | null, + firstName?: string | null + ) => { + const seededImage = getSeededRecipientImage(firstName, photoPath); + if (seededImage) return seededImage; + + if (photoPath) { + const { data: urlData } = await supabase.storage + .from('recipient-photos') + .createSignedUrl(photoPath, 3600); + if (urlData?.signedUrl) return urlData.signedUrl; + } + + return null; + }; + + const formatAlertSubtitle = (firstName: string, dueAt?: string | null) => { + if (!dueAt) return `For ${firstName}`; + + const date = new Date(dueAt); + if (Number.isNaN(date.getTime())) return `For ${firstName}`; + + const today = new Date(); + const startOfToday = new Date( + today.getFullYear(), + today.getMonth(), + today.getDate() + ); + const startOfDate = new Date( + date.getFullYear(), + date.getMonth(), + date.getDate() + ); + const diffDays = Math.round( + (startOfDate.getTime() - startOfToday.getTime()) / 86_400_000 + ); + + if (diffDays < 0) return `For ${firstName} · overdue`; + if (diffDays === 0) return `For ${firstName} · today`; + if (diffDays === 1) return `For ${firstName} · tomorrow`; + return `For ${firstName} · in ${diffDays} days`; + }; + + const getNormalizedServiceType = (value: string) => { + const normalized = value.toLowerCase(); + if (normalized.includes('grocery')) return 'grocery'; + if (normalized.includes('medication') || normalized.includes('pharmacy')) { + return 'medication'; + } + if (normalized.includes('airtime') || normalized.includes('data')) { + return 'airtime'; + } + if (normalized.includes('electricity') || normalized.includes('zesa')) { + return 'electricity'; + } + return normalized; + }; + + const getAlertPresentation = (serviceType: string) => { + switch (serviceType) { + case 'grocery': + return { + title: 'Grocery', + icon: basketIcon, + tone: 'grocery' as const, + cta: 'Send support', + }; + case 'medication': + return { + title: 'Medication', + icon: medkitOutline, + tone: 'medication' as const, + cta: 'Send support', + }; + case 'airtime': + return { + title: 'Airtime', + icon: phonePortraitOutline, + tone: 'airtime' as const, + cta: 'Top up', + }; + case 'electricity': + return { + title: 'Electricity', + icon: flashOutline, + tone: 'electricity' as const, + cta: 'Top up', + }; + default: + return { + title: 'Support', + icon: timeOutline, + tone: 'default' as const, + cta: 'Send support', + }; + } + }; + + const getActivityStatusTone = ( + serviceType: string, + status: string + ): ActivityStatusTone => { + const normalizedStatus = status.toLowerCase(); + const normalizedService = serviceType.toLowerCase(); + const isVoucherService = + normalizedService === 'grocery' || normalizedService === 'medication'; + + if (isVoucherService) { + if (normalizedStatus.includes('redeemed')) return 'success'; + if (normalizedStatus.includes('partial')) return 'partial'; + return 'warning'; + } + + if ( + normalizedStatus.includes('completed') || + normalizedStatus.includes('active') + ) { + return 'success'; + } + + if ( + normalizedStatus.includes('delivered') || + normalizedStatus.includes('created') || + normalizedStatus === 'ready_for_redemption' + ) { + return 'warning'; + } + + return 'info'; + }; + + const getActivityStatusLabel = (serviceType: string, status: string) => { + const normalizedService = serviceType.toLowerCase(); + const normalizedStatus = status.toLowerCase(); + const isVoucherService = + normalizedService === 'grocery' || normalizedService === 'medication'; + + if (isVoucherService) { + if (normalizedStatus.includes('redeemed')) return 'redeemed'; + if (normalizedStatus.includes('partial')) return 'partial'; + return 'created'; + } + + if (normalizedStatus === 'ready_for_redemption') return 'created'; + + return normalizedStatus.replace(/_/g, ' '); + }; + + useIonViewWillEnter(() => { + setStatusBarStyle(Style.Light); + loadHomePageData(); + }); + + const loadHomePageData = async () => { + const activeUserId = user?.id ?? '00000000-0000-0000-0000-000000000000'; + + setAlertsLoading(true); + setAlertsError(null); + setLovedOnesLoading(true); + setLovedOnesError(null); + setActivitiesLoading(true); + setActivitiesError(null); + + const { data: alertsData, error: alertsErr } = await supabase + .from('care_alerts') + .select('id, title, body, severity, service_type, due_at, recipient_id') + .eq('user_id', activeUserId) + .is('dismissed_at', null) + .order('due_at', { ascending: true, nullsFirst: false }) + .limit(5); + + if (alertsErr) { + console.error('[home care alerts]', alertsErr); + setAlertsError('Could not load care alerts'); + setAlerts([]); + } else if (alertsData) { + const recipientIds = Array.from( + new Set(alertsData.map((alert) => alert.recipient_id).filter(Boolean)) + ); + const recipientNameById = new Map(); + + if (recipientIds.length > 0) { + const { data: alertRecipients, error: alertRecipientsError } = + await supabase + .from('recipients') + .select('id, first_name') + .in('id', recipientIds); + + if (alertRecipientsError) { + console.error('[home care alert recipients]', alertRecipientsError); + } + + (alertRecipients || []).forEach((recipient) => { + recipientNameById.set(recipient.id, recipient.first_name); + }); + } + + setAlerts( + alertsData.map((alert) => { + const presentation = getAlertPresentation( + alert.service_type || 'default' + ); + const firstName = + recipientNameById.get(alert.recipient_id) || 'Loved one'; + return { + id: alert.id, + scheduleId: alert.id, + recipientId: alert.recipient_id, + serviceType: alert.service_type || 'support', + title: presentation.title, + subtitle: formatAlertSubtitle(firstName, alert.due_at), + icon: presentation.icon, + iconType: presentation.icon === basketIcon ? 'image' : 'ion', + tone: presentation.tone, + cta: presentation.cta, + }; + }) + ); + } else { + setAlerts([]); + } + setAlertsLoading(false); + + const { data: recipientsData, error: recipientsErr } = await supabase + .from('recipients') + .select( + 'id, first_name, last_name, country, city, photo_path, relationship' + ) + .eq('user_id', activeUserId); + + if (recipientsErr) { + setLovedOnesError('Could not load loved ones'); + } else if (recipientsData) { + const mappedLovedOnes = await Promise.all( + recipientsData.map(async (rec: any) => { + const avatarUrl = await getRecipientAvatarUrl( + rec.photo_path, + rec.first_name + ); + const { data: recentOrders } = await supabase + .from('support_orders') + .select('service_type, status, created_at, merchants(name)') + .eq('recipient_id', rec.id) + .eq('user_id', activeUserId) + .order('created_at', { ascending: false }) + .limit(8); + + const serviceTiePriority: Record = { + grocery: 0, + medication: 1, + electricity: 2, + airtime: 3, + }; + + const ordersForSelection = [...(recentOrders || [])].sort( + (a: any, b: any) => { + const timeDiff = + new Date(b.created_at).getTime() - + new Date(a.created_at).getTime(); + if (timeDiff !== 0) return timeDiff; + return ( + (serviceTiePriority[a.service_type] ?? 99) - + (serviceTiePriority[b.service_type] ?? 99) + ); + } + ); + + const voucherPrimaryOrder = ordersForSelection.find((order: any) => + ['grocery', 'medication'].includes(order.service_type) + ); + const primaryOrder = voucherPrimaryOrder ?? ordersForSelection[0]; + const orderedStatuses = [ + ...(primaryOrder ? [primaryOrder] : []), + ...ordersForSelection.filter( + (order: any) => order !== primaryOrder + ), + ].slice(0, 3); + + const statuses = orderedStatuses.map((order: any) => { + const tone = getAlertPresentation(order.service_type).tone; + const isSuccess = + order.status === 'redeemed' || order.status === 'completed'; + + let detail = getActivityStatusLabel( + order.service_type, + order.status + ); + if (order.status === 'redeemed' && order.merchants?.name) { + detail = `redeemed • ${order.merchants.name}`; + } + + return { + iconType: tone === 'grocery' ? 'image' : 'ion', + iconSrc: tone === 'grocery' ? basketIcon : undefined, + icon: + tone !== 'grocery' + ? getAlertPresentation(order.service_type).icon + : undefined, + iconAlt: order.service_type, + label: + order.service_type === 'grocery' + ? 'Grocery voucher' + : order.service_type === 'medication' + ? 'Medication voucher' + : order.service_type === 'electricity' + ? 'Electricity' + : order.service_type === 'airtime' + ? 'Airtime' + : `${order.service_type.charAt(0).toUpperCase()}${order.service_type.slice(1)}`, + detail, + status: isSuccess ? 'success' : 'warning', + iconTone: tone, + serviceType: order.service_type, + }; + }); + + const primaryTone = primaryOrder + ? getAlertPresentation(primaryOrder.service_type).tone + : 'grocery'; + const repeatCta = + primaryOrder?.service_type === 'medication' + ? 'Send Medication' + : primaryOrder?.service_type === 'airtime' + ? 'Top Up Again' + : primaryOrder?.service_type === 'electricity' + ? 'Send Electricity' + : 'Send Groceries'; + + return { + id: rec.id, + name: rec.first_name, + emoji: + rec.relationship === 'Mother' || rec.first_name === 'Mum' + ? '💜' + : '💚', + location: `${rec.city || ''}, ${rec.country || ''}`.replace( + /^, | , $/g, + '' + ), + cardTone: rec.first_name === 'Mum' ? 'lavender' : 'mint', + avatar: avatarUrl, + fallbackInitial: rec.first_name?.charAt(0)?.toUpperCase() ?? '?', + lastSupportLabel: formatRelativeSupportDate( + primaryOrder?.created_at + ), + repeatCta, + repeatAction: { + iconType: primaryTone === 'grocery' ? 'image' : 'ion', + iconSrc: primaryTone === 'grocery' ? basketIcon : undefined, + icon: + primaryTone !== 'grocery' && primaryOrder + ? getAlertPresentation(primaryOrder.service_type).icon + : undefined, + tone: primaryTone as SupportCategoryTone, + }, + statuses, + primaryServiceType: primaryOrder?.service_type ?? 'grocery', + }; + }) + ); + setLovedOnes(mappedLovedOnes); + } + setLovedOnesLoading(false); + + const { data: recentActivityData, error: activityErr } = await supabase + .from('support_orders') + .select( + 'id, service_type, status, amount, created_at, recipient_id, merchant_id' + ) + .eq('user_id', activeUserId) + .order('created_at', { ascending: false }) + .limit(5); + + if (activityErr) { + setActivitiesError('Could not load activity'); + } else if (recentActivityData) { + const activityRecipientIds = Array.from( + new Set( + recentActivityData + .map((activity) => activity.recipient_id) + .filter(Boolean) + ) + ); + const activityMerchantIds = Array.from( + new Set( + recentActivityData + .map((activity) => activity.merchant_id) + .filter(Boolean) + ) + ); + const recipientsById = new Map< + string, + { first_name: string; photo_path: string | null } + >(); + const merchantsById = new Map(); + + if (activityRecipientIds.length > 0) { + const { data: activityRecipients } = await supabase + .from('recipients') + .select('id, first_name, photo_path') + .in('id', activityRecipientIds); + + (activityRecipients || []).forEach((recipient) => { + recipientsById.set(recipient.id, { + first_name: recipient.first_name, + photo_path: recipient.photo_path, + }); + }); + } + + if (activityMerchantIds.length > 0) { + const { data: activityMerchants } = await supabase + .from('merchants') + .select('id, name') + .in('id', activityMerchantIds); + + (activityMerchants || []).forEach((merchant) => { + merchantsById.set(merchant.id, merchant.name); + }); + } + + const mappedActivity = await Promise.all( + recentActivityData.map(async (act) => { + const recipient = recipientsById.get(act.recipient_id); + const avatarUrl = await getRecipientAvatarUrl( + recipient?.photo_path, + recipient?.first_name + ); + const tone = getAlertPresentation(act.service_type).tone; + + const activityTitle = + act.service_type === 'grocery' + ? 'Grocery voucher' + : act.service_type === 'medication' + ? 'Medication voucher' + : act.service_type === 'airtime' + ? 'Airtime' + : act.service_type === 'data' + ? 'Data' + : act.service_type === 'electricity' + ? 'Electricity' + : `${act.service_type.charAt(0).toUpperCase()}${act.service_type.slice(1)}`; + + const normalizedServiceType = getNormalizedServiceType( + act.service_type + ); + const statusLabel = getActivityStatusLabel( + act.service_type, + act.status + ); + const merchantName = + (act.merchant_id && merchantsById.get(act.merchant_id)) || null; + const isVoucherSupport = + normalizedServiceType === 'grocery' || + normalizedServiceType === 'medication'; + + let subtitle = merchantName; + if (!subtitle) { + if (isVoucherSupport) { + subtitle = + statusLabel === 'redeemed' + ? 'Voucher redeemed' + : 'Voucher ready for collection'; + } else if (normalizedServiceType === 'electricity') { + subtitle = 'Meter support sent'; + } else if (normalizedServiceType === 'airtime') { + subtitle = 'Top-up sent'; + } else { + subtitle = 'Support sent'; + } + } + + return { + id: act.id, + recipientId: act.recipient_id, + title: activityTitle, + subtitle, + amount: `${Number(act.amount).toFixed(2)}`, + status: statusLabel, + tone: getActivityStatusTone(act.service_type, act.status), + icon: { + iconType: tone === 'grocery' ? 'image' : 'ion', + iconSrc: tone === 'grocery' ? basketIcon : undefined, + icon: + tone !== 'grocery' + ? getAlertPresentation(act.service_type).icon + : undefined, + }, + iconTone: tone, + avatar: avatarUrl, + fallbackInitial: + recipient?.first_name?.charAt(0)?.toUpperCase() ?? '?', + }; + }) + ); + setActivities(mappedActivity); + } + setActivitiesLoading(false); + }; + + const handleAlertTap = (alert: HomeAlert) => { + history.push('/support/new', { + recipientId: alert.recipientId, + serviceType: alert.serviceType, + parentRoot: '/home', + }); + }; + + const handleSupportClick = (serviceType?: SupportCategoryTone) => { + history.push( + '/support/new', + serviceType + ? { serviceType, parentRoot: '/home' } + : { parentRoot: '/home' } + ); + }; + + const handleRecipientsClick = () => { + history.push('/recipients'); + }; + + const isPreviewMode = !user; + const showInitialDashboardSkeleton = + !isPreviewMode && + profileStatus === 'loading' && + lovedOnesLoading && + activitiesLoading && + alertsLoading && + lovedOnes.length === 0 && + activities.length === 0 && + alerts.length === 0; + + return ( + + + {showInitialDashboardSkeleton ? ( + + ) : ( +
+
+
+
+ Sarah +
+
+

Hi Sarah 👋

+
+
+ + +
+ +
+
+

Supporting 2 loved ones ❤️

+
+
+
+ +
+
+

This Month

+

$185 Sent

+
+
+
+ + {(alertsLoading || alertsError || alerts.length > 0) && ( + <> +
+

Care Alerts

+
+ +
+ {alertsLoading && alerts.length === 0 ? ( +
+
+
+
+ + + +
+
+
+ ) : alertsError ? ( +
+

{alertsError}

+
+ ) : alerts.length > 0 ? ( +
+ {[...alerts, ...alerts].map((alert, index) => ( + + ))} +
+ ) : null} +
+ + )} + +
+

Your Loved Ones

+ +
+ +
+ {lovedOnesLoading && lovedOnes.length === 0 ? ( +
+
+
+
+
+

Loading...

+
+
+
+
+ ) : lovedOnesError ? ( +

{lovedOnesError}

+ ) : lovedOnes.length === 0 ? ( +
+
+ +
+

No loved ones yet

+

+ Add family members to start supporting them. +

+ +
+ ) : ( + lovedOnes.map((person) => ( +
+
+
+
+ {person.avatar ? ( + {person.name} + ) : ( + + {person.fallbackInitial} + + )} + +
+ +
+

+ {person.name} {person.emoji} +

+

+ {person.lastSupportLabel} +

+
+
+ + +
+ +
+ {person.statuses.length > 0 ? ( + person.statuses.map((item: any) => { + const isSuccess = item.status === 'success'; + return ( +
+
+ {renderHomeIcon(item)} +
+
+

+ {item.label} +

+

+ {item.detail} +

+
+ +
+ ); + }) + ) : ( +
+ + No support sent yet +
+ )} +
+ + +
+ )) + )} +
+ +
+ + + +
+ +
+

Send Support

+
+ +
+ {quickActions.map((action) => ( + + ))} +
+ +
+

Family Updates

+ +
+ +
+ {activitiesLoading && activities.length === 0 ? ( +
+ Loading activity... +
+ ) : activitiesError ? ( +
+

{activitiesError}

+
+ ) : activities.length === 0 ? ( +
+
+ +
+

No recent activity

+

+ Support history will appear here once you send support. +

+ +
+ ) : ( + activities.map((activity, index) => ( + + )) + )} +
+
+ )} + + + ); +}; + +export default HomePage; diff --git a/src/pages/NotificationsPage.tsx b/src/pages/NotificationsPage.tsx new file mode 100644 index 0000000..c083841 --- /dev/null +++ b/src/pages/NotificationsPage.tsx @@ -0,0 +1,480 @@ +import React, { useCallback, useEffect, useState } from 'react'; +import { + IonActionSheet, + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonPage, + IonSkeletonText, + IonTitle, + IonToolbar, + useIonViewWillEnter, +} from '@ionic/react'; +import { + chevronBackOutline, + chevronForwardOutline, + ellipsisHorizontal, + flashOutline, + medkitOutline, + notificationsOutline, + phonePortraitOutline, + receiptOutline, + trashOutline, +} from 'ionicons/icons'; +import { useHistory } from 'react-router-dom'; +import basketIcon from '../assets/basket.png'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import '../styles/activity.css'; +import '../styles/recipients.css'; + +type ServiceType = + | 'grocery' + | 'medication' + | 'airtime' + | 'electricity' + | 'support'; + +type NotificationRow = { + id: string; + title: string; + body: string; + priority: string; + type: string; + read_at: string | null; + created_at: string; + order_id: string | null; + voucher_id: string | null; + support_orders: { service_type: string | null } | null; + vouchers: { voucher_type: string | null } | null; +}; + +const previewUserId = '00000000-0000-0000-0000-000000000000'; + +const notificationSelect = + 'id,title,body,priority,type,read_at,created_at,order_id,voucher_id'; + +const normalizeServiceType = (value?: string | null): ServiceType => { + const normalized = value?.toLowerCase() ?? ''; + if (normalized.includes('med')) return 'medication'; + if (normalized.includes('air') || normalized.includes('data')) + return 'airtime'; + if (normalized.includes('electric')) return 'electricity'; + if (normalized.includes('grocery') || normalized.includes('voucher')) { + return 'grocery'; + } + return 'support'; +}; + +const inferServiceType = (notification: NotificationRow): ServiceType => { + const joinedType = notification.support_orders?.service_type; + if (joinedType) return normalizeServiceType(joinedType); + + const voucherType = notification.vouchers?.voucher_type; + if (voucherType) return normalizeServiceType(voucherType); + + return normalizeServiceType( + `${notification.title} ${notification.body} ${notification.type}` + ); +}; + +const getServicePresentation = (serviceType: ServiceType) => { + if (serviceType === 'medication') { + return { + className: 'notification-service-medication', + icon: medkitOutline, + }; + } + + if (serviceType === 'airtime') { + return { + className: 'notification-service-airtime', + icon: phonePortraitOutline, + }; + } + + if (serviceType === 'electricity') { + return { + className: 'notification-service-electricity', + icon: flashOutline, + }; + } + + if (serviceType === 'grocery') { + return { + className: 'notification-service-grocery', + iconImageSrc: basketIcon, + }; + } + + return { + className: 'notification-service-support', + icon: receiptOutline, + }; +}; + +const NotificationsPage: React.FC = () => { + const history = useHistory(); + const { user } = useAuth(); + const isPreviewMode = !user; + const [notifications, setNotifications] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + const [showActions, setShowActions] = useState(false); + + const showError = useCallback((message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }, []); + + const loadNotifications = useCallback(async () => { + setLoading(true); + setError(null); + + try { + const activeUserId = user?.id ?? previewUserId; + let { data, error: loadError } = await supabase + .from('notifications') + .select(notificationSelect) + .eq('user_id', activeUserId) + .order('created_at', { ascending: false }); + + if (!loadError && user?.id && (data ?? []).length === 0) { + const previewResult = await supabase + .from('notifications') + .select(notificationSelect) + .eq('user_id', previewUserId) + .order('created_at', { ascending: false }); + + data = previewResult.data; + loadError = previewResult.error; + } + + if (loadError) { + showError(loadError.message); + setNotifications([]); + return; + } + + const baseNotifications = (data ?? []) as unknown as NotificationRow[]; + const orderIds = Array.from( + new Set( + baseNotifications + .map((notification) => notification.order_id) + .filter((id): id is string => Boolean(id)) + ) + ); + const voucherIds = Array.from( + new Set( + baseNotifications + .map((notification) => notification.voucher_id) + .filter((id): id is string => Boolean(id)) + ) + ); + + const [ordersResult, vouchersResult] = await Promise.all([ + orderIds.length > 0 + ? supabase + .from('support_orders') + .select('id,service_type') + .in('id', orderIds) + : Promise.resolve({ data: [], error: null }), + voucherIds.length > 0 + ? supabase + .from('vouchers') + .select('id,voucher_type') + .in('id', voucherIds) + : Promise.resolve({ data: [], error: null }), + ]); + + if (ordersResult.error || vouchersResult.error) { + console.warn( + '[NotificationsPage] Notification detail lookup failed', + ordersResult.error ?? vouchersResult.error + ); + } + + const serviceTypesByOrderId = new Map( + ( + (ordersResult.data ?? []) as { + id: string; + service_type: string | null; + }[] + ).map((order) => [order.id, order.service_type]) + ); + const voucherTypesById = new Map( + ( + (vouchersResult.data ?? []) as { + id: string; + voucher_type: string | null; + }[] + ).map((voucher) => [voucher.id, voucher.voucher_type]) + ); + + setNotifications( + baseNotifications.map((notification) => ({ + ...notification, + support_orders: notification.order_id + ? { + service_type: + serviceTypesByOrderId.get(notification.order_id) ?? null, + } + : null, + vouchers: notification.voucher_id + ? { + voucher_type: + voucherTypesById.get(notification.voucher_id) ?? null, + } + : null, + })) + ); + } catch (loadCrash) { + console.error( + '[NotificationsPage] Failed to load notifications', + loadCrash + ); + showError('Notifications could not be loaded. Pull back and try again.'); + setNotifications([]); + } finally { + setLoading(false); + } + }, [showError, user?.id]); + + useEffect(() => { + void loadNotifications(); + }, [loadNotifications]); + + useIonViewWillEnter(() => { + void loadNotifications(); + }); + + const markRead = async (notificationId: string) => { + const readAt = new Date().toISOString(); + setNotifications((current) => + current.map((item) => + item.id === notificationId ? { ...item, read_at: readAt } : item + ) + ); + + if (isPreviewMode) { + const { error: updateError } = await supabase + .from('notifications') + .update({ read_at: readAt }) + .eq('id', notificationId) + .eq('user_id', previewUserId); + + if (updateError) { + showError(updateError.message); + void loadNotifications(); + } + return; + } + + const { error: invokeError } = await supabase.functions.invoke( + 'mark-notification-read', + { + body: { notificationId }, + } + ); + if (invokeError) { + showError(invokeError.message); + void loadNotifications(); + } + }; + + const handleOpenNotification = async (notification: NotificationRow) => { + if (!notification.read_at) { + await markRead(notification.id); + } + if (notification.order_id) { + history.push(`/orders/${notification.order_id}`, { + parentRoot: '/profile', + }); + } else if (notification.voucher_id) { + history.push(`/voucher/${notification.voucher_id}`, { + parentRoot: '/profile', + }); + } + }; + + const handleClearNotifications = async () => { + const targetUserId = user?.id ?? previewUserId; + + const { error: deleteError } = await supabase + .from('notifications') + .delete() + .eq('user_id', targetUserId); + + if (deleteError) { + showError(deleteError.message); + return; + } + + setNotifications([]); + setShowActions(false); + }; + + return ( + + + + + + history.length > 1 + ? history.goBack() + : history.replace('/profile') + } + aria-label="Go back" + > + + + + + Notifications + + + setShowActions(true)} + aria-label="Notification actions" + disabled={loading || notifications.length === 0} + > + + + + + + + + setShowActions(false)} + header="Notifications" + cssClass="app-action-sheet" + buttons={[ + { + text: 'Clear notifications', + role: 'destructive', + icon: trashOutline, + handler: () => { + void handleClearNotifications(); + }, + }, + { + text: 'Cancel', + role: 'cancel', + }, + ]} + /> + {error && ( +

+ {error} +

+ )} + + {loading ? ( +
+ {[1, 2, 3].map((item) => ( +
+ +
+ + +
+
+ ))} +
+ ) : notifications.length === 0 ? ( +
+ +

No notifications yet

+

+ Important payment and voucher updates will appear here. +

+
+ ) : ( +
+ {notifications.map((notification) => { + const service = getServicePresentation( + inferServiceType(notification) + ); + + return ( + + ); + })} +
+ )} +
+
+ ); +}; + +export default NotificationsPage; diff --git a/src/pages/OrderDetailPage.tsx b/src/pages/OrderDetailPage.tsx new file mode 100644 index 0000000..9315160 --- /dev/null +++ b/src/pages/OrderDetailPage.tsx @@ -0,0 +1,1205 @@ +import React, { useMemo, useState } from 'react'; +import { renderToStaticMarkup } from 'react-dom/server'; +import { QRCodeSVG } from 'qrcode.react'; +import momImage from '../assets/mom.jpg'; +import dadImage from '../assets/dad.jpg'; +import { + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonPage, + IonSkeletonText, + IonTitle, + IonToast, + IonToolbar, + useIonViewWillEnter, + useIonViewWillLeave, +} from '@ionic/react'; +import { + chevronBackOutline, + copyOutline, + flashOutline, + heartOutline, + listOutline, + medkitOutline, + peopleOutline, + personOutline, + phonePortraitOutline, + repeatOutline, + shareSocialOutline, + storefrontOutline, +} from 'ionicons/icons'; +import basketIcon from '../assets/basket.png'; +import { useHistory, useLocation, useParams } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import { formatMoney } from '../utils/formatMoney'; +import '../styles/support.css'; + +type Params = { id: string }; + +type Merchant = { + id: string; + name: string; + branch_name: string | null; + city: string; + country: string; +}; + +type RecipientSummary = { + first_name: string; + last_name: string; + city: string; + country: string; + mobile_number?: string | null; + photo_path?: string | null; +}; + +type OrderDetail = { + id: string; + service_type: string; + amount: number; + platform_fee: number; + total_amount: number; + currency: string; + status: string; + network: string | null; + meter_number: string | null; + payment_method: string | null; + created_at: string; + recipient_id: string; + merchant_id: string | null; + recipients?: RecipientSummary | null; + merchants?: Merchant | null; +}; + +type VoucherRedemption = { + id: string; + redeemed_amount: number | null; + redeemed_at: string | null; + merchant_id: string | null; + merchant_name?: string | null; +}; + +type Voucher = { + id: string; + voucher_code: string; + status: string; + expires_at: string; + redeemed_at: string | null; + redeemed_merchant_id: string | null; + voucher_redemptions?: VoucherRedemption[] | null; +}; + +const previewUserId = '00000000-0000-0000-0000-000000000000'; + +type ServiceTheme = { + icon?: string; + iconImageSrc?: string; + headerIcon?: string; + headerIconImageSrc?: string; + iconClassName: string; + cardClassName: string; + accent: string; + soft: string; + label: string; + explicitTitle: string; +}; + +const getServiceTheme = (type: string): ServiceTheme => { + if (type === 'medication') { + return { + icon: medkitOutline, + headerIcon: medkitOutline, + iconClassName: 'support-service-image support-service-image-medication', + cardClassName: 'order-service-card order-service-card-medication', + accent: '#16a34a', + soft: 'rgba(22, 163, 74, 0.1)', + label: 'Medication voucher', + explicitTitle: 'Medication support', + }; + } + + if (type === 'airtime') { + return { + icon: phonePortraitOutline, + headerIcon: phonePortraitOutline, + iconClassName: 'support-service-icon-vector', + cardClassName: 'order-service-card order-service-card-airtime', + accent: '#2563eb', + soft: 'rgba(37, 99, 235, 0.1)', + label: 'Airtime & Data', + explicitTitle: 'Airtime support', + }; + } + + if (type === 'electricity') { + return { + icon: flashOutline, + headerIcon: flashOutline, + iconClassName: 'support-service-icon-vector', + cardClassName: 'order-service-card order-service-card-electricity', + accent: '#d97706', + soft: 'rgba(245, 158, 11, 0.12)', + label: 'Electricity', + explicitTitle: 'Electricity support', + }; + } + + return { + iconImageSrc: basketIcon, + headerIcon: storefrontOutline, + headerIconImageSrc: basketIcon, + iconClassName: + 'support-service-image support-service-image-grocery order-detail-basket-image', + cardClassName: 'order-service-card order-service-card-grocery', + accent: '#6d28d9', + soft: 'rgba(109, 40, 217, 0.1)', + label: 'Grocery voucher', + explicitTitle: 'Grocery support', + }; +}; + +const isVoucherService = (serviceType: string) => + serviceType === 'grocery' || serviceType === 'medication'; + +const getDisplayStatus = ( + order: OrderDetail | null, + voucher: Voucher | null +) => { + if (!order) return 'Created'; + const combinedStatus = `${order.status} ${voucher?.status ?? ''}` + .toLowerCase() + .replace(/_/g, ' '); + + if (isVoucherService(order.service_type)) { + if (combinedStatus.includes('partial')) return 'Partially'; + if ( + combinedStatus.includes('redeemed') || + voucher?.redeemed_at || + voucher?.redeemed_merchant_id || + (voucher?.voucher_redemptions?.length ?? 0) > 0 + ) { + return 'Redeemed'; + } + return 'Created'; + } + + if ( + combinedStatus.includes('completed') || + combinedStatus.includes('delivered') || + combinedStatus.includes('active') + ) { + return 'Completed'; + } + + return 'Created'; +}; + +const formatDateTime = (dateString: string | null) => { + if (!dateString) return '—'; + const date = new Date(dateString); + const day = date.getDate(); + const month = date.toLocaleString('en-GB', { month: 'short' }); + const year = date.getFullYear(); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + return `${day} ${month} ${year}, ${hours}:${minutes}`; +}; + +const getMerchantDisplayName = (merchant?: Merchant | null) => { + if (!merchant) return null; + return `${merchant.name}${merchant.branch_name ? ` ${merchant.branch_name}` : ''}`; +}; + +const getSeededRecipientImage = ( + firstName?: string | null, + photoPath?: string | null +) => { + const normalizedPath = photoPath?.trim().toLowerCase(); + if (normalizedPath === 'mom.jpg' || normalizedPath === 'mum.jpg') { + return momImage; + } + if (normalizedPath === 'dad.jpg' || normalizedPath === 'father.jpg') { + return dadImage; + } + + const normalizedName = firstName?.trim().toLowerCase(); + if (normalizedName === 'mum' || normalizedName === 'mom') return momImage; + if (normalizedName === 'dad' || normalizedName === 'father') return dadImage; + return undefined; +}; + +const getRecipientAvatarUrl = async (recipient?: RecipientSummary | null) => { + if (!recipient) return undefined; + + const seededImage = getSeededRecipientImage( + recipient.first_name, + recipient.photo_path + ); + if (seededImage) return seededImage; + + if (!recipient.photo_path) return undefined; + + const { data } = await supabase.storage + .from('recipient-photos') + .createSignedUrl(recipient.photo_path, 3600); + + return data?.signedUrl; +}; + +const getInitials = (name: string) => + name + .split(' ') + .map((part) => part.charAt(0)) + .join('') + .slice(0, 2) + .toUpperCase(); + +const getMerchantLabel = ( + order: OrderDetail | null, + voucher: Voucher | null, + merchantsById: Map +) => { + const latestRedemption = [...(voucher?.voucher_redemptions ?? [])].sort( + (a, b) => + new Date(b.redeemed_at ?? 0).getTime() - + new Date(a.redeemed_at ?? 0).getTime() + )[0]; + + if (latestRedemption?.merchant_name) return latestRedemption.merchant_name; + + const redemptionMerchant = latestRedemption?.merchant_id + ? merchantsById.get(latestRedemption.merchant_id) + : null; + const voucherMerchant = voucher?.redeemed_merchant_id + ? merchantsById.get(voucher.redeemed_merchant_id) + : null; + const orderMerchant = + order?.merchants ?? + (order?.merchant_id ? merchantsById.get(order.merchant_id) : null); + + return ( + getMerchantDisplayName(redemptionMerchant) ?? + getMerchantDisplayName(voucherMerchant) ?? + getMerchantDisplayName(orderMerchant) + ); +}; + +const OrderDetailPage: React.FC = () => { + const { id } = useParams(); + const history = useHistory(); + const location = useLocation<{ parentRoot?: string }>(); + const { user } = useAuth(); + const [order, setOrder] = useState(null); + const [voucher, setVoucher] = useState(null); + const [voucherLoadState, setVoucherLoadState] = useState< + 'idle' | 'loaded' | 'missing' | 'error' + >('idle'); + const [voucherError, setVoucherError] = useState(null); + const [voucherRedemptions, setVoucherRedemptions] = useState< + VoucherRedemption[] + >([]); + const [merchantsById, setMerchantsById] = useState>( + () => new Map() + ); + const [loading, setLoading] = useState(true); + const [message, setMessage] = useState(null); + const [toastMessage, setToastMessage] = useState(null); + const [recipientAvatarUrl, setRecipientAvatarUrl] = useState( + null + ); + + const recipientName = order?.recipients + ? `${order.recipients.first_name} ${order.recipients.last_name}` + : 'Loved one'; + const recipientLocation = order?.recipients + ? `${order.recipients.city}, ${order.recipients.country}` + : '—'; + const serviceTheme = getServiceTheme(order?.service_type ?? 'grocery'); + const serviceName = order ? serviceTheme.label : 'Support'; + const explicitServiceTitle = order + ? serviceTheme.explicitTitle + : 'Support summary'; + const voucherWithRedemptions = voucher + ? { ...voucher, voucher_redemptions: voucherRedemptions } + : null; + const displayStatus = getDisplayStatus(order, voucherWithRedemptions); + const merchantLabel = getMerchantLabel( + order, + voucherWithRedemptions, + merchantsById + ); + const latestRedemption = [...voucherRedemptions].sort( + (a, b) => + new Date(b.redeemed_at ?? 0).getTime() - + new Date(a.redeemed_at ?? 0).getTime() + )[0]; + const createdOnLabel = order ? formatDateTime(order.created_at) : '—'; + const redeemedOnLabel = latestRedemption?.redeemed_at + ? formatDateTime(latestRedemption.redeemed_at) + : null; + const supportRouteRows = useMemo( + () => [ + { label: 'Recipient', value: recipientName }, + { label: 'Location', value: recipientLocation }, + ...(order?.recipients?.mobile_number + ? [{ label: 'Mobile number', value: order.recipients.mobile_number }] + : []), + { label: 'Created on', value: createdOnLabel }, + ...(merchantLabel + ? [ + { + label: + order?.service_type === 'grocery' || + order?.service_type === 'medication' + ? 'Merchant' + : 'Provider', + value: merchantLabel, + }, + ] + : []), + ...(redeemedOnLabel + ? [{ label: 'Redeemed on', value: redeemedOnLabel }] + : []), + ...(order?.network ? [{ label: 'Network', value: order.network }] : []), + ...(order?.meter_number + ? [{ label: 'Meter number', value: order.meter_number }] + : []), + ], + [ + createdOnLabel, + merchantLabel, + order?.meter_number, + order?.network, + order?.recipients?.mobile_number, + order?.service_type, + recipientLocation, + recipientName, + redeemedOnLabel, + ] + ); + + const showVoucherArtifact = order + ? isVoucherService(order.service_type) + : false; + + const voucherQrValue = useMemo(() => { + if (!order || !voucher || !isVoucherService(order.service_type)) { + return null; + } + + const partnerGroup = + order.service_type === 'grocery' ? 'grocery' : 'pharmacy'; + + return JSON.stringify({ + type: 'kumusha-voucher', + voucherId: voucher.id, + voucherCode: voucher.voucher_code, + supportType: order.service_type, + supportLabel: serviceName, + recipientName, + partnerGroup, + status: displayStatus, + expiresAt: voucher.expires_at, + }); + }, [displayStatus, order, recipientName, serviceName, voucher]); + + const voucherRedeemCopy = useMemo(() => { + if (!order || !showVoucherArtifact) return ''; + return `Voucher redeemable at Kumusha ${ + order.service_type === 'grocery' ? 'grocery' : 'pharmacy' + } partners.`; + }, [order, showVoucherArtifact]); + + useIonViewWillEnter(() => { + void loadOrderDetail(); + }); + + useIonViewWillLeave(() => { + setToastMessage(null); + setMessage(null); + }); + + const handleGoBack = () => { + if (history.length > 1) { + history.goBack(); + } else { + history.replace('/recipients'); + } + }; + + const parentRoot = location.state?.parentRoot ?? '/recipients'; + + const parentRootTitle = + parentRoot === '/activity' + ? 'Activity' + : parentRoot === '/home' + ? 'Care' + : parentRoot === '/profile' + ? 'Profile' + : 'Recipients'; + + const rootEscapeIcon = + parentRoot === '/activity' + ? listOutline + : parentRoot === '/home' + ? heartOutline + : parentRoot === '/profile' + ? personOutline + : peopleOutline; + + const handleGoToParentRoot = () => { + history.replace(parentRoot); + }; + + const showMessage = (text: string) => { + setMessage(text); + setTimeout(() => setMessage(null), 4000); + }; + + const showToast = (text: string) => { + setToastMessage(text); + setTimeout(() => setToastMessage(null), 4000); + }; + + const loadOrderDetail = async () => { + setLoading(true); + setMessage(null); + setVoucherLoadState('idle'); + setVoucherError(null); + + const activeUserId = user?.id ?? previewUserId; + + let orderResult = await supabase + .from('support_orders') + .select( + 'id,service_type,amount,platform_fee,total_amount,currency,status,network,meter_number,payment_method,created_at,recipient_id,merchant_id,recipients(first_name,last_name,city,country,mobile_number,photo_path),merchants(id,name,branch_name,city,country)' + ) + .eq('id', id) + .eq('user_id', activeUserId) + .maybeSingle(); + + if (!orderResult.error && !orderResult.data && user?.id) { + orderResult = await supabase + .from('support_orders') + .select( + 'id,service_type,amount,platform_fee,total_amount,currency,status,network,meter_number,payment_method,created_at,recipient_id,merchant_id,recipients(first_name,last_name,city,country,mobile_number,photo_path),merchants(id,name,branch_name,city,country)' + ) + .eq('id', id) + .eq('user_id', previewUserId) + .maybeSingle(); + } + + if (orderResult.error || !orderResult.data) { + showMessage(orderResult.error?.message ?? 'Order not found'); + setOrder(null); + setVoucher(null); + setVoucherRedemptions([]); + setLoading(false); + return; + } + + const nextOrder = orderResult.data as unknown as OrderDetail; + + const [voucherResult, merchantsResult, redemptionsResult] = + await Promise.all([ + supabase + .from('vouchers') + .select( + 'id,voucher_code,status,expires_at,redeemed_at,redeemed_merchant_id' + ) + .eq('order_id', id) + .maybeSingle(), + supabase.from('merchants').select('id,name,branch_name,city,country'), + supabase + .from('voucher_redemptions') + .select('id,redeemed_amount,redeemed_at,merchant_id') + .eq('order_id', id), + ]); + + if (voucherResult.error) { + setVoucherLoadState('error'); + setVoucherError(voucherResult.error.message); + } else if ( + !voucherResult.data && + isVoucherService(nextOrder.service_type) + ) { + setVoucherLoadState('missing'); + } else if (voucherResult.data) { + setVoucherLoadState('loaded'); + } + + let nextRedemptions = (redemptionsResult.data ?? []) as VoucherRedemption[]; + + // If order-based redemptions are empty but we have a voucher, check by voucher_id + if (nextRedemptions.length === 0 && voucherResult.data) { + const fallbackRedemptions = await supabase + .from('voucher_redemptions') + .select('id,redeemed_amount,redeemed_at,merchant_id') + .eq('voucher_id', voucherResult.data.id); + if (fallbackRedemptions.data) { + nextRedemptions = fallbackRedemptions.data as VoucherRedemption[]; + } + } + + if (merchantsResult.error || redemptionsResult.error) { + showMessage( + merchantsResult.error?.message || + redemptionsResult.error?.message || + 'Some order details could not be loaded' + ); + } + + setOrder(nextOrder); + setVoucher((voucherResult.data ?? null) as Voucher | null); + setVoucherRedemptions(nextRedemptions); + setMerchantsById( + new Map( + ((merchantsResult.data ?? []) as Merchant[]).map((merchant) => [ + merchant.id, + merchant, + ]) + ) + ); + + const nextAvatarUrl = await getRecipientAvatarUrl( + nextOrder.recipients ?? null + ); + setRecipientAvatarUrl(nextAvatarUrl ?? null); + setLoading(false); + }; + + const sharePayload = useMemo(() => { + if (!order) { + return { + subject: 'Kumusha support details', + text: `Kumusha order ${id}`, + }; + } + + const amountLabel = formatMoney(Number(order.amount), order.currency); + const totalLabel = formatMoney(Number(order.total_amount), order.currency); + const supportLabel = `${serviceTheme.label} for ${recipientName}`; + const merchantText = merchantLabel + ? `Redeem at ${merchantLabel}.` + : showVoucherArtifact + ? 'Redeem at participating partner merchants.' + : ''; + + if (showVoucherArtifact && voucher) { + const lines = [ + `Kumusha ${supportLabel}`, + `Voucher code: ${voucher.voucher_code}`, + `Voucher amount: ${amountLabel}`, + merchantText, + ].filter(Boolean); + + return { + subject: `${serviceTheme.label} voucher for ${recipientName}`, + text: lines.join('\n'), + }; + } + + return { + subject: `${serviceTheme.label} for ${recipientName}`, + text: [ + `Kumusha ${supportLabel}`, + `Support amount: ${amountLabel}`, + `Total paid: ${totalLabel}`, + ].join('\n'), + }; + }, [ + id, + merchantLabel, + order, + recipientName, + serviceTheme.label, + showVoucherArtifact, + voucher, + ]); + + const shareSubject = sharePayload.subject; + const shareText = sharePayload.text; + + const buildVoucherSharePayload = () => { + if (!voucher || !order) { + return sharePayload; + } + + const amountLabel = formatMoney(Number(order.amount), order.currency); + const voucherText = [ + `Hi ${order.recipients?.first_name ?? recipientName}, your ${serviceTheme.label.toLowerCase()} from Kumusha is ready to use.`, + `Voucher code: ${voucher.voucher_code}`, + `Voucher amount: ${amountLabel}`, + merchantLabel + ? `Redeem at ${merchantLabel}.` + : 'Redeem at participating Kumusha partner merchants.', + 'Show the QR code in this message to the merchant for redemption.', + ].join('\n'); + + return { + subject: `${serviceTheme.label} voucher for ${recipientName}`, + text: voucherText, + }; + }; + + const buildVoucherQrFile = async () => { + if (!voucherQrValue || !voucher || !order) return undefined; + + const markup = renderToStaticMarkup( + + ); + const svgBlob = new Blob([markup], { type: 'image/svg+xml;charset=utf-8' }); + const imageUrl = URL.createObjectURL(svgBlob); + + try { + const image = new Image(); + const loaded = new Promise((resolve, reject) => { + image.onload = () => resolve(); + image.onerror = () => reject(new Error('Could not prepare QR code')); + }); + image.src = imageUrl; + await loaded; + + const canvas = document.createElement('canvas'); + canvas.width = 1080; + canvas.height = 1320; + const ctx = canvas.getContext('2d'); + if (!ctx) return undefined; + + ctx.fillStyle = '#ffffff'; + ctx.fillRect(0, 0, canvas.width, canvas.height); + ctx.fillStyle = '#171827'; + ctx.font = + '700 54px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'; + ctx.textAlign = 'center'; + ctx.fillText('Kumusha voucher', canvas.width / 2, 92); + ctx.font = + '500 34px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'; + ctx.fillStyle = '#5f6572'; + ctx.fillText(serviceTheme.label, canvas.width / 2, 146); + ctx.drawImage(image, 120, 218, 840, 840); + ctx.fillStyle = serviceTheme.accent; + ctx.font = '700 46px ui-monospace, SFMono-Regular, Menlo, monospace'; + ctx.fillText(voucher.voucher_code, canvas.width / 2, 1124); + ctx.fillStyle = '#5f6572'; + ctx.font = + '500 30px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'; + ctx.fillText( + `Amount: ${formatMoney(Number(order.amount), order.currency)}`, + canvas.width / 2, + 1188 + ); + ctx.fillText(`For ${recipientName}`, canvas.width / 2, 1240); + + const blob = await new Promise((resolve) => + canvas.toBlob(resolve, 'image/png') + ); + if (!blob) return undefined; + return new File([blob], `kumusha-${voucher.voucher_code}.png`, { + type: 'image/png', + }); + } finally { + URL.revokeObjectURL(imageUrl); + } + }; + + const copyTextToClipboard = async (text: string) => { + try { + if (navigator.clipboard?.writeText) { + await navigator.clipboard.writeText(text); + return true; + } + } catch { + // Fall through to the textarea copy path. Some WebViews expose + // navigator.clipboard but reject writes unless triggered in a strict + // user gesture context. + } + + const textArea = document.createElement('textarea'); + textArea.value = text; + textArea.setAttribute('readonly', ''); + textArea.style.position = 'fixed'; + textArea.style.top = '0'; + textArea.style.left = '0'; + textArea.style.width = '1px'; + textArea.style.height = '1px'; + textArea.style.opacity = '0'; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + textArea.setSelectionRange(0, text.length); + + let copied = false; + try { + copied = document.execCommand('copy'); + } finally { + document.body.removeChild(textArea); + } + + return copied; + }; + + const copySharePayload = async (payload = sharePayload) => { + const text = payload.text || shareText; + const copied = await copyTextToClipboard(text); + showToast(copied ? 'Voucher copied' : 'Could not copy voucher'); + }; + + const openNativeShare = async (payload = sharePayload, file?: File) => { + if (!navigator.share) { + return false; + } + + const shareData: ShareData = { + title: payload.subject, + text: payload.text, + }; + + if (file) { + const fileShareData: ShareData = { + ...shareData, + files: [file], + }; + + if (!navigator.canShare || navigator.canShare(fileShareData)) { + await navigator.share(fileShareData); + return true; + } + } + + if (navigator.canShare && !navigator.canShare(shareData)) { + return false; + } + + await navigator.share(shareData); + return true; + }; + + const handleShare = async () => { + try { + if (await openNativeShare(sharePayload)) { + return; + } + await copySharePayload(sharePayload); + } catch (error) { + if ((error as Error)?.name !== 'AbortError') { + await copySharePayload(sharePayload); + } + } + }; + + const handleVoucherShare = async () => { + if (!voucher || !order) { + await handleShare(); + return; + } + + const voucherPayload = buildVoucherSharePayload(); + + try { + const qrFile = await buildVoucherQrFile(); + if (await openNativeShare(voucherPayload, qrFile)) { + return; + } + if (await openNativeShare(voucherPayload)) { + return; + } + await copySharePayload(voucherPayload); + } catch (error) { + if ((error as Error)?.name !== 'AbortError') { + await copySharePayload(voucherPayload); + } + } + }; + + return ( + + + + + + + + + + {explicitServiceTitle} + + + + + + + + + + + {loading ? ( +
+ + +
+ ) : order ? ( + <> + {message && ( +

+ {message} +

+ )} +
+
+
+ + {displayStatus} + + + Support for {recipientName} + +
+ +
+
+

Support type

+
+
+ {serviceTheme.iconImageSrc ? ( + + ) : ( + + )} +
+
+

{serviceName}

+
+
+

+ {displayStatus === 'Redeemed' && merchantLabel + ? `Redeemed at ${merchantLabel}` + : order?.service_type === 'grocery' + ? 'Ready to use at participating grocery merchants' + : order?.service_type === 'medication' + ? 'Ready to use at participating medication merchants' + : 'Successfully delivered to recipient'} +

+
+ +
+
+ {recipientAvatarUrl ? ( + {recipientName} + ) : ( +
+ {getInitials(recipientName)} +
+ )} +
+ {serviceTheme.iconImageSrc ? ( + + ) : ( + + )} +
+
+
+
+ +
+
+ + Total paid + + + {formatMoney(Number(order.total_amount), order.currency)} + +
+
+
+ + Support amount + + + {formatMoney(Number(order.amount), order.currency)} + +
+
+
+ +
+
+
+

Order summary

+

+ Payment and support details +

+
+
+ + {showVoucherArtifact && + voucherLoadState !== 'missing' && + voucherLoadState !== 'error' && ( +
+
+
+ {voucherQrValue ? ( + + ) : ( + + )} +
+ +
+

+ Voucher code +

+

+ {voucher ? voucher.voucher_code : '...'} +

+
+ + +
+
+
+
+ )} + +
+
+
+ Support amount + + {formatMoney(Number(order.amount), order.currency)} + +
+
+ Service fee + + {formatMoney(Number(order.platform_fee), order.currency)} + +
+
+ Total paid + + {formatMoney(Number(order.total_amount), order.currency)} + +
+
+
+
+ +
+
+
+

Support route

+

+ Who received it and where +

+
+
+ +
+ {supportRouteRows.map((row) => ( +
+ {row.label} + {row.value} +
+ ))} +
+
+ + + history.push('/support/new', { + recipientId: order.recipient_id, + serviceType: order.service_type, + amount: Number(order.amount), + merchantId: order.merchant_id, + network: order.network, + meterNumber: order.meter_number, + startAtAmount: true, + }) + } + className={`order-detail-send-again-button order-tone-${order.service_type}`} + style={ + { + margin: '4px 20px 20px', + '--border-radius': '999px', + '--box-shadow': 'none', + minHeight: '52px', + fontWeight: 700, + } as React.CSSProperties + } + > + + + Send again + + + + ) : null} + + setToastMessage(null)} + cssClass="order-detail-toast" + /> + + ); +}; + +export default OrderDetailPage; diff --git a/src/pages/OrdersPage.tsx b/src/pages/OrdersPage.tsx new file mode 100644 index 0000000..f81f2e2 --- /dev/null +++ b/src/pages/OrdersPage.tsx @@ -0,0 +1,253 @@ +import React, { useMemo, useState } from 'react'; +import { + IonContent, + IonIcon, + IonPage, + IonRefresher, + IonRefresherContent, + IonSkeletonText, + useIonViewWillEnter, +} from '@ionic/react'; +import { receiptOutline } from 'ionicons/icons'; +import { useHistory } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import ListSearchRow from '../components/ListSearchRow'; +import OrderSummaryCard, { OrderSummary } from '../components/OrderSummaryCard'; +import { formatMoney } from '../utils/formatMoney'; +import '../styles/support.css'; +import '../styles/recipients.css'; + +type OrderRow = { + id: string; + service_type: string; + amount: number; + status: string; + created_at: string; + recipient_id: string; + merchant_id: string | null; + recipients?: { + first_name: string; + last_name: string; + photo_path: string | null; + } | null; + merchants?: { name: string; branch_name: string | null } | null; +}; + +const statusFilters = [ + { value: 'all', label: 'All' }, + { value: 'paid', label: 'Paid' }, + { value: 'ready_for_redemption', label: 'Ready' }, + { value: 'redeemed', label: 'Redeemed' }, + { value: 'delivered', label: 'Delivered' }, + { value: 'expired', label: 'Expired' }, +]; + +const OrdersPage: React.FC = () => { + const history = useHistory(); + const { user } = useAuth(); + const [orders, setOrders] = useState([]); + const [searchTerm, setSearchTerm] = useState(''); + const [activeStatus, setActiveStatus] = useState('all'); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + useIonViewWillEnter(() => { + void loadOrders(); + }); + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const loadOrders = async () => { + if (!user) return; + setLoading(true); + setError(null); + + const { data, error: ordersError } = await supabase + .from('support_orders') + .select( + 'id,service_type,amount,status,created_at,recipient_id,merchant_id,recipients(first_name,last_name,photo_path),merchants(name,branch_name)' + ) + .eq('user_id', user.id) + .order('created_at', { ascending: false }); + + if (ordersError) { + showError(ordersError.message); + setLoading(false); + return; + } + + const rows = (data ?? []) as unknown as OrderRow[]; + const normalized = await Promise.all( + rows.map(async (row) => { + const recipientName = row.recipients + ? `${row.recipients.first_name} ${row.recipients.last_name}` + : 'Loved one'; + const avatarUrl = row.recipients?.photo_path + ? (( + await supabase.storage + .from('recipient-photos') + .createSignedUrl(row.recipients.photo_path, 3600) + ).data?.signedUrl ?? null) + : null; + + return { + id: row.id, + recipientName, + serviceType: + row.service_type.charAt(0).toUpperCase() + + row.service_type.slice(1), + merchantName: row.merchants + ? `${row.merchants.name}${row.merchants.branch_name ? ` — ${row.merchants.branch_name}` : ''}` + : undefined, + amount: Number(row.amount ?? 0), + amountLabel: formatMoney(Number(row.amount ?? 0)), + status: row.status, + createdAt: row.created_at, + avatarUrl, + }; + }) + ); + + setOrders(normalized); + setLoading(false); + }; + + const visibleOrders = useMemo(() => { + const query = searchTerm.trim().toLowerCase(); + return orders.filter((order) => { + const statusMatch = + activeStatus === 'all' || order.status === activeStatus; + const searchMatch = + !query || + [ + order.recipientName, + order.serviceType, + order.merchantName, + order.status, + ] + .join(' ') + .toLowerCase() + .includes(query); + return statusMatch && searchMatch; + }); + }, [orders, activeStatus, searchTerm]); + + const handleRefresh = async (event: CustomEvent) => { + await loadOrders(); + event.detail.complete(); + }; + + return ( + + + + + + +
+
+

Activity

+

+ {orders.length} support updates +

+
+
+ + + +
+ {statusFilters.map((filter) => ( + + ))} +
+ + {error && ( +

+ {error} +

+ )} + + {loading ? ( +
+ {[1, 2, 3].map((item) => ( +
+ +
+ + +
+
+ ))} +
+ ) : visibleOrders.length === 0 ? ( +
+ +

+ {orders.length === 0 ? 'No orders yet' : 'No matching orders'} +

+

+ {orders.length === 0 + ? 'Your support transactions will appear here.' + : 'Try changing your search or status filter.'} +

+
+ ) : ( +
+ {visibleOrders.map((order) => ( + history.push(`/orders/${id}`)} + /> + ))} +
+ )} +
+
+ ); +}; + +export default OrdersPage; diff --git a/src/pages/ProfilePage.tsx b/src/pages/ProfilePage.tsx new file mode 100644 index 0000000..43181f7 --- /dev/null +++ b/src/pages/ProfilePage.tsx @@ -0,0 +1,451 @@ +import React, { useState } from 'react'; +import { + IonButton, + IonContent, + IonIcon, + IonPage, + IonSkeletonText, + useIonViewWillEnter, +} from '@ionic/react'; +import { + cardOutline, + createOutline, + documentTextOutline, + helpCircleOutline, + informationCircleOutline, + logoWhatsapp, + logOutOutline, + mailOutline, + notificationsOutline, + personOutline, + phonePortraitOutline, + shieldCheckmarkOutline, +} from 'ionicons/icons'; +import { useHistory } from 'react-router-dom'; +import { FirebaseAuthentication } from '@capacitor-firebase/authentication'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import SettingsRow from '../components/SettingsRow'; +import sarahAvatarImage from '../assets/sarah.jpg'; +import '../styles/profile.css'; + +type Profile = { + id: string; + first_name: string; + last_name: string; + full_name: string; + phone: string; + country_of_residence: string; + avatar_path: string | null; + notification_push_enabled: boolean; + notification_email_enabled: boolean; + notification_sms_enabled: boolean; +}; + +type PreviewProfilePayload = { + first_name: string; + last_name: string; + phone: string; + country_of_residence: string; + avatar_url: string | null; + notification_push_enabled: boolean; + notification_email_enabled: boolean; + notification_sms_enabled: boolean; +}; + +const PREVIEW_PROFILE_STORAGE_KEY = 'kumusha-preview-profile'; + +const getPreviewProfilePayload = (): PreviewProfilePayload => { + const fallback: PreviewProfilePayload = { + first_name: 'Sarah', + last_name: 'Moyo', + phone: '+44 7123 456789', + country_of_residence: 'United Kingdom', + avatar_url: sarahAvatarImage, + notification_push_enabled: true, + notification_email_enabled: true, + notification_sms_enabled: false, + }; + + try { + const saved = localStorage.getItem(PREVIEW_PROFILE_STORAGE_KEY); + return saved ? { ...fallback, ...JSON.parse(saved) } : fallback; + } catch { + return fallback; + } +}; + +const savePreviewProfilePayload = ( + profile: Profile, + avatarUrl: string | null +) => { + const payload: PreviewProfilePayload = { + first_name: profile.first_name, + last_name: profile.last_name, + phone: profile.phone, + country_of_residence: profile.country_of_residence, + avatar_url: avatarUrl, + notification_push_enabled: profile.notification_push_enabled, + notification_email_enabled: profile.notification_email_enabled, + notification_sms_enabled: profile.notification_sms_enabled, + }; + localStorage.setItem(PREVIEW_PROFILE_STORAGE_KEY, JSON.stringify(payload)); +}; + +const buildPreviewProfile = () => { + const payload = getPreviewProfilePayload(); + const profile: Profile = { + id: 'preview-profile', + first_name: payload.first_name, + last_name: payload.last_name, + full_name: `${payload.first_name} ${payload.last_name}`, + phone: payload.phone, + country_of_residence: payload.country_of_residence, + avatar_path: null, + notification_push_enabled: payload.notification_push_enabled, + notification_email_enabled: payload.notification_email_enabled, + notification_sms_enabled: payload.notification_sms_enabled, + }; + + return { profile, avatarUrl: payload.avatar_url }; +}; + +const ProfilePage: React.FC = () => { + const history = useHistory(); + const { user, signOut, refreshProfile } = useAuth(); + const [profile, setProfile] = useState(null); + const [avatarUrl, setAvatarUrl] = useState(null); + const [loading, setLoading] = useState(true); + const [signingOut, setSigningOut] = useState(false); + const [error, setError] = useState(null); + + useIonViewWillEnter(() => { + void loadProfile(); + }); + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const loadProfile = async () => { + setLoading(true); + + if (!user) { + const preview = buildPreviewProfile(); + setProfile(preview.profile); + setAvatarUrl(preview.avatarUrl); + setLoading(false); + return; + } + + const { data, error: profileError } = await supabase + .from('profiles') + .select('*') + .eq('id', user.id) + .single(); + + if (profileError || !data) { + showError(profileError?.message ?? 'Profile not found'); + const preview = buildPreviewProfile(); + setProfile(preview.profile); + setAvatarUrl(preview.avatarUrl); + setLoading(false); + return; + } + + const nextProfile = data as Profile; + setProfile(nextProfile); + if (nextProfile.avatar_path) { + const { data: signed } = await supabase.storage + .from('avatars') + .createSignedUrl(nextProfile.avatar_path, 3600); + setAvatarUrl(signed?.signedUrl ?? null); + } else { + setAvatarUrl(null); + } + setLoading(false); + }; + + const handleTogglePreference = async ( + field: + | 'notification_push_enabled' + | 'notification_email_enabled' + | 'notification_sms_enabled', + checked: boolean + ) => { + if (!profile) return; + const previous = profile; + const next = { ...profile, [field]: checked }; + setProfile(next); + + if (!user) { + savePreviewProfilePayload(next, avatarUrl); + return; + } + + const updatedAt = new Date().toISOString(); + const updates: any = + field === 'notification_push_enabled' + ? { notification_push_enabled: checked, updated_at: updatedAt } + : field === 'notification_email_enabled' + ? { notification_email_enabled: checked, updated_at: updatedAt } + : { notification_sms_enabled: checked, updated_at: updatedAt }; + + if (field === 'notification_push_enabled' && !checked) { + updates.fcm_token = null; + } + + const { error: updateError } = await supabase + .from('profiles') + .update(updates) + .eq('id', profile.id); + + if (updateError) { + setProfile(previous); + showError(updateError.message); + return; + } + await refreshProfile(); + }; + + const handleSignOut = async () => { + setSigningOut(true); + try { + await FirebaseAuthentication.signOut().catch(() => undefined); + await signOut(); + history.replace('/auth'); + } finally { + setSigningOut(false); + } + }; + + const initials = + profile?.full_name + ?.split(' ') + .map((part) => part.charAt(0)) + .slice(0, 2) + .join('') + .toUpperCase() || '?'; + + const paymentMethodsCount = 0; + + return ( + + +

Profile

+ {error && ( +

+ {error} +

+ )} + + {loading ? ( +
+ +
+ + +
+
+ ) : profile ? ( + <> +
+
+ {avatarUrl ? ( + {profile.full_name} + ) : ( +
{initials}
+ )} +
+
+

{profile.full_name}

+

{profile.country_of_residence}

+
+ history.push('/profile/edit')} + > + + +
+ +

Payments

+
+ 0 + ? `${paymentMethodsCount} saved for faster checkout` + : 'No saved cards yet' + } + onClick={() => + showError( + 'Saved cards will be added when payments are connected in a later phase' + ) + } + /> +
+ +

Account

+
+ history.push('/profile/edit')} + /> + history.push('/notifications')} + /> + + showError( + 'Security settings will be available after MVP launch' + ) + } + /> +
+ +

Support

+
+ + showError( + 'Help centre articles will be added in a later phase' + ) + } + /> + + showError('Support chat will be connected in a later phase') + } + /> + + showError( + 'Guided product explainers will be added in a later phase' + ) + } + /> +
+ +

Legal

+
+ + showError('Terms of service will be added in a later phase') + } + /> + + showError('Privacy policy will be added in a later phase') + } + /> +
+ +

Preferences

+
+ + handleTogglePreference('notification_push_enabled', checked) + } + /> + + handleTogglePreference('notification_email_enabled', checked) + } + /> + + handleTogglePreference('notification_sms_enabled', checked) + } + /> +
+ +
+ +
+ +
+
K
+

Kumusha

+

Version 1.0.0

+

+ © 2026 Kumusha. All rights reserved. +

+
+ + ) : null} +
+
+ ); +}; + +export default ProfilePage; diff --git a/src/pages/RecipientDetailPage.tsx b/src/pages/RecipientDetailPage.tsx new file mode 100644 index 0000000..07205e8 --- /dev/null +++ b/src/pages/RecipientDetailPage.tsx @@ -0,0 +1,1234 @@ +import React, { useMemo, useState } from 'react'; +import { renderToStaticMarkup } from 'react-dom/server'; +import { QRCodeSVG } from 'qrcode.react'; +import { + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonModal, + IonPage, + IonSkeletonText, + IonTitle, + IonToolbar, + useIonViewWillEnter, +} from '@ionic/react'; +import basketIcon from '../assets/basket.png'; +import momImage from '../assets/mom.jpg'; +import dadImage from '../assets/dad.jpg'; +import { + chevronBackOutline, + closeOutline, + createOutline, + heartOutline, + alertCircleOutline, + timeOutline, + flashOutline, + medkitOutline, + cartOutline, + wifiOutline, + checkmarkCircleOutline, + shareOutline, + shareSocialOutline, + copyOutline, +} from 'ionicons/icons'; +import { useHistory, useParams } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import { formatMoney } from '../utils/formatMoney'; +import '../styles/recipients.css'; + +type Params = { id: string }; + +type Recipient = { + id: string; + first_name: string; + last_name: string; + relationship: string; + country: string; + city: string; + mobile_number: string; + photo_path: string | null; +}; + +type OrderRow = { + id: string; + service_type: string; + status: string; + amount: number; + currency?: string | null; + created_at: string; + merchant_id?: string | null; + merchants?: { name: string; branch_name?: string | null } | null; + vouchers?: + | { + id: string; + voucher_code: string; + status: string; + expires_at: string; + }[] + | null; +}; + +type CareAlertRow = { + id: string; + title: string; + body: string; + severity: string; + service_type: string | null; + due_at: string | null; +}; + +type VoucherRow = NonNullable[number] & { + order_id: string; +}; + +const RecipientDetailPage: React.FC = () => { + const history = useHistory(); + const { id } = useParams(); + const { user } = useAuth(); + const [recipient, setRecipient] = useState(null); + const [avatarUrl, setAvatarUrl] = useState(null); + const [groupedOrders, setGroupedOrders] = useState< + { label: string; items: OrderRow[] }[] + >([]); + const [careAlerts, setCareAlerts] = useState([]); + const [totalAssistance, setTotalAssistance] = useState(0); + const [orderCount, setOrderCount] = useState(0); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + const [showVoucherShareSheet, setShowVoucherShareSheet] = useState(false); + const [voucherShareText, setVoucherShareText] = useState(''); + const [voucherShareSubject, setVoucherShareSubject] = useState(''); + const [voucherShareTitle, setVoucherShareTitle] = useState('Share voucher'); + + useIonViewWillEnter(() => { + void loadRecipientDetail(); + }); + + const handleGoBack = () => { + if (history.length > 1) { + history.goBack(); + } else { + history.replace('/recipients'); + } + }; + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const getSeededRecipientImage = ( + firstName?: string | null, + photoPath?: string | null + ) => { + const normalizedPath = photoPath?.trim().toLowerCase(); + if (normalizedPath === 'mom.jpg' || normalizedPath === 'mum.jpg') + return momImage; + if (normalizedPath === 'dad.jpg' || normalizedPath === 'father.jpg') + return dadImage; + + const normalizedName = firstName?.trim().toLowerCase(); + if (normalizedName === 'mum' || normalizedName === 'mom') return momImage; + if (normalizedName === 'dad' || normalizedName === 'father') + return dadImage; + return null; + }; + + const resolveRecipientAvatar = async (nextRecipient: Recipient) => { + const seededImage = getSeededRecipientImage( + nextRecipient.first_name, + nextRecipient.photo_path + ); + if (seededImage) { + setAvatarUrl(seededImage); + return; + } + + if (!nextRecipient.photo_path) { + setAvatarUrl(null); + return; + } + + const { data } = await supabase.storage + .from('recipient-photos') + .createSignedUrl(nextRecipient.photo_path, 3600); + setAvatarUrl(data?.signedUrl ?? null); + }; + + const groupOrdersByDate = (orders: OrderRow[]) => { + const groups: { label: string; items: OrderRow[] }[] = []; + let currentLabel = ''; + let currentItems: OrderRow[] = []; + + const today = new Date(); + today.setHours(0, 0, 0, 0); + + const yesterday = new Date(today); + yesterday.setDate(yesterday.getDate() - 1); + + for (const order of orders) { + const orderDate = new Date(order.created_at); + orderDate.setHours(0, 0, 0, 0); + + let label = ''; + if (orderDate.getTime() === today.getTime()) { + label = 'Today'; + } else if (orderDate.getTime() === yesterday.getTime()) { + label = 'Yesterday'; + } else { + label = orderDate.toLocaleDateString(undefined, { + month: 'short', + day: 'numeric', + year: + orderDate.getFullYear() !== today.getFullYear() + ? 'numeric' + : undefined, + }); + } + + if (label !== currentLabel) { + if (currentItems.length > 0) { + groups.push({ label: currentLabel, items: currentItems }); + } + currentLabel = label; + currentItems = [order]; + } else { + currentItems.push(order); + } + } + if (currentItems.length > 0) { + groups.push({ label: currentLabel, items: currentItems }); + } + return groups; + }; + + const attachVouchersToOrders = async (orders: OrderRow[]) => { + const voucherOrderIds = orders + .filter( + (order) => + order.service_type === 'grocery' || + order.service_type === 'medication' + ) + .map((order) => order.id); + + if (voucherOrderIds.length === 0) return orders; + + const { data, error } = await supabase + .from('vouchers') + .select('id,order_id,voucher_code,status,expires_at') + .in('order_id', voucherOrderIds); + + if (error) { + showError('Voucher QR details could not be loaded'); + return orders; + } + + const vouchersByOrderId = new Map(); + ((data ?? []) as VoucherRow[]).forEach((voucher) => { + const existing = vouchersByOrderId.get(voucher.order_id) ?? []; + existing.push(voucher); + vouchersByOrderId.set(voucher.order_id, existing); + }); + + return orders.map((order) => ({ + ...order, + vouchers: vouchersByOrderId.get(order.id) ?? null, + })); + }; + + const loadRecipientDetail = async () => { + if (!user) { + const [recipientResult, ordersResult, careAlertsResult] = + await Promise.all([ + supabase + .from('recipients') + .select( + 'id,first_name,last_name,relationship,country,city,mobile_number,photo_path' + ) + .eq('id', id) + .eq('user_id', '00000000-0000-0000-0000-000000000000') + .single(), + supabase + .from('support_orders') + .select( + 'id,service_type,status,amount,currency,created_at,merchant_id,merchants(name,branch_name)' + ) + .eq('recipient_id', id) + .eq('user_id', '00000000-0000-0000-0000-000000000000') + .order('created_at', { ascending: false }), + supabase + .from('care_alerts') + .select('id,title,body,severity,service_type,due_at') + .eq('recipient_id', id) + .eq('user_id', '00000000-0000-0000-0000-000000000000') + .is('dismissed_at', null) + .order('due_at', { ascending: true, nullsFirst: false }) + .limit(3), + ]); + + const queryError = + recipientResult.error ?? ordersResult.error ?? careAlertsResult.error; + if (queryError || !recipientResult.data) { + showError(queryError?.message ?? 'Loved one not found'); + setLoading(false); + return; + } + + const nextRecipient = recipientResult.data as Recipient; + setRecipient(nextRecipient); + + await resolveRecipientAvatar(nextRecipient); + + const orders = await attachVouchersToOrders( + (ordersResult.data ?? []) as OrderRow[] + ); + setOrderCount(orders.length); + setTotalAssistance( + orders + .filter( + (order) => order.status !== 'failed' && order.status !== 'cancelled' + ) + .reduce((sum, order) => sum + Number(order.amount ?? 0), 0) + ); + setGroupedOrders(groupOrdersByDate(orders)); + setCareAlerts((careAlertsResult.data ?? []) as CareAlertRow[]); + setLoading(false); + return; + } + + setLoading(true); + setError(null); + + const [recipientResult, ordersResult, careAlertsResult] = await Promise.all( + [ + supabase + .from('recipients') + .select( + 'id,first_name,last_name,relationship,country,city,mobile_number,photo_path' + ) + .eq('id', id) + .eq('user_id', user.id) + .single(), + supabase + .from('support_orders') + .select( + 'id,service_type,status,amount,currency,created_at,merchant_id,merchants(name,branch_name)' + ) + .eq('recipient_id', id) + .eq('user_id', user.id) + .order('created_at', { ascending: false }), + supabase + .from('care_alerts') + .select('id,title,body,severity,service_type,due_at') + .eq('recipient_id', id) + .eq('user_id', user.id) + .is('dismissed_at', null) + .order('due_at', { ascending: true, nullsFirst: false }) + .limit(3), + ] + ); + + const queryError = + recipientResult.error ?? ordersResult.error ?? careAlertsResult.error; + if (queryError || !recipientResult.data) { + showError(queryError?.message ?? 'Loved one not found'); + setLoading(false); + return; + } + + const nextRecipient = recipientResult.data as Recipient; + setRecipient(nextRecipient); + + await resolveRecipientAvatar(nextRecipient); + + const orders = await attachVouchersToOrders( + (ordersResult.data ?? []) as OrderRow[] + ); + setOrderCount(orders.length); + setTotalAssistance( + orders + .filter( + (order) => order.status !== 'failed' && order.status !== 'cancelled' + ) + .reduce((sum, order) => sum + Number(order.amount ?? 0), 0) + ); + setGroupedOrders(groupOrdersByDate(orders)); + setCareAlerts((careAlertsResult.data ?? []) as CareAlertRow[]); + setLoading(false); + }; + + const formatDueDate = (value: string | null) => { + if (!value) return 'Upcoming'; + const dueDate = new Date(value); + const now = new Date(); + const diffMs = dueDate.getTime() - now.getTime(); + const diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24)); + + if (diffDays <= 0) return 'Due today'; + if (diffDays === 1) return 'Due tomorrow'; + if (diffDays <= 5) return `Due in ${diffDays} days`; + + return 'Due in 5 days'; + }; + + const normalizeVoucherStatus = ( + serviceType: string | null, + status: string | null + ) => { + const normalizedStatus = (status ?? '').toLowerCase(); + if (serviceType === 'grocery' || serviceType === 'medication') { + if (normalizedStatus === 'redeemed') return 'redeemed'; + if (normalizedStatus === 'partial') return 'partial'; + return 'created'; + } + return normalizedStatus || 'created'; + }; + + const formatSupportDateTime = (value: string) => + new Date(value).toLocaleString(undefined, { + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: '2-digit', + }); + + const getStatusDescription = (order: OrderRow) => { + const normalizedStatus = normalizeVoucherStatus( + order.service_type, + order.status + ); + const serviceLabel = order.service_type.replace(/_/g, ' '); + + if ( + order.service_type === 'grocery' || + order.service_type === 'medication' + ) { + if (normalizedStatus === 'redeemed') { + return 'Voucher collected by recipient.'; + } + if (normalizedStatus === 'partial') { + return 'Voucher partially used at merchant.'; + } + return 'Voucher created and ready to share.'; + } + + if (order.service_type === 'airtime') { + if (normalizedStatus === 'completed') { + return 'Top-up confirmed on recipient line.'; + } + if (normalizedStatus === 'delivered') { + return 'Top-up sent and awaiting final confirmation.'; + } + return `${serviceLabel.charAt(0).toUpperCase() + serviceLabel.slice(1)} request in progress.`; + } + + if (order.service_type === 'electricity') { + if (normalizedStatus === 'completed') { + return 'Token delivered successfully.'; + } + return 'Electricity support is being processed.'; + } + + return 'Support action recorded successfully.'; + }; + + const buildVoucherQrFile = async ( + order: OrderRow, + voucher: NonNullable[number], + recipientName: string, + serviceLabel: string, + merchantName: string + ) => { + const partnerGroup = + order.service_type === 'grocery' ? 'grocery' : 'pharmacy'; + const qrValue = JSON.stringify({ + type: 'kumusha-voucher', + voucherId: voucher.id, + voucherCode: voucher.voucher_code, + supportType: order.service_type, + supportLabel: serviceLabel, + recipientName, + partnerGroup, + status: normalizeVoucherStatus(order.service_type, voucher.status), + expiresAt: voucher.expires_at, + }); + + const markup = renderToStaticMarkup( + + ); + const svgBlob = new Blob([markup], { type: 'image/svg+xml;charset=utf-8' }); + const imageUrl = URL.createObjectURL(svgBlob); + + try { + const image = new Image(); + const loaded = new Promise((resolve, reject) => { + image.onload = () => resolve(); + image.onerror = () => reject(new Error('Could not prepare QR code')); + }); + image.src = imageUrl; + await loaded; + + const canvas = document.createElement('canvas'); + canvas.width = 1080; + canvas.height = 1320; + const ctx = canvas.getContext('2d'); + if (!ctx) return undefined; + + ctx.fillStyle = '#ffffff'; + ctx.fillRect(0, 0, canvas.width, canvas.height); + ctx.fillStyle = '#171827'; + ctx.font = + '700 54px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'; + ctx.textAlign = 'center'; + ctx.fillText('Kumusha voucher', canvas.width / 2, 92); + ctx.font = + '500 34px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'; + ctx.fillStyle = '#5f6572'; + ctx.fillText(serviceLabel, canvas.width / 2, 146); + ctx.drawImage(image, 120, 218, 840, 840); + ctx.fillStyle = + order.service_type === 'medication' ? '#16a34a' : '#6d28d9'; + ctx.font = '700 46px ui-monospace, SFMono-Regular, Menlo, monospace'; + ctx.fillText(voucher.voucher_code, canvas.width / 2, 1124); + ctx.fillStyle = '#5f6572'; + ctx.font = + '500 30px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'; + ctx.fillText( + `Amount: ${formatMoney(Number(order.amount), order.currency ?? 'USD')}`, + canvas.width / 2, + 1188 + ); + ctx.fillText(`For ${recipientName}`, canvas.width / 2, 1240); + ctx.fillText(merchantName, canvas.width / 2, 1290); + + const blob = await new Promise((resolve) => + canvas.toBlob(resolve, 'image/png') + ); + if (!blob) return undefined; + return new File([blob], `kumusha-${voucher.voucher_code}.png`, { + type: 'image/png', + }); + } finally { + URL.revokeObjectURL(imageUrl); + } + }; + + const copyVoucherTextToClipboard = async (text: string) => { + try { + if (navigator.clipboard?.writeText) { + await navigator.clipboard.writeText(text); + return true; + } + } catch { + // Fall through to the textarea fallback for native webviews. + } + + const textArea = document.createElement('textarea'); + textArea.value = text; + textArea.setAttribute('readonly', ''); + textArea.style.position = 'fixed'; + textArea.style.top = '0'; + textArea.style.left = '0'; + textArea.style.width = '1px'; + textArea.style.height = '1px'; + textArea.style.opacity = '0'; + document.body.appendChild(textArea); + textArea.focus(); + textArea.select(); + textArea.setSelectionRange(0, text.length); + + let copied = false; + try { + copied = document.execCommand('copy'); + } finally { + document.body.removeChild(textArea); + } + + return copied; + }; + + const openNativeVoucherShare = async ( + subject: string, + text: string, + file?: File + ) => { + if (!navigator.share) { + return false; + } + + const shareData: ShareData = { + title: subject, + text, + }; + + if (file) { + const fileShareData: ShareData = { + ...shareData, + files: [file], + }; + + if (!navigator.canShare || navigator.canShare(fileShareData)) { + await navigator.share(fileShareData); + return true; + } + } + + if (navigator.canShare && !navigator.canShare(shareData)) { + return false; + } + + await navigator.share(shareData); + return true; + }; + + const handleShareVoucher = async (order: OrderRow) => { + if ( + order.service_type !== 'grocery' && + order.service_type !== 'medication' + ) { + return; + } + + const serviceLabel = + order.service_type === 'grocery' + ? 'grocery voucher' + : 'medication voucher'; + const recipientName = recipient?.first_name ?? 'your loved one'; + const merchantName = order.merchants?.name + ? `${order.merchants.name}${order.merchants.branch_name ? ` ${order.merchants.branch_name}` : ''}` + : 'participating Kumusha partner merchants'; + const voucher = order.vouchers?.[0] ?? null; + + if (!voucher) { + showError('Voucher details are still being prepared'); + return; + } + + const statusLabel = normalizeVoucherStatus( + order.service_type, + voucher.status ?? order.status + ); + const shareText = + statusLabel === 'redeemed' + ? `${recipientName}'s ${serviceLabel} from Kumusha has already been redeemed at ${merchantName}. Voucher code: ${voucher.voucher_code}.` + : [ + `Hi ${recipientName}, your ${serviceLabel} from Kumusha is ready to use.`, + `Voucher code: ${voucher.voucher_code}`, + `Voucher amount: ${formatMoney(Number(order.amount), order.currency ?? 'USD')}`, + `Redeem at ${merchantName}.`, + 'Show the QR code in this message to the merchant for redemption.', + ].join('\n'); + const shareSubject = `Kumusha ${serviceLabel}`; + + setVoucherShareText(shareText); + setVoucherShareSubject(shareSubject); + setVoucherShareTitle('Share voucher'); + + try { + const qrFile = await buildVoucherQrFile( + order, + voucher, + recipientName, + serviceLabel, + merchantName + ); + if (await openNativeVoucherShare(shareSubject, shareText, qrFile)) { + return; + } + if (await openNativeVoucherShare(shareSubject, shareText)) { + return; + } + } catch (error) { + if ((error as Error)?.name === 'AbortError') { + return; + } + } + + setShowVoucherShareSheet(true); + }; + + const getServiceTheme = ( + serviceType: string | null, + status?: string | null + ) => { + const normalizedStatus = normalizeVoucherStatus( + serviceType, + status ?? null + ); + const successLike = ['redeemed', 'completed']; + const pendingLike = ['created', 'delivered', 'processing']; + const partialLike = ['partial']; + + const resolveTrailingIcon = () => { + if (partialLike.includes(normalizedStatus)) return alertCircleOutline; + if (successLike.includes(normalizedStatus)) return checkmarkCircleOutline; + if (pendingLike.includes(normalizedStatus)) return timeOutline; + return timeOutline; + }; + + switch (serviceType) { + case 'grocery': + return { + icon: cartOutline, + cardClass: 'service-grocery', + statusClass: + normalizedStatus === 'partial' + ? 'status-partial' + : normalizedStatus === 'created' + ? 'status-created' + : 'status-redeemed', + trailingIcon: resolveTrailingIcon(), + }; + case 'medication': + return { + icon: medkitOutline, + cardClass: 'service-medication', + statusClass: + normalizedStatus === 'partial' + ? 'status-partial' + : normalizedStatus === 'created' + ? 'status-created' + : 'status-redeemed', + trailingIcon: resolveTrailingIcon(), + }; + case 'electricity': + return { + icon: flashOutline, + cardClass: 'service-electricity', + statusClass: + normalizedStatus === 'completed' + ? 'status-completed' + : 'status-pending', + trailingIcon: resolveTrailingIcon(), + }; + case 'airtime': + return { + icon: wifiOutline, + cardClass: 'service-airtime', + statusClass: + normalizedStatus === 'completed' + ? 'status-completed' + : 'status-pending', + trailingIcon: resolveTrailingIcon(), + }; + default: + return { + icon: alertCircleOutline, + cardClass: 'service-default', + statusClass: 'status-default', + trailingIcon: resolveTrailingIcon(), + }; + } + }; + + const renderServiceIcon = (serviceType: string | null, ionIcon: string) => { + if (serviceType === 'grocery') { + return ( + + ); + } + return ; + }; + + const handleOpenOrder = (orderId?: string | null) => { + if (orderId) { + history.push(`/orders/${orderId}`, { parentRoot: '/recipients' }); + } + }; + + return ( + + + + + + + + + + {recipient + ? `${recipient.first_name} ${recipient.last_name}`.trim() + : 'Loved one'} + + + history.push(`/recipients/${id}/edit`)} + aria-label="Edit recipient" + style={ + { + '--recipient-action-accent': '#6d28d9', + } as React.CSSProperties + } + > + + + + + + + + setShowVoucherShareSheet(false)} + initialBreakpoint={0.4} + breakpoints={[0, 0.4, 0.62]} + className="kumusha-share-sheet" + > + +
+
+
+

Share

+

+ {voucherShareTitle} +

+
+ +
+ +
+ + + +
+
+
+
+ {loading ? ( +
+ + + +
+ ) : recipient ? ( + <> + {error && ( +

+ {error} +

+ )} +
+ {avatarUrl ? ( + {recipient.first_name} + ) : ( +
+ {recipient.first_name.charAt(0)} +
+ )} +
+

+ {recipient.first_name} {recipient.last_name} +

+

{recipient.relationship}

+

+ {recipient.city}, {recipient.country} +

+

{recipient.mobile_number}

+
+
+
+

+ {formatMoney(Math.round(totalAssistance))} +

+

Total sent

+
+
+

{orderCount}

+

Orders

+
+
+ + history.push('/support/new', { recipientId: id }) + } + > + + Send support + +
+ +

Care alerts

+ {careAlerts.length === 0 ? ( +
+
+ +
+
+

No active alerts

+

+ This loved one has no upcoming care reminders right now. +

+
+
+ ) : ( +
+ {careAlerts.map((alert) => { + const theme = getServiceTheme(alert.service_type); + return ( + + ); + })} +
+ )} + +
+
+

Support history

+

{orderCount} recent care actions

+
+
+ {groupedOrders.length === 0 ? ( +
+ +

No support yet

+

+ Send first support and history will appear here. +

+ + history.push('/support/new', { recipientId: id }) + } + style={ + { + '--background': '#6d28d9', + '--border-radius': '999px', + '--box-shadow': 'none', + } as React.CSSProperties + } + > + Send first support + +
+ ) : ( +
+ {groupedOrders.map((group) => ( +
+
+ {group.label} +
+ {group.items.map((row) => { + const inferredServiceType = row.service_type; + const normalizedStatus = normalizeVoucherStatus( + inferredServiceType, + row.status + ); + const theme = getServiceTheme( + inferredServiceType, + normalizedStatus + ); + const displayTitle = + row.service_type === 'grocery' + ? 'Grocery voucher' + : row.service_type === 'medication' + ? 'Medication voucher' + : row.service_type === 'electricity' + ? 'Electricity' + : row.service_type === 'airtime' + ? 'Airtime' + : `${row.service_type.charAt(0).toUpperCase()}${row.service_type.slice(1)}`; + const merchantName = row.merchants?.name ?? null; + const voucherSendDisabled = + (row.service_type === 'grocery' || + row.service_type === 'medication') && + normalizedStatus === 'redeemed'; + return ( + + +
+ )} +

+ {getStatusDescription(row)} +

+
+ + ); + })} +
+ ))} +
+ )} + + ) : null} +
+
+ ); +}; + +export default RecipientDetailPage; diff --git a/src/pages/RecipientFormPage.tsx b/src/pages/RecipientFormPage.tsx new file mode 100644 index 0000000..7011069 --- /dev/null +++ b/src/pages/RecipientFormPage.tsx @@ -0,0 +1,728 @@ +import React, { useEffect, useRef, useState } from 'react'; +import { + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonInput, + IonList, + IonModal, + IonPage, + IonTitle, + IonToolbar, +} from '@ionic/react'; +import { + cameraOutline, + chevronBackOutline, + closeOutline, +} from 'ionicons/icons'; +import { useHistory, useParams } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import AvatarPicker from '../components/AvatarPicker'; +import momImage from '../assets/mom.jpg'; +import dadImage from '../assets/dad.jpg'; +import '../styles/recipients.css'; + +type Params = { id?: string }; + +type RecipientRow = { + id: string; + first_name: string; + last_name: string; + relationship: string; + country: string; + city: string; + mobile_number: string; + photo_path: string | null; +}; + +const countryOptions = [ + { name: 'Zimbabwe', flag: '🇿🇼', dialCode: '+263' }, + { name: 'South Africa', flag: '🇿🇦', dialCode: '+27' }, + { name: 'Zambia', flag: '🇿🇲', dialCode: '+260' }, + { name: 'Botswana', flag: '🇧🇼', dialCode: '+267' }, + { name: 'Mozambique', flag: '🇲🇿', dialCode: '+258' }, + { name: 'United Kingdom', flag: '🇬🇧', dialCode: '+44' }, + { name: 'United States', flag: '🇺🇸', dialCode: '+1' }, + { name: 'Canada', flag: '🇨🇦', dialCode: '+1' }, + { name: 'Australia', flag: '🇦🇺', dialCode: '+61' }, +]; + +const locationOptionsByCountry: Record< + string, + Array<{ + group: string; + options: Array<{ name: string; description: string }>; + }> +> = { + Zimbabwe: [ + { + group: 'Major cities', + options: [ + { name: 'Harare', description: 'Capital city coverage' }, + { name: 'Bulawayo', description: 'City merchants and pharmacies' }, + { name: 'Mutare', description: 'Eastern Highlands coverage' }, + { name: 'Gweru', description: 'Midlands city coverage' }, + ], + }, + { + group: 'Towns', + options: [ + { name: 'Chitungwiza', description: 'Harare metro support' }, + { name: 'Masvingo', description: 'Town and surrounding areas' }, + { name: 'Kwekwe', description: 'Supported collection points' }, + { name: 'Kadoma', description: 'Supported collection points' }, + { name: 'Victoria Falls', description: 'Town coverage' }, + ], + }, + { + group: 'Rural districts', + options: [ + { name: 'Murehwa District', description: 'Rural collection support' }, + { name: 'Gokwe District', description: 'Rural collection support' }, + { name: 'Buhera District', description: 'Rural collection support' }, + { name: 'Zaka District', description: 'Rural collection support' }, + { name: 'Guruve District', description: 'Rural collection support' }, + { + name: 'Tsholotsho District', + description: 'Rural collection support', + }, + ], + }, + ], + Zambia: [ + { + group: 'Major cities', + options: [ + { name: 'Lusaka', description: 'Capital city coverage' }, + { name: 'Ndola', description: 'Copperbelt coverage' }, + { name: 'Kitwe', description: 'Copperbelt coverage' }, + { name: 'Livingstone', description: 'Town coverage' }, + ], + }, + { + group: 'Rural districts', + options: [ + { name: 'Chongwe District', description: 'Rural collection support' }, + { name: 'Monze District', description: 'Rural collection support' }, + ], + }, + ], + Botswana: [ + { + group: 'Cities and towns', + options: [ + { name: 'Gaborone', description: 'Capital city coverage' }, + { name: 'Francistown', description: 'Town coverage' }, + { name: 'Maun', description: 'Town coverage' }, + ], + }, + { + group: 'Rural districts', + options: [ + { name: 'Kweneng District', description: 'Rural collection support' }, + { name: 'Central District', description: 'Rural collection support' }, + ], + }, + ], +}; + +const fallbackLocationGroups = [ + { + group: 'Supported areas', + options: [ + { name: 'Main city', description: 'Available merchant coverage' }, + { name: 'Nearby town', description: 'Supported collection points' }, + { name: 'Rural district', description: 'Rural collection support' }, + ], + }, +]; + +const getCountryMeta = (countryName: string) => + countryOptions.find((option) => option.name === countryName) ?? + countryOptions[0]; + +const getLocationGroups = (countryName: string) => + locationOptionsByCountry[countryName] ?? fallbackLocationGroups; + +const getSeededRecipientImage = ( + firstName?: string | null, + photoPath?: string | null +) => { + const normalizedPath = photoPath?.trim().toLowerCase(); + if (normalizedPath === 'mom.jpg' || normalizedPath === 'mum.jpg') { + return momImage; + } + if (normalizedPath === 'dad.jpg' || normalizedPath === 'father.jpg') { + return dadImage; + } + + const normalizedName = firstName?.trim().toLowerCase(); + if (normalizedName === 'mum' || normalizedName === 'mom') { + return momImage; + } + if (normalizedName === 'dad' || normalizedName === 'father') { + return dadImage; + } + + return null; +}; + +const stripDialCode = (value: string, dialCode: string) => { + const normalizedValue = value.trim(); + if (normalizedValue.startsWith(dialCode)) { + return normalizedValue.slice(dialCode.length).trimStart(); + } + return normalizedValue; +}; + +const sanitizePhoneInput = (value: string) => + value.replace(/[^\d\s()-]/g, '').replace(/\s{2,}/g, ' '); + +const normalizePhoneInput = (value: string) => + sanitizePhoneInput(value).replace(/^0+/, ''); + +const formatNameInput = (value: string) => + value + .toLowerCase() + .replace( + /(^|[\s'-])([a-z])/g, + (_match, separator: string, letter: string) => + `${separator}${letter.toUpperCase()}` + ); + +const RecipientFormPage: React.FC = () => { + const history = useHistory(); + const { id } = useParams(); + const { user } = useAuth(); + const isEdit = Boolean(id); + + const [firstName, setFirstName] = useState(''); + const [lastName, setLastName] = useState(''); + const [relationship, setRelationship] = useState(''); + const [country, setCountry] = useState('Zimbabwe'); + const [city, setCity] = useState(''); + const [mobileNumber, setMobileNumber] = useState(''); + const [showCountrySheet, setShowCountrySheet] = useState(false); + const [showLocationSheet, setShowLocationSheet] = useState(false); + const selectedCountry = getCountryMeta(country); + const locationGroups = getLocationGroups(country); + const [photoFile, setPhotoFile] = useState(null); + const [photoPreview, setPhotoPreview] = useState(null); + const previewObjectUrlRef = useRef(null); + const [existingPhotoPath, setExistingPhotoPath] = useState( + null + ); + const [loading, setLoading] = useState(false); + const [saving, setSaving] = useState(false); + const [error, setError] = useState(null); + const firstNameInputRef = useRef(null); + const lastNameInputRef = useRef(null); + const relationshipInputRef = useRef(null); + const mobileInputRef = useRef(null); + + useEffect(() => { + if (isEdit) { + void loadRecipient(); + } + }, [id, isEdit]); + + useEffect(() => { + return () => { + if (previewObjectUrlRef.current) { + URL.revokeObjectURL(previewObjectUrlRef.current); + } + }; + }, []); + + const handleGoBack = () => { + if (history.length > 1) { + history.goBack(); + } else { + history.replace('/recipients'); + } + }; + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const applyRecipientToForm = async (recipient: RecipientRow) => { + setFirstName(recipient.first_name); + setLastName(recipient.last_name); + setRelationship(recipient.relationship); + setCountry(recipient.country); + setCity(recipient.city); + const recipientCountry = getCountryMeta(recipient.country); + setMobileNumber( + stripDialCode(recipient.mobile_number, recipientCountry.dialCode) + ); + setExistingPhotoPath(recipient.photo_path); + + const seededImage = getSeededRecipientImage( + recipient.first_name, + recipient.photo_path + ); + if (seededImage) { + setPhotoPreview(seededImage); + return; + } + + if (!recipient.photo_path) { + setPhotoPreview(null); + return; + } + + const { data: signed } = await supabase.storage + .from('recipient-photos') + .createSignedUrl(recipient.photo_path, 3600); + setPhotoPreview(signed?.signedUrl ?? null); + }; + + const loadRecipient = async () => { + if (!id) return; + setLoading(true); + + const ownerId = user?.id ?? '00000000-0000-0000-0000-000000000000'; + + const { data, error: loadError } = await supabase + .from('recipients') + .select( + 'id,first_name,last_name,relationship,country,city,mobile_number,photo_path' + ) + .eq('id', id) + .eq('user_id', ownerId) + .single(); + + if (loadError || !data) { + showError(loadError?.message ?? 'Recipient not found'); + setLoading(false); + history.replace('/recipients'); + return; + } + + const recipient = data as RecipientRow; + await applyRecipientToForm(recipient); + setLoading(false); + }; + + const handlePhotoChange = (event: React.ChangeEvent) => { + const file = event.target.files?.[0]; + if (!file) return; + + if (previewObjectUrlRef.current) { + URL.revokeObjectURL(previewObjectUrlRef.current); + } + + const objectUrl = URL.createObjectURL(file); + previewObjectUrlRef.current = objectUrl; + setPhotoFile(file); + setPhotoPreview(objectUrl); + }; + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + if (!user) { + showError('Please sign in again to save this loved one'); + return; + } + + const payload = { + first_name: firstName.trim(), + last_name: lastName.trim(), + relationship: relationship.trim(), + country: country.trim(), + city: city.trim(), + mobile_number: + `${selectedCountry.dialCode} ${mobileNumber.trim()}`.trim(), + updated_at: new Date().toISOString(), + }; + + if ( + !payload.first_name || + !payload.last_name || + !payload.relationship || + !payload.country || + !payload.city || + !payload.mobile_number + ) { + showError('Please complete all required fields'); + return; + } + + setSaving(true); + setError(null); + + let photoPath = existingPhotoPath; + if (photoFile) { + const extension = photoFile.name.split('.').pop() || 'jpg'; + photoPath = `${user.id}/${Date.now()}.${extension}`; + const { error: uploadError } = await supabase.storage + .from('recipient-photos') + .upload(photoPath, photoFile); + + if (uploadError) { + showError(uploadError.message); + setSaving(false); + return; + } + } + + if (isEdit && id) { + const { error: updateError } = await supabase + .from('recipients') + .update({ ...payload, photo_path: photoPath }) + .eq('id', id) + .eq('user_id', user.id); + + if (updateError) { + showError(updateError.message); + setSaving(false); + return; + } + + setSaving(false); + history.push(`/recipients/${id}`); + return; + } + + const { data, error: insertError } = await supabase + .from('recipients') + .insert({ + user_id: user.id, + ...payload, + photo_path: photoPath, + }) + .select('id') + .single(); + + if (insertError || !data) { + showError(insertError?.message ?? 'Could not create recipient'); + setSaving(false); + return; + } + + setSaving(false); + history.replace(`/recipients/${data.id}`); + }; + + const initials = `${firstName.charAt(0)}${lastName.charAt(0)}`.toUpperCase(); + + return ( + + + + + + + + + + {isEdit ? 'Edit loved one' : 'Add loved one'} + + + + + +
+
+
+ + +
+ + + + + + + + {error && ( +

+ {error} +

+ )} +
+ +
+ + {saving ? 'Saving...' : isEdit ? 'Save changes' : 'Add loved one'} + +
+
+ + setShowCountrySheet(false)} + initialBreakpoint={1} + breakpoints={[0, 1]} + handle={true} + className="country-sheet-modal" + > +
+
+

Select country

+ setShowCountrySheet(false)} + aria-label="Close country selector" + > + + +
+
+ + {countryOptions.map((option) => { + const isSelected = option.name === country; + return ( + + ); + })} + +
+
+
+ + setShowLocationSheet(false)} + initialBreakpoint={1} + breakpoints={[0, 1]} + handle={true} + className="country-sheet-modal" + > +
+
+

Select location

+ setShowLocationSheet(false)} + aria-label="Close location selector" + > + + +
+
+
+ Choose a city, town, or rural district where support collection + is available. +
+ {locationGroups.map((group) => ( +
+

{group.group}

+ {group.options.map((option) => { + const isSelected = option.name === city; + return ( + + ); + })} +
+ ))} +
+
+
+
+
+ ); +}; + +export default RecipientFormPage; diff --git a/src/pages/RecipientsPage.tsx b/src/pages/RecipientsPage.tsx new file mode 100644 index 0000000..c533dd7 --- /dev/null +++ b/src/pages/RecipientsPage.tsx @@ -0,0 +1,345 @@ +import React, { useMemo, useState } from 'react'; +import { + IonButton, + IonContent, + IonIcon, + IonPage, + IonRefresher, + IonRefresherContent, + IonSkeletonText, + useIonViewWillEnter, +} from '@ionic/react'; +import { addOutline, peopleOutline } from 'ionicons/icons'; +import { useHistory } from 'react-router-dom'; +import dadImage from '../assets/dad.jpg'; +import momImage from '../assets/mom.jpg'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import ListSearchRow from '../components/ListSearchRow'; +import RecipientListCard, { + RecipientListItem, +} from '../components/RecipientListCard'; +import '../styles/recipients.css'; + +type RecipientRow = { + id: string; + first_name: string; + last_name: string; + relationship: string; + country: string; + city: string; + photo_path: string | null; + created_at: string; +}; + +type ActivityRow = { + recipient_id: string | null; + event_at: string; +}; + +const formatLastActivity = (dateText?: string) => { + if (!dateText) return 'No support yet'; + const diffMs = Date.now() - new Date(dateText).getTime(); + const diffDays = Math.max(0, Math.floor(diffMs / 86400000)); + if (diffDays === 0) return 'Today'; + if (diffDays === 1) return 'Yesterday'; + return `${diffDays} days ago`; +}; + +const getSeededRecipientImage = (firstName?: string | null) => { + const normalized = firstName?.trim().toLowerCase(); + if (normalized === 'mum' || normalized === 'mom') return momImage; + if (normalized === 'dad' || normalized === 'father') return dadImage; + return null; +}; + +const RecipientsPage: React.FC = () => { + const history = useHistory(); + const { user } = useAuth(); + const [recipients, setRecipients] = useState([]); + const [searchTerm, setSearchTerm] = useState(''); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + useIonViewWillEnter(() => { + void loadRecipients(); + }); + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const loadRecipients = async () => { + if (!user) { + // Auth bypass mode: fetch seeded preview recipients from Supabase + setLoading(true); + setError(null); + const [recipientsResult, activityResult] = await Promise.all([ + supabase + .from('recipients') + .select( + 'id,first_name,last_name,relationship,country,city,photo_path,created_at' + ) + .eq('user_id', '00000000-0000-0000-0000-000000000000') + .order('created_at', { ascending: false }), + supabase + .from('activity_events') + .select('recipient_id,event_at') + .eq('user_id', '00000000-0000-0000-0000-000000000000') + .order('event_at', { ascending: false }) + .limit(100), + ]); + + const queryError = recipientsResult.error ?? activityResult.error; + if (queryError) { + showError(queryError.message); + setLoading(false); + return; + } + + const activities = (activityResult.data ?? []) as ActivityRow[]; + const list = await Promise.all( + ((recipientsResult.data ?? []) as RecipientRow[]).map( + async (recipient) => { + const latestActivity = activities.find( + (a) => a.recipient_id === recipient.id + ); + + let avatarUrl = null; + if (recipient.photo_path) { + const { data: urlData } = await supabase.storage + .from('recipient-photos') + .createSignedUrl(recipient.photo_path, 3600); + avatarUrl = urlData?.signedUrl ?? null; + } + + if (!avatarUrl) { + avatarUrl = getSeededRecipientImage(recipient.first_name); + } + + return { + id: recipient.id, + firstName: recipient.first_name, + lastName: recipient.last_name, + relationship: recipient.relationship, + location: `${recipient.city}, ${recipient.country}`, + lastActivityText: formatLastActivity(latestActivity?.event_at), + avatarUrl, + }; + } + ) + ); + setRecipients(list); + setLoading(false); + return; + } + + setLoading(true); + setError(null); + + const [recipientsResult, activityResult] = await Promise.all([ + supabase + .from('recipients') + .select( + 'id,first_name,last_name,relationship,country,city,photo_path,created_at' + ) + .eq('user_id', user.id) + .eq('is_active', true) + .order('created_at', { ascending: false }), + supabase + .from('activity_events') + .select('recipient_id,event_at') + .eq('user_id', user.id) + .order('event_at', { ascending: false }) + .limit(100), + ]); + + const queryError = recipientsResult.error ?? activityResult.error; + if (queryError) { + showError(queryError.message); + setLoading(false); + return; + } + + const activities = (activityResult.data ?? []) as ActivityRow[]; + const list = await Promise.all( + ((recipientsResult.data ?? []) as RecipientRow[]).map( + async (recipient) => { + const latestActivity = activities.find( + (activity) => activity.recipient_id === recipient.id + ); + let avatarUrl = recipient.photo_path + ? (( + await supabase.storage + .from('recipient-photos') + .createSignedUrl(recipient.photo_path, 3600) + ).data?.signedUrl ?? null) + : null; + + if (!avatarUrl) { + avatarUrl = getSeededRecipientImage(recipient.first_name); + } + + return { + id: recipient.id, + firstName: recipient.first_name, + lastName: recipient.last_name, + relationship: recipient.relationship, + location: `${recipient.city}, ${recipient.country}`, + lastActivityText: formatLastActivity(latestActivity?.event_at), + avatarUrl, + }; + } + ) + ); + + setRecipients(list); + setLoading(false); + }; + + const visibleRecipients = useMemo(() => { + const query = searchTerm.trim().toLowerCase(); + if (!query) return recipients; + return recipients.filter((recipient) => + [ + recipient.firstName, + recipient.lastName, + recipient.relationship, + recipient.location, + ] + .join(' ') + .toLowerCase() + .includes(query) + ); + }, [recipients, searchTerm]); + + const handleRefresh = async (event: CustomEvent) => { + await loadRecipients(); + event.detail.complete(); + }; + + return ( + + + + + + +
+
+

Loved ones

+

+ Manage family and care recipients +

+
+ history.push('/recipients/new')} + > + + Add + +
+ + + + {error && ( +

+ {error} +

+ )} + + {loading ? ( +
+ {[1, 2, 3].map((item) => ( +
+ +
+ + +
+
+ ))} +
+ ) : visibleRecipients.length === 0 ? ( +
+ +

+ {recipients.length === 0 + ? 'No loved ones yet' + : 'No matches found'} +

+

+ {recipients.length === 0 + ? 'Add your first loved one so you can send support with confidence.' + : 'Try a different name, relationship, or city.'} +

+ {recipients.length === 0 && ( + history.push('/recipients/new')} + style={ + { + '--background': '#6d28d9', + '--border-radius': '999px', + '--box-shadow': 'none', + } as React.CSSProperties + } + > + + Add loved one + + )} +
+ ) : ( +
+ {visibleRecipients.map((recipient) => ( + history.push(`/recipients/${id}`)} + /> + ))} +
+ )} +
+
+ ); +}; + +export default RecipientsPage; diff --git a/src/pages/SetupProfilePage.tsx b/src/pages/SetupProfilePage.tsx new file mode 100644 index 0000000..32fa534 --- /dev/null +++ b/src/pages/SetupProfilePage.tsx @@ -0,0 +1,366 @@ +import React, { useEffect, useRef, useState } from 'react'; +import { IonButton, IonContent, IonInput, IonPage } from '@ionic/react'; +import { useHistory } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import AvatarPicker from '../components/AvatarPicker'; +import '../styles/auth.css'; + +type ProfileDraft = { + first_name?: string | null; + last_name?: string | null; + phone?: string | null; + country_of_residence?: string | null; + avatar_path?: string | null; +}; + +const SetupProfilePage: React.FC = () => { + const history = useHistory(); + const { user, setProfile, signOut } = useAuth(); + + const [firstName, setFirstName] = useState(''); + const [lastName, setLastName] = useState(''); + const [phone, setPhone] = useState(''); + const [country, setCountry] = useState(''); + const [avatarFile, setAvatarFile] = useState(null); + const [avatarPreview, setAvatarPreview] = useState(null); + const messageTimerRef = useRef | null>(null); + const mountedRef = useRef(true); + const [loading, setLoading] = useState(false); + const [prefilling, setPrefilling] = useState(true); + const [error, setError] = useState(null); + + useEffect(() => { + mountedRef.current = true; + return () => { + mountedRef.current = false; + if (messageTimerRef.current) { + clearTimeout(messageTimerRef.current); + } + }; + }, []); + + useEffect(() => { + loadExistingProfile(); + }, [user?.id]); + + const showError = (message: string) => { + if (messageTimerRef.current) { + clearTimeout(messageTimerRef.current); + } + setError(message); + messageTimerRef.current = setTimeout(() => { + if (mountedRef.current) { + setError(null); + } + }, 4000); + }; + + const loadExistingProfile = async () => { + if (!user) { + setPrefilling(false); + return; + } + + setPrefilling(true); + let profile: ProfileDraft | null = null; + let profileLoadError: unknown = null; + + try { + const profileLoadRequest = supabase + .from('profiles') + .select('first_name,last_name,phone,country_of_residence,avatar_path') + .eq('id', user.id) + .maybeSingle(); + + const result = await Promise.race([ + profileLoadRequest, + new Promise((_, reject) => + setTimeout( + () => reject(new Error('Profile setup loading timed out.')), + 8000 + ) + ), + ]); + + profile = result.data as ProfileDraft | null; + profileLoadError = result.error; + } catch (loadError) { + profileLoadError = loadError; + } + + if (!mountedRef.current) return; + + if (profileLoadError) { + console.error( + '[SetupProfilePage] Failed to load existing profile', + profileLoadError + ); + showError( + 'We could not load your profile yet. You can still finish setup.' + ); + } + if (profile) { + setFirstName(profile.first_name ?? ''); + setLastName(profile.last_name ?? ''); + setPhone(profile.phone ?? ''); + setCountry(profile.country_of_residence ?? ''); + if (profile.avatar_path) { + const { data: publicUrlData } = supabase.storage + .from('avatars') + .getPublicUrl(profile.avatar_path); + setAvatarPreview(publicUrlData.publicUrl); + } + } else if (user.user_metadata?.full_name) { + const parts = String(user.user_metadata.full_name).split(' '); + setFirstName(parts[0] ?? ''); + setLastName(parts.slice(1).join(' ')); + } + setPrefilling(false); + }; + + const handleAvatarChange = (event: React.ChangeEvent) => { + const file = event.target.files?.[0]; + if (!file) return; + + const reader = new FileReader(); + reader.onload = () => { + if (!mountedRef.current) return; + setAvatarFile(file); + setAvatarPreview( + typeof reader.result === 'string' ? reader.result : null + ); + }; + reader.onerror = () => { + showError( + 'We could not preview that image. Please choose another photo.' + ); + }; + reader.readAsDataURL(file); + }; + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + + if (!user) { + showError('Please sign in again to complete your profile'); + return; + } + + const cleanFirstName = firstName.trim(); + const cleanLastName = lastName.trim(); + const cleanPhone = phone.trim(); + const cleanCountry = country.trim(); + + if (!cleanFirstName || !cleanLastName || !cleanPhone || !cleanCountry) { + showError('Please complete all profile fields'); + return; + } + + setLoading(true); + setError(null); + + try { + let avatarPath: string | null = null; + if (avatarFile) { + const extension = avatarFile.name.split('.').pop() || 'jpg'; + avatarPath = `${user.id}/${Date.now()}.${extension}`; + const uploadRequest = supabase.storage + .from('avatars') + .upload(avatarPath, avatarFile); + const { error: uploadError } = await Promise.race([ + uploadRequest, + new Promise((_, reject) => + setTimeout( + () => + reject(new Error('Photo upload timed out. Please try again.')), + 12000 + ) + ), + ]); + + if (uploadError) { + showError(uploadError.message); + setLoading(false); + return; + } + } + + const now = new Date().toISOString(); + const profilePayload = { + id: user.id, + first_name: cleanFirstName, + last_name: cleanLastName, + full_name: `${cleanFirstName} ${cleanLastName}`, + phone: cleanPhone, + country_of_residence: cleanCountry, + ...(avatarPath ? { avatar_path: avatarPath } : {}), + notification_push_enabled: true, + notification_email_enabled: true, + notification_sms_enabled: false, + updated_at: now, + }; + + const profileSaveRequest = supabase + .from('profiles') + .upsert(profilePayload, { onConflict: 'id' }) + .select('*') + .single(); + + const { data: savedProfile, error: profileError } = await Promise.race([ + profileSaveRequest, + new Promise((_, reject) => + setTimeout( + () => + reject(new Error('Profile save timed out. Please try again.')), + 12000 + ) + ), + ]); + + if (profileError) { + showError(profileError.message); + setLoading(false); + return; + } + + if (!mountedRef.current) return; + + setLoading(false); + setProfile(savedProfile); + history.replace('/home'); + } catch (submitError: any) { + if (!mountedRef.current) return; + showError( + submitError.message || 'Profile setup failed. Please try again.' + ); + setLoading(false); + } + }; + + const initials = `${firstName.charAt(0)}${lastName.charAt(0)}`.toUpperCase(); + + const handleLogout = async () => { + if (loading || prefilling) return; + + setLoading(true); + setError(null); + + try { + await signOut(); + history.replace('/auth'); + } catch (logoutError: any) { + showError( + logoutError?.message || 'We could not sign you out. Please try again.' + ); + setLoading(false); + } + }; + + return ( + + +
+
+

Profile setup

+

Tell us about you

+

+ We use this to personalise your Kumusha dashboard and keep your + account secure. +

+
+ +
+ + + setFirstName(event.detail.value ?? '')} + disabled={loading || prefilling} + placeholder="e.g. Tadiwa" + className="auth-field" + /> + setLastName(event.detail.value ?? '')} + disabled={loading || prefilling} + placeholder="e.g. Moyo" + className="auth-field" + /> + setPhone(event.detail.value ?? '')} + disabled={loading || prefilling} + placeholder="e.g. +44 7123 456789" + className="auth-field" + /> + setCountry(event.detail.value ?? '')} + disabled={loading || prefilling} + placeholder="e.g. United Kingdom" + className="auth-field" + /> + + {error && ( +

+ {error} +

+ )} + +
+ + Logout + + + {loading ? 'Saving profile...' : 'Finish setup'} + +
+ +
+
+
+ ); +}; + +export default SetupProfilePage; diff --git a/src/pages/SupportFlowPage.tsx b/src/pages/SupportFlowPage.tsx new file mode 100644 index 0000000..0a0c259 --- /dev/null +++ b/src/pages/SupportFlowPage.tsx @@ -0,0 +1,1803 @@ +import React, { useEffect, useMemo, useState } from 'react'; +import type { CSSProperties } from 'react'; +import { + IonAvatar, + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonInput, + IonItem, + IonLabel, + IonModal, + IonPage, + IonTitle, + IonToolbar, + IonSelect, + IonSelectOption, + IonList, + useIonViewWillEnter, +} from '@ionic/react'; +import { + addOutline, + cardOutline, + chevronBackOutline, + chevronDownOutline, + checkmarkCircleOutline, + closeCircleOutline, + closeOutline, + flashOutline, + logoApple, + logoPaypal, + medkitOutline, + phonePortraitOutline, + timeOutline, +} from 'ionicons/icons'; +import { useHistory, useLocation } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import momImage from '../assets/mom.jpg'; +import dadImage from '../assets/dad.jpg'; +import basketIcon from '../assets/basket.png'; +import { formatMoney } from '../utils/formatMoney'; +import '../styles/support.css'; + +type ServiceType = 'grocery' | 'medication' | 'airtime' | 'electricity'; + +type RecipientOption = { + id: string; + first_name: string; + last_name: string; + photo_url?: string | null; + photo_path?: string | null; +}; + +type MerchantOption = { + id: string; + name: string; + branch_name: string | null; + merchant_type: string; +}; + +type LocationState = { + recipientId?: string; + serviceType?: ServiceType; + amount?: number; + merchantId?: string | null; + network?: string | null; + meterNumber?: string | null; + startAtAmount?: boolean; + parentRoot?: string; +}; + +const services: Array<{ + type: ServiceType; + label: string; + reviewLabel: string; + amountHeading: string; + amountHint: string; + icon?: string; + imageSrc?: string; + imageAlt?: string; + color: string; + bg: string; + cardBg: string; + selectedTint: string; +}> = [ + { + type: 'grocery', + label: 'Groceries', + reviewLabel: 'Grocery voucher', + amountHeading: 'Voucher amount', + amountHint: 'You are sending a grocery voucher.', + imageSrc: basketIcon, + imageAlt: 'Groceries', + color: '#6d28d9', + bg: 'rgba(109,40,217,0.12)', + cardBg: 'rgba(109,40,217,0.03)', + selectedTint: 'rgba(109,40,217,0.08)', + }, + { + type: 'medication', + label: 'Medication', + reviewLabel: 'Medication voucher', + amountHeading: 'Voucher amount', + amountHint: 'You are sending a medication voucher.', + icon: medkitOutline, + color: '#16a34a', + bg: 'rgba(22,163,74,0.14)', + cardBg: 'rgba(22,163,74,0.06)', + selectedTint: 'rgba(22,163,74,0.08)', + }, + { + type: 'airtime', + label: 'Airtime & Data', + reviewLabel: 'Airtime & data', + amountHeading: 'Choose airtime & data amount', + amountHint: 'You are topping up airtime or data.', + icon: phonePortraitOutline, + color: '#3b82f6', + bg: 'rgba(59,130,246,0.1)', + cardBg: 'rgba(59,130,246,0.03)', + selectedTint: 'rgba(59,130,246,0.08)', + }, + { + type: 'electricity', + label: 'Electricity', + reviewLabel: 'Electricity', + amountHeading: 'Choose electricity amount', + amountHint: 'You are buying an electricity token.', + icon: flashOutline, + color: '#f59e0b', + bg: 'rgba(245,158,11,0.1)', + cardBg: 'rgba(245,158,11,0.03)', + selectedTint: 'rgba(245,158,11,0.08)', + }, +]; + +const amountPresets = [10, 20, 50, 100]; +const networks = ['Econet', 'NetOne', 'Telecel']; +const previewUserId = '00000000-0000-0000-0000-000000000000'; + +const previewRecipients: RecipientOption[] = [ + { + id: 'preview-mum', + first_name: 'Mum', + last_name: 'Moyo', + photo_url: momImage, + }, + { + id: 'preview-dad', + first_name: 'Dad', + last_name: 'Moyo', + photo_url: dadImage, + }, +]; + +const paymentMethods = [ + { + value: 'card', + label: 'Visa ending 4242', + detail: 'Default card • reusable checkout', + kind: 'card' as const, + }, + { + value: 'apple_pay', + label: 'Apple Pay', + detail: 'Wallet checkout', + kind: 'apple' as const, + }, + { + value: 'google_pay', + label: 'Google Pay', + detail: 'Fast wallet checkout', + kind: 'google' as const, + }, + { + value: 'paypal', + label: 'PayPal', + detail: 'Pay with PayPal', + kind: 'paypal' as const, + }, +] as const; + +const getRecipientPhoto = (recipient?: RecipientOption | null) => { + if (!recipient) return null; + + const photoPath = recipient.photo_path?.toLowerCase() ?? ''; + if (photoPath === 'mom.jpg' || photoPath === 'mum.jpg') return momImage; + if (photoPath === 'dad.jpg' || photoPath === 'father.jpg') return dadImage; + + if (recipient.photo_url) return recipient.photo_url; + if (recipient.first_name.toLowerCase() === 'mum') return momImage; + if (recipient.first_name.toLowerCase() === 'dad') return dadImage; + return null; +}; + +const sanitizeAmount = (raw: string) => { + const cleaned = raw.replace(/[^\d.]/g, ''); + const parts = cleaned.split('.'); + const normalized = + parts.length <= 1 ? cleaned : `${parts[0]}.${parts.slice(1).join('')}`; + const dotIndex = normalized.indexOf('.'); + return dotIndex === -1 ? normalized : normalized.slice(0, dotIndex + 3); +}; + +const SupportFlowPage: React.FC = () => { + const history = useHistory(); + const location = useLocation(); + const { user } = useAuth(); + + const [step, setStep] = useState(1); + const [recipients, setRecipients] = useState([]); + const [merchants, setMerchants] = useState([]); + const [selectedRecipientId, setSelectedRecipientId] = useState( + location.state?.recipientId ?? null + ); + const [serviceType, setServiceType] = useState( + location.state?.serviceType ?? null + ); + const [merchantId, setMerchantId] = useState(null); + const [network, setNetwork] = useState(null); + const [meterNumber, setMeterNumber] = useState(''); + const [amountDisplay, setAmountDisplay] = useState(''); + const [isCustomAmountSelected, setIsCustomAmountSelected] = useState(false); + const [platformFee, setPlatformFee] = useState(0); + const [totalAmount, setTotalAmount] = useState(0); + const [orderId, setOrderId] = useState(null); + const [paymentMethod, setPaymentMethod] = useState('card'); + const [isPaymentSheetOpen, setIsPaymentSheetOpen] = useState(false); + const [loading, setLoading] = useState(!user); + const [submitting, setSubmitting] = useState(false); + const [error, setError] = useState(null); + const [isRecipientSheetOpen, setIsRecipientSheetOpen] = useState(false); + + const parentRoot = location.state?.parentRoot ?? '/home'; + + const [paymentResult, setPaymentResult] = useState< + 'idle' | 'success' | 'failure' + >('idle'); + const [paymentResultMessage, setPaymentResultMessage] = useState< + string | null + >(null); + const isShowingPaymentResult = paymentResult !== 'idle'; + + const [isRecurringEnabled, setIsRecurringEnabled] = useState(false); + const [frequencyUnit, setFrequencyUnit] = useState<'weekly' | 'monthly'>( + 'weekly' + ); + const [frequencyInterval, setFrequencyInterval] = useState(1); + + const requiresSupportDetails = + serviceType === 'airtime' || serviceType === 'electricity'; + const totalSteps = requiresSupportDetails ? 5 : 4; + const amountStep = requiresSupportDetails ? 4 : 3; + const reviewStep = requiresSupportDetails ? 5 : 4; + + const parsedAmount = useMemo(() => { + if (!amountDisplay || amountDisplay === '.') return null; + const value = Number(amountDisplay); + return Number.isFinite(value) && value > 0 ? value : null; + }, [amountDisplay]); + + const selectedService = useMemo( + () => services.find((item) => item.type === serviceType) ?? null, + [serviceType] + ); + + const pageBackground = selectedService + ? `linear-gradient(180deg, ${selectedService.selectedTint} 0%, #fafafa 240px)` + : '#fafafa'; + + const themeStyle = selectedService + ? ({ + '--flow-accent': selectedService.color, + '--flow-accent-soft': selectedService.selectedTint, + '--flow-icon-soft': selectedService.bg, + '--flow-card-soft': selectedService.cardBg, + } as CSSProperties) + : undefined; + + const flowTitle = selectedService?.label ?? 'Send support'; + const isPresetAmountSelected = amountPresets.includes(Number(amountDisplay)); + + useEffect(() => { + void loadInitialData(); + }, [user?.id]); + + useIonViewWillEnter(() => { + const presetRecipientId = location.state?.recipientId ?? null; + const presetServiceType = location.state?.serviceType ?? null; + const presetAmount = location.state?.amount; + const presetAmountDisplay = + typeof presetAmount === 'number' && Number.isFinite(presetAmount) + ? presetAmount.toFixed(2) + : ''; + const presetStartAtAmount = Boolean(location.state?.startAtAmount); + const presetRequiresSupportDetails = + presetServiceType === 'airtime' || presetServiceType === 'electricity'; + const presetAmountStep = presetRequiresSupportDetails ? 4 : 3; + + setStep( + presetStartAtAmount && presetRecipientId && presetServiceType + ? presetAmountStep + : presetRecipientId && presetServiceType + ? presetAmountStep + : presetRecipientId || presetServiceType + ? 2 + : 1 + ); + setSelectedRecipientId(presetRecipientId); + setServiceType(presetServiceType); + setMerchantId(location.state?.merchantId ?? null); + setNetwork(location.state?.network ?? null); + setMeterNumber(location.state?.meterNumber ?? ''); + setAmountDisplay(presetAmountDisplay); + setIsCustomAmountSelected( + Boolean( + presetAmountDisplay && + !amountPresets.includes(Number(presetAmountDisplay)) + ) + ); + setPlatformFee(0); + setTotalAmount(0); + setOrderId(null); + setPaymentMethod('card'); + setIsPaymentSheetOpen(false); + setSubmitting(false); + setError(null); + setPaymentResult('idle'); + setPaymentResultMessage(null); + setIsRecurringEnabled(false); + setFrequencyUnit('weekly'); + setFrequencyInterval(1); + }); + + useEffect(() => { + if (serviceType === 'grocery' || serviceType === 'medication') { + void loadMerchantsForService(serviceType); + } else { + setMerchantId(null); + setMerchants([]); + } + }, [serviceType]); + + useEffect(() => { + const fee = parsedAmount + ? Number((2.99 + parsedAmount * 0.03).toFixed(2)) + : 0; + setPlatformFee(fee); + setTotalAmount(parsedAmount ? Number((parsedAmount + fee).toFixed(2)) : 0); + }, [parsedAmount]); + + useEffect(() => { + const loadExistingSchedule = async () => { + if (!user || !selectedRecipientId || !serviceType) return; + const { data, error: fetchError } = await supabase + .from('support_schedules') + .select( + 'id, frequency_unit, frequency_interval, next_due_at, is_active' + ) + .eq('recipient_id', selectedRecipientId) + .eq('service_type', serviceType) + .eq('user_id', user.id) + .maybeSingle(); + + if (fetchError) { + showError('Could not load support frequency'); + } else if (data) { + setIsRecurringEnabled(data.is_active); + setFrequencyUnit(data.frequency_unit as 'weekly' | 'monthly'); + setFrequencyInterval(data.frequency_interval); + } else { + setIsRecurringEnabled(false); + setFrequencyUnit('weekly'); + setFrequencyInterval( + serviceType === 'grocery' || serviceType === 'medication' ? 4 : 1 + ); + } + }; + void loadExistingSchedule(); + }, [user?.id, selectedRecipientId, serviceType]); + + const showError = (message: string) => { + setError(message); + setTimeout(() => setError(null), 4000); + }; + + const resolveRecipientOptions = async (rows: RecipientOption[]) => + Promise.all( + rows.map(async (recipient) => { + const seededPhoto = getRecipientPhoto(recipient); + if (seededPhoto || !recipient.photo_path) { + return { + ...recipient, + photo_url: seededPhoto ?? recipient.photo_url, + }; + } + + const { data: urlData } = await supabase.storage + .from('recipient-photos') + .createSignedUrl(recipient.photo_path, 3600); + + return { + ...recipient, + photo_url: urlData?.signedUrl ?? recipient.photo_url ?? null, + }; + }) + ); + + const loadInitialData = async () => { + setLoading(true); + const activeUserId = user?.id ?? previewUserId; + const query = supabase + .from('recipients') + .select('id,first_name,last_name,photo_path') + .eq('user_id', activeUserId) + .order('created_at', { ascending: false }); + + const { data, error: loadError } = user + ? await query.eq('is_active', true) + : await query; + + if (loadError) { + showError(loadError.message); + const fallbackRecipients = + await resolveRecipientOptions(previewRecipients); + setRecipients(fallbackRecipients); + setSelectedRecipientId( + (current) => current ?? fallbackRecipients[0]?.id ?? null + ); + setLoading(false); + return; + } + + const resolvedRecipients = await resolveRecipientOptions( + (data ?? []) as RecipientOption[] + ); + setRecipients(resolvedRecipients); + setSelectedRecipientId((current) => { + if ( + current && + resolvedRecipients.some((recipient) => recipient.id === current) + ) { + return current; + } + return current ?? resolvedRecipients[0]?.id ?? null; + }); + setLoading(false); + }; + + const loadMerchantsForService = async (nextService: ServiceType) => { + const { data, error: merchantError } = await supabase + .from('merchants') + .select('id,name,branch_name,merchant_type') + .eq('merchant_type', nextService === 'grocery' ? 'grocery' : 'pharmacy') + .eq('is_active', true) + .order('name', { ascending: true }); + + if (merchantError) { + showError(merchantError.message); + return; + } + setMerchants((data ?? []) as MerchantOption[]); + }; + + const handleServiceSelect = (nextService: ServiceType) => { + setServiceType(nextService); + setMerchantId(null); + setNetwork(null); + setMeterNumber(''); + setOrderId(null); + setAmountDisplay(''); + setIsCustomAmountSelected(false); + }; + + const validateCurrentStep = () => { + if (step === 1 && !selectedRecipientId) + return 'Choose who will receive support'; + if (step === 2 && !serviceType) return 'Choose a support type'; + if (step === 3 && requiresSupportDetails) { + if (serviceType === 'airtime' && !network) + return 'Choose a mobile network'; + if (serviceType === 'electricity' && !meterNumber.trim()) + return 'Enter the meter number'; + } + if (step === amountStep && !parsedAmount) return 'Enter a support amount'; + return null; + }; + + const createOrderAndIntent = async () => { + if (!selectedRecipientId || !serviceType || !parsedAmount) return false; + + setSubmitting(true); + + const activeUserId = user?.id ?? previewUserId; + let currentOrderId = orderId; + if (!currentOrderId) { + const { data, error: orderError } = await supabase + .from('support_orders') + .insert({ + user_id: activeUserId, + recipient_id: selectedRecipientId, + merchant_id: merchantId, + service_type: serviceType, + amount: parsedAmount, + platform_fee: platformFee, + total_amount: totalAmount, + currency: 'USD', + status: 'pending_payment', + payment_method: paymentMethod, + network, + meter_number: meterNumber.trim() || null, + }) + .select('id') + .single(); + + if (orderError || !data) { + showError(orderError?.message ?? 'Could not create order'); + setSubmitting(false); + return false; + } + currentOrderId = data.id; + setOrderId(currentOrderId); + } + + if (!user) { + setSubmitting(false); + return true; + } + + const { data: intentData, error: intentError } = + await supabase.functions.invoke('calculate-payment-intent', { + body: { + orderId: currentOrderId, + serviceType, + amount: parsedAmount, + currency: 'USD', + paymentMethod, + }, + }); + + if (intentError) { + showError(intentError.message); + setSubmitting(false); + return false; + } + + const response = intentData as { + platformFee?: number; + totalAmount?: number; + } | null; + setPlatformFee(Number(response?.platformFee ?? platformFee)); + setTotalAmount(Number(response?.totalAmount ?? totalAmount)); + setSubmitting(false); + return true; + }; + + const handleContinue = async () => { + const validation = validateCurrentStep(); + if (validation) { + showError(validation); + return; + } + + if (step === amountStep) { + const ok = await createOrderAndIntent(); + if (!ok) return; + } + + setStep((current) => Math.min(totalSteps, current + 1)); + }; + + const handleBack = () => { + if (paymentResult === 'failure') { + setPaymentResult('idle'); + return; + } + if (paymentResult === 'success') { + if (orderId) { + history.push(`/orders/${orderId}`, { parentRoot }); + } else { + history.push(parentRoot); + } + return; + } + + if (step > 1) { + setStep((current) => Math.max(1, current - 1)); + return; + } + + history.length > 1 ? history.goBack() : history.replace('/home'); + }; + + const handleConfirmPayment = async () => { + if (!orderId || !selectedRecipientId || !serviceType) { + showError('Order is not ready yet'); + return; + } + + setSubmitting(true); + setPaymentResult('idle'); + setPaymentResultMessage(null); + + const { error: fulfilError } = await supabase.functions.invoke( + 'confirm-payment-and-fulfil', + { + body: { orderId }, + } + ); + + if (fulfilError) { + setSubmitting(false); + setPaymentResult('failure'); + setPaymentResultMessage( + fulfilError.message || 'Payment could not be processed at this time.' + ); + return; + } + + if (isRecurringEnabled) { + const scheduleId = await upsertSupportSchedule(); + if (scheduleId) { + await supabase + .from('support_orders') + .update({ recurring_schedule_id: scheduleId }) + .eq('id', orderId); + + await createGeneralizedCareAlert(scheduleId); + } + } + + setSubmitting(false); + setPaymentResult('success'); + setPaymentResultMessage( + `Your ${selectedService?.reviewLabel.toLowerCase()} order is confirmed and ready for ${selectedRecipient?.first_name}.` + ); + }; + + const handleViewOrderDetails = () => { + if (orderId) { + history.push(`/orders/${orderId}`, { parentRoot }); + } else { + history.push(parentRoot); + } + }; + + const handlePaymentResultSecondaryAction = () => { + if (paymentResult === 'success') { + history.push(parentRoot); + } else { + setPaymentResult('idle'); + setPaymentResultMessage(null); + } + }; + + const handleRetryPayment = () => { + setError(null); + setPaymentResult('idle'); + setPaymentResultMessage(null); + void handleConfirmPayment(); + }; + + const calculateNextDueDate = () => { + const date = new Date(); + if (frequencyUnit === 'weekly') { + date.setDate(date.getDate() + 7 * frequencyInterval); + } else { + date.setMonth(date.getMonth() + frequencyInterval); + } + return date.toISOString(); + }; + + const upsertSupportSchedule = async () => { + if (!user || !selectedRecipientId || !serviceType) return null; + const nextDueAt = calculateNextDueDate(); + + const { data: existing } = await supabase + .from('support_schedules') + .select('id') + .eq('user_id', user.id) + .eq('recipient_id', selectedRecipientId) + .eq('service_type', serviceType) + .maybeSingle(); + + if (existing) { + const { error: updateError } = await supabase + .from('support_schedules') + .update({ + frequency_unit: frequencyUnit, + frequency_interval: frequencyInterval, + last_supported_at: new Date().toISOString(), + next_due_at: nextDueAt, + is_active: true, + }) + .eq('id', existing.id); + + if (updateError) { + showError('Failed to update recurring schedule'); + return null; + } + return existing.id; + } + + const { data: inserted, error: insertError } = await supabase + .from('support_schedules') + .insert({ + user_id: user.id, + recipient_id: selectedRecipientId, + service_type: serviceType, + frequency_unit: frequencyUnit, + frequency_interval: frequencyInterval, + last_supported_at: new Date().toISOString(), + next_due_at: nextDueAt, + is_active: true, + }) + .select('id') + .single(); + + if (insertError || !inserted) { + showError('Failed to save recurring schedule'); + return null; + } + return inserted.id; + }; + + const createGeneralizedCareAlert = async (scheduleId: string) => { + if (!user || !selectedRecipientId || !serviceType) return; + const nextDueAt = calculateNextDueDate(); + + const recipient = recipients.find((r) => r.id === selectedRecipientId); + const firstName = recipient?.first_name || 'Loved one'; + + let title = ''; + if (serviceType === 'grocery') title = 'Grocery support due soon'; + else if (serviceType === 'medication') { + title = 'Medication support due soon'; + } else if (serviceType === 'airtime') { + title = 'Airtime running low soon'; + } else if (serviceType === 'electricity') { + title = 'Electricity top-up may be needed'; + } + + let intervalStr = ''; + if (frequencyInterval === 1) { + intervalStr = frequencyUnit === 'weekly' ? 'a week' : 'a month'; + } else { + intervalStr = `${frequencyInterval} ${frequencyUnit === 'weekly' ? 'weeks' : 'months'}`; + } + const body = `For ${firstName} • in ${intervalStr}`; + + const { data: existingAlert } = await supabase + .from('care_alerts') + .select('id') + .eq('schedule_id', scheduleId) + .is('dismissed_at', null) + .maybeSingle(); + + if (existingAlert) { + await supabase + .from('care_alerts') + .update({ + title, + body, + due_at: nextDueAt, + service_type: serviceType, + }) + .eq('id', existingAlert.id); + } else { + await supabase.from('care_alerts').insert({ + user_id: user.id, + recipient_id: selectedRecipientId, + schedule_id: scheduleId, + service_type: serviceType, + alert_type: 'support_due', + title, + body, + severity: 'info', + due_at: nextDueAt, + }); + } + }; + + const ctaLabel = + step === amountStep + ? submitting + ? 'Preparing...' + : 'Review payment' + : step === reviewStep + ? submitting + ? 'Confirming...' + : 'Confirm payment' + : 'Continue'; + + const renderPaymentResultCard = () => { + if (paymentResult === 'idle') return null; + + const isSuccess = paymentResult === 'success'; + + return ( +
+
+ +
+
+

+ Payment {isSuccess ? 'Confirmed' : 'Declined'} +

+

+ {isSuccess ? 'Payment successful' : 'Payment failed'} +

+

{paymentResultMessage}

+
+ +
+
+ Recipient + + {selectedRecipient + ? `${selectedRecipient.first_name} ${selectedRecipient.last_name}` + : ''} + +
+
+ Support type + {selectedService?.label} +
+
+ Total paid + {formatMoney(totalAmount)} +
+
+ +
+ {isSuccess ? ( + <> + + View order details + + + Back to activity + + + ) : ( + <> + + {submitting ? 'Retrying...' : 'Try payment again'} + + + Back to review + + + )} +
+
+ ); + }; + + const selectedRecipient = + recipients.find((recipient) => recipient.id === selectedRecipientId) ?? + null; + const selectedRecipientPhoto = getRecipientPhoto(selectedRecipient); + const selectedPaymentMethod = + paymentMethods.find((method) => method.value === paymentMethod) ?? + paymentMethods[0]; + + return ( + + + + + 1 ? 'Go to previous step' : 'Go back'} + > + + + + + {selectedService && ( + + )} + {flowTitle} + + + + + +
+ {!isShowingPaymentResult && ( +
+ {Array.from({ length: totalSteps }, (_, index) => index + 1).map( + (item, index) => ( + +
+ {item} +
+ {index < totalSteps - 1 && ( +
+ )} + + ) + )} +
+ )} + + {error && !isShowingPaymentResult && ( +

+ {error} +

+ )} + + {isShowingPaymentResult && renderPaymentResultCard()} + + {!isShowingPaymentResult && step === 1 && ( +
+

Who are you supporting?

+ + {!loading && recipients.length === 0 && ( + history.push('/recipients/new')} + > + Add your first loved one + + )} +
+ )} + + {!isShowingPaymentResult && step === 2 && ( +
+

Choose support type

+
+ {services.map((service) => ( + + ))} +
+
+ )} + + {!isShowingPaymentResult && step === 3 && ( + <> + {(serviceType === 'airtime' || serviceType === 'electricity') && ( +
+

Support details

+ {serviceType === 'airtime' && ( + setNetwork(event.detail.value)} + > + {networks.map((item) => ( + + {item} + + ))} + + )} + {serviceType === 'electricity' && ( + + setMeterNumber( + (event.detail.value ?? '').replace(/\D/g, '') + ) + } + /> + )} +
+ )} + + )} + + {!isShowingPaymentResult && step === amountStep && ( +
+ {selectedService && ( +
+ +
+

+ {selectedRecipient + ? `For ${selectedRecipient.first_name} ${selectedRecipient.last_name}` + : 'Selected recipient'} +

+

+ {selectedService.amountHeading} +

+

+ {selectedService.amountHint} +

+
+
+ )} + {!selectedService && ( +

+ Choose amount +

+ )} +
+ {amountPresets.map((amount) => ( + + ))} + +
+ {isCustomAmountSelected && ( + + + $ + + + setAmountDisplay(sanitizeAmount(event.detail.value ?? '')) + } + /> + + )} + + {parsedAmount && parsedAmount > 0 && ( +
+
+
+
+ +
+
+

+ Repeat support +

+

+ Set up automatic reminders +

+
+
+
setIsRecurringEnabled(!isRecurringEnabled)} + style={{ + width: 44, + height: 24, + borderRadius: 12, + background: isRecurringEnabled + ? 'var(--flow-accent, #6d28d9)' + : 'rgba(23,24,39,0.1)', + position: 'relative', + cursor: 'pointer', + transition: '0.2s', + flexShrink: 0, + }} + > +
+
+
+ + {isRecurringEnabled && ( +
+
+ + +
+ +
+ + Every + +
+ + + {frequencyInterval} + + +
+
+
+ )} +
+ )} +
+ )} + + {!isShowingPaymentResult && step === reviewStep && ( +
+

Review and pay

+
+ {selectedService?.reviewLabel ?? 'Support amount'} + {formatMoney(parsedAmount ?? 0)} +
+ {(serviceType === 'grocery' || serviceType === 'medication') && ( +
+
+ {selectedService?.imageSrc ? ( + + ) : ( + + )} +
+
+

+ Redeemable at any Kumusha{' '} + {serviceType === 'grocery' ? 'grocery' : 'pharmacy'}{' '} + partner +

+

+ The recipient can use this voucher with approved + participating merchants. +

+
+
+ )} +
+ Service fee + {formatMoney(platformFee)} +
+
+ Total + {formatMoney(totalAmount)} +
+ + {isRecurringEnabled && ( +
+ + + Remind me every{' '} + {frequencyInterval === 1 + ? frequencyUnit === 'weekly' + ? 'week' + : 'month' + : `${frequencyInterval} ${frequencyUnit === 'weekly' ? 'weeks' : 'months'}`} + +
+ )} + +
+ + Payment method + + +
+ + Saved card will be reused for + future support in the live version. + +
+ )} + + {!isShowingPaymentResult && ( +
+
+

Total

+

{formatMoney(totalAmount)}

+
+ + {ctaLabel} + +
+ )} +
+ + setIsPaymentSheetOpen(false)} + className="support-payment-modal" + initialBreakpoint={0.58} + breakpoints={[0, 0.58, 0.84]} + handle={true} + > + +
+
+
+

+ Payment method +

+

+ Choose how you want to pay for this support. +

+
+ +
+ + + {paymentMethods.map((method) => { + const isSelected = method.value === paymentMethod; + return ( + + ); + })} + +
+
+
+ + setIsRecipientSheetOpen(false)} + className="support-recipient-modal" + initialBreakpoint={0.55} + breakpoints={[0, 0.55, 0.82]} + handle={true} + > + +
+
+
+

+ Choose recipient +

+

+ Pick who should receive this support. +

+
+ +
+ +
+ {recipients.map((recipient) => { + const photo = getRecipientPhoto(recipient); + const isSelected = recipient.id === selectedRecipientId; + return ( + + ); + })} +
+
+
+
+ + + ); +}; + +export default SupportFlowPage; diff --git a/src/pages/VerifyEmailPage.tsx b/src/pages/VerifyEmailPage.tsx new file mode 100644 index 0000000..492039a --- /dev/null +++ b/src/pages/VerifyEmailPage.tsx @@ -0,0 +1,297 @@ +import React, { useState, useEffect } from 'react'; +import { + IonPage, + IonContent, + IonHeader, + IonToolbar, + IonButtons, + IonTitle, + IonButton, + useIonViewWillEnter, +} from '@ionic/react'; +import { useHistory, useLocation } from 'react-router-dom'; +import { IonIcon } from '@ionic/react'; +import { chevronBackOutline, mailOutline } from 'ionicons/icons'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import OtpInputSlots from '../components/OtpInputSlots'; +import '../styles/auth.css'; + +interface LocationState { + email?: string; + resent?: boolean; +} + +const VerifyEmailPage: React.FC = () => { + const history = useHistory(); + const location = useLocation(); + const { user, profile, profileStatus } = useAuth(); + + const email = + location.state?.email?.trim().toLowerCase() || + localStorage.getItem('kumusha_pending_verification_email') || + ''; + const wasResent = location.state?.resent; + + const [code, setCode] = useState(['', '', '', '', '', '']); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + const [status, setStatus] = useState( + wasResent ? 'We sent a fresh code to your email.' : null + ); + const [cooldown, setCooldown] = useState(wasResent ? 60 : 0); + + useEffect(() => { + if (!email) { + showError( + 'We could not find the email used for sign up. Please sign up again.' + ); + } + }, [email]); + + useEffect(() => { + if (!user || profileStatus === 'loading') return; + + if ( + !profile || + !profile.first_name || + !profile.last_name || + !profile.phone || + !profile.country_of_residence + ) { + history.replace('/setup-profile'); + } else { + history.replace('/home'); + } + }, [user, profile, profileStatus, history]); + + useIonViewWillEnter(() => { + setError(null); + }); + + useEffect(() => { + let timer: ReturnType | undefined; + if (cooldown > 0) { + timer = setTimeout(() => setCooldown((c) => c - 1), 1000); + } + return () => { + if (timer) { + clearTimeout(timer); + } + }; + }, [cooldown]); + + const showError = (msg: string) => { + setStatus(null); + setError(msg); + setTimeout(() => setError(null), 4000); + }; + + const showStatus = (msg: string) => { + setError(null); + setStatus(msg); + setTimeout(() => setStatus(null), 4000); + }; + + const handleDigitChange = (index: number, val: string) => { + const newCode = [...code]; + newCode[index] = val; + setCode(newCode); + }; + + const handlePaste = (e: React.ClipboardEvent) => { + e.preventDefault(); + const pastedData = e.clipboardData + .getData('Text') + .replace(/[^0-9]/g, '') + .slice(0, 6); + if (!pastedData) return; + const newCode = [...code]; + for (let i = 0; i < pastedData.length; i++) { + newCode[i] = pastedData[i]; + } + setCode(newCode); + }; + + const handleVerifyOtp = async () => { + const token = code.join(''); + if (token.length !== 6) { + showError('Please enter the full 6-digit code.'); + return; + } + + if (!email) { + showError( + 'We could not find the email used for sign up. Please go back and create your account again.' + ); + return; + } + + setLoading(true); + setError(null); + setStatus(null); + + const { error: verifyError } = await supabase.auth.verifyOtp({ + email, + token, + type: 'email', + }); + + if (verifyError) { + showError(verifyError.message); + setLoading(false); + return; + } + + localStorage.removeItem('kumusha_pending_verification_email'); + showStatus('Email verified. Finishing your sign in...'); + setLoading(false); + }; + + const handleResend = async () => { + if (cooldown > 0) return; + if (!email) { + showError( + 'We could not find the email used for sign up. Please go back and create your account again.' + ); + return; + } + setError(null); + setStatus(null); + + const { error: resendError } = await supabase.auth.resend({ + type: 'signup', + email, + }); + + if (resendError) { + showError(resendError.message); + return; + } + + setCode(['', '', '', '', '', '']); + setCooldown(60); + showStatus('A new 6-digit code has been sent.'); + }; + + return ( + + + + + history.goBack()}> + + + + Verify email + + + + +
+
+
+ +
+

+ Check your email +

+

+ {email ? ( + <> + We sent a 6-digit code to {email}. Enter it + below to confirm your account and continue. + + ) : ( + 'We could not find the email used for sign up. Go back and create your account again.' + )} +

+
+ +
+
+ + + {status ? ( +
+ {status} +
+ ) : null} + + {error ? ( +
{error}
+ ) : null} + + + + +
+
+
+
+
+ ); +}; + +export default VerifyEmailPage; diff --git a/src/pages/VerifyResetPage.tsx b/src/pages/VerifyResetPage.tsx new file mode 100644 index 0000000..ee2c20d --- /dev/null +++ b/src/pages/VerifyResetPage.tsx @@ -0,0 +1,317 @@ +import React, { useEffect, useState } from 'react'; +import { + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonInput, + IonPage, + IonTitle, + IonToolbar, +} from '@ionic/react'; +import { chevronBackOutline, lockClosedOutline } from 'ionicons/icons'; +import { useHistory, useLocation } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import OtpInputSlots from '../components/OtpInputSlots'; +import '../styles/auth.css'; + +interface LocationState { + email?: string; +} + +const VerifyResetPage: React.FC = () => { + const history = useHistory(); + const location = useLocation(); + const { user, refreshProfile, profileStatus } = useAuth(); + const email = location.state?.email; + + const [code, setCode] = useState(['', '', '', '', '', '']); + const [newPassword, setNewPassword] = useState(''); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + const [status, setStatus] = useState(null); + const [cooldown, setCooldown] = useState(0); + const [passwordUpdated, setPasswordUpdated] = useState(false); + + useEffect(() => { + if (!email) { + history.replace('/forgot-password'); + } + }, [email, history]); + + useEffect(() => { + if (cooldown <= 0) return; + const timer = setTimeout(() => setCooldown((current) => current - 1), 1000); + return () => clearTimeout(timer); + }, [cooldown]); + + useEffect(() => { + if (user && passwordUpdated && profileStatus !== 'loading') { + loadProfileAndNavigate(); + } + }, [user, passwordUpdated, profileStatus]); + + const showMessage = (message: string, kind: 'error' | 'status') => { + if (kind === 'error') { + setError(message); + setStatus(null); + setTimeout(() => setError(null), 4000); + } else { + setStatus(message); + setError(null); + setTimeout(() => setStatus(null), 4000); + } + }; + + const loadProfileAndNavigate = async () => { + if (!user) return; + + const data = await refreshProfile(); + + if ( + !data || + !data.first_name || + !data.last_name || + !data.phone || + !data.country_of_residence + ) { + history.replace('/setup-profile'); + } else { + history.replace('/home'); + } + }; + + const handleDigitChange = (index: number, value: string) => { + const nextCode = [...code]; + nextCode[index] = value.replace(/\D/g, '').slice(-1); + setCode(nextCode); + }; + + const handlePaste = (event: React.ClipboardEvent) => { + event.preventDefault(); + const digits = event.clipboardData + .getData('Text') + .replace(/\D/g, '') + .slice(0, 6); + if (!digits) return; + + const nextCode = ['', '', '', '', '', '']; + digits.split('').forEach((digit, index) => { + nextCode[index] = digit; + }); + setCode(nextCode); + }; + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + + const token = code.join(''); + if (token.length !== 6) { + showMessage('Please enter the 6-digit reset code', 'error'); + return; + } + + if (newPassword.length < 6) { + showMessage('Password must be at least 6 characters', 'error'); + return; + } + + setLoading(true); + setError(null); + setStatus(null); + + const { error: verifyError } = await supabase.auth.verifyOtp({ + email: email!, + token, + type: 'recovery', + }); + + if (verifyError) { + showMessage(verifyError.message, 'error'); + setLoading(false); + return; + } + + const { error: updateError } = await supabase.auth.updateUser({ + password: newPassword, + }); + + if (updateError) { + showMessage(updateError.message, 'error'); + setLoading(false); + return; + } + + showMessage('Password updated', 'status'); + setPasswordUpdated(true); + setLoading(false); + }; + + const handleResend = async () => { + if (cooldown > 0 || !email) return; + + const { error: resendError } = + await supabase.auth.resetPasswordForEmail(email); + if (resendError) { + showMessage(resendError.message, 'error'); + return; + } + + showMessage('A new reset code has been sent', 'status'); + setCooldown(60); + }; + + return ( + + + + + history.goBack()} + style={ + { + '--color': '#111827', + '--border-radius': '12px', + } as React.CSSProperties + } + aria-label="Go back" + > + + + + + New password + + + + + +
+
+
+ +
+
+

Enter your reset code

+

+ Use the 6-digit code sent to {email}, then + choose a new password. +

+
+
+ +
+
+ + + +
+ +
+ setNewPassword(event.detail.value ?? '')} + disabled={loading} + placeholder="Enter a new password" + style={ + { + '--background': '#fafafa', + '--border-radius': '12px', + '--padding-start': '14px', + '--padding-end': '14px', + '--highlight-color-focused': '#6d28d9', + } as React.CSSProperties + } + /> + + {error && ( +

+ {error} +

+ )} + {status && ( +

+ {status} +

+ )} + + + {loading ? 'Updating password...' : 'Update password'} + +
+
+
+
+
+ ); +}; + +export default VerifyResetPage; diff --git a/src/pages/VoucherDetailPage.tsx b/src/pages/VoucherDetailPage.tsx new file mode 100644 index 0000000..6a69e95 --- /dev/null +++ b/src/pages/VoucherDetailPage.tsx @@ -0,0 +1,295 @@ +import React, { useState } from 'react'; +import { + IonButton, + IonButtons, + IonContent, + IonHeader, + IonIcon, + IonPage, + IonSkeletonText, + IonTitle, + IonToolbar, + useIonViewWillEnter, +} from '@ionic/react'; +import { + chevronBackOutline, + copyOutline, + listOutline, + qrCodeOutline, + shieldCheckmarkOutline, +} from 'ionicons/icons'; +import { useHistory, useLocation, useParams } from 'react-router-dom'; +import { supabase } from '../supabase'; +import { useAuth } from '../contexts/AuthContext'; +import { formatMoney } from '../utils/formatMoney'; +import '../styles/support.css'; + +type Params = { id: string }; + +type RedemptionEntry = { + id: string; + redeemed_amount: number; + redeemed_at: string; + merchant_name: string | null; + status: string | null; +}; + +type Voucher = { + id: string; + voucher_code: string; + status: string; + expires_at: string; + qr_payload: string; + voucher_type: string; + redeemed_amount?: number; + remaining_amount?: number; + voucher_redemptions?: RedemptionEntry[] | null; + support_orders?: { + service_type: string; + amount: number; + recipients?: { first_name: string; last_name: string } | null; + merchants?: { name: string; branch_name: string | null } | null; + } | null; +}; + +const VoucherDetailPage: React.FC = () => { + const { id } = useParams(); + const history = useHistory(); + const location = useLocation<{ parentRoot?: string }>(); + const { user } = useAuth(); + const [voucher, setVoucher] = useState(null); + const [loading, setLoading] = useState(true); + const [message, setMessage] = useState(null); + + useIonViewWillEnter(() => { + void loadVoucher(); + }); + + const handleGoBack = () => { + if (history.length > 1) { + history.goBack(); + } else { + history.replace('/activity'); + } + }; + + const parentRoot = location.state?.parentRoot ?? '/activity'; + + const handleGoToParentRoot = () => { + history.replace(parentRoot); + }; + + const showMessage = (text: string) => { + setMessage(text); + setTimeout(() => setMessage(null), 4000); + }; + + const loadVoucher = async () => { + if (!user) return; + setLoading(true); + + const { data, error } = await supabase + .from('vouchers') + .select( + 'id,voucher_code,status,expires_at,qr_payload,voucher_type,redeemed_amount,remaining_amount,voucher_redemptions(id,redeemed_amount,redeemed_at,merchant_name,status),support_orders!inner(service_type,amount,user_id,recipients(first_name,last_name),merchants(name,branch_name))' + ) + .eq('id', id) + .eq('support_orders.user_id', user.id) + .single(); + + if (error || !data) { + showMessage(error?.message ?? 'Voucher not found'); + setLoading(false); + return; + } + + setVoucher(data as unknown as Voucher); + setLoading(false); + }; + + const handleCopyCode = async () => { + if (!voucher) return; + await navigator.clipboard.writeText(voucher.voucher_code); + showMessage('Voucher code copied'); + }; + + const totalAmount = Number(voucher?.support_orders?.amount ?? 0); + const redeemedAmount = Number(voucher?.redeemed_amount ?? 0); + const fallbackRemaining = Math.max(totalAmount - redeemedAmount, 0); + const remainingAmount = Number( + voucher?.remaining_amount ?? fallbackRemaining + ); + const hasPartialRedemption = redeemedAmount > 0 && remainingAmount > 0; + const redemptionHistory = [...(voucher?.voucher_redemptions ?? [])].sort( + (a, b) => + new Date(b.redeemed_at).getTime() - new Date(a.redeemed_at).getTime() + ); + + return ( + + + + + + + + + Voucher + + + + + + + + + + {loading ? ( +
+ + +
+ ) : voucher ? ( + <> + {message && ( +

+ {message} +

+ )} +
+ {voucher.voucher_code} +
+ +
+
+

+ Expires {new Date(voucher.expires_at).toLocaleDateString()} +

+

+ {voucher.support_orders?.merchants + ? `${voucher.support_orders.merchants.name}${voucher.support_orders.merchants.branch_name ? ` — ${voucher.support_orders.merchants.branch_name}` : ''}` + : `Kumusha ${voucher.support_orders?.service_type === 'medication' ? 'pharmacy' : 'grocery'} partner`} +

+

+ For{' '} + {voucher.support_orders?.recipients + ? `${voucher.support_orders.recipients.first_name} ${voucher.support_orders.recipients.last_name}` + : 'recipient'}{' '} + · {formatMoney(Number(voucher.support_orders?.amount ?? 0))} +

+
+ + + Copy code + +
+ + {(hasPartialRedemption || redemptionHistory.length > 0) && ( +
+
+
+

Voucher balance

+

+ Track redeemed and remaining value for this voucher. +

+
+
+ {formatMoney(totalAmount)} +
+
+ +
+
+ Redeemed {formatMoney(redeemedAmount)} +
+
+ Unredeemed {formatMoney(remainingAmount)} +
+
+ + {redemptionHistory.length > 0 && ( +
+

+ Redemption history +

+ {redemptionHistory.map((entry) => ( +
+
+

+ {entry.merchant_name || + voucher.support_orders?.merchants?.name || + `Kumusha ${voucher.support_orders?.service_type === 'medication' ? 'pharmacy' : 'grocery'} partner`} +

+

+ {new Date(entry.redeemed_at).toLocaleString()} +

+
+
+

+ {formatMoney(entry.redeemed_amount)} +

+ + {entry.status || 'Redeemed'} + +
+
+ ))} +
+ )} +
+ )} + +
+ +

+ Redeemable at any approved Kumusha{' '} + {voucher.support_orders?.service_type === 'medication' + ? 'pharmacy' + : 'grocery'}{' '} + partner. Balance updates automatically after partial redemption. + Do not share code. +

+
+ + ) : null} +
+
+ ); +}; + +export default VoucherDetailPage; diff --git a/src/styles/activity.css b/src/styles/activity.css new file mode 100644 index 0000000..075f770 --- /dev/null +++ b/src/styles/activity.css @@ -0,0 +1,507 @@ +/* Activity Feed */ +.activity-top-row { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 16px; + margin: 0 20px 14px; +} + +.activity-title-block { + min-width: 0; + display: flex; + flex-direction: column; + gap: 4px; +} + +.activity-page-title { + font-size: 28px; + font-weight: 700; + line-height: 1.05; + color: #171827; + margin: 0; + letter-spacing: -0.02em; +} + +.activity-page-subtitle { + margin: 0; + color: rgba(23, 24, 39, 0.56); + font-size: 14px; + line-height: 1.35; + font-weight: 500; +} + +.activity-shell { + padding-bottom: calc(130px + var(--ion-safe-area-bottom, 0px)); +} + +.activity-type-filter-row { + display: flex; + align-items: center; + gap: 8px; + margin: 0 20px 12px; + overflow-x: auto; + scrollbar-width: none; +} + +.activity-type-filter-row::-webkit-scrollbar { + display: none; +} + +.activity-type-chip { + flex: 0 0 auto; + background: #ffffff; + color: rgba(23, 24, 39, 0.58); + border: none; + border-radius: 999px; + font-size: 13px; + font-weight: 700; + padding: 9px 16px; + margin: 0; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); +} + +.activity-type-chip.active { + background: #6d28d9; + color: #ffffff; +} + +.activity-filter-row { + margin: 0 20px 18px; +} + +.activity-range-shell { + background: rgba(255, 255, 255, 0.78); + border-radius: 24px; + padding: 6px; +} + +.activity-range-segment { + padding: 0; + background: transparent; + border-radius: 999px; +} + +.activity-range-segment ion-segment-button { + min-height: 46px; + --background: transparent; + --background-checked: #6d28d9; + --color: rgba(23, 24, 39, 0.5); + --color-checked: #ffffff; + --indicator-color: transparent; + --border-radius: 999px; + --padding-start: 2px; + --padding-end: 2px; + text-transform: none; + font-size: 12px; + font-weight: 700; + letter-spacing: -0.01em; +} + +.activity-range-segment ion-label { + margin: 0; + white-space: nowrap; +} + +.activity-grouped-list { + background: rgba(255, 255, 255, 0.94); + border-radius: 24px; + padding: 6px 0; + margin: 0 20px 20px; +} + +.activity-date-group-label { + font-size: 11px; + font-weight: 700; + color: rgba(23, 24, 39, 0.38); + text-transform: uppercase; + letter-spacing: 0.08em; + margin: 16px 20px 8px; +} + +.activity-list-item { + display: flex; + align-items: center; + padding: 14px 20px; + gap: 16px; + cursor: pointer; +} + +.activity-feed-item { + width: 100%; + border: none; + background: transparent; + display: flex; + align-items: flex-start; + gap: 12px; + padding: 14px 16px; + text-align: left; +} + +.activity-feed-item + .activity-feed-item { + border-top: 1px solid rgba(23, 24, 39, 0.06); +} + +.activity-feed-item:disabled { + opacity: 1; +} + +.activity-feed-item:active { + background: rgba(109, 40, 217, 0.03); +} + +.activity-feed-avatar-wrap { + flex-shrink: 0; + margin-top: 2px; +} + +.activity-feed-avatar { + position: relative; + width: 53px; + height: 53px; + border-radius: 999px; + display: flex; + align-items: center; + justify-content: center; + color: #171827; + font-size: 14px; + font-weight: 700; + flex-shrink: 0; + overflow: visible; +} + +.activity-feed-avatar-image { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 999px; +} + +.activity-feed-avatar-lavender { + background: #efe7fb; + color: #6d28d9; +} + +.activity-feed-avatar-mint { + background: #e8f7ee; + color: #16a34a; +} + +.activity-feed-avatar-sky { + background: #eaf3ff; + color: #3b82f6; +} + +.activity-feed-avatar-gold { + background: #fff2df; + color: #d97706; +} + +.activity-feed-avatar-brand { + background: #ece9ff; + color: #6d28d9; +} + +.activity-feed-avatar-badge { + position: absolute; + right: -5px; + bottom: -5px; + width: 24px; + height: 24px; + border-radius: 999px; + border: 2px solid #ffffff; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + box-shadow: 0 6px 14px rgba(23, 24, 39, 0.12); +} + +.activity-feed-avatar-badge-grocery { + background: #f1e7fb; + color: #6d28d9; +} + +.activity-feed-avatar-badge-medication { + background: #e8f7ee; + color: #16a34a; +} + +.activity-feed-avatar-badge-airtime { + background: #eaf3ff; + color: #3b82f6; +} + +.activity-feed-avatar-badge-electricity { + background: #fff2df; + color: #d97706; +} + +.activity-feed-avatar-badge ion-icon { + font-size: 13px; + --ionicon-stroke-width: 48px; +} + +.activity-feed-badge-image { + width: 22px; + height: 22px; + object-fit: contain; + display: block; + flex-shrink: 0; +} + +.activity-feed-main { + flex: 1; + min-width: 0; +} + +.activity-feed-row { + display: grid; + grid-template-columns: minmax(128px, 1fr) auto; + align-items: flex-start; + gap: 10px; +} + +.activity-feed-copy { + min-width: 0; + flex: 1; + display: flex; + flex-direction: column; + gap: 4px; +} + +.activity-feed-title { + margin: 0; + color: #171827; + font-size: 14px; + line-height: 1.2; + font-weight: 800; +} + +.activity-feed-subtitle { + margin: 0; + color: rgba(23, 24, 39, 0.54); + font-size: 13px; + line-height: 1.3; + font-weight: 500; +} + +.activity-feed-right { + display: flex; + flex-direction: column; + align-items: flex-end; + justify-content: flex-start; + gap: 8px; + flex-shrink: 0; + min-width: 112px; +} + +.activity-feed-amount { + margin: 0; + color: #171827; + font-size: 14px; + line-height: 1.1; + font-weight: 700; +} + +.activity-feed-status { + width: fit-content; + min-height: 28px; + border: none; + border-radius: 999px; + padding: 0 10px 0 12px; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 5px; + font-size: 12px; + font-weight: 800; + text-transform: capitalize; + background: transparent; +} + +.activity-feed-status ion-icon { + font-size: 12px; + flex-shrink: 0; +} + +.activity-feed-status-success { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.activity-feed-status-warning { + background: rgba(245, 158, 11, 0.1); + color: #d97706; +} + +.activity-feed-status-partial { + background: rgba(245, 158, 11, 0.14); + color: #b45309; +} + +.activity-feed-breakdown { + display: flex; + flex-direction: column; + gap: 6px; + margin-top: 8px; +} + +.activity-feed-breakdown-summary { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.activity-feed-breakdown-pill { + min-height: 24px; + border-radius: 999px; + padding: 0 10px; + display: inline-flex; + align-items: center; + gap: 5px; + font-size: 12px; + font-weight: 700; +} + +.activity-feed-breakdown-pill ion-icon { + font-size: 12px; + flex-shrink: 0; +} + +.activity-feed-breakdown-pill.is-redeemed { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.activity-feed-breakdown-pill.is-remaining { + background: rgba(245, 158, 11, 0.12); + color: #d97706; +} + +.activity-feed-usage-note { + width: 100%; + margin: 0; + color: rgba(23, 24, 39, 0.56); + font-size: 10px; + line-height: 1.35; + font-weight: 500; +} + +/* Notifications List */ +.notifications-list-card { + background: #ffffff; + border-radius: 24px; + padding: 8px 0; + margin: 20px; +} + +.notification-row { + display: flex; + align-items: flex-start; + padding: 16px 20px; + gap: 16px; + position: relative; +} + +.nr-status-dot { + position: absolute; + top: 24px; + left: 8px; + width: 8px; + height: 8px; + border-radius: 50%; +} + +.nr-status-dot.is-unread { + background: #6d28d9; +} + +.nr-status-dot.is-read { + background: #d1d5db; +} + +.nr-icon-box { + width: 44px; + height: 44px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + font-size: 20px; + flex-shrink: 0; +} + +.nr-icon-box img { + width: 25px; + height: 25px; + object-fit: contain; + display: block; + flex-shrink: 0; +} + +.nr-icon-box ion-icon { + font-size: 21px; + flex-shrink: 0; +} + +.nr-icon-box.is-read { + opacity: 0.64; +} + +/* Support type mappings */ +.nr-icon-box.notification-service-grocery { + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; +} + +.nr-icon-box.notification-service-medication { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.nr-icon-box.notification-service-airtime { + background: rgba(37, 99, 235, 0.1); + color: #2563eb; +} + +.nr-icon-box.notification-service-electricity { + background: rgba(245, 158, 11, 0.12); + color: #d97706; +} + +.nr-icon-box.notification-service-support { + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; +} + +.nr-content { + flex: 1; +} + +.nr-title { + font-size: 15px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0 0 4px; +} + +.nr-body { + font-size: 13px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0 0 6px; + line-height: 1.4; +} + +.nr-time { + font-size: 11px; + font-weight: 600; + color: #9ca3af; +} + +.nr-link-icon { + font-size: 18px; + color: var(--ion-color-medium); + align-self: center; +} diff --git a/src/styles/auth.css b/src/styles/auth.css new file mode 100644 index 0000000..d5d8821 --- /dev/null +++ b/src/styles/auth.css @@ -0,0 +1,599 @@ +.auth-page-shell, +.auth-shell { + padding: 18px 20px calc(var(--ion-safe-area-bottom, 0px) + 28px); +} + +.auth-content { + --background: linear-gradient(180deg, #fafafa 0%, #f6f1ff 52%, #f4f0ff 100%); +} + +.auth-shell--centered { + min-height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + gap: 20px; +} + +.auth-brand-block, +.auth-brand-intro { + background: transparent; + border-radius: 0; + padding: 0; + margin: 0; + display: flex; + flex-direction: column; + gap: 8px; +} + +.auth-card { + background: rgba(255, 255, 255, 0.94); + border-radius: 24px; + padding: 20px; +} + +.auth-card--elevated { + box-shadow: + 0 24px 60px rgba(109, 40, 217, 0.1), + 0 8px 20px rgba(17, 24, 39, 0.05); + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); +} + +.auth-social-buttons, +.auth-form-fields { + display: flex; + flex-direction: column; + gap: 14px; +} + +.auth-form-stack { + display: flex; + flex-direction: column; + gap: 18px; +} + +.auth-divider { + color: rgba(17, 24, 39, 0.45); + font-size: 12px; + text-align: center; + position: relative; + margin: 20px 0 16px; +} + +.auth-divider span { + background: rgba(255, 255, 255, 0.94); + padding: 0 12px; + position: relative; + z-index: 1; +} + +.auth-divider::before { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + background: rgba(17, 24, 39, 0.08); +} + +.field-group { + display: flex; + flex-direction: column; + gap: 8px; +} + +.auth-field-label { + font-size: 13px; + font-weight: 600; + color: rgba(17, 24, 39, 0.66); +} + +.auth-text-input { + width: 100%; + min-height: 52px; + padding: 0 16px; + border: 1px solid rgba(17, 24, 39, 0.08); + border-radius: 12px; + background: #f8f7fb; + font-size: 15px; + color: #111827; + outline: none; + box-sizing: border-box; + transition: + border-color 0.18s ease, + background 0.18s ease, + box-shadow 0.18s ease; +} + +.auth-text-input::placeholder { + color: rgba(17, 24, 39, 0.38); +} + +.auth-text-input:focus { + border-color: rgba(109, 40, 217, 0.4); + background: #ffffff; + box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.08); +} + +.auth-text-input:disabled { + opacity: 0.65; +} + +.auth-text-input.has-error { + border-color: rgba(220, 38, 38, 0.28); + background: rgba(254, 242, 242, 0.8); +} + +.auth-password-wrap { + position: relative; +} + +.auth-password-wrap .auth-text-input { + padding-right: 48px; +} + +.auth-password-toggle { + position: absolute; + top: 50%; + right: 12px; + transform: translateY(-50%); + width: 28px; + height: 28px; + border-radius: 12px; + border: none; + background: transparent; + color: rgba(17, 24, 39, 0.5); + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + padding: 0; +} + +.auth-password-toggle ion-icon { + font-size: 18px; +} + +.auth-field-error { + margin: 0; + font-size: 12px; + font-weight: 500; + color: #dc2626; +} + +.auth-submit-btn { + width: 100%; + min-height: 52px; + border: none; + border-radius: 999px; + background: #6d28d9; + color: #ffffff; + font-size: 15px; + font-weight: 700; + cursor: pointer; + transition: + transform 0.18s ease, + opacity 0.18s ease; +} + +.auth-submit-btn:disabled { + opacity: 0.55; + cursor: not-allowed; +} + +.auth-inline-message { + border-radius: 12px; + background: rgba(220, 38, 38, 0.08); + color: #dc2626; + padding: 12px 14px; + font-size: 13px; + font-weight: 500; + text-align: center; +} + +.auth-meta-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.auth-meta-hint { + font-size: 12px; + color: rgba(17, 24, 39, 0.45); +} + +.auth-link-button { + border: none; + background: transparent; + padding: 0; + color: #6d28d9; + font-size: 13px; + font-weight: 700; + cursor: pointer; +} + +.auth-eyebrow { + margin: 0 0 4px 0; + font-size: 22px; + font-weight: 800; + color: #6d28d9; + line-height: 1.2; + letter-spacing: -0.01em; +} + +.auth-heading { + font-size: 32px; + font-weight: 700; + color: #111827; + line-height: 1.12; + letter-spacing: -0.02em; + margin: 0; +} + +.auth-subtitle { + font-size: 15px; + font-weight: 400; + color: rgba(17, 24, 39, 0.62); + line-height: 1.6; + margin: 0; +} + +.auth-mode-toggle { + background: #f7f4fb; + border-radius: 999px; + padding: 6px; + display: flex; + gap: 8px; +} + +.auth-toggle-pill { + flex: 1; + text-align: center; + padding: 11px 12px; + border: none; + border-radius: 999px; + font-size: 14px; + transition: all 0.2s ease; +} + +.auth-toggle-pill.active { + background: #ffffff; + font-weight: 700; + color: #111827; + box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06); +} + +.auth-toggle-pill.inactive { + background: transparent; + font-weight: 600; + color: rgba(17, 24, 39, 0.5); +} + +.social-auth-button { + width: 100%; + min-height: 52px; + padding: 0 16px; + border: none; + border-radius: 999px; + background: #f8f7fb; + color: #111827; + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + font-size: 14px; + font-weight: 600; + cursor: pointer; + transition: + background 0.18s ease, + opacity 0.18s ease; +} + +.social-auth-button:disabled { + opacity: 0.6; + cursor: not-allowed; +} + +.social-auth-button__icon { + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.social-auth-button__label { + line-height: 1; +} + +.login, +.register { + border-radius: 999px; +} + +.otp-input-row { + display: flex; + gap: 8px; + justify-content: center; +} + +.otp-slot { + -webkit-appearance: none; + appearance: none; +} + +.avatar-picker-container { + display: flex; + flex-direction: column; + align-items: center; +} + +.avatar-preview-circle { + flex-shrink: 0; +} + +.auth-form-card { + background: #ffffff; + border-radius: 24px; + padding: 20px; + margin: 0; + display: flex; + flex-direction: column; + gap: 14px; +} + +.auth-field { + --background: #fafafa; + --color: #111827; + --placeholder-color: rgba(17, 24, 39, 0.38); + --placeholder-opacity: 1; + --highlight-color-focused: #6d28d9; + --border-radius: 12px; + --padding-start: 16px; + --padding-end: 16px; + color: #111827; +} + +.auth-field::part(label) { + color: rgba(17, 24, 39, 0.62); +} + +.auth-field.ion-focused::part(label) { + color: #6d28d9; +} + +.auth-helper-text { + font-size: 12px; + font-weight: 500; + color: var(--ion-color-danger); + margin-left: 16px; + margin-top: -6px; +} + +.auth-status-text { + font-size: 13px; + font-weight: 500; + text-align: center; + margin-top: 8px; +} + +.auth-primary-btn { + --background: var(--ion-color-primary); + --border-radius: 999px; + font-size: 15px; + font-weight: 700; + color: #ffffff; + margin-top: 8px; + height: 52px; +} + +.auth-social-btn { + --background: #fafafa; + --border-radius: 999px; + --box-shadow: none; + --color: var(--ion-color-dark); + font-size: 14px; + font-weight: 600; + height: 52px; +} + +.auth-footer { + background: transparent; + margin: 16px 0 0 0; + text-align: center; +} + +.auth-footer-text { + font-size: 13px; + font-weight: 400; + color: var(--ion-color-medium); +} + +.auth-footer-link { + font-size: 13px; + font-weight: 700; + color: var(--ion-color-primary); + cursor: pointer; +} + +.auth-intro-block { + background: transparent; + margin: 8px 0 24px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 16px; +} + +.auth-icon-container { + width: 56px; + height: 56px; + border-radius: 24px; + background: rgba(109, 40, 217, 0.12); + display: flex; + align-items: center; + justify-content: center; + color: var(--ion-color-primary); + font-size: 26px; +} + +.auth-intro-heading { + font-size: 24px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0; +} + +.auth-intro-body { + font-size: 15px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0; +} + +.auth-otp-row { + background: #ffffff; + border-radius: 24px; + padding: 20px; + margin: 0 0 20px; + display: flex; + gap: 12px; + justify-content: space-between; +} + +.auth-otp-input { + width: calc((100% - 60px) / 6); + height: 56px; + border-radius: 12px; + background: #fafafa; + border: 1px solid transparent; + font-size: 24px; + font-weight: 700; + color: var(--ion-color-dark); + text-align: center; + padding: 0; +} + +.auth-otp-input:focus { + outline: none; + background: rgba(109, 40, 217, 0.1); + border-color: var(--ion-color-primary); + color: var(--ion-color-primary); +} + +.auth-action-area { + background: transparent; + display: flex; + flex-direction: column; + gap: 12px; +} + +.auth-resend-btn { + --background: transparent; + --color: var(--ion-color-primary); + --box-shadow: none; + font-size: 14px; + font-weight: 700; +} + +.auth-resend-btn[disabled] { + --color: #9ca3af; +} + +.auth-success-card { + background: #ffffff; + border-radius: 24px; + padding: 20px; + text-align: center; + display: flex; + flex-direction: column; + gap: 16px; + align-items: center; +} + +.auth-success-title { + font-size: 18px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0; +} + +.auth-success-body { + font-size: 14px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0; +} + +.setup-avatar-container { + width: 88px; + height: 88px; + border-radius: 24px; + background: rgba(109, 40, 217, 0.1); + margin: 0 auto 16px; + display: flex; + align-items: center; + justify-content: center; + position: relative; + overflow: hidden; +} + +.setup-avatar-img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.setup-avatar-icon { + font-size: 32px; + color: var(--ion-color-primary); +} + +.setup-avatar-input { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + cursor: pointer; +} + +.setup-profile-actions-row { + display: flex; + align-items: center; + gap: 12px; + margin-top: 8px; +} + +.setup-profile-actions-row ion-button { + margin: 0; +} + +.setup-profile-secondary-btn { + flex: 0 0 auto; + min-width: 112px; + height: 52px; + --border-radius: 999px; + --box-shadow: none; + --border-color: rgba(109, 40, 217, 0.18); + --border-width: 1px; + --color: #6d28d9; + font-size: 15px; + font-weight: 700; +} + +.setup-profile-primary-btn { + flex: 1; + height: 52px; + --background: #6d28d9; + --background-activated: #5b21b6; + --border-radius: 999px; + --box-shadow: none; + --color: #ffffff; + font-size: 15px; + font-weight: 700; +} diff --git a/src/styles/home.css b/src/styles/home.css new file mode 100644 index 0000000..b659d64 --- /dev/null +++ b/src/styles/home.css @@ -0,0 +1,1181 @@ +.home-shell { + padding: calc(var(--ion-safe-area-top, 0px) + 12px) 0 + calc(140px + var(--ion-safe-area-bottom, 0px)); + background: linear-gradient(180deg, #fcfbff 0%, #f2edf8 44%, #fbfbfc 100%); + min-height: 100%; +} + +.home-topline, +.home-header-actions-row, +.home-section-row, +.home-action-grid, +.home-activity-card { + margin-left: 20px; + margin-right: 20px; +} + +.home-topline { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; +} + +.home-topline-left { + display: flex; + align-items: center; + gap: 12px; + min-width: 0; +} + +.home-main-avatar-wrap { + width: 52px; + height: 52px; + border-radius: 999px; + overflow: hidden; + background: #eadff8; + flex-shrink: 0; +} + +.home-main-avatar, +.home-person-avatar { + width: 100%; + height: 100%; + object-fit: cover; +} + +.home-greeting-block { + min-width: 0; +} + +.home-greeting { + margin: 0; + color: #151624; + font-size: 20px; + line-height: 1.02; + font-weight: 800; + letter-spacing: -0.045em; +} + +.home-notification-card { + width: 50px; + height: 50px; + border: none; + border-radius: 18px; + background: rgba(255, 255, 255, 0.94); + color: #171827; + display: flex; + align-items: center; + justify-content: center; + position: relative; + font-size: 23px; + flex-shrink: 0; + box-shadow: 0 12px 28px rgba(92, 63, 134, 0.07); +} + +.home-notification-card ion-icon { + transform: translateY(1px); + --ionicon-stroke-width: 34px; +} + +.home-dot { + position: absolute; + top: 9px; + right: 9px; + width: 9px; + height: 9px; + border-radius: 999px; + background: #7c3aed; + box-shadow: 0 0 0 3px #ffffff; +} + +.home-header-actions-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + margin-top: 6px; + margin-left: 84px; + margin-right: 20px; +} + +.home-tagline-wrap { + flex: 1; + min-width: 0; + display: flex; + align-items: center; +} + +.home-subcopy { + margin: 0; + color: rgba(21, 22, 36, 0.56); + font-size: 13px; + line-height: 1.16; + font-weight: 700; + letter-spacing: -0.015em; + max-width: 134px; +} + +.home-month-pill { + min-width: 142px; + max-width: 154px; + min-height: 46px; + border-radius: 999px; + background: rgba(255, 255, 255, 0.92); + display: flex; + align-items: center; + justify-content: center; + gap: 9px; + padding: 6px 12px 6px 8px; + box-shadow: 0 12px 28px rgba(92, 63, 134, 0.07); + flex-shrink: 0; +} + +.home-month-icon { + width: 31px; + height: 31px; + border-radius: 999px; + background: #f1e7fb; + color: #8b3ff2; + display: flex; + align-items: center; + justify-content: center; + font-size: 16px; + flex-shrink: 0; +} + +.home-month-copy { + min-width: 0; + transform: translateY(1px); +} + +.home-month-label { + margin: 0 0 1px; + color: rgba(21, 22, 36, 0.42); + font-size: 9px; + line-height: 1.02; + font-weight: 600; +} + +.home-month-value { + margin: 0; + color: #6d28d9; + font-size: 13px; + line-height: 1.06; + font-weight: 800; +} + +.home-section-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + margin-top: 20px; + margin-bottom: 8px; +} + +.home-section-row-spaced { + margin-top: 18px; +} + +.home-section-heading { + margin: 0; + color: #171827; + font-size: 20px; + line-height: 1.15; + font-weight: 800; + letter-spacing: -0.035em; +} + +.home-section-link { + border: none; + background: transparent; + padding: 0; + color: #6d28d9; + font-size: 14px; + line-height: 1.2; + font-weight: 700; +} + +.home-loved-ones-scroll { + display: flex; + gap: 12px; + overflow-x: auto; + padding: 0 20px 4px; + scroll-snap-type: x mandatory; + -webkit-overflow-scrolling: touch; +} + +.home-loved-ones-scroll::-webkit-scrollbar { + display: none; +} + +.home-person-card { + width: 264px; + min-width: 264px; + border-radius: 24px; + padding: 13px; + display: flex; + flex-direction: column; + gap: 10px; + scroll-snap-align: start; +} + +.home-person-card-lavender { + background: #f6effb; +} + +.home-person-card-mint { + background: #edf7ef; +} + +.home-person-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 10px; +} + +.home-person-meta { + display: flex; + align-items: center; + gap: 12px; + min-width: 0; +} + +.home-person-avatar-shell { + width: 54px; + height: 54px; + border-radius: 999px; + overflow: hidden; + background: #eadff8; + color: #6d28d9; + position: relative; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; +} + +.home-person-initial { + color: currentColor; + font-size: 20px; + line-height: 1; + font-weight: 800; +} + +.home-person-online { + position: absolute; + right: 1px; + bottom: 2px; + width: 11px; + height: 11px; + border-radius: 999px; + border: 2px solid #ffffff; + background: #16a34a; +} + +.home-person-name { + margin: 0 0 3px; + color: #171827; + font-size: 15px; + line-height: 1.12; + font-weight: 800; +} + +.home-person-location { + margin: 0; + color: rgba(23, 24, 39, 0.52); + font-size: 12px; + line-height: 1.18; + font-weight: 500; +} + +.home-card-menu { + width: 30px; + height: 30px; + border: none; + border-radius: 12px; + background: transparent; + color: rgba(23, 24, 39, 0.62); + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + flex-shrink: 0; +} + +.home-status-stack { + display: flex; + flex-direction: column; + gap: 8px; + min-height: 160px; +} + +.home-status-row { + display: flex; + align-items: center; + gap: 10px; + min-height: 48px; + background: rgba(255, 255, 255, 0.46); + border-radius: 12px; + padding: 8px 10px; +} + +.home-status-empty-row { + min-height: 156px; + border-radius: 12px; + background: rgba(255, 255, 255, 0.46); + color: rgba(23, 24, 39, 0.52); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 8px; + font-size: 12px; + line-height: 1.2; + font-weight: 700; + text-align: center; +} + +.home-status-empty-row ion-icon { + font-size: 22px; + color: rgba(109, 40, 217, 0.42); +} + +.home-person-card-mint .home-status-row { + background: rgba(255, 255, 255, 0.46); +} + +.home-status-icon, +.home-action-icon, +.home-alert-icon, +.home-activity-icon { + width: 34px; + height: 34px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + flex-shrink: 0; +} + +.home-status-icon ion-icon, +.home-action-icon ion-icon, +.home-alert-icon ion-icon, +.home-activity-icon ion-icon { + --ionicon-stroke-width: 42px; +} + +.home-custom-icon { + width: 24px; + height: 24px; + object-fit: contain; + display: block; + flex-shrink: 0; +} + +.home-custom-icon.is-basket { + width: 32px; + height: 32px; +} + +.home-custom-icon.is-pill { + width: 34px; + height: 34px; +} + +.home-status-copy { + flex: 1; + min-width: 0; +} + +.home-status-label { + margin: 0 0 2px; + color: #171827; + font-size: 13px; + line-height: 1.12; + font-weight: 800; +} + +.home-status-detail { + margin: 0; + font-size: 10.5px; + line-height: 1.12; + font-weight: 600; +} + +.home-status-detail.is-success, +.home-status-trailing.is-success { + color: #16a34a; +} + +.home-status-detail.is-warning, +.home-status-trailing.is-warning { + color: #d99a12; +} + +.home-status-trailing { + font-size: 18px; + flex-shrink: 0; +} + +.home-send-button { + width: 100%; + min-height: 48px; + border: none; + border-radius: 999px; + display: flex; + align-items: center; + justify-content: center; + gap: 10px; + padding: 0 18px; + font-size: 14px; + font-weight: 800; + margin-top: 4px; +} + +.home-send-button.home-tone-grocery { + background: #6d28d9; + color: #ffffff; +} + +.home-send-button.home-tone-grocery .home-send-button-icon { + color: #6d28d9; +} + +.home-send-button.home-tone-medication { + background: #16a34a; + color: #ffffff; +} + +.home-send-button.home-tone-medication .home-send-button-icon { + color: #16a34a; +} + +.home-send-button.home-tone-airtime { + background: #2563eb; + color: #ffffff; +} + +.home-send-button.home-tone-airtime .home-send-button-icon { + color: #2563eb; +} + +.home-send-button.home-tone-electricity { + background: #d97706; + color: #ffffff; +} + +.home-send-button.home-tone-electricity .home-send-button-icon { + color: #d97706; +} + +.home-send-button-icon { + width: 28px; + height: 28px; + border-radius: 999px; + background: #ffffff; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.home-send-button-icon ion-icon { + font-size: 18px; + --ionicon-stroke-width: 42px; +} + +.home-send-button-icon .home-custom-icon.is-basket { + width: 40.32px; + height: 40.32px; +} + +.home-carousel-indicator { + display: flex; + align-items: center; + justify-content: center; + gap: 6px; + margin-top: 10px; +} + +.home-dot-active { + width: 18px; + height: 6px; + border-radius: 999px; + background: #6d28d9; +} + +.home-dot-inactive { + width: 6px; + height: 6px; + border-radius: 999px; + background: rgba(109, 40, 217, 0.18); +} + +.home-action-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; +} + +.home-action-card { + min-height: 84px; + border: none; + border-radius: 24px; + background: rgba(255, 255, 255, 0.94); + padding: 14px; + display: flex; + align-items: center; + gap: 12px; + text-align: left; + box-shadow: none; +} + +.home-action-card .home-action-icon { + width: 42px; + height: 42px; + border-radius: 12px; + font-size: 22px; +} + +.home-action-card .home-action-icon ion-icon { + --ionicon-stroke-width: 38px; +} + +.home-action-card .home-action-icon .home-custom-icon.is-basket { + width: 30px; + height: 30px; +} + +.home-action-text-block { + display: flex; + flex-direction: column; + gap: 4px; + min-width: 0; +} + +.home-action-label { + color: #171827; + font-size: 15px; + line-height: 1.2; + font-weight: 800; +} + +.home-action-helper { + color: rgba(23, 24, 39, 0.56); + font-size: 11px; + line-height: 1.3; + font-weight: 600; +} + +.home-alert-marquee { + position: relative; + overflow-x: auto; + overflow-y: hidden; + padding: 0 0 4px; + -webkit-overflow-scrolling: touch; + scroll-snap-type: x mandatory; + scrollbar-width: none; + cursor: grab; + overscroll-behavior-x: contain; +} + +.home-alert-marquee::-webkit-scrollbar { + display: none; +} + +.home-alert-marquee:active { + cursor: grabbing; +} + +.home-alert-marquee-track { + display: flex; + gap: 12px; + width: max-content; + padding: 0 20px; + animation: home-alert-marquee-scroll 24s linear infinite; + will-change: transform; +} + +.home-alert-marquee:hover .home-alert-marquee-track, +.home-alert-marquee:active .home-alert-marquee-track, +.home-alert-marquee:focus-within .home-alert-marquee-track { + animation-play-state: paused; +} + +.home-alert-overlay-state, +.home-alert-overlay-note { + position: absolute; + inset: 0; + display: flex; + align-items: center; + padding: 0 20px 4px; + pointer-events: none; +} + +.home-alert-overlay-note { + justify-content: flex-start; +} + +@keyframes home-alert-marquee-scroll { + from { + transform: translateX(0); + } + to { + transform: translateX(calc(-50% - 6px)); + } +} + +@media (prefers-reduced-motion: reduce) { + .home-alert-marquee-track { + animation: none; + } +} + +.home-alert-card { + width: 215px; + min-width: 215px; + min-height: 94px; + border: none; + border-radius: 24px; + background: #ffffff; + padding: 14px 12px; + display: flex; + align-items: center; + gap: 10px; + text-align: left; + scroll-snap-align: start; + box-shadow: none; + transition: transform 0.18s ease; + flex-shrink: 0; +} + +.home-alert-content { + flex: 1; + display: flex; + flex-direction: column; + min-width: 0; +} + +.home-alert-title { + color: #171827; + font-size: 14px; + line-height: 1.16; + font-weight: 800; + margin-bottom: 4px; +} + +.home-alert-subtitle { + color: rgba(23, 24, 39, 0.6); + font-size: 10.5px; + line-height: 1.22; + font-weight: 600; +} + +.home-alert-chevron-chip { + width: 34px; + height: 34px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + font-size: 16px; +} + +.home-alert-chevron-chip ion-icon { + --ionicon-stroke-width: 48px; +} + +.home-alert-card:active { + transform: scale(0.985); +} + +.home-alert-preview-note { + min-width: fit-content; + align-self: center; + border-radius: 999px; + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; + padding: 7px 12px; + font-size: 11px; + font-weight: 800; + flex-shrink: 0; +} + +.home-alert-error { + min-width: fit-content; + align-self: center; + margin: 0; + border-radius: 999px; + background: rgba(220, 38, 38, 0.1); + color: #dc2626; + padding: 7px 12px; + font-size: 11px; + font-weight: 800; + flex-shrink: 0; +} + +.home-alert-skeleton .home-alert-icon, +.home-alert-skeleton-title, +.home-alert-skeleton-subtitle, +.home-alert-skeleton-cta { + background: #eee8f6; +} + +.home-alert-skeleton-title, +.home-alert-skeleton-subtitle, +.home-alert-skeleton-cta { + display: block; + border-radius: 12px; +} + +.home-alert-skeleton-title { + width: 118px; + height: 13px; + margin-bottom: 6px; +} + +.home-alert-skeleton-subtitle { + width: 86px; + height: 11px; + margin-bottom: 9px; +} + +.home-alert-skeleton-cta { + width: 72px; + height: 21px; + border-radius: 999px; +} + +.home-tone-grocery { + background: rgba(109, 40, 217, 0.12); + color: #6d28d9; +} +.home-alert-cta.home-tone-grocery { + background: rgba(109, 40, 217, 0.12); +} + +.home-tone-medication { + background: rgba(22, 163, 74, 0.12); + color: #16a34a; +} +.home-alert-cta.home-tone-medication { + background: rgba(22, 163, 74, 0.12); +} + +.home-tone-airtime { + background: rgba(59, 130, 246, 0.12); + color: #2563eb; +} +.home-alert-cta.home-tone-airtime { + background: rgba(59, 130, 246, 0.12); +} + +.home-tone-electricity { + background: rgba(245, 158, 11, 0.14); + color: #d97706; +} +.home-alert-cta.home-tone-electricity { + background: rgba(245, 158, 11, 0.14); +} + +.home-tone-default { + background: #f4f4f5; + color: #52525b; +} +.home-alert-cta.home-tone-default { + background: rgba(82, 82, 91, 0.12); +} + +.home-empty-alerts { + background: #ffffff; + border-radius: 24px; + padding: 24px 20px; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + box-shadow: 0 4px 12px rgba(23, 24, 39, 0.03); +} + +.home-empty-alerts-icon { + width: 48px; + height: 48px; + border-radius: 24px; + background: #f3ebff; + color: #6d28d9; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 12px; +} +.home-empty-alerts-icon ion-icon { + font-size: 24px; +} + +.home-empty-alerts-msg { + font-size: 16px; + font-weight: 700; + color: #171827; + margin: 0 0 4px; +} + +.home-empty-alerts-helper { + font-size: 13px; + color: rgba(23, 24, 39, 0.6); + margin: 0 0 16px; + line-height: 1.4; + max-width: 220px; +} + +.home-empty-alerts-cta { + background: #6d28d9; + color: #ffffff; + font-size: 14px; + font-weight: 600; + padding: 10px 20px; + border-radius: 999px; + border: none; +} + +.home-alert-chevron, +.home-activity-chevron { + color: rgba(23, 24, 39, 0.32); + font-size: 16px; + flex-shrink: 0; +} + +.home-activity-card { + background: rgba(255, 255, 255, 0.94); + border-radius: 24px; + padding: 4px 0; +} + +.home-activity-row { + display: flex; + align-items: flex-start; + gap: 14px; + padding: 13px 14px; + position: relative; +} + +.home-activity-row::after { + content: ''; + position: absolute; + left: 14px; + right: 14px; + bottom: 0; + height: 1px; + background: rgba(23, 24, 39, 0.06); +} + +.home-activity-row-button { + width: 100%; + border: none; + background: transparent; + text-align: left; +} + +.home-activity-row.is-last { + padding-bottom: 15px; +} + +.home-activity-row.is-last::after { + display: none; +} + +.home-activity-avatar-shell { + position: relative; + width: 53px; + height: 53px; + border-radius: 999px; + flex-shrink: 0; +} + +.home-activity-avatar { + width: 100%; + height: 100%; + border-radius: 999px; + object-fit: cover; + background: #eadff8; +} + +.home-activity-avatar-fallback { + color: #6d28d9; + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + line-height: 1; + font-weight: 800; +} + +.home-activity-avatar-badge { + position: absolute; + bottom: -5px; + right: -5px; + width: 30px; + height: 30px; + border-radius: 999px; + display: flex; + align-items: center; + justify-content: center; + border: 2px solid #ffffff; + box-shadow: 0 6px 14px rgba(23, 24, 39, 0.12); +} + +.home-activity-avatar-badge.home-tone-grocery { + background: #f1e7fb; + color: #6d28d9; +} + +.home-activity-avatar-badge.home-tone-medication { + background: #e8f7ee; + color: #16a34a; +} + +.home-activity-avatar-badge.home-tone-airtime { + background: #eaf3ff; + color: #3b82f6; +} + +.home-activity-avatar-badge.home-tone-electricity { + background: #fff2df; + color: #d97706; +} + +.home-activity-avatar-badge .home-custom-icon { + width: 12px; + height: 12px; +} + +.home-activity-avatar-badge .home-custom-icon.is-basket { + width: 22px; + height: 22px; +} + +.home-activity-avatar-badge .home-custom-icon.is-pill { + width: 15px; + height: 15px; +} + +.home-activity-avatar-badge ion-icon { + font-size: 13px; + --ionicon-stroke-width: 48px; +} + +.home-activity-copy { + flex: 1; + min-width: 0; +} + +.home-activity-head-row { + display: grid; + grid-template-columns: minmax(128px, 1fr) auto; + align-items: flex-start; + gap: 10px; +} + +.home-activity-text-block { + min-width: 0; +} + +.home-activity-title { + margin: 0 0 3px; + color: #171827; + font-size: 14px; + line-height: 1.2; + font-weight: 800; + white-space: nowrap; +} + +.home-activity-subtitle, +.home-activity-meta { + margin: 0; + color: rgba(23, 24, 39, 0.54); + font-size: 12px; + line-height: 1.35; + font-weight: 600; +} + +.home-activity-meta { + margin-top: 2px; +} + +.home-activity-right { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 6px; + flex-shrink: 0; + min-width: 92px; +} + +.home-activity-amount { + margin: 0; + color: #171827; + font-size: 14px; + line-height: 1.1; + font-weight: 700; +} + +.home-activity-badge { + width: fit-content; + min-height: 24px; + border-radius: 999px; + padding: 0 10px; + display: inline-flex; + align-items: center; + justify-content: center; + font-size: 12px; + font-weight: 800; + text-transform: capitalize; +} + +.home-activity-breakdown { + display: flex; + flex-direction: column; + gap: 6px; + margin-top: 8px; +} + +.home-activity-breakdown-summary { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.home-activity-breakdown-pill { + min-height: 24px; + border-radius: 999px; + padding: 0 10px; + display: inline-flex; + align-items: center; + gap: 5px; + font-size: 12px; + font-weight: 700; +} + +.home-activity-breakdown-pill.is-redeemed { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.home-activity-breakdown-pill.is-remaining { + background: rgba(245, 158, 11, 0.12); + color: #d97706; +} + +.home-activity-usage-note { + width: 100%; + margin: 0; + color: rgba(23, 24, 39, 0.56); + font-size: 11px; + line-height: 1.4; + font-weight: 500; +} + +.home-activity-dot { + width: 6px; + height: 6px; + border-radius: 999px; +} + +.home-activity-badge ion-icon { + font-size: 12px; + flex-shrink: 0; +} + +.home-badge-success { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.home-badge-info { + background: rgba(59, 130, 246, 0.1); + color: #3b82f6; +} + +.home-badge-warning { + background: rgba(245, 158, 11, 0.1); + color: #d97706; +} + +.home-badge-info { + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; +} + +.home-badge-partial { + background: rgba(245, 158, 11, 0.14); + color: #b45309; +} + +.home-badge-default { + background: rgba(23, 24, 39, 0.05); + color: rgba(23, 24, 39, 0.6); +} + +.home-tone-brand, +.home-tone-grocery { + background: rgba(109, 40, 217, 0.12); + color: #6d28d9; +} + +.home-tone-rose, +.home-tone-medication, +.home-tone-success, +.home-tone-mint { + background: rgba(22, 163, 74, 0.12); + color: #16a34a; +} + +.home-tone-blue, +.home-tone-airtime { + background: rgba(59, 130, 246, 0.12); + color: #2563eb; +} + +.home-tone-amber, +.home-tone-warning, +.home-tone-gold, +.home-tone-electricity { + background: rgba(245, 158, 11, 0.14); + color: #d97706; +} + +@media (max-width: 380px) { + .home-header-actions-row { + margin-left: 78px; + gap: 8px; + } + + .home-subcopy { + max-width: 118px; + font-size: 12px; + } + + .home-month-pill { + min-width: 136px; + max-width: 146px; + } + + .home-person-card { + width: 264px; + min-width: 264px; + } + + .home-action-card { + min-height: 70px; + padding: 10px 12px; + } + + .home-action-label { + font-size: 14px; + } +} diff --git a/src/styles/profile.css b/src/styles/profile.css new file mode 100644 index 0000000..df64544 --- /dev/null +++ b/src/styles/profile.css @@ -0,0 +1,349 @@ +/* Profile Tab */ +.profile-shell { + padding-bottom: calc(130px + var(--ion-safe-area-bottom, 0px)); +} + +.profile-page-title { + font-size: 28px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0 20px 16px; +} + +.profile-summary-card { + background: #ffffff; + border-radius: 24px; + padding: 20px; + margin: 0 20px 12px; + display: flex; + align-items: center; + gap: 16px; +} + +.psc-avatar-shell { + width: 72px; + height: 72px; + border-radius: 24px; + background: rgba(109, 40, 217, 0.08); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.psc-avatar { + width: 72px; + height: 72px; + border-radius: 24px; + object-fit: cover; +} + +.psc-avatar-placeholder { + width: 72px; + height: 72px; + border-radius: 24px; + background: rgba(109, 40, 217, 0.1); + display: flex; + align-items: center; + justify-content: center; + color: var(--ion-color-primary); + font-size: 28px; + font-weight: 700; +} + +.psc-info { + flex: 1; + display: flex; + flex-direction: column; + gap: 2px; + min-width: 0; +} + +.psc-name { + font-size: 22px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0 0 2px; +} + +.psc-location { + font-size: 14px; + font-weight: 500; + color: var(--ion-color-medium); + margin: 0; +} + +.psc-edit-btn { + --background: #fafafa; + --color: var(--ion-color-dark); + --border-radius: 12px; + --box-shadow: none; + width: 44px; + height: 44px; + margin: 0; + flex-shrink: 0; +} + +.profile-quick-actions-card { + background: #ffffff; + border-radius: 24px; + padding: 8px 0; + margin: 0 20px 24px; +} + +.profile-quick-action { + width: 100%; + border: none; + background: transparent; + display: flex; + align-items: center; + gap: 12px; + padding: 14px 16px; + text-align: left; + cursor: pointer; +} + +.profile-quick-action + .profile-quick-action { + border-top: 1px solid rgba(17, 24, 39, 0.06); +} + +.profile-quick-action-icon { + width: 40px; + height: 40px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + flex-shrink: 0; +} + +.profile-quick-action-icon--accent { + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; +} + +.profile-quick-action-icon--soft { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.profile-quick-action-copy { + display: flex; + flex-direction: column; + gap: 3px; + min-width: 0; +} + +.profile-quick-action-title { + font-size: 15px; + font-weight: 600; + color: #111827; +} + +.profile-quick-action-subtitle { + font-size: 13px; + color: rgba(17, 24, 39, 0.6); +} + +/* Settings Cards */ +.settings-section-title { + font-size: 14px; + font-weight: 700; + color: rgba(17, 24, 39, 0.48); + margin: 0 20px 8px; + text-transform: uppercase; + letter-spacing: 0.08em; +} + +.settings-card { + background: #ffffff; + border-radius: 24px; + padding: 8px 0; + margin: 0 20px 20px; +} + +.profile-footer-mark { + margin: 8px 20px 0; + padding: 12px 20px calc(8px + var(--ion-safe-area-bottom, 0px)); + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; + text-align: center; +} + +.profile-footer-logo { + width: 48px; + height: 48px; + border-radius: 16px; + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; + display: flex; + align-items: center; + justify-content: center; + font-size: 22px; + font-weight: 700; +} + +.profile-footer-name { + margin: 0; + font-size: 15px; + font-weight: 700; + color: #111827; +} + +.profile-footer-meta { + margin: 0; + font-size: 12px; + font-weight: 500; + color: rgba(17, 24, 39, 0.48); +} + +.profile-footer-copyright { + margin: 2px 0 0; + font-size: 11px; + font-weight: 500; + color: rgba(17, 24, 39, 0.4); +} + +.profile-inline-note { + margin: 0 16px 10px; + padding: 12px; + border-radius: 12px; + background: rgba(109, 40, 217, 0.06); + display: flex; + align-items: flex-start; + gap: 12px; +} + +.profile-inline-note-icon { + width: 32px; + height: 32px; + border-radius: 12px; + background: rgba(109, 40, 217, 0.12); + color: #6d28d9; + display: flex; + align-items: center; + justify-content: center; + font-size: 16px; + flex-shrink: 0; +} + +.profile-inline-note-title { + font-size: 14px; + font-weight: 600; + color: #111827; + margin: 0 0 2px; +} + +.profile-inline-note-text { + font-size: 13px; + line-height: 1.45; + color: rgba(17, 24, 39, 0.6); + margin: 0; +} + +.settings-row { + display: flex; + align-items: center; + min-height: 56px; + padding: 8px 16px; + gap: 12px; +} + +.sr-icon-box { + width: 36px; + height: 36px; + border-radius: 12px; + background: #fafafa; + display: flex; + align-items: center; + justify-content: center; + font-size: 18px; + color: var(--ion-color-primary); +} + +.sr-icon-box.danger { + color: var(--ion-color-danger); + background: rgba(220, 38, 38, 0.08); +} + +.sr-label { + flex: 1; + font-size: 15px; + font-weight: 600; + color: var(--ion-color-dark); +} + +.sr-label.danger { + color: var(--ion-color-danger); +} + +.sr-toggle { + --handle-background: #ffffff; + --handle-background-checked: #ffffff; + --track-background: #e5e7eb; + --track-background-checked: var(--ion-color-primary); + padding: 0; +} + +/* Edit Profile */ +.edit-profile-card { + background: #ffffff; + border-radius: 24px; + padding: 20px; + margin: 20px; + display: flex; + flex-direction: column; + gap: 14px; +} + +.profile-back-button { + --color: var(--profile-action-accent, var(--color-brand)); + --background: transparent; + --background-activated: transparent; + --border-radius: 12px; + --box-shadow: none; + width: 44px; + height: 44px; + margin-left: 8px; +} + +.profile-back-button ion-icon { + color: var(--profile-action-accent, var(--color-brand)); + font-size: 24px; +} + +.edit-profile-shell { + padding-bottom: calc(32px + var(--ion-safe-area-bottom, 0px)); +} + +.epc-field { + --background: #fafafa; + --color: #111827; + --placeholder-color: rgba(17, 24, 39, 0.38); + --placeholder-opacity: 1; + --highlight-color-focused: #6d28d9; + --border-radius: 12px; + --padding-start: 16px; + --padding-end: 16px; + color: #111827; +} + +.epc-field::part(label) { + color: rgba(17, 24, 39, 0.62); +} + +.epc-field.ion-focused::part(label) { + color: #6d28d9; +} + +.epc-save-btn { + --background: var(--ion-color-primary); + --border-radius: 999px; + font-size: 15px; + font-weight: 700; + margin: 0 20px 20px; + height: 52px; +} diff --git a/src/styles/recipients.css b/src/styles/recipients.css new file mode 100644 index 0000000..14a9d6f --- /dev/null +++ b/src/styles/recipients.css @@ -0,0 +1,1151 @@ +/* Recipients List */ +.recipients-top-row { + display: flex; + align-items: center; + justify-content: space-between; + margin: 0 20px; +} + +.recipients-page-title { + font-size: 28px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0; +} + +.recipients-add-btn { + --background: rgba(109, 40, 217, 0.1); + --color: var(--ion-color-primary); + --border-radius: 999px; + --box-shadow: none; + --padding-start: 16px; + --padding-end: 16px; + font-size: 14px; + font-weight: 700; + height: 40px; + margin: 0; +} + +/* Back Button Consistency */ +.recipients-back-button { + --color: var(--recipient-action-accent, var(--color-brand)); + --background: transparent; + --background-activated: transparent; + --border-radius: 12px; + --box-shadow: none; + width: 44px; + height: 44px; + margin-left: 8px; +} + +.recipients-back-button ion-icon { + color: var(--recipient-action-accent, var(--color-brand)); + font-size: 24px; +} + +.recipients-shell { + padding-bottom: calc(130px + var(--ion-safe-area-bottom, 0px)); +} + +.search-row { + margin: 0 20px 12px; +} + +.search-input-container { + background: #ffffff; + border-radius: 12px; + display: flex; + align-items: center; + padding: 0 16px; + height: 48px; +} + +.search-icon { + font-size: 20px; + color: var(--ion-color-medium); + margin-right: 12px; +} + +.search-input { + --padding-start: 0; + --padding-end: 0; + --placeholder-color: var(--ion-color-medium); + --placeholder-opacity: 1; + font-size: 15px; + color: var(--ion-color-dark); +} + +.recipient-list-card { + background: #ffffff; + border-radius: 24px; + padding: 16px; + margin: 0 20px 12px; + display: flex; + align-items: center; + gap: 16px; +} + +.rlc-avatar { + width: 52px; + height: 52px; + border-radius: 16px; + object-fit: cover; +} + +.rlc-avatar-placeholder { + width: 52px; + height: 52px; + border-radius: 16px; + background: rgba(109, 40, 217, 0.1); + display: flex; + align-items: center; + justify-content: center; + color: var(--ion-color-primary); + font-size: 20px; + font-weight: 700; +} + +.rlc-info { + flex: 1; + display: flex; + flex-direction: column; + gap: 2px; +} + +.rlc-name-row { + display: flex; + align-items: center; + gap: 8px; +} + +.rlc-name { + font-size: 16px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0; +} + +.rlc-relationship { + font-size: 13px; + font-weight: 600; + color: var(--ion-color-primary); + background: rgba(109, 40, 217, 0.1); + padding: 2px 8px; + border-radius: 12px; +} + +.rlc-location { + font-size: 13px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0; +} + +.rlc-activity { + font-size: 12px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 2px 0 0; +} + +.rlc-chevron { + font-size: 18px; + color: #9ca3af; +} + +.empty-state-card { + background: #ffffff; + border-radius: 24px; + padding: 28px; + margin: 0 20px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +} + +.esc-icon { + font-size: 44px; + color: var(--ion-color-primary); + margin-bottom: 16px; +} + +.esc-title { + font-size: 16px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0 0 8px; +} + +.esc-msg { + font-size: 14px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0 0 20px; +} + +/* Recipient Detail */ +.recipient-summary-card { + margin: 20px; + background: #ffffff; + border-radius: 24px; + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 16px; +} + +.rsc-avatar { + width: 80px; + height: 80px; + border-radius: 24px; + object-fit: cover; +} + +.rsc-avatar-placeholder { + width: 80px; + height: 80px; + border-radius: 24px; + background: rgba(109, 40, 217, 0.1); + display: flex; + align-items: center; + justify-content: center; + color: var(--ion-color-primary); + font-size: 32px; + font-weight: 700; +} + +.rsc-info { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; +} + +.rsc-name { + font-size: 22px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0; +} + +.rsc-relationship { + font-size: 14px; + font-weight: 600; + color: var(--ion-color-primary); + margin: 0; +} + +.rsc-location { + font-size: 14px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0; +} + +.rsc-stats-row { + display: flex; + gap: 12px; + width: 100%; +} + +.rsc-stat-box { + flex: 1; + background: #fafafa; + border-radius: 12px; + padding: 12px; + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; +} + +.rsc-stat-val { + font-size: 16px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0; +} + +.rsc-stat-label { + font-size: 12px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0; +} + +.rsc-cta-btn { + --background: var(--ion-color-primary); + --border-radius: 999px; + font-size: 15px; + font-weight: 700; + width: 100%; + height: 52px; + margin: 8px 0 0; +} + +.detail-section-header { + margin: 24px 20px 12px; + font-size: 16px; + font-weight: 700; + color: var(--ion-color-dark); +} + +.detail-section-header-with-meta { + display: flex; + align-items: flex-end; + justify-content: space-between; +} + +.detail-section-header-with-meta h2 { + margin: 0; + font-size: 16px; + font-weight: 700; + color: var(--ion-color-dark); +} + +.detail-section-header-with-meta p { + margin: 4px 0 0; + font-size: 13px; + color: var(--ion-color-medium); + font-weight: 400; +} + +.recipient-history-date-label { + font-size: 11px; + font-weight: 700; + color: rgba(23, 24, 39, 0.45); + text-transform: uppercase; + letter-spacing: 0.06em; + margin-top: 6px; + margin-bottom: -2px; + margin-left: 4px; +} + +.recipient-history-stack { + margin: 0 20px 20px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.recipient-history-item { + width: 100%; + border: none; + background: #ffffff; + border-radius: 24px; + padding: 14px; + display: flex; + align-items: flex-start; + gap: 12px; + text-align: left; +} + +.recipient-history-item.service-grocery, +.recipient-alert-card.service-grocery { + background: rgba(109, 40, 217, 0.05); +} + +.recipient-history-item.service-medication, +.recipient-alert-card.service-medication { + background: rgba(22, 163, 74, 0.06); +} + +.recipient-history-item.service-electricity, +.recipient-alert-card.service-electricity { + background: rgba(245, 158, 11, 0.08); +} + +.recipient-history-item.service-airtime, +.recipient-alert-card.service-airtime { + background: rgba(249, 115, 22, 0.08); +} + +.recipient-history-badge { + width: 40px; + height: 40px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.recipient-history-badge ion-icon { + font-size: 18px; +} + +.recipient-history-badge.service-grocery, +.recipient-alert-icon-wrap.service-grocery { + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; +} + +.recipient-history-badge.service-medication, +.recipient-alert-icon-wrap.service-medication { + background: rgba(22, 163, 74, 0.14); + color: #16a34a; +} + +.recipient-history-badge.service-electricity, +.recipient-alert-icon-wrap.service-electricity { + background: rgba(245, 158, 11, 0.16); + color: #d97706; +} + +.recipient-history-badge.service-airtime, +.recipient-alert-icon-wrap.service-airtime { + background: rgba(249, 115, 22, 0.14); + color: #ea580c; +} + +.recipient-history-badge.service-default, +.recipient-alert-icon-wrap.service-default { + background: rgba(148, 163, 184, 0.14); + color: #64748b; +} + +.recipient-history-copy { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 6px; +} + +.recipient-history-topline { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 10px; +} + +.recipient-history-title-block { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 2px; +} + +.recipient-history-topline h3 { + margin: 0; + font-size: 15px; + font-weight: 700; + color: var(--ion-color-dark); +} + +.recipient-history-support-meta { + margin: 0; + font-size: 12px; + line-height: 1.25; + color: rgba(23, 24, 39, 0.56); +} + +.recipient-history-amount { + flex-shrink: 0; + font-size: 14px; + font-weight: 700; + color: var(--ion-color-primary); + font-variant-numeric: tabular-nums; +} + +.recipient-history-copy p { + margin: 0; + font-size: 13px; + line-height: 1.4; + color: var(--ion-color-medium); +} + +.recipient-history-meta-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; +} + +.recipient-history-meta-row-compact { + align-items: center; +} + +.recipient-history-status { + align-self: flex-start; + border-radius: 999px; + padding: 5px 9px; + font-size: 11px; + font-weight: 700; + text-transform: capitalize; +} + +.recipient-history-trailing { + font-size: 16px; + flex-shrink: 0; +} + +.recipient-history-details-grid { + display: grid; + grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); + gap: 8px; + align-items: stretch; +} + +.recipient-history-detail-chip { + background: rgba(255, 255, 255, 0.58); + border-radius: 12px; + padding: 8px 10px; + display: flex; + flex-direction: column; + justify-content: center; + gap: 2px; + min-width: 0; +} + +.recipient-history-share-chip { + background: rgba(255, 255, 255, 0.9); + border: none; + border-radius: 12px; + padding: 10px 12px; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + text-align: left; + color: #171827; + min-height: 46px; + width: 100%; +} + +.recipient-history-copy-chip { + background: rgba(255, 255, 255, 0.78); +} + +.recipient-history-share-icon-wrap { + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.recipient-history-share-chip ion-icon { + font-size: 18px; + color: #171827; + flex-shrink: 0; +} + +.recipient-history-share-text { + min-width: 0; + font-size: 13px; + font-weight: 600; + color: #171827; + line-height: 1; + white-space: nowrap; +} + +.recipient-history-share-chip.is-disabled { + background: rgba(255, 255, 255, 0.52); + color: rgba(23, 24, 39, 0.42); + opacity: 0.58; + cursor: not-allowed; +} + +.recipient-history-share-chip.is-disabled ion-icon, +.recipient-history-share-chip.is-disabled .recipient-history-share-text { + color: rgba(23, 24, 39, 0.38); +} + +.recipient-history-detail-label { + font-size: 9px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.06em; + color: rgba(23, 24, 39, 0.42); +} + +.recipient-history-detail-value { + font-size: 12px; + font-weight: 600; + line-height: 1.25; + color: #171827; +} + +.recipient-history-description { + font-size: 12px; + line-height: 1.35; + color: rgba(23, 24, 39, 0.64); +} + +.recipient-history-status.status-created, +.recipient-alert-pill.status-created, +.recipient-history-trailing.status-created, +.recipient-history-status.status-pending, +.recipient-alert-pill.status-pending, +.recipient-history-trailing.status-pending { + background: rgba(245, 158, 11, 0.14); + color: #b45309; +} + +.recipient-history-status.status-redeemed, +.recipient-alert-pill.status-redeemed, +.recipient-history-trailing.status-redeemed, +.recipient-history-status.status-completed, +.recipient-alert-pill.status-completed, +.recipient-history-trailing.status-completed { + background: rgba(22, 163, 74, 0.14); + color: #16a34a; +} + +.recipient-history-status.status-partial, +.recipient-alert-pill.status-partial, +.recipient-history-trailing.status-partial { + background: rgba(109, 40, 217, 0.12); + color: #6d28d9; +} + +.recipient-history-status.status-default, +.recipient-alert-pill.status-default, +.recipient-history-trailing.status-default { + background: rgba(148, 163, 184, 0.14); + color: #64748b; +} + +@media (max-width: 360px) { + .recipient-history-details-grid { + grid-template-columns: 1fr; + } +} + +.recipient-alerts-stack { + margin: 0 20px 8px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.recipient-alert-card { + background: #ffffff; + border-radius: 24px; + padding: 16px; + display: flex; + align-items: flex-start; + gap: 14px; +} + +.recipient-alert-icon-wrap { + width: 44px; + height: 44px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.recipient-alert-icon-wrap ion-icon { + font-size: 20px; +} + +.recipient-alert-icon-wrap.service-medication ion-icon { + font-size: 22px; +} + +.recipient-alert-copy { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 6px; +} + +.recipient-alert-topline { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 10px; +} + +.recipient-alert-topline h3 { + margin: 0; + font-size: 15px; + font-weight: 700; + color: var(--ion-color-dark); +} + +.recipient-alert-copy p { + margin: 0; + font-size: 13px; + line-height: 1.45; + color: var(--ion-color-medium); +} + +.recipient-alert-pill { + flex-shrink: 0; + border-radius: 999px; + padding: 6px 10px; + font-size: 11px; + font-weight: 700; +} + +.recipient-empty-inline-card { + margin: 0 20px 8px; + background: #ffffff; + border-radius: 24px; + padding: 16px; + display: flex; + align-items: center; + gap: 14px; +} + +.recipient-custom-basket-icon { + display: block; +} + +.recipient-empty-inline-icon { + width: 44px; + height: 44px; + border-radius: 12px; + background: rgba(109, 40, 217, 0.08); + color: var(--ion-color-primary); + display: flex; + align-items: center; + justify-content: center; + font-size: 20px; + flex-shrink: 0; +} + +.recipient-empty-inline-copy { + display: flex; + flex-direction: column; + gap: 4px; +} + +.recipient-empty-inline-copy h3 { + margin: 0; + font-size: 15px; + font-weight: 700; + color: var(--ion-color-dark); +} + +.recipient-empty-inline-copy p { + margin: 0; + font-size: 13px; + line-height: 1.4; + color: var(--ion-color-medium); +} + +/* Recipient Form */ +.recipient-form-card { + background: #ffffff; + border-radius: 24px; + padding: 16px; + margin: 12px 20px 14px; + display: flex; + flex-direction: column; + gap: 10px; +} + +.rf-photo-picker { + background: #f8f7fb; + border-radius: 24px; + padding: 14px 16px 12px; + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; + position: relative; + overflow: hidden; +} + +.rf-photo-preview { + width: 64px; + height: 64px; + border-radius: 16px; + object-fit: cover; +} + +.rf-photo-placeholder { + width: 64px; + height: 64px; + border-radius: 16px; + background: rgba(109, 40, 217, 0.1); + display: flex; + align-items: center; + justify-content: center; + color: var(--ion-color-primary); + font-size: 24px; +} + +.rf-photo-label { + font-size: 13px; + font-weight: 600; + color: var(--ion-color-primary); +} + +.rf-photo-input { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + cursor: pointer; +} + +.rf-input-shell { + min-height: 56px; + background: #f8f7fb; + border: 1.5px solid transparent; + border-radius: 12px; + padding: 8px 16px 7px; + display: flex; + flex-direction: column; + justify-content: center; + gap: 2px; + transition: + background 160ms ease, + border-color 160ms ease, + box-shadow 160ms ease; +} + +.rf-text-shell, +.rf-phone-shell { + width: 100%; + appearance: none; + border-color: transparent; + text-align: left; +} + +.rf-input-shell:focus-within { + background: #ffffff; + border-color: rgba(109, 40, 217, 0.42); + box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.1); +} + +.rf-field-label { + color: rgba(17, 24, 39, 0.62); + font-size: 12px; + font-weight: 650; + line-height: 1.1; + letter-spacing: 0; +} + +.rf-input-shell:focus-within .rf-field-label { + color: var(--ion-color-primary); +} + +.rf-field { + --background: transparent; + --padding-start: 0; + --padding-end: 0; + --padding-top: 0; + --padding-bottom: 0; + --color: #111827; + --placeholder-color: rgba(17, 24, 39, 0.34); + --placeholder-opacity: 1; + --highlight-color-focused: transparent; + --highlight-color-valid: transparent; + --highlight-color-invalid: transparent; + color: #111827; + font-size: 15px; + font-weight: 600; + min-height: 20px; + caret-color: var(--ion-color-primary); +} + +.rf-field::part(native) { + color: #111827; + font-size: 15px; + font-weight: 600; + line-height: 1.25; + padding: 0; + caret-color: var(--ion-color-primary); +} + +.rf-field input::placeholder { + color: rgba(17, 24, 39, 0.34); + font-weight: 400; +} + +.rf-phone-shell { + align-items: stretch; +} + +.rf-phone-row { + display: flex; + align-items: center; + gap: 14px; + min-width: 0; +} + +.rf-phone-prefix { + display: flex; + align-items: center; + gap: 7px; + min-width: 76px; + flex-shrink: 0; + color: #111827; + font-size: 15px; + font-weight: 600; +} + +.rf-phone-flag { + font-size: 17px; + line-height: 1; +} + +.rf-phone-code { + font-variant-numeric: tabular-nums; +} + +.rf-phone-field { + flex: 1; + min-width: 0; +} + +.rf-phone-hint { + font-size: 12px; + color: var(--ion-color-medium); + margin-top: -4px; +} + +.rf-actions { + margin: 0 20px 20px; + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; +} + +.rf-submit-btn { + --background: var(--ion-color-primary); + --border-radius: 999px; + font-size: 15px; + font-weight: 700; + margin: 0; + height: 52px; + width: 100%; +} + +/* Country Bottom Sheet */ +.rf-country-trigger { + width: 100%; + border: 1.5px solid transparent; + background: #f8f7fb; + border-radius: 12px; + padding: 8px 16px 7px; + display: flex; + flex-direction: column; + justify-content: center; + gap: 2px; + text-align: left; + min-height: 56px; + transition: + background 160ms ease, + border-color 160ms ease, + box-shadow 160ms ease; +} + +.rf-country-trigger:focus-visible { + background: #ffffff; + border-color: rgba(109, 40, 217, 0.42); + box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.1); + outline: none; +} + +.rf-country-trigger:disabled { + opacity: 0.6; +} + +.rf-country-label { + font-size: 12px; + font-weight: 650; + color: rgba(17, 24, 39, 0.62); + line-height: 1.1; + letter-spacing: 0; +} + +.rf-country-trigger:focus-visible .rf-country-label { + color: var(--ion-color-primary); +} + +.rf-country-value-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.rf-country-value { + font-size: 15px; + font-weight: 600; + color: #111827; + line-height: 1.25; +} + +.rf-country-value.is-placeholder { + color: rgba(17, 24, 39, 0.34); + font-weight: 400; +} + +.rf-country-chevron { + font-size: 17px; + color: rgba(17, 24, 39, 0.46); + transform: rotate(-90deg); + flex-shrink: 0; +} + +.country-sheet-modal { + --border-radius: 24px 24px 0 0; + --height: min(560px, 72vh); +} + +.country-sheet-modal::part(content) { + height: min(560px, 72vh); + max-height: calc(100vh - var(--ion-safe-area-top) - 24px); + overflow: hidden; +} + +.country-sheet-shell { + height: 100%; + min-height: 360px; + background: #ffffff; + display: flex; + flex-direction: column; + overflow: hidden; +} + +.country-sheet-header { + min-height: 60px; + flex-shrink: 0; + display: flex; + align-items: center; + justify-content: center; + padding: 8px 56px 6px; + position: relative; + background: #ffffff; +} + +.country-sheet-header h2 { + margin: 0; + font-size: 17px; + font-weight: 700; + color: var(--ion-color-dark); +} + +.country-sheet-close { + position: absolute; + right: 12px; + top: 8px; + width: 44px; + height: 44px; + --padding-start: 0; + --padding-end: 0; + --color: var(--ion-color-primary); + margin: 0; +} + +.country-sheet-scroll { + flex: 1; + min-height: 0; + overflow-y: scroll; + overscroll-behavior: contain; + -webkit-overflow-scrolling: touch; + background: #ffffff; + scrollbar-width: none; + -ms-overflow-style: none; + padding-bottom: calc(180px + var(--ion-safe-area-bottom)); +} + +.country-sheet-scroll::-webkit-scrollbar { + display: none; +} + +.country-sheet-list { + padding: 4px 20px 0; + background: transparent; +} + +.country-sheet-option { + width: 100%; + min-height: 52px; + border: none; + background: transparent; + text-align: left; + padding: 14px 0; + border-bottom: 1px solid rgba(17, 24, 39, 0.06); +} + +.country-sheet-option:last-child { + border-bottom: none; +} + +.country-sheet-option-text { + display: flex; + align-items: center; + gap: 8px; + color: var(--ion-color-primary); +} + +.country-sheet-flag { + font-size: 21px; + line-height: 1; + flex-shrink: 0; +} + +.country-sheet-name, +.country-sheet-code { + font-size: 15px; + line-height: 1.25; +} + +.country-sheet-option.is-selected .country-sheet-name, +.country-sheet-option.is-selected .country-sheet-code, +.location-sheet-option.is-selected .location-sheet-name { + font-weight: 700; +} + +.location-sheet-helper { + margin: 0 20px 8px; + padding: 12px 14px; + border-radius: 12px; + background: rgba(109, 40, 217, 0.08); + color: var(--ion-color-primary); + font-size: 13px; + line-height: 1.35; +} + +.location-sheet-group { + padding: 0 20px; +} + +.location-sheet-group-title { + margin: 18px 0 6px; + font-size: 12px; + font-weight: 700; + color: var(--ion-color-medium); + text-transform: uppercase; + letter-spacing: 0.05em; +} + +.location-sheet-option { + padding: 12px 0; +} + +.location-sheet-option-text { + display: flex; + flex-direction: column; + gap: 3px; + color: var(--ion-color-primary); +} + +.location-sheet-name { + font-size: 15px; + line-height: 1.25; +} + +.location-sheet-description { + font-size: 12px; + line-height: 1.3; + color: var(--ion-color-medium); +} diff --git a/src/styles/support.css b/src/styles/support.css new file mode 100644 index 0000000..0b1e899 --- /dev/null +++ b/src/styles/support.css @@ -0,0 +1,2306 @@ +/* Support Flow */ +.support-toolbar { + --background: var(--flow-accent-soft, #fafafa); + --border-width: 0px; + --min-height: 58px; + --padding-start: 8px; + --padding-end: 20px; + color: var(--color-text-primary); +} + +.support-toolbar-title { + color: var(--color-text-primary); + font-size: 18px; + font-weight: 700; +} + +.support-toolbar-title .toolbar-title, +.support-summary-toolbar-title .toolbar-title { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; +} + +.support-summary-toolbar-title { + letter-spacing: -0.02em; +} + +.support-toolbar-service-icon { + width: 32px; + height: 32px; + border-radius: 12px; + background: var(--flow-icon-soft, rgba(109, 40, 217, 0.12)); + color: var(--flow-accent, #6d28d9); + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + vertical-align: middle; +} + +.support-toolbar-service-icon ion-icon { + font-size: 18px; +} + +.support-toolbar-service-image { + width: 24px; + height: 24px; + object-fit: contain; +} + +.support-back-button { + --color: var(--support-action-accent, var(--color-brand)); + --background: transparent; + --background-activated: transparent; + --border-radius: 12px; + --box-shadow: none; + width: 44px; + height: 44px; + margin-left: 8px; +} + +.support-back-button ion-icon { + color: var(--support-action-accent, var(--color-brand)); + font-size: 24px; +} + +.order-detail-root-escape-button { + --color: var(--root-escape-accent, var(--color-text-primary)); + --background: transparent; + --background-activated: transparent; +} + +.order-detail-root-escape-button ion-icon { + color: var(--root-escape-accent, var(--color-text-primary)); + font-size: 22px; +} + +.order-detail-root-escape-image { + width: 26px; + height: 26px; + object-fit: contain; + flex-shrink: 0; +} + +.support-step-indicator { + background: #ffffff; + border-radius: 24px; + padding: 14px 16px; + margin: 16px 20px; + display: flex; + align-items: center; + justify-content: space-between; +} + +.ssi-chip { + width: 32px; + height: 32px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 14px; + font-weight: 700; + background: #fafafa; + color: var(--ion-color-medium); + transition: all 0.3s ease; +} + +.ssi-chip.active { + background: var(--flow-accent, var(--ion-color-primary)); + color: #ffffff; +} + +.ssi-chip.completed { + background: var(--flow-accent-soft, rgba(109, 40, 217, 0.1)); + color: var(--flow-accent, var(--ion-color-primary)); +} + +.ssi-line { + flex: 1; + height: 2px; + background: #f4f5f5; + margin: 0 8px; +} + +.ssi-line.active { + background: var(--flow-accent, rgba(109, 40, 217, 0.5)); + opacity: 0.45; +} + +.support-form-card { + background: #ffffff; + border-radius: 24px; + padding: 20px; + margin: 0 20px 12px; +} + +.support-form-card-themed { + background: linear-gradient( + 180deg, + var(--flow-card-soft, #ffffff) 0%, + #ffffff 58% + ); +} + +.support-select, +.support-text-input { + --background: #fafafa; + --color: var(--color-text-primary); + --placeholder-color: var(--color-text-secondary); + --placeholder-opacity: 1; + --border-radius: 12px; + --padding-start: 16px; + --padding-end: 16px; + min-height: 54px; + border-radius: 12px; + background: #fafafa; +} + +.support-payment-select-wrap { + margin-top: 16px; +} + +.support-payment-select-label { + display: block; + margin-bottom: 8px; + font-size: 13px; + font-weight: 600; + color: #171827; +} + +.support-payment-trigger-copy { + display: flex; + flex-direction: column; + gap: 2px; + min-width: 0; + flex: 1; +} + +.support-payment-trigger-name { + font-size: 15px; + font-weight: 700; + color: #171827; +} + +.support-payment-trigger-detail { + font-size: 12px; + color: rgba(23, 24, 39, 0.56); + line-height: 1.35; +} + +.support-payment-preview, +.support-payment-sheet-option { + width: 100%; + border: none; + border-radius: 16px; + background: #fafafa; + padding: 14px 16px; + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.support-payment-preview-button { + cursor: pointer; +} + +.support-payment-preview-chevron { + flex-shrink: 0; + color: rgba(23, 24, 39, 0.5); + font-size: 18px; +} + +.support-payment-modal { + --border-radius: 18px 18px 0 0; +} + +.support-payment-modal::part(content) { + border-radius: 18px 18px 0 0; +} + +.support-payment-modal::part(backdrop) { + border-radius: 18px 18px 0 0; +} + +.support-payment-sheet-content { + --padding-bottom: calc(40px + var(--ion-safe-area-bottom)); +} + +.support-payment-sheet { + padding: 12px 20px calc(56px + var(--ion-safe-area-bottom)); + min-height: 100%; +} + +.support-payment-sheet-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 16px; + margin-bottom: 20px; +} + +.support-payment-sheet-title { + margin: 0 0 4px; + font-size: 18px; + font-weight: 700; + color: #171827; +} + +.support-payment-sheet-subtitle { + margin: 0; + font-size: 13px; + color: rgba(23, 24, 39, 0.56); + line-height: 1.45; +} + +.support-payment-sheet-close { + width: 36px; + height: 36px; + border: none; + border-radius: 12px; + background: #f5f5f5; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.support-payment-sheet-close ion-icon { + font-size: 20px; + color: #171827; +} + +.support-payment-sheet-list { + display: flex; + flex-direction: column; + gap: 14px; + background: transparent; + padding: 0 0 calc(132px + var(--ion-safe-area-bottom)); + margin-bottom: calc(24px + var(--ion-safe-area-bottom)); +} + +.support-payment-sheet-option { + box-shadow: inset 0 0 0 1px rgba(23, 24, 39, 0.04); +} + +.support-payment-sheet-option.selected { + background: rgba(109, 40, 217, 0.08); + box-shadow: inset 0 0 0 1.5px rgba(109, 40, 217, 0.18); +} + +.support-payment-selected-dot { + width: 10px; + height: 10px; + border-radius: 999px; + background: #6d28d9; + flex-shrink: 0; +} + +.support-payment-method-icon { + width: 44px; + height: 44px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + font-size: 20px; +} + +.support-payment-method-icon ion-icon { + font-size: 20px; +} + +.support-google-pay-mark { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 2px; + font-family: Arial, Helvetica, sans-serif; + line-height: 1; +} + +.support-google-pay-g { + width: 18px; + height: 18px; + display: block; + flex-shrink: 0; +} + +.support-google-pay-pay { + font-size: 11px; + font-weight: 700; + color: #3c4043; + letter-spacing: -0.4px; +} + +.support-payment-method-icon-card { + background: linear-gradient( + 135deg, + rgba(109, 40, 217, 0.14), + rgba(124, 58, 237, 0.22) + ); + color: #6d28d9; +} + +.support-payment-method-icon-apple { + background: linear-gradient(135deg, #101828, #1f2937); + color: #ffffff; +} + +.support-payment-method-icon-apple ion-icon { + color: #ffffff; +} + +.support-payment-method-icon-google { + background: linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%); + box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05); + color: #4285f4; +} + +.support-payment-method-icon-paypal { + background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); + color: #003087; +} + +.support-payment-method-icon-paypal ion-icon { + font-size: 22px; +} + +.support-payment-sheet-option:last-child { + margin-bottom: calc(64px + var(--ion-safe-area-bottom)); +} + +.support-recipient-trigger { + width: 100%; + min-height: 76px; + border: none; + border-radius: 12px; + background: #fafafa; + padding: 14px 16px; + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.support-recipient-trigger-left, +.support-recipient-sheet-item-left { + display: flex; + align-items: center; + gap: 12px; + min-width: 0; +} + +.support-recipient-avatar { + width: 44px; + height: 44px; + flex-shrink: 0; + background: rgba(109, 40, 217, 0.12); +} + +.support-recipient-avatar img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.support-recipient-avatar-fallback { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + font-size: 14px; + font-weight: 700; + color: #6d28d9; +} + +.support-recipient-copy { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 3px; + min-width: 0; +} + +.support-recipient-name { + font-size: 15px; + font-weight: 600; + color: #171827; +} + +.support-recipient-hint { + font-size: 12px; + color: rgba(23, 24, 39, 0.56); + text-align: left; +} + +.support-recipient-chevron { + flex-shrink: 0; + color: rgba(23, 24, 39, 0.5); + font-size: 18px; +} + +.support-recipient-modal { + --border-radius: 18px 18px 0 0; +} + +.support-recipient-modal::part(content) { + border-radius: 18px 18px 0 0; +} + +.support-recipient-modal::part(backdrop) { + border-radius: 18px 18px 0 0; +} + +.support-recipient-sheet { + padding: 12px 20px calc(24px + var(--ion-safe-area-bottom)); +} + +.support-recipient-sheet-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 16px; + margin-bottom: 18px; +} + +.support-recipient-sheet-title { + margin: 0 0 4px; + font-size: 18px; + font-weight: 700; + color: #171827; +} + +.support-recipient-sheet-subtitle { + margin: 0; + font-size: 13px; + color: rgba(23, 24, 39, 0.56); + line-height: 1.45; +} + +.support-recipient-sheet-close { + width: 36px; + height: 36px; + border: none; + border-radius: 12px; + background: #f5f5f5; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.support-recipient-sheet-close ion-icon { + font-size: 20px; + color: #171827; +} + +.support-recipient-sheet-list { + display: flex; + flex-direction: column; + gap: 10px; +} + +.support-recipient-sheet-item { + width: 100%; + border: none; + border-radius: 16px; + background: #fafafa; + padding: 14px 16px; + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.support-recipient-sheet-item.selected { + background: rgba(109, 40, 217, 0.08); +} + +.support-recipient-sheet-avatar { + width: 48px; + height: 48px; +} + +.support-recipient-selected-dot { + width: 10px; + height: 10px; + border-radius: 999px; + background: #6d28d9; + flex-shrink: 0; +} + +.category-explainer-card { + width: 100%; +} + +.sfc-title { + font-size: 16px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0 0 16px; +} + +.support-context-row { + display: flex; + align-items: flex-start; + gap: 12px; + margin-bottom: 16px; +} + +.support-context-row-amount { + margin-bottom: 20px; +} + +.support-context-avatar-wrap { + position: relative; + width: 74px; + height: 74px; + flex-shrink: 0; +} + +.support-context-avatar { + width: 67px; + height: 67px; + background: var(--flow-icon-soft, rgba(109, 40, 217, 0.12)); +} + +.support-context-avatar img { + width: 100%; + height: 100%; + object-fit: cover; +} + +.support-context-badge { + position: absolute; + right: 0; + bottom: 0; + width: 24px; + height: 24px; + border-radius: 12px; + background: var(--flow-icon-soft, rgba(109, 40, 217, 0.12)); + color: var(--flow-accent, #6d28d9); + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 0 0 3px #ffffff; +} + +.support-context-badge ion-icon { + font-size: 22px; +} + +.support-context-badge-image { + width: 22.5px; + height: 22.5px; + object-fit: contain; +} + +.support-context-icon { + width: 44px; + height: 44px; + border-radius: 12px; + background: var(--flow-icon-soft, rgba(109, 40, 217, 0.12)); + color: var(--flow-accent, #6d28d9); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.support-context-icon ion-icon { + font-size: 22px; +} + +.support-context-image { + width: 30px; + height: 30px; + object-fit: contain; +} + +.support-step-kicker { + margin: 0 0 4px; + color: var(--flow-accent, #6d28d9); + font-size: 12px; + font-weight: 700; +} + +.support-themed-title { + margin-bottom: 0; +} + +.support-recurring-icon { + width: 40px; + height: 40px; + border-radius: 12px; + background: var(--flow-accent-soft, rgba(109, 40, 217, 0.1)); + color: var(--flow-accent, #6d28d9); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.support-recurring-icon ion-icon { + font-size: 20px; +} + +.support-amount-hint { + margin: 2px 0 0; + color: rgba(23, 24, 39, 0.58); + font-size: 13px; + line-height: 1.4; +} + +/* Service Type Cards */ +.service-type-grid { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 12px; +} + +.service-type-card { + background: var(--service-card-bg, #fafafa); + border: 2px solid transparent; + border-radius: 16px; + padding: 16px; + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; + transition: all 0.2s ease; +} + +.service-type-card.selected { + background: var(--service-tint, rgba(109, 40, 217, 0.08)); + border-color: var(--service-accent, var(--ion-color-primary)); +} + +.stc-icon-box { + width: 48px; + height: 48px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + font-size: 24px; + flex-shrink: 0; +} + +.stc-icon-box ion-icon { + font-size: 24px; +} + +.service-type-card.service-medication .stc-icon-box ion-icon { + font-size: 22px; +} + +.support-service-image { + display: block; + object-fit: contain; +} + +.support-service-image-grocery { + width: 33px; + height: 33px; +} + +.stc-label { + font-size: 14px; + font-weight: 600; + color: var(--ion-color-dark); +} + +/* Amount Selection */ +.amount-preset-chips { + display: flex; + flex-wrap: wrap; + gap: 12px; + margin-bottom: 16px; +} + +.amount-chip { + padding: 10px 20px; + border-radius: 999px; + background: #fafafa; + color: var(--ion-color-dark); + font-size: 15px; + font-weight: 600; + border: 2px solid transparent; +} + +.amount-chip.active { + background: rgba(109, 40, 217, 0.1); + border-color: var(--ion-color-primary); + color: var(--ion-color-primary); +} + +.support-form-card-themed .amount-chip.active { + background: var(--flow-accent-soft, rgba(109, 40, 217, 0.1)); + border-color: var(--flow-accent, var(--ion-color-primary)); + color: var(--flow-accent, var(--ion-color-primary)); +} + +.custom-amount-input { + --background: #fafafa; + --color: #171827; + --placeholder-color: rgba(23, 24, 39, 0.42); + --placeholder-opacity: 1; + --border-radius: 12px; + --padding-start: 16px; + color: #171827; + caret-color: var(--flow-accent, #6d28d9); + font-size: 21px; + font-weight: 700; + font-variant-numeric: tabular-nums; +} + +.custom-amount-input input { + color: #171827 !important; + caret-color: var(--flow-accent, #6d28d9); +} + +/* Inline Action Card */ +.support-page-shell { + display: flex; + flex-direction: column; + gap: 12px; + padding-bottom: calc(20px + var(--ion-safe-area-bottom)); +} + +.support-inline-action-card { + margin: 0 20px calc(20px + var(--ion-safe-area-bottom)); + padding: 16px 18px; + border-radius: 24px; + background: rgba(255, 255, 255, 0.96); + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; +} + +.ssb-info { + display: flex; + flex-direction: column; +} + +.ssb-label { + font-size: 13px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0; +} + +.ssb-total { + font-size: 18px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0; +} + +.ssb-btn { + --background: var(--flow-accent, var(--ion-color-primary)); + --background-activated: var(--flow-accent, var(--ion-color-primary)); + --border-radius: 999px; + font-size: 15px; + font-weight: 700; + margin: 0; + min-width: 140px; +} + +.support-payment-result-card { + background: #ffffff; + border-radius: 24px; + padding: 24px; + margin: 16px 20px 12px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 16px; +} + +.sprc-icon-shell { + width: 64px; + height: 64px; + border-radius: 24px; + display: flex; + align-items: center; + justify-content: center; +} + +.sprc-icon-shell.success { + background: rgba(22, 163, 74, 0.12); + color: #16a34a; +} + +.sprc-icon-shell.failure { + background: rgba(239, 68, 68, 0.12); + color: #dc2626; +} + +.sprc-icon-shell ion-icon { + font-size: 32px; +} + +.sprc-eyebrow { + margin: 0; + color: rgba(23, 24, 39, 0.48); + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.08em; +} + +.sprc-title { + margin: 0 0 6px; + color: #171827; + font-size: 26px; + font-weight: 700; + line-height: 1.12; +} + +.sprc-body { + margin: 0; + color: rgba(23, 24, 39, 0.62); + font-size: 14px; + line-height: 1.5; +} + +.sprc-summary-slab { + width: 100%; + background: #fafafa; + border-radius: 16px; + padding: 14px 16px; + display: flex; + flex-direction: column; + gap: 10px; + text-align: left; +} + +.sprc-summary-row { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + font-size: 14px; +} + +.sprc-summary-row span { + color: rgba(23, 24, 39, 0.56); +} + +.sprc-summary-row strong { + color: #171827; + font-weight: 700; +} + +.sprc-actions { + width: 100%; + display: flex; + flex-direction: column; + gap: 10px; + margin-top: 8px; +} + +.sprc-primary-btn { + --background: var(--flow-accent, var(--ion-color-primary)); + --background-activated: var(--flow-accent, var(--ion-color-primary)); + --border-radius: 999px; + margin: 0; + min-height: 48px; + font-size: 15px; + font-weight: 700; +} + +.sprc-secondary-btn { + --background: #fafafa; + --color: #171827; + --border-radius: 999px; + --box-shadow: none; + margin: 0; + min-height: 48px; + font-size: 15px; + font-weight: 700; +} + +/* Orders List */ +.orders-filter-row { + display: flex; + overflow-x: auto; + padding: 0 20px 12px; + margin: 8px 0 0; + gap: 8px; + scroll-snap-type: x mandatory; +} + +.orders-filter-row::-webkit-scrollbar { + display: none; +} + +.status-filter-chip { + padding: 8px 16px; + border-radius: 999px; + font-size: 13px; + font-weight: 600; + white-space: nowrap; + scroll-snap-align: start; +} + +.status-filter-chip.active { + background: var(--ion-color-primary); + color: #ffffff; +} + +.status-filter-chip.inactive { + background: #ffffff; + color: var(--ion-color-medium); +} + +.order-summary-card { + background: #ffffff; + border-radius: 24px; + padding: 16px; + margin: 0 20px 12px; + display: flex; + align-items: center; + gap: 16px; +} + +.osc-icon { + width: 48px; + height: 48px; + border-radius: 16px; + display: flex; + align-items: center; + justify-content: center; + font-size: 24px; + flex-shrink: 0; +} + +.osc-info { + flex: 1; +} + +.osc-title { + font-size: 15px; + font-weight: 700; + color: var(--ion-color-dark); + margin: 0 0 2px; +} + +.osc-subtitle { + font-size: 13px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0 0 4px; +} + +.osc-date { + font-size: 12px; + font-weight: 400; + color: #9ca3af; + margin: 0; +} + +.osc-meta { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 6px; +} + +.osc-amount { + font-size: 15px; + font-weight: 700; + color: var(--ion-color-dark); +} + +.osc-badge { + padding: 4px 8px; + border-radius: 999px; + font-size: 11px; + font-weight: 700; + display: flex; + align-items: center; + gap: 4px; +} + +/* Order Detail */ +.order-status-summary { + background: #ffffff; + border-radius: 24px; + padding: 24px 20px 22px; + margin: 20px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.order-status-summary-modern { + position: relative; + overflow: hidden; + padding: 16px; + background: linear-gradient( + 180deg, + rgba(255, 255, 255, 0.98) 0%, + #ffffff 100% + ); +} + +.order-status-summary-glow { + position: absolute; + right: -28px; + top: -38px; + width: 168px; + height: 168px; + border-radius: 999px; + background: radial-gradient( + circle, + var(--service-soft, rgba(109, 40, 217, 0.12)) 0%, + rgba(255, 255, 255, 0) 72% + ); + pointer-events: none; +} + +.order-status-summary-topline { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + position: relative; + z-index: 1; +} + +.order-status-meta-row { + display: flex; + align-items: center; + gap: 8px; + flex-wrap: wrap; +} + +.order-status-badge { + min-height: 28px; + padding: 0 12px; + border-radius: 999px; + display: inline-flex; + align-items: center; + font-size: 12px; + font-weight: 700; + flex-shrink: 0; +} + +.order-status-recipient { + color: rgba(23, 24, 39, 0.62); + font-size: 13px; + font-weight: 600; +} + +.order-status-summary-core { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + position: relative; + z-index: 1; +} + +.order-status-summary-core-refined { + align-items: flex-start; + gap: 14px; +} + +.order-status-summary-hero-copy { + flex: 1; + min-width: 0; + text-align: left; + padding-top: 6px; +} + +.order-status-summary-title-row-refined { + display: flex; + align-items: center; + gap: 12px; + margin-bottom: 10px; + min-width: 0; +} + +.order-status-summary-title-copy { + min-width: 0; + display: flex; + align-items: center; + min-height: 70px; + flex: 1; +} + +.order-status-summary-title-copy .oss-title { + width: 100%; + font-size: 22px; + line-height: 1.12; + overflow-wrap: normal; + word-break: normal; +} + +.order-status-summary-title-row { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 6px; +} + +.order-status-summary-service-badge { + width: 70px; + height: 70px; + border-radius: 20px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.order-status-summary-service-badge-large { + width: 70px; + height: 70px; + border-radius: 20px; +} + +.order-status-summary-service-badge .support-service-icon-vector { + font-size: 35px; +} + +.order-status-summary-service-badge-large .support-service-icon-vector { + font-size: 42px; +} + +.order-status-summary-service-badge .support-service-image { + width: 38px; + height: 38px; +} + +.order-status-summary-service-badge-large .support-service-image { + width: 48px; + height: 48px; +} + +.order-status-summary-hero-art { + flex-shrink: 0; +} + +.order-status-summary-label { + margin: 0 0 6px; + color: rgba(23, 24, 39, 0.5); + font-size: 11px; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.order-status-summary-finance-row { + display: flex; + align-items: center; + gap: 12px; + border-radius: 24px; + background: linear-gradient( + 180deg, + rgba(255, 255, 255, 0.94) 0%, + #fafafa 100% + ); + padding: 14px 16px; + position: relative; + z-index: 1; +} + +.order-status-summary-finance-block { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + gap: 4px; +} + +.order-status-summary-finance-block.align-end { + text-align: right; + align-items: flex-end; +} + +.order-status-summary-finance-label { + color: rgba(23, 24, 39, 0.48); + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.08em; +} + +.order-status-summary-finance-block strong { + color: #171827; + font-size: 19px; + font-weight: 600; + font-variant-numeric: tabular-nums; +} + +.order-status-summary-finance-divider { + width: 1px; + align-self: stretch; + background: rgba(23, 24, 39, 0.08); +} + +.order-detail-recipient-hero-avatar-shell { + position: relative; + width: 102px; + height: 102px; + flex-shrink: 0; +} + +.order-detail-recipient-hero-avatar, +.order-detail-recipient-hero-avatar-fallback { + width: 100%; + height: 100%; + border-radius: 28px; + background: #f3f1f8; + display: flex; + align-items: center; + justify-content: center; +} + +.order-detail-recipient-hero-avatar { + object-fit: cover; +} + +.order-detail-recipient-hero-avatar-fallback { + color: #6d28d9; + font-size: 30px; + font-weight: 700; +} + +.order-detail-recipient-hero-badge { + position: absolute; + right: -3px; + bottom: -3px; + width: 34px; + height: 34px; + border-radius: 999px; + display: flex; + align-items: center; + justify-content: center; + border: 2px solid #ffffff; + box-shadow: 0 6px 14px rgba(23, 24, 39, 0.12); + overflow: hidden; +} + +.order-detail-recipient-hero-badge.order-service-card-grocery { + background: #f1e7fb; + color: #6d28d9; +} + +.order-detail-recipient-hero-badge.order-service-card-medication { + background: #e8f7ee; + color: #16a34a; +} + +.order-detail-recipient-hero-badge.order-service-card-airtime { + background: #eaf3ff; + color: #2563eb; +} + +.order-detail-recipient-hero-badge.order-service-card-electricity { + background: #fff2df; + color: #d97706; +} + +.order-detail-recipient-hero-badge .support-service-icon-vector { + font-size: 15px; + --ionicon-stroke-width: 48px; +} + +.order-detail-recipient-hero-badge .order-detail-basket-image { + width: 24px; + height: 24px; +} + +.support-service-icon-vector { + font-size: 30px; +} + +.order-service-card-grocery { + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; +} + +.order-service-card-medication { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.order-service-card-airtime { + background: rgba(37, 99, 235, 0.1); + color: #2563eb; +} + +.order-service-card-electricity { + background: rgba(245, 158, 11, 0.12); + color: #d97706; +} + +undefined .money-breakdown-list { + background: #ffffff; + border-radius: 24px; + padding: 16px 20px; + margin: 0 20px 12px; + display: flex; + flex-direction: column; + gap: 12px; +} + +.mbl-row { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 16px; + padding: 6px 0; + font-size: 14px; + color: var(--ion-color-medium); +} + +.mbl-row span, +.mbl-row strong { + line-height: 1.4; +} + +.mbl-row strong { + text-align: right; + flex-shrink: 0; +} + +.support-review-primary-row { + margin-bottom: 8px; +} + +.support-redemption-note { + display: flex; + align-items: flex-start; + gap: 12px; + margin: 0 0 14px; + padding: 12px 14px; + border-radius: 12px; + background: var(--flow-accent-soft, rgba(109, 40, 217, 0.08)); +} + +.support-redemption-note-icon { + width: 36px; + height: 36px; + border-radius: 12px; + background: var(--flow-icon-soft, rgba(109, 40, 217, 0.12)); + color: var(--flow-accent, #6d28d9); + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.support-redemption-note-icon ion-icon { + font-size: 29px; +} + +.support-redemption-note-icon img { + width: 29px; + height: 29px; + object-fit: contain; + transform: scale(1.08); + transform-origin: center; +} + +.support-redemption-note-copy { + display: flex; + flex-direction: column; + gap: 3px; + min-width: 0; +} + +.support-redemption-note-title { + margin: 0; + color: #171827; + font-size: 13px; + font-weight: 600; + line-height: 1.35; +} + +.support-redemption-note-subtitle { + margin: 0; + color: rgba(23, 24, 39, 0.56); + font-size: 12px; + line-height: 1.4; +} + +.mbl-row.total { + font-size: 16px; + font-weight: 700; + color: var(--ion-color-dark); + border-top: 1px solid var(--color-border); + padding-top: 12px; + margin-top: 4px; +} + +.order-detail-card { + background: #ffffff; + border-radius: 24px; + padding: 20px; + margin: 0 20px 12px; + display: flex; + flex-direction: column; + gap: 16px; +} + +.order-detail-card-modern { + background: #ffffff; +} + +.order-detail-card-route { + background: #ffffff; +} + +.order-detail-section-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; +} + +.order-detail-section-header.modern { + align-items: center; +} + +.order-detail-section-header-summary { + margin-bottom: 4px; +} + +.order-detail-section-header.compact { + margin-bottom: -4px; +} + +.order-detail-section-kicker { + margin: 0 0 4px; + color: rgba(23, 24, 39, 0.56); + font-size: 12px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.08em; +} + +.order-detail-section-title { + margin: 0; + color: #171827; + font-size: 18px; + font-weight: 700; + line-height: 1.25; +} + +.order-detail-section-subtitle { + margin: 6px 0 0; + color: rgba(23, 24, 39, 0.56); + font-size: 13px; + line-height: 1.45; +} + +.order-detail-total-chip { + min-height: 32px; + padding: 0 12px; + border-radius: 999px; + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; + display: inline-flex; + align-items: center; + font-size: 12px; + font-weight: 700; + flex-shrink: 0; +} + +.order-detail-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; +} + +.order-detail-grid.compact { + gap: 10px; +} + +.order-detail-tile { + min-width: 0; + border-radius: 12px; + background: #fafafa; + padding: 14px; + display: flex; + align-items: flex-start; + gap: 12px; +} + +.order-detail-tile-wide { + grid-column: 1 / -1; +} + +.order-detail-tile-service { + background: linear-gradient( + 180deg, + rgba(109, 40, 217, 0.04) 0%, + #fafafa 100% + ); +} + +.order-detail-tile-service-compact { + align-items: center; +} + +.order-detail-tile-amount { + background: rgba(22, 163, 74, 0.06); +} + +.order-detail-tile-time { + background: rgba(245, 158, 11, 0.08); +} + +.order-detail-tile-payment { + background: rgba(37, 99, 235, 0.07); +} + +.order-detail-tile.order-service-card-grocery, +.order-detail-tile.order-service-card-medication, +.order-detail-tile.order-service-card-airtime, +.order-detail-tile.order-service-card-electricity { + color: inherit; +} + +.order-detail-tile-icon { + width: 44px; + height: 44px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.order-detail-tile-icon ion-icon { + font-size: 20px; +} + +.order-detail-tile-icon.order-service-card-grocery { + background: rgba(109, 40, 217, 0.12); + color: #6d28d9; +} + +.order-detail-tile-icon.order-service-card-medication { + background: rgba(22, 163, 74, 0.12); + color: #16a34a; +} + +.order-detail-tile-icon.order-service-card-airtime { + background: rgba(37, 99, 235, 0.12); + color: #2563eb; +} + +.order-detail-tile-icon.order-service-card-electricity { + background: rgba(245, 158, 11, 0.14); + color: #d97706; +} + +.order-detail-tile-icon.is-green-soft { + background: rgba(22, 163, 74, 0.12); + color: #16a34a; +} + +.order-detail-tile-icon.is-amber-soft { + background: rgba(245, 158, 11, 0.14); + color: #d97706; +} + +.order-detail-tile-icon.is-blue-soft { + background: rgba(37, 99, 235, 0.12); + color: #2563eb; +} + +.order-detail-basket-image { + width: 54px; + height: 54px; + object-fit: contain; +} + +.order-detail-tile-icon .order-detail-basket-image { + width: 24px; + height: 24px; +} + +.order-detail-tile-label { + margin: 0 0 4px; + color: rgba(23, 24, 39, 0.56); + font-size: 12px; + font-weight: 600; +} + +.order-detail-tile-value { + margin: 0; + color: #171827; + font-size: 14px; + font-weight: 700; + line-height: 1.35; +} + +.order-detail-tile-note { + margin: 6px 0 0; + color: rgba(23, 24, 39, 0.5); + font-size: 12px; + line-height: 1.4; +} + +.compact-metric { + align-items: center; +} + +.compact-metric .order-detail-tile-value { + font-size: 16px; +} + +.order-detail-voucher-shell { + border-radius: 20px; + background: linear-gradient( + 180deg, + var(--service-soft, rgba(109, 40, 217, 0.08)) 0%, + #fafafa 100% + ); + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + gap: 16px; +} + +.order-detail-voucher-qr-wrap { + width: 100%; + display: flex; + justify-content: center; +} + +.order-detail-voucher-qr-frame { + width: 208px; + height: 208px; + border-radius: 24px; + background: #ffffff; + display: flex; + align-items: center; + justify-content: center; + padding: 16px; +} + +.order-detail-voucher-missing { + background: #fdfdfd; + border: 1px dashed rgba(23, 24, 39, 0.12); + padding: 32px 20px; + text-align: center; + gap: 8px; +} + +.odv-missing-icon { + font-size: 32px; + color: rgba(23, 24, 39, 0.24); + margin-bottom: 4px; +} + +.odv-missing-title { + margin: 0; + color: #171827; + font-size: 16px; + font-weight: 600; +} + +.odv-missing-helper { + margin: 0; + color: rgba(23, 24, 39, 0.56); + font-size: 14px; + line-height: 1.5; + max-width: 280px; +} + +.order-detail-voucher-qr-frame svg { + display: block; + width: 176px; + height: 176px; +} + +.order-detail-voucher-copy { + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; + text-align: center; +} + +.order-detail-voucher-code-label { + margin: 0; + color: rgba(23, 24, 39, 0.54); + font-size: 11px; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.order-detail-voucher-code { + margin: 0; + color: #171827; + font-size: 22px; + font-weight: 700; + letter-spacing: 0.04em; +} + +.order-detail-voucher-helper { + margin: 0; + color: rgba(23, 24, 39, 0.6); + font-size: 13px; + line-height: 1.45; + max-width: 260px; +} + +.order-detail-inline-voucher-slot { + position: relative; + border-radius: 24px; + background: linear-gradient( + 180deg, + var(--service-soft, rgba(109, 40, 217, 0.1)) 0%, + rgba(255, 255, 255, 0.72) 130% + ); + padding: 14px 16px 16px; + display: flex; + flex-direction: column; + gap: 8px; +} + +.order-detail-inline-voucher-body { + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; +} + +.order-detail-inline-voucher-frame { + width: 280px; + height: 280px; + border-radius: 24px; + background: #ffffff; + display: flex; + align-items: center; + justify-content: center; + padding: 12px; +} + +.order-detail-inline-voucher-frame svg { + display: block; + width: 252px; + height: 252px; +} + +.order-detail-inline-voucher-copy { + display: flex; + flex-direction: column; + align-items: center; + gap: 3px; + text-align: center; +} + +.order-detail-inline-voucher-actions { + display: flex; + align-items: center; + gap: 10px; + margin-top: 10px; +} + +.order-detail-inline-voucher-action { + min-height: 42px; + border: none; + border-radius: 999px; + background: #ffffff; + color: #171827; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 0 14px; + cursor: pointer; + font: inherit; +} + +.order-detail-inline-voucher-action.is-copy { + background: #ffffff; + color: #171827; +} + +.order-detail-inline-voucher-action.is-share { + background: #ffffff; + color: #171827; +} + +.order-detail-inline-voucher-action-icon { + width: 18px; + height: 18px; + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.order-detail-inline-voucher-action-icon ion-icon { + font-size: 18px; + color: #171827; +} + +.order-detail-toast { + --background: #171827; + --color: #ffffff; + --border-radius: 999px; + --box-shadow: none; + font-weight: 700; +} + +.order-detail-inline-voucher-action-label { + font-size: 14px; + font-weight: 700; + line-height: 1; +} + +.order-detail-inline-voucher-code-label { + margin: 0; + color: rgba(23, 24, 39, 0.46); + font-size: 10px; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; +} + +.order-detail-inline-voucher-code { + margin: 0; + color: #171827; + font-size: 19px; + font-weight: 700; + letter-spacing: 0.05em; +} + +.order-detail-receipt-block { + border-radius: 20px; + background: #fafafa; + padding: 4px; + margin-top: 8px; +} + +.order-detail-breakdown { + background: #fafafa; + margin: 0; + padding: 16px; +} + +.order-detail-breakdown.modern { + box-shadow: none; +} + +.order-detail-list { + display: flex; + flex-direction: column; + gap: 14px; +} + +.modern-route-list { + gap: 0; + border-radius: 20px; + background: #fafafa; + padding: 4px 0; +} + +.order-detail-list-row { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + font-size: 14px; + padding: 12px 16px; +} + +.order-detail-list-row + .order-detail-list-row { + border-top: 1px solid rgba(23, 24, 39, 0.06); +} + +.order-detail-list-row span { + color: rgba(23, 24, 39, 0.56); +} + +.order-detail-list-row strong { + color: #171827; + font-weight: 700; + text-align: right; +} + +.order-detail-activity-card { + gap: 12px; +} + +.order-detail-activity-list { + margin: 0; + padding: 0; +} + +.voucher-preview-card { + background: #ffffff; + border-radius: 24px; + padding: 20px; + margin: 0 20px 12px; + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; +} + +.vpc-info { + display: flex; + flex-direction: column; + gap: 4px; + min-width: 0; +} + +.vpc-label { + font-size: 13px; + font-weight: 600; + color: var(--ion-color-medium); + margin: 0; +} + +.vpc-code { + font-size: 16px; + font-weight: 700; + color: var(--ion-color-primary); + margin: 0; + letter-spacing: 1px; +} + +.vpc-helper { + margin: 0; + color: rgba(23, 24, 39, 0.56); + font-size: 12px; + line-height: 1.4; +} + +.vpc-btn { + --background: rgba(109, 40, 217, 0.1); + --color: var(--ion-color-primary); + --border-radius: 12px; + --box-shadow: none; + font-weight: 600; + margin: 0; +} + +/* Voucher Detail Hero */ +.voucher-hero-card { + background: #ffffff; + border-radius: 24px; + padding: 24px; + margin: 20px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 20px; +} + +.vhc-code-pill { + background: rgba(109, 40, 217, 0.1); + color: var(--ion-color-primary); + padding: 8px 16px; + border-radius: 999px; + font-size: 16px; + font-weight: 700; + letter-spacing: 1px; +} + +.vhc-qr-placeholder { + width: 220px; + height: 220px; + border-radius: 24px; + background: #fafafa; + display: flex; + align-items: center; + justify-content: center; +} + +.vhc-qr-placeholder ion-icon { + font-size: 64px; + color: var(--ion-color-medium); + opacity: 0.5; +} + +.vhc-expiry { + font-size: 14px; + font-weight: 600; + color: var(--ion-color-dark); + margin: 0; +} + +.vhc-merchant { + font-size: 13px; + font-weight: 400; + color: var(--ion-color-medium); + margin: 0; +} + +.voucher-balance-card { + margin: 0 20px 16px; + padding: 18px; + border-radius: 24px; + background: rgba(255, 255, 255, 0.94); + display: flex; + flex-direction: column; + gap: 14px; +} + +.voucher-balance-head { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; +} + +.voucher-balance-title { + margin: 0 0 4px; + color: #171827; + font-size: 16px; + font-weight: 700; +} + +.voucher-balance-subtitle { + margin: 0; + color: rgba(23, 24, 39, 0.56); + font-size: 12px; + line-height: 1.4; +} + +.voucher-balance-total { + color: #171827; + font-size: 20px; + font-weight: 400; + font-variant-numeric: tabular-nums; +} + +.voucher-balance-pills { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.voucher-balance-pill { + min-height: 28px; + border-radius: 999px; + padding: 0 12px; + display: inline-flex; + align-items: center; + font-size: 12px; + font-weight: 700; +} + +.voucher-balance-pill.is-redeemed { + background: rgba(22, 163, 74, 0.1); + color: #16a34a; +} + +.voucher-balance-pill.is-remaining { + background: rgba(245, 158, 11, 0.12); + color: #d97706; +} + +.voucher-redemption-history { + display: flex; + flex-direction: column; + gap: 10px; +} + +.voucher-redemption-history-title { + margin: 0; + color: #171827; + font-size: 13px; + font-weight: 700; +} + +.voucher-redemption-row { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + padding: 12px 0; +} + +.voucher-redemption-row + .voucher-redemption-row { + border-top: 1px solid rgba(23, 24, 39, 0.06); +} + +.voucher-redemption-merchant, +.voucher-redemption-amount { + margin: 0; + color: #171827; + font-size: 14px; + font-weight: 700; +} + +.voucher-redemption-date { + margin: 3px 0 0; + color: rgba(23, 24, 39, 0.54); + font-size: 11px; + line-height: 1.3; +} + +.voucher-redemption-right { + display: flex; + flex-direction: column; + align-items: flex-end; + gap: 5px; + flex-shrink: 0; +} + +.voucher-redemption-status { + min-height: 22px; + border-radius: 999px; + padding: 0 8px; + background: rgba(109, 40, 217, 0.1); + color: #6d28d9; + display: inline-flex; + align-items: center; + font-size: 10px; + font-weight: 700; + text-transform: capitalize; +} + +.security-note-card { + background: rgba(22, 163, 74, 0.08); + border-radius: 16px; + padding: 16px; + margin: 0 20px; + display: flex; + align-items: flex-start; + gap: 12px; +} + +.oss-title { + margin: 0; + font-size: 24px; + font-weight: 700; + color: #171827; + line-height: 1.1; + letter-spacing: -0.01em; +} + +.oss-subtitle { + margin: 8px 0 0; + padding-left: 0; + max-width: 240px; + font-size: 13px; + font-weight: 500; + color: rgba(23, 24, 39, 0.56); + line-height: 1.45; +} + +.snc-icon { + font-size: 20px; + color: var(--ion-color-success); +} + +.snc-text { + font-size: 13px; + font-weight: 400; + color: var(--ion-color-dark); + line-height: 1.4; + margin: 0; +} + +.order-detail-send-again-button { + text-transform: none; + letter-spacing: -0.01em; +} + +.order-detail-send-again-button::part(native) { + font-size: 16px; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 12px; + padding: 0 22px; +} + +.order-detail-send-again-button__label { + color: #ffffff; + font-size: 16px; + font-weight: 800; + line-height: 1; + letter-spacing: -0.01em; +} + +.order-detail-send-again-button.order-tone-grocery { + --background: #6d28d9; + --background-activated: #5b21b6; + --color: #ffffff; +} + +.order-detail-send-again-button.order-tone-medication { + --background: #16a34a; + --background-activated: #15803d; + --color: #ffffff; +} + +.order-detail-send-again-button.order-tone-airtime { + --background: #2563eb; + --background-activated: #1d4ed8; + --color: #ffffff; +} + +.order-detail-send-again-button.order-tone-electricity { + --background: #d97706; + --background-activated: #b45309; + --color: #ffffff; +} + +.order-detail-send-again-button__icon { + width: 28px; + height: 28px; + border-radius: 999px; + background: #ffffff; + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + margin-right: 4px; +} + +.order-detail-send-again-button__icon ion-icon { + font-size: 18px; + --ionicon-stroke-width: 42px; +} + +.order-detail-send-again-button.order-tone-grocery + .order-detail-send-again-button__icon { + color: #6d28d9; +} + +.order-detail-send-again-button.order-tone-medication + .order-detail-send-again-button__icon { + color: #16a34a; +} + +.order-detail-send-again-button.order-tone-airtime + .order-detail-send-again-button__icon { + color: #2563eb; +} + +.order-detail-send-again-button.order-tone-electricity + .order-detail-send-again-button__icon { + color: #d97706; +} + +.order-detail-send-again-button__icon .home-custom-icon.is-basket { + width: 40px; + height: 40px; +} diff --git a/src/supabase.ts b/src/supabase.ts new file mode 100644 index 0000000..48a0919 --- /dev/null +++ b/src/supabase.ts @@ -0,0 +1,7 @@ +import { createClient } from '@supabase/supabase-js'; +import type { Database } from './database.types'; + +export const supabase = createClient( + 'https://pdtnuymihtxnhmzaybif.supabase.co', + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBkdG51eW1paHR4bmhtemF5YmlmIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODE5NTQwOTYsImV4cCI6MjA5NzUzMDA5Nn0.k-3YKruldYrh88JSt4E-Q8veUbnAE6hrsxlrWmwjzeM', +); diff --git a/src/test-globals.d.ts b/src/test-globals.d.ts new file mode 100644 index 0000000..c9172aa --- /dev/null +++ b/src/test-globals.d.ts @@ -0,0 +1,51 @@ +// Ambient test globals for optional *.test.* files in the editor / tsc. +// No test runner is installed in the template; stubs avoid spurious TS errors. + +interface Matchers { + toBeDefined(): R; + toBe(expected: unknown): R; + toEqual(expected: unknown): R; + toBeTruthy(): R; + toBeFalsy(): R; + toBeNull(): R; + toContain(item: unknown): R; + toHaveLength(length: number): R; + toMatch(expected: string | RegExp): R; + toThrow(expected?: string | RegExp | Error): R; + not: Matchers; +} + +interface Expect { + (actual: T): Matchers; +} + +declare const expect: Expect; + +type TestCaseFn = ( + name: string, + fn?: () => void | Promise, + timeout?: number, +) => void; + +declare const test: TestCaseFn; +declare const it: TestCaseFn; +declare const describe: TestCaseFn; + +declare function beforeEach(fn: () => void | Promise): void; +declare function afterEach(fn: () => void | Promise): void; +declare function beforeAll(fn: () => void | Promise): void; +declare function afterAll(fn: () => void | Promise): void; + +declare module "@testing-library/react" { + export function render( + ui: unknown, + options?: object, + ): { + baseElement: Element; + container: Element; + unmount(): void; + rerender(ui: unknown): void; + }; + export const screen: Record Element>; + export function cleanup(): void; +} diff --git a/src/theme/variables.css b/src/theme/variables.css new file mode 100644 index 0000000..a7b0545 --- /dev/null +++ b/src/theme/variables.css @@ -0,0 +1,277 @@ +/* Ionic Variables and Color Palette */ + +:root { + /* Core brand colors */ + --ion-color-primary: #6d28d9; + --ion-color-primary-rgb: 109, 40, 217; + --ion-color-primary-contrast: #ffffff; + --ion-color-primary-contrast-rgb: 255, 255, 255; + --ion-color-primary-shade: #6023bf; + --ion-color-primary-tint: #7b3de1; + + --ion-color-success: #16a34a; + --ion-color-success-rgb: 22, 163, 74; + --ion-color-success-contrast: #ffffff; + --ion-color-success-contrast-rgb: 255, 255, 255; + --ion-color-success-shade: #138f41; + --ion-color-success-tint: #2dac5b; + + --ion-color-warning: #f59e0b; + --ion-color-warning-rgb: 245, 158, 11; + --ion-color-warning-contrast: #ffffff; + --ion-color-warning-contrast-rgb: 255, 255, 255; + --ion-color-warning-shade: #d88b0a; + --ion-color-warning-tint: #f6a823; + + --ion-color-danger: #dc2626; + --ion-color-danger-rgb: 220, 38, 38; + --ion-color-danger-contrast: #ffffff; + --ion-color-danger-contrast-rgb: 255, 255, 255; + --ion-color-danger-shade: #c22121; + --ion-color-danger-tint: #e03c3c; + + --ion-color-dark: #111827; + --ion-color-dark-rgb: 17, 24, 39; + --ion-color-dark-contrast: #ffffff; + --ion-color-dark-contrast-rgb: 255, 255, 255; + --ion-color-dark-shade: #0f1522; + --ion-color-dark-tint: #292f3d; + + --ion-color-medium: #6b7280; + --ion-color-medium-rgb: 107, 114, 128; + --ion-color-medium-contrast: #ffffff; + --ion-color-medium-contrast-rgb: 255, 255, 255; + --ion-color-medium-shade: #5e6470; + --ion-color-medium-tint: #7a808d; + + --ion-color-light: #fafafa; + --ion-color-light-rgb: 250, 250, 250; + --ion-color-light-contrast: #111827; + --ion-color-light-contrast-rgb: 17, 24, 39; + --ion-color-light-shade: #dcdcdc; + --ion-color-light-tint: #fbfbfb; + + /* Typography */ + --ion-font-family: + -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, + sans-serif; + + /* App generic background */ + --ion-background-color: #fafafa; + + /* Utilities */ + --color-brand: #6d28d9; + --color-success: #16a34a; + --color-warning: #f59e0b; + --color-info: #3b82f6; + --color-bg: #fafafa; + --color-surface: #ffffff; + --color-surface-raised: #f4f1fb; + --color-text-primary: #111827; + --color-text-secondary: rgba(17, 24, 39, 0.62); + --color-text-tertiary: rgba(17, 24, 39, 0.38); + --color-border: #e5e7eb; +} + +/* Force light mode globally (no dark mode overrides) */ +@media (prefers-color-scheme: dark) { + :root { + /* We map dark mode vars back to light to enforce light theme for MVP */ + --ion-background-color: #fafafa; + --ion-background-color-rgb: 250, 250, 250; + --ion-text-color: #111827; + --ion-text-color-rgb: 17, 24, 39; + --ion-color-step-50: #f4f5f5; + --ion-color-step-100: #eef0f1; + --ion-color-step-150: #e8eaec; + --ion-color-step-200: #e1e5e8; + --ion-color-step-250: #dbdfe3; + --ion-color-step-300: #d5d9df; + --ion-color-step-350: #cfd4da; + --ion-color-step-400: #c9ced6; + --ion-color-step-450: #c2c9d1; + --ion-color-step-500: #bcc3cc; + --ion-color-step-550: #b6bec8; + --ion-color-step-600: #b0b8c3; + --ion-color-step-650: #a9b3bf; + --ion-color-step-700: #a3adba; + --ion-color-step-750: #9da8b6; + --ion-color-step-800: #97a2b1; + --ion-color-step-850: #919dad; + --ion-color-step-900: #8a97a8; + --ion-color-step-950: #8492a4; + } +} + +/* Custom Tab Bar */ +.app-tab-bar { + --background: rgba(255, 255, 255, 0.98); + --border: none; + border-top: none; + box-shadow: 0 -10px 34px rgba(82, 53, 121, 0.06); + padding: 6px 12px calc(6px + var(--ion-safe-area-bottom, 0px)); +} + +.app-tab-bar ion-tab-button { + --color: rgba(21, 22, 36, 0.5); + --color-selected: #6d28d9; + min-height: 56px; + gap: 3px; +} + +.app-tab-bar ion-tab-button ion-icon { + font-size: 28px; +} + +.app-tab-bar ion-tab-button ion-label { + font-size: 15px; + font-weight: 600; + margin-top: 2px; +} + +.app-send-support-fab { + position: fixed; + left: 50%; + bottom: calc(var(--ion-safe-area-bottom, 0px) + 38px); + z-index: 10000; + width: 64px; + height: 64px; + border: 6px solid #fafafa; + border-radius: 999px; + background: #6d28d9; + color: #ffffff; + transform: translateX(-50%); + display: flex; + align-items: center; + justify-content: center; + box-shadow: + 0 16px 28px rgba(109, 40, 217, 0.24), + 0 6px 14px rgba(109, 40, 217, 0.12); +} + +.app-send-support-fab ion-icon { + font-size: 28px; + flex-shrink: 0; +} + +.app-send-support-fab:active { + transform: translateX(-50%) translateY(1px); +} + +.kumusha-share-sheet { + --border-radius: 24px 24px 0 0; +} + +.kumusha-share-sheet::part(content) { + border-radius: 24px 24px 0 0; +} + +.kumusha-share-sheet-content { + --padding-bottom: calc(28px + var(--ion-safe-area-bottom, 0px)); +} + +.kumusha-share-sheet-shell { + padding: 14px 20px calc(28px + var(--ion-safe-area-bottom, 0px)); +} + +.kumusha-share-sheet-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 16px; + margin-bottom: 18px; +} + +.kumusha-share-sheet-kicker { + margin: 0 0 4px; + font-size: 11px; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; + color: rgba(17, 24, 39, 0.45); +} + +.kumusha-share-sheet-title { + margin: 0; + font-size: 20px; + font-weight: 700; + color: #111827; +} + +.kumusha-share-sheet-close { + width: 40px; + height: 40px; + border: none; + border-radius: 12px; + background: #f4f1fb; + color: #6d28d9; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.kumusha-share-sheet-close ion-icon { + font-size: 20px; +} + +.kumusha-share-sheet-options { + display: flex; + flex-direction: column; + gap: 12px; +} + +.kumusha-share-sheet-option { + width: 100%; + border: none; + border-radius: 24px; + background: #fafafa; + padding: 16px; + display: flex; + align-items: center; + gap: 14px; + text-align: left; +} + +.kumusha-share-sheet-option-icon { + width: 48px; + height: 48px; + border-radius: 12px; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; +} + +.kumusha-share-sheet-option-icon ion-icon { + font-size: 22px; +} + +.kumusha-share-sheet-option-icon.is-brand { + background: rgba(109, 40, 217, 0.12); + color: #6d28d9; +} + +.kumusha-share-sheet-option-icon.is-soft { + background: rgba(22, 163, 74, 0.12); + color: #16a34a; +} + +.kumusha-share-sheet-option-copy { + min-width: 0; + display: flex; + flex-direction: column; + gap: 4px; +} + +.kumusha-share-sheet-option-title { + font-size: 15px; + font-weight: 700; + color: #111827; +} + +.kumusha-share-sheet-option-subtitle { + font-size: 13px; + line-height: 1.4; + color: rgba(17, 24, 39, 0.6); +} diff --git a/src/utils/formatMoney.ts b/src/utils/formatMoney.ts new file mode 100644 index 0000000..9fd5770 --- /dev/null +++ b/src/utils/formatMoney.ts @@ -0,0 +1,11 @@ +export const formatMoney = (amount: number, currency = 'USD') => { + const safeCurrency = currency || 'USD'; + const formatted = new Intl.NumberFormat(undefined, { + style: 'currency', + currency: safeCurrency, + }).format(amount); + + return safeCurrency.toUpperCase() === 'USD' + ? formatted.replace(/US\$/g, '$') + : formatted; +}; diff --git a/src/utils/statusBar.ts b/src/utils/statusBar.ts new file mode 100644 index 0000000..6e2db3f --- /dev/null +++ b/src/utils/statusBar.ts @@ -0,0 +1,32 @@ +import { StatusBar, Style } from '@capacitor/status-bar'; +export { Style }; + +const _origin = (() => { + try { + if (document.referrer) return new URL(document.referrer).origin; + } catch {} + return window.location.origin; +})(); + +/** Set status bar icon/text colour. Use instead of StatusBar.setStyle directly. */ +export async function setStatusBarStyle(style: Style): Promise { + try { + await StatusBar.setStyle({ style }); + } catch {} + if (window.parent !== window) { + window.parent.postMessage({ type: '__apsuite_statusbar', style }, _origin); + } +} + +/** Set status bar background colour (Android). Use instead of StatusBar.setBackgroundColor directly. */ +export async function setStatusBarBackground(color: string): Promise { + try { + await (StatusBar as any).setBackgroundColor({ color }); + } catch {} + if (window.parent !== window) { + window.parent.postMessage( + { type: '__apsuite_statusbar_bg', color }, + _origin + ); + } +} diff --git a/supabase/functions/mark-notification-read/index.ts b/supabase/functions/mark-notification-read/index.ts new file mode 100644 index 0000000..9988c8b --- /dev/null +++ b/supabase/functions/mark-notification-read/index.ts @@ -0,0 +1,77 @@ +import { serve } from 'https://deno.land/std@0.177.0/http/server.ts'; +import { createClient } from 'npm:@supabase/supabase-js@2'; + +const corsHeaders = { + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Headers': + 'authorization, x-client-info, apikey, content-type', +}; + +serve(async (req) => { + if (req.method === 'OPTIONS') { + return new Response('ok', { headers: corsHeaders }); + } + + try { + const supabaseUrl = Deno.env.get('SUPABASE_URL')!; + const supabaseAnonKey = Deno.env.get('SUPABASE_ANON_KEY')!; + + const authHeader = req.headers.get('Authorization'); + if (!authHeader) { + return new Response(JSON.stringify({ error: 'Missing auth headers' }), { + status: 401, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } + + const supabase = createClient(supabaseUrl, supabaseAnonKey, { + global: { headers: { Authorization: authHeader } }, + }); + + const body = await req.json(); + const { notificationId } = body; + + if (!notificationId) { + return new Response(JSON.stringify({ error: 'Missing notificationId' }), { + status: 400, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } + + // Auth validation check: ensure user token resolves + const { + data: { user }, + error: authError, + } = await supabase.auth.getUser(); + if (authError || !user) { + return new Response(JSON.stringify({ error: 'Unauthorized' }), { + status: 401, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } + + const readAt = new Date().toISOString(); + + const { error: updateError } = await supabase + .from('notifications') + .update({ read_at: readAt }) + .eq('id', notificationId) + .eq('user_id', user.id); // RLS also enforces this, but explicit is good + + if (updateError) { + return new Response(JSON.stringify({ error: updateError.message }), { + status: 500, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } + + return new Response(JSON.stringify({ ok: true, readAt }), { + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } catch (err: any) { + return new Response(JSON.stringify({ error: err.message }), { + status: 500, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } +}); diff --git a/supabase/functions/send-notification/index.ts b/supabase/functions/send-notification/index.ts new file mode 100644 index 0000000..30848ea --- /dev/null +++ b/supabase/functions/send-notification/index.ts @@ -0,0 +1,164 @@ +import { serve } from 'https://deno.land/std@0.177.0/http/server.ts'; +import { createClient } from 'npm:@supabase/supabase-js@2'; +import { cert, getApps, initializeApp } from 'npm:firebase-admin@12.2.0/app'; +import { getMessaging } from 'npm:firebase-admin@12.2.0/messaging'; + +const corsHeaders = { + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Headers': + 'authorization, x-client-info, apikey, content-type', +}; + +// Singleton — Edge Functions can be warm-reused; avoid "app already exists" error +const app = + getApps()[0] ?? + initializeApp({ + credential: cert( + JSON.parse( + atob(Deno.env.get('FIREBASE_SERVICE_ACCOUNT')!.replace(/\s/g, '')) + ) + ), + }); +const messaging = getMessaging(app); + +serve(async (req) => { + if (req.method === 'OPTIONS') { + return new Response('ok', { headers: corsHeaders }); + } + + try { + const supabaseUrl = Deno.env.get('SUPABASE_URL')!; + const supabaseAnonKey = Deno.env.get('SUPABASE_ANON_KEY')!; + + const authHeader = req.headers.get('Authorization'); + if (!authHeader) { + return new Response(JSON.stringify({ error: 'Missing auth headers' }), { + status: 401, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } + + const supabase = createClient(supabaseUrl, supabaseAnonKey, { + global: { headers: { Authorization: authHeader } }, + }); + + const body = await req.json(); + const { + userId, + title, + body: messageBody, + type, + orderId, + voucherId, + priority = 'important', + persist = true, + } = body; + + if (!userId || !title || !messageBody || !type) { + return new Response( + JSON.stringify({ error: 'Missing required parameters' }), + { + status: 400, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + } + ); + } + + // Persist notification if needed (using service role key to insert securely if needed, but here auth is user) + // Wait, if an admin/webhook is calling this, they will use service_role. If a user is calling, they use their token. + // Let's create a service-role client just for DB updates to ensure it works even if sender is different from recipient + const serviceRoleKey = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!; + const adminSupabase = createClient(supabaseUrl, serviceRoleKey); + + let notificationId: string | null = null; + let persisted = false; + + if (persist) { + const { data: notifData, error: notifError } = await adminSupabase + .from('notifications') + .insert({ + user_id: userId, + title, + body: messageBody, + type, + priority, + order_id: orderId || null, + voucher_id: voucherId || null, + }) + .select('id') + .single(); + + if (!notifError && notifData) { + notificationId = notifData.id; + persisted = true; + } + } + + // Get user's profile to find fcm_token and preferences + const { data: profile } = await adminSupabase + .from('profiles') + .select('fcm_token, notification_push_enabled') + .eq('id', userId) + .single(); + + let sent = false; + + if (profile && profile.notification_push_enabled && profile.fcm_token) { + const message = { + notification: { + title: title, + body: messageBody, + }, + data: { + orderId: orderId || '', + voucherId: voucherId || '', + type: type || '', + }, + apns: { + payload: { + aps: { + badge: 1, + sound: 'default', + }, + }, + }, + android: { + notification: { + sound: 'default', + notificationCount: 1, + }, + }, + token: profile.fcm_token, + }; + + try { + await messaging.send(message); + sent = true; + } catch (err: any) { + if ( + err.code === 'messaging/registration-token-not-registered' || + err.code === 'messaging/invalid-registration-token' + ) { + // Token is stale — remove it from the DB + await adminSupabase + .from('profiles') + .update({ fcm_token: null }) + .eq('id', userId); + } + console.error('FCM send error:', err); + } + } + + return new Response( + JSON.stringify({ ok: true, sent, persisted, notificationId }), + { + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + } + ); + } catch (err: any) { + return new Response(JSON.stringify({ error: err.message }), { + status: 500, + headers: { ...corsHeaders, 'Content-Type': 'application/json' }, + }); + } +}); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..29e1016 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": false, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "types": ["vite/client"] + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/tsconfig.node.json b/tsconfig.node.json new file mode 100644 index 0000000..9d31e2a --- /dev/null +++ b/tsconfig.node.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true, + "module": "ESNext", + "moduleResolution": "Node", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..d6a1d11 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,41 @@ +// NOTE: @ionic/react and @ionic/react-router are pinned to 8.8.7 in package.json. +// 8.8.8 introduced a regression that breaks IonRouterOutlet page transition animations. +// Do not upgrade until the upstream fix is confirmed. +import { defineConfig, type Plugin } from 'vite'; +import react from '@vitejs/plugin-react'; + +const injectRouterBasename: Plugin = { + name: 'inject-router-basename', + enforce: 'pre', + transform(code, id) { + if (!/\.[jt]sx$/.test(id)) return null; + const next = code.replace( + /]*basename)([^>]*)>/g, + '', + ); + return next === code ? null : next; + }, +}; + +const hideScrollbars: Plugin = { + name: 'hide-scrollbars', + transformIndexHtml(html) { + return html.replace( + '', + '', + ); + }, +}; + +export default defineConfig({ + plugins: [injectRouterBasename, hideScrollbars, react()], + server: { + host: '0.0.0.0', + port: 8100, + allowedHosts: true, + hmr: { + clientPort: process.env.HMR_CLIENT_PORT ? parseInt(process.env.HMR_CLIENT_PORT) : undefined, + }, + }, + css: { devSourcemap: false }, +}); diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..c63de7c --- /dev/null +++ b/yarn.lock @@ -0,0 +1,3762 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"@babel/code-frame@npm:^7.28.6, @babel/code-frame@npm:^7.29.0": + version: 7.29.0 + resolution: "@babel/code-frame@npm:7.29.0" + dependencies: + "@babel/helper-validator-identifier": "npm:^7.28.5" + js-tokens: "npm:^4.0.0" + picocolors: "npm:^1.1.1" + checksum: 10c0/d34cc504e7765dfb576a663d97067afb614525806b5cad1a5cc1a7183b916fec8ff57fa233585e3926fd5a9e6b31aae6df91aa81ae9775fb7a28f658d3346f0d + languageName: node + linkType: hard + +"@babel/compat-data@npm:^7.28.6": + version: 7.29.3 + resolution: "@babel/compat-data@npm:7.29.3" + checksum: 10c0/81bddd53ce1b1395576fbb7cb739631a976f6b421cd260e6cf2715a9691b9a0ec12ca5c4e1bb88088e60dc87875f6e4ef7fa8674f1dc96ae1bd7c357416605a7 + languageName: node + linkType: hard + +"@babel/core@npm:^7.28.0": + version: 7.29.0 + resolution: "@babel/core@npm:7.29.0" + dependencies: + "@babel/code-frame": "npm:^7.29.0" + "@babel/generator": "npm:^7.29.0" + "@babel/helper-compilation-targets": "npm:^7.28.6" + "@babel/helper-module-transforms": "npm:^7.28.6" + "@babel/helpers": "npm:^7.28.6" + "@babel/parser": "npm:^7.29.0" + "@babel/template": "npm:^7.28.6" + "@babel/traverse": "npm:^7.29.0" + "@babel/types": "npm:^7.29.0" + "@jridgewell/remapping": "npm:^2.3.5" + convert-source-map: "npm:^2.0.0" + debug: "npm:^4.1.0" + gensync: "npm:^1.0.0-beta.2" + json5: "npm:^2.2.3" + semver: "npm:^6.3.1" + checksum: 10c0/5127d2e8e842ae409e11bcbb5c2dff9874abf5415e8026925af7308e903f4f43397341467a130490d1a39884f461bc2b67f3063bce0be44340db89687fd852aa + languageName: node + linkType: hard + +"@babel/generator@npm:^7.29.0": + version: 7.29.1 + resolution: "@babel/generator@npm:7.29.1" + dependencies: + "@babel/parser": "npm:^7.29.0" + "@babel/types": "npm:^7.29.0" + "@jridgewell/gen-mapping": "npm:^0.3.12" + "@jridgewell/trace-mapping": "npm:^0.3.28" + jsesc: "npm:^3.0.2" + checksum: 10c0/349086e6876258ef3fb2823030fee0f6c0eb9c3ebe35fc572e16997f8c030d765f636ddc6299edae63e760ea6658f8ee9a2edfa6d6b24c9a80c917916b973551 + languageName: node + linkType: hard + +"@babel/helper-compilation-targets@npm:^7.28.6": + version: 7.28.6 + resolution: "@babel/helper-compilation-targets@npm:7.28.6" + dependencies: + "@babel/compat-data": "npm:^7.28.6" + "@babel/helper-validator-option": "npm:^7.27.1" + browserslist: "npm:^4.24.0" + lru-cache: "npm:^5.1.1" + semver: "npm:^6.3.1" + checksum: 10c0/3fcdf3b1b857a1578e99d20508859dbd3f22f3c87b8a0f3dc540627b4be539bae7f6e61e49d931542fe5b557545347272bbdacd7f58a5c77025a18b745593a50 + languageName: node + linkType: hard + +"@babel/helper-globals@npm:^7.28.0": + version: 7.28.0 + resolution: "@babel/helper-globals@npm:7.28.0" + checksum: 10c0/5a0cd0c0e8c764b5f27f2095e4243e8af6fa145daea2b41b53c0c1414fe6ff139e3640f4e2207ae2b3d2153a1abd346f901c26c290ee7cb3881dd922d4ee9232 + languageName: node + linkType: hard + +"@babel/helper-module-imports@npm:^7.28.6": + version: 7.28.6 + resolution: "@babel/helper-module-imports@npm:7.28.6" + dependencies: + "@babel/traverse": "npm:^7.28.6" + "@babel/types": "npm:^7.28.6" + checksum: 10c0/b49d8d8f204d9dbfd5ac70c54e533e5269afb3cea966a9d976722b13e9922cc773a653405f53c89acb247d5aebdae4681d631a3ae3df77ec046b58da76eda2ac + languageName: node + linkType: hard + +"@babel/helper-module-transforms@npm:^7.28.6": + version: 7.28.6 + resolution: "@babel/helper-module-transforms@npm:7.28.6" + dependencies: + "@babel/helper-module-imports": "npm:^7.28.6" + "@babel/helper-validator-identifier": "npm:^7.28.5" + "@babel/traverse": "npm:^7.28.6" + peerDependencies: + "@babel/core": ^7.0.0 + checksum: 10c0/6f03e14fc30b287ce0b839474b5f271e72837d0cafe6b172d759184d998fbee3903a035e81e07c2c596449e504f453463d58baa65b6f40a37ded5bec74620b2b + languageName: node + linkType: hard + +"@babel/helper-plugin-utils@npm:^7.27.1": + version: 7.28.6 + resolution: "@babel/helper-plugin-utils@npm:7.28.6" + checksum: 10c0/3f5f8acc152fdbb69a84b8624145ff4f9b9f6e776cb989f9f968f8606eb7185c5c3cfcf3ba08534e37e1e0e1c118ac67080610333f56baa4f7376c99b5f1143d + languageName: node + linkType: hard + +"@babel/helper-string-parser@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/helper-string-parser@npm:7.27.1" + checksum: 10c0/8bda3448e07b5583727c103560bcf9c4c24b3c1051a4c516d4050ef69df37bb9a4734a585fe12725b8c2763de0a265aa1e909b485a4e3270b7cfd3e4dbe4b602 + languageName: node + linkType: hard + +"@babel/helper-validator-identifier@npm:^7.28.5": + version: 7.28.5 + resolution: "@babel/helper-validator-identifier@npm:7.28.5" + checksum: 10c0/42aaebed91f739a41f3d80b72752d1f95fd7c72394e8e4bd7cdd88817e0774d80a432451bcba17c2c642c257c483bf1d409dd4548883429ea9493a3bc4ab0847 + languageName: node + linkType: hard + +"@babel/helper-validator-option@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/helper-validator-option@npm:7.27.1" + checksum: 10c0/6fec5f006eba40001a20f26b1ef5dbbda377b7b68c8ad518c05baa9af3f396e780bdfded24c4eef95d14bb7b8fd56192a6ed38d5d439b97d10efc5f1a191d148 + languageName: node + linkType: hard + +"@babel/helpers@npm:^7.28.6": + version: 7.29.2 + resolution: "@babel/helpers@npm:7.29.2" + dependencies: + "@babel/template": "npm:^7.28.6" + "@babel/types": "npm:^7.29.0" + checksum: 10c0/dab0e65b9318b2502a62c58bc0913572318595eec0482c31f0ad416b72636e6698a1d7c57cd2791d4528eb8c548bca88d338dc4d2a55a108dc1f6702f9bc5512 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.1.0, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.28.6, @babel/parser@npm:^7.29.0": + version: 7.29.3 + resolution: "@babel/parser@npm:7.29.3" + dependencies: + "@babel/types": "npm:^7.29.0" + bin: + parser: ./bin/babel-parser.js + checksum: 10c0/f06920c819550c0db689e4c5b626bf55ba3cebf80ebe9ccfa434e134036cf3de50951fe759f74abb2dae381989239860bde46d4600328578ad1f7114c3711a6d + languageName: node + linkType: hard + +"@babel/plugin-transform-react-jsx-self@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/plugin-transform-react-jsx-self@npm:7.27.1" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.27.1" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/00a4f917b70a608f9aca2fb39aabe04a60aa33165a7e0105fd44b3a8531630eb85bf5572e9f242f51e6ad2fa38c2e7e780902176c863556c58b5ba6f6e164031 + languageName: node + linkType: hard + +"@babel/plugin-transform-react-jsx-source@npm:^7.27.1": + version: 7.27.1 + resolution: "@babel/plugin-transform-react-jsx-source@npm:7.27.1" + dependencies: + "@babel/helper-plugin-utils": "npm:^7.27.1" + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 10c0/5e67b56c39c4d03e59e03ba80692b24c5a921472079b63af711b1d250fc37c1733a17069b63537f750f3e937ec44a42b1ee6a46cd23b1a0df5163b17f741f7f2 + languageName: node + linkType: hard + +"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.12.13": + version: 7.29.2 + resolution: "@babel/runtime@npm:7.29.2" + checksum: 10c0/30b80a0140d16467792e1bbeb06f655b0dab70407da38dfac7fedae9c859f9ae9d846ef14ad77bd3814c064295fe9b1bc551f1541ea14646ae9f22b71a8bc17a + languageName: node + linkType: hard + +"@babel/template@npm:^7.28.6": + version: 7.28.6 + resolution: "@babel/template@npm:7.28.6" + dependencies: + "@babel/code-frame": "npm:^7.28.6" + "@babel/parser": "npm:^7.28.6" + "@babel/types": "npm:^7.28.6" + checksum: 10c0/66d87225ed0bc77f888181ae2d97845021838c619944877f7c4398c6748bcf611f216dfd6be74d39016af502bca876e6ce6873db3c49e4ac354c56d34d57e9f5 + languageName: node + linkType: hard + +"@babel/traverse@npm:^7.28.6, @babel/traverse@npm:^7.29.0": + version: 7.29.0 + resolution: "@babel/traverse@npm:7.29.0" + dependencies: + "@babel/code-frame": "npm:^7.29.0" + "@babel/generator": "npm:^7.29.0" + "@babel/helper-globals": "npm:^7.28.0" + "@babel/parser": "npm:^7.29.0" + "@babel/template": "npm:^7.28.6" + "@babel/types": "npm:^7.29.0" + debug: "npm:^4.3.1" + checksum: 10c0/f63ef6e58d02a9fbf3c0e2e5f1c877da3e0bc57f91a19d2223d53e356a76859cbaf51171c9211c71816d94a0e69efa2732fd27ffc0e1bbc84b636e60932333eb + languageName: node + linkType: hard + +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.28.2, @babel/types@npm:^7.28.6, @babel/types@npm:^7.29.0": + version: 7.29.0 + resolution: "@babel/types@npm:7.29.0" + dependencies: + "@babel/helper-string-parser": "npm:^7.27.1" + "@babel/helper-validator-identifier": "npm:^7.28.5" + checksum: 10c0/23cc3466e83bcbfab8b9bd0edaafdb5d4efdb88b82b3be6728bbade5ba2f0996f84f63b1c5f7a8c0d67efded28300898a5f930b171bb40b311bca2029c4e9b4f + languageName: node + linkType: hard + +"@capacitor-firebase/authentication@npm:^8.0.0": + version: 8.3.0 + resolution: "@capacitor-firebase/authentication@npm:8.3.0" + peerDependencies: + "@capacitor/core": ">=8.0.0" + firebase: ^12.6.0 + peerDependenciesMeta: + firebase: + optional: true + checksum: 10c0/a52f6ec85d18438ed616c78f29a8cea4a64621d13208a4d79d914344090630ce549f4e2d5d75da94b012e8799b4794e0af8d0e736edd97973b57205b62258ed9 + languageName: node + linkType: hard + +"@capacitor/android@npm:8.3.4": + version: 8.3.4 + resolution: "@capacitor/android@npm:8.3.4" + peerDependencies: + "@capacitor/core": ^8.3.0 + checksum: 10c0/c24c0ad18df8de1ef63bc22392cc8e3934acbff72a7cbd97eb1710f38617cc42728c410cd9e2f74c62d93da09d678ce2dac96a819005343c1c0a8ad8ee629cb1 + languageName: node + linkType: hard + +"@capacitor/app@npm:8.1.0": + version: 8.1.0 + resolution: "@capacitor/app@npm:8.1.0" + peerDependencies: + "@capacitor/core": ">=8.0.0" + checksum: 10c0/670a5bc3f0c1706f9d09ad03873836ac9b56e1ca6c9853e283d43b4ff04c7295b30801d49f563206aadcf882245025be1ecdc12c22c7d479c636b34123e9a0d3 + languageName: node + linkType: hard + +"@capacitor/cli@npm:8.3.4": + version: 8.3.4 + resolution: "@capacitor/cli@npm:8.3.4" + dependencies: + "@ionic/cli-framework-output": "npm:^2.2.8" + "@ionic/utils-subprocess": "npm:^3.0.1" + "@ionic/utils-terminal": "npm:^2.3.5" + commander: "npm:^12.1.0" + debug: "npm:^4.4.0" + env-paths: "npm:^2.2.0" + fs-extra: "npm:^11.2.0" + kleur: "npm:^4.1.5" + native-run: "npm:^2.0.3" + open: "npm:^8.4.0" + plist: "npm:^3.1.0" + prompts: "npm:^2.4.2" + rimraf: "npm:^6.0.1" + semver: "npm:^7.6.3" + tar: "npm:^7.5.3" + tslib: "npm:^2.8.1" + xml2js: "npm:^0.6.2" + bin: + cap: bin/capacitor + capacitor: bin/capacitor + checksum: 10c0/e9f8f4bbd10f1eb4cd80b450cab75c12a78490fed2caa540f5fc7b7ba9cb61e309e0d214bc4b30085f686eda1de4da72ed0ea84902a9129d257deffff65797c7 + languageName: node + linkType: hard + +"@capacitor/core@npm:8.3.4": + version: 8.3.4 + resolution: "@capacitor/core@npm:8.3.4" + dependencies: + tslib: "npm:^2.1.0" + checksum: 10c0/12341743e5d4c532cdfe1f3a145ac0f278f9006a46cd9a31f79c9169cfce6d86b77c60082230975bf265882a84e7dce7a4d5b137a5841a5b86d1b9d230f67995 + languageName: node + linkType: hard + +"@capacitor/google-maps@npm:^8.0.0": + version: 8.0.1 + resolution: "@capacitor/google-maps@npm:8.0.1" + dependencies: + "@googlemaps/js-api-loader": "npm:^2.0.2" + "@googlemaps/markerclusterer": "npm:^2.6.2" + "@types/google.maps": "npm:^3.58.1" + peerDependencies: + "@capacitor/core": ">=8.0.0" + checksum: 10c0/3b947ef116ac2efcc6611cd2b713adc3466e1dca8ea3cdd9e8e73c8d20265d216dc3c2ee62c273305c68f04eecf1190e54016449f9adbf16ce5b48f4519473f1 + languageName: node + linkType: hard + +"@capacitor/haptics@npm:8.0.2": + version: 8.0.2 + resolution: "@capacitor/haptics@npm:8.0.2" + peerDependencies: + "@capacitor/core": ">=8.0.0" + checksum: 10c0/cf6c9c0c6035dc66cf6e483aa513d69a147cafde70d9c3bf8792704322478eb0cc7cee6a4179ebea7c5b6effce85a4753ab10a7f0007375527676bf4e2827c6b + languageName: node + linkType: hard + +"@capacitor/ios@npm:8.3.4": + version: 8.3.4 + resolution: "@capacitor/ios@npm:8.3.4" + peerDependencies: + "@capacitor/core": ^8.3.0 + checksum: 10c0/1725f5d38ef762c0bba6368fcf13be62758e0159041d83e7570b0163e99db6e6be4fab5f2863c32c2bd4d05e1dbea70bbe55def635a07862e850fae35ae83563 + languageName: node + linkType: hard + +"@capacitor/keyboard@npm:8.0.3": + version: 8.0.3 + resolution: "@capacitor/keyboard@npm:8.0.3" + peerDependencies: + "@capacitor/core": ">=8.0.0" + checksum: 10c0/502c7ff5b88367df92ab4c0a51f04d70a6bd2b7ce03ead881035e63286282bc4abfb35d9fe55c8ebed538fe8b665e632050810e89ac6014a70fc98afaf8bbf23 + languageName: node + linkType: hard + +"@capacitor/preferences@npm:^8.0.1": + version: 8.0.1 + resolution: "@capacitor/preferences@npm:8.0.1" + peerDependencies: + "@capacitor/core": ">=8.0.0" + checksum: 10c0/cbed0229a685f484c396fd043354688fdeec69264f322180b62c5adb0322561b288a63eb38ee9b38cf78ea7dbc3b9dc8dd8c2e52b54a7f752a1b2f07bfd29f0d + languageName: node + linkType: hard + +"@capacitor/push-notifications@npm:^8.1.1": + version: 8.1.1 + resolution: "@capacitor/push-notifications@npm:8.1.1" + peerDependencies: + "@capacitor/core": ">=8.0.0" + checksum: 10c0/4641fd997e03385676c12848c9ba3bb36a180450926614efb1769d8e6579c60641365e1018f8d846979c5c411f9152b50be4bac7c2e4d06dbf7c1954c07e181c + languageName: node + linkType: hard + +"@capacitor/status-bar@npm:8.0.2": + version: 8.0.2 + resolution: "@capacitor/status-bar@npm:8.0.2" + peerDependencies: + "@capacitor/core": ">=8.0.0" + checksum: 10c0/2e27cf6629666b9e3078ac26e68a13d211a442b24ce64e40510ca9741666abe72c64c0be05b2645ebfcd297413a2f5238812218649e74b906d11893378a15231 + languageName: node + linkType: hard + +"@esbuild/aix-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/aix-ppc64@npm:0.21.5" + conditions: os=aix & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/android-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm64@npm:0.21.5" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/android-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-arm@npm:0.21.5" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@esbuild/android-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/android-x64@npm:0.21.5" + conditions: os=android & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/darwin-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-arm64@npm:0.21.5" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/darwin-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/darwin-x64@npm:0.21.5" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/freebsd-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-arm64@npm:0.21.5" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/freebsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/freebsd-x64@npm:0.21.5" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/linux-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm64@npm:0.21.5" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/linux-arm@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-arm@npm:0.21.5" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@esbuild/linux-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ia32@npm:0.21.5" + conditions: os=linux & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/linux-loong64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-loong64@npm:0.21.5" + conditions: os=linux & cpu=loong64 + languageName: node + linkType: hard + +"@esbuild/linux-mips64el@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-mips64el@npm:0.21.5" + conditions: os=linux & cpu=mips64el + languageName: node + linkType: hard + +"@esbuild/linux-ppc64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-ppc64@npm:0.21.5" + conditions: os=linux & cpu=ppc64 + languageName: node + linkType: hard + +"@esbuild/linux-riscv64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-riscv64@npm:0.21.5" + conditions: os=linux & cpu=riscv64 + languageName: node + linkType: hard + +"@esbuild/linux-s390x@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-s390x@npm:0.21.5" + conditions: os=linux & cpu=s390x + languageName: node + linkType: hard + +"@esbuild/linux-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/linux-x64@npm:0.21.5" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/netbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/netbsd-x64@npm:0.21.5" + conditions: os=netbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/openbsd-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/openbsd-x64@npm:0.21.5" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/sunos-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/sunos-x64@npm:0.21.5" + conditions: os=sunos & cpu=x64 + languageName: node + linkType: hard + +"@esbuild/win32-arm64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-arm64@npm:0.21.5" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@esbuild/win32-ia32@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-ia32@npm:0.21.5" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@esbuild/win32-x64@npm:0.21.5": + version: 0.21.5 + resolution: "@esbuild/win32-x64@npm:0.21.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@firebase/ai@npm:1.4.1": + version: 1.4.1 + resolution: "@firebase/ai@npm:1.4.1" + dependencies: + "@firebase/app-check-interop-types": "npm:0.3.3" + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + "@firebase/app-types": 0.x + checksum: 10c0/81b0913877438c080e7c22ef2aef207ce4aec921d34a82c0bb58b2cd829612ca2acc726fab389484489374af7b1e0270b7c9d9f98b9dc5c32f658e90b69af6c2 + languageName: node + linkType: hard + +"@firebase/analytics-compat@npm:0.2.23": + version: 0.2.23 + resolution: "@firebase/analytics-compat@npm:0.2.23" + dependencies: + "@firebase/analytics": "npm:0.10.17" + "@firebase/analytics-types": "npm:0.8.3" + "@firebase/component": "npm:0.6.18" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/61ca904bcd8eafe91f2db09c592ff0da911ae1f50f6ec95cc2eefbbe1dd5b537cc8838d3b03ab8dca9e06c42c4092a447dc69c61a1b8a1ffcd0fac1047eac71d + languageName: node + linkType: hard + +"@firebase/analytics-types@npm:0.8.3": + version: 0.8.3 + resolution: "@firebase/analytics-types@npm:0.8.3" + checksum: 10c0/2cbc5fe8425bc01c7ba03579cdc5ca6b23de51b08edb62927be610a33bbc961bae97aa48ee12dcdb039b752c158d095f234ed20f1f4d2bd7a5c39f44d82cdf22 + languageName: node + linkType: hard + +"@firebase/analytics@npm:0.10.17": + version: 0.10.17 + resolution: "@firebase/analytics@npm:0.10.17" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/installations": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/c6669c3d090a52c1e8fa0071f541237b811dbbbf5a4dd497e3ee4175fd2c25e55da272dec5e73801d7ac4688862e1719b391daa445bf1e2dfadc8c2b153ef73b + languageName: node + linkType: hard + +"@firebase/app-check-compat@npm:0.3.26": + version: 0.3.26 + resolution: "@firebase/app-check-compat@npm:0.3.26" + dependencies: + "@firebase/app-check": "npm:0.10.1" + "@firebase/app-check-types": "npm:0.5.3" + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/1ef896356eb6656a836f68bb860dcac0b9af2021a3651e26064d9d936180b3e6d0b8b2adbc834a0353b68cca249ed707e01519a14f9514e1b38fa9c911260c01 + languageName: node + linkType: hard + +"@firebase/app-check-interop-types@npm:0.3.3": + version: 0.3.3 + resolution: "@firebase/app-check-interop-types@npm:0.3.3" + checksum: 10c0/4a887ef5e30ee1a407b569603c433a9f21244d50a19d97a5f1f17d8f5caea83096852b39e67d599f3238f1f7e2a369b02d184a184986a649ed1f8fed12fbd6be + languageName: node + linkType: hard + +"@firebase/app-check-types@npm:0.5.3": + version: 0.5.3 + resolution: "@firebase/app-check-types@npm:0.5.3" + checksum: 10c0/59af0ae698ff2172e84f504e3b5e778c2cc78fefdcceb917eb899a204ad130ad5497011ab94459f6f9dd0a9062a0455bbd745ad3e488b39dae4625c3fb0d0145 + languageName: node + linkType: hard + +"@firebase/app-check@npm:0.10.1": + version: 0.10.1 + resolution: "@firebase/app-check@npm:0.10.1" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/95504658f10b957b6c0080b7d48a7e3352dd23b342c81868bc17242f0812b315ed9db9a022a50f26a1ffd44d6760de5114cd3bf1f5176319a40706cfb2b0b5c9 + languageName: node + linkType: hard + +"@firebase/app-compat@npm:0.4.2": + version: 0.4.2 + resolution: "@firebase/app-compat@npm:0.4.2" + dependencies: + "@firebase/app": "npm:0.13.2" + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + checksum: 10c0/265b9b6a2284feb3a768a4a7506e336521549894f557016a77e05867a0d37daa9a496f275844cc007047b4248c930743cf0e89c874387a8c7888ca6a4aa1ff84 + languageName: node + linkType: hard + +"@firebase/app-types@npm:0.9.3": + version: 0.9.3 + resolution: "@firebase/app-types@npm:0.9.3" + checksum: 10c0/02ec9a26c10b9bbb2a1e5b9ae0552b5325b40066e3c23be089ceae53414a1505f2ab716ae1098652a0a0c9992ba322c05371a9b2a837cccfae309788372a72e0 + languageName: node + linkType: hard + +"@firebase/app@npm:0.13.2": + version: 0.13.2 + resolution: "@firebase/app@npm:0.13.2" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + idb: "npm:7.1.1" + tslib: "npm:^2.1.0" + checksum: 10c0/e6c315aceb8c5c415d536d4468fb8fab468a4e75ab292259256e3a1007293254f7394816637398ebef0c8e9cb192c60392b18d1367219f49bbac8048e34d789d + languageName: node + linkType: hard + +"@firebase/auth-compat@npm:0.5.28": + version: 0.5.28 + resolution: "@firebase/auth-compat@npm:0.5.28" + dependencies: + "@firebase/auth": "npm:1.10.8" + "@firebase/auth-types": "npm:0.13.0" + "@firebase/component": "npm:0.6.18" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/2e22d37054ee5dd2861ec2dea32fe39e7628c49bfd74cdf06f6959b24e94eeb4f7150f26bc35da2b6166f25772c90f241cd403d7ef8ed4ebad4b8c858ef260dd + languageName: node + linkType: hard + +"@firebase/auth-interop-types@npm:0.2.4": + version: 0.2.4 + resolution: "@firebase/auth-interop-types@npm:0.2.4" + checksum: 10c0/ff833bcbb472992c6061847309e338dac736c616522c5fd808526d6dc13b9788458a8c9677d91c33c1288ee38f42896c2b4b8fe10ee74f1569d11f3f3c4f53b5 + languageName: node + linkType: hard + +"@firebase/auth-types@npm:0.13.0": + version: 0.13.0 + resolution: "@firebase/auth-types@npm:0.13.0" + peerDependencies: + "@firebase/app-types": 0.x + "@firebase/util": 1.x + checksum: 10c0/a844c4a083ade9ae946337ec7d7fca8b0a384439be455d6d60d1ba01671c34b2b5162b7b8c1341a699fa70f78948c145c3bbe4723ca444f3b2f17cace40a4fd9 + languageName: node + linkType: hard + +"@firebase/auth@npm:1.10.8": + version: 1.10.8 + resolution: "@firebase/auth@npm:1.10.8" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + "@react-native-async-storage/async-storage": ^1.18.1 + peerDependenciesMeta: + "@react-native-async-storage/async-storage": + optional: true + checksum: 10c0/91cb05a743d61647d4f78a8bc8b31d1ee948d24f049f6a4d76012eb6f004ac1b8754ae85e79f9e0183fa8b8e75a246d3aca6f25d76f106a44b4e5d0983b67f6d + languageName: node + linkType: hard + +"@firebase/component@npm:0.6.18": + version: 0.6.18 + resolution: "@firebase/component@npm:0.6.18" + dependencies: + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + checksum: 10c0/8132696aed9092b9c9274a1191db0f4c93779a23a416427cf2c8bdfb13ce6ccea8f86a4b4e55638f54ee17aab9d8ad7b4068ffc866efb67ff9510da1de179b6b + languageName: node + linkType: hard + +"@firebase/data-connect@npm:0.3.10": + version: 0.3.10 + resolution: "@firebase/data-connect@npm:0.3.10" + dependencies: + "@firebase/auth-interop-types": "npm:0.2.4" + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/fb04aca45fc837daafb9dbe3d573dd86b208e57fed6cfbe8bdc0a41c56dca094ed2e1572bf69641d89a17cb785b945d412b635337170b7d05bee670f77d2b4bf + languageName: node + linkType: hard + +"@firebase/database-compat@npm:2.0.11": + version: 2.0.11 + resolution: "@firebase/database-compat@npm:2.0.11" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/database": "npm:1.0.20" + "@firebase/database-types": "npm:1.0.15" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + checksum: 10c0/908f6f0295505e1b4e112cbf898a518ef74d09a2511f8c451b49c93c7bab58ad707d1ff3e9db2b28a44d87ba06f8137f23f398c7302b89856ab56685d249e6f1 + languageName: node + linkType: hard + +"@firebase/database-types@npm:1.0.15": + version: 1.0.15 + resolution: "@firebase/database-types@npm:1.0.15" + dependencies: + "@firebase/app-types": "npm:0.9.3" + "@firebase/util": "npm:1.12.1" + checksum: 10c0/379e61eb1b7d949c499ea36b5937b496b59b56adb51f3967471bb96f93f29ca870df1bae006a68c59e94cfadc47e19db5a49a52f50338db71a445db9c44e3c78 + languageName: node + linkType: hard + +"@firebase/database@npm:1.0.20": + version: 1.0.20 + resolution: "@firebase/database@npm:1.0.20" + dependencies: + "@firebase/app-check-interop-types": "npm:0.3.3" + "@firebase/auth-interop-types": "npm:0.2.4" + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + faye-websocket: "npm:0.11.4" + tslib: "npm:^2.1.0" + checksum: 10c0/40ef1037b00baae94c6d32c48ca4eb2812c36bfb23cd15fd240cba9450860e73c216420989aef5886f0f0e5facd34a1bd7d2c0dc751a527f2f0a0c6f369d397c + languageName: node + linkType: hard + +"@firebase/firestore-compat@npm:0.3.53": + version: 0.3.53 + resolution: "@firebase/firestore-compat@npm:0.3.53" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/firestore": "npm:4.8.0" + "@firebase/firestore-types": "npm:3.0.3" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/a588fbd28c579a6c1d59225e3fbd6f6ec748a65b2bda4766e12d2b2cb843338568a883e5a170fe23333a7710060a1b714304a69a63b8282514be6fc72bb1c6e1 + languageName: node + linkType: hard + +"@firebase/firestore-types@npm:3.0.3": + version: 3.0.3 + resolution: "@firebase/firestore-types@npm:3.0.3" + peerDependencies: + "@firebase/app-types": 0.x + "@firebase/util": 1.x + checksum: 10c0/8196168a2de68bd60e0a9053a670d14d2917bf8e30829a4a2f8435fa2aceaaf97ce7438cd9525786a9bf8c5d6104ced3086acd792439371fea7b35497a53bdfa + languageName: node + linkType: hard + +"@firebase/firestore@npm:4.8.0": + version: 4.8.0 + resolution: "@firebase/firestore@npm:4.8.0" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + "@firebase/webchannel-wrapper": "npm:1.0.3" + "@grpc/grpc-js": "npm:~1.9.0" + "@grpc/proto-loader": "npm:^0.7.8" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/87e2a16fd432a1e6eeab537bf24ca8f3a5b01268d5ef0a7b4bae72032bdcb009159a6739383ff786087937c773493e67e8614f5835044d264dfc7954b1a6c209 + languageName: node + linkType: hard + +"@firebase/functions-compat@npm:0.3.26": + version: 0.3.26 + resolution: "@firebase/functions-compat@npm:0.3.26" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/functions": "npm:0.12.9" + "@firebase/functions-types": "npm:0.6.3" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/815e657273c4333177163b1e9fd1cc607189dd5be7b0766269d3c796baef800f3c65f61469d60c0214e36c1cc6b3ccfbf5294fca1d95c809f43ac7dea2b26ddf + languageName: node + linkType: hard + +"@firebase/functions-types@npm:0.6.3": + version: 0.6.3 + resolution: "@firebase/functions-types@npm:0.6.3" + checksum: 10c0/aabd7bdd8c479323a419bba9ad275d96cd44229bd2213c87be08a9978af5ff0c1306279229a358c77280ce54fa6f42c91a6fd6c947808b1103174db0261b86e1 + languageName: node + linkType: hard + +"@firebase/functions@npm:0.12.9": + version: 0.12.9 + resolution: "@firebase/functions@npm:0.12.9" + dependencies: + "@firebase/app-check-interop-types": "npm:0.3.3" + "@firebase/auth-interop-types": "npm:0.2.4" + "@firebase/component": "npm:0.6.18" + "@firebase/messaging-interop-types": "npm:0.2.3" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/99666f7500004b4073b8b617edbafe4efec758816f7ae980b9fdd149bf767edb65353c41534ef1e2bb988cd72c08d46e4f64a98b6d1cf961a81009ec81a7e7cd + languageName: node + linkType: hard + +"@firebase/installations-compat@npm:0.2.18": + version: 0.2.18 + resolution: "@firebase/installations-compat@npm:0.2.18" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/installations": "npm:0.6.18" + "@firebase/installations-types": "npm:0.5.3" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/22e1bc4b4da0bdee9881d8bb4c43794f8f5743b87f071afa6d4c30bbe6a2f99786c1864b9054429c8fdc35f68b5f9dbae825164e1c5c3272c2564c7e877836a2 + languageName: node + linkType: hard + +"@firebase/installations-types@npm:0.5.3": + version: 0.5.3 + resolution: "@firebase/installations-types@npm:0.5.3" + peerDependencies: + "@firebase/app-types": 0.x + checksum: 10c0/f8af07a17e9c0cd1738009b880579b57d112f991ac99e4a17f327d89ad9f8f633fd50757bfd97f470edcc62045526dc59432fb7fcb1f76daa3c72c975519af62 + languageName: node + linkType: hard + +"@firebase/installations@npm:0.6.18": + version: 0.6.18 + resolution: "@firebase/installations@npm:0.6.18" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/util": "npm:1.12.1" + idb: "npm:7.1.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/d7fbd65b89f59c57b05e82c3748b17c4fa973661809c0d97f0b57193609da4b0f4926b1bf63d03346330c5d194487c7c5e06433f4bf4987bad2e2ba884799304 + languageName: node + linkType: hard + +"@firebase/logger@npm:0.4.4": + version: 0.4.4 + resolution: "@firebase/logger@npm:0.4.4" + dependencies: + tslib: "npm:^2.1.0" + checksum: 10c0/0493468960c1243bad71ff932fbf89c17870b07cd3cb25b9565661689e52e93948e43cbd423f9903bdd80c40b98c28e4b2d85698e9ef09d4c59e23beb9140bda + languageName: node + linkType: hard + +"@firebase/messaging-compat@npm:0.2.22": + version: 0.2.22 + resolution: "@firebase/messaging-compat@npm:0.2.22" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/messaging": "npm:0.12.22" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/b91cd3faa6c3e8787143e5977821cb8e36e29311bfc8b84c099ecd4f32a70c5d9c6c4a2bec5ea07a8613ddc295facf1976a8bf8be0c886dd8fc1ae33dbb46216 + languageName: node + linkType: hard + +"@firebase/messaging-interop-types@npm:0.2.3": + version: 0.2.3 + resolution: "@firebase/messaging-interop-types@npm:0.2.3" + checksum: 10c0/a6fb8f02db6a93f277cb5bd530934509e49465f775f2b5ed159116d9ce30b6255213781639b98984ff8b424a8fc36a8e5779e0cc3f0cf5e1bdbd41ae938d6c39 + languageName: node + linkType: hard + +"@firebase/messaging@npm:0.12.22": + version: 0.12.22 + resolution: "@firebase/messaging@npm:0.12.22" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/installations": "npm:0.6.18" + "@firebase/messaging-interop-types": "npm:0.2.3" + "@firebase/util": "npm:1.12.1" + idb: "npm:7.1.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/8c9d9c9c6a5cf9c08ca790e3d60e54199e47c957312a9208c70c9b391e02cafef1588635327990f18269a8556fec0d48db6744e0c754ce2622e4f0a55453cd11 + languageName: node + linkType: hard + +"@firebase/performance-compat@npm:0.2.20": + version: 0.2.20 + resolution: "@firebase/performance-compat@npm:0.2.20" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/performance": "npm:0.7.7" + "@firebase/performance-types": "npm:0.2.3" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/bb85d8dfcaee63f30ecd188f8ed04a83c9f0ef0be61479e746dd82c3ef6b8b5f588e492c3022238e19817bb3186aab411b0b941202987213841c9551cf22b5a7 + languageName: node + linkType: hard + +"@firebase/performance-types@npm:0.2.3": + version: 0.2.3 + resolution: "@firebase/performance-types@npm:0.2.3" + checksum: 10c0/971d6bff448481dd5e8ff9d643e14b364ed4d619aca1d8d64105555c7f4566c9c05bca3cd0c027b3f879cccf8c7bc0e31579f7f0d7b8b1de182af804572b2374 + languageName: node + linkType: hard + +"@firebase/performance@npm:0.7.7": + version: 0.7.7 + resolution: "@firebase/performance@npm:0.7.7" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/installations": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + web-vitals: "npm:^4.2.4" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/4c9cf7607ebcbcc2a2a48b2a548bfe1738d1839c75fda37622aff9007e86618a20cde41ca1b81e39414e18fa409ff4c8695854306bb2ec5ba9f52c21bc95acf4 + languageName: node + linkType: hard + +"@firebase/remote-config-compat@npm:0.2.18": + version: 0.2.18 + resolution: "@firebase/remote-config-compat@npm:0.2.18" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/remote-config": "npm:0.6.5" + "@firebase/remote-config-types": "npm:0.4.0" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/e14035320c9ada6f0130440bdfffaf671614452c3743599800f89b5790de30407c88ef10e0b8ae9f38e05738553595d7c80bf792de96427a3f2589f7cd93df8b + languageName: node + linkType: hard + +"@firebase/remote-config-types@npm:0.4.0": + version: 0.4.0 + resolution: "@firebase/remote-config-types@npm:0.4.0" + checksum: 10c0/2b80a82559f8025ec2e16e98b2fc0bebc1aba6ad461895cd5544c7af964bba9faf6e351aeb356dcb28cd7fe75bc9f120f02ccacffa70f44b160a1b27fd00a5d2 + languageName: node + linkType: hard + +"@firebase/remote-config@npm:0.6.5": + version: 0.6.5 + resolution: "@firebase/remote-config@npm:0.6.5" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/installations": "npm:0.6.18" + "@firebase/logger": "npm:0.4.4" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/8f33384205c43ab65d0c725fd5be3fd949970eb755583baba11331192ed95d881928598d2dbc771aecf80f843617367bb4f6b3083107260a213344f1c043714e + languageName: node + linkType: hard + +"@firebase/storage-compat@npm:0.3.24": + version: 0.3.24 + resolution: "@firebase/storage-compat@npm:0.3.24" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/storage": "npm:0.13.14" + "@firebase/storage-types": "npm:0.8.3" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app-compat": 0.x + checksum: 10c0/cfe0ec9ef4bccc96675334e5e89dcf7b150730834e5d188cb06c60d0e91241d5673e32c9779edd2e3f48bb23dc4f7d4bf3e6bbe3f4ec30a09fecabd866afd493 + languageName: node + linkType: hard + +"@firebase/storage-types@npm:0.8.3": + version: 0.8.3 + resolution: "@firebase/storage-types@npm:0.8.3" + peerDependencies: + "@firebase/app-types": 0.x + "@firebase/util": 1.x + checksum: 10c0/4b34edca4fcbf75ba6575b02d823f5f5b0680977488a2e8101116313903d75973623cf4440f1e0f8048158e0804d0f5a7730f15bbe5af4ceb35fae6ff532a696 + languageName: node + linkType: hard + +"@firebase/storage@npm:0.13.14": + version: 0.13.14 + resolution: "@firebase/storage@npm:0.13.14" + dependencies: + "@firebase/component": "npm:0.6.18" + "@firebase/util": "npm:1.12.1" + tslib: "npm:^2.1.0" + peerDependencies: + "@firebase/app": 0.x + checksum: 10c0/e6b40c7057783a390b89e6e52e9994763246777cd74ac1d25be98478a50639feedbac8097683aa288b90eda1cc4f9345dc682b8f416f13cbcf7f7394721194ad + languageName: node + linkType: hard + +"@firebase/util@npm:1.12.1": + version: 1.12.1 + resolution: "@firebase/util@npm:1.12.1" + dependencies: + tslib: "npm:^2.1.0" + checksum: 10c0/1ba735478eb06f718b971a39fc9b91dc1bab8a76e9a63f199be56c31fc0a46a9e062fc86d63c7be65dff791927ab964f0264ef0fb9bf01a4650890c6c6a08c59 + languageName: node + linkType: hard + +"@firebase/webchannel-wrapper@npm:1.0.3": + version: 1.0.3 + resolution: "@firebase/webchannel-wrapper@npm:1.0.3" + checksum: 10c0/faa1e53ea82ab6bda0b9dcc5f525101a301c74d1cffb924269de947a46511a633662dd6ee8ca571470e06642b35a596625228c766f37cc2d657321edfc560d28 + languageName: node + linkType: hard + +"@googlemaps/js-api-loader@npm:^2.0.2": + version: 2.1.1 + resolution: "@googlemaps/js-api-loader@npm:2.1.1" + dependencies: + "@types/google.maps": "npm:^3.53.1" + checksum: 10c0/06cb6eaf686b838be51efd8293010b7bee42e341e9ad41b42a0ee8909cf06cc5711ba6cfdbcd0c62ff05c8ba35d8622c34130e738bc5844011c8bc457d14de64 + languageName: node + linkType: hard + +"@googlemaps/markerclusterer@npm:^2.6.2": + version: 2.6.2 + resolution: "@googlemaps/markerclusterer@npm:2.6.2" + dependencies: + "@types/supercluster": "npm:^7.1.3" + fast-equals: "npm:^5.2.2" + supercluster: "npm:^8.0.1" + checksum: 10c0/bfe4ffef9dc9f635fca93968d71b2019c936b46480e38dbfb885c3bed1589c9a353e428880a018f8fbc50c2cb16257c4822742d2e49f963dd9ff5d7ffe12f9cb + languageName: node + linkType: hard + +"@grpc/grpc-js@npm:~1.9.0": + version: 1.9.16 + resolution: "@grpc/grpc-js@npm:1.9.16" + dependencies: + "@grpc/proto-loader": "npm:^0.7.8" + "@types/node": "npm:>=12.12.47" + checksum: 10c0/dfe2b1a670d650489fe82bb7afc1c0336313b0cde4a102623a1331267cbdeb1bde9409143fb1432db074bc1845b38d96b82a4277bdd99929aa8322cf97d305aa + languageName: node + linkType: hard + +"@grpc/proto-loader@npm:^0.7.8": + version: 0.7.15 + resolution: "@grpc/proto-loader@npm:0.7.15" + dependencies: + lodash.camelcase: "npm:^4.3.0" + long: "npm:^5.0.0" + protobufjs: "npm:^7.2.5" + yargs: "npm:^17.7.2" + bin: + proto-loader-gen-types: build/bin/proto-loader-gen-types.js + checksum: 10c0/514a134a724b56d73d0a202b7e02c84479da21e364547bacb2f4995ebc0d52412a1a21653add9f004ebd146c1e6eb4bcb0b8846fdfe1bfa8a98ed8f3d203da4a + languageName: node + linkType: hard + +"@hookform/resolvers@npm:^3.9.0": + version: 3.10.0 + resolution: "@hookform/resolvers@npm:3.10.0" + peerDependencies: + react-hook-form: ^7.0.0 + checksum: 10c0/7ee44533b4cdc28c4fa2a94894c735411e5a1f830f4a617c580533321a9b901df0cc8c1e2fad81ad8d55154ebc5cb844cf9c116a3148ffae2bc48758c33cbb8e + languageName: node + linkType: hard + +"@ionic/cli-framework-output@npm:^2.2.8": + version: 2.2.8 + resolution: "@ionic/cli-framework-output@npm:2.2.8" + dependencies: + "@ionic/utils-terminal": "npm:2.3.5" + debug: "npm:^4.0.0" + tslib: "npm:^2.0.1" + checksum: 10c0/a7bf9379201225f20dc3fe1ff93d8b811ef6f9437762785ca80d0c26bcb5aa6fe1661e9d8e1a41d6b193036d7c09a97215d6ec36f4692fa6ea860c1aebd5a97f + languageName: node + linkType: hard + +"@ionic/core@npm:8.8.7": + version: 8.8.7 + resolution: "@ionic/core@npm:8.8.7" + dependencies: + "@stencil/core": "npm:4.43.0" + ionicons: "npm:^8.0.13" + tslib: "npm:^2.1.0" + checksum: 10c0/46d442018b1c70ec6182e3b449dddc77c192df1f4da87078ab20f4740ce7eca852929d4987004a60bf5416fadb232a9cf5e492160179092c80b0fb7a252d62bf + languageName: node + linkType: hard + +"@ionic/pwa-elements@npm:^3.0.0": + version: 3.4.0 + resolution: "@ionic/pwa-elements@npm:3.4.0" + checksum: 10c0/4c4f9251d30e7f4551faeefcaa40846618e9567a5c091175b8502e9da931d0411ac8575a8128d9f3edac575d70f36514a29a8a733d7cf0189b91dc646e6e37ba + languageName: node + linkType: hard + +"@ionic/react-router@npm:8.8.7": + version: 8.8.7 + resolution: "@ionic/react-router@npm:8.8.7" + dependencies: + "@ionic/react": "npm:8.8.7" + tslib: "npm:*" + peerDependencies: + react: ">=16.8.6" + react-dom: ">=16.8.6" + react-router: ^5.0.1 + react-router-dom: ^5.0.1 + checksum: 10c0/302d6ad9c0d450cf6466ff18622aa7708af77c1c4a676d2ff39eca6add440fe96d36a157feae146c3da460c32e7799357320b3270740b050ab040a664b9f0ff2 + languageName: node + linkType: hard + +"@ionic/react@npm:8.8.7": + version: 8.8.7 + resolution: "@ionic/react@npm:8.8.7" + dependencies: + "@ionic/core": "npm:8.8.7" + ionicons: "npm:^8.0.13" + tslib: "npm:*" + peerDependencies: + react: ">=16.8.6" + react-dom: ">=16.8.6" + checksum: 10c0/f5b19ca029a56dcf218ae735b53dcafca3325f9faa62e0bf8aa80095fe3e28053b5884fda5eedfd1392b8ab2cec1f4b29baa28b321e1e421f0b5cd42438a2837 + languageName: node + linkType: hard + +"@ionic/utils-array@npm:2.1.6": + version: 2.1.6 + resolution: "@ionic/utils-array@npm:2.1.6" + dependencies: + debug: "npm:^4.0.0" + tslib: "npm:^2.0.1" + checksum: 10c0/07b9a1c77b34e0c4d0e3bd1f638d7f7ede9481e8903328f4d1ecce20a96e92d71faed7f1c7572bcc7099d14f5c26d815c38b15a7c0679d71ee0ab40c3fde3d20 + languageName: node + linkType: hard + +"@ionic/utils-fs@npm:3.1.7, @ionic/utils-fs@npm:^3.1.7": + version: 3.1.7 + resolution: "@ionic/utils-fs@npm:3.1.7" + dependencies: + "@types/fs-extra": "npm:^8.0.0" + debug: "npm:^4.0.0" + fs-extra: "npm:^9.0.0" + tslib: "npm:^2.0.1" + checksum: 10c0/e6d71395530ad7d60ee2a698ed5f3c1fc4df85083808a7847a639fc5dfd3cb701563e1652e7cc80b7915b19a62071138a8a40e47537dc750d1a262bdb43daf6e + languageName: node + linkType: hard + +"@ionic/utils-object@npm:2.1.6": + version: 2.1.6 + resolution: "@ionic/utils-object@npm:2.1.6" + dependencies: + debug: "npm:^4.0.0" + tslib: "npm:^2.0.1" + checksum: 10c0/17b55abb65008d6be72db8cd4d3fffd2fdf103de11b38f48b65c9f6f8fe0501ff19bb7dd972014852b19dce79cf4029d0a905628e041894be10f4d2fd19f601f + languageName: node + linkType: hard + +"@ionic/utils-process@npm:2.1.12": + version: 2.1.12 + resolution: "@ionic/utils-process@npm:2.1.12" + dependencies: + "@ionic/utils-object": "npm:2.1.6" + "@ionic/utils-terminal": "npm:2.3.5" + debug: "npm:^4.0.0" + signal-exit: "npm:^3.0.3" + tree-kill: "npm:^1.2.2" + tslib: "npm:^2.0.1" + checksum: 10c0/0ee9c9810080fcf77dd7bed457f65dd074009d799b7c4efa147f3c53049993d08c73409653bc402fa9c7bf67b691d3c8cce7cd6836db4fdb75334e179ae325fa + languageName: node + linkType: hard + +"@ionic/utils-stream@npm:3.1.7": + version: 3.1.7 + resolution: "@ionic/utils-stream@npm:3.1.7" + dependencies: + debug: "npm:^4.0.0" + tslib: "npm:^2.0.1" + checksum: 10c0/738715334237cbafe4c43f3620ffd6ccbef3a6148958d6d4642dba784acb55223c4c059d7593edddcc72fcab7b5fe7c5c51b74cfd54521dd91ff1a9de7d5d121 + languageName: node + linkType: hard + +"@ionic/utils-subprocess@npm:^3.0.1": + version: 3.0.1 + resolution: "@ionic/utils-subprocess@npm:3.0.1" + dependencies: + "@ionic/utils-array": "npm:2.1.6" + "@ionic/utils-fs": "npm:3.1.7" + "@ionic/utils-process": "npm:2.1.12" + "@ionic/utils-stream": "npm:3.1.7" + "@ionic/utils-terminal": "npm:2.3.5" + cross-spawn: "npm:^7.0.3" + debug: "npm:^4.0.0" + tslib: "npm:^2.0.1" + checksum: 10c0/b4f4b02c3ebd7dcc587c5db077ddade5d938f7693fc7aaba7e5356404f272dac8c9e032adfb496115ab3ca5ec7ec37949ce7925394f4a7574db81f30e3b27eed + languageName: node + linkType: hard + +"@ionic/utils-terminal@npm:2.3.5, @ionic/utils-terminal@npm:^2.3.4, @ionic/utils-terminal@npm:^2.3.5": + version: 2.3.5 + resolution: "@ionic/utils-terminal@npm:2.3.5" + dependencies: + "@types/slice-ansi": "npm:^4.0.0" + debug: "npm:^4.0.0" + signal-exit: "npm:^3.0.3" + slice-ansi: "npm:^4.0.0" + string-width: "npm:^4.1.0" + strip-ansi: "npm:^6.0.0" + tslib: "npm:^2.0.1" + untildify: "npm:^4.0.0" + wrap-ansi: "npm:^7.0.0" + checksum: 10c0/a3fdd68f6913250f49a302e03f4c93c2abafed3064f982c10b69a2e05439df208d09cc25dfec062cbfd741d22ebf5473f72831aeba96e246f8e3d82d6caaa03a + languageName: node + linkType: hard + +"@isaacs/fs-minipass@npm:^4.0.0": + version: 4.0.1 + resolution: "@isaacs/fs-minipass@npm:4.0.1" + dependencies: + minipass: "npm:^7.0.4" + checksum: 10c0/c25b6dc1598790d5b55c0947a9b7d111cfa92594db5296c3b907e2f533c033666f692a3939eadac17b1c7c40d362d0b0635dc874cbfe3e70db7c2b07cc97a5d2 + languageName: node + linkType: hard + +"@jridgewell/gen-mapping@npm:^0.3.12, @jridgewell/gen-mapping@npm:^0.3.5": + version: 0.3.13 + resolution: "@jridgewell/gen-mapping@npm:0.3.13" + dependencies: + "@jridgewell/sourcemap-codec": "npm:^1.5.0" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 10c0/9a7d65fb13bd9aec1fbab74cda08496839b7e2ceb31f5ab922b323e94d7c481ce0fc4fd7e12e2610915ed8af51178bdc61e168e92a8c8b8303b030b03489b13b + languageName: node + linkType: hard + +"@jridgewell/remapping@npm:^2.3.5": + version: 2.3.5 + resolution: "@jridgewell/remapping@npm:2.3.5" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.24" + checksum: 10c0/3de494219ffeb2c5c38711d0d7bb128097edf91893090a2dbc8ee0b55d092bb7347b1fd0f478486c5eab010e855c73927b1666f2107516d472d24a73017d1194 + languageName: node + linkType: hard + +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.2 + resolution: "@jridgewell/resolve-uri@npm:3.1.2" + checksum: 10c0/d502e6fb516b35032331406d4e962c21fe77cdf1cbdb49c6142bcbd9e30507094b18972778a6e27cbad756209cfe34b1a27729e6fa08a2eb92b33943f680cf1e + languageName: node + linkType: hard + +"@jridgewell/source-map@npm:^0.3.3": + version: 0.3.11 + resolution: "@jridgewell/source-map@npm:0.3.11" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + checksum: 10c0/50a4fdafe0b8f655cb2877e59fe81320272eaa4ccdbe6b9b87f10614b2220399ae3e05c16137a59db1f189523b42c7f88bd097ee991dbd7bc0e01113c583e844 + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0": + version: 1.5.5 + resolution: "@jridgewell/sourcemap-codec@npm:1.5.5" + checksum: 10c0/f9e538f302b63c0ebc06eecb1dd9918dd4289ed36147a0ddce35d6ea4d7ebbda243cda7b2213b6a5e1d8087a298d5cf630fb2bd39329cdecb82017023f6081a0 + languageName: node + linkType: hard + +"@jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.28": + version: 0.3.31 + resolution: "@jridgewell/trace-mapping@npm:0.3.31" + dependencies: + "@jridgewell/resolve-uri": "npm:^3.1.0" + "@jridgewell/sourcemap-codec": "npm:^1.4.14" + checksum: 10c0/4b30ec8cd56c5fd9a661f088230af01e0c1a3888d11ffb6b47639700f71225be21d1f7e168048d6d4f9449207b978a235c07c8f15c07705685d16dc06280e9d9 + languageName: node + linkType: hard + +"@protobufjs/aspromise@npm:^1.1.1, @protobufjs/aspromise@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/aspromise@npm:1.1.2" + checksum: 10c0/a83343a468ff5b5ec6bff36fd788a64c839e48a07ff9f4f813564f58caf44d011cd6504ed2147bf34835bd7a7dd2107052af755961c6b098fd8902b4f6500d0f + languageName: node + linkType: hard + +"@protobufjs/base64@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/base64@npm:1.1.2" + checksum: 10c0/eec925e681081af190b8ee231f9bad3101e189abbc182ff279da6b531e7dbd2a56f1f306f37a80b1be9e00aa2d271690d08dcc5f326f71c9eed8546675c8caf6 + languageName: node + linkType: hard + +"@protobufjs/codegen@npm:^2.0.5": + version: 2.0.5 + resolution: "@protobufjs/codegen@npm:2.0.5" + checksum: 10c0/1b8a2ae56ee60a56e9d205cd4b6072a1503c5069b8ebb905710f974ff0098a0d0700641c137e0a8d98dedf14423156a106a9433695cbf52574810f55000fdcab + languageName: node + linkType: hard + +"@protobufjs/eventemitter@npm:^1.1.1": + version: 1.1.1 + resolution: "@protobufjs/eventemitter@npm:1.1.1" + checksum: 10c0/8e06193d4629c5e7c09d4f8c2ddba8fc4dfa739f0149f33a1d901568d35bb7b8b5277a4e8452baf3bdd0b302fd599cf255d193267aa93a0a4747e23cd073c4ac + languageName: node + linkType: hard + +"@protobufjs/fetch@npm:^1.1.1": + version: 1.1.1 + resolution: "@protobufjs/fetch@npm:1.1.1" + dependencies: + "@protobufjs/aspromise": "npm:^1.1.1" + checksum: 10c0/a497ff5433854e8577f0427983ea39b9113b49a8120f94515291d763327061d2c3013e60e24ea436d091dafae01a0f6eb1867e3b1616045d96a31d8b3c646ed4 + languageName: node + linkType: hard + +"@protobufjs/float@npm:^1.0.2": + version: 1.0.2 + resolution: "@protobufjs/float@npm:1.0.2" + checksum: 10c0/18f2bdede76ffcf0170708af15c9c9db6259b771e6b84c51b06df34a9c339dbbeec267d14ce0bddd20acc142b1d980d983d31434398df7f98eb0c94a0eb79069 + languageName: node + linkType: hard + +"@protobufjs/path@npm:^1.1.2": + version: 1.1.2 + resolution: "@protobufjs/path@npm:1.1.2" + checksum: 10c0/cece0a938e7f5dfd2fa03f8c14f2f1cf8b0d6e13ac7326ff4c96ea311effd5fb7ae0bba754fbf505312af2e38500250c90e68506b97c02360a43793d88a0d8b4 + languageName: node + linkType: hard + +"@protobufjs/pool@npm:^1.1.0": + version: 1.1.0 + resolution: "@protobufjs/pool@npm:1.1.0" + checksum: 10c0/eda2718b7f222ac6e6ad36f758a92ef90d26526026a19f4f17f668f45e0306a5bd734def3f48f51f8134ae0978b6262a5c517c08b115a551756d1a3aadfcf038 + languageName: node + linkType: hard + +"@protobufjs/utf8@npm:^1.1.1": + version: 1.1.1 + resolution: "@protobufjs/utf8@npm:1.1.1" + checksum: 10c0/641fc145f00626405e8984b6e90b9edcbcc072ffc82d0647ca3176e09c730b2d022f988e65f011a7a17e2e4d77cde7733643aa10d8ac2bfa30f134dbcad553fd + languageName: node + linkType: hard + +"@rolldown/pluginutils@npm:1.0.0-beta.27": + version: 1.0.0-beta.27 + resolution: "@rolldown/pluginutils@npm:1.0.0-beta.27" + checksum: 10c0/9658f235b345201d4f6bfb1f32da9754ca164f892d1cb68154fe5f53c1df42bd675ecd409836dff46884a7847d6c00bdc38af870f7c81e05bba5c2645eb4ab9c + languageName: node + linkType: hard + +"@rollup/rollup-android-arm-eabi@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.60.4" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@rollup/rollup-android-arm64@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-android-arm64@npm:4.60.4" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-darwin-arm64@npm:4.34.9" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.44.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-arm64@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-darwin-arm64@npm:4.60.4" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-darwin-x64@npm:4.34.9" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.44.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-darwin-x64@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-darwin-x64@npm:4.60.4" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-freebsd-arm64@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-freebsd-arm64@npm:4.60.4" + conditions: os=freebsd & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-freebsd-x64@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-freebsd-x64@npm:4.60.4" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-gnueabihf@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.60.4" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-musleabihf@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.60.4" + conditions: os=linux & cpu=arm & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.34.9" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.44.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-gnu@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.60.4" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.34.9" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.44.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm64-musl@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.60.4" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-loong64-gnu@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.60.4" + conditions: os=linux & cpu=loong64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-loong64-musl@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-loong64-musl@npm:4.60.4" + conditions: os=linux & cpu=loong64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-ppc64-gnu@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.60.4" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-ppc64-musl@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.60.4" + conditions: os=linux & cpu=ppc64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.60.4" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-musl@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.60.4" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-s390x-gnu@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.60.4" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.34.9" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.44.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.60.4" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.34.9" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.44.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-musl@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.60.4" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@rollup/rollup-openbsd-x64@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-openbsd-x64@npm:4.60.4" + conditions: os=openbsd & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-openharmony-arm64@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-openharmony-arm64@npm:4.60.4" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.34.9" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.44.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-arm64-msvc@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.60.4" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-ia32-msvc@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.60.4" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-gnu@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-win32-x64-gnu@npm:4.60.4" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.34.9": + version: 4.34.9 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.34.9" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.44.0": + version: 4.44.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.44.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@rollup/rollup-win32-x64-msvc@npm:4.60.4": + version: 4.60.4 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.60.4" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"@stencil/core@npm:4.43.0": + version: 4.43.0 + resolution: "@stencil/core@npm:4.43.0" + dependencies: + "@rollup/rollup-darwin-arm64": "npm:4.34.9" + "@rollup/rollup-darwin-x64": "npm:4.34.9" + "@rollup/rollup-linux-arm64-gnu": "npm:4.34.9" + "@rollup/rollup-linux-arm64-musl": "npm:4.34.9" + "@rollup/rollup-linux-x64-gnu": "npm:4.34.9" + "@rollup/rollup-linux-x64-musl": "npm:4.34.9" + "@rollup/rollup-win32-arm64-msvc": "npm:4.34.9" + "@rollup/rollup-win32-x64-msvc": "npm:4.34.9" + dependenciesMeta: + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + bin: + stencil: bin/stencil + checksum: 10c0/e267b68a12f992ea4f0c9ca69499551d93f31ed9aa9f49a5c421618cc2e104edf56a50c63cf25f1fa2690d30c3c5f699957ee4e7abdf22abf06f5edbc6102641 + languageName: node + linkType: hard + +"@stencil/core@npm:^4.0.3, @stencil/core@npm:^4.35.3": + version: 4.43.4 + resolution: "@stencil/core@npm:4.43.4" + dependencies: + "@rollup/rollup-darwin-arm64": "npm:4.44.0" + "@rollup/rollup-darwin-x64": "npm:4.44.0" + "@rollup/rollup-linux-arm64-gnu": "npm:4.44.0" + "@rollup/rollup-linux-arm64-musl": "npm:4.44.0" + "@rollup/rollup-linux-x64-gnu": "npm:4.44.0" + "@rollup/rollup-linux-x64-musl": "npm:4.44.0" + "@rollup/rollup-win32-arm64-msvc": "npm:4.44.0" + "@rollup/rollup-win32-x64-msvc": "npm:4.44.0" + dependenciesMeta: + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + bin: + stencil: bin/stencil + checksum: 10c0/02a4ae50986a83110dcf4c5bdfca6013e6952df2678cbc905a9c0eef915a98f6c3e8f2295c3bb72ee2e1bd167ad8f599405296665b15a59516b44b310138c474 + languageName: node + linkType: hard + +"@supabase/auth-js@npm:2.108.2": + version: 2.108.2 + resolution: "@supabase/auth-js@npm:2.108.2" + dependencies: + tslib: "npm:2.8.1" + checksum: 10c0/31617770accb5910c1e7d19f230e3f1e5e1fd3e78912ea5ae342dddb7e032f58fb1d277560eae9a7892ef2d20b03c4989118a9ff17cb48aa5e7dd99eb566fb02 + languageName: node + linkType: hard + +"@supabase/functions-js@npm:2.108.2": + version: 2.108.2 + resolution: "@supabase/functions-js@npm:2.108.2" + dependencies: + tslib: "npm:2.8.1" + checksum: 10c0/06e899cd3445f519f8f595c648b8fa38f174f01335b18cf1ebcc87efc7cede997896e6b06c74747b4275c7b2514accee26d5ee0d4bb2bf5fc757c82070435624 + languageName: node + linkType: hard + +"@supabase/phoenix@npm:^0.4.2": + version: 0.4.4 + resolution: "@supabase/phoenix@npm:0.4.4" + checksum: 10c0/b4ba930c82b20d412358826aa87ce0735147fd168efb817bfc34e31d78605220947dc7c5844726268ac6bf338f0cd081f9908a7bab87aaff4058cb80bf71ab5b + languageName: node + linkType: hard + +"@supabase/postgrest-js@npm:2.108.2": + version: 2.108.2 + resolution: "@supabase/postgrest-js@npm:2.108.2" + dependencies: + tslib: "npm:2.8.1" + checksum: 10c0/eafb794763943f1c72683157785e325647e5cc8eb17904b6922b896b5c25f0be75c11376cb7a518b6f6ee983ad7d94a509e75950533f3da4fcf8f910f1e11433 + languageName: node + linkType: hard + +"@supabase/realtime-js@npm:2.108.2": + version: 2.108.2 + resolution: "@supabase/realtime-js@npm:2.108.2" + dependencies: + "@supabase/phoenix": "npm:^0.4.2" + tslib: "npm:2.8.1" + checksum: 10c0/3a5c19c4283b64cf22e91d264580905de0a724376314acf6a9f9e53ae74ba05bad679eaf57fe5c31e95213608c1bd065485127824bed377500b021d01cec0454 + languageName: node + linkType: hard + +"@supabase/storage-js@npm:2.108.2": + version: 2.108.2 + resolution: "@supabase/storage-js@npm:2.108.2" + dependencies: + iceberg-js: "npm:^0.8.1" + tslib: "npm:2.8.1" + checksum: 10c0/9e7ed4560150012ea8fa45c12b180533f166d6900b4a61e1a2bbf7f12e872ea42f85670db3dc781b7e76f983f5c9d320d84574775969d18804c6a0ca4aa44e7d + languageName: node + linkType: hard + +"@supabase/supabase-js@npm:^2.108.1": + version: 2.108.2 + resolution: "@supabase/supabase-js@npm:2.108.2" + dependencies: + "@supabase/auth-js": "npm:2.108.2" + "@supabase/functions-js": "npm:2.108.2" + "@supabase/postgrest-js": "npm:2.108.2" + "@supabase/realtime-js": "npm:2.108.2" + "@supabase/storage-js": "npm:2.108.2" + checksum: 10c0/1e627189af3d8088329fdbdfbff754285dd757f30d7d4e0415881d75b684143b6c1fe519449b69d4b30b52f732a7f4510566718640826a966e124c8331becbfb + languageName: node + linkType: hard + +"@types/babel__core@npm:^7.20.5": + version: 7.20.5 + resolution: "@types/babel__core@npm:7.20.5" + dependencies: + "@babel/parser": "npm:^7.20.7" + "@babel/types": "npm:^7.20.7" + "@types/babel__generator": "npm:*" + "@types/babel__template": "npm:*" + "@types/babel__traverse": "npm:*" + checksum: 10c0/bdee3bb69951e833a4b811b8ee9356b69a61ed5b7a23e1a081ec9249769117fa83aaaf023bb06562a038eb5845155ff663e2d5c75dd95c1d5ccc91db012868ff + languageName: node + linkType: hard + +"@types/babel__generator@npm:*": + version: 7.27.0 + resolution: "@types/babel__generator@npm:7.27.0" + dependencies: + "@babel/types": "npm:^7.0.0" + checksum: 10c0/9f9e959a8792df208a9d048092fda7e1858bddc95c6314857a8211a99e20e6830bdeb572e3587ae8be5429e37f2a96fcf222a9f53ad232f5537764c9e13a2bbd + languageName: node + linkType: hard + +"@types/babel__template@npm:*": + version: 7.4.4 + resolution: "@types/babel__template@npm:7.4.4" + dependencies: + "@babel/parser": "npm:^7.1.0" + "@babel/types": "npm:^7.0.0" + checksum: 10c0/cc84f6c6ab1eab1427e90dd2b76ccee65ce940b778a9a67be2c8c39e1994e6f5bbc8efa309f6cea8dc6754994524cd4d2896558df76d92e7a1f46ecffee7112b + languageName: node + linkType: hard + +"@types/babel__traverse@npm:*": + version: 7.28.0 + resolution: "@types/babel__traverse@npm:7.28.0" + dependencies: + "@babel/types": "npm:^7.28.2" + checksum: 10c0/b52d7d4e8fc6a9018fe7361c4062c1c190f5778cf2466817cb9ed19d69fbbb54f9a85ffedeb748ed8062d2cf7d4cc088ee739848f47c57740de1c48cbf0d0994 + languageName: node + linkType: hard + +"@types/estree@npm:1.0.8": + version: 1.0.8 + resolution: "@types/estree@npm:1.0.8" + checksum: 10c0/39d34d1afaa338ab9763f37ad6066e3f349444f9052b9676a7cc0252ef9485a41c6d81c9c4e0d26e9077993354edf25efc853f3224dd4b447175ef62bdcc86a5 + languageName: node + linkType: hard + +"@types/fs-extra@npm:^8.0.0": + version: 8.1.5 + resolution: "@types/fs-extra@npm:8.1.5" + dependencies: + "@types/node": "npm:*" + checksum: 10c0/c9f7965bc499a6cc1cadb37a4e9002c0f33810867a0a47a132c4165cbe3b49c6ea52e26c3c38f07720540dd5c470619254c0ef00a2e14a8bf4971ec5d478ba69 + languageName: node + linkType: hard + +"@types/geojson@npm:*": + version: 7946.0.16 + resolution: "@types/geojson@npm:7946.0.16" + checksum: 10c0/1ff24a288bd5860b766b073ead337d31d73bdc715e5b50a2cee5cb0af57a1ed02cc04ef295f5fa68dc40fe3e4f104dd31282b2b818a5ba3231bc1001ba084e3c + languageName: node + linkType: hard + +"@types/google.maps@npm:^3.53.1, @types/google.maps@npm:^3.58.1": + version: 3.65.2 + resolution: "@types/google.maps@npm:3.65.2" + checksum: 10c0/790aed74128385bfa6c8b41c6bf18b8f1901e6c7b7c806615e904e9093703a8238f8b2504027ebe714e95f9cd5b2a94fd63306f8b71907a23ba24673754843ea + languageName: node + linkType: hard + +"@types/history@npm:^4.7.11": + version: 4.7.11 + resolution: "@types/history@npm:4.7.11" + checksum: 10c0/3facf37c2493d1f92b2e93a22cac7ea70b06351c2ab9aaceaa3c56aa6099fb63516f6c4ec1616deb5c56b4093c026a043ea2d3373e6c0644d55710364d02c934 + languageName: node + linkType: hard + +"@types/katex@npm:^0.16.0": + version: 0.16.8 + resolution: "@types/katex@npm:0.16.8" + checksum: 10c0/0661609353f4f5e62bd2dc78da99e842761c6474b19f2268b195bbe9dbf20e6f766a31155d79eec2e7c3eff4e7eba4b30f4f519e9c6a11c75bb45e257a2ddb69 + languageName: node + linkType: hard + +"@types/node@npm:*": + version: 25.9.1 + resolution: "@types/node@npm:25.9.1" + dependencies: + undici-types: "npm:>=7.24.0 <7.24.7" + checksum: 10c0/9a04682842bebbcf21a1779dfeab9aa733d7bd7bbc0a0edb641ab3a9a3d43eac543225acf669c334f458f1956443ebc072bc3c72840c543b8b356cab5c82d456 + languageName: node + linkType: hard + +"@types/node@npm:>=12.12.47, @types/node@npm:>=13.7.0": + version: 26.0.0 + resolution: "@types/node@npm:26.0.0" + dependencies: + undici-types: "npm:~8.3.0" + checksum: 10c0/f36e21634fd8e8ded162ca486508bd8bb229d398a8d5541f6d8c1255968d4464e53327a77f403b216ef98e3b6f6956882eef83e4857d4bc2be9569dd55d37aae + languageName: node + linkType: hard + +"@types/react-dom@npm:^19.0.0": + version: 19.2.3 + resolution: "@types/react-dom@npm:19.2.3" + peerDependencies: + "@types/react": ^19.2.0 + checksum: 10c0/b486ebe0f4e2fb35e2e108df1d8fc0927ca5d6002d5771e8a739de11239fe62d0e207c50886185253c99eb9dedfeeb956ea7429e5ba17f6693c7acb4c02f8cd1 + languageName: node + linkType: hard + +"@types/react-router-dom@npm:^5.3.3": + version: 5.3.3 + resolution: "@types/react-router-dom@npm:5.3.3" + dependencies: + "@types/history": "npm:^4.7.11" + "@types/react": "npm:*" + "@types/react-router": "npm:*" + checksum: 10c0/a9231a16afb9ed5142678147eafec9d48582809295754fb60946e29fcd3757a4c7a3180fa94b45763e4c7f6e3f02379e2fcb8dd986db479dcab40eff5fc62a91 + languageName: node + linkType: hard + +"@types/react-router@npm:*, @types/react-router@npm:^5.1.20": + version: 5.1.20 + resolution: "@types/react-router@npm:5.1.20" + dependencies: + "@types/history": "npm:^4.7.11" + "@types/react": "npm:*" + checksum: 10c0/1f7eee61981d2f807fa01a34a0ef98ebc0774023832b6611a69c7f28fdff01de5a38cabf399f32e376bf8099dcb7afaf724775bea9d38870224492bea4cb5737 + languageName: node + linkType: hard + +"@types/react@npm:*, @types/react@npm:^19.0.0": + version: 19.2.15 + resolution: "@types/react@npm:19.2.15" + dependencies: + csstype: "npm:^3.2.2" + checksum: 10c0/b554eab715bb14e581f0ae60e5cefe91e1a5e06c31022b543a9806cf224aa056f21e4fb46208e46eb934d86ca0b247ebc82377192a0dead303cb28b8764c6e67 + languageName: node + linkType: hard + +"@types/slice-ansi@npm:^4.0.0": + version: 4.0.0 + resolution: "@types/slice-ansi@npm:4.0.0" + checksum: 10c0/5ea517c6739652029ac13810fe8b3b360e7cca4b2fcf99fc879964c2a4f12f8e6b559dacda5b9f016415f0c14017fd9e2b614ecfe0eb056d68e16b3a04cc48bf + languageName: node + linkType: hard + +"@types/supercluster@npm:^7.1.3": + version: 7.1.3 + resolution: "@types/supercluster@npm:7.1.3" + dependencies: + "@types/geojson": "npm:*" + checksum: 10c0/0d55dad98df0990fc38a7bb64dc23dda46014187c0d7638e6f2b6717ba8931b13e5b1d394789833a2ac822014c977ef64623dffd81a0bbf39e52c53c8183741f + languageName: node + linkType: hard + +"@vitejs/plugin-react@npm:^4.0.1": + version: 4.7.0 + resolution: "@vitejs/plugin-react@npm:4.7.0" + dependencies: + "@babel/core": "npm:^7.28.0" + "@babel/plugin-transform-react-jsx-self": "npm:^7.27.1" + "@babel/plugin-transform-react-jsx-source": "npm:^7.27.1" + "@rolldown/pluginutils": "npm:1.0.0-beta.27" + "@types/babel__core": "npm:^7.20.5" + react-refresh: "npm:^0.17.0" + peerDependencies: + vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 + checksum: 10c0/692f23960972879485d647713663ec299c478222c96567d60285acf7c7dc5c178e71abfe9d2eefddef1eeb01514dacbc2ed68aad84628debf9c7116134734253 + languageName: node + linkType: hard + +"@xmldom/xmldom@npm:^0.9.10": + version: 0.9.10 + resolution: "@xmldom/xmldom@npm:0.9.10" + checksum: 10c0/38a9c9b95450d7fccebc61371c8e0b90ceaae992886484108333d29ccbd2640e3555b6af012f15ce1beb5067aeb40486659b6183fad38af179e82d28028bfc5d + languageName: node + linkType: hard + +"abbrev@npm:^4.0.0": + version: 4.0.0 + resolution: "abbrev@npm:4.0.0" + checksum: 10c0/b4cc16935235e80702fc90192e349e32f8ef0ed151ef506aa78c81a7c455ec18375c4125414b99f84b2e055199d66383e787675f0bcd87da7a4dbd59f9eac1d5 + languageName: node + linkType: hard + +"acorn@npm:^8.15.0": + version: 8.16.0 + resolution: "acorn@npm:8.16.0" + bin: + acorn: bin/acorn + checksum: 10c0/c9c52697227661b68d0debaf972222d4f622aa06b185824164e153438afa7b08273432ca43ea792cadb24dada1d46f6f6bb1ef8de9956979288cc1b96bf9914e + languageName: node + linkType: hard + +"ansi-regex@npm:^5.0.1": + version: 5.0.1 + resolution: "ansi-regex@npm:5.0.1" + checksum: 10c0/9a64bb8627b434ba9327b60c027742e5d17ac69277960d041898596271d992d4d52ba7267a63ca10232e29f6107fc8a835f6ce8d719b88c5f8493f8254813737 + languageName: node + linkType: hard + +"ansi-styles@npm:^4.0.0": + version: 4.3.0 + resolution: "ansi-styles@npm:4.3.0" + dependencies: + color-convert: "npm:^2.0.1" + checksum: 10c0/895a23929da416f2bd3de7e9cb4eabd340949328ab85ddd6e484a637d8f6820d485f53933446f5291c3b760cbc488beb8e88573dd0f9c7daf83dccc8fe81b041 + languageName: node + linkType: hard + +"app@workspace:.": + version: 0.0.0-use.local + resolution: "app@workspace:." + dependencies: + "@capacitor-firebase/authentication": "npm:^8.0.0" + "@capacitor/android": "npm:8.3.4" + "@capacitor/app": "npm:8.1.0" + "@capacitor/cli": "npm:8.3.4" + "@capacitor/core": "npm:8.3.4" + "@capacitor/google-maps": "npm:^8.0.0" + "@capacitor/haptics": "npm:8.0.2" + "@capacitor/ios": "npm:8.3.4" + "@capacitor/keyboard": "npm:8.0.3" + "@capacitor/preferences": "npm:^8.0.1" + "@capacitor/push-notifications": "npm:^8.1.1" + "@capacitor/status-bar": "npm:8.0.2" + "@hookform/resolvers": "npm:^3.9.0" + "@ionic/pwa-elements": "npm:^3.0.0" + "@ionic/react": "npm:8.8.7" + "@ionic/react-router": "npm:8.8.7" + "@supabase/supabase-js": "npm:^2.108.1" + "@types/katex": "npm:^0.16.0" + "@types/react": "npm:^19.0.0" + "@types/react-dom": "npm:^19.0.0" + "@types/react-router": "npm:^5.1.20" + "@types/react-router-dom": "npm:^5.3.3" + "@vitejs/plugin-react": "npm:^4.0.1" + firebase: "npm:^11.0.0" + ionicons: "npm:^7.4.0" + katex: "npm:^0.16.0" + qrcode.react: "npm:^4.2.0" + react: "npm:18.2.0" + react-dom: "npm:18.2.0" + react-hook-form: "npm:^7.54.0" + react-katex: "npm:^3.0.1" + react-router: "npm:^5.3.4" + react-router-dom: "npm:^5.3.4" + terser: "npm:^5.4.0" + typescript: "npm:~5.9.0" + vite: "npm:^5.0.0" + zod: "npm:^3.24.0" + zustand: "npm:^5.0.0" + languageName: unknown + linkType: soft + +"astral-regex@npm:^2.0.0": + version: 2.0.0 + resolution: "astral-regex@npm:2.0.0" + checksum: 10c0/f63d439cc383db1b9c5c6080d1e240bd14dae745f15d11ec5da863e182bbeca70df6c8191cffef5deba0b566ef98834610a68be79ac6379c95eeb26e1b310e25 + languageName: node + linkType: hard + +"at-least-node@npm:^1.0.0": + version: 1.0.0 + resolution: "at-least-node@npm:1.0.0" + checksum: 10c0/4c058baf6df1bc5a1697cf182e2029c58cd99975288a13f9e70068ef5d6f4e1f1fd7c4d2c3c4912eae44797d1725be9700995736deca441b39f3e66d8dee97ef + languageName: node + linkType: hard + +"balanced-match@npm:^4.0.2": + version: 4.0.4 + resolution: "balanced-match@npm:4.0.4" + checksum: 10c0/07e86102a3eb2ee2a6a1a89164f29d0dbaebd28f2ca3f5ca786f36b8b23d9e417eb3be45a4acf754f837be5ac0a2317de90d3fcb7f4f4dc95720a1f36b26a17b + languageName: node + linkType: hard + +"base64-js@npm:^1.5.1": + version: 1.5.1 + resolution: "base64-js@npm:1.5.1" + checksum: 10c0/f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf + languageName: node + linkType: hard + +"baseline-browser-mapping@npm:^2.10.12": + version: 2.10.31 + resolution: "baseline-browser-mapping@npm:2.10.31" + bin: + baseline-browser-mapping: dist/cli.cjs + checksum: 10c0/ecb6a10b4bb62d8660e3a4c525acdae2b1c7f68e4ec1e03f473b2050781b7131fbd562a200489ae987d11eb8ae85ec95d3ac77d9d84b4afe6548dfdfdceb6734 + languageName: node + linkType: hard + +"big-integer@npm:1.6.x": + version: 1.6.52 + resolution: "big-integer@npm:1.6.52" + checksum: 10c0/9604224b4c2ab3c43c075d92da15863077a9f59e5d4205f4e7e76acd0cd47e8d469ec5e5dba8d9b32aa233951893b29329ca56ac80c20ce094b4a647a66abae0 + languageName: node + linkType: hard + +"bplist-parser@npm:^0.3.2": + version: 0.3.2 + resolution: "bplist-parser@npm:0.3.2" + dependencies: + big-integer: "npm:1.6.x" + checksum: 10c0/4dc307c11d2511a01255e87e370d4ab6f1962b35fdc27605fd4ce9a557a259c2dc9f87822617ddb1f7aa062a71e30ef20d6103329ac7ce235628f637fb0ed763 + languageName: node + linkType: hard + +"brace-expansion@npm:^5.0.5": + version: 5.0.6 + resolution: "brace-expansion@npm:5.0.6" + dependencies: + balanced-match: "npm:^4.0.2" + checksum: 10c0/8c919869b90f61d533b341d3340be5ee4413232ea89b8246cbc2f38eb014f1d8182785c98a006eaf6111d02dc9eeffefdc240d5ac158625b2ed084dccd4bbf9b + languageName: node + linkType: hard + +"browserslist@npm:^4.24.0": + version: 4.28.2 + resolution: "browserslist@npm:4.28.2" + dependencies: + baseline-browser-mapping: "npm:^2.10.12" + caniuse-lite: "npm:^1.0.30001782" + electron-to-chromium: "npm:^1.5.328" + node-releases: "npm:^2.0.36" + update-browserslist-db: "npm:^1.2.3" + bin: + browserslist: cli.js + checksum: 10c0/c0228b6330f785b7fa59d2d360124ec6d9322f96ed9f3ee1f873e33ecc9503a6f0ffc3b71191a28c4ff6e930b753b30043da1c33844a9548f3018d491f09ce60 + languageName: node + linkType: hard + +"buffer-crc32@npm:~0.2.3": + version: 0.2.13 + resolution: "buffer-crc32@npm:0.2.13" + checksum: 10c0/cb0a8ddf5cf4f766466db63279e47761eb825693eeba6a5a95ee4ec8cb8f81ede70aa7f9d8aeec083e781d47154290eb5d4d26b3f7a465ec57fb9e7d59c47150 + languageName: node + linkType: hard + +"buffer-from@npm:^1.0.0": + version: 1.1.2 + resolution: "buffer-from@npm:1.1.2" + checksum: 10c0/124fff9d66d691a86d3b062eff4663fe437a9d9ee4b47b1b9e97f5a5d14f6d5399345db80f796827be7c95e70a8e765dd404b7c3ff3b3324f98e9b0c8826cc34 + languageName: node + linkType: hard + +"caniuse-lite@npm:^1.0.30001782": + version: 1.0.30001793 + resolution: "caniuse-lite@npm:1.0.30001793" + checksum: 10c0/bee8f8b55d1ccdb2076b7355c06fd01916952eadd76b828e4d5fb9ac62d17ec7db0e2b7c326b923478b93526ad1ff74f189cf40c06de0e4a5edbc677009b97fe + languageName: node + linkType: hard + +"chownr@npm:^3.0.0": + version: 3.0.0 + resolution: "chownr@npm:3.0.0" + checksum: 10c0/43925b87700f7e3893296c8e9c56cc58f926411cce3a6e5898136daaf08f08b9a8eb76d37d3267e707d0dcc17aed2e2ebdf5848c0c3ce95cf910a919935c1b10 + languageName: node + linkType: hard + +"cliui@npm:^8.0.1": + version: 8.0.1 + resolution: "cliui@npm:8.0.1" + dependencies: + string-width: "npm:^4.2.0" + strip-ansi: "npm:^6.0.1" + wrap-ansi: "npm:^7.0.0" + checksum: 10c0/4bda0f09c340cbb6dfdc1ed508b3ca080f12992c18d68c6be4d9cf51756033d5266e61ec57529e610dacbf4da1c634423b0c1b11037709cc6b09045cbd815df5 + languageName: node + linkType: hard + +"color-convert@npm:^2.0.1": + version: 2.0.1 + resolution: "color-convert@npm:2.0.1" + dependencies: + color-name: "npm:~1.1.4" + checksum: 10c0/37e1150172f2e311fe1b2df62c6293a342ee7380da7b9cfdba67ea539909afbd74da27033208d01d6d5cfc65ee7868a22e18d7e7648e004425441c0f8a15a7d7 + languageName: node + linkType: hard + +"color-name@npm:~1.1.4": + version: 1.1.4 + resolution: "color-name@npm:1.1.4" + checksum: 10c0/a1a3f914156960902f46f7f56bc62effc6c94e84b2cae157a526b1c1f74b677a47ec602bf68a61abfa2b42d15b7c5651c6dbe72a43af720bc588dff885b10f95 + languageName: node + linkType: hard + +"commander@npm:^12.1.0": + version: 12.1.0 + resolution: "commander@npm:12.1.0" + checksum: 10c0/6e1996680c083b3b897bfc1cfe1c58dfbcd9842fd43e1aaf8a795fbc237f65efcc860a3ef457b318e73f29a4f4a28f6403c3d653d021d960e4632dd45bde54a9 + languageName: node + linkType: hard + +"commander@npm:^2.20.0": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: 10c0/74c781a5248c2402a0a3e966a0a2bba3c054aad144f5c023364be83265e796b20565aa9feff624132ff629aa64e16999fa40a743c10c12f7c61e96a794b99288 + languageName: node + linkType: hard + +"commander@npm:^8.3.0": + version: 8.3.0 + resolution: "commander@npm:8.3.0" + checksum: 10c0/8b043bb8322ea1c39664a1598a95e0495bfe4ca2fad0d84a92d7d1d8d213e2a155b441d2470c8e08de7c4a28cf2bc6e169211c49e1b21d9f7edc6ae4d9356060 + languageName: node + linkType: hard + +"convert-source-map@npm:^2.0.0": + version: 2.0.0 + resolution: "convert-source-map@npm:2.0.0" + checksum: 10c0/8f2f7a27a1a011cc6cc88cc4da2d7d0cfa5ee0369508baae3d98c260bb3ac520691464e5bbe4ae7cdf09860c1d69ecc6f70c63c6e7c7f7e3f18ec08484dc7d9b + languageName: node + linkType: hard + +"cross-spawn@npm:^7.0.3": + version: 7.0.6 + resolution: "cross-spawn@npm:7.0.6" + dependencies: + path-key: "npm:^3.1.0" + shebang-command: "npm:^2.0.0" + which: "npm:^2.0.1" + checksum: 10c0/053ea8b2135caff68a9e81470e845613e374e7309a47731e81639de3eaeb90c3d01af0e0b44d2ab9d50b43467223b88567dfeb3262db942dc063b9976718ffc1 + languageName: node + linkType: hard + +"csstype@npm:^3.2.2": + version: 3.2.3 + resolution: "csstype@npm:3.2.3" + checksum: 10c0/cd29c51e70fa822f1cecd8641a1445bed7063697469d35633b516e60fe8c1bde04b08f6c5b6022136bb669b64c63d4173af54864510fbb4ee23281801841a3ce + languageName: node + linkType: hard + +"debug@npm:^4.0.0, debug@npm:^4.1.0, debug@npm:^4.3.1, debug@npm:^4.3.4, debug@npm:^4.4.0": + version: 4.4.3 + resolution: "debug@npm:4.4.3" + dependencies: + ms: "npm:^2.1.3" + peerDependenciesMeta: + supports-color: + optional: true + checksum: 10c0/d79136ec6c83ecbefd0f6a5593da6a9c91ec4d7ddc4b54c883d6e71ec9accb5f67a1a5e96d00a328196b5b5c86d365e98d8a3a70856aaf16b4e7b1985e67f5a6 + languageName: node + linkType: hard + +"define-lazy-prop@npm:^2.0.0": + version: 2.0.0 + resolution: "define-lazy-prop@npm:2.0.0" + checksum: 10c0/db6c63864a9d3b7dc9def55d52764968a5af296de87c1b2cc71d8be8142e445208071953649e0386a8cc37cfcf9a2067a47207f1eb9ff250c2a269658fdae422 + languageName: node + linkType: hard + +"electron-to-chromium@npm:^1.5.328": + version: 1.5.360 + resolution: "electron-to-chromium@npm:1.5.360" + checksum: 10c0/2f5936e5f3c1483c7fb2f741b109ef7eb4e1761b0fc944bf2898b0835aae235c7b257790edde4679ad780fbcb8be8734caa720a4644526110c77f7216b678233 + languageName: node + linkType: hard + +"elementtree@npm:^0.1.7": + version: 0.1.7 + resolution: "elementtree@npm:0.1.7" + dependencies: + sax: "npm:1.1.4" + checksum: 10c0/669e56d5092382ceaaa2022f3c391b0f6702e47876095b0e00a790181b7f6b5f49fe6e67ebe8339fd6b1b1b66ffe53c87dd47f1e550661ea55722279bf24cad3 + languageName: node + linkType: hard + +"emoji-regex@npm:^8.0.0": + version: 8.0.0 + resolution: "emoji-regex@npm:8.0.0" + checksum: 10c0/b6053ad39951c4cf338f9092d7bfba448cdfd46fe6a2a034700b149ac9ffbc137e361cbd3c442297f86bed2e5f7576c1b54cc0a6bf8ef5106cc62f496af35010 + languageName: node + linkType: hard + +"env-paths@npm:^2.2.0": + version: 2.2.1 + resolution: "env-paths@npm:2.2.1" + checksum: 10c0/285325677bf00e30845e330eec32894f5105529db97496ee3f598478e50f008c5352a41a30e5e72ec9de8a542b5a570b85699cd63bd2bc646dbcb9f311d83bc4 + languageName: node + linkType: hard + +"esbuild@npm:^0.21.3": + version: 0.21.5 + resolution: "esbuild@npm:0.21.5" + dependencies: + "@esbuild/aix-ppc64": "npm:0.21.5" + "@esbuild/android-arm": "npm:0.21.5" + "@esbuild/android-arm64": "npm:0.21.5" + "@esbuild/android-x64": "npm:0.21.5" + "@esbuild/darwin-arm64": "npm:0.21.5" + "@esbuild/darwin-x64": "npm:0.21.5" + "@esbuild/freebsd-arm64": "npm:0.21.5" + "@esbuild/freebsd-x64": "npm:0.21.5" + "@esbuild/linux-arm": "npm:0.21.5" + "@esbuild/linux-arm64": "npm:0.21.5" + "@esbuild/linux-ia32": "npm:0.21.5" + "@esbuild/linux-loong64": "npm:0.21.5" + "@esbuild/linux-mips64el": "npm:0.21.5" + "@esbuild/linux-ppc64": "npm:0.21.5" + "@esbuild/linux-riscv64": "npm:0.21.5" + "@esbuild/linux-s390x": "npm:0.21.5" + "@esbuild/linux-x64": "npm:0.21.5" + "@esbuild/netbsd-x64": "npm:0.21.5" + "@esbuild/openbsd-x64": "npm:0.21.5" + "@esbuild/sunos-x64": "npm:0.21.5" + "@esbuild/win32-arm64": "npm:0.21.5" + "@esbuild/win32-ia32": "npm:0.21.5" + "@esbuild/win32-x64": "npm:0.21.5" + dependenciesMeta: + "@esbuild/aix-ppc64": + optional: true + "@esbuild/android-arm": + optional: true + "@esbuild/android-arm64": + optional: true + "@esbuild/android-x64": + optional: true + "@esbuild/darwin-arm64": + optional: true + "@esbuild/darwin-x64": + optional: true + "@esbuild/freebsd-arm64": + optional: true + "@esbuild/freebsd-x64": + optional: true + "@esbuild/linux-arm": + optional: true + "@esbuild/linux-arm64": + optional: true + "@esbuild/linux-ia32": + optional: true + "@esbuild/linux-loong64": + optional: true + "@esbuild/linux-mips64el": + optional: true + "@esbuild/linux-ppc64": + optional: true + "@esbuild/linux-riscv64": + optional: true + "@esbuild/linux-s390x": + optional: true + "@esbuild/linux-x64": + optional: true + "@esbuild/netbsd-x64": + optional: true + "@esbuild/openbsd-x64": + optional: true + "@esbuild/sunos-x64": + optional: true + "@esbuild/win32-arm64": + optional: true + "@esbuild/win32-ia32": + optional: true + "@esbuild/win32-x64": + optional: true + bin: + esbuild: bin/esbuild + checksum: 10c0/fa08508adf683c3f399e8a014a6382a6b65542213431e26206c0720e536b31c09b50798747c2a105a4bbba1d9767b8d3615a74c2f7bf1ddf6d836cd11eb672de + languageName: node + linkType: hard + +"escalade@npm:^3.1.1, escalade@npm:^3.2.0": + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 10c0/ced4dd3a78e15897ed3be74e635110bbf3b08877b0a41be50dcb325ee0e0b5f65fc2d50e9845194d7c4633f327e2e1c6cce00a71b617c5673df0374201d67f65 + languageName: node + linkType: hard + +"exponential-backoff@npm:^3.1.1": + version: 3.1.3 + resolution: "exponential-backoff@npm:3.1.3" + checksum: 10c0/77e3ae682b7b1f4972f563c6dbcd2b0d54ac679e62d5d32f3e5085feba20483cf28bd505543f520e287a56d4d55a28d7874299941faf637e779a1aa5994d1267 + languageName: node + linkType: hard + +"fast-equals@npm:^5.2.2": + version: 5.4.0 + resolution: "fast-equals@npm:5.4.0" + checksum: 10c0/4fdce3a8f814e78af7296ca4ebe82f4765074a6dfe557ee98c18f5d2958c3de59025fbff7556d65f250165ccef424d37f9952ee159400f8ebe5f2edb704ec80e + languageName: node + linkType: hard + +"faye-websocket@npm:0.11.4": + version: 0.11.4 + resolution: "faye-websocket@npm:0.11.4" + dependencies: + websocket-driver: "npm:>=0.5.1" + checksum: 10c0/c6052a0bb322778ce9f89af92890f6f4ce00d5ec92418a35e5f4c6864a4fe736fec0bcebd47eac7c0f0e979b01530746b1c85c83cb04bae789271abf19737420 + languageName: node + linkType: hard + +"fd-slicer@npm:~1.1.0": + version: 1.1.0 + resolution: "fd-slicer@npm:1.1.0" + dependencies: + pend: "npm:~1.2.0" + checksum: 10c0/304dd70270298e3ffe3bcc05e6f7ade2511acc278bc52d025f8918b48b6aa3b77f10361bddfadfe2a28163f7af7adbdce96f4d22c31b2f648ba2901f0c5fc20e + languageName: node + linkType: hard + +"fdir@npm:^6.5.0": + version: 6.5.0 + resolution: "fdir@npm:6.5.0" + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + checksum: 10c0/e345083c4306b3aed6cb8ec551e26c36bab5c511e99ea4576a16750ddc8d3240e63826cc624f5ae17ad4dc82e68a253213b60d556c11bfad064b7607847ed07f + languageName: node + linkType: hard + +"firebase@npm:^11.0.0": + version: 11.10.0 + resolution: "firebase@npm:11.10.0" + dependencies: + "@firebase/ai": "npm:1.4.1" + "@firebase/analytics": "npm:0.10.17" + "@firebase/analytics-compat": "npm:0.2.23" + "@firebase/app": "npm:0.13.2" + "@firebase/app-check": "npm:0.10.1" + "@firebase/app-check-compat": "npm:0.3.26" + "@firebase/app-compat": "npm:0.4.2" + "@firebase/app-types": "npm:0.9.3" + "@firebase/auth": "npm:1.10.8" + "@firebase/auth-compat": "npm:0.5.28" + "@firebase/data-connect": "npm:0.3.10" + "@firebase/database": "npm:1.0.20" + "@firebase/database-compat": "npm:2.0.11" + "@firebase/firestore": "npm:4.8.0" + "@firebase/firestore-compat": "npm:0.3.53" + "@firebase/functions": "npm:0.12.9" + "@firebase/functions-compat": "npm:0.3.26" + "@firebase/installations": "npm:0.6.18" + "@firebase/installations-compat": "npm:0.2.18" + "@firebase/messaging": "npm:0.12.22" + "@firebase/messaging-compat": "npm:0.2.22" + "@firebase/performance": "npm:0.7.7" + "@firebase/performance-compat": "npm:0.2.20" + "@firebase/remote-config": "npm:0.6.5" + "@firebase/remote-config-compat": "npm:0.2.18" + "@firebase/storage": "npm:0.13.14" + "@firebase/storage-compat": "npm:0.3.24" + "@firebase/util": "npm:1.12.1" + checksum: 10c0/4a24f5e6e3b557aa0ded1ca208135ef8e733adef7df2c69f9be264203f82a1260e05fe7b9ff508852a9c50c1069b560004dd59dd375f30ae5e41035403777675 + languageName: node + linkType: hard + +"fs-extra@npm:^11.2.0": + version: 11.3.5 + resolution: "fs-extra@npm:11.3.5" + dependencies: + graceful-fs: "npm:^4.2.0" + jsonfile: "npm:^6.0.1" + universalify: "npm:^2.0.0" + checksum: 10c0/33e80bad6b5d17308faa197e5ede99ecba4b6f6cb4aa4645d52745476c75afc57665bdf39ec75b2ebb38b97b7110f634a8dcc0a546e248eb4de059275cf5ac90 + languageName: node + linkType: hard + +"fs-extra@npm:^9.0.0": + version: 9.1.0 + resolution: "fs-extra@npm:9.1.0" + dependencies: + at-least-node: "npm:^1.0.0" + graceful-fs: "npm:^4.2.0" + jsonfile: "npm:^6.0.1" + universalify: "npm:^2.0.0" + checksum: 10c0/9b808bd884beff5cb940773018179a6b94a966381d005479f00adda6b44e5e3d4abf765135773d849cc27efe68c349e4a7b86acd7d3306d5932c14f3a4b17a92 + languageName: node + linkType: hard + +"fsevents@npm:~2.3.2, fsevents@npm:~2.3.3": + version: 2.3.3 + resolution: "fsevents@npm:2.3.3" + dependencies: + node-gyp: "npm:latest" + checksum: 10c0/a1f0c44595123ed717febbc478aa952e47adfc28e2092be66b8ab1635147254ca6cfe1df792a8997f22716d4cbafc73309899ff7bfac2ac3ad8cf2e4ecc3ec60 + conditions: os=darwin + languageName: node + linkType: hard + +"fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.3#optional!builtin": + version: 2.3.3 + resolution: "fsevents@patch:fsevents@npm%3A2.3.3#optional!builtin::version=2.3.3&hash=df0bf1" + dependencies: + node-gyp: "npm:latest" + conditions: os=darwin + languageName: node + linkType: hard + +"gensync@npm:^1.0.0-beta.2": + version: 1.0.0-beta.2 + resolution: "gensync@npm:1.0.0-beta.2" + checksum: 10c0/782aba6cba65b1bb5af3b095d96249d20edbe8df32dbf4696fd49be2583faf676173bf4809386588828e4dd76a3354fcbeb577bab1c833ccd9fc4577f26103f8 + languageName: node + linkType: hard + +"get-caller-file@npm:^2.0.5": + version: 2.0.5 + resolution: "get-caller-file@npm:2.0.5" + checksum: 10c0/c6c7b60271931fa752aeb92f2b47e355eac1af3a2673f47c9589e8f8a41adc74d45551c1bc57b5e66a80609f10ffb72b6f575e4370d61cc3f7f3aaff01757cde + languageName: node + linkType: hard + +"glob@npm:^13.0.3": + version: 13.0.6 + resolution: "glob@npm:13.0.6" + dependencies: + minimatch: "npm:^10.2.2" + minipass: "npm:^7.1.3" + path-scurry: "npm:^2.0.2" + checksum: 10c0/269c236f11a9b50357fe7a8c6aadac667e01deb5242b19c84975628f05f4438d8ee1354bb62c5d6c10f37fd59911b54d7799730633a2786660d8c69f1d18120a + languageName: node + linkType: hard + +"graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.6": + version: 4.2.11 + resolution: "graceful-fs@npm:4.2.11" + checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2 + languageName: node + linkType: hard + +"history@npm:^4.9.0": + version: 4.10.1 + resolution: "history@npm:4.10.1" + dependencies: + "@babel/runtime": "npm:^7.1.2" + loose-envify: "npm:^1.2.0" + resolve-pathname: "npm:^3.0.0" + tiny-invariant: "npm:^1.0.2" + tiny-warning: "npm:^1.0.0" + value-equal: "npm:^1.0.1" + checksum: 10c0/35377694e4f10f2cf056a9cb1a8ee083e04e4b4717a63baeee4afd565658a62c7e73700bf9e82aa53dbe1ec94e0a25a83c080d63bad8ee6b274a98d2fbc5ed4c + languageName: node + linkType: hard + +"hoist-non-react-statics@npm:^3.1.0": + version: 3.3.2 + resolution: "hoist-non-react-statics@npm:3.3.2" + dependencies: + react-is: "npm:^16.7.0" + checksum: 10c0/fe0889169e845d738b59b64badf5e55fa3cf20454f9203d1eb088df322d49d4318df774828e789898dcb280e8a5521bb59b3203385662ca5e9218a6ca5820e74 + languageName: node + linkType: hard + +"http-parser-js@npm:>=0.5.1": + version: 0.5.10 + resolution: "http-parser-js@npm:0.5.10" + checksum: 10c0/8bbcf1832a8d70b2bd515270112116333add88738a2cc05bfb94ba6bde3be4b33efee5611584113818d2bcf654fdc335b652503be5a6b4c0b95e46f214187d93 + languageName: node + linkType: hard + +"iceberg-js@npm:^0.8.1": + version: 0.8.1 + resolution: "iceberg-js@npm:0.8.1" + checksum: 10c0/e504da64cc26e8ad7c5344353a7203c671a740c14eb6086f20505f5e9739cab774493e616032530c962df97f2a855115cc2e89a47dd81581df5917b21a69ec48 + languageName: node + linkType: hard + +"idb@npm:7.1.1": + version: 7.1.1 + resolution: "idb@npm:7.1.1" + checksum: 10c0/72418e4397638797ee2089f97b45fc29f937b830bc0eb4126f4a9889ecf10320ceacf3a177fe5d7ffaf6b4fe38b20bbd210151549bfdc881db8081eed41c870d + languageName: node + linkType: hard + +"inherits@npm:^2.0.3": + version: 2.0.4 + resolution: "inherits@npm:2.0.4" + checksum: 10c0/4e531f648b29039fb7426fb94075e6545faa1eb9fe83c29f0b6d9e7263aceb4289d2d4557db0d428188eeb449cc7c5e77b0a0b2c4e248ff2a65933a0dee49ef2 + languageName: node + linkType: hard + +"ini@npm:^4.1.1": + version: 4.1.3 + resolution: "ini@npm:4.1.3" + checksum: 10c0/0d27eff094d5f3899dd7c00d0c04ea733ca03a8eb6f9406ce15daac1a81de022cb417d6eaff7e4342451ffa663389c565ffc68d6825eaf686bf003280b945764 + languageName: node + linkType: hard + +"ionicons@npm:^7.4.0": + version: 7.4.0 + resolution: "ionicons@npm:7.4.0" + dependencies: + "@stencil/core": "npm:^4.0.3" + checksum: 10c0/0f0e9b5a390514e864f098fbc6b69823fa2cde1758d0e43ca6a9a3b19d3a15b595c913e5a4445945bbbf779454c710fd101edb00f5f1a658dafd9073cc10b0b6 + languageName: node + linkType: hard + +"ionicons@npm:^8.0.13": + version: 8.0.13 + resolution: "ionicons@npm:8.0.13" + dependencies: + "@stencil/core": "npm:^4.35.3" + checksum: 10c0/4f12586359ed5d68dafff0440ff7ca4c195bdea5fff1f9fa4626add1e4fcea78a862db87c20930199f93817737695425b319aede65ef2111cf0191cdc346ce80 + languageName: node + linkType: hard + +"is-docker@npm:^2.0.0, is-docker@npm:^2.1.1": + version: 2.2.1 + resolution: "is-docker@npm:2.2.1" + bin: + is-docker: cli.js + checksum: 10c0/e828365958d155f90c409cdbe958f64051d99e8aedc2c8c4cd7c89dcf35329daed42f7b99346f7828df013e27deb8f721cf9408ba878c76eb9e8290235fbcdcc + languageName: node + linkType: hard + +"is-fullwidth-code-point@npm:^3.0.0": + version: 3.0.0 + resolution: "is-fullwidth-code-point@npm:3.0.0" + checksum: 10c0/bb11d825e049f38e04c06373a8d72782eee0205bda9d908cc550ccb3c59b99d750ff9537982e01733c1c94a58e35400661f57042158ff5e8f3e90cf936daf0fc + languageName: node + linkType: hard + +"is-wsl@npm:^2.2.0": + version: 2.2.0 + resolution: "is-wsl@npm:2.2.0" + dependencies: + is-docker: "npm:^2.0.0" + checksum: 10c0/a6fa2d370d21be487c0165c7a440d567274fbba1a817f2f0bfa41cc5e3af25041d84267baa22df66696956038a43973e72fca117918c91431920bdef490fa25e + languageName: node + linkType: hard + +"isarray@npm:0.0.1": + version: 0.0.1 + resolution: "isarray@npm:0.0.1" + checksum: 10c0/ed1e62da617f71fe348907c71743b5ed550448b455f8d269f89a7c7ddb8ae6e962de3dab6a74a237b06f5eb7f6ece7a45ada8ce96d87fe972926530f91ae3311 + languageName: node + linkType: hard + +"isexe@npm:^2.0.0": + version: 2.0.0 + resolution: "isexe@npm:2.0.0" + checksum: 10c0/228cfa503fadc2c31596ab06ed6aa82c9976eec2bfd83397e7eaf06d0ccf42cd1dfd6743bf9aeb01aebd4156d009994c5f76ea898d2832c1fe342da923ca457d + languageName: node + linkType: hard + +"isexe@npm:^4.0.0": + version: 4.0.0 + resolution: "isexe@npm:4.0.0" + checksum: 10c0/5884815115bceac452877659a9c7726382531592f43dc29e5d48b7c4100661aed54018cb90bd36cb2eaeba521092570769167acbb95c18d39afdccbcca06c5ce + languageName: node + linkType: hard + +"js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": + version: 4.0.0 + resolution: "js-tokens@npm:4.0.0" + checksum: 10c0/e248708d377aa058eacf2037b07ded847790e6de892bbad3dac0abba2e759cb9f121b00099a65195616badcb6eca8d14d975cb3e89eb1cfda644756402c8aeed + languageName: node + linkType: hard + +"jsesc@npm:^3.0.2": + version: 3.1.0 + resolution: "jsesc@npm:3.1.0" + bin: + jsesc: bin/jsesc + checksum: 10c0/531779df5ec94f47e462da26b4cbf05eb88a83d9f08aac2ba04206508fc598527a153d08bd462bae82fc78b3eaa1a908e1a4a79f886e9238641c4cdefaf118b1 + languageName: node + linkType: hard + +"json5@npm:^2.2.3": + version: 2.2.3 + resolution: "json5@npm:2.2.3" + bin: + json5: lib/cli.js + checksum: 10c0/5a04eed94810fa55c5ea138b2f7a5c12b97c3750bc63d11e511dcecbfef758003861522a070c2272764ee0f4e3e323862f386945aeb5b85b87ee43f084ba586c + languageName: node + linkType: hard + +"jsonfile@npm:^6.0.1": + version: 6.2.1 + resolution: "jsonfile@npm:6.2.1" + dependencies: + graceful-fs: "npm:^4.1.6" + universalify: "npm:^2.0.0" + dependenciesMeta: + graceful-fs: + optional: true + checksum: 10c0/e1abf000ecee9942d4d028a8e02dc752617face227d72afd1cfb2187e2433079e625bf82b807a313689db71b6472c6b2b389a2340d2798737b1199a39631c28a + languageName: node + linkType: hard + +"katex@npm:^0.16.0": + version: 0.16.47 + resolution: "katex@npm:0.16.47" + dependencies: + commander: "npm:^8.3.0" + bin: + katex: cli.js + checksum: 10c0/b10f4d0651c60771a48444879e4227255e26e2b2ec061b1ee4b08934863ad2324ba8dbb772455f7768aeb14dfcc13bcd309174a0ddd5ef954a607f644a197710 + languageName: node + linkType: hard + +"kdbush@npm:^4.0.2": + version: 4.1.0 + resolution: "kdbush@npm:4.1.0" + checksum: 10c0/b47c8a27de438df1e60080f73e3793217b4542a62bed7f07c8c29b0bf53359bbdba1e97305e396f7f4d28f98e31ce3fd21500dc3de03a44d8cda71a3d70ff7bb + languageName: node + linkType: hard + +"kleur@npm:^3.0.3": + version: 3.0.3 + resolution: "kleur@npm:3.0.3" + checksum: 10c0/cd3a0b8878e7d6d3799e54340efe3591ca787d9f95f109f28129bdd2915e37807bf8918bb295ab86afb8c82196beec5a1adcaf29042ce3f2bd932b038fe3aa4b + languageName: node + linkType: hard + +"kleur@npm:^4.1.5": + version: 4.1.5 + resolution: "kleur@npm:4.1.5" + checksum: 10c0/e9de6cb49657b6fa70ba2d1448fd3d691a5c4370d8f7bbf1c2f64c24d461270f2117e1b0afe8cb3114f13bbd8e51de158c2a224953960331904e636a5e4c0f2a + languageName: node + linkType: hard + +"lodash.camelcase@npm:^4.3.0": + version: 4.3.0 + resolution: "lodash.camelcase@npm:4.3.0" + checksum: 10c0/fcba15d21a458076dd309fce6b1b4bf611d84a0ec252cb92447c948c533ac250b95d2e00955801ebc367e5af5ed288b996d75d37d2035260a937008e14eaf432 + languageName: node + linkType: hard + +"long@npm:^5.0.0, long@npm:^5.3.2": + version: 5.3.2 + resolution: "long@npm:5.3.2" + checksum: 10c0/7130fe1cbce2dca06734b35b70d380ca3f70271c7f8852c922a7c62c86c4e35f0c39290565eca7133c625908d40e126ac57c02b1b1a4636b9457d77e1e60b981 + languageName: node + linkType: hard + +"loose-envify@npm:^1.1.0, loose-envify@npm:^1.2.0, loose-envify@npm:^1.3.1, loose-envify@npm:^1.4.0": + version: 1.4.0 + resolution: "loose-envify@npm:1.4.0" + dependencies: + js-tokens: "npm:^3.0.0 || ^4.0.0" + bin: + loose-envify: cli.js + checksum: 10c0/655d110220983c1a4b9c0c679a2e8016d4b67f6e9c7b5435ff5979ecdb20d0813f4dec0a08674fcbdd4846a3f07edbb50a36811fd37930b94aaa0d9daceb017e + languageName: node + linkType: hard + +"lru-cache@npm:^11.0.0": + version: 11.5.0 + resolution: "lru-cache@npm:11.5.0" + checksum: 10c0/b92c2a7518128dec6b244bf3eb9fd79964d316cdeb12865ebfc2cebb4dfe9b24e3767a3923d71e6eb735f56b557fc55f08f150a53097d7805afb628c90158df4 + languageName: node + linkType: hard + +"lru-cache@npm:^5.1.1": + version: 5.1.1 + resolution: "lru-cache@npm:5.1.1" + dependencies: + yallist: "npm:^3.0.2" + checksum: 10c0/89b2ef2ef45f543011e38737b8a8622a2f8998cddf0e5437174ef8f1f70a8b9d14a918ab3e232cb3ba343b7abddffa667f0b59075b2b80e6b4d63c3de6127482 + languageName: node + linkType: hard + +"minimatch@npm:^10.2.2": + version: 10.2.5 + resolution: "minimatch@npm:10.2.5" + dependencies: + brace-expansion: "npm:^5.0.5" + checksum: 10c0/6bb058bd6324104b9ec2f763476a35386d05079c1f5fe4fbf1f324a25237cd4534d6813ecd71f48208f4e635c1221899bef94c3c89f7df55698fe373aaae20fd + languageName: node + linkType: hard + +"minipass@npm:^7.0.4, minipass@npm:^7.1.2, minipass@npm:^7.1.3": + version: 7.1.3 + resolution: "minipass@npm:7.1.3" + checksum: 10c0/539da88daca16533211ea5a9ee98dc62ff5742f531f54640dd34429e621955e91cc280a91a776026264b7f9f6735947629f920944e9c1558369e8bf22eb33fbb + languageName: node + linkType: hard + +"minizlib@npm:^3.1.0": + version: 3.1.0 + resolution: "minizlib@npm:3.1.0" + dependencies: + minipass: "npm:^7.1.2" + checksum: 10c0/5aad75ab0090b8266069c9aabe582c021ae53eb33c6c691054a13a45db3b4f91a7fb1bd79151e6b4e9e9a86727b522527c0a06ec7d45206b745d54cd3097bcec + languageName: node + linkType: hard + +"ms@npm:^2.1.3": + version: 2.1.3 + resolution: "ms@npm:2.1.3" + checksum: 10c0/d924b57e7312b3b63ad21fc5b3dc0af5e78d61a1fc7cfb5457edaf26326bf62be5307cc87ffb6862ef1c2b33b0233cdb5d4f01c4c958cc0d660948b65a287a48 + languageName: node + linkType: hard + +"nanoid@npm:^3.3.12": + version: 3.3.12 + resolution: "nanoid@npm:3.3.12" + bin: + nanoid: bin/nanoid.cjs + checksum: 10c0/ba142b7b39e11e80c16dd74b0365d407880c87c1cf7e1480956981ae940ee36060fa5b6f092cd1e315184dd19244c657bd017d03327bd3c62247d691c5e8edfb + languageName: node + linkType: hard + +"native-run@npm:^2.0.3": + version: 2.0.3 + resolution: "native-run@npm:2.0.3" + dependencies: + "@ionic/utils-fs": "npm:^3.1.7" + "@ionic/utils-terminal": "npm:^2.3.4" + bplist-parser: "npm:^0.3.2" + debug: "npm:^4.3.4" + elementtree: "npm:^0.1.7" + ini: "npm:^4.1.1" + plist: "npm:^3.1.0" + split2: "npm:^4.2.0" + through2: "npm:^4.0.2" + tslib: "npm:^2.6.2" + yauzl: "npm:^2.10.0" + bin: + native-run: bin/native-run + checksum: 10c0/ce7e4fccca1f3dce3a4c5c8ceca5ad84dde66eda5c912311990c7c4cf8bfade607d8ea4707349cbe309bba151e779dc1a1f8428b7ebbc114ada4e8f08d717d6b + languageName: node + linkType: hard + +"node-gyp@npm:latest": + version: 12.3.0 + resolution: "node-gyp@npm:12.3.0" + dependencies: + env-paths: "npm:^2.2.0" + exponential-backoff: "npm:^3.1.1" + graceful-fs: "npm:^4.2.6" + nopt: "npm:^9.0.0" + proc-log: "npm:^6.0.0" + semver: "npm:^7.3.5" + tar: "npm:^7.5.4" + tinyglobby: "npm:^0.2.12" + undici: "npm:^6.25.0" + which: "npm:^6.0.0" + bin: + node-gyp: bin/node-gyp.js + checksum: 10c0/9d9032b405cbe42f72a105259d9eb679376470c102df4a2dbaa51e07d59bf741dcffb85897087ea9d8318b9cabb824a8978af51508ae142f0239ae1e6a3c2329 + languageName: node + linkType: hard + +"node-releases@npm:^2.0.36": + version: 2.0.44 + resolution: "node-releases@npm:2.0.44" + checksum: 10c0/004337ee9c0c455e81fdfc85cc8a585e89932d28338cd35a4ddba21ef2b68ff20cf06097544e7859c1868579d8529ed230802b127be5357c153e267079e8d851 + languageName: node + linkType: hard + +"nopt@npm:^9.0.0": + version: 9.0.0 + resolution: "nopt@npm:9.0.0" + dependencies: + abbrev: "npm:^4.0.0" + bin: + nopt: bin/nopt.js + checksum: 10c0/1822eb6f9b020ef6f7a7516d7b64a8036e09666ea55ac40416c36e4b2b343122c3cff0e2f085675f53de1d2db99a2a89a60ccea1d120bcd6a5347bf6ceb4a7fd + languageName: node + linkType: hard + +"object-assign@npm:^4.1.1": + version: 4.1.1 + resolution: "object-assign@npm:4.1.1" + checksum: 10c0/1f4df9945120325d041ccf7b86f31e8bcc14e73d29171e37a7903050e96b81323784ec59f93f102ec635bcf6fa8034ba3ea0a8c7e69fa202b87ae3b6cec5a414 + languageName: node + linkType: hard + +"open@npm:^8.4.0": + version: 8.4.2 + resolution: "open@npm:8.4.2" + dependencies: + define-lazy-prop: "npm:^2.0.0" + is-docker: "npm:^2.1.1" + is-wsl: "npm:^2.2.0" + checksum: 10c0/bb6b3a58401dacdb0aad14360626faf3fb7fba4b77816b373495988b724fb48941cad80c1b65d62bb31a17609b2cd91c41a181602caea597ca80dfbcc27e84c9 + languageName: node + linkType: hard + +"package-json-from-dist@npm:^1.0.1": + version: 1.0.1 + resolution: "package-json-from-dist@npm:1.0.1" + checksum: 10c0/62ba2785eb655fec084a257af34dbe24292ab74516d6aecef97ef72d4897310bc6898f6c85b5cd22770eaa1ce60d55a0230e150fb6a966e3ecd6c511e23d164b + languageName: node + linkType: hard + +"path-key@npm:^3.1.0": + version: 3.1.1 + resolution: "path-key@npm:3.1.1" + checksum: 10c0/748c43efd5a569c039d7a00a03b58eecd1d75f3999f5a28303d75f521288df4823bc057d8784eb72358b2895a05f29a070bc9f1f17d28226cc4e62494cc58c4c + languageName: node + linkType: hard + +"path-scurry@npm:^2.0.2": + version: 2.0.2 + resolution: "path-scurry@npm:2.0.2" + dependencies: + lru-cache: "npm:^11.0.0" + minipass: "npm:^7.1.2" + checksum: 10c0/b35ad37cf6557a87fd057121ce2be7695380c9138d93e87ae928609da259ea0a170fac6f3ef1eb3ece8a068e8b7f2f3adf5bb2374cf4d4a57fe484954fcc9482 + languageName: node + linkType: hard + +"path-to-regexp@npm:^1.7.0": + version: 1.9.0 + resolution: "path-to-regexp@npm:1.9.0" + dependencies: + isarray: "npm:0.0.1" + checksum: 10c0/de9ddb01b84d9c2c8e2bed18630d8d039e2d6f60a6538595750fa08c7a6482512257464c8da50616f266ab2cdd2428387e85f3b089e4c3f25d0c537e898a0751 + languageName: node + linkType: hard + +"pend@npm:~1.2.0": + version: 1.2.0 + resolution: "pend@npm:1.2.0" + checksum: 10c0/8a87e63f7a4afcfb0f9f77b39bb92374afc723418b9cb716ee4257689224171002e07768eeade4ecd0e86f1fa3d8f022994219fb45634f2dbd78c6803e452458 + languageName: node + linkType: hard + +"picocolors@npm:^1.1.1": + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: 10c0/e2e3e8170ab9d7c7421969adaa7e1b31434f789afb9b3f115f6b96d91945041ac3ceb02e9ec6fe6510ff036bcc0bf91e69a1772edc0b707e12b19c0f2d6bcf58 + languageName: node + linkType: hard + +"picomatch@npm:^4.0.4": + version: 4.0.4 + resolution: "picomatch@npm:4.0.4" + checksum: 10c0/e2c6023372cc7b5764719a5ffb9da0f8e781212fa7ca4bd0562db929df8e117460f00dff3cb7509dacfc06b86de924b247f504d0ce1806a37fac4633081466b0 + languageName: node + linkType: hard + +"plist@npm:^3.1.0": + version: 3.1.1 + resolution: "plist@npm:3.1.1" + dependencies: + "@xmldom/xmldom": "npm:^0.9.10" + base64-js: "npm:^1.5.1" + xmlbuilder: "npm:^15.1.1" + checksum: 10c0/af681277c2e541c6aab0ddee57f59459c43beeea1ee7aa2d4218aa39595fb41c068e2d2be3e4abb17e3252eaf2c1b806ecfb1d402fa5a3f4a6e1a7a32c880c9a + languageName: node + linkType: hard + +"postcss@npm:^8.4.43": + version: 8.5.15 + resolution: "postcss@npm:8.5.15" + dependencies: + nanoid: "npm:^3.3.12" + picocolors: "npm:^1.1.1" + source-map-js: "npm:^1.2.1" + checksum: 10c0/7f2e63ae22fbe43aace1bf652bd99da4e90737c64194d49e51ddc9cd0f9e51ff2861a7d734379b494deffa03a880a5c65eec70bc29ee9ebaa7136dde3eee8f31 + languageName: node + linkType: hard + +"proc-log@npm:^6.0.0": + version: 6.1.0 + resolution: "proc-log@npm:6.1.0" + checksum: 10c0/4f178d4062733ead9d71a9b1ab24ebcecdfe2250916a5b1555f04fe2eda972a0ec76fbaa8df1ad9c02707add6749219d118a4fc46dc56bdfe4dde4b47d80bb82 + languageName: node + linkType: hard + +"prompts@npm:^2.4.2": + version: 2.4.2 + resolution: "prompts@npm:2.4.2" + dependencies: + kleur: "npm:^3.0.3" + sisteransi: "npm:^1.0.5" + checksum: 10c0/16f1ac2977b19fe2cf53f8411cc98db7a3c8b115c479b2ca5c82b5527cd937aa405fa04f9a5960abeb9daef53191b53b4d13e35c1f5d50e8718c76917c5f1ea4 + languageName: node + linkType: hard + +"prop-types@npm:^15.6.2": + version: 15.8.1 + resolution: "prop-types@npm:15.8.1" + dependencies: + loose-envify: "npm:^1.4.0" + object-assign: "npm:^4.1.1" + react-is: "npm:^16.13.1" + checksum: 10c0/59ece7ca2fb9838031d73a48d4becb9a7cc1ed10e610517c7d8f19a1e02fa47f7c27d557d8a5702bec3cfeccddc853579832b43f449e54635803f277b1c78077 + languageName: node + linkType: hard + +"protobufjs@npm:^7.2.5": + version: 7.6.4 + resolution: "protobufjs@npm:7.6.4" + dependencies: + "@protobufjs/aspromise": "npm:^1.1.2" + "@protobufjs/base64": "npm:^1.1.2" + "@protobufjs/codegen": "npm:^2.0.5" + "@protobufjs/eventemitter": "npm:^1.1.1" + "@protobufjs/fetch": "npm:^1.1.1" + "@protobufjs/float": "npm:^1.0.2" + "@protobufjs/path": "npm:^1.1.2" + "@protobufjs/pool": "npm:^1.1.0" + "@protobufjs/utf8": "npm:^1.1.1" + "@types/node": "npm:>=13.7.0" + long: "npm:^5.3.2" + checksum: 10c0/6403eaa9c5a72cc6450c11f38fefafdde243fd806e7ac606ac8d591bc3fdaec45ae764febf83181a2d9aac51aca624e0f46dec368ceea191f7e85e2d6ccaaf93 + languageName: node + linkType: hard + +"qrcode.react@npm:^4.2.0": + version: 4.2.0 + resolution: "qrcode.react@npm:4.2.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 10c0/68c691d130e5fda2f57cee505ed7aea840e7d02033100687b764601f9595e1116e34c13876628a93e1a5c2b85e4efc27d30b2fda72e2050c02f3e1c4e998d248 + languageName: node + linkType: hard + +"react-dom@npm:18.2.0": + version: 18.2.0 + resolution: "react-dom@npm:18.2.0" + dependencies: + loose-envify: "npm:^1.1.0" + scheduler: "npm:^0.23.0" + peerDependencies: + react: ^18.2.0 + checksum: 10c0/66dfc5f93e13d0674e78ef41f92ed21dfb80f9c4ac4ac25a4b51046d41d4d2186abc915b897f69d3d0ebbffe6184e7c5876f2af26bfa956f179225d921be713a + languageName: node + linkType: hard + +"react-hook-form@npm:^7.54.0": + version: 7.76.1 + resolution: "react-hook-form@npm:7.76.1" + peerDependencies: + react: ^16.8.0 || ^17 || ^18 || ^19 + checksum: 10c0/77b502ffc76a99527093cc67205baf3462ac4b4d8699ba3f45f2efa53f0678dfe8c19aea284a6bdb25f4c598464615e6b9567fc8c194e220313aa9f3e48c6da7 + languageName: node + linkType: hard + +"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0": + version: 16.13.1 + resolution: "react-is@npm:16.13.1" + checksum: 10c0/33977da7a5f1a287936a0c85639fec6ca74f4f15ef1e59a6bc20338fc73dc69555381e211f7a3529b8150a1f71e4225525b41b60b52965bda53ce7d47377ada1 + languageName: node + linkType: hard + +"react-katex@npm:^3.0.1": + version: 3.1.0 + resolution: "react-katex@npm:3.1.0" + dependencies: + katex: "npm:^0.16.0" + peerDependencies: + prop-types: ^15.8.1 + react: ">=15.3.2 <20" + checksum: 10c0/a61eb2c19a2dc384ad5864a27af66f40c504643f984150f4e270373df88293c2586779b53b2ee7ee4e75076f3c5284b36f425bbc1021d164ccb2997d11d8678f + languageName: node + linkType: hard + +"react-refresh@npm:^0.17.0": + version: 0.17.0 + resolution: "react-refresh@npm:0.17.0" + checksum: 10c0/002cba940384c9930008c0bce26cac97a9d5682bc623112c2268ba0c155127d9c178a9a5cc2212d560088d60dfd503edd808669a25f9b377f316a32361d0b23c + languageName: node + linkType: hard + +"react-router-dom@npm:^5.3.4": + version: 5.3.4 + resolution: "react-router-dom@npm:5.3.4" + dependencies: + "@babel/runtime": "npm:^7.12.13" + history: "npm:^4.9.0" + loose-envify: "npm:^1.3.1" + prop-types: "npm:^15.6.2" + react-router: "npm:5.3.4" + tiny-invariant: "npm:^1.0.2" + tiny-warning: "npm:^1.0.0" + peerDependencies: + react: ">=15" + checksum: 10c0/f04f727e2ed2e9d1d3830af02cc61690ff67b1524c0d18690582bfba0f4d14142ccc88fb6da6befad644fddf086f5ae4c2eb7048c67da8a0b0929c19426421b0 + languageName: node + linkType: hard + +"react-router@npm:5.3.4, react-router@npm:^5.3.4": + version: 5.3.4 + resolution: "react-router@npm:5.3.4" + dependencies: + "@babel/runtime": "npm:^7.12.13" + history: "npm:^4.9.0" + hoist-non-react-statics: "npm:^3.1.0" + loose-envify: "npm:^1.3.1" + path-to-regexp: "npm:^1.7.0" + prop-types: "npm:^15.6.2" + react-is: "npm:^16.6.0" + tiny-invariant: "npm:^1.0.2" + tiny-warning: "npm:^1.0.0" + peerDependencies: + react: ">=15" + checksum: 10c0/e15c00dfef199249b4c6e6d98e5e76cc352ce66f3270f13df37cc069ddf7c05e43281e8c308fc407e4435d72924373baef1d2890e0f6b0b1eb423cf47315a053 + languageName: node + linkType: hard + +"react@npm:18.2.0": + version: 18.2.0 + resolution: "react@npm:18.2.0" + dependencies: + loose-envify: "npm:^1.1.0" + checksum: 10c0/b562d9b569b0cb315e44b48099f7712283d93df36b19a39a67c254c6686479d3980b7f013dc931f4a5a3ae7645eae6386b4aa5eea933baa54ecd0f9acb0902b8 + languageName: node + linkType: hard + +"readable-stream@npm:3": + version: 3.6.2 + resolution: "readable-stream@npm:3.6.2" + dependencies: + inherits: "npm:^2.0.3" + string_decoder: "npm:^1.1.1" + util-deprecate: "npm:^1.0.1" + checksum: 10c0/e37be5c79c376fdd088a45fa31ea2e423e5d48854be7a22a58869b4e84d25047b193f6acb54f1012331e1bcd667ffb569c01b99d36b0bd59658fb33f513511b7 + languageName: node + linkType: hard + +"require-directory@npm:^2.1.1": + version: 2.1.1 + resolution: "require-directory@npm:2.1.1" + checksum: 10c0/83aa76a7bc1531f68d92c75a2ca2f54f1b01463cb566cf3fbc787d0de8be30c9dbc211d1d46be3497dac5785fe296f2dd11d531945ac29730643357978966e99 + languageName: node + linkType: hard + +"resolve-pathname@npm:^3.0.0": + version: 3.0.0 + resolution: "resolve-pathname@npm:3.0.0" + checksum: 10c0/c6ec49b670dc35b9a303c47fa83ba9348a71e92d64a4c4bb85e1b659a29b407aa1ac1cb14a9b5b502982132ca77482bd80534bca147439d66880d35a137fe723 + languageName: node + linkType: hard + +"rimraf@npm:^6.0.1": + version: 6.1.3 + resolution: "rimraf@npm:6.1.3" + dependencies: + glob: "npm:^13.0.3" + package-json-from-dist: "npm:^1.0.1" + bin: + rimraf: dist/esm/bin.mjs + checksum: 10c0/4a56537850102e20ba5d5eb49f366b4b7b2435389734b4b8480cf0e0eb0f6f5d0c44120a171aeb0d8f9ab40312a10d2262f3f50acbad803e32caef61b6cf86fc + languageName: node + linkType: hard + +"rollup@npm:^4.20.0": + version: 4.60.4 + resolution: "rollup@npm:4.60.4" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.60.4" + "@rollup/rollup-android-arm64": "npm:4.60.4" + "@rollup/rollup-darwin-arm64": "npm:4.60.4" + "@rollup/rollup-darwin-x64": "npm:4.60.4" + "@rollup/rollup-freebsd-arm64": "npm:4.60.4" + "@rollup/rollup-freebsd-x64": "npm:4.60.4" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.60.4" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.60.4" + "@rollup/rollup-linux-arm64-gnu": "npm:4.60.4" + "@rollup/rollup-linux-arm64-musl": "npm:4.60.4" + "@rollup/rollup-linux-loong64-gnu": "npm:4.60.4" + "@rollup/rollup-linux-loong64-musl": "npm:4.60.4" + "@rollup/rollup-linux-ppc64-gnu": "npm:4.60.4" + "@rollup/rollup-linux-ppc64-musl": "npm:4.60.4" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.60.4" + "@rollup/rollup-linux-riscv64-musl": "npm:4.60.4" + "@rollup/rollup-linux-s390x-gnu": "npm:4.60.4" + "@rollup/rollup-linux-x64-gnu": "npm:4.60.4" + "@rollup/rollup-linux-x64-musl": "npm:4.60.4" + "@rollup/rollup-openbsd-x64": "npm:4.60.4" + "@rollup/rollup-openharmony-arm64": "npm:4.60.4" + "@rollup/rollup-win32-arm64-msvc": "npm:4.60.4" + "@rollup/rollup-win32-ia32-msvc": "npm:4.60.4" + "@rollup/rollup-win32-x64-gnu": "npm:4.60.4" + "@rollup/rollup-win32-x64-msvc": "npm:4.60.4" + "@types/estree": "npm:1.0.8" + fsevents: "npm:~2.3.2" + dependenciesMeta: + "@rollup/rollup-android-arm-eabi": + optional: true + "@rollup/rollup-android-arm64": + optional: true + "@rollup/rollup-darwin-arm64": + optional: true + "@rollup/rollup-darwin-x64": + optional: true + "@rollup/rollup-freebsd-arm64": + optional: true + "@rollup/rollup-freebsd-x64": + optional: true + "@rollup/rollup-linux-arm-gnueabihf": + optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true + "@rollup/rollup-linux-arm64-gnu": + optional: true + "@rollup/rollup-linux-arm64-musl": + optional: true + "@rollup/rollup-linux-loong64-gnu": + optional: true + "@rollup/rollup-linux-loong64-musl": + optional: true + "@rollup/rollup-linux-ppc64-gnu": + optional: true + "@rollup/rollup-linux-ppc64-musl": + optional: true + "@rollup/rollup-linux-riscv64-gnu": + optional: true + "@rollup/rollup-linux-riscv64-musl": + optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true + "@rollup/rollup-linux-x64-gnu": + optional: true + "@rollup/rollup-linux-x64-musl": + optional: true + "@rollup/rollup-openbsd-x64": + optional: true + "@rollup/rollup-openharmony-arm64": + optional: true + "@rollup/rollup-win32-arm64-msvc": + optional: true + "@rollup/rollup-win32-ia32-msvc": + optional: true + "@rollup/rollup-win32-x64-gnu": + optional: true + "@rollup/rollup-win32-x64-msvc": + optional: true + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 10c0/2734511579da220408eefb877b51281767d790652cee25da8fcd4936c947e3db14882b5edb1d0d5d5bf60f2a71a58ae7d5f7f46c11e3fdf33182538953886243 + languageName: node + linkType: hard + +"safe-buffer@npm:>=5.1.0, safe-buffer@npm:~5.2.0": + version: 5.2.1 + resolution: "safe-buffer@npm:5.2.1" + checksum: 10c0/6501914237c0a86e9675d4e51d89ca3c21ffd6a31642efeba25ad65720bce6921c9e7e974e5be91a786b25aa058b5303285d3c15dbabf983a919f5f630d349f3 + languageName: node + linkType: hard + +"sax@npm:1.1.4": + version: 1.1.4 + resolution: "sax@npm:1.1.4" + checksum: 10c0/805371d5c326f48e6b180e059315d9e97be8e38620538bc7d5debb05c1b2f6ffc14c5f26a50688d5e61a79949e2c8ff2781410de6718d3323137ae7e7a32cbe5 + languageName: node + linkType: hard + +"sax@npm:>=0.6.0": + version: 1.6.0 + resolution: "sax@npm:1.6.0" + checksum: 10c0/e5593f4a91eb25761a688c4d96902e4e95a0dd6017bc65146b6f21236e3d715cf893333b76bc758923c9574c2fb5a7a76c3a81e96ea15432f2624f906c027c1e + languageName: node + linkType: hard + +"scheduler@npm:^0.23.0": + version: 0.23.2 + resolution: "scheduler@npm:0.23.2" + dependencies: + loose-envify: "npm:^1.1.0" + checksum: 10c0/26383305e249651d4c58e6705d5f8425f153211aef95f15161c151f7b8de885f24751b377e4a0b3dd42cce09aad3f87a61dab7636859c0d89b7daf1a1e2a5c78 + languageName: node + linkType: hard + +"semver@npm:^6.3.1": + version: 6.3.1 + resolution: "semver@npm:6.3.1" + bin: + semver: bin/semver.js + checksum: 10c0/e3d79b609071caa78bcb6ce2ad81c7966a46a7431d9d58b8800cfa9cb6a63699b3899a0e4bcce36167a284578212d9ae6942b6929ba4aa5015c079a67751d42d + languageName: node + linkType: hard + +"semver@npm:^7.3.5, semver@npm:^7.6.3": + version: 7.8.0 + resolution: "semver@npm:7.8.0" + bin: + semver: bin/semver.js + checksum: 10c0/8f096ca9b80ffd47b308d03f9ce8c873e27e2983f36023c559cdc92c51e8433fc23ebbfe57ec9623fc155636a6961ee989501099841ae4bb1babc8d2b3f048cd + languageName: node + linkType: hard + +"shebang-command@npm:^2.0.0": + version: 2.0.0 + resolution: "shebang-command@npm:2.0.0" + dependencies: + shebang-regex: "npm:^3.0.0" + checksum: 10c0/a41692e7d89a553ef21d324a5cceb5f686d1f3c040759c50aab69688634688c5c327f26f3ecf7001ebfd78c01f3c7c0a11a7c8bfd0a8bc9f6240d4f40b224e4e + languageName: node + linkType: hard + +"shebang-regex@npm:^3.0.0": + version: 3.0.0 + resolution: "shebang-regex@npm:3.0.0" + checksum: 10c0/1dbed0726dd0e1152a92696c76c7f06084eb32a90f0528d11acd764043aacf76994b2fb30aa1291a21bd019d6699164d048286309a278855ee7bec06cf6fb690 + languageName: node + linkType: hard + +"signal-exit@npm:^3.0.3": + version: 3.0.7 + resolution: "signal-exit@npm:3.0.7" + checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 + languageName: node + linkType: hard + +"sisteransi@npm:^1.0.5": + version: 1.0.5 + resolution: "sisteransi@npm:1.0.5" + checksum: 10c0/230ac975cca485b7f6fe2b96a711aa62a6a26ead3e6fb8ba17c5a00d61b8bed0d7adc21f5626b70d7c33c62ff4e63933017a6462942c719d1980bb0b1207ad46 + languageName: node + linkType: hard + +"slice-ansi@npm:^4.0.0": + version: 4.0.0 + resolution: "slice-ansi@npm:4.0.0" + dependencies: + ansi-styles: "npm:^4.0.0" + astral-regex: "npm:^2.0.0" + is-fullwidth-code-point: "npm:^3.0.0" + checksum: 10c0/6c25678db1270d4793e0327620f1e0f9f5bea4630123f51e9e399191bc52c87d6e6de53ed33538609e5eacbd1fab769fae00f3705d08d029f02102a540648918 + languageName: node + linkType: hard + +"source-map-js@npm:^1.2.1": + version: 1.2.1 + resolution: "source-map-js@npm:1.2.1" + checksum: 10c0/7bda1fc4c197e3c6ff17de1b8b2c20e60af81b63a52cb32ec5a5d67a20a7d42651e2cb34ebe93833c5a2a084377e17455854fee3e21e7925c64a51b6a52b0faf + languageName: node + linkType: hard + +"source-map-support@npm:~0.5.20": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: "npm:^1.0.0" + source-map: "npm:^0.6.0" + checksum: 10c0/9ee09942f415e0f721d6daad3917ec1516af746a8120bba7bb56278707a37f1eb8642bde456e98454b8a885023af81a16e646869975f06afc1a711fb90484e7d + languageName: node + linkType: hard + +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011 + languageName: node + linkType: hard + +"split2@npm:^4.2.0": + version: 4.2.0 + resolution: "split2@npm:4.2.0" + checksum: 10c0/b292beb8ce9215f8c642bb68be6249c5a4c7f332fc8ecadae7be5cbdf1ea95addc95f0459ef2e7ad9d45fd1064698a097e4eb211c83e772b49bc0ee423e91534 + languageName: node + linkType: hard + +"string-width@npm:^4.1.0, string-width@npm:^4.2.0, string-width@npm:^4.2.3": + version: 4.2.3 + resolution: "string-width@npm:4.2.3" + dependencies: + emoji-regex: "npm:^8.0.0" + is-fullwidth-code-point: "npm:^3.0.0" + strip-ansi: "npm:^6.0.1" + checksum: 10c0/1e525e92e5eae0afd7454086eed9c818ee84374bb80328fc41217ae72ff5f065ef1c9d7f72da41de40c75fa8bb3dee63d92373fd492c84260a552c636392a47b + languageName: node + linkType: hard + +"string_decoder@npm:^1.1.1": + version: 1.3.0 + resolution: "string_decoder@npm:1.3.0" + dependencies: + safe-buffer: "npm:~5.2.0" + checksum: 10c0/810614ddb030e271cd591935dcd5956b2410dd079d64ff92a1844d6b7588bf992b3e1b69b0f4d34a3e06e0bd73046ac646b5264c1987b20d0601f81ef35d731d + languageName: node + linkType: hard + +"strip-ansi@npm:^6.0.0, strip-ansi@npm:^6.0.1": + version: 6.0.1 + resolution: "strip-ansi@npm:6.0.1" + dependencies: + ansi-regex: "npm:^5.0.1" + checksum: 10c0/1ae5f212a126fe5b167707f716942490e3933085a5ff6c008ab97ab2f272c8025d3aa218b7bd6ab25729ca20cc81cddb252102f8751e13482a5199e873680952 + languageName: node + linkType: hard + +"supercluster@npm:^8.0.1": + version: 8.0.1 + resolution: "supercluster@npm:8.0.1" + dependencies: + kdbush: "npm:^4.0.2" + checksum: 10c0/79121e6dbff67b3036ea6651f3baddb942478830ba3ecbc27455715ab5bd269de8381dc04618c0c15963346ea2ed0f81cd5f767c2978a63e2841807c73445d57 + languageName: node + linkType: hard + +"tar@npm:^7.5.3, tar@npm:^7.5.4": + version: 7.5.15 + resolution: "tar@npm:7.5.15" + dependencies: + "@isaacs/fs-minipass": "npm:^4.0.0" + chownr: "npm:^3.0.0" + minipass: "npm:^7.1.2" + minizlib: "npm:^3.1.0" + yallist: "npm:^5.0.0" + checksum: 10c0/8f039edb1d12fdd7df6c6f9877d125afe9f3da3f5f9317df326fdd090d48793d6998cede1506a1471f3e3a250db270a89dace28005eb5e99c5a9132d704ac956 + languageName: node + linkType: hard + +"terser@npm:^5.4.0": + version: 5.47.1 + resolution: "terser@npm:5.47.1" + dependencies: + "@jridgewell/source-map": "npm:^0.3.3" + acorn: "npm:^8.15.0" + commander: "npm:^2.20.0" + source-map-support: "npm:~0.5.20" + bin: + terser: bin/terser + checksum: 10c0/e7017001aff657b8eb444edb4c4ad2425b90c141c5329f06b1939161f38884622972ec7b12d197207229c8079d24d20bf44be93852f735fe3bb4b32d80775775 + languageName: node + linkType: hard + +"through2@npm:^4.0.2": + version: 4.0.2 + resolution: "through2@npm:4.0.2" + dependencies: + readable-stream: "npm:3" + checksum: 10c0/3741564ae99990a4a79097fe7a4152c22348adc4faf2df9199a07a66c81ed2011da39f631e479fdc56483996a9d34a037ad64e76d79f18c782ab178ea9b6778c + languageName: node + linkType: hard + +"tiny-invariant@npm:^1.0.2": + version: 1.3.3 + resolution: "tiny-invariant@npm:1.3.3" + checksum: 10c0/65af4a07324b591a059b35269cd696aba21bef2107f29b9f5894d83cc143159a204b299553435b03874ebb5b94d019afa8b8eff241c8a4cfee95872c2e1c1c4a + languageName: node + linkType: hard + +"tiny-warning@npm:^1.0.0": + version: 1.0.3 + resolution: "tiny-warning@npm:1.0.3" + checksum: 10c0/ef8531f581b30342f29670cb41ca248001c6fd7975ce22122bd59b8d62b4fc84ad4207ee7faa95cde982fa3357cd8f4be650142abc22805538c3b1392d7084fa + languageName: node + linkType: hard + +"tinyglobby@npm:^0.2.12": + version: 0.2.16 + resolution: "tinyglobby@npm:0.2.16" + dependencies: + fdir: "npm:^6.5.0" + picomatch: "npm:^4.0.4" + checksum: 10c0/f2e09fd93dd95c41e522113b686ff6f7c13020962f8698a864a257f3d7737599afc47722b7ab726e12f8a813f779906187911ff8ee6701ede65072671a7e934b + languageName: node + linkType: hard + +"tree-kill@npm:^1.2.2": + version: 1.2.2 + resolution: "tree-kill@npm:1.2.2" + bin: + tree-kill: cli.js + checksum: 10c0/7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2 + languageName: node + linkType: hard + +"tslib@npm:*, tslib@npm:2.8.1, tslib@npm:^2.0.1, tslib@npm:^2.1.0, tslib@npm:^2.6.2, tslib@npm:^2.8.1": + version: 2.8.1 + resolution: "tslib@npm:2.8.1" + checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62 + languageName: node + linkType: hard + +"typescript@npm:~5.9.0": + version: 5.9.3 + resolution: "typescript@npm:5.9.3" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/6bd7552ce39f97e711db5aa048f6f9995b53f1c52f7d8667c1abdc1700c68a76a308f579cd309ce6b53646deb4e9a1be7c813a93baaf0a28ccd536a30270e1c5 + languageName: node + linkType: hard + +"typescript@patch:typescript@npm%3A~5.9.0#optional!builtin": + version: 5.9.3 + resolution: "typescript@patch:typescript@npm%3A5.9.3#optional!builtin::version=5.9.3&hash=5786d5" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 10c0/ad09fdf7a756814dce65bc60c1657b40d44451346858eea230e10f2e95a289d9183b6e32e5c11e95acc0ccc214b4f36289dcad4bf1886b0adb84d711d336a430 + languageName: node + linkType: hard + +"undici-types@npm:>=7.24.0 <7.24.7": + version: 7.24.6 + resolution: "undici-types@npm:7.24.6" + checksum: 10c0/d9cd8befb643ac904615c280a095ba4240531f6bb4a5e75a22a7483630ca8d3f1016d2ab6ace6ceda1f63b3a2db2fe037fafe121d6917a0187573aa548ff78ca + languageName: node + linkType: hard + +"undici-types@npm:~8.3.0": + version: 8.3.0 + resolution: "undici-types@npm:8.3.0" + checksum: 10c0/c8aa7e2fbebfce519654dafadc0ece59be888d2ccaf180fb4495da875e7b536d2456345c384069c7e6f3e9c9ab7435f074957da306f142343eee86ff8048855a + languageName: node + linkType: hard + +"undici@npm:^6.25.0": + version: 6.25.0 + resolution: "undici@npm:6.25.0" + checksum: 10c0/2597cc6689bdb02c210c557b1f85febbfda65becae6e6fc1061508e2f33734d25207f81cd8af56ada9956329eb3a7bd7431e87dcfeceba20ee87059b57dcf985 + languageName: node + linkType: hard + +"universalify@npm:^2.0.0": + version: 2.0.1 + resolution: "universalify@npm:2.0.1" + checksum: 10c0/73e8ee3809041ca8b818efb141801a1004e3fc0002727f1531f4de613ea281b494a40909596dae4a042a4fb6cd385af5d4db2e137b1362e0e91384b828effd3a + languageName: node + linkType: hard + +"untildify@npm:^4.0.0": + version: 4.0.0 + resolution: "untildify@npm:4.0.0" + checksum: 10c0/d758e624c707d49f76f7511d75d09a8eda7f2020d231ec52b67ff4896bcf7013be3f9522d8375f57e586e9a2e827f5641c7e06ee46ab9c435fc2b2b2e9de517a + languageName: node + linkType: hard + +"update-browserslist-db@npm:^1.2.3": + version: 1.2.3 + resolution: "update-browserslist-db@npm:1.2.3" + dependencies: + escalade: "npm:^3.2.0" + picocolors: "npm:^1.1.1" + peerDependencies: + browserslist: ">= 4.21.0" + bin: + update-browserslist-db: cli.js + checksum: 10c0/13a00355ea822388f68af57410ce3255941d5fb9b7c49342c4709a07c9f230bbef7f7499ae0ca7e0de532e79a82cc0c4edbd125f1a323a1845bf914efddf8bec + languageName: node + linkType: hard + +"util-deprecate@npm:^1.0.1": + version: 1.0.2 + resolution: "util-deprecate@npm:1.0.2" + checksum: 10c0/41a5bdd214df2f6c3ecf8622745e4a366c4adced864bc3c833739791aeeeb1838119af7daed4ba36428114b5c67dcda034a79c882e97e43c03e66a4dd7389942 + languageName: node + linkType: hard + +"value-equal@npm:^1.0.1": + version: 1.0.1 + resolution: "value-equal@npm:1.0.1" + checksum: 10c0/79068098355483ef29f4d3753999ad880875b87625d7e9055cad9346ea4b7662aad3a66f87976801b0dd7a6f828ba973d28b1669ebcd37eaf88cc5f687c1a691 + languageName: node + linkType: hard + +"vite@npm:^5.0.0": + version: 5.4.21 + resolution: "vite@npm:5.4.21" + dependencies: + esbuild: "npm:^0.21.3" + fsevents: "npm:~2.3.3" + postcss: "npm:^8.4.43" + rollup: "npm:^4.20.0" + peerDependencies: + "@types/node": ^18.0.0 || >=20.0.0 + less: "*" + lightningcss: ^1.21.0 + sass: "*" + sass-embedded: "*" + stylus: "*" + sugarss: "*" + terser: ^5.4.0 + dependenciesMeta: + fsevents: + optional: true + peerDependenciesMeta: + "@types/node": + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + bin: + vite: bin/vite.js + checksum: 10c0/468336a1409f728b464160cbf02672e72271fb688d0e605e776b74a89d27e1029509eef3a3a6c755928d8011e474dbf234824d054d07960be5f23cd176bc72de + languageName: node + linkType: hard + +"web-vitals@npm:^4.2.4": + version: 4.2.4 + resolution: "web-vitals@npm:4.2.4" + checksum: 10c0/383c9281d5b556bcd190fde3c823aeb005bb8cf82e62c75b47beb411014a4ed13fa5c5e0489ed0f1b8d501cd66b0bebcb8624c1a75750bd5df13e2a3b1b2d194 + languageName: node + linkType: hard + +"websocket-driver@npm:>=0.5.1": + version: 0.7.5 + resolution: "websocket-driver@npm:0.7.5" + dependencies: + http-parser-js: "npm:>=0.5.1" + safe-buffer: "npm:>=5.1.0" + websocket-extensions: "npm:>=0.1.1" + checksum: 10c0/843a3c9f529ce07f2721829f70f62986247525ab22625e857b69da13dc90967bacfe57b85e196801b565cd797e309ddd5b06fa8435732e34e8a8ab6201d7abed + languageName: node + linkType: hard + +"websocket-extensions@npm:>=0.1.1": + version: 0.1.4 + resolution: "websocket-extensions@npm:0.1.4" + checksum: 10c0/bbc8c233388a0eb8a40786ee2e30d35935cacbfe26ab188b3e020987e85d519c2009fe07cfc37b7f718b85afdba7e54654c9153e6697301f72561bfe429177e0 + languageName: node + linkType: hard + +"which@npm:^2.0.1": + version: 2.0.2 + resolution: "which@npm:2.0.2" + dependencies: + isexe: "npm:^2.0.0" + bin: + node-which: ./bin/node-which + checksum: 10c0/66522872a768b60c2a65a57e8ad184e5372f5b6a9ca6d5f033d4b0dc98aff63995655a7503b9c0a2598936f532120e81dd8cc155e2e92ed662a2b9377cc4374f + languageName: node + linkType: hard + +"which@npm:^6.0.0": + version: 6.0.1 + resolution: "which@npm:6.0.1" + dependencies: + isexe: "npm:^4.0.0" + bin: + node-which: bin/which.js + checksum: 10c0/7e710e54ea36d2d6183bee2f9caa27a3b47b9baf8dee55a199b736fcf85eab3b9df7556fca3d02b50af7f3dfba5ea3a45644189836df06267df457e354da66d5 + languageName: node + linkType: hard + +"wrap-ansi@npm:^7.0.0": + version: 7.0.0 + resolution: "wrap-ansi@npm:7.0.0" + dependencies: + ansi-styles: "npm:^4.0.0" + string-width: "npm:^4.1.0" + strip-ansi: "npm:^6.0.0" + checksum: 10c0/d15fc12c11e4cbc4044a552129ebc75ee3f57aa9c1958373a4db0292d72282f54373b536103987a4a7594db1ef6a4f10acf92978f79b98c49306a4b58c77d4da + languageName: node + linkType: hard + +"xml2js@npm:^0.6.2": + version: 0.6.2 + resolution: "xml2js@npm:0.6.2" + dependencies: + sax: "npm:>=0.6.0" + xmlbuilder: "npm:~11.0.0" + checksum: 10c0/e98a84e9c172c556ee2c5afa0fc7161b46919e8b53ab20de140eedea19903ed82f7cd5b1576fb345c84f0a18da1982ddf65908129b58fc3d7cbc658ae232108f + languageName: node + linkType: hard + +"xmlbuilder@npm:^15.1.1": + version: 15.1.1 + resolution: "xmlbuilder@npm:15.1.1" + checksum: 10c0/665266a8916498ff8d82b3d46d3993913477a254b98149ff7cff060d9b7cc0db7cf5a3dae99aed92355254a808c0e2e3ec74ad1b04aa1061bdb8dfbea26c18b8 + languageName: node + linkType: hard + +"xmlbuilder@npm:~11.0.0": + version: 11.0.1 + resolution: "xmlbuilder@npm:11.0.1" + checksum: 10c0/74b979f89a0a129926bc786b913459bdbcefa809afaa551c5ab83f89b1915bdaea14c11c759284bb9b931e3b53004dbc2181e21d3ca9553eeb0b2a7b4e40c35b + languageName: node + linkType: hard + +"y18n@npm:^5.0.5": + version: 5.0.8 + resolution: "y18n@npm:5.0.8" + checksum: 10c0/4df2842c36e468590c3691c894bc9cdbac41f520566e76e24f59401ba7d8b4811eb1e34524d57e54bc6d864bcb66baab7ffd9ca42bf1eda596618f9162b91249 + languageName: node + linkType: hard + +"yallist@npm:^3.0.2": + version: 3.1.1 + resolution: "yallist@npm:3.1.1" + checksum: 10c0/c66a5c46bc89af1625476f7f0f2ec3653c1a1791d2f9407cfb4c2ba812a1e1c9941416d71ba9719876530e3340a99925f697142989371b72d93b9ee628afd8c1 + languageName: node + linkType: hard + +"yallist@npm:^5.0.0": + version: 5.0.0 + resolution: "yallist@npm:5.0.0" + checksum: 10c0/a499c81ce6d4a1d260d4ea0f6d49ab4da09681e32c3f0472dee16667ed69d01dae63a3b81745a24bd78476ec4fcf856114cb4896ace738e01da34b2c42235416 + languageName: node + linkType: hard + +"yargs-parser@npm:^21.1.1": + version: 21.1.1 + resolution: "yargs-parser@npm:21.1.1" + checksum: 10c0/f84b5e48169479d2f402239c59f084cfd1c3acc197a05c59b98bab067452e6b3ea46d4dd8ba2985ba7b3d32a343d77df0debd6b343e5dae3da2aab2cdf5886b2 + languageName: node + linkType: hard + +"yargs@npm:^17.7.2": + version: 17.7.3 + resolution: "yargs@npm:17.7.3" + dependencies: + cliui: "npm:^8.0.1" + escalade: "npm:^3.1.1" + get-caller-file: "npm:^2.0.5" + require-directory: "npm:^2.1.1" + string-width: "npm:^4.2.3" + y18n: "npm:^5.0.5" + yargs-parser: "npm:^21.1.1" + checksum: 10c0/7a28572f7e785a57886e34fdbddb9b28756dec552e1453d5f6e7cdd00ad8721a4e8c4321d33683f5e61cacb36ad43258adbb48396b71ec4ed14abee0fc0d0c1f + languageName: node + linkType: hard + +"yauzl@npm:^2.10.0": + version: 2.10.0 + resolution: "yauzl@npm:2.10.0" + dependencies: + buffer-crc32: "npm:~0.2.3" + fd-slicer: "npm:~1.1.0" + checksum: 10c0/f265002af7541b9ec3589a27f5fb8f11cf348b53cc15e2751272e3c062cd73f3e715bc72d43257de71bbaecae446c3f1b14af7559e8ab0261625375541816422 + languageName: node + linkType: hard + +"zod@npm:^3.24.0": + version: 3.25.76 + resolution: "zod@npm:3.25.76" + checksum: 10c0/5718ec35e3c40b600316c5b4c5e4976f7fee68151bc8f8d90ec18a469be9571f072e1bbaace10f1e85cf8892ea12d90821b200e980ab46916a6166a4260a983c + languageName: node + linkType: hard + +"zustand@npm:^5.0.0": + version: 5.0.13 + resolution: "zustand@npm:5.0.13" + peerDependencies: + "@types/react": ">=18.0.0" + immer: ">=9.0.6" + react: ">=18.0.0" + use-sync-external-store: ">=1.2.0" + peerDependenciesMeta: + "@types/react": + optional: true + immer: + optional: true + react: + optional: true + use-sync-external-store: + optional: true + checksum: 10c0/e4e76af1c324c797e3cc6ef094cb15c5884ca6713697140c2be292b2c612f5445fa21d222671b97797a4376154cac14a140f05728f0ac17b4b9e10f45e0ff29e + languageName: node + linkType: hard