+
    =i             
         ^ RI Ht ^ RIt^ RIt^ RIt^ RIHtHtHtH	t	 ^ RI
H
t
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHtHt ^ R
IHtHt ^ RIHt ^ RIHt ^ RIHt  ^ RI!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t>H?t?H@t@HAtAHBtBHCtCHDtDHEtE ^ RIFHGtGHHtH ^ RIIHJtJHKtK ^ RILHMtN ^ RILHOtP ^ RIQHRtS ^ RITHUtUHVtV ^ RIWHXtX ^ RIYHZtZ ]P                  ! ] 4      t\]\P                  t]. ROt^ ! R/ R4      t_ ! R0 R&]4      t` ! R1 R.]4      taR2]`P                  R3]`P                  R4]`P                  R5]`P                  R6]`P                  /tgR7]aP                  R8]aP                  R9]aP                  /tk ! R: R;]4      tl ! R< R]l4      tm]m! ])!  tn ! R= R]4      toR> R? ltp] ! R@ R,4      4       tqRA RB ltrRC RD ltsRE^ RF^RG^RH^/tt ! RI R]4      tu ! RJ R4      tv ! RK R4      tw ! RL R(4      tx ! RM R'4      ty] ! RN RO4      4       tz ! RP R]z]U4      t{ ! RQ R*]{4      t| ! RR R-]{4      t} ! RS R+]{4      t~ ! RT R]~4      t ! RU R#]{4      t ! RV R]{4      t ! RW R!]{4      t ! RX R"]{4      t ! RY R$]{4      t ! RZ R)]{4      tR[ R\ ltR] R^ ltR_ R` ltRa tRb Rc ltRd Re ltRf tRRg Rh lltRi Rj lt]! ^
4       U u. uF  p ]! V 4      NK  	  up ]! ]! Rk4      ]! Rl4      ^,           4       U u. uF  p ]! V 4      NK  	  up ,           tRm Rn ltRo Rp ltRq Rr ltRs Rt ltRu Rv ltRw Rx ltRy Rz ltR{ R| ltRR} R~ lltR t]! 4        ! R R%4      4       t] ! R R 4      4       tR# u up i u up i )    )annotationsN)asdict	dataclassfieldfields)datetime	timedelta)IntEnum)Fraction)sha1)basename)packunpack)Any
NamedTuplewarn)round)__name__)$CHECKBOX_FALSE_VALUECHECKBOX_TRUE_VALUECURRENCY_CELL_TYPECUSTOM_TEXT_PLACEHOLDERDATETIME_FIELD_MAPDECIMAL128_BIASDECIMAL_PLACES_AUTODEFAULT_ALIGNMENTDEFAULT_BORDER_COLORDEFAULT_BORDER_STYLEDEFAULT_BORDER_WIDTHDEFAULT_DATETIME_FORMATDEFAULT_FONTDEFAULT_FONT_SIZEDEFAULT_TEXT_INSETDEFAULT_TEXT_WRAPEMPTY_STORAGE_BUFFEREPOCHMAX_BASEMAX_SIGNIFICANT_DIGITS
PACKAGE_IDSECONDS_IN_DAYSECONDS_IN_HOURSECONDS_IN_WEEKSTAR_RATING_VALUECellPaddingCellTypeControlFormattingTypeCustomFormattingTypeDurationStyleDurationUnitsFormattingType
FormatTypeFractionAccuracyNegativeNumberStylePaddingType)
CURRENCIESCURRENCY_SYMBOLS)UnsupportedErrorUnsupportedWarning)TSPMessages_pb2)TSTArchives_pb2)ParagraphStylePropertiesArchive)	Cacheablecache)NumbersUUID)xl_rangeRGB	AlignmentBackgroundImageBoolCellBorder
BorderTypeBulletedTextCellCell
CellBorderCustomFormattingDateCellDurationCell	EmptyCell	ErrorCell
FormattingHorizontalJustificationMergeAnchorMergeReference
MergedCell
NumberCellRichTextCellStyleTextCellVerticalJustificationc                  V    ] tR t^dtRtR
R R llt]R R l4       t]R R l4       tR	t	R# )rG   uZ  
A named document style that can be applied to cells.

.. code-block:: python

    fh = open("cats.png", mode="rb")
    image_data = fh.read()
    cats_bg = doc.add_style(
        name="Cats",
        bg_image=BackgroundImage(image_data, "cats.png")
    )
    table.write(0, 0, "❤️ cats", style=cats_bg)

Currently only standard image files and not 'advanced' image fills are
supported. Tiling and scaling is not reported back and cannot be changed
when saving new cells.

Parameters
----------
data: bytes
    Raw image data for a cell background image.
filename: str
    Path to the image file.

Nc               $    V ^8  d   QhRRRRRR/# )   datazbytes | Nonefilename
str | NonereturnNone )formats   "v/Users/tonyclaw/.openclaw/workspace/scripts/youtube-playlists/venv/lib/python3.14/site-packages/numbers_parser/cell.py__annotate__BackgroundImage.__annotate__   s"     , ,\ ,J ,RV ,    c                	2    Wn         \        V4      V n        R # N)_datar   	_filename)selfr`   ra   s   &&&rg   __init__BackgroundImage.__init__   s    
!(+rj   c                   V ^8  d   QhRR/# )r_   rc   bytesre   )rf   s   "rg   rh   ri      s      e rj   c                    V P                   # )zEbytes: The background image as bytes for a cell, or None if no image.)rm   ro   s   &rg   r`   BackgroundImage.data   s     zzrj   c                   V ^8  d   QhRR/# r_   rc   strre   )rf   s   "rg   rh   ri      s      # rj   c                    V P                   # )z8str: The image filename for a cell, or None if no image.)rn   ru   s   &rg   ra   BackgroundImage.filename   s     ~~rj   )rm   rn   )NN)
r   
__module____qualname____firstlineno____doc__rp   propertyr`   ra   __static_attributes__re   rj   rg   rG   rG   d   s4    4,    rj   c                      ] tR t^t]P
                  P                  t]P
                  P                  t	]P
                  P                  t]P
                  P                  t]P
                  P                  tRtR# )rT   re   N)r   r|   r}   r~   ParagraphStyleTextAlignmentType	TATvalue0LEFT	TATvalue1RIGHT	TATvalue2CENTER	TATvalue3	JUSTIFIED	TATvalue4AUTOr   re   rj   rg   rT   rT      sW    ++55D,,66E--77F00::I++55Drj   c                      ] tR t^t]P
                  P                  t]P
                  P                  t	]P
                  P                  tRtR# )r\   re   N)r   r|   r}   r~   r   DeprecatedParagraphBorderType	PBTvalue0TOP	PBTvalue1MIDDLE	PBTvalue2BOTTOMr   re   rj   rg   r\   r\      s5    

6
6
@
@C99CCF99CCFrj   leftrightcenter	justifiedautotopmiddlebottomc                  0    ] tR t^t$ RtR]R&   R]R&   RtR# )
_Alignmentz"Class for internal alignment type.ry   
horizontalverticalre   Nr   r|   r}   r~   r   __annotations__r   re   rj   rg   r   r      s    ,OMrj   r   c                  L   a  ] tR t^t]^ ,          ]^,          3V 3R lltRtV ;t# )rF   c                	Z  < \        V\        4      '       d6   VP                  4       pV\        9  d   R p\	        V4      h\        V,          p\        V\        4      '       d6   VP                  4       pV\
        9  d   Rp\	        V4      h\
        V,          p\        \        V `#  WV34      # )zinvalid horizontal alignmentzinvalid vertical alignment)	
isinstancery   lowerHORIZONTAL_MAP	TypeErrorVERTICAL_MAPsuperr   __new__)clsr   r   msg	__class__s   &&& rg   r   Alignment.__new__   s    j#&&#))+J/4n$'
3Jh$$~~'H|+2n$#H-HZ-c3IJJrj   re   )r   r|   r}   r~   r   r   r   __classcell__r   s   @rg   rF   rF      s      1! 4?PQR?S K Krj   c                  :    ] tR t^t$ RtR]R&   R]R&   R]R&   RtR# )rE   zA color in RGB.intrgbre   Nr   re   rj   rg   rE   rE      s    
F
F
Frj   c                   V ^8  d   QhRR/# r_   rc   rE   re   )rf   s   "rg   rh   rh      s      s rj   c                     \        ^ ^ ^ 4      # r   )rE   re   rj   rg   default_colorr      s    q!Q<rj   c                     ] tR t^t$ Rt]tR]R&   RtR]R&   Rt	R]R&   ]
! ]R	7      tR
]R&   ]tR]R&   ]tR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   ^ tR]R&   ^ tR]R&   ^ tR]R&   ]tR]R&   ]tR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   Rt R]R &   ]!R! 4       t"]!R" 4       t#]$R# R$ l4       t%R% t&R& R' lt'R(t(R# ))rZ   u  
A named document style that can be applied to cells.

Parameters
----------
alignment: Alignment, optional, default: Alignment("auto", "top")
    Horizontal and vertical alignment of the cell
bg_color: RGB | List[RGB], optional, default: RGB(0, 0, 0)
    Background color or list of colors for gradients
bold: bool, optional, default: False
    ``True`` if the cell font is bold
font_color: RGB, optional, default: RGB(0, 0, 0)) – Font color
font_size: float, optional, default: DEFAULT_FONT_SIZE
    Font size in points
font_name: str, optional, default: DEFAULT_FONT_SIZE
    Font name
italic: bool, optional, default: False
    ``True`` if the cell font is italic
name: str, optional
    Style name
underline: bool, optional, default: False) – True if the
    cell font is underline
strikethrough: bool, optional, default: False) – True if
    the cell font is strikethrough
first_indent: float, optional, default: 0.0) – First line
    indent in points
left_indent: float, optional, default: 0.0
    Left indent in points
right_indent: float, optional, default: 0.0
    Right indent in points
text_inset: float, optional, default: DEFAULT_TEXT_INSET
    Text inset in points
text_wrap: str, optional, default: True
    ``True`` if text wrapping is enabled

Raises
------
TypeError:
    If arguments do not match the specified type or for objects have invalid arguments
IndexError:
    If an image filename already exists in document

rF   	alignmentNobjectbg_imagezRGB | list[RGB]bg_colordefault_factoryrE   
font_colorfloat	font_sizery   	font_nameFboolbolditalicstrikethrough	underlinefirst_indentleft_indentright_indent
text_inset	text_wrapnamer   _text_style_obj_id_cell_style_obj_id_update_cell_style_update_text_stylec                 	
    . RO# )r   )r   r   r   r   r   r   r   r   r   r   r   r   r   re   re   rj   rg   _text_attrsStyle._text_attrs  s    
 	
rj   c                 	
    . RO# )r   )r   r   r   r   r   r   r   r   re   re   rj   rg   _cell_attrsStyle._cell_attrs)  s    	
 		
