+
    TjHB                         ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
 ^ RIHt ^RIHtHtHt ^RIHt  ! R	 R
]4      t ! R R4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      tR tR tR# )    )Iterable)wraps)import_module)getfullargspecunwrap)conditional_escape)lazy_annotations)NodeTemplatetoken_kwargs)TemplateSyntaxErrorc                       ] tR t^tRtR# )InvalidTemplateLibrary N)__name__
__module____qualname____firstlineno____static_attributes__r       L/var/www/idalgo/venv/lib/python3.14/site-packages/django/template/library.pyr   r      s    r   r   c                   h   a  ] tR t^t o RtR tRR ltR tRR ltR t	RR lt
RR	 ltRR
 ltRtV tR# )Libraryz
A class for registering template tags and filters. Compiled filter and
template tag functions are stored in the filters and tags attributes.
The filter, simple_tag, and inclusion_tag methods provide a convenient
way to register callables as tags.
c                "    / V n         / V n        R # Nfilterstags)selfs   &r   __init__Library.__init__   s    	r   Nc                   a a Sf   Vf   S P                   # Se0   Vf,   \        S4      '       d   S P                  S4      # VV 3R lpV# Se   Ve   VS P                  S&   V# \        RS: RV: R24      h)Nc                 (   < SP                  SV 4      # r   )tag)funcnamer   s   &r   decLibrary.tag.<locals>.dec'   s    88D$//r   z'Unsupported arguments to Library.tag: (, ))tag_functioncallabler   
ValueError)r   r&   compile_functionr'   s   ff& r   r$   Library.tag   s    <,4$$$"2":~~((..0 
"2">.DIIdO##)+ r   c                6    WP                   VP                  &   V# r   )r   r   )r   r%   s   &&r   r+   Library.tag_function5   s    #'		$-- r   c                v  a aa Sf   Vf
   VV 3R lpV# Se3   Vf/   \        S4      '       d   S P                  ! S3/ SB # VVV 3R lpV# SeY   VeU   VS P                  S&   R F6  pVS9   g   K  SV,          p\        W%V4       \        \	        V4      WV4       K8  	  SVn        V# \        RS: RV: R24      h)zq
Register a callable as a template filter. Example:

@register.filter
def lower(value):
    return value.lower()
c                 *   < SP                   ! V 3/ SB # r   )filter_function)r%   flagsr   s   &r   r'   Library.filter.<locals>.decC   s    ++D:E::r   c                 ,   < SP                   ! SV 3/ SB # r   )filter)r%   r5   r&   r   s   &r   r'   r6   N   s    ;;tT;U;;r   z*Unsupported arguments to Library.filter: (r)   r*   )expects_localtimeis_safeneeds_autoescape)r,   r4   r   setattrr   _filter_namer-   )r   r&   filter_funcr5   r'   attrvalues   ff&l   r   r8   Library.filter9   s     <K/; J+"5~~++D:E::< 
+"9!,DLLL5=!$KEKu5 F;/= M (,K$& r   c                >    V P                   ! VP                  V3/ VB # r   )r8   r   )r   r%   r5   s   &&,r   r4   Library.filter_functione   s    {{4==$8%88r   c                l   a aa VV V3R lpVf   V# \        V4      '       d	   V! V4      # \        R4      h)z
Register a callable as a compiled template tag. Example:

@register.simple_tag
def hello(*args, **kwargs):
    return 'world'
c           
      4  <a aaaaaaa	 \        4       ;_uu_ 4        \        \        S 4      4      w  ooo	ooopR R R 4       S
;'       g    S P                  o\	        S 4      VV VVVVVVV	3	R l4       pSP                  SV4       S #   + '       g   i     LV; i)Nc                    <	 VP                  4       R ,          pRp\        V4      ^8  d   VR,          R8X  d   VR,          pVRR p\        V VSSSSS	S
SS4
      w  rE\        SSWEV4      # )   NNNas)split_contentslen
