Ë
    }D™jõY ã                   óÄ  — U d Z ddlZddlZddlmZmZmZmZmZ ddl	m
Z
mZ ddlmZ ddlmZmZmZmZmZmZ ddlmZmZ ed   Z	 eeef   Zd	Zeed
f   ed<   dZ eed
f   ed<   dZ!eed
f   ed<   dZ"eed
f   ed<   dZ#eed<   i dd“dd“dd“dd“dd“dd“dd“dd“dd“d d“d!d“d"d“d#d“d$d%“d&d%“d'd%“d(d%“i d)d%“d*d%“d+d%“d,d-“d.d%“d/d%“d0d%“d1d2“d3d2“d4d2“d5d6“d7d6“d8d6“d9d6“d:d6“d;d6“d<d6“¥i d=d6“d>d“d?d@“dAd-“dBd-“dCdD“dEdD“dFdD“dGdD“dHdD“dIdD“dJdD“dKdD“dLdD“dMdD“dNdD“dOdD“¥dDdDdDdDdDdDdDdDdDdDd6dPœ¥Z$e%eef   edQ<   	 �ddRedSeeeef      dTee%eef   ef   fdU„Z&dVeeeef   dWee   dXee   dYee   dZeeef   d[edTe%eef   fd\„Z'd]Z(eed^<   d_Z)eed`<   daZ*eedb<   dcZ+ee
d
f   edd<   deZ,eedf<   �ddge
dhedTeeeef   fdi„Z-�ddjedkeeeeef      dTeeef   fdl„Z.dmednedTefdo„Z/dpedqedredTefds„Z0dteeef   dueeef   dTefdv„Z1dteeef   dueeef   dTefdw„Z2dxeeef   dTefdy„Z3dzeejh                  df   dTefd{„Z5d|eeef   d}eeef   d~eeef   dTefd„Z6d|eeef   d€eeef   d~eeef   dTefd�„Z7d‚eeef   dge
dƒeeef   d„ed€eeef   d…ed†edTefd‡„Z8dˆeeef   d‰edŠedTefd‹„Z9dˆeeef   dŒed�edTefdŽ„Z:	 	 	 �dd€eeef   d�eeef   d�eee%f   d‘edƒeeef   d’e;d“ee<eeeef         d”edTefd•„Z=�dd–ed—ed˜   dTefd™„Z>d€eeef   dƒeeef   dTefdš„Z?d€eeef   d‚eeef   dƒeeef   d›edTef
dœ„Z@d€eeef   d�edžedTefdŸ„ZA	 �dd€eeef   d›edge
d‚eeedf   dTef
d „ZBd€eeef   d›ed¡edTefd¢„ZC	 �dd€eeef   d›ed¡edge
d£eeedf   dTefd¤„ZDd}eeef   d›ed¡edge
d¥eeef   dTefd¦„ZE	 	 �dd›ed§e<d¨e<d©edªedTefd«„ZF	 	 	 �dd€eeef   d¬e<e   d­ed®ed¯ed°ed±ed‚eeef   d¥eeef   dge
d²ee<e   df   d³eedf   d´e;dTefdµ„ZGd¶d·d¶d¸dd¹dºd»œd¼ed½ee<e   e<e%   f   dneeeeeeef   f   eeeef      f   d¾eeeef      d¿edÀedÁedÂedÃeeeef      dÄedÅedTefdÆ„ZHdÇedTe%fdÈ„ZI	 	 	 	 �ddÉe<e   dÊedËedÌedÍedTefdÎ„ZJ	 	 	 	 �ddÏe<e   dÊedËedÌedÍedTefdÐ„ZK	 	 	 �ddÑedÒedÓe<e   dge
dnedËedÌedÍedTefdÔ„ZL	 	 	 �ddÑedÕedÖe<e   dge
dnedËedÌedÍedTefd×„ZM	 	 	 �dd›ed§e<d¨e<dØedÙedÚedTefdÛ„ZN�ddÜedÝedTefdÞ„ZOdßedTefdà„ZPdáddâœdãee   dWee   dVeeeef   dRedSeeeef      dTe%eef   fdä„ZQdáddâœdãee   dWee   dåedæedRedSeeeef      dTe%eef   fdç„ZRdèdédêdëdìdídîddïœdðdñdnedòe<e   dóedô   dËedõedöed÷edøedÌedÍedTefdù„ZSdèdédêdëdúdûddüœdðdñdnedòe<e   dóedô   dËedõedöedýedÌedÍedTefdþ„ZTdèdédÿ�d �ddûd�dœdðdñdn�d�dedô   dËe�de�de�dedÌedÍedTef�d„ZUdèdédÿ�d �ddûd�dœdðdñdn�d�dedô   dËe�de�de�dedÌedÍedTef�d	„ZVdÇe�d
edTef�d„ZWdáddâœdãee   dWee   dVeeeef   dRedSeeeef      dTe%eef   f�d„ZXdáddâœdãee   dWee   dåedæedRedSeeeef      dTe%eef   f�d„ZYy(  a´  
Utility functions for astrological chart generation and SVG drawing.

This module provides:
- Mathematical utilities for angle and coordinate calculations
- SVG drawing functions for chart elements (circles, slices, grids, etc.)
- Element and modality distribution calculations
- Coordinate conversion and formatting utilities

The module is organized in the following sections:
1. Constants (zodiac mappings, weights, layout thresholds)
2. Internal helper functions (weight preparation, distribution calculation)
3. Mathematical utilities (angles, coordinates, time conversion)
4. SVG drawing functions (circles, slices, rings, grids, aspects)
5. Element/modality distribution calculations
é    N)ÚLiteralÚMappingÚOptionalÚSequenceÚUnion)Ú	ChartTypeÚKerykeionException)ÚAstrologicalPoint)ÚAspectModelÚAstrologicalSubjectModelÚCompositeSubjectModelÚHouseComparisonModelÚKerykeionPointModelÚPlanetReturnModel)Ú$KerykeionLanguageCelestialPointModelÚ$KerykeionSettingsCelestialPointModel)Ú
pure_countÚweighted)ÚfireÚearthÚairÚwaterr   r   r   r   r   r   r   r   .Ú_SIGN_TO_ELEMENT)ÚcardinalÚfixedÚmutabler   r   r   r   r   r   r   r   r   Ú_SIGN_TO_QUALITY)r   r   r   r   Ú_ELEMENT_KEYS)r   r   r   Ú_QUALITY_KEYSç      ð?Ú_DEFAULT_WEIGHTED_FALLBACKÚsunç       @ÚmoonÚ	ascendantÚmedium_coelig      ø?Ú
descendantÚ
imum_coeliÚvertexgš™™™™™é?Úanti_vertexÚmercuryÚvenusÚmarsÚjupiterÚsaturnÚuranusç      à?ÚneptuneÚplutoÚmean_north_lunar_nodeÚtrue_north_lunar_nodeÚmean_south_lunar_nodeÚtrue_south_lunar_nodeÚchirong333333ã?Úmean_lilithÚtrue_lilithÚceresÚpallasgš™™™™™Ù?ÚjunoÚvestaÚpholusg333333Ó?ÚerisÚsednaÚhaumeaÚmakemakeÚixionÚorcusÚquaoarÚpars_fortunaeÚpars_spiritusgffffffæ?Úpars_amorisÚ
pars_fideiÚregulusgš™™™™™É?ÚspicaÚ	aldebaranÚantaresÚsiriusÚ	fomalhautÚalgolÚ
betelgeuseÚcanopusÚprocyonÚarcturusÚpollux)ÚdenebÚaltairÚrigelÚachernarÚcapellaÚvegaÚalcyoneÚalpheccaÚalgorabÚdeneb_algedir   ÚDEFAULT_WEIGHTED_POINT_WEIGHTSÚmethodÚcustom_weightsÚreturnc                 óN  — |r;|j                  «       D ��ci c]  \  }}|j                  «       t        |«      “Œ! c}}ni }| dk(  rt        t        «      }t
        }ni }d}|j                  d|«      }|j                  «       D ]  \  }}|dk(  rŒt        |«      ||<   Œ ||fS c c}}w )a  
    Normalize and merge default weights with any custom overrides.

    Args:
        method: Calculation strategy to use.
        custom_weights: Optional mapping of point name (case-insensitive) to weight.
                        Supports special key "__default__" as fallback weight.

    Returns:
        A tuple containing the weight lookup dictionary and fallback weight.
    r   r    Ú__default__)ÚitemsÚlowerÚfloatÚdictra   r!   Úget)rb   rc   ÚkeyÚvalueÚnormalized_customÚweight_lookupÚfallback_weights          úi/var/www/html/Astrologybackend/backend/venv/lib/python3.12/site-packages/kerykeion/charts/charts_utils.pyÚ_prepare_weight_lookuprr   ¶   s´   € ñ aoÀ^×EYÑEYÓE[×\±z°s¸E˜Ÿ™›¤e¨E£lÑ2Ô\ÐtvÐà�ÒÜ*.Ô/MÓ*NˆÜ4‰àˆØˆà'×+Ñ+¨M¸?ÓK€Oà'×-Ñ-Ó/ò *‰
ˆˆUØ�-ÒØÜ" 5›\ˆ�cÒð*ð
 ˜/Ð)Ð)ùó! ]s   –$B!ÚsubjectÚcelestial_points_namesÚsign_to_group_mapÚ
