Ë
    ©2ÚioG  ã                   óž  — d Z ddlZddlZddl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 ddlmZmZ ddlmZ ddlmZ ddlmZmZmZmZ d	d
lmZ d	dlmZ  ej<                  d«      Z ej<                  d«      Z  ejB                  «       Z"	  ejF                  e"«      jH                  dk(  rdZ"de› �dddœZ& G d„ de«      Z'd„ Z(d„ Z)d„ Z*d)d„Z+d„ Z,d„ Z-d„ Z.d„ Z/	 	 d*d„Z0ejb                  	 	 d+d„«       Z2 G d „ d!e3«      Z4 G d"„ d#e5«      Z6 G d$„ d%ejn                  «      Z8 G d&„ d'«      Z9ejb                  d(„ «       Z:y# e%$ r dZ"Y Œ™w xY w),z9Various utility functions and classes for URL management.é    N)ÚEmailMessage)ÚGzipFile)ÚBytesIOÚStringIO)ÚPath)Úrequest)ÚquoteÚunquoteÚurljoinÚurlsplité   )Ú__version__)ÚLOGGERz^([a-zA-Z][a-zA-Z0-9.+-]+):s   ^([a-zA-Z][a-zA-Z0-9.+-]+):Úasciiúutf-8zWeasyPrint z*/*zgzip, deflate)z
User-AgentÚAcceptzAccept-Encodingc                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚStreamingGzipFilec                 ó@   — t        j                  | |¬«       || _        y )N©Úfileobj)r   Ú__init__Úfileobj_to_close)Úselfr   s     úF/var/www/html/acx/venv/lib/python3.12/site-packages/weasyprint/urls.pyr   zStreamingGzipFile.__init__+   s   € Ü×Ñ˜$¨Õ0Ø 'ˆÕó    c                 ób   — t        j                  | «       | j                  j                  «        y ©N)r   Úcloser   ©r   s    r   r   zStreamingGzipFile.close/   s    € Ü�‰�tÔØ×Ñ×#Ñ#Õ%r   c                  ó   — y)NF© r    s    r   ÚseekablezStreamingGzipFile.seekable3   s   € Ør   N)Ú__name__Ú
__module__Ú__qualname__r   r   r#   r"   r   r   r   r   *   s   „ ò(ò&ór   r   c                 ó’   — | j                  d«      r| S | j                  | j                  d«      rt        nd«      } t        | d¬«      S )zDTurn a Unicode IRI into an ASCII-only URI that conforms to RFC 3986.zdata:úfile:r   s   /:?#[]@!$&'()*+,;=~%)Úsafe)Ú
startswithÚencodeÚFILESYSTEM_ENCODINGr	   ©Úurls    r   Ú
iri_to_urir/   7   s?   € à
‡~�~�gÔàˆ
à
�*‰*¨C¯N©N¸7Ô,CÕ(ÈÓ
Q€Cô �Ð2Ô3Ð3r   c                 ó(  — t        | t        «      rt        | «      } n%t        | t        «      r| j	                  t
        «      } | j                  t        j                  j                  df«      }t        j                  j                  | «      } |st        j                  j                  | «      r| t        j                  j                  z  } d}t        j                  | «      } |r| j                  d«      s| dz  } | j                  d«      rd| › �S d| › �S )zVReturn file URL of `path`.

    Accepts 'str', 'bytes' or 'Path', returns 'str'.

    ú/Tz///r(   zfile://)Ú