parse_bits
SimpleNode)parsertokenbits
target_varargskwargsdefaultsr%   function_namekwonlykwonly_defaultsparamstakes_contextvarargsvarkws   &&    r   compile_func5Library.simple_tag.<locals>.dec.<locals>.compile_func~   s    ++-b1!
t9>d2h$&6!%bJ9D)#!!  "$tZPPr   r	   r   r   r   r   r$   )r%   _r^   rV   rW   rX   rY   rZ   r\   r]   r&   r   r[   s   f  @@@@@@@r   r'   Library.simple_tag.<locals>.decq   s    !## #6$<0# $ !11DMMM4[Q Q Q( HH]L1KE $#s   BB	z(Invalid arguments provided to simple_tagr,   r-   )r   r%   r[   r&   r'   s   f&ff r   
simple_tagLibrary.simple_tagh   s4    #	J <Jd^^t9GHHr   c                p   a aaa VVV V3R lpVf   V# \        V4      '       d	   V! V4      # \        R4      h)z
Register a callable as a compiled block template tag. Example:

@register.simple_block_tag
def hello(content):
    return 'world'
c                 H  <a aaaaaaa	 \        4       ;_uu_ 4        \        \        S 4      4      w  ooo	ooopR R R 4       S;'       g    S P                  oS
f   RS 2o
\	        S 4      VV
V VVVVVVV	3
R l4       pSP                  SV4       S #   + '       g   i     L`; i)Nendc                    <
 SP                  4       pS'       d2   \        V4      ^8  d   V^,          R8X  d   V^ M8\        S: R24      hV'       d   V^ ,          R8X  d   V^  M\        RS R24      hVP                  4       R,          pRp\        V4      ^8  d   VR,          R8X  d   VR	,          pVRR pV P	                  S	34      pV P                  4        \        V VVSSSSSSS4
      w  rg\        VS
SWgV4      # )
   contentzv is decorated with takes_context=True so it must have a first argument of 'context' and a second argument of 'content''z)' must have a first argument of 'content'rG   NrI   rJ   rK   )copyrM   r   rL   parsedelete_first_tokenrN   SimpleBlockNode)rP   rQ   
tag_paramsrR   rS   nodelistrT   rU   rV   end_namer%   rW   rX   rY   rZ   r[   r\   r]   s   &&      r   r^   ;Library.simple_block_tag.<locals>.dec.<locals>.compile_func   s!   #[[]
 :!+
10J&qM1,/ 04 4 
  JqMY$>"1-M?*ST  ++-b1!
t9>d2h$&6!%bJ9D!<<4))+)#!!  'dM4 r   r`   )r%   ra   r^   rV   rW   rX   rY   rZ   r\   r]   rs   r&   r   r[   s   f  @@@@@@@r   r'   %Library.simple_block_tag.<locals>.dec   s    !## #6$<0# $ !11DMMM 04[+ + +Z HH]L1K} $#s   BB!	z.Invalid arguments provided to simple_block_tagrc   )r   r%   r[   r&   rs   r'   s   f&fff r   simple_block_tagLibrary.simple_block_tag   s;    @	 @	D <Jd^^t9MNNr   c                    a aaa VVV V3R lpV# )z
Register a callable as an inclusion tag:

@register.inclusion_tag('results.html')
def show_results(poll):
    choices = poll.choice_set.all()
    return {'choices': choices}
c                 6  <a aaaaaaa	 \        4       ;_uu_ 4        \        \        S 4      4      w  ooo	ooopR R R 4       S;'       g    S P                  o\	        S 4      VV
V VVVVVVV	3
R l4       pSP                  SV4       S #   + '       g   i     LW; i)Nc                 |   <
 VP                  4       R ,          p\        V VSSSSS	S
