Ë
    Ìi­#  ã                  óæ  — U d Z ddlmZ ddlZddlZddlZddlZddlZddlm	Z	 ddl
mZmZmZ ddlmZ ddlmZ ddlmZ i Zd	ed
<    ej,                  «       Zej0                  j3                  ej0                  j5                  e«      d«      Z ej:                  dej<                  «      Zdd„Z dd„Z!dd„Z" ed¬«      dd„«       Z#dd„Z$ddd„Z%dd„Z& G d„ d«      Z' G d„ de	j                  «      Z(y) a+  
babel.localedata
~~~~~~~~~~~~~~~~

Low-level locale data access.

:note: The `Locale` class, which uses this module under the hood, provides a
       more convenient interface for accessing the locale data.

:copyright: (c) 2013-2026 by the Babel Team.
:license: BSD, see LICENSE for more details.
é    )ÚannotationsN)Úabc)ÚIteratorÚMappingÚMutableMapping)Ú	lru_cache)Úchain)ÚAnyúdict[str, Any]Ú_cachezlocale-dataz%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$c                óä   — | rt        | t        «      sy| j                  «       j                  «       } t	        j
                  t        t        «       g«      D ]  }| |j                  «       k(  sŒ|c S  y)zŸNormalize a locale ID by stripping spaces and apply proper casing.

    Returns the normalized locale ID string or `None` if the ID is not
    recognized.
    N)Ú
isinstanceÚstrÚstripÚlowerr	   Úfrom_iterabler   Úlocale_identifiers)ÚnameÚ	locale_ids     úQ/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/babel/localedata.pyÚnormalize_localer   !   s_   € ñ ”z $¬Ô,ØØ�:‰:‹<×ÑÓ€DÜ×(Ñ(¬&Ô2DÓ2FÐ)GÓHò ˆ	Ø�9—?‘?Ó$Ó$ØÒñó    c                ó<  — t         j                  j                  | «      } t        j                  dk(  rDt
        j                  t         j                  j                  | «      d   «      rt        d| › d�«      ‚t         j                  j                  t        | › d�«      S )z?
    Resolve a locale identifier to a `.dat` path on disk.
    Úwin32r   zName z is invalid on Windowsú.dat)ÚosÚpathÚbasenameÚsysÚplatformÚ_windows_reserved_name_reÚmatchÚsplitextÚ
ValueErrorÚjoinÚ_dirname)r   s    r   Úresolve_locale_filenamer'   /   s|   € ô �7‰7×Ñ˜DÓ!€Dô ‡|�|�wÒÔ#<×#BÑ#BÄ2Ç7Á7×CSÑCSÐTXÓCYÐZ[ÑC\Ô#]Ü˜5  Ð&<Ð=Ó>Ð>ô �7‰7�<‰<œ T F¨$ -Ó0Ð0r   c                óº   — | rt        | t        «      sy| t        v ryt        j                  j                  t        | «      «      }|rdS t        t        | «      «      S )z¥Check whether locale data is available for the given locale.

    Returns `True` if it exists, `False` otherwise.

    :param name: the locale identifier string
    FT)	r   r   r   r   r   Úexistsr'   Úboolr   )r   Ú