isinstancer   ÚstrÚbytesÚdecoder,   ÚendswithÚosÚpathÚsepÚabspathÚisdirr   Úpathname2urlr*   )r8   Úwants_trailing_slashs     r   Úpath2urlr>   G   sØ   € ô �$œÔÜ�4‹y‰Ü	�Dœ%Ô	 Ø�{‰{Ô.Ó/ˆàŸ=™=¬"¯'©'¯+©+°sÐ);Ó<ÐÜ�7‰7�?‰?˜4Ó €DÙœrŸw™wŸ}™}¨TÔ2ð 	”—‘—‘ÑˆØ#ÐÜ×Ñ Ó%€Dá D§M¡M°#Ô$6Ø�‰ˆØ‡��uÔð �t�fˆ~Ðà˜˜ÐÐr   c                 ón   — t        | t        «      rt        nt        }t	        |j                  | «      «      S )z4Return whether an URL (bytes or string) is absolute.)r2   r3   ÚUNICODE_SCHEME_REÚBYTES_SCHEME_REÚboolÚmatch)r.   Úschemes     r   Úurl_is_absoluterE   f   s'   € ä",¨S´#Ô"6Õ¼O€FÜ�—‘˜SÓ!Ó"Ð"r   c           	      óˆ   — | j                  |d«      j                  «       }|r t        |xs d||d| j                  ||f«      S y)a'  Get the URI corresponding to the ``attr_name`` attribute.

    Return ``None`` if:

    * the attribute is empty or missing or,
    * the value is a relative URI but the document has no base URI and
      ``allow_relative`` is ``False``.

    Otherwise return an URI, absolute if possible.

    Ú z<%s %s="%s">N)ÚgetÚstripÚurl_joinÚtag)ÚelementÚ	attr_nameÚbase_urlÚallow_relativeÚvalues        r   Úget_url_attributerQ   l   sM   € ð �K‰K˜	 2Ó&×,Ñ,Ó.€EÙÜØŠN˜˜E >°>Ø�[‰[˜) UÐ+ó-ð 	-ð r   c                 ó¨   — | j                  d«      rdt        | dd «      fS t        | «      rdt        | «      fS |rdt        t	        || «      «      fS y)z.Get tuple describing internal or external URI.ú#Úinternalr   NÚexternal)r*   r
   rE   r/   r   )r.   rN   s     r   Úget_url_tuplerV      sZ   € à
‡~�~�cÔØœG C¨¨ GÓ,Ð-Ð-Ü	˜Ô	ØœJ s›OÐ,Ð,Ù	ØœJ¤w¨x¸Ó'=Ó>Ð?Ð?ð 
r   c                 óª   — t        |«      rt        |«      S | rt        t        | |«      «      S |rt        |«      S t        j                  d|› �g|¢­Ž  y)zBLike urllib.urljoin, but warn if base_url is required but missing.z+Relative URI reference without a base URI: N)rE   r/   r   r   Úerror)rN   r.   rO   ÚcontextÚcontext_argss        r   rJ   rJ   ‰   sY   € ä�sÔÜ˜#‹ÐÙ	Üœ' (¨CÓ0Ó1Ð1Ù	Ü˜#‹Ðä�‰Ø9¸'¸ÐCð	àó	ð r   c                 óü  — | j                  |d«      j                  «       }|j                  d«      r t        |«      dkD  rddt	        |dd «      ffS t        | ||d¬«      }|rP|rH	 t        |«      }	 t        |«      }|j                  r$|dd	 |dd	 k(  rddt	        |j                  «      ffS dd|ffS y# t        $ r t        j                  d
|«       Y Œ(w xY w# t        $ r t        j                  d|«       Y ŒMw xY w)z˜Get the URL value of an element attribute.

    Return ``('external', absolute_uri)``, or ``('internal',
    unquoted_fragment_id)``, or ``None``.

    rG   rS   r   r.   rT   NT)rO   éÿÿÿÿzMalformed base URL: %szMalformed URL: %srU   )rH   rI   r*   Úlenr
   rQ   r   ÚfragmentÚ
ValueErrorr   Úwarning)rL   rM   rN   Ú
attr_valueÚuriÚparsedÚparsed_bases          r   Úget_link_attributere   ˜   s  € ð —‘˜Y¨Ó+×1Ñ1Ó3€JØ×Ñ˜SÔ!¤c¨*£o¸Ò&9à˜
¤G¨J°q°r¨NÓ$;Ð<Ð=Ð=Ü
˜G Y°ÈÔ
N€CÙ
ÙðOÜ! #›�ðOÜ"*¨8Ó"4�Kð
 —’¨6°#°2¨;¸+ÀcÀrÐ:JÒ+JØ %¨