group_keysro   rp   c                 óú   — |D �ci c]  }|d“Œ }}|D ]`  }| j                  |«      }	|	€Œt        |	dd«      }
|
�d|
cxk  rt        |«      k  sn Œ=||
   }|j                  ||«      }||xx   |z  cc<   Œb |S c c}w )aA  
    Accumulate distribution totals for a single subject.

    Args:
        subject: Subject providing planetary positions.
        celestial_points_names: Names of celestial points to consider (lowercase).
        sign_to_group_map: Mapping from sign index to element/modality key.
        group_keys: Iterable of expected keys for the resulting totals.
        weight_lookup: Precomputed mapping of weights per point.
        fallback_weight: Default weight if point missing in lookup.

    Returns:
        Dictionary with accumulated totals keyed by element/modality.
    ç        NÚsign_numr   )rk   ÚgetattrÚlen)rs   rt   ru   rv   ro   rp   rl   ÚtotalsÚ
point_nameÚpointÚ
sign_indexÚ	group_keyÚweights                rq   Ú#_calculate_distribution_for_subjectr‚   Ø   s¡   € ð, #-Ö-˜3ˆc�3‰hÐ-€FÐ-à,ò $ˆ
Ø—‘˜JÓ'ˆØˆ=Øä˜U J°Ó5ˆ
ØÐ a¨:Ô&N¼Ð<MÓ8NÔ&NØà% jÑ1ˆ	Ø×"Ñ" :¨Ó?ˆØˆyÓ˜VÑ#Ôð$ð €Mùò .s   …
A8é   Ú_SECOND_COLUMN_THRESHOLDé   Ú_THIRD_COLUMN_THRESHOLDé$   Ú_FOURTH_COLUMN_THRESHOLD©ÚSynastryÚTransitÚDualReturnChartÚ_DOUBLE_CHART_TYPESé}   Ú_GRID_COLUMN_WIDTHÚ
chart_typeÚ
num_pointsc           
      óò   — | t         v ry|t        k  rt        t        t        fS t        }t	        dt        dt        j                  ||z  «      «      «      }t        j                  ||z  «      }||dz  |dz  fS )aH  
    Return column thresholds for the planet grids based on chart type and point count.

    For double-wheel charts (Synastry, Transit, DualReturnChart), returns very high
    thresholds to effectively disable multi-column layout.

    For single-wheel charts with many active points (> 20), computes balanced
    thresholds to distribute points evenly across columns, preventing visual
    overlap between the planet grid and the chart wheel.

    Args:
        chart_type: The type of chart being rendered.
        num_points: Total number of active celestial points. When > 20 in single-wheel
                   charts, triggers balanced multi-column distribution instead of the
                   fixed thresholds (20, 28, 36) which produce uneven columns.

    Returns:
        Tuple of (second, third, fourth) column thresholds.
    )i@B iHB iPB é   é   é   é   )r�   r„   r†   rˆ   ÚminÚmaxÚmathÚceil)r�   r‘   Úmax_rowsÚnum_columnsÚrows_per_cols        rq   Ú_select_planet_grid_thresholdsrž     s~   € ð( Ô(Ñ(ð
ð Ô-Ò-Ü'Ô)@ÔBZÐZÐZô
 (€HÜ�aœ˜Q¤§	¡	¨*°xÑ*?Ó @ÓAÓB€KÜ—9‘9˜Z¨+Ñ5Ó6€Là˜¨Ñ)¨<¸!Ñ+;Ð;Ð;ó    ÚindexÚ
thresholdsc                 ó¦   — |�|nt         t        t        f\  }}}| |k  rd}| }n!| |k  rd}| |z
  }n| |k  rd}| |z
  }nd}| |z
  }t        |z   }||fS )aa  
    Calculate the grid position for a planet at the given index.

    Args:
        index: Zero-based index of the planet in the list.
        thresholds: Optional tuple of (second, third, fourth) column thresholds.
                   If None, uses default thresholds.

    Returns:
        Tuple of (horizontal_offset, row_index) for positioning.
    r   r”   r•   r–   )r„   r†   rˆ   r�   )r    r¡   Úsecond_thresholdÚthird_thresholdÚfourth_thresholdÚcolumnÚrowÚoffsets           rq   Ú_planet_grid_layout_positionr©   9  s”   € ð Ð!ñ 	ä&Ô(?ÔAYÐZñ 8Ð�oÐ'7ð ÐÒØˆØ‰Ø	�Ò	 ØˆØÐ&Ñ&‰Ø	Ð!Ò	!ØˆØ�oÑ%‰àˆØÐ&Ñ&ˆä! FÑ*Ð+€FØ�3ˆ;ÐrŸ   Úinput_planet_nameÚcelestial_point_languagec                 ón   — |j                  «       j                  «       }| |v r||    S t        d| › d�«      ‚)a   
    Decode the given celestial point name based on the provided language model.

    Args:
        input_planet_name: The internal name of the celestial point to decode.
        celestial_point_language: The language model containing translated point names.

    Returns:
        The localized celestial point name.

    Raises:
        KerykeionException: If the point name is not found in the language model.
    zCelestial point z not found in language model.)Ú
model_dumpÚkeysr	   )rª   r«   Úlanguage_keyss      rq   Ú*get_decoded_kerykeion_celestial_point_namer°   a  sG   € ð  -×7Ñ7Ó9×>Ñ>Ó@€Mà˜MÑ)Ø'Ð(9Ñ:Ð:ä Ð#3Ð4EÐ3FÐFcÐ!dÓeÐerŸ   ÚinHÚinMÚinSc                 ód   — t        | «      }t        |«      dz  }t        |«      dz  }||z   |z   }|S )a  
    Convert hours, minutes, and seconds to decimal hours.

    Args:
        inH: Hours component.
        inM: Minutes component.
        inS: Seconds component.

    Returns:
        Time as decimal hours.

    Example:
        >>> decHourJoin(12, 30, 0)
        12.5
    é<   é  )ri   )r±   r²   r³   ÚdhÚdmÚdsÚoutputs          rq   ÚdecHourJoinr»   ~  s:   € ô" 
ˆs‹€BÜ	ˆs‹�b‰€BÜ	ˆs‹�dÑ	€BØ�"‰W�r‰\€FØ€MrŸ   ÚaÚbc                 ód   — t        j                  t        | |z
  «      d«      }t        |d|z
  «      S )a  Calculate the smallest difference between two angles in degrees.

    Args:
        a (int | float): first angle in degrees
        b (int | float): second angle in degrees

    Returns:
        float: smallest difference between a and b (0 to 180 degrees)
    éh  )r™   ÚfmodÚabsr—   )r¼   r½   Údiffs      rq   Ú
degreeDiffrÃ   –  s-   € ô �9‰9”S˜˜Q™“Z Ó%€DÜˆt�S˜4‘ZÓ Ð rŸ   c                 óN   — | |z   dz  dk7  rt        j                  | |z   d«      S dS )a  Calculate the sum of two angles in degrees, normalized to [0, 360).

    Args:
        a (int | float): first angle in degrees
        b (int | float): second angle in degrees

    Returns:
        float: normalized sum of a and b in the range [0, 360)
    r¿   r   rx   )r™   rÀ   )r¼   r½   s     rq   Ú	degreeSumrÅ   ¤  s-   € ð &'¨¡U¨c¡M°QÒ$6Œ4�9‰9�Q˜‘U˜CÓ Ð?¸CÐ?rŸ   Úanglec                 ó    — | dz  dk7  r| dz  S dS )z»Normalize an angle to the range [0, 360).

    Args:
        angle (int | float): The input angle in degrees.

    Returns:
        float: The normalized angle in the range [0, 360).
    r¿   r   rx   © )rÆ   s    rq   ÚnormalizeDegreerÉ   ±  s   € ð   #™+¨Ò*ˆ5�3‰;Ð3°Ð3rŸ   Údatetime_offsetc                 óŠ   — | €t        d«      ‚t        | j                  dz  «      }t        | j                  dz  «      }||z   }|S )z©Convert datetime offset to float in hours.

    Args:
        - datetime_offset (datetime.timedelta): datetime offset

    Returns:
        - float: offset in hours
    zdatetime_offset is Noneé   g      ¬@)r	   ri   ÚdaysÚseconds)rÊ   r·   Úshrº   s       rq   Ú
offsetToTzrÐ   ½  sP   € ð ÐÜ Ð!:Ó;Ð;ô 
ˆ×#Ñ# bÑ(Ó	)€Bä	ˆ×&Ñ&¨Ñ/Ó	0€Bà�"‰W€FØ€MrŸ   ÚsliceÚradiusr¨   c                 ó–   — t         j                  |z  dz  }t         j                  dz  | z  |z   }|t        j                  |«      dz   z  S )u›  
    Calculate the x-coordinate of a point on a circle.

    Used for positioning elements on the zodiac wheel.

    Args:
        slice: Slice index (0-11 for zodiac signs, represents 30Â° segments).
        radius: Circle radius in pixels.
        offset: Angular offset in degrees.

    Returns:
        X-coordinate on the circle.

    Example:
        >>> sliceToX(3, 5, 45)
        2.5000000000000018
    é´   é   r”   )r™   ÚpiÚcos)rÑ   rÒ   r¨   ÚplusÚradials        rq   ÚsliceToXrÚ   Ø  sG   € ô$ �G‰G�fÑ Ñ#€DÜ�w‰w˜‰{˜eÑ# tÑ+€FØ”T—X‘X˜fÓ%¨Ñ)Ñ*Ð*rŸ   Úrc                 óœ   — t         j                  |z  dz  }t         j                  dz  | z  |z   }|t        j                  |«      dz  dz   z  S )u–  
    Calculate the y-coordinate of a point on a circle.

    Used for positioning elements on the zodiac wheel.

    Args:
        slice: Slice index (0-11 for zodiac signs, represents 30Â° segments).
        r: Circle radius in pixels.
        offset: Angular offset in degrees.

    Returns:
        Y-coordinate on the circle.

    Example:
        >>> sliceToY(3, 5, 45)
        -4.330127018922194
    rÔ   rÕ   éÿÿÿÿr”   )r™   rÖ   Úsin)rÑ   rÛ   r¨   rØ   rÙ   s        rq   ÚsliceToYrß   ï  sL   € ô$ �G‰G�fÑ Ñ#€DÜ�w‰w˜‰{˜eÑ# tÑ+€FØ”—‘˜&Ó! BÑ&¨!Ñ+Ñ,Ð,rŸ   Úc1Úseventh_house_degree_utÚnumÚstyleÚtypec                 óh  — d|z
  }|dk(  s
|dk(  s|dk(  rd}n| }dt        |«      › dt        |«      › dt        |t        |||z
  |«      z   «      › dt        |t        |||z
  |«      z   «      › d	t        ||z
  «      › dt        ||z
  «      › d
t        |t        |dz   ||z
  |«      z   «      › dt        |t        |dz   ||z
  |«      z   «      › d|› d�}	|dz   }|dk(  s
|dk(  s|dk(  rd}nd| z   }dt        |t        |||z
  |«      z   «      › dt        |t        |||z
  |«      z   «      › d|› d�}
|	dz   |
z   S )u¬  
    Draw a zodiac sign slice with its symbol on the chart wheel.

    Creates an SVG path element for one of the 12 zodiac slices (30Â° each)
    and positions the corresponding zodiac symbol.

    Args:
        c1: Inner offset for single-wheel charts (ignored for double-wheel).
        chart_type: Type of chart being rendered.
        seventh_house_degree_ut: Degree of the 7th house cusp for alignment.
        num: Sign index (0-11, where 0=Aries).
        r: Chart radius in pixels.
        style: CSS inline style for the slice path.
        type: Sign symbol ID (e.g., "Ari", "Tau", etc.).

    Returns:
        SVG string containing the slice path and symbol elements.
    r¿   r‹   rŠ   rŒ   r   z
<path d="Mú,z Lz Az 0 0,0 r”   z z" style="ú"/>é   é6   é   z*<g transform="translate(-16,-16)"><use x="ú" y="ú" xlink:href="#ú" /></g>Ú )ÚstrrÚ   rß   )rà   r�   rá   râ   rÛ   rã   rä   r¨   ÚdropinrÑ   Úsigns              rq   Údraw_zodiac_slicerò     sÔ  € ð8 Ð*Ñ*€Fà�YÒ *°
Ò":¸jÐL]Ò>]Ø$%‰àˆØœ˜Q›˜ ¤# a£& ¨¬C°¼À#ÀqÈ6ÁzÐSYÓ9ZÑ0ZÓ,[Ð+\Ð\]Ô^aÐbhÔksÐtwÐyzð  ~Dñ  zDð  FLó  lMñ  cMó  _Nð  ^Oð  OQô  RUð  VWð  Z`ñ  V`ó  Rað  Qbð  bcô  dgð  hið  lrñ  hró  dsð  ctð  t{ô  |ð  @Fô  IQð  RUð  XYñ  RYð  [\ð  _eñ  [eð  gmó  Inñ  @nó  |oð  {pð  pqô  ruð  v|ô  Gð  HKð  NOñ  HOð  QRð  U[ñ  Q[ð  ]có  dñ  vdó  reð  qfð  fqð  rwð  qxð  x{ð  |€Eð �b‰[€Fà�YÒ *°
Ò":¸jÐL]Ò>]Ø‰à�b‘ˆØ7¼¸FÄXÈcÐSTÐW]ÑS]Ð_eÓEfÑ<fÓ8gÐ7hÐhmÔnqÐrxô  |Dð  EHð  JKð  NTñ  JTð  V\ó  |]ñ  s]ó  o^ð  n_ð  _nð  osð  ntð  t|ð  }€Dà�2‰:˜ÑÐrŸ   ÚcoordÚnorth_labelÚsouth_labelc           	      óò   — |}| dk  r|}t        | «      } t        | «      }t        t        | «      |z
  dz  «      }t        t        t        t        | «      |z
  dz  |z
  «      dz  «      «      }|› d|› d|› d|› �S )u7  
    Convert latitude to a formatted string with cardinal direction.

    Args:
        coord: Latitude in decimal degrees (negative for south).
        north_label: Label for north (e.g., "N").
        south_label: Label for south (e.g., "S").

    Returns:
        Formatted string (e.g., "52Â°7'25" N").
    rx   rµ   ç      N@õ   Â°ú'ú" ©rÁ   Úintri   Úround)ró   rô   rõ   rñ   Údegr—   Úsecs          rq   Ú%convert_latitude_coordinate_to_stringr   @  sˆ   € ð €DØˆs‚{ØˆÜ�E“
ˆÜ
ˆe‹*€CÜ
Œu�U‹|˜cÑ! RÑ'Ó
(€CÜ
Œe”EœE %›L¨3Ñ.°"Ñ4¸Ñ;Ó<¸tÑCÓDÓ
E€CØˆU�"�S�E˜˜3˜%˜s 4 &Ð)Ð)rŸ   Ú
east_labelÚ
west_labelc           	      óò   — |}| dk  r|}t        | «      } t        | «      }t        t        | «      |z
  dz  «      }t        t        t        t        | «      |z
  dz  |z
  «      dz  «      «      }|› d|› d|› d|› �S )u4  
    Convert longitude to a formatted string with cardinal direction.

    Args:
        coord: Longitude in decimal degrees (negative for west).
        east_label: Label for east (e.g., "E").
        west_label: Label for west (e.g., "W").

    Returns:
        Formatted string (e.g., "2Â°59'30" W").
    rx   rµ   r÷   rø   rù   rú   rû   )ró   r  r  rñ   rþ   r—   rÿ   s          rq   Ú&convert_longitude_coordinate_to_stringr  V  sˆ   € ð €DØˆs‚{ØˆÜ�E“
ˆÜ
ˆe‹*€CÜ
Œu�U‹|˜cÑ! RÑ'Ó
(€CÜ
Œe”EœE %›L¨3Ñ.°"Ñ4¸Ñ;Ó<¸tÑCÓDÓ
E€CØˆU�"�S�E˜˜3˜%˜s 4 &Ð)Ð)rŸ   ÚarÚaspectÚcolorÚshow_aspect_iconÚrendered_icon_positionsÚicon_collision_thresholdc                 óP  — t        |t        «      rt        d(i |¤Ž}t        |«      dz  t        |d   «      z   }t	        d||«      | |z
  z   }	t        d||«      | |z
  z   }
t        |«      dz  t        |d   «      z   }t	        d||«      | |z
  z   }t        d||«      | |z
  z   }d}|�rˆ|d   dk(  rõt        j                  |d   «      }t        j                  |d   «      }t        j                  |«      t        j                  |«      z   dz  }t        j                  |«      t        j                  |«      z   dz  }t        j                  t        j                  ||«      «      dz  }t        |«      dz  |z   }|d	z   }t	        d||«      | |z
  z   }t        d||«      | |z
  z   }n|	|z   dz  }|
|z   dz  }d
}|d   }|�>|D ]9  \  }}}||k(  sŒt        j                  ||z
  dz  ||z
  dz  z   «      }||k  sŒ7d} n |r2d|d   › �}d}d||z
  › d||z
  › d|› d�}|�|j                  |||f«       dj                  g d‘|d   › ‘d‘|d   › ‘d‘|d   › ‘d‘|d   › ‘d‘|d   › ‘d‘|d   › ‘d‘|d   › ‘d‘|d   › ‘d‘|d    › ‘d!‘|	› ‘d"‘|
› ‘d#‘|› ‘d$‘|› ‘d%‘|› ‘d&‘|› ‘d'‘«      S ))a=  Draws svg aspects: ring, aspect ring, degreeA degreeB

    Args:
        - r (Union[int, float]): The value of r.
        - ar (Union[int, float]): The value of ar.
        - aspect_dict (dict): The aspect dictionary.
        - color (str): The color of the aspect.
        - seventh_house_degree_ut (Union[int, float]): The degree of the seventh house.
        - show_aspect_icon (bool): Whether to show the aspect icon at the center of the line.
        - rendered_icon_positions (list | None): List to track rendered icon positions (x, y, aspect_degrees)
            for collision detection. Only icons of the same aspect type will be checked for collision.
        - icon_collision_threshold (float): Minimum distance in pixels between icons to avoid overlap.

    Returns:
        str: The SVG line element as a string.
    rÝ   Ú
p1_abs_posr   Ú
p2_abs_posrî   Úaspect_degreesr•   r¿   r“   TFÚorbrÕ   z<use x="rë   rì   ú" />z#<g kr:node="Aspect" kr:aspectname="r  z	" kr:to="Úp1_namez" kr:tooriginaldegrees="z" kr:from="Úp2_namez" kr:fromoriginaldegrees="z
" kr:orb="Úorbitz" kr:aspectdegrees="z" kr:planetsdiff="rÂ   z" kr:aspectmovement="Úaspect_movementz"><line class="aspect" x1="ú" y1="ú" x2="ú" y2="ú" style="stroke: z); stroke-width: 1; stroke-opacity: .9;"/>ú</g>rÈ   )Ú
isinstancerj   r   rü   rÚ   rß   r™   ÚradiansrÞ   r×   ÚdegreesÚatan2ÚsqrtÚappendÚjoin) rÛ   r  r  r  rá   r  r	  r
  Úfirst_offsetÚx1Úy1Úsecond_offsetÚx2Úy2Úaspect_icon_svgÚp1_radÚp2_radÚavg_sinÚavg_cosÚavg_posr¨   Úicon_radiusÚmid_xÚmid_yÚshould_render_iconÚcurrent_aspect_degreesÚ
existing_xÚ
existing_yÚexisting_aspect_degreesÚdistanceÚaspect_symbol_idÚicon_offsets                                    rq   Údraw_aspect_liner8  q  sˆ  € ô6 �&œ$ÔÜÑ&˜vÑ&ˆäÐ/Ó0°2Ñ5¼¸VÀLÑ=QÓ9RÑR€LÜ	�!�R˜Ó	&¨!¨b©&Ñ	1€BÜ	�!�R˜Ó	&¨!¨b©&Ñ	1€BäÐ0Ó1°BÑ6¼#¸fÀ\Ñ>RÓ:SÑS€MÜ	�!�R˜Ó	'¨1¨r©6Ñ	2€BÜ	�!�R˜Ó	'¨1¨r©6Ñ	2€Bð €OÚàÐ"Ñ# qÒ(ô —\‘\ &¨Ñ"6Ó7ˆFÜ—\‘\ &¨Ñ"6Ó7ˆFÜ—x‘x Ó'¬$¯(©(°6Ó*:Ñ:¸aÑ?ˆGÜ—x‘x Ó'¬$¯(©(°6Ó*:Ñ:¸aÑ?ˆGÜ—l‘l¤4§:¡:¨g°wÓ#?Ó@À3ÑFˆGäÐ1Ó2°RÑ7¸7ÑBˆFà˜q™&ˆKÜ˜Q ¨VÓ4¸¸K¹ÑHˆEÜ˜Q ¨VÓ4¸¸K¹ÑH‰Eð ˜"‘W ‘MˆEØ˜"‘W ‘MˆEð "ÐØ!'Ð(8Ñ!9ÐØ"Ð.ØCZò Ñ?�
˜JÐ(?à*Ð.DÓDÜ#Ÿy™y¨%°*Ñ*<ÀÑ)BÀeÈjÑFXÐ]^ÑE^Ñ)^Ó_�HØÐ":Ó:Ø-2Ð*Ùðñ à!$ VÐ,<Ñ%=Ð$>Ð?ÐàˆKà˜5 ;Ñ.Ð/¨u°U¸[Ñ5HÐ4IÈÐYiÐXjÐjnÐoð ð 'Ð2Ø'×.Ñ.°°uÐ>TÐ/UÔV÷	ó 	Ð
-ð 	¨f°XÑ.>Ð-?ð 	¸yð 	ÈÐPYÑIZÐH[ð 	Ð[sð 	Ðtzð  |Hñ  uIð  tJð 	ð  JUð 	ð  V\ð  ]fñ  Vgð  Uhð 	ð  hBð 	ð  CIð  JVñ  CWð  BXð 	ð  Xbð 	ð  cið  jqñ  crð  bsð 	ð  sGð 	ð  HNð  O_ñ  H`ð  Gað 	ð  asð 	ð  tzð  {Añ  tBð  sCð 	ð  CXð 	ð  Y_ð  `qñ  Yrð  Xsð 	ð s$ð 	Ø$& 4ð	Ø'-ð	Ø.0¨Tð	Ø17ð	Ø8:°tð	Ø;Að	ØBDÀð	ØEVð	ØW\ÐV]ð	ð ^Gð	àÐ
ð	ð ô	ðrŸ   ÚdecÚformat_type)Ú1Ú2Ú3c                 óæ   — t        | «      } t        | «      }t        | |z
  dz  «      }t        t        | |z
  |dz  z
  dz  «      «      }|dk(  r|› d�S |dk(  r	|› d|d›d�S |dk(  r|› d|d›d|d›d	�S y
)uU  
    Converts a decimal float to a degrees string in the specified format.

    Args:
        dec (float): The decimal float to convert.
        format_type (str): The format type:
            - "1": aÂ°
            - "2": aÂ°b'
            - "3": aÂ°b'c" (default)

    Returns:
        str: The degrees string in the specified format.
    rµ   r¶   r;  rø   r<  Ú02drù   r=  ú"N)ri   rü   rý   )r9  r:  r  ÚminutesrÎ   s        rq   Ú convert_decimal_to_degree_stringrB  Ï  s©   € ô �‹*€Cô �#‹h€GÜ�3˜‘= BÑ&Ó'€GÜ”%˜˜w™¨°2©Ñ5¸Ñ=Ó>Ó?€Gð �cÒØ�˜"ˆ~ÐØ	˜Ò	Ø�˜"˜W S˜M¨Ð+Ð+Ø	˜Ò	Ø�˜"˜W S˜M¨¨7°3¨-°rÐ:Ð:ð 
rŸ   c                 ó$  — d}t        d«      D ]z  }t        |dz  «      |z
  }|dk  r|dz   }n
|dkD  r|dz
  }t        d| |«      }t        d| |«      }t        d| dz   |«      dz
  }t        d| dz   |«      dz
  }|d|› d	|› d
|› d|› d�	z  }Œ| |dz  }|S )u/  
    Draw degree tick marks around the transit ring.

    Creates 72 tick marks at 5Â° intervals for visual reference.

    Args:
        r: Chart radius in pixels.
        seventh_house_degree_ut: 7th house position for alignment.

    Returns:
        SVG group element containing the tick marks.
    z<g id="transitRingDegreeSteps">éH   é   r   ç     €v@r¿   r•   ú
<line x1="r  r  r  z?" style="stroke: #F00; stroke-width: 1px; stroke-opacity:.9;"/>r  ©Úrangeri   rÚ   rß   )	rÛ   rá   ÚoutÚir¨   r"  r#  r%  r&  s	            rq   Údraw_transit_ring_degree_stepsrL  ó  sÑ   € ð ,€CÜ�2‹Yò 
~ˆÜ�q˜1‘u“Ð 7Ñ7ˆØ�AŠ:Ø˜e‘^‰FØ�cŠ\Ø˜e‘^ˆFÜ�a˜˜FÓ#ˆÜ�a˜˜FÓ#ˆÜ�a˜˜Q™ Ó'¨!Ñ+ˆÜ�a˜˜Q™ Ó'¨!Ñ+ˆØ�˜B˜4˜v b T¨°¨t°6¸"¸Ð=|Ð}Ñ}‰ð
~ð ˆ6�M€Cà€JrŸ   Ústroke_colorc                 óZ  — d}t        d«      D ]•  }t        |dz  «      |z
  }|dk  r|dz   }n
|dkD  r|dz
  }t        d| |z
  |«      |z   }t        d| |z
  |«      |z   }t        d| dz   |z
  |«      dz
  |z   }	t        d| dz   |z
  |«      dz
  |z   }
|d|› d	|› d
|	› d|
› d|› d�z  }Œ— |dz  }|S )u  
    Draw degree tick marks around the main chart ring.

    Creates 72 tick marks at 5Â° intervals for visual reference.

    Args:
        r: Chart radius in pixels.
        c1: Inner offset in pixels.
        seventh_house_degree_ut: 7th house position for alignment.
        stroke_color: Color for the tick marks.

    Returns:
        str: The SVG path of the degree ring.
    z<g id="degreeRing">rD  rE  r   rF  r¿   r•   rG  r  r  r  r  z*; stroke-width: 1px; stroke-opacity:.9;"/>r  rH  )rÛ   rà   rá   rM  rJ  rK  r¨   r"  r#  r%  r&  s              rq   Údraw_degree_ringrO    s  € ð"  €CÜ�2‹Yò HˆÜ�q˜1‘u“Ð 7Ñ7ˆØ�AŠ:Ø˜e‘^‰FØ�cŠ\Ø˜e‘^ˆFÜ�a˜˜R™ Ó(¨2Ñ-ˆÜ�a˜˜R™ Ó(¨2Ñ-ˆÜ�a˜˜Q™ ™ VÓ,¨qÑ0°2Ñ5ˆÜ�a˜˜Q™ ™ VÓ,¨qÑ0°2Ñ5ˆà�˜B˜4˜v b T¨°¨t°6¸"¸Ð=NÈ|Ènð  ]Gð  Hñ  	H‰ðHð ˆ6�M€Cà€JrŸ   Úpaper_1_colorÚzodiac_transit_ring_3_colorc           
      óR   — d}d| › d| › d| |z
  › d|› d�	}|d| › d| › d| › d|› d�	z  }|S )a"  
    Draw the transit ring for double-wheel charts.

    Args:
        r: Chart radius in pixels.
        paper_1_color: Color for the inner ring fill.
        zodiac_transit_ring_3_color: Color for the outer ring stroke.

    Returns:
        SVG circle elements for the transit ring.
    rê   ú<circle cx="ú" cy="ú" r="ú" style="fill: none; stroke: z,; stroke-width: 36px; stroke-opacity: .4;"/>z+; stroke-width: 1px; stroke-opacity: .6;"/>rÈ   )rÛ   rP  rQ  Úradius_offsetrJ  s        rq   Údraw_transit_ringrX  9  sr   € ð €Mà˜˜˜6 !  E¨!¨mÑ*;Ð)<Ð<YÐZgÐYhð  iUð  V€CØˆ\˜!˜˜F 1 # U¨1¨#Ð-JÐKfÐJgð  hSð  Tñ  T€Cà€JrŸ   c           	      ó‚   — |dk(  s
|dk(  s|dk(  rd| › d| › d| dz
  › d|› d	�	S |€t        d
«      ‚d| › d| › d| |z
  › d|› d�	S )aŠ  
    Draw the first (outer) structural circle of the chart.

    Args:
        r: Chart radius in pixels.
        stroke_color: Stroke color for the circle.
        chart_type: Type of chart being rendered.
        c1: Inner offset (required for single-wheel charts).

    Returns:
        SVG circle element.

    Raises:
        KerykeionException: If c1 is None for single-wheel charts.
    rŠ   r‹   rŒ   rS  rT  rU  r‡   rV  z+; stroke-width: 1px; stroke-opacity:.4;" />z
c1 is Nonez; stroke-width: 1px; " />©r	   )rÛ   rM  r�   rà   s       rq   Údraw_first_circler[  M  s‹   € ð$ �ZÒ :°Ò#:¸jÐL]Ò>]Ø˜a˜S  q c¨¨q°2©v¨hÐ6SÐT`ÐSað  bMð  Nð  	Nàˆ:Ü$ \Ó2Ð2ð ˜1˜#˜V A 3 e¨A°©F¨8Ð3PÐQ]ÐP^Ð^wÐxð	
rŸ   Ú
fill_colorc                 ó&   — d| › d| › d| › d|› d|› d�S )a  
    Draws the background circle.

    Args:
        - r (Union[int, float]): The value of r.
        - stroke_color (str): The color of the stroke.
        - fill_color (str): The color of the fill.

    Returns:
        str: The SVG path of the background circle.
    rS  rT  rU  ú" style="fill: z
