diff --git a/CHANGELOG.md b/CHANGELOG.md index 802d0872..7e8b4705 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is loosely inspired by Keep a Changelog. ### Added +- **Web 0.14.10, Struktogramm area in green:** the colour of the Struktogramm area (top edge, slim strip, name on the exercise card) is now green #2b8a3e instead of blue, so it stands apart from the blue buttons and links; Code stays violet. The Struktogramm area now has a heading „Struktogramm“ in green above its tools, like „Code“ in violet. - **Web 0.14.9, Margaret Hamilton and Hedy Lamarr with photo:** lesson 22 (try and catch) gets an Angeberwissen box on Margaret Hamilton: during the Apollo 11 landing in 1969 the onboard computer raised the alarms 1202 and 1201 but did not crash, because her team's software recognised the overload and kept only the most important jobs running; she called her work „software engineering“. Photo 1969 next to the printed Apollo programs (Draper Laboratory, Commons „Margaret Hamilton - restoration.jpg“, PD-US-no notice, 300×400). Lesson 15 (arrays) gets an Angeberwissen box on Hedy Lamarr: 1942 patent with George Antheil, sender and receiver hop through the same list of 88 frequencies in the same order (like a loop through an array), today's frequency hopping e.g. in Bluetooth; worded as an important forerunner, not the sole inventor. Publicity photo 1944 (Commons „Hedy Lamarr Publicity Photo for The Heavenly Body 1944.jpg“, PD-US-no notice, 300×400). de/en/pt. - **Web 0.14.8, Katherine Johnson with photo:** lesson 7 step „Der Schreibtischtest“ gets an Angeberwissen box: „Computer“ used to be a job; in 1962 John Glenn asked Katherine Johnson to check the IBM computer's orbit calculation by hand before he flew (a real desk check); the toilet scene from „Hidden Figures“ is marked as exaggerated by the film; her colleague Dorothy Vaughan taught herself and her team FORTRAN. Followed by her portrait (NASA 1983, public domain, Commons „Katherine_Johnson_1983.jpg“, 300×400) (de/en/pt). - **Web 0.14.7, area „Code“ and area colours:** the area „Programmieren“ is now called „Code“ (en „Code“, pt „Código“) in the app, all lessons, VisuBot lessons, tasks and glossary. Struktogramm and Code each have a colour (blue #007aff, violet #7c3aed): a coloured top edge, the slim strip when collapsed, and the area names on the exercise card („Löse diese Übung im Struktogramm und im Code.“). New exercise key `bereich: struktogramm | code | beide`: the card names the area(s) and „Im Editor öffnen“ shows exactly those: the lessons stay open, everything else (files, mBot2 live, the other area) is closed. Lesson 20 „Countdown“ and „Fakultät aus Java“ use `beide` (de/en/pt). diff --git a/web/lessons/README.md b/web/lessons/README.md index 5a188619..bf198dfd 100644 --- a/web/lessons/README.md +++ b/web/lessons/README.md @@ -78,7 +78,7 @@ lösung: l2-hallo-loesung.visustruct - `datei:` (optional, nach einem `test:`) Diese Datei soll das Programm in diesem Test speichern, zum Beispiel `datei: einkauf-neu.txt -> Heu | Äpfel | Kuchen`. Verglichen wird Zeile für Zeile wie bei den Ausgaben. - `code: java` (optional) Die Übung wird im Bereich Code in Java gelöst. „Im Editor öffnen“ öffnet die Spalte gleich mit und stellt sie auf Java. Geprüft wird wie sonst das Struktogramm, das beim Tippen entsteht. Eine Musterlösung ist Pflicht, der Test tippt sie als Java und prüft sie. -- `bereich: struktogramm | code | beide` (optional) Wo man die Übung löst. Die Karte zeigt es farbig an (Struktogramm blau, Code violett), und „Im Editor öffnen“ zeigt genau diese Bereiche: Lektionen bleiben offen, alles andere (Dateien, mBot2 live, bei `struktogramm` der Code, bei `code` das Struktogramm) wird geschlossen. Ohne Angabe gilt `code` bei `code: java`, sonst `struktogramm`. Für Übungen, bei denen man Code tippt und das Struktogramm liest (oder umgekehrt), `beide` nehmen. +- `bereich: struktogramm | code | beide` (optional) Wo man die Übung löst. Die Karte zeigt es farbig an (Struktogramm grün, Code violett), und „Im Editor öffnen“ zeigt genau diese Bereiche: Lektionen bleiben offen, alles andere (Dateien, mBot2 live, bei `struktogramm` der Code, bei `code` das Struktogramm) wird geschlossen. Ohne Angabe gilt `code` bei `code: java`, sonst `struktogramm`. Für Übungen, bei denen man Code tippt und das Struktogramm liest (oder umgekehrt), `beide` nehmen. - Die Kennung (`l2-hallo`) muss überall eindeutig sein, denn unter ihr wird der Fortschritt gespeichert. Eine Checkliste zum Abhaken: diff --git a/web/package-lock.json b/web/package-lock.json index a2b43ab9..f29c4db3 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1,12 +1,12 @@ { "name": "visustruct-web", - "version": "0.14.9", + "version": "0.14.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "visustruct-web", - "version": "0.14.9", + "version": "0.14.10", "dependencies": { "@codemirror/autocomplete": "^6.20.4", "@codemirror/commands": "^6.11.1", diff --git a/web/package.json b/web/package.json index ec4b3203..03d3d566 100644 --- a/web/package.json +++ b/web/package.json @@ -1,7 +1,7 @@ { "name": "visustruct-web", "private": true, - "version": "0.14.9", + "version": "0.14.10", "type": "module", "scripts": { "dev": "vite", diff --git a/web/src/ui/app.ts b/web/src/ui/app.ts index 36921599..5215335e 100644 --- a/web/src/ui/app.ts +++ b/web/src/ui/app.ts @@ -538,6 +538,7 @@ export class App {
${De(p("simulation_variables_placeholder"))}
`;else{const r=document.createElement("table");for(const o of n){const l=r.insertRow();l.insertCell().textContent=o;const u=e.variables.get(o),m=l.insertCell();u.kind==="grid"?m.append(rg(u)):m.textContent=_e(u)}this.variables.replaceChildren(r)}e.outputLines.length===0&&e.files.size===0?this.output.innerHTML=`${De(p("simulation_output_placeholder"))}
`:(this.output.replaceChildren(...e.outputLines.map(r=>{const o=document.createElement("div");return o.textContent=r,o}),...sg(e.files)),this.output.scrollTop=this.output.scrollHeight)}updateInput(){const e=this.engine.state.inputRequest,t=this.inputSection;if(t.parentElement.classList.toggle("active",!!e),!e){t.innerHTML=`${De(p("simulation_input_placeholder"))}
`;return}let n=t.querySelector("form");if(!n){n=document.createElement("form"),n.innerHTML=``;const l=n.querySelector("input");n.addEventListener("submit",u=>{u.preventDefault(),this.submitInput(l)}),t.replaceChildren(n),requestAnimationFrame(()=>l.focus())}const a=this.engine.state.outputLines;n.querySelector(".sim-prompt").textContent=e.prompt||(a[a.length-1]??"");const s=n.querySelector("input");s.inputMode=e.valueType==="string"||e.valueType==="boolean"?"text":"decimal";const r=this.engine.state.inputErrorNotice,o=n.querySelector(".sim-input-error");o.textContent=r?t1(r):"",o.hidden=!r}}function rg(i){const e=document.createElement("table");e.className="sim-grid";for(const t of i.value){const n=e.insertRow();for(const a of t){const s=n.insertCell();s.textContent=String(a),a===!0&&(s.className="sim-grid-true")}}return e}const x1=Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),Gn=360/x1.length,nZ="http://www.w3.org/2000/svg";function Fe(i,e={},...t){const n=document.createElement(i);for(const[a,s]of Object.entries(e))n.setAttribute(a,s);return n.append(...t),n}function xt(i,e={},t){const n=document.createElementNS(nZ,i);for(const[a,s]of Object.entries(e))n.setAttribute(a,String(s));return t!==void 0&&(n.textContent=t),n}function iZ(i,e){const t=(e%26+26)%26;return Array.from(i).map(n=>{const a=n.charCodeAt(0);return a>=65&&a<=90?String.fromCharCode((a-65+t)%26+65):a>=97&&a<=122?String.fromCharCode((a-97+t)%26+97):n}).join("")}function em(i,e){const t=xt("g",{class:e}),n=x1.map((a,s)=>{const r=xt("g",{transform:`rotate(${s*Gn})`});return r.append(xt("text",{x:0,y:-i,"text-anchor":"middle","dominant-baseline":"central"},a)),t.append(r),r});return{group:t,cells:n}}function aZ(i,e){let t=i,n=!1,a=-t*Gn;const s=Fe("section",{class:"learn-game learn-caesar"});s.append(Fe("div",{class:"learn-game-head"},Fe("strong",{},p("web_learn_caesar_title")))),s.append(Fe("p",{class:"learn-game-status"},p("web_learn_caesar_hint")));const r=xt("svg",{viewBox:"-200 -200 400 400",class:"learn-caesar-disc",role:"img"});r.append(xt("circle",{r:196,class:"outer-disc"})),r.append(xt("path",{d:sZ(196,92,Gn/2),class:"window"}));const o=em(168,"outer-letters");r.append(o.group);for(let j=0;j${De(p("simulation_variables_placeholder"))}
`;else{const r=document.createElement("table");for(const o of n){const l=r.insertRow();l.insertCell().textContent=o;const u=e.variables.get(o),m=l.insertCell();u.kind==="grid"?m.append(rg(u)):m.textContent=_e(u)}this.variables.replaceChildren(r)}e.outputLines.length===0&&e.files.size===0?this.output.innerHTML=`${De(p("simulation_output_placeholder"))}
`:(this.output.replaceChildren(...e.outputLines.map(r=>{const o=document.createElement("div");return o.textContent=r,o}),...sg(e.files)),this.output.scrollTop=this.output.scrollHeight)}updateInput(){const e=this.engine.state.inputRequest,t=this.inputSection;if(t.parentElement.classList.toggle("active",!!e),!e){t.innerHTML=`${De(p("simulation_input_placeholder"))}
`;return}let n=t.querySelector("form");if(!n){n=document.createElement("form"),n.innerHTML=``;const l=n.querySelector("input");n.addEventListener("submit",u=>{u.preventDefault(),this.submitInput(l)}),t.replaceChildren(n),requestAnimationFrame(()=>l.focus())}const a=this.engine.state.outputLines;n.querySelector(".sim-prompt").textContent=e.prompt||(a[a.length-1]??"");const s=n.querySelector("input");s.inputMode=e.valueType==="string"||e.valueType==="boolean"?"text":"decimal";const r=this.engine.state.inputErrorNotice,o=n.querySelector(".sim-input-error");o.textContent=r?t1(r):"",o.hidden=!r}}function rg(i){const e=document.createElement("table");e.className="sim-grid";for(const t of i.value){const n=e.insertRow();for(const a of t){const s=n.insertCell();s.textContent=String(a),a===!0&&(s.className="sim-grid-true")}}return e}const x1=Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),Gn=360/x1.length,nZ="http://www.w3.org/2000/svg";function Fe(i,e={},...t){const n=document.createElement(i);for(const[a,s]of Object.entries(e))n.setAttribute(a,s);return n.append(...t),n}function xt(i,e={},t){const n=document.createElementNS(nZ,i);for(const[a,s]of Object.entries(e))n.setAttribute(a,String(s));return t!==void 0&&(n.textContent=t),n}function iZ(i,e){const t=(e%26+26)%26;return Array.from(i).map(n=>{const a=n.charCodeAt(0);return a>=65&&a<=90?String.fromCharCode((a-65+t)%26+65):a>=97&&a<=122?String.fromCharCode((a-97+t)%26+97):n}).join("")}function em(i,e){const t=xt("g",{class:e}),n=x1.map((a,s)=>{const r=xt("g",{transform:`rotate(${s*Gn})`});return r.append(xt("text",{x:0,y:-i,"text-anchor":"middle","dominant-baseline":"central"},a)),t.append(r),r});return{group:t,cells:n}}function aZ(i,e){let t=i,n=!1,a=-t*Gn;const s=Fe("section",{class:"learn-game learn-caesar"});s.append(Fe("div",{class:"learn-game-head"},Fe("strong",{},p("web_learn_caesar_title")))),s.append(Fe("p",{class:"learn-game-status"},p("web_learn_caesar_hint")));const r=xt("svg",{viewBox:"-200 -200 400 400",class:"learn-caesar-disc",role:"img"});r.append(xt("circle",{r:196,class:"outer-disc"})),r.append(xt("path",{d:sZ(196,92,Gn/2),class:"window"}));const o=em(168,"outer-letters");r.append(o.group);for(let j=0;j${p("web_visubot_world_in_preview")}
${EZ()}${NZ()}`,this.stage=this.element.querySelector(".visubot-stage"),this.picker=this.element.querySelector(".visubot-worlds"),this.status=this.element.querySelector(".visubot-status"),this.liveStatus=this.element.querySelector(".visubot-live"),this.viewport=this.element.querySelector(".visubot-viewport"),this.stopListening=ge.listen(()=>this.updateLive()),this.setupControls(),this.check=this.element.querySelector(".visubot-check"),this.setupCheck(),this.updateLive(),this.updateStatus()}show(){this.loading??(this.loading=K(async()=>{const{Robot3D:e}=await import("./robot3d-CDfhZPAN.js");return{Robot3D:e}},[],import.meta.url).then(({Robot3D:e})=>{this.view=new e(this.stage),this.view.setWorld(this.world.setup),this.view.place(this.world.pose,this.world.trail),this.view.setLeds(this.world.leds)}).catch(()=>{this.stage.textContent=p("web_visubot_no_3d")}))}restoreViewport(){this.viewport.parentElement!==this.element&&this.liveStatus.after(this.viewport)}setWorlds(e){this.picker.replaceChildren(),this.picker.hidden=e.length<2,e.forEach((t,n)=>{const a=document.createElement("button");a.textContent=p("web_visubot_world_fmt",n+1),a.addEventListener("click",()=>this.useWorld(t,a)),this.picker.append(a)}),this.useWorld(e[0]??Ii,this.picker.firstElementChild)}useWorld(e,t){var n,a,s,r,o;for(const l of this.picker.children)l.classList.toggle("active",l===t);e!==this.world.setup&&(this.world=new ds(e),this.applied=0,this.sent=0,(n=this.view)==null||n.setWorld(e),(a=this.view)==null||a.place(this.world.pose,this.world.trail),(s=this.view)==null||s.setLed(void 0),(r=this.view)==null||r.setScreen(void 0),this.updateStatus(),(o=this.onWorldChange)==null||o.call(this))}reset(){var e,t,n;this.world.reset(),this.applied=0,this.sent=0,this.realSensors=void 0,(e=this.view)==null||e.place(this.world.pose,this.world.trail),(t=this.view)==null||t.setLed(void 0),(n=this.view)==null||n.setScreen(void 0),this.updateStatus()}prepare(e){e.robotSensors={...this.controls,...this.world.sensors()}}setupControls(){for(const e of this.element.querySelectorAll(".visubot-controls input[type=range]")){const t=e.parentElement.querySelector("output"),n=()=>{this.controls[e.name]=Number(e.value),t.textContent=e.value};e.addEventListener("input",n),n()}for(const e of this.element.querySelectorAll(".visubot-controls button[name]"))e.addEventListener("click",()=>{const t=e.name;this.controls[t]=!0,e.classList.add("pressed"),window.clearTimeout(this.pressTimers.get(t)),this.pressTimers.set(t,window.setTimeout(()=>{this.controls[t]=!1,e.classList.remove("pressed")},1e3))})}setupCheck(){for(const e of this.check.querySelectorAll("button[data-py]"))e.addEventListener("click",()=>{const{after:t,wait:n}=e.dataset;ge.run(e.dataset.py).then(()=>t?new Promise(a=>setTimeout(a,Number(n))).then(()=>ge.run(t)):void 0).catch(a=>this.liveFailed(a))});this.check.addEventListener("toggle",()=>void this.readCheck())}async readCheck(){if(!this.checking){this.checking=!0;try{for(;this.check.open&&ge.connected;){for(const e of this.check.querySelectorAll("[data-sensor]")){if(!this.check.open||!ge.connected)break;const t=e.dataset.sensor,n=await ge.ask(Ct[t].python).catch(()=>{});n!==void 0&&(e.textContent=typeof Ct[t].simulated=="boolean"?n===!0||typeof n=="number"&&n!==0?"✓":"–":String(typeof n=="number"?Math.round(n*10)/10:n))}await new Promise(e=>setTimeout(e,200))}}finally{this.checking=!1}}}get live(){return ge.connected}async prepareLive(e,t=[]){const n={};for(const a of new Set(["getDistance","getLine",...t])){const s=await ge.ask(Ct[a].python);typeof Ct[a].simulated=="boolean"?n[a]=s===!0||typeof s=="number"&&s!==0:typeof Ct[a].simulated=="string"?n[a]=typeof s=="string"?s:String(Ct[a].simulated):n[a]=typeof s=="number"?a==="getDistance"?Math.round(s):s:0}this.realSensors=n,e.robotSensors={...this.controls,...this.world.sensors(),...n}}async drive(e){for(;this.sent${p("web_visubot_world_in_preview")}
${EZ()}${NZ()}`,this.stage=this.element.querySelector(".visubot-stage"),this.picker=this.element.querySelector(".visubot-worlds"),this.status=this.element.querySelector(".visubot-status"),this.liveStatus=this.element.querySelector(".visubot-live"),this.viewport=this.element.querySelector(".visubot-viewport"),this.stopListening=ge.listen(()=>this.updateLive()),this.setupControls(),this.check=this.element.querySelector(".visubot-check"),this.setupCheck(),this.updateLive(),this.updateStatus()}show(){this.loading??(this.loading=K(async()=>{const{Robot3D:e}=await import("./robot3d-BqWf7TG_.js");return{Robot3D:e}},[],import.meta.url).then(({Robot3D:e})=>{this.view=new e(this.stage),this.view.setWorld(this.world.setup),this.view.place(this.world.pose,this.world.trail),this.view.setLeds(this.world.leds)}).catch(()=>{this.stage.textContent=p("web_visubot_no_3d")}))}restoreViewport(){this.viewport.parentElement!==this.element&&this.liveStatus.after(this.viewport)}setWorlds(e){this.picker.replaceChildren(),this.picker.hidden=e.length<2,e.forEach((t,n)=>{const a=document.createElement("button");a.textContent=p("web_visubot_world_fmt",n+1),a.addEventListener("click",()=>this.useWorld(t,a)),this.picker.append(a)}),this.useWorld(e[0]??Ii,this.picker.firstElementChild)}useWorld(e,t){var n,a,s,r,o;for(const l of this.picker.children)l.classList.toggle("active",l===t);e!==this.world.setup&&(this.world=new ds(e),this.applied=0,this.sent=0,(n=this.view)==null||n.setWorld(e),(a=this.view)==null||a.place(this.world.pose,this.world.trail),(s=this.view)==null||s.setLed(void 0),(r=this.view)==null||r.setScreen(void 0),this.updateStatus(),(o=this.onWorldChange)==null||o.call(this))}reset(){var e,t,n;this.world.reset(),this.applied=0,this.sent=0,this.realSensors=void 0,(e=this.view)==null||e.place(this.world.pose,this.world.trail),(t=this.view)==null||t.setLed(void 0),(n=this.view)==null||n.setScreen(void 0),this.updateStatus()}prepare(e){e.robotSensors={...this.controls,...this.world.sensors()}}setupControls(){for(const e of this.element.querySelectorAll(".visubot-controls input[type=range]")){const t=e.parentElement.querySelector("output"),n=()=>{this.controls[e.name]=Number(e.value),t.textContent=e.value};e.addEventListener("input",n),n()}for(const e of this.element.querySelectorAll(".visubot-controls button[name]"))e.addEventListener("click",()=>{const t=e.name;this.controls[t]=!0,e.classList.add("pressed"),window.clearTimeout(this.pressTimers.get(t)),this.pressTimers.set(t,window.setTimeout(()=>{this.controls[t]=!1,e.classList.remove("pressed")},1e3))})}setupCheck(){for(const e of this.check.querySelectorAll("button[data-py]"))e.addEventListener("click",()=>{const{after:t,wait:n}=e.dataset;ge.run(e.dataset.py).then(()=>t?new Promise(a=>setTimeout(a,Number(n))).then(()=>ge.run(t)):void 0).catch(a=>this.liveFailed(a))});this.check.addEventListener("toggle",()=>void this.readCheck())}async readCheck(){if(!this.checking){this.checking=!0;try{for(;this.check.open&&ge.connected;){for(const e of this.check.querySelectorAll("[data-sensor]")){if(!this.check.open||!ge.connected)break;const t=e.dataset.sensor,n=await ge.ask(Ct[t].python).catch(()=>{});n!==void 0&&(e.textContent=typeof Ct[t].simulated=="boolean"?n===!0||typeof n=="number"&&n!==0?"✓":"–":String(typeof n=="number"?Math.round(n*10)/10:n))}await new Promise(e=>setTimeout(e,200))}}finally{this.checking=!1}}}get live(){return ge.connected}async prepareLive(e,t=[]){const n={};for(const a of new Set(["getDistance","getLine",...t])){const s=await ge.ask(Ct[a].python);typeof Ct[a].simulated=="boolean"?n[a]=s===!0||typeof s=="number"&&s!==0:typeof Ct[a].simulated=="string"?n[a]=typeof s=="string"?s:String(Ct[a].simulated):n[a]=typeof s=="number"?a==="getDistance"?Math.round(s):s:0}this.realSensors=n,e.robotSensors={...this.controls,...this.world.sensors(),...n}}async drive(e){for(;this.sent${p("web_visubot_controls_hint")}
${i("getBrightness","web_visubot_sensor_brightness",0,100,50)} ${i("getLoudness","web_visubot_sensor_loudness",0,100,0)} @@ -64623,10 +64623,10 @@ ${a}`));this.body.append(s),this.foldReference(s)}}foldReference(e){const t="vis `;this.styleTag.textContent=l}let o=t.head||t;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Bn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},kB=typeof navigator<"u"&&/Mac/.test(navigator.platform),SB=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ue=0;Ue<10;Ue++)Bn[48+Ue]=Bn[96+Ue]=String(Ue);for(var Ue=1;Ue<=24;Ue++)Bn[Ue+111]="F"+Ue;for(var Ue=65;Ue<=90;Ue++)Bn[Ue]=String.fromCharCode(Ue+32),_i[Ue]=String.fromCharCode(Ue);for(var Or in Bn)_i.hasOwnProperty(Or)||(_i[Or]=Bn[Or]);function TB(i){var e=kB&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||SB&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?_i:Bn)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}let ut=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},tl=typeof document<"u"?document:{documentElement:{style:{}}};const nl=/Edge\/(\d+)/.exec(ut.userAgent),Gg=/MSIE \d/.test(ut.userAgent),il=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ut.userAgent),Xs=!!(Gg||il||nl),Pm=!Xs&&/gecko\/(\d+)/i.test(ut.userAgent),Pr=!Xs&&/Chrome\/(\d+)/.exec(ut.userAgent),Mm="webkitFontSmoothing"in tl.documentElement.style,al=!Xs&&/Apple Computer/.test(ut.vendor),Dm=al&&(/Mobile\/\w+/.test(ut.userAgent)||ut.maxTouchPoints>2);var G={mac:Dm||/Mac/.test(ut.platform),windows:/Win/.test(ut.platform),linux:/Linux|X11/.test(ut.platform),ie:Xs,ie_version:Gg?tl.documentMode||6:il?+il[1]:nl?+nl[1]:0,gecko:Pm,gecko_version:Pm?+(/Firefox\/(\d+)/.exec(ut.userAgent)||[0,0])[1]:0,chrome:!!Pr,chrome_version:Pr?+Pr[1]:0,ios:Dm,android:/Android\b/.test(ut.userAgent),webkit:Mm,webkit_version:Mm?+(/\bAppleWebKit\/(\d+)/.exec(ut.userAgent)||[0,0])[1]:0,safari:al,safari_version:al?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ut.userAgent)||[0,0])[1]:0,tabSize:tl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function x0(i,e){for(let t in i)t=="class"&&e.class?e.class+=" "+i.class:t=="style"&&e.style?e.style+=";"+i.style:e[t]=i[t];return e}const vs=Object.create(null);function v0(i,e,t){if(i==e)return!0;i||(i=vs),e||(e=vs);let n=Object.keys(i),a=Object.keys(e);if(n.length-0!=a.length-0)return!1;for(let s of n)if(s!=t&&(a.indexOf(s)==-1||i[s]!==e[s]))return!1;return!0}function _B(i,e){for(let t=i.attributes.length-1;t>=0;t--){let n=i.attributes[t].name;e[n]==null&&i.removeAttribute(n)}for(let t in e){let n=e[t];t=="style"?i.style.cssText=n:i.getAttribute(t)!=n&&i.setAttribute(t,n)}}function Zm(i,e,t){let n=!1;if(e)for(let a in e)t&&a in t||(n=!0,a=="style"?i.style.cssText="":i.removeAttribute(a));if(t)for(let a in t)e&&e[a]==t[a]||(n=!0,a=="style"?i.style.cssText=t[a]:i.setAttribute(a,t[a]));return n}function CB(i){let e=Object.create(null);for(let t=0;t