´G¸F¿O¹OÓ4LÐ'MÐNÐNØ˜
 CÐ(Ð)Ð)ð øô "ò GÜ—N‘NÐ#;¸XÖFðGûô ò 9Ü—‘Ð2°CÖ8ð9ús$   Á&C Á2B4 Â4CÃCÃC;Ã:C;c                 ó2   — t        | «      r| S t        | «      S )z²Get a ``scheme://path`` URL from ``string``.

    If ``string`` looks like an URL, return it unchanged. Otherwise assume a
    filename and convert it to a ``file://`` URL.

    )rE   r>   )Ústrings    r   Ú
ensure_urlrh   ¶   s   € ô % VÔ,ˆ6ÐB´(¸6Ó2BÐBr   c                 óz   — t        j                  dt        ¬«       t        ||||d¬«      }|j	                  | «      S )z~Fetch an external resource such as an image or stylesheet.

    This function is deprecated, use ``URLFetcher`` instead.

    a-  default_url_fetcher is deprecated and will be removed in WeasyPrint 69.0, please use URLFetcher instead. For security reasons, HTTP redirects are not supported anymore with default_url_fetcher, but are with URLFetcher.

See https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#url-fetchers©ÚcategoryF)Úallow_redirects)ÚwarningsÚwarnÚDeprecationWarningÚ
URLFetcherÚfetch)r.   ÚtimeoutÚssl_contextÚhttp_headersÚallowed_protocolsÚfetchers         r   Údefault_url_fetcherrw   À   sC   € ô ‡M�Mð	Xô $õ%ô Ø�˜lÐ,=ÈuôV€Gà�=‰=˜ÓÐr   c              #   ó8  K  — |�t        |«      }|€
t        «       }| ||||fD �cg c]  }|�|‘Œ }	}t        |	«      dk7  r#dj                  |	«      xs d}
t	        d|
› �«      ‚| �_|||dœ}t        | d«      r| |d<   n,t        | t        «      r| |d	<   nt        | «      r| |d
<   n| |d	<   t        di |¤Ž}|5 }|–— ddd«       y|�+|€t        |«      }t        |d«      5 }||ddf–— ddd«       y|�’t        ||«      5 }|rP|j                  dk7  rAt        j                  d|j                  › d|j                   › �«       t#        d«      |ddf–— n*|€|j                   }|||j$                  |j                  f–— ddd«       y|�6|€+t'        |dd«      }|r|j)                  d«      st        |«      }||ddf–— yt        |t*        «      rt#        |«      |ddf–— yt-        |«      |ddf–— yc c}w # 1 sw Y   yxY w# 1 sw Y   yxY w# 1 sw Y   yxY w­w)z†If only one input is given, return it.

    Yield a file object, the base url, the protocol encoding and the protocol mime-type.

    Nr   z, Únothingz!Expected exactly one source, got )rN   Úurl_fetcherÚcheck_css_mime_typeÚreadÚfile_objÚfilenamer.   Úrbztext/csszUnsupported stylesheet type z for rG   Únameú<r"   )rh   rp   r]   ÚjoinÚ	TypeErrorÚhasattrr2   r   rE   Úselect_sourcer>   Úopenrq   Úcontent_typer   rX   r.   r   ÚcharsetÚgetattrr*   r3   r   )Úguessr~   r.   r}   rg   rN   rz   r{   ÚparamÚselected_paramsÚsourceÚkwargsÚresultÚresponser€   s                  r   r…   r…   Ò   s‡  è ø€ ð ÐÜ˜hÓ'ˆØÐÜ “lˆð " 8¨S°(¸FÐCöØØÐò 	ð€Oð ô ˆ?Ó˜qÒ Ø—‘˜?Ó+Ò8¨yˆÜÐ;¸F¸8ÐDÓEÐEØ	Ð	à Ø&Ø#6ñ
ˆô
 �5˜&Ô!Ø!&ˆF�:ÒÜ˜œtÔ$Ø!&ˆF�:ÒÜ˜UÔ#Ø!ˆF�5ŠMà!&ˆF�:ÑÜÑ( Ñ(ˆØð 	�vØŠL÷	ð 	à	Ð	ØÐÜ Ó)ˆHÜ�(˜DÓ!ð 	1 XØ˜H d¨DÐ0Ò0÷	1ð 	1à	ˆÜ�; Ó$ð 		R¨Ù" x×'<Ñ'<À
Ò'JÜ—‘Ø2°8×3HÑ3HÐ2Ið JØ#Ÿ<™<˜.ð*ô+ô ˜r“l H¨d°DÐ8Ó8àÐ#Ø'Ÿ|™|�HØ ¨(×*:Ñ*:¸H×<QÑ<QÐQÒQ÷		Rð 		Rð 
Ð	ØÐä˜8 V¨TÓ2ˆDá˜DŸO™O¨CÔ0Ü% dÓ+�Ø˜ $¨Ð,Ó,ä�fœcÔ"Ü˜6Ó" H¨d°DÐ8Ó8ä˜&“/ 8¨T°4Ð7Ó7ùòg÷*	ð 	ú÷
	1ð 	1ú÷		Rð 		RüsZ   ‚#H¥G1°BHÂ6G6Â;$HÃ	HÃ(HÃ?A=HÅ<A:HÇ6G?Ç;HÈHÈHÈHÈHc                   ó   — e Zd ZdZy)ÚURLFetchingErrorz)Some error happened when fetching an URL.N©r$   r%   r&   Ú__doc__r"   r   r   r’   r’     s   „ Ú3r   r’   c                   ó   — e Zd ZdZy)ÚFatalURLFetchingErrorzESome error happened when fetching an URL and must stop the rendering.Nr“   r"   r   r   r–   r–     s   „ ÚOr   r–   c                   óB   ‡ — e Zd ZdZ	 	 dˆ fd„	Zdˆ fd„	Zdd„Zd„ Zˆ xZS )	rp   a`  Fetcher of external resources such as images or stylesheets.

    :param int timeout: The number of seconds before HTTP requests are dropped.
    :param ssl.SSLContext ssl_context: An SSL context used for HTTPS requests.
    :param dict http_headers: Additional HTTP headers used for HTTP requests.
    :type allowed_protocols: :term:`sequence`
    :param allowed_protocols: A set of authorized protocols, :obj:`None` means all.
    :param bool allow_redirects: Whether HTTP redirects must be followed.
    :param bool fail_on_errors: Whether HTTP errors should stop the rendering.

    Another class inheriting from this class, with a ``fetch`` method that has a
    compatible signature, can be given as the ``url_fetcher`` argument to
    :class:`weasyprint.HTML` or :class:`weasyprint.CSS`.

    See :ref:`URL Fetchers` for more information and examples.

    c                 óJ  •— t         ‰
| �  «        t        j                  «       t        j                  «       t        j
                  «       t        j                  «       t        j                  «       t        j                  «       t        j                  «       t        j                  «       t        j                  |¬«      g	}|r#|j                  t        j                  «       «       |D ]  }	| j                  |	«       Œ || _        i t         ¥|xs i ¥| _        || _        || _        y )N)rY   )Úsuperr   r   ÚProxyHandlerÚUnknownHandlerÚHTTPHandlerÚHTTPDefaultErrorHandlerÚ
FTPHandlerÚFileHandlerÚHTTPErrorProcessorÚDataHandlerÚHTTPSHandlerÚappendÚHTTPRedirectHandlerÚadd_handlerÚ_timeoutÚHTTP_HEADERSÚ_http_headersÚ_allowed_protocolsÚ_fail_on_errors)r   rr   rs   rt   ru   rl   Úfail_on_errorsrŽ   ÚhandlersÚhandlerÚ	__class__s             €r   r   zURLFetcher.__init__0  sç   ø€ ô 	‰ÑÔä× Ñ Ó"¤G×$:Ñ$:Ó$<¼g×>QÑ>QÓ>SÜ×+Ñ+Ó-¬w×/AÑ/AÓ/CÜ×ÑÓ!¤7×#=Ñ#=Ó#?Ä×ATÑATÓAVÜ× Ñ ¨Ô5ð	7ˆñ
 Ø�O‰OœG×7Ñ7Ó9Ô:Øò 	&ˆGØ×Ñ˜WÕ%ð	&ð  ˆŒØE¤ÐE°Ò1CÀÐEˆÔØ"3ˆÔØ-ˆÕr   c                 ó   •— t         j                  |«      x}st        d|› �«      ‚|d   j                  «       }| j                  �|| j                  vrt        d|› �«      ‚|dk(  r|j                  d«      d   }t        |«      }i | j                  ¥|xs i ¥}t        j                  ||¬«      }t        ‰