; stroke: z; stroke-width: 1px;" />rÈ   )rÛ   rM  r\  s      rq   Údraw_background_circler_  j  s/   € ð �q�c˜ ˜s %¨ s¨/¸*¸ÀZÐP\È~Ð]uÐvðrŸ   Úc2c                 óŽ   — |dk(  s
|dk(  s|dk(  rd| › d| › d| dz
  › d|› d	|› d
�S |€t        d«      ‚d| › d| › d| |z
  › d|› d|› d
�S )an  
    Draws the second circle.

    Args:
        - r (Union[int, float]): The value of r.
        - stroke_color (str): The color of the stroke.
        - fill_color (str): The color of the fill.
        - chart_type (ChartType): The type of chart.
        - c2 (Union[int, float]): The value of c2.

    Returns:
        str: The SVG path of the second circle.
    rŠ   r‹   rŒ   rS  rT  rU  rD  r^  z; fill-opacity:.4; stroke: z*; stroke-opacity:.4; stroke-width: 1px" />z
c2 is Nonez; fill-opacity:.2; stroke: rZ  )rÛ   rM  r\  r�   r`  s        rq   Údraw_second_circlerb  {  sŸ   € ð" �ZÒ :°Ò#:¸jÐL]Ò>]Ø˜a˜S  q c¨¨q°2©v¨h°oÀjÀ\ÐQlÐmyÐlzð  {eð  fð  	fð ˆ:Ü$ \Ó2Ð2à˜a˜S  q c¨¨q°2©v¨h°oÀjÀ\ÐQlÐmyÐlzð  {eð  fð  	frŸ   Úc3c                 ó^   — |dv rd| › d| › d| dz
  › d|› d|› d�S d| › d| › d| |z
  › d|› d|› d�S )	aÆ  
    Draws the third circle in an SVG chart.

    Parameters:
    - radius (Union[int, float]): The radius of the circle.
    - stroke_color (str): The stroke color of the circle.
    - fill_color (str): The fill color of the circle.
    - chart_type (ChartType): The type of the chart.
    - c3 (Union[int, float, None], optional): The radius adjustment for non-Synastry and non-Transit charts.

    Returns:
    - str: The SVG element as a string.
    >   r‹   rŠ   rŒ   rS  rT  rU  é    r^  z; fill-opacity:.8; stroke: z; stroke-width: 1px" />rÈ   )rÒ   rM  r\  r�   rc  s        rq   Údraw_third_circlerf  –  s•   € ð  Ð?Ñ?à˜f˜X V¨F¨8°5¸À#¹¸ÀoÐV`ÐUaÐa|ð  ~Jð  }Kð  Kbð  cð  	cð ˜f˜X V¨F¨8°5¸À"¹¸À_ÐU_ÐT`Ð`{ð  }Ið  |Jð  Jað  bð  	brŸ   Úavailable_planetsÚaspectsÚx_startÚy_startc                 óú  — d}d| › d�}d}|D �cg c]
  }|d   sŒ	|‘Œ }	}|	ddd…   }