file_founds     r   r)   r)   ?   sM   € ñ ”z $¬Ô,ØØŒv�~ØÜ—‘—‘Ô 7¸Ó =Ó>€JÙˆ4Ð?¤4Ô(8¸Ó(>Ó#?Ð?r   )Úmaxsizec                 óˆ   — d„ t        j                  t        «      D «       D � �cg c]  \  } }|dk(  r| dk7  r| ‘Œ c}} S c c}} w )a&  Return a list of all locale identifiers for which locale data is
    available.

    This data is cached after the first invocation.
    You can clear the cache by calling `locale_identifiers.cache_clear()`.

    .. versionadded:: 0.8.1

    :return: a list of locale identifiers (strings)
    c              3  óZ   K  — | ]#  }t         j                  j                  |«      –— Œ% y ­w©N)r   r   r#   )Ú.0Úfilenames     r   ú	<genexpr>z%locale_identifiers.<locals>.<genexpr>\   s$   è ø€ ò  
Ø+3ŒB�G‰G×Ñ˜X×&ñ 
ùs   ‚)+r   Úroot)r   Úlistdirr&   )ÚstemÚ	extensions     r   r   r   N   sI   € ñ 
Ü79·z±zÄ(Ó7Kô 
÷áˆD�)ð ˜Ò 4¨6¢>ò	 	óð ùó s   ¤>c                ó²   — ddl m}m} 	  || «      ^}}}}}|r0|r.|s,|s*|s( |d«      j	                  |«      } ||«      ^}	}	}
}	||
k7  S y# t        $ r Y yw xY w)a  Return whether the locale is of the form ``lang_Script``,
    and the script is not the likely script for the language.

    This implements the behavior of the ``nonlikelyScript`` value of the
    ``localRules`` attribute for parent locales added in CLDR 45.
    r   )Ú
get_globalÚparse_localeFÚlikely_subtags)Ú
babel.corer8   r9   r$   Úget)r   r8   r9   ÚlangÚ	territoryÚscriptÚvariantÚrestÚlikely_subtagÚ_Úlikely_scripts              r   Ú_is_non_likely_scriptrE   c   sy   € ÷ 4ðÙ2>¸tÓ2DÐ/ˆˆi˜ ¨4ñ ‘™y±ÁÙ"Ð#3Ó4×8Ñ8¸Ó>ˆÙ".¨}Ó"=Ðˆˆ1ˆm˜aØ˜Ñ&Ð&Øøô ò Ùðús   ŠA
 Á
	AÁAc                óâ  — t         j                  j                  | «      } t        j	                  «        	 t
        j                  | «      }|sê| dk(  s|si }n{ddlm}  |d«      j                  | «      }|sCt        | «      rd}n5| j                  d«      }t        |«      dk(  rdndj                  |dd «      }t        |«      j                  «       }t        | «      }t!        |d	«      5 }| dk7  r"|r t#        |t%        j                  |«      «       nt%        j                  |«      }ddd«       |t
        | <   |t        j'                  «        S # 1 sw Y   Œ(xY w# t        j'                  «        w xY w)
ae  Load the locale data for the given locale.

    The locale data is a dictionary that contains much of the data defined by
    the Common Locale Data Repository (CLDR). This data is stored as a
    collection of pickle files inside the ``babel`` package.

    >>> d = load('en_US')
    >>> d['languages']['sv']
    'Swedish'

    Note that the results are cached, and subsequent requests for the same
    locale return the same dictionary:

    >>> d1 = load('en_US')
    >>> d2 = load('en_US')
    >>> d1 is d2
    True

    :param name: the locale identifier string (or "root")
    :param merge_inherited: whether the inherited data should be merged into
                            the data of the requested locale
    :raise `IOError`: if no locale data file is found for the given locale
                      identifier, or one of the locales it inherits from
    r3   r   )r8   Úparent_exceptionsrC   é   NéÿÿÿÿÚrb)r   r   r   Ú_cache_lockÚacquirer   r<   r;   r8   rE   ÚsplitÚlenr%   ÚloadÚcopyr'   ÚopenÚmergeÚpickleÚrelease)r   Úmerge_inheritedÚdatar8   ÚparentÚpartsr1   Úfileobjs           r   rO   rO   x   s/  € ô2 �7‰7×Ñ˜DÓ!€DÜ×ÑÔðÜ�z‰z˜$ÓˆÙà�vŠ~¡_Ø‘å1á#Ð$7Ó8×<Ñ<¸TÓB�ÙÜ,¨TÔ2Ø!'™à $§
