Ë
    *Rði w  ã                   ó~  — d dl Z d dlmZmZmZ d dlmZ d dlmZ d dl	m
Z
mZmZmZmZmZmZmZmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZmZmZ ddlmZ ddl m!Z! ddl m"Z# ddl m$Z$m%Z% ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3 ddl4m5Z5m6Z6 ddlm7Z7m8Z8m9Z9m:Z:m;Z; dZ< G d„ d«      Z= G d„ d«      Z> G d„ de>«      Z?y)é    N)ÚBytesIOÚFileIOÚIOBase)ÚPath)ÚTracebackType)	ÚAnyÚDictÚIterableÚListÚOptionalÚTupleÚTypeÚUnionÚcasté   )Ú
Encryption)Ú
PageObject)Ú	PdfReader)ÚStrByteTypeÚdeprecation_bookmarkÚdeprecation_with_replacementÚstr_)Ú	PdfWriter)ÚGoToActionArguments)ÚPagesAttributes)ÚTypArgumentsÚTypFitArguments)ÚPAGE_FITÚArrayObjectÚDestinationÚDictionaryObjectÚFitÚFloatObjectÚIndirectObjectÚ
NameObjectÚ
NullObjectÚNumberObjectÚOutlineItemÚTextStringObjectÚ
TreeObject)Ú	PageRangeÚPageRangeSpec)ÚFitTypeÚ
LayoutTypeÚOutlineTypeÚPagemodeTypeÚZoomArgTypez=close() was called and thus the writer cannot be used anymorec                   ó(   — e Zd ZdZdedededdfd„Zy)Ú_MergedPagez@Collect necessary information on each page that is being merged.ÚpagedataÚsrcÚidÚreturnNc                 ó<   — || _         || _        d | _        || _        y ©N)r5   r4   Úout_pagedatar6   )Úselfr4   r5   r6   s       úI/var/www/html/Extract/venv/lib/python3.12/site-packages/PyPDF2/_merger.pyÚ__init__z_MergedPage.__init__Q   s   € ØˆŒØ ˆŒØ ˆÔØˆ�ó    )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Úintr=   © r>   r<   r3   r3   N   s&   „ ÙJð ð °)ð Àð Èô r>   r3   c                   ó–  — e Zd ZdZ ed¬«      	 d>dedeeef   ddfd	„«       Z	d?d
„Z
deee      dee   dee   ddfd„Z edd¬«      	 	 	 	 	 	 d@dee   deeeef   dee   dee   dedee   ddfd„«       Zdeeeef   deeee   f   fd„Z edd¬«      	 	 	 dAdeeeef   dee   dedeeeef   eeeef   ee   f   deddf
d„«       Zdeeef   ddfd„ZdBd„Zdeeef   ddfd„Z deeef   ddfd„Z!de"ddfd„Z#de"ddfd„Z$d e%ddfd!„Z&d e%ddfd"„Z'd#ed$eeeeef   f   deeeef   eeeef   ee   f   deeeef      fd%„Z(d#ede)deeeef   eeeef   ee   f   de)fd&„Z*dBd'„Z+ ed¬«      	 	 dCdee,e-      d(ee.   ddfd)„«       Z/ ed¬*«      dee-e0f   d+e1ddfd,„«       Z2dee1   ddfd-„Z3 ed¬«      	 dDdee1   dee,e-      ddfd.„«       Z4 ed¬*«      	 dDdeeef   d/ee)   deee      fd0„«       Z5 ed¬*«      	 dDdeeef   d/ee)   deee      fd1„«       Z6ddddde7dfd2edee   d(ede.e8f   d3eee9e9e9f      d4ed5ed6e:d7ee   de8fd8„Z;	 	 	 	 	 dEd2ed7ed(ede.e8f   d3eee9e9e9f      d4ed5ed6e<d9e=de8fd:„Z>	 	 	 	 	 dEd2ed7ed(ede.e8f   d3eee9e9e9f      d4ed5ed6e<d9e=de8fd;„Z?d2ed7eddfd<„Z@	 	 dCd2edee   d7ee   ddfd=„ZAy)FÚ	PdfMergeraI  
    Initialize a ``PdfMerger`` object.

    ``PdfMerger`` merges multiple PDFs into a single PDF.
    It can concatenate, slice, insert, or any combination of the above.

    See the functions :meth:`merge()<merge>` (or :meth:`append()<append>`)
    and :meth:`write()<write>` for usage information.

    :param bool strict: Determines whether user should be warned of all
            problems and also causes some correctable problems to be fatal.
            Defaults to ``False``.
    :param fileobj: Output file. Can be a filename or any kind of
            file-like object.
    Úoutline)Ú	bookmarksFÚstrictÚfileobjr7   Nc                 ó„   — g | _         g | _        t        «       | _        g | _        g | _        d| _        || _        || _        y )Nr   )	ÚinputsÚpagesr   ÚoutputrG   Únamed_destsÚid_countrJ   rI   )r;   rI   rJ   s      r<   r=   zPdfMerger.__init__i   s?   € ð 46ˆŒØ "ˆŒ
