+
    ÂHàj~  ã                  óÚ   € R t ^ RIHt ^ RIt^ RIt^RIHt ^RIHt ]P                  ! R4      t
]P                  ! R4      t ! R R]P                  4      t ! R	 R
]P                  4      tR# )zC
OSC 8 hyperlink parsing and measurement.

.. versionadded:: 0.7.0
)ÚannotationsN)Úwidth)Ú_SEQUENCE_CLASSIFYz*\x1b]8;([^;]*);([^\x07\x1b]*)(\x07|\x1b\\)z\x1b]8;;(\x07|\x1b\\)c                  óp   € ] tR t^t$ RtR]R&   RtR]R&   RtR]R&   ]R R	 l4       t	R
 R lt
R R ltRtR# )ÚHyperlinkParamszÙ
Parsed parameters from an OSC 8 hyperlink open sequence.

:param url: The hyperlink URL.
:param params: Colon-separated metadata string (often empty).
:param terminator: Sequence terminator (``\x07`` or ``\x1b\\``).
ÚstrÚurlÚ ÚparamsÚÚ
terminatorc               ó    € V ^8„  d   QhRRRR/# )é   Úseqr   ÚreturnzHyperlinkParams | None© )Úformats   "Ú“/home/ubuntu/.hermes/installs/5f0a1ff4045d044e/environments/88679baa1dc64374a0cd943b62eeefb9/venv/lib/python3.14/site-packages/wcwidth/hyperlink.pyÚ__annotate__ÚHyperlinkParams.__annotate__$   s   € ÷ Mñ M˜ð MÐ 6ñ Mó    c                ó¨   € \         P                  V4      pVf   R# V ! VP                  ^4      VP                  ^4      VP                  ^4      R7      # )zõ
Parse an OSC 8 open sequence string.

Returns ``None`` if *seq* is not a valid OSC 8 open.

Example::

    >>> HyperlinkParams.parse('\x1b]8;;http://example.com\x07')
    HyperlinkParams(url='http://example.com', params='', terminator='\\x07')
N)r   r
   r   )ÚHYPERLINK_OPEN_REÚmatchÚgroup)Úclsr   Úms   && r   ÚparseÚHyperlinkParams.parse#   sC   € ô ×#Ñ# CÓ(ˆØŠ9ÙÙ�q—w‘w˜q“z¨!¯'©'°!«*ÀÇÁÈÃÔLÐLr   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   r   4   s   € ÷ Cñ C˜3ñ Cr   c                óR   € RV P                    RV P                   V P                   2# )z(Generate the OSC 8 open escape sequence.z]8;Ú;)r
   r   r   ©Úselfs   &r   Ú	make_openÚHyperlinkParams.make_open4   s&   € à˜Ÿ™˜ Q t§x¡x j°·±Ð0AÐBÐBr   c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   r   8   s   € ÷ ,ñ ,˜Cñ ,r   c                ó    € RV P                    2# )z)Generate the OSC 8 close escape sequence.z]8;;)r   r#   s   &r   Ú
make_closeÚHyperlinkParams.make_close8   s   € à˜$Ÿ/™/Ð*Ð+Ð+r   r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r
   r   Úclassmethodr   r%   r)   Ú__static_attributes__r   r   r   r   r      sF   ‡ ñð 
ƒHØ€FˆCÓØ€J�ÓàôMó ðMõ C÷,ñ ,r   r   c                  óˆ   € ] tR t^=t$ RtR]R&   R]R&   ]R R l4       tRR	R
^R^/R R llt]RR R ll4       t	R R lt
RtR# )Ú	Hyperlinkz§
A complete OSC 8 hyperlink with target and inner text.

:param params: Parsed open sequence parameters.
:param text: Inner text between the open and close sequences.
r   r
   r   Útextc               ó$   € V ^8„  d   QhRRRRRR/# )r   r5   r   Úopen_endÚintr   ztuple[int, int]r   )r   s   "r   r   ÚHyperlink.__annotate__I   s!   € ÷ $ñ $˜cð $¨Sð $°_ñ $r   c                óx   € \         P                  W4      pVf   R# VP                  4       VP                  4       3# )a±  
Find the matching OSC 8 close sequence.

Searches 'text' starting at 'open_end', the position just past the open
sequence.  Returns position of close sequence ``(close_start,
close_end)`` or ``(-1, -1)`` if not found.