rj   c                    V ^8  d   QhRRRR/# )r_   cellr   modelre   )rf   s   "rg   rh   Style.__annotate__7  s     
 
 
v 
rj   c                	   VP                   e   \        VP                   !  MR p\        R/ RVP                  V4      bRVbRVP	                  V4      bRVP                  V4      bRVP                  V4      bRVP                  V4      bRVP                  V4      bRVP                  V4      bR	VP                  V4      bR
VP                  V4      bRVP                  V4      bRVP                  V4      bRVP                  V4      bRVP                  V4      bRVP!                  V4      bRVP#                  V4      bRVP%                  V4      bRVP'                  V4      b # )Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   re   )_image_datarG   rZ   cell_alignmentcell_bg_colorcell_font_colorcell_font_sizecell_font_namecell_is_boldcell_is_italiccell_is_strikethroughcell_is_underlinecell_style_namecell_first_indentcell_left_indentcell_right_indentcell_text_insetcell_text_wraptext_style_object_idcell_style_object_id)r   r   r   r   s   &&& rg   from_storageStyle.from_storage6  s   9=9I9I9U?D$4$45[_ 
**40

 ((.
 ,,T2	

 **40
 **40
 ##D)
 ''-
  55d;
 --d3
 &&t,
 006
 ..t4
 006
 ,,T2
  **40!
"  %99$?#
$  %99$?%
 	
rj   c                	   \        V P                  4      V n        \        V P                  4      V n        \        V P                  \
        4      '       g   R p\        V4      h\        V P                  \        4      '       g   Rp\        V4      hR F2  p\        \        W4      \        4      '       d   K$  V R2p\        V4      h	  R# )z%size must be a float number of pointszfont name must be a stringz argument must be booleanN)r   r   r   r   )	rgb_colorr   r   r   r   r   r   r   ry   getattrr   )ro   r   attrs   &  rg   __post_init__Style.__post_init__N  s    !$--0#DOO4$..%009CC. $..#...CC. DDgd148878n$ Erj   c               $    V ^8  d   QhRRRRRR/# )r_   r   ry   valuer   rc   rd   re   )rf   s   "rg   rh   r   ^  s!     ( ( (C (D (rj   c                   VR9   d   \        V4      pVR8X  d   \        V4      pV\        P                  4       9   d   RV P                  R&   V\        P                  4       9   d   RV P                  R&   VR9  d   W P                  V&   R# R# )za
Detect changes to cell styles and flag the style for
possible updates when saving the document.
r   Tr   r   Nr   r   )r   r   )r   r   rZ   r   __dict__r   )ro   r   r   s   &&&rg   __setattr__Style.__setattr__^  s    
 --e$E;e$E5$$&&26DMM./5$$&&26DMM./CC"'MM$ Drj   r   ))r   r|   r}   r~   r   DEFAULT_ALIGNMENT_CLASSr   r   r   r   r   r   r   r#   r   r"   r   r   r   r   r   r   r   r   r$   r   r%   r   r   r   r   r   r   staticmethodr   r   classmethodr   r   r  r   re   rj   rg   rZ   rZ      s$   *X 3Iy2Hf $Ho$M:J:(Iu(!Is!D$FDM4ItL%KL%*J*'It'D#""""$$$$
 
" 

 

 
 
.% ( (rj   c                   V ^8  d   QhRR/# r   re   )rf   s   "rg   rh   rh   p  s       rj   c                   V f   R# \        V \        4      '       d   V # \        V \        4      '       da   \        V 4      ^8X  d;   \        ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       g   Rp\        V4      h\        V !  # \        V \        4      '       d   V  Uu. uF  p\        V4      NK  	  up# Rp\        V4      hu upi )z6Raise a TypeError if a color is not a valid RGB value.Nc              3  B   "   T F  p\        V\        4      x  K  	  R # 5irl   )r   r   .0xs   & rg   	<genexpr>rgb_color.<locals>.<genexpr>w  s     'JEq
1c(:(:Es   FTz1RGB color must be an RGB or a tuple of 3 integers)r   rE   tuplelenallr   listr   )colorr   cs   &  rg   r   r   p  s    }%%E
aCC'JE'JCCC'JE'J$J$JECC. E{%&+,e	!e,,
=C
C. -s   /Cc                   V ^8  d   QhRR/# )r_   rc   rF   re   )rf   s   "rg   rh   rh     s      	 rj   c                T   V f   \        4       # \        V \         4      '       d   V # \        V \        4      '       da   \        V 4      ^8X  d;   \        ;QJ d    R V  4       F  '       d   K   RM	  RM! R V  4       4      '       g   Rp\        V4      h\        V !  # Rp\        V4      h)z0Raise a TypeError if a alignment is not a valid.c              3  N   "   T F  p\        V\        \        34      x  K  	  R # 5irl   )r   r   ry   r
  s   & rg   r  alignment.<locals>.<genexpr>  s     'Q5a
1sCj(A(A5s   #%FTz?Alignment must be an Alignment or a tuple of 2 integers/strings)rF   r   r  r  r  r   )r   r   s   & rg   r   r     s    }{%##%E
aCC'Q5'QCCC'Q5'Q$Q$QSCC. %  
KC
C.rj   soliddashesdotsnonec                  ^    ] tR tRt]R,          t]R,          t]R,          t]R,          tRt	R# )rJ   i  r  r  r  r  re   N)
r   r|   r}   r~   BORDER_STYLE_MAPSOLIDDASHESDOTSNONEr   re   rj   rg   rJ   rJ     s*    W%Eh'FF#DF#Drj   c                  J    ] tR tRtRt]RR^ 3R R lltR R ltR R	 ltR
t	R# )rI   i  ag  
Create a cell border to use with the :py:class:`~numbers_parser.Table` method
:py:meth:`~numbers_parser.Table.set_cell_border`.

.. code-block:: python

    border_style = Border(8.0, RGB(29, 177, 0), "solid")
    table.set_cell_border("B6", "left", border_style, 3)
    table.set_cell_border(6, 1, "right", border_style)

Parameters
----------
width: float, optional, default: 0.35
    Number of rows in the first table of a new document.
color: RGB, optional, default: RGB(0, 0, 0)
    The line color for the border if present
style: BorderType, optional, default: ``None``
    The type of border to create or ``None`` if there is no border defined. Valid
    border types are:

    * ``"solid"``: a solid line
    * ``"dashes"``: a dashed line
    * ``"dots"``: a dotted line

Raises
------
TypeError:
    If the width is not a float, or the border type is invalid.

Nc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r_   widthr   r  rE   stylerJ   _orderr   rc   rd   re   )rf   s   "rg   rh   Border.__annotate__  s<        	
  
rj   c                	   \        V\        4      '       g   R p\        V4      hWn        Vf   \	        \         p\        V4      V n        Vf   \        \        \        ,          4      p\        V\        4      '       d<   VP                  4       pV\        9  d   Rp\        V4      h\        V,          V n        MW0n        W@n        R# )z&width must be a float number of pointsNzinvalid border style)r   r   r   r%  rE   r   r   r  rJ   r  r   ry   r   r&  r'  )ro   r%  r  r&  r'  r   s   &&&&& rg   rp   Border.__init__  s     %'':CC. 
=-.Eu%
=/0DEFEeS!!KKME,,,n$)%0DJJrj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r(    s     U U Urj   c                	    \        V P                  4      P                  P                  4       pR V P                   RV P
                   RV R2# )zBorder(width=z, color=z, style=))rJ   r&  r   r   r%  r  )ro   
style_names   & rg   __str__Border.__str__  sC    

+00668
tzzl(4::,hzlRSTTrj   c                    V ^8  d   QhRRRR/# )r_   r   r   rc   r   re   )rf   s   "rg   rh   r(    s     
 
F 
t 
rj   c                	    \        V P                  VP                  8H  V P                  VP                  8H  V P                  VP                  8H  .4      # rl   )r  r%  r  r&  ro   r   s   &&rg   __eq__Border.__eq__  sC    ZZ5;;&

ekk(A4::QVQ\Q\C\]
 	
rj   )r'  r  r&  r%  )
r   r|   r}   r~   r   r    rp   r/  r4  r   re   rj   rg   rI   rI     s+    B , :U
 
rj   c                     ] tR tRtRR R llt]R 4       t]P                  R R l4       t]R 4       t]P                  R R	 l4       t]R
 4       t	]	P                  R R l4       t	]R 4       t
]
P                  R R l4       t
RtR# )rM   i  c          
     ,    V ^8  d   QhRRRRRRRRRR/# )r_   
top_mergedr   right_mergedbottom_mergedleft_mergedrc   rd   re   )rf   s   "rg   rh   CellBorder.__annotate__  s<     ( (( ( 	(
 ( 
(rj   c                	n    R V n         R V n        R V n        R V n        Wn        W n        W0n        W@n        R # rl   )_top_right_bottom_left_top_merged_right_merged_bottom_merged_left_merged)ro   r8  r9  r:  r;  s   &&&&&rg   rp   CellBorder.__init__  s8     	
%)+'rj   c                	^    V P                   '       g   V P                  f   R # V P                  # rl   )rB  r>  ru   s   &rg   r   CellBorder.top  s$    tyy0yyrj   c                   V ^8  d   QhRR/# r_   rc   rd   re   )rf   s   "rg   rh   r<    s      D rj   c                	|    V P                   e&   VP                  V P                  P                  8  d	   Wn         R # R # rl   )r>  r'  r   r3  s   &&rg   r   rH    s)    99txx >I !?rj   c                	^    V P                   '       g   V P                  f   R # V P                  # rl   )rC  r?  ru   s   &rg   r   CellBorder.right  s$    !4{{rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r<    s        d  rj   c                	|    V P                   e&   VP                  V P                   P                  8  d	   Wn         R # R # rl   )r?  r'  r3  s   &&rg   r   rM    s,    ;;%,,1C1C"CK #Drj   c                	^    V P                   '       g   V P                  f   R # V P                  # rl   )rD  r@  ru   s   &rg   r   CellBorder.bottom  s$    $,,"6||rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r<    s     ! !t !rj   c                	|    V P                   e&   VP                  V P                   P                  8  d	   Wn         R # R # rl   )r@  r'  r3  s   &&rg   r   rQ    s,    <<5<<$,,2E2E#E L $Frj   c                	^    V P                   '       g   V P                  f   R # V P                  # rl   )rE  rA  ru   s   &rg   r   CellBorder.left  s$    

 2zzrj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r<    s      T rj   c                	|    V P                   e&   VP                  V P                   P                  8  d	   Wn         R # R # rl   )rA  r'  r3  s   &&rg   r   rU    s,    ::

0A0A!AJ "Brj   )r@  rD  rA  rE  r?  rC  r>  rB  N)FFFF)r   r|   r}   r~   rp   r   r   setterr   r   r   r   re   rj   rg   rM   rM     s    (   
 	ZZ   
 \\     
 ]]! !  
 