Ü+4«;ˆŒØ$&ˆŒØ&(ˆÔØˆŒØˆŒØˆ�r>   c                 ó   — | S r9   rD   )r;   s    r<   Ú	__enter__zPdfMerger.__enter__v   s   € àˆr>   Úexc_typeÚexcÚ	tracebackc                 ór   — | j                   r| j                  | j                   «       | j                  «        y)z*Write to the fileobj and close the merger.N)rJ   ÚwriteÚclose)r;   rS   rT   rU   s       r<   Ú__exit__zPdfMerger.__exit__z   s$   € ð �<Š<Ø�J‰J�t—|‘|Ô$Ø�
‰
�r>   Úoutline_itemÚimport_outline)ÚbookmarkÚimport_bookmarksÚpage_numberrM   Úpositionc                 óÚ  — |�4|€'|}d}d}t        j                  |› d|› d�t        «       nt        d«      ‚|€t        d«      ‚|€t        d«      ‚| j	                  |«      \  }	}
t        |	| j                  ¬	«      }| j                  j                  |	|f«       |
�|
|_	        |€d
t        |j                  «      f}nat        |t        «      r%|j                  t        |j                  «      «      }n,t        |t        «      rnt        |t         «      st#        d«      ‚g }g }|r|j$                  }| j'                  |||«      }|rSt)        t+        |«      t-        | j.                  «      t1        j2                  «       «      }| xj$                  ||gz  c_        n| xj$                  |z  c_        |j4                  }| j7                  |||«      }| xj8                  |z  c_        t;        |Ž D ]P  }|j                  |   }| j.                  }| xj.                  dz  c_        t=        |||«      }|j                  |«       ŒR | j?                  |«       | jA                  |«       || j                  || y)a¾  
        Merge the pages from the given file into the output file at the
        specified page number.

        :param int page_number: The *page number* to insert this file. File will
            be inserted after the given number.

        :param fileobj: A File Object or an object that supports the standard
            read and seek methods similar to a File Object. Could also be a
            string representing a path to a PDF file.

        :param str outline_item: Optionally, you may specify an outline item
            (previously referred to as a 'bookmark') to be applied at the
            beginning of the included file by supplying the text of the outline item.

        :param pages: can be a :class:`PageRange<PyPDF2.pagerange.PageRange>`
            or a ``(start, stop[, step])`` tuple
            to merge only the specified range of pages from the source
            document into the output document.
            Can also be a list of pages to merge.

        :param bool import_outline: You may prevent the source document's
            outline (collection of outline items, previously referred to as
            'bookmarks') from being imported by specifying this as ``False``.
        Nr_   r^   zG is deprecated as an argument and will be removed in PyPDF2=4.0.0. Use ú insteadzCThe argument position of merge is deprecated. Use page_number only.úpage_number may not be Nonezfileobj may not be None)rI   r   z0"pages" must be a tuple of (start, stop[, step])r   )!ÚwarningsÚwarnÚDeprecationWarningÚ
ValueErrorÚ_create_streamr   rI   rL   ÚappendÚ_encryptionÚlenrM   Ú
isinstancer+   ÚindicesÚlistÚtupleÚ	TypeErrorrG   Ú_trim_outliner(   r)   r'   rP   r"   ÚfitÚnamed_destinationsÚ_trim_destsrO   Úranger3   Ú_associate_dests_to_pagesÚ!_associate_outline_items_to_pages)r;   r^   rJ   rZ   rM   r[   r_   Úold_termÚnew_termÚstreamÚencryption_objÚreaderÚsrcpagesrG   Úoutline_item_typÚdestsÚtrimmed_destsÚiÚpager6   Úmps                        r<   ÚmergezPdfMerger.merge…   sY  € ðF ÐØÐ"Ø&�Ø%�Ø(�Ü—‘à#˜*ð %8Ø8@°zÀðKô 'õô !ØYóð ð Ðô Ð:Ó;Ð;Øˆ?ô Ð6Ó7Ð7à!%×!4Ñ!4°WÓ!=Ñˆ�ô ˜6¨$¯+©+Ô6ˆØ�‰×Ñ˜F FÐ+Ô,ØÐ%Ø!/ˆFÔð ˆ=Øœ˜FŸL™LÓ)Ð*‰EÜ˜œyÔ)Ø—M‘M¤# f§l¡lÓ"3Ó4‰EÜ˜œtÔ$ØÜ˜E¤5Ô)ÜÐNÓOÐOàˆàˆÙØ—n‘nˆGØ×(Ñ(¨°¸%Ó@ˆGáÜ*Ü  Ó.Ü˜TŸ]™]Ó+Ü—‘“	ó Ðð
 �LŠLÐ-¨wÐ7Ñ7ŽLà�LŠL˜GÑ#�Là×)Ñ)ˆØ×(Ñ(¨°¸Ó>ˆØ×Ò˜MÑ)Õô ˜�ò 	 ˆAØ—<‘< ‘?ˆDà—‘ˆBØ�MŠM˜QÑ�Mä˜T 6¨2Ó.ˆBà�O‰O˜BÕð	 ð 	×&Ñ& xÔ0Ø×.Ñ.¨xÔ8ð /7ˆ�
