+
    yjG                     X    ^ RI t ^ RIHt ^RIHt ^RIHt ^RIHt Rt ! R R]4      t	R# )	    N)unset_value)widgets)Field)UnboundField	FieldListc                      a a ] tR t^t oRt]P                  ! 4       tRV 3R llt]	R3R lt
R tRR ltR tR]	R3R lt]	3R	 ltR
 tR tR tR t]R 4       tRtVtV ;t# )r   a  
Encapsulate an ordered list of multiple instances of the same field type,
keeping data as a list.

>>> authors = FieldList(StringField('Name', [validators.DataRequired()]))

:param unbound_field:
    A partially-instantiated field definition, just like that would be
    defined on a form directly.
:param min_entries:
    if provided, always have at least this many entries on the field,
    creating blank ones if the provided input does not specify a sufficient
    amount.
:param max_entries:
    accept no more than this many entries as input, even if more exist in
    formdata.
:param separator:
    A string which will be suffixed to this field's name to create the
    prefix to enclosed list entries. The default is fine for most uses.
Nc                P  < \         S	V `  ! W#3R V/VB  V P                  '       d   \        R4      h\	        V\
        4      '       g   Q R4       hWn        W@n        WPn        RV n	        VP                  RR4      V n        W`n        VP                  P                  RR4      V n        R# )	defaultRFieldList does not accept any filters. Instead, define them on the enclosed field.z(Field must be unbound, not a field class_prefix 	separator-N)super__init__filters	TypeError
isinstancer   unbound_fieldmin_entriesmax_entries
last_indexgetr   
_separatorkwargs_field_separator)
selfr   label
validatorsr   r   r   r
   r   	__class__s
   &&&&&&&&,G/var/www/html/2rare/lib/python3.14/site-packages/wtforms/fields/list.pyr   FieldList.__init__$   s     	FGFvF<<</  <
 
 	65	6 
 +&&zz)R0# - 4 4 8 8c J    c                   V'       d   \        R 4      h. V n        V\        J g	   V'       g    V P                  4       pW n        V'       d   \        \        V P                  V P                  V4      4      4      pV P                  '       d   VRV P                   p\        V4      pV F"  p \        V4      pV P                  WVR7       K$  	  MV F  pV P                  W4       K  	  \        V P                  4      V P                  8  d   V P                  V4       K7  R#   \          d    T P                  p Li ; i  \         d
    \        p Li ; i)r   N)index)r   entriesr   r
   object_datasortedset_extract_indicesnamer   iternextStopIteration
_add_entrylenr   )r   formdatadataextra_filtersindicesidatar&   obj_datas   &&&&    r"   processFieldList.process@   s(   / 
 ;d$||~  S!6!6tyy(!KLMG!"4D$4$45JE +#E{H %@ ! !3 ! $,,$"2"22OOH% 3+  $||$ % +*H+s#   D" ,D?"D<;D<?EEc              #  
  "   \        V4      ^,           pV Ff  pVP                  V4      '       g   K  WCR P                  V P                  ^4      ^ ,          pVP	                  4       '       g   KY  \        V4      x  Kh  	  R# 5i)z
Yield indices of any keys with given prefix.

formdata must be an object which will produce keys when iterated.  For
example, if field 'foo' contains keys 'foo-0-bar', 'foo-1-baz', then
the numbers 0 and 1 will be yielded, but not necessarily in order.
N)r1   
startswithsplitr   isdigitint)r   prefixr2   offsetks   &&&  r"   r+   FieldList._extract_indicesc   sb      VqA||F##gJ$$T%:%:A>qA99;;a&L	 s   ,B8B0Bc                   . V n         V P                   F9  pVP                  V4       V P                   P                  VP                   4       K;  	  \        ;QJ d&    R V P                    4       F  '       g   K   RM	  RM! R V P                    4       4      '       g   . V n         \
        P                  ! V P                  V4      pV P                  W4       \        V P                   4      ^ 8H  # )z
