
    !gr%                         d dl mZ d dlmZ d dlmZmZmZ d dlm	Z	m
Z
mZ d dlmZmZmZmZ  G d dee	e
e      Z G d d	e      Z G d
 de      Z G d d      Zy)    )date)gettext)SEPNOVDEC)ChristianHolidaysInternationalHolidaysStaticHolidays)ObservedHolidayBaseALL_TO_NEAREST_MON_LATAMMON_TO_NEXT_TUESUN_TO_NEXT_MONc                   X     e Zd ZdZdZdZ ed      ZdZdZ	 fdZ
def fd	Zd
 Z xZS )Tongaa  
    References:
      - 2020 Rev. https://ago.gov.to/cms/images/LEGISLATION/PRINCIPAL/1919/1919-0008/PublicHolidaysAct_3.pdf
      - 2020 Rev. (to) https://ago.gov.to/cms/images/LEGISLATION/PRINCIPAL/1919/1919-0008/LaokihengaahiAhoMaloloFaka-Puleanga_3x.pdf
      - 2016 Rev. https://ago.gov.to/cms/images/LEGISLATION/PRINCIPAL/1919/1919-0008/PublicHolidaysAct_2.pdf
      - 1988 Rev. https://ago.gov.to/cms/images/LEGISLATION/PRINCIPAL/1919/1919-0008/PublicHolidaysAct_1.pdf
      - 1988 Rev. (to) https://ago.gov.to/cms/images/LEGISLATION/PRINCIPAL/1919/1919-0008/LaokihengaahiAhoMaloloFaka-Puleanga_1x.pdf
      - Act 10 of 2010 http://www.paclii.org/to/legis/num_act/pha2010243/
      - Act 5 of 2013 http://www.paclii.org/to/legis/num_act/pha2013243/

    Checked With:
      - https://www.gov.to/press-release/tonga-public-holidays-for-2024/  # 2024
      - https://www.gov.to/press-release/tonga-public-holidays-for-2023/  # 2023
      - https://www.gov.to/press-release/tonga-public-holidays-for-2022/  # 2022
      - https://www.gov.to/press-release/tonga-public-holidays-for-2021/  # 2021
      - https://www.gov.to/press-release/tonga-public-holidays-for-2020/  # 2020
      - https://www.gov.to/press-release/tonga-public-holidays-for-2019-2/  # 2019
      - https://www.gov.to/press-release/tonga-public-holidays-for-2018/  # 2018
      - https://www.officeholidays.com/countries/tonga/2017  # 2017

    1988 Revision Observance Rule:
        Provided always that when any of the days specified falls upon a Sunday,
        the next following Monday shall be a public holiday and that whenever
        the twenty-sixth day of December falls upon a Monday the day following
        shall be a public holiday. (Amended by Act 11 of 1970.)

    2016 and 2020 Revision Observance Rule:
        Provided that when any public holidays specified, except Christmas Day, the
        day immediately succeeding Christmas Day, New Years Day, Good Friday,
        Easter Monday, ANZAC Day, Birthday of the reigning Sovereign of Tonga
        and Birthday of the Heir to the Crown of Tonga, falls upon a Thursday,
        Friday, Saturday or Sunday, that public holiday shall be celebrated on the next
        following Monday; and if it falls on a Tuesday or Wednesday, that public
        holiday shall be celebrated on the Monday before the actual public holiday.
        (Amended by Act 10 of 2010: May 18, 2010.)
        "Birthday of the reigning Sovereign of Tonga and Birthday of the Heir to
        the Crown of Tonga" is add to the exempted list as seen above.
        (Amended by Act 5 of 2013: Jun 28, 2013.)

        Further provided that the Birthday of the reigning Sovereign of Tonga and the
        Birthday of the Heir to the Crown of Tonga shall be celebrated on the day it
        falls, unless it falls on a Sunday in which case it would be celebrated on the
        next following Monday.
        (Inserted by Act 5 of 2013: Jun 28, 2013.)
    TOtoz%s (fakatokanga'i))en_USr   i  c                     t        j                  |        t        j                  |        t        j                  | t               |j                  dt               t        |   |i | y )N)clsobserved_rule)r   __init__r	   r
   TongaStaticHolidays
setdefaultr   super)selfargskwargs	__class__s      U/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/holidays/countries/tonga.pyr   zTonga.__init__Q   sR    ""4(&&t,*=>/?;$)&)    dtc                 b    | j                   dk\  r|d   xs t        |d<   t        |   |fi |S )N  rule)_yearr   r   _add_observed)r   r!   r   r   s      r   r&   zTonga._add_observedX   s7    ::#F^G/GF6Nw$R2622r    c                    | j                  t        d            }| j                  dk  r| j                  |t               t        d      }| j                  dk(  r!| j                  | j                  |             ntd| j                  cxk  rdk  r*n n'| j                  | j                  |      t               n5| j                  dk7  r&| j                  | j                  |      t               t        d	      }| j                  dk\  r'| j                  | j                  |      t               n| j                  dk\  r!| j                  | j                  |             nP| j                  dk\  r!| j                  | j                  |             n | j                  | j                  |             | j                  t        d
             | j                  t        d             | j                  t        d            }| j                  dk  r| j                  |t               | j                  t        d            }| j                  dk\  r| j                  |       n| j                  |       d| j                  cxk  rdk  r^n n[t        d      }| j                  dk\  r!| j                  | j                  |             n | j                  | j                  |             | j                  t        d            }| j                  dk\  r| j                  |       n| j                  |       | j!                  t        d            }| j                  dk\  r| j                  |       n| j                  |       | j#                  t        d             | j%                  t        d            }| j                  dk  r| j                  |t&               y y )Nz'Uluaki 'Aho 'o e Ta'u Fo'oui  )r$   z@'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pulei  i  r#   i  z+'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o TongazFalaite LeleizMonite 'o e Toetu'uz