t        |
«      D ]À  \  }}|d|› d	|› d
|› d|› d|› d�z  }|d|dz   dz  › d	|dz   dz  › d|d   › d�z  }||z  }||z  }|}||z   }|
|dz   d D ]l  }|d|› d	|› d
|› d|› d|› d�z  }||z  }|D ]K  }|d   |d   k(  r|d   |d   k(  s|d   |d   k(  sŒ%|d   |d   k(  sŒ1|d||z
  dz   › d	|dz   › d|d   › d�z  }ŒM Œn ŒÂ |S c c}w )a  
    Draw the triangular aspect grid showing relationships between planets.

    This function generates a diagonal grid where each cell represents the
    aspect relationship between two planets. The grid is triangular because
    aspects are symmetric (A-B is the same as B-A).

    Args:
        stroke_color: CSS color for the grid lines.
        available_planets: List of planet dictionaries. Only planets with
            "is_active" set to True will be included in the grid.
        aspects: List of aspect dictionaries containing p1, p2, and aspect_degrees.
        x_start: X-coordinate for the bottom-left corner of the grid.
        y_start: Y-coordinate for the bottom-left corner of the grid.

    Returns:
        SVG string containing the aspect grid rectangles and symbols.
    rî   ústroke:ú3; stroke-width: 1px; stroke-width: 0.5px; fill:noneé   Ú	is_activeNrÝ   z#<rect kr:node="AspectsGridRect" x="rë   ú	" width="ú
" height="ú	" style="rç   ú<use transform="scale(0.4)" x="r•   ç      @r”   rì   Únamer  Úp1ÚidÚp2ú	<use  x="ú" xlink:href="#orbr  ©Ú	enumerate)rM  rg  rh  ri  rj  Ú
svg_outputrã   Úbox_sizeÚplanetÚactive_planetsÚreversed_planetsr    Úplanet_aÚx_aspectÚy_aspectÚplanet_br  s                    rq   Údraw_aspect_gridr†  ®  sT  € ð2 €JØ�l�^Ð#VÐW€EØ€Hð ,=ÖT ÀÀ{Ó@S’fÐT€NÐTð &¡d¨ dÑ+Ðä$Ð%5Ó6ò K‰ˆˆxàÐ;¸G¸9ÀEÈ'ÈÐR[Ð\dÐ[eÐeoÐpxÐoyð  zCð  DIð  CJð  JMð  Nñ  	Nˆ
ØÐ7¸À1¹ÈÑ8KÐ7LÈEÐSZÐ]^ÑS^ÐbeÑReÐQfÐfuÐv~ð  @Fñ  wGð  vHð  HLð  Mñ  	Mˆ
ð 	�8ÑˆØ�8Ñˆð ˆØ˜XÑ%ˆð )¨°©¨Ð5ò 
	KˆHàÐ?À¸zÈÈxÈjÐXaÐbjÐakÐkuÐv~Ðuð  @Ið  JOð  IPð  PSð  Tñ  TˆJØ˜Ñ ˆHð "ò K�Ø˜4‘L H¨T¡NÒ2°v¸d±|ÀxÐPTÁ~Ò7UØ˜4‘L H¨T¡NÓ2°v¸d±|ÀxÐPTÁ~Ó7Uà I¨h¸Ñ.AÀAÑ.EÐ-FÀeÈHÐWXÉLÈ>ÐYkÐlrð  tDñ  mEð  lFð  FJð  #Kñ  K‘Jñ	Kñ
	KðKð4 Ðùò? Us
   �
C8šC8Úfirst_subject_houses_listÚstandard_house_cusp_colorÚfirst_house_colorÚtenth_house_colorÚseventh_house_colorÚfourth_house_colorÚsecond_subject_houses_listÚtransit_house_cusp_colorÚexternal_viewc                 óŠ  — d}d}t        |«      D �]/  }|	dv rdn||df\  }}}t        |t        |dz  «         j                  «      dz  t        ||   j                  «      z   }t        d| |z
  |«      |z   }t	        d| |z
  |«      |z   }t        d| |z
  |«      |z   }t	        d| |z
  |«      |z   }|d	z   |z  }|t        t        ||   j                  ||   j                  «      dz  «      z   }||||d
œj                  ||«      }|	dv �rs|
�|€t        d«      ‚d|d   j                  z
  }||
|   j                  z   dz  }t        d| |z
  |«      |z   }t	        d| |z
  |«      |z   }t        d| |«      }t	        d| |«      } |t        t        |
|   j                  |
|   j                  «      dz  «      z   }!|d
v r|n|}"t        d| dz
  |!«      dz   }#t	        d| dz
  |!«      dz   }$|	dk(  rdnd}%|dz  }|d|%› d|#dz
  › d|$dz   › d|d	z   › d�	z  }|dz  }|	dk(  rdnd}&|d|
|   j                  › d|
|   j                  › d|
|   j                  › d|
|   j                  › d�	z  }|d|› d |› d!|› d"| › d#|"› d$|&› d%�z  }|dz  }d&d&d&dœ}'|rd'}n|'j                  |	d(«      }t        d| |z
  |«      |z   }#t	        d| |z
  |«      |z   }$|d||   j                  › d||   j                  › d||   j                  › d||   j                  › d�	z  }|d)|› d*|› d+|› d,|› d-|› d.�z  }|dz  }|dz  }|d/|#dz
  › d|$dz   › d|d	z   › d�z  }|dz  }�Œ2 |S )0a†  
    Draw the house cusp lines and house numbers for a chart.

    This function renders the 12 house cusp lines radiating from the center
    of the chart, with special colors for angular houses (1st, 4th, 7th, 10th).
    For dual-wheel charts, it also draws the secondary subject's house cusps.

    Args:
        r: Radius of the chart in pixels.
        first_subject_houses_list: List of house models for the primary subject.
        standard_house_cusp_color: Default CSS color for house cusp lines.
        first_house_color: CSS color for the Ascendant (1st house) cusp.
        tenth_house_color: CSS color for the Midheaven (10th house) cusp.
        seventh_house_color: CSS color for the Descendant (7th house) cusp.
        fourth_house_color: CSS color for the IC (4th house) cusp.
        c1: Inner radius offset for cusp lines.
        c3: Outer radius offset for cusp lines.
        chart_type: Type of chart being rendered.
        second_subject_houses_list: House models for secondary subject (Transit/Synastry).
        transit_house_cusp_color: CSS color for transit house cusps.
        external_view: If True, renders for external/traditional view mode.

    Returns:
        SVG string containing house cusp lines and numbered labels.

    Raises:
        KerykeionException: If chart_type requires second_subject_houses_list
            or transit_house_cusp_color but they are None.
    rî   é   )r‹   rŠ   rŒ   )re  rD  r‡   Fr•   rÝ   r   r”   )r   é	   rÕ   r–   zAsecond_subject_houses_list_ut or transit_house_cusp_color is Noner¿   rÕ   é   r‹   Ú0z.4z<g kr:node="HouseNumber">zL<text style="fill: var(--kerykeion-chart-color-house-number); fill-opacity: z; font-size: 14px"><tspan x="r–   rë   z">z</tspan></text>r  z.3z'<g kr:node="Cusp" kr:absoluteposition="z" kr:signposition="z" kr:sing="z" kr:slug="z