Validate this FieldList.

Note that FieldList validation differs from normal field validation in
that FieldList validates all its enclosed fields first before running any
of its own validators.
c              3   $   "   T F  qx  K  	  R # 5iN ).0xs   & r"   	<genexpr>%FieldList.validate.<locals>.<genexpr>   s     *k1ks   TF)
errorsr'   validateappendany	itertoolschainr    _run_validation_chainr1   )r   formextra_validatorssubfieldrP   s   &&&  r"   rL   FieldList.validater   s      Hd#KKx/ % s*dkk*sss*dkk***DK1AB""4/4;;1$$r$   c                   \        WR 4      p \        V4      p\        P                  ! V\        P
                  ! R 4      4      p\        R\        3/ 4      p. p\        V P                  V4       F?  w  rV! 4       p
Wn
        VP                  V
R4       VP                  V
P                  4       KA  	  \        WV4       R #   \         d    \        . 4      p Li ; i)N_faker3   )getattrr-   r   rO   rP   repeattypeobjectzipr'   r3   populate_objrM   setattr)r   objr,   valuesivalues
candidatesrW   outputfieldr3   fake_objs   &&&        r"   r]   FieldList.populate_obj   s    D)	6lG __Wi.>.>t.DE
Wvi,t||Z8KEwH Mx0MM(--(	 9 	6"  	2hG	s   B? ?CCc           	         V P                   '       d,   \        V P                  4      V P                   8  g   Q R 4       hVf   V P                  ^,           pW0n        V P                   V P
                   V 2pV P                   V P
                   V 2pV P                  P                  RVV P                  VV P                  V P                  R7      pVP                  W4       V P                  P                  V4       V# )z?You cannot have more than max_entries entries in this FieldListN)rR   r,   r?   id_metatranslations)r   r1   r'   r   
short_namer   rh   r   bindr   meta_translationsr8   rM   )r   r2   r3   r&   r,   rh   rd   s   &&&&   r"   r0   FieldList._add_entry   s       C$58H8H$H	ML	MH=OOa'E//"4??"3E7;y)%1""''<<))++ ( 
 	h%E"r$   c                &    V P                  VR7      # )z
Create a new entry with optional default data.

Entries added in this way will *not* receive formdata however, and can
only receive object data.
)r3   )r0   )r   r3   s   &&r"   append_entryFieldList.append_entry   s     D))r$   c                l    V P                   P                  4       pV ;P                  ^,          un        V# )z4Removes the last entry from the list and returns it.)r'   popr   )r   entrys   & r"   	pop_entryFieldList.pop_entry   s'      "1r$   c                ,    \        V P                  4      # rE   )r-   r'   r   s   &r"   __iter__FieldList.__iter__   s    DLL!!r$   c                ,    \        V P                  4      # rE   )r1   r'   ry   s   &r"   __len__FieldList.__len__   s    4<<  r$   c                (    V P                   V,          # rE   )r'   )r   r&   s   &&r"   __getitem__FieldList.__getitem__   s    ||E""r$   c                V    V P                    Uu. uF  qP                  NK  	  up# u upi rE   )r'   r3   )r   fs   & r"   r3   FieldList.data   s      $-1---s   &)
r   r   r   r'   rK   r   r   r   r(   r   )NNr   Nr   rF   )rF   )__name__
__module____qualname____firstlineno____doc__r   
ListWidgetwidgetr   r   r8   r+   rL   r]   r0   rq   rv   rz   r}   r   propertyr3   __static_attributes____classdictcell____classcell__)r!   __classdict__s   @@r"   r   r      s     * !FK8 &1 !&F!%.#$ #'[ * !, *"!# . . .r$   )r   )
rO   wtforms.utilsr   r   r   corer   r   __all__r   rF   r$   r"   <module>r      s'     %   
~. ~.r$   