
    UHjc              
         d Z ddlmZ ddlZddlZddlmZ ddlmZ  ee	      j                         j                  d   Zedz  Zdd	d
ddZddddZddddddddddgiZd4dZd5d6dZd7d8dZd9dZd:dZd;d Zd:d!Zd<d"Zd=d#Zd>d$Zd?d%Zd@d&ZdAd'ZdBd(Zdddd)	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dCd*ZdDd+Z dEd,Z!d:d-Z"	 	 	 	 	 	 	 	 dFd.Z#dGd/Z$efdHd0Z%efdId1Z&dJd2Z'e(d3k(  r e'        yy)Ka  Build a canonical CNS source-rect review bundle.

The web page should not re-assemble scattered review JSON files at runtime.
This script normalizes the current promoted/selected rect data into one bundle
and keeps unpromoted candidates explicitly separate.
    )annotationsN)Path)Any   outUIu	   몬스터u	   캐릭터u   배틀)uimonster	characterbattleu   확정/적용u   검토/후보u	   미확정)goodwarnbadcara_etci  p   0   z0x00485874 #16
0x00485874   z"manual-tile-26-7-3x3-exe-candidate)xywhsourceLabelsourceTableVaHexsourceRectIndexconfirmationc                L    t        j                  | j                  d            S )Nutf-8encoding)jsonloads	read_text)paths    7/home/exedev/hwanse/tools/build_cns_rect_review_data.py	load_jsonr&   1   s    ::dnngn677    c                "   t        | j                  d| j                  dd            xs d      t        | j                  d| j                  dd            xs d      t        | j                  d| j                  dd            xs d      t        | j                  d| j                  d	d            xs d      d
}|||d<   |xs$ | j                  d      xs | j                  d      }|t        |      |d<   dD ]  }|| v s| |   ||<    |S )Nr   sourceXr   r   sourceYr   widthr   height)r   r   r   r   indexlabeloverlayLabel)r   columnrownontransparentPixelsemptyoffsetXoffsetY)intgetstr)rectr-   r.   r   
rect_labelkeys         r%   
clean_rectr<   5   s   #txx	156;!<#txx	156;!<#txx349:#txx!45:;	C GG$((7+Gtxx/GJ:Gf !$;CyCH! Jr'    c                    g }t        | xs g       D ]R  \  }}|j                  d      xs |j                  d      xs
 |r| | nd }|j                  t        |||             T |S )Nr.   r/   r-   r.   )	enumerater7   appendr<   )rectslabel_prefixresultr-   r9   r.   s         r%   clean_rectsrE   G   ss    F "- Bt!uTXXn%=u^j\NSXRYBZptjU%@AB Mr'   c                   t        | j                  d| j                  dd            xs d      t        | j                  d| j                  dd            xs d      t        | j                  d| j                  dd            xs d      t        | j                  d| j                  d	d            xs d      | j                  d
      | j                  d      fS )Nr   r)   r   r   r*   r   r+   r   r,   r4   r5   )r6   r7   )r9   s    r%   rect_keyrG   O   s    DHHS$((9a016Q7DHHS$((9a016Q7DHHS$((7A./415DHHS$((8Q/05A6 r'   c                   | j                  d      xs g D cg c](  }|j                  d      s|j                  d      s'|* }}|r|S | j                  d      xs i }|j                  d      r|j                  d      r|gS g S c c}w )NtablesfieldPlus4BoundrB   	bestTabler7   )r1   tablerI   s      r%   descriptor_bound_rect_tablesrN   Z   s    !$!2!8bpEIIFW<X]b]f]fgn]oepFpGGK &BEyy"#		'(:wI qs   BBBc           
     T   t        |       }t               }g }d}t        |      D ]  \  }}|j                  d      xs d| }t        |j                  d      xs g       D ]c  \  }}	|dz  }t	        |	      }
|
|v r|j                  |
       t        |	t        |      d| d|       }| d	| |d
<   |j                  |       e  t        j                  t        | j                  d      xs d      g       D ]  }	t	        |	      }
|
|v r|j                  |
       t        |	t        |      dt        |             }|	j                  d
      |d
