diff --git a/HMI_V5_10_10_WORKPLACE_JSONP_PROVIDER.md b/HMI_V5_10_10_WORKPLACE_JSONP_PROVIDER.md new file mode 100644 index 0000000..05c814e --- /dev/null +++ b/HMI_V5_10_10_WORKPLACE_JSONP_PROVIDER.md @@ -0,0 +1,76 @@ +# WidgetWorkbench V5.10.10 – JSON-P-Provider für CheerpJ Workplace + +## Nachgewiesener Fehler + +Der Workplace-Log vom 05.11.2026 zeigt beim Initialisieren von +`com.itac.config.domain.ParameterType`: + +``` +javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not found +Caused by: java.lang.ClassNotFoundException: org.glassfish.json.JsonProviderImpl +``` + +`Workplace.jnlp` enthält die Java-EE-8-API (`javax-javaee-api.jar`), aber +keinen GlassFish-JSON-P-Provider. Der Payara-Server besitzt zwar selbst +JSON-P-Bibliotheken, diese sind aber NICHT automatisch im Browser-JVM- +Klassenpfad von CheerpJ verfügbar. + +## Fix + +1. Maven `dependency:copy` lädt `org.glassfish:javax.json:1.1.4`, + den zu `javax.json` (JSR 374) passenden GlassFish-Provider. Dies ist + eine Build-Abhängigkeit und ändert keine iTAC-Original-JARs. +2. Der WAR-Plugin kopiert die Provider-Datei nach + `hmi/cheerpj-libs/javax.json-1.1.4.jar`. +3. Nur das iTAC-Workplace-Widget hängt diese JAR zusätzlich an den + `cheerpjRunMain`-Klassenpfad (`/app/backend/hmi/cheerpj-libs/...`). +4. Vor dem Java-Start prüft der Runner mit `Range: bytes=0-0`, dass + die WAR-Ressource mit HTTP **206** erreichbar ist. Fehler führen zu einer + hilfreichen Meldung, statt einem Folgefehler in `ParameterType`. + +## Linux-Build (Stand V5.10.9) + +```bash +cd ~/hmi/WidgetWorkbench +git apply --check /pfad/WidgetWorkbench_V5_10_10_JSONP_From_V5_10_9.patch +git apply /pfad/WidgetWorkbench_V5_10_10_JSONP_From_V5_10_9.patch +./build-hmi.sh +``` + +Danach die WAR neu deployen und die Seite mit Strg+F5 laden. Maven benötigt +beim erstmaligen Auflösen des JSON-P-Providers Zugriff auf Maven Central +oder auf ein internes Artefakt-Repository. + +### Nach Deployment prüfen + +```bash +# Nur als Anhaltspunkt: die exakte WAR-Datei kann bei euch anders heißen +jar tf backend/target/backend-1.war | grep 'hmi/cheerpj-libs/javax.json-1.1.4.jar' + +curl -sSI -H 'Range: bytes=0-0' \ + 'https://:8181/backend/hmi/cheerpj-libs/javax.json-1.1.4.jar' +``` + +Bei einem Range-GET sollte Status `206` und `Content-Range: bytes 0-0/...` +kommen. `curl -I` (HEAD) kann hinsichtlich Range abweichen; +für die genaue Prüfung verwenden: + +```bash +curl -skD - -o /dev/null -H 'Range: bytes=0-0' \ + 'https://:8181/backend/hmi/cheerpj-libs/javax.json-1.1.4.jar' +``` + +Die bisherigen Fehler `security/csrf 401` sind hiervon unabhängig: +Sie deuten auf eine fehlende oder abgelaufene IMSAPI-HMI-Sitzung hin. +Ebenso ist `ResizeBridge unavailable: Only one library thread supported` +ein eigenständiger optionaler ResizeBridge-Hinweis. + +### Sicherheit, Lizenz und Grenzen + +- Die Library kommt aus Maven Central, `org.glassfish:javax.json:1.1.4`. + Urheber-/Lizenzbedingungen (CDDL/GPLv2-Dual-License) beim Verteilen + der gebauten WAR beachten; der Quellcode-ZIP liegt kein Drittanbieter-JAR bei. +- Es wird keine unbeschränkte Server-Proxy-URL eingeführt. +- Es wurde **kein** vollständiger Maven-/CheerpJ-Live-Test ausgeführt. +- JSON-P ist das nachgewiesene *erste* Klassenpfadproblem; weitere + iTAC-spezifische Laufzeitabhängigkeiten können danach auftreten. diff --git a/HMI_V5_10_11_LOGIN_CONTRAST.md b/HMI_V5_10_11_LOGIN_CONTRAST.md new file mode 100644 index 0000000..56ce18e --- /dev/null +++ b/HMI_V5_10_11_LOGIN_CONTRAST.md @@ -0,0 +1,23 @@ +# WidgetWorkbench V5.10.11 – lesbare IMSAPI-Anmeldung + +Die drei Felder **IMSAPI-Benutzer**, **Passwort** und **Station** haben jetzt in allen +HMI-Farbschemata einen zur Schriftfarbe passenden Hintergrund. Das bisherige +`color: inherit` in Kombination mit `--hmi-surface` konnte insbesondere bei +hellen Designs oder vererbten CSS-Variablen zu unlesbaren Eingaben führen. + +* Hintergrund aus `--input`, Text und Cursor aus `--text`, Platzhalter aus `--muted`. +* Fokusrahmen aus `--hmi-accent` für Tastaturbedienung. +* Browser-Autofill-Felder behalten Text-/Hintergrundkontrast (Chrome, Edge, Safari). +* Farbschema-abhängige native Darstellung für hell/dunkel. +* Keine Änderung an IMSAPI, Rollen, Datenbank oder Backend-Schnittstellen. + +## Deployment + +```bash +cd /usr/src/WidgetWorkbench +git apply --check /pfad/WidgetWorkbench_V5_10_11_Login_Kontrast_From_V5_10_10.patch +git apply /pfad/WidgetWorkbench_V5_10_11_Login_Kontrast_From_V5_10_10.patch +./build-hmi.sh +``` + +Anschließend WAR erneut deployen. Browser-Cache bei Bedarf mit Strg+F5 erneuern. diff --git a/HMI_V5_10_12_SWING_WINDOWS_AND_JAAS.md b/HMI_V5_10_12_SWING_WINDOWS_AND_JAAS.md new file mode 100644 index 0000000..95c43a2 --- /dev/null +++ b/HMI_V5_10_12_SWING_WINDOWS_AND_JAAS.md @@ -0,0 +1,43 @@ +# WidgetWorkbench V5.10.12 – Swing-Fenster und CheerpJ-JAAS-Diagnose + +## Nachgewiesener Fehler aus dem Kundenlog vom 05.11.2026 + +`com.itac.util.system.SysParameter.getJavaUserNameSecure()` ruft +`com.sun.security.auth.module.UnixSystem` auf. Die CheerpJ-4.3-Java-11-Laufzeit +meldet `java.lang.UnsatisfiedLinkError: no jaas in java.library.path: [.]`. +Der AWT Event Dispatch Thread bricht damit beim Aufruf des iTAC-Logindialogs ab. +Zusätzlich erscheint `GET /backend/api/hmi/v1/security/csrf` mit HTTP 401; +dies betrifft die separate HMI-IMSAPI-Authentifizierung. + +## Änderung in V5.10.12 + +- CheerpJ 5.0 ist der Standard im Workplace-Widget. Die offizielle Version 5.0 + enthält Java-11-Verbesserungen, aber **eine Behebung von `jaas` ist noch nicht + durch einen echten Browserstart bestätigt**. +- Im Widget kann jederzeit vorübergehend auf 4.3 zurückgestellt werden. +- **„Eigenes Fenster“** öffnet ausschließlich die feste, authentifizierte + Workplace-JNLP-Bridge in einer eigenen Browserregisterkarte mit voller Größe. + Es gibt keinen durch Queryparameter steuerbaren JNLP-Proxy. +- „Vollbild“ innerhalb des Widgets bleibt erhalten. Java-Swing-Fenster werden + weiterhin von `cheerpjCreateDisplay` dargestellt; die eigene Registerkarte + vermeidet, dass Dialoge außerhalb eines kleinen Widget-Bereichs liegen. +- Die JVM- und Backend-Sitzung werden nicht miteinander verwechselt. +- iTAC-JARs und JNLP bleiben unverändert. Keine native `jaas`-Datei wird aus + GlassFish als echte Linux-Library bereitgestellt; eine `.so` lässt sich im + Browser nicht einfach nachladen. + +## Tests und Eingrenzung + +1. WAR bauen/deployen und Browsercache für die Runner-Datei neu laden. +2. Workplace starten; im Widget 5.0 auswählen. +3. **„Eigenes Fenster“** öffnen und iTAC-Anmeldung testen. +4. Falls `UnsatisfiedLinkError: no jaas` weiterhin erscheint: native + JAAS-Kompatibilität von CheerpJ 5.0 mit Leaning Technologies klären oder + herstellerseitig `SysParameter.getJavaUserNameSecure` ohne UnixSystem + implementieren lassen. Das ist kein Darstellungs- oder CSS-Problem. +5. Wenn nur 5.0 regressiert: im Widget 4.3 wählen. +6. Der HTTP-401-Fehler `/security/csrf` erfordert unabhängig eine gültige + IMSAPI-Anmeldung am HMI-Frontend. + +CheerpJ API: https://cheerpj.com/docs/reference/cheerpjCreateDisplay.html +Offizielle Version 5.0: https://labs.leaningtech.com/blog/cheerpj-5.0 diff --git a/HMI_V5_10_13_CHEERPJ_JAAS_BRIDGE.md b/HMI_V5_10_13_CHEERPJ_JAAS_BRIDGE.md new file mode 100644 index 0000000..3dccc99 --- /dev/null +++ b/HMI_V5_10_13_CHEERPJ_JAAS_BRIDGE.md @@ -0,0 +1,36 @@ +# WidgetWorkbench V5.10.13 — experimentelle CheerpJ-JAAS-Kompatibilitätsbridge + +## Warum der Login bislang nicht erscheint + +Die unveränderte iTAC-Anwendung ruft beim Login über `SysParameter.getJavaUserNameSecure()` die Klasse `com.sun.security.auth.module.UnixSystem` auf. Im OpenJDK 11-Konstruktor steht `System.loadLibrary("jaas")`, gefolgt von der nativen Methode `getUnixInfo()`. Unter CheerpJ 4.3 und 5.0 wurde im Log `UnsatisfiedLinkError: no jaas in java.library.path: [.]` beobachtet. Der AWT-Event-Thread bricht dann vor dem Logindialog ab. + +## Lösung ohne Modifikation der iTAC-JARs + +- `hmi-frontend/public/cheerpj/natives/jaas.js` bietet eine CheerpJ-native Implementierung von `Java_com_sun_security_auth_module_UnixSystem_getUnixInfo`. +- `hmi-frontend/public/cheerpj/jaas-identity-bridge.jar` enthält die eigene Klasse `com.widgetworkbench.cheerpj.JaasIdentityBridge`. Der zugehörige Java-11-Quellcode liegt unter `hmi-docs/cheerpj/JaasIdentityBridge.java`. +- Der Runner setzt vor `cheerpjInit()` `java.library.path=/app/backend/hmi/cheerpj/natives` und ergänzt die eigene Helper-JAR im Classpath. +- Die Hilfsklasse initialisiert ausschließlich die vier `UnixSystem`-Felder: `username=cheerpj-client`, `uid=65534`, `gid=65534`, `groups=[]`. Hierbei handelt es sich um eine **künstliche, nicht privilegierte Identität** in der Browser-JVM. +- `com.itac.*`-JAR-Dateien, JNLP, IMSAPI-Passwörter und Serverdatenbanken werden nicht verändert. Der Identitätswert ist **keine Authentifizierung, keine echte OS-Identität und kein Berechtigungsnachweis**. +- `UnixSystem` liegt in einem JDK-Modul; die Hilfsklasse versucht zuerst normale Feldreflexion und benutzt bei gesperrtem Modul das JDK-eigene `sun.misc.Unsafe`. Ob beides in CheerpJ 5.0 verfügbar ist, muss auf dem Zielsystem geprüft werden. + +## Build / Deployment + +```bash +cd /usr/src/WidgetWorkbench +./hmi-scripts/test-jaas-identity.sh +./build-hmi.sh +jar tf backend/target/backend-1.war | grep -E 'hmi/cheerpj/(natives/jaas.js|jaas-identity-bridge.jar)' +``` + +Anschließend die WAR neu deployen, den Browser hart neu laden und Workplace starten. Wenn beim nächsten Start `no jaas in java.library.path` weg ist, sollte als nächstes der normale MES-Logindialog kommen. Bei Problemen den **ersten** neuen Fehler mitsenden (z.B. `JAAS-Kompatibilitätsmodul`, `native`, `IllegalStateException`, `Unsafe` oder `SecurityException`). + +## Validierung / Grenzen + +Die Hilfsklasse ist für Java 11 kompiliert. Ein isolierter Test unter einer regulären OpenJDK-JVM validiert die vier Felder und eine JavaScript-Vertragstest-Simulation validiert die Weiterleitung von `jaas.js` auf die Hilfsklasse. **Ein echter Test des privaten nativen CheerpJ-5-Aufrufpfads und das Anzeigen des iTAC-Dialogs sind hier nicht möglich.** Die Änderung ist deshalb bewusst als **experimenteller Kompatibilitätsfix** gekennzeichnet, keine garantierte CheerpJ-Laufzeitreparatur. + +Die normale Anmeldung und Autorisierung durch den iTAC-MES-Server bleibt erforderlich. Niemals die künstliche Benutzerkennung als MES-Benutzer oder für Rollen-/Rechteentscheidungen übernehmen. + +## Nachschlagen + +- https://cheerpj.com/docs/guides/implementing-native-libraries +- https://cr.openjdk.org/~weijun/8228659/webrev.00/src/jdk.security.auth/share/classes/com/sun/security/auth/module/UnixSystem.java.html diff --git a/HMI_V5_10_13_WINDOWS_LINUX.md b/HMI_V5_10_13_WINDOWS_LINUX.md new file mode 100644 index 0000000..a2cafb4 --- /dev/null +++ b/HMI_V5_10_13_WINDOWS_LINUX.md @@ -0,0 +1,43 @@ +# WidgetWorkbench V5.10.13 – Windows- und Linux-Unterstützung + +## Zwei voneinander unabhängige Laufzeitumgebungen + +1. **Payara/GlassFish-Server**: `System.getProperty("os.name")` ermittelt in der laufenden **Server-JVM** automatisch das Hostsystem. Auf Windows wird `bin/asadmin.bat` verwendet, auf Linux `bin/asadmin`. Die existierende Administrationsschnittstelle zeigt (nur für `hmi-admin`) die Felder `serverPlatform` und `asadminExecutable` an. Das ist für die Online-Transport-Einstellungen relevant. +2. **CheerpJ im Browser**: Die virtuelle Java-11-Umgebung ist **nicht das Host-Betriebssystem** von Payara. Auch wenn Payara auf Windows Server läuft, hat der Browser keinen Zugriff auf dessen `jaas.dll`, `libjaas.so`, Laufwerke oder Betriebssystemkonto. Die JavaScript-`jaas.js`-Bridge wird auf Windows **und** Linux identisch ausgeliefert und greift nur die Browser-JVM ab. Die künstliche `cheerpj-client`-Identität ersetzt keine IMSAPI-Anmeldung. + +Die Bridge ist ein experimenteller Kompatibilitätsansatz für den im Log beobachteten `UnixSystem.getUnixInfo()`-Pfad. Die iTAC-JARs bleiben unverändert. Ein Browser-Livetest ist erforderlich; eine native Windows-`wjaas`-Emulation ist **nicht** Teil dieses Fixes, weil in den beobachteten Logs ausdrücklich `UnixSystem` aufgerufen wurde. + +## Build unter Linux + +```bash +cd /usr/src/WidgetWorkbench +./hmi-scripts/test-transport-policy.sh +./hmi-scripts/test-jaas-identity.sh +./build-hmi.sh +``` + +## Build unter Windows (PowerShell) + +PowerShell 5.1 oder höher mit `javac`/`jar` (JDK 11+), Node.js/npm und Maven in `PATH`: + +```powershell +cd C:\hmi\WidgetWorkbench +.\hmi-scripts\build-jaas-bridge.ps1 +.\build-hmi.ps1 +``` + +Das PowerShell-Buildskript nutzt automatisch `npm.cmd` und `mvn.cmd` beziehungsweise deren verfügbare Varianten und baut dieselbe WAR. Es ist **kein** Windows-spezifischer Neuaufbau der iTAC-JAR-Dateien notwendig. + +## Deployment und Windows-Dateinamen + +Immer die erzeugte `backend/target/*.war` deployen, **nicht** das vollständige Quellcode-ZIP. Falls das Archiv vom Linux-Host mit Windows-Zonendatei-Anhängseln kopiert wurde, vor dem Build kontrollieren: + +```bash +find /usr/src/WidgetWorkbench -name '*:Zone.Identifier' -print +``` + +Nur diese fremden Metadaten-Dateien bei Bedarf entfernen, nicht reguläre Anwendungsdateien. + +## Grenzen der Tests + +Die Platform-Auswahl (`Windows Server` -> `asadmin.bat`, `Linux` -> `asadmin`) wird in Java-11-Vertragstests getestet. Die Java-Hilfsklasse und der JavaScript-Native-Einstieg wurden isoliert getestet. Der Build über PowerShell sowie das Starten der Browser-JVM unter einem echten Windows-Payara konnten hier nicht ausgeführt werden. Auf Windows muss der Payara-Dienstbenutzer für administratives `asadmin.bat` über die passenden Rechte verfügen. diff --git a/HMI_V5_10_14_CHEERPJ_EXIT71_DIAGNOSTICS.md b/HMI_V5_10_14_CHEERPJ_EXIT71_DIAGNOSTICS.md new file mode 100644 index 0000000..1b026d3 --- /dev/null +++ b/HMI_V5_10_14_CHEERPJ_EXIT71_DIAGNOSTICS.md @@ -0,0 +1,19 @@ +# V5.10.14 – CheerpJ-Exit-Code-71: Startphasendiagnose + +## Befund +`CheerpException: Program exited with code 71` ist allein keine hinreichende Java-Fehlerdiagnose. Der JS/WASM-Stack nennt in der Regel nicht die Java-Ursache. In V5.10.13 wird lediglich die HTTP-Erreichbarkeit von `jaas.js` und der Helper-JAR geprüft; das beweist nicht, dass `UnixSystem.getUnixInfo` in der Browser-JVM funktioniert. + +## Änderung +Die Datei `hmi-frontend/public/cheerpj-runner.js` protokolliert die Phasen `JNLP-Abruf`, `CheerpJ-Initialisierung`, `Temp-Verzeichnis prüfen`, `Java-Anzeigefläche vorbereiten`, `JSON-P-JAR prüfen`, `JAAS-JavaScript prüfen`, `JAAS-Bridge-JAR prüfen`, `ResizeBridge starten`, `iTAC Workplace main()` und `Java main() beendet` in der Browser-Konsole mit dem Präfix `[WidgetWorkbench/CheerpJ]`. Bei einem JS-Fehler wird die zuletzt aktive Phase zusammen mit dem JS-Error-Objekt geloggt und kurz im Widget gemeldet. + +## Optionaler echter JAAS-Laufzeittest +Im **CheerpJ-Runner** kann der URL-Parameter `diagnose=jaas` gesetzt werden (z.B. `/backend/hmi/cheerpj-runner.html?standalone=workplace&diagnose=jaas`). **Hinweis:** Der tatsächliche Runner-Pfad muss zur Anwendung passen; er wird durch das Frontend-Build bereitgestellt. Der Test ruft vor dem iTAC-Main über CheerpJ Library Mode `new com.sun.security.auth.module.UnixSystem()` und dessen `getUsername()` auf und prüft auf `cheerpj-client`. Bei Fehler wird die Phase `JAAS-Laufzeittest (UnixSystem)` ausgegeben. Das kann die bisher unsichtbare native Ursache isolieren. Die Prüfung ist standardmäßig **deaktiviert**, weil sie selber einen Laufzeitabbruch verursachen könnte. Sie authentifiziert nicht am MES und ersetzt keine Login-Prüfung. + +## Fehler reproduzieren +1. WAR bauen und deployen, Browser-Cache leeren. +2. Browser-Entwicklerwerkzeuge -> Konsole: `Preserve log`/`Protokoll beibehalten` aktivieren. +3. iTAC-Workplace starten und den **ersten Java-Fehler vor dem Exit 71**, die letzte `[WidgetWorkbench/CheerpJ]`-Phase sowie die Netzwerkanfragen zu `/backend/hmi/cheerpj/natives/jaas.js` und `/backend/hmi/cheerpj/jaas-identity-bridge.jar` prüfen. +4. Bei Verdacht auf JAAS separat `?standalone=workplace&diagnose=jaas` testen; wenn dabei bereits `UnixSystem` abstürzt, liegt der Fehler vor dem iTAC-Main. + +## Grenzen +Der Fehler wurde aus dem gemeldeten Stack und dem Quellcode analysiert. Ein echter Browser-Lauf mit dem proprietären iTAC-Workplace und dem MES-Server ist in dieser Umgebung nicht möglich. Der Exit-Code 71 wird daher nicht als gesicherter JAAS-Fehler bezeichnet. diff --git a/HMI_V5_10_15_CHANGELOG.md b/HMI_V5_10_15_CHANGELOG.md new file mode 100644 index 0000000..294d320 --- /dev/null +++ b/HMI_V5_10_15_CHANGELOG.md @@ -0,0 +1,12 @@ +# V5.10.15 Änderungen + +Grundlage: WidgetWorkbench V5.10.14 (CheerpJ Exit-71-Diagnose). + +- Native JAAS-JavaScript-Callback über `cheerpjInit.natives` vorregistriert; bestehender `System.loadLibrary("jaas")`-JS-Modulpfad bleibt erhalten. +- Ein gemeinsamer CheerpJ-Library-Mode-Kontext statt mehrerer konkurrierender Aufrufe. +- `diagnose=jaas-only`: gezielter UnixSystem-Laufzeittest ohne iTAC Workplace. +- Zusätzliche automatisierte Regressionstests. +- Keine Änderungen an iTAC-Original-JARs, Rollen oder IMSAPI-Authentifizierung. +- Verbleibende Einschränkung: Wenn `JVM_LoadLibrary` im CheerpJ-Runtime-Kern fehlt, kann die JS-Integration alleine das nicht ersetzen. + +Details: `HMI_V5_10_15_CHEERPJ_JAAS_RUNTIME_FIX.md`. diff --git a/HMI_V5_10_15_CHEERPJ_JAAS_RUNTIME_FIX.md b/HMI_V5_10_15_CHEERPJ_JAAS_RUNTIME_FIX.md new file mode 100644 index 0000000..70bae47 --- /dev/null +++ b/HMI_V5_10_15_CHEERPJ_JAAS_RUNTIME_FIX.md @@ -0,0 +1,67 @@ +# WidgetWorkbench V5.10.15 — JAAS-/CheerpJ-Native-Integration + +## Beobachteter Fehler (05.11.2026) + +Im Kundenlog erscheint bei `MesContext.doLogin()`: + +``` +JVM_FindLibraryEntry: JNI_OnLoad_jaas +Missing import: JVM_LoadLibrary +java.lang.UnsatisfiedLinkError: no jaas in java.library.path: [/app/backend/hmi/cheerpj/natives] + at com.sun.security.auth.module.UnixSystem. + at com.itac.util.system.SysParameter.getJavaUserNameSecure + at com.itac.mes.gui.MesContext.doLogin +``` + +Der MES-Verbindungsaufbau, die Hauptklasse und der ConfigService starten vorher bereits. Der HTTP-Status 401 von `/security/csrf` betrifft die getrennte HMI-Sitzung und ist **nicht** durch die JNI-Änderung behoben. + +## Änderungen + +- `cheerpj-runner.js` importiert das lokale `cheerpj/natives/jaas.js` explizit als JavaScript-Modul und registriert den JNI-Callback `Java_com_sun_security_auth_module_UnixSystem_getUnixInfo` **vor dem Start der Java-VM**, über die von CheerpJ dokumentierte Option `cheerpjInit({ natives })`. +- Der alternative, ebenfalls dokumentierte `System.loadLibrary("jaas")`-Pfad bleibt über `java.library.path=/app/backend/hmi/cheerpj/natives` und `jaas.js` erhalten. +- Der Handler schreibt **keine** iTAC-Zugangsdaten und setzt nur eine synthetische, unprivilegierte Kennung (`cheerpj-client`, UID/GID 65534, keine Gruppen). Die Anmeldung beim MES-Server bleibt unverändert erforderlich. +- `cheerpjRunLibrary()` wird für **Temp-Ordner**, JAAS-Laufzeittest und **ResizeBridge** nur noch *einmal* aufgerufen. Die bisherige zweite Library-Thread-Initialisierung verursachte `Only one library thread supported`. +- Ein isolierter Testmodus stellt `new com.sun.security.auth.module.UnixSystem()` innerhalb der Browser-JVM tatsächlich her und überprüft `getUsername()`. Damit wird das bisher nur anhand von HTTP-200 validierte `jaas.js` vom echten JNI-Ladevorgang unterschieden. +- Die vorhandene Java-11-Bridge-JAR wird unverändert aus ihrem eigenen Quellcode kompiliert; alle proprietären iTAC-JARs bleiben unverändert. + +### Wichtige technische Grenze + +Die beiden CheerpJ-Mechanismen `natives` und `java.library.path` sind dokumentiert. Sie garantieren **nicht**, dass ein `System.loadLibrary()` in OpenJDK 11 erfolgreich ist, wenn die CheerpJ-Runtime intern den Import `JVM_LoadLibrary` nicht bereitstellt. Java ruft `System.loadLibrary("jaas")` **vor** `getUnixInfo()` auf. Falls die Runtime bereits dort scheitert, wird unser JS-Native-Handler nicht erreicht. Das lässt sich in externem Anwendungscode ohne Änderung der CheerpJ-JVM oder JDK-Laufzeit nicht seriös als behoben ausgeben. + +## Deployment + +```bash +# Linux im entpackten Projekt +./hmi-scripts/test-jaas-identity.sh +./build-hmi.sh +jar tf backend/target/backend-1.war | grep -E 'hmi/cheerpj/(natives/jaas.js|jaas-identity-bridge.jar)|hmi/cheerpj-runner.js' +``` + +WAR auf dem Payara-Server deployen, Browsercache deaktivieren bzw. hart neu laden. Wegen des neuen ES-Modulimports muss **beides** aus der gleichen Origin erreichbar sein: + +``` +https://:8181/backend/hmi/cheerpj-runner.js +https://:8181/backend/hmi/cheerpj/natives/jaas.js +``` + +### Getrennter JNI-Laufzeittest + +Direkt im Browser öffnen, mit eurem tatsächlichen Origin davor: + +``` +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&diagnose=jaas-only +``` + +- **Erfolg**: `JAAS UnixSystem erfolgreich initialisiert. Workplace nicht gestartet (Diagnosemodus).` +- **Fehler `JVM_LoadLibrary` / `no jaas in java.library.path`**: Die CheerpJ-JVM kann den nativen JDK-Ladepfad weiterhin nicht ausführen. Das ist unabhängig von einem erreichbaren `jaas.js`-HTTP-Endpunkt und erfordert weitere Arbeit am CheerpJ-Runtime-Lader bzw. eine bestätigte kompatible Runtime. +- **Fehler `Unsafe`, `module`, `access`**: Die Java-Bridge konnte ihre vier Felder nicht initialisieren. Dies wäre eine **nachgelagerte** Inkompatibilität, nachdem `System.loadLibrary()` grundsätzlich funktioniert. + +Danach regulär den Workplace starten und prüfen, ob die MES-Anmeldemaske erscheint. Die Browser-Konsole nach dem **ersten** Java-Fehler absuchen; ein späterer Exit-Code 71 allein ist nicht diagnostisch. + +## Teststatus beim Erstellen + +- `./hmi-scripts/test-jaas-identity.sh`: Java-11-Classfile-Kompilierung und Test der virtuellen Identität auf einer lokalen OpenJDK-VM **erfolgreich**. +- `npm run test:cheerpj`, `npm run test:bootstrap`, `npm run test:login`: **erfolgreich**, einschliesslich JAAS-Failure- und JAAS-Only-Mock. +- Vollständiger Frontend-/WAR-Build und Live-CheerpJ-Test: in der Erstellungsumgebung **nicht ausgeführt** (Maven und Frontend-Node-Abhängigkeiten nicht vorhanden). Diese Tests sind vor produktiver Verwendung erforderlich. + +Quellen: https://cheerpj.com/docs/guides/implementing-native-libraries , https://cheerpj.com/docs/guides/implementing-native-methods , https://cheerpj.com/docs/reference/cheerpjInit diff --git a/HMI_V5_10_16_CHANGELOG.md b/HMI_V5_10_16_CHANGELOG.md new file mode 100644 index 0000000..258945f --- /dev/null +++ b/HMI_V5_10_16_CHANGELOG.md @@ -0,0 +1,11 @@ +# V5.10.16 Änderungen + +Grundlage: WidgetWorkbench V5.10.15 (JAAS-Native-Integration). + +- CheerpJ-Java-Throwable-Proxies sicher protokollieren: kein `String(error)` auf nicht konvertierbaren Java-Objekten. +- Diagnosestufen für `UnixSystem` bis `getUsername()` einzeln protokollieren. +- Identitätsprüfung auch für Java-String-Proxies; bestehende Java-Bridge bleibt erhalten. +- Automatisierte Fehlerfalltests für Java-Exception-Proxies und opake Throwable-Objekte. +- Keine Änderungen an proprietären iTAC-JARs und an der IMSAPI-Authentifizierung. + +Details: `HMI_V5_10_16_JAAS_PROXY_EXCEPTION_FIX.md`. diff --git a/HMI_V5_10_16_JAAS_PROXY_EXCEPTION_FIX.md b/HMI_V5_10_16_JAAS_PROXY_EXCEPTION_FIX.md new file mode 100644 index 0000000..a658d23 --- /dev/null +++ b/HMI_V5_10_16_JAAS_PROXY_EXCEPTION_FIX.md @@ -0,0 +1,47 @@ +# WidgetWorkbench V5.10.16 — CheerpJ-JAAS-Fehlerdiagnose + +Ausgangsmeldung: + +``` +[WidgetWorkbench/CheerpJ] Failure in JAAS-Laufzeittest (UnixSystem) +TypeError: Cannot convert object to primitive value + at String () + at start (cheerpj-runner.js:285:16) +``` + +## Ursache + +Der bisherige Diagnosecode enthielt `String(error?.message || error)`. Im CheerpJ-Library-Mode können Java-Ausnahmen als Proxy-Objekte ohne gültige JavaScript-Primitive-Konvertierung auftreten. Diese Stelle erzeugte damit eine **zweite** Exception und verdeckte den ursprünglichen JAAS-Fehler. + +## Korrektur + +- `describeThrowable()` liest nach Möglichkeit Java-Exception-Methoden `getClass().getName()`, `getMessage()` und `getCause()` aus und behandelt sie asynchron. Bei JavaScript-Exceptions werden `name`, `message` und `stack` verwendet. +- Keine implizite `String(...)`-Konvertierung von Java/CheerpJ-Proxyobjekten mehr in den CheerpJ-Fehlerpfaden. +- Das Originalobjekt bleibt in der Browserkonsole sichtbar. +- Der isolierte JAAS-Test unterscheidet die Startphasen: Klassenauflösung, `UnixSystem`-Konstruktor mit `System.loadLibrary("jaas")`, `getUsername()` und Identitätsprüfung. +- Java-String-Proxyobjekte in `getUsername()` werden ohne `String(proxy)` via `equals()` validiert, sofern nötig. +- Der `diagnose=jaas-only`-Test startet weiterhin nicht den iTAC Workplace; proprietäre iTAC-JARs bleiben unverändert. + +## Browser-Test + +``` +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&diagnose=jaas-only +``` + +In den Developer Tools nach `[WidgetWorkbench/CheerpJ]` filtern. + +- Fehler in **JAAS: UnixSystem-Konstruktor (System.loadLibrary)** mit `JVM_LoadLibrary` bzw. `no jaas in java.library.path`: Das native Laden schlägt noch fehl; diese Version verbessert lediglich die Sichtbarkeit der Ursache. +- Fehler in **JAAS: UnixSystem.getUsername()**: Die JVM hat `UnixSystem` konstruiert; JNI-Callback/Feldinitialisierung weiter prüfen. +- **JAAS-Laufzeittest erfolgreich (UnixSystem)**: Java-Identitätsinitialisierung erfolgreich; danach normale Workplace-Initialisierung getrennt testen. + +## Lokale Tests + +``` +cd WidgetWorkbench_V5_10_16 +npm --prefix hmi-frontend run test:cheerpj +npm --prefix hmi-frontend run test:login +npm --prefix hmi-frontend run test:bootstrap +bash hmi-scripts/test-jaas-identity.sh +``` + +Auch ein simuliertes Java-Throwable-Objekt ohne `toString()` wird korrekt behandelt. Die Tests sind isolierte Vertragsprüfungen; ein Laufzeittest mit der echten CheerpJ-JVM oder dem MES-Server war in der Erstellungsumgebung nicht möglich. diff --git a/HMI_V5_10_17_CHEERPJ_NATIVE_LOADER_SMOKE.md b/HMI_V5_10_17_CHEERPJ_NATIVE_LOADER_SMOKE.md new file mode 100644 index 0000000..46cb01a --- /dev/null +++ b/HMI_V5_10_17_CHEERPJ_NATIVE_LOADER_SMOKE.md @@ -0,0 +1,47 @@ +# WidgetWorkbench 5.10.17 — unabhängiger CheerpJ Native-Loader-Test + +## Hintergrund + +CheerpJ 4.3 und 5.0 meldeten beim nativen JAAS-Aufruf des iTAC Workplace +`Missing import: JVM_LoadLibrary` und `UnsatisfiedLinkError: no jaas in java.library.path`. +Das ist **kein** Fehler des JNI-JavaScript-Callbacks selbst, denn die Java-11- +JDK-Klasse `UnixSystem` ruft im Konstruktor vorher `System.loadLibrary("jaas")`. +Die bisherige JS-Bridge kann einen fehlenden JVM-internen Import nicht ersetzen. + +## Ergänzt + +- `hmi-frontend/public/cheerpj-native-loader-test.html`: eigenständiger Test ohne iTAC, JNLP oder IMSAPI. +- `hmi-frontend/public/cheerpj-native-loader-test.js`: Laufzeitstart und Teststatus. +- `hmi-frontend/public/cheerpj/natives/wwprobe.js`: minimale JavaScript-JNI-Bibliothek. +- `hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar`: Java-11-Testprogramm. +- `hmi-docs/cheerpj/NativeLoaderSmoke.java`: Testquellcode. +- `hmi-frontend/tests/native-loader-smoke.mjs`: statischer Vertragstest. + +## Nach Deployment + +``` +https://:8181/backend/hmi/cheerpj-native-loader-test.html +``` + +Der Standardtest lädt `wwprobe.js` über die dokumentierte JavaScript-Bibliotheksmethode `System.loadLibrary("wwprobe")` +und ruft anschließend die native JS-Funktion `ping()` auf (Erwartungswert 42). +Der alternative Test lädt nur die JDK-Bibliothek `jaas`: + +``` +https://:8181/backend/hmi/cheerpj-native-loader-test.html?mode=jaas +``` + +- **wwprobe und jaas schlagen mit `JVM_LoadLibrary` fehl**: Allgemeiner JavaScript-Bibliothekslader-Fehler in der CheerpJ-11-Konfiguration oder beim Laden der .js-Ressourcen. +- **wwprobe funktioniert, jaas schlägt fehl**: JAAS-/JDK-Sonderfall; diesen Befund samt Browser-Console an Leaning Technologies melden. +- **beide System.loadLibrary-Aufrufe funktionieren**: Der nächste Fehler liegt im `UnixSystem.getUnixInfo()`-Callback oder der Java-Bridge und muss dann mit `diagnose=jaas-only` separat geprüft werden. + +In den DevTools die erste Meldung mit `[NATIVE-LOADER]` bzw. `Missing import` betrachten. + +## Grenzen + +Die Änderung repariert **nicht** `JVM_LoadLibrary` in CheerpJ. Sie liefert einen reproduzierbaren Test, der eindeutig zwischen dem allgemeinen `System.loadLibrary`-Problem und einem speziellen JDK-JAAS-Problem unterscheiden kann. +Die iTAC-JARs wurden nicht verändert und für den Test sind keine MES-Zugangsdaten nötig. +Für einen Einsatz im Unternehmen ist die CheerpJ-Lizenzierung zu berücksichtigen. + +Offizielle Dokumentation: +https://cheerpj.com/docs/guides/implementing-native-libraries.html diff --git a/HMI_V5_10_18_CHEERPJ_JAVA11_NATIVE_DIAGNOSTICS.md b/HMI_V5_10_18_CHEERPJ_JAVA11_NATIVE_DIAGNOSTICS.md new file mode 100644 index 0000000..2648604 --- /dev/null +++ b/HMI_V5_10_18_CHEERPJ_JAVA11_NATIVE_DIAGNOSTICS.md @@ -0,0 +1,84 @@ +# WidgetWorkbench 5.10.18 — Java-11-Native-Integration getrennt prüfen + +## Ausgangssituation (durch Browserlog nachgewiesen) + +Das eigenständige Testprogramm aus 5.10.17 meldet in CheerpJ 5.0 / Java 11: + +``` +[NATIVE-LOADER] about to System.loadLibrary("wwprobe") +JVM_FindLibraryEntry: JNI_OnLoad_wwprobe +Missing import: JVM_LoadLibrary +java.lang.UnsatisfiedLinkError: no wwprobe in java.library.path +``` + +Die Testressourcen sind per HTTP 200 erreichbar. Die gleiche Fehlersignatur tritt +bei `System.loadLibrary("jaas")` aus JDK `UnixSystem` auf. Damit ist der Fehler nicht +spezifisch für eine iTAC-JAR oder die JAAS-Bridge. **HTTP 200 allein beweist jedoch +nicht, dass der Server auch das richtige JavaScript-Modul zurückgibt.** + +## Änderung in 5.10.18 + +* Weiterhin **CheerpJ Java 11**, unabhängig von Payara/GlassFish Java 11. +* Drei isolierte Modi, ohne proprietäre iTAC-JARs: + - `?mode=direct`: `cheerpjInit({natives})`, Aufruf von `NativeLoaderSmoke.ping()` **ohne** `System.loadLibrary()`. + - `?mode=wwprobe` (Standard): `System.loadLibrary("wwprobe")`, danach JNI-Aufruf. + - `?mode=jaas`: Nur `System.loadLibrary("jaas")`. +* Kontrolliert JavaScript-Quelltext und Content-Type (z. B. HTML-Fallback oder Loginseite + statt `wwprobe.js`), JAR-Range-Anfrage und Java-11-Version. +* Test-JAR erneut mit `javac --release 11` gebaut (Classfile-Major-Version 55). +* Keine Änderung an MES-Anmeldung, iTAC-JARs, Payara-Backend oder Java-Runtime. + +Test-URLs nach Frontend-Build + Deployment: + +``` +/backend/hmi/cheerpj-native-loader-test.html?mode=direct +/backend/hmi/cheerpj-native-loader-test.html?mode=wwprobe +/backend/hmi/cheerpj-native-loader-test.html?mode=jaas +``` + +Erwartete Meldung bei erfolgreichem Direktmodus: + +``` +[NATIVE-LOADER] DIRECT_NATIVES: about to call ping() WITHOUT System.loadLibrary +[NATIVE-LOADER] NATIVE_CALL_RESULT=42 +[NATIVE-LOADER] PASS DIRECT_NATIVES +``` + +Erwartete Meldung bei erfolgreichem Modul-Lader: + +``` +[NATIVE-LOADER] LOAD_SUCCESS wwprobe +[NATIVE-LOADER] NATIVE_CALL_RESULT=42 +[NATIVE-LOADER] PASS MODULE_LOADER wwprobe +``` + +## Entscheidungsmatrix + +| direct | wwprobe | Interpretation | +| --- | --- | --- | +| PASS | FAIL `JVM_LoadLibrary` | Öffentliche `natives`-API funktioniert; der native Modul-Loader bleibt blockiert. JDK `UnixSystem` wird dadurch **nicht** repariert. | +| FAIL | FAIL | Auch direkte JavaScript-native Registrierung/Dateiauslieferung prüfen, bevor ein Runtime-Fehler angenommen wird. | +| PASS | PASS | JAAS-Sonderfall mit `?mode=jaas` und `?diagnose=jaas-only` weiter untersuchen. | + +**Wichtig:** `natives` kann ausschließlich native Java-Methoden registrieren. Es ersetzt +keine interne JVM-Funktion wie `JVM_LoadLibrary` und kann die feste JDK- +Initialisierung der `com.sun.security.auth.module.UnixSystem`-Klasse nicht umgehen. +Im Fall **direct PASS / wwprobe FAIL** ist als dauerhafte Abhilfe eine vom +CheerpJ-Hersteller unterstützte Runtime-Korrektur oder ein offiziell freigegebener +Workaround nötig. Der direkte Test ist nur ein Nachweis, **keine Lösung der MES-Anmeldung**. + +Offizielle Schnittstellen: +- https://cheerpj.com/docs/reference/cheerpjInit +- https://cheerpj.com/docs/guides/implementing-native-libraries.html + +## Lokale Tests + +``` +cd hmi-frontend +node tests/native-loader-smoke.mjs +npm run test:cheerpj +npm run typecheck +``` + +Für den vollständigen Payara-WAR-Build wird Maven und die vollständige Build-Umgebung +benötigt. Browser-Tests unter der realen Unternehmens-URL sind gesondert erforderlich. diff --git a/HMI_V5_10_19_CHEERPJ_JAVA11_DIAGNOSE.md b/HMI_V5_10_19_CHEERPJ_JAVA11_DIAGNOSE.md new file mode 100644 index 0000000..263eb0b --- /dev/null +++ b/HMI_V5_10_19_CHEERPJ_JAVA11_DIAGNOSE.md @@ -0,0 +1,108 @@ +# WidgetWorkbench 5.10.19 — CheerpJ Java-11-Native-Loader und JAAS diagnostizieren + +## Warum diese Version? + +Die folgenden **bereits im Browser bestätigten** Befunde stammen aus den +Workplace- und NativeLoaderSmoke-Protokollen vom 5.–6. November 2026: + +1. CheerpJ 5.0 initialisiert die Browser-JVM `11.0.33-internal`. +2. `cheerpjInit({ natives })` ruft den unabhängigen JS-Callback + `Java_com_widgetworkbench_cheerpj_NativeLoaderSmoke_ping()` erfolgreich auf; + Rückgabe 42, Java-Exit 0 (`PASS DIRECT_NATIVES`). +3. `System.loadLibrary("wwprobe")` reproduziert **ohne iTAC** + `Missing import: JVM_LoadLibrary` und `UnsatisfiedLinkError: no wwprobe in java.library.path`. +4. `System.loadLibrary("jaas")` reproduziert denselben fehlenden JVM-Import. +5. Der Workplace erreicht den iTAC-MES-Cluster sowie Person-/Config-Service, + aber `UnixSystem.` ruft vor seinem JNI-Callback `System.loadLibrary("jaas")` auf. + Dadurch kommt es in `SysParameter.getJavaUserNameSecure()`/`MesContext.doLogin()` + zu `UnsatisfiedLinkError`. Es ist **kein Fehler der Benutzer-/Kennwortprüfung** nachgewiesen. +6. Ein separater Abruf der CDN-Datei `/5.0/11/lib/modules` warf sporadisch + `ERR_CACHE_OPERATION_NOT_SUPPORTED`. Diese Warnung ist nicht als Ursache des + Native-Loader-Fehlers bewiesen. `/backend/api/hmi/v1/security/csrf` HTTP 401 + ist ein weiterer, unabhängig zu bewertender Authentifizierungsstatus. + +## Änderungen 5.10.19 + +- Vollständig getrennte Diagnose-JAR (Java-11-Bytecode, Major Version 55). +- Isolierter Java-11-Start ohne iTAC/JNLP/MES-Login. +- Tests für Java-Umgebung, Benutzereigenschaft ohne Ausgabe des echten + Usernamens, Direct-JNI, Bibliothekslader mit `wwprobe` und `jaas`, den echten + JDK-`UnixSystem`-Konstruktor sowie `JaasIdentityBridge.populate` **ohne** + Konstruktor durch `Unsafe.allocateInstance`. +- 5.0- und 4.3-Vergleich unter **derselben Java-Version 11**. Die GlassFish- + Installation ist nicht betroffen. +- HTTP-Range-/MIME-Prüfung für die beiden selbst entwickelten Diagnose-JARs + und die JS-Native-Bibliotheken. `path=missing` dient als Negativkontrolle. +- Bericht als kopierbarer Text, ohne MES-Token, Passwörter oder interne URLs. + Java-Systemausgaben bleiben zusätzlich in den Browser-DevTools sichtbar. +- Java-11-Build-Skripte für Windows und Linux; beide werden in `build-hmi` + eingebunden. Die originalen iTAC-JARs bleiben unverändert. + +## Im Browser ausführen + +Nach vollständigem Build/Deployment **und hartem Neuladen** öffnen: + +``` +https:///backend/hmi/cheerpj-native-loader-test.html +``` + +Die Seite hat direkte Links zu allen Testmodi. Pro Test eine frische Seite +verwenden, weil CheerpJ nur einmal je Page initialisiert werden kann. + +| URL-Parameter | Bedeutung | Erwartung aus bisherigen Logs | +| --- | --- | --- | +| `?mode=environment` | JDK 11, Modul `jdk.security.auth` und JVM-Umgebung | voraussichtlich PASS | +| `?mode=sysprop` | Nur Vorhandensein von `user.name` und `os.name` | voraussichtlich PASS | +| `?mode=direct` | Native-JS-Callback ohne `System.loadLibrary` | **bereits PASS** | +| `?mode=wwprobe` | Eigenständige JS-Library über `System.loadLibrary` | **bereits FAIL: JVM_LoadLibrary** | +| `?mode=jaas` | JDK-Library über `System.loadLibrary` | **bereits FAIL: JVM_LoadLibrary** | +| `?mode=unix` | Konstruktor des echten `UnixSystem` | Fehler wahrscheinlich, Details sichern | +| `?mode=bridge` | Java-Hilfsklasse ohne UnixSystem-Konstruktor | **noch nicht im Browser gemessen** | +| `?mode=wwprobe&path=missing` | bewusst falscher nativer Suchpfad, Kontrolltest | Fehlermeldung mit gültigem Pfad vergleichen | +| `?mode=wwprobe&runtime=4.3` | CheerpJ 4.3, weiterhin Java 11 | mit 5.0 vergleichen | + +**Wichtige Unterscheidung:** `bridge` erzeugt mittels `Unsafe.allocateInstance` +zu Diagnosezwecken ein JDK-Objekt ohne Konstruktor und schreibt nur dessen +synthetische OS-Identitätsfelder. Das ist **keine** Reparatur des Ladepfads und +wird **nicht** im echten MES-Login verwendet. MES-Authentifizierung und +Berechtigungsprüfung bleiben unberührt. + +## Auswertung + +- `direct PASS`, `wwprobe FAIL`, `jaas FAIL`: Der allgemeine + `System.loadLibrary`-Pfad ist betroffen. Neue Exportnamen im JS-Callback + allein beheben den fehlenden `JVM_LoadLibrary`-Import nicht. +- `bridge PASS`, `unix FAIL`: Die lokale JAAS-Java-Hilfsklasse ist isoliert + nutzbar; der Konstruktor bleibt blockiert. Herstellerkorrektur oder ein + **vom Hersteller unterstützter** Erweiterungspunkt wäre erforderlich. +- `bridge FAIL`: Zusätzliches, separat einzugrenzendes Reflektions-/Unsafe- + oder Modulzugriffsproblem unter CheerpJ Java 11. +- `wwprobe FAIL` sowohl 4.3 als auch 5.0: Kein auf 5.0 begrenzter Regressionseffekt + ersichtlich; noch kein Beweis für die Ursache innerhalb der Runtime. +- `wwprobe FAIL` nur 5.0: Verdacht auf Runtime-Regression zwischen 4.3/5.0. +- `wwprobe&path=missing` und gültiger Pfad unterscheiden sich: + Suchpfadauflösung ist möglicherweise beteiligt; **bei identischem Fehler** + eher Fehler vor der eigentlichen Modulauflösung. +- HTTP 206 auf JARs und HTTP 200 mit JS-MIME beweisen die Erreichbarkeit der + eigenen Dateien, **nicht** das korrekte Laden durch die CheerpJ-JVM. + +Eine erfolgreiche `environment`-/`bridge`-Prüfung darf nicht als vollständiger +funktionierender Workplace-Login gewertet werden. + +## Dokumentation und Support + +Reproduktionsbericht in englischer Sprache: `hmi-docs/cheerpj/CHEERPJ_JAVA11_NATIVE_LOADER_SUPPORT.md`. +Für eine vollständige Fehlermeldung die **Java-Ausgaben** (`[NATIVE-LOADER]`, +`Missing import`, Exception-Stack) aus der Browserkonsole ergänzen. Die +Schaltfläche „Diagnosebericht kopieren“ enthält nur die JS-Kontrollausgaben. + +Offizielle CheerpJ-Quellen: + +- https://cheerpj.com/docs/guides/implementing-native-libraries.html +- https://cheerpj.com/docs/reference/cheerpjInit +- https://cheerpj.com/compatibility/ + +CheerpJ-Nutzung im Unternehmen benötigt eine geeignete Lizenz; die im Log +angezeigte Community Edition ist nur für private/nichtgeschäftliche Nutzung. + +**Separates Minimalpaket:** `CheerpJ_Java11_MinimalRepro_V5_10_19.zip` kann unabhängig von WidgetWorkbench mit HTTP-Range-Unterstützung gehostet und an Leaning Technologies weitergegeben werden. diff --git a/HMI_V5_10_20_SWING_WINDOW_GEOMETRY.md b/HMI_V5_10_20_SWING_WINDOW_GEOMETRY.md new file mode 100644 index 0000000..fe09282 --- /dev/null +++ b/HMI_V5_10_20_SWING_WINDOW_GEOMETRY.md @@ -0,0 +1,125 @@ +# WidgetWorkbench V5.10.20 — CheerpJ Java 11: Monitor- und Swing-Fensterdiagnose + +## Ziel + +Unterscheiden, ob der iTAC-Anmeldedialog (a) außerhalb des virtuellen +CheerpJ-Anzeigebereichs liegt, (b) erzeugt, aber nicht sichtbar gemacht wurde, +oder (c) wegen einer Exception gar nicht erzeugt wird. Keine Änderung an +den signierten iTAC-JARs, der MES-Authentifizierung oder der JVM-Version. + +**Wichtig:** CheerpJ hat einen virtuellen AWT-Bildschirm innerhalb des Browsers. +`GraphicsDevice[]` sind virtuelle Geräte und keine zuverlässige Darstellung +der physischen Monitore des Bedieners. Java kann die tatsächliche Position des +Browserfensters auf dem ersten/zweiten physischen Monitor nicht ermitteln. + +## Neuer Java-Bridge-Code + +`hmi-docs/cheerpj/WorkplaceResizeBridge.java` ist die Quellcodebasis für +`hmi-frontend/public/cheerpj/workplace-resize-bridge-v2.jar` (Java-11-Bytecode). + +Neu: + +- `diagnoseWindows(int width, int height)` — nur lesend, auf dem Swing-EDT. + Protokolliert das virtuelle Viewport, `GraphicsEnvironment.isHeadless()`, + `Toolkit.getScreenSize()`, `GraphicsDevice`-Grenzen sowie `Window.getWindows()`. + Für jedes Fenster: Typ, Koordinaten, Größe, `visible`, `showing`, + `displayable`, `active`, `focused`, `owner`, `modal` und `outsideViewport`. + Auch noch unsichtbare Dialoge sind aufgelistet. +- `rescueOffscreenDialogs(int width, int height)` — nur im explizit gewählten + Korrekturmodus. Verschiebt ausschließlich **sichtbare**, bereits darstellbare + `JDialog`-Fenster, von denen nur ein sehr kleiner Teil im Viewport liegt. + Die Dialoggröße, Modalität und iTAC-Funktionen bleiben unverändert; + Hauptfenster und unsichtbare Dialoge bleiben unberührt. +- `resize(int width, int height)` und `diagnose()` sind rückwärtskompatibel. +- Fenstertitel und Texte werden bewusst **nicht** protokolliert, da sie + personenbezogene und MES-Produktionsinformationen enthalten könnten. + +## Verwendung im Workplace-Widget + +In der Toolbar erscheint eine Auswahlliste **Fenster**: + +- **Diagnose** (Standard): nur protokollieren, kein Fenster verschieben. +- **Dialoge zurückholen**: zusätzliche behutsame Korrektur der außerhalb + liegenden sichtbaren Swing-Dialoge. +- **Aus**: kein zusätzlicher Diagnose-Poll. + +Das Umschalten startet den Workplace-Frame neu. Im laufenden Frame gibt es +rechts unten die aufklappbare **Fensterdiagnose (Java 11)**. Änderungen an +Fensterzahl, Sichtbarkeit oder Position werden alle zwei Sekunden an die +Browser-Konsole mit Präfix `[WidgetWorkbench/WindowGeometry]` ausgegeben. +Der Java-Listener verwendet denselben CheerpJ-Library-Kontext wie die +ResizeBridge; es wird kein zweiter Library-Thread gestartet. + +Im separaten Browserfenster sind identische Modi über URLs erreichbar: + +```text +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&windows=diagnose +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&windows=rescue +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&windows=off +``` + +## Ergebnisinterpretation + +| Beobachtung | Bedeutung / nächster Schritt | +| --- | --- | +| `windows=... dialogs=0` beim fehlenden Login | Login-Dialog noch nicht konstruiert, nicht nur verschoben. Java-Exception prüfen. | +| `dialogs>0 visibleDialogs=0` | Dialog existiert, ist jedoch nicht sichtbar. AWT-Event-Thread und iTAC-Loginfluss prüfen. | +| `offscreenDialogs>0` | Dialog liegt außerhalb des CheerpJ-Viewports. Korrekturmodus verwenden. | +| `RESCUE moved=1` | Dialog wurde geometrisch verschoben; jetzt in der Anzeige prüfen. | +| `offscreenDialogs=0` und `visibleDialogs>0` | Geometrie als alleinige Ursache unwahrscheinlich; Z-Order/Fokus/Modalität untersuchen. | +| `Missing import: JVM_LoadLibrary` | Separater nativer Library-Loader-Fehler, durch Verschieben von Fenstern NICHT behoben. | + +Aus dem bereits bestätigten unabhängigen `wwprobe`-Test wissen wir, dass +`System.loadLibrary()` unter dieser CheerpJ-11-Runtime fehlschlägt, während +`cheerpjInit({natives})` funktioniert. Der bekannte Stacktrace von +`SysParameter.getJavaUserNameSecure -> UnixSystem.` spricht dafür, +dass das Anmeldefenster auch ohne Positionsfehler fehlen kann. + +## Deployment und Test + +1. Frontend und WAR mit `./build-hmi.sh` bauen; das ZIP enthält Quellcode, + **kein neu erstelltes WAR**. Keine Änderungen an iTAC-JARs. +2. Prüfen, dass `/backend/hmi/cheerpj/workplace-resize-bridge-v2.jar` + als JAR mit Range-Unterstützung (HTTP 206) erreichbar ist. +3. Browser-Cache für den Deploy-Test leeren, Arbeitsplatz starten, beim + Login-Versuch in der Konsole die `[WidgetWorkbench/WindowGeometry]`-Meldungen + bzw. die aufklappbare Fensterdiagnose aufrufen. +4. Einmal mit `windows=diagnose` prüfen. Nur wenn `offscreenDialogs>0` + erscheint, `windows=rescue` wählen und erneut starten. +5. Berichte idealerweise `viewport`, `toolkitScreen`, `virtualScreens`, + `dialogs`, `visibleDialogs`, `offscreenDialogs` und die Dialog-Zeilen. + Die ursprüngliche Java-Exception bleibt für die Analyse wichtig. + +## Lokale Prüfung / Grenzen + +```bash +mkdir -p /tmp/ww-window-test +javac --release 11 -d /tmp/ww-window-test \ + hmi-docs/cheerpj/WorkplaceResizeBridge.java \ + hmi-docs/cheerpj/WindowGeometrySmoke.java +java -Djava.awt.headless=true -cp /tmp/ww-window-test \ + com.widgetworkbench.cheerpj.WindowGeometrySmoke +# Optional für einen echten AWT-Dialog auf einem virtuellen X11-Display: +xvfb-run -a java -Djava.awt.headless=false -cp /tmp/ww-window-test \ + com.widgetworkbench.cheerpj.WindowGeometrySmoke +cd hmi-frontend && npm run test:cheerpj +``` + +Die JVM wird in dieser Entwicklungsumgebung mit `javac --release 11` +kompiliert; der Browserbetrieb in der echten CheerpJ-Java-11-Runtime ist +hier nicht verifiziert. Wenn eine Bridge-Methode in CheerpJ selbst nicht +unterstützt wird, zeigt der optionale Monitor einen Fehler an, ohne die +ursprüngliche iTAC-Anwendung gezielt zu stoppen. Ein Java-Laufzeitproblem +wie `JVM_LoadLibrary` erfordert eine getrennte Korrektur. + +### Prüfstand dieser Lieferung + +- Java-Quellcode mit `javac --release 11` gebaut; JAR-Classfile-Version 55. +- `WindowGeometrySmoke` im Headless-Modus und unter Xvfb bestanden; + unter Xvfb wird ein echter sichtbarer JDialog außerhalb eines 960×640- + Viewports platziert und erfolgreich zurückgeholt. +- `npm run test:cheerpj`, `test:login`, `test:navigation`, `test:bootstrap`, + `test:theme` bestanden. +- `test:mes`, `test:widget` und Frontend-Typecheck/Build sind ohne die nicht + installierte `typescript`-Abhängigkeit nicht durchführbar. Auch `mvn` + steht hier nicht bereit; ein vollständiger WAR-Build wurde nicht behauptet. diff --git a/HMI_V5_10_21_LIBRARY_CONCURRENCY_FIX.md b/HMI_V5_10_21_LIBRARY_CONCURRENCY_FIX.md new file mode 100644 index 0000000..0de3dbd --- /dev/null +++ b/HMI_V5_10_21_LIBRARY_CONCURRENCY_FIX.md @@ -0,0 +1,47 @@ +# WidgetWorkbench V5.10.21 – CheerpJ Java 11 / Swing-Fenstermonitor + +## Fehler + +V5.10.20 führte mehrere asynchrone Java-Methoden fast gleichzeitig über einen +CheerpJ-Library-Mode-Kontext aus: `attachWorkplaceResize()` startete sofort +`void update()`, danach rief `attachWorkplaceWindowMonitor()` `diagnoseWindows()` +auf. CheerpJ meldete: `Java code still running, check for a missing 'await'`. +Das `await` innerhalb jeder einzelnen Funktion verhinderte **nicht** die +Überschneidung beider asynchroner Abläufe. + +## Korrektur + +- Eine einzige Java-11-Bridge-JAR `workplace-window-monitor-v3.jar` enthält + `startRuntimeMonitor(width,height,mode)`, `diagnoseWindows()` und `rescueOffscreenDialogs()`. +- Der JavaScript-Runner startet die Java-interne Überwachung **einmal vor** + `cheerpjRunMain()` und führt danach keine periodischen Library-Mode-Methoden mehr aus. +- Ein Java-Daemon-Thread ermittelt alle zwei Sekunden die virtuelle + Bildschirmgeometrie und alle AWT-Fenster. Ergebnisse erscheinen in der + Browserkonsole im `cheerpOS.js`-Log mit Präfix `[WidgetWorkbench/WindowGeometry]`. + Die aufklappbare Diagnoseseite erklärt bewusst, dass die Details aus der + Java-Konsole kommen (nicht mehr als Live-Text im HTML-Panel). +- Der Java-Thread führt ebenso den einmaligen Resize des Workplace-Hauptfensters + durch, sobald dieses existiert. Bei `windows=off` läuft nur Resize, + keine Fensterdiagnose. +- `windows=diagnose` protokolliert, `windows=rescue` verschiebt ausschließlich + bereits sichtbare, fast vollständig außerhalb liegende `JDialog`-Fenster; + `windows=off` deaktiviert Diagnose und Rettung. +- Der Java-Thread ist Daemon und endet beim Ende der Browser-JVM. +- Originale iTAC-JARs, JAAS und MES-Authentifizierung wurden nicht geändert. + `Missing import: JVM_LoadLibrary` bleibt ein **separates** Laufzeitproblem. + +## Test + +``` +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&windows=diagnose +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&windows=rescue +``` + +Suche im Browserlog nach `[WidgetWorkbench/WindowGeometry]` sowie +`windows=`, `dialogs=`, `visibleDialogs=`, `offscreenDialogs=` und nach +`Missing import: JVM_LoadLibrary`. + +Das ZIP enthält Java-11-Quellcode und eine mit `javac --release 11` erstellte +Bridge-JAR. Ein echter CheerpJ-Browserlauf auf dem Zielsystem ist erforderlich; +lokale Java/Xvfb-Tests ersetzen diesen nicht. Neue JAR-URL verhindert, dass +noch die v2-Bridge aus dem Browsercache geladen wird. diff --git a/HMI_V5_10_22_MES_LOGIN_HOTFIX.md b/HMI_V5_10_22_MES_LOGIN_HOTFIX.md new file mode 100644 index 0000000..196156d --- /dev/null +++ b/HMI_V5_10_22_MES_LOGIN_HOTFIX.md @@ -0,0 +1,106 @@ +# WidgetWorkbench V5.10.22 – iTAC-MES-Login-Fenster-Hotfix (Java 11) + +## Ausgangslage und verifizierte Klassen + +Bytecode-Analyse der beiden vom Benutzer bereitgestellten Originaldateien: + +- `com.itac.product-mes.suite-gui.jar`: `com.itac.mes.gui.MesContext.doLogin(boolean)` + ruft bei `true` **zuerst** `SysParameter.getJavaUserName()` auf und erzeugt erst bei + erfolglosem/nicht aktiviertem Autologin `new MesLoginDialog(getFrame())`. +- `com.itac.product-mes.suite-gui.jar`: `MesLoginDialog` erbt von `GuiDialog`. +- `com.itac.product-gui-client.jar`: `GuiDialog` erbt von `JDialog`. Vor dem + Anzeigen positioniert `adjustLocationAndSize()` das Fenster relativ zum + Besitzer (`setLocationRelativeTo(owner)`), sonst relativ zur Bildschirmgröße. +- `MesContext.getFrame()` kann ein neues, nicht sichtbares `JFrame` zurückgeben. + Ein offscreen oder unsichtbarer Besitzer kann zur falschen Fensterposition führen. + +Die genannten iTAC-JARs wurden **nicht verändert**. Die Originalsignaturen +bleiben gültig. Keine Identität, Credentials oder Login-Prüfungen werden umgangen. + +## Hotfix-Änderungen + +1. `workplace-window-monitor-v4.jar` ersetzt v3 im CheerpJ-Klassenpfad. + Mit `javac --release 11` kompiliert; nur `com.widgetworkbench.cheerpj.*`. +2. Diagnose erfasst `MES_LOGIN state=NOT_SEEN | CREATED_HIDDEN | + VISIBLE_ONSCREEN | VISIBLE_OFFSCREEN`, Anzahl und Sichtbarkeit. +3. Für jeden erkannten MES-Login wird `MES_LOGIN_OWNER` ausgegeben: Klasse, + Koordinaten, `visible`, `showing`, `displayable`, `offscreen`. +4. Erweiterte, begrenzte `COMPONENT_TREE`-Inspektion für `JInternalFrame`, + `JDesktopPane`, `JLayeredPane`, `JOptionPane`, `MyDoggy` und Glass-Panes. + Die Klassennamen werden ohne direkte Abhängigkeit von MyDoggy erkannt. +5. `windows=rescue` verschiebt weiterhin **nur sichtbare** und außerhalb des + virtuellen Viewports liegende `JDialog`-Fenster. `RESCUE loginMoved=1` + kennzeichnet einen zurückgeholten MES-Login. Dialoggröße und Inhalte bleiben + unverändert. Versteckte Dialoge werden niemals erzwungen angezeigt. +6. Der Java-11-Überwachungsthread bleibt vollständig in Java. Es gibt keine + parallelen CheerpJ-Library-Mode-Aufrufe während des laufenden Workplace. +7. Keine Fensterüberschriften, Komponenten-Texte oder Kennwörter im Log. + Zähler, Klassen und Geometriedaten allein können trotzdem interne + Informationen offenlegen; Debug-Logs nur kontrolliert weitergeben. + +## Browser-Tests + +Zuerst nach Redeployment Cache mit hartem Neuladen umgehen und prüfen, dass +`/backend/hmi/cheerpj/workplace-window-monitor-v4.jar` als JAR mit HTTP +200/206 erreichbar ist. **Auch `cheerpj-runner.js` muss die neue JAR referenzieren.** + +``` +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&windows=diagnose +/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime=5.0&windows=rescue +``` + +In der Browserkonsole (`cheerpOS.js`) nach `[WidgetWorkbench/WindowGeometry]` +und folgenden Feldern suchen: + +- `MES_LOGIN state=NOT_SEEN`: der Login-Dialog wurde **bisher nicht beobachtet**. + Das beweist nicht, dass er nie konstruiert wurde. Besonders gleichzeitig + auftretende `Missing import: JVM_LoadLibrary` beachten. +- `MES_LOGIN state=CREATED_HIDDEN`: der Dialog existiert, aber `setVisible(true)` + wurde noch nicht erfolgreich abgeschlossen. +- `MES_LOGIN state=VISIBLE_OFFSCREEN`: `windows=rescue` testen. +- `MES_LOGIN state=VISIBLE_ONSCREEN`: Problem ist vermutlich kein reiner + Koordinatenfehler; ggf. Überdeckung oder CheerpJ-Zeichnung untersuchen. +- `MES_LOGIN_OWNER ... visible=false`: iTAC verwendet möglicherweise ein + unsichtbares `JFrame` als Besitzer. +- `COMPONENT_TREE ... internalFrames / myDoggy`: zeigt, ob interne Docking- + Panels statt eigener Top-Level-Dialoge vorliegen. + +## Weiterhin separat: JAAS-/JVM_LoadLibrary-Fehler + +Der unabhängig getestete Loader `System.loadLibrary("wwprobe")` scheitert +unter CheerpJ Java 11 bereits mit `Missing import: JVM_LoadLibrary`, +obwohl `cheerpjInit({natives})` den nativen Callback direkt erfolgreich +aufrufen kann (`NATIVE_CALL_RESULT=42`). + +Der iTAC-Login benutzt bei erzwungenem Autologin `SysParameter.getJavaUserName()`, +und dieser Weg kann `UnixSystem` / `System.loadLibrary("jaas")` erreichen, +**bevor** `MesLoginDialog` erzeugt wird. Der Hotfix repariert **nicht** +`JVM_LoadLibrary` und garantiert daher keinen funktionierenden Login. +Ein Login-Dialog, der nie erzeugt wird, kann nicht durch Verschieben +wiederhergestellt werden. Keine unsichere Umgehung des Logins wird vorgenommen. + +## Testen ohne Produktiv-MES + +Linux: +``` +bash hmi-scripts/test-workplace-login-hotfix.sh +cd hmi-frontend && npm run test:cheerpj +``` + +Windows (PowerShell, Java 11): +``` +.\\hmi-scripts\\test-workplace-login-hotfix.ps1 +``` + +Für den grafischen Linux-Test wird `xvfb-run` benötigt. Die zusätzliche +`hmi-scripts/tests/fixtures/MesLoginDialog.java` ist **ausschließlich eine +künstliche Testklasse** für die Namenserkennung und wird niemals in die +Bridge-JAR gepackt. Sie enthält keinen iTAC-Bytecode. + +## Deployment und Grenzen + +- Vollständiger Frontend-Build: `cd hmi-frontend && npm ci && npm run build`. +- Payara-5/Java-11-Backend bleibt unverändert; `cd backend && mvn clean package`. +- Tests unter einer dedizierten Teststation, keine produktiven Buchungen. +- Lokale Java-11-/Xvfb-Tests und Node-Vertragstests sind keine vollständigen + CheerpJ- oder MES-Laufzeitprüfungen. diff --git a/HMI_V5_10_23_BROWSER_TO_WORKPLACE_LOGIN.md b/HMI_V5_10_23_BROWSER_TO_WORKPLACE_LOGIN.md new file mode 100644 index 0000000..319ca7e --- /dev/null +++ b/HMI_V5_10_23_BROWSER_TO_WORKPLACE_LOGIN.md @@ -0,0 +1,90 @@ +# WidgetWorkbench V5.10.23 – Browser-Login an iTAC Workplace (Java 11) + +## Ziel und technische Grundlage + +Ein erfolgreiches WidgetWorkbench-IMSAPI-Login soll die **gerade eingegebenen** Anmeldedaten einmalig an den eingebetteten CheerpJ-Workplace übergeben. Eine IMSAPI-Session-ID ist **keine** Workplace-/PersonService-Sitzung und wird deshalb nicht übernommen. + +Die beiden vom Nutzer bereitgestellten signierten iTAC-GUI-JARs wurden via `javap` untersucht: +- `com.itac.mes.gui.MesContext.doLogin(String, com.itac.util.text.Password, String): boolean` +- `MesContext.loginUser(String, Password, String)` verwendet `PersonService.login(...)` und anschließend `getSessionContext(...)`. +- `com.itac.gui.GuiPasswordField.getValue()` erstellt `new Password(Password.Encryption.NONE, plaintext)`. +- iTAC-Autologin ruft `loginUser(..., "any")` auf. Deshalb lautet der vorbelegte Mandant `any` (im Widget editierbar). + +Die Original-JARs einschließlich der Signaturen bleiben unverändert. + +## Ablauf + +1. Bei einer **erfolgreichen** IMSAPI-Anmeldung bietet `App.vue` die bereits eingegebenen Zugangsdaten optional für maximal 120 Sekunden an (`workplaceHandoff.ts`). Die Eingabebox für das Passwort wird anschließend geleert. +2. Der eingebettete Workplace-Runner lädt Java 11, die originalen iTAC-JARs und die neue `workplace-credential-bridge.jar`. +3. Kurz vor `cheerpjRunMain()` fordert der Runner mit `postMessage` die Einmalübergabe an. `CheerpJWidget.vue` akzeptiert ausschließlich Nachrichten **seines konkreten iframes**, auf **derselben Origin** und mit passender `requestId`. +4. Die Zugangsdaten werden in genau einer `cheerpjRunLibrary`-Methode `WorkplaceCredentialBridge.offer(username,password,client)` abgesetzt, bevor der Workplace läuft. Danach erfolgen **keine parallelen JavaScript-zu-Java-Library-Aufrufe** während `cheerpjRunMain()`. +5. Ein Java-interner Daemon wartet begrenzt auf `PersonService` und ruft `MesContext.doLogin(username, Password(Encryption.NONE, password), client)` einmal auf. Der eigentliche Berechtigungs-/Authentifizierungsentscheid bleibt ausschließlich bei iTAC. +6. Eine direkte JNI-Rückmeldung via `cheerpjInit({natives})` meldet nur numerische Ergebnis-Codes; `System.loadLibrary()` wird für diese Bridge nicht verwendet. + +### Statuscodes + +- `RESULT_CODE=1`: Der reguläre MES-Login wurde erfolgreich bestätigt. +- `RESULT_CODE=2`: MES-Login abgelehnt. +- `RESULT_CODE=3`: Der Workplace besitzt bereits einen angemeldeten Benutzer; vorhandene Sitzung wird nicht ersetzt. +- `RESULT_CODE=4`: Angebot abgelaufen bzw. PersonService im Zeitfenster nicht bereit. +- `RESULT_CODE=5`: Bridge-/Laufzeitfehler ohne Klartextdetails. + +Wichtig: `offer() == 1` heißt nur **Daten übernommen**, nicht „MES angemeldet“. Erst `RESULT_CODE=1` bestätigt die Anmeldung. + +## Sicherheit und Einschränkungen + +- Automatische Übergabe nur über **HTTPS** (localhost für Entwicklungsumgebungen). Keine Passwörter in URLs, JNLP, Props, Cookies, Browser-Storage, Server-DB oder Konsolenlogs. +- Einmaliges Angebot, maximal 120 Sekunden, kein Wiederholen. Browser-Neuladen verliert das Passwort. Logout verwirft ein noch ausstehendes Angebot. +- Die Passwörter werden kurzzeitig als JavaScript-Strings und in der CheerpJ-JVM verwendet; die Java-Bridge hält ein `char[]` und überschreibt dieses nach dem Versuch. **Eine Garantie der vollständigen Speicherbereinigung ist wegen unveränderlicher Java-/JavaScript-Strings nicht möglich.** +- Separate `standalone`-Tabs haben absichtlich **keinen Zugriff** auf das Passwort der anderen Seite (`noopener`). Die manuelle Eingabe ist im eingebetteten Workplace-Widget verfügbar. +- Nach Seitenreload/erneuter Browser-Sitzung kann der Nutzer im Workplace-Widget „Workplace-Anmeldung“ aufklappen und die Angaben **bewusst erneut** für genau einen Start eingeben. Das ist keine erneute IMSAPI-Anmeldung. +- Der neue Java-Login läuft in einem eigenen Java-Thread. Der iTAC-Initialisierungsablauf ist nicht vollständig bekannt; das Timing ist im echten Browser zu validieren. Es kann vorkommen, dass iTAC vorher `getSessionContext()` ausführt und an `UnixSystem` scheitert. **V5.10.23 repariert nicht `Missing import: JVM_LoadLibrary`.** +- Der `PersonService` kann eine andere/zusätzliche iTAC-Authentifizierung konfigurieren; erfolgreicher IMSAPI-Login garantiert keine erfolgreiche Workplace-Anmeldung. +- Nur in einem MES-Testsystem produktionsähnlich prüfen; bitte keine realen Zugangsdaten in Tickets oder Konsolenlogs kopieren. + +## Dateien + +- `hmi-frontend/src/workplaceHandoff.ts`: Einmaliges Angebot mit Ablauf/Logout und HTTPS-Prüfung. +- `hmi-frontend/src/App.vue`: Zustimmung im bestehenden IMSAPI-Login, Angebot nach Erfolg. +- `hmi-frontend/src/widgets/CheerpJWidget.vue`: Same-Origin-/Frame-/Request-Prüfung, manuelle Eingabe, Rückmeldung. +- `hmi-frontend/public/cheerpj-runner.js`: einmalige Anfrage vor `runMain`, Bridge-Laden, Direct-JNI-Ergebnis. +- `hmi-docs/cheerpj/WorkplaceCredentialBridge.java`: Java-11-Implementierung ohne iTAC-Kompilierungsabhängigkeiten. +- `hmi-frontend/public/cheerpj/workplace-credential-bridge.jar`: fertige **Java-11-JAR**, Classfile 55. +- Tests `hmi-frontend/tests/workplace-handoff.mjs` und `hmi-frontend/tests/cheerpj-runner.mjs`, `hmi-docs/cheerpj/tests/test-workplace-credential-bridge.sh`. + +## Deployment + +### Vollständiges Quellcode-Paket + +Aus dem ZIP `WidgetWorkbench_V5_10_23_Browser_Workplace_Login_FullSource.zip` deployen: + +```bash +cd hmi-frontend +npm ci # sofern ein Lockfile vorliegt; andernfalls npm install nach Projektvorgabe +npm run build +cd ../backend +mvn clean package +``` + +Das Frontend-Build in die regulären `/backend/hmi/*`-Ressourcen einbinden, das bestehende Backend neu deployen und den Browsercache erneuern. + +### Overlay + +`WidgetWorkbench_V5_10_23_Browser_Workplace_Login_Overlay.zip` in eine **V5.10.22-Quellcodebasis** entpacken (Pfade überschreiben), anschließend **Frontend und Backend neu bauen**. Die Overlay-JAR ist eine CheerpJ-Browserressource, keine Payara-JVM-Library. + +### Browserprüfung + +1. Browserseite ausschließlich über HTTPS laden und IMSAPI-Anmeldung ausführen. Option „Anmeldedaten einmalig an den iTAC Workplace übergeben“ aktiv lassen. +2. Workplace-Widget automatisch starten lassen. Erwartet: „Zugangsdaten an Workplace übergeben; MES-Anmeldung wird geprüft.“ +3. In der Browserkonsole `[WidgetWorkbench/WorkplaceAuth] MES_LOGIN_SUCCESS` und im Java-Log `RESULT_CODE=1` prüfen. Nur dies bestätigt den Erfolg. +4. Falls abgelehnt, Eingaben und den in iTAC erwarteten Mandanten prüfen. Keine Passwortwerte in den Debugger kopieren. +5. Nach Reload und ohne neue IMSAPI-Passworteingabe die Formularsektion „Workplace-Anmeldung“ im Widget öffnen und dort einmalig neu eingeben; erneut starten. +6. Test 401/403 im HMI, manuelle Anmeldung, Zeitablauf, Logout, mehrere Frames, und explizit JAAS-/Fensterdiagnose (`windows=diagnose`). + +## Lokal überprüft + +- Java-11-Bridge mit `javac --release 11` kompiliert, Classfile-Version 55. +- Unabhängiger Stub-Integrationstest für `PersonService`-Lookup und `MesContext.doLogin(...)` bestanden (kein iTAC-Live-Test). +- CheerpJ-Runner-/DirectJNI-Verdrahtung inklusive fehlender Credentials, fehlender Bridge und fehlgeschlagenem Offer getestet. +- Tests für Einmalübergabe, Verfall, Logout, HTTP-Verbot erfolgreich. +- Vollständiger Vue-/Payara-Build und MES-Browser-Livetest **nicht** ausgeführt; in dieser Umgebung fehlen lokale npm-Abhängigkeiten und Maven. diff --git a/HMI_V5_10_9_CHEERPJ_TEMP_FALLBACK.md b/HMI_V5_10_9_CHEERPJ_TEMP_FALLBACK.md new file mode 100644 index 0000000..1c933bc --- /dev/null +++ b/HMI_V5_10_9_CHEERPJ_TEMP_FALLBACK.md @@ -0,0 +1,66 @@ +# WidgetWorkbench V5.10.9 – CheerpJ-Temp-Fix + +## Gemeldeter Fehler (V5.10.8) + +``` +CheerpJ-Temp-Verzeichnis /files/itac-workplace/tmp nicht verfügbar: Pfad ist kein Verzeichnis. +``` + +Die Implementierung V5.10.8 hat `Files.isDirectory(...) !== true` als +Fehler behandelt. Der strenge Vergleich des über CheerpJ Library Mode +zurückgelieferten Werts ist kein zuverlässiger Nachweis für die tatsächliche +Schreibbarkeit. Außerdem konnte ein bereits existierender Dateikonflikt +unter `/files/itac-workplace/tmp` den gesamten Workplace-Start blockieren. + +## Neues Verhalten + +1. Die Java-VM startet mit dem garantiert bereits gemounteten + `java.io.tmpdir=/files`. +2. Nach `cheerpjInit()` wird versucht, `/files/itac-workplace/tmp` + über Java NIO `Files.createDirectories(...)` bereitzustellen. +3. Statt einer nur typbasierten Prüfung erzeugt und löscht der Runner + eine echte Java-Testdatei im jeweiligen Verzeichnis. +4. Wenn der bevorzugte Pfad nicht nutzbar ist, versucht der Runner + `/files/itac-workplace-tmp` und anschließend `/files` als Ausweichpfad. +5. **Vor dem Aufruf** der iTAC-`main()`-Methode setzt der Runner + `System.setProperty("java.io.tmpdir", testedPath)`. +6. Wenn auch `/files` nicht beschreibbar ist, wird der Start verhindert und + eine Fehlermeldung mit den Gründen aller drei Versuche angezeigt. + +Vorhandene Dateien werden **nicht** gelöscht; außer den ausschließlich +selbst angelegten Testdateien wird kein Browser-Speicher verändert. + +### Einschränkungen + +- `/files` ist ein persistentes, browserseitiges CheerpJ-Dateisystem, + kein lokales Windows-/Linux-Temp-Verzeichnis und kein GlassFish-Ordner. +- Der tatsächliche iTAC-Workplace-Lauf in CheerpJ kann hier nicht + geprüft werden. Die automatisierten Tests verwenden Simulationen + der CheerpJ-Library-API. Ein kompletter Maven-/Vite-Build war in dieser + Umgebung nicht möglich. +- Der Browser-Cache kann nach einem WAR-Deployment noch die alte Runner-JS + enthalten. Nach dem Deployment die Seite mit `Strg+F5` neu laden. +- Wenn auch der Fallback `/files` nicht beschreibbar ist, bitte + Browser-Konsole und IndexedDB-/Website-Speichereinstellungen prüfen. + Keine Browserdaten pauschal löschen: `/files` kann echte gespeicherte + Anwendungsdateien enthalten. + +## Installation auf V5.10.8 + +```bash +cd ~/hmi/WidgetWorkbench +git apply --check /pfad/WidgetWorkbench_V5_10_9_CheerpJ_TempFix_From_V5_10_8.patch +git apply /pfad/WidgetWorkbench_V5_10_9_CheerpJ_TempFix_From_V5_10_8.patch +node hmi-frontend/tests/cheerpj-runner.mjs +./build-hmi.sh +``` + +Danach WAR deployen und Browser-Cache aktualisieren. +Keine neuen Datenbanktabellen oder Java-Abhängigkeiten notwendig. + +## Testumfang + +`hmi-frontend/tests/cheerpj-runner.mjs`: Standardpfad, nicht zuverlässig +lesbare `isDirectory`-Antwort, Fehler bei der Verzeichnisanlage, blockierte +Unterverzeichnisse, Fallback auf `/files`, Schreibfehler, Fehlerweitergabe +und Reihenfolge `cheerpjInit` → Schreibprobe → Property → Workplace-Start. diff --git a/HMI_V5_README.md b/HMI_V5_README.md index 8c2b129..d13f14b 100644 --- a/HMI_V5_README.md +++ b/HMI_V5_README.md @@ -1,3 +1,5 @@ +> **Neu 5.10.19:** Unabhängige CheerpJ-Java-11-Diagnose und Hersteller-Reproduktion: [HMI_V5_10_19_CHEERPJ_JAVA11_DIAGNOSE.md](HMI_V5_10_19_CHEERPJ_JAVA11_DIAGNOSE.md). + # WidgetWorkbench V5 – Page Editor, Rollen/PERS_ID und HMI Widgets Ausgangsbasis: **Workbench HMI V4.2 (IMSAPI regLogin)**. Das Paket enthält Original-Workbench-Backend und den erweiterten Vue/GridStack-Client. Bestehende HTML-Seiten bleiben erhalten. diff --git a/backend/pom.xml b/backend/pom.xml index 82505cc..10615ce 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -189,13 +189,52 @@ + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1 + + + copy-cheerpj-jsonp-provider + prepare-package + copy + + + + org.glassfish + javax.json + 1.1.4 + jar + ${project.build.directory}/cheerpj-support + javax.json-1.1.4.jar + true + + + + + + + org.apache.maven.plugins maven-war-plugin 3.3.2 - + + + + ${project.build.directory}/cheerpj-support + hmi/cheerpj-libs + javax.json-1.1.4.jar + false + + diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiJvmOptions.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiJvmOptions.java index 4661b3b..e3db5bb 100644 --- a/backend/src/main/java/com/workbenchclassic/hmi/HmiJvmOptions.java +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiJvmOptions.java @@ -8,6 +8,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; +import java.util.Locale; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; @@ -27,11 +28,32 @@ final class HmiJvmOptions { private static final int TIMEOUT_SECONDS = 18; private HmiJvmOptions() { } + /** Detect the GlassFish host OS, not the browser/virtual CheerpJ OS. */ + static String hostPlatform() { + String name = System.getProperty("os.name", "").toLowerCase(Locale.ROOT); + if (name.startsWith("windows")) return "windows"; + if (name.startsWith("linux")) return "linux"; + return "other"; + } + + static boolean windowsHost(String osName) { + return osName != null && osName.toLowerCase(Locale.ROOT).startsWith("windows"); + } + + static String executableNameFor(String osName) { + return windowsHost(osName) ? "asadmin.bat" : "asadmin"; + } + + static String executableName() { + return executableNameFor(System.getProperty("os.name", "")); + } + static JSONObject commands(boolean browser, boolean api) { + String command = executableName(); return new JSONObject() - .put("allowInsecure", "asadmin create-jvm-options -Dhmi.allow.insecure=" + browser) - .put("allowImsapiHttp", "asadmin create-jvm-options -Dhmi.imsapi.allowHttp=" + api) - .put("restart", "asadmin restart-domain"); + .put("allowInsecure", command + " create-jvm-options -Dhmi.allow.insecure=" + browser) + .put("allowImsapiHttp", command + " create-jvm-options -Dhmi.imsapi.allowHttp=" + api) + .put("restart", command + " restart-domain"); } static synchronized JSONObject update(boolean browser, boolean api) throws IOException, InterruptedException { @@ -90,8 +112,13 @@ final class HmiJvmOptions { String home = System.getProperty("com.sun.aas.installRoot", "").trim(); if (home.isEmpty()) throw new IOException("GlassFish installation root unavailable"); Path install = Paths.get(home).toAbsolutePath().normalize(); - Path asadmin = install.resolve("bin").resolve("asadmin").normalize(); - if (!asadmin.startsWith(install) || !Files.isRegularFile(asadmin) || !Files.isExecutable(asadmin)) + Path asadmin = install.resolve("bin").resolve(executableName()).normalize(); + // On Windows, .bat files are started through the OS command interpreter + // by the Java process launcher. Files.isExecutable is not reliably + // implemented for batch scripts; existence is the meaningful check. + boolean valid = asadmin.startsWith(install) && Files.isRegularFile(asadmin); + if (valid && !windowsHost(System.getProperty("os.name", ""))) valid = Files.isExecutable(asadmin); + if (!valid) throw new IOException("Local asadmin is not executable"); return asadmin; } diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiSystemSettingsResource.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiSystemSettingsResource.java index 1008042..9243660 100644 --- a/backend/src/main/java/com/workbenchclassic/hmi/HmiSystemSettingsResource.java +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiSystemSettingsResource.java @@ -36,6 +36,8 @@ public class HmiSystemSettingsResource { Response denied = allowed(false); if (denied != null) return denied; return json(200, HmiTransportPolicy.status() .put("managedVia", "asadmin / domain.xml") + .put("serverPlatform", HmiJvmOptions.hostPlatform()) + .put("asadminExecutable", HmiJvmOptions.executableName()) .put("fallbackCommands", HmiJvmOptions.commands( HmiTransportPolicy.allowBrowserHttp(),HmiTransportPolicy.allowImsapiHttp()))); } diff --git a/backend/src/main/webapp/hmi/assets/index-Bv60NqJm.css b/backend/src/main/webapp/hmi/assets/index-Bv60NqJm.css deleted file mode 100644 index 4edb6ec..0000000 --- a/backend/src/main/webapp/hmi/assets/index-Bv60NqJm.css +++ /dev/null @@ -1 +0,0 @@ -.grid-stack{position:relative}.grid-stack-rtl{direction:ltr}.grid-stack-rtl>.grid-stack-item{direction:rtl}.grid-stack-placeholder>.placeholder-content{background-color:#0000001a;margin:0;position:absolute;width:auto;z-index:0!important}.grid-stack>.grid-stack-item{position:absolute;padding:0;top:0;width:var(--gs-column-width);height:var(--gs-cell-height)}.grid-stack>.grid-stack-item>.grid-stack-item-content{margin:0;position:absolute;width:auto;overflow-x:hidden;overflow-y:auto}.grid-stack>.grid-stack-item.size-to-content:not(.size-to-content-max)>.grid-stack-item-content{overflow-y:hidden}.grid-stack:not(.grid-stack-rtl)>.grid-stack-item{left:0}.grid-stack.grid-stack-rtl>.grid-stack-item{right:0}.grid-stack>.grid-stack-item>.grid-stack-item-content,.grid-stack>.grid-stack-placeholder>.placeholder-content{top:var(--gs-item-margin-top);right:var(--gs-item-margin-right);bottom:var(--gs-item-margin-bottom);left:var(--gs-item-margin-left)}.grid-stack-item>.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.grid-stack-item.ui-resizable-autohide>.ui-resizable-handle,.grid-stack-item.ui-resizable-disabled>.ui-resizable-handle{display:none}.grid-stack-item>.ui-resizable-ne,.grid-stack-item>.ui-resizable-nw,.grid-stack-item>.ui-resizable-se,.grid-stack-item>.ui-resizable-sw{background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-position:center}.grid-stack-item>.ui-resizable-ne{transform:rotate(45deg)}.grid-stack-item>.ui-resizable-sw{transform:rotate(45deg)}.grid-stack-item>.ui-resizable-nw{transform:rotate(-45deg)}.grid-stack-item>.ui-resizable-se{transform:rotate(-45deg)}.grid-stack-item>.ui-resizable-nw{cursor:nw-resize;width:20px;height:20px;top:var(--gs-item-margin-top);left:var(--gs-item-margin-left)}.grid-stack-item>.ui-resizable-n{cursor:n-resize;height:10px;top:var(--gs-item-margin-top);left:25px;right:25px}.grid-stack-item>.ui-resizable-ne{cursor:ne-resize;width:20px;height:20px;top:var(--gs-item-margin-top);right:var(--gs-item-margin-right)}.grid-stack-item>.ui-resizable-e{cursor:e-resize;width:10px;top:15px;bottom:15px;right:var(--gs-item-margin-right)}.grid-stack-item>.ui-resizable-se{cursor:se-resize;width:20px;height:20px;bottom:var(--gs-item-margin-bottom);right:var(--gs-item-margin-right)}.grid-stack-item>.ui-resizable-s{cursor:s-resize;height:10px;left:25px;bottom:var(--gs-item-margin-bottom);right:25px}.grid-stack-item>.ui-resizable-sw{cursor:sw-resize;width:20px;height:20px;bottom:var(--gs-item-margin-bottom);left:var(--gs-item-margin-left)}.grid-stack-item>.ui-resizable-w{cursor:w-resize;width:10px;top:15px;bottom:15px;left:var(--gs-item-margin-left)}.grid-stack-item.ui-draggable-dragging>.ui-resizable-handle{display:none!important}.grid-stack-item.ui-draggable-dragging{will-change:left,right,top}.grid-stack-item.ui-resizable-resizing{will-change:width,height}.ui-draggable-dragging,.ui-resizable-resizing{z-index:10000}.ui-draggable-dragging>.grid-stack-item-content,.ui-resizable-resizing>.grid-stack-item-content{box-shadow:1px 4px 6px #0003;opacity:.8}.grid-stack-animate,.grid-stack-animate .grid-stack-item{transition:left .3s,right .3s,top .3s,height .3s,width .3s}.grid-stack-animate .grid-stack-item.grid-stack-placeholder,.grid-stack-animate .grid-stack-item.ui-draggable-dragging,.grid-stack-animate .grid-stack-item.ui-resizable-resizing{transition:left 0s,right 0s,top 0s,height 0s,width 0s}.grid-stack>.grid-stack-item[gs-y="0"]{top:0}.grid-stack:not(.grid-stack-rtl)>.grid-stack-item[gs-x="0"]{left:0}.grid-stack.grid-stack-rtl>.grid-stack-item[gs-x="0"]{right:0}*{box-sizing:border-box}html,body,#app{margin:0;min-height:100%;font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif}body{background:#101827}.shell{--hmi-accent:#4686fb;--hmi-scale:1;--bg:#101827;--panel:#192537;--panel-deep:#142032;--subtle:#243248;--line:#2d3b51;--text:#e8eef7;--muted:#94a6be;--input:#121f31;min-height:100vh;display:flex;background:var(--bg);color:var(--text);font-size:calc(14px * var(--hmi-scale))}.shell.light{--bg:#edf2f8;--panel:white;--panel-deep:#f8fbfe;--subtle:#edf3f9;--line:#d8e0ec;--text:#132338;--muted:#5f738b;--input:#fff}.shell.high-contrast{--line:#9eaebf;--muted:#d1dbe7}.shell.light.high-contrast{--muted:#31475f}.sidebar{width:238px;flex-shrink:0;min-height:100vh;background:var(--panel-deep);border-right:1px solid var(--line);display:flex;flex-direction:column;padding:20px 12px;gap:8px}.brand{display:flex;align-items:center;gap:12px;padding:4px 12px 27px}.brand-icon{font-size:29px;color:var(--hmi-accent);font-weight:700}.brand strong{font-size:1.05em;display:block}.brand small,.sidebar-bottom small{display:block;font-size:.65em;letter-spacing:1px;color:var(--muted);margin-top:5px}.nav-caption{font-size:.71em;font-weight:800;letter-spacing:1.4px;color:var(--muted);padding:12px 12px 7px}.nav-link{width:100%;border:0;color:var(--muted);background:transparent;padding:12px 14px;border-radius:10px;display:flex;gap:11px;text-align:left;cursor:pointer;align-items:center;font:inherit}.nav-link.active{background:color-mix(in srgb,var(--hmi-accent) 18%,transparent);color:var(--text);border-left:3px solid var(--hmi-accent)}.nav-link:hover{background:var(--subtle);color:var(--text)}.nav-add{margin:8px 9px;background:transparent;border:1px dashed var(--line);color:var(--muted);padding:11px;border-radius:9px;cursor:pointer}.sidebar-bottom{margin-top:auto;display:flex;align-items:center;gap:12px;padding:18px 12px;border-top:1px solid var(--line)}.online-dot,.status-dot{background:#35bd78;width:10px;height:10px;border-radius:50%;display:inline-block;box-shadow:0 0 0 4px #35bd7822}.content{display:flex;flex-direction:column;flex:1;min-width:0}.toolbar{padding:22px 32px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);background:var(--panel-deep)}.toolbar h1{font-size:1.6em;margin:0 0 5px;font-weight:750}.subtitle,.muted{color:var(--muted)}.subtitle{font-size:.85em}.toolbar-right{display:flex;align-items:center;gap:14px}.station-label{display:flex;align-items:center;gap:10px;color:var(--muted)}.station-input{width:150px}.icon-button{font-size:22px;line-height:1;padding:9px 14px}.work-area{flex:1;padding:24px 28px}.work-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px;flex-wrap:wrap}.mode-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}button{font:inherit;cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}.mode-btn,.subtle-button,.primary-button,.publish-button,.danger-button,.icon-button{border-radius:9px;padding:9px 14px;border:1px solid var(--line);background:var(--panel);color:var(--text)}.mode-btn.active{background:var(--hmi-accent);color:#fff;border-color:var(--hmi-accent)}.primary-button{background:var(--hmi-accent);border-color:var(--hmi-accent);color:#fff;font-weight:600}.publish-button{background:#157f59;border-color:#157f59;color:#fff;font-weight:600}.danger-button{color:#fc9191;border-color:#734347}.version{color:var(--muted);font-size:.8em;margin-left:8px}.work-layout{display:flex;gap:22px;align-items:flex-start}.canvas{flex:1;min-width:0;min-height:550px;background:var(--panel-deep);border:1px solid var(--line);border-radius:14px;padding:11px}.canvas.editable{background-image:radial-gradient(var(--line) .8px,transparent .8px);background-size:18px 18px}.grid-stack{min-height:500px}.grid-stack-item-content{height:100%;border:1px solid var(--line);border-radius:13px;overflow:hidden!important;background:var(--panel);box-shadow:0 5px 15px #0000000b}.grid-stack-item-content.selected{outline:2px solid var(--hmi-accent)}.widget{height:100%;display:flex;flex-direction:column;min-height:0}.widget-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line);min-height:48px}.widget-name{font-size:.92em;font-weight:700}.widget-label{font-size:.65em;text-transform:uppercase;letter-spacing:.5px;color:var(--muted)}.widget-body{flex:1;padding:16px;min-height:0;overflow:auto}.info-number{font-size:1.7em;letter-spacing:-.3px;font-weight:750;display:inline-block;margin:3px 13px 6px 0}.widget .muted{font-size:.86em}.widget input,.inspector input,.inspector textarea,.inspector select,.station-input{background:var(--input);color:var(--text);border:1px solid var(--line);border-radius:9px;padding:10px 12px;width:100%;font:inherit}.widget input:focus,.inspector input:focus,.inspector textarea:focus{outline:2px solid var(--hmi-accent)}.widget-table{border-collapse:collapse;width:100%;font-size:.87em;text-align:left}.widget-table th{background:var(--subtle);font-weight:650}.widget-table td,.widget-table th{padding:9px;border-bottom:1px solid var(--line)}.text-widget{white-space:pre-wrap;font-size:1.05em}.inspector{width:315px;flex-shrink:0;background:var(--panel);border:1px solid var(--line);border-radius:13px;padding:18px;display:flex;flex-direction:column;gap:12px;max-height:calc(100vh - 190px);overflow:auto}.inspector h3{font-size:1.08em;margin:5px 0 0}.inspector-help{color:var(--muted);font-size:.85em;line-height:1.45;margin:0}.widget-picker{display:grid;grid-template-columns:1fr;gap:6px;margin:8px 0}.widget-picker button{background:var(--subtle);color:var(--text);border:1px solid var(--line);border-radius:8px;text-align:left;padding:9px}.widget-picker button:hover{border-color:var(--hmi-accent)}.input-label{color:var(--muted);font-size:.84em;margin-top:8px}.check-row{display:flex;align-items:center;gap:8px}.check-row input{width:auto}.inspector textarea{font-size:.83em;font-family:ui-monospace,monospace;resize:vertical}.notice{padding:15px 25px;background:#8b631e26;color:#dfbd78;border-bottom:1px solid #8b631e99}.error-notice{background:#913a3a22;color:#f6a3a3}.success-msg{background:#157f592e;color:#66dfac;padding:11px 27px}.error{color:#fd8585}.link-btn{border:0;background:transparent;color:var(--hmi-accent);margin-top:12px;padding:0}.empty{padding:70px 20px;text-align:center;color:var(--muted)}.footer{padding:13px 30px;font-size:.77em;color:var(--muted);border-top:1px solid var(--line)}@media(max-width:1050px){.inspector{width:260px}.sidebar{width:194px}.work-area{padding:16px}}@media(max-width:800px){.shell{display:block}.sidebar{width:100%;min-height:0}.sidebar-bottom{display:none}.content{min-height:85vh}.toolbar{padding:15px}.work-layout{flex-direction:column}.inspector{width:100%;max-height:none}.work-area{padding:12px}.grid-stack-item-content{border-radius:8px}}.hmi-diagnostic-notice{border:1px solid #ad793c;background:var(--panel);border-radius:12px;margin:18px 27px;padding:18px;color:var(--text);box-shadow:0 2px 18px #0002}.hmi-diagnostic-notice strong{font-size:1.07em}.hmi-diagnostic-notice p{color:var(--muted);line-height:1.45}.diagnostic-line{font-family:ui-monospace,monospace;font-size:.85em}.diagnostic-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.diagnostic-actions a{display:inline-block;text-decoration:none}.hmi-mes-login{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:14px 0}.hmi-mes-login label{display:grid;gap:5px;font-size:.85rem;min-width:165px;flex:1}.hmi-mes-login input{background:var(--hmi-surface,#182a40);color:inherit;border:1px solid var(--hmi-line,#41556b);border-radius:10px;padding:10px 12px;max-width:100%}.hmi-mes-login .primary-button{min-height:40px}.hmi-heading-frame{display:flex;flex-direction:column;justify-content:center;gap:5px;width:100%;height:100%;min-height:65px;border:1px solid;box-sizing:border-box;padding:18px 22px;overflow:hidden}.hmi-heading-frame .heading-subtitle{opacity:.77;font-size:.93em}.hmi-image-frame{display:flex;justify-content:center;align-items:center;width:100%;height:100%;border-radius:8px;overflow:hidden}.hmi-image-frame img{display:block;width:100%;height:100%}.hmi-role-picker{max-height:160px;overflow-y:auto;border:1px solid var(--line);border-radius:9px;padding:6px}.widget-picker button[draggable=true]{cursor:grab}.widget-picker button[draggable=true]:active{cursor:grabbing}.widget-portable-actions{display:grid;gap:8px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--panel-deep)}.widget-portable-actions small{font-size:.77em;line-height:1.35;color:var(--muted)}.widget-portable-actions .subtle-button{width:100%}.nav-group{display:flex;flex-direction:column;gap:2px}.nav-root{display:flex;gap:10px;align-items:center;width:100%;padding:12px;background:transparent;border:0;border-radius:10px;color:var(--text);text-align:left;font:inherit;cursor:pointer}.nav-root:hover{background:var(--subtle)}.nav-root strong{font-size:.89em;flex:1}.nav-count{font-size:.74em;border:1px solid var(--line);border-radius:7px;padding:2px 6px;color:var(--muted)}.nav-page-line{display:flex;align-items:center;padding-left:calc(var(--nav-depth) * 13px);gap:2px}.nav-expander,.nav-expander-spacer{width:22px;min-width:22px;display:grid;place-items:center;border:0;background:transparent;color:var(--muted);padding:5px 0}.nav-expander{cursor:pointer}.nav-expander:hover{color:var(--text)}.nav-page{min-width:0;flex:1;gap:7px;padding:9px 8px;font-size:.91em}.nav-page-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-page.disabled{opacity:.55}.nav-page small{font-size:.71em}.nav-page-icon{color:var(--muted)}.hmi-bootstrap{background:var(--panel);border:1px solid var(--hmi-accent);border-radius:14px;padding:24px;margin:16px;max-width:800px}.hmi-bootstrap h2{margin:0 0 12px}.hmi-bootstrap p{color:var(--muted)}.hmi-bootstrap form{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end}.hmi-bootstrap label{display:flex;flex-direction:column;gap:6px;min-width:220px;flex:1}.hmi-bootstrap input{background:var(--input);color:var(--text);border:1px solid var(--line);padding:10px;border-radius:8px}.cheerpj-widget{display:flex;flex-direction:column;width:100%;height:100%;min-height:0;overflow:hidden;color:var(--text,#d8ecf2)}.cheerpj-toolbar{display:flex;gap:6px;align-items:center;padding:4px 7px;min-height:30px;background:#23394b73;border-bottom:1px solid rgba(75,195,229,.3)}.cheerpj-caption{font-weight:650;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:.89em}.cheerpj-badge{font-size:10px;opacity:.7}.cheerpj-toolbar button{font-size:11px;cursor:pointer;border:1px solid #39819a;background:#153544;color:#d0f2fa;border-radius:7px;padding:4px 7px}.cheerpj-frame{display:block;flex:1;min-height:0;min-width:0;width:100%;height:100%;border:0;background:#18242f}.cheerpj-placeholder{display:flex;flex:1;min-height:0;align-items:center;justify-content:center;flex-direction:column;gap:12px;text-align:center;font-size:1em;padding:14px;overflow-wrap:anywhere}.cheerpj-placeholder small{font-size:.77em;opacity:.72}.cheerpj-status,.cheerpj-alert{margin:0;padding:4px 9px;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cheerpj-alert{background:#4b151a;color:#fff}.cheerpj-warning{padding:4px 8px;font-size:11px;line-height:1.35;background:#4f351a;color:#ffe0a6;border-bottom:1px solid #886132}.cheerpj-display-wrapper{display:flex;flex:1;min-width:0;min-height:0;overflow:hidden}.cheerpj-display-wrapper--original{overflow:auto}.cheerpj-widget:fullscreen{background:#111e2a;padding:0;max-width:none!important;max-height:none!important}.cheerpj-widget:fullscreen .cheerpj-display-wrapper{flex:1}.grid-stack-item-content{position:relative}.widget-editor-controls{position:absolute;top:6px;right:6px;z-index:50;display:flex;gap:5px;pointer-events:auto}.widget-editor-controls button{border:1px solid var(--line);border-radius:6px;min-width:29px;min-height:29px;line-height:1;background:var(--panel-deep);color:var(--text);font-size:17px;cursor:pointer;box-shadow:0 2px 7px #0006}.widget-editor-controls .widget-editor-remove{background:#682330;color:#fff;border-color:#a94555}.widget-editor-controls button:hover,.widget-editor-controls button:focus-visible{outline:2px solid var(--hmi-accent)}.hmi-widget-revisions{border:1px solid var(--hmi-border,rgba(128,151,172,.4));border-radius:12px;padding:12px;margin:12px 0;background:var(--hmi-surface,rgba(52,72,94,.12));display:grid;gap:8px}.hmi-widget-revisions h4{margin:0;font-size:1rem}.hmi-widget-revisions .revision-actions{display:flex;gap:6px;flex-wrap:wrap}.hmi-widget-revisions select,.hmi-widget-revisions input{max-width:100%;min-width:0}.hmi-widget-edit-fieldset{border:0;margin:0;padding:0;min-width:0;display:contents}.hmi-widget-edit-fieldset[disabled]{opacity:.58}.shell{--itac-red:#a40640;--itac-red-light:#bd0749;--itac-red-dark:#73042d;--itac-blue:#00488e;--itac-ink:#243746;--itac-slate:#375169;--itac-muted:#838c93;--itac-border:#dfe5eb;--itac-soft:#f6f7fb;--itac-surface:#fff;--itac-shadow:0 12px 34px rgba(36,55,70,.16);--itac-radius:8px;--ios-tap:44px}.shell.ios{--bg:#f1f4f8;--panel:#fff;--panel-deep:#f9fafc;--subtle:#eef2f6;--line:var(--itac-border);--text:var(--itac-ink);--muted:#637487;--input:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Arial,sans-serif}.shell.ios .sidebar{background:#fff;border-right:1px solid var(--itac-border)}.shell.ios .toolbar{background:#fff;border-bottom-color:var(--itac-border)}.shell.ios .toolbar h1{color:var(--itac-ink);letter-spacing:-.035em}.shell.ios .brand-icon{color:var(--itac-red)}.shell.ios .brand small{letter-spacing:.11em;color:var(--itac-muted)}.shell.ios .nav-link.active{color:var(--itac-red);background:#a4064011;border-left:3px solid var(--itac-red)}.shell.ios .nav-link:hover{background:#f5f7fb}.shell.ios .canvas{background:#f5f7fa;border-color:#dfe5eb}.shell.ios .canvas.editable{background-image:radial-gradient(#ccd6e0 .8px,transparent .8px)}.shell.ios .grid-stack-item-content{border:1px solid #e1e7ef;border-radius:13px;background:#fff;box-shadow:0 4px 18px #1e38570b}.shell.ios .grid-stack-item-content:hover{box-shadow:0 9px 25px #1e385717}.shell.ios .widget-head{border-bottom:1px solid #eaf0f5;background:linear-gradient(#fff,#fcfdfe)}.shell.ios .primary-button,.shell.ios .mode-btn.active{background:var(--itac-red);border-color:var(--itac-red)}.shell.ios .widget-label{color:#8191a3}.shell.ios .sidebar-bottom .online-dot{background:#139469}.shell.ios .inspector{background:#fff}.shell.ios .widget-picker button{background:#fff;border:1px solid #dde5ed}.shell.ios .widget-picker button:hover{border-color:var(--itac-red);background:#fff8fb}.shell.ios .widget input,.shell.ios .inspector input,.shell.ios .inspector textarea,.shell.ios .inspector select{background:#fff;color:#243746}.shell.ios .widget input:focus,.shell.ios .inspector input:focus{outline-color:var(--itac-red)}.shell.ios .widget-table th{background:#f4f6f9}.wb-widget-title{display:flex;align-items:center;gap:10px;min-width:0}.wb-widget-symbol{width:29px;height:29px;border-radius:9px;background:color-mix(in srgb,var(--hmi-accent) 10%,transparent);color:var(--hmi-accent);display:grid;place-items:center;font-weight:750;font-size:1.1em;flex-shrink:0}.wb-widget .widget-body{padding:0;overflow:auto}.wb-widget :is(button,input,select){font:inherit}.wb-widget button{min-height:34px}.wb-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 15px 8px}.wb-meta{display:flex;align-items:center;gap:6px;font-size:.85em;color:var(--muted)}.wb-meta b{color:var(--text);font-size:1.07em}.wb-live-dot{width:8px;height:8px;border-radius:50%;background:#17a978;box-shadow:0 0 0 3px #17a97820;flex-shrink:0}.wb-live-dot.inactive{background:#f2a737;box-shadow:0 0 0 3px #f2a73720}.wb-inline-actions{display:flex;align-items:center;gap:7px}.wb-btn{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:8px;padding:7px 11px;font-size:.86em;white-space:nowrap;min-height:34px}.wb-btn:hover:not(:disabled){border-color:var(--hmi-accent);color:var(--hmi-accent)}.wb-btn:focus-visible,.wb-widget input:focus-visible{outline:2px solid var(--hmi-accent);outline-offset:2px}.wb-btn-icon{font-size:1.1em;min-width:34px;padding:5px}.wb-btn.wb-primary{background:var(--hmi-accent);color:#fff;border-color:var(--hmi-accent);font-weight:700}.wb-btn.wb-primary:hover:not(:disabled){filter:brightness(1.12);color:#fff}.wb-btn.wb-small{font-size:.78em;padding:6px 9px}.wb-filter{position:relative;padding:6px 15px 12px}.wb-filter input{display:block;width:100%;border-radius:9px;background:var(--input);border:1px solid var(--line);padding:9px 11px 9px 34px;min-height:39px;font-size:.87em;color:var(--text)}.wb-search-icon{position:absolute;top:7px;left:25px;color:var(--muted);font-size:1.5em;pointer-events:none}.wb-placeholder{margin:12px 16px;color:var(--muted);font-size:.86em}.wb-alert{margin:9px 15px;padding:10px;background:color-mix(in srgb,#c8414c 10%,var(--panel));border:1px solid color-mix(in srgb,#c8414c 40%,transparent);border-radius:8px;font-size:.83em;color:#dd7676}.shell.ios .wb-alert{color:#a72a37}.wb-table-scroll{overflow:auto;max-height:100%;min-height:60px;margin:0 12px;border:1px solid var(--line);border-radius:9px}.wb-table{border-collapse:collapse;min-width:100%;font-size:.82em;white-space:nowrap}.wb-table thead{position:sticky;top:0;z-index:1}.wb-table th{background:var(--subtle);padding:11px 12px;text-align:left;color:var(--muted);font-weight:700;font-size:.83em;text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid var(--line)}.wb-table td{padding:10px 12px;border-bottom:1px solid var(--line);color:var(--text);max-width:320px;overflow:hidden;text-overflow:ellipsis}.wb-table tbody tr:hover{background:color-mix(in srgb,var(--hmi-accent) 6%,transparent)}.wb-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.94em}.wb-empty{text-align:center;padding:20px!important;color:var(--muted)!important}.wb-footer{padding:10px 15px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:.76em;flex-wrap:wrap}.wb-tree-list{overflow:auto;flex:1;padding:2px 14px 8px}.wb-tree-group{border:1px solid var(--line);border-radius:9px;background:var(--panel);margin-bottom:8px;overflow:hidden}.wb-tree-group>summary{display:flex;align-items:center;gap:10px;cursor:pointer;min-height:48px;padding:9px 13px;list-style:none;color:var(--text);font-size:.88em}.wb-tree-group>summary::-webkit-details-marker{display:none}.wb-tree-group>summary:hover{background:var(--subtle)}.wb-tree-group[open]>summary{background:color-mix(in srgb,var(--hmi-accent) 7%,var(--panel));border-bottom:1px solid var(--line)}.wb-tree-group>summary:after{content:"⌄";margin-left:7px;color:var(--muted);font-size:1.1em}.wb-tree-group[open]>summary:after{transform:rotate(180deg)}.wb-tree-name{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.wb-tree-name span{font-size:.84em;color:var(--muted);font-weight:400}.wb-tree-count{border-radius:8px;background:var(--subtle);padding:2px 7px;font-size:.75em;color:var(--muted)}.wb-tree-children{padding:8px 8px 4px 14px;border-left:2px solid color-mix(in srgb,var(--hmi-accent) 25%,transparent);margin-left:15px}.wb-tree-icon{flex-shrink:0;width:26px;height:26px;display:grid;place-items:center;border-radius:8px;background:color-mix(in srgb,var(--hmi-accent) 10%,transparent);color:var(--hmi-accent)}.wb-tree-leaf{display:flex;align-items:center;width:100%;gap:10px;min-height:45px;border:1px solid var(--line);border-radius:8px;background:var(--panel);margin-bottom:6px;text-align:left;color:var(--text);padding:8px 10px;cursor:pointer}.wb-tree-leaf:hover{border-color:var(--hmi-accent);background:color-mix(in srgb,var(--hmi-accent) 5%,var(--panel))}.wb-tree-leaf>span:nth-child(2){display:flex;flex-direction:column;gap:3px;flex:1}.wb-tree-leaf small{color:var(--muted);font-size:.77em}.wb-tree-arrow{color:var(--hmi-accent);font-size:1.3em}.wb-module{height:100%;min-height:0;padding:17px;display:flex;flex-direction:column;gap:12px;justify-content:center}.wb-module-row{display:flex;align-items:center;gap:14px}.wb-module-logo{width:52px;height:52px;display:grid;place-items:center;flex-shrink:0;border-radius:14px;color:var(--hmi-accent);font-size:1.5em;font-weight:800;background:color-mix(in srgb,var(--hmi-accent) 12%,var(--panel))}.wb-module-text h3{font-size:1.08em;margin:0 0 6px;color:var(--text)}.wb-module-text p{font-size:.85em;line-height:1.4;margin:0;color:var(--muted)}.wb-module-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.wb-chip{font:600 .75em ui-monospace,monospace;color:var(--muted);padding:6px 8px;border-radius:7px;background:var(--subtle)}.wb-module .wb-field{display:flex;flex-direction:column;font-size:.81em;gap:6px;color:var(--muted)}.wb-module .wb-field input{min-height:38px}.wb-hint{font-size:.76em;color:var(--muted);margin:0;line-height:1.5}.wb-module-note{opacity:.83}.wb-data-table,.wb-station-tree{height:100%;display:flex;flex-direction:column;min-height:0}.wb-data-table .wb-table-scroll,.wb-station-tree .wb-tree-list{flex:1}.widget-picker-group{font-size:.7em;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:12px 2px 6px}.widget-picker button{display:flex;gap:9px;align-items:center}.widget-picker-icon{color:var(--hmi-accent);font-size:1.15em;width:20px;text-align:center}.widget-picker-name{display:flex;flex-direction:column;gap:3px;font-weight:600}.widget-picker-desc{color:var(--muted);font-size:.72em;line-height:1.2;font-weight:400}@media(max-width:800px){.wb-module{padding:12px}.wb-module-logo{width:40px;height:40px}.wb-widget .widget-head{padding:9px}.wb-toolbar{padding:8px 10px}.wb-table-scroll{margin:0 6px}}.widget-search{padding:9px 12px;border:1px solid var(--line);background:var(--input);color:var(--text);width:100%;border-radius:8px;margin-top:6px}.wb-value-pill{font-weight:700;border-radius:7px;padding:4px 10px;display:inline-block;font-size:.9em}.wb-value-pill.on{color:#16825b;background:#dcf6e8}.wb-value-pill.off{color:#a76122;background:#fff0d8}.wb-mes-client{display:flex;flex-direction:column;min-height:0;height:100%;gap:10px;color:var(--text,var(--itac-ink,#243746));font-size:calc(.91rem * var(--hmi-scale,1))}.wb-mes-strip{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px 13px;background:var(--subtle,#f1f3f6);border-radius:10px;font-size:.84em}.wb-mes-pill{padding:5px 10px;border-radius:8px;font-weight:750;background:color-mix(in srgb,var(--hmi-accent,#a40640) 12%,transparent);color:var(--hmi-accent,#a40640)}.wb-mes-muted,.wb-mes-note{font-size:.83em;color:var(--muted,#637487);line-height:1.45}.wb-mes-note{padding:0 12px}.wb-mes-form{padding:0 12px;display:flex;gap:10px;align-items:end}.wb-mes-form>label{display:flex;flex-direction:column;gap:5px;flex:1;font-weight:600;font-size:.84em}.wb-mes-form input{min-height:42px;padding:10px 12px;border:1px solid var(--line,#dfe5eb);border-radius:9px;min-width:0;width:100%;color:var(--text,#243746);background:var(--panel,#fff)}.wb-mes-tabs{display:flex;gap:5px;padding:0 12px;flex-wrap:nowrap;overflow-x:auto;flex-shrink:0}.wb-mes-tab{white-space:nowrap;padding:8px 10px;min-height:38px;border:1px solid var(--line,#dfe5eb);border-radius:10px;background:var(--subtle,#eef2f6);color:var(--muted,#637487);cursor:pointer;font-size:.84em}.wb-mes-tab.selected{background:var(--hmi-accent,#a40640);color:#fff;border-color:var(--hmi-accent,#a40640)}.wb-mes-tab small{opacity:.8;margin-left:4px}.wb-mes-client>.wb-table-scroll{flex:1;min-height:90px;max-height:none;margin:0 12px 11px}.wb-mes-actions{display:flex;gap:5px;align-items:center;white-space:nowrap}.wb-mes-actions .wb-btn{padding:5px 9px}.wb-mes-overlay{position:fixed;inset:0;z-index:25000;display:grid;place-items:center;padding:12px;background:#0e1521ad;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.wb-mes-dialog{box-sizing:border-box;width:min(700px,95vw);max-height:90vh;overflow-y:auto;border-radius:19px;background:#fff;color:#243746;border:1px solid #dfe5eb;box-shadow:0 25px 90px #00000040;padding:19px 23px;display:flex;flex-direction:column;gap:15px;--line:#dfe5eb;--muted:#637487;--panel:#fff;--text:#243746}.wb-mes-dialog header{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #dfe5eb;padding-bottom:12px}.wb-mes-dialog header strong{font-size:1.15em}.wb-mes-dialog label:not(.wb-mes-check){display:flex;flex-direction:column;gap:5px;font-weight:600;font-size:.87em}.wb-mes-dialog input:not([type=checkbox]),.wb-mes-dialog select{display:block;padding:10px 13px;width:100%;border:1px solid #dfe5eb;border-radius:9px;background:#fff;color:#243746}.wb-mes-dialog p{margin:0;color:#375169}.wb-mes-check{display:flex;align-items:center;gap:9px;font-size:.87em;cursor:pointer;padding:8px 0}.wb-mes-check input{width:19px;height:19px;flex-shrink:0;accent-color:#a40640}.wb-mes-orders{display:flex;flex-direction:column;gap:5px;overflow:auto;max-height:230px}.wb-mes-order{display:flex;gap:8px;flex-wrap:wrap;align-items:center;text-align:left;border:1px solid #dfe5eb;background:#f8fafc;padding:11px;border-radius:9px;color:#243746}.wb-mes-order:hover,.wb-mes-order.chosen{border-color:#a40640;background:#fff5f8}.wb-mes-order small{color:#637487}.wb-mes-order span{margin-left:auto;color:#a40640}.wb-mes-dialog>.wb-btn.wb-primary{align-self:end}.wb-mes-dialog .wb-alert{margin:0}.shell.neon{--bg:#070f16;--panel:#13232d;--panel-deep:#0c1821;--subtle:#19303d;--line:#355461;--text:#e2f2f8;--muted:#a3becd;--input:#0e1b25;--neon-cyan:#42daf5;--neon-blue:#56a9ee;--neon-purple:#bc75e7;--neon-magenta:#e65ab7;--neon-green:#72f2b2;--neon-border:rgba(105,213,238,.5);font-family:Segoe UI,Arial,system-ui,sans-serif;color-scheme:dark;background:radial-gradient(ellipse 70% 50% at 74% 20%,rgba(24,73,92,.13),transparent 75%),repeating-linear-gradient(45deg,rgba(126,172,189,.025) 0 1px,transparent 1px 5px),#070f16}.shell.neon.high-contrast{--line:#a8d9e7;--muted:#d7eaf2;--neon-border:#9ef0ff}.shell.neon .sidebar{background:linear-gradient(100deg,#090f15,#192530 43%,#0b151c 90%);border-right:2px solid #274f62;box-shadow:inset -4px 0 12px #000000a6,3px 0 18px #36b1d921;padding-top:14px}.shell.neon .brand{margin:-6px -4px 10px;padding:17px 10px 20px;border:1px solid #4d626b;border-radius:13px 24px;background:linear-gradient(160deg,rgba(255,255,255,.12),transparent 29%),linear-gradient(180deg,#3e4c55,#202b33 15%,#0e1b24 61%,#0c141b 84%,#43515a);box-shadow:0 5px #060b0f,inset 0 1px #839ca9,0 0 15px #34dbf436;position:relative}.shell.neon .brand:after{content:"";position:absolute;bottom:5px;left:17px;right:23px;height:2px;background:linear-gradient(90deg,transparent,#42e9fb 46%,#4e97d5,transparent);box-shadow:0 0 9px #36d2ee}.shell.neon .brand-icon{color:#8bebfb;text-shadow:0 0 8px rgba(35,222,247,.7)}.shell.neon .brand strong{color:#c7edff;text-shadow:0 0 12px rgba(45,163,244,.45)}.shell.neon .brand small{color:#a4c0cf;letter-spacing:.15em}.shell.neon .nav-caption{color:#83c8e4;letter-spacing:.22em}.shell.neon .nav-root,.shell.neon .nav-link,.shell.neon .nav-add{border:1px solid #334954;border-radius:8px 15px 8px 13px;color:#c5e4f0;background:linear-gradient(115deg,#23343f,#111e27 61%,#26333b);box-shadow:inset 0 1px #52626b,0 3px 4px #03070b9c;margin:2px 0;position:relative;transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease}.shell.neon .nav-link{min-height:39px}.shell.neon .nav-root:after,.shell.neon .nav-link:after{content:"";position:absolute;bottom:3px;left:12%;width:62%;height:1px;background:linear-gradient(90deg,transparent,#54d1f2,transparent);box-shadow:0 0 9px #31d9f8;pointer-events:none}.shell.neon .nav-link.active,.shell.neon .nav-root[aria-expanded=true]{background:linear-gradient(115deg,#176075,#105064 35%,#0c3445 80%,#145f77);color:#f1ffff;border:1px solid #62e9ff;box-shadow:inset 0 1px #a6faff,0 0 11px #00dbff85,0 0 26px #00dbff30}.shell.neon .nav-link:hover,.shell.neon .nav-root:hover,.shell.neon .nav-add:hover{color:#fff;border-color:#8ee8fa;box-shadow:0 0 13px #36e2ff61,inset 0 1px #8ca4ad}.shell.neon .nav-expander{color:#8fcde0}.shell.neon .sidebar-bottom{border-top:1px solid #3c5d6d}.shell.neon .online-dot{background:#47e6b0;box-shadow:0 0 10px #47e6b080}.shell.neon .toolbar{min-height:95px;padding:19px 28px;background:linear-gradient(90deg,rgba(178,221,241,.12),transparent 20%,rgba(119,151,167,.07) 79%,transparent),linear-gradient(180deg,#3e4a53,#1b2933 20%,#0b171f 68%,#293b46 94%,#57656c);border:1px solid #627782;border-left:0;border-bottom:4px ridge #435f6a;border-radius:0 0 26px 12px;box-shadow:inset 0 1px #9aacb6,0 6px 18px #000000b3,0 0 17px #1dc6f229;position:relative}.shell.neon .toolbar:after{content:"";position:absolute;left:6%;right:22%;bottom:4px;height:2px;background:linear-gradient(90deg,transparent,#4cd8f6 29%,#55aefa 58%,#bb63dd,transparent);box-shadow:0 0 10px #3ed8f5b3;pointer-events:none}.shell.neon .toolbar h1{color:#a7dfff;font-size:1.62em;letter-spacing:.02em;font-weight:500;text-shadow:0 0 16px #2b9ee67a}.shell.neon .subtitle{color:#b1ceda}.shell.neon .toolbar-design-label{color:#b8dcea}.shell.neon .toolbar-theme-select{color:#e6f6ff;border-color:#497387;background:linear-gradient(#1e3442,#101b27)}.shell.neon .work-area{background:radial-gradient(ellipse 100% 80% at 70% 0%,rgba(44,97,117,.17),transparent 75%),repeating-linear-gradient(135deg,rgba(156,203,228,.018) 0 1px,transparent 1px 4px)}.shell.neon .canvas{border:1px solid #466a78;background:linear-gradient(125deg,#081219,#101d26 68%,#121924);box-shadow:inset 0 0 32px #000c,0 0 0 3px #101d26,0 0 12px #2ea7d91f;border-radius:15px}.shell.neon .canvas.editable{background-image:radial-gradient(#3c7a92 .8px,transparent .8px);background-size:18px 18px}.shell.neon .grid-stack-item-content{border:1px solid #638c9f;background:linear-gradient(160deg,#1e343e,#101e27 32%,#11242d);border-radius:10px 18px 12px 16px;box-shadow:inset 0 1px #638b99,0 0 0 2px #0a1b24,0 4px 17px #0008,0 0 12px #30bae224}.shell.neon .grid-stack-item-content:hover{border-color:#93e9fb;box-shadow:0 0 0 2px #0b2533,0 0 20px #33ccea52,0 6px 16px #0008}.shell.neon .grid-stack-item-content.selected{outline:2px solid #3be4fd;outline-offset:2px}.shell.neon .widget-head{border-bottom:1px solid #3d6e7f;min-height:52px;background:linear-gradient(#4a657073,#16252df0 36%,#142630);box-shadow:inset 0 1px #6287956b}.shell.neon .widget-name{color:#d3f4ff;text-shadow:0 0 8px #19bcf54d;letter-spacing:.015em}.shell.neon .widget-label{color:#b6cfda;letter-spacing:.14em}.shell.neon .wb-widget-symbol{background:#163d4b;color:#77e1f3;box-shadow:0 0 9px #19bdd338}.shell.neon .inspector{background:linear-gradient(150deg,#182934,#0b1720);border-color:#5f8997;box-shadow:0 0 14px #35a7d524}.shell.neon .widget-picker button{background:linear-gradient(160deg,#253944,#101f28);border:1px solid #496a78;box-shadow:inset 0 1px #597582}.shell.neon .widget-picker button:hover{background:#183544;border-color:#60d8fa}.shell.neon :is(.mode-btn,.subtle-button,.primary-button,.publish-button,.icon-button,.wb-btn){border-radius:6px 11px 7px;border:1px solid #587787;background:linear-gradient(180deg,#365260,#172d3b 52%,#111c28);color:#ecfaff;box-shadow:inset 0 1px #7a9aa9,0 2px 5px #0007}.shell.neon :is(.mode-btn.active,.primary-button,.wb-btn.wb-primary){border-color:#58daf5;background:linear-gradient(180deg,#2484a8,#175779 53%,#09314c);box-shadow:inset 0 1px #a1eaff,0 0 11px #1cbbed70}.shell.neon .publish-button{border-color:#64d8ba;background:linear-gradient(#298f76,#0b5644);box-shadow:0 0 9px #31ddad55}.shell.neon .danger-button{border-color:#a55467;background:#3b1a2d;color:#ffd6df}.shell.neon :is(button,.nav-link,.nav-root):focus-visible{outline:2px solid #c0f7ff;outline-offset:2px}.shell.neon .wb-mes-tab{background:linear-gradient(#344b59,#172c38);color:#d8eef8;border:1px solid #658b9a;border-radius:5px 9px;box-shadow:inset 0 1px #6a919e}.shell.neon .wb-mes-tab.selected{background:linear-gradient(#158bbb,#10547a);color:#fff;box-shadow:0 0 12px #39b7e65c;border-color:#66e6ff}.shell.neon .wb-mes-tabs .wb-mes-tab:nth-child(2n).selected{background:linear-gradient(#2c8d99,#1b525b)}.shell.neon .wb-mes-tabs .wb-mes-tab:nth-child(3n).selected{background:linear-gradient(#8a5ca6,#4e3574)}.shell.neon .wb-table-scroll{border-color:#547785;box-shadow:inset 0 0 12px #0009}.shell.neon :is(.wb-table,.widget-table) th{background:linear-gradient(180deg,#35515c,#1a2f39);color:#ceebf6;border-color:#567c89}.shell.neon :is(.wb-table,.widget-table) td{border-color:#33515d;color:#d5edf5}.shell.neon :is(.wb-table,.widget-table) tbody tr:hover{background:#1a3a48}.shell.neon .wb-mes-strip{background:linear-gradient(#24404e,#132936);border:1px solid #3d6375}.shell.neon .wb-mes-pill{background:#134655;color:#9decff;box-shadow:0 0 8px #43cee52a}.shell.neon .wb-value-pill.on{background:#0e4a3a;color:#8ff5be}.shell.neon .hmi-heading-frame.neon-frame{background:linear-gradient(170deg,#51636f,#152732 22%,#0b1924 63%,#304653 94%,#617582)!important;color:#bceaff!important;border-color:#69d6f2!important;text-shadow:0 0 18px #51bdf17c;box-shadow:inset 0 1px #a5bbc6,inset 0 -2px #42687c,0 0 13px #3fcef754}.shell.neon .footer{border-color:#31515d;background:#0b1720}.shell.neon .hmi-diagnostic-notice{background:#18232e;border-color:#ad8744}body[data-hmi-theme=neon] .wb-mes-overlay{background:#01070cd1}body[data-hmi-theme=neon] .wb-mes-dialog{--line:#456d7f;--muted:#b1c8d6;--panel:#192c37;--text:#eff8fd;background:linear-gradient(160deg,#284450,#0c1b26 38%,#142a36);border:2px solid #6a9aa9;border-radius:12px 22px;color:#ebf7fb;box-shadow:inset 0 1px #a4c1cc,0 0 26px #2ec9f654,0 25px 65px #000b}body[data-hmi-theme=neon] .wb-mes-dialog header{border-color:#476b79}body[data-hmi-theme=neon] .wb-mes-dialog p{color:#c7dfea}body[data-hmi-theme=neon] .wb-mes-dialog :is(input:not([type=checkbox]),select){background:#101f2a;color:#f0fbff;border-color:#537e8e}body[data-hmi-theme=neon] .wb-mes-order{background:#182e39;border-color:#507684;color:#edf9ff}body[data-hmi-theme=neon] .wb-mes-order:hover{background:#17475c;border-color:#65e1ff}body[data-hmi-theme=neon] .wb-mes-dialog .wb-btn{background:#193c50;border-color:#5fa5bf;color:#dff8ff}body[data-hmi-theme=neon] .wb-mes-dialog .wb-btn.wb-primary{background:#13587b;border-color:#3cb9e4;color:#fff}.toolbar-design-label{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:.86em}.toolbar-theme-select{max-width:168px;border:1px solid var(--line);background:var(--input);border-radius:9px;color:var(--text);padding:9px;font:inherit;cursor:pointer}.theme-picker{display:grid;gap:7px}.theme-choice{background:var(--panel-deep);border:1px solid var(--line);border-radius:11px;padding:8px 10px;display:flex;align-items:center;gap:10px;text-align:left;color:var(--text);width:100%}.theme-choice.chosen{border:2px solid var(--hmi-accent);padding:7px 9px}.theme-choice-label{display:flex;flex-direction:column;gap:3px;flex:1}.theme-choice-label strong{font-size:.9em}.theme-choice-label small{font-size:.75em;color:var(--muted)}.theme-selected{color:var(--hmi-accent);font-size:1.2em}.theme-swatch{display:block;width:54px;height:34px;flex-shrink:0;border:2px solid #334957;border-radius:6px;overflow:hidden;background:#1b2d39;position:relative}.theme-swatch i{position:absolute;top:0;bottom:0;left:0;width:14px;background:#10222d;border-right:1px solid #5395b1}.theme-swatch b{position:absolute;top:5px;left:19px;right:4px;height:8px;border:1px solid #80c5df;background:#2c4656;border-radius:2px}.theme-swatch em{position:absolute;bottom:5px;left:19px;right:4px;height:8px;border:1px solid #5e95aa;background:#1f3947;border-radius:2px}.theme-choice-neon .theme-swatch{box-shadow:inset 0 0 7px #42d5f8,0 0 8px #28c8ff77;border-color:#6ae7ff}.theme-choice-neon .theme-swatch b{box-shadow:0 0 6px #54e1ff}.theme-choice-ios .theme-swatch{background:#f5f7fa;border-color:#bdcbd7}.theme-choice-ios .theme-swatch i{background:#fff;border-color:#e4e8ee}.theme-choice-ios .theme-swatch b{background:#e7ebef;border-color:#d8dfe8}.theme-choice-ios .theme-swatch em{background:#a40640;border-color:#a40640}.theme-choice-light .theme-swatch{background:#f4f7fb}.theme-choice-light .theme-swatch i{background:#dce6ef}.theme-choice-light .theme-swatch b{background:#cbd8e4}.theme-choice-light .theme-swatch em{background:#5f86b5}.theme-choice-system .theme-swatch{background:linear-gradient(100deg,#f0f4fa 50%,#1b2e3b 50%)}@media(max-width:1000px){.toolbar-design-label{font-size:.75em}.toolbar-theme-select{max-width:125px}}@media(max-width:800px){.shell.neon .toolbar{border-radius:0 0 15px 15px}.toolbar-right{flex-wrap:wrap}.shell.neon .sidebar{min-height:0}.shell.neon .nav-root:after{width:25%}}@media(prefers-reduced-motion:reduce){.shell.neon :is(.nav-root,.nav-link,.nav-add){transition:none}}.toolbar-right .theme-save-button{white-space:nowrap;padding:9px 10px;font-size:.78em}@media(max-width:1000px){.toolbar-right .theme-save-button{padding:8px}}.shell.neon{position:relative;padding-top:112px}.shell.neon .sidebar{min-height:calc(100vh - 112px);padding-top:10px}.shell.neon .sidebar .brand{padding:8px 10px;margin:0 0 8px;min-height:55px}.shell.neon .content{min-width:0}.curved-workbench-header{position:absolute;top:0;left:0;right:0;height:116px;z-index:5;pointer-events:none;filter:drop-shadow(0 5px 5px #000b);color:#d1eafa}.curved-header-art{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.curved-header-center{position:absolute;top:17px;left:34%;right:34%;display:flex;align-items:center;flex-direction:column;white-space:nowrap;gap:1px}.curved-header-center strong{font-size:clamp(22px,2.7vw,41px);line-height:1.18;letter-spacing:.04em;font-weight:480;color:#a5dcff;text-shadow:0 0 8px #54a1ed,0 0 18px #1269b678}.curved-header-center span{font-size:9px;letter-spacing:.2em;color:#81a7b9}.curved-header-left{position:absolute;left:4%;top:43px;letter-spacing:.23em;font-size:11px;color:#a8c5d3}.curved-header-right{position:absolute;right:4%;top:37px;font-size:clamp(12px,1.4vw,20px);font-weight:800;letter-spacing:.08em;color:#d9e2e9;text-shadow:0 2px 3px #000}.shell.neon .toolbar{min-height:72px;padding:12px 22px;border-radius:0 0 18px 9px;box-shadow:inset 0 1px #677985,0 6px 18px #0008}.shell.neon .toolbar h1{font-size:1.28em}.shell.neon .nav-root,.shell.neon .nav-link,.shell.neon .nav-add{clip-path:polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,12px 100%,0 calc(100% - 12px));border-radius:4px}.shell.neon .nav-root[aria-expanded=true],.shell.neon .nav-link.active{background:linear-gradient(115deg,#064153,#1688a0 45%,#0a4357);box-shadow:inset 0 0 10px #75f5ff88,0 0 18px #27d8ef88}.shell.neon .grid-stack-item-content{background:linear-gradient(145deg,#263d47,#10232d 15%,#0c1923 77%,#2a3544);border-color:#4c7f92;border-radius:8px 17px 11px}.shell.neon .widget-head{position:relative;background:linear-gradient(180deg,#3d5661cc,#172c36 68%,#152a34)}.shell.neon .widget-head:after{content:"";position:absolute;left:20px;right:20px;bottom:0;height:1px;background:linear-gradient(90deg,transparent,#79e4ff 32%,#518bb8,transparent);box-shadow:0 0 8px #44cbff80}.shell.neon .canvas{background-image:radial-gradient(ellipse at 88% 100%,#25192b55,transparent 53%),repeating-linear-gradient(45deg,#ffffff03 0 1px,transparent 1px 5px),linear-gradient(#07131b,#08141c)}.shell.neon .mode-btn,.shell.neon .subtle-button,.shell.neon .primary-button,.shell.neon .publish-button,.shell.neon .icon-button,.shell.neon .wb-btn,body[data-hmi-theme=neon] .wb-mes-dialog .wb-btn{clip-path:polygon(0 0,calc(100% - 11px) 0,100% 11px,100% 100%,11px 100%,0 calc(100% - 11px));border-radius:3px;min-height:36px;transition:filter .15s ease,transform .15s ease}.shell.neon :is(.mode-btn,.subtle-button,.primary-button,.publish-button,.icon-button,.wb-btn):not(:disabled):hover{filter:brightness(1.2) drop-shadow(0 0 5px #38cffa78);transform:translateY(-1px)}.curved-widget-frame{position:relative;isolation:isolate;width:100%;height:100%;min-height:86px;display:flex;justify-content:center;align-items:center;overflow:hidden;background:#111f29;color:#b7e8ff;border-radius:9px}.curved-widget-svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.curved-widget-copy{z-index:1;display:flex;align-items:center;flex-direction:column;justify-content:center;gap:6px;min-width:0;text-align:center;transform:translateY(-2%);padding:12px 26%;line-height:1.1}.curved-widget-copy strong{color:#a7dfff;font-weight:500;letter-spacing:.02em;text-shadow:0 0 13px #57b4f8;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.curved-widget-copy span{color:#b2c7d8;font-size:clamp(9px,.8vw,13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.futuristic-button{--fb-top:#3d657b;--fb-mid:#1a4864;--fb-bottom:#102a42;--fb-edge:#64d9ff;--fb-glow:#36c5f777;font:inherit;font-weight:700;font-size:.86em;letter-spacing:.02em;color:#f5fcff;min-height:38px;min-width:48px;padding:2px;border:1px solid var(--fb-edge);background:linear-gradient(145deg,#a7d9e7 0%,var(--fb-edge) 8%,#11171e 15%,#60707b 85%,#17242d);cursor:pointer;box-shadow:0 2px 4px #000b,inset 0 1px #e1f6ff88,0 0 9px var(--fb-glow);transition:filter .12s ease,transform .12s ease,box-shadow .12s ease;position:relative}.futuristic-button .fb-inner{display:flex;align-items:center;justify-content:center;min-height:34px;padding:7px 15px;background:linear-gradient(180deg,var(--fb-top),var(--fb-mid) 46%,var(--fb-bottom));box-shadow:inset 0 2px #fff4,inset 0 -1px #000b;text-shadow:0 1px 1px #000;clip-path:inherit}.futuristic-button.fb-shape-hex{clip-path:polygon(18% 0,82% 0,100% 22%,100% 78%,82% 100%,18% 100%,0 78%,0 22%);min-width:52px;min-height:48px}.futuristic-button.fb-shape-hex .fb-inner{min-height:43px;padding:8px 14px}.futuristic-button.fb-shape-capsule{border-radius:22px}.futuristic-button.fb-shape-capsule .fb-inner{border-radius:21px}.futuristic-button.fb-shape-plate{clip-path:polygon(0 0,calc(100% - 11px) 0,100% 11px,100% 100%,11px 100%,0 calc(100% - 11px))}.futuristic-button.fb-shape-tab{clip-path:polygon(12px 0,calc(100% - 12px) 0,100% 27%,100% 100%,0 100%,0 27%)}.futuristic-button.fb-tone-red{--fb-top:#a74c60;--fb-mid:#821d38;--fb-bottom:#490d26;--fb-edge:#ef7e98;--fb-glow:#ec336077}.futuristic-button.fb-tone-blue{--fb-top:#497aa0;--fb-mid:#295783;--fb-bottom:#153152;--fb-edge:#8bd3ff;--fb-glow:#389ae777}.futuristic-button.fb-tone-purple{--fb-top:#755aaf;--fb-mid:#573886;--fb-bottom:#332350;--fb-edge:#b8a0fa;--fb-glow:#ad7bff77}.futuristic-button.fb-tone-magenta{--fb-top:#b650a4;--fb-mid:#872a78;--fb-bottom:#591544;--fb-edge:#fc83e5;--fb-glow:#ed44cf77}.futuristic-button.fb-tone-green{--fb-top:#46877b;--fb-mid:#21635c;--fb-bottom:#153d36;--fb-edge:#76ebca;--fb-glow:#38e1b077}.futuristic-button.fb-tone-steel{--fb-top:#667883;--fb-mid:#3d5566;--fb-bottom:#1f323e;--fb-edge:#acc7d2;--fb-glow:#7cbdd044}.futuristic-button.is-pressed{box-shadow:0 0 0 1px #fff6,0 0 19px var(--fb-glow),inset 0 1px #fff8;filter:brightness(1.19)}.futuristic-button:focus-visible{outline:3px solid #e7fcff;outline-offset:3px}.futuristic-button:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.4)}@media(hover:hover){.futuristic-button:not(:disabled):hover{filter:brightness(1.24);transform:translateY(-1px)}}.neon-actions-widget{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;width:100%;height:100%;gap:8px;min-height:52px}.neon-action-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:8px;width:100%}.neon-actions-selection{font-size:.78em;color:var(--muted,#a6bfd0)}.metal-panel-widget{--mp-accent:#47cee9;position:relative;height:100%;min-height:90px;color:#e0f4fc;background:linear-gradient(163deg,#4e6872,#132c37 8%,#101e29 78%,#252032 94%,#607787);border:2px solid #66899a;border-radius:13px 22px 15px 18px;box-shadow:inset 0 2px #94b2c3aa,inset 0 -2px #10202b,0 0 14px #24cde933;overflow:auto;padding:0 16px 12px}.metal-accent-purple{--mp-accent:#ad8bea}.metal-accent-magenta{--mp-accent:#ee75c8}.metal-accent-green{--mp-accent:#67e9bd}.metal-accent-blue{--mp-accent:#73b9f4}.metal-accent-red{--mp-accent:#ec6c88}.metal-accent-steel{--mp-accent:#a9c4d7}.metal-panel-edge{position:absolute;top:0;left:12%;right:20%;height:2px;background:linear-gradient(90deg,transparent,var(--mp-accent),transparent);box-shadow:0 0 10px var(--mp-accent);pointer-events:none}.metal-panel-top{display:flex;align-items:center;gap:10px;padding:14px 0 8px;border-bottom:1px solid #517485}.metal-panel-pip{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--mp-accent);box-shadow:0 0 12px var(--mp-accent)}.metal-panel-top h3{font-size:1em;flex:1;margin:0;letter-spacing:.015em}.metal-panel-tag{font-size:.65em;color:#a8cdda;letter-spacing:.11em}.metal-panel-content p{color:#c5dce8;line-height:1.5;white-space:pre-wrap}.metal-panel-content small{color:#91b4c5}.metal-panel-rule{height:1px;background:linear-gradient(90deg,#70c9e8,transparent);opacity:.45;margin:6px 0 10px}.shell.neon .wb-mes-tab{clip-path:polygon(11px 0,calc(100% - 11px) 0,100% 27%,100% 100%,0 100%,0 27%);border-radius:0;min-height:40px;padding:8px 16px}.shell.neon .wb-mes-tab.selected{filter:drop-shadow(0 0 3px #56d7f6)}.shell.neon .wb-mes-tabs{padding-top:5px;padding-bottom:7px;border-bottom:2px solid #3e6a81;background:linear-gradient(90deg,#111c24,#303d49 45%,#131d28)}.shell.neon.high-contrast .futuristic-button{box-shadow:none;border-width:2px}@media(max-width:1050px){.curved-header-center{left:30%;right:30%}.curved-header-left{display:none}.curved-header-right{right:2%;top:43px;font-size:11px}}@media(max-width:800px){.shell.neon{padding-top:75px}.curved-workbench-header{height:83px}.shell.neon .sidebar{min-height:0}.curved-header-center{left:20%;right:20%;top:10px}.curved-header-center strong{font-size:25px}.curved-header-center span,.curved-header-right{display:none}.curved-widget-copy{padding:10px 19%}.curved-widget-copy strong{font-size:22px!important}}@media(prefers-reduced-motion:reduce){.futuristic-button,.shell.neon .mode-btn,.shell.neon .subtle-button,.shell.neon .primary-button,.shell.neon .publish-button{transition:none!important;transform:none!important}}.wb-production-overview[data-v-42cc2e76]{height:100%;min-width:0;display:flex;flex-direction:column;gap:10px;padding:8px;color:var(--hmi-text,#d9e9f4)}.wb-overview-top[data-v-42cc2e76]{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.wb-overview-station[data-v-42cc2e76]{font-weight:700}.wb-overview-note[data-v-42cc2e76]{opacity:.75;font-size:.85rem;margin-right:auto}.wb-overview-values[data-v-42cc2e76]{display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:10px;flex:1;align-content:start}.wb-overview-value[data-v-42cc2e76]{min-width:0;padding:12px;border-radius:12px;background:var(--hmi-surface,rgba(40,55,78,.25));border:1px solid var(--hmi-border,rgba(133,163,193,.35));box-shadow:inset 0 1px #ffffff12}.wb-overview-label[data-v-42cc2e76]{font-size:.78rem;letter-spacing:.025em;opacity:.78;margin-bottom:6px}.wb-overview-data[data-v-42cc2e76]{font-size:clamp(.95rem,1.2vw,1.25rem);font-weight:750;overflow-wrap:anywhere}.hmi-script-widget[data-v-a08c6023]{display:grid;gap:8px}.script-result[data-v-a08c6023]{font-size:.84em;max-height:170px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;background:var(--subtle);padding:10px;border-radius:7px}.hmi-css-editor[data-v-14ffdbfe]{padding:26px;overflow:auto;flex:1;min-height:0}.hmi-css-editor header[data-v-14ffdbfe]{display:flex;justify-content:space-between;align-items:center;gap:20px}.hmi-css-editor h2[data-v-14ffdbfe]{margin:0 0 6px}.hmi-css-editor p[data-v-14ffdbfe]{color:var(--muted);font-size:.88rem;margin:0}.css-toolbar[data-v-14ffdbfe]{display:flex;gap:10px;align-items:end;flex-wrap:wrap;padding:24px 0}.css-toolbar label[data-v-14ffdbfe]{display:flex;flex-direction:column;gap:7px;font-size:.86rem}.css-toolbar select[data-v-14ffdbfe]{min-width:230px;padding:9px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:8px}.css-toolbar span[data-v-14ffdbfe]{color:var(--muted);font-size:.85rem;margin-right:auto}.css-editor-grid[data-v-14ffdbfe]{display:grid;grid-template-columns:minmax(360px,1fr) minmax(300px,1fr);gap:14px;min-height:520px}.css-editor-code[data-v-14ffdbfe]{display:flex;flex-direction:column;gap:10px;font-size:.88rem;font-weight:600}.css-editor-code textarea[data-v-14ffdbfe]{width:100%;flex:1;min-height:480px;background:#111827;color:#dbeafe;border:1px solid #394458;border-radius:12px;padding:18px;font:12px/1.55 ui-monospace,Consolas,monospace;resize:vertical}.css-preview[data-v-14ffdbfe]{padding:14px;background:var(--panel);border:1px solid var(--line);border-radius:12px;display:flex;flex-direction:column;gap:10px}.css-preview iframe[data-v-14ffdbfe]{border:1px solid var(--line);border-radius:9px;background:#fff;width:100%;flex:1;min-height:380px}.css-preview p[data-v-14ffdbfe]{font-size:.75rem}@media(max-width:1000px){.css-editor-grid[data-v-14ffdbfe]{grid-template-columns:1fr}}.role-administration[data-v-32be4d46]{padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--panel);margin:16px 0}.role-admin-header[data-v-32be4d46]{display:flex;align-items:center;justify-content:space-between}.role-admin-header h2[data-v-32be4d46]{margin:0}.role-admin-header p[data-v-32be4d46],.muted[data-v-32be4d46]{color:var(--muted);font-size:.85em}.role-admin-columns[data-v-32be4d46]{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px;margin-top:20px}.role-pane[data-v-32be4d46]{background:var(--panel-deep);border:1px solid var(--line);border-radius:12px;padding:16px;min-width:0;max-height:70vh;overflow:auto}.role-pane h3[data-v-32be4d46]{margin-top:0}.role-pane h4[data-v-32be4d46]{margin-bottom:7px}.role-pane input[data-v-32be4d46],.role-pane select[data-v-32be4d46]{background:var(--input);color:var(--text);padding:9px;border:1px solid var(--line);border-radius:8px;min-width:0}.role-search[data-v-32be4d46]{display:flex;gap:7px;margin:12px 0}.role-search input[data-v-32be4d46]{flex:1}.person-rows[data-v-32be4d46]{max-height:40vh;overflow:auto}.person-row[data-v-32be4d46]{display:flex;flex-direction:column;width:100%;gap:3px;margin:5px 0;text-align:left;border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:9px;padding:10px}.person-row.selected[data-v-32be4d46]{border-color:var(--hmi-accent)}.person-row small[data-v-32be4d46],.role-check small[data-v-32be4d46]{color:var(--muted)}.role-check[data-v-32be4d46]{display:flex;align-items:center;gap:9px;margin:8px 0}.role-check span[data-v-32be4d46]{display:flex;flex-direction:column}.role-error[data-v-32be4d46]{color:#f07171}.role-success[data-v-32be4d46]{color:#4cb481}@media(max-width:1100px){.role-admin-columns[data-v-32be4d46]{grid-template-columns:1fr}}.page-admin[data-v-03d65587]{margin:14px 0;background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:20px}.page-admin-head[data-v-03d65587]{display:flex;align-items:center;justify-content:space-between;gap:10px}.page-admin-head h2[data-v-03d65587]{margin:0}.page-admin-head p[data-v-03d65587],.page-admin-hint[data-v-03d65587]{color:var(--muted);font-size:.86em}.page-admin-columns[data-v-03d65587]{display:grid;grid-template-columns:minmax(180px,1fr) minmax(270px,1.5fr) minmax(180px,1fr);gap:18px;margin-top:18px}.page-admin-list[data-v-03d65587],.page-admin-form[data-v-03d65587]{background:var(--panel-deep);border:1px solid var(--line);border-radius:12px;padding:15px;display:flex;flex-direction:column;gap:11px;min-width:0;align-self:start}.page-admin h3[data-v-03d65587]{margin:0 0 10px}.page-admin-section[data-v-03d65587]{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}.page-admin-section>strong[data-v-03d65587]{color:var(--muted);font-size:.9em}.page-admin-entry[data-v-03d65587]{text-align:left;background:transparent;border:1px solid var(--line);border-radius:8px;color:var(--text);padding:10px}.page-admin-entry.selected[data-v-03d65587]{border-color:var(--hmi-accent);background:var(--subtle)}.page-admin label[data-v-03d65587]{display:flex;flex-direction:column;gap:6px;font-size:.9em}.page-admin input[data-v-03d65587],.page-admin select[data-v-03d65587]{background:var(--input);border:1px solid var(--line);border-radius:8px;padding:10px;color:var(--text);width:100%}.page-check[data-v-03d65587]{flex-direction:row!important;align-items:center}.page-check input[data-v-03d65587]{width:auto}.page-form-actions[data-v-03d65587]{display:flex;flex-wrap:wrap;gap:10px}@media(max-width:1100px){.page-admin-columns[data-v-03d65587]{grid-template-columns:1fr}}.script-code-editor[data-v-fdb2941e]{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--input)}.script-code-toolbar[data-v-fdb2941e]{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px;background:var(--subtle);font-size:.85em}.script-code-toolbar span[data-v-fdb2941e]{color:var(--muted);font-size:.9em}.script-code-area[data-v-fdb2941e]{display:flex;min-height:230px;max-height:410px;overflow:auto}.script-lines[data-v-fdb2941e]{flex:0 0 37px;margin:0;text-align:right;padding:12px 8px 12px 0;color:var(--muted);-webkit-user-select:none;user-select:none;border-right:1px solid var(--line);font:12px/1.55 ui-monospace,Consolas,monospace}.script-code-area textarea[data-v-fdb2941e]{flex:1;min-width:0;border:0!important;outline:0!important;border-radius:0!important;resize:vertical;min-height:230px;padding:12px!important;background:transparent!important;color:var(--text);font:12px/1.55 ui-monospace,Consolas,monospace;white-space:pre;tab-size:2}.script-code-hint[data-v-fdb2941e]{font-size:.8em;line-height:1.45;color:var(--muted);padding:6px 12px;margin:4px 0}.script-code-editor button[data-v-fdb2941e]{margin:8px 12px 12px} diff --git a/backend/src/main/webapp/hmi/assets/index-C0IEMKdK.js b/backend/src/main/webapp/hmi/assets/index-C0IEMKdK.js deleted file mode 100644 index 3fc7401..0000000 --- a/backend/src/main/webapp/hmi/assets/index-C0IEMKdK.js +++ /dev/null @@ -1,15 +0,0 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function i(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=i(n);fetch(n.href,r)}})();function kn(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return i=>i in e}const Le={},pi=[],Lt=()=>{},Br=()=>!1,Ns=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Os=t=>t.startsWith("onUpdate:"),Ye=Object.assign,Tn=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},Ml=Object.prototype.hasOwnProperty,Te=(t,e)=>Ml.call(t,e),de=Array.isArray,ii=t=>Xi(t)==="[object Map]",Jt=t=>Xi(t)==="[object Set]",Zn=t=>Xi(t)==="[object Date]",me=t=>typeof t=="function",Fe=t=>typeof t=="string",_t=t=>typeof t=="symbol",Pe=t=>t!==null&&typeof t=="object",$r=t=>(Pe(t)||me(t))&&me(t.then)&&me(t.catch),zr=Object.prototype.toString,Xi=t=>zr.call(t),xl=t=>Xi(t).slice(8,-1),Hr=t=>Xi(t)==="[object Object]",Cn=t=>Fe(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Li=kn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ms=t=>{const e=Object.create(null);return(i=>e[i]||(e[i]=t(i)))},Pl=/-\w/g,at=Ms(t=>t.replace(Pl,e=>e.slice(1).toUpperCase())),Il=/\B([A-Z])/g,mi=Ms(t=>t.replace(Il,"-$1").toLowerCase()),xs=Ms(t=>t.charAt(0).toUpperCase()+t.slice(1)),Vs=Ms(t=>t?`on${xs(t)}`:""),Pt=(t,e)=>!Object.is(t,e),as=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:i})},Ps=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let er;const Is=()=>er||(er=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function bt(t){if(de(t)){const e={};for(let i=0;ii.startsWith("/*")?"":i).split(Ll).forEach(i=>{if(i){const s=i.split(Dl);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function xe(t){let e="";if(Fe(t))e=t;else if(de(t))for(let i=0;iYt(i,e))}const Kr=t=>!!(t&&t.__v_isRef===!0),E=t=>Fe(t)?t:t==null?"":de(t)||Pe(t)&&(t.toString===zr||!me(t.toString))?Kr(t)?E(t.value):JSON.stringify(t,Gr,2):String(t),Gr=(t,e)=>Kr(e)?Gr(t,e.value):ii(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[s,n],r)=>(i[Ks(s,r)+" =>"]=n,i),{})}:Jt(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>Ks(i))}:_t(e)?Ks(e):Pe(e)&&!de(e)&&!Hr(e)?String(e):e,Ks=(t,e="")=>{var i;return _t(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};let Ke;class Wl{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Ke&&(Ke.active?(this.parent=Ke,this.index=(Ke.scopes||(Ke.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,i;if(this.scopes){const s=this.scopes.slice();for(e=0,i=s.length;e0&&--this._on===0){if(Ke===this)Ke=this.prevScope;else{let e=Ke;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let i,s;for(i=0,s=this.effects.length;i0)return;if(Ui){let e=Ui;for(Ui=void 0;e;){const i=e.next;e.next=void 0,e.flags&=-9,e=i}}let t;for(;Di;){let e=Di;for(Di=void 0;e;){const i=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=i}}if(t)throw t}function qr(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Xr(t){let e,i=t.depsTail,s=i;for(;s;){const n=s.prevDep;s.version===-1?(s===i&&(i=n),xn(s),Kl(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=n}t.deps=e,t.depsTail=i}function rn(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Qr(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Qr(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Hi)||(t.globalVersion=Hi,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!rn(t))))return;t.flags|=2;const e=t.dep,i=De,s=wt;De=t,wt=!0;try{qr(t);const n=t.fn(t._value);(e.version===0||Pt(n,t._value))&&(t.flags|=128,t._value=n,e.version++)}catch(n){throw e.version++,n}finally{De=i,wt=s,Xr(t),t.flags&=-3}}function xn(t,e=!1){const{dep:i,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),i.subs===t&&(i.subs=s,!s&&i.computed)){i.computed.flags&=-5;for(let r=i.computed.deps;r;r=r.nextDep)xn(r,!0)}!e&&!--i.sc&&i.map&&i.map.delete(i.key)}function Kl(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}let wt=!0;const Zr=[];function Dt(){Zr.push(wt),wt=!1}function Ut(){const t=Zr.pop();wt=t===void 0?!0:t}function sr(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=De;De=void 0;try{e()}finally{De=i}}}let Hi=0;class Gl{constructor(e,i){this.sub=e,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Pn{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!De||!wt||De===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==De)i=this.activeLink=new Gl(De,this),De.deps?(i.prevDep=De.depsTail,De.depsTail.nextDep=i,De.depsTail=i):De.deps=De.depsTail=i,eo(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const s=i.nextDep;s.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=s),i.prevDep=De.depsTail,i.nextDep=void 0,De.depsTail.nextDep=i,De.depsTail=i,De.deps===i&&(De.deps=s)}return i}trigger(e){this.version++,Hi++,this.notify(e)}notify(e){On();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{Mn()}}}function eo(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)eo(s)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const on=new WeakMap,gi=Symbol(""),ln=Symbol(""),Wi=Symbol("");function et(t,e,i){if(wt&&De){let s=on.get(t);s||on.set(t,s=new Map);let n=s.get(i);n||(s.set(i,n=new Pn),n.map=s,n.key=i),n.track()}}function Vt(t,e,i,s,n,r){const o=on.get(t);if(!o){Hi++;return}const l=u=>{u&&u.trigger()};if(On(),e==="clear")o.forEach(l);else{const u=de(t),d=u&&Cn(i);if(u&&i==="length"){const c=Number(s);o.forEach((h,y)=>{(y==="length"||y===Wi||!_t(y)&&y>=c)&&l(h)})}else switch((i!==void 0||o.has(void 0))&&l(o.get(i)),d&&l(o.get(Wi)),e){case"add":u?d&&l(o.get("length")):(l(o.get(gi)),ii(t)&&l(o.get(ln)));break;case"delete":u||(l(o.get(gi)),ii(t)&&l(o.get(ln)));break;case"set":ii(t)&&l(o.get(gi));break}}Mn()}function yi(t){const e=Ce(t);return e===t||(et(e,"iterate",Wi),ht(t))?e:Ft(t)?si(t)?e.map(i=>ri(gt(i))):e.map(ri):e.map(gt)}function Ls(t){return et(t=Ce(t),"iterate",Wi),t}function Ot(t,e){return Ft(t)?ri(si(t)?gt(e):e):gt(e)}const jl={__proto__:null,[Symbol.iterator](){return js(this,Symbol.iterator,t=>Ot(this,t))},concat(...t){return yi(this).concat(...t.map(e=>de(e)?yi(e):e))},entries(){return js(this,"entries",t=>(t[1]=Ot(this,t[1]),t))},every(t,e){return zt(this,"every",t,e,void 0,arguments)},filter(t,e){return zt(this,"filter",t,e,i=>i.map(s=>Ot(this,s)),arguments)},find(t,e){return zt(this,"find",t,e,i=>Ot(this,i),arguments)},findIndex(t,e){return zt(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return zt(this,"findLast",t,e,i=>Ot(this,i),arguments)},findLastIndex(t,e){return zt(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return zt(this,"forEach",t,e,void 0,arguments)},includes(...t){return Js(this,"includes",t)},indexOf(...t){return Js(this,"indexOf",t)},join(t){return yi(this).join(t)},lastIndexOf(...t){return Js(this,"lastIndexOf",t)},map(t,e){return zt(this,"map",t,e,void 0,arguments)},pop(){return Ni(this,"pop")},push(...t){return Ni(this,"push",t)},reduce(t,...e){return rr(this,"reduce",t,e)},reduceRight(t,...e){return rr(this,"reduceRight",t,e)},shift(){return Ni(this,"shift")},some(t,e){return zt(this,"some",t,e,void 0,arguments)},splice(...t){return Ni(this,"splice",t)},toReversed(){return yi(this).toReversed()},toSorted(t){return yi(this).toSorted(t)},toSpliced(...t){return yi(this).toSpliced(...t)},unshift(...t){return Ni(this,"unshift",t)},values(){return js(this,"values",t=>Ot(this,t))}};function js(t,e,i){const s=Ls(t),n=s[e],r=n.call(s);if(s!==t&&!ht(t)){if(r[Symbol.toStringTag]==="Array Iterator"){const o=Object.create(Object.getPrototypeOf(r));return o.next=()=>nr(r.next(),i),n!==to[e]&&Object.defineProperties(o,{return:{get(){const l=r.return;return typeof l=="function"?l.bind(r):l}},throw:{get(){const l=r.throw;return typeof l=="function"?l.bind(r):l}}}),o}r._next=r.next,r.next=()=>nr(r._next(),i)}return r}function nr(t,e){return t.done||(t.value=e(t.value)),t}const to=Array.prototype;function zt(t,e,i,s,n,r){const o=Ls(t),l=o!==t&&!ht(t),u=o[e];if(u!==to[e]){const h=u.apply(t,r);return l?gt(h):h}let d=i;o!==t&&(l?d=function(h,y){return i.call(this,Ot(t,h),y,t)}:i.length>2&&(d=function(h,y){return i.call(this,h,y,t)}));const c=u.call(o,d,s);return l&&n?n(c):c}function rr(t,e,i,s){const n=Ls(t),r=n!==t&&!ht(t);let o=i,l=!1;n!==t&&(r?(l=s.length===0,o=function(d,c,h){return l&&(l=!1,d=Ot(t,d)),i.call(this,d,Ot(t,c),h,t)}):i.length>3&&(o=function(d,c,h){return i.call(this,d,c,h,t)}));const u=n[e](o,...s);return l?Ot(t,u):u}function Js(t,e,i){const s=Ce(t);et(s,"iterate",Wi);const n=s[e](...i);return(n===-1||n===!1)&&Un(i[0])?(i[0]=Ce(i[0]),s[e](...i)):n}function Ni(t,e,i=[]){Dt(),On();const s=Ce(t)[e].apply(t,i);return Mn(),Ut(),s}const Jl=kn("__proto__,__v_isRef,__isVue"),io=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(_t));function Yl(t){_t(t)||(t=String(t));const e=Ce(this);return et(e,"has",t),e.hasOwnProperty(t)}class so{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,s){if(i==="__v_skip")return e.__v_skip;const n=this._isReadonly,r=this._isShallow;if(i==="__v_isReactive")return!n;if(i==="__v_isReadonly")return n;if(i==="__v_isShallow")return r;if(i==="__v_raw")return s===(n?r?ra:lo:r?oo:ro).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=de(e);if(!n){let u;if(o&&(u=jl[i]))return u;if(i==="hasOwnProperty")return Yl}const l=Reflect.get(e,i,it(e)?e:s);if((_t(i)?io.has(i):Jl(i))||(n||et(e,"get",i),r))return l;if(it(l)){const u=o&&Cn(i)?l:l.value;return n&&Pe(u)?un(u):u}return Pe(l)?n?un(l):Ln(l):l}}class no extends so{constructor(e=!1){super(!1,e)}set(e,i,s,n){let r=e[i];const o=de(e)&&Cn(i);if(!this._isShallow){const d=Ft(r);if(!ht(s)&&!Ft(s)&&(r=Ce(r),s=Ce(s)),!o&&it(r)&&!it(s))return d||(r.value=s),!0}const l=o?Number(i)t,is=t=>Reflect.getPrototypeOf(t);function ea(t,e,i){return function(...s){const n=this.__v_raw,r=Ce(n),o=ii(r),l=t==="entries"||t===Symbol.iterator&&o,u=t==="keys"&&o,d=n[t](...s),c=i?an:e?ri:gt;return!e&&et(r,"iterate",u?ln:gi),Ye(Object.create(d),{next(){const{value:h,done:y}=d.next();return y?{value:h,done:y}:{value:l?[c(h[0]),c(h[1])]:c(h),done:y}}})}}function ss(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function ta(t,e){const i={get(n){const r=this.__v_raw,o=Ce(r),l=Ce(n);t||(Pt(n,l)&&et(o,"get",n),et(o,"get",l));const{has:u}=is(o),d=e?an:t?ri:gt;if(u.call(o,n))return d(r.get(n));if(u.call(o,l))return d(r.get(l));r!==o&&r.get(n)},get size(){const n=this.__v_raw;return!t&&et(Ce(n),"iterate",gi),n.size},has(n){const r=this.__v_raw,o=Ce(r),l=Ce(n);return t||(Pt(n,l)&&et(o,"has",n),et(o,"has",l)),n===l?r.has(n):r.has(n)||r.has(l)},forEach(n,r){const o=this,l=o.__v_raw,u=Ce(l),d=e?an:t?ri:gt;return!t&&et(u,"iterate",gi),l.forEach((c,h)=>n.call(r,d(c),d(h),o))}};return Ye(i,t?{add:ss("add"),set:ss("set"),delete:ss("delete"),clear:ss("clear")}:{add(n){const r=Ce(this),o=is(r),l=Ce(n),u=!e&&!ht(n)&&!Ft(n)?l:n;return o.has.call(r,u)||Pt(n,u)&&o.has.call(r,n)||Pt(l,u)&&o.has.call(r,l)||(r.add(u),Vt(r,"add",u,u)),this},set(n,r){!e&&!ht(r)&&!Ft(r)&&(r=Ce(r));const o=Ce(this),{has:l,get:u}=is(o);let d=l.call(o,n);d||(n=Ce(n),d=l.call(o,n));const c=u.call(o,n);return o.set(n,r),d?Pt(r,c)&&Vt(o,"set",n,r):Vt(o,"add",n,r),this},delete(n){const r=Ce(this),{has:o,get:l}=is(r);let u=o.call(r,n);u||(n=Ce(n),u=o.call(r,n)),l&&l.call(r,n);const d=r.delete(n);return u&&Vt(r,"delete",n,void 0),d},clear(){const n=Ce(this),r=n.size!==0,o=n.clear();return r&&Vt(n,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=ea(n,t,e)}),i}function In(t,e){const i=ta(t,e);return(s,n,r)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_isShallow"?e:n==="__v_raw"?s:Reflect.get(Te(i,n)&&n in s?i:s,n,r)}const ia={get:In(!1,!1)},sa={get:In(!1,!0)},na={get:In(!0,!1)};const ro=new WeakMap,oo=new WeakMap,lo=new WeakMap,ra=new WeakMap;function oa(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ln(t){return Ft(t)?t:Dn(t,!1,Xl,ia,ro)}function la(t){return Dn(t,!1,Zl,sa,oo)}function un(t){return Dn(t,!0,Ql,na,lo)}function Dn(t,e,i,s,n){if(!Pe(t)||t.__v_raw&&!(e&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const r=n.get(t);if(r)return r;const o=oa(xl(t));if(o===0)return t;const l=new Proxy(t,o===2?s:i);return n.set(t,l),l}function si(t){return Ft(t)?si(t.__v_raw):!!(t&&t.__v_isReactive)}function Ft(t){return!!(t&&t.__v_isReadonly)}function ht(t){return!!(t&&t.__v_isShallow)}function Un(t){return t?!!t.__v_raw:!1}function Ce(t){const e=t&&t.__v_raw;return e?Ce(e):t}function aa(t){return!Te(t,"__v_skip")&&Object.isExtensible(t)&&Wr(t,"__v_skip",!0),t}const gt=t=>Pe(t)?Ln(t):t,ri=t=>Pe(t)?un(t):t;function it(t){return t?t.__v_isRef===!0:!1}function A(t){return ua(t,!1)}function ua(t,e){return it(t)?t:new ca(t,e)}class ca{constructor(e,i){this.dep=new Pn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?e:Ce(e),this._value=i?e:gt(e),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(e){const i=this._rawValue,s=this.__v_isShallow||ht(e)||Ft(e);e=s?e:Ce(e),Pt(e,i)&&(this._rawValue=e,this._value=s?e:gt(e),this.dep.trigger())}}function Ge(t){return it(t)?t.value:t}const da={get:(t,e,i)=>e==="__v_raw"?t:Ge(Reflect.get(t,e,i)),set:(t,e,i,s)=>{const n=t[e];return it(n)&&!it(i)?(n.value=i,!0):Reflect.set(t,e,i,s)}};function ao(t){return si(t)?t:new Proxy(t,da)}class fa{constructor(e,i,s){this.fn=e,this.setter=i,this._value=void 0,this.dep=new Pn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hi-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&De!==this)return Yr(this,!0),!0}get value(){const e=this.dep.track();return Qr(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ha(t,e,i=!1){let s,n;return me(t)?s=t:(s=t.get,n=t.set),new fa(s,n,i)}const ns={},hs=new WeakMap;let di;function pa(t,e=!1,i=di){if(i){let s=hs.get(i);s||hs.set(i,s=[]),s.push(t)}}function ga(t,e,i=Le){const{immediate:s,deep:n,once:r,scheduler:o,augmentJob:l,call:u}=i,d=x=>n?x:ht(x)||n===!1||n===0?Kt(x,1):Kt(x);let c,h,y,S,C=!1,T=!1;if(it(t)?(h=()=>t.value,C=ht(t)):si(t)?(h=()=>d(t),C=!0):de(t)?(T=!0,C=t.some(x=>si(x)||ht(x)),h=()=>t.map(x=>{if(it(x))return x.value;if(si(x))return d(x);if(me(x))return u?u(x,2):x()})):me(t)?e?h=u?()=>u(t,2):t:h=()=>{if(y){Dt();try{y()}finally{Ut()}}const x=di;di=c;try{return u?u(t,3,[S]):t(S)}finally{di=x}}:h=Lt,e&&n){const x=h,j=n===!0?1/0:n;h=()=>Kt(x(),j)}const P=Vl(),F=()=>{c.stop(),P&&P.active&&Tn(P.effects,c)};if(r&&e){const x=e;e=(...j)=>{try{return x(...j)}finally{F()}}}let D=T?new Array(t.length).fill(ns):ns;const re=x=>{if(!(!(c.flags&1)||!c.dirty&&!x))if(e){const j=c.run();if(x||n||C||(T?j.some((G,Z)=>Pt(G,D[Z])):Pt(j,D))){const G=di;Dt();try{y&&y(),di=c;const Z=[j,D===ns?void 0:T&&D[0]===ns?[]:D,S];D=j,u?u(e,3,Z):e(...Z)}finally{di=G,Ut()}}}else c.run()};return l&&l(re),c=new jr(h),c.scheduler=o?()=>o(re,!1):re,S=x=>pa(x,!1,c),y=c.onStop=()=>{const x=hs.get(c);if(x){if(u)u(x,4);else for(const j of x)j();hs.delete(c)}},e?s?re(!0):D=c.run():o?o(re.bind(null,!0),!0):c.run(),F.pause=c.pause.bind(c),F.resume=c.resume.bind(c),F.stop=F,F}function Kt(t,e=1/0,i){if(e<=0||!Pe(t)||t.__v_skip||(i=i||new Map,(i.get(t)||0)>=e))return t;if(i.set(t,e),e--,it(t))Kt(t.value,e,i);else if(de(t))for(let s=0;s{Kt(s,e,i)});else if(Hr(t)){for(const s in t)Kt(t[s],e,i);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&Kt(t[s],e,i)}return t}function Qi(t,e,i,s){try{return s?t(...s):t()}catch(n){Ds(n,e,i)}}function St(t,e,i,s){if(me(t)){const n=Qi(t,e,i,s);return n&&$r(n)&&n.catch(r=>{Ds(r,e,i)}),n}if(de(t)){const n=[];for(let r=0;r>>1,n=lt[s],r=Vi(n);r=Vi(i)?lt.push(t):lt.splice(va(e),0,t),t.flags|=1,co()}}function co(){ps||(ps=uo.then(po))}function ba(t){if(!de(t))Qt&&t.id===-1?Qt.splice(wi+1,0,t):t.flags&1||(Mt.push(t),t.flags|=1);else for(let e=0;e=e))continue;lt.splice(s,1),s=t?s-1:vt,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function ho(t,e,i=0){if(Mt.length){let s=Mt,n=0;if(e){s=[];for(let o=0;oVi(o)-Vi(l));if(Mt.length=n,Qt){for(let o=0;ot.id==null?t.flags&2?-1:1/0:t.id;function po(t){try{for(vt=0;vt{s._d&&yr(-1);const r=ms(e),o=jt.length;let l;try{l=t(...n)}finally{for(let u=jt.length;u>o;u--)Wn();ms(r),s._d&&yr(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function ae(t,e){if(Je===null)return t;const i=Hs(Je),s=t.dirs||(t.dirs=[]);for(let n=0;n1)return i&&me(e)?e.call(s&&s.proxy):e}}const Ea=Symbol.for("v-scx"),_a=()=>us(Ea);function st(t,e,i){return vo(t,e,i)}function vo(t,e,i=Le){const{immediate:s,deep:n,flush:r,once:o}=i,l=Ye({},i),u=e&&s||!e&&r!=="post";let d;if(ji){if(r==="sync"){const S=_a();d=S.__watcherHandles||(S.__watcherHandles=[])}else if(!u){const S=()=>{};return S.stop=Lt,S.resume=Lt,S.pause=Lt,S}}const c=tt;l.call=(S,C,T)=>St(S,c,C,T);let h=!1;r==="post"?l.scheduler=S=>{S.i=c,ot(S,c&&c.suspense)}:r!=="sync"&&(h=!0,l.scheduler=(S,C)=>{C?S():Fn(S)}),l.augmentJob=S=>{e&&(S.flags|=4),h&&(S.flags|=2,c&&(S.id=c.uid,S.i=c))};const y=ga(t,e,l);return ji&&(d?d.push(y):u&&y()),y}function Sa(t,e,i){const s=this.proxy,n=Fe(t)?t.includes(".")?bo(s,t):()=>s[t]:t.bind(s,s);let r;me(e)?r=e:(r=e.handler,i=e);const o=Zi(this),l=vo(n,r.bind(s),i);return o(),l}function bo(t,e){const i=e.split(".");return()=>{let s=t;for(let n=0;nt.__isTeleport,fi=t=>t&&(t.disabled||t.disabled===""),Ra=t=>t&&(t.defer||t.defer===""),or=t=>typeof SVGElement<"u"&&t instanceof SVGElement,lr=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,cn=(t,e)=>{const i=t&&t.to;return Fe(i)?e?e(i):null:i},Aa={name:"Teleport",__isTeleport:!0,process(t,e,i,s,n,r,o,l,u,d){const{mc:c,pc:h,pbc:y,o:{insert:S,querySelector:C,createText:T,createComment:P,parentNode:F}}=d,D=fi(e.props);let{dynamicChildren:re}=e;const x=(Z,ee,he)=>{Z.shapeFlag&16&&c(Z.children,ee,he,n,r,o,l,u)},j=(Z=e)=>{const ee=fi(Z.props),he=Z.target=cn(Z.props,C),te=dn(he,Z,T,S);he&&(o!=="svg"&&or(he)?o="svg":o!=="mathml"&&lr(he)&&(o="mathml"),n&&n.isCE&&(n.ce._teleportTargets||(n.ce._teleportTargets=new Set)).add(he),ee||(x(Z,he,te),xi(Z,!1)))},G=Z=>{const ee=()=>{if(Xt.get(Z)===ee){if(Xt.delete(Z),fi(Z.props)){const he=F(Z.el)||i;x(Z,he,Z.anchor),xi(Z,!0)}j(Z)}};Xt.set(Z,ee),ot(ee,r)};if(t==null){const Z=e.el=T(""),ee=e.anchor=T("");if(S(Z,i,s),S(ee,i,s),Ra(e.props)||r&&r.pendingBranch){G(e);return}D&&(x(e,i,ee),xi(e,!0)),j()}else{e.el=t.el;const Z=e.anchor=t.anchor,ee=Xt.get(t);if(ee){ee.flags|=8,Xt.delete(t),G(e);return}e.targetStart=t.targetStart;const he=e.target=t.target,te=e.targetAnchor=t.targetAnchor,I=fi(t.props),se=I?i:he,ke=I?Z:te;if(o==="svg"||or(he)?o="svg":(o==="mathml"||lr(he))&&(o="mathml"),re?(y(t.dynamicChildren,re,se,n,r,o,l),Hn(t,e,!0)):u||h(t,e,se,ke,n,r,o,l,!1),D)I?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):rs(e,i,Z,d,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const ue=cn(e.props,C);ue&&(e.target=ue,rs(e,ue,null,d,0))}else I&&rs(e,he,te,d,1);xi(e,D)}},remove(t,e,i,{um:s,o:{remove:n}},r){const{shapeFlag:o,children:l,anchor:u,targetStart:d,targetAnchor:c,target:h,props:y}=t,S=fi(y),C=r||!S,T=Xt.get(t);if(T&&(T.flags|=8,Xt.delete(t)),h&&(n(d),n(c)),r&&n(u),!T&&(S||h)&&o&16)for(let P=0;P1){for(const i of t)if(i.type!==mt){e=i;break}}return e}function Eo(t){if(!Bn(t))return Us(t.type)&&t.children?Ta(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&me(i.default))return i.default()}}function vs(t,e){if(t.shapeFlag&6&&t.component){t.transition=e;const i=t.component.subTree;vs(Us(i.type)&&Eo(i)||i,e)}else if(t.shapeFlag&128)t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback);else if(t.transition=e,t.type===K&&de(t.children)){const i=Mo(t.children,!1);i&&vs(i,e)}}function fn(t){if(t.component)return fn(t.component.subTree);if(t.type===K){const e=de(t.children)&&Mo(t.children,!1);return e?fn(e):void 0}if(t.type!==mt)return t}function He(t,e){return me(t)?Ye({name:t.name},e,{setup:t}):t}function _o(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function ar(t,e){let i;return!!((i=Object.getOwnPropertyDescriptor(t,e))&&!i.configurable)}const bs=new WeakMap;function Fi(t,e,i,s,n=!1){if(de(t)){t.forEach((T,P)=>Fi(T,e&&(de(e)?e[P]:e),i,s,n));return}if(_i(s)&&!n){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Fi(t,e,i,s.component.subTree);return}const r=s.shapeFlag&4?Hs(s.component):s.el,o=n?null:r,{i:l,r:u}=t,d=e&&e.r,c=l.refs===Le?l.refs={}:l.refs,h=l.setupState,y=Ce(h),S=h===Le?Br:T=>ar(c,T)?!1:Te(y,T),C=(T,P)=>!(P&&ar(c,P));if(d!=null&&d!==u){if(ur(e),Fe(d))c[d]=null,S(d)&&(h[d]=null);else if(it(d)){const T=e;C(d,T.k)&&(d.value=null),T.k&&(c[T.k]=null)}}if(me(u))Qi(u,l,12,[o,c]);else{const T=Fe(u),P=it(u);if(T||P){const F=()=>{if(t.f){const D=T?S(u)?h[u]:c[u]:C()||!t.k?u.value:c[t.k];if(n)de(D)&&Tn(D,r);else if(de(D))D.includes(r)||D.push(r);else if(T)c[u]=[r],S(u)&&(h[u]=c[u]);else{const re=[r];C(u,t.k)&&(u.value=re),t.k&&(c[t.k]=re)}}else T?(c[u]=o,S(u)&&(h[u]=o)):P&&(C(u,t.k)&&(u.value=o),t.k&&(c[t.k]=o))};if(o){const D=()=>{F(),bs.delete(t)};D.id=-1,bs.set(t,D),ot(D,i)}else ur(t),F()}}}function ur(t){const e=bs.get(t);e&&(e.flags|=8,bs.delete(t))}Is().requestIdleCallback;Is().cancelIdleCallback;const _i=t=>!!t.type.__asyncLoader,Bn=t=>t.type.__isKeepAlive;function Ca(t,e){So(t,"a",e)}function Na(t,e){So(t,"da",e)}function So(t,e,i=tt){const s=t.__wdc||(t.__wdc=()=>{let n=i;for(;n;){if(n.isDeactivated)return;n=n.parent}return t()});if(Fs(e,s,i),i){let n=i.parent;for(;n&&n.parent;)Bn(n.parent.vnode)&&Oa(s,e,i,n),n=n.parent}}function Oa(t,e,i,s){const n=Fs(e,t,s,!0);Ro(()=>{Tn(s[e],n)},i)}function Fs(t,e,i=tt,s=!1){if(i){const n=i[t]||(i[t]=[]),r=e.__weh||(e.__weh=(...o)=>{Dt();const l=Zi(i),u=St(e,i,t,o);return l(),Ut(),u});return s?n.unshift(r):n.push(r),r}}const qt=t=>(e,i=tt)=>{(!ji||t==="sp")&&Fs(t,(...s)=>e(...s),i)},Ma=qt("bm"),li=qt("m"),xa=qt("bu"),Pa=qt("u"),vi=qt("bum"),Ro=qt("um"),Ia=qt("sp"),La=qt("rtg"),Da=qt("rtc");function Ua(t,e=tt){Fs("ec",t,e)}const Fa="components";function Ao(t,e){return $a(Fa,t,!0,e)||t}const Ba=Symbol.for("v-ndc");function $a(t,e,i=!0,s=!1){const n=Je||tt;if(n){const r=n.type;{const l=Au(r,!1);if(l&&(l===e||l===at(e)||l===xs(at(e))))return r}const o=cr(n[t]||r[t],e)||cr(n.appContext[t],e);return!o&&s?r:o}}function cr(t,e){return t&&(t[e]||t[at(e)]||t[xs(at(e))])}function ge(t,e,i,s){let n;const r=i,o=de(t);if(o||Fe(t)){const l=o&&si(t);let u=!1,d=!1;l&&(u=!ht(t),d=Ft(t),t=Ls(t)),n=new Array(t.length);for(let c=0,h=t.length;ce(l,u,void 0,r));else{const l=Object.keys(t);n=new Array(l.length);for(let u=0,d=l.length;u0;return g(),Ue(K,null,[pt("slot",d,s)],c?-2:64)}let o=t[e];o&&o._c&&(o._d=!1);const l=jt.length;g();let u;try{const d=o&&ko(o(i)),c=i.key||r||d&&d.key;u=Ue(K,{key:(c&&!_t(c)?c:`_${e}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&t._===1?64:-2)}catch(d){for(let c=jt.length;c>l;c--)Wn();throw d}finally{o&&o._c&&(o._d=!0)}return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),u}function ko(t){return t.some(e=>zs(e)?!(e.type===mt||e.type===K&&!ko(e.children)):!0)?t:null}const hn=t=>t?jo(t)?Hs(t):hn(t.parent):null,Bi=Ye(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>hn(t.parent),$root:t=>hn(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Co(t),$forceUpdate:t=>t.f||(t.f=()=>{Fn(t.update)}),$nextTick:t=>t.n||(t.n=gs.bind(t.proxy)),$watch:t=>Sa.bind(t)}),Xs=(t,e)=>t!==Le&&!t.__isScriptSetup&&Te(t,e),Ha={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:s,data:n,props:r,accessCache:o,type:l,appContext:u}=t;if(e[0]!=="$"){const y=o[e];if(y!==void 0)switch(y){case 1:return s[e];case 2:return n[e];case 4:return i[e];case 3:return r[e]}else{if(Xs(s,e))return o[e]=1,s[e];if(n!==Le&&Te(n,e))return o[e]=2,n[e];if(Te(r,e))return o[e]=3,r[e];if(i!==Le&&Te(i,e))return o[e]=4,i[e];pn&&(o[e]=0)}}const d=Bi[e];let c,h;if(d)return e==="$attrs"&&et(t.attrs,"get",""),d(t);if((c=l.__cssModules)&&(c=c[e]))return c;if(i!==Le&&Te(i,e))return o[e]=4,i[e];if(h=u.config.globalProperties,Te(h,e))return h[e]},set({_:t},e,i){const{data:s,setupState:n,ctx:r}=t;return Xs(n,e)?(n[e]=i,!0):s!==Le&&Te(s,e)?(s[e]=i,!0):Te(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:s,appContext:n,props:r,type:o}},l){let u;return!!(i[l]||t!==Le&&l[0]!=="$"&&Te(t,l)||Xs(e,l)||Te(r,l)||Te(s,l)||Te(Bi,l)||Te(n.config.globalProperties,l)||(u=o.__cssModules)&&u[l])},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:Te(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function dr(t){return de(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}let pn=!0;function Wa(t){const e=Co(t),i=t.proxy,s=t.ctx;pn=!1,e.beforeCreate&&fr(e.beforeCreate,t,"bc");const{data:n,computed:r,methods:o,watch:l,provide:u,inject:d,created:c,beforeMount:h,mounted:y,beforeUpdate:S,updated:C,activated:T,deactivated:P,beforeDestroy:F,beforeUnmount:D,destroyed:re,unmounted:x,render:j,renderTracked:G,renderTriggered:Z,errorCaptured:ee,serverPrefetch:he,expose:te,inheritAttrs:I,components:se,directives:ke,filters:ue}=e;if(d&&Va(d,s,null),o)for(const _e in o){const ye=o[_e];me(ye)&&(s[_e]=ye.bind(i))}if(n){const _e=n.call(i,i);Pe(_e)&&(t.data=Ln(_e))}if(pn=!0,r)for(const _e in r){const ye=r[_e],We=me(ye)?ye.bind(i,i):me(ye.get)?ye.get.bind(i,i):Lt,qe=!me(ye)&&me(ye.set)?ye.set.bind(i):Lt,X=ie({get:We,set:qe});Object.defineProperty(s,_e,{enumerable:!0,configurable:!0,get:()=>X.value,set:V=>X.value=V})}if(l)for(const _e in l)To(l[_e],s,i,_e);if(u){const _e=me(u)?u.call(i):u;Reflect.ownKeys(_e).forEach(ye=>{wa(ye,_e[ye])})}c&&fr(c,t,"c");function q(_e,ye){de(ye)?ye.forEach(We=>_e(We.bind(i))):ye&&_e(ye.bind(i))}if(q(Ma,h),q(li,y),q(xa,S),q(Pa,C),q(Ca,T),q(Na,P),q(Ua,ee),q(Da,G),q(La,Z),q(vi,D),q(Ro,x),q(Ia,he),de(te))if(te.length){const _e=t.exposed||(t.exposed={});te.forEach(ye=>{Object.defineProperty(_e,ye,{get:()=>i[ye],set:We=>i[ye]=We,enumerable:!0})})}else t.exposed||(t.exposed={});j&&t.render===Lt&&(t.render=j),I!=null&&(t.inheritAttrs=I),se&&(t.components=se),ke&&(t.directives=ke),he&&_o(t)}function Va(t,e,i=Lt){de(t)&&(t=gn(t));for(const s in t){const n=t[s];let r;Pe(n)?"default"in n?r=us(n.from||s,n.default,!0):r=us(n.from||s):r=us(n),it(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function fr(t,e,i){St(de(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,i)}function To(t,e,i,s){let n=s.includes(".")?bo(i,s):()=>i[s];if(Fe(t)){const r=e[t];me(r)&&st(n,r)}else if(me(t))st(n,t.bind(i));else if(Pe(t))if(de(t))t.forEach(r=>To(r,e,i,s));else{const r=me(t.handler)?t.handler.bind(i):e[t.handler];me(r)&&st(n,r,t)}}function Co(t){const e=t.type,{mixins:i,extends:s}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,l=r.get(e);let u;return l?u=l:!n.length&&!i&&!s?u=e:(u={},n.length&&n.forEach(d=>ys(u,d,o,!0)),ys(u,e,o)),Pe(e)&&r.set(e,u),u}function ys(t,e,i,s=!1){const{mixins:n,extends:r}=e;r&&ys(t,r,i,!0),n&&n.forEach(o=>ys(t,o,i,!0));for(const o in e)if(!(s&&o==="expose")){const l=Ka[o]||i&&i[o];t[o]=l?l(t[o],e[o]):e[o]}return t}const Ka={data:hr,props:pr,emits:pr,methods:Pi,computed:Pi,beforeCreate:rt,created:rt,beforeMount:rt,mounted:rt,beforeUpdate:rt,updated:rt,beforeDestroy:rt,beforeUnmount:rt,destroyed:rt,unmounted:rt,activated:rt,deactivated:rt,errorCaptured:rt,serverPrefetch:rt,components:Pi,directives:Pi,watch:ja,provide:hr,inject:Ga};function hr(t,e){return e?t?function(){return Ye(me(t)?t.call(this,this):t,me(e)?e.call(this,this):e)}:e:t}function Ga(t,e){return Pi(gn(t),gn(e))}function gn(t){if(de(t)){const e={};for(let i=0;ie==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${at(e)}Modifiers`]||t[`${mi(e)}Modifiers`];function Xa(t,e,...i){if(t.isUnmounted)return;const s=t.vnode.props||Le;let n=i;const r=e.startsWith("update:"),o=r&&qa(s,e.slice(7));o&&(o.trim&&(n=i.map(c=>Fe(c)?c.trim():c)),o.number&&(n=n.map(Ps)));let l,u=s[l=Vs(e)]||s[l=Vs(at(e))];!u&&r&&(u=s[l=Vs(mi(e))]),u&&St(u,t,6,n);const d=s[l+"Once"];if(d){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,St(d,t,6,n)}}const Qa=new WeakMap;function Oo(t,e,i=!1){const s=i?Qa:e.emitsCache,n=s.get(t);if(n!==void 0)return n;const r=t.emits;let o={},l=!1;if(!me(t)){const u=d=>{const c=Oo(d,e,!0);c&&(l=!0,Ye(o,c))};!i&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}return!r&&!l?(Pe(t)&&s.set(t,null),null):(de(r)?r.forEach(u=>o[u]=null):Ye(o,r),Pe(t)&&s.set(t,o),o)}function Bs(t,e){return!t||!Ns(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),Te(t,e[0].toLowerCase()+e.slice(1))||Te(t,mi(e))||Te(t,e))}function gr(t){const{type:e,vnode:i,proxy:s,withProxy:n,propsOptions:[r],slots:o,attrs:l,emit:u,render:d,renderCache:c,props:h,data:y,setupState:S,ctx:C,inheritAttrs:T}=t,P=ms(t);let F,D;try{if(i.shapeFlag&4){const x=n||s,j=x;F=xt(d.call(j,x,c,h,S,y,C)),D=l}else{const x=e;F=xt(x.length>1?x(h,{attrs:l,slots:o,emit:u}):x(h,null)),D=e.props?l:Za(l)}}catch(x){jt.length=0,Ds(x,t,1),F=pt(mt)}let re=F;if(D&&T!==!1){const x=Object.keys(D),{shapeFlag:j}=re;x.length&&j&7&&(r&&x.some(Os)&&(D=eu(D,r)),re=Ri(re,D,!1,!0))}if(i.dirs&&(re=Ri(re,null,!1,!0),re.dirs=re.dirs?re.dirs.concat(i.dirs):i.dirs),i.transition){const x=Us(re.type)&&Eo(re)||re;vs(x,i.transition)}return F=re,ms(P),F}function Mo(t,e=!0){let i;for(let s=0;s{let e;for(const i in t)(i==="class"||i==="style"||Ns(i))&&((e||(e={}))[i]=t[i]);return e},eu=(t,e)=>{const i={};for(const s in t)(!Os(s)||!(s.slice(9)in e))&&(i[s]=t[s]);return i};function tu(t,e,i){const{props:s,children:n,component:r}=t,{props:o,children:l,patchFlag:u}=e,d=r.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&u>=0){if(u&1024)return!0;if(u&16)return s?mr(s,o,d):!!o;if(u&8){const c=e.dynamicProps;for(let h=0;hObject.create(Po),Lo=t=>Object.getPrototypeOf(t)===Po;function su(t,e,i,s=!1){const n={},r=Io();t.propsDefaults=Object.create(null),Do(t,e,n,r);for(const o in t.propsOptions[0])o in n||(n[o]=void 0);i?t.props=s?n:la(n):t.type.props?t.props=n:t.props=r,t.attrs=r}function nu(t,e,i,s){const{props:n,attrs:r,vnode:{patchFlag:o}}=t,l=Ce(n),[u]=t.propsOptions;let d=!1;if((s||o>0)&&!(o&16)){if(o&8){const c=t.vnode.dynamicProps;for(let h=0;h{u=!0;const[y,S]=Uo(h,e,!0);Ye(o,y),S&&l.push(...S)};!i&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}if(!r&&!u)return Pe(t)&&s.set(t,pi),pi;if(de(r))for(let c=0;ct==="_"||t==="_ctx"||t==="$stable",zn=t=>de(t)?t.map(xt):[xt(t)],ou=(t,e,i)=>{if(e._n)return e;const s=mo((...n)=>zn(e(...n)),i);return s._c=!1,s},Fo=(t,e,i)=>{const s=t._ctx;for(const n in t){if($n(n))continue;const r=t[n];if(me(r))e[n]=ou(n,r,s);else if(r!=null){const o=zn(r);e[n]=()=>o}}},Bo=(t,e)=>{const i=zn(e);t.slots.default=()=>i},$o=(t,e,i)=>{for(const s in e)(i||!$n(s))&&(t[s]=e[s])},lu=(t,e,i)=>{const s=t.slots=Io();if(t.vnode.shapeFlag&32){const n=e._;n?($o(s,e,i),i&&Wr(s,"_",n,!0)):Fo(e,s)}else e&&Bo(t,e)},au=(t,e,i)=>{const{vnode:s,slots:n}=t;let r=!0,o=Le;if(s.shapeFlag&32){const l=e._;l?i&&l===1?r=!1:$o(n,e,i):(r=!e.$stable,Fo(e,n)),o=e}else e&&(Bo(t,e),o={default:1});if(r)for(const l in n)!$n(l)&&o[l]==null&&delete n[l]},ot=hu;function uu(t){return cu(t)}function cu(t,e){const i=Is();i.__VUE__=!0;const{insert:s,remove:n,patchProp:r,createElement:o,createText:l,createComment:u,setText:d,setElementText:c,parentNode:h,nextSibling:y,setScopeId:S=Lt,insertStaticContent:C}=t,T=(p,b,O,B=null,L=null,U=null,W=void 0,H=null,k=!!b.dynamicChildren)=>{if(p===b)return;p&&!Oi(p,b)&&(B=Ve(p),V(p,L,U,!0),p=null),b.patchFlag===-2&&(k=!1,b.dynamicChildren=null),b.dynamicChildren&&p&&p.dynamicChildren&&p.dynamicChildren.hasOnce&&(b.dynamicChildren===pi&&(b.dynamicChildren=[]),b.dynamicChildren.hasOnce=!0);const{type:v,ref:R,shapeFlag:M}=b;switch(v){case $s:P(p,b,O,B);break;case mt:F(p,b,O,B);break;case cs:p==null&&D(b,O,B,W);break;case K:se(p,b,O,B,L,U,W,H,k);break;default:M&1?j(p,b,O,B,L,U,W,H,k):M&6?ke(p,b,O,B,L,U,W,H,k):(M&64||M&128)&&v.process(p,b,O,B,L,U,W,H,k,Xe)}R!=null&&L?Fi(R,p&&p.ref,U,b||p,!b):R==null&&p&&p.ref!=null&&Fi(p.ref,null,U,p,!0)},P=(p,b,O,B)=>{if(p==null)s(b.el=l(b.children),O,B);else{const L=b.el=p.el;b.children!==p.children&&d(L,b.children)}},F=(p,b,O,B)=>{p==null?s(b.el=u(b.children||""),O,B):b.el=p.el},D=(p,b,O,B)=>{[p.el,p.anchor]=C(p.children,b,O,B,p.el,p.anchor)},re=({el:p,anchor:b},O,B)=>{let L;for(;p&&p!==b;)L=y(p),s(p,O,B),p=L;s(b,O,B)},x=({el:p,anchor:b})=>{let O;for(;p&&p!==b;)O=y(p),n(p),p=O;n(b)},j=(p,b,O,B,L,U,W,H,k)=>{if(b.type==="svg"?W="svg":b.type==="math"&&(W="mathml"),p==null)G(b,O,B,L,U,W,H,k);else{const v=p.el&&p.el._isVueCE?p.el:null;try{v&&v._beginPatch(),he(p,b,L,U,W,H,k)}finally{v&&v._endPatch()}}},G=(p,b,O,B,L,U,W,H)=>{let k,v;const{props:R,shapeFlag:M,transition:J,dirs:fe}=p;if(k=p.el=o(p.type,U,R&&R.is,R),M&8?c(k,p.children):M&16&&ee(p.children,k,null,B,L,Qs(p,U),W,H),fe&&ui(p,null,B,"created"),Z(k,p,p.scopeId,W,B),R){for(const pe in R)pe!=="value"&&!Li(pe)&&r(k,pe,null,R[pe],U,B);"value"in R&&r(k,"value",null,R.value,U),(v=R.onVnodeBeforeMount)&&Nt(v,B,p)}fe&&ui(p,null,B,"beforeMount");const we=du(L,J);we&&J.beforeEnter(k),s(k,b,O),((v=R&&R.onVnodeMounted)||we||fe)&&ot(()=>{v&&Nt(v,B,p),we&&J.enter(k),fe&&ui(p,null,B,"mounted")},L)},Z=(p,b,O,B,L)=>{if(O&&S(p,O),B)for(let U=0;U{for(let v=k;v{const H=b.el=p.el;let{patchFlag:k,dynamicChildren:v,dirs:R}=b;k|=p.patchFlag&16;const M=p.props||Le,J=b.props||Le;let fe;if(O&&ci(O,!1),(fe=J.onVnodeBeforeUpdate)&&Nt(fe,O,b,p),R&&ui(b,p,O,"beforeUpdate"),O&&ci(O,!0),v&&(!p.dynamicChildren||p.dynamicChildren.length!==v.length)&&(k=0,W=!1,v=null),(M.innerHTML&&J.innerHTML==null||M.textContent&&J.textContent==null)&&c(H,""),v?te(p.dynamicChildren,v,H,O,B,Qs(b,L),U):W||ye(p,b,H,null,O,B,Qs(b,L),U,!1),k>0){if(k&16)I(H,M,J,O,L);else if(k&2&&M.class!==J.class&&r(H,"class",null,J.class,L),k&4&&r(H,"style",M.style,J.style,L),k&8){const we=b.dynamicProps;for(let pe=0;pe{fe&&Nt(fe,O,b,p),R&&ui(b,p,O,"updated")},B)},te=(p,b,O,B,L,U,W)=>{for(let H=0;H{if(b!==O){if(b!==Le)for(const U in b)!Li(U)&&!(U in O)&&r(p,U,b[U],null,L,B);for(const U in O){if(Li(U))continue;const W=O[U],H=b[U];W!==H&&U!=="value"&&r(p,U,H,W,L,B)}"value"in O&&r(p,"value",b.value,O.value,L)}},se=(p,b,O,B,L,U,W,H,k)=>{const v=b.el=p?p.el:l(""),R=b.anchor=p?p.anchor:l("");let{patchFlag:M,dynamicChildren:J,slotScopeIds:fe}=b;fe&&(H=H?H.concat(fe):fe),p==null?(s(v,O,B),s(R,O,B),ee(b.children||[],O,R,L,U,W,H,k)):M>0&&M&64&&J&&p.dynamicChildren&&p.dynamicChildren.length===J.length?(te(p.dynamicChildren,J,O,L,U,W,H),(b.key!=null||L&&b===L.subTree)&&Hn(p,b,!0)):ye(p,b,O,R,L,U,W,H,k)},ke=(p,b,O,B,L,U,W,H,k)=>{b.slotScopeIds=H,p==null?b.shapeFlag&512?L.ctx.activate(b,O,B,W,k):ue(b,O,B,L,U,W,k):ne(p,b,k)},ue=(p,b,O,B,L,U,W)=>{const H=p.component=yu(p,B,L);if(Bn(p)&&(H.ctx.renderer=Xe),Eu(H,!1,W),H.asyncDep){if(L&&L.registerDep(H,q,W,U),!p.el){const k=H.subTree=pt(mt);F(null,k,b,O),p.placeholder=k.el}}else q(H,p,b,O,L,U,W)},ne=(p,b,O)=>{const B=b.component=p.component;if(tu(p,b,O))if(B.asyncDep&&!B.asyncResolved){b.el=p.el,b.placeholder=p.placeholder,_e(B,b,O);return}else B.next=b,B.update();else b.el=p.el,b.placeholder=p.placeholder,B.vnode=b},q=(p,b,O,B,L,U,W)=>{const H=()=>{if(p.isMounted){let{next:M,bu:J,u:fe,parent:we,vnode:pe}=p;{const Qe=zo(p);if(Qe){M&&(M.el=pe.el,_e(p,M,W)),Qe.asyncDep.then(()=>{ot(()=>{p.isUnmounted||v()},L)});return}}let Ee=M,Se;ci(p,!1),M?(M.el=pe.el,_e(p,M,W)):M=pe,J&&as(J),(Se=M.props&&M.props.onVnodeBeforeUpdate)&&Nt(Se,we,M,pe),ci(p,!0);const $e=gr(p),ze=p.subTree;p.subTree=$e,T(ze,$e,h(ze.el),Ve(ze),p,L,U),M.el=$e.el,Ee===null&&iu(p,$e.el),fe&&ot(fe,L),(Se=M.props&&M.props.onVnodeUpdated)&&ot(()=>Nt(Se,we,M,pe),L)}else{let M;const{el:J,props:fe}=b,{bm:we,m:pe,parent:Ee,root:Se,type:$e}=p,ze=_i(b);ci(p,!1),we&&as(we),!ze&&(M=fe&&fe.onVnodeBeforeMount)&&Nt(M,Ee,b),ci(p,!0);{Se.ce&&Se.ce._hasShadowRoot()&&Se.ce._injectChildStyle($e,p.parent?p.parent.type:void 0);const Qe=p.subTree=gr(p);T(null,Qe,O,B,p,L,U),b.el=Qe.el}if(pe&&ot(pe,L),!ze&&(M=fe&&fe.onVnodeMounted)){const Qe=b;ot(()=>Nt(M,Ee,Qe),L)}(b.shapeFlag&256||Ee&&_i(Ee.vnode)&&Ee.vnode.shapeFlag&256)&&p.a&&ot(p.a,L),p.isMounted=!0,b=O=B=null}};p.scope.on();const k=p.effect=new jr(H);p.scope.off();const v=p.update=k.run.bind(k),R=p.job=k.runIfDirty.bind(k);R.i=p,R.id=p.uid,k.scheduler=()=>Fn(R),ci(p,!0),v()},_e=(p,b,O)=>{b.component=p;const B=p.vnode.props;p.vnode=b,p.next=null,nu(p,b.props,B,O),au(p,b.children,O),Dt(),fo(p),Ut()},ye=(p,b,O,B,L,U,W,H,k=!1)=>{const v=p&&p.children,R=p?p.shapeFlag:0,M=b.children,{patchFlag:J,shapeFlag:fe}=b;if(J>0){if(J&128){qe(v,M,O,B,L,U,W,H,k);return}else if(J&256){We(v,M,O,B,L,U,W,H,k);return}}fe&8?(R&16&&z(v,L,U),M!==v&&c(O,M)):R&16?fe&16?qe(v,M,O,B,L,U,W,H,k):z(v,L,U,!0):(R&8&&c(O,""),fe&16&&ee(M,O,B,L,U,W,H,k))},We=(p,b,O,B,L,U,W,H,k)=>{p=p||pi,b=b||pi;const v=p.length,R=b.length,M=Math.min(v,R);let J;for(J=0;JR?z(p,L,U,!0,!1,M):ee(b,O,B,L,U,W,H,k,M)},qe=(p,b,O,B,L,U,W,H,k)=>{let v=0;const R=b.length;let M=p.length-1,J=R-1;for(;v<=M&&v<=J;){const fe=p[v],we=b[v]=k?Wt(b[v]):xt(b[v]);if(Oi(fe,we))T(fe,we,O,null,L,U,W,H,k);else break;v++}for(;v<=M&&v<=J;){const fe=p[M],we=b[J]=k?Wt(b[J]):xt(b[J]);if(Oi(fe,we))T(fe,we,O,null,L,U,W,H,k);else break;M--,J--}if(v>M){if(v<=J){const fe=J+1,we=feJ)for(;v<=M;)V(p[v],L,U,!0),v++;else{const fe=v,we=v,pe=new Map;for(v=we;v<=J;v++){const Re=b[v]=k?Wt(b[v]):xt(b[v]);Re.key!=null&&pe.set(Re.key,v)}let Ee,Se=0;const $e=J-we+1;let ze=!1,Qe=0;const At=new Array($e);for(v=0;v<$e;v++)At[v]=0;for(v=fe;v<=M;v++){const Re=p[v];if(Se>=$e){V(Re,L,U,!0);continue}let ve;if(Re.key!=null)ve=pe.get(Re.key);else for(Ee=we;Ee<=J;Ee++)if(At[Ee-we]===0&&Oi(Re,b[Ee])){ve=Ee;break}ve===void 0?V(Re,L,U,!0):(At[ve-we]=v+1,ve>=Qe?Qe=ve:ze=!0,T(Re,b[ve],O,null,L,U,W,H,k),Se++)}const ai=ze?fu(At):pi;for(Ee=ai.length-1,v=$e-1;v>=0;v--){const Re=we+v,ve=b[Re],kt=b[Re+1],Tt=Re+1{const{el:U,type:W,transition:H,children:k,shapeFlag:v}=p;if(v&6){X(p.component.subTree,b,O,B);return}if(v&128){p.suspense.move(b,O,B);return}if(v&64){W.move(p,b,O,Xe);return}if(W===K){s(U,b,O);for(let M=0;MH.enter(U),L));else{const{leave:M,delayLeave:J,afterLeave:fe}=H,we=()=>{p.ctx.isUnmounted?n(U):s(U,b,O)},pe=()=>{const Ee=U._isLeaving||!!U[qs];U._isLeaving&&U[qs](!0),H.persisted&&!Ee?we():M(U,()=>{we(),fe&&fe()})};J?J(U,we,pe):pe()}else s(U,b,O)},V=(p,b,O,B=!1,L=!1)=>{const{type:U,props:W,ref:H,children:k,dynamicChildren:v,shapeFlag:R,patchFlag:M,dirs:J,cacheIndex:fe,memo:we}=p;if((M===-2||v&&v.hasOnce)&&(L=!1),H!=null&&(Dt(),Fi(H,null,O,p,!0),Ut()),fe!=null&&(!p.ctx||p.ctx===b)&&(b.renderCache[fe]=void 0),R&256){b.ctx.deactivate(p);return}const pe=R&1&&J,Ee=!_i(p);let Se;if(Ee&&(Se=W&&W.onVnodeBeforeUnmount)&&Nt(Se,b,p),R&6)Oe(p.component,O,B);else{if(R&128){p.suspense.unmount(O,B);return}pe&&ui(p,null,b,"beforeUnmount"),R&64?p.type.remove(p,b,O,Xe,B):v&&!v.hasOnce&&(U!==K||M>0&&M&64)?z(v,b,O,!1,!0):(U===K&&M&384||!L&&R&16)&&z(k,b,O),B&&oe(p)}const $e=we!=null&&fe==null;(Ee&&(Se=W&&W.onVnodeUnmounted)||pe||$e)&&ot(()=>{Se&&Nt(Se,b,p),pe&&ui(p,null,b,"unmounted"),$e&&(p.el=null)},O)},oe=p=>{const{type:b,el:O,anchor:B,transition:L}=p,U=b===K;if(U&&!L){Be(O,B);return}if(b===cs){x(p),L&&!L.persisted&&L.afterLeave&&L.afterLeave();return}const W=U?fn(p):p,H=()=>{U?h(O)&&Be(O,B):n(O),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(W&&W.shapeFlag&1&&L&&!L.persisted){const{leave:k,delayLeave:v}=L,R=W.el,M=()=>k(R,H);v?v(R,H,M):M()}else H()},Be=(p,b)=>{let O;for(;p!==b;)O=y(p),n(p),p=O;n(b)},Oe=(p,b,O)=>{const{bum:B,scope:L,job:U,subTree:W,um:H,m:k,a:v}=p;br(k),br(v),B&&as(B),L.stop(),U?(U.flags|=8,V(W,p,b,O)):p.vnode.el&&W&&(W.transition=p.vnode.transition,V(W,p,b,O)),H&&ot(H,b),ot(()=>{p.isUnmounted=!0},b)},z=(p,b,O,B=!1,L=!1,U=0)=>{for(let W=U;W{if(p.shapeFlag&6)return Ve(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const b=y(p.anchor||p.el),O=b&&b[yo];return O?y(O):b},Ie=(p,b,O)=>{const B=p&&b._vnode?void 0:p&&p.component?p.component.uid:bu();ya(()=>{p==null?b._vnode&&V(b._vnode,null,null,!0):T(b._vnode||null,p,b,null,null,null,O),b._vnode=p},B)},Xe={p:T,um:V,m:X,r:oe,mt:ue,mc:ee,pc:ye,pbc:te,n:Ve,o:t};return{render:Ie,hydrate:void 0,createApp:Ya(Ie)}}function Qs({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function ci({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function du(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Hn(t,e,i=!1){const s=t.children,n=e.children;if(de(s)&&de(n))for(let r=0;r>1,t[i[l]]0&&(e[s]=i[r-1]),i[r]=s)}}for(r=i.length,o=i[r-1];r-- >0;)i[r]=o,o=e[o];return i}function zo(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:zo(e)}function br(t){if(t)for(let e=0;et.__isSuspense;function hu(t,e){e&&e.pendingBranch?de(t)?e.effects.push(...t):e.effects.push(t):ba(t)}const K=Symbol.for("v-fgt"),$s=Symbol.for("v-txt"),mt=Symbol.for("v-cmt"),cs=Symbol.for("v-stc"),jt=[];let dt=null;function g(t=!1){jt.push(dt=t?null:[])}function Wn(){jt.pop(),dt=jt[jt.length-1]||null}let Ki=1;function yr(t,e=!1){Ki+=t,t<0&&dt&&e&&(dt.hasOnce=!0)}function Wo(t){return t.dynamicChildren=Ki>0?dt||pi:null,Wn(),Ki>0&&dt&&dt.push(t),t}function m(t,e,i,s,n,r){return Wo(a(t,e,i,s,n,r,!0))}function Ue(t,e,i,s,n){return Wo(pt(t,e,i,s,n,!0))}function zs(t){return t?t.__v_isVNode===!0:!1}function Oi(t,e){return t.type===e.type&&t.key===e.key}const Vo=({key:t})=>t??null,ds=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?Fe(t)||it(t)||me(t)?{i:Je,r:t,k:e,f:!!i}:t:null);function a(t,e=null,i=null,s=0,n=null,r=t===K?0:1,o=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Vo(e),ref:e&&ds(e),scopeId:go,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Je};return l?(ws(u,i),r&128&&t.normalize(u)):i&&(u.shapeFlag|=Fe(i)?8:16),Ki>0&&!o&&dt&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&dt.push(u),u}const pt=pu;function pu(t,e=null,i=null,s=0,n=null,r=!1){if((!t||t===Ba)&&(t=mt),zs(t)){const l=Ri(t,e,!0);return i&&ws(l,i),Ki>0&&!r&&dt&&(l.shapeFlag&6?dt[dt.indexOf(t)]=l:dt.push(l)),l.patchFlag=-2,l}if(ku(t)&&(t=t.__vccOpts),e){e=gu(e);let{class:l,style:u}=e;l&&!Fe(l)&&(e.class=xe(l)),Pe(u)&&(Un(u)&&!de(u)&&(u=Ye({},u)),e.style=bt(u))}const o=Fe(t)?1:Ho(t)?128:Us(t)?64:Pe(t)?4:me(t)?2:0;return a(t,e,i,s,n,o,r,!0)}function gu(t){return t?Un(t)||Lo(t)?Ye({},t):t:null}function Ri(t,e,i=!1,s=!1){const{props:n,ref:r,patchFlag:o,children:l,transition:u}=t,d=e?mu(n||{},e):n,c={__v_isVNode:!0,__v_skip:!0,type:t.type,props:d,key:d&&Vo(d),ref:e&&e.ref?i&&r?de(r)?r.concat(ds(e)):[r,ds(e)]:ds(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==K?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:u,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ri(t.ssContent),ssFallback:t.ssFallback&&Ri(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce,cacheIndex:t.cacheIndex};return u&&s&&vs(c,u.clone(c)),c}function Q(t=" ",e=0){return pt($s,null,t,e)}function Ko(t,e){const i=pt(cs,null,t);return i.staticCount=e,i}function $(t="",e=!1){return e?(g(),Ue(mt,null,t)):pt(mt,null,t)}function xt(t){return t==null||typeof t=="boolean"?pt(mt):de(t)?pt(K,null,t.slice()):zs(t)?Wt(t):pt($s,null,String(t))}function Wt(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ri(t)}function ws(t,e){let i=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(de(e))i=16;else if(typeof e=="object")if(s&65){const n=e.default;n&&(n._c&&(n._d=!1),ws(t,n()),n._c&&(n._d=!0));return}else{i=32;const n=e._;!n&&!Lo(e)?e._ctx=Je:n===3&&Je&&(Je.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else if(me(e)){if(s&65){ws(t,{default:e});return}e={default:e,_ctx:Je},i=32}else e=String(e),s&64?(i=16,e=[Q(e)]):i=8;t.children=e,t.shapeFlag|=i}function mu(...t){const e={};for(let i=0;itt||Je;let Es,Gi;{const t=Is(),e=(i,s)=>{let n;return(n=t[i])||(n=t[i]=[]),n.push(s),r=>{n.length>1?n.forEach(o=>o(r)):n[0](r)}};Es=e("__VUE_INSTANCE_SETTERS__",i=>tt=i),Gi=e("__VUE_SSR_SETTERS__",i=>ji=i)}const Zi=t=>{const e=tt;return Es(t),t.scope.on(),()=>{t.scope.off(),Es(e)}},wr=()=>{tt&&tt.scope.off(),Es(null)};function jo(t){return t.vnode.shapeFlag&4}let ji=!1;function Eu(t,e=!1,i=!1){e&&Gi(e);const{props:s,children:n}=t.vnode,r=jo(t);su(t,s,r,e),lu(t,n,i||e);const o=r?_u(t,e):void 0;return e&&Gi(!1),o}function _u(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Ha);const{setup:s}=i;if(s){Dt();const n=t.setupContext=s.length>1?Ru(t):null,r=Zi(t),o=Qi(s,t,0,[t.props,n]),l=$r(o);if(Ut(),r(),(l||t.sp)&&!_i(t)&&_o(t),l){if(o.then(wr,wr),e)return o.then(u=>{Gi(!0);try{Er(t,u,e)}finally{Gi(!1)}}).catch(u=>{Ds(u,t,0)});t.asyncDep=o}else Er(t,o)}else Jo(t)}function Er(t,e,i){me(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Pe(e)&&(t.setupState=ao(e)),Jo(t)}function Jo(t,e,i){const s=t.type;t.render||(t.render=s.render||Lt);{const n=Zi(t);Dt();try{Wa(t)}finally{Ut(),n()}}}const Su={get(t,e){return et(t,"get",""),t[e]}};function Ru(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,Su),slots:t.slots,emit:t.emit,expose:e}}function Hs(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(ao(aa(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in Bi)return Bi[i](t)},has(e,i){return i in e||i in Bi}})):t.proxy}function Au(t,e=!0){return me(t)?t.displayName||t.name:t.name||e&&t.__name}function ku(t){return me(t)&&"__vccOpts"in t}const ie=(t,e)=>ha(t,e,ji),Tu="3.5.44";let bn;const _r=typeof window<"u"&&window.trustedTypes;if(_r)try{bn=_r.createPolicy("vue",{createHTML:t=>t})}catch{}const Yo=bn?t=>bn.createHTML(t):t=>t,Cu="http://www.w3.org/2000/svg",Nu="http://www.w3.org/1998/Math/MathML",Ht=typeof document<"u"?document:null,Sr=Ht&&Ht.createElement("template"),Ou={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,s)=>{const n=e==="svg"?Ht.createElementNS(Cu,t):e==="mathml"?Ht.createElementNS(Nu,t):i?Ht.createElement(t,{is:i}):Ht.createElement(t);return t==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:t=>Ht.createTextNode(t),createComment:t=>Ht.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Ht.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,s,n,r){const o=i?i.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),i),!(n===r||!(n=n.nextSibling)););else{Sr.innerHTML=Yo(s==="svg"?`${t}`:s==="mathml"?`${t}`:t);const l=Sr.content;if(s==="svg"||s==="mathml"){const u=l.firstChild;for(;u.firstChild;)l.appendChild(u.firstChild);l.removeChild(u)}e.insertBefore(l,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},Mu=Symbol("_vtc");function xu(t,e,i){const s=t[Mu];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const _s=Symbol("_vod"),qo=Symbol("_vsh"),Pu={name:"show",beforeMount(t,{value:e},{transition:i}){t[_s]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):Mi(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:s}){!e!=!i&&(s?e?(s.beforeEnter(t),Mi(t,!0),s.enter(t)):s.leave(t,()=>{Mi(t,!1)}):Mi(t,e))},beforeUnmount(t,{value:e}){Mi(t,e)}};function Mi(t,e){t.style.display=e?t[_s]:"none",t[qo]=!e}const Iu=Symbol(""),Lu=/(?:^|;)\s*display\s*:/;function Du(t,e,i){const s=t.style,n=Fe(i);let r=!1;if(i&&!n){if(e)if(Fe(e))for(const o of e.split(";")){const l=o.slice(0,o.indexOf(":")).trim();i[l]==null&&Ii(s,l,"")}else for(const o in e)i[o]==null&&Ii(s,o,"");for(const o in i){o==="display"&&(r=!0);const l=i[o];l!=null?Fu(t,o,!Fe(e)&&e?e[o]:void 0,l)||Ii(s,o,l):Ii(s,o,"")}}else if(n){if(e!==i){const o=s[Iu];o&&(i+=";"+o),s.cssText=i,r=Lu.test(i)}}else e&&t.removeAttribute("style");_s in t&&((!n||e!==i)&&(t[_s]=r?s.display:""),t[qo]&&(s.display="none"))}const os=/\s*!important$/;function Ii(t,e,i){if(de(i))i.forEach(s=>Ii(t,e,s));else if(i==null&&(i=""),e.startsWith("--"))os.test(i)?t.setProperty(e,i.replace(os,""),"important"):t.setProperty(e,i);else{const s=Uu(t,e);os.test(i)?t.setProperty(mi(s),i.replace(os,""),"important"):t[s]=i}}const Rr=["Webkit","Moz","ms"],Zs={};function Uu(t,e){const i=Zs[e];if(i)return i;let s=at(e);if(s!=="filter"&&s in t)return Zs[e]=s;s=xs(s);for(let n=0;nen||(Vu.then(()=>en=0),en=Date.now());function Gu(t,e){const i=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=i.attached)return;const n=i.value;if(de(n)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const o=n.slice(),l=[s];for(let u=0;ut.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,ju=(t,e,i,s,n,r)=>{const o=n==="svg";e==="class"?xu(t,s,o):e==="style"?Du(t,i,s):Ns(e)?Os(e)||$u(t,e,i,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Ju(t,e,s,o))?(Tr(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&kr(t,e,s,o,r,e!=="value")):t._isVueCE&&(Yu(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!Fe(s)))?Tr(t,at(e),s,r,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),kr(t,e,s,o))};function Ju(t,e,i,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&Nr(e)&&me(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=t.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return Nr(e)&&Fe(i)?!1:e in t}function Yu(t,e){const i=t._def.props;if(!i)return!1;const s=at(e);return Array.isArray(i)?i.some(n=>at(n)===s):Object.keys(i).some(n=>at(n)===s)}const Ai=t=>{const e=t.props["onUpdate:modelValue"]||!1;return de(e)?i=>as(e,i):e};function qu(t){t.target.composing=!0}function Or(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const It=Symbol("_assign"),ls=Symbol("_initialValue");function tn(t,e,i){return e&&(t=t.trim()),i&&(t=Ps(t)),t}const Ae={created(t,{modifiers:{lazy:e,trim:i,number:s}},n){t.parentNode&&(t.type==="text"?t[ls]=t.defaultValue.replace(/[\r\n]/g,""):t.type==="textarea"&&(t[ls]=t.defaultValue.replace(/\r\n?/g,` -`))),t[It]=Ai(n);const r=s||n.props&&n.props.type==="number";Zt(t,e?"change":"input",o=>{o.target.composing||t[It](tn(t.value,i,r))}),(i||r)&&Zt(t,"change",()=>{t.value=tn(t.value,i,r)}),e||(Zt(t,"compositionstart",qu),Zt(t,"compositionend",Or),Zt(t,"change",Or))},mounted(t,{value:e,modifiers:{trim:i,number:s}}){const n=e??"",r=t[ls];delete t[ls],r!==void 0&&(t.type==="text"||t.type==="textarea")&&t.value!==r?t[It](tn(t.value,i,s)):t.value=n},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:s,trim:n,number:r}},o){if(t[It]=Ai(o),t.composing)return;const l=(r||t.type==="number")&&!/^0\d/.test(t.value)?Ps(t.value):t.value,u=e??"";if(l===u)return;const d=t.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===t&&t.type!=="range"&&(s&&e===i||n&&t.value.trim()===u)||(t.value=u)}},ei={deep:!0,created(t,e,i){t[It]=Ai(i),Zt(t,"change",()=>{const s=t._modelValue,n=Ji(t),r=t.checked,o=t[It];if(de(s)){const l=Nn(s,n),u=l!==-1;if(r&&!u)o(s.concat(n));else if(!r&&u){const d=[...s];d.splice(l,1),o(d)}}else if(Jt(s)){const l=new Set(s);r?l.add(n):l.delete(n),o(l)}else o(Xo(t,r))})},mounted:Mr,beforeUpdate(t,e,i){t[It]=Ai(i),Mr(t,e,i)}};function Mr(t,{value:e,oldValue:i},s){t._modelValue=e;let n;if(de(e))n=Nn(e,s.props.value)>-1;else if(Jt(e))n=e.has(s.props.value);else{if(e===i)return;n=Yt(e,Xo(t,!0))}t.checked!==n&&(t.checked=n)}const Et={deep:!0,created(t,{value:e,modifiers:{number:i}},s){t._modelValue=e,Zt(t,"change",()=>{const n=Array.prototype.filter.call(t.options,u=>u.selected).map(u=>i?Ps(Ji(u)):Ji(u)),r=t.multiple,o=r?Jt(t._modelValue)?new Set(n):n:n[0],l=t._pendingValue=[r,r?de(o)?n.slice():n:o];try{t[It](o)}finally{gs(()=>{t._pendingValue===l&&(t._pendingValue=void 0)})}}),t[It]=Ai(s)},mounted(t,{value:e}){xr(t,e)},beforeUpdate(t,{value:e},i){t._modelValue=e,t[It]=Ai(i)},updated(t,{value:e}){const i=t._pendingValue;t._pendingValue=void 0,(!i||i[0]!==t.multiple||!Xu(e,i[1],i[0]))&&xr(t,e)}};function Xu(t,e,i){if(!i||de(t))return Yt(t,e);if(Jt(t)){if(t.size!==e.length)return!1;for(const s of e)if(!t.has(s))return!1;return!0}return!1}function xr(t,e){const i=t.multiple,s=de(e);if(!(i&&!s&&!Jt(e))){for(let n=0,r=t.options.length;nString(d)===String(l)):o.selected=Nn(e,l)>-1}else o.selected=e.has(l);else if(Yt(Ji(o),e)){t.selectedIndex!==n&&(t.selectedIndex=n);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Ji(t){return"_value"in t?t._value:t.value}function Xo(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const Qu=["ctrl","shift","alt","meta"],Zu={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Qu.some(i=>t[`${i}Key`]&&!e.includes(i))},je=(t,e)=>{if(!t)return t;const i=t._withMods||(t._withMods={}),s=e.join(".");return i[s]||(i[s]=((n,...r)=>{for(let o=0;o{const e=tc().createApp(...t),{mount:i}=e;return e.mount=s=>{const n=nc(s);if(!n)return;const r=e._component;!me(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const o=i(n,!1,sc(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e});function sc(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function nc(t){return Fe(t)?document.querySelector(t):t}class N{static getElements(e,i=document){if(typeof e=="string"){const s="getElementById"in i?i:void 0;if(s&&!isNaN(+e[0])){const r=s.getElementById(e);return r?[r]:[]}let n=i.querySelectorAll(e);if(!n.length&&e[0]!=="."&&e[0]!=="#"&&(n=i.querySelectorAll("."+e),n.length||(n=i.querySelectorAll("#"+e)),!n.length)){const r=i.querySelector(`[gs-id="${e}"]`);return r?[r]:[]}return Array.from(n)}return[e]}static getElement(e,i=document){if(typeof e=="string"){const s="getElementById"in i?i:void 0;if(!e.length)return null;if(s&&e[0]==="#")return s.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return i.querySelector(e);if(s&&!isNaN(+e[0]))return s.getElementById(e);let n=i.querySelector(e);return s&&!n&&(n=s.getElementById(e)),n||(n=i.querySelector("."+e)),n}return e}static lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,i){const s=document.createElement("div");return e.forEach(n=>{n&&s.classList.add(n)}),i?.appendChild(s),s}static shouldSizeToContent(e,i=!1){return e?.grid&&(i?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,i){return!(e.y>=i.y+i.h||e.y+e.h<=i.y||e.x+e.w<=i.x||e.x>=i.x+i.w)}static isTouching(e,i){return N.isIntercepted(e,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(e,i){const s=e.x>i.x?e.x:i.x,n=e.x+e.wi.y?e.y:i.y,o=e.y+e.h{const o=i*((n.y??1e4)-(r.y??1e4));return o===0?i*((n.x??1e4)-(r.x??1e4)):o})}static find(e,i){return i?e.find(s=>s.id===i):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let i,s="px";if(typeof e=="string")if(e==="auto"||e==="")i=0;else{const n=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!n)throw new Error(`Invalid height val = ${e}`);s=n[2]||"px",i=parseFloat(n[1])}else i=e;return{h:i,unit:s}}static defaults(e,...i){return i.forEach(s=>{for(const n in s){if(!s.hasOwnProperty(n))return;e[n]===null||e[n]===void 0?e[n]=s[n]:typeof s[n]=="object"&&typeof e[n]=="object"&&N.defaults(e[n],s[n])}}),e}static same(e,i){if(typeof e!="object")return e==i;if(typeof e!=typeof i||Object.keys(e).length!==Object.keys(i).length)return!1;for(const s in e)if(e[s]!==i[s])return!1;return!0}static copyPos(e,i,s=!1){return i.x!==void 0&&(e.x=i.x),i.y!==void 0&&(e.y=i.y),i.w!==void 0&&(e.w=i.w),i.h!==void 0&&(e.h=i.h),s&&(i.minW&&(e.minW=i.minW),i.minH&&(e.minH=i.minH),i.maxW&&(e.maxW=i.maxW),i.maxH&&(e.maxH=i.maxH)),e}static samePos(e,i){return e&&i&&e.x===i.x&&e.y===i.y&&(e.w||1)===(i.w||1)&&(e.h||1)===(i.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,i){if(!(typeof e!="object"||typeof i!="object")&&!(Array.isArray(e)||Array.isArray(i)))for(let s in e){const n=e[s],r=i[s];s[0]==="_"||n===r?delete e[s]:n&&typeof n=="object"&&r!==void 0&&(N.removeInternalAndSame(n,r),Object.keys(n).length||delete e[s])}}static removeInternalForSave(e,i=!0){for(let s in e)(s[0]==="_"||e[s]===null||e[s]===void 0)&&delete e[s];delete e.grid,i&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,i){let s=!1;return(...n)=>{s||(s=!0,setTimeout(()=>{e(...n),s=!1},i))}}static removePositioningStyles(e){const i=e.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const i=getComputedStyle(e).overflowY;return(i==="auto"||i==="scroll")&&e.scrollHeight>e.clientHeight?e:N.getScrollElement(e.parentElement)}static updateScrollResize(e,i,s){const n=N.getScrollElement(i),r=n.clientHeight,o=n===N.getScrollElement()?0:n.getBoundingClientRect().top,l=e.clientY-o,u=lr-s;u?n.scrollBy({behavior:"smooth",top:l-s}):d&&n.scrollBy({behavior:"smooth",top:s-(r-l)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const i=["parentGrid","el","grid","subGrid","engine"],s=N.clone(e);for(const n in s)s.hasOwnProperty(n)&&typeof s[n]=="object"&&n.substring(0,2)!=="__"&&!i.find(r=>r===n)&&(s[n]=N.cloneDeep(e[n]));return s}static cloneNode(e){const i=e.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(e,i){let s;typeof i=="string"?s=N.getElement(i):s=i,s&&s.appendChild(e)}static addElStyles(e,i){if(i instanceof Object)for(const s in i)i.hasOwnProperty(s)&&(Array.isArray(i[s])?i[s].forEach(n=>{e.style[s]=n}):e.style[s]=i[s])}static initEvent(e,i){const s={type:i.type},n={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>s[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>s[r]=e[r]),{...s,...n}}static simulateMouseEvent(e,i,s){const n=e,r=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:n.ctrlKey??!1,altKey:n.altKey??!1,shiftKey:n.shiftKey??!1,metaKey:n.metaKey??!1,button:0,relatedTarget:e.target});(s||e.target).dispatchEvent(r)}static getValuesFromTransformedElement(e){const i=document.createElement("div");N.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(i);const s=i.getBoundingClientRect();return e.removeChild(i),i.remove(),{xScale:1/s.width,yScale:1/s.height,xOffset:s.left,yOffset:s.top}}static swap(e,i,s){if(!e)return;const n=e[i];e[i]=e[s],e[s]=n}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class Gt{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,i=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||i.y<=e.y)}_fixCollisions(e,i=e,s,n={}){if(this.sortNodes(-1),s=s||this.collide(e,i),!s)return!1;if(e._moving&&!n.nested&&!this.float&&this.swap(e,s))return!0;let r=i;!this._loading&&this._useEntireRowArea(e,i)&&(r={x:0,w:this.column,y:i.y,h:i.h},s=this.collide(e,r,n.skip));let o=!1;const l={nested:!0,pack:!1};let u=0;for(;s=s||this.collide(e,r,n.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let d;if(s.locked||this._loading||e._moving&&!e._skipDown&&i.y>e.y&&!this.float&&(!this.collide(s,{...s,y:e.y},e)||!this.collide(s,{...s,y:i.y-s.h},e))){e._skipDown=e._skipDown||i.y>e.y;const c={...i,y:s.y+s.h,...l};d=this._loading&&N.samePos(e,c)?!0:this.moveNode(e,c),(s.locked||this._loading)&&d?N.copyPos(i,e):!s.locked&&d&&n.pack&&(this._packNodes(),i.y=s.y+s.h,N.copyPos(e,i)),o=o||d}else d=this.moveNode(s,{...s,y:i.y+i.h,skip:e,...l});if(!d)return o;s=void 0}return o}collide(e,i=e,s){const n=e._id,r=s?._id;return this.nodes.find(o=>o._id!==n&&o._id!==r&&N.isIntercepted(o,i))}collideAll(e,i=e,s){const n=e._id,r=s?._id;return this.nodes.filter(o=>o._id!==n&&o._id!==r&&N.isIntercepted(o,i))}directionCollideCoverage(e,i,s){if(!i.rect||!e._rect)return;const n=e._rect,r={...i.rect};r.y>n.y?(r.h+=r.y-n.y,r.y=n.y):r.h+=n.y-r.y,r.x>n.x?(r.w+=r.x-n.x,r.x=n.x):r.w+=n.x-r.x;let o,l=.5;for(let u of s){if(u.locked||!u._rect)break;const d=u._rect;let c=Number.MAX_VALUE,h=Number.MAX_VALUE;n.yd.y+d.h&&(c=(d.y+d.h-r.y)/d.h),n.xd.x+d.w&&(h=(d.x+d.w-r.x)/d.w);const y=Math.min(h,c);y>l&&(l=y,o=u)}return i.collide=o,o}cacheRects(e,i,s,n,r,o){return this.nodes.forEach(l=>l._rect={y:l.y*i+s,x:l.x*e+o,w:l.w*e-o-n,h:l.h*i-s-r}),this}swap(e,i){if(!i||i.locked||!e||e.locked)return!1;function s(){const r=i.x,o=i.y;return i.x=e.x,i.y=e.y,e.h!=i.h?(e.x=r,e.y=i.y+i.h):e.w!=i.w?(e.x=i.x+i.w,e.y=o):(e.x=r,e.y=o),e._dirty=i._dirty=!0,!0}let n;if(e.w===i.w&&e.h===i.h&&(e.x===i.x||e.y===i.y)&&(n=N.isTouching(e,i)))return s();if(n!==!1){if(e.w===i.w&&e.x===i.x&&(n||(n=N.isTouching(e,i)))){if(i.y{let d;o.locked||(o.autoPosition=!0,e==="list"&&l&&(d=u[l-1])),this.addNode(o,!1,d)}),n||delete this._inColumnResize,s||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=N.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let i=e.y;for(;i>e._orig.y;)--i,this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})||(e._dirty=!0,e.y=i)}):this.nodes.forEach((e,i)=>{if(!e.locked)for(;e.y>0;){const s=i===0?0:e.y-1;if(!(i===0||!this.collide(e,{x:e.x,y:s,w:e.w,h:e.h})))break;e._dirty=e.y!==s,e.y=s}}),this)}prepareNode(e,i){e._id=e._id??Gt._idSeq++;const s=e.id;if(s){let r=1;for(;this.nodes.find(o=>o.id===e.id&&o!==e);)e.id=s+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const n={x:0,y:0,w:1,h:1};return N.defaults(e,n),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,N.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=n.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=n.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=n.w),isNaN(e.h)&&(e.h=n.h),this.nodeBoundFix(e,i),e}nodeBoundFix(e,i){const s=e._orig||N.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.columnthis.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(i?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(i?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),N.samePos(e,s)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(i=>i._dirty&&!N.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const i=(e||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=N.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||N.samePos(e,e._orig)||(N.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,i=this.nodes,s=this.column,n){const r=n?n.y*s+(n.x+n.w):0;let o=!1;for(let l=r;!o;++l){const u=l%s,d=Math.floor(l/s);if(u+e.w>s)continue;const c={x:u,y:d,w:e.w,h:e.h};i.find(h=>N.isIntercepted(c,h))||((e.x!==u||e.y!==d)&&(e._dirty=!0),e.x=u,e.y=d,delete e.autoPosition,o=!0)}return o}addNode(e,i=!1,s){const n=this.nodes.find(o=>o._id===e._id);if(n)return n;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,s)&&(delete e.autoPosition,r=!0),this.nodes.push(e),i&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,i=!0,s=!1){return this.nodes.find(n=>n._id===e._id)?(s&&this.removedNodes.push(e),i&&(e._removeDOM=!0),this.nodes=this.nodes.filter(n=>n._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(n=>n._removeDOM=!0);const s=this.nodes;return this.removedNodes=i?s:[],this.nodes=[],this._notify(s)}moveNodeCheck(e,i){if(!this.changedPosConstrain(e,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(e,i);let s;const n=new Gt({column:this.column,float:this.float,nodes:this.nodes.map(o=>o._id===e._id?(s={...o},s):{...o})});if(!s)return!1;const r=n.moveNode(s,i)&&n.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!i.resizing&&i.collide){const o=i.collide.el.gridstackNode;if(this.swap(e,o))return this._notify(),!0}return r?(n.nodes.filter(o=>o._dirty).forEach(o=>{const l=this.nodes.find(u=>u._id===o._id);l&&(N.copyPos(l,o),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const i=new Gt({column:this.column,float:this.float,nodes:this.nodes.map(n=>({...n}))}),s={...e};return this.cleanupNode(s),delete s.el,delete s._id,delete s.content,delete s.grid,i.addNode(s),i.getRow()<=this.maxRow?(e._willFitPos=N.copyPos({},s),!0):!1}changedPosConstrain(e,i){return i.w=i.w||e.w,i.h=i.h||e.h,e.x!==i.x||e.y!==i.y?!0:(e.maxW&&(i.w=Math.min(i.w,e.maxW)),e.maxH&&(i.h=Math.min(i.h,e.maxH)),e.minW&&(i.w=Math.max(i.w,e.minW)),e.minH&&(i.h=Math.max(i.h,e.minH)),e.w!==i.w||e.h!==i.h)}moveNode(e,i){if(!e||!i)return!1;let s;i.pack===void 0&&!this.batchMode&&(s=i.pack=!0),typeof i.x!="number"&&(i.x=e.x),typeof i.y!="number"&&(i.y=e.y),typeof i.w!="number"&&(i.w=e.w),typeof i.h!="number"&&(i.h=e.h);const n=e.w!==i.w||e.h!==i.h,r=N.copyPos({},e,!0);if(N.copyPos(r,i),this.nodeBoundFix(r,n),N.copyPos(i,r),!i.forceCollide&&N.samePos(e,i))return!1;const o=N.copyPos({},e),l=this.collideAll(e,r,i.skip);let u=!0;if(l.length){const d=e._moving&&!i.nested;let c=d?this.directionCollideCoverage(e,i,l):l[0];if(d&&c&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const h=N.areaIntercept(i.rect,c._rect),y=N.area(i.rect),S=N.area(c._rect);h/(y.8&&(c.grid.makeSubGrid(c.el,void 0,e),c=void 0)}c?u=!this._fixCollisions(e,r,c,i):(u=!1,s&&delete i.pack)}return u&&!N.samePos(e,r)&&(e._dirty=!0,N.copyPos(e,r)),i.pack&&this._packNodes()._notify(),!N.samePos(e,o)}getRow(){return this.nodes.reduce((e,i)=>Math.max(e,i.y+i.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(i=>i._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,i,s){const n=this._layouts?.length||0;let r;n&&(s?s!==this.column&&(r=this._layouts[s]):this.column!==n-1&&(r=this._layouts[n-1]));const o=[];return this.sortNodes(),this.nodes.forEach(l=>{const u=r?.find(c=>c._id===l._id),d={...l,...u||{}};N.removeInternalForSave(d,!e),i&&i(l,d),o.push(d)}),o}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,s)=>{if(!i||s===this.column)return this;if(s{if(!r._orig)return;const o=i.find(l=>l._id===r._id);o&&(o.y>=0&&r.y!==r._orig.y&&(o.y+=r.y-r._orig.y,o.y<0&&(o.y=0)),r.x!==r._orig.x&&(o.x=Math.round(r.x*n),o.x<0&&(o.x=0)),r.w!==r._orig.w&&(o.w=Math.round(r.w*n),o.w<1&&(o.w=1)))})}}),this)}columnChanged(e,i,s="moveScale"){if(!this.nodes.length||!i||e===i)return this;const n=s==="compact"||s==="list";n&&this.sortNodes(1),ie&&this._layouts){const l=this._layouts[i]||[],u=this._layouts.length-1;!l.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(d=>{const c=o.find(h=>h._id===d._id);c&&(!n&&!d.autoPosition&&(c.x=d.x??c.x,c.y=d.y??c.y),c.w=d.w??c.w,(d.x==null||d.y===void 0)&&(c.autoPosition=!0))})),l.forEach(d=>{const c=o.findIndex(h=>h._id===d._id);if(c!==-1){const h=o[c];if(n){h.w=d.w;return}(d.autoPosition||isNaN(d.x)||isNaN(d.y))&&this.findEmptyPosition(d,r),d.autoPosition||(h.x=d.x??h.x,h.y=d.y??h.y,h.w=d.w??h.w,r.push(h)),o.splice(c,1)}})}if(n)this.compact(s,!1);else{if(o.length)if(typeof s=="function")s(i,e,r,o);else{const l=n||s==="none"?1:i/e,u=s==="move"||s==="moveScale",d=s==="scale"||s==="moveScale";o.forEach(c=>{c.x=i===1?0:u?Math.round(c.x*l):Math.min(c.x,i-1),c.w=i===1||e===1?1:d?Math.round(c.w*l)||1:Math.min(c.w,i),r.push(c)}),o=[]}r=N.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!n),delete this._inColumnResize,this}cacheLayout(e,i,s=!1){const n=[];return e.forEach((r,o)=>{if(r._id===void 0){const l=r.id?this.nodes.find(u=>u.id===r.id):void 0;r._id=l?._id??Gt._idSeq++}n[o]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=s?[]:this._layouts||[],this._layouts[i]=n,this}cacheOneLayout(e,i){e._id=e._id??Gt._idSeq++;const s={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete s.x,delete s.y,e.autoPosition&&(s.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];const n=this.findCacheLayout(e,i);return n===-1?this._layouts[i].push(s):this._layouts[i][n]=s,this}findCacheLayout(e,i){return this._layouts?.[i]?.findIndex(s=>s._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let i=0;i0||navigator.msMaxTouchPoints>0);class ct{}function Ss(t,e){t.touches.length>1||(t.cancelable&&t.preventDefault(),N.simulateMouseEvent(t.changedTouches[0],e))}function Qo(t,e){t.cancelable&&t.preventDefault(),N.simulateMouseEvent(t,e)}function Rs(t){ct.touchHandled||(ct.touchHandled=!0,Ss(t,"mousedown"))}function As(t){ct.touchHandled&&Ss(t,"mousemove")}function ks(t){if(!ct.touchHandled)return;ct.pointerLeaveTimeout&&(window.clearTimeout(ct.pointerLeaveTimeout),delete ct.pointerLeaveTimeout);const e=!!ce.dragElement;Ss(t,"mouseup"),e||Ss(t,"click"),ct.touchHandled=!1}function Ts(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function Ir(t){ce.dragElement&&t.pointerType!=="mouse"&&Qo(t,"mouseenter")}function Lr(t){ce.dragElement&&t.pointerType!=="mouse"&&(ct.pointerLeaveTimeout=window.setTimeout(()=>{delete ct.pointerLeaveTimeout,Qo(t,"mouseleave")},10))}class Ws{constructor(e,i,s){this.host=e,this.dir=i,this.option=s,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Ws.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),yt&&(this.el.addEventListener("touchstart",Rs),this.el.addEventListener("pointerdown",Ts)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),yt&&(this.el.removeEventListener("touchstart",Rs),this.el.removeEventListener("pointerdown",Ts)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),yt&&(this.el.addEventListener("touchmove",As),this.el.addEventListener("touchend",ks)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const i=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-i.x)+Math.abs(e.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),yt&&(this.el.removeEventListener("touchmove",As),this.el.removeEventListener("touchend",ks)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,i){return this.option[e]&&this.option[e](i),this}}Ws.prefix="ui-resizable-";class Vn{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,i){this._eventRegister[e]=i}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,i){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](i)}}class Yi extends Vn{constructor(e,i={}){super(),this.el=e,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{const n=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},o=this.temporalRect||r;return{position:{left:this.option.rtl?(n.right-o.right)*this.rectScale.x:(o.left-n.left)*this.rectScale.x,top:(o.top-n.top)*this.rectScale.y},size:{width:o.width*this.rectScale.x,height:o.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,i){super.on(e,i)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const i=e.handles&&e.handles!==this.option.handles,s=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(n=>this.option[n]=e[n]),i&&(this._removeHandlers(),this._setupHandlers()),s&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),ce.overResizeElement===this&&delete ce.overResizeElement),this}_mouseOver(e){ce.overResizeElement||ce.dragElement||(ce.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){ce.overResizeElement===this&&(delete ce.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Ws(this.el,e,{element:this.option.element,start:i=>this._resizeStart(i),stop:i=>this._resizeStop(i),move:i=>this._resizing(i,e)})),this}_resizeStart(e){this.sizeToContent=N.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=N.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const i=N.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(e,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,i),this._applyChange();const s=N.initEvent(e,{type:"resize",target:this.el});return s.resizeDir=i,s.hasMovedX=this.option.rtl?i.includes("e"):i.includes("w"),s.hasMovedY=i.includes("n"),this.option.resize&&this.option.resize(s,this._ui()),this.triggerEvent("resize",s),this}_resizeStop(e){const i=N.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=Yi._originStyleProp.map(s=>this.el.style[s]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,i=N.getValuesFromTransformedElement(e);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return Yi._originStyleProp.forEach((e,i)=>{this.el.style[e]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,i){const s=this.startEvent,n={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},r=e.clientX-s.clientX,o=this.sizeToContent?0:e.clientY-s.clientY;let l,u;const d=this.option.rtl;!d&&i.indexOf("e")>-1?n.width+=r:d&&i.indexOf("w")>-1?n.width-=r:!d&&i.indexOf("w")>-1?(n.width-=r,n.left+=r,l=!0):d&&i.indexOf("e")>-1&&(n.width+=r,n.right+=r,l=!0),i.indexOf("s")>-1?n.height+=o:i.indexOf("n")>-1&&(n.height-=o,n.top+=o,u=!0);const c=this._constrainSize(n.width,n.height,l,u);return Math.round(n.width)!==Math.round(c.width)&&(!d&&i.indexOf("w")>-1?n.left+=n.width-c.width:d&&i.indexOf("e")>-1&&(n.right-=n.width-c.width),n.width=c.width),Math.round(n.height)!==Math.round(c.height)&&(i.indexOf("n")>-1&&(n.top+=n.height-c.height),n.height=c.height),n}_constrainSize(e,i,s,n){const r=this.option,o=(s?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,l=r.minWidth/this.rectScale.x||e,u=(n?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,d=r.minHeight/this.rectScale.y||i,c=Math.min(o,Math.max(l,e)),h=Math.min(u,Math.max(d,i));return{width:c,height:h}}_applyChange(){let e={left:0,right:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const i=this.el.parentElement,{left:s,right:n,top:r}=i.getBoundingClientRect();e={left:s,right:n,top:r,width:0,height:0}}return this.temporalRect?(Object.entries(this.temporalRect).forEach(([i,s])=>{if(this.option.rtl?i==="left":i==="right")return;const n=i==="width"||i==="left"||i==="right"?this.rectScale.x:i==="height"||i==="top"?this.rectScale.y:1;let r;i==="right"?r=(e.right-s)*this.rectScale.x+"px":r=(s-e[i])*n+"px",this.el.style[i]=r}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}Yi._originStyleProp=["width","height","position","left","right","top","opacity","zIndex"];const rc='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class qi extends Vn{constructor(e,i={}){super(),this.el=e,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},this._autoScrollTick=()=>{const r=this.helper,o=this._autoScrollContainer;if(!r||!o){this._stopScrolling();return}const l=this._getClipping(r,o);if(l===0){this._stopScrolling();return}if(!this._autoScrollMaxSpeed){const y=window.innerHeight||document.documentElement.clientHeight;this._autoScrollMaxSpeed=Math.max(y/150,4)}const u=Math.abs(l),d=Math.min(u*.5,this._autoScrollMaxSpeed),c=l>0?d:-d,h=o.scrollTop;if(o.scrollTop+=c,o.scrollTop===h){this._stopScrolling();return}this.dragging&&this.lastDrag&&(this._dragFollow(this.lastDrag),this._callDrag(this.lastDrag)),this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick)};const s=i?.handle?.substring(1),n=e.gridstackNode;this.dragEls=!s||e.classList.contains(s)?[e]:n?.subGrid?[e.querySelector(i.handle)||e]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}getAllHandles(){return Array.from(this.el.querySelectorAll(this.option.handle)).filter(e=>{if(!(e instanceof HTMLElement))return!1;const i=e.closest(".grid-stack-item");return i===this.el||!i})}on(e,i){super.on(e,i)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),yt&&(e.addEventListener("touchstart",Rs),e.addEventListener("pointerdown",Ts))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),yt&&(i.removeEventListener("touchstart",Rs),i.removeEventListener("pointerdown",Ts))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(i=>this.option[i]=e[i]),this}_mouseDown(e){if(ct.touchHandled&&e.isTrusted&&(ct.touchHandled=!1),!ce.mouseHandled)return e.button!==0||!this.dragEls.find(i=>i===e.target)&&e.target.closest(rc)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete ce.dragElement,delete ce.dropElement,delete this._autoScrollMaxSpeed,delete this._autoScrollContainer,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),yt&&(e.currentTarget.addEventListener("touchmove",As),e.currentTarget.addEventListener("touchend",ks)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),ce.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const i=N.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(e){const i=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),ce.pauseDrag){const s=Number.isInteger(ce.pauseDrag)?ce.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),s)}else this._callDrag(e);else if(Math.abs(e.x-i.x)+Math.abs(e.y-i.y)>3){this.dragging=!0,ce.dragElement=this;const s=this.el.gridstackNode?.grid;s?ce.dropElement=s.el.ddElement.ddDroppable:delete ce.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=N.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const n=N.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(n,this.ui()),this.triggerEvent("dragstart",n),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(this._stopScrolling(),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),yt&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",As,!0),e.currentTarget.removeEventListener("touchend",ks,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),ce.dropElement?.el===this.el.parentElement&&delete ce.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const i=N.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),ce.dropElement&&ce.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete ce.dragElement,delete ce.dropElement,delete ce.mouseHandled,e.preventDefault()}_keyEvent(e){const i=this.el.gridstackNode,s=i?.grid||ce.dropElement?.el?.gridstack;if(e.key==="Escape")i&&i._origRotate&&(i._orig=i._origRotate,delete i._origRotate),s?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(i&&s&&(e.key==="r"||e.key==="R")){if(!N.canBeRotated(i))return;i._origRotate=i._origRotate||{...i._orig},delete i._moving,s.setAnimation(!1).rotate(i.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetX}).setAnimation(),i._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,i.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",N.swap(i._orig,"w","h"),delete i._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=N.cloneNode(this.el)),e.parentElement||N.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=qi.originStyleProp.map(i=>this.el.style[i]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");const i=this.helper.style;return i.pointerEvents="none",i.width=this.dragOffset.width+"px",i.height=this.dragOffset.height+"px",i.willChange="left, right, top",i.position="fixed",this._dragFollow(e),i.transition="none",setTimeout(()=>{this.helper&&(i.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const i=this.helper,s=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",qi.originStyleProp.forEach(n=>i.style[n]=this.dragElementOriginStyle[n]||null),setTimeout(()=>i.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const i=this.helper.style,s=this.dragOffset;this.option.rtl?(i.right=(window.innerWidth-e.clientX+s.offsetX)*this.dragTransform.xScale+"px",i.left&&(i.left="")):(i.left=(e.clientX+s.offsetX)*this.dragTransform.xScale+"px",i.right&&(i.right="")),i.top=(e.clientY+s.offsetTop)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,i,s){let n=0,r=0;s&&(n=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const o=i.getBoundingClientRect();let l=this.option.rtl?o.right:o.left,u=this.option.rtl?e.clientX-o.right+n:-e.clientX+o.left-n;return{x:l,top:o.top,offsetX:u,offsetTop:-e.clientY+o.top-r,width:o.width*this.dragTransform.xScale,height:o.height*this.dragTransform.yScale}}updateScrollPosition(e){this._autoScrollContainer=N.getScrollElement(e),this._getClipping(this.helper,this._autoScrollContainer)===0?this._stopScrolling():this._autoScrollAnimId||(this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick))}_getClipping(e,i){const s=e.getBoundingClientRect(),n=i.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(s.bottomn.bottom)return 0;const o=s.bottom-Math.min(n.bottom,r),l=s.top-Math.max(n.top,0);return l<0?l:o>0?o:0}_stopScrolling(){this._autoScrollAnimId&&(cancelAnimationFrame(this._autoScrollAnimId),delete this._autoScrollAnimId)}ui(){const i=this.el.parentElement.getBoundingClientRect(),s=this.helper.getBoundingClientRect(),n=this.option.rtl?(i.right-s.right)*this.dragTransform.xScale:(s.left-i.left)*this.dragTransform.xScale;return{position:{top:(s.top-i.top)*this.dragTransform.yScale,left:n}}}}qi.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","right","top","minWidth","willChange"];class oc extends Vn{constructor(e,i={}){super(),this.el=e,this.option=i,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,i){super.on(e,i)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),yt&&(this.el.addEventListener("pointerenter",Ir),this.el.addEventListener("pointerleave",Lr)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),yt&&(this.el.removeEventListener("pointerenter",Ir),this.el.removeEventListener("pointerleave",Lr)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(i=>this.option[i]=e[i]),this._setupAccept(),this}_mouseEnter(e){if(!ce.dragElement||ct.touchHandled&&e.isTrusted||!this._canDrop(ce.dragElement.el))return;e.preventDefault(),e.stopPropagation(),ce.dragElement._stopScrolling(),ce.dropElement&&ce.dropElement!==this&&ce.dropElement._mouseLeave(e,!0),ce.dropElement=this;const i=N.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(ce.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,i=!1){if(!ce.dragElement||ce.dropElement!==this)return;e.preventDefault(),e.stopPropagation(),i&&ce.dragElement._stopScrolling();const s=N.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(s,this._ui(ce.dragElement)),this.triggerEvent("dropout",s),ce.dropElement===this&&(delete ce.dropElement,!i)){let n,r=this.el.parentElement;for(;!n&&r;)n=r.ddElement?.ddDroppable,r=r.parentElement;n&&n._mouseEnter(e)}}drop(e){e.preventDefault();const i=N.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(ce.dragElement)),this.triggerEvent("drop",i)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class Kn{static init(e){return e.ddElement||(e.ddElement=new Kn(e)),e.ddElement}constructor(e){this.el=e}on(e,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,i),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new qi(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new Yi(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new oc(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class lc{resizable(e,i,s,n){return this._getDDElements(e,i).forEach(r=>{if(i==="disable"||i==="enable")r.ddResizable&&r.ddResizable[i]();else if(i==="destroy")r.ddResizable&&r.cleanResizable();else if(i==="option")r.setupResizable({[s]:n});else{const l=r.el.gridstackNode.grid;let u=r.el.getAttribute("gs-resize-handles")||l.opts.resizable.handles||"e,s,se";u==="all"&&(u="n,e,s,w,se,sw,ne,nw");const d=!l.opts.alwaysShowResizeHandle;r.setupResizable({...l.opts.resizable,handles:u,autoHide:d,start:i.start,stop:i.stop,resize:i.resize,rtl:i.rtl})}}),this}draggable(e,i,s,n){return this._getDDElements(e,i).forEach(r=>{if(i==="disable"||i==="enable")r.ddDraggable&&r.ddDraggable[i]();else if(i==="destroy")r.ddDraggable&&r.cleanDraggable();else if(i==="option")r.setupDraggable({[s]:n});else{const o=r.el.gridstackNode.grid;r.setupDraggable({...o.opts.draggable,start:i.start,stop:i.stop,drag:i.drag,rtl:i.rtl})}}),this}dragIn(e,i){return this._getDDElements(e).forEach(s=>s.setupDraggable(i)),this}droppable(e,i,s,n){return typeof i.accept=="function"&&!i._accept&&(i._accept=i.accept,i.accept=r=>i._accept(r)),this._getDDElements(e,i).forEach(r=>{i==="disable"||i==="enable"?r.ddDroppable&&r.ddDroppable[i]():i==="destroy"?r.ddDroppable&&r.cleanDroppable():i==="option"?r.setupDroppable({[s]:n}):r.setupDroppable(i)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,i,s){return this._getDDElements(e).forEach(n=>n.on(i,r=>{s(r,ce.dragElement?ce.dragElement.el:r.target,ce.dragElement?ce.dragElement.helper:null)})),this}off(e,i){return this._getDDElements(e).forEach(s=>s.off(i)),this}_getDDElements(e,i){const s=e.gridstack||i!=="destroy"&&i!=="disable",n=N.getElements(e);return n.length?n.map(o=>o.ddElement||(s?Kn.init(o):null)).filter(o=>o):[]}}const nt=new lc;class le{static init(e={},i=".grid-stack"){if(typeof document>"u")return null;const s=le.getGridElement(i);return s?(s.gridstack||(s.gridstack=new le(s,N.cloneDeep(e))),s.gridstack):(console.error(typeof i=="string"?'GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ? -Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},i=".grid-stack"){const s=[];return typeof document>"u"||(le.getGridElements(i).forEach(n=>{n.gridstack||(n.gridstack=new le(n,N.cloneDeep(e))),s.push(n.gridstack)}),s.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ? -Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),s}static addGrid(e,i={}){if(!e)return null;let s=e;if(s.gridstack){const o=s.gridstack;return i&&(o.opts={...o.opts,...i}),i.children!==void 0&&o.load(i.children),o}return(!e.classList.contains("grid-stack")||le.addRemoveCB)&&(le.addRemoveCB?s=le.addRemoveCB(e,i,!0,!0):s=N.createDiv(["grid-stack",i.class],e)),le.init(i,s)}static registerEngine(e){le.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=N.createDiv([this.opts.placeholderClass,ut.itemClass,this.opts.itemClass]);const e=N.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,i={}){this.el=e,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=i=i||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const s=N.toNumber(e.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const n=i.columnOpts;if(n){const d=n.breakpoints;!n.columnWidth&&!d?.length?delete i.columnOpts:(n.columnMax=n.columnMax||12,d?.length>1&&d.sort((c,h)=>(h.w||0)-(c.w||0)))}const r={...N.cloneDeep(ut),column:N.toNumber(e.getAttribute("gs-column"))||ut.column,minRow:s||N.toNumber(e.getAttribute("gs-min-row"))||ut.minRow,maxRow:s||N.toNumber(e.getAttribute("gs-max-row"))||ut.maxRow,staticGrid:N.toBool(e.getAttribute("gs-static"))||ut.staticGrid,sizeToContent:N.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||ut.draggable.handle},removableOptions:{accept:i.itemClass||ut.removableOptions.accept,decline:ut.removableOptions.decline}};e.getAttribute("gs-animate")&&(r.animate=N.toBool(e.getAttribute("gs-animate"))),i=N.defaults(i,r),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=e.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const l=this.el.closest("."+ut.itemClass)?.gridstackNode;if(l&&(l.subGrid=this,this.parentGridNode=l,this.el.classList.add("grid-stack-nested"),l.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==ut.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const d=i.cellHeight;delete i.cellHeight,this.cellHeight(d)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=yt),this._setStaticClass();const u=i.engineClass||le.engineClass||Gt;if(this.engine=new u({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:d=>{d.forEach(c=>{const h=c.el;h&&(c._removeDOM?(h&&h.remove(),delete c._removeDOM):this._writePosAttr(h,c))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(d=>this._prepareElement(d)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const d=i.children;delete i.children,d.length&&this.load(d)}this.setAnimation(),i.subGridDynamic&&!ce.pauseDrag&&(ce.pauseDrag=!0),i.draggable?.pause!==void 0&&(ce.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let i,s=e;if(s.grid=this,s.el?i=s.el:le.addRemoveCB?i=le.addRemoveCB(this.el,e,!0,!1):i=this.createWidgetDivs(s),!i)return;if(s=i.gridstackNode,s&&i.parentElement===this.el&&this.engine.nodes.find(r=>r._id===s._id))return i;const n=this._readAttr(i);return N.defaults(e,n),this.engine.prepareNode(e),this.el.appendChild(i),this.makeWidget(i,e),i}createWidgetDivs(e){const i=N.createDiv(["grid-stack-item",this.opts.itemClass]),s=N.createDiv(["grid-stack-item-content"],i);return N.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([n])=>{n.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,le.renderCB(s,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(i))):le.renderCB(s,e),i}makeSubGrid(e,i,s,n=!0){let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),r.subGrid?.el)return r.subGrid;let o,l=this;for(;l&&!o;)o=l.opts?.subGridOpts,l=l.parentGridNode?.grid;i=N.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...o||{},...i||r.subGridOpts||{}}),r.subGridOpts=i;let u;i.column==="auto"&&(u=!0,i.column=Math.max(r.w||1,s?.w||1),delete i.columnOpts);let d=r.el.querySelector(".grid-stack-item-content"),c,h;if(n&&(this._removeDD(r.el),h={...r,x:0,y:0},N.removeInternalForSave(h),delete h.subGridOpts,r.content&&(h.content=r.content,delete r.content),le.addRemoveCB?c=le.addRemoveCB(this.el,h,!0,!1):(c=N.createDiv(["grid-stack-item"]),c.appendChild(d),d=N.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),s){const S=u?i.column:r.w,C=r.h+s.h,T=r.el.style;T.transition="none",this.update(r.el,{w:S,h:C}),setTimeout(()=>T.transition=null)}const y=r.subGrid=le.addGrid(d,i);return s?._moving&&(y._isTemp=!0),u&&(y._autoColumn=!0),n&&y.makeWidget(c,h),s&&(s._moving?window.setTimeout(()=>N.simulateMouseEvent(s._event,"mouseenter",y.el),0):y.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),y}removeAsSubGrid(e){const i=this.parentGridNode?.grid;i&&(i.batchUpdate(),i.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(s=>{s.x+=this.parentGridNode.x,s.y+=this.parentGridNode.y,i.makeWidget(s.el,s)}),i.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>N.simulateMouseEvent(e._event,"mouseenter",i.el),0))}save(e=!0,i=!1,s=le.saveCB,n){const r=this.engine.save(e,s,n);if(r.forEach(o=>{if(e&&o.el&&!o.subGrid&&!s){const l=o.el.querySelector(".grid-stack-item-content");o.content=l?.innerHTML,o.content||delete o.content}else if(!e&&!s&&delete o.content,o.subGrid?.el){const l=o.w||o.subGrid.getColumn(),u=o.subGrid.save(e,i,s,l);o.subGridOpts=i?u:{children:u},delete o.subGrid}delete o.el}),i){const o=N.cloneDeep(this.opts);o.marginBottom===o.marginTop&&o.marginRight===o.marginLeft&&o.marginTop===o.marginRight&&(o.margin=o.marginTop,delete o.marginTop,delete o.marginRight,delete o.marginBottom,delete o.marginLeft),o.rtl===(this.el.style.direction==="rtl")&&(o.rtl="auto"),this._isAutoCellHeight&&(o.cellHeight="auto"),this._autoColumn&&(o.column="auto");const l=o._alwaysShowResizeHandle;return delete o._alwaysShowResizeHandle,l!==void 0?o.alwaysShowResizeHandle=l:delete o.alwaysShowResizeHandle,N.removeInternalAndSame(o,ut),o.children=r,o}return r}load(e,i=le.addRemoveCB||!0){e.forEach(c=>{c.w=c.w||c.minW||1,c.h=c.h||c.minH||1}),e=N.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;e.forEach(c=>{s=Math.max(s,(c.x||0)+c.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s);const n=this.getColumn();s>n&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(s,n,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,s,!0));const r=le.addRemoveCB;typeof i=="function"&&(le.addRemoveCB=i);const o=[];this.batchUpdate();const l=!this.engine.nodes.length,u=l&&this.opts.animate;u&&this.setAnimation(!1),!l&&i&&[...this.engine.nodes].forEach(h=>{if(!h.id)return;N.find(e,h.id)||(le.addRemoveCB&&le.addRemoveCB(this.el,h,!1,!1),o.push(h),this.removeWidget(h.el,!0,!1))}),this.engine._loading=!0;const d=[];return this.engine.nodes=this.engine.nodes.filter(c=>N.find(e,c.id)?(d.push(c),!1):!0),e.forEach(c=>{const h=N.find(d,c.id);if(h){if(N.shouldSizeToContent(h)&&(c.h=h.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||h.w,c.h=c.h||h.h,this.engine.findEmptyPosition(c)),this.engine.nodes.push(h),N.samePos(h,c)&&this.engine.nodes.length>1&&(this.moveNode(h,{...c,forceCollide:!0}),N.copyPos(c,h)),this.update(h.el,c),c.subGridOpts?.children){const y=h.el.querySelector(".grid-stack");y&&y.gridstack&&y.gridstack.load(c.subGridOpts.children)}}else i&&this.addWidget(c)}),delete this.engine._loading,this.engine.removedNodes=o,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?le.addRemoveCB=r:delete le.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const i=this.el.querySelector("."+this.opts.itemClass);if(i){const n=N.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/n)}const s=parseInt(this.el.getAttribute("gs-current-row"));return s?Math.round(this.el.getBoundingClientRect().height/s):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}const i=N.parseHeight(e);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.length)return!1;const i=this.getColumn();let s=i;const n=this._widthOrContainer(!0);if(e.columnWidth)s=Math.min(Math.round(n/e.columnWidth)||1,e.columnMax);else{s=e.columnMax;let r=0;for(;ro.c===s);return this.column(s,r?.layout||e.layout),!0}return!1}compact(e="compact",i=!0){return this.engine.compact(e,i),this._triggerChangeEvent(),this}column(e,i="moveScale"){if(!e||e<1||this.opts.column===e)return this;const s=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+s),this._updateColumnVar(),this.engine.columnChanged(s,e,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,i=!1){const s=this.el.getBoundingClientRect();let n;i?n={top:s.top+document.documentElement.scrollTop,left:s.left}:n={top:this.el.offsetTop,left:this.el.offsetLeft};const r=e.left-n.left,o=e.top-n.top,l=s.width/this.getColumn(),u=s.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/l),y:Math.floor(o/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,i,s,n){return this.engine.isAreaEmpty(e,i,s,n)}makeWidget(e,i){const s=le.getElement(e);if(!s||s.gridstackNode)return s;s.parentElement||this.el.appendChild(s),this._prepareElement(s,!0,i);const n=s.gridstackNode;this._updateContainerHeight(),n.subGridOpts&&this.makeSubGrid(s,n.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,s}on(e,i){return e.indexOf(" ")!==-1?(e.split(" ").forEach(n=>this.on(n,i)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=n=>i(n):this._gsEventHandler[e]=n=>{n.detail&&i(n,n.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=i:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(s=>this.off(s)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,i=!0,s=!0){return e?(le.getElements(e).forEach(n=>{if(n.parentElement&&n.parentElement!==this.el)return;let r=n.gridstackNode;r||(r=this.engine.nodes.find(o=>n===o.el)),r&&(i&&le.addRemoveCB&&le.addRemoveCB(this.el,r,!1,!1),delete n.gridstackNode,this._removeDD(n),this.engine.removeNode(r,i,s),i&&n.parentElement&&n.remove())}),s&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,i=!0){return this.engine.nodes.forEach(s=>{e&&le.addRemoveCB&&le.addRemoveCB(this.el,s,!1,!1),delete s.el.gridstackNode,this.opts.staticGrid||this._removeDD(s.el)}),this.engine.removeAll(e,i),i&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,i=!0,s=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(n=>{this.prepareDragDrop(n.el),n.subGrid&&s&&n.subGrid.setStatic(e,i,s)}),i&&this._setStaticClass(),this)}updateOptions(e){const i=this.opts;if(e===i)return this;if(e.acceptWidgets!==void 0&&(i.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==i.class&&(i.class&&this.el.classList.remove(i.class),e.class&&this.el.classList.add(e.class)),e.columnOpts){const s=!!this.opts.columnOpts;this.opts.columnOpts=e.columnOpts,s!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column);return e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(i.minRow=i.maxRow=i.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(i.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(i.maxRow=this.engine.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(i.lazyLoad=e.lazyLoad),e.children?.length&&this.load(e.children),this}update(e,i){return le.getElements(e).forEach(s=>{const n=s?.gridstackNode;if(!n)return;const r={...N.copyPos({},n),...N.cloneDeep(i)};this.engine.nodeBoundFix(r),delete r.autoPosition;const o=["x","y","w","h"];let l;if(o.some(c=>r[c]!==void 0&&r[c]!==n[c])&&(l={},o.forEach(c=>{l[c]=r[c]!==void 0?r[c]:n[c],delete r[c]})),!l&&(r.minW||r.minH||r.maxW||r.maxH)&&(l={}),r.content!==void 0){const c=s.querySelector(".grid-stack-item-content");c&&c.textContent!==r.content&&(n.content=r.content,le.renderCB(c,r),n.subGrid?.el&&(c.appendChild(n.subGrid.el),n.subGrid._updateContainerHeight())),delete r.content}let u=!1,d=!1;for(const c in r)c[0]!=="_"&&n[c]!==r[c]&&(n[c]=r[c],u=!0,d=d||!this.opts.staticGrid&&(c==="noResize"||c==="noMove"||c==="locked"));if(N.sanitizeMinMax(n),l){const c=l.w!==void 0&&l.w!==n.w;this.moveNode(n,l),c&&n.subGrid?n.subGrid.onResize(this.hasAnimationCSS()?n.w:void 0):this.resizeToContentCheck(c,n),delete n._orig}(l||u)&&this._writeAttr(s,n),d&&this.prepareDragDrop(n.el),le.updateCB&&le.updateCB(n)}),this}moveNode(e,i){const s=e._updating;s||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,i),this._updateContainerHeight(),s||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const i=e.gridstackNode;if(!i)return;const s=i.grid;if(!s||e.parentElement!==s.el)return;const n=s.getCellHeight(!0);if(!n)return;let r=i.h?i.h*n:e.clientHeight,o;if(i.resizeToContentParent&&(o=e.querySelector(i.resizeToContentParent)),o||(o=e.querySelector(le.resizeToContentParent)),!o)return;const l=e.clientHeight-o.clientHeight,u=i.h?i.h*n-l:o.clientHeight;let d;if(i.subGrid){d=i.subGrid.getRow()*i.subGrid.getCellHeight(!0);const y=i.subGrid.el.getBoundingClientRect(),S=e.getBoundingClientRect();d+=y.top-S.top}else{if(i.subGridOpts?.children?.length)return;{const y=o.firstElementChild;if(!y){console.error(`Error: GridStack.resizeToContent() widget id:${i.id} '${le.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}d=y.getBoundingClientRect().height||u}}if(u===d)return;r+=d-u;let c=Math.ceil(r/n);const h=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;h&&c>h&&(c=h,e.classList.add("size-to-content-max")),i.minH&&ci.maxH&&(c=i.maxH),c!==i.h&&(s._ignoreLayoutsNodeChange=!0,s.moveNode(i,{h:c}),delete s._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){le.resizeToContentCB?le.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,i){return le.getElements(e).forEach(s=>{const n=s.gridstackNode;if(!N.canBeRotated(n))return;const r={w:n.h,h:n.w,minH:n.minW,minW:n.minH,maxH:n.maxW,maxW:n.maxH};if(i){const l=i.left>0?Math.floor(i.left/this.cellWidth()):0,u=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;r.x=n.x+l-(n.h-(u+1)),r.y=n.y+u-l}Object.keys(r).forEach(l=>{r[l]===void 0&&delete r[l]});const o=n._orig;this.update(s,r),n._orig=o}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const s=N.parseHeight(e);if(this.opts.marginUnit===s.unit&&this.opts.margin===s.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,i){const s=i?new CustomEvent(e,{bubbles:!1,detail:i}):new Event(e);let n=this;for(;n.parentGridNode;)n=n.parentGridNode.grid;return n.el.dispatchEvent(s),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const s=this.opts.cellHeight,n=this.opts.cellHeightUnit;if(!s)return this;if(!e&&!this.opts.minRow){const r=N.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===n){const o=Math.floor(r.h/s);i1?`calc(${i.w} * var(--gs-column-width))`:null,e.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null}return e.setAttribute("gs-x",String(i.x)),e.setAttribute("gs-y",String(i.y)),i.w>1?e.setAttribute("gs-w",String(i.w)):e.removeAttribute("gs-w"),i.h>1?e.setAttribute("gs-h",String(i.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,i){if(!i)return this;this._writePosAttr(e,i);const s={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const n in s)i[n]?e.setAttribute(s[n],String(i[n])):e.removeAttribute(s[n]);return this}_readAttr(e,i=!0){const s={};s.x=N.toNumber(e.getAttribute("gs-x")),s.y=N.toNumber(e.getAttribute("gs-y")),s.w=N.toNumber(e.getAttribute("gs-w")),s.h=N.toNumber(e.getAttribute("gs-h")),s.autoPosition=N.toBool(e.getAttribute("gs-auto-position")),s.noResize=N.toBool(e.getAttribute("gs-no-resize")),s.noMove=N.toBool(e.getAttribute("gs-no-move")),s.locked=N.toBool(e.getAttribute("gs-locked"));const n=e.getAttribute("gs-size-to-content");n&&(n==="true"||n==="false"?s.sizeToContent=N.toBool(n):s.sizeToContent=parseInt(n,10)),s.id=e.getAttribute("gs-id"),s.maxW=N.toNumber(e.getAttribute("gs-max-w")),s.minW=N.toNumber(e.getAttribute("gs-min-w")),s.maxH=N.toNumber(e.getAttribute("gs-max-h")),s.minH=N.toNumber(e.getAttribute("gs-min-h")),i&&(s.w===1&&e.removeAttribute("gs-w"),s.h===1&&e.removeAttribute("gs-h"),s.maxW&&e.removeAttribute("gs-max-w"),s.minW&&e.removeAttribute("gs-min-w"),s.maxH&&e.removeAttribute("gs-max-h"),s.minH&&e.removeAttribute("gs-min-h"));for(const r in s){if(!s.hasOwnProperty(r))return;!s[r]&&s[r]!==0&&r!=="sizeToContent"&&delete s[r]}return s}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(s=>{s.subGrid&&s.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,i=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)N.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(s=>N.shouldSizeToContent(s))){const s=[...this.engine.nodes];this.batchUpdate(),s.forEach(n=>{N.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(e=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(s=>s.sizeToContent));return!e&&i&&!this.resizeObserver?(this._sizeThrottle=N.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return N.getElement(e)}static getElements(e=".grid-stack-item"){return N.getElements(e)}static getGridElement(e){return le.getElement(e)}static getGridElements(e){return N.getElements(e)}_initMargin(){let e,i=0,s=[];typeof this.opts.margin=="string"&&(s=this.opts.margin.split(" ")),s.length===2?(this.opts.marginTop=this.opts.marginBottom=s[0],this.opts.marginLeft=this.opts.marginRight=s[1]):s.length===4?(this.opts.marginTop=s[0],this.opts.marginRight=s[1],this.opts.marginBottom=s[2],this.opts.marginLeft=s[3]):(e=N.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,i=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(o=>{this.opts[o]===void 0?this.opts[o]=i:(e=N.parseHeight(this.opts[o]),this.opts[o]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const r=this.el.style;return r.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return nt}static setupDragIn(e,i,s,n=document){i?.pause!==void 0&&(ce.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof e=="string"?N.getElements(e,n):e).forEach((o,l)=>{nt.isDraggable(o)||nt.dragIn(o,i),s?.[l]&&(o.gridstackNode=s[l])})}movable(e,i){return this.opts.staticGrid?this:(le.getElements(e).forEach(s=>{const n=s.gridstackNode;n&&(i?delete n.noMove:n.noMove=!0,this.prepareDragDrop(n.el))}),this)}resizable(e,i){return this.opts.staticGrid?this:(le.getElements(e).forEach(s=>{const n=s.gridstackNode;n&&(i?delete n.noResize:n.noResize=!0,this.prepareDragDrop(n.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,i=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.enableMove(e,i)}),this)}enableResize(e,i=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.enableResize(e,i)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&le._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return nt.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return nt.droppable(this.el,"destroy"),this;let e,i;const s=(n,r,o)=>{o=o||r;const l=o.gridstackNode;if(!l)return;if(!l.grid?.el){o.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const y=o.getBoundingClientRect();o.style.left=y.x+(this.dragTransform.xScale-1)*(n.clientX-y.x)/this.dragTransform.xScale+"px",o.style.top=y.y+(this.dragTransform.yScale-1)*(n.clientY-y.y)/this.dragTransform.yScale+"px",o.style.transformOrigin="0px 0px"}let{top:u,left:d}=o.getBoundingClientRect();const c=this.el.getBoundingClientRect();d-=c.left,u-=c.top;const h={position:{top:u*this.dragTransform.xScale,left:d*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(d/i)),l.y=Math.max(0,Math.round(u/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){nt.off(r,"drag");return}l._willFitPos&&(N.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(o,n,h,l,i,e)}else this._dragOrResize(o,n,h,l,i,e)};return nt.droppable(this.el,{accept:n=>{const r=n.gridstackNode||this._readAttr(n,!1);if(r?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let o=!0;if(typeof this.opts.acceptWidgets=="function")o=this.opts.acceptWidgets(n);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;o=n.matches(l)}if(o&&r&&this.opts.maxRow){const l={w:r.w,h:r.h,minW:r.minW,minH:r.minH};o=this.engine.willItFit(l)}return o}}).on(this.el,"dropover",(n,r,o)=>{let l=o?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(r,o),o=o||r,i=this.cellWidth(),e=this.getCellHeight(!0),!l){const c=o.getAttribute("data-gs-widget")||o.getAttribute("gridstacknode");if(c){try{l=JSON.parse(c)}catch{console.error("Gridstack dropover: Bad JSON format: ",c)}o.removeAttribute("data-gs-widget"),o.removeAttribute("gridstacknode")}l||(l=this._readAttr(o)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,o.gridstackNode=l);const u=l.w||Math.round(o.offsetWidth/i)||1,d=l.h||Math.round(o.offsetHeight/e)||1;return l.grid&&l.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=l),r.gridstackNode=l={...l,w:u,h:d,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=u,l.h=d,l._temporaryRemoved=!0),le._itemRemoving(l.el,!1),nt.on(r,"drag",s),s(n,r,o),!1}).on(this.el,"dropout",(n,r,o)=>{const l=o?.gridstackNode||r.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(r,o),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(n,r,o)=>{const l=o?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const u=!!this.placeholder.parentElement,d=r!==o;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const c=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,u&&c?.grid&&c.grid!==this){const y=c.grid;y.engine.removeNodeFromLayoutCache(c),y.engine.removedNodes.push(c),y._triggerRemoveEvent()._triggerChangeEvent(),y.parentGridNode&&!y.engine.nodes.length&&y.opts.subGridDynamic&&y.removeAsSubGrid()}if(!l||(u&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,nt.off(r,"drag"),o!==r?(o.remove(),r=o):r.remove(),this._removeDD(r),!u))return!1;const h=l.subGrid?.el?.gridstack;return N.copyPos(l,this._readAttr(this.placeholder)),N.removePositioningStyles(r),d&&(l.content||l.subGridOpts||le.addRemoveCB)?(delete l.el,r=this.addWidget(l)):(this._prepareElement(r,!0,l),this.el.appendChild(r),this.resizeToContentCheck(!1,l),h&&(h.parentGridNode=l),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...n,type:"dropped"},c&&c.grid?c:void 0,l),!1}),this}static _itemRemoving(e,i){if(!e)return;const s=e?e.gridstackNode:void 0;!s?.grid||e.classList.contains(s.grid.opts.removableOptions.decline)||(i?s._isAboutToRemove=!0:delete s._isAboutToRemove,i?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!nt.isDroppable(e)&&nt.droppable(e,this.opts.removableOptions).on(e,"dropover",(i,s)=>le._itemRemoving(s,!0)).on(e,"dropout",(i,s)=>le._itemRemoving(s,!1)),this):this}prepareDragDrop(e,i=!1){const s=e?.gridstackNode;if(!s)return;const n=s.noMove||this.opts.disableDrag,r=s.noResize||this.opts.disableResize,o=this.opts.staticGrid||n&&r;if((i||o)&&(s._initDD&&(this._removeDD(e),delete s._initDD),o))return e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!s._initDD){let l,u;const d=(y,S)=>{this.triggerEvent(y,y.target),l=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,y,S,s,l,u)},c=(y,S)=>{this._dragOrResize(e,y,S,s,l,u)},h=y=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete s._moving,delete s._resizing,delete s._event,delete s._lastTried;const S=s.w!==s._orig.w,C=y.target;if(!(!C.gridstackNode||C.gridstackNode.grid!==this)){if(s.el=C,s._isAboutToRemove){const T=e.gridstackNode.grid;T._gsEventHandler[y.type]&&T._gsEventHandler[y.type](y,C),T.engine.nodes.push(s),T.removeWidget(e,!0,!0)}else N.removePositioningStyles(C),s._temporaryRemoved?(this._writePosAttr(C,s),this.engine.addNode(s)):this._writePosAttr(C,s),this.triggerEvent(y,C);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),y.type==="resizestop"&&(Number.isInteger(s.sizeToContent)&&(s.sizeToContent=s.h),this.resizeToContentCheck(S,s))}};nt.draggable(e,{start:d,stop:h,drag:c,rtl:this.opts.rtl}).resizable(e,{start:d,stop:h,resize:c,rtl:this.opts.rtl}),s._initDD=!0}return nt.draggable(e,n?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,i,s,n,r,o){if(this.engine.cleanNodes().beginUpdate(n),this._writePosAttr(this.placeholder,n),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=n,n.grid?.el)this.dragTransform=N.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=N.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(n.el=this.placeholder,n._lastUiPosition=s.position,n._prevYPix=s.position.top,n._moving=i.type==="dragstart",n._resizing=i.type==="resizestart",delete n._lastTried,i.type==="dropover"&&n._temporaryRemoved&&(this.engine.addNode(n),n._moving=!0),this.engine.cacheRects(r,o,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const l=this.getColumn()-n.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-n.y;nt.resizable(e,"option","minWidth",r*Math.min(n.minW||1,l)).resizable(e,"option","minHeight",o*Math.min(n.minH||1,u)).resizable(e,"option","maxWidth",r*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,n.x+n.w)).resizable(e,"option","maxHeight",o*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",o*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,n.y+n.h))}}_dragOrResize(e,i,s,n,r,o){const l={...n._orig};let u,d=this.opts.marginLeft,c=this.opts.marginRight,h=this.opts.marginTop,y=this.opts.marginBottom;const S=Math.round(o*.1),C=Math.round(r*.1);if(d=Math.min(d,C),c=Math.min(c,C),h=Math.min(h,S),y=Math.min(y,S),i.type==="drag"){if(n._temporaryRemoved)return;n._prevYPix=s.position.top,this.opts.draggable.scroll!==!1&&ce.dragElement?.updateScrollPosition(this.el);const P=s.position.left+(s.position.left>n._lastUiPosition.left?-c:d),F=s.position.top+(s.position.top>n._lastUiPosition.top?-y:h);l.x=Math.round(P/r),l.y=Math.round(F/o);const D=this._extraDragRow;if(this.engine.collide(n,l)){const re=this.getRow();let x=Math.max(0,l.y+n.h-re);this.opts.maxRow&&re+x>this.opts.maxRow&&(x=Math.max(0,this.opts.maxRow-re)),this._extraDragRow=x}else this._extraDragRow=0;if(this._extraDragRow!==D&&this._updateContainerHeight(),n.x===l.x&&n.y===l.y)return}else if(i.type==="resize"){if(l.x<0||(N.updateScrollResize(i,e,o),l.w=Math.round((s.size.width-d)/r),l.h=Math.round((s.size.height-h)/o),n.w===l.w&&n.h===l.h)||n._lastTried&&n._lastTried.w===l.w&&n._lastTried.h===l.h)return;if(i.hasMovedX){const P=s.position.left+d;l.x=Math.round(P/r)}if(i.hasMovedY){const P=s.position.top+h;l.y=Math.round(P/o)}u=!0}n._event=i,n._lastTried=l;const T={x:s.position.left+d,y:s.position.top+h,w:(s.size?s.size.width:n.w*r)-d-c,h:(s.size?s.size.height:n.h*o)-h-y};if(this.engine.moveNodeCheck(n,{...l,cellWidth:r,cellHeight:o,rect:T,resizing:u})){n._lastUiPosition=s.position,this.engine.cacheRects(r,o,h,c,y,d),delete n._skipDown,u&&n.subGrid&&n.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const P=i.target;n._sidebarOrig||this._writePosAttr(P,n),this.triggerEvent(i,P)}}triggerEvent(e,i){let s=this;for(;s.parentGridNode;)s=s.parentGridNode.grid;s._gsEventHandler[e.type]&&s._gsEventHandler[e.type](e,i)}_leave(e,i){i=i||e;const s=i.gridstackNode;if(!s||(i.style.transform=i.style.transformOrigin=null,nt.off(e,"drag"),s._temporaryRemoved))return;s._temporaryRemoved=!0,this.engine.removeNode(s),s.el=s._isExternal&&i?i:e;const n=s._sidebarOrig;s._isExternal&&this.engine.cleanupNode(s),s._sidebarOrig=n,this.opts.removable===!0&&le._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):s._isExternal&&this.engine.restoreInitial()}}le.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)};le.resizeToContentParent=".grid-stack-item-content";le.Utils=N;le.Engine=Gt;le.GDRev="12.6.0";const ac="/backend/api/hmi/v1";class Zo extends Error{constructor(e,i){super(i),this.status=e,this.name="HmiHttpError"}status}let oi=null;function el(){return oi}async function uc(t,e,i){return oi=await be("/security/login","POST",{username:t,password:e,station:i}),oi}async function cc(){try{await be("/security/logout","POST",{})}finally{oi=null}}async function Dr(){return oi=await be("/security/csrf","GET"),oi}async function be(t,e="GET",i){const s={Accept:"application/json"};i!==void 0&&(s["Content-Type"]="application/json"),e!=="GET"&&e!=="HEAD"&&oi&&(s["X-CSRF-Token"]=oi.csrf);const n=await fetch(`${ac}${t}`,{method:e,headers:s,credentials:"same-origin",body:i===void 0?void 0:JSON.stringify(i)}),r=await n.text();let o;try{o=r?JSON.parse(r):{}}catch{o={error:r.slice(0,300)}}if(!n.ok){const l=n.status===401?"Keine IMSAPI-Anmeldung. Bitte Benutzer, Passwort und Station eingeben.":n.status===403?"HMI-Berechtigung fehlt oder CSRF ist ungültig (HTTP 403).":n.status===503?"Datenbank bzw. HMI-Schema nicht bereit (HTTP 503). Siehe Diagnose.":o?.error&&!String(o.error).trim().startsWith("<")?String(o.error)+(typeof o.imsapiReturnValue=="number"?" [IMSAPI "+o.imsapiReturnValue+"]":""):`${e} ${t}: HTTP ${n.status}`;throw new Zo(n.status,l)}return o}const dc=[{id:"station-tree",type:"wb.station-tree",x:0,y:0,w:7,h:6,mandatory:!1,personalizable:!0,props:{title:"Fertigungsbaum"}},{id:"history",type:"wb.history",x:7,y:0,w:5,h:4,mandatory:!1,personalizable:!0,props:{title:"History & Booking",module:"history"}},{id:"workorder",type:"wb.workorders",x:7,y:4,w:5,h:3,mandatory:!1,personalizable:!0,props:{title:"Auftragsaktivierung",module:"workorder"}},{id:"config",type:"wb.station-config",x:0,y:6,w:7,h:6,mandatory:!1,personalizable:!0,props:{title:"Stationskonfiguration",source:"station-config"}},{id:"activities",type:"wb.activities",x:7,y:7,w:5,h:4,mandatory:!1,personalizable:!0,props:{title:"Manuelle Fertigung",module:"activities"}}],sn={layout:{widgets:dc},preferences:{fontScale:1,theme:"ios",contrast:"normal",accent:"#a40640"}},fc={800:"SMS_MOBIL_PHONE_NR",1e3:"Flag PASS",1001:"Flag REWORK",1002:"Flag SCRAP",1010:"Failure record type",1011:"Channel number",1100:"Supplier type",1101:"Failure type category",1102:"Failure reason category",1103:"Keyboard type",1104:"State type",2e3:"Digitizer type",2001:"X-REF1",2002:"Y-REF1",2003:"X-REF2",2004:"Y-REF2",4001:"RETURN_RJOU_THRESHOLD",4010:"BDE THRESHOLD",4011:"Account TR-BDE conforming to shift(TRUE/FALSE)",4012:"Do TR to RM booking only when previous workstep has enough PASS(TRUE/FALSE)",4015:"Workorder time",4016:"QM-Analyses: Use RM-Good-Bookings (TRUE/FALSE) (Default: TR-bookings are used)",5001:"Password Scrap",6e3:"SCANNER-BARCODE",6001:"SCANNER-BOARD-SNR",7003:"UTILS_PART_DNC_SCHEMA",7004:"UTILS_PART_FILE_ID_SCHEMA",7005:"Target directory Schema",7006:"UTILS_PART_DNC_LAYOUT",7007:"UTILS_PART_FILE_ID_LAYOUT",7008:"Target directory Layout",7010:"Target directory CDB_DATA LAYOUT",7011:"PR Open 2nd view in Layouter(TRUE/FALSE)",7012:"PR File extension for 2nd viewer file",7013:"Paternoster active (TRUE/FALSE)",7020:"Source directory Layout",7021:"Source directory Viewer",7022:"Target directory Viewer",7023:"Call Layout",7024:"Call Viewer",7025:"Start Layouter automatically (TRUE/FALSE)",7026:"BOM Check in PR automatically (TRUE/FALSE)",7027:"BOM check with status (TRUE/FALSE)",7028:"BOM check with quantity (TRUE/FALSE)",7029:"SETUP Tear down locked reels automatically (TRUE/FALSE)",7033:"CopyViewerData (TRUE/FALSE) [TRUE]=Copy, [FALSE] do not copy",7100:"Layouter class",7101:"Layout active (TRUE/FALSE)",7102:"Viewer active (TRUE/FALSE)",7103:"Digitizer active (TRUE/FALSE)",7104:"OPMA_KAP active (TRUE/FALSE)",7105:"OPMA_MAGRP active (TRUE/FALSE)",7106:"Number of opm uploads the server should cache for station",7107:"Reset OPM-A Kap Cache on product change (TRUE/FALSE)",7108:"Reset OPM-A Kap Cache on workorder change (TRUE/FALSE)",7109:"Reset OPM-A Kap Cache on shift change (TRUE/FALSE)",7110:"Cycle time active (TRUE/FALSE)",7120:"(PR) Workstep query serial no (TRUE/FALSE)",7125:"PR Tester dialog always active (TRUE/FALSE)",7126:"PR Setup dialog always active (TRUE/FALSE)",7127:"Register active PR workorder (TRUE/FALSE)",7128:"PR Panel Flag N Snr Register single (TRUE/FALSE)",7129:"PR Check always serial number state (TRUE/FALSE)",7130:"PR Merge to next level (TRUE/FALSE)",7131:"PR Merge with equal serial no (TRUE/FALSE)",7132:"Activated only if BOM-Check ok (TRUE/FALSE)",7133:"Default Position Pattern",7134:"Check expiration (TRUE/FALSE)",7135:"Enable multiple positions for same part (TRUE/FALSE)",7136:"Enable create container in setup dialog (TRUE/FALSE)",7137:"Print label config file",7138:"Print label output",7139:"Maximum number of repairs",7140:"Repair counting for all uploads (TRUE/FALSE)",7141:"Exceeding repairs procedure (0, 1, 2)",7150:"Panel-related setup (TRUE/FALSE)",7160:"PR Setup Station Activate Work Order (TRUE/FALSE)",7200:"ICT Failure type",7201:"FailureCode for checkSerialUnitState book fail",7202:"TR Automatic upload state of previous work step (FALSE/L/W)",7203:"API Check all previous steps concerning uploaded state (TRUE/FALSE)",7204:"API Test Retry counter for CheckState (J/N/D)",7205:"API_GETSNRBYSNRREF_SINGLE_ERROR (TRUE/FALSE)",7206:"API_Check_merge_to_BOM (TRUE/FALSE) TRUE=check BOM Qty",7207:"API_UNMERGEPARTS deactivate (M)aster, (S)lave or (N)othing",7208:"API_IGNORE_SNR_UNIQUE_FOR_MERGE (TRUE/FALSE)",7209:"Loop counter only for active error codes (TRUE/FALSE)",7210:"CHECK_ANOMALY_FOR_RESULT_DATA (TRUE/FALSE)",7211:"CHECK_ANOMALY_ERROR_CODE (Errorcode for attributive error)",7212:"CHECK_ANOMALY_FAILCODE (Failcode for measurecode_wert)",7213:"CHECK_ANOMALY_RESET_TIME (ResetTime in sec)",7214:"CHECK_ANOMALIE_FOR_2ND_UPLOAD_INFLUENCE_code_wertS",7215:"CHECK_ANOMALIE_FOR_2ND_UPLOAD_CHANGE_MODEL",7216:"CHECK_ANOMALIE_PSEUDO_ERROR_CODE",7217:"Check the Batch Quantity in API-Call verifyMerge (TRUE/FALSE)",7218:"CODE_API_CHECK_MERGED_PARTS_COMPLETE (TRUE/FALSE)",7219:"API Check merge to BOM with client version (TRUE/FALSE) TRUE=check BOM Qty",7220:"Report Merge to ERP-System (TRUE/FALSE)",7221:"PR_UNMERGE_EXTENSION free Text(WO actual WorkOrder)",7222:"SWITCH_SERIALNO_AFTER_MERGE (TRUE/FALSE)",7223:"Enable check for consecutive fault (TRUE/FALSE)",7224:"Cancel Upload on station locked (TRUE/FALSE)",7225:"Add Time[min] for Messages :mdcUploadStationCondition endDate = (startDate + X)",7226:"Check code: 16000 to resolve the state of the serial number (TRUE/FALSE)",7227:"Tranfer MDC station conditions to ERP (TRUE/FALSE)",7228:"Max. quantity off registered batches at station",7230:"Correction factor for cycle time",7250:"SPA_FUNCTION_AVAILABLE",7251:"SPA_RESET_TIME (in seconds)",7252:"SPA_SET_REWORK_ON_CP_ERROR",7253:"SPA_REWORK_ON_CPK_ERROR",7254:"SPA_ASSIGN_CP_ERROR_CODE",7255:"SPA_ASSIGN_CP_PSEUDO_ERROR_CODE",7256:"SPA_ASSIGN_CPK_ERROR_CODE",7257:"SPA_ASSIGN_CPK_PSEUDO_ERROR_CODE",7258:"API_ANOMALY_CHECK_RETURN_ENABLED",7260:"CHECK_ORDER_NET_FOR_MERGE",7320:"Refer to Serial no (S), Position (P) or both (-)",7400:"upload->update single mat qty (FALSE, TRUE, KONSI)",7401:"upload->update mat qty for all bookings (FALSE, TRUE)",7402:"update mat qty: 0 = as 7401, 1 = first PASS, 2 = each PASS, 3 = first PASS/SCRAP, 4 = each PASS/SCRAP",7450:"default cost center number used for material booking",7510:"Serialnumber-Generation: Fix part for station",7666:"Derivation Manufacturing type",7777:"Product types of external charges",8e3:"Account state in config management (TRUE/FALSE)",8100:"Check recipes (0, 1, 10)",8101:"Check recipes for trUploadStationResult compatible to trUploadResultDataAndRecipe by configuration parameter 8100 (TRUE/FALSE)",8110:"Check Recipe of completeness (TRUE/FALSE)",8200:"Active Recipe necessary for upload result data (J/N)",8300:"Register user required for upload (TRUE/FALSE)",8310:"API processLayer is workplan Avo or Workstep (L/A/W)",8320:"Keep selected process layer in Shipping-Module (TRUE/FALSE)",8400:"Equipment-Bookings during API-Upload (TRUE/FALSE)",8401:"AssetEquipment-Bookings during API-Upload (TRUE/FALSE)",8402:"Cavity-Bookings during API-Upload (TRUE/FALSE)",8410:"Allow multiple equipment setup on same station (TRUE/FALSE)",8411:"Amount of multiple equipment setup on same station",8500:"Transfer completed batches to ERP",8510:"Transfer serials to ERP: 0 = all, 1 = first PASS, 2 = all PASS, 3 = first PASS/SCRAP, 4 = all PASS/SCRAP",8610:"API-getBinInfo LocationNo Mode (0=OLD, 1=ONLY NUMBER, 2=COMPLETE PATH)",9011:"API-getRecipeDataStrictObjectTypeValidation Mode (0=compatible mode, 1=strict mode)",1e4:"FAILDAT_Z1800",10001:"FAILDAT_Z8000",10002:"FAILDAT_SPEA",10003:"FAILDAT_GENRAD",11e3:"PSEUDO_COMPTYPE_FAILICT",12e3:"CONFIG_NO_COMPTYPE",13e3:"TESTSTEP_MODE (OBJECT_ID, OBJECT_ID&STK_VERS, LP_ID)",13010:"CHECK_ONLY_PREVIOUS_LOOP_COUNTER (TRUE/FALSE)",13011:"CHECK_OWN_STATUS_ON_FIRST_WS (TRUE/FALSE)",13020:"WO_CHECK_NEEDS_RECIPE",13021:"WO_CHECK_NEEDS_CUSTOMER",13100:"Skip BOM-Check (TRUE/FALSE)",13110:"Activate setup immediately (TRUE/FALSE)",13111:"SETUP_ACTIVATION_ON_LAST_USED_WORKORDER (TRUE/FALSE)",13120:"Line based setup activation (TRUE/FALSE)",13125:"Open msl package while setup on smt line automatically (false/activation/setup)",13130:"Refill only same parts at the same setup position (TRUE/FALSE)",13140:"Type for reading setup-data sequences: A = all, F = first, L = last",13145:"BOM Check with additional components (TRUE/FALSE)",13150:"BOM Check for all boards of multi panels (TRUE/FALSE)",13161:"SMT wait for bomCheck timeout in sec",13162:"SMT wait for bomCheck interval in ms",13163:"SMT wait for bomCheck mode(0=off, 1=all machines in one ws, 2=check previous ws)",13170:"SMT book omitted serials (TRUE/FALSE)",13200:"KAP_TYP_M reference",13300:"Always check actual production order (TRUE/FALSE)",13301:"enable ProductionOrder-State check (TRUE/FALSE)",13302:"Finish production order when qty reached (0-No, 1-all..., 2-last..., 3-first workstep)",13310:"Always check actual other orders than production order (TRUE/FALSE)",13311:"enable Order-State check for other orders than ProductionOrder (TRUE/FALSE)",13312:"Finish other orders than production order when qty reached (0-No, 1-all..., 2-last..., 3-first workstep)",13400:"Allow merge multipanel scrap (TRUE/FALSE)",13410:"Override scrap on same workstep (TRUE/FALSE)",13420:"Allow changing serialNumber state to OK (TRUE/FALSE)",13600:"API: attribGetAttributecode_werts -> enable complete check (TRUE/FALSE)",14e3:"Activate OpmMd (TRUE/FALSE)",15e3:"Limit Residual time share of Overhead Costs in Percent",15001:"Storage assignment barcode",15002:"Auto. shift to stock(15001) while setup (0=off, 1=to machine, 2=to machine and back to default)",15003:"Store in transaction type while setup",15004:"Store in transaction type while tear down",15100:"ONLY_MATLABEL_SETUP (TRUE/FALSE)",15200:"Create new failure type from measuring result (TRUE/FALSE)",15201:"Level of new failure type (0, 1, 2)",15210:"Use intervention limit from previous recipe(R), station(K) default code_werts(D)",15211:"Intervention limit Ok (in percent, 0 - 100)",15212:"Intervention limit scrap (in percent, >=100)",15220:"Update recipe-teststeps on upload if measurement-type changes (0 Dont compare measurement-type, 1 Only changes to DYNAMIC...,2 Any change)",15250:"generate pseudo errors for measure code_werts with these failcodes(sep. by [;] )",15260:"no OPM data for measure code_werts with these failcodes(sep. by [;] )",15270:"Size of the returned array size for api functions",15280:"Lock station exclusive (TRUE/FALSE)",15300:"API queryTestData: Fetch data uploaded with -1, (TRUE, FALSE(default)).",16e3:"Rep- or Diag place: Terminate workstep (TRUE/FALSE)",16001:"Ignore booking of repair/diag station when not allowed to close work step (Y/N/A)",16100:"Uploads from this station are Testplan-relevant and count for SampleCaches (TRUE/FALSE)",18e3:"ERP line number for confirmation",18200:"Allow bookings for SerialNumbers that are already set to scrap (off|check|checkAll|-1= Use PlantConfig 18200)",18500:"All Atribute get APIs will use equal(0) or like (1) in case of search condition",18510:"Attribute-Search: Treat empty string as wildcard (TRUE/FALSE)",2e4:"MDE Prod time calculation with station snr booking (0) or with condition (1)",20001:"MDE OEE calculation with Yield (0) or with FPY (1)",20002:"MDE NEE calculation with Yield (0) or with FPY (1)",20003:"MDE Placing performance calculation with component (0) or with unit (1)",20004:"MDE MTBF calculation with operational time (0) or with uptime (1)",20011:"Calculation method (0) overall performance (1) weighted average",20013:"MDE OEE calculation with total availability (0) or with organizatonal (1) or with technical (2) or with system-related (3)",20014:"Cycle time calculation with time range (0) or with productive time acc. to shift timetable (1)",21001:"SNR_MAT_ID of active shipping lot of this station",21002:"object_id of default Lot-Product for Lot in Lot",21003:"object_id of default Lot-Part for serial in Lot",21004:"Default Customer",21005:"SHIPPING: No automatic serial check for addSnrTOLot (TRUE/FALSE)",21010:"Suppress ERP-Feedback Sno <-> Lot (TX: 810,811) (TRUE/FALSE)",21012:"Suppress ERP-Feedback Lot <-> Lot (TX: 820,821,822,823) (TRUE/FALSE)",21016:"Suppress ERP-Feedback Lot Create/Complete/Reopen/Finish (TX: 830,831,832,833) (TRUE/FALSE)",21020:"Lock handling for shipping (I = ignore, F = forbidden, L = locked only)",22e3:"Automatic depaneling of multipanels (FALSE/TRUE)",25001:"Fix API mdataGetBomData: switch off processbased (FALSE/TRUE)",25002:"IMSAPI: trAssignSerialNumberMergeAndUploadState -> book scrap (FALSE/TRUE)",25003:"API: verifyMergeBySnrRef fix errorcode -2 when not finished (FALSE/TRUE)",25004:"API: Allow booking on merged(inactive) serial no (FALSE/TRUE)",25010:"EWAPI: getBomItems suppress BomItems with 0 Quantity in Grouped Mode:2 (TRUE/FALSE)",25020:"IMSAPI: Set mdataGetBomData() compatible to 8.52.00 changes (TRUE/FALSE)",25030:"IMSAPI: Correct trCheckSerialNumberState() in case of scrap and open work steps in multi panel (TRUE/FALSE)",25040:"IMSAPI: Set trGetSerialNumberUploadInfo() compatible to 8.50.01 (TRUE/FALSE)",25050:"Leave packaging information to manufacturing serial number when add to change order (TRUE/FALSE)",25100:"IMSAPI: Send new created material bin immediately to ERP (TRUE/FALSE)",26002:"PFDC booking : User authentication required",27e3:"Transfer Equipment usage for PFDC Booking to ERP",28001:"Publish and subscribe messages for workorders",28002:"Pub/Sub-Messaging for EQUIPMENT (TRUE/FALSE)",28003:"Pub/Sub-Messaging for MATERIAL SETUP (TRUE/FALSE)",28004:"Pub/Sub Messaging for STATION MEASUREMENT (TRUE/FALSE)",28005:"Pub/Sub Messaging for SERIAL NUMBER MEASUREMENT (TRUE/FALSE)",28006:"Pub/Sub Messaging for SERIAL NUMBER FAILURE (TRUE/FALSE)",28007:"Pub/Sub Messaging for STATION CONDITION (TRUE/FALSE)",3e4:"Line attribute"},$i={contacts:{path:"/backend/api/getContact",title:"Kontakte",fields:["PARTNER_NR","NAME","STREET","CITY"]},"erp-groups":{path:"/backend/api/getERPGroups",title:"ERP-Gruppen",fields:["erp_grp_nr","erp_grp_bez","kap_nr"]},users:{path:"/backend/api/getUsers",title:"Benutzer",fields:["user_id","user_name","user_firstname","gender"]},"station-config":{path:"/backend/api/getStationConfig",title:"Konfiguration",fields:["code_nr","code_wert","timestamp","changedby"]},stations:{path:"/backend/api/getStationExport",title:"Stationen",fields:["kap_nr","kap_bez","ma_grp_nr","ma_grp_bez","line_nr","line_bez"]}};function hc(t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call($i,t)}function tl(t){return/^[A-Za-z0-9_.-]{1,100}$/.test(t)}async function il(t,e,i){const s=Object.entries($i).find(([,o])=>o.path===t)?.[0]??(t==="/backend/api/getStations"?"station-tree":"");if(!s)throw new Error("Unbekannte API");if(!tl(e))throw new Error("Bitte eine gültige Stationsnummer eingeben");const n=await fetch("/backend/api/hmi/v1/legacy/"+s+"?station="+encodeURIComponent(e),{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"},signal:i,cache:"no-store"}),r=await n.json();if(!n.ok)throw new Error(r&&typeof r=="object"&&"error"in r?String(r.error):"HMI API "+n.status);return r}function pc(t){return Array.isArray(t)?t.filter(e=>e!==null&&typeof e=="object"&&!Array.isArray(e)).map(e=>Object.fromEntries(Object.entries(e).map(([i,s])=>[i.toLowerCase(),s]))):[]}const Gn={workorder:{path:"/backend/Workorder.html",heading:"Auftragsaktivierung",detail:"Auftrag und Prozesslage prüfen und aktivieren",action:"Zur Auftragsaktivierung"},history:{path:"/backend/HistoryBooking.html",heading:"History & Booking",detail:"Seriennummern prüfen, Statusumbuchungen und Buchungshistorie",action:"History & Booking öffnen"},activities:{path:"/backend/Activities_rest.html",heading:"Manuelle Fertigung",detail:"Activity-Buchungen, Fehlermeldungen, Messwerte und Setup",action:"Manuelle Fertigung öffnen"},"activity-designer":{path:"/backend/Activity_designer_rest.html",heading:"Activity Designer",detail:"Activities und Rezepte verwalten",action:"Activity Designer öffnen"},bom:{path:"/backend/BOMImport.html",heading:"Stückliste / BOM",detail:"Excel importieren und Stücklisten aktualisieren",action:"BOM-Verwaltung öffnen"},part:{path:"/backend/PARTImport.html",heading:"Material / PART",detail:"Teile und Materialstammdaten importieren",action:"Materialverwaltung öffnen"},station:{path:"/backend/Station.html",heading:"Stationsexport/-import",detail:"Stationsbaum und Excel-Import / Export",action:"Stationsverwaltung öffnen"},erp:{path:"/backend/ErpAdd.html",heading:"ERP-Gruppen",detail:"ERP-Gruppen importieren",action:"ERP-Gruppen öffnen"},contact:{path:"/backend/Contacts.html",heading:"Kontakte",detail:"Kontaktdaten und Excel-Dateien",action:"Kontaktverwaltung öffnen"},user:{path:"/backend/Useradd.html",heading:"Benutzerimport",detail:"Benutzerstammdaten importieren",action:"Benutzerimport öffnen"}};function gc(t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(Gn,t)}function jn(t,e,i){if(e&&!tl(e))throw new Error("Ungültige Stationsnummer");e&&sessionStorage.setItem("stationNumber",e),sessionStorage.setItem("url",window.location.origin),i&&/^[A-Za-z0-9_.:/-]{1,120}$/.test(i)&&sessionStorage.setItem("hmiLastSerial",i);const s=new URLSearchParams;t==="station"&&e&&s.set("station",e),i&&["history","activities"].includes(t)&&s.set("serial",i);const n=Gn[t].path+(s.toString()?"?"+s.toString():""),r=window.open(n,"_blank");r?r.opener=null:window.location.assign(n)}function mc(t,e){if(!t.length)return;const i=[...new Set(t.flatMap(l=>Object.keys(l)))],s=l=>'"'+String(l??"").replace(/"/g,'""')+'"',n="\uFEFF"+[i.map(s).join(";"),...t.map(l=>i.map(u=>s(l[u])).join(";"))].join(`\r -`),r=URL.createObjectURL(new Blob([n],{type:"text/csv;charset=utf-8"})),o=document.createElement("a");o.href=r,o.download=e,o.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}const vc={class:"wb-data-table"},bc={class:"wb-toolbar"},yc={class:"wb-meta"},wc={class:"wb-hint"},Ec={class:"wb-inline-actions"},_c=["disabled"],Sc={class:"wb-filter"},Rc=["aria-label"],Ac={key:0,class:"wb-alert",role:"alert"},kc={key:1,class:"wb-placeholder"},Tc={key:2,class:"wb-table-scroll"},Cc={class:"wb-table"},Nc={key:0},Oc=["colspan"],Mc={class:"wb-footer"},xc={class:"wb-inline-actions"},Pc=["disabled"],Ic=["disabled"],Lc=He({__name:"LegacyTableWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=ie(()=>hc(e.widget.props.source)?e.widget.props.source:"contacts"),s=ie(()=>String(e.station||e.widget.props.station||"")),n=A(""),r=A([]),o=A(!1),l=A(""),u=A(1);let d=null;const c=ie(()=>Math.max(5,Math.min(100,Number(e.widget.props.limit)||20))),h=ie(()=>{const x=r.value,j=i.value==="station-config"?["code_nr","description","code_wert","changedby","timestamp"]:$i[i.value].fields.map(Z=>Z.toLowerCase()),G=[...new Set(x.flatMap(Z=>Object.keys(Z)))];return[...j.filter(Z=>G.includes(Z)),...G.filter(Z=>!j.includes(Z))].slice(0,18)}),y=ie(()=>r.value.filter(x=>Object.values(x).some(j=>String(j??"").toLocaleLowerCase("de").includes(n.value.toLocaleLowerCase("de"))))),S=ie(()=>Math.max(1,Math.ceil(y.value.length/c.value))),C=ie(()=>y.value.slice((u.value-1)*c.value,u.value*c.value)),T=x=>({description:"Beschreibung",contact_code:"Kontakt-Nr.",contact_name:"Kontakt",artikel:"Artikel",artbez:"Artikelbeschreibung",part_ext:"Teile-Nr.",art_bez_ext:"Teilebeschreibung",is_manufacturer:"Hersteller",is_customer:"Kunde",is_supplier:"Lieferant",code_nr:"Code",code_wert:"Wert",timestamp:"Geändert am",changedby:"Geändert von",user_id:"Benutzer-ID",user_name:"Nachname",user_firstname:"Vorname",gender:"Anrede",erp_grp_nr:"ERP-Gruppe",erp_grp_bez:"Bezeichnung",kap_nr:"Station",kap_bez:"Station Bezeichnung",line_nr:"Linie",line_bez:"Linie Bezeichnung",ma_grp_nr:"Maschinengruppe",ma_grp_bez:"Maschinengruppe Bezeichnung"})[x]||x.replace(/_/g," ");function P(x){return x==null||x===""?"—":typeof x=="object"?JSON.stringify(x):String(x)}async function F(){if(d?.abort(),r.value=[],l.value="",u.value=1,e.demo){r.value=[{code_nr:"1401",code_wert:"1",changedby:"Demo",timestamp:"2026-10-20"},{code_nr:"1402",code_wert:"0",changedby:"Demo",timestamp:"2026-10-20"}];return}if(!s.value){l.value="Stationsnummer im Kopfbereich eingeben";return}const x=new AbortController;d=x,o.value=!0;try{const j=await il($i[i.value].path,s.value,x.signal);r.value=pc(j).map(G=>i.value==="station-config"?{...G,description:fc[String(G.code_nr)]||"—"}:G)}catch(j){x.signal.aborted||(l.value=String(j instanceof Error?j.message:j))}finally{d===x&&(o.value=!1)}}st([i,s,()=>e.demo],F,{immediate:!0}),st(n,()=>u.value=1),vi(()=>d?.abort());const D=ie(()=>i.value==="users"?"user":i.value==="contacts"?"contact":i.value==="erp-groups"?"erp":(i.value==="stations","station"));function re(){try{jn(D.value,s.value)}catch(x){l.value=String(x)}}return(x,j)=>(g(),m("section",vc,[a("div",bc,[a("div",yc,[a("span",{class:xe(["wb-live-dot",{inactive:!!l.value}])},null,2),a("b",null,E(y.value.length),1),j[4]||(j[4]=Q(" Datensätze ",-1)),a("span",wc,"· "+E(s.value||"Keine Station"),1)]),a("div",Ec,[a("button",{type:"button",class:"wb-btn wb-btn-icon",title:"Neu laden",onClick:F},"↻"),a("button",{type:"button",class:"wb-btn wb-btn-icon",disabled:!r.value.length,title:"CSV exportieren",onClick:j[0]||(j[0]=G=>Ge(mc)(y.value,"hmi-"+i.value+".csv"))},"⇩",8,_c)])]),a("div",Sc,[j[5]||(j[5]=a("span",{class:"wb-search-icon"},"⌕",-1)),ae(a("input",{"onUpdate:modelValue":j[1]||(j[1]=G=>n.value=G),"aria-label":"Suche in "+Ge($i)[i.value].title,placeholder:"Suche in allen Spalten ..."},null,8,Rc),[[Ae,n.value]])]),l.value?(g(),m("div",Ac,E(l.value),1)):o.value?(g(),m("div",kc,"Daten werden geladen …")):$("",!0),o.value?$("",!0):(g(),m("div",Tc,[a("table",Cc,[a("thead",null,[a("tr",null,[(g(!0),m(K,null,ge(h.value,G=>(g(),m("th",{key:G},E(T(G)),1))),128))])]),a("tbody",null,[(g(!0),m(K,null,ge(C.value,(G,Z)=>(g(),m("tr",{key:Z},[(g(!0),m(K,null,ge(h.value,ee=>(g(),m("td",{key:ee},[ee==="code_wert"&&["TRUE","FALSE"].includes(String(G[ee]).toUpperCase())?(g(),m("span",{key:0,class:xe(["wb-value-pill",String(G[ee]).toUpperCase()==="TRUE"?"on":"off"])},E(String(G[ee]).toUpperCase()==="TRUE"?"Ein":"Aus"),3)):(g(),m("span",{key:1,class:xe({"wb-mono":ee.includes("nr")||ee.includes("id")})},E(P(G[ee])),3))]))),128))]))),128)),C.value.length===0?(g(),m("tr",Nc,[a("td",{colspan:h.value.length||1,class:"wb-empty"},E(r.value.length?"Keine passenden Einträge":"Keine Daten vorhanden"),9,Oc)])):$("",!0)])])])),a("div",Mc,[a("span",null,"Seite "+E(u.value)+" / "+E(S.value),1),a("div",xc,[a("button",{class:"wb-btn wb-small",disabled:u.value===1,onClick:j[2]||(j[2]=G=>u.value--)},"‹",8,Pc),a("button",{class:"wb-btn wb-small",disabled:u.value>=S.value,onClick:j[3]||(j[3]=G=>u.value++)},"›",8,Ic),a("button",{class:"wb-btn wb-small",onClick:re},"Vollansicht ↗")])])]))}}),Dc=["open"],Uc={class:"wb-tree-icon"},Fc={class:"wb-tree-name"},Bc={class:"wb-tree-count"},$c={class:"wb-tree-children"},zc=He({__name:"StationTreeNode",props:{node:{},filter:{},level:{}},emits:["selected"],setup(t,{emit:e}){const i=e;function s(n,r){return!r||(n.id+" "+n.text).toLocaleLowerCase("de").includes(r.toLocaleLowerCase("de"))||(n.children||[]).some(o=>s(o,r))}return(n,r)=>{const o=Ao("StationTreeNode",!0);return s(t.node,t.filter)?(g(),m(K,{key:0},[t.node.children?.length?(g(),m("details",{key:0,class:"wb-tree-group",open:t.filter?!0:void 0},[a("summary",null,[a("span",Uc,E(t.level===0?"▦":"▤"),1),a("span",Fc,[a("b",null,E(t.node.id),1),a("span",null,E(t.node.text),1)]),a("span",Bc,E(t.node.children.length),1)]),a("div",$c,[(g(!0),m(K,null,ge(t.node.children,l=>(g(),Ue(o,{key:l.id,node:l,filter:t.filter,level:(t.level||0)+1,onSelected:r[0]||(r[0]=u=>i("selected",u))},null,8,["node","filter","level"]))),128))])],8,Dc)):(g(),m("button",{key:1,type:"button",class:"wb-tree-leaf",onClick:r[1]||(r[1]=l=>i("selected",t.node.id))},[r[2]||(r[2]=a("span",{class:"wb-tree-icon"},"▣",-1)),a("span",null,[a("b",null,E(t.node.id),1),a("small",null,E(t.node.text),1)]),r[3]||(r[3]=a("span",{class:"wb-tree-arrow"},"›",-1))]))],64)):$("",!0)}}}),Hc={class:"wb-station-tree"},Wc={class:"wb-toolbar"},Vc={class:"wb-meta"},Kc={class:"wb-filter"},Gc={key:0,class:"wb-alert",role:"alert"},jc={key:1,class:"wb-placeholder"},Jc={key:2,class:"wb-tree-list"},Yc={key:0,class:"wb-placeholder"},qc={class:"wb-footer"},Xc={key:0},Qc=He({__name:"StationTreeWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=A([]),s=A(""),n=A(!1),r=A(""),o=A("");let l=null;const u=ie(()=>String(e.station||e.widget.props.station||""));async function d(){if(l?.abort(),r.value="",i.value=[],e.demo){i.value=[{id:"100",text:"Linie Montage",children:[{id:"200",text:"Montagebereich",children:[{id:"J815513",text:"Lagern"},{id:"J816352",text:"Waschen"}]}]}];return}if(!u.value){r.value="Bitte Station auswählen";return}const y=new AbortController;l=y,n.value=!0;try{const S=await il("/backend/api/getStations",u.value,y.signal);if(!Array.isArray(S))throw Error("Ungültige Fertigungsbaum-Antwort");i.value=S}catch(S){y.signal.aborted||(r.value=String(S instanceof Error?S.message:S))}finally{l===y&&(n.value=!1)}}st([u,()=>e.demo],d,{immediate:!0}),vi(()=>l?.abort());function c(y){o.value=y,sessionStorage.setItem("selectedStation",y);const S="/backend/Config.html?station="+encodeURIComponent(y),C=window.open(S,"_blank");C?C.opener=null:window.location.assign(S)}function h(){try{jn("station",u.value)}catch(y){r.value=String(y)}}return(y,S)=>(g(),m("div",Hc,[a("div",Wc,[a("span",Vc,[a("span",{class:xe(["wb-live-dot",{inactive:!!r.value}])},null,2),a("b",null,E(i.value.length),1),S[1]||(S[1]=Q(" Fertigungslinien",-1))]),a("div",{class:"wb-inline-actions"},[a("button",{class:"wb-btn wb-btn-icon",onClick:d,title:"Aktualisieren"},"↻"),a("button",{class:"wb-btn wb-small",onClick:h},"Vollansicht ↗")])]),a("div",Kc,[S[2]||(S[2]=a("span",{class:"wb-search-icon"},"⌕",-1)),ae(a("input",{"onUpdate:modelValue":S[0]||(S[0]=C=>s.value=C),placeholder:"Station, Linie oder Gruppe suchen ...","aria-label":"Fertigungsbaum durchsuchen"},null,512),[[Ae,s.value]])]),r.value?(g(),m("p",Gc,E(r.value),1)):n.value?(g(),m("p",jc,"Fertigungsbaum wird geladen …")):(g(),m("div",Jc,[(g(!0),m(K,null,ge(i.value,C=>(g(),Ue(zc,{key:C.id,node:C,filter:s.value,level:0,onSelected:c},null,8,["node","filter"]))),128)),i.value.length?$("",!0):(g(),m("p",Yc,"Keine Stationen gefunden"))])),a("div",qc,[S[3]||(S[3]=a("span",null,"Fertigungsbereiche sind anfangs zugeklappt",-1)),o.value?(g(),m("span",Xc,"Station "+E(o.value)+" gewählt",1)):$("",!0)])]))}}),Zc={class:"wb-module"},ed={class:"wb-module-row"},td={class:"wb-module-logo","aria-hidden":"true"},id={class:"wb-module-text"},sd={key:0,class:"wb-field"},nd={class:"wb-module-foot"},rd={class:"wb-chip"},od={key:1,class:"wb-hint",role:"status"},ld=He({__name:"LegacyModuleWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=ie(()=>gc(e.widget.props.module)?e.widget.props.module:"history"),s=ie(()=>Gn[i.value]),n=A(""),r=A("");function o(){if(e.demo){r.value="Vorschau: Live-Anwendungen werden im Demo-Modus nicht gestartet";return}try{jn(i.value,e.station,n.value),r.value="Originalanwendung in neuem Tab geöffnet"}catch(l){r.value=String(l)}}return(l,u)=>(g(),m("section",Zc,[a("div",ed,[a("div",td,E(["history","activities","activity-designer"].includes(i.value)?"◈":i.value==="workorder"?"▣":"⇄"),1),a("div",id,[a("h3",null,E(s.value.heading),1),a("p",null,E(s.value.detail),1)])]),i.value==="history"||i.value==="activities"?(g(),m("label",sd,[u[1]||(u[1]=Q("Seriennummer ",-1)),ae(a("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),maxlength:120,placeholder:"Optional vormerken …",autocomplete:"off"},null,512),[[Ae,n.value]])])):$("",!0),a("div",nd,[a("span",rd,E(e.station||"Station wählen"),1),a("button",{class:"wb-btn wb-primary",type:"button",onClick:o},E(s.value.action)+" ↗",1)]),r.value?(g(),m("p",od,E(r.value),1)):$("",!0),u[2]||(u[2]=a("p",{class:"wb-hint wb-module-note"},"Dieser Baustein öffnet die bestehende Workbench-Funktion. Die iTAC-MES-Sitzung muss dort angemeldet sein; Schreibaktionen werden im Widget nicht dupliziert.",-1))]))}}),yn=["SERIAL_NUMBER","SERIAL_NUMBER_POS","STATION_DESC","STATION_DIAG_NUMBER","STATION_NUMBER","WORKORDER_NUMBER","WORKSTEP_DESC","WORKSTEP_NUMBER","BOOK_DATE","BOOK_STATE","CYCLE_TIME","PROCESS_LAYER"],wn=["BOOK_REFERENCE","COMP_NAME","FAILURE_ACTION_CODE","FAILURE_ACTION_INFO","FAILURE_CAUSE_CODE","FAILURE_CAUSE_DESC","FAILURE_CAUSE_INFO","FAILURE_IMAGE_CODE","FAILURE_IMAGE_DESC","FAILURE_MEASURE_CODE","FAILURE_MEASURE_INFO","FAILURE_SEQUENCE_NUMBER","FAILURE_TYPE_CODE","FAILURE_TYPE_DESC","FAILURE_TYPE_INFO","INFO","INFO_TXT_REPAIR","MAJOR_FAILURE","PART_DESC","PART_NUMBER","REPAIRED","REPAIRED_DATE","SERIAL_NUMBER","SERIAL_NUMBER_POS","STATION_DIAG_NUMBER","STATION_NUMBER","STATION_REPAIR_DESC","WORKORDER_NUMBER"],En=["BOOK_DATE","BOOK_REFERENCE","COMP_NAME","FAILURE_SLIP_REFERENCE","SEQUENCE_NUMBER","STATION_NUMBER","TEST_STEP_NAME","WORKORDER_NUMBER","WORKSTEP_NUMBER"],_n=["FUNCTION","FUNCTION_DESC","FUNCTION_STEP","LOWER_LIMIT","MEASURE_FAIL_CODE","MEASURE_NAME","MEASURE_TYPE","MEASURE_VALUE","NOMINAL","SEQUENCE_NUMBER","SERIAL_NUMBER","SERIAL_NUMBER_POS","STATION_DESC","STATION_NUMBER","TOLERANCE","UNIT","UPPER_LIMIT","WORKORDER_NUMBER","WORKSTEP_NUMBER"],Sn=["SERIAL_NUMBER","SERIAL_NUMBER_POS","SERIAL_SLAVE_NUMBER","PART_NUMBER","PART_DESC","BOM_VERSION","BOM_VARIANT","STATION_NUMBER","WORKORDER_NUMBER"],Rn=["COMP_NAME","PART_NUMBER","MATERIAL_BIN_NUMBER","BOOK_DATE","PART_PARENT_NUMBER","SETUP_COMP_NAME","SETUP_POSITION","WORKSTEP_NUMBER","STATION_NUMBER","STATION_DESC","WORKORDER_NUMBER"],nn=[{id:"booking",title:"Buchungen",keys:yn},{id:"failure",title:"Fehler",keys:wn},{id:"slip",title:"Fehlerscheine",keys:En},{id:"measure",title:"Messwerte",keys:_n},{id:"merge",title:"Merge Parts",keys:Sn},{id:"setup",title:"Rüstung",keys:Rn}],sl={SERIAL_NUMBER:"Seriennummer",STATION_NUMBER:"Station",WORKORDER_NUMBER:"Auftrag",WORKSTEP_NUMBER:"Schritt",WORKSTEP_AVO:"AVO",WORKSTEP_DESC:"Arbeitsgang",BOOK_DATE:"Datum",BOOK_STATE:"Status",PROCESS_LAYER:"Lage",PART_NUMBER:"Sachnummer",PART_DESC:"Beschreibung",MEASURE_NAME:"Messgröße",MEASURE_VALUE:"Messwert",FAILURE_TYPE_DESC:"Fehlerart",FAILURE_TYPE_CODE:"Fehlercode",MATERIAL_BIN_NUMBER:"MBK",SERIAL_SLAVE_NUMBER:"Verbundteil",COMP_NAME:"Komponente",ATTRIBUTE_CODE:"Attribut",ATTRIBUTE_VALUE:"Wert"};function Ze(t,e,i=e){if(t==null)return[];if(!Array.isArray(t))throw new Error("IMSAPI liefert kein Array");if(t.length&&typeof t[0]=="object"&&t[0]!==null)return t;if(!e.length||t.length%e.length!==0)throw new Error("IMSAPI Rückgabe passt nicht zu den Ergebnis-Keys");const s=[];for(let n=0;nr[o]=t[n+l]??null),s.push(r)}return s}function ft(t){const e=String(t??"").trim().toUpperCase();return{TOP:"0",BOT:"1",BOTTOM:"1",INDEP:"2","INDEP.":"2",INDEPENDENT:"2"}[e]||e}function hi(t){return{0:"TOP",1:"BOTTOM",2:"INDEPENDENT"}[ft(t)]||String(t??"—")}function Cs(t,e=""){if(t==null||t==="")return"—";if(["BOOK_DATE","REPAIRED_DATE"].includes(e)){const i=Number(t);if(Number.isFinite(i)&&i>0)return new Date(i).toLocaleString("de-DE")}return e==="PROCESS_LAYER"?hi(t):String(t)}function ni(t){return/^[A-Za-z0-9_.-]{1,120}$/.test(t)}function ti(t){return/^[A-Za-z0-9_.:/-]{1,120}$/.test(t)}function nl(){return el()?{sessionId:"server-managed"}:null}class rl extends Error{constructor(e,i,s){super(e),this.action=i,this.code=s}action;code}async function Me(t,e,i=[0]){if(!/^[A-Za-z][A-Za-z0-9]+$/.test(t))throw new Error("Ungültige IMSAPI-Aktion");if(!el())throw new Error("Bitte zuerst am HMI über IMSAPI anmelden");const n=(await be("/mes/actions/"+t,"POST",e))?.result;if(!n||n.return_value===void 0)throw new Error(t+": ungültige IMSAPI-Antwort");const r=Number(n.return_value);if(!i.includes(r))throw new rl(t+" ("+r+"): "+(n.customErrorString||n.errorString||"MES-Fehler"),t,r);return n}async function ol(t,e){if(!ni(t)||!ti(e))throw new Error("Station oder Seriennummer ungültig");const i={stationNumber:t,serialNumber:e},s=await Me("trGetSerialNumberHistoryData",{...i,serialNumberPos:"-1",processLayer:"2",desolvingSerialNumber:"1",desolvingLevel:"0",bookingResultKeys:yn,failureDataResultKeys:wn,failureSlipDataResultKeys:En,measureDataResultKeys:_n}),n={booking:Ze(s.bookingResultValues,yn),failure:Ze(s.failureDataResultValues,wn),slip:Ze(s.failureSlipDataResultValues,En),measure:Ze(s.measureDataResultValues,_n),merge:[],setup:[]},r=await Promise.allSettled([Me("trGetMergeParts",{...i,serialNumberPos:"-1",resolveLevel:"2",resolveDirection:"0",mergePartsResultKeys:Sn}),Me("setupGetSetupDataBySerialNumber",{...i,partNumber:"-1",location:"-1",level:"-1",setupResultKeys:Rn})]),o=[];return r.forEach((l,u)=>{const d=u?"setup":"merge";l.status==="fulfilled"?n[d]=Ze(l.value[u?"setupResultValues":"mergePartsResultValues"],u?Rn:Sn):o.push(d+": "+String(l.reason))}),{result:s,sections:n,warnings:o}}async function fs(t){const e=["WORKORDER_NUMBER","PART_NUMBER","PART_DESC","PROCESS_LAYER","QUANTITY"],i=await Me("trGetStationSetting",{stationNumber:t,stationSettingResultKeys:e});return Ze(i.stationSettingResultValues,e)[0]||null}async function ad(t){const e=["WORKORDER_NUMBER","PART_NUMBER","PART_DESC","PROCESS_LAYER"],i=await Me("trGetWorkOrderForStation",{stationNumber:t,workorderFilter:[{key:"MAX_ROWS",value:"100"}],workorderResultKeys:e},[0,3]);return Ze(i.workorderResultValues,e)}async function Ur(t,e,i,s,n,r="1"){if(!ni(t)||!ti(e)||!["0","1","2"].includes(String(s))||![0,1].includes(n))throw new Error("Ungültige Buchungsparameter");const o=["ERROR_CODE","SERIAL_NUMBER","SERIAL_NUMBER_STATE"],l=await Me("trUploadState",{stationNumber:t,processLayer:i,serialNumberRef:e,serialNumberRefPos:r,serialNumberState:String(s),duplicateSerialNumber:String(n),bookDate:"-1",cycleTime:"5",serialNumberUploadKeys:o,serialNumberUploadValues:[]});if(Ze(l.serialNumberUploadValues,o).some(d=>Number(d.ERROR_CODE)!==0))throw new Error("Statusbuchung meldet Fehler bei Seriennummer "+e);return l}const ud={class:"wb-mes-client"},cd={class:"wb-mes-strip"},dd={class:"wb-mes-pill"},fd={class:"wb-mes-muted"},hd=["disabled"],pd=["disabled"],gd=["disabled"],md=["disabled"],vd={key:0,class:"wb-mes-note"},bd={key:1,class:"wb-alert",role:"alert"},yd={key:2,class:"wb-mes-note",role:"status"},wd={key:3,class:"wb-mes-strip"},Ed={class:"wb-mes-tabs",role:"tablist"},_d=["aria-selected","onClick"],Sd={class:"wb-table-scroll"},Rd={class:"wb-table"},Ad={key:0},kd={key:0},Td=["disabled","onClick"],Cd=["title"],Nd={key:0},Od=["colspan"],Md={class:"wb-mes-dialog",role:"dialog","aria-modal":"true"},xd=["disabled"],Pd=["disabled"],Id={class:"wb-mes-check"},Ld=["disabled"],Dd={class:"wb-mes-orders"},Ud=["onClick"],Fd={key:0},Bd=["value"],$d=["disabled"],zd={key:3,class:"wb-alert"},Hd=He({__name:"HistoryBookingWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=A(e.station),s=A(""),n=A(!1),r=A(""),o=A(""),l=A("booking"),u=A({}),d=A({}),c=A(null),h=A([]),y=A(""),S=A("none"),C=A(null),T=A(""),P=A("2"),F=A(0),D=A(0),re=A(!0),x=A(!1),j=ie(()=>nn.map(X=>({id:X.id,title:X.title,count:(u.value[X.id]||[]).length}))),G=ie(()=>nn.find(X=>X.id===l.value)||nn[0]),Z=ie(()=>u.value[l.value]||[]),ee=ie(()=>G.value.keys),he=ie(()=>!e.demo&&!!nl()&&ni(i.value));st(()=>e.station,X=>{i.value=X,c.value=null,u.value={}}),li(()=>{he.value&&I();const X=new URLSearchParams(location.search).get("serial")||sessionStorage.getItem("hmiLastSerial")||"";ti(X)&&(s.value=X)});function te(){r.value="",o.value=""}async function I(){if(he.value)try{c.value=await fs(i.value)}catch(X){o.value="Aktiver Auftrag nicht verfügbar: "+String(X)}}async function se(){if(te(),!he.value){r.value="Workbench-Anmeldung und Station erforderlich";return}if(!ti(s.value)){r.value="Ungültige Seriennummer";return}n.value=!0,u.value={};try{const X=await ol(i.value,s.value);u.value=X.sections,d.value=X.result,o.value=X.warnings.join(" · ")||"Seriennummer aktualisiert"}catch(X){X instanceof rl&&X.code===-110?(S.value="assign",x.value=!1,await I(),o.value="Seriennummer nicht gefunden. Zuweisung zum aktiven Auftrag möglich."):r.value=String(X)}finally{n.value=!1}}async function ke(){te(),n.value=!0;try{h.value=await ad(i.value),S.value="orders"}catch(X){r.value=String(X)}finally{n.value=!1}}const ue=ie(()=>{const X=new Map;for(const V of h.value){const oe=String(V.WORKORDER_NUMBER||"");if(!oe)continue;const Be=X.get(oe)||{number:oe,part:String(V.PART_DESC||V.PART_NUMBER||""),layers:[]};Be.layers.includes(ft(V.PROCESS_LAYER))||Be.layers.push(ft(V.PROCESS_LAYER)),X.set(oe,Be)}return[...X.values()].filter(V=>(V.number+" "+V.part).toLowerCase().includes(y.value.toLowerCase()))});async function ne(){if(he.value&&!(!T.value||!["0","1","2"].includes(P.value))){n.value=!0,te();try{if(await Me("trActivateWorkOrder",{stationNumber:i.value,workOrderNumber:T.value,serialNumber:"-1",serialNumberPos:"-1",processLayer:P.value,flag:"1"}),await I(),String(c.value?.WORKORDER_NUMBER)!==T.value||ft(c.value?.PROCESS_LAYER)!==P.value)throw new Error("Aktivierung vom MES noch nicht bestätigt");S.value="none",o.value="Auftrag erfolgreich aktiviert"}catch(X){r.value=String(X)}finally{n.value=!1}}}function q(X){if(!ti(String(X.SERIAL_NUMBER||""))||!ni(String(X.STATION_NUMBER||""))||!["0","1","2"].includes(ft(X.PROCESS_LAYER))){r.value="Buchungszeile enthält keine gültige Station, Lage oder Seriennummer";return}C.value=X,F.value=0,D.value=0,S.value="rebook"}async function _e(){if(!he.value||!C.value)return;const X=C.value;n.value=!0,te();try{if(!confirm(`Status ${F.value} für ${X.SERIAL_NUMBER} an ${X.STATION_NUMBER} buchen?`))return;await Ur(String(X.STATION_NUMBER),String(X.SERIAL_NUMBER),ft(X.PROCESS_LAYER),F.value,D.value),S.value="none",o.value="Statusbuchung durch MES bestätigt",await se()}catch(V){r.value=String(V)}finally{n.value=!1}}async function ye(){if(he.value){if(!c.value||!ti(s.value)||!ni(i.value)){r.value="Aktiver Auftrag/Station/Seriennummer fehlen";return}n.value=!0,te();try{const X=await fs(i.value);if(String(X?.WORKORDER_NUMBER)!==String(c.value.WORKORDER_NUMBER)||ft(X?.PROCESS_LAYER)!==ft(c.value.PROCESS_LAYER))throw Error("Auftrag oder Lage haben sich geändert");if(x.value||(await Me("trAssignSerialNumberForProductOrWorkOrder",{stationNumber:i.value,workOrderNumber:X?.WORKORDER_NUMBER,partNumber:"-1",bomVersion:"-2",serialNumberRef:s.value,serialNumberRefPos:"1",processLayer:ft(X?.PROCESS_LAYER),serialNumberArray:[],activateWorkOrder:"1"}),x.value=!0),re.value){const V=await fs(i.value);if(String(V?.WORKORDER_NUMBER)!==String(X?.WORKORDER_NUMBER)||ft(V?.PROCESS_LAYER)!==ft(X?.PROCESS_LAYER))throw Error("Auftrag während Zuweisung geändert");await Ur(i.value,s.value,ft(X?.PROCESS_LAYER),0,0)}S.value="none",o.value="Seriennummer zugewiesen"+(re.value?" und gebucht":""),await se()}catch(X){r.value=(x.value?"Seriennummer bereits zugewiesen. ":"")+String(X)}finally{n.value=!1}}}const We=ie(()=>ee.value.filter(X=>Z.value.some(V=>V[X]!==void 0))),qe=ie(()=>We.value.length?We.value:ee.value);return(X,V)=>(g(),m("div",ud,[a("div",cd,[a("span",dd,E(i.value||"Station fehlt"),1),a("span",fd,[V[8]||(V[8]=Q("Auftrag: ",-1)),a("b",null,E(c.value?.WORKORDER_NUMBER||"—"),1),Q(" · "+E(Ge(hi)(c.value?.PROCESS_LAYER)),1)]),a("button",{class:"wb-btn wb-small",disabled:n.value||!he.value,onClick:ke},"Auftrag wählen",8,hd),a("button",{class:"wb-btn wb-small",disabled:n.value||!he.value,onClick:I},"↻",8,pd)]),a("form",{class:"wb-mes-form",onSubmit:je(se,["prevent"])},[a("label",null,[V[9]||(V[9]=Q("Seriennummer",-1)),ae(a("input",{"onUpdate:modelValue":V[0]||(V[0]=oe=>s.value=oe),autocomplete:"off",placeholder:"Seriennummer scannen",disabled:n.value},null,8,gd),[[Ae,s.value,void 0,{trim:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!he.value},E(n.value?"Lade…":"Daten abrufen"),9,md)],32),t.demo||!he.value?(g(),m("p",vd,E(t.demo?"Designer-Demo – keine MES-Schreibzugriffe":"Bitte zuerst die Workbench-Station anmelden."),1)):$("",!0),r.value?(g(),m("p",bd,E(r.value),1)):$("",!0),o.value?(g(),m("p",yd,E(o.value),1)):$("",!0),d.value.partNumber||d.value.workOrderNumber?(g(),m("div",wd,[a("span",null,[V[10]||(V[10]=Q("Sachnummer ",-1)),a("b",null,E(d.value.partNumber||"—"),1)]),a("span",null,E(d.value.partDesc),1),a("span",null,[V[11]||(V[11]=Q("Auftrag ",-1)),a("b",null,E(d.value.workOrderNumber),1)])])):$("",!0),a("div",Ed,[(g(!0),m(K,null,ge(j.value,oe=>(g(),m("button",{key:oe.id,class:xe(["wb-mes-tab",{selected:l.value===oe.id}]),"aria-selected":l.value===oe.id,role:"tab",onClick:Be=>l.value=oe.id},[Q(E(oe.title)+" ",1),a("small",null,E(oe.count),1)],10,_d))),128))]),a("div",Sd,[a("table",Rd,[a("thead",null,[a("tr",null,[l.value==="booking"?(g(),m("th",Ad,"Aktion")):$("",!0),(g(!0),m(K,null,ge(qe.value,oe=>(g(),m("th",{key:oe},E(Ge(sl)[oe]||oe),1))),128))])]),a("tbody",null,[(g(!0),m(K,null,ge(Z.value,(oe,Be)=>(g(),m("tr",{key:Be},[l.value==="booking"?(g(),m("td",kd,[a("button",{class:"wb-btn wb-small",title:"Statusumbuchung",disabled:n.value||!he.value,onClick:Oe=>q(oe)},"⚒ Umbuchen",8,Td)])):$("",!0),(g(!0),m(K,null,ge(qe.value,Oe=>(g(),m("td",{key:Oe,title:Ge(Cs)(oe[Oe],Oe)},E(Ge(Cs)(oe[Oe],Oe)),9,Cd))),128))]))),128)),Z.value.length?$("",!0):(g(),m("tr",Nd,[a("td",{colspan:qe.value.length+(l.value==="booking"?1:0),class:"wb-empty"},E(s.value?"Keine Einträge in dieser Ansicht":"Seriennummer scannen und abrufen"),9,Od)]))])])]),(g(),Ue(wo,{to:"body"},[S.value!=="none"?(g(),m("div",{key:0,class:"wb-mes-overlay",onClick:V[7]||(V[7]=je(oe=>!n.value&&(S.value="none"),["self"]))},[a("section",Md,[a("header",null,[a("strong",null,E(S.value==="rebook"?"Statusumbuchung":S.value==="assign"?"Seriennummer zuweisen":"Auftrag aktivieren"),1),a("button",{class:"wb-btn",disabled:n.value,onClick:V[1]||(V[1]=oe=>S.value="none")},"✕",8,xd)]),S.value==="rebook"?(g(),m(K,{key:0},[a("p",null,[V[12]||(V[12]=Q("Seriennummer: ",-1)),a("b",null,E(C.value?.SERIAL_NUMBER),1),Q(" · Lage: "+E(Ge(hi)(C.value?.PROCESS_LAYER))+" · Station: "+E(C.value?.STATION_NUMBER),1)]),a("label",null,[V[14]||(V[14]=Q("Status",-1)),ae(a("select",{"onUpdate:modelValue":V[2]||(V[2]=oe=>F.value=oe)},[...V[13]||(V[13]=[a("option",{value:0},"0 – Gut",-1),a("option",{value:1},"1 – Nacharbeit",-1),a("option",{value:2},"2 – Ausschuss",-1)])],512),[[Et,F.value,void 0,{number:!0}]])]),a("label",null,[V[16]||(V[16]=Q("Nutzen",-1)),ae(a("select",{"onUpdate:modelValue":V[3]||(V[3]=oe=>D.value=oe)},[...V[15]||(V[15]=[a("option",{value:0},"0 – Einzelschaltung",-1),a("option",{value:1},"1 – Nutzen",-1)])],512),[[Et,D.value,void 0,{number:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:_e},"Status buchen",8,Pd)],64)):S.value==="assign"?(g(),m(K,{key:1},[a("p",null,[V[17]||(V[17]=Q("Seriennummer ",-1)),a("b",null,E(s.value),1),V[18]||(V[18]=Q(" zum aktiven Auftrag ",-1)),a("b",null,E(c.value?.WORKORDER_NUMBER||"—"),1),V[19]||(V[19]=Q(" zuweisen?",-1))]),a("p",null,"Prozesslage: "+E(Ge(hi)(c.value?.PROCESS_LAYER)),1),a("label",Id,[ae(a("input",{type:"checkbox","onUpdate:modelValue":V[4]||(V[4]=oe=>re.value=oe)},null,512),[[ei,re.value]]),V[20]||(V[20]=Q(" Anschließend Status „Gut“ buchen",-1))]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!c.value,onClick:ye},E(x.value?"Zuweisung abschließen":"Zuweisen"),9,Ld)],64)):(g(),m(K,{key:2},[ae(a("input",{"onUpdate:modelValue":V[5]||(V[5]=oe=>y.value=oe),placeholder:"Auftrag filtern"},null,512),[[Ae,y.value]]),a("div",Dd,[(g(!0),m(K,null,ge(ue.value,oe=>(g(),m("button",{key:oe.number,class:"wb-mes-order",onClick:Be=>{T.value=oe.number,P.value=oe.layers[0]||"2"}},[a("b",null,E(oe.number),1),a("small",null,E(oe.part),1),a("span",null,E(oe.layers.map(Ge(hi)).join(" / ")),1)],8,Ud))),128))]),T.value?(g(),m("div",Fd,[a("b",null,"Auftrag: "+E(T.value),1),a("label",null,[V[21]||(V[21]=Q("Prozesslage",-1)),ae(a("select",{"onUpdate:modelValue":V[6]||(V[6]=oe=>P.value=oe)},[(g(!0),m(K,null,ge(ue.value.find(oe=>oe.number===T.value)?.layers,oe=>(g(),m("option",{key:oe,value:oe},E(Ge(hi)(oe)),9,Bd))),128))],512),[[Et,P.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:ne},"Aktivieren",8,$d)])):$("",!0)],64)),r.value?(g(),m("p",zd,E(r.value),1)):$("",!0)])])):$("",!0)]))]))}}),Wd=["aria-busy"],Vd={class:"wb-overview-top"},Kd={class:"wb-overview-station"},Gd={class:"wb-overview-note"},jd=["disabled"],Jd={key:0,class:"error",role:"alert"},Yd={class:"wb-overview-values"},qd={class:"wb-overview-label"},Xd=["title"],Qd=He({__name:"ProductionOverviewWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=A(null),s=A(!1),n=A(""),r=ie(()=>Math.min(300,Math.max(0,Number(e.widget.props.refreshSeconds??30)||0)));let o,l=0;const u=ie(()=>{const h=i.value||{},y=S=>Cs(h[S]);return[{label:"Auftragsnummer",value:y("WORKORDER_NUMBER")},{label:"Artikelnummer",value:y("PART_NUMBER")},{label:"Beschreibung",value:y("PART_DESC")},{label:"Lage",value:h.PROCESS_LAYER===null||h.PROCESS_LAYER===void 0?"—":hi(h.PROCESS_LAYER)},{label:"Auftragsmenge",value:y("QUANTITY")}]});async function d(){const h=++l;if(e.demo){i.value={WORKORDER_NUMBER:"47110815",PART_NUMBER:"10004032",PART_DESC:"Musterartikel · Produktionsübersicht",PROCESS_LAYER:"0",QUANTITY:1200},n.value="";return}if(!ni(e.station)){n.value="Bitte eine gültige Station anmelden",i.value=null;return}s.value=!0,n.value="";try{const y=await fs(e.station);if(h!==l)return;i.value=y,(!y||String(y.WORKORDER_NUMBER??"").trim()==="-1")&&(i.value=null)}catch(y){h===l&&(i.value=null,n.value=y instanceof Error?y.message:String(y))}finally{h===l&&(s.value=!1)}}function c(){o&&clearInterval(o),o=void 0,d(),!e.demo&&r.value>0&&(o=setInterval(()=>{d()},r.value*1e3))}return st([()=>e.station,()=>e.demo,r],c,{immediate:!0}),vi(()=>{l++,o&&clearInterval(o)}),(h,y)=>(g(),m("section",{class:"wb-production-overview","aria-busy":s.value},[a("div",Vd,[a("span",{class:xe(["wb-live-dot",{inactive:!!n.value}])},null,2),a("span",Kd,"Station "+E(t.station||"—"),1),a("span",Gd,E(s.value?"Lade Stationsdaten…":i.value?"Aktiver Auftrag":"Kein aktiver Auftrag"),1),a("button",{type:"button",class:"subtle-button",disabled:s.value,onClick:d},"↻ Aktualisieren",8,jd)]),n.value?(g(),m("div",Jd,E(n.value),1)):$("",!0),a("div",Yd,[(g(!0),m(K,null,ge(u.value,S=>(g(),m("div",{key:S.label,class:"wb-overview-value"},[a("div",qd,E(S.label),1),a("div",{class:"wb-overview-data",title:S.value},E(S.value),9,Xd)]))),128))])],8,Wd))}}),ki=(t,e)=>{const i=t.__vccOpts||t;for(const[s,n]of e)i[s]=n;return i},Zd=ki(Qd,[["__scopeId","data-v-42cc2e76"]]),ef={class:"wb-mes-client"},tf={class:"wb-mes-strip"},sf={class:"wb-mes-pill"},nf=["disabled"],rf={key:0,class:"wb-mes-note"},of={key:1,class:"wb-alert",role:"alert"},lf={key:2,class:"wb-mes-note",role:"status"},af={class:"wb-mes-tabs"},uf=["onClick"],cf={class:"wb-table-scroll"},df={class:"wb-table"},ff={key:0},hf={key:0,class:"wb-mes-actions"},pf=["disabled","onClick"],gf=["disabled","onClick"],mf=["disabled","onClick"],vf=["disabled","onClick"],bf=["disabled","onClick"],yf=["disabled","onClick"],wf={key:0},Ef=["colspan"],_f={class:"wb-mes-dialog",role:"dialog","aria-modal":"true"},Sf=["disabled"],Rf={key:0,class:"wb-alert"},Af={class:"wb-mes-check"},kf=["disabled"],Tf={class:"wb-mes-orders"},Cf=["onClick"],Nf=["disabled"],Of=["disabled"],Mf={class:"wb-mes-orders"},xf=["value"],Pf={class:"wb-mes-orders"},If=["value"],Lf={class:"wb-mes-check"},Df=["disabled"],Uf={class:"wb-mes-actions"},Ff=["disabled"],Bf=["disabled"],$f=["disabled"],zf=["disabled"],Hf={key:5,class:"wb-alert"},Wf=He({__name:"ManualProductionWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=A(e.station),s=A(""),n=A(!1),r=A(""),o=A(""),l=A([]),u=A([]),d=A({}),c=A([]),h=A([]),y=A([]),S=A([]),C=A(!1),T=A(""),P=A("plan"),F=A("none"),D=A(null),re=A(0),x=A(0),j=A(-1),G=A(""),Z=A([]),ee=A([]),he=A(""),te=A(""),I=A(!1),se=A(""),ke=A("setup"),ue=A(""),ne=A(""),q=ie(()=>!e.demo&&!!nl()&&ni(i.value));st(()=>e.station,k=>{i.value=k,_e()}),li(()=>{const k=new URLSearchParams(location.search).get("serial")||sessionStorage.getItem("hmiLastSerial")||"";ti(k)&&(s.value=k)});function _e(){l.value=[],u.value=[],d.value={},c.value=[],h.value=[],y.value=[],T.value=""}function ye(k){return Object.keys(k)}const We=ie(()=>({booking:d.value.booking||[],failure:d.value.failure||[],slip:d.value.slip||[],measure:d.value.measure||[],setup:c.value,setupcheck:h.value,attributes:y.value,plan:l.value})[P.value]||[]),qe=ie(()=>We.value.length?ye(We.value[0]):[]);function X(k){r.value=k instanceof Error?k.message:String(k)}function V(){return q.value?!0:(r.value="Buchungsaktionen sind nur im angemeldeten Werker-Modus erlaubt",!1)}function oe(k){return String(k.Arbeitsschritt??"")}function Be(k){const v=oe(k);return[...d.value.booking||[]].filter(R=>String(R.WORKSTEP_NUMBER)===v).sort((R,M)=>Number(M.BOOK_DATE||0)-Number(R.BOOK_DATE||0))[0]}function Oe(k){const v=Be(k);if(String(v?.BOOK_STATE)==="2")return{ok:!1,reason:"Arbeitsschritt ist Ausschuss"};const R=l.value.indexOf(k);if(R<=0)return{ok:!0,reason:""};const M=l.value[R-1];return String(Be(M)?.BOOK_STATE)!=="0"?{ok:!1,reason:"Vorgänger "+oe(M)+" ist nicht mit Gut (0) gebucht"}:{ok:!0,reason:""}}function z(k){return String(C.value?k.AVO:k.Prozesslage??"2")}const Ve=ie(()=>D.value?u.value.filter(k=>String(k.MEASURE_NAME||"").startsWith(String(D.value?.AVO)+"|")):[]);async function Ie(){if(r.value="",o.value="",!q.value||!ti(s.value)){r.value="Workbench-Anmeldung, Station und gültige Seriennummer erforderlich";return}n.value=!0,_e();try{const k=await ol(i.value,s.value);if(d.value=k.sections,T.value=String(k.result.workOrderNumber||k.sections.booking[0]?.WORKORDER_NUMBER||""),!T.value)throw new Error("Kein Auftrag zur Seriennummer gefunden");const v=[{key:"FUNC_MODE",value:"0"},{key:"WORKORDER_NUMBER",value:T.value},{key:"WORKSTEP_FLAG",value:"1"}];let R=["WORKSTEP_AVO","WORKSTEP_NUMBER","PROCESS_LAYER","WORKSTEP_DESC","OBLIGATORY_CONFIRM_FLAG","PART_NUMBER","SKILL_LEVEL"],M=["AVO","Arbeitsschritt","Prozesslage","Beschreibung","Rueckmeldepflichtig","Artikelnummer","Skill"],J;try{J=await Me("mdataGetWorkplanData",{stationNumber:i.value,workplanFilter:v,workplanDataResultKeys:R})}catch(Re){if(Re?.code!==-368)throw Re;R=R.slice(0,-1),M=M.slice(0,-1),J=await Me("mdataGetWorkplanData",{stationNumber:i.value,workplanFilter:v,workplanDataResultKeys:R})}l.value=Ze(J.workplanDataResultValues,R,M);const fe=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","MIN_VALUE","MAX_VALUE","NOMINAL","UNIT"],we=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","LOWER_LIMIT","UPPER_LIMIT","NOMINAL","UNIT"],pe=["COMP_NAME","PART_NUMBER","MATERIAL_BIN_NUMBER","BOOK_DATE","SETUP_POSITION","WORKSTEP_NUMBER","STATION_NUMBER","STATION_DESC","WORKORDER_NUMBER"],Ee=["COMP_NAME","PART_NUMBER","PART_DESC","PROCESS_LAYER","QUANTITY","PRODUCT_FLAG","SETUP_FLAG","UNIT","WORKSTEP_NUMBER","SETUP_POSITION"],Se=["PART_NUMBER","MATERIAL_BIN_NUMBER","MATERIAL_BIN_QTY_ACTUAL","MATERIAL_BIN_STATE","EXPIRATION_DATE","SETUP_POSITION"],$e=await Promise.allSettled([Me("mdaGetRecipeData",{stationNumber:i.value,recipeVersionId:-1,function:"-1",functionStep:"-1",measurementName:"-1",sequentialNumber:-1,type:"-1",measurementType:"-1",objectType:1,recipeFilters:[{key:"PART_NUMBER",value:String(l.value[0]?.Artikelnummer||"-1")}],recipeResultKeys:fe},[0,-702]),Me("setupGetSetupDataBySerialNumber",{stationNumber:i.value,serialNumber:s.value,partNumber:"-1",location:"-1",level:"-1",setupResultKeys:pe}),Me("setupGetMaterialSetup",{stationNumber:i.value,processLayer:-1,setupFlag:0,setupStartDate:-1,setupEndDate:-1,setupResultKeys:Se,componentResultKeys:[]}),Me("mdataGetBomData",{stationNumber:i.value,bomDataFilter:[{key:"SERIAL_NUMBER",value:s.value}],bomDataResultKeys:Ee}),Me("attribGetAttributeValues",{stationNumber:i.value,objectType:0,objectNumber:s.value,objectDetail:"-1",attributeCodeArray:[],allMergeLevel:1,attributeResultKeys:["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"]}),Me("mdataGetFailureDataForStation",{stationNumber:i.value,functionMode:0,failureDataResultKeys:["FAILURE_TYPE_CODE","FAILURE_TYPE_DESC"]}),Me("mdataGetStationConfiguration",{stationNumber:i.value,stationConfigFilter:[{key:"CODE_NUMBER",value:"8310"}],stationConfigCodeResultKeys:["CODE_VALUE","IS_USED"],stationParamResultKeys:[],stationLicenseResultKeys:[]})]),ze=Re=>{const ve=$e[Re];return ve.status==="fulfilled"?ve.value:{}};u.value=Ze(ze(0).recipeResultValues,fe,we),c.value=Ze(ze(1).setupResultValues,pe);const Qe=Ze(ze(2).setupResultValues,Se);h.value=Ze(ze(3).bomDataResultValues,Ee).map(Re=>({...Re,MATERIAL_BIN_NUMBERS:Qe.filter(ve=>String(ve.PART_NUMBER)===String(Re.PART_NUMBER)).map(ve=>String(ve.MATERIAL_BIN_NUMBER)).join(", ")})),y.value=Ze(ze(4).attributeResultValues,["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"]),S.value=Ze(ze(5).failureDataResultValues,["FAILURE_TYPE_CODE","FAILURE_TYPE_DESC"]);const At=ze(6).stationConfigCodeResultValues||[];C.value=String(At[0]||"").toUpperCase()==="A"&&["1","TRUE"].includes(String(At[1]||"").toUpperCase());const ai=$e.map((Re,ve)=>Re.status==="rejected"?`Datenquelle ${ve+1}: ${String(Re.reason)}`:"").filter(Boolean);o.value=ai.length?"Teildaten geladen. "+ai.join(" · "):`Arbeitsplan: ${l.value.length} Schritte · ${u.value.length} Rezeptwerte`}catch(k){X(k)}finally{n.value=!1}}function Xe(k,v){r.value="",D.value=v,F.value=k,j.value=-1,G.value="",Z.value=[],ee.value=[],he.value="",te.value="",re.value=0,x.value=0,I.value=!1}function Rt(k){j.value=k,G.value=String(Ve.value[k]?.MEASURE_VALUE??"")}function p(){const k=Ve.value[j.value];if(!k){r.value="Messgröße auswählen";return}k.MEASURE_VALUE=G.value,o.value="Messwert lokal vorgemerkt. MES-Buchung über Status-Dialog ausführen.",F.value="none"}function b(){const k=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","LOWER_LIMIT","UPPER_LIMIT","MEASURE_VALUE","NOMINAL","UNIT","MEASURE_FAIL_CODE"],R=[...Ve.value].sort((M,J)=>String(M.MEASURE_NAME||"").localeCompare(String(J.MEASURE_NAME||""),"de",{numeric:!0})).flatMap(M=>[String(M.MEASURE_NAME||"").split("|")[1]||"",M.FUNCTION||"",M.FUNCTION_DESC||"",M.FUNCTION_STEP||"",M.FUNCTION_STEP_DESC||"",M.LOWER_LIMIT||"",M.UPPER_LIMIT||"",M.MEASURE_VALUE||"",M.NOMINAL||"",M.UNIT||"",0]);return{keys:k,values:R}}async function O(){if(!V()||!D.value)return;const k=Oe(D.value);if(!k.ok){r.value=k.reason;return}const v=z(D.value);if(confirm(`Status ${re.value} an Schritt ${oe(D.value)} buchen?`)){n.value=!0,r.value="";try{const R=b();R.values.length?await Me("trUploadResultDataAndRecipe",{stationNumber:i.value,processLayer:v,recipeVersionId:-1,serialNumberRef:s.value,serialNumberRefPos:"-1",serialNumberState:re.value,duplicateSerialNumber:x.value,bookDate:-1,cycleTime:10,recipeVersionMode:0,resultUploadKeys:R.keys,resultUploadValues:R.values}):await Me("trUploadState",{stationNumber:i.value,processLayer:v,serialNumberRef:s.value,serialNumberRefPos:"-1",serialNumberState:re.value,duplicateSerialNumber:x.value,bookDate:-1,cycleTime:10,serialNumberUploadKeys:["SERIAL_NUMBER","SERIAL_NUMBER_STATE","ERROR_CODE"],serialNumberUploadValues:[]}),F.value="none",await Ie(),o.value="Statusbuchung durch MES bestätigt"}catch(R){X(R)}finally{n.value=!1}}}async function B(){if(V()){if(!D.value||!Z.value.length){r.value="Fehlercode auswählen";return}if(confirm("Fehlerbuchung ausführen?")){n.value=!0,r.value="";try{const k=ee.value.length?["COMP_NAME","ERROR_CODE","FAILURE_TYPE_CODE","REPAIRED"]:["ERROR_CODE","FAILURE_TYPE_CODE","REPAIRED"],v=(ee.value.length?ee.value:[""]).flatMap(R=>Z.value.flatMap(M=>ee.value.length?[R,"0",M,I.value?"1":"0"]:["0",M,I.value?"1":"0"]));await Me("trUploadFailureAndResultData",{stationNumber:i.value,processLayer:z(D.value),serialNumberRef:s.value,serialNumberRefPos:"-1",...he.value?{serialNumberState:Number(he.value)}:{},duplicateSerialNumber:x.value,bookDate:-1,cycleTime:10,measureKeys:["ERROR_CODE","MEASURE_FAIL_CODE","MEASURE_NAME","MEASURE_VALUE"],measureValues:[],failureKeys:k,failureValues:v,failureSlipKeys:["ERROR_CODE","TESTSTEP_NAME"],failureSlipValues:te.value.trim()?["0",te.value.trim()]:[]}),F.value="none",await Ie(),o.value="Fehlerbuchung erfolgreich"}catch(k){X(k)}finally{n.value=!1}}}}async function L(k){if(!(!V()||!D.value)&&confirm(`Rüstzustand ${k} für Station ${i.value} ändern?`)){n.value=!0,r.value="";try{const v=["PART_NUMBER","BOM_VERSION_ERP","PROCESS_LAYER","WORKORDER_NUMBER","QUANTITY"],R=await Me("trGetStationSetting",{stationNumber:i.value,stationSettingResultKeys:v}),M=Ze(R.stationSettingResultValues,v)[0];if(!M)throw new Error("Stationseinstellungen fehlen");await Me("setupStateChange",{stationNumber:i.value,processLayer:M.PROCESS_LAYER,workOrderNumber:M.WORKORDER_NUMBER,serialNumber:"-1",serialNumberPos:"-1",setupState:k}),F.value="none",await Ie()}catch(v){X(v)}finally{n.value=!1}}}async function U(){if(V()){if(!se.value.trim()||!ni(i.value)){r.value="Materialbehälter fehlt";return}n.value=!0,r.value="";try{const k=se.value.trim();await Me("setupUpdateMaterialSetup",{stationNumber:i.value,materialBinNumber:-1,partNumber:"-1",location:"SMT",setupUploadKeys:["ERROR_CODE","MATERIAL_BIN_NUMBER","SETUP_POSITION","SETUP_STATE"],setupUploadValues:[0,k,k.slice(-6),ke.value==="setup"?0:1],resultKeys:["COMP_REFERENCE"],resultValues:[]}),F.value="none",await Ie()}catch(k){X(k)}finally{n.value=!1}}}async function W(){if(V()){if(!ue.value.trim()){r.value="Attributcode fehlt";return}n.value=!0,r.value="";try{const k={stationNumber:i.value,objectType:0,objectNumber:s.value,objectDetail:"-1",bookDate:-1,allowOverWrite:1,attributeUploadKeys:["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"],attributeUploadValues:[ue.value,ne.value,0]};let v=!1;try{const M=(await Me("attribAppendAttributeValues",k,[0,5])).attributeResultValues;Array.isArray(M)&&M.some(J=>String(J)==="-901")&&(v=!0)}catch(R){if(R?.code!==-901)throw R;v=!0}v&&(await Me("attribCreateAttributeCode",{stationNumber:i.value,codeKeys:["ATTRIBUTE_CODE","DATA_TYPE","OBJECT_TYPE"],codeValues:[ue.value,"STRING","0"]}),await Me("attribAppendAttributeValues",k)),F.value="none",await Ie()}catch(k){X(k)}finally{n.value=!1}}}async function H(k){if(V()&&confirm("Auftrag für Arbeitsschritt "+oe(k)+" aktivieren?")){n.value=!0,r.value="";try{const v=["WORKORDER_NUMBER"],M=(await Me("trGetSerialNumberInfo",{stationNumber:i.value,serialNumber:s.value,serialNumberPos:"-1",serialNumberResultKeys:v})).serialNumberResultValues?.[0];if(!M)throw Error("Seriennummer hat keinen Auftrag");await Me("trActivateWorkOrder",{stationNumber:i.value,workOrderNumber:String(M),serialNumber:"-1",serialNumberPos:"-1",processLayer:z(k),flag:"1"}),o.value="Auftrag aktiviert"}catch(v){X(v)}finally{n.value=!1}}}return(k,v)=>(g(),m("div",ef,[a("div",tf,[a("span",sf,E(i.value||"Station fehlt"),1),a("span",null,[v[17]||(v[17]=Q("Auftrag: ",-1)),a("b",null,E(T.value||"—"),1)]),a("span",null,E(C.value?"AVO-Steuerung":"Prozesslage"),1)]),a("form",{class:"wb-mes-form",onSubmit:je(Ie,["prevent"])},[a("label",null,[v[18]||(v[18]=Q("Seriennummer",-1)),ae(a("input",{"onUpdate:modelValue":v[0]||(v[0]=R=>s.value=R),autocomplete:"off",placeholder:"Seriennummer scannen"},null,512),[[Ae,s.value,void 0,{trim:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!q.value},E(n.value?"Lade…":"Arbeitsplan laden"),9,nf)],32),q.value?$("",!0):(g(),m("p",rf,E(t.demo?"Demo – keine MES-Aktionen":"Zuerst die Workbench-Station anmelden."),1)),r.value?(g(),m("p",of,E(r.value),1)):$("",!0),o.value?(g(),m("p",lf,E(o.value),1)):$("",!0),a("div",af,[(g(),m(K,null,ge(["plan","booking","failure","slip","measure","setup","setupcheck","attributes"],R=>a("button",{key:R,class:xe(["wb-mes-tab",{selected:P.value===R}]),onClick:M=>P.value=R},E({plan:"Arbeitsplan",booking:"Buchungen",failure:"Fehler",slip:"Fehlerschein",measure:"Messwerte",setup:"Rüstung",setupcheck:"SetupCheck",attributes:"Attribute"}[R]),11,uf)),64))]),a("div",cf,[a("table",df,[a("thead",null,[a("tr",null,[P.value==="plan"?(g(),m("th",ff,"Aktionen")):$("",!0),(g(!0),m(K,null,ge(qe.value,R=>(g(),m("th",{key:R},E(Ge(sl)[R]||R),1))),128))])]),a("tbody",null,[(g(!0),m(K,null,ge(We.value,(R,M)=>(g(),m("tr",{key:M},[P.value==="plan"?(g(),m("td",hf,[a("button",{class:"wb-btn wb-small",title:"Messwerte",disabled:n.value,onClick:J=>Xe("measure",R)},"M",8,pf),a("button",{class:"wb-btn wb-small",title:"Fehler",disabled:n.value,onClick:J=>Xe("failure",R)},"F",8,gf),a("button",{class:"wb-btn wb-small",title:"Rüstung",disabled:n.value,onClick:J=>Xe("setup",R)},"R",8,mf),a("button",{class:"wb-btn wb-small",title:"Attribute",disabled:n.value,onClick:J=>Xe("attribute",R)},"A",8,vf),a("button",{class:"wb-btn wb-small",title:"Status buchen",disabled:n.value||!q.value||!Oe(R).ok,onClick:J=>Xe("status",R)},"✓",8,bf),a("button",{class:"wb-btn wb-small",title:"Auftrag aktivieren",disabled:n.value||!q.value,onClick:J=>H(R)},"↗",8,yf)])):$("",!0),(g(!0),m(K,null,ge(qe.value,J=>(g(),m("td",{key:J},E(Ge(Cs)(R[J],J)),1))),128))]))),128)),We.value.length?$("",!0):(g(),m("tr",wf,[a("td",{colspan:qe.value.length+(P.value==="plan"?1:0)||1,class:"wb-empty"},"Keine Daten geladen",8,Ef)]))])])]),(g(),Ue(wo,{to:"body"},[F.value!=="none"?(g(),m("div",{key:0,class:"wb-mes-overlay",onClick:v[16]||(v[16]=je(R=>!n.value&&(F.value="none"),["self"]))},[a("section",_f,[a("header",null,[a("strong",null,E({status:"Statusbuchung",measure:"Messwert erfassen",failure:"Fehler buchen",setup:"Rüstung",attribute:"Attribute",none:""}[F.value])+" · AVO "+E(D.value?.AVO),1),a("button",{class:"wb-btn",disabled:n.value,onClick:v[1]||(v[1]=R=>F.value="none")},"✕",8,Sf)]),F.value==="status"?(g(),m(K,{key:0},[a("p",null,"Arbeitsschritt "+E(D.value?.Arbeitsschritt)+" · "+E(D.value?.Beschreibung),1),Oe(D.value).ok?$("",!0):(g(),m("p",Rf,E(Oe(D.value).reason),1)),a("label",null,[v[20]||(v[20]=Q("Status",-1)),ae(a("select",{"onUpdate:modelValue":v[2]||(v[2]=R=>re.value=R)},[...v[19]||(v[19]=[a("option",{value:0},"Gut",-1),a("option",{value:1},"Nacharbeit",-1),a("option",{value:2},"Ausschuss",-1)])],512),[[Et,re.value,void 0,{number:!0}]])]),a("label",Af,[ae(a("input",{type:"checkbox","onUpdate:modelValue":v[3]||(v[3]=R=>x.value=R),"true-value":1,"false-value":0},null,512),[[ei,x.value]]),v[21]||(v[21]=Q(" Nutzen",-1))]),a("p",null,E(Ve.value.length)+" Messwerte werden mitgebucht.",1),a("button",{class:"wb-btn wb-primary",disabled:n.value||!Oe(D.value).ok,onClick:O},"Buchen",8,kf)],64)):$("",!0),F.value==="measure"?(g(),m(K,{key:1},[a("div",Tf,[(g(!0),m(K,null,ge(Ve.value,(R,M)=>(g(),m("button",{key:M,class:xe(["wb-mes-order",{chosen:j.value===M}]),onClick:J=>Rt(M)},E(R.MEASURE_NAME)+" · "+E(R.UNIT)+" ("+E(R.LOWER_LIMIT)+" … "+E(R.UPPER_LIMIT)+")",11,Cf))),128))]),a("label",null,[v[22]||(v[22]=Q("Messwert",-1)),ae(a("input",{"onUpdate:modelValue":v[4]||(v[4]=R=>G.value=R),disabled:j.value<0},null,8,Nf),[[Ae,G.value]])]),a("button",{class:"wb-btn wb-primary",disabled:j.value<0,onClick:p},"Übernehmen (lokal)",8,Of)],64)):$("",!0),F.value==="failure"?(g(),m(K,{key:2},[v[27]||(v[27]=a("p",null,"Fehlerart auswählen",-1)),a("div",Mf,[(g(!0),m(K,null,ge(S.value,R=>(g(),m("label",{key:String(R.FAILURE_TYPE_CODE),class:"wb-mes-check"},[ae(a("input",{type:"checkbox",value:String(R.FAILURE_TYPE_CODE),"onUpdate:modelValue":v[5]||(v[5]=M=>Z.value=M)},null,8,xf),[[ei,Z.value]]),Q(" "+E(R.FAILURE_TYPE_CODE)+" – "+E(R.FAILURE_TYPE_DESC),1)]))),128))]),v[28]||(v[28]=a("p",null,"Komponenten (optional)",-1)),a("div",Pf,[(g(!0),m(K,null,ge(h.value,R=>(g(),m("label",{key:String(R.COMP_NAME),class:"wb-mes-check"},[ae(a("input",{type:"checkbox",value:String(R.COMP_NAME),"onUpdate:modelValue":v[6]||(v[6]=M=>ee.value=M)},null,8,If),[[ei,ee.value]]),Q(" "+E(R.COMP_NAME)+" · "+E(R.PART_NUMBER),1)]))),128))]),a("label",null,[v[23]||(v[23]=Q("Fehlerscheintext",-1)),ae(a("input",{"onUpdate:modelValue":v[7]||(v[7]=R=>te.value=R)},null,512),[[Ae,te.value]])]),a("label",null,[v[25]||(v[25]=Q("Status",-1)),ae(a("select",{"onUpdate:modelValue":v[8]||(v[8]=R=>he.value=R)},[...v[24]||(v[24]=[a("option",{value:""},"Ohne Statusänderung",-1),a("option",{value:"0"},"Gut",-1),a("option",{value:"1"},"Nacharbeit",-1),a("option",{value:"2"},"Ausschuss",-1)])],512),[[Et,he.value]])]),a("label",Lf,[ae(a("input",{type:"checkbox","onUpdate:modelValue":v[9]||(v[9]=R=>I.value=R)},null,512),[[ei,I.value]]),v[26]||(v[26]=Q(" Repariert",-1))]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!Z.value.length,onClick:B},"Fehler buchen",8,Df)],64)):$("",!0),F.value==="setup"?(g(),m(K,{key:3},[a("p",null,"Rüstzustand und Materialbehälter an Station "+E(i.value),1),a("div",Uf,[a("button",{class:"wb-btn",disabled:n.value,onClick:v[10]||(v[10]=R=>L(0))},"Rüstung aktivieren",8,Ff),a("button",{class:"wb-btn",disabled:n.value,onClick:v[11]||(v[11]=R=>L(2))},"Rüstung löschen",8,Bf)]),a("label",null,[v[29]||(v[29]=Q("Behälternummer",-1)),ae(a("input",{"onUpdate:modelValue":v[12]||(v[12]=R=>se.value=R)},null,512),[[Ae,se.value,void 0,{trim:!0}]])]),a("label",null,[v[31]||(v[31]=Q("Modus",-1)),ae(a("select",{"onUpdate:modelValue":v[13]||(v[13]=R=>ke.value=R)},[...v[30]||(v[30]=[a("option",{value:"setup"},"Einrüsten",-1),a("option",{value:"remove"},"Abrüsten",-1)])],512),[[Et,ke.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:U},"Behälter übernehmen",8,$f)],64)):$("",!0),F.value==="attribute"?(g(),m(K,{key:4},[a("label",null,[v[32]||(v[32]=Q("Attributcode",-1)),ae(a("input",{"onUpdate:modelValue":v[14]||(v[14]=R=>ue.value=R)},null,512),[[Ae,ue.value,void 0,{trim:!0}]])]),a("label",null,[v[33]||(v[33]=Q("Wert",-1)),ae(a("input",{"onUpdate:modelValue":v[15]||(v[15]=R=>ne.value=R)},null,512),[[Ae,ne.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:W},"Attribut speichern",8,zf)],64)):$("",!0),r.value?(g(),m("p",Hf,E(r.value),1)):$("",!0)])])):$("",!0)]))]))}}),Vf={class:"hmi-script-widget"},Kf=["disabled"],Gf={key:0,class:"script-result"},jf={key:1,class:"error"},Jf=["srcdoc"],Yf=He({__name:"ScriptWidget",props:{widget:{},demo:{type:Boolean},station:{}},setup(t){const e=t,i=A(null),s=A(""),n=A(""),r=Math.random().toString(36).slice(2)+Date.now().toString(36),o=ie(()=>{const c=String(e.widget.props.script||'return {info:"REST-Skript anpassen"};'),h=JSON.stringify(c).replace(/ + + +

CheerpJ Java 11 – Native-Loader-Diagnose

+

Ohne iTAC-JARs, MES-Anmeldedaten oder Änderungen an proprietären Bibliotheken. Alle Tests laufen fest unter Java 11; jeder Link startet einen einzelnen Test in einer frischen Seite.

+
Einzeltests
+
CheerpJ-Release vergleichen (jeweils Java 11)
+

environment JDK/Modul, sysprop Java-Systemeigenschaften, + direct direktes JNI, wwprobe unabhängiger JS-Library-Loader, + jaas JDK-Bibliothek, unix echter UnixSystem-Konstruktor, + bridge Java-Hilfsklasse ohne UnixSystem-Konstruktor. + Ein bestandener Bridge-Test behebt den JDK-Konstruktor nicht.

+
Start noch nicht ausgeführt …
+ +

Bei Missing import: JVM_LoadLibrary bitte zusätzlich die ersten relevanten [NATIVE-LOADER]-Zeilen aus der Browserkonsole sichern. Der Bericht enthält keine MES-Anmeldedaten.

+ + diff --git a/backend/src/main/webapp/hmi/cheerpj-native-loader-test.js b/backend/src/main/webapp/hmi/cheerpj-native-loader-test.js new file mode 100644 index 0000000..86e69b0 --- /dev/null +++ b/backend/src/main/webapp/hmi/cheerpj-native-loader-test.js @@ -0,0 +1,189 @@ +// WidgetWorkbench V5.10.19: self-contained, Java-11-only CheerpJ diagnostics. +// No iTAC JARs, MES calls, credentials or modification of JDK/vendor classes. +import wwprobeNativeHandlers from './cheerpj/natives/wwprobe.js'; + +const out = document.getElementById('result'); +const diagnosticModes = ['environment', 'sysprop', 'direct', 'wwprobe', 'jaas', 'unix', 'bridge']; +const params = new URL(location.href).searchParams; +const mode = diagnosticModes.includes(params.get('mode')) ? params.get('mode') : 'environment'; +const runtime = params.get('runtime') === '4.3' ? '4.3' : '5.0'; +const pathVariant = params.get('path') === 'missing' ? 'missing' : 'normal'; +const nativeRoot = '/backend/hmi/cheerpj/natives'; +const classJar = '/backend/hmi/cheerpj/jaas-native-loader-smoke.jar'; +const bridgeJar = '/backend/hmi/cheerpj/jaas-identity-bridge.jar'; +const logs = []; +let resultCode = null; +let resultStatus = 'NOT_RUN'; +const log = (...parts) => { + const line = parts.map(value => { + if (value === null) return 'null'; + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') return String(value); + return '(Objekt: siehe Konsole)'; + }).join(' '); + logs.push(line); + out.textContent += line + '\n'; + console.info('[WidgetWorkbench/NativeLoaderSmoke]', ...parts); +}; + +function renderModeLinks() { + const links = document.getElementById('modes'); + if (!links) return; + for (const name of diagnosticModes) { + const a = document.createElement('a'); + const url = new URL(location.href); + url.searchParams.set('mode', name); + url.searchParams.set('runtime', runtime); + url.searchParams.delete('path'); + a.href = url.pathname + url.search; + a.textContent = name; + a.setAttribute('aria-current', name === mode ? 'page' : 'false'); + links.appendChild(a); + } + const variants = document.getElementById('runtime-links'); + if (!variants) return; + for (const name of ['5.0', '4.3']) { + const a = document.createElement('a'); + const url = new URL(location.href); + url.searchParams.set('runtime', name); + a.href = url.pathname + url.search; + a.textContent = 'CheerpJ ' + name; + a.setAttribute('aria-current', name === runtime ? 'page' : 'false'); + variants.appendChild(a); + } +} + +function report() { + return [ + 'WidgetWorkbench 5.10.19 - CheerpJ Native Loader Diagnosis', + 'CheerpJ runtime: ' + runtime + ' | Java: 11 | mode: ' + mode, + 'java.library.path variant: ' + pathVariant, + 'Run result: ' + resultStatus + (resultCode !== null ? ' (exit ' + resultCode + ')' : ''), + 'No MES account information or internal URLs are recorded.', + '', + ...logs, + '', + 'NOTE: Java System.out/System.err and JVM_LoadLibrary events appear separately', + 'in the browser developer console. Attach only the relevant [NATIVE-LOADER]', + 'lines when reporting to the runtime vendor.', + ].join('\n'); +} +function installCopyButton() { + const btn = document.getElementById('copy-report'); + if (!btn) return; + btn.addEventListener('click', async () => { + try { + await navigator.clipboard.writeText(report()); + btn.textContent = 'Bericht kopiert'; + } catch (_) { + const blob = new Blob([report()], { type: 'text/plain;charset=utf-8' }); + const obj = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = obj; + a.download = 'cheerpj-native-' + runtime + '-' + mode + '.txt'; + a.click(); + URL.revokeObjectURL(obj); + btn.textContent = 'Bericht als Datei gespeichert'; + } + }); +} + +async function checkResource(url, { range = false, module = false } = {}) { + const resp = await fetch(url, { + credentials: 'same-origin', + cache: 'no-store', + ...(range ? { headers: { Range: 'bytes=0-0' } } : {}), + }); + const type = resp.headers.get('content-type') || '(nicht angegeben)'; + const ranges = resp.headers.get('accept-ranges') || '(nicht angegeben)'; + const contentRange = resp.headers.get('content-range') || '(nicht angegeben)'; + log(url, 'HTTP', resp.status, 'Content-Type:', type, 'Accept-Ranges:', ranges, + range ? 'Content-Range: ' + contentRange : ''); + if (!resp.ok) throw new Error('Datei nicht abrufbar: ' + url + ' (HTTP ' + resp.status + ')'); + if (range && resp.status !== 206) { + throw new Error('Java-JAR unterstützt keinen HTTP-Range-Abruf (HTTP ' + resp.status + '): ' + url); + } + if (range && !/^bytes\s+0-0\/\d+$/i.test(contentRange) && contentRange !== '(nicht angegeben)') { + throw new Error('Ungültige Content-Range für JAR: ' + contentRange); + } + if (module) { + const source = await resp.text(); + if (type.toLowerCase().includes('text/html') || !source.includes('export default') || + !source.includes('Java_com_')) { + throw new Error('JS-Native-Modul fehlt oder Server liefert HTML: ' + url); + } + } else if (resp.body && typeof resp.body.cancel === 'function') { + await resp.body.cancel(); // With Range, never fetch a complete large JAR. + } +} + +async function ensureRuntimeLoader() { + if (typeof cheerpjInit === 'function') { + log('CheerpJ-Loader bereits verfügbar.'); + return; + } + // Only these two fixed release URLs are permitted, never user-supplied URLs. + const url = 'https://cjrtnc.leaningtech.com/' + runtime + '/loader.js'; + log('CheerpJ-Loader:', 'release ' + runtime); + await new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.src = url; + script.onload = () => resolve(); + script.onerror = () => reject(new Error('CheerpJ-Loader nicht erreichbar: release ' + runtime)); + document.head.appendChild(script); + }); + if (typeof cheerpjInit !== 'function') throw new Error('cheerpjInit nach Laden nicht verfügbar'); +} + +async function run() { + resultStatus = 'RUNNING'; + log('V5.10.19 | Modus:', mode, '| Java 11 | CheerpJ:', runtime); + log('Dieser Test ist unabhängig von iTAC und GlassFish-Java-Prozessen.'); + await checkResource(classJar, { range: true }); + if (mode === 'bridge') await checkResource(bridgeJar, { range: true }); + if (mode === 'direct' || mode === 'wwprobe') { + await checkResource(nativeRoot + '/wwprobe.js', { module: true }); + } else if (mode === 'jaas' || mode === 'unix') { + await checkResource(nativeRoot + '/jaas.js', { module: true }); + } + await ensureRuntimeLoader(); + const libPath = pathVariant === 'missing' + ? '/app/backend/hmi/cheerpj/absichtlich-nicht-vorhanden' + : '/app' + nativeRoot; + const settings = { + version: 11, + status: 'none', + javaProperties: ['java.library.path=' + libPath], + }; + if (mode === 'direct') { + settings.natives = wwprobeNativeHandlers; + log('Direkter JNI-Handler registriert. Kein System.loadLibrary.'); + } else { + log('Kein direkter Native-Handler registriert; Isolation des Testmodus.'); + } + await cheerpjInit(settings); + log('CheerpJ Java 11 initialisiert; Testklasse starten …'); + const classpath = '/app' + classJar + (mode === 'bridge' ? ':/app' + bridgeJar : ''); + const code = await cheerpjRunMain('com.widgetworkbench.cheerpj.NativeLoaderSmoke', classpath, mode); + resultCode = typeof code === 'number' ? code : null; + resultStatus = code === 0 ? 'PASS' : 'FAIL'; + log('Java-Exit-Code:', resultCode === null ? 'nicht numerisch' : resultCode); + log('TESTERGEBNIS:', resultStatus); + if (mode === 'direct' && code === 0) { + log('Direct JNI funktioniert. System.loadLibrary/UnixSystem ist dadurch NICHT repariert.'); + } else if (mode === 'bridge' && code === 0) { + log('Java-Bridge funktioniert OHNE UnixSystem-Konstruktor. Kein produktiver Login-Workaround.'); + } + log('Für vollständige Java-Fehlerdetails die [NATIVE-LOADER]-Zeilen aus der Browserkonsole hinzufügen.'); +} + +renderModeLinks(); +installCopyButton(); +out.textContent = ''; +run().catch(error => { + resultStatus = 'ABORT'; + // CheerpJ Java Throwable proxies can fail conversion to String(); preserve original. + console.error('[WidgetWorkbench/NativeLoaderSmoke] Original exception:', error); + const reason = error instanceof Error && typeof error.message === 'string' + ? error.message : 'Java-/Runtime-Exception; Original in der Browserkonsole'; + log('TESTABBRUCH:', reason); +}); diff --git a/backend/src/main/webapp/hmi/cheerpj-runner.html b/backend/src/main/webapp/hmi/cheerpj-runner.html index 3e11261..f1bd7d0 100644 --- a/backend/src/main/webapp/hmi/cheerpj-runner.html +++ b/backend/src/main/webapp/hmi/cheerpj-runner.html @@ -1,7 +1,20 @@ CheerpJ-Frame | WidgetWorkbench - - + + -
+
diff --git a/backend/src/main/webapp/hmi/cheerpj-runner.js b/backend/src/main/webapp/hmi/cheerpj-runner.js index c16bef3..f63446c 100644 --- a/backend/src/main/webapp/hmi/cheerpj-runner.js +++ b/backend/src/main/webapp/hmi/cheerpj-runner.js @@ -1,14 +1,115 @@ -/* WidgetWorkbench CheerpJ 4.3 runner. +import jaasNativeHandlers from './cheerpj/natives/jaas.js'; + +/* WidgetWorkbench CheerpJ 5.0 runner (4.3 selectable as a compatibility fallback). * CheerpJ Core has no documented runJNLP(url) API: parse the manifest and run JAR(s). * Deliberately SAME-ORIGIN only. Do not turn this into an open server-side URL proxy. */ const screen=document.getElementById('display'); const notice=document.getElementById('state'); -const BRIDGE_JAR='/app/backend/hmi/cheerpj/workplace-resize-bridge-v2.jar'; +const BRIDGE_JAR='/app/backend/hmi/cheerpj/workplace-window-monitor-v4.jar'; +const CREDENTIAL_BRIDGE_JAR='/app/backend/hmi/cheerpj/workplace-credential-bridge.jar'; +const CREDENTIAL_BRIDGE_URL='/backend/hmi/cheerpj/workplace-credential-bridge.jar'; +let credentialWaiter=null; +// JS implementation for OpenJDK UnixSystem.getUnixInfo. Register the handler via +// cheerpjInit({natives}) AND keep the JS native library for System.loadLibrary. +// Note: registration cannot repair a missing CheerpJ JVM_LoadLibrary import. +const JAAS_JS_URL='/backend/hmi/cheerpj/natives/jaas.js'; +const JAAS_NATIVE_PATH='/app/backend/hmi/cheerpj/natives'; +const JAAS_BRIDGE_JAR='/app/backend/hmi/cheerpj/jaas-identity-bridge.jar'; +// JSON-P 1.1 provider required by iTAC ParameterType; NOT included in Workplace.jnlp. +// Maven packages this dependency as a static WAR resource. +const JSONP_PROVIDER_URL='/backend/hmi/cheerpj-libs/javax.json-1.1.4.jar'; +const JSONP_PROVIDER_JAR='/app'+JSONP_PROVIDER_URL; const WORKPLACE_MANIFEST='/backend/api/hmi/v1/cheerpj/workplace/manifest.jnlp'; // Writable, browser-local CheerpJ directory; never a GlassFish/server filesystem path. const WORKPLACE_TMP_DIR='/files/itac-workplace/tmp'; +// CheerpJ /files is writable. A flat and finally root fallback handle engines +// that cannot create nested directories or previously conflicting user files. +const WORKPLACE_TMP_CANDIDATES=[WORKPLACE_TMP_DIR,'/files/itac-workplace-tmp','/files']; let busy=false; +// Collect the last boot stage so a CheerpJ WASM exit code can be tied to the +// Java startup phase. No credentials, JNLP arguments or MES URLs are logged. +let bootStage='not-started'; +function boot(stage){ + bootStage=stage; + console.info('[WidgetWorkbench/CheerpJ] '+stage); +} +// CheerpJ can reject library-mode calls with a Java Throwable proxy. Such +// objects do NOT necessarily implement JS Symbol.toPrimitive/toString, so +// String(error), a template literal or `'' + error` can replace the original +// JAAS exception with "Cannot convert object to primitive value". +function primitiveText(value){ + switch(typeof value){ + case 'string': return value; + case 'number': case 'boolean': case 'bigint': return String(value); + default: return null; + } +} +async function describeThrowable(error,depth=0,seen=new Set()){ + const direct=primitiveText(error); + if(direct!==null)return direct; + if(error===null||error===undefined)return 'Unbekannte JavaScript-Ausnahme'; + if(depth>2||seen.has(error))return 'Weitere Exception (rekursiv)'; + seen.add(error); + let className=null, message=null, stack=null, cause=null; + try{ + const getClass=error.getClass; + if(typeof getClass==='function'){ + const cls=await getClass.call(error); + if(cls && typeof cls.getName==='function')className=primitiveText(await cls.getName()); + } + }catch(_ignored){ /* Java proxy may not expose class metadata. */ } + try{if(!className)className=primitiveText(error.name);}catch(_ignored){} + try{ + const getMessage=error.getMessage; + if(typeof getMessage==='function')message=primitiveText(await getMessage.call(error)); + }catch(_ignored){ /* Read the original exception below without replacing it. */ } + try{if(!message)message=primitiveText(error.message);}catch(_ignored){} + try{ + if(!message && typeof error.toString==='function'){ + message=primitiveText(await error.toString()); + } + }catch(_ignored){} + try{stack=primitiveText(error.stack);}catch(_ignored){} + try{ + if(typeof error.getCause==='function')cause=await error.getCause(); + else cause=error.cause; + }catch(_ignored){} + let result=[className,message].filter(Boolean).join(': '); + if(!result && stack)result=stack; + if(!result)result='CheerpJ-Java-Exception (nicht als JavaScript-String lesbar)'; + if(cause!==null&&cause!==undefined&&cause!==error) + result+=' | Ursache: '+await describeThrowable(cause,depth+1,seen); + return result.slice(0,900); +} +async function describeFailure(error){ + // Keep the original object accessible in DevTools, not only a reformatted copy. + console.error('[WidgetWorkbench/CheerpJ] Failure in '+bootStage+' (original):',error); + const reason=await describeThrowable(error); + return 'CheerpJ-Start fehlgeschlagen in Phase "'+bootStage+'": '+reason+ + '. Details in der Browser-Konsole (WidgetWorkbench/CheerpJ).'; +} +// Optional browser-JVM probe: ?diagnose=jaas. Only exercised on demand. +// Does not replace the real iTAC authentication or modify vendor JARs. +async function probeJaasRuntime(lib){ + boot('JAAS: UnixSystem-Klasse laden'); + const UnixSystem=await lib.com.sun.security.auth.module.UnixSystem; + boot('JAAS: UnixSystem-Konstruktor (System.loadLibrary)'); + const instance=await new UnixSystem(); + boot('JAAS: UnixSystem.getUsername()'); + const user=await instance.getUsername(); + let identityOk=user==='cheerpj-client'; + // CheerpJ generally passes Java String by value, but guard versions that + // expose a Java proxy instead of coercing that object with String(user). + if(!identityOk && user!=null){ + try{if(typeof user.equals==='function')identityOk=(await user.equals('cheerpj-client'))===true;} + catch(_ignored){} + } + console.info('[WidgetWorkbench/CheerpJ] UnixSystem konstruiert; synthetische Benutzeridentität gültig:',identityOk); + if(!identityOk)throw Error('JAAS-Runtimeprüfung: unerwartete virtuelle Benutzeridentität'); + boot('JAAS-Laufzeittest erfolgreich (UnixSystem)'); +} + const trusted=(raw,base=location.href)=>{ const u=new URL(raw,base); if(u.origin!==location.origin)throw Error('JNLP und alle JARs müssen von derselben Origin wie WidgetWorkbench kommen.'); @@ -69,74 +170,108 @@ function readManifest(xml,jnlpUrl){ * Only the immutable, locally packaged Bridge JAR is loaded; no vendor JAR is modified. * When the JVM has not created MesSuiteFrame yet, retry for a bounded startup window. */ -async function ensureWorkplaceTempDirectory() { - // /app is read-only and /str is read-only to Java. CheerpJ's /files mount - // supports Java writes (IndexedDB, per-browser origin). Create via Java NIO, - // not JavaScript, because JS cannot write directly into /files. - if (typeof window.cheerpjRunLibrary !== 'function') - throw Error('CheerpJ Library Mode für die Temp-Verzeichnisanlage nicht verfügbar.'); - const lib=await window.cheerpjRunLibrary(''); +async function ensureWorkplaceTempDirectory(lib) { + // Use Java NIO through CheerpJ Library Mode. Checking Files.isDirectory() + // with `=== true` is not reliable across CheerpJ versions: the reported + // value can be a bridge wrapper, even when the directory is writable. + // The real requirement for java.io.tmpdir is that Java can create a file. + if (!lib)throw Error('CheerpJ Library Mode für das Temp-Verzeichnis nicht verfügbar.'); const Paths=await lib.java.nio.file.Paths; const Files=await lib.java.nio.file.Files; - const path=await Paths.get(WORKPLACE_TMP_DIR); - try { - await Files.createDirectories(path, []); - if (await Files.isDirectory(path, []) !== true) - throw Error('Pfad ist kein Verzeichnis.'); - // Checking the directory alone is not enough: verify actual write access. - const probe=await Files.createTempFile(path,'hmi-tmp-check-','.tmp',[]); - await Files.deleteIfExists(probe); - } catch(error) { - throw Error('CheerpJ-Temp-Verzeichnis '+WORKPLACE_TMP_DIR+' nicht verfügbar: '+ - (error instanceof Error ? error.message : String(error))); - } -} - -async function attachWorkplaceResize(container, classPath, mode) { - if (typeof window.cheerpjRunLibrary !== 'function') - throw Error('CheerpJ Library Mode für die ResizeBridge nicht verfügbar.'); - const lib=await window.cheerpjRunLibrary(classPath); - const bridge=await lib.com.widgetworkbench.cheerpj.WorkplaceResizeBridge; - let closed=false, inFlight=false, pending=false, lastSize='', retry=0; - let retryTimer=null; - const desired=()=>{ - if(mode==='original')return [1280,1024]; - const size=container.getBoundingClientRect(); - return [Math.max(200,Math.floor(size.width)),Math.max(150,Math.floor(size.height))]; - }; - async function update(){ - if(closed||inFlight){pending=true;return;} - const [width,height]=desired(), size=width+'x'+height; - if(size===lastSize && retry>=24)return; - inFlight=true; + const System=await lib.java.lang.System; + const errors=[]; + for(const candidate of WORKPLACE_TMP_CANDIDATES){ try{ - const found=await bridge.resize(width,height); - // The frame appears asynchronously while cheerpjRunMain is active. - if(Number(found)>0){lastSize=size;retry=24;} + const dir=await Paths.get(candidate); + if(candidate!=='/files')await Files.createDirectories(dir,[]); + // A successful write/delete is stronger proof than isDirectory() and + // works independently of Java boolean conversion in the JS bridge. + const probe=await Files.createTempFile(dir,'hmi-tmp-check-','.tmp',[]); + try{ + const deleted=await Files.deleteIfExists(probe); + if(deleted===false)throw Error('Schreibtestdatei konnte nicht entfernt werden.'); + }catch(cleanupError){ + throw Error('Temporäre Testdatei konnte nicht gelöscht werden: '+await describeThrowable(cleanupError)); + } + // Bootstrap with java.io.tmpdir=/files (always an existing mount point), + // then configure the tested directory before invoking Workplace main(). + await System.setProperty('java.io.tmpdir',candidate); + return candidate; }catch(error){ - console.warn('Workplace resize bridge:',error); - retry=24; - }finally{ - inFlight=false; - if(pending&&!closed){pending=false;void update();} + errors.push(candidate+': '+await describeThrowable(error)); } } - const observer=typeof ResizeObserver!=='undefined' ? new ResizeObserver(()=>{retry=24;void update();}) : null; - observer?.observe(container); - // Retry initialization until first Workplace JFrame is shown, stop after 24 attempts. - retryTimer=setInterval(()=>{ - if(closed||retry>=24){clearInterval(retryTimer);return;} - retry++; - void update(); - },750); - void update(); - return {stop(){closed=true;observer?.disconnect();if(retryTimer)clearInterval(retryTimer);},refresh:()=>update()}; + throw Error('CheerpJ-Temp-Verzeichnis nicht beschreibbar ('+errors.join(' | ')+').'); } +// V5.10.21: Do NOT concurrently call a CheerpJ Library Mode method from +// JS timers. CheerpJ may reject the second invocation with: +// "Java code still running, check for a missing 'await'". +// The Java bridge starts ONE daemon monitor before main(), which handles +// resize and window inspection entirely inside the JVM/AWT thread domain. +// No further JS -> CheerpJ library-mode calls are made while main() runs. +async function attachWorkplaceRuntimeMonitor(container, lib, windowMode, displayMode) { + if(!lib)throw Error('CheerpJ Library Mode für Fensterüberwachung nicht verfügbar.'); + const bridge=await lib.com.widgetworkbench.cheerpj.WorkplaceResizeBridge; + if(typeof bridge.startRuntimeMonitor!=='function') + throw Error('Workplace Window Monitor v4 fehlt: startRuntimeMonitor nicht vorhanden. JAR V5.10.22 prüfen.'); + const panel=document.getElementById('window-diagnostics'); + const output=document.getElementById('window-diagnostics-output'); + const bounds=container.getBoundingClientRect(); + const width=displayMode==='original'?1280:Math.max(200,Math.floor(bounds.width)); + const height=displayMode==='original'?1024:Math.max(150,Math.floor(bounds.height)); + // This is the LAST library-mode method call before cheerpjRunMain(). + // startRuntimeMonitor returns immediately; Java then polls independently. + const started=await bridge.startRuntimeMonitor(width,height,windowMode); + if(Number(started)!==1&&Number(started)!==2) + throw Error('Workplace Window Monitor wurde nicht gestartet (Code '+(primitiveText(started)??'?')+').'); + if(windowMode!=='off'){ + if(panel)panel.hidden=false; + if(output)output.textContent='Java-11-Fensterdiagnose aktiv ('+windowMode+').\n' + +'Ausgabe in der Browser-Konsole: [WidgetWorkbench/WindowGeometry]\n' + +'Die Abfragen laufen im Java-Hintergrundthread, ohne parallele CheerpJ-Library-Aufrufe.\n' + +'MES_LOGIN: NOT_SEEN / CREATED_HIDDEN / VISIBLE_ONSCREEN / VISIBLE_OFFSCREEN.\n' + +'MES_LOGIN_OWNER zeigt das iTAC-Besitzerfenster; COMPONENT_TREE erfasst JInternalFrame/MyDoggy.\n' + +'Eine JAAS UnsatisfiedLinkError kann die Dialogerzeugung verhindern und wird hier NICHT umgangen.'; + } + console.info('[WidgetWorkbench/WindowGeometry] Java-interner Monitor gestartet; ' + +width+'x'+height+'; Modus='+windowMode+'; keine JS-Library-Polling-Aufrufe.'); + return {stop(){ /* Monitor lebt als Java-Daemon bis zum Ende der JVM. */ }}; +} + +// Request secrets only after the JVM has initialized and immediately before +// main(). No URL/query parameters, storage or server-side password endpoint. +async function requestBrowserCredentials(requestId){ + if(window.parent===window)return null; // standalone window has no trusted parent + return new Promise(resolve=>{ + const waiter={requestId,resolve};credentialWaiter=waiter; + const timeout=setTimeout(()=>{ + if(credentialWaiter===waiter){credentialWaiter=null;resolve(null);} + },5000); + waiter.finish=value=>{ + clearTimeout(timeout); + if(credentialWaiter===waiter)credentialWaiter=null; + resolve(value); + }; + window.parent.postMessage({type:'hmi-cheerpj-credential-request',requestId},location.origin); + }); +} +function credentialNativeHandlers(requestId){ + return { + ...jaasNativeHandlers, + // Direct JNI, not System.loadLibrary(). Results contain codes only. + async Java_com_widgetworkbench_cheerpj_WorkplaceCredentialBridge_nativeReport(_lib,_self,code){ + const result=Number(code); + const labels={1:'MES_LOGIN_SUCCESS',2:'MES_LOGIN_REJECTED',3:'ALREADY_AUTHENTICATED',4:'EXPIRED',5:'BRIDGE_ERROR'}; + console.info('[WidgetWorkbench/WorkplaceAuth]',labels[result]||'UNKNOWN_RESULT'); + if(window.parent!==window)window.parent.postMessage({type:'hmi-cheerpj-auth-result',requestId,code:result},location.origin); + } + }; +} function status(requestId,state,message){ const text=String(message).slice(0,350); notice.textContent=text;notice.className=state==='error'?'fail':''; - parent.postMessage({type:'hmi-cheerpj-state',requestId,state,message:text},location.origin); + if(window.parent!==window)parent.postMessage({type:'hmi-cheerpj-state',requestId,state,message:text},location.origin); } async function start(e,data){ const id=data.requestId; @@ -148,6 +283,11 @@ async function start(e,data){ if(![8,11,17].includes(version))throw Error('Ungültige Java-Version.'); const isWorkplace=data.workplace===true && url.pathname===WORKPLACE_MANIFEST; const displayMode=data.displayMode==='original'?'original':'fit'; + const params=new URL(location.href).searchParams; + const rawWindowMode=data.windowMode ?? params.get('windows'); + const windowMode=isWorkplace && ['off','diagnose','rescue'].includes(rawWindowMode) + ? rawWindowMode : (isWorkplace ? 'diagnose' : 'off'); + boot('JNLP-Abruf'); status(id,'loading','JNLP wird gelesen …'); const r=await fetch(url.href,{credentials:'same-origin',redirect:'follow',cache:'no-store'}); if(!r.ok||!r.url||trusted(r.url).origin!==location.origin)throw Error('JNLP nicht abrufbar (HTTP '+r.status+').'); @@ -158,45 +298,165 @@ async function start(e,data){ if(typeof window.cheerpjInit!=='function'){ await new Promise((resolve,reject)=>{let count=0;const timer=setInterval(()=>{if(typeof window.cheerpjInit==='function'){clearInterval(timer);resolve();}else if(++count>150){clearInterval(timer);reject(Error('CheerpJ CDN nicht erreichbar oder durch CSP blockiert.'));}},100);}); } + // Keep a single JVM library context for tmp, optional JAAS diagnostics and + // ResizeBridge: CheerpJ allows only one library thread in this configuration. + const cp=manifest.paths.join(':')+(isWorkplace + ? ':'+JSONP_PROVIDER_JAR+':'+JAAS_BRIDGE_JAR+':'+CREDENTIAL_BRIDGE_JAR+':'+BRIDGE_JAR : ''); + const diag=new URL(location.href).searchParams.get('diagnose'); + // Explicitly verify native JavaScript is delivered before VM initialization; + // a successful HTTP response alone does NOT guarantee System.loadLibrary works. + if(isWorkplace){ + boot('JAAS-JavaScript abrufen'); + const nativeResponse=await fetch(JAAS_JS_URL,{credentials:'same-origin',cache:'no-store'}); + if(!nativeResponse.ok)throw Error('JAAS-Kompatibilitätsmodul fehlt (HTTP '+nativeResponse.status+').'); + if(typeof jaasNativeHandlers?.Java_com_sun_security_auth_module_UnixSystem_getUnixInfo!=='function') + throw Error('JAAS-JavaScript enthält keine gültige UnixSystem-JNI-Implementierung.'); + } // JNLP URL query parameters are not Java system properties. - // CheerpJ 4.3 supplies -D equivalents through javaProperties. + // CheerpJ supplies -D equivalents through javaProperties. const javaProperties=isWorkplace && manifest.clusterNodes ? ['itac.artes.clusternodes='+manifest.clusterNodes] : []; - if(isWorkplace)javaProperties.push('java.io.tmpdir='+WORKPLACE_TMP_DIR); - await window.cheerpjInit({version,status:'none',javaProperties}); + // /files exists already when the Java VM initializes; choose the actual + // writable subdirectory after probing, before launching the application. if(isWorkplace){ - status(id,'loading','Virtuelles Workplace-Temp-Verzeichnis wird vorbereitet …'); - await ensureWorkplaceTempDirectory(); + javaProperties.push('java.io.tmpdir=/files'); + // Must be present at VM initialization: UnixSystem() calls loadLibrary("jaas") + // before running its private native method getUnixInfo(). + javaProperties.push('java.library.path='+JAAS_NATIVE_PATH); } + boot('CheerpJ-Initialisierung'); + await window.cheerpjInit({version,status:'none',javaProperties, + ...(isWorkplace ? {natives:credentialNativeHandlers(id)} : {})}); + boot('CheerpJ initialisiert'); + let sharedLib=null; + if(isWorkplace){ + boot('Gemeinsamen Java-Library-Kontext starten'); + sharedLib=await window.cheerpjRunLibrary(cp); + status(id,'loading','Virtuelles Workplace-Temp-Verzeichnis wird vorbereitet …'); + boot('Temp-Verzeichnis prüfen'); + const tempDir=await ensureWorkplaceTempDirectory(sharedLib); + if(tempDir!==WORKPLACE_TMP_DIR)manifest.warnings.push('Temp-Ausweichverzeichnis: '+tempDir+'.'); + } + boot('Java-Anzeigefläche vorbereiten'); if(isWorkplace && displayMode==='original'){ document.body.classList.add('cheerpj-original-mode'); window.cheerpjCreateDisplay(1280,1024,screen); }else{ window.cheerpjCreateDisplay(-1,-1,screen); } - let resizeBridge=null; - let cp=manifest.paths.join(':'); + let windowMonitor=null; if(isWorkplace){ - cp+=':'+BRIDGE_JAR; + // Range probe catches a missing WAR-bundled provider (or server-side + // Range misconfiguration) before Java reports opaque ExceptionInInitializerError. + boot('JSON-P-JAR prüfen'); + const jsonpProbe=await fetch(JSONP_PROVIDER_URL,{ + credentials:'same-origin',cache:'no-store',headers:{Range:'bytes=0-0'} + }); + if(jsonpProbe.status!==206){ + throw Error('JSON-P-Provider im WAR fehlt oder unterstützt kein HTTP Range ' + +'(HTTP '+jsonpProbe.status+'). Maven-Build und ' + +'hmi/cheerpj-libs/javax.json-1.1.4.jar prüfen.'); + } + // Validate the helper JAR before Java main(); the native JS module has + // already been registered via cheerpjInit({natives}) above. + boot('JAAS-Bridge-JAR prüfen'); + const bridgeProbe=await fetch(JAAS_BRIDGE_JAR.slice(4),{ + credentials:'same-origin',cache:'no-store',headers:{Range:'bytes=0-0'} + }); + if(bridgeProbe.status!==206)throw Error('JAAS-Java-Hilfsklasse nicht als JAR abrufbar ' + +'(HTTP '+bridgeProbe.status+'). hmi/cheerpj/jaas-identity-bridge.jar prüfen.'); + // The vendor JNLP contains javax.json API but not its implementation. + // Keep proprietary JARs untouched; helpers are part of the shared cp. + if(diag==='jaas' || diag==='jaas-only'){ + try{ + await probeJaasRuntime(sharedLib); + }catch(error){ + console.error('[WidgetWorkbench/CheerpJ] JAAS-Laufzeittest Original-Exception:',error); + const msg=await describeThrowable(error); + throw Error('JAAS-Laufzeittest fehlgeschlagen. '+msg+'; ' + +'falls JVM_LoadLibrary oder no jaas in java.library.path gemeldet wird, ' + +'liegt das Problem bereits beim nativen Library-Loader der CheerpJ-JVM.', + {cause:error}); + } + if(diag==='jaas-only'){ + boot('JAAS-Laufzeittest erfolgreich – kein Workplace-Start'); + status(id,'finished','JAAS UnixSystem erfolgreich initialisiert. Workplace nicht gestartet (Diagnosemodus).'); + return; + } + } + if(data.browserCredentials===true){ + boot('Einmalige Browser-Anmeldung vorbereiten'); + const credentials=await requestBrowserCredentials(id); + if(credentials){ + // Probe only when a one-time offer was made. Server must support Range. + const credentialProbe=await fetch(CREDENTIAL_BRIDGE_URL,{ + credentials:'same-origin',cache:'no-store',headers:{Range:'bytes=0-0'} + }); + if(credentialProbe.status!==206){ + status(id,'loading','Workplace-Anmeldebridge ist nicht verfügbar; normaler Login bleibt aktiv.'); + }else{ + try{ + const authBridge=await sharedLib.com.widgetworkbench.cheerpj.WorkplaceCredentialBridge; + const accepted=await authBridge.offer(credentials.username,credentials.password,credentials.client); + if(Number(accepted)!==1)throw Error('Einmalige Anmeldung wurde von der Java-Bridge abgelehnt.'); + // No success claim until the Java nativeReport callback reports code 1. + console.info('[WidgetWorkbench/WorkplaceAuth] One-shot offer accepted; waiting for PersonService'); + }catch(error){ + console.warn('[WidgetWorkbench/WorkplaceAuth] Übergabe fehlgeschlagen (Zugangsdaten und Exception werden nicht protokolliert).'); + status(id,'loading','Workplace-Übergabe fehlgeschlagen; manueller MES-Login bleibt möglich.'); + } + } + }else{ + console.info('[WidgetWorkbench/WorkplaceAuth] Keine Browser-Zugangsdaten angeboten; normaler MES-Login.'); + } + } + boot('Java-internen Swing-Fenstermonitor starten ('+windowMode+')'); try{ - resizeBridge=await attachWorkplaceResize(screen,cp,displayMode); + windowMonitor=await attachWorkplaceRuntimeMonitor(screen,sharedLib,windowMode,displayMode); }catch(error){ - console.warn('Optional Workplace ResizeBridge unavailable:',error); - manifest.warnings.push('ResizeBridge konnte nicht gestartet werden; Anzeige bleibt nutzbar, interne Größe möglicherweise fix.'); + console.warn('[WidgetWorkbench/WindowGeometry] Java-interner Monitor nicht verfügbar:',error); + manifest.warnings.push('Fenstermonitor nicht verfügbar; Workplace-Start wird fortgesetzt.'); } } + boot('iTAC Workplace main(): '+(manifest.main?'Startklasse vorhanden':'JAR-Start')); status(id,'running','Java-Anwendungsstart wird versucht. '+manifest.warnings.join(' ')); try{ const exitCode=manifest.main ? await window.cheerpjRunMain(manifest.main,cp,...manifest.args) : await window.cheerpjRunJar(manifest.paths[0],...manifest.args); + boot('Java main() beendet'); status(id,'finished','Anwendung beendet (Exit-Code '+exitCode+').'); - }finally{resizeBridge?.stop();} - }catch(error){status(id,'error',error instanceof Error?error.message:String(error));} + }finally{windowMonitor?.stop();} + }catch(error){status(id,'error',await describeFailure(error));} } window.addEventListener('message',event=>{ if(event.source!==window.parent||event.origin!==location.origin)return; const data=event.data; - if(!data||data.type!=='hmi-cheerpj-launch'||typeof data.requestId!=='string'||data.requestId.length>150)return; - void start(event,data); + if(!data||typeof data.requestId!=='string'||data.requestId.length>150)return; + if(data.type==='hmi-cheerpj-credentials'||data.type==='hmi-cheerpj-credentials-unavailable'){ + const waiter=credentialWaiter; + if(!waiter||waiter.requestId!==data.requestId)return; + if(data.type==='hmi-cheerpj-credentials-unavailable'){waiter.finish(null);return;} + if(typeof data.username!=='string'||!data.username||data.username.length>120 + ||typeof data.password!=='string'||!data.password||data.password.length>1024 + ||typeof data.client!=='string'||!data.client||data.client.length>120)return; + waiter.finish({username:data.username,password:data.password,client:data.client}); + return; + } + if(data.type==='hmi-cheerpj-launch')void start(event,data); }); + +// Direct, full-window workplace mode. This URL is deliberately limited to the +// fixed authenticated MES JNLP bridge. No arbitrary JNLP or Java class name +// can be supplied through query parameters. +if(new URL(location.href).searchParams.get('standalone')==='workplace'){ + document.body.classList.add('cheerpj-standalone'); + void start(null,{ + requestId:'standalone-workplace', + jnlpUrl:new URL(WORKPLACE_MANIFEST,location.href).href, + javaVersion:11, + workplace:true, + displayMode:'fit', + windowMode:new URL(location.href).searchParams.get('windows') + }); +} diff --git a/backend/src/main/webapp/hmi/cheerpj/jaas-identity-bridge.jar b/backend/src/main/webapp/hmi/cheerpj/jaas-identity-bridge.jar new file mode 100644 index 0000000..c307038 Binary files /dev/null and b/backend/src/main/webapp/hmi/cheerpj/jaas-identity-bridge.jar differ diff --git a/backend/src/main/webapp/hmi/cheerpj/jaas-native-loader-smoke.jar b/backend/src/main/webapp/hmi/cheerpj/jaas-native-loader-smoke.jar new file mode 100644 index 0000000..f3d43e7 Binary files /dev/null and b/backend/src/main/webapp/hmi/cheerpj/jaas-native-loader-smoke.jar differ diff --git a/backend/src/main/webapp/hmi/cheerpj/natives/jaas.js b/backend/src/main/webapp/hmi/cheerpj/natives/jaas.js new file mode 100644 index 0000000..1d9106e --- /dev/null +++ b/backend/src/main/webapp/hmi/cheerpj/natives/jaas.js @@ -0,0 +1,27 @@ +/* + * Virtual OpenJDK 11 `jaas` library for CheerpJ Workplace. + * JDK UnixSystem() calls System.loadLibrary("jaas") followed by native + * getUnixInfo(). This module supplies only that native method and delegates + * protected-field initialization to our unsigned, non-vendor Java helper. + * + * Not an authentication provider: users must still authenticate to iTAC MES. + * This handler is registered with cheerpjInit({natives}) in addition to being + * exported as a System.loadLibrary("jaas") module. Registering the method + * does not itself make JVM_LoadLibrary available in the CheerpJ runtime. + */ +export default { + async Java_com_sun_security_auth_module_UnixSystem_getUnixInfo(lib, self) { + if (!lib || !self) { + throw new Error('CheerpJ JAAS bridge: missing native context'); + } + const helper = await lib.com.widgetworkbench.cheerpj.JaasIdentityBridge; + if (!helper || typeof helper.populate !== 'function') { + throw new Error('CheerpJ JAAS bridge JAR is not on the Workplace classpath'); + } + console.info('[WidgetWorkbench/JAAS] UnixSystem.getUnixInfo native invoked'); + const username = await helper.populate(self); + if (username !== 'cheerpj-client') { + throw new Error('CheerpJ JAAS bridge returned an unexpected identity'); + } + }, +}; diff --git a/backend/src/main/webapp/hmi/cheerpj/natives/wwprobe.js b/backend/src/main/webapp/hmi/cheerpj/natives/wwprobe.js new file mode 100644 index 0000000..38006e8 --- /dev/null +++ b/backend/src/main/webapp/hmi/cheerpj/natives/wwprobe.js @@ -0,0 +1,10 @@ +// Self-contained native-library-loader diagnostic; no MES authentication or system identity. +// Loaded EITHER by System.loadLibrary("wwprobe") from java.library.path OR +// injected directly through cheerpjInit({natives}) in the isolated direct test. +// The direct path does not repair JVM_LoadLibrary and does not affect JAAS. +export default { + async Java_com_widgetworkbench_cheerpj_NativeLoaderSmoke_ping() { + console.info('[WidgetWorkbench/NativeLoaderSmoke] wwprobe.js JNI callback reached'); + return 42; + } +}; diff --git a/backend/src/main/webapp/hmi/cheerpj/workplace-credential-bridge.jar b/backend/src/main/webapp/hmi/cheerpj/workplace-credential-bridge.jar new file mode 100644 index 0000000..060458f Binary files /dev/null and b/backend/src/main/webapp/hmi/cheerpj/workplace-credential-bridge.jar differ diff --git a/backend/src/main/webapp/hmi/cheerpj/workplace-resize-bridge-v2.jar b/backend/src/main/webapp/hmi/cheerpj/workplace-resize-bridge-v2.jar index 377dff0..feee7c3 100644 Binary files a/backend/src/main/webapp/hmi/cheerpj/workplace-resize-bridge-v2.jar and b/backend/src/main/webapp/hmi/cheerpj/workplace-resize-bridge-v2.jar differ diff --git a/backend/src/main/webapp/hmi/cheerpj/workplace-window-monitor-v3.jar b/backend/src/main/webapp/hmi/cheerpj/workplace-window-monitor-v3.jar new file mode 100644 index 0000000..6a48a01 Binary files /dev/null and b/backend/src/main/webapp/hmi/cheerpj/workplace-window-monitor-v3.jar differ diff --git a/backend/src/main/webapp/hmi/cheerpj/workplace-window-monitor-v4.jar b/backend/src/main/webapp/hmi/cheerpj/workplace-window-monitor-v4.jar new file mode 100644 index 0000000..fb0a653 Binary files /dev/null and b/backend/src/main/webapp/hmi/cheerpj/workplace-window-monitor-v4.jar differ diff --git a/backend/src/main/webapp/hmi/index.html b/backend/src/main/webapp/hmi/index.html index 2361de5..d962a45 100644 --- a/backend/src/main/webapp/hmi/index.html +++ b/backend/src/main/webapp/hmi/index.html @@ -1,3 +1,3 @@ -Workbench HMI - +Workbench HMI +
diff --git a/backend/target/backend-1.war b/backend/target/backend-1.war index cf2bdf8..0c20cb3 100644 Binary files a/backend/target/backend-1.war and b/backend/target/backend-1.war differ diff --git a/backend/target/backend-1/hmi/index.html b/backend/target/backend-1/hmi/index.html index 2361de5..d962a45 100644 --- a/backend/target/backend-1/hmi/index.html +++ b/backend/target/backend-1/hmi/index.html @@ -1,3 +1,3 @@ -Workbench HMI - +Workbench HMI +
diff --git a/backend/target/jacoco.exec b/backend/target/jacoco.exec index 799590a..029c870 100644 Binary files a/backend/target/jacoco.exec and b/backend/target/jacoco.exec differ diff --git a/backend/target/site/jacoco/com.workbenchclassic.hmi/index.html b/backend/target/site/jacoco/com.workbenchclassic.hmi/index.html index aabbc4c..5a591e5 100644 --- a/backend/target/site/jacoco/com.workbenchclassic.hmi/index.html +++ b/backend/target/site/jacoco/com.workbenchclassic.hmi/index.html @@ -1 +1 @@ -com.workbenchclassic.hmi

com.workbenchclassic.hmi

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total14.447 of 14.4470 %1.845 of 1.8450 %1.2191.2192.0502.0502932933232
HmiApiResource4.6530 %5990 %368368561561676711
HmiWidgetRevisionResource1.2810 %1560 %102102129129242411
HmiRolesResource9530 %860 %6565111111222211
HmiSchemaBootstrap7540 %800 %5858158158181811
HmiStyleResource6540 %560 %45455151171711
HmiImsapiGateway5280 %960 %535368685511
HmiAuth4850 %1000 %67677676171711
HmiImsapiSecurityResource4430 %480 %303074746611
HmiWorkplaceProxyResource4080 %500 %35358686101011
HmiJvmOptions3720 %320 %242469698811
HmiWorkplaceConfiguration3580 %640 %383858586611
HmiAssetsResource3580 %600 %353537375511
HmiWorkplaceManifest3580 %460 %252565652211
HmiLegacyWidgetResource3540 %460 %323250507711
HmiInitialAdmin3490 %580 %373765658811
HmiWorkplaceJarCache3120 %260 %202058587711
HmiPersonnel2590 %440 %292954547711
HmiSystemSettingsResource1970 %240 %181837376611
HmiWorkplaceByteRange1870 %280 %181829294411
HmiWorkplaceSettingsResource1810 %220 %171727276611
HmiBootstrapResource1570 %140 %111123234411
HmiImsapiActionResource1530 %200 %131322223311
HmiStyles1360 %280 %181821214411
HmiSchemaRecoveryResource1340 %160 %111117173311
HmiSchemaRecovery920 %140 %131322226611
HmiTransportPolicy880 %160 %131318185511
HmiHealthServlet700 %n/a2221212211
HmiJvmOptions.new Callable() {...}440 %0 %44882211
HmiThemeServlet430 %0 %4411112211
HmiOriginFilter0 %0 %5512124411
HmiPersonnel.Person0 %0 %33771111
HmiDb0 %0 %66665511
\ No newline at end of file +com.workbenchclassic.hmi

com.workbenchclassic.hmi

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total14.515 of 14.5150 %1.859 of 1.8590 %1.2301.2302.0622.0622972973232
HmiApiResource4.6530 %5990 %368368561561676711
HmiWidgetRevisionResource1.2810 %1560 %102102129129242411
HmiRolesResource9530 %860 %6565111111222211
HmiSchemaBootstrap7540 %800 %5858158158181811
HmiStyleResource6540 %560 %45455151171711
HmiImsapiGateway5280 %960 %535368685511
HmiAuth4850 %1000 %67677676171711
HmiImsapiSecurityResource4430 %480 %303074746611
HmiJvmOptions4340 %460 %35357979121211
HmiWorkplaceProxyResource4080 %500 %35358686101011
HmiWorkplaceConfiguration3580 %640 %383858586611
HmiAssetsResource3580 %600 %353537375511
HmiWorkplaceManifest3580 %460 %252565652211
HmiLegacyWidgetResource3540 %460 %323250507711
HmiInitialAdmin3490 %580 %373765658811
HmiWorkplaceJarCache3120 %260 %202058587711
HmiPersonnel2590 %440 %292954547711
HmiSystemSettingsResource2030 %240 %181839396611
HmiWorkplaceByteRange1870 %280 %181829294411
HmiWorkplaceSettingsResource1810 %220 %171727276611
HmiBootstrapResource1570 %140 %111123234411
HmiImsapiActionResource1530 %200 %131322223311
HmiStyles1360 %280 %181821214411
HmiSchemaRecoveryResource1340 %160 %111117173311
HmiSchemaRecovery920 %140 %131322226611
HmiTransportPolicy880 %160 %131318185511
HmiHealthServlet700 %n/a2221212211
HmiJvmOptions.new Callable() {...}440 %0 %44882211
HmiThemeServlet430 %0 %4411112211
HmiOriginFilter0 %0 %5512124411
HmiPersonnel.Person0 %0 %33771111
HmiDb0 %0 %66665511
\ No newline at end of file diff --git a/backend/target/site/jacoco/com.workbenchclassic.hmi/index.source.html b/backend/target/site/jacoco/com.workbenchclassic.hmi/index.source.html index b8d34cf..acaf475 100644 --- a/backend/target/site/jacoco/com.workbenchclassic.hmi/index.source.html +++ b/backend/target/site/jacoco/com.workbenchclassic.hmi/index.source.html @@ -1 +1 @@ -com.workbenchclassic.hmi

com.workbenchclassic.hmi

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total14.447 of 14.4470 %1.845 of 1.8450 %1.2191.2192.0502.0502932933232
HmiApiResource.java4.6530 %5990 %368368561561676711
HmiWidgetRevisionResource.java1.2810 %1560 %102102129129242411
HmiRolesResource.java9530 %860 %6565111111222211
HmiSchemaBootstrap.java7540 %800 %5858158158181811
HmiStyleResource.java6540 %560 %45455151171711
HmiImsapiGateway.java5280 %960 %535368685511
HmiAuth.java4850 %1000 %67677676171711
HmiImsapiSecurityResource.java4430 %480 %303074746611
HmiJvmOptions.java4160 %360 %28287676101022
HmiWorkplaceProxyResource.java4080 %500 %35358686101011
HmiAssetsResource.java3580 %600 %353537375511
HmiWorkplaceManifest.java3580 %460 %252565652211
HmiWorkplaceConfiguration.java3580 %640 %383858586611
HmiLegacyWidgetResource.java3540 %460 %323250507711
HmiInitialAdmin.java3490 %580 %373765658811
HmiWorkplaceJarCache.java3120 %260 %202058587711
HmiPersonnel.java2890 %480 %323261618822
HmiSystemSettingsResource.java1970 %240 %181837376611
HmiWorkplaceByteRange.java1870 %280 %181829294411
HmiWorkplaceSettingsResource.java1810 %220 %171727276611
HmiBootstrapResource.java1570 %140 %111123234411
HmiImsapiActionResource.java1530 %200 %131322223311
HmiStyles.java1360 %280 %181821214411
HmiSchemaRecoveryResource.java1340 %160 %111117173311
HmiSchemaRecovery.java920 %140 %131322226611
HmiTransportPolicy.java880 %160 %131318185511
HmiHealthServlet.java700 %n/a2221212211
HmiThemeServlet.java430 %0 %4411112211
HmiOriginFilter.java0 %0 %5512124411
HmiDb.java0 %0 %66665511
\ No newline at end of file +com.workbenchclassic.hmi

com.workbenchclassic.hmi

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total14.515 of 14.5150 %1.859 of 1.8590 %1.2301.2302.0622.0622972973232
HmiApiResource.java4.6530 %5990 %368368561561676711
HmiWidgetRevisionResource.java1.2810 %1560 %102102129129242411
HmiRolesResource.java9530 %860 %6565111111222211
HmiSchemaBootstrap.java7540 %800 %5858158158181811
HmiStyleResource.java6540 %560 %45455151171711
HmiImsapiGateway.java5280 %960 %535368685511
HmiAuth.java4850 %1000 %67677676171711
HmiJvmOptions.java4780 %500 %39398686141422
HmiImsapiSecurityResource.java4430 %480 %303074746611
HmiWorkplaceProxyResource.java4080 %500 %35358686101011
HmiAssetsResource.java3580 %600 %353537375511
HmiWorkplaceManifest.java3580 %460 %252565652211
HmiWorkplaceConfiguration.java3580 %640 %383858586611
HmiLegacyWidgetResource.java3540 %460 %323250507711
HmiInitialAdmin.java3490 %580 %373765658811
HmiWorkplaceJarCache.java3120 %260 %202058587711
HmiPersonnel.java2890 %480 %323261618822
HmiSystemSettingsResource.java2030 %240 %181839396611
HmiWorkplaceByteRange.java1870 %280 %181829294411
HmiWorkplaceSettingsResource.java1810 %220 %171727276611
HmiBootstrapResource.java1570 %140 %111123234411
HmiImsapiActionResource.java1530 %200 %131322223311
HmiStyles.java1360 %280 %181821214411
HmiSchemaRecoveryResource.java1340 %160 %111117173311
HmiSchemaRecovery.java920 %140 %131322226611
HmiTransportPolicy.java880 %160 %131318185511
HmiHealthServlet.java700 %n/a2221212211
HmiThemeServlet.java430 %0 %4411112211
HmiOriginFilter.java0 %0 %5512124411
HmiDb.java0 %0 %66665511
\ No newline at end of file diff --git a/backend/target/site/jacoco/index.html b/backend/target/site/jacoco/index.html index 0099df5..70a6b23 100644 --- a/backend/target/site/jacoco/index.html +++ b/backend/target/site/jacoco/index.html @@ -1 +1 @@ -backend

backend

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total19.588 of 19.5880 %2.069 of 2.0690 %1.4461.4463.2513.2514084085959
com.workbenchclassic.hmi14.4470 %1.8450 %1.2191.2192.0502.0502932933232
com.workbenchclassic5.1410 %2240 %2272271.2011.2011151152727
\ No newline at end of file +backend

backend

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total19.656 of 19.6560 %2.083 of 2.0830 %1.4571.4573.2633.2634124125959
com.workbenchclassic.hmi14.5150 %1.8590 %1.2301.2302.0622.0622972973232
com.workbenchclassic5.1410 %2240 %2272271.2011.2011151152727
\ No newline at end of file diff --git a/backend/target/site/jacoco/jacoco-sessions.html b/backend/target/site/jacoco/jacoco-sessions.html index 32a243f..822b010 100644 --- a/backend/target/site/jacoco/jacoco-sessions.html +++ b/backend/target/site/jacoco/jacoco-sessions.html @@ -1 +1 @@ -Sessions

Sessions

This coverage report is based on execution data from the following sessions:

SessionStart TimeDump Time
kubernetes-56cd89ce01.11.2026, 10:08:5801.11.2026, 10:08:58

Execution data for the following classes is considered in this report:

ClassId
com.workbenchclassic.AppTest7718c7447416258a
org.apache.maven.surefire.api.booter.BaseProviderFactory5bdb25554fb3d5df
org.apache.maven.surefire.api.booter.BiProperty9a2074ae999b3c8a
org.apache.maven.surefire.api.booter.Commandf31ca5085797c808
org.apache.maven.surefire.api.booter.DumpErrorSingletone3f1c75f159a9ac5
org.apache.maven.surefire.api.booter.ForkedProcessEventTypedc56c5dba14b9d58
org.apache.maven.surefire.api.booter.ForkingReporterFactorybcadcd63978e8dcf
org.apache.maven.surefire.api.booter.ForkingRunListener08c963875a23e517
org.apache.maven.surefire.api.booter.MasterProcessCommand90562129b4defd58
org.apache.maven.surefire.api.booter.Shutdownfab38023c4f1ded4
org.apache.maven.surefire.api.cli.CommandLineOption4401c2efb3702254
org.apache.maven.surefire.api.provider.AbstractProvidercf68f167cf236f7b
org.apache.maven.surefire.api.report.ConsoleOutputCaptureb8719a08fbb63e05
org.apache.maven.surefire.api.report.ConsoleOutputCapture.ForwardingPrintStream7c2392ea44674f2d
org.apache.maven.surefire.api.report.ConsoleOutputCapture.NullOutputStreamf7132188596462e2
org.apache.maven.surefire.api.report.ReporterConfiguration39591ad2c5816a79
org.apache.maven.surefire.api.report.RunModef02e60476bce4d8d
org.apache.maven.surefire.api.report.SimpleReportEntrye252cb5986c391cc
org.apache.maven.surefire.api.suite.RunResult8d97f6894fd90ced
org.apache.maven.surefire.api.testset.DirectoryScannerParametersc53ea59aeaf0b80a
org.apache.maven.surefire.api.testset.IncludedExcludedPatterns43b8f8de9b3a1945
org.apache.maven.surefire.api.testset.ResolvedTest7e73a65f1017294e
org.apache.maven.surefire.api.testset.ResolvedTest.ClassMatcher0f9c29dc1562afeb
org.apache.maven.surefire.api.testset.ResolvedTest.MethodMatcherfccae89ce7b4ee31
org.apache.maven.surefire.api.testset.ResolvedTest.Typebf93fc9765a2bd72
org.apache.maven.surefire.api.testset.RunOrderParameterscb70af248c260139
org.apache.maven.surefire.api.testset.TestArtifactInfoc68e923f629df613
org.apache.maven.surefire.api.testset.TestListResolver3dc896f10c8df96c
org.apache.maven.surefire.api.testset.TestRequest976405c051909d71
org.apache.maven.surefire.api.util.CloseableIteratorf2c0acf940ec6fbe
org.apache.maven.surefire.api.util.DefaultRunOrderCalculator1f50ae9e4b9717cd
org.apache.maven.surefire.api.util.DefaultScanResult46fdc84739146387
org.apache.maven.surefire.api.util.ReflectionUtils6079e135f863f220
org.apache.maven.surefire.api.util.RunOrder0ea36dbbf05327aa
org.apache.maven.surefire.api.util.TestsToRuncc3376426ef9c01c
org.apache.maven.surefire.api.util.TestsToRun.ClassesIteratorcd6601db7bc899db
org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleReadableChannel6abb59e4c94390af
org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleWritableChannel989f9bf3c66ab7be
org.apache.maven.surefire.api.util.internal.Channels95e459b596e3b873
org.apache.maven.surefire.api.util.internal.Channels.39770f03bd51e14f7
org.apache.maven.surefire.api.util.internal.Channels.4a0e3eaa91d355cc2
org.apache.maven.surefire.api.util.internal.DaemonThreadFactorya56bf84543725f3a
org.apache.maven.surefire.api.util.internal.DaemonThreadFactory.NamedThreadFactorycfeefeb0265a8a13
org.apache.maven.surefire.api.util.internal.DumpFileUtils9a7dbfdf3c2027c8
org.apache.maven.surefire.api.util.internal.ImmutableMapee11b540cdd4034e
org.apache.maven.surefire.api.util.internal.ImmutableMap.Node984f6258c6d6ac9c
org.apache.maven.surefire.api.util.internal.ObjectUtils8c788ffcde97fbb4
org.apache.maven.surefire.booter.AbstractPathConfiguration4839ca4be6e46906
org.apache.maven.surefire.booter.BooterDeserializer02dc12ed0aec9547
org.apache.maven.surefire.booter.ClassLoaderConfiguration462fdbd63f8ea8c8
org.apache.maven.surefire.booter.Classpath5c18bd381e88bcc8
org.apache.maven.surefire.booter.ClasspathConfiguration4c9fc97c565be4cc
org.apache.maven.surefire.booter.CommandReaderc29c2eca0cd24bfc
org.apache.maven.surefire.booter.CommandReader.1727226d97ed192cb
org.apache.maven.surefire.booter.CommandReader.CommandRunnable41ac58e8d85ca2bd
org.apache.maven.surefire.booter.ForkedBooter708bf5b29b088537
org.apache.maven.surefire.booter.ForkedBooter.17d062229af4458f7
org.apache.maven.surefire.booter.ForkedBooter.3093e1d6ec83caf1c
org.apache.maven.surefire.booter.ForkedBooter.488f2f3e42230f38d
org.apache.maven.surefire.booter.ForkedBooter.6a150022bee6cbd41
org.apache.maven.surefire.booter.ForkedBooter.77d0ab78a1157bb24
org.apache.maven.surefire.booter.ForkedBooter.801800b3929973273
org.apache.maven.surefire.booter.ForkedBooter.PingSchedulerfb97687ca93ecbd1
org.apache.maven.surefire.booter.PpidCheckercc99aab0e566c991
org.apache.maven.surefire.booter.ProcessCheckerType5e6688e4a6a909e6
org.apache.maven.surefire.booter.PropertiesWrapperf63d2b2f2fd9087a
org.apache.maven.surefire.booter.ProviderConfiguration146800cea9c5f6cc
org.apache.maven.surefire.booter.StartupConfiguration1cb50557cb9ebb0b
org.apache.maven.surefire.booter.SystemPropertyManager3a0459e270104889
org.apache.maven.surefire.booter.TypeEncodedValue25e613e357b4f737
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelDecoder477264b3887a3b8b
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelDecoder.FrameCompletion00319e897e4dfd77
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelEncoderd52ce258d8e88d04
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelProcessorFactory3e8e80dcadf11ad6
org.apache.maven.surefire.booter.spi.SurefireMasterProcessChannelProcessorFactory6bb9533ad5c08a49
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider847b42ef97f97d2b
org.apache.maven.surefire.junitplatform.RunListenerAdapterd23fd29ada1102cb
org.apache.maven.surefire.junitplatform.RunListenerAdapter.155724259eef83afa
org.apache.maven.surefire.junitplatform.TestPlanScannerFiltera3ae2542fd30e874
org.apache.maven.surefire.shared.codec.binary.Base64cd6927ec7cf0569e
org.apache.maven.surefire.shared.codec.binary.BaseNCodecc8dd8163b58acfc1
org.apache.maven.surefire.shared.codec.binary.BaseNCodec.Context84b370e464e7008c
org.apache.maven.surefire.shared.lang3.JavaVersion590095a767529b48
org.apache.maven.surefire.shared.lang3.StringUtilsae3c2c379ffab6fd
org.apache.maven.surefire.shared.lang3.SystemUtilse4faf882077bc6c0
org.apache.maven.surefire.shared.lang3.math.NumberUtils505629194db735ed
org.apache.maven.surefire.shared.utils.StringUtils5ba1288622b5e22e
org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtilsb7b46c5c1f482bd4
org.apiguardian.api.API.Status0341e8d99fc36573
org.junit.jupiter.api.AssertEquals6b16b14f06d2f13c
org.junit.jupiter.api.Assertions7406fdbebf83bc7a
org.junit.jupiter.api.DisplayNameGeneratorc813afbd86fd7cc8
org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores82e8bc7daaa8e1e0
org.junit.jupiter.api.DisplayNameGenerator.Standardf23772be1d9bb824
org.junit.jupiter.api.TestInstance.Lifecycle548dd47a98f9c8af
org.junit.jupiter.api.extension.ConditionEvaluationResult2f9dc9ea54b57975
org.junit.jupiter.api.extension.ExtensionContext1789eac1274261fc
org.junit.jupiter.api.extension.ExtensionContext.Namespace9ecb19f5d8d233f2
org.junit.jupiter.api.extension.InvocationInterceptor996f7741ba5ec355
org.junit.jupiter.engine.JupiterTestEngine42bfd69ac4ff9a31
org.junit.jupiter.engine.config.CachingJupiterConfiguratione0782b8c7a730030
org.junit.jupiter.engine.config.ClassNamePatternParameterConverterdb88e74320096433
org.junit.jupiter.engine.config.DefaultJupiterConfiguration9edf3c93edb9be05
org.junit.jupiter.engine.config.DisplayNameGeneratorParameterConverter10239f24d8c710ad
org.junit.jupiter.engine.config.EnumConfigurationParameterConverter339f5752af685066
org.junit.jupiter.engine.descriptor.AbstractExtensionContext9bf01323cf853683
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor93da3ced5777b865
org.junit.jupiter.engine.descriptor.ClassExtensionContextda8d011f2fd97107
org.junit.jupiter.engine.descriptor.ClassTestDescriptorf5d10ac1d89bb01f
org.junit.jupiter.engine.descriptor.DisplayNameUtils5b062d6beb8f55b6
org.junit.jupiter.engine.descriptor.ExtensionUtils857bd7cde465ada0
org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor8502a8ddd495080f
org.junit.jupiter.engine.descriptor.JupiterEngineExtensionContext37e3ac8bbe8deb47
org.junit.jupiter.engine.descriptor.JupiterTestDescriptoracf2905fc10efa75
org.junit.jupiter.engine.descriptor.LifecycleMethodUtils1162b59df6db6b33
org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor120c02c460cd1892
org.junit.jupiter.engine.descriptor.MethodExtensionContextafe114c2ffc920b7
org.junit.jupiter.engine.descriptor.TestInstanceLifecycleUtils8d8758db35676c1c
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptorb9a613d54c81997c
org.junit.jupiter.engine.discovery.ClassSelectorResolvera62bf2e2a3da3cb2
org.junit.jupiter.engine.discovery.DiscoverySelectorResolver9913614fbfb4142b
org.junit.jupiter.engine.discovery.MethodFinder5ea468d2eb528361
org.junit.jupiter.engine.discovery.MethodOrderingVisitorbd9a3fc474bdccea
org.junit.jupiter.engine.discovery.MethodSelectorResolver9e004b1ce9842826
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType76d091417c997edb
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType.1098756f55a3f159b
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType.2b4451da4ca26c94f
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType.3a9cba48e54e36d6b
org.junit.jupiter.engine.discovery.predicates.IsInnerClassf7d9846d00228720
org.junit.jupiter.engine.discovery.predicates.IsNestedTestClasse47ff7cd33073803
org.junit.jupiter.engine.discovery.predicates.IsPotentialTestContainerfcb5565ad4483f6c
org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests2a6af63531e197a1
org.junit.jupiter.engine.discovery.predicates.IsTestFactoryMethoda2c68978bd6bfbc6
org.junit.jupiter.engine.discovery.predicates.IsTestMethod8b244977e441886e
org.junit.jupiter.engine.discovery.predicates.IsTestTemplateMethod0baf1066bf0cbad7
org.junit.jupiter.engine.discovery.predicates.IsTestableMethod59a0b58a40803fe2
org.junit.jupiter.engine.execution.ConditionEvaluatorc2ba33ab802578df
org.junit.jupiter.engine.execution.ConstructorInvocation4aef47e7c0afe594
org.junit.jupiter.engine.execution.DefaultTestInstances37fd85d961d60c98
org.junit.jupiter.engine.execution.ExecutableInvoker88626e54fda7c10e
org.junit.jupiter.engine.execution.ExecutableInvoker.ReflectiveInterceptorCall1e58a02ac712330c
org.junit.jupiter.engine.execution.ExtensionValuesStoreb7ff2e73f692c652
org.junit.jupiter.engine.execution.ExtensionValuesStore.CompositeKey24fed135af0eff32
org.junit.jupiter.engine.execution.ExtensionValuesStore.MemoizingSupplier5be22cd9e3599327
org.junit.jupiter.engine.execution.InvocationInterceptorChain008224a337018874
org.junit.jupiter.engine.execution.InvocationInterceptorChain.InterceptedInvocation62ff9a2338ce3045
org.junit.jupiter.engine.execution.InvocationInterceptorChain.ValidatingInvocation2434903e45fcd05c
org.junit.jupiter.engine.execution.JupiterEngineExecutionContext868921f800563654
org.junit.jupiter.engine.execution.JupiterEngineExecutionContext.Builderd23096bee4e10887
org.junit.jupiter.engine.execution.JupiterEngineExecutionContext.State0a606b935b0623c0
org.junit.jupiter.engine.execution.MethodInvocation6f894f3cd37e86c5
org.junit.jupiter.engine.execution.NamespaceAwareStore3ffe1c39d58eaf53
org.junit.jupiter.engine.execution.TestInstancesProviderbb5b676e93849b60
org.junit.jupiter.engine.extension.DisabledCondition23223b45668b6ef2
org.junit.jupiter.engine.extension.ExtensionRegistry7f89cc3238c43287
org.junit.jupiter.engine.extension.MutableExtensionRegistry094514ca9919cd68
org.junit.jupiter.engine.extension.RepeatedTestExtension1b7914cc8cf83732
org.junit.jupiter.engine.extension.TempDirectory3ed1c1e958835b3c
org.junit.jupiter.engine.extension.TestInfoParameterResolver1b5b370a56807cae
org.junit.jupiter.engine.extension.TestReporterParameterResolver60beaf7c80fe99cc
org.junit.jupiter.engine.extension.TimeoutConfigurationd1c949ce4363e069
org.junit.jupiter.engine.extension.TimeoutDurationParser47f3e400722ef57b
org.junit.jupiter.engine.extension.TimeoutExtensionf396c89f10d2bf92
org.junit.jupiter.engine.support.JupiterThrowableCollectorFactorybe8bb2befc643502
org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollectorea5378eacfd98d84
org.junit.platform.commons.function.Tryed940444537e81c8
org.junit.platform.commons.function.Try.Failure11c2a90efd237384
org.junit.platform.commons.function.Try.Successc4950437cb3f8d07
org.junit.platform.commons.logging.LoggerFactory3ba683e3050bf0cd
org.junit.platform.commons.logging.LoggerFactory.DelegatingLoggerc601ec41368ffb23
org.junit.platform.commons.support.AnnotationSupport9943d504ff0c08cc
org.junit.platform.commons.support.ReflectionSupport534b5bde0100740f
org.junit.platform.commons.util.AnnotationUtilsf61f84cc85e2534a
org.junit.platform.commons.util.BlacklistedExceptionsbde618675b598c40
org.junit.platform.commons.util.ClassLoaderUtilsc4b37ecc9a1c73f1
org.junit.platform.commons.util.ClassUtils8883e6fc8a933271
org.junit.platform.commons.util.ClasspathScannerac8b6266e9b6789d
org.junit.platform.commons.util.CollectionUtilsa5cea6ca5e67470d
org.junit.platform.commons.util.Preconditions96db76b91278a526
org.junit.platform.commons.util.ReflectionUtils9fe1fac13e880dd6
org.junit.platform.commons.util.ReflectionUtils.HierarchyTraversalMode12b3937debd6b2c1
org.junit.platform.commons.util.StringUtilsae2f08e02cb55734
org.junit.platform.engine.CompositeFilterec8dc82249eeb7a9
org.junit.platform.engine.CompositeFilter.170825b5141694d2a
org.junit.platform.engine.EngineDiscoveryListener22998ffae2c92a7c
org.junit.platform.engine.EngineDiscoveryListener.1df3f3b5f98f0bac1
org.junit.platform.engine.ExecutionRequested3835cc21e5a048
org.junit.platform.engine.Filterf932423ccd3b54bf
org.junit.platform.engine.FilterResultcdaa92f4f6f79059
org.junit.platform.engine.SelectorResolutionResult84379bf9c19eb4b1
org.junit.platform.engine.SelectorResolutionResult.Status7127e7bcdd8dd16b
org.junit.platform.engine.TestDescriptor9fce516d5ec67d95
org.junit.platform.engine.TestDescriptor.Type3d400391a113f4d2
org.junit.platform.engine.TestExecutionResultfd67f84654a5aa1c
org.junit.platform.engine.TestExecutionResult.Status26685ff07ec05579
org.junit.platform.engine.UniqueIde031943c734b350e
org.junit.platform.engine.UniqueId.Segmente194895cf704d270
org.junit.platform.engine.UniqueIdFormatd5b6ae13b16471ae
org.junit.platform.engine.discovery.ClassSelector502567f08c42b0d4
org.junit.platform.engine.discovery.DiscoverySelectors82f61a948dbe4f5a
org.junit.platform.engine.discovery.MethodSelectora07d3186374af8d5
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor2bfbf25c43491443
org.junit.platform.engine.support.descriptor.ClassSourceebe18bb735086cbe
org.junit.platform.engine.support.descriptor.EngineDescriptorb7dbf6dfb794516c
org.junit.platform.engine.support.descriptor.MethodSourceadbe9ff8c196551c
org.junit.platform.engine.support.discovery.ClassContainerSelectorResolver13e03d83db463757
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolutionf23cc843ffd69e68
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.DefaultContext1062edde7e863f79
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver96067c54823596a5
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.Builder4536a37bf6e65b70
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.DefaultInitializationContextf1925780e6c4e71e
org.junit.platform.engine.support.discovery.SelectorResolver80cba972b4f10568
org.junit.platform.engine.support.discovery.SelectorResolver.Matcha6c967fba828723c
org.junit.platform.engine.support.discovery.SelectorResolver.Match.Typeb37cc687ae9a3084
org.junit.platform.engine.support.discovery.SelectorResolver.Resolution6a587b13ca925431
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine97ffbc145c7d4a83
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor68a36544a3925ed3
org.junit.platform.engine.support.hierarchical.LockManager3b5f78863ff21738
org.junit.platform.engine.support.hierarchical.Nodeb49761977ceb7101
org.junit.platform.engine.support.hierarchical.Node.SkipResultbd08edf24f1dd4d9
org.junit.platform.engine.support.hierarchical.NodeExecutionAdvisore5cf54a3abfe8a32
org.junit.platform.engine.support.hierarchical.NodeTestTask2d78f1925dd4882a
org.junit.platform.engine.support.hierarchical.NodeTestTask.DefaultDynamicTestExecutorfdbc89e07549b13b
org.junit.platform.engine.support.hierarchical.NodeTestTaskContext844fff78e0efe7ef
org.junit.platform.engine.support.hierarchical.NodeTreeWalkerb0b50dbbc8c467a5
org.junit.platform.engine.support.hierarchical.NodeUtilsd602362461bcf308
org.junit.platform.engine.support.hierarchical.NodeUtils.1f707e15bc93748e1
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService054c281153908bb9
org.junit.platform.engine.support.hierarchical.ThrowableCollector655e27ddc85aeb2a
org.junit.platform.launcher.EngineDiscoveryResult8a104796dc402ce9
org.junit.platform.launcher.EngineDiscoveryResult.Statusb30c4012c3e2f07e
org.junit.platform.launcher.LauncherDiscoveryListener456d3e735c22aa48
org.junit.platform.launcher.LauncherDiscoveryListener.1a120e75b9fe22bf4
org.junit.platform.launcher.TestIdentifier225bb434f8f223e2
org.junit.platform.launcher.TestPlan60578bb4f50b5157
org.junit.platform.launcher.core.DefaultDiscoveryRequestc69d8a6244047852
org.junit.platform.launcher.core.DefaultLauncherb535c0b0b3751eb8
org.junit.platform.launcher.core.DefaultLauncherConfiga355b55f1fea9e21
org.junit.platform.launcher.core.DelegatingEngineExecutionListener1e5487ee783deeca
org.junit.platform.launcher.core.EngineDiscoveryResultValidator93df7a3977833cf5
org.junit.platform.launcher.core.ExecutionListenerAdapterc5de7169f1a88932
org.junit.platform.launcher.core.InternalTestPlan4bd2d207c99632bd
org.junit.platform.launcher.core.LauncherConfigb3c713ac595fde03
org.junit.platform.launcher.core.LauncherConfig.Buildera17564c5b87448a3
org.junit.platform.launcher.core.LauncherConfigurationParameters461c933a6a874583
org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder718cd866fd0e3b49
org.junit.platform.launcher.core.LauncherFactoryd419bbcae8fd872b
org.junit.platform.launcher.core.OutcomeDelayingEngineExecutionListener72e79df7e2d97cc9
org.junit.platform.launcher.core.OutcomeDelayingEngineExecutionListener.Outcome4d8244bde278efbb
org.junit.platform.launcher.core.Root77042aab5235c2d8
org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry7c054c4cf76cb0f6
org.junit.platform.launcher.core.ServiceLoaderTestExecutionListenerRegistry2299bac1075a6bf3
org.junit.platform.launcher.core.StreamInterceptingTestExecutionListener3a1f3bd6b32f854b
org.junit.platform.launcher.core.TestExecutionListenerRegistryf61866dbd0e36091
org.junit.platform.launcher.core.TestExecutionListenerRegistry.CompositeTestExecutionListener583008686628ab79
org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener267176035c858efc
org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListenersc83fb9349eaee2dc
\ No newline at end of file +Sessions

Sessions

This coverage report is based on execution data from the following sessions:

SessionStart TimeDump Time
kubernetes-88b2dab008.11.2026, 17:44:2608.11.2026, 17:44:26

Execution data for the following classes is considered in this report:

ClassId
com.workbenchclassic.AppTest7718c7447416258a
org.apache.maven.surefire.api.booter.BaseProviderFactory5bdb25554fb3d5df
org.apache.maven.surefire.api.booter.BiProperty9a2074ae999b3c8a
org.apache.maven.surefire.api.booter.Commandf31ca5085797c808
org.apache.maven.surefire.api.booter.DumpErrorSingletone3f1c75f159a9ac5
org.apache.maven.surefire.api.booter.ForkedProcessEventTypedc56c5dba14b9d58
org.apache.maven.surefire.api.booter.ForkingReporterFactorybcadcd63978e8dcf
org.apache.maven.surefire.api.booter.ForkingRunListener08c963875a23e517
org.apache.maven.surefire.api.booter.MasterProcessCommand90562129b4defd58
org.apache.maven.surefire.api.booter.Shutdownfab38023c4f1ded4
org.apache.maven.surefire.api.cli.CommandLineOption4401c2efb3702254
org.apache.maven.surefire.api.provider.AbstractProvidercf68f167cf236f7b
org.apache.maven.surefire.api.report.ConsoleOutputCaptureb8719a08fbb63e05
org.apache.maven.surefire.api.report.ConsoleOutputCapture.ForwardingPrintStream7c2392ea44674f2d
org.apache.maven.surefire.api.report.ConsoleOutputCapture.NullOutputStreamf7132188596462e2
org.apache.maven.surefire.api.report.ReporterConfiguration39591ad2c5816a79
org.apache.maven.surefire.api.report.RunModef02e60476bce4d8d
org.apache.maven.surefire.api.report.SimpleReportEntrye252cb5986c391cc
org.apache.maven.surefire.api.suite.RunResult8d97f6894fd90ced
org.apache.maven.surefire.api.testset.DirectoryScannerParametersc53ea59aeaf0b80a
org.apache.maven.surefire.api.testset.IncludedExcludedPatterns43b8f8de9b3a1945
org.apache.maven.surefire.api.testset.ResolvedTest7e73a65f1017294e
org.apache.maven.surefire.api.testset.ResolvedTest.ClassMatcher0f9c29dc1562afeb
org.apache.maven.surefire.api.testset.ResolvedTest.MethodMatcherfccae89ce7b4ee31
org.apache.maven.surefire.api.testset.ResolvedTest.Typebf93fc9765a2bd72
org.apache.maven.surefire.api.testset.RunOrderParameterscb70af248c260139
org.apache.maven.surefire.api.testset.TestArtifactInfoc68e923f629df613
org.apache.maven.surefire.api.testset.TestListResolver3dc896f10c8df96c
org.apache.maven.surefire.api.testset.TestRequest976405c051909d71
org.apache.maven.surefire.api.util.CloseableIteratorf2c0acf940ec6fbe
org.apache.maven.surefire.api.util.DefaultRunOrderCalculator1f50ae9e4b9717cd
org.apache.maven.surefire.api.util.DefaultScanResult46fdc84739146387
org.apache.maven.surefire.api.util.ReflectionUtils6079e135f863f220
org.apache.maven.surefire.api.util.RunOrder0ea36dbbf05327aa
org.apache.maven.surefire.api.util.TestsToRuncc3376426ef9c01c
org.apache.maven.surefire.api.util.TestsToRun.ClassesIteratorcd6601db7bc899db
org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleReadableChannel6abb59e4c94390af
org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleWritableChannel989f9bf3c66ab7be
org.apache.maven.surefire.api.util.internal.Channels95e459b596e3b873
org.apache.maven.surefire.api.util.internal.Channels.39770f03bd51e14f7
org.apache.maven.surefire.api.util.internal.Channels.4a0e3eaa91d355cc2
org.apache.maven.surefire.api.util.internal.DaemonThreadFactorya56bf84543725f3a
org.apache.maven.surefire.api.util.internal.DaemonThreadFactory.NamedThreadFactorycfeefeb0265a8a13
org.apache.maven.surefire.api.util.internal.DumpFileUtils9a7dbfdf3c2027c8
org.apache.maven.surefire.api.util.internal.ImmutableMapee11b540cdd4034e
org.apache.maven.surefire.api.util.internal.ImmutableMap.Node984f6258c6d6ac9c
org.apache.maven.surefire.api.util.internal.ObjectUtils8c788ffcde97fbb4
org.apache.maven.surefire.booter.AbstractPathConfiguration4839ca4be6e46906
org.apache.maven.surefire.booter.BooterDeserializer02dc12ed0aec9547
org.apache.maven.surefire.booter.ClassLoaderConfiguration462fdbd63f8ea8c8
org.apache.maven.surefire.booter.Classpath5c18bd381e88bcc8
org.apache.maven.surefire.booter.ClasspathConfiguration4c9fc97c565be4cc
org.apache.maven.surefire.booter.CommandReaderc29c2eca0cd24bfc
org.apache.maven.surefire.booter.CommandReader.1727226d97ed192cb
org.apache.maven.surefire.booter.CommandReader.CommandRunnable41ac58e8d85ca2bd
org.apache.maven.surefire.booter.ForkedBooter708bf5b29b088537
org.apache.maven.surefire.booter.ForkedBooter.17d062229af4458f7
org.apache.maven.surefire.booter.ForkedBooter.3093e1d6ec83caf1c
org.apache.maven.surefire.booter.ForkedBooter.488f2f3e42230f38d
org.apache.maven.surefire.booter.ForkedBooter.6a150022bee6cbd41
org.apache.maven.surefire.booter.ForkedBooter.77d0ab78a1157bb24
org.apache.maven.surefire.booter.ForkedBooter.801800b3929973273
org.apache.maven.surefire.booter.ForkedBooter.PingSchedulerfb97687ca93ecbd1
org.apache.maven.surefire.booter.PpidCheckercc99aab0e566c991
org.apache.maven.surefire.booter.ProcessCheckerType5e6688e4a6a909e6
org.apache.maven.surefire.booter.PropertiesWrapperf63d2b2f2fd9087a
org.apache.maven.surefire.booter.ProviderConfiguration146800cea9c5f6cc
org.apache.maven.surefire.booter.StartupConfiguration1cb50557cb9ebb0b
org.apache.maven.surefire.booter.SystemPropertyManager3a0459e270104889
org.apache.maven.surefire.booter.TypeEncodedValue25e613e357b4f737
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelDecoder477264b3887a3b8b
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelDecoder.FrameCompletion00319e897e4dfd77
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelEncoderd52ce258d8e88d04
org.apache.maven.surefire.booter.spi.LegacyMasterProcessChannelProcessorFactory3e8e80dcadf11ad6
org.apache.maven.surefire.booter.spi.SurefireMasterProcessChannelProcessorFactory6bb9533ad5c08a49
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider847b42ef97f97d2b
org.apache.maven.surefire.junitplatform.RunListenerAdapterd23fd29ada1102cb
org.apache.maven.surefire.junitplatform.RunListenerAdapter.155724259eef83afa
org.apache.maven.surefire.junitplatform.TestPlanScannerFiltera3ae2542fd30e874
org.apache.maven.surefire.shared.codec.binary.Base64cd6927ec7cf0569e
org.apache.maven.surefire.shared.codec.binary.BaseNCodecc8dd8163b58acfc1
org.apache.maven.surefire.shared.codec.binary.BaseNCodec.Context84b370e464e7008c
org.apache.maven.surefire.shared.lang3.JavaVersion590095a767529b48
org.apache.maven.surefire.shared.lang3.StringUtilsae3c2c379ffab6fd
org.apache.maven.surefire.shared.lang3.SystemUtilse4faf882077bc6c0
org.apache.maven.surefire.shared.lang3.math.NumberUtils505629194db735ed
org.apache.maven.surefire.shared.utils.StringUtils5ba1288622b5e22e
org.apache.maven.surefire.shared.utils.cli.ShutdownHookUtilsb7b46c5c1f482bd4
org.apiguardian.api.API.Status0341e8d99fc36573
org.junit.jupiter.api.AssertEquals6b16b14f06d2f13c
org.junit.jupiter.api.Assertions7406fdbebf83bc7a
org.junit.jupiter.api.DisplayNameGeneratorc813afbd86fd7cc8
org.junit.jupiter.api.DisplayNameGenerator.ReplaceUnderscores82e8bc7daaa8e1e0
org.junit.jupiter.api.DisplayNameGenerator.Standardf23772be1d9bb824
org.junit.jupiter.api.TestInstance.Lifecycle548dd47a98f9c8af
org.junit.jupiter.api.extension.ConditionEvaluationResult2f9dc9ea54b57975
org.junit.jupiter.api.extension.ExtensionContext1789eac1274261fc
org.junit.jupiter.api.extension.ExtensionContext.Namespace9ecb19f5d8d233f2
org.junit.jupiter.api.extension.InvocationInterceptor996f7741ba5ec355
org.junit.jupiter.engine.JupiterTestEngine42bfd69ac4ff9a31
org.junit.jupiter.engine.config.CachingJupiterConfiguratione0782b8c7a730030
org.junit.jupiter.engine.config.ClassNamePatternParameterConverterdb88e74320096433
org.junit.jupiter.engine.config.DefaultJupiterConfiguration9edf3c93edb9be05
org.junit.jupiter.engine.config.DisplayNameGeneratorParameterConverter10239f24d8c710ad
org.junit.jupiter.engine.config.EnumConfigurationParameterConverter339f5752af685066
org.junit.jupiter.engine.descriptor.AbstractExtensionContext9bf01323cf853683
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor93da3ced5777b865
org.junit.jupiter.engine.descriptor.ClassExtensionContextda8d011f2fd97107
org.junit.jupiter.engine.descriptor.ClassTestDescriptorf5d10ac1d89bb01f
org.junit.jupiter.engine.descriptor.DisplayNameUtils5b062d6beb8f55b6
org.junit.jupiter.engine.descriptor.ExtensionUtils857bd7cde465ada0
org.junit.jupiter.engine.descriptor.JupiterEngineDescriptor8502a8ddd495080f
org.junit.jupiter.engine.descriptor.JupiterEngineExtensionContext37e3ac8bbe8deb47
org.junit.jupiter.engine.descriptor.JupiterTestDescriptoracf2905fc10efa75
org.junit.jupiter.engine.descriptor.LifecycleMethodUtils1162b59df6db6b33
org.junit.jupiter.engine.descriptor.MethodBasedTestDescriptor120c02c460cd1892
org.junit.jupiter.engine.descriptor.MethodExtensionContextafe114c2ffc920b7
org.junit.jupiter.engine.descriptor.TestInstanceLifecycleUtils8d8758db35676c1c
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptorb9a613d54c81997c
org.junit.jupiter.engine.discovery.ClassSelectorResolvera62bf2e2a3da3cb2
org.junit.jupiter.engine.discovery.DiscoverySelectorResolver9913614fbfb4142b
org.junit.jupiter.engine.discovery.MethodFinder5ea468d2eb528361
org.junit.jupiter.engine.discovery.MethodOrderingVisitorbd9a3fc474bdccea
org.junit.jupiter.engine.discovery.MethodSelectorResolver9e004b1ce9842826
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType76d091417c997edb
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType.1098756f55a3f159b
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType.2b4451da4ca26c94f
org.junit.jupiter.engine.discovery.MethodSelectorResolver.MethodType.3a9cba48e54e36d6b
org.junit.jupiter.engine.discovery.predicates.IsInnerClassf7d9846d00228720
org.junit.jupiter.engine.discovery.predicates.IsNestedTestClasse47ff7cd33073803
org.junit.jupiter.engine.discovery.predicates.IsPotentialTestContainerfcb5565ad4483f6c
org.junit.jupiter.engine.discovery.predicates.IsTestClassWithTests2a6af63531e197a1
org.junit.jupiter.engine.discovery.predicates.IsTestFactoryMethoda2c68978bd6bfbc6
org.junit.jupiter.engine.discovery.predicates.IsTestMethod8b244977e441886e
org.junit.jupiter.engine.discovery.predicates.IsTestTemplateMethod0baf1066bf0cbad7
org.junit.jupiter.engine.discovery.predicates.IsTestableMethod59a0b58a40803fe2
org.junit.jupiter.engine.execution.ConditionEvaluatorc2ba33ab802578df
org.junit.jupiter.engine.execution.ConstructorInvocation4aef47e7c0afe594
org.junit.jupiter.engine.execution.DefaultTestInstances37fd85d961d60c98
org.junit.jupiter.engine.execution.ExecutableInvoker88626e54fda7c10e
org.junit.jupiter.engine.execution.ExecutableInvoker.ReflectiveInterceptorCall1e58a02ac712330c
org.junit.jupiter.engine.execution.ExtensionValuesStoreb7ff2e73f692c652
org.junit.jupiter.engine.execution.ExtensionValuesStore.CompositeKey24fed135af0eff32
org.junit.jupiter.engine.execution.ExtensionValuesStore.MemoizingSupplier5be22cd9e3599327
org.junit.jupiter.engine.execution.InvocationInterceptorChain008224a337018874
org.junit.jupiter.engine.execution.InvocationInterceptorChain.InterceptedInvocation62ff9a2338ce3045
org.junit.jupiter.engine.execution.InvocationInterceptorChain.ValidatingInvocation2434903e45fcd05c
org.junit.jupiter.engine.execution.JupiterEngineExecutionContext868921f800563654
org.junit.jupiter.engine.execution.JupiterEngineExecutionContext.Builderd23096bee4e10887
org.junit.jupiter.engine.execution.JupiterEngineExecutionContext.State0a606b935b0623c0
org.junit.jupiter.engine.execution.MethodInvocation6f894f3cd37e86c5
org.junit.jupiter.engine.execution.NamespaceAwareStore3ffe1c39d58eaf53
org.junit.jupiter.engine.execution.TestInstancesProviderbb5b676e93849b60
org.junit.jupiter.engine.extension.DisabledCondition23223b45668b6ef2
org.junit.jupiter.engine.extension.ExtensionRegistry7f89cc3238c43287
org.junit.jupiter.engine.extension.MutableExtensionRegistry094514ca9919cd68
org.junit.jupiter.engine.extension.RepeatedTestExtension1b7914cc8cf83732
org.junit.jupiter.engine.extension.TempDirectory3ed1c1e958835b3c
org.junit.jupiter.engine.extension.TestInfoParameterResolver1b5b370a56807cae
org.junit.jupiter.engine.extension.TestReporterParameterResolver60beaf7c80fe99cc
org.junit.jupiter.engine.extension.TimeoutConfigurationd1c949ce4363e069
org.junit.jupiter.engine.extension.TimeoutDurationParser47f3e400722ef57b
org.junit.jupiter.engine.extension.TimeoutExtensionf396c89f10d2bf92
org.junit.jupiter.engine.support.JupiterThrowableCollectorFactorybe8bb2befc643502
org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollectorea5378eacfd98d84
org.junit.platform.commons.function.Tryed940444537e81c8
org.junit.platform.commons.function.Try.Failure11c2a90efd237384
org.junit.platform.commons.function.Try.Successc4950437cb3f8d07
org.junit.platform.commons.logging.LoggerFactory3ba683e3050bf0cd
org.junit.platform.commons.logging.LoggerFactory.DelegatingLoggerc601ec41368ffb23
org.junit.platform.commons.support.AnnotationSupport9943d504ff0c08cc
org.junit.platform.commons.support.ReflectionSupport534b5bde0100740f
org.junit.platform.commons.util.AnnotationUtilsf61f84cc85e2534a
org.junit.platform.commons.util.BlacklistedExceptionsbde618675b598c40
org.junit.platform.commons.util.ClassLoaderUtilsc4b37ecc9a1c73f1
org.junit.platform.commons.util.ClassUtils8883e6fc8a933271
org.junit.platform.commons.util.ClasspathScannerac8b6266e9b6789d
org.junit.platform.commons.util.CollectionUtilsa5cea6ca5e67470d
org.junit.platform.commons.util.Preconditions96db76b91278a526
org.junit.platform.commons.util.ReflectionUtils9fe1fac13e880dd6
org.junit.platform.commons.util.ReflectionUtils.HierarchyTraversalMode12b3937debd6b2c1
org.junit.platform.commons.util.StringUtilsae2f08e02cb55734
org.junit.platform.engine.CompositeFilterec8dc82249eeb7a9
org.junit.platform.engine.CompositeFilter.170825b5141694d2a
org.junit.platform.engine.EngineDiscoveryListener22998ffae2c92a7c
org.junit.platform.engine.EngineDiscoveryListener.1df3f3b5f98f0bac1
org.junit.platform.engine.ExecutionRequested3835cc21e5a048
org.junit.platform.engine.Filterf932423ccd3b54bf
org.junit.platform.engine.FilterResultcdaa92f4f6f79059
org.junit.platform.engine.SelectorResolutionResult84379bf9c19eb4b1
org.junit.platform.engine.SelectorResolutionResult.Status7127e7bcdd8dd16b
org.junit.platform.engine.TestDescriptor9fce516d5ec67d95
org.junit.platform.engine.TestDescriptor.Type3d400391a113f4d2
org.junit.platform.engine.TestExecutionResultfd67f84654a5aa1c
org.junit.platform.engine.TestExecutionResult.Status26685ff07ec05579
org.junit.platform.engine.UniqueIde031943c734b350e
org.junit.platform.engine.UniqueId.Segmente194895cf704d270
org.junit.platform.engine.UniqueIdFormatd5b6ae13b16471ae
org.junit.platform.engine.discovery.ClassSelector502567f08c42b0d4
org.junit.platform.engine.discovery.DiscoverySelectors82f61a948dbe4f5a
org.junit.platform.engine.discovery.MethodSelectora07d3186374af8d5
org.junit.platform.engine.support.descriptor.AbstractTestDescriptor2bfbf25c43491443
org.junit.platform.engine.support.descriptor.ClassSourceebe18bb735086cbe
org.junit.platform.engine.support.descriptor.EngineDescriptorb7dbf6dfb794516c
org.junit.platform.engine.support.descriptor.MethodSourceadbe9ff8c196551c
org.junit.platform.engine.support.discovery.ClassContainerSelectorResolver13e03d83db463757
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolutionf23cc843ffd69e68
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.DefaultContext1062edde7e863f79
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver96067c54823596a5
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.Builder4536a37bf6e65b70
org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.DefaultInitializationContextf1925780e6c4e71e
org.junit.platform.engine.support.discovery.SelectorResolver80cba972b4f10568
org.junit.platform.engine.support.discovery.SelectorResolver.Matcha6c967fba828723c
org.junit.platform.engine.support.discovery.SelectorResolver.Match.Typeb37cc687ae9a3084
org.junit.platform.engine.support.discovery.SelectorResolver.Resolution6a587b13ca925431
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine97ffbc145c7d4a83
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor68a36544a3925ed3
org.junit.platform.engine.support.hierarchical.LockManager3b5f78863ff21738
org.junit.platform.engine.support.hierarchical.Nodeb49761977ceb7101
org.junit.platform.engine.support.hierarchical.Node.SkipResultbd08edf24f1dd4d9
org.junit.platform.engine.support.hierarchical.NodeExecutionAdvisore5cf54a3abfe8a32
org.junit.platform.engine.support.hierarchical.NodeTestTask2d78f1925dd4882a
org.junit.platform.engine.support.hierarchical.NodeTestTask.DefaultDynamicTestExecutorfdbc89e07549b13b
org.junit.platform.engine.support.hierarchical.NodeTestTaskContext844fff78e0efe7ef
org.junit.platform.engine.support.hierarchical.NodeTreeWalkerb0b50dbbc8c467a5
org.junit.platform.engine.support.hierarchical.NodeUtilsd602362461bcf308
org.junit.platform.engine.support.hierarchical.NodeUtils.1f707e15bc93748e1
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService054c281153908bb9
org.junit.platform.engine.support.hierarchical.ThrowableCollector655e27ddc85aeb2a
org.junit.platform.launcher.EngineDiscoveryResult8a104796dc402ce9
org.junit.platform.launcher.EngineDiscoveryResult.Statusb30c4012c3e2f07e
org.junit.platform.launcher.LauncherDiscoveryListener456d3e735c22aa48
org.junit.platform.launcher.LauncherDiscoveryListener.1a120e75b9fe22bf4
org.junit.platform.launcher.TestIdentifier225bb434f8f223e2
org.junit.platform.launcher.TestPlan60578bb4f50b5157
org.junit.platform.launcher.core.DefaultDiscoveryRequestc69d8a6244047852
org.junit.platform.launcher.core.DefaultLauncherb535c0b0b3751eb8
org.junit.platform.launcher.core.DefaultLauncherConfiga355b55f1fea9e21
org.junit.platform.launcher.core.DelegatingEngineExecutionListener1e5487ee783deeca
org.junit.platform.launcher.core.EngineDiscoveryResultValidator93df7a3977833cf5
org.junit.platform.launcher.core.ExecutionListenerAdapterc5de7169f1a88932
org.junit.platform.launcher.core.InternalTestPlan4bd2d207c99632bd
org.junit.platform.launcher.core.LauncherConfigb3c713ac595fde03
org.junit.platform.launcher.core.LauncherConfig.Buildera17564c5b87448a3
org.junit.platform.launcher.core.LauncherConfigurationParameters461c933a6a874583
org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder718cd866fd0e3b49
org.junit.platform.launcher.core.LauncherFactoryd419bbcae8fd872b
org.junit.platform.launcher.core.OutcomeDelayingEngineExecutionListener72e79df7e2d97cc9
org.junit.platform.launcher.core.OutcomeDelayingEngineExecutionListener.Outcome4d8244bde278efbb
org.junit.platform.launcher.core.Root77042aab5235c2d8
org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry7c054c4cf76cb0f6
org.junit.platform.launcher.core.ServiceLoaderTestExecutionListenerRegistry2299bac1075a6bf3
org.junit.platform.launcher.core.StreamInterceptingTestExecutionListener3a1f3bd6b32f854b
org.junit.platform.launcher.core.TestExecutionListenerRegistryf61866dbd0e36091
org.junit.platform.launcher.core.TestExecutionListenerRegistry.CompositeTestExecutionListener583008686628ab79
org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener267176035c858efc
org.junit.platform.launcher.listeners.discovery.LauncherDiscoveryListenersc83fb9349eaee2dc
\ No newline at end of file diff --git a/backend/target/site/jacoco/jacoco.csv b/backend/target/site/jacoco/jacoco.csv index a806dd1..cfa3c9b 100644 --- a/backend/target/site/jacoco/jacoco.csv +++ b/backend/target/site/jacoco/jacoco.csv @@ -10,7 +10,7 @@ backend,com.workbenchclassic.hmi,HmiPersonnel.Person,30,0,4,0,7,0,3,0,1,0 backend,com.workbenchclassic.hmi,HmiLegacyWidgetResource,354,0,46,0,50,0,32,0,7,0 backend,com.workbenchclassic.hmi,HmiHealthServlet,70,0,0,0,21,0,2,0,2,0 backend,com.workbenchclassic.hmi,HmiThemeServlet,43,0,4,0,11,0,4,0,2,0 -backend,com.workbenchclassic.hmi,HmiJvmOptions,372,0,32,0,69,0,24,0,8,0 +backend,com.workbenchclassic.hmi,HmiJvmOptions,434,0,46,0,79,0,35,0,12,0 backend,com.workbenchclassic.hmi,HmiImsapiActionResource,153,0,20,0,22,0,13,0,3,0 backend,com.workbenchclassic.hmi,HmiPersonnel,259,0,44,0,54,0,29,0,7,0 backend,com.workbenchclassic.hmi,HmiWorkplaceConfiguration,358,0,64,0,58,0,38,0,6,0 @@ -21,7 +21,7 @@ backend,com.workbenchclassic.hmi,HmiSchemaRecovery,92,0,14,0,22,0,13,0,6,0 backend,com.workbenchclassic.hmi,HmiRolesResource,953,0,86,0,111,0,65,0,22,0 backend,com.workbenchclassic.hmi,HmiStyles,136,0,28,0,21,0,18,0,4,0 backend,com.workbenchclassic.hmi,HmiSchemaRecoveryResource,134,0,16,0,17,0,11,0,3,0 -backend,com.workbenchclassic.hmi,HmiSystemSettingsResource,197,0,24,0,37,0,18,0,6,0 +backend,com.workbenchclassic.hmi,HmiSystemSettingsResource,203,0,24,0,39,0,18,0,6,0 backend,com.workbenchclassic.hmi,HmiOriginFilter,32,0,2,0,12,0,5,0,4,0 backend,com.workbenchclassic.hmi,HmiDb,24,0,2,0,6,0,6,0,5,0 backend,com.workbenchclassic.hmi,HmiApiResource,4653,0,599,0,561,0,368,0,67,0 diff --git a/backend/target/site/jacoco/jacoco.xml b/backend/target/site/jacoco/jacoco.xml index 4141dd1..645c144 100644 --- a/backend/target/site/jacoco/jacoco.xml +++ b/backend/target/site/jacoco/jacoco.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/backend/target/surefire-reports/TEST-com.workbenchclassic.AppTest.xml b/backend/target/surefire-reports/TEST-com.workbenchclassic.AppTest.xml index 6b52762..85df543 100644 --- a/backend/target/surefire-reports/TEST-com.workbenchclassic.AppTest.xml +++ b/backend/target/surefire-reports/TEST-com.workbenchclassic.AppTest.xml @@ -1,5 +1,5 @@ - + @@ -12,7 +12,7 @@ - + @@ -27,7 +27,7 @@ - + @@ -54,5 +54,5 @@ - + \ No newline at end of file diff --git a/backend/target/surefire-reports/com.workbenchclassic.AppTest.txt b/backend/target/surefire-reports/com.workbenchclassic.AppTest.txt index 6d26704..f165bc0 100644 --- a/backend/target/surefire-reports/com.workbenchclassic.AppTest.txt +++ b/backend/target/surefire-reports/com.workbenchclassic.AppTest.txt @@ -1,4 +1,4 @@ ------------------------------------------------------------------------------- Test set: com.workbenchclassic.AppTest ------------------------------------------------------------------------------- -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.049 s - in com.workbenchclassic.AppTest +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 s - in com.workbenchclassic.AppTest diff --git a/build-hmi.ps1 b/build-hmi.ps1 new file mode 100644 index 0000000..d8b97f4 --- /dev/null +++ b/build-hmi.ps1 @@ -0,0 +1,36 @@ +# Windows/PowerShell build entry point. GlassFish may run on Windows or Linux; +# the generated WAR and browser-side CheerpJ code are OS independent. +[CmdletBinding()] +param() +Set-StrictMode -Version Latest +$ErrorActionPreference = 'Stop' +$Root = Split-Path -Parent $MyInvocation.MyCommand.Path + +function Find-Tool([string[]]$Names) { + foreach ($name in $Names) { + $item = Get-Command $name -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($null -ne $item) { return $item.Source } + } + throw "Erforderliches Programm fehlt: $($Names -join ' oder ')" +} +function Run-Checked([string]$Tool, [string[]]$ToolArguments) { + & $Tool @ToolArguments + if ($LASTEXITCODE -ne 0) { throw "Fehler: $Tool $($ToolArguments -join ' ') (Exit-Code $LASTEXITCODE)" } +} + +$npm = Find-Tool @('npm.cmd','npm') +$mvn = Find-Tool @('mvn.cmd','mvn.bat','mvn') +& (Join-Path $Root 'hmi-scripts/build-jaas-bridge.ps1') +& (Join-Path $Root 'hmi-scripts/build-native-loader-smoke.ps1') +Push-Location (Join-Path $Root 'hmi-frontend') +try { + if (Test-Path 'package-lock.json') { Run-Checked $npm @('ci') } + else { Run-Checked $npm @('install') } + Run-Checked $npm @('run','build') +} finally { Pop-Location } +Push-Location (Join-Path $Root 'backend') +try { Run-Checked $mvn @('clean','package') } +finally { Pop-Location } +$wars = @(Get-ChildItem -Path (Join-Path $Root 'backend/target') -Filter '*.war' -File) +if ($wars.Count -ne 1) { throw "Genau eine WAR erwartet: gefunden $($wars.Count)" } +Write-Host "Build erfolgreich. WAR: $($wars[0].FullName)" diff --git a/build-hmi.sh b/build-hmi.sh index d5c3ea5..36840f7 100755 --- a/build-hmi.sh +++ b/build-hmi.sh @@ -3,6 +3,8 @@ set -euo pipefail ROOT="$(cd "$(dirname "$0")" && pwd)" command -v npm >/dev/null || { echo 'Node 20.19+/npm fehlt'; exit 1; } command -v mvn >/dev/null || { echo 'Maven 3.6.3+ fehlt'; exit 1; } +"$ROOT/hmi-scripts/build-jaas-bridge.sh" +"$ROOT/hmi-scripts/build-native-loader-smoke.sh" (cd "$ROOT/hmi-frontend" && if [[ -f package-lock.json ]]; then npm ci; else npm install; fi && npm run build) (cd "$ROOT/backend" && mvn clean package) printf '\nWAR: %s/backend/target/backend-1.war\n' "$ROOT" diff --git a/hmi-docs/cheerpj/CHEERPJ_JAVA11_NATIVE_LOADER_SUPPORT.md b/hmi-docs/cheerpj/CHEERPJ_JAVA11_NATIVE_LOADER_SUPPORT.md new file mode 100644 index 0000000..f5091f4 --- /dev/null +++ b/hmi-docs/cheerpj/CHEERPJ_JAVA11_NATIVE_LOADER_SUPPORT.md @@ -0,0 +1,82 @@ +# CheerpJ 5.0 / Java 11: missing JVM_LoadLibrary import for System.loadLibrary() + +**Status:** Reproducible with a minimal application independent of customer or vendor code. +**CheerpJ:** Core 5.0, OpenJDK 11.0.33-internal (according to Java console output). +**Server JDK:** Java 11 on Payara/GlassFish (independent of browser JVM). +**Java classfile:** 55 (`javac --release 11`). +**Browser:** Edge/Chromium (as reported by customer). Additional Firefox verification not available. + +## Minimal reproduction steps + +The included `NativeLoaderSmoke.java` and `wwprobe.js` are vendor-independent. +Compile the Java class for Java 11, serve the JAR with HTTP Range support, serve +`wwprobe.js` as an ES module. Configure: + +```js +await cheerpjInit({ + version: 11, + javaProperties: ["java.library.path=/app/backend/hmi/cheerpj/natives"], +}); +await cheerpjRunMain( + "com.widgetworkbench.cheerpj.NativeLoaderSmoke", + "/app/backend/hmi/cheerpj/jaas-native-loader-smoke.jar", + "wwprobe" +); +``` + +Native module (`wwprobe.js`): + +```js +export default { + async Java_com_widgetworkbench_cheerpj_NativeLoaderSmoke_ping() { + return 42; + } +}; +``` + +The Java program executes `System.loadLibrary("wwprobe")` and then calls +its `private static native int ping()` method. + +**Actual output:** + +``` +[NATIVE-LOADER] java.version=11.0.33-internal +[NATIVE-LOADER] java.library.path=/app/backend/hmi/cheerpj/natives +[NATIVE-LOADER] about to System.loadLibrary("wwprobe") +JVM_FindLibraryEntry: JNI_OnLoad_wwprobe +JVM_FindLibraryEntry: JNI_OnLoad_wwprobe +Missing import: JVM_LoadLibrary +java.lang.UnsatisfiedLinkError: no wwprobe in java.library.path +``` + +**Expected:** `System.loadLibrary("wwprobe")` loads the JS module and the +subsequent native call returns 42. + +**Control test:** Using `cheerpjInit({ natives: wwprobeNativeHandlers })` +with the same native function and **without** `System.loadLibrary()` works: + +``` +[NATIVE-LOADER] NATIVE_CALL_RESULT=42 +[NATIVE-LOADER] PASS DIRECT_NATIVES +Java-Exit-Code: 0 +``` + +The same `JVM_LoadLibrary` error occurs for `System.loadLibrary("jaas")`, +which the Java 11 JDK class `com.sun.security.auth.module.UnixSystem` +performs in its constructor. + +## Questions for Leaning Technologies + +1. Is `System.loadLibrary` of JavaScript ES modules supported in **CheerpJ 5.0 with OpenJDK 11**? If so, are any additional `cheerpjInit` flags/imports required? +2. Is `Missing import: JVM_LoadLibrary` a known issue in the runtime's OpenJDK 11 native library loader? Is there a patch, fixed build, or documented workaround? +3. Does the Java 11 `jdk.security.auth` module's `UnixSystem` work under CheerpJ without using a synthetic OS identity? What is the recommended virtual OS identity approach? +4. Are there specific HTTP-Range or caching requirements for the CDN resource `/5.0/11/lib/modules`? An Edge session produced `ERR_CACHE_OPERATION_NOT_SUPPORTED`, but it is not proven to be causal. +5. Can you provide a supported browser-side extension mechanism to satisfy the UnixSystem constructor without editing vendor application JARs? + +## Scope and exclusions + +The original MES application JARs and its authentication process are untouched. +The test needs no customer database, internal server, iTAC classes, user credentials, +or workstation-specific identity. The generated Java `bridge` mode is a **separate +non-production diagnostic** of a synthetic identity helper; it is not a fix for +`System.loadLibrary`. diff --git a/hmi-docs/cheerpj/JaasIdentityBridge.java b/hmi-docs/cheerpj/JaasIdentityBridge.java new file mode 100644 index 0000000..46903e5 --- /dev/null +++ b/hmi-docs/cheerpj/JaasIdentityBridge.java @@ -0,0 +1,73 @@ +package com.widgetworkbench.cheerpj; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; + +/** + * CheerpJ-only shim for Java 11 UnixSystem.getUnixInfo(). + * + * The browser does not have an OS account. This class intentionally supplies + * an unprivileged synthetic Unix identity ONLY for the JDK OS-name lookup. + * It does not authenticate a MES user and must never be used for access control. + * It can be called from the CheerpJ jaas.js native implementation without + * modifying or repackaging vendor JARs. + */ +public final class JaasIdentityBridge { + public static final String VIRTUAL_USER = "cheerpj-client"; + private static final long VIRTUAL_UID = 65534L; + + private JaasIdentityBridge() { } + + /** Set the four instance fields the native OpenJDK Unix.c normally sets. */ + public static String populate(Object unixSystem) { + if (unixSystem == null + || !"com.sun.security.auth.module.UnixSystem".equals(unixSystem.getClass().getName())) { + throw new IllegalArgumentException("Expected an OpenJDK UnixSystem instance"); + } + try { + setField(unixSystem, "username", VIRTUAL_USER); + setField(unixSystem, "uid", VIRTUAL_UID); + setField(unixSystem, "gid", VIRTUAL_UID); + setField(unixSystem, "groups", new long[0]); + Method nameGetter = unixSystem.getClass().getMethod("getUsername"); + Object result = nameGetter.invoke(unixSystem); + if (!VIRTUAL_USER.equals(result)) { + throw new IllegalStateException("UnixSystem username was not populated"); + } + return VIRTUAL_USER; + } catch (ReflectiveOperationException ex) { + throw new IllegalStateException("Cannot populate virtual UnixSystem identity", ex); + } + } + + private static void setField(Object target, String name, Object value) + throws ReflectiveOperationException { + Field field = target.getClass().getDeclaredField(name); + // On a Java 11+ module with an open package, normal reflection is enough. + // On standard JDKs jdk.security.auth exports but does not open the package; + // use the JDK-provided Unsafe implementation to set exactly these fields. + try { + if (field.trySetAccessible()) { + field.set(target, value); + return; + } + } catch (SecurityException ex) { + // Try the explicitly scoped fallback below. + } + Class unsafeType = Class.forName("sun.misc.Unsafe"); + Field theUnsafe = unsafeType.getDeclaredField("theUnsafe"); + if (!theUnsafe.trySetAccessible()) { + throw new IllegalStateException("Unsafe unavailable in this Java runtime"); + } + Object unsafe = theUnsafe.get(null); + long offset = ((Number) unsafeType.getMethod("objectFieldOffset", Field.class) + .invoke(unsafe, field)).longValue(); + if (field.getType() == long.class) { + unsafeType.getMethod("putLong", Object.class, long.class, long.class) + .invoke(unsafe, target, offset, ((Number) value).longValue()); + } else { + unsafeType.getMethod("putObject", Object.class, long.class, Object.class) + .invoke(unsafe, target, offset, value); + } + } +} diff --git a/hmi-docs/cheerpj/NativeLoaderSmoke.java b/hmi-docs/cheerpj/NativeLoaderSmoke.java new file mode 100644 index 0000000..ba52138 --- /dev/null +++ b/hmi-docs/cheerpj/NativeLoaderSmoke.java @@ -0,0 +1,135 @@ +package com.widgetworkbench.cheerpj; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +/** + * Java 11/55 classfile, browser-only troubleshooting program. No proprietary + * libraries, MES calls, credentials, or changes to JVM/UnixSystem classes. + * Every invocation tests exactly ONE mode in a fresh browser page. + * + * direct - native method via cheerpjInit({natives}); no loadLibrary call + * wwprobe - System.loadLibrary("wwprobe") + * jaas - System.loadLibrary("jaas") + * unix - construct the real JDK UnixSystem, hitting its native load + * bridge - validate the Java helper independently of native loading; + * an instance allocated WITHOUT UnixSystem's constructor is + * used ONLY for this standalone diagnostic. Not a login path. + * environment - benign JDK/module settings (no usernames printed) + * sysprop - check whether user.name is present (never print its value) + */ +public final class NativeLoaderSmoke { + private NativeLoaderSmoke() {} + private static native int ping(); + + public static void main(String[] args) { + final String mode = args.length > 0 ? args[0] : "environment"; + System.out.println("[NATIVE-LOADER] JAVA_VERSION=" + System.getProperty("java.version")); + System.out.println("[NATIVE-LOADER] JAVA_LIBRARY_PATH=" + System.getProperty("java.library.path")); + System.out.println("[NATIVE-LOADER] MODE=" + mode); + try { + switch (mode) { + case "direct": + System.out.println("[NATIVE-LOADER] DIRECT_NATIVES: ping WITHOUT System.loadLibrary"); + verifyPing(); + pass("DIRECT_NATIVES"); + break; + case "wwprobe": + case "jaas": + System.out.println("[NATIVE-LOADER] LOAD_ATTEMPT=" + mode); + System.loadLibrary(mode); + System.out.println("[NATIVE-LOADER] LOAD_SUCCESS=" + mode); + if ("wwprobe".equals(mode)) verifyPing(); + pass("MODULE_LOADER_" + mode); + break; + case "unix": + testUnixConstructor(); + break; + case "bridge": + testBridgeWithoutUnixConstructor(); + break; + case "sysprop": + final String user = System.getProperty("user.name"); + System.out.println("[NATIVE-LOADER] USER_NAME_PRESENT=" + (user != null && !user.isEmpty())); + System.out.println("[NATIVE-LOADER] OS_NAME_PRESENT=" + (System.getProperty("os.name") != null)); + pass("SYSTEM_PROPERTIES"); + break; + case "environment": + System.out.println("[NATIVE-LOADER] JAVA_VENDOR=" + System.getProperty("java.vendor")); + System.out.println("[NATIVE-LOADER] JAVA_HOME=" + System.getProperty("java.home")); + System.out.println("[NATIVE-LOADER] JAVA_CLASS_VERSION=" + System.getProperty("java.class.version")); + Class cls = Class.forName("com.sun.security.auth.module.UnixSystem", false, + ClassLoader.getSystemClassLoader()); + System.out.println("[NATIVE-LOADER] UNIX_CLASS_PRESENT=" + (cls != null)); + System.out.println("[NATIVE-LOADER] UNIX_MODULE=" + cls.getModule().getName()); + System.out.println("[NATIVE-LOADER] UNIX_MODULE_EXPORTED=" + cls.getModule() + .isExported("com.sun.security.auth.module")); + pass("ENVIRONMENT"); + break; + default: + throw new IllegalArgumentException("Unbekannter Testmodus"); + } + } catch (Throwable error) { + System.err.println("[NATIVE-LOADER] FAIL " + mode + ": " + error.getClass().getName()); + // Reflective wrappers are printed, including their full cause chain. + error.printStackTrace(System.err); + if (error instanceof InvocationTargetException) { + Throwable root = ((InvocationTargetException) error).getTargetException(); + if (root != null) { + System.err.println("[NATIVE-LOADER] ROOT_CAUSE=" + root.getClass().getName()); + root.printStackTrace(System.err); + } + } + System.exit(31); + } + } + + private static void pass(String label) { + System.out.println("[NATIVE-LOADER] PASS " + label); + } + + private static void verifyPing() { + int value = ping(); + System.out.println("[NATIVE-LOADER] NATIVE_CALL_RESULT=" + value); + if (value != 42) throw new IllegalStateException("Expected 42, got " + value); + } + + private static void testUnixConstructor() throws Exception { + Class type = Class.forName("com.sun.security.auth.module.UnixSystem"); + System.out.println("[NATIVE-LOADER] UNIX_CONSTRUCTOR_ATTEMPT"); + Constructor constructor = type.getConstructor(); + Object instance = constructor.newInstance(); + Method getter = type.getMethod("getUsername"); + Object name = getter.invoke(instance); + // Do not print the operating-system identity to the diagnostic log. + System.out.println("[NATIVE-LOADER] UNIX_USERNAME_PRESENT=" + (name != null)); + pass("UNIX_CONSTRUCTOR"); + } + + private static void testBridgeWithoutUnixConstructor() throws Exception { + System.out.println("[NATIVE-LOADER] BRIDGE: Unsafe.allocateInstance only for test"); + Class unsafeType = Class.forName("sun.misc.Unsafe"); + Field singleton = unsafeType.getDeclaredField("theUnsafe"); + if (!singleton.trySetAccessible()) throw new IllegalStateException("Unsafe unavailable"); + Object unsafe = singleton.get(null); + Class unixType = Class.forName("com.sun.security.auth.module.UnixSystem", false, + ClassLoader.getSystemClassLoader()); + // This test deliberately never calls UnixSystem. or System.loadLibrary. + Object object = unsafeType.getMethod("allocateInstance", Class.class) + .invoke(unsafe, unixType); + String value = JaasIdentityBridge.populate(object); + if (!JaasIdentityBridge.VIRTUAL_USER.equals(value)) { + throw new IllegalStateException("Synthetic identity did not match"); + } + long uid = ((Number) unixType.getMethod("getUid").invoke(object)).longValue(); + long gid = ((Number) unixType.getMethod("getGid").invoke(object)).longValue(); + long[] groups = (long[]) unixType.getMethod("getGroups").invoke(object); + if (uid != 65534L || gid != 65534L || groups.length != 0) { + throw new IllegalStateException("Synthetic UnixSystem fields incomplete"); + } + System.out.println("[NATIVE-LOADER] BRIDGE_IDENTITY_FIELDS_OK=true"); + pass("BRIDGE_WITHOUT_CONSTRUCTOR"); + } +} diff --git a/hmi-docs/cheerpj/WindowGeometrySmoke.java b/hmi-docs/cheerpj/WindowGeometrySmoke.java new file mode 100644 index 0000000..c63b82a --- /dev/null +++ b/hmi-docs/cheerpj/WindowGeometrySmoke.java @@ -0,0 +1,87 @@ +package com.widgetworkbench.cheerpj; + +import java.awt.Rectangle; +import java.awt.GraphicsEnvironment; +import javax.swing.JDialog; +import javax.swing.SwingUtilities; + +/** Isolated Java 11 regression test. Does not start the vendor Workplace. */ +public final class WindowGeometrySmoke { + public static void main(String[] args) throws Exception { + Rectangle viewport = new Rectangle(0, 0, 960, 640); + verify(!WorkplaceResizeBridge.isOutside(new Rectangle(100, 100, 450, 330), viewport), "fully visible"); + verify(WorkplaceResizeBridge.isOutside(new Rectangle(2100, 900, 450, 330), viewport), "second monitor offscreen"); + verify(WorkplaceResizeBridge.isOutside(new Rectangle(-900, -800, 450, 330), viewport), "negative coordinates"); + verify(!WorkplaceResizeBridge.isOutside(new Rectangle(900, 580, 200, 100), viewport), "partially visible"); + verify(WorkplaceResizeBridge.isOutside(new Rectangle(945, 625, 200, 100), viewport), "tiny corner visible"); + verify("WINDOWS INVALID_VIEWPORT".equals(WorkplaceResizeBridge.diagnoseWindows(0, 0)), "invalid input"); + String diagnostic = WorkplaceResizeBridge.diagnoseWindows(960, 640); + verify(diagnostic.contains("viewport=0,0 960x640") && diagnostic.contains("windows="), "AWT snapshot"); + if (GraphicsEnvironment.isHeadless()) { + verify(WorkplaceResizeBridge.rescueOffscreenDialogs(960, 640).contains("RESCUE moved=0"), "no dialogs in headless test"); + } else { + final JDialog[] holder = new JDialog[1]; + SwingUtilities.invokeAndWait(() -> { + JDialog dialog = new JDialog(); + dialog.setSize(240, 160); + dialog.setVisible(true); + holder[0] = dialog; + }); + try { + // Wait for any initial native peer/window-manager placement event, + // then simulate restoring a saved window position. + Thread.sleep(250); + SwingUtilities.invokeAndWait(() -> holder[0].setLocation(100, 700)); + String before = WorkplaceResizeBridge.diagnoseWindows(960, 640); + verify(before.contains("offscreenDialogs=1"), "offscreen dialog reported"); + String fixed = WorkplaceResizeBridge.rescueOffscreenDialogs(960, 640); + verify(fixed.contains("RESCUE moved=1"), "dialog rescued"); + String after = WorkplaceResizeBridge.diagnoseWindows(960, 640); + verify(after.contains("offscreenDialogs=0"), "dialog now onscreen"); + verify(WorkplaceResizeBridge.rescueOffscreenDialogs(960, 640).contains("RESCUE moved=0"), "no recurring motion"); + } finally { + SwingUtilities.invokeAndWait(() -> holder[0].dispose()); + } + // End-to-end Java daemon test: the offscreen dialog must be rescued + // autonomously without any JavaScript polling or direct rescue call. + final JDialog[] automatic = new JDialog[1]; + SwingUtilities.invokeAndWait(() -> { + JDialog dialog = new JDialog(); + dialog.setSize(240, 160); + dialog.setVisible(true); + automatic[0] = dialog; + }); + try { + // Some window managers asynchronously reset the initial position + // after setVisible(true). Allow native realization to settle first. + Thread.sleep(300); + SwingUtilities.invokeAndWait(() -> automatic[0].setLocation(1300, 950)); + verify(WorkplaceResizeBridge.isOutside(automatic[0].getBounds(), viewport), "automatic test starts offscreen"); + verify(WorkplaceResizeBridge.startRuntimeMonitor(960, 640, "rescue") == 1, "autonomous rescue monitor starts"); + boolean rescued = false; + for (int i = 0; i < 25; i++) { + if (!WorkplaceResizeBridge.isOutside(automatic[0].getBounds(), viewport)) { rescued = true; break; } + Thread.sleep(100); + } + verify(rescued, "background thread autonomously rescues dialog"); + } finally { + WorkplaceResizeBridge.stopRuntimeMonitor(); + SwingUtilities.invokeAndWait(() -> automatic[0].dispose()); + } + Thread.sleep(100); + } + // One JVM thread owns the repeated checks; no further JS bridge calls. + verify(WorkplaceResizeBridge.startRuntimeMonitor(960, 640, "diagnose") == 1, "runtime monitor starts"); + verify(WorkplaceResizeBridge.startRuntimeMonitor(960, 640, "rescue") == 2, "runtime monitor reuses thread"); + Thread.sleep(100); + WorkplaceResizeBridge.stopRuntimeMonitor(); + boolean rejected = false; + try { WorkplaceResizeBridge.startRuntimeMonitor(960, 640, "invalid"); } + catch (IllegalArgumentException expected) { rejected = true; } + verify(rejected, "invalid monitor mode rejected"); + System.out.println("WINDOW_GEOMETRY_JAVA11_PASS"); + } + private static void verify(boolean ok, String label) { + if (!ok) throw new AssertionError(label); + } +} diff --git a/hmi-docs/cheerpj/WorkplaceCredentialBridge.java b/hmi-docs/cheerpj/WorkplaceCredentialBridge.java new file mode 100644 index 0000000..d51a741 --- /dev/null +++ b/hmi-docs/cheerpj/WorkplaceCredentialBridge.java @@ -0,0 +1,126 @@ +package com.widgetworkbench.cheerpj; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.Arrays; + +/** + * Optional one-shot bridge from an authenticated HTTPS HMI browser session to + * the *independent* iTAC Workplace PersonService login. Java 11. + * + * No vendor classes are patched, and IMSAPI session tokens are NOT reused. + * The browser offers credentials before main() starts; one Java-owned daemon + * waits for PersonService to become available and invokes the public + * MesContext.doLogin(String, Password, String) method exactly once. + * + * 0 = NONE; 1 = SUCCESS; 2 = REJECTED; 3 = ALREADY_SIGNED_IN; + * 4 = EXPIRED; 5 = BRIDGE_ERROR. No passwords, usernames, or stack traces + * are printed. Logging must never contain credential-bearing exceptions. + */ +public final class WorkplaceCredentialBridge { + private static final long TTL_MILLIS = 120_000L; + private static final int RETRY_DELAY = 400; + private static char[] pending; + private static String username; + private static String client; + private static long expires; + private static boolean armed; + private static volatile int result; + + private WorkplaceCredentialBridge() { } + + // Direct CheerpJ native handler, registered with cheerpjInit({natives}). + // No System.loadLibrary() is called by this helper. + private static native void nativeReport(int code); + + private static void report(int code) { + result = code; + System.out.println("[WidgetWorkbench/WorkplaceAuth] RESULT_CODE=" + code); + try { nativeReport(code); } catch (Throwable ignored) { /* stdout still reports */ } + } + + /** Called ONCE via CheerpJ Library Mode, before cheerpjRunMain(). */ + public static synchronized int offer(String user, String password, String targetClient) { + if (armed || pending != null || !valid(user, 120) || !valid(password, 1024) + || !valid(targetClient, 120)) return 0; + username = user; + pending = password.toCharArray(); + client = targetClient; + expires = System.currentTimeMillis() + TTL_MILLIS; + armed = true; + Thread worker = new Thread(WorkplaceCredentialBridge::runOnce, "hmi-workplace-auth-handoff"); + worker.setDaemon(true); + worker.start(); + return 1; + } + + public static synchronized int getResultCode() { return result; } + + private static boolean valid(String input, int max) { + return input != null && !input.isEmpty() && input.length() <= max + && input.indexOf('\0') < 0; + } + + private static void clearPending() { + if (pending != null) Arrays.fill(pending, '\0'); + pending = null; username = null; client = null; expires = 0L; + } + + private static void runOnce() { + // Wait until the Workplace has begun its own Java initialization. The + // service locator may be unavailable during the first few seconds. + try { Thread.sleep(1200); } catch (InterruptedException ignored) { + Thread.currentThread().interrupt(); + synchronized (WorkplaceCredentialBridge.class) { clearPending(); } + report(5);return; + } + try { + final ClassLoader cl = WorkplaceCredentialBridge.class.getClassLoader(); + final Class locator = Class.forName("com.itac.artes.ihas.ServiceLocator", true, cl); + final Class personService = Class.forName("com.itac.mes.admin.domain.PersonService", false, cl); + final Method getService = locator.getMethod("getService", Class.class); + // Do not construct/use MesContext before the MES services are ready. + Object service = null; + while (System.currentTimeMillis() < expires) { + try { service = getService.invoke(null, personService); } catch (Exception ignored) { } + if (service != null) break; + Thread.sleep(RETRY_DELAY); + } + if (service == null) { report(4);return; } + final Class contextType = Class.forName("com.itac.mes.gui.MesContext", true, cl); + final Object context = contextType.getMethod("instance").invoke(null); + // Avoid replacing an active login (including a different MES user). + if (contextType.getMethod("getUser").invoke(context) != null) { + report(3);return; + } + final Class passwordType = Class.forName("com.itac.util.text.Password", true, cl); + @SuppressWarnings({"unchecked", "rawtypes"}) + final Class encryptionType = + (Class) Class.forName("com.itac.util.text.Password$Encryption", true, cl); + @SuppressWarnings({"unchecked", "rawtypes"}) + final Object none = Enum.valueOf((Class) encryptionType, "NONE"); + final Constructor passwordConstructor = passwordType.getConstructor(encryptionType, String.class); + String user; String target; char[] chars; + synchronized (WorkplaceCredentialBridge.class) { + if (pending == null || System.currentTimeMillis() >= expires) { report(4);return; } + user = username; target = client; chars = pending; + pending = null; username = null; client = null; + } + try { + // Same Password constructor used by iTAC GuiPasswordField.getValue(). + final Object pwd = passwordConstructor.newInstance(none, new String(chars)); + // Exactly one real MES authentication attempt; boolean false is + // a rejected login. No exception contents leave the JVM. + final Object success = contextType.getMethod("doLogin", String.class, passwordType, String.class) + .invoke(context, user, pwd, target); + report(Boolean.TRUE.equals(success) ? 1 : 2); + } finally { Arrays.fill(chars, '\0'); } + } catch (Throwable error) { + // Do not log Throwable.toString(): vendor exceptions may contain + // credentials or personally identifying information. + report(5); + } finally { + synchronized (WorkplaceCredentialBridge.class) { clearPending(); } + } + } +} diff --git a/hmi-docs/cheerpj/WorkplaceLoginHotfixSmoke.java b/hmi-docs/cheerpj/WorkplaceLoginHotfixSmoke.java new file mode 100644 index 0000000..cb1a37c --- /dev/null +++ b/hmi-docs/cheerpj/WorkplaceLoginHotfixSmoke.java @@ -0,0 +1,84 @@ +package com.widgetworkbench.cheerpj; + +import com.itac.mes.gui.dialog.MesLoginDialog; +import java.awt.GraphicsEnvironment; +import java.awt.Rectangle; +import javax.swing.JDesktopPane; +import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; + +/** + * Test-only window fixture verifying iTAC class-name detection and owner + * geometry. Requires the unsiged fixture in hmi-scripts/tests/fixtures. + * Do NOT bundle the fixture MesLoginDialog into the production bridge JAR. + */ +public final class WorkplaceLoginHotfixSmoke { + private static final class MyDoggyTestPanel extends JPanel { } + private static void check(boolean ok, String label) { + if (!ok) throw new AssertionError(label); + } + public static void main(String[] args) throws Exception { + if (GraphicsEnvironment.isHeadless()) { + System.out.println("WORKPLACE_LOGIN_HOTFIX_HEADLESS_PASS"); + return; + } + JFrame owner = new JFrame(); + owner.setSize(520, 420); + owner.setLocation(1900, 1250); + final MesLoginDialog[] holder = new MesLoginDialog[1]; + SwingUtilities.invokeAndWait(() -> { + MesLoginDialog login = new MesLoginDialog(owner); + login.setSize(450, 350); + login.setLocation(2400, 1300); + holder[0] = login; + // Do not show modal JDialog via setVisible(true) on the EDT; + // that call enters a nested event loop. make it visible on test + // without ever invoking the proprietary iTAC login method. + login.setModal(false); + login.setVisible(true); + }); + try { + String snapshot = WorkplaceResizeBridge.diagnoseWindows(960, 640); + check(snapshot.contains("MES_LOGIN state=VISIBLE_OFFSCREEN observed=1"), "login class detected"); + check(snapshot.contains("MES_LOGIN_OWNER class=javax.swing.JFrame"), "owner identified"); + check(snapshot.contains("visible=false") && snapshot.contains("offscreen=true"), "invisible/offscreen owner reported"); + check(snapshot.contains("COMPONENT_TREE scanned="), "nested inventory available"); + String rescue = WorkplaceResizeBridge.rescueOffscreenDialogs(960, 640); + check(rescue.contains("loginMoved=1"), "targeted login rescue"); + check(!WorkplaceResizeBridge.isOutside(holder[0].getBounds(),new Rectangle(0, 0, 960, 640)), "login visible after rescue"); + check(WorkplaceResizeBridge.rescueOffscreenDialogs(960, 640).contains("loginMoved=0"), "idempotent rescue"); + SwingUtilities.invokeAndWait(() -> holder[0].setVisible(false)); + check(WorkplaceResizeBridge.diagnoseWindows(960,640).contains("MES_LOGIN state=CREATED_HIDDEN"), "hidden dialog distinguishable"); + } finally { + SwingUtilities.invokeAndWait(() -> { holder[0].dispose(); owner.dispose(); }); + } + JFrame nested = new JFrame(); + SwingUtilities.invokeAndWait(() -> { + JDesktopPane desk = new JDesktopPane(); + JInternalFrame child = new JInternalFrame(); + child.setBounds(20, 20, 100, 100); + desk.add(child); + nested.add(desk); + nested.add(new JOptionPane(), java.awt.BorderLayout.SOUTH); + nested.add(new MyDoggyTestPanel(), java.awt.BorderLayout.NORTH); + nested.add(new JTextField("DO_NOT_LOG_PASSWORD"), java.awt.BorderLayout.WEST); + nested.setSize(400, 300); + nested.setVisible(true); + }); + try { + String snapshot = WorkplaceResizeBridge.diagnoseWindows(960, 640); + check(snapshot.contains("internalFrames=1"), "internal frame inventoried"); + check(snapshot.contains("desktops=1"), "desktop inventoried"); + check(snapshot.contains("optionPanes=1"), "option pane inventoried"); + check(snapshot.contains("myDoggy=1"), "MyDoggy classname diagnostic"); + check(!snapshot.contains("DO_NOT_LOG_PASSWORD"), "component text and secrets excluded"); + } finally { + SwingUtilities.invokeAndWait(nested::dispose); + } + System.out.println("WORKPLACE_LOGIN_HOTFIX_JAVA11_PASS"); + } +} diff --git a/hmi-docs/cheerpj/WorkplaceResizeBridge.java b/hmi-docs/cheerpj/WorkplaceResizeBridge.java index 256f15a..90ea3f6 100644 --- a/hmi-docs/cheerpj/WorkplaceResizeBridge.java +++ b/hmi-docs/cheerpj/WorkplaceResizeBridge.java @@ -2,53 +2,151 @@ package com.widgetworkbench.cheerpj; import java.awt.Component; import java.awt.Container; +import java.awt.Dialog; import java.awt.Dimension; import java.awt.Frame; -import java.util.concurrent.atomic.AtomicReference; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; +import java.util.ArrayDeque; +import java.util.Locale; +import java.util.concurrent.Callable; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import javax.swing.JDialog; import javax.swing.JFrame; +import javax.swing.JInternalFrame; +import javax.swing.JDesktopPane; +import javax.swing.JLayeredPane; +import javax.swing.JOptionPane; +import javax.swing.RootPaneContainer; import javax.swing.JSplitPane; import javax.swing.SwingUtilities; /** - * Optional adapter for resizing the iTAC MES.Suite Workplace inside a CheerpJ display. - * No iTAC class dependencies, no modifications to vendor-signed JARs. - * The adapter must be loaded into the SAME JVM as the Workplace. - * This affects the Swing frame, NOT browser-side display scaling. + * Optional, unsigned compatibility bridge for the iTAC Workplace running in + * CheerpJ's virtual Swing desktop. No vendor classes are modified. + * + * Window reports deliberately do not contain window titles or component text: + * those may contain sensitive MES data. Only classes and geometry are reported. */ public final class WorkplaceResizeBridge { - private static final String FRAME_NAME = - "com.itac.mes.suite.presentation.MesSuiteFrame"; - private static final String PANEL_NAME = - "com.itac.mes.gui.suite.MesSuitePanel"; + private static final String FRAME_NAME = "com.itac.mes.suite.presentation.MesSuiteFrame"; + private static final String PANEL_NAME = "com.itac.mes.gui.suite.MesSuitePanel"; + // Verified using the user-provided signed iTAC GUI JARs. These names are + // informational only; the bridge never loads or instantiates vendor classes. + private static final String MES_LOGIN_NAME = "com.itac.mes.gui.dialog.MesLoginDialog"; + private static final String GUI_DIALOG_NAME = "com.itac.gui.dialog.GuiDialog"; + private static final int MAX_WINDOW_REPORTS = 80; + private static final int MAX_TREE_NODES = 2500; + private static final int MAX_COMPONENT_REPORTS = 35; private WorkplaceResizeBridge() { } + private static volatile boolean monitorActive; + private static volatile Thread monitorThread; + private static volatile int monitorWidth; + private static volatile int monitorHeight; + private static volatile String monitorMode = "off"; /** - * Requests a resize of the matching iTAC Workplace window. - * Returns number of matching frames found; update may be scheduled on EDT. + * Starts exactly one Java-owned AWT/window monitor. IMPORTANT: all subsequent + * monitor calls happen on a native Java Thread, NOT through CheerpJ Library + * Mode. That prevents simultaneous JavaScript-to-Java invocations while + * cheerpjRunMain() is executing. + * + * @return 1 = started, 2 = already running */ + public static synchronized int startRuntimeMonitor(int width, int height, String mode) { + if (!validSize(width, height)) throw new IllegalArgumentException("invalid viewport"); + if (!("off".equals(mode) || "diagnose".equals(mode) || "rescue".equals(mode))) + throw new IllegalArgumentException("invalid window mode"); + monitorWidth = width; + monitorHeight = height; + monitorMode = mode; + if (monitorThread != null && monitorThread.isAlive()) return 2; + monitorActive = true; + final Thread worker = new Thread(new Runnable() { + @Override public void run() { + String lastSnapshot = null; + boolean mainFrameSized = false; + int reportedErrorCount = 0; + while (monitorActive) { + try { + final int width = monitorWidth; + final int height = monitorHeight; + final String mode = monitorMode; + // The main frame does not exist at startup. Retry until + // first detected; do not continuously move user windows. + if (!mainFrameSized) { + if (resize(width, height) > 0) { + mainFrameSized = true; + System.out.println("[WidgetWorkbench/WindowGeometry] MAIN_FRAME_RESIZE " + + width + "x" + height); + } + } + if (!"off".equals(mode)) { + if ("rescue".equals(mode)) { + final String rescue = rescueOffscreenDialogs(width, height); + if (rescue.startsWith("RESCUE moved=") && !rescue.startsWith("RESCUE moved=0")) + System.out.println("[WidgetWorkbench/WindowGeometry] " + rescue); + } + final String snapshot = diagnoseWindows(width, height); + if (!snapshot.equals(lastSnapshot)) { + lastSnapshot = snapshot; + System.out.println("[WidgetWorkbench/WindowGeometry]\n" + snapshot); + } + } + Thread.sleep(2000); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + break; + } catch (Throwable ex) { + // Diagnostics MUST NOT abort the vendor application or + // repeatedly flood logs when the AWT implementation fails. + if (reportedErrorCount++ < 3) System.out.println( + "[WidgetWorkbench/WindowGeometry] MONITOR_ERROR " + ex.getClass().getName()); + try { Thread.sleep(3000); } + catch (InterruptedException interrupted) { + Thread.currentThread().interrupt(); + break; + } + } + } + monitorActive = false; + } + }, "WidgetWorkbench-WindowMonitor"); + worker.setDaemon(true); + monitorThread = worker; + worker.start(); + return 1; + } + + /** For isolated Java regression tests; not called by the active JS runner. */ + public static synchronized void stopRuntimeMonitor() { + monitorActive = false; + Thread worker = monitorThread; + if (worker != null) worker.interrupt(); + monitorThread = null; + } + + + /** Resize only the main Workplace frame (not its owned dialogs). */ public static int resize(final int width, final int height) { - if (width < 200 || height < 150 || width > 16000 || height > 16000) { - return 0; - } + if (!validSize(width, height)) return 0; int matches = 0; for (final Frame frame : Frame.getFrames()) { - if (!(frame instanceof JFrame) - || !FRAME_NAME.equals(frame.getClass().getName())) { - continue; - } + if (!(frame instanceof JFrame) || !FRAME_NAME.equals(frame.getClass().getName())) continue; final JFrame window = (JFrame) frame; final Container content = window.getContentPane(); - if (content == null || !PANEL_NAME.equals(content.getClass().getName())) { - continue; - } + if (content == null || !PANEL_NAME.equals(content.getClass().getName())) continue; matches++; final Runnable action = new Runnable() { - @Override - public void run() { + @Override public void run() { if (!window.isDisplayable()) return; - // MesSuitePanel contains BorderLayout: north toolbar, center split navigation. - // Respect iTAC navigation preference (divider initially at 150 px). window.setSize(width, height); window.setLocation(0, 0); content.invalidate(); @@ -62,12 +160,10 @@ public final class WorkplaceResizeBridge { return matches; } - /** Inspect live dimensions without changing iTAC settings or window sizes. */ + /** Existing main-window resize diagnostics (kept for compatibility). */ public static String diagnose() { - final AtomicReference result = new AtomicReference("diagnostic unavailable"); - Runnable task = new Runnable() { - @Override - public void run() { + return onEdt(new Snapshot() { + @Override public String get() { StringBuilder sb = new StringBuilder(); int count = 0; for (Frame frame : Frame.getFrames()) { @@ -86,25 +182,245 @@ public final class WorkplaceResizeBridge { } } if (count == 0) sb.append("Workplace window not found"); - result.set(sb.toString()); + return sb.toString(); + } + }); + } + + /** + * Read-only snapshot of the virtual desktop and ALL AWT top-level windows, + * including invisible/not-yet-displayed JDialogs. Safe for periodic polling. + * The viewport represents the actual CheerpJ HTML display in CSS pixels. + */ + public static String diagnoseWindows(final int width, final int height) { + if (!validSize(width, height)) return "WINDOWS INVALID_VIEWPORT"; + return onEdt(new Snapshot() { + @Override public String get() { + final Rectangle viewport = new Rectangle(0, 0, width, height); + final StringBuilder out = new StringBuilder(4096); + out.append("viewport=").append(rect(viewport)); + out.append(" headless=").append(GraphicsEnvironment.isHeadless()).append('\n'); + try { + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + GraphicsDevice[] devices = ge.getScreenDevices(); + Dimension toolkit = Toolkit.getDefaultToolkit().getScreenSize(); + out.append("toolkitScreen=").append(toolkit.width).append('x').append(toolkit.height).append('\n'); + out.append("virtualScreens=").append(devices.length).append('\n'); + for (int i = 0; i < devices.length && i < 8; i++) { + GraphicsConfiguration gc = devices[i].getDefaultConfiguration(); + out.append(" screen[").append(i).append("]=") + .append(gc == null ? "no configuration" : rect(gc.getBounds())) + .append('\n'); + } + } catch (RuntimeException | LinkageError ex) { + out.append("virtualScreens=unavailable(").append(ex.getClass().getSimpleName()).append(")\n"); + } + final Window[] windows = Window.getWindows(); + int dialogs = 0, visibleDialogs = 0, outsideDialogs = 0; + int loginCount = 0, loginVisible = 0, loginOffscreen = 0, loginHidden = 0; + for (Window w : windows) { + if (w instanceof JDialog) { + dialogs++; + if (w.isVisible()) visibleDialogs++; + if (w.isVisible() && isOutside(w.getBounds(), viewport)) outsideDialogs++; + } + if (isMesLoginDialog(w)) { + loginCount++; + if (w.isVisible()) { + loginVisible++; + if (isOutside(w.getBounds(), viewport)) loginOffscreen++; + } else loginHidden++; + } + } + out.append("windows=").append(windows.length) + .append(" dialogs=").append(dialogs) + .append(" visibleDialogs=").append(visibleDialogs) + .append(" offscreenDialogs=").append(outsideDialogs).append('\n'); + // NOT_SEEN is observational, not proof that no constructor ran: + // a dialog may have been disposed or the monitor may have missed it. + String loginState = loginCount == 0 ? "NOT_SEEN" + : loginVisible == 0 ? "CREATED_HIDDEN" + : loginOffscreen > 0 ? "VISIBLE_OFFSCREEN" : "VISIBLE_ONSCREEN"; + out.append("MES_LOGIN state=").append(loginState) + .append(" observed=").append(loginCount) + .append(" visible=").append(loginVisible) + .append(" hidden=").append(loginHidden) + .append(" offscreen=").append(loginOffscreen) + .append(" (NOT_SEEN does not prove never constructed)\n"); + for (int i = 0; i < windows.length && i < MAX_WINDOW_REPORTS; i++) { + Window w = windows[i]; + Rectangle b = w.getBounds(); + out.append('[').append(i).append("] ") + .append(w.getClass().getName()) + .append(" bounds=").append(rect(b)) + .append(" visible=").append(w.isVisible()) + .append(" showing=").append(w.isShowing()) + .append(" displayable=").append(w.isDisplayable()) + .append(" active=").append(w.isActive()) + .append(" focused=").append(w.isFocused()) + .append(" outsideViewport=").append(b.width > 0 && b.height > 0 && isOutside(b, viewport)); + Window owner = w.getOwner(); + if (owner != null) out.append(" owner=").append(owner.getClass().getName()); + if (w instanceof Dialog) out.append(" modal=").append(((Dialog) w).isModal()); + out.append('\n'); + if (isMesLoginDialog(w)) { + out.append(" MES_LOGIN_OWNER "); + if (owner == null) out.append("none"); + else out.append("class=").append(owner.getClass().getName()) + .append(" bounds=").append(rect(owner.getBounds())) + .append(" visible=").append(owner.isVisible()) + .append(" showing=").append(owner.isShowing()) + .append(" displayable=").append(owner.isDisplayable()) + .append(" offscreen=").append(isOutside(owner.getBounds(),viewport)); + out.append('\n'); + } + } + if (windows.length > MAX_WINDOW_REPORTS) out.append("... additional windows omitted\n"); + appendComponentInventory(out, windows); + return out.toString(); + } + }); + } + + private static boolean isMesLoginDialog(Window w) { + return MES_LOGIN_NAME.equals(w.getClass().getName()); + } + + /** + * Bounded, read-only inspection of nested Swing components. JInternalFrame, + * MyDoggy docking containers, JOptionPane and glass panes do not necessarily + * appear in Window.getWindows(). Only class names and geometry are logged; + * never component text, dialog titles, usernames or passwords. + */ + private static void appendComponentInventory(StringBuilder out, Window[] windows) { + ArrayDeque queue = new ArrayDeque(); + for (int i = 0; i < windows.length && i < MAX_WINDOW_REPORTS; i++) queue.add(windows[i]); + int nodes = 0, internal = 0, desktop = 0, layered = 0, option = 0, docking = 0, glass = 0, reported = 0; + while (!queue.isEmpty() && nodes < MAX_TREE_NODES) { + Component c = queue.removeFirst(); + nodes++; + String name = c.getClass().getName(); + boolean isInternal = c instanceof JInternalFrame; + boolean isDesktop = c instanceof JDesktopPane; + boolean isLayered = c instanceof JLayeredPane; + boolean isOption = c instanceof JOptionPane; + boolean isDocking = name.toLowerCase(Locale.ROOT).contains("mydoggy"); + if (isInternal) internal++; + if (isDesktop) desktop++; + if (isLayered) layered++; + if (isOption) option++; + if (isDocking) docking++; + if (c instanceof RootPaneContainer) { + Component g = ((RootPaneContainer)c).getGlassPane(); + // Identity is checked while traversing child components below. + if (g != null && g.isVisible()) glass++; + } + if ((isInternal || isDesktop || isOption || isDocking) && reported++ < MAX_COMPONENT_REPORTS) { + out.append(" COMPONENT ").append(name) + .append(" boundsLocal=").append(rect(c.getBounds())) + .append(" visible=").append(c.isVisible()) + .append(" showing=").append(c.isShowing()).append('\n'); + } + if (c instanceof Container) { + for (Component child : ((Container)c).getComponents()) { + if (child != null && nodes + queue.size() < MAX_TREE_NODES) queue.addLast(child); + } } - }; - if (SwingUtilities.isEventDispatchThread()) task.run(); - else { - try { SwingUtilities.invokeAndWait(task); } - catch (Exception ex) { return "diagnostic error: " + ex.getClass().getSimpleName(); } } - return result.get(); + out.append("COMPONENT_TREE scanned=").append(nodes) + .append(" pending=").append(queue.size()) + .append(" internalFrames=").append(internal) + .append(" desktops=").append(desktop) + .append(" layered=").append(layered) + .append(" optionPanes=").append(option) + .append(" myDoggy=").append(docking) + .append(" visibleGlassPanes=").append(glass) + .append(" capped=").append(!queue.isEmpty()).append('\n'); + } + + /** + * Opt-in recovery, NOT an authentication workaround. Reposition only visible + * Swing dialogs which are almost entirely outside the virtual display. + * Never resize dialogs, move the main frame, or move invisible dialogs. + */ + public static String rescueOffscreenDialogs(final int width, final int height) { + if (!validSize(width, height)) return "WINDOWS INVALID_VIEWPORT"; + return onEdt(new Snapshot() { + @Override public String get() { + Rectangle viewport = new Rectangle(0, 0, width, height); + int visible = 0, moved = 0, loginMoved = 0; + for (Window window : Window.getWindows()) { + if (!(window instanceof JDialog) || !window.isVisible() || !window.isDisplayable()) continue; + visible++; + Rectangle before = window.getBounds(); + if (!isOutside(before, viewport)) continue; + // An oversized dialog is positioned at zero rather than + // resized, avoiding changes to vendor-controlled content. + int newX = Math.max(0, (width - before.width) / 2); + int newY = Math.max(0, (height - before.height) / 2); + window.setLocation(newX, newY); + moved++; + if (isMesLoginDialog(window)) loginMoved++; + } + return "RESCUE moved=" + moved + " loginMoved=" + loginMoved + + " visibleDialogs=" + visible; + } + }); + } + + private static boolean validSize(int width, int height) { + return width >= 200 && height >= 150 && width <= 16000 && height <= 16000; + } + + static boolean isOutside(Rectangle bounds, Rectangle viewport) { + if (bounds.width <= 0 || bounds.height <= 0) return true; + Rectangle intersection = bounds.intersection(viewport); + int minWidth = Math.min(48, Math.max(1, bounds.width / 5)); + int minHeight = Math.min(40, Math.max(1, bounds.height / 5)); + return intersection.width < minWidth || intersection.height < minHeight; + } + + private static String rect(Rectangle r) { + return r.x + "," + r.y + " " + r.width + "x" + r.height; + } + + private interface Snapshot { String get(); } + + private static String onEdt(final Snapshot action) { + if (SwingUtilities.isEventDispatchThread()) { + try { return action.get(); } + catch (RuntimeException | LinkageError ex) { return "WINDOWS ERROR " + ex.getClass().getSimpleName(); } + } + // An iTAC modal UI may be busy or its event dispatch may have thrown. + // Do NOT wait indefinitely for the EDT from CheerpJ's library thread. + FutureTask task = new FutureTask(new Callable() { + @Override public String call() { + try { return action.get(); } + catch (RuntimeException | LinkageError ex) { return "WINDOWS ERROR " + ex.getClass().getSimpleName(); } + } + }); + SwingUtilities.invokeLater(task); + try { + return task.get(1500, TimeUnit.MILLISECONDS); + } catch (TimeoutException ex) { + task.cancel(false); + return "WINDOWS EDT_BUSY (snapshot timed out after 1500ms)"; + } catch (InterruptedException ex) { + task.cancel(false); + Thread.currentThread().interrupt(); + return "WINDOWS interrupted"; + } catch (Exception ex) { + return "WINDOWS invocation error: " + ex.getClass().getSimpleName(); + } } private static void appendSize(StringBuilder sb, String title, Component c) { Dimension preferred = c.getPreferredSize(); Dimension minimum = c.getMinimumSize(); Dimension actual = c.getSize(); - sb.append(title).append("=").append(actual.width).append('x').append(actual.height) + sb.append(title).append('=').append(actual.width).append('x').append(actual.height) .append(" pref=").append(preferred.width).append('x').append(preferred.height) - .append(" min=").append(minimum.width).append('x').append(minimum.height) - .append("; "); + .append(" min=").append(minimum.width).append('x').append(minimum.height).append("; "); } private static JSplitPane findSplit(Container parent) { diff --git a/hmi-docs/cheerpj/tests/WorkplaceCredentialBridgeSmoke.java b/hmi-docs/cheerpj/tests/WorkplaceCredentialBridgeSmoke.java new file mode 100644 index 0000000..b47515e --- /dev/null +++ b/hmi-docs/cheerpj/tests/WorkplaceCredentialBridgeSmoke.java @@ -0,0 +1,13 @@ +import com.widgetworkbench.cheerpj.WorkplaceCredentialBridge; +/** Mimics verified public method signatures, not proprietary MES behavior. */ +public final class WorkplaceCredentialBridgeSmoke { + public static void main(String[] args) throws Exception { + final String secret="secret123"; + if(WorkplaceCredentialBridge.offer("tester",secret,"any")!=1)throw new AssertionError("first offer rejected"); + if(WorkplaceCredentialBridge.offer("tester",secret,"any")!=0)throw new AssertionError("duplicate offer accepted"); + long deadline=System.currentTimeMillis()+6000; + while(WorkplaceCredentialBridge.getResultCode()==0 && System.currentTimeMillis() ignored){return new Object();} +} diff --git a/hmi-docs/cheerpj/tests/stubs/com/itac/mes/admin/domain/PersonService.java b/hmi-docs/cheerpj/tests/stubs/com/itac/mes/admin/domain/PersonService.java new file mode 100644 index 0000000..1979830 --- /dev/null +++ b/hmi-docs/cheerpj/tests/stubs/com/itac/mes/admin/domain/PersonService.java @@ -0,0 +1,2 @@ +package com.itac.mes.admin.domain; +public interface PersonService {} diff --git a/hmi-docs/cheerpj/tests/stubs/com/itac/mes/gui/MesContext.java b/hmi-docs/cheerpj/tests/stubs/com/itac/mes/gui/MesContext.java new file mode 100644 index 0000000..0fa30e5 --- /dev/null +++ b/hmi-docs/cheerpj/tests/stubs/com/itac/mes/gui/MesContext.java @@ -0,0 +1,14 @@ +package com.itac.mes.gui; +import com.itac.util.text.Password; +public final class MesContext { + private static final MesContext INSTANCE=new MesContext(); + private Object user; + public static MesContext instance(){return INSTANCE;} + public Object getUser(){return user;} + public boolean doLogin(String username, Password password, String client){ + if("tester".equals(username) && password.matches("secret123") && "any".equals(client)){ + user=new Object();return true; + } + return false; + } +} diff --git a/hmi-docs/cheerpj/tests/stubs/com/itac/util/text/Password.java b/hmi-docs/cheerpj/tests/stubs/com/itac/util/text/Password.java new file mode 100644 index 0000000..642e9c7 --- /dev/null +++ b/hmi-docs/cheerpj/tests/stubs/com/itac/util/text/Password.java @@ -0,0 +1,10 @@ +package com.itac.util.text; +public final class Password { + public enum Encryption { NONE } + private final String value; + public Password(Encryption encryption, String plaintext){ + if(encryption!=Encryption.NONE)throw new IllegalArgumentException(); + value=plaintext; + } + public boolean matches(String check){return value.equals(check);} +} diff --git a/hmi-docs/cheerpj/tests/test-workplace-credential-bridge.sh b/hmi-docs/cheerpj/tests/test-workplace-credential-bridge.sh new file mode 100644 index 0000000..9d45b3b --- /dev/null +++ b/hmi-docs/cheerpj/tests/test-workplace-credential-bridge.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euo pipefail +SRC="$(cd "$(dirname "$0")/.." && pwd)" +TEMP="$(mktemp -d)" +trap 'rm -rf "$TEMP"' EXIT +javac --release 11 -d "$TEMP" "$SRC/WorkplaceCredentialBridge.java" \ + "$(dirname "$0")/WorkplaceCredentialBridgeSmoke.java" \ + $(find "$(dirname "$0")/stubs" -type f -name '*.java' | sort) +java -cp "$TEMP" WorkplaceCredentialBridgeSmoke diff --git a/hmi-frontend/package.json b/hmi-frontend/package.json index f2aa002..ad28360 100644 --- a/hmi-frontend/package.json +++ b/hmi-frontend/package.json @@ -1,7 +1,7 @@ { "name": "workbench-hmi", "private": true, - "version": "5.10.8", + "version": "5.10.23", "type": "module", "scripts": { "dev": "vite --host 0.0.0.0 --port 5173", @@ -11,8 +11,9 @@ "test:widget": "node tests/widget-package.mjs", "test:navigation": "node --experimental-strip-types tests/navigation.mjs", "test:bootstrap": "node tests/bootstrap-contract.mjs", - "test:cheerpj": "node tests/cheerpj-runner.mjs && node --experimental-strip-types tests/cheerpj-autostart.mjs", - "test:theme": "node tests/neon-theme.mjs && node tests/futuristic-v54.mjs" + "test:cheerpj": "node tests/native-loader-smoke.mjs && node tests/cheerpj-runner.mjs && node --experimental-strip-types tests/cheerpj-autostart.mjs && node tests/cheerpj-window-runtime.mjs && node tests/cheerpj-jaas-native.mjs", + "test:theme": "node tests/neon-theme.mjs && node tests/futuristic-v54.mjs", + "test:login": "node tests/login-contrast.mjs && node --experimental-strip-types tests/workplace-handoff.mjs" }, "dependencies": { "vue": "^3.5.0", diff --git a/hmi-frontend/public/cheerpj-native-loader-test.html b/hmi-frontend/public/cheerpj-native-loader-test.html new file mode 100644 index 0000000..388b760 --- /dev/null +++ b/hmi-frontend/public/cheerpj-native-loader-test.html @@ -0,0 +1,31 @@ + + + + + + WidgetWorkbench V5.10.19 – CheerpJ Java-11-Diagnose + + + + +

CheerpJ Java 11 – Native-Loader-Diagnose

+

Ohne iTAC-JARs, MES-Anmeldedaten oder Änderungen an proprietären Bibliotheken. Alle Tests laufen fest unter Java 11; jeder Link startet einen einzelnen Test in einer frischen Seite.

+
Einzeltests
+
CheerpJ-Release vergleichen (jeweils Java 11)
+

environment JDK/Modul, sysprop Java-Systemeigenschaften, + direct direktes JNI, wwprobe unabhängiger JS-Library-Loader, + jaas JDK-Bibliothek, unix echter UnixSystem-Konstruktor, + bridge Java-Hilfsklasse ohne UnixSystem-Konstruktor. + Ein bestandener Bridge-Test behebt den JDK-Konstruktor nicht.

+
Start noch nicht ausgeführt …
+ +

Bei Missing import: JVM_LoadLibrary bitte zusätzlich die ersten relevanten [NATIVE-LOADER]-Zeilen aus der Browserkonsole sichern. Der Bericht enthält keine MES-Anmeldedaten.

+ + diff --git a/hmi-frontend/public/cheerpj-native-loader-test.js b/hmi-frontend/public/cheerpj-native-loader-test.js new file mode 100644 index 0000000..86e69b0 --- /dev/null +++ b/hmi-frontend/public/cheerpj-native-loader-test.js @@ -0,0 +1,189 @@ +// WidgetWorkbench V5.10.19: self-contained, Java-11-only CheerpJ diagnostics. +// No iTAC JARs, MES calls, credentials or modification of JDK/vendor classes. +import wwprobeNativeHandlers from './cheerpj/natives/wwprobe.js'; + +const out = document.getElementById('result'); +const diagnosticModes = ['environment', 'sysprop', 'direct', 'wwprobe', 'jaas', 'unix', 'bridge']; +const params = new URL(location.href).searchParams; +const mode = diagnosticModes.includes(params.get('mode')) ? params.get('mode') : 'environment'; +const runtime = params.get('runtime') === '4.3' ? '4.3' : '5.0'; +const pathVariant = params.get('path') === 'missing' ? 'missing' : 'normal'; +const nativeRoot = '/backend/hmi/cheerpj/natives'; +const classJar = '/backend/hmi/cheerpj/jaas-native-loader-smoke.jar'; +const bridgeJar = '/backend/hmi/cheerpj/jaas-identity-bridge.jar'; +const logs = []; +let resultCode = null; +let resultStatus = 'NOT_RUN'; +const log = (...parts) => { + const line = parts.map(value => { + if (value === null) return 'null'; + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') return String(value); + return '(Objekt: siehe Konsole)'; + }).join(' '); + logs.push(line); + out.textContent += line + '\n'; + console.info('[WidgetWorkbench/NativeLoaderSmoke]', ...parts); +}; + +function renderModeLinks() { + const links = document.getElementById('modes'); + if (!links) return; + for (const name of diagnosticModes) { + const a = document.createElement('a'); + const url = new URL(location.href); + url.searchParams.set('mode', name); + url.searchParams.set('runtime', runtime); + url.searchParams.delete('path'); + a.href = url.pathname + url.search; + a.textContent = name; + a.setAttribute('aria-current', name === mode ? 'page' : 'false'); + links.appendChild(a); + } + const variants = document.getElementById('runtime-links'); + if (!variants) return; + for (const name of ['5.0', '4.3']) { + const a = document.createElement('a'); + const url = new URL(location.href); + url.searchParams.set('runtime', name); + a.href = url.pathname + url.search; + a.textContent = 'CheerpJ ' + name; + a.setAttribute('aria-current', name === runtime ? 'page' : 'false'); + variants.appendChild(a); + } +} + +function report() { + return [ + 'WidgetWorkbench 5.10.19 - CheerpJ Native Loader Diagnosis', + 'CheerpJ runtime: ' + runtime + ' | Java: 11 | mode: ' + mode, + 'java.library.path variant: ' + pathVariant, + 'Run result: ' + resultStatus + (resultCode !== null ? ' (exit ' + resultCode + ')' : ''), + 'No MES account information or internal URLs are recorded.', + '', + ...logs, + '', + 'NOTE: Java System.out/System.err and JVM_LoadLibrary events appear separately', + 'in the browser developer console. Attach only the relevant [NATIVE-LOADER]', + 'lines when reporting to the runtime vendor.', + ].join('\n'); +} +function installCopyButton() { + const btn = document.getElementById('copy-report'); + if (!btn) return; + btn.addEventListener('click', async () => { + try { + await navigator.clipboard.writeText(report()); + btn.textContent = 'Bericht kopiert'; + } catch (_) { + const blob = new Blob([report()], { type: 'text/plain;charset=utf-8' }); + const obj = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = obj; + a.download = 'cheerpj-native-' + runtime + '-' + mode + '.txt'; + a.click(); + URL.revokeObjectURL(obj); + btn.textContent = 'Bericht als Datei gespeichert'; + } + }); +} + +async function checkResource(url, { range = false, module = false } = {}) { + const resp = await fetch(url, { + credentials: 'same-origin', + cache: 'no-store', + ...(range ? { headers: { Range: 'bytes=0-0' } } : {}), + }); + const type = resp.headers.get('content-type') || '(nicht angegeben)'; + const ranges = resp.headers.get('accept-ranges') || '(nicht angegeben)'; + const contentRange = resp.headers.get('content-range') || '(nicht angegeben)'; + log(url, 'HTTP', resp.status, 'Content-Type:', type, 'Accept-Ranges:', ranges, + range ? 'Content-Range: ' + contentRange : ''); + if (!resp.ok) throw new Error('Datei nicht abrufbar: ' + url + ' (HTTP ' + resp.status + ')'); + if (range && resp.status !== 206) { + throw new Error('Java-JAR unterstützt keinen HTTP-Range-Abruf (HTTP ' + resp.status + '): ' + url); + } + if (range && !/^bytes\s+0-0\/\d+$/i.test(contentRange) && contentRange !== '(nicht angegeben)') { + throw new Error('Ungültige Content-Range für JAR: ' + contentRange); + } + if (module) { + const source = await resp.text(); + if (type.toLowerCase().includes('text/html') || !source.includes('export default') || + !source.includes('Java_com_')) { + throw new Error('JS-Native-Modul fehlt oder Server liefert HTML: ' + url); + } + } else if (resp.body && typeof resp.body.cancel === 'function') { + await resp.body.cancel(); // With Range, never fetch a complete large JAR. + } +} + +async function ensureRuntimeLoader() { + if (typeof cheerpjInit === 'function') { + log('CheerpJ-Loader bereits verfügbar.'); + return; + } + // Only these two fixed release URLs are permitted, never user-supplied URLs. + const url = 'https://cjrtnc.leaningtech.com/' + runtime + '/loader.js'; + log('CheerpJ-Loader:', 'release ' + runtime); + await new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.src = url; + script.onload = () => resolve(); + script.onerror = () => reject(new Error('CheerpJ-Loader nicht erreichbar: release ' + runtime)); + document.head.appendChild(script); + }); + if (typeof cheerpjInit !== 'function') throw new Error('cheerpjInit nach Laden nicht verfügbar'); +} + +async function run() { + resultStatus = 'RUNNING'; + log('V5.10.19 | Modus:', mode, '| Java 11 | CheerpJ:', runtime); + log('Dieser Test ist unabhängig von iTAC und GlassFish-Java-Prozessen.'); + await checkResource(classJar, { range: true }); + if (mode === 'bridge') await checkResource(bridgeJar, { range: true }); + if (mode === 'direct' || mode === 'wwprobe') { + await checkResource(nativeRoot + '/wwprobe.js', { module: true }); + } else if (mode === 'jaas' || mode === 'unix') { + await checkResource(nativeRoot + '/jaas.js', { module: true }); + } + await ensureRuntimeLoader(); + const libPath = pathVariant === 'missing' + ? '/app/backend/hmi/cheerpj/absichtlich-nicht-vorhanden' + : '/app' + nativeRoot; + const settings = { + version: 11, + status: 'none', + javaProperties: ['java.library.path=' + libPath], + }; + if (mode === 'direct') { + settings.natives = wwprobeNativeHandlers; + log('Direkter JNI-Handler registriert. Kein System.loadLibrary.'); + } else { + log('Kein direkter Native-Handler registriert; Isolation des Testmodus.'); + } + await cheerpjInit(settings); + log('CheerpJ Java 11 initialisiert; Testklasse starten …'); + const classpath = '/app' + classJar + (mode === 'bridge' ? ':/app' + bridgeJar : ''); + const code = await cheerpjRunMain('com.widgetworkbench.cheerpj.NativeLoaderSmoke', classpath, mode); + resultCode = typeof code === 'number' ? code : null; + resultStatus = code === 0 ? 'PASS' : 'FAIL'; + log('Java-Exit-Code:', resultCode === null ? 'nicht numerisch' : resultCode); + log('TESTERGEBNIS:', resultStatus); + if (mode === 'direct' && code === 0) { + log('Direct JNI funktioniert. System.loadLibrary/UnixSystem ist dadurch NICHT repariert.'); + } else if (mode === 'bridge' && code === 0) { + log('Java-Bridge funktioniert OHNE UnixSystem-Konstruktor. Kein produktiver Login-Workaround.'); + } + log('Für vollständige Java-Fehlerdetails die [NATIVE-LOADER]-Zeilen aus der Browserkonsole hinzufügen.'); +} + +renderModeLinks(); +installCopyButton(); +out.textContent = ''; +run().catch(error => { + resultStatus = 'ABORT'; + // CheerpJ Java Throwable proxies can fail conversion to String(); preserve original. + console.error('[WidgetWorkbench/NativeLoaderSmoke] Original exception:', error); + const reason = error instanceof Error && typeof error.message === 'string' + ? error.message : 'Java-/Runtime-Exception; Original in der Browserkonsole'; + log('TESTABBRUCH:', reason); +}); diff --git a/hmi-frontend/public/cheerpj-runner.html b/hmi-frontend/public/cheerpj-runner.html index 3e11261..f1bd7d0 100644 --- a/hmi-frontend/public/cheerpj-runner.html +++ b/hmi-frontend/public/cheerpj-runner.html @@ -1,7 +1,20 @@ CheerpJ-Frame | WidgetWorkbench - - + + -
+
diff --git a/hmi-frontend/public/cheerpj-runner.js b/hmi-frontend/public/cheerpj-runner.js index c16bef3..f63446c 100644 --- a/hmi-frontend/public/cheerpj-runner.js +++ b/hmi-frontend/public/cheerpj-runner.js @@ -1,14 +1,115 @@ -/* WidgetWorkbench CheerpJ 4.3 runner. +import jaasNativeHandlers from './cheerpj/natives/jaas.js'; + +/* WidgetWorkbench CheerpJ 5.0 runner (4.3 selectable as a compatibility fallback). * CheerpJ Core has no documented runJNLP(url) API: parse the manifest and run JAR(s). * Deliberately SAME-ORIGIN only. Do not turn this into an open server-side URL proxy. */ const screen=document.getElementById('display'); const notice=document.getElementById('state'); -const BRIDGE_JAR='/app/backend/hmi/cheerpj/workplace-resize-bridge-v2.jar'; +const BRIDGE_JAR='/app/backend/hmi/cheerpj/workplace-window-monitor-v4.jar'; +const CREDENTIAL_BRIDGE_JAR='/app/backend/hmi/cheerpj/workplace-credential-bridge.jar'; +const CREDENTIAL_BRIDGE_URL='/backend/hmi/cheerpj/workplace-credential-bridge.jar'; +let credentialWaiter=null; +// JS implementation for OpenJDK UnixSystem.getUnixInfo. Register the handler via +// cheerpjInit({natives}) AND keep the JS native library for System.loadLibrary. +// Note: registration cannot repair a missing CheerpJ JVM_LoadLibrary import. +const JAAS_JS_URL='/backend/hmi/cheerpj/natives/jaas.js'; +const JAAS_NATIVE_PATH='/app/backend/hmi/cheerpj/natives'; +const JAAS_BRIDGE_JAR='/app/backend/hmi/cheerpj/jaas-identity-bridge.jar'; +// JSON-P 1.1 provider required by iTAC ParameterType; NOT included in Workplace.jnlp. +// Maven packages this dependency as a static WAR resource. +const JSONP_PROVIDER_URL='/backend/hmi/cheerpj-libs/javax.json-1.1.4.jar'; +const JSONP_PROVIDER_JAR='/app'+JSONP_PROVIDER_URL; const WORKPLACE_MANIFEST='/backend/api/hmi/v1/cheerpj/workplace/manifest.jnlp'; // Writable, browser-local CheerpJ directory; never a GlassFish/server filesystem path. const WORKPLACE_TMP_DIR='/files/itac-workplace/tmp'; +// CheerpJ /files is writable. A flat and finally root fallback handle engines +// that cannot create nested directories or previously conflicting user files. +const WORKPLACE_TMP_CANDIDATES=[WORKPLACE_TMP_DIR,'/files/itac-workplace-tmp','/files']; let busy=false; +// Collect the last boot stage so a CheerpJ WASM exit code can be tied to the +// Java startup phase. No credentials, JNLP arguments or MES URLs are logged. +let bootStage='not-started'; +function boot(stage){ + bootStage=stage; + console.info('[WidgetWorkbench/CheerpJ] '+stage); +} +// CheerpJ can reject library-mode calls with a Java Throwable proxy. Such +// objects do NOT necessarily implement JS Symbol.toPrimitive/toString, so +// String(error), a template literal or `'' + error` can replace the original +// JAAS exception with "Cannot convert object to primitive value". +function primitiveText(value){ + switch(typeof value){ + case 'string': return value; + case 'number': case 'boolean': case 'bigint': return String(value); + default: return null; + } +} +async function describeThrowable(error,depth=0,seen=new Set()){ + const direct=primitiveText(error); + if(direct!==null)return direct; + if(error===null||error===undefined)return 'Unbekannte JavaScript-Ausnahme'; + if(depth>2||seen.has(error))return 'Weitere Exception (rekursiv)'; + seen.add(error); + let className=null, message=null, stack=null, cause=null; + try{ + const getClass=error.getClass; + if(typeof getClass==='function'){ + const cls=await getClass.call(error); + if(cls && typeof cls.getName==='function')className=primitiveText(await cls.getName()); + } + }catch(_ignored){ /* Java proxy may not expose class metadata. */ } + try{if(!className)className=primitiveText(error.name);}catch(_ignored){} + try{ + const getMessage=error.getMessage; + if(typeof getMessage==='function')message=primitiveText(await getMessage.call(error)); + }catch(_ignored){ /* Read the original exception below without replacing it. */ } + try{if(!message)message=primitiveText(error.message);}catch(_ignored){} + try{ + if(!message && typeof error.toString==='function'){ + message=primitiveText(await error.toString()); + } + }catch(_ignored){} + try{stack=primitiveText(error.stack);}catch(_ignored){} + try{ + if(typeof error.getCause==='function')cause=await error.getCause(); + else cause=error.cause; + }catch(_ignored){} + let result=[className,message].filter(Boolean).join(': '); + if(!result && stack)result=stack; + if(!result)result='CheerpJ-Java-Exception (nicht als JavaScript-String lesbar)'; + if(cause!==null&&cause!==undefined&&cause!==error) + result+=' | Ursache: '+await describeThrowable(cause,depth+1,seen); + return result.slice(0,900); +} +async function describeFailure(error){ + // Keep the original object accessible in DevTools, not only a reformatted copy. + console.error('[WidgetWorkbench/CheerpJ] Failure in '+bootStage+' (original):',error); + const reason=await describeThrowable(error); + return 'CheerpJ-Start fehlgeschlagen in Phase "'+bootStage+'": '+reason+ + '. Details in der Browser-Konsole (WidgetWorkbench/CheerpJ).'; +} +// Optional browser-JVM probe: ?diagnose=jaas. Only exercised on demand. +// Does not replace the real iTAC authentication or modify vendor JARs. +async function probeJaasRuntime(lib){ + boot('JAAS: UnixSystem-Klasse laden'); + const UnixSystem=await lib.com.sun.security.auth.module.UnixSystem; + boot('JAAS: UnixSystem-Konstruktor (System.loadLibrary)'); + const instance=await new UnixSystem(); + boot('JAAS: UnixSystem.getUsername()'); + const user=await instance.getUsername(); + let identityOk=user==='cheerpj-client'; + // CheerpJ generally passes Java String by value, but guard versions that + // expose a Java proxy instead of coercing that object with String(user). + if(!identityOk && user!=null){ + try{if(typeof user.equals==='function')identityOk=(await user.equals('cheerpj-client'))===true;} + catch(_ignored){} + } + console.info('[WidgetWorkbench/CheerpJ] UnixSystem konstruiert; synthetische Benutzeridentität gültig:',identityOk); + if(!identityOk)throw Error('JAAS-Runtimeprüfung: unerwartete virtuelle Benutzeridentität'); + boot('JAAS-Laufzeittest erfolgreich (UnixSystem)'); +} + const trusted=(raw,base=location.href)=>{ const u=new URL(raw,base); if(u.origin!==location.origin)throw Error('JNLP und alle JARs müssen von derselben Origin wie WidgetWorkbench kommen.'); @@ -69,74 +170,108 @@ function readManifest(xml,jnlpUrl){ * Only the immutable, locally packaged Bridge JAR is loaded; no vendor JAR is modified. * When the JVM has not created MesSuiteFrame yet, retry for a bounded startup window. */ -async function ensureWorkplaceTempDirectory() { - // /app is read-only and /str is read-only to Java. CheerpJ's /files mount - // supports Java writes (IndexedDB, per-browser origin). Create via Java NIO, - // not JavaScript, because JS cannot write directly into /files. - if (typeof window.cheerpjRunLibrary !== 'function') - throw Error('CheerpJ Library Mode für die Temp-Verzeichnisanlage nicht verfügbar.'); - const lib=await window.cheerpjRunLibrary(''); +async function ensureWorkplaceTempDirectory(lib) { + // Use Java NIO through CheerpJ Library Mode. Checking Files.isDirectory() + // with `=== true` is not reliable across CheerpJ versions: the reported + // value can be a bridge wrapper, even when the directory is writable. + // The real requirement for java.io.tmpdir is that Java can create a file. + if (!lib)throw Error('CheerpJ Library Mode für das Temp-Verzeichnis nicht verfügbar.'); const Paths=await lib.java.nio.file.Paths; const Files=await lib.java.nio.file.Files; - const path=await Paths.get(WORKPLACE_TMP_DIR); - try { - await Files.createDirectories(path, []); - if (await Files.isDirectory(path, []) !== true) - throw Error('Pfad ist kein Verzeichnis.'); - // Checking the directory alone is not enough: verify actual write access. - const probe=await Files.createTempFile(path,'hmi-tmp-check-','.tmp',[]); - await Files.deleteIfExists(probe); - } catch(error) { - throw Error('CheerpJ-Temp-Verzeichnis '+WORKPLACE_TMP_DIR+' nicht verfügbar: '+ - (error instanceof Error ? error.message : String(error))); - } -} - -async function attachWorkplaceResize(container, classPath, mode) { - if (typeof window.cheerpjRunLibrary !== 'function') - throw Error('CheerpJ Library Mode für die ResizeBridge nicht verfügbar.'); - const lib=await window.cheerpjRunLibrary(classPath); - const bridge=await lib.com.widgetworkbench.cheerpj.WorkplaceResizeBridge; - let closed=false, inFlight=false, pending=false, lastSize='', retry=0; - let retryTimer=null; - const desired=()=>{ - if(mode==='original')return [1280,1024]; - const size=container.getBoundingClientRect(); - return [Math.max(200,Math.floor(size.width)),Math.max(150,Math.floor(size.height))]; - }; - async function update(){ - if(closed||inFlight){pending=true;return;} - const [width,height]=desired(), size=width+'x'+height; - if(size===lastSize && retry>=24)return; - inFlight=true; + const System=await lib.java.lang.System; + const errors=[]; + for(const candidate of WORKPLACE_TMP_CANDIDATES){ try{ - const found=await bridge.resize(width,height); - // The frame appears asynchronously while cheerpjRunMain is active. - if(Number(found)>0){lastSize=size;retry=24;} + const dir=await Paths.get(candidate); + if(candidate!=='/files')await Files.createDirectories(dir,[]); + // A successful write/delete is stronger proof than isDirectory() and + // works independently of Java boolean conversion in the JS bridge. + const probe=await Files.createTempFile(dir,'hmi-tmp-check-','.tmp',[]); + try{ + const deleted=await Files.deleteIfExists(probe); + if(deleted===false)throw Error('Schreibtestdatei konnte nicht entfernt werden.'); + }catch(cleanupError){ + throw Error('Temporäre Testdatei konnte nicht gelöscht werden: '+await describeThrowable(cleanupError)); + } + // Bootstrap with java.io.tmpdir=/files (always an existing mount point), + // then configure the tested directory before invoking Workplace main(). + await System.setProperty('java.io.tmpdir',candidate); + return candidate; }catch(error){ - console.warn('Workplace resize bridge:',error); - retry=24; - }finally{ - inFlight=false; - if(pending&&!closed){pending=false;void update();} + errors.push(candidate+': '+await describeThrowable(error)); } } - const observer=typeof ResizeObserver!=='undefined' ? new ResizeObserver(()=>{retry=24;void update();}) : null; - observer?.observe(container); - // Retry initialization until first Workplace JFrame is shown, stop after 24 attempts. - retryTimer=setInterval(()=>{ - if(closed||retry>=24){clearInterval(retryTimer);return;} - retry++; - void update(); - },750); - void update(); - return {stop(){closed=true;observer?.disconnect();if(retryTimer)clearInterval(retryTimer);},refresh:()=>update()}; + throw Error('CheerpJ-Temp-Verzeichnis nicht beschreibbar ('+errors.join(' | ')+').'); } +// V5.10.21: Do NOT concurrently call a CheerpJ Library Mode method from +// JS timers. CheerpJ may reject the second invocation with: +// "Java code still running, check for a missing 'await'". +// The Java bridge starts ONE daemon monitor before main(), which handles +// resize and window inspection entirely inside the JVM/AWT thread domain. +// No further JS -> CheerpJ library-mode calls are made while main() runs. +async function attachWorkplaceRuntimeMonitor(container, lib, windowMode, displayMode) { + if(!lib)throw Error('CheerpJ Library Mode für Fensterüberwachung nicht verfügbar.'); + const bridge=await lib.com.widgetworkbench.cheerpj.WorkplaceResizeBridge; + if(typeof bridge.startRuntimeMonitor!=='function') + throw Error('Workplace Window Monitor v4 fehlt: startRuntimeMonitor nicht vorhanden. JAR V5.10.22 prüfen.'); + const panel=document.getElementById('window-diagnostics'); + const output=document.getElementById('window-diagnostics-output'); + const bounds=container.getBoundingClientRect(); + const width=displayMode==='original'?1280:Math.max(200,Math.floor(bounds.width)); + const height=displayMode==='original'?1024:Math.max(150,Math.floor(bounds.height)); + // This is the LAST library-mode method call before cheerpjRunMain(). + // startRuntimeMonitor returns immediately; Java then polls independently. + const started=await bridge.startRuntimeMonitor(width,height,windowMode); + if(Number(started)!==1&&Number(started)!==2) + throw Error('Workplace Window Monitor wurde nicht gestartet (Code '+(primitiveText(started)??'?')+').'); + if(windowMode!=='off'){ + if(panel)panel.hidden=false; + if(output)output.textContent='Java-11-Fensterdiagnose aktiv ('+windowMode+').\n' + +'Ausgabe in der Browser-Konsole: [WidgetWorkbench/WindowGeometry]\n' + +'Die Abfragen laufen im Java-Hintergrundthread, ohne parallele CheerpJ-Library-Aufrufe.\n' + +'MES_LOGIN: NOT_SEEN / CREATED_HIDDEN / VISIBLE_ONSCREEN / VISIBLE_OFFSCREEN.\n' + +'MES_LOGIN_OWNER zeigt das iTAC-Besitzerfenster; COMPONENT_TREE erfasst JInternalFrame/MyDoggy.\n' + +'Eine JAAS UnsatisfiedLinkError kann die Dialogerzeugung verhindern und wird hier NICHT umgangen.'; + } + console.info('[WidgetWorkbench/WindowGeometry] Java-interner Monitor gestartet; ' + +width+'x'+height+'; Modus='+windowMode+'; keine JS-Library-Polling-Aufrufe.'); + return {stop(){ /* Monitor lebt als Java-Daemon bis zum Ende der JVM. */ }}; +} + +// Request secrets only after the JVM has initialized and immediately before +// main(). No URL/query parameters, storage or server-side password endpoint. +async function requestBrowserCredentials(requestId){ + if(window.parent===window)return null; // standalone window has no trusted parent + return new Promise(resolve=>{ + const waiter={requestId,resolve};credentialWaiter=waiter; + const timeout=setTimeout(()=>{ + if(credentialWaiter===waiter){credentialWaiter=null;resolve(null);} + },5000); + waiter.finish=value=>{ + clearTimeout(timeout); + if(credentialWaiter===waiter)credentialWaiter=null; + resolve(value); + }; + window.parent.postMessage({type:'hmi-cheerpj-credential-request',requestId},location.origin); + }); +} +function credentialNativeHandlers(requestId){ + return { + ...jaasNativeHandlers, + // Direct JNI, not System.loadLibrary(). Results contain codes only. + async Java_com_widgetworkbench_cheerpj_WorkplaceCredentialBridge_nativeReport(_lib,_self,code){ + const result=Number(code); + const labels={1:'MES_LOGIN_SUCCESS',2:'MES_LOGIN_REJECTED',3:'ALREADY_AUTHENTICATED',4:'EXPIRED',5:'BRIDGE_ERROR'}; + console.info('[WidgetWorkbench/WorkplaceAuth]',labels[result]||'UNKNOWN_RESULT'); + if(window.parent!==window)window.parent.postMessage({type:'hmi-cheerpj-auth-result',requestId,code:result},location.origin); + } + }; +} function status(requestId,state,message){ const text=String(message).slice(0,350); notice.textContent=text;notice.className=state==='error'?'fail':''; - parent.postMessage({type:'hmi-cheerpj-state',requestId,state,message:text},location.origin); + if(window.parent!==window)parent.postMessage({type:'hmi-cheerpj-state',requestId,state,message:text},location.origin); } async function start(e,data){ const id=data.requestId; @@ -148,6 +283,11 @@ async function start(e,data){ if(![8,11,17].includes(version))throw Error('Ungültige Java-Version.'); const isWorkplace=data.workplace===true && url.pathname===WORKPLACE_MANIFEST; const displayMode=data.displayMode==='original'?'original':'fit'; + const params=new URL(location.href).searchParams; + const rawWindowMode=data.windowMode ?? params.get('windows'); + const windowMode=isWorkplace && ['off','diagnose','rescue'].includes(rawWindowMode) + ? rawWindowMode : (isWorkplace ? 'diagnose' : 'off'); + boot('JNLP-Abruf'); status(id,'loading','JNLP wird gelesen …'); const r=await fetch(url.href,{credentials:'same-origin',redirect:'follow',cache:'no-store'}); if(!r.ok||!r.url||trusted(r.url).origin!==location.origin)throw Error('JNLP nicht abrufbar (HTTP '+r.status+').'); @@ -158,45 +298,165 @@ async function start(e,data){ if(typeof window.cheerpjInit!=='function'){ await new Promise((resolve,reject)=>{let count=0;const timer=setInterval(()=>{if(typeof window.cheerpjInit==='function'){clearInterval(timer);resolve();}else if(++count>150){clearInterval(timer);reject(Error('CheerpJ CDN nicht erreichbar oder durch CSP blockiert.'));}},100);}); } + // Keep a single JVM library context for tmp, optional JAAS diagnostics and + // ResizeBridge: CheerpJ allows only one library thread in this configuration. + const cp=manifest.paths.join(':')+(isWorkplace + ? ':'+JSONP_PROVIDER_JAR+':'+JAAS_BRIDGE_JAR+':'+CREDENTIAL_BRIDGE_JAR+':'+BRIDGE_JAR : ''); + const diag=new URL(location.href).searchParams.get('diagnose'); + // Explicitly verify native JavaScript is delivered before VM initialization; + // a successful HTTP response alone does NOT guarantee System.loadLibrary works. + if(isWorkplace){ + boot('JAAS-JavaScript abrufen'); + const nativeResponse=await fetch(JAAS_JS_URL,{credentials:'same-origin',cache:'no-store'}); + if(!nativeResponse.ok)throw Error('JAAS-Kompatibilitätsmodul fehlt (HTTP '+nativeResponse.status+').'); + if(typeof jaasNativeHandlers?.Java_com_sun_security_auth_module_UnixSystem_getUnixInfo!=='function') + throw Error('JAAS-JavaScript enthält keine gültige UnixSystem-JNI-Implementierung.'); + } // JNLP URL query parameters are not Java system properties. - // CheerpJ 4.3 supplies -D equivalents through javaProperties. + // CheerpJ supplies -D equivalents through javaProperties. const javaProperties=isWorkplace && manifest.clusterNodes ? ['itac.artes.clusternodes='+manifest.clusterNodes] : []; - if(isWorkplace)javaProperties.push('java.io.tmpdir='+WORKPLACE_TMP_DIR); - await window.cheerpjInit({version,status:'none',javaProperties}); + // /files exists already when the Java VM initializes; choose the actual + // writable subdirectory after probing, before launching the application. if(isWorkplace){ - status(id,'loading','Virtuelles Workplace-Temp-Verzeichnis wird vorbereitet …'); - await ensureWorkplaceTempDirectory(); + javaProperties.push('java.io.tmpdir=/files'); + // Must be present at VM initialization: UnixSystem() calls loadLibrary("jaas") + // before running its private native method getUnixInfo(). + javaProperties.push('java.library.path='+JAAS_NATIVE_PATH); } + boot('CheerpJ-Initialisierung'); + await window.cheerpjInit({version,status:'none',javaProperties, + ...(isWorkplace ? {natives:credentialNativeHandlers(id)} : {})}); + boot('CheerpJ initialisiert'); + let sharedLib=null; + if(isWorkplace){ + boot('Gemeinsamen Java-Library-Kontext starten'); + sharedLib=await window.cheerpjRunLibrary(cp); + status(id,'loading','Virtuelles Workplace-Temp-Verzeichnis wird vorbereitet …'); + boot('Temp-Verzeichnis prüfen'); + const tempDir=await ensureWorkplaceTempDirectory(sharedLib); + if(tempDir!==WORKPLACE_TMP_DIR)manifest.warnings.push('Temp-Ausweichverzeichnis: '+tempDir+'.'); + } + boot('Java-Anzeigefläche vorbereiten'); if(isWorkplace && displayMode==='original'){ document.body.classList.add('cheerpj-original-mode'); window.cheerpjCreateDisplay(1280,1024,screen); }else{ window.cheerpjCreateDisplay(-1,-1,screen); } - let resizeBridge=null; - let cp=manifest.paths.join(':'); + let windowMonitor=null; if(isWorkplace){ - cp+=':'+BRIDGE_JAR; + // Range probe catches a missing WAR-bundled provider (or server-side + // Range misconfiguration) before Java reports opaque ExceptionInInitializerError. + boot('JSON-P-JAR prüfen'); + const jsonpProbe=await fetch(JSONP_PROVIDER_URL,{ + credentials:'same-origin',cache:'no-store',headers:{Range:'bytes=0-0'} + }); + if(jsonpProbe.status!==206){ + throw Error('JSON-P-Provider im WAR fehlt oder unterstützt kein HTTP Range ' + +'(HTTP '+jsonpProbe.status+'). Maven-Build und ' + +'hmi/cheerpj-libs/javax.json-1.1.4.jar prüfen.'); + } + // Validate the helper JAR before Java main(); the native JS module has + // already been registered via cheerpjInit({natives}) above. + boot('JAAS-Bridge-JAR prüfen'); + const bridgeProbe=await fetch(JAAS_BRIDGE_JAR.slice(4),{ + credentials:'same-origin',cache:'no-store',headers:{Range:'bytes=0-0'} + }); + if(bridgeProbe.status!==206)throw Error('JAAS-Java-Hilfsklasse nicht als JAR abrufbar ' + +'(HTTP '+bridgeProbe.status+'). hmi/cheerpj/jaas-identity-bridge.jar prüfen.'); + // The vendor JNLP contains javax.json API but not its implementation. + // Keep proprietary JARs untouched; helpers are part of the shared cp. + if(diag==='jaas' || diag==='jaas-only'){ + try{ + await probeJaasRuntime(sharedLib); + }catch(error){ + console.error('[WidgetWorkbench/CheerpJ] JAAS-Laufzeittest Original-Exception:',error); + const msg=await describeThrowable(error); + throw Error('JAAS-Laufzeittest fehlgeschlagen. '+msg+'; ' + +'falls JVM_LoadLibrary oder no jaas in java.library.path gemeldet wird, ' + +'liegt das Problem bereits beim nativen Library-Loader der CheerpJ-JVM.', + {cause:error}); + } + if(diag==='jaas-only'){ + boot('JAAS-Laufzeittest erfolgreich – kein Workplace-Start'); + status(id,'finished','JAAS UnixSystem erfolgreich initialisiert. Workplace nicht gestartet (Diagnosemodus).'); + return; + } + } + if(data.browserCredentials===true){ + boot('Einmalige Browser-Anmeldung vorbereiten'); + const credentials=await requestBrowserCredentials(id); + if(credentials){ + // Probe only when a one-time offer was made. Server must support Range. + const credentialProbe=await fetch(CREDENTIAL_BRIDGE_URL,{ + credentials:'same-origin',cache:'no-store',headers:{Range:'bytes=0-0'} + }); + if(credentialProbe.status!==206){ + status(id,'loading','Workplace-Anmeldebridge ist nicht verfügbar; normaler Login bleibt aktiv.'); + }else{ + try{ + const authBridge=await sharedLib.com.widgetworkbench.cheerpj.WorkplaceCredentialBridge; + const accepted=await authBridge.offer(credentials.username,credentials.password,credentials.client); + if(Number(accepted)!==1)throw Error('Einmalige Anmeldung wurde von der Java-Bridge abgelehnt.'); + // No success claim until the Java nativeReport callback reports code 1. + console.info('[WidgetWorkbench/WorkplaceAuth] One-shot offer accepted; waiting for PersonService'); + }catch(error){ + console.warn('[WidgetWorkbench/WorkplaceAuth] Übergabe fehlgeschlagen (Zugangsdaten und Exception werden nicht protokolliert).'); + status(id,'loading','Workplace-Übergabe fehlgeschlagen; manueller MES-Login bleibt möglich.'); + } + } + }else{ + console.info('[WidgetWorkbench/WorkplaceAuth] Keine Browser-Zugangsdaten angeboten; normaler MES-Login.'); + } + } + boot('Java-internen Swing-Fenstermonitor starten ('+windowMode+')'); try{ - resizeBridge=await attachWorkplaceResize(screen,cp,displayMode); + windowMonitor=await attachWorkplaceRuntimeMonitor(screen,sharedLib,windowMode,displayMode); }catch(error){ - console.warn('Optional Workplace ResizeBridge unavailable:',error); - manifest.warnings.push('ResizeBridge konnte nicht gestartet werden; Anzeige bleibt nutzbar, interne Größe möglicherweise fix.'); + console.warn('[WidgetWorkbench/WindowGeometry] Java-interner Monitor nicht verfügbar:',error); + manifest.warnings.push('Fenstermonitor nicht verfügbar; Workplace-Start wird fortgesetzt.'); } } + boot('iTAC Workplace main(): '+(manifest.main?'Startklasse vorhanden':'JAR-Start')); status(id,'running','Java-Anwendungsstart wird versucht. '+manifest.warnings.join(' ')); try{ const exitCode=manifest.main ? await window.cheerpjRunMain(manifest.main,cp,...manifest.args) : await window.cheerpjRunJar(manifest.paths[0],...manifest.args); + boot('Java main() beendet'); status(id,'finished','Anwendung beendet (Exit-Code '+exitCode+').'); - }finally{resizeBridge?.stop();} - }catch(error){status(id,'error',error instanceof Error?error.message:String(error));} + }finally{windowMonitor?.stop();} + }catch(error){status(id,'error',await describeFailure(error));} } window.addEventListener('message',event=>{ if(event.source!==window.parent||event.origin!==location.origin)return; const data=event.data; - if(!data||data.type!=='hmi-cheerpj-launch'||typeof data.requestId!=='string'||data.requestId.length>150)return; - void start(event,data); + if(!data||typeof data.requestId!=='string'||data.requestId.length>150)return; + if(data.type==='hmi-cheerpj-credentials'||data.type==='hmi-cheerpj-credentials-unavailable'){ + const waiter=credentialWaiter; + if(!waiter||waiter.requestId!==data.requestId)return; + if(data.type==='hmi-cheerpj-credentials-unavailable'){waiter.finish(null);return;} + if(typeof data.username!=='string'||!data.username||data.username.length>120 + ||typeof data.password!=='string'||!data.password||data.password.length>1024 + ||typeof data.client!=='string'||!data.client||data.client.length>120)return; + waiter.finish({username:data.username,password:data.password,client:data.client}); + return; + } + if(data.type==='hmi-cheerpj-launch')void start(event,data); }); + +// Direct, full-window workplace mode. This URL is deliberately limited to the +// fixed authenticated MES JNLP bridge. No arbitrary JNLP or Java class name +// can be supplied through query parameters. +if(new URL(location.href).searchParams.get('standalone')==='workplace'){ + document.body.classList.add('cheerpj-standalone'); + void start(null,{ + requestId:'standalone-workplace', + jnlpUrl:new URL(WORKPLACE_MANIFEST,location.href).href, + javaVersion:11, + workplace:true, + displayMode:'fit', + windowMode:new URL(location.href).searchParams.get('windows') + }); +} diff --git a/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar b/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar new file mode 100644 index 0000000..c307038 Binary files /dev/null and b/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar differ diff --git a/hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar b/hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar new file mode 100644 index 0000000..f3d43e7 Binary files /dev/null and b/hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar differ diff --git a/hmi-frontend/public/cheerpj/natives/jaas.js b/hmi-frontend/public/cheerpj/natives/jaas.js new file mode 100644 index 0000000..1d9106e --- /dev/null +++ b/hmi-frontend/public/cheerpj/natives/jaas.js @@ -0,0 +1,27 @@ +/* + * Virtual OpenJDK 11 `jaas` library for CheerpJ Workplace. + * JDK UnixSystem() calls System.loadLibrary("jaas") followed by native + * getUnixInfo(). This module supplies only that native method and delegates + * protected-field initialization to our unsigned, non-vendor Java helper. + * + * Not an authentication provider: users must still authenticate to iTAC MES. + * This handler is registered with cheerpjInit({natives}) in addition to being + * exported as a System.loadLibrary("jaas") module. Registering the method + * does not itself make JVM_LoadLibrary available in the CheerpJ runtime. + */ +export default { + async Java_com_sun_security_auth_module_UnixSystem_getUnixInfo(lib, self) { + if (!lib || !self) { + throw new Error('CheerpJ JAAS bridge: missing native context'); + } + const helper = await lib.com.widgetworkbench.cheerpj.JaasIdentityBridge; + if (!helper || typeof helper.populate !== 'function') { + throw new Error('CheerpJ JAAS bridge JAR is not on the Workplace classpath'); + } + console.info('[WidgetWorkbench/JAAS] UnixSystem.getUnixInfo native invoked'); + const username = await helper.populate(self); + if (username !== 'cheerpj-client') { + throw new Error('CheerpJ JAAS bridge returned an unexpected identity'); + } + }, +}; diff --git a/hmi-frontend/public/cheerpj/natives/wwprobe.js b/hmi-frontend/public/cheerpj/natives/wwprobe.js new file mode 100644 index 0000000..38006e8 --- /dev/null +++ b/hmi-frontend/public/cheerpj/natives/wwprobe.js @@ -0,0 +1,10 @@ +// Self-contained native-library-loader diagnostic; no MES authentication or system identity. +// Loaded EITHER by System.loadLibrary("wwprobe") from java.library.path OR +// injected directly through cheerpjInit({natives}) in the isolated direct test. +// The direct path does not repair JVM_LoadLibrary and does not affect JAAS. +export default { + async Java_com_widgetworkbench_cheerpj_NativeLoaderSmoke_ping() { + console.info('[WidgetWorkbench/NativeLoaderSmoke] wwprobe.js JNI callback reached'); + return 42; + } +}; diff --git a/hmi-frontend/public/cheerpj/workplace-credential-bridge.jar b/hmi-frontend/public/cheerpj/workplace-credential-bridge.jar new file mode 100644 index 0000000..060458f Binary files /dev/null and b/hmi-frontend/public/cheerpj/workplace-credential-bridge.jar differ diff --git a/hmi-frontend/public/cheerpj/workplace-resize-bridge-v2.jar b/hmi-frontend/public/cheerpj/workplace-resize-bridge-v2.jar index 377dff0..feee7c3 100644 Binary files a/hmi-frontend/public/cheerpj/workplace-resize-bridge-v2.jar and b/hmi-frontend/public/cheerpj/workplace-resize-bridge-v2.jar differ diff --git a/hmi-frontend/public/cheerpj/workplace-window-monitor-v3.jar b/hmi-frontend/public/cheerpj/workplace-window-monitor-v3.jar new file mode 100644 index 0000000..6a48a01 Binary files /dev/null and b/hmi-frontend/public/cheerpj/workplace-window-monitor-v3.jar differ diff --git a/hmi-frontend/public/cheerpj/workplace-window-monitor-v4.jar b/hmi-frontend/public/cheerpj/workplace-window-monitor-v4.jar new file mode 100644 index 0000000..fb0a653 Binary files /dev/null and b/hmi-frontend/public/cheerpj/workplace-window-monitor-v4.jar differ diff --git a/hmi-frontend/src/App.vue b/hmi-frontend/src/App.vue index b082e15..1afc246 100644 --- a/hmi-frontend/src/App.vue +++ b/hmi-frontend/src/App.vue @@ -15,6 +15,7 @@ import WidgetCodeEditor from './WidgetCodeEditor.vue'; import {makeExportPackage,parseWidgetPackage} from './widgetPackage'; import {widgetCatalog,createWidget} from './widgets/catalog'; import {presets,buildPreset,type PresetName} from './widgets/presets'; +import {offerWorkplaceCredentials,clearWorkplaceCredentials} from './workplaceHandoff'; type Mode = 'run'|'personal'|'template'; const identity=ref(null); @@ -25,6 +26,8 @@ const warning=ref(''); const loginUser=ref(''); const loginPassword=ref(''); const loginBusy=ref(false); +const secureWorkplaceHandoff=window.location.protocol==='https:' || ['localhost','127.0.0.1'].includes(window.location.hostname); +const workplaceAutoLogin=ref(secureWorkplaceHandoff); // consent; never persist const firstAdminCode=ref(''); const firstAdminPerson=ref(''); const firstAdminBusy=ref(false); @@ -259,7 +262,11 @@ async function startLogin(){ if(loginBusy.value)return; loginBusy.value=true; try{ + clearWorkplaceCredentials(); identity.value=await imsapiLogin(loginUser.value,loginPassword.value,station.value); + // Only after successful IMSAPI authentication; the ephemeral offer is consumed + // exactly once by the Workplace frame or expires automatically. + if(workplaceAutoLogin.value)offerWorkplaceCredentials(loginUser.value,loginPassword.value,'any'); loginPassword.value='';authIssue.value=null;warning.value=''; localStorage.setItem('hmi.stationNumber',station.value); if(identity.value.schemaReady === false){authIssue.value='database';warning.value='HMI-Datenbank ist nicht bereit. Die Systemdiagnose ist jetzt ohne Administratorrolle verfügbar.';return;} @@ -268,6 +275,7 @@ async function startLogin(){ finally{loginBusy.value=false;} } async function logout(){ + clearWorkplaceCredentials(); try{await imsapiLogout();}catch(e){warning.value=String(e);}finally{ identity.value=null;loginPassword.value='';authIssue.value='login';pages.value=[];activePage.value=null;widgets.value=[]; } @@ -545,6 +553,7 @@ onBeforeUnmount(()=>{delete document.body.dataset.hmiTheme;window.removeEventLis + diff --git a/hmi-frontend/src/ios-widget.css b/hmi-frontend/src/ios-widget.css index da10600..cc1db98 100644 --- a/hmi-frontend/src/ios-widget.css +++ b/hmi-frontend/src/ios-widget.css @@ -114,3 +114,13 @@ .widget-search{padding:9px 12px;border:1px solid var(--line);background:var(--input);color:var(--text);width:100%;border-radius:8px;margin-top:6px} .wb-value-pill{font-weight:700;border-radius:7px;padding:4px 10px;display:inline-block;font-size:.9em}.wb-value-pill.on{color:#16825b;background:#dcf6e8}.wb-value-pill.off{color:#a76122;background:#fff0d8} + +/* V5.10.23 Workplace one-shot credentials (never displayed after submission). */ +.cheerpj-workplace-login{margin:6px 0;color:var(--itac-text,#dbeaf3)} +.cheerpj-workplace-login summary{cursor:pointer;font-weight:600;padding:4px} +.cheerpj-workplace-login-fields{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin:8px 0} +.cheerpj-workplace-login-fields label{display:flex;flex-direction:column;gap:3px;min-width:120px} +.cheerpj-workplace-login-fields input{background:#152532!important;color:#fff!important;border:1px solid #5b8396;border-radius:5px;padding:7px} +.cheerpj-workplace-login-fields button{border:1px solid #42798b;border-radius:5px;background:#183948;color:#fff;padding:8px;cursor:pointer} +.cheerpj-workplace-login small{color:#bbd1d9} +.workplace-handoff-optin{display:flex;gap:8px;align-items:center} diff --git a/hmi-frontend/src/style.css b/hmi-frontend/src/style.css index 6c06fc3..176a997 100644 --- a/hmi-frontend/src/style.css +++ b/hmi-frontend/src/style.css @@ -4,11 +4,33 @@ .hmi-diagnostic-notice strong{font-size:1.07em}.hmi-diagnostic-notice p{color:var(--muted);line-height:1.45}.diagnostic-line{font-family:ui-monospace,monospace;font-size:.85em}.diagnostic-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center} .diagnostic-actions a{display:inline-block;text-decoration:none} -/* IMSAPI login: iOS tokens inherited from existing ios.css design. */ +/* IMSAPI-Anmeldung: Vordergrund und Hintergrund verwenden immer dasselbe + Themesystem. Kein geerbtes Textweiß auf einem hellen iOS-Eingabefeld. */ .hmi-mes-login{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:14px 0} -.hmi-mes-login label{display:grid;gap:5px;font-size:.85rem;min-width:165px;flex:1} -.hmi-mes-login input{background:var(--hmi-surface,#182a40);color:inherit;border:1px solid var(--hmi-line,#41556b);border-radius:10px;padding:10px 12px;max-width:100%} -.hmi-mes-login .primary-button{min-height:40px} +.hmi-mes-login label{display:grid;gap:5px;font-size:.85rem;min-width:165px;flex:1;color:var(--text)} +.hmi-diagnostic-notice .hmi-mes-login input{ + display:block;width:100%;max-width:100%;min-height:42px; + background:var(--input);color:var(--text);caret-color:var(--text); + border:1px solid var(--line);border-radius:10px;padding:10px 12px; + font:inherit;box-shadow:none; +} +.hmi-diagnostic-notice .hmi-mes-login input::placeholder{color:var(--muted);opacity:1} +.hmi-diagnostic-notice .hmi-mes-login input:focus-visible{ + outline:2px solid var(--hmi-accent);outline-offset:2px; + border-color:var(--hmi-accent); +} +/* Browser-Autofill (Chrome/Edge/Safari): Text und Hintergrund bleiben lesbar. */ +.hmi-diagnostic-notice .hmi-mes-login input:-webkit-autofill, +.hmi-diagnostic-notice .hmi-mes-login input:-webkit-autofill:hover, +.hmi-diagnostic-notice .hmi-mes-login input:-webkit-autofill:focus{ + -webkit-text-fill-color:var(--text); + -webkit-box-shadow:0 0 0 1000px var(--input) inset; + caret-color:var(--text); + transition:background-color 9999s ease-out 0s; +} +.shell.ios .hmi-mes-login input,.shell.light .hmi-mes-login input{color-scheme:light} +.shell.dark .hmi-mes-login input,.shell.neon .hmi-mes-login input{color-scheme:dark} +.hmi-mes-login .primary-button{min-height:42px} /* V5 Page-Designer widgets share the existing iOS/iTAC design tokens. */ .hmi-heading-frame{display:flex;flex-direction:column;justify-content:center;gap:5px;width:100%;height:100%;min-height:65px;border:1px solid;box-sizing:border-box;padding:18px 22px;overflow:hidden} @@ -74,3 +96,13 @@ .hmi-widget-revisions select,.hmi-widget-revisions input{max-width:100%;min-width:0} .hmi-widget-edit-fieldset{border:0;margin:0;padding:0;min-width:0;display:contents} .hmi-widget-edit-fieldset[disabled]{opacity:.58} + +/* CheerpJ Workplace: runtime switch and a dedicated window for Swing dialogs. */ +.cheerpj-toolbar .cheerpj-open-window{display:inline-flex;align-items:center;text-decoration:none;font-size:11px;border:1px solid #39819a;background:#153544;color:#d0f2fa;border-radius:7px;padding:4px 7px;white-space:nowrap} +.cheerpj-toolbar .cheerpj-open-window:hover{border-color:#75d7f5;background:#204b61} +.cheerpj-runtime-picker{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:var(--text,#d8ecf2)} +.cheerpj-runtime-picker select{color:#e9f9ff;background:#143645;border:1px solid #39819a;border-radius:6px;padding:3px 4px;font-size:11px} +.cheerpj-runtime-picker select:focus-visible,.cheerpj-toolbar .cheerpj-open-window:focus-visible{outline:2px solid #79d4e9;outline-offset:2px} + +.cheerpj-toolbar{flex-wrap:wrap} +.cheerpj-toolbar .cheerpj-caption{min-width:0} diff --git a/hmi-frontend/src/widgets/CheerpJWidget.vue b/hmi-frontend/src/widgets/CheerpJWidget.vue index 6723b20..7190b84 100644 --- a/hmi-frontend/src/widgets/CheerpJWidget.vue +++ b/hmi-frontend/src/widgets/CheerpJWidget.vue @@ -2,6 +2,7 @@ import {computed, ref, watch, onBeforeUnmount} from 'vue'; import type {HmiWidget} from '../types'; import {shouldAutoStartWidget} from './cheerpjAutoStart'; +import {takeWorkplaceCredentials,offerWorkplaceCredentials} from '../workplaceHandoff'; const props = defineProps<{widget:HmiWidget;demo:boolean}>(); const url = computed(()=>String(props.widget.props.jnlpUrl||'').trim()); @@ -10,11 +11,22 @@ const autoStartEnabled = computed(()=>shouldAutoStartWidget(props.widget.type,pr const javaVersion = computed(()=>[8,11,17].includes(Number(props.widget.props.javaVersion))?Number(props.widget.props.javaVersion):8); const windowProtocolWarning = window.location.protocol==='http:' && !['localhost','127.0.0.1'].includes(window.location.hostname); const displayMode = computed(()=>['fit','original'].includes(String(props.widget.props.displayMode))?String(props.widget.props.displayMode):'fit'); +const windowMode = ref<'off'|'diagnose'|'rescue'>('diagnose'); // Client-only; no vendor settings changed. const launchRequested = ref(false); const failure = ref(''); const status = ref(''); +const workplaceAuthStatus=ref(''); +const manualUser=ref(''); +const manualPassword=ref(''); +const manualClient=ref('any'); +const secureTransfer=window.location.protocol==='https:' || ['localhost','127.0.0.1'].includes(window.location.hostname); const sequence = ref(0); const frame = ref(null); +// Newer CheerpJ provides improved Java 11/AWT support. The previous runtime +// remains selectable while vendor application compatibility is assessed. +const runtimeVersion = ref<'5.0'|'4.3'>(workplace.value ? '5.0' : '4.3'); +const frameSrc = computed(()=>'/backend/hmi/cheerpj-runner.html?runtime='+runtimeVersion.value); +const standaloneHref = computed(()=>'/backend/hmi/cheerpj-runner.html?standalone=workplace&runtime='+runtimeVersion.value+'&windows='+windowMode.value); const requestId = computed(()=>`${props.widget.id}-${sequence.value}`); function validate():string { @@ -31,26 +43,75 @@ function validate():string { return ''; } function launch(){ - failure.value=validate();status.value=''; + failure.value=validate();status.value='';workplaceAuthStatus.value=''; if(failure.value || props.demo)return; sequence.value+=1;launchRequested.value=true; } function stop(){launchRequested.value=false;status.value='';} +function setWindowMode(event:Event){ + const selected=(event.target as HTMLSelectElement).value; + const next=selected==='rescue'?'rescue':selected==='off'?'off':'diagnose'; + if(windowMode.value===next)return; + windowMode.value=next; + if(launchRequested.value){stop();launch();} +} +function setRuntime(event:Event){ + const selected=(event.target as HTMLSelectElement).value; + const next=selected==='4.3'?'4.3':'5.0'; + if(runtimeVersion.value===next)return; + runtimeVersion.value=next; + if(launchRequested.value){stop();launch();} +} async function openFullscreen(){ const host=document.getElementById('cheerpj-'+props.widget.id); if(host?.requestFullscreen)await host.requestFullscreen(); } function onFrameLoad(){ if(!frame.value||!launchRequested.value)return; - frame.value.contentWindow?.postMessage({type:'hmi-cheerpj-launch',requestId:requestId.value,jnlpUrl:new URL(url.value,window.location.origin).href,javaVersion:javaVersion.value,workplace:workplace.value,displayMode:displayMode.value},window.location.origin); + frame.value.contentWindow?.postMessage({type:'hmi-cheerpj-launch',requestId:requestId.value,jnlpUrl:new URL(url.value,window.location.origin).href,javaVersion:javaVersion.value,workplace:workplace.value,displayMode:displayMode.value,windowMode:windowMode.value,browserCredentials:workplace.value && secureTransfer},window.location.origin); +} +function offerManualWorkplaceLogin(){ + if(!secureTransfer){workplaceAuthStatus.value='Passwortübergabe erfordert HTTPS.';return;} + if(!manualUser.value.trim()||!manualPassword.value||!manualClient.value.trim()){ + workplaceAuthStatus.value='Bitte Benutzer, Passwort und Mandant angeben.';return; + } + offerWorkplaceCredentials(manualUser.value.trim(),manualPassword.value,manualClient.value.trim()); + manualPassword.value='';workplaceAuthStatus.value='Anmeldung einmalig vorgemerkt. Workplace neu starten, falls er bereits läuft.'; + if(launchRequested.value){stop();launch();} } function onMessage(e:MessageEvent){ if(e.origin!==window.location.origin||e.source!==frame.value?.contentWindow)return; const data=e.data; - if(!data||data.type!=='hmi-cheerpj-state'||data.requestId!==requestId.value)return; + if(!data||data.requestId!==requestId.value)return; + if(!workplace.value && data.type!=='hmi-cheerpj-state')return; + if(data.type==='hmi-cheerpj-credential-request'){ + // Only the explicitly selected, same-origin iframe can consume the offer. + // Never hand credentials to an unrelated JNLP widget or an arbitrary frame. + const credentials=secureTransfer?takeWorkplaceCredentials():null; + if(credentials){ + frame.value?.contentWindow?.postMessage({type:'hmi-cheerpj-credentials',requestId:requestId.value, + username:credentials.username,password:credentials.password,client:credentials.client},window.location.origin); + workplaceAuthStatus.value='Zugangsdaten an Workplace übergeben; MES-Anmeldung wird geprüft.'; + }else{ + frame.value?.contentWindow?.postMessage({type:'hmi-cheerpj-credentials-unavailable',requestId:requestId.value},window.location.origin); + workplaceAuthStatus.value='Keine einmaligen Browser-Anmeldedaten vorhanden. Bei Bedarf unten erneut eingeben.'; + } + return; + } + if(data.type==='hmi-cheerpj-auth-result'){ + const state=Number(data.code); + workplaceAuthStatus.value=state===1?'Workplace-MES-Anmeldung erfolgreich bestätigt.' + :state===2?'Workplace-MES-Anmeldung abgelehnt. Anmeldedaten prüfen.' + :state===3?'Workplace hatte bereits eine eigene MES-Anmeldung.' + :state===4?'Workplace-Anmeldedaten abgelaufen oder MES-Service nicht bereit.' + :'Workplace-Anmeldebridge fehlgeschlagen. Konsole prüfen.'; + return; + } + if(data.type!=='hmi-cheerpj-state')return; status.value=String(data.message||'').slice(0,350); if(data.state==='error')failure.value=status.value; } + // The workplace starts automatically in runtime, also for legacy templates with autoStart:false. // The designer never starts a VM. A manual stop lasts until the widget/page is reopened. watch([url,javaVersion,displayMode],()=>{ @@ -70,16 +131,40 @@ onBeforeUnmount(()=>window.removeEventListener('message',onMessage));
{{String(widget.props.title||'JNLP-Anwendung')}} {{workplace?'iTAC Workplace · ':''}}CheerpJ {{javaVersion}} + + + ↗ Eigenes Fenster
-
Java 11 · 129 JARs · ResizeBridge V2 · native RXTX-Treiber/JNLP-JVM-Optionen sind nicht garantiert.
+
Java 11 · „Fenster: Diagnose“ protokolliert virtuelle Bildschirmgrenzen und alle Swing-Dialoge. „Dialoge zurückholen“ korrigiert nur außerhalb liegende sichtbare JDialogs; ein JAAS-Fehler wird dadurch nicht behoben.
+ +

{{workplaceAuthStatus}}

HTTP aktiv: Anmeldedaten und MES-Daten sind nicht transportverschlüsselt. Nur in geschützten Netzen einsetzen.
☕ CheerpJ-Vorschau: Der Java-Client wird erst im Werker-Modus gestartet.{{url||'JNLP-Adresse noch nicht konfiguriert'}}
☕ JNLP-Anwendung starten{{url||'Bitte eine JNLP-URL im Designer hinterlegen'}}
-