‰
�;˜{Ñ+r>   c                 ó6  — d }t        |t        t        f«      rt        |d«      }||fS t        |t        «      r�|j
                  r|j
                  }|j                  j                  «       }|j                  j                  d«       t        |j                  j                  «       «      }|j                  j                  |«       ||fS t        |d«      r<t        |d«      r0|j                  d«       |j                  «       }t        |«      }||fS t        d«      ‚)NÚrbr   ÚseekÚreadzÝPdfMerger.merge requires an object that PdfReader can parse. Typically, that is a Path or a string representing a Path, a file object, or an object implementing .seek and .read. Passing a PdfReader directly works as well.)rk   Ústrr   r   r   ri   ry   Útellr†   r   r‡   ÚhasattrÚNotImplementedError)r;   rJ   rz   ry   Ú	orig_tellÚfilecontents         r<   rg   zPdfMerger._create_streamû   s  € ð ˆä�g¤¤T˜{Ô+Ü˜G TÓ*ˆFð* �~Ð%Ð%ô) ˜¤Ô+Ø×"Ò"Ø!(×!4Ñ!4�ØŸ™×+Ñ+Ó-ˆIØ�N‰N×Ñ Ô"Ü˜WŸ^™^×0Ñ0Ó2Ó3ˆFð �N‰N×Ñ 	Ô*ð �~Ð%Ð%ô �W˜fÔ%¬'°'¸6Ô*BØ�L‰L˜ŒOØ!Ÿ,™,›.ˆKÜ˜[Ó)ˆFð �~Ð%Ð%ô &ð>óð r>   c                 óT   — | j                  t        | j                  «      ||||«       y)a‡  
        Identical to the :meth:`merge()<merge>` method, but assumes you want to
        concatenate all pages onto the end of the file instead of specifying a
        position.

        :param fileobj: A File Object or an object that supports the standard
            read and seek methods similar to a File Object. Could also be a
            string representing a path to a PDF file.

        :param str outline_item: Optionally, you may specify an outline item
            (previously referred to as a 'bookmark') to be applied at the
            beginning of the included file by supplying the text of the outline item.

        :param pages: can be a :class:`PageRange<PyPDF2.pagerange.PageRange>`
            or a ``(start, stop[, step])`` tuple
            to merge only the specified range of pages from the source
            document into the output document.
            Can also be a list of pages to append.

        :param bool import_outline: You may prevent the source document's
            outline (collection of outline items, previously referred to as
            'bookmarks') from being imported by specifying this as ``False``.
        N)rƒ   rj   rM   )r;   rJ   rZ   rM   r[   s        r<   rh   zPdfMerger.append  s!   € ðB 	�
‰
”3�t—z‘z“? G¨\¸5À.ÕQr>   c                 óJ  — | j                   €t        t        «      ‚| j                  D ]¨  }| j                   j	                  |j
                  «       t        t        t        t        f   | j                   j                  j                  «       «      }| j                   j                  |t        j                     d   j                  «       «      |_        Œª | j!                  «        | j#                  «        | j                   j%                  |«      \  }}|r|j'                  «        yy)z´
        Write all data that has been merged to the given output file.

        :param fileobj: Output file. Can be a filename or any kind of
            file-like object.
        Néÿÿÿÿ)rN   ÚRuntimeErrorÚERR_CLOSED_WRITERrM   Úadd_pager4   r   r	   rˆ   r   Ú_pagesÚ
get_objectÚget_referenceÚPAÚKIDSr:   Ú_write_destsÚ_write_outlinerW   rX   )r;   rJ   r�   Ú	pages_objÚmy_fileÚret_fileobjs         r<   rW   zPdfMerger.writeA  sæ   € ð �;‰;ÐÜÔ0Ó1Ð1ð
 —J‘Jò 	ˆDØ�K‰K× Ñ  §¡Ô/ÜœT¤#¤s (™^¨T¯[©[×-?Ñ-?×-JÑ-JÓ-LÓMˆIØ $§¡× 9Ñ 9Øœ"Ÿ'™'Ñ" 2Ñ&×1Ñ1Ó3ó!ˆDÕð	ð 	×ÑÔØ×ÑÔð  $Ÿ{™{×0Ñ0°Ó9Ñˆ�áØ×ÑÕð r>   c                 óv   — g | _         | j                  D ]  \  }}|j                  «        Œ g | _        d| _        y)zHShut all file descriptors (input and output) and clear all memory usage.N)rM   rL   rX   rN   )r;   ÚfoÚ_readers      r<   rX   zPdfMerger.closea  s9   € àˆŒ
