U
    \ªShG  ã                D   @  sø   U d Z ddlmZ ddlmZmZ edƒZded< dddddd	d
dddd	dddd	ddddddd	dddddddddd	d	ddd	d	dd	d	dd	ddddddddddddddddddd	d	ddd	dd	dœCZded< dZ	ded< G dd„ de
ƒZd"dddœd d!„ZdS )#z¸
    babel.messages.plurals
    ~~~~~~~~~~~~~~~~~~~~~~

    Plural form definitions.

    :copyright: (c) 2013-2025 by the Babel Team.
    :license: BSD, see LICENSE for more details.
é    )Úannotations)ÚLocaleÚdefault_localeÚLC_CTYPEz
str | None)é   z(n != 1))é   z[(n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=0 && n%100<=2 ? 4 : 5))é   zR(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2))é   Ú0)r   a&  (n==1 ? 0 : n%10==1 && n%100!=11 && n%100!=71 && n%100!=91 ? 1 : n%10==2 && n%100!=12 && n%100!=72 && n%100!=92 ? 2 : (n%10==3 || n%10==4 || n%10==9) && n%100!=13 && n%100!=14 && n%100!=19 && n%100!=73 && n%100!=74 && n%100!=79 && n%100!=93 && n%100!=94 && n%100!=99 ? 3 : n%1000000==0 ? 4 : 5))r   z%((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2))é   z/(n==1 ? 1 : n==2 ? 2 : n==3 ? 3 : n==6 ? 4 : 0))r   z(n > 1))r   z@(n==1 ? 0 : n==2 ? 1 : n>=3 && n<=6 ? 2 : n>=7 && n<=10 ? 3 : 4))r   z(n%10==1 && n%100!=11 ? 0 : 1))r   zG(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2))r   z+(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2))é   zS(n==1 ? 0 : n==0 || ( n%100>=1 && n%100<=10) ? 1 : (n%100>10 && n%100<20 ) ? 2 : 3))r   zB(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2))r   z8(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2))r   z<(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3))CÚafÚarÚbeÚbgZbnZboÚbrÚbsÚcaÚcsZcvÚcyÚdaÚdeZdzÚelÚenÚeoÚesÚetÚeuÚfaÚfiÚfrZfurÚgaÚglZhaÚheÚhiÚhrÚhuÚhyÚisÚitÚjaÚkaZkgÚkmÚkoZkuÚloÚltÚlvÚmtÚnbÚnlÚnnÚnoÚpaÚplÚptÚpt_BRÚroÚruÚskÚslÚsrÚstÚsvÚthÚtrÚukÚveÚviÚxhÚzhzdict[str, tuple[int, str]]ÚPLURALSztuple[int, str]ÚDEFAULT_PLURALc                   @  sX   e Zd ZdZdZeddœdd„ƒZeddœdd	„ƒZeddœd
d„ƒZddœdd„Z	dS )Ú_PluralTuplez A tuple with plural information.© Úint)Úreturnc                 C  s   | d S )z)The number of plurals used by the locale.r   rK   ©ÚselfrK   rK   úI/root/rtd-docs/venv/lib/python3.8/site-packages/babel/messages/plurals.pyÚnum_pluralsÓ   s    z_PluralTuple.num_pluralsÚstrc                 C  s   | d S )z)The plural expression used by the locale.r	   rK   rN   rK   rK   rP   Úplural_exprØ   s    z_PluralTuple.plural_exprc                 C  s   d| d › d| d › dS )z4The plural expression used by the catalog or locale.z	nplurals=r   z	; plural=r	   ú;rK   rN   rK   rK   rP   Úplural_formsÝ   s    z_PluralTuple.plural_formsc                 C  s   | j S )N)rU   rN   rK   rK   rP   Ú__str__â   s    z_PluralTuple.__str__N)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__ÚpropertyrQ   rS   rU   rV   rK   rK   rK   rP   rJ   Î   s   rJ   NzLocale | str | None)ÚlocalerM   c                 C  sd   t  | p
t¡} ztt| ƒ }W n< tk
rZ   zt| j }W n tk
rT   t}Y nX Y nX t|ƒS )a$  A tuple with the information catalogs need to perform proper
    pluralization.  The first item of the tuple is the number of plural
    forms, the second the plural expression.

    :param locale: the `Locale` object or locale identifier. Defaults to the system character type locale.

    >>> get_plural(locale='en')
    (2, '(n != 1)')
    >>> get_plural(locale='ga')
    (5, '(n==1 ? 0 : n==2 ? 1 : n>=3 && n<=6 ? 2 : n>=7 && n<=10 ? 3 : 4)')

    The object returned is a special tuple with additional members:

    >>> tup = get_plural("ja")
    >>> tup.num_plurals
    1
    >>> tup.plural_expr
    '0'
    >>> tup.plural_forms
    'nplurals=1; plural=0;'

    Converting the tuple into a string prints the plural forms for a
    gettext catalog:

    >>> str(tup)
    'nplurals=1; plural=0;'
    )	r   Úparser   rH   rR   ÚKeyErrorÚlanguagerI   rJ   )r]   ÚtuprK   rK   rP   Ú
get_pluralæ   s    rb   )N)rZ   Ú
__future__r   Z
babel.corer   r   r   Ú__annotations__rH   rI   ÚtuplerJ   rb   rK   rK   rK   rP   Ú<module>   s˜   	
€ Í 8