+
    8iV                       R t ^ RIHt ^ RIt^ RIt^ RIt^ RIHtHtH	t	H
t
HtHtHtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHtHtHtHt ^ RIHtHt ^ R	IHt ]'       d   ^ R
IH t  Rt!]"! ]!4      t#Rt$]"! ]$4      t%Rt&]'! . RNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NR;N4      t(R< R= lt)R> R? lt*R@ RA lt+]&3RB RC llt,0 R_mt-RD RE lt.RF RG lt/RH RI lt0RJ RK lt1R`RM RN llt2RaRP RQ llt3]&3RR RS llt4]Pj                  ! RT]Pl                  ! RU4      ,           RV,           4      t7]'! . RbO4      t8RW RX lt9RY RZ lt:]&RORLROR3R[ R\ llt;R] R^ lt<R# )czTools to parse and validate a MongoDB URI.

.. seealso:: This module is compatible with both the synchronous and asynchronous PyMongo APIs.
)annotationsN)TYPE_CHECKINGAnyMappingMutableMappingOptionalSizedUnioncast)unquote_plus)_have_dnspython)_parse_ssl_options)INTERNAL_URI_OPTION_NAME_MAPURI_OPTIONS_DEPRECATION_MAP_CaseInsensitiveDictionaryget_validated_options)ConfigurationError
InvalidURI)_Address)
SSLContextz
mongodb://zmongodb+srv://ii  appnameauthMechanismauthMechanismProperties
authSourcecompressorsconnectTimeoutMSdirectConnectionheartbeatFrequencyMSjournalloadBalancedlocalThresholdMSmaxIdleTimeMSmaxPoolSizemaxConnectingmaxStalenessSecondsminPoolSize	proxyHost	proxyPortproxyUsernameproxyPasswordreadConcernLevelreadPreferencereadPreferenceTags
replicaSet
retryReadsretryWritesserverMonitoringModeserverSelectionTimeoutMSserverSelectionTryOncesocketTimeoutMSsrvMaxHostssrvServiceNamessltlstlsAllowInvalidCertificatestlsAllowInvalidHostnames	tlsCAFiletlsCertificateKeyFiletlsCertificateKeyFilePassword$tlsDisableCertificateRevocationChecktlsDisableOCSPEndpointChecktlsInsecurewwaitQueueTimeoutMS
wTimeoutMSzlibCompressionLevelc                    V ^8  d   QhRRRR/# )   sstrreturnbool )formats   "W/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pymongo/uri_parser_shared.py__annotate__rM   m   s            c                    \        \        V 4      4       F0  pW,          R8X  g   K  WV^,            p\        V4      V8X  g   K/   R# 	  R# )zCheck for unescaped percent signs.

:param s: A string. `s` can have things like '%25', '%2525',
       and '%E2%85%A8' but cannot have unquoted percent like '%foo'.
%TF)rangelenr   )rF   isubs   &  rL   _unquoted_percentrU   m   sC     3q6]43;A,C C C'  rN   c                    V ^8  d   QhRRRR/# )rE   userinforG   rH   ztuple[str, str]rJ   )rK   s   "rL   rM   rM   }   s     4 4S 4_ 4rN   c                    RV 9   g(   V P                  R4      ^8  g   \        V 4      '       d   \        R4      hV P                  R4      w  rpV'       g   \        R4      h\	        V4      \	        V4      3# )aB  Validates the format of user information in a MongoDB URI.
Reserved characters that are gen-delimiters (":", "/", "?", "#", "[",
"]", "@") as per RFC 3986 must be escaped.

Returns a 2-tuple containing the unescaped username followed
by the unescaped password.

