From 7f6e16f5d1d0a03ed380c9e01a121590500f1d8e Mon Sep 17 00:00:00 2001 From: Ben Ashton Date: Thu, 3 Dec 2026 15:10:17 -0700 Subject: [PATCH] Initial commit --- .gitignore | 27 ++ cgi/api.sh | 210 ++++++++ cgi/exprash.sh | 570 ++++++++++++++++++++++ index.html | 16 + package-lock.json | 882 ++++++++++++++++++++++++++++++++++ package.json | 20 + public/apple-touch-icon.png | Bin 0 -> 2525 bytes public/icon-192.png | Bin 0 -> 2673 bytes public/icon-512.png | Bin 0 -> 7364 bytes public/icon.svg | 6 + public/manifest.webmanifest | 15 + src/App.jsx | 931 ++++++++++++++++++++++++++++++++++++ src/main.jsx | 11 + src/styles.css | 157 ++++++ vite.config.js | 110 +++++ 15 files changed, 2955 insertions(+) create mode 100644 .gitignore create mode 100644 cgi/api.sh create mode 100644 cgi/exprash.sh create mode 100644 index.html create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/apple-touch-icon.png create mode 100644 public/icon-192.png create mode 100644 public/icon-512.png create mode 100644 public/icon.svg create mode 100644 public/manifest.webmanifest create mode 100644 src/App.jsx create mode 100644 src/main.jsx create mode 100644 src/styles.css create mode 100644 vite.config.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..17cbc84 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# Installed packages (recreated by `npm install`) +node_modules/ + +# Built app (recreated by `npm run build`) +dist/ + +# Data written by the local dev server: test profiles, password hashes and +# photos. The real data lives in the container on n0m.org. +data/ + +# Deploy credentials and other secrets +.env +.env.* +!.env.example + +# Logs +*.log + +# Claude Code per-machine settings +.claude/settings.local.json + +# Editor and OS clutter +.vscode/ +.idea/ +*.swp +.DS_Store +Thumbs.db diff --git a/cgi/api.sh b/cgi/api.sh new file mode 100644 index 0000000..71ea00e --- /dev/null +++ b/cgi/api.sh @@ -0,0 +1,210 @@ +#!/bin/bash +# Data API for the Climbing Tracker when hosted in an n0m.org files container. +# Each person has their own file: data/users/.json +# GET api.sh -> everyone's data as one JSON object, keyed by id +# GET api.sh?check= -> whether that person has a password, and whether +# the one sent with this request is correct +# PUT api.sh?user= -> replaces that person's data with the request body +# (needs their password; the first save sets it) +# PUT api.sh?user=&photo= +# -> saves a photo for one of that person's climbs as +# data/photos/-.jpg. The body is +# {"photo":""}, or {"photo":""} to +# delete it. Photos are shrunk in the browser first +# because n0m only accepts JSON bodies up to 100 KB. +# (Query strings are used instead of paths like api.sh/users/ because n0m +# never responds to a path that continues past a script's file name) +# +# Passwords: the browser never sends the password itself. It sends a token (a +# SHA-256 of the profile id and password) in the X-Auth header. What is kept in +# data/.auth/ is a SHA-256 of that token, hashed again together with a +# random secret (data/.auth/_pepper) that is created on first use. +# +# n0m will happily serve any ordinary file in the container, including ones in +# dot folders. It runs executable files instead of sending their contents +# though, so the secret files are made executable with a "#!/bin/true" first +# line: requesting one over the web runs "true" and returns nothing. +source exprash.sh + +redirect_stdout + +data_dir='data' +users_dir="$data_dir/users" +backups_dir="$data_dir/backups" +auth_dir="$data_dir/.auth" +photos_dir="$data_dir/photos" +max_photo_bytes=72000 +legacy_file="$data_dir/climbing-data.json" +pepper_file="$auth_dir/_pepper" +token="${HTTP_X_AUTH:-}" + +mkdir -p "$users_dir" "$backups_dir" "$auth_dir" "$photos_dir" + +sha256() { + sha256sum | cut -d ' ' -f 1 +} + +# $1: file path +# $2: secret value +write_secret() { + local secret_tmp + secret_tmp="$(mktemp "$data_dir/tmp.XXXXXX")" + printf '#!/bin/true\n%s\n' "$2" > "$secret_tmp" + chmod 700 "$secret_tmp" + mv "$secret_tmp" "$1" +} + +# $1: file path +read_secret() { + tail -n 1 "$1" +} + +if [ ! -s "$pepper_file" ]; then + write_secret "$pepper_file" "$(head -c 32 /dev/urandom | sha256)" +fi +pepper="$(read_secret "$pepper_file")" + +# $1: SHA-256 of a token +pepper_hash() { + printf '%s:%s' "$pepper" "$1" | sha256 +} + +# One-off upgrade of password files saved before the secret existed +for auth_file in "$auth_dir"/*; do + [ -f "$auth_file" ] || continue + if [ "$(head -c 2 "$auth_file")" != '#!' ]; then + write_secret "$auth_file" "$(pepper_hash "$(head -n 1 "$auth_file")")" + fi +done + +# $1: user id +valid_id() { + [[ "$1" =~ ^[a-z0-9]{4,24}$ ]] +} + +valid_token() { + [[ "$token" =~ ^[a-f0-9]{64}$ ]] +} + +token_hash() { + pepper_hash "$(printf '%s' "$token" | sha256)" +} + +# $1: user id +has_password() { + [ -s "$auth_dir/$1" ] +} + +# $1: user id +password_correct() { + valid_token && has_password "$1" && + [ "$(read_secret "$auth_dir/$1")" == "$(token_hash)" ] +} + +# One-off move of the original single-person data into Alysia's profile +if [ -s "$legacy_file" ] && [ ! -e "$users_dir/alysia.json" ] && + [ "$(head -c 1 "$legacy_file")" == '{' ] && [ "$(cat "$legacy_file")" != '{}' ] +then + migrate_tmp="$(mktemp "$data_dir/tmp.XXXXXX")" + { printf '{"name":"Alysia",'; tail -c +2 "$legacy_file"; } > "$migrate_tmp" + mv "$migrate_tmp" "$users_dir/alysia.json" + mv "$legacy_file" "$backups_dir/original-climbing-data.json" +fi + +get '/' && { + set_header 'Cache-Control' 'no-store' + if has_query 'check'; then + check_id="$(query 'check')" + ok='false' + has='false' + if valid_id "$check_id"; then + has_password "$check_id" && has='true' + password_correct "$check_id" && ok='true' + fi + printf '{"ok":%s,"hasPassword":%s}' "$ok" "$has" | send_json + else + { + printf '{' + separator='' + for user_file in "$users_dir"/*.json; do + [ -s "$user_file" ] || continue + user_id="$(basename "$user_file" .json)" + [[ "$user_id" =~ ^[a-z0-9]+$ ]] || continue + printf '%s"%s":' "$separator" "$user_id" + cat "$user_file" + separator=',' + done + printf '}' + } | send_json + fi +} + +put '/' && { + user_id="$(query 'user')" + tmp_file="$(mktemp "$data_dir/tmp.XXXXXX")" + cat > "$tmp_file" + + # n0m only passes the body through for valid JSON requests, so this is just + # a sanity check that we aren't about to save something empty or truncated + first_char="$(head -c 1 "$tmp_file")" + last_char="$(tail -c 1 "$tmp_file")" + if ! valid_id "$user_id" || + [ "$first_char" != '{' ] || [ "$last_char" != '}' ] + then + rm -f "$tmp_file" + status '400' + printf '{"ok":false}' | send_json + elif has_query 'photo'; then + photo_id="$(query 'photo')" + photo_file="$photos_dir/$user_id-$photo_id.jpg" + photo_tmp="$(mktemp "$data_dir/tmp.XXXXXX")" + sed -n 's/^{"photo":"\([A-Za-z0-9+\/=]*\)"}$/\1/p' "$tmp_file" | + base64 -d > "$photo_tmp" 2>/dev/null + photo_start="$(head -c 3 "$photo_tmp" | od -An -tx1 | tr -d ' \n')" + photo_bytes="$(wc -c < "$photo_tmp")" + + if ! valid_id "$photo_id"; then + status '400' + printf '{"ok":false}' | send_json + elif ! password_correct "$user_id"; then + status '403' + printf '{"ok":false,"auth":false}' | send_json + elif [ "$(cat "$tmp_file")" == '{"photo":""}' ]; then + rm -f "$photo_file" + printf '{"ok":true}' | send_json + # Only real JPEG files (they all start with the bytes FF D8 FF) are kept + elif [ "$photo_start" == 'ffd8ff' ] && [ "$photo_bytes" -le "$max_photo_bytes" ] + then + chmod 644 "$photo_tmp" + mv "$photo_tmp" "$photo_file" + printf '{"ok":true}' | send_json + else + status '400' + printf '{"ok":false}' | send_json + fi + rm -f "$tmp_file" "$photo_tmp" + elif ! valid_token || { has_password "$user_id" && ! password_correct "$user_id"; } + then + rm -f "$tmp_file" + status '403' + printf '{"ok":false,"auth":false}' | send_json + else + # A profile without a password yet is claimed by the first save + if ! has_password "$user_id"; then + write_secret "$auth_dir/$user_id" "$(token_hash)" + fi + user_file="$users_dir/$user_id.json" + # Keep one backup per person per day: their data before that day's first save + backup_file="$backups_dir/$user_id-$(date +'%Y%m%d').json" + if [ -s "$user_file" ] && [ ! -e "$backup_file" ]; then + cp "$user_file" "$backup_file" + fi + mv "$tmp_file" "$user_file" + printf '{"ok":true}' | send_json + fi +} + +(use || use_error) && { + status '404' + printf '{"ok":false}' | send_json +} diff --git a/cgi/exprash.sh b/cgi/exprash.sh new file mode 100644 index 0000000..6f1efbd --- /dev/null +++ b/cgi/exprash.sh @@ -0,0 +1,570 @@ +#!/bin/bash +# shellcheck disable=SC2034 # false flags nameref params +# shellcheck disable=SC2178 # false flags nameref params + +# ====================== +# Required shell options +# ====================== + +# Necessary for piping to "send" funciton +shopt -s lastpipe + +# =============== +# Setup Functions +# =============== + +# $1: Log file for redirecting stdout to +function redirect_stdout() { + local output="$1"; + [ -z "$output" ] && output="/dev/null"; + + exec 5<&1; + _exprash_redirect_stdout="$output"; + exec 1>>"$_exprash_redirect_stdout"; + printf '%s: %s\n' "${REQUEST_METHOD:-UNKNOWN}" "${PATH_INFO:-/}" +} + +# ============= +# Route Function +# ============= + +# $1: path +function get() { + [ "$REQUEST_METHOD" != "GET" ] && return 1; + all "$1"; +} + +# $1: path +function post() { + [ "$REQUEST_METHOD" != "POST" ] && return 1; + all "$1"; +} + +# $1: path +function put() { + [ "$REQUEST_METHOD" != "PUT" ] && return 1; + all "$1"; +} + +# $1: path +function delete() { + [ "$REQUEST_METHOD" != "DELETE" ] && return 1; + all "$1"; +} + +# $1: path +function all() { + [ "$_exprash_route_handled" -eq 1 ] && return 1; + [ -n "$_exprash_error_message" ] && return 1; + + # Reset params + _exprash_params=(); + + _path_match "$1" _exprash_params || return 1; + _exprash_route_handled=1; + + return 0; +} + +function use() { + [ "$_exprash_route_handled" -eq 1 ] && return 1; + [ -n "$_exprash_error_message" ] && return 1; + + _exprash_route_handled=1; + return 0; +} + +# ===================== +# Error Route Functions +# ===================== + +# $1: path +function get_error() { + [ "$REQUEST_METHOD" != "GET" ] && return 1; + all_error "$1"; +} + +# $1: path +function post_error() { + [ "$REQUEST_METHOD" != "POST" ] && return 1; + all_error "$1"; +} + +# $1: path +function put_error() { + [ "$REQUEST_METHOD" != "PUT" ] && return 1; + all_error "$1"; +} + +# $1: path +function delete_error() { + [ "$REQUEST_METHOD" != "DELETE" ] && return 1; + all_error "$1"; +} + +# $1: path +function all_error() { + [ "$_exprash_route_handled" -eq 1 ] && return 1; + [ -z "$_exprash_error_message" ] && return 1; + + # Reset params + _exprash_params=(); + + _path_match "$1" _exprash_params || return 1; + _exprash_route_handled=1; + + return 0; +} + +function use_error() { + [ "$_exprash_route_handled" -eq 1 ] && return 1; + [ -z "$_exprash_error_message" ] && return 1; + + _exprash_route_handled=1; + return 0; +} + +# ==== +# Next +# ==== + +# $1 (optional): error message +function next() { + _exprash_route_handled=0; + [ -n "$1" ] && _exprash_error_message="$1"; +} + +# ============= +# App Functions +# ============= + +function get_error_message() { + printf '%s' "$_exprash_error_message"; +} + +function has_error_message() { + [ -n "$_exprash_error_message" ]; +} + +# ================= +# Request Functions +# ================= + +# $1: param name +function param() { + printf '%s\n' "${_exprash_params[$1]}"; +} + +function has_param() { + [[ -v "_exprash_params[$1]" ]]; +} + +# $1: key +# $2: (optional) index for accessing array parameters +function query() { + _multi_get _exprash_query "$1" "$2" +} +# $1: key +function has_query() { + _multi_has _exprash_query "$1" +} +# $1: key +function len_query() { + _multi_len _exprash_query "$1" +} + +# Call this function to parse URLencoded request bodies +function use_body() { + if [[ "${HTTP_CONTENT_TYPE,,}" == "application/x-www-form-urlencoded" ]]; + then + _parse_url_encoded _exprash_body + fi +} +# $1: key +# $2: (optional) index for accessing array parameters +function body() { + _multi_get _exprash_body "$1" "$2" +} +# $1: key +function has_body() { + _multi_has _exprash_body "$1" +} +# $1: key +function len_body() { + _multi_len _exprash_body "$1" +} + +# $1: key +function cookie() { + printf '%s' "${_exprash_cookies[$1]}" +} +# $1: key +function has_cookie() { + [[ -v "_exprash_cookies[$1]" ]] +} +# $1: key +# $2: value +function set_cookie() { + _exprash_set_cookies["$1"]="$2" +} + +# ================== +# Response Functions +# ================== + +function send() { + if [ "$_exprash_headers_sent" -eq 0 ]; then + send_headers + _exprash_headers_sent=1 + fi + + _send_raw +} + +function send_json() { + set_header 'Content-Type' 'application/json' + send +} + +# $1: Path +function redirect() { + local path="$1" + if [ "$path" == 'back' ]; then + path="${HTTP_REFERER:-/}" + fi + + status '302' + set_header 'Location' "$path" + printf 'Redirecting to: %s' "$path" | send +} + +# $1: satus code +function status() { + set_header "Status" "$1" +} + +# $1: Header Name +# $2: Header Value +function set_header() { + _exprash_headers["$1"]="$2" +} + +function send_headers() { + printf '%s\n' "Content-Type: ${_exprash_headers['Content-Type']}" | \ + _send_raw + for key in "${!_exprash_headers[@]}"; do + [ "$key" == 'Content-Type' ] && continue + printf '%s\n' "${key}: ${_exprash_headers[$key]}" | \ + _send_raw + done; + for key in "${!_exprash_set_cookies[@]}"; do + printf '%s\n' "Set-Cookie: ${key}=${_exprash_set_cookies[$key]}" | \ + _send_raw + done; + printf '\n' | _send_raw +} + + +# ======= +# Session +# ======= + +# Call this function to automatically manage sessions +# $1: (optional) session dir, defaults to "session" in the current directory +function use_session() { + local session_dir=$1 + + # Create default session directory + if [ -z "$session_dir" ]; then + session_dir="./session" + mkdir -p "$session_dir" + fi + + # Setup session globals + _exprash_use_session=1 + _exprash_session_dir=$session_dir + + _load_session || _create_session || return 1 +} + +# Set a session variable +# $1: variable name +# $2: (optional) vairable value +function session() { + local name="$1" + if [[ -v 2 ]]; then + local value="$2" + _exprash_session["$name"]="$value" + else + printf '%s' "${_exprash_session["$name"]}" + fi +} + +# ========= +# Internals +# ========= + +function _send_raw() { + [ -n "$_exprash_redirect_stdout" ] && exec >&5; + cat; + [ -n "$_exprash_redirect_stdout" ] && exec 1>>"$_exprash_redirect_stdout"; +} + +# $1: path +# $2: (nameref) array +function _path_to_array() { + readarray -t "$2" < <(printf '%s\n' "$1" | tr '/' '\n' | grep .); +} + +# $1: route +# $2: (nameref) associative array for params +function _path_match() { + [ -z ${PATH_INFO+x} ] && return 1; + [ -z ${1+x} ] && return 1; + + local path="$PATH_INFO"; + local route="$1"; + + # Params associative array + local -n route_params="$2"; + + local path_arr; + _path_to_array "$path" path_arr; + + local route_arr; + _path_to_array "$route" route_arr; + + # Get max path length + local route_len=${#route_arr[@]}; + local path_len=${#path_arr[@]}; + local maxLen=$(( route_len >= path_len ? route_len : path_len )); + + for ((i=0; i "$session_file" +} + +# ================= +# Utility Functions +# ================= + +# $1 | stdin: string to trim +function _trim() { + local str="${1-"$(< /dev/stdin)"}" + + # trim leading spaces + str="${str#"${str%%[![:space:]]*}"}" + # trim trailing spaces + str="${str%"${str##*[![:space:]]}"}" + + printf '%s' "$str" +} + +# ======== +# Shutdown +# ======== + +function _exprash_shutdown() { + _save_session +} + +# ============== +# Initialization +# ============== +function _exprash_init() { + _exprash_redirect_stdout='' + + declare -gA _exprash_params=() + declare -gA _exprash_body=() + declare -gA _exprash_query=() + declare -gA _exprash_headers=() + declare -gA _exprash_cookies=() + declare -gA _exprash_set_cookies=() + + _exprash_use_session=0 + _exprash_session_dir='' + _exprash_sessionId='' + declare -gA _exprash_session=() + _exprash_session_cookie_name='exprash_session' + + _exprash_route_handled=0 + _exprash_error_message='' + _exprash_headers_sent=0 + _exprash_headers['Content-Type']='text/html' + + # Parse query string + _parse_url_encoded _exprash_query "$QUERY_STRING" + + # Parse cookies + _parse_cookies _exprash_cookies "$HTTP_COOKIE" +} + +# Shutdown trap +trap _exprash_shutdown EXIT + +# Initialize exprash +_exprash_init + diff --git a/index.html b/index.html new file mode 100644 index 0000000..f3a5f8a --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + + + + Climbing Tracker + + +
+ + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..70fb119 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,882 @@ +{ + "name": "climbing-tracker", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "climbing-tracker", + "version": "0.1.0", + "dependencies": { + "@vitejs/plugin-react": "^6.3.0", + "react": "^19.3.1", + "react-dom": "^19.3.1", + "vite": "^8.4.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.160.0.tgz", + "integrity": "sha512-gw4k9syEmnckbOgw2A2FU1TBDdX9hfwV9jEn/uio65pguPzwWiXQS3OIJDMEhv9m06tj9XiEe6RoD0YA+LgreA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.3.4.tgz", + "integrity": "sha512-xCW8CkL/ualx/SbYqeG9iK87lJCZGDQ0soE+kaORJ0Bd+pHALyE4qK7BStmEAyYWLEzZ3/biSIpA6/7GDFvzIg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.3.4.tgz", + "integrity": "sha512-5lifIO+b/prcM9sx/bkPN4w6UEToEfQ3gjhx0+0neuL+dkYskI792CfAq03T51jc8JFcaYXs2hi3l8RjiH/VWQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-RCgxTI4AJQxhVF//BI3ImQOsXTHrF4Eg+f99jBy8WoETA2kSEGFxpnrVmW0leQq/2aBR4R5AC6csmy3rc66e3Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.3.4.tgz", + "integrity": "sha512-zNPJVVPUaDEj+L0lImoK3rFv2b+Z5gNijI6DWu/fcD3/1TfmRXKb9ZyxbSN+2AhlctqjbNzUvCsMa+EBhnEM4Q==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.3.4.tgz", + "integrity": "sha512-upP6g7ZIRy5by1RDQ/EphHIdJ5xK0eUD7sUgfZFWJ49s4XdbYsIvIlAPtrFpayR70Hhf9J22lb4Pm8/9FhrZmg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.3.4.tgz", + "integrity": "sha512-SAX5C5+poMLCxu8dkPF6h5yst40rkzs+9Y3cbPn2OFSydmHjAEprrGi64zGgnYyPIVZfdGUFqJ2fJbfbnHI+mA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.3.4.tgz", + "integrity": "sha512-nwHqdlRZS6GWBef3dG5/pMY6RNTBBUjj7s0Da+m6xsFpe7jx6IC46SLZcCu8f46JOfCovZmwnrz51EzGE+7Fyw==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.3.4.tgz", + "integrity": "sha512-Gr78X2ur/AgLCkmZgHffk/FerIX8S5zb/eII4bCcvJo0ANzeXhTShahdNbpnY6bpiszIAgIfiuKS9ziziWsamw==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.3.4.tgz", + "integrity": "sha512-o9Wcn8nWrsQasaBRYM4d//FwhlBsTJYWkPVlhlt6FwzpwEoovY4IopRZjk5Fq3+ntRuSDORJjF/nA8sFeF2q6w==", + "cpu": [ + "ppc64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.3.4.tgz", + "integrity": "sha512-UDWu4jkVcx2kiBKm3Ec//4lVCbeTWj8gmJ9SyLWCdLWtTlyq7fQVeVV/14nXvRtSLErvJ2+yA/Ux5taS31Y17Q==", + "cpu": [ + "s390x" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.3.4.tgz", + "integrity": "sha512-W9mGtTa0w4fWh8RLMNPyaEhhcuqUfO07Q4I1bBc4PDMNg7gQSw0yPQNQ3D0qwbkXwxbyL4YrIzc8n6k1vuFExQ==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.3.4.tgz", + "integrity": "sha512-8B+ofyQZ7/aCmkqnyMonPr5zKLqMVNczhRGFNtdIuItiwNn8iQWJawMq2E58r7bxD1XEbtRRsULY/eCWwZQ01Q==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.3.4.tgz", + "integrity": "sha512-TlD0FSZaC7o2B4NCe9V5N11ugTnhzTM9ksj4sgRLvrKosDzjEkvlsTX3ehkw4ZlPv8AADimZZTvJGEa16pfXug==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.3.4.tgz", + "integrity": "sha512-jwO8P3o53ygo7b5061B7BeaJ1BGv3BKZ6jroFdw/01qWry7Z+qNBlDvulzbTle5s/A0Fc1FRgsTxrke9DvsSbA==", + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@oxc-project/types": "0.160.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.3.4.tgz", + "integrity": "sha512-8adGMrNtrdzi2WD1ozhYapER59gD8Q/DV6SCKJlyG2HqULPdeQUBvMa33lTsiEYwIqTZUaIU2MmvPp5f1wbtXA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.3.4.tgz", + "integrity": "sha512-rIMjtESdXJCIoOiUTroQ1Y1rjVDZkuUVRUxs3APX2vNv175D7TDWvzdELiIhzGq9cUNUFat+co+PTmPHPqSREg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "license": "MIT" + }, + "node_modules/@vitejs/plugin-react": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-6.3.0.tgz", + "integrity": "sha512-H9E955aVvD2F4zNHCw4eIZbIfF6xKldlh7MNu+hSU7xwQzh65lI/N+CJWqmfhi0PEjDXIt/H7T7J/4wU63KJiw==", + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0 || ^0.3.0", + "babel-plugin-react-compiler": "^1.0.0", + "oxc-transform-react": ">=0.152.0 <0.157.0", + "vite": "^8.0.0" + }, + "peerDependenciesMeta": { + "@rolldown/plugin-babel": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "oxc-transform-react": { + "optional": true + } + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/napi-windows-process-start-time": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/napi-windows-process-start-time/-/napi-windows-process-start-time-0.1.0.tgz", + "integrity": "sha512-zHxhzKsIFu3elch3eFw69WEUGc79DFhbc3nD/WEOzWL/pFFLZRW13EHnuO0c+0YjncE5uCaS9ICHxOBXkb6vPw==", + "cpu": [ + "x64", + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.34", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.34.tgz", + "integrity": "sha512-P1Qzj0XXZjMda74C7qiVnBG90UKNbyNUAOeQRBW8X63RsIMV57gevRqjnkELdwtZ/S2/uQFksJhmwuN8xShLPw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.4" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.1" + } + }, + "node_modules/rolldown": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.3.4.tgz", + "integrity": "sha512-p2rq4bfBmF0M6yaR8+A89fbkBQynZI2fxUW4G07eq9kpctAkpo7q5BZ4X4Mo4XZ7HHROu33cX9PeopUFN6u+2Q==", + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.160.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.3.4", + "@rolldown/binding-android-arm64": "1.3.4", + "@rolldown/binding-darwin-arm64": "1.3.4", + "@rolldown/binding-darwin-x64": "1.3.4", + "@rolldown/binding-freebsd-x64": "1.3.4", + "@rolldown/binding-linux-arm-gnueabihf": "1.3.4", + "@rolldown/binding-linux-arm64-gnu": "1.3.4", + "@rolldown/binding-linux-arm64-musl": "1.3.4", + "@rolldown/binding-linux-ppc64-gnu": "1.3.4", + "@rolldown/binding-linux-s390x-gnu": "1.3.4", + "@rolldown/binding-linux-x64-gnu": "1.3.4", + "@rolldown/binding-linux-x64-musl": "1.3.4", + "@rolldown/binding-openharmony-arm64": "1.3.4", + "@rolldown/binding-wasm32-wasi": "1.3.4", + "@rolldown/binding-win32-arm64-msvc": "1.3.4", + "@rolldown/binding-win32-x64-msvc": "1.3.4" + } + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.3.0.tgz", + "integrity": "sha512-pdUVfIWcK0kCgK831ibqkZDcL7I9zljjOu0TQFnA+fiQ6y1CYqYB7RkTOHHO45FGMg5P/Mvk/+4ToQ7gAYAL5Q==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/vite": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.4.0.tgz", + "integrity": "sha512-X2nUJg+9cutlz3hzqyO6p+WTwk9H257DjwAEf9EQYUFrQbDItmetadi9gYmb+l7VDy4r3VXLUnmLTwuPmzejDw==", + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.33", + "rolldown": "~1.3.2", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3", + "napi-windows-process-start-time": "^0.1.0" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..2390b3b --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "climbing-tracker", + "private": true, + "version": "0.1.0", + "type": "module", + "config": { + "slug": "act" + }, + "scripts": { + "dev": "vite", + "build": "vite build && cp cgi/api.sh cgi/exprash.sh dist/ && chmod 755 dist/api.sh", + "upload": "npm run build && rsync -avH --exclude 'data/' -e 'ssh -p 24' ./dist/ \"ben@n0m.org:/home/ben/n0m/current/files/$npm_package_config_slug/\"" + }, + "dependencies": { + "@vitejs/plugin-react": "^6.3.0", + "react": "^19.3.1", + "react-dom": "^19.3.1", + "vite": "^8.4.0" + } +} diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..54e8bc324128e464880b59131ca3ee5f04567d59 GIT binary patch literal 2525 zcmd5;iB}Tp5;rUL*7Mq8o06tbrkPphQbKBK=AM$d++1>L5fyPsh{$90E~$W_DMl!D zF>)yhcLlT*(W|D03z&)mF1h5srpDvGf8xC}zwev#oB7VnoH=K{Gs)N798`B{>{3ur zP<6a&=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bA^>V--pu!c%DRSRKW8d%>A^Tm$j{B0g%tHw{e=6kf(?KTpPb174!@BZj{h{bv(RnqX>|Wb7op1ojjbdaheu9fe z3@=NQ^8%gbMW#DRg#oUV%tngwzH@}6F#_<*?JYCF)PT8Aqd$f=G{wq7nw9F8WED;p z;Jd zG{mA0->)uqX;(3?HShs!Xp*l44;}>MzndvF`Il5);#6_u;R)f!Qb)*fqGWCoMbe|6 zwj4Osupd9_)o+#XMMzm^p!$yU;|T(SUJXps(2`Pk5_oj*NaAf)PVv34N3yiUMVpG; z&WL(;4EL{i=wKgU^StgKj3cj<{DKwn+Kp)gARc`TBT8Wq7zdpuImbNK4bfHS$@5JhMx%G`~RAO6T2-nQ@vwjees^ zJUys1#tiH3=34;j`agjyaAZFX2cv1Zf0;(_Z6sQ*$)x*J$_>Qhok1d&cZ)4V?JBMn$$#fwN)h%D@i^Z0~bouwmq&7b2_H;`~MNP a)J|ejg6ht@smu2@1xI@~yW-11kN*Sxf#weY literal 0 HcmV?d00001 diff --git a/public/icon-192.png b/public/icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..6b839e6ab311b36b655f3e3837f0bd20b4b7251e GIT binary patch literal 2673 zcmc&$`8ONd7LJ%g1=T7_G`CgN*3?@(Gi@pAiXnzlts2{ypD~7Ls`nYMu^Jr^EfpG? znoGpgnr;zk#5^{HAQX+XF}-+y!TagGb=E$6t#5yOt#kJJ&RJio9n1nOdRi0!0D!G5 z%^Y~S{U|^{-ag&BYsX7MUe*?7fWxCzOu{_{07R9o%&s{i3s_Ukkdqup&t_9plu<1% zi(MV?s-Dz+Z0wj$Lv@F)P+;cViT>lKfsPr&DFU}>m|REyb58GGTI>sROC7Lf4p?)0 zhkD0y1WoI@efmquRDcyI(+lQ7T<6E-bnGZ@PrsNA@iQSj|^{HM?D9<&6CdgsPtOz`RViln*qziLX2yr`UOzRi>s+GYJ;*|%4!SFiWvAa zWCZ6uqV-Vk=eYBfj-BB_tpAI?%~#~QelatK&D|_dPzs-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12X4zxIiY+_KfQ59zBi3~nO-gQM*wSiY= zun>LExw8|Ts57D6b`2+h-1+aXvx7&R2~tk`U6iNz5eyp@C!|P=M0|VBA0;zxTs*^; z7n+=~F*36*jiOPh)}xc)Sr+Ct)e^@_u3lN5%fw zkr3J6e_b4Ni~{$TG^=Oc**_amhmW@SQszWxguBZc2hO|#)Q+(@&V{ z!1j6dP!I-!KlTQv)pFcM@R}|*i1Fy?4R2DK;h1tUckAyKA)U1^_e!WcAl}=VAnW5li^K_NjZ;JJmlUI_@a6FdOVCxPh0j8KPRX}C6b##ArJZZPENgA> zjc;aHT^sX_c*$XdLs(3Ie@~LAjufTYn?(L_&-|3Ta2_275vD(ic)5xWo2{Tb?q$KY z<%jHQK9$LoA4}h+AYlBzH^6%;kcx#2Ehs#CWlWr0LNyff>3~5d=c6KC64A(mAn$ZC z1+fmS3B+Zx1hn?|Iz&eB$kQHtt}XDMC|!j@h6+^KATltyk%Gtsau0?q>*@;FmykV^ z%UT+IywRFWk)E(Gtv$w55bD6N6&U1csP^mjE^>c`L1h0Y^0L-0x_|`lF)a8Cc2&H0 z^9bx))}o`+JaL&ZNZCR^IlIlZ;VTln^ZM~g(_oNo%`=65QFC6C72b*sCDcIRrNKgd zhNrIn02KOu@QEJ(CkjG{PkNij{BXLkK_7b5{gi^h^LHLK%Q5P-j-XfU5-O$$q`?tP z;4C#(8G0SR#JR&&^+TApwe4j-OXffJq3yIpL(>1p@BCM0tM3pnwpgZKHyM0`=OF=B M<}kDO*Y79(8yk28r2qf` literal 0 HcmV?d00001 diff --git a/public/icon-512.png b/public/icon-512.png new file mode 100644 index 0000000000000000000000000000000000000000..84ec415bc9d61e8cc035c0591105b066620de52d GIT binary patch literal 7364 zcmeHMX*|^3+dngrK^Ri*EJGy8QpvuJinQ3uHnJwNWQ~c&Hb|06rHDduM|P5JY$Kr} zOZI)FEHjpooxyYJ{&&BBUOca!|7TvzIOkfw=eoYv@%u#?8R&Ab@v{K{IL@BYz6byk z{zL-Qude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ejN4EuR0@GgNF+t%KZQT7$s7lJR#pUXCjMa{iaCspAK`UQ*4W2a zEyOSMEkyYO6PcTop7bKIP|tWtgjfTk{k8NPc+DE58w70v4K^JA)IEyRj79Ah=#4op zO{{`G(ZQ$O6*Zqt@T%FV!JSahD;aw(=`ZX{*l5piLT+kEJBe8bcIC*f+7dBP($`&a z+j=iC4elI4+Qr<(F*2iEU_!O^0@Qy^84H+@$SM>OL)wLN3~2 zQftZGh(kmFf?p2z4+j3O*dENE;*bwJV>J_ zZY1hzGAjh?7nwxsg1hf!bU_WI_<0oh8|0lqUo@TDjD;@>UMv6L56;(7DfVchPJus) zE(SMG(Xie)_}CgS!$;izebw^cS5W_V@7=b!u={pzv>9iH!`G7Ftd4 + + + + + diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest new file mode 100644 index 0000000..fd20be4 --- /dev/null +++ b/public/manifest.webmanifest @@ -0,0 +1,15 @@ +{ + "name": "Climbing Tracker", + "short_name": "Climbing", + "description": "Log climbs, see progress and plan sessions", + "start_url": "./", + "scope": "./", + "display": "standalone", + "background_color": "#f6f4ef", + "theme_color": "#2f6f5e", + "icons": [ + { "src": "icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" }, + { "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" }, + { "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } + ] +} diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..1baf332 --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,931 @@ +import { useEffect, useState } from 'react' + +// ---------- Settings you can easily change ---------- +const GRADES = ['VB', 'V0', 'V1', 'V2', 'V3', 'V4', 'V5', 'V6', 'V7', 'V8', 'V9', 'V10', 'V11', 'V12'] +const STYLES = ['Slab', 'Vertical', 'Overhang', 'Roof', 'Other'] +// Hold colours you can pick for a climb, and the shade used for the little dot +const COLOURS = { + Red: '#d64545', Orange: '#e8862e', Yellow: '#e9c935', Green: '#3f9b57', Blue: '#3a7bd5', Purple: '#8457c2', + Pink: '#e57fb0', Black: '#222222', White: '#ffffff', Grey: '#8d9299', Brown: '#8a5a3c', +} + +// ---------- Date helpers ---------- +const pad = (n) => String(n).padStart(2, '0') +const toStr = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}` +const today = () => toStr(new Date()) +const parse = (s) => { const [y, m, d] = s.split('-').map(Number); return new Date(y, m - 1, d) } +const dayIndex = (s) => (parse(s).getDay() + 6) % 7 // 0 = Monday +const weekStart = (s) => { const d = parse(s); d.setDate(d.getDate() - dayIndex(s)); return toStr(d) } +const niceDate = (s) => parse(s).toLocaleDateString(undefined, { weekday: 'short', day: 'numeric', month: 'short', year: 'numeric' }) +const newId = () => Date.now().toString(36) + Math.random().toString(36).slice(2, 6) + +const EMPTY = { climbs: [], goals: [], planChecks: {}, sessions: [], rsvps: {}, groupItems: [], seenSessions: [] } + +const LOGIN_KEY = 'climbing-tracker-login' +const TAB_KEY = 'climbing-tracker-tab' +const TABS = [['log', 'Log a climb'], ['sessions', 'Sessions'], ['progress', 'Progress'], ['goals', 'Goals'], ['friends', 'Friends']] +const MIN_PASSWORD = 4 +const withDefaults = (p) => ({ ...EMPTY, ...p, name: p.name || 'Unnamed' }) + +// The password itself never leaves this device. What gets sent (and remembered +// here so you stay signed in) is a scrambled version of it. +async function makeToken(id, password) { + const bytes = new TextEncoder().encode(`climbing-tracker:${id}:${password}`) + const hash = await crypto.subtle.digest('SHA-256', bytes) + return [...new Uint8Array(hash)].map((b) => b.toString(16).padStart(2, '0')).join('') +} + +// Photos are shrunk on your device before they are sent, so they upload quickly +// and stay under the website's size limit (about 64 KB each) +const MAX_PHOTO_BYTES = 64000 +const photoUrl = (owner, photoId) => `data/photos/${owner}-${photoId}.jpg` + +async function compressPhoto(file) { + const img = new Image() + const url = URL.createObjectURL(file) + try { + await new Promise((resolve, reject) => { img.onload = resolve; img.onerror = reject; img.src = url }) + // Try big and sharp first, then step down until the photo is small enough + for (const longest of [1280, 1024, 800, 640, 480, 320]) { + const scale = Math.min(1, longest / Math.max(img.naturalWidth, img.naturalHeight)) + const canvas = document.createElement('canvas') + canvas.width = Math.round(img.naturalWidth * scale) + canvas.height = Math.round(img.naturalHeight * scale) + canvas.getContext('2d').drawImage(img, 0, 0, canvas.width, canvas.height) + for (const quality of [0.8, 0.65, 0.5, 0.4]) { + const blob = await new Promise((resolve) => canvas.toBlob(resolve, 'image/jpeg', quality)) + if (blob && blob.size <= MAX_PHOTO_BYTES) return blob + } + } + throw new Error('Photo could not be made small enough') + } finally { + URL.revokeObjectURL(url) + } +} + +const toBase64 = (blob) => new Promise((resolve, reject) => { + const reader = new FileReader() + reader.onload = () => resolve(reader.result.split(',')[1]) + reader.onerror = reject + reader.readAsDataURL(blob) +}) + +// Talks to the saved data. query is e.g. '' or '?user=abc' +function api(query, token, body) { + const headers = {} + if (token) headers['X-Auth'] = token + if (body) headers['Content-Type'] = 'application/json' + return fetch(`api.sh${query}`, { method: body ? 'PUT' : 'GET', cache: 'no-store', headers, body }).then((r) => r.json()) +} + +export default function App() { + const [all, setAll] = useState(null) // everyone's data, by profile id + const [login, setLogin] = useState(() => { + try { return JSON.parse(localStorage.getItem(LOGIN_KEY)) } catch { return null } + }) + // The tab you were last on is remembered on this device, so a refresh keeps you there + const [tab, setTabState] = useState(() => { + const saved = localStorage.getItem(TAB_KEY) + return TABS.some(([k]) => k === saved) ? saved : 'log' + }) + const setTab = (k) => { localStorage.setItem(TAB_KEY, k); setTabState(k) } + const [saveError, setSaveError] = useState(false) + const [notice, setNotice] = useState('') + + const load = () => api('').then((d) => { if (d.ok === false) throw new Error(); setAll(d); setSaveError(false) }) + .catch(() => setSaveError(true)) + + useEffect(() => { + load() + // Reload when coming back to the page, and every minute while it's open, + // so everyone's climbs and new sessions show up without refreshing + const onVisible = () => { if (document.visibilityState === 'visible') load() } + document.addEventListener('visibilitychange', onVisible) + const timer = setInterval(onVisible, 60000) + return () => { document.removeEventListener('visibilitychange', onVisible); clearInterval(timer) } + }, []) + + const logIn = (id, token) => { + localStorage.setItem(LOGIN_KEY, JSON.stringify({ id, token })) + setLogin({ id, token }); setNotice('') + } + const logOut = (message = '') => { localStorage.removeItem(LOGIN_KEY); setLogin(null); setNotice(message) } + + // Saves one person's profile. The server refuses it unless the password matches. + const save = (id, person, token) => { + setAll((a) => ({ ...a, [id]: person })) + return api(`?user=${id}`, token, JSON.stringify(person)) + .then((r) => { + if (r.auth === false) { logOut('That password was not accepted. Please sign in again.'); load() } else setSaveError(!r.ok) + return r + }) + .catch(() => { setSaveError(true); return { ok: false } }) + } + + const me = login?.id + const data = all && login?.token && all[me] ? withDefaults(all[me]) : null + // Only ever saves your own profile, never anyone else's + const update = (changes) => save(me, { ...data, ...changes }, login.token) + + // New sessions: upcoming ones someone else added that you haven't looked at or answered yet + const [fresh, setFresh] = useState([]) // shown with a "New" tag for the rest of this visit + const sessionList = data ? allSessions(all) : [] + const unseen = data ? sessionList.filter((s) => s.date >= today() && s.owner !== me && !data.rsvps[s.id] && !data.seenSessions.includes(s.id)) : [] + useEffect(() => { + // Opening the Sessions tab counts as having seen them + if (tab !== 'sessions' || unseen.length === 0) return + const ids = unseen.map((s) => s.id) + setFresh((f) => [...f, ...ids]) + update({ seenSessions: [...data.seenSessions.filter((id) => sessionList.some((s) => s.id === id)), ...ids] }) + }, [tab, unseen.length]) + + const photos = { + upload: async (photoId, blob) => api(`?user=${me}&photo=${photoId}`, login.token, JSON.stringify({ photo: await toBase64(blob) })).catch(() => ({ ok: false })), + remove: (photoId) => api(`?user=${me}&photo=${photoId}`, login.token, JSON.stringify({ photo: '' })).catch(() => ({ ok: false })), + } + + return ( +
+
+

🧗 Climbing Tracker

+ {data && ( + <> +

Climbing as {data.name} ·

+ + + )} +
+ {saveError &&

Couldn't reach your saved data, so recent changes may not be saved. Try refreshing the page.

} + {data && tab !== 'sessions' && unseen.length > 0 && ( +
+
+ 🔔 {unseen.length === 1 ? 'New session' : `${unseen.length} new sessions`} + {unseen.map((s) =>

{sessionWhen(s)}{s.gym && ` · ${s.gym}`} · added by {s.ownerName}

)} +
+ +
+ )} + {!all ? (!saveError &&

Loading…

) : !data ? : ( +
+ {tab === 'log' && } + {tab === 'sessions' && } + {tab === 'progress' && } + {tab === 'goals' && } + {tab === 'friends' && } +
+ )} +
+ ) +} + +// ---------- Welcome screen (sign in or create a profile) ---------- +function Welcome({ all, notice, logIn, save }) { + const [picked, setPicked] = useState(null) // { id, hasPassword } + const [name, setName] = useState('') + const [password, setPassword] = useState('') + const [error, setError] = useState('') + const [busy, setBusy] = useState(false) + + const people = Object.entries(all).map(([id, p]) => [id, withDefaults(p)]).sort((a, b) => a[1].name.localeCompare(b[1].name)) + const taken = people.some(([, p]) => p.name.toLowerCase() === name.trim().toLowerCase()) + const tooShort = password.length < MIN_PASSWORD + + const pick = async (id) => { + setError(''); setPassword('') + const r = await api(`?check=${id}`).catch(() => null) + if (!r) return setError("Couldn't reach the saved data. Please try again.") + setPicked({ id, hasPassword: r.hasPassword }) + } + const back = () => { setPicked(null); setPassword(''); setError('') } + + const signIn = async (e) => { + e.preventDefault() + if (tooShort) return setError(`Passwords have at least ${MIN_PASSWORD} characters.`) + setBusy(true); setError('') + const token = await makeToken(picked.id, password) + // A profile with no password yet gets this one, by saving it once + const r = picked.hasPassword + ? await api(`?check=${picked.id}`, token).catch(() => ({})) + : await save(picked.id, all[picked.id], token) + setBusy(false) + if (r.ok) logIn(picked.id, token) + else setError(picked.hasPassword ? "That password isn't right. Please try again." : "Couldn't set the password. Please try again.") + } + + const create = async (e) => { + e.preventDefault() + if (!name.trim() || taken) return + if (tooShort) return setError(`Choose a password with at least ${MIN_PASSWORD} characters.`) + setBusy(true); setError('') + const id = newId() + const token = await makeToken(id, password) + const r = await save(id, { name: name.trim(), ...EMPTY }, token) + setBusy(false) + if (r.ok) logIn(id, token) + else setError("Couldn't create your profile. Please try again.") + } + + if (picked) { + const person = withDefaults(all[picked.id] || {}) + return ( +
+