¡
¨3£˜Ü+.¨u«:¸ª?¡ÀÇÁÈÈsÐPRÈÓ@T˜Ü˜F“|×(Ñ(Ó*�Ü.¨tÓ4ˆHÜ�h Ó%ð 0¨Ø˜6’>¡oÜ˜$¤§¡¨GÓ 4Õ5ä!Ÿ;™; wÓ/�D÷	0ð
  ŒF�4‰LØä×ÑÕ÷0ð 0ûô 	×ÑÕús$   µB3E Ã(=EÄ%E ÅEÅE ÅE.c                ób  — |j                  «       D ]œ  \  }}|€Œ	| j                  |«      }t        |t        «      rl|€i }t        |t        «      r||f}nUt        |t
        «      r&|\  }}|j                  «       }t        ||«       ||f}n|j                  «       }t        ||«       n|}|| |<   Œž y)an  Merge the data from `dict2` into the `dict1` dictionary, making copies
    of nested dictionaries.

    >>> d = {1: 'foo', 3: 'baz'}
    >>> merge(d, {1: 'Foo', 2: 'Bar'})
    >>> sorted(d.items())
    [(1, 'Foo'), (2, 'Bar'), (3, 'baz')]

    :param dict1: the dictionary to merge into
    :param dict2: the dictionary containing the data that should be merged
    N)Úitemsr<   r   ÚdictÚAliasÚtuplerP   rR   )Údict1Údict2ÚkeyÚval2Úval1ÚaliasÚotherss          r   rR   rR   °   s«   € ð —[‘[“]ò ‰	ˆˆTØÑØ—9‘9˜S“>ˆDÜ˜$¤Ô%Ø�<Ø�DÜ˜d¤EÔ*Ø  $˜<‘DÜ ¤eÔ,Ø$(‘M�E˜6Ø#Ÿ[™[›]�FÜ˜& $Ô'Ø! 6˜?‘DàŸ9™9›;�DÜ˜$ Õ%à�ØˆE�#ŠJñ%r   c                  ó(   — e Zd ZdZdd„Zdd„Zdd„Zy)	r]   zŸRepresentation of an alias in the locale data.

    An alias is a value that refers to some other part of the locale data,
    as specified by the `keys`.
    c                ó$   — t        |«      | _        y r/   )r^   Úkeys)Úselfrh   s     r   Ú__init__zAlias.__init__Ø   s   € Ü˜$“Kˆ�	r   c                óN   — dt        | «      j                  › d| j                  ›d�S )Nú<ú ú>)ÚtypeÚ__name__rh   ©ri   s    r   Ú__repr__zAlias.__repr__Û   s&   € Ø”4˜“:×&Ñ&Ð' q¨¯©¨°QÐ7Ð7r   c                óÈ   — |}| j                   D ]  }||   }Œ	 t        |t        «      r|j                  |«      }|S t        |t        «      r|\  }}|j                  |«      }|S )zôResolve the alias based on the given data.

        This is done recursively, so if one alias resolves to a second alias,
        that second alias will also be resolved.

        :param data: the locale data
        :type data: `dict`
        )rh   r   r]   Úresolver^   )ri   rV   Úbasera   rd   re   s         r   rt   zAlias.resolveÞ   sl   € ð ˆØ—9‘9ò 	ˆCØ˜‘9‰Dð	ä�dœEÔ"Ø—<‘< Ó%ˆDð ˆô ˜œeÔ$Ø ‰MˆE�6Ø—=‘= Ó&ˆDØˆr   N)rh   ztuple[str, ...]ÚreturnÚNone)rv   r   )rV   úMapping[str | int | None, Any]rv   rx   )rp   Ú
__module__Ú__qualname__Ú__doc__rj   rr   rt   © r   r   r]   r]   Ñ   s   „ ñó ó8ôr   r]   c                  óR   — e Zd ZdZ	 d
	 	 	 dd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	dd	„Z
y)ÚLocaleDataDictzUDictionary wrapper that automatically resolves aliases to the actual
    values.
    Nc                ó(   — || _         |€|}|| _        y r/   )Ú_dataru   )ri   rV   ru   s      r   rj   zLocaleDataDict.__init__÷   s   € ð
 ˆŒ