:param userinfo: A string of the form <username>:<password>
@:zXUsername and password must be escaped according to RFC 3986, use urllib.parse.quote_plusz&The empty string is not valid username)countrU   r   	partitionr   )rW   user_passwds   &   rL   parse_userinfor`   }   sr     h(..-15Fx5P5P4
 	

 ((-ODVABB|F333rN   c               $    V ^8  d   QhRRRRRR/# )rE   entityrG   default_portOptional[int]rH   z%tuple[str, Optional[Union[str, int]]]rJ   )rK   s   "rL   rM   rM      s$     ( ((,(*(rN   c                    V P                  R4      R8X  d   \        R4      hV P                  R4      pVR8X  d   V ^R V3# V ^V W^,           R 3# )a  Validates an IPv6 literal host:port string.

Returns a 2-tuple of IPv6 literal followed by port where
port is default_port if it wasn't specified in entity.

:param entity: A string that represents an IPv6 literal enclosed
                in braces (e.g. '[::1]' or '[::1]:27017').
:param default_port: The port number to use when one wasn't
                      specified in entity.
]zNan IPv6 address literal must be enclosed in '[' and ']' according to RFC 2732.z]:N)find
ValueError)rb   rc   rS   s   && rL   parse_ipv6_literal_hostrj      sf     {{32\
 	
 	DABwa|\))!A;1uw''rN   c               $    V ^8  d   QhRRRRRR/# )rE   rb   rG   rc   rd   rH   r   rJ   )rK   s   "rL   rM   rM      s!     0 0s 0- 08 0rN   c                   T pTpV ^ ,          R8X  d   \        W4      w  r#MeV P                  R4      '       d   W3# V P                  R4      R8w  d6   V P                  R4      ^8  d   \	        R4      hVP                  R^4      w  r#\        V\        4      '       d   VP                  4       '       gt   \        ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       d/   V F(  pVP                  4       '       g   K  \	        RV: 24      h	  \	        R	4      h\        V4      R
8  g   \        V4      ^ 8:  d   \	        R4      h\        V4      pVP                  4       V3# )aU  Validates a host string

Returns a 2-tuple of host followed by port where port is default_port
if it wasn't specified in the string.

:param entity: A host or host:port string where host could be a
                hostname or IP address.
:param default_port: The port number to use when one wasn't
                      specified in entity.
[.sockrZ   zReserved characters such as ':' must be escaped according RFC 2396. An IPv6 address literal must be enclosed in '[' and ']' according to RFC 2732.c              3  p   "   T F,  qP                  4       ;'       g    VP                  4       x  K.  	  R # 5iN)isspaceisdigit).0cs   & rL   	<genexpr>parse_host.<locals>.<genexpr>   s%     <t!99;--!))+-ts   66FTz$Port contains whitespace character: zPort contains non-digit characters. Hint: username and password must be escaped according to RFC 3986, use urllib.parse.quote_plusi  z+Port must be an integer between 0 and 65535rg   )rj   endswithrh   r[   ri   split
isinstancerG   rr   allrq   intlower)rb   rc   hostportrt   s   &&   rL   
parse_hostr      s>    D&2DayC,VB
d		!	!##	S	R	<<q 1  ZZQ'
$||~~s<t<sss<t<<<Ayy{{(+OPQu)UVV  8  t9uD	QJKK4y ::<rN   c               $    V ^8  d   QhRRRRRR/# )rE   optsrG   delimzOptional[str]rH   r   rJ   )rK   s   "rL   rM   rM      s"       ] 7Q rN   c                r   \        4       pV P                  V4       F  pVP                  R4      w  rEVP                  4       R8X  d$   VP                  V. 4      P	                  V4       KN  WB9   d   \
        P                  ! RV R2^R7       VP                  4       R8X  d   TpM\        V4      pWbV&   K  	  V# )zHelper method for split_options which creates the options dict.
Also handles the creation of a list for the URI tag_sets/
readpreferencetags portion, and the use of a unicode options string.
=readpreferencetagszDuplicate URI option 'z'.
stacklevelauthmechanismproperties)r   rx   r|   
setdefaultappendwarningswarnr   )r   r   optionsurioptkeyvaluevals   &&     rL   _parse_optionsr      s    
 )*G**U#\\#&
99;..sB'..u5~ 6se2>1Myy{77"5)CL $ NrN   c                    V ^8  d   QhRRRR/# rE   r   r   rH   rJ   )rK   s   "rL   rM   rM      s     2 2&@ 2E_ 2rN   c                   V P                  R4      pVeG   \         F<  pW 9   g   K  Rp\        W0P                  R4      V P                  V4      3,          4      h	  V P                  R4      pVe8   RV 9   d&   Rp\        VRV P                  R4      3,          4      hVRJ d   RV R&   V P                  R4      pVe3   R F,  pV P                  V4      RJ g   K  Rp\        W23,          4      h	  RV 9   dr   R	V 9   dk   R
 R lpV! V P                  R4      4      V! V P                  R	4      4      8w  d4   Rp\        W0P                  R4      V P                  R	4      3,          4      hV # )zRaise appropriate errors when conflicting TLS options are present in
the options dictionary.

:param options: Instance of _CaseInsensitiveDictionary containing
      MongoDB URI options.
tlsinsecurez9URI options %s and %s cannot be specified simultaneously.tlsallowinvalidcertificatestlsdisableocspendpointcheckT
tlscrlfilezDURI option %s=True cannot be specified when CRL checking is enabled.r6   r7   c                    V ^8  d   QhRRRR/# )rE   r   r   rH   rJ   )rK   s   "rL   rM   ._handle_security_options.<locals>.__annotate__$  s     	 	S 	S 	rN   c                N    V R9   d   V R 8H  # \        V \        4      '       d   V # V # )true)r   false)ry   rI   )r   s   &rL   truth_value-_handle_security_options.<locals>.truth_value$  s,    ''f}$#t$$
JrN   z=Can not specify conflicting values for URI options %s and %s.)r   r   r   )get_IMPLICIT_TLSINSECURE_OPTSr   	cased_key)r   r   opterr_msgtlsallowinvalidcertsr   r   s   &      rL   _handle_security_optionsr      sv    ++m,K-C~U 00?ARARSVAWXX  . #;;'DE'(G3QG0'2C2CDa2bcd   4'59G12 \*J`C{{34'` 6!122 a
 EW,	 w{{5)*k'++e:L.MMUGW(9(9%(@'BSBSTYBZ'[[\\NrN   c                    V ^8  d   QhRRRR/# r   rJ   )rK   s   "rL   rM   rM   2  s     $ $)C $Hb $rN   c                   \        V 4       F  pV\        9   g   K  \        V,          w  r#VR8X  d   TpW@9   dY   Rp\        P                  ! WPP	                  V4      V P	                  V4      3,          \
        ^R7       V P                  V4       K  Rp\        P                  ! WPP	                  V4      V3,          \
        ^R7       K  VR8X  g   K  Rp\        P                  ! WPP	                  V4      V3,          \
        ^R7       K  	  V # )a'  Issue appropriate warnings when deprecated options are present in the
options dictionary. Removes deprecated option key, value pairs if the
options dictionary is found to also have the renamed option.

:param options: Instance of _CaseInsensitiveDictionary containing
      MongoDB URI options.
renamedz0Deprecated option '%s' ignored in favor of '%s'.r   z,Option '%s' is deprecated, use '%s' instead.removedzOption '%s' is deprecated. %s.)listr   r   r   r   DeprecationWarningpop)r   optnamemodemessage
newoptnamewarn_msgs   &     rL   _handle_option_deprecationsr   2  s     =117@MDy $
(QHMM $5$5g$>@Q@QR\@]#^^*#$
 KK(I 1 1' :JGG& 
 "; 1 1' :GDD& - !8 NrN   c                    V ^8  d   QhRRRR/# r   rJ   )rK   s   "rL   rM   rM   Y  s       : ?Y rN   c                    V P                  R4      pVe   \         F  pWV&   K	  	  \        V 4       F3  p\        P                   ! VR4      pVf   K   V P	                  V4      W&   K5  	  V # )zNormalizes option names in the options dictionary by converting them to
their internally-used names.

:param options: Instance of _CaseInsensitiveDictionary containing
      MongoDB URI options.
r   N)r   r   r   r   r   )r   r   r   r   intnames   &    rL   _normalize_optionsr   Y  si     ++m,K-C&CL . =.227DA&{{73G !
 NrN   Fc               $    V ^8  d   QhRRRRRR/# )rE   r   Mapping[str, Any]r   rI   rH   MutableMapping[str, Any]rJ   )rK   s   "rL   rM   rM   o  s#     - -, -D -E] -rN   c                    \        W4      # )a  Validates and normalizes options passed in a MongoDB URI.

Returns a new dictionary of validated and normalized options. If warn is
False then errors will be thrown for invalid options, otherwise they will
be ignored and a warning will be issued.

:param opts: A dict of MongoDB URI options.
:param warn: If ``True`` then warnings will be logged and
      invalid options will be ignored. Otherwise invalid options will
      cause errors.
)r   )r   r   s   &&rL   validate_optionsr   o  s     !,,rN   Tc          
     ,    V ^8  d   QhRRRRRRRRRR/# )	rE   r   rG   validaterI   r   	normalizerH   r   rJ   )rK   s   "rL   rM   rM   ~  s4     * *
**,0*EI**rN   c                ,   V P                  R4      pV P                  R4      p V^ 8  d   V^ 8  d   \        R4      hV^ 8  d   \        V R4      pM=V^ 8  d   \        V R4      pM)V P                  R4      R
8w  d   \        V R4      pM\        h\	        V4      p\        V4      pV'       d   \        V4      pV'       d;   \        \        \        Wb4      4      pVP                  R4      R8X  d   \        R	4      hV#   \         d    \        R4      Rhi ; i)a  Takes the options portion of a MongoDB URI, validates each option
and returns the options in a dictionary.

:param opt: A string representing MongoDB URI options.
:param validate: If ``True`` (the default), validate and normalize all
      options.
:param warn: If ``False`` (the default), suppress all warnings raised
      during validation of options.
:param normalize: If ``True`` (the default), renames all options to their
      internally-used names.
&;z-Can not mix '&' and ';' for option separatorsr   Nz'MongoDB URI options are key=value pairs
authsource z1the authSource database cannot be an empty stringrg   )rh   r   r   ri   r   r   r   r
   r   r   r   )r   r   r   r   and_idxsemi_idxr   s   &&&&   rL   split_optionsr   ~  s    iinGyy~HNa<HMLMM\$T3/G]$T3/GYYs^r!$T40G 'w/G)'2G$W-13CG3RS;;|$*PQQN  NBCMNs   ,C; C; %"C; C; ;Dc               $    V ^8  d   QhRRRRRR/# )rE   hostsrG   rc   rd   rH   zlist[_Address]rJ   )rK   s   "rL   rM   rM     s!      s - > rN   c                    . pV P                  R4       FK  pV'       g   \        R4      hTpVP                  R4      '       d   RpVP                  \	        W44      4       KM  	  V# )a  Takes a string of the form host1[:port],host2[:port]... and
splits it into (host, port) tuples. If [:port] isn't present the
default_port is used.

Returns a set of 2-tuples containing the host name (or IP) followed by
port number.

:param hosts: A string of the form host1[:port],host2[:port],...
:param default_port: The port number to use when one wasn't specified
      for a host.
,z(Empty host (or extra comma in host list)rn   N)rx   r   rw   r   r   )r   rc   nodesrb   r~   s   &&   rL   split_hostsr     s\     E++c"$%OPP??7##DZ-. # LrN   rm   z/ "$rf   c               $    V ^8  d   QhRRRRRR/# )rE   r   r   r   r   rH   NonerJ   )rK   s   "rL   rM   rM     s'     Y Y% Y*; Y YrN   c                Z   \        V 4      ^8  d#   VP                  R4      '       d   \        R4      hVP                  R4      '       db   \        V 4      ^8  d   \        R4      hVP                  R4      '       d   \        R4      hVP                  R4      '       d   \        R4      hR# R# )	   directconnectionz8Cannot specify multiple hosts with directConnection=trueloadbalancedz4Cannot specify multiple hosts with loadBalanced=truez;Cannot specify directConnection=true with loadBalanced=true
replicasetz0Cannot specify replicaSet with loadBalanced=trueN)rR   r   r   )r   r   s   &&rL   _check_optionsr     s    
5zA~'++&899 ![\\{{>""u:>$%[\\;;)**$%bcc;;|$$$%WXX % #rN   c               $    V ^8  d   QhRRRRRR/# )rE   kms_tls_optionszOptional[Mapping[str, Any]]is_syncrI   rH   zdict[str, SSLContext]rJ   )rK   s   "rL   rM   rM     s&     ! !0!! !rN   c                   V '       g   / # \        V \        4      '       g   \        R4      h/ pV P                  4        F  w  r4\        V\        4      '       g   \        RV R24      hVP	                  RR4       \        V4      p\        V4      p\        V4      p\        \
        \        V4      4      p\        WQ4      w  rgVf   \        R4      hV'       d   \        R4      hR	 F  pW9   d   \        RV 24      hWbV&   K  	  K  	  V# )
z!Parse KMS TLS connection options.zkms_tls_options must be a dictzkms_tls_options["z"] must be a dictr7   Tz!TLS is required for KMS providerszInsecure TLS options prohibitedz!Insecure TLS options prohibited: )r?   r8   r9   r=   )ry   dict	TypeErroritemsr   r   r   r   r
   r   r   r   )	r   r   contextsproviderr   r   ssl_contextallow_invalid_hostnamesns	   &&       rL   _parse_kms_tls_optionsr     s   
 	ot,,899H,224'4((/z9JKLL5$')'2'-!$'.0@0FG/A$/P,$%HII"$%FGG
A y(+LQC)PQQ!,X
 5. OrN   c               4    V ^8  d   QhRRRRRRRRRRR	RR
R/# )rE   urirG   rc   rd   r   rI   r   r   srv_max_hostsrH   dict[str, Any]rJ   )rK   s   "rL   rM   rM     sW     ] ]	]] ] 	]
 ] !] ]rN   c                   V P                  \        4      '       d   R pV \        R pM}V P                  \        4      '       dI   \	        4       '       g-   \
        P                  ;'       g    Rp\        RV,          4      hRpV \        R pM\        R\         R\         R24      hV'       g   \        R4      hRp	Rp
