+
    ‚°ñj=  ã                   óz   € ^ RI t ^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIHt ^ RI	H
t
 . R	OtR R lt ! R R4      tR# )
é    N)Úweb)Ú	lru_cache)Úmerge_json_recursivec                ó0   € V ^8„  d   QhR\         R\        /# )é   Ú	file_pathÚreturn)ÚstrÚdict)Úformats   "Ú;C:\Ai_Coding\apps\studio\ComfyUI\app\custom_node_manager.pyÚ__annotate__r      s   € ÷ 	ñ 	¤3ð 	¬4ñ 	ó    c                 óT  € \         P                  P                  V 4      '       g   / #  \        V R RR7      ;_uu_ 4       p\        P
                  ! V4      uuRRR4       #   + '       g   i     R# ; i  \        P                   d    \        P                  ! RT  24       / u # i ; i)Úrzutf-8)ÚencodingNzError loading )	ÚosÚpathÚexistsÚopenÚjsonÚloadÚJSONDecodeErrorÚloggingÚerror)r   Úfs   & r   Úsafe_load_json_filer      sv   € Ü�7‰7�>‰>˜)×$Ò$Øˆ	ðÜ�)˜S¨7×3Õ3°qÜ—9’9˜Q“<÷ 4×3×3Ó3ûä×Ñô Ü�Š˜ y kÐ2Ô3ØŠ	ðús.   ©A4 ¿A Á
A4 Á A1	Á+A4 Á1A4 Á40B'Â&B'c                   óD   a € ] tR t^ t o ]! ^R7      R 4       tR tRtV tR# )ÚCustomNodeManager)Úmaxsizec           	     ó°  € / p\         P                  ! R4       EF¸  p\        \        P                  ! \        P
                  P                  VR4      4      4       EFr  p\        P
                  P                  VR4      p\        P
                  P                  V4      '       g   KK  \        P                  ! \        P
                  P                  VR4      4       Fï  p\        P
                  P                  \        P
                  P                  V4      4      pWa9  d   / W&   \        P
                  P                  VR4      p\        V4      p\         FS  p	\        P
                  P                  WY4      p
V	P                  R4      ^ ,          p\        V
4      pV'       g   KO  WÈV&   KU  	  V'       g   KÛ  \        W,          V4      W&   Kñ  	  EKu  	  EK»  	  V# )a"  Load all custom nodes translations during initialization. Translations are
expected to be loaded from `locales/` folder.

The folder structure is expected to be the following:
- custom_nodes/
    - custom_node_1/
        - locales/
            - en/
                - main.json
                - commands.json
                - settings.json

