import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import java.util.function.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.math.*;
import static x30_pkg.x30_util.DynamicObject;
import java.text.*;
import java.text.NumberFormat;
import java.util.TimeZone;
import java.awt.geom.*;
class main {
static AutoCloseable profileThisThreadToConsole() {
int interval = 5000, firstInterval = 1000;
final Thread t = currentThread();
return timerAsAutocloseable(doEvery_daemon(interval, firstInterval, new Runnable() { public void run() { try {
print("\nStack trace.");
print(lines(asList(t.getStackTrace())));
} catch (Exception __e) { throw rethrow(__e); } } public String toString() { return "print(\"\\nStack trace.\");\r\n print(lines(asList(t.getStackTrace())));"; }}));
}
static A profileThisThreadToConsole(IF0 f) {
if (f == null) return null;
AutoCloseable __1 = profileThisThreadToConsole(); try {
return f.get();
} finally { _close(__1); }}
static void profileThisThreadToConsole(Runnable r) {
if (r == null) return;
AutoCloseable __2 = profileThisThreadToConsole(); try {
r.run();
} finally { _close(__2); }}
static Thread currentThread() {
return Thread.currentThread();
}
static AutoCloseable timerAsAutocloseable(final java.util.Timer timer) {
return timer == null ? null : new AutoCloseable() {
public void close() {
timer.cancel();
}
};
}
// firstDelay = delay
static FixedRateTimer doEvery_daemon(long delay, final Object r) { return doEvery_daemon(defaultTimerName(), delay, r); }
static FixedRateTimer doEvery_daemon(String timerName, long delay, final Object r) {
return doEvery_daemon(timerName, delay, delay, r);
}
static FixedRateTimer doEvery_daemon(long delay, long firstDelay, final Object r) { return doEvery_daemon(defaultTimerName(), delay, firstDelay, r); }
static FixedRateTimer doEvery_daemon(String timerName, long delay, long firstDelay, final Object r) {
FixedRateTimer timer = new FixedRateTimer(true);
timer.scheduleAtFixedRate(smartTimerTask(r, timer, delay), firstDelay, delay);
return timer;
}
static FixedRateTimer doEvery_daemon(double delaySeconds, final Object r) {
return doEvery_daemon(toMS(delaySeconds), r);
}
static volatile StringBuffer local_log = new StringBuffer(); // not redirected
static boolean printAlsoToSystemOut = true;
static volatile Appendable print_log = local_log; // might be redirected, e.g. to main bot
// in bytes - will cut to half that
static volatile int print_log_max = 1024*1024;
static volatile int local_log_max = 100*1024;
static boolean print_silent = false; // total mute if set
static Object print_byThread_lock = new Object();
static volatile ThreadLocal