ØŸ;™;ò 	‰KˆB�Ø�H‰H�Jð	ð ˆŒØˆ�r>   Úinfosc                 óp   — | j                   €t        t        «      ‚| j                   j                  |«       y)zá
        Add custom metadata to the output.

        :param dict infos: a Python dictionary where each key is a field
            and each value is your new metadata.
            Example: ``{u'/Title': u'My title'}``
        N)rN   r‘   r’   Úadd_metadata©r;   r¡   s     r<   r£   zPdfMerger.add_metadataj  s,   € ð �;‰;ÐÜÔ0Ó1Ð1Ø�‰× Ñ  Õ'r>   c                 ó>   — t        dd«       | j                  |«       y)zW
        .. deprecated:: 1.28.0

            Use :meth:`add_metadata` instead.
        ÚaddMetadatar£   N)r   r£   r¤   s     r<   r¦   zPdfMerger.addMetadatav  s   € ô 	% ]°NÔCØ×Ñ˜%Õ r>   Úlayoutc                 ó>   — t        dd«       | j                  |«       y)zZ
        .. deprecated:: 1.28.0

            Use :meth:`set_page_layout` instead.
        ÚsetPageLayoutÚset_page_layoutN)r   rª   ©r;   r§   s     r<   r©   zPdfMerger.setPageLayout  s   € ô 	% _Ð6GÔHØ×Ñ˜VÕ$r>   c                 óp   — | j                   €t        t        «      ‚| j                   j                  |«       y)a  
        Set the page layout.

        :param str layout: The page layout to be used

        .. list-table:: Valid ``layout`` arguments
           :widths: 50 200

           * - /NoLayout
             - Layout explicitly not specified
           * - /SinglePage
             - Show one page at a time
           * - /OneColumn
             - Show one column at a time
           * - /TwoColumnLeft
             - Show pages in two columns, odd-numbered pages on the left
           * - /TwoColumnRight
             - Show pages in two columns, odd-numbered pages on the right
           * - /TwoPageLeft
             - Show two pages at a time, odd-numbered pages on the left
           * - /TwoPageRight
             - Show two pages at a time, odd-numbered pages on the right
        N)rN   r‘   r’   Ú_set_page_layoutr«   s     r<   rª   zPdfMerger.set_page_layoutˆ  s,   € ð0 �;‰;ÐÜÔ0Ó1Ð1Ø�‰×$Ñ$ VÕ,r>   Úmodec                 ó@   — t        ddd«       | j                  |«       y)zX
        .. deprecated:: 1.28.0

            Use :meth:`set_page_mode` instead.
        ÚsetPageModeÚset_page_modeú3.0.0N)r   r±   ©r;   r®   s     r<   r°   zPdfMerger.setPageMode¤  s   € ô 	% ]°OÀWÔMØ×Ñ˜4Õ r>   c                 óp   — | j                   €t        t        «      ‚| j                   j                  |«       y)aP  
        Set the page mode.

        :param str mode: The page mode to use.

        .. list-table:: Valid ``mode`` arguments
           :widths: 50 200

           * - /UseNone
             - Do not show outline or thumbnails panels
           * - /UseOutlines
             - Show outline (aka bookmarks) panel
           * - /UseThumbs
             - Show page thumbnails panel
           * - /FullScreen
             - Fullscreen view
           * - /UseOC
             - Show Optional Content Group (OCG) panel
           * - /UseAttachments
             - Show attachments panel
        N)rN   r‘   r’   r±   r³   s     r<   r±   zPdfMerger.set_page_mode­  s,   € ð, �;‰;ÐÜÔ0Ó1Ð1Ø�‰×!Ñ! $Õ'r>   Úpdfr~   c                 óŒ  — g }t        |t        «      r|nt        t        |Ž «      }|j                  «       D ]‹  \  }}|D ]�  }|j                  |   j                  «       |d   j                  «       k(  sŒ5|d   j                  «       |t        d«      <   t        |«      t        |d   «      k(  sJ ‚|j                  |«        Œ‹ Œ� |S )zHRemove named destinations that are not a part of the specified page set.ú/Pageú/Title)	rk   rm   rt   ÚitemsrM   r•   r%   r   rh   )	r;   rµ   r~   rM   Ú	new_destsÚlstÚkeyÚobjÚjs	            r<   rs   zPdfMerger._trim_destsÇ  sÀ   € ð ˆ	Ü! %¬Ô.‰e´D¼À¸Ó4GˆØŸ™›ò 	‰HˆC�Øò �Ø—9‘9˜Q‘<×*Ñ*Ó,°°G±×0GÑ0GÓ0IÓIØ/2°7©|×/FÑ/FÓ/H�Cœ
 7Ó+Ñ,Ü ›9¬¨S°©]Ó(;Ò;Ð;Ð;Ø×$Ñ$ SÔ)Ùñð	ð Ðr>   c                 ó  — g }d}t        |t        «      r|nt        t        |Ž «      }t        |«      D ]Ê  \  }}t        |t        «      rA| j	                  |||«      }	|	sŒ,|s|j                  ||dz
     «       |j                  |	«       ŒWd}|D ]m  }
