
    ͆h              	         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	r	S SK
r
S SKJrJr  S SK	Jr  S SKJrJrJrJrJrJrJrJrJrJrJrJrJr  S SKJr  S SKJ r J!r!  S SK"r"S SK#r#S SK$r#S SK%J&r&J'r'J(r(  S S	K)J*r*J+r+J,r,J-r-J.r.  S S
K/J0r0  \" S5      r1\" S\+S9r2\Rf                  " \45      r5 " S S\\2   \*\2   5      r6 " S S\6\2   \\2   5      r7 " S S\\1   \*\1   5      r8 " S S\\1   \*\\1      5      r9 " S S\\1   \*\\:\14      5      r; " S S\9\,   5      r< " S S\\1   \8\1   5      r= " S S\\1   \8\1   5      r> " S S\*5      r? " S  S!\5      r@ " S" S#\8\@   5      rA " S$ S%\8\:   5      rB " S& S'\\1   \*\\1S4      5      rC " S( S)\B5      rD " S* S+\=\:   5      rE " S, S-\*\:   5      rF " S. S/\=\:   5      rG " S0 S1\=\:   5      rH " S2 S3\H5      rI " S4 S5\I5      rJ " S6 S7\H5      rK " S8 S9\9\:   5      rL " S: S;\I5      rM " S< S=\*\'R                     5      rN " S> S?\85      rO " S@ SA\\1   \*\1   5      rP " SB SC\+5      rQ " SD SE\*\\Q\:4      5      rR " SF SG\8\\:      5      rS " SH SI\8\&R                     5      rU " SJ SK\*\\	R                        5      rW " SL SM\*\#R                  R                     5      rZg)N    )annotationsN)Counter
UserString)SimpleNamespace)AnyCallable
CollectionDictGenericIteratorListMappingMutableMapping
NamedTupleTypeVarUnionoverload)quote)urlsplit
urlunsplit)pluginsthemeutils)BaseConfigOptionConfigLegacyConfigPlainConfigSchemaItemValidationError)ConfigurationErrorT
SomeConfig)boundc                     ^  \ rS rSr% SrSrS\S'   S\S'   \SS	.     SS
 jj5       r\SS	.     SS jj5       rSS	.U 4S jjrSS jr	SS jr
SS jrSrU =r$ )	SubConfig4   a  
Subconfig Config Option.

New: If targeting MkDocs 1.4+, please pass a subclass of Config to the
constructor, instead of the old style of a sequence of ConfigOption instances.
Validation is then enabled by default.

A set of `config_options` grouped under a single config option.
By default, validation errors and warnings resulting from validating
`config_options` are ignored (`validate=False`). Users should typically
enable validation with `validate=True`.
N
str | None_config_file_pathtype[SomeConfig]config_classT)validatec                  g)zRCreate a sub-config in a type-safe way, using fields defined in a Config subclass.N )selfr)   r*   s      T/opt/services/DDDS/venv/lib/python3.13/site-packages/mkdocs/config/config_options.py__init__SubConfig.__init__E           Fc                   g)z;Create an untyped sub-config, using directly passed fields.Nr,   )r-   r*   config_optionss      r.   r/   r0   K   r1   r2   c               X  > [         TU ]  5         0 U l        Uc  SOUU l        [	        U 5      [
        L av  [        U5      S:X  a:  [        US   [        5      (       a"  [        US   [        5      (       a
  Uu  U l
        g [        R                  " [        U5      U l
        Uc  SOUU l        g g )NT   r   F)superr/   default_do_validationtyper$   len
isinstance
issubclassr   r)   	functoolspartialr   )r-   r*   r4   	__class__s      r.   r/   r0   S   s    &.&6dH:"N#q(~a0$77~a0&99'5$"$-$5$5lN$S!/7/?eX# #r2   c                b    U R                    SUR                    S3n[        X 4[        US95      $ )z^Eliminates the need to write `config_class = FooConfig` when subclassing SubConfig[FooConfig].[])r)   )__name__r:   dict)clsr)   names      r.   __class_getitem__SubConfig.__class_getitem__b   s3    ,,q!6!6 7q9D&$L"ABBr2   c                &    UR                   U l        g N)config_file_pathr'   r-   configkey_names      r.   pre_validationSubConfig.pre_validationg   s    !'!8!8r2   c                p   U R                  U R                  S9n UR                  U5        UR                  5       u  p4U R                  (       aA  U R                  R                  S U 5       5        U(       a  US   u  pg[        SU SU 35      eU$ ! [         a  n[        [        U5      5      eS nAff = f)NrL   c              3  6   #    U  H  u  pS U SU 3v   M     g7f)Sub-option '': Nr,   ).0keymsgs      r.   	<genexpr>+SubConfig.run_validation.<locals>.<genexpr>t   s      Wh(#<uCu!=hs   r   rU   rV   )
r)   r'   	load_dictr*   r   r   strr9   warningsextend)r-   valuerN   failedr^   erX   errs           r.   run_validationSubConfig.run_validationj   s    ""D4J4J"K	*U#%0F MM   Wh WW!!9%SESE&BCC " 	*!#a&))	*s   #B 
B5B00B5)r'   r9   r)   r8   )r-   zSubConfig[SomeConfig]r)   r(   r*   bool)r-   zSubConfig[LegacyConfig]r4   r   r*   rf   )r)   ztype[Config]rN   r   rO   r]   )r`   objectreturnr!   )rD   
__module____qualname____firstlineno____doc__r'   __annotations__r   r/   rH   rP   rd   __static_attributes____classcell__r@   s   @r.   r$   r$   4   s     %)z(""\`a#a3CaUYa a
  J%J.J J J 26 N NC
9 r2   r$   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )PropagatingSubConfig}   z
A SubConfig that must consist of SubConfigs with defined schemas.