SS4
      w  r4\        SSVVS4      # )rG   )rL   rN   InclusionNode)rP   rQ   rR   rT   rU   rV   filenamer%   rW   rX   rY   rZ   r[   r\   r]   s   &&   r   r^   8Library.inclusion_tag.<locals>.dec.<locals>.compile_func
  s^    ++-b1)#!!  %! r   r`   )r%   ra   r^   rV   rW   rX   rY   rZ   r\   r]   r|   r&   r   r[   s   f  @@@@@@@r   r'   "Library.inclusion_tag.<locals>.dec   s    !## #6$<0# $ !11DMMM4[  , HH]L1KI $#s   BB	r   )r   r|   r%   r[   r&   r'   s   ff&ff r   inclusion_tagLibrary.inclusion_tag   s    %	 %	N 
r   r   )NN)NNN)NNNN)r   r   r   r   __doc__r    r$   r+   r8   r4   rd   rv   r   r   __classdictcell____classdict__s   @r   r   r      s=     0*X95InROh1 1r   r   c                   0   a  ] tR tRt o RtR tR tRtV tR# )TagHelperNodei'  z
Base class for tag helper nodes such as SimpleNode and InclusionNode.
Manages the positional and keyword arguments to be passed to the decorated
function.
c                6    Wn         W n        W0n        W@n        R # r   )r%   r[   rT   rU   )r   r%   r[   rT   rU   s   &&&&&r   r    TagHelperNode.__init__.  s    	*	r   c                   V P                    Uu. uF  q"P                  V4      NK  	  ppV P                  '       d   V.VOpV P                  P	                  4        UUu/ uF  w  rEWEP                  V4      bK  	  pppW63# u upi u uppi r   )rT   resolver[   rU   items)r   contextvarresolved_argskvresolved_kwargss   &&     r   get_resolved_arguments$TagHelperNode.get_resolved_arguments4  s    9=C#W-C$5}5M=A[[=N=N=PQ=PTQ1ii00=PQ--	 D Rs   B B)rT   r%   rU   r[   N)	r   r   r   r   r   r    r   r   r   r   s   @r   r   r   '  s     . .r   r   c                   <   a a ] tR tRt oRtV 3R ltR tRtVtV ;t	# )rO   i<  c                4   < \         SV `  WW44       WPn        R # r   )superr    rS   )r   r%   r[   rT   rU   rS   	__class__s   &&&&&&r   r    SimpleNode.__init__?  s    d;$r   c                    V P                  V4      w  r#V P                  ! V/ VB pV P                  e   WAV P                  &   R# VP                  '       d   \	        V4      pV# )N )r   r%   rS   
autoescaper   )r   r   r   r   outputs   &&   r   renderSimpleNode.renderC  s\    )-)D)DW)M&M=_=??&'-DOO$'/Fr   )rS   r   )
r   r   r   r   child_nodelistsr    r   r   r   __classcell__r   r   s   @@r   rO   rO   <  s     O% r   rO   c                   >   a a ] tR tRt oV 3R ltV 3R ltRtVtV ;t# )rp   iN  c                4   < \         SV `  ! V/ VB  Wn        R # r   )r   r    rr   )r   rr   rT   rU   r   s   &&*,r   r    SimpleBlockNode.__init__O  s    $)&) r   c                   < \         SV `  V4      w  r#TP                  V P                  '       d   ^M^ V P                  P                  V4      4       W#3# )rH   )r   r   insertr[   rr   r   )r   r   r   r   r   s   &&  r   r   &SimpleBlockNode.get_resolved_argumentsS  sQ    ).)G)P& 	###ADMM,@,@,I	
 --r   )rr   )	r   r   r   r   r    r   r   r   r   r   s   @@r   rp   rp   N  s     !	. 	.r   rp   c                   8   a a ] tR tRt oV 3R ltR tRtVtV ;t# )r{   i_  c                4   < \         SV `  WW44       WPn        R # r   )r   r    r|   )r   r%   r[   rT   rU   r|   r   s   &&&&&&r   r    InclusionNode.__init__`  s    d; r   c                :   V P                  V4      w  r#V P                  ! V/ VB pVP                  P                  V 4      pVEf   \	        V P
                  \        4      '       d   V P
                  pM\	        \        V P
                  RR4      \        4      '       d   V P
                  P                  pM\	        V P
                  \        4      '       gQ   \	        V P
                  \        4      '       d1   VP                  P                  P                  V P
                  4      pM/VP                  P                  P                  V P
                  4      pWQP                  V &   VP                  V4      pVP                  R4      pVe   WvR&   VP                  V4      # )z