<   |	j                  d      |d<   |	j                  d      |d<   |	j                  d      |d<   |j                  |        |||fS )a7  Return unique source rects across all descriptor +4 tables for one CNS.

    Some `cara_*.cns` files hold multiple actors or action groups.  The EXE has
    several descriptor-bound source-rect tables for the same CNS, so a single
    best table leaves valid sprites without overlays in the unified review.
    r   tableStartVaHexztable-rB   r   T#r?   z #r   assetr=   zmanual#r   r   r   )rN   setr@   r7   rG   addr<   lenrA   PROMOTED_SINGLE_RECTSr8   )r1   rI   seenmergedraw_entry_counttable_indexrM   table_labelframe_indexr9   r;   items               r%   merged_descriptor_rectsr_   d   s    *#.F58UDFO'/ 
 Uii 12L{m6L!*599W+=+C!D 	 Kq O4.Cd{HHSMd#f+qQ{m=\]D%0MK="ADMM$	 
  &))#cggg.>.D"*ErJ 
tn$;$c&k73v;-9PQ"hh}5]#'88,>#? "&((+<"=#xx7^d
 6?**r'   c                   g }t        | j                  d      xs g       D ]  \  }}t        |j                  d      xs g d| d      }|s-|j                  ||j                  d      xs d| |j                  d      |j                  d	      |j                  d
t	        |            |j                  d      |j                  d      |j                  d      |j                  d      |d
        |S )NcandidateTablesrB   C:)rC   rP   z
candidate-schemastride
frameCount
fieldLabelrJ   boundaryKind)
r-   r.   rd   re   rf   rP   rg   rJ   rh   rB   )r@   r7   rE   rA   rV   )r1   rI   r-   rM   rB   s        r%   candidate_tablesri      s    F!#''*;"<"BC 
uEIIg.4"QugQ<P#45M:eW9M))H-))H-#iic%jA#(99->#?#ii5#(99->#? %		. 9	
	
$ Mr'   c                    g }| D ]L  }|j                  d      xs g D ]2  }t        |      }|j                  d      |d<   |j                  |       4 N |S )NrB   r.   candidateTable)r7   dictrA   )rI   r   rM   r9   r^   s        r%   flattened_candidate_rectsrm      sc    
C IIg&," 	D:D%*YYw%7D!"JJt	
 Jr'   c                   t        | j                  d      t              rt        | d         dfS t        | j                  d      t              rt        | d         dfS | j                  d      xs i }|j                  d      rt        |d         dfS | j                  d      r*t	        | d   d| d   j                  d      xs d	      gdfS g d
fS )NglyphMapcellMap	rectTablerB   	fullFramer   r.   fullr?   none)
isinstancer7   listrE   r<   )r1   
rect_tables     r%   selected_ui_rectsrx      s    #''*%t,3z?+Z77#'')$d+3y>*I55%+J~~g:g./<<
ww{3{+1C<L<P<PQX<Y<c]cdegrrrv:r'   c                R    | xs d} | j                  d      s| dk(  ry| dk(  sd| v ryy)Nr=   	confirmedzbest-exe-rectr   zreview-full-image	candidater   )
startswith)selecteds    r%   source_statusr~      s9    ~2H;'8+F&&+*Ar'   c                Z    | j                  d      xs g D ci c]  }|d   |
 c}S c c}w )NrowsassetKeyrL   )frame_assetsr1   s     r%   frame_asset_mapr      s/    ,8,<,<V,D,JKSC
OS KKKs   (c                T    |j                  | i       j                  d      xs d|  dS )Nr$   ../extract_fld/.cnsrL   )rS   r   s     r%   
image_pathr      s.    E2&**62Swd6SSr'   c                \    | dk(  rd| S | dk(  rd| S | dk(  rd| S | dk(  rd| S d	| S )
Nr	   zui_window_review.html?asset=r
   zmonster_review.html?asset=r   z"field_character_review.html?asset=r   z'battle_effect_visual_review.html?asset=zcns_rect_review.html?asset= )grouprS   s     r%   review_hrefr      sb    }-eW55	+E7333E7;;8@@(00r'   c                   | sy | j                  d      | j                  d      | j                  d      | j                  dt        | j                  d      xs g             | j                  d      | j                  d      | j                  d      | j                  d	      | j                  d
      | j                  d      | j                  d      dS )Nrd   re   
