+
    Ĝi.                        ^ RI Ht ^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
HtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt RR
 R llt ! R R4      tRR R llt]R8X  d
   ]! 4        R# R# )    )annotationsN)dumps)abspathbasenamedirnamejoinrealpath)python_version)unidata_version)from_fp)CliDetectionResult)__version__c               $    V ^8  d   QhRRRRRR/# )   questionstrdefaultreturnbool )formats   "h/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/charset_normalizer/cli/__main__.py__annotate__r      s!     1 13 1 1 1    c                    VR8X  d   RMRp \        W,           4      P                  4       P                  4       pV'       g   VR8H  # VR9   d   R# VR9   d   R# \        R4       KZ  )	zBAsk a yes/no question via input() and return the answer as a bool.yesz [Y/n] z [y/N] TFzPlease respond with 'y' or 'n'.)yr   )nno)inputstriplowerprint)r   r   promptchoices   &&  r   query_yes_nor&      s_    !U*Y	F
x()//1779e##\![ /0r   c                  B    ] tR t^ tRtR
R R lltR R ltR R ltR	tR# )FileTypea  Factory for creating file object types

Instances of FileType are typically passed as type= arguments to the
ArgumentParser add_argument() method.

Keyword Arguments:
    - mode -- A string indicating how the file is to be opened. Accepts the
        same values as the builtin open() function.
    - bufsize -- The file's desired buffer size. Accepts the same values as
        the builtin open() function.
    - encoding -- The file's encoding. Accepts the same values as the
        builtin open() function.
    - errors -- A string indicating how encoding and decoding errors are to
        be handled. Accepts the same value as the builtin open() function.

Backported from CPython 3.12
Nc               (    V ^8  d   QhRRRRRRRR/# )r   moder   bufsizeintencodingz
str | Noneerrorsr   )r   s   "r   r   FileType.__annotate__3   s2     
 

 
 	

 
r   c                	6    Wn         W n        W0n        W@n        R # N)_mode_bufsize	_encoding_errors)selfr*   r+   r-   r.   s   &&&&&r   __init__FileType.__init__3   s     
!r   c                    V ^8  d   QhRRRR/# )r   stringr   r   z	typing.IOr   )r   s   "r   r   r/   ?   s     6 6s 6y 6r   c                	  a  VR 8X  d   RS P                   9   d<   RS P                   9   d   \        P                  P                  # \        P                  # \        ;QJ d    V 3R lR 4       F  '       g   K   RM	  RM! V 3R lR 4       4      '       d<   RS P                   9   d   \        P
                  P                  # \        P
                  # RS P                    2p\        V4      h \        VS P                   S P                  S P                  S P                  4      #   \         d$   pRT R	T 2p\        P                  ! T4      hR
p?ii ; i)-rbc              3  @   <"   T F  qSP                   9   x  K  	  R # 5ir1   )r2   ).0cr6   s   & r   	<genexpr>$FileType.__call__.<locals>.<genexpr>D   s     4e$**_es   waxTFzargument "-" with mode zcan't open 'z': N)r2   sysstdinbufferanystdout
ValueErroropenr3   r4   r5   OSErrorargparseArgumentTypeError)r6   r:   msgemessages   f&   r   __call__FileType.__call__?   s    S=djj +.$**+<syy''K#))K4e44e444,/4::,=szz((M3::M/

|< o%	6

DMM4>>4<<XX 	6$VHCs3G,,W55	6s   +6D" "E-EEc                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   r/   Q   s     4 4# 4r   c           
     	h   V P                   V P                  3pR V P                  3RV P                  3.pRP	                  V Uu. uF  q3R8w  g   K  \        V4      NK  	  upV UUu. uF  w  rCVf   K  V RV: 2NK  	  upp,           4      p\        V 4      P                   RV R2# u upi u uppi )r-   r.   , =())r2   r3   r4   r5   r   reprtype__name__)r6   argskwargsargkwargs_strs   &     r   __repr__FileType.__repr__Q   s    zz4==(t~~.4<<0HI99"&4$3)YT#Y$4.4Hf72"QsgfHI
 t*%%&az33 5Hs   B)B)'B.4B.)r3   r4   r5   r2   )r=   rZ   NN)	r]   