returned translations are expected to be in the following format:
{
    "en": {
        "nodeDefs": {...},
        "commands": {...},
        "settings": {...},
        ...{other main.json keys}
    }
}
Úcustom_nodesú*/Úlocalesz	main.jsonÚ.)Úfolder_pathsÚget_folder_pathsÚsortedÚglobr   r   Újoinr   ÚbasenameÚdirnamer   ÚEXTRA_LOCALE_FILESÚsplitr   )ÚselfÚtranslationsÚfolderÚcustom_node_dirÚlocales_dirÚlang_dirÚ	lang_codeÚ	main_fileÚnode_translationsÚ
extra_fileÚextra_file_pathÚkeyÚ	json_datas   &            r   Úbuild_translationsÚ$CustomNodeManager.build_translations!   sT  € ð2 ˆä"×3Ò3°N×CˆFä#)¬$¯)ª)´B·G±G·L±LÀÈÓ4NÓ*O×#P�Ü Ÿg™gŸl™l¨?¸IÓF�Ü—w‘w—~‘~ k×2Ò2Ùä $§	¢	¬"¯'©'¯,©,°{ÀDÓ*IÖ J�HÜ "§¡× 0Ñ 0´·±·±ÀÓ1JÓ K�Ià Ô4Ø24˜Ñ/ô !#§¡§¡¨X°{Ó C�IÜ(;¸IÓ(FÐ%÷ '9˜
Ü*,¯'©'¯,©,°xÓ*L˜Ø(×.Ñ.¨sÓ3°AÕ6˜Ü$7¸Ó$H˜	ß$™9Ø5>¨cÓ2ñ '9÷ )Ñ(Ü2FØ(Õ3Ð5Fó3˜Ó/ô' !Kô $Qñ Dð< Ðr   c                óÆ  a a
€ . ROo
VP                  R4      V
3R l4       pV F   w  rVS
 F•  p\        P                  P                  Wg4      p\        P                  P	                  V4      '       g   KI  VR 8w  d   \
        P                  ! RWu4       VP                  \        P                  ! RV,           V4      .4       K—  	  K¢  	  VP                  R4      V 3R l4       p	R# )	Úexample_workflowsz/workflow_templatesc              “  ó®  <"  € . p\         P                  ! R4       FW  pS
 FN  p\        P                  P	                  VRV R24      p\
        P
                  ! V4      pVP                  V4       KP  	  KY  	  / pV FÀ  p\        P                  P                  \        P                  P                  \        P                  P                  V4      4      4      p\        P                  P                  \        P                  P                  V4      4      ^ ,          p	VP                  V. 4      P                  V	4       KÂ  	  \        P                  ! V4      # 5i)z“Returns a web response that contains the map of custom_nodes names and their associated workflow templates. The ones without templates are omitted.r"   r#   z/*.json)r&   r'   r   r   r*   r)   Úextendr+   r,   ÚsplitextÚ
setdefaultÚappendr   Újson_response)ÚrequestÚfilesr1   Úfolder_nameÚpatternÚmatched_filesÚworkflow_templates_dictÚfileÚcustom_nodes_nameÚworkflow_nameÚexample_workflow_folder_namess   &         €r   Úget_workflow_templatesÚ<CustomNodeManager.add_routes.<locals>.get_workflow_templates`   s
  øé € ð ˆEä&×7Ò7¸ÖG�Û#@�KÜ Ÿg™gŸl™l¨6°R¸°}ÀGÐ3LÓM�GÜ$(§I¢I¨gÓ$6�MØ—L‘L Ö/ó $Añ Hð ð $ó �Ü$&§G¡G×$4Ñ$4Ü—G‘G—O‘O¤B§G¡G§O¡O°DÓ$9Ó:ó%Ð!ô !#§¡× 0Ñ 0´·±×1AÑ1AÀ$Ó1GÓ HÈÕ K�Ø'×2Ñ2Ð3DÀbÓI×PÑPØ!öñ ô ×$Ò$Ð%<Ó=Ð=ùs   ƒEEzdFound example workflow folder '%s' for custom node '%s', consider renaming it to 'example_workflows'z/api/workflow_templates/z/i18nc              “  óT   <"  € \         P                  ! SP                  4       4      # 5i)z<Returns translations from all custom nodes' locales folders.)r   rE   r<   )rF   r/   s   &€r   Úget_i18nÚ.CustomNodeManager.add_routes.<locals>.get_i18nŒ   s"   øé € ô ×$Ò$ T×%<Ñ%<Ó%>Ó?Ð?ùs   ƒ%(N)r?   ÚexampleÚexamplesÚworkflowÚ	workflows)
Úgetr   r   r*   r   r   ÚdebugÚ
add_routesr   Ústatic)r/   ÚroutesÚwebappÚloadedModulesrP   Úmodule_nameÚ
module_dirrH   Úworkflows_dirrS   rO   s   f&&&      @r   r[   ÚCustomNodeManager.add_routes\   sË   ù€ â(mÐ%à	�‰Ð)Ó	*ô	>ó 
+ð	>ó2 (5Ñ#ˆKÛ<�Ü "§¡§¡¨ZÓ E�ä—7‘7—>‘> -×0Ô0Ø"Ð&9Ô9ÜŸšð CØ'ô6ð ×%Ñ%äŸJšJØ :¸[Õ HÈ-óðöó  =ñ (5ð$ 
�‰�GÓ	ô	@ó 
ò	@r   © N)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r<   r[   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r       s)   ø‡ € Ù�qÔñ8ó ð8÷t3@ð 3@r   r   )znodeDefs.jsonzcommands.jsonzsettings.json)r   r&   r)   Úaiohttpr   r   r   Ú	functoolsr   Úutils.json_utilr   r-   r   r   rd   r   r   Ú<module>ro      s8   ðÛ 	Û Û Ý Û Û Ý å 0òÐ õ	÷o@ó o@r   