diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-11-26 16:00:52 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-11-26 16:00:52 -0500 |
commit | 04ff67e26b880dde8bfb6462f312cf434457cd46 (patch) | |
tree | a3961289cbe8c60ca524490df1716229c555b379 /assets/js | |
parent | e64faae69aec404b2641b8ae281afe20806e8292 (diff) |
Rewrite task move position component and remove Vuejs
Diffstat (limited to 'assets/js')
-rw-r--r-- | assets/js/app.min.js | 4 | ||||
-rw-r--r-- | assets/js/components/accordion.js | 2 | ||||
-rw-r--r-- | assets/js/components/submit-cancel.js | 81 | ||||
-rw-r--r-- | assets/js/components/task-move-position.js | 236 | ||||
-rw-r--r-- | assets/js/components/text-editor.js | 6 | ||||
-rw-r--r-- | assets/js/core/base.js | 70 | ||||
-rw-r--r-- | assets/js/core/dom.js | 45 | ||||
-rw-r--r-- | assets/js/core/html.js | 25 | ||||
-rw-r--r-- | assets/js/core/http.js | 66 | ||||
-rw-r--r-- | assets/js/core/kb.js | 58 | ||||
-rw-r--r-- | assets/js/core/utils.js | 13 | ||||
-rw-r--r-- | assets/js/polyfills/matches.js | 14 | ||||
-rw-r--r-- | assets/js/src/Popover.js | 4 | ||||
-rw-r--r-- | assets/js/vendor.min.js | 7 |
14 files changed, 440 insertions, 191 deletions
diff --git a/assets/js/app.min.js b/assets/js/app.min.js index 649f88b5..1222df58 100644 --- a/assets/js/app.min.js +++ b/assets/js/app.min.js @@ -1,2 +1,2 @@ -var KB={components:{},utils:{},clickEvents:{}};KB.onClick=function(t,e){this.clickEvents[t]=e},KB.listen=function(){function t(t){for(var o in e.clickEvents)e.clickEvents.hasOwnProperty(o)&&t.target.matches(o)&&(t.preventDefault(),e.clickEvents[o](t))}var e=this;document.addEventListener("click",t,!1)},KB.component=function(t,e){this.components[t]=e},KB.render=function(){for(var t in this.components)for(var e=document.querySelectorAll(".js-"+t),o=0;o<e.length;o++)if(this.components.hasOwnProperty(t)){var a=this.components[t],n=new a(e[o],JSON.parse(e[o].dataset.params));n.render(),e[o].className=e[o].className+"-rendered"}},KB.utils.formatDuration=function(t){return t>=86400?Math.round(t/86400)+"d":t>=3600?Math.round(t/3600)+"h":t>=60?Math.round(t/60)+"m":t+"s"},KB.dom=function(t){function e(t){var e="string"==typeof t?document.createElement(t):t;this.attr=function(t,o){return null!==o&&e.setAttribute(t,o),this},this.hide=function(){return e.style.display="none",this},this.show=function(){return e.style.display="block",this},this.toggle=function(){return"none"===e.style.display?this.show():this.hide(),this},this.click=function(t){return e.onclick=function(e){e.preventDefault(),t()},this},this.add=function(t){return e.appendChild(t),this},this.html=function(t){return e.innerHTML=t,this},this.text=function(t){return e.appendChild(document.createTextNode(t)),this},this.addClass=function(t){return e.classList.add(t),this},this.removeClass=function(t){return e.classList.remove(t),this},this.toggleClass=function(t){return e.classList.toggle(t),this},this.hasClass=function(t){return e.classList.contains(t)},this.parent=function(t){for(;e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null},this.child=function(t){return e.querySelector(t)},this["for"]=function(t,o){for(var a=0;a<o.length;a++){var n=o[a];if("object"!=typeof n)e.appendChild(KB.dom(t).text(n).build());else{var i=KB.dom(t);for(var r in n)n.hasOwnProperty(r)&&r in this&&"function"==typeof this[r]?i[r](n[r]):i.attr(r,n[r]);e.appendChild(i.build())}}return this},this.build=function(){return e}}return new e(t)},KB.onClick(".accordion-toggle",function(t){var e=KB.dom(t.target).parent(".accordion-section");e&&(KB.dom(e).toggleClass("accordion-collapsed"),KB.dom(KB.dom(e).child(".accordion-content")).toggle())}),KB.component("calendar",function(t,e){this.render=function(){var o=$(t);o.fullCalendar({locale:$("body").data("js-lang"),editable:!0,eventLimit:!0,defaultView:"month",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},eventDrop:function(t){$.ajax({cache:!1,url:e.saveUrl,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({task_id:t.id,date_due:t.start.format()})})},viewRender:function(){var t=e.checkUrl,a={start:o.fullCalendar("getView").start.format(),end:o.fullCalendar("getView").end.format()};for(var n in a)t+="&"+n+"="+a[n];$.getJSON(t,function(t){o.fullCalendar("removeEvents"),o.fullCalendar("addEventSource",t),o.fullCalendar("rerenderEvents")})}})}}),KB.component("chart-project-avg-time-column",function(t,e){this.render=function(){var o=e.metrics,a=[e.label],n=[];for(var i in o)a.push(o[i].average),n.push(o[i].title);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[a],type:"bar"},bar:{width:{ratio:.5}},axis:{x:{type:"category",categories:n},y:{tick:{format:KB.utils.formatDuration}}},legend:{show:!1}})}}),KB.component("chart-project-burndown",function(t,e){this.render=function(){for(var o=e.metrics,a=[[e.labelTotal]],n=[],i=d3.time.format("%Y-%m-%d"),r=d3.time.format(e.dateFormat),s=0;s<o.length;s++)for(var d=0;d<o[s].length;d++)0===s?a.push([o[s][d]]):(a[d+1].push(o[s][d]),d>0&&(void 0===a[0][s]&&a[0].push(0),a[0][s]+=o[s][d]),0===d&&n.push(r(i.parse(o[s][d]))));KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:a},axis:{x:{type:"category",categories:n}}})}}),KB.component("chart-project-cumulative-flow",function(t,e){this.render=function(){for(var o=e.metrics,a=[],n=[],i=[],r=d3.time.format("%Y-%m-%d"),s=d3.time.format(e.dateFormat),d=0;d<o.length;d++)for(var c=0;c<o[d].length;c++)0===d?(a.push([o[d][c]]),c>0&&n.push(o[d][c])):(a[c].push(o[d][c]),0===c&&i.push(s(r.parse(o[d][c]))));KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:a,type:"area-spline",groups:[n]},axis:{x:{type:"category",categories:i}}})}}),KB.component("chart-project-lead-cycle-time",function(t,e){this.render=function(){var o=e.metrics,a=[e.labelCycle],n=[e.labelLead],i=[],r={};r[e.labelCycle]="area",r[e.labelLead]="area-spline";var s={};s[e.labelLead]="#afb42b",s[e.labelCycle]="#4e342e";for(var d=0;d<o.length;d++)a.push(parseInt(o[d].avg_cycle_time)),n.push(parseInt(o[d].avg_lead_time)),i.push(o[d].day);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[n,a],types:r,colors:s},axis:{x:{type:"category",categories:i},y:{tick:{format:KB.utils.formatDuration}}}})}}),KB.component("chart-project-task-distribution",function(t,e){this.render=function(){for(var o=[],a=0;a<e.metrics.length;a++)o.push([e.metrics[a].column_title,e.metrics[a].nb_tasks]);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:o,type:"donut"}})}}),KB.component("chart-project-time-comparison",function(t,e){this.render=function(){var o=[e.labelSpent],a=[e.labelEstimated],n=[];for(var i in e.metrics)o.push(e.metrics[i].time_spent),a.push(e.metrics[i].time_estimated),n.push("open"===i?e.labelOpen:e.labelClosed);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[o,a],type:"bar"},bar:{width:{ratio:.2}},axis:{x:{type:"category",categories:n}},legend:{show:!0}})}}),KB.component("chart-project-user-distribution",function(t,e){this.render=function(){for(var o=[],a=0;a<e.metrics.length;a++)o.push([e.metrics[a].user,e.metrics[a].nb_tasks]);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:o,type:"donut"}})}}),KB.component("chart-task-time-column",function(t,e){this.render=function(){for(var o=e.metrics,a=[e.label],n=[],i=0;i<o.length;i++)a.push(o[i].time_spent),n.push(o[i].title);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[a],type:"bar"},bar:{width:{ratio:.5}},axis:{x:{type:"category",categories:n},y:{tick:{format:KB.utils.formatDuration}}},legend:{show:!1}})}}),KB.component("external-task-view",function(t,e){this.render=function(){$.ajax({cache:!1,url:e.url,success:function(e){KB.dom(t).html('<div id="external-task-view">'+e+"</div>")}})}}),Vue.component("submit-cancel",{props:["labelButton","labelOr","labelCancel","callback"],template:'<div class="form-actions"><button type="button" class="btn btn-blue" @click="onSubmit" :disabled="isLoading"><span v-show="isLoading"><i class="fa fa-spinner fa-pulse"></i> </span>{{ labelButton }}</button> {{ labelOr }} <a href="#" v-on:click.prevent="onCancel">{{ labelCancel }}</a></div>',data:function(){return{loading:!1}},computed:{isLoading:function(){return this.loading}},methods:{onSubmit:function(){this.loading=!0,this.callback()},onCancel:function(){_KB.get("Popover").close()}},events:{submitCancelled:function(){this.loading=!1}}}),Vue.component("task-move-position",{props:["board","saveUrl"],template:"#template-task-move-position",data:function(){return{swimlaneId:0,columnId:0,position:1,columns:[],tasks:[],positionChoice:"before",errorMessage:""}},ready:function(){this.columns=this.board[0].columns,this.columnId=this.columns[0].id,this.tasks=this.columns[0].tasks,this.errorMessage=""},methods:{onChangeSwimlane:function(){var t=this;this.columnId=0,this.position=1,this.columns=[],this.tasks=[],this.positionChoice="before",this.board.forEach(function(e){e.id===t.swimlaneId&&(t.columns=e.columns,t.tasks=t.columns[0].tasks,t.columnId=t.columns[0].id)})},onChangeColumn:function(){var t=this;this.position=1,this.tasks=[],this.positionChoice="before",this.columns.forEach(function(e){e.id==t.columnId&&(t.tasks=e.tasks,t.tasks.length>0&&(t.position=parseInt(t.tasks[0].position)))})},onSubmit:function(){var t=this;"after"==this.positionChoice&&this.position++,$.ajax({cache:!1,url:this.saveUrl,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({column_id:this.columnId,swimlane_id:this.swimlaneId,position:this.position}),statusCode:{200:function(){window.location.reload(!0)},403:function(e){var o=JSON.parse(e.responseText);t.errorMessage=o.message,t.$broadcast("submitCancelled")}}})}}}),KB.component("text-editor",function(t,e){function o(){var t=KB.dom("div").attr("class","text-editor-toolbar")["for"]("a",[{href:"#",html:'<i class="fa fa-pencil-square-o fa-fw"></i> '+e.labelWrite,click:function(){n()}}]).build();return m=KB.dom("div").attr("class","text-editor-preview-area markdown").build(),KB.dom("div").attr("class","text-editor-view-mode").add(t).add(m).hide().build()}function a(){var t=KB.dom("div").attr("class","text-editor-toolbar")["for"]("a",[{href:"#",html:'<i class="fa fa-eye fa-fw"></i> '+e.labelPreview,click:function(){n()}},{href:"#",html:'<i class="fa fa-bold fa-fw"></i>',click:function(){s("**")}},{href:"#",html:'<i class="fa fa-italic fa-fw"></i>',click:function(){s("_")}},{href:"#",html:'<i class="fa fa-strikethrough fa-fw"></i>',click:function(){s("~~")}},{href:"#",html:'<i class="fa fa-quote-right fa-fw"></i>',click:function(){c("> ")}},{href:"#",html:'<i class="fa fa-list-ul fa-fw"></i>',click:function(){c("* ")}},{href:"#",html:'<i class="fa fa-code fa-fw"></i>',click:function(){d("```")}}]).build();return u=KB.dom("textarea").attr("name",e.name).attr("tabindex",e.tabindex||"-1").attr("required",e.required||!1).attr("autofocus",e.autofocus||null).attr("placeholder",e.placeholder||"").text(e.text).build(),KB.dom("div").attr("class","text-editor-write-mode").add(t).add(u).build()}function n(){KB.dom(m).html(marked(u.value,{sanitize:!0})),KB.dom(h).toggle(),KB.dom(f).toggle()}function i(){return u.value.substring(u.selectionStart,u.selectionEnd)}function r(t,e,o,a){return t.substring(0,e)+a+t.substring(o)}function s(t){var e=i();l(t+e+t),p(t)}function d(t){var e=i();l("\n"+t+"\n"+e+"\n"+t),p(t,2)}function c(t){var e=i();if(e.indexOf("\n")===-1)l("\n"+t+e);else{for(var o=e.split("\n"),a=0;a<o.length;a++)o[a].indexOf(t)===-1&&(o[a]=t+o[a]);l(o.join("\n"))}}function l(t){var e=!1;if(v=u.selectionStart,b=u.selectionEnd,u.focus(),document.queryCommandSupported("insertText")&&(e=document.execCommand("insertText",!1,t)),!e){try{document.execCommand("ms-beginUndoUnit")}catch(o){}u.value=r(text,u.selectionStart,u.selectionEnd,t);try{document.execCommand("ms-endUndoUnit")}catch(o){}}}function p(t,e){e=e||0;var o=b+t.length+e;u.setSelectionRange(o,o)}var u,h,f,m,v,b;this.render=function(){f=a(),h=o(),t.appendChild(KB.dom("div").attr("class","text-editor").add(h).add(f).build())}}),document.addEventListener("DOMContentLoaded",function(){KB.render(),KB.listen()});var Kanboard={};Kanboard.App=function(){this.controllers={}},Kanboard.App.prototype.get=function(t){return this.controllers[t]},Kanboard.App.prototype.execute=function(){for(var t in Kanboard)if("App"!==t){var e=new Kanboard[t](this);this.controllers[t]=e,"function"==typeof e.execute&&e.execute(),"function"==typeof e.listen&&e.listen(),"function"==typeof e.focus&&e.focus(),"function"==typeof e.keyboardShortcuts&&e.keyboardShortcuts()}this.focus(),this.chosen(),this.keyboardShortcuts(),this.datePicker(),this.autoComplete(),this.tagAutoComplete()},Kanboard.App.prototype.keyboardShortcuts=function(){var t=this;Mousetrap.bindGlobal("mod+enter",function(){var e=$("form");1==e.length?e.submit():e.length>1&&("INPUT"===document.activeElement.tagName||"TEXTAREA"===document.activeElement.tagName?$(document.activeElement).parents("form").submit():t.get("Popover").isOpen()&&$("#popover-container form").submit())}),Mousetrap.bind("b",function(t){t.preventDefault(),$("#board-selector").trigger("chosen:open")}),Mousetrap.bindGlobal("esc",function(){t.get("Popover").close(),t.get("Dropdown").close()}),Mousetrap.bind("?",function(){t.get("Popover").open($("body").data("keyboard-shortcut-url"))})},Kanboard.App.prototype.focus=function(){$(document).on("focus",".auto-select",function(){$(this).select()}),$(document).on("mouseup",".auto-select",function(t){t.preventDefault()})},Kanboard.App.prototype.chosen=function(){$(".chosen-select").each(function(){var t=$(this).data("search-threshold");void 0===t&&(t=10),$(this).chosen({width:"180px",no_results_text:$(this).data("notfound"),disable_search_threshold:t})}),$(".select-auto-redirect").change(function(){var t=new RegExp($(this).data("redirect-regex"),"g");window.location=$(this).data("redirect-url").replace(t,$(this).val())})},Kanboard.App.prototype.datePicker=function(){var t=$("body"),e=t.data("js-date-format"),o=t.data("js-time-format"),a=t.data("js-lang");$.datepicker.setDefaults($.datepicker.regional[a]),$.timepicker.setDefaults($.timepicker.regional[a]),$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:e,constrainInput:!1}),$(".form-datetime").datetimepicker({dateFormat:e,timeFormat:o,constrainInput:!1})},Kanboard.App.prototype.tagAutoComplete=function(){$(".tag-autocomplete").select2({tags:!0})},Kanboard.App.prototype.autoComplete=function(){$(".autocomplete").each(function(){var t=$(this),e=t.data("dst-field"),o=t.data("dst-extra-field");""===$("#form-"+e).val()&&t.parent().find("button[type=submit]").attr("disabled","disabled"),t.autocomplete({source:t.data("search-url"),minLength:1,select:function(a,n){$("input[name="+e+"]").val(n.item.id),o&&$("input[name="+o+"]").val(n.item[o]),t.parent().find("button[type=submit]").removeAttr("disabled")}})})},Kanboard.App.prototype.hasId=function(t){return!!document.getElementById(t)},Kanboard.App.prototype.showLoadingIcon=function(){$("body").append('<span id="app-loading-icon"> <i class="fa fa-spinner fa-spin"></i></span>')},Kanboard.App.prototype.hideLoadingIcon=function(){$("#app-loading-icon").remove()},Kanboard.App.prototype.isVisible=function(){var t="";return"undefined"!=typeof document.hidden?t="visibilityState":"undefined"!=typeof document.mozHidden?t="mozVisibilityState":"undefined"!=typeof document.msHidden?t="msVisibilityState":"undefined"!=typeof document.webkitHidden&&(t="webkitVisibilityState"),""===t||"visible"==document[t]},Kanboard.BoardCollapsedMode=function(t){this.app=t},Kanboard.BoardCollapsedMode.prototype.keyboardShortcuts=function(){var t=this;t.app.hasId("board")&&Mousetrap.bind("s",function(){t.toggle()})},Kanboard.BoardCollapsedMode.prototype.toggle=function(){var t=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:$('.filter-display-mode:not([style="display: none;"]) a').attr("href"),success:function(e){$(".filter-display-mode").toggle(),t.app.get("BoardDragAndDrop").refresh(e)}})},Kanboard.BoardColumnView=function(t){this.app=t},Kanboard.BoardColumnView.prototype.execute=function(){this.app.hasId("board")&&this.render()},Kanboard.BoardColumnView.prototype.listen=function(){var t=this;$(document).on("click",".board-toggle-column-view",function(){t.toggle($(this).data("column-id"))})},Kanboard.BoardColumnView.prototype.onBoardRendered=function(){this.render()},Kanboard.BoardColumnView.prototype.render=function(){var t=this;$(".board-column-header").each(function(){var e=$(this).data("column-id");localStorage.getItem("hidden_column_"+e)&&t.hideColumn(e)})},Kanboard.BoardColumnView.prototype.toggle=function(t){localStorage.getItem("hidden_column_"+t)?this.showColumn(t):this.hideColumn(t)},Kanboard.BoardColumnView.prototype.hideColumn=function(t){$(".board-column-"+t+" .board-column-expanded").hide(),$(".board-column-"+t+" .board-column-collapsed").show(),$(".board-column-header-"+t+" .board-column-expanded").hide(),$(".board-column-header-"+t+" .board-column-collapsed").show(),$(".board-column-header-"+t).each(function(){$(this).removeClass("board-column-compact"),$(this).addClass("board-column-header-collapsed")}),$(".board-column-"+t).each(function(){$(this).addClass("board-column-task-collapsed")}),$(".board-column-"+t+" .board-rotation").each(function(){$(this).css("width",$(".board-column-"+t).height())}),localStorage.setItem("hidden_column_"+t,1)},Kanboard.BoardColumnView.prototype.showColumn=function(t){$(".board-column-"+t+" .board-column-expanded").show(),$(".board-column-"+t+" .board-column-collapsed").hide(),$(".board-column-header-"+t+" .board-column-expanded").show(),$(".board-column-header-"+t+" .board-column-collapsed").hide(),$(".board-column-header-"+t).removeClass("board-column-header-collapsed"),$(".board-column-"+t).removeClass("board-column-task-collapsed"),0==localStorage.getItem("horizontal_scroll")&&$(".board-column-header-"+t).addClass("board-column-compact"),localStorage.removeItem("hidden_column_"+t)},Kanboard.BoardHorizontalScrolling=function(t){this.app=t},Kanboard.BoardHorizontalScrolling.prototype.execute=function(){this.app.hasId("board")&&this.render()},Kanboard.BoardHorizontalScrolling.prototype.listen=function(){var t=this;$(document).on("click",".filter-toggle-scrolling",function(e){e.preventDefault(),t.toggle()})},Kanboard.BoardHorizontalScrolling.prototype.keyboardShortcuts=function(){var t=this;t.app.hasId("board")&&Mousetrap.bind("c",function(){t.toggle()})},Kanboard.BoardHorizontalScrolling.prototype.onBoardRendered=function(){this.render()},Kanboard.BoardHorizontalScrolling.prototype.toggle=function(){var t=localStorage.getItem("horizontal_scroll")||1;localStorage.setItem("horizontal_scroll",0==t?1:0),this.render()},Kanboard.BoardHorizontalScrolling.prototype.render=function(){0==localStorage.getItem("horizontal_scroll")?($(".filter-wide").show(),$(".filter-compact").hide(),$("#board-container").addClass("board-container-compact"),$("#board th:not(.board-column-header-collapsed)").addClass("board-column-compact")):($(".filter-wide").hide(),$(".filter-compact").show(),$("#board-container").removeClass("board-container-compact"),$("#board th").removeClass("board-column-compact"))},Kanboard.BoardPolling=function(t){this.app=t},Kanboard.BoardPolling.prototype.execute=function(){if(this.app.hasId("board")){var t=parseInt($("#board").attr("data-check-interval"));t>0&&window.setInterval(this.check.bind(this),1e3*t)}},Kanboard.BoardPolling.prototype.check=function(){if(this.app.isVisible()&&!this.app.get("BoardDragAndDrop").savingInProgress){var t=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:$("#board").data("check-url"),statusCode:{200:function(e){t.app.get("BoardDragAndDrop").refresh(e)},304:function(){t.app.hideLoadingIcon()}}})}},Kanboard.BoardTask=function(t){this.app=t},Kanboard.BoardTask.prototype.listen=function(){var t=this;$(document).on("click",".task-board-change-assignee",function(e){e.preventDefault(),e.stopPropagation(),t.app.get("Popover").open($(this).data("url"))}),$(document).on("click",".task-board",function(t){"A"!=t.target.tagName&&"IMG"!=t.target.tagName&&(window.location=$(this).data("task-url"))})},Kanboard.BoardTask.prototype.keyboardShortcuts=function(){var t=this;t.app.hasId("board")&&Mousetrap.bind("n",function(){t.app.get("Popover").open($("#board").data("task-creation-url"))})},Kanboard.Column=function(t){this.app=t},Kanboard.Column.prototype.listen=function(){this.dragAndDrop()},Kanboard.Column.prototype.dragAndDrop=function(){var t=this;$(".draggable-row-handle").mouseenter(function(){$(this).parent().parent().addClass("draggable-item-hover")}).mouseleave(function(){$(this).parent().parent().removeClass("draggable-item-hover")}),$(".columns-table tbody").sortable({forcePlaceholderSize:!0,handle:"td:first i",helper:function(t,e){return e.children().each(function(){$(this).width($(this).width())}),e},stop:function(e,o){var a=o.item;a.removeClass("draggable-item-selected"),t.savePosition(a.data("column-id"),a.index()+1)},start:function(t,e){e.item.addClass("draggable-item-selected")}}).disableSelection()},Kanboard.Column.prototype.savePosition=function(t,e){var o=$(".columns-table").data("save-position-url"),a=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:o,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({column_id:t,position:e}),complete:function(){a.app.hideLoadingIcon()}})},Kanboard.Dropdown=function(t){this.app=t},Kanboard.Dropdown.prototype.listen=function(){var t=this;$(document).on("click",function(){t.close()}),$(document).on("click","#popover-content",function(){t.close()}),$(document).on("click",".dropdown-menu",function(e){e.preventDefault(),e.stopImmediatePropagation(),t.close();var o=$(this).next("ul"),a=$(this).offset();$("body").append(jQuery("<div>",{id:"dropdown"})),o.clone().appendTo("#dropdown");var n=$("#dropdown ul");n.addClass("dropdown-submenu-open");var i=n.outerHeight(),r=n.outerWidth();a.top+i-$(window).scrollTop()<$(window).height()||$(window).scrollTop()+a.top<i?n.css("top",a.top+$(this).height()):n.css("top",a.top-i-5),a.left+r>$(window).width()?n.css("left",a.left-r+$(this).outerWidth()):n.css("left",a.left)}),$(document).on("click",".dropdown-submenu-open li",function(t){$(t.target).is("li")&&$(this).find("a:visible")[0].click()})},Kanboard.Dropdown.prototype.close=function(){$("#dropdown").remove()},Kanboard.Dropdown.prototype.onPopoverOpened=function(){this.close()},Kanboard.FileUpload=function(t){this.app=t,this.files=[],this.currentFile=0},Kanboard.FileUpload.prototype.onPopoverOpened=function(){var t=document.getElementById("file-dropzone"),e=this;t&&(t.ondragover=t.ondragenter=function(t){t.stopPropagation(),t.preventDefault()},t.ondrop=function(t){t.stopPropagation(),t.preventDefault(),e.files=t.dataTransfer.files,e.show(),$("#file-error-max-size").hide()},$(document).on("click","#file-browser",function(t){t.preventDefault(),$("#file-form-element").get(0).click()}),$(document).on("click","#file-upload-button",function(t){t.preventDefault(),e.currentFile=0,e.checkFiles()}),$("#file-form-element").change(function(){e.files=document.getElementById("file-form-element").files,e.show(),$("#file-error-max-size").hide()}))},Kanboard.FileUpload.prototype.show=function(){if($("#file-list").remove(),this.files.length>0){$("#file-upload-button").prop("disabled",!1),$("#file-dropzone-inner").hide();for(var t=jQuery("<ul>",{id:"file-list"}),e=0;e<this.files.length;e++){var o=jQuery("<span>",{id:"file-percentage-"+e}).append("(0%)"),a=jQuery("<progress>",{id:"file-progress-"+e,value:0}),n=jQuery("<li>",{id:"file-label-"+e}).append(a).append(" ").append(this.files[e].name).append(" ").append(o);t.append(n)}$("#file-dropzone").append(t)}else $("#file-dropzone-inner").show()},Kanboard.FileUpload.prototype.checkFiles=function(){for(var t=parseInt($("#file-dropzone").data("max-size")),e=0;e<this.files.length;e++)if(this.files[e].size>t)return $("#file-error-max-size").show(),$("#file-label-"+e).addClass("file-error"),void $("#file-upload-button").prop("disabled",!0);this.uploadFiles()},Kanboard.FileUpload.prototype.uploadFiles=function(){this.files.length>0&&this.uploadFile(this.files[this.currentFile])},Kanboard.FileUpload.prototype.uploadFile=function(t){var e=document.getElementById("file-dropzone"),o=e.dataset.url,a=new XMLHttpRequest,n=new FormData;a.upload.addEventListener("progress",this.updateProgress.bind(this)),a.upload.addEventListener("load",this.transferComplete.bind(this)),a.open("POST",o,!0),n.append("files[]",t),a.send(n)},Kanboard.FileUpload.prototype.updateProgress=function(t){t.lengthComputable&&($("#file-progress-"+this.currentFile).val(t.loaded/t.total),$("#file-percentage-"+this.currentFile).text("("+Math.floor(t.loaded/t.total*100)+"%)"))},Kanboard.FileUpload.prototype.transferComplete=function(){if(this.currentFile++,this.currentFile<this.files.length)this.uploadFile(this.files[this.currentFile]);else{var t=$("#file-upload-button");t.prop("disabled",!0),t.parent().hide(),$("#file-done").show()}},Kanboard.Gantt=function(t){this.app=t,this.data=[],this.options={container:"#gantt-chart",showWeekends:!0,allowMoves:!0,allowResizes:!0,cellWidth:21,cellHeight:31,slideWidth:1e3,vHeaderWidth:200}},Kanboard.Gantt.prototype.execute=function(){this.app.hasId("gantt-chart")&&this.show()},Kanboard.Gantt.prototype.saveRecord=function(t){this.app.showLoadingIcon(),$.ajax({cache:!1,url:$(this.options.container).data("save-url"),contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify(t),complete:this.app.hideLoadingIcon.bind(this)})},Kanboard.Gantt.prototype.show=function(){this.data=this.prepareData($(this.options.container).data("records"));var t=Math.floor(this.options.slideWidth/this.options.cellWidth+5),e=this.getDateRange(t),o=e[0],a=e[1],n=$(this.options.container),i=jQuery("<div>",{"class":"ganttview"});i.append(this.renderVerticalHeader()),i.append(this.renderSlider(o,a)),n.append(i),jQuery("div.ganttview-grid-row div.ganttview-grid-row-cell:last-child",n).addClass("last"),jQuery("div.ganttview-hzheader-days div.ganttview-hzheader-day:last-child",n).addClass("last"),jQuery("div.ganttview-hzheader-months div.ganttview-hzheader-month:last-child",n).addClass("last"),$(this.options.container).data("readonly")?(this.options.allowResizes=!1,this.options.allowMoves=!1):(this.listenForBlockResize(o),this.listenForBlockMove(o))},Kanboard.Gantt.prototype.renderVerticalHeader=function(){for(var t=jQuery("<div>",{"class":"ganttview-vtheader"}),e=jQuery("<div>",{"class":"ganttview-vtheader-item"}),o=jQuery("<div>",{"class":"ganttview-vtheader-series"}),a=0;a<this.data.length;a++){var n=jQuery("<span>").append(jQuery("<i>",{"class":"fa fa-info-circle tooltip",title:this.getVerticalHeaderTooltip(this.data[a])})).append(" ");"task"==this.data[a].type?n.append(jQuery("<a>",{href:this.data[a].link,title:this.data[a].title}).append(this.data[a].title)):n.append(jQuery("<a>",{href:this.data[a].board_link,title:$(this.options.container).data("label-board-link")}).append('<i class="fa fa-th"></i>')).append(" ").append(jQuery("<a>",{href:this.data[a].gantt_link,title:$(this.options.container).data("label-gantt-link")}).append('<i class="fa fa-sliders"></i>')).append(" ").append(jQuery("<a>",{href:this.data[a].link}).append(this.data[a].title)),o.append(jQuery("<div>",{"class":"ganttview-vtheader-series-name"}).append(n))}return e.append(o),t.append(e),t},Kanboard.Gantt.prototype.renderSlider=function(t,e){var o=jQuery("<div>",{"class":"ganttview-slide-container"}),a=this.getDates(t,e);return o.append(this.renderHorizontalHeader(a)),o.append(this.renderGrid(a)),o.append(this.addBlockContainers()),this.addBlocks(o,t),o},Kanboard.Gantt.prototype.renderHorizontalHeader=function(t){var e=jQuery("<div>",{"class":"ganttview-hzheader"}),o=jQuery("<div>",{"class":"ganttview-hzheader-months"}),a=jQuery("<div>",{"class":"ganttview-hzheader-days"}),n=0;for(var i in t)for(var r in t[i]){var s=t[i][r].length*this.options.cellWidth;n+=s,o.append(jQuery("<div>",{"class":"ganttview-hzheader-month",css:{width:s-1+"px"}}).append($.datepicker.regional[$("body").data("js-lang")].monthNames[r]+" "+i));for(var d in t[i][r])a.append(jQuery("<div>",{"class":"ganttview-hzheader-day"}).append(t[i][r][d].getDate()))}return o.css("width",n+"px"),a.css("width",n+"px"),e.append(o).append(a),e},Kanboard.Gantt.prototype.renderGrid=function(t){var e=jQuery("<div>",{"class":"ganttview-grid"}),o=jQuery("<div>",{"class":"ganttview-grid-row"});for(var a in t)for(var n in t[a])for(var i in t[a][n]){var r=jQuery("<div>",{"class":"ganttview-grid-row-cell"});this.options.showWeekends&&this.isWeekend(t[a][n][i])&&r.addClass("ganttview-weekend"),o.append(r)}var s=jQuery("div.ganttview-grid-row-cell",o).length*this.options.cellWidth;o.css("width",s+"px"),e.css("width",s+"px");for(var d=0;d<this.data.length;d++)e.append(o.clone());return e},Kanboard.Gantt.prototype.addBlockContainers=function(){for(var t=jQuery("<div>",{"class":"ganttview-blocks"}),e=0;e<this.data.length;e++)t.append(jQuery("<div>",{"class":"ganttview-block-container"}));return t},Kanboard.Gantt.prototype.addBlocks=function(t,e){for(var o=jQuery("div.ganttview-blocks div.ganttview-block-container",t),a=0,n=0;n<this.data.length;n++){var i=this.data[n],r=this.daysBetween(i.start,i.end)+1,s=this.daysBetween(e,i.start),d=jQuery("<div>",{"class":"ganttview-block-text"}),c=jQuery("<div>",{"class":"ganttview-block tooltip"+(this.options.allowMoves?" ganttview-block-movable":""),title:this.getBarTooltip(i),css:{width:r*this.options.cellWidth-9+"px","margin-left":s*this.options.cellWidth+"px"}}).append(d);r>=2&&d.append(i.progress),c.data("record",i),this.setBarColor(c,i),jQuery(o[a]).append(c),a+=1}},Kanboard.Gantt.prototype.getVerticalHeaderTooltip=function(t){var e="";if("task"==t.type)e="<strong>"+t.column_title+"</strong> ("+t.progress+")<br/>"+t.title;else{var o=["project-manager","project-member"];for(var a in o){var n=o[a];if(!jQuery.isEmptyObject(t.users[n])){var i=jQuery("<ul>");for(var r in t.users[n])r&&i.append(jQuery("<li>").append(t.users[n][r]));e+="<p><strong>"+$(this.options.container).data("label-"+n)+"</strong></p>"+i[0].outerHTML}}}return e},Kanboard.Gantt.prototype.getBarTooltip=function(t){var e="";return t.not_defined?e=$(this.options.container).data("label-not-defined"):("task"==t.type&&(e="<strong>"+t.progress+"</strong><br/>"+$(this.options.container).data("label-assignee")+" "+(t.assignee?t.assignee:"")+"<br/>"),e+=$(this.options.container).data("label-start-date")+" "+$.datepicker.formatDate("yy-mm-dd",t.start)+"<br/>",e+=$(this.options.container).data("label-end-date")+" "+$.datepicker.formatDate("yy-mm-dd",t.end)),e},Kanboard.Gantt.prototype.setBarColor=function(t,e){e.not_defined?t.addClass("ganttview-block-not-defined"):(t.css("background-color",e.color.background),t.css("border-color",e.color.border),"0%"!=e.progress&&t.append(jQuery("<div>",{css:{"z-index":0,position:"absolute",top:0,bottom:0,"background-color":e.color.border,width:e.progress,opacity:.4}})))},Kanboard.Gantt.prototype.listenForBlockResize=function(t){var e=this;jQuery("div.ganttview-block",this.options.container).resizable({grid:this.options.cellWidth,handles:"e,w",delay:300,stop:function(){var o=jQuery(this);e.updateDataAndPosition(o,t),e.saveRecord(o.data("record"))}})},Kanboard.Gantt.prototype.listenForBlockMove=function(t){var e=this;jQuery("div.ganttview-block",this.options.container).draggable({axis:"x",delay:300,grid:[this.options.cellWidth,this.options.cellWidth],stop:function(){var o=jQuery(this);e.updateDataAndPosition(o,t),e.saveRecord(o.data("record"))}})},Kanboard.Gantt.prototype.updateDataAndPosition=function(t,e){var o=jQuery("div.ganttview-slide-container",this.options.container),a=o.scrollLeft(),n=t.offset().left-o.offset().left-1+a,i=t.data("record");i.not_defined=!1,this.setBarColor(t,i);var r=Math.round(n/this.options.cellWidth),s=this.addDays(this.cloneDate(e),r);i.start=s;var d=t.outerWidth(),c=Math.round(d/this.options.cellWidth)-1;i.end=this.addDays(this.cloneDate(s),c),"task"===i.type&&c>0&&jQuery("div.ganttview-block-text",t).text(i.progress),t.attr("title",this.getBarTooltip(i)),t.data("record",i),t.css("top","").css("left","").css("position","relative").css("margin-left",n+"px")},Kanboard.Gantt.prototype.getDates=function(t,e){var o=[];o[t.getFullYear()]=[],o[t.getFullYear()][t.getMonth()]=[t];for(var a=t;this.compareDate(a,e)==-1;){var n=this.addDays(this.cloneDate(a),1);o[n.getFullYear()]||(o[n.getFullYear()]=[]),o[n.getFullYear()][n.getMonth()]||(o[n.getFullYear()][n.getMonth()]=[]),o[n.getFullYear()][n.getMonth()].push(n),a=n}return o},Kanboard.Gantt.prototype.prepareData=function(t){for(var e=0;e<t.length;e++){var o=new Date(t[e].start[0],t[e].start[1]-1,t[e].start[2],0,0,0,0);t[e].start=o;var a=new Date(t[e].end[0],t[e].end[1]-1,t[e].end[2],0,0,0,0);t[e].end=a}return t},Kanboard.Gantt.prototype.getDateRange=function(t){for(var e=new Date,o=new Date,a=0;a<this.data.length;a++){var n=new Date;n.setTime(Date.parse(this.data[a].start));var i=new Date;i.setTime(Date.parse(this.data[a].end)),0==a&&(e=n, -o=i),1==this.compareDate(e,n)&&(e=n),this.compareDate(o,i)==-1&&(o=i)}return this.daysBetween(e,o)<t&&(o=this.addDays(this.cloneDate(e),t)),e.setDate(e.getDate()-1),[e,o]},Kanboard.Gantt.prototype.daysBetween=function(t,e){if(!t||!e)return 0;for(var o=0,a=this.cloneDate(t);this.compareDate(a,e)==-1;)o+=1,this.addDays(a,1);return o},Kanboard.Gantt.prototype.isWeekend=function(t){return t.getDay()%6==0},Kanboard.Gantt.prototype.cloneDate=function(t){return new Date(t.getTime())},Kanboard.Gantt.prototype.addDays=function(t,e){return t.setDate(t.getDate()+1*e),t},Kanboard.Gantt.prototype.compareDate=function(t,e){if(isNaN(t)||isNaN(e))throw new Error(t+" - "+e);if(t instanceof Date&&e instanceof Date)return t<e?-1:t>e?1:0;throw new TypeError(t+" - "+e)},Kanboard.Notification=function(t){this.app=t},Kanboard.Notification.prototype.execute=function(){$(".alert-fade-out").delay(4e3).fadeOut(800,function(){$(this).remove()})},Kanboard.Popover=function(t){this.app=t},Kanboard.Popover.prototype.listen=function(){var t=this;$(document).on("click",".popover",function(e){t.onClick(e)}),$(document).on("click",".close-popover",function(e){t.close(e)}),$(document).on("click","#popover-close-button",function(e){t.close(e)}),$(document).on("click","#popover-content",function(t){t.stopPropagation()})},Kanboard.Popover.prototype.onClick=function(t){t.preventDefault(),t.stopPropagation();var e=t.currentTarget||t.target,o=e.getAttribute("href");o||(o=e.getAttribute("data-href")),o&&this.open(o)},Kanboard.Popover.prototype.isOpen=function(){return $("#popover-container").size()>0},Kanboard.Popover.prototype.open=function(t){var e=this;e.isOpen()||$.get(t,function(t){$("body").prepend('<div id="popover-container"><div id="popover-content"><div id="popover-content-header"><a href="#" id="popover-close-button"><i class="fa fa-times"></i></a></div>'+t+"</div></div>"),e.executeOnOpenedListeners()})},Kanboard.Popover.prototype.close=function(t){this.isOpen()&&(t&&t.preventDefault(),$("#popover-container").remove(),this.executeOnClosedListeners())},Kanboard.Popover.prototype.ajaxReload=function(t,e,o){var a=e.getResponseHeader("X-Ajax-Redirect");"self"===a?window.location.reload():a&&a.indexOf("#")>-1?window.location=a.split("#")[0]:a?window.location=a:($("#popover-content").html(t),$("#popover-content input[autofocus]").focus(),o.executeOnOpenedListeners())},Kanboard.Popover.prototype.executeOnOpenedListeners=function(){for(var t in this.app.controllers){var e=this.app.get(t);"function"==typeof e.onPopoverOpened&&e.onPopoverOpened()}this.afterOpen()},Kanboard.Popover.prototype.executeOnClosedListeners=function(){for(var t in this.app.controllers){var e=this.app.get(t);"function"==typeof e.onPopoverClosed&&e.onPopoverClosed()}},Kanboard.Popover.prototype.afterOpen=function(){var t=this,e=$("#popover-content .popover-form");e&&e.on("submit",function(o){o.preventDefault(),$.ajax({type:"POST",url:e.attr("action"),data:e.serialize(),success:function(e,o,a){t.ajaxReload(e,a,t)},beforeSend:function(){var t=$('.popover-form button[type="submit"]');t.html('<i class="fa fa-spinner fa-pulse"></i> '+t.html()),t.attr("disabled",!0)}})}),$(document).on("click",".popover-link",function(e){e.preventDefault(),$.ajax({type:"GET",url:$(this).attr("href"),success:function(e,o,a){t.ajaxReload(e,a,t)}})}),$("#popover-content input[autofocus]").each(function(){$(this).focus()}),this.app.datePicker(),this.app.autoComplete(),this.app.tagAutoComplete(),new Vue({el:"#popover-container"}),KB.render()},Kanboard.ProjectCreation=function(t){this.app=t},Kanboard.ProjectCreation.prototype.onPopoverOpened=function(){$("#project-creation-form #form-src_project_id").on("change",function(){var t=$(this).val();0==t?$(".project-creation-options").hide():$(".project-creation-options").show()})},Kanboard.ProjectPermission=function(t){this.app=t},Kanboard.ProjectPermission.prototype.listen=function(){$(".project-change-role").on("change",function(){$.ajax({cache:!1,url:$(this).data("url"),contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({id:$(this).data("id"),role:$(this).val()})})})},Kanboard.Screenshot=function(t){this.app=t,this.pasteCatcher=null},Kanboard.Screenshot.prototype.onPopoverOpened=function(){this.app.hasId("screenshot-zone")&&this.initialize()},Kanboard.Screenshot.prototype.initialize=function(){this.destroy(),window.Clipboard||(this.pasteCatcher=document.createElement("div"),this.pasteCatcher.id="screenshot-pastezone",this.pasteCatcher.contentEditable="true",this.pasteCatcher.style.opacity=0,this.pasteCatcher.style.position="fixed",this.pasteCatcher.style.top=0,this.pasteCatcher.style.right=0,this.pasteCatcher.style.width=0,document.body.insertBefore(this.pasteCatcher,document.body.firstChild),this.pasteCatcher.focus(),document.addEventListener("click",this.setFocus.bind(this)),document.getElementById("screenshot-zone").addEventListener("click",this.setFocus.bind(this))),window.addEventListener("paste",this.pasteHandler.bind(this))},Kanboard.Screenshot.prototype.destroy=function(){null!==this.pasteCatcher?document.body.removeChild(this.pasteCatcher):document.getElementById("screenshot-pastezone")&&document.body.removeChild(document.getElementById("screenshot-pastezone")),document.removeEventListener("click",this.setFocus.bind(this)),this.pasteCatcher=null},Kanboard.Screenshot.prototype.setFocus=function(){null!==this.pasteCatcher&&this.pasteCatcher.focus()},Kanboard.Screenshot.prototype.pasteHandler=function(t){if(t.clipboardData&&t.clipboardData.items){var e=t.clipboardData.items;if(e)for(var o=0;o<e.length;o++)if(e[o].type.indexOf("image")!==-1){var a=e[o].getAsFile(),n=new FileReader,i=this;n.onload=function(t){i.createImage(t.target.result)},n.readAsDataURL(a)}}else setTimeout(this.checkInput.bind(this),100)},Kanboard.Screenshot.prototype.checkInput=function(){var t=this.pasteCatcher.childNodes[0];t&&"IMG"===t.tagName&&this.createImage(t.src),this.pasteCatcher.innerHTML=""},Kanboard.Screenshot.prototype.createImage=function(t){var e=new Image;e.src=t,e.onload=function(){var e=t.split("base64,"),o=e[1];$("input[name=screenshot]").val(o)};var o=document.getElementById("screenshot-zone");o.innerHTML="",o.className="screenshot-pasted",o.appendChild(e),this.destroy(),this.initialize()},Kanboard.Search=function(t){this.app=t},Kanboard.Search.prototype.focus=function(){$(document).on("focus","#form-search",function(){var t=$("#form-search");if(t[0].setSelectionRange){var e=2*t.val().length;t[0].setSelectionRange(e,e)}})},Kanboard.Search.prototype.listen=function(){$(document).on("click",".filter-helper",function(t){t.preventDefault();var e=$(this).data("filter"),o=$(this).data("append-filter"),a=$(this).data("unique-filter"),n=$("#form-search");if(a){var i=a.substr(0,a.indexOf(":"));e=n.val().replace(new RegExp("("+i+":[#a-z0-9]+)","g"),""),e=e.replace(new RegExp("("+i+':"(.+)")',"g"),""),e=e.trim(),e+=" "+a}else o&&(e=n.val()+" "+o);n.val(e),$("form.search").submit()})},Kanboard.Search.prototype.goToView=function(t){var e=$(t);e.length&&(window.location=e.attr("href"))},Kanboard.Search.prototype.keyboardShortcuts=function(){var t=this;Mousetrap.bind("v o",function(){t.goToView(".view-overview")}),Mousetrap.bind("v b",function(){t.goToView(".view-board")}),Mousetrap.bind("v c",function(){t.goToView(".view-calendar")}),Mousetrap.bind("v l",function(){t.goToView(".view-listing")}),Mousetrap.bind("v g",function(){t.goToView(".view-gantt")}),Mousetrap.bind("f",function(t){t.preventDefault();var e=document.getElementById("form-search");e&&e.focus()}),Mousetrap.bind("r",function(t){t.preventDefault();var e=$(".filter-reset").data("filter"),o=$("#form-search");o.val(e),$("form.search").submit()})},Kanboard.Session=function(t){this.app=t},Kanboard.Session.prototype.execute=function(){window.setInterval(this.checkSession,6e4)},Kanboard.Session.prototype.checkSession=function(){$(".form-login").length||$.ajax({cache:!1,url:$("body").data("status-url"),statusCode:{401:function(){window.location=$("body").data("login-url")}}})},Kanboard.Subtask=function(t){this.app=t},Kanboard.Subtask.prototype.listen=function(){var t=this;this.dragAndDrop(),$(document).on("click",".subtask-toggle-status",function(e){var o=$(this);e.preventDefault(),$.ajax({cache:!1,url:o.attr("href"),success:function(e){o.hasClass("subtask-refresh-table")?$(".subtasks-table").replaceWith(e):o.replaceWith(e),t.dragAndDrop()}})}),$(document).on("click",".subtask-toggle-timer",function(e){var o=$(this);e.preventDefault(),$.ajax({cache:!1,url:o.attr("href"),success:function(e){$(".subtasks-table").replaceWith(e),t.dragAndDrop()}})})},Kanboard.Subtask.prototype.dragAndDrop=function(){var t=this;$(".draggable-row-handle").mouseenter(function(){$(this).parent().parent().addClass("draggable-item-hover")}).mouseleave(function(){$(this).parent().parent().removeClass("draggable-item-hover")}),$(".subtasks-table tbody").sortable({forcePlaceholderSize:!0,handle:"td:first i",helper:function(t,e){return e.children().each(function(){$(this).width($(this).width())}),e},stop:function(e,o){var a=o.item;a.removeClass("draggable-item-selected"),t.savePosition(a.data("subtask-id"),a.index()+1)},start:function(t,e){e.item.addClass("draggable-item-selected")}}).disableSelection()},Kanboard.Subtask.prototype.savePosition=function(t,e){var o=$(".subtasks-table").data("save-position-url"),a=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:o,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({subtask_id:t,position:e}),complete:function(){a.app.hideLoadingIcon()}})},Kanboard.Swimlane=function(t){this.app=t},Kanboard.Swimlane.prototype.execute=function(){$(".swimlanes-table").length&&this.dragAndDrop()},Kanboard.Swimlane.prototype.listen=function(){var t=this;$(document).on("click",".board-swimlane-toggle",function(e){e.preventDefault();var o=$(this).data("swimlane-id");t.isCollapsed(o)?t.expand(o):t.collapse(o)})},Kanboard.Swimlane.prototype.onBoardRendered=function(){for(var t=this.getAllCollapsed(),e=0;e<t.length;e++)this.collapse(t[e])},Kanboard.Swimlane.prototype.getStorageKey=function(){return"hidden_swimlanes_"+$("#board").data("project-id")},Kanboard.Swimlane.prototype.expand=function(t){var e=this.getAllCollapsed(),o=e.indexOf(t);o>-1&&e.splice(o,1),localStorage.setItem(this.getStorageKey(),JSON.stringify(e)),$(".board-swimlane-columns-"+t).css("display","table-row"),$(".board-swimlane-tasks-"+t).css("display","table-row"),$(".hide-icon-swimlane-"+t).css("display","inline"),$(".show-icon-swimlane-"+t).css("display","none")},Kanboard.Swimlane.prototype.collapse=function(t){var e=this.getAllCollapsed();e.indexOf(t)<0&&(e.push(t),localStorage.setItem(this.getStorageKey(),JSON.stringify(e))),$(".board-swimlane-columns-"+t+":not(:first-child)").css("display","none"),$(".board-swimlane-tasks-"+t).css("display","none"),$(".hide-icon-swimlane-"+t).css("display","none"),$(".show-icon-swimlane-"+t).css("display","inline")},Kanboard.Swimlane.prototype.isCollapsed=function(t){return this.getAllCollapsed().indexOf(t)>-1},Kanboard.Swimlane.prototype.getAllCollapsed=function(){return JSON.parse(localStorage.getItem(this.getStorageKey()))||[]},Kanboard.Swimlane.prototype.dragAndDrop=function(){var t=this;$(".draggable-row-handle").mouseenter(function(){$(this).parent().parent().addClass("draggable-item-hover")}).mouseleave(function(){$(this).parent().parent().removeClass("draggable-item-hover")}),$(".swimlanes-table tbody").sortable({forcePlaceholderSize:!0,handle:"td:first i",helper:function(t,e){return e.children().each(function(){$(this).width($(this).width())}),e},stop:function(e,o){var a=o.item;a.removeClass("draggable-item-selected"),t.savePosition(a.data("swimlane-id"),a.index()+1)},start:function(t,e){e.item.addClass("draggable-item-selected")}}).disableSelection()},Kanboard.Swimlane.prototype.savePosition=function(t,e){var o=$(".swimlanes-table").data("save-position-url"),a=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:o,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({swimlane_id:t,position:e}),complete:function(){a.app.hideLoadingIcon()}})},Kanboard.Task=function(t){this.app=t},Kanboard.Task.prototype.keyboardShortcuts=function(){var t=$("#task-view"),e=this;this.app.hasId("task-view")&&(Mousetrap.bind("e",function(){e.app.get("Popover").open(t.data("edit-url"))}),Mousetrap.bind("c",function(){e.app.get("Popover").open(t.data("comment-url"))}),Mousetrap.bind("s",function(){e.app.get("Popover").open(t.data("subtask-url"))}),Mousetrap.bind("l",function(){e.app.get("Popover").open(t.data("internal-link-url"))}))},Kanboard.Task.prototype.onPopoverOpened=function(){var t=this,e=0;t.renderColorPicker(),$(document).on("click",".assign-me",function(t){var e=$(this).data("current-id"),o="#"+$(this).data("target-id");t.preventDefault(),$(o+" option[value="+e+"]").length&&$(o).val(e)}),$(document).on("change","select.task-reload-project-destination",function(){if(e>0)$(this).val(e);else{e=$(this).val();var o=$(this).data("redirect").replace(/PROJECT_ID/g,e);$(".loading-icon").show(),$.ajax({type:"GET",url:o,success:function(o,a,n){e=0,$(".loading-icon").hide(),t.app.get("Popover").ajaxReload(o,n,t.app.get("Popover"))}})}})},Kanboard.Task.prototype.renderColorPicker=function(){function t(t){return $('<div class="color-picker-option"><div class="color-picker-square color-'+t.id+'"></div><div class="color-picker-label">'+t.text+"</div></div>")}$(".color-picker").select2({minimumResultsForSearch:1/0,templateResult:t,templateSelection:t})},Kanboard.Tooltip=function(t){this.app=t},Kanboard.Tooltip.prototype.onBoardRendered=function(){this.execute()},Kanboard.Tooltip.prototype.execute=function(){$(".tooltip").tooltip({track:!1,show:!1,hide:!1,position:{my:"left-20 top",at:"center bottom+9",using:function(t,e){$(this).css(t);var o=e.target.left+e.target.width/2-e.element.left-20;$("<div>").addClass("tooltip-arrow").addClass(e.vertical).addClass(o<1?"align-left":"align-right").appendTo(this)}},content:function(){var t=this,e=$(this).attr("data-href");return e?($.get(e,function(e){var o=$(".ui-tooltip:visible");$(".ui-tooltip-content:visible").html(e),o.css({top:"",left:""}),o.children(".tooltip-arrow").remove();var a=$(t).tooltip("option","position");a.of=$(t),o.position(a)}),'<i class="fa fa-spinner fa-spin"></i>'):'<div class="markdown">'+$(this).attr("title")+"</div>"}}).on("mouseenter",function(){var t=this;$(this).tooltip("open"),$(".ui-tooltip").on("mouseleave",function(){$(t).tooltip("close")})}).on("mouseleave focusout",function(t){t.stopImmediatePropagation();var e=this;setTimeout(function(){$(".ui-tooltip:hover").length||$(e).tooltip("close")},100)})},Kanboard.BoardDragAndDrop=function(t){this.app=t,this.savingInProgress=!1},Kanboard.BoardDragAndDrop.prototype.execute=function(){this.app.hasId("board")&&(this.dragAndDrop(),this.executeListeners())},Kanboard.BoardDragAndDrop.prototype.dragAndDrop=function(){var t=this,e=$(".board-task-list"),o={forcePlaceholderSize:!0,tolerance:"pointer",connectWith:".sortable-column",placeholder:"draggable-placeholder",items:".draggable-item",stop:function(e,o){var a=o.item,n=a.attr("data-task-id"),i=a.attr("data-position"),r=a.attr("data-column-id"),s=a.attr("data-swimlane-id"),d=a.parent().attr("data-column-id"),c=a.parent().attr("data-swimlane-id"),l=a.index()+1;a.removeClass("draggable-item-selected"),d==r&&c==s&&l==i||(t.changeTaskState(n),t.save(n,r,d,l,c))},start:function(t,e){e.item.addClass("draggable-item-selected"),e.placeholder.height(e.item.height())}};isMobile.any&&($(".task-board-sort-handle").css("display","inline"),o.handle=".task-board-sort-handle"),e.each(function(){$(this).css("min-height",$(this).parent().height())}),e.sortable(o)},Kanboard.BoardDragAndDrop.prototype.changeTaskState=function(t){var e=$("div[data-task-id="+t+"]");e.addClass("task-board-saving-state"),e.find(".task-board-saving-icon").show()},Kanboard.BoardDragAndDrop.prototype.save=function(t,e,o,a,n){var i=this;i.app.showLoadingIcon(),i.savingInProgress=!0,$.ajax({cache:!1,url:$("#board").data("save-url"),contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({task_id:t,src_column_id:e,dst_column_id:o,swimlane_id:n,position:a}),success:function(t){i.refresh(t),i.savingInProgress=!1},error:function(){i.app.hideLoadingIcon(),i.savingInProgress=!1},statusCode:{403:function(t){window.alert(t.responseJSON.message),document.location.reload(!0)}}})},Kanboard.BoardDragAndDrop.prototype.refresh=function(t){$("#board-container").replaceWith(t),this.app.hideLoadingIcon(),this.dragAndDrop(),this.executeListeners()},Kanboard.BoardDragAndDrop.prototype.executeListeners=function(){for(var t in this.app.controllers){var e=this.app.get(t);"function"==typeof e.onBoardRendered&&e.onBoardRendered()}};var _KB=null;jQuery(document).ready(function(){_KB=new Kanboard.App,_KB.execute()});
\ No newline at end of file +Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),o=e.length;--o>=0&&e.item(o)!==this;);return o>-1});var KB={components:{},utils:{},html:{},http:{},listeners:{clicks:{},internals:{}}};KB.on=function(t,e){this.listeners.internals.hasOwnProperty(t)||(this.listeners.internals[t]=[]),this.listeners.internals[t].push(e)},KB.trigger=function(t,e){if(this.listeners.internals.hasOwnProperty(t))for(var o=0;o<this.listeners.internals[t].length&&this.listeners.internals[t][o](e);o++);},KB.onClick=function(t,e){this.listeners.clicks[t]=e},KB.listen=function(){function t(t){for(var o in e.listeners.clicks)e.listeners.clicks.hasOwnProperty(o)&&t.target.matches(o)&&(t.preventDefault(),e.listeners.clicks[o](t))}var e=this;document.addEventListener("click",t,!1)},KB.component=function(t,e){this.components[t]=e},KB.getComponent=function(t,e,o){var a=this.components[t];return new a(e,o)},KB.render=function(){for(var t in this.components)for(var e=document.querySelectorAll(".js-"+t),o=0;o<e.length;o++)if(this.components.hasOwnProperty(t)){var a=KB.getComponent(t,e[o],JSON.parse(e[o].dataset.params));a.render(),e[o].className=e[o].className+"-rendered"}},KB.dom=function(t){function e(t){var e="string"==typeof t?document.createElement(t):t;this.attr=function(t,o){return null!==o&&e.setAttribute(t,o),this},this.hide=function(){return e.style.display="none",this},this.show=function(){return e.style.display="block",this},this.toggle=function(){return"none"===e.style.display?this.show():this.hide(),this},this.on=function(t,o){return e.addEventListener(t,function(t){t.preventDefault(),o(t.target)}),this},this.click=function(t){return this.on("click",t)},this.change=function(t){return this.on("change",t)},this.add=function(t){return e.appendChild(t),this},this.replace=function(t){return e.parentNode.replaceChild(t,e),this},this.html=function(t){return e.innerHTML=t,this},this.text=function(t){return e.appendChild(document.createTextNode(t)),this},this.addClass=function(t){return e.classList.add(t),this},this.removeClass=function(t){return e.classList.remove(t),this},this.toggleClass=function(t){return e.classList.toggle(t),this},this.hasClass=function(t){return e.classList.contains(t)},this.disable=function(){return e.disabled=!0,this},this.enable=function(){return e.disabled=!1,this},this.parent=function(t){for(;e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null},this.find=function(t){return e.querySelector(t)},this["for"]=function(t,o){for(var a=0;a<o.length;a++){var n=o[a];if("object"!=typeof n)e.appendChild(KB.dom(t).text(n).build());else{var i=KB.dom(t);for(var r in n)n.hasOwnProperty(r)&&r in this&&"function"==typeof this[r]?i[r](n[r]):i.attr(r,n[r]);e.appendChild(i.build())}}return this},this.build=function(){return e}}return new e(t)},KB.find=function(t){var e=document.querySelector(t);return e?KB.dom(e):null},KB.html.label=function(t,e){return KB.dom("label").attr("for",e).text(t).build()},KB.html.radio=function(t,e,o){return KB.dom("label").add(KB.dom("input").attr("type","radio").attr("name",e).attr("value",o).build()).text(t).build()},KB.html.radios=function(t){var e=KB.dom("div");for(var o in t)t.hasOwnProperty(o)&&e.add(KB.html.radio(o.label,o.name,o.value))},KB.http.request=function(t,e,o,a){function n(t){try{return JSON.parse(t.responseText)}catch(e){return t.responseText}}var i=function(){},r=function(){};this.execute=function(){var s=new XMLHttpRequest;s.open(t,e,!0),s.setRequestHeader("X-Requested-With","XMLHttpRequest");for(var d in o)o.hasOwnProperty(d)&&s.setRequestHeader(d,o[d]);return s.onerror=function(){r()},s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE){var t=n(s);200===s.status?i(t):r(t)}},s.send(a),this},this.success=function(t){return i=t,this},this.error=function(t){return r=t,this}},KB.http.get=function(t){return new KB.http.request("GET",t).execute()},KB.http.postJson=function(t,e){var o={"Content-Type":"application/json",Accept:"application/json"};return new KB.http.request("POST",t,o,JSON.stringify(e)).execute()},KB.utils.formatDuration=function(t){return t>=86400?Math.round(t/86400)+"d":t>=3600?Math.round(t/3600)+"h":t>=60?Math.round(t/60)+"m":t+"s"},KB.onClick(".accordion-toggle",function(t){var e=KB.dom(t.target).parent(".accordion-section");e&&(KB.dom(e).toggleClass("accordion-collapsed"),KB.dom(KB.dom(e).find(".accordion-content")).toggle())}),KB.component("calendar",function(t,e){this.render=function(){var o=$(t);o.fullCalendar({locale:$("body").data("js-lang"),editable:!0,eventLimit:!0,defaultView:"month",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},eventDrop:function(t){$.ajax({cache:!1,url:e.saveUrl,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({task_id:t.id,date_due:t.start.format()})})},viewRender:function(){var t=e.checkUrl,a={start:o.fullCalendar("getView").start.format(),end:o.fullCalendar("getView").end.format()};for(var n in a)t+="&"+n+"="+a[n];$.getJSON(t,function(t){o.fullCalendar("removeEvents"),o.fullCalendar("addEventSource",t),o.fullCalendar("rerenderEvents")})}})}}),KB.component("chart-project-avg-time-column",function(t,e){this.render=function(){var o=e.metrics,a=[e.label],n=[];for(var i in o)a.push(o[i].average),n.push(o[i].title);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[a],type:"bar"},bar:{width:{ratio:.5}},axis:{x:{type:"category",categories:n},y:{tick:{format:KB.utils.formatDuration}}},legend:{show:!1}})}}),KB.component("chart-project-burndown",function(t,e){this.render=function(){for(var o=e.metrics,a=[[e.labelTotal]],n=[],i=d3.time.format("%Y-%m-%d"),r=d3.time.format(e.dateFormat),s=0;s<o.length;s++)for(var d=0;d<o[s].length;d++)0===s?a.push([o[s][d]]):(a[d+1].push(o[s][d]),d>0&&(void 0===a[0][s]&&a[0].push(0),a[0][s]+=o[s][d]),0===d&&n.push(r(i.parse(o[s][d]))));KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:a},axis:{x:{type:"category",categories:n}}})}}),KB.component("chart-project-cumulative-flow",function(t,e){this.render=function(){for(var o=e.metrics,a=[],n=[],i=[],r=d3.time.format("%Y-%m-%d"),s=d3.time.format(e.dateFormat),d=0;d<o.length;d++)for(var l=0;l<o[d].length;l++)0===d?(a.push([o[d][l]]),l>0&&n.push(o[d][l])):(a[l].push(o[d][l]),0===l&&i.push(s(r.parse(o[d][l]))));KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:a,type:"area-spline",groups:[n]},axis:{x:{type:"category",categories:i}}})}}),KB.component("chart-project-lead-cycle-time",function(t,e){this.render=function(){var o=e.metrics,a=[e.labelCycle],n=[e.labelLead],i=[],r={};r[e.labelCycle]="area",r[e.labelLead]="area-spline";var s={};s[e.labelLead]="#afb42b",s[e.labelCycle]="#4e342e";for(var d=0;d<o.length;d++)a.push(parseInt(o[d].avg_cycle_time)),n.push(parseInt(o[d].avg_lead_time)),i.push(o[d].day);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[n,a],types:r,colors:s},axis:{x:{type:"category",categories:i},y:{tick:{format:KB.utils.formatDuration}}}})}}),KB.component("chart-project-task-distribution",function(t,e){this.render=function(){for(var o=[],a=0;a<e.metrics.length;a++)o.push([e.metrics[a].column_title,e.metrics[a].nb_tasks]);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:o,type:"donut"}})}}),KB.component("chart-project-time-comparison",function(t,e){this.render=function(){var o=[e.labelSpent],a=[e.labelEstimated],n=[];for(var i in e.metrics)o.push(e.metrics[i].time_spent),a.push(e.metrics[i].time_estimated),n.push("open"===i?e.labelOpen:e.labelClosed);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[o,a],type:"bar"},bar:{width:{ratio:.2}},axis:{x:{type:"category",categories:n}},legend:{show:!0}})}}),KB.component("chart-project-user-distribution",function(t,e){this.render=function(){for(var o=[],a=0;a<e.metrics.length;a++)o.push([e.metrics[a].user,e.metrics[a].nb_tasks]);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:o,type:"donut"}})}}),KB.component("chart-task-time-column",function(t,e){this.render=function(){for(var o=e.metrics,a=[e.label],n=[],i=0;i<o.length;i++)a.push(o[i].time_spent),n.push(o[i].title);KB.dom(t).add(KB.dom("div").attr("id","chart").build()),c3.generate({data:{columns:[a],type:"bar"},bar:{width:{ratio:.5}},axis:{x:{type:"category",categories:n},y:{tick:{format:KB.utils.formatDuration}}},legend:{show:!1}})}}),KB.component("external-task-view",function(t,e){this.render=function(){$.ajax({cache:!1,url:e.url,success:function(e){KB.dom(t).html('<div id="external-task-view">'+e+"</div>")}})}}),KB.component("submit-cancel",function(t,e){function o(){r=!0,KB.find("#modal-submit-button").replace(i()),KB.trigger("modal.submit")}function a(){KB.trigger("modal.cancel"),_KB.get("Popover").close()}function n(){r=!1,KB.find("#modal-submit-button").replace(i())}function i(){var t=KB.dom("button").click(o).attr("id","modal-submit-button").attr("type","submit").attr("class","btn btn-blue");return r&&t.disable().add(KB.dom("i").attr("class","fa fa-spinner fa-pulse").build()).text(" "),t.text(e.submitLabel).build()}var r=!1;this.render=function(){KB.on("modal.stop",n);var o=KB.dom("div").attr("class","form-actions").add(i()).text(" "+e.orLabel+" ").add(KB.dom("a").attr("href","#").click(a).text(e.cancelLabel).build()).build();t.appendChild(o)}}),KB.component("task-move-position",function(t,e){function o(t){var e=KB.dom(document).find("#"+t);return e?parseInt(e.options[e.selectedIndex].value):null}function a(){var t=o("form-swimlanes");return null===t?e.board[0].id:t}function n(){var t=o("form-columns");return null===t?e.board[0].columns[0].id:t}function i(){var t=o("form-position");return null===t?1:t}function r(){var t=KB.find("input[name=positionChoice]:checked");return t?t.value:"before"}function s(){var t=KB.dom(document).find("#form-columns");KB.dom(t).replace(u());var e=KB.dom(document).find("#form-tasks");KB.dom(e).replace(h())}function d(){var t=KB.dom(document).find("#form-tasks");KB.dom(t).replace(h())}function l(t){KB.trigger("modal.stop"),KB.find("#message-container").replace(KB.dom("div").attr("id","message-container").attr("class","alert alert-error").text(t).build())}function c(){var t=i(),o=r();"after"===o&&t++,KB.find("#message-container").replace(KB.dom("div").attr("id","message-container").build()),KB.http.postJson(e.saveUrl,{column_id:n(),swimlane_id:a(),position:t}).success(function(){window.location.reload(!0)}).error(function(t){t&&l(t.message)})}function p(){var t=[];return e.board.forEach(function(e){t.push({value:e.id,text:e.name})}),KB.dom("select").attr("id","form-swimlanes").change(s)["for"]("option",t).build()}function u(){var t=[],o=a();return e.board.forEach(function(e){o===e.id&&e.columns.forEach(function(e){t.push({value:e.id,text:e.title})})}),KB.dom("select").attr("id","form-columns").change(d)["for"]("option",t).build()}function h(){var t=[],o=a(),i=n(),r=KB.dom("div").attr("id","form-tasks");return e.board.forEach(function(e){o===e.id&&e.columns.forEach(function(e){i===e.id&&e.tasks.forEach(function(e){t.push({value:e.position,text:"#"+e.id+" - "+e.title})})})}),t.length>0&&r.add(KB.html.label(e.positionLabel,"form-position")).add(KB.dom("select").attr("id","form-position")["for"]("option",t).build()).add(KB.html.radio(e.beforeLabel,"positionChoice","before")).add(KB.html.radio(e.afterLabel,"positionChoice","after")),r.build()}this.render=function(){KB.on("modal.submit",c);var o=KB.dom("div").on("submit",c).add(KB.dom("div").attr("id","message-container").build()).add(KB.html.label(e.swimlaneLabel,"form-swimlanes")).add(p()).add(KB.html.label(e.columnLabel,"form-columns")).add(u()).add(h()).build();t.appendChild(o)}}),KB.component("text-editor",function(t,e){function o(){var t=KB.dom("div").attr("class","text-editor-toolbar")["for"]("a",[{href:"#",html:'<i class="fa fa-pencil-square-o fa-fw"></i> '+e.labelWrite,click:function(){n()}}]).build();return m=KB.dom("div").attr("class","text-editor-preview-area markdown").build(),KB.dom("div").attr("class","text-editor-view-mode").add(t).add(m).hide().build()}function a(){var t=KB.dom("div").attr("class","text-editor-toolbar")["for"]("a",[{href:"#",html:'<i class="fa fa-eye fa-fw"></i> '+e.labelPreview,click:function(){n()}},{href:"#",html:'<i class="fa fa-bold fa-fw"></i>',click:function(){s("**")}},{href:"#",html:'<i class="fa fa-italic fa-fw"></i>',click:function(){s("_")}},{href:"#",html:'<i class="fa fa-strikethrough fa-fw"></i>',click:function(){s("~~")}},{href:"#",html:'<i class="fa fa-quote-right fa-fw"></i>',click:function(){l("> ")}},{href:"#",html:'<i class="fa fa-list-ul fa-fw"></i>',click:function(){l("* ")}},{href:"#",html:'<i class="fa fa-code fa-fw"></i>',click:function(){d("```")}}]).build();return u=KB.dom("textarea").attr("name",e.name).attr("tabindex",e.tabindex||"-1").attr("required",e.required||!1).attr("autofocus",e.autofocus||null).text(e.text).attr("placeholder",e.placeholder||null).build(),KB.dom("div").attr("class","text-editor-write-mode").add(t).add(u).build()}function n(){KB.dom(m).html(marked(u.value,{sanitize:!0})),KB.dom(h).toggle(),KB.dom(f).toggle()}function i(){return u.value.substring(u.selectionStart,u.selectionEnd)}function r(t,e,o,a){return t.substring(0,e)+a+t.substring(o)}function s(t){var e=i();c(t+e+t),p(t)}function d(t){var e=i();c("\n"+t+"\n"+e+"\n"+t),p(t,2)}function l(t){var e=i();if(e.indexOf("\n")===-1)c("\n"+t+e);else{for(var o=e.split("\n"),a=0;a<o.length;a++)o[a].indexOf(t)===-1&&(o[a]=t+o[a]);c(o.join("\n"))}}function c(t){var e=!1;if(v=u.selectionStart,b=u.selectionEnd,u.focus(),document.queryCommandSupported("insertText")&&(e=document.execCommand("insertText",!1,t)),!e){try{document.execCommand("ms-beginUndoUnit")}catch(o){}u.value=r(u.value,u.selectionStart,u.selectionEnd,t);try{document.execCommand("ms-endUndoUnit")}catch(o){}}}function p(t,e){e=e||0;var o=b+t.length+e;u.setSelectionRange(o,o)}var u,h,f,m,v,b;this.render=function(){f=a(),h=o(),t.appendChild(KB.dom("div").attr("class","text-editor").add(h).add(f).build())}}),document.addEventListener("DOMContentLoaded",function(){KB.render(),KB.listen()});var Kanboard={};Kanboard.App=function(){this.controllers={}},Kanboard.App.prototype.get=function(t){return this.controllers[t]},Kanboard.App.prototype.execute=function(){for(var t in Kanboard)if("App"!==t){var e=new Kanboard[t](this);this.controllers[t]=e,"function"==typeof e.execute&&e.execute(),"function"==typeof e.listen&&e.listen(),"function"==typeof e.focus&&e.focus(),"function"==typeof e.keyboardShortcuts&&e.keyboardShortcuts()}this.focus(),this.chosen(),this.keyboardShortcuts(),this.datePicker(),this.autoComplete(),this.tagAutoComplete()},Kanboard.App.prototype.keyboardShortcuts=function(){var t=this;Mousetrap.bindGlobal("mod+enter",function(){var e=$("form");1==e.length?e.submit():e.length>1&&("INPUT"===document.activeElement.tagName||"TEXTAREA"===document.activeElement.tagName?$(document.activeElement).parents("form").submit():t.get("Popover").isOpen()&&$("#popover-container form").submit())}),Mousetrap.bind("b",function(t){t.preventDefault(),$("#board-selector").trigger("chosen:open")}),Mousetrap.bindGlobal("esc",function(){t.get("Popover").close(),t.get("Dropdown").close()}),Mousetrap.bind("?",function(){t.get("Popover").open($("body").data("keyboard-shortcut-url"))})},Kanboard.App.prototype.focus=function(){$(document).on("focus",".auto-select",function(){$(this).select()}),$(document).on("mouseup",".auto-select",function(t){t.preventDefault()})},Kanboard.App.prototype.chosen=function(){$(".chosen-select").each(function(){var t=$(this).data("search-threshold");void 0===t&&(t=10),$(this).chosen({width:"180px",no_results_text:$(this).data("notfound"),disable_search_threshold:t})}),$(".select-auto-redirect").change(function(){var t=new RegExp($(this).data("redirect-regex"),"g");window.location=$(this).data("redirect-url").replace(t,$(this).val())})},Kanboard.App.prototype.datePicker=function(){var t=$("body"),e=t.data("js-date-format"),o=t.data("js-time-format"),a=t.data("js-lang");$.datepicker.setDefaults($.datepicker.regional[a]),$.timepicker.setDefaults($.timepicker.regional[a]),$(".form-date").datepicker({showOtherMonths:!0,selectOtherMonths:!0,dateFormat:e,constrainInput:!1}),$(".form-datetime").datetimepicker({dateFormat:e,timeFormat:o,constrainInput:!1})},Kanboard.App.prototype.tagAutoComplete=function(){$(".tag-autocomplete").select2({tags:!0})},Kanboard.App.prototype.autoComplete=function(){$(".autocomplete").each(function(){var t=$(this),e=t.data("dst-field"),o=t.data("dst-extra-field");""===$("#form-"+e).val()&&t.parent().find("button[type=submit]").attr("disabled","disabled"),t.autocomplete({source:t.data("search-url"),minLength:1,select:function(a,n){$("input[name="+e+"]").val(n.item.id),o&&$("input[name="+o+"]").val(n.item[o]),t.parent().find("button[type=submit]").removeAttr("disabled")}})})},Kanboard.App.prototype.hasId=function(t){return!!document.getElementById(t)},Kanboard.App.prototype.showLoadingIcon=function(){$("body").append('<span id="app-loading-icon"> <i class="fa fa-spinner fa-spin"></i></span>')},Kanboard.App.prototype.hideLoadingIcon=function(){$("#app-loading-icon").remove()},Kanboard.App.prototype.isVisible=function(){var t="";return"undefined"!=typeof document.hidden?t="visibilityState":"undefined"!=typeof document.mozHidden?t="mozVisibilityState":"undefined"!=typeof document.msHidden?t="msVisibilityState":"undefined"!=typeof document.webkitHidden&&(t="webkitVisibilityState"),""===t||"visible"==document[t]},Kanboard.BoardCollapsedMode=function(t){this.app=t},Kanboard.BoardCollapsedMode.prototype.keyboardShortcuts=function(){var t=this;t.app.hasId("board")&&Mousetrap.bind("s",function(){t.toggle()})},Kanboard.BoardCollapsedMode.prototype.toggle=function(){var t=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:$('.filter-display-mode:not([style="display: none;"]) a').attr("href"),success:function(e){$(".filter-display-mode").toggle(),t.app.get("BoardDragAndDrop").refresh(e)}})},Kanboard.BoardColumnView=function(t){this.app=t},Kanboard.BoardColumnView.prototype.execute=function(){this.app.hasId("board")&&this.render()},Kanboard.BoardColumnView.prototype.listen=function(){var t=this;$(document).on("click",".board-toggle-column-view",function(){t.toggle($(this).data("column-id"))})},Kanboard.BoardColumnView.prototype.onBoardRendered=function(){this.render()},Kanboard.BoardColumnView.prototype.render=function(){var t=this;$(".board-column-header").each(function(){var e=$(this).data("column-id");localStorage.getItem("hidden_column_"+e)&&t.hideColumn(e)})},Kanboard.BoardColumnView.prototype.toggle=function(t){localStorage.getItem("hidden_column_"+t)?this.showColumn(t):this.hideColumn(t)},Kanboard.BoardColumnView.prototype.hideColumn=function(t){$(".board-column-"+t+" .board-column-expanded").hide(),$(".board-column-"+t+" .board-column-collapsed").show(),$(".board-column-header-"+t+" .board-column-expanded").hide(),$(".board-column-header-"+t+" .board-column-collapsed").show(),$(".board-column-header-"+t).each(function(){$(this).removeClass("board-column-compact"),$(this).addClass("board-column-header-collapsed")}),$(".board-column-"+t).each(function(){$(this).addClass("board-column-task-collapsed")}),$(".board-column-"+t+" .board-rotation").each(function(){$(this).css("width",$(".board-column-"+t).height())}),localStorage.setItem("hidden_column_"+t,1)},Kanboard.BoardColumnView.prototype.showColumn=function(t){$(".board-column-"+t+" .board-column-expanded").show(),$(".board-column-"+t+" .board-column-collapsed").hide(),$(".board-column-header-"+t+" .board-column-expanded").show(),$(".board-column-header-"+t+" .board-column-collapsed").hide(),$(".board-column-header-"+t).removeClass("board-column-header-collapsed"),$(".board-column-"+t).removeClass("board-column-task-collapsed"),0==localStorage.getItem("horizontal_scroll")&&$(".board-column-header-"+t).addClass("board-column-compact"),localStorage.removeItem("hidden_column_"+t)},Kanboard.BoardHorizontalScrolling=function(t){this.app=t},Kanboard.BoardHorizontalScrolling.prototype.execute=function(){this.app.hasId("board")&&this.render()},Kanboard.BoardHorizontalScrolling.prototype.listen=function(){var t=this;$(document).on("click",".filter-toggle-scrolling",function(e){e.preventDefault(),t.toggle()})},Kanboard.BoardHorizontalScrolling.prototype.keyboardShortcuts=function(){var t=this;t.app.hasId("board")&&Mousetrap.bind("c",function(){t.toggle()})},Kanboard.BoardHorizontalScrolling.prototype.onBoardRendered=function(){this.render()},Kanboard.BoardHorizontalScrolling.prototype.toggle=function(){var t=localStorage.getItem("horizontal_scroll")||1;localStorage.setItem("horizontal_scroll",0==t?1:0),this.render()},Kanboard.BoardHorizontalScrolling.prototype.render=function(){0==localStorage.getItem("horizontal_scroll")?($(".filter-wide").show(),$(".filter-compact").hide(),$("#board-container").addClass("board-container-compact"),$("#board th:not(.board-column-header-collapsed)").addClass("board-column-compact")):($(".filter-wide").hide(),$(".filter-compact").show(),$("#board-container").removeClass("board-container-compact"),$("#board th").removeClass("board-column-compact"))},Kanboard.BoardPolling=function(t){this.app=t},Kanboard.BoardPolling.prototype.execute=function(){if(this.app.hasId("board")){var t=parseInt($("#board").attr("data-check-interval"));t>0&&window.setInterval(this.check.bind(this),1e3*t)}},Kanboard.BoardPolling.prototype.check=function(){if(this.app.isVisible()&&!this.app.get("BoardDragAndDrop").savingInProgress){var t=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:$("#board").data("check-url"),statusCode:{200:function(e){t.app.get("BoardDragAndDrop").refresh(e)},304:function(){t.app.hideLoadingIcon()}}})}},Kanboard.BoardTask=function(t){this.app=t},Kanboard.BoardTask.prototype.listen=function(){var t=this;$(document).on("click",".task-board-change-assignee",function(e){e.preventDefault(),e.stopPropagation(),t.app.get("Popover").open($(this).data("url"))}),$(document).on("click",".task-board",function(t){"A"!=t.target.tagName&&"IMG"!=t.target.tagName&&(window.location=$(this).data("task-url"))})},Kanboard.BoardTask.prototype.keyboardShortcuts=function(){var t=this;t.app.hasId("board")&&Mousetrap.bind("n",function(){t.app.get("Popover").open($("#board").data("task-creation-url"))})},Kanboard.Column=function(t){this.app=t},Kanboard.Column.prototype.listen=function(){this.dragAndDrop()},Kanboard.Column.prototype.dragAndDrop=function(){var t=this;$(".draggable-row-handle").mouseenter(function(){$(this).parent().parent().addClass("draggable-item-hover")}).mouseleave(function(){$(this).parent().parent().removeClass("draggable-item-hover")}),$(".columns-table tbody").sortable({forcePlaceholderSize:!0,handle:"td:first i",helper:function(t,e){return e.children().each(function(){$(this).width($(this).width())}),e},stop:function(e,o){var a=o.item;a.removeClass("draggable-item-selected"),t.savePosition(a.data("column-id"),a.index()+1)},start:function(t,e){e.item.addClass("draggable-item-selected")}}).disableSelection()},Kanboard.Column.prototype.savePosition=function(t,e){var o=$(".columns-table").data("save-position-url"),a=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:o,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({column_id:t,position:e}),complete:function(){a.app.hideLoadingIcon()}})},Kanboard.Dropdown=function(t){this.app=t},Kanboard.Dropdown.prototype.listen=function(){var t=this;$(document).on("click",function(){t.close()}),$(document).on("click","#popover-content",function(){t.close()}),$(document).on("click",".dropdown-menu",function(e){e.preventDefault(),e.stopImmediatePropagation(),t.close();var o=$(this).next("ul"),a=$(this).offset();$("body").append(jQuery("<div>",{id:"dropdown"})),o.clone().appendTo("#dropdown");var n=$("#dropdown ul");n.addClass("dropdown-submenu-open");var i=n.outerHeight(),r=n.outerWidth();a.top+i-$(window).scrollTop()<$(window).height()||$(window).scrollTop()+a.top<i?n.css("top",a.top+$(this).height()):n.css("top",a.top-i-5),a.left+r>$(window).width()?n.css("left",a.left-r+$(this).outerWidth()):n.css("left",a.left)}),$(document).on("click",".dropdown-submenu-open li",function(t){$(t.target).is("li")&&$(this).find("a:visible")[0].click()})},Kanboard.Dropdown.prototype.close=function(){$("#dropdown").remove()},Kanboard.Dropdown.prototype.onPopoverOpened=function(){this.close()},Kanboard.FileUpload=function(t){this.app=t,this.files=[],this.currentFile=0},Kanboard.FileUpload.prototype.onPopoverOpened=function(){var t=document.getElementById("file-dropzone"),e=this;t&&(t.ondragover=t.ondragenter=function(t){t.stopPropagation(),t.preventDefault()},t.ondrop=function(t){t.stopPropagation(),t.preventDefault(),e.files=t.dataTransfer.files,e.show(),$("#file-error-max-size").hide()},$(document).on("click","#file-browser",function(t){t.preventDefault(),$("#file-form-element").get(0).click()}),$(document).on("click","#file-upload-button",function(t){t.preventDefault(),e.currentFile=0,e.checkFiles()}),$("#file-form-element").change(function(){e.files=document.getElementById("file-form-element").files,e.show(),$("#file-error-max-size").hide()}))},Kanboard.FileUpload.prototype.show=function(){if($("#file-list").remove(),this.files.length>0){$("#file-upload-button").prop("disabled",!1),$("#file-dropzone-inner").hide();for(var t=jQuery("<ul>",{id:"file-list"}),e=0;e<this.files.length;e++){var o=jQuery("<span>",{id:"file-percentage-"+e}).append("(0%)"),a=jQuery("<progress>",{id:"file-progress-"+e,value:0}),n=jQuery("<li>",{id:"file-label-"+e}).append(a).append(" ").append(this.files[e].name).append(" ").append(o);t.append(n)}$("#file-dropzone").append(t)}else $("#file-dropzone-inner").show()},Kanboard.FileUpload.prototype.checkFiles=function(){for(var t=parseInt($("#file-dropzone").data("max-size")),e=0;e<this.files.length;e++)if(this.files[e].size>t)return $("#file-error-max-size").show(),$("#file-label-"+e).addClass("file-error"),void $("#file-upload-button").prop("disabled",!0);this.uploadFiles()},Kanboard.FileUpload.prototype.uploadFiles=function(){this.files.length>0&&this.uploadFile(this.files[this.currentFile])},Kanboard.FileUpload.prototype.uploadFile=function(t){var e=document.getElementById("file-dropzone"),o=e.dataset.url,a=new XMLHttpRequest,n=new FormData;a.upload.addEventListener("progress",this.updateProgress.bind(this)),a.upload.addEventListener("load",this.transferComplete.bind(this)),a.open("POST",o,!0),n.append("files[]",t),a.send(n)},Kanboard.FileUpload.prototype.updateProgress=function(t){t.lengthComputable&&($("#file-progress-"+this.currentFile).val(t.loaded/t.total),$("#file-percentage-"+this.currentFile).text("("+Math.floor(t.loaded/t.total*100)+"%)"))},Kanboard.FileUpload.prototype.transferComplete=function(){if(this.currentFile++,this.currentFile<this.files.length)this.uploadFile(this.files[this.currentFile]);else{var t=$("#file-upload-button");t.prop("disabled",!0),t.parent().hide(),$("#file-done").show()}},Kanboard.Gantt=function(t){this.app=t,this.data=[],this.options={container:"#gantt-chart",showWeekends:!0,allowMoves:!0,allowResizes:!0,cellWidth:21,cellHeight:31,slideWidth:1e3,vHeaderWidth:200}},Kanboard.Gantt.prototype.execute=function(){this.app.hasId("gantt-chart")&&this.show()},Kanboard.Gantt.prototype.saveRecord=function(t){this.app.showLoadingIcon(),$.ajax({cache:!1,url:$(this.options.container).data("save-url"),contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify(t),complete:this.app.hideLoadingIcon.bind(this)})},Kanboard.Gantt.prototype.show=function(){this.data=this.prepareData($(this.options.container).data("records"));var t=Math.floor(this.options.slideWidth/this.options.cellWidth+5),e=this.getDateRange(t),o=e[0],a=e[1],n=$(this.options.container),i=jQuery("<div>",{"class":"ganttview"});i.append(this.renderVerticalHeader()),i.append(this.renderSlider(o,a)),n.append(i),jQuery("div.ganttview-grid-row div.ganttview-grid-row-cell:last-child",n).addClass("last"),jQuery("div.ganttview-hzheader-days div.ganttview-hzheader-day:last-child",n).addClass("last"),jQuery("div.ganttview-hzheader-months div.ganttview-hzheader-month:last-child",n).addClass("last"),$(this.options.container).data("readonly")?(this.options.allowResizes=!1,this.options.allowMoves=!1):(this.listenForBlockResize(o),this.listenForBlockMove(o))},Kanboard.Gantt.prototype.renderVerticalHeader=function(){for(var t=jQuery("<div>",{"class":"ganttview-vtheader"}),e=jQuery("<div>",{"class":"ganttview-vtheader-item"}),o=jQuery("<div>",{"class":"ganttview-vtheader-series"}),a=0;a<this.data.length;a++){var n=jQuery("<span>").append(jQuery("<i>",{"class":"fa fa-info-circle tooltip",title:this.getVerticalHeaderTooltip(this.data[a])})).append(" ");"task"==this.data[a].type?n.append(jQuery("<a>",{href:this.data[a].link,title:this.data[a].title}).append(this.data[a].title)):n.append(jQuery("<a>",{href:this.data[a].board_link,title:$(this.options.container).data("label-board-link")}).append('<i class="fa fa-th"></i>')).append(" ").append(jQuery("<a>",{href:this.data[a].gantt_link,title:$(this.options.container).data("label-gantt-link")}).append('<i class="fa fa-sliders"></i>')).append(" ").append(jQuery("<a>",{href:this.data[a].link}).append(this.data[a].title)),o.append(jQuery("<div>",{"class":"ganttview-vtheader-series-name"}).append(n))}return e.append(o),t.append(e),t},Kanboard.Gantt.prototype.renderSlider=function(t,e){var o=jQuery("<div>",{"class":"ganttview-slide-container"}),a=this.getDates(t,e);return o.append(this.renderHorizontalHeader(a)),o.append(this.renderGrid(a)),o.append(this.addBlockContainers()),this.addBlocks(o,t),o},Kanboard.Gantt.prototype.renderHorizontalHeader=function(t){var e=jQuery("<div>",{"class":"ganttview-hzheader"}),o=jQuery("<div>",{"class":"ganttview-hzheader-months"}),a=jQuery("<div>",{"class":"ganttview-hzheader-days"}),n=0;for(var i in t)for(var r in t[i]){var s=t[i][r].length*this.options.cellWidth;n+=s,o.append(jQuery("<div>",{"class":"ganttview-hzheader-month",css:{width:s-1+"px"}}).append($.datepicker.regional[$("body").data("js-lang")].monthNames[r]+" "+i));for(var d in t[i][r])a.append(jQuery("<div>",{"class":"ganttview-hzheader-day"}).append(t[i][r][d].getDate()))}return o.css("width",n+"px"),a.css("width",n+"px"),e.append(o).append(a),e},Kanboard.Gantt.prototype.renderGrid=function(t){var e=jQuery("<div>",{"class":"ganttview-grid"}),o=jQuery("<div>",{"class":"ganttview-grid-row"});for(var a in t)for(var n in t[a])for(var i in t[a][n]){var r=jQuery("<div>",{"class":"ganttview-grid-row-cell"});this.options.showWeekends&&this.isWeekend(t[a][n][i])&&r.addClass("ganttview-weekend"),o.append(r)}var s=jQuery("div.ganttview-grid-row-cell",o).length*this.options.cellWidth;o.css("width",s+"px"),e.css("width",s+"px");for(var d=0;d<this.data.length;d++)e.append(o.clone());return e},Kanboard.Gantt.prototype.addBlockContainers=function(){for(var t=jQuery("<div>",{"class":"ganttview-blocks"}),e=0;e<this.data.length;e++)t.append(jQuery("<div>",{"class":"ganttview-block-container"}));return t},Kanboard.Gantt.prototype.addBlocks=function(t,e){for(var o=jQuery("div.ganttview-blocks div.ganttview-block-container",t),a=0,n=0;n<this.data.length;n++){var i=this.data[n],r=this.daysBetween(i.start,i.end)+1,s=this.daysBetween(e,i.start),d=jQuery("<div>",{"class":"ganttview-block-text"}),l=jQuery("<div>",{"class":"ganttview-block tooltip"+(this.options.allowMoves?" ganttview-block-movable":""),title:this.getBarTooltip(i),css:{width:r*this.options.cellWidth-9+"px","margin-left":s*this.options.cellWidth+"px" +}}).append(d);r>=2&&d.append(i.progress),l.data("record",i),this.setBarColor(l,i),jQuery(o[a]).append(l),a+=1}},Kanboard.Gantt.prototype.getVerticalHeaderTooltip=function(t){var e="";if("task"==t.type)e="<strong>"+t.column_title+"</strong> ("+t.progress+")<br/>"+t.title;else{var o=["project-manager","project-member"];for(var a in o){var n=o[a];if(!jQuery.isEmptyObject(t.users[n])){var i=jQuery("<ul>");for(var r in t.users[n])r&&i.append(jQuery("<li>").append(t.users[n][r]));e+="<p><strong>"+$(this.options.container).data("label-"+n)+"</strong></p>"+i[0].outerHTML}}}return e},Kanboard.Gantt.prototype.getBarTooltip=function(t){var e="";return t.not_defined?e=$(this.options.container).data("label-not-defined"):("task"==t.type&&(e="<strong>"+t.progress+"</strong><br/>"+$(this.options.container).data("label-assignee")+" "+(t.assignee?t.assignee:"")+"<br/>"),e+=$(this.options.container).data("label-start-date")+" "+$.datepicker.formatDate("yy-mm-dd",t.start)+"<br/>",e+=$(this.options.container).data("label-end-date")+" "+$.datepicker.formatDate("yy-mm-dd",t.end)),e},Kanboard.Gantt.prototype.setBarColor=function(t,e){e.not_defined?t.addClass("ganttview-block-not-defined"):(t.css("background-color",e.color.background),t.css("border-color",e.color.border),"0%"!=e.progress&&t.append(jQuery("<div>",{css:{"z-index":0,position:"absolute",top:0,bottom:0,"background-color":e.color.border,width:e.progress,opacity:.4}})))},Kanboard.Gantt.prototype.listenForBlockResize=function(t){var e=this;jQuery("div.ganttview-block",this.options.container).resizable({grid:this.options.cellWidth,handles:"e,w",delay:300,stop:function(){var o=jQuery(this);e.updateDataAndPosition(o,t),e.saveRecord(o.data("record"))}})},Kanboard.Gantt.prototype.listenForBlockMove=function(t){var e=this;jQuery("div.ganttview-block",this.options.container).draggable({axis:"x",delay:300,grid:[this.options.cellWidth,this.options.cellWidth],stop:function(){var o=jQuery(this);e.updateDataAndPosition(o,t),e.saveRecord(o.data("record"))}})},Kanboard.Gantt.prototype.updateDataAndPosition=function(t,e){var o=jQuery("div.ganttview-slide-container",this.options.container),a=o.scrollLeft(),n=t.offset().left-o.offset().left-1+a,i=t.data("record");i.not_defined=!1,this.setBarColor(t,i);var r=Math.round(n/this.options.cellWidth),s=this.addDays(this.cloneDate(e),r);i.start=s;var d=t.outerWidth(),l=Math.round(d/this.options.cellWidth)-1;i.end=this.addDays(this.cloneDate(s),l),"task"===i.type&&l>0&&jQuery("div.ganttview-block-text",t).text(i.progress),t.attr("title",this.getBarTooltip(i)),t.data("record",i),t.css("top","").css("left","").css("position","relative").css("margin-left",n+"px")},Kanboard.Gantt.prototype.getDates=function(t,e){var o=[];o[t.getFullYear()]=[],o[t.getFullYear()][t.getMonth()]=[t];for(var a=t;this.compareDate(a,e)==-1;){var n=this.addDays(this.cloneDate(a),1);o[n.getFullYear()]||(o[n.getFullYear()]=[]),o[n.getFullYear()][n.getMonth()]||(o[n.getFullYear()][n.getMonth()]=[]),o[n.getFullYear()][n.getMonth()].push(n),a=n}return o},Kanboard.Gantt.prototype.prepareData=function(t){for(var e=0;e<t.length;e++){var o=new Date(t[e].start[0],t[e].start[1]-1,t[e].start[2],0,0,0,0);t[e].start=o;var a=new Date(t[e].end[0],t[e].end[1]-1,t[e].end[2],0,0,0,0);t[e].end=a}return t},Kanboard.Gantt.prototype.getDateRange=function(t){for(var e=new Date,o=new Date,a=0;a<this.data.length;a++){var n=new Date;n.setTime(Date.parse(this.data[a].start));var i=new Date;i.setTime(Date.parse(this.data[a].end)),0==a&&(e=n,o=i),1==this.compareDate(e,n)&&(e=n),this.compareDate(o,i)==-1&&(o=i)}return this.daysBetween(e,o)<t&&(o=this.addDays(this.cloneDate(e),t)),e.setDate(e.getDate()-1),[e,o]},Kanboard.Gantt.prototype.daysBetween=function(t,e){if(!t||!e)return 0;for(var o=0,a=this.cloneDate(t);this.compareDate(a,e)==-1;)o+=1,this.addDays(a,1);return o},Kanboard.Gantt.prototype.isWeekend=function(t){return t.getDay()%6==0},Kanboard.Gantt.prototype.cloneDate=function(t){return new Date(t.getTime())},Kanboard.Gantt.prototype.addDays=function(t,e){return t.setDate(t.getDate()+1*e),t},Kanboard.Gantt.prototype.compareDate=function(t,e){if(isNaN(t)||isNaN(e))throw new Error(t+" - "+e);if(t instanceof Date&&e instanceof Date)return t<e?-1:t>e?1:0;throw new TypeError(t+" - "+e)},Kanboard.Notification=function(t){this.app=t},Kanboard.Notification.prototype.execute=function(){$(".alert-fade-out").delay(4e3).fadeOut(800,function(){$(this).remove()})},Kanboard.Popover=function(t){this.app=t},Kanboard.Popover.prototype.listen=function(){var t=this;$(document).on("click",".popover",function(e){t.onClick(e)}),$(document).on("click",".close-popover",function(e){t.close(e)}),$(document).on("click","#popover-close-button",function(e){t.close(e)}),$(document).on("click","#popover-content",function(t){t.stopPropagation()})},Kanboard.Popover.prototype.onClick=function(t){t.preventDefault(),t.stopPropagation();var e=t.currentTarget||t.target,o=e.getAttribute("href");o||(o=e.getAttribute("data-href")),o&&this.open(o)},Kanboard.Popover.prototype.isOpen=function(){return $("#popover-container").size()>0},Kanboard.Popover.prototype.open=function(t){var e=this;e.isOpen()||$.get(t,function(t){$("body").prepend('<div id="popover-container"><div id="popover-content"><div id="popover-content-header"><a href="#" id="popover-close-button"><i class="fa fa-times"></i></a></div>'+t+"</div></div>"),e.executeOnOpenedListeners()})},Kanboard.Popover.prototype.close=function(t){this.isOpen()&&(t&&t.preventDefault(),$("#popover-container").remove(),this.executeOnClosedListeners())},Kanboard.Popover.prototype.ajaxReload=function(t,e,o){var a=e.getResponseHeader("X-Ajax-Redirect");"self"===a?window.location.reload():a&&a.indexOf("#")>-1?window.location=a.split("#")[0]:a?window.location=a:($("#popover-content").html(t),$("#popover-content input[autofocus]").focus(),o.executeOnOpenedListeners())},Kanboard.Popover.prototype.executeOnOpenedListeners=function(){for(var t in this.app.controllers){var e=this.app.get(t);"function"==typeof e.onPopoverOpened&&e.onPopoverOpened()}this.afterOpen()},Kanboard.Popover.prototype.executeOnClosedListeners=function(){for(var t in this.app.controllers){var e=this.app.get(t);"function"==typeof e.onPopoverClosed&&e.onPopoverClosed()}},Kanboard.Popover.prototype.afterOpen=function(){var t=this,e=$("#popover-content .popover-form");e&&e.on("submit",function(o){o.preventDefault(),$.ajax({type:"POST",url:e.attr("action"),data:e.serialize(),success:function(e,o,a){t.ajaxReload(e,a,t)},beforeSend:function(){var t=$('.popover-form button[type="submit"]');t.html('<i class="fa fa-spinner fa-pulse"></i> '+t.html()),t.attr("disabled",!0)}})}),$(document).on("click",".popover-link",function(e){e.preventDefault(),$.ajax({type:"GET",url:$(this).attr("href"),success:function(e,o,a){t.ajaxReload(e,a,t)}})}),$("#popover-content input[autofocus]").each(function(){$(this).focus()}),this.app.datePicker(),this.app.autoComplete(),this.app.tagAutoComplete(),KB.render()},Kanboard.ProjectCreation=function(t){this.app=t},Kanboard.ProjectCreation.prototype.onPopoverOpened=function(){$("#project-creation-form #form-src_project_id").on("change",function(){var t=$(this).val();0==t?$(".project-creation-options").hide():$(".project-creation-options").show()})},Kanboard.ProjectPermission=function(t){this.app=t},Kanboard.ProjectPermission.prototype.listen=function(){$(".project-change-role").on("change",function(){$.ajax({cache:!1,url:$(this).data("url"),contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({id:$(this).data("id"),role:$(this).val()})})})},Kanboard.Screenshot=function(t){this.app=t,this.pasteCatcher=null},Kanboard.Screenshot.prototype.onPopoverOpened=function(){this.app.hasId("screenshot-zone")&&this.initialize()},Kanboard.Screenshot.prototype.initialize=function(){this.destroy(),window.Clipboard||(this.pasteCatcher=document.createElement("div"),this.pasteCatcher.id="screenshot-pastezone",this.pasteCatcher.contentEditable="true",this.pasteCatcher.style.opacity=0,this.pasteCatcher.style.position="fixed",this.pasteCatcher.style.top=0,this.pasteCatcher.style.right=0,this.pasteCatcher.style.width=0,document.body.insertBefore(this.pasteCatcher,document.body.firstChild),this.pasteCatcher.focus(),document.addEventListener("click",this.setFocus.bind(this)),document.getElementById("screenshot-zone").addEventListener("click",this.setFocus.bind(this))),window.addEventListener("paste",this.pasteHandler.bind(this))},Kanboard.Screenshot.prototype.destroy=function(){null!==this.pasteCatcher?document.body.removeChild(this.pasteCatcher):document.getElementById("screenshot-pastezone")&&document.body.removeChild(document.getElementById("screenshot-pastezone")),document.removeEventListener("click",this.setFocus.bind(this)),this.pasteCatcher=null},Kanboard.Screenshot.prototype.setFocus=function(){null!==this.pasteCatcher&&this.pasteCatcher.focus()},Kanboard.Screenshot.prototype.pasteHandler=function(t){if(t.clipboardData&&t.clipboardData.items){var e=t.clipboardData.items;if(e)for(var o=0;o<e.length;o++)if(e[o].type.indexOf("image")!==-1){var a=e[o].getAsFile(),n=new FileReader,i=this;n.onload=function(t){i.createImage(t.target.result)},n.readAsDataURL(a)}}else setTimeout(this.checkInput.bind(this),100)},Kanboard.Screenshot.prototype.checkInput=function(){var t=this.pasteCatcher.childNodes[0];t&&"IMG"===t.tagName&&this.createImage(t.src),this.pasteCatcher.innerHTML=""},Kanboard.Screenshot.prototype.createImage=function(t){var e=new Image;e.src=t,e.onload=function(){var e=t.split("base64,"),o=e[1];$("input[name=screenshot]").val(o)};var o=document.getElementById("screenshot-zone");o.innerHTML="",o.className="screenshot-pasted",o.appendChild(e),this.destroy(),this.initialize()},Kanboard.Search=function(t){this.app=t},Kanboard.Search.prototype.focus=function(){$(document).on("focus","#form-search",function(){var t=$("#form-search");if(t[0].setSelectionRange){var e=2*t.val().length;t[0].setSelectionRange(e,e)}})},Kanboard.Search.prototype.listen=function(){$(document).on("click",".filter-helper",function(t){t.preventDefault();var e=$(this).data("filter"),o=$(this).data("append-filter"),a=$(this).data("unique-filter"),n=$("#form-search");if(a){var i=a.substr(0,a.indexOf(":"));e=n.val().replace(new RegExp("("+i+":[#a-z0-9]+)","g"),""),e=e.replace(new RegExp("("+i+':"(.+)")',"g"),""),e=e.trim(),e+=" "+a}else o&&(e=n.val()+" "+o);n.val(e),$("form.search").submit()})},Kanboard.Search.prototype.goToView=function(t){var e=$(t);e.length&&(window.location=e.attr("href"))},Kanboard.Search.prototype.keyboardShortcuts=function(){var t=this;Mousetrap.bind("v o",function(){t.goToView(".view-overview")}),Mousetrap.bind("v b",function(){t.goToView(".view-board")}),Mousetrap.bind("v c",function(){t.goToView(".view-calendar")}),Mousetrap.bind("v l",function(){t.goToView(".view-listing")}),Mousetrap.bind("v g",function(){t.goToView(".view-gantt")}),Mousetrap.bind("f",function(t){t.preventDefault();var e=document.getElementById("form-search");e&&e.focus()}),Mousetrap.bind("r",function(t){t.preventDefault();var e=$(".filter-reset").data("filter"),o=$("#form-search");o.val(e),$("form.search").submit()})},Kanboard.Session=function(t){this.app=t},Kanboard.Session.prototype.execute=function(){window.setInterval(this.checkSession,6e4)},Kanboard.Session.prototype.checkSession=function(){$(".form-login").length||$.ajax({cache:!1,url:$("body").data("status-url"),statusCode:{401:function(){window.location=$("body").data("login-url")}}})},Kanboard.Subtask=function(t){this.app=t},Kanboard.Subtask.prototype.listen=function(){var t=this;this.dragAndDrop(),$(document).on("click",".subtask-toggle-status",function(e){var o=$(this);e.preventDefault(),$.ajax({cache:!1,url:o.attr("href"),success:function(e){o.hasClass("subtask-refresh-table")?$(".subtasks-table").replaceWith(e):o.replaceWith(e),t.dragAndDrop()}})}),$(document).on("click",".subtask-toggle-timer",function(e){var o=$(this);e.preventDefault(),$.ajax({cache:!1,url:o.attr("href"),success:function(e){$(".subtasks-table").replaceWith(e),t.dragAndDrop()}})})},Kanboard.Subtask.prototype.dragAndDrop=function(){var t=this;$(".draggable-row-handle").mouseenter(function(){$(this).parent().parent().addClass("draggable-item-hover")}).mouseleave(function(){$(this).parent().parent().removeClass("draggable-item-hover")}),$(".subtasks-table tbody").sortable({forcePlaceholderSize:!0,handle:"td:first i",helper:function(t,e){return e.children().each(function(){$(this).width($(this).width())}),e},stop:function(e,o){var a=o.item;a.removeClass("draggable-item-selected"),t.savePosition(a.data("subtask-id"),a.index()+1)},start:function(t,e){e.item.addClass("draggable-item-selected")}}).disableSelection()},Kanboard.Subtask.prototype.savePosition=function(t,e){var o=$(".subtasks-table").data("save-position-url"),a=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:o,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({subtask_id:t,position:e}),complete:function(){a.app.hideLoadingIcon()}})},Kanboard.Swimlane=function(t){this.app=t},Kanboard.Swimlane.prototype.execute=function(){$(".swimlanes-table").length&&this.dragAndDrop()},Kanboard.Swimlane.prototype.listen=function(){var t=this;$(document).on("click",".board-swimlane-toggle",function(e){e.preventDefault();var o=$(this).data("swimlane-id");t.isCollapsed(o)?t.expand(o):t.collapse(o)})},Kanboard.Swimlane.prototype.onBoardRendered=function(){for(var t=this.getAllCollapsed(),e=0;e<t.length;e++)this.collapse(t[e])},Kanboard.Swimlane.prototype.getStorageKey=function(){return"hidden_swimlanes_"+$("#board").data("project-id")},Kanboard.Swimlane.prototype.expand=function(t){var e=this.getAllCollapsed(),o=e.indexOf(t);o>-1&&e.splice(o,1),localStorage.setItem(this.getStorageKey(),JSON.stringify(e)),$(".board-swimlane-columns-"+t).css("display","table-row"),$(".board-swimlane-tasks-"+t).css("display","table-row"),$(".hide-icon-swimlane-"+t).css("display","inline"),$(".show-icon-swimlane-"+t).css("display","none")},Kanboard.Swimlane.prototype.collapse=function(t){var e=this.getAllCollapsed();e.indexOf(t)<0&&(e.push(t),localStorage.setItem(this.getStorageKey(),JSON.stringify(e))),$(".board-swimlane-columns-"+t+":not(:first-child)").css("display","none"),$(".board-swimlane-tasks-"+t).css("display","none"),$(".hide-icon-swimlane-"+t).css("display","none"),$(".show-icon-swimlane-"+t).css("display","inline")},Kanboard.Swimlane.prototype.isCollapsed=function(t){return this.getAllCollapsed().indexOf(t)>-1},Kanboard.Swimlane.prototype.getAllCollapsed=function(){return JSON.parse(localStorage.getItem(this.getStorageKey()))||[]},Kanboard.Swimlane.prototype.dragAndDrop=function(){var t=this;$(".draggable-row-handle").mouseenter(function(){$(this).parent().parent().addClass("draggable-item-hover")}).mouseleave(function(){$(this).parent().parent().removeClass("draggable-item-hover")}),$(".swimlanes-table tbody").sortable({forcePlaceholderSize:!0,handle:"td:first i",helper:function(t,e){return e.children().each(function(){$(this).width($(this).width())}),e},stop:function(e,o){var a=o.item;a.removeClass("draggable-item-selected"),t.savePosition(a.data("swimlane-id"),a.index()+1)},start:function(t,e){e.item.addClass("draggable-item-selected")}}).disableSelection()},Kanboard.Swimlane.prototype.savePosition=function(t,e){var o=$(".swimlanes-table").data("save-position-url"),a=this;this.app.showLoadingIcon(),$.ajax({cache:!1,url:o,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({swimlane_id:t,position:e}),complete:function(){a.app.hideLoadingIcon()}})},Kanboard.Task=function(t){this.app=t},Kanboard.Task.prototype.keyboardShortcuts=function(){var t=$("#task-view"),e=this;this.app.hasId("task-view")&&(Mousetrap.bind("e",function(){e.app.get("Popover").open(t.data("edit-url"))}),Mousetrap.bind("c",function(){e.app.get("Popover").open(t.data("comment-url"))}),Mousetrap.bind("s",function(){e.app.get("Popover").open(t.data("subtask-url"))}),Mousetrap.bind("l",function(){e.app.get("Popover").open(t.data("internal-link-url"))}))},Kanboard.Task.prototype.onPopoverOpened=function(){var t=this,e=0;t.renderColorPicker(),$(document).on("click",".assign-me",function(t){var e=$(this).data("current-id"),o="#"+$(this).data("target-id");t.preventDefault(),$(o+" option[value="+e+"]").length&&$(o).val(e)}),$(document).on("change","select.task-reload-project-destination",function(){if(e>0)$(this).val(e);else{e=$(this).val();var o=$(this).data("redirect").replace(/PROJECT_ID/g,e);$(".loading-icon").show(),$.ajax({type:"GET",url:o,success:function(o,a,n){e=0,$(".loading-icon").hide(),t.app.get("Popover").ajaxReload(o,n,t.app.get("Popover"))}})}})},Kanboard.Task.prototype.renderColorPicker=function(){function t(t){return $('<div class="color-picker-option"><div class="color-picker-square color-'+t.id+'"></div><div class="color-picker-label">'+t.text+"</div></div>")}$(".color-picker").select2({minimumResultsForSearch:1/0,templateResult:t,templateSelection:t})},Kanboard.Tooltip=function(t){this.app=t},Kanboard.Tooltip.prototype.onBoardRendered=function(){this.execute()},Kanboard.Tooltip.prototype.execute=function(){$(".tooltip").tooltip({track:!1,show:!1,hide:!1,position:{my:"left-20 top",at:"center bottom+9",using:function(t,e){$(this).css(t);var o=e.target.left+e.target.width/2-e.element.left-20;$("<div>").addClass("tooltip-arrow").addClass(e.vertical).addClass(o<1?"align-left":"align-right").appendTo(this)}},content:function(){var t=this,e=$(this).attr("data-href");return e?($.get(e,function(e){var o=$(".ui-tooltip:visible");$(".ui-tooltip-content:visible").html(e),o.css({top:"",left:""}),o.children(".tooltip-arrow").remove();var a=$(t).tooltip("option","position");a.of=$(t),o.position(a)}),'<i class="fa fa-spinner fa-spin"></i>'):'<div class="markdown">'+$(this).attr("title")+"</div>"}}).on("mouseenter",function(){var t=this;$(this).tooltip("open"),$(".ui-tooltip").on("mouseleave",function(){$(t).tooltip("close")})}).on("mouseleave focusout",function(t){t.stopImmediatePropagation();var e=this;setTimeout(function(){$(".ui-tooltip:hover").length||$(e).tooltip("close")},100)})},Kanboard.BoardDragAndDrop=function(t){this.app=t,this.savingInProgress=!1},Kanboard.BoardDragAndDrop.prototype.execute=function(){this.app.hasId("board")&&(this.dragAndDrop(),this.executeListeners())},Kanboard.BoardDragAndDrop.prototype.dragAndDrop=function(){var t=this,e=$(".board-task-list"),o={forcePlaceholderSize:!0,tolerance:"pointer",connectWith:".sortable-column",placeholder:"draggable-placeholder",items:".draggable-item",stop:function(e,o){var a=o.item,n=a.attr("data-task-id"),i=a.attr("data-position"),r=a.attr("data-column-id"),s=a.attr("data-swimlane-id"),d=a.parent().attr("data-column-id"),l=a.parent().attr("data-swimlane-id"),c=a.index()+1;a.removeClass("draggable-item-selected"),d==r&&l==s&&c==i||(t.changeTaskState(n),t.save(n,r,d,c,l))},start:function(t,e){e.item.addClass("draggable-item-selected"),e.placeholder.height(e.item.height())}};isMobile.any&&($(".task-board-sort-handle").css("display","inline"),o.handle=".task-board-sort-handle"),e.each(function(){$(this).css("min-height",$(this).parent().height())}),e.sortable(o)},Kanboard.BoardDragAndDrop.prototype.changeTaskState=function(t){var e=$("div[data-task-id="+t+"]");e.addClass("task-board-saving-state"),e.find(".task-board-saving-icon").show()},Kanboard.BoardDragAndDrop.prototype.save=function(t,e,o,a,n){var i=this;i.app.showLoadingIcon(),i.savingInProgress=!0,$.ajax({cache:!1,url:$("#board").data("save-url"),contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({task_id:t,src_column_id:e,dst_column_id:o,swimlane_id:n,position:a}),success:function(t){i.refresh(t),i.savingInProgress=!1},error:function(){i.app.hideLoadingIcon(),i.savingInProgress=!1},statusCode:{403:function(t){window.alert(t.responseJSON.message),document.location.reload(!0)}}})},Kanboard.BoardDragAndDrop.prototype.refresh=function(t){$("#board-container").replaceWith(t),this.app.hideLoadingIcon(),this.dragAndDrop(),this.executeListeners()},Kanboard.BoardDragAndDrop.prototype.executeListeners=function(){for(var t in this.app.controllers){var e=this.app.get(t);"function"==typeof e.onBoardRendered&&e.onBoardRendered()}};var _KB=null;jQuery(document).ready(function(){_KB=new Kanboard.App,_KB.execute()});
\ No newline at end of file diff --git a/assets/js/components/accordion.js b/assets/js/components/accordion.js index 518d0768..4588ccc6 100644 --- a/assets/js/components/accordion.js +++ b/assets/js/components/accordion.js @@ -3,6 +3,6 @@ KB.onClick('.accordion-toggle', function(e) { if (section) { KB.dom(section).toggleClass('accordion-collapsed'); - KB.dom(KB.dom(section).child('.accordion-content')).toggle(); + KB.dom(KB.dom(section).find('.accordion-content')).toggle(); } }); diff --git a/assets/js/components/submit-cancel.js b/assets/js/components/submit-cancel.js index 061b1146..ccb3c1d9 100644 --- a/assets/js/components/submit-cancel.js +++ b/assets/js/components/submit-cancel.js @@ -1,35 +1,52 @@ -Vue.component('submit-cancel', { - props: ['labelButton', 'labelOr', 'labelCancel', 'callback'], - template: '<div class="form-actions">' + - '<button type="button" class="btn btn-blue" @click="onSubmit" :disabled="isLoading">' + - '<span v-show="isLoading"><i class="fa fa-spinner fa-pulse"></i> </span>' + - '{{ labelButton }}' + - '</button> ' + - '{{ labelOr }} <a href="#" v-on:click.prevent="onCancel">{{ labelCancel }}</a>' + - '</div>' - , - data: function () { - return { - loading: false - }; - }, - computed: { - isLoading: function () { - return this.loading; - } - }, - methods: { - onSubmit: function () { - this.loading = true; - this.callback(); - }, - onCancel: function () { - _KB.get('Popover').close(); - } - }, - events: { - 'submitCancelled': function() { - this.loading = false; +KB.component('submit-cancel', function (containerElement, options) { + var isLoading = false; + + function onSubmit() { + isLoading = true; + KB.find('#modal-submit-button').replace(buildButton()); + KB.trigger('modal.submit'); + } + + function onCancel() { + KB.trigger('modal.cancel'); + _KB.get('Popover').close(); + } + + function onStop() { + isLoading = false; + KB.find('#modal-submit-button').replace(buildButton()); + } + + function buildButton() { + var button = KB.dom('button') + .click(onSubmit) + .attr('id', 'modal-submit-button') + .attr('type', 'submit') + .attr('class', 'btn btn-blue'); + + if (isLoading) { + button + .disable() + .add(KB.dom('i').attr('class', 'fa fa-spinner fa-pulse').build()) + .text(' ') + ; } + + return button + .text(options.submitLabel) + .build(); } + + this.render = function () { + KB.on('modal.stop', onStop); + + var element = KB.dom('div') + .attr('class', 'form-actions') + .add(buildButton()) + .text(' ' + options.orLabel + ' ') + .add(KB.dom('a').attr('href', '#').click(onCancel).text(options.cancelLabel).build()) + .build(); + + containerElement.appendChild(element); + }; }); diff --git a/assets/js/components/task-move-position.js b/assets/js/components/task-move-position.js index 11e1068c..5e559713 100644 --- a/assets/js/components/task-move-position.js +++ b/assets/js/components/task-move-position.js @@ -1,86 +1,164 @@ -Vue.component('task-move-position', { - props: ['board', 'saveUrl'], - template: '#template-task-move-position', - data: function () { - return { - swimlaneId: 0, - columnId: 0, - position: 1, - columns: [], - tasks: [], - positionChoice: 'before', - errorMessage: '' +KB.component('task-move-position', function (containerElement, options) { + + function getSelectedValue(id) { + var element = KB.dom(document).find('#' + id); + + if (element) { + return parseInt(element.options[element.selectedIndex].value); } - }, - ready: function () { - this.columns = this.board[0].columns; - this.columnId = this.columns[0].id; - this.tasks = this.columns[0].tasks; - this.errorMessage = ''; - }, - methods: { - onChangeSwimlane: function () { - var self = this; - this.columnId = 0; - this.position = 1; - this.columns = []; - this.tasks = []; - this.positionChoice = 'before'; - - this.board.forEach(function(swimlane) { - if (swimlane.id === self.swimlaneId) { - self.columns = swimlane.columns; - self.tasks = self.columns[0].tasks; - self.columnId = self.columns[0].id; - } - }); - }, - onChangeColumn: function () { - var self = this; - this.position = 1; - this.tasks = []; - this.positionChoice = 'before'; - - this.columns.forEach(function(column) { - if (column.id == self.columnId) { - self.tasks = column.tasks; - - if (self.tasks.length > 0) { - self.position = parseInt(self.tasks[0]['position']); - } - } - }); - }, - onSubmit: function () { - var self = this; - - if (this.positionChoice == 'after') { - this.position++; + + return null; + } + + function getSwimlaneId() { + var swimlaneId = getSelectedValue('form-swimlanes'); + return swimlaneId === null ? options.board[0].id : swimlaneId; + } + + function getColumnId() { + var columnId = getSelectedValue('form-columns'); + return columnId === null ? options.board[0].columns[0].id : columnId; + } + + function getPosition() { + var position = getSelectedValue('form-position'); + return position === null ? 1 : position; + } + + function getPositionChoice() { + var element = KB.find('input[name=positionChoice]:checked'); + + if (element) { + return element.value; + } + + return 'before'; + } + + function onSwimlaneChanged() { + var columnSelect = KB.dom(document).find('#form-columns'); + KB.dom(columnSelect).replace(buildColumnSelect()); + + var taskSection = KB.dom(document).find('#form-tasks'); + KB.dom(taskSection).replace(buildTasks()); + } + + function onColumnChanged() { + var taskSection = KB.dom(document).find('#form-tasks'); + KB.dom(taskSection).replace(buildTasks()); + } + + function onError(message) { + KB.trigger('modal.stop'); + + KB.find('#message-container') + .replace(KB.dom('div') + .attr('id', 'message-container') + .attr('class', 'alert alert-error') + .text(message) + .build() + ); + } + + function onSubmit() { + var position = getPosition(); + var positionChoice = getPositionChoice(); + + if (positionChoice === 'after') { + position++; + } + + KB.find('#message-container').replace(KB.dom('div').attr('id', 'message-container').build()); + + KB.http.postJson(options.saveUrl, { + "column_id": getColumnId(), + "swimlane_id": getSwimlaneId(), + "position": position + }).success(function () { + window.location.reload(true); + }).error(function (response) { + if (response) { + onError(response.message); } + }); + } + + function buildSwimlaneSelect() { + var swimlanes = []; + + options.board.forEach(function(swimlane) { + swimlanes.push({'value': swimlane.id, 'text': swimlane.name}); + }); + + return KB.dom('select') + .attr('id', 'form-swimlanes') + .change(onSwimlaneChanged) + .for('option', swimlanes) + .build(); + } + + function buildColumnSelect() { + var columns = []; + var swimlaneId = getSwimlaneId(); - $.ajax({ - cache: false, - url: this.saveUrl, - contentType: "application/json", - type: "POST", - processData: false, - data: JSON.stringify({ - "column_id": this.columnId, - "swimlane_id": this.swimlaneId, - "position": this.position - }), - statusCode: { - 200: function() { - window.location.reload(true); - }, - 403: function(jqXHR) { - var response = JSON.parse(jqXHR.responseText); - self.errorMessage = response.message; - - self.$broadcast('submitCancelled'); + options.board.forEach(function(swimlane) { + if (swimlaneId === swimlane.id) { + swimlane.columns.forEach(function(column) { + columns.push({'value': column.id, 'text': column.title}); + }); + } + }); + + return KB.dom('select') + .attr('id', 'form-columns') + .change(onColumnChanged) + .for('option', columns) + .build(); + } + + function buildTasks() { + var tasks = []; + var swimlaneId = getSwimlaneId(); + var columnId = getColumnId(); + var container = KB.dom('div').attr('id', 'form-tasks'); + + options.board.forEach(function(swimlane) { + if (swimlaneId === swimlane.id) { + swimlane.columns.forEach(function(column) { + if (columnId === column.id) { + column.tasks.forEach(function(task) { + tasks.push({'value': task.position, 'text': '#' + task.id + ' - ' + task.title}); + }); } - } - }); + }); + } + }); + + if (tasks.length > 0) { + container + .add(KB.html.label(options.positionLabel, 'form-position')) + .add(KB.dom('select').attr('id', 'form-position').for('option', tasks).build()) + .add(KB.html.radio(options.beforeLabel, 'positionChoice', 'before')) + .add(KB.html.radio(options.afterLabel, 'positionChoice', 'after')) + ; } + + return container.build(); } + + this.render = function () { + KB.on('modal.submit', onSubmit); + + var form = KB.dom('div') + .on('submit', onSubmit) + .add(KB.dom('div').attr('id', 'message-container').build()) + .add(KB.html.label(options.swimlaneLabel, 'form-swimlanes')) + .add(buildSwimlaneSelect()) + .add(KB.html.label(options.columnLabel, 'form-columns')) + .add(buildColumnSelect()) + .add(buildTasks()) + .build(); + + containerElement.appendChild(form); + }; }); diff --git a/assets/js/components/text-editor.js b/assets/js/components/text-editor.js index 5268bc4d..2bf8109e 100644 --- a/assets/js/components/text-editor.js +++ b/assets/js/components/text-editor.js @@ -51,8 +51,8 @@ KB.component('text-editor', function (containerElement, options) { .attr('tabindex', options.tabindex || '-1') .attr('required', options.required || false) .attr('autofocus', options.autofocus || null) - .attr('placeholder', options.placeholder || '') - .text(options.text) + .text(options.text) // Order is important for IE11 + .attr('placeholder', options.placeholder || null) .build(); return KB.dom('div') @@ -124,7 +124,7 @@ KB.component('text-editor', function (containerElement, options) { document.execCommand('ms-beginUndoUnit'); } catch (error) {} - textarea.value = replaceTextRange(text, textarea.selectionStart, textarea.selectionEnd, replacedText); + textarea.value = replaceTextRange(textarea.value, textarea.selectionStart, textarea.selectionEnd, replacedText); try { document.execCommand('ms-endUndoUnit'); diff --git a/assets/js/core/base.js b/assets/js/core/base.js new file mode 100644 index 00000000..7346575c --- /dev/null +++ b/assets/js/core/base.js @@ -0,0 +1,70 @@ +var KB = { + components: {}, + utils: {}, + html: {}, + http: {}, + listeners: { + clicks: {}, + internals: {} + } +}; + +KB.on = function (eventType, callback) { + if (! this.listeners.internals.hasOwnProperty(eventType)) { + this.listeners.internals[eventType] = []; + } + + this.listeners.internals[eventType].push(callback); +}; + +KB.trigger = function (eventType, eventData) { + if (this.listeners.internals.hasOwnProperty(eventType)) { + for (var i = 0; i < this.listeners.internals[eventType].length; i++) { + if (! this.listeners.internals[eventType][i](eventData)) { + break; + } + } + } +}; + +KB.onClick = function (selector, callback) { + this.listeners.clicks[selector] = callback; +}; + +KB.listen = function () { + var self = this; + + function onClick(e) { + for (var selector in self.listeners.clicks) { + if (self.listeners.clicks.hasOwnProperty(selector) && e.target.matches(selector)) { + e.preventDefault(); + self.listeners.clicks[selector](e); + } + } + } + + document.addEventListener('click', onClick, false); +}; + +KB.component = function (name, object) { + this.components[name] = object; +}; + +KB.getComponent = function (name, containerElement, options) { + var object = this.components[name]; + return new object(containerElement, options); +}; + +KB.render = function () { + for (var name in this.components) { + var elementList = document.querySelectorAll('.js-' + name); + + for (var i = 0; i < elementList.length; i++) { + if (this.components.hasOwnProperty(name)) { + var component = KB.getComponent(name, elementList[i], JSON.parse(elementList[i].dataset.params)); + component.render(); + elementList[i].className = elementList[i].className + '-rendered'; + } + } + } +}; diff --git a/assets/js/core/dom.js b/assets/js/core/dom.js index 821a1d2f..33039285 100644 --- a/assets/js/core/dom.js +++ b/assets/js/core/dom.js @@ -1,4 +1,3 @@ - KB.dom = function (tag) { function DomManipulation(tag) { @@ -31,19 +30,33 @@ KB.dom = function (tag) { return this; }; - this.click = function (callback) { - element.onclick = function (e) { + this.on = function (eventName, callback) { + element.addEventListener(eventName, function (e) { e.preventDefault(); - callback(); - }; + callback(e.target); + }); + return this; }; + this.click = function (callback) { + return this.on('click', callback); + }; + + this.change = function (callback) { + return this.on('change', callback); + }; + this.add = function (node) { element.appendChild(node); return this; }; + this.replace = function (node) { + element.parentNode.replaceChild(node, element); + return this; + }; + this.html = function (html) { element.innerHTML = html; return this; @@ -73,6 +86,16 @@ KB.dom = function (tag) { return element.classList.contains(className); }; + this.disable = function () { + element.disabled = true; + return this; + }; + + this.enable = function () { + element.disabled = false; + return this; + }; + this.parent = function (selector) { for (; element && element !== document; element = element.parentNode) { if (element.matches(selector)) { @@ -83,7 +106,7 @@ KB.dom = function (tag) { return null; }; - this.child = function (selector) { + this.find = function (selector) { return element.querySelector(selector); }; @@ -118,3 +141,13 @@ KB.dom = function (tag) { return new DomManipulation(tag); }; + +KB.find = function (selector) { + var element = document.querySelector(selector); + + if (element) { + return KB.dom(element); + } + + return null; +}; diff --git a/assets/js/core/html.js b/assets/js/core/html.js new file mode 100644 index 00000000..f49a629c --- /dev/null +++ b/assets/js/core/html.js @@ -0,0 +1,25 @@ +KB.html.label = function (label, id) { + return KB.dom('label').attr('for', id).text(label).build(); +}; + +KB.html.radio = function (label, name, value) { + return KB.dom('label') + .add(KB.dom('input') + .attr('type', 'radio') + .attr('name', name) + .attr('value', value) + .build() + ) + .text(label) + .build(); +}; + +KB.html.radios = function (items) { + var html = KB.dom('div'); + + for (var item in items) { + if (items.hasOwnProperty(item)) { + html.add(KB.html.radio(item.label, item.name, item.value)); + } + } +}; diff --git a/assets/js/core/http.js b/assets/js/core/http.js new file mode 100644 index 00000000..b965ad23 --- /dev/null +++ b/assets/js/core/http.js @@ -0,0 +1,66 @@ +KB.http.request = function (method, url, headers, body) { + var successCallback = function() {}; + var errorCallback = function() {}; + + function parseResponse(request) { + try { + return JSON.parse(request.responseText); + } catch (e) { + return request.responseText; + } + } + + this.execute = function () { + var request = new XMLHttpRequest(); + request.open(method, url, true); + request.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + + for (var header in headers) { + if (headers.hasOwnProperty(header)) { + request.setRequestHeader(header, headers[header]); + } + } + + request.onerror = function() { + errorCallback(); + }; + + request.onreadystatechange = function() { + if (request.readyState === XMLHttpRequest.DONE) { + var response = parseResponse(request); + + if (request.status === 200) { + successCallback(response); + } else { + errorCallback(response); + } + } + }; + + request.send(body); + return this; + }; + + this.success = function (callback) { + successCallback = callback; + return this; + }; + + this.error = function (callback) { + errorCallback = callback; + return this; + }; +}; + +KB.http.get = function (url) { + return (new KB.http.request('GET', url)).execute(); +}; + +KB.http.postJson = function (url, body) { + var headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }; + + return (new KB.http.request('POST', url, headers, JSON.stringify(body))).execute(); +}; diff --git a/assets/js/core/kb.js b/assets/js/core/kb.js deleted file mode 100644 index 8ed0e41c..00000000 --- a/assets/js/core/kb.js +++ /dev/null @@ -1,58 +0,0 @@ -var KB = { - components: {}, - utils: {}, - clickEvents: {} -}; - -KB.onClick = function (selector, callback) { - this.clickEvents[selector] = callback; -}; - -KB.listen = function () { - var self = this; - - function onClick(e) { - for (var selector in self.clickEvents) { - if (self.clickEvents.hasOwnProperty(selector) && e.target.matches(selector)) { - e.preventDefault(); - self.clickEvents[selector](e); - } - } - } - - document.addEventListener('click', onClick, false); -}; - -KB.component = function (name, object) { - this.components[name] = object; -}; - -KB.render = function () { - for (var name in this.components) { - var elementList = document.querySelectorAll('.js-' + name); - - for (var i = 0; i < elementList.length; i++) { - if (this.components.hasOwnProperty(name)) { - var object = this.components[name]; - var component = new object(elementList[i], JSON.parse(elementList[i].dataset.params)); - - component.render(); - elementList[i].className = elementList[i].className + '-rendered'; - } - } - } -}; - -KB.utils.formatDuration = function (d) { - if (d >= 86400) { - return Math.round(d/86400) + "d"; - } - else if (d >= 3600) { - return Math.round(d/3600) + "h"; - } - else if (d >= 60) { - return Math.round(d/60) + "m"; - } - - return d + "s"; -}; diff --git a/assets/js/core/utils.js b/assets/js/core/utils.js new file mode 100644 index 00000000..7d631526 --- /dev/null +++ b/assets/js/core/utils.js @@ -0,0 +1,13 @@ +KB.utils.formatDuration = function (d) { + if (d >= 86400) { + return Math.round(d/86400) + "d"; + } + else if (d >= 3600) { + return Math.round(d/3600) + "h"; + } + else if (d >= 60) { + return Math.round(d/60) + "m"; + } + + return d + "s"; +}; diff --git a/assets/js/polyfills/matches.js b/assets/js/polyfills/matches.js new file mode 100644 index 00000000..a6f813bf --- /dev/null +++ b/assets/js/polyfills/matches.js @@ -0,0 +1,14 @@ +if (!Element.prototype.matches) { + Element.prototype.matches = + Element.prototype.matchesSelector || + Element.prototype.mozMatchesSelector || + Element.prototype.msMatchesSelector || + Element.prototype.oMatchesSelector || + Element.prototype.webkitMatchesSelector || + function(s) { + var matches = (this.document || this.ownerDocument).querySelectorAll(s), + i = matches.length; + while (--i >= 0 && matches.item(i) !== this) {} + return i > -1; + }; +} diff --git a/assets/js/src/Popover.js b/assets/js/src/Popover.js index 6e487efa..ab71505a 100644 --- a/assets/js/src/Popover.js +++ b/assets/js/src/Popover.js @@ -157,9 +157,5 @@ Kanboard.Popover.prototype.afterOpen = function() { this.app.autoComplete(); this.app.tagAutoComplete(); - new Vue({ - el: '#popover-container' - }); - KB.render(); }; diff --git a/assets/js/vendor.min.js b/assets/js/vendor.min.js index bd070d46..2f29db5e 100644 --- a/assets/js/vendor.min.js +++ b/assets/js/vendor.min.js @@ -1892,9 +1892,4 @@ SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",a),this._y=b},SV * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ -(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].split(/ *\| */)}this.tokens.push(item);continue}if(cap=this.rules.lheading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[2]==="="?1:2,text:cap[1]});continue}if(cap=this.rules.hr.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"hr"});continue}if(cap=this.rules.blockquote.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"blockquote_start"});cap=cap[0].replace(/^ *> ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i<l;i++){item=cap[i];space=item.length;item=item.replace(/^ *([*+-]|\d+\.) +/,"");if(~item.indexOf("\n ")){space-=item.length;item=!this.options.pedantic?item.replace(new RegExp("^ {1,"+space+"}","gm"),""):item.replace(/^ {1,4}/gm,"")}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(cap[i+1])[0];if(bull!==b&&!(bull.length>1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */)}this.tokens.push(item);continue}if(top&&(cap=this.rules.paragraph.exec(src))){src=src.substring(cap[0].length);this.tokens.push({type:"paragraph",text:cap[1].charAt(cap[1].length-1)==="\n"?cap[1].slice(0,-1):cap[1]});continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"text",text:cap[0]});continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return this.tokens};var inline={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};inline._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;inline._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^<a /i.test(cap[0])){this.inLink=true}else if(this.inLink&&/^<\/a>/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i<l;i++){ch=text.charCodeAt(i);if(Math.random()>.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"<pre><code>"+(escaped?code:escape(code,true))+"\n</code></pre>"}return'<pre><code class="'+this.options.langPrefix+escape(lang,true)+'">'+(escaped?code:escape(code,true))+"\n</code></pre>\n"};Renderer.prototype.blockquote=function(quote){return"<blockquote>\n"+quote+"</blockquote>\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"<h"+level+' id="'+this.options.headerPrefix+raw.toLowerCase().replace(/[^\w]+/g,"-")+'">'+text+"</h"+level+">\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"</"+type+">\n"};Renderer.prototype.listitem=function(text){return"<li>"+text+"</li>\n"};Renderer.prototype.paragraph=function(text){return"<p>"+text+"</p>\n"};Renderer.prototype.table=function(header,body){return"<table>\n"+"<thead>\n"+header+"</thead>\n"+"<tbody>\n"+body+"</tbody>\n"+"</table>\n"};Renderer.prototype.tablerow=function(content){return"<tr>\n"+content+"</tr>\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"</"+type+">\n"};Renderer.prototype.strong=function(text){return"<strong>"+text+"</strong>"};Renderer.prototype.em=function(text){return"<em>"+text+"</em>"};Renderer.prototype.codespan=function(text){return"<code>"+text+"</code>"};Renderer.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"};Renderer.prototype.del=function(text){return"<del>"+text+"</del>"};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='<a href="'+href+'"';if(title){out+=' title="'+title+'"'}out+=">"+text+"</a>";return out};Renderer.prototype.image=function(href,title,text){var out='<img src="'+href+'" alt="'+text+'"';if(title){out+=' title="'+title+'"'}out+=this.options.xhtml?"/>":">";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i<this.token.header.length;i++){flags={header:true,align:this.token.align[i]};cell+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]})}header+=this.renderer.tablerow(cell);for(i=0;i<this.token.cells.length;i++){row=this.token.cells[i];cell="";for(j=0;j<row.length;j++){cell+=this.renderer.tablecell(this.inline.output(row[j]),{header:false,align:this.token.align[j]})}body+=this.renderer.tablerow(cell)}return this.renderer.table(header,body)}case"blockquote_start":{var body="";while(this.next().type!=="blockquote_end"){body+=this.tok()}return this.renderer.blockquote(body)}case"list_start":{var body="",ordered=this.token.ordered;while(this.next().type!=="list_end"){body+=this.tok()}return this.renderer.list(body,ordered)}case"list_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.token.type==="text"?this.parseText():this.tok()}return this.renderer.listitem(body)}case"loose_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.tok()}return this.renderer.listitem(body)}case"html":{var html=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(html)}case"paragraph":{return this.renderer.paragraph(this.inline.output(this.token.text))}case"text":{return this.renderer.paragraph(this.parseText())}}};function escape(html,encode){return html.replace(!encode?/&(?!#?\w+;)/g:/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;i<arguments.length;i++){target=arguments[i];for(key in target){if(Object.prototype.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj}function marked(src,opt,callback){if(callback||typeof opt==="function"){if(!callback){callback=opt;opt=null}opt=merge({},marked.defaults,opt||{});var highlight=opt.highlight,tokens,pending,i=0;try{tokens=Lexer.lex(src,opt)}catch(e){return callback(e)}pending=tokens.length;var done=function(err){if(err){opt.highlight=highlight;return callback(err)}var out;try{out=Parser.parse(tokens,opt)}catch(e){err=e}opt.highlight=highlight;return err?callback(err):callback(null,out)};if(!highlight||highlight.length<3){return done()}delete opt.highlight;if(!pending)return done();for(;i<tokens.length;i++){(function(token){if(token.type!=="code"){return--pending||done()}return highlight(token.text,token.lang,function(err,code){if(err)return done(err);if(code==null||code===token.text){return--pending||done()}token.text=code;token.escaped=true;--pending||done()})})(tokens[i])}return}try{if(opt)opt=merge({},marked.defaults,opt);return Parser.parse(Lexer.lex(src,opt),opt)}catch(e){e.message+="\nPlease report this to https://github.com/chjj/marked.";if((opt||marked.defaults).silent){return"<p>An error occured:</p><pre>"+escape(e.message+"",true)+"</pre>"}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";function e(t,r,i){if(n(t,r))return void(t[r]=i);if(t._isVue)return void e(t._data,r,i);var a=t.__ob__;if(!a)return void(t[r]=i);if(a.convert(r,i),a.dep.notify(),a.vms)for(var o=a.vms.length;o--;){var s=a.vms[o];s._proxy(r),s._digest()}return i}function t(e,t){if(n(e,t)){delete e[t];var r=e.__ob__;if(!r)return void(e._isVue&&(delete e._data[t],e._digest()));if(r.dep.notify(),r.vms)for(var i=r.vms.length;i--;){var a=r.vms[i];a._unproxy(t),a._digest()}}}function n(e,t){return $n.call(e,t)}function r(e){return An.test(e)}function i(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function a(e){return null==e?"":e.toString()}function o(e){if("string"!=typeof e)return e;var t=Number(e);return isNaN(t)?e:t}function s(e){return"true"===e?!0:"false"===e?!1:e}function l(e){var t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t!==n||34!==t&&39!==t?e:e.slice(1,-1)}function u(e){return e.replace(Nn,c)}function c(e,t){return t?t.toUpperCase():""}function p(e){return e.replace(Ln,"$1-$2").toLowerCase()}function h(e){return e.replace(In,c)}function f(e,t){return function(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}}function d(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function v(e,t){for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function m(e){return null!==e&&"object"==typeof e}function y(e){return Pn.call(e)===jn}function g(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function b(e,t){var n,r,i,a,o,s=function l(){var s=Date.now()-a;t>s&&s>=0?n=setTimeout(l,t-s):(n=null,o=e.apply(i,r),n||(i=r=null))};return function(){return i=this,r=arguments,a=Date.now(),n||(n=setTimeout(s,t)),o}}function _(e,t){for(var n=e.length;n--;)if(e[n]===t)return n;return-1}function x(e){var t=function n(){return n.cancelled?void 0:e.apply(this,arguments)};return t.cancel=function(){t.cancelled=!0},t}function w(e,t){return e==t||(m(e)&&m(t)?JSON.stringify(e)===JSON.stringify(t):!1)}function k(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap=Object.create(null)}function S(){var e,t=nr.slice(lr,or).trim();if(t){e={};var n=t.match(vr);e.name=n[0],n.length>1&&(e.args=n.slice(1).map(C))}e&&(rr.filters=rr.filters||[]).push(e),lr=or+1}function C(e){if(mr.test(e))return{value:o(e),dynamic:!1};var t=l(e),n=t===e;return{value:n?e:t,dynamic:n}}function E(e){var t=dr.get(e);if(t)return t;for(nr=e,ur=cr=!1,pr=hr=fr=0,lr=0,rr={},or=0,sr=nr.length;sr>or;or++)if(ar=ir,ir=nr.charCodeAt(or),ur)39===ir&&92!==ar&&(ur=!ur);else if(cr)34===ir&&92!==ar&&(cr=!cr);else if(124===ir&&124!==nr.charCodeAt(or+1)&&124!==nr.charCodeAt(or-1))null==rr.expression?(lr=or+1,rr.expression=nr.slice(0,or).trim()):S();else switch(ir){case 34:cr=!0;break;case 39:ur=!0;break;case 40:fr++;break;case 41:fr--;break;case 91:hr++;break;case 93:hr--;break;case 123:pr++;break;case 125:pr--}return null==rr.expression?rr.expression=nr.slice(0,or).trim():0!==lr&&S(),dr.put(e,rr),rr}function O(e){return e.replace(gr,"\\$&")}function $(){var e=O(Er.delimiters[0]),t=O(Er.delimiters[1]),n=O(Er.unsafeDelimiters[0]),r=O(Er.unsafeDelimiters[1]);_r=new RegExp(n+"((?:.|\\n)+?)"+r+"|"+e+"((?:.|\\n)+?)"+t,"g"),xr=new RegExp("^"+n+"((?:.|\\n)+?)"+r+"$"),br=new k(1e3)}function A(e){br||$();var t=br.get(e);if(t)return t;if(!_r.test(e))return null;for(var n,r,i,a,o,s,l=[],u=_r.lastIndex=0;n=_r.exec(e);)r=n.index,r>u&&l.push({value:e.slice(u,r)}),i=xr.test(n[0]),a=i?n[1]:n[2],o=a.charCodeAt(0),s=42===o,a=s?a.slice(1):a,l.push({tag:!0,value:a.trim(),html:i,oneTime:s}),u=r+n[0].length;return u<e.length&&l.push({value:e.slice(u)}),br.put(e,l),l}function N(e,t){return e.length>1?e.map(function(e){return L(e,t)}).join("+"):L(e[0],t,!0)}function L(e,t,n){return e.tag?e.oneTime&&t?'"'+t.$eval(e.value)+'"':I(e.value,n):'"'+e.value+'"'}function I(e,t){if(wr.test(e)){var n=E(e);return n.filters?"this._applyFilters("+n.expression+",null,"+JSON.stringify(n.filters)+",false)":"("+e+")"}return t?e:"("+e+")"}function P(e,t,n,r){F(e,1,function(){t.appendChild(e)},n,r)}function j(e,t,n,r){F(e,1,function(){V(e,t)},n,r)}function T(e,t,n){F(e,-1,function(){W(e)},t,n)}function F(e,t,n,r,i){var a=e.__v_trans;if(!a||!a.hooks&&!Jn||!r._isCompiled||r.$parent&&!r.$parent._isCompiled)return n(),void(i&&i());var o=t>0?"enter":"leave";a[o](n,i)}function D(e){if("string"==typeof e){e=document.querySelector(e)}return e}function R(e){if(!e)return!1;var t=e.ownerDocument.documentElement,n=e.parentNode;return t===e||t===n||!(!n||1!==n.nodeType||!t.contains(n))}function B(e,t){var n=e.getAttribute(t);return null!==n&&e.removeAttribute(t),n}function U(e,t){var n=B(e,":"+t);return null===n&&(n=B(e,"v-bind:"+t)),n}function M(e,t){return e.hasAttribute(t)||e.hasAttribute(":"+t)||e.hasAttribute("v-bind:"+t)}function V(e,t){t.parentNode.insertBefore(e,t)}function H(e,t){t.nextSibling?V(e,t.nextSibling):t.parentNode.appendChild(e)}function W(e){e.parentNode.removeChild(e)}function z(e,t){t.firstChild?V(e,t.firstChild):t.appendChild(e)}function q(e,t){var n=e.parentNode;n&&n.replaceChild(t,e)}function G(e,t,n,r){e.addEventListener(t,n,r)}function J(e,t,n){e.removeEventListener(t,n)}function K(e){var t=e.className;return"object"==typeof t&&(t=t.baseVal||""),t}function Q(e,t){Mn&&!/svg$/.test(e.namespaceURI)?e.className=t:e.setAttribute("class",t)}function X(e,t){if(e.classList)e.classList.add(t);else{var n=" "+K(e)+" ";n.indexOf(" "+t+" ")<0&&Q(e,(n+t).trim())}}function Z(e,t){if(e.classList)e.classList.remove(t);else{for(var n=" "+K(e)+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");Q(e,n.trim())}e.className||e.removeAttribute("class")}function Y(e,t){var n,r;if(ne(e)&&se(e.content)&&(e=e.content),e.hasChildNodes())for(ee(e),r=t?document.createDocumentFragment():document.createElement("div");n=e.firstChild;)r.appendChild(n);return r}function ee(e){for(var t;t=e.firstChild,te(t);)e.removeChild(t);for(;t=e.lastChild,te(t);)e.removeChild(t)}function te(e){return e&&(3===e.nodeType&&!e.data.trim()||8===e.nodeType)}function ne(e){return e.tagName&&"template"===e.tagName.toLowerCase()}function re(e,t){var n=Er.debug?document.createComment(e):document.createTextNode(t?" ":"");return n.__v_anchor=!0,n}function ie(e){if(e.hasAttributes())for(var t=e.attributes,n=0,r=t.length;r>n;n++){var i=t[n].name;if(Ar.test(i))return u(i.replace(Ar,""))}}function ae(e,t,n){for(var r;e!==t;)r=e.nextSibling,n(e),e=r;n(t)}function oe(e,t,n,r,i){function a(){if(s++,o&&s>=l.length){for(var e=0;e<l.length;e++)r.appendChild(l[e]);i&&i()}}var o=!1,s=0,l=[];ae(e,t,function(e){e===t&&(o=!0),l.push(e),T(e,n,a)})}function se(e){return e&&11===e.nodeType}function le(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}function ue(e,t){var n=e.tagName.toLowerCase(),r=e.hasAttributes();if(Nr.test(n)||Lr.test(n)){if(r)return ce(e,t)}else{if(ye(t,"components",n))return{id:n};var i=r&&ce(e,t);if(i)return i}}function ce(e,t){var n=e.getAttribute("is");if(null!=n){if(ye(t,"components",n))return e.removeAttribute("is"),{id:n}}else if(n=U(e,"is"),null!=n)return{id:n,dynamic:!0}}function pe(t,r){var i,a,o;for(i in r)a=t[i],o=r[i],n(t,i)?m(a)&&m(o)&&pe(a,o):e(t,i,o);return t}function he(e,t){var n=Object.create(e||null);return t?v(n,ve(t)):n}function fe(e){if(e.components)for(var t,n=e.components=ve(e.components),r=Object.keys(n),i=0,a=r.length;a>i;i++){var o=r[i];Nr.test(o)||Lr.test(o)||(t=n[o],y(t)&&(n[o]=wn.extend(t)))}}function de(e){var t,n,r=e.props;if(Tn(r))for(e.props={},t=r.length;t--;)n=r[t],"string"==typeof n?e.props[n]=null:n.name&&(e.props[n.name]=n);else if(y(r)){var i=Object.keys(r);for(t=i.length;t--;)n=r[i[t]],"function"==typeof n&&(r[i[t]]={type:n})}}function ve(e){if(Tn(e)){for(var t,n={},r=e.length;r--;){t=e[r];var i="function"==typeof t?t.options&&t.options.name||t.id:t.name||t.id;i&&(n[i]=t)}return n}return e}function me(e,t,r){function i(n){var i=Ir[n]||Pr;o[n]=i(e[n],t[n],r,n)}fe(t),de(t);var a,o={};if(t["extends"]&&(e="function"==typeof t["extends"]?me(e,t["extends"].options,r):me(e,t["extends"],r)),t.mixins)for(var s=0,l=t.mixins.length;l>s;s++){var u=t.mixins[s],c=u.prototype instanceof wn?u.options:u;e=me(e,c,r)}for(a in e)i(a);for(a in t)n(e,a)||i(a);return o}function ye(e,t,n,r){if("string"==typeof n){var i,a=e[t],o=a[n]||a[i=u(n)]||a[i.charAt(0).toUpperCase()+i.slice(1)];return o}}function ge(){this.id=jr++,this.subs=[]}function be(e){Rr=!1,e(),Rr=!0}function _e(e){if(this.value=e,this.dep=new ge,g(e,"__ob__",this),Tn(e)){var t=Fn?xe:we;t(e,Fr,Dr),this.observeArray(e)}else this.walk(e)}function xe(e,t){e.__proto__=t}function we(e,t,n){for(var r=0,i=n.length;i>r;r++){var a=n[r];g(e,a,t[a])}}function ke(e,t){if(e&&"object"==typeof e){var r;return n(e,"__ob__")&&e.__ob__ instanceof _e?r=e.__ob__:Rr&&(Tn(e)||y(e))&&Object.isExtensible(e)&&!e._isVue&&(r=new _e(e)),r&&t&&r.addVm(t),r}}function Se(e,t,n){var r=new ge,i=Object.getOwnPropertyDescriptor(e,t);if(!i||i.configurable!==!1){var a=i&&i.get,o=i&&i.set,s=ke(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=a?a.call(e):n;if(ge.target&&(r.depend(),s&&s.dep.depend(),Tn(t)))for(var i,o=0,l=t.length;l>o;o++)i=t[o],i&&i.__ob__&&i.__ob__.dep.depend();return t},set:function(t){var i=a?a.call(e):n;t!==i&&(o?o.call(e,t):n=t,s=ke(t),r.notify())}})}}function Ce(e){e.prototype._init=function(e){e=e||{},this.$el=null,this.$parent=e.parent,this.$root=this.$parent?this.$parent.$root:this,this.$children=[],this.$refs={},this.$els={},this._watchers=[],this._directives=[],this._uid=Ur++,this._isVue=!0,this._events={},this._eventsCount={},this._isFragment=!1,this._fragment=this._fragmentStart=this._fragmentEnd=null,this._isCompiled=this._isDestroyed=this._isReady=this._isAttached=this._isBeingDestroyed=this._vForRemoving=!1,this._unlinkFn=null,this._context=e._context||this.$parent,this._scope=e._scope,this._frag=e._frag,this._frag&&this._frag.children.push(this),this.$parent&&this.$parent.$children.push(this),e=this.$options=me(this.constructor.options,e,this),this._updateRef(),this._data={},this._callHook("init"),this._initState(),this._initEvents(),this._callHook("created"),e.el&&this.$mount(e.el)}}function Ee(e){if(void 0===e)return"eof";var t=e.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return e;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&122>=t||t>=65&&90>=t?"ident":t>=49&&57>=t?"number":"else"}function Oe(e){var t=e.trim();return"0"===e.charAt(0)&&isNaN(e)?!1:r(t)?l(t):"*"+t}function $e(e){function t(){var t=e[c+1];return p===ii&&"'"===t||p===ai&&'"'===t?(c++,r="\\"+t,f[Kr](),!0):void 0}var n,r,i,a,o,s,l,u=[],c=-1,p=Yr,h=0,f=[];for(f[Qr]=function(){void 0!==i&&(u.push(i),i=void 0)},f[Kr]=function(){void 0===i?i=r:i+=r},f[Xr]=function(){f[Kr](),h++},f[Zr]=function(){if(h>0)h--,p=ri,f[Kr]();else{if(h=0,i=Oe(i),i===!1)return!1;f[Qr]()}};null!=p;)if(c++,n=e[c],"\\"!==n||!t()){if(a=Ee(n),l=li[p],o=l[a]||l["else"]||si,o===si)return;if(p=o[0],s=f[o[1]],s&&(r=o[2],r=void 0===r?n:r,s()===!1))return;if(p===oi)return u.raw=e,u}}function Ae(e){var t=Jr.get(e);return t||(t=$e(e),t&&Jr.put(e,t)),t}function Ne(e,t){return Be(t).get(e)}function Le(t,n,r){var i=t;if("string"==typeof n&&(n=$e(n)),!n||!m(t))return!1;for(var a,o,s=0,l=n.length;l>s;s++)a=t,o=n[s],"*"===o.charAt(0)&&(o=Be(o.slice(1)).get.call(i,i)),l-1>s?(t=t[o],m(t)||(t={},e(a,o,t))):Tn(t)?t.$set(o,r):o in t?t[o]=r:e(t,o,r);return!0}function Ie(){}function Pe(e,t){var n=wi.length;return wi[n]=t?e.replace(mi,"\\n"):e,'"'+n+'"'}function je(e){var t=e.charAt(0),n=e.slice(1);return hi.test(n)?e:(n=n.indexOf('"')>-1?n.replace(gi,Te):n,t+"scope."+n)}function Te(e,t){return wi[t]}function Fe(e){di.test(e),wi.length=0;var t=e.replace(yi,Pe).replace(vi,"");return t=(" "+t).replace(_i,je).replace(gi,Te),De(t)}function De(e){try{var t=qr.Function("scope","Math","return "+e);return function(e){return t.call(this,e,Math)}}catch(n){return Ie}}function Re(e){var t=Ae(e);return t?function(e,n){Le(e,t,n)}:void 0}function Be(e,t){e=e.trim();var n=ci.get(e);if(n)return t&&!n.set&&(n.set=Re(n.exp)),n;var r={exp:e};return r.get=Ue(e)&&e.indexOf("[")<0?De("scope."+e):Fe(e),t&&(r.set=Re(e)),ci.put(e,r),r}function Ue(e){return bi.test(e)&&!xi.test(e)&&"Math."!==e.slice(0,5)}function Me(){Si.length=0,Ci.length=0,Ei={},Oi={},$i=!1}function Ve(){for(var e=!0;e;)e=!1,He(Si),He(Ci),Si.length?e=!0:(Rn&&Er.devtools&&Rn.emit("flush"),Me())}function He(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.id;Ei[r]=null,n.run()}e.length=0}function We(e){var t=e.id;if(null==Ei[t]){var n=e.user?Ci:Si;Ei[t]=n.length,n.push(e),$i||($i=!0,Yn(Ve))}}function ze(e,t,n,r){r&&v(this,r);var i="function"==typeof t;if(this.vm=e,e._watchers.push(this),this.expression=t,this.cb=n,this.id=++Ai,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new er,this.newDepIds=new er,this.prevError=null,i)this.getter=t,this.setter=void 0;else{var a=Be(t,this.twoWay);this.getter=a.get,this.setter=a.set}this.value=this.lazy?void 0:this.get(),this.queued=this.shallow=!1}function qe(e,t){var n=void 0,r=void 0;t||(t=Ni,t.clear());var i=Tn(e),a=m(e);if((i||a)&&Object.isExtensible(e)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)qe(e[n],t);else if(a)for(r=Object.keys(e),n=r.length;n--;)qe(e[r[n]],t)}}function Ge(e){return ne(e)&&se(e.content)}function Je(e,t){var n=t?e:e.trim(),r=Ii.get(n);if(r)return r;var i=document.createDocumentFragment(),a=e.match(Ti),o=Fi.test(e),s=Di.test(e);if(a||o||s){var l=a&&a[1],u=ji[l]||ji.efault,c=u[0],p=u[1],h=u[2],f=document.createElement("div");for(f.innerHTML=p+e+h;c--;)f=f.lastChild;for(var d;d=f.firstChild;)i.appendChild(d)}else i.appendChild(document.createTextNode(e));return t||ee(i),Ii.put(n,i),i}function Ke(e){if(Ge(e))return Je(e.innerHTML);if("SCRIPT"===e.tagName)return Je(e.textContent);for(var t,n=Qe(e),r=document.createDocumentFragment();t=n.firstChild;)r.appendChild(t);return ee(r),r}function Qe(e){if(!e.querySelectorAll)return e.cloneNode();var t,n,r,i=e.cloneNode(!0);if(Ri){var a=i;if(Ge(e)&&(e=e.content,a=i.content),n=e.querySelectorAll("template"),n.length)for(r=a.querySelectorAll("template"),t=r.length;t--;)r[t].parentNode.replaceChild(Qe(n[t]),r[t])}if(Bi)if("TEXTAREA"===e.tagName)i.value=e.value;else if(n=e.querySelectorAll("textarea"),n.length)for(r=i.querySelectorAll("textarea"),t=r.length;t--;)r[t].value=n[t].value;return i}function Xe(e,t,n){var r,i;return se(e)?(ee(e),t?Qe(e):e):("string"==typeof e?n||"#"!==e.charAt(0)?i=Je(e,n):(i=Pi.get(e),i||(r=document.getElementById(e.slice(1)),r&&(i=Ke(r),Pi.put(e,i)))):e.nodeType&&(i=Ke(e)),i&&t?Qe(i):i)}function Ze(e,t,n,r,i,a){this.children=[],this.childFrags=[],this.vm=t,this.scope=i,this.inserted=!1,this.parentFrag=a,a&&a.childFrags.push(this),this.unlink=e(t,n,r,i,this);var o=this.single=1===n.childNodes.length&&!n.childNodes[0].__v_anchor;o?(this.node=n.childNodes[0],this.before=Ye,this.remove=et):(this.node=re("fragment-start"),this.end=re("fragment-end"),this.frag=n,z(this.node,n),n.appendChild(this.end),this.before=tt,this.remove=nt),this.node.__v_frag=this}function Ye(e,t){this.inserted=!0;var n=t!==!1?j:V;n(this.node,e,this.vm),R(this.node)&&this.callHook(rt)}function et(){this.inserted=!1;var e=R(this.node),t=this;this.beforeRemove(),T(this.node,this.vm,function(){e&&t.callHook(it),t.destroy()})}function tt(e,t){this.inserted=!0;var n=this.vm,r=t!==!1?j:V;ae(this.node,this.end,function(t){r(t,e,n)}),R(this.node)&&this.callHook(rt)}function nt(){this.inserted=!1;var e=this,t=R(this.node);this.beforeRemove(),oe(this.node,this.end,this.vm,this.frag,function(){t&&e.callHook(it),e.destroy()})}function rt(e){!e._isAttached&&R(e.$el)&&e._callHook("attached")}function it(e){e._isAttached&&!R(e.$el)&&e._callHook("detached")}function at(e,t){this.vm=e;var n,r="string"==typeof t;r||ne(t)&&!t.hasAttribute("v-if")?n=Xe(t,!0):(n=document.createDocumentFragment(),n.appendChild(t)),this.template=n;var i,a=e.constructor.cid;if(a>0){var o=a+(r?t:le(t));i=Vi.get(o),i||(i=jt(n,e.$options,!0),Vi.put(o,i))}else i=jt(n,e.$options,!0);this.linker=i}function ot(e,t,n){var r=e.node.previousSibling;if(r){for(e=r.__v_frag;!(e&&e.forId===n&&e.inserted||r===t);){if(r=r.previousSibling,!r)return;e=r.__v_frag}return e}}function st(e){var t=e.node;if(e.end)for(;!t.__vue__&&t!==e.end&&t.nextSibling;)t=t.nextSibling;return t.__vue__}function lt(e){for(var t=-1,n=new Array(Math.floor(e));++t<e;)n[t]=t;return n}function ut(e,t,n,r){return r?"$index"===r?e:r.charAt(0).match(/\w/)?Ne(n,r):n[r]:t||n}function ct(e,t,n){for(var r,i,a,o=t?[]:null,s=0,l=e.options.length;l>s;s++)if(r=e.options[s],a=n?r.hasAttribute("selected"):r.selected){if(i=r.hasOwnProperty("_value")?r._value:r.value,!t)return i;o.push(i)}return o}function pt(e,t){for(var n=e.length;n--;)if(w(e[n],t))return n;return-1}function ht(e,t){var n=t.map(function(e){var t=e.charCodeAt(0);return t>47&&58>t?parseInt(e,10):1===e.length&&(t=e.toUpperCase().charCodeAt(0),t>64&&91>t)?t:ua[e]});return n=[].concat.apply([],n),function(t){return n.indexOf(t.keyCode)>-1?e.call(this,t):void 0}}function ft(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function dt(e){return function(t){return t.preventDefault(),e.call(this,t)}}function vt(e){return function(t){return t.target===t.currentTarget?e.call(this,t):void 0}}function mt(e){if(da[e])return da[e];var t=yt(e);return da[e]=da[t]=t,t}function yt(e){e=p(e);var t=u(e),n=t.charAt(0).toUpperCase()+t.slice(1);va||(va=document.createElement("div"));var r,i=pa.length;if("filter"!==t&&t in va.style)return{kebab:e,camel:t};for(;i--;)if(r=ha[i]+n,r in va.style)return{kebab:pa[i]+e,camel:r}}function gt(e){var t=[];if(Tn(e))for(var n=0,r=e.length;r>n;n++){var i=e[n];if(i)if("string"==typeof i)t.push(i);else for(var a in i)i[a]&&t.push(a)}else if(m(e))for(var o in e)e[o]&&t.push(o);return t}function bt(e,t,n){if(t=t.trim(),-1===t.indexOf(" "))return void n(e,t);for(var r=t.split(/\s+/),i=0,a=r.length;a>i;i++)n(e,r[i])}function _t(e,t,n){function r(){++a>=i?n():e[a].call(t,r)}var i=e.length,a=0;e[0].call(t,r)}function xt(e,t,n){for(var i,a,o,s,l,c,h,f=[],d=Object.keys(t),v=d.length;v--;)a=d[v],i=t[a]||La,l=u(a),Ia.test(l)&&(h={name:a,path:l,options:i,mode:Na.ONE_WAY,raw:null},o=p(a),null===(s=U(e,o))&&(null!==(s=U(e,o+".sync"))?h.mode=Na.TWO_WAY:null!==(s=U(e,o+".once"))&&(h.mode=Na.ONE_TIME)),null!==s?(h.raw=s,c=E(s),s=c.expression,h.filters=c.filters,r(s)&&!c.filters?h.optimizedLiteral=!0:h.dynamic=!0,h.parentPath=s):null!==(s=B(e,o))&&(h.raw=s),f.push(h));return wt(f)}function wt(e){return function(t,r){t._props={};for(var i,a,u,c,h,f=t.$options.propsData,d=e.length;d--;)if(i=e[d],h=i.raw,a=i.path,u=i.options,t._props[a]=i,f&&n(f,a)&&St(t,i,f[a]),null===h)St(t,i,void 0);else if(i.dynamic)i.mode===Na.ONE_TIME?(c=(r||t._context||t).$get(i.parentPath),St(t,i,c)):t._context?t._bindDir({name:"prop",def:ja,prop:i},null,null,r):St(t,i,t.$get(i.parentPath));else if(i.optimizedLiteral){var v=l(h);c=v===h?s(o(h)):v,St(t,i,c)}else c=u.type!==Boolean||""!==h&&h!==p(i.name)?h:!0,St(t,i,c)}}function kt(e,t,n,r){var i=t.dynamic&&Ue(t.parentPath),a=n;void 0===a&&(a=Et(e,t)),a=$t(t,a,e);var o=a!==n;Ot(t,a,e)||(a=void 0),i&&!o?be(function(){r(a)}):r(a)}function St(e,t,n){kt(e,t,n,function(n){Se(e,t.path,n)})}function Ct(e,t,n){kt(e,t,n,function(n){e[t.path]=n})}function Et(e,t){var r=t.options;if(!n(r,"default"))return r.type===Boolean?!1:void 0;var i=r["default"];return m(i),"function"==typeof i&&r.type!==Function?i.call(e):i}function Ot(e,t,n){if(!e.options.required&&(null===e.raw||null==t))return!0;var r=e.options,i=r.type,a=!i,o=[];if(i){Tn(i)||(i=[i]);for(var s=0;s<i.length&&!a;s++){var l=At(t,i[s]);o.push(l.expectedType),a=l.valid}}if(!a)return!1;var u=r.validator;return!u||u(t)}function $t(e,t,n){var r=e.options.coerce;return r&&"function"==typeof r?r(t):t}function At(e,t){var n,r;return t===String?(r="string",n=typeof e===r):t===Number?(r="number",n=typeof e===r):t===Boolean?(r="boolean",n=typeof e===r):t===Function?(r="function",n=typeof e===r):t===Object?(r="object",n=y(e)):t===Array?(r="array",n=Tn(e)):n=e instanceof t,{valid:n,expectedType:r}}function Nt(e){Ta.push(e),Fa||(Fa=!0,Yn(Lt))}function Lt(){for(var e=document.documentElement.offsetHeight,t=0;t<Ta.length;t++)Ta[t]();return Ta=[],Fa=!1,e}function It(e,t,n,r){this.id=t,this.el=e,this.enterClass=n&&n.enterClass||t+"-enter",this.leaveClass=n&&n.leaveClass||t+"-leave",this.hooks=n,this.vm=r,this.pendingCssEvent=this.pendingCssCb=this.cancel=this.pendingJsCb=this.op=this.cb=null,this.justEntered=!1,this.entered=this.left=!1,this.typeCache={},this.type=n&&n.type;var i=this;["enterNextTick","enterDone","leaveNextTick","leaveDone"].forEach(function(e){i[e]=f(i[e],i)})}function Pt(e){if(/svg$/.test(e.namespaceURI)){var t=e.getBoundingClientRect();return!(t.width||t.height)}return!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function jt(e,t,n){var r=n||!t._asComponent?Mt(e,t):null,i=r&&r.terminal||an(e)||!e.hasChildNodes()?null:Gt(e.childNodes,t);return function(e,t,n,a,o){var s=d(t.childNodes),l=Tt(function(){r&&r(e,t,n,a,o),i&&i(e,s,n,a,o)},e);return Dt(e,l)}}function Tt(e,t){t._directives=[];var n=t._directives.length;e();var r=t._directives.slice(n);r.sort(Ft);for(var i=0,a=r.length;a>i;i++)r[i]._bind();return r}function Ft(e,t){return e=e.descriptor.def.priority||Xa,t=t.descriptor.def.priority||Xa,e>t?-1:e===t?0:1}function Dt(e,t,n,r){function i(i){Rt(e,t,i),n&&r&&Rt(n,r)}return i.dirs=t,i}function Rt(e,t,n){for(var r=t.length;r--;)t[r]._teardown()}function Bt(e,t,n,r){var i=xt(t,n,e),a=Tt(function(){i(e,r)},e);return Dt(e,a)}function Ut(e,t,n){var r,i,a=t._containerAttrs,o=t._replacerAttrs;return 11!==e.nodeType&&(t._asComponent?(a&&n&&(r=en(a,n)),o&&(i=en(o,t))):i=en(e.attributes,t)),t._containerAttrs=t._replacerAttrs=null,function(e,t,n){var a,o=e._context;o&&r&&(a=Tt(function(){r(o,t,null,n)},o));var s=Tt(function(){i&&i(e,t)},e);return Dt(e,s,o,a)}}function Mt(e,t){var n=e.nodeType;return 1!==n||an(e)?3===n&&e.data.trim()?Ht(e,t):null:Vt(e,t)}function Vt(e,t){if("TEXTAREA"===e.tagName){var n=A(e.value);n&&(e.setAttribute(":value",N(n)),e.value="")}var r,i=e.hasAttributes(),a=i&&d(e.attributes);return i&&(r=Xt(e,a,t)),r||(r=Kt(e,t)),r||(r=Qt(e,t)),!r&&i&&(r=en(a,t)),r}function Ht(e,t){if(e._skip)return Wt;var n=A(e.wholeText);if(!n)return null;for(var r=e.nextSibling;r&&3===r.nodeType;)r._skip=!0,r=r.nextSibling;for(var i,a,o=document.createDocumentFragment(),s=0,l=n.length;l>s;s++)a=n[s],i=a.tag?zt(a,t):document.createTextNode(a.value),o.appendChild(i);return qt(n,o,t)}function Wt(e,t){W(t)}function zt(e,t){function n(t){if(!e.descriptor){var n=E(e.value);e.descriptor={name:t,def:Oa[t],expression:n.expression,filters:n.filters}}}var r;return e.oneTime?r=document.createTextNode(e.value):e.html?(r=document.createComment("v-html"),n("html")):(r=document.createTextNode(" "),n("text")),r}function qt(e,t){return function(n,r,i,o){for(var s,l,u,c=t.cloneNode(!0),p=d(c.childNodes),h=0,f=e.length;f>h;h++)s=e[h],l=s.value,s.tag&&(u=p[h],s.oneTime?(l=(o||n).$eval(l),s.html?q(u,Xe(l,!0)):u.data=a(l)):n._bindDir(s.descriptor,u,i,o));q(r,c)}}function Gt(e,t){for(var n,r,i,a=[],o=0,s=e.length;s>o;o++)i=e[o],n=Mt(i,t),r=n&&n.terminal||"SCRIPT"===i.tagName||!i.hasChildNodes()?null:Gt(i.childNodes,t),a.push(n,r);return a.length?Jt(a):null}function Jt(e){return function(t,n,r,i,a){for(var o,s,l,u=0,c=0,p=e.length;p>u;c++){o=n[c],s=e[u++],l=e[u++];var h=d(o.childNodes);s&&s(t,o,r,i,a),l&&l(t,h,r,i,a)}}}function Kt(e,t){var n=e.tagName.toLowerCase();if(!Nr.test(n)){var r=ye(t,"elementDirectives",n);return r?Yt(e,n,"",t,r):void 0}}function Qt(e,t){var n=ue(e,t);if(n){var r=ie(e),i={name:"component",ref:r,expression:n.id,def:za.component,modifiers:{literal:!n.dynamic}},a=function(e,t,n,a,o){r&&Se((a||e).$refs,r,null),e._bindDir(i,t,n,a,o)};return a.terminal=!0,a}}function Xt(e,t,n){if(null!==B(e,"v-pre"))return Zt;if(e.hasAttribute("v-else")){var r=e.previousElementSibling;if(r&&r.hasAttribute("v-if"))return Zt}for(var i,a,o,s,l,u,c,p,h,f,d=0,v=t.length;v>d;d++)i=t[d],a=i.name.replace(Ka,""),(l=a.match(Ja))&&(h=ye(n,"directives",l[1]),h&&h.terminal&&(!f||(h.priority||Za)>f.priority)&&(f=h,c=i.name,s=tn(i.name),o=i.value,u=l[1],p=l[2]));return f?Yt(e,u,o,n,f,c,p,s):void 0}function Zt(){}function Yt(e,t,n,r,i,a,o,s){var l=E(n),u={name:t,arg:o,expression:l.expression,filters:l.filters,raw:n,attr:a,modifiers:s,def:i};"for"!==t&&"router-view"!==t||(u.ref=ie(e));var c=function(e,t,n,r,i){u.ref&&Se((r||e).$refs,u.ref,null),e._bindDir(u,t,n,r,i)};return c.terminal=!0,c}function en(e,t){function n(e,t,n){var r=n&&rn(n),i=!r&&E(a);v.push({name:e,attr:o,raw:s,def:t,arg:u,modifiers:c,expression:i&&i.expression,filters:i&&i.filters,interp:n,hasOneTime:r})}for(var r,i,a,o,s,l,u,c,p,h,f,d=e.length,v=[];d--;)if(r=e[d],i=o=r.name,a=s=r.value,h=A(a),u=null,c=tn(i),i=i.replace(Ka,""),h)a=N(h),u=i,n("bind",Oa.bind,h);else if(Qa.test(i))c.literal=!qa.test(i),n("transition",za.transition);else if(Ga.test(i))u=i.replace(Ga,""),n("on",Oa.on);else if(qa.test(i))l=i.replace(qa,""),"style"===l||"class"===l?n(l,za[l]):(u=l,n("bind",Oa.bind));else if(f=i.match(Ja)){if(l=f[1],u=f[2],"else"===l)continue;p=ye(t,"directives",l,!0),p&&n(l,p)}return v.length?nn(v):void 0}function tn(e){var t=Object.create(null),n=e.match(Ka);if(n)for(var r=n.length;r--;)t[n[r].slice(1)]=!0;return t}function nn(e){return function(t,n,r,i,a){for(var o=e.length;o--;)t._bindDir(e[o],n,r,i,a)}}function rn(e){for(var t=e.length;t--;)if(e[t].oneTime)return!0}function an(e){return"SCRIPT"===e.tagName&&(!e.hasAttribute("type")||"text/javascript"===e.getAttribute("type"))}function on(e,t){return t&&(t._containerAttrs=ln(e)),ne(e)&&(e=Xe(e)),t&&(t._asComponent&&!t.template&&(t.template="<slot></slot>"),t.template&&(t._content=Y(e),e=sn(e,t))),se(e)&&(z(re("v-start",!0),e),e.appendChild(re("v-end",!0))),e}function sn(e,t){var n=t.template,r=Xe(n,!0);if(r){var i=r.firstChild,a=i.tagName&&i.tagName.toLowerCase();return t.replace?(e===document.body,r.childNodes.length>1||1!==i.nodeType||"component"===a||ye(t,"components",a)||M(i,"is")||ye(t,"elementDirectives",a)||i.hasAttribute("v-for")||i.hasAttribute("v-if")?r:(t._replacerAttrs=ln(i),un(e,i),i)):(e.appendChild(r),e)}}function ln(e){return 1===e.nodeType&&e.hasAttributes()?d(e.attributes):void 0}function un(e,t){for(var n,r,i=e.attributes,a=i.length;a--;)n=i[a].name,r=i[a].value,t.hasAttribute(n)||Ya.test(n)?"class"===n&&!A(r)&&(r=r.trim())&&r.split(/\s+/).forEach(function(e){X(t,e)}):t.setAttribute(n,r)}function cn(e,t){if(t){for(var n,r,i=e._slotContents=Object.create(null),a=0,o=t.children.length;o>a;a++)n=t.children[a],(r=n.getAttribute("slot"))&&(i[r]||(i[r]=[])).push(n);for(r in i)i[r]=pn(i[r],t);if(t.hasChildNodes()){var s=t.childNodes;if(1===s.length&&3===s[0].nodeType&&!s[0].data.trim())return;i["default"]=pn(t.childNodes,t)}}}function pn(e,t){var n=document.createDocumentFragment();e=d(e);for(var r=0,i=e.length;i>r;r++){var a=e[r];!ne(a)||a.hasAttribute("v-if")||a.hasAttribute("v-for")||(t.removeChild(a),a=Xe(a,!0)),n.appendChild(a)}return n}function hn(e){function t(){}function r(e,t){var n=new ze(t,e,null,{lazy:!0});return function(){return n.dirty&&n.evaluate(),ge.target&&n.depend(),n.value}}Object.defineProperty(e.prototype,"$data",{get:function(){return this._data},set:function(e){e!==this._data&&this._setData(e)}}),e.prototype._initState=function(){this._initProps(),this._initMeta(),this._initMethods(),this._initData(),this._initComputed()},e.prototype._initProps=function(){var e=this.$options,t=e.el,n=e.props;t=e.el=D(t),this._propsUnlinkFn=t&&1===t.nodeType&&n?Bt(this,t,n,this._scope):null},e.prototype._initData=function(){var e=this.$options.data,t=this._data=e?e():{};y(t)||(t={});var r,i,a=this._props,o=Object.keys(t);for(r=o.length;r--;)i=o[r],a&&n(a,i)||this._proxy(i);ke(t,this)},e.prototype._setData=function(e){e=e||{};var t=this._data;this._data=e;var r,i,a;for(r=Object.keys(t),a=r.length;a--;)i=r[a],i in e||this._unproxy(i);for(r=Object.keys(e),a=r.length;a--;)i=r[a],n(this,i)||this._proxy(i);t.__ob__.removeVm(this),ke(e,this),this._digest()},e.prototype._proxy=function(e){if(!i(e)){var t=this;Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return t._data[e]},set:function(n){t._data[e]=n}})}},e.prototype._unproxy=function(e){i(e)||delete this[e]},e.prototype._digest=function(){for(var e=0,t=this._watchers.length;t>e;e++)this._watchers[e].update(!0)},e.prototype._initComputed=function(){var e=this.$options.computed;if(e)for(var n in e){var i=e[n],a={enumerable:!0,configurable:!0};"function"==typeof i?(a.get=r(i,this),a.set=t):(a.get=i.get?i.cache!==!1?r(i.get,this):f(i.get,this):t,a.set=i.set?f(i.set,this):t),Object.defineProperty(this,n,a)}},e.prototype._initMethods=function(){var e=this.$options.methods;if(e)for(var t in e)this[t]=f(e[t],this)},e.prototype._initMeta=function(){var e=this.$options._meta;if(e)for(var t in e)Se(this,t,e[t])}}function fn(e){function t(e,t){for(var n,r,i,a=t.attributes,o=0,s=a.length;s>o;o++)n=a[o].name,to.test(n)&&(n=n.replace(to,""),r=a[o].value,Ue(r)&&(r+=".apply(this, $arguments)"),i=(e._scope||e._context).$eval(r,!0),i._fromParent=!0,e.$on(n.replace(to),i))}function n(e,t,n){if(n){var i,a,o,s;for(a in n)if(i=n[a],Tn(i))for(o=0,s=i.length;s>o;o++)r(e,t,a,i[o]);else r(e,t,a,i)}}function r(e,t,n,i,a){var o=typeof i;if("function"===o)e[t](n,i,a);else if("string"===o){var s=e.$options.methods,l=s&&s[i];l&&e[t](n,l,a)}else i&&"object"===o&&r(e,t,n,i.handler,i)}function i(){this._isAttached||(this._isAttached=!0,this.$children.forEach(a))}function a(e){!e._isAttached&&R(e.$el)&&e._callHook("attached")}function o(){this._isAttached&&(this._isAttached=!1,this.$children.forEach(s))}function s(e){e._isAttached&&!R(e.$el)&&e._callHook("detached")}e.prototype._initEvents=function(){var e=this.$options;e._asComponent&&t(this,e.el),n(this,"$on",e.events),n(this,"$watch",e.watch)},e.prototype._initDOMHooks=function(){this.$on("hook:attached",i),this.$on("hook:detached",o)},e.prototype._callHook=function(e){this.$emit("pre-hook:"+e);var t=this.$options[e];if(t)for(var n=0,r=t.length;r>n;n++)t[n].call(this);this.$emit("hook:"+e)}}function dn(){}function vn(e,t,n,r,i,a){this.vm=t,this.el=n,this.descriptor=e,this.name=e.name,this.expression=e.expression,this.arg=e.arg,this.modifiers=e.modifiers,this.filters=e.filters,this.literal=this.modifiers&&this.modifiers.literal,this._locked=!1,this._bound=!1,this._listeners=null,this._host=r,this._scope=i,this._frag=a}function mn(e){e.prototype._updateRef=function(e){var t=this.$options._ref;if(t){var n=(this._scope||this._context).$refs;e?n[t]===this&&(n[t]=null):n[t]=this}},e.prototype._compile=function(e){var t=this.$options,n=e;if(e=on(e,t),this._initElement(e),1!==e.nodeType||null===B(e,"v-pre")){var r=this._context&&this._context.$options,i=Ut(e,t,r);cn(this,t._content);var a,o=this.constructor;t._linkerCachable&&(a=o.linker,a||(a=o.linker=jt(e,t)));var s=i(this,e,this._scope),l=a?a(this,e):jt(e,t)(this,e);this._unlinkFn=function(){s(),l(!0)},t.replace&&q(n,e),this._isCompiled=!0,this._callHook("compiled")}},e.prototype._initElement=function(e){se(e)?(this._isFragment=!0,this.$el=this._fragmentStart=e.firstChild,this._fragmentEnd=e.lastChild,3===this._fragmentStart.nodeType&&(this._fragmentStart.data=this._fragmentEnd.data=""),this._fragment=e):this.$el=e,this.$el.__vue__=this,this._callHook("beforeCompile")},e.prototype._bindDir=function(e,t,n,r,i){this._directives.push(new vn(e,this,t,n,r,i))},e.prototype._destroy=function(e,t){if(this._isBeingDestroyed)return void(t||this._cleanup());var n,r,i=this,a=function(){!n||r||t||i._cleanup(); -};e&&this.$el&&(r=!0,this.$remove(function(){r=!1,a()})),this._callHook("beforeDestroy"),this._isBeingDestroyed=!0;var o,s=this.$parent;for(s&&!s._isBeingDestroyed&&(s.$children.$remove(this),this._updateRef(!0)),o=this.$children.length;o--;)this.$children[o].$destroy();for(this._propsUnlinkFn&&this._propsUnlinkFn(),this._unlinkFn&&this._unlinkFn(),o=this._watchers.length;o--;)this._watchers[o].teardown();this.$el&&(this.$el.__vue__=null),n=!0,a()},e.prototype._cleanup=function(){this._isDestroyed||(this._frag&&this._frag.children.$remove(this),this._data&&this._data.__ob__&&this._data.__ob__.removeVm(this),this.$el=this.$parent=this.$root=this.$children=this._watchers=this._context=this._scope=this._directives=null,this._isDestroyed=!0,this._callHook("destroyed"),this.$off())}}function yn(e){e.prototype._applyFilters=function(e,t,n,r){var i,a,o,s,l,u,c,p,h;for(u=0,c=n.length;c>u;u++)if(i=n[r?c-u-1:u],a=ye(this.$options,"filters",i.name,!0),a&&(a=r?a.write:a.read||a,"function"==typeof a)){if(o=r?[e,t]:[e],l=r?2:1,i.args)for(p=0,h=i.args.length;h>p;p++)s=i.args[p],o[p+l]=s.dynamic?this.$get(s.value):s.value;e=a.apply(this,o)}return e},e.prototype._resolveComponent=function(t,n){var r;if(r="function"==typeof t?t:ye(this.$options,"components",t,!0))if(r.options)n(r);else if(r.resolved)n(r.resolved);else if(r.requested)r.pendingCallbacks.push(n);else{r.requested=!0;var i=r.pendingCallbacks=[n];r.call(this,function(t){y(t)&&(t=e.extend(t)),r.resolved=t;for(var n=0,a=i.length;a>n;n++)i[n](t)},function(e){})}}}function gn(e){function n(e){return JSON.parse(JSON.stringify(e))}e.prototype.$get=function(e,t){var n=Be(e);if(n){if(t){var r=this;return function(){r.$arguments=d(arguments);var e=n.get.call(r,r);return r.$arguments=null,e}}try{return n.get.call(this,this)}catch(i){}}},e.prototype.$set=function(e,t){var n=Be(e,!0);n&&n.set&&n.set.call(this,this,t)},e.prototype.$delete=function(e){t(this._data,e)},e.prototype.$watch=function(e,t,n){var r,i=this;"string"==typeof e&&(r=E(e),e=r.expression);var a=new ze(i,e,t,{deep:n&&n.deep,sync:n&&n.sync,filters:r&&r.filters,user:!n||n.user!==!1});return n&&n.immediate&&t.call(i,a.value),function(){a.teardown()}},e.prototype.$eval=function(e,t){if(no.test(e)){var n=E(e),r=this.$get(n.expression,t);return n.filters?this._applyFilters(r,null,n.filters):r}return this.$get(e,t)},e.prototype.$interpolate=function(e){var t=A(e),n=this;return t?1===t.length?n.$eval(t[0].value)+"":t.map(function(e){return e.tag?n.$eval(e.value):e.value}).join(""):e},e.prototype.$log=function(e){var t=e?Ne(this._data,e):this._data;if(t&&(t=n(t)),!e){var r;for(r in this.$options.computed)t[r]=n(this[r]);if(this._props)for(r in this._props)t[r]=n(this[r])}console.log(t)}}function bn(e){function t(e,t,r,i,a,o){t=n(t);var s=!R(t),l=i===!1||s?a:o,u=!s&&!e._isAttached&&!R(e.$el);return e._isFragment?(ae(e._fragmentStart,e._fragmentEnd,function(n){l(n,t,e)}),r&&r()):l(e.$el,t,e,r),u&&e._callHook("attached"),e}function n(e){return"string"==typeof e?document.querySelector(e):e}function r(e,t,n,r){t.appendChild(e),r&&r()}function i(e,t,n,r){V(e,t),r&&r()}function a(e,t,n){W(e),n&&n()}e.prototype.$nextTick=function(e){Yn(e,this)},e.prototype.$appendTo=function(e,n,i){return t(this,e,n,i,r,P)},e.prototype.$prependTo=function(e,t,r){return e=n(e),e.hasChildNodes()?this.$before(e.firstChild,t,r):this.$appendTo(e,t,r),this},e.prototype.$before=function(e,n,r){return t(this,e,n,r,i,j)},e.prototype.$after=function(e,t,r){return e=n(e),e.nextSibling?this.$before(e.nextSibling,t,r):this.$appendTo(e.parentNode,t,r),this},e.prototype.$remove=function(e,t){if(!this.$el.parentNode)return e&&e();var n=this._isAttached&&R(this.$el);n||(t=!1);var r=this,i=function(){n&&r._callHook("detached"),e&&e()};if(this._isFragment)oe(this._fragmentStart,this._fragmentEnd,this,this._fragment,i);else{var o=t===!1?a:T;o(this.$el,this,i)}return this}}function _n(e){function t(e,t,r){var i=e.$parent;if(i&&r&&!n.test(t))for(;i;)i._eventsCount[t]=(i._eventsCount[t]||0)+r,i=i.$parent}e.prototype.$on=function(e,n){return(this._events[e]||(this._events[e]=[])).push(n),t(this,e,1),this},e.prototype.$once=function(e,t){function n(){r.$off(e,n),t.apply(this,arguments)}var r=this;return n.fn=t,this.$on(e,n),this},e.prototype.$off=function(e,n){var r;if(!arguments.length){if(this.$parent)for(e in this._events)r=this._events[e],r&&t(this,e,-r.length);return this._events={},this}if(r=this._events[e],!r)return this;if(1===arguments.length)return t(this,e,-r.length),this._events[e]=null,this;for(var i,a=r.length;a--;)if(i=r[a],i===n||i.fn===n){t(this,e,-1),r.splice(a,1);break}return this},e.prototype.$emit=function(e){var t="string"==typeof e;e=t?e:e.name;var n=this._events[e],r=t||!n;if(n){n=n.length>1?d(n):n;var i=t&&n.some(function(e){return e._fromParent});i&&(r=!1);for(var a=d(arguments,1),o=0,s=n.length;s>o;o++){var l=n[o],u=l.apply(this,a);u!==!0||i&&!l._fromParent||(r=!0)}}return r},e.prototype.$broadcast=function(e){var t="string"==typeof e;if(e=t?e:e.name,this._eventsCount[e]){var n=this.$children,r=d(arguments);t&&(r[0]={name:e,source:this});for(var i=0,a=n.length;a>i;i++){var o=n[i],s=o.$emit.apply(o,r);s&&o.$broadcast.apply(o,r)}return this}},e.prototype.$dispatch=function(e){var t=this.$emit.apply(this,arguments);if(t){var n=this.$parent,r=d(arguments);for(r[0]={name:e,source:this};n;)t=n.$emit.apply(n,r),n=t?n.$parent:null;return this}};var n=/^hook:/}function xn(e){function t(){this._isAttached=!0,this._isReady=!0,this._callHook("ready")}e.prototype.$mount=function(e){return this._isCompiled?void 0:(e=D(e),e||(e=document.createElement("div")),this._compile(e),this._initDOMHooks(),R(this.$el)?(this._callHook("attached"),t.call(this)):this.$once("hook:attached",t),this)},e.prototype.$destroy=function(e,t){this._destroy(e,t)},e.prototype.$compile=function(e,t,n,r){return jt(e,this.$options,!0)(this,e,t,n,r)}}function wn(e){this._init(e)}function kn(e,t,n){return n=n?parseInt(n,10):0,t=o(t),"number"==typeof t?e.slice(n,n+t):e}function Sn(e,t,n){if(e=oo(e),null==t)return e;if("function"==typeof t)return e.filter(t);t=(""+t).toLowerCase();for(var r,i,a,o,s="in"===n?3:2,l=Array.prototype.concat.apply([],d(arguments,s)),u=[],c=0,p=e.length;p>c;c++)if(r=e[c],a=r&&r.$value||r,o=l.length){for(;o--;)if(i=l[o],"$key"===i&&En(r.$key,t)||En(Ne(a,i),t)){u.push(r);break}}else En(r,t)&&u.push(r);return u}function Cn(e){function t(e,t,n){var i=r[n];return i&&("$key"!==i&&(m(e)&&"$value"in e&&(e=e.$value),m(t)&&"$value"in t&&(t=t.$value)),e=m(e)?Ne(e,i):e,t=m(t)?Ne(t,i):t),e===t?0:e>t?a:-a}var n=null,r=void 0;e=oo(e);var i=d(arguments,1),a=i[i.length-1];"number"==typeof a?(a=0>a?-1:1,i=i.length>1?i.slice(0,-1):i):a=1;var o=i[0];return o?("function"==typeof o?n=function(e,t){return o(e,t)*a}:(r=Array.prototype.concat.apply([],i),n=function(e,i,a){return a=a||0,a>=r.length-1?t(e,i,a):t(e,i,a)||n(e,i,a+1)}),e.slice().sort(n)):e}function En(e,t){var n;if(y(e)){var r=Object.keys(e);for(n=r.length;n--;)if(En(e[r[n]],t))return!0}else if(Tn(e)){for(n=e.length;n--;)if(En(e[n],t))return!0}else if(null!=e)return e.toString().toLowerCase().indexOf(t)>-1}function On(n){n.options={directives:Oa,elementDirectives:ao,filters:lo,transitions:{},components:{},partials:{},replace:!0},n.util=Br,n.config=Er,n.set=e,n["delete"]=t,n.nextTick=Yn,n.compiler=eo,n.FragmentFactory=at,n.internalDirectives=za,n.parsers={path:ui,text:kr,template:Ui,directive:yr,expression:ki},n.cid=0;var r=1;n.extend=function(e){e=e||{};var t=this,i=0===t.cid;if(i&&e._Ctor)return e._Ctor;var a=e.name||t.options.name,o=function(e){n.call(this,e)};return o.prototype=Object.create(t.prototype),o.prototype.constructor=o,o.cid=r++,o.options=me(t.options,e),o["super"]=t,o.extend=t.extend,Er._assetTypes.forEach(function(e){o[e]=t[e]}),a&&(o.options.components[a]=o),i&&(e._Ctor=o),o},n.use=function(e){if(!e.installed){var t=d(arguments,1);return t.unshift(this),"function"==typeof e.install?e.install.apply(e,t):e.apply(null,t),e.installed=!0,this}},n.mixin=function(e){n.options=me(n.options,e)},Er._assetTypes.forEach(function(e){n[e]=function(t,r){return r?("component"===e&&y(r)&&(r.name||(r.name=t),r=n.extend(r)),this.options[e+"s"][t]=r,r):this.options[e+"s"][t]}}),v(n.transition,$r)}var $n=Object.prototype.hasOwnProperty,An=/^\s?(true|false|-?[\d\.]+|'[^']*'|"[^"]*")\s?$/,Nn=/-(\w)/g,Ln=/([a-z\d])([A-Z])/g,In=/(?:^|[-_\/])(\w)/g,Pn=Object.prototype.toString,jn="[object Object]",Tn=Array.isArray,Fn="__proto__"in{},Dn="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),Rn=Dn&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Bn=Dn&&window.navigator.userAgent.toLowerCase(),Un=Bn&&Bn.indexOf("trident")>0,Mn=Bn&&Bn.indexOf("msie 9.0")>0,Vn=Bn&&Bn.indexOf("android")>0,Hn=Bn&&/(iphone|ipad|ipod|ios)/i.test(Bn),Wn=Hn&&Bn.match(/os ([\d_]+)/),zn=Wn&&Wn[1].split("_"),qn=zn&&Number(zn[0])>=9&&Number(zn[1])>=3&&!window.indexedDB,Gn=void 0,Jn=void 0,Kn=void 0,Qn=void 0;if(Dn&&!Mn){var Xn=void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend,Zn=void 0===window.onanimationend&&void 0!==window.onwebkitanimationend;Gn=Xn?"WebkitTransition":"transition",Jn=Xn?"webkitTransitionEnd":"transitionend",Kn=Zn?"WebkitAnimation":"animation",Qn=Zn?"webkitAnimationEnd":"animationend"}var Yn=function(){function e(){r=!1;var e=n.slice(0);n=[];for(var t=0;t<e.length;t++)e[t]()}var t,n=[],r=!1;if("undefined"==typeof MutationObserver||qn){var i=Dn?window:"undefined"!=typeof global?global:{};t=i.setImmediate||setTimeout}else{var a=1,o=new MutationObserver(e),s=document.createTextNode(a);o.observe(s,{characterData:!0}),t=function(){a=(a+1)%2,s.data=a}}return function(i,a){var o=a?function(){i.call(a)}:i;n.push(o),r||(r=!0,t(e,0))}}(),er=void 0;"undefined"!=typeof Set&&Set.toString().match(/native code/)?er=Set:(er=function(){this.set=Object.create(null)},er.prototype.has=function(e){return void 0!==this.set[e]},er.prototype.add=function(e){this.set[e]=1},er.prototype.clear=function(){this.set=Object.create(null)});var tr=k.prototype;tr.put=function(e,t){var n,r=this.get(e,!0);return r||(this.size===this.limit&&(n=this.shift()),r={key:e},this._keymap[e]=r,this.tail?(this.tail.newer=r,r.older=this.tail):this.head=r,this.tail=r,this.size++),r.value=t,n},tr.shift=function(){var e=this.head;return e&&(this.head=this.head.newer,this.head.older=void 0,e.newer=e.older=void 0,this._keymap[e.key]=void 0,this.size--),e},tr.get=function(e,t){var n=this._keymap[e];if(void 0!==n)return n===this.tail?t?n:n.value:(n.newer&&(n===this.head&&(this.head=n.newer),n.newer.older=n.older),n.older&&(n.older.newer=n.newer),n.newer=void 0,n.older=this.tail,this.tail&&(this.tail.newer=n),this.tail=n,t?n:n.value)};var nr,rr,ir,ar,or,sr,lr,ur,cr,pr,hr,fr,dr=new k(1e3),vr=/[^\s'"]+|'[^']*'|"[^"]*"/g,mr=/^in$|^-?\d+/,yr=Object.freeze({parseDirective:E}),gr=/[-.*+?^${}()|[\]\/\\]/g,br=void 0,_r=void 0,xr=void 0,wr=/[^|]\|[^|]/,kr=Object.freeze({compileRegex:$,parseText:A,tokensToExp:N}),Sr=["{{","}}"],Cr=["{{{","}}}"],Er=Object.defineProperties({debug:!1,silent:!1,async:!0,warnExpressionErrors:!0,devtools:!1,_delimitersChanged:!0,_assetTypes:["component","directive","elementDirective","filter","transition","partial"],_propBindingModes:{ONE_WAY:0,TWO_WAY:1,ONE_TIME:2},_maxUpdateCount:100},{delimiters:{get:function(){return Sr},set:function(e){Sr=e,$()},configurable:!0,enumerable:!0},unsafeDelimiters:{get:function(){return Cr},set:function(e){Cr=e,$()},configurable:!0,enumerable:!0}}),Or=void 0,$r=Object.freeze({appendWithTransition:P,beforeWithTransition:j,removeWithTransition:T,applyTransition:F}),Ar=/^v-ref:/,Nr=/^(div|p|span|img|a|b|i|br|ul|ol|li|h1|h2|h3|h4|h5|h6|code|pre|table|th|td|tr|form|label|input|select|option|nav|article|section|header|footer)$/i,Lr=/^(slot|partial|component)$/i,Ir=Er.optionMergeStrategies=Object.create(null);Ir.data=function(e,t,n){return n?e||t?function(){var r="function"==typeof t?t.call(n):t,i="function"==typeof e?e.call(n):void 0;return r?pe(r,i):i}:void 0:t?"function"!=typeof t?e:e?function(){return pe(t.call(this),e.call(this))}:t:e},Ir.el=function(e,t,n){if(n||!t||"function"==typeof t){var r=t||e;return n&&"function"==typeof r?r.call(n):r}},Ir.init=Ir.created=Ir.ready=Ir.attached=Ir.detached=Ir.beforeCompile=Ir.compiled=Ir.beforeDestroy=Ir.destroyed=Ir.activate=function(e,t){return t?e?e.concat(t):Tn(t)?t:[t]:e},Er._assetTypes.forEach(function(e){Ir[e+"s"]=he}),Ir.watch=Ir.events=function(e,t){if(!t)return e;if(!e)return t;var n={};v(n,e);for(var r in t){var i=n[r],a=t[r];i&&!Tn(i)&&(i=[i]),n[r]=i?i.concat(a):[a]}return n},Ir.props=Ir.methods=Ir.computed=function(e,t){if(!t)return e;if(!e)return t;var n=Object.create(null);return v(n,e),v(n,t),n};var Pr=function(e,t){return void 0===t?e:t},jr=0;ge.target=null,ge.prototype.addSub=function(e){this.subs.push(e)},ge.prototype.removeSub=function(e){this.subs.$remove(e)},ge.prototype.depend=function(){ge.target.addDep(this)},ge.prototype.notify=function(){for(var e=d(this.subs),t=0,n=e.length;n>t;t++)e[t].update()};var Tr=Array.prototype,Fr=Object.create(Tr);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=Tr[e];g(Fr,e,function(){for(var n=arguments.length,r=new Array(n);n--;)r[n]=arguments[n];var i,a=t.apply(this,r),o=this.__ob__;switch(e){case"push":i=r;break;case"unshift":i=r;break;case"splice":i=r.slice(2)}return i&&o.observeArray(i),o.dep.notify(),a})}),g(Tr,"$set",function(e,t){return e>=this.length&&(this.length=Number(e)+1),this.splice(e,1,t)[0]}),g(Tr,"$remove",function(e){if(this.length){var t=_(this,e);return t>-1?this.splice(t,1):void 0}});var Dr=Object.getOwnPropertyNames(Fr),Rr=!0;_e.prototype.walk=function(e){for(var t=Object.keys(e),n=0,r=t.length;r>n;n++)this.convert(t[n],e[t[n]])},_e.prototype.observeArray=function(e){for(var t=0,n=e.length;n>t;t++)ke(e[t])},_e.prototype.convert=function(e,t){Se(this.value,e,t)},_e.prototype.addVm=function(e){(this.vms||(this.vms=[])).push(e)},_e.prototype.removeVm=function(e){this.vms.$remove(e)};var Br=Object.freeze({defineReactive:Se,set:e,del:t,hasOwn:n,isLiteral:r,isReserved:i,_toString:a,toNumber:o,toBoolean:s,stripQuotes:l,camelize:u,hyphenate:p,classify:h,bind:f,toArray:d,extend:v,isObject:m,isPlainObject:y,def:g,debounce:b,indexOf:_,cancellable:x,looseEqual:w,isArray:Tn,hasProto:Fn,inBrowser:Dn,devtools:Rn,isIE:Un,isIE9:Mn,isAndroid:Vn,isIos:Hn,iosVersionMatch:Wn,iosVersion:zn,hasMutationObserverBug:qn,get transitionProp(){return Gn},get transitionEndEvent(){return Jn},get animationProp(){return Kn},get animationEndEvent(){return Qn},nextTick:Yn,get _Set(){return er},query:D,inDoc:R,getAttr:B,getBindAttr:U,hasBindAttr:M,before:V,after:H,remove:W,prepend:z,replace:q,on:G,off:J,setClass:Q,addClass:X,removeClass:Z,extractContent:Y,trimNode:ee,isTemplate:ne,createAnchor:re,findRef:ie,mapNodeRange:ae,removeNodeRange:oe,isFragment:se,getOuterHTML:le,mergeOptions:me,resolveAsset:ye,checkComponentAttr:ue,commonTagRE:Nr,reservedTagRE:Lr,warn:Or}),Ur=0,Mr="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,Vr=function(e,t){function n(e){if(!(this instanceof n))return new n(e);this.context=e;for(var t=0;t<s.length;t++)this.context[s[t]]||(this.context[s[t]]=o(u[t]))}function r(e){return e.prototype}function i(e){return t[e]}function a(e,t){e.__proto__=t}function o(e){var t=Object.create(e.prototype),n=function(){if(!(this instanceof n)){var r=e.apply(null,arguments);return a(r,t),r}e.apply(this,arguments)};return a(n,e),n.prototype=t,n.wrapped=!0,n}var s=(e.exports,["Object","String","Boolean","Number","RegExp","Date","Array"]),l={string:"String","boolean":"Boolean",number:"Number"},u=s.map(i),c=u.map(r);return e.exports=n,n.prototype.replace=function(e){var t=u.indexOf(e),n=c.indexOf(e);if(~t){var r=s[t];return this.context[r]}if(~n){var r=s[n];return this.context[r].prototype}return e},n.prototype.getPropertyObject=function(e,t){return l[typeof e]?this.getPrototypeOf(e):e},n.prototype.isPrimitive=function(e){return!!~u.indexOf(e)||!!~c.indexOf(e)},n.prototype.getPrototypeOf=function(e){if(null==e)return e;var t=l[typeof e];if(t)var n=this.context[t].prototype;else var n=Object.getPrototypeOf(e);if(n&&n!==Object.prototype){var r=this.replace(n);return r===e&&(r=this.replace(Object.prototype)),r}return null},n.prototype.applyNew=function(e,t){if(e.wrapped){var n=Object.getPrototypeOf(e),r=new(Function.prototype.bind.apply(n,arguments));return a(r,e.prototype),r}return new(Function.prototype.bind.apply(e,arguments))},e.exports}({exports:{}},Mr),Hr=function(e){function t(e){return this instanceof t?(this.maxIterations=e,void(this.count=0)):new t(e)}e.exports;return e.exports=t,t.prototype.check=function(){if(this.count+=1,this.count>this.maxIterations)throw new Error("Infinite loop detected - reached max iterations")},e.exports}({exports:{}}),Wr=function(e){function t(e){function i(e){for(var t=null,n=0;n<e.length;n++){var r=e[n];if("EmptyStatement"!==r.type){var t=a(r);"remove"===t&&e.splice(n--,1)}}}function a(e){var r=o[o.length-1],u=!1;o.push(e);var c=!1;n(e,r)&&(t(e.body),c=!0),"VariableDeclarator"===e.type&&s.push(e),"FunctionDeclaration"===e.type&&(l.push(e),u=!0);for(var p in e)"type"===p||c&&"body"===p||p in e&&e[p]&&"object"==typeof e[p]&&(e[p].type?a(e[p]):Array.isArray(e[p])&&i(e[p]));return o.pop(),u?"remove":void 0}var o=[],s=[],l=[];return Array.isArray(e)?(i(e),r(e,s,l)):a(e),e}function n(e,t){return"Program"===e.type?!0:"BlockStatement"!==e.type||!t||"FunctionExpression"!==t.type&&"FunctionDeclaration"!==t.type?void 0:!0}function r(e,t,n){if(t&&t.length){for(var r=[],i=0;i<t.length;i++)r.push({type:"VariableDeclarator",id:t[i].id,init:null});e.unshift({type:"VariableDeclaration",kind:"var",declarations:r})}if(n&&n.length)for(var i=0;i<n.length;i++)e.unshift(n[i])}e.exports;return e.exports=t,e.exports}({exports:{}}),zr=function(e){var t=e.exports;return function(e,n){"function"==typeof define&&define.amd?define(["exports"],n):n("undefined"!=typeof t?t:e.esprima={})}(this,function(e){function t(e,t){if(!e)throw new Error("ASSERT: "+t)}function n(e,t){return ht.slice(e,t)}function r(e){return"0123456789".indexOf(e)>=0}function i(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function a(e){return"01234567".indexOf(e)>=0}function o(e){return" "===e||" "===e||"\x0B"===e||"\f"===e||"\xa0"===e||e.charCodeAt(0)>=5760&&"\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\ufeff".indexOf(e)>=0}function s(e){return"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e}function l(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e.charCodeAt(0)>=128&&pt.NonAsciiIdentifierStart.test(e)}function u(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&pt.NonAsciiIdentifierPart.test(e)}function c(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function p(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0}return!1}function h(e){return"eval"===e||"arguments"===e}function f(e){var t=!1;switch(e.length){case 2:t="if"===e||"in"===e||"do"===e;break;case 3:t="var"===e||"for"===e||"new"===e||"try"===e;break;case 4:t="this"===e||"else"===e||"case"===e||"void"===e||"with"===e;break;case 5:t="while"===e||"break"===e||"catch"===e||"throw"===e;break;case 6:t="return"===e||"typeof"===e||"delete"===e||"switch"===e;break;case 7:t="default"===e||"finally"===e;break;case 8:t="function"===e||"continue"===e||"debugger"===e;break;case 10:t="instanceof"===e}if(t)return!0;switch(e){case"const":return!0;case"yield":case"let":return!0}return ft&&p(e)?!0:c(e)}function d(){var e,t,n;for(t=!1,n=!1;yt>dt;)if(e=ht[dt],n)e=ht[dt++],s(e)&&(n=!1,"\r"===e&&"\n"===ht[dt]&&++dt,++vt,mt=dt);else if(t)s(e)?("\r"===e&&"\n"===ht[dt+1]&&++dt,++vt,++dt,mt=dt,dt>=yt&&E({},ct.UnexpectedToken,"ILLEGAL")):(e=ht[dt++],dt>=yt&&E({},ct.UnexpectedToken,"ILLEGAL"),"*"===e&&(e=ht[dt],"/"===e&&(++dt,t=!1)));else if("/"===e)if(e=ht[dt+1],"/"===e)dt+=2,n=!0;else{if("*"!==e)break;dt+=2,t=!0,dt>=yt&&E({},ct.UnexpectedToken,"ILLEGAL")}else if(o(e))++dt;else{if(!s(e))break;++dt,"\r"===e&&"\n"===ht[dt]&&++dt,++vt,mt=dt}}function v(e){var t,n,r,a=0;for(n="u"===e?4:2,t=0;n>t;++t){if(!(yt>dt&&i(ht[dt])))return"";r=ht[dt++],a=16*a+"0123456789abcdef".indexOf(r.toLowerCase())}return String.fromCharCode(a)}function m(){var e,t,n,r;if(e=ht[dt],l(e)){if(t=dt,"\\"===e){if(++dt,"u"!==ht[dt])return;if(++dt,r=dt,e=v("u")){if("\\"===e||!l(e))return;n=e}else dt=r,n="u"}else n=ht[dt++];for(;yt>dt&&(e=ht[dt],u(e));)if("\\"===e){if(++dt,"u"!==ht[dt])return;if(++dt,r=dt,e=v("u")){if("\\"===e||!u(e))return;n+=e}else dt=r,n+="u"}else n+=ht[dt++];return 1===n.length?{type:ot.Identifier,value:n,lineNumber:vt,lineStart:mt,range:[t,dt]}:f(n)?{type:ot.Keyword,value:n,lineNumber:vt,lineStart:mt,range:[t,dt]}:"null"===n?{type:ot.NullLiteral,value:n,lineNumber:vt,lineStart:mt,range:[t,dt]}:"true"===n||"false"===n?{type:ot.BooleanLiteral,value:n,lineNumber:vt,lineStart:mt,range:[t,dt]}:{type:ot.Identifier,value:n,lineNumber:vt,lineStart:mt,range:[t,dt]}}}function y(){var e,t,n,i=dt,a=ht[dt];return";"===a||"{"===a||"}"===a?(++dt,{type:ot.Punctuator,value:a,lineNumber:vt,lineStart:mt,range:[i,dt]}):","===a||"("===a||")"===a?(++dt,{type:ot.Punctuator,value:a,lineNumber:vt,lineStart:mt,range:[i,dt]}):(e=ht[dt+1],"."!==a||r(e)?(t=ht[dt+2],n=ht[dt+3],">"===a&&">"===e&&">"===t&&"="===n?(dt+=4,{type:ot.Punctuator,value:">>>=",lineNumber:vt,lineStart:mt,range:[i,dt]}):"="===a&&"="===e&&"="===t?(dt+=3,{type:ot.Punctuator,value:"===",lineNumber:vt,lineStart:mt,range:[i,dt]}):"!"===a&&"="===e&&"="===t?(dt+=3,{type:ot.Punctuator,value:"!==",lineNumber:vt,lineStart:mt,range:[i,dt]}):">"===a&&">"===e&&">"===t?(dt+=3,{type:ot.Punctuator,value:">>>",lineNumber:vt,lineStart:mt,range:[i,dt]}):"<"===a&&"<"===e&&"="===t?(dt+=3,{type:ot.Punctuator,value:"<<=",lineNumber:vt,lineStart:mt,range:[i,dt]}):">"===a&&">"===e&&"="===t?(dt+=3,{type:ot.Punctuator,value:">>=",lineNumber:vt,lineStart:mt,range:[i,dt]}):"="===e&&"<>=!+-*%&|^/".indexOf(a)>=0?(dt+=2,{type:ot.Punctuator,value:a+e,lineNumber:vt,lineStart:mt,range:[i,dt]}):a===e&&"+-<>&|".indexOf(a)>=0&&"+-<>&|".indexOf(e)>=0?(dt+=2,{type:ot.Punctuator,value:a+e,lineNumber:vt,lineStart:mt,range:[i,dt]}):"[]<>+-*%&|^!~?:=/".indexOf(a)>=0?{type:ot.Punctuator,value:ht[dt++],lineNumber:vt,lineStart:mt,range:[i,dt]}:void 0):{type:ot.Punctuator,value:ht[dt++],lineNumber:vt,lineStart:mt,range:[i,dt]})}function g(){var e,n,o;if(o=ht[dt],t(r(o)||"."===o,"Numeric literal must start with a decimal digit or a decimal point"),n=dt,e="","."!==o){if(e=ht[dt++],o=ht[dt],"0"===e){if("x"===o||"X"===o){for(e+=ht[dt++];yt>dt&&(o=ht[dt],i(o));)e+=ht[dt++];return e.length<=2&&E({},ct.UnexpectedToken,"ILLEGAL"),yt>dt&&(o=ht[dt],l(o)&&E({},ct.UnexpectedToken,"ILLEGAL")),{type:ot.NumericLiteral,value:parseInt(e,16),lineNumber:vt,lineStart:mt,range:[n,dt]}}if(a(o)){for(e+=ht[dt++];yt>dt&&(o=ht[dt],a(o));)e+=ht[dt++];return yt>dt&&(o=ht[dt],(l(o)||r(o))&&E({},ct.UnexpectedToken,"ILLEGAL")),{type:ot.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:vt,lineStart:mt,range:[n,dt]}}r(o)&&E({},ct.UnexpectedToken,"ILLEGAL")}for(;yt>dt&&(o=ht[dt],r(o));)e+=ht[dt++]}if("."===o)for(e+=ht[dt++];yt>dt&&(o=ht[dt],r(o));)e+=ht[dt++];if("e"===o||"E"===o)if(e+=ht[dt++],o=ht[dt],"+"!==o&&"-"!==o||(e+=ht[dt++]),o=ht[dt],r(o))for(e+=ht[dt++];yt>dt&&(o=ht[dt],r(o));)e+=ht[dt++];else o="character "+o,dt>=yt&&(o="<end>"),E({},ct.UnexpectedToken,"ILLEGAL");return yt>dt&&(o=ht[dt],l(o)&&E({},ct.UnexpectedToken,"ILLEGAL")),{type:ot.NumericLiteral,value:parseFloat(e),lineNumber:vt,lineStart:mt,range:[n,dt]}}function b(){var e,n,r,i,o,l,u="",c=!1;for(e=ht[dt],t("'"===e||'"'===e,"String literal must starts with a quote"),n=dt,++dt;yt>dt;){if(r=ht[dt++],r===e){e="";break}if("\\"===r)if(r=ht[dt++],s(r))++vt,"\r"===r&&"\n"===ht[dt]&&++dt;else switch(r){case"n":u+="\n";break;case"r":u+="\r";break;case"t":u+=" ";break;case"u":case"x":l=dt,o=v(r),o?u+=o:(dt=l,u+=r);break;case"b":u+="\b";break;case"f":u+="\f";break;case"v":u+="\x0B";break;default:a(r)?(i="01234567".indexOf(r),0!==i&&(c=!0),yt>dt&&a(ht[dt])&&(c=!0,i=8*i+"01234567".indexOf(ht[dt++]),"0123".indexOf(r)>=0&&yt>dt&&a(ht[dt])&&(i=8*i+"01234567".indexOf(ht[dt++]))),u+=String.fromCharCode(i)):u+=r}else{if(s(r))break;u+=r}}return""!==e&&E({},ct.UnexpectedToken,"ILLEGAL"),{type:ot.StringLiteral,value:u,octal:c,lineNumber:vt,lineStart:mt,range:[n,dt]}}function _(){var e,n,r,i,a,o,l,c=!1,p=!1;for(gt=null,d(),r=dt,n=ht[dt],t("/"===n,"Regular expression literal must start with a slash"),e=ht[dt++];yt>dt;)if(n=ht[dt++],e+=n,"\\"===n)n=ht[dt++],s(n)&&E({},ct.UnterminatedRegExp),e+=n;else if(c)"]"===n&&(c=!1);else{if("/"===n){p=!0;break}"["===n?c=!0:s(n)&&E({},ct.UnterminatedRegExp)}for(p||E({},ct.UnterminatedRegExp),i=e.substr(1,e.length-2),a="";yt>dt&&(n=ht[dt],u(n));)if(++dt,"\\"===n&&yt>dt)if(n=ht[dt],"u"===n)if(++dt,l=dt,n=v("u"))for(a+=n,e+="\\u";dt>l;++l)e+=ht[l];else dt=l,a+="u",e+="\\u";else e+="\\";else a+=n,e+=n;try{o=new RegExp(i,a)}catch(h){E({},ct.InvalidRegExp)}return{literal:e,value:o,range:[r,dt]}}function x(e){return e.type===ot.Identifier||e.type===ot.Keyword||e.type===ot.BooleanLiteral||e.type===ot.NullLiteral}function w(){var e,t;return d(),dt>=yt?{type:ot.EOF,lineNumber:vt,lineStart:mt,range:[dt,dt]}:(t=y(),"undefined"!=typeof t?t:(e=ht[dt],"'"===e||'"'===e?b():"."===e||r(e)?g():(t=m(),"undefined"!=typeof t?t:void E({},ct.UnexpectedToken,"ILLEGAL"))))}function k(){var e;return gt?(dt=gt.range[1],vt=gt.lineNumber,mt=gt.lineStart,e=gt,gt=null,e):(gt=null,w())}function S(){var e,t,n;return null!==gt?gt:(e=dt,t=vt,n=mt,gt=w(),dt=e,vt=t,mt=n,gt)}function C(){var e,t,n,r;return e=dt,t=vt,n=mt,d(),r=vt!==t,dt=e,vt=t,mt=n,r}function E(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,function(e,t){return r[t]||""});throw"number"==typeof e.lineNumber?(n=new Error("Line "+e.lineNumber+": "+i),n.index=e.range[0],n.lineNumber=e.lineNumber,n.column=e.range[0]-mt+1):(n=new Error("Line "+vt+": "+i),n.index=dt,n.lineNumber=vt,n.column=dt-mt+1),n}function O(){try{E.apply(null,arguments)}catch(e){if(!_t.errors)throw e;_t.errors.push(e)}}function $(e){if(e.type===ot.EOF&&E(e,ct.UnexpectedEOS),e.type===ot.NumericLiteral&&E(e,ct.UnexpectedNumber),e.type===ot.StringLiteral&&E(e,ct.UnexpectedString),e.type===ot.Identifier&&E(e,ct.UnexpectedIdentifier),e.type===ot.Keyword){if(c(e.value))E(e,ct.UnexpectedReserved);else if(ft&&p(e.value))return void O(e,ct.StrictReservedWord);E(e,ct.UnexpectedToken,e.value)}E(e,ct.UnexpectedToken,e.value)}function A(e){var t=k();t.type===ot.Punctuator&&t.value===e||$(t)}function N(e){var t=k();t.type===ot.Keyword&&t.value===e||$(t)}function L(e){var t=S();return t.type===ot.Punctuator&&t.value===e}function I(e){var t=S();return t.type===ot.Keyword&&t.value===e}function P(){var e=S(),t=e.value;return e.type!==ot.Punctuator?!1:"="===t||"*="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t}function j(){var e,t;if(";"===ht[dt])return void k();if(t=vt,d(),vt===t){if(L(";"))return void k();e=S(),e.type===ot.EOF||L("}")||$(e)}}function T(e){return e.type===lt.Identifier||e.type===lt.MemberExpression}function F(){var e=[];for(A("[");!L("]");)L(",")?(k(),e.push(null)):(e.push(ue()),L("]")||A(","));return A("]"),{type:lt.ArrayExpression,elements:e}}function D(e,t){var n,r;return n=ft,r=Fe(),t&&ft&&h(e[0].name)&&O(t,ct.StrictParamName),ft=n,{type:lt.FunctionExpression,id:null,params:e,defaults:[],body:r,rest:null,generator:!1,expression:!1}}function R(){var e=k();return e.type===ot.StringLiteral||e.type===ot.NumericLiteral?(ft&&e.octal&&O(e,ct.StrictOctalLiteral),Je(e)):{type:lt.Identifier,name:e.value}}function B(){var e,t,n,r;return e=S(),e.type===ot.Identifier?(n=R(),"get"!==e.value||L(":")?"set"!==e.value||L(":")?(A(":"),{type:lt.Property,key:n,value:ue(),kind:"init"}):(t=R(),A("("),e=S(),e.type!==ot.Identifier?(A(")"),O(e,ct.UnexpectedToken,e.value),{type:lt.Property,key:t,value:D([]),kind:"set"}):(r=[fe()],A(")"),{type:lt.Property,key:t,value:D(r,e),kind:"set"})):(t=R(),A("("),A(")"),{type:lt.Property,key:t,value:D([]),kind:"get"})):e.type!==ot.EOF&&e.type!==ot.Punctuator?(t=R(),A(":"),{type:lt.Property,key:t,value:ue(),kind:"init"}):void $(e)}function U(){var e,t,n,r=[],i={},a=String;for(A("{");!L("}");)e=B(),t=e.key.type===lt.Identifier?e.key.name:a(e.key.value),n="init"===e.kind?ut.Data:"get"===e.kind?ut.Get:ut.Set,Object.prototype.hasOwnProperty.call(i,t)?(i[t]===ut.Data?ft&&n===ut.Data?O({},ct.StrictDuplicateProperty):n!==ut.Data&&O({},ct.AccessorDataProperty):n===ut.Data?O({},ct.AccessorDataProperty):i[t]&n&&O({},ct.AccessorGetSet),i[t]|=n):i[t]=n,r.push(e),L("}")||A(",");return A("}"),{type:lt.ObjectExpression,properties:r}}function M(){var e;return A("("),e=ce(),A(")"),e}function V(){var e=S(),t=e.type;if(t===ot.Identifier)return{type:lt.Identifier,name:k().value};if(t===ot.StringLiteral||t===ot.NumericLiteral)return ft&&e.octal&&O(e,ct.StrictOctalLiteral),Je(k());if(t===ot.Keyword){if(I("this"))return k(),{type:lt.ThisExpression};if(I("function"))return Re()}return t===ot.BooleanLiteral?(k(),e.value="true"===e.value,Je(e)):t===ot.NullLiteral?(k(),e.value=null,Je(e)):L("[")?F():L("{")?U():L("(")?M():L("/")||L("/=")?Je(_()):$(k())}function H(){var e=[];if(A("("),!L(")"))for(;yt>dt&&(e.push(ue()),!L(")"));)A(",");return A(")"),e}function W(){var e=k();return x(e)||$(e),{type:lt.Identifier,name:e.value}}function z(){return A("."),W()}function q(){var e;return A("["),e=ce(),A("]"),e}function G(){var e;return N("new"),e={type:lt.NewExpression,callee:K(),arguments:[]},L("(")&&(e.arguments=H()),e}function J(){var e;for(e=I("new")?G():V();L(".")||L("[")||L("(");)e=L("(")?{type:lt.CallExpression,callee:e,arguments:H()}:L("[")?{type:lt.MemberExpression,computed:!0,object:e,property:q()}:{type:lt.MemberExpression,computed:!1,object:e,property:z()};return e}function K(){var e;for(e=I("new")?G():V();L(".")||L("[");)e=L("[")?{type:lt.MemberExpression,computed:!0,object:e,property:q()}:{type:lt.MemberExpression,computed:!1,object:e,property:z()};return e}function Q(){var e,t=J();return e=S(),e.type!==ot.Punctuator?t:(!L("++")&&!L("--")||C()||(ft&&t.type===lt.Identifier&&h(t.name)&&O({},ct.StrictLHSPostfix),T(t)||O({},ct.InvalidLHSInAssignment),t={type:lt.UpdateExpression,operator:k().value,argument:t,prefix:!1}),t)}function X(){var e,t;return e=S(),e.type!==ot.Punctuator&&e.type!==ot.Keyword?Q():L("++")||L("--")?(e=k(),t=X(),ft&&t.type===lt.Identifier&&h(t.name)&&O({},ct.StrictLHSPrefix),T(t)||O({},ct.InvalidLHSInAssignment),t={type:lt.UpdateExpression,operator:e.value,argument:t,prefix:!0}):L("+")||L("-")||L("~")||L("!")?t={type:lt.UnaryExpression,operator:k().value,argument:X(),prefix:!0}:I("delete")||I("void")||I("typeof")?(t={type:lt.UnaryExpression,operator:k().value,argument:X(),prefix:!0},ft&&"delete"===t.operator&&t.argument.type===lt.Identifier&&O({},ct.StrictDelete),t):Q()}function Z(){for(var e=X();L("*")||L("/")||L("%");)e={type:lt.BinaryExpression,operator:k().value,left:e,right:X()};return e}function Y(){for(var e=Z();L("+")||L("-");)e={type:lt.BinaryExpression,operator:k().value,left:e,right:Z()};return e}function ee(){for(var e=Y();L("<<")||L(">>")||L(">>>");)e={type:lt.BinaryExpression,operator:k().value,left:e,right:Y()};return e}function te(){var e,t;for(t=bt.allowIn,bt.allowIn=!0,e=ee();L("<")||L(">")||L("<=")||L(">=")||t&&I("in")||I("instanceof");)e={type:lt.BinaryExpression,operator:k().value,left:e,right:ee()};return bt.allowIn=t,e}function ne(){for(var e=te();L("==")||L("!=")||L("===")||L("!==");)e={type:lt.BinaryExpression,operator:k().value,left:e,right:te()};return e}function re(){for(var e=ne();L("&");)k(),e={type:lt.BinaryExpression,operator:"&",left:e,right:ne()};return e}function ie(){for(var e=re();L("^");)k(),e={ -type:lt.BinaryExpression,operator:"^",left:e,right:re()};return e}function ae(){for(var e=ie();L("|");)k(),e={type:lt.BinaryExpression,operator:"|",left:e,right:ie()};return e}function oe(){for(var e=ae();L("&&");)k(),e={type:lt.LogicalExpression,operator:"&&",left:e,right:ae()};return e}function se(){for(var e=oe();L("||");)k(),e={type:lt.LogicalExpression,operator:"||",left:e,right:oe()};return e}function le(){var e,t,n;return e=se(),L("?")&&(k(),t=bt.allowIn,bt.allowIn=!0,n=ue(),bt.allowIn=t,A(":"),e={type:lt.ConditionalExpression,test:e,consequent:n,alternate:ue()}),e}function ue(){var e,t;return e=S(),t=le(),P()&&(T(t)||O({},ct.InvalidLHSInAssignment),ft&&t.type===lt.Identifier&&h(t.name)&&O(e,ct.StrictLHSAssignment),t={type:lt.AssignmentExpression,operator:k().value,left:t,right:ue()}),t}function ce(){var e=ue();if(L(","))for(e={type:lt.SequenceExpression,expressions:[e]};yt>dt&&L(",");)k(),e.expressions.push(ue());return e}function pe(){for(var e,t=[];yt>dt&&!L("}")&&(e=Be(),"undefined"!=typeof e);)t.push(e);return t}function he(){var e;return A("{"),e=pe(),A("}"),{type:lt.BlockStatement,body:e}}function fe(){var e=k();return e.type!==ot.Identifier&&$(e),{type:lt.Identifier,name:e.value}}function de(e){var t=fe(),n=null;return ft&&h(t.name)&&O({},ct.StrictVarName),"const"===e?(A("="),n=ue()):L("=")&&(k(),n=ue()),{type:lt.VariableDeclarator,id:t,init:n}}function ve(e){var t=[];do{if(t.push(de(e)),!L(","))break;k()}while(yt>dt);return t}function me(){var e;return N("var"),e=ve(),j(),{type:lt.VariableDeclaration,declarations:e,kind:"var"}}function ye(e){var t;return N(e),t=ve(e),j(),{type:lt.VariableDeclaration,declarations:t,kind:e}}function ge(){return A(";"),{type:lt.EmptyStatement}}function be(){var e=ce();return j(),{type:lt.ExpressionStatement,expression:e}}function _e(){var e,t,n;return N("if"),A("("),e=ce(),A(")"),t=Te(),I("else")?(k(),n=Te()):n=null,{type:lt.IfStatement,test:e,consequent:t,alternate:n}}function xe(){var e,t,n;return N("do"),n=bt.inIteration,bt.inIteration=!0,e=Te(),bt.inIteration=n,N("while"),A("("),t=ce(),A(")"),L(";")&&k(),{type:lt.DoWhileStatement,body:e,test:t}}function we(){var e,t,n;return N("while"),A("("),e=ce(),A(")"),n=bt.inIteration,bt.inIteration=!0,t=Te(),bt.inIteration=n,{type:lt.WhileStatement,test:e,body:t}}function ke(){var e=k();return{type:lt.VariableDeclaration,declarations:ve(),kind:e.value}}function Se(){var e,t,n,r,i,a,o;return e=t=n=null,N("for"),A("("),L(";")?k():(I("var")||I("let")?(bt.allowIn=!1,e=ke(),bt.allowIn=!0,1===e.declarations.length&&I("in")&&(k(),r=e,i=ce(),e=null)):(bt.allowIn=!1,e=ce(),bt.allowIn=!0,I("in")&&(T(e)||O({},ct.InvalidLHSInForIn),k(),r=e,i=ce(),e=null)),"undefined"==typeof r&&A(";")),"undefined"==typeof r&&(L(";")||(t=ce()),A(";"),L(")")||(n=ce())),A(")"),o=bt.inIteration,bt.inIteration=!0,a=Te(),bt.inIteration=o,"undefined"==typeof r?{type:lt.ForStatement,init:e,test:t,update:n,body:a}:{type:lt.ForInStatement,left:r,right:i,body:a,each:!1}}function Ce(){var e,t=null;return N("continue"),";"===ht[dt]?(k(),bt.inIteration||E({},ct.IllegalContinue),{type:lt.ContinueStatement,label:null}):C()?(bt.inIteration||E({},ct.IllegalContinue),{type:lt.ContinueStatement,label:null}):(e=S(),e.type===ot.Identifier&&(t=fe(),Object.prototype.hasOwnProperty.call(bt.labelSet,t.name)||E({},ct.UnknownLabel,t.name)),j(),null!==t||bt.inIteration||E({},ct.IllegalContinue),{type:lt.ContinueStatement,label:t})}function Ee(){var e,t=null;return N("break"),";"===ht[dt]?(k(),bt.inIteration||bt.inSwitch||E({},ct.IllegalBreak),{type:lt.BreakStatement,label:null}):C()?(bt.inIteration||bt.inSwitch||E({},ct.IllegalBreak),{type:lt.BreakStatement,label:null}):(e=S(),e.type===ot.Identifier&&(t=fe(),Object.prototype.hasOwnProperty.call(bt.labelSet,t.name)||E({},ct.UnknownLabel,t.name)),j(),null!==t||bt.inIteration||bt.inSwitch||E({},ct.IllegalBreak),{type:lt.BreakStatement,label:t})}function Oe(){var e,t=null;return N("return"),bt.inFunctionBody||O({},ct.IllegalReturn)," "===ht[dt]&&l(ht[dt+1])?(t=ce(),j(),{type:lt.ReturnStatement,argument:t}):C()?{type:lt.ReturnStatement,argument:null}:(L(";")||(e=S(),L("}")||e.type===ot.EOF||(t=ce())),j(),{type:lt.ReturnStatement,argument:t})}function $e(){var e,t;return ft&&O({},ct.StrictModeWith),N("with"),A("("),e=ce(),A(")"),t=Te(),{type:lt.WithStatement,object:e,body:t}}function Ae(){var e,t,n=[];for(I("default")?(k(),e=null):(N("case"),e=ce()),A(":");yt>dt&&!(L("}")||I("default")||I("case"))&&(t=Te(),"undefined"!=typeof t);)n.push(t);return{type:lt.SwitchCase,test:e,consequent:n}}function Ne(){var e,t,n,r,i;if(N("switch"),A("("),e=ce(),A(")"),A("{"),t=[],L("}"))return k(),{type:lt.SwitchStatement,discriminant:e,cases:t};for(r=bt.inSwitch,bt.inSwitch=!0,i=!1;yt>dt&&!L("}");)n=Ae(),null===n.test&&(i&&E({},ct.MultipleDefaultsInSwitch),i=!0),t.push(n);return bt.inSwitch=r,A("}"),{type:lt.SwitchStatement,discriminant:e,cases:t}}function Le(){var e;return N("throw"),C()&&E({},ct.NewlineAfterThrow),e=ce(),j(),{type:lt.ThrowStatement,argument:e}}function Ie(){var e;return N("catch"),A("("),L(")")&&$(S()),e=fe(),ft&&h(e.name)&&O({},ct.StrictCatchVariable),A(")"),{type:lt.CatchClause,param:e,body:he()}}function Pe(){var e,t=[],n=null;return N("try"),e=he(),I("catch")&&t.push(Ie()),I("finally")&&(k(),n=he()),0!==t.length||n||E({},ct.NoCatchOrFinally),{type:lt.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:n}}function je(){return N("debugger"),j(),{type:lt.DebuggerStatement}}function Te(){var e,t,n=S();if(n.type===ot.EOF&&$(n),n.type===ot.Punctuator)switch(n.value){case";":return ge();case"{":return he();case"(":return be()}if(n.type===ot.Keyword)switch(n.value){case"break":return Ee();case"continue":return Ce();case"debugger":return je();case"do":return xe();case"for":return Se();case"function":return De();case"if":return _e();case"return":return Oe();case"switch":return Ne();case"throw":return Le();case"try":return Pe();case"var":return me();case"while":return we();case"with":return $e()}return e=ce(),e.type===lt.Identifier&&L(":")?(k(),Object.prototype.hasOwnProperty.call(bt.labelSet,e.name)&&E({},ct.Redeclaration,"Label",e.name),bt.labelSet[e.name]=!0,t=Te(),delete bt.labelSet[e.name],{type:lt.LabeledStatement,label:e,body:t}):(j(),{type:lt.ExpressionStatement,expression:e})}function Fe(){var e,t,r,i,a,o,s,l,u=[];for(A("{");yt>dt&&(t=S(),t.type===ot.StringLiteral)&&(e=Be(),u.push(e),e.expression.type===lt.Literal);)r=n(t.range[0]+1,t.range[1]-1),"use strict"===r?(ft=!0,i&&O(i,ct.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(a=bt.labelSet,o=bt.inIteration,s=bt.inSwitch,l=bt.inFunctionBody,bt.labelSet={},bt.inIteration=!1,bt.inSwitch=!1,bt.inFunctionBody=!0;yt>dt&&!L("}")&&(e=Be(),"undefined"!=typeof e);)u.push(e);return A("}"),bt.labelSet=a,bt.inIteration=o,bt.inSwitch=s,bt.inFunctionBody=l,{type:lt.BlockStatement,body:u}}function De(){var e,t,n,r,i,a,o,s,l,u=[];if(N("function"),r=S(),e=fe(),ft?h(r.value)&&O(r,ct.StrictFunctionName):h(r.value)?(a=r,o=ct.StrictFunctionName):p(r.value)&&(a=r,o=ct.StrictReservedWord),A("("),!L(")"))for(l={};yt>dt&&(r=S(),t=fe(),ft?(h(r.value)&&(i=r,o=ct.StrictParamName),Object.prototype.hasOwnProperty.call(l,r.value)&&(i=r,o=ct.StrictParamDupe)):a||(h(r.value)?(a=r,o=ct.StrictParamName):p(r.value)?(a=r,o=ct.StrictReservedWord):Object.prototype.hasOwnProperty.call(l,r.value)&&(a=r,o=ct.StrictParamDupe)),u.push(t),l[t.name]=!0,!L(")"));)A(",");return A(")"),s=ft,n=Fe(),ft&&a&&E(a,o),ft&&i&&O(i,o),ft=s,{type:lt.FunctionDeclaration,id:e,params:u,defaults:[],body:n,rest:null,generator:!1,expression:!1}}function Re(){var e,t,n,r,i,a,o,s,l=null,u=[];if(N("function"),L("(")||(e=S(),l=fe(),ft?h(e.value)&&O(e,ct.StrictFunctionName):h(e.value)?(n=e,r=ct.StrictFunctionName):p(e.value)&&(n=e,r=ct.StrictReservedWord)),A("("),!L(")"))for(s={};yt>dt&&(e=S(),i=fe(),ft?(h(e.value)&&(t=e,r=ct.StrictParamName),Object.prototype.hasOwnProperty.call(s,e.value)&&(t=e,r=ct.StrictParamDupe)):n||(h(e.value)?(n=e,r=ct.StrictParamName):p(e.value)?(n=e,r=ct.StrictReservedWord):Object.prototype.hasOwnProperty.call(s,e.value)&&(n=e,r=ct.StrictParamDupe)),u.push(i),s[i.name]=!0,!L(")"));)A(",");return A(")"),o=ft,a=Fe(),ft&&n&&E(n,r),ft&&t&&O(t,r),ft=o,{type:lt.FunctionExpression,id:l,params:u,defaults:[],body:a,rest:null,generator:!1,expression:!1}}function Be(){var e=S();if(e.type===ot.Keyword)switch(e.value){case"const":case"let":return ye(e.value);case"function":return De();default:return Te()}return e.type!==ot.EOF?Te():void 0}function Ue(){for(var e,t,r,i,a=[];yt>dt&&(t=S(),t.type===ot.StringLiteral)&&(e=Be(),a.push(e),e.expression.type===lt.Literal);)r=n(t.range[0]+1,t.range[1]-1),"use strict"===r?(ft=!0,i&&O(i,ct.StrictOctalLiteral)):!i&&t.octal&&(i=t);for(;yt>dt&&(e=Be(),"undefined"!=typeof e);)a.push(e);return a}function Me(){var e;return ft=!1,e={type:lt.Program,body:Ue()}}function Ve(e,n,r,i,a){t("number"==typeof r,"Comment must have valid position"),_t.comments.length>0&&_t.comments[_t.comments.length-1].range[1]>r||_t.comments.push({type:e,value:n,range:[r,i],loc:a})}function He(){var e,t,n,r,i,a;for(e="",i=!1,a=!1;yt>dt;)if(t=ht[dt],a)t=ht[dt++],s(t)?(n.end={line:vt,column:dt-mt-1},a=!1,Ve("Line",e,r,dt-1,n),"\r"===t&&"\n"===ht[dt]&&++dt,++vt,mt=dt,e=""):dt>=yt?(a=!1,e+=t,n.end={line:vt,column:yt-mt},Ve("Line",e,r,yt,n)):e+=t;else if(i)s(t)?("\r"===t&&"\n"===ht[dt+1]?(++dt,e+="\r\n"):e+=t,++vt,++dt,mt=dt,dt>=yt&&E({},ct.UnexpectedToken,"ILLEGAL")):(t=ht[dt++],dt>=yt&&E({},ct.UnexpectedToken,"ILLEGAL"),e+=t,"*"===t&&(t=ht[dt],"/"===t&&(e=e.substr(0,e.length-1),i=!1,++dt,n.end={line:vt,column:dt-mt},Ve("Block",e,r,dt,n),e="")));else if("/"===t)if(t=ht[dt+1],"/"===t)n={start:{line:vt,column:dt-mt}},r=dt,dt+=2,a=!0,dt>=yt&&(n.end={line:vt,column:dt-mt},a=!1,Ve("Line",e,r,dt,n));else{if("*"!==t)break;r=dt,dt+=2,i=!0,n={start:{line:vt,column:dt-mt-2}},dt>=yt&&E({},ct.UnexpectedToken,"ILLEGAL")}else if(o(t))++dt;else{if(!s(t))break;++dt,"\r"===t&&"\n"===ht[dt]&&++dt,++vt,mt=dt}}function We(){var e,t,n,r=[];for(e=0;e<_t.comments.length;++e)t=_t.comments[e],n={type:t.type,value:t.value},_t.range&&(n.range=t.range),_t.loc&&(n.loc=t.loc),r.push(n);_t.comments=r}function ze(){var e,t,r,i,a;return d(),e=dt,t={start:{line:vt,column:dt-mt}},r=_t.advance(),t.end={line:vt,column:dt-mt},r.type!==ot.EOF&&(i=[r.range[0],r.range[1]],a=n(r.range[0],r.range[1]),_t.tokens.push({type:st[r.type],value:a,range:i,loc:t})),r}function qe(){var e,t,n,r;return d(),e=dt,t={start:{line:vt,column:dt-mt}},n=_t.scanRegExp(),t.end={line:vt,column:dt-mt},_t.tokens.length>0&&(r=_t.tokens[_t.tokens.length-1],r.range[0]===e&&"Punctuator"===r.type&&("/"!==r.value&&"/="!==r.value||_t.tokens.pop())),_t.tokens.push({type:"RegularExpression",value:n.literal,range:[e,dt],loc:t}),n}function Ge(){var e,t,n,r=[];for(e=0;e<_t.tokens.length;++e)t=_t.tokens[e],n={type:t.type,value:t.value},_t.range&&(n.range=t.range),_t.loc&&(n.loc=t.loc),r.push(n);_t.tokens=r}function Je(e){return{type:lt.Literal,value:e.value}}function Ke(e){return{type:lt.Literal,value:e.value,raw:n(e.range[0],e.range[1])}}function Qe(){var e={};return e.range=[dt,dt],e.loc={start:{line:vt,column:dt-mt},end:{line:vt,column:dt-mt}},e.end=function(){this.range[1]=dt,this.loc.end.line=vt,this.loc.end.column=dt-mt},e.applyGroup=function(e){_t.range&&(e.groupRange=[this.range[0],this.range[1]]),_t.loc&&(e.groupLoc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e.apply=function(e){_t.range&&(e.range=[this.range[0],this.range[1]]),_t.loc&&(e.loc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e}function Xe(){var e,t;return d(),e=Qe(),A("("),t=ce(),A(")"),e.end(),e.applyGroup(t),t}function Ze(){var e,t;for(d(),e=Qe(),t=I("new")?G():V();L(".")||L("[");)L("[")?(t={type:lt.MemberExpression,computed:!0,object:t,property:q()},e.end(),e.apply(t)):(t={type:lt.MemberExpression,computed:!1,object:t,property:z()},e.end(),e.apply(t));return t}function Ye(){var e,t;for(d(),e=Qe(),t=I("new")?G():V();L(".")||L("[")||L("(");)L("(")?(t={type:lt.CallExpression,callee:t,arguments:H()},e.end(),e.apply(t)):L("[")?(t={type:lt.MemberExpression,computed:!0,object:t,property:q()},e.end(),e.apply(t)):(t={type:lt.MemberExpression,computed:!1,object:t,property:z()},e.end(),e.apply(t));return t}function et(e){var t,n,r;t="[object Array]"===Object.prototype.toString.apply(e)?[]:{};for(n in e)e.hasOwnProperty(n)&&"groupRange"!==n&&"groupLoc"!==n&&(r=e[n],null===r||"object"!=typeof r||r instanceof RegExp?t[n]=r:t[n]=et(r));return t}function tt(e,t){return function(n){function r(e){return e.type===lt.LogicalExpression||e.type===lt.BinaryExpression}function i(n){var a,o;r(n.left)&&i(n.left),r(n.right)&&i(n.right),e&&(n.left.groupRange||n.right.groupRange?(a=n.left.groupRange?n.left.groupRange[0]:n.left.range[0],o=n.right.groupRange?n.right.groupRange[1]:n.right.range[1],n.range=[a,o]):"undefined"==typeof n.range&&(a=n.left.range[0],o=n.right.range[1],n.range=[a,o])),t&&(n.left.groupLoc||n.right.groupLoc?(a=n.left.groupLoc?n.left.groupLoc.start:n.left.loc.start,o=n.right.groupLoc?n.right.groupLoc.end:n.right.loc.end,n.loc={start:a,end:o}):"undefined"==typeof n.loc&&(n.loc={start:n.left.loc.start,end:n.right.loc.end}))}return function(){var a,o;return d(),a=Qe(),o=n.apply(null,arguments),a.end(),e&&"undefined"==typeof o.range&&a.apply(o),t&&"undefined"==typeof o.loc&&a.apply(o),r(o)&&i(o),o}}}function nt(){var e;_t.comments&&(_t.skipComment=d,d=He),_t.raw&&(_t.createLiteral=Je,Je=Ke),(_t.range||_t.loc)&&(_t.parseGroupExpression=M,_t.parseLeftHandSideExpression=K,_t.parseLeftHandSideExpressionAllowCall=J,M=Xe,K=Ze,J=Ye,e=tt(_t.range,_t.loc),_t.parseAdditiveExpression=Y,_t.parseAssignmentExpression=ue,_t.parseBitwiseANDExpression=re,_t.parseBitwiseORExpression=ae,_t.parseBitwiseXORExpression=ie,_t.parseBlock=he,_t.parseFunctionSourceElements=Fe,_t.parseCatchClause=Ie,_t.parseComputedMember=q,_t.parseConditionalExpression=le,_t.parseConstLetDeclaration=ye,_t.parseEqualityExpression=ne,_t.parseExpression=ce,_t.parseForVariableDeclaration=ke,_t.parseFunctionDeclaration=De,_t.parseFunctionExpression=Re,_t.parseLogicalANDExpression=oe,_t.parseLogicalORExpression=se,_t.parseMultiplicativeExpression=Z,_t.parseNewExpression=G,_t.parseNonComputedProperty=W,_t.parseObjectProperty=B,_t.parseObjectPropertyKey=R,_t.parsePostfixExpression=Q,_t.parsePrimaryExpression=V,_t.parseProgram=Me,_t.parsePropertyFunction=D,_t.parseRelationalExpression=te,_t.parseStatement=Te,_t.parseShiftExpression=ee,_t.parseSwitchCase=Ae,_t.parseUnaryExpression=X,_t.parseVariableDeclaration=de,_t.parseVariableIdentifier=fe,Y=e(_t.parseAdditiveExpression),ue=e(_t.parseAssignmentExpression),re=e(_t.parseBitwiseANDExpression),ae=e(_t.parseBitwiseORExpression),ie=e(_t.parseBitwiseXORExpression),he=e(_t.parseBlock),Fe=e(_t.parseFunctionSourceElements),Ie=e(_t.parseCatchClause),q=e(_t.parseComputedMember),le=e(_t.parseConditionalExpression),ye=e(_t.parseConstLetDeclaration),ne=e(_t.parseEqualityExpression),ce=e(_t.parseExpression),ke=e(_t.parseForVariableDeclaration),De=e(_t.parseFunctionDeclaration),Re=e(_t.parseFunctionExpression),K=e(K),oe=e(_t.parseLogicalANDExpression),se=e(_t.parseLogicalORExpression),Z=e(_t.parseMultiplicativeExpression),G=e(_t.parseNewExpression),W=e(_t.parseNonComputedProperty),B=e(_t.parseObjectProperty),R=e(_t.parseObjectPropertyKey),Q=e(_t.parsePostfixExpression),V=e(_t.parsePrimaryExpression),Me=e(_t.parseProgram),D=e(_t.parsePropertyFunction),te=e(_t.parseRelationalExpression),Te=e(_t.parseStatement),ee=e(_t.parseShiftExpression),Ae=e(_t.parseSwitchCase),X=e(_t.parseUnaryExpression),de=e(_t.parseVariableDeclaration),fe=e(_t.parseVariableIdentifier)),"undefined"!=typeof _t.tokens&&(_t.advance=w,_t.scanRegExp=_,w=ze,_=qe)}function rt(){"function"==typeof _t.skipComment&&(d=_t.skipComment),_t.raw&&(Je=_t.createLiteral),(_t.range||_t.loc)&&(Y=_t.parseAdditiveExpression,ue=_t.parseAssignmentExpression,re=_t.parseBitwiseANDExpression,ae=_t.parseBitwiseORExpression,ie=_t.parseBitwiseXORExpression,he=_t.parseBlock,Fe=_t.parseFunctionSourceElements,Ie=_t.parseCatchClause,q=_t.parseComputedMember,le=_t.parseConditionalExpression,ye=_t.parseConstLetDeclaration,ne=_t.parseEqualityExpression,ce=_t.parseExpression,ke=_t.parseForVariableDeclaration,De=_t.parseFunctionDeclaration,Re=_t.parseFunctionExpression,M=_t.parseGroupExpression,K=_t.parseLeftHandSideExpression,J=_t.parseLeftHandSideExpressionAllowCall,oe=_t.parseLogicalANDExpression,se=_t.parseLogicalORExpression,Z=_t.parseMultiplicativeExpression,G=_t.parseNewExpression,W=_t.parseNonComputedProperty,B=_t.parseObjectProperty,R=_t.parseObjectPropertyKey,V=_t.parsePrimaryExpression,Q=_t.parsePostfixExpression,Me=_t.parseProgram,D=_t.parsePropertyFunction,te=_t.parseRelationalExpression,Te=_t.parseStatement,ee=_t.parseShiftExpression,Ae=_t.parseSwitchCase,X=_t.parseUnaryExpression,de=_t.parseVariableDeclaration,fe=_t.parseVariableIdentifier),"function"==typeof _t.scanRegExp&&(w=_t.advance,_=_t.scanRegExp)}function it(e){var t,n=e.length,r=[];for(t=0;n>t;++t)r[t]=e.charAt(t);return r}function at(e,t){var n,r;r=String,"string"==typeof e||e instanceof String||(e=r(e)),ht=e,dt=0,vt=ht.length>0?1:0,mt=0,yt=ht.length,gt=null,bt={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},_t={},"undefined"!=typeof t&&(_t.range="boolean"==typeof t.range&&t.range,_t.loc="boolean"==typeof t.loc&&t.loc,_t.raw="boolean"==typeof t.raw&&t.raw,"boolean"==typeof t.tokens&&t.tokens&&(_t.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(_t.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(_t.errors=[])),yt>0&&"undefined"==typeof ht[0]&&(e instanceof String&&(ht=e.valueOf()),"undefined"==typeof ht[0]&&(ht=it(e))),nt();try{n=Me(),"undefined"!=typeof _t.comments&&(We(),n.comments=_t.comments),"undefined"!=typeof _t.tokens&&(Ge(),n.tokens=_t.tokens),"undefined"!=typeof _t.errors&&(n.errors=_t.errors),(_t.range||_t.loc)&&(n.body=et(n.body))}catch(i){throw i}finally{rt(),_t={}}return n}var ot,st,lt,ut,ct,pt,ht,ft,dt,vt,mt,yt,gt,bt,_t;ot={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},st={},st[ot.BooleanLiteral]="Boolean",st[ot.EOF]="<end>",st[ot.Identifier]="Identifier",st[ot.Keyword]="Keyword",st[ot.NullLiteral]="Null",st[ot.NumericLiteral]="Numeric",st[ot.Punctuator]="Punctuator",st[ot.StringLiteral]="String",lt={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},ut={Data:1,Get:2,Set:4},ct={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},pt={NonAsciiIdentifierStart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),NonAsciiIdentifierPart:new RegExp("[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]")},"undefined"==typeof"esprima"[0]&&(n=function(e,t){return ht.slice(e,t).join("")}),e.version="1.0.4",e.parse=at,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in lt)lt.hasOwnProperty(e)&&(t[e]=lt[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()}),e.exports}({exports:{}}),qr=function(e,t){function n(e,t){var n=i(e),r=Object.create(t||{});return f(a(n,r))}function r(e){var t=Object.create(e||{});return function(){var e=Array.prototype.slice.call(arguments),n=e.slice(-1)[0];e=e.slice(0,-1),"string"==typeof n&&(n=m("function a(){"+n+"}").body[0].body);var r=i(n);return h(r,e,t)}}function i(e){var t="string"==typeof e?m(e):e;return y(t)}function a(e,t){function n(e){for(var t=void 0,n=0;n<e.length;n++){var r=e[n];if("EmptyStatement"!==r.type&&(t=i(r), -t instanceof v))return t}return t}function i(e){if(e)switch(e.type){case"Program":return n(e.body);case"BlockStatement":u();var r=n(e.body);return c(),r;case"FunctionDeclaration":var s=e.params.map(d),p=h(e.body,s,w);return t[e.id.name]=p;case"FunctionExpression":var s=e.params.map(d);return h(e.body,s,w);case"ReturnStatement":var p=i(e.argument);return new v("return",p);case"BreakStatement":return new v("break");case"ContinueStatement":return new v("continue");case"ExpressionStatement":return i(e.expression);case"AssignmentExpression":return m(w,e.left,e.right,e.operator);case"UpdateExpression":return m(w,e.argument,null,e.operator);case"VariableDeclaration":e.declarations.forEach(function(n){var r="let"===e.kind?w:t;n.init?r[n.id.name]=i(n.init):r[n.id.name]=void 0});break;case"SwitchStatement":var y=null,b=!1,p=i(e.discriminant),r=void 0;u();for(var k=0;null==r;)if(k<e.cases.length){if(e.cases[k].test?b=b||i(e.cases[k].test)===p:null==y&&(y=k),b){var S=n(e.cases[k].consequent);if(S instanceof v){if("break"==S.type)break;r=S}}k+=1}else{if(b||null==y)break;k=y,b=!0}return c(),r;case"IfStatement":if(i(e.test))return i(e.consequent);if(e.alternate)return i(e.alternate);case"ForStatement":var C=g(_),r=void 0;for(u(),i(e.init);i(e.test);i(e.update)){var S=i(e.body);if(S instanceof v){if("continue"==S.type)continue;if("break"==S.type)break;r=S;break}C.check()}return c(),r;case"ForInStatement":var C=g(_),r=void 0,p=i(e.right),E=e.left,O=t;u(),"VariableDeclaration"==E.type&&(i(E),E=E.declarations[0].id,"let"===E.kind&&(O=w));for(var $ in p){m(O,E,{type:"Literal",value:$});var S=i(e.body);if(S instanceof v){if("continue"==S.type)continue;if("break"==S.type)break;r=S;break}C.check()}return c(),r;case"WhileStatement":for(var C=g(_);i(e.test);)i(e.body),C.check();break;case"TryStatement":try{i(e.block)}catch(A){u();var N=e.handlers[0];N&&(w[N.param.name]=A,i(N.body)),c()}finally{e.finalizer&&i(e.finalizer)}break;case"Literal":return e.value;case"UnaryExpression":var L=i(e.argument);switch(e.operator){case"+":return+L;case"-":return-L;case"~":return~L;case"!":return!L;case"typeof":return typeof L;default:return o(e)}case"ArrayExpression":for(var I=w.Array(),k=0;k<e.elements.length;k++)I.push(i(e.elements[k]));return I;case"ObjectExpression":for(var I=w.Object(),k=0;k<e.properties.length;k++){var P=e.properties[k],p=null===P.value?P.value:i(P.value);I[P.key.value||P.key.name]=p}return I;case"NewExpression":var j=e.arguments.map(function(e){return i(e)}),O=i(e.callee);return x.applyNew(O,j);case"BinaryExpression":var T=i(e.left),S=i(e.right);switch(e.operator){case"==":return T===S;case"===":return T===S;case"!=":return T!=S;case"!==":return T!==S;case"+":return T+S;case"-":return T-S;case"*":return T*S;case"/":return T/S;case"%":return T%S;case"<":return S>T;case"<=":return S>=T;case">":return T>S;case">=":return T>=S;case"|":return T|S;case"&":return T&S;case"^":return T^S;case"instanceof":return T instanceof S;default:return o(e)}case"LogicalExpression":switch(e.operator){case"&&":return i(e.left)&&i(e.right);case"||":return i(e.left)||i(e.right);default:return o(e)}case"ThisExpression":return w["this"];case"Identifier":if("undefined"===e.name)return;if(l(w,e.name,x))return f(w[e.name]);throw new ReferenceError(e.name+" is not defined");case"CallExpression":var j=e.arguments.map(function(e){return i(e)}),F=null,O=i(e.callee);return"MemberExpression"===e.callee.type&&(F=i(e.callee.object)),O.apply(F,j);case"MemberExpression":var I=i(e.object);if(e.computed)var P=i(e.property);else var P=e.property.name;return I=x.getPropertyObject(I,P),a(I[P]);case"ConditionalExpression":var L=i(e.test);return i(L?e.consequent:e.alternate);case"EmptyStatement":return;default:return o(e)}}function a(e){return e===Gr&&(e=y),f(e)}function u(){w=Object.create(w)}function c(){w=Object.getPrototypeOf(w)}function m(e,t,n,r){var a=null;if("Identifier"===t.type?(a=t.name,e=s(e,a,x)):"MemberExpression"===t.type&&(a=t.computed?i(t.property):t.property.name,e=i(t.object)),p(e,a,x))switch(r){case void 0:return e[a]=i(n);case"=":return e[a]=i(n);case"+=":return e[a]+=i(n);case"-=":return e[a]-=i(n);case"++":return e[a]++;case"--":return e[a]--}}var y=r(t),x=b(t),w=t;return i(e)}function o(e){console.error(e);var t=new Error("Unsupported expression: "+e.type);throw t.node=e,t}function s(e,t,n){var r=n.getPrototypeOf(e);return!r||u(e,t)?e:s(r,t,n)}function l(e,t,n){var r=n.getPrototypeOf(e),i=u(e,t);return void 0!==e[t]?!0:!r||i?i:l(r,t,n)}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)}function p(e,t,n){return"__proto__"===t||n.isPrimitive(e)?!1:null!=e?u(e,t)?!!c(e,t):p(n.getPrototypeOf(e),t,n):!0}function h(e,n,r){return function(){var i=Object.create(r);this==t?i["this"]=null:i["this"]=this;var o=Array.prototype.slice.call(arguments);i.arguments=arguments,o.forEach(function(e,t){var r=n[t];r&&(i[r]=e)});var s=a(e,i);return s instanceof v?s.value:void 0}}function f(e){return e instanceof v?e.value:e}function d(e){return e.name}function v(e,t){this.type=e,this.value=t}var m=(e.exports,zr.parse),y=Wr,g=Hr,b=Vr;e.exports=n,e.exports.FunctionFactory=r,e.exports.Function=r();var _=1e6;return e.exports}({exports:{}},Mr),Gr=qr.Function,Jr=new k(1e3),Kr=0,Qr=1,Xr=2,Zr=3,Yr=0,ei=1,ti=2,ni=3,ri=4,ii=5,ai=6,oi=7,si=8,li=[];li[Yr]={ws:[Yr],ident:[ni,Kr],"[":[ri],eof:[oi]},li[ei]={ws:[ei],".":[ti],"[":[ri],eof:[oi]},li[ti]={ws:[ti],ident:[ni,Kr]},li[ni]={ident:[ni,Kr],0:[ni,Kr],number:[ni,Kr],ws:[ei,Qr],".":[ti,Qr],"[":[ri,Qr],eof:[oi,Qr]},li[ri]={"'":[ii,Kr],'"':[ai,Kr],"[":[ri,Xr],"]":[ei,Zr],eof:si,"else":[ri,Kr]},li[ii]={"'":[ri,Kr],eof:si,"else":[ii,Kr]},li[ai]={'"':[ri,Kr],eof:si,"else":[ai,Kr]};var ui=Object.freeze({parsePath:Ae,getPath:Ne,setPath:Le}),ci=new k(1e3),pi="Math,Date,this,true,false,null,undefined,Infinity,NaN,isNaN,isFinite,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,parseInt,parseFloat",hi=new RegExp("^("+pi.replace(/,/g,"\\b|")+"\\b)"),fi="break,case,class,catch,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,let,return,super,switch,throw,try,var,while,with,yield,enum,await,implements,package,protected,static,interface,private,public",di=new RegExp("^("+fi.replace(/,/g,"\\b|")+"\\b)"),vi=/\s/g,mi=/\n/g,yi=/[\{,]\s*[\w\$_]+\s*:|('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`)|new |typeof |void /g,gi=/"(\d+)"/g,bi=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?'\]|\[".*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/,_i=/[^\w$\.](?:[A-Za-z_$][\w$]*)/g,xi=/^(?:true|false|null|undefined|Infinity|NaN)$/,wi=[],ki=Object.freeze({parseExpression:Be,isSimplePath:Ue}),Si=[],Ci=[],Ei={},Oi={},$i=!1,Ai=0;ze.prototype.get=function(){this.beforeGet();var e,t=this.scope||this.vm;try{e=this.getter.call(t,t)}catch(n){}return this.deep&&qe(e),this.preProcess&&(e=this.preProcess(e)),this.filters&&(e=t._applyFilters(e,null,this.filters,!1)),this.postProcess&&(e=this.postProcess(e)),this.afterGet(),e},ze.prototype.set=function(e){var t=this.scope||this.vm;this.filters&&(e=t._applyFilters(e,this.value,this.filters,!0));try{this.setter.call(t,t,e)}catch(n){}var r=t.$forContext;if(r&&r.alias===this.expression){if(r.filters)return;r._withLock(function(){t.$key?r.rawValue[t.$key]=e:r.rawValue.$set(t.$index,e)})}},ze.prototype.beforeGet=function(){ge.target=this},ze.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},ze.prototype.afterGet=function(){ge.target=null;for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},ze.prototype.update=function(e){this.lazy?this.dirty=!0:this.sync||!Er.async?this.run():(this.shallow=this.queued?e?this.shallow:!1:!!e,this.queued=!0,We(this))},ze.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||(m(e)||this.deep)&&!this.shallow){var t=this.value;this.value=e;this.prevError;this.cb.call(this.vm,e,t)}this.queued=this.shallow=!1}},ze.prototype.evaluate=function(){var e=ge.target;this.value=this.get(),this.dirty=!1,ge.target=e},ze.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},ze.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||this.vm._vForRemoving||this.vm._watchers.$remove(this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1,this.vm=this.cb=this.value=null}};var Ni=new er,Li={bind:function(){this.attr=3===this.el.nodeType?"data":"textContent"},update:function(e){this.el[this.attr]=a(e)}},Ii=new k(1e3),Pi=new k(1e3),ji={efault:[0,"",""],legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]};ji.td=ji.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],ji.option=ji.optgroup=[1,'<select multiple="multiple">',"</select>"],ji.thead=ji.tbody=ji.colgroup=ji.caption=ji.tfoot=[1,"<table>","</table>"],ji.g=ji.defs=ji.symbol=ji.use=ji.image=ji.text=ji.circle=ji.ellipse=ji.line=ji.path=ji.polygon=ji.polyline=ji.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"version="1.1">',"</svg>"];var Ti=/<([\w:-]+)/,Fi=/&#?\w+?;/,Di=/<!--/,Ri=function(){if(Dn){var e=document.createElement("div");return e.innerHTML="<template>1</template>",!e.cloneNode(!0).firstChild.innerHTML}return!1}(),Bi=function(){if(Dn){var e=document.createElement("textarea");return e.placeholder="t","t"===e.cloneNode(!0).value}return!1}(),Ui=Object.freeze({cloneNode:Qe,parseTemplate:Xe}),Mi={bind:function(){8===this.el.nodeType&&(this.nodes=[],this.anchor=re("v-html"),q(this.el,this.anchor))},update:function(e){e=a(e),this.nodes?this.swap(e):this.el.innerHTML=e},swap:function(e){for(var t=this.nodes.length;t--;)W(this.nodes[t]);var n=Xe(e,!0,!0);this.nodes=d(n.childNodes),V(n,this.anchor)}};Ze.prototype.callHook=function(e){var t,n;for(t=0,n=this.childFrags.length;n>t;t++)this.childFrags[t].callHook(e);for(t=0,n=this.children.length;n>t;t++)e(this.children[t])},Ze.prototype.beforeRemove=function(){var e,t;for(e=0,t=this.childFrags.length;t>e;e++)this.childFrags[e].beforeRemove(!1);for(e=0,t=this.children.length;t>e;e++)this.children[e].$destroy(!1,!0);var n=this.unlink.dirs;for(e=0,t=n.length;t>e;e++)n[e]._watcher&&n[e]._watcher.teardown()},Ze.prototype.destroy=function(){this.parentFrag&&this.parentFrag.childFrags.$remove(this),this.node.__v_frag=null,this.unlink()};var Vi=new k(5e3);at.prototype.create=function(e,t,n){var r=Qe(this.template);return new Ze(this.linker,this.vm,r,e,t,n)};var Hi=700,Wi=800,zi=850,qi=1100,Gi=1500,Ji=1500,Ki=1750,Qi=2100,Xi=2200,Zi=2300,Yi=0,ea={priority:Xi,terminal:!0,params:["track-by","stagger","enter-stagger","leave-stagger"],bind:function(){var e=this.expression.match(/(.*) (?:in|of) (.*)/);if(e){var t=e[1].match(/\((.*),(.*)\)/);t?(this.iterator=t[1].trim(),this.alias=t[2].trim()):this.alias=e[1].trim(),this.expression=e[2]}if(this.alias){this.id="__v-for__"+ ++Yi;var n=this.el.tagName;this.isOption=("OPTION"===n||"OPTGROUP"===n)&&"SELECT"===this.el.parentNode.tagName,this.start=re("v-for-start"),this.end=re("v-for-end"),q(this.el,this.end),V(this.start,this.end),this.cache=Object.create(null),this.factory=new at(this.vm,this.el)}},update:function(e){this.diff(e),this.updateRef(),this.updateModel()},diff:function(e){var t,r,i,a,o,s,l=e[0],u=this.fromObject=m(l)&&n(l,"$key")&&n(l,"$value"),c=this.params.trackBy,p=this.frags,h=this.frags=new Array(e.length),f=this.alias,d=this.iterator,v=this.start,y=this.end,g=R(v),b=!p;for(t=0,r=e.length;r>t;t++)l=e[t],a=u?l.$key:null,o=u?l.$value:l,s=!m(o),i=!b&&this.getCachedFrag(o,t,a),i?(i.reused=!0,i.scope.$index=t,a&&(i.scope.$key=a),d&&(i.scope[d]=null!==a?a:t),(c||u||s)&&be(function(){i.scope[f]=o})):(i=this.create(o,f,t,a),i.fresh=!b),h[t]=i,b&&i.before(y);if(!b){var _=0,x=p.length-h.length;for(this.vm._vForRemoving=!0,t=0,r=p.length;r>t;t++)i=p[t],i.reused||(this.deleteCachedFrag(i),this.remove(i,_++,x,g));this.vm._vForRemoving=!1,_&&(this.vm._watchers=this.vm._watchers.filter(function(e){return e.active}));var w,k,S,C=0;for(t=0,r=h.length;r>t;t++)i=h[t],w=h[t-1],k=w?w.staggerCb?w.staggerAnchor:w.end||w.node:v,i.reused&&!i.staggerCb?(S=ot(i,v,this.id),S===w||S&&ot(S,v,this.id)===w||this.move(i,k)):this.insert(i,C++,k,g),i.reused=i.fresh=!1}},create:function(e,t,n,r){var i=this._host,a=this._scope||this.vm,o=Object.create(a);o.$refs=Object.create(a.$refs),o.$els=Object.create(a.$els),o.$parent=a,o.$forContext=this,be(function(){Se(o,t,e)}),Se(o,"$index",n),r?Se(o,"$key",r):o.$key&&g(o,"$key",null),this.iterator&&Se(o,this.iterator,null!==r?r:n);var s=this.factory.create(i,o,this._frag);return s.forId=this.id,this.cacheFrag(e,s,n,r),s},updateRef:function(){var e=this.descriptor.ref;if(e){var t,n=(this._scope||this.vm).$refs;this.fromObject?(t={},this.frags.forEach(function(e){t[e.scope.$key]=st(e)})):t=this.frags.map(st),n[e]=t}},updateModel:function(){if(this.isOption){var e=this.start.parentNode,t=e&&e.__v_model;t&&t.forceUpdate()}},insert:function(e,t,n,r){e.staggerCb&&(e.staggerCb.cancel(),e.staggerCb=null);var i=this.getStagger(e,t,null,"enter");if(r&&i){var a=e.staggerAnchor;a||(a=e.staggerAnchor=re("stagger-anchor"),a.__v_frag=e),H(a,n);var o=e.staggerCb=x(function(){e.staggerCb=null,e.before(a),W(a)});setTimeout(o,i)}else{var s=n.nextSibling;s||(H(this.end,n),s=this.end),e.before(s)}},remove:function(e,t,n,r){if(e.staggerCb)return e.staggerCb.cancel(),void(e.staggerCb=null);var i=this.getStagger(e,t,n,"leave");if(r&&i){var a=e.staggerCb=x(function(){e.staggerCb=null,e.remove()});setTimeout(a,i)}else e.remove()},move:function(e,t){t.nextSibling||this.end.parentNode.appendChild(this.end),e.before(t.nextSibling,!1)},cacheFrag:function(e,t,r,i){var a,o=this.params.trackBy,s=this.cache,l=!m(e);i||o||l?(a=ut(r,i,e,o),s[a]||(s[a]=t)):(a=this.id,n(e,a)?null===e[a]&&(e[a]=t):Object.isExtensible(e)&&g(e,a,t)),t.raw=e},getCachedFrag:function(e,t,n){var r,i=this.params.trackBy,a=!m(e);if(n||i||a){var o=ut(t,n,e,i);r=this.cache[o]}else r=e[this.id];return r&&(r.reused||r.fresh),r},deleteCachedFrag:function(e){var t=e.raw,r=this.params.trackBy,i=e.scope,a=i.$index,o=n(i,"$key")&&i.$key,s=!m(t);if(r||o||s){var l=ut(a,o,t,r);this.cache[l]=null}else t[this.id]=null,e.raw=null},getStagger:function(e,t,n,r){r+="Stagger";var i=e.node.__v_trans,a=i&&i.hooks,o=a&&(a[r]||a.stagger);return o?o.call(e,t,n):t*parseInt(this.params[r]||this.params.stagger,10)},_preProcess:function(e){return this.rawValue=e,e},_postProcess:function(e){if(Tn(e))return e;if(y(e)){for(var t,n=Object.keys(e),r=n.length,i=new Array(r);r--;)t=n[r],i[r]={$key:t,$value:e[t]};return i}return"number"!=typeof e||isNaN(e)||(e=lt(e)),e||[]},unbind:function(){if(this.descriptor.ref&&((this._scope||this.vm).$refs[this.descriptor.ref]=null),this.frags)for(var e,t=this.frags.length;t--;)e=this.frags[t],this.deleteCachedFrag(e),e.destroy()}},ta={priority:Qi,terminal:!0,bind:function(){var e=this.el;if(e.__vue__)this.invalid=!0;else{var t=e.nextElementSibling;t&&null!==B(t,"v-else")&&(W(t),this.elseEl=t),this.anchor=re("v-if"),q(e,this.anchor)}},update:function(e){this.invalid||(e?this.frag||this.insert():this.remove())},insert:function(){this.elseFrag&&(this.elseFrag.remove(),this.elseFrag=null),this.factory||(this.factory=new at(this.vm,this.el)),this.frag=this.factory.create(this._host,this._scope,this._frag),this.frag.before(this.anchor)},remove:function(){this.frag&&(this.frag.remove(),this.frag=null),this.elseEl&&!this.elseFrag&&(this.elseFactory||(this.elseFactory=new at(this.elseEl._context||this.vm,this.elseEl)),this.elseFrag=this.elseFactory.create(this._host,this._scope,this._frag),this.elseFrag.before(this.anchor))},unbind:function(){this.frag&&this.frag.destroy(),this.elseFrag&&this.elseFrag.destroy()}},na={bind:function(){var e=this.el.nextElementSibling;e&&null!==B(e,"v-else")&&(this.elseEl=e)},update:function(e){this.apply(this.el,e),this.elseEl&&this.apply(this.elseEl,!e)},apply:function(e,t){function n(){e.style.display=t?"":"none"}R(e)?F(e,t?1:-1,n,this.vm):n()}},ra={bind:function(){var e=this,t=this.el,n="range"===t.type,r=this.params.lazy,i=this.params.number,a=this.params.debounce,s=!1;if(Vn||n||(this.on("compositionstart",function(){s=!0}),this.on("compositionend",function(){s=!1,r||e.listener()})),this.focused=!1,n||r||(this.on("focus",function(){e.focused=!0}),this.on("blur",function(){e.focused=!1,e._frag&&!e._frag.inserted||e.rawListener()})),this.listener=this.rawListener=function(){if(!s&&e._bound){var r=i||n?o(t.value):t.value;e.set(r),Yn(function(){e._bound&&!e.focused&&e.update(e._watcher.value)})}},a&&(this.listener=b(this.listener,a)),this.hasjQuery="function"==typeof jQuery,this.hasjQuery){var l=jQuery.fn.on?"on":"bind";jQuery(t)[l]("change",this.rawListener),r||jQuery(t)[l]("input",this.listener)}else this.on("change",this.rawListener),r||this.on("input",this.listener);!r&&Mn&&(this.on("cut",function(){Yn(e.listener)}),this.on("keyup",function(t){46!==t.keyCode&&8!==t.keyCode||e.listener()})),(t.hasAttribute("value")||"TEXTAREA"===t.tagName&&t.value.trim())&&(this.afterBind=this.listener)},update:function(e){e=a(e),e!==this.el.value&&(this.el.value=e)},unbind:function(){var e=this.el;if(this.hasjQuery){var t=jQuery.fn.off?"off":"unbind";jQuery(e)[t]("change",this.listener),jQuery(e)[t]("input",this.listener)}}},ia={bind:function(){var e=this,t=this.el;this.getValue=function(){if(t.hasOwnProperty("_value"))return t._value;var n=t.value;return e.params.number&&(n=o(n)),n},this.listener=function(){e.set(e.getValue())},this.on("change",this.listener),t.hasAttribute("checked")&&(this.afterBind=this.listener)},update:function(e){this.el.checked=w(e,this.getValue())}},aa={bind:function(){var e=this,t=this,n=this.el;this.forceUpdate=function(){t._watcher&&t.update(t._watcher.get())};var r=this.multiple=n.hasAttribute("multiple");this.listener=function(){var e=ct(n,r);e=t.params.number?Tn(e)?e.map(o):o(e):e,t.set(e)},this.on("change",this.listener);var i=ct(n,r,!0);(r&&i.length||!r&&null!==i)&&(this.afterBind=this.listener),this.vm.$on("hook:attached",function(){Yn(e.forceUpdate)}),R(n)||Yn(this.forceUpdate)},update:function(e){var t=this.el;t.selectedIndex=-1;for(var n,r,i=this.multiple&&Tn(e),a=t.options,o=a.length;o--;)n=a[o],r=n.hasOwnProperty("_value")?n._value:n.value,n.selected=i?pt(e,r)>-1:w(e,r)},unbind:function(){this.vm.$off("hook:attached",this.forceUpdate)}},oa={bind:function(){function e(){var e=n.checked;return e&&n.hasOwnProperty("_trueValue")?n._trueValue:!e&&n.hasOwnProperty("_falseValue")?n._falseValue:e}var t=this,n=this.el;this.getValue=function(){return n.hasOwnProperty("_value")?n._value:t.params.number?o(n.value):n.value},this.listener=function(){var r=t._watcher.value;if(Tn(r)){var i=t.getValue();n.checked?_(r,i)<0&&r.push(i):r.$remove(i)}else t.set(e())},this.on("change",this.listener),n.hasAttribute("checked")&&(this.afterBind=this.listener)},update:function(e){var t=this.el;Tn(e)?t.checked=_(e,this.getValue())>-1:t.hasOwnProperty("_trueValue")?t.checked=w(e,t._trueValue):t.checked=!!e}},sa={text:ra,radio:ia,select:aa,checkbox:oa},la={priority:Wi,twoWay:!0,handlers:sa,params:["lazy","number","debounce"],bind:function(){this.checkFilters(),this.hasRead&&!this.hasWrite;var e,t=this.el,n=t.tagName;if("INPUT"===n)e=sa[t.type]||sa.text;else if("SELECT"===n)e=sa.select;else{if("TEXTAREA"!==n)return;e=sa.text}t.__v_model=this,e.bind.call(this),this.update=e.update,this._unbind=e.unbind},checkFilters:function(){var e=this.filters;if(e)for(var t=e.length;t--;){var n=ye(this.vm.$options,"filters",e[t].name);("function"==typeof n||n.read)&&(this.hasRead=!0),n.write&&(this.hasWrite=!0)}},unbind:function(){this.el.__v_model=null,this._unbind&&this._unbind()}},ua={esc:27,tab:9,enter:13,space:32,"delete":[8,46],up:38,left:37,right:39,down:40},ca={priority:Hi,acceptStatement:!0,keyCodes:ua,bind:function(){if("IFRAME"===this.el.tagName&&"load"!==this.arg){var e=this;this.iframeBind=function(){G(e.el.contentWindow,e.arg,e.handler,e.modifiers.capture)},this.on("load",this.iframeBind)}},update:function(e){if(this.descriptor.raw||(e=function(){}),"function"==typeof e){this.modifiers.stop&&(e=ft(e)),this.modifiers.prevent&&(e=dt(e)),this.modifiers.self&&(e=vt(e));var t=Object.keys(this.modifiers).filter(function(e){return"stop"!==e&&"prevent"!==e&&"self"!==e&&"capture"!==e});t.length&&(e=ht(e,t)),this.reset(),this.handler=e,this.iframeBind?this.iframeBind():G(this.el,this.arg,this.handler,this.modifiers.capture)}},reset:function(){var e=this.iframeBind?this.el.contentWindow:this.el;this.handler&&J(e,this.arg,this.handler)},unbind:function(){this.reset()}},pa=["-webkit-","-moz-","-ms-"],ha=["Webkit","Moz","ms"],fa=/!important;?$/,da=Object.create(null),va=null,ma={deep:!0,update:function(e){"string"==typeof e?this.el.style.cssText=e:Tn(e)?this.handleObject(e.reduce(v,{})):this.handleObject(e||{})},handleObject:function(e){var t,n,r=this.cache||(this.cache={});for(t in r)t in e||(this.handleSingle(t,null),delete r[t]);for(t in e)n=e[t],n!==r[t]&&(r[t]=n,this.handleSingle(t,n))},handleSingle:function(e,t){if(e=mt(e))if(null!=t&&(t+=""),t){var n=fa.test(t)?"important":"";n?(t=t.replace(fa,"").trim(),this.el.style.setProperty(e.kebab,t,n)):this.el.style[e.camel]=t}else this.el.style[e.camel]=""}},ya="http://www.w3.org/1999/xlink",ga=/^xlink:/,ba=/^v-|^:|^@|^(?:is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/,_a=/^(?:value|checked|selected|muted)$/,xa=/^(?:draggable|contenteditable|spellcheck)$/,wa={value:"_value","true-value":"_trueValue","false-value":"_falseValue"},ka={priority:zi,bind:function(){var e=this.arg,t=this.el.tagName;e||(this.deep=!0);var n=this.descriptor,r=n.interp;r&&(n.hasOneTime&&(this.expression=N(r,this._scope||this.vm)),(ba.test(e)||"name"===e&&("PARTIAL"===t||"SLOT"===t))&&(this.el.removeAttribute(e),this.invalid=!0))},update:function(e){if(!this.invalid){var t=this.arg;this.arg?this.handleSingle(t,e):this.handleObject(e||{})}},handleObject:ma.handleObject,handleSingle:function(e,t){var n=this.el,r=this.descriptor.interp;if(this.modifiers.camel&&(e=u(e)),!r&&_a.test(e)&&e in n){var i="value"===e&&null==t?"":t;n[e]!==i&&(n[e]=i)}var a=wa[e];if(!r&&a){n[a]=t;var o=n.__v_model;o&&o.listener()}return"value"===e&&"TEXTAREA"===n.tagName?void n.removeAttribute(e):void(xa.test(e)?n.setAttribute(e,t?"true":"false"):null!=t&&t!==!1?"class"===e?(n.__v_trans&&(t+=" "+n.__v_trans.id+"-transition"),Q(n,t)):ga.test(e)?n.setAttributeNS(ya,e,t===!0?"":t):n.setAttribute(e,t===!0?"":t):n.removeAttribute(e))}},Sa={priority:Gi,bind:function(){if(this.arg){var e=this.id=u(this.arg),t=(this._scope||this.vm).$els;n(t,e)?t[e]=this.el:Se(t,e,this.el)}},unbind:function(){var e=(this._scope||this.vm).$els;e[this.id]===this.el&&(e[this.id]=null)}},Ca={bind:function(){}},Ea={bind:function(){var e=this.el;this.vm.$once("pre-hook:compiled",function(){e.removeAttribute("v-cloak")})}},Oa={text:Li,html:Mi,"for":ea,"if":ta,show:na,model:la,on:ca,bind:ka,el:Sa,ref:Ca,cloak:Ea},$a={deep:!0,update:function(e){e?"string"==typeof e?this.setClass(e.trim().split(/\s+/)):this.setClass(gt(e)):this.cleanup()},setClass:function(e){this.cleanup(e);for(var t=0,n=e.length;n>t;t++){var r=e[t];r&&bt(this.el,r,X)}this.prevKeys=e},cleanup:function(e){var t=this.prevKeys;if(t)for(var n=t.length;n--;){var r=t[n];(!e||e.indexOf(r)<0)&&bt(this.el,r,Z)}}},Aa={priority:Ji,params:["keep-alive","transition-mode","inline-template"],bind:function(){this.el.__vue__||(this.keepAlive=this.params.keepAlive,this.keepAlive&&(this.cache={}),this.params.inlineTemplate&&(this.inlineTemplate=Y(this.el,!0)),this.pendingComponentCb=this.Component=null,this.pendingRemovals=0,this.pendingRemovalCb=null,this.anchor=re("v-component"),q(this.el,this.anchor),this.el.removeAttribute("is"),this.el.removeAttribute(":is"),this.descriptor.ref&&this.el.removeAttribute("v-ref:"+p(this.descriptor.ref)),this.literal&&this.setComponent(this.expression))},update:function(e){this.literal||this.setComponent(e)},setComponent:function(e,t){if(this.invalidatePending(),e){var n=this;this.resolveComponent(e,function(){n.mountComponent(t)})}else this.unbuild(!0),this.remove(this.childVM,t),this.childVM=null},resolveComponent:function(e,t){var n=this;this.pendingComponentCb=x(function(r){n.ComponentName=r.options.name||("string"==typeof e?e:null),n.Component=r,t()}),this.vm._resolveComponent(e,this.pendingComponentCb)},mountComponent:function(e){this.unbuild(!0);var t=this,n=this.Component.options.activate,r=this.getCached(),i=this.build();n&&!r?(this.waitingFor=i,_t(n,i,function(){t.waitingFor===i&&(t.waitingFor=null,t.transition(i,e))})):(r&&i._updateRef(),this.transition(i,e))},invalidatePending:function(){this.pendingComponentCb&&(this.pendingComponentCb.cancel(),this.pendingComponentCb=null)},build:function(e){var t=this.getCached();if(t)return t;if(this.Component){var n={name:this.ComponentName,el:Qe(this.el),template:this.inlineTemplate,parent:this._host||this.vm,_linkerCachable:!this.inlineTemplate,_ref:this.descriptor.ref,_asComponent:!0,_isRouterView:this._isRouterView,_context:this.vm,_scope:this._scope,_frag:this._frag};e&&v(n,e);var r=new this.Component(n);return this.keepAlive&&(this.cache[this.Component.cid]=r),r}},getCached:function(){return this.keepAlive&&this.cache[this.Component.cid]},unbuild:function(e){this.waitingFor&&(this.keepAlive||this.waitingFor.$destroy(),this.waitingFor=null);var t=this.childVM;return!t||this.keepAlive?void(t&&(t._inactive=!0,t._updateRef(!0))):void t.$destroy(!1,e)},remove:function(e,t){var n=this.keepAlive;if(e){this.pendingRemovals++,this.pendingRemovalCb=t;var r=this;e.$remove(function(){r.pendingRemovals--,n||e._cleanup(),!r.pendingRemovals&&r.pendingRemovalCb&&(r.pendingRemovalCb(),r.pendingRemovalCb=null)})}else t&&t()},transition:function(e,t){var n=this,r=this.childVM;switch(r&&(r._inactive=!0),e._inactive=!1,this.childVM=e,n.params.transitionMode){case"in-out":e.$before(n.anchor,function(){n.remove(r,t)});break;case"out-in":n.remove(r,function(){e.$before(n.anchor,t)});break;default:n.remove(r),e.$before(n.anchor,t)}},unbind:function(){if(this.invalidatePending(),this.unbuild(),this.cache){for(var e in this.cache)this.cache[e].$destroy();this.cache=null}}},Na=Er._propBindingModes,La={},Ia=/^[$_a-zA-Z]+[\w$]*$/,Pa=Er._propBindingModes,ja={bind:function(){var e=this.vm,t=e._context,n=this.descriptor.prop,r=n.path,i=n.parentPath,a=n.mode===Pa.TWO_WAY,o=this.parentWatcher=new ze(t,i,function(t){Ct(e,n,t)},{twoWay:a,filters:n.filters,scope:this._scope});if(St(e,n,o.value),a){var s=this;e.$once("pre-hook:created",function(){s.childWatcher=new ze(e,r,function(e){o.set(e)},{sync:!0})})}},unbind:function(){this.parentWatcher.teardown(),this.childWatcher&&this.childWatcher.teardown()}},Ta=[],Fa=!1,Da="transition",Ra="animation",Ba=Gn+"Duration",Ua=Kn+"Duration",Ma=Dn&&window.requestAnimationFrame,Va=Ma?function(e){Ma(function(){Ma(e)})}:function(e){setTimeout(e,50)},Ha=It.prototype;Ha.enter=function(e,t){this.cancelPending(),this.callHook("beforeEnter"),this.cb=t,X(this.el,this.enterClass),e(),this.entered=!1,this.callHookWithCb("enter"),this.entered||(this.cancel=this.hooks&&this.hooks.enterCancelled,Nt(this.enterNextTick))},Ha.enterNextTick=function(){var e=this;this.justEntered=!0,Va(function(){e.justEntered=!1});var t=this.enterDone,n=this.getCssTransitionType(this.enterClass);this.pendingJsCb?n===Da&&Z(this.el,this.enterClass):n===Da?(Z(this.el,this.enterClass),this.setupCssCb(Jn,t)):n===Ra?this.setupCssCb(Qn,t):t()},Ha.enterDone=function(){this.entered=!0,this.cancel=this.pendingJsCb=null,Z(this.el,this.enterClass),this.callHook("afterEnter"),this.cb&&this.cb()},Ha.leave=function(e,t){this.cancelPending(),this.callHook("beforeLeave"),this.op=e,this.cb=t,X(this.el,this.leaveClass),this.left=!1,this.callHookWithCb("leave"),this.left||(this.cancel=this.hooks&&this.hooks.leaveCancelled,this.op&&!this.pendingJsCb&&(this.justEntered?this.leaveDone():Nt(this.leaveNextTick)))},Ha.leaveNextTick=function(){var e=this.getCssTransitionType(this.leaveClass);if(e){var t=e===Da?Jn:Qn;this.setupCssCb(t,this.leaveDone)}else this.leaveDone()},Ha.leaveDone=function(){this.left=!0,this.cancel=this.pendingJsCb=null,this.op(),Z(this.el,this.leaveClass),this.callHook("afterLeave"),this.cb&&this.cb(),this.op=null},Ha.cancelPending=function(){this.op=this.cb=null;var e=!1;this.pendingCssCb&&(e=!0,J(this.el,this.pendingCssEvent,this.pendingCssCb),this.pendingCssEvent=this.pendingCssCb=null),this.pendingJsCb&&(e=!0,this.pendingJsCb.cancel(),this.pendingJsCb=null),e&&(Z(this.el,this.enterClass),Z(this.el,this.leaveClass)),this.cancel&&(this.cancel.call(this.vm,this.el),this.cancel=null)},Ha.callHook=function(e){this.hooks&&this.hooks[e]&&this.hooks[e].call(this.vm,this.el)},Ha.callHookWithCb=function(e){var t=this.hooks&&this.hooks[e];t&&(t.length>1&&(this.pendingJsCb=x(this[e+"Done"])),t.call(this.vm,this.el,this.pendingJsCb))},Ha.getCssTransitionType=function(e){if(!(!Jn||document.hidden||this.hooks&&this.hooks.css===!1||Pt(this.el))){var t=this.type||this.typeCache[e];if(t)return t;var n=this.el.style,r=window.getComputedStyle(this.el),i=n[Ba]||r[Ba];if(i&&"0s"!==i)t=Da;else{var a=n[Ua]||r[Ua];a&&"0s"!==a&&(t=Ra)}return t&&(this.typeCache[e]=t),t}},Ha.setupCssCb=function(e,t){this.pendingCssEvent=e;var n=this,r=this.el,i=this.pendingCssCb=function(a){a.target===r&&(J(r,e,i),n.pendingCssEvent=n.pendingCssCb=null,!n.pendingJsCb&&t&&t())};G(r,e,i)};var Wa={priority:qi,update:function(e,t){var n=this.el,r=ye(this.vm.$options,"transitions",e);e=e||"v",t=t||"v",n.__v_trans=new It(n,e,r,this.vm),Z(n,t+"-transition"),X(n,e+"-transition")}},za={style:ma,"class":$a,component:Aa,prop:ja,transition:Wa},qa=/^v-bind:|^:/,Ga=/^v-on:|^@/,Ja=/^v-([^:]+)(?:$|:(.*)$)/,Ka=/\.[^\.]+/g,Qa=/^(v-bind:|:)?transition$/,Xa=1e3,Za=2e3;Zt.terminal=!0;var Ya=/[^\w\-:\.]/,eo=Object.freeze({compile:jt,compileAndLinkProps:Bt,compileRoot:Ut,transclude:on,resolveSlots:cn}),to=/^v-on:|^@/;vn.prototype._bind=function(){var e=this.name,t=this.descriptor;if(("cloak"!==e||this.vm._isCompiled)&&this.el&&this.el.removeAttribute){var n=t.attr||"v-"+e;this.el.removeAttribute(n)}var r=t.def;if("function"==typeof r?this.update=r:v(this,r),this._setupParams(),this.bind&&this.bind(),this._bound=!0,this.literal)this.update&&this.update(t.raw);else if((this.expression||this.modifiers)&&(this.update||this.twoWay)&&!this._checkStatement()){var i=this;this.update?this._update=function(e,t){i._locked||i.update(e,t)}:this._update=dn;var a=this._preProcess?f(this._preProcess,this):null,o=this._postProcess?f(this._postProcess,this):null,s=this._watcher=new ze(this.vm,this.expression,this._update,{filters:this.filters,twoWay:this.twoWay,deep:this.deep,preProcess:a,postProcess:o,scope:this._scope});this.afterBind?this.afterBind():this.update&&this.update(s.value)}},vn.prototype._setupParams=function(){if(this.params){var e=this.params;this.params=Object.create(null);for(var t,n,r,i=e.length;i--;)t=p(e[i]),r=u(t),n=U(this.el,t),null!=n?this._setupParamWatcher(r,n):(n=B(this.el,t),null!=n&&(this.params[r]=""===n?!0:n))}},vn.prototype._setupParamWatcher=function(e,t){var n=this,r=!1,i=(this._scope||this.vm).$watch(t,function(t,i){if(n.params[e]=t,r){var a=n.paramWatchers&&n.paramWatchers[e];a&&a.call(n,t,i)}else r=!0},{immediate:!0,user:!1});(this._paramUnwatchFns||(this._paramUnwatchFns=[])).push(i)},vn.prototype._checkStatement=function(){var e=this.expression;if(e&&this.acceptStatement&&!Ue(e)){var t=Be(e).get,n=this._scope||this.vm,r=function(e){n.$event=e,t.call(n,n),n.$event=null};return this.filters&&(r=n._applyFilters(r,null,this.filters)), -this.update(r),!0}},vn.prototype.set=function(e){this.twoWay&&this._withLock(function(){this._watcher.set(e)})},vn.prototype._withLock=function(e){var t=this;t._locked=!0,e.call(t),Yn(function(){t._locked=!1})},vn.prototype.on=function(e,t,n){G(this.el,e,t,n),(this._listeners||(this._listeners=[])).push([e,t])},vn.prototype._teardown=function(){if(this._bound){this._bound=!1,this.unbind&&this.unbind(),this._watcher&&this._watcher.teardown();var e,t=this._listeners;if(t)for(e=t.length;e--;)J(this.el,t[e][0],t[e][1]);var n=this._paramUnwatchFns;if(n)for(e=n.length;e--;)n[e]();this.vm=this.el=this._watcher=this._listeners=null}};var no=/[^|]\|[^|]/;Ce(wn),hn(wn),fn(wn),mn(wn),yn(wn),gn(wn),bn(wn),_n(wn),xn(wn);var ro={priority:Zi,params:["name"],bind:function(){var e=this.params.name||"default",t=this.vm._slotContents&&this.vm._slotContents[e];t&&t.hasChildNodes()?this.compile(t.cloneNode(!0),this.vm._context,this.vm):this.fallback()},compile:function(e,t,n){if(e&&t){if(this.el.hasChildNodes()&&1===e.childNodes.length&&1===e.childNodes[0].nodeType&&e.childNodes[0].hasAttribute("v-if")){var r=document.createElement("template");r.setAttribute("v-else",""),r.innerHTML=this.el.innerHTML,r._context=this.vm,e.appendChild(r)}var i=n?n._scope:this._scope;this.unlink=t.$compile(e,n,i,this._frag)}e?q(this.el,e):W(this.el)},fallback:function(){this.compile(Y(this.el,!0),this.vm)},unbind:function(){this.unlink&&this.unlink()}},io={priority:Ki,params:["name"],paramWatchers:{name:function(e){ta.remove.call(this),e&&this.insert(e)}},bind:function(){this.anchor=re("v-partial"),q(this.el,this.anchor),this.insert(this.params.name)},insert:function(e){var t=ye(this.vm.$options,"partials",e,!0);t&&(this.factory=new at(this.vm,t),ta.insert.call(this))},unbind:function(){this.frag&&this.frag.destroy()}},ao={slot:ro,partial:io},oo=ea._postProcess,so=/(\d{3})(?=\d)/g,lo={orderBy:Cn,filterBy:Sn,limitBy:kn,json:{read:function(e,t){return"string"==typeof e?e:JSON.stringify(e,null,arguments.length>1?t:2)},write:function(e){try{return JSON.parse(e)}catch(t){return e}}},capitalize:function(e){return e||0===e?(e=e.toString(),e.charAt(0).toUpperCase()+e.slice(1)):""},uppercase:function(e){return e||0===e?e.toString().toUpperCase():""},lowercase:function(e){return e||0===e?e.toString().toLowerCase():""},currency:function(e,t,n){if(e=parseFloat(e),!isFinite(e)||!e&&0!==e)return"";t=null!=t?t:"$",n=null!=n?n:2;var r=Math.abs(e).toFixed(n),i=n?r.slice(0,-1-n):r,a=i.length%3,o=a>0?i.slice(0,a)+(i.length>3?",":""):"",s=n?r.slice(-1-n):"",l=0>e?"-":"";return l+t+o+i.slice(a).replace(so,"$1,")+s},pluralize:function(e){var t=d(arguments,1),n=t.length;if(n>1){var r=e%10-1;return r in t?t[r]:t[n-1]}return t[0]+(1===e?"":"s")},debounce:function(e,t){return e?(t||(t=300),b(e,t)):void 0}};return On(wn),wn.version="1.0.26-csp",setTimeout(function(){Er.devtools&&Rn&&Rn.emit("init",wn)},0),wn}); +(function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||marked.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]||""});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].split(/ *\| */)}this.tokens.push(item);continue}if(cap=this.rules.lheading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[2]==="="?1:2,text:cap[1]});continue}if(cap=this.rules.hr.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"hr"});continue}if(cap=this.rules.blockquote.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"blockquote_start"});cap=cap[0].replace(/^ *> ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i<l;i++){item=cap[i];space=item.length;item=item.replace(/^ *([*+-]|\d+\.) +/,"");if(~item.indexOf("\n ")){space-=item.length;item=!this.options.pedantic?item.replace(new RegExp("^ {1,"+space+"}","gm"),""):item.replace(/^ {1,4}/gm,"")}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(cap[i+1])[0];if(bull!==b&&!(bull.length>1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(cap[1]==="pre"||cap[1]==="script"||cap[1]==="style"),text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */)}this.tokens.push(item);continue}if(top&&(cap=this.rules.paragraph.exec(src))){src=src.substring(cap[0].length);this.tokens.push({type:"paragraph",text:cap[1].charAt(cap[1].length-1)==="\n"?cap[1].slice(0,-1):cap[1]});continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"text",text:cap[0]});continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return this.tokens};var inline={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};inline._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;inline._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||marked.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^<a /i.test(cap[0])){this.inLink=true}else if(this.inLink&&/^<\/a>/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(cap[0]):escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.text(escape(this.smartypants(cap[0])));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){if(!this.options.mangle)return text;var out="",l=text.length,i=0,ch;for(;i<l;i++){ch=text.charCodeAt(i);if(Math.random()>.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"<pre><code>"+(escaped?code:escape(code,true))+"\n</code></pre>"}return'<pre><code class="'+this.options.langPrefix+escape(lang,true)+'">'+(escaped?code:escape(code,true))+"\n</code></pre>\n"};Renderer.prototype.blockquote=function(quote){return"<blockquote>\n"+quote+"</blockquote>\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"<h"+level+' id="'+this.options.headerPrefix+raw.toLowerCase().replace(/[^\w]+/g,"-")+'">'+text+"</h"+level+">\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"</"+type+">\n"};Renderer.prototype.listitem=function(text){return"<li>"+text+"</li>\n"};Renderer.prototype.paragraph=function(text){return"<p>"+text+"</p>\n"};Renderer.prototype.table=function(header,body){return"<table>\n"+"<thead>\n"+header+"</thead>\n"+"<tbody>\n"+body+"</tbody>\n"+"</table>\n"};Renderer.prototype.tablerow=function(content){return"<tr>\n"+content+"</tr>\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"</"+type+">\n"};Renderer.prototype.strong=function(text){return"<strong>"+text+"</strong>"};Renderer.prototype.em=function(text){return"<em>"+text+"</em>"};Renderer.prototype.codespan=function(text){return"<code>"+text+"</code>"};Renderer.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"};Renderer.prototype.del=function(text){return"<del>"+text+"</del>"};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0||prot.indexOf("vbscript:")===0){return""}}var out='<a href="'+href+'"';if(title){out+=' title="'+title+'"'}out+=">"+text+"</a>";return out};Renderer.prototype.image=function(href,title,text){var out='<img src="'+href+'" alt="'+text+'"';if(title){out+=' title="'+title+'"'}out+=this.options.xhtml?"/>":">";return out};Renderer.prototype.text=function(text){return text};function Parser(options){this.tokens=[];this.token=null;this.options=options||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i<this.token.header.length;i++){flags={header:true,align:this.token.align[i]};cell+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]})}header+=this.renderer.tablerow(cell);for(i=0;i<this.token.cells.length;i++){row=this.token.cells[i];cell="";for(j=0;j<row.length;j++){cell+=this.renderer.tablecell(this.inline.output(row[j]),{header:false,align:this.token.align[j]})}body+=this.renderer.tablerow(cell)}return this.renderer.table(header,body)}case"blockquote_start":{var body="";while(this.next().type!=="blockquote_end"){body+=this.tok()}return this.renderer.blockquote(body)}case"list_start":{var body="",ordered=this.token.ordered;while(this.next().type!=="list_end"){body+=this.tok()}return this.renderer.list(body,ordered)}case"list_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.token.type==="text"?this.parseText():this.tok()}return this.renderer.listitem(body)}case"loose_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.tok()}return this.renderer.listitem(body)}case"html":{var html=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(html)}case"paragraph":{return this.renderer.paragraph(this.inline.output(this.token.text))}case"text":{return this.renderer.paragraph(this.parseText())}}};function escape(html,encode){return html.replace(!encode?/&(?!#?\w+;)/g:/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;i<arguments.length;i++){target=arguments[i];for(key in target){if(Object.prototype.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj}function marked(src,opt,callback){if(callback||typeof opt==="function"){if(!callback){callback=opt;opt=null}opt=merge({},marked.defaults,opt||{});var highlight=opt.highlight,tokens,pending,i=0;try{tokens=Lexer.lex(src,opt)}catch(e){return callback(e)}pending=tokens.length;var done=function(err){if(err){opt.highlight=highlight;return callback(err)}var out;try{out=Parser.parse(tokens,opt)}catch(e){err=e}opt.highlight=highlight;return err?callback(err):callback(null,out)};if(!highlight||highlight.length<3){return done()}delete opt.highlight;if(!pending)return done();for(;i<tokens.length;i++){(function(token){if(token.type!=="code"){return--pending||done()}return highlight(token.text,token.lang,function(err,code){if(err)return done(err);if(code==null||code===token.text){return--pending||done()}token.text=code;token.escaped=true;--pending||done()})})(tokens[i])}return}try{if(opt)opt=merge({},marked.defaults,opt);return Parser.parse(Lexer.lex(src,opt),opt)}catch(e){e.message+="\nPlease report this to https://github.com/chjj/marked.";if((opt||marked.defaults).silent){return"<p>An error occured:</p><pre>"+escape(e.message+"",true)+"</pre>"}throw e}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false};marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=marked}else if(typeof define==="function"&&define.amd){define(function(){return marked})}else{this.marked=marked}}).call(function(){return this||(typeof window!=="undefined"?window:global)}());
\ No newline at end of file |