Render the specified template and context. Cache the template object
in render_context to avoid reparsing and loading when used in a for
loop.
Ntemplate
csrf_token)r   r%   render_contextget
isinstancer|   r   getattrr   strr   engineselect_templateget_templatenewr   )r   r   r   r   _dicttnew_contextr   s   &&      r   r   InclusionNode.renderd  s9    *.)D)DW)M&		=<O<""&&t,9$--22MMGDMM:tDhOOMM**s33
x9 9 $$++;;DMMJ$$++88G+,""4(kk%( [[.
!(2%xx$$r   )r|   )	r   r   r   r   r    r   r   r   r   r   s   @@r   r{   r{   _  s     !% %r   r{   c
           
        V'       d3   V'       d   V^ ,          R8X  d   VR,          pM\        RV	,          4      h. p
/ p\        V4      pV Uu. uF  q'       d	   W9  g   K  VNK  	  ppV F  p\        V.V 4      pV'       d   VP                  4       w  ppVV9  d    VV9  d   Vf   \        RV	: RV: R24      hVV9   d   \        RV	: RV: R24      hVV\	        V4      &   VV9   d   VP                  V4       K  VV9   d   VP                  V4       K  K  V'       d   \        RV	,          4      hV
P                  V P                  V4      4        VP                  ^ 4       K  	  Ve   VR\        V4      )  pV'       g	   V'       d0   \        RV	: R
RP                  R W,            4       4      : 24      hW3# u upi   \         d    Tf   \        R	T	,          4      h EK  i ; i)z
Parse bits for template tag helpers simple_tag and inclusion_tag, in
particular by detecting syntax errors and by extracting positional and
keyword arguments.
r   rG   zW'%s' is decorated with takes_context=True so it must have a first argument of 'context'Nrl   z(' received unexpected keyword argument 'z1' received multiple values for keyword argument 'zH'%s' received some positional argument(s) after some keyword argument(s)z+'%s' received too many positional argumentsz0' did not receive value(s) for the argument(s): r)   c              3   4   "   T F  pR V,          x  K  	  R# 5i)z'%s'Nr   ).0ps   & r   	<genexpr>parse_bits.<locals>.<genexpr>  s     W3Vavzz3Vs   )r   listr   popitemr   removeappendcompile_filterpop
IndexErrorrM   join)rP   rR   rZ   r\   r]   rV   rX   rY   r[   r&   rT   rU   unhandled_paramskwargunhandled_kwargsbitparamr@   s   &&&&&&&&&&        r   rN   rN     s	   " fQi9,BZF%57;<  DFF|!!%E<X6   cUF+ ==?LE5F"uF':u})HLeT  &)U$  &+s5z",, %++E2..$++E2 / )*,01  F11#67$((+M X  ,,<s8}n=+!TYYW3C3VWWY
 	
 <sT " 1IDP  's   G"GG!G,+G,c                     \        V 4      p TP                  #   \         d   p\        RT : RT: 24      hRp?ii ; i  \         d    \        RT ,          4      hi ; i)z3
Load a Library object from a template tag module.
zLInvalid template library specified. ImportError raised when trying to load 'z': Nz3Module %s does not have a variable named 'register')r   ImportErrorr   registerAttributeError)r&   modulees   &  r   import_libraryr     sn    
t$
  
$)-q2
 	

  
$ADH
 	

s    A  =8= AN)collections.abcr   	functoolsr   	importlibr   inspectr   r   django.utils.htmlr   django.utils.inspectr	   baser
   r   r   
exceptionsr   	Exceptionr   r   r   rO   rp   r{   rN   r   r   r   r   <module>r      sv    $  # * 0 1 . . +	Y 	S Sl.D .* $.j .""%M "%JUp
r   