|d   €Œ	|j                  |
   j                  «       |d   j                  «       k(  sŒ;|d   j                  «       |t        d«      <   |j                  |«       d} ŒÊ ŒÌ |S )zJRemove outline item entries that are not a part of the specified page set.Tr   Fr·   )	rk   rm   rt   Ú	enumeraterp   rh   rM   r•   r%   )r;   rµ   rG   rM   Únew_outlineÚprev_header_addedr»   r€   rZ   Úsubr¾   s              r<   rp   zPdfMerger._trim_outlineÙ  s  € ð ˆØ ÐÜ! %¬Ô.‰e´D¼À¸Ó4GˆÜ(¨Ó1ò 	‰OˆAˆ|Ü˜,¬Ô-Ø×(Ñ(¨¨l¸CÓ@�ÚÙ,Ø#×*Ñ*¨7°1°q±5©>Ô:Ø×&Ñ& sÕ+à$)Ð!Øò 	�AØ# GÑ,Ð4Ø Ø—y‘y ‘|×.Ñ.Ó0°LÀÑ4I×4TÑ4TÓ4VÓVØ<HØ#ñ=ç$™*›,ð %¤Z°Ó%8Ñ9ð $×*Ñ*¨<Ô8Ø,0Ð)Ùñ	ð	ð& Ðr>   c                 ó6  — | j                   €t        t        «      ‚| j                  D ]o  }d }d|v rIt	        | j
                  «      D ]1  \  }}|j                  |d   k(  sŒ|j                  |t        d«      <    n |€ŒU| j                   j                  |«       Œq y )Nr·   )
rN   r‘   r’   rO   rÀ   rM   r6   r:   r%   Úadd_named_destination_object)r;   Ú
named_destÚpagenor�   s       r<   r™   zPdfMerger._write_destsø  s›   € Ø�;‰;ÐÜÔ0Ó1Ð1Ø×*Ñ*ò 		EˆJØˆFØ˜*Ñ$Ü$-¨d¯j©jÓ$9ò ‘L�F˜DØ—w‘w *¨WÑ"5Ó5Ø:>×:KÑ:K˜
¤:¨gÓ#6Ñ7Ùðð
 Ñ!Ø—‘×8Ñ8¸ÕDñ		Er>   Úparentc                 óœ  — | j                   €t        t        «      ‚|€| j                  }|€J d«       ‚d }|D ]“  }t	        |t
        «      r| j                  ||«       Œ&d }d|v rCt        | j                  «      D ]+  \  }}|j                  |d   k(  sŒ| j                  ||«        n |€Œr|d= |d= | j                   j                  ||«      }Œ• y )Núhint for mypyr·   ú/Type)rN   r‘   r’   rG   rk   rm   rš   rÀ   rM   r6   Ú_write_outline_item_on_pageÚadd_outline_item_dict)r;   rG   rÈ   Ú
last_addedrZ   Úpage_nor�   s          r<   rš   zPdfMerger._write_outline  sæ   € ð �;‰;ÐÜÔ0Ó1Ð1Øˆ?Ø—l‘lˆGØÐ"Ð3 OÓ3Ð"àˆ
Ø#ò 	UˆLÜ˜,¬Ô-Ø×#Ñ# L°*Ô=ØàˆGØ˜,Ñ&Ü%.¨t¯z©zÓ%:ò ‘M�G˜TØ—w‘w ,¨wÑ"7Ó7Ø×8Ñ8¸ÀtÔLÙðð Ñ"Ø  Ð)¨<¸Ð+@Ø!Ÿ[™[×>Ñ>¸|ÈVÓT‘
ñ	Ur>   )r\   r�   c                 óô  — t        t        |d   «      }t        |j                  «      t	        |«      g}t
        j                  t        j                  ft
        j                  t        j                  ft
        j                  t        j                  ft
        j                  t        j                  ft
        j                  t        j                  t        j                  dft
        j                  t        j                  t        j                  t        j                   t        j                  fi}|j#                  |t%        «       «      D ]T  }||v r1t'        ||   t(        «      s|j+                  t-        ||   «      «       n|j+                  t-        d«      «       ||= ŒV t/        t	        t0        j2                  «      t	        d«      t	        t0        j4                  «      t7        |«      i«      |t	        d«      <   y )NrË   z/Zoomr   z/GoToz/A)r   rˆ   r'   r6   r%   r   ÚFIT_Hr   ÚTOPÚFIT_BHÚFIT_VÚLEFTÚFIT_BVÚXYZÚFIT_RÚBOTTOMÚRIGHTÚgetrn   rk   r&   rh   r#   r!   r   ÚSÚDr   )r;   rZ   r�   Úoi_typeÚargsÚfit2arg_keysÚarg_keys          r<   rÌ   z%PdfMerger._write_outline_item_on_page"  s„  € ô ”s˜L¨Ñ1Ó2ˆÜ˜TŸW™WÓ%¤z°'Ó':Ð;ˆä×!Ñ!¤L×$4Ñ$4Ð#6Ü×"Ñ"¤\×%5Ñ%5Ð$7Ü×!Ñ!¤L×$5Ñ$5Ð#7Ü×"Ñ"¤\×%6Ñ%6Ð$8Ü×Ñ¤,×"3Ñ"3´\×5EÑ5EÀwÐ!OÜ×!Ñ!Ü×!Ñ!Ü×#Ñ#Ü×"Ñ"Ü× Ñ ð	$ð4