[[ rj   c                  &    ] tR tRtRtR R ltRtR# )rV   i  z/Cell reference for cells eliminated by a merge.c          
     ,    V ^8  d   QhRRRRRRRRRR/# )r_   	row_startr   	col_startrow_endcol_endrc   rd   re   )rf   s   "rg   rh   MergeReference.__annotate__"  s0     = =# =# = =c =VZ =rj   c                	    WW43V n         R # rl   rect)ro   r[  r\  r]  r^  s   &&&&&rg   rp   MergeReference.__init__"  s    7<	rj   ra  Nr   r|   r}   r~   r   rp   r   re   rj   rg   rV   rV     s    9= =rj   c                  &    ] tR tRtRtR R ltRtR# )rU   i&  z#Cell reference for the merged cell.c                    V ^8  d   QhRRRR/# )r_   sizer  rc   rd   re   )rf   s   "rg   rh   MergeAnchor.__annotate__)  s      U t rj   c                	    Wn         R # rl   rg  )ro   rg  s   &&rg   rp   MergeAnchor.__init__)  s    	rj   rj  Nrd  re   rj   rg   rU   rU   &  s    - rj   c                      ] tR tRt$ RtR]R&   RtR]R&   RtR]R&   RtR]R&   Rt	R]R&   Rt
R]R	&   RtR]R
&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   RtR]R&   R R ltR tRtR# )CellStorageFlagsi-  Nr   
_string_id_rich_id_cell_style_id_text_style_id_formula_id_control_id_formula_error_id_suggest_id_num_format_id_currency_format_id_date_format_id_duration_format_id_text_format_id_bool_format_idc                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   CellStorageFlags.__annotate__>  s     ? ? ?rj   c                	   \        V 4      P                  4        UUu. uF2  w  rVP                  R 4      '       g   K  Vf   K$  VR,           RV 2NK4  	  pppRP                  V Uu. uF  qD'       g   K  TNK  	  up4      # u uppi u upi )_id   NN=, )r   itemsendswithjoin)ro   kvr   r  s   &    rg   r/  CellStorageFlags.__str__>  s|    '-d|'9'9';
';tqqzz%?PNUVNqugQqcN'; 	 
 yyV=Vq!!V=>>
 >s   BBB'	B5Bc                	T    \        V 4       Uu. uF  qP                  NK  	  up# u upi rl   )r   r   )ro   r  s   & rg   flagsCellStorageFlags.flagsD  s      &t-1---s   %re   )r   r|   r}   r~   rn  r   ro  rp  rq  rr  rs  rt  ru  rv  rw  rx  ry  rz  r{  r/  r  r   re   rj   rg   rm  rm  -  s    JHcNCNCKK!s!KNC##OS##OSOS?.rj   rm  c                  <  a  ] tR tRtRtR V 3R lltR V 3R llt]R 4       t]R 4       t	]R	 R
 l4       t
]R R l4       t]R R l4       t]R R l4       t]R R l4       t]R R l4       t]P                   R R l4       t]R R l4       t]P                   R R l4       t]R R l4       t]R R l4       t]R R  l4       t]R! R" l4       tR# R$ ltR% R& ltR' R( ltR) R* lt]]! ^ R+7      R, R- l4       4       tR. R/ ltR0 R1 ltR2 R3 ltR7R4 R5 llt R6t!V ;t"# )8rL   iH  g
.. NOTE::

   Do not instantiate directly. Cells are created by :py:class:`~numbers_parser.Document`.
c               $    V ^8  d   QhRRRRRR/# r_   rowr   colrc   rd   re   )rf   s   "rg   rh   Cell.__annotate__O  s!      C c T rj   c                	   < W0n         Wn        W n        R V n        RV n        RV n        RV n        RV n        RV n        RV n	        \        SV `-  4        R# )FN)_valuer  r  _is_bulletedrr  _storage_style_d128_double_secondsr   rp   ro   r  r  r   r   s   &&&&rg   rp   Cell.__init__O  sP    !
rj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r  \  s     8 8 8rj   c                	  < V P                   P                  V P                  4      pV P                   P                  V P                   P	                  V P                  4      4      pV R V RV P
                   RV P                   R2pVRV P                   RV P                  P                   R2,          pVRV P                   RV P                  R	 R
V P                  R 2,          pRP                  V\        SV `9  4       .4      # )@[,z]:z	table_id=z, type=r  zvalue=z, flags=08xz	, extras=04x)_model
table_name	_table_id
sheet_nametable_id_to_sheet_idr  r  _typer   r  _flags_extrasr  r   r/  )ro   r  r  cell_strr   s   &   rg   r/  Cell.__str__\  s    [[++DNN;
[[++DKK,L,LT^^,\]
 \:,az488*BGi/wtzz6GrJJfT[[M$++c1B)DLLY\K]^^yy(EGO$5677rj   c                	    \        R\        ^R7       V P                  e9   V P                  P                  e!   V P                  P                  P                  # R# )z@image_filename is deprecated and will be removed in the future. 
stacklevelNz]image_filename is deprecated and will be removed in the future. Please use the style property)r   DeprecationWarningr&  r   ra   ru   s   &rg   image_filenameCell.image_filenamed  sI    .		
 ::!djj&9&9&E::&&///rj   c                	    \        R\        ^R7       V P                  e9   V P                  P                  e!   V P                  P                  P                  # R# )z<image_data is deprecated and will be removed in the future. r  NzYimage_data is deprecated and will be removed in the future. Please use the style property)r   r  r&  r   r`   ru   s   &rg   
image_dataCell.image_datap  sI    .		
 ::!djj&9&9&E::&&+++rj   c                   V ^8  d   QhRR/# r_   rc   r   re   )rf   s   "rg   rh   r  }  s     , ,D ,rj   c                    V P                   RJ# )z.bool: ``True`` if the cell contains a formula.N)rr  ru   s   &rg   
is_formulaCell.is_formula|  s     t++rj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    s       rj   c                    V P                   eW   V P                  P                  V P                  4      pVP	                  V P                   V P
                  V P                  4      # R# )ai  
str: The formula in a cell.

Formula evaluation relies on Numbers storing current values which should
usually be the case. In cells containing a formula, :py:meth:`numbers_parser.Cell.value`
returns computed value of the formula.

Returns
-------
    str:
        The text of the formula in a cell, or `None` if there is no formula
        present in a cell.

N)rr  r  table_formulasr  formular  r  )ro   r  s   & rg   r  Cell.formula  sN      '![[77GN!))$*:*:DHHdhhOOrj   c                   V ^8  d   QhRR/# r  re   )rf   s   "rg   rh   r    s     ! !T !rj   c                    V P                   # )z1bool: ``True`` if the cell contains text bullets.)r  ru   s   &rg   is_bulletedCell.is_bulleted  s        rj   c                   V ^8  d   QhRR/# )r_   rc   zlist[str] | Nonere   )rf   s   "rg   rh   r    s      ) rj   c                    R# )a  
List[str] | None: The bullets in a cell, or ``None``.

Cells that contain bulleted or numbered lists are identified
by :py:attr:`numbers_parser.Cell.is_bulleted`. For these cells,
:py:attr:`numbers_parser.Cell.value` returns the whole cell contents.
Bullets can also be extracted into a list of paragraphs cell without the
bullet or numbering character. Newlines are not included in the
bullet list.

Example
-------
.. code-block:: python

    doc = Document("bullets.numbers")
    sheets = doc.sheets
    tables = sheets[0].tables
    table = tables[0]
    if not table.cell(0, 1).is_bulleted:
        print(table.cell(0, 1).value)
    else:
        bullets = ["* " + s for s in table.cell(0, 1).bullets]
        print("\n".join(bullets))
            return None

Nre   ru   s   &rg   bulletsCell.bullets  s    8 rj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    s     &\ &\ &\rj   c                   V P                   e   V P                  e   V P                  4       # V P                  e   V P                  e   V P                  4       # V P                  f+   V P                  f   V P                  f   V P                  e   V P                  4       # \        V P                  \        4      '       d$   \        V P                  4      P                  4       # \        V P                  4      # )u  
str: The formatted value of the cell as it appears in Numbers.

Interactive elements are converted into a suitable text format where
supported, or as their number values where there is no suitable
visual representation. Currently supported mappings are:

* Checkboxes are U+2610 (Ballow Box) or U+2611 (Ballot Box with Check)
* Ratings are their star value represented using (U+2605) (Black Star)