<line x1='z' y1='z' x2='z' y2='z' style='stroke: z$; stroke-width: 1px; stroke-opacity:z;'/>éT   éd   é0   rG  r  r  r  r  z@; stroke-width: 1px; stroke-dasharray:3,2; stroke-opacity:.4;"/>zk<text style="fill: var(--kerykeion-chart-color-house-number); fill-opacity: .6; font-size: 14px"><tspan x=")rI  rü   Úabs_posrÚ   rß   rÃ   rk   r	   Úpositionrñ   ru  )(rÛ   r‡  rˆ  r‰  rŠ  r‹  rŒ  rà   rc  r�   r�  rŽ  r�  ÚpathÚxrrK  rð   ÚroffÚt_roffr¨   r"  r#  r%  r&  Ú
next_indexÚtext_offsetÚ	linecolorÚ	zeropointÚt_offsetÚt_x1Út_y1Út_x2Út_y2Út_text_offsetÚt_linecolorÚxtextÚytextÚfill_opacityÚstroke_opacityÚ
dropin_maps(                                           rq   Ú!draw_houses_cusps_and_text_numberr®  î  s,  € ðZ €DØ	€Bä�2‹Yó Mˆð (Ð+UÑU‰MÐ\^Ð`bÐdiÐ[jñ 	ˆ��fô
 Ð/´°B¸±F³Ñ<×DÑDÓEÈÑJÌcÐRkÐlmÑRn×RvÑRvÓNwÑwˆô �a˜!˜f™* vÓ.°Ñ7ˆÜ�a˜!˜f™* vÓ.°Ñ7ˆÜ�a˜˜T™ 6Ó*¨TÑ1ˆÜ�a˜˜T™ 6Ó*¨TÑ1ˆð ˜!‘e˜r‘\ˆ
ØœsÜÐ0°Ñ<×DÑDÐF_Ð`aÑFb×FjÑFjÓkÐnoÑoó 
ñ 
ˆð
 *Ð.?ÐDWÐ\nÑo×sÑsØÐ(ó
ˆ	ð ÐCÒCØ)Ð1Ð5MÐ5UÜ(Ð)lÓmÐmð Ð7¸Ñ:×BÑBÑBˆIØ!Ð$>¸qÑ$A×$IÑ$IÑIÈSÑPˆHô ˜A  F¡
¨XÓ6¸Ñ?ˆDÜ˜A  F¡
¨XÓ6¸Ñ?ˆDÜ˜A˜q (Ó+ˆDÜ˜A˜q (Ó+ˆDð %¤sÜÐ5°jÑA×IÑIÐKeÐfgÑKh×KpÑKpÓqÐtuÑuó(ñ ˆMð ()¨LÑ'8™)Ð>VˆKÜ˜Q  Q¡¨Ó7¸!Ñ;ˆEÜ˜Q  Q¡¨Ó7¸!Ñ;ˆEð #-°	Ò"9™3¸tˆLØÐ/Ñ/ˆDØÐbÐcoÐbpð  qNð  OTð  WXñ  OXð  NYð  Y^ð  _dð  ghñ  _hð  ^ið  ikð  lmð  pqñ  lqð  krð  rAð  Bñ  BˆDØ�F‰NˆDð %/°)Ò$;™SÀˆNØÐ=Ð>XÐYZÑ>[×>cÑ>cÐ=dÐdwð  ySð  TUñ  yV÷  y_ñ  y_ð  x`ð  `kð  lFð  GHñ  lI÷  lNñ  lNð  kOð  OZð  [uð  vwñ  [x÷  [}ñ  [}ð  Z~ð  ~@ð  Añ  AˆDØ�j   f¨T¨F°&¸¸¸fÀTÀFÐJ[Ð\gÐ[hð  iMð  N\ð  M]ð  ]að  bñ  bˆDØ�F‰NˆDð "$°ÈÑKˆ
ÙØ‰Fà—^‘^ J°Ó3ˆFÜ˜˜Q ™Z¨+Ó6¸Ñ?ˆÜ˜˜Q ™Z¨+Ó6¸Ñ?ˆð 	Ð9Ð:SÐTUÑ:V×:^Ñ:^Ð9_Ð_rð  tMð  NOñ  tP÷  tYñ  tYð  sZð  Zeð  fð  @Añ  fB÷  fGñ  fGð  eHð  HSð  Tmð  noñ  Tp÷  Tuñ  Tuð  Svð  vxð  yñ  	yˆØ�*˜R˜D  r d¨&°°°F¸2¸$Ð>OÐPYÈ{ð  [[ð  \ñ  	\ˆØ�‰ˆð 	Ð+Ñ+ˆØÐ}ð  Dð  GHñ  Hð  ~Ið  INð  OTð  WXñ  OXð  NYð  Y[ð  \]ð  `añ  \að  [bð  bqð  rñ  	rˆØ�‰Šð[Mð^ €KrŸ   rn  r–  rÕ   i5  i  )Úaspects_per_columnÚcolumn_widthÚline_heightÚmax_columnsÚchart_heightÚx_offsetÚy_offsetÚ
grid_titleÚaspects_listÚaspects_settingsr¯  r°  r±  r²  r³  r´  rµ  c          	      ó²  ‡(— t        |t        «      rt        di |¤Ž}|r+t        |d   t        «      r|D �cg c]  }t        di |¤Ž‘Œ }}|}|	}|
}d}| |z   }d}|dz
  }t	        j
                  ||z  «      }||z
  dz   }d}d}|�At        ||z
  |z
  |«      }t        |t        ||z  «      «      }t        |t        ||«      «      }n|}g }g }|D ]n  }|rt        |d   «      |d   k\  rBt        |«      }||k  r|n|}t        |d«      }|j                  g «       |j                  |«       |d   j                  |«       Œp t        |«      D ]é  \  }}||   }||z  } t        |«      }!t        |«      D ]Á  \  }"}|"|z  }#||k\  r||!dz
  |"z
  z
  }$|$|z  }#n*||k\  r%||k(  r t        d|t        |«      z
  «      }%|%|"z   |z  }#|d	| › d
|#› d�z  }|d||d      d   › d�z  }|d   Š(t        ˆ(fd„|D «       d«      }&|d|&› d�z  }|dz  }|d||d      d   › d�z  }|dz  }|dt        |d   «      › d�z  }|dz  }ŒÃ Œë d	|› d
|› d�}'|'d| › d�z  }'|'|z  }'|'dz  }'|'S c c}w )aœ  
    Generate SVG output for the aspect list panel in transit/synastry charts.

    This function creates a multi-column list showing all active aspects
    between planets, with their orbs and aspect symbols. The layout
    dynamically adjusts columns based on the number of aspects.

    Args:
        grid_title: Title displayed above the aspect list.
        aspects_list: List of AspectModel instances or aspect dictionaries.
        celestial_point_language: Language model for translating planet names.
        aspects_settings: Dictionary mapping aspect names to their settings.
        aspects_per_column: Maximum aspects per column before wrapping.
        column_width: Width of each column in pixels.
        line_height: Vertical spacing between aspect rows in pixels.
        max_columns: Maximum columns before using vertical space optimization.
        chart_height: Total chart height for calculating extended column capacity.
        x_offset: Horizontal origin of the aspect list group (default 565).
        y_offset: Vertical origin of the aspect list group (default 273).

    Returns:
        SVG string containing the formatted aspect list with title.
    r   rê   é(   r”   rî   é
   NrÝ   ú<g transform="translate(ræ   ú)">z5<use transform="scale(0.4)" x="0" y="3" xlink:href="#rv  ru  r  r  c              3   ó:   •K  — | ]  }|d    ‰k(  sŒ|d   –— Œ y­w)ru  ÚdegreeNrÈ   )Ú.0r¼   Úaspect_names     €rq   ú	<genexpr>z+draw_transit_aspect_list.<locals>.<genexpr>á  s!   øè ø€ Ò_¨QÀaÈÁiÐS^ÓF^˜Q˜x�[Ñ_ùs   ƒ‘
z"<use x="15" y="0" xlink:href="#orbz<g transform="translate(30,0)">rx  r  zX<text y="8" x="45" style="fill: var(--kerykeion-chart-color-paper-0); font-size: 10px;">r  ú</text>zY<text y="-15" x="0" style="fill: var(--kerykeion-chart-color-paper-0); font-size: 14px;">z:</text>rÈ   )r  rj   r   r   r™   rš   r˜   rü   r—   r{   r  r|  ÚnextrB  ))r¶  r·  r«   r¸  r¯  r°  r±  r²  r³  r´  rµ  r  Útyped_aspects_listÚtranslate_xÚtranslate_yÚtitle_clearanceÚtop_limit_yÚbottom_paddingÚbaseline_indexÚtop_limit_indexÚmax_capacity_by_topÚ
inner_pathÚfull_height_column_indexÚavailable_heightÚallowed_capacityÚfull_height_capacityÚcolumnsÚcolumn_capacitiesÚnew_col_indexÚcapacityÚcol_idxr¦   Úhorizontal_positionÚ
column_lenÚrow_idxÚvertical_positionÚvertical_indexÚtop_offset_linesÚid_valuerJ  rÁ  s)                                           @rq   Údraw_transit_aspect_listrß  p  sÊ  ø€ ôP Ð*¬DÔ1Ü#GÑ#cÐJbÑ#cÐ ñ œ
 <°¡?´DÔ9Ø<HÖI°&œÑ- fÓ-ÐIˆÐIð -9Ðà€KØ€KØ€OØ%˜¨Ñ7€KØ€NØ'¨!Ñ+€NÜ—i‘i ¨kÑ 9Ó:€Oð )¨?Ñ:¸QÑ>Ðà€Jà!ÐØÐÜ˜|¨kÑ9¸NÑJÈKÓXÐÜÐ1´3Ð7GÈ;Ñ7VÓ3WÓXÐÜ"Ð#5´sÐ;KÐM`Ó7aÓbÑà1Ðð (*€GØ#%Ðà$ò #ˆÙœ#˜g b™kÓ*Ð.?ÀÑ.CÒCÜ ›LˆMØ-:Ð=UÒ-UÑ)Ð[oˆHÜ˜8 QÓ'ˆHØ�N‰N˜2ÔØ×$Ñ$ XÔ.Ø�‰×Ñ˜6Õ"ð#ô % WÓ-ò '!‰ˆ�Ø$ WÑ-ˆØ%¨Ñ4ÐÜ˜“[ˆ
ä(¨Ó0ò "	!‰OˆG�Và '¨+Ñ 5Ðð Ð2Ò2Ø!/°:À±>ÀGÑ3KÑ!L�Ø$2°[Ñ$@Ñ!ð ˜KÒ'¨HÐ8JÒ,JÜ#& q¨(´S¸³[Ñ*@Ó#AÐ Ø%5¸Ñ%?À;Ñ$NÐ!àÐ4Ð5HÐ4IÈÐK\ÐJ]Ð]`ÐaÑaˆJð ÐQÐRjÐkqÐrvÑkwÑRxÐyñ  SAð  RBð  BFð  Gñ  GˆJð ! Ñ*ˆKÜÓ_Ð2BÔ_ÐaeÓfˆHØÐ>¸x¸jÈÐMÑMˆJð Ð;Ñ;ˆJØÐQÐRjÐkqÐrvÑkwÑRxÐyñ  SAð  RBð  BFð  Gñ  GˆJØ˜&Ñ ˆJð Ðtô  vVð  W]ð  ^eñ  Wfó  vgð  uhð  hoð  pñ  pˆJà˜&Ñ ‰JñE"	!ð'!ðR % [ M°°;°-¸sÐ
C€CØØ
cÐdnÐcoÐowÐxñ€Cð ˆ:Ñ€CØˆ6�M€Cà€Jùòq Js   ¶IÚdegrees_between_sun_and_moonc                 óô   — t        j                  | «      st        d| › �«      ‚| dz  }t        j                  |«      }t        j                  |«      }d|z
  dz  }t        dt        d|«      «      }||d|z  dœS )a  
    Calculate normalized parameters used by the moon phase icon.

    This function computes the geometric parameters needed to render an accurate
    lunar phase visualization based on the angular separation between the Sun
    and Moon.

    Args:
        degrees_between_sun_and_moon: The elongation (angular separation) between
            the Sun and Moon in degrees. Values are normalized to 0-360 range.

    Returns:
        Dictionary containing:
            - phase_angle: Normalized angle (0-360 degrees)
            - illuminated_fraction: Fraction of moon illuminated (0.0 to 1.0)
            - shadow_ellipse_rx: Horizontal radius for the shadow ellipse

    Raises:
        KerykeionException: If degrees_between_sun_and_moon is not a finite number.
    zInvalid degree value: rF  r    r#   rx   ç      $@)Úphase_angleÚilluminated_fractionÚshadow_ellipse_rx)r™   Úisfiniter	   r  r×   r˜   r—   )rà  rã  r  Úcosinerä  s        rq   Ú!calculate_moon_phase_chart_paramsrè  ø  s‹   € ô* �=‰=Ð5Ô6Ü Ð#9Ð:VÐ9WÐ!XÓYÐYà.°Ñ6€KÜ�l‰l˜;Ó'€GÜ�X‰X�gÓ€FØ &™L¨CÑ/Ðô ˜s¤C¨Ð-AÓ$BÓCÐð #Ø 4Ø! F™]ñð rŸ   Úmain_subject_houses_listÚhouse_cusp_generale_name_labelÚ
text_colorÚ
x_positionÚ
y_positionc                 óà   — d|› d|› d�}d}t        | «      D ]O  \  }}|dk  rd|dz   › �nt        |dz   «      }	|d|› d	|› d
|› d|	› d|d   › d|› dt        |d   «      › d�z  }|dz  }ŒQ |dz  }|S )a"  
    Generate SVG code for a grid of astrological houses for the main subject.

    Parameters:
    - main_subject_houses_list (list[KerykeionPointModel]): List of houses for the main subject.
    - house_cusp_generale_name_label (str): Label for the house cusp. Defaults to "Cusp".
    - text_color (str): Color of the text. Defaults to "#000000".
    - x_position (int): X position for the grid. Defaults to 720.
    - y_position (int): Y position for the grid. Defaults to 30.

    Returns:
    - str: The SVG code for the grid of houses.
    r¼  ræ   r½  r»  r’  ú&#160;&#160;r”   ú<g transform="translate(0,ú.)"><text text-anchor="end" x="40" style="fill:ú; font-size: 10px;">ú úQ:</text><g transform="translate(40,-8)"><use transform="scale(0.3)" xlink:href="#rñ   ú!" /></g><text x="53" style="fill:ú; font-size: 10px;"> r™  ú</text></g>rn  r  ©r|  rï   rB  )
ré  rê  rë  rì  rí  r}  Úline_incrementrK  ÚhouseÚcusp_numbers
             rq   Údraw_main_house_gridrü  &  sè   € ð( ,¨J¨<°q¸¸ÀCÐH€Jà€NÜÐ6Ó7ò 	‰ˆˆ5Ø01°A²˜ Q¨¡U GÑ,¼3¸qÀ1¹u»:ˆØØ(¨Ð(8ð 9:Ø:D¸ÐEYÐZxÐYyÐyzð  |Gð  {Hð HXØX]Ð^dÑXeÐWfð g(Ø(2 |Ð3HÔIiÐjoÐpzÑj{ÓI|ÐH}ð ~ðñ	
ˆ
ð 	˜"Ñ‰ð	ð �&Ñ€JØÐrŸ   Úsecondary_subject_houses_listc                 óà   — d|› d|› d�}d}t        | «      D ]O  \  }}|dk  rd|dz   › �nt        |dz   «      }	|d|› d	|› d
|› d|	› d|d   › d|› dt        |d   «      › d�z  }|dz  }ŒQ |dz  }|S )a1  
    Generate SVG code for a grid of astrological houses for the secondary subject.

    Parameters:
    - secondary_subject_houses_list (list[KerykeionPointModel]): List of houses for the secondary subject.
    - house_cusp_generale_name_label (str): Label for the house cusp. Defaults to "Cusp".
    - text_color (str): Color of the text. Defaults to "#000000".
    - x_position (int): X position for the grid. Defaults to 970.
    - y_position (int): Y position for the grid. Defaults to 30.

    Returns:
    - str: The SVG code for the grid of houses.
    r¼  ræ   r½  r»  r’  rï  r”   rð  rñ  rò  ró  rô  rñ   rõ  rö  r™  r÷  rn  r  rø  )
rý  rê  rë  rì  rí  r}  rù  rK  rú  rû  s
             rq   Údraw_secondary_house_gridrÿ  L  sè   € ð( ,¨J¨<°q¸¸ÀCÐH€Jà€NÜÐ;Ó<ò 	‰ˆˆ5Ø01°A²˜ Q¨¡U GÑ,¼3¸qÀ1¹u»:ˆØØ(¨Ð(8ð 9:Ø:D¸ÐEYÐZxÐYyÐyzð  |Gð  {Hð HXØX]Ð^dÑXeÐWfð g(Ø(2 |Ð3HÔIiÐjoÐpzÑj{ÓI|ÐH}ð ~ðñ	
ˆ
ð 	˜"Ñ‰ð	ð �&Ñ€JØÐrŸ   Úplanets_and_houses_grid_titleÚsubject_nameÚ$available_kerykeion_celestial_pointsc                 ó‚  — d}d}	d}
d}d|› d|› d�}|dv r|d	|	› d
|› d| › d|› d�	z  }d}t        |t        |«      «      }t        |«      D ]m  \  }}t        ||«      \  }}|
||z  z   }t	        |d   |«      }|d|› d||z   › d|› d|› d|d   › d|› dt        |d   «      › d|d   › d�z  }|d   r|dz  }||z  }Œo |dz  }|S )an  
    Draw the planet grid (main subject) and optional title.

    The entire output is wrapped in a single SVG group `<g>` so the
    whole block can be repositioned by changing the group transform.

    Args:
        planets_and_houses_grid_title: Title prefix to show for eligible chart types.
        subject_name: Subject name to append to the title.
        available_kerykeion_celestial_points: Celestial points to render in the grid.
        chart_type: Chart type identifier (Literal string).
        celestial_point_language: Language model for celestial point decoding.
        text_color: Text color for labels (default: "#000000").
        x_position: X translation applied to the outer `<g>` (default: 620).
        y_position: Y translation applied to the outer `<g>` (default: 0).

    Returns:
        SVG string for the main planet grid wrapped in a `<g>`.
    é   rè   r»  rn  r¼  ræ   r½  r‰   z<g transform="translate(0, ú)"><text style="fill:ú; font-size: 14px;">ró  r÷  r  ru  ú')"><text text-anchor="end" style="fill:rò  úO</text><g transform="translate(5,-8)"><use transform="scale(0.4)" xlink:href="#ú5" /></g><text text-anchor="start" x="19" style="fill:r™  úP</text><g transform="translate(60,-8)"><use transform="scale(0.3)" xlink:href="#rñ   rí   Ú
