Ë
    ûûàgö  ã                   ó2   — d Z ddlZddlmZ d„ Zdd„Zdd„Zy)	z&
Helpers for dealing with HTML input.
é    N)ÚMultiValueDictc                 ó   — t        | d«      S )NÚgetlist)Úhasattr)Ú
dictionarys    úW/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/rest_framework/utils/html.pyÚis_html_inputr	   	   s   € ô �:˜yÓ)Ð)ó    c                 ó¼  — i }t        j                  dt        j                  |«      z  «      }| j                  «       D ]x  \  }}|j	                  |«      }|sŒ|j                  «       \  }}	t        |«      }|	s|||<   Œ@t        |j                  |«      t        «      r	|||   |	<   Œht        |	|gi«      ||<   Œz |rt        |«      D �
cg c]  }
||
   ‘Œ	 c}
S |S c c}
w )ad  
    Used to support list values in HTML forms.
    Supports lists of primitives and/or dictionaries.

    * List of primitives.

    {
        '[0]': 'abc',
        '[1]': 'def',
        '[2]': 'hij'
    }
        -->
    [
        'abc',
        'def',
        'hij'
    ]

    * List of dictionaries.

    {
        '[0]foo': 'abc',
        '[0]bar': 'def',
        '[1]foo': 'hij',
        '[1]bar': 'klm',
    }
        -->
    [
        {'foo': 'abc', 'bar': 'def'},
        {'foo': 'hij', 'bar': 'klm'}
    ]

    :returns a list of objects, or the value specified in ``default`` if the list is empty
    z^%s\[([0-9]+)\](.*)$)ÚreÚcompileÚescapeÚitemsÚmatchÚgroupsÚintÚ
isinstanceÚgetÚdictr   Úsorted)r   ÚprefixÚdefaultÚretÚregexÚfieldÚvaluer   ÚindexÚkeyÚitems              r   Úparse_html_listr       sÓ   € ðF €CÜ�J‰JÐ.´·±¸6Ó1BÑBÓC€EØ"×(Ñ(Ó*ò 8‰ˆˆuØ—‘˜EÓ"ˆÙØØ—\‘\“^‰
ˆˆsÜ�E“
ˆÙØˆC�ŠJÜ˜Ÿ™ ›¬Ô-Ø#ˆC�‰J�sŠOä'¨¨u¨g¨Ó7ˆC�ŠJð8ñ 36¤&¨£+Ö.˜$ˆC�‹IÒ.ÐB¸7ÐBùÒ.s   ÃCc                 ó  — t        «       }t        j                  dt        j                  |«      z  «      }| D ]L  }|j	                  |«      }|sŒ|j                  «       d   }| j                  |«      }|j                  ||«       ŒN |S )a#  
    Used to support dictionary values in HTML forms.

    {
        'profile.username': 'example',
        'profile.email': 'example@example.com',
    }
        -->
    {
        'profile': {
            'username': 'example',
            'email': 'example@example.com'
        }
    }
    z
^%s\.(.+)$r   )r   r   r   r   r   r   r   Úsetlist)r   r   r   r   r   r   r   r   s           r   Úparse_html_dictr#   E   s€   € ô  Ó
€CÜ�J‰J�}¤r§y¡y°Ó'8Ñ8Ó9€EØò  ˆØ—‘˜EÓ"ˆÙØØ�l‰l‹n˜QÑˆØ×"Ñ" 5Ó)ˆØ�‰�C˜Õð ð €Jr
   )Ú N)r$   )Ú__doc__r   Údjango.utils.datastructuresr   r	   r    r#   © r
   r   ú<module>r(      s#   ðñó 
å 6ò*ó3Côlr
   