Per the OSC 8 specification, terminal emulators treat hyperlinks as a
state attribute, not as nested HTML anchors.  A close sequence closes
the current hyperlink regardless of how many open sequences preceded it.
©éÿÿÿÿr<   )ÚHYPERLINK_CLOSE_REÚsearchÚstartÚend)r   r5   r7   r   s   &&& r   Ú
find_closeÚHyperlink.find_closeH   s5   € ô ×%Ñ% dÓ5ˆØŠ9ØˆOØ—‘“	˜1Ÿ5™5›7Ð#Ð#r   Úcontrol_codesr   ÚtabsizeÚambiguous_widthc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rC   z+typing.Literal['parse', 'strict', 'ignore']rD   r8   rE   r   r   )r   s   "r   r   r9   Z   s5   € ÷ 
ñ 
ð Cð
ð ð	
ð
 ð
ð 
ñ
r   c               ó4   € \        V P                  VVVR7      # )zù
Measure the display width of the hyperlink's inner text.

Delegates to :func:`wcwidth.width` with the given parameters.

Example::

    >>> hl = Hyperlink.parse('\x1b]8;;http://example.com\x07Hello\x1b]8;;\x07', 0)
    >>> hl.display_width()
    5
)rC   rD   rE   )Ú_widthr5   )r$   rC   rD   rE   s   &$$$r   Údisplay_widthÚHyperlink.display_widthZ   s!   € ô$ Ø�I‰IØ'ØØ+ô	
ð 	
r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r5   r   r?   r8   r   zHyperlink | Noner   )r   s   "r   r   r9   t   s'   € ÷ Bñ B˜ð B Sð BÐ1Añ Br   c                ó  € \         P                  ! W4      pVf   R# \        P                  VP	                  4       4      pVf   R# V P                  WP                  4       4      w  rVWV3R8X  d   R# V ! WAVP                  4       V R7      # )aÁ  
Parse a complete OSC 8 hyperlink unit from *text* at position *start*.

Locates the open sequence, finds the matching close, and returns a
``Hyperlink`` containing the parsed parameters and inner text.  Returns
``None`` if the text at *start* is not a complete OSC 8 hyperlink.

Example::

    >>> Hyperlink.parse('\x1b]8;;http://example.com\x07Hello\x1b]8;;\x07')
    Hyperlink(params=HyperlinkParams(url='http://example.com', ...), text='Hello')
N)r
   r5   r;   )r   r   r   r   r   rA   r@   )r   r5   r?   r   r
   Úclose_startÚ	close_ends   &&&    r   r   ÚHyperlink.parses   sw   € ô ×$Ò$ TÓ1ˆØŠ9ÙÜ ×&Ñ& q§w¡w£yÓ1ˆØŠ>ÙØ!$§¡°·e±e³gÓ!>ÑˆØÐ# xÔ/ÙÙ˜&¨A¯E©E«G°KÐ'@ÔAÐAr   c               ó   € V ^8„  d   QhRR/# r    r   )r   s   "r   r   r9   Œ   s   € ÷ Nñ N˜sñ Nr   c                ó–   € V P                   P                  4       V P                  ,           V P                   P                  4       ,           # )z5Rebuild the complete OSC 8 hyperlink escape sequence.)r
   r%   r5   r)   r#   s   &r   Úmake_sequenceÚHyperlink.make_sequenceŒ   s0   € à�{‰{×$Ñ$Ó&¨¯©Õ2°T·[±[×5KÑ5KÓ5MÕMÐMr   r   N)é    )r+   r,   r-   r.   r/   r0   r1   rA   rI   r   rR   r2   r   r   r   r4   r4   =   sm   ‡ ñð ÓØ
ƒIàô$ó ð$ð"
ð FMð
ð ð	
ð
  !÷
ð2 öBó ðB÷0Nñ Nr   r4   )r/   Ú
__future__r   ÚreÚtypingrH   r   Úescape_sequencesr   Úcompiler   r=   Ú
NamedTupler   r4   r   r   r   Ú<module>r[      sh   ðñõ #ó 
ã õ $Ý 0à—J’JÐLÓMÐ Ø—Z’ZÐ 8Ó9Ð ô$,�f×'Ñ'ô $,ôNQN�×!Ñ!ö QNr   