retrogradeúZ<g transform="translate(74,-6)"><use transform="scale(.5)" xlink:href="#retrograde" /></g>©rž   r{   r|  r©   r°   rB  )r   r  r  r�   r«   rë  rì  rí  ÚBASE_YÚHEADER_YÚ
LINE_STARTÚ	LINE_STEPr}  Úend_of_lineÚcolumn_thresholdsrK  r  r¨   Ú	row_indexr±  Údecoded_names                        rq   Údraw_main_planet_gridr  x  s   € ð< €FØ€HØ€JØ€Ið ,¨J¨<°q¸¸ÀCÐH€Jð Ð?Ñ?ØØ)¨(¨ð 4!Ø!+ Ð,@ÐA^Ð@_Ð_`ÐamÐ`nð oðñ	
ˆ
ð €Kä6°zÄ3ÐGkÓClÓmÐäÐCÓDò "‰	ˆˆ6Ü8¸Ð<MÓNÑˆ�	Ø  I°	Ñ$9Ñ:ˆäAØ�6‰NØ$ó
ˆð
 	Ø& v h¨a°¸Ñ0DÐ/Eð F3Ø3=°,Ð>RÐS_ÐR`ð aWØW]Ð^dÑWeÐVfð g<Ø<F¸<ÐG[Ô\|ð  ~Dð  EOñ  ~Pó  ]Qð  \Rð RXØX^Ð_eÑXfÐWgÐgoð	qñ	
ˆ
ð �,ÒØÐvÑvˆJà�kÑ!‰
ð)"ð. �&Ñ€JàÐrŸ   Úsecond_subject_nameÚ3second_subject_available_kerykeion_celestial_pointsc                 ó¬  — d}d}	d}
d}d|› d|› d�}|dk(  r|n| › d	|› �}|dk(  rd
nd}|d|› d|	› d|› d|› d�	z  }|
}d}t        |t        |«      «      }t        |«      D ]m  \  }}t        ||«      \  }}|
||z  z   }t	        |d   |«      }|d|› d||z   › d|› d|› d|d   › d|› dt        |d   «      › d|d   › d�z  }|d   r|dz  }||z  }Œo |dz  }|S )a—  
    Draw the planet grid for the secondary subject and its title.

    The entire output is wrapped in a single SVG group `<g>` so the
    whole block can be repositioned by changing the group transform.

    Args:
        planets_and_houses_grid_title: Title prefix (used except for Transit charts).
        second_subject_name: Name of the secondary subject.
        second_subject_available_kerykeion_celestial_points: Celestial points to render for the secondary subject.
        chart_type: Chart type identifier (Literal string).
        celestial_point_language: Language model for celestial point decoding.
        text_color: Text color for labels (default: "#000000").
        x_position: X translation applied to the outer `<g>` (default: 870).
        y_position: Y translation applied to the outer `<g>` (default: 0).

    Returns:
        SVG string for the secondary planet grid wrapped in a `<g>`.
    r  rè   r»  rn  r¼  ræ   r½  r‹   ró  iÎÿÿÿr   ú, r  r  r÷  r  ru  r  rò  r  r	  r™  r
  rñ   rí   r  r  r  )r   r  r  r�   r«   rë  rì  rí  r  r  r  r  r}  Úheader_textÚheader_x_offsetr±  r  r  rK  Út_planetr¨   r  Úsecond_decoded_names                          rq   Údraw_secondary_planet_gridr  Æ  sÒ  € ð< €FØ€HØ€JØ€Ið ,¨J¨<°q¸¸ÀCÐH€Jð  *¨YÒ6ÑÐ?\Ð>]Ð]^Ð_rÐ^sÐ<tð ð (¨9Ò4‘c¸!€OàØ
" ?Ð"3°2°h°Zð @Ø'˜LÐ(<¸[¸Mð Jð	ñ€Jð €KØ€Kä6Ø”CÐKÓLóÐô !Ð!TÓUò "‰ˆˆ8Ü8¸Ð<MÓNÑˆ�	Ø  I°	Ñ$9Ñ:ˆäHØ�VÑØ$ó
Ðð 	Ø& v h¨a°¸Ñ0DÐ/Eð F3Ø3=°,Ð>RÐSfÐRgð hWØW_Ð`fÑWgÐVhð i<Ø<F¸<ÐG[Ô\|ð  ~Fð  GQñ  ~Ró  ]Sð  \Tð TXØX`ÐagÑXhÐWiÐiqð	sñ	
ˆ
ð �LÒ!ØÐvÑvˆJà�kÑ!‰
ð'"ð, �&Ñ€JàÐrŸ   Úx_indentÚy_indentr~  c                 óÒ  — d}d| › d�}|}|}	|D �
cg c]
  }
|
d   sŒ	|
‘Œ }}
|ddd…   }t        |«      D ]=  \  }}|d|› d|	› d	|› d
|› d|› d�z  }|d|dz   dz  › d|	dz   dz  › d|d   › d�z  }||z  }Œ? ||z
  }||z
  }	t        |«      D ]=  \  }}|d|› d|	› d	|› d
|› d|› d�z  }|d|dz   dz  › d|	dz   dz  › d|d   › d�z  }|	|z  }	Œ? |}|}	|	|z
  }	t        |«      D ]�  \  }}|d|› d|	› d	|› d
|› d|› d�z  }|	|z  }	|}|	|z   }|D ]V  }|d|› d|› d	|› d
|› d|› d�z  }||z  }|D ]5  }|d   |d   k(  sŒ|d   |d   k(  sŒ|d||z
  dz   › d|dz   › d|d   › d�z  }Œ7 ŒX Œƒ |S c c}
w )a4  
    Draw a rectangular aspect grid for transit charts.

    Unlike the triangular natal aspect grid, this grid shows all planet
    combinations in a full matrix format, suitable for comparing aspects
    between natal and transit planets.

    Args:
        stroke_color: CSS color for the grid lines.
        available_planets: List of planet dictionaries. Only planets with
            "is_active" set to True will be included.
        aspects: List of aspect dictionaries containing p1, p2, and aspect_degrees.
        x_indent: X-coordinate for the grid's left edge.
        y_indent: Y-coordinate for the grid's top edge.
        box_size: Width and height of each grid cell in pixels.

    Returns:
        SVG string containing the transit aspect grid.
        str: SVG string representing the aspect grid.
    rî   rl  rm  ro  NrÝ   z	<rect x="rë   rp  rq  rr  rç   rs  r•   rt  r”   rì   ru  r  rv  rw  rx  ry  rz  r  r{  )rM  rg  rh  r   r!  r~  r}  rã   ri  rj  r  r€  r�  r    r‚  rƒ  r„  r…  r  s                      rq   Údraw_transit_aspect_gridr#  !  s  € ð8 €JØ�l�^Ð#VÐW€EØ€GØ€Gð ,=ÖT ÀÀ{Ó@S’fÐT€NÐTð &¡d¨ dÑ+ÐÜ$Ð%5Ó6ò ‰ˆˆxà˜	 ' ¨%°¨y¸	À(ÀÈ:ÐV^ÐU_Ð_hÐinÐhoÐorÐsÑsˆ
ØÐ7¸À1¹ÈÑ8KÐ7LÈEÐSZÐ]^ÑS^ÐbeÑReÐQfÐfuÐv~ð  @Fñ  wGð  vHð  HLð  Mñ  	Mˆ
Ø�8Ñ‰ð	ð ˜Ñ!€GØ˜Ñ!€Gä$Ð%5Ó6ò ‰ˆˆxà˜	 ' ¨%°¨y¸	À(ÀÈ:ÐV^ÐU_Ð_hÐinÐhoÐorÐsÑsˆ
ØÐ7¸À1¹ÈÑ8KÐ7LÈEÐSZÐ]^ÑS^ÐbeÑReÐQfÐfuÐv~ð  @Fñ  wGð  vHð  HLð  Mñ  	Mˆ
Ø�8Ñ‰ð	ð €GØ€GØ˜Ñ €Gä$Ð%5Ó6ò K‰ˆˆxà˜	 ' ¨%°¨y¸	À(ÀÈ:ÐV^ÐU_Ð_hÐinÐhoÐorÐsÑsˆ
ð 	�8Ñˆð ˆØ˜XÑ%ˆð )ò 
	KˆHàØ˜H˜: U¨8¨*°I¸h¸ZÀzÐRZÐQ[Ð[dÐejÐdkÐknÐoñˆJð ˜Ñ ˆHð "ò K�Ø˜$‘< 8¨D¡>Ó1°f¸T±lÀhÈtÁnÓ6TØ I¨h¸Ñ.AÀAÑ.EÐ-FÀeÈHÐWXÉLÈ>ÐYkÐlrð  tDñ  mEð  lFð  FJð  #Kñ  K‘JñKñ
	KðKð0 Ðùò_ Us
   ‘
E$œE$ÚlocationÚ
max_lengthc                 ó¼   — t        | «      |kD  rM| j                  d«      }t        |«      dkD  r&|d   dz   |d   z   }t        |«      |kD  r|d| dz   S |S | d| dz   S | S )aê  
    Format a location string to ensure it fits within a specified maximum length.

    If the location is longer than max_length, it attempts to shorten by using only
    the first and last parts separated by commas. If still too long, it truncates
    and adds ellipsis.

    Args:
        location: The original location string
        max_length: Maximum allowed length for the output string (default: 35)

    Returns:
        Formatted location string that fits within max_length
    ræ   r”   r   r  rÝ   Nz...)r{   Úsplit)r$  r%  Úsplit_locationÚ	shorteneds       rq   Úformat_location_stringr*  {  s   € ô ˆ8ƒ}�zÒ!Ø!Ÿ™¨Ó,ˆÜˆ~Ó Ò"Ø& qÑ)¨DÑ0°>À"Ñ3EÑEˆIÜ�9‹~ 
Ò*Ø   *Ð-°Ñ5Ð5ØÐà˜K˜ZÐ(¨5Ñ0Ð0Ø€OrŸ   Úiso_datetime_stringc                 ó‚   — t         j                   j                  | «      }|j                  d«      }|dd dz   |dd z   }|S )a  
    Format an ISO datetime string with a custom format that includes properly formatted timezone.

    Args:
        iso_datetime_string: ISO formatted datetime string

    Returns:
        Formatted datetime string with properly formatted timezone offset (HH:MM)
    z%Y-%m-%d %H:%M [%z]Néýÿÿÿú:)ÚdatetimeÚfromisoformatÚstrftime)r+  ÚdtÚcustom_formats      rq   Úformat_datetime_with_timezoner4  –  sM   € ô 
×	Ñ	×	(Ñ	(Ð)<Ó	=€BØ—K‘KÐ 5Ó6€MØ! # 2Ð&¨Ñ,¨}¸R¸SÐ/AÑA€MàÐrŸ   r   )rb   rc   Úplanets_settingsc                ó”   — |D �cg c]  }|j                  «       ‘Œ }}t        ||«      \  }}t        ||t        t        ||«      S c c}w )a  
    Calculate elemental totals for a subject using the selected strategy.

    Args:
        planets_settings: Planet configuration list (kept for API compatibility).
        celestial_points_names: Celestial point names to include.
        subject: Astrological subject with planetary data.
        method: Calculation method (pure_count or weighted). Defaults to weighted.
        custom_weights: Optional overrides for point weights keyed by name.

    Returns:
        Dictionary mapping each element to its accumulated total.
    )rh   rr   r‚   r   r   ©	r5  rt   rs   rb   rc   ru  Únormalized_namesro   rp   s	            rq   Úcalculate_element_pointsr9  ®  óU   € ð* 2HÖH¨˜Ÿ
™
�ÐHÐÐHÜ%;¸FÀNÓ%SÑ"€M�?ä.ØØÜÜØØóð ùò Ió   …AÚsubject1Úsubject2c                ó¾  — |D �cg c]  }|j                  «       ‘Œ }}t        ||«      \  }}	t        ||t        t        ||	«      }
t        ||t        t        ||	«      }t        D �ci c]  }||
|   ||   z   “Œ }}t        |j                  «       «      }|dk(  rt        D �ci c]  }|d“Œ c}S t        D �ci c]  }|||   |z  dz  “Œ c}S c c}w c c}w c c}w c c}w )a  
    Calculate combined element percentages for a synastry chart.

    Args:
        planets_settings: Planet configuration list (unused but preserved).
        celestial_points_names: Celestial point names to process.
        subject1: First astrological subject.
        subject2: Second astrological subject.
        method: Calculation strategy (pure_count or weighted).
        custom_weights: Optional overrides for point weights.

    Returns:
        Dictionary with element percentages summing to 100.
    r   rx   ç      Y@)rh   rr   r‚   r   r   ÚsumÚvalues©r5  rt   r<  r=  rb   rc   ru  r8  ro   rp   Úsubject1_totalsÚsubject2_totalsrl   Úcombined_totalsÚtotal_pointss                  rq   Ú!calculate_synastry_element_pointsrG  Ð  óþ   € ð. 2HÖH¨˜Ÿ
™
�ÐHÐÐHÜ%;¸FÀNÓ%SÑ"€M�?ä9ØØÜÜØØó€Oô :ØØÜÜØØó€Oô TaÖaÈC�s˜O¨CÑ0°?À3Ñ3GÑGÑGÐa€OÐaÜ�×-Ñ-Ó/Ó0€Là�qÒÜ$1Ö2˜S��S‘Ò2Ð2äJWÖXÀ3ˆC�/ #Ñ&¨Ñ5¸Ñ>Ñ>ÒXÐXùò5 Iùò( bùò 3ùâXó   …CÁ%CÂ 
CÂ5Cr”   z&var(--kerykeion-color-neutral-content)zHouse Position ComparisonzReturn PointrŒ   ÚRadixiL  )Úpoints_owner_subject_numberrë  Úhouse_position_comparison_labelÚreturn_point_labelÚreturn_labelÚradix_labelrì  rí  Úhouse_comparisonr   Úactive_pointsrK  )r”   r•   rL  rM  rN  rO  c                ó<  — |dk(  r| j                   }n| j                  }d|	› d|
› d�}|d|› d|› d�z  }d}|d	|› d
|› d|› d|› d|› d|› d|› d�z  }|dz  }i }|D ]Q  }|j                  |v sŒ|j                  |vsŒ!|j                  |j                  |j                  dœ||j                  <   ŒS |j                  «       D ]V  \  }}|j                  dd«      }|j                  dd«      }|d	|› d|› d|› dt        ||«      › d|› d|› d|› d|› d�z  }|dz  }ŒX |dz  }|S )ab  
    Generate SVG code for displaying a comparison of points across houses between two charts.

    Parameters:
    - house_comparison ("HouseComparisonModel"): Model containing house comparison data,
      including first_subject_name, second_subject_name, and points in houses.
    - celestial_point_language (KerykeionLanguageCelestialPointModel): Language model for celestial points
    - active_celestial_points (list[KerykeionPointModel]): List of active celestial points to display
    - text_color (str): Color for the text elements

    Returns:
    - str: SVG code for the house comparison grid.
    r”   r¼  ræ   r½  ú4<text text-anchor="start" x="0" y="-15" style="fill:r  rÃ  r»  rð  ú/)"><text text-anchor="start" x="0" style="fill:ú'; font-weight: bold; font-size: 10px;">ú4</text><text text-anchor="start" x="77" style="fill:z5</text><text text-anchor="start" x="132" style="fill:r÷  rè   )ru  Úsecondary_houseÚnative_houserX  ú-rW  úK)"><g transform="translate(0,-9)"><use transform="scale(0.4)" xlink:href="#ú5" /></g><text text-anchor="start" x="15" style="fill:rò  ú4</text><text text-anchor="start" x="90" style="fill:z5</text><text text-anchor="start" x="140" style="fill:r‘  r  )Úfirst_points_in_second_housesÚsecond_points_in_first_housesr}   Úprojected_house_numberÚpoint_owner_house_numberrg   rk   r°   )rP  r«   rQ  rK  rë  rL  rM  rN  rO  rì  rí  Úcomparison_datar}  rù  Úall_points_by_namer~   ru  Ú
point_datarX  rW  s                       rq   Údraw_house_comparison_gridrd    s  € ð6 # aÒ'Ø*×HÑH‰à*×HÑHˆà+¨J¨<°q¸¸ÀCÐH€Jð ÐHÈÈÐThð  jIð  iJð  JQð  Rñ  R€Jð €NØØ
$ ^Ð$4ð 57Ø7A°lÐBiÐj|Ði}ð ~8Ø8B°|ÐCjÐkwÐjxð y9Ø9C¸ÐDkÐlwÐkxð yð	ñ€Jð �bÑ€Nð Ðà ò ˆà×Ñ˜}Ò,°×1AÑ1AÐI[Ò1[à×(Ñ(Ø#(×#?Ñ#?Ø %× >Ñ >ñ4Ð˜u×/Ñ/Ò0ðð /×4Ñ4Ó6ò ÑˆˆjØ!—~‘~ n°cÓ:ˆØ$Ÿ.™.Ð):¸CÓ@ˆàØ(¨Ð(8ð 9WØW[ÐV\ð ]<Ø<F¸<ÐG[ô  ]Gð  HLð  Nfó  ]gð  \hð h<Ø<F¸<ÐG[Ð\hÐ[ið j=Ø=G¸LÐH\Ð]lÐ\mð nð	ñ	
ˆ
ð 	˜"Ñ‰ðð �&Ñ€JàÐrŸ   zNatal Housei  )rK  rë  rL  rM  Únatal_house_labelrì  rí  re  c                óê  — |dk(  r| j                   }
n| j                  }
d|› d|	› d�}|d|› d|› d�z  }d}|d	|› d
|› d|› d|› d|› d�z  }|dz  }i }|
D ]F  }|j                  |v sŒ|j                  |vsŒ!|j                  |j                  dœ||j                  <   ŒH |j	                  «       D ]>  \  }}|j                  dd«      }|d	|› d|› d|› dt        ||«      › d|› d|› d�z  }|dz  }Œ@ |dz  }|S )aú  
    Generate SVG code for displaying celestial points and their house positions.

    Parameters:
    - house_comparison ("HouseComparisonModel"): Model containing house comparison data,
      including first_subject_name, second_subject_name, and points in houses.
    - celestial_point_language (KerykeionLanguageCelestialPointModel): Language model for celestial points
    - active_points (list[AstrologicalPoint]): List of active celestial points to display
    - points_owner_subject_number (Literal[1, 2]): Which subject's points to display (1 for first, 2 for second)
    - text_color (str): Color for the text elements
    - house_position_comparison_label (str): Label for the house position comparison grid
    - return_point_label (str): Label for the return point column
    - house_position_label (str): Label for the house position column
    - x_position (int): X position for the grid
    - y_position (int): Y position for the grid

    Returns:
    - str: SVG code for the house position grid.
    r”   r¼  ræ   r½  rS  r  rÃ  r»  rð  rT  rU  rV  r÷  rè   )ru  rú  rú  rY  rZ  r[  rò  r\  r‘  r  )r]  r^  r}   r_  rg   rk   r°   )rP  r«   rQ  rK  rë  rL  rM  re  rì  rí  ra  r}  rù  rb  r~   ru  rc  rú  s                     rq   Ú!draw_single_house_comparison_gridrg  [  sÓ  € ð@ # aÒ'Ø*×HÑH‰à*×HÑHˆà+¨J¨<°q¸¸ÀCÐH€Jð ÐHÈÈÐThð  jIð  iJð  JQð  Rñ  R€Jð €NØØ
$ ^Ð$4ð 57Ø7A°lÐBiÐj|Ði}ð ~8Ø8B°|ÐCjÐk|Ðj}ð ~ð	ñ€Jð �bÑ€Nð Ðà ò uˆà×Ñ˜}Ò,°×1AÑ1AÐI[Ò1[Ø<A×<LÑ<LÐW\×WsÑWsÑ3tÐ˜u×/Ñ/Ò0ðuð /×4Ñ4Ó6ò 
ÑˆˆjØ—‘˜w¨Ó,ˆàØ(¨Ð(8ð 9WØW[ÐV\ð ]<Ø<F¸<ÐG[ô  ]Gð  HLð  Nfó  ]gð  \hð h<Ø<F¸<ÐG[Ð\aÐ[bð cðñ	
ˆ
ð 	˜"Ñ‰ð
ð �&Ñ€JàÐrŸ   zCusp Position Comparisonz
Owner CuspzProjected House)Úcusps_owner_subject_numberrë  Úcusp_position_comparison_labelÚowner_cusp_labelÚprojected_house_labelrì  rí  r   rh  ri  rj  rk  c                óx  — |dk(  r| j                   }	n| j                  }	|	syd|› d|› d|› d|› d�	}
d}|
d	|› d
|› d|› d|› d|› d�z  }
|dz  }|r|j                  «       d   nd}|	D ]L  }|j                  xs d}|r|› d|› �nd}t	        |j
                  «      }|
d	|› d
|› d|› d|› d|› d�z  }
|dz  }ŒN |
dz  }
|
S )a  
    Generate SVG code for displaying house cusps and their positions in reciprocal houses.

    Parameters:
    - house_comparison (HouseComparisonModel): House comparison data
    - celestial_point_language (KerykeionLanguageCelestialPointModel): Language settings
    - cusps_owner_subject_number (int): Which subject's cusps to display (1 or 2)
    - text_color (str): Color for text elements
    - cusp_position_comparison_label (str): Label for the comparison section
    - owner_cusp_label (str): Label for owner cusp column
    - projected_house_label (str): Label for projected house column
    - x_position (int): X position for the grid
    - y_position (int): Y position for the grid

    Returns:
    - str: SVG representation of the cusp comparison grid
    r”   rî   r¼  ræ   z7)"><text text-anchor="start" x="0" y="-15" style="fill:z'; font-size: 12px; font-weight: bold;">rÃ  r»  rð  rT  rU  z4</text><text text-anchor="start" x="70" style="fill:r÷  rè   rÝ   ÚCuspr   ró  rY  rò  r‘  r  )Úfirst_cusps_in_second_housesÚsecond_cusps_in_first_housesr'  r`  rï   r_  )rP  r«   rh  rë  ri  rj  rk  rì  rí  Ú