ˆð $×'Ñ'¨´³Ó9ò 	&ˆGØ˜,Ñ&¬zØ˜WÑ%¤zô0ð —‘œK¨°WÑ(=Ó>Õ?à—‘œK¨›NÔ+Ø˜WÑ%ð	&ô *:äÔ.×0Ñ0Ó1´:¸gÓ3FÜÔ.×0Ñ0Ó1´;¸tÓ3Dðó*
ˆ”Z Ó%Ò&r>   c                 ó*  — | j                   D ]„  }d }|d   }t        |t        «      rŒ|D ]:  }|j                  «       |j                  j                  «       k(  sŒ/|j
                  }Œ< |€t        d|d   › d�«      ‚t        |«      |t        d«      <   Œ† y )Nr·   zUnresolved named destination 'r¸   ú')rO   rk   r'   r•   r4   r6   rf   r%   )r;   rM   rÆ   rÇ   Únpr�   s         r<   ru   z#PdfMerger._associate_dests_to_pagesE  s¤   € Ø×*Ñ*ò 	CˆJØˆFØ˜GÑ$ˆBä˜"œlÔ+Øàò %�Ø—=‘=“? d§m¡m×&>Ñ&>Ó&@Ó@Ø!ŸW™W‘Fð%ð ˆ~Ü Ø4°ZÀÑ5IÐ4JÈ!ÐLóð ô /;¸6Ó.BˆJ”z 'Ó*Ò+ñ	Cr>   c                 óh  — |€| j                   }|€J d«       ‚|D ]–  }t        |t        «      r| j                  ||«       Œ&d }|d   }t        |t        «      rŒ>|D ]:  }|j                  «       |j                  j                  «       k(  sŒ/|j                  }Œ< |€Œ€t	        |«      |t        d«      <   Œ˜ y )NrÊ   r·   )	rG   rk   rm   rv   r'   r•   r4   r6   r%   )r;   rM   rG   rZ   rÇ   Úoutline_item_pageÚps          r<   rv   z+PdfMerger._associate_outline_items_to_pagesW  sÁ   € ð ˆ?Ø—l‘lˆGØÐ"Ð3 OÓ3Ð"Ø#ò 	IˆLÜ˜,¬Ô-Ø×6Ñ6°u¸lÔKØàˆFØ ,¨WÑ 5ÐäÐ+¬\Ô:Øàò "�Ø$×/Ñ/Ó1°Q·Z±Z×5JÑ5JÓ5LÓLØŸT™T‘Fð"ð Ñ!Ü4@ÀÓ4H�œZ¨Ó0Ò1ñ!	Ir>   Úrootc                 óú   — |€| j                   }t        |«      D ]_  \  }}t        |t        «      r| j	                  ||«      }|sŒ+|g|z   c S ||k(  s$t        t        t        t        f   |d   «      |k(  sŒ\|gc S  y )Nr¸   )rG   rÀ   rk   rm   Úfind_outline_itemr   r	   r   )r;   rZ   rè   r€   Úoi_enumÚress         r<   rê   zPdfMerger.find_outline_itemp  sˆ   € ð ˆ<Ø—<‘<ˆDä# D›/ò 	‰JˆAˆwÜ˜'¤4Ô(ð ×,Ñ,¨\¸7ÓC�ÚØ˜3 ™9Ò$à˜<Ò'ÜœœS¤#˜X™¨°Ñ(9Ó:¸lÓJð �s’
ð	ð r>   c                 ó&   — | j                  ||«      S )zZ
        .. deprecated:: 2.9.0
            Use :meth:`find_outline_item` instead.
        )rê   )r;   rZ   rè   s      r<   Úfind_bookmarkzPdfMerger.find_bookmark‰  s   € ð ×%Ñ% l°DÓ9Ð9r>   ÚtitleÚcolorÚboldÚitalicrq   Úpagenumc	           
      óô   — |�|�t        d«      ‚|�&d}	d}
