!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a,b){var c=$(b+" .nav");return c.find(".all a").on("click",f(a)),a.stream.display(b).keys().filter(function(a){return" Count"==a.substr(a.length-6)}).map(function(a){return a.substr(0,a.length-6)}).addFrame(e(a,c))}function e(a,b){return function(c,d,e){if(d.length>0){var g=b.find(".placeholder");if("#all"==a.currentUnitFilter){b.find(".unit").remove();for(var h=d[0],i=0;i<h.length;i++){var j=g.clone().removeClass("placeholder d-none").addClass("unit");j.find("a").attr("href","#"+h[i]).text(h[i]).on("click",f(a)),b.append(j)}}a.displays.learners.update()}}}function f(a){return function(b){a.changeUnit(b,$(this))}}b.exports=d},{}],2:[function(a,b,c){function d(a,b){this.llama=a,this.$div=$(b),this.$div.find("button").on("click",function(b){a.clearSelection(b,$(this))})}function e(a,b){for(var c=0;c<b.length;c++)if(b[c].UserID==a)return b[c];return null}b.exports=d,d.prototype.update=function(){var a=this.$div,b=this.llama.selectedLearners.array(),c=this.llama.stream.array();b.length>0?a.show():a.hide();var d=a.find(".placeholder");a.find(".unit").remove();for(var f=0;f<b.length;f++){var g=e(b[f],c);if(null!=g){var h=d.clone().removeClass("placeholder d-none").addClass("unit");a.append(h),this.createBadge(h,b[f],g)}}},d.prototype.createBadge=function(a,b,c){var d=this.llama;d.config.userUrl?a.find("a").attr("href",d.config.userUrl(b)):a.find("a").removeAttr("href"),a.find(".name").text(c.Email||c.UserID),a.find(".studentid").text(c.StudentID||"");var e=new d3Stream(d.displays.keys.array()).map(function(a,b){return{x:a,p:+c[a+" Ratio"],e:+c[a+" Count"]}}),f={height:20,marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,transitionDuration:0};e.display(a.find(".up"),f).domainBands("x","x").barChart({verticalVariable:"p"}),e.display(a.find(".down"),f).domainBands("x","x").barChartDownwards({verticalVariable:"e"})}},{}],3:[function(a,b,c){function d(a){var b={progressLabels:["Not submitted","< 90% points",">= 90% points"]};if(this.config=$.extend({},b,a),"function"!=typeof this.config.apiUrl)throw new Error("Llama Client requires apiUrl (function) in options argument!");this.stream=new d3Stream,this.filterTagIds=new d3Stream,this.selectedLearners=new d3Stream,this.displays={keys:new e(this,"#llama-unit-select"),learners:new f(this,"#llama-view-learners")},this.currentDisplay=void 0,this.currentUnitFilter=void 0;var c=this;$("#llama-view-select .nav a").on("click",function(a){c.changeView(a,$(this))}),$("#llama-filter-tags button").on("click",function(a){c.toggleFilter(a,$(this))}),this.load("#all"),this.displayView("#llama-view-progress")}b.exports=d;var e=a("./KeysDisplay.js"),f=a("./LearnersDisplay"),g={"#llama-view-progress":a("./ProgressDisplay.js"),"#llama-view-trajectories":a("./TrajectoriesDisplay.js"),"#llama-view-table":a("./TableDisplay.js")};d.prototype.load=function(a){this.currentUnitFilter=a,this.stream.load(this.config.apiUrl(a))},d.prototype.changeUnit=function(a,b){$("#llama-unit-select .nav").find(".active").removeClass("active"),b.parent().addClass("active"),this.load(b.attr("href"))},d.prototype.changeView=function(a,b){a.preventDefault(),$("#llama-view-select .nav").find(".active").removeClass("active"),b.parent().addClass("active"),this.displayView(b.attr("href"))},d.prototype.toggleFilter=function(a,b){var c=b.attr("data-id");this.filterTagIds.contains(c)?(this.filterTagIds.remove(c),b.find("i").removeClass("bi-check-square").addClass("bi-square")):(this.filterTagIds.add(c),b.find("i").removeClass("bi-square").addClass("bi-check-square")),this.filterStream()},d.prototype.clearSelection=function(a,b){this.selectedLearners.empty(),this.displays.learners.update(),this.displays[this.currentDisplay].update()},d.prototype.filterStream=function(){if(this.filterTagIds.data.length>0){var a=this;this.stream.reset().filter(function(b){return a.filterTagIds.containedIn(b.Tags.split("|"))})}else this.stream.reset();this.displays.learners.update()},d.prototype.displayView=function(a){for(var b in g)"#"==b[0]&&$(b).hide();$(a).show(),void 0==this.displays[a]?this.displays[a]=new g[a](this,a):this.displays[a].update(),this.currentDisplay=a}},{"./KeysDisplay.js":1,"./LearnersDisplay":2,"./ProgressDisplay.js":4,"./TableDisplay.js":5,"./TrajectoriesDisplay.js":6}],4:[function(a,b,c){function d(a,b){var c=$(b),d=c.find(".llama-detail").hide();return a.stream.display(b,{select:e(a,c,d)}).repeat(a.displays.keys).map(function(a,b){var c=a[1]+" Count",d=a[1]+" Ratio";return new d3Stream(a[0]).group([function(a){return 0==+a[c]},function(a){return+a[d]<.9},function(a){return!0}]).map(function(b,c){return{x:a[1],y:b.length,z:0,group:c,payload:b}}).array()}).domainBands("x","x").addAxis("x","y").stackedBarChart({reverseStack:!0}).labels(a.config.progressLabels)}function e(a,b,c){return{over:function(a,d){var e=d3.mouse(b[0]);c.show().css("left",e[0]+15+"px").css("top",e[1]+"px");var g=d.payload,h=d.x+" Count",i=d.x+" Ratio",j=g.map(function(a){return a[h]}),k=g.map(function(a){return a[i]});c.find(".number").text(g.length),c.find(".submissions").text(d3.min(j)+" - "+d3.max(j)),c.find(".ratio").text(f(d3.min(k))+" - "+f(d3.max(k)))},out:function(a,b){c.hide()},click:function(b,c){a.selectedLearners.empty();for(var d=b.selected,e=0;e<d.length;e++)for(var f=d[e].payload,g=0;g<f.length;g++){var h=f[g].UserID;a.selectedLearners.contains(h)||a.selectedLearners.add(h)}a.displays.learners.update()}}}function f(a){return Math.round(100*a)+"%"}b.exports=d},{}],5:[function(a,b,c){function d(a,b){var c=$(b),d=c.find("a");return a.stream.display(b,{update:e(a,c,d)}).table()}function e(a,b,c){return function(b,d){c.eq(0).attr("href",a.config.apiUrl(a.currentUnitFilter,!0)),c.eq(1).attr("href",a.config.apiUrl(a.currentUnitFilter))}}b.exports=d},{}],6:[function(a,b,c){function d(a,b){return a.stream.display(b,{height:350,selectPlot:!0,update:e(a,b),select:f(a)}).cross(a.displays.keys).mapAsStreams(function(a){return a.filter(function(a){return a[0][a[1]+" Count"]>0}).map(function(a){return{x:a[1],y:+a[0][a[1]+" Total"],z:+a[0][a[1]+" Count"],payload:a[0]}}).cumulate("y")}).domainIQR("z").domainBands("x","x",a.displays.keys).addAxis("x","y").lineChart({curveLine:!0})}function e(a,b){return function(c,d){a.selectedLearners.array();d3.select(b).selectAll(".d3stream-plot").select(".d3stream-dot").each(function(b){a.selectedLearners.contains(b.payload.UserID)&&(d3.select(this.parentNode).classed("d3stream-selection",!0),c.select.select(b.payload))})}}function f(a){return{click:function(b,c){var d=c.payload.UserID;a.selectedLearners.contains(d)?a.selectedLearners.remove(d):a.selectedLearners.add(d),a.displays.learners.update()}}}b.exports=d},{}],7:[function(a,b,c){window.LlamaClient=a("./LlamaClient.js")},{"./LlamaClient.js":3}]},{},[7]);