Skip to content
Navigation Menu
{{ message }}
forked from algorithm-visualizer/algorithm-visualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalgorithm_visualizer.min.js
More file actions
3 lines (3 loc) · 62.1 KB
/
Copy pathalgorithm_visualizer.min.js
File metadata and controls
3 lines (3 loc) · 62.1 KB
1
2
3
!function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var c="function"==typeof require&&require;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[o]={exports:{}};e[o][0].call(l.exports,function(t){var r=e[o][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(t,e,r){"use strict";var n=$,i=n.extend,a={lastFileUsed:"",files:{}},o=function(t){if(!t)throw"Missing file name"};e.exports={getCachedFile:function(t){return o(t),a.files[t]},updateCachedFile:function(t,e){o(t),a.files[t]||(a.files[t]={}),i(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"),i=t("../tracer_manager"),a=t("../dom/setup"),o=t("../utils"),s=(o.getFileDir,t("./cache")),c=$,u=(c.each,{isLoading:null,editor:null,tracerManager:null,categories:null}),l=function(t){u.isLoading=!1,u.editor=new n(t),u.tracerManager=t,u.categories={}},h=function(){this.getIsLoading=function(){return u.isLoading},this.setIsLoading=function(t){u.isLoading=t,t?$("#loading-slider").removeClass("loaded"):$("#loading-slider").addClass("loaded")},this.getEditor=function(){return u.editor},this.getCategories=function(){return u.categories},this.getCategory=function(t){return u.categories[t]},this.setCategories=function(t){u.categories=t},this.updateCategory=function(t,e){$.extend(u.categories[t],e)},this.getTracerManager=function(){return u.tracerManager};var t=i.init();l(t),a.setup(t)};h.prototype=s,e.exports=h},{"../dom/setup":5,"../editor":24,"../tracer_manager":48,"../utils":54,"./cache":1}],3:[function(t,e,r){"use strict";e.exports={}},{}],4:[function(t,e,r){"use strict";var n=t("./show_algorithm"),i=t("./show_categories"),a=t("./show_description"),o=t("./show_files"),s=t("./show_first_algorithm");e.exports={showAlgorithm:n,showCategories:i,showDescription:a,showFiles:o,showFirstAlgorithm:s}},{"./show_algorithm":16,"./show_categories":17,"./show_description":18,"./show_files":19,"./show_first_algorithm":20}],5:[function(t,e,r){"use strict";var n=t("./setup_dividers"),i=t("./setup_document"),a=t("./setup_files_bar"),o=t("./setup_interval"),s=t("./setup_module_container"),c=t("./setup_powered_by"),u=t("./setup_scratch_paper"),l=t("./setup_side_menu"),h=t("./setup_top_menu"),p=t("./setup_window"),f=function(){$(".btn input").click(function(t){t.stopPropagation()}),n(),i(),a(),o(),s(),c(),u(),l(),h(),p()};e.exports={setup:f}},{"./setup_dividers":6,"./setup_document":7,"./setup_files_bar":8,"./setup_interval":9,"./setup_module_container":10,"./setup_powered_by":11,"./setup_scratch_paper":12,"./setup_side_menu":13,"./setup_top_menu":14,"./setup_window":15}],6:[function(t,e,r){"use strict";var n=function(){function t(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(c){i=!0,a=c}finally{try{!n&&s["return"]&&s["return"]()}finally{if(i)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")}}(),i=t("../../app"),a=function(t){var e=n(t,3),r=e[0],a=e[1],o=e[2],s=a.parent(),c=5,u=$('<div class="divider">'),l=!1;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=o.position().left+r-e,c=n/s.width()*100;c=Math.min(90,Math.max(10,c)),a.css("right",100-c+"%"),o.css("left",c+"%"),e=r,i.getTracerManager().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=o.position().top+r-e,c=n/s.height()*100;c=Math.min(90,Math.max(10,c)),a.css("bottom",100-c+"%"),o.css("top",c+"%"),e=r,i.getTracerManager().resize()}}),$(document).mouseup(function(t){l=!1})}(),o.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}],7:[function(t,e,r){"use strict";var n=t("../../app");e.exports=function(){$(document).on("click","a",function(t){t.preventDefault(),window.open($(void 0).attr("href"),"_blank")||alert("Please allow popups for this site")}),$(document).mouseup(function(t){n.getTracerManager().command("mouseup",t)})}},{"../../app":3}],8:[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,i=n+$(this).outerWidth();return 0>n?(t.scrollLeft(r+i-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,i=n+$(this).outerWidth();return i>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"),i=t.children("button:last-child"),a=r.position().left,o=i.position().left+i.outerWidth();if(n(0,a)&&n(e,o)){var s=t.scrollLeft();return void t.scrollLeft(s+e-o)}var c=n(0,a),u=n(o,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)})}},{}],9:[function(t,e,r){"use strict";var n=function(){function t(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(c){i=!0,a=c}finally{try{!n&&s["return"]&&s["return"]()}finally{if(i)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")}}(),i=t("../../app"),a=t("../toast"),o=Number.parseFloat,s=.1,c=10,u=.5,l=.1,h=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=i.getTracerManager(),e=h(o($(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":21}],10:[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}],11:[function(t,e,r){"use strict";e.exports=function(){$("#powered-by").click(function(){$("#powered-by-list button").toggleClass("collapse")})}},{}],12:[function(t,e,r){"use strict";var n=t("../../server"),i=t("../show_algorithm");e.exports=function(){$("#scratch-paper").click(function(){var t=null,e="scratch_paper";n.loadAlgorithm(t,e).then(function(r){i(t,e,r)})})}},{"../../server":42,"../show_algorithm":16}],13:[function(t,e,r){"use strict";var n=t("../../app"),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()})}},{"../../app":3}],14:[function(t,e,r){"use strict";var n=t("../../app"),i=t("../../server"),a=t("../toast");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"),i.shareScratchPaper().then(function(e){t.removeClass("fa-spin fa-spin-faster"),$("#shared").removeClass("collapse"),$("#shared").val(e),a.showInfoToast("Shareable link is created.")})}),$("#btn_run").click(function(){$("#btn_trace").click();var t=n.getEditor().execute();t&&(console.error(t),a.showErrorToast(t))}),$("#btn_pause").click(function(){n.getTracerManager().isPause()?n.getTracerManager().resumeStep():n.getTracerManager().pauseStep()}),$("#btn_prev").click(function(){n.getTracerManager().pauseStep(),n.getTracerManager().prevStep()}),$("#btn_next").click(function(){n.getTracerManager().pauseStep(),n.getTracerManager().nextStep()}),$("#btn_desc").click(function(){$(".tab_container > .tab").removeClass("active"),$("#tab_desc").addClass("active"),$(".tab_bar > button").removeClass("active"),$(this).addClass("active")}),$("#btn_trace").click(function(){$(".tab_container > .tab").removeClass("active"),$("#tab_module").addClass("active"),$(".tab_bar > button").removeClass("active"),$(this).addClass("active")})}},{"../../app":3,"../../server":42,"../toast":21}],15:[function(t,e,r){"use strict";var n=t("../../app");e.exports=function(){$(window).resize(function(){n.getTracerManager().resize()})}},{"../../app":3}],16:[function(t,e,r){"use strict";var n=t("../app"),i=t("../utils"),a=i.isScratchPaper,o=t("./show_description"),s=t("./show_files");e.exports=function(t,e,r){var i=void 0,c=void 0,u=void 0;if(a(t,e))i=$("#scratch-paper"),c="",u="Scratch Paper";else{i=$('[data-category="'+t+'"][data-algorithm="'+e+'"]');var l=n.getCategory(t);c=l.name,u=l.list[e]}$(".sidemenu button").removeClass("active"),i.addClass("active"),$("#btn_desc").click(),$("#category").html(c),$("#algorithm").html(u),$("#tab_desc > .wrapper").empty(),$(".files_bar > .wrapper").empty(),$("#explanation").html(""),n.setLastFileUsed(null),n.getEditor().clearContent();var h=r.files;delete r.files,o(r),s(t,e,h)}},{"../app":3,"../utils":54,"./show_description":18,"./show_files":19}],17:[function(t,e,r){"use strict";var n=t("../app"),i=t("../server"),a=t("./show_algorithm"),o=$,s=o.each,c=function(t,e,r){var n=$('<button class="indent collapse">').append(e[r]).attr("data-algorithm",r).attr("data-category",t).click(function(){i.loadAlgorithm(t,r).then(function(e){a(t,r,e)})});$("#list").append(n)},u=function(t){var e=n.getCategory(t),r=e.name,i=e.list,a=$('<button class="category">').append('<i class="fa fa-fw fa-caret-right">').append(r);a.click(function(){$('[data-category="'+t+'"]').toggleClass("collapse"),$(this).find("i.fa").toggleClass("fa-caret-right fa-caret-down")}),$("#list").append(a),s(i,function(e){c(t,i,e)})};e.exports=function(){s(n.getCategories(),u)}},{"../app":3,"../server":42,"./show_algorithm":16}],18:[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},i=Array.isArray,a=$,o=a.each;e.exports=function(t){var e=$("#tab_desc > .wrapper");e.empty(),o(t,function(t,r){t&&e.append($("<h3>").html(t)),"string"==typeof r?e.append($("<p>").html(r)):i(r)?!function(){var t=$("<ul>");e.append(t),r.forEach(function(e){t.append($("<li>").html(e))})}():"object"===("undefined"==typeof r?"undefined":n(r))&&!function(){var t=$("<ul>");e.append(t),o(r,function(e){t.append($("<li>").append($("<strong>").html(e)).append(" "+r[e]))})}()})}},{}],19:[function(t,e,r){"use strict";var n=t("../server"),i=$,a=i.each,o=function(t,e,r,i){var a=$("<button>").append(r).click(function(){n.loadFile(t,e,r,i),$(".files_bar > .wrapper > button").removeClass("active"),$(this).addClass("active")});$(".files_bar > .wrapper").append(a)};e.exports=function(t,e,r){$(".files_bar > .wrapper").empty(),a(r,function(r,n){o(t,e,r,n)}),$(".files_bar > .wrapper > button").first().click(),$(".files_bar > .wrapper").scroll()}},{"../server":42}],20:[function(t,e,r){"use strict";e.exports=function(){$("#list button.category").first().click(),$("#list button.category + .indent").first().click()}},{}],21:[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)},i=function(t){n(t,"error")},a=function(t){n(t,"info")};e.exports={showErrorToast:i,showInfoToast:a}},{}],22:[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}},{}],23:[function(require,module,exports){"use strict";var execute=function execute(tracerManager,code){try{tracerManager.deallocateAll(),eval(code),tracerManager.visualize()}catch(err){return err}finally{tracerManager.removeUnallocated()}},executeData=function(t,e){return execute(t,e)},executeDataAndCode=function(t,e,r){return execute(t,e+";"+r)};module.exports={executeData:executeData,executeDataAndCode:executeDataAndCode}},{}],24:[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"),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 o.executeDataAndCode(t,r,n)},this.dataEditor.on("change",function(){var r=e.dataEditor.getValue(),n=i.getLastFileUsed();n&&i.updateCachedFile(n,{data:r}),o.executeData(t,r)}),this.codeEditor.on("change",function(){var t=e.codeEditor.getValue(),r=i.getLastFileUsed();r&&i.updateCachedFile(r,{code:t})})}var i=t("../app"),a=t("./create"),o=t("./executor");e.exports=n},{"../app":3,"./create":22,"./executor":23}],25:[function(t,e,r){"use strict";var n=t("rsvp"),i=t("./app"),a=t("./app/constructor"),o=t("./dom"),s=t("./server"),c=t("./server/helpers"),u=t("./module"),l=$,h=l.extend;$.ajaxSetup({cache:!1,dataType:"text"}),n.on("error",function(t){console.assert(!1,t)}),$(function(){var t=new a;h(!0,i,t),h(!0,window,u),s.loadCategories().then(function(t){i.setCategories(t),o.showCategories();var e=c.getParameterByName("scratch-paper");e?s.loadScratchPaper(e).then(function(t){var e=t.category,r=t.algorithm,n=t.data;o.showAlgorithm(e,r,n)}):o.showFirstAlgorithm()})})},{"./app":3,"./app/constructor":2,"./dom":4,"./module":31,"./server":42,"./server/helpers":41,rsvp:56}],26:[function(t,e,r){"use strict";function n(){return o.apply(this,arguments)}var i=t("./array2d"),a=i.Array2D,o=i.Array2DTracer;n.prototype=$.extend(!0,Object.create(o.prototype),{constructor:n,_notify:function(t,e){return o.prototype._notify.call(this,0,t,e),this},_denotify:function(t){return o.prototype._denotify.call(this,0,t),this},_select:function(t,e){return void 0===e?o.prototype._select.call(this,0,t):o.prototype._selectRow.call(this,0,t,e),this},_deselect:function(t,e){return void 0===e?o.prototype._deselect.call(this,0,t):o.prototype._deselectRow.call(this,0,t,e),this},setData:function(t){return o.prototype.setData.call(this,[t])}});var s={random:function(t,e,r){return a.random(1,t,e,r)[0]},randomSorted:function(t,e,r){return a.randomSorted(1,t,e,r)[0]}};e.exports={Array1D:s,Array1DTracer:n}},{"./array2d":27}],27:[function(t,e,r){"use strict";function n(){return i.apply(this,arguments)?(n.prototype.init.call(this),!0):!1}var i=t("./tracer"),a=t("../tracer_manager/util"),o=a.refineByType;n.prototype=$.extend(!0,Object.create(i.prototype),{constructor:n,init:function(){this.$table=this.capsule.$table=$('<div class="mtbl-table">'),this.$container.append(this.$table)},_notify:function(t,e,r){return this.manager.pushStep(this.capsule,{type:"notify",x:t,y:e,v:r}),this},_denotify:function(t,e){return this.manager.pushStep(this.capsule,{type:"denotify",x:t,y:e}),this},_select:function(t,e,r,n){return this.pushSelectingStep("select",null,arguments),this},_selectRow:function(t,e,r){return this.pushSelectingStep("select","row",arguments),this},_selectCol:function(t,e,r){return this.pushSelectingStep("select","col",arguments),this},_deselect:function(t,e,r,n){return this.pushSelectingStep("deselect",null,arguments),this},_deselectRow:function(t,e,r){return this.pushSelectingStep("deselect","row",arguments),this},_deselectCol:function(t,e,r){return this.pushSelectingStep("deselect","col",arguments),this},_separate:function(t,e){return this.manager.pushStep(this.capsule,{type:"separate",x:t,y:e}),this},_separateRow:function(t){return this._separate(t,-1),this},_separateCol:function(t){return this._separate(-1,t),this},_deseparate:function(t,e){return this.manager.pushStep(this.capsule,{type:"deseparate",x:t,y:e}),this},_deseparateRow:function(t){return this._deseparate(t,-1),this},_deseparateCol:function(t){return this._deseparate(-1,t),this},pushSelectingStep: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 i={type:e};$.extend(i,n),this.manager.pushStep(this.capsule,i)},processStep:function(t,e){switch(t.type){case"notify":if(0===t.v||t.v){var r=this.$table.find(".mtbl-row").eq(t.x),n=r.find(".mtbl-col").eq(t.y);n.text(o(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,l=t.ex,h=t.ey;void 0===c&&(c=t.x),void 0===u&&(u=t.y),void 0===l&&(l=t.x),void 0===h&&(h=t.y),this.paintColor(c,u,l,h,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.prototype.processStep.call(this,t,e)}},setData:function(t){if(this.viewX=this.viewY=0,this.paddingH=6,this.paddingV=3,this.fontSize=16,i.prototype.setData.apply(this,arguments))return this.$table.find(".mtbl-row").each(function(e){$(this).find(".mtbl-col").each(function(r){$(this).text(o(t[e][r]))})}),!0;this.$table.empty();for(var e=0;e<t.length;e++){var r=$('<div class="mtbl-row">');this.$table.append(r);for(var n=0;n<t[e].length;n++){var a=$('<div class="mtbl-col">').css(this.getCellCss()).text(o(t[e][n]));r.append(a)}}return this.resize(),!1},resize:function(){i.prototype.resize.call(this),this.refresh()},clear:function(){i.prototype.clear.call(this),this.clearColor(),this.deseparateAll()},getCellCss:function(){return{padding:this.paddingV.toFixed(1)+"px "+this.paddingH.toFixed(1)+"px","font-size":this.fontSize.toFixed(1)+"px"}},refresh:function(){i.prototype.refresh.call(this);var t=this.$table.parent(),e=t.height()/2-this.$table.height()/2+this.viewY,r=t.width()/2-this.$table.width()/2+this.viewX;this.$table.css("margin-top",e),this.$table.css("margin-left",r)},mousedown:function(t){i.prototype.mousedown.call(this,t),this.dragX=t.pageX,this.dragY=t.pageY,this.dragging=!0},mousemove:function(t){i.prototype.mousemove.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())},mouseup:function(t){i.prototype.mouseup.call(this,t),this.dragging=!1},mousewheel:function(t){i.prototype.mousewheel.call(this,t),t.preventDefault(),t=t.originalEvent;var e=void 0!==t.wheelDelta&&t.wheelDelta||void 0!==t.detail&&-t.detail,r=1.01,n=e>0?1/r:r;this.fontSize<4&&1>n||this.fontSize>40&&n>1||(this.paddingV*=n,this.paddingH*=n,this.fontSize*=n,this.$table.find(".mtbl-col").css(this.getCellCss()),this.refresh())},paintColor:function(t,e,r,n,i,a){for(var o=t;r>=o;o++)for(var s=this.$table.find(".mtbl-row").eq(o),c=e;n>=c;c++){var u=s.find(".mtbl-col").eq(c);a?u.addClass(i):u.removeClass(i)}},clearColor:function(){this.$table.find(".mtbl-col").removeClass(Object.keys(this.colorClass).join(" "))},colorClass:{selected:"selected",notified:"notified"},separate: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))})})},deseparate:function(t,e){this.$table.find("[data-row="+t+"]").remove(),this.$table.find("[data-col="+e+"]").remove()},deseparateAll:function(){this.$table.find(".mtbl-empty-row, .mtbl-empty-col").remove()}});var s={random:function(t,e,r,n){t||(t=10),e||(e=10),void 0===r&&(r=1),void 0===n&&(n=9);for(var i=[],a=0;t>a;a++){i.push([]);for(var o=0;e>o;o++)i[a].push((Math.random()*(n-r+1)|0)+r)}return i},randomSorted:function(t,e,r,n){return this.random(t,e,r,n).map(function(t){return t.sort(function(t,e){return t-e})})}};e.exports={Array2D:s,Array2DTracer:n}},{"../tracer_manager/util":51,"./tracer":33}],28:[function(t,e,r){"use strict";function n(){return i.apply(this,arguments)?(n.prototype.init.call(this,arguments),!0):!1}var i=t("./tracer");n.prototype=$.extend(!0,Object.create(i.prototype),{constructor:n,init:function(){this.$wrapper=this.capsule.$wrapper=$('<canvas id="chart">'),this.$container.append(this.$wrapper)},setData:function(t){if(i.prototype.setData.apply(this,arguments))return!0;for(var e=[],r=0;r<t.length;r++)e.push("rgba(136, 136, 136, 1)");var n={type:"bar",data:{labels:t.map(String),datasets:[{backgroundColor:e,data:t}]},options:{scales:{yAxes:[{ticks:{beginAtZero:!0}}]}}};this.chart=this.capsule.chart=new Chart(this.$wrapper,n)},_notify:function(t,e){return this.manager.pushStep(this.capsule,{type:"notify",s:t,v:e}),this},_denotify:function(t){return this.manager.pushStep(this.capsule,{type:"denotify",s:t}),this},_select:function(t,e){return this.manager.pushStep(this.capsule,{type:"select",s:t,e:e}),this},_deselect:function(t,e){return this.manager.pushStep(this.capsule,{type:"deselect",s:t,e:e}),this},processStep:function(t,e){switch(t.type){case"notify":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"deselect":var r="denotify"==t.type||"deselect"==t.type?"rgba(136, 136, 136, 1)":"rgba(255, 0, 0, 1)";case"select":if(void 0===r)var r="rgba(0, 0, 255, 1)";if(void 0!==t.e)for(var n=t.s;n<=t.e;n++)this.chart.config.data.datasets[0].backgroundColor[n]=r;else this.chart.config.data.datasets[0].backgroundColor[t.s]=r;this.chart.update();break;default:i.prototype.processStep.call(this,t,e)}}}),e.exports=n},{"./tracer":33}],29:[function(t,e,r){"use strict";function n(){return a.apply(this,arguments)?(n.prototype.init.call(this),!0):!1}var i=t("./directed_graph"),a=(i.DirectedGraph,i.DirectedGraphTracer);n.prototype=$.extend(!0,Object.create(a.prototype),{constructor:n,init:function(){var t=this;this.s.settings({defaultEdgeType:"def",funcEdgesDef:function(e,r,n,i,a){var o=t.getColor(e,r,n,a);t.drawEdge(e,r,n,o,i,a)}})},setData: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},processStep:function(t,e){switch(t.type){case"visit":case"leave":var r="visit"==t.type,n=this.graph.nodes(this.n(t.target)),i=r?this.color.visited:this.color.left;if(n.color=i,void 0!==t.source){var a=this.e(t.source,t.target);if(this.graph.edges(a)){var o=this.graph.edges(a);o.color=i,this.graph.dropEdge(a).addEdge(o)}else this.graph.addEdge({id:this.e(t.target,t.source),source:this.n(t.source),target:this.n(t.target),color:i,size:1})}if(this.logTracer){var s=t.source;void 0===s&&(s=""),this.logTracer.print(r?s+" -> "+t.target:s+" <- "+t.target)}break;default:Tracer.prototype.processStep.call(this,t,e)}},e:function(t,e){if(t>e){var r=t;t=e,e=r}return"e"+t+"_"+e},drawOnHover:function(t,e,r,n){var i=this;e.setLineDash([5,5]);var a=t.id.substring(1);this.graph.edges().forEach(function(o){var s=o.id.substring(1).split("_");if(s[0]==a){var c="#0ff",u=t,l=i.graph.nodes("n"+s[1]);i.drawEdge(o,u,l,c,e,r),n&&n(o,u,l,c,e,r)}else if(s[1]==a){var c="#0ff",u=i.graph.nodes("n"+s[0]),l=t;i.drawEdge(o,u,l,c,e,r),n&&n(o,u,l,c,e,r)}})},drawEdge:function(t,e,r,n,i,a){var o=a("prefix")||"",s=t[o+"size"]||1;i.strokeStyle=n,i.lineWidth=s,i.beginPath(),i.moveTo(e[o+"x"],e[o+"y"]),i.lineTo(r[o+"x"],r[o+"y"]),i.stroke()}});var o={random:function(t,e,r){t||(t=7),e||(e=1),r||(r=10);for(var n=new Array(t),i=0;t>i;i++)n[i]=new Array(2);for(var i=0;t>i;i++)for(var a=0;a<n[i].length;a++)n[i][a]=(Math.random()*(r-e+1)|0)+e;return n}};e.exports={CoordinateSystem:o,CoordinateSystemTracer:n}},{"./directed_graph":30}],30:[function(t,e,r){"use strict";function n(){return i.apply(this,arguments)?(n.prototype.init.call(this),!0):!1}var i=t("./tracer");n.prototype=$.extend(!0,Object.create(i.prototype),{constructor:n,init:function(){var t=this;this.s=this.capsule.s=new sigma({renderer:{container:this.$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,i){t.drawOnHover(e,r,n,i)},funcEdgesArrow:function(e,r,n,i,a){var o=t.getColor(e,r,n,a);t.drawArrow(e,r,n,o,i,a)}}}),sigma.plugins.dragNodes(this.s,this.s.renderers[0]),this.graph=this.capsule.graph=this.s.graph},_setTreeData:function(t,e){return this.manager.pushStep(this.capsule,{type:"setTreeData",arguments:arguments}),this},_visit:function(t,e){return this.manager.pushStep(this.capsule,{type:"visit",target:t,source:e}),this},_leave:function(t,e){return this.manager.pushStep(this.capsule,{type:"leave",target:t,source:e}),this},processStep:function(t,e){switch(t.type){case"setTreeData":this.setTreeData.apply(this,t.arguments);break;case"visit":case"leave":var r="visit"==t.type,n=this.graph.nodes(this.n(t.target)),a=r?this.color.visited:this.color.left;if(n.color=a,void 0!==t.source){var o=this.e(t.source,t.target),s=this.graph.edges(o);s.color=a,this.graph.dropEdge(o).addEdge(s)}if(this.logTracer){var c=t.source;void 0===c&&(c=""),this.logTracer.print(r?c+" -> "+t.target:c+" <- "+t.target)}break;default:i.prototype.processStep.call(this,t,e)}},setTreeData:function(t,e){var r=this;e=e||0;var n=-1,i=new Array(t.length),a=function u(e,r){if(i[e])throw"the given graph is not a tree because it forms a circuit";i[e]=!0,r>n&&(n=r);for(var a=0;a<t[e].length;a++)t[e][a]&&u(a,r+1)};if(a(e,1),this.setData.apply(this,arguments))return!0;var o=function(t,e,n){var i=r.graph.nodes(r.n(t));i.x=e,i.y=n},s=1/(n-1),c=function l(e,r,n,i){o(e,n+i,r*s);for(var a=0,c=0;c<t[e].length;c++)t[e][c]&&a++;for(var u=(i-n)/a,h=0,c=0;c<t[e].length;c++)t[e][c]&&l(c,r+1,n+u*h,n+u*++h)};c(e,0,0,1),this.refresh()},setData:function(t){if(i.prototype.setData.apply(this,arguments))return!0;this.graph.clear();for(var e=[],r=[],n=2*Math.PI/t.length,a=0,o=0;o<t.length;o++){a+=n,e.push({id:this.n(o),label:""+o,x:.5+Math.sin(a)/2,y:.5+Math.cos(a)/2,size:1,color:this.color["default"]});for(var s=0;s<t[o].length;s++)t[o][s]&&r.push({id:this.e(o,s),source:this.n(o),target:this.n(s),color:this.color["default"],size:1})}return this.graph.read({nodes:e,edges:r}),this.s.camera.goTo({x:0,y:0,angle:0,ratio:1}),this.refresh(),!1},resize:function(){i.prototype.resize.call(this),this.s.renderers[0].resize(),this.refresh()},refresh:function(){i.prototype.refresh.call(this),this.s.refresh()},clear:function(){i.prototype.clear.call(this),this.clearGraphColor()},color:{visited:"#f00",left:"#000","default":"#888"},clearGraphColor: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"]})},n:function(t){return"n"+t},e:function(t,e){return"e"+t+"_"+e},getColor:function(t,e,r,n){var i=t.color,a=n("edgeColor"),o=n("defaultNodeColor"),s=n("defaultEdgeColor");if(!i)switch(a){case"source":i=e.color||o;break;case"target":i=r.color||o;break;default:i=s}return i},drawLabel:function(t,e,r){var n,i=r("prefix")||"",a=t[i+"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[i+"x"]),Math.round(t[i+"y"]+n/3)))},drawArrow:function(t,e,r,n,i,a){var o=a("prefix")||"",s=t[o+"size"]||1,c=r[o+"size"],u=e[o+"x"],l=e[o+"y"],h=r[o+"x"],p=r[o+"y"],f=Math.atan2(p-l,h-u),d=3;u+=Math.sin(f)*d,h+=Math.sin(f)*d,l+=-Math.cos(f)*d,p+=-Math.cos(f)*d;var g=Math.max(2.5*s,a("minArrowSize")),v=Math.sqrt(Math.pow(h-u,2)+Math.pow(p-l,2)),y=u+(h-u)*(v-g-c)/v,m=l+(p-l)*(v-g-c)/v,w=(h-u)*g/v,_=(p-l)*g/v;i.strokeStyle=n,i.lineWidth=s,i.beginPath(),i.moveTo(u,l),i.lineTo(y,m),i.stroke(),i.fillStyle=n,i.beginPath(),i.moveTo(y+w,m+_),i.lineTo(y+.6*_,m-.6*w),i.lineTo(y-.6*_,m+.6*w),i.lineTo(y+w,m+_),i.closePath(),i.fill()},drawOnHover:function(t,e,r,n){var i=this;e.setLineDash([5,5]);var a=t.id.substring(1);this.graph.edges().forEach(function(o){var s=o.id.substring(1).split("_");if(s[0]==a){var c="#0ff",u=t,l=i.graph.nodes("n"+s[1]);i.drawArrow(o,u,l,c,e,r),n&&n(o,u,l,c,e,r)}else if(s[1]==a){var c="#ff0",u=i.graph.nodes("n"+s[0]),l=t;i.drawArrow(o,u,l,c,e,r),n&&n(o,u,l,c,e,r)}})}});var a={random: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 i=0;t>i;i++)n!=i&&(r[n][i]=0==(Math.random()*(1/e)|0)?1:0)}return r}};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,i){var a=i("funcEdgesDef");a&&a(t,e,r,n,i)},sigma.canvas.edges.arrow=function(t,e,r,n,i){var a=i("funcEdgesArrow");a&&a(t,e,r,n,i)},e.exports={DirectedGraph:a,DirectedGraphTracer:n}},{"./tracer":33}],31:[function(t,e,r){"use strict";var n=t("./tracer"),i=t("./log_tracer"),a=t("./array1d"),o=a.Array1D,s=a.Array1DTracer,c=t("./array2d"),u=c.Array2D,l=c.Array2DTracer,h=t("./chart"),p=t("./coordinate_system"),f=p.CoordinateSystem,d=p.CoordinateSystemTracer,g=t("./directed_graph"),v=g.DirectedGraph,y=g.DirectedGraphTracer,m=t("./undirected_graph"),w=m.UndirectedGraph,_=m.UndirectedGraphTracer,b=t("./weighted_directed_graph"),x=b.WeightedDirectedGraph,$=b.WeightedDirectedGraphTracer,S=t("./weighted_undirected_graph"),T=S.WeightedUndirectedGraph,C=S.WeightedUndirectedGraphTracer;e.exports={Tracer:n,LogTracer:i,Array1D:o,Array1DTracer:s,Array2D:u,Array2DTracer:l,ChartTracer:h,CoordinateSystem:f,CoordinateSystemTracer:d,DirectedGraph:v,DirectedGraphTracer:y,UndirectedGraph:w,UndirectedGraphTracer:_,WeightedDirectedGraph:x,WeightedDirectedGraphTracer:$,WeightedUndirectedGraph:T,WeightedUndirectedGraphTracer:C
}},{"./array1d":26,"./array2d":27,"./chart":28,"./coordinate_system":29,"./directed_graph":30,"./log_tracer":32,"./tracer":33,"./undirected_graph":34,"./weighted_directed_graph":35,"./weighted_undirected_graph":36}],32:[function(t,e,r){"use strict";function n(){return i.apply(this,arguments)?(n.prototype.init.call(this),!0):!1}var i=t("./tracer");n.prototype=$.extend(!0,Object.create(i.prototype),{constructor:n,init:function(){this.$wrapper=this.capsule.$wrapper=$('<div class="wrapper">'),this.$container.append(this.$wrapper)},_print:function(t){return this.manager.pushStep(this.capsule,{type:"print",msg:t}),this},processStep:function(t,e){switch(t.type){case"print":this.print(t.msg)}},refresh:function(){this.scrollToEnd(Math.min(50,this.interval))},clear:function(){i.prototype.clear.call(this),this.$wrapper.empty()},print:function(t){this.$wrapper.append($("<span>").append(t+"<br/>"))},scrollToEnd:function(t){this.$container.animate({scrollTop:this.$container[0].scrollHeight},t)}}),e.exports=n},{"./tracer":33}],33:[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 i(t){return this.module=this.constructor,this.capsule=this.manager.allocate(this),$.extend(this,this.capsule),this.setName(t),this.isNew}var a=t("../tracer_manager/util"),o=a.toJSON,s=a.fromJSON;i.prototype={constructor:i,manager:null,_setData: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:o(e)}),this},_clear:function(){return this.manager.pushStep(this.capsule,{type:"clear"}),this},_wait:function(){return this.manager.newStep(),this},processStep:function(t,e){var r=t.type,i=t.args;switch(r){case"setData":this.setData.apply(this,n(s(i)));break;case"clear":this.clear()}},setName: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)},setData:function(){var t=o(arguments);return this.isNew||this.lastData!==t?(this.isNew=this.capsule.isNew=!1,this.lastData=this.capsule.lastData=t,!1):!0},resize:function(){},refresh:function(){},clear:function(){},attach:function(t){return t.module===LogTracer&&(this.logTracer=t),this},mousedown:function(t){},mousemove:function(t){},mouseup:function(t){},mousewheel:function(t){}},e.exports=i},{"../tracer_manager/util":51}],34:[function(t,e,r){"use strict";function n(){return a.apply(this,arguments)?(n.prototype.init.call(this),!0):!1}var i=t("./directed_graph"),a=(i.DirectedGraph,i.DirectedGraphTracer);n.prototype=$.extend(!0,Object.create(a.prototype),{constructor:n,init:function(){var t=this;this.s.settings({defaultEdgeType:"def",funcEdgesDef:function(e,r,n,i,a){var o=t.getColor(e,r,n,a);t.drawEdge(e,r,n,o,i,a)}})},setData:function(t){if(Tracer.prototype.setData.apply(this,arguments))return!0;this.graph.clear();for(var e=[],r=[],n=2*Math.PI/t.length,i=0,a=0;a<t.length;a++)i+=n,e.push({id:this.n(a),label:""+a,x:.5+Math.sin(i)/2,y:.5+Math.cos(i)/2,size:1,color:this.color["default"]});for(var a=0;a<t.length;a++)for(var o=0;a>=o;o++)(t[a][o]||t[o][a])&&r.push({id:this.e(a,o),source:this.n(a),target:this.n(o),color:this.color["default"],size:1});return this.graph.read({nodes:e,edges:r}),this.s.camera.goTo({x:0,y:0,angle:0,ratio:1}),this.refresh(),!1},e:function(t,e){if(t>e){var r=t;t=e,e=r}return"e"+t+"_"+e},drawOnHover:function(t,e,r,n){var i=this;e.setLineDash([5,5]);var a=t.id.substring(1);this.graph.edges().forEach(function(o){var s=o.id.substring(1).split("_");if(s[0]==a){var c="#0ff",u=t,l=i.graph.nodes("n"+s[1]);i.drawEdge(o,u,l,c,e,r),n&&n(o,u,l,c,e,r)}else if(s[1]==a){var c="#0ff",u=i.graph.nodes("n"+s[0]),l=t;i.drawEdge(o,u,l,c,e,r),n&&n(o,u,l,c,e,r)}})},drawEdge:function(t,e,r,n,i,a){var o=a("prefix")||"",s=t[o+"size"]||1;i.strokeStyle=n,i.lineWidth=s,i.beginPath(),i.moveTo(e[o+"x"],e[o+"y"]),i.lineTo(r[o+"x"],r[o+"y"]),i.stroke()}});var o={random: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 i=0;t>i;i++)n>i&&(r[n][i]=r[i][n]=0==(Math.random()*(1/e)|0)?1:0);return r}};e.exports={UndirectedGraph:o,UndirectedGraphTracer:n}},{"./directed_graph":30}],35:[function(t,e,r){"use strict";function n(){return a.apply(this,arguments)?(n.prototype.init.call(this),!0):!1}var i=t("./directed_graph"),a=(i.DirectedGraph,i.DirectedGraphTracer),o=t("../tracer_manager/util"),s=o.refineByType;n.prototype=$.extend(!0,Object.create(a.prototype),{constructor:n,init:function(){var t=this;this.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,i,a){var o=t.getColor(e,r,n,a);t.drawArrow(e,r,n,o,i,a),t.drawEdgeWeight(e,r,n,o,i,a)}})},_weight:function(t,e){return this.manager.pushStep(this.capsule,{type:"weight",target:t,weight:e}),this},_visit:function(t,e,r){return this.manager.pushStep(this.capsule,{type:"visit",target:t,source:e,weight:r}),this},_leave:function(t,e,r){return this.manager.pushStep(this.capsule,{type:"leave",target:t,source:e,weight:r}),this},processStep:function(t,e){switch(t.type){case"weight":var r=this.graph.nodes(this.n(t.target));void 0!==t.weight&&(r.weight=s(t.weight));break;case"visit":case"leave":var n="visit"==t.type,r=this.graph.nodes(this.n(t.target)),i=n?this.color.visited:this.color.left;if(r.color=i,void 0!==t.weight&&(r.weight=s(t.weight)),void 0!==t.source){var o=this.e(t.source,t.target),c=this.graph.edges(o);c.color=i,this.graph.dropEdge(o).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:a.prototype.processStep.call(this,t,e)}},setData:function(t){if(Tracer.prototype.setData.apply(this,arguments))return!0;this.graph.clear();for(var e=[],r=[],n=2*Math.PI/t.length,i=0,a=0;a<t.length;a++){i+=n,e.push({id:this.n(a),label:""+a,x:.5+Math.sin(i)/2,y:.5+Math.cos(i)/2,size:1,color:this.color["default"],weight:0});for(var o=0;o<t[a].length;o++)t[a][o]&&r.push({id:this.e(a,o),source:this.n(a),target:this.n(o),color:this.color["default"],size:1,weight:s(t[a][o])})}return this.graph.read({nodes:e,edges:r}),this.s.camera.goTo({x:0,y:0,angle:0,ratio:1}),this.refresh(),!1},clear:function(){a.prototype.clear.call(this),this.clearWeights()},clearWeights:function(){this.graph.nodes().forEach(function(t){t.weight=0})},drawEdgeWeight:function(t,e,r,n,i,a){if(e!=r){var o=a("prefix")||"",s=t[o+"size"]||1;if(!(s<a("edgeLabelThreshold"))){if(0===a("edgeLabelSizePowRatio"))throw'"edgeLabelSizePowRatio" must not be 0.';var c,u=(e[o+"x"]+r[o+"x"])/2,l=(e[o+"y"]+r[o+"y"])/2,h=r[o+"x"]-e[o+"x"],p=r[o+"y"]-e[o+"y"],f=Math.atan2(p,h);c="fixed"===a("edgeLabelSize")?a("defaultEdgeLabelSize"):a("defaultEdgeLabelSize")*s*Math.pow(s,-1/a("edgeLabelSizePowRatio")),i.save(),t.active?(i.font=[a("activeFontStyle"),c+"px",a("activeFont")||a("font")].join(" "),i.fillStyle=n):(i.font=[a("fontStyle"),c+"px",a("font")].join(" "),i.fillStyle=n),i.textAlign="center",i.textBaseline="alphabetic",i.translate(u,l),i.rotate(f),i.fillText(t.weight,0,-s/2-3),i.restore()}}},drawNodeWeight:function(t,e,r){var n,i=r("prefix")||"",a=t[i+"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[i+"x"]+1.5*a),Math.round(t[i+"y"]+n/3)))}});var c={random:function(t,e,r,n){t||(t=5),e||(e=.3),r||(r=1),n||(n=5);for(var i=new Array(t),a=0;t>a;a++){i[a]=new Array(t);for(var o=0;t>o;o++)a!=o&&0==(Math.random()*(1/e)|0)&&(i[a][o]=(Math.random()*(n-r+1)|0)+r)}return i}};e.exports={WeightedDirectedGraph:c,WeightedDirectedGraphTracer:n}},{"../tracer_manager/util":51,"./directed_graph":30}],36:[function(t,e,r){"use strict";function n(){return a.apply(this,arguments)?(n.prototype.init.call(this),!0):!1}var i=t("./weighted_directed_graph"),a=(i.WeightedDirectedGraph,i.WeightedDirectedGraphTracer),o=t("./undirected_graph"),s=o.UndirectedGraphTracer;n.prototype=$.extend(!0,Object.create(a.prototype),{constructor:n,init:function(){var t=this;this.s.settings({defaultEdgeType:"def",funcEdgesDef:function(e,r,n,i,a){var o=t.getColor(e,r,n,a);t.drawEdge(e,r,n,o,i,a),t.drawEdgeWeight(e,r,n,o,i,a)}})},setData:function(t){if(Tracer.prototype.setData.apply(this,arguments))return!0;this.graph.clear();for(var e=[],r=[],n=2*Math.PI/t.length,i=0,a=0;a<t.length;a++)i+=n,e.push({id:this.n(a),label:""+a,x:.5+Math.sin(i)/2,y:.5+Math.cos(i)/2,size:1,color:this.color["default"],weight:0});for(var a=0;a<t.length;a++)for(var o=0;a>=o;o++)(t[a][o]||t[o][a])&&r.push({id:this.e(a,o),source:this.n(a),target:this.n(o),color:this.color["default"],size:1,weight:t[a][o]});return this.graph.read({nodes:e,edges:r}),this.s.camera.goTo({x:0,y:0,angle:0,ratio:1}),this.refresh(),!1},e:s.prototype.e,drawOnHover:s.prototype.drawOnHover,drawEdge:s.prototype.drawEdge,drawEdgeWeight:function(t,e,r,n,i,o){var s=o("prefix")||"";if(e[s+"x"]>r[s+"x"]){var c=e;e=r,r=c}a.prototype.drawEdgeWeight.call(this,t,e,r,n,i,o)}});var c={random:function(t,e,r,n){t||(t=5),e||(e=.3),r||(r=1),n||(n=5);for(var i=new Array(t),a=0;t>a;a++)i[a]=new Array(t);for(var a=0;t>a;a++)for(var o=0;t>o;o++)a>o&&0==(Math.random()*(1/e)|0)&&(i[a][o]=i[o][a]=(Math.random()*(n-r+1)|0)+r);return i}};e.exports={WeightedUndirectedGraph:c,WeightedUndirectedGraphTracer:n}},{"./undirected_graph":34,"./weighted_directed_graph":35}],37:[function(t,e,r){"use strict";var n=t("./request");e.exports=function(t){return n(t,{type:"GET"})}},{"./request":40}],38:[function(t,e,r){"use strict";var n=t("./request");e.exports=function(t){return n(t,{dataType:"json",type:"GET"})}},{"./request":40}],39:[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":40}],40:[function(t,e,r){"use strict";var n=t("rsvp"),i=t("../../app"),a=$,o=a.ajax,s=a.extend,c={};e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return i.setIsLoading(!0),new n.Promise(function(r,n){var a={success:function(t){i.setIsLoading(!1),r(t)},error:function(t){i.setIsLoading(!1),n(t)}},u=s({},c,e,a,{url:t});o(u)})}},{"../../app":3,rsvp:56}],41:[function(t,e,r){"use strict";var n=function(){function t(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(c){i=!0,a=c}finally{try{!n&&s["return"]&&s["return"]()}finally{if(i)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")}}(),i=t("../app"),a=t("../dom/toast"),o=function(){return i.getIsLoading()?(a.showErrorToast("Wait until it completes loading of previous file."),!0):!1},s=function(t){var e=window.location.href,r=(t.replace(/[\[\]]/g,"\\$&"),new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)")),i=r.exec(e);if(!i||3!==i.length)return null;var a=n(i,3),o=a[2];return o};e.exports={checkLoading:o,getParameterByName:s}},{"../app":3,"../dom/toast":21}],42:[function(t,e,r){"use strict";var n=t("./load_algorithm"),i=t("./load_categories"),a=t("./load_file"),o=t("./load_scratch_paper"),s=t("./share_scratch_paper");e.exports={loadAlgorithm:n,loadCategories:i,loadFile:a,loadScratchPaper:o,shareScratchPaper:s}},{"./load_algorithm":43,"./load_categories":44,"./load_file":45,"./load_scratch_paper":46,"./share_scratch_paper":47}],43:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./ajax/get_json");e.exports=function(t,e){var r=n.getAlgorithmDir(t,e);return i(r+"desc.json")}},{"../utils":54,"./ajax/get_json":38}],44:[function(t,e,r){"use strict";var n=(t("../app"),t("./ajax/get_json"));e.exports=function(){return n("./algorithm/category.json")}},{"../app":3,"./ajax/get_json":38}],45:[function(t,e,r){"use strict";var n=t("rsvp"),i=t("../app"),a=t("../utils"),o=t("./helpers"),s=o.checkLoading,c=t("./ajax/get"),u=function(t){return n.hash({data:c(t+"data.js"),code:c(t+"code.js")})},l=function(t){return i.getEditor().clearContent(),u(t).then(function(e){i.updateCachedFile(t,e),i.getEditor().setContent(e)})},h=function(t){return t&&void 0!==t.data&&void 0!==t.code};e.exports=function(t,e,r,o){return new n.Promise(function(n,c){if(s())c();else{$("#explanation").html(o);var u=a.getFileDir(t,e,r);i.setLastFileUsed(u);var p=i.getCachedFile(u);h(p)?(i.getEditor().setContent(p),n()):l(u).then(n,c)}})}},{"../app":3,"../utils":54,"./ajax/get":37,"./helpers":41,rsvp:56}],46:[function(t,e,r){"use strict";var n=t("rsvp"),i=t("../utils"),a=t("../app"),o=t("./ajax/get_json"),s=t("./load_algorithm"),c=function(t,e){return t[e+".js"].content};e.exports=function(t){return new n.Promise(function(e,r){o("https://api.github.com/gists/"+t).then(function(t){var r=t.files,n="scratch_paper",o=null;s(o,n).then(function(t){var s=c(r,"data"),u=c(r,"code"),l=i.getFileDir(o,n,"scratch_paper");a.updateCachedFile(l,{data:s,code:u,"CREDIT.md":"Shared by an anonymous user from http://parkjs814.github.io/AlgorithmVisualizer"}),e({category:o,algorithm:n,data:t})})})})}},{"../app":3,"../utils":54,"./ajax/get_json":38,"./load_algorithm":43,rsvp:56}],47:[function(t,e,r){"use strict";var n=t("rsvp"),i=t("../app"),a=t("./ajax/post_json");e.exports=function(){return new n.Promise(function(t,e){var r=i.getEditor(),n=r.dataEditor,o=r.codeEditor,s={description:"temp","public":!0,files:{"data.js":{content:n.getValue()},"code.js":{content:o.getValue()}}};a("https://api.github.com/gists",s).then(function(e){var r=e.id,n=location,i=n.protocol,a=n.host,o=n.pathname,s=i+"//"+a+o+"?scratch-paper="+r;t(s)})})}},{"../app":3,"./ajax/post_json":39,rsvp:56}],48:[function(t,e,r){"use strict";var n=t("./manager"),i=t("../module/tracer");e.exports={init:function(){var t=new n;return i.prototype.manager=t,t}}},{"../module/tracer":33,"./manager":49}],49:[function(t,e,r){"use strict";var n=1e6,i=function(){this.timer=null,this.pause=!1,this.capsules=[],this.interval=500};i.prototype={add:function(t){var e=$('<section class="module_wrapper">');$(".module_container").append(e);var 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;return $.each(this.capsules,function(n,i){return i.module!==t.module||(r++,i.allocated)?void 0:(i.tracer=t,i.allocated=!0,i.isNew=!1,e=i,!1)}),null===e&&(r++,e=this.add(t)),e.defaultName=t.constructor.name+" "+r,e},deallocateAll:function(){this.reset(),$.each(this.capsules,function(t,e){e.allocated=!1})},removeUnallocated:function(){var t=!1;this.capsules=$.grep(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;$.each(t,function(e,r){var n=100,i=100/t.length,a=i*e;r.$container.css({top:a+"%",width:n+"%",height:i+"%"}),r.tracer.resize()})},resize:function(){this.command("resize")},isPause:function(){return this.pause},setInterval:function(t){$("#interval").val(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++>n)throw"Tracer's stack overflow";var r=this.traces.length,i=[];0===r?this.traces.push(i):i=this.traces[r-1],i.push($.extend(e,{capsule:t}))},newStep:function(){this.traces.push([])},pauseStep:function(){this.traceIndex<0||(this.pause=!0,this.timer&&clearTimeout(this.timer),$("#btn_pause").addClass("active"))},resumeStep:function(){this.pause=!1,this.step(this.traceIndex+1),$("#btn_pause").removeClass("active")},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 n=this.traces[t];n.forEach(function(t){t.capsule.tracer.processStep(t,e)}),e.virtual||this.command("refresh"),this.pause||(this.timer=setTimeout(function(){r.step(t+1,e)},this.interval))}},prevStep:function(){this.command("clear");var t=this.traceIndex-1;if(0>t)return this.traceIndex=-1,void this.command("refresh");for(var e=0;t>e;e++)this.step(e,{virtual:!0});this.step(t)},nextStep:function(){this.step(this.traceIndex+1)},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();$.each(this.capsules,function(t,r){r.allocated&&r.tracer.module.prototype[n].apply(r.tracer,e)})},findOwner:function(t){var e=null;return $.each(this.capsules,function(r,n){return n.$container[0]===t?(e=n,!1):void 0}),e.tracer}},e.exports=i},{}],50:[function(t,e,r){"use strict";var n=JSON.parse,i=function(t){return n(t,function(t,e){return"Infinity"===e?1/0:e})};e.exports=i},{}],51:[function(t,e,r){"use strict";var n=t("./to_json"),i=t("./from_json"),a=t("./refine_by_type");e.exports={toJSON:n,fromJSON:i,refineByType:a}},{"./from_json":50,"./refine_by_type":52,"./to_json":53}],52:[function(t,e,r){"use strict";var n=function(t){return"number"==typeof t?a(t):i(t)},i=function(t){return""===t?" ":t},a=function(t){return t===1/0?"∞":t};e.exports=n},{}],53:[function(t,e,r){"use strict";var n=JSON.stringify,i=function(t){return n(t,function(t,e){return e===1/0?"Infinity":e})};e.exports=i},{}],54:[function(t,e,r){"use strict";var n=function(t,e){return null===t&&"scratch_paper"===e},i=function(t,e){return n(t,e)?"./algorithm/scratch_paper/":"./algorithm/"+t+"/"+e+"/"},a=function(t,e,r){return n(t,e)?"./algorithm/scratch_paper/":"./algorithm/"+t+"/"+e+"/"+r+"/"};e.exports={isScratchPaper:n,getAlgorithmDir:i,getFileDir:a}},{}],55:[function(t,e,r){function n(){l&&s&&(l=!1,s.length?u=s.concat(u):h=-1,u.length&&i())}function i(){if(!l){var t=setTimeout(n);l=!0;for(var e=u.length;e;){for(s=u,u=[];++h<e;)s&&s[h].run();h=-1,e=u.length}s=null,l=!1,clearTimeout(t)}}function a(t,e){this.fun=t,this.array=e}function o(){}var s,c=e.exports={},u=[],l=!1,h=-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(i,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=o,c.addListener=o,c.once=o,c.off=o,c.removeListener=o,c.removeAllListeners=o,c.emit=o,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}},{}],56:[function(t,e,r){(function(r,n){(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return"function"==typeof t}function o(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 Ct.on("error",e):2!==arguments.length?Ct[t]:void(Ct[t]=e)}function h(){setTimeout(function(){for(var t,e=0;e<Et.length;e++){t=Et[e];var r=t.payload;r.guid=r.key+r.id,r.childGuid=r.key+r.childId,r.error&&(r.stack=r.error.stack),Ct.trigger(t.name,t.payload)}Et.length=0},50)}function p(t,e,r){1===Et.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:r&&r._id,label:e._label,timeStamp:$t(),error:Ct["instrument-with-stack"]?new Error(e._label):null}})&&h()}function f(t,e,r){var n=this,i=n._state;if(i===Gt&&!t||i===Ft&&!e)return Ct.instrument&&At("chained",n,n),n;n._onError=null;var a=new n.constructor(S,r),o=n._result;if(Ct.instrument&&At("chained",n,a),i){var s=arguments[i-1];Ct.async(function(){P(i,a,s,o)})}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(S,e);return M(n,t),n}function g(t,e,r){return t===Gt?{state:"fulfilled",value:r}:{state:"rejected",reason:r}}function v(t,e,r,n){this._instanceConstructor=t,this.promise=new t(S,n),this._abortOnReject=r,this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?k(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&k(this.promise,this._result))):z(this.promise,this._validationError())}function y(t,e){return new jt(this,t,!0,e).promise}function m(t,e){function r(t){M(a,t)}function n(t){z(a,t)}var i=this,a=new i(S,e);if(!xt(t))return z(a,new TypeError("You must pass an array to race.")),a;for(var o=t.length,s=0;a._state===Pt&&o>s;s++)L(i.resolve(t[s]),void 0,r,n);return a}function w(t,e){var r=this,n=new r(S,e);return z(n,t),n}function _(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function b(){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=It++,this._label=e,this._state=void 0,this._result=void 0,this._subscribers=[],Ct.instrument&&At("created",this),S!==t&&("function"!=typeof t&&_(),this instanceof x?G(this,t):b())}function $(){return new TypeError("A promises callback cannot return that same promise.")}function S(){}function T(t){try{return t.then}catch(e){return Wt.error=e,Wt}}function C(t,e,r,n){try{t.call(e,r,n)}catch(i){return i}}function E(t,e,r){Ct.async(function(t){var n=!1,i=C(r,e,function(r){n||(n=!0,e!==r?M(t,r,void 0):k(t,r))},function(e){n||(n=!0,z(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,z(t,i))},t)}function A(t,e){e._state===Gt?k(t,e._result):e._state===Ft?(e._onError=null,z(t,e._result)):L(e,void 0,function(r){e!==r?M(t,r,void 0):k(t,r)},function(e){z(t,e)})}function D(t,e,r){e.constructor===t.constructor&&r===Dt&&constructor.resolve===Mt?A(t,e):r===Wt?z(t,Wt.error):void 0===r?k(t,e):a(r)?E(t,e,r):k(t,e)}function M(t,e){t===e?k(t,e):i(e)?D(t,e,T(e)):k(t,e)}function j(t){t._onError&&t._onError(t._result),O(t)}function k(t,e){t._state===Pt&&(t._result=e,t._state=Gt,0===t._subscribers.length?Ct.instrument&&At("fulfilled",t):Ct.async(O,t))}function z(t,e){t._state===Pt&&(t._state=Ft,t._result=e,Ct.async(j,t))}function L(t,e,r,n){var i=t._subscribers,a=i.length;t._onError=null,i[a]=e,i[a+Gt]=r,i[a+Ft]=n,0===a&&t._state&&Ct.async(O,t)}function O(t){var e=t._subscribers,r=t._state;if(Ct.instrument&&At(r===Gt?"fulfilled":"rejected",t),0!==e.length){for(var n,i,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?P(r,n,i,a):i(a);t._subscribers.length=0}}function I(){this.error=null}function N(t,e){try{return t(e)}catch(r){return Rt.error=r,Rt}}function P(t,e,r,n){var i,o,s,c,u=a(r);if(u){if(i=N(r,n),i===Rt?(c=!0,o=i.error,i=null):s=!0,e===i)return void z(e,$())}else i=n,s=!0;e._state!==Pt||(u&&s?M(e,i):c?z(e,o):t===Gt?k(e,i):t===Ft&&z(e,i))}function G(t,e){var r=!1;try{e(function(e){r||(r=!0,M(t,e))},function(e){r||(r=!0,z(t,e))})}catch(n){z(t,n)}}function F(t,e,r){this._superConstructor(t,e,!1,r)}function W(t,e){return new F(Nt,t,e).promise}function R(t,e){return Nt.all(t,e)}function U(t,e){te[Ht]=t,te[Ht+1]=e,Ht+=2,2===Ht&&qt()}function q(){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(B)}}function V(){return function(){Ut(B)}}function Y(){var t=0,e=new Kt(B),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}function H(){var t=new MessageChannel;return t.port1.onmessage=B,function(){t.port2.postMessage(0)}}function X(){return function(){setTimeout(B,1)}}function B(){for(var t=0;Ht>t;t+=2){var e=te[t],r=te[t+1];e(r),te[t]=void 0,te[t+1]=void 0}Ht=0}function J(){try{var e=t,r=e("vertx");return Ut=r.runOnLoop||r.runOnContext,V()}catch(n){return X()}}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,i=new Array(n),o=0;n>o;o++)i[o]=e(t[o]);return Nt.all(i,r).then(function(e){for(var r=new Array(n),i=0,a=0;n>a;a++)e[a]&&(r[i]=t[a],i++);return r.length=i,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,i=new Array(n),o=0;n>o;o++)i[o]=e(t[o]);return Nt.all(i,r)})}function it(){this.value=void 0}function at(t){try{return t.then}catch(e){return ce.value=e,ce}}function ot(t,e,r){try{t.apply(e,r)}catch(n){return ce.value=n,ce}}function st(t,e){for(var r,n,i={},a=t.length,o=new Array(a),s=0;a>s;s++)o[s]=t[s];for(n=0;n<e.length;n++)r=e[n],i[r]=o[n+1];return i}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,i=arguments.length,a=new Array(i+1),o=!1,s=0;i>s;++s){if(r=arguments[s],!o){if(o=ft(r),o===ue){var c=new Nt(S);return z(c,ue.value),c}o&&o!==!0&&(r=ut(o,r))}a[s]=r}var u=new Nt(S);return a[i]=function(t,r){t?z(u,t):void 0===e?M(u,r):e===!0?M(u,ct(arguments)):xt(e)?M(u,st(arguments,e)):M(u,r)},o?pt(u,a,t,n):ht(u,a,t,n)};return r.__proto__=t,r}function ht(t,e,r,n){var i=ot(r,n,e);return i===ce&&z(t,i.value),t}function pt(t,e,r,n){return Nt.all(e).then(function(e){var i=ot(r,n,e);return i===ce&&z(t,i.value),t})}function ft(t){return t&&"object"==typeof t?t.constructor===Nt?!0:at(t):!1}function dt(t,e){return Nt.race(t,e)}function gt(t,e){return Nt.reject(t,e)}function vt(t,e){return Nt.resolve(t,e)}function yt(t){throw setTimeout(function(){throw t}),t}function mt(t,e){Ct.async(t,e)}function wt(){Ct.on.apply(Ct,arguments)}function _t(){Ct.off.apply(Ct,arguments)}var bt;bt=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var xt=bt,$t=Date.now||function(){return(new Date).getTime()},St=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},Tt={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,i=u(this);return e?(r=i[t],n=c(r,e),void(-1!==n&&r.splice(n,1))):void(i[t]=[])},trigger:function(t,e,r){var n,i,a=u(this);if(n=a[t])for(var o=0;o<n.length;o++)(i=n[o])(e,r)}},Ct={instrument:!1};Tt.mixin(Ct);var Et=[],At=p,Dt=f,Mt=d,jt=v;v.prototype._validateInput=function(t){return xt(t)},v.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},v.prototype._init=function(){this._result=new Array(this.length)},v.prototype._enumerate=function(){for(var t=this.length,e=this.promise,r=this._input,n=0;e._state===Pt&&t>n;n++)this._eachEntry(r[n],n)},v.prototype._settleMaybeThenable=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===Mt){var i=T(t);if(i===Dt&&t._state!==Pt)t._onError=null,this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=this._makeResult(Gt,e,t);else if(r===Nt){var a=new r(S);D(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){e(t)}),e)}else this._willSettleAt(n(t),e)},v.prototype._eachEntry=function(t,e){o(t)?this._settleMaybeThenable(t,e):(this._remaining--,this._result[e]=this._makeResult(Gt,e,t))},v.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===Pt&&(this._remaining--,this._abortOnReject&&t===Ft?z(n,r):this._result[e]=this._makeResult(t,e,r)),0===this._remaining&&k(n,this._result)},v.prototype._makeResult=function(t,e,r){return r},v.prototype._willSettleAt=function(t,e){var r=this;L(t,void 0,function(t){r._settledAt(Gt,e,t)},function(t){r._settledAt(Ft,e,t)})};var kt=y,zt=m,Lt=w,Ot="rsvp_"+$t()+"-",It=0,Nt=x;x.cast=Mt,x.all=kt,x.race=zt,x.resolve=Mt,x.reject=Lt,x.prototype={constructor:x,_guidKey:Ot,_onError:function(t){var e=this;Ct.after(function(){e._onError&&Ct.trigger("error",t,e._label)})},then:Dt,"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 Pt=void 0,Gt=1,Ft=2,Wt=new I,Rt=new I;F.prototype=St(jt.prototype),F.prototype._superConstructor=jt,F.prototype._makeResult=g,F.prototype._validationError=function(){return new Error("allSettled must be called with an array")};var Ut,qt,Vt=W,Yt=R,Ht=0,Xt=({}.toString,U),Bt="undefined"!=typeof window?window:void 0,Jt=Bt||{},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);qt=Zt?q():Kt?Y():Qt?H():void 0===Bt&&"function"==typeof t?J():X();var ee=K,re=Z,ne=Q;Q.prototype=St(jt.prototype),Q.prototype._superConstructor=jt,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 i in r)e._state===Pt&&Object.prototype.hasOwnProperty.call(r,i)&&n.push({position:i,entry:r[i]});var a=n.length;t._remaining=a;for(var o,s=0;e._state===Pt&&a>s;s++)o=n[s],t._eachEntry(o.entry,o.position)},tt.prototype=St(ne.prototype),tt.prototype._superConstructor=jt,tt.prototype._makeResult=g,tt.prototype._validationError=function(){return new Error("hashSettled must be called with an object")};var ie,ae=et,oe=rt,se=nt,ce=new it,ue=new it,le=lt;if("object"==typeof self)ie=self;else{if("object"!=typeof n)throw new Error("no global: `self` or `global` found");ie=n}var he=ie,pe=dt,fe=gt,de=vt,ge=yt;Ct.async=Xt,Ct.after=function(t){setTimeout(t,0)};if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var ve=window.__PROMISE_INSTRUMENTATION__;l("instrument",!0);for(var ye in ve)ve.hasOwnProperty(ye)&&wt(ye,ve[ye])}var me={race:pe,Promise:Nt,allSettled:Vt,hash:oe,hashSettled:ae,denodeify:le,on:wt,off:_t,map:se,filter:re,resolve:de,reject:fe,all:Yt,rethrow:ge,defer:ee,EventTarget:Tt,configure:l,async:mt};"function"==typeof define&&define.amd?define(function(){return me}):"undefined"!=typeof e&&e.exports?e.exports=me:"undefined"!=typeof he&&(he.RSVP=me)}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:55}]},{},[25]);
//# sourceMappingURL=algorithm_visualizer.min.js.map
You can’t perform that action at this time.