.. code-block:: python

    >>> table = doc.default_table
    >>> table.cell(0,0).value
    False
    >>> table.cell(0,0).formatted_value
    '☐'
    >>> table.cell(0,1).value
    True
    >>> table.cell(0,1).formatted_value
    '☑'
    >>> table.cell(1,1).value
    3.0
    >>> table.cell(1,1).formatted_value
    '★★★'
)ry  r  _duration_formatrx  r  _date_formatrz  rv  rw  r{  _custom_formatr   r   r   ry   upperru   s   &rg   formatted_valueCell.formatted_value  s    8 ##/DLL4L((**+0I$$&&  ,"".''3##/&&((*4TZZ*F*Fs4::$$&[CPTPZPZO[rj   c                   V ^8  d   QhRR/# )r_   rc   zStyle | Nonere   )rf   s   "rg   rh   r    s      | rj   c                ~    V P                   f%   \        P                  W P                  4      V n         V P                   # )z
Style | None: The :class:`Style` associated with the cell or ``None``.

Warns
-----
    UnsupportedWarning: On assignment; use
        :py:meth:`numbers_parser.Table.set_cell_style` instead.

)r  rZ   r   r  ru   s   &rg   r&  
Cell.style  s.     ;;,,T;;?DK{{rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r    s     
 
$ 
rj   c                	*    \        R \        ^R7       R# )z<cell style cannot be set; use Table.set_cell_style() insteadr  Nr   r=   ro   _s   &&rg   r&  r    s    J	
rj   c                   V ^8  d   QhRR/# )r_   rc   zCellBorder | Nonere   )rf   s   "rg   rh   r    s      ) rj   c                d    V P                   P                  V P                  4       V P                  # )z
CellBorder| None: The :class:`CellBorder` associated with the cell or ``None``.

Warns
-----
    UnsupportedWarning: On assignment; use
        :py:meth:`numbers_parser.Table.set_cell_border` instead.

)r  extract_strokesr  _borderru   s   &rg   borderCell.border  s$     	##DNN3||rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r    s     
 
4 
rj   c                	*    \        R \        ^R7       R# )zEcell border values cannot be set; use Table.set_cell_border() insteadr  Nr  r  s   &&rg   r  r    s    S	
rj   c               (    V ^8  d   QhRRRRRRRR/# r_   table_idr   r  r  r   r   re   )rf   s   "rg   rh   r    s.     S S3 SS Ss S6 Srj   c                	:    \         P                  WV\        V4      # rl   )rL   _from_storager&   )r   r  r  r  r   s   &&&&&rg   _empty_cellCell._empty_cell  s    !!(6JERRrj   c               (    V ^8  d   QhRRRRRRRR/# r  re   )rf   s   "rg   rh   r    s(      C c  F rj   c                	    \        W#4      pWEn        Wn        VP                  V4      pVP	                  VP                  W#34      4       V# rl   )rW   r  r  merge_cells
_set_mergeget)r   r  r  r  r   r   r  s   &&&&&  rg   _merged_cellCell._merged_cell  sB    ##!''1
34rj   c                    V ^8  d   QhRRRR/# )r_   r  r   r  re   )rf   s   "rg   rh   r    s      c  rj   c                	j   \        V\        4      '       d   \        WV4      pV# \        V\        4      '       d   \	        WV4      pV# \        V\
        4      '       d   \        WV4      pV# \        V\        4      '       dD   \        V\        R R7      pWS8w  d   \        RV R\         R2\        ^R7       \        WV4      pV# \        V\        4      '       d   \        WV4      pV# \        V\        4      '       d   \        WV4      pV# R\!        V4      P"                  ,           p\%        V4      h)Fsigfigsr   'z' rounded to z significant digitsr  z$Can't determine cell type from type )r   ry   r[   r   rH   r   rX   r   sigfigr)   r   RuntimeWarningr   rO   r	   rP   typer   
ValueError)r   r  r  r   r   rounded_valuer   s   &&&&   rg   _from_valueCell._from_value  s(    eS!!Ce,D, + t$$Ce,D( ' s##c.D$ # u%%"52HuUM%wm,B+CCVW" 
 c6D  x((Ce,D  y))%0D
  94;;O;OOCS/!rj   c               0    V ^8  d   QhRRRRRRRRRRR	R
/# )r_   r  r   r  r  buffer	bytearrayr   r   rc   rd   re   )rf   s   "rg   rh   r  9  sN     w ww w 	w
 w w 
wrj   c           	     	>   R pR pR pV^ ,          p	V	^8w  d   RV	 R2p
\        V
4      h^p\        4       p\        RVR,          4      ^ ,          pV^,          '       d   \        WKV^,            4      pV^,          pV^,          '       d&   \        RWKV^,            4      ^ ,          pV^,          pV^,          '       d&   \        RWKV^,            4      ^ ,          pV^,          pV^,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pV^,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pV^ ,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pV^@,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pV^,          '       d
   V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn	        V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn
        V^,          pV^\        VR	,          4      P                  R
4      ,          ,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pVR,          '       d+   \        RWKV^,            4      ^ ,          Vn        V^,          pV^,          pV\&        P(                  8X  d   \+        W#4      pEMV\&        P,                  8X  d   \/        W#V4      pEMjV\&        P0                  8X  d(   \3        W#VP5                  WP                  4      4      pEM.V\&        P6                  8X  d4   \9        W#\:        \=        VR7      ,           4      pVP>                  Vn         MV\&        PB                  8X  d   \E        W#VR8  4      pMV\&        PF                  8X  d   \I        W#\=        VR7      4      pMV\&        PJ                  8X  d   \M        W#4      pMtV\&        PN                  8X  d'   \Q        W#VPS                  WP
                  4      4      pM9V\T        8X  d   \/        W#V\V        PX                  R7      pMRV R2p
\        V
4      hVP[                  V4       WOn.        W_n/        Wn0        Won1        Wn2        Wn3        \        RVR,          4      ^ ,          Vn4        Wn5        VPm                  V4      pVPo                  VPq                  W#34      4       \r        Pt                  ! \v        4      Px                  \r        Pz                  8X  d   \}        \        V4      4       V# )NzCell storage version z is unsupported<i      N<d         i 	  1     @              )seconds        )	cell_typezCell type ID z is not recognizedz<H:   r  N)@r<   rm  r   _unpack_decimal128rn  ro  rp  rq  rr  rs  ru  bincountrv  rw  rx  ry  rz  r{  TSTArchivesgenericCellTyperQ   numberCellTyperX   textCellTyper[   table_stringdateCellTyperO   r'   r	   r  	_datetimeboolCellTyperH   durationCellTyperP   formulaErrorCellTyperR   automaticCellTyperY   table_rich_textr   r0   CURRENCY_copy_flags_bufferr  r  r  r  r  r  r  r  r  r  logging	getLogger__package__levelDEBUGdebugry   )r   r  r  r  r  r   d128doubler  versionr   offsetstorage_flagsr  r  r   r  s   &&&&&&           rg   r  Cell._from_storage8  sr    )a<)'/BC"3''(*tVD\*1-3;;%ffrk&BCDbLF3;;D&&1*"=>qAFaKF3;;T66A:#>?BGaKF3;;'-dFFQJ4O'PQR'SM$aKF4<<%+D&&1*2M%Nq%QM"aKF4<<+1$QR
8S+TUV+WM(aKF4<<+1$QR
8S+TUV+WM(aKF4<<aKF5==(.tVVaZ5P(QRS(TM%aKF5==(.tVVaZ5P(QRS(TM%aKF6>>(.tVVaZ5P(QRS(TM%aKF!c%%-(..s3336>>+1$QR
8S+TUV+WM(aKF6>>06tVVVWZ=X0YZ[0\M-aKF6>>,24RS9T,UVW,XM)aKF7??06tVVVWZ=X0YZ[0\M-aKF7??,24RS9T,UVW,XM)aKF7??,24RS9T,UVW,XM)aKF 1I	333S&D+444c-D+222Ce&8&8C[C[&\]D+222Cei.H&HID![[DN+222Cfsl3D+666)F*CDD+:::S&D+777%*?*?J`J`*abD,,c8I8IJD!),>?C"3'''!
dF3K03''1
34[)//7==@#d)rj   c                    V ^8  d   QhRRRR/# )r_   r/  rm  rc   rd   re   )rf   s   "rg   rh   r    s     > >)9 >d >rj   c           	     	^    VP                  4        F  p\        W\        W4      4       K  	  R # rl   )r  setattrr   )ro   r/  flags   && rg   r#  Cell._copy_flags  s$    !'')DD <= *rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r    s     ( (t (rj   c                	@   \        V\        4      '       d8   R V n        VP                  V n        RV n        RV n        \        4       V n        R# \        V\        4      '       Ed   RV n        RV n        VP
                  ^ ,          V n	        VP
                  ^,          V n
        VP
                  ^,          V n        VP
                  ^,          V n        \        VP
                  !  V n        VP
                  V n        V P                  V P                  8  pV P                  V P                  8  pV P                  V P                  8  pV P                  V P                  8  p\        W#WE4      V n        R# RV n        RV n        RV n        RV n        \        4       V n        R# )TNF)r  r  )r   rU   	is_mergedrg  merge_rangerb  rM   r  rV   r[  r\  r]  r^  rD   r  r  )ro   	merge_refr8  r9  r:  r;  s   &&    rg   r  Cell._set_merge  s,   i--!DN!DI#DDI%<DL	>22"DNDI&^^A.DN&^^A.DN$>>!,DL$>>!,DL'8D!DIDNN2J88dll2L HHt||3M((T^^3K%j[DL"DNDI#DDI%<DLrj   c                   V ^8  d   QhRR/# )r_   rc   r  re   )rf   s   "rg   rh   r    s     O! O!I O!rj   c                   V P                   Ee   V P                   P                  e   V P                  P                  P	                  V P
                  \        P                  ! V P                   P                  R7      4      V n        V P                  P                  V P                   P                  V P                  P                  P                  V P
                  4      R7       V P                   P                  e   V P                  P                  P	                  V P
                  \        P                  ! V P                   P                  R7      4      V n        V P                  P                  V P                   P                  V P                  P                  P                  V P
                  4      R7       ^p\        V \        4      '       dY   ^pV^,          pV P                  \         P"                  8X  d   \$        pM\&        P(                  p\+        V P,                  4      pEM\        V \.        4      '       dX   ^pV^,          p\&        P0                  p\3        RV P                  P5                  V P
                  V P,                  4      4      pEMq\        V \6        4      '       d   ^pV^,          p\&        P8                  pV P:                  P<                  f   V P:                  \>        ,
          pM;V P:                  \>        P@                  ! V P:                  P<                  4      ,
          p\3        R\C        VPE                  4       4      4      pEM\        V \F        4      '       d=   ^pV^,          p\&        PH                  p\3        R\C        V P,                  4      4      pEM^\        V \J        4      '       dJ   ^pV^,          p\&        PL                  p\3        R\C        V P,                  PE                  4       4      4      pM\        V \N        4      '       d   ^ p\&        PP                  pRpM\        V \R        4      '       d   R# \        V \T        4      '       d3   ^ pV^,          p\&        PV                  p\3        RV PX                  4      pMt\[        V 4      P\                  pV P                  P_                  V P
                  4      pRV RV P`                   R	V Pb                   R
2p\e        V RV R2\f        ^R7       R# \i        ^4      p	^V	^ &   W9^&   W,          p	V PX                  e0   V^,          pV^,          pV	\3        RV PX                  4      ,          p	V P                  e0   V^ ,          pV^,          pV	\3        RV P                  4      ,          p	V P                  e0   V^@,          pV^,          pV	\3        RV P                  4      ,          p	V Pj                  e0   VR,          pV^,          pV	\3        RV Pj                  4      ,          p	V Pl                  e0   VR,          pV^,          pV	\3        RV Pl                  4      ,          p	V Pn                  e0   VR,          pV^,          pV	\3        RV Pn                  4      ,          p	V Pp                  eE   VR,          pV^,          pV	\3        RV Pp                  4      ,          p	V	^;;,          ^,          uu&   V Pr                  eE   VR,          pV^,          pV	\3        RV Pr                  4      ,          p	V	^;;,          ^,          uu&   V Pt                  eE   VR,          pV^,          pV	\3        RV Pt                  4      ,          p	V	^;;,          ^,          uu&   V Pv                  eE   VR,          pV^,          pV	\3        RV Pv                  4      ,          p	V	^;;,          ^,          uu&   V Px                  e0   VR,          pV^,          pV	\3        RV Px                  4      ,          p	V Pz                  eE   VR,          pV^,          pV	\3        RV Pz                  4      ,          p	V	^;;,          ^ ,          uu&   V P|                  e   V	^;;,          ^,          uu&   \3        RV4      V	R&   \        V	4      ^ 8  d   V	\i        ^ V,
          4      ,          p	V	^ V # )z<Create a storage buffer for a cell using v5 (modern) layout.N)
identifier)component_idr   r  rj   r  z:[r  ]z: unsupported data type z	 for saver  r  r  r  r	  r
  r  r  r  r  r  )@r  r   r  _table_styles
lookup_keyr  TSPMessages	Referencerq  add_component_referenceidr   rp  r   rX   r  r0   r"  r   r  r  _pack_decimal128r   r[   r  r   table_string_keyrO   r  r  tzinfor'   
astimezoner   total_secondsrH   r  rP   r  rQ   emptyCellValueTyperW   rY   r   ro  r  r   r  r  r  r   r=   r  rr  rs  ru  rv  rw  rx  ry  rz  r{  rn  r  )
ro   lengthr  r  r   
date_delta	data_typer  	table_refstorages
   &         rg   
_to_bufferCell._to_buffer  s   ;;"{{--9&*kk&?&?&J&JNN))T[[5S5ST'# 33KK22!%!:!:!=!=dnn!M 4 
 {{--9&*kk&?&?&J&JNN))T[[5S5ST'# 33KK22!%!:!:!=!=dnn!M 4 
 dJ''EbLFzzX....	'66	$TZZ0Eh''EaKF#00It{{;;DNNDJJWXEh''EaKF#00I{{!!)![[50
![[5+;+;DKK<N<N+OO
uZ%=%=%?@AEh''EaKF#00IuTZZ01El++EaKF#44IuTZZ%=%=%?@AEi((E#66IEj))l++EaKF#55It}}-ET
++I//?JJ<r$((1TXXJa@I+5i[	J"
 B-

==$TMEaKFtD$--00G*TMEaKFtD$"5"566G*TMEaKFtD$"5"566G'UNEaKFtD$"2"233G'UNEaKFtD$"2"233G'VOEaKFtD$"2"233G*VOEaKFtD$"5"566GAJ!OJ##/VOEaKFtD$":":;;GAJ!OJ+VOEaKFtD$"6"677GAJ!OJ##/WEaKFtD$":":;;GAJ!OJ+WEaKFtD$"6"677G+WEaKFtD$"6"677GAJ$J??&AJ$JT5)w<"yf--Gq  rj   c                    V ^8  d   QhRRRR/# )r_   r   r   rc   rd   re   )rf   s   "rg   rh   r  c  s       D rj   c                	    VP                   \        P                  8X  d   Wn        M%VP                   \        P                  8X  d   Wn        Wn        R # rl   )r  r0   NUMBERr  DATEr  r  )ro   r   r   s   &&&rg   _update_valueCell._update_valuec  s1    ::(JZZ8==("Nrj   )num_argsc                   V ^8  d   QhRR/# )r_   rc   ztuple[bytes, str]re   )rf   s   "rg   rh   r  l  s     0 0. 0rj   c                  a
 V P                   f   R# V P                  P                  V P                  V P                   4      pVP                  P
                  P                  R4      '       g   R# VP                  P
                  P                  P                  P                  o
V P                  P                  \        ,          P                  p\        V
3R lV 4       4      p\        V
3R lV 4       4      pV P                  P                  P                  P                  4       pV Uu. uF  qfRV 28X  g   K  VNK  	  pp\!        V4      ^ 8X  d   \#        RV R2\$        ^R7       R# V P                  P                  P                  V^ ,          ,          p\'        V4      P)                  4       p	WP                  P*                  9  d   S
V P                  P*                  V	&   W3# u upi )	z@Return the background image data for a cell or None if no image.Nimagec              3  `   <"   T F#  qP                   S8X  g   K  VP                  x  K%  	  R # 5irl   )r>  	file_namer  r  image_ids   & rg   r  #Cell._image_data.<locals>.<genexpr>v  s#      
!&A,,(*BKAKK   ..c              3  `   <"   T F#  qP                   S8X  g   K  VP                  x  K%  	  R # 5irl   )r>  preferred_file_namer`  s   & rg   r  rb  y  s&      "
+0aLLH4L!A!!5rc  zData/zCannot find file 'z' in Numbers archiver  )rp  r  table_styler  cell_properties	cell_fillHasFieldr]  	imagedatar>  objectsr*   datasnext
file_storekeysr  r   r  r   digest_images)ro   r&  rl  stored_filenamepreferred_filename	all_pathsr  image_pathnamesr  rp  ra  s   &         @rg   r   Cell._image_dataj  s    &''8K8KL$$..77@@((2288BBMM##J/55 
!&
 
 " "
+0"
 
 KK''22779	&/Ri%?P8Q3Q11iR1$$%7$88LM
 [[((33OA4FG
j!((*,,,*2DKK'// Ss   *G':G'c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    s     8 8 8rj   c                	8	   V P                   eQ   V P                  \        P                  8X  d2   V P                  P                  V P                  V P                   4      pMV P                  e2   V P                  P                  V P                  V P                  4      pMV P                  eQ   V P                  \        P                  8X  d2   V P                  P                  V P                  V P                  4      pMTV P                  e2   V P                  P                  V P                  V P                  4      pM\        V P                  4      # \        RV P                  V P                  VP                   4       VP#                  R4      '       d   \%        VP&                  4      P(                  pV P                  P+                  4       pW2,          P,                  pVP.                  '       d   \1        V P2                  V4      pV# VP                   \4        P6                  8X  d=   \9        VV P                  P;                  V P                  V P<                  4      4      pV# \?        VV P2                  W2,          P@                  4      p V# VP                   \4        PB                  8X  d   \E        V P2                  V4      # VP                   \4        PF                  8X  d   \I        V P2                  V4      # VP                   \4        PJ                  8X  d   V P                  '       d   R# R# VP                   \4        PL                  8X  d    \E        V P2                  ^d,          VRR7      # VP                   \4        PN                  8X  d   \Q        V P2                  V4      # VP                   \4        PR                  8X  d   \1        V P2                  V4      # VP                   \4        PT                  8X  d   \W        V P2                  V4      # VP                   \4        PX                  8X  d   V P                  '       d   \Z        # \\        # VP                   \4        P^                  8X  d!   \`        \c        V P2                  4      ,          # \        V P                  4      pV# )Nz)custom_format: @[%d,%d]: format_type=%s, 
custom_uidTRUEFALSET)percent)2rz  r  r0   TEXTr  table_formatr  rw  r{  BOOLrv  ry   r   r*  r  r  format_typeri  rC   ry  hexcustom_format_mapdefault_formatrequires_fraction_replacement_format_fractionr  r6   CUSTOM_TEXT_decode_text_formatr  rn  _decode_number_formatr   DECIMAL_format_decimalr"  _format_currencyBOOLEANPERCENTBASE_format_baseFRACTION
SCIENTIFIC_format_scientificCHECKBOXr   r   RATINGr.   r   )ro   custom_formatformat_uuid
format_mapr  s   &    rg   r  Cell._custom_format  sN   +

hmm0K KK44T^^TEYEYZM%%1 KK44T^^TE]E]^M!!-$**2M KK44T^^TEYEYZM  , KK44T^^TEXEXYMtzz?"7HHHH%%		
 !!,//%m&>&>?CCK668J&3BBM:::"24::}"M@ ? **j.D.DD"5!KK,,T^^T__M#< 3 #8!JJ+00#2 ) &&**<*<<"4::}==&&**=*==#DJJ>>&&**<*<<!ZZZ64W4&&**<*<<"4::#3]DQQ&&*//9

M::&&**=*==#DJJ>>&&**?*??%djj-@@&&**=*==*.***&N:NN&&**;*;;$s4::66!$**oOrj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    s      c rj   c                	0   V P                   P                  V P                  V P                  4      pVP	                  R 4      '       d   \        VP                  4      P                  pV P                   P                  4       pW2,          P                  pVP                  pVP                  \        P                  8X  d   \        WPP                  4      pV# \!        RVP                   2\"        ^R7       R# \        VP$                  V P                  4      pV# )ry  zUnexpected custom format type r   )r  r~  r  rx  ri  rC   ry  r  r  r  custom_format_stringr  r6   CUSTOM_DATE_decode_date_formatr  r   r=   date_time_format)ro   date_formatr  r  r  r  r  s   &      rg   r  Cell._date_format  s    kk..t~~t?S?ST--%k&<&<=AAK668J&3BBM#0#E#E ((J,B,BB"56JNN"[  4]5N5N4OP& 
 1+2N2NPTP^P^_Orj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    s     M M# Mrj   c           	     		   V P                   P                  V P                  V P                  4      p\	        R V P
                  V P                  V P                  V P                  VP                  4       VP                  pVP                  pVP                  pVP                  '       d   \        V P                  V4      w  rCV P                  p\        V P                  4      p. pR pR p	V\        P                  8X  dk   \        V\         ,          4      pV\        P                  8w  d   V\         V,          ,          pVP#                  \%        V4      \'        RWb4      ,           4       V! W4\        P(                  4      '       dk   \        V\*        ,          4      pV\        P(                  8  d   V\*        V,          ,          pVP#                  \%        V4      \'        RWb4      ,           4       V! W4\        P,                  4      '       dk   \        V\.        ,          4      pV\        P,                  8  d   V\.        V,          ,          pVP#                  \%        V4      \'        RWb4      ,           4       V! W4\        P0                  4      '       d   \        V^<,          4      pV\        P0                  8  d   V^<V,          ,          pV\2        P4                  8X  dE   V	! WdV\        P0                  4      p
TP#                  V
'       d   RMR\%        V4      ,           4       M+VP#                  \%        V4      \'        RWb4      ,           4       V! W4\        P6                  4      '       d   \        V4      pV\        P6                  8  d	   WV,          pV\2        P4                  8X  dE   V	! WdV\        P6                  4      p
TP#                  V
'       d   RMR\%        V4      ,           4       M+VP#                  \%        V4      \'        R	Wb4      ,           4       V\        P8                  8  d   \        \;        R
V,          4      4      pV\2        P4                  8X  d-   V^
8  d   RMRpV^d8  d   RMTpVP#                  V V 24       M,VP#                  \%        V4      \'        RWbR4      ,           4       V^ 8X  d   RMRP=                  V4      pV\2        P4                  8X  d   \>        P@                  ! RRV4      pV# )zPduration_format: @[%d,%d]: table_id=%d, duration_format_id=%d, duration_style=%sc                "    W8*  ;'       d    W8  # rl   re   )largestsmallest	unit_types   &&&rg   unit_in_range,Cell._duration_format.<locals>.unit_in_range  s    'AAH,AArj   c                <    W8H  ;'       d    W#8H  ;'       g    V ^
8  # )
   re   )dr  r  r  s   &&&&rg   
pad_digits)Cell._duration_format.<locals>.pad_digits  s"    (BBX-BNNqBwNrj   weekdayhourr  0minutesecondi  00millisecondms: z
:(\d\d\d)$z.\1)!r  r~  r  ry  r*  r  r  duration_styleduration_unit_largestduration_unit_smallestuse_automatic_duration_units_auto_unitsr  r   r4   WEEKr-   appendry   _unit_formatDAYr+   HOURr,   MINUTEr3   COMPACTSECONDMILLISECONDr   r  resub)ro   duration_formatr  unit_largestunit_smallestr  dddstrr  r  padpaddingduration_strs   &            rg   r  Cell._duration_format  s   ++224>>4C[C[\^HHHHNN$$**	
 )77&<<'>>777*5dllO*T'MLL	B	O =---Q()B 2 22_r))KKB,vr"JJKm6G6GHHQ'(B}000^b((KKB,ub"IIJm6H6HIIQ()B}111_r))KKB,vr"JJKm6J6JKKQVB}333R"W!6!66 L-BVBVW3RC3r7:;CGl8R&PPQm6J6JKKQB}333!6!66 L-BVBVW3RC3r7:;CGl8R&PPQM555U4!8_%B!6!66!#r#t "c	"wwit,-CGl="VZ&[[\-2AA$G]22266-FLrj   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r_   	format_idr   r  z%FormattingType | CustomFormattingType
control_idz
int | Noneis_currencyr   rc   rd   re   )rf   s   "rg   rh   r  *  s<      ,  , , ; , 	 ,
  , 
 ,rj   c                	   W@n         V'       d   \        P                  V n        V\        P                  8X  d	   Wn        R # V\        P                  8X  d   Wn        W0n        R # V\        P                  8X  d   Wn
        W0n        R # V\        P                  \        P                  39   d   V'       d   Wn        MWn
        W0n        R # V\        P                  8X  d   Wn        W0n        R # V\        P                  \         P                  39   d	   Wn        R # V\        P$                  \         P$                  39   d	   Wn        R # Wn
        R # rl   )_is_currencyr0   r"  r  r5   rw  TICKBOXr{  rs  r  rv  SLIDERSTEPPERPOPUPrz  DATETIMEr2   rx  r}  )ro   r  r  r  r  s   &&&&&rg   _set_formattingCell._set_formatting*  s     (!**DJ.111'0$N222#, )N111"+)^22N4J4JKK+4(&/#)N000#, )^446J6S6STT#, ^002F2K2KLL#, "+rj   )r{  r  rp  rs  rw  r  rx  r  r  rr  r  r  rv  r  r  r  rz  rq  r  r  r  r^  r\  r8  r9  rb  r  r]  r[  rg  )NF)#r   r|   r}   r~   r   rp   r/  r   r  r  r  r  r  r  r  r&  rX  r  r  r  r  r  r  r#  r  rR  rX  rB   r   r  r  r  r  r   r   r   s   @rg   rL   rL   H  s    8 8 	 	 	 	 , ,  ( ! !  : &\ &\P   \\
 
   ]]
 
 S S    6 w wr>(8O!b 
A0  0B8t(M^ ,  ,rj   c                  b   a  ] tR tRtRt]P                  3R V 3R lllt]R R l4       t	Rt
V ;t# )rX   iM  r  c               (    V ^8  d   QhRRRRRRRR/# )r_   r  r   r  r   r   rc   rd   re   )rf   s   "rg   rh   NumberCell.__annotate__T  s)     * *C *c *% *W[ *rj   c                	4   < W@n         \        SV `	  WV4       R # rl   )r  r   rp   )ro   r  r  r   r  r   s   &&&&&rg   rp   NumberCell.__init__T  s    
5)rj   c                   V ^8  d   QhRR/# )r_   rc   r   re   )rf   s   "rg   rh   r  Y        s rj   c                	    V P                   # rl   r  ru   s   &rg   r   NumberCell.valueX      {{rj   r  )r   r|   r}   r~   r   r0   rV  rp   r   r   r   r   r   s   @rg   rX   rX   M  s1     DL?? * *  rj   c                  D   a  ] tR tRtR V 3R llt]R R l4       tRtV ;t# )r[   i]  c               (    V ^8  d   QhRRRRRRRR/# )r_   r  r   r  r   ry   rc   rd   re   )rf   s   "rg   rh   TextCell.__annotate__^  s(     * *C *c *# *$ *rj   c                	R   < \         P                  V n        \        SV `  WV4       R # rl   )r0   r}  r  r   rp   r  s   &&&&rg   rp   TextCell.__init__^  s    ]]
5)rj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r  c  r  rj   c                	    V P                   # rl   r  ru   s   &rg   r   TextCell.valueb  r  rj   r  	r   r|   r}   r~   rp   r   r   r   r   r   s   @rg   r[   r[   ]  s!    * *  rj   c                     a  ] tR tRtRtR V 3R llt]R R l4       t]R R l4       t]R	 R
 l4       t	]R R l4       t
RtV ;t# )rY   ig  r  c               $    V ^8  d   QhRRRRRR/# r  re   )rf   s   "rg   rh   RichTextCell.__annotate__n  s!     % %C %c %T %rj   c                	  < \         SV `  WVR ,          4       \        P                  V n        VR,          V n        VR,          V n        VR,          '       d   \        \        V P
                  4      4       Uu. uFQ  pVR,          V,          e-   VR,          V,          R,           VR,          V,          ,           MVR,          V,          NKS  	  upV n	        RV n
        R# R# u upi )textr  
hyperlinksbulletedbullet_charsNr  T)r   rp   r0   	RICH_TEXTr  _bullets_hyperlinksranger  _formatted_bulletsr  )ro   r  r  r   ir   s   &&&& rg   rp   RichTextCell.__init__n  s    5=1''
i( . s4==12' 3A ^,Q/; .)!,s2U95Ea5HHy)!,- 3'D# !%D 's   9AC#c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    r  rj   c                	    V P                   # rl   r  ru   s   &rg   r   RichTextCell.value~  r  rj   c                   V ^8  d   QhRR/# )r_   rc   	list[str]re   )rf   s   "rg   rh   r    s       rj   c                    V P                   # )z2List[str]: A list of the text bullets in the cell.)r  ru   s   &rg   r  RichTextCell.bullets  s     }}rj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    s     ' '3 'rj   c                    V P                   # )z2str: The bullets as a formatted multi-line string.)r  ru   s   &rg   formatted_bulletsRichTextCell.formatted_bullets  s     &&&rj   c                   V ^8  d   QhRR/# )r_   rc   zlist[tuple] | Nonere   )rf   s   "rg   rh   r    s        .  rj   c                    V P                   # )a  
List[Tuple] | None: the hyperlinks in a cell or ``None``.

Numbers does not support hyperlinks to cells within a spreadsheet, but does
allow embedding links in cells. When cells contain hyperlinks,
`numbers_parser` returns the text version of the cell. The `hyperlinks` property
of cells where :py:attr:`numbers_parser.Cell.is_bulleted` is ``True`` is a
list of text and URL tuples.

Example
-------
.. code-block:: python

    cell = table.cell(0, 0)
    (text, url) = cell.hyperlinks[0]

)r  ru   s   &rg   r  RichTextCell.hyperlinks  s    & rj   )r  r  r  r  r  )r   r|   r}   r~   r   rp   r   r   r  r  r  r   r   r   s   @rg   rY   rY   g  sb    % %      ' '    rj   c                      ] tR tRtRtR# )rK   i  re   N)r   r|   r}   r~   r   re   rj   rg   rK   rK     s    rj   c                  ^   a  ] tR tRtRtR V 3R llt]R R l4       t]R R l4       tR	t	V ;t
# )
rQ   i  r  c               $    V ^8  d   QhRRRRRR/# r  re   )rf   s   "rg   rh   EmptyCell.__annotate__  !     $ $C $c $d $rj   c                	R   < \         SV `  WR 4       \        P                  V n        R # rl   )r   rp   r0   EMPTYr  ro   r  r  r   s   &&&rg   rp   EmptyCell.__init__      4(^^
rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r          t rj   c                	    R # rl   re   ru   s   &rg   r   EmptyCell.value      rj   c                   V ^8  d   QhRR/# rx   re   )rf   s   "rg   rh   r    s       rj   c                	    R # )r  re   ru   s   &rg   r  EmptyCell.formatted_value  s    rj   r  )r   r|   r}   r~   r   rp   r   r   r  r   r   r   s   @rg   rQ   rQ     s:    $ $    rj   c                  H   a  ] tR tRtRtR V 3R llt]R R l4       tRtV ;t	# )rH   i  r  c               (    V ^8  d   QhRRRRRRRR/# )r_   r  r   r  r   r   rc   rd   re   )rf   s   "rg   rh   BoolCell.__annotate__  s(      C c $ 4 rj   c                	^   < \         SV `  WV4       \        P                  V n        W0n        R # rl   )r   rp   r0   r  r  r  r  s   &&&&rg   rp   BoolCell.__init__  s"    5)]]
rj   c                   V ^8  d   QhRR/# r  re   )rf   s   "rg   rh   r&    s      t rj   c                	    V P                   # rl   r  ru   s   &rg   r   BoolCell.value  r  rj   )r  r  
r   r|   r}   r~   r   rp   r   r   r   r   r   s   @rg   rH   rH     s&     
  rj   c                  H   a  ] tR tRtRtR V 3R llt]R R l4       tRtV ;t	# )rO   i  r  c               (    V ^8  d   QhRRRRRRRR/# )r_   r  r   r  r   r   rc   rd   re   )rf   s   "rg   rh   DateCell.__annotate__  s(     # #C #c #( #t #rj   c                	R   < \         SV `  WV4       \        P                  V n        R # rl   )r   rp   r0   rW  r  r  s   &&&&rg   rp   DateCell.__init__  s    5)]]