t        j                  |	› d|
› d�t        «       |}|€t        d«      ‚| j                  }|€t        t        «      ‚|j                  |||d||||«      S )al  
        Add an outline item (commonly referred to as a "Bookmark") to this PDF file.

        :param str title: Title to use for this outline item.
        :param int page_number: Page number this outline item will point to.
        :param parent: A reference to a parent outline item to create nested
            outline items.
        :param tuple color: Color of the outline item's font as a red, green, blue tuple
            from 0.0 to 1.0
        :param bool bold: Outline item font is bold
        :param bool italic: Outline item font is italic
        :param Fit fit: The fit of the destination page.
        NzMThe argument pagenum of add_outline_item is deprecated. Use page_number only.ró   r^   úH is deprecated as an argument and will be removed in PyPDF2==4.0.0. Use ra   rb   )rf   rc   rd   re   rN   r‘   r’   Úadd_outline_item)r;   rï   r^   rÈ   rð   rñ   rò   rq   ró   rw   rx   Úwriters               r<   rö   zPdfMerger.add_outline_item•  s·   € ð0 Ð" wÐ':ÜØ_óð ð ÐØ ˆHØ$ˆHÜ�M‰Mà�jð !5Ø5=°J¸hðHô #ôð "ˆKØÐÜÐ:Ó;Ð;Ø—‘ˆØˆ>ÜÔ0Ó1Ð1Ø×&Ñ&ØØØØØØØØó	
ð 		
r>   rß   c                 ó`   — t        ddd«       | j                  ||||||t        ||¬«      «      S )zZ
        .. deprecated:: 1.28.0
            Use :meth:`add_outline_item` instead.
        ÚaddBookmarkrö   r²   ©Úfit_typeÚfit_args©r   rö   r"   ©	r;   rï   ró   rÈ   rð   rñ   rò   rq   rß   s	            r<   rù   zPdfMerger.addBookmarkÌ  ó@   € ô 	% ]Ð4FÈÔPØ×$Ñ$ØØØØØØÜ˜ tÔ,ó
ð 	
r>   c                 ó`   — t        ddd«       | j                  ||||||t        ||¬«      «      S )zY
        .. deprecated:: 2.9.0
            Use :meth:`add_outline_item` instead.
        rù   rö   r²   rú   rý   rþ   s	            r<   Úadd_bookmarkzPdfMerger.add_bookmarkæ  rÿ   r>   c                 ó@   — t        ddd«       | j                  ||«      S )z_
        .. deprecated:: 1.28.0
            Use :meth:`add_named_destination` instead.
        ÚaddNamedDestinationÚadd_named_destinationr²   )r   r  )r;   rï   ró   s      r<   r  zPdfMerger.addNamedDestination   s)   € ô
 	%Ø!Ð#:¸Gô	
ð ×)Ñ)¨%°Ó9Ð9r>   c                 ó(  — |�|�t        d«      ‚|�&d}d}t        j                  |› d|› d�t        «       |}|€t        d«      ‚t	        t        |«      t        |«      t        j                  d¬	«      «      }| j                  j                  |«       y)
z¢
        Add a destination to the output.

        :param str title: Title to use
        :param int page_number: Page number this destination points at.
        NzRThe argument pagenum of add_named_destination is deprecated. Use page_number only.ró   r^   rõ   ra   rb   i:  )Útop)rf   rc   rd   re   r    r)   r'   r"   Úfit_horizontallyrO   rh   )r;   rï   r^   ró   rw   rx   Údests          r<   r  zPdfMerger.add_named_destination
  s°   € ð Ð" wÐ':ÜØdóð ð ÐØ ˆHØ$ˆHÜ�M‰Mà�jð !5Ø5=°J¸hðHô #ôð "ˆKØÐÜÐ:Ó;Ð;ÜÜ˜UÓ#Ü˜Ó%Ü× Ñ  SÔ)ó
ˆð
 	×Ñ×Ñ Õ%r>   )FÚ )r7   rF   )NNNNTN)NNT)r7   N)NNr9   )NNFFz/Fit)Br?   r@   rA   rB   r   Úboolr   r   r   r=   rR   r   r   ÚBaseExceptionr   rY   rC   r   rˆ   r,   rƒ   r   r   r   rg   r+   r   rh   rW   rX   r	   r   r£   r¦   r.   r©   rª   r0   r°   r±   rs   r/   rp   r™   r
   r(   r*   rš   r    r3   rÌ   ru   rv   rê   rî   r   r$   Úfloatr"   rö   r-   r1   rù   r  r  r  rD   r>   r<   rF   rF   X   sí  „ ññ   IÔ.àHJñ
Øð
Ø-2°4¸Ð3DÑ-Eð
à	ò
ó /ð
óð	à˜4 Ñ.Ñ/ð	ð �mÑ$ð	ð ˜MÑ*ð		ð
 
ó	ñ  >ÐDTÔUð &*Ø7;Ø&*Ø)-Ø#Ø"&ñs7à˜c‘]ðs7ð �t˜[¨)Ð3Ñ4ðs7ð ˜s‘mð	s7ð
 ˜Ñ&ðs7ð ðs7ð ˜3‘-ðs7ð 