__module____qualname____firstlineno____doc__r7   rR   rc   __static_attributes__r   r   r   r(   r(       s    $
6$4 4r   r(   c                    V ^8  d   QhRRRR/# )r   argvzlist[str] | Noner   r,   r   )r   s   "r   r   r   [   s     L L% L Lr   c                B   \         P                  ! RR7      pVP                  R\        R4      RRR7       VP                  RR	R
RRRR7       VP                  RRR
RRRR7       VP                  RRR
RRRR7       VP                  RRR
RRRR7       VP                  RRR
RRRR7       VP                  RR R
RR!R"R7       VP                  R#R$R
RR%R&R7       VP                  R'R(R)R*\        R+R,R-7       TP                  R.R/R0P                  \        \        4       \        \        P                  P                  4       P                  R14      '       d   R2MR34      R4R57       VP                  V 4      pVP                  R6J dc   VP                  RJ dS   VP                   '       d$   VP                    F  pVP#                  4        K  	  \%        R7\&        P(                  R87       ^# VP*                  R6J dc   VP                  RJ dS   VP                   '       d$   VP                    F  pVP#                  4        K  	  \%        R9\&        P(                  R87       ^# VP,                  R:8  g   VP,                  R;8  dS   VP                   '       d$   VP                    F  pVP#                  4        K  	  \%        R<\&        P(                  R87       ^# . pVP                    EFb  p\/        VVP,                  VP0                  VP2                  RJ R=7      pVP5                  4       pVf   \%        R?P                  VP6                  VP,                  R;8  d   R@MRA4      \&        P(                  R87       VP9                  \;        \=        VP6                  4      R>. . RB. RR;R:R>R64      4       EMwTP9                  \;        \=        VP6                  4      VP>                  VP@                  VPB                   Uu. uF  pWvP>                  8w  g   K  VNK  	  upVPD                  VPF                  VPH                  VPJ                  VPL                  R>R64      4       \O        V4      ^8  d   VPP                  '       d   V F  pW8w  g   K  TP9                  \;        \=        VP6                  4      VP>                  VP@                  VPB                   Uu. uF  pWxP>                  8w  g   K  VNK  	  upVPD                  VPF                  VPH                  VPJ                  VPL                  R>R4      4       K  	  VP                  R6J Ed   VP>                  PS                  RC4      R6J dX   \%        RDP                  VP6                  4      \&        P(                  R87       VPT                  RJ d   VP#                  4        EK  \W        \Y        VP6                  4      4      p	\[        \Y        VP6                  4      4      p
V
P]                  RE4      pVP                  RJ d>   VP_                  RLVP>                  4       VPT                  RJ d   VP#                  4        M\VP*                  RJ dM   \a        RFP                  VP6                  4      RG4      RJ d$   VPT                  RJ d   VP#                  4        EK   \c        V	REPc                  V4      4      V^ ,          n2        \g        V^ ,          Pd                  RH4      ;_uu_ 4       pVPi                  VPk                  4       4       R>R>R>4       VPT                  RJ g   EKR  VP#                  4        EKe  	  VPp                  RJ dV   \%        \s        \O        V4      ^8  d   V Uu. uF  qPt                  NK  	  upMV^ ,          Pt                  R6^RI7      4       ^ # VP                    Fg  p\%        RJPc                  V Uu. uF?  pVPv                  \=        VP6                  4      8X  g   K)  VP>                  ;'       g    RKNKA  	  up4      4       Ki  	  ^ # u upi u upi   + '       g   i     EL!; i  \l         dQ   p\%        \o        T4      \&        P(                  R87       TPT                  RJ d   TP#                  4         R>p? ^# R>p?ii ; iu upi u upi )Mzx
CLI assistant using ARGV and ArgumentParser
:param argv:
:return: 0 if everything is fine, anything else equal trouble
zvThe Real First Universal Charset Detector. Discover originating encoding used on text file. Normalize text to unicode.)descriptionfilesrb+zFile(s) to be analysed)r\   nargshelpz-vz	--verbose
store_trueFverbosezjDisplay complementary information about file if any. Stdout will contain logs about the detection process.)actionr   destrr   z-az--with-alternativealternativeszIOutput complementary possibilities if any. Top-level JSON WILL be a list.z-nz--normalize	normalizezLPermit to normalize input file. If not set, program does not write anything.z-mz	--minimalminimalzBOnly output the charset detected to STDOUT. Disabling JSON output.z-rz	--replacereplacezGReplace file when trying to normalize it instead of creating a new one.z-fz--forceforcezHReplace file without asking if you are sure, use this flag with caution.z-iz--no-preemptiveno_preemptivez>Disable looking at a charset declaration to hint the detector.z-tz--thresholdstoreg?	thresholdzUDefine a custom maximum amount of noise allowed in decoded content. 0. <= noise <= 1.)ru   r   r\   rv   rr   z	--versionversionz;Charset-Normalizer {} - Python {} - Unicode {} - SpeedUp {}z.pyOFFONz"Show version information and exit.)ru   r   rr   Tz.Use --replace in addition of --normalize only.)filez*Use --force in addition of --replace only.g        g      ?z---threshold VALUE should be between 0. AND 1.)r~   explainpreemptive_behaviourNz4Unable to identify originating encoding for "{}". {}z-Maybe try increasing maximum amount of chaos. UnknownutfzJ"{}" file does not need to be normalized, as it already came from unicode..z0Are you sure to normalize "{}" by replacing it ?r   wb)ensure_asciiindentrV   	undefinedrZ   )<rM   ArgumentParseradd_argumentr(   floatr   r   r
   r   	md_module__file__r"   endswith