Any value set on the top config gets moved to sub-configs with matching keys.
c                  > [        U[        5      (       a  [        5       nU R                  R                   H  u  p4[        U[
        5      (       d  M  UR                  R                   HZ  u  pVXQ;   d  M  UR                  U0 5      n[        U[        5      (       d  M5  UR                  U5        UR                  XQU   5        M\     M     U H  nX	 M     [        T	U ]%  U5      $ rK   )
r<   rE   setr)   _schemar$   
setdefaultaddr7   rd   )
r-   r`   
to_discardk1v1k2_subdictkr@   s
            r.   rd   #PropagatingSubConfig.run_validation   s    eT""J++33b),,!#!8!8;&+&6&6r2&>G)'488 *r 2 ' 2 22Ry A "9 4  H  w%e,,r2   r,   r`   rh   )rD   rj   rk   rl   rm   rd   ro   rp   rq   s   @r.   rs   rs   }   s    - -r2   rs   c                  b   ^  \ rS rSrSr\SS j5       r\SS	S jj5       rS
U 4S jjrS rSrU =r	$ )OptionallyRequired   z
Soft-deprecated, do not use.

A subclass of BaseConfigOption that adds support for default values and
required values. It is a base class for config options.
c                    g rK   r,   r-   r8   s     r.   r/   OptionallyRequired.__init__       r2   c                   g rK   r,   r-   r8   requireds      r.   r/   r      r   r2   c                Z   > [         TU ]  5         Xl        X l        [	        U5      U l        g rK   )r7   r/   r8   _legacy_requiredrf   r   r-   r8   r   r@   s      r.   r/   r      s$     (Xr2   c                    UcH  U R                   b  U R                   nO.U R                  (       d  gU R                  (       a  [        S5      eU R                  U5      $ )z
Perform some initial validation.

If the option is empty (None) and isn't required, leave it as such. If
it is empty but has a default, use that. Finally, call the
run_validation method on the subclass unless.
N$Required configuration not provided.)r8   r   r   rd   r-   r`   s     r.   r*   OptionallyRequired.validate   sJ     =||']]%&LMM""5))r2   )r   r8   r   rK   r   rf   )NN)
rD   rj   rk   rl   rm   r   r/   r*   ro   rp   rq   s   @r.   r   r      s?        '* *r2   r   c                  b   ^  \ rS rSr% SrSrS\S'   SSU 4S jjjrSS jrSS jr	SS	 jr
S
rU =r$ )ListOfItems   z
Validates a homogeneous list of items.

E.g. for `config_options.ListOfItems(config_options.Type(int))` a valid item is `[1, 2, 3]`.
Nbool | Noner   c                p   > [         TU ]  5         X l        Xl        U R                  U R                  l        g rK   r7   r/   r8   option_typer^   r-   r   r8   r@   s      r.   r/   ListOfItems.__init__   +    &$(MM!r2   c                J    [        U 5      R                   SU R                   3$ N: r:   rD   r   r-   s    r.   __repr__ListOfItems.__repr__   %    t*%%&b)9)9(:;;r2   c                    Xl         X l        g rK   _config	_key_namerM   s      r.   rP   ListOfItems.pre_validation       !r2   c                >   Uc5  U R                   (       d  U R                  c  [        S5      eU R                  n[        U[        5      (       d  [        S[        U5       S35      eU(       d  U$ [        S5      n U R                  R                  Ul        [        U SS5      n[        [        U5      5       Vs/ s H
  oC SU S3PM     nn[        [        XQ5      5      Ul        U R                   U R"                  l        U H  nU R"                  R%                  X&5        M      U H"  nU R"                  R'                  X&   5      X&'   M$     U H  nU R"                  R)                  X&5        M      U Vs/ s H  orU   PM	     sn$ ! [         a     Nf = fs  snf s  snf )	Nr   z Expected a list of items, but a  was given.r,   r    rB   rC   )r   r8   r   r<   listr:   r   r   rL   AttributeErrorgetattrranger;   rE   zipdatar^   r   rP   rd   post_validation)r-   r`   fake_configparent_key_namei	fake_keysrO   r   s           r.   rd   ListOfItems.run_validation   sv   =}} 4%&LMMLLE%&&!$DT%[MQ\"]^^L"2&	+/<<+H+HK(
 "$R88=c%j8IJ8I1(!A.8I	JI 56$(MM!#H++KB $#H$($4$4$C$CKDY$ZK! $ $H,,[C $ )22	1A	22#  		
 K 3s   ;F 9F4F
FFr   r   r8   r   rK   r   BaseConfigOption[T]ri   Noneri   r]   rg   )r`   rh   ri   zlist[T]rD   rj   rk   rl   rm   r   rn   r/   r   rP   rd   ro   rp   rq   s   @r.   r   r      s2     !Hk 2 2<"3 3r2   r   c                  b   ^  \ rS rSr% SrSrS\S'   SSU 4S jjjrSS jrSS jr	SS	 jr
S
rU =r$ )DictOfItems   z
Validates a dict of items. Keys are always strings.

E.g. for `config_options.DictOfItems(config_options.Type(int))` a valid item is `{"a": 1, "b": 2}`.
Nr   r   c                p   > [         TU ]  5         X l        Xl        U R                  U R                  l        g rK   r   r   s      r.   r/   DictOfItems.__init__   r   r2   c                J    [        U 5      R                   SU R                   3$ r   r   r   s    r.   r   DictOfItems.__repr__  r   r2   c                    Xl         X l        g rK   r   rM   s      r.   rP   DictOfItems.pre_validation  r   r2   c           
        Uc5  U R                   (       d  U R                  c  [        S5      eU R                  n[        U[        5      (       d  [        S[        U5       S35      eU(       d  U$ [        S5      n U R                  R                  Ul        Xl
        U H  nU R                  R                  X#5        M      U H:  n[        U[        5      (       a  M  [        S[         S[        U5       SU S35      e   U H"  nU R                  R                  X#   5      X#'   M$     U H  nU R                  R                  X#5        M      U$ ! [         a     Nf = f)	Nr   z Expected a dict of items, but a r   r,   Expected type: z for keys, but received: z (key=))r   r8   r   r<   rE   r:   r   r   rL   r   r   r   rP   r]   rd   r   )r-   r`   r   rX   s       r.   rd   DictOfItems.run_validation
  sI   =}} 4%&LMMLLE%&&!$DT%[MQ\"]^^L"2&	+/<<+H+HK(
 !C++K= Cc3''%%cU*CDI;fUXTYYZ[  
 C#//>>{?OPK  C,,[>  '  		s   ;E 
EEr   rK   r   r   rg   )r`   rh   ri   zdict[str, T]r   rq   s   @r.   r   r      s2     !Hk 2 2<"   r2   r   c                  `   ^  \ rS rSrSr\S	S j5       r\S
S j5       rSS.SU 4S jjjrSrU =r$ )ConfigItemsi-  z
Deprecated: Use `ListOfItems(SubConfig(...))` instead of `ConfigItems(...)`.

Validates a list of mappings that all must match the same set of
options.
c                    g rK   r,   )r-   r4   s     r.   r/   ConfigItems.__init__5  r   r2   c                   g rK   r,   )r-   r   r4   s      r.   r/   r   9  r   r2   Nr   c               Z   > [         TU ]  [        U6 / S9  Xl        [	        U5      U l        g )Nr8   )r7   r/   r$   r   rf   r   )r-   r   r4   r@   s      r.   r/   r   =  s+    N3R@ (Xr2   )r   r   )r4   r   )r4   r   r   rf   )r4   r   ri   r   	rD   rj   rk   rl   rm   r   r/   ro   rp   rq   s   @r.   r   r   -  sF         IM ' ' 'r2   r   c                  n   ^  \ rS rSrSr\SS	S jj5       r\SS
S jj5       rSSU 4S jjjrSS jrSrU =r	$ )TypeiC  zX
Type Config Option.

