Commit 1c1889ae authored by kosheo's avatar kosheo

Update website

parent b0cccd84
$(document).ready(function(){function t(t){var e="";return t.find(">div>span").each(function(t,r){e+=0===t?$(r).text().substr(n.length):$(r).text()}),e}$('[data-toggle="tooltip"]').tooltip();var e=new clc.Calculator(math);e.installExtension(new clc.HexBinLiteralsExtension),e.installExtension(new clc.UnicodeEncodingExtension),e.installExtension(new clc.Base64EncodingExtension),e.installExtension(new clc.HashesExtension),e.installExtension(new clc.ColorExtension(!0)),e.installExtension(new clc.LerpExtension),e.installExtension(new clc.PlotExtension);var n=">",r=new clc.LinksHandler(function(e){if(void 0!==e)return[t(e)];var n=[];return $(".terminal-output .command").each(function(e,r){var i=t($(r));clc.isStringBlank(i)||n.push(i)}),n}),i=new clc.TexHandler,o=new clc.SyntaxHighlighter;r.setLogLinkButtonEnabled(!1),$.terminal.defaults.formatters.push(function(t){return o.highlight(t)});var s=$(".console-panel").terminal(function(t){if(!clc.isStringBlank(t)){r.setLogLinkButtonEnabled(!0);try{var n=e.evaluate(t);i.addEvaluatedExpression(n.tex,n.result.tex||null),n.result.postprocessed?this.echo(n.result.postprocessed,{raw:!0}):n.result.raw instanceof clc.CallbackResult&&this.echo(n.result.raw.callback,{raw:!0})}catch(t){this.echo("[[;;;terminal-output-error;]"+t.name+": "+t.message+"]")}}},{completion:clc.COMPLETION_KEYWORDS,onEchoCommand:function(t){var e=t.find("div span"),i=e.length?e.text().substring(n.length):"";clc.isStringBlank(i)||r.injectExpressionLinkButton(t.find(">div").last())},name:"clcalc",prompt:n,exit:!1,memory:!0,enabled:!0,greetings:function(){this.echo('<div class="welcome-message">Type math expression and press enter to calculate the result. You can use up/down keys to navigate commands history and tab key for autocompletion. Check <a href="/help.html#quickstart" target="_blank">Quick Start</a> guide for some examples.</div>',{raw:!0})},onClear:function(){r.setLogLinkButtonEnabled(!1),i.clear()}});window.onhashchange=function(){window.location.reload()};var a=r.getExpressionsListFromUrl();if(a){var l=new RegExp(String.fromCharCode(160),"g");for(var c in a)s.exec(a[c].replace(l," "))}}),Math.log10||(Math.log10=function(t){return Math.log(t)/Math.LN10}),Math.sign||(Math.sign=function(t){return(t>0)-(t<0)||+t}),function(t){t.isStringBlank=function(t){if(!t||!t.length)return!0;for(var e=0;e<t.length;++e)if(" "!==t[e]&&"\t"!==t[e]&&"\r"!==t[e]&&"\n"!==t[e]&&160!==t.charCodeAt(e))return!1;return!0},t.repeatString=function(t,e){for(var n="",r=0;r<e;++r)n+=t;return n},t.padLeft=function(e,n,r){return e.length>=r||1!==n.length?e:t.repeatString(n,r-e.length)+e},t.stringToUnicodeCodePointList=function(t){for(var e=[],n=0;n<t.length;++n){var r=t.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<t.length){var i=t.charCodeAt(n+1);i>=56320&&i<=57343&&(r=1024*(r-55296)+i-56320+65536,++n)}e.push(r)}return e},t.stringFromUnicodeCodePointList=function(e){for(var n="",r=0;r<e.length;++r){var i=t.toUint32(e[r]);if(i>1114111)throw new Error("Invalid code point value: "+i+". Must be less then or equal to 0x10FFFF.");if(i>65535){var o=Math.floor((i-65536)/1024)+55296,s=(i-65536)%1024+56320;n+=String.fromCharCode(o,s)}else n+=String.fromCharCode(i)}return n},t.stringToUtf8Array=function(t){var e=[];t=unescape(encodeURIComponent(t));for(var n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e},t.stringFromUtf8Array=function(e){for(var n=[],r=0;r<e.length;){var i,o=t.toUint8(e[r]);if(0==(128&o))i=127&o,r+=1;else if(o>>>5==6){if(r+1>=e.length)throw new Error("Failed to decode utf8 string: excepceted 1 byte after "+o);i=(31&o)<<6|63&t.toUint8(e[r+1]),r+=2}else if(o>>>4==14){if(r+2>=e.length)throw new Error("Failed to decode utf8 string: excepceted 2 bytes after "+o);i=(15&o)<<12|(63&t.toUint8(e[r+1]))<<6|63&t.toUint8(e[r+2]),r+=3}else{if(o>>>3!=30)throw new Error("Failed to decode utf8 string: unexpected byte "+o+" at position "+r);if(r+3>=e.length)throw new Error("Failed to decode utf8 string: excepceted 3 bytes after "+o);i=(7&o)<<18|(63&t.toUint8(e[r+1]))<<12|(63&t.toUint8(e[r+2]))<<6|63&t.toUint8(e[r+3]),r+=4}n.push(i)}return t.stringFromUnicodeCodePointList(n)};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.base64Encode=function(n){if(0===n.length)return"";var r,i="",o=n.length%3;if(o)for(o=3-o,r=0;r<o;++r)n.push(0);for(r=0;r<n.length;r+=3){var s=t.toUint8(n[r]),a=t.toUint8(n[r+1]),l=t.toUint8(n[r+2]);i+=e[s>>>2],i+=e[(3&s)<<4|a>>>4],i+=r===n.length-3&&2===o?"=":e[(15&a)<<2|l>>>6],i+=r===n.length-3&&o?"=":e[63&l]}return i},t.base64Decode=function(t){if(0===t.length)return[];for(var n=[],r=0;r<t.length;r+=4){var i=e.indexOf(t[r]);if(-1===i)throw new Error("Invalid character at index "+r);if(r+1>=t.length)throw new Error("The string is not correctly base64 encoded: next character expected.");var o=e.indexOf(t[r+1]);if(-1===o)throw new Error("Invalid character at index "+r);var s=r+2<t.length?"="===t[r+2]?0:e.indexOf(t[r+2]):0;if(-1===s)throw new Error("Invalid character at index "+r);var a=r+3<t.length?"="===t[r+3]?0:e.indexOf(t[r+3]):0;if(-1===a)throw new Error("Invalid character at index "+r);if(r+2<t.length&&"="===t[r+2]&&(r+3>=t.length||"="!==t[r+3]))throw new Error("The string is not correctly base64 encoded: improper padding.");n.push(i<<2|o>>>4),r+2<t.length&&"="!==t[r+2]&&(n.push((15&o)<<4|s>>>2),r+3<t.length&&"="!==t[r+3]&&n.push((3&s)<<6|a))}return n},t.randomAlnumString=function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r<t;++r)n+=e[Math.floor(Math.random()*e.length)];return n},t.randomId=function(e){return e+t.randomAlnumString(10)},t.round1Dec=function(t){return Math.sign(t)*Math.round(10*Math.abs(t))/10},t.truncateNumber=function(t){return 0|t},t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.mod=function(t,e){return(t%e+e)%e},t.toUint32=function(t){if("number"!=typeof t&&!t.toNumber)throw new Error("Must be a numeric type: "+t);var e=t.toNumber?t.toNumber():t;if(e<0)throw new Error("Number must be non-negative: "+e);if(e>4294967295)throw new Error("Number must fit in 4 byte unsigned integer: "+e);return e>>>0},t.toUint8=function(e){var n=t.toUint32(e);if(e>255)throw new Error("Number exceeds byte range: "+n);return n},t.dropTrailingZeroes=function(t){var e=t.indexOf(".");if(-1!==e){for(var n=t.length-1;n>e&&"0"===t[n];)--n;if(e===n)return t.substring(0,e);if(n<t.length-1)return t.substring(0,n+1)}return t},t.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},t.htmlTag=function(e,n,r){var i="<"+e;if(n)for(var o in n)n.hasOwnProperty(o)&&(i+=" "+o+'="'+n[o]+'"');return r&&t.isArray(r)&&(r=r.join("")),i+=">"+(r||"")+"</"+e+">"},t.domElement=function(e,n,r,i){var o=document.createElementNS(e,n);if(r)for(var s in r)r.hasOwnProperty(s)&&o.setAttribute(s,r[s]);if(i)if(t.isArray(i))for(var a=0;a<i.length;++a)o.appendChild(i[a]);else"string"==typeof i?o.innerHTML=i:o.appendChild(i);return o},t.mathJsToValidNumber=function(t){if("number"==typeof t||t instanceof Number){if(!isFinite(t))throw new Error("Number is infinite or NaN");return t}if(t.toNumber){if(t.isFinite())return t.toNumber();throw new Error("Number is infinite or NaN")}throw new Error("Not a recognized number type")},t.log=function(t){console&&console.log&&console.log(t)}}(window.clc=window.clc||{}),function(t){t.Calculator=function(e){var n=this;this._precisionSignificantDigits=64,this._mathJs=e,this._mathJs.config({number:"BigNumber",precision:this._precisionSignificantDigits}),this._scope={},this._extensions=[],this._numberFormatter=function(e){return e.isBigNumber?t.dropTrailingZeroes(e.toFixed(n._precisionSignificantDigits)):e.toString()}},t.Calculator.prototype.installExtension=function(t){t.extend(this._mathJs),this._extensions.push(t)},t.Calculator.prototype.evaluate=function(e){var n=new t.EvaluatedExpression;if(!t.isStringBlank(e)){var r=this._preprocessExpression(e);try{var i=this._mathJs.parse(r);n.tex=this._nodeToTex(i);var o=i.compile().eval(this._scope);this._isValidValue(o)&&(o instanceof t.CallbackResult?n.result.raw=o:(n.result.raw=this._mathJs.format(o,this._numberFormatter),n.result.postprocessed=this._postprocessValue(n.result.raw),n.result.tex=this._valueToTex(n.result.raw)))}catch(t){throw t.message||(t.message="Failed to parse expression"),e!==r&&(t.message+=". Preprocessed expression: '"+r+"'"),t}}return n},t.Calculator.prototype._preprocessExpression=function(t){for(var e=0;e<this._extensions.length;++e){var n=this._extensions[e];n.preprocess&&(t=n.preprocess(t))}return t},t.Calculator.prototype._postprocessValue=function(t){for(var e=0;e<this._extensions.length;++e){var n=this._extensions[e];n.postprocess&&(t=n.postprocess(t))}return t},t.Calculator.prototype._nodeToTex=function(e){try{return e.toTex()}catch(e){return t.log(e.name+", "+e.message),"Failed to convert expression to TeX"}},t.Calculator.prototype._valueToTex=function(e){try{return this._mathJs.parse(this._preprocessExpression(e)).toTex()}catch(e){return t.log(e.name+", "+e.message),"Failed to convert expression value to TeX"}},t.Calculator.prototype._isValidValue=function(t){return void 0!==t&&"function"!=typeof t}}(window.clc=window.clc||{}),(window.clc=window.clc||{}).CallbackResult=function(t){this.callback=t},(window.clc=window.clc||{}).EvaluatedExpression=function(){this.tex=null,this.result={raw:null,postprocessed:null}},function(t){t.MATH_JS_CONSTANTS=["e","E","i","Infinity","NaN","null","LN2","LN10","LOG2E","LOG10E","phi","pi","PI","tau","SQRT1_2","SQRT2","uninitialized","version"],t.MATH_JS_FUNCTIONS=["bignumber","boolean","chain","complex","createUnit","fraction","index","matrix","number","sparse","splitUnit","string","unit","compile","eval","help","parse","parser","derivative","lsolve","lup","lusolve","qr","simplify","slu","usolve","rationalize","abs","add","cbrt","ceil","cube","divide","dotDivide","dotMultiply","dotPow","exp","fix","floor","gcd","hypot","lcm","log","log10","mod","multiply","norm","nthRoot","pow","round","sign","sqrt","square","subtract","unaryMinus","unaryPlus","xgcd","bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift","bellNumbers","catalan","composition","stirlingS2","arg","conj","im","re","distance","intersect","and","not","or","xor","concat","cross","det","diag","dot","eye","filter","flatten","forEach","inv","kron","map","ones","partitionSelect","range","reshape","resize","size","sort","squeeze","subset","trace","transpose","zeros","combinations","factorial","gamma","kldivergence","multinomial","permutations","pickRandom","random","randomInt","compare","compareNatural","deepEqual","equal","larger","largerEq","smaller","smallerEq","unequal","setCartesian","setDifference","setDistinct","setIntersect","setIsSubset","setMultiplicity","setPowerset","setSize","setSymDifference","setUnion","erf","mad","max","mean","median","min","mode","prod","quantileSeq","std","sum","var","format","print","acos","acosh","acot","acoth","acsc","acsch","asec","asech","asin","asinh","atan","atan2","atanh","cos","cosh","cot","coth","csc","csch","sec","sech","sin","sinh","tan","tanh","to","clone","isInteger","isNaN","isNegative","isNumeric","isPositive","isPrime","isZero","typeof"],t.CLCALC_FUNCTIONS=["Color4b","color4b","color3b","color4f","colorU32","colorHsv","colorHsl","hsv","hsl","rgb","argb","argbf","base64Encode","base64Decode","toCodePoints","fromCodePoints","toUtf8","fromUtf8","md5","sha1","sha224","sha256","lerp","plot2d","hex","bin"],t.COMPLETION_KEYWORDS=["Infinity","NaN","null","LN2","LN10","LOG2E","LOG10E","phi","pi","PI","tau","SQRT1_2","SQRT2","fraction","derivative","lsolve","lup","lusolve","qr","simplify","slu","usolve","rationalize","abs","cbrt","ceil","cube","dotDivide","dotMultiply","dotPow","exp","fix","floor","gcd","hypot","lcm","log","log10","mod","norm","nthRoot","round","sign","sqrt","square","subtract","xgcd","bellNumbers","catalan","composition","stirlingS2","arg","conj","im","re","distance","intersect","and","not","or","xor","concat","cross","det","diag","dot","eye","filter","flatten","forEach","inv","kron","map","ones","partitionSelect","range","reshape","resize","size","sort","squeeze","subset","trace","transpose","zeros","combinations","factorial","gamma","kldivergence","multinomial","permutations","pickRandom","random","randomInt","setCartesian","setDifference","setDistinct","setIntersect","setIsSubset","setMultiplicity","setPowerset","setSize","setSymDifference","setUnion","erf","mad","max","mean","median","min","mode","prod","quantileSeq","std","sum","var","acos","acosh","acot","acoth","acsc","acsch","asec","asech","asin","asinh","atan","atan2","atanh","cos","cosh","cot","coth","csc","csch","sec","sech","sin","sinh","tan","tanh","to","help","clear"].concat(t.CLCALC_FUNCTIONS)}(window.clc=window.clc||{}),function(t){t.ColorExtension=function(t){this._mathJs=null,this._colorLiteral4bRegexp=new RegExp("#[A-Fa-f0-9]{8}","g"),this._colorLiteral43bRegexp=new RegExp("#[A-Fa-f0-9]{6,8}","g"),t&&(this._visibleTooltipIds=[],this._initializeColorTooltips())},t.ColorExtension.prototype.extend=function(e){this._mathJs=e,this._mathJs.typed.addType({name:"Color",test:function(e){return e&&e instanceof t.Color}}),this._registerFunction("Color4b","BigNumber, BigNumber, BigNumber, BigNumber",function(e,n,r,i){return t.Color.from4b(e,n,r,i)},!1,function(e){return"\\mathtt{\\"+t.Color.from4b(parseInt(e.args[0].value),parseInt(e.args[1].value),parseInt(e.args[2].value),parseInt(e.args[3].value)).toString()+"}"}),this._registerFunction("color4b","BigNumber, BigNumber, BigNumber, BigNumber",function(e,n,r,i){return t.Color.from4b(e,n,r,i)}),this._registerFunction("color3b","BigNumber, BigNumber, BigNumber",function(e,n,r){return t.Color.from4b(255,e,n,r)}),this._registerFunction("color4f","BigNumber, BigNumber, BigNumber, BigNumber",function(e,n,r,i){return t.Color.from4f(e,n,r,i)}),this._registerFunction("colorU32","BigNumber",function(e){return t.Color.fromU32(e)}),this._registerFunction("colorHsv","BigNumber, BigNumber, BigNumber",function(e,n,r){return t.Color.fromHsv(e,n,r)}),this._registerFunction("colorHsl","BigNumber, BigNumber, BigNumber",function(e,n,r){return t.Color.fromHsl(e,n,r)}),this._registerFunction("hsv","Color",function(t){return t.toHsv()},!0),this._registerFunction("hsl","Color",function(t){return t.toHsl()},!0),this._registerFunction("rgb","Color",function(t){return t.toArgb().splice(1)},!0),this._registerFunction("argb","Color",function(t){return t.toArgb()},!0),this._registerFunction("argbf","Color",function(t){return t.toArgbf()},!0),this._registerFunction("add","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t+e})}),this._registerFunction("subtract","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t-e})}),this._registerFunction("multiply","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t*e})}),this._registerFunction("multiply","Color, BigNumber",function(t,e){return t.op([e,e,e,e],function(t,e){return t*e})}),this._registerFunction("multiply","BigNumber, Color",function(t,e){return e.op([t,t,t,t],function(t,e){return t*e})}),this._registerFunction("divide","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t/e})}),this._registerFunction("divide","Color, BigNumber",function(t,e){return t.op([e,e,e,e],function(t,e){return t/e})})},t.ColorExtension.prototype.preprocess=function(t){return t.replace(this._colorLiteral43bRegexp,function(t){if(9!==t.length&&7!==t.length)throw new Error("Invalid color literal: "+t);var e=t.substr(9===t.length?3:1),n=e.substr(0,2),r=e.substr(2,2),i=e.substr(4,2),o=9===t.length?t.substr(1,2):"FF";return"Color4b("+parseInt(o,16)+", "+parseInt(n,16)+", "+parseInt(r,16)+", "+parseInt(i,16)+")"})},t.ColorExtension.prototype.postprocess=function(t){var e=this;return t.replace(this._colorLiteral4bRegexp,function(t){return e._generateColorSampleHtml(t)})},t.ColorExtension.prototype._generateColorSampleHtml=function(t){return'<div class="color-sample" data-color="'+t+'"><div style="background-color: '+("#"+t.substr(3))+"; opacity: "+parseInt(t.substr(1,2),16)/255+'">&nbsp;</div></div>'},t.ColorExtension.prototype._initializeColorTooltips=function(){var t=this;$("body").tooltip({placement:"top",container:"body",selector:".color-sample",trigger:"click",template:'<div class="tooltip color-sample-tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:function(){return $(this).data("color")}}),$(document).on("shown.bs.tooltip",".color-sample",function(e){t._visibleTooltipIds.push($(e.target).attr("aria-describedby"))}),$(document).on("click",function(e){if(t._visibleTooltipIds.length){var n=$(e.target),r=$(e.target).parent();if($(".color-sample-tooltip").has(e.target).length)return;if(n.hasClass("color-sample")||r&&r.length&&r.hasClass("color-sample"))return;for(var i=0;i<t._visibleTooltipIds.length;++i)$("#"+t._visibleTooltipIds[i]).tooltip("hide");t._visibleTooltipIds=[]}}),$(document).on("hidden.bs.tooltip",function(t){$(t.target).data("bs.tooltip").inState.click=!1})},t.ColorExtension.prototype._registerFunction=function(t,e,n,r,i){try{var o={},s={},a=i||null,l=this;o[e]=n,r&&(o["Array | Matrix"]=function(t){return l._mathJs.map(t,n)}),s[t]=this._mathJs.typed(t,o),a&&(s[t].toTex=a),this._mathJs.import(s)}catch(t){if(!t.data||!t.data.signature)throw t}}}(window.clc=window.clc||{}),function(t){function e(e){var n=t.mathJsToValidNumber(e);if(n<0||n>1)throw new Error("Must be floating point number in range [0, 1]");return Math.round(255*n)}t.Color=function(t){this._argb=t>>>0},t.Color.from4b=function(e,n,r,i){return new t.Color(t.toUint8(e)<<24|t.toUint8(n)<<16|t.toUint8(r)<<8|t.toUint8(i))},t.Color.from4f=function(n,r,i,o){return new t.Color.from4b(e(n),e(r),e(i),e(o))},t.Color.fromU32=function(e){return new t.Color(t.toUint32(e))},t.Color.fromHsv=function(e,n,r){if(e=t.toUint32(e),n=t.toUint32(n),r=t.toUint32(r),e>=360)throw new Error("Hue must be in range [0, 360)");if(n>100)throw new Error("Saturation must be in range [0, 100]");if(r>100)throw new Error("Value must be in range [0, 100]");var i,o=(r/=100)*(n/=100),s=o*(1-Math.abs(e/60%2-1)),a=r-o;return i=e<60?[o,s,0]:e<120?[s,o,0]:e<180?[0,o,s]:e<240?[0,s,o]:e<300?[s,0,o]:[o,0,s],t.Color.from4b(255,Math.round(255*(i[0]+a)),Math.round(255*(i[1]+a)),Math.round(255*(i[2]+a)))},t.Color.fromHsl=function(e,n,r){if(e=t.toUint32(e),n=t.toUint32(n),r=t.toUint32(r),e>=360)throw new Error("Hue must be in range [0, 360)");if(n>100)throw new Error("Saturation must be in range [0, 100]");if(r>100)throw new Error("Lightness must be in range [0, 100]");n/=100,r/=100;var i,o=(1-Math.abs(2*r-1))*n,s=o*(1-Math.abs(e/60%2-1)),a=r-.5*o;return i=e<60?[o,s,0]:e<120?[s,o,0]:e<180?[0,o,s]:e<240?[0,s,o]:e<300?[s,0,o]:[o,0,s],t.Color.from4b(255,Math.round(255*(i[0]+a)),Math.round(255*(i[1]+a)),Math.round(255*(i[2]+a)))},t.Color.prototype.get=function(t){return this._argb>>>24-8*t&255},t.Color.prototype.toString=function(){return"#"+(t.padLeft(this.get(0).toString(16),"0",2)+t.padLeft(this.get(1).toString(16),"0",2)+t.padLeft(this.get(2).toString(16),"0",2)+t.padLeft(this.get(3).toString(16),"0",2)).toUpperCase()},t.Color.prototype.op=function(e,n){var r,i=this.toArgbf();for(r=0;r<4;++r)i[r]=t.clamp(n(i[r],t.mathJsToValidNumber(e[r])),0,1);return t.Color.from4f(i[0],i[1],i[2],i[3])},t.Color.prototype.toHsv=function(){var e,n,r,i=this.get(1)/255,o=this.get(2)/255,s=this.get(3)/255,a=Math.max(i,o,s),l=a-Math.min(i,o,s);return 0==l?e=0:a===i?e=60*t.mod((o-s)/l,6):a===o?e=60*((s-i)/l+2):a===s&&(e=60*((i-o)/l+4)),n=0==a?0:l/a,r=a,[Math.round(e),Math.round(100*n),Math.round(100*r)]},t.Color.prototype.toHsl=function(){var e,n,r,i=this.get(1)/255,o=this.get(2)/255,s=this.get(3)/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a-l;return 0==c?e=0:a===i?e=60*t.mod((o-s)/c,6):a===o?e=60*((s-i)/c+2):a===s&&(e=60*((i-o)/c+4)),r=(a+l)/2,n=0==c?0:c/(1-Math.abs(2*r-1)),[Math.round(e),Math.round(100*n),Math.round(100*r)]},t.Color.prototype.toArgb=function(){return[this.get(0),this.get(1),this.get(2),this.get(3)]},t.Color.prototype.toArgbf=function(){return[this.get(0)/255,this.get(1)/255,this.get(2)/255,this.get(3)/255]}}(window.clc=window.clc||{}),function(t){t.Base64EncodingExtension=function(){this._mathJs=null},t.Base64EncodingExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.base64Encode){var n=this._mathJs.typed("base64Encode",{Array:function(t){return e._functionBase64Encode(t)}});this._mathJs.import({base64Encode:n})}if(!this._mathJs.base64Decode){var r=this._mathJs.typed("base64Decode",{string:function(t){return e._functionBase64Decode(t)}});this._mathJs.import({base64Decode:r})}},t.Base64EncodingExtension.prototype._functionBase64Encode=function(e){return void 0===e||null===e?"":t.base64Encode(e)},t.Base64EncodingExtension.prototype._functionBase64Decode=function(e){return void 0===e||null===e?[]:t.base64Decode(e)}}(window.clc=window.clc||{}),function(t){t.UnicodeEncodingExtension=function(){this._mathJs=null},t.UnicodeEncodingExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.toCodePoints){var n=this._mathJs.typed("toCodePoints",{string:function(t){return e._functionToCodePoints(t)}});this._mathJs.import({toCodePoints:n})}if(!this._mathJs.fromCodePoints){var r=this._mathJs.typed("fromCodePoints",{Array:function(t){return e._functionFromCodePoints(t)}});this._mathJs.import({fromCodePoints:r})}if(!this._mathJs.toUtf8){var i=this._mathJs.typed("toUtf8",{string:function(t){return e._functionToUtf8(t)}});this._mathJs.import({toUtf8:i})}if(!this._mathJs.fromUtf8){var o=this._mathJs.typed("fromUtf8",{Array:function(t){return e._functionFromUtf8(t)}});this._mathJs.import({fromUtf8:o})}},t.UnicodeEncodingExtension.prototype._functionToCodePoints=function(e){return void 0===e||null===e||0===e.length?[]:t.stringToUnicodeCodePointList(e)},t.UnicodeEncodingExtension.prototype._functionFromCodePoints=function(e){return void 0===e||null===e||0===e.length?"":t.stringFromUnicodeCodePointList(e)},t.UnicodeEncodingExtension.prototype._functionToUtf8=function(e){return void 0===e||null===e||0===e.length?[]:t.stringToUtf8Array(e)},t.UnicodeEncodingExtension.prototype._functionFromUtf8=function(e){return void 0===e||null===e||0===e.length?"":t.stringFromUtf8Array(e)}}(window.clc=window.clc||{}),function(t){t.HashesExtension=function(){this._mathJs=null},t.HashesExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.md5){var n=this._mathJs.typed("md5",{Array:function(t){return e._functionMd5(t)}});this._mathJs.import({md5:n})}if(!this._mathJs.sha1){var r=this._mathJs.typed("sha1",{Array:function(t){return e._functionSha1(t)}});this._mathJs.import({sha1:r})}if(!this._mathJs.sha224){var i=this._mathJs.typed("sha224",{Array:function(t){return e._functionSha224(t)}});this._mathJs.import({sha224:i})}if(!this._mathJs.sha256){var o=this._mathJs.typed("sha256",{Array:function(t){return e._functionSha256(t)}});this._mathJs.import({sha256:o})}},t.HashesExtension.prototype._functionMd5=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.md5(e)},t.HashesExtension.prototype._functionSha1=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.sha1(e)},t.HashesExtension.prototype._functionSha224=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.sha224(e)},t.HashesExtension.prototype._functionSha256=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.sha256(e)}}(window.clc=window.clc||{}),function(t){function e(t,e){return(t<<e|t>>>32-e)>>>0}function n(t,e){return(t>>>e|t<<32-e)>>>0}function r(t){return((4278190080&t)>>>24|(16711680&t)>>>8|(65280&t)<<8|(255&t)<<24)>>>0}function i(e,n,r){return(t.toUint8(e[n+4*r+3])<<24|t.toUint8(e[n+4*r+2])<<16|t.toUint8(e[n+4*r+1])<<8|t.toUint8(e[n+4*r]))>>>0}function o(t,e,n){return r(i(t,e,n))}function s(t,e){return 0===t?e:1+(t-1|63)}function a(e){var n,r=[];for(n=0;n<e.length;++n)r.push(t.toUint8(e[n]));return r}function l(t,e,n){for(var r=0;r<n;++r)t.push(e)}function c(t,e,n,i){if(!i){var o=e;e=r(n),n=r(o)}for(var s=0;s<8;++s)s<4?t.push(n>>>8*s&255):t.push(e>>>8*(s-4)&255)}var h=16777215;!function(){var n=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],o=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];t.md5=function(u){if(u.length>h)throw new Error("Array is too big. Maximum allowed size: "+h);var p=a(u),g=u.length;p.push(128),l(p,0,s(g+9)-g-9),c(p,0,8*g,!0);for(var d=1732584193,f=4023233417,m=2562383102,_=271733878,v=0;v<p.length;v+=64){for(var b=d,x=f,y=m,w=_,E=0;E<64;++E){var P,C;E<16?(P=x&y|~x&w,C=E):E<32?(P=w&x|~w&y,C=(5*E+1)%16):E<48?(P=x^y^w,C=(3*E+5)%16):(P=y^(x|~w),C=7*E%16),P=P+b+o[E]+i(p,v,C)>>>0,b=w,w=y,y=x,x=x+e(P,n[E])>>>0}d=d+b>>>0,f=f+x>>>0,m=m+y>>>0,_=_+w>>>0}return t.padLeft(r(d).toString(16),"0",8)+t.padLeft(r(f).toString(16),"0",8)+t.padLeft(r(m).toString(16),"0",8)+t.padLeft(r(_).toString(16),"0",8)}}(),t.sha1=function(n){if(n.length>h)throw new Error("Array is too big. Maximum allowed size: "+h);var r=a(n),i=n.length;r.push(128),l(r,0,s(i+9)-i-9),c(r,0,8*i,!1);for(var u=1732584193,p=4023233417,g=2562383102,d=271733878,f=3285377520,m=0;m<r.length;m+=64){var _,v=u,b=p,x=g,y=d,w=f,E=[];for(_=0;_<80;++_)_<16?E.push(o(r,m,_)):E.push(e(E[_-3]^E[_-8]^E[_-14]^E[_-16],1));for(_=0;_<80;++_){var P,C;_<20?(P=b&x|~b&y,C=1518500249):_<40?(P=b^x^y,C=1859775393):_<60?(P=b&x|b&y|x&y,C=2400959708):(P=b^x^y,C=3395469782);var L=e(v,5)+P+w+C+E[_]>>>0;w=y,y=x,x=e(b,30),b=v,v=L}u=u+v>>>0,p=p+b>>>0,g=g+x>>>0,d=d+y>>>0,f=f+w>>>0}return t.padLeft(u.toString(16),"0",8)+t.padLeft(p.toString(16),"0",8)+t.padLeft(g.toString(16),"0",8)+t.padLeft(d.toString(16),"0",8)+t.padLeft(f.toString(16),"0",8)},function(){function e(t,e,r,i,u,p,g,d,f,m){if(t.length>h)throw new Error("Array is too big. Maximum allowed size: "+h);var _=a(t),v=t.length;_.push(128),l(_,0,s(v+9)-v-9),c(_,0,8*v,!1);for(var b=0;b<_.length;b+=64){var x,y=r,w=i,E=u,P=p,C=g,L=d,S=f,k=m,F=[];for(x=0;x<64;++x)if(x<16)F.push(o(_,b,x));else{var N=n(F[x-15],7)^n(F[x-15],18)^F[x-15]>>>3,T=n(F[x-2],17)^n(F[x-2],19)^F[x-2]>>>10;F.push(F[x-16]+N+F[x-7]+T>>>0)}for(x=0;x<64;++x){var U=n(C,6)^n(C,11)^n(C,25),D=n(y,2)^n(y,13)^n(y,22),J=y&w^y&E^w&E,B=k+U+(C&L^~C&S)+e[x]+F[x]>>>0;k=S,S=L,L=C,C=P+B>>>0,P=E,E=w,w=y,y=B+(D+J>>>0)>>>0}r=r+y>>>0,i=i+w>>>0,u=u+E>>>0,p=p+P>>>0,g=g+C>>>0,d=d+L>>>0,f=f+S>>>0,m=m+k>>>0}return[r,i,u,p,g,d,f,m]}var r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];t.sha224=function(n){var i=e(n,r,3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428);return t.padLeft(i[0].toString(16),"0",8)+t.padLeft(i[1].toString(16),"0",8)+t.padLeft(i[2].toString(16),"0",8)+t.padLeft(i[3].toString(16),"0",8)+t.padLeft(i[4].toString(16),"0",8)+t.padLeft(i[5].toString(16),"0",8)+t.padLeft(i[6].toString(16),"0",8)},t.sha256=function(n){var i=e(n,r,1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225);return t.padLeft(i[0].toString(16),"0",8)+t.padLeft(i[1].toString(16),"0",8)+t.padLeft(i[2].toString(16),"0",8)+t.padLeft(i[3].toString(16),"0",8)+t.padLeft(i[4].toString(16),"0",8)+t.padLeft(i[5].toString(16),"0",8)+t.padLeft(i[6].toString(16),"0",8)+t.padLeft(i[7].toString(16),"0",8)}}()}(window.clc=window.clc||{}),function(t){t.LerpExtension=function(){this._mathJs=null},t.LerpExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.lerp){var n=this._mathJs.typed("lerp",{"BigNumber, BigNumber, BigNumber":function(t,n,r){return e._functionLerpNumber(t,n,r)},"Color, Color, BigNumber":function(t,n,r){return e._functionLerpColor(t,n,r)}});this._mathJs.import({lerp:n})}},t.LerpExtension.prototype._functionLerpNumber=function(t,e,n){if(n.lessThan(0)||n.greaterThan(1))throw new Error("Interpolation coefficient must be in range [0, 1]");var r=new this._mathJs.bignumber(1).minus(n).times(t),i=n.times(e);return r.plus(i)},t.LerpExtension.prototype._functionLerpColor=function(e,n,r){if(r.lessThan(0)||r.greaterThan(1))throw new Error("Interpolation coefficient must be in range [0, 1]");var i=t.mathJsToValidNumber(r),o=e.op([1-i,1-i,1-i,1-i],function(t,e){return t*e}),s=n.op([i,i,i,i],function(t,e){return t*e});return o.op(s.toArgbf(),function(t,e){return t+e})}}(window.clc=window.clc||{}),function(t){t.FunctionPlot2D=function(e,n,r,i,o,s){this.id=t.randomId("plot2d-"),this._mathJs=s;var a=o.totalWidth-o.axisYWidth,l=o.totalHeight-o.axisXHeight-o.legendHeight,c=Math.abs(a/(r[1]-r[0])),h=a/2-.5*(r[0]+r[1])*c;this._graphParameters={size:{width:a,height:l},transform:{x:{scale:c,offset:h},y:{scale:-c,offset:l/2}},scale:{x:{begin:0,step:0},y:{begin:0,step:0}},offset:{x:o.axisYWidth,y:o.legendHeight},state:{isDragging:!1,beginDragX:0,beginDragY:0}},this._function={expression:e,variable:n,domain:r,scope:i},this._attributes={svg:{id:this.id,class:"function-plot2d",width:o.totalWidth,height:o.totalHeight},"svg.legend.text":{class:"function-plot2d-legend","text-anchor":"end",x:o.totalWidth,y:15},"svg.canvas.g":{class:"function-plot2d-canvas",transform:"translate(0, "+o.legendHeight+")"},"svg.canvas.defs.clipPath":{id:"clip-path-"+this.id},"svg.canvas.defs.clipPath.rect":{width:this._graphParameters.size.width,height:this._graphParameters.size.height},"svg.canvas.axisX.g":{class:"function-plot2d-axis-x",transform:"translate("+o.axisYWidth+", "+this._graphParameters.size.height+")"},"svg.canvas.axisX.g.path":{"shape-rendering":"crispedges",d:"M0,0H"+this._graphParameters.size.width},"svg.canvas.axisX.g.scale.g.text":{style:"text-anchor: middle;",y:"1.5em"},"svg.canvas.axisX.g.scale.g.line":{x1:0,y1:0,x2:0,y2:5,"shape-rendering":"crispedges","stroke-width":1},"svg.canvas.axisY.g":{class:"function-plot2d-axis-y",transform:"translate("+o.axisYWidth+", 0)"},"svg.canvas.axisY.g.path":{"shape-rendering":"crispedges",d:"M0,0V"+this._graphParameters.size.height},"svg.canvas.axisY.g.scale.g.text":{style:"text-anchor: end;",x:"-0.5em",dy:"0.31em"},"svg.canvas.axisY.g.scale.g.line":{x1:0,y1:0,x2:-5,y2:0,"shape-rendering":"crispedges","stroke-width":1},"svg.canvas.eventGrabArea.rect":{class:"function-plot2d-event-grab",width:this._graphParameters.size.width,height:this._graphParameters.size.height,fill:"none",x:o.axisYWidth},"svg.canvas.graph.g":{transform:"translate("+o.axisYWidth+", 0)","clip-path":"url(#clip-path-"+this.id+")"},"svg.canvas.graph.originX.path":{class:"function-plot2d-origin-x","stroke-width":"1","shape-rendering":"crispedges",d:"M0,"+this._toScreenY(0)+"H"+this._graphParameters.size.width},"svg.canvas.graph.originY.path":{class:"function-plot2d-origin-y","stroke-width":"1","shape-rendering":"crispedges",d:"M"+this._toScreenX(0)+",0V"+this._graphParameters.size.height},"svg.canvas.graph.data.path":{class:"function-plot2d-graph","stroke-width":1,fill:"none","stroke-linecap":"round",d:""}},this._xmlns="http://www.w3.org/2000/svg",this._elements={},this.update()},t.FunctionPlot2D.prototype.svg=function(){return this._elements={},t.htmlTag("svg",this._attributes.svg,[this._legend(),this._canvas()])},t.FunctionPlot2D.prototype.update=function(){if(!this._elements.svg){var t=$("#"+this.id);t.length&&(this._elements.svg=t.eq(0),this._elements.axis={x:this._elements.svg.find("."+this._attributes["svg.canvas.axisX.g"].class).eq(0),y:this._elements.svg.find("."+this._attributes["svg.canvas.axisY.g"].class).eq(0)},this._elements.origin={x:this._elements.svg.find("."+this._attributes["svg.canvas.graph.originX.path"].class).eq(0),y:this._elements.svg.find("."+this._attributes["svg.canvas.graph.originY.path"].class).eq(0)},this._elements.graph=this._elements.svg.find("."+this._attributes["svg.canvas.graph.data.path"].class).eq(0))}this._updateAxisScale(),this._updateOrigin(),this._updateFunctionData()},t.FunctionPlot2D.prototype.setPointerCoordinates=function(e,n){this._elements.legend||(this._elements.legend=$("#"+this.id+" ."+this._attributes["svg.legend.text"].class));var r=1/this._graphParameters.transform.x.scale,i=Math.floor(Math.log10(r)),o=Math.abs(t.clamp(i-1,-15,0)),s=(+this._fromScreenX(e-this._graphParameters.offset.x).toFixed(o)).toString(),a=(+this._fromScreenY(n-this._graphParameters.offset.y).toFixed(o)).toString();this._elements.legend.text("X: "+s+", Y: "+a)},t.FunctionPlot2D.prototype.clearLegend=function(){this._elements.legend||(this._elements.legend=$("#"+this.id+" ."+this._attributes["svg.legend.text"].class)),this._elements.legend.text("")},t.FunctionPlot2D.prototype.zoom=function(t){var e=t>0?1.1:.9;this._graphParameters.transform.x.scale*=e,this._graphParameters.transform.y.scale*=e,this.update()},t.FunctionPlot2D.prototype.beginDrag=function(t,e){this._graphParameters.state.isDragging=!0,this._graphParameters.state.beginDragX=t,this._graphParameters.state.beginDragY=e},t.FunctionPlot2D.prototype.endDrag=function(){this._graphParameters.state.isDragging=!1},t.FunctionPlot2D.prototype.onDrag=function(t,e){this._graphParameters.state.isDragging&&(this._graphParameters.transform.x.offset+=t-this._graphParameters.state.beginDragX,this._graphParameters.transform.y.offset+=e-this._graphParameters.state.beginDragY,this._graphParameters.state.beginDragX=t,this._graphParameters.state.beginDragY=e,this.update())},t.FunctionPlot2D.prototype._legend=function(){return t.htmlTag("text",this._attributes["svg.legend.text"])},t.FunctionPlot2D.prototype._canvas=function(){return t.htmlTag("g",this._attributes["svg.canvas.g"],[this._defs(),this._axisX(),this._axisY(),this._graph(),this._eventGrabArea()])},t.FunctionPlot2D.prototype._defs=function(){return t.htmlTag("defs",null,t.htmlTag("clipPath",this._attributes["svg.canvas.defs.clipPath"],t.htmlTag("rect",this._attributes["svg.canvas.defs.clipPath.rect"])))},t.FunctionPlot2D.prototype._axisX=function(){var e=this._axisXScale(!1);return e.push(t.htmlTag("path",this._attributes["svg.canvas.axisX.g.path"])),t.htmlTag("g",this._attributes["svg.canvas.axisX.g"],e)},t.FunctionPlot2D.prototype._axisY=function(){var e=this._axisYScale(!1);return e.push(t.htmlTag("path",this._attributes["svg.canvas.axisY.g.path"])),t.htmlTag("g",this._attributes["svg.canvas.axisY.g"],e)},t.FunctionPlot2D.prototype._axisXScale=function(e){for(var n=this,r=[],i=e?function(e,r,i){return t.domElement(n._xmlns,e,r,i)}:t.htmlTag,o=this._boundsX(),s=this._graphParameters.scale.x.begin;s<=o[1];s+=this._graphParameters.scale.x.step){var a=i("g",{transform:"translate("+this._toScreenX(s)+", 0)"},[i("text",this._attributes["svg.canvas.axisX.g.scale.g.text"],this._prettyPrintNumber(s)),i("line",this._attributes["svg.canvas.axisX.g.scale.g.line"])]);r.push(a)}return r},t.FunctionPlot2D.prototype._axisYScale=function(e){for(var n=this,r=[],i=e?function(e,r,i){return t.domElement(n._xmlns,e,r,i)}:t.htmlTag,o=this._boundsY(),s=this._graphParameters.scale.y.begin;s<=o[1];s+=this._graphParameters.scale.y.step){var a=i("g",{transform:"translate(0, "+this._toScreenY(s)+")"},[i("text",this._attributes["svg.canvas.axisY.g.scale.g.text"],this._prettyPrintNumber(s)),i("line",this._attributes["svg.canvas.axisY.g.scale.g.line"])]);r.push(a)}return r},t.FunctionPlot2D.prototype._graph=function(){return this._attributes["svg.canvas.graph.data.path"].d=this._data,t.htmlTag("g",this._attributes["svg.canvas.graph.g"],[this._origin(),t.htmlTag("path",this._attributes["svg.canvas.graph.data.path"])])},t.FunctionPlot2D.prototype._origin=function(){return t.htmlTag("path",this._attributes["svg.canvas.graph.originX.path"])+t.htmlTag("path",this._attributes["svg.canvas.graph.originY.path"])},t.FunctionPlot2D.prototype._updateOrigin=function(){this._elements.origin&&(this._elements.origin.x.attr("d","M0,"+this._toScreenY(0)+"H"+this._graphParameters.size.width),this._elements.origin.y.attr("d","M"+this._toScreenX(0)+",0V"+this._graphParameters.size.height))},t.FunctionPlot2D.prototype._eventGrabArea=function(){return t.htmlTag("rect",this._attributes["svg.canvas.eventGrabArea.rect"])},t.FunctionPlot2D.prototype._updateFunctionData=function(){this._data=this._sampleFunctionData(),this._elements.graph&&this._elements.graph.attr("d",this._data)},t.FunctionPlot2D.prototype._sampleFunctionData=function(){for(var e,n,r,i,o=1/this._graphParameters.transform.x.scale,s=this._boundsX(),a="M",l="",c=s[0];c<=s[1];c+=o)if(this._function.scope[this._function.variable]=this._mathJs.bignumber(c),e=this._function.expression.eval(this._function.scope),n=!(void 0===e||null===e),r="number"==typeof e||e instanceof Number,i=!!e.toNumber,n&&(r&&isFinite(e)||i&&e.isFinite())){var h=t.clamp(this._toScreenY(i?e.toNumber():e),-1073741824,1073741824);l+=a+t.round1Dec(this._toScreenX(c))+", "+t.round1Dec(h),a="L"}else a="M";return l},t.FunctionPlot2D.prototype._updateAxisScale=function(){if(this._graphParameters.scale.x=this._calculateScaleParameters(this._boundsX()[0],this._graphParameters.size.width/this._graphParameters.transform.x.scale),this._graphParameters.scale.y=this._calculateScaleParameters(this._boundsY()[0],-this._graphParameters.size.height/this._graphParameters.transform.y.scale),this._elements.axis){this._elements.axis.x.find("g").remove();var t,e=this._axisXScale(!0);for(t=0;t<e.length;++t)this._elements.axis.x.append(e[t]);for(this._elements.axis.y.find("g").remove(),e=this._axisYScale(!0),t=0;t<e.length;++t)this._elements.axis.y.append(e[t])}},t.FunctionPlot2D.prototype._calculateScaleParameters=function(t,e){var n=Math.pow(10,Math.floor(Math.log10(e)+.2)),r=e/n,i=(r<=1.5?1:r<=3?2:5)*n/10,o=Math.ceil(t/i);return{begin:i>=1?o*i:o*(10/n*i)/(10/n),step:i}},t.FunctionPlot2D.prototype._prettyPrintNumber=function(t){return 0==t?"0":(+t.toFixed(14)).toString()},t.FunctionPlot2D.prototype._toScreenX=function(t){return t*this._graphParameters.transform.x.scale+this._graphParameters.transform.x.offset},t.FunctionPlot2D.prototype._toScreenY=function(t){return t*this._graphParameters.transform.y.scale+this._graphParameters.transform.y.offset},t.FunctionPlot2D.prototype._fromScreenX=function(t){return(t-this._graphParameters.transform.x.offset)/this._graphParameters.transform.x.scale},t.FunctionPlot2D.prototype._fromScreenY=function(t){return(t-this._graphParameters.transform.y.offset)/this._graphParameters.transform.y.scale},t.FunctionPlot2D.prototype._boundsX=function(){return[this._fromScreenX(0),this._fromScreenX(this._graphParameters.size.width)]},t.FunctionPlot2D.prototype._boundsY=function(){return[this._fromScreenY(this._graphParameters.size.height),this._fromScreenY(0)]}}(window.clc=window.clc||{}),function(t){t.PlotExtension=function(){this._mathJs=null,this._plots={},this._defaultPlotParameters={totalWidth:500,totalHeight:350,legendHeight:20,axisXHeight:25,axisYWidth:50},this._initializeEventListeners()},t.PlotExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.plot2d){var n=function(t,n,r){return e._functionPlot2D(t,r)};n.rawArgs=!0,this._mathJs.import({plot2d:n})}},t.PlotExtension.prototype._initializeEventListeners=function(){function t(t){return $(t).parent().parent()}var e=this;$(document).on({mousemove:function(n){var r=t(n.target),i=e._plots[r.attr("id")],o=r.offset();i.setPointerCoordinates(Math.round(n.pageX-o.left),Math.round(n.pageY-o.top)),i.onDrag(n.clientX,n.clientY),n.preventDefault()},mouseout:function(n){var r=e._plots[t(n.target).attr("id")];r.clearLegend(),r.endDrag()},mousedown:function(n){e._plots[t(n.target).attr("id")].beginDrag(n.clientX,n.clientY),n.preventDefault()},mouseup:function(n){e._plots[t(n.target).attr("id")].endDrag(),n.preventDefault()},mousewheel:function(n){e._plots[t(n.target).attr("id")].zoom(n.deltaY)}},".function-plot2d-event-grab")},t.PlotExtension.prototype._functionPlot2D=function(e,n){var arguments=this._getPlot2dArguments(e,n),r=new t.FunctionPlot2D(arguments.expression,arguments.variable,arguments.domain,n,this._defaultPlotParameters,this._mathJs);return this._plots[r.id]=r,new t.CallbackResult(function(){return r.svg()})},t.PlotExtension.prototype._getPlot2dArguments=function(e,n){var r={};if(!e||3!==e.length)throw new Error("'plot2d' function expects 3 arguments: function expression, argument variable, argument domain interval");if("FunctionNode"!==e[0].type&&"OperatorNode"!==e[0].type&&"SymbolNode"!==e[0].type&&"ConstantNode"!==e[1].type)throw new Error("First argument must be an expression");if("SymbolNode"!==e[1].type)throw new Error("Second argument must be an independent variable name");if("ArrayNode"!==e[2].type||2!==e[2].items.length)throw new Error("Third argument must be an interval representing domain of a function");if(r.domain=[t.mathJsToValidNumber(e[2].items[0].eval(n)),t.mathJsToValidNumber(e[2].items[1].eval(n))],r.domain[0]>=r.domain[1])throw new Error("Domain interval must be in form [min, max] where min < max");return r.domain[0]=r.domain[0]-Math.abs(.1*r.domain[0]),r.domain[1]=r.domain[1]+Math.abs(.1*r.domain[1]),r.expression=e[0].compile(),r.variable=e[1].name,r}}(window.clc=window.clc||{}),function(t){t.HexBinLiteralsExtension=function(){this._mathJs=null,this._literalRegexp=new RegExp("(?:^|[^A-Za-z0-9_\\\\$\\.])((0[bB][10\\.]+)|(0[xX][A-Fa-f0-9\\.]+))\\b","g")},t.HexBinLiteralsExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.hex){var n=this._mathJs.typed("hex",{"Array | Matrix":function(t){return e._mathJs.map(t,function(t){return e._functionHex(t)})},BigNumber:function(t){return e._functionHex(t)}});this._mathJs.import({hex:n})}if(!this._mathJs.bin){var r=this._mathJs.typed("bin",{"Array | Matrix":function(t){return e._mathJs.map(t,function(t){return e._functionBin(t)})},BigNumber:function(t){return e._functionBin(t)}});this._mathJs.import({bin:r})}},t.HexBinLiteralsExtension.prototype.preprocess=function(t){var e=this;return t.replace(this._literalRegexp,function(t,n){if(n&&n.length>2){var r=e._mathJs.bignumber(n);return t.length===n.length?r.toString():t[0]+r.toString()}})},t.HexBinLiteralsExtension.prototype._functionHex=function(t){return t.toHex()},t.HexBinLiteralsExtension.prototype._functionBin=function(t){return t.toBinary()}}(window.clc=window.clc||{}),function(t){t.LinksHandler=function(e){this._getExpressionCallback=e||null,this._isLogLinkButtonEnabled=!0,this._elements={logLinkButton:$("#generate-log-link-button")};var n=this._isCopyingToClipboardSupported();this._popoverTemplateId=n?"#template-create-link-popover":"#template-create-link-popover-no-copy",this._expressionLinkButtonHtml=$("#template-create-expression-link-button").html(),e&&(this._initializeLogLinkUi(),this._initializeExpressionLinkUi(),$(document).on("hidden.bs.popover",function(t){$(t.target).data("bs.popover").inState.click=!1}),n&&$(document).on("click",".copy-link-to-clipboard",function(e){try{if($(e.target).parents(".input-group").find("input").select(),!document.execCommand("copy"))throw new Error('Failed to execute execCommand("copy")')}catch(e){t.log("Failed to copy to clipboard: "+e.name+", "+e.message)}}))},t.LinksHandler.prototype.setLogLinkButtonEnabled=function(t){this._isLogLinkButtonEnabled!==t&&(this._isLogLinkButtonEnabled=t,this._elements.logLinkButton.toggleClass("disabled",!this._isLogLinkButtonEnabled))},t.LinksHandler.prototype.getExpressionsListFromUrl=function(){var e=this._getExpressonsListFromUrl();if(null===e)return null;try{return this._deserializeExpressionsList(e)}catch(e){return t.log(e.name+", "+e.message),null}},t.LinksHandler.prototype.injectExpressionLinkButton=function(t){t.append(this._expressionLinkButtonHtml)},t.LinksHandler.prototype._isCopyingToClipboardSupported=function(){try{return!!document.queryCommandSupported("copy")}catch(t){return!1}},t.LinksHandler.prototype._initializeLogLinkUi=function(){var t=this;this._elements.logLinkButton.popover({placement:function(){return $(window).width()<768?"bottom":"right"},container:"body",html:!0,title:"Link Generated",trigger:"manual",content:function(){return $(t._popoverTemplateId).html().replace("{link}",t._getExpressionsLink())}}),this._elements.logLinkButton.click(function(){t._isLogLinkButtonEnabled&&$(this).popover("show")}),this._elements.logLinkButton.on("shown.bs.popover",function(){var t=$(this).attr("aria-describedby");$("#"+t+" input").focus().select(),$(this).addClass("active")}),this._elements.logLinkButton.on("hidden.bs.popover",function(){$(this).removeClass("active")}),$(document).on("click",function(e){var n=t._elements.logLinkButton,r=n.attr("aria-describedby")||null;r&&n.hasClass("active")&&0===$("#"+r).has(e.target).length&&n.popover("hide")})},t.LinksHandler.prototype._initializeExpressionLinkUi=function(){var t=this;this._visibleExpressionLinkPopover=null,$("body").popover({placement:"left",container:"body",html:!0,title:"Expression Link Generated",trigger:"click",selector:".create-expression-link-button",content:function(){return $(t._popoverTemplateId).html().replace("{link}",t._getExpressionsLink($(this).parents(".command")))}}),$("body").on("shown.bs.popover",function(e){var n=$(e.target);if(n.hasClass("create-expression-link-button")){n.parents(".command").addClass("active");var r=n.attr("aria-describedby");$("#"+r+" input").focus().select(),t._visibleExpressionLinkPopover=$("#"+r)}}),$("body").on("hidden.bs.popover",function(t){var e=$(t.target);e.hasClass("create-expression-link-button")&&e.parents(".command").removeClass("active")}),$(document).on("click",function(e){t._visibleExpressionLinkPopover&&0===t._visibleExpressionLinkPopover.has(e.target).length&&(t._visibleExpressionLinkPopover.popover("hide"),t._visibleExpressionLinkPopover=null)})},t.LinksHandler.prototype._getExpressionsLink=function(t){var e=this._getExpressionCallback(t),n=this._serializeExpressionsList(e);return this._buildLink(n)},t.LinksHandler.prototype._serializeExpressionsList=function(e){var n={c:e,v:"1"},r=JSON.stringify(n);return t.base64Encode(t.stringToUtf8Array(r))},t.LinksHandler.prototype._deserializeExpressionsList=function(e){var n=t.stringFromUtf8Array(t.base64Decode(e));return JSON.parse(n).c},t.LinksHandler.prototype._buildLink=function(t){var e=window.location.href.split("/");return e[0]+"//"+e[2]+"#"+t},t.LinksHandler.prototype._getExpressonsListFromUrl=function(){if(!window.location.hash)return null;var t=window.location.hash.substring(1);return t.length?t:null}}(window.clc=window.clc||{}),function(t){t.SyntaxHighlighter=function(){this._constants=[].concat(t.MATH_JS_CONSTANTS,["true","false"]),this._keywords=[].concat(t.MATH_JS_FUNCTIONS,t.CLCALC_FUNCTIONS),this._re={identifier:new RegExp("([0-9]*)([A-Za-z_$][A-Za-z0-9_$]*)","g"),color:new RegExp("#[A-Fa-f0-9]{6,8}","g")},this._classes={constant:"highlight-constant",keyword:"highlight-keyword",color:"highlight-color"}},t.SyntaxHighlighter.prototype.highlight=function(t){var e=this;return t.replace(this._re.identifier,function(t,n,r){if(e._isValidIdentifier(n,r)){if(-1!==e._constants.indexOf(r))return n+"[[;;;highlight-constant;]"+r+"]";if(-1!==e._keywords.indexOf(r))return n+"[[;;;highlight-keyword;]"+r+"]"}return t}).replace(this._re.color,function(t){return 7===t.length||9===t.length?"[[;;;highlight-color;]"+t+"]":t})},t.SyntaxHighlighter.prototype._isValidIdentifier=function(t,e){return!(!e||0===e.length)&&(!t||1!==t.length||"0"!==t[0]||"x"!==e[0]&&"X"!==e[0]&&"b"!==e[0]&&"B"!==e[0])}}(window.clc=window.clc||{}),function(t){t.TexHandler=function(){this._pendingExpressions=[],this._elements={togglePanelButton:$("#toggle-tex-panel-button"),panel:$(".tex-panel"),panelWrapper:$(".tex-wrapper")},this._katexLoadUrl="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha1/katex.min.js",this._katexLoadInProgress=!1,this._initializeUi()},t.TexHandler.prototype.addEvaluatedExpression=function(t,e){this._pendingExpressions.push({expression:t,value:e||null}),this._render()},t.TexHandler.prototype.clear=function(){this._pendingExpressions=[],this._elements.panel.empty()},t.TexHandler.prototype._isPanelVisible=function(){return"none"!==this._elements.panelWrapper.css("display")},t.TexHandler.prototype._setPanelVisible=function(t){t?this._elements.panelWrapper.css("display",$(window).width()<768?"table-row":"table-cell"):this._elements.panelWrapper.css("display","none")},t.TexHandler.prototype._initializeUi=function(){var t=this;this._elements.togglePanelButton.click(function(){t._isPanelVisible()?t._hidePanel():t._showPanel()})},t.TexHandler.prototype._showPanel=function(){var t=this;this._elements.togglePanelButton.addClass("active"),"undefined"==typeof katex?this._loadKatex(function(){t._showPanel()}):(this._setPanelVisible(!0),this._render())},t.TexHandler.prototype._hidePanel=function(){this._elements.togglePanelButton.removeClass("active"),this._setPanelVisible(!1)},t.TexHandler.prototype._loadKatex=function(e){var n=this;this._katexLoadInProgress||(this._katexLoadInProgress=!0,$.getScript(this._katexLoadUrl).done(function(){n._katexLoadInProgress=!1,e()}).fail(function(e,r,i){n._katexLoadInProgress=!1,t.log("Failed to load Katex library: "+i.name+", "+i.message)}))},t.TexHandler.prototype._render=function(){if(this._isPanelVisible()){for(var t=0;t<this._pendingExpressions.length;++t){var e=this._pendingExpressions[t],n=$('<div class="tex-block"></div>'),r=$('<div class="tex-expression"></div>');if(this._elements.panel.append(n),n.append(r),katex.render(e.expression,r[0]),null!==e.value){var i=$('<div class="tex-value"></div>');n.append(i),katex.render(e.value,i[0])}}this._pendingExpressions.length&&(this._pendingExpressions=[],this._elements.panel.scrollTop(this._elements.panel[0].scrollHeight))}}}(window.clc=window.clc||{});
\ No newline at end of file
$(document).ready(function(){function t(t){var e="";return t.find(">div>span").each(function(t,r){e+=0===t?$(r).text().substr(n.length):$(r).text()}),e}$('[data-toggle="tooltip"]').tooltip();var e=new clc.Calculator(math);e.installExtension(new clc.HexBinLiteralsExtension),e.installExtension(new clc.UnicodeEncodingExtension),e.installExtension(new clc.Base64EncodingExtension),e.installExtension(new clc.HashesExtension),e.installExtension(new clc.ColorExtension(!0)),e.installExtension(new clc.LerpExtension),e.installExtension(new clc.PlotExtension);var n=">",r=new clc.LinksHandler(function(e){if(void 0!==e)return[t(e)];var n=[];return $(".terminal-output .command").each(function(e,r){var i=t($(r));clc.isStringBlank(i)||n.push(i)}),n}),i=new clc.TexHandler,o=new clc.SyntaxHighlighter;r.setLogLinkButtonEnabled(!1),$.terminal.defaults.formatters.push(function(t){return o.highlight(t)});var s=$(".console-panel").terminal(function(t){if(!clc.isStringBlank(t)){r.setLogLinkButtonEnabled(!0);try{var n=e.evaluate(t);i.addEvaluatedExpression(n.tex,n.result.tex||null),n.result.postprocessed?this.echo(n.result.postprocessed,{raw:!0}):n.result.raw instanceof clc.CallbackResult&&this.echo(n.result.raw.callback,{raw:!0})}catch(t){this.echo("[[;;;terminal-output-error;]"+t.name+": "+t.message+"]")}}},{completion:clc.COMPLETION_KEYWORDS,onEchoCommand:function(t){var e=t.find("div span"),i=e.length?e.text().substring(n.length):"";clc.isStringBlank(i)||r.injectExpressionLinkButton(t.find(">div").last())},name:"clcalc",prompt:"[[;;;prompt-wrapper]"+n+"]",exit:!1,memory:!0,enabled:!0,greetings:function(){this.echo('<div class="welcome-message">Type math expression and press enter to calculate the result. You can use up/down keys to navigate commands history and tab key for autocompletion. Check <a href="/help.html#quickstart" target="_blank">Quick Start</a> guide for some examples.</div>',{raw:!0})},onClear:function(){r.setLogLinkButtonEnabled(!1),i.clear()}});s.option("mousewheel",function(t){return!clc.FunctionPlot2D.isEventConsumed(t)}),window.onhashchange=function(){window.location.reload()};var a=r.getExpressionsListFromUrl();if(a){var l=new RegExp(String.fromCharCode(160),"g");for(var c in a)s.exec(a[c].replace(l," "))}}),Math.log10||(Math.log10=function(t){return Math.log(t)/Math.LN10}),Math.sign||(Math.sign=function(t){return(t>0)-(t<0)||+t}),function(t){t.isStringBlank=function(t){if(!t||!t.length)return!0;for(var e=0;e<t.length;++e)if(" "!==t[e]&&"\t"!==t[e]&&"\r"!==t[e]&&"\n"!==t[e]&&160!==t.charCodeAt(e))return!1;return!0},t.repeatString=function(t,e){for(var n="",r=0;r<e;++r)n+=t;return n},t.padLeft=function(e,n,r){return e.length>=r||1!==n.length?e:t.repeatString(n,r-e.length)+e},t.stringToUnicodeCodePointList=function(t){for(var e=[],n=0;n<t.length;++n){var r=t.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<t.length){var i=t.charCodeAt(n+1);i>=56320&&i<=57343&&(r=1024*(r-55296)+i-56320+65536,++n)}e.push(r)}return e},t.stringFromUnicodeCodePointList=function(e){for(var n="",r=0;r<e.length;++r){var i=t.toUint32(e[r]);if(i>1114111)throw new Error("Invalid code point value: "+i+". Must be less then or equal to 0x10FFFF.");if(i>65535){var o=Math.floor((i-65536)/1024)+55296,s=(i-65536)%1024+56320;n+=String.fromCharCode(o,s)}else n+=String.fromCharCode(i)}return n},t.stringToUtf8Array=function(t){var e=[];t=unescape(encodeURIComponent(t));for(var n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e},t.stringFromUtf8Array=function(e){for(var n=[],r=0;r<e.length;){var i,o=t.toUint8(e[r]);if(0==(128&o))i=127&o,r+=1;else if(o>>>5==6){if(r+1>=e.length)throw new Error("Failed to decode utf8 string: excepceted 1 byte after "+o);i=(31&o)<<6|63&t.toUint8(e[r+1]),r+=2}else if(o>>>4==14){if(r+2>=e.length)throw new Error("Failed to decode utf8 string: excepceted 2 bytes after "+o);i=(15&o)<<12|(63&t.toUint8(e[r+1]))<<6|63&t.toUint8(e[r+2]),r+=3}else{if(o>>>3!=30)throw new Error("Failed to decode utf8 string: unexpected byte "+o+" at position "+r);if(r+3>=e.length)throw new Error("Failed to decode utf8 string: excepceted 3 bytes after "+o);i=(7&o)<<18|(63&t.toUint8(e[r+1]))<<12|(63&t.toUint8(e[r+2]))<<6|63&t.toUint8(e[r+3]),r+=4}n.push(i)}return t.stringFromUnicodeCodePointList(n)};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.base64Encode=function(n){if(0===n.length)return"";var r,i="",o=n.length%3;if(o)for(o=3-o,r=0;r<o;++r)n.push(0);for(r=0;r<n.length;r+=3){var s=t.toUint8(n[r]),a=t.toUint8(n[r+1]),l=t.toUint8(n[r+2]);i+=e[s>>>2],i+=e[(3&s)<<4|a>>>4],i+=r===n.length-3&&2===o?"=":e[(15&a)<<2|l>>>6],i+=r===n.length-3&&o?"=":e[63&l]}return i},t.base64Decode=function(t){if(0===t.length)return[];for(var n=[],r=0;r<t.length;r+=4){var i=e.indexOf(t[r]);if(-1===i)throw new Error("Invalid character at index "+r);if(r+1>=t.length)throw new Error("The string is not correctly base64 encoded: next character expected.");var o=e.indexOf(t[r+1]);if(-1===o)throw new Error("Invalid character at index "+r);var s=r+2<t.length?"="===t[r+2]?0:e.indexOf(t[r+2]):0;if(-1===s)throw new Error("Invalid character at index "+r);var a=r+3<t.length?"="===t[r+3]?0:e.indexOf(t[r+3]):0;if(-1===a)throw new Error("Invalid character at index "+r);if(r+2<t.length&&"="===t[r+2]&&(r+3>=t.length||"="!==t[r+3]))throw new Error("The string is not correctly base64 encoded: improper padding.");n.push(i<<2|o>>>4),r+2<t.length&&"="!==t[r+2]&&(n.push((15&o)<<4|s>>>2),r+3<t.length&&"="!==t[r+3]&&n.push((3&s)<<6|a))}return n},t.randomAlnumString=function(t){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r<t;++r)n+=e[Math.floor(Math.random()*e.length)];return n},t.randomId=function(e){return e+t.randomAlnumString(10)},t.round1Dec=function(t){return Math.sign(t)*Math.round(10*Math.abs(t))/10},t.truncateNumber=function(t){return 0|t},t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.mod=function(t,e){return(t%e+e)%e},t.toUint32=function(t){if("number"!=typeof t&&!t.toNumber)throw new Error("Must be a numeric type: "+t);var e=t.toNumber?t.toNumber():t;if(e<0)throw new Error("Number must be non-negative: "+e);if(e>4294967295)throw new Error("Number must fit in 4 byte unsigned integer: "+e);return e>>>0},t.toUint8=function(e){var n=t.toUint32(e);if(e>255)throw new Error("Number exceeds byte range: "+n);return n},t.dropTrailingZeroes=function(t){var e=t.indexOf(".");if(-1!==e){for(var n=t.length-1;n>e&&"0"===t[n];)--n;if(e===n)return t.substring(0,e);if(n<t.length-1)return t.substring(0,n+1)}return t},t.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},t.htmlTag=function(e,n,r){var i="<"+e;if(n)for(var o in n)n.hasOwnProperty(o)&&(i+=" "+o+'="'+n[o]+'"');return r&&t.isArray(r)&&(r=r.join("")),i+=">"+(r||"")+"</"+e+">"},t.domElement=function(e,n,r,i){var o=document.createElementNS(e,n);if(r)for(var s in r)r.hasOwnProperty(s)&&o.setAttribute(s,r[s]);if(i)if(t.isArray(i))for(var a=0;a<i.length;++a)o.appendChild(i[a]);else"string"==typeof i?o.innerHTML=i:o.appendChild(i);return o},t.mathJsToValidNumber=function(t){if("number"==typeof t||t instanceof Number){if(!isFinite(t))throw new Error("Number is infinite or NaN");return t}if(t.toNumber){if(t.isFinite())return t.toNumber();throw new Error("Number is infinite or NaN")}throw new Error("Not a recognized number type")},t.log=function(t){console&&console.log&&console.log(t)}}(window.clc=window.clc||{}),function(t){t.Calculator=function(e){var n=this;this._precisionSignificantDigits=64,this._mathJs=e,this._mathJs.config({number:"BigNumber",precision:this._precisionSignificantDigits}),this._scope={},this._extensions=[],this._numberFormatter=function(e){return e.isBigNumber?t.dropTrailingZeroes(e.toFixed(n._precisionSignificantDigits)):e.toString()}},t.Calculator.prototype.installExtension=function(t){t.extend(this._mathJs),this._extensions.push(t)},t.Calculator.prototype.evaluate=function(e){var n=new t.EvaluatedExpression;if(!t.isStringBlank(e)){var r=this._preprocessExpression(e);try{var i=this._mathJs.parse(r);n.tex=this._nodeToTex(i);var o=i.compile().eval(this._scope);this._isValidValue(o)&&(o instanceof t.CallbackResult?n.result.raw=o:(n.result.raw=this._mathJs.format(o,this._numberFormatter),n.result.postprocessed=this._postprocessValue(n.result.raw),n.result.tex=this._valueToTex(n.result.raw)))}catch(t){throw t.message||(t.message="Failed to parse expression"),e!==r&&(t.message+=". Preprocessed expression: '"+r+"'"),t}}return n},t.Calculator.prototype._preprocessExpression=function(t){for(var e=0;e<this._extensions.length;++e){var n=this._extensions[e];n.preprocess&&(t=n.preprocess(t))}return t},t.Calculator.prototype._postprocessValue=function(t){for(var e=0;e<this._extensions.length;++e){var n=this._extensions[e];n.postprocess&&(t=n.postprocess(t))}return t},t.Calculator.prototype._nodeToTex=function(e){try{return e.toTex()}catch(e){return t.log(e.name+", "+e.message),"Failed to convert expression to TeX"}},t.Calculator.prototype._valueToTex=function(e){try{return this._mathJs.parse(this._preprocessExpression(e)).toTex()}catch(e){return t.log(e.name+", "+e.message),"Failed to convert expression value to TeX"}},t.Calculator.prototype._isValidValue=function(t){return void 0!==t&&"function"!=typeof t}}(window.clc=window.clc||{}),(window.clc=window.clc||{}).CallbackResult=function(t){this.callback=t},(window.clc=window.clc||{}).EvaluatedExpression=function(){this.tex=null,this.result={raw:null,postprocessed:null}},function(t){t.MATH_JS_CONSTANTS=["e","E","i","Infinity","NaN","null","LN2","LN10","LOG2E","LOG10E","phi","pi","PI","tau","SQRT1_2","SQRT2","uninitialized","version"],t.MATH_JS_FUNCTIONS=["bignumber","boolean","chain","complex","createUnit","fraction","index","matrix","number","sparse","splitUnit","string","unit","compile","eval","help","parse","parser","derivative","lsolve","lup","lusolve","qr","simplify","slu","usolve","rationalize","abs","add","cbrt","ceil","cube","divide","dotDivide","dotMultiply","dotPow","exp","fix","floor","gcd","hypot","lcm","log","log10","mod","multiply","norm","nthRoot","pow","round","sign","sqrt","square","subtract","unaryMinus","unaryPlus","xgcd","bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift","bellNumbers","catalan","composition","stirlingS2","arg","conj","im","re","distance","intersect","and","not","or","xor","concat","cross","det","diag","dot","eye","filter","flatten","forEach","inv","kron","map","ones","partitionSelect","range","reshape","resize","size","sort","squeeze","subset","trace","transpose","zeros","combinations","factorial","gamma","kldivergence","multinomial","permutations","pickRandom","random","randomInt","compare","compareNatural","deepEqual","equal","larger","largerEq","smaller","smallerEq","unequal","setCartesian","setDifference","setDistinct","setIntersect","setIsSubset","setMultiplicity","setPowerset","setSize","setSymDifference","setUnion","erf","mad","max","mean","median","min","mode","prod","quantileSeq","std","sum","var","format","print","acos","acosh","acot","acoth","acsc","acsch","asec","asech","asin","asinh","atan","atan2","atanh","cos","cosh","cot","coth","csc","csch","sec","sech","sin","sinh","tan","tanh","to","clone","isInteger","isNaN","isNegative","isNumeric","isPositive","isPrime","isZero","typeof"],t.CLCALC_FUNCTIONS=["Color4b","color4b","color3b","color4f","colorU32","colorHsv","colorHsl","hsv","hsl","rgb","argb","argbf","base64Encode","base64Decode","toCodePoints","fromCodePoints","toUtf8","fromUtf8","md5","sha1","sha224","sha256","lerp","plot2d","hex","bin"],t.COMPLETION_KEYWORDS=["Infinity","NaN","null","LN2","LN10","LOG2E","LOG10E","phi","pi","PI","tau","SQRT1_2","SQRT2","fraction","derivative","lsolve","lup","lusolve","qr","simplify","slu","usolve","rationalize","abs","cbrt","ceil","cube","dotDivide","dotMultiply","dotPow","exp","fix","floor","gcd","hypot","lcm","log","log10","mod","norm","nthRoot","round","sign","sqrt","square","subtract","xgcd","bellNumbers","catalan","composition","stirlingS2","arg","conj","im","re","distance","intersect","and","not","or","xor","concat","cross","det","diag","dot","eye","filter","flatten","forEach","inv","kron","map","ones","partitionSelect","range","reshape","resize","size","sort","squeeze","subset","trace","transpose","zeros","combinations","factorial","gamma","kldivergence","multinomial","permutations","pickRandom","random","randomInt","setCartesian","setDifference","setDistinct","setIntersect","setIsSubset","setMultiplicity","setPowerset","setSize","setSymDifference","setUnion","erf","mad","max","mean","median","min","mode","prod","quantileSeq","std","sum","var","acos","acosh","acot","acoth","acsc","acsch","asec","asech","asin","asinh","atan","atan2","atanh","cos","cosh","cot","coth","csc","csch","sec","sech","sin","sinh","tan","tanh","to","help","clear"].concat(t.CLCALC_FUNCTIONS)}(window.clc=window.clc||{}),function(t){t.ColorExtension=function(t){this._mathJs=null,this._colorLiteral4bRegexp=new RegExp("#[A-Fa-f0-9]{8}","g"),this._colorLiteral43bRegexp=new RegExp("#[A-Fa-f0-9]{6,8}","g"),t&&(this._visibleTooltipIds=[],this._initializeColorTooltips())},t.ColorExtension.prototype.extend=function(e){this._mathJs=e,this._mathJs.typed.addType({name:"Color",test:function(e){return e&&e instanceof t.Color}}),this._registerFunction("Color4b","BigNumber, BigNumber, BigNumber, BigNumber",function(e,n,r,i){return t.Color.from4b(e,n,r,i)},!1,function(e){return"\\mathtt{\\"+t.Color.from4b(parseInt(e.args[0].value),parseInt(e.args[1].value),parseInt(e.args[2].value),parseInt(e.args[3].value)).toString()+"}"}),this._registerFunction("color4b","BigNumber, BigNumber, BigNumber, BigNumber",function(e,n,r,i){return t.Color.from4b(e,n,r,i)}),this._registerFunction("color3b","BigNumber, BigNumber, BigNumber",function(e,n,r){return t.Color.from4b(255,e,n,r)}),this._registerFunction("color4f","BigNumber, BigNumber, BigNumber, BigNumber",function(e,n,r,i){return t.Color.from4f(e,n,r,i)}),this._registerFunction("colorU32","BigNumber",function(e){return t.Color.fromU32(e)}),this._registerFunction("colorHsv","BigNumber, BigNumber, BigNumber",function(e,n,r){return t.Color.fromHsv(e,n,r)}),this._registerFunction("colorHsl","BigNumber, BigNumber, BigNumber",function(e,n,r){return t.Color.fromHsl(e,n,r)}),this._registerFunction("hsv","Color",function(t){return t.toHsv()},!0),this._registerFunction("hsl","Color",function(t){return t.toHsl()},!0),this._registerFunction("rgb","Color",function(t){return t.toArgb().splice(1)},!0),this._registerFunction("argb","Color",function(t){return t.toArgb()},!0),this._registerFunction("argbf","Color",function(t){return t.toArgbf()},!0),this._registerFunction("add","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t+e})}),this._registerFunction("subtract","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t-e})}),this._registerFunction("multiply","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t*e})}),this._registerFunction("multiply","Color, BigNumber",function(t,e){return t.op([e,e,e,e],function(t,e){return t*e})}),this._registerFunction("multiply","BigNumber, Color",function(t,e){return e.op([t,t,t,t],function(t,e){return t*e})}),this._registerFunction("divide","Color, Color",function(t,e){return t.op(e.toArgbf(),function(t,e){return t/e})}),this._registerFunction("divide","Color, BigNumber",function(t,e){return t.op([e,e,e,e],function(t,e){return t/e})})},t.ColorExtension.prototype.preprocess=function(t){return t.replace(this._colorLiteral43bRegexp,function(t){if(9!==t.length&&7!==t.length)throw new Error("Invalid color literal: "+t);var e=t.substr(9===t.length?3:1),n=e.substr(0,2),r=e.substr(2,2),i=e.substr(4,2),o=9===t.length?t.substr(1,2):"FF";return"Color4b("+parseInt(o,16)+", "+parseInt(n,16)+", "+parseInt(r,16)+", "+parseInt(i,16)+")"})},t.ColorExtension.prototype.postprocess=function(t){var e=this;return t.replace(this._colorLiteral4bRegexp,function(t){return e._generateColorSampleHtml(t)})},t.ColorExtension.prototype._generateColorSampleHtml=function(t){return'<div class="color-sample" data-color="'+t+'"><div style="background-color: '+("#"+t.substr(3))+"; opacity: "+parseInt(t.substr(1,2),16)/255+'">&nbsp;</div></div>'},t.ColorExtension.prototype._initializeColorTooltips=function(){var t=this;$("body").tooltip({placement:"top",container:"body",selector:".color-sample",trigger:"click",template:'<div class="tooltip color-sample-tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:function(){return $(this).data("color")}}),$(document).on("shown.bs.tooltip",".color-sample",function(e){t._visibleTooltipIds.push($(e.target).attr("aria-describedby"))}),$(document).on("click",function(e){if(t._visibleTooltipIds.length){var n=$(e.target),r=$(e.target).parent();if($(".color-sample-tooltip").has(e.target).length)return;if(n.hasClass("color-sample")||r&&r.length&&r.hasClass("color-sample"))return;for(var i=0;i<t._visibleTooltipIds.length;++i)$("#"+t._visibleTooltipIds[i]).tooltip("hide");t._visibleTooltipIds=[]}}),$(document).on("hidden.bs.tooltip",function(t){$(t.target).data("bs.tooltip").inState.click=!1})},t.ColorExtension.prototype._registerFunction=function(t,e,n,r,i){try{var o={},s={},a=i||null,l=this;o[e]=n,r&&(o["Array | Matrix"]=function(t){return l._mathJs.map(t,n)}),s[t]=this._mathJs.typed(t,o),a&&(s[t].toTex=a),this._mathJs.import(s)}catch(t){if(!t.data||!t.data.signature)throw t}}}(window.clc=window.clc||{}),function(t){function e(e){var n=t.mathJsToValidNumber(e);if(n<0||n>1)throw new Error("Must be floating point number in range [0, 1]");return Math.round(255*n)}t.Color=function(t){this._argb=t>>>0},t.Color.from4b=function(e,n,r,i){return new t.Color(t.toUint8(e)<<24|t.toUint8(n)<<16|t.toUint8(r)<<8|t.toUint8(i))},t.Color.from4f=function(n,r,i,o){return new t.Color.from4b(e(n),e(r),e(i),e(o))},t.Color.fromU32=function(e){return new t.Color(t.toUint32(e))},t.Color.fromHsv=function(e,n,r){if(e=t.toUint32(e),n=t.toUint32(n),r=t.toUint32(r),e>=360)throw new Error("Hue must be in range [0, 360)");if(n>100)throw new Error("Saturation must be in range [0, 100]");if(r>100)throw new Error("Value must be in range [0, 100]");var i,o=(r/=100)*(n/=100),s=o*(1-Math.abs(e/60%2-1)),a=r-o;return i=e<60?[o,s,0]:e<120?[s,o,0]:e<180?[0,o,s]:e<240?[0,s,o]:e<300?[s,0,o]:[o,0,s],t.Color.from4b(255,Math.round(255*(i[0]+a)),Math.round(255*(i[1]+a)),Math.round(255*(i[2]+a)))},t.Color.fromHsl=function(e,n,r){if(e=t.toUint32(e),n=t.toUint32(n),r=t.toUint32(r),e>=360)throw new Error("Hue must be in range [0, 360)");if(n>100)throw new Error("Saturation must be in range [0, 100]");if(r>100)throw new Error("Lightness must be in range [0, 100]");n/=100,r/=100;var i,o=(1-Math.abs(2*r-1))*n,s=o*(1-Math.abs(e/60%2-1)),a=r-.5*o;return i=e<60?[o,s,0]:e<120?[s,o,0]:e<180?[0,o,s]:e<240?[0,s,o]:e<300?[s,0,o]:[o,0,s],t.Color.from4b(255,Math.round(255*(i[0]+a)),Math.round(255*(i[1]+a)),Math.round(255*(i[2]+a)))},t.Color.prototype.get=function(t){return this._argb>>>24-8*t&255},t.Color.prototype.toString=function(){return"#"+(t.padLeft(this.get(0).toString(16),"0",2)+t.padLeft(this.get(1).toString(16),"0",2)+t.padLeft(this.get(2).toString(16),"0",2)+t.padLeft(this.get(3).toString(16),"0",2)).toUpperCase()},t.Color.prototype.op=function(e,n){var r,i=this.toArgbf();for(r=0;r<4;++r)i[r]=t.clamp(n(i[r],t.mathJsToValidNumber(e[r])),0,1);return t.Color.from4f(i[0],i[1],i[2],i[3])},t.Color.prototype.toHsv=function(){var e,n,r,i=this.get(1)/255,o=this.get(2)/255,s=this.get(3)/255,a=Math.max(i,o,s),l=a-Math.min(i,o,s);return 0==l?e=0:a===i?e=60*t.mod((o-s)/l,6):a===o?e=60*((s-i)/l+2):a===s&&(e=60*((i-o)/l+4)),n=0==a?0:l/a,r=a,[Math.round(e),Math.round(100*n),Math.round(100*r)]},t.Color.prototype.toHsl=function(){var e,n,r,i=this.get(1)/255,o=this.get(2)/255,s=this.get(3)/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a-l;return 0==c?e=0:a===i?e=60*t.mod((o-s)/c,6):a===o?e=60*((s-i)/c+2):a===s&&(e=60*((i-o)/c+4)),r=(a+l)/2,n=0==c?0:c/(1-Math.abs(2*r-1)),[Math.round(e),Math.round(100*n),Math.round(100*r)]},t.Color.prototype.toArgb=function(){return[this.get(0),this.get(1),this.get(2),this.get(3)]},t.Color.prototype.toArgbf=function(){return[this.get(0)/255,this.get(1)/255,this.get(2)/255,this.get(3)/255]}}(window.clc=window.clc||{}),function(t){t.Base64EncodingExtension=function(){this._mathJs=null},t.Base64EncodingExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.base64Encode){var n=this._mathJs.typed("base64Encode",{Array:function(t){return e._functionBase64Encode(t)}});this._mathJs.import({base64Encode:n})}if(!this._mathJs.base64Decode){var r=this._mathJs.typed("base64Decode",{string:function(t){return e._functionBase64Decode(t)}});this._mathJs.import({base64Decode:r})}},t.Base64EncodingExtension.prototype._functionBase64Encode=function(e){return void 0===e||null===e?"":t.base64Encode(e)},t.Base64EncodingExtension.prototype._functionBase64Decode=function(e){return void 0===e||null===e?[]:t.base64Decode(e)}}(window.clc=window.clc||{}),function(t){t.UnicodeEncodingExtension=function(){this._mathJs=null},t.UnicodeEncodingExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.toCodePoints){var n=this._mathJs.typed("toCodePoints",{string:function(t){return e._functionToCodePoints(t)}});this._mathJs.import({toCodePoints:n})}if(!this._mathJs.fromCodePoints){var r=this._mathJs.typed("fromCodePoints",{Array:function(t){return e._functionFromCodePoints(t)}});this._mathJs.import({fromCodePoints:r})}if(!this._mathJs.toUtf8){var i=this._mathJs.typed("toUtf8",{string:function(t){return e._functionToUtf8(t)}});this._mathJs.import({toUtf8:i})}if(!this._mathJs.fromUtf8){var o=this._mathJs.typed("fromUtf8",{Array:function(t){return e._functionFromUtf8(t)}});this._mathJs.import({fromUtf8:o})}},t.UnicodeEncodingExtension.prototype._functionToCodePoints=function(e){return void 0===e||null===e||0===e.length?[]:t.stringToUnicodeCodePointList(e)},t.UnicodeEncodingExtension.prototype._functionFromCodePoints=function(e){return void 0===e||null===e||0===e.length?"":t.stringFromUnicodeCodePointList(e)},t.UnicodeEncodingExtension.prototype._functionToUtf8=function(e){return void 0===e||null===e||0===e.length?[]:t.stringToUtf8Array(e)},t.UnicodeEncodingExtension.prototype._functionFromUtf8=function(e){return void 0===e||null===e||0===e.length?"":t.stringFromUtf8Array(e)}}(window.clc=window.clc||{}),function(t){t.HashesExtension=function(){this._mathJs=null},t.HashesExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.md5){var n=this._mathJs.typed("md5",{Array:function(t){return e._functionMd5(t)}});this._mathJs.import({md5:n})}if(!this._mathJs.sha1){var r=this._mathJs.typed("sha1",{Array:function(t){return e._functionSha1(t)}});this._mathJs.import({sha1:r})}if(!this._mathJs.sha224){var i=this._mathJs.typed("sha224",{Array:function(t){return e._functionSha224(t)}});this._mathJs.import({sha224:i})}if(!this._mathJs.sha256){var o=this._mathJs.typed("sha256",{Array:function(t){return e._functionSha256(t)}});this._mathJs.import({sha256:o})}},t.HashesExtension.prototype._functionMd5=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.md5(e)},t.HashesExtension.prototype._functionSha1=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.sha1(e)},t.HashesExtension.prototype._functionSha224=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.sha224(e)},t.HashesExtension.prototype._functionSha256=function(e){if(void 0===e||null===e)throw new Error("Invalid argument");return t.sha256(e)}}(window.clc=window.clc||{}),function(t){function e(t,e){return(t<<e|t>>>32-e)>>>0}function n(t,e){return(t>>>e|t<<32-e)>>>0}function r(t){return((4278190080&t)>>>24|(16711680&t)>>>8|(65280&t)<<8|(255&t)<<24)>>>0}function i(e,n,r){return(t.toUint8(e[n+4*r+3])<<24|t.toUint8(e[n+4*r+2])<<16|t.toUint8(e[n+4*r+1])<<8|t.toUint8(e[n+4*r]))>>>0}function o(t,e,n){return r(i(t,e,n))}function s(t,e){return 0===t?e:1+(t-1|63)}function a(e){var n,r=[];for(n=0;n<e.length;++n)r.push(t.toUint8(e[n]));return r}function l(t,e,n){for(var r=0;r<n;++r)t.push(e)}function c(t,e,n,i){if(!i){var o=e;e=r(n),n=r(o)}for(var s=0;s<8;++s)s<4?t.push(n>>>8*s&255):t.push(e>>>8*(s-4)&255)}var h=16777215;!function(){var n=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],o=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];t.md5=function(u){if(u.length>h)throw new Error("Array is too big. Maximum allowed size: "+h);var p=a(u),g=u.length;p.push(128),l(p,0,s(g+9)-g-9),c(p,0,8*g,!0);for(var d=1732584193,f=4023233417,m=2562383102,_=271733878,v=0;v<p.length;v+=64){for(var b=d,x=f,y=m,w=_,E=0;E<64;++E){var P,C;E<16?(P=x&y|~x&w,C=E):E<32?(P=w&x|~w&y,C=(5*E+1)%16):E<48?(P=x^y^w,C=(3*E+5)%16):(P=y^(x|~w),C=7*E%16),P=P+b+o[E]+i(p,v,C)>>>0,b=w,w=y,y=x,x=x+e(P,n[E])>>>0}d=d+b>>>0,f=f+x>>>0,m=m+y>>>0,_=_+w>>>0}return t.padLeft(r(d).toString(16),"0",8)+t.padLeft(r(f).toString(16),"0",8)+t.padLeft(r(m).toString(16),"0",8)+t.padLeft(r(_).toString(16),"0",8)}}(),t.sha1=function(n){if(n.length>h)throw new Error("Array is too big. Maximum allowed size: "+h);var r=a(n),i=n.length;r.push(128),l(r,0,s(i+9)-i-9),c(r,0,8*i,!1);for(var u=1732584193,p=4023233417,g=2562383102,d=271733878,f=3285377520,m=0;m<r.length;m+=64){var _,v=u,b=p,x=g,y=d,w=f,E=[];for(_=0;_<80;++_)_<16?E.push(o(r,m,_)):E.push(e(E[_-3]^E[_-8]^E[_-14]^E[_-16],1));for(_=0;_<80;++_){var P,C;_<20?(P=b&x|~b&y,C=1518500249):_<40?(P=b^x^y,C=1859775393):_<60?(P=b&x|b&y|x&y,C=2400959708):(P=b^x^y,C=3395469782);var L=e(v,5)+P+w+C+E[_]>>>0;w=y,y=x,x=e(b,30),b=v,v=L}u=u+v>>>0,p=p+b>>>0,g=g+x>>>0,d=d+y>>>0,f=f+w>>>0}return t.padLeft(u.toString(16),"0",8)+t.padLeft(p.toString(16),"0",8)+t.padLeft(g.toString(16),"0",8)+t.padLeft(d.toString(16),"0",8)+t.padLeft(f.toString(16),"0",8)},function(){function e(t,e,r,i,u,p,g,d,f,m){if(t.length>h)throw new Error("Array is too big. Maximum allowed size: "+h);var _=a(t),v=t.length;_.push(128),l(_,0,s(v+9)-v-9),c(_,0,8*v,!1);for(var b=0;b<_.length;b+=64){var x,y=r,w=i,E=u,P=p,C=g,L=d,S=f,k=m,F=[];for(x=0;x<64;++x)if(x<16)F.push(o(_,b,x));else{var N=n(F[x-15],7)^n(F[x-15],18)^F[x-15]>>>3,T=n(F[x-2],17)^n(F[x-2],19)^F[x-2]>>>10;F.push(F[x-16]+N+F[x-7]+T>>>0)}for(x=0;x<64;++x){var D=n(C,6)^n(C,11)^n(C,25),U=n(y,2)^n(y,13)^n(y,22),J=y&w^y&E^w&E,B=k+D+(C&L^~C&S)+e[x]+F[x]>>>0;k=S,S=L,L=C,C=P+B>>>0,P=E,E=w,w=y,y=B+(U+J>>>0)>>>0}r=r+y>>>0,i=i+w>>>0,u=u+E>>>0,p=p+P>>>0,g=g+C>>>0,d=d+L>>>0,f=f+S>>>0,m=m+k>>>0}return[r,i,u,p,g,d,f,m]}var r=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];t.sha224=function(n){var i=e(n,r,3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428);return t.padLeft(i[0].toString(16),"0",8)+t.padLeft(i[1].toString(16),"0",8)+t.padLeft(i[2].toString(16),"0",8)+t.padLeft(i[3].toString(16),"0",8)+t.padLeft(i[4].toString(16),"0",8)+t.padLeft(i[5].toString(16),"0",8)+t.padLeft(i[6].toString(16),"0",8)},t.sha256=function(n){var i=e(n,r,1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225);return t.padLeft(i[0].toString(16),"0",8)+t.padLeft(i[1].toString(16),"0",8)+t.padLeft(i[2].toString(16),"0",8)+t.padLeft(i[3].toString(16),"0",8)+t.padLeft(i[4].toString(16),"0",8)+t.padLeft(i[5].toString(16),"0",8)+t.padLeft(i[6].toString(16),"0",8)+t.padLeft(i[7].toString(16),"0",8)}}()}(window.clc=window.clc||{}),function(t){t.LerpExtension=function(){this._mathJs=null},t.LerpExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.lerp){var n=this._mathJs.typed("lerp",{"BigNumber, BigNumber, BigNumber":function(t,n,r){return e._functionLerpNumber(t,n,r)},"Color, Color, BigNumber":function(t,n,r){return e._functionLerpColor(t,n,r)}});this._mathJs.import({lerp:n})}},t.LerpExtension.prototype._functionLerpNumber=function(t,e,n){if(n.lessThan(0)||n.greaterThan(1))throw new Error("Interpolation coefficient must be in range [0, 1]");var r=new this._mathJs.bignumber(1).minus(n).times(t),i=n.times(e);return r.plus(i)},t.LerpExtension.prototype._functionLerpColor=function(e,n,r){if(r.lessThan(0)||r.greaterThan(1))throw new Error("Interpolation coefficient must be in range [0, 1]");var i=t.mathJsToValidNumber(r),o=e.op([1-i,1-i,1-i,1-i],function(t,e){return t*e}),s=n.op([i,i,i,i],function(t,e){return t*e});return o.op(s.toArgbf(),function(t,e){return t+e})}}(window.clc=window.clc||{}),function(t){t.FunctionPlot2D=function(e,n,r,i,o,s){this.id=t.randomId("plot2d-"),this._mathJs=s;var a=o.totalWidth-o.axisYWidth,l=o.totalHeight-o.axisXHeight-o.legendHeight,c=Math.abs(a/(r[1]-r[0])),h=a/2-.5*(r[0]+r[1])*c;this._graphParameters={size:{width:a,height:l},transform:{x:{scale:c,offset:h},y:{scale:-c,offset:l/2}},scale:{x:{begin:0,step:0},y:{begin:0,step:0}},offset:{x:o.axisYWidth,y:o.legendHeight},state:{isDragging:!1,beginDragX:0,beginDragY:0}},this._function={expression:e,variable:n,domain:r,scope:i},this._attributes={svg:{id:this.id,class:"function-plot2d",width:o.totalWidth,height:o.totalHeight},"svg.legend.text":{class:"function-plot2d-legend","text-anchor":"end",x:o.totalWidth,y:15},"svg.canvas.g":{class:"function-plot2d-canvas",transform:"translate(0, "+o.legendHeight+")"},"svg.canvas.defs.clipPath":{id:"clip-path-"+this.id},"svg.canvas.defs.clipPath.rect":{width:this._graphParameters.size.width,height:this._graphParameters.size.height},"svg.canvas.axisX.g":{class:"function-plot2d-axis-x",transform:"translate("+o.axisYWidth+", "+this._graphParameters.size.height+")"},"svg.canvas.axisX.g.path":{"shape-rendering":"crispedges",d:"M0,0H"+this._graphParameters.size.width},"svg.canvas.axisX.g.scale.g.text":{style:"text-anchor: middle;",y:"1.5em"},"svg.canvas.axisX.g.scale.g.line":{x1:0,y1:0,x2:0,y2:5,"shape-rendering":"crispedges","stroke-width":1},"svg.canvas.axisY.g":{class:"function-plot2d-axis-y",transform:"translate("+o.axisYWidth+", 0)"},"svg.canvas.axisY.g.path":{"shape-rendering":"crispedges",d:"M0,0V"+this._graphParameters.size.height},"svg.canvas.axisY.g.scale.g.text":{style:"text-anchor: end;",x:"-0.5em",dy:"0.31em"},"svg.canvas.axisY.g.scale.g.line":{x1:0,y1:0,x2:-5,y2:0,"shape-rendering":"crispedges","stroke-width":1},"svg.canvas.eventGrabArea.rect":{class:"function-plot2d-event-grab",width:this._graphParameters.size.width,height:this._graphParameters.size.height,fill:"none",x:o.axisYWidth},"svg.canvas.graph.g":{transform:"translate("+o.axisYWidth+", 0)","clip-path":"url(#clip-path-"+this.id+")"},"svg.canvas.graph.originX.path":{class:"function-plot2d-origin-x","stroke-width":"1","shape-rendering":"crispedges",d:"M0,"+this._toScreenY(0)+"H"+this._graphParameters.size.width},"svg.canvas.graph.originY.path":{class:"function-plot2d-origin-y","stroke-width":"1","shape-rendering":"crispedges",d:"M"+this._toScreenX(0)+",0V"+this._graphParameters.size.height},"svg.canvas.graph.data.path":{class:"function-plot2d-graph","stroke-width":1,fill:"none","stroke-linecap":"round",d:""}},this._xmlns="http://www.w3.org/2000/svg",this._elements={},this.update()},t.FunctionPlot2D.isEventConsumed=function(t){return 1===$(t.target).closest(".function-plot2d-event-grab").length},t.FunctionPlot2D.prototype.svg=function(){return this._elements={},t.htmlTag("svg",this._attributes.svg,[this._legend(),this._canvas()])},t.FunctionPlot2D.prototype.update=function(){if(!this._elements.svg){var t=$("#"+this.id);t.length&&(this._elements.svg=t.eq(0),this._elements.axis={x:this._elements.svg.find("."+this._attributes["svg.canvas.axisX.g"].class).eq(0),y:this._elements.svg.find("."+this._attributes["svg.canvas.axisY.g"].class).eq(0)},this._elements.origin={x:this._elements.svg.find("."+this._attributes["svg.canvas.graph.originX.path"].class).eq(0),y:this._elements.svg.find("."+this._attributes["svg.canvas.graph.originY.path"].class).eq(0)},this._elements.graph=this._elements.svg.find("."+this._attributes["svg.canvas.graph.data.path"].class).eq(0))}this._updateAxisScale(),this._updateOrigin(),this._updateFunctionData()},t.FunctionPlot2D.prototype.setPointerCoordinates=function(e,n){this._elements.legend||(this._elements.legend=$("#"+this.id+" ."+this._attributes["svg.legend.text"].class));var r=1/this._graphParameters.transform.x.scale,i=Math.floor(Math.log10(r)),o=Math.abs(t.clamp(i-1,-15,0)),s=(+this._fromScreenX(e-this._graphParameters.offset.x).toFixed(o)).toString(),a=(+this._fromScreenY(n-this._graphParameters.offset.y).toFixed(o)).toString();this._elements.legend.text("X: "+s+", Y: "+a)},t.FunctionPlot2D.prototype.clearLegend=function(){this._elements.legend||(this._elements.legend=$("#"+this.id+" ."+this._attributes["svg.legend.text"].class)),this._elements.legend.text("")},t.FunctionPlot2D.prototype.zoom=function(t){var e=t>0?1.1:.9;this._graphParameters.transform.x.scale*=e,this._graphParameters.transform.y.scale*=e,this.update()},t.FunctionPlot2D.prototype.beginDrag=function(t,e){this._graphParameters.state.isDragging=!0,this._graphParameters.state.beginDragX=t,this._graphParameters.state.beginDragY=e},t.FunctionPlot2D.prototype.endDrag=function(){this._graphParameters.state.isDragging=!1},t.FunctionPlot2D.prototype.onDrag=function(t,e){this._graphParameters.state.isDragging&&(this._graphParameters.transform.x.offset+=t-this._graphParameters.state.beginDragX,this._graphParameters.transform.y.offset+=e-this._graphParameters.state.beginDragY,this._graphParameters.state.beginDragX=t,this._graphParameters.state.beginDragY=e,this.update())},t.FunctionPlot2D.prototype._legend=function(){return t.htmlTag("text",this._attributes["svg.legend.text"])},t.FunctionPlot2D.prototype._canvas=function(){return t.htmlTag("g",this._attributes["svg.canvas.g"],[this._defs(),this._axisX(),this._axisY(),this._graph(),this._eventGrabArea()])},t.FunctionPlot2D.prototype._defs=function(){return t.htmlTag("defs",null,t.htmlTag("clipPath",this._attributes["svg.canvas.defs.clipPath"],t.htmlTag("rect",this._attributes["svg.canvas.defs.clipPath.rect"])))},t.FunctionPlot2D.prototype._axisX=function(){var e=this._axisXScale(!1);return e.push(t.htmlTag("path",this._attributes["svg.canvas.axisX.g.path"])),t.htmlTag("g",this._attributes["svg.canvas.axisX.g"],e)},t.FunctionPlot2D.prototype._axisY=function(){var e=this._axisYScale(!1);return e.push(t.htmlTag("path",this._attributes["svg.canvas.axisY.g.path"])),t.htmlTag("g",this._attributes["svg.canvas.axisY.g"],e)},t.FunctionPlot2D.prototype._axisXScale=function(e){for(var n=this,r=[],i=e?function(e,r,i){return t.domElement(n._xmlns,e,r,i)}:t.htmlTag,o=this._boundsX(),s=this._graphParameters.scale.x.begin;s<=o[1];s+=this._graphParameters.scale.x.step){var a=i("g",{transform:"translate("+this._toScreenX(s)+", 0)"},[i("text",this._attributes["svg.canvas.axisX.g.scale.g.text"],this._prettyPrintNumber(s)),i("line",this._attributes["svg.canvas.axisX.g.scale.g.line"])]);r.push(a)}return r},t.FunctionPlot2D.prototype._axisYScale=function(e){for(var n=this,r=[],i=e?function(e,r,i){return t.domElement(n._xmlns,e,r,i)}:t.htmlTag,o=this._boundsY(),s=this._graphParameters.scale.y.begin;s<=o[1];s+=this._graphParameters.scale.y.step){var a=i("g",{transform:"translate(0, "+this._toScreenY(s)+")"},[i("text",this._attributes["svg.canvas.axisY.g.scale.g.text"],this._prettyPrintNumber(s)),i("line",this._attributes["svg.canvas.axisY.g.scale.g.line"])]);r.push(a)}return r},t.FunctionPlot2D.prototype._graph=function(){return this._attributes["svg.canvas.graph.data.path"].d=this._data,t.htmlTag("g",this._attributes["svg.canvas.graph.g"],[this._origin(),t.htmlTag("path",this._attributes["svg.canvas.graph.data.path"])])},t.FunctionPlot2D.prototype._origin=function(){return t.htmlTag("path",this._attributes["svg.canvas.graph.originX.path"])+t.htmlTag("path",this._attributes["svg.canvas.graph.originY.path"])},t.FunctionPlot2D.prototype._updateOrigin=function(){this._elements.origin&&(this._elements.origin.x.attr("d","M0,"+this._toScreenY(0)+"H"+this._graphParameters.size.width),this._elements.origin.y.attr("d","M"+this._toScreenX(0)+",0V"+this._graphParameters.size.height))},t.FunctionPlot2D.prototype._eventGrabArea=function(){return t.htmlTag("rect",this._attributes["svg.canvas.eventGrabArea.rect"])},t.FunctionPlot2D.prototype._updateFunctionData=function(){this._data=this._sampleFunctionData(),this._elements.graph&&this._elements.graph.attr("d",this._data)},t.FunctionPlot2D.prototype._sampleFunctionData=function(){for(var e,n,r,i,o=1/this._graphParameters.transform.x.scale,s=this._boundsX(),a="M",l="",c=s[0];c<=s[1];c+=o)if(this._function.scope[this._function.variable]=this._mathJs.bignumber(c),e=this._function.expression.eval(this._function.scope),n=!(void 0===e||null===e),r="number"==typeof e||e instanceof Number,i=!!e.toNumber,n&&(r&&isFinite(e)||i&&e.isFinite())){var h=t.clamp(this._toScreenY(i?e.toNumber():e),-1073741824,1073741824);l+=a+t.round1Dec(this._toScreenX(c))+", "+t.round1Dec(h),a="L"}else a="M";return l},t.FunctionPlot2D.prototype._updateAxisScale=function(){if(this._graphParameters.scale.x=this._calculateScaleParameters(this._boundsX()[0],this._graphParameters.size.width/this._graphParameters.transform.x.scale),this._graphParameters.scale.y=this._calculateScaleParameters(this._boundsY()[0],-this._graphParameters.size.height/this._graphParameters.transform.y.scale),this._elements.axis){this._elements.axis.x.find("g").remove();var t,e=this._axisXScale(!0);for(t=0;t<e.length;++t)this._elements.axis.x.append(e[t]);for(this._elements.axis.y.find("g").remove(),e=this._axisYScale(!0),t=0;t<e.length;++t)this._elements.axis.y.append(e[t])}},t.FunctionPlot2D.prototype._calculateScaleParameters=function(t,e){var n=Math.pow(10,Math.floor(Math.log10(e)+.2)),r=e/n,i=(r<=1.5?1:r<=3?2:5)*n/10,o=Math.ceil(t/i);return{begin:i>=1?o*i:o*(10/n*i)/(10/n),step:i}},t.FunctionPlot2D.prototype._prettyPrintNumber=function(t){return 0==t?"0":(+t.toFixed(14)).toString()},t.FunctionPlot2D.prototype._toScreenX=function(t){return t*this._graphParameters.transform.x.scale+this._graphParameters.transform.x.offset},t.FunctionPlot2D.prototype._toScreenY=function(t){return t*this._graphParameters.transform.y.scale+this._graphParameters.transform.y.offset},t.FunctionPlot2D.prototype._fromScreenX=function(t){return(t-this._graphParameters.transform.x.offset)/this._graphParameters.transform.x.scale},t.FunctionPlot2D.prototype._fromScreenY=function(t){return(t-this._graphParameters.transform.y.offset)/this._graphParameters.transform.y.scale},t.FunctionPlot2D.prototype._boundsX=function(){return[this._fromScreenX(0),this._fromScreenX(this._graphParameters.size.width)]},t.FunctionPlot2D.prototype._boundsY=function(){return[this._fromScreenY(this._graphParameters.size.height),this._fromScreenY(0)]}}(window.clc=window.clc||{}),function(t){t.PlotExtension=function(){this._mathJs=null,this._plots={},this._defaultPlotParameters={totalWidth:500,totalHeight:350,legendHeight:20,axisXHeight:25,axisYWidth:50},this._initializeEventListeners()},t.PlotExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.plot2d){var n=function(t,n,r){return e._functionPlot2D(t,r)};n.rawArgs=!0,this._mathJs.import({plot2d:n})}},t.PlotExtension.prototype._initializeEventListeners=function(){function t(t){return $(t).parent().parent()}var e=this;$(document).on({mousemove:function(n){var r=t(n.target),i=e._plots[r.attr("id")],o=r.offset();i.setPointerCoordinates(Math.round(n.pageX-o.left),Math.round(n.pageY-o.top)),i.onDrag(n.clientX,n.clientY),n.preventDefault()},mouseout:function(n){var r=e._plots[t(n.target).attr("id")];r.clearLegend(),r.endDrag()},mousedown:function(n){e._plots[t(n.target).attr("id")].beginDrag(n.clientX,n.clientY),n.preventDefault()},mouseup:function(n){e._plots[t(n.target).attr("id")].endDrag(),n.preventDefault()},mousewheel:function(n){e._plots[t(n.target).attr("id")].zoom(n.deltaY)}},".function-plot2d-event-grab")},t.PlotExtension.prototype._functionPlot2D=function(e,n){var arguments=this._getPlot2dArguments(e,n),r=new t.FunctionPlot2D(arguments.expression,arguments.variable,arguments.domain,n,this._defaultPlotParameters,this._mathJs);return this._plots[r.id]=r,new t.CallbackResult(function(){return r.svg()})},t.PlotExtension.prototype._getPlot2dArguments=function(e,n){var r={};if(!e||3!==e.length)throw new Error("'plot2d' function expects 3 arguments: function expression, argument variable, argument domain interval");if("FunctionNode"!==e[0].type&&"OperatorNode"!==e[0].type&&"SymbolNode"!==e[0].type&&"ConstantNode"!==e[1].type)throw new Error("First argument must be an expression");if("SymbolNode"!==e[1].type)throw new Error("Second argument must be an independent variable name");if("ArrayNode"!==e[2].type||2!==e[2].items.length)throw new Error("Third argument must be an interval representing domain of a function");if(r.domain=[t.mathJsToValidNumber(e[2].items[0].eval(n)),t.mathJsToValidNumber(e[2].items[1].eval(n))],r.domain[0]>=r.domain[1])throw new Error("Domain interval must be in form [min, max] where min < max");return r.domain[0]=r.domain[0]-Math.abs(.1*r.domain[0]),r.domain[1]=r.domain[1]+Math.abs(.1*r.domain[1]),r.expression=e[0].compile(),r.variable=e[1].name,r}}(window.clc=window.clc||{}),function(t){t.HexBinLiteralsExtension=function(){this._mathJs=null,this._literalRegexp=new RegExp("(?:^|[^A-Za-z0-9_\\\\$\\.])((0[bB][10\\.]+)|(0[xX][A-Fa-f0-9\\.]+))\\b","g")},t.HexBinLiteralsExtension.prototype.extend=function(t){var e=this;if(this._mathJs=t,!this._mathJs.hex){var n=this._mathJs.typed("hex",{"Array | Matrix":function(t){return e._mathJs.map(t,function(t){return e._functionHex(t)})},BigNumber:function(t){return e._functionHex(t)}});this._mathJs.import({hex:n})}if(!this._mathJs.bin){var r=this._mathJs.typed("bin",{"Array | Matrix":function(t){return e._mathJs.map(t,function(t){return e._functionBin(t)})},BigNumber:function(t){return e._functionBin(t)}});this._mathJs.import({bin:r})}},t.HexBinLiteralsExtension.prototype.preprocess=function(t){var e=this;return t.replace(this._literalRegexp,function(t,n){if(n&&n.length>2){var r=e._mathJs.bignumber(n);return t.length===n.length?r.toString():t[0]+r.toString()}})},t.HexBinLiteralsExtension.prototype._functionHex=function(t){return t.toHex()},t.HexBinLiteralsExtension.prototype._functionBin=function(t){return t.toBinary()}}(window.clc=window.clc||{}),function(t){t.LinksHandler=function(e){this._getExpressionCallback=e||null,this._isLogLinkButtonEnabled=!0,this._elements={logLinkButton:$("#generate-log-link-button")};var n=this._isCopyingToClipboardSupported();this._popoverTemplateId=n?"#template-create-link-popover":"#template-create-link-popover-no-copy",this._expressionLinkButtonHtml=$("#template-create-expression-link-button").html(),e&&(this._initializeLogLinkUi(),this._initializeExpressionLinkUi(),$(document).on("hidden.bs.popover",function(t){$(t.target).data("bs.popover").inState.click=!1}),n&&$(document).on("click",".copy-link-to-clipboard",function(e){try{if($(e.target).parents(".input-group").find("input").select(),!document.execCommand("copy"))throw new Error('Failed to execute execCommand("copy")')}catch(e){t.log("Failed to copy to clipboard: "+e.name+", "+e.message)}}))},t.LinksHandler.prototype.setLogLinkButtonEnabled=function(t){this._isLogLinkButtonEnabled!==t&&(this._isLogLinkButtonEnabled=t,this._elements.logLinkButton.toggleClass("disabled",!this._isLogLinkButtonEnabled))},t.LinksHandler.prototype.getExpressionsListFromUrl=function(){var e=this._getExpressonsListFromUrl();if(null===e)return null;try{return this._deserializeExpressionsList(e)}catch(e){return t.log(e.name+", "+e.message),null}},t.LinksHandler.prototype.injectExpressionLinkButton=function(t){t.append(this._expressionLinkButtonHtml)},t.LinksHandler.prototype._isCopyingToClipboardSupported=function(){try{return!!document.queryCommandSupported("copy")}catch(t){return!1}},t.LinksHandler.prototype._initializeLogLinkUi=function(){var t=this;this._elements.logLinkButton.popover({placement:function(){return $(window).width()<768?"bottom":"right"},container:"body",html:!0,title:"Link Generated",trigger:"manual",content:function(){return $(t._popoverTemplateId).html().replace("{link}",t._getExpressionsLink())}}),this._elements.logLinkButton.click(function(){t._isLogLinkButtonEnabled&&$(this).popover("show")}),this._elements.logLinkButton.on("shown.bs.popover",function(){var t=$(this).attr("aria-describedby");$("#"+t+" input").focus().select(),$(this).addClass("active")}),this._elements.logLinkButton.on("hidden.bs.popover",function(){$(this).removeClass("active")}),$(document).on("click",function(e){var n=t._elements.logLinkButton,r=n.attr("aria-describedby")||null;r&&n.hasClass("active")&&0===$("#"+r).has(e.target).length&&n.popover("hide")})},t.LinksHandler.prototype._initializeExpressionLinkUi=function(){var t=this;this._visibleExpressionLinkPopover=null,$("body").popover({placement:"left",container:"body",html:!0,title:"Expression Link Generated",trigger:"click",selector:".create-expression-link-button",content:function(){return $(t._popoverTemplateId).html().replace("{link}",t._getExpressionsLink($(this).parents(".command")))}}),$("body").on("shown.bs.popover",function(e){var n=$(e.target);if(n.hasClass("create-expression-link-button")){n.parents(".command").addClass("active");var r=n.attr("aria-describedby");$("#"+r+" input").focus().select(),t._visibleExpressionLinkPopover=$("#"+r)}}),$("body").on("hidden.bs.popover",function(t){var e=$(t.target);e.hasClass("create-expression-link-button")&&e.parents(".command").removeClass("active")}),$(document).on("click",function(e){t._visibleExpressionLinkPopover&&0===t._visibleExpressionLinkPopover.has(e.target).length&&(t._visibleExpressionLinkPopover.popover("hide"),t._visibleExpressionLinkPopover=null)})},t.LinksHandler.prototype._getExpressionsLink=function(t){var e=this._getExpressionCallback(t),n=this._serializeExpressionsList(e);return this._buildLink(n)},t.LinksHandler.prototype._serializeExpressionsList=function(e){var n={c:e,v:"1"},r=JSON.stringify(n);return t.base64Encode(t.stringToUtf8Array(r))},t.LinksHandler.prototype._deserializeExpressionsList=function(e){var n=t.stringFromUtf8Array(t.base64Decode(e));return JSON.parse(n).c},t.LinksHandler.prototype._buildLink=function(t){var e=window.location.href.split("/");return e[0]+"//"+e[2]+"#"+t},t.LinksHandler.prototype._getExpressonsListFromUrl=function(){if(!window.location.hash)return null;var t=window.location.hash.substring(1);return t.length?t:null}}(window.clc=window.clc||{}),function(t){t.SyntaxHighlighter=function(){this._constants=[].concat(t.MATH_JS_CONSTANTS,["true","false"]),this._keywords=[].concat(t.MATH_JS_FUNCTIONS,t.CLCALC_FUNCTIONS),this._re={identifier:new RegExp("([0-9]*)([A-Za-z_$][A-Za-z0-9_$]*)","g"),color:new RegExp("#[A-Fa-f0-9]{6,8}","g")},this._classes={constant:"highlight-constant",keyword:"highlight-keyword",color:"highlight-color"}},t.SyntaxHighlighter.prototype.highlight=function(t){var e=this;return t.replace(this._re.identifier,function(t,n,r){if(e._isValidIdentifier(n,r)){if(-1!==e._constants.indexOf(r))return n+"[[;;;highlight-constant;]"+r+"]";if(-1!==e._keywords.indexOf(r))return n+"[[;;;highlight-keyword;]"+r+"]"}return t}).replace(this._re.color,function(t){return 7===t.length||9===t.length?"[[;;;highlight-color;]"+t+"]":t})},t.SyntaxHighlighter.prototype._isValidIdentifier=function(t,e){return!(!e||0===e.length)&&(!t||1!==t.length||"0"!==t[0]||"x"!==e[0]&&"X"!==e[0]&&"b"!==e[0]&&"B"!==e[0])}}(window.clc=window.clc||{}),function(t){t.TexHandler=function(){this._pendingExpressions=[],this._elements={togglePanelButton:$("#toggle-tex-panel-button"),panel:$(".tex-panel"),panelWrapper:$(".tex-wrapper")},this._katexLoadUrl="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha1/katex.min.js",this._katexLoadInProgress=!1,this._initializeUi()},t.TexHandler.prototype.addEvaluatedExpression=function(t,e){this._pendingExpressions.push({expression:t,value:e||null}),this._render()},t.TexHandler.prototype.clear=function(){this._pendingExpressions=[],this._elements.panel.empty()},t.TexHandler.prototype._isPanelVisible=function(){return"none"!==this._elements.panelWrapper.css("display")},t.TexHandler.prototype._setPanelVisible=function(t){t?this._elements.panelWrapper.css("display",$(window).width()<768?"table-row":"table-cell"):this._elements.panelWrapper.css("display","none")},t.TexHandler.prototype._initializeUi=function(){var t=this;this._elements.togglePanelButton.click(function(){t._isPanelVisible()?t._hidePanel():t._showPanel()})},t.TexHandler.prototype._showPanel=function(){var t=this;this._elements.togglePanelButton.addClass("active"),"undefined"==typeof katex?this._loadKatex(function(){t._showPanel()}):(this._setPanelVisible(!0),this._render())},t.TexHandler.prototype._hidePanel=function(){this._elements.togglePanelButton.removeClass("active"),this._setPanelVisible(!1)},t.TexHandler.prototype._loadKatex=function(e){var n=this;this._katexLoadInProgress||(this._katexLoadInProgress=!0,$.getScript(this._katexLoadUrl).done(function(){n._katexLoadInProgress=!1,e()}).fail(function(e,r,i){n._katexLoadInProgress=!1,t.log("Failed to load Katex library: "+i.name+", "+i.message)}))},t.TexHandler.prototype._render=function(){if(this._isPanelVisible()){for(var t=0;t<this._pendingExpressions.length;++t){var e=this._pendingExpressions[t],n=$('<div class="tex-block"></div>'),r=$('<div class="tex-expression"></div>');if(this._elements.panel.append(n),n.append(r),katex.render(e.expression,r[0]),null!==e.value){var i=$('<div class="tex-value"></div>');n.append(i),katex.render(e.value,i[0])}}this._pendingExpressions.length&&(this._pendingExpressions=[],this._elements.panel.scrollTop(this._elements.panel[0].scrollHeight))}}}(window.clc=window.clc||{});
\ No newline at end of file
.navbar{margin-bottom:0;border-radius:0}@media (max-width:767px){.navbar{min-height:32px}}.navbar-header{float:left}@media (max-width:767px){.navbar-brand{padding:6px;height:32px}}.navbar-brand>img{display:inline-block;vertical-align:top;margin-right:4px}.navbar-right{float:right}.navbar-right img{vertical-align:top;margin-right:4px;opacity:.7}.navbar-nav{margin-top:0;margin-bottom:0}.navbar-nav>li>a{padding:15px}@media (max-width:767px){.navbar-nav>li>a{padding:6px}}.content-panel{position:fixed;top:50px;bottom:0;left:50px;right:0}@media (max-width:767px){.content-panel{top:72px;left:0}}.content-wrapper{display:table;width:100%;height:100%}.console-wrapper{display:table-cell;position:relative;width:65%;height:100%}@media (max-width:767px){.console-wrapper{display:table-row;position:static;width:100%;height:65%}}.console-wrapper-inner{width:100%;height:100%}@media (max-width:767px){.console-wrapper-inner{display:table-cell;position:relative;height:auto}}.tex-wrapper{display:none;position:relative;height:100%;border-left:1px solid #d7d7d7}@media (max-width:767px){.tex-wrapper{display:none;position:static;width:100%;height:auto;border-left:none}}.tex-wrapper-inner{width:100%;height:100%}@media (max-width:767px){.tex-wrapper-inner{display:table-cell;position:relative;height:auto;border-top:1px solid #d7d7d7}}.popover-title{font-weight:700}.sidebar{position:fixed;top:50px;bottom:0;left:0;width:50px;border-right:1px solid #d7d7d7;background-color:#e7e7e7}@media (max-width:767px){.sidebar{top:32px;bottom:auto;right:0;width:auto;height:40px;border-right:none;border-bottom:1px solid #d7d7d7}}.sidebar>a{color:#777;font-size:16px;line-height:20px;text-decoration:none;outline:0}.sidebar>a>.round-button{position:relative;width:34px;height:34px;margin-top:12px;margin-bottom:0;margin-left:auto;margin-right:auto;border-radius:50%;transition:background-color .2s ease 0s;background-color:#d8d8d8}@media (max-width:767px){.sidebar>a>.round-button{display:inline-block;margin-top:3px;margin-bottom:3px;margin-left:4px;margin-right:0}}.sidebar>a>.round-button:hover{background-color:#c7c7c7}.sidebar>a>.round-button span{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.sidebar>a>.round-button span.texticon{font-size:18px;font-weight:700}.sidebar>a.active>.round-button{background-color:#c7c7c7}.sidebar>a.disabled>.round-button{cursor:not-allowed;color:#afafaf;background-color:#e2e2e2}.cmd,.terminal{font-family:'Roboto Mono',monospace;color:#7a9983;background-color:#fdfdfd}.cmd,.cmd .prompt,.terminal .terminal-output div div{font-size:16px;line-height:24px}.cmd{margin-top:4px}.terminal{position:absolute;top:0;bottom:0;left:0;right:0;padding:12px;margin:0}.terminal .terminal-output .command{margin-top:4px}.terminal .terminal-output .welcome-message{color:#7a9983;padding-bottom:16px;font-style:italic;opacity:.7;word-break:normal}.terminal .terminal-output-error{color:#fa5050;padding-left:10px}.terminal a:hover{background:0 0;text-decoration:underline;color:#0f60ff}.terminal .command.active{background-color:#eff5ef;border-radius:4px}.terminal .create-expression-link-button{color:#9f9f9f;text-decoration:none;outline:0;transition:color .2s ease 0s}.terminal .create-expression-link-button:hover{color:#777}.terminal .raw{padding-left:10px;color:#66b734}.terminal .raw div{word-break:break-all}@-webkit-keyframes terminal-blink{0%,100%{color:#f0f0f0;background-color:#909090}50%{color:#777;background-color:#ccc}}@keyframes terminal-blink{0%,100%{color:#f0f0f0;background-color:#909090}50%{color:#777;background-color:#ccc}}.highlight-constant{font-style:italic}.highlight-keyword{font-weight:700}.highlight-color{font-weight:700}.terminal .terminal-output div div .color-sample{display:inline-block;height:24px;width:24px;border-radius:4px;background:url(checkerboard.png) no-repeat left top;background-size:cover;cursor:pointer}.terminal .terminal-output div div .color-sample div{border-radius:4px}.function-plot2d-event-grab{cursor:crosshair;pointer-events:all}.function-plot2d-legend{font-family:'Roboto Mono',monospace;font-size:10px;fill:#999}.function-plot2d-axis-x,.function-plot2d-axis-y{stroke:#aaa}.function-plot2d-axis-x text,.function-plot2d-axis-y text{fill:#999;font-weight:400;font-size:11px;stroke-width:0}.function-plot2d-origin-x,.function-plot2d-origin-y{stroke:#ccc}.function-plot2d-graph{stroke:#0dc1e5}.tex-panel{position:absolute;top:0;bottom:0;left:0;right:0;padding:0;margin:0;overflow-y:auto;background-color:#f7f7f7}.tex-panel>.tex-block{border:1px solid #eee;border-radius:2px;background-color:#fdfdfd;margin:8px;padding:8px;overflow-x:auto}.tex-panel>.tex-block .tex-expression{margin:8px}.tex-panel>.tex-block .tex-value{margin-left:8px;margin-right:8px;margin-bottom:8px;padding-top:8px;border-top:1px solid #eee}body{margin-top:50px}@media (max-width:767px){body{margin-top:32px}}.help-container{padding-top:50px;margin-top:-50px;font-family:Lato,"Helvetica Neue",Helvetica,Arial,sans-serif}.help-toc{position:fixed;top:70px}.help-toc ul{list-style-type:none;padding-left:20px}.help-toc ul li{font-size:13px;line-height:22px}@media (max-width:991px){.help-toc{position:static}}.help-content{font-size:16px}.help-content h1,.help-content h2{padding-top:50px;margin-top:-50px}.help-content h1{color:#0e83cd;border-bottom:1px solid #ddd;padding-bottom:5px;margin-bottom:20px;margin-top:-30px}.help-content h2{color:#0e83cd;font-size:24px;margin-top:-35px}.help-content table{font-size:14px}.help-content table td.code{font-family:'Roboto Mono',monospace}code{font-family:'Roboto Mono',monospace;font-size:16px;line-height:24px;color:#7a9983;background-color:#f5f5f5;display:block;margin-top:0;margin-bottom:12px;margin-left:8px;margin-right:8px;padding-top:4px;padding-bottom:4px;padding-left:0;padding-right:0;word-break:break-all}code span.expr{display:block;margin-left:8px}code span.expr::before{content:'>';display:inline-block;width:16px}code span.value{margin-left:24px;margin-bottom:4px;color:#66b734}code .help-try-it{display:inline-block;float:right;border-top-left-radius:0;border-top-right-radius:4px;border-bottom-left-radius:4px;border-bottom-right-radius:0;padding-top:2px;padding-bottom:2px;padding-left:6px;padding-right:6px;margin-top:-4px;font-size:14px;color:#fefefe;background-color:#337ab7;outline:0}code .help-try-it:hover{text-decoration:none;background-color:#286090;outline:0}code .help-try-it:focus{text-decoration:none;outline:0}code p{margin:8px}
\ No newline at end of file
.navbar{margin-bottom:0;border-radius:0}@media (max-width:767px){.navbar{min-height:32px}}.navbar-header{float:left}@media (max-width:767px){.navbar-brand{padding:6px;height:32px}}.navbar-brand>img{display:inline-block;vertical-align:top;margin-right:4px}.navbar-right{float:right}.navbar-right img{vertical-align:top;margin-right:4px;opacity:.7}.navbar-nav{margin-top:0;margin-bottom:0}.navbar-nav>li>a{padding:15px}@media (max-width:767px){.navbar-nav>li>a{padding:6px}}.content-panel{position:fixed;top:50px;bottom:0;left:50px;right:0}@media (max-width:767px){.content-panel{top:72px;left:0}}.content-wrapper{display:table;width:100%;height:100%}.console-wrapper{display:table-cell;position:relative;width:65%;height:100%}@media (max-width:767px){.console-wrapper{display:table-row;position:static;width:100%;height:65%}}.console-wrapper-inner{width:100%;height:100%}@media (max-width:767px){.console-wrapper-inner{display:table-cell;position:relative;height:auto}}.tex-wrapper{display:none;position:relative;height:100%;border-left:1px solid #d7d7d7}@media (max-width:767px){.tex-wrapper{display:none;position:static;width:100%;height:auto;border-left:none}}.tex-wrapper-inner{width:100%;height:100%}@media (max-width:767px){.tex-wrapper-inner{display:table-cell;position:relative;height:auto;border-top:1px solid #d7d7d7}}.popover-title{font-weight:700}.sidebar{position:fixed;top:50px;bottom:0;left:0;width:50px;border-right:1px solid #d7d7d7;background-color:#e7e7e7}@media (max-width:767px){.sidebar{top:32px;bottom:auto;right:0;width:auto;height:40px;border-right:none;border-bottom:1px solid #d7d7d7}}.sidebar>a{color:#777;font-size:16px;line-height:20px;text-decoration:none;outline:0}.sidebar>a>.round-button{position:relative;width:34px;height:34px;margin-top:12px;margin-bottom:0;margin-left:auto;margin-right:auto;border-radius:50%;transition:background-color .2s ease 0s;background-color:#d8d8d8}@media (max-width:767px){.sidebar>a>.round-button{display:inline-block;margin-top:3px;margin-bottom:3px;margin-left:4px;margin-right:0}}.sidebar>a>.round-button:hover{background-color:#c7c7c7}.sidebar>a>.round-button span{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.sidebar>a>.round-button span.texticon{font-size:18px;font-weight:700}.sidebar>a.active>.round-button{background-color:#c7c7c7}.sidebar>a.disabled>.round-button{cursor:not-allowed;color:#afafaf;background-color:#e2e2e2}.cmd,.terminal{font-family:'Roboto Mono',monospace;color:#7a9983;background-color:#fdfdfd}.cmd,.cmd .prompt,.terminal .terminal-output div div{font-size:16px;line-height:24px}.cmd{margin-top:4px}.terminal{position:absolute;top:0;bottom:0;left:0;right:0;padding:12px;margin:0}.terminal .terminal-output .command{margin-top:4px}.terminal .terminal-output .welcome-message{color:#7a9983;padding-bottom:16px;font-style:italic;opacity:.7;word-break:normal}.terminal .terminal-output-error{color:#fa5050;padding-left:12px}.terminal a:hover{background:0 0;text-decoration:underline;color:#0f60ff}.terminal .command.active{background-color:#eff5ef;border-radius:4px}.terminal .create-expression-link-button{color:#9f9f9f;text-decoration:none;outline:0;transition:color .2s ease 0s}.terminal .create-expression-link-button:hover{color:#777}.terminal .prompt-wrapper{width:12px}.terminal .raw{padding-left:12px;color:#66b734}.terminal .raw div{word-break:break-all}@-webkit-keyframes terminal-blink{0%,100%{color:#f0f0f0;background-color:#909090}50%{color:#777;background-color:#ccc}}@keyframes terminal-blink{0%,100%{color:#f0f0f0;background-color:#909090}50%{color:#777;background-color:#ccc}}.highlight-constant{font-style:italic}.highlight-keyword{font-weight:700}.highlight-color{font-weight:700}.terminal .terminal-output div div .color-sample{display:inline-block;height:24px;width:24px;border-radius:4px;background:url(checkerboard.png) no-repeat left top;background-size:cover;cursor:pointer}.terminal .terminal-output div div .color-sample div{border-radius:4px}.function-plot2d-event-grab{cursor:crosshair;pointer-events:all}.function-plot2d-legend{font-family:'Roboto Mono',monospace;font-size:10px;fill:#999}.function-plot2d-axis-x,.function-plot2d-axis-y{stroke:#aaa}.function-plot2d-axis-x text,.function-plot2d-axis-y text{fill:#999;font-weight:400;font-size:11px;stroke-width:0}.function-plot2d-origin-x,.function-plot2d-origin-y{stroke:#ccc}.function-plot2d-graph{stroke:#0dc1e5}.tex-panel{position:absolute;top:0;bottom:0;left:0;right:0;padding:0;margin:0;overflow-y:auto;background-color:#f7f7f7}.tex-panel>.tex-block{border:1px solid #eee;border-radius:2px;background-color:#fdfdfd;margin:8px;padding:8px;overflow-x:auto}.tex-panel>.tex-block .tex-expression{margin:8px}.tex-panel>.tex-block .tex-value{margin-left:8px;margin-right:8px;margin-bottom:8px;padding-top:8px;border-top:1px solid #eee}body{margin-top:50px}@media (max-width:767px){body{margin-top:32px}}.help-container{padding-top:50px;margin-top:-50px;font-family:Lato,"Helvetica Neue",Helvetica,Arial,sans-serif}.help-toc{position:fixed;top:70px}.help-toc ul{list-style-type:none;padding-left:20px}.help-toc ul li{font-size:13px;line-height:22px}@media (max-width:991px){.help-toc{position:static}}.help-content{font-size:16px}.help-content h1,.help-content h2{padding-top:50px;margin-top:-50px}.help-content h1{color:#0e83cd;border-bottom:1px solid #ddd;padding-bottom:5px;margin-bottom:20px;margin-top:-30px}.help-content h2{color:#0e83cd;font-size:24px;margin-top:-35px}.help-content table{font-size:14px}.help-content table td.code{font-family:'Roboto Mono',monospace}code{font-family:'Roboto Mono',monospace;font-size:16px;line-height:24px;color:#7a9983;background-color:#f5f5f5;display:block;margin-top:0;margin-bottom:12px;margin-left: