#!/bin/zsh
# fusion-rangepicker-fill — fill Fusion (Aliyun) next-range-picker by
# driving the calendar overlay through chrome.debugger trusted clicks.
#
# Usage:
#   fusion-rangepicker-fill --start 2021-07-28 --end 2041-07-28 \
#       --url-contains qualification/add --browser edge
#
# Why this exists:
#   Fusion next-range-picker is a readonly combobox whose start/end inputs
#   share React state — JS setNativeValue cannot fill it (writes cross-
#   pollute). Calendar overlay nav buttons and day cells DO accept
#   trusted CDP clicks dispatched via the chrome-debugger extension.
#   This wrapper opens the overlay, navigates to the target year/month,
#   clicks the target day, and repeats for the end date.
set -euo pipefail
HERE=${0:A:h}
COMPONENT="$HERE/../components/macos/browser-automation/fusion_rangepicker_fill.py"
exec /usr/bin/python3 "$COMPONENT" "$@"
