+
    	i''                         R t ^ RI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R4      t]! R	R
4      tR tRR ltR tR tR# )z$Manage background position and size.)
namedtuple)cycle)parse_color)boxes)replaced)
percentageresolve_radii_percentages
Backgroundzcolor, layers, styleBackgroundLayerzXimage, size, position, repeat, unbounded, painting_area, positioning_area, clipped_boxesc                    VR 8X  d?   V P                  4       V P                  4       V P                  4       V P                  4       3# VR8X  d?   V P	                  4       V P                  4       V P                  4       V P                  4       3# VR8X  g   Q V4       hV P                  4       V P                  4       V P                  V P                  3# )
border-boxpadding-boxcontent-box)border_box_xborder_box_yborder_widthborder_heightpadding_box_xpadding_box_ypadding_widthpadding_heightcontent_box_xcontent_box_ywidthheight)boxwhich_rectangles   &&b/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/weasyprint/layout/background.pybox_rectangler      s    ,& 0 0 2 1 1 35 	5 
M	)!2!2!4!3!3!57 	7 -/@@/!2!2!4IIszz# 	#    Nc                   ^RI Hp \        V4       V'       d$   VP                  4        F  p\	        WV4       K  	  Vf   VP
                  pVR,          ^ ,          R8w  d(   VR,          w  rxVR8X  d   V! VR7      Vn        MWn        VR,          ^ ,          R8w  d(   VR,          w  rxVR8X  d   V! VR7      Vn        MWn        VR,          R	8X  d   . p	\        R
4      p
M>VR,          pVR,           UUu. uF  w  rxVR8X  d
   V! WR7      MTNK  	  p	ppV! VR4      p
V
P                  ^ 8X  d!   \        V	4      '       g   W8w  d
   RVn        R# \        V	.\        \        VR,          VR,          VR,          VR,          VR,          VR,          .4      O5!   Uu. uF  p\        WVR,          .VO5!  NK  	  pp\!        WV4      Vn        R# u uppi u upi )z%Fetch and position background images.)	get_colorNborder_image_sourcenoneurl)r$   mask_border_source
visibilityhiddentransparentimage_orientationbackground_image)r$   orientationbackground_colorbackground_sizebackground_clipbackground_repeatbackground_originbackground_positionbackground_attachmentimage_resolution)
draw.colorr!   r   all_childrenlayout_box_backgroundsstyleborder_imagemask_border_imager   alphaany
backgroundzipmapr   layout_background_layerr	   )pager   get_image_from_urilayout_childrenr7   r!   childtype_valueimagescolorr+   layerlayerss   &&&&&         r   r6   r6   #   s    ' c"%%'E"40BC ( }		 "#A&&023E>1e<C$!"1%/12E>$65$AC!$)!\h&M*/0 !&&8 9; !: ~ 5B#() 9 	 ; %!34{{aF;!CN  .#e#$#$%&%&'()*., #- ./.E 	 51C+DMuM.  /  u5CN);/s   6GGc
                 ^
   . p
RpWJ d   VP                   p. p
EM\        V \        P                  4      '       d   . p
^ pV P                   Fm  pVP                  '       g   K  T
VP                   Uu. uF  qP                  4       NK  	  up,          p
\        V\        R VP                   4       4      4      pKo  	  V P                  4       V P                  4       V P                  4       V.pEM\        V \        P                  4      '       d   V P                  '       du   V P                   Uu. uF  qP                  4       NK  	  p
p\        R V P                   4       4      pV P                  4       V P                  4       V P                  4       V.pEM\        V \        P                  \        P                  34      '       d   V P                  4       pV'       dl   V Uu. uF  qP                  4       NK  	  p
p\        R V 4       4      p\        R V 4       4      pVV P                  4       VV,
          V P                  4       .pM\\!        W4      pVR8X  d   V P                  4       .p
M8VR8X  d   V P#                  4       .p
MVR8X  g   Q V4       hV P%                  4       .p
Ve'   VP'                  W P(                  R	,          4      w  pppVe
   ^ XX39   d   \+        RR
VRRRRV
R7      # V	R8X  dQ   \        V \        P,                  4      '       d$   ^ ^ V P/                  4       V P1                  4       3pM\!        VR4      pM\!        W4      pVw  ppppVw  ppppVR8X  d   \2        P4                  ! VVX4      w  pp MqVR8X  d   \2        P6                  ! VVX4      w  pp MNVw  p!p"\2        P8                  ! VVX\;        V!V P(                  V4      \;        V"V P(                  V4      VV4      w  pp Vw  p#p$p%p&VV,
          p'VV ,
          p(\;        V$V P(                  V'4      p$\;        V&V P(                  V(4      p&V#R8X  d
   V'V$,
          p$V%R8X  d
   V(V&,
          p&Vw  p)p*V)R8X  dO   \        ^\=        VV,          4      4      p+VV+,          p,^ p$V*R8w  d   V^,          R8X  d   V V,V,          ,          p T,pV*R8X  dO   \        ^\=        VV ,          4      4      p+VV+,          p-^ p&V)R8w  d   V^ ,          R8X  d   VV-V ,          ,          pT-p \+        VVV 3V$V&3VR
VVV
R7      # u upi u upi u upi )    c              3   @   "   T F  qP                  4       x  K  	  R # 5iNr   .0cells   & r   	<genexpr>*layout_background_layer.<locals>.<genexpr>q   s      5C5AT&&((\   c              3   @   "   T F  qP                  4       x  K  	  R # 5irM   rN   rO   s   & r   rR   rS   z   s     G,$++--,rT   c              3   @   "   T F  qP                  4       x  K  	  R # 5irM   )r   rO   s   & r   rR   rS      s     >))++rT   c              3   j   "   T F)  qP                  4       VP                  4       ,           x  K+  	  R # 5irM   )r   r   rO   s   & r   rR   rS      s,      MFKd!!#d&7&7&999es   13r   r   r   N	font_sizeFunused)image	unboundedpainting_areasizepositionrepeatpositioning_areaclipped_boxesfixedcovercontainrightbottomroundauto)rZ   r]   r^   r_   r[   r\   r`   ra   )rK   rK   rK   rK   )
bleed_area
isinstancer   TableRowGroupBoxchildrenrounded_border_boxmaxr   r   r   TableRowBoxTableColumnGroupBoxTableColumnBox	get_cellsminr   r   rounded_padding_boxrounded_content_boxget_intrinsic_sizer7   r
   PageBoxmargin_widthmargin_heightr   cover_constraint_image_sizingcontain_constraint_image_sizingdefault_image_sizingr   rg   ).r   r@   
resolutionrZ   r]   clipr_   originr^   
attachmentra   r\   total_heightrowrQ   r   cellsmin_xmax_xintrinsic_widthintrinsic_heightratior`   positioning_xpositioning_ypositioning_widthpositioning_height
painting_x
painting_ypainting_widthpainting_heightimage_widthimage_height
size_widthsize_heightorigin_x
position_xorigin_y
position_yref_xref_yrepeat_xrepeat_y	n_repeats	new_width
new_heights.   &&&&&&&&&&                                    r   r?   r?   ^   s6    MM
{ 	C//	0	0<<C|||:=,,"H:F$++-,"H H"< 5C58\\5C 2C  D	    0 0 2. 
C**	+	+<<<69llD6Bd'')l  DG#,,GGF  "C$4$4$6  "F,M 
C%33U5I5IJ	K	KCHI544465MI>>>E MFKM ME s'')55=#:K:K:MOM &c0< 3356M]" 4467M=(.$.( 4467M383K3K		+.400)5}o/?@@%}HX%]D 	D
 Wc5==)) !"1c&6&6&8#:K:K:MN,T=A(5 	 HM="35G>K;J
NOw$,$J$J15%:!\		$,$L$L15%:!\ #'
K$,$A$A-uz399.?@{CII/AB1	%3!\ 2:.Hj(J+E-EJ		59JJ		59J7Z'
8Z'
Hh75!2[!@AB	%	1	
w47f#4I33L75!3l!BCD	')3

w47f#4:44K!<(j)#)#% %I"HD Js   0T -T%!T*c           	        \        W V4       \        V P                  ^ ,          \        P                  4      '       d   Q hV P                  ^ ,          pTpVP
                  P                  4       R8X  dE   VP                  f7   VP                   F&  pVP
                  P                  4       R8X  g   K$  Tp M	  VP                  '       d   \        V R4      pV P                  p\        W VRVP                  R7       V P                  P                  V P                  P                   Uu. uF  pVP                  VR7      NK  	  upR7      V n        W`n        RVn        R# RV n        R# u upi )	zLayout backgrounds on the page box and on its children.

This function takes care of the canvas background, taken from the root
elememt or a <body> child of the root element.

See https://www.w3.org/TR/CSS21/colors.html#background

htmlNbodyr   F)rB   r7   )r\   )rI   )r6   rj   rl   r   	MarginBoxelement_taglowerr<   r   r7   _replacerI   canvas_background)r@   rA   root_box
chosen_boxrC   r\   original_backgroundrH   s   &&      r   layout_backgroundsr      s<    4'9:$--*EOO<<<<}}QHJ!!#v-(2E2E2M&&E  &&(F2"
 '
 %dL9"oo*E""	$ "&!9!9 "__3353E ];35 ": "6
 . $
!%5s   (E()TN)__doc__collectionsr   	itertoolsr   tinycss2.color5r   formatting_structurer    r   percentr   r   r	   r
   r   r6   r?   r    r   r   <module>r      sP    * "  ' (  :&<=
56# 86v}%@!&r   