òs7ó Vðs7ðj!&Ø˜T ;°	Ð9Ñ:ð!&à	ˆv�x 
Ñ+Ð+Ñ	,ó!&ñF  >ÐDTÔUð '+ð Ø#ñ Rà�{ I¨tÐ3Ñ4ð Rð ˜s‘mð Rð Ø�)˜U 3¨ 8™_¨e°C¸¸c°MÑ.BÀDÈÁIÐMñ
ð	 Rð ð Rð 
ò Ró Vð RðD ˜U 4¨Ð#4Ñ5ð  ¸$ó  ó@ð
( $ s¨C x¡.ð 
(°Tó 
(ð!  c¨3 h¡ð !°Dó !ð% Jð %°4ó %ð- jð -°Tó -ð8! ð !°ó !ð( ,ð (°4ó (ð4àðð �C˜˜c 3˜h™Ð'Ñ(ðð �U˜3 ˜8‘_ e¨C°°c¨MÑ&:¸DÀ¹IÐEÑFð	ð
 
ˆd�3˜�8‰nÑ	óð$àðð ðð �U˜3 ˜8‘_ e¨C°°c¨MÑ&:¸DÀ¹IÐEÑFð	ð
 
óó>Eñ  IÔ.ð 48Ø'+ñUà˜( ;Ñ/Ñ0ðUð ˜Ñ$ðUð 
ò	Uó /ðUñ6  >Ô2ð 
Ø! +¨{Ð":Ñ;ð 
ØCNð 
à	ò 
ó 3ð 
ðDC¨t°KÑ/@ð CÀTó Cñ$  IÔ.àSWñIØ˜+Ñ&ðIØ19¸(À;Ñ:OÑ1PðIà	òIó /ðIñ0  >Ô2ð '+ñà˜3 ˜8‘nðð �{Ñ#ðð 
�$�s‘)Ñ	ò	ó 3ðñ0  >Ô2ð '+ñ	:à˜3 ˜8‘nð	:ð �{Ñ#ð	:ð 
�$�s‘)Ñ	ò		:ó 3ð	:ð &*Ø:>Ø6:ØØØØ!%ñ5
àð5
ð ˜c‘]ð5
ð �d˜J¨Ð6Ñ7ð	5
ð
 ˜˜e U¨EÐ1Ñ2Ñ3ð5
ð ð5
ð ð5
ð ð5
ð ˜#‘ð5
ð 
ó5
ðv ;?Ø6:ØØØñ
àð
ð ð
ð �d˜J¨Ð6Ñ7ð	
ð
 ˜˜e U¨EÐ1Ñ2Ñ3ð
ð ð
ð ð
ð ð
ð ð
ð 
ó
ð< ;?Ø6:ØØØñ
àð
ð ð
ð �d˜J¨Ð6Ñ7ð	
ð
 ˜˜e U¨EÐ1Ñ2Ñ3ð
ð ð
ð ð
ð ð
ð ð
ð 
ó
ð4:¨ð :°sð :¸tó :ð &*Ø!%ñ	"&àð"&ð ˜c‘]ð"&ð ˜#‘ð	"&ð
 
ô"&r>   rF   c                   ó,   ‡ — e Zd Zdededdfˆ fd„Zˆ xZS )ÚPdfFileMergerrß   Úkwargsr7   Nc                 ól   •— t        ddd«       d|vrt        |«      dk  rd|d<   t        ‰| �  |i |¤Ž y )Nr  rF   r²   rI   r   T)r   rj   Úsuperr=   )r;   rß   r  Ú	__class__s      €r<   r=   zPdfFileMerger.__init__0  s=   ø€ Ü$ _°kÀ7ÔKà˜6Ñ!¤c¨$£i°!¢mØ#ˆF�8ÑÜ‰Ñ˜$Ð) &Ó)r>   )r?   r@   rA   r   r=   Ú__classcell__)r  s   @r<   r  r  /  s"   ø„ ð*˜cð *¨Sð *°T÷ *ñ *r>   r  )@rc   Úior   r   r   Úpathlibr   Útypesr   Útypingr   r	   r
   r   r   r   r   r   r   ri   r   Ú_pager   r    r   Ú_utilsr   r   r   r   Ú_writerr   Ú	constantsr   r   r—   r   r   Úgenericr   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   Ú	pageranger+   r,   r-   r.   r/   r0   r1   r’   r3   rF   r  rD   r>   r<   ú<module>r     s�   ðó8 ß &Ñ &Ý Ý ÷
÷ 
õ 
õ $Ý Ý ÷ó õ Ý *Ý ,ß 4÷÷ ÷ õ ÷ 0ß NÕ NàSÐ ÷ñ ÷T&ñ T&ôn*�Iõ *r>   