
    ̆h#                       % S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSKJ	r	  SSK
JrJrJr  SSKJr  SSKJr  SSKJr  0 rS	\S
'   \R,                  " 5       r\R0                  R3                  \R0                  R5                  \5      S5      r\R:                  " S\R<                  5      rSS jr SS jr!SS jr"\" SS9SS j5       r#SS jr$SSS jjr%SS jr& " S S5      r' " S S\	R                  5      r(g) 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-2025 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                    U (       a  [        U [        5      (       d  gU R                  5       R                  5       n [        R
                  " [        [        5       /5       H  nXR                  5       :X  d  M  Us  $    g)zNormalize 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     H/opt/services/DDDS/venv/lib/python3.13/site-packages/babel/localedata.pynormalize_localer   !   s\     z$,,::<D((&2D2F)GH	??$$ I    c                H   [         R                  R                  U 5      n [        R                  S:X  aI  [
        R                  [         R                  R                  U 5      S   5      (       a  [        SU  S35      e[         R                  R                  [        U  S35      $ )z7
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     77D!D ||w#<#B#B277CSCSTXCYZ[C\#]#]5&<=>> 77<<TF$-00r   c                    U (       a  [        U [        5      (       d  gU [        ;   a  g[        R                  R                  [        U 5      5      nU(       a  S$ [        [        U 5      5      $ )zCheck 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)   ?   sP     z$,,v~ 7 =>J4?4(8(>#??r   )maxsizec                     S [         R                  " [        5       5        V Vs/ s H  u  pUS:X  d  M  U S:w  d  M  U PM     snn $ s  snn f )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  `   #    U  H$  n[         R                  R                  U5      v   M&     g 7fN)r   r   r#   ).0filenames     r   	<genexpr>%locale_identifiers.<locals>.<genexpr>]   s$     I4H		(	#	#4Hs   ,.r   root)r   listdirr&   )stem	extensions     r   r   r   N   sV     	JBJJx4HI 	J D 	 $(6> 	I  s   AAAc                    SSK JnJn   U" U 5      tp4pVnU(       aB  U(       a;  U(       d4  U(       d-  U(       d&  U" S5      R	                  U5      nU" U5      t  pn	XZ:g  $ g! [         a     gf = f)zReturn 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.corer9   r:   r$   get)r   r9   r:   lang	territoryscriptvariantrestlikely_subtag_likely_scripts              r   _is_non_likely_scriptrF   b   sq     42>t2D/4 y"#3488>".}"=1a&&  s   A 
A,+A,c                *   [         R                  R                  U 5      n [        R	                  5          [
        R                  U 5      nU(       Gd  U S:X  d  U(       d  0 nOSSKJn  U" S5      R                  U 5      nU(       dI  [        U 5      (       a  SnO6U R                  S5      n[        U5      S:X  a  SOSR                  USS 5      n[        U5      R                  5       n[        U 5      n[!        US	5       nU S:w  a(  U(       a!  [#        U[$        R                  " U5      5        O[$        R                  " U5      nSSS5        U[
        U '   U[        R'                  5         $ ! , (       d  f       N-= f! [        R'                  5         f = f)
a  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']
u'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
r4   r   )r9   parent_exceptionsrD      Nrb)r   r   r   _cache_lockacquirer   r=   r<   r9   rF   splitlenr%   loadcopyr'   openmergepicklerelease)r   merge_inheriteddatar9   parentpartsr1   fileobjs           r   rP   rP   w   s+   2 77D!Dzz$v~_1#$78<<TB,T22!' $

3+.u:?sPR@TF|((*.t4Hh%6>o$G 45!;;w/D	 &
  F4L &% 	s%   C
E< ?AE+E< +
E95E< <Fc                |   UR                  5        H  u  p#Uc  M
  U R                  U5      n[        U[        5      (       ar  Uc  0 n[        U[        5      (       a  XC4nOV[        U[
        5      (       a#  Uu  pVUR                  5       n[        Xc5        XV4nOUR                  5       n[        XC5        OUnX@U'   M     g)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tuplerQ   rS   )dict1dict2keyval2val1aliasotherss          r   rS   rS      s     [[]	99S>D$%%<DdE** <De,,$(ME#[[]F&'!?D99;D$%#J% #r   c                  6    \ rS rSrSrSS jrS	S jrS
S jrSrg)r^      zRepresentation 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                $    [        U5      U l        g r/   )r_   keys)selfrj   s     r   __init__Alias.__init__   s    $K	r   c                P    S[        U 5      R                   SU R                  < S3$ )N< >)type__name__rj   rk   s    r   __repr__Alias.__repr__   s&    4:&&'qQ77r   c                    UnU R                    H  nX   nM	     [        U[        5      (       a  UR                  U5      nU$ [        U[        5      (       a  Uu  pEUR                  U5      nU$ )zResolve 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`
)rj   r   r^   resolver_   )rk   rW   baserb   re   rf   s         r   rx   Alias.resolve   si     99C9D dE""<<%D  e$$ ME==&Dr   )rj   N)rj   ztuple[str, ...]returnNone)r{   r   )rW   Mapping[str | int | None, Any]r{   r}   )	rs   
__module____qualname____firstlineno____doc__rl   ru   rx   __static_attributes__ r   r   r^   r^      s     8r   r^   c                  b    \ rS rSrSrSSS jjrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSrg)LocaleDataDict   zMDictionary wrapper that automatically resolves aliases to the actual
values.
Nc                &    Xl         Uc  UnX l        g r/   _datary   )rk   rW   ry   s      r   rl   LocaleDataDict.__init__   s    
<D	r   c                ,    [        U R                  5      $ r/   )rO   r   rt   s    r   __len__LocaleDataDict.__len__   s    4::r   c                ,    [        U R                  5      $ r/   )iterr   rt   s    r   __iter__LocaleDataDict.__iter__   s    DJJr   c                   U R                   U   =p#[        U[        5      (       a  UR                  U R                  5      n[        U[
        5      (       a8  Uu  pEUR                  U R                  5      R                  5       n[        X55        [        U[        5      (       a  [        X0R                  S9nX2La  X0R                   U'   U$ N)ry   )
r   r   r^   rx   ry   r_   rQ   rS   r]   r   )rk   rb   origvalre   rf   s         r   __getitem__LocaleDataDict.__getitem__  s    ZZ_$c5!!++dii(Cc5!!ME--		*//1C#c4   995C?!JJsO
r   c                     X R                   U'   g r/   r   )rk   rb   values      r   __setitem__LocaleDataDict.__setitem__  s    

3r   c                    U R                   U	 g r/   r   )rk   rb   s     r   __delitem__LocaleDataDict.__delitem__  s    JJsOr   c                Z    [        U R                  R                  5       U R                  S9$ r   )r   r   rQ   ry   rt   s    r   rQ   LocaleDataDict.copy  s    djjoo/dii@@r   r   r/   )rW   z%MutableMapping[str | int | None, Any]ry   z%Mapping[str | int | None, Any] | None)r{   int)r{   zIterator[str | int | None])rb   str | int | Noner{   r
   )rb   r   r   r
   r{   r|   )rb   r   r{   r|   )r{   r   )rs   r~   r   r   r   rl   r   r   r   r   r   rQ   r   r   r   r   r   r      s+      Ar   r   )r   r   r{   z
str | None)r   os.PathLike[str] | strr{   r   )r   r   r{   r*   )r{   z	list[str])T)r   r   rV   r*   r{   r   )r`   zMutableMapping[Any, Any]ra   zMapping[Any, Any]r{   r|   ))r   
__future__r   r   rT   rer   	threadingcollectionsr   collections.abcr   r   r   	functoolsr   	itertoolsr	   typingr
   r   __annotations__RLockrL   r   r%   dirname__file__r&   compileIr!   r   r'   r)   r   rF   rP   rS   r^   r   r   r   r   <module>r      s    # 	  	 
   = =    oo77<<1=AJJ'NPRPTPTU 1 @ 4 &*4nB B&AS'' &Ar   