Hi {person.name}!

+
+ + {!picked.hasPassword &&

You'll need it to sign in on another phone or computer, so pick something you'll remember.

} + {error &&

{error}

} + + +
+
+ ) + } + + return ( +
+

Who's climbing?

+ {notice &&

{notice}

} + {people.length > 0 && ( + <> +

Tap your name if you've been here before.

+
+ {people.map(([id, p]) => )} +
+ + )} +
+ + + {taken &&

That name is already taken. Tap it above, or pick a different one.

} + {error &&

{error}

} + +
+
+ ) +} + +// ---------- Log tab ---------- +// A drop-down whose options are shared by everyone, with a way to add a new one +function ListPicker({ value, onChange, options, noun }) { + const [adding, setAdding] = useState(false) + const list = [...options] + if (value && !adding && !list.includes(value)) list.push(value) + list.sort((x, y) => x.localeCompare(y)) + if (adding || list.length === 0) { + return ( + <> + onChange(e.target.value)} /> + {list.length > 0 && } + + ) + } + return ( + + ) +} + +const sameText = (x, y) => (x || '').trim().toLowerCase() === (y || '').trim().toLowerCase() +// Collects one field from everyone's climbs, without repeats +function sharedList(all, field, keep = () => true) { + const list = [] + Object.values(all).forEach((p) => (p.climbs || []).forEach((c) => { + if (c[field] && keep(c) && !list.some((x) => sameText(x, c[field]))) list.push(c[field]) + })) + return list +} +// If a typed name is already on the list, use the list's spelling +const tidy = (list, name) => list.find((x) => sameText(x, name)) ?? name.trim() + +const ColourDot = ({ colour }) => (COLOURS[colour] ? : null) + +// The description of one climb, used in your list and when viewing a friend +function ClimbInfo({ c }) { + return ( +
+ {c.colour && `${c.colour} · `}{c.style} {c.sent ? '· ✅ Sent' : '· 🔁 Project'} + {niceDate(c.date)}{c.gym && ` · ${c.gym}`}{c.wall && ` · ${c.wall}`} + {c.notes && {c.notes}} +
+ ) +} + +// A small picture of the climb; tap it to see it full size +function Photo({ owner, c }) { + const [open, setOpen] = useState(false) + if (!c.photo) return null + const src = photoUrl(owner, c.photo) + return ( + <> + Photo of this climb setOpen(true)} /> + {open &&
setOpen(false)}>Photo of this climb
} + + ) +} + +function Log({ data, all, me, update, photos }) { + const last = data.climbs[0] + const blank = () => ({ date: today(), grade: last?.grade ?? 2, style: 'Slab', colour: '', gym: last?.gym ?? '', wall: '', sent: true, notes: '', photo: '' }) + const [form, setForm] = useState(blank) + const [newPhoto, setNewPhoto] = useState(null) // a photo just chosen: { blob, url } + const [photoBusy, setPhotoBusy] = useState(false) + const [photoError, setPhotoError] = useState('') + const [editingId, setEditingId] = useState(null) + const [formKey, setFormKey] = useState(0) // changing this resets the drop-downs + const set = (k, v) => setForm((f) => ({ ...f, [k]: v })) + + // Shared lists: every gym anyone has climbed at, and every wall logged at the chosen gym + const gyms = sharedList(all, 'gym') + const walls = sharedList(all, 'wall', (c) => sameText(c.gym, form.gym)) + + const pickPhoto = async (e) => { + const file = e.target.files[0] + e.target.value = '' + if (!file) return + setPhotoError(''); setPhotoBusy(true) + try { + const blob = await compressPhoto(file) + setNewPhoto({ blob, url: URL.createObjectURL(blob) }) + } catch { + setPhotoError("Couldn't read that photo. Please try a different one.") + } + setPhotoBusy(false) + } + const clearPhoto = () => { setNewPhoto(null); setPhotoError(''); set('photo', '') } + + const add = async (e) => { + e.preventDefault() + if (photoBusy) return + const gym = tidy(gyms, form.gym) + const wall = tidy(walls, form.wall) + // Upload a newly chosen photo first, so a climb never points at a missing picture + const oldPhoto = editingId ? data.climbs.find((c) => c.id === editingId)?.photo : '' + let photo = form.photo + if (newPhoto) { + setPhotoBusy(true) + photo = newId() + const r = await photos.upload(photo, newPhoto.blob) + setPhotoBusy(false) + if (!r.ok) return setPhotoError("Couldn't upload the photo. Please try again, or remove it and save without one.") + } + const climb = { ...form, id: editingId ?? newId(), discipline: 'Bouldering', gym, wall, photo } + const others = data.climbs.filter((c) => c.id !== editingId) + const climbs = [climb, ...others].sort((a, b) => b.date.localeCompare(a.date)) + update({ climbs }) + setEditingId(null) + setFormKey((k) => k + 1) + setForm(editingId ? blank() : { ...form, gym, wall, colour: '', notes: '', photo: '' }) + setNewPhoto(null); setPhotoError('') + if (oldPhoto && oldPhoto !== photo) photos.remove(oldPhoto) + } + const remove = (id) => { + if (!confirm('Delete this climb?')) return + const photo = data.climbs.find((c) => c.id === id)?.photo + update({ climbs: data.climbs.filter((c) => c.id !== id) }) + if (photo) photos.remove(photo) + if (id === editingId) cancelEdit() + } + const edit = (c) => { + setEditingId(c.id) + setFormKey((k) => k + 1) + setForm({ date: c.date, grade: c.grade, style: c.style, colour: c.colour || '', gym: c.gym || '', wall: c.wall || '', sent: c.sent, notes: c.notes || '', photo: c.photo || '' }) + setNewPhoto(null); setPhotoError('') + window.scrollTo({ top: 0, behavior: 'smooth' }) + } + const cancelEdit = () => { setEditingId(null); setFormKey((k) => k + 1); setForm(blank()); setNewPhoto(null); setPhotoError('') } + + return ( + <> +
+

{editingId ? 'Edit climb' : 'Add a climb'}

+
+ + + + + + +
+
+ + +
+