# shellcheck shell=dash disable=1091,2034

. "$___X_CMD_THEME_EXT_ROOT/pl/_index"

xrc:theme:widget msg symbol
___x_cmd_theme_plfull(){
    local x_=

    ___x_cmd_theme_headline_print

    {
        ___x_cmd_theme_pl_left
        ___x_cmd_theme_pl_right

        ______x_cmd_theme_prompt_remove_escapes_ "$X_left"
        if [ -n "$COLUMNS" ] && [ "${#x_}" -gt "$((  COLUMNS - COLUMNS / 3 ))" ]; then
            # printf "%s\n"   "$X_right"
            printf "%s\n"     "$X_left"
        else
            theme:col2_  "${X_left}" "${X_right}"
            printf "%s\n"   "$x_"
        fi
    }

    {
        ___x_cmd_theme_widget_symbol "❯" "❯" "❯"
        printf "%s "      "${X_symbol}"
    }
}

___x_cmd_theme_pl_right(){
    X_right=""

    theme:comp  time_hms
    [ -z "$x_time_hms" ] || {
        theme:style_ "bg-${XT_PL_hms_bg}" "fg-${XT_PL_hms_fg}" -- " ${x_time_hms} ";    X_right="${x_}${X_right}"
        ___x_cmd_theme_widget_pl_horn "" "${XT_PL_hms_bg}" left
        X_right="${X_pl_horn}${X_right}"
    }

}

XT_transient_ps1(){
    local x_=""
    theme:feature:get transient_time
    case "$x_" in
        always)
            ___x_cmd_theme_comp_transient time
            ___X_CMD_THEME_TIME_H_M_S="$x_"
            ___x_cmd_theme_widget_hms 2>/dev/null
            [ -z "$X_hms" ] || X_ps1="${X_hms} " ;;
    esac

    ___x_cmd_theme_widget_symbol "❯" "❯" "❯" 2>/dev/null
    [ -z "$X_symbol" ] || X_ps1="${X_ps1}${X_symbol} "
}

___x_cmd_theme_linecount_ps1=2