hasOffset2rf   rB   rP   tableStartFileOffsetHexrg   rJ   !descriptorPlus4PointsToTableStartrh   score)rd   re   r   rf   rP   r   rg   rJ   r   rh   r   )r7   rV   )rM   s    r%   table_summaryr      s    ))H%))H%ii-iic%))G2D2J.KL 99%67#(99-F#Gii- 99%67-2YY7Z-[		.17# r'   )candidate_tables_valuesourcenotec                   |	xs g }	t        |	      }i d| dt        |    d|d|d|d|d|d|xs d	 d
|xs d	 d|dt        |   d|d|dt        |      d|	d|dt        |      d|
xs i t	        | |      |dS )Nr   
groupLabelrS   cnsr$   r+   r,   size-r   statusstatusLabelselectedRectSourcerB   	rectCountra   candidateRectscandidateCountr   )
reviewHrefr   )rm   GROUP_LABELSSTATUS_LABELSrV   r   )r   rS   r   r$   r+   r,   r   selected_rect_sourcerB   r   r   r   
candidatess                r%   base_rowr      s+    49r*+ABJl5) 	 	s	
 	 	 	& 	5<C.&-C1 	& 	}V, 	2 	 	SZ 	1 	*  	#j/!" 	&,B#$ "%/' r'   c                   g }| j                  d      xs g D ]Q  }|j                  d      }|rt        |      j                  d      r2t        |      \  }}|j                  d      xs |}t	        |      }t        |      }|dk(  rg }d|t        |j                  d      xs |j                  d            |dk(  rd	nd
d}	|j                  t        d||j                  d      xs | d|j                  d      xs d| d|j                  d      |j                  d      |||||	|j                  di       j                  d      xs |j                  d      xs d             T |S )NassetsrS   btl_r   r   zui-window-canonicalrq   rK   rz   review)kindselectedKeyrq   
confidencer	   r   r   r$   r   r+   r,   	frameHintr   r=   r   rS   r   r$   r+   r,   r   r   rB   r   r   r   )	r7   r8   r|   rx   ri   r~   r   rA   r   )
	ui_windowr   r1   rS   rB   rG   r}   c_tablesr   r   s
             r%   build_ui_rowsr     sj   D}}X&," 
 E
--f5+C0x77/0<H#C(x(VH)#&sww{';'Ssww{?ST)/6)9+x	
 	GGEN4tnWWV_E/%(Eggg&wwx(%-'/WW["-11&9RSWWV_RPR	
!
@ Kr'   c                2   g }| j                  d      xs g D ]  }|j                  d      }|j                  d      xs i }t        |j                  d      xs g       }|j                  d      }|j                  dt        |            }t        |j                  d            }	|d uxr t	        |xs d      t	        |xs d      k(  }
|r	|	r|
rd	}d
}n|rd}d}nd}d}d|||j                  d      |j                  d      |j                  d      |j                  d      t        |      d}|j                  t        d||j                  d      xs | dt        ||      t	        t        |j                  d      xs d      j                  d      d   xs d      t	        t        |j                  d      xs d      j                  d      d   xs d      ||rdnd||d|xs d d |xs d d!|j                  d      xs d "              |S )#N	localRowsrS   bestAdjacentTablerB   targetFrameCountrf   r   r   r   z#descriptor-bound-target-count-matchr   zrect-table-present-reviewr   zmissing-rect-tablez'monster-descriptor-plus4-adjacent-tableautoComponentCountframeCountSourcerectSetSourcedescriptorRefVaHex)r   r   r   r   r   r   r   rM   r
   r   r   	imageSize0x0r   r   z&monster-exe-adjacent-source-rect-tablemissingztarget r   z	 / table z / auto r   rS   r   r$   r+   r,   r   r   rB   r   r   )r7   rE   rV   boolr6   r   rA   r   r   r8   split)monster_scanr   r   r1   rS   rM   rB   target_counttable_countdescriptor_boundmatchesr   r   r   s                 r%   build_monster_rowsr   2  s"   D,2 )
 +,2EIIg.4"5ww12iic%j9		*M NOd*^s;3C!/DLL]\]H^/^%'F>JF4JF-J=$ ,"%''*>"? #(: ; WW_5"%''*>"?"5)	
 	GGEN4tn|4#cggk2;e<BB3GJOaP3sww{3<u=CCCHKPqQQV%M\e|2s39[=OC<PPXY\Y`Y`auYvY}z}X~	
7)
T Kr'   c                   g }| j                  d      xs g D ]  }|j                  d      xs g D ]  }|j                  t        |j                  d      |j                  d      |j                  d      |j                  d      |j                  d       dd	|j                  d
      |j                  d       d|j                  d
                      t        | j                  d      xs g       D ]g  \  }}|j                  t        |j                  d      |j                  d      | j                  d      | j                  d      dd	|d|              i |S )N
directionsframesr)   r*   r+   r,   namez walk)r   r   r   r   r   r-   rR   r?   specialFrames
frameWidthframeHeightspecialzspecial#)r7   rA   r<   r@   )r1   rB   	directionframer-   s        r%   playable_rectsr   a  sX   "$EWW\*0b 	]]8,2 	ELL"YYy1"YYy1"YYw/"YYx0*3--*?)@'F  ))G,&]]6231UYYw5G4HI
	 "#''/":"@bA 
u9-9-./#,  (
	

 Lr'   c                
   g }t               }|j                  d      xs g D ci c]  }|j                  d      | }}| D ]  }t        |j                  d      xs d      j                  dd      }|j	                  |       |j                  |      xs i }t        |      \  }	}
}|	rQ|
rNt        d |
D              }t        j                  |g       }|	}t        |
      dkD  rdnd	}t        |
      dkD  rd
nd|rdn|rdndt        |
d         |
D cg c]  }t        |       c}|
D cg c]  }|j                  d      rt        |      ! c}|t        |
      |t        |      d|j                  d      |j                  d      |j                  d      |j                  d      ddd
}dt        |
       dt        |       d|rdnd |rdnd d|j                  d       d|j                  d       }nit        |      }d }d!d"|j                  d      |j                  d      |j                  d      dd#}d$|j                  d       d|j                  d       }|j                  t        d%||j                  d      t        ||      |j                  d&      |j                  d'      d(||||)              |j                  d      xs g D ]U  }|j                  d*      d%k7  s|j                  d      |v r,|j                  d      }|j                  d+      xs i }t        |      \  }}
}|st        |j                  d,      xs g       }t        |xr |
      }t        d- |
D              }t        j                  |g       }|rd(n|rd.nd/}g }|rt        |
      dkD  rd0n|rd1nd2|r
|rdn|rdndnd3|j                  d*      t        |
r|
d   n|      |
D cg c]  }t        |       c}|
D cg c]  }|j                  d      rt        |      ! c}|t        |
      |t        |      d4
}|rd5t        |
       dt        |       dnI|rd6t        |
       dt        |       dn,|j                  d7      xs d8 d9|j                  d:      xs d8 }|r| d;|d   d<    }|j                  t        d%||j                  d=      xs | dt        ||      |j                  d&      |j                  d'      ||rt        |
      dkD  rdnd	n|rd>nd?||||@             X |S c c}w c c}w c c}w c c}w c c}w )ANr   rS   filer=   r   c              3  @   K   | ]  }|j                  d          ywrJ   NrL   .0rM   s     r%   	<genexpr>z'build_character_rows.<locals>.<genexpr>  s     &`E5995F+G'G&`   r   zexe-source-rect-table-unionexe-source-rect-tablez+field-character-exe-source-rect-table-unionz%field-character-exe-source-rect-tablez)field-plus4-or-promoted-single-rect-boundz'field-plus4-or-promoted-alternate-boundfield-plus4-boundr   rJ    out/character_sprite_frames.jsonr   r   walkFramesPerDirection	idleFramezbottom-3x1-horizontal-footprint)r   r   r   r   r   	footprint)
r   r   rM   rI   promotedAlternateTablespromotedSingleRectssourceTableCountrawRectEntryCountuniqueRectCount
reviewGridzexe z table(s), z unique rectsu!    · includes promoted single rectu&    · includes promoted alternate layoutu    · walk-grid u   /dir · idle #z$confirmed-48x64-field-character-gridzconfirmed-field-character-gridzmanual-confirmed)r   r   r   r   r   r   zwalk r   r+   r,   r   r   categoryrK   rB   c              3  @   K   | ]  }|j                  d          ywr   rL   r   s     r%   r   z'build_character_rows.<locals>.<genexpr>  s     "\uyy1B'C#C"\r   r   r   z%character-exe-source-rect-table-unionzcharacter-exe-source-rect-tablez#character-exe-source-rect-candidater   )
r   r   r   rM   rI   r   r   r   r   r   z+descriptor +4/alternate source rect union: z!descriptor +4 source rect union: rg   r   u    · rh   u    · promoted single rect r   r   zexe-source-rect-candidater   r   )rT   r7   r8   replacerU   r_   anyrW   rV   r   r   rA   r   r   rE   r   )character_frames	rect_scanr   r   rz   r1   rect_scan_by_assetrS   exe_row	exe_rects
exe_tablesrZ   has_alternate_tablespromoted_single_rectsrB   selected_sourcerM   r   r   is_descriptor_boundr   r   
table_items                          r%   build_character_rowsr     s   
 DI;D==;P;VTVWC#'''*C/WW ?
CGGFO)r*2262>e$((/521H1Q.	:#&&`U_&`#` $9$=$=eR$H!E?B:QR?R;XoOILZ[\I\E  cJMbI  Wk  jS  qD&z!}5=GHE=/H6@,-2		RcHdM%(, (=$'
O%4#&u:@"%'',"7#&77=#9.1gg6N.O!$!5!BF, s:'{3u:,m:O6UWX?S;Y[\ ] WW%=>?~cggVaNbMce  #3'EDO80!ggl3"ww}5*-''2J*K>F 377#;<=^CGGT_L`KabD!GGFO|4ggg&wwx(%4	
c?
@ }}V$* 3
77:+-1AY1N $*-DS-I*z?		' 2 8b9E"5#7Z8""\Q["\\ 5 9 9% D.uV%)+?RWZ[eWfijWj;  Wj  rS  pU GZJ_F  Th  gP  nA  `h
+"J:a=EJCMNZ}Z0N<F(.8jnn]nNoj)( $9 #J!0"5z
  $ :#j/9J+VYZ_V`Uaano # 5S_4E[QTUZQ[P\\ijIIl+2s34		.8Q8XUX7YZ 	 !V45J15Mm5\4]^D!GGEN4tn|4ggg&wwx( }Ps:YZGZ&C`w  v{  Wr  AJ'/	
