
    PThX	                         d dl mZ ddlmZmZ dZdZdZg dZde	d	e
d
ee   de
dedede
fdZdededefdZ G d de      Zy)    )Optional   )FEATURES
conv_space)	 kMGTPEZY)	r   Kr	   r
   r   r   r   r   r   )	r   KiMiGiTiPiEiZiYi)	r   r   r      r   r   r   r   r   valunitprecspacedivisorspecreturnc                     t        |t              D ]  \  }}t        | |      }||k\  r| |z  }  n | d}}|t        | |      }n|dz  dk(  rd}n|dz  dz  dk(  rd}nd}dj                  |||||      S )	N+g      ?        r   g      $@r   r   z{:.{}f}{}{}{})zipDECIMALSroundformat)	r   r   r   r   r   r   scaledecrs	            [/home/www/backend.miabetepe.com/venv/lib/python3.12/site-packages/about_time/human_count.py__human_countr,      s    $) 
s#sO<7NC 5#t	
R2
c'R2	!!!T5%>>    d1024iecc                      dt         dt        dt        t           f fd}t	                dt
        fdt        fdt        fdt        fd||f   \  |S )Nr   r   r   c                 $    t        | ||      S N)r,   )r   r   r   r   r   r   s      r+   runzfn_human_count.<locals>.run"   s    S$eWdCCr-   i  i   ))FF)TF)TT)FT)floatstrr   intr   SI_1000_SPECSI_1024_SPECIEC_1024_SPEC)r   r.   r/   r3   r   r   s   `   @@r+   fn_human_countr:   !   sq    D Dc D# D uE|,l+]+m,	
 clMGT Jr-   c                   \    e Zd Zd Zed        Zdedd fdZddee	   defdZ
d	 Zd
 Zd Zy)
HumanCountc                 .    |dk\  sJ || _         || _        y )Nr#   )_value_unit)selfvaluer   s      r+   __init__zHumanCount.__init__0   s    {{
r-   c                     | j                   S r2   )r>   r@   s    r+   rA   zHumanCount.value5   s    {{r-   rA   r    c                     || _         | S r2   )r?   )r@   rA   s     r+   r   zHumanCount.unit9   s    
r-   Nr   c                      t        t        j                  t        j                  t        j                        | j
                  | j                  |      S )zReturn a beautiful representation of this count.
        It dynamically calculates the best scale to use.

        Args:
            prec: an optional custom precision

        Returns:
            the human friendly representation.

        )r:   r   feature_spacefeature_1024feature_iecr>   r?   )r@   r   s     r+   as_humanzHumanCount.as_human=   sB    4~h44h6K6K&22448KKTS 	Sr-   c                 "    | j                         S r2   )rJ   rD   s    r+   __str__zHumanCount.__str__K   s    }}r-   c                 :    dj                  | j                  |       S )NzHumanCount{{ value={} }} -> {})r'   r>   rD   s    r+   __repr__zHumanCount.__repr__N   s    /66t{{DIIr-   c                 (    | j                         |k(  S r2   )rL   )r@   others     r+   __eq__zHumanCount.__eq__Q   s    ||~&&r-   r2   )__name__
__module____qualname__rB   propertyrA   r5   r   r   r6   rJ   rL   rN   rQ    r-   r+   r<   r<   /   sX    
  # , SXc] Sc SJ'r-   r<   N)typingr   featuresr   r   r7   r8   r9   r%   r4   r5   r6   tupler,   boolr:   objectr<   rV   r-   r+   <module>r\      s     *;;D&?u ?C ?x} ?S ?SV ??"%?,$ t $ #' #'r-   