"use strict";var UrsLCDDisplay=function(t,e){function o(t,e){var o=document.createElement("canvas");return o.width=t,o.height=e,o}function r(t,e,o,r,i,a){var n=e+r,l=o+i;t.beginPath(),t.moveTo(e+a,o),t.lineTo(n-a,o),t.quadraticCurveTo(n,o,n,o+a),t.lineTo(n,o+i-a),t.quadraticCurveTo(n,l,n-a,l),t.lineTo(e+a,l),t.quadraticCurveTo(e,l,e,l-a),t.lineTo(e,o+a),t.quadraticCurveTo(e,o,e+a,o),t.closePath()}var i,a=void 0===(e=e||{}).context?null:e.context,n=void 0===e.width?0:e.width,l=void 0===e.height?0:e.height,d=void 0===e.value?0:e.value,c=void 0===e.top?0:e.top,s=void 0===e.left?0:e.left,h=void 0===e.align?"right":e.align;i=a||function(t){return("string"==typeof t||t instanceof String?document.getElementById(t):t).getContext("2d")}(t),0===n&&(n=i.canvas.width),0===l&&(l=i.canvas.height);var u,f=Math.floor(l/1.5),g=f+"px LCDMono2Ultra,Arial,Verdana,sans-serif",v=!1,p=function(t,e){switch(i.save(),i.textAlign=h,i.strokeStyle=e,i.fillStyle=e,i.beginPath(),i.rect(s+2,c+0,n-4,l),i.closePath(),i.clip(),i.shadowColor="gray",i.shadowOffsetX=.035*l,i.shadowOffsetY=.035*l,i.shadowBlur=.055*l,i.font=g,h.toLowerCase()){case"left":i.fillText(t,s+2,c+.5*l+.38*f);break;case"center":i.fillText(t,s+n/2,c+.5*l+.38*f);break;default:i.fillText(t,s+n-2,c+.5*l+.38*f)}i.restore()},C=function(t,e){var i,a,n,l=t,d=e,c=.095*Math.min(t,e),s=t-2,h=e-2,u=c-1;t.toString();return i=o(t,e),a=i.getContext("2d"),(n=a.createLinearGradient(0,0,0,0+d)).addColorStop(0,"#4c4c4c"),n.addColorStop(.08,"#666666"),n.addColorStop(.92,"#666666"),n.addColorStop(1,"#e6e6e6"),a.fillStyle=n,r(a,0,0,l,d,c),a.fill(),(n=a.createLinearGradient(0,1,0,1+h)).addColorStop(0,"rgb(131, 133, 119)"),n.addColorStop(.03,"rgb(176, 183, 167)"),n.addColorStop(.49,"rgb(165, 174, 153)"),n.addColorStop(.5,"rgb(166, 175, 156)"),n.addColorStop(1,"rgb(175, 184, 165)"),a.fillStyle=n,r(a,1,1,s,h,u),a.fill(),i},S=function(){v=!0,u=C(n,l)};return this.setValue=function(t){return d!==t&&(d=t,this.repaint()),this},this.setAlign=function(t){return h!==t&&(h=t,this.repaint()),this},this.repaint=function(){v||S(),i.clearRect(s+2,c+2,n-4,l-4);var t=u;i.drawImage(t,s,c),p(d,"rgb(35, 42, 52)")},this.repaint(),this};