I3
h Kk X I,F O(s)   T4T9-T>T>&U>UUc                   g }| j                  d      xs g D ]H  }|j                  d      dk7  r|j                  d      }|j                  d      xs i }t        |j                  d      xs g       }|r|j                  d      rdn|rd	nd
}g }d|j                  d      rdnd|j                  d      t        |      d}	|j                  t	        d||j                  d      xs | dt        ||      |j                  d      |j                  d      ||rdnd|||	|j                  dt        |            xs d d|j                  d      xs d              K |S )Nr   r   r   rS   rK   rB   rJ   r   r   r   zbattle-exe-source-rect-tabler   r   )r   r   r   rM   r   r   r+   r,   r   r   rf   r   u    frames · rg   r   r   )r7   rE   r   rA   r   r   rV   )
r   r   r   r1   rS   rM   rB   r   r   r   s
             r%   build_battle_rowsr     se   D}}V$* 
77:(* $*EIIg.4"5 UYY/@%ARW]b)+216;L1M-S[
+"5)	
 	GGEN4tn|4ggg&wwx(@E%<9'/		,E
;@qAUYYWcMdMkhkLlm	

< Kr'   c                V  
 t        | dz        }t        | dz        }t        | dz        }t        | dz        }t        | dz        }t        |      }g t        |      t        ||      t	        |||      t        ||      }|j                  d        t        D ci c]  t        fd|D               }	}t        D 

ci c]  