Øˆ<ØˆDØˆ�	r   c                ó,   — t        | j                  «      S r/   )rN   r€   rq   s    r   Ú__len__zLocaleDataDict.__len__  s   € Ü�4—:‘:‹Ðr   c                ó,   — t        | j                  «      S r/   )Úiterr€   rq   s    r   Ú__iter__zLocaleDataDict.__iter__  s   € Ü�D—J‘JÓÐr   c                ó†  — | j                   |   x}}t        |t        «      r|j                  | j                  «      }t        |t
        «      r:|\  }}|j                  | j                  «      j                  «       }t        ||«       t        |t        «      rt        || j                  ¬«      }||ur|| j                   |<   |S ©N)ru   )
r€   r   r]   rt   ru   r^   rP   rR   r\   r~   )ri   ra   ÚorigÚvalrd   re   s         r   Ú__getitem__zLocaleDataDict.__getitem__  s›   € Ø—Z‘Z ‘_Ð$ˆˆsÜ�cœ5Ô!Ø—+‘+˜dŸi™iÓ(ˆCÜ�cœ5Ô!Ø‰MˆE�6Ø—-‘- §	¡	Ó*×/Ñ/Ó1ˆCÜ�#�vÔÜ�cœ4Ô Ü  ¨4¯9©9Ô5ˆCØ�d‰?Ø!ˆD�J‰J�s‰OØˆ
r   c                ó"   — || j                   |<   y r/   ©r€   )ri   ra   Úvalues      r   Ú__setitem__zLocaleDataDict.__setitem__  s   € Øˆ�
‰
�3Šr   c                ó   — | j                   |= y r/   rŒ   )ri   ra   s     r   Ú__delitem__zLocaleDataDict.__delitem__  s   € Ø�J‰J�s‰Or   c                ó`   — t        | j                  j                  «       | j                  ¬«      S r‡   )r~   r€   rP   ru   rq   s    r   rP   zLocaleDataDict.copy  s   € Ü˜dŸj™jŸo™oÓ/°d·i±iÔ@Ð@r   r/   )rV   z%MutableMapping[str | int | None, Any]ru   z%Mapping[str | int | None, Any] | None)rv   Úint)rv   zIterator[str | int | None])ra   ústr | int | Nonerv   r
   )ra   r“   r�   r
   rv   rw   )ra   r“   rv   rw   )rv   r~   )rp   ry   rz   r{   rj   r‚   r…   rŠ   rŽ   r�   rP   r|   r   r   r~   r~   ò   sB   „ ñð 7;ðà3ðð 4óóó óó óôAr   r~   )r   r   rv   z
str | None)r   úos.PathLike[str] | strrv   r   )r   r   rv   r*   )rv   z	list[str])T)r   r”   rU   r*   rv   r   )r_   zMutableMapping[Any, Any]r`   zMapping[Any, Any]rv   rw   ))r{   Ú
__future__r   r   rS   Úrer   Ú	threadingÚcollectionsr   Úcollections.abcr   r   r   Ú	functoolsr   Ú	itertoolsr	   Útypingr
   r   Ú__annotations__ÚRLockrK   r   r%   ÚdirnameÚ__file__r&   ÚcompileÚIr!   r   r'   r)   r   rE   rO   rR   r]   r~   r|   r   r   ú<module>r£      sÝ   ðòõ #ã 	Û Û 	Û 
Û Ý ß =Ñ =Ý Ý Ý à€ˆÓ Øˆi�o‰oÓ€Ø�7‰7�<‰<˜Ÿ™Ÿ™¨Ó1°=ÓA€Ø&˜BŸJ™JÐ'NÐPR×PTÑPTÓUÐ óó1ó @ñ �4Ôòó ðó(ô*5óp÷Bñ ôB*A�S×'Ñ'õ *Ar   