rj   c                   V ^8  d   QhRR/# )r_   rc   r   re   )rf   s   "rg   rh   r/    s      x rj   c                	    V P                   # rl   r  ru   s   &rg   r   DateCell.value  r  rj   r  r,  r   s   @rg   rO   rO     s&    # #  rj   c                  D   a  ] tR tRtR V 3R llt]R R l4       tRtV ;t# )rP   i  c               (    V ^8  d   QhRRRRRRRR/# )r_   r  r   r  r   r	   rc   rd   re   )rf   s   "rg   rh   DurationCell.__annotate__  s(     ' 'C 'c ') ' 'rj   c                	R   < \         SV `  WV4       \        P                  V n        R # rl   )r   rp   r0   DURATIONr  r  s   &&&&rg   rp   DurationCell.__init__  s    5)&&
rj   c                   V ^8  d   QhRR/# )r_   rc   r	   re   )rf   s   "rg   rh   r7    s      y rj   c                	    V P                   # rl   r  ru   s   &rg   r   DurationCell.value  r  rj   r  r  r   s   @rg   rP   rP     s!    ' '  rj   c                  H   a  ] tR tRtRtR V 3R llt]R R l4       tRtV ;t	# )rR   i  r  c               $    V ^8  d   QhRRRRRR/# r  re   )rf   s   "rg   rh   ErrorCell.__annotate__  r  rj   c                	R   < \         SV `  WR 4       \        P                  V n        R # rl   )r   rp   r0   ERRORr  r  s   &&&rg   rp   ErrorCell.__init__  r  rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   r@    r  rj   c                	    R # rl   re   ru   s   &rg   r   ErrorCell.value  r   rj   r  r,  r   s   @rg   rR   rR     s&    $ $  rj   c                  H   a  ] tR tRtRtR V 3R llt]R R l4       tRtV ;t	# )rW   i  r  c               $    V ^8  d   QhRRRRRR/# r  re   )rf   s   "rg   rh   MergedCell.__annotate__  s!     % %C %c %d %rj   c                	R   < \         SV `  WR 4       \        P                  V n        R # rl   )r   rp   r0   MERGEDr  r  s   &&&rg   rp   MergedCell.__init__  s    4(__
rj   c                   V ^8  d   QhRR/# rJ  re   )rf   s   "rg   rh   rI    r  rj   c                	    R # rl   re   ru   s   &rg   r   MergedCell.value  r   rj   r  r,  r   s   @rg   rW   rW     s&    % %  rj   c                    V ^8  d   QhRRRR/# )r_   r   r   rc   r  re   )rf   s   "rg   rh   rh     s      E i rj   c           
        \        ^4      pV R8w  d]   \        P                  ! \        P                  ! \        P                  4      \        P
                  ! \        V 4      4      ,          4      M^ pV\        ^,
          ,          p\        \        V \        P                  ! ^
