ó
    T=Œj¡  ã                  óü  • S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
Jr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SK J!r!  S SK"J#r#  S SK$J%r%  S SK&J'r'J(r(  S SK)J*r*J+r+J,r,J-r-  S SK.J/r/J0r0J1r1  \Rd                  " SS9r3\Rh                  " \55      r6SS jr7 " S S5      r8\ " S S5      5       r9      S S jr:        S!S jr;      S"S jr<S#S jr=g)$é    )ÚannotationsN)Ú	dataclass)ÚVersion)Úparse)ÚGroup)Úescape)ÚText)ÚLinkCollector)ÚPackageFinder)Úget_default_environment)ÚReleaseControl)ÚSelectionPreferences)Ú
PipSession)ÚWINDOWS)Úparse_iso_datetime)Ú get_best_invocation_for_this_pipÚ#get_best_invocation_for_this_python)Úadjacent_tmp_fileÚcheck_path_ownerÚcopy_directory_permissionsÚreplace)ÚExternallyManagedEnvironmentÚcheck_externally_managedÚ
ensure_diré   )Údaysc                ón   • U R                  5       n[        R                  " U5      R                  5       nU$ ©N)ÚencodeÚhashlibÚsha224Ú	hexdigest)ÚkeyÚ	key_bytesÚnames      Úe/Users/stevendouglas/BidBrain/.venv/lib/python3.13/site-packages/pip/_internal/self_outdated_check.pyÚ_get_statefile_namer'   /   s)   € Ø—
‘
“€IÜ�>Š>˜)Ó$×.Ñ.Ó0€DØ€Kó    c                  óF   • \ rS rSrSS jr\S	S j5       rS
S jrSS jrSr	g)ÚSelfCheckStateé5   c                ól  • 0 U l         S U l        U(       as  [        R                  R	                  US[        U R                  5      5      U l         [        U R                  SS9 n[        R                  " U5      U l         S S S 5        g g ! , (       d  f       g = f! [        [        [        4 a     g f = f)NÚ	selfcheckzutf-8)Úencoding)Ú_stateÚ_statefile_pathÚosÚpathÚjoinr'   r#   ÚopenÚjsonÚloadÚOSErrorÚ
ValueErrorÚKeyError)ÚselfÚ	cache_dirÚ	statefiles      r&   Ú__init__ÚSelfCheckState.__init__6   s•   € Ø&(ˆŒØ#ˆÔö Ü#%§7¡7§<¡<Ø˜;Ô(;¸D¿H¹HÓ(Eó$ˆDÔ ðÜ˜$×.Ñ.¸ÒAÀYÜ"&§)¢)¨IÓ"6�D”K÷ BÐAð ÷
 BÕAûäœZ¬Ð2ó ñ ðús0   ÁB Á$B
Â B Â

BÂB ÂB ÂB3Â2B3c                ó"   • [         R                  $ r   )ÚsysÚprefix)r:   s    r&   r#   ÚSelfCheckState.keyG   s   € ä�z‰zÐr(   c                óÖ   • U R                   (       d  gSU R                   ;  a  gSU R                   ;  a  g[        U R                   S   5      nX-
  nU[        :”  a  gU R                   S   $ )z7Check if we have a not-outdated version loaded already.NÚ
last_checkÚpypi_version)r/   r   Ú_WEEK)r:   Úcurrent_timerD   Útime_since_last_checks       r&   ÚgetÚSelfCheckState.getK   sb   € à�{�{Øà˜tŸ{™{Ó*Øà §¡Ó,Øô (¨¯©°LÑ(AÓBˆ
Ø ,Ñ 9ÐØ ¤5Ó(Øà�{‰{˜>Ñ*Ð*r(   c                ó.  • U R                   (       d  g [        R                  R                  U R                   5      n[	        U5      (       d  g [        U5        U R                  UR                  5       US.n[        R                  " USSS9n[        U R                   5       nUR                  UR                  5       5        [        X65        S S S 5         [        WR                  U R                   5        g ! , (       d  f       N0= f! [          a     g f = f)N)r#   rD   rE   T)Ú,Ú:)Ú	sort_keysÚ
separators)r0   r1   r2   Údirnamer   r   r#   Ú	isoformatr5   Údumpsr   Úwriter   r   r   r%   r7   )r:   rE   rG   Ústatefile_directoryÚstateÚtextÚfs          r&   ÚsetÚSelfCheckState.set^   sÝ   € à×#×#Øä Ÿg™gŸo™o¨d×.BÑ.BÓCÐô  Ð 3×4Ñ4Øô 	Ð&Ô'ð
 —8‘8Ø&×0Ñ0Ó2Ø(ñ
ˆô �zŠz˜%¨4¸JÑGˆä˜t×3Ñ3Ô4¸Ø�G‰G�D—K‘K“MÔ"Ü&Ð':Ô>÷ 5ð	ô �A—F‘F˜D×0Ñ0Õ1÷ 5Õ4ûô ó 	áð	ús   Â!+C6Ã D Ã6
DÄ
DÄD)r/   r0   N)r;   ÚstrÚreturnÚNone)r[   rZ   )rG   údatetime.datetimer[   ú
str | None)rE   rZ   rG   r]   r[   r\   )
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r=   Úpropertyr#   rI   rX   Ú__static_attributes__© r(   r&   r*   r*   5   s%   † ôð" óó ðô+÷&#r(   r*   c                  ó4   • \ rS rSr% S\S'   S\S'   SS jrSrg)	ÚUpgradePrompté„   rZ   ÚoldÚnewc                ó  • [         (       a  [        5        S3nO
[        5       nSn[        [	        5       [        R
                  " U SU R                   SU R                   S35      [        R
                  " U S[        U5       S35      5      $ )Nz -m pipz/[bold][[reset][blue]notice[reset][bold]][reset]z) A new release of pip is available: [red]z[reset] -> [green]z[reset]z To update, run: [green]z install --upgrade pip)	r   r   r   r   r	   Úfrom_markupri   rj   r   )r:   Úpip_cmdÚnotices      r&   Ú__rich__ÚUpgradePrompt.__rich__‰   s—   € ßŠ7Ü<Ó>Ð?¸wÐG‰Gä6Ó8ˆGàBˆÜÜ‹FÜ×ÒØ�(ð ØŸ™�zÐ!3°D·H±H°:¸WðFóô ×ÒØ�(ð Ü  ›/Ð*Ð*@ðBóó

ð 
	
r(   re   N)r[   r   )r_   r`   ra   rb   Ú__annotations__ro   rd   re   r(   r&   rg   rg   „   s   ‡ à	ƒHØ	ƒH÷
r(   rg   c                óä   • [         R                  " U USS9n[        S[        S1S9S9n[        R                  " UUS9nUR                  S5      R                  nUc  g [        UR                  5      $ )NT)ÚoptionsÚsuppress_no_indexFÚpip)Ú
only_final)Úallow_yankedÚrelease_control)Úlink_collectorÚselection_prefs)	r
   Úcreater   r   r   Úfind_best_candidateÚbest_candidaterZ   Úversion)Úsessionrs   ry   rz   Úfinderr}   s         r&   Ú_get_current_remote_pip_versionr�   �   s€   € ô #×)Ò)ØØØñ€Nô +ØÜ&°5°'Ñ:ñ€Oô
 ×!Ò!Ø%Ø'ñ€Fð ×/Ñ/°Ó6×EÑE€NØÑØäˆ~×%Ñ%Ó&Ð&r(   c                ó*  • [        U5      n[        R                  SU5        [        R                  SU 5        [        R                  SU5        U(       d  g X:  =(       a    U R                  UR                  :g  nU(       a  [	        [        U 5      US9$ g )NzRemote version of pip: %szLocal version of pip:  %szWas pip installed by pip? %s)ri   rj   )Úparse_versionÚloggerÚdebugÚbase_versionrg   rZ   )Úlocal_versionÚremote_version_strÚinstalled_by_pipÚremote_versionÚlocal_version_is_olders        r&   Ú_compute_upgrade_promptrŒ   ¹   s…   € ô #Ð#5Ó6€NÜ
‡L�LÐ,¨nÔ=Ü
‡L�LÐ,¨mÔ<Ü
‡L�LÐ/Ð1AÔBæØð 	Ñ&÷ 	FØ×&Ñ&¨.×*EÑ*EÑEð ö Ü¤ ]Ó!3Ð9KÑLÐLàr(   c                óä  • [        5       R                  S5      nU(       d  g [        5         [	        UR
                  S9n[        R                  R                  [        R                  R                  5      nUR                  U5      nUc5  [        X5      nUc  [        R                  S5        gUR                  XT5        [        UR                   UUR"                  S:H  S9$ ! [         a     gf = f)aV  Compute the pip upgrade prompt, if any, before the command runs.

Limit the frequency of checks to once per week. State is stored either in
the active virtualenv or in the user's USER_CACHE_DIR keyed off the prefix
of the pip script path.

Pair with :func:`pip_self_version_check_emit`, which displays the prompt
after the command body runs.
ru   N)r;   zNo remote pip version found)r‡   rˆ   r‰   )r   Úget_distributionr   r   r*   r;   ÚdatetimeÚnowÚtimezoneÚutcrI   r�   r„   r…   rX   rŒ   r~   Ú	installer)r   rs   Úinstalled_distrU   rG   rˆ   s         r&   Úpip_self_version_check_fetchr•   Î   sÚ   € ô -Ó.×?Ñ?ÀÓF€NÞØðÜ Ô"ô  W×%6Ñ%6Ñ7€EÜ×$Ñ$×(Ñ(¬×):Ñ):×)>Ñ)>Ó?€LØŸ™ <Ó0ÐØÑ!Ü<¸WÓNÐØÑ%Ü�L‰LÐ6Ô7ØØ�	‰	Ð$Ô3ä"Ø$×,Ñ,Ø-Ø'×1Ñ1°UÑ:ñð øô (ó Ùðús   £
C" Ã"
C/Ã.C/c                ó:   • U b  [         R                  SU SS0S9  gg)zIEmit the upgrade prompt captured by :func:`pip_self_version_check_fetch`.Nz%sÚrichT)Úextra)r„   Úwarning)Úupgrade_prompts    r&   Úpip_self_version_check_emitr›   ó   s#   € àÑ!Ü�‰�t˜^°F¸D°>ˆÒBð "r(   )r#   rZ   r[   rZ   )r   r   rs   úoptparse.Valuesr[   r^   )r‡   r   rˆ   rZ   r‰   Úboolr[   úUpgradePrompt | None)r   r   rs   rœ   r[   rž   )rš   rž   r[   r\   )>Ú
__future__r   r�   r    r5   ÚloggingÚoptparseÚos.pathr1   r@   Údataclassesr   Úpip._vendor.packaging.versionr   r   rƒ   Úpip._vendor.rich.consoler   Úpip._vendor.rich.markupr   Úpip._vendor.rich.textr	   Úpip._internal.index.collectorr
   Ú"pip._internal.index.package_finderr   Úpip._internal.metadatar   Ú$pip._internal.models.release_controlr   Ú$pip._internal.models.selection_prefsr   Úpip._internal.network.sessionr   Úpip._internal.utils.compatr   Úpip._internal.utils.datetimer   Úpip._internal.utils.entrypointsr   r   Úpip._internal.utils.filesystemr   r   r   r   Úpip._internal.utils.miscr   r   r   Ú	timedeltarF   Ú	getLoggerr_   r„   r'   r*   rg   r�   rŒ   r•   r›   re   r(   r&   Ú<module>rµ      s  ðÝ "ã Û Û Û Û Û Û 
Ý !å 1Ý @Ý *Ý *Ý &å 7Ý <Ý :Ý ?Ý EÝ 4Ý .Ý ;÷÷ó ÷ñ ð 	×Ò Ñ"€à	×	Ò	˜8Ó	$€ô÷Lñ Lð^ ÷
ð 
ó ð
ð0'Øð'Ø"1ð'àô'ð8ØðØ03ðØGKðàôð*"Øð"Ø"1ð"àô"õJCr(   