import{logicgate,currMouseAction}from"./menutools.js";import{MouseAction}from"./circuit_components/Enums.js";import{WireManager}from"./circuit_components/Wire.js";import{FileManager}from"./FileManager.js";export let gateIMG=[];export let gate=[];export let Wire_status=[1];export let map_gate=[];export let bulb=[];export let logicInput=[];export let logicOutput=[];export let logicClock=[];export let srLatch=[];export let flipflop=[];export let wireMng;export let colorMouseOver=[246,255,255];export let fileManager=new FileManager;export function preload(){gateIMG.push(loadImage("simulator/img/LogicInput.svg")),gateIMG.push(loadImage("simulator/img/NOT.svg")),gateIMG.push(loadImage("simulator/img/AND.svg")),gateIMG.push(loadImage("simulator/img/NAND.svg")),gateIMG.push(loadImage("simulator/img/OR.svg")),gateIMG.push(loadImage("simulator/img/NOR.svg")),gateIMG.push(loadImage("simulator/img/XOR.svg")),gateIMG.push(loadImage("simulator/img/XNOR.svg")),map_gate.push(loadImage("simulator/img/map_of_and_IC.png")),map_gate.push(loadImage("simulator/img/map of xor IC.png")),map_gate.push(loadImage("simulator/img/map of xnor IC.png")),map_gate.push(loadImage("simulator/img/map of or IC.png")),map_gate.push(loadImage("simulator/img/map of not IC.png")),map_gate.push(loadImage("simulator/img/map of nor IC.png")),map_gate.push(loadImage("simulator/img/map of nand IC.png")),map_gate.push(loadImage("simulator/img/exp1.svg")),bulb.push(loadImage("simulator/img/bulb_on_.png")),bulb.push(loadImage("simulator/img/bulb_off_.png"))}let img,bulbOn,bulbOff,brightness=0;export function setup(){const e=windowHeight-90;let t=createCanvas(windowWidth-250,e,P2D);bulbOn=loadImage("simulator/img/bulb_on.png"),bulbOff=loadImage("simulator/img/bulb_off.png"),t.parent("canvas-sim"),document.getElementsByClassName("tools")[0].style.height=e,wireMng=new WireManager}export function windowResized(){const e=windowHeight-90;resizeCanvas(windowWidth-115,e),document.getElementsByClassName("tools")[0].style.height=e}export function draw(){background(255),stroke(171,171,171,97),strokeWeight(1),fill(179,181,180,127),rect(0,0,width,height);for(let e=0;e<=height;e+=25)line(0,e,width,e);for(let e=0;e<=width;e+=25)line(e,0,e,height);2==Wire_status[0]&&(wireMng.wire.splice(0,wireMng.wire.length),Wire_status[0]=1),wireMng.draw();for(let e=0;e