V\        ,
          4      ,          4      4      pV^;;,          V^,	          ,          uu&   V^;;,          V^,          ^,          ,          uu&   ^ pV^8  d)   V^,          W&   V^,          p\        VR,          4      pK/  V ^ 8  d   V^;;,          ^,          uu&   V# )   r     )
r  mathfloorlog10elogabsr   r   pow)r   r  expmantissar  s   &    rg   rG  rG    s    r]FCHC<$**TZZ'$((3u:*>>
?UVC?RC3utxxC/,ABBCDH
2J#(J
2J3:!##J	A
a-tO		Qx#~&qyr
d
Mrj   c                    V ^8  d   QhRRRR/# )r_   r  r  rc   r   re   )rf   s   "rg   rh   rh     s     	 	y 	U 	rj   c                b   V ^,          ^,          ^,          V ^,          ^,	          ,          \         ,
          pV ^,          ^,          p\        ^RR4       F  pVR,          W,          ,           pK  	  V ^,          ^,          '       d   ^M^ pV^8X  d   V) pV^
V,          ,          p\        V4      # )   rS  )r   r   r   )r  r[  r\  r  signr   s   &     rg   r  r    s    BZ$1$q9_
LCbzA~H2r2c>FI- r
T!!1qDqy9r3wE<rj   c               $    V ^8  d   QhRRRRRR/# )r_   r   ry   r   r   rc   re   )rf   s   "rg   rh   rh   #  s!      S  c rj   c                    V \         9   d8   \         V ,          p\        V4      '       d	   V! V4      # VP                  V4      # \        R V  R2\        ^R7       R# )zUnsupported field code 'r  r  r  )r   callablestrftimer   r=   )r   r   ss   && rg   _decode_date_format_fieldrg  #  sP    ""u%A;;U8O~~a  #E7!	,.@QOrj   c                   . V Op^ pRpRpRpRpV\        V4      8  Ed0   W#,          pV\        V4      ^,
          8  d   W#^,           ,          MRp	VR8X  dl   V	f   MW#^,           ,          R8X  d   VR,          pV^,          pKu  V'       d   RpV^,          pK  RpV'       d   V\        Wq4      ,          pRpV^,          pK  V'       d   Wh,          pV^,          pK  VP                  4       '       g1   V'       d   V\        Wq4      ,          pRpWh,          pV^,          pEK  V'       d   Wx,          pV^,          pEK0  RpTpV^,          pEK@  V'       d   V\        Wq4      ,          pV# )zHParse a custom date format string and return a formatted datetime value.Fr  Nr  T)r  rg  isalpha)
