
    hZ                    L   S SK J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
  \R                  (       a  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\5      r " S S\\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      r " S S\5      rg)    )annotationsN   )
BadRequest)HTTPException)cached_property)redirect)WSGIEnvironment   )
MapAdapter)Rule)Request)Responsec                      \ rS rSrSrSrg)RoutingException   zlSpecial exceptions that require the application to redirect, notifying
about missing urls, etc.

:internal:
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       pC:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\werkzeug/routing/exceptions.pyr   r      s    r   r   c                  P   ^  \ rS rSrSrSrSU 4S jjr  S     S	S jjrSrU =r	$ )
RequestRedirect   zRaise if the map requests a redirect. This is for example the case if
`strict_slashes` are activated and an url that requires a trailing slash.

The attribute `new_url` contains the absolute destination url.
i4  c                0   > [         TU ]  U5        Xl        g N)super__init__new_url)selfr#   	__class__s     r   r"   RequestRedirect.__init__$   s    !r   c                B    [        U R                  U R                  5      $ r    )r   r#   code)r$   environscopes      r   get_responseRequestRedirect.get_response(   s    
 dii00r   )r#   )r#   strreturnNone)NN)r)   z WSGIEnvironment | Request | Noner*   zdict | Noner.   r   )
r   r   r   r   r   r(   r"   r+   r   __classcell__r%   s   @r   r   r      sB     D 59!111 1 
	1 1r   r   c                  4   ^  \ rS rSrSrSrSU 4S jjrSrU =r$ )RequestPath0   zInternal exception.)	path_infoc                .   > [         TU ]  5         Xl        g r    )r!   r"   r5   )r$   r5   r%   s     r   r"   RequestPath.__init__5   s    "r   )r5   r-   r.   r/   )	r   r   r   r   r   	__slots__r"   r   r0   r1   s   @r   r3   r3   0   s    I# #r   r3   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )RequestAliasRedirect:   zAThis rule is an alias and wants to redirect to the canonical URL.c                :   > [         TU ]  5         Xl        X l        g r    )r!   r"   matched_valuesendpoint)r$   r=   r>   r%   s      r   r"   RequestAliasRedirect.__init__=   s    , r   )r>   r=   )r=   t.Mapping[str, t.Any]r>   r-   r.   r/   )r   r   r   r   r   r"   r   r0   r1   s   @r   r:   r:   :   s    K! !r   r:   c                  p   ^  \ rS rSrSr S         S	U 4S jjjr\S
S j5       rSS jrSS jr	Sr
U =r$ )
BuildErrorC   zWRaised if the build system cannot find a URL for an endpoint with the
values provided.
c                V   > [         TU ]  XU5        Xl        X l        X0l        X@l        g r    )r!   r"   r>   valuesmethodadapter)r$   r>   rE   rF   rG   r%   s        r   r"   BuildError.__init__H   s(     	62 r   c                8    U R                  U R                  5      $ r    )closest_rulerG   )r$   s    r   	suggestedBuildError.suggestedU   s      ..r   c                   ^  SU 4S jjnU(       a9  UR                   R                  (       a  [        UR                   R                  US9$ g )Nc           
       > [        S[        R                  " S U R                  TR                  5      R	                  5       -  S[        [        TR                  =(       d    S5      R                  U R                  5      5      -  S[        U R                  =(       a    TR                  U R                  ;   5      -  /5      $ )Ng\(\?g{Gz?r   )sumdifflibSequenceMatcherr>   ratioboolsetrE   issubset	argumentsmethodsrF   )ruler$   s    r   _score_rule,BuildError.closest_rule.<locals>._score_ruleZ   s    --dmmT]]eg 4DKK$52 6 ? ? OPP4 L1LMM	 	r   )key)rX   r   r.   float)map_rulesmax)r$   rG   rY   s   `  r   rJ   BuildError.closest_ruleY   s3    
	 w{{))w{{)){;;r   c                (   SU R                   < 3/nU R                  (       a   UR                  SU R                  < S35        U R                  (       a(  UR                  S[	        U R                  5      < 35        UR                  S5        U R
                  (       Gad  U R                   U R
                  R                   :X  Ga  U R                  (       an  U R
                  R                  bW  U R                  U R
                  R                  ;  a3  UR                  S[	        U R
                  R                  5      < S35        U R
                  R                  R                  [        U R
                  R                  =(       d    S5      5      [        U R                  R                  5       5      -
  nU(       a  UR                  S	[	        U5      < S35        O*UR                  S
U R
                  R                   < S35        SR                  U5      $ )Nz!Could not build url for endpoint z ()z with values .z Did you mean to use methods ?r   z" Did you forget to specify values z Did you mean z	 instead? )r>   rF   appendrE   sortedrK   rW   rV   unionrT   defaultskeysjoin)r$   messagemissing_valuess      r   __str__BuildError.__str__k   s   6t}}6GHI;;NNRa01;;NN]6$+++>*ABCs>>>}} 7 77KK..:4>>+A+AANN"4>>#9#9:=Q@ "&!9!9!?!?//526"((*+", "NN<VN=S<VVWX 0G0G/J)TUwwwr   )rG   r>   rF   rE   r    )
r>   r-   rE   r@   rF   z
str | NonerG   MapAdapter | Noner.   r/   )r.   Rule | None)rG   rp   r.   rq   )r.   r-   )r   r   r   r   r   r"   r   rK   rJ   rn   r   r0   r1   s   @r   rB   rB   C   sj     &* & 	
 # 
  / /$   r   rB   c                      \ rS rSrSrSrg)WebsocketMismatch   zyThe only matched rule is either a WebSocket and the request is
HTTP, or the rule is HTTP and the request is a WebSocket.
r   Nr   r   r   r   rs   rs      s    r   rs   c                  "    \ rS rSrSrSS jrSrg)NoMatch   have_match_forwebsocket_mismatchc                    Xl         X l        g r    rx   )r$   ry   rz   s      r   r"   NoMatch.__init__   s    ,"4r   N)ry   zset[str]rz   rS   r.   r/   )r   r   r   r   r8   r"   r   r   r   r   rv   rv      s    8I5r   rv   )
__future__r   rP   typingt
exceptionsr   r   utilsr   r   TYPE_CHECKING_typeshed.wsgir	   r]   r   rulesr   wrappers.requestr   wrappers.responser   	Exceptionr   r   r3   r:   LookupErrorrB   rs   rv   r   r   r   <module>r      s    "   # & # ??.*,y 1m%5 1*#" #!+ !C !; C L
 5i 5r   