| �-  || j                  ¬«      }|}d	|j                  v rY|j                  d	   }|j                  d	= |d
k(  rt        |¬«      }n+|dk(  r&|j                  «       }		 t!        j"                  |	«      }t'        |j(                  ||j                  |j*                  «      S # t         j$                  $ r t!        j"                  |	d«      }Y ŒWw xY w)aE  Fetch a given URL.

        :returns: A :obj:`URLFetcherResponse` instance.
        :raises: An exception indicating failure, e.g. :obj:`ValueError` on
            syntactically invalid URL. All exceptions are catched internally by
            WeasyPrint, except when they inherit from :obj:`FatalURLFetchingError`.

        zNot an absolute URI: r   zURI uses disallowed protocol: Úfileú?r   ©Úheaders)rr   zContent-EncodingÚgzipr   Údeflateiñÿÿÿ)r@   rC   r_   Úlowerr©   Úsplitr/   r¨   r   ÚRequestr™   r†   r¦   r³   r   r|   ÚzlibÚ
decompressrX   ÚURLFetcherResponser.   Ústatus)r   r.   r³   rC   rD   Úhttp_requestr�   ÚbodyÚcontent_encodingÚdatar®   s             €r   rq   zURLFetcher.fetchC  s‰  ø€ ô +×0Ñ0°Ó5Ð5�Ð5ÜÐ4°S°EÐ:Ó;Ð;Ø�q‘—‘Ó!ˆð ×"Ñ"Ð.Ø˜T×4Ñ4Ñ4Ü Ð#AÀ#ÀÐ!GÓHÐHð �VÒØ—)‘)˜C“. Ñ#ˆCô ˜‹oˆð <�T×'Ñ'Ð;¨GªM°rÐ;ˆÜ—‘ s°GÔ<ˆÜ‘7‘< °d·m±m�<ÓDˆð ˆØ ×!1Ñ!1Ñ1Ø'×/Ñ/Ð0BÑCÐØ× Ñ Ð!3Ð4Ø 6Ò)Ü(°Ô:‘Ø! YÒ.Ø—}‘}“�ð6ÜŸ?™?¨4Ó0�Dô
 " (§,¡,°°h×6FÑ6FÈÏÉÓXÐXøô	 —z‘zò 6äŸ?™?¨4°Ó5’Dð6ús   Ä E! Å!)FÆFc                 ó¤   — t        |t        j                  «      r&| j                  |j                  |j
                  «      S | j                  |«      S r   )r2   r   r¸   rq   Úfull_urlr³   )r   r.   rÀ   rr   s       r   r†   zURLFetcher.opent  s7   € Ü�cœ7Ÿ?™?Ô+Ø—:‘:˜cŸl™l¨C¯K©KÓ8Ð8Ø�z‰z˜#‹Ðr   c                 ó$   — | j                  |«      S r   )rq   )r   r.   s     r   Ú__call__zURLFetcher.__call__y  s   € Ø�z‰z˜#‹Ðr   )é
   NNNTFr   )NN)	r$   r%   r&   r”   r   rq   r†   rÄ   Ú__classcell__)r®   s   @r   rp   rp     s(   ø„ ñð$ CGØNSõ.õ&/Yóbö
r   rp   c                   óv   — e Zd ZdZdd„Zd„ Zd„ Zed„ «       Zed„ «       Z	ed„ «       Z
d	„ Zd
„ Zed„ «       Zd„ Zy)r»   u  The HTTP response of an URL fetcher.

    :param str url: The URL of the HTTP response.
    :type body: :class:`str`, :class:`bytes` or :term:`file object`
    :param body: The body of the HTTP response.
    :type headers: dict or email.message.EmailMessage
    :param headers: The headers of the HTTP response.
    :param int status: The status of the HTTP response.

    Has the same interface as :class:`urllib.response.addinfourl`.

    If a :term:`file object` is given for the body, it is the callerâ€™s responsibility to
    call ``close()`` on it. The default function used internally to fetch data in
    WeasyPrint tries to close the file object after retreiving; but if this URL fetcher
    is used elsewhere, the file object has to be closed manually.

    Nc                 óÄ  — || _         || _        t        |t        «      r|| _        n;t        «       | _        |xs i j                  «       D ]  \  }}	 || j                  |<   Œ t        |d«      r|| _        y t        |t        «      r<| j                  j                  dd«       t        |j                  d«      «      | _        y t        |«      | _        y # t        $ r Y Œ”w xY w)Nr|   rˆ   r   )r.   r¼   r2   r   r³   Úitemsr_   r„   Ú	_file_objr3   Ú	set_paramr   r+   )r   r.   r¾   r³   r¼   rŽ   ÚkeyrP   s           r   r   zURLFetcherResponse.__init__�  sÂ   € ØˆŒØˆŒä�gœ|Ô,Ø"ˆD�Lä'›>ˆDŒLØ&š}¨"×3Ñ3Ó5ò ‘