r  r   charsindex	in_stringin_fieldresultr   current_char	next_chars
   &&        rg   r  r  -  sH   kNEEIHFE
#e*
|(-E
Q(>E!)$D	3 QY3&#
!	
 	7EEF$H
"FQJE%%''3EAA "FQJE!EQJEH EQJE+E99Mrj   c                   V ^8  d   QhRR/# )r_   r   ry   re   )rf   s   "rg   rh   rh   ]  s     H HC Hrj   c                F    V P                   pVP                  \        V4      # )FParse a custom date format string and return a formatted number value.)r  replacer   )text_formatr   r  s   && rg   r  r  ]  s"    &;;''(?GGrj   c                    V ^8  d   QhRRRR/# r_   r   ry   rc   re   )rf   s   "rg   rh   rh   c  s      # # rj   c                p   . V Op^ pRpRpV\        V4      8  d   W,          pV\        V4      ^,
          8  d   W^,           ,          MRpVR8X  dR   Vf    V# W^,           ,          R8X  d   VR,          pV^,          pKv  V'       d   RpV^,          pK  RpV^,          pK  WE,          pV^,          pK  V# )r   Fr  Nr  T)r  )r   rj  rk  rl  r  ro  rp  s   &      rg   _expand_quotesry  c  s    eHEEIO
#e*
|(-E
Q(>E!)$D	3   QY3&3&
!	
 	
+OQJErj   c                   V P                   pWP                  ,          pRV9   d   V P                  R8X  d
   VR,          pV P                  R8w  d$   VP                  RV P                  R,           4      p\        P
                  ! RV4      ;pf   \        R	V R
2\        ^R7       V# VP                  ^4      pVP                  ^4      pV^ ,          R8X  d   RVR,          rMRV9   d   VP                  R4      w  rxMTRrVe5   VR\        V4      ^,
           R2 p	VP                  WY4      p	\        V	4      # \        V4      p
V
^ 8  dE   V^ ,          R8X  d   RpM5V P                  ^ 8  d   \        P                  pM\        P                  pMRpT
p\!        \#        V4      4      P                  R4      w  rV
^ 8  d%   \%        V4      p\'        \#        RV 24      V
4      pM\'        V4      p\#        RV 24      p\        VP                  RR4      4      pV P(                  '       g   VP                  RR4      pV^ 8  d   V^ ,          R8X  d   Rp\        V4      pMV P*                  ^ 8  d   \        P                  pV P(                  '       dr   V^ 8w  d;   \%        \,        P.                  ! \,        P0                  ! V4      4      ^,          4      M^ p\3        V\%        V^,
          ^,          4      .4      pVV,           pM#TpM \        P                  p\        V4      pMRpTpRpV^ 8X  d0   V\        P                  8X  d   V
^ 8X  d   RP5                  V4      p	EMGV^ 8X  d   Vf   V\        P                  8X  d   Rp	EM#V^ 8X  d   V\        P                  8X  d   Vf:   V^ 8X  dE   V\        P                  8X  d0   Vf,   \        \!        V4      4      V
8  d   RP5                  V4      p	MV'       g   V\        P                  8X  d$   V P(                  '       d
   VRV R2 p	MVRV 2 p	MxV\        P                  8X  dB   V P(                  '       d   VR P5                  V4      p	M=\!        V4      P5                  V4      p	M"V P(                  '       d   VR p	M\!        V4      p	V
'       Ed	   V\        P                  8X  g   V\        P                  8X  d&   V^ 8X  d   V	RVRV R2 R,          ,           ,          p	MV\        P                  8X  d/   V^ 8X  d(   V^ 8  d!   V	RP7                  V^,           4      ,          p	MvV\        P                  8X  d3   \!        V4      R,          pV	RVP7                  V4      ,           ,          p	M/V'       g   V^ 8X  d!   V	R\!        V4      R,          ,           ,          p	VP                  WY4      p	\        V	4      # )rs  %      ?      Y@r     ¤    z([#0.,]+(E[+]\d+)?)NzCan't parse format string 'z'; skippingr  .r  E#z0.r  Fr  z,.fr_   NN)r  scale_factorcurrency_codert  r  searchr   r=   groupsplitr  ry  num_nonspace_decimal_digitsr/   ZEROSPACEry   r   r   r   show_thousands_separatornum_nonspace_integer_digitsrT  rU  rV  maxrjustljust)number_formatr   r   r  matchformat_specscientific_specint_partdec_partr  num_decimalsdec_pad	dec_widthintegerdecimalnum_integersint_pad	int_width
num_commasint_pad_space_as_zerodecimal_strs   &&&                  rg   r  r  }  s   (==	'''E
""}'A'AS'H""b(3;;''(2 

 13GHHQ)*>)?{K	

 $#++a.Kkk!nO1~ "KO8	$	$*0058 +R8""1S]Q%6$7q"89.66{To..x=LaA;#G66:!&&G!''GIU5\*005Wag,7)n-|<,"WI'x''R01L111##C,aA;#GHI66:!&&G555IPTUSDJJw,?!@1!DE[\
 *c<!3Cq2H.I!JK
(:5	(	!''GHI 	! !|;#4#449J((9-	A'/g9J9J.J
Q,7k&7&77G<O1{(((OG,((9-	'[-=-="=111!(9+Q 7O!(9+ 6O	K%%	%111!(229=O!'l00;O		/	/	/$QKg,|k&&&7k6G6G+GL\]L]s9+Q'?%DDDO)))gl|a?OsyyQ77O)))g,r*Ks[%6%6y%AAAO)sS\"%555O*22;PO/**rj   c               $    V ^8  d   QhRRRRRR/# )r_   r   r   r|  r   rc   ry   re   )rf   s   "rg   rh   rh     s!     & &5 &$ &3 &rj   c                   V f   R# V ^ 8  d   VP                   ^8X  d   RpV ) p M V ^ 8  d   VP                   ^8  d   RpV ) p MRpVP                  '       d   RMRpV P                  4       '       d%   VP                  \        8  d   \        V 4      V  pMVP                  \        8  d   \        \        V \        RR7      4      pM3\        V \        \        RR7      p\        VVP                  \        R7      pVP                  '       dH   \        VR^\        R7      p VP                  R	4      w  rgVR	,           VP                  RR4      ,           pV'       d
   VR
,          pV'       d   RV R2# V#   \         d     L.i ; i)Nr  FTr  r   )r  r   )decimalsr  )spacerspacingr  r  r{  (r-  )negative_styler  
is_integerdecimal_placesr   r   ry   r  r)   r  rt  r  )r   r  r|  accounting_style	thousandsr  r  r  s   &&&     rg   r  r    sk   }qy]11Q6 	}33q8 $===2Im::>QQ Z4''+>>!&0FU"STO$U,BSXYO$&55O
 111$_S!RUVO%4%:%:3%?"")C-'//#r2J"J 3?#1%%  s   3E3 3F Fc                    V ^8  d   QhRRRR/# r_   r   r   rc   ry   re   )rf   s   "rg   rh   rh   (  s     
$ 
$E 
$S 
$rj   c                *   \        W4      pVP                  \        9   d   \        VP                  ,          pMVP                  R ,           pVP                  '       d   V ^ 8  d   V RVR,           R2# VP                  '       d   V RV 2# W2,           # )r  z	(r  r-  	)r  r  r;   use_accounting_style)r   r  r  symbols   &&  rg   r  r  (  s    %e;O""&66!-"="=>,,s2)))eai_R0133)))O,--##rj   AZc                    V ^8  d   QhRRRR/# rw  re   )rf   s   "rg   rh   rh   8  s     > >3 >3 >rj   c                ^    RP                  V  Uu. uF  qR8X  d   RMRNK  	  up4      # u upi )zInvert a binary value.r  r  r  )r  )r   r   s   & rg   _invert_bit_strr  8  s,    77e<e8C,e<==<s   *c               $    V ^8  d   QhRRRRRR/# )r_   r   r   baserc   ry   re   )rf   s   "rg   rh   rh   =  s!     0 0C 0s 0s 0rj   c           
        \        ^ \        P                  ! \        P                  ! \	        V 4      4      4      ^,           .4      p\        \	        V 4      4      R,          p\        V4      P                  VR4      p\        V^4      ^,           pV^8X  d#   \        V4      R,          P                  VR4      # V^8X  d   \        V4      R,          # \        V4      R,          P                  4       # )zRCalculate the twos complement of a negative integer with minimum 32-bit precision.r  r  )r  rT  ceillog2rY  r  r  r  r   octr  r  )r   r  num_bits	bin_valueinverted_bin_valuetwos_complement_decs   &&    rg   _twos_complementr  =  s    B		$))CJ"781<=>HCJ#I(399(CH0!4q8qy&'+11(C@@qy&'++"#B'--//rj   c                    V ^8  d   QhRRRR/# r  re   )rf   s   "rg   rh   rh   K  s     < < < <rj   c                   V ^ 8X  d   RP                  VP                  4      # \        V 4      p RpVP                  '       g:   VP                  R9   d)   V ^ 8  d   \        WP                  4      # \        V 4      p MV ^ 8  d   Rp\        V 4      p . pV '       d?   VP                  \        WP                  ,          4      4       WP                  ,          p KF  RP                  VRRR1,           Uu. uF  p\        V,          NK  	  up4      pV'       d#   RVP                  VP                  4      ,           # VP                  VP                  4      # u upi )	r   r  FTr  N-r_   r  rR  r`  )zfillbase_placesr   base_use_minus_signr  r  rY  r  r   r  INT_TO_BASE_CHAR)r   r  is_negativer  r  s   &&   rg   r  r  K  s   zyy2233%LEK,,,1C1Cz1Q19#E+=+=>>E
	E
O
s5+=+=#=>?$$$ggODbD<QR<Qq/22<QRSO_**=+D+DEEE  !:!:;;	 Ss   0Ec               $    V ^8  d   QhRRRRRR/# )r_   wholer   	numeratordenominatorre   )rf   s   "rg   rh   rh   e  s!     	( 	(S 	(S 	(s 	(rj   c                x    V ^ 8  d   V^ 8X  d   \        V 4      # V  RV RV 2# V^ 8X  d   R# W8X  d   R# V RV 2# )r   r  /r  r  )ry   )r  r  r  s   &&&rg   _format_fraction_parts_tor  e  sU    qy>u:)Ak]33A~[+''rj   c               $    V ^8  d   QhRRRRRR/# )r_   r   r   r  r   rc   ry   re   )rf   s   "rg   rh   rh   q  s&     D De D# D# Drj   c                `    \        V 4      p\        WV,
          ,          4      p\        W#V4      # )z?Convert a float to the nearest fraction and return as a string.)r   r   r  )r   r  r  r  s   &&  rg   _float_to_fractionr  q  s)    JEkU]34I$U{CCrj   c               $    V ^8  d   QhRRRRRR/# )r_   r   r   
max_digitsr   rc   ry   re   )rf   s   "rg   rh   rh   x  s&     D De D D Drj   c                    ^
V,          ^,
          p\         P                  ! V 4      P                  V4      P                  4       w  r4\	        V 4      pW5V,          ,          p\        WSV4      # )zU
Convert a float to a fraction of a maxinum number of digits
and return as a string.
)r   
from_floatlimit_denominatoras_integer_ratior   r  )r   r  max_denominatorr  r  r  s   &&    rg   _float_to_n_digit_fractionr  x  s`    
 *nq(OE"44_EVVX Y JE$$I$U{CCrj   c                    V ^8  d   QhRRRR/# r  re   )rf   s   "rg   rh   rh     s     / /E /S /rj   c                v    VP                   pVR ,          '       d   RV,
          p\        W4      # \        W4      # )l      ~ l        )fraction_accuracyr  r  )r   r  accuracy
num_digitss   &&  rg   r  r    s8    ..H* 8+
)%<<e..rj   c                    V ^8  d   QhRRRR/# r  re   )rf   s   "rg   rh   rh     s     A Ae As Arj   c                J    \        V \        R R7      pVRVP                   R2 # )Fr  r  r  )r  r)   r  )r   r  r  s   && rg   r  r    s,    U,BOOa < <=Q>?@rj   c               (    V ^8  d   QhRRRRRRRR/# )r_   unitry   r   r   r&  abbrevrb   re   )rf   s   "rg   rh   rh     s(      s 3 s J rj   c                    V^8X  d   RMRpVf
   V ^ ,          pV\         P                  8X  d   R# V\         P                  8X  d   V # RV  2V,           # )r  r  rf  r  )r3   r  SHORT)r  r   r&  r  plurals   &&&& rg   r  r    sU    A:R3F~a%%%###tf:rj   c                8   VP                   pVP                  pV ^ 8X  d$   \        P                  p\        P                  pW23# V \        8  d   \        P
                  pMxV \        8  d   \        P                  pM\V \        8  d   \        P                  pM@V ^<8  d   \        P                  pM(V ^8  d   \        P                  pM\        P                  p\        P                  ! V 4      V 8w  d   \        P                  pMV ^<,          '       d   \        P                  pMkV \        ,          '       d   \        P                  pMGV \        ,          '       d   \        P                  pM#V \        ,          '       d   \        P                  p\        W24      pW23# r   )r  r  r4   r  r-   r  r+   r,   r  r  r  r  rT  rU  r  )
cell_valuer  r  r  s   &&  rg   r  r    s0    66L!88MQ$((%))6 &&3 ((--L>)(,,L?*(--L2(//L1_(//L(44L::j!Z/)55M"__)00M/)))00M.(()..M/)))--MM8&&rj   c                  p   ] tR tRt$ RtR]R&   ^ tR]R&   RtR]R&   ^
tR]R	&   ]	P                  tR
]R&   RtR]R&   ]tR]R&   RtR]R&   ]P"                  tR]R&   RtR]R&   RtR]R&   RtR]R&   ]! R R7      tR]R&   ]P2                  tR]R&   RtR]R &   ]P                  tR!]R"&   RtR]R#&   RtR$ t R%t!R# )&rS   i  Fr   
allow_noner   r  Tr  r  r1   control_formatGBPry   r  r  Nr  r7   r  r|  r   	incrementr}  maximumminimumc                 	    R .# )zItem 1re   re   rj   rg   <lambda>Formatting.<lambda>  s    XJrj   r   r  popup_valuesr8   r  r  r5   r  r  c                	   \        V P                  \        4      '       g1   \        V P                  4      P                  pR V R2p\	        V4      hV P
                  '       d2   V P                  \        P                  8w  d   \        R\        ^R7       V P                  \        P                  8X  dV   \        P                  ! RRV P                  4      P                  4       pV F  pV\         9  g   K  RV R2p\	        V4      h	  V P                  \        P"                  8X  d1   V P$                  \&        9  d   RV P$                   R2p\	        V4      hV P(                  f3   V P                  \        P"                  8X  d	   ^V n        M\*        V n        V P                  \        P,                  8X  d>   V P.                  '       g,   V P0                  R9  d   R
V P0                   2p\	        V4      hV P                  \        P,                  8X  d6   V P0                  ^8  g   V P0                  \2        8  d   Rp\	        V4      hR	# R	# )Invalid format type 'r  z.use_accounting_style overriding negative_styler  z[^a-zA-Z\s]r  zInvalid format specifier 'z' in date/time formatzUnsupported currency code 'Nz*base_use_minus_sign must be True for base zbase must be in range 2-36r  )r   r  r5   r   r   r  r  r8   MINUSr   r  r  r  r  r  r  r   r"  r  r:   r  r   r  r  r  r(   )ro   	type_namer   formatsels   &    rg   r   Formatting.__post_init__  s   $))^44TYY00I))A6CC. $$$)<)<@S@Y@Y)Y@ 99///ff^S$2G2GHNNPG//6rd:OPC#C.( 
 99///D4F4Fj4X/0B0B/C1ECC. &yyN333&'#&9# II,,,,,,		+>tyykJCC. 99+++Q$))hBV.CC.  CW+rj   )r  )"r   r|   r}   r~   r  r   r  r  r  r1   rV  r  r  r!   r  r  r7   THREEr  r  r  r  r   r  r8   r  r  r  r5   r  r  
_format_idr   r   re   rj   rg   rS   rS     s    JK $$D#N,A,H,HN)HM33c3NC*:*@*@'@IuGUGU#4FGL)G*=*C*CN'C%*d*)00D.0!&$&J(!rj   c                      ] tR tRt$ ]P
                  tR]R&   RtR]R&   ]	P                  tR]R&   ]	P                  tR]R	&   ^ tR
]R&   ^ tR
]R&   RtR]R&   RtR]R&   R t]R R l4       tRtR# )rN   i  r2   r  Nry   r   r9   integer_formatdecimal_formatr   r  r  Fr   r  %srf   c                	B   \        V P                  \        4      '       g1   \        V P                  4      P                  pR V R2p\	        V4      hV P                  \        P
                  8X  d0   V P                  P                  R4      ^8  d   Rp\	        V4      hR# R# )r  r  r  z/Custom formats only allow one text substitutionN)r   r  r2   r   r   r}  rf   r  )ro   r  r   s   &  rg   r   CustomFormatting.__post_init__  s    $))%9::TYY00I))A6CC. 99,111dkk6G6G6MPQ6QCCC.  7R1rj   c                   V ^8  d   QhRR/# )r_   archiver   re   )rf   s   "rg   rh   CustomFormatting.__annotate__  s     E E6 Erj   c                	   VP                   \        P                  8X  d   \        P                  pM@VP                   \        P
                  8X  d   \        P                  pM\        P                  p\        VP                  VR 7      # ))r   r  )
r  r6   r  r2   r  CUSTOM_NUMBERrV  r}  rN   r   )r   r	  r  s   && rg   from_archiveCustomFormatting.from_archive  s\    *"8"88.77K  J$<$<<.55K.33KW\\DDrj   re   )r   r|   r}   r~   r2   rV  r  r   r   r9   r"  r  r  r  r  r  rf   r   r  r  r   re   rj   rg   rN   rN     s    !5!<!<D
<D#"-"2"2NK2"-"2"2NK2L#L#%*d*FC! E Erj   )rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r[   r\   )Frl   )
__future__r   r%  rT  r  dataclassesr   r   r   r   r   r	   enumr
   	fractionsr   hashlibr   os.pathr   structr   r   typingr   r   warningsr   r  r   numbers_parserr   numbers_parser_namenumbers_parser.constantsr   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   numbers_parser.currenciesr:   r;   numbers_parser.exceptionsr<   r=   numbers_parser.generatedr>   rC  r?   r  )numbers_parser.generated.TSWPArchives_pb2r@   r   numbers_parser.numbers_cacherA   rB   numbers_parser.numbers_uuidrC   numbers_parser.xrefsrD   r&  loggerr*  __all__rG   rT   r\   r   r   r   r   r   r   r   r   r   r   r   rF   r  rE   r   rZ   r   r   r  rJ   rI   rM   rV   rU   rm  rL   rX   r[   rY   rK   rQ   rH   rO   rP   rR   rW   rG  r  rg  r  r  ry  r  r  r  r   ry   ordchrr  r  r  r  r  r  r  r  r  r  r  rS   rN   )r  s   0rg   <module>r&     s   "   	 8 8 (      "  " :% % % % % % % % % %L C J C C : 3 )			.	/8' 'T6g 6DG D #(($**%,,(22
#(( 
 $$#**#** K
 K& $%67 *  X( X( X(v" Q!VQB $ $D
 D
N; ;|= =  . . .4B,Y B,J  t 8 4 8 x	| 	 (t "t  4     "	-`H4+D&R
$ %*"I.IqCFI.%CRUVYRZ]^R^B_1`B_Q#a&B_1`` >
0<4	(DD/A
!'H <! <! <!~ E E E] /1`s   M>N