'Aho Anzacz'Aho Tau'atainai  z`Fakamanatu 'o e 'Aho Hilifaki Kalauni 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'a ia 'oku lolotonga Pulez'Aho KonisitutonezE'Aho Fakamanatu 'o e Hilifaki Kalauni 'o 'Ene 'Afio ko Siaosi Tupou Iz'Aho Kilisimasi'Aho 2 'o e Kilisimasii  )_add_new_years_daytrr%   r&   r   _move_holiday_add_holiday_may_4_add_holiday_jul_4_add_holiday_sep_17_add_holiday_jul_12_add_good_friday_add_easter_monday_add_anzac_day_add_holiday_jun_4_add_holiday_aug_1_add_holiday_nov_4_add_holiday_dec_4_add_christmas_day_add_christmas_day_twor   )r   jan_1nameapr_25jun_4nov_4dec_4dec_26s           r   _populate_public_holidayszTonga._populate_public_holidays]   s4   ''+I(JK::u?; TU::t66t<=TZZ'4't66t<?SZZ4t66t<?S ?@::t77=OTZZ4t77=>ZZ4t77=>t66t<= 	b12 	#8 9: $$R%56::vO< ''+<(=>::u%u% 4::%%,D
 zzT!""4#:#:4#@A""4#:#:4#@A ''+>(?@::u%u%''VW
 ::u%u% 	#4 56 ,,R0H-IJ::vO< r    )__name__
__module____qualname____doc__countrydefault_languager*   observed_labelsupported_languages
start_yearr   r   r&   r@   __classcell__)r   s   @r   r   r      sC    ,\ G,-N)J*3 3
b=r    r   c                       e Zd Zy)r   NrA   rB   rC    r    r   r   r          r    r   c                       e Zd Zy)TONNrL   rM   r    r   rP   rP      rN   r    rP   c                   f    e Zd ZdZ ed      Zedefed ed      fedeffdZde	d	 ed
      fiZ
y)r   at  
    References:
      - https://www.stuff.co.nz/sport/league/99338959/tonga-government-declares-public-holiday-over-rugby-league-teams-deeds
      - https://www.rnz.co.nz/international/pacific-news/398653/tonga-declares-public-holiday-for-pm-pohiva-s-state-funeral
      - https://www.nrl.com/news/2019/11/06/tonga-declare-public-holiday-for-woolfs-winning-warriors/
    z'Aho malolo 'akapulu 'a Tonga      z*Me'afaka'eiki 'o e Siteiti 'Akilisi Pohiva   )i  i  i     r(   N)rA   rB   rC   rD   r*   rugby_special_holidaysr   r   special_public_holidaysr    special_public_holidays_observedrM   r    r   r   r      sh       ?@ B./ "bEFG",-
 	sB345($r    r   N)datetimer   r   r*   holidays.calendars.gregorianr   r   r   holidays.groupsr   r	   r
   holidays.observed_holiday_baser   r   r   r   r   r   rP   r   rM   r    r   <module>r]      s]     ! 6 6 T T e=!24I> e=P	 		% 	 r    