Validate the type of a config option against a given Python type.
c                   g rK   r,   r-   type_lengthkwargss       r.   r/   Type.__init__J  r   r2   c                   g rK   r,   r   s       r.   r/   r   N  r   r2   c               >   > [         TU ]  " S0 UD6  Xl        X l        g Nr,   )r7   r/   _typer   )r-   r   r   r   r@   s       r.   r/   r   R  s    "6"
r2   c           
     .   [        XR                  5      (       d  SU R                   S[        U5       3nOUU R                  bF  [	        U5      U R                  :w  a-  SU R                   SU R                   SU< S[	        U5       3nOU$ [        U5      e)Nr    but received: z with length )r<   r   r:   r   r;   r   )r-   r`   rY   s      r.   rd   Type.run_validationW  s    %,,#DJJ<tE{mLC[[$Ut{{)B!$**]4;;-!%-E
|E 
 Lc""r2   )r   r   rK   )r   
int | Noner   ztype[T])r   r   r   ztuple[type[T], ...]ri   r   r`   rh   ri   r    
rD   rj   rk   rl   rm   r   r/   rd   ro   rp   rq   s   @r.   r   r   C  sD         
# #r2   r   c                  >   ^  \ rS rSrSrSSU 4S jjjrSS jrSrU =r$ )	Choiceie  zS
Choice Config Option.

Validate the config option against a strict set of values.
c                   > [         TU ]  " SSU0UD6   [        U5      nU(       a  [	        U[
        5      (       a  [        SU 35      eUb  X!;  a  [        U< SU< 35      eXl        g ! [         a    Sn NYf = f)Nr8   r   z"Expected iterable of choices, got z is not one of r,   )r7   r/   r;   	TypeErrorr<   r]   
ValueErrorchoices)r-   r   r8   r   r   r@   s        r.   r/   Choice.__init__l  s    33F3	\F GS11A'KLL7#9{/'EFF  	F	s   A+ +A:9A:c                \    XR                   ;  a  [        SU R                    SU< 35      eU$ )NzExpected one of: r   )r   r   r   s     r.   rd   Choice.run_validationz  s0    $!$5dll^?SXR["\]]r2   )r   rK   )r   zCollection[T]r8   T | Noneri   r   r   )	rD   rj   rk   rl   rm   r/   rd   ro   rp   rq   s   @r.   r   r   e  s      r2   r   c                  n   ^  \ rS rSrSr    S	         S
U 4S jjjrSS jrS rSS jrS r	Sr
U =r$ )
Deprecatedi  a=  
Deprecated Config Option.

Raises a warning as the option is deprecated. Uses `message` for the
warning. If `move_to` is set to the name of a new config option, the value
is moved to the new option on pre_validation. If `option_type` is set to a
ConfigOption instance, then the value is validated against that type.
c                   > [         TU ]  5         S U l        Xl        U(       d  U(       a  SnOSnU(       a	  USU S3-  nX l        X0l        U=(       d
    [        5       U l        U R                  R                  U l        g )Nz6The configuration option '{}' was removed from MkDocs.zZThe configuration option '{}' has been deprecated and will be removed in a future release.z Use 'z
' instead.)	r7   r/   r8   moved_tomessageremovedr   optionr^   )r-   r   r   r   r   r@   s        r.   r/   Deprecated.__init__  st     	 R;  VH:Z88!7%5%7,,r2   c                &   U R                   R                  X5        UR                  U5      b  U R                  (       a$  [	        U R
                  R                  U5      5      eU R                  R                  U R
                  R                  U5      5        U R                  bm  U R                  R                  S5      Gt p4UnU H4  nUR                  U5      c  0 XV'   XV   n[        U[        5      (       a  M4    g    UR                  U5      XT'   g g g )N.)r   rP   getr   r   r   formatr^   appendr   splitr<   rE   pop)r-   rN   rO   parent_keys
target_keytargetrX   s          r.   rP   Deprecated.pre_validation  s    ""64::h+||%dll&9&9(&CDDMM  !4!4X!>?}}(+/==+>+>s+C($&Czz#.&(#[F%fd33 ' &,ZZ%9" ) ,r2   c                8    U R                   R                  U5      $ rK   r   r*   r   s     r.   r*   Deprecated.validate  s    {{##E**r2   c                :    U R                   R                  X5        g rK   )r   r   rM   s      r.   r   Deprecated.post_validation  s    ##F5r2   c                n    U R                   R                  5         U R                   R                  U l        g rK   r   reset_warningsr^   r   s    r.   r  Deprecated.reset_warnings  #    ""$,,r2   )r8   r   r   r   r   r^   )NNFN)
r   r&   r   r&   r   rf   r   zBaseConfigOption | Noneri   r   rg   )rD   rj   rk   rl   rm   r/   rP   r*   r   r  ro   rp   rq   s   @r.   r   r     si      $"/3-- - 	-
 -- 
- -6:.+6- -r2   r   c                  4    \ rS rSr% S\S'   S\S'   S	S jrSrg)
_IpAddressValuei  r]   hostintportc                8    U R                    SU R                   3$ )N:)r  r  r   s    r.   __str___IpAddressValue.__str__  s    ))Adii[))r2   r,   Nr   )rD   rj   rk   rl   rn   r  ro   r,   r2   r.   r  r    s    
I
I*r2   r  c                  "    \ rS rSrSrSS jrSrg)	IpAddressi  zS
IpAddress Config Option.

Validate that an IP address is in an appropriate format
c                   [        U[        5      (       a  SU;  a  [        S5      eUR                  SS5      u  p#US:w  aQ  UR	                  S5      (       a  UR                  S5      (       a  USS n [        [        R                  " U5      5      n [        U5      n[        X%5      $ ! [         a  n[        U5      eS nAff = f! [         a    [        SU S	35      ef = f)
Nr  z$Must be a string of format 'IP:PORT'r6   	localhostrB   rC   'z' is not a valid port)r<   r]   r   rsplit
startswithendswith	ipaddress
ip_addressr   r  	Exceptionr  )r-   r`   r  port_strrb   r  s         r.   rd   IpAddress.run_validation  s    %%%E)9!"HIIc1-;s##c(:(:Abz)9//56	Gx=D t**  )%a(()
  	G!AhZ/D"EFF	Gs$   3B) C )
C3B>>CC r,   N)r`   rh   ri   r  rD   rj   rk   rl   rm   rd   ro   r,   r2   r.   r  r    s    +r2   r  c                  ~   ^  \ rS rSrSr\S	SS.S
S jjj5       r\S	SS.SS jjj5       rSSU 4S jjjrSS jrSrU =r	$ )URLi  zF
URL Config Option.

