+
    Ĝi,~                        ^ RI HtHtHt ^ RIHt ^ RIHtHt ^ RI	t	^ RI
t
^ RIHtHt ^ RIt^RIHtHtHtHt ^RIHt ^RIHt ]! ] U u. uF  q P1                  R	4      NK  	  up 4      t]! ] U u. uF  q P1                  R	4      NK  	  up 4      t]! ] U u. uF  q P1                  R	4      NK  	  up 4      t]]! R
R.4      ,          tRt]P<                  '       dQ   ]R>,          R8X  d   ]P?                  R4      ^8X  g   Q h]
P@                  ! ]RR> ]!! R4      ,           R,           4      t"M]
P@                  ! ]4      t"0 RkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkRkR kR!kR"kR#kR$kR%kR&kR'kR(kR)kR*kR+kR,kR-kR.kt#]
P@                  ! R/4      t$/ t% ! R0 R1]&4      t'R2 t( ! R3 R4]&4      t) ! R5 R6])4      t* ! R7 R8]+4      t, ! R9 R:]&4      t- ! R; R<]&4      t.R= t/R# u up i u up i u up i )?    )absolute_importdivisionunicode_literals)	text_type)http_clienturllibN)BytesIOStringIO)EOFspaceCharactersasciiLettersasciiUppercase)_ReparseException)_utilsascii   >   <u   [---﷐-﷯￾￿🿾🿿𯿾𯿿𿿾𿿿񏿾񏿿񟿾񟿿񯿾񯿿񿿾񿿿򏿾򏿿򟿾򟿿򯿾򯿿򿿾򿿿󏿾󏿿󟿾󟿿󯿾󯿿󿿾󿿿􏿾􏿿]]z"\uD800-\uDFFF"i i i i i i i i i i i i i i i i i	 i	 i
 i
 i i i i i i i i i i i i z[	- -/:-@\[-`{-~]c                   N   a  ] tR t^3t o RtR tR tR tR tR t	R t
R tR	tV tR
# )BufferedStreamzBuffering for streams that do not have buffering of their own

The buffer is implemented as a list of chunks on the assumption that
joining many strings will be slow since it is O(n**2)
c                2    Wn         . V n        R^ .V n        R#    N)streambufferposition)selfr   s   &&^/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/html5lib/_inputstream.py__init__BufferedStream.__init__:   s    Q    c                    ^ pV P                   RV P                  ^ ,            F  pV\        V4      ,          pK  	  WP                  ^,          ,          pV# r   N)r   r   len)r   poschunks   &  r   tellBufferedStream.tell?   sJ    [[!2$--"23E3u:C 4}}Q
r"   c                    WP                  4       8:  g   Q hTp^ p\        V P                  V,          4      V8  d/   V\        V P                  V,          4      ,          pV^,          pKO  W2.V n        R# r$   )_bufferedBytesr%   r   r   )r   r&   offsetis   &&  r   seekBufferedStream.seekF   s_    ))++++$++a.!F*c$++a.))FFAr"   c                F   V P                   '       g   V P                  V4      # V P                  ^ ,          \        V P                   4      8X  dD   V P                  ^,          \        V P                   R,          4      8X  d   V P                  V4      # V P	                  V4      # )r   r   )r   _readStreamr   r%   _readFromBufferr   bytess   &&r   readBufferedStream.readO   sv    {{{##E**mmA#dkk"22mmA#dkk"o"66##E**''..r"   c                h    \        V P                   Uu. uF  p\        V4      NK  	  up4      # u upi N)sumr   r%   )r   items   & r   r+   BufferedStream._bufferedBytesX   s'    $++6+$CI+6776s   /c                    V P                   P                  V4      pV P                  P                  V4       V P                  ^ ;;,          ^,          uu&   \        V4      V P                  ^&   V# r   )r   r5   r   appendr   r%   )r   r4   datas   && r   r1   BufferedStream._readStream[   sS    {{&4 aAt9ar"   c                8   Tp. pV P                   ^ ,          pV P                   ^,          pV\        V P                  4      8  d   V^ 8w  d   V^ 8  g   Q hV P                  V,          pV\        V4      V,
          8:  d   TpWEV,           .V n         M-\        V4      V,
          pV\        V4      .V n         V^,          pVP                  WeWW,            4       W',          p^ pK  V'       d!   VP                  V P	                  V4      4       RP                  V4      # )r   r"   )r   r%   r   r>   r1   join)r   r4   remainingBytesrvbufferIndexbufferOffsetbufferedDatabytesToReads   &&      r   r2   BufferedStream._readFromBufferb   s    mmA&}}Q'C,,11D!A%%%;;{3L\!2\!AA,!,[.H I!,/,>!,c,.? @q IIl0JKL)NLIId&&~67xx|r"   )r   r   r   N)__name__
__module____qualname____firstlineno____doc__r    r(   r.   r5   r+   r1   r2   __static_attributes____classdictcell____classdict__s   @r   r   r   3   s2      
$/8 r"   r   c                 D   \        V \        P                  4      '       gU   \        V \        P                  P
                  4      '       d.   \        V P                  \        P                  4      '       d   R pMB\        V R4      '       d!   \        V P                  ^ 4      \        4      pM\        V \        4      pV'       dP   V Uu. uF  q3P                  R4      '       g   K  VNK  	  ppV'       d   \        RV,          4      h\        V 3/ VB # \        V 3/ VB # u upi )Fr5   	_encodingz3Cannot set an encoding with a unicode input, set %r)
isinstancer   HTTPResponser   responseaddbasefphasattrr5   r   endswith	TypeErrorHTMLUnicodeInputStreamHTMLBinaryInputStream)sourcekwargs	isUnicodex	encodingss   &,   r   HTMLInputStreamrd   }   s     	6;3344	FFOO33	4	4	FII{77	8	8			 	 v{{1~y9	vy1	 &B1**[*AQQ	BQT]]^^%f777$V6v66 Cs   D#Dc                   r   a  ] tR t^t o RtRtR tR tR tR t	R t
R tRR
 ltR tR tRR ltR tRtV tR	# )r]   Provides a unicode stream of characters to the HTMLTokenizer.

This class takes care of character encoding and removing or replacing
incorrect byte-sequences and also provides column and line tracking.

i (  c                (   \         P                  '       g	   RV n        M3\        R4      ^8X  d   V P                  V n        MV P
                  V n        ^ .V n        \        R4      R3V n        V P                  V4      V n
        V P                  4        R# )  Initialises the HTMLInputStream.

HTMLInputStream(source, [encoding]) -> Normalized stream from source
for use by html5lib.

source can be either a file-object, local filename or a string.

The optional encoding parameter must be a string that indicates
the encoding.  If specified, that encoding will be used,
regardless of any BOM or later declaration (such as in a meta
element)

Nu   􏿿utf-8certain)r   supports_lone_surrogatesreportCharacterErrorsr%   characterErrorsUCS4characterErrorsUCS2newLineslookupEncodingcharEncoding
openStream
dataStreamreset)r   r_   s   &&r   r    HTMLUnicodeInputStream.__init__   sy     ... *.D&!#)-)A)AD&)-)A)AD& +G4i@//&1

r"   c                h    R V n         ^ V n        ^ V n        . V n        ^ V n        ^ V n        RV n        R# ) N)r'   	chunkSizechunkOffseterrorsprevNumLinesprevNumCols_bufferedCharacterr   s   &r   rt   HTMLUnicodeInputStream.reset   s;    
  #'r"   c                H    \        VR4      '       d   TpV# \        V4      pV# zfProduces a file object from source.

source can be either a file object, local filename or a string.

r5   )rZ   r
   r   r_   r   s   && r   rr   !HTMLUnicodeInputStream.openStream   s.     66""F  f%Fr"   c                    V P                   pVP                  R ^ V4      pV P                  V,           pVP                  R ^ V4      pVR8X  d   V P                  V,           pWF3# W^,           ,
          pWF3# )
r   )r'   countr{   rfindr|   )r   r,   r'   nLinespositionLinelastLinePospositionColumns   &&     r   	_position HTMLUnicodeInputStream._position   sy    

T1f-((61kk$62"!--6N -- $Q7N--r"   c                R    V P                  V P                  4      w  rV^,           V3# )z:Returns (line, col) of the current position in the stream.)r   ry   )r   linecols   &  r   r   HTMLUnicodeInputStream.position   s&    NN4#3#34	q#r"   c                    V P                   V P                  8  d   V P                  4       '       g   \        # V P                   pV P                  V,          pV^,           V n         V# )zZRead one character from the stream or queue if available. Return
EOF when EOF is reached.
)ry   rx   	readChunkr   r'   )r   ry   chars   &  r   r   HTMLUnicodeInputStream.char   sR    
 t~~->>##
&&zz+&&?r"   Nc                   Vf   V P                   pV P                  V P                  4      w  V n        V n        RV n        ^ V n        ^ V n        V P                  P                  V4      pV P                  '       d   V P                  V,           pR V n	        M
V'       g   R# \        V4      ^8  d?   \        VR	,          4      pV^8X  g   RTu;8:  d   R8:  d   M MVR	,          V n	        VR R	 pV P                  '       d   V P                  V4       VP                  RR4      pVP                  RR4      pW n        \        V4      V n        R# )
Nrw   F   i  z
r   Tr   )_defaultChunkSizer   rx   r{   r|   r'   ry   rs   r5   r}   r%   ordrl   replace)r   rx   r?   lastvs   &&  r   r    HTMLUnicodeInputStream.readChunk   s   ..I.2nnT^^.L+4+
##I. """**T1D&*D#t9q=RME}% 96 9*.r('CRy%%%&&t, ||FD)||D$'
Tr"   c                    \        \        \        P                  V4      4      4       F  pV P                  P                  R 4       K   	  R# )invalid-codepointN)ranger%   invalid_unicode_refindallrz   r>   )r   r?   _s   && r   rm   *HTMLUnicodeInputStream.characterErrorsUCS4  s5    s-55d;<=AKK23 >r"   c                F   R p\         P                  V4       EF  pV'       d   K  \        VP                  4       4      pVP	                  4       p\
        P                  ! WV^,            4      '       dJ   \
        P                  ! WV^,            4      pV\        9   d   V P                  P                  R4       RpK  VR8  d<   VR8:  d5   V\        V4      ^,
          8X  d   V P                  P                  R4       K  R pV P                  P                  R4       EK  	  R# )Fr   Tr   i  N)r   finditerr   groupstartr   isSurrogatePairsurrogatePairToCodepointnon_bmp_invalid_codepointsrz   r>   r%   )r   r?   skipmatch	codepointr&   char_vals   &&     r   rn   *HTMLUnicodeInputStream.characterErrorsUCS2#  s     '006EEKKM*I++-C%%dsQw&788!::4C!G;LM99KK&&':;v%)v*=TQ&""#67""#67# 7r"   c           
     4    \         W3,          p. p TP                  T P                  T P                  4      pTf   T P                  T P                  8w  d   MMOTP                  4       pYP                  8w  d0   TP                  T P                  T P                  T 4       Yn        MATP                  T P                  T P                  R 4       T P                  4       '       d   K   RP                  T4      p	T	#   \         d     T F  p\        T4      ^8  d   K  Q h	  RP                  T Uu. uF  pR\        T4      ,          NK  	  Mu upi up4      pT'       g
   RT,          p\        P
                  ! RT,          4      ;p\         Y3&    ELi ; i)zReturns a string of characters from the stream up to but not
including any character in 'characters' or EOF. 'characters' must be
a container that supports the 'in' method and iteration over its
characters.
rw   z\x%02xz^%sz[%s]+N)charsUntilRegExKeyErrorr   rB   recompiler   r'   ry   rx   endr>   r   )
r   
charactersoppositecharscregexrD   mr   rs
   &&&       r   
charsUntil!HTMLUnicodeInputStream.charsUntil:  sa   		Z#Z$:;E DJJ(8(89Ay ##t~~5 6 eeg ..(IIdjj)9)9#>?'*$ IIdjj!1!1!234>>##GGBKG  	Z#Aq6C<(< $GGDAYQ//DEE>@jjSX>YYEOZ$:;	Zs)   C= =F F3E
F#0FFc                   V\         Jd   V P                  ^ 8X  d3   WP                  ,           V n        V ;P                  ^,          un        R# V ;P                  ^,          un        V P                  V P                  ,          V8X  g   Q hR# R# r$   )r   ry   r'   rx   )r   r   s   &&r   ungetHTMLUnicodeInputStream.ungeti  sj     s?1$ "JJ.
!#  A% zz$"2"23t;;; r"   )r}   rq   r'   ry   rx   rs   rz   ro   r|   r{   rl   r8   F)rJ   rK   rL   rM   rN   r   r    rt   rr   r   r   r   r   rm   rn   r   r   rO   rP   rQ   s   @r   r]   r]      sQ      @'	.
$L48.-^< <r"   r]   c                   V   a  ] tR tRt o RtRR ltR tR tRR ltR t	R	 t
R
 tRtV tR# )r^   iz  rf   Nc                B   V P                  V4      V n        \        P                  W P                  4       RV n        ^dV n        W n        W0n        W@n        WPn	        W`n
        V P                  V4      V n        V P                  ^ ,          f   Q hV P                  4        R# )rh   i   N)rr   	rawStreamr]   r    numBytesMetanumBytesChardetoverride_encodingtransport_encodingsame_origin_parent_encodinglikely_encodingdefault_encodingdetermineEncodingrq   rt   )r   r_   r   r   r   r   r   
useChardets   &&&&&&&&r   r    HTMLBinaryInputStream.__init__  s    $ 0''nn=
 !"!2"4+F(. 0 !22:>  #/// 	

r"   c                    V P                   ^ ,          P                  P                  V P                  R4      V n        \
        P                  V 4       R# )r   r   N)rq   
codec_infostreamreaderr   rs   r]   rt   r~   s   &r   rt   HTMLBinaryInputStream.reset  s:    ++A.99FFt~~W`a$$T*r"   c                    \        VR4      '       d   TpM\        V4      p VP                  VP                  4       4       V#   \         d    \        T4      p T# i ; ir   )rZ   r	   r.   r(   	Exceptionr   r   s   && r   rr    HTMLBinaryInputStream.openStream  s]     66""FV_F	,KK&   	,#F+F	,s   A AAc                :   V P                  4       R 3pV^ ,          e   V# \        V P                  4      R 3pV^ ,          e   V# \        V P                  4      R 3pV^ ,          e   V# V P	                  4       R3pV^ ,          e   V# \        V P
                  4      R3pV^ ,          e+   V^ ,          P                  P                  R4      '       g   V# \        V P                  4      R3pV^ ,          e   V# V'       d    ^ RI	H
p . pV! 4       pVP                  '       gk   V P                  P                  V P                  4      p\        V\         4      '       g   Q hV'       g   M$VP#                  V4       VP%                  V4       K|  VP'                  4        \        VP(                  R,          4      pV P                  P+                  ^ 4       Ve   VR3#  \        V P.                  4      R3pV^ ,          e   V# \        R4      R3#   \,         d     L>i ; i)rj   	tentativezutf-16)UniversalDetectorencodingwindows-1252)	detectBOMrp   r   r   detectEncodingMetar   name
startswithr   chardet.universaldetectorr   doner   r5   r   rU   r4   r>   feedcloseresultr.   ImportErrorr   )r   chardetrq   r   buffersdetectorr   r   s   &&      r   r   'HTMLBinaryInputStream.determineEncoding  s    ~~'2?& &d&<&<=yH?& &d&=&=>	I?& ..0+=?& &d&F&FGT?&|A/C/C/N/Nx/X/X &d&:&:;[H?& 1G ,."---!^^001E1EFF%fe4444!NN6*MM&) )(//**EF##A&'#[00 ( &d&;&;<kI?& n-{::1  s    H HHc                   V P                   ^,          R8w  g   Q h\        V4      pVf   R# VP                  R9   d   \        R4      pVf   Q hR# WP                   ^ ,          8X  d   V P                   ^ ,          R3V n         R# V P                  P	                  ^ 4       VR3V n         V P                  4        \        RV P                   ^ ,          : RV: 24      h)r   rj   Nri   zEncoding changed from z to utf-16beutf-16le)rq   rp   r   r   r.   rt   r   )r   newEncodings   &&r   changeEncoding$HTMLBinaryInputStream.changeEncoding  s      #y000$[177(1K***--a00!%!2!21!5y ADNN"!,i 8DJJL#HYHYZ[H\H\^i$jkkr"   c           
     P   \         P                  R\         P                  R\         P                  R\         P                  R\         P
                  R/pV P                  P                  ^4      p\        V\        4      '       g   Q hVP                  VR,          4      p^pV'       g6   VP                  V4      p^pV'       g   VP                  VR,          4      p^pV'       d'   V P                  P                  V4       \        V4      # V P                  P                  ^ 4       R# )	zAttempts to detect at BOM at the start of the stream. If
an encoding can be determined from the BOM return the name of the
encoding otherwise return Noneri   r   r   zutf-32lezutf-32be:N   N:N   NN)codecsBOM_UTF8BOM_UTF16_LEBOM_UTF16_BEBOM_UTF32_LEBOM_UTF32_BEr   r5   rU   r4   getr.   rp   )r   bomDictstringr   r.   s   &    r   r   HTMLBinaryInputStream.detectBOM  s    
 OOWV-@-@*V-@-@*
 $$Q'&%(((( ;;vbz*{{6*HD";;vbz2 NN%!(++NN"r"   c                ,   V P                   P                  V P                  4      p\        V\        4      '       g   Q h\        V4      pV P                   P                  ^ 4       VP                  4       pVe   VP                  R9   d   \        R4      pV# )z9Report the encoding declared by the meta element
        ri   r   )
r   r5   r   rU   r4   EncodingParserr.   getEncodingr   rp   )r   r   parserr   s   &   r   r   (HTMLBinaryInputStream.detectEncodingMeta3  s|     $$T%6%67&%(((('A%%'HMM5M$M%g.Hr"   )
rq   rs   r   r   r   r   r   r   r   r   )NNNNr   TT)rJ   rK   rL   rM   rN   r    rt   rr   r   r   r   r   rO   rP   rQ   s   @r   r^   r^   z  s6     (T+&<;|l  D r"   r^   c                      a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 t]! ]]4      tR t]! ]4      t]3R ltR tR tR tRtV tR# )EncodingBytesiB  zString-like object with an associated position and various extra methods
If the position is ever greater than the string length then an exception is
raisedc                x    \        V\        4      '       g   Q h\        P                  WP                  4       4      # r8   )rU   r4   __new__lowerr   values   &&r   r  EncodingBytes.__new__F  s*    %''''}}T;;=11r"   c                    RV n         R# r   r   r
  s   &&r   r    EncodingBytes.__init__J  s	    r"   c                    V # r8    r~   s   &r   __iter__EncodingBytes.__iter__N  s    r"   c                    V P                   ^,           ;qn         V\        V 4      8  d   \        hV^ 8  d   \        hWV^,            # r   r   r%   StopIterationr\   r   ps   & r   __next__EncodingBytes.__next__Q  s@    !^^a//ND	>UOa!e}r"   c                "    V P                  4       # r8   )r  r~   s   &r   nextEncodingBytes.nextY  s    }}r"   c                    V P                   pV\        V 4      8  d   \        hV^ 8  d   \        hV^,
          ;V n         pWV^,            # r=   r  r  s   & r   previousEncodingBytes.previous]  sF    NND	>UOU"a!e}r"   c                R    V P                   \        V 4      8  d   \        hWn         R # r8   r   r%   r  )r   r   s   &&r   setPositionEncodingBytes.setPositionf  s    >>SY&!r"   c                    V P                   \        V 4      8  d   \        hV P                   ^ 8  d   V P                   # R# r$   r#  r~   s   &r   getPositionEncodingBytes.getPositionk  s1    >>SY&>>Q>>!r"   c                @    W P                   V P                   ^,            # r  )r   r~   s   &r   getCurrentByteEncodingBytes.getCurrentByteu  s    MM$--!"344r"   c                    V P                   pV\        V 4      8  d%   WV^,            pW19  d	   W n        V# V^,          pK4  W n        R# )zSkip past a list of charactersNr   r%   r   r   r   r  r   s   &&  r   r   EncodingBytes.skipz  sC    MM#d)mq1uA~!"FAr"   c                    V P                   pV\        V 4      8  d%   WV^,            pW19   d	   W n        V# V^,          pK4  W n        R# )r   Nr-  r.  s   &&  r   	skipUntilEncodingBytes.skipUntil  sC    MM#d)mq1uAz!"FAr"   c                    V P                  WP                  4      pV'       d#   V ;P                  \        V4      ,          un        V# )zLook for a sequence of bytes at the start of a string. If the bytes
are found return True and advance the position to the byte after the
match. Otherwise return False and leave the position alone)r   r   r%   )r   r4   rD   s   && r   
matchBytesEncodingBytes.matchBytes  s0     __UMM2MMSZ'M	r"   c                     V P                  WP                  4      \        V4      ,           ^,
          V n        R#   \         d    \
        hi ; i)zLook for the next sequence of bytes matching a given sequence. If
a match is found advance the position to the last byte of the matchT)indexr   r%   r   
ValueErrorr  r3   s   &&r   jumpToEncodingBytes.jumpTo  sE    	 !ZZ}}=E
JQNDN   	 	 s	   7; Ar  N)rJ   rK   rL   rM   rN   r  r    r  r  r  r   r$  r'  propertyr   r*  currentBytespaceCharactersBytesr   r1  r4  r9  rO   rP   rQ   s   @r   r  r  B  sm     2"
 [1H5 >*K- 
	 r"   r  c                   Z   a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )r   i  z?Mini parser for detecting character encoding from meta elementsc                4    \        V4      V n        RV n        R# )z3string - the data to work on for encoding detectionN)r  r?   r   r   r?   s   &&r   r    EncodingParser.__init__  s    !$'	r"   c                <   R V P                   9  d   R# RV P                  3R V P                  3RV P                  3RV P                  3RV P                  3RV P
                  33pV P                    Fl  pRp V P                   P                  R4       T F0  w  rET P                   P                  T4      '       g   K(   T! 4       p M	  T'       d   Ka   T P                  # 	  V P                  #   \         d      T P                  # i ; i  \         d    Rp  KS  i ; i)	s   <metaNs   <!--s   </s   <!s   <?r   TF)
r?   handleComment
handleMetahandlePossibleEndTaghandleOtherhandlePossibleStartTagr9  r  r4  r   )r   methodDispatchr   keepParsingkeymethods   &     r   r  EncodingParser.getEncoding  s"   499$ d(()t'D--.D$$%D$$%4../1 AK		  &  .99'',,&,h	  . ;}}# " }} !  }} ) &+s$   6C,<D	,DD	DDc                8    V P                   P                  R4      # )zSkip over commentss   -->r?   r9  r~   s   &r   rC  EncodingParser.handleComment  s    yy''r"   c                
   V P                   P                  \        9  d   R # RpRp V P                  4       pVf   R # V^ ,          R8X  d%   V^,          R8H  pV'       d   Ve	   W n        R# KG  KI  V^ ,          R8X  d#   V^,          p\        V4      pVe	   WPn        R# Ky  V^ ,          R8X  g   K  \        \        V^,          4      4      pVP                  4       pVf   K  \        V4      pVf   K  V'       d	   WPn        R# TpK  )TFNs
   http-equivs   content-type   charsets   content)	r?   r<  r=  getAttributer   rp   ContentAttrParserr  parse)r   	hasPragmapendingEncodingattrtentativeEncodingcodeccontentParsers   &      r   rD  EncodingParser.handleMeta  s    99  (<<	$$&D|7m+ $Q? :I _%@(7$ &Ay !W
*(,Q%*+<=E((-$ ) !W
*$5mDG6L$MM(5(;(;(=%(4 ./@ A ,(05',27r"   c                $    V P                  R 4      # r   )handlePossibleTagr~   s   &r   rG  %EncodingParser.handlePossibleStartTag  s    %%e,,r"   c                N    \        V P                  4       V P                  R 4      # r  )r  r?   r]  r~   s   &r   rE  #EncodingParser.handlePossibleEndTag  s    TYY%%d++r"   c                D   V P                   pVP                  \        9  d+   V'       d!   VP                  4        V P	                  4        R # VP                  \        4      pVR8X  d   VP                  4        R # V P                  4       pVe   V P                  4       pK  R # )Tr   )r?   r<  asciiLettersBytesr   rF  r1  spacesAngleBracketsrR  )r   endTagr?   r   rW  s   &&   r   r]   EncodingParser.handlePossibleTag  s    yy#44   "NN./9 MMO  $$&D"((*r"   c                8    V P                   P                  R 4      # )r   rN  r~   s   &r   rF  EncodingParser.handleOther  s    yy%%r"   c                $   V P                   pVP                  \        \        R.4      ,          4      pVe   \	        V4      ^8X  g   Q hVR9   d   R# . p. p VR8X  d
   V'       d   MV\        9   d   VP                  4       pMiVR9   d   RP                  V4      R3# V\        9   d!   VP                  VP                  4       4       MVf   R# VP                  V4       \        V4      pK  VR8w  d$   VP                  4        RP                  V4      R3# \        V4       VP                  4       pVR9   d   Tp \        V4      pW%8X  d.   \        V4       RP                  V4      RP                  V4      3# V\        9   d"   VP                  VP                  4       4       Kk  VP                  V4       K~  VR8X  d   RP                  V4      R3# V\        9   d!   VP                  VP                  4       4       MVf   R# VP                  V4        \        V4      pV\        9   d#   RP                  V4      RP                  V4      3# V\        9   d"   VP                  VP                  4       4       Ke  Vf   R# VP                  V4       K~  )	zWReturn a name,value pair for the next attribute in the stream,
if one is found, or None   /Nr      =r"   )r   N)ri  r   )   '   ")r?   r   r=  	frozensetr%   rB   asciiUppercaseBytesr>   r	  r  r   rc  )r   r?   r   attrName	attrValue	quoteChars   &     r   rR  EncodingParser.getAttribute  s$    yyII*Yv->>?yCFaK''	DyX**IIKl"xx)3..))	*"T
A9MMO88H%s**T
IIKIJ>J88H-sxx	/BBB--$$QWWY/ $$Q'$Y88H%s**%%QWWY'YQT
A''xx)388I+>>>))  +  #r"   )r?   r   N)rJ   rK   rL   rM   rN   r    r  rC  rD  rG  rE  r]  rF  rR  rO   rP   rQ   s   @r   r   r     s=     I
<("8H-,.&J$ J$r"   r   c                   ,   a  ] tR tRt o R tR tRtV tR# )rS  i`  c                B    \        V\        4      '       g   Q hWn        R # r8   )rU   r4   r?   r@  s   &&r   r    ContentAttrParser.__init__a  s    $&&&&	r"   c                    V P                   P                  R 4       V P                   ;P                  ^,          un        V P                   P                  4        V P                   P                  R8X  g   R# V P                   ;P                  ^,          un        V P                   P                  4        V P                   P                  R9   d   V P                   P                  pV P                   ;P                  ^,          un        V P                   P                  pV P                   P                  V4      '       d#   V P                   W P                   P                   # R# V P                   P                  p V P                   P                  \        4       V P                   W P                   P                   #   \         d    T P                   TR u # i ; i  \         d     R# i ; i)rQ  rj  N)rl  rk  )r?   r9  r   r   r<  r1  r=  r  )r   	quoteMarkoldPositions   &  r   rT  ContentAttrParser.parsee  sa   	 IIZ(II!#IINN99((D0II!#IINNyy$$4 II11			""a'""ii0099##I..99[1C1CDD #ii003II''(<=99[1C1CDD$ 399[\223  		sD   A3G 7CG ?!G #G :A F; ;GG GG G*)G*)r?   N)rJ   rK   rL   rM   r    rT  rO   rP   rQ   s   @r   rS  rS  `  s      r"   rS  c                    \        V \        4      '       d    V P                  R4      p V e    \        P
                  ! V 4      # R#   \         d     R# i ; i  \         d     R# i ; i)zwReturn the python codec name corresponding to an encoding or None if the
string doesn't correspond to a valid encoding.r   N)rU   r4   decodeUnicodeDecodeErrorwebencodingslookupAttributeError)r   s   &r   rp   rp     sn     (E""	w/H 	&&x00  " 		  		s"   A A AAA'&A'r   )0
__future__r   r   r   sixr   	six.movesr   r   r   r   ior	   r
   r}  	constantsr   r   r   r   r   rw   r   rm  encoder=  rb  rn  rc  invalid_unicode_no_surrogaterk   r   r   evalr   r   ascii_punctuation_rer   objectr   rd   r]   r^   r4   r  r   rS  rp   )r:   s   0r   <module>r     s   B B  )  	    I I (  !?!S?4++g"6?!ST M{{73MN . Q.$W!5. QR *Yd|-DD   j 	"""
 (+s27S7Y7YZ]7^bc7ccc$@"$E$()<$=%>$'%( ) $@A2g 2w 2 2 2' 2%2'.20729@2BI2%2'.20729@2BI2 &2 (/2 182 :A2 CJ2 &	2 (/	2 18	2 :A	2 CJ	2
 &2
 (/2
 182
 :A2
 CJ2 '2 )12  zz"mn  GV GT7.c<V c<LE2 EP_E _Dy$V y$x$ $Nm "TM Qs   G1G#G(