/*!
 * SAP UI development toolkit for HTML5 (SAPUI5/OpenUI5)
 * (c) Copyright 2009-2015 SAP SE or an SAP affiliate company.
 * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
 */
sap.ui.define(['jquery.sap.global'],function(q){"use strict";var T=function(){};T.render=function(r,c){var a=r;var m=c.getMinValue();var b=c.getMaxValue();var v=c.getValue();if(m<0||m==Number.NaN){m=0;}if(b<0||b==Number.NaN){b=1;}if(v<0||v==Number.NaN){v=0;}var d=v.toString();var e=c.getColor();var s='sapUiTaskCircleColorGray';switch(e){case sap.ui.suite.TaskCircleColor.Red:s='sapUiTaskCircleColorRed';break;case sap.ui.suite.TaskCircleColor.Yellow:s='sapUiTaskCircleColorYellow';break;case sap.ui.suite.TaskCircleColor.Green:s='sapUiTaskCircleColorGreen';break;case sap.ui.suite.TaskCircleColor.Gray:s='sapUiTaskCircleColorGray';break;}if(v<m){m=v;}if(v>b){b=v;}var p=24;if(m>10){p=32;}if(m>100){p=46;}var f=62;var g=parseInt(Math.sqrt((v-m)/(b-m)*(f*f-p*p)+p*p),10);var h=(v+'').length;var i=g*0.55;if(h>1){i=g/h;}a.write("<div");a.writeControlData(c);a.writeAttribute('tabIndex','0');if(c.getTooltip_AsString()){a.writeAttributeEscaped("title",c.getTooltip_AsString());}else{a.writeAttributeEscaped("title",d);}if(sap.ui.getCore().getConfiguration().getAccessibility()){a.writeAttribute('role','progressbar');a.writeAccessibilityState(c,{valuemin:m});a.writeAccessibilityState(c,{valuemax:b});a.writeAccessibilityState(c,{valuenow:v});}a.writeAttribute("class","sapUiTaskCircle "+s);a.addStyle("width",g+"px");a.addStyle("height",g+"px");a.addStyle("line-height",g+"px");a.addStyle("font-size",parseInt(i,10)+"px");a.addStyle("border-radius",g+"px");a.addStyle("-moz-border-radius",g+"px");a.writeClasses();a.writeStyles();a.write(">");a.write(v);a.write("</div>");};return T;},true);