cusps_datar}  rù  Úcusp_cell_labelÚcuspÚowner_house_numberÚowner_house_displayÚprojected_house_displays                    rq   Údraw_cusp_comparison_gridrv  ©  sŠ  € ð< " QÒ&Ø%×BÑB‰
à%×BÑBˆ
áØð # : ,¨a°
¨|ð <?Ø?I¸lÐJqð  sQð  rRð  RYð	Zð ð €NØØ
$ ^Ð$4ð 57Ø7A°lÐBiÐjzÐi{ð |8Ø8B°|ÐCjð  lAð  kBð Bð	ñ€Jð �bÑ€Nñ 7GÐ&×,Ñ,Ó.¨rÒ2ÈF€Oàò ˆà!×:Ñ:Ò?¸aÐÙK] Ð 1°Ð3EÐ2FÑGÐcfÐÜ"% d×&AÑ&AÓ"BÐàØ(¨Ð(8ð 9;Ø;E¸,ÐFZÐ[nÐZoð p<Ø<F¸<ÐG[Ð\sÐ[tð uðñ	
ˆ
ð 	˜"Ñ‰ðð �&Ñ€JàÐrŸ   c                ó*   — t        | ||||||||¬«	      S )a  
    Generate SVG code for displaying house cusps and their positions in reciprocal houses (single grid).

    Parameters:
    - house_comparison (HouseComparisonModel): House comparison data
    - celestial_point_language (KerykeionLanguageCelestialPointModel): Language settings
    - cusps_owner_subject_number (int): Which subject's cusps to display (1 or 2)
    - text_color (str): Color for text elements
    - cusp_position_comparison_label (str): Label for the comparison section
    - owner_cusp_label (str): Label for owner cusp column
    - projected_house_label (str): Label for projected house column
    - x_position (int): X position for the grid
    - y_position (int): Y position for the grid

    Returns:
    - str: SVG representation of the cusp comparison grid
    ©	rP  r«   rh  rë  ri  rj  rk  rì  rí  )rv  rx  s	            rq   Ú draw_single_cusp_comparison_gridry  ô  s,   € ô: %Ø)Ø!9Ø#=ØØ'EØ)Ø3ØØô
ð 
rŸ   Úlatitudec           	      óÚ  ‡‡‡— t        | «      }|d   }d|d   z
  }t        |d   «      }dŠdŠdŠd}d}|d	k  }|d
k  r|}	d}
d}nNd|z
  d
k  r|}	d}
d}n?|dk\  }|r|}	|}|rdnd}n
|}	|}|rdnd}dt        dt        dt        fˆˆˆfd„} |||«      }
ddddddd|	› d�g}|
r|j	                  d|
› d|› d�«       |j	                  d«       |j	                  d«       d j                  |«      S )!a1  
    Generate SVG representation of lunar phase.

    Parameters:
    - degrees_between_sun_and_moon (float): Angle between sun and moon in degrees
    - latitude (float): Observer's latitude (no longer used, kept for backward compatibility)

    Returns:
    - str: SVG representation of lunar phase
    rã  r    rä  rå  râ  g      4@z*var(--kerykeion-chart-color-lunar-phase-1)z*var(--kerykeion-chart-color-lunar-phase-0)g     €f@ç�íµ ÷Æ°>rî   r1   ÚleftÚrightÚsideÚ
ellipse_rxrd   c                 ó  •— t        dt        ‰|«      «      }‰‰z
  }‰‰z   }| dk(  rdnd}|dk  r&d‰d›d|d›d	‰d›d‰d›d