��UðØ(-�D—L‘L Ò%ðô �4˜Ô Ø!ˆD�NÜ˜œcÔ"Ø�L‰L×"Ñ" 9¨gÔ6Ü$ T§[¡[°Ó%9Ó:ˆD�Nä$ T›]ˆD�Nøô "ò Ùðús   ÁCÃ	CÃCc                 ó:   —  | j                   j                  |i |¤ŽS r   )rÊ   r|   )r   ÚargsrŽ   s      r   r|   zURLFetcherResponse.read¥  s   € Ø"ˆt�~‰~×"Ñ" DÐ3¨FÑ3Ð3r   c                 ó¾   — 	 | j                   j                  «        y # t        $ r6 t        j                  d| j
                  t        j                  «       «       Y y w xY w)Nz$Error when closing stream for %s:
%s)rÊ   r   Ú	Exceptionr   r`   r.   Ú	tracebackÚ
format_excr    s    r   r   zURLFetcherResponse.close¨  sI   € ð	2Ø�N‰N× Ñ Õ"øÜò 	2ô �N‰NØ7Ø—‘œ)×.Ñ.Ó0ö2ð	2ús   ‚ �<AÁAc                 óº   — | j                   j                  d«      r@t        j                  | j                   j	                  d«      d   j                  d«      «      S y )Nr(   r±   r   )r.   r*   r   Úurl2pathnamer·   Úremoveprefixr    s    r   r8   zURLFetcherResponse.path²  sG   € à�8‰8×Ñ˜wÔ'Ü×'Ñ'¨¯©¯©°sÓ(;¸AÑ(>×(KÑ(KÈGÓ(TÓUÐUð (r   c                 ó6   — | j                   j                  «       S r   )r³   Úget_content_typer    s    r   r‡   zURLFetcherResponse.content_type·  s   € à�|‰|×,Ñ,Ó.Ð.r   c                 ó8   — | j                   j                  d«      S )Nrˆ   )r³   Ú	get_paramr    s    r   rˆ   zURLFetcherResponse.charset»  s   € à�|‰|×%Ñ% iÓ0Ð0r   c                 ó   — | j                   S r   r-   r    s    r   ÚgeturlzURLFetcherResponse.geturl¿  s   € Ø�x‰xˆr   c                 ó   — | j                   S r   r²   r    s    r   ÚinfozURLFetcherResponse.infoÂ  s   € Ø�|‰|Ðr   c                 ó   — | j                   S r   ©r¼   r    s    r   ÚcodezURLFetcherResponse.codeÅ  s   € à�{‰{Ðr   c                 ó   — | j                   S r   rß   r    s    r   ÚgetcodezURLFetcherResponse.getcodeÉ  s   € Ø�{‰{Ðr   )NNéÈ   )r$   r%   r&   r”   r   r|   r   Úpropertyr8   r‡   rˆ   rÛ   rÝ   rà   râ   r"   r   r   r»   r»   }  sw   „ ñó"+ò,4ò2ð ñVó ðVð ñ/ó ð/ð ñ1ó ð1òòð ñó ðór   r»   c              #   ó�  K  — 	  | |«      }t        |t        «      r—t        j                  dt        ¬«       d	|vr|j                  d
|«      |d	<   |j                  d|j                  d«      «      |d<   |j                  dd«      }|j                  d«      x}r|d|› �z  }d|i|d<   t        di |¤Ž}t        |t        «      sJ d«       ‚	 |–— |j                  «        y# t         $ rE}t        | dd«      rt        d|› d�«      |‚t        t	        |«      j
                  › d|› �«      ‚d}~ww xY w# |j                  «        w xY w­w)aD  Fetch an ``url`` with ```url_fetcher``, fill in optional data, and clean up.

    Fatal errors must raise a ``FatalURLFetchingError`` that stops the rendering. All
    other exceptions are catched and raise an ``URLFetchingError``, that is usually
    catched by the code that fetches the resource and emits a warning.

    rª   FzError fetching "ú"z: NzReturning dicts in URL fetchers is deprecated and will be removed in WeasyPrint 69.0, please return URLFetcherResponse instead.rj   r.   Úredirected_urlr}   rg   r¾   Ú	mime_typezapplication/octet-streamÚencodingz
