Ë
    Ìi  ã                   ó(   — d dl Z d dlZd dlmZ dd„Zy)é    N)ÚOrderedDictc           	      ón  ‡‡‡‡— |�‰rt        d«      ‚‰r|�t        d«      ‚t        |d«      }d|dœŠ‰j                  |«       | j                  D �cg c]  }|j                  ‘Œ c}Šd}dŠ	 t        |d«      r|Šd}n™t
        j                  j                  |«      rnt
        j                  j                  t
        j                  j                  |«      «      s2t        j                  t
        j                  j                  |«      «       t        |d	«      Šˆˆˆfd
„}	|�›t        «       }
| j                  D ]y  }|r	 ||«      }nt        ||   «      }||
v rt        dt        |«      z  «      ‚t        ˆfd„t        |«      D «       «      }t        t!        |j#                  «       |«      «      |
|<   Œ{  |	|
«       nÄ‰rX| j                  D ]H  }t        ˆfd„t        |«      D «       «      } |	t        t!        |j#                  «       |«      «      «       ŒJ njg }
| j                  D ]Q  }t        ˆfd„t        |«      D «       «      }|
j%                  t        t!        |j#                  «       |«      «      «       ŒS  |	|
«       |r‰�‰j'                  «        yyyc c}w # |r‰�‰j'                  «        w w w xY w)a�  
    Write this table to a JSON file or file-like object.

    :code:`kwargs` will be passed through to the JSON encoder.

    :param path:
        File path or file-like object to write to.
    :param key:
        If specified, JSON will be output as an hash instead of a list. May
        be either the name of a column from the this table containing
        unique values or a :class:`function` that takes a row and returns
        a unique value.
    :param newline:
        If `True`, output will be in the form of "newline-delimited JSON".
    :param indent:
        If specified, the number of spaces to indent the JSON for
        formatting.
    Nz.key and newline may not be specified together.z1newline and indent may not be specified together.Ú__call__F)Úensure_asciiÚindentTÚwriteÚwc                 ó\   •— t        j                  | ‰fi ‰¤Ž ‰r‰j                  d«       y y )Nú
)ÚjsonÚdumpr   )ÚdataÚfÚjson_kwargsÚnewlines    €€€úT/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/agate/table/to_json.pyÚ	dump_jsonzto_json.<locals>.dump_json7   s)   ø€ Ü�I‰I�d˜AÑ- Ò-áØ—‘˜•ð ó    z)Value %s is not unique in the key column.c              3   ó:   •K  — | ]  \  }} ‰|   |«      –— Œ y ­w©N© ©Ú.0ÚiÚdÚ
json_funcss      €r   ú	<genexpr>zto_json.<locals>.<genexpr>J   ó    øè ø€ ÒK±D°A°q˜}˜z¨!™}¨Q×/ÑKùó   ƒc              3   ó:   •K  — | ]  \  }} ‰|   |«      –— Œ y ­wr   r   r   s      €r   r   zto_json.<locals>.<genexpr>P   r   r   c              3   ó:   •K  — | ]  \  }} ‰|   |«      –— Œ y ­wr   r   r   s      €r   r   zto_json.<locals>.<genexpr>W   r   r   )Ú
ValueErrorÚhasattrÚupdateÚ_column_typesÚjsonifyÚosÚpathÚdirnameÚexistsÚmakedirsÚopenr   Ú_rowsÚstrÚtupleÚ	enumerateÚzipÚkeysÚappendÚclose)Úselfr(   Úkeyr   r   ÚkwargsÚkey_is_row_functionÚcr4   r   ÚoutputÚrowÚkÚvaluesr   r   r   s      `          @@@r   Úto_jsonr>      sU  û€ ð& €™7ÜÐIÓJÐJá�6Ð%ÜÐLÓMÐMä! # zÓ2Ðð Øñ€Kð ×Ñ�vÔà%)×%7Ñ%7Ö8 �!—)“)Ò8€Jà€EØ€Að/Ü�4˜Ô!ØˆAØ‰Eä�w‰w�‰˜tÔ$¬R¯W©W¯^©^¼B¿G¹G¿O¹OÈDÓ<QÔ-RÜ—‘œBŸG™GŸO™O¨DÓ1Ô2Ü�T˜3“ˆAö	ð ˆ?Ü “]ˆFà—z‘zò 
A�Ù&Ù˜C›‘Aä˜C ™H›�Aà˜‘;Ü$Ð%PÔSVÐWXÓSYÑ%YÓZÐZäÓK¼IÀc»NÔKÓK�Ü'¬¨C¯H©H«J¸Ó(?Ó@��q’	ð
Añ �fÕáØ—z‘zò @�ÜÓK¼IÀc»NÔKÓK�Ùœ+¤c¨#¯(©(«*°fÓ&=Ó>Õ?ñ@ð
 ˆFà—z‘zò D�ÜÓK¼IÀc»NÔKÓK�Ø—‘œk¬#¨c¯h©h«j¸&Ó*AÓBÕCðDñ �fÔá�Q�]Ø�G‰G�Ið #ˆ5ùòg 9øñf �Q�]Ø�G‰G�Ið #ˆ5ús   ÁJÁ.HJ ÊJ4)NFN)r   r'   Úcollectionsr   r>   r   r   r   ú<module>r@      s   ðÛ Û 	Ý #ôWr   