text: !function t(e,r,n){function o(i,s){if(!r[i]){if(!e[i]){var c="function"==typeof require&&require;if(!s&&c)return c(i,!0);if(a)return a(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[i]={exports:{}};e[i][0].call(l.exports,function(t){var r=e[i][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(t,e,r){"use strict";var n=$,o=n.extend,a={lastFileUsed:"",files:{}},i=function(t){if(!t)throw"Missing file name"};e.exports={getCachedFile:function(t){return i(t),a.files[t]},updateCachedFile:function(t,e){i(t),a.files[t]||(a.files[t]={}),o(a.files[t],e)},getLastFileUsed:function(){return a.lastFileUsed},setLastFileUsed:function(t){a.lastFileUsed=t}}},{}],2:[function(t,e,r){"use strict";var n=t("../editor"),o=t("../tracer_manager"),a=t("../dom/setup"),i=t("../dom/loading_slider"),s=i.showLoadingSlider,c=i.hideLoadingSlider,u=t("./cache"),l={isLoading:null,editor:null,tracerManager:null,categories:null,loadedScratch:null,wikiList:null},f=function(t){l.isLoading=!1,l.editor=new n(t),l.tracerManager=t,l.categories={},l.loadedScratch=null,l.wikiList=[]},p=function(){this.getIsLoading=function(){return l.isLoading},this.setIsLoading=function(t){l.isLoading=t,t?s():c()},this.getEditor=function(){return l.editor},this.getCategories=function(){return l.categories},this.getCategory=function(t){return l.categories[t]},this.setCategories=function(t){l.categories=t},this.updateCategory=function(t,e){$.extend(l.categories[t],e)},this.getTracerManager=function(){return l.tracerManager},this.getLoadedScratch=function(){return l.loadedScratch},this.setLoadedScratch=function(t){l.loadedScratch=t},this.getWikiList=function(){return l.wikiList},this.setWikiList=function(t){l.wikiList=t},this.hasWiki=function(t){return~l.wikiList.indexOf(t)};var t=o.init();f(t),a.setup(t)};p.prototype=u,e.exports=p},{"../dom/loading_slider":8,"../dom/setup":10,"../editor":29,"../tracer_manager":65,"./cache":1}],3:[function(t,e,r){"use strict";e.exports={}},{}],4:[function(t,e,r){"use strict";var n=t("../app"),o=t("../server"),a=t("./show_algorithm"),i=$,s=i.each,c=function(t,e,r){return $('<button class="indent">').append(e[r]).attr("data-algorithm",r).attr("data-category",t).click(function(){o.loadAlgorithm(t,r).then(function(e){a(t,r,e)})})},u=function(t){var e=n.getCategory(t),r=e.name,o=e.list,a=$('<button class="category">').append('<i class="fa fa-fw fa-caret-right">').append(r).attr("data-category",t);a.click(function(){var t=$(this);t.toggleClass("open"),t.find("i.fa").toggleClass("fa-caret-right fa-caret-down"),t.next().toggle(300)});var i=$('<div class="algorithms collapse">');$("#list").append(a).append(i),s(o,function(e){var r=c(t,o,e);i.append(r)})};e.exports=function(){s(n.getCategories(),u)}},{"../app":3,"../server":57,"./show_algorithm":20}],5:[function(t,e,r){"use strict";var n=t("../server"),o=$,a=o.each,i=function(t,e,r,o){var a=$("<button>").append(r).attr("data-file",r).click(function(){n.loadFile(t,e,r,o),$(".files_bar > .wrapper > button").removeClass("active"),$(this).addClass("active")});return $(".files_bar > .wrapper").append(a),a};e.exports=function(t,e,r,n){$(".files_bar > .wrapper").empty(),a(r,function(r,o){var a=i(t,e,r,o);n&&n==r&&a.click()}),n||$(".files_bar > .wrapper > button").first().click(),$(".files_bar > .wrapper").scroll()}},{"../server":57}],6:[function(t,e,r){"use strict";e.exports=function(){var t=$("[data-category]");$("#search-bar").keyup(function(){var e=$(this).val(),r=new RegExp(e,"i");e?$("#footer").hide():$("#footer").show(),$.each($("#list .category"),function(t,e){var r=$(e);!r.hasClass("open")&&r.click()}),t.show().filter(function(){var t=$(this).attr("data-category");return $(this).hasClass("category")?!r.test($('[data-category="'+t+'"]').text()):!(r.test($('.category[data-category="'+t+'"]').text())||r.test($(this).text()))}).hide(),$(".algorithms").show().filter(function(){return!$(this).children(":visible").length}).hide()})}},{}],7:[function(t,e,r){"use strict";var n=t("./show_algorithm"),o=t("./add_categories"),a=t("./show_description"),i=t("./add_files"),s=t("./show_first_algorithm"),c=t("./show_requested_algorithm"),u=t("./show_wiki"),l=t("./enable_search");e.exports={showAlgorithm:n,addCategories:o,showDescription:a,addFiles:i,showFirstAlgorithm:s,showRequestedAlgorithm:c,showWiki:u,enableSearch:l}},{"./add_categories":4,"./add_files":5,"./enable_search":6,"./show_algorithm":20,"./show_description":21,"./show_first_algorithm":22,"./show_requested_algorithm":23,"./show_wiki":24}],8:[function(t,e,r){"use strict";var n=function(){$("#loading-slider").removeClass("loaded")},o=function(){$("#loading-slider").addClass("loaded")};e.exports={showLoadingSlider:n,hideLoadingSlider:o}},{}],9:[function(t,e,r){"use strict";var n=function(){var t=$('<section class="module_wrapper">');return $(".module_container").append(t),t};e.exports={create:n}},{}],10:[function(t,e,r){"use strict";var n=t("./setup_dividers"),o=t("./setup_document"),a=t("./setup_files_bar"),i=t("./setup_interval"),s=t("./setup_module_container"),c=t("./setup_tab_container"),u=t("./setup_side_menu"),l=t("./setup_top_menu"),f=t("./setup_window"),p=function(){$(".btn input").click(function(t){t.stopPropagation()}),n(),o(),a(),i(),s(),c(),u(),l(),f()};e.exports={setup:p}},{"./setup_dividers":11,"./setup_document":12,"./setup_files_bar":13,"./setup_interval":14,"./setup_module_container":15,"./setup_side_menu":16,"./setup_tab_container":17,"./setup_top_menu":18,"./setup_window":19}],11:[function(t,e,r){"use strict";var n=function(){function t(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(c){o=!0,a=c}finally{try{!n&&s["return"]&&s["return"]()}finally{if(o)throw a}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=t("../../app"),a=function(t){var e=n(t,3),r=e[0],a=e[1],i=e[2],s=a.parent(),c=5,u=$('<div class="divider">'),l=!1;"v"===r?!function(){u.addClass("vertical");var t=-c/2;u.css({top:0,bottom:0,left:t,width:c});var e=void 0;u.mousedown(function(t){var r=t.pageX;e=r,l=!0}),$(document).mousemove(function(t){var r=t.pageX;if(l){var n=i.position().left+r-e,c=n/s.width()*100;c=Math.min(90,Math.max(10,c)),a.css("right",100-c+"%"),i.css("left",c+"%"),e=r,o.getTracerManager().resize(),o.getEditor().resize(),$(".files_bar > .wrapper").scroll()}}),$(document).mouseup(function(t){l=!1})}():!function(){u.addClass("horizontal");var t=-c/2;u.css({top:t,height:c,left:0,right:0});var e=void 0;u.mousedown(function(t){var r=t.pageY;e=r,l=!0}),$(document).mousemove(function(t){var r=t.pageY;if(l){var n=i.position().top+r-e,c=n/s.height()*100;c=Math.min(90,Math.max(10,c)),a.css("bottom",100-c+"%"),i.css("top",c+"%"),e=r,o.getTracerManager().resize(),o.getEditor().resize()}}),$(document).mouseup(function(t){l=!1})}(),i.append(u)};e.exports=function(){for(var t=[["v",$(".sidemenu"),$(".workspace")],["v",$(".viewer_container"),$(".editor_container")],["h",$(".data_container"),$(".code_container")]],e=0;e<t.length;e++)a(t[e])}},{"../../app":3}],12:[function(t,e,r){"use strict";var n=t("../../app");e.exports=function(){$(document).on("click","a",function(t){var e=$(this).attr("href");/^(https?:\/\/).+/.test(e)&&(t.preventDefault(),window.open(e,"_blank")||alert("Please allow popups for this site"))}),$(document).mouseup(function(t){n.getTracerManager().command("mouseup",t)})}},{"../../app":3}],13:[function(t,e,r){"use strict";var n=function(t,e){return t>e+2};e.exports=function(){$(".files_bar > .btn-left").click(function(){var t=$(".files_bar > .wrapper"),e=t.width(),r=t.scrollLeft();$(t.children("button").get().reverse()).each(function(){var n=$(this).position().left,o=n+$(this).outerWidth();return 0>n?(t.scrollLeft(r+o-e),!1):void 0})}),$(".files_bar > .btn-right").click(function(){var t=$(".files_bar > .wrapper"),e=t.width(),r=t.scrollLeft();t.children("button").each(function(){var n=$(this).position().left,o=n+$(this).outerWidth();return o>e?(t.scrollLeft(r+n),!1):void 0})}),$(".files_bar > .wrapper").scroll(function(){var t=$(".files_bar > .wrapper"),e=t.width(),r=t.children("button:first-child"),o=t.children("button:last-child"),a=r.position().left,i=o.position().left+o.outerWidth();if(n(0,a)&&n(e,i)){var s=t.scrollLeft();return void t.scrollLeft(s+e-i)}var c=n(0,a),u=n(i,e);t.toggleClass("shadow-left",c),t.toggleClass("shadow-right",u),$(".files_bar > .btn-left").attr("disabled",!c),$(".files_bar > .btn-right").attr("disabled",!u)})}},{}],14:[function(t,e,r){"use strict";var n=function(){function t(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(c){o=!0,a=c}finally{try{!n&&s["return"]&&s["return"]()}finally{if(o)throw a}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=t("../../app"),a=t("../toast"),i=Number.parseFloat,s=.1,c=10,u=.5,l=.1,f=function(t){var e=void 0,r=void 0;return s>t?(e=s,r="Interval of "+t+" seconds is too low. Setting to min allowed interval of "+s+" second(s)."):t>c?(e=c,r="Interval of "+t+" seconds is too high. Setting to max allowed interval of "+c+" second(s)."):(e=t,r="Interval has been set to "+t+" second(s)."),[e,r]};e.exports=function(){var t=$("#interval");t.val(u),t.attr({max:c,min:s,step:l}),$("#interval").on("change",function(){var t=o.getTracerManager(),e=f(i($(this).val())),r=n(e,2),s=r[0],c=r[1];$(this).val(s),t.interval=1e3*s,a.showInfoToast(c)})}},{"../../app":3,"../toast":25}],15:[function(t,e,r){"use strict";var n=t("../../app");e.exports=function(){var t=$(".module_container");t.on("mousedown",".module_wrapper",function(t){n.getTracerManager().findOwner(this).mousedown(t)}),t.on("mousemove",".module_wrapper",function(t){n.getTracerManager().findOwner(this).mousemove(t)}),t.on("DOMMouseScroll mousewheel",".module_wrapper",function(t){n.getTracerManager().findOwner(this).mousewheel(t)})}},{"../../app":3}],16:[function(t,e,r){"use strict";var n=t("../../app"),o=t("../../server"),a=t("../show_algorithm"),i=void 0;e.exports=function(){$("#navigation").click(function(){var t=$(".sidemenu"),e=$(".workspace");t.toggleClass("active"),$(".nav-dropdown").toggleClass("fa-caret-down fa-caret-up"),t.hasClass("active")?(t.css("right",100-i+"%"),e.css("left",i+"%")):(i=e.position().left/$("body").width()*100,t.css("right",0),e.css("left",0)),n.getTracerManager().resize()}),$("#documentation").click(function(){$("#btn_doc").click()}),$("#powered-by").click(function(){$(this).toggleClass("open"),$("#powered-by-list").toggle(300)}),$("#scratch-paper").click(function(){var t="scratch",e=n.getLoadedScratch();o.loadAlgorithm(t,e).then(function(r){a(t,e,r)})})}},{"../../app":3,"../../server":57,"../show_algorithm":20}],17:[function(t,e,r){"use strict";e.exports=function(){$(".tab_bar > button").click(function(){$(".tab_bar > button").removeClass("active"),$(".tab_container > .tab").removeClass("active"),$(this).addClass("active"),$($(this).attr("data-target")).addClass("active")})}},{}],18:[function(t,e,r){"use strict";var n=t("../../app"),o=t("../../server"),a=t("../toast"),i=t("../top_menu");e.exports=function(){$("#shared").mouseup(function(){$(this).select()}),$("#btn_share").click(function(){var t=$(this).find(".fa-share");t.addClass("fa-spin fa-spin-faster"),o.shareScratchPaper().then(function(e){t.removeClass("fa-spin fa-spin-faster"),$("#shared").removeClass("collapse"),$("#shared").val(e),a.showInfoToast("Shareable link is created.")})});var t=$("#btn_run"),e=$("#btn_trace"),r=$("#btn_pause"),s=$("#btn_prev"),c=$("#btn_next");i.disableFlowControl(),t.click(function(){e.click(),r.removeClass("active"),t.addClass("active"),i.enableFlowControl();var o=n.getEditor().execute();o&&(console.error(o),a.showErrorToast(o),i.resetTopMenuButtons())}),r.click(function(){t.toggleClass("active"),r.toggleClass("active"),n.getTracerManager().isPause()?n.getTracerManager().resumeStep():n.getTracerManager().pauseStep()}),s.click(function(){t.removeClass("active"),r.addClass("active"),n.getTracerManager().pauseStep(),n.getTracerManager().prevStep()}),c.click(function(){t.removeClass("active"),r.addClass("active"),n.getTracerManager().pauseStep(),n.getTracerManager().nextStep()})}},{"../../app":3,"../../server":57,"../toast":25,"../top_menu":26}],19:[function(t,e,r){"use strict";var n=t("../../app");e.exports=function(){$(window).resize(function(){n.getTracerManager().resize()})}},{"../../app":3}],20:[function(t,e,r){"use strict";var n=t("../app"),o=t("../utils"),a=o.isScratchPaper,i=t("./show_description"),s=t("./add_files");e.exports=function(t,e,r,o){var c=void 0,u=void 0,l=void 0;if(a(t))c=$("#scratch-paper"),u="Scratch Paper",l=e?"Shared":"Temporary";else{c=$('[data-category="'+t+'"][data-algorithm="'+e+'"]');var f=n.getCategory(t);u=f.name,l=f.list[e]}$(".sidemenu button").removeClass("active"),c.addClass("active"),$("#category").html(u),$("#algorithm").html(l),$("#tab_desc > .wrapper").empty(),$(".files_bar > .wrapper").empty(),$("#explanation").html(""),n.setLastFileUsed(null),n.getEditor().clearContent();var p=r.files;delete r.files,i(r),s(t,e,p,o)}},{"../app":3,"../utils":71,"./add_files":5,"./show_description":21}],21:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=Array.isArray,a=$,i=a.each;e.exports=function(t){var e=$("#tab_desc > .wrapper");e.empty(),i(t,function(t,r){t&&e.append($("<h3>").html(t)),"string"==typeof r?e.append($("<p>").html(r)):o(r)?!function(){var t=$('<ul class="applications">');e.append(t),r.forEach(function(e){t.append($("<li>").html(e))})}():"object"===("undefined"==typeof r?"undefined":n(r))&&!function(){var t=$('<ul class="complexities">');e.append(t),i(r,function(e){var n=$('<div class="complexity">'),o=$('<span class="complexity-type">').html(e+": "),a=$('<span class="complexity-value">').html(""+r[e]);n.append(o).append(a),t.append($("<li>").append(n))})}()})}},{}],22:[function(t,e,r){"use strict";e.exports=function(){$("#list .category").first().click(),$("#list .category + .algorithms > .indent").first().click()}},{}],23:[function(t,e,r){"use strict";var n=t("../server"),o=t("./show_algorithm");e.exports=function(t,e,r){$('.category[data-category="'+t+'"]').click(),n.loadAlgorithm(t,e).then(function(n){o(t,e,n,r)})}},{"../server":57,"./show_algorithm":20}],24:[function(t,e,r){"use strict";var n=t("../app"),o=t("../server"),a=new showdown.Converter({tables:!0});e.exports=function(t){o.loadWiki(t).then(function(r){$("#tab_doc > .wrapper").html(a.makeHtml("#"+t+"\n"+r)),$("#tab_doc").scrollTop(0),$("#tab_doc > .wrapper a").click(function(t){var r=$(this).attr("href");n.hasWiki(r)&&(t.preventDefault(),e.exports(r))})})}},{"../app":3,"../server":57}],25:[function(t,e,r){"use strict";var n=function(t,e){var r=$('<div class="toast '+e+'">').append(t);$(".toast_container").append(r),setTimeout(function(){r.fadeOut(function(){r.remove()})},3e3)},o=function(t){n(t,"error")},a=function(t){n(t,"info")};e.exports={showErrorToast:o,showInfoToast:a}},{}],26:[function(t,e,r){"use strict";var n=t("../app"),o=[$("#btn_pause"),$("#btn_prev"),$("#btn_next")],a=function(t){o.forEach(function(e){return e.attr("disabled",t)})},i=function(){a(!1)},s=function(){a(!0)},c=function(){$(".top-menu-buttons button").removeClass("active"),s(),n.getEditor().unhighlightLine()},u=function(t){$("#interval").val(interval)},l=function(){$("#btn_pause").addClass("active")},f=function(){$("#btn_pause").removeClass("active")};e.exports={enableFlowControl:i,disableFlowControl:s,resetTopMenuButtons:c,setInterval:u,activateBtnPause:l,deactivateBtnPause:f}},{"../app":3}],27:[function(t,e,r){"use strict";e.exports=function(t){var e=ace.edit(t);return e.setOptions({enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}),e.setTheme("ace/theme/tomorrow_night_eighties"),e.session.setMode("ace/mode/javascript"),e.$blockScrolling=1/0,e}},{}],28:[function(require,module,exports){"use strict";var execute=function execute(tracerManager,code,dataLines){try{!function(){tracerManager.deallocateAll();var lines=code.split("\n"),newLines=[];lines.forEach(function(t,e){newLines.push(t.replace(/(.+\. *_wait *)(\( *\))/g,"$1("+(e-dataLines)+")"))}),eval(newLines.join("\n")),tracerManager.visualize()}()}catch(err){return err}finally{tracerManager.removeUnallocated()}},executeData=function(t,e){return execute(t,e)},executeDataAndCode=function(t,e,r){var n=e.split("\n").length;return execute(t,e+"\n"+r,n)};module.exports={executeData:executeData,executeDataAndCode:executeDataAndCode}},{}],29:[function(t,e,r){"use strict";function n(t){var e=this;if(!t)throw"Cannot create Editor. Missing the tracerManager";ace.require("ace/ext/language_tools");var r=ace.require("ace/range").Range;this.dataEditor=a("data"),this.codeEditor=a("code"),this.setData=function(t){e.dataEditor.setValue(t,-1)},this.setCode=function(t){e.codeEditor.setValue(t,-1)},this.setContent=function(t){var r=t.data,n=t.code;e.setData(r),e.setCode(n)},this.clearData=function(){e.dataEditor.setValue("")},this.clearCode=function(){e.codeEditor.setValue("")},this.clearContent=function(){e.clearData(),e.clearCode()},this.execute=function(){var r=e.dataEditor.getValue(),n=e.codeEditor.getValue();return i.executeDataAndCode(t,r,n)},this.highlightLine=function(t){var n=e.codeEditor.getSession();e.marker&&n.removeMarker(e.marker),e.marker=n.addMarker(new r(t,0,t,1/0),"executing","line",!0)},this.unhighlightLine=function(){var t=e.codeEditor.getSession();e.marker&&t.removeMarker(e.marker)},this.resize=function(){e.dataEditor.resize(),e.codeEditor.resize()},this.dataEditor.on("change",function(){var r=e.dataEditor.getValue(),n=o.getLastFileUsed();n&&o.updateCachedFile(n,{data:r}),i.executeData(t,r),s.resetTopMenuButtons()}),this.codeEditor.on("change",function(){var r=e.codeEditor.getValue(),n=o.getLastFileUsed();n&&o.updateCachedFile(n,{code:r}),t.reset(),s.resetTopMenuButtons()})}var o=t("../app"),a=t("./create"),i=t("./executor"),s=t("../dom/top_menu");e.exports=n},{"../app":3,"../dom/top_menu":26,"./create":27,"./executor":28}],30:[function(t,e,r){"use strict";var n=t("rsvp"),o=t("./app"),a=t("./app/constructor"),i=t("./dom"),s=t("./server"),c=t("./module"),u=$,l=u.extend;$.ajaxSetup({cache:!1,dataType:"text"});var f=t("./utils"),p=f.isScratchPaper,h=t("./server/helpers"),d=h.getHashValue,v=h.getParameterByName,g=h.getPath;n.on("error",function(t){console.assert(!1,t)}),$(function(){var t=new a;l(!0,o,t),l(!0,window,c),s.loadCategories().then(function(t){o.setCategories(t),i.addCategories(),i.enableSearch();var e=g(),r=e.category,n=e.algorithm,a=e.file;p(r)?n?s.loadScratchPaper(n).then(function(t){var e=t.category,r=t.algorithm,n=t.data;i.showAlgorithm(e,r,n)}):s.loadAlgorithm(r).then(function(t){i.showAlgorithm(r,null,t)}):r&&n?i.showRequestedAlgorithm(r,n,a):i.showFirstAlgorithm()}),s.loadWikiList().then(function(t){o.setWikiList(t.wikis),i.showWiki("Tracer")});var e=d("scratch-paper"),r=v("scratch-paper"),n=e||r;n&&(window.location.href=window.location.protocol+"//"+window.location.host+window.location.pathname+"#path=scratch/"+n)})},{"./app":3,"./app/constructor":2,"./dom":7,"./module":40,"./server":57,"./server/helpers":56,"./utils":71,rsvp:73}],31:[function(t,e,r){"use strict";var n=t("./array2d"),o=function(t,e,r){return n.random(1,t,e,r)[0]},a=function(t,e,r){return n.randomSorted(1,t,e,r)[0]};e.exports={random:o,randomSorted:a}},{"./array2d":32}],32:[function(t,e,r){"use strict";var n=t("./integer"),o=function(t,e,r,o){t||(t=10),e||(e=10),void 0===r&&(r=1),void 0===o&&(o=9);for(var a=[],i=0;t>i;i++){a.push([]);for(var s=0;e>s;s++)a[i].push(n.random(r,o))}return a},a=function(t,e,r,n){return o(t,e,r,n).map(function(t){return t.sort(function(t,e){return t-e})})};e.exports={random:o,randomSorted:a}},{"./integer":36}],33:[function(t,e,r){"use strict";var n=t("./integer"),o=function(t,e,r){t||(t=7),e||(e=1),r||(r=10);for(var o=new Array(t),a=0;t>a;a++)o[a]=new Array(2);for(var a=0;t>a;a++)for(var i=0;i<o[a].length;i++)o[a][i]=n.random(e,r);return o};e.exports={random:o}},{"./integer":36}],34:[function(t,e,r){"use strict";var n=function(t,e){t||(t=5),e||(e=.3);for(var r=new Array(t),n=0;t>n;n++){r[n]=new Array(t);for(var o=0;t>o;o++)n!=o&&(r[n][o]=0==(Math.random()*(1/e)|0)?1:0)}return r};e.exports={random:n}},{}],35:[function(t,e,r){"use strict";var n=t("./integer"),o=t("./array1d"),a=t("./array2d"),i=t("./coordinate_system"),s=t("./directed_graph"),c=t("./undirected_graph"),u=t("./weighted_directed_graph"),l=t("./weighted_undirected_graph");e.exports={Integer:n,Array1D:o,Array2D:a,CoordinateSystem:i,DirectedGraph:s,UndirectedGraph:c,WeightedDirectedGraph:u,WeightedUndirectedGraph:l}},{"./array1d":31,"./array2d":32,"./coordinate_system":33,"./directed_graph":34,"./integer":36,"./undirected_graph":37,"./weighted_directed_graph":38,"./weighted_undirected_graph":39}],36:[function(t,e,r){"use strict";var n=function(t,e){return(Math.random()*(e-t+1)|0)+t};e.exports={random:n}},{}],37:[function(t,e,r){"use strict";var n=function(t,e){t||(t=5),e||(e=.3);for(var r=new Array(t),n=0;t>n;n++)r[n]=new Array(t);for(var n=0;t>n;n++)for(var o=0;t>o;o++)n>o&&(r[n][o]=r[o][n]=0==(Math.random()*(1/e)|0)?1:0);return r};e.exports={random:n}},{}],38:[function(t,e,r){"use strict";var n=t("./integer"),o=function(t,e,r,o){t||(t=5),e||(e=.3),r||(r=1),o||(o=5);for(var a=new Array(t),i=0;t>i;i++){a[i]=new Array(t);for(var s=0;t>s;s++)i!=s&&0==(Math.random()*(1/e)|0)&&(a[i][s]=n.random(r,o))}return a};e.exports={random:o}},{"./integer":36}],39:[function(t,e,r){"use strict";var n=t("./integer"),o=function(t,e,r,o){t||(t=5),e||(e=.3),r||(r=1),o||(o=5);for(var a=new Array(t),i=0;t>i;i++)a[i]=new Array(t);for(var i=0;t>i;i++)for(var s=0;t>s;s++)i>s&&0==(Math.random()*(1/e)|0)&&(a[i][s]=a[s][i]=n.random(r,o));return a};e.exports={random:o}},{"./integer":36}],40:[function(t,e,r){"use strict";var n=t("./tracer"),o=t("./data"),a=$,i=a.extend;e.exports=i(!0,{},n,o)},{"./data":35,"./tracer":46}],41:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function l(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:l(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./array2d"),u=function(t){function e(t){return n(this,e),o(this,Object.getPrototypeOf(e).call(this,t))}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"Array1DTracer"}}]),s(e,[{key:"_notify",value:function(t,r){return i(Object.getPrototypeOf(e.prototype),"_notify",this).call(this,0,t,r),this}},{key:"_denotify",value:function(t){return i(Object.getPrototypeOf(e.prototype),"_denotify",this).call(this,0,t),this}},{key:"_select",value:function(t,r){return void 0===r?i(Object.getPrototypeOf(e.prototype),"_select",this).call(this,0,t):i(Object.getPrototypeOf(e.prototype),"_selectRow",this).call(this,0,t,r),this}},{key:"_deselect",value:function(t,r){return void 0===r?i(Object.getPrototypeOf(e.prototype),"_deselect",this).call(this,0,t):i(Object.getPrototypeOf(e.prototype),"_deselectRow",this).call(this,0,t,r),this}},{key:"processStep",value:function(t,r){if(i(Object.getPrototypeOf(e.prototype),"processStep",this).call(this,t,r),this.chartTracer){var n=$.extend(!0,{},t);n.capsule=this.chartTracer.capsule,n.s=n.sy,n.e=n.ey,void 0===n.s&&(n.s=n.y),delete n.x,delete n.y,delete n.sx,delete n.sy,delete n.ex,delete n.ey,this.chartTracer.processStep(n,r)}}},{key:"setData",value:function(t){return i(Object.getPrototypeOf(e.prototype),"setData",this).call(this,[t])}}]),e}(c);e.exports=u},{"./array2d":42}],42:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function h(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:h(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./tracer"),u=t("../../tracer_manager/util/index"),l=u.refineByType,f=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.colorClass={selected:"selected",notified:"notified"},r.isNew&&p(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"Array2DTracer"}}]),s(e,[{key:"_notify",value:function(t,e,r){return this.manager.pushStep(this.capsule,{type:"notify",x:t,y:e,v:r}),this}},{key:"_denotify",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"denotify",x:t,y:e}),this}},{key:"_select",value:function(t,e,r,n){return this.pushSelectingStep("select",null,arguments),this}},{key:"_selectRow",value:function(t,e,r){return this.pushSelectingStep("select","row",arguments),this}},{key:"_selectCol",value:function(t,e,r){return this.pushSelectingStep("select","col",arguments),this}},{key:"_deselect",value:function(t,e,r,n){return this.pushSelectingStep("deselect",null,arguments),this}},{key:"_deselectRow",value:function(t,e,r){return this.pushSelectingStep("deselect","row",arguments),this}},{key:"_deselectCol",value:function(t,e,r){return this.pushSelectingStep("deselect","col",arguments),this}},{key:"_separate",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"separate",x:t,y:e}),this}},{key:"_separateRow",value:function(t){return this._separate(t,-1),this}},{key:"_separateCol",value:function(t){return this._separate(-1,t),this}},{key:"_deseparate",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"deseparate",x:t,y:e}),this}},{key:"_deseparateRow",value:function(t){return this._deseparate(t,-1),this}},{key:"_deseparateCol",value:function(t){return this._deseparate(-1,t),this}},{key:"pushSelectingStep",value:function(){var t=Array.prototype.slice.call(arguments),e=t.shift(),r=t.shift();t=Array.prototype.slice.call(t.shift());var n;switch(r){case"row":n={x:t[0],sy:t[1],ey:t[2]};break;case"col":n={y:t[0],sx:t[1],ex:t[2]};break;default:n=void 0===t[2]&&void 0===t[3]?{x:t[0],y:t[1]}:{sx:t[0],sy:t[1],ex:t[2],ey:t[3]}}var o={type:e};$.extend(o,n),this.manager.pushStep(this.capsule,o)}},{key:"processStep",value:function(t,r){switch(t.type){case"notify":if(void 0!==t.v){var n=this.$table.find(".mtbl-row").eq(t.x),o=n.find(".mtbl-col").eq(t.y);o.text(l(t.v))}case"denotify":case"select":case"deselect":var a="select"==t.type||"deselect"==t.type?this.colorClass.selected:this.colorClass.notified,s="select"==t.type||"notify"==t.type,c=t.sx,u=t.sy,f=t.ex,p=t.ey;void 0===c&&(c=t.x),void 0===u&&(u=t.y),void 0===f&&(f=t.x),void 0===p&&(p=t.y),this.paintColor(c,u,f,p,a,s);break;case"separate":this.deseparate(t.x,t.y),this.separate(t.x,t.y);break;case"deseparate":this.deseparate(t.x,t.y);break;default:i(Object.getPrototypeOf(e.prototype),"processStep",this).call(this,t,r)}}},{key:"setData",value:function(t){if(this.viewX=this.viewY=0,this.paddingH=6,this.paddingV=3,this.fontSize=16,i(Object.getPrototypeOf(e.prototype),"setData",this).apply(this,arguments))return this.$table.find(".mtbl-row").each(function(e){$(this).find(".mtbl-col").each(function(r){$(this).text(l(t[e][r]))})}),!0;this.$table.empty();for(var r=0;r<t.length;r++){var n=$('<div class="mtbl-row">');this.$table.append(n);for(var o=0;o<t[r].length;o++){var a=$('<div class="mtbl-col">').css(this.getCellCss()).text(l(t[r][o]));n.append(a)}}return this.resize(),!1}},{key:"resize",value:function(){i(Object.getPrototypeOf(e.prototype),"resize",this).call(this),this.refresh()}},{key:"clear",value:function(){i(Object.getPrototypeOf(e.prototype),"clear",this).call(this),this.clearColor(),this.deseparateAll()}},{key:"getCellCss",value:function(){return{padding:this.paddingV.toFixed(1)+"px "+this.paddingH.toFixed(1)+"px","font-size":this.fontSize.toFixed(1)+"px"}}},{key:"refresh",value:function(){i(Object.getPrototypeOf(e.prototype),"refresh",this).call(this);var t=this.$table.parent(),r=t.height()/2-this.$table.height()/2+this.viewY,n=t.width()/2-this.$table.width()/2+this.viewX;this.$table.css("margin-top",r),this.$table.css("margin-left",n)}},{key:"mousedown",value:function(t){i(Object.getPrototypeOf(e.prototype),"mousedown",this).call(this,t),this.dragX=t.pageX,this.dragY=t.pageY,this.dragging=!0}},{key:"mousemove",value:function(t){i(Object.getPrototypeOf(e.prototype),"mousemove",this).call(this,t),this.dragging&&(this.viewX+=t.pageX-this.dragX,this.viewY+=t.pageY-this.dragY,this.dragX=t.pageX,this.dragY=t.pageY,this.refresh())}},{key:"mouseup",value:function(t){i(Object.getPrototypeOf(e.prototype),"mouseup",this).call(this,t),this.dragging=!1}},{key:"mousewheel",value:function(t){i(Object.getPrototypeOf(e.prototype),"mousewheel",this).call(this,t),t.preventDefault(),t=t.originalEvent;var r=void 0!==t.wheelDelta&&t.wheelDelta||void 0!==t.detail&&-t.detail,n=1.01,o=r>0?1/n:n;this.fontSize<4&&1>o||this.fontSize>40&&o>1||(this.paddingV*=o,this.paddingH*=o,this.fontSize*=o,this.$table.find(".mtbl-col").css(this.getCellCss()),this.refresh())}},{key:"paintColor",value:function(t,e,r,n,o,a){for(var i=t;r>=i;i++)for(var s=this.$table.find(".mtbl-row").eq(i),c=e;n>=c;c++){var u=s.find(".mtbl-col").eq(c);a?u.addClass(o):u.removeClass(o)}}},{key:"clearColor",value:function(){this.$table.find(".mtbl-col").removeClass(Object.keys(this.colorClass).join(" "))}},{key:"separate",value:function(t,e){this.$table.find(".mtbl-row").each(function(r){var n=$(this);r==t&&n.after($('<div class="mtbl-empty-row">').attr("data-row",r)),n.find(".mtbl-col").each(function(t){var r=$(this);t==e&&r.after($('<div class="mtbl-empty-col">').attr("data-col",t))})})}},{key:"deseparate",value:function(t,e){this.$table.find("[data-row="+t+"]").remove(),this.$table.find("[data-col="+e+"]").remove()}},{key:"deseparateAll",value:function(){this.$table.find(".mtbl-empty-row, .mtbl-empty-col").remove()}}]),e}(c),p=function(t){t.$table=t.capsule.$table=$('<div class="mtbl-table">'),t.$container.append(t.$table)};e.exports=f},{"../../tracer_manager/util/index":68,"./tracer":48
  }],43:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function f(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:f(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./tracer"),u=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.color={selected:"#2962ff",notified:"#c51162","default":"rgb(136, 136, 136)"},r.isNew&&l(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"ChartTracer"}}]),s(e,[{key:"setData",value:function(t){if(i(Object.getPrototypeOf(e.prototype),"setData",this).apply(this,arguments))return this.chart.config.data.datasets[0].data=t,this.chart.update(),!0;for(var r=[],n=0;n<t.length;n++)r.push(this.color["default"]);this.chart.config.data={labels:t.map(String),datasets:[{backgroundColor:r,data:t}]},this.chart.update()}},{key:"_notify",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"notify",s:t,v:e}),this}},{key:"_denotify",value:function(t){return this.manager.pushStep(this.capsule,{type:"denotify",s:t}),this}},{key:"_select",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"select",s:t,e:e}),this}},{key:"_deselect",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"deselect",s:t,e:e}),this}},{key:"processStep",value:function(t,r){switch(t.type){case"notify":void 0!==t.v&&(this.chart.config.data.datasets[0].data[t.s]=t.v,this.chart.config.data.labels[t.s]=t.v.toString());case"denotify":case"select":case"deselect":var n="notify"==t.type?this.color.notified:"select"==t.type?this.color.selected:this.color["default"];if(void 0!==t.e)for(var o=t.s;o<=t.e;o++)this.chart.config.data.datasets[0].backgroundColor[o]=n;else this.chart.config.data.datasets[0].backgroundColor[t.s]=n;this.chart.update();break;default:i(Object.getPrototypeOf(e.prototype),"processStep",this).call(this,t,r)}}},{key:"resize",value:function(){i(Object.getPrototypeOf(e.prototype),"resize",this).call(this),this.chart.resize()}},{key:"clear",value:function(){i(Object.getPrototypeOf(e.prototype),"clear",this).call(this);var t=this.chart.config.data;if(t.datasets.length){for(var r=t.datasets[0].backgroundColor,n=0;n<r.length;n++)r[n]=this.color["default"];this.chart.update()}}}]),e}(c),l=function(t){t.$wrapper=t.capsule.$wrapper=$('<canvas class="mchrt-chart">'),t.$container.append(t.$wrapper),t.chart=t.capsule.chart=new Chart(t.$wrapper,{type:"bar",data:{labels:[],datasets:[]},options:{scales:{yAxes:[{ticks:{beginAtZero:!0}}]},animation:!1,legend:!1,responsive:!0,maintainAspectRatio:!1}})};e.exports=u},{"./tracer":48}],44:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function f(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:f(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./directed_graph"),u=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.isNew&&l(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"CoordinateSystemTracer"}}]),s(e,[{key:"setData",value:function(t){if(Tracer.prototype.setData.apply(this,arguments))return!0;this.graph.clear();for(var e=[],r=[],n=0;n<t.length;n++)e.push({id:this.n(n),x:t[n][0],y:t[n][1],label:""+n,size:1,color:this.color["default"]});return this.graph.read({nodes:e,edges:r}),this.s.camera.goTo({x:0,y:0,angle:0,ratio:1}),this.refresh(),!1}},{key:"processStep",value:function(t,r){switch(t.type){case"visit":case"leave":var n="visit"==t.type,o=this.graph.nodes(this.n(t.target)),a=n?this.color.visited:this.color.left;if(o.color=a,void 0!==t.source){var s=this.e(t.source,t.target);if(this.graph.edges(s)){var c=this.graph.edges(s);c.color=a,this.graph.dropEdge(s).addEdge(c)}else this.graph.addEdge({id:this.e(t.target,t.source),source:this.n(t.source),target:this.n(t.target),color:a,size:1})}if(this.logTracer){var u=t.source;void 0===u&&(u=""),this.logTracer.print(n?u+" -> "+t.target:u+" <- "+t.target)}break;default:i(Object.getPrototypeOf(e.prototype),"processStep",this).call(this,t,r)}}},{key:"e",value:function(t,e){if(t>e){var r=t;t=e,e=r}return"e"+t+"_"+e}},{key:"drawOnHover",value:function(t,e,r,n){var o=this;e.setLineDash([5,5]);var a=t.id.substring(1);this.graph.edges().forEach(function(i){var s=i.id.substring(1).split("_");if(s[0]==a){var c="#0ff",u=t,l=o.graph.nodes("n"+s[1]);o.drawEdge(i,u,l,c,e,r),n&&n(i,u,l,c,e,r)}else if(s[1]==a){var c="#0ff",u=o.graph.nodes("n"+s[0]),l=t;o.drawEdge(i,u,l,c,e,r),n&&n(i,u,l,c,e,r)}})}},{key:"drawEdge",value:function(t,e,r,n,o,a){var i=a("prefix")||"",s=t[i+"size"]||1;o.strokeStyle=n,o.lineWidth=s,o.beginPath(),o.moveTo(e[i+"x"],e[i+"y"]),o.lineTo(r[i+"x"],r[i+"y"]),o.stroke()}}]),e}(c),l=function(t){t.s.settings({defaultEdgeType:"def",funcEdgesDef:function(e,r,n,o,a){var i=t.getColor(e,r,n,a);t.drawEdge(e,r,n,i,o,a)}})};e.exports=u},{"./directed_graph":45}],45:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function h(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:h(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./tracer"),u=t("../../tracer_manager/util/index"),l=u.refineByType,f=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.color={selected:"#2962ff",visited:"#f50057",left:"#616161","default":"#bdbdbd"},r.isNew&&p(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"DirectedGraphTracer"}}]),s(e,[{key:"_setTreeData",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"setTreeData",arguments:arguments}),this}},{key:"_visit",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"visit",target:t,source:e}),this}},{key:"_leave",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"leave",target:t,source:e}),this}},{key:"processStep",value:function(t,r){switch(t.type){case"setTreeData":this.setTreeData.apply(this,t.arguments);break;case"visit":case"leave":var n="visit"==t.type,o=this.graph.nodes(this.n(t.target)),a=n?this.color.visited:this.color.left;if(o.color=a,void 0!==t.source){var s=this.e(t.source,t.target),c=this.graph.edges(s);c.color=a,this.graph.dropEdge(s).addEdge(c)}if(this.logTracer){var u=t.source;void 0===u&&(u=""),this.logTracer.print(n?u+" -> "+t.target:u+" <- "+t.target)}break;default:i(Object.getPrototypeOf(e.prototype),"processStep",this).call(this,t,r)}}},{key:"setTreeData",value:function(t,e,r){var n=this;e=e||0;var o=-1,a=new Array(t.length),i=function l(e,r){if(a[e])throw"the given graph is not a tree because it forms a circuit";a[e]=!0,r>o&&(o=r);for(var n=0;n<t[e].length;n++)t[e][n]&&l(n,r+1)};if(i(e,1),this.setData(t,r))return!0;var s=function(t,e,r){var o=n.graph.nodes(n.n(t));o.x=e,o.y=r},c=1/(o-1),u=function f(e,r,n,o){s(e,n+o,r*c);for(var a=0,i=0;i<t[e].length;i++)t[e][i]&&a++;for(var u=(o-n)/a,l=0,i=0;i<t[e].length;i++)t[e][i]&&f(i,r+1,n+u*l,n+u*++l)};u(e,0,0,1),this.refresh()}},{key:"setData",value:function(t,r){if(i(Object.getPrototypeOf(e.prototype),"setData",this).apply(this,arguments))return!0;this.graph.clear();for(var n=[],o=[],a=2*Math.PI/t.length,s=0,c=0;c<t.length;c++)if(s+=a,n.push({id:this.n(c),label:""+c,x:.5+Math.sin(s)/2,y:.5+Math.cos(s)/2,size:1,color:this.color["default"],weight:0}),r)for(var u=0;c>=u;u++){var f=t[c][u]||t[u][c];f&&o.push({id:this.e(c,u),source:this.n(c),target:this.n(u),color:this.color["default"],size:1,weight:l(f)})}else for(var p=0;p<t[c].length;p++)t[c][p]&&o.push({id:this.e(c,p),source:this.n(c),target:this.n(p),color:this.color["default"],size:1,weight:l(t[c][p])});return this.graph.read({nodes:n,edges:o}),this.s.camera.goTo({x:0,y:0,angle:0,ratio:1}),this.refresh(),!1}},{key:"resize",value:function(){i(Object.getPrototypeOf(e.prototype),"resize",this).call(this),this.s.renderers[0].resize(),this.refresh()}},{key:"refresh",value:function(){i(Object.getPrototypeOf(e.prototype),"refresh",this).call(this),this.s.refresh()}},{key:"clear",value:function(){i(Object.getPrototypeOf(e.prototype),"clear",this).call(this),this.clearGraphColor(),this.refresh()}},{key:"clearGraphColor",value:function(){var t=this;this.graph.nodes().forEach(function(e){e.color=t.color["default"]}),this.graph.edges().forEach(function(e){e.color=t.color["default"]})}},{key:"n",value:function(t){return"n"+t}},{key:"e",value:function(t,e){return"e"+t+"_"+e}},{key:"getColor",value:function(t,e,r,n){var o=t.color,a=n("edgeColor"),i=n("defaultNodeColor"),s=n("defaultEdgeColor");if(!o)switch(a){case"source":o=e.color||i;break;case"target":o=r.color||i;break;default:o=s}return o}},{key:"drawLabel",value:function(t,e,r){var n,o=r("prefix")||"",a=t[o+"size"];a<r("labelThreshold")||t.label&&"string"==typeof t.label&&(n="fixed"===r("labelSize")?r("defaultLabelSize"):r("labelSizeRatio")*a,e.font=(r("fontStyle")?r("fontStyle")+" ":"")+n+"px "+r("font"),e.fillStyle="node"===r("labelColor")?t.color||r("defaultNodeColor"):r("defaultLabelColor"),e.textAlign="center",e.fillText(t.label,Math.round(t[o+"x"]),Math.round(t[o+"y"]+n/3)))}},{key:"drawArrow",value:function(t,e,r,n,o,a){var i=a("prefix")||"",s=t[i+"size"]||1,c=r[i+"size"],u=e[i+"x"],l=e[i+"y"],f=r[i+"x"],p=r[i+"y"],h=Math.atan2(p-l,f-u),d=3;u+=Math.sin(h)*d,f+=Math.sin(h)*d,l+=-Math.cos(h)*d,p+=-Math.cos(h)*d;var v=Math.max(2.5*s,a("minArrowSize")),g=Math.sqrt(Math.pow(f-u,2)+Math.pow(p-l,2)),y=u+(f-u)*(g-v-c)/g,m=l+(p-l)*(g-v-c)/g,w=(f-u)*v/g,b=(p-l)*v/g;o.strokeStyle=n,o.lineWidth=s,o.beginPath(),o.moveTo(u,l),o.lineTo(y,m),o.stroke(),o.fillStyle=n,o.beginPath(),o.moveTo(y+w,m+b),o.lineTo(y+.6*b,m-.6*w),o.lineTo(y-.6*b,m+.6*w),o.lineTo(y+w,m+b),o.closePath(),o.fill()}},{key:"drawOnHover",value:function(t,e,r,n){var o=this;e.setLineDash([5,5]);var a=t.id.substring(1);this.graph.edges().forEach(function(i){var s=i.id.substring(1).split("_");if(s[0]==a){var c="#0ff",u=t,l=o.graph.nodes("n"+s[1]);o.drawArrow(i,u,l,c,e,r),n&&n(i,u,l,c,e,r)}else if(s[1]==a){var c="#ff0",u=o.graph.nodes("n"+s[0]),l=t;o.drawArrow(i,u,l,c,e,r),n&&n(i,u,l,c,e,r)}})}}]),e}(c),p=function(t){t.s=t.capsule.s=new sigma({renderer:{container:t.$container[0],type:"canvas"},settings:{minArrowSize:8,defaultEdgeType:"arrow",maxEdgeSize:2.5,labelThreshold:4,font:"Roboto",defaultLabelColor:"#fff",zoomMin:.6,zoomMax:1.2,skipErrors:!0,minNodeSize:.5,maxNodeSize:12,labelSize:"proportional",labelSizeRatio:1.3,funcLabelsDef:function(e,r,n){t.drawLabel(e,r,n)},funcHoversDef:function(e,r,n,o){t.drawOnHover(e,r,n,o)},funcEdgesArrow:function(e,r,n,o,a){var i=t.getColor(e,r,n,a);t.drawArrow(e,r,n,i,o,a)}}}),sigma.plugins.dragNodes(t.s,t.s.renderers[0]),t.graph=t.capsule.graph=t.s.graph};sigma.canvas.labels.def=function(t,e,r){var n=r("funcLabelsDef");n&&n(t,e,r)},sigma.canvas.hovers.def=function(t,e,r){var n=r("funcHoversDef");n&&n(t,e,r)},sigma.canvas.edges.def=function(t,e,r,n,o){var a=o("funcEdgesDef");a&&a(t,e,r,n,o)},sigma.canvas.edges.arrow=function(t,e,r,n,o){var a=o("funcEdgesArrow");a&&a(t,e,r,n,o)},e.exports=f},{"../../tracer_manager/util/index":68,"./tracer":48}],46:[function(t,e,r){"use strict";var n=t("./tracer"),o=t("./log"),a=t("./array1d"),i=t("./array2d"),s=t("./chart"),c=t("./coordinate_system"),u=t("./directed_graph"),l=t("./undirected_graph"),f=t("./weighted_directed_graph"),p=t("./weighted_undirected_graph");e.exports={Tracer:n,LogTracer:o,Array1DTracer:a,Array2DTracer:i,ChartTracer:s,CoordinateSystemTracer:c,DirectedGraphTracer:u,UndirectedGraphTracer:l,WeightedDirectedGraphTracer:f,WeightedUndirectedGraphTracer:p}},{"./array1d":41,"./array2d":42,"./chart":43,"./coordinate_system":44,"./directed_graph":45,"./log":47,"./tracer":48,"./undirected_graph":49,"./weighted_directed_graph":50,"./weighted_undirected_graph":51}],47:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function f(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:f(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./tracer"),u=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.isNew&&l(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"LogTracer"}}]),s(e,[{key:"_print",value:function(t){return this.manager.pushStep(this.capsule,{type:"print",msg:t}),this}},{key:"processStep",value:function(t,e){switch(t.type){case"print":this.print(t.msg)}}},{key:"refresh",value:function(){this.scrollToEnd(Math.min(50,this.interval))}},{key:"clear",value:function(){i(Object.getPrototypeOf(e.prototype),"clear",this).call(this),this.$wrapper.empty()}},{key:"print",value:function(t){this.$wrapper.append($("<span>").append(t+"<br/>"))}},{key:"scrollToEnd",value:function(t){this.$container.animate({scrollTop:this.$container[0].scrollHeight},t)}}]),e}(c),l=function(t){t.$wrapper=t.capsule.$wrapper=$('<div class="wrapper">'),t.$container.append(t.$wrapper)};e.exports=u},{"./tracer":48}],48:[function(t,e,r){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),i=t("../../app"),s=t("../../tracer_manager/util/index"),c=s.toJSON,u=s.fromJSON,l=function(){function t(e){o(this,t),this.module=this.constructor,this.manager=i.getTracerManager(),this.capsule=this.manager.allocate(this),$.extend(this,this.capsule),this.setName(e)}return a(t,null,[{key:"getClassName",value:function(){return"Tracer"}}]),a(t,[{key:"_setData",value:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return this.manager.pushStep(this.capsule,{type:"setData",args:c(e)}),this}},{key:"_clear",value:function(){return this.manager.pushStep(this.capsule,{type:"clear"}),this}},{key:"_wait",value:function(t){return this.manager.newStep(t),this}},{key:"processStep",value:function(t,e){var r=t.type,o=t.args;switch(r){case"setData":this.setData.apply(this,n(u(o)));break;case"clear":this.clear()}}},{key:"setName",value:function(t){var e=void 0;this.isNew?(e=$('<span class="name">'),this.$container.append(e)):e=this.$container.find("span.name"),e.text(t||this.defaultName)}},{key:"setData",value:function(){var t=c(arguments);return this.isNew||this.lastData!==t?(this.lastData=this.capsule.lastData=t,!1):!0}},{key:"resize",value:function(){}},{key:"refresh",value:function(){}},{key:"clear",value:function(){}},{key:"attach",value:function(t){switch(t.module){case LogTracer:this.logTracer=t;break;case ChartTracer:this.chartTracer=t}return this}},{key:"mousedown",value:function(t){}},{key:"mousemove",value:function(t){}},{key:"mouseup",value:function(t){}},{key:"mousewheel",value:function(t){}}]),t}();e.exports=l},{"../../app":3,"../../tracer_manager/util/index":68}],49:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function f(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:f(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./directed_graph"),u=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.isNew&&l(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"UndirectedGraphTracer"}}]),s(e,[{key:"setTreeData",value:function(t,r){return i(Object.getPrototypeOf(e.prototype),"setTreeData",this).call(this,t,r,!0)}},{key:"setData",value:function(t){return i(Object.getPrototypeOf(e.prototype),"setData",this).call(this,t,!0)}},{key:"e",value:function(t,e){if(t>e){var r=t;t=e,e=r}return"e"+t+"_"+e}},{key:"drawOnHover",value:function(t,e,r,n){var o=this;e.setLineDash([5,5]);var a=t.id.substring(1);this.graph.edges().forEach(function(i){var s=i.id.substring(1).split("_");if(s[0]==a){var c="#0ff",u=t,l=o.graph.nodes("n"+s[1]);o.drawEdge(i,u,l,c,e,r),n&&n(i,u,l,c,e,r)}else if(s[1]==a){var c="#0ff",u=o.graph.nodes("n"+s[0]),l=t;o.drawEdge(i,u,l,c,e,r),n&&n(i,u,l,c,e,r)}})}},{key:"drawEdge",value:function(t,e,r,n,o,a){var i=a("prefix")||"",s=t[i+"size"]||1;o.strokeStyle=n,o.lineWidth=s,o.beginPath(),o.moveTo(e[i+"x"],e[i+"y"]),o.lineTo(r[i+"x"],r[i+"y"]),o.stroke()}}]),e}(c),l=function(t){t.s.settings({defaultEdgeType:"def",funcEdgesDef:function(e,r,n,o,a){var i=t.getColor(e,r,n,a);t.drawEdge(e,r,n,i,o,a)}})};e.exports=u},{"./directed_graph":45}],50:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function h(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:h(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./directed_graph"),u=t("../../tracer_manager/util/index"),l=u.refineByType,f=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.isNew&&p(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"WeightedDirectedGraphTracer"}}]),s(e,[{key:"_weight",value:function(t,e){return this.manager.pushStep(this.capsule,{type:"weight",target:t,weight:e}),this}},{key:"_visit",value:function(t,e,r){return this.manager.pushStep(this.capsule,{type:"visit",target:t,source:e,weight:r}),this}},{key:"_leave",value:function(t,e,r){return this.manager.pushStep(this.capsule,{type:"leave",target:t,source:e,weight:r}),this}},{key:"processStep",value:function(t,r){switch(t.type){case"weight":var n=this.graph.nodes(this.n(t.target));void 0!==t.weight&&(n.weight=l(t.weight));break;case"visit":case"leave":var o="visit"==t.type,n=this.graph.nodes(this.n(t.target)),a=o?void 0===t.weight?this.color.selected:this.color.visited:this.color.left;if(n.color=a,void 0!==t.weight&&(n.weight=l(t.weight)),void 0!==t.source){var s=this.e(t.source,t.target),c=this.graph.edges(s);c.color=a,this.graph.dropEdge(s).addEdge(c)}if(this.logTracer){var u=t.source;void 0===u&&(u=""),this.logTracer.print(o?u+" -> "+t.target:u+" <- "+t.target)}break;default:i(Object.getPrototypeOf(e.prototype),"processStep",this).call(this,t,r)}}},{key:"clear",value:function(){i(Object.getPrototypeOf(e.prototype),"clear",this).call(this),this.clearWeights()}},{key:"clearWeights",value:function(){this.graph.nodes().forEach(function(t){t.weight=0})}},{key:"drawEdgeWeight",value:function(t,e,r,n,o,a){if(e!=r){var i=a("prefix")||"",s=t[i+"size"]||1;if(!(s<a("edgeLabelThreshold"))){if(0===a("edgeLabelSizePowRatio"))throw'"edgeLabelSizePowRatio" must not be 0.';var c,u=(e[i+"x"]+r[i+"x"])/2,l=(e[i+"y"]+r[i+"y"])/2,f=r[i+"x"]-e[i+"x"],p=r[i+"y"]-e[i+"y"],h=Math.atan2(p,f);c="fixed"===a("edgeLabelSize")?a("defaultEdgeLabelSize"):a("defaultEdgeLabelSize")*s*Math.pow(s,-1/a("edgeLabelSizePowRatio")),o.save(),t.active?(o.font=[a("activeFontStyle"),c+"px",a("activeFont")||a("font")].join(" "),o.fillStyle=n):(o.font=[a("fontStyle"),c+"px",a("font")].join(" "),o.fillStyle=n),o.textAlign="center",o.textBaseline="alphabetic",o.translate(u,l),o.rotate(h),o.fillText(t.weight,0,-s/2-3),o.restore()}}}},{key:"drawNodeWeight",value:function(t,e,r){var n,o=r("prefix")||"",a=t[o+"size"];a<r("labelThreshold")||(n="fixed"===r("labelSize")?r("defaultLabelSize"):r("labelSizeRatio")*a,e.font=(r("fontStyle")?r("fontStyle")+" ":"")+n+"px "+r("font"),e.fillStyle="node"===r("labelColor")?t.color||r("defaultNodeColor"):r("defaultLabelColor"),e.textAlign="left",e.fillText(t.weight,Math.round(t[o+"x"]+1.5*a),Math.round(t[o+"y"]+n/3)))}}]),e}(c),p=function(t){t.s.settings({edgeLabelSize:"proportional",defaultEdgeLabelSize:20,edgeLabelSizePowRatio:.8,funcLabelsDef:function(e,r,n){t.drawNodeWeight(e,r,n),t.drawLabel(e,r,n)},funcHoversDef:function(e,r,n){t.drawOnHover(e,r,n,t.drawEdgeWeight)},funcEdgesArrow:function(e,r,n,o,a){var i=t.getColor(e,r,n,a);t.drawArrow(e,r,n,i,o,a),t.drawEdgeWeight(e,r,n,i,o,a)}})};e.exports=f},{"../../tracer_manager/util/index":68,"./directed_graph":45}],51:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var i=function p(t,e,r){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,e);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:p(o,e,r)}if("value"in n)return n.value;var a=n.get;if(void 0!==a)return a.call(r)},s=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),c=t("./weighted_directed_graph"),u=t("./undirected_graph"),l=function(t){function e(t){n(this,e);var r=o(this,Object.getPrototypeOf(e).call(this,t));return r.e=u.prototype.e,r.drawOnHover=u.prototype.drawOnHover,r.drawEdge=u.prototype.drawEdge,r.isNew&&f(r),r}return a(e,t),s(e,null,[{key:"getClassName",value:function(){return"WeightedUndirectedGraphTracer"}}]),s(e,[{key:"setTreeData",value:function(t,r){return i(Object.getPrototypeOf(e.prototype),"setTreeData",this).call(this,t,r,!0)}},{key:"setData",value:function(t){return i(Object.getPrototypeOf(e.prototype),"setData",this).call(this,t,!0)}},{key:"drawEdgeWeight",value:function(t,e,r,n,o,a){var i=a("prefix")||"";if(e[i+"x"]>r[i+"x"]){var s=e;e=r,r=s}c.prototype.drawEdgeWeight.call(this,t,e,r,n,o,a)}}]),e}(c),f=function(t){t.s.settings({defaultEdgeType:"def",funcEdgesDef:function(e,r,n,o,a){var i=t.getColor(e,r,n,a);t.drawEdge(e,r,n,i,o,a),t.drawEdgeWeight(e,r,n,i,o,a)}})};e.exports=l},{"./undirected_graph":49,"./weighted_directed_graph":50}],52:[function(t,e,r){"use strict";var n=t("./request");e.exports=function(t){return n(t,{type:"GET"})}},{"./request":55}],53:[function(t,e,r){"use strict";var n=t("./request");e.exports=function(t){return n(t,{dataType:"json",type:"GET"})}},{"./request":55}],54:[function(t,e,r){"use strict";var n=t("./request");e.exports=function(t,e){return n(t,{dataType:"json",type:"POST",data:JSON.stringify(e)})}},{"./request":55}],55:[function(t,e,r){"use strict";var n=t("rsvp"),o=t("../../app"),a=$,i=a.ajax,s=a.extend,c={};e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return o.setIsLoading(!0),new n.Promise(function(r,n){var a={success:function(t){o.setIsLoading(!1),r(t)},error:function(t){o.setIsLoading(!1),n(t)}},u=s({},c,e,a,{url:t});i(u)})}},{"../../app":3,rsvp:73}],56:[function(t,e,r){"use strict";var n=function(){function t(t,e){var r=[],n=!0,o=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(n=(i=s.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(c){o=!0,a=c}finally{try{!n&&s["return"]&&s["return"]()}finally{if(o)throw a}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=t("../app"),a=t("../dom/toast"),i=function(){return o.getIsLoading()?(a.showErrorToast("Wait until it completes loading of previous file."),!0):!1},s=function(t){var e=window.location.href,r=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)"),o=r.exec(e);if(!o||3!==o.length)return null;var a=n(o,3),i=a[2];return i},c=function(t){if(!t)return null;for(var e=window.location.hash.substr(1),r=e?e.split("&"):[],n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===t)return o[1]}return null},u=function(t,e){if(t&&e){for(var r=window.location.hash.substr(1),n=r?r.split("&"):[],o=!1,a=0;a<n.length&&!o;a++){var i=n[a].split("=");i[0]===t&&(i[1]=e,n[a]=i.join("="),o=!0)}o||n.push([t,e].join("="));var s=n.join("&");window.location.hash="#"+s}},l=function(t){if(t){for(var e=window.location.hash.substr(1),r=e?e.split("&"):[],n=0;n<r.length;n++){var o=r[n].split("=");if(o[0]===t){r.splice(n,1);break}}var a=r.join("&");window.location.hash="#"+a}},f=function(t,e,r){var n=t?t+(e?"/"+e+(r?"/"+r:""):""):"";u("path",n)},p=function(){var t=c("path");if(t){var e=t.split("/"),r=n(e,3),o=r[0],a=r[1],i=r[2];return{category:o,algorithm:a,file:i}}return!1};e.exports={checkLoading:i,getParameterByName:s,getHashValue:c,setHashValue:u,removeHashValue:l,setPath:f,getPath:p}},{"../app":3,"../dom/toast":25}],57:[function(t,e,r){"use strict";var n=t("./load_algorithm"),o=t("./load_categories"),a=t("./load_file"),i=t("./load_scratch_paper"),s=t("./share_scratch_paper"),c=t("./load_wiki_list"),u=t("./load_wiki");e.exports={loadAlgorithm:n,loadCategories:o,loadFile:a,loadScratchPaper:i,shareScratchPaper:s,loadWikiList:c,loadWiki:u}},{"./load_algorithm":58,"./load_categories":59,"./load_file":60,"./load_scratch_paper":61,"./load_wiki":62,"./load_wiki_list":63,"./share_scratch_paper":64}],58:[function(t,e,r){"use strict";var n=t("./ajax/get_json"),o=t("../utils"),a=o.getAlgorithmDir;e.exports=function(t,e){var r=a(t,e);return n(r+"desc.json")}},{"../utils":71,"./ajax/get_json":53}],59:[function(t,e,r){"use strict";var n=t("./ajax/get_json");e.exports=function(){return n("./algorithm/category.json")}},{"./ajax/get_json":53}],60:[function(t,e,r){"use strict";var n=t("rsvp"),o=t("../app"),a=t("../utils"),i=a.getFileDir,s=a.isScratchPaper,c=t("./helpers"),u=c.checkLoading,l=c.setPath,f=t("./ajax/get"),p=function(t){return n.hash({data:f(t+"data.js"),code:f(t+"code.js")})},h=function(t){return o.getEditor().clearContent(),p(t).then(function(e){o.updateCachedFile(t,e),o.getEditor().setContent(e)})},d=function(t){return t&&void 0!==t.data&&void 0!==t.code};e.exports=function(t,e,r,a){return new n.Promise(function(n,c){if(u())c();else{s(t)?l(t,o.getLoadedScratch()):l(t,e,r),$("#explanation").html(a);var f=i(t,e,r);o.setLastFileUsed(f);var p=o.getCachedFile(f);d(p)?(o.getEditor().setContent(p),n()):h(f).then(n,c)}})}},{"../app":3,"../utils":71,"./ajax/get":52,"./helpers":56,rsvp:73}],61:[function(t,e,r){"use strict";var n=t("rsvp"),o=t("../app"),a=t("../utils"),i=a.getFileDir,s=t("./ajax/get_json"),c=t("./load_algorithm"),u=function(t,e){return t[e+".js"].content};e.exports=function(t){return new n.Promise(function(e,r){o.setLoadedScratch(t),s("https://api.github.com/gists/"+t).then(function(r){var n=r.files,a="scratch",s=t;c(a,s).then(function(t){var r=u(n,"data"),c=u(n,"code"),l=i(a,s,"scratch_paper");o.updateCachedFile(l,{data:r,code:c,"CREDIT.md":"Shared by an anonymous user from http://parkjs814.github.io/AlgorithmVisualizer"
  }),e({category:a,algorithm:s,data:t})})})})}},{"../app":3,"../utils":71,"./ajax/get_json":53,"./load_algorithm":58,rsvp:73}],62:[function(t,e,r){"use strict";var n=t("./ajax/get");e.exports=function(t){return n("./AlgorithmVisualizer.wiki/"+t+".md")}},{"./ajax/get":52}],63:[function(t,e,r){"use strict";var n=t("./ajax/get_json");e.exports=function(){return n("./wiki.json")}},{"./ajax/get_json":53}],64:[function(t,e,r){"use strict";var n=t("rsvp"),o=t("../app"),a=t("./ajax/post_json"),i=t("./helpers"),s=i.setPath;e.exports=function(){return new n.Promise(function(t,e){var r=o.getEditor(),n=r.dataEditor,i=r.codeEditor,c={description:"temp","public":!0,files:{"data.js":{content:n.getValue()},"code.js":{content:i.getValue()}}};a("https://api.github.com/gists",c).then(function(e){var r=e.id;o.setLoadedScratch(r),s("scratch",r);var n=location,a=n.href;$("#algorithm").html("Shared"),t(a)})})}},{"../app":3,"./ajax/post_json":54,"./helpers":56,rsvp:73}],65:[function(t,e,r){"use strict";var n=t("./manager"),o=t("../module/tracer/tracer");e.exports={init:function(){var t=new n;return o.prototype.manager=t,t}}},{"../module/tracer/tracer":48,"./manager":66}],66:[function(t,e,r){"use strict";var n=t("../app"),o=t("../dom/module_container"),a=t("../dom/top_menu"),i=$,s=i.each,c=i.extend,u=i.grep,l=1e6,f=function(){this.timer=null,this.pause=!1,this.capsules=[],this.interval=500};f.prototype={add:function(t){var e=o.create(),r={module:t.module,tracer:t,allocated:!0,defaultName:null,$container:e,isNew:!0};return this.capsules.push(r),r},allocate:function(t){var e=null,r=0;s(this.capsules,function(n,o){return o.module!==t.module||(r++,o.allocated)?void 0:(o.tracer=t,o.allocated=!0,o.isNew=!1,e=o,!1)}),null===e&&(r++,e=this.add(t));var n=t.module.getClassName();return e.defaultName=n+" "+r,e.order=this.order++,e},deallocateAll:function(){this.order=0,this.reset(),s(this.capsules,function(t,e){e.allocated=!1})},removeUnallocated:function(){var t=!1;this.capsules=u(this.capsules,function(e){var r=!e.allocated;return(e.isNew||r)&&(t=!0),r&&e.$container.remove(),!r}),t&&this.place()},place:function(){var t=this.capsules;s(t,function(e,r){var n=100,o=100/t.length,a=o*r.order;r.$container.css({top:a+"%",width:n+"%",height:o+"%"}),r.tracer.resize()})},resize:function(){this.command("resize")},isPause:function(){return this.pause},setInterval:function(t){a.setInterval(t)},reset:function(){this.traces=[],this.traceIndex=-1,this.stepCnt=0,this.timer&&clearTimeout(this.timer),this.command("clear")},pushStep:function(t,e){if(this.stepCnt++>l)throw"Tracer's stack overflow";var r=this.traces.length;0==r&&(r+=this.newStep());var n=this.traces[r-1];n.push(c(e,{capsule:t}))},newStep:function(){var t=arguments.length<=0||void 0===arguments[0]?-1:arguments[0],e=this.traces.length;return e>0&&~t&&this.traces[e-1].push(t),this.traces.push([])},pauseStep:function(){this.traceIndex<0||(this.pause=!0,this.timer&&clearTimeout(this.timer),a.activateBtnPause())},resumeStep:function(){this.pause=!1,this.step(this.traceIndex+1),a.deactivateBtnPause()},step:function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=this;if(!(isNaN(t)||t>=this.traces.length||0>t)){this.traceIndex=t;var o=this.traces[t];o.forEach(function(t){return"number"==typeof t?void n.getEditor().highlightLine(t):void t.capsule.tracer.processStep(t,e)}),e.virtual||this.command("refresh"),this.pause||(this.timer=setTimeout(function(){r.nextStep(e)||a.resetTopMenuButtons()},this.interval))}},prevStep:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.command("clear");var e=this.traceIndex-1;if(0>e)return this.traceIndex=-1,this.command("refresh"),!1;for(var r=0;e>r;r++)this.step(r,c(t,{virtual:!0}));return this.step(e),!0},nextStep:function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=this.traceIndex+1;return e>=this.traces.length?(this.traceIndex=this.traces.length-1,!1):(this.step(e,t),!0)},visualize:function(){this.traceIndex=-1,this.resumeStep()},command:function(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var n=e.shift();s(this.capsules,function(t,r){r.allocated&&r.tracer.module.prototype[n].apply(r.tracer,e)})},findOwner:function(t){var e=null;return s(this.capsules,function(r,n){return n.$container[0]===t?(e=n,!1):void 0}),e.tracer}},e.exports=f},{"../app":3,"../dom/module_container":9,"../dom/top_menu":26}],67:[function(t,e,r){"use strict";var n=JSON.parse,o=function(t){return n(t,function(t,e){return"Infinity"===e?1/0:e})};e.exports=o},{}],68:[function(t,e,r){"use strict";var n=t("./to_json"),o=t("./from_json"),a=t("./refine_by_type");e.exports={toJSON:n,fromJSON:o,refineByType:a}},{"./from_json":67,"./refine_by_type":69,"./to_json":70}],69:[function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=function(t){switch("undefined"==typeof t?"undefined":n(t)){case"number":return i(t);case"boolean":return s(t);default:return a(t)}},a=function(t){return""===t?" ":t},i=function(t){return t===1/0?"∞":t},s=function(t){return t?"T":"F"};e.exports=o},{}],70:[function(t,e,r){"use strict";var n=JSON.stringify,o=function(t){return n(t,function(t,e){return e===1/0?"Infinity":e})};e.exports=o},{}],71:[function(t,e,r){"use strict";var n=function(t,e){return"scratch"==t},o=function(t,e){return n(t)?"./algorithm/scratch_paper/":"./algorithm/"+t+"/"+e+"/"},a=function(t,e,r){return n(t)?"./algorithm/scratch_paper/":"./algorithm/"+t+"/"+e+"/"+r+"/"};e.exports={isScratchPaper:n,getAlgorithmDir:o,getFileDir:a}},{}],72:[function(t,e,r){function n(){l&&s&&(l=!1,s.length?u=s.concat(u):f=-1,u.length&&o())}function o(){if(!l){var t=setTimeout(n);l=!0;for(var e=u.length;e;){for(s=u,u=[];++f<e;)s&&s[f].run();f=-1,e=u.length}s=null,l=!1,clearTimeout(t)}}function a(t,e){this.fun=t,this.array=e}function i(){}var s,c=e.exports={},u=[],l=!1,f=-1;c.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new a(t,e)),1!==u.length||l||setTimeout(o,0)},a.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=i,c.addListener=i,c.once=i,c.off=i,c.removeListener=i,c.removeAllListeners=i,c.emit=i,c.binding=function(t){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(t){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],73:[function(t,e,r){(function(r,n){(function(){"use strict";function o(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function s(){}function c(t,e){for(var r=0,n=t.length;n>r;r++)if(t[r]===e)return r;return-1}function u(t){var e=t._promiseCallbacks;return e||(e=t._promiseCallbacks={}),e}function l(t,e){return"onerror"===t?void $t.on("error",e):2!==arguments.length?$t[t]:void($t[t]=e)}function f(){setTimeout(function(){for(var t,e=0;e<jt.length;e++){t=jt[e];var r=t.payload;r.guid=r.key+r.id,r.childGuid=r.key+r.childId,r.error&&(r.stack=r.error.stack),$t.trigger(t.name,t.payload)}jt.length=0},50)}function p(t,e,r){1===jt.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:r&&r._id,label:e._label,timeStamp:kt(),error:$t["instrument-with-stack"]?new Error(e._label):null}})&&f()}function h(t,e,r){var n=this,o=n._state;if(o===It&&!t||o===Rt&&!e)return $t.instrument&&Tt("chained",n,n),n;n._onError=null;var a=new n.constructor(O,r),i=n._result;if($t.instrument&&Tt("chained",n,a),o){var s=arguments[o-1];$t.async(function(){F(o,a,s,i)})}else L(n,a,t,e);return a}function d(t,e){var r=this;if(t&&"object"==typeof t&&t.constructor===r)return t;var n=new r(O,e);return E(n,t),n}function v(t,e,r){return t===It?{state:"fulfilled",value:r}:{state:"rejected",reason:r}}function g(t,e,r,n){this._instanceConstructor=t,this.promise=new t(O,n),this._abortOnReject=r,this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?A(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&A(this.promise,this._result))):D(this.promise,this._validationError())}function y(t,e){return new Pt(this,t,!0,e).promise}function m(t,e){function r(t){E(a,t)}function n(t){D(a,t)}var o=this,a=new o(O,e);if(!xt(t))return D(a,new TypeError("You must pass an array to race.")),a;for(var i=t.length,s=0;a._state===Ft&&i>s;s++)L(o.resolve(t[s]),void 0,r,n);return a}function w(t,e){var r=this,n=new r(O,e);return D(n,t),n}function b(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function _(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function x(t,e){this._id=zt++,this._label=e,this._state=void 0,this._result=void 0,this._subscribers=[],$t.instrument&&Tt("created",this),O!==t&&("function"!=typeof t&&b(),this instanceof x?I(this,t):_())}function k(){return new TypeError("A promises callback cannot return that same promise.")}function O(){}function S(t){try{return t.then}catch(e){return Wt.error=e,Wt}}function $(t,e,r,n){try{t.call(e,r,n)}catch(o){return o}}function j(t,e,r){$t.async(function(t){var n=!1,o=$(r,e,function(r){n||(n=!0,e!==r?E(t,r,void 0):A(t,r))},function(e){n||(n=!0,D(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&o&&(n=!0,D(t,o))},t)}function T(t,e){e._state===It?A(t,e._result):e._state===Rt?(e._onError=null,D(t,e._result)):L(e,void 0,function(r){e!==r?E(t,r,void 0):A(t,r)},function(e){D(t,e)})}function C(t,e,r){e.constructor===t.constructor&&r===Ct&&constructor.resolve===Et?T(t,e):r===Wt?D(t,Wt.error):void 0===r?A(t,e):a(r)?j(t,e,r):A(t,e)}function E(t,e){t===e?A(t,e):o(e)?C(t,e,S(e)):A(t,e)}function P(t){t._onError&&t._onError(t._result),M(t)}function A(t,e){t._state===Ft&&(t._result=e,t._state=It,0===t._subscribers.length?$t.instrument&&Tt("fulfilled",t):$t.async(M,t))}function D(t,e){t._state===Ft&&(t._state=Rt,t._result=e,$t.async(P,t))}function L(t,e,r,n){var o=t._subscribers,a=o.length;t._onError=null,o[a]=e,o[a+It]=r,o[a+Rt]=n,0===a&&t._state&&$t.async(M,t)}function M(t){var e=t._subscribers,r=t._state;if($t.instrument&&Tt(r===It?"fulfilled":"rejected",t),0!==e.length){for(var n,o,a=t._result,i=0;i<e.length;i+=3)n=e[i],o=e[i+r],n?F(r,n,o,a):o(a);t._subscribers.length=0}}function z(){this.error=null}function N(t,e){try{return t(e)}catch(r){return qt.error=r,qt}}function F(t,e,r,n){var o,i,s,c,u=a(r);if(u){if(o=N(r,n),o===qt?(c=!0,i=o.error,o=null):s=!0,e===o)return void D(e,k())}else o=n,s=!0;e._state!==Ft||(u&&s?E(e,o):c?D(e,i):t===It?A(e,o):t===Rt&&D(e,o))}function I(t,e){var r=!1;try{e(function(e){r||(r=!0,E(t,e))},function(e){r||(r=!0,D(t,e))})}catch(n){D(t,n)}}function R(t,e,r){this._superConstructor(t,e,!1,r)}function W(t,e){return new R(Nt,t,e).promise}function q(t,e){return Nt.all(t,e)}function U(t,e){te[Gt]=t,te[Gt+1]=e,Gt+=2,2===Gt&&Vt()}function V(){var t=r.nextTick,e=r.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(e)&&"0"===e[1]&&"10"===e[2]&&(t=setImmediate),function(){t(X)}}function H(){return function(){Ut(X)}}function B(){var t=0,e=new Kt(X),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function G(){var t=new MessageChannel;return t.port1.onmessage=X,function(){t.port2.postMessage(0)}}function Y(){return function(){setTimeout(X,1)}}function X(){for(var t=0;Gt>t;t+=2){var e=te[t],r=te[t+1];e(r),te[t]=void 0,te[t+1]=void 0}Gt=0}function J(){try{var e=t,r=e("vertx");return Ut=r.runOnLoop||r.runOnContext,H()}catch(n){return Y()}}function K(t){var e={};return e.promise=new Nt(function(t,r){e.resolve=t,e.reject=r},t),e}function Z(t,e,r){return Nt.all(t,r).then(function(t){if(!a(e))throw new TypeError("You must pass a function as filter's second argument.");for(var n=t.length,o=new Array(n),i=0;n>i;i++)o[i]=e(t[i]);return Nt.all(o,r).then(function(e){for(var r=new Array(n),o=0,a=0;n>a;a++)e[a]&&(r[o]=t[a],o++);return r.length=o,r})})}function Q(t,e,r){this._superConstructor(t,e,!0,r)}function tt(t,e,r){this._superConstructor(t,e,!1,r)}function et(t,e){return new tt(Nt,t,e).promise}function rt(t,e){return new ne(Nt,t,e).promise}function nt(t,e,r){return Nt.all(t,r).then(function(t){if(!a(e))throw new TypeError("You must pass a function as map's second argument.");for(var n=t.length,o=new Array(n),i=0;n>i;i++)o[i]=e(t[i]);return Nt.all(o,r)})}function ot(){this.value=void 0}function at(t){try{return t.then}catch(e){return ce.value=e,ce}}function it(t,e,r){try{t.apply(e,r)}catch(n){return ce.value=n,ce}}function st(t,e){for(var r,n,o={},a=t.length,i=new Array(a),s=0;a>s;s++)i[s]=t[s];for(n=0;n<e.length;n++)r=e[n],o[r]=i[n+1];return o}function ct(t){for(var e=t.length,r=new Array(e-1),n=1;e>n;n++)r[n-1]=t[n];return r}function ut(t,e){return{then:function(r,n){return t.call(e,r,n)}}}function lt(t,e){var r=function(){for(var r,n=this,o=arguments.length,a=new Array(o+1),i=!1,s=0;o>s;++s){if(r=arguments[s],!i){if(i=ht(r),i===ue){var c=new Nt(O);return D(c,ue.value),c}i&&i!==!0&&(r=ut(i,r))}a[s]=r}var u=new Nt(O);return a[o]=function(t,r){t?D(u,t):void 0===e?E(u,r):e===!0?E(u,ct(arguments)):xt(e)?E(u,st(arguments,e)):E(u,r)},i?pt(u,a,t,n):ft(u,a,t,n)};return r.__proto__=t,r}function ft(t,e,r,n){var o=it(r,n,e);return o===ce&&D(t,o.value),t}function pt(t,e,r,n){return Nt.all(e).then(function(e){var o=it(r,n,e);return o===ce&&D(t,o.value),t})}function ht(t){return t&&"object"==typeof t?t.constructor===Nt?!0:at(t):!1}function dt(t,e){return Nt.race(t,e)}function vt(t,e){return Nt.reject(t,e)}function gt(t,e){return Nt.resolve(t,e)}function yt(t){throw setTimeout(function(){throw t}),t}function mt(t,e){$t.async(t,e)}function wt(){$t.on.apply($t,arguments)}function bt(){$t.off.apply($t,arguments)}var _t;_t=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var xt=_t,kt=Date.now||function(){return(new Date).getTime()},Ot=Object.create||function(t){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof t)throw new TypeError("Argument must be an object");return s.prototype=t,new s},St={mixin:function(t){return t.on=this.on,t.off=this.off,t.trigger=this.trigger,t._promiseCallbacks=void 0,t},on:function(t,e){if("function"!=typeof e)throw new TypeError("Callback must be a function");var r,n=u(this);r=n[t],r||(r=n[t]=[]),-1===c(r,e)&&r.push(e)},off:function(t,e){var r,n,o=u(this);return e?(r=o[t],n=c(r,e),void(-1!==n&&r.splice(n,1))):void(o[t]=[])},trigger:function(t,e,r){var n,o,a=u(this);if(n=a[t])for(var i=0;i<n.length;i++)(o=n[i])(e,r)}},$t={instrument:!1};St.mixin($t);var jt=[],Tt=p,Ct=h,Et=d,Pt=g;g.prototype._validateInput=function(t){return xt(t)},g.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},g.prototype._init=function(){this._result=new Array(this.length)},g.prototype._enumerate=function(){for(var t=this.length,e=this.promise,r=this._input,n=0;e._state===Ft&&t>n;n++)this._eachEntry(r[n],n)},g.prototype._settleMaybeThenable=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===Et){var o=S(t);if(o===Ct&&t._state!==Ft)t._onError=null,this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=this._makeResult(It,e,t);else if(r===Nt){var a=new r(O);C(a,t,o),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){e(t)}),e)}else this._willSettleAt(n(t),e)},g.prototype._eachEntry=function(t,e){i(t)?this._settleMaybeThenable(t,e):(this._remaining--,this._result[e]=this._makeResult(It,e,t))},g.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===Ft&&(this._remaining--,this._abortOnReject&&t===Rt?D(n,r):this._result[e]=this._makeResult(t,e,r)),0===this._remaining&&A(n,this._result)},g.prototype._makeResult=function(t,e,r){return r},g.prototype._willSettleAt=function(t,e){var r=this;L(t,void 0,function(t){r._settledAt(It,e,t)},function(t){r._settledAt(Rt,e,t)})};var At=y,Dt=m,Lt=w,Mt="rsvp_"+kt()+"-",zt=0,Nt=x;x.cast=Et,x.all=At,x.race=Dt,x.resolve=Et,x.reject=Lt,x.prototype={constructor:x,_guidKey:Mt,_onError:function(t){var e=this;$t.after(function(){e._onError&&$t.trigger("error",t,e._label)})},then:Ct,"catch":function(t,e){return this.then(void 0,t,e)},"finally":function(t,e){var r=this,n=r.constructor;return r.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){return n.reject(e)})},e)}};var Ft=void 0,It=1,Rt=2,Wt=new z,qt=new z;R.prototype=Ot(Pt.prototype),R.prototype._superConstructor=Pt,R.prototype._makeResult=v,R.prototype._validationError=function(){return new Error("allSettled must be called with an array")};var Ut,Vt,Ht=W,Bt=q,Gt=0,Yt=({}.toString,U),Xt="undefined"!=typeof window?window:void 0,Jt=Xt||{},Kt=Jt.MutationObserver||Jt.WebKitMutationObserver,Zt="undefined"==typeof self&&"undefined"!=typeof r&&"[object process]"==={}.toString.call(r),Qt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3);Vt=Zt?V():Kt?B():Qt?G():void 0===Xt&&"function"==typeof t?J():Y();var ee=K,re=Z,ne=Q;Q.prototype=Ot(Pt.prototype),Q.prototype._superConstructor=Pt,Q.prototype._init=function(){this._result={}},Q.prototype._validateInput=function(t){return t&&"object"==typeof t},Q.prototype._validationError=function(){return new Error("Promise.hash must be called with an object")},Q.prototype._enumerate=function(){var t=this,e=t.promise,r=t._input,n=[];for(var o in r)e._state===Ft&&Object.prototype.hasOwnProperty.call(r,o)&&n.push({position:o,entry:r[o]});var a=n.length;t._remaining=a;for(var i,s=0;e._state===Ft&&a>s;s++)i=n[s],t._eachEntry(i.entry,i.position)},tt.prototype=Ot(ne.prototype),tt.prototype._superConstructor=Pt,tt.prototype._makeResult=v,tt.prototype._validationError=function(){return new Error("hashSettled must be called with an object")};var oe,ae=et,ie=rt,se=nt,ce=new ot,ue=new ot,le=lt;if("object"==typeof self)oe=self;else{if("object"!=typeof n)throw new Error("no global: `self` or `global` found");oe=n}var fe=oe,pe=dt,he=vt,de=gt,ve=yt;$t.async=Yt,$t.after=function(t){setTimeout(t,0)};if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var ge=window.__PROMISE_INSTRUMENTATION__;l("instrument",!0);for(var ye in ge)ge.hasOwnProperty(ye)&&wt(ye,ge[ye])}var me={race:pe,Promise:Nt,allSettled:Ht,hash:ie,hashSettled:ae,denodeify:le,on:wt,off:bt,map:se,filter:re,resolve:de,reject:he,all:Bt,rethrow:ve,defer:ee,EventTarget:St,configure:l,async:mt};"function"==typeof define&&define.amd?define(function(){return me}):"undefined"!=typeof e&&e.exports?e.exports=me:"undefined"!=typeof fe&&(fe.RSVP=me)}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:72}]},{},[30]);
  //# sourceMappingURL=algorithm_visualizer.min.js.map
  