
    9 f                     ^    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	 ddl
mZ ded	ed
efdZdS )z%djLint function to call jsbeautifier.    )partialN)BeautifierOptions   )child_of_unformatted_block)Confightmlconfigreturnc                     dt           dt          dt          j        dt          fd}t	          |||           }t          j        t          j        dt          j        t          j        z            ||           S )z'Format javascript inside <script> tags.r	   r   matchr
   c                 6   t          | ||          r|                                S |                    d                                          s|                                S t          |                    d                    dz  }d| j        d<   t          | j                  }t          j        |                    d          |                                          }d| j        d<   t          | j                  }t          j        |                    d          |                                          }d}t          ||          D ]\  }}	|dz  }||	k    r||z  }|||z   z  }|                    d          |                    d          z   |z   dz   |z   S )z(Add break after if not in ignored block.       indent_levelr    
)
r   groupstriplen	js_configr   jsbeautifierbeautify
splitlineszip)
r	   r   r   indentoptsbeautified_linesbeautified_lines_test
beautifiedlinetests
             I/var/www/equiseq/venv/lib/python3.11/site-packages/djlint/formatter/js.pylaunch_formatterz#format_js.<locals>.launch_formatter   s|   %fdE:: 	!;;== {{1~~##%% 	!;;== U[[^^$$s* ,-( !122'0QFFQQSS+,( !122 , 5ekk!nnd K K V V X X
.0EFF 	( 	(JD$$Jt||d"
&4-'JJ{{1~~A.;dBVKK    zR([ ]*?)(<(?:script)\b(?:\"[^\"]*\"|'[^']*'|{[^}]*}|[^'\">{}])*>)(.*?)(?=</script>))	r   strreMatchr   subcompile
IGNORECASEDOTALL)r   r	   r$   funcs       r#   	format_jsr.      s     L  Ls  L28  L  L  L  L  LD #VT22D6

aMBI%	
 	
 	  r%   )__doc__	functoolsr   r   regexr'   jsbeautifier.javascript.optionsr   helpersr   settingsr   r&   r.    r%   r#   <module>r6      s    + +               = = = = = = 0 0 0 0 0 0      .C . .C . . . . . .r%   