parse_argsrz   rx   rn   closer#   rE   stderrr{   r~   r   rt   r|   bestnameappendr   r   r-   encoding_aliasescould_be_from_charsetlanguage	alphabetsbompercent_chaospercent_coherencelenrw   
startswithclosedr   r	   r   splitinsertr&   r   unicode_pathrK   writeoutputrL   r   ry   r   __dict__path)rk   parserr^   my_filex_matches
best_guesscpeldir_path	file_nameo_fprP   s   &             r   
cli_detectr   [   s    $$%F htnC6N   @   X   [   Q   V   W   M   d   MTT''--/88??ET	
 2  
 T"D||t% 7::::: &>SZZPzzTdlle3::::: &:L~~t~~3::::: &=CJJO	B::nnLL!%!3!3u!<	
 \\^
FMMLL  >>C/ H ZZ
 II"GLL)  II"GLL)''// #-"B"B"BB!4!44 "B
 ''((NN,,00( 7|aD$5$5$5!B'		. ' 5 " " 3 3 /1.F.F!".F')[['8 %'B.F!"
 !# " " " 0 0 " 4 4 $ % ", ~~%&&11%8D@dkk#LL !ZZ	 ~~."8GLL#9:$Xgll%;<	 ) 4<<5(IIb*"5"56~~.JJ%'$JQQ#LL 	  ~~.	)-h)EBqE&be00$772!2!2!45 8 >>U"MMOA D ||u.1"gkr*rr*r!u~~!	
&  zzG		 #%"$B77ggll&;; 322{2"$ " W.!"j 877 #a&szz2~~.	 +sh   &`=`>` ` !A`9- `%`9+b&b0bb%`60`96`99bAbb__main__)r   r1   )
__future__r   rM   rE   typingjsonr   os.pathr   r   r   r   r	   platformr
   unicodedatar   charset_normalizer.mdmdr   charset_normalizerr   charset_normalizer.modelsr   charset_normalizer.versionr   r&   r(   r   r]   r   r   r   <module>r      sW    "  
   > > # ' ) & 8 2184 84vL^ zL r   