|› d‰d›d|d›d‰d›d|d›d�S d‰d›d|d›d	‰d›d‰d›d
|› d‰d›d|d›d	|d›d‰d›d
|› d‰d›d|d›d�S )Nrx   r~  r”   r   r|  zM z.4fró  z A z 0 0 z L z Z)r˜   r—   )r  r€  Útop_yÚbottom_yÚcircle_sweepÚcenter_xÚcenter_yrÒ   s        €€€rq   Úbuild_lune_pathz'makeLunarPhase.<locals>.build_lune_pathT  s  ø€ Ü˜S¤# f¨jÓ"9Ó:ˆJØ˜vÑ%ˆEØ &Ñ(ˆHØ $¨¢™1°QˆLà˜TÒ!à˜ #˜ a¨¨c {Ø˜& ˜ Q v¨c l°%¸°~ÀQÀxÐPSÀnÐTUÐV^Ð_bÐUcØ˜( 3˜ q¨¨s¨Øððð �X˜c�N ! E¨# ;Ø�f˜S�\  6¨# ,¨e°L°>ÀÀ8ÈCÀ.ÐPQÐRZÐ[^ÐQ_Ø�j Ð% Q v¨c l°%¸°~ÀQÀxÐPSÀnÐTUÐV[Ð\_ÐU`ØððrŸ   z<g transform="rotate(0 20 10)">z
    <defs>z-        <clipPath id="moonPhaseCutOffCircle">z-            <circle cx="20" cy="10" r="10" />z        </clipPath>z    </defs>z0    <circle cx="20" cy="10" r="10" style="fill: r  z    <path d="r^  z," clip-path="url(#moonPhaseCutOffCircle)" />z–    <circle cx="20" cy="10" r="10" style="fill: none; stroke: var(--kerykeion-chart-color-lunar-phase-0); stroke-width: 0.5px; stroke-opacity: 0.5" />r  ú
)rè  rÁ   rï   ri   r  r   )rà  rz  Úparamsrã  rä  rå  Úbright_colorÚshadow_colorÚ	is_waxingÚ	base_fillÚoverlay_pathÚoverlay_fillÚis_lit_majorÚoverlay_sider‡  Ú	svg_linesr…  r†  rÒ   s                   @@@rq   ÚmakeLunarPhaser“  $  sq  ú€ ô /Ð/KÓL€Fà˜Ñ'€KØ Ð(>Ñ!?Ñ?ÐÜ˜FÐ#6Ñ7Ó8Ðà€FØ€HØ€Hà?€LØ?€Là˜eÑ#€Ià˜tÒ#Ø ˆ	ØˆØ‰Ø	Ð#Ñ	# tÒ	+Ø ˆ	ØˆØ‰à+¨sÑ2ˆÙØ$ˆIØ'ˆLÙ%.™6°G‰Là$ˆIØ'ˆLÙ&/™7°VˆLð
	¤#ð 	´5ð 	¼S÷ 	ñ* ' |Ð5FÓGˆð 	*ØØ7Ø7ØØØ
:¸9¸+ÀTÐJð€Iñ Ø×ÑØ˜L˜>¨¸¸ÐFrÐsô	
ð ×Ñð 	aôð ×Ñ�VÔà�9‰9�YÓÐrŸ   c                ó”   — |D �cg c]  }|j                  «       ‘Œ }}t        ||«      \  }}t        ||t        t        ||«      S c c}w )a  
    Calculate modality totals for a subject using the selected strategy.

    Args:
        planets_settings: Planet configuration list (kept for API compatibility).
        celestial_points_names: Celestial point names to include.
        subject: Astrological subject with planetary data.
        method: Calculation method (pure_count or weighted). Defaults to weighted.
        custom_weights: Optional overrides for point weights keyed by name.

    Returns:
        Dictionary mapping each modality to its accumulated total.
    )rh   rr   r‚   r   r   r7  s	            rq   Úcalculate_quality_pointsr•  ‚  r:  r;  c                ó¾  — |D �cg c]  }|j                  «       ‘Œ }}t        ||«      \  }}	t        ||t        t        ||	«      }
t        ||t        t        ||	«      }t        D �ci c]  }||
|   ||   z   “Œ }}t        |j                  «       «      }|dk(  rt        D �ci c]  }|d“Œ c}S t        D �ci c]  }|||   |z  dz  “Œ c}S c c}w c c}w c c}w c c}w )a  
    Calculate combined modality percentages for a synastry chart.

    Args:
        planets_settings: Planet configuration list (unused but preserved).
        celestial_points_names: Celestial point names to process.
        subject1: First astrological subject.
        subject2: Second astrological subject.
        method: Calculation strategy (pure_count or weighted).
        custom_weights: Optional overrides for point weights.

    Returns:
        Dictionary with modality percentages summing to 100.
    r   rx   r?  )rh   rr   r‚   r   r   r@  rA  rB  s                  rq   Ú!calculate_synastry_quality_pointsr—  ¤  rH  rI  )N)r   )TNg      0@)r=  )iþ  iÔ  )NNF)rm  ú#000000iî  r  )rm  r˜  i÷  r  )r˜  i…  r   )r˜  iŽ  r   )é2   éú   rn  )é#   )ZÚ__doc__r/  r™   Útypingr   r   r   r   r   Úkerykeion.schemasr   r	   Úkerykeion.schemas.kr_literalsr
   Úkerykeion.schemas.kr_modelsr   r   r   r   r   r   Ú!kerykeion.schemas.settings_modelsr   r   Ú ElementQualityDistributionMethodrü   ri   ÚNumberr   Útuplerï   Ú__annotations__r   r   r   r!   ra   rj   rr   r‚   r„   r†   rˆ   r�   r�   rž   r©   r°   r»   rÃ   rÅ   rÉ   Ú	timedeltarÐ   rÚ   rß   rò   r   r  ÚboolÚlistr8  rB  rL  rO  rX  r[  r_  rb  rf  r†  r®  rß  rè  rü  rÿ  r  r  r#  r*  r4  r9  rG  rd  rg  rv  ry  r“  r•  r—  rÈ   rŸ   rq   ú<module>r©     s’  ðòó" Û ß >Õ >ç ;Ý ;÷÷ ÷ð $+Ð+CÑ#DÐ  Ø Nð 
ˆs�EˆzÑ	€ð%Ð �%˜˜S˜‘/ó ð%Ð �%˜˜S˜‘/ó ð  "C€ˆu�S˜#�X‰Ó Bð "B€ˆu�S˜#�X‰Ó Að %(Ð ˜EÓ 'ðJ4à	ˆ3ðJ4ð ˆCðJ4ð �ð	J4ð
 �CðJ4ð �#ðJ4ð �#ðJ4ð ˆcðJ4ð �3ðJ4ð ˆsðJ4ð ˆSðJ4ð ˆCðJ4ð ˆsðJ4ð  ˆcð!J4ð$ ˆcð%J4ð& ˆsð'J4ð( ˆSð)J4ð, ˜Sñ-J4ð. ˜Sð/J4ð0 ˜Sð1J4ð2 ˜Sð3J4ð6 ˆcð7J4ð8 �3ð9J4ð: �3ð;J4ð> ˆSð?J4ð@ ˆcðAJ4ðB ˆCðCJ4ðD ˆSðEJ4ðF ˆcðGJ4ðJ ˆCðKJ4ðL ˆSðMJ4ðN ˆcðOJ4ðP �ðQJ4ðR ˆSðSJ4ðT ˆSòUJ4ðV ˆcðWJ4ðZ �Sð[J4ð\ �Sð]J4ð^ �3ð_J4ð` �#ðaJ4ðd ˆsðeJ4ðf ˆSðgJ4ðh �ðiJ4ðj ˆsðkJ4ðl ˆcðmJ4ðn �ðoJ4ðp ˆSðqJ4ðr �#ðsJ4ðt ˆsðuJ4ðv ˆsðwJ4ðx �ðyJ4ðz ˆcñ{J4ð| ØØØØØØØØØàòSJ4Ð   S¨% ZÑ 0ó Jðh 59ò*Ø,ð*à˜W S¨% ZÑ0Ñ1ð*ð ˆ4��U�
Ñ˜UÐ"Ñ#ó*ðD%ØÐ+Ð-BÐDUÐUÑVð%à$ S™Mð%ð   ‘}ð%ð ˜‘ð	%ð
 ˜3 ˜:Ñ&ð%ð ð%ð 
ˆ#ˆuˆ*Ñó%ðZ !#Ð ˜#Ó "Ø!Ð ˜Ó !Ø "Ð ˜#Ó "ð .XÐ �U˜9 c˜>Ñ*Ó Wð Ð �CÓ ò&<¨yð &<Àcð &<ÐRWÐX[Ð]`ÐbeÐXeÑRfó &<òR ¨ð  ¸À%ÈÈSÐRUÈÑBVÑ9Wð  ÐchÐilÐnqÐiqÑcró  ðPfØðfØ6Zðfàófð:�Sð ˜sð ¨ð °ó ð0!�%˜˜U˜
Ñ#ð !¨¨c°5¨jÑ(9ð !¸eó !ð
@��s˜E�zÑ"ð 
@ u¨S°%¨ZÑ'8ð 
@¸Uó 
@ð	4˜5  e Ñ,ð 	4°ó 	4ð  h×&8Ñ&8¸$Ð&>Ñ ?ð ÀEó ð6+�E˜#˜u˜*Ñ%ð +¨u°S¸%°ZÑ/@ð +È%ÐPSÐUZÐPZÑJ[ð +Ð`eó +ð.-�E˜#˜u˜*Ñ%ð -¨%°°U°
Ñ*;ð -ÀUÈ3ÐPUÈ:ÑEVð -Ð[`ó -ð8-Øˆc�5ˆjÑð-àð-ð # 3¨ :Ñ.ð-ð 
ð	-ð
 ˆS�%ˆZÑð-ð ð-ð ð-ð 	ó-ðj*°°s¸E°zÑ1Bð *ÐQTð *Ðcfð *Ðknó *ð,*°%¸¸U¸
Ñ2Cð *ÐQTð *Ðbeð *Ðjmó *ðB "ØHLØ&*ò[ØˆS�%ˆZÑð[àˆc�5ˆjÑð[ð �+˜tÐ#Ñ$ð[ð ð	[ð
 # 3¨ :Ñ.ð[ð ð[ð & d¨5°¸¸sÐ1BÑ+CÑ&DÑEð[ð $ð[ð 	ó[ò|;¨%ð ;¸gÀmÑ>Tð ;Ð_bó ;ðH e¨C°¨JÑ&7ð ÐRWÐX[Ð]bÐXbÑRcð Ðhkó ð< ØˆS�%ˆZÑð Ø# C¨ JÑ/ð ØJOÐPSÐUZÐPZÑJ[ð Øknð àó ðP˜˜s E˜zÑ*ð ¸3ð Ð]`ð Ðehó ð* cgò
ØˆS�%ˆZÑð
Ø(+ð
Ø9Bð
ØHMÈcÐSXÐZ^ÐN^ÑH_ð
àó
ð:˜e C¨ JÑ/ð ¸sð ÐPSð ÐX[ó ð$ txòfØˆS�%ˆZÑðfØ(+ðfØ9<ðfØJSðfØY^Ð_bÐdiÐkoÐ_oÑYpðfàófð6bØ�#�u�*ÑðbØ-0ðbØ>AðbØOXðbØ^cÐdgÐinÐdnÑ^oðbàóbð8 Øò=Øð=àð=ð ð=ð ð	=ð
 ð=ð 	ó=ðV JNØ15ØòØˆS�%ˆZÑðà#Ð$7Ñ8ðð  #ðð ð	ð
 ðð ðð ðð 	ˆc�5ˆjÑðð 	ˆc�5ˆjÑðð ðð !& dÐ+>Ñ&?ÀÐ&EÑ Fðð $ C¨ IÑ.ðð ðð 	óðT !ØØØØ04ØØòEØðEà˜˜[Ñ)¨4°©:Ð5Ñ6ðEð $Ø,¨g°c¸7À3ÈÀ8Ñ;LÐ6LÑ.MÈxÐX_Ð`cÐehÐ`hÑXiÑOjÐjñðEð ˜w s¨C xÑ0Ñ1ðEð ðEð ðEð ðEð ðEð ˜5  e Ñ,Ñ-ðEð ðEð ðEð 	óEðP$ÀEð $Èdó $ð` +1ØØØò#Ø"Ð#6Ñ7ð#à$'ð#ð ð#ð ð	#ð
 ð#ð 	ó#ðP +1ØØØò#Ø#'Ð(;Ñ#<ð#à$'ð#ð ð#ð ð	#ð
 ð#ð 	ó#ðd  ØØòKØ#&ðKàðKð +/Ð/BÑ*CðKð ð	Kð
 CðKð ðKð ðKð ðKð 	óKðh  ØØòRØ#&ðRàðRð :>Ð>QÑ9RðRð ð	Rð
 CðRð ðRð ðRð ðRð 	óRð~ ØØòQØðQàðQð ðQð ð	Qð
 ðQð ðQð 	óQòt Sð °cð À3ó ð6°sð ¸só ð: 0:Ø48òØÐCÑDðà$ S™Mðð Ð+Ð-BÐDUÐUÑVðð
 -ðð ˜W S¨% ZÑ0Ñ1ðð 
ˆ#ˆuˆ*ÑóðP 0:Ø48ò1YØÐCÑDð1Yà$ S™Mð1Yð 'ð1Yð 'ð	1Yð -ð1Yð ˜W S¨% ZÑ0Ñ1ð1Yð 
ˆ#ˆuˆ*Ñó1Yð@ 23Ø>Ø+FØ,Ø)ØØØòMØ,ðMàBðMð Ð)Ñ*ðMð
 ")¨¡ðMð ðMð &)ðMð ðMð ðMð ðMð ðMð ðMð 	óMðj 23Ø>Ø+FØ,Ø*ØØòKØ,ðKàBðKð Ð)Ñ*ðKð
 ")¨¡ðKð ðKð &)ðKð ðKð ðKð ðKð ðKð 	óKðd 12Ø>Ø*DÙ(Ù!2ØØóHØ,ðHáDñHð !(¨¡ð	Hð
 ñHð %(ñHð ñHð ðHð ðHð ðHð 	ôHð^ 12Ø>Ø*DÙ(Ù!2ØØó'Ø,ð'áDñ'ð !(¨¡ð	'ð
 ñ'ð %(ñ'ð ñ'ð ð'ð ð'ð ð'ð 	ô'ð`[ °ñ [ À%ð [ ÈCô [ ðF 0:Ø48òØÐCÑDðà$ S™Mðð Ð+Ð-BÐDUÐUÑVðð
 -ðð ˜W S¨% ZÑ0Ñ1ðð 
ˆ#ˆuˆ*ÑôðP 0:Ø48ò1YØÐCÑDð1Yà$ S™Mð1Yð 'ð1Yð 'ð	1Yð -ð1Yð ˜W S¨% ZÑ0Ñ1ð1Yð 
ˆ#ˆuˆ*Ñõ1YrŸ   