; charset=zContent-Typer³   zFURL fetcher must return either a dict or a URLFetcherResponse instancer"   )rÐ   r‰   r–   r’   Útyper$   r2   Údictrm   rn   ro   rH   r»   r   )rz   r.   ÚresourceÚ	exceptionr‡   rˆ   s         r   rq   rq   Í  s\  è ø€ ðKÙ˜sÓ#ˆô �(œDÔ!Ü�‰ðLä'õ	)ð ˜Ñ Ø&Ÿl™lÐ+;¸SÓAˆH�U‰OØ#Ÿ<™<¨
°H·L±LÀÓ4JÓKˆ�ÑØ—|‘| KÐ1KÓLˆØ—l‘l :Ó.Ð.ˆ7Ð.Ø˜j¨¨	Ð2Ñ2ˆLØ-¨|Ð<ˆ�ÑÜ%Ñ1¨Ñ1ˆä�hÔ 2Ô3ð RØPóRÐ3ðØŠà�‰Õøô3 ò KÜ�;Ð 1°5Ô9Ü'Ð*:¸3¸%¸qÐ(AÓBÈ	ÐQÜ¤$ y£/×":Ñ":Ð!;¸2¸i¸[ÐIÓJÐJûðKûð2 	�‰ÕüsA   ‚E„C  ŒB>EÃD1 ÃEÃ 	D.Ã)A D)Ä)D.Ä.EÄ1EÅE)F)rÅ   NNN)NNNNNNNF);r”   ÚcodecsÚ
contextlibÚos.pathr7   ÚreÚsysrÑ   rm   r¹   Úemail.messager   r´   r   Úior   r   Úpathlibr   Úurllibr   Úurllib.parser	   r
   r   r   rG   r   Úloggerr   Úcompiler@   rA   Úgetfilesystemencodingr,   Úlookupr€   ÚLookupErrorr§   r   r/   r>   rE   rQ   rV   rJ   re   rh   rw   Úcontextmanagerr…   ÚIOErrorr’   ÚBaseExceptionr–   ÚOpenerDirectorrp   r»   rq   r"   r   r   ú<module>r     s…  ðÙ ?ã Û Û Û 	Û 
Û Û Û Ý &Ý ß  Ý Ý ß :Ó :å Ý ð
 �B—J‘JÐ<Ó=Ð Ø�"—*‘*Ð;Ó<€ð 0�c×/Ñ/Ó1Ð ð"Ø€v‡}�}Ð(Ó)×.Ñ.°'Ò9Ø%Ðð
   ˜}Ð-ØØ&ñ€ô
˜ô 
ò4ò  ò>#ó-ò&@òò*ò<Cð IMØ*.óð$ ×ÑØMQØGLò?8ó ð?8ôD4�wô 4ôP˜Mô Pô]�×'Ñ'ô ]÷@Mñ Mð` ×Ññ#ó ñ#øð] ò "Ø!Òð"ús   Â!E ÅEÅE