Connecticut nonresidents form and bonuses (CT-1040NR/PY)

Hi,

Part of 2023 year I worked in CT office as a non resident (lived in NY) and now I need to submit TC tax form. My employer withheld some tax for CT. Starting Sep 2023 I’m not a NY resident and never worked in CT after that. Could you please help me how to calculate income that I need to enter as CT wages.

Timeline:
Jan-Aug 2023 - periodically visited CT office;
March 2023 - received bonus for work done in 2022 (didn’t work in 2022 in CT), employer didn’t withhold CT tax;
Aug 2023 - last month of NY residency (moved to another state);
Dec 2023 - received part of the 2023 bonus (employer withheld CT tax);

Should I include all monthly wages for the whole 2023 year (proportional to the number of days worked in CT)?
Or include only Jan-Aug wages and proportion only during this period?
What to do with bonuses? Do I need to include March 2023 bonus which was paid for work done in 2022? Do I need to include Dec 2023 bonus which was paid for work done in 2023?

Thank you!