Validate a URL by requiring a scheme is present.
F)is_dirc                   g rK   r,   )r-   r8   r,  s      r.   r/   URL.__init__  r   r2   c                   g rK   r,   )r-   r8   r   r,  s       r.   r/   r.    r   r2   c                ,   > X0l         [        TU ]	  XS9  g )Nr   )r,  r7   r/   )r-   r8   r   r,  r@   s       r.   r/   r.    s    4r2   c                   [        U[        5      (       d  [        S[        U5       35      eUS:X  a  U$  [	        U5      nUR                  (       ai  UR                  (       aX  U R                  (       a<  UR                  R                  S5      (       d  UR                  UR                   S3S9n[        U5      $ [        S5      e! [
        [        4 a    [        S5      ef = f)NzExpected a string, got r   zUnable to parse the URL./pathz;The URL isn't valid, it should include the http:// (scheme))r<   r]   r   r:   r   r   r   schemenetlocr,  r4  r#  _replacer   )r-   r`   
parsed_urls      r.   rd   URL.run_validation  s    %%%!$;DK="IJJB;L	>!%J !2!2{{:??#;#;C#@#@'008I6K0L
j))[\\ 	* 	>!"<==	>s   C C"rK   )r,  rf   )r   rf   r,  rf   )NNF)r,  rf   ri   r   r`   rh   ri   r]   r   rq   s   @r.   r+  r+    sT     u   u  5 5] ]r2   r+  c                  Z   ^  \ rS rSrSrS
U 4S jjrS rSS jrSS jrSS jr	S r
S	rU =r$ )Optionali  z
Wraps a field and makes a None value possible for it when no value is set.

E.g. `my_field = config_options.Optional(config_options.Type(str))`
c                   > UR                   b  [        SUR                   < S35      e[        TU ]  5         Xl        UR
                  U l        g )Nz#This option already has a default (z.) and doesn't need to be wrapped into Optional)r8   r   r7   r/   r   r^   )r-   config_optionr@   s     r.   r/   Optional.__init__  sU      ,5m6K6K5N O? @  	#%..r2   c                F    US;   a  [         e[        U R                  U5      $ )Nr   r^   )r   r   r   )r-   rX   s     r.   __getattr__Optional.__getattr__"  s"    ((  t{{C((r2   c                8    U R                   R                  X5      $ rK   )r   rP   rM   s      r.   rP   Optional.pre_validation'  s    {{))&;;r2   c                @    Uc  g U R                   R                  U5      $ rK   r	  r   s     r.   rd   Optional.run_validation*  s    ={{##E**r2   c                r    U R                   R                  X5      nU R                   R                  U l        U$ rK   )r   r   r^   )r-   rN   rO   results       r.   r   Optional.post_validation/  s,    ,,V>,,r2   c                n    U R                   R                  5         U R                   R                  U l        g rK   r  r   s    r.   r  Optional.reset_warnings4  r  r2   rA  )r>  r   ri   r   rg   )r`   rh   ri   r   )rD   rj   rk   rl   rm   r/   rB  rP   rd   r   r  ro   rp   rq   s   @r.   r<  r<    s+    /)
<+

- -r2   r<  c                  2   ^  \ rS rSrU 4S jrSS jrSrU =r$ )RepoURLi9  c                \   > [         R                  " S[        5        [        TU ]  " U0 UD6  g )Nz8RepoURL is no longer used in MkDocs and will be removed.)r^   warnDeprecationWarningr7   r/   )r-   argsr   r@   s      r.   r/   RepoURL.__init__:  s)    FHZ	
 	$)&)r2   c                   [        US   5      R                  R                  5       nUR                  S5      nUS   b[  UR                  S5      cI  US:X  a  SUS'   O=US:X  a  SUS'   O1US:X  a  S	US'   O%UR	                  S
5      S   R                  5       US'   US   b  Uc  US:X  d  US:X  a  SnOUS:X  a  SnOSnU(       a  UR                  S5      (       d  US-  nXAS'   g )Nrepo_urledit_uri	repo_name
github.comGitHubbitbucket.org	Bitbucket
gitlab.comGitLabr   r   edit/master/docs/src/default/docs/r   r2  )r   r6  lowerr   r  titler#  )r-   rN   rO   	repo_hostrV  s        r.   r   RepoURL.post_validation@  s    VJ/077==?	::j) *)fjj.E.ML(&.{#o-&1{#l*&.{#&/ooc&:1&=&C&C&E{# *)h.>L(I,E.o-. H--c22OH%zr2   r,   rg   rD   rj   rk   rl   r/   r   ro   rp   rq   s   @r.   rN  rN  9  s    *& &r2   rN  c                  6   ^  \ rS rSrSU 4S jjrSS jrSrU =r$ )EditURIi_  c                8   > [         TU ]  [        5        Xl        g rK   r7   r/   r]   repo_url_keyr-   ri  r@   s     r.   r/   EditURI.__init__`      (r2   c                (   UR                  U5      nUR                  U R                  5      nUc=  Ub:  [        U5      R                  R	                  5       nUS:X  d  US:X  a  SnOUS:X  a  SnU(       a  UR                  S5      (       d  US-  nX1U'   g )NrX  r\  r^  rZ  r_  r2  )r   ri  r   r6  r`  r#  )r-   rN   rO   rV  rU  rb  s         r.   r   EditURI.post_validationd  s    ::h'::d//0 4 *11779IL(I,E.o-. H--c22OH#xr2   ri  ri  r]   ri   r   rg   rd  rq   s   @r.   rf  rf  _  s    )$ $r2   rf  c                     ^  \ rS rSr " S S\R
                  5      r " S S\5      rS
SU 4S jjjrSS jr	SS jr
S	rU =r$ )EditURITemplateiv  c                  (   ^  \ rS rSrU 4S jrSrU =r$ )EditURITemplate.Formatteriw  c                B   > US:X  a
  [        USS9$ [        TU ]	  X5      $ )Nqr   )safe)urlquoter7   convert_field)r-   r`   
conversionr@   s      r.   ry  'EditURITemplate.Formatter.convert_fieldx  s(    S B//7(;;r2   r,   )rD   rj   rk   rl   ry  ro   rp   rq   s   @r.   	Formatterrt  w  s    	< 	<r2   r|  c                  2   ^  \ rS rSrSU 4S jjrS rSrU =r$ )EditURITemplate.Templatei}  c                   > [         TU ]  U5        Xl         U R                  SS5        g ! [         a  n[        SU 35      eS nAff = f)Nr   zUnknown template substitute: )r7   r/   	formatterr   KeyErrorr   )r-   r  r   rb   r@   s       r.   r/   !EditURITemplate.Template.__init__~  sN    GT"&NFB# F #@!DEEFs   + 
AAAc                J    U R                   R                  U R                  XS9$ )N)r4  
path_noext)r  r   r   )r-   r4  r  s      r.   r   EditURITemplate.Template.format  s     >>(((UUr2   )r  r   )rD   rj   rk   rl   r/   r   ro   rp   rq   s   @r.   Templater~  }  s    	F	V 	Vr2   r  c                .   > [         TU ]  5         Xl        g rK   )r7   r/   edit_uri_key)r-   r  r@   s     r.   r/   EditURITemplate.__init__  s    (r2   c                ~     U R                  U R                  5       U5      $ ! [         a  n[        U5      eS nAff = frK   )r  r|  r&  r   r-   r`   rb   s      r.   rd   EditURITemplate.run_validation  s:    	%==!1599 	%!!$$	%s   " 
<7<c                    U R                   (       ae  UR                  U5      (       aN  UR                  U R                   5      (       a-  U R                  R                  SU R                    SU S35        g g g g )NzThe option 'z' has no effect when 'z	' is set.)r  r   r^   r  rM   s      r.   r   EditURITemplate.post_validation  sf    H!5!5&**TEVEV:W:WMM  t0011GzQZ[ ;X!5r2   )r  rK   )r  r&   ri   r   r   rg   )rD   rj   rk   rl   stringr|  r   r  r/   rd   r   ro   rp   rq   s   @r.   rr  rr  v  s<    <F$$ <
V: 
V) )% r2   rr  c                  6   ^  \ rS rSrSU 4S jjrSS jrSrU =r$ )RepoNamei  c                8   > [         TU ]  [        5        Xl        g rK   rh  rj  s     r.   r/   RepoName.__init__  rl  r2   c                :   UR                  U5      nUR                  U R                  5      nUbl  Uch  [        US   5      R                  R	                  5       nUS:X  a  SnO4US:X  a  SnO+US:X  a  SnO"UR                  S5      S	   R                  5       nX1U'   g g g )
NrU  rX  rY  rZ  r[  r\  r]  r   r   )r   ri  r   r6  r`  r  ra  )r-   rN   rO   rW  rU  rb  s         r.   r   RepoName.post_validation  s    JJx(	::d//0 I$5 
!34;;AACIL($	o-'	l*$	%OOC0399;	(8 %6r2   ro  rp  rg   rd  rq   s   @r.   r  r    s    )) )r2   r  c                     ^  \ rS rSr% Sr\" \R                  R                  5      r	S\
S'   SrS
SU 4S jjjrSS jrSU 4S jjrS	rU =r$ )FilesystemObjecti  z8Base class for options that point to filesystem objects.zCallable[[str], bool]existence_testzfile or directoryc                J   > [         TU ]  " [        40 UD6  Xl        S U l        g rK   )r7   r/   r]   exists
config_dir)r-   r  r   r@   s      r.   r/   FilesystemObject.__init__  s!    ''&*r2   c                    UR                   (       a/  [        R                  R                  UR                   5      U l        g S U l        g rK   )rL   osr4  dirnamer  rM   s      r.   rP   FilesystemObject.pre_validation  s1    8>8O8OBGGOOF334 	UY 	r2   c                  > [         TU ]  U5      nU R                  (       aN  [        R                  R                  U5      (       d*  [        R                  R                  U R                  U5      nU R                  (       a2  U R                  U5      (       d  [        SU SU R                   S35      e[        R                  R                  U5      $ )Nz
The path 'z' isn't an existing r   )r7   rd   r  r  r4  isabsjoinr  r  r   rG   abspath)r-   r`   r@   s     r.   rd   FilesystemObject.run_validation  s    &u-??277==#7#7GGLL%8E;;t22599!Jug5I$))TU"VWWwwu%%r2   )r  r  )F)r  rf   ri   r   rg   r:  )rD   rj   rk   rl   rm   staticmethodr  r4  r  r  rn   rG   r/   rP   rd   ro   rp   rq   s   @r.   r  r    s<    B,8,HN)HD+ +


& &r2   r  c                  T    \ rS rSrSr\" \R                  R                  5      r	Sr
Srg)Diri  zZ
Dir Config Option.

