� J�g�F��t�dZddlZddlZddlZddlZddlmZddlmZddl m Z ddl m Z m Z mZddlmZmZmZmZmZmZmZdd lmZmZdd lmZd d iZd �Zed���Zeee ej!fZ"ee ej!fZ#e$d��Z% e$d��Z& e$d��Z' ej(d��Z)ddddddddd�Z*Gd�de��Z+d�d �Z,d!�Z-d"�Z.Gd#�d$e d$d%e"fd&e"fd'e"fd(e e"fg����Z/d ed)<d*ed+<d,ed-<d.ed/<d0ed1<Gd2�d3e d3d&e"fd(e e"fg����Z0d ed4<d5ed6<d0ed7<Gd8�d9e d9d:e"fd;e"fd<e"fd=e"fd(e e"fg����Z1d ed><d?ed@<dAedB<dCedD<dEedF<d0edG<d�dH�Z2d�dI�Z3d�dK�Z4d�dL�Z5dM�Z6dN�Z7GdO�dPe ��Z8GdQ�dRe ��Z9d edS<d edT<d edU<d edV<d edW<d edX<GdY�dZ��Z:d[�Z;d\�Z<d]�Z=Gd^�d_e ��Z>Gd`�dae ��Z?Gdb�dce ��Z@Gdd�dee ��ZAGdf�dge ��ZBGdh�die ��ZCGdj�dke ��ZDGdl�dme ��ZEGdn�doe ��ZFGdp�dqe ��ZGGdr�dse ��ZHGdt�due ��ZIGdv�dwe ��ZJGdx�dye ��ZKGdz�d{e ��ZLGd|�d}e ��ZMGd~�de ��ZNGd��d�e ��ZOGd��d�e ��ZPGd��d���ZQGd��d���ZRGd��d�eR��ZSGd��d���ZTdS)�a  Vector drawing: managing colors, graphics states, paths, transforms... The contents of this module are internal to fpdf2, and not part of the public API. They may change at any time without prior warning or any deprecation period, in non-backward-compatible ways. �N)� OrderedDict)�Sequence)�contextmanager)�Optional� NamedTuple�Union�)� BlendMode�ClippingPathIntersectionRule�IntersectionRule� PathPaintRule�StrokeCapStyle�StrokeJoinStyle� PDFStyleKeys)�Name�Raw)� escape_parens�force_nodocumentFc�$�dt|j<|S)zQA decorator that forces pdoc not to document the decorated item (class or method)F��__pdoc__� __qualname__��items �\/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fpdf/drawing.pyrr"s��"'�H�T� �� �K�c�$�dt|j<|S)zMA decorator that forces pdoc to document the decorated item (class or method)Trrs r�force_documentr(s��#'�H�T� �� �Krz z z ()<>[]{}/%z[\n\r\t\b\f()\\]z\nz\rz\tz\bz\fz\(z\)z\\)� � � �� �(�)�\c��eZdZdZdd�ZdS)�GraphicsStateDictRegistryzZ A container providing deduplication of graphics state dictionaries across a PDF. �style� GraphicsStylec��|���}|sdS ||S#t$rYnwxYwtdt|������}|||<|S)N�GS)� serialize�KeyErrorr�len)�selfr)�sdict�names r�register_stylez(GraphicsStateDictRegistry.register_styleNs{�����!�!��� ��4� ���;� ��� � � � �D� �����$��T���$�$�%�%����U� �� s �"� /�/N)r)r*)�__name__� __module__r�__doc__r3�rrr(r(Is2�������������rr(���?c�T�||cxkr|ksnt|�d|�d|�d����|S)Nz not in range [z, �])� ValueError)�value�minimum�maximums r� _check_ranger@`sM�� �e� &� &� &� &�w� &� &� &� &��E�G�G�'�G�G�W�G�G�G�H�H�H� �Lrc�V�|d��d���d��S)z� Convert a decimal number to a minimal string representation (no trailing 0 or .). Args: number (Number): the number to be converted to a string. Returns: The number's string representation. z.4f�0�.)�rstrip)�numbers r� number_to_strrFgs*���?�?� !� !�#� &� &� -� -�c� 2� 2�2rc���t|t��r|Stt|dd����r|���}�n�|�d}�n�t|t ��rdt |���d�}�not|t��rd|����d�}�n@t|t��r dd g|}�nt|t��rt|��}n�t|ttf��r&d d �d �|D����zd z}n�t|t��r�g}|���D]^\}}t|t"��st%d���|�t)|��d zt)|��z���_dd�|��zdz}nt+d|�����t|��S)a Render a Python value as a PDF primitive type. Container types (tuples/lists and dicts) are rendered recursively. This supports values of the type Name, str, bytes, numbers, booleans, list/tuple, and dict. Any custom type can be passed in as long as it provides a `serialize` method that takes no arguments and returns a string. The primitive object is returned directly if it is an instance of the `Raw` class. Otherwise, The existence of the `serialize` method is checked before any other type checking is performed, so, for example, a `dict` subclass with a `serialize` method would be converted using its `pdf_repr` method rather than the built-in `dict` conversion process. Args: primitive: the primitive value to convert to its PDF representation. Returns: Raw-wrapped str of the PDF representation. Raises: ValueError: if a dictionary key is not a Name. TypeError: if `primitive` does not have a known conversion to a PDF representation. r-N�nullr$r%�<�>�false�true�[� c3�4K�|]}t|��V��dS�N)�render_pdf_primitive��.0�vals r� <genexpr>z'render_pdf_primitive.<locals>.<genexpr>�s+����O�O�c� 4�S� 9� 9�O�O�O�O�O�Orr;zdict keys must be Namesz<< rz >>z,cannot produce PDF representation for value )� isinstancer�callable�getattrr-�strr�bytes�hex�bool� NumberClassrF�list�tuple�join�dict�itemsrr<�appendrQ� TypeError)� primitive�output� item_list�keyrTs rrQrQws��4�)�S�!�!������ �;��5�5�6�6�V��$�$�&�&��� � ���� �I�s� #� #�V�0�]�9�-�-�0�0�0��� �I�u� %� %�V�'�Y�]�]�_�_�'�'�'��� �I�t� $� $�V��6�"�9�-��� �I�{� +� +�V��y�)�)��� �I��e�}� -� -�V��s�x�x�O�O�Y�O�O�O�O�O�O�RU�U��� �I�t� $� $� V�� �!���)�)� � �H�C���c�4�(�(� <� �!:�;�;�;� � � �$�S�)�)�C�/�2F�s�2K�2K�K� � � � �����9�-�-�-��5����T�y�T�T�U�U�U� �v�;�;�rc�b��eZdZdZdZ d �fd� Zed���Zed���Zde fd�Z �xZ S) � DeviceRGBz+A class representing a PDF DeviceRGB color.�rgNc���|�t|��t���|t|��t|��t|��|��SrP�r@�super�__new__)�cls�r�g�b�a� __class__s �rrozDeviceRGB.__new__�sJ��� �=� ��O�O�O��w�w��� ��a���,�q�/�/�<��?�?�A� � � rc��|dd�S)zVThe color components as a tuple in order `(r, g, b)` with alpha omitted, in range 0-1.N�����r7�r0s r�colorszDeviceRGB.colors�����C�R�C�y�rc�>�td�|jD����S)�XThe color components as a tuple in order `(r, g, b)` with alpha omitted, in range 0-255.c3� K�|] }d|zV�� dS���Nr7�rS�vs rrUz&DeviceRGB.colors255.<locals>.<genexpr>��&����2�2��S�1�W�2�2�2�2�2�2r�r_ryrxs r� colors255zDeviceRGB.colors255��#���2�2�d�k�2�2�2�2�2�2r�returnc�`�d�d�|jD����d|j��zS)NrNc3�4K�|]}t|��V��dSrP�rFrRs rrUz&DeviceRGB.serialize.<locals>.<genexpr>��*����B�B�s� �c�*�*�B�B�B�B�B�Br�r`ry�OPERATORrxs rr-zDeviceRGB.serialize��5���x�x�B�B�d�k�B�B�B�B�B�EX���EX�EX�X�XrrP� r4r5rr6r�ro�propertyryr�rYr-� __classcell__�rus@rrjrj�s�������� 6�5� �H�F� � � � � � �����X���3�3��X�3�Y�3�Y�Y�Y�Y�Y�Y�Y�YrrjrqrrrsrtzDeviceRGB.OPERATORz8The red color component. Must be in the interval [0, 1].z DeviceRGB.rz:The green color component. Must be in the interval [0, 1].z DeviceRGB.gz9The blue color component. Must be in the interval [0, 1].z DeviceRGB.baD The alpha color component (i.e. opacity). Must be `None` or in the interval [0, 1]. An alpha value of 0 makes the color fully transparent, and a value of 1 makes it fully opaque. If `None`, the color will be interpreted as not specifying a particular transparency rather than specifying fully transparent or fully opaque. z DeviceRGB.ac�b��eZdZdZdZ d �fd� Zed���Zed���Zde fd�Z �xZ S) � DeviceGrayz,A class representing a PDF DeviceGray color.rrNc���|�t|��t���|t|��|��SrPrm)rprrrtrus �rrozDeviceGray.__new__s3��� �=� ��O�O�O��w�w���s�L��O�O�Q�7�7�7rc�*�|j|j|jfS)zTThe color components as a tuple in order (r, g, b) with alpha omitted, in range 0-1.)rrrxs rryzDeviceGray.colors s���v�t�v�t�v�%�%rc�>�td�|jD����S)r|c3� K�|] }d|zV�� dSr~r7r�s rrUz'DeviceGray.colors255.<locals>.<genexpr>r�rr�rxs rr�zDeviceGray.colors255r�rr�c�>�t|j���d|j��S)NrN)rFrrr�rxs rr-zDeviceGray.serializes"�����'�'�9�9�$�-�9�9�9rrPr�r�s@rr�r��s�������� 7�6��H�F�8�8�8�8�8�8� �&�&��X�&��3�3��X�3�:�3�:�:�:�:�:�:�:�:rr�zDeviceGray.OPERATORz} The gray color component. Must be in the interval [0, 1]. A value of 0 represents black and a value of 1 represents white. z DeviceGray.gz DeviceGray.ac�L��eZdZdZdZ d�fd� Zed���Zdefd�Z �xZ S) � DeviceCMYKz,A class representing a PDF DeviceCMYK color.�kNc ����|�t|��t���|t|��t|��t|��t|��|��SrPrm)rp�c�m�yr�rtrus �rrozDeviceCMYK.__new__?sT��� �=� ��O�O�O��w�w��� ��a���,�q�/�/�<��?�?�L�QR�O�O�UV� � � rc��|dd�S)zWThe color components as a tuple in order (c, m, y, k) with alpha omitted, in range 0-1.Nrwr7rxs rryzDeviceCMYK.colorsGrzrr�c�`�d�d�|jD����d|j��zS)NrNc3�4K�|]}t|��V��dSrPr�rRs rrUz'DeviceCMYK.serialize.<locals>.<genexpr>Mr�rr�rxs rr-zDeviceCMYK.serializeLr�rrP) r4r5rr6r�ror�ryrYr-r�r�s@rr�r�.s��������7�6��H�F� � � � � � �����X��Y�3�Y�Y�Y�Y�Y�Y�Y�Yrr�r�r�r�r�zDeviceCMYK.OPERATORz9The cyan color component. Must be in the interval [0, 1].z DeviceCMYK.cz<The magenta color component. Must be in the interval [0, 1].z DeviceCMYK.mz;The yellow color component. Must be in the interval [0, 1].z DeviceCMYK.yz:The black color component. Must be in the interval [0, 1].z DeviceCMYK.kz DeviceCMYK.ac��|�#||cxkr|krnnt|dz ��Sn|dz}t|dz |dz |dz |��S)aP Produce a DeviceRGB color from the given 8-bit RGB values. Args: r (Number): red color component. Must be in the interval [0, 255]. g (Number): green color component. Must be in the interval [0, 255]. b (Number): blue color component. Must be in the interval [0, 255]. a (Optional[Number]): alpha component. Must be `None` or in the interval [0, 255]. 0 is fully transparent, 255 is fully opaque Returns: DeviceRGB color representation. Raises: ValueError: if any components are not in their valid interval. N��o@)r�rj)rqrrrsrts r�rgb8r�bsd��" �y� ��;�;�;�;�Q�;�;�;�;�;��a�%�i�(�(� (� � �U� �� �Q��Y��E� �1�u�9�a� 8� 8�8rc�6�|�|dz}t|dz |��S)a� Produce a DeviceGray color from the given 8-bit gray value. Args: g (Number): gray color component. Must be in the interval [0, 255]. 0 is black, 255 is white. a (Optional[Number]): alpha component. Must be `None` or in the interval [0, 255]. 0 is fully transparent, 255 is fully opaque Returns: DeviceGray color representation. Raises: ValueError: if any components are not in their valid interval. Nr�)r�)rrrts r�gray8r�|s&��  �}� �U� �� �a�%�i�� #� #�#rrwc�h�t|tttf��r|St|t��r$|�d��rt |��St|t��r|\}}}|||fdks|dkrt|dz ��St|dz |dz |dz ��S)N�#)rrrrwr)rVr�r�rjrY� startswith�color_from_hex_stringr)rqrrrss r�convert_to_device_colorr��s����!�j�*�i�8�9�9�����!�S���(�a�l�l�3�/�/�(�$�Q�'�'�'��!�X�������1�a� �1�a�y�I����b����!�c�'�"�"�"� �Q��W�a�#�g�q�3�w� /� /�/rc�N�|�|dz}t|dz |dz |dz |dz |��S)a� Produce a DeviceCMYK color from the given 8-bit CMYK values. Args: c (Number): red color component. Must be in the interval [0, 255]. m (Number): green color component. Must be in the interval [0, 255]. y (Number): blue color component. Must be in the interval [0, 255]. k (Number): blue color component. Must be in the interval [0, 255]. a (Optional[Number]): alpha component. Must be `None` or in the interval [0, 255]. 0 is fully transparent, 255 is fully opaque Returns: DeviceCMYK color representation. Raises: ValueError: if any components are not in their valid interval. Nr�)r�)r�r�r�r�rts r�cmyk8r��s8��$ �}� �U� �� �a�%�i��U��A��I�q�5�y�!� D� D�Drc���t�t��st��d������d��st ��d����t ���}|dkrt d��dd�D��ddi�S|d krt d ��dd�D���S|d kr't �fd �td|d ��D��ddi�S|dkr$t �fd�td|d ��D���St ��d����)a Parse an RGB color from a css-style 8-bit hexadecimal color string. Args: hexstr (str): of the form `#RGB`, `#RGBA`, `#RRGGBB`, or `#RRGGBBAA` (case insensitive). Must include the leading octothorp. Forms omitting the alpha field are interpreted as not specifying the opacity, so it will not be explicitly set. An alpha value of `00` is fully transparent and `FF` is fully opaque. Returns: DeviceRGB representation of the color. � is not of type strr�z does not start with #�c�6�g|]}t|dzd�����S���)�base��int�rS�chars r� <listcomp>z)color_from_hex_string.<locals>.<listcomp>��)��D�D�D��c�$��(��,�,�,�D�D�Drr Nrt�c�6�g|]}t|dzd�����Sr�r�r�s rr�z)color_from_hex_string.<locals>.<listcomp>�r�r�c�H��g|]}t�||dz�d�����Sr�r��rS�idx�hexstrs �rr�z)color_from_hex_string.<locals>.<listcomp>�s3��� O� O� O�c�c�&��s�Q�w��'�b�1�1�1� O� O� Orr�� c�H��g|]}t�||dz�d�����Sr�r�r�s �rr�z)color_from_hex_string.<locals>.<listcomp>�s3���W�W�W�c�c�&��s�Q�w��/�b�9�9�9�W�W�Wrz0 could not be interpreted as a RGB(A) hex string)rVrYrdr�r<r/r��range)r��hlens` rr�r��sY��� �f�c� "� "�8��6�6�6�6�7�7�7� � � �S� !� !�<��F�:�:�:�;�;�;� �v�;�;�D� �q�y�y��D�D������D�D�D�M��M�M�M� �q�y�y��D�D������D�D�D�E�E� �q�y�y�� O� O� O� O�U�1�d�A�=N�=N� O� O� O� �SW� � � � �q�y�y��W�W�W�W�U�1�d�TU�EV�EV�W�W�W�X�X� ��P�P�P� Q� Q�Qrc���t|t��st|�d����|�dd��}|�d��r|�d��st |�d����|dd�}|�d ��}t|��d krtd �|D��d d i�St|��dkrtd�|D���St |�d����)z� Parse an RGB color from a css-style rgb(R, G, B, A) color string. Args: rgbstr (str): of the form `rgb(R, G, B)` or `rgb(R, G, B, A)`. Returns: DeviceRGB representation of the color. r�rN�zrgb(r%z- does not follow the expected rgb(...) formatr�rw�,�c�,�g|]}t|����Sr7r��rSr�s rr�z)color_from_rgb_string.<locals>.<listcomp>����-�-�-��c�!�f�f�-�-�-rrtNc�,�g|]}t|����Sr7r�r�s rr�z)color_from_rgb_string.<locals>.<listcomp>�r�rz6 could not be interpreted as a rgb(R, G, B[, A]) color) rVrYrd�replacer��endswithr<�splitr/r�)�rgbstrrys r�color_from_rgb_stringr��s�� �f�c� "� "�8��6�6�6�6�7�7�7� �^�^�C�� $� $�F� � � �V� $� $�S�F�O�O�C�,@�,@�S��F�Q�Q�Q�R�R�R� �A�b�D�\�F� �\�\�#� � �F� �6�{�{�a����-�-�f�-�-�-�6��6�6�6� �6�{�{�a����-�-�f�-�-�-�.�.� ��V�V�V� W� W�Wrc���eZdZUdZeed< eed< d�Zd�Zd�Zd�Z e d���Z e d ���Z e d ���Z e d ���ZeZe d ���Ze d ���Ze d���Zd�ZdS)�PointzM An x-y coordinate pair within the two-dimensional coordinate frame. �xr�c�X�t|j���dt|j����S)z=Render the point to the string `"x y"` for emitting to a PDF.rN�rFr�r�rxs r�renderz Point.renders,�� ���'�'�A�A�-���*?�*?�A�A�Arc��t|t��std|�����|j|jz|j|jzzS)a( Compute the dot product of two points. Args: other (Point): the point with which to compute the dot product. Returns: The scalar result of the dot product computation. Raises: TypeError: if `other` is not a `Point`. zcannot dot with )rVr�rdr�r��r0�others r�dotz Point.dot sJ���%��'�'� :��8�u�8�8�9�9� 9��v����$�&�5�7�"2�2�2rc �l�t|t��std|�����|j|jz|j|jzz }|dk|dkz }|t jt|�|��|� ��|� ��zz d����zS)a� Compute the angle between two points (interpreted as vectors from the origin). The return value is in the interval (-pi, pi]. Sign is dependent on ordering, with clockwise angle travel considered to be positive due to the orientation of the coordinate frame basis vectors (i.e. the angle between `(1, 0)` and `(0, 1)` is `+pi/2`, the angle between `(1, 0)` and `(0, -1)` is `-pi/2`, and the angle between `(0, -1)` and `(1, 0)` is `+pi/2`). Args: other (Point): the point to compute the angle sweep toward. Returns: The scalar angle between the two points **in radians**. Raises: TypeError: if `other` is not a `Point`. zcannot compute angle with r�) rVr�rdr�r��math�acos�roundr��mag)r0r�� signifier�signs r�anglez Point.angles���(�%��'�'� D��B��B�B�C�C� C��V�e�g�%�$�&�5�7�*:�;� ��Q��9�q�=�1���d�i��d�h�h�u�o�o������e�i�i�k�k�9Q�&R�TU� V� V�W�W�W�Wrc�2�|jdz|jdzzdzS)a Compute the Cartesian distance from this point to the origin This is the same as computing the magnitude of the vector represented by this point. Returns: The scalar result of the distance computation. r���?�r�r�rxs rr�z Point.mag:s ����� �D�F�A�I�%�#�-�-rc��t|t��r+t|j|jz|j|jz���StS)an Produce the sum of two points. Adding two points is the same as translating the source point by interpreting the other point's x and y coordinates as distances. Args: other (Point): right-hand side of the infix addition operation Returns: A Point which is the sum of the two source points. r��rVr�r�r��NotImplementedr�s r�__add__z Point.__add__GsB�� �e�U� #� #� A��4�6�E�G�+�t�v���/?�@�@�@� @��rc��t|t��r+t|j|jz |j|jz ���StS)a0 Produce the difference between two points. Unlike addition, this is not a commutative operation! Args: other (Point): right-hand side of the infix subtraction operation Returns: A Point which is the difference of the two source points. r�r�r�s r�__sub__z Point.__sub__ZsB�� �e�U� #� #� A��4�6�E�G�+�t�v���/?�@�@�@� @��rc�<�t|j |j ���S)z� Produce a point by negating this point's coordinates. Returns: A Point whose coordinates are this points coordinates negated. r�)r�r�r�rxs r�__neg__z Point.__neg__ls�����w�4�6�'�*�*�*�*rc�z�t|t��r t|j|z|j|z��St S)a  Multiply a point by a scalar value. Args: other (Number): the scalar value by which to multiply the point's coordinates. Returns: A Point whose coordinates are the result of the multiplication. �rVr]r�r�r�r�r�s r�__mul__z Point.__mul__vs8�� �e�[� )� )� 9����%����%��8�8� 8��rc�z�t|t��r t|j|z |j|z ��St S)a� Divide a point by a scalar value. .. note:: Because division is not commutative, `Point / scalar` is implemented, but `scalar / Point` is nonsensical and not implemented. Args: other (Number): the scalar value by which to divide the point's coordinates. Returns: A Point whose coordinates are the result of the division. r�r�s r� __truediv__zPoint.__truediv__�s8�� �e�[� )� )� 9����%����%��8�8� 8��rc�z�t|t��r t|j|z|j|z��St S)a� Divide a point by a scalar value using integer division. .. note:: Because division is not commutative, `Point // scalar` is implemented, but `scalar // Point` is nonsensical and not implemented. Args: other (Number): the scalar value by which to divide the point's coordinates. Returns: A Point whose coordinates are the result of the division. r�r�s r� __floordiv__zPoint.__floordiv__�s8�� �e�[� )� )� ;����5��$�&�E�/�:�:� :��rc���t|t��r[t|j|jz|j|jzz|jz|j|jz|j |jzz|j z���StS)a� Transform a point with the given transform matrix. .. note:: This operator is only implemented for Transforms. This transform is not commutative, so `Point @ Transform` is implemented, but `Transform @ Point` is not implemented (technically speaking, the current implementation is commutative because of the way points and transforms are represented, but if that representation were to change this operation could stop being commutative) Args: other (Transform): the transform to apply to the point Returns: A Point whose coordinates are the result of applying the transform. r�) rV� Transformr�rtr�r�r��ers�d�fr�r�s r� __matmul__zPoint.__matmul__�sw��& �e�Y� '� '� ���'�D�F�"�U�W�t�v�%5�5���?��'�D�F�"�U�W�t�v�%5�5���?���� � �rc�\�dt|j���dt|j���d�S)Nz(x=z, y=r%r�rxs r�__str__z Point.__str__�s/��H�]�4�6�*�*�H�H� �d�f�0E�0E�H�H�H�HrN)r4r5rr6�Number�__annotations__r�r�r�r�rr�r�r�r��__rmul__r�r�r�rr7rrr�r��sR����������I�I�I�$� �I�I�I�$�B�B�B� 3�3�3�$X�X�X�6 .� .� .�����^��$����^��"�+�+��^�+�����^�� �H�����^��(����^��,����^��4I�I�I�I�Irr�c�<�eZdZUdZeed<eed<eed<eed<eed<eed<ed���Zed ���Zedd ���Z ed ���Z ed ���Z edd���Z d�Z dd�Zd�Zd�Zdd�Zd�Zed���ZeZed���Zd�Zd�Zd S)r�ax A representation of an affine transformation matrix for 2D shapes. The actual matrix is: ``` [ a b 0 ] [x' y' 1] = [x y 1] [ c d 0 ] [ e f 1 ] ``` Complex transformation operations can be composed via a sequence of simple transformations by performing successive matrix multiplication of the simple transformations. For example, scaling a set of points around a specific center point can be represented by a translation-scale-translation sequence, where the first translation translates the center to the origin, the scale transform scales the points relative to the origin, and the second translation translates the points back to the specified center point. Transform multiplication is performed using python's dedicated matrix multiplication operator, `@` The semantics of this representation mean composed transformations are specified left-to-right in order of application (some other systems provide transposed representations, in which case the application order is right-to-left). For example, to rotate the square `(1,1) (1,3) (3,3) (3,1)` 45 degrees clockwise about its center point (which is `(2,2)`) , the translate-rotate-translate process described above may be applied: ```python rotate_centered = ( Transform.translation(-2, -2) @ Transform.rotation_d(45) @ Transform.translation(2, 2) ) ``` Instances of this class provide a chaining API, so the above transform could also be constructed as follows: ```python rotate_centered = Transform.translation(-2, -2).rotate_d(45).translate(2, 2) ``` Or, because the particular operation of performing some transformations about a specific point is pretty common, ```python rotate_centered = Transform.rotation_d(45).about(2, 2) ``` By convention, this class provides class method constructors following noun-ish naming (`translation`, `scaling`, `rotation`, `shearing`) and instance method manipulations following verb-ish naming (`translate`, `scale`, `rotate`, `shear`). rtrsr�r�r�r�c�"�|dddddd��S)zu Create a transform representing the identity transform. The identity transform is a no-op. r rr7)rps r�identityzTransform.identitys���s�1�a��A�q�!�$�$�$rc�"�|dddd||��S)aF Create a transform that performs translation. Args: x (Number): distance to translate points along the x (horizontal) axis. y (Number): distance to translate points along the y (vertical) axis. Returns: A Transform representing the specified translation. r rr7�rpr�r�s r� translationzTransform.translation%s���s�1�a��A�q�!�$�$�$rNc�*�|�|}||dd|dd��S)a Create a transform that performs scaling. Args: x (Number): scaling ratio in the x (horizontal) axis. A value of 1 results in no scale change in the x axis. y (Number): optional scaling ratio in the y (vertical) axis. A value of 1 results in no scale change in the y axis. If this value is omitted, it defaults to the value provided to the `x` argument. Returns: A Transform representing the specified scaling. Nrr7r s r�scalingzTransform.scaling4s(�� �9��A��s�1�a��A�q�!�$�$�$rc��|tj|��tj|��tj|�� tj|��dd��S)a# Create a transform that performs rotation. Args: theta (Number): the angle **in radians** by which to rotate. Positive values represent clockwise rotations. Returns: A Transform representing the specified rotation. r)r��cos�sin)rp�thetas r�rotationzTransform.rotationHsJ���s� �H�U�O�O�T�X�e�_�_�t�x����.>������QR�TU� � � rc�P�|�tj|����S)a4 Create a transform that performs rotation **in degrees**. Args: theta_d (Number): the angle **in degrees** by which to rotate. Positive values represent clockwise rotations. Returns: A Transform representing the specified rotation. )rr��radians)rp�theta_ds r� rotation_dzTransform.rotation_dYs ���|�|�D�L��1�1�2�2�2rc�*�|�|}|d||ddd��S)a� Create a transform that performs shearing (not of sheep). Args: x (Number): The amount to shear along the x (horizontal) axis. y (Number): Optional amount to shear along the y (vertical) axis. If omitted, this defaults to the value provided to the `x` argument. Returns: A Transform representing the specified shearing. Nr rr7r s r�shearingzTransform.shearinghs(�� �9��A��s�1�a��A�q�!�$�$�$rc�>�|t�||��zS)a� Produce a transform by composing the current transform with a translation. .. note:: Transforms are immutable, so this returns a new transform rather than mutating self. Args: x (Number): distance to translate points along the x (horizontal) axis. y (Number): distance to translate points along the y (vertical) axis. Returns: A Transform representing the composed transform. �r�r �r0r�r�s r� translatezTransform.translatezs���i�+�+�A�q�1�1�1�1rc�>�|t�||��zS)a� Produce a transform by composing the current transform with a scaling. .. note:: Transforms are immutable, so this returns a new transform rather than mutating self. Args: x (Number): scaling ratio in the x (horizontal) axis. A value of 1 results in no scale change in the x axis. y (Number): optional scaling ratio in the y (vertical) axis. A value of 1 results in no scale change in the y axis. If this value is omitted, it defaults to the value provided to the `x` argument. Returns: A Transform representing the composed transform. )r�r rs r�scalezTransform.scale�s��$�i�'�'��1�-�-�-�-rc�<�|t�|��zS)a� Produce a transform by composing the current transform with a rotation. .. note:: Transforms are immutable, so this returns a new transform rather than mutating self. Args: theta (Number): the angle **in radians** by which to rotate. Positive values represent clockwise rotations. Returns: A Transform representing the composed transform. )r�r)r0rs r�rotatezTransform.rotate�s���i�(�(��/�/�/�/rc�<�|t�|��zS)a� Produce a transform by composing the current transform with a rotation **in degrees**. .. note:: Transforms are immutable, so this returns a new transform rather than mutating self. Args: theta_d (Number): the angle **in degrees** by which to rotate. Positive values represent clockwise rotations. Returns: A Transform representing the composed transform. )r�r)r0rs r�rotate_dzTransform.rotate_d�s�� �i�*�*�7�3�3�3�3rc�>�|t�||��zS)a% Produce a transform by composing the current transform with a shearing. .. note:: Transforms are immutable, so this returns a new transform rather than mutating self. Args: x (Number): The amount to shear along the x (horizontal) axis. y (Number): Optional amount to shear along the y (vertical) axis. If omitted, this defaults to the value provided to the `x` argument. Returns: A Transform representing the composed transform. )r�rrs r�shearzTransform.shear�s�� �i�(�(��A�.�.�.�.rc�z�t�| | ��|zt�||��zS)a� Bracket the given transform in a pair of translations to make it appear about a point that isn't the origin. This is a useful shorthand for performing a transform like a rotation around the center point of an object that isn't centered at the origin. .. note:: Transforms are immutable, so this returns a new transform rather than mutating self. Args: x (Number): the point along the x (horizontal) axis about which to transform. y (Number): the point along the y (vertical) axis about which to transform. Returns: A Transform representing the composed transform. rrs r�aboutzTransform.about�s8��&�$�$�a�R�!��,�,�t�3�i�6K�6K�A�q�6Q�6Q�Q�Qrc ���t|t��rEt|j|z|j|z|j|z|j|z|j|z|j|z���StS)z� Multiply the individual transform parameters by a scalar value. Args: other (Number): the scalar value by which to multiply the parameters Returns: A Transform with the modified parameters. �rtrsr�r�r�r�) rVr]r�rtrsr�r�r�r�r�r�s rr�zTransform.__mul__�sk�� �e�[� )� )� ���&�5�.��&�5�.��&�5�.��&�5�.��&�5�.��&�5�.� ��� ��rc ���t|t��r�|�|j|jz|j|jzz|j|jz|j|jzz|j|jz|j|jzz|j|jz|j|jzz|j|jz|j|jzz|jz|j|jz|j|jzz|jz���StS)z� Compose two transforms into a single transform. Args: other (Transform): the right-hand side transform of the infix operator. Returns: A Transform representing the composed transform. r') rVr�rurtrsr�r�r�r�r�r�s rr�zTransform.__matmul__s��� �e�Y� '� '� ��>�>��&�5�7�"�T�V�e�g�%5�5��&�5�7�"�T�V�e�g�%5�5��&�5�7�"�T�V�e�g�%5�5��&�5�7�"�T�V�e�g�%5�5��&�5�7�"�T�V�e�g�%5�5���?��&�5�7�"�T�V�e�g�%5�5���?� "��� ��rc ��t|j���dt|j���dt|j���dt|j���dt|j���dt|j���d� |fS)z� Render the transform to its PDF output representation. Args: last_item: the last path element this transform applies to Returns: A tuple of `(str, last_item)`. `last_item` is returned unchanged. rNz cm�rFrtrsr�r�r�r�)r0� last_items rr�zTransform.renders����T�V�$�$� B� B�}�T�V�'<�'<� B� B��T�V�$�$� B� B�'4�T�V�'<�'<� B� B��T�V�$�$� B� B�'4�T�V�'<�'<� B� B� B� �  � rc��dt|j���dt|j���dt|j���dt|j���dt|j���dt|j���d� S)Nz transform: [rNz 0; z 1]r*rxs rrzTransform.__str__+s��� B��T�V�$�$� B� B�'4�T�V�'<�'<� B� B��T�V�$�$� B� B�'4�T�V�'<�'<� B� B��T�V�$�$� B� B�(5�T�V�'<�'<� B� B� B� rrP)r4r5rr6rr� classmethodrr r rrrrrrr!r#r%rr�rr�r�rr7rrr�r��s��������7�7�r�I�I�I� �I�I�I� �I�I�I� �I�I�I� �I�I�I� �I�I�I��%�%��[�%�� %� %��[� %��%�%�%��[�%�&� � ��[� � � 3� 3��[� 3��%�%�%��[�%�"2�2�2�".�.�.�.�(0�0�0�"4�4�4�$/�/�/�/�$R�R�R�*����^��.�H�����^��, � � �" � � � � rr�z Transform.az Transform.bz Transform.cz Transform.dz Transform.ez Transform.fc�>��eZdZdZdZ dZ ejjej jej jfZ gd�eD���RZ e i��eje dh��eje dejh��eje dejh��eje ddejh��eje ddejh��ejiZ ed���Zd�Zd �Z�fd �Zed ���Zej �fd ���Zed ���Z!e!j �fd���Z!ed���Z"e"j �fd���Z"ed���Z#e#j �fd���Z#ed���Z$e$j �fd���Z$ed���Z%e%j �fd���Z%ed���Z&e&j �fd���Z&ed���Z'e'j �fd���Z'ed���Z(e(j �fd���Z(ed���Z)e)j �fd���Z)ed���Z*e*j �fd ���Z*ed!���Z+e+j �fd"���Z+ed#���Z,e,j �fd$���Z,ed%���Z-e-j �fd&���Z-ed'���Z.e.j �fd(���Z.d)�Z/e0d*���Z1�xZ2S)+r*a� A class representing various style attributes that determine drawing appearance. This class uses the convention that the global Python singleton ellipsis (`...`) is exclusively used to represent values that are inherited from the parent style. This is to disambiguate the value None which is used for several values to signal an explicitly disabled style. An example of this is the fill/stroke color styles, which use None as hints to the auto paint style detection code. .)� paint_rule�allow_transparency� auto_close�intersection_rule� fill_color� fill_opacity� stroke_color�stroke_opacity� blend_mode� stroke_width�stroke_cap_style�stroke_join_style�stroke_miter_limit�stroke_dash_pattern�stroke_dash_phasec#�@K�|]}|tju�|jV��dSrP)r�STROKE_DASH_PATTERNr=)rSr�s rrUzGraphicsStyle.<genexpr>gs1���� U� U�a�1�L�4T�+T�+T�!�'�+T�+T�+T�+T� U� Ur�stroke�fillc ���|��}|jD]L}t||��}||jur t||t||�����;t|||���M|S)aA Merge parent and child into a single GraphicsStyle. The result contains the properties of the parent as overridden by any properties explicitly set on the child. If both the parent and the child specify to inherit a given property, that property will preserve the inherit value. )�MERGE_PROPERTIESrX�INHERIT�setattr)rp�parent�child�new�prop�cvals r�mergezGraphicsStyle.mergeysv���c�e�e���(� )� )�D��5�$�'�'�D��s�{�"�"���T�7�6�4�#8�#8�9�9�9�9���T�4�(�(�(�(�� rc�n�|j|_|j|_|j|_|j|_|j|_|j|_|j|_|j|_|j|_ |j|_ |j|_ |j|_ |j|_ |j|_|j|_dSrP)rDr0r/r1r2r3r4r5r6r7r8r9r:r;r<r=rxs r�__init__zGraphicsStyle.__init__�s���"&�,����,����,���!%�����,��� �L��� �L���"�l����,��� �L��� $� ���!%����"&�,���#'�<�� �!%�����rc ��|���}|jD]!}t||t||�����"|SrP)rurCrErX)r0�memo�copiedrIs r� __deepcopy__zGraphicsStyle.__deepcopy__�sG�����!�!���)� 7� 7�D� �F�D�'�$��"5�"5� 6� 6� 6� 6�� rc���t|j|��st|j�d|�d����t���||��dS)Nz does not have style "z " (a typo?))�hasattrru�AttributeErrorrn� __setattr__)r0r2r=rus �rrUzGraphicsStyle.__setattr__�sa����t�~�t�,�,� � ��>�J�J��J�J�J��� � �����D�%�(�(�(�(�(rc��|jSrP)�_allow_transparencyrxs rr0z GraphicsStyle.allow_transparency�s ���'�'rc�H��t���d|��S)NrW)rnrU�r0rHrus �rr0z GraphicsStyle.allow_transparency�s����w�w�"�"�#8�#�>�>�>rc��|jS)z*The paint rule to use for this path/group.)� _paint_rulerxs rr/zGraphicsStyle.paint_rule�� ����rc�*��|�.t���dtj��dS||jur$t���d|��dSt���dtj|����dS)Nr[)rnrUr � DONT_PAINTrD�coercerYs �rr/zGraphicsStyle.paint_rule�s���� �;� �G�G� � � �}�/G� H� H� H� H� H� �D�L� � � �G�G� � � �s� 3� 3� 3� 3� 3� �G�G� � � �}�/C�C�/H�/H� I� I� I� I� Irc��|jS)zEIf True, unclosed paths will be automatically closed before stroking.)� _auto_closerxs rr1zGraphicsStyle.auto_close�r\rc���|dd|jhvrtd|�����t���d|��dS)NTFz/auto_close must be a bool or self.INHERIT, not ra)rDrdrnrUrYs �rr1zGraphicsStyle.auto_close�sN��� �t�U�D�L�1� 1� 1��S�c�S�S�T�T� T� �����M�3�/�/�/�/�/rc��|jS)z2The desired intersection rule for this path/group.)�_intersection_rulerxs rr2zGraphicsStyle.intersection_rule�� ���&�&rc����||jur$t���d|��dSt���dtj|����dS)Nrd)rDrnrUr r_rYs �rr2zGraphicsStyle.intersection_rule�s`��� �$�,� � � �G�G� � � 4�c� :� :� :� :� :� �G�G� � � 4�6F�6M�c�6R�6R� S� S� S� S� Src��|jS)z� The desired fill color for this path/group. When setting this property, if the color specifies an opacity value, that will be used to set the fill_opacity property as well. )� _fill_colorrxs rr3zGraphicsStyle.fill_color�s ����rc���t|t��rt|��}t|ttt f��r9t ���d|��|j�|j|_ dSdS|� ||j ur$t ���d|��dSt|�d����)Nrh�" doesn't look like a drawing color) rVrYr�rjr�r�rnrUrtr4rDrd�r0�colorrus �rr3zGraphicsStyle.fill_color�s���� �e�S� !� !� 1�)�%�0�0�E� �e�i��Z�@� A� A� J� �G�G� � � �u� 5� 5� 5��w�"�$)�G��!�!�!�#�"��m��$�,�!6�!6� �G�G� � � �u� 5� 5� 5� 5� 5��u�H�H�H�I�I� Irc�@�t|tjj��S)z-The desired fill opacity for this path/group.)rXr� FILL_ALPHAr=rxs rr4zGraphicsStyle.fill_opacity�����t�\�4�:�;�;�;rc���|d|jhvrt|��t���tjj|��dSrP)rDr@rnrUrrnr=rYs �rr4zGraphicsStyle.fill_opacity�sI��� �t�T�\�*� *� *� �� � � � �����L�3�9�3�?�?�?�?�?rc��|jS)z� The desired stroke color for this path/group. When setting this property, if the color specifies an opacity value, that will be used to set the fill_opacity property as well. )� _stroke_colorrxs rr5zGraphicsStyle.stroke_colors ���!�!rc���t|t��rt|��}t|ttt f��rNt ���d|��|j� |j|_ |j |j ur d|_ dSdS|� ||j ur$t ���d|��dSt|�d����)Nrrr rj) rVrYr�rjr�r�rnrUrtr6r8rDrdrks �rr5zGraphicsStyle.stroke_colors���� �e�S� !� !� 1�)�%�0�0�E� �e�i��Z�@� A� A� J� �G�G� � ��� 7� 7� 7��w�"�&+�g��#�� �D�L�0�0�$%��!�!�!�1�0��m��$�,�!6�!6� �G�G� � ��� 7� 7� 7� 7� 7��u�H�H�H�I�I� Irc�@�t|tjj��S)z/The desired stroke opacity for this path/group.)rXr� STROKE_ALPHAr=rxs rr6zGraphicsStyle.stroke_opacity"����t�\�6�<�=�=�=rc���|d|jhvrt|��t���tjj|��dSrP)rDr@rnrUrrur=rYs �rr6zGraphicsStyle.stroke_opacity'sI��� �t�T�\�*� *� *� �� � � � �����L�5�;�S�A�A�A�A�Arc�@�t|tjj��S)z+The desired blend mode for this path/group.)rXr� BLEND_MODEr=rxs rr7zGraphicsStyle.blend_mode.rorc���||jur3t���tjj|��dSt���tjjt j|��j��dSrP)rDrnrUrryr=r r_�r0r=rus �rr7zGraphicsStyle.blend_mode3su��� �D�L� � � �G�G� � � � 7� =�u� E� E� E� E� E� �G�G� � ��'�-�y�/?��/F�/F�/L� � � � � rc�@�t|tjj��S)z-The desired stroke width for this path/group.)rXr� STROKE_WIDTHr=rxs rr8zGraphicsStyle.stroke_width<rvrc �8��t|tttjt d��t |j��f��stdt |�������t��� tj j |��dS)Nz#stroke_width must be a number, not ) rVr��float�decimal�Decimal�typerDrdrnrUrr}r=)r0�widthrus �rr8zGraphicsStyle.stroke_widthAs~���� � �%���$�t�*�*�d�4�<�6H�6H� I� � � Q��O�$�u�+�+�O�O�P�P� P� �����L�5�;�U�C�C�C�C�Crc�@�t|tjj��S)z1The desired stroke cap style for this path/group.)rXr�STROKE_CAP_STYLEr=rxs rr9zGraphicsStyle.stroke_cap_styleKs���t�\�:�@�A�A�Arc���||jur3t���tjj|��dSt���tjjt j|����dSrP)rDrnrUrr�r=rr_r{s �rr9zGraphicsStyle.stroke_cap_stylePsr��� �D�L� � � �G�G� � � � =� C�U� K� K� K� K� K� �G�G� � ��-�3�^�5J�5�5Q�5Q� � � � � rc�@�t|tjj��S)z2The desired stroke join style for this path/group.)rXr�STROKE_JOIN_STYLEr=rxs rr:zGraphicsStyle.stroke_join_styleYs���t�\�;�A�B�B�Brc���||jur3t���tjj|��dSt���tjjt j|����dSrP)rDrnrUrr�r=rr_r{s �rr:zGraphicsStyle.stroke_join_style^ss��� �D�L� � � �G�G� � � � >� D�e� L� L� L� L� L� �G�G� � ��.�4��&�u�-�-� � � � � rc�@�t|tjj��S)z3The desired stroke miter limit for this path/group.)rXr�STROKE_MITER_LIMITr=rxs rr;z GraphicsStyle.stroke_miter_limiths���t�\�<�B�C�C�Crc����||just|t��r3t���t jj|��dSt|�d����)Nz is not a number) rDrVr]rnrUrr�r=rdr{s �rr;z GraphicsStyle.stroke_miter_limitms\��� �T�\� !� !�j�� �&D�&D� !� �G�G� � � � ?� E�u� M� M� M� M� M��u�6�6�6�7�7� 7rc��|jS)z4The desired stroke dash pattern for this path/group.)�_stroke_dash_patternrxs rr<z!GraphicsStyle.stroke_dash_patternts ���(�(rc�z��|�d}n�||jur|}n�t|t��r|f}nm g}|D]?}t|t��std|�d����|�|���@n"#t$rtd|�d���d�wxYwg|�R}t ���d|��dS)Nr7zstroke_dash_pattern z sequence has non-numeric valuez( must be a number or sequence of numbersr�)rDrVr]rdrcrnrU)r0r=�result�accumrrus �rr<z!GraphicsStyle.stroke_dash_patternys��� �=��F�F� �d�l� "� "��F�F� ��{� +� +� ��X�F�F� ���!�'�'�D�%�d�K�8�8��'�Y�5�Y�Y�Y�����L�L��&�&�&�&� '�� � � � ��Z�5�Z�Z�Z����� �����u�Y�Y�F� �����2�F�;�;�;�;�;s �AA2�2Bc��|jS)zAThe desired stroke dash pattern phase offset for this path/group.)�_stroke_dash_phaserxs rr=zGraphicsStyle.stroke_dash_phase�rerc���||just|t��r"t���d|��St |�d����)Nr�z( isn't a number or GraphicsStyle.INHERIT)rDrVr]rnrUrdr{s �rr=zGraphicsStyle.stroke_dash_phase�sQ��� �D�L� � �J�u�k�$B�$B� ��7�7�&�&�';�U�C�C� C��5�J�J�J�K�K�Krc��t��}|jD](}t|||j��}||jur|�|||<�)|jr.|j|jur |j|jg|t jj<|j dur|j D] }||vr||=� |rGtd��}td��||<|� |d���t|��SdS)z� Convert this style object to a PDF dictionary with appropriate style keys. Only explicitly specified values are emitted. NF�Type� ExtGState)�last)r�PDF_STYLE_KEYSrXrDr<r=rr?r=r0�TRANSPARENCY_KEYSr� move_to_endrQ)r0r�rhr=� type_names rr-zGraphicsStyle.serialize�s�� �����&� $� $�C��D�#�t�|�4�4�E��T�\�)�)��0A�$��s� �� � #� ��(@�� �(T�(T��(��&�>�F�<�3�9� :� � "�e� +� +��-� $� $���&�=�=��s� �� � 0��V� � �I� $�[� 1� 1�F�9� � � � �y�u� � 5� 5� 5�'��/�/� /��trc���|jtjur�t��}|j�|j�|�d��|j�8|�d��|j�J�|�|j�� |j t|��}n>#t$rtj }Yn&wxYw|j|j ur tj }n|j}|S)z� Resolve `PathPaintRule.AUTO` to a real paint rule based on this style. Returns: the resolved `PathPaintRule`. Nr@rA)r/r �AUTO�setr8r5�addr3r2�_PAINT_RULE_LOOKUP� frozensetr.�STROKE_FILL_NONZEROrD)r0�want�rules r�resolve_paint_rulez GraphicsStyle.resolve_paint_rule�s��� �?�m�0� 0� 0��5�5�D�� �,��1B�1N�����"�"�"���*����� � � ��-�9�9�9�����/�0�0�0� 9��.�y����?����� 9� 9� 9�%�8���� 9���� �_�� � ,� ,�!�4�D�D��?�D�� s�B � B9�8B9)3r4r5rr6rDrCrrnr=ruryr�r�r�r r^�STROKEr �NONZERO� FILL_NONZERO�EVENODD� FILL_EVENODDr��STROKE_FILL_EVENODDr�r-rKrMrQrUr�r0�setterr/r1r2r3r4r5r6r7r8r9r:r;r<r=r-rr�r�r�s@rr*r*<s�����������G�]���"V� ��%��!�'���%��� S�� U� U�<� U� U� U���N�U� � �"� � �}�/�� �8�*���}�3�� �6�+�3�4�5�5�}�7Q�� �6�+�3�4�5�5�}�7Q�� � �v�/�7� 8� � � � ,�� � �v�/�7� 8� � � � ,� ��:�����[��$.�.�.�"���)�)�)�)�)��(�(��X�(���?�?�?�?���?� � � ��X� ���J�J�J�J���J�� � ��X� ���0�0�0�0���0� �'�'��X�'���T�T�T�T���T�� � ��X� ��� J� J� J� J��� J��<�<��X�<���@�@�@�@���@� �"�"��X�"���J�J�J�J���J�"�>�>��X�>���B�B�B�B���B� �<�<��X�<�����������>�>��X�>���D�D�D�D���D��B�B��X�B�����������C�C��X�C�����������D�D��X�D���8�8�8�8���8� �)�)��X�)���<�<�<�<� ��<�0�'�'��X�'���L�L�L�L���L� (�(�(�T�"�"���"�"�"�"�"rr*c�0�|����d�S)Nz m�r���pts r� _render_mover������i�i�k�k� � � �rc�0�|����d�S)Nz lr�r�s r� _render_liner��r�rc��|����d|����d|����d�S)NrNz cr�)�ctrl1�ctrl2�ends r� _render_curver��s9���l�l�n�n� @� @�u�|�|�~�~� @� @�� � � � � @� @� @�@rc�b�eZdZUdZeed< ed���Zed���Z ed���Z dS)�Movez� A path move element. If a path has been created but not yet painted, this will create a new subpath. See: `PaintedPath.move_to` r�c��|jS�z#The end point of this path element.r�rxs r� end_pointzMove.end_point� ���w�rc�:�t|j��||jfS�a� Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is `self` )r�r��r0� gsd_registryr)r+� initial_points rr�z Move.render s�� �D�G�$�$�d�D�G�3�3rc��|�||||��\}}}|�t|��dz��|||fS)a0 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `Move.render`. r�r��writerY� r0r�r)r+r�� debug_stream�pfx�rendered�resolveds r� render_debugzMove.render_debug�U��0-1�K�K� �%��M�- �- �)��(�M� ���3�t�9�9�t�+�,�,�,���=�0�0rN� r4r5rr6r�rr�r�rr�r�r7rrr�r��s��������� �I�I�I�%� ����X���4�4���4�"�1�1���1�1�1rr�c�L�eZdZUdZeed< ed���Zed���ZdS)� RelativeMovez� A path move element with an end point relative to the end of the previous path element. If a path has been created but not yet painted, this will create a new subpath. See: `PaintedPath.move_relative` r�c�^�|j|jz}t|��t|��|fS)a Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved `Move` )r�r�r�r��r0r�r)r+r��points rr�zRelativeMove.renderJs.��"�#�d�g�-���E�"�"�D��K�K��6�6rc�z�|�||||��\}}}|�|�d|�d���|||fS)a8 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RelativeMove.render`. � resolved to r�r�r�r�s rr�zRelativeMove.render_debug^�[��0-1�K�K� �%��M�- �- �)��(�M� ���d�=�=��=�=�=�>�>�>���=�0�0rN� r4r5rr6r�rrr�r�r7rrr�r�=sd��������� �I�I�I�&��7�7���7�&�1�1���1�1�1rr�c�b�eZdZUdZeed< ed���Zed���Z ed���Z dS)�Linez� A path line element. This draws a straight line from the end point of the previous path element to the point specified by `pt`. See: `PaintedPath.line_to` r�c��|jSr�r�rxs rr�zLine.end_point�r�rc�0�t|j��||fSr�)r�r�r�s rr�z Line.render�s�� �D�G�$�$�d�M�9�9rc��|�||||��\}}}|�t|��dz��|||fS)a0 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `Line.render`. rr�r�s rr�zLine.render_debug�r�rNr�r7rrr�r�~s��������� �I�I�I�/� ����X���:�:���:�"�1�1���1�1�1rr�c�L�eZdZUdZeed< ed���Zed���ZdS)� RelativeLinead A path line element with an endpoint relative to the end of the previous element. This draws a straight line from the end point of the previous path element to the point specified by `last_item.end_point + pt`. The absolute coordinates of the end point are resolved during the rendering process. See: `PaintedPath.line_relative` r�c�^�|j|jz}t|��t|��|fS)� Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved `Line`. )r�r�r�r�r�s rr�zRelativeLine.render�s.��"�#�d�g�-���E�"�"�D��K�K��>�>rc�z�|�||||��\}}}|�|�d|�d���|||fS)a8 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RelativeLine.render`. r�rr�r�s rr�zRelativeLine.render_debug�r�rNr�r7rrr�r��sd��������� �I�I�I�I��?�?���?�&�1�1���1�1�1rr�c�L�eZdZUdZeed< ed���Zed���ZdS)�HorizontalLinez� A path line element that takes its ordinate from the end of the previous element. See: `PaintedPath.horizontal_line_to` r�c��t|j|jj���}t |��t |��|fS�r�r�)r�r�r�r�r�r��r0r�r)r+r�r�s rr�zHorizontalLine.renders9��"�D�F�i�&9�&;�<�<�<� ��I�&�&��Y����F�Frc�z�|�||||��\}}}|�|�d|�d���|||fS)a: Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `HorizontalLine.render`. r�rr�r�s rr�zHorizontalLine.render_debug"r�rN� r4r5rr6rrrr�r�r7rrr�r�sg��������� �I�I�I�:��G�G���G�&�1�1���1�1�1rr�c�L�eZdZUdZeed< ed���Zed���ZdS)�RelativeHorizontalLinez� A path line element that takes its ordinate from the end of the previous element and computes its abscissa offset from the end of that element. See: `PaintedPath.horizontal_line_relative` r�c��t|jj|jz|jj���}t |��t |��|fSr��r�r�r�r�r�r�r�s rr�zRelativeHorizontalLine.renderPsD��"�I�/�1�D�F�:�i�>Q�>S�T�T�T� ��I�&�&��Y����F�Frc�z�|�||||��\}}}|�|�d|�d���|||fS)aB Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RelativeHorizontalLine.render`. r�rr�r�s rr�z#RelativeHorizontalLine.render_debugdr�rNr�r7rrr�r�B�k����������I�I�I�� �G�G���G�&�1�1���1�1�1rr�c�L�eZdZUdZeed< ed���Zed���ZdS)� VerticalLinez� A path line element that takes its abscissa from the end of the previous element. See: `PaintedPath.vertical_line_to` r�c��t|jj|j���}t |��t |��|fSr�r�r�s rr�zVerticalLine.render�s9��"�I�/�1�T�V�<�<�<� ��I�&�&��Y����F�Frc�z�|�||||��\}}}|�|�d|�d���|||fS)a8 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `VerticalLine.render`. r�rr�r�s rr�zVerticalLine.render_debug�r�rNr�r7rrr�r��sg��������� �I�I�I�8��G�G���G�&�1�1���1�1�1rr�c�L�eZdZUdZeed< ed���Zed���ZdS)�RelativeVerticalLinez� A path line element that takes its abscissa from the end of the previous element and computes its ordinate offset from the end of that element. See: `PaintedPath.vertical_line_relative` r�c��t|jj|jj|jz���}t |��t |��|fSr�r�r�s rr�zRelativeVerticalLine.render�sD��"�I�/�1�Y�5H�5J�T�V�5S�T�T�T� ��I�&�&��Y����F�Frc�z�|�||||��\}}}|�|�d|�d���|||fS)a@ Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RelativeVerticalLine.render`. r�rr�r�s rr�z!RelativeVerticalLine.render_debug�r�rNr�r7rrr�r��r�rr�c�z�eZdZUdZeed< eed< eed< ed���Zed���Z ed���Z dS) � BezierCurveu� A cubic Bézier curve path element. This draws a Bézier curve parameterized by the end point of the previous path element, two off-curve control points, and an end point. See: `PaintedPath.curve_to` �c1�c2r�c��|jSr��r�rxs rr�zBezierCurve.end_point� ���x�rc�H�t|j|j|j��||fSr�)r�r�r�r�r�s rr�zBezierCurve.renders#�� �T�W�d�g�t�x�8�8�$� �M�Mrc��|�||||��\}}}|�t|��dz��|||fS)a7 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `BezierCurve.render`. rr�r�s rr�zBezierCurve.render_debug,r�rNr�r7rrr�r�s���������� �I�I�I�*� �I�I�I�+� �J�J�J� � ����X���N�N���N�"�1�1���1�1�1rr�c�d�eZdZUdZeed< eed< eed< ed���Zed���ZdS)�RelativeBezierCurveu� A cubic Bézier curve path element whose points are specified relative to the end point of the previous path element. See: `PaintedPath.curve_relative` r�r�r�c��|j}||jz}||jz}||jz}t |||��t |||���|fS)a  Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved `BezierCurve`. )r�r�r�)r�r�r�r�r�r�) r0r�r)r+r�� last_pointr�r�r�s rr�zRelativeBezierCurve.render_s`��"�(� � �$�'� !�� �$�'� !���4�8�#�� �"�b�#� &� &� �2�"�#� .� .� .� � � rc�z�|�||||��\}}}|�|�d|�d���|||fS)a? Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RelativeBezierCurve.render`. r�rr�r�s rr�z RelativeBezierCurve.render_debug|r�rNr�r7rrrrLs���������� �I�I�I�� �I�I�I�� �J�J�J�Q�� � ��� �8�1�1���1�1�1rrc�t�eZdZUdZeed< eed< ed���Zd�Ze d���Z e d���Z dS) �QuadraticBezierCurveu� A quadratic Bézier curve path element. This draws a Bézier curve parameterized by the end point of the previous path element, one off-curve control point, and an end point. See: `PaintedPath.quadratic_curve_to` �ctrlr�c��|jSr�r�rxs rr�zQuadraticBezierCurve.end_point�rrc�\�|j}|j}t|jd|j|jz zdz z|jd|j|jz zdz z���}t|jd|j|jz zdz z|jd|j|jz zdz z���}t |||��S)Nr�r�r�)r r�r�r�r�r�)r0� start_pointr r�r�r�s r�to_cubic_curvez#QuadraticBezierCurve.to_cubic_curve�s����y���h����m�a�4�6�K�M�#9�:�Q�>�>��m�a�4�6�K�M�#9�:�Q�>�>� � � ����e�a�4�6�C�E�>�*�Q�.�.��e�a�4�6�C�E�>�*�Q�.�.� � � �� �5�%��-�-�-rc�t�|�|j���||||��d||fS)a� Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is `self`. r)rr�r�r�s rr�zQuadraticBezierCurve.render�sK�� � � � � 3� 4� 4� ;� ;��e�Y� � � �� � � �  � rc��|�||||��\}}}|�|�d|�|j���d���|||fS)a@ Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `QuadraticBezierCurve.render`. r�r�r�r�rr�r�s rr�z!QuadraticBezierCurve.render_debug�su��0-1�K�K� �%��M�- �- �)��(�M� ���� N� N�$�"5�"5�i�6I�"J�"J� N� N� N� � � ���=�0�0rN) r4r5rr6r�rr�r�rrr�r�r7rrr r �s���������� �K�K�K�$� �J�J�J� � ����X�� .� .� .�� � ��� �,�1�1���1�1�1rr c�X�eZdZUdZeed< eed< ed���Zed���ZdS)�RelativeQuadraticBezierCurveu� A quadratic Bézier curve path element whose points are specified relative to the end point of the previous path element. See: `PaintedPath.quadratic_curve_relative` r r�c��|j}||jz}||jz}t||���}|�||||��S)a Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved `QuadraticBezierCurve`. )r r�)r�r r�r r�) r0r�r)r+r�rr r��absolutes rr�z#RelativeQuadraticBezierCurve.render sN�� �(� ��D�I�%���4�8�#��'�T�s�;�;�;�����|�U�I�}�M�M�Mrc ��|�||||��\}}}|�|�d|�d|�|j���d���|||fS)aH Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RelativeQuadraticBezierCurve.render`. r�z then to rrr�s rr�z)RelativeQuadraticBezierCurve.render_debug s���0-1�K�K� �%��M�- �- �)��(�M� ���� H� H�(� H� H��.�.�y�/B�C�C� H� H� H� � � � ��=�0�0rNr�r7rrrr�ss��������� �K�K�K�U� �J�J�J�Q��N�N���N�.�1�1���1�1�1rrc��eZdZUdZeed< eed< eed< eed< eed< ee d�����Z d�Z e d ���Z e d ���Z d S) �Arcz� An elliptical arc path element. The arc is drawn from the end of the current path element to its specified end point using a number of parameters to determine how it is constructed. See: `PaintedPath.arc_to` �radiir�large�sweepr�c#� K�t|��}|}tjdz }tj||z ��}||z }tj|��}tj|��}dtj|dz ��z}td|��}t|||zz|||zz ��} t||��} t|��D]6} ||z } t� | ��} || z| | z| | zfV�||z}�7dS)uq A generator that subdivides a swept angle into segments no larger than a quarter turn. Any sweep that is larger than a quarter turn is subdivided into as many equally sized segments as necessary to prevent any individual segment from being larger than a quarter turn. This is used for approximating a circular curve segment using cubic Bézier curves. This computes the parameters used for the Bézier approximation up front, as well as the transform necessary to place the segment in the correct position. Args: sweep_angle (Number): the angle to subdivide. Yields: A tuple of (ctrl1, ctrl2, end) representing the control and end points of the cubic Bézier curve approximating the segment as a unit circle centered at the origin. r�gUUUUUU�?r�r N) �absr��pi�ceilrr�tanr�r�r�r)� sweep_angle� sweep_left� quarterturn�chunks� sweep_segment�cos_t�sin_t�kappar�r�r��_�offset� transforms r�subdivde_sweepzArc.subdivde_sweepW s ����0�+�&�&� � � ��g��k� ���;��4�5�5��#�f�,� ����'�'�����'�'�������!2�3�3�3���a������e�e�e�m�+�U�U�U�]�-B�C�C���E�5�!�!���v��� (� (�A� �:�-�F�!�*�*�6�2�2�I��)�#�U�Y�%6��i��G� G� G� G� �-� '�J�J�  (� (rc ��|j}t�|j ��}t�|j��}|j|jz dz|z}|j|jz dz|j|jz dzz}|dkr't|dz|jz|dz|jz���}|j|j k|j|j kz }|j|jzdz}|j|jzdz} |j|jzdz} |tj t|| z | z d��| | zz ��zt|j|jz|jz |j |jz|jz ���z} | |z|j|jzdzz} t|j| jz |jz |j| jz |jz ���} t|j | jz |jz |j | jz |jz ���}tdd��� | ��}| � |��}|j dur|dkr|tjz}n|j dur|dkr|tjz }|dk|dkz }t�d|����|���|j|j���|j���| j| j��}g}|�|��D]3\}}}|�t+||z||z||z�����4|S) z� Approximate this arc with a sequence of `BezierCurve`. Args: last_item: the previous path element (used for its end point) Returns: a list of `BezierCurve`. r�r�r r�r�rFT)rr�rr�r�r�r�r�rrr��sqrtr�r��taur rrrr,rcr�)r0r+r�reverse�forward�prime�lam_dar��rxry2�rxpy2�rypx2� centerprime�center�arcstart�arcendr� deltatheta� sweep_sign�final_tf�curvesr�r�r�s r�_approximate_arczArc._approximate_arc� sW��� ���$�$�d�m�^�4�4���$�$�T�]�3�3���%���0�C�7�7�B���'�E�G�#��)�U�W�u�w�->�1�,D�D�� �A�:�:��V�S�[�E�G�3��� �u�w�7N�O�O�O�E�� �d�j�(�T�Z�4�:�-E�F����5�7�"�q�(����5�7�"�q�(����5�7�"�q�(�� ��i��e�e�m�e�3�Q�7�7�5�5�=�I�J�J� K���'�E�G�#�e�g�-��7�(�U�W�$�u�w�.���� � ���'�Y�-@�4�8�-K�s�,R�S����w���&�%�'�1��w���&�%�'�1� � � �����x�+�-�'�5�7�2���x�+�-�'�5�7�2� � � �� �a�� � �!�!�(�+�+���^�^�F�+�+� � �J�%� � �j�1�n�n� �$�(� "�J�J��j�D� � �z�A�~�~� �$�(� "�J� �A�o�*�q�.�9� � � � ��Z� � 0� 0� �V�E�]�]� �U�5�7�E�G� $� $� �V�D�M� "� "� �Y�v�x��� *� *� ���!%�!4�!4�Z�!@�!@� � � �E�5�#� �M�M��E�H�,�e�h�.>��h��O�O� � � � �� rc ������|�|��}|sd|fSd����fd�t|g|dd��|��D����|d�fS)� Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is a resolved `BezierCurve`. r�rNc3�Z�K�|]%\}}|���|���dV��&dS�rNr��rS�prev�curver�r�r)s ���rrUzArc.render.<locals>.<genexpr>� �R��������D�%�� � �\�5�$� �F�F�q�I������rNrw)r?r`�zip)r0r�r)r+r�r>s `` ` rr�z Arc.render� s������ �&�&�y�1�1��� !��y�=� � �H�H�������#&� �'@�F�3�B�3�K�'@�&�#I�#I���� � � �2�J� �  � rc������|�|��}|�|�d���|s|�|dz��d|fS|g}|dd�D]3} |�| ��|�|d| �d�z���4|�|d|d�d�z��d ����fd �t ||��D����|d�fS) a/ Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `Arc.render`. � resolved to: � └─ nothing r�Nrw� ├─ r� └─ rNc3�Z�K�|]%\}}|���|���dV��&dSrCr�rDs ���rrUz#Arc.render_debug.<locals>.<genexpr> rGr)r?r�rcr`rH) r0r�r)r+r�r�r�r>�previousrFs `` ` rr�zArc.render_debug� sG�����.�&�&�y�1�1�����d�3�3�3�4�4�4�� !� � � �s�%8�8� 9� 9� 9��y�=� ��;���C�R�C�[� ;� ;�E� �O�O�E� "� "� "� � � �s�%9��%9�%9�%9�9� :� :� :� :����3�!:�F�2�J�!:�!:�!:�:�;�;�;� �H�H�������#&�x��#8�#8���� � � �2�J� �  � rN)r4r5rr6r�rrr\� staticmethodrr,r?r�r�r7rrrr@ s���������� �L�L�L������V� �K�K�K�T� �K�K�K�F� �J�J�J�#���+(�+(����\�+(�ZG�G�G�R� � ��� �:�* �* ���* �* �* rrc�|�eZdZUdZeed< eed< eed< eed< eed< ed���Z ed���Z d S) � RelativeArcz� An elliptical arc path element. The arc is drawn from the end of the current path element to its specified end point using a number of parameters to determine how it is constructed. See: `PaintedPath.arc_relative` rrrrr�c��t|j|j|j|j|j|jz���||||��S)rA)rrrrrr�r�r�r�s rr�zRelativeArc.render2 sM�� � �J� �M� �J� �J� � �$�(� *�  � � �&��u�i�� ?� ?�  @rc���|�|�d���t|j|j|j|j|j|jz���||||||��S)a7 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RelativeArc.render`. r�) r�rrrrrr�r�r��r0r�r)r+r�r�r�s rr�zRelativeArc.render_debugJ so��0 ���d�1�1�1�2�2�2�� �J� �M� �J� �J� � �$�(� *�  � � �,�|�U�I�}�l�TW� X� X�  YrN) r4r5rr6r�rrr\rr�r�r7rrrRrR s���������� �L�L�L������V� �K�K�K�T� �K�K�K�F� �J�J�J�T��@�@���@�.�Y�Y���Y�Y�YrrRc�X�eZdZUdZeed< eed< ed���Zed���ZdS)� RectanglezA pdf primitive rectangle.�org�sizec��|j����d|j����d�t|j��|fS)a Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is a `Line` back to the rectangle's origin. rNz re)rXr�rYr�r�s rr�zRectangle.renderu sJ��&�x��� � � :� :�4�9�#3�#3�#5�#5� :� :� :� ���N�N� � � rc�z�|�||||��\}}}|�|�d|�d���|||fS)a5 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `Rectangle.render`. r�rr�r�s rr�zRectangle.render_debug� r�rNr�r7rrrWrWm sj�������$�$� �J�J�J�/� �K�K�K�0�� � ��� �.�1�1���1�1�1rrWc�j�eZdZUdZeed< eed< eed< d�Zed���Zed���Z dS) �RoundedRectanglezM A rectangle with rounded corners. See: `PaintedPath.rectangle` rXrY� corner_radiic ��g}|jjdkr|jjdkr�n�|jjdks|jjdkry|�t |j����|�t |j|jz����|�t�����nO|jjdks|jjdkr/|�t|j|j�����n|j\}}|j\}}|j\}}|jjdk|jjdkz }|jjdk|jjdkz } t|��t|��kr |jj}t|��t|��kr |jj}|t|��z}| t|��z}t||��} |�t t||z|������|�t t||z|z |������|�t| dddt||z||z������|�t t||z||z|z ������|�t| dddt||z|z ||z������|�t t||z||z������|�t| dddt|||z|z ������|�t t|||z������|�t| dddt||z|������|�t����|S�NrFT) rYr�r�rcr�rXr��Closer^rWrr�r) r0rbr�r��w�h�rx�ry� sign_width� sign_height�arc_rads r� _decomposezRoundedRectangle._decompose� sf���� �I�K�1� � �4�9�;�!�#3�#3� ��i�k�Q���D�I�K�1�$4�$4� �L�L��d�h��� (� (� (� �L�L��d�h���2�3�3� 4� 4� 4� �L�L���� !� !� !� !���!�Q�&�&�D�,=�,?�1�,D�,D� �L�L��4�8�T�Y�7�7� 8� 8� 8� 8��8�D�A�q��9�D�A�q��&�F�B���)�+��*�t�y�{�Q��?�J��9�;�!�+�� � �a��@�K��2�w�w��Q������Y�[���2�w�w��Q������Y�[���c�"�g�g�%�B��s�2�w�w�&�B��B��m�m�G� �L�L��e�A��F�A�.�.�/�/� 0� 0� 0� �L�L��e�A��E�B�J��2�2�3�3� 4� 4� 4� �L�L��W�a���e�A��E�1�r�6�6J�6J�K�K� L� L� L� �L�L��e�A��E�1�q�5�2�:�6�6�7�7� 8� 8� 8� �L�L��W�a���e�A��E�B�J��A��6N�6N�O�O� P� P� P� �L�L��e�A��F�A��E�2�2�3�3� 4� 4� 4� �L�L��W�a���e�A�q�1�u�r�z�6J�6J�K�K� L� L� L� �L�L��e�A�q�2�v�.�.�/�/� 0� 0� 0� �L�L��W�a���e�A��F�A�6F�6F�G�G� H� H� H� �L�L���� !� !� !�� rc���|���}|sd|fSg}|D]3}|�||||��\}}}|�|���4d�|��t |j��|fS)a Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is a resolved `Line`. r�rN)rir�rcr`r�rX� r0r�r)r+r�� components� render_listrr�s rr�zRoundedRectangle.render� s��� �_�_�&�&� �� !��y�=� �� �� )� )�D�15����e�Y� �2�2� .�H�i�� � � �x� (� (� (� (��x�x� �$�$�d�4�8�n�n�m�C�Crc�T�|���}|�|�d���|s|�|dz��d|fSg}|dd�D]O} | �||||��\} }}|�|d| �d�z��|�| ���P|d�||||��\} }}|�|d|d�d�z��|�| ��d �|��t |j��|fS) a< Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `RoundedRectangle.render`. rJrKr�NrwrLrrMrN)rir�r�rcr`r�rX� r0r�r)r+r�r�r�rlrmrr�s rr�zRoundedRectangle.render_debug sb��.�_�_�&�&� ����d�3�3�3�4�4�4�� !� � � �s�%8�8� 9� 9� 9��y�=� �� ��s��s�O� )� )�D�15����e�Y� �2�2� .�H�i�� � � �s�%8��%8�%8�%8�8� 9� 9� 9� � � �x� (� (� (� (�-7��^�-B�-B� �%��M�. �. �*��)�]� ���3�!>�J�r�N�!>�!>�!>�>�?�?�?����8�$�$�$��x�x� �$�$�d�4�8�n�n�m�C�CrN� r4r5rr6r�rrirr�r�r7rrr]r]� s���������� �J�J�J�/� �K�K�K�0�����-�'�'�'�R�D�D���D�:�+D�+D���+D�+D�+Drr]c�^�eZdZUdZeed< eed< d�Zed���Zed���Z dS)�Ellipsez5 An ellipse. See: `PaintedPath.ellipse` rr8c ��g}t|jj��}t|jj��}|j\}}t ||��}|dk�r7|dk�r0|�tt ||z|������|�t|dddt |||z������|�t|dddt ||z |������|�t|dddt |||z ������|�t|dddt ||z|������|�t����|Sr`) rrr�r�r8r�rcr�rra)r0rbrdre�cx�cyrhs rrizEllipse._decompose= sW���� ���� � �� ���� � ������B���B�-�-�� �!�G�G�"��'�'� �L�L��e�B��G�R�0�0�1�1� 2� 2� 2� �L�L��W�a���e�B��R��6H�6H�I�I� J� J� J� �L�L��W�a���e�B��G�R�6H�6H�I�I� J� J� J� �L�L��W�a���e�B��R��6H�6H�I�I� J� J� J� �L�L��W�a���e�B��G�R�6H�6H�I�I� J� J� J� �L�L���� !� !� !�� rc���|���}|sd|fSg}|D]3}|�||||��\}}}|�|���4d�|��t |j��|fS)a Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is a resolved `Move` to the center of the ellipse. r�rN)rir�rcr`r�r8rks rr�zEllipse.renderR s��� �_�_�&�&� �� !��y�=� �� �� )� )�D�15����e�Y� �2�2� .�H�i�� � � �x� (� (� (� (��x�x� �$�$�d�4�;�&7�&7��F�Frc�T�|���}|�|�d���|s|�|dz��d|fSg}|dd�D]O} | �||||��\} }}|�|d| �d�z��|�| ���P|d�||||��\} }}|�|d|d�d�z��|�| ��d �|��t |j��|fS) a3 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `Ellipse.render`. rJrKr�NrwrLrrMrN)rir�r�rcr`r�r8ros rr�zEllipse.render_debugp sd��.�_�_�&�&� ����d�3�3�3�4�4�4�� !� � � �s�%8�8� 9� 9� 9��y�=� �� ��s��s�O� )� )�D�15����e�Y� �2�2� .�H�i�� � � �s�%8��%8�%8�%8�8� 9� 9� 9� � � �x� (� (� (� (�-7��^�-B�-B� �%��M�. �. �*��)�]� ���3�!>�J�r�N�!>�!>�!>�>�?�?�?����8�$�$�$��x�x� �$�$�d�4�;�&7�&7��F�FrNrpr7rrrrrr1 s���������� �L�L�L�+� �M�M�M�@����*�G�G���G�:�+G�+G���+G�+G�+Grrrc�>�eZdZdZed���Zed���ZdS)� ImplicitClosezw A path close element that is conditionally rendered depending on the value of `GraphicsStyle.auto_close`. c�$�|jrd||fSd||fS)� Render this path element to its PDF representation. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command Returns: a tuple of `(str, new_last_item)`, where `new_last_item` is whatever the old last_item was. rcr�)r1r�s rr�zImplicitClose.render� s)��" � � 1�� �=�0� 0��9�m�+�+rc�z�|�||||��\}}}|�|�d|�d���|||fS)a9 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `ImplicitClose.render`. r�rr�r�s rr�zImplicitClose.render_debug� r�rN�r4r5rr6rr�r�r7rrryry� sV�������� �,�,���,�*�1�1���1�1�1rryc�>�eZdZdZed���Zed���ZdS)raz� A path close element. Instructs the renderer to draw a straight line from the end of the last path element to the start of the current path. See: `PaintedPath.close` c�&�dt|��|fS)r{rc)r�r�s rr�z Close.render� s��"�D��'�'��6�6rc��|�||||��\}}}|�t|��dz��|||fS)a1 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `Close.render`. rr�r�s rr�zClose.render_debug� r�rNr}r7rrrara� sV���������7�7���7�$�1�1���1�1�1rrac�B�eZdZdZd�Zd d�Zed���Zd�Zd�Z dS) �DrawingContextz� Base context for a drawing in a PDF This context is not stylable and is mainly responsible for transforming path drawing coordinates into user coordinates (i.e. it ensures that the output drawing is correctly scaled). c��g|_dSrP)� _subitemsrxs rrMzDrawingContext.__init__# s ������rTc���t|ttf��st|�d����|rt j|��}|j�|��dS)a� Append an item to this drawing context Args: item (GraphicsContext, PaintedPath): the item to be appended. _copy (bool): if true (the default), the item will be copied before being appended. This prevents modifications to a referenced object from "retroactively" altering its style/shape and should be disabled with caution. z# doesn't belong in a DrawingContextN)rV�GraphicsContext� PaintedPathrd�copy�deepcopyr�rc�r0r�_copys r�add_itemzDrawingContext.add_item& sf���$��+� >�?�?� J��t�H�H�H�I�I� I� � '��=��&�&�D� ����d�#�#�#�#�#rc�>�d|_tj|_tj|_t|��}t� dd���� d|dz ���� |��� |��\}}d|g}|||fS)NTr rwr�rr��q) r1r r�r/r r�r2r�r�r r%rr�)r)� first_pointr�heightr+rms r�_setup_render_prereqsz$DrawingContext._setup_render_prereqs: s������(�-���"2�":�����%�%� � � � ��R� � (� (� �U�Q�&�1�*�U� %� %� �U�5�\�\� �V�I� � � ��y��E�l� ��E�9�,�,rc�@�|jsdS|�||||��\}}}|jD]5} | �||||��\} }}| r|�| ���6t |��dkrdS|�|��} | �g|�dt| ���d���|�dt|j��dt|j ���d�z��|�d��d� |��S) a Render the drawing context to PDF format. Args: gsd_registry (GraphicsStateDictRegistry): the parent document's graphics state registry. first_point (Point): the starting point to use if the first path element is a relative element. scale (Number): the scale factor to convert from PDF pt units into the document's semantic units (e.g. mm or in). height (Number): the page height. This is used to remap the coordinates to be from the top-left corner of the page (matching fpdf's behavior) instead of the PDF native behavior of bottom-left. starting_style (GraphicsStyle): the base style for this drawing context, derived from the document's current style defaults. Returns: A string composed of the PDF representation of all the paths and groups in this context (an empty string is returned if there are no paths or groups) r�r�N� gsr�rN� d�Q) r�r�r�rcr/r3�insertrQr<rFr=r`) r0r�r�rr��starting_stylermr)r+rr��style_dict_names rr�zDrawingContext.renderL sX��*�~� ��2�(,�(B�(B� �K���) �) �%� �U�I��N� -� -�D�/3�{�{��e�Y� �0�0� ,�H�i��� -��"�"�8�,�,�,�� �{� � �q� � ��2�&�5�5�e�<�<�� � &� � � �q�%9�/�%J�%J�"O�"O�"O� P� P� P� � � ��$�U�%>�?�?�@�m�E�$;�<�<�@�@�@�A� � � � ���3�����x�x� �$�$�$rc�P�|�||||��\}}} |�d��|jdd�D]J} |�d��| �||| |d��\} } | r|�| ���K|j�r|�d��|jd�||| ||d��\} } }| r|�| ��t |��dkrd S|�|��} | �g|�dt| ���d ���|�d t|j ��d t|j ���d �z��|�d��d � |��Sd S)a� Render the drawing context to PDF format. Args: gsd_registry (GraphicsStateDictRegistry): the parent document's graphics state registry. first_point (Point): the starting point to use if the first path element is a relative element. scale (Number): the scale factor to convert from PDF pt units into the document's semantic units (e.g. mm or in). height (Number): the page height. This is used to remap the coordinates to be from the top-left corner of the page (matching fpdf's behavior) instead of the PDF native behavior of bottom-left. starting_style (GraphicsStyle): the base style for this drawing context, derived from the document's current style defaults. debug_stream (TextIO): a text stream to which a debug representation of the drawing structure will be written. Returns: A string composed of the PDF representation of all the paths and groups in this context (an empty string is returned if there are no paths or groups) zROOT NrwrL� │ rM� r�r�r�r�rNr�r�) r�r�r�r�rcr/r3r�rQr<rFr=r`) r0r�r�rr�r�r�rmr)r+rGr�r�s rr�zDrawingContext.render_debug� s���2)-�(B�(B� �K���) �) �%� �U�I� ���8�$�$�$��^�C�R�C�(� -� -�E� � � �z� *� *� *�"'�"4�"4��e�Y� �h�#�#� �H�i�� -��"�"�8�,�,�,�� �>� )� � � �z� *� *� *�/3�~�b�/A�/N�/N��e�Y� �\�6�0�0� ,�H�i��� -��"�"�8�,�,�,��;���1�$�$��r�*�9�9�%�@�@�O��*��"�"�1�)=�o�)N�)N�&S�&S�&S�T�T�T��"�"��(��)B�C�C�D�-��(?�@�@�D�D�D�E���� � � �s� #� #� #��8�8�K�(�(� (��rrN�T) r4r5rr6rMr�rPr�r�r�r7rrr�r� s������������$�$�$�$�(�-�-��\�-�"3%�3%�3%�j@�@�@�@�@rr�c���eZdZdZd)d�Zd�Zed���Zed���Zej d���Zed���Z e j d ���Z ed ���Z e j d ���Z ed ���Z e j d ���Z e d*d���Ze d���Zd*d�Zd�Zd)d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�Z d"�Z!d#�Z"d$�Z#d%�Z$ d+d'�Z%d(�Z&d&S),r�ab A path to be drawn by the PDF renderer. A painted path is defined by a style and an arbitrary sequence of path elements, which include the primitive path elements (`Move`, `Line`, `BezierCurve`, ...) as well as arbitrarily nested `GraphicsContext` containing their own sequence of primitive path elements and `GraphicsContext`. rc��t��|_|j|_d|_|j|_t t ||����|_dS)NT)r��_root_graphics_context�_graphics_context�_closed�_close_contextr�r�� _starter_movers rrMzPaintedPath.__init__� sK��&5�&7�&7��#�!%�!<����� �"�4���!�%��1�+�+�.�.����rc���|j|jurtd|�d����|���}t j|j|��|_|j|_|j|_|j|_|S)Nzcannot copy path z while it is being modified)r�r�� RuntimeErrorrur�r�r�r��r0rOrPs rrQzPaintedPath.__deepcopy__� sz�� � !��)D� D� D��T�4�T�T�T�U�U� U����!�!��(,� �d�6Q�SW�(X�(X��%�#)�#@�� ����� &� 8���� rc��|jjS)z9The `GraphicsStyle` applied to all elements of this path.)r�r)rxs rr)zPaintedPath.style� s���*�0�0rc��|jjS)zAThe `Transform` that applies to all of the elements of this path.�r�r+rxs rr+zPaintedPath.transform� s���*�4�4rc��||j_dSrPr��r0�tfs rr+zPaintedPath.transform� s��02��#�-�-�-rc��|jjS)zDIf true, the path should automatically close itself before painting.�r)r1rxs rr1zPaintedPath.auto_close� ����z�$�$rc��||j_dSrPr�)r0�shoulds rr1zPaintedPath.auto_close� s�� &�� ���rc��|jjS)zCManually specify the `PathPaintRule` to use for rendering the path.�r)r/rxs rr/zPaintedPath.paint_rule� r�rc��||j_dSrPr�)r0r)s rr/zPaintedPath.paint_rule s�� %�� ���rc��|jjS)z$Set the clipping path for this path.�r�� clipping_pathrxs rr�zPaintedPath.clipping_path s���*�8�8rc��||j_dSrPr��r0� new_clipaths rr�zPaintedPath.clipping_path s��4?��#�1�1�1rTc#�K�|j}t��}||_ |V�|r|�|��||_dS#||_wxYwrP)r�r�r�)r0�_attach�old_graphics_context�new_graphics_contexts r�_new_graphics_contextz!PaintedPath._new_graphics_context su����#�5��.�0�0��!5��� :�&� &� &� &�� D�$�-�-�.B�C�C�C�%9�D� "� "� "��%9�D� "� 9� 9� 9� 9s �A� A c#�zK�|���5}||_|V�ddd��dS#1swxYwYdS)zY Apply the provided `Transform` to all points added within this context. N)r�r+)r0r+�ctxts r�transform_groupzPaintedPath.transform_group s����� � '� '� )� )� �T�&�D�N��J�J�J� � � � � � � � � � � � ���� � � � � � s � 0�4�4c���|j�;d|_|j�|jd���|j|_d|_|j�||���dS)a� Add the given element as a path item of this path. Args: item: the item to add to this path. _copy (bool): if true (the default), the item will be copied before being appended. This prevents modifications to a referenced object from "retroactively" altering its style/shape and should be disabled with caution. NF�r�)r�r�r�r�r�r�s r�add_path_elementzPaintedPath.add_path_element$ sh�� � � )� �D�L� � "� +� +�D�,>�e� +� L� L� L�"&�"8�D� �!%�D� � ��'�'��E�'�:�:�:�:�:rc�8�|j���dSrP)r��remove_last_itemrxs r�remove_last_path_elementz$PaintedPath.remove_last_path_element7 s�� ��/�/�1�1�1�1�1rc ��|���|�tt||��t||��t||����d���d|_|�||��|S)a� Append a rectangle as a closed subpath to the current path. If the width or the height are 0, the rectangle will be collapsed to a line (unless they're both 0, in which case it's collapsed to nothing). Args: x (Number): the abscissa of the starting corner of the rectangle. y (Number): the ordinate of the starting corner of the rectangle. w (Number): the width of the rectangle (if 0, the rectangle will be rendered as a vertical line). h (Number): the height of the rectangle (if 0, the rectangle will be rendered as a horizontal line). rx (Number): the x-radius of the rectangle rounded corner (if 0 the corners will not be rounded). ry (Number): the y-radius of the rectangle rounded corner (if 0 the corners will not be rounded). Returns: The path, to allow chaining method calls. Fr�T)�_insert_implicit_close_if_openr�r]r�r��move_to)r0r�r�rbrcrdres r� rectanglezPaintedPath.rectangle: s~��. �+�+�-�-�-� ��� �U�1�a�[�[�%��1�+�+�u�R��}�}� E� E�U� � � � ��� � � � �Q������ rc�2�|�||||��S)a[ Append a circle as a closed subpath to the current path. Args: cx (Number): the abscissa of the circle's center point. cy (Number): the ordinate of the circle's center point. r (Number): the radius of the circle. Returns: The path, to allow chaining method calls. )�ellipse)r0rtrurqs r�circlezPaintedPath.circleZ s���|�|�B��A�q�)�)�)rc ���|���|�tt||��t||����d���d|_|�||��|S)a� Append an ellipse as a closed subpath to the current path. Args: cx (Number): the abscissa of the ellipse's center point. cy (Number): the ordinate of the ellipse's center point. rx (Number): the x-radius of the ellipse. ry (Number): the y-radius of the ellipse. Returns: The path, to allow chaining method calls. Fr�T)r�r�rrr�r�r�)r0rtrurdres rr�zPaintedPath.ellipseh si�� �+�+�-�-�-� ���g�e�B��m�m�U�2�r�]�]�C�C�5��Q�Q�Q��� � � � �R������ rc�r�|���tt||����|_|S)a� Start a new subpath or move the path starting point. If no path elements have been added yet, this will change the path starting point. If path elements have been added, this will insert an implicit close in order to start a new subpath. Args: x (Number): abscissa of the (sub)path starting point. y (Number): ordinate of the (sub)path starting point. Returns: The path, to allow chaining method calls. )r�r�r�r�rs rr�zPaintedPath.move_to| s3�� �+�+�-�-�-�!�%��1�+�+�.�.���� rc���|���|j�4d|_|j�|jd���|j|_t t||����|_|S)a� Start a new subpath or move the path start point relative to the previous point. If no path elements have been added yet, this will change the path starting point. If path elements have been added, this will insert an implicit close in order to start a new subpath. This will overwrite an absolute move_to as long as no non-move path items have been appended. The relative position is resolved from the previous item when the path is being rendered, or from 0, 0 if it is the first item. Args: x (Number): abscissa of the (sub)path starting point relative to the. y (Number): ordinate of the (sub)path starting point relative to the. NFr�)r�r�r�r�r�r�r�r�rs r� move_relativezPaintedPath.move_relative� sm�� �+�+�-�-�-� � � )� �D�L� � "� +� +�D�,>�e� +� L� L� L�"&�"8�D� �)�%��1�+�+�6�6���� rc�j�|�tt||����d���|S)z� Append a straight line to this path. Args: x (Number): abscissa the line's end point. y (Number): ordinate of the line's end point. Returns: The path, to allow chaining method calls. Fr�)r�r�r�rs r�line_tozPaintedPath.line_to� s2�� ���d�5��A�;�;�/�/�u��=�=�=�� rc�j�|�tt||����d���|S)a� Append a straight line whose end is computed as an offset from the end of the previous path element. Args: x (Number): abscissa the line's end point relative to the end point of the previous path element. y (Number): ordinate of the line's end point relative to the end point of the previous path element. Returns: The path, to allow chaining method calls. Fr�)r�r�r�)r0�dx�dys r� line_relativezPaintedPath.line_relative� s2�� ���l�5��R�=�=�9�9���G�G�G�� rc�N�|�t|��d���|S)a. Append a straight horizontal line to the given abscissa. The ordinate is retrieved from the end point of the previous path element. Args: x (Number): abscissa of the line's end point. Returns: The path, to allow chaining method calls. Fr�)r�r�)r0r�s r�horizontal_line_tozPaintedPath.horizontal_line_to� s*�� ���n�Q�/�/�u��=�=�=�� rc�N�|�t|��d���|S)a� Append a straight horizontal line to the given offset from the previous path element. The ordinate is retrieved from the end point of the previous path element. Args: x (Number): abscissa of the line's end point relative to the end point of the previous path element. Returns: The path, to allow chaining method calls. Fr�)r�r�)r0r�s r�horizontal_line_relativez$PaintedPath.horizontal_line_relative� s+�� ���4�R�8�8���F�F�F�� rc�N�|�t|��d���|S)a, Append a straight vertical line to the given ordinate. The abscissa is retrieved from the end point of the previous path element. Args: y (Number): ordinate of the line's end point. Returns: The path, to allow chaining method calls. Fr�)r�r�)r0r�s r�vertical_line_tozPaintedPath.vertical_line_to� s(�� ���l�1�o�o�U��;�;�;�� rc�N�|�t|��d���|S)a� Append a straight vertical line to the given offset from the previous path element. The abscissa is retrieved from the end point of the previous path element. Args: y (Number): ordinate of the line's end point relative to the end point of the previous path element. Returns: The path, to allow chaining method calls. Fr�)r�r�)r0r�s r�vertical_line_relativez"PaintedPath.vertical_line_relative� s+�� ���2�2�6�6�e��D�D�D�� rc��t||��}t||��}t||��} |�t||| ��d���|S)u� Append a cubic Bézier curve to this path. Args: x1 (Number): abscissa of the first control point y1 (Number): ordinate of the first control point x2 (Number): abscissa of the second control point y2 (Number): ordinate of the second control point x3 (Number): abscissa of the end point y3 (Number): ordinate of the end point Returns: The path, to allow chaining method calls. Fr�)r�r�r�) r0�x1�y1�x2�y2�x3�y3r�r�r�s r�curve_tozPaintedPath.curve_tosU���b�"� � ���b�"� � ���B��m�m�� ���k�%���<�<�E��J�J�J�� rc��t||��}t||��}t||��} |�t||| ��d���|S)u� Append a cubic Bézier curve whose points are expressed relative to the end point of the previous path element. E.g. with a start point of (0, 0), given (1, 1), (2, 2), (3, 3), the output curve would have the points: (0, 0) c1 (1, 1) c2 (3, 3) e (6, 6) Args: dx1 (Number): abscissa of the first control point relative to the end point of the previous path element dy1 (Number): ordinate of the first control point relative to the end point of the previous path element dx2 (Number): abscissa offset of the second control point relative to the end point of the previous path element dy2 (Number): ordinate offset of the second control point relative to the end point of the previous path element dx3 (Number): abscissa offset of the end point relative to the end point of the previous path element dy3 (Number): ordinate offset of the end point relative to the end point of the previous path element Returns: The path, to allow chaining method calls. Fr�)r�r�r) r0�dx1�dy1�dx2�dy2�dx3�dy3�c1d�c2dr�s r�curve_relativezPaintedPath.curve_relativesV��6�C��o�o���C��o�o���C��o�o�� ���1�#�s�C�@�@���N�N�N�� rc��t||��}t||��}|�t||��d���|S)u� Append a cubic Bézier curve mimicking the specified quadratic Bézier curve. Args: x1 (Number): abscissa of the control point y1 (Number): ordinate of the control point x2 (Number): abscissa of the end point y2 (Number): ordinate of the end point Returns: The path, to allow chaining method calls. Fr�)r�r�r )r0r�r�r�r�r r�s r�quadratic_curve_tozPaintedPath.quadratic_curve_to:sG���R��}�}���B��m�m�� ���2�4��=�=�U��K�K�K�� rc��t||��}t||��}|�t||��d���|S)u� Append a cubic Bézier curve mimicking the specified quadratic Bézier curve. Args: dx1 (Number): abscissa of the control point relative to the end point of the previous path element dy1 (Number): ordinate of the control point relative to the end point of the previous path element dx2 (Number): abscissa offset of the end point relative to the end point of the previous path element dy2 (Number): ordinate offset of the end point relative to the end point of the previous path element Returns: The path, to allow chaining method calls. Fr�)r�r�r)r0r�r�r�r�r r�s r�quadratic_curve_relativez$PaintedPath.quadratic_curve_relativeLsG��"�S�#�����C��o�o�� ���:�4��E�E�U��S�S�S�� rc �r�|dks|dkr|�||��Stt|��t|����}t|��}t j|��}t|��}t||��} |�t||||| ��d���|S)u� Append an elliptical arc from the end of the previous path point to the specified end point. The arc is approximated using Bézier curves, so it is not perfectly accurate. However, the error is small enough to not be noticeable at any reasonable (and even most unreasonable) scales, with a worst-case deviation of around 3‱. Notes: - The signs of the radii arguments (`rx` and `ry`) are ignored (i.e. their absolute values are used instead). - If either radius is 0, then a straight line will be emitted instead of an arc. - If the radii are too small for the arc to reach from the current point to the specified end point (`x` and `y`), then they will be proportionally scaled up until they are big enough, which will always result in a half-ellipse arc (i.e. an 180 degree sweep) Args: rx (Number): radius in the x-direction. ry (Number): radius in the y-direction. rotation (Number): angle (in degrees) that the arc should be rotated clockwise from the principle axes. This parameter does not have a visual effect in the case that `rx == ry`. large_arc (bool): if True, the arc will cover a sweep angle of at least 180 degrees. Otherwise, the sweep angle will be at most 180 degrees. positive_sweep (bool): if True, the arc will be swept over a positive angle, i.e. clockwise. Otherwise, the arc will be swept over a negative angle. x (Number): abscissa of the arc's end point. y (Number): ordinate of the arc's end point. rFr�)r�r�rr\r�rr�r) r0rdrer� large_arc�positive_sweepr�r�rr�s r�arc_tozPaintedPath.arc_tobs���D ��7�7�b�A�g�g��<�<��1�%�%� %��c�"�g�g�s�2�w�w�'�'����O�O� ��<��)�)���n�-�-���A�q�k�k�� ��� ��x��N�C� @� @�� � � � �� rc �r�|dks|dkr|�||��Stt|��t|����}t|��}t j|��}t|��}t||��} |�t||||| ��d���|S)un Append an elliptical arc from the end of the previous path point to an offset point. The arc is approximated using Bézier curves, so it is not perfectly accurate. However, the error is small enough to not be noticeable at any reasonable (and even most unreasonable) scales, with a worst-case deviation of around 3‱. Notes: - The signs of the radii arguments (`rx` and `ry`) are ignored (i.e. their absolute values are used instead). - If either radius is 0, then a straight line will be emitted instead of an arc. - If the radii are too small for the arc to reach from the current point to the specified end point (`x` and `y`), then they will be proportionally scaled up until they are big enough, which will always result in a half-ellipse arc (i.e. an 180 degree sweep) Args: rx (Number): radius in the x-direction. ry (Number): radius in the y-direction. rotation (Number): angle (in degrees) that the arc should be rotated clockwise from the principle axes. This parameter does not have a visual effect in the case that `rx == ry`. large_arc (bool): if True, the arc will cover a sweep angle of at least 180 degrees. Otherwise, the sweep angle will be at most 180 degrees. positive_sweep (bool): if True, the arc will be swept over a positive angle, i.e. clockwise. Otherwise, the arc will be swept over a negative angle. dx (Number): abscissa of the arc's end point relative to the end point of the previous path element. dy (Number): ordinate of the arc's end point relative to the end point of the previous path element. rFr�)r�r�rr\r�rr�rR) r0rdrerr�r�r�r�rr�s r� arc_relativezPaintedPath.arc_relative�s���F ��7�7�b�A�g�g��%�%�b�"�-�-� -��c�"�g�g�s�2�w�w�'�'����O�O� ��<��)�)���n�-�-���B��m�m�� ��� ��x��N�C� H� H�PU� � � � �� rc��|�t��d���d|_|�dd��dS)z9 Explicitly close the current (sub)path. Fr�TrN)r�rar�r�rxs r�closezPaintedPath.close�sD�� ���e�g�g�U��3�3�3��� � ���1�a� � � � � rc��|js=|j�t��d���|j|_d|_dSdS)NFr�T)r�r�r�ryr�rxs rr�z*PaintedPath._insert_implicit_close_if_open�sL���|� � � � (� (����� (� F� F� F�"&�"8�D� ��D�L�L�L� � rNc�:�|���|j�||||||��\}}}t�||j�����}|�d|j��d� |��||fS)NrwrN) r�r��build_render_listr*rKr)r�r�r=r`) r0r�r)r+r�r�r�rmr/s rr�zPaintedPath.render�s��� �+�+�-�-�-� � '� 9� 9� �%��M�<�� � �  � � � � #�(�(��� �;�;�N�N�P�P� ����2�z�/�0�0�0��x�x� �$�$�i��>�>rc�6�|�||||||��S)a7 Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `PaintedPath.render`. r�rUs rr�zPaintedPath.render_debug�s'��,�{�{� �%��M�<�� � � r�rrr��NN)'r4r5rr6rMrQr�r)r+r�r1r/r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r7rrr�r�� s���������/�/�/�/� � � ��1�1��X�1��5�5��X�5���3�3���3��%�%��X�%���'�'���'��%�%��X�%���&�&���&��9�9��X�9���@�@���@�� :� :� :��^� :�����^��;�;�;�;�&2�2�2�����@ *� *� *����(���&���0 � � ����" � � ���� � � ���� ���, � � �D���$���,.�.�.�`/�/�/�b!�!�!� � � �UY�?�?�?�?�& � � � � rr�c�4��eZdZdZd�fd� Z dd�Zd�Z�xZS) � ClippingPatha3 The PaintedPath API but to be used to create clipping paths. .. warning:: Unless you really know what you're doing, changing attributes of the clipping path style is likely to produce unexpected results. This is because the clipping path styles override implicit style inheritance of the `PaintedPath` it applies to. For example, `clippath.style.stroke_width = 2` can unexpectedly override `paintpath.style.stroke_width = GraphicsStyle.INHERIT` and cause the painted path to be rendered with a stroke of 2 instead of what it would have normally inherited. Because a `ClippingPath` can be painted like a normal `PaintedPath`, it would be overly restrictive to remove the ability to style it, so instead this warning is here. rc�p��t���||���tj|_dS)Nr�)rnrMr r^r/)r0r�r�rus �rrMzClippingPath.__init__s.��� �����1���"�"�"�'�2����rNc ���|r|�d��|j�||||||d���\}}}t�||j��}|j} | |jur tj } nt| j } |� ��} |� | j ��|� | j ��d�|��||fS)Nz<ClippingPath> F�� _push_stackrN)r�r�rr*rKr)r2rDr r�r2r�rcr=r`) r0r�r)r+r�r�r�rm� merged_styler2r/s rr�zClippingPath.renders �� � 2� � � �0� 1� 1� 1� � '� 9� 9� � � � � � �� :� � �  � � � �%�*�*�5�$�*�=�=� �(�:�� � � 4� 4� 4� <� D� � � <�!�&�!� �"�4�4�6�6� ����,�2�3�3�3����:�+�,�,�,��x�x� �$�$�i��>�>rc�6�|�||||||��S)a� Render this path element to its PDF representation and produce debug information. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). Returns: The same tuple as `ClippingPath.render`. r�rUs rr�zClippingPath.render_debugKs'��*�{�{� �%��M�<�� � � rrr)r4r5rr6rMr�r�r�r�s@rrr�sr���������63�3�3�3�3�3� UY�*?�*?�*?�*?�X � � � � � � rrc���eZdZd�Zd�Zed���Zejd���Zed���Zejd���Zdd�Z d �Z d �Z e dd ���Z dd efd�Z dd efd�Zd S)r�c�V�t��|_g|_d|_d|_dSrP)r*r)� path_items� _transform�_clipping_pathrxs rrMzGraphicsContext.__init__fs)��"�_�_�� �������"����rc�&�|���}tj|j|��|_tj|j|��|_tj|j|��|_tj|j|��|_|SrP) rur�r�r)rr+rr�rr�s rrQzGraphicsContext.__deepcopy__msn�����!�!���}�T�Z��6�6�� � �M�$�/�4�@�@��� �M�$�.�$�?�?��� $� �d�.@�$� G� G���� rc��|jSrP�rrxs rr+zGraphicsContext.transformws ����rc��||_dSrPrr�s rr+zGraphicsContext.transform{s ������rc��|jS)z-The `ClippingPath` for this graphics context.�rrxs rr�zGraphicsContext.clipping_paths ���"�"rc��||_dSrPrr�s rr�zGraphicsContext.clipping_path�s��)����rTc�f�|rtj|��}|j�|��dS)a� Add a path element to this graphics context. Args: item: the path element to add. May be a primitive element or another `GraphicsContext` or a `PaintedPath`. _copy (bool): if true (the default), the item will be copied before being appended. This prevents modifications to a referenced object from "retroactively" altering its style/shape and should be disabled with caution. N)r�r�rrcr�s rr�zGraphicsContext.add_item�s7�� � '��=��&�&�D� ����t�$�$�$�$�$rc��|jd=dS)Nrw)rrxs rr�z GraphicsContext.remove_last_item�s�� �O�B� � � rc�D�|j�|j��dS)z:Copy another `GraphicsContext`'s path items into this one.N)r�extend)r0� other_contexts rrKzGraphicsContext.merge�s!�� ����}�7�8�8�8�8�8rNc �6 �g}|j�r |� |�|jj���|j�||j��} |��|jr|�d|j�d���g} | jD]X} t| | ��} | | j ur=t|j| ��| j urd} nd} | � | �d| �| �����Y| ru|�d��| D]D}|�|dz��|�|��|�d ���E|�|d z��n|�d ��d| j h}|j}| j |jj kr%tj |j��}| j |_ | j}| j}||jks ||jkr0||jurtj |��}||_||_||f}nd}|�|��}|�%|� t#|���d ���|jj}|jj}||vr9|� |��������||vr9|� |��������|�B|� t#|d ��d t/|d���d�z��|�r|j�U|�|dz��|j�|| ||||dz��\}}}|r|� |��|jdd�D]R}|�|dz��|�|| ||||dz��\}}}|r|� |���S|�|dz��|jd�|| ||||dz��\}}}|r|� |��n||j�8|j�|| ||��\}}}|r|� |��|jD]5}|�|| ||��\}}}|r|� |���6|j�4|�d |j�|��d ��|r+|�d d��|� d��|||fS)a� Build a list composed of all all the individual elements rendered. This is used by `PaintedPath` and `ClippingPath` to reuse the `GraphicsContext` rendering process while still being able to inject some path specific items (e.g. the painting directive) before the render is collapsed into a single string. Args: gsd_registry (GraphicsStateDictRegistry): the owner's graphics state dictionary registry. style (GraphicsStyle): the current resolved graphics style last_item: the previous path element. initial_point: last position set by a "M" or "m" command debug_stream (io.TextIO): the stream to which the debug output should be written. This is not guaranteed to be seekable (e.g. it may be stdout or stderr). pfx (str): the current debug output prefix string (only needed if emitting more than one line). _push_stack (bool): if True, wrap the resulting render list in a push/pop graphics stack directive pair. Returns: `tuple[list[str], last_item]` where `last_item` is the past path element in this `GraphicsContext` Nr$r%z (inherited)r�z: z { r�ru}┐ r�rrNr r�rLr�rwrMr�r�)rr�rur4rKr)rrCrXrDrcr0r�r�r<r=r3rQr3r5r-�lower�upperrFr�r�r�r+r�)r0r�r)r+r�r�r�r rmr � styles_dbg�attrrT�inh�style_dbg_line� NO_EMIT_SET� emit_style� dash_pattern� dash_phase� emit_dashr�r3r5�rendered_cpathr)�__rr�s rrz!GraphicsContext.build_render_list�s���J� � �?�N (��'��"�"�d�n�&=�#?�@�@�@� �?�0�0��� �C�C�L��'��?�?� �&�&�'=�4�?�'=�'=�'=�>�>�>�� �(�9�A�A�D�!�,��5�5�C��,�"6�6�6�"�4�:�t�4�4� �8L�L�L�"0�C�C�"$�C�"�)�)�T�*?�*?�S�*?�#�*?�*?�@�@�@��� -� �&�&�v�.�.�.�*4�1�1��$�*�*�3��<�8�8�8�$�*�*�>�:�:�:�$�*�*�4�0�0�0�0� �&�&�s�X�~�6�6�6�6� �&�&�t�,�,�,���!5�6�K���J��.�$�*�2O�O�O�!�]�4�:�6�6� �0<�0O� �-� (�;�L�%�7�J��� 9�9�9��e�5�5�5����+�+�!%��z�!:�!:�J�1=� �.�/9� �,�)�:�6� � � � �*�9�9�*�E�E�O��*��"�"�&:�?�&K�&K�#P�#P�#P�Q�Q�Q���.�J��:�2�L���,�,��"�"�:�#7�#7�#9�#9�#?�#?�#A�#A�B�B�B��;�.�.��"�"�<�#9�#9�#;�#;�#A�#A�#C�#C�D�D�D��$��"�"�(��1��6�6�9�-� �!� �5�5�9�9�9�:���� �7 5��%�1� �&�&�s�Z�'7�8�8�8�,0�,>�,K�,K�$�$�!�%�$��h�� -�-�)�N�A�r�&�;�#�*�*�>�:�:�:� �O�C�R�C�0� 5� 5�D� �&�&�s�Z�'7�8�8�8�9=�9J�9J�$�$�!�%�$��h�� :�:�6�H�i�� �5�#�*�*�8�4�4�4���"�"�3��#3�4�4�4�59�_�R�5H�5U�5U� � ��!� ��&�L� 6�6�2��)�]��1��&�&�x�0�0�0���%�1�,0�,>�,E�,E�$�l�I�}�-�-�)�N�A�r�&�;�#�*�*�>�:�:�:� �O�5�5�D�9=���$�l�I�}�:�:�6�H�i�� �5�#�*�*�8�4�4�4���~�)��"�"�1�d�n�&;�&;�I�&F�&F�q�&I�J�J�J�� (��"�"�1�c�*�*�*��"�"�3�'�'�'��I�}�4�4rr)c �r�|�|||||||���\}}}d�|��||fS)Nr rN)rr`) r0r�r)r+r�r�r�r rms rr�zGraphicsContext.renderYsV��15�0F�0F� � � � � � �#�1G�1 �1 �-� �Y� ��x�x� �$�$�i��>�>rc �:�|�|||||||���S)Nr r�)r0r�r)r+r�r�r�r s rr�zGraphicsContext.render_debugos4���{�{� � � � � � �#�� � � rr�)NNT)r4r5rrMrQr�r+r�r�r�r�rKrrr�r�r�r7rrr�r�es_������#�#�#��������X����������#�#��X�#���*�*���*�%�%�%�%�" � � �9�9�9��� ��v5�v5�v5���v5�|� ��?�?��?�?�?�?�<� � �� � � � � � rr�)r8r9rP)rwrw)Ur6r�r�r��re� collectionsr�collections.abcr� contextlibr�typingrrr�enumsr r r r rrr�syntaxrr�utilrrrrr�rr�rr]r�� WHITESPACE� EOL_CHARS� DELIMITERS�compile�STR_ESC� STR_ESC_MAPr(r@rFrQrjr�r�r�r�r�r�r�r�r�r�r*r�r�r�r�r�r�r�r�r�r�r�r�rr rrrRrWr]rrryrar�r�rr�r7rr�<module>r=s ��������������������#�#�#�#�#�#� %�$�$�$�$�$�%�%�%�%�%�%�.�.�.�.�.�.�.�.�.�.��������������������������������� �� &����� ������ �s�E�7�?�*� +���E�7�?�+� ��Y�}� %� %� �0� �I�f� � � �9� �Y�|� $� $� �"� �"�*�(� )� )�� � � � � � � � � � � ������ ����.���� 3� 3� 3� 9�9�9�F,Y�,Y�,Y�,Y�,Y��J�� �v���f� ��V�}�s�H�V�<L�6M�N���,Y�,Y�,Y�^"'�� ��T����V����U����� ���:�:�:�:�:��J�� �v���h�v�.�/�0���:�:�:�>#(�� ��� ���� ���Y�Y�Y�Y�Y��J�� �&�M� �&�M� �&�M� �&�M� �(�6�"� #�  � � �Y�Y�Y�D#(�� ��V����B� ���Y����W����� ���9�9�9�9�4$�$�$�$�, 0� 0� 0� 0�E�E�E�E�0%R�%R�%R�PX�X�X�<TI�TI�TI�TI�TI�J�TI�TI�TI�n] �] �] �] �] � �] �] �] �@  ������������������������o�o�o�o�o�o�o�o�d ������A�A�A�@1�@1�@1�@1�@1�:�@1�@1�@1�F>1�>1�>1�>1�>1�:�>1�>1�>1�BA1�A1�A1�A1�A1�:�A1�A1�A1�H?1�?1�?1�?1�?1�:�?1�?1�?1�D;1�;1�;1�;1�;1�Z�;1�;1�;1�|?1�?1�?1�?1�?1�Z�?1�?1�?1�D;1�;1�;1�;1�;1�:�;1�;1�;1�|?1�?1�?1�?1�?1�:�?1�?1�?1�DE1�E1�E1�E1�E1�*�E1�E1�E1�PM1�M1�M1�M1�M1�*�M1�M1�M1�`Y1�Y1�Y1�Y1�Y1�:�Y1�Y1�Y1�xE1�E1�E1�E1�E1�:�E1�E1�E1�PX �X �X �X �X �*�X �X �X �vOY�OY�OY�OY�OY�*�OY�OY�OY�d=1�=1�=1�=1�=1� �=1�=1�=1�@AD�AD�AD�AD�AD�z�AD�AD�AD�HkG�kG�kG�kG�kG�j�kG�kG�kG�\:1�:1�:1�:1�:1�J�:1�:1�:1�z;1�;1�;1�;1�;1�J�;1�;1�;1�|g�g�g�g�g�g�g�g�Tx �x �x �x �x �x �x �x �vc �c �c �c �c �;�c �c �c �L\ �\ �\ �\ �\ �\ �\ �\ �\ �\ r
Memory