RpRp\        4       pVP                  R	4      w  rpR
V9   d   VP                  R
4      w  prMTpV'       dU   \        V4      pRV9   d   VP                  R^4      w  r\        P                  V4      '       d   \        RV,          4      hMRpV'       d   VP!                  \#        VW#V4      4       RV9   d$   VP%                  R4      w  ppp\'        V4      w  rMTpR
V9   d   \        RV,          4      h\        V4      pRpT;'       g    VP)                  R4      pV'       d}   VP)                  R4      '       d   \        R\         R24      h\+        VRR7      p\-        V4      ^8w  d   \        \         R24      hV^ ,          w  ppVe   \        \         R24      hMNV'       g   VP)                  R4      e   \        R4      hV'       g   V'       d   \        R4      h\+        VVR7      p\/        VV4       RVRV	RV
RVRVRVRV/# ) FNpythonzThe "dnspython" module must be installed to use mongodb+srv:// URIs. To fix this error install pymongo again:
 %s -m pip install pymongo>=4.3Tz)Invalid URI scheme: URI must begin with 'z' or ''z(Must provide at least one hostname or IP?/.zBad database name "%s"rY   z;Any '/' in a unix domain socket must be percent-encoded: %sr4   r   z*Cannot specify directConnection=true with z URIs)rc   z. URIs must include one, and only one, hostnamez$ URIs must not include a port numberr5   zDThe srvServiceName option is only allowed with 'mongodb+srv://' URIszAThe srvMaxHosts option is only allowed with 'mongodb+srv://' URIsnodelistusernamepassworddatabase
collectionr   fqdn)
startswithSCHEME
SCHEME_LEN
SRV_SCHEMEr   sys
executabler   SRV_SCHEME_LENr   r   r\   r   rx   _BAD_DB_CHARSsearchupdater   
rpartitionr`   r   r   rR   r   )r   rc   r   r   r   r   is_srvscheme_freepython_pathr]   r_   dbaser   r   host_plus_db_partr^   r   	host_partrW   r   r   r   r~   s   &&&&&&                 rL   _validate_urir    s    ~~f*+&	
	#	#  ..44HK$1 5@A  ./*DVHFS]R^^_`aaCDDDFEJ(*G!,!6!6s!;$
/99#>	1e%	U#%< %C 3E&&5=>> ' }T89EF
i&11#6!U%h/f
e|VYbbccED!??W[[%?M;;)**$'QR\Q]]b%cddE5u:?
|+YZ[[1X
d
|+OPQQ $45A R
 	
  O
 	
 E=5'" 	EDFEj7 rN   c                    V ^8  d   QhRRRR/# )rE   r   r   rH   r   rJ   )rK   s   "rL   rM   rM   ^  s      *D  rN   c                    / p\          F5  pVP                  4       V 9   g   K  W,          W&   V P                  V4       K7  	  V P                  4        F	  w  r4WAV&   K  	  V# rp   )URI_OPTIONSr|   r   r   )r   case_sensitiveoptionkvs   &    rL   _make_options_case_sensitiver  ^  sW    N<<>W$%,_N"KK  q  rN   >   tlsallowinvalidhostnamesr   r   )F)TFT)r   r   r   r-   r   r   )=__doc__
__future__r   rer   r   typingr   r   r   r   r   r   r	   r
   urllib.parser   !pymongo.asynchronous.srv_resolverr   pymongo.client_optionsr   pymongo.commonr   r   r   r   pymongo.errorsr   r   pymongo.typingsr   pymongo.pyopenssl_contextr   r   rR   r   r   r   DEFAULT_PORT	frozensetr  rU   r`   rj   r   r   r   r   r   r   r   r   r   compileescaper   _ALLOWED_TXT_OPTSr   r   r  r  rJ   rN   rL   <module>r     s
    # 	 
 	 	 	 & = 5  : $4	[

Z/// 	"/ 		/
 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/  	!/" 	#/$ 	%/& 	'/( 	)/* 	+/, 	-/. 	//0 	1/2 	3/4 	5/6 	7/8 	#9/: 	!;/< 	=/> 	?/@ 	A/B 	C/D 	E/F 	&G/H 	#I/J 	K/L 	 M/N 	(O/P 	/Q/R 	&S/T 	U/V 	W/X 	Y/Z 	[/\ 	]/1h 40(. ;G 0h ,2j$N,-*Z ;G 4 

37!33c9:\ 
Y!L #/#']@rN   