Validate a path to a directory, optionally verifying that it exists.
	directoryr,   N)rD   rj   rk   rl   rm   r  r  r4  isdirr  rG   ro   r,   r2   r.   r  r    s      ""''--0NDr2   r  c                      \ rS rSrSS jrSrg)DocsDiri  c                    UR                   (       d  g [        R                  R                  UR                   5      X   :X  a  [	        SU SU S35      eg )NzThe 'zd' should not be the parent directory of the config file. Use a child directory instead so that the 'z"' is a sibling of the config file.)rL   r  r4  r  r   rM   s      r.   r   DocsDir.post_validation  s[    && 77??6223v7GG!z "J@B  Hr2   r,   Nrg   )rD   rj   rk   rl   r   ro   r,   r2   r.   r  r    s    
r2   r  c                  T    \ rS rSrSr\" \R                  R                  5      r	Sr
Srg)Filei  zV
File Config Option.

Validate a path to a file, optionally verifying that it exists.
filer,   N)rD   rj   rk   rl   rm   r  r  r4  isfiler  rG   ro   r,   r2   r.   r  r    s      ""''..1NDr2   r  c                  h   ^  \ rS rSrSr\/ 4S j5       r\/ 4SS jj5       r/ S4S	U 4S jjjrSrU =r$ )
ListOfPathsi  a  
List of Paths Config Option.

A list of file system paths. Raises an error if one of the paths does not exist.

For greater flexibility, prefer ListOfItems, e.g. to require files specifically:

    config_options.ListOfItems(config_options.File(exists=True))
c                    g rK   r,   r   s     r.   r/   ListOfPaths.__init__  r   r2   c                   g rK   r,   r   s      r.   r/   r    r   r2   Nc                @   > [         TU ]  [        SS9U5        X l        g NT)r  )r7   r/   r  r   r   s      r.   r/   r    s    )6@ r2   r   r   r   r   rq   s   @r.   r  r    sG     !   !    "D ! !r2   r  c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )SiteDiri  zd
SiteDir Config Option.