t        
fd	|D               }}
d
dg dt        |      |	|t        d |D              t        d |D              |g dd
S c c}w c c}
w )Nzcns_frame_assets.jsonzcns_frame_rect_exe_scan.jsonz(monster_frame_rect_exe_pattern_scan.jsonzcharacter_sprite_frames.jsonzui_window_review_data.jsonc                    | d   | d   fS )Nr   rS   r   )r1   s    r%   <lambda>zbuild_summary.<locals>.<lambda>2  s    s7|S\: r'   )r;   c              3  4   K   | ]  }|d    k(  sd  yw)r   r   Nr   )r   r1   r   s     r%   r   z build_summary.<locals>.<genexpr>3  s     JSCLE4IqJ   c              3  4   K   | ]  }|d    k(  sd  yw)r   r   Nr   )r   r1   r   s     r%   r   z build_summary.<locals>.<genexpr>4  s      Nsc(mv6M Nr   zcanonical-cns-rect-review-datazACanonical selected CNS frame/source rect data grouped for review.)zout/ui_window_review_data.jsonz,out/monster_frame_rect_exe_pattern_scan.jsonr   z out/cns_frame_rect_exe_scan.jsonzout/cns_frame_assets.jsonc              3  &   K   | ]	  }|d      yw)r   Nr   r   r1   s     r%   r   z build_summary.<locals>.<genexpr>B  s      Bc[!1 B   c              3  &   K   | ]	  }|d      yw)r   Nr   r   s     r%   r   z build_summary.<locals>.<genexpr>C  s     !HC#&6"7!Hr   )zlThe browser page consumes this one canonical bundle instead of assembling scattered source files at runtime.zxSelected rects are the latest applied/review units. Unpromoted candidates are retained separately and hidden by default.zistatus.cns and 01234567.cns remain whole-image review rows; their grid/table candidates are not promoted.z/face_01.cns is a confirmed 80x80 portrait grid.ziMonster rows use descriptor +4 adjacent source-rect tables when available; mismatches remain review rows.)
r   scoper   rowCountgroupCountsstatusCountsselectedRectCountcandidateRectCountr   notes)r&   r   r   r   r   r   sortr   sumr   rV   )out_dirframe_assets_datar   r   r   r   r   r   r   group_countsr   status_countss           ` ` r%   build_summaryr  %  sQ   !',C"CD'$BBCIW'QQRL +I!IJ'$@@AI"#45L	y	!	L,	7 
.	<	H 
9l	3	D 	II:I;XdeuE3JDJJJeLe]jkSYVS Nd NNNkMk2T
 I#%  BT BB!!H4!HH
!  fks   "D!	D&c                    |j                  dd       |dz  j                  t        j                  | dd      dz   d	       |d
z  j                  dt        j                  | dd      z   dz   d	       y )NT)parentsexist_okcns_rect_review_data.jsonF   )ensure_asciiindent
r   r   zcns_rect_review_data.jsz%window.HWANSE_CNS_RECT_REVIEW_DATA = ),rc   )r  
separatorsz;
)mkdir
write_textr!   dumps)summaryr
  s     r%   write_outputsr  O  s    MM$M.**66

7q9D@ 7  ((44/
**W5Z
H	I
	 	 5 r'   c            	     (   t        j                         } | j                  dt        t               | j                         }t        |j                        }t        ||j                         t        d|d    d|d    d|j                  dz          y )	Nz	--out-dir)typedefaultzwrote r  z rows, r  z selected rects -> r  )
argparseArgumentParseradd_argumentr   OUT
parse_argsr  r
  r  print)parserargsr  s      r%   mainr)  ]  s    $$&F
$<DDLL)G'4<<(	:
w&'
((;DLLKf<f;g	ir'   __main__)r$   r   returnr   )NN)r9   dict[str, Any]r-   
int | Noner.   z
str | Noner+  r,  )r=   )rB   list[dict[str, Any]] | NonerC   r8   r+  list[dict[str, Any]])r9   r,  r+  z#tuple[int, int, int, int, Any, Any])r1   r,  r+  r/  )r1   r,  r+  z6tuple[list[dict[str, Any]], list[dict[str, Any]], int])rI   r/  r+  r/  )r1   r,  r+  z tuple[list[dict[str, Any]], str])r}   r8   r+  r8   )r   r,  r+  dict[str, dict[str, Any]])rS   r8   r   r0  r+  r8   )r   r8   rS   r8   r+  r8   )rM   dict[str, Any] | Noner+  r1  )r   r8   rS   r8   r   r8   r$   r8   r+   r-  r,   r-  r   r8   r   r8   rB   r/  r   r.  r   r1  r   r8   r+  r,  )r   r,  r+  r/  )r   r,  r   r0  r+  r/  )r   r/  r   r,  r   r0  r+  r/  )r   r,  r   r0  r+  r/  )r
  r   r+  r,  )r  r,  r
  r   r+  None)r+  r2  ))__doc__
__future__r   r!  r!   pathlibr   typingr   __file__resolver  ROOTr$  r   r   rW   r&   r<   rE   rG   rN   r_   ri   rm   rx   r~   r   r   r   r   r   r   r   r   r   r   r  r  r)  __name__r   r'   r%   <module>r;     s   #     H~''*
Ul 	  + ,!@		
  8$!+H.
LT	1: ;?$(%% % 
	%
 % % % % %  % 8% "% % %P"J,^D|*|| ,| 	|~ F #& 'T <? 
 zF r'   