Ë
    ^ãjÞ'  ã                  ó‚  — d Z ddlmZ ddlmZ ddlmZmZmZm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZmZ ddlmZmZ dd	lmZmZ dd
lmZ ddlmZmZ g d¢Zdd„Zdej@                  eefdddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z!ddej@                  eefdddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z"y)u@   Universal character encoding detector â€” 0BSD-licensed rewrite.é    )Úannotations)ÚIterable)Ú_DEFAULT_CHUNK_SIZEÚDEFAULT_MAX_BYTESÚMINIMUM_THRESHOLDÚ_resolve_prefer_supersetÚ_validate_max_bytesÚ_warn_deprecated_chunk_size)Ú__version__)ÚUniversalDetector)ÚEncodingEraÚLanguageFilter)Úapply_compat_namesÚapply_preferred_superset)ÚDetectionDictÚDetectionResult)Úrun_pipeline)Ú_validate_encodingÚnormalize_encodings)
r   r   r   r   r   r   r   r   ÚdetectÚ
detect_allc                ód   — | dk(  rddl }|j                  d«      S dt        ›d| ›�}t        |«      ‚)aæ  Resolve the deprecated ``chardet.equivalences`` submodule on demand.

    Before the 7.5 split, ``chardet/__init__.py`` imported that module for
    its own use, which as a side effect made ``chardet.equivalences`` work
    without an explicit ``import chardet.equivalences``.  This package now
    imports :mod:`chardet.output_names` instead, so the attribute is bound
    lazily here: importing the shim eagerly would fire its deprecation
    warning on every ``import chardet``.
    Úequivalencesr   Nzchardet.equivalenceszmodule z has no attribute )Ú	importlibÚimport_moduleÚ__name__ÚAttributeError)Únamer   Úmsgs      úR/var/www/html/metafoliadorv2/venv/lib/python3.12/site-packages/chardet/__init__.pyÚ__getattr__r!   %   sA   € ð ˆ~Òó 	à×&Ñ&Ð'=Ó>Ð>Ø”H�<Ð1°$°Ð
:€CÜ
˜Ó
Ðó    FTNÚcp1252zutf-8)Úprefer_supersetÚcompat_namesÚinclude_encodingsÚexclude_encodingsÚno_match_encodingÚempty_input_encodingc          	     óv  — t        |«       t        |«       t        ||«      }t        |d«      }t        |d«      }t	        |	d«      }t	        |
d«      }t        | t        «      r| n
t        | «      }t        |||||||¬«      }|d   j                  «       }|d| }|rt        ||||¬«       |rt        ||«       |S )	aD	  Detect the encoding of the given byte string.

    :param byte_str: The byte sequence to detect encoding for.
    :param should_rename_legacy: Deprecated alias for *prefer_superset*.
    :param encoding_era: Restrict candidate encodings to the given era.
    :param chunk_size: Deprecated -- accepted for backward compatibility but
        has no effect.
    :param max_bytes: Maximum number of bytes to examine from *byte_str*.
    :param prefer_superset: If ``True``, remap subset encodings in the result
        to their decode-safe Windows/CP superset equivalents (e.g.,
        ISO-8859-1 -> Windows-1252, EUC-KR -> CP949).  Recommended when the
        result will be used to decode: detection examines at most
        *max_bytes* of input, and only the superset is guaranteed to decode
        bytes beyond that window.  The remap is skipped when the superset
        cannot decode the examined window itself (the Windows code pages
        leave a few C1 positions undefined that the ISO subsets map), so
        the reported name always decodes what was examined.  If ``False``
        (default), the detected
        encoding is reported under its own name --- note this only skips
        the renaming step; it is not a promise of the *smallest* matching
        encoding, since detection may natively choose a superset that fits
        the data better.  The default will change to ``True`` in chardet
        8.0; pass ``False`` explicitly if you depend on subset names.
    :param compat_names: If ``True`` (default), return encoding names
        compatible with chardet 5.x/6.x.  If ``False``, return raw Python
        codec names.
    :param include_encodings: If given, restrict detection to only these
        encodings (names or aliases).
    :param exclude_encodings: If given, remove these encodings from the
        candidate set.
    :param no_match_encoding: Encoding to return when no candidate survives
        the pipeline.  Defaults to ``"cp1252"``.  It is returned as given,
        at confidence 0.10, and is the one answer that is not checked
        against the data: it is the caller's sentinel for "nothing fit".
    :param empty_input_encoding: Encoding to return for empty input.  Defaults
        to ``"utf-8"``.
    :returns: A dictionary with keys ``"encoding"``, ``"confidence"``,
        ``"language"``, and ``"mime_type"``.
    r&   r'   r(   r)   )Ú	max_bytesr&   r'   r(   r)   r   N©r&   r'   )r
   r	   r   r   r   Ú
isinstanceÚbytesr   Úto_dictr   r   )Úbyte_strÚshould_rename_legacyÚencoding_eraÚ
chunk_sizer+   r$   r%   r&   r'   r(   r)   ÚincludeÚexcludeÚno_matchÚemptyÚdataÚresultsÚresultÚwindows                      r    r   r   :   sØ   € ôj   
Ô+Ü˜	Ô"Ü.Ð/CÀ_ÓU€OÜ!Ð"3Ð5HÓI€GÜ!Ð"3Ð5HÓI€GÜ!Ð"3Ð5HÓI€HÜÐ3Ð5KÓL€EÜ! (¬EÔ2‰8¼¸h»€DÜØØØØ!Ø!Ø"Ø"ô€Gð �Q‰Z×ÑÓ!€FØ�*�9Ð€FÙÜ ØØØ%Ø%õ		
ñ Ü˜6 6Ô*Ø€Mr"   c          
     óœ  — t        |«       t        |«       t        ||«      }t        |d«      }t        |	d«      }t	        |
d«      }t	        |d«      }t        | t        «      r| n
t        | «      }t        |||||||d¬«      }|D �cg c]  }|j                  «       ‘Œ }}|s |D �cg c]  }|d   t        kD  sŒ|‘Œ }}|r|}|d| }|D ]"  }|rt        ||||¬	«       |sŒt        ||«       Œ$ |j                  d
„ d¬«       t        «       }g }|D ]/  }|d   |vsŒ|j                  |d   «       |j                  |«       Œ1 |S c c}w c c}w )aY  Detect all possible encodings of the given byte string.

    When *ignore_threshold* is False (the default), results with confidence
    <= MINIMUM_THRESHOLD (0.20) are filtered out.  If all results are below
    the threshold, the full unfiltered list is returned as a fallback so the
    caller always receives at least one result.

    :param byte_str: The byte sequence to detect encoding for.
    :param ignore_threshold: If ``True``, return all candidate encodings
        regardless of confidence score.
    :param should_rename_legacy: Deprecated alias for *prefer_superset*.
    :param encoding_era: Restrict candidate encodings to the given era.
    :param chunk_size: Deprecated -- accepted for backward compatibility but
        has no effect.
    :param max_bytes: Maximum number of bytes to examine from *byte_str*.
    :param prefer_superset: If ``True``, remap subset encodings in the
        results to their decode-safe Windows/CP superset equivalents.
        If ``False`` (default), skip the renaming --- not a promise of the
        smallest matching encoding.  The default will change to ``True``
        in chardet 8.0.  See :func:`detect` for details.
    :param compat_names: If ``True`` (default), return encoding names
        compatible with chardet 5.x/6.x.  If ``False``, return raw Python
        codec names.
    :param include_encodings: If given, restrict detection to only these
        encodings (names or aliases).
    :param exclude_encodings: If given, remove these encodings from the
        candidate set.
    :param no_match_encoding: Encoding to return when no candidate survives
        the pipeline.  Defaults to ``"cp1252"``.
    :param empty_input_encoding: Encoding to return for empty input.  Defaults
        to ``"utf-8"``.
    :returns: A list of dictionaries, sorted by descending confidence, one
        per encoding name.
    r&   r'   r(   r)   T)r+   r&   r'   r(   r)   Úfull_rankingÚ
confidenceNr,   c                ó   — | d   S )Nr>   © )Úds    r    ú<lambda>zdetect_all.<locals>.<lambda>Þ   s
   € ˜Q˜|™_€ r"   )ÚkeyÚreverseÚencoding)r
   r	   r   r   r   r-   r.   r   r/   r   r   r   ÚsortÚsetÚaddÚappend)r0   Úignore_thresholdr1   r2   r3   r+   r$   r%   r&   r'   r(   r)   r4   r5   r6   r7   r8   r9   ÚrÚdictsrA   Úfilteredr;   ÚseenÚuniques                            r    r   r   Ž   sz  € ôb   
Ô+Ü˜	Ô"Ü.Ð/CÀ_ÓU€OÜ!Ð"3Ð5HÓI€GÜ!Ð"3Ð5HÓI€GÜ!Ð"3Ð5HÓI€HÜÐ3Ð5KÓL€EÜ! (¬EÔ2‰8¼¸h»€DÜØØØØ!Ø!Ø"Ø"Øô	€Gð #*Ö*˜QˆQ�Y‰Y�[Ð*€EÐ*ÙØ$ÖL˜!¨¨,©Ô:KÓ(K’AÐLˆÐLÙØˆEØ�*�9Ð€FØò *ˆÙÜ$Ø�6¨WÈõò Ü˜q &Õ)ð*ð 
‡J�JÑ,°d€JÔ;ô
  ›E€DØ"$€FØò ˆØˆZ‰= Ò$Ø�H‰H�Q�z‘]Ô#Ø�M‰M˜!Õðð €Mùò1 +ùâLs   ÂEÂ&E	Â8E	)r   ÚstrÚreturnÚobject)r0   úbytes | bytearrayr1   Úboolr2   r   r3   Úintr+   rU   r$   rT   r%   rT   r&   úIterable[str] | Noner'   rV   r(   rP   r)   rP   rQ   r   )r0   rS   rJ   rT   r1   rT   r2   r   r3   rU   r+   rU   r$   rT   r%   rT   r&   rV   r'   rV   r(   rP   r)   rP   rQ   zlist[DetectionDict])#Ú__doc__Ú
__future__r   Úcollections.abcr   Úchardet._utilsr   r   r   r   r	   r
   Úchardet._versionr   Úchardet.detectorr   Úchardet.enumsr   r   Úchardet.output_namesr   r   Úchardet.pipeliner   r   Úchardet.pipeline.orchestratorr   Úchardet.registryr   r   Ú__all__r!   ÚALLr   r   r@   r"   r    ú<module>rd      s®  ðÙ Få "å $÷÷ õ )Ý .ß 5ß Mß ;Ý 6ß Dò€óð. "'Ø +§¡Ø)Ø&ðQð "ØØ.2Ø.2Ø%Ø 'ñQØðQàðQð ðQð ð	Qð
 ðQð ðQð ðQð ,ðQð ,ðQð ðQð ðQð óQðl #Ø!&Ø +§¡Ø)Ø&ð[ð "ØØ.2Ø.2Ø%Ø 'ñ[Øð[àð[ð ð[ð ð	[ð
 ð[ð ð[ð ð[ð ð[ð ,ð[ð ,ð[ð ð[ð ð[ð ô[r"   