Validates the site_dir and docs_dir directories do not contain each other.
c                  > [         TU ]  X5        US   nUS   nU[        R                  -   R	                  UR                  [        R                  5      [        R                  -   5      (       a  [        SU SU S35      eU[        R                  -   R	                  UR                  [        R                  5      [        R                  -   5      (       a  [        SU SU S35      eg )Ndocs_dirsite_dirzThe 'docs_dir' should not be within the 'site_dir' as this can mean the source files are overwritten by the output or it will be deleted if --clean is passed to mkdocs build. (site_dir: 'z', docs_dir: 'z')zThe 'site_dir' should not be within the 'docs_dir' as this leads to the build directory being copied into itself and duplicate nested files in the 'site_dir'. (site_dir: ')r7   r   r  sepr"  rstripr   )r-   rN   rO   r  r  r@   s        r.   r   SiteDir.post_validation  s    1*%*%
 rvv))(//"&&*ABFF*JKK!  (jxjD  ++HOOBFF,Cbff,LMM!  (jxjD  Nr2   r,   rg   )rD   rj   rk   rl   rm   r   ro   rp   rq   s   @r.   r  r    s     r2   r  c                  H   ^  \ rS rSrSrSSU 4S jjjrS	S jrS
S jrSrU =r	$ )Themei%  zP
Theme Config Option.

Validate that the theme exists and build Theme instance.
c                .   > [         TU ]  5         Xl        g rK   )r7   r/   r8   )r-   r8   r@   s     r.   r/   Theme.__init__,  s    r2   c                &    UR                   U l         g rK   rS   rM   s      r.   rP   Theme.pre_validation0  s     & 7 7r2   c                   Uc  U R                   b  SU R                   0nO[[        U[        5      (       a  SU0nOA[        U[        5      (       a  SU;  a  [	        S5      eUnO[	        S[        U5       S35      e[        R                  " 5       nUS   b,  US   U;  a#  [	        SUS    SSR                  U5       35      eUS   (       d  SU;  a  [	        S	5      eSU;   au  [        R                  R                  US   5      (       dN  [        R                  R                  U R                  5      n[        R                  R                  XBS   5      US'   SU;   aB  [        R                  R                  US   5      (       d  [	        S
R                  US   S95      eSU;   a#  [        US   [        5      (       d  [	        S5      e[         R"                  " S0 UD6$ )NrG   zNo theme name set.zInvalid type z'. Expected a string or key/value pairs.zUnrecognised theme name: 'z''. The available installed themes are: z, 
custom_dirz7At least one of 'name' or 'custom_dir' must be defined.z5The path set in custom_dir ('{path}') does not exist.r3  localez'locale' must be a string.r,   )r8   r<   r]   rE   r   r:   r   get_theme_namesr  r  r4  r  r  rL   r  r   r   r  )r-   r`   theme_configthemesr  s        r.   rd   Theme.run_validation3  s   =T\\5"DLL1Ls##"E?Lt$$U"%&:;; L!U},ST  &&(+V0DF0R!,\&-A,B C77;yy7H6IK 
 F#L(H!"[\\ <'l<>X0Y0Y)>)>?J)+j|B\)]L&<'l<>X0Y0Y!GNN%l3 O   |#J|H7Ms,S,S!">??{{*\**r2   )rL   r8   rK   r   rg   )r`   rh   ri   ztheme.Theme)
rD   rj   rk   rl   rm   r/   rP   rd   ro   rp   rq   s   @r.   r  r  %  s!     8'+ '+r2   r  c                  D    \ rS rSrSrSS.S
S jjrS r\SS j5       rSr	g	)Navi]  z.
Nav Config Option.

Validate the Nav config.
Ttopc                  [        U[        5      (       a,  U H  nU R                  U5        M     U(       a	  U(       d  S nU$ [        U[        5      (       ad  U(       a]  U(       dV  U R                  R                  SU R                  U5       35        UR                  5        H  nU R                  USS9  M     U$ [        U[        5      (       a
  U(       d   U$ [        SU R                  U5       35      e)NzExpected nav to be a list, got Fr  )r<   r   _validate_nav_itemrE   r^   r  
_repr_itemvaluesrd   r]   r   )r-   r`   r  subitems       r.   rd   Nav.run_validationd  s    eT"" ''0 !5  t$$sMM  #B4??SXCYBZ![\ <<>##G#7 * 	 s##C  "$CDOOTYDZC["\]]r2   c                :   [        U[        5      (       a  g [        U[        5      (       aT  [        U5      S:w  a  [	        SU R                  U5       35      eUR                  5        H  nU R                  USS9  M     g [	        SU R                  U5       35      e)Nr6   z.Expected nav item to be a dict of size 1, got Fr  z.Expected nav item to be a string or dict, got )r<   r]   rE   r;   r   r  r  rd   )r-   r`   subnavs      r.   r  Nav._validate_nav_itemu  s    eS!!t$$5zQ%DT__UZE[D\]   ,,.##F#6 ) "@QVAW@XY r2   c                    [        U[        5      (       a#  U(       a  S[        UR                  5       5       3$ [        U[        [        S 5      45      (       a  [        U5      $ S[        U5      R                   SU< 3$ )Nzdict with keys za r   )r<   rE   tuplekeysr]   r:   reprrD   )rF   r`   s     r.   r  Nav._repr_item  sh    eT""u$U5::<%8$9::T$Z011;U,,-Ry99r2   r,   Nr   r   )
rD   rj   rk   rl   rm   rd   r  classmethodr  ro   r,   r2   r.   r  r  ]  s*     48 " : :r2   r  c                  "    \ rS rSrSrSS jrSrg)Privatei  z`A config option that can only be populated programmatically. Raises an error if set by the user.c                     Ub  [        S5      eg )NzFor internal use only.)r   r   s     r.   rd   Private.run_validation  s    !":;; r2   r,   N)r`   rh   ri   r   r)  r,   r2   r.   r  r    s
    j<r2   r  c                     ^  \ rS rSrSr\" \5      r \" \SS9r \" \	SS9r
 \" \	SS9r S
SU 4S jjjrS rS rS	rU =r$ )ExtraScriptValuei  zZAn extra script to be added to the page. The `extra_javascript` config is a list of these.r   r   Fc                ,   > [         TU ]  US9  Xl        g )NrS   )r7   r/   r4  )r-   r4  rL   r@   s      r.   r/   ExtraScriptValue.__init__  s    *:;	r2   c                    U R                   $ rK   r3  r   s    r.   r  ExtraScriptValue.__str__      yyr2   c                    U R                   $ rK   r3  r   s    r.   
__fspath__ExtraScriptValue.__fspath__  r  r2   r3  )r   N)r4  r]   )rD   rj   rk   rl   rm   r   r]   r4  r:   rf   deferasync_r/   r  r  ro   rp   rq   s   @r.   r  r    sX    d9D3R D4u%E7$&F7  r2   r  c                  2   ^  \ rS rSrU 4S jrSS jrSrU =r$ )ExtraScripti  c                P   > [         TU ]  5         [        [           " 5       U l        g rK   )r7   r/   r$   r  r   )r-   r@   s    r.   r/   ExtraScript.__init__  s    $%568r2   c                   U R                   U R                  l         [        U[        5      (       a6  UR	                  S5      (       a  U R                  R                  USS.5      $ U$ U R                  R                  U5      $ )Nz.mjsmodule)r4  r:   )r^   r   r<   r]   r#  rd   r   s     r.   rd   ExtraScript.run_validation  sh    $(MM!eS!!~~f%%''66x7XYYL..u55r2   )r   )r`   rh   ri   zExtraScriptValue | str)rD   rj   rk   rl   r/   rd   ro   rp   rq   s   @r.   r  r    s    96 6r2   r  c                  l   ^  \ rS rSrSrSS/ 4       SU 4S jjjrSS jrS rSS jrSS	 jr	S
r
U =r$ )MarkdownExtensionsi  aK  
Markdown Extensions Config Option.

A list or dict of extensions. Each list item may contain either a string or a one item dict.
A string must be a valid Markdown extension name with no config options defined. The key of
a dict item must be a valid Markdown extension name and the value must be a dict of config
options for that extension. Extension configs are set on the private setting passed to
`configkey`. The `builtins` keyword accepts a list of extensions which cannot be overridden by
the user. However, builtins can be duplicated to define config options for them if desired.
Nmdx_configsc                V   > [         TU ]  " SSU0UD6  U=(       d    / U l        X l        g )Nr8   r,   )r7   r/   builtins	configkey)r-   r  r  r8   r   r@   s        r.   r/   MarkdownExtensions.__init__  s*     	33F3 B"r2   c                    [        U[        5      (       d  [        SU S35      eU(       d  g [        U[        5      (       d  [        SU S35      eX R                  U'   g )Nr   z)' is not a valid Markdown Extension name.z/Invalid config options for Markdown Extension 'z'.)r<   r]   r   rE   
configdata)r-   extcfgs      r.   validate_ext_cfg#MarkdownExtensions.validate_ext_cfg  s[    #s##!AcU*S"TUU#t$$!$STWSXXZ"[\\"r2   c                f    [        5       =Ul        n[        5       Ul        SUR                  l        g )Nr   )r   _current_pager  src_path)r-   rN   rO   current_pages       r.   rP   !MarkdownExtensions.pre_validation  s+    .=.??|+-%'"r2   c                   0 U l         [        U[        [        [        45      (       d  [        S5      e/ n[        U[        5      (       a<  UR                  5        H'  u  p4U R                  X45        UR                  U5        M)     OU H  n[        U[        5      (       aP  [        U5      S:  a  [        S5      eUR                  5       u  p4U R                  X45        UR                  U5        Mh  [        U[        5      (       a  UR                  U5        M  [        S5      e   [        R                  " U R                  U-   5      n[        R                   " 5       nU H!  n UR#                  U4U R                   5        M#     U$ ! [$         a  n/ n['        [(        R*                  " [,        R.                  " 5       S   5      5       H(  n	U	R0                  (       d    OUR3                  SU	5        M*     SR5                  [(        R6                  " U5      5      n
[        SU SU
 [9        U5      R:                   SU 35      eS nAff = f)	Nz)Invalid Markdown Extensions configurationr6      r   r   zFailed to load extension 'z'.
r   )r  r<   r   r  rE   r   itemsr  r  r;   popitemr]   r   reduce_listr  markdownMarkdownregisterExtensionsr&  reversed	traceback
extract_tbsysexc_infolineinsertr  format_listr:   rD   )r-   r`   
extensionsr  r  itemmdrb   stackframetbs              r.   rd   !MarkdownExtensions.run_validation  s   +-%$t!455!"MNN
eT""!KKM%%c/!!#& * dD))4y1}-.YZZ#||~HC))#3%%c*c**%%d+)*UVV  &&t}}z'AB
  C%%sfdoo>    
 %i&:&:3<<>!;L&MNE ::LLE* O WWY2259:%0T"d1g>N>N=OrRSQTU 
s   #F
IB1IIc                B    S Ul         U R                  XR                  '   g rK   )r  r  r  rM   s      r.   r   "MarkdownExtensions.post_validation  s    #!%~~r2   )r  r  r  )r  zlist[str] | Noner  r]   r8   	list[str]ri   r   )r  rh   r  rh   ri   r   )r`   rh   ri   r$  rg   )rD   rj   rk   rl   rm   r/   r  rP   rd   r   ro   rp   rq   s   @r.   r  r    s]    	 &*&		#"	# 	# 		# 
	# 	##()V1 1r2   r  c                  l   ^  \ rS rSrSrS
SU 4S jjjrS rSS jr\SS j5       r	SS jr
SS jrS	rU =r$ )Pluginsi  z
Plugins config option.

A list or dict of plugins. If a plugin defines config options those are used when
initializing the plugin class.
c                   > [         TU ]  " S0 UD6  [        R                  " 5       U l        Xl        S U l        0 U l        g r   )r7   r/   r   get_pluginsinstalled_plugins	theme_keyr   plugin_cache)r-   r*  r   r@   s      r.   r/   Plugins.__init__  s8    "6"!(!4!4!6"&*;=r2   c                    Xl         g rK   )r   rM   s      r.   rP   Plugins.pre_validation   s    r2   c                   [        U[        [        [        45      (       d  [	        S5      e[
        R                  " 5       U l        [        5       U l        U R                  U5       H  u  p#U R                  X#5        M     U R
                  $ )Nz7Invalid Plugins configuration. Expected a list or dict.)r<   r   r  rE   r   r   PluginCollectionr   _instance_counter_parse_configsload_plugin_with_namespace)r-   r`   rG   r  s       r.   rd   Plugins.run_validation#  sk    %$t!455!"[\\//1;B9,,U3ID++D6 4||r2   c              #    #    [        U[        5      (       aC  UR                  5        H.  u  p#[        U[        5      (       d  [	        SU S35      eX#4v   M0     g U Hr  n[        U[        5      (       a-  [        U5      S:w  a  [	        S5      eUR                  5       u  p#OUn0 n[        U[        5      (       d  [	        SU S35      eX#4v   Mt     g 7f)Nr   z' is not a valid plugin name.r6   zInvalid Plugins configuration)r<   rE   r  r]   r   r;   r  )rF   r`   rG   r  r  s        r.   r2  Plugins._parse_configs,  s     eT"""[[]	!$,,)AdV3P*QRRi +
 dD))4yA~-.MNN $ID#DC!$,,)AdV3P*QRRi s   CCc                R   SU;   a  UR                  S5      (       a  USS  nOtU R                  (       ac  U R                  (       aR  U R                  U R                     n[        U[        5      (       d  US   nU(       a  U SU 3nX@R
                  ;   a  UnXR                  X5      4$ )Nr2  r6   rG   )r"  r*  r   r<   r]   r)  load_plugin)r-   rG   rN   current_themeexpanded_names        r.   r3  "Plugins.load_plugin_with_namespace@  s    $;s##ABx ~~$,, $T^^ <!-55$1&$9M '4oQtf$=M$(>(>>,&&t455r2   c           	     "  ^ TU R                   ;  a  [        ST S35      eU=(       d    0 n[        U[        5      (       d  [        ST S35      eU R                  T==   S-  ss'   U R                  T   nTnUS:  a  USU 3-  nU R
                  R                  U5      nUc  U R                   T   R                  5       n[        U[        R                  5      (       dZ  [        UR                   SUR                   S[        R                  R                   S[        R                  R                   35      eU" 5       n[        US	5      (       d  [        US
5      (       a  XPR
                  U'   US:  a1  [        USS5      (       d  U R                  R!                  ST S35        SU;   a  [#        S UR$                   5       5      (       db  UR'                  S5      n[        U[(        5      (       d  [        ST S[+        U5       35      eU(       d  [,        R/                  SU S35        U$ UR1                  X R2                  (       a  U R2                  R4                  OS 5      u  pU	 Hc  n
[        U
[6        5      (       a#  U R                  R!                  SU SU
 35        M;  U
u  pU R                  R!                  SU SU SU 35        Me     SR9                  U4S jU 5       5      nU(       a  [        U5      eXPR                  U'   U$ )NzThe "z" plugin is not installedz Invalid config options for the 'z	' plugin.r6   z #r   z must be a subclass of 
on_startupon_shutdownsupports_multiple_instancesFPlugin 'z|' was specified multiple times - this is likely a mistake, because the plugin doesn't declare `supports_multiple_instances`.enabledc              3  0   #    U  H  oS    S:H  v   M     g7f)r   rA  Nr,   )rW   pairs     r.   rZ   &Plugins.load_plugin.<locals>.<genexpr>u  s     *aL`D7i+?L`s   z3' option 'enabled': Expected boolean but received: z&' is disabled in the config, skipping.rV   
' option '
c              3  >   >#    U  H  u  pS T SU SU 3v   M     g7f)r@  rE  rV   Nr,   )rW   rX   rY   rG   s      r.   rZ   rD    s*     "c\bPXPSXdV:cU#cU#K\bs   )r)  r   r<   rE   r1  r+  r   loadr=   r   
BasePluginrj   rD   hasattrr   r^   r  anyconfig_schemer  rf   r:   logdebugload_configr   rL   r]   r  )r-   rG   rN   inst_number	inst_nameplugin
plugin_clsrA  errorswarnswarningrX   rY   errors_messages    `            r.   r8  Plugins.load_pluginQ  s   t---!E$/H"IJJ2&$''!$DTF)"TUUt$)$,,T2	?2k]++I""&&y1>//5::<Jj'*<*<==%!,,-Qz/B/B.C D**556a8J8J8S8S7TV 
  \Fv|,,0N0N/5!!),?763PRW#X#XMM  4& !T T s*aFL`L`*a'a'ajj+Ggt,,%tf$WX\]dXeWfg  		HYK/UVW**\\DLL11t
 G'3''$$x	{#gY%GH"$$x	{*SESE%RS  "c\b"cc!.11"(Yr2   )r   r1  r)  r+  r   r*  rK   )r*  r&   ri   r   )r`   rh   ri   zplugins.PluginCollection)r`   zlist | tuple | dictri   zIterator[tuple[str, dict]])rG   r]   ri   ztuple[str, plugins.BasePlugin])rG   r]   ri   zplugins.BasePlugin)rD   rj   rk   rl   rm   r/   rP   rd   r  r2  r3  r8  ro   rp   rq   s   @r.   r&  r&    s?    > >    &6"< <r2   r&  c                  z   ^  \ rS rSrSrSU 4S jjrSS jrSS jr\R                  " SS9S 5       r
SS	 jrS
rU =r$ )Hooksi  z?A list of Python scripts to be treated as instances of plugins.c                <   > [         TU ]  5         / U l        Xl        g rK   )r7   r/   r8   plugins_key)r-   r\  r@   s     r.   r/   Hooks.__init__  s    &r2   c                h    [        [        SS95      U l        U R                  R                  X5        g r  )r   r  _base_optionrP   rM   s      r.   rP   Hooks.pre_validation  s(    'D(9:((:r2   c                   U R                   R                  U5      nU R                  R                  U R                   R                  5        [	        U[
        5      (       d   e0 n[        X5       H  u  pEU R                  XE5      X4'   M     U$ rK   )r_  r*   r^   r_   r<   r   r   
_load_hook)r-   r`   pathshooksrG   r4  s         r.   rd   Hooks.run_validation  st    !!**51T..778%&&&&e+JD//$5EK ,r2   N)maxsizec                @   SS K nUR                  R                  X5      nUc  [        SU S35      eUR                  R	                  U5      nU[
        R                  U'   UR                  c  [        SU S35      e[
        R                  R                  5       n[
        R                  R                  S[        R                  R                  U5      5         UR                  R                  U5        U[
        R                  S S & U$ ! U[
        R                  S S & f = f)Nr   zCannot import path 'z' as a Python module)importlib.utilutilspec_from_file_locationr   module_from_specr  modulesloaderr4  copyr  r  r  exec_module)r-   rG   r4  	importlibspecr  old_sys_paths          r.   rb  Hooks._load_hook  s    ~~55dA<!$8>R"STT006"D;;!$8>R"STTxx}}277??401	'KK##F+&CHHQK 'CHHQKs   D Dc                ^    XR                      nX   R                  5        H	  u  pEXSU'   M     g rK   )r\  r  )r-   rN   rO   r   rG   hooks         r.   r   Hooks.post_validation  s/    ))* *002JD DM 3r2   )r_  r8   r\  )r\  r]   ri   r   rg   )r`   rh   ri   zMapping[str, Any])rD   rj   rk   rl   rm   r/   rP   rd   r>   	lru_cacherb  r   ro   rp   rq   s   @r.   rZ  rZ    s>    I'
; & '(! !r2   rZ  c                  "    \ rS rSrSrSS jrSrg)PathSpeci  z.A path pattern based on gitignore-like syntax.c                   [        U[        5      (       d  [        S[        U5       S35      e [        R
                  R                  R                  UR                  5       S9$ ! [         a  n[        [        U5      5      eS nAff = f)Nz#Expected a multiline string, but a r   )lines)
r<   r]   r   r:   pathspec	gitignoreGitIgnoreSpec
from_lines
splitlinesr   r  s      r.   rd   PathSpec.run_validation  sv    %%%!$GU}T_"`aa	*%%33>>UEUEUEW>XX 	*!#a&))	*s   4A$ $
B.BBr,   N)r`   rh   ri   z pathspec.gitignore.GitIgnoreSpecr)  r,   r2   r.   ry  ry    s
    8*r2   ry  )[
__future__r   r>   r$  loggingr  r  r  r  typesr^   collectionsr   r   r   typingr   r   r	   r
   r   r   r   r   r   r   r   r   r   urllib.parser   rx  r   r   r  r|  pathspec.gitignoremkdocsr   r   r   mkdocs.config.baser   r   r   r   r   mkdocs.exceptionsr   r    r!   	getLoggerrD   rM  r$   rs   r   r   r]   r   r   r   r   r   r  r  r+  r<  rN  rf  rr  r  r  r  r  r  r  r  r  r  r  r  r  r  r0  r&  
ModuleTyperZ  r}  r~  ry  r,   r2   r.   <module>r     s"   "    	  
    + !    + -    ( (  1CL\0
!F
#%5j%A FR-9Z0'*2E -.&*%5a%8 &*R43'!*.tAw7 43n6'!*.tCF|< 6r'+l+ ',#71:)!, #DWQZ+A. 6D-! D-N*j *+"?3 +:"]
S
! "]J%-wqz+E!T'N; %-P#&c #&L$d3i $.!&s+ !H)tCy ).&tCy &2
 c  !+c" !0c >5+U[[) 5+p.:
 .:b<gaj*1- <v .6"5)93)>#?@ 6S1+DI6 S1l| !9!9: |~.!T%"2"234 .!b	* 2 2 @ @A 	*r2   