diff --git a/afterwriting.zip b/afterwriting.zip index c1748e80..d109f459 100644 Binary files a/afterwriting.zip and b/afterwriting.zip differ diff --git a/bundle/js/afterwriting.js b/bundle/js/afterwriting.js index ad5ec131..5046f419 100644 --- a/bundle/js/afterwriting.js +++ b/bundle/js/afterwriting.js @@ -81,50 +81,58 @@ THE SOFTWARE. * Released under MIT license, http://github.com/requirejs/text/LICENSE */ +/*! + * @overview es6-promise - a tiny implementation of Promises/A+. + * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) + * @license Licensed under MIT license + * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE + * @version 4.1.1 + */ + /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE -var requirejs,require,define;!function(ba){function G(A){return"[object Function]"===K.call(A)}function H(A){return"[object Array]"===K.call(A)}function v(A,e){if(A){var t;for(t=0;tthis.depCount&&!this.defined){if(G(i)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{n=y.execCb(t,i,e,n)}catch(e){A=e}else n=y.execCb(t,i,e,n);if(this.map.isDefine&&void 0===n&&((e=this.module)?n=e.exports:this.usingExports&&(n=this.exports)),A)return A.requireMap=this.map,A.requireModules=this.map.isDefine?[this.map.id]:null,A.requireType=this.map.isDefine?"define":"require",l(this.error=A)}else n=i;this.exports=n,this.map.isDefine&&!this.ignore&&(J[t]=n,g.onResourceLoad)&&g.onResourceLoad(y,this.map,this.depMaps),h(t),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var A=this.map,n=A.id,i=o(A.prefix);this.depMaps.push(i),a(i,"defined",u(this,function(i){var r,c;c=m(P,this.map.id);var d=this.map.name,p=this.map.parentMap?this.map.parentMap.name:null,Q=y.makeRequire(A.parentMap,{enableBuildCallback:!0});this.map.unnormalized?(i.normalize&&(d=i.normalize(d,function(A){return e(A,p,!0)})||""),i=o(A.prefix+"!"+d,this.map.parentMap),a(i,"defined",u(this,function(A){this.init([],function(){return A},null,{enabled:!0,ignore:!0})})),(c=m(L,i.id))&&(this.depMaps.push(i),this.events.error&&c.on("error",u(this,function(A){this.emit("error",A)})),c.enable())):c?(this.map.url=y.nameToUrl(c),this.load()):(r=u(this,function(A){this.init([],function(){return A},null,{enabled:!0})}),r.error=u(this,function(A){this.inited=!0,this.error=A,A.requireModules=[n],B(L,function(A){0===A.map.id.indexOf(n+"_unnormalized")&&h(A.map.id)}),l(A)}),r.fromText=u(this,function(e,i){var a=A.name,c=o(a),u=M;i&&(e=i),u&&(M=!1),s(c),t(k.config,n)&&(k.config[a]=k.config[n]);try{g.exec(e)}catch(A){return l(C("fromtexteval","fromText eval for "+n+" failed: "+A,A,[n]))}u&&(M=!0),this.depMaps.push(c),y.completeLoad(a),Q([a],r)}),i.load(A.name,Q,r,k))})),y.enable(i,this),this.pluginMaps[i.id]=i},enable:function(){x[this.map.id]=this,this.enabling=this.enabled=!0,v(this.depMaps,u(this,function(A,e){var n,i;if("string"==typeof A){if(A=o(A,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[e]=A,n=m(D,A.id))return void(this.depExports[e]=n(this));this.depCount+=1,a(A,"defined",u(this,function(A){this.defineDep(e,A),this.check()})),this.errback&&a(A,"error",u(this,this.errback))}n=A.id,i=L[n],!t(D,n)&&i&&!i.enabled&&y.enable(A,this)})),B(this.pluginMaps,u(this,function(A){var e=m(L,A.id);e&&!e.enabled&&y.enable(A,this)})),this.enabling=!1,this.check()},on:function(A,e){var t=this.events[A];t||(t=this.events[A]=[]),t.push(e)},emit:function(A,e){v(this.events[A],function(A){A(e)}),"error"===A&&delete this.events[A]}},y={config:k,contextName:A,registry:L,defined:J,urlFetched:_,defQueue:j,Module:b,makeModuleMap:o,nextTick:g.nextTick,onError:l,configure:function(A){A.baseUrl&&"/"!==A.baseUrl.charAt(A.baseUrl.length-1)&&(A.baseUrl+="/");var e=k.shim,t={paths:!0,bundles:!0,config:!0,map:!0};B(A,function(A,e){t[e]?(k[e]||(k[e]={}),U(k[e],A,!0,!0)):k[e]=A}),A.bundles&&B(A.bundles,function(A,e){v(A,function(A){A!==e&&(P[A]=e)})}),A.shim&&(B(A.shim,function(A,t){H(A)&&(A={deps:A}),!A.exports&&!A.init||A.exportsFn||(A.exportsFn=y.makeShimExports(A)),e[t]=A}),k.shim=e),A.packages&&v(A.packages,function(A){var e,A="string"==typeof A?{name:A}:A;e=A.name,A.location&&(k.paths[e]=A.location),k.pkgs[e]=A.name+"/"+(A.main||"main").replace(ia,"").replace(Q,"")}),B(L,function(A,e){!A.inited&&!A.map.unnormalized&&(A.map=o(e))}),(A.deps||A.callback)&&y.require(A.deps||[],A.callback)},makeShimExports:function(A){return function(){var e;return A.init&&(e=A.init.apply(ba,arguments)),e||A.exports&&da(A.exports)}},makeRequire:function(i,r){function a(e,n,c){var u,h;return r.enableBuildCallback&&n&&G(n)&&(n.__requireJsBuild=!0),"string"==typeof e?G(n)?l(C("requireargs","Invalid require call"),c):i&&t(D,e)?D[e](L[i.id]):g.get?g.get(y,e,i,a):(u=o(e,i,!1,!0),u=u.id,t(J,u)?J[u]:l(C("notloaded",'Module name "'+u+'" has not been loaded yet for context: '+A+(i?"":". Use require([])")))):(w(),y.nextTick(function(){w(),h=s(o(null,i)),h.skipMap=r.skipMap,h.init(e,n,c,{enabled:!0}),p()}),a)}return r=r||{},U(a,{isBrowser:z,toUrl:function(A){var t,n=A.lastIndexOf("."),r=A.split("/")[0];return-1!==n&&("."!==r&&".."!==r||1n.attachEvent.toString().indexOf("[native code")||Y?(n.addEventListener("load",A.onScriptLoad,!1),n.addEventListener("error",A.onScriptError,!1)):(M=!0,n.attachEvent("onreadystatechange",A.onScriptLoad)),n.src=t,J=n,D?y.insertBefore(n,D):y.appendChild(n),J=null,n;if(ea)try{importScripts(t),A.completeLoad(e)}catch(n){A.onError(C("importscripts","importScripts failed for "+e+" at "+t,n,[e]))}},z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(A){if(y||(y=A.parentNode),I=A.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0}),define=function(A,e,t){var n,i;"string"!=typeof A&&(t=e,e=A,A=null),H(e)||(t=e,e=null),!e&&G(t)&&(e=[],t.length&&(t.toString().replace(ka,"").replace(la,function(A,t){e.push(t)}),e=(1===t.length?["require"]:["require","exports","module"]).concat(e))),M&&((n=J)||(N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(A){if("interactive"===A.readyState)return N=A}),n=N),n&&(A||(A=n.getAttribute("data-requiremodule")),i=F[n.getAttribute("data-requirecontext")])),(i?i.defQueue:R).push([A,e,t])},define.amd={jQuery:!0},g.exec=function(b){return eval(b)},g(q)}}(this),define("libs/require",function(){}),function(A,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=A.document?e(A,!0):function(A){if(!A.document)throw new Error("jQuery requires a window with a document");return e(A)}:e(A)}("undefined"!=typeof window?window:this,function(A,e){function t(A){var e=A.length,t=iA.type(A);return"function"!==t&&!iA.isWindow(A)&&(!(1!==A.nodeType||!e)||("array"===t||0===e||"number"==typeof e&&e>0&&e-1 in A))}function n(A,e,t){if(iA.isFunction(e))return iA.grep(A,function(A,n){return!!e.call(A,n,A)!==t});if(e.nodeType)return iA.grep(A,function(A){return A===e!==t});if("string"==typeof e){if(gA.test(e))return iA.filter(e,A,t);e=iA.filter(e,A)}return iA.grep(A,function(A){return iA.inArray(A,e)>=0!==t})}function i(A,e){do{A=A[e]}while(A&&1!==A.nodeType);return A}function r(A){var e=fA[A]={};return iA.each(A.match(EA)||[],function(A,t){e[t]=!0}),e}function o(){BA.addEventListener?(BA.removeEventListener("DOMContentLoaded",s,!1),A.removeEventListener("load",s,!1)):(BA.detachEvent("onreadystatechange",s),A.detachEvent("onload",s))}function s(){(BA.addEventListener||"load"===event.type||"complete"===BA.readyState)&&(o(),iA.ready())}function a(A,e,t){if(void 0===t&&1===A.nodeType){var n="data-"+e.replace(MA,"-$1").toLowerCase();if("string"==typeof(t=A.getAttribute(n))){try{t="true"===t||"false"!==t&&("null"===t?null:+t+""===t?+t:mA.test(t)?iA.parseJSON(t):t)}catch(A){}iA.data(A,e,t)}else t=void 0}return t}function l(A){var e;for(e in A)if(("data"!==e||!iA.isEmptyObject(A[e]))&&"toJSON"!==e)return!1;return!0}function c(A,e,t,n){if(iA.acceptData(A)){var i,r,o=iA.expando,s=A.nodeType,a=s?iA.cache:A,l=s?A[o]:A[o]&&o;if(l&&a[l]&&(n||a[l].data)||void 0!==t||"string"!=typeof e)return l||(l=s?A[o]=K.pop()||iA.guid++:o),a[l]||(a[l]=s?{}:{toJSON:iA.noop}),("object"==typeof e||"function"==typeof e)&&(n?a[l]=iA.extend(a[l],e):a[l].data=iA.extend(a[l].data,e)),r=a[l],n||(r.data||(r.data={}),r=r.data),void 0!==t&&(r[iA.camelCase(e)]=t),"string"==typeof e?null==(i=r[e])&&(i=r[iA.camelCase(e)]):i=r,i}}function u(A,e,t){if(iA.acceptData(A)){var n,i,r=A.nodeType,o=r?iA.cache:A,s=r?A[iA.expando]:iA.expando;if(o[s]){if(e&&(n=t?o[s]:o[s].data)){iA.isArray(e)?e=e.concat(iA.map(e,iA.camelCase)):e in n?e=[e]:(e=iA.camelCase(e),e=e in n?[e]:e.split(" ")),i=e.length;for(;i--;)delete n[e[i]];if(t?!l(n):!iA.isEmptyObject(n))return}(t||(delete o[s].data,l(o[s])))&&(r?iA.cleanData([A],!0):tA.deleteExpando||o!=o.window?delete o[s]:o[s]=null)}}}function g(){return!0}function h(){return!1}function B(){try{return BA.activeElement}catch(A){}}function d(A){var e=RA.split("|"),t=A.createDocumentFragment();if(t.createElement)for(;e.length;)t.createElement(e.pop());return t}function p(A,e){var t,n,i=0,r=typeof A.getElementsByTagName!==IA?A.getElementsByTagName(e||"*"):typeof A.querySelectorAll!==IA?A.querySelectorAll(e||"*"):void 0;if(!r)for(r=[],t=A.childNodes||A;null!=(n=t[i]);i++)!e||iA.nodeName(n,e)?r.push(n):iA.merge(r,p(n,e));return void 0===e||e&&iA.nodeName(A,e)?iA.merge([A],r):r}function Q(A){GA.test(A.type)&&(A.defaultChecked=A.checked)}function E(A,e){return iA.nodeName(A,"table")&&iA.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?A.getElementsByTagName("tbody")[0]||A.appendChild(A.ownerDocument.createElement("tbody")):A}function f(A){return A.type=(null!==iA.find.attr(A,"type"))+"/"+A.type,A}function C(A){var e=VA.exec(A.type);return e?A.type=e[1]:A.removeAttribute("type"),A}function w(A,e){for(var t,n=0;null!=(t=A[n]);n++)iA._data(t,"globalEval",!e||iA._data(e[n],"globalEval"))}function I(A,e){if(1===e.nodeType&&iA.hasData(A)){var t,n,i,r=iA._data(A),o=iA._data(e,r),s=r.events;if(s){delete o.handle,o.events={};for(t in s)for(n=0,i=s[t].length;i>n;n++)iA.event.add(e,t,s[t][n])}o.data&&(o.data=iA.extend({},o.data))}}function m(A,e){var t,n,i;if(1===e.nodeType){if(t=e.nodeName.toLowerCase(),!tA.noCloneEvent&&e[iA.expando]){i=iA._data(e);for(n in i.events)iA.removeEvent(e,n,i.handle);e.removeAttribute(iA.expando)}"script"===t&&e.text!==A.text?(f(e).text=A.text,C(e)):"object"===t?(e.parentNode&&(e.outerHTML=A.outerHTML),tA.html5Clone&&A.innerHTML&&!iA.trim(e.innerHTML)&&(e.innerHTML=A.innerHTML)):"input"===t&&GA.test(A.type)?(e.defaultChecked=e.checked=A.checked,e.value!==A.value&&(e.value=A.value)):"option"===t?e.defaultSelected=e.selected=A.defaultSelected:("input"===t||"textarea"===t)&&(e.defaultValue=A.defaultValue)}}function M(e,t){var n,i=iA(t.createElement(e)).appendTo(t.body),r=A.getDefaultComputedStyle&&(n=A.getDefaultComputedStyle(i[0]))?n.display:iA.css(i[0],"display");return i.detach(),r}function b(A){var e=BA,t=qA[A];return t||(t=M(A,e),"none"!==t&&t||(XA=(XA||iA("':'
',a+='
'+r.closeText+'
',i.jqib=A(a).appendTo(o),i.jqi=i.jqib.children("."+r.prefix),i.jqif=i.jqib.children("."+r.prefix+"fade"),t.constructor===String&&(t={state0:{title:r.title,html:t,buttons:r.buttons,position:r.position,focus:r.focus,defaultButton:r.defaultButton,submit:r.submit}}),i.options.states={};var l,c;for(l in t)c=A.extend({},e.defaults.state,{name:l},t[l]),i.addState(c.name,c),""===i.currentStateName&&(i.currentStateName=c.name);i.jqi.on("click","."+r.prefix+"buttons button",function(){var e=A(this),t=e.parents("."+r.prefix+"state"),n=i.options.states[t.data("jqi-name")],o=t.children("."+r.prefix+"message"),s=n.buttons[e.text()]||n.buttons[e.html()],a={};if(void 0===s)for(var l in n.buttons)(n.buttons[l].title===e.text()||n.buttons[l].title===e.html())&&(s=n.buttons[l].value);A.each(i.jqi.children("form").serializeArray(),function(A,e){void 0===a[e.name]?a[e.name]=e.value:typeof a[e.name]===Array||"object"==typeof a[e.name]?a[e.name].push(e.value):a[e.name]=[a[e.name],e.value]});var c=new A.Event("impromptu:submit");c.stateName=n.name,c.state=t,t.trigger(c,[s,o,a]),c.isDefaultPrevented()||i.close(!0,s,o,a)});var u=function(){if(r.persistent){var e=(""+r.top).indexOf("%")>=0?s.height()*(parseInt(r.top,10)/100):parseInt(r.top,10),t=parseInt(i.jqi.css("top").replace("px",""),10)-e;A("html,body").animate({scrollTop:t},"fast",function(){var A=0;i.jqib.addClass(r.prefix+"warning");var e=setInterval(function(){i.jqib.toggleClass(r.prefix+"warning"),A++>1&&(clearInterval(e),i.jqib.removeClass(r.prefix+"warning"))},100)})}else i.close(!0)},g=function(e){var t=window.event?event.keyCode:e.keyCode;if(27===t&&u(),13===t){var n=i.getCurrentState().find("."+r.prefix+"defaultbutton");!1===A(e.target).is("textarea,."+r.prefix+"button")&&n.length>0&&(e.preventDefault(),n.click())}if(9===t){var o=A("input,select,textarea,button",i.getCurrentState()),s=!e.shiftKey&&e.target===o[o.length-1],a=e.shiftKey&&e.target===o[0];if(s||a)return setTimeout(function(){if(o){var A=o[!0===a?o.length-1:0];A&&A.focus()}},10),!1}};return i.position(),i.style(),i._windowResize=function(A){i.position(A)},s.resize({animate:!1},i._windowResize),i.jqif.click(u),i.jqi.find("."+r.prefix+"close").click(function(){i.close()}),i.jqib.on("keydown",g).on("impromptu:loaded",r.loaded).on("impromptu:close",r.close).on("impromptu:statechanging",r.statechanging).on("impromptu:statechanged",r.statechanged),i.jqif[r.show](r.overlayspeed),i.jqi[r.show](r.promptspeed,function(){var A=i.jqi.find("."+r.prefix+"states ."+r.prefix+"state").eq(0);i.goToState(A.data("jqi-name")),i.jqib.trigger("impromptu:loaded")}),r.timeout>0&&(i.timeout=setTimeout(function(){i.close(!0)},r.timeout)),i},close:function(t,n,i,r){var o=this;return e.removeFromStack(o.id),o.timeout&&(clearTimeout(o.timeout),o.timeout=!1),o.jqib&&o.jqib[o.options.hide]("fast",function(){o.jqib.trigger("impromptu:close",[n,i,r]),o.jqib.remove(),A(window).off("resize",o._windowResize),"function"==typeof t&&t()}),o.currentStateName="",o},addState:function(t,n,i){var r,o,s,a,l,c=this,u="",g=null,h="",B="",d=c.options,p=A("."+d.prefix+"states"),Q=[],E=0;if(n=A.extend({},e.defaults.state,{name:t},n),null!==n.position.arrow&&(h='
'),n.title&&""!==n.title&&(B='
'+n.title+"
"),r=n.html,"function"==typeof n.html&&(r="Error: html function must return text"),u+='",g=A(u),g.on("impromptu:submit",n.submit),void 0!==i?p.find('[data-jqi-name="'+i+'"]').after(g):p.append(g),c.options.states[t]=n,g},removeState:function(A,e){var t=this,n=t.getState(A),i=function(){n.remove()};return 0!==n.length&&("none"!==n.css("display")?void 0!==e&&t.getState(e).length>0?t.goToState(e,!1,i):n.next().length>0?t.nextState(i):n.prev().length>0?t.prevState(i):t.close():n.slideUp("slow",i),!0)},getApi:function(){return this},getBox:function(){return this.jqib},getPrompt:function(){return this.jqi},getState:function(A){return this.jqi.find('[data-jqi-name="'+A+'"]')},getCurrentState:function(){return this.getState(this.getCurrentStateName())},getCurrentStateName:function(){return this.currentStateName},position:function(e){var t=this,n=A.fx.off,i=t.getCurrentState(),r=t.options.states[i.data("jqi-name")],o=r?r.position:void 0,s=A(window),a=document.body.scrollHeight,l=A(window).height(),c=(A(document).height(),a>l?a:l),u=parseInt(s.scrollTop(),10)+((""+t.options.top).indexOf("%")>=0?l*(parseInt(t.options.top,10)/100):parseInt(t.options.top,10));if(void 0!==e&&!1===e.data.animate&&(A.fx.off=!0),t.jqib.css({position:"absolute",height:c,width:"100%",top:0,left:0,right:0,bottom:0}),t.jqif.css({position:"fixed",height:c,width:"100%",top:0,left:0,right:0,bottom:0}),o&&o.container){var g=A(o.container).offset();A.isPlainObject(g)&&void 0!==g.top&&(t.jqi.css({position:"absolute"}),t.jqi.animate({top:g.top+o.y,left:g.left+o.x,marginLeft:0,width:void 0!==o.width?o.width:null}),u=g.top+o.y-((""+t.options.top).indexOf("%")>=0?l*(parseInt(t.options.top,10)/100):parseInt(t.options.top,10)),A("html,body").animate({scrollTop:u},"slow","swing",function(){}))}else o&&o.width?(t.jqi.css({position:"absolute",left:"50%"}),t.jqi.animate({top:o.y||u,left:o.x||"50%",marginLeft:o.width/2*-1,width:o.width})):t.jqi.css({position:"absolute",top:u,left:"50%",marginLeft:t.jqi.outerWidth(!1)/2*-1});void 0!==e&&!1===e.data.animate&&(A.fx.off=n)},style:function(){var A=this;A.jqif.css({zIndex:A.options.zIndex,display:"none",opacity:A.options.opacity}),A.jqi.css({zIndex:A.options.zIndex+1,display:"none"}),A.jqib.css({zIndex:A.options.zIndex})},goToState:function(e,t,n){var i=this,r=(i.jqi,i.options),o=i.getState(e),s=r.states[o.data("jqi-name")],a=new A.Event("impromptu:statechanging"),l=i.options;if(void 0!==s){if("function"==typeof s.html){var c=s.html;o.find("."+l.prefix+"message ").html(c())}"function"==typeof t&&(n=t,t=!1),i.jqib.trigger(a,[i.getCurrentStateName(),e]),!a.isDefaultPrevented()&&o.length>0&&(i.jqi.find("."+l.prefix+"parentstate").removeClass(l.prefix+"parentstate"),t?(i.jqi.find("."+l.prefix+"substate").not(o).slideUp(r.promptspeed).removeClass("."+l.prefix+"substate").find("."+l.prefix+"arrow").hide(),i.jqi.find("."+l.prefix+"state:visible").addClass(l.prefix+"parentstate"),o.addClass(l.prefix+"substate")):i.jqi.find("."+l.prefix+"state").not(o).slideUp(r.promptspeed).find("."+l.prefix+"arrow").hide(),i.currentStateName=s.name,o.slideDown(r.promptspeed,function(){var t=A(this);"string"==typeof s.focus?t.find(s.focus).eq(0).focus():t.find("."+l.prefix+"defaultbutton").focus(),t.find("."+l.prefix+"arrow").show(r.promptspeed),"function"==typeof n&&i.jqib.on("impromptu:statechanged",n),i.jqib.trigger("impromptu:statechanged",[e]),"function"==typeof n&&i.jqib.off("impromptu:statechanged",n)}),t||i.position())}return o},nextState:function(A){var e=this,t=e.getCurrentState().next();return t.length>0&&e.goToState(t.data("jqi-name"),A),t},prevState:function(A){var e=this,t=e.getCurrentState().prev();return t.length>0&&e.goToState(t.data("jqi-name"),A),t}},A.prompt=function(A,t){return new e(A,t).jqi},A.each(e,function(e,t){A.prompt[e]=t}),A.each(e.prototype,function(t){A.prompt[t]=function(){var A=e.getLast();return A&&"function"==typeof A[t]?A[t].apply(A,arguments):void 0}}),A.fn.prompt=function(e){void 0===e&&(e={}),void 0===e.withDataAndEvents&&(e.withDataAndEvents=!1),A.prompt(A(this).clone(e.withDataAndEvents).html(),e)},window.Impromptu=e}),function(A){"use strict";"function"==typeof define&&define.amd?define("jstree",["jquery"],A):A("object"==typeof exports?require("jquery"):jQuery)}(function(A,e){"use strict";if(!A.jstree){var t,n,i=0,r=!1,o=!1,s=!1,a=[],l=A("script:last").attr("src"),c=document,u=c.createElement("LI");u.setAttribute("role","treeitem"),t=c.createElement("I"),t.className="jstree-icon jstree-ocl",t.setAttribute("role","presentation"),u.appendChild(t),t=c.createElement("A"),t.className="jstree-anchor",t.setAttribute("href","#"),t.setAttribute("tabindex","-1"),n=c.createElement("I"),n.className="jstree-icon jstree-themeicon",n.setAttribute("role","presentation"),t.appendChild(n),u.appendChild(t),t=n=null,A.jstree={version:"3.0.9",defaults:{plugins:[]},plugins:{},path:l&&-1!==l.indexOf("/")?l.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g},A.jstree.create=function(e,t){var n=new A.jstree.core(++i),r=t;return t=A.extend(!0,{},A.jstree.defaults,t),r&&r.plugins&&(t.plugins=r.plugins),A.each(t.plugins,function(A,e){"core"!==A&&(n=n.plugin(e,t[e]))}),n.init(e,t),n},A.jstree.destroy=function(){A(".jstree:jstree").jstree("destroy"),A(document).off(".jstree")},A.jstree.core=function(A){this._id=A,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},A.jstree.reference=function(e){var t=null,n=null;if(e&&e.id&&(e=e.id),!n||!n.length)try{n=A(e)}catch(A){}if(!n||!n.length)try{n=A("#"+e.replace(A.jstree.idregex,"\\$&"))}catch(A){}return n&&n.length&&(n=n.closest(".jstree")).length&&(n=n.data("jstree"))?t=n:A(".jstree").each(function(){var n=A(this).data("jstree");return n&&n._model.data[e]?(t=n,!1):void 0}),t},A.fn.jstree=function(t){var n="string"==typeof t,i=Array.prototype.slice.call(arguments,1),r=null;return!(!0===t&&!this.length)&&(this.each(function(){var o=A.jstree.reference(this),s=n&&o?o[t]:null;return r=n&&s?s.apply(o,i):null,o||n||t!==e&&!A.isPlainObject(t)||A(this).data("jstree",new A.jstree.create(this,t)),(o&&!n||!0===t)&&(r=o||!1),(null===r||r===e)&&void 0}),null!==r&&r!==e?r:this)},A.expr[":"].jstree=A.expr.createPseudo(function(t){return function(t){return A(t).hasClass("jstree")&&A(t).data("jstree")!==e}}),A.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:A.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},A.jstree.core.prototype={plugin:function(e,t){var n=A.jstree.plugins[e];return n?(this._data[e]={},n.prototype=this,new n(t,this)):this},init:function(e,t){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this.element=A(e).addClass("jstree jstree-"+this._id),this.settings=t,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html(""),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().height()||24,this.trigger("loading"),this.load_node("#")},destroy:function(A){if(this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(A){}A||this.element.empty(),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var e="",t=null,n=0;this.element.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var A=window.getSelection();try{A.removeAllRanges(),A.collapse()}catch(A){}}}).on("mousedown.jstree",A.proxy(function(A){A.target===this.element[0]&&(A.preventDefault(),n=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(A){A.preventDefault()}).on("click.jstree",".jstree-ocl",A.proxy(function(A){this.toggle_node(A.target)},this)).on("dblclick.jstree",".jstree-anchor",A.proxy(function(A){this.settings.core.dblclick_toggle&&this.toggle_node(A.target)},this)).on("click.jstree",".jstree-anchor",A.proxy(function(e){e.preventDefault(),e.currentTarget!==document.activeElement&&A(e.currentTarget).focus(),this.activate_node(e.currentTarget,e)},this)).on("keydown.jstree",".jstree-anchor",A.proxy(function(e){if("INPUT"===e.target.tagName)return!0;var t=null;switch(this._data.core.rtl&&(37===e.which?e.which=39:39===e.which&&(e.which=37)),e.which){case 32:e.ctrlKey&&(e.type="click",A(e.currentTarget).trigger(e));break;case 13:e.type="click",A(e.currentTarget).trigger(e);break;case 37:e.preventDefault(),this.is_open(e.currentTarget)?this.close_node(e.currentTarget):(t=this.get_parent(e.currentTarget))&&"#"!==t.id&&this.get_node(t,!0).children(".jstree-anchor").focus();break;case 38:e.preventDefault(),(t=this.get_prev_dom(e.currentTarget))&&t.length&&t.children(".jstree-anchor").focus();break;case 39:e.preventDefault(),this.is_closed(e.currentTarget)?this.open_node(e.currentTarget,function(A){this.get_node(A,!0).children(".jstree-anchor").focus()}):this.is_open(e.currentTarget)&&(t=this.get_node(e.currentTarget,!0).children(".jstree-children")[0])&&A(this._firstChild(t)).children(".jstree-anchor").focus();break;case 40:e.preventDefault(), -(t=this.get_next_dom(e.currentTarget))&&t.length&&t.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:e.preventDefault(),(t=this._firstChild(this.get_container_ul()[0]))&&A(t).children(".jstree-anchor").filter(":visible").focus();break;case 35:e.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()}},this)).on("load_node.jstree",A.proxy(function(e,t){t.status&&("#"!==t.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(A.proxy(function(){if(!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var e,t,n=[];for(e=0,t=this._data.core.selected.length;t>e;e++)n=n.concat(this._model.data[this._data.core.selected[e]].parents);for(n=A.vakata.array_unique(n),e=0,t=n.length;t>e;e++)this.open_node(n[e],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",A.proxy(function(n){if("INPUT"===n.target.tagName)return!0;t&&clearTimeout(t),t=setTimeout(function(){e=""},500);var i=String.fromCharCode(n.which).toLowerCase(),r=this.element.find(".jstree-anchor").filter(":visible"),o=r.index(document.activeElement)||0,s=!1;if(e+=i,e.length>1){if(r.slice(o).each(A.proxy(function(t,n){return 0===A(n).text().toLowerCase().indexOf(e)?(A(n).focus(),s=!0,!1):void 0},this)),s)return;if(r.slice(0,o).each(A.proxy(function(t,n){return 0===A(n).text().toLowerCase().indexOf(e)?(A(n).focus(),s=!0,!1):void 0},this)),s)return}if(new RegExp("^"+i+"+$").test(e)){if(r.slice(o+1).each(A.proxy(function(e,t){return A(t).text().toLowerCase().charAt(0)===i?(A(t).focus(),s=!0,!1):void 0},this)),s)return;if(r.slice(0,o+1).each(A.proxy(function(e,t){return A(t).text().toLowerCase().charAt(0)===i?(A(t).focus(),s=!0,!1):void 0},this)),s)return}},this)).on("init.jstree",A.proxy(function(){var A=this.settings.core.themes;this._data.core.themes.dots=A.dots,this._data.core.themes.stripes=A.stripes,this._data.core.themes.icons=A.icons,this.set_theme(A.name||"default",A.url),this.set_theme_variant(A.variant)},this)).on("loading.jstree",A.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("blur.jstree",".jstree-anchor",A.proxy(function(e){this._data.core.focused=null,A(e.currentTarget).filter(".jstree-hovered").mouseleave(),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",A.proxy(function(e){var t=this.get_node(e.currentTarget);t&&t.id&&(this._data.core.focused=t.id),this.element.find(".jstree-hovered").not(e.currentTarget).mouseleave(),A(e.currentTarget).mouseenter(),this.element.attr("tabindex","-1")},this)).on("focus.jstree",A.proxy(function(){+new Date-n>500&&!this._data.core.focused&&(n=0,this.get_node(this.element.attr("aria-activedescendant"),!0).find("> .jstree-anchor").focus())},this)).on("mouseenter.jstree",".jstree-anchor",A.proxy(function(A){this.hover_node(A.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",A.proxy(function(A){this.dehover_node(A.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),A(document).off(".jstree-"+this._id)},trigger:function(A,e){e||(e={}),e.instance=this,this.element.triggerHandler(A.replace(".jstree","")+".jstree",e)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(e){var t=this.settings.core.strings;return A.isFunction(t)?t.call(this,e):t&&t[e]?t[e]:e},_firstChild:function(A){for(A=A?A.firstChild:null;null!==A&&1!==A.nodeType;)A=A.nextSibling;return A},_nextSibling:function(A){for(A=A?A.nextSibling:null;null!==A&&1!==A.nodeType;)A=A.nextSibling;return A},_previousSibling:function(A){for(A=A?A.previousSibling:null;null!==A&&1!==A.nodeType;)A=A.previousSibling;return A},get_node:function(e,t){e&&e.id&&(e=e.id);var n;try{if(this._model.data[e])e=this._model.data[e];else if("string"==typeof e&&this._model.data[e.replace(/^#/,"")])e=this._model.data[e.replace(/^#/,"")];else if("string"==typeof e&&(n=A("#"+e.replace(A.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[n.closest(".jstree-node").attr("id")])e=this._model.data[n.closest(".jstree-node").attr("id")];else if((n=A(e,this.element)).length&&this._model.data[n.closest(".jstree-node").attr("id")])e=this._model.data[n.closest(".jstree-node").attr("id")];else{if(!(n=A(e,this.element)).length||!n.hasClass("jstree"))return!1;e=this._model.data["#"]}return t&&(e="#"===e.id?this.element:A("#"+e.id.replace(A.jstree.idregex,"\\$&"),this.element)),e}catch(A){return!1}},get_path:function(A,e,t){if(!(A=A.parents?A:this.get_node(A))||"#"===A.id||!A.parents)return!1;var n,i,r=[];for(r.push(t?A.id:A.text),n=0,i=A.parents.length;i>n;n++)r.push(t?A.parents[n]:this.get_text(A.parents[n]));return r=r.reverse().slice(1),e?r.join(e):r},get_next_dom:function(e,t){var n;if(e=this.get_node(e,!0),e[0]===this.element[0]){for(n=this._firstChild(this.get_container_ul()[0]);n&&0===n.offsetHeight;)n=this._nextSibling(n);return!!n&&A(n)}if(!e||!e.length)return!1;if(t){n=e[0];do{n=this._nextSibling(n)}while(n&&0===n.offsetHeight);return!!n&&A(n)}if(e.hasClass("jstree-open")){for(n=this._firstChild(e.children(".jstree-children")[0]);n&&0===n.offsetHeight;)n=this._nextSibling(n);if(null!==n)return A(n)}n=e[0];do{n=this._nextSibling(n)}while(n&&0===n.offsetHeight);return null!==n?A(n):e.parentsUntil(".jstree",".jstree-node").next(".jstree-node:visible").first()},get_prev_dom:function(e,t){var n;if(e=this.get_node(e,!0),e[0]===this.element[0]){for(n=this.get_container_ul()[0].lastChild;n&&0===n.offsetHeight;)n=this._previousSibling(n);return!!n&&A(n)}if(!e||!e.length)return!1;if(t){n=e[0];do{n=this._previousSibling(n)}while(n&&0===n.offsetHeight);return!!n&&A(n)}n=e[0];do{n=this._previousSibling(n)}while(n&&0===n.offsetHeight);if(null!==n){for(e=A(n);e.hasClass("jstree-open");)e=e.children(".jstree-children").first().children(".jstree-node:visible:last");return e}return!(!(n=e[0].parentNode.parentNode)||!n.className||-1===n.className.indexOf("jstree-node"))&&A(n)},get_parent:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.parent},get_children_dom:function(A){return A=this.get_node(A,!0),A[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):!(!A||!A.length)&&A.children(".jstree-children").children(".jstree-node")},is_parent:function(A){return(A=this.get_node(A))&&(!1===A.state.loaded||A.children.length>0)},is_loaded:function(A){return(A=this.get_node(A))&&A.state.loaded},is_loading:function(A){return(A=this.get_node(A))&&A.state&&A.state.loading},is_open:function(A){return(A=this.get_node(A))&&A.state.opened},is_closed:function(A){return(A=this.get_node(A))&&this.is_parent(A)&&!A.state.opened},is_leaf:function(A){return!this.is_parent(A)},load_node:function(e,t){var n,i,r,o,s;if(A.isArray(e))return this._load_nodes(e.slice(),t),!0;if(!(e=this.get_node(e)))return t&&t.call(this,e,!1),!1;if(e.state.loaded){for(e.state.loaded=!1,n=0,i=e.children_d.length;i>n;n++){for(r=0,o=e.parents.length;o>r;r++)this._model.data[e.parents[r]].children_d=A.vakata.array_remove_item(this._model.data[e.parents[r]].children_d,e.children_d[n]);this._model.data[e.children_d[n]].state.selected&&(s=!0,this._data.core.selected=A.vakata.array_remove_item(this._data.core.selected,e.children_d[n])),delete this._model.data[e.children_d[n]]}e.children=[],e.children_d=[],s&&this.trigger("changed",{action:"load_node",node:e,selected:this._data.core.selected})}return e.state.loading=!0,this.get_node(e,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(e,A.proxy(function(A){e=this._model.data[e.id],e.state.loading=!1,e.state.loaded=A;var n=this.get_node(e,!0);e.state.loaded&&!e.children.length&&n&&n.length&&!n.hasClass("jstree-leaf")&&n.removeClass("jstree-closed jstree-open").addClass("jstree-leaf"),n.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:e,status:A}),t&&t.call(this,e,A)},this)),!0},_load_nodes:function(A,e,t){var n,i,r=!0,o=function(){this._load_nodes(A,e,!0)},s=this._model.data;for(n=0,i=A.length;i>n;n++)!s[A[n]]||s[A[n]].state.loaded&&t||(this.is_loading(A[n])||this.load_node(A[n],o),r=!1);r&&e&&!e.done&&(e.call(this,A),e.done=!0)},load_all:function(A,e){if(A||(A="#"),!(A=this.get_node(A)))return!1;var t,n,i=[],r=this._model.data,o=r[A.id].children_d;for(A.state&&!A.state.loaded&&i.push(A.id),t=0,n=o.length;n>t;t++)r[o[t]]&&r[o[t]].state&&!r[o[t]].state.loaded&&i.push(o[t]);i.length?this._load_nodes(i,function(){this.load_all(A,e)}):(e&&e.call(this,A),this.trigger("load_all",{node:A}))},_load_node:function(e,t){var n,i=this.settings.core.data;return i?A.isFunction(i)?i.call(this,e,A.proxy(function(n){!1===n&&t.call(this,!1),this["string"==typeof n?"_append_html_data":"_append_json_data"](e,"string"==typeof n?A(n):n,function(A){t.call(this,A)})},this)):"object"==typeof i?i.url?(i=A.extend(!0,{},i),A.isFunction(i.url)&&(i.url=i.url.call(this,e)),A.isFunction(i.data)&&(i.data=i.data.call(this,e)),A.ajax(i).done(A.proxy(function(n,i,r){var o=r.getResponseHeader("Content-Type");return-1!==o.indexOf("json")||"object"==typeof n?this._append_json_data(e,n,function(A){t.call(this,A)}):-1!==o.indexOf("html")||"string"==typeof n?this._append_html_data(e,A(n),function(A){t.call(this,A)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:e.id,xhr:r})},this.settings.core.error.call(this,this._data.core.last_error),t.call(this,!1))},this)).fail(A.proxy(function(A){t.call(this,!1),this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:e.id,xhr:A})},this.settings.core.error.call(this,this._data.core.last_error)},this))):(n=A.isArray(i)||A.isPlainObject(i)?JSON.parse(JSON.stringify(i)):i,"#"===e.id?this._append_json_data(e,n,function(A){t.call(this,A)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:e.id})},this.settings.core.error.call(this,this._data.core.last_error),t.call(this,!1))):"string"==typeof i?"#"===e.id?this._append_html_data(e,A(i),function(A){t.call(this,A)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:e.id})},this.settings.core.error.call(this,this._data.core.last_error),t.call(this,!1)):t.call(this,!1):"#"===e.id?this._append_html_data(e,this._data.core.original_container_html.clone(!0),function(A){t.call(this,A)}):t.call(this,!1)},_node_changed:function(A){(A=this.get_node(A))&&this._model.changed.push(A.id)},_append_html_data:function(e,t,n){e=this.get_node(e),e.children=[],e.children_d=[];var i,r,o,s=t.is("ul")?t.children():t,a=e.id,l=[],c=[],u=this._model.data,g=u[a],h=this._data.core.selected.length;for(s.each(A.proxy(function(e,t){(i=this._parse_model_from_html(A(t),a,g.parents.concat()))&&(l.push(i),c.push(i),u[i].children_d.length&&(c=c.concat(u[i].children_d)))},this)),g.children=l,g.children_d=c,r=0,o=g.parents.length;o>r;r++)u[g.parents[r]].children_d=u[g.parents[r]].children_d.concat(c);this.trigger("model",{nodes:c,parent:a}),"#"!==a?(this._node_changed(a),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==h&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),n.call(this,!0)},_append_json_data:function(e,t,n,i){e=this.get_node(e),e.children=[],e.children_d=[],t.d&&"string"==typeof(t=t.d)&&(t=JSON.parse(t)),A.isArray(t)||(t=[t]);var r=null,o={df:this._model.default_state,dat:t,par:e.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},s=function(A,e){A.data&&(A=A.data);var t,n,i,r,o=A.dat,s=A.par,a=[],l=[],c=[],u=A.df,g=A.t_id,h=A.t_cnt,B=A.m,d=B[s],p=A.sel,Q=function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a=A.id.toString(),l={id:a,text:A.text||"",icon:A.icon===e||A.icon,parent:t,parents:n,children:A.children||[],children_d:A.children_d||[],data:A.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in u)u.hasOwnProperty(i)&&(l.state[i]=u[i]);if(A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(l.icon=A.data.jstree.icon),A&&A.data&&(l.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(l.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(l.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(l.li_attr[i]=A.li_attr[i]);if(l.li_attr.id||(l.li_attr.id=a),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(l.a_attr[i]=A.a_attr[i]);for(A&&A.children&&!0===A.children&&(l.state.loaded=!1,l.children=[],l.children_d=[]),B[l.id]=l,i=0,r=l.children.length;r>i;i++)o=Q(B[l.children[i]],l.id,n),s=B[o],l.children_d.push(o),s.children_d.length&&(l.children_d=l.children_d.concat(s.children_d));return delete A.data,delete A.children,B[l.id].original=A,l.state.selected&&c.push(l.id),l.id},E=function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a,l=!1;do{l="j"+g+"_"+ ++h}while(B[l]);a={id:!1,text:"string"==typeof A?A:"",icon:"object"!=typeof A||A.icon===e||A.icon,parent:t,parents:n,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in u)u.hasOwnProperty(i)&&(a.state[i]=u[i]);if(A&&A.id&&(a.id=A.id.toString()),A&&A.text&&(a.text=A.text),A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(a.icon=A.data.jstree.icon),A&&A.data&&(a.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(a.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(a.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(a.li_attr[i]=A.li_attr[i]);if(a.li_attr.id&&!a.id&&(a.id=a.li_attr.id.toString()),a.id||(a.id=l),a.li_attr.id||(a.li_attr.id=a.id),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(a.a_attr[i]=A.a_attr[i]);if(A&&A.children&&A.children.length){for(i=0,r=A.children.length;r>i;i++)o=E(A.children[i],a.id,n),s=B[o],a.children.push(o),s.children_d.length&&(a.children_d=a.children_d.concat(s.children_d));a.children_d=a.children_d.concat(a.children)}return A&&A.children&&!0===A.children&&(a.state.loaded=!1,a.children=[],a.children_d=[]),delete A.data,delete A.children,a.original=A,B[a.id]=a,a.state.selected&&c.push(a.id),a.id};if(o.length&&o[0].id!==e&&o[0].parent!==e){for(n=0,i=o.length;i>n;n++)o[n].children||(o[n].children=[]),B[o[n].id.toString()]=o[n];for(n=0,i=o.length;i>n;n++)B[o[n].parent.toString()].children.push(o[n].id.toString()),d.children_d.push(o[n].id.toString());for(n=0,i=d.children.length;i>n;n++)t=Q(B[d.children[n]],s,d.parents.concat()),l.push(t),B[t].children_d.length&&(l=l.concat(B[t].children_d));for(n=0,i=d.parents.length;i>n;n++)B[d.parents[n]].children_d=B[d.parents[n]].children_d.concat(l);r={cnt:h,mod:B,sel:p,par:s,dpc:l,add:c}}else{for(n=0,i=o.length;i>n;n++)(t=E(o[n],s,d.parents.concat()))&&(a.push(t),l.push(t),B[t].children_d.length&&(l=l.concat(B[t].children_d)));for(d.children=a,d.children_d=l,n=0,i=d.parents.length;i>n;n++)B[d.parents[n]].children_d=B[d.parents[n]].children_d.concat(l);r={cnt:h,mod:B,sel:p,par:s,dpc:l,add:c}}return"undefined"!=typeof window&&void 0!==window.document?r:void postMessage(r)},a=function(e,t){if(this._cnt=e.cnt,this._model.data=e.mod,t){var i,r,o=e.add,s=e.sel,a=this._data.core.selected.slice(),l=this._model.data;if(s.length!==a.length||A.vakata.array_unique(s.concat(a)).length!==s.length){for(i=0,r=s.length;r>i;i++)-1===A.inArray(s[i],o)&&-1===A.inArray(s[i],a)&&(l[s[i]].state.selected=!1);for(i=0,r=a.length;r>i;i++)-1===A.inArray(a[i],s)&&(l[a[i]].state.selected=!0)}}e.add.length&&(this._data.core.selected=this._data.core.selected.concat(e.add)),this.trigger("model",{nodes:e.dpc,parent:e.par}),"#"!==e.par?(this._node_changed(e.par),this.redraw()):this.redraw(!0),e.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),n.call(this,!0)};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+s.toString()],{type:"text/javascript"}))),!this._data.core.working||i?(this._data.core.working=!0,r=new window.Worker(this._wrk),r.onmessage=A.proxy(function(A){a.call(this,A.data,!0);try{r.terminate(),r=null}catch(A){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),o.par?r.postMessage(o):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([e,t,n,!0])}catch(A){a.call(this,s(o),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else a.call(this,s(o),!1)},_parse_model_from_html:function(e,t,n){n=n?[].concat(n):[],t&&n.unshift(t);var i,r,o,s,a,l=this._model.data,c={id:!1,text:!1,icon:!0,parent:t,parents:n,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(o in this._model.default_state)this._model.default_state.hasOwnProperty(o)&&(c.state[o]=this._model.default_state[o]);if(s=A.vakata.attributes(e,!0),A.each(s,function(e,t){return t=A.trim(t),!t.length||(c.li_attr[e]=t,void("id"===e&&(c.id=t.toString())))}),s=e.children("a").first(),s.length&&(s=A.vakata.attributes(s,!0),A.each(s,function(e,t){t=A.trim(t),t.length&&(c.a_attr[e]=t)})),s=e.children("a").first().length?e.children("a").first().clone():e.clone(),s.children("ins, i, ul").remove(),s=s.html(),s=A("
").html(s),c.text=this.settings.core.force_text?s.text():s.html(),s=e.data(),c.data=s?A.extend(!0,{},s):null,c.state.opened=e.hasClass("jstree-open"),c.state.selected=e.children("a").hasClass("jstree-clicked"),c.state.disabled=e.children("a").hasClass("jstree-disabled"),c.data&&c.data.jstree)for(o in c.data.jstree)c.data.jstree.hasOwnProperty(o)&&(c.state[o]=c.data.jstree[o]);s=e.children("a").children(".jstree-themeicon"),s.length&&(c.icon=!s.hasClass("jstree-themeicon-hidden")&&s.attr("rel")),c.state.icon&&(c.icon=c.state.icon),s=e.children("ul").children("li");do{a="j"+this._id+"_"+ ++this._cnt}while(l[a]);return c.id=c.li_attr.id?c.li_attr.id.toString():a,s.length?(s.each(A.proxy(function(e,t){i=this._parse_model_from_html(A(t),c.id,n),r=this._model.data[i],c.children.push(i),r.children_d.length&&(c.children_d=c.children_d.concat(r.children_d))},this)),c.children_d=c.children_d.concat(c.children)):e.hasClass("jstree-closed")&&(c.state.loaded=!1),c.li_attr.class&&(c.li_attr.class=c.li_attr.class.replace("jstree-closed","").replace("jstree-open","")),c.a_attr.class&&(c.a_attr.class=c.a_attr.class.replace("jstree-clicked","").replace("jstree-disabled","")),l[c.id]=c,c.state.selected&&this._data.core.selected.push(c.id),c.id},_parse_model_from_flat_json:function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a=A.id.toString(),l=this._model.data,c=this._model.default_state,u={id:a,text:A.text||"",icon:A.icon===e||A.icon,parent:t,parents:n,children:A.children||[],children_d:A.children_d||[],data:A.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in c)c.hasOwnProperty(i)&&(u.state[i]=c[i]);if(A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(u.icon=A.data.jstree.icon),A&&A.data&&(u.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(u.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(u.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(u.li_attr[i]=A.li_attr[i]);if(u.li_attr.id||(u.li_attr.id=a),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(u.a_attr[i]=A.a_attr[i]);for(A&&A.children&&!0===A.children&&(u.state.loaded=!1,u.children=[],u.children_d=[]),l[u.id]=u,i=0,r=u.children.length;r>i;i++)o=this._parse_model_from_flat_json(l[u.children[i]],u.id,n),s=l[o],u.children_d.push(o),s.children_d.length&&(u.children_d=u.children_d.concat(s.children_d));return delete A.data,delete A.children,l[u.id].original=A,u.state.selected&&this._data.core.selected.push(u.id),u.id},_parse_model_from_json:function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a,l=!1,c=this._model.data,u=this._model.default_state;do{l="j"+this._id+"_"+ ++this._cnt}while(c[l]);a={id:!1,text:"string"==typeof A?A:"",icon:"object"!=typeof A||A.icon===e||A.icon,parent:t,parents:n,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in u)u.hasOwnProperty(i)&&(a.state[i]=u[i]);if(A&&A.id&&(a.id=A.id.toString()),A&&A.text&&(a.text=A.text),A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(a.icon=A.data.jstree.icon),A&&A.data&&(a.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(a.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(a.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(a.li_attr[i]=A.li_attr[i]);if(a.li_attr.id&&!a.id&&(a.id=a.li_attr.id.toString()),a.id||(a.id=l),a.li_attr.id||(a.li_attr.id=a.id),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(a.a_attr[i]=A.a_attr[i]);if(A&&A.children&&A.children.length){for(i=0,r=A.children.length;r>i;i++)o=this._parse_model_from_json(A.children[i],a.id,n),s=c[o],a.children.push(o),s.children_d.length&&(a.children_d=a.children_d.concat(s.children_d));a.children_d=a.children_d.concat(a.children)}return A&&A.children&&!0===A.children&&(a.state.loaded=!1,a.children=[],a.children_d=[]),delete A.data,delete A.children,a.original=A,c[a.id]=a,a.state.selected&&this._data.core.selected.push(a.id),a.id},_redraw:function(){var A,e,t,n=this._model.force_full_redraw?this._model.data["#"].children.concat([]):this._model.changed.concat([]),i=document.createElement("UL"),r=this._data.core.focused;for(e=0,t=n.length;t>e;e++)(A=this.redraw_node(n[e],!0,this._model.force_full_redraw))&&this._model.force_full_redraw&&i.appendChild(A);this._model.force_full_redraw&&(i.className=this.get_container_ul()[0].className,i.setAttribute("role","group"),this.element.empty().append(i)),null!==r&&(A=this.get_node(r,!0),A&&A.length&&A.children(".jstree-anchor")[0]!==document.activeElement?A.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:n})},redraw:function(A){A&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(A){var e=this.get_node(A),t=!1,n=!1,i=!1,r=document;if(!e)return!1;if("#"===e.id)return this.redraw(!0);if(!(A=this.get_node(A,!0))||!A.length)return!1;if(A.children(".jstree-children").remove(),A=A[0],e.children.length&&e.state.loaded){for(i=r.createElement("UL"),i.setAttribute("role","group"),i.className="jstree-children",t=0,n=e.children.length;n>t;t++)i.appendChild(this.redraw_node(e.children[t],!0,!0));A.appendChild(i)}},redraw_node:function(e,t,n,i){var r=this.get_node(e),o=!1,s=!1,a=!1,l=!1,c=!1,g=!1,h="",B=document,d=this._model.data,p=!1,Q=null,E=0,f=0;if(!r)return!1;if("#"===r.id)return this.redraw(!0);if(t=t||0===r.children.length,e=document.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(r.id[0])?"\\3"+r.id[0]+" "+r.id.substr(1).replace(A.jstree.idregex,"\\$&"):r.id.replace(A.jstree.idregex,"\\$&"))):document.getElementById(r.id))e=A(e),n||(o=e.parent().parent()[0],o===this.element[0]&&(o=null),s=e.index()),t||!r.children.length||e.children(".jstree-children").length||(t=!0),t||(a=e.children(".jstree-children")[0]),p=e.children(".jstree-anchor")[0]===document.activeElement,e.remove();else if(t=!0,!n){if(!(null===(o="#"!==r.parent?A("#"+r.parent.replace(A.jstree.idregex,"\\$&"),this.element)[0]:null)||o&&d[r.parent].state.opened))return!1;s=A.inArray(r.id,null===o?d["#"].children:d[r.parent].children)}e=u.cloneNode(!0),h="jstree-node ";for(l in r.li_attr)if(r.li_attr.hasOwnProperty(l)){if("id"===l)continue;"class"!==l?e.setAttribute(l,r.li_attr[l]):h+=r.li_attr[l]}r.a_attr.id||(r.a_attr.id=r.id+"_anchor"),e.setAttribute("aria-selected",!!r.state.selected),e.setAttribute("aria-level",r.parents.length),e.setAttribute("aria-labelledby",r.a_attr.id),r.state.disabled&&e.setAttribute("aria-disabled",!0),r.state.loaded&&!r.children.length?h+=" jstree-leaf":(h+=r.state.opened&&r.state.loaded?" jstree-open":" jstree-closed",e.setAttribute("aria-expanded",r.state.opened&&r.state.loaded)),null!==r.parent&&d[r.parent].children[d[r.parent].children.length-1]===r.id&&(h+=" jstree-last"),e.id=r.id,e.className=h,h=(r.state.selected?" jstree-clicked":"")+(r.state.disabled?" jstree-disabled":"");for(c in r.a_attr)if(r.a_attr.hasOwnProperty(c)){if("href"===c&&"#"===r.a_attr[c])continue;"class"!==c?e.childNodes[1].setAttribute(c,r.a_attr[c]):h+=" "+r.a_attr[c]}if(h.length&&(e.childNodes[1].className="jstree-anchor "+h),(r.icon&&!0!==r.icon||!1===r.icon)&&(!1===r.icon?e.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===r.icon.indexOf("/")&&-1===r.icon.indexOf(".")?e.childNodes[1].childNodes[0].className+=" "+r.icon+" jstree-themeicon-custom":(e.childNodes[1].childNodes[0].style.backgroundImage="url("+r.icon+")",e.childNodes[1].childNodes[0].style.backgroundPosition="center center",e.childNodes[1].childNodes[0].style.backgroundSize="auto",e.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?e.childNodes[1].appendChild(B.createTextNode(r.text)):e.childNodes[1].innerHTML+=r.text,t&&r.children.length&&(r.state.opened||i)&&r.state.loaded){for(g=B.createElement("UL"),g.setAttribute("role","group"),g.className="jstree-children",l=0,c=r.children.length;c>l;l++)g.appendChild(this.redraw_node(r.children[l],t,!0));e.appendChild(g)}if(a&&e.appendChild(a),!n){for(o||(o=this.element[0]),l=0,c=o.childNodes.length;c>l;l++)if(o.childNodes[l]&&o.childNodes[l].className&&-1!==o.childNodes[l].className.indexOf("jstree-children")){Q=o.childNodes[l];break}Q||(Q=B.createElement("UL"),Q.setAttribute("role","group"),Q.className="jstree-children",o.appendChild(Q)),o=Q,sr;r++)this.open_node(t[r],n,i);return!0}if(!(t=this.get_node(t))||"#"===t.id)return!1;if(i=i===e?this.settings.core.animation:i,!this.is_closed(t))return n&&n.call(this,t,!1),!1;if(this.is_loaded(t))s=this.get_node(t,!0),a=this,s.length&&(i&&s.children(".jstree-children").length&&s.children(".jstree-children").stop(!0,!0),t.children.length&&!this._firstChild(s.children(".jstree-children")[0])&&this.draw_children(t),i?(this.trigger("before_open",{node:t}),s.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(i,function(){this.style.display="",a.trigger("after_open",{node:t})})):(this.trigger("before_open",{node:t}),s[0].className=s[0].className.replace("jstree-closed","jstree-open"),s[0].setAttribute("aria-expanded",!0))),t.state.opened=!0,n&&n.call(this,t,!0),s.length||this.trigger("before_open",{node:t}),this.trigger("open_node",{node:t}),i&&s.length||this.trigger("after_open",{node:t});else{if(this.is_loading(t))return setTimeout(A.proxy(function(){this.open_node(t,n,i)},this),500);this.load_node(t,function(A,e){return e?this.open_node(A,n,i):!!n&&n.call(this,A,!1)})}},_open_to:function(e){if(!(e=this.get_node(e))||"#"===e.id)return!1;var t,n,i=e.parents;for(t=0,n=i.length;n>t;t+=1)"#"!==t&&this.open_node(i[t],!1,0);return A("#"+e.id.replace(A.jstree.idregex,"\\$&"),this.element)},close_node:function(t,n){var i,r,o,s;if(A.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.close_node(t[i],n);return!0}return!(!(t=this.get_node(t))||"#"===t.id)&&(!this.is_closed(t)&&(n=n===e?this.settings.core.animation:n,o=this,s=this.get_node(t,!0),s.length&&(n?s.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(n,function(){this.style.display="",s.children(".jstree-children").remove(),o.trigger("after_close",{node:t})}):(s[0].className=s[0].className.replace("jstree-open","jstree-closed"),s.attr("aria-expanded",!1).children(".jstree-children").remove())),t.state.opened=!1,this.trigger("close_node",{node:t}),void(n&&s.length||this.trigger("after_close",{node:t}))))},toggle_node:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.toggle_node(e[t]);return!0}return this.is_closed(e)?this.open_node(e):this.is_open(e)?this.close_node(e):void 0},open_all:function(A,e,t){if(A||(A="#"),!(A=this.get_node(A)))return!1;var n,i,r,o="#"===A.id?this.get_container_ul():this.get_node(A,!0);if(!o.length){for(n=0,i=A.children_d.length;i>n;n++)this.is_closed(this._model.data[A.children_d[n]])&&(this._model.data[A.children_d[n]].state.opened=!0);return this.trigger("open_all",{node:A})}t=t||o,r=this,o=this.is_closed(A)?o.find(".jstree-closed").addBack():o.find(".jstree-closed"),o.each(function(){r.open_node(this,function(A,n){n&&this.is_parent(A)&&this.open_all(A,e,t)},e||0)}),0===t.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(t)})},close_all:function(e,t){if(e||(e="#"),!(e=this.get_node(e)))return!1;var n,i,r="#"===e.id?this.get_container_ul():this.get_node(e,!0),o=this;if(!r.length){for(n=0,i=e.children_d.length;i>n;n++)this._model.data[e.children_d[n]].state.opened=!1;return this.trigger("close_all",{node:e})}r=this.is_open(e)?r.find(".jstree-open").addBack():r.find(".jstree-open"),A(r.get().reverse()).each(function(){o.close_node(this,t||0)}),this.trigger("close_all",{node:e})},is_disabled:function(A){return(A=this.get_node(A))&&A.state&&A.state.disabled},enable_node:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.enable_node(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(e.state.disabled=!1,this.get_node(e,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:e}))},disable_node:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.disable_node(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(e.state.disabled=!0,this.get_node(e,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:e}))},activate_node:function(A,t){if(this.is_disabled(A))return!1;if(this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==e?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null), -!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(t.metaKey||t.ctrlKey||t.shiftKey)&&(!t.shiftKey||this._data.core.last_clicked&&this.get_parent(A)&&this.get_parent(A)===this._data.core.last_clicked.parent))if(t.shiftKey){var n,i,r=this.get_node(A).id,o=this._data.core.last_clicked.id,s=this.get_node(this._data.core.last_clicked.parent).children,a=!1;for(n=0,i=s.length;i>n;n+=1)s[n]===r&&(a=!a),s[n]===o&&(a=!a),a||s[n]===r||s[n]===o?this.select_node(s[n],!0,!1,t):this.deselect_node(s[n],!0,t);this.trigger("changed",{action:"select_node",node:this.get_node(A),selected:this._data.core.selected,event:t})}else this.is_selected(A)?this.deselect_node(A,!1,t):this.select_node(A,!1,!1,t);else!this.settings.core.multiple&&(t.metaKey||t.ctrlKey||t.shiftKey)&&this.is_selected(A)?this.deselect_node(A,!1,t):(this.deselect_all(!0),this.select_node(A,!1,!1,t),this._data.core.last_clicked=this.get_node(A));this.trigger("activate_node",{node:this.get_node(A)})},hover_node:function(A){if(!(A=this.get_node(A,!0))||!A.length||A.children(".jstree-hovered").length)return!1;var e=this.element.find(".jstree-hovered"),t=this.element;e&&e.length&&this.dehover_node(e),A.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(A)}),setTimeout(function(){t.attr("aria-activedescendant",A[0].id)},0)},dehover_node:function(A){return!!((A=this.get_node(A,!0))&&A.length&&A.children(".jstree-hovered").length)&&(A.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(A)}))},select_node:function(e,t,n,i){var r,o,s;if(A.isArray(e)){for(e=e.slice(),o=0,s=e.length;s>o;o++)this.select_node(e[o],t,n,i);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(r=this.get_node(e,!0),void(e.state.selected||(e.state.selected=!0,this._data.core.selected.push(e.id),n||(r=this._open_to(e)),r&&r.length&&r.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:e,selected:this._data.core.selected,event:i}),t||this.trigger("changed",{action:"select_node",node:e,selected:this._data.core.selected,event:i}))))},deselect_node:function(e,t,n){var i,r,o;if(A.isArray(e)){for(e=e.slice(),i=0,r=e.length;r>i;i++)this.deselect_node(e[i],t,n);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(o=this.get_node(e,!0),void(e.state.selected&&(e.state.selected=!1,this._data.core.selected=A.vakata.array_remove_item(this._data.core.selected,e.id),o.length&&o.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:e,selected:this._data.core.selected,event:n}),t||this.trigger("changed",{action:"deselect_node",node:e,selected:this._data.core.selected,event:n}))))},select_all:function(A){var e,t,n=this._data.core.selected.concat([]);for(this._data.core.selected=this._model.data["#"].children_d.concat(),e=0,t=this._data.core.selected.length;t>e;e++)this._model.data[this._data.core.selected[e]]&&(this._model.data[this._data.core.selected[e]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),A||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:n})},deselect_all:function(A){var e,t,n=this._data.core.selected.concat([]);for(e=0,t=this._data.core.selected.length;t>e;e++)this._model.data[this._data.core.selected[e]]&&(this._model.data[this._data.core.selected[e]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:n}),A||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:n})},is_selected:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.state.selected},get_selected:function(e){return e?A.map(this._data.core.selected,A.proxy(function(A){return this.get_node(A)},this)):this._data.core.selected.slice()},get_top_selected:function(e){var t,n,i,r,o=this.get_selected(!0),s={};for(t=0,n=o.length;n>t;t++)s[o[t].id]=o[t];for(t=0,n=o.length;n>t;t++)for(i=0,r=o[t].children_d.length;r>i;i++)s[o[t].children_d[i]]&&delete s[o[t].children_d[i]];o=[];for(t in s)s.hasOwnProperty(t)&&o.push(t);return e?A.map(o,A.proxy(function(A){return this.get_node(A)},this)):o},get_bottom_selected:function(e){var t,n,i=this.get_selected(!0),r=[];for(t=0,n=i.length;n>t;t++)i[t].children.length||r.push(i[t].id);return e?A.map(r,A.proxy(function(A){return this.get_node(A)},this)):r},get_state:function(){var A,e={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}};for(A in this._model.data)this._model.data.hasOwnProperty(A)&&"#"!==A&&(this._model.data[A].state.opened&&e.core.open.push(A),this._model.data[A].state.selected&&e.core.selected.push(A));return e},set_state:function(t,n){if(t){if(t.core){var i,r,o,s;if(t.core.open)return A.isArray(t.core.open)?(i=!0,r=!1,o=this,A.each(t.core.open.concat([]),function(e,s){(r=o.get_node(s))&&(o.is_loaded(s)?(o.is_closed(s)&&o.open_node(s,!1,0),t&&t.core&&t.core.open&&A.vakata.array_remove_item(t.core.open,s)):(o.is_loading(s)||o.open_node(s,A.proxy(function(e,i){!i&&t&&t.core&&t.core.open&&A.vakata.array_remove_item(t.core.open,e.id),this.set_state(t,n)},o),0),i=!1))}),i&&(delete t.core.open,this.set_state(t,n)),!1):(delete t.core.open,this.set_state(t,n),!1);if(t.core.scroll)return t.core.scroll&&t.core.scroll.left!==e&&this.element.scrollLeft(t.core.scroll.left),t.core.scroll&&t.core.scroll.top!==e&&this.element.scrollTop(t.core.scroll.top),delete t.core.scroll,this.set_state(t,n),!1;if(t.core.selected)return s=this,this.deselect_all(),A.each(t.core.selected,function(A,e){s.select_node(e)}),delete t.core.selected,this.set_state(t,n),!1;if(A.isEmptyObject(t.core))return delete t.core,this.set_state(t,n),!1}return!A.isEmptyObject(t)||(t=null,n&&n.call(this),this.trigger("set_state"),!1)}return!1},refresh:function(e,t){this._data.core.state=!0===t?{}:this.get_state(),t&&A.isFunction(t)&&(this._data.core.state=t.call(this,this._data.core.state)),this._cnt=0,this._model.data={"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}};var n=this.get_container_ul()[0].className;e||(this.element.html(""),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node("#",function(e,t){t&&(this.get_container_ul()[0].className=n,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(A.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(e){if(!(e=this.get_node(e))||"#"===e.id)return!1;var t=[],n=[];this._data.core.selected.concat([]);n.push(e.id),!0===e.state.opened&&t.push(e.id),this.get_node(e,!0).find(".jstree-open").each(function(){t.push(this.id)}),this._load_nodes(n,A.proxy(function(A){this.open_node(t,!1,0),this.select_node(this._data.core.selected),this.trigger("refresh_node",{node:e,nodes:A})},this))},set_id:function(e,t){if(!(e=this.get_node(e))||"#"===e.id)return!1;var n,i,r=this._model.data;for(t=t.toString(),r[e.parent].children[A.inArray(e.id,r[e.parent].children)]=t,n=0,i=e.parents.length;i>n;n++)r[e.parents[n]].children_d[A.inArray(e.id,r[e.parents[n]].children_d)]=t;for(n=0,i=e.children.length;i>n;n++)r[e.children[n]].parent=t;for(n=0,i=e.children_d.length;i>n;n++)r[e.children_d[n]].parents[A.inArray(e.id,r[e.children_d[n]].parents)]=t;return n=A.inArray(e.id,this._data.core.selected),-1!==n&&(this._data.core.selected[n]=t),n=this.get_node(e.id,!0),n&&n.attr("id",t),delete r[e.id],e.id=t,r[t]=e,!0},get_text:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.text},set_text:function(e,t){var n,i;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.set_text(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(e.text=t,this.get_node(e,!0).length&&this.redraw_node(e.id),this.trigger("set_text",{obj:e,text:t}),!0)},get_json:function(e,t,n){if(!(e=this.get_node(e||"#")))return!1;t&&t.flat&&!n&&(n=[]);var i,r,o={id:e.id,text:e.text,icon:this.get_icon(e),li_attr:A.extend(!0,{},e.li_attr),a_attr:A.extend(!0,{},e.a_attr),state:{},data:(!t||!t.no_data)&&A.extend(!0,{},e.data)};if(t&&t.flat?o.parent=e.parent:o.children=[],!t||!t.no_state)for(i in e.state)e.state.hasOwnProperty(i)&&(o.state[i]=e.state[i]);if(t&&t.no_id&&(delete o.id,o.li_attr&&o.li_attr.id&&delete o.li_attr.id,o.a_attr&&o.a_attr.id&&delete o.a_attr.id),t&&t.flat&&"#"!==e.id&&n.push(o),!t||!t.no_children)for(i=0,r=e.children.length;r>i;i++)t&&t.flat?this.get_json(e.children[i],t,n):o.children.push(this.get_json(e.children[i],t));return t&&t.flat?n:"#"===e.id?o.children:o},create_node:function(t,n,i,r,o){if(null===t&&(t="#"),!(t=this.get_node(t)))return!1;if(i=i===e?"last":i,!i.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(t))return this.load_node(t,function(){this.create_node(t,n,i,r,!0)});n||(n={text:this.get_string("New node")}),"string"==typeof n&&(n={text:n}),n.text===e&&(n.text=this.get_string("New node"));var s,a,l,c;switch("#"===t.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":s=this.get_node(t.parent),i=A.inArray(t.id,s.children),t=s;break;case"after":s=this.get_node(t.parent),i=A.inArray(t.id,s.children)+1,t=s;break;case"inside":case"first":i=0;break;case"last":i=t.children.length;break;default:i||(i=0)}if(i>t.children.length&&(i=t.children.length),n.id||(n.id=!0),!this.check("create_node",n,t,i))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!0===n.id&&delete n.id,!(n=this._parse_model_from_json(n,t.id,t.parents.concat())))return!1;for(s=this.get_node(n),a=[],a.push(n),a=a.concat(s.children_d),this.trigger("model",{nodes:a,parent:t.id}),t.children_d=t.children_d.concat(a),l=0,c=t.parents.length;c>l;l++)this._model.data[t.parents[l]].children_d=this._model.data[t.parents[l]].children_d.concat(a);for(n=s,s=[],l=0,c=t.children.length;c>l;l++)s[l>=i?l+1:l]=t.children[l];return s[i]=n.id,t.children=s,this.redraw_node(t,!0),r&&r.call(this,this.get_node(n)),this.trigger("create_node",{node:this.get_node(n),parent:t.id,position:i}),n.id},rename_node:function(e,t){var n,i,r;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.rename_node(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(r=e.text,this.check("rename_node",e,this.get_parent(e),t)?(this.set_text(e,t),this.trigger("rename_node",{node:e,text:t,old:r}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1))},delete_node:function(e){var t,n,i,r,o,s,a,l,c,u;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.delete_node(e[t]);return!0}if(!(e=this.get_node(e))||"#"===e.id)return!1;if(i=this.get_node(e.parent),r=A.inArray(e.id,i.children),u=!1,!this.check("delete_node",e,i,r))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==r&&(i.children=A.vakata.array_remove(i.children,r)),o=e.children_d.concat([]),o.push(e.id),l=0,c=o.length;c>l;l++){for(s=0,a=e.parents.length;a>s;s++)-1!==(r=A.inArray(o[l],this._model.data[e.parents[s]].children_d))&&(this._model.data[e.parents[s]].children_d=A.vakata.array_remove(this._model.data[e.parents[s]].children_d,r));this._model.data[o[l]].state.selected&&(u=!0,-1!==(r=A.inArray(o[l],this._data.core.selected))&&(this._data.core.selected=A.vakata.array_remove(this._data.core.selected,r)))}for(this.trigger("delete_node",{node:e,parent:i.id}),u&&this.trigger("changed",{action:"delete_node",node:e,selected:this._data.core.selected,parent:i.id}),l=0,c=o.length;c>l;l++)delete this._model.data[o[l]];return this.redraw_node(i,!0),!0},check:function(e,t,n,i,r){t=t&&t.id?t:this.get_node(t),n=n&&n.id?n:this.get_node(n);var o=e.match(/^move_node|copy_node|create_node$/i)?n:t,s=this.settings.core.check_callback;return"move_node"!==e&&"copy_node"!==e||r&&r.is_multi||t.id!==n.id&&A.inArray(t.id,n.children)!==i&&-1===A.inArray(n.id,t.children_d)?(o&&o.data&&(o=o.data),o&&o.functions&&(!1===o.functions[e]||!0===o.functions[e])?(!1===o.functions[e]&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!n||!n.id)&&n.id})}),o.functions[e]):!(!1===s||A.isFunction(s)&&!1===s.call(this,e,t,n,i,r)||s&&!1===s[e])||(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!n||!n.id)&&n.id})},!1)):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!n||!n.id)&&n.id})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(t,n,i,r,o,s){var a,l,c,u,g,h,B,d,p,Q,E,f,C,w;if(n=this.get_node(n),i=i===e?0:i,!n)return!1;if(!i.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(n))return this.load_node(n,function(){this.move_node(t,n,i,r,!0)});if(A.isArray(t)){for(t=t.slice(),a=0,l=t.length;l>a;a++)this.move_node(t[a],n,i,r,o,!0)&&(n=t[a],i="after");return this.redraw(),!0}if(!(t=t&&t.id?t:this.get_node(t))||"#"===t.id)return!1;if(c=(t.parent||"#").toString(),g=i.toString().match(/^(before|after)$/)&&"#"!==n.id?this.get_node(n.parent):n,h=t.instance?t.instance:this._model.data[t.id]?this:A.jstree.reference(t.id),B=!h||!h._id||this._id!==h._id,u=h&&h._id&&c&&h._model.data[c]&&h._model.data[c].children?A.inArray(t.id,h._model.data[c].children):-1,B)return!!this.copy_node(t,n,i,r,o)&&(h&&h.delete_node(t),!0);switch("#"===n.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":i=A.inArray(n.id,g.children);break;case"after":i=A.inArray(n.id,g.children)+1;break;case"inside":case"first":i=0;break;case"last":i=g.children.length;break;default:i||(i=0)}if(i>g.children.length&&(i=g.children.length),!this.check("move_node",t,g,i,{core:!0,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(t.parent===g.id){for(d=g.children.concat(),p=A.inArray(t.id,d),-1!==p&&(d=A.vakata.array_remove(d,p),i>p&&i--),p=[],Q=0,E=d.length;E>Q;Q++)p[Q>=i?Q+1:Q]=d[Q];p[i]=t.id,g.children=p,this._node_changed(g.id),this.redraw("#"===g.id)}else{for(p=t.children_d.concat(),p.push(t.id),Q=0,E=t.parents.length;E>Q;Q++){for(d=[],w=h._model.data[t.parents[Q]].children_d,f=0,C=w.length;C>f;f++)-1===A.inArray(w[f],p)&&d.push(w[f]);h._model.data[t.parents[Q]].children_d=d}for(h._model.data[c].children=A.vakata.array_remove_item(h._model.data[c].children,t.id),Q=0,E=g.parents.length;E>Q;Q++)this._model.data[g.parents[Q]].children_d=this._model.data[g.parents[Q]].children_d.concat(p);for(d=[],Q=0,E=g.children.length;E>Q;Q++)d[Q>=i?Q+1:Q]=g.children[Q];for(d[i]=t.id,g.children=d,g.children_d.push(t.id),g.children_d=g.children_d.concat(t.children_d),t.parent=g.id,p=g.parents.concat(),p.unshift(g.id),w=t.parents.length,t.parents=p,p=p.concat(),Q=0,E=t.children_d.length;E>Q;Q++)this._model.data[t.children_d[Q]].parents=this._model.data[t.children_d[Q]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[t.children_d[Q]].parents,p);("#"===c||"#"===g.id)&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(c),this._node_changed(g.id)),s||this.redraw()}return r&&r.call(this,t,g,i),this.trigger("move_node",{node:t,parent:g.id,position:i,old_parent:c,old_position:u,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id,old_instance:h,new_instance:this}),!0},copy_node:function(t,n,i,r,o,s){var a,l,c,u,g,h,B,d,p,Q;if(n=this.get_node(n),i=i===e?0:i,!n)return!1;if(!i.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(n))return this.load_node(n,function(){this.copy_node(t,n,i,r,!0)});if(A.isArray(t)){for(t=t.slice(),a=0,l=t.length;l>a;a++)(u=this.copy_node(t[a],n,i,r,o,!0))&&(n=u,i="after");return this.redraw(),!0}if(!(t=t&&t.id?t:this.get_node(t))||"#"===t.id)return!1;switch(d=(t.parent||"#").toString(),p=i.toString().match(/^(before|after)$/)&&"#"!==n.id?this.get_node(n.parent):n,Q=t.instance?t.instance:this._model.data[t.id]?this:A.jstree.reference(t.id),!Q||!Q._id||this._id!==Q._id,"#"===n.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":i=A.inArray(n.id,p.children);break;case"after":i=A.inArray(n.id,p.children)+1;break;case"inside":case"first":i=0;break;case"last":i=p.children.length;break;default:i||(i=0)}if(i>p.children.length&&(i=p.children.length),!this.check("copy_node",t,p,i,{core:!0,is_multi:Q&&Q._id&&Q._id!==this._id,is_foreign:!Q||!Q._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!(B=Q?Q.get_json(t,{no_id:!0,no_data:!0,no_state:!0}):t))return!1;if(!0===B.id&&delete B.id,!(B=this._parse_model_from_json(B,p.id,p.parents.concat())))return!1;for(u=this.get_node(B),t&&t.state&&!1===t.state.loaded&&(u.state.loaded=!1),c=[],c.push(B),c=c.concat(u.children_d),this.trigger("model",{nodes:c,parent:p.id}),g=0,h=p.parents.length;h>g;g++)this._model.data[p.parents[g]].children_d=this._model.data[p.parents[g]].children_d.concat(c);for(c=[],g=0,h=p.children.length;h>g;g++)c[g>=i?g+1:g]=p.children[g];return c[i]=u.id,p.children=c,p.children_d.push(u.id),p.children_d=p.children_d.concat(u.children_d),"#"===p.id&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(p.id),s||this.redraw("#"===p.id),r&&r.call(this,u,p,i),this.trigger("copy_node",{node:u,original:t,parent:p.id,position:i,old_parent:d,old_position:Q&&Q._id&&d&&Q._model.data[d]&&Q._model.data[d].children?A.inArray(t.id,Q._model.data[d].children):-1,is_multi:Q&&Q._id&&Q._id!==this._id,is_foreign:!Q||!Q._id,old_instance:Q,new_instance:this}),u.id},cut:function(e){if(e||(e=this._data.core.selected.concat()),A.isArray(e)||(e=[e]),!e.length)return!1;var t,n,i,a=[];for(n=0,i=e.length;i>n;n++)(t=this.get_node(e[n]))&&t.id&&"#"!==t.id&&a.push(t);return!!a.length&&(r=a,s=this,o="move_node",void this.trigger("cut",{node:e}))},copy:function(e){if(e||(e=this._data.core.selected.concat()),A.isArray(e)||(e=[e]),!e.length)return!1;var t,n,i,a=[];for(n=0,i=e.length;i>n;n++)(t=this.get_node(e[n]))&&t.id&&"#"!==t.id&&a.push(t);return!!a.length&&(r=a,s=this,o="copy_node",void this.trigger("copy",{node:e}))},get_buffer:function(){return{mode:o,node:r,inst:s}},can_paste:function(){return!1!==o&&!1!==r},paste:function(A,e){return!!((A=this.get_node(A))&&o&&o.match(/^(copy_node|move_node)$/)&&r)&&(this[o](r,A,e)&&this.trigger("paste",{parent:A.id,node:r,mode:o}),r=!1,o=!1,void(s=!1))},clear_buffer:function(){r=!1,o=!1,s=!1,this.trigger("clear_buffer")},edit:function(e,t){if(!(e=this.get_node(e)))return!1;if(!1===this.settings.core.check_callback)return this._data.core.last_error={error:"check",plugin:"core",id:"core_07",reason:"Could not edit node because of check_callback"},this.settings.core.error.call(this,this._data.core.last_error),!1;t="string"==typeof t?t:e.text,this.set_text(e,""),e=this._open_to(e);var n=this._data.core.rtl,i=this.element.width(),r=e.children(".jstree-anchor"),o=A(""),s=t,a=A("
",{css:{position:"absolute",top:"-200px",left:n?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),l=A("",{value:s,class:"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:A.proxy(function(){var t=o.children(".jstree-rename-input"),n=t.val();""===n&&(n=s),a.remove(),o.replaceWith(r),o.remove(),this.set_text(e,s),!1===this.rename_node(e,A("
").text(n)[this.settings.core.force_text?"text":"html"]())&&this.set_text(e,s)},this),keydown:function(A){var e=A.which;27===e&&(this.value=s),(27===e||13===e||37===e||38===e||39===e||40===e||32===e)&&A.stopImmediatePropagation(),(27===e||13===e)&&(A.preventDefault(),this.blur())},click:function(A){A.stopImmediatePropagation()},mousedown:function(A){A.stopImmediatePropagation()},keyup:function(A){l.width(Math.min(a.text("pW"+this.value).width(),i))},keypress:function(A){return 13!==A.which&&void 0}}),c={fontFamily:r.css("fontFamily")||"",fontSize:r.css("fontSize")||"",fontWeight:r.css("fontWeight")||"",fontStyle:r.css("fontStyle")||"",fontStretch:r.css("fontStretch")||"",fontVariant:r.css("fontVariant")||"",letterSpacing:r.css("letterSpacing")||"",wordSpacing:r.css("wordSpacing")||""};o.attr("class",r.attr("class")).append(r.contents().clone()).append(l),r.replaceWith(o),a.css(c),l.css(c).width(Math.min(a.text("pW"+l[0].value).width(),i))[0].select()},set_theme:function(e,t){if(!e)return!1;if(!0===t){var n=this.settings.core.themes.dir;n||(n=A.jstree.path+"/themes"),t=n+"/"+e+"/style.css"}t&&-1===A.inArray(t,a)&&(A("head").append(''),a.push(t)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=e,this.element.addClass("jstree-"+e),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+e+"-responsive"),this.trigger("set_theme",{theme:e})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(A){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=A,A&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(e,t){var n,i,r,o;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.set_icon(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(o=e.icon,e.icon=t,r=this.get_node(e,!0).children(".jstree-anchor").children(".jstree-themeicon"),!1===t?this.hide_icon(e):!0===t?(r.removeClass("jstree-themeicon-custom "+o).css("background","").removeAttr("rel"),!1===o&&this.show_icon(e)):-1===t.indexOf("/")&&-1===t.indexOf(".")?(r.removeClass(o).css("background",""),r.addClass(t+" jstree-themeicon-custom").attr("rel",t),!1===o&&this.show_icon(e)):(r.removeClass(o).css("background",""),r.addClass("jstree-themeicon-custom").css("background","url('"+t+"') center center no-repeat").attr("rel",t),!1===o&&this.show_icon(e)),!0)},get_icon:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.icon},hide_icon:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.hide_icon(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e)&&(e.icon=!1,this.get_node(e,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0)},show_icon:function(e){var t,n,i;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.show_icon(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e)&&(i=this.get_node(e,!0),e.icon=!i.length||i.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"),e.icon||(e.icon=!0),i.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0)}},A.vakata={},A.vakata.attributes=function(e,t){e=A(e)[0];var n=t?{}:[];return e&&e.attributes&&A.each(e.attributes,function(e,i){-1===A.inArray(i.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==i.value&&""!==A.trim(i.value)&&(t?n[i.name]=i.value:n.push(i.name))}),n},A.vakata.array_unique=function(A){var e,t,n,i=[];for(e=0,n=A.length;n>e;e++){for(t=0;e>=t&&A[e]!==A[t];t++);t===e&&i.push(A[e])}return i},A.vakata.array_remove=function(A,e,t){var n=A.slice((t||e)+1||A.length);return A.length=0>e?A.length+e:e,A.push.apply(A,n),A},A.vakata.array_remove_item=function(e,t){var n=A.inArray(t,e);return-1!==n?A.vakata.array_remove(e,n):e};var g=document.createElement("I");g.className="jstree-icon jstree-checkbox",g.setAttribute("role","presentation"),A.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0},A.jstree.plugins.checkbox=function(e,t){this.bind=function(){t.bind.call(this),this._data.checkbox.uto=!1,this._data.checkbox.selected=[],this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined"),this.element.on("init.jstree",A.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",A.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",A.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(A.proxy(this._undetermined,this),50)},this)),this.settings.checkbox.tie_selection||this.element.on("model.jstree",A.proxy(function(A,e){var t,n,i=this._model.data,r=(i[e.parent],e.nodes);for(t=0,n=r.length;n>t;t++)i[r[t]].state.checked=i[r[t]].original&&i[r[t]].original.state&&i[r[t]].original.state.checked,i[r[t]].state.checked&&this._data.checkbox.selected.push(r[t])},this)),(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",A.proxy(function(e,t){var n,i,r,o,s,a,l=this._model.data,c=l[t.parent],u=t.nodes,g=[],h=this.settings.checkbox.cascade,B=this.settings.checkbox.tie_selection;if(-1!==h.indexOf("down"))if(c.state[B?"selected":"checked"]){for(i=0,r=u.length;r>i;i++)l[u[i]].state[B?"selected":"checked"]=!0;this._data[B?"core":"checkbox"].selected=this._data[B?"core":"checkbox"].selected.concat(u)}else for(i=0,r=u.length;r>i;i++)if(l[u[i]].state[B?"selected":"checked"]){for(o=0,s=l[u[i]].children_d.length;s>o;o++)l[l[u[i]].children_d[o]].state[B?"selected":"checked"]=!0;this._data[B?"core":"checkbox"].selected=this._data[B?"core":"checkbox"].selected.concat(l[u[i]].children_d)}if(-1!==h.indexOf("up")){for(i=0,r=c.children_d.length;r>i;i++)l[c.children_d[i]].children.length||g.push(l[c.children_d[i]].parent);for(g=A.vakata.array_unique(g),o=0,s=g.length;s>o;o++)for(c=l[g[o]];c&&"#"!==c.id;){for(n=0,i=0,r=c.children.length;r>i;i++)n+=l[c.children[i]].state[B?"selected":"checked"];if(n!==r)break;c.state[B?"selected":"checked"]=!0,this._data[B?"core":"checkbox"].selected.push(c.id),a=this.get_node(c,!0),a&&a.length&&a.attr("aria-selected",!0).children(".jstree-anchor").addClass(B?"jstree-clicked":"jstree-checked"),c=this.get_node(c.parent)}}this._data[B?"core":"checkbox"].selected=A.vakata.array_unique(this._data[B?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",A.proxy(function(e,t){var n,i,r,o,s=t.node,a=this._model.data,l=this.get_node(s.parent),c=this.get_node(s,!0),u=this.settings.checkbox.cascade,g=this.settings.checkbox.tie_selection;if(-1!==u.indexOf("down"))for(this._data[g?"core":"checkbox"].selected=A.vakata.array_unique(this._data[g?"core":"checkbox"].selected.concat(s.children_d)),n=0,i=s.children_d.length;i>n;n++)o=a[s.children_d[n]],o.state[g?"selected":"checked"]=!0,o&&o.original&&o.original.state&&o.original.state.undetermined&&(o.original.state.undetermined=!1);if(-1!==u.indexOf("up"))for(;l&&"#"!==l.id;){for(r=0,n=0,i=l.children.length;i>n;n++)r+=a[l.children[n]].state[g?"selected":"checked"];if(r!==i)break;l.state[g?"selected":"checked"]=!0,this._data[g?"core":"checkbox"].selected.push(l.id),o=this.get_node(l,!0),o&&o.length&&o.attr("aria-selected",!0).children(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked"),l=this.get_node(l.parent)}-1!==u.indexOf("down")&&c.length&&c.find(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!0)},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",A.proxy(function(A,e){var t,n,i,r=this.get_node("#"),o=this._model.data;for(t=0,n=r.children_d.length;n>t;t++)(i=o[r.children_d[t]])&&i.original&&i.original.state&&i.original.state.undetermined&&(i.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",A.proxy(function(e,t){var n,i,r,o=t.node,s=this.get_node(o,!0),a=this.settings.checkbox.cascade,l=this.settings.checkbox.tie_selection;if(o&&o.original&&o.original.state&&o.original.state.undetermined&&(o.original.state.undetermined=!1),-1!==a.indexOf("down"))for(n=0,i=o.children_d.length;i>n;n++)r=this._model.data[o.children_d[n]],r.state[l?"selected":"checked"]=!1,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1);if(-1!==a.indexOf("up"))for(n=0,i=o.parents.length;i>n;n++)r=this._model.data[o.parents[n]],r.state[l?"selected":"checked"]=!1,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1),(r=this.get_node(o.parents[n],!0))&&r.length&&r.attr("aria-selected",!1).children(".jstree-anchor").removeClass(l?"jstree-clicked":"jstree-checked");for(r=[],n=0,i=this._data[l?"core":"checkbox"].selected.length;i>n;n++)-1!==a.indexOf("down")&&-1!==A.inArray(this._data[l?"core":"checkbox"].selected[n],o.children_d)||-1!==a.indexOf("up")&&-1!==A.inArray(this._data[l?"core":"checkbox"].selected[n],o.parents)||r.push(this._data[l?"core":"checkbox"].selected[n]);this._data[l?"core":"checkbox"].selected=A.vakata.array_unique(r),-1!==a.indexOf("down")&&s.length&&s.find(".jstree-anchor").removeClass(l?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!1)},this)),-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",A.proxy(function(A,e){for(var t,n,i,r,o=this.get_node(e.parent),s=this._model.data,a=this.settings.checkbox.tie_selection;o&&"#"!==o.id;){for(i=0,t=0,n=o.children.length;n>t;t++)i+=s[o.children[t]].state[a?"selected":"checked"];if(i!==n)break;o.state[a?"selected":"checked"]=!0,this._data[a?"core":"checkbox"].selected.push(o.id),r=this.get_node(o,!0),r&&r.length&&r.attr("aria-selected",!0).children(".jstree-anchor").addClass(a?"jstree-clicked":"jstree-checked"),o=this.get_node(o.parent)}},this)).on("move_node.jstree",A.proxy(function(e,t){ -var n,i,r,o,s,a=t.is_multi,l=t.old_parent,c=this.get_node(t.parent),u=this._model.data,g=this.settings.checkbox.tie_selection;if(!a)for(n=this.get_node(l);n&&"#"!==n.id;){for(i=0,r=0,o=n.children.length;o>r;r++)i+=u[n.children[r]].state[g?"selected":"checked"];if(i!==o)break;n.state[g?"selected":"checked"]=!0,this._data[g?"core":"checkbox"].selected.push(n.id),s=this.get_node(n,!0),s&&s.length&&s.attr("aria-selected",!0).children(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked"),n=this.get_node(n.parent)}for(n=c;n&&"#"!==n.id;){for(i=0,r=0,o=n.children.length;o>r;r++)i+=u[n.children[r]].state[g?"selected":"checked"];if(i===o)n.state[g?"selected":"checked"]||(n.state[g?"selected":"checked"]=!0,this._data[g?"core":"checkbox"].selected.push(n.id),(s=this.get_node(n,!0))&&s.length&&s.attr("aria-selected",!0).children(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked"));else{if(!n.state[g?"selected":"checked"])break;n.state[g?"selected":"checked"]=!1,this._data[g?"core":"checkbox"].selected=A.vakata.array_remove_item(this._data[g?"core":"checkbox"].selected,n.id),(s=this.get_node(n,!0))&&s.length&&s.attr("aria-selected",!1).children(".jstree-anchor").removeClass(g?"jstree-clicked":"jstree-checked")}n=this.get_node(n.parent)}},this))},this._undetermined=function(){var e,t,n=this._model.data,i=this.settings.checkbox.tie_selection,r=this._data[i?"core":"checkbox"].selected,o=[],s=this;for(e=0,t=r.length;t>e;e++)n[r[e]]&&n[r[e]].parents&&(o=o.concat(n[r[e]].parents));for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var A,i=s.get_node(this);if(i.state.loaded)for(e=0,t=i.children_d.length;t>e;e++)A=n[i.children_d[e]],!A.state.loaded&&A.original&&A.original.state&&A.original.state.undetermined&&!0===A.original.state.undetermined&&(o.push(A.id),o=o.concat(A.parents));else i.original&&i.original.state&&i.original.state.undetermined&&!0===i.original.state.undetermined&&(o.push(i.id),o=o.concat(i.parents))}),o=A.vakata.array_unique(o),o=A.vakata.array_remove_item(o,"#"),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),e=0,t=o.length;t>e;e++)n[o[e]].state[i?"selected":"checked"]||(r=this.get_node(o[e],!0))&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined")},this.redraw_node=function(e,n,i,r){if(e=t.redraw_node.apply(this,arguments)){var o,s,a=null;for(o=0,s=e.childNodes.length;s>o;o++)if(e.childNodes[o]&&e.childNodes[o].className&&-1!==e.childNodes[o].className.indexOf("jstree-anchor")){a=e.childNodes[o];break}a&&(!this.settings.checkbox.tie_selection&&this._model.data[e.id].state.checked&&(a.className+=" jstree-checked"),a.insertBefore(g.cloneNode(!1),a.childNodes[0]))}return i||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(A.proxy(this._undetermined,this),50)),e},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()},this.is_undetermined=function(e){e=this.get_node(e);var t,n,i=this.settings.checkbox.cascade,r=this.settings.checkbox.tie_selection,o=this._data[r?"core":"checkbox"].selected,s=this._model.data;if(!e||!0===e.state[r?"selected":"checked"]||-1===i.indexOf("undetermined")||-1===i.indexOf("down")&&-1===i.indexOf("up"))return!1;if(!e.state.loaded&&!0===e.original.state.undetermined)return!0;for(t=0,n=e.children_d.length;n>t;t++)if(-1!==A.inArray(e.children_d[t],o)||!s[e.children_d[t]].state.loaded&&s[e.children_d[t]].original.state.undetermined)return!0;return!1},this.activate_node=function(e,n){return this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||A(n.target).hasClass("jstree-checkbox"))&&(n.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!A(n.target).hasClass("jstree-checkbox")?t.activate_node.call(this,e,n):!this.is_disabled(e)&&(this.is_checked(e)?this.uncheck_node(e,n):this.check_node(e,n),void this.trigger("activate_node",{node:this.get_node(e)}))},this.check_node=function(e,t){if(this.settings.checkbox.tie_selection)return this.select_node(e,!1,!0,t);var n,i,r;if(A.isArray(e)){for(e=e.slice(),i=0,r=e.length;r>i;i++)this.check_node(e[i],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(n=this.get_node(e,!0),void(e.state.checked||(e.state.checked=!0,this._data.checkbox.selected.push(e.id),n&&n.length&&n.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:e,selected:this._data.checkbox.selected,event:t}))))},this.uncheck_node=function(e,t){if(this.settings.checkbox.tie_selection)return this.deselect_node(e,!1,t);var n,i,r;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.uncheck_node(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(r=this.get_node(e,!0),void(e.state.checked&&(e.state.checked=!1,this._data.checkbox.selected=A.vakata.array_remove_item(this._data.checkbox.selected,e.id),r.length&&r.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:e,selected:this._data.checkbox.selected,event:t}))))},this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var A,e;this._data.checkbox.selected.concat([]);for(this._data.checkbox.selected=this._model.data["#"].children_d.concat(),A=0,e=this._data.checkbox.selected.length;e>A;A++)this._model.data[this._data.checkbox.selected[A]]&&(this._model.data[this._data.checkbox.selected[A]].state.checked=!0);this.redraw(!0),this.trigger("check_all",{selected:this._data.checkbox.selected})},this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();var A,e,t=this._data.checkbox.selected.concat([]);for(A=0,e=this._data.checkbox.selected.length;e>A;A++)this._model.data[this._data.checkbox.selected[A]]&&(this._model.data[this._data.checkbox.selected[A]].state.checked=!1);this._data.checkbox.selected=[],this.element.find(".jstree-checked").removeClass("jstree-checked"),this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:t})},this.is_checked=function(A){return this.settings.checkbox.tie_selection?this.is_selected(A):!(!(A=this.get_node(A))||"#"===A.id)&&A.state.checked},this.get_checked=function(e){return this.settings.checkbox.tie_selection?this.get_selected(e):e?A.map(this._data.checkbox.selected,A.proxy(function(A){return this.get_node(A)},this)):this._data.checkbox.selected},this.get_top_checked=function(e){if(this.settings.checkbox.tie_selection)return this.get_top_selected(e);var t,n,i,r,o=this.get_checked(!0),s={};for(t=0,n=o.length;n>t;t++)s[o[t].id]=o[t];for(t=0,n=o.length;n>t;t++)for(i=0,r=o[t].children_d.length;r>i;i++)s[o[t].children_d[i]]&&delete s[o[t].children_d[i]];o=[];for(t in s)s.hasOwnProperty(t)&&o.push(t);return e?A.map(o,A.proxy(function(A){return this.get_node(A)},this)):o},this.get_bottom_checked=function(e){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(e);var t,n,i=this.get_checked(!0),r=[];for(t=0,n=i.length;n>t;t++)i[t].children.length||r.push(i[t].id);return e?A.map(r,A.proxy(function(A){return this.get_node(A)},this)):r},this.load_node=function(e,n){var i,r,o;if(!A.isArray(e)&&!this.settings.checkbox.tie_selection&&(o=this.get_node(e))&&o.state.loaded)for(i=0,r=o.children_d.length;r>i;i++)this._model.data[o.children_d[i]].state.checked&&(!0,this._data.checkbox.selected=A.vakata.array_remove_item(this._data.checkbox.selected,o.children_d[i]));return t.load_node.apply(this,arguments)},this.get_state=function(){var A=t.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?A:(A.checkbox=this._data.checkbox.selected.slice(),A)},this.set_state=function(e,n){var i=t.set_state.apply(this,arguments);if(i&&e.checkbox){if(!this.settings.checkbox.tie_selection){this.uncheck_all();var r=this;A.each(e.checkbox,function(A,e){r.check_node(e)})}return delete e.checkbox,!1}return i}};var h,B,d=null;A.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(e,t){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.create_node(n,{},"last",function(A){setTimeout(function(){t.edit(A)},0)})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.edit(n)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.delete_node(t.is_selected(n)?t.get_selected():n)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.cut(t.is_selected(n)?t.get_selected():n)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.copy(t.is_selected(n)?t.get_selected():n)}},paste:{separator_before:!1,icon:!1,_disabled:function(e){return!A.jstree.reference(e.reference).can_paste()},separator_after:!1,label:"Paste",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.paste(n)}}}}}}},A.jstree.plugins.contextmenu=function(t,n){this.bind=function(){n.bind.call(this);var e=0;this.element.on("contextmenu.jstree",".jstree-anchor",A.proxy(function(A,t){A.preventDefault(),e=A.ctrlKey?+new Date:0,(t||d)&&(e=+new Date+1e4),d&&clearTimeout(d),this.is_loading(A.currentTarget)||this.show_contextmenu(A.currentTarget,A.pageX,A.pageY,A)},this)).on("click.jstree",".jstree-anchor",A.proxy(function(t){this._data.contextmenu.visible&&(!e||+new Date-e>250)&&A.vakata.context.hide(),e=0},this)).on("touchstart.jstree",".jstree-anchor",function(e){e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(h=e.pageX,B=e.pageY,d=setTimeout(function(){A(e.currentTarget).trigger("contextmenu",!0)},750))}),A(document).on("context_hide.vakata.jstree",A.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&A.vakata.context.hide(),n.teardown.call(this)},this.show_contextmenu=function(t,n,i,r){if(!(t=this.get_node(t))||"#"===t.id)return!1;var o=this.settings.contextmenu,s=this.get_node(t,!0),a=s.children(".jstree-anchor"),l=!1,c=!1;(o.show_at_node||n===e||i===e)&&(l=a.offset(),n=l.left,i=l.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(t)&&this.activate_node(t,r),c=o.items,A.isFunction(c)&&(c=c.call(this,t,A.proxy(function(A){this._show_contextmenu(t,n,i,A)},this))),A.isPlainObject(c)&&this._show_contextmenu(t,n,i,c)},this._show_contextmenu=function(e,t,n,i){var r=this.get_node(e,!0),o=r.children(".jstree-anchor");A(document).one("context_show.vakata.jstree",A.proxy(function(e,t){var n="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";A(t.element).addClass(n)},this)),this._data.contextmenu.visible=!0,A.vakata.context.show(o,{x:t,y:n},i),this.trigger("show_contextmenu",{node:e,x:t,y:n})}},A(function(){A(document).on("touchmove.vakata.jstree",function(A){d&&A.originalEvent&&A.originalEvent.changedTouches&&A.originalEvent.changedTouches[0]&&(Math.abs(h-A.pageX)>50||Math.abs(B-A.pageY)>50)&&clearTimeout(d)}).on("touchend.vakata.jstree",function(A){d&&clearTimeout(d)})}),function(A){var e=!1,t={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};A.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(e){A(document).triggerHandler("context_"+e+".vakata",{reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}})},_execute:function(e){return!(!(e=t.items[e])||e._disabled&&(!A.isFunction(e._disabled)||e._disabled({item:e,reference:t.reference,element:t.element}))||!e.action)&&e.action.call(null,{item:e,reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}})},_parse:function(e,n){if(!e)return!1;n||(t.html="",t.items=[]);var i,r="",o=!1;return n&&(r+=""),n||(t.html=r,A.vakata.context._trigger("parse")),r.length>10&&r},_show_submenu:function(t){if(t=A(t),t.length&&t.children("ul").length){var n=t.children("ul"),i=t.offset().left+t.outerWidth(),r=t.offset().top,o=n.width(),s=n.height(),a=A(window).width()+A(window).scrollLeft(),l=A(window).height()+A(window).scrollTop();e?t[i-(o+10+t.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):t[i+o+10>a?"addClass":"removeClass"]("vakata-context-right"),r+s+10>l&&n.css("bottom","-1px"),n.show()}},show:function(n,i,r){var o,s,a,l,c,u,g,h;switch(t.element&&t.element.length&&t.element.width(""),!0){case!i&&!n:return!1;case!!i&&!!n:t.reference=n,t.position_x=i.x,t.position_y=i.y;break;case!i&&!!n:t.reference=n,o=n.offset(),t.position_x=o.left+n.outerHeight(),t.position_y=o.top;break;case!!i&&!n:t.position_x=i.x,t.position_y=i.y}n&&!r&&A(n).data("vakata_contextmenu")&&(r=A(n).data("vakata_contextmenu")),A.vakata.context._parse(r)&&t.element.html(t.html),t.items.length&&(t.element.appendTo("body"),s=t.element,a=t.position_x,l=t.position_y,c=s.width(),u=s.height(),g=A(window).width()+A(window).scrollLeft(),h=A(window).height()+A(window).scrollTop(),e&&(a-=s.outerWidth()-A(n).outerWidth())g&&(a=g-(c+20)),l+u+20>h&&(l=h-(u+20)),t.element.css({left:a,top:l}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),t.is_visible=!0,A.vakata.context._trigger("show"))},hide:function(){t.is_visible&&(t.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),t.is_visible=!1,A.vakata.context._trigger("hide"))}},A(function(){e="rtl"===A("body").css("direction");var n=!1;t.element=A("
    "),t.element.on("mouseenter","li",function(e){e.stopImmediatePropagation(),A.contains(this,e.relatedTarget)||(n&&clearTimeout(n),t.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),A(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),A.vakata.context._show_submenu(this))}).on("mouseleave","li",function(e){A.contains(this,e.relatedTarget)||A(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(e){A(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),A.vakata.context.settings.hide_onmouseleave&&(n=setTimeout(function(e){return function(){A.vakata.context.hide()}}(),A.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault(),A(this).blur().parent().hasClass("vakata-context-disabled")||!1===A.vakata.context._execute(A(this).attr("rel"))||A.vakata.context.hide()}).on("keydown","a",function(e){var n=null;switch(e.which){case 13:case 32:e.type="mouseup",e.preventDefault(),A(e.currentTarget).trigger(e);break;case 37:t.is_visible&&(t.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 38:t.is_visible&&(n=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),n.length||(n=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),n.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 39:t.is_visible&&(t.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 40:t.is_visible&&(n=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),n.length||(n=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),n.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 27:A.vakata.context.hide(),e.preventDefault()}}).on("keydown",function(A){A.preventDefault();var e=t.element.find(".vakata-contextmenu-shortcut-"+A.which).parent();e.parent().not(".vakata-context-disabled")&&e.click()}),A(document).on("mousedown.vakata.jstree",function(e){t.is_visible&&!A.contains(t.element[0],e.target)&&A.vakata.context.hide()}).on("context_show.vakata.jstree",function(A,n){t.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),e&&t.element.addClass("vakata-context-rtl").css("direction","rtl"),t.element.find("ul").hide().end()})})}(A),A.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0},A.jstree.plugins.dnd=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("mousedown.jstree touchstart.jstree",".jstree-anchor",A.proxy(function(e){if("touchstart"===e.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!A(e.currentTarget).hasClass("jstree-clicked")))return!0;var t=this.get_node(e.target),n=this.is_selected(t)&&this.settings.drag_selection?this.get_selected().length:1,i=n>1?n+" "+this.get_string("nodes"):this.get_text(e.currentTarget);return this.settings.core.force_text&&(i=A("
    ").text(i).html()),t&&t.id&&"#"!==t.id&&(1===e.which||"touchstart"===e.type)&&(!0===this.settings.dnd.is_draggable||A.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,n>1?this.get_selected(!0):[t]))?(this.element.trigger("mousedown.jstree"),A.vakata.dnd.start(e,{jstree:!0,origin:this,obj:this.get_node(t,!0),nodes:n>1?this.get_selected():[t.id]},'
    '+i+'
    ')):void 0},this))}},A(function(){var e=!1,t=!1,n=!1,i=A('
     
    ').hide();A(document).on("dnd_start.vakata.jstree",function(A,t){e=!1,t&&t.data&&t.data.jstree&&i.appendTo("body")}).on("dnd_move.vakata.jstree",function(r,o){if(n&&clearTimeout(n),o&&o.data&&o.data.jstree&&(!o.event.target.id||"jstree-marker"!==o.event.target.id)){var s,a,l,c,u,g,h,B,d,p,Q,E,f,C,w=A.jstree.reference(o.event.target),I=!1,m=!1,M=!1;if(w&&w._data&&w._data.dnd)if(i.attr("class","jstree-"+w.get_theme()+(w.settings.core.themes.responsive?" jstree-dnd-responsive":"")),o.helper.children().attr("class","jstree-"+w.get_theme()+" jstree-"+w.get_theme()+"-"+w.get_theme_variant()+" "+(w.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"show":"hide"](),o.event.target!==w.element[0]&&o.event.target!==w.get_container_ul()[0]||0!==w.get_container_ul().children().length){if((I=A(o.event.target).closest(".jstree-anchor"))&&I.length&&I.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(m=I.offset(),M=o.event.pageY-m.top,l=I.height(),g=l/3>M?["b","i","a"]:M>l-l/3?["a","i","b"]:M>l/2?["i","a","b"]:["i","b","a"],A.each(g,function(r,M){switch(M){case"b":s=m.left-6,a=m.top,c=w.get_parent(I),u=I.parent().index();break;case"i":f=w.settings.dnd.inside_pos,C=w.get_node(I.parent()),s=m.left-2,a=m.top+l/2+1,c=C.id,u="first"===f?0:"last"===f?C.children.length:Math.min(f,C.children.length);break;case"a":s=m.left-6,a=m.top+l,c=w.get_parent(I),u=I.parent().index()+1}for(h=!0,B=0,d=o.data.nodes.length;d>B;B++)if(p=o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",Q=u,"move_node"===p&&"a"===M&&o.data.origin&&o.data.origin===w&&c===w.get_parent(o.data.nodes[B])&&(E=w.get_node(c),Q>A.inArray(o.data.nodes[B],E.children)&&(Q-=1)),!(h=h&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(p,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[B]):o.data.nodes[B],c,Q,{dnd:!0,ref:w.get_node(I.parent()),pos:M,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(t=w.last_error());break}return"i"===M&&I.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(n=setTimeout(function(A,e){return function(){A.open_node(e)}}(w,I),w.settings.dnd.open_timeout)),h?(e={ins:w,par:c,pos:"i"!==M||"last"!==f||0!==u||w.is_loaded(C)?u:"last"},i.css({left:s+"px",top:a+"px"}).show(),o.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),t={},g=!0,!1):void 0}),!0===g))return}else{for(h=!0,B=0,d=o.data.nodes.length;d>B&&(h=h&&w.check(o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[B]):o.data.nodes[B],"#","last",{dnd:!0,ref:w.get_node("#"),pos:"i",is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin}));B++);if(h)return e={ins:w,par:"#",pos:"last"},i.hide(),void o.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok")}e=!1,o.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),i.hide()}}).on("dnd_scroll.vakata.jstree",function(A,t){t&&t.data&&t.data.jstree&&(i.hide(),e=!1,t.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(r,o){if(n&&clearTimeout(n),o&&o.data&&o.data.jstree){i.hide().detach();var s,a,l=[];if(e){for(s=0,a=o.data.nodes.length;a>s;s++)l[s]=o.data.origin?o.data.origin.get_node(o.data.nodes[s]):o.data.nodes[s],o.data.origin&&(l[s].instance=o.data.origin);for(e.ins[o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node"](l,e.par,e.pos),s=0,a=l.length;a>s;s++)l[s].instance&&(l[s].instance=null)}else s=A(o.event.target).closest(".jstree"),s.length&&t&&t.error&&"check"===t.error&&(s=s.jstree(!0))&&s.settings.core.error.call(this,t)}}).on("keyup.jstree keydown.jstree",function(e,t){(t=A.vakata.dnd._get())&&t.data&&t.data.jstree&&t.helper.find(".jstree-copy").first()[t.data.origin&&(t.data.origin.settings.dnd.always_copy||t.data.origin.settings.dnd.copy&&(e.metaKey||e.ctrlKey))?"show":"hide"]()})}),function(A){var e={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};A.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(e,t){var n=A.vakata.dnd._get();n.event=t,A(document).triggerHandler("dnd_"+e+".vakata",n)},_get:function(){return{data:e.data,element:e.element,helper:e.helper}},_clean:function(){e.helper&&e.helper.remove(),e.scroll_i&&(clearInterval(e.scroll_i),e.scroll_i=!1),e={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},A(document).off("mousemove.vakata.jstree touchmove.vakata.jstree",A.vakata.dnd.drag),A(document).off("mouseup.vakata.jstree touchend.vakata.jstree",A.vakata.dnd.stop)},_scroll:function(t){if(!e.scroll_e||!e.scroll_l&&!e.scroll_t)return e.scroll_i&&(clearInterval(e.scroll_i),e.scroll_i=!1),!1;if(!e.scroll_i)return e.scroll_i=setInterval(A.vakata.dnd._scroll,100),!1;if(!0===t)return!1;var n=e.scroll_e.scrollTop(),i=e.scroll_e.scrollLeft();e.scroll_e.scrollTop(n+e.scroll_t*A.vakata.dnd.settings.scroll_speed),e.scroll_e.scrollLeft(i+e.scroll_l*A.vakata.dnd.settings.scroll_speed),(n!==e.scroll_e.scrollTop()||i!==e.scroll_e.scrollLeft())&&A.vakata.dnd._trigger("scroll",e.scroll_e)},start:function(t,n,i){"touchstart"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_drag&&A.vakata.dnd.stop({});try{t.currentTarget.unselectable="on",t.currentTarget.onselectstart=function(){return!1},t.currentTarget.style&&(t.currentTarget.style.MozUserSelect="none")}catch(A){}return e.init_x=t.pageX,e.init_y=t.pageY,e.data=n,e.is_down=!0,e.element=t.currentTarget,e.target=t.target,e.is_touch="touchstart"===t.type,!1!==i&&(e.helper=A("
    ").html(i).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),A(document).on("mousemove.vakata.jstree touchmove.vakata.jstree",A.vakata.dnd.drag),A(document).on("mouseup.vakata.jstree touchend.vakata.jstree",A.vakata.dnd.stop),!1},drag:function(t){if("touchmove"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_down){if(!e.is_drag){if(!(Math.abs(t.pageX-e.init_x)>(e.is_touch?A.vakata.dnd.settings.threshold_touch:A.vakata.dnd.settings.threshold)||Math.abs(t.pageY-e.init_y)>(e.is_touch?A.vakata.dnd.settings.threshold_touch:A.vakata.dnd.settings.threshold)))return;e.helper&&(e.helper.appendTo("body"),e.helper_w=e.helper.outerWidth()),e.is_drag=!0,A.vakata.dnd._trigger("start",t)}var n=!1,i=!1,r=!1,o=!1,s=!1,a=!1,l=!1,c=!1,u=!1,g=!1;return e.scroll_t=0,e.scroll_l=0,e.scroll_e=!1,A(A(t.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(A(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var n=A(this),i=n.offset();return this.scrollHeight>this.offsetHeight&&(i.top+n.height()-t.pageYthis.offsetWidth&&(i.left+n.width()-t.pageXo&&t.pageY-lo&&o-(t.pageY-l)a&&t.pageX-ca&&a-(t.pageX-c)r&&(u=r-50),s&&g+e.helper_w>s&&(g=s-(e.helper_w+2)),e.helper.css({left:g+"px",top:u+"px"})),A.vakata.dnd._trigger("move",t),!1}},stop:function(t){if("touchend"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_drag)A.vakata.dnd._trigger("stop",t);else if("touchend"===t.type&&t.target===e.target){var n=setTimeout(function(){A(t.target).click()},100);A(t.target).one("click",function(){n&&clearTimeout(n)})}return A.vakata.dnd._clean(),!1}}}(A),A.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},A.jstree.plugins.search=function(t,n){this.bind=function(){n.bind.call(this),this._data.search.str="",this._data.search.dom=A(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this.element.on("before_open.jstree",A.proxy(function(e,t){var n,i,r=this._data.search.res,o=[],s=A();if(r&&r.length&&(this._data.search.dom=A(this.element[0].querySelectorAll("#"+A.map(r,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(A.jstree.idregex,"\\$&"):e.replace(A.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this._data.search.som&&this._data.search.res.length)){for(n=0,i=r.length;i>n;n++)o=o.concat(this.get_node(r[n]).parents);o=A.vakata.array_remove_item(A.vakata.array_unique(o),"#"),s=o.length?A(this.element[0].querySelectorAll("#"+A.map(o,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(A.jstree.idregex,"\\$&"):e.replace(A.jstree.idregex,"\\$&")}).join(", #"))):A(),this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),s=s.add(this._data.search.dom),s.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){A(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")})}},this)).on("search.jstree",A.proxy(function(e,t){this._data.search.som&&t.nodes.length&&(this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),t.nodes.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){A(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")}))},this)).on("clear_search.jstree",A.proxy(function(A,e){this._data.search.som&&e.nodes.length&&this.element.find(".jstree-node").css("display","").filter(".jstree-last").filter(function(){ -return this.nextSibling}).removeClass("jstree-last")},this))},this.search=function(t,n,i){if(!1===t||""===A.trim(t.toString()))return this.clear_search();t=t.toString();var r=this.settings.search,o=!!r.ajax&&r.ajax,s=null,a=[],l=[];return this._data.search.res.length&&this.clear_search(),i===e&&(i=r.show_only_matches),n||!1===o?(this._data.search.str=t,this._data.search.dom=A(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=i,s=new A.vakata.search(t,!0,{caseSensitive:r.case_sensitive,fuzzy:r.fuzzy}),A.each(this._model.data,function(A,e){e.text&&(r.search_callback&&r.search_callback.call(this,t,e)||!r.search_callback&&s.search(e.text).isMatch)&&(!r.search_leaves_only||e.state.loaded&&0===e.children.length)&&(a.push(A),l=l.concat(e.parents))}),a.length&&(l=A.vakata.array_unique(l),this._search_open(l),this._data.search.dom=A(this.element[0].querySelectorAll("#"+A.map(a,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(A.jstree.idregex,"\\$&"):e.replace(A.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=a,this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")),void this.trigger("search",{nodes:this._data.search.dom,str:t,res:this._data.search.res,show_only_matches:i})):A.isFunction(o)?o.call(this,t,A.proxy(function(e){e&&e.d&&(e=e.d),this._load_nodes(A.isArray(e)?A.vakata.array_unique(e):[],function(){this.search(t,!0,i)},!0)},this)):(o=A.extend({},o),o.data||(o.data={}),o.data.str=t,A.ajax(o).fail(A.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(o)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(A.proxy(function(e){e&&e.d&&(e=e.d),this._load_nodes(A.isArray(e)?A.vakata.array_unique(e):[],function(){this.search(t,!0,i)},!0)},this)))},this.clear_search=function(){this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"),this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=A()},this._search_open=function(e){var t=this;A.each(e.concat([]),function(n,i){if("#"===i)return!0;try{i=A("#"+i.replace(A.jstree.idregex,"\\$&"),t.element)}catch(A){}i&&i.length&&t.is_closed(i)&&(t._data.search.opn.push(i[0].id),t.open_node(i,function(){t._search_open(e)},0))})}},function(A){A.vakata.search=function(A,e,t){t=t||{},!1!==t.fuzzy&&(t.fuzzy=!0),A=t.caseSensitive?A:A.toLowerCase();var n,i,r,o,s=t.location||0,a=t.distance||100,l=t.threshold||.6,c=A.length;return c>32&&(t.fuzzy=!1),t.fuzzy&&(n=1<t;t++)e[A.charAt(t)]=0;for(t=0;c>t;t++)e[A.charAt(t)]|=1<o;o++){for(u=0,g=w;g>u;)r(o,s+g)<=f?u=g:w=g,g=Math.floor((w-u)/2+u);for(w=g,B=Math.max(1,s-g+1),d=Math.min(s+g,E)+c,p=new Array(d+2),p[d+1]=(1<=B;a--)if(Q=i[e.charAt(a-1)],p[a]=0===o?(p[a+1]<<1|1)&Q:(p[a+1]<<1|1)&Q|(h[a+1]|h[a])<<1|1|h[a+1],p[a]&n&&(I=r(o,a-1),f>=I)){if(f=I,C=a-1,m.push(C),!(C>s))break;B=Math.max(1,2*s-C)}if(r(o+1,s)>f)break;h=p}return{isMatch:C>=0,score:I}},!0===e?{search:o}:o(e)}}(A),A.jstree.defaults.sort=function(A,e){return this.get_text(A)>this.get_text(e)?1:-1},A.jstree.plugins.sort=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("model.jstree",A.proxy(function(A,e){this.sort(e.parent,!0)},this)).on("rename_node.jstree create_node.jstree",A.proxy(function(A,e){this.sort(e.parent||e.node.parent,!1),this.redraw_node(e.parent||e.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",A.proxy(function(A,e){this.sort(e.parent,!1),this.redraw_node(e.parent,!0)},this))},this.sort=function(e,t){var n,i;if((e=this.get_node(e))&&e.children&&e.children.length&&(e.children.sort(A.proxy(this.settings.sort,this)),t))for(n=0,i=e.children_d.length;i>n;n++)this.sort(e.children_d[n],!1)}};var p=!1;A.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1},A.jstree.plugins.state=function(e,t){this.bind=function(){t.bind.call(this);var e=A.proxy(function(){this.element.on(this.settings.state.events,A.proxy(function(){p&&clearTimeout(p),p=setTimeout(A.proxy(function(){this.save_state()},this),100)},this)),this.trigger("state_ready")},this);this.element.on("ready.jstree",A.proxy(function(A,t){this.element.one("restore_state.jstree",e),this.restore_state()||e()},this))},this.save_state=function(){var e={state:this.get_state(),ttl:this.settings.state.ttl,sec:+new Date};A.vakata.storage.set(this.settings.state.key,JSON.stringify(e))},this.restore_state=function(){var e=A.vakata.storage.get(this.settings.state.key);if(e)try{e=JSON.parse(e)}catch(A){return!1}return!(e&&e.ttl&&e.sec&&+new Date-e.sec>e.ttl)&&(e&&e.state&&(e=e.state),e&&A.isFunction(this.settings.state.filter)&&(e=this.settings.state.filter.call(this,e)),!!e&&(this.element.one("set_state.jstree",function(t,n){n.instance.trigger("restore_state",{state:A.extend(!0,{},e)})}),this.set_state(e),!0))},this.clear_state=function(){return A.vakata.storage.del(this.settings.state.key)}},function(A,e){A.vakata.storage={set:function(A,e){return window.localStorage.setItem(A,e)},get:function(A){return window.localStorage.getItem(A)},del:function(A){return window.localStorage.removeItem(A)}}}(A),A.jstree.defaults.types={"#":{},default:{}},A.jstree.plugins.types=function(t,n){this.init=function(A,t){var i,r;if(t&&t.types&&t.types.default)for(i in t.types)if("default"!==i&&"#"!==i&&t.types.hasOwnProperty(i))for(r in t.types.default)t.types.default.hasOwnProperty(r)&&t.types[i][r]===e&&(t.types[i][r]=t.types.default[r]);n.init.call(this,A,t),this._model.data["#"].type="#"},this.refresh=function(A,e){n.refresh.call(this,A,e),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",A.proxy(function(A,t){var n,i,r=this._model.data,o=t.nodes,s=this.settings.types,a="default";for(n=0,i=o.length;i>n;n++)a="default",r[o[n]].original&&r[o[n]].original.type&&s[r[o[n]].original.type]&&(a=r[o[n]].original.type),r[o[n]].data&&r[o[n]].data.jstree&&r[o[n]].data.jstree.type&&s[r[o[n]].data.jstree.type]&&(a=r[o[n]].data.jstree.type),r[o[n]].type=a,!0===r[o[n]].icon&&s[a].icon!==e&&(r[o[n]].icon=s[a].icon);r["#"].type="#"},this)),n.bind.call(this)},this.get_json=function(e,t,i){var r,o,s=this._model.data,a=t?A.extend(!0,{},t,{no_id:!1}):{},l=n.get_json.call(this,e,a,i);if(!1===l)return!1;if(A.isArray(l))for(r=0,o=l.length;o>r;r++)l[r].type=l[r].id&&s[l[r].id]&&s[l[r].id].type?s[l[r].id].type:"default",t&&t.no_id&&(delete l[r].id,l[r].li_attr&&l[r].li_attr.id&&delete l[r].li_attr.id,l[r].a_attr&&l[r].a_attr.id&&delete l[r].a_attr.id);else l.type=l.id&&s[l.id]&&s[l.id].type?s[l.id].type:"default",t&&t.no_id&&(l=this._delete_ids(l));return l},this._delete_ids=function(e){if(A.isArray(e)){for(var t=0,n=e.length;n>t;t++)e[t]=this._delete_ids(e[t]);return e}return delete e.id,e.li_attr&&e.li_attr.id&&delete e.li_attr.id,e.a_attr&&e.a_attr.id&&delete e.a_attr.id,e.children&&A.isArray(e.children)&&(e.children=this._delete_ids(e.children)),e},this.check=function(t,i,r,o,s){if(!1===n.check.call(this,t,i,r,o,s))return!1;i=i&&i.id?i:this.get_node(i),r=r&&r.id?r:this.get_node(r);var a,l,c,u,g=i&&i.id?A.jstree.reference(i.id):null;switch(g=g&&g._model&&g._model.data?g._model.data:null,t){case"create_node":case"move_node":case"copy_node":if("move_node"!==t||-1===A.inArray(i.id,r.children)){if(a=this.get_rules(r),a.max_children!==e&&-1!==a.max_children&&a.max_children===r.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+t,data:JSON.stringify({chk:t,pos:o,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})},!1;if(a.valid_children!==e&&-1!==a.valid_children&&-1===A.inArray(i.type||"default",a.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+t,data:JSON.stringify({chk:t,pos:o,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})},!1;if(g&&i.children_d&&i.parents){for(l=0,c=0,u=i.children_d.length;u>c;c++)l=Math.max(l,g[i.children_d[c]].parents.length);l=l-i.parents.length+1}(0>=l||l===e)&&(l=1);do{if(a.max_depth!==e&&-1!==a.max_depth&&a.max_depthr;r++)this.set_type(t[r],n);return!0}return i=this.settings.types,t=this.get_node(t),!(!i[n]||!t)&&(s=t.type,a=this.get_icon(t),t.type=n,(!0===a||i[s]&&i[s].icon!==e&&a===i[s].icon)&&this.set_icon(t,i[n].icon===e||i[n].icon),!0)}},A.jstree.defaults.unique={case_sensitive:!1,duplicate:function(A,e){return A+" ("+e+")"}},A.jstree.plugins.unique=function(t,n){this.check=function(e,t,i,r,o){if(!1===n.check.call(this,e,t,i,r,o))return!1;if(t=t&&t.id?t:this.get_node(t),!(i=i&&i.id?i:this.get_node(i))||!i.children)return!0;var s,a,l="rename_node"===e?r:t.text,c=[],u=this.settings.unique.case_sensitive,g=this._model.data;for(s=0,a=i.children.length;a>s;s++)c.push(u?g[i.children[s]].text:g[i.children[s]].text.toLowerCase());switch(u||(l=l.toLowerCase()),e){case"delete_node":return!0;case"rename_node":return s=-1===A.inArray(l,c)||t.text&&t.text[u?"toString":"toLowerCase"]()===l,s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+l+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s;case"create_node":return s=-1===A.inArray(l,c),s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+l+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s;case"copy_node":return s=-1===A.inArray(l,c),s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+l+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s;case"move_node":return s=t.parent===i.id||-1===A.inArray(l,c),s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+l+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s}return!0},this.create_node=function(t,i,r,o,s){if(!i||i.text===e){if(null===t&&(t="#"),!(t=this.get_node(t)))return n.create_node.call(this,t,i,r,o,s);if(r=r===e?"last":r,!r.toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(t))return n.create_node.call(this,t,i,r,o,s);i||(i={});var a,l,c,u,g,h=this._model.data,B=this.settings.unique.case_sensitive,d=this.settings.unique.duplicate;for(l=a=this.get_string("New node"),c=[],u=0,g=t.children.length;g>u;u++)c.push(B?h[t.children[u]].text:h[t.children[u]].text.toLowerCase());for(u=1;-1!==A.inArray(B?l:l.toLowerCase(),c);)l=d.call(this,a,++u).toString();i.text=l}return n.create_node.call(this,t,i,r,o,s)}};var Q=document.createElement("DIV");Q.setAttribute("unselectable","on"),Q.setAttribute("role","presentation"),Q.className="jstree-wholerow",Q.innerHTML=" ",A.jstree.plugins.wholerow=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("ready.jstree set_state.jstree",A.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",A.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",A.proxy(function(A,e){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",A.proxy(function(A,e){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var t,n,i=!1;for(t=0,n=e.selected.length;n>t;t++)(i=this.get_node(e.selected[t],!0))&&i.length&&i.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",A.proxy(function(A,e){this.get_node(e.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",A.proxy(function(A,e){"hover_node"===A.type&&this.is_disabled(e.node)||this.get_node(e.node,!0).children(".jstree-wholerow")["hover_node"===A.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",A.proxy(function(e){e.preventDefault();var t=A.Event("contextmenu",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,pageX:e.pageX,pageY:e.pageY});A(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t)},this)).on("click.jstree",".jstree-wholerow",function(e){e.stopImmediatePropagation();var t=A.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});A(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",A.proxy(function(e){e.stopImmediatePropagation();var t=A.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});A(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",A.proxy(function(A){return A.stopImmediatePropagation(),this.is_disabled(A.currentTarget)||this.hover_node(A.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",A.proxy(function(A){this.dehover_node(A.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),t.teardown.call(this)},this.redraw_node=function(e,n,i,r){if(e=t.redraw_node.apply(this,arguments)){var o=Q.cloneNode(!0);-1!==A.inArray(e.id,this._data.core.selected)&&(o.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===e.id&&(o.className+=" jstree-wholerow-hovered"),e.insertBefore(o,e.childNodes[0])}return e}},function(A){if(document.registerElement&&Object&&Object.create){var e=Object.create(HTMLElement.prototype);e.createdCallback=function(){var e,t={core:{},plugins:[]};for(e in A.jstree.plugins)A.jstree.plugins.hasOwnProperty(e)&&this.attributes[e]&&(t.plugins.push(e),this.getAttribute(e)&&JSON.parse(this.getAttribute(e))&&(t[e]=JSON.parse(this.getAttribute(e))));for(e in A.jstree.defaults.core)A.jstree.defaults.core.hasOwnProperty(e)&&this.attributes[e]&&(t.core[e]=JSON.parse(this.getAttribute(e))||this.getAttribute(e));jQuery(this).jstree(t)};try{document.registerElement("vakata-jstree",{prototype:e})}catch(A){}}}(jQuery)}}),function(A){"function"==typeof define&&define.amd?define("cookie",["jquery"],A):A("object"==typeof exports?require("jquery"):jQuery)}(function(A){function e(A){return s.raw?A:encodeURIComponent(A)}function t(A){return s.raw?A:decodeURIComponent(A)}function n(A){return e(s.json?JSON.stringify(A):String(A))}function i(A){0===A.indexOf('"')&&(A=A.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return A=decodeURIComponent(A.replace(o," ")),s.json?JSON.parse(A):A}catch(A){}}function r(e,t){var n=s.raw?e:i(e);return A.isFunction(t)?t(n):n}var o=/\+/g,s=A.cookie=function(i,o,a){if(void 0!==o&&!A.isFunction(o)){if(a=A.extend({},s.defaults,a),"number"==typeof a.expires){var l=a.expires,c=a.expires=new Date;c.setTime(+c+864e5*l)}return document.cookie=[e(i),"=",n(o),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}for(var u=i?void 0:{},g=document.cookie?document.cookie.split("; "):[],h=0,B=g.length;h=0)&&t(e,!i)}}),A("").outerWidth(1).jquery||A.each(["Width","Height"],function(t,n){function i(e,t,n,i){return A.each(r,function(){t-=parseFloat(A.css(e,"padding"+this))||0,n&&(t-=parseFloat(A.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(A.css(e,"margin"+this))||0)}),t}var r="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),s={innerWidth:A.fn.innerWidth,innerHeight:A.fn.innerHeight,outerWidth:A.fn.outerWidth,outerHeight:A.fn.outerHeight};A.fn["inner"+n]=function(t){return t===e?s["inner"+n].call(this):this.each(function(){A(this).css(o,i(this,t)+"px")})},A.fn["outer"+n]=function(e,t){return"number"!=typeof e?s["outer"+n].call(this,e):this.each(function(){A(this).css(o,i(this,e,!0,t)+"px")})}}),A.fn.addBack||(A.fn.addBack=function(A){return this.add(null==A?this.prevObject:this.prevObject.filter(A))}),A("").data("a-b","a").removeData("a-b").data("a-b")&&(A.fn.removeData=function(e){return function(t){return arguments.length?e.call(this,A.camelCase(t)):e.call(this)}}(A.fn.removeData)),A.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),A.support.selectstart="onselectstart"in document.createElement("div"),A.fn.extend({disableSelection:function(){return this.bind((A.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(A){A.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),A.extend(A.ui,{plugin:{add:function(e,t,n){var i,r=A.ui[e].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([t,n[i]])},call:function(A,e,t){var n,i=A.plugins[e];if(i&&A.element[0].parentNode&&11!==A.element[0].parentNode.nodeType)for(n=0;i.length>n;n++)A.options[i[n][0]]&&i[n][1].apply(A.element,t)}},hasScroll:function(e,t){if("hidden"===A(e).css("overflow"))return!1;var n=t&&"left"===t?"scrollLeft":"scrollTop",i=!1;return e[n]>0||(e[n]=1,i=e[n]>0,e[n]=0,i)}})}(A),function(A,e){var t=0,n=Array.prototype.slice,i=A.cleanData;A.cleanData=function(e){for(var t,n=0;null!=(t=e[n]);n++)try{A(t).triggerHandler("remove")}catch(A){}i(e)},A.widget=function(t,n,i){var r,o,s,a,l={},c=t.split(".")[0];t=t.split(".")[1],r=c+"-"+t,i||(i=n,n=A.Widget),A.expr[":"][r.toLowerCase()]=function(e){return!!A.data(e,r)},A[c]=A[c]||{},o=A[c][t],s=A[c][t]=function(A,t){return this._createWidget?(arguments.length&&this._createWidget(A,t),e):new s(A,t)},A.extend(s,o,{version:i.version,_proto:A.extend({},i),_childConstructors:[]}),a=new n,a.options=A.widget.extend({},a.options),A.each(i,function(t,i){return A.isFunction(i)?(l[t]=function(){var A=function(){return n.prototype[t].apply(this,arguments)},e=function(A){return n.prototype[t].apply(this,A)};return function(){var t,n=this._super,r=this._superApply;return this._super=A,this._superApply=e,t=i.apply(this,arguments),this._super=n,this._superApply=r,t}}(),e):(l[t]=i,e)}),s.prototype=A.widget.extend(a,{widgetEventPrefix:o?a.widgetEventPrefix:t},l,{constructor:s,namespace:c,widgetName:t,widgetFullName:r}),o?(A.each(o._childConstructors,function(e,t){var n=t.prototype;A.widget(n.namespace+"."+n.widgetName,s,t._proto)}),delete o._childConstructors):n._childConstructors.push(s),A.widget.bridge(t,s)},A.widget.extend=function(t){for(var i,r,o=n.call(arguments,1),s=0,a=o.length;a>s;s++)for(i in o[s])r=o[s][i],o[s].hasOwnProperty(i)&&r!==e&&(t[i]=A.isPlainObject(r)?A.isPlainObject(t[i])?A.widget.extend({},t[i],r):A.widget.extend({},r):r);return t},A.widget.bridge=function(t,i){var r=i.prototype.widgetFullName||t;A.fn[t]=function(o){var s="string"==typeof o,a=n.call(arguments,1),l=this;return o=!s&&a.length?A.widget.extend.apply(null,[o].concat(a)):o,s?this.each(function(){var n,i=A.data(this,r);return i?A.isFunction(i[o])&&"_"!==o.charAt(0)?(n=i[o].apply(i,a),n!==i&&n!==e?(l=n&&n.jquery?l.pushStack(n.get()):n,!1):e):A.error("no such method '"+o+"' for "+t+" widget instance"):A.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")}):this.each(function(){var e=A.data(this,r);e?e.option(o||{})._init():A.data(this,r,new i(o,this))}),l}},A.Widget=function(){},A.Widget._childConstructors=[],A.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
    ",options:{disabled:!1,create:null},_createWidget:function(e,n){n=A(n||this.defaultElement||this)[0],this.element=A(n),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=A.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=A(),this.hoverable=A(),this.focusable=A(),n!==this&&(A.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(A){A.target===n&&this.destroy()}}),this.document=A(n.style?n.ownerDocument:n.document||n),this.window=A(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:A.noop,_getCreateEventData:A.noop,_create:A.noop,_init:A.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(A.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:A.noop,widget:function(){return this.element},option:function(t,n){var i,r,o,s=t;if(0===arguments.length)return A.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(r=s[t]=A.widget.extend({},this.options[t]),o=0;i.length-1>o;o++)r[i[o]]=r[i[o]]||{},r=r[i[o]];if(t=i.pop(),n===e)return r[t]===e?null:r[t];r[t]=n}else{if(n===e)return this.options[t]===e?null:this.options[t];s[t]=n}return this._setOptions(s),this},_setOptions:function(A){var e;for(e in A)this._setOption(e,A[e]);return this},_setOption:function(A,e){return this.options[A]=e,"disabled"===A&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,i){var r,o=this;"boolean"!=typeof t&&(i=n,n=t,t=!1),i?(n=r=A(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,r=this.widget()),A.each(i,function(i,s){function a(){return t||!0!==o.options.disabled&&!A(this).hasClass("ui-state-disabled")?("string"==typeof s?o[s]:s).apply(o,arguments):e}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||A.guid++);var l=i.match(/^(\w+)\s*(.*)$/),c=l[1]+o.eventNamespace,u=l[2];u?r.delegate(u,c,a):n.bind(c,a)})},_off:function(A,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,A.unbind(e).undelegate(e)},_delay:function(A,e){function t(){return("string"==typeof A?n[A]:A).apply(n,arguments)}var n=this;return setTimeout(t,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){A(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){A(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){A(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){A(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,t,n){var i,r,o=this.options[e];if(n=n||{},t=A.Event(t),t.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),t.target=this.element[0],r=t.originalEvent)for(i in r)i in t||(t[i]=r[i]);return this.element.trigger(t,n),!(A.isFunction(o)&&!1===o.apply(this.element[0],[t].concat(n))||t.isDefaultPrevented())}},A.each({show:"fadeIn",hide:"fadeOut"},function(e,t){A.Widget.prototype["_"+e]=function(n,i,r){"string"==typeof i&&(i={effect:i});var o,s=i?!0===i||"number"==typeof i?t:i.effect||t:e;i=i||{},"number"==typeof i&&(i={duration:i}),o=!A.isEmptyObject(i),i.complete=r,i.delay&&n.delay(i.delay),o&&A.effects&&A.effects.effect[s]?n[e](i):s!==e&&n[s]?n[s](i.duration,i.easing,r):n.queue(function(t){A(this)[e](),r&&r.call(n[0]),t()})}})}(A),function(A){var e=!1;A(document).mouseup(function(){e=!1}),A.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(A){return e._mouseDown(A)}).bind("click."+this.widgetName,function(t){return!0===A.data(t.target,e.widgetName+".preventClickEvent")?(A.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&A(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!e){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,i=1===t.which,r=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&A(t.target).closest(this.options.cancel).length;return!(i&&!r&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===A.data(t.target,this.widgetName+".preventClickEvent")&&A.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(A){return n._mouseMove(A)},this._mouseUpDelegate=function(A){return n._mouseUp(A)},A(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),e=!0,!0))}},_mouseMove:function(e){return A.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return A(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&A.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(A){return Math.max(Math.abs(this._mouseDownEvent.pageX-A.pageX),Math.abs(this._mouseDownEvent.pageY-A.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(A),function(A,e){function t(A,e,t){return[parseFloat(A[0])*(h.test(A[0])?e/100:1),parseFloat(A[1])*(h.test(A[1])?t/100:1)]}function n(e,t){return parseInt(A.css(e,t),10)||0}function i(e){var t=e[0];return 9===t.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:A.isWindow(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}A.ui=A.ui||{};var r,o=Math.max,s=Math.abs,a=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,g=/^\w+/,h=/%$/,B=A.fn.position;A.position={scrollbarWidth:function(){if(void 0!==r)return r;var e,t,n=A("
    "),i=n.children()[0];return A("body").append(n),e=i.offsetWidth,n.css("overflow","scroll"),t=i.offsetWidth,e===t&&(t=n[0].clientWidth),n.remove(),r=e-t},getScrollInfo:function(e){var t=e.isWindow?"":e.element.css("overflow-x"),n=e.isWindow?"":e.element.css("overflow-y"),i="scroll"===t||"auto"===t&&e.widthn?"left":t>0?"right":"center",vertical:0>r?"top":i>0?"bottom":"middle"};u>h&&h>s(t+n)&&(a.horizontal="center"),g>d&&d>s(i+r)&&(a.vertical="middle"),a.important=o(s(t),s(n))>o(s(i),s(r))?"horizontal":"vertical",e.using.call(this,A,a)}),c.offset(A.extend(v,{using:l}))})},A.ui.position={fit:{left:function(A,e){var t,n=e.within,i=n.isWindow?n.scrollLeft:n.offset.left,r=n.width,s=A.left-e.collisionPosition.marginLeft,a=i-s,l=s+e.collisionWidth-r-i;e.collisionWidth>r?a>0&&0>=l?(t=A.left+a+e.collisionWidth-r-i,A.left+=a-t):A.left=l>0&&0>=a?i:a>l?i+r-e.collisionWidth:i:a>0?A.left+=a:l>0?A.left-=l:A.left=o(A.left-s,A.left)},top:function(A,e){var t,n=e.within,i=n.isWindow?n.scrollTop:n.offset.top,r=e.within.height,s=A.top-e.collisionPosition.marginTop,a=i-s,l=s+e.collisionHeight-r-i;e.collisionHeight>r?a>0&&0>=l?(t=A.top+a+e.collisionHeight-r-i,A.top+=a-t):A.top=l>0&&0>=a?i:a>l?i+r-e.collisionHeight:i:a>0?A.top+=a:l>0?A.top-=l:A.top=o(A.top-s,A.top)}},flip:{left:function(A,e){var t,n,i=e.within,r=i.offset.left+i.scrollLeft,o=i.width,a=i.isWindow?i.scrollLeft:i.offset.left,l=A.left-e.collisionPosition.marginLeft,c=l-a,u=l+e.collisionWidth-o-a,g="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,h="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,B=-2*e.offset[0];0>c?(0>(t=A.left+g+h+B+e.collisionWidth-o-r)||s(c)>t)&&(A.left+=g+h+B):u>0&&((n=A.left-e.collisionPosition.marginLeft+g+h+B-a)>0||u>s(n))&&(A.left+=g+h+B)},top:function(A,e){var t,n,i=e.within,r=i.offset.top+i.scrollTop,o=i.height,a=i.isWindow?i.scrollTop:i.offset.top,l=A.top-e.collisionPosition.marginTop,c=l-a,u=l+e.collisionHeight-o-a,g="top"===e.my[1],h=g?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,B="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,d=-2*e.offset[1];0>c?(n=A.top+h+B+d+e.collisionHeight-o-r,A.top+h+B+d>c&&(0>n||s(c)>n)&&(A.top+=h+B+d)):u>0&&(t=A.top-e.collisionPosition.marginTop+h+B+d-a,A.top+h+B+d>u&&(t>0||u>s(t))&&(A.top+=h+B+d))}},flipfit:{left:function(){A.ui.position.flip.left.apply(this,arguments),A.ui.position.fit.left.apply(this,arguments)},top:function(){A.ui.position.flip.top.apply(this,arguments),A.ui.position.fit.top.apply(this,arguments)}}},function(){var e,t,n,i,r,o=document.getElementsByTagName("body")[0],s=document.createElement("div");e=document.createElement(o?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&A.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"});for(r in n)e.style[r]=n[r];e.appendChild(s),t=o||document.documentElement,t.insertBefore(e,t.firstChild),s.style.cssText="position: absolute; left: 10.7432222px;",i=A(s).offset().left,A.support.offsetFractions=i>10&&11>i,e.innerHTML="",t.removeChild(e)}()}(A),function(A){A.widget("ui.draggable",A.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var t=this.options;return!(this.helper||t.disabled||A(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(A(!0===t.iframeFix?"iframe":t.iframeFix).each(function(){A("
    ").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(A(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var t=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),A.ui.ddmanager&&(A.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,A.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,t.cursorAt&&this._adjustOffsetFromHelper(t.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),A.ui.ddmanager&&!t.dropBehaviour&&A.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),A.ui.ddmanager&&A.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,t){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!t){var n=this._uiHash();if(!1===this._trigger("drag",e,n))return this._mouseUp({}),!1;this.position=n.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),A.ui.ddmanager&&A.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var t=this,n=!1;return A.ui.ddmanager&&!this.options.dropBehaviour&&(n=A.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1),!("original"===this.options.helper&&!A.contains(this.element[0].ownerDocument,this.element[0]))&&("invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||A.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==t._trigger("stop",e)&&t._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1)},_mouseUp:function(e){return A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),A.ui.ddmanager&&A.ui.ddmanager.dragStop(this,e),A.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!A(e.target).closest(this.element.find(this.options.handle)).length},_createHelper:function(e){var t=this.options,n=A.isFunction(t.helper)?A(t.helper.apply(this.element[0],[e])):"clone"===t.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===t.appendTo?this.element[0].parentNode:t.appendTo),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),A.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&A.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var A=this.element.position();return{top:A.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:A.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,n,i=this.options;return i.containment?"window"===i.containment?void(this.containment=[A(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,A(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,A(window).scrollLeft()+A(window).width()-this.helperProportions.width-this.margins.left,A(window).scrollTop()+(A(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===i.containment?void(this.containment=[0,0,A(document).width()-this.helperProportions.width-this.margins.left,(A(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):i.containment.constructor===Array?void(this.containment=i.containment):("parent"===i.containment&&(i.containment=this.helper[0].parentNode),t=A(i.containment),void((n=t[0])&&(e="hidden"!==t.css("overflow"),this.containment=[(parseInt(t.css("borderLeftWidth"),10)||0)+(parseInt(t.css("paddingLeft"),10)||0),(parseInt(t.css("borderTopWidth"),10)||0)+(parseInt(t.css("paddingTop"),10)||0),(e?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(t.css("borderRightWidth"),10)||0)-(parseInt(t.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(t.css("borderBottomWidth"),10)||0)-(parseInt(t.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=t))):void(this.containment=null)},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:i.scrollTop(),left:i.scrollLeft()}),{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*n}},_generatePosition:function(e){var t,n,i,r,o=this.options,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=e.pageX,l=e.pageY;return this.offset.scroll||(this.offset.scroll={top:s.scrollTop(),left:s.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(n=this.relative_container.offset(),t=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):t=this.containment,e.pageX-this.offset.click.leftt[2]&&(a=t[2]+this.offset.click.left),e.pageY-this.offset.click.top>t[3]&&(l=t[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=t?i-this.offset.click.top>=t[1]||i-this.offset.click.top>t[3]?i:i-this.offset.click.top>=t[1]?i-o.grid[1]:i+o.grid[1]:i,r=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=t?r-this.offset.click.left>=t[0]||r-this.offset.click.left>t[2]?r:r-this.offset.click.left>=t[0]?r-o.grid[0]:r+o.grid[0]:r)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,t,n){return n=n||this._uiHash(),A.ui.plugin.call(this,e,[t,n]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),A.Widget.prototype._trigger.call(this,e,t,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),A.ui.plugin.add("draggable","connectToSortable",{start:function(e,t){var n=A(this).data("ui-draggable"),i=n.options,r=A.extend({},t,{item:n.element});n.sortables=[],A(i.connectToSortable).each(function(){var t=A.data(this,"ui-sortable");t&&!t.options.disabled&&(n.sortables.push({instance:t,shouldRevert:t.options.revert}),t.refreshPositions(),t._trigger("activate",e,r))})},stop:function(e,t){var n=A(this).data("ui-draggable"),i=A.extend({},t,{item:n.element});A.each(n.sortables,function(){this.instance.isOver?(this.instance.isOver=0,n.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===n.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,i))})},drag:function(e,t){var n=A(this).data("ui-draggable"),i=this;A.each(n.sortables,function(){var r=!1,o=this;this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(r=!0,A.each(n.sortables,function(){return this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&A.contains(o.instance.element[0],this.instance.element[0])&&(r=!1),r})),r?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=A(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return t.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",e),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),n._trigger("fromSortable",e),n.dropped=!1)})}}),A.ui.plugin.add("draggable","cursor",{start:function(){var e=A("body"),t=A(this).data("ui-draggable").options;e.css("cursor")&&(t._cursor=e.css("cursor")),e.css("cursor",t.cursor)},stop:function(){var e=A(this).data("ui-draggable").options;e._cursor&&A("body").css("cursor",e._cursor)}}),A.ui.plugin.add("draggable","opacity",{start:function(e,t){var n=A(t.helper),i=A(this).data("ui-draggable").options;n.css("opacity")&&(i._opacity=n.css("opacity")),n.css("opacity",i.opacity)},stop:function(e,t){var n=A(this).data("ui-draggable").options;n._opacity&&A(t.helper).css("opacity",n._opacity)}}),A.ui.plugin.add("draggable","scroll",{start:function(){var e=A(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var t=A(this).data("ui-draggable"),n=t.options,i=!1;t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(t.overflowOffset.top+t.scrollParent[0].offsetHeight-e.pageY=0;u--)s=h.snapElements[u].left,a=s+h.snapElements[u].width,l=h.snapElements[u].top,c=l+h.snapElements[u].height,s-d>Q||p>a+d||l-d>f||E>c+d||!A.contains(h.snapElements[u].item.ownerDocument,h.snapElements[u].item)?(h.snapElements[u].snapping&&h.options.snap.release&&h.options.snap.release.call(h.element,e,A.extend(h._uiHash(),{snapItem:h.snapElements[u].item})),h.snapElements[u].snapping=!1):("inner"!==B.snapMode&&(n=d>=Math.abs(l-f),i=d>=Math.abs(c-E),r=d>=Math.abs(s-Q),o=d>=Math.abs(a-p),n&&(t.position.top=h._convertPositionTo("relative",{top:l-h.helperProportions.height,left:0}).top-h.margins.top),i&&(t.position.top=h._convertPositionTo("relative",{top:c,left:0}).top-h.margins.top),r&&(t.position.left=h._convertPositionTo("relative",{top:0,left:s-h.helperProportions.width}).left-h.margins.left),o&&(t.position.left=h._convertPositionTo("relative",{top:0,left:a}).left-h.margins.left)),g=n||i||r||o,"outer"!==B.snapMode&&(n=d>=Math.abs(l-E),i=d>=Math.abs(c-f),r=d>=Math.abs(s-p),o=d>=Math.abs(a-Q),n&&(t.position.top=h._convertPositionTo("relative",{top:l,left:0}).top-h.margins.top),i&&(t.position.top=h._convertPositionTo("relative",{top:c-h.helperProportions.height,left:0}).top-h.margins.top),r&&(t.position.left=h._convertPositionTo("relative",{top:0,left:s}).left-h.margins.left),o&&(t.position.left=h._convertPositionTo("relative",{top:0,left:a-h.helperProportions.width}).left-h.margins.left)),!h.snapElements[u].snapping&&(n||i||r||o||g)&&h.options.snap.snap&&h.options.snap.snap.call(h.element,e,A.extend(h._uiHash(),{snapItem:h.snapElements[u].item})),h.snapElements[u].snapping=n||i||r||o||g)}}),A.ui.plugin.add("draggable","stack",{start:function(){var e,t=this.data("ui-draggable").options,n=A.makeArray(A(t.stack)).sort(function(e,t){return(parseInt(A(e).css("zIndex"),10)||0)-(parseInt(A(t).css("zIndex"),10)||0)});n.length&&(e=parseInt(A(n[0]).css("zIndex"),10)||0,A(n).each(function(t){A(this).css("zIndex",e+t)}),this.css("zIndex",e+n.length))}}),A.ui.plugin.add("draggable","zIndex",{start:function(e,t){var n=A(t.helper),i=A(this).data("ui-draggable").options;n.css("zIndex")&&(i._zIndex=n.css("zIndex")),n.css("zIndex",i.zIndex)},stop:function(e,t){var n=A(this).data("ui-draggable").options;n._zIndex&&A(t.helper).css("zIndex",n._zIndex)}})}(A),function(A){function e(A,e,t){return A>e&&e+t>A}A.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e=this.options,t=e.accept;this.isover=!1,this.isout=!0,this.accept=A.isFunction(t)?t:function(A){return A.is(t)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},A.ui.ddmanager.droppables[e.scope]=A.ui.ddmanager.droppables[e.scope]||[],A.ui.ddmanager.droppables[e.scope].push(this),e.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,t=A.ui.ddmanager.droppables[this.options.scope];t.length>e;e++)t[e]===this&&t.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,t){"accept"===e&&(this.accept=A.isFunction(t)?t:function(A){return A.is(t)}),A.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var t=A.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),t&&this._trigger("activate",e,this.ui(t))},_deactivate:function(e){var t=A.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),t&&this._trigger("deactivate",e,this.ui(t))},_over:function(e){var t=A.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(t)))},_out:function(e){var t=A.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(t)))},_drop:function(e,t){var n=t||A.ui.ddmanager.current,i=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=A.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===n.options.scope&&e.accept.call(e.element[0],n.currentItem||n.element)&&A.ui.intersect(n,A.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(i=!0,!1):void 0}),!i&&(!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(n)),this.element)))},ui:function(A){return{draggable:A.currentItem||A.element,helper:A.helper,position:A.position,offset:A.positionAbs}}}),A.ui.intersect=function(A,t,n){if(!t.offset)return!1;var i,r,o=(A.positionAbs||A.position.absolute).left,s=o+A.helperProportions.width,a=(A.positionAbs||A.position.absolute).top,l=a+A.helperProportions.height,c=t.offset.left,u=c+t.proportions.width,g=t.offset.top,h=g+t.proportions.height;switch(n){case"fit":return o>=c&&u>=s&&a>=g&&h>=l;case"intersect":return o+A.helperProportions.width/2>c&&u>s-A.helperProportions.width/2&&a+A.helperProportions.height/2>g&&h>l-A.helperProportions.height/2;case"pointer":return i=(A.positionAbs||A.position.absolute).left+(A.clickOffset||A.offset.click).left,r=(A.positionAbs||A.position.absolute).top+(A.clickOffset||A.offset.click).top,e(r,g,t.proportions.height)&&e(i,c,t.proportions.width);case"touch":return(a>=g&&h>=a||l>=g&&h>=l||g>a&&l>h)&&(o>=c&&u>=o||s>=c&&u>=s||c>o&&s>u);default:return!1}},A.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,t){var n,i,r=A.ui.ddmanager.droppables[e.options.scope]||[],o=t?t.type:null,s=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();A:for(n=0;r.length>n;n++)if(!(r[n].options.disabled||e&&!r[n].accept.call(r[n].element[0],e.currentItem||e.element))){for(i=0;s.length>i;i++)if(s[i]===r[n].element[0]){r[n].proportions.height=0;continue A}r[n].visible="none"!==r[n].element.css("display"),r[n].visible&&("mousedown"===o&&r[n]._activate.call(r[n],t),r[n].offset=r[n].element.offset(),r[n].proportions={width:r[n].element[0].offsetWidth,height:r[n].element[0].offsetHeight})}},drop:function(e,t){var n=!1;return A.each((A.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&A.ui.intersect(e,this,this.options.tolerance)&&(n=this._drop.call(this,t)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,t)))}),n},dragStart:function(e,t){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||A.ui.ddmanager.prepareOffsets(e,t)})},drag:function(e,t){e.options.refreshPositions&&A.ui.ddmanager.prepareOffsets(e,t),A.each(A.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,i,r,o=A.ui.intersect(e,this,this.options.tolerance),s=!o&&this.isover?"isout":o&&!this.isover?"isover":null;s&&(this.options.greedy&&(i=this.options.scope,r=this.element.parents(":data(ui-droppable)").filter(function(){return A.data(this,"ui-droppable").options.scope===i}),r.length&&(n=A.data(r[0],"ui-droppable"),n.greedyChild="isover"===s)),n&&"isover"===s&&(n.isover=!1,n.isout=!0,n._out.call(n,t)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,t),n&&"isout"===s&&(n.isout=!1,n.isover=!0,n._over.call(n,t)))}})},dragStop:function(e,t){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||A.ui.ddmanager.prepareOffsets(e,t)}}}(A),function(A){function e(A){return parseInt(A,10)||0}function t(A){return!isNaN(parseInt(A,10))}A.widget("ui.resizable",A.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,t,n,i,r,o=this,s=this.options;if(this.element.addClass("ui-resizable"),A.extend(this,{_aspectRatio:!!s.aspectRatio,aspectRatio:s.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:s.helper||s.ghost||s.animate?s.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(A("
    ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=s.handles||(A(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},t=0;e.length>t;t++)n=A.trim(e[t]),r="ui-resizable-"+n,i=A("
    "),i.css({zIndex:s.zIndex}),"se"===n&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[n]=".ui-resizable-"+n,this.element.append(i);this._renderAxis=function(e){var t,n,i,r;e=e||this.element;for(t in this.handles)this.handles[t].constructor===String&&(this.handles[t]=A(this.handles[t],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(n=A(this.handles[t],this.element),r=/sw|ne|nw|se|n|s/.test(t)?n.outerHeight():n.outerWidth(),i=["padding",/ne|nw|n/.test(t)?"Top":/se|sw|s/.test(t)?"Bottom":/^e$/.test(t)?"Right":"Left"].join(""),e.css(i,r),this._proportionallyResize()),A(this.handles[t]).length},this._renderAxis(this.element),this._handles=A(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=i&&i[1]?i[1]:"se")}),s.autoHide&&(this._handles.hide(),A(this.element).addClass("ui-resizable-autohide").mouseenter(function(){ -s.disabled||(A(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){s.disabled||o.resizing||(A(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,t=function(e){A(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(e){var t,n,i=!1;for(t in this.handles)((n=A(this.handles[t])[0])===e.target||A.contains(n,e.target))&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(t){var n,i,r,o=this.options,s=this.element.position(),a=this.element;return this.resizing=!0,/absolute/.test(a.css("position"))?a.css({position:"absolute",top:a.css("top"),left:a.css("left")}):a.is(".ui-draggable")&&a.css({position:"absolute",top:s.top,left:s.left}),this._renderProxy(),n=e(this.helper.css("left")),i=e(this.helper.css("top")),o.containment&&(n+=A(o.containment).scrollLeft()||0,i+=A(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:i},this.size=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalPosition={left:n,top:i},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,r=A(".ui-resizable-"+this.axis).css("cursor"),A("body").css("cursor","auto"===r?this.axis+"-resize":r),a.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t,n=this.helper,i={},r=this.originalMousePosition,o=this.axis,s=this.position.top,a=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-r.left||0,g=e.pageY-r.top||0,h=this._change[o];return!!h&&(t=h.apply(this,[e,u,g]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(t=this._updateRatio(t,e)),t=this._respectSize(t,e),this._updateCache(t),this._propagate("resize",e),this.position.top!==s&&(i.top=this.position.top+"px"),this.position.left!==a&&(i.left=this.position.left+"px"),this.size.width!==l&&(i.width=this.size.width+"px"),this.size.height!==c&&(i.height=this.size.height+"px"),n.css(i),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),A.isEmptyObject(i)||this._trigger("resize",e,this.ui()),!1)},_mouseStop:function(e){this.resizing=!1;var t,n,i,r,o,s,a,l=this.options,c=this;return this._helper&&(t=this._proportionallyResizeElements,n=t.length&&/textarea/i.test(t[0].nodeName),i=n&&A.ui.hasScroll(t[0],"left")?0:c.sizeDiff.height,r=n?0:c.sizeDiff.width,o={width:c.helper.width()-r,height:c.helper.height()-i},s=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,a=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(A.extend(o,{top:a,left:s})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),A("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(A){var e,n,i,r,o,s=this.options;o={minWidth:t(s.minWidth)?s.minWidth:0,maxWidth:t(s.maxWidth)?s.maxWidth:1/0,minHeight:t(s.minHeight)?s.minHeight:0,maxHeight:t(s.maxHeight)?s.maxHeight:1/0},(this._aspectRatio||A)&&(e=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,n=o.maxHeight*this.aspectRatio,r=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),i>o.minHeight&&(o.minHeight=i),o.maxWidth>n&&(o.maxWidth=n),o.maxHeight>r&&(o.maxHeight=r)),this._vBoundaries=o},_updateCache:function(A){this.offset=this.helper.offset(),t(A.left)&&(this.position.left=A.left),t(A.top)&&(this.position.top=A.top),t(A.height)&&(this.size.height=A.height),t(A.width)&&(this.size.width=A.width)},_updateRatio:function(A){var e=this.position,n=this.size,i=this.axis;return t(A.height)?A.width=A.height*this.aspectRatio:t(A.width)&&(A.height=A.width/this.aspectRatio),"sw"===i&&(A.left=e.left+(n.width-A.width),A.top=null),"nw"===i&&(A.top=e.top+(n.height-A.height),A.left=e.left+(n.width-A.width)),A},_respectSize:function(A){var e=this._vBoundaries,n=this.axis,i=t(A.width)&&e.maxWidth&&e.maxWidthA.width,s=t(A.height)&&e.minHeight&&e.minHeight>A.height,a=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(n),u=/nw|ne|n/.test(n);return o&&(A.width=e.minWidth),s&&(A.height=e.minHeight),i&&(A.width=e.maxWidth),r&&(A.height=e.maxHeight),o&&c&&(A.left=a-e.minWidth),i&&c&&(A.left=a-e.maxWidth),s&&u&&(A.top=l-e.minHeight),r&&u&&(A.top=l-e.maxHeight),A.width||A.height||A.left||!A.top?A.width||A.height||A.top||!A.left||(A.left=null):A.top=null,A},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var A,e,t,n,i,r=this.helper||this.element;for(A=0;this._proportionallyResizeElements.length>A;A++){if(i=this._proportionallyResizeElements[A],!this.borderDif)for(this.borderDif=[],t=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],n=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")],e=0;t.length>e;e++)this.borderDif[e]=(parseInt(t[e],10)||0)+(parseInt(n[e],10)||0);i.css({height:r.height()-this.borderDif[0]-this.borderDif[2]||0,width:r.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,t=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||A("
    "),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++t.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(A,e){return{width:this.originalSize.width+e}},w:function(A,e){var t=this.originalSize;return{left:this.originalPosition.left+e,width:t.width-e}},n:function(A,e,t){var n=this.originalSize;return{top:this.originalPosition.top+t,height:n.height-t}},s:function(A,e,t){return{height:this.originalSize.height+t}},se:function(e,t,n){return A.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,t,n]))},sw:function(e,t,n){return A.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,t,n]))},ne:function(e,t,n){return A.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,t,n]))},nw:function(e,t,n){return A.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,t,n]))}},_propagate:function(e,t){A.ui.plugin.call(this,e,[t,this.ui()]),"resize"!==e&&this._trigger(e,t,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),A.ui.plugin.add("resizable","animate",{stop:function(e){var t=A(this).data("ui-resizable"),n=t.options,i=t._proportionallyResizeElements,r=i.length&&/textarea/i.test(i[0].nodeName),o=r&&A.ui.hasScroll(i[0],"left")?0:t.sizeDiff.height,s=r?0:t.sizeDiff.width,a={width:t.size.width-s,height:t.size.height-o},l=parseInt(t.element.css("left"),10)+(t.position.left-t.originalPosition.left)||null,c=parseInt(t.element.css("top"),10)+(t.position.top-t.originalPosition.top)||null;t.element.animate(A.extend(a,c&&l?{top:c,left:l}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseInt(t.element.css("width"),10),height:parseInt(t.element.css("height"),10),top:parseInt(t.element.css("top"),10),left:parseInt(t.element.css("left"),10)};i&&i.length&&A(i[0]).css({width:n.width,height:n.height}),t._updateCache(n),t._propagate("resize",e)}})}}),A.ui.plugin.add("resizable","containment",{start:function(){var t,n,i,r,o,s,a,l=A(this).data("ui-resizable"),c=l.options,u=l.element,g=c.containment,h=g instanceof A?g.get(0):/parent/.test(g)?u.parent().get(0):g;h&&(l.containerElement=A(h),/document/.test(g)||g===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:A(document),left:0,top:0,width:A(document).width(),height:A(document).height()||document.body.parentNode.scrollHeight}):(t=A(h),n=[],A(["Top","Right","Left","Bottom"]).each(function(A,i){n[A]=e(t.css("padding"+i))}),l.containerOffset=t.offset(),l.containerPosition=t.position(),l.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},i=l.containerOffset,r=l.containerSize.height,o=l.containerSize.width,s=A.ui.hasScroll(h,"left")?h.scrollWidth:o,a=A.ui.hasScroll(h)?h.scrollHeight:r,l.parentData={element:h,left:i.left,top:i.top,width:s,height:a}))},resize:function(e){var t,n,i,r,o=A(this).data("ui-resizable"),s=o.options,a=o.containerOffset,l=o.position,c=o._aspectRatio||e.shiftKey,u={top:0,left:0},g=o.containerElement;g[0]!==document&&/static/.test(g.css("position"))&&(u=a),l.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-u.left),c&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=s.helper?a.left:0),l.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),c&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?a.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,t=Math.abs((o._helper,o.offset.left-u.left+o.sizeDiff.width)),n=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-a.top)+o.sizeDiff.height),i=o.containerElement.get(0)===o.element.parent().get(0),r=/relative|absolute/.test(o.containerElement.css("position")),i&&r&&(t-=o.parentData.left),t+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-t,c&&(o.size.height=o.size.width/o.aspectRatio)),n+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-n,c&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=A(this).data("ui-resizable"),t=e.options,n=e.containerOffset,i=e.containerPosition,r=e.containerElement,o=A(e.helper),s=o.offset(),a=o.outerWidth()-e.sizeDiff.width,l=o.outerHeight()-e.sizeDiff.height;e._helper&&!t.animate&&/relative/.test(r.css("position"))&&A(this).css({left:s.left-i.left-n.left,width:a,height:l}),e._helper&&!t.animate&&/static/.test(r.css("position"))&&A(this).css({left:s.left-i.left-n.left,width:a,height:l})}}),A.ui.plugin.add("resizable","alsoResize",{start:function(){var e=A(this).data("ui-resizable"),t=e.options,n=function(e){A(e).each(function(){var e=A(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof t.alsoResize||t.alsoResize.parentNode?n(t.alsoResize):t.alsoResize.length?(t.alsoResize=t.alsoResize[0],n(t.alsoResize)):A.each(t.alsoResize,function(A){n(A)})},resize:function(e,t){var n=A(this).data("ui-resizable"),i=n.options,r=n.originalSize,o=n.originalPosition,s={height:n.size.height-r.height||0,width:n.size.width-r.width||0,top:n.position.top-o.top||0,left:n.position.left-o.left||0},a=function(e,n){A(e).each(function(){var e=A(this),i=A(this).data("ui-resizable-alsoresize"),r={},o=n&&n.length?n:e.parents(t.originalElement[0]).length?["width","height"]:["width","height","top","left"];A.each(o,function(A,e){var t=(i[e]||0)+(s[e]||0);t&&t>=0&&(r[e]=t||null)}),e.css(r)})};"object"!=typeof i.alsoResize||i.alsoResize.nodeType?a(i.alsoResize):A.each(i.alsoResize,function(A,e){a(A,e)})},stop:function(){A(this).removeData("resizable-alsoresize")}}),A.ui.plugin.add("resizable","ghost",{start:function(){var e=A(this).data("ui-resizable"),t=e.options,n=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof t.ghost?t.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=A(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=A(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),A.ui.plugin.add("resizable","grid",{resize:function(){var e=A(this).data("ui-resizable"),t=e.options,n=e.size,i=e.originalSize,r=e.originalPosition,o=e.axis,s="number"==typeof t.grid?[t.grid,t.grid]:t.grid,a=s[0]||1,l=s[1]||1,c=Math.round((n.width-i.width)/a)*a,u=Math.round((n.height-i.height)/l)*l,g=i.width+c,h=i.height+u,B=t.maxWidth&&g>t.maxWidth,d=t.maxHeight&&h>t.maxHeight,p=t.minWidth&&t.minWidth>g,Q=t.minHeight&&t.minHeight>h;t.grid=s,p&&(g+=a),Q&&(h+=l),B&&(g-=a),d&&(h-=l),/^(se|s|e)$/.test(o)?(e.size.width=g,e.size.height=h):/^(ne)$/.test(o)?(e.size.width=g,e.size.height=h,e.position.top=r.top-u):/^(sw)$/.test(o)?(e.size.width=g,e.size.height=h,e.position.left=r.left-c):(e.size.width=g,e.size.height=h,e.position.top=r.top-u,e.position.left=r.left-c)}})}(A),function(A){A.widget("ui.selectable",A.ui.mouse,{version:"1.10.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,t=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=A(t.options.filter,t.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=A(this),t=e.offset();A.data(this,"selectable-item",{element:this,$element:e,left:t.left,top:t.top,right:t.left+e.outerWidth(),bottom:t.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=A("
    ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var t=this,n=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=A(n.filter,this.element[0]),this._trigger("start",e),A(n.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=A.data(this,"selectable-item");n.startselected=!0,e.metaKey||e.ctrlKey||(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,t._trigger("unselecting",e,{unselecting:n.element}))}),A(e.target).parents().addBack().each(function(){var n,i=A.data(this,"selectable-item");return i?(n=!e.metaKey&&!e.ctrlKey||!i.$element.hasClass("ui-selected"),i.$element.removeClass(n?"ui-unselecting":"ui-selected").addClass(n?"ui-selecting":"ui-unselecting"),i.unselecting=!n,i.selecting=n,i.selected=n,n?t._trigger("selecting",e,{selecting:i.element}):t._trigger("unselecting",e,{unselecting:i.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var t,n=this,i=this.options,r=this.opos[0],o=this.opos[1],s=e.pageX,a=e.pageY;return r>s&&(t=s,s=r,r=t),o>a&&(t=a,a=o,o=t),this.helper.css({left:r,top:o,width:s-r,height:a-o}),this.selectees.each(function(){var t=A.data(this,"selectable-item"),l=!1;t&&t.element!==n.element[0]&&("touch"===i.tolerance?l=!(t.left>s||r>t.right||t.top>a||o>t.bottom):"fit"===i.tolerance&&(l=t.left>r&&s>t.right&&t.top>o&&a>t.bottom),l?(t.selected&&(t.$element.removeClass("ui-selected"),t.selected=!1),t.unselecting&&(t.$element.removeClass("ui-unselecting"),t.unselecting=!1),t.selecting||(t.$element.addClass("ui-selecting"),t.selecting=!0,n._trigger("selecting",e,{selecting:t.element}))):(t.selecting&&((e.metaKey||e.ctrlKey)&&t.startselected?(t.$element.removeClass("ui-selecting"),t.selecting=!1,t.$element.addClass("ui-selected"),t.selected=!0):(t.$element.removeClass("ui-selecting"),t.selecting=!1,t.startselected&&(t.$element.addClass("ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",e,{unselecting:t.element}))),t.selected&&(e.metaKey||e.ctrlKey||t.startselected||(t.$element.removeClass("ui-selected"),t.selected=!1,t.$element.addClass("ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",e,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var t=this;return this.dragged=!1,A(".ui-unselecting",this.element[0]).each(function(){var n=A.data(this,"selectable-item");n.$element.removeClass("ui-unselecting"),n.unselecting=!1,n.startselected=!1,t._trigger("unselected",e,{unselected:n.element})}),A(".ui-selecting",this.element[0]).each(function(){var n=A.data(this,"selectable-item");n.$element.removeClass("ui-selecting").addClass("ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,t._trigger("selected",e,{selected:n.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(A),function(A){function e(A,e,t){return A>e&&e+t>A}function t(A){return/left|right/.test(A.css("float"))||/inline|table-cell/.test(A.css("display"))}A.widget("ui.sortable",A.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var A=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===A.axis||t(this.items[0].item)),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var A=this.items.length-1;A>=0;A--)this.items[A].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,t){"disabled"===e?(this.options[e]=t,this.widget().toggleClass("ui-sortable-disabled",!!t)):A.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,t){var n=null,i=!1,r=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),A(e.target).parents().each(function(){return A.data(this,r.widgetName+"-item")===r?(n=A(this),!1):void 0}),A.data(e.target,r.widgetName+"-item")===r&&(n=A(e.target)),!!n&&(!(this.options.handle&&!t&&(A(this.options.handle,n).find("*").addBack().each(function(){this===e.target&&(i=!0)}),!i))&&(this.currentItem=n,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,t,n){var i,r,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},A.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(r=this.document.find("body"),this.storedCursor=r.css("cursor"),r.css("cursor",o.cursor),this.storedStylesheet=A("").appendTo(r)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",e,this._uiHash(this));return A.ui.ddmanager&&(A.ui.ddmanager.current=this),A.ui.ddmanager&&!o.dropBehaviour&&A.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var t,n,i,r,o=this.options,s=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;t--)if(n=this.items[t],i=n.item[0],(r=this._intersectsWithPointer(n))&&n.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===r?"next":"prev"]()[0]!==i&&!A.contains(this.placeholder[0],i)&&("semi-dynamic"!==this.options.type||!A.contains(this.element[0],i))){if(this.direction=1===r?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(e,n),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),A.ui.ddmanager&&A.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,t){if(e){if(A.ui.ddmanager&&!this.options.dropBehaviour&&A.ui.ddmanager.drop(this,e),this.options.revert){var n=this,i=this.placeholder.offset(),r=this.options.axis,o={};r&&"x"!==r||(o.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),r&&"y"!==r||(o.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,A(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){n._clear(e)})}else this._clear(e,t);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),A.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?A(this.domPosition.prev).after(this.currentItem):A(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},A(t).each(function(){var t=(A(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&n.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!n.length&&e.key&&n.push(e.key+"="),n.join("&")},toArray:function(e){var t=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t.each(function(){n.push(A(e.item||this).attr(e.attribute||"id")||"")}),n},_intersectsWith:function(A){var e=this.positionAbs.left,t=e+this.helperProportions.width,n=this.positionAbs.top,i=n+this.helperProportions.height,r=A.left,o=r+A.width,s=A.top,a=s+A.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||n+l>s&&a>n+l,g="y"===this.options.axis||e+c>r&&o>e+c,h=u&&g;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>A[this.floating?"width":"height"]?h:e+this.helperProportions.width/2>r&&o>t-this.helperProportions.width/2&&n+this.helperProportions.height/2>s&&a>i-this.helperProportions.height/2},_intersectsWithPointer:function(A){var t="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,A.top,A.height),n="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,A.left,A.width),i=t&&n,r=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return!!i&&(this.floating?o&&"right"===o||"down"===r?2:1:r&&("down"===r?2:1))},_intersectsWithSides:function(A){var t=e(this.positionAbs.top+this.offset.click.top,A.top+A.height/2,A.height),n=e(this.positionAbs.left+this.offset.click.left,A.left+A.width/2,A.width),i=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return this.floating&&r?"right"===r&&n||"left"===r&&!n:i&&("down"===i&&t||"up"===i&&!t)},_getDragVerticalDirection:function(){var A=this.positionAbs.top-this.lastPositionAbs.top;return 0!==A&&(A>0?"down":"up")},_getDragHorizontalDirection:function(){var A=this.positionAbs.left-this.lastPositionAbs.left;return 0!==A&&(A>0?"right":"left")},refresh:function(A){return this._refreshItems(A),this.refreshPositions(),this},_connectWith:function(){var A=this.options;return A.connectWith.constructor===String?[A.connectWith]:A.connectWith},_getItemsAsjQuery:function(e){var t,n,i,r,o=[],s=[],a=this._connectWith();if(a&&e)for(t=a.length-1;t>=0;t--)for(i=A(a[t]),n=i.length-1;n>=0;n--)(r=A.data(i[n],this.widgetFullName))&&r!==this&&!r.options.disabled&&s.push([A.isFunction(r.options.items)?r.options.items.call(r.element):A(r.options.items,r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),r]);for(s.push([A.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):A(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),t=s.length-1;t>=0;t--)s[t][0].each(function(){o.push(this)});return A(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=A.grep(this.items,function(A){for(var t=0;e.length>t;t++)if(e[t]===A.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var t,n,i,r,o,s,a,l,c=this.items,u=[[A.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):A(this.options.items,this.element),this]],g=this._connectWith();if(g&&this.ready)for(t=g.length-1;t>=0;t--)for(i=A(g[t]),n=i.length-1;n>=0;n--)(r=A.data(i[n],this.widgetFullName))&&r!==this&&!r.options.disabled&&(u.push([A.isFunction(r.options.items)?r.options.items.call(r.element[0],e,{item:this.currentItem}):A(r.options.items,r.element),r]),this.containers.push(r));for(t=u.length-1;t>=0;t--)for(o=u[t][1],s=u[t][0],n=0,l=s.length;l>n;n++)a=A(s[n]),a.data(this.widgetName+"-item",o),c.push({item:a,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var t,n,i,r;for(t=this.items.length-1;t>=0;t--)n=this.items[t],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?A(this.options.toleranceElement,n.item):n.item,e||(n.width=i.outerWidth(),n.height=i.outerHeight()),r=i.offset(),n.left=r.left,n.top=r.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(t=this.containers.length-1;t>=0;t--)r=this.containers[t].element.offset(),this.containers[t].containerCache.left=r.left,this.containers[t].containerCache.top=r.top,this.containers[t].containerCache.width=this.containers[t].element.outerWidth(),this.containers[t].containerCache.height=this.containers[t].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var t,n=e.options;n.placeholder&&n.placeholder.constructor!==String||(t=n.placeholder,n.placeholder={element:function(){var n=e.currentItem[0].nodeName.toLowerCase(),i=A("<"+n+">",e.document[0]).addClass(t||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===n?e.currentItem.children().each(function(){A(" ",e.document[0]).attr("colspan",A(this).attr("colspan")||1).appendTo(i)}):"img"===n&&i.attr("src",e.currentItem.attr("src")),t||i.css("visibility","hidden"),i},update:function(A,i){(!t||n.forcePlaceholderSize)&&(i.height()||i.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=A(n.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_contactContainers:function(n){var i,r,o,s,a,l,c,u,g,h,B=null,d=null;for(i=this.containers.length-1;i>=0;i--)if(!A.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(B&&A.contains(this.containers[i].element[0],B.element[0]))continue;B=this.containers[i],d=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",n,this._uiHash(this)),this.containers[i].containerCache.over=0);if(B)if(1===this.containers.length)this.containers[d].containerCache.over||(this.containers[d]._trigger("over",n,this._uiHash(this)),this.containers[d].containerCache.over=1);else{for(o=1e4,s=null,h=B.floating||t(this.currentItem),a=h?"left":"top", -l=h?"width":"height",c=this.positionAbs[a]+this.offset.click[a],r=this.items.length-1;r>=0;r--)A.contains(this.containers[d].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(!h||e(this.positionAbs.top+this.offset.click.top,this.items[r].top,this.items[r].height))&&(u=this.items[r].item.offset()[a],g=!1,Math.abs(u-c)>Math.abs(u+this.items[r][l]-c)&&(g=!0,u+=this.items[r][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),s=this.items[r],this.direction=g?"up":"down"));if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[d])return;s?this._rearrange(n,s,null,!0):this._rearrange(n,null,this.containers[d].element,!0),this._trigger("change",n,this._uiHash()),this.containers[d]._trigger("change",n,this._uiHash(this)),this.currentContainer=this.containers[d],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",n,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(e){var t=this.options,n=A.isFunction(t.helper)?A(t.helper.apply(this.element[0],[e,this.currentItem])):"clone"===t.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||A("parent"!==t.appendTo?t.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!n[0].style.width||t.forceHelperSize)&&n.width(this.currentItem.width()),(!n[0].style.height||t.forceHelperSize)&&n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),A.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&A.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var A=this.currentItem.position();return{top:A.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:A.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,n,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A("document"===i.containment?document:window).width()-this.helperProportions.width-this.margins.left,(A("document"===i.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(e=A(i.containment)[0],t=A(i.containment).offset(),n="hidden"!==A(e).css("overflow"),this.containment=[t.left+(parseInt(A(e).css("borderLeftWidth"),10)||0)+(parseInt(A(e).css("paddingLeft"),10)||0)-this.margins.left,t.top+(parseInt(A(e).css("borderTopWidth"),10)||0)+(parseInt(A(e).css("paddingTop"),10)||0)-this.margins.top,t.left+(n?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(A(e).css("borderLeftWidth"),10)||0)-(parseInt(A(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,t.top+(n?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(A(e).css("borderTopWidth"),10)||0)-(parseInt(A(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(i[0].tagName);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:i.scrollTop())*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:i.scrollLeft())*n}},_generatePosition:function(e){var t,n,i=this.options,r=e.pageX,o=e.pageY,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(s[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(r=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(t=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=this.containment?t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-i.grid[1]:t+i.grid[1]:t,n=this.originalPageX+Math.round((r-this.originalPageX)/i.grid[0])*i.grid[0],r=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-i.grid[0]:n+i.grid[0]:n)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:s.scrollTop()),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:s.scrollLeft())}},_rearrange:function(A,e,t,n){t?t[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!n)})},_clear:function(A,e){this.reverting=!1;var t,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(t in this._storedCSS)("auto"===this._storedCSS[t]||"static"===this._storedCSS[t])&&(this._storedCSS[t]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(A){this._trigger("receive",A,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(A){this._trigger("update",A,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(A){this._trigger("remove",A,this._uiHash())}),n.push(function(A){return function(e){A._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(A){return function(e){A._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),t=this.containers.length-1;t>=0;t--)e||n.push(function(A){return function(e){A._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[t])),this.containers[t].containerCache.over&&(n.push(function(A){return function(e){A._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[t])),this.containers[t].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",A,this._uiHash()),t=0;n.length>t;t++)n[t].call(this,A);this._trigger("stop",A,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",A,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(t=0;n.length>t;t++)n[t].call(this,A);this._trigger("stop",A,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===A.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var t=e||this;return{helper:t.helper,placeholder:t.placeholder||A([]),position:t.position,originalPosition:t.originalPosition,offset:t.positionAbs,item:t.currentItem,sender:e?e.element:null}}})}(A),function(A){var e=0;A.widget("ui.autocomplete",{version:"1.10.3",defaultElement:"",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,t,n,i=this.element[0].nodeName.toLowerCase(),r="textarea"===i,o="input"===i;this.isMultiLine=!!r||!o&&this.element.prop("isContentEditable"),this.valueMethod=this.element[r||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly"))return e=!0,n=!0,void(t=!0);e=!1,n=!1,t=!1;var r=A.ui.keyCode;switch(i.keyCode){case r.PAGE_UP:e=!0,this._move("previousPage",i);break;case r.PAGE_DOWN:e=!0,this._move("nextPage",i);break;case r.UP:e=!0,this._keyEvent("previous",i);break;case r.DOWN:e=!0,this._keyEvent("next",i);break;case r.ENTER:case r.NUMPAD_ENTER:this.menu.active&&(e=!0,i.preventDefault(),this.menu.select(i));break;case r.TAB:this.menu.active&&this.menu.select(i);break;case r.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:t=!0,this._searchTimeout(i)}},keypress:function(n){if(e)return e=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&n.preventDefault());if(!t){var i=A.ui.keyCode;switch(n.keyCode){case i.PAGE_UP:this._move("previousPage",n);break;case i.PAGE_DOWN:this._move("nextPage",n);break;case i.UP:this._keyEvent("previous",n);break;case i.DOWN:this._keyEvent("next",n)}}},input:function(A){return n?(n=!1,void A.preventDefault()):void this._searchTimeout(A)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(A){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(A),void this._change(A))}}),this._initSource(),this.menu=A("
    ',i.jqib=A(a).appendTo(o),i.jqi=i.jqib.children("."+r.prefix),i.jqif=i.jqib.children("."+r.prefix+"fade"),t.constructor===String&&(t={state0:{title:r.title,html:t,buttons:r.buttons,position:r.position,focus:r.focus,defaultButton:r.defaultButton,submit:r.submit}}),i.options.states={};var c,l;for(c in t)l=A.extend({},e.defaults.state,{name:c},t[c]),i.addState(l.name,l),""===i.currentStateName&&(i.currentStateName=l.name);i.jqi.on("click","."+r.prefix+"buttons button",function(){var e=A(this),t=e.parents("."+r.prefix+"state"),n=i.options.states[t.data("jqi-name")],o=t.children("."+r.prefix+"message"),s=n.buttons[e.text()]||n.buttons[e.html()],a={};if(void 0===s)for(var c in n.buttons)(n.buttons[c].title===e.text()||n.buttons[c].title===e.html())&&(s=n.buttons[c].value);A.each(i.jqi.children("form").serializeArray(),function(A,e){void 0===a[e.name]?a[e.name]=e.value:typeof a[e.name]===Array||"object"==typeof a[e.name]?a[e.name].push(e.value):a[e.name]=[a[e.name],e.value]});var l=new A.Event("impromptu:submit");l.stateName=n.name,l.state=t,t.trigger(l,[s,o,a]),l.isDefaultPrevented()||i.close(!0,s,o,a)});var u=function(){if(r.persistent){var e=(""+r.top).indexOf("%")>=0?s.height()*(parseInt(r.top,10)/100):parseInt(r.top,10),t=parseInt(i.jqi.css("top").replace("px",""),10)-e;A("html,body").animate({scrollTop:t},"fast",function(){var A=0;i.jqib.addClass(r.prefix+"warning");var e=setInterval(function(){i.jqib.toggleClass(r.prefix+"warning"),A++>1&&(clearInterval(e),i.jqib.removeClass(r.prefix+"warning"))},100)})}else i.close(!0)},g=function(e){var t=window.event?event.keyCode:e.keyCode;if(27===t&&u(),13===t){var n=i.getCurrentState().find("."+r.prefix+"defaultbutton");!1===A(e.target).is("textarea,."+r.prefix+"button")&&n.length>0&&(e.preventDefault(),n.click())}if(9===t){var o=A("input,select,textarea,button",i.getCurrentState()),s=!e.shiftKey&&e.target===o[o.length-1],a=e.shiftKey&&e.target===o[0];if(s||a)return setTimeout(function(){if(o){var A=o[!0===a?o.length-1:0];A&&A.focus()}},10),!1}};return i.position(),i.style(),i._windowResize=function(A){i.position(A)},s.resize({animate:!1},i._windowResize),i.jqif.click(u),i.jqi.find("."+r.prefix+"close").click(function(){i.close()}),i.jqib.on("keydown",g).on("impromptu:loaded",r.loaded).on("impromptu:close",r.close).on("impromptu:statechanging",r.statechanging).on("impromptu:statechanged",r.statechanged),i.jqif[r.show](r.overlayspeed),i.jqi[r.show](r.promptspeed,function(){var A=i.jqi.find("."+r.prefix+"states ."+r.prefix+"state").eq(0);i.goToState(A.data("jqi-name")),i.jqib.trigger("impromptu:loaded")}),r.timeout>0&&(i.timeout=setTimeout(function(){i.close(!0)},r.timeout)),i},close:function(t,n,i,r){var o=this;return e.removeFromStack(o.id),o.timeout&&(clearTimeout(o.timeout),o.timeout=!1),o.jqib&&o.jqib[o.options.hide]("fast",function(){o.jqib.trigger("impromptu:close",[n,i,r]),o.jqib.remove(),A(window).off("resize",o._windowResize),"function"==typeof t&&t()}),o.currentStateName="",o},addState:function(t,n,i){var r,o,s,a,c,l=this,u="",g=null,h="",B="",d=l.options,Q=A("."+d.prefix+"states"),p=[],E=0;if(n=A.extend({},e.defaults.state,{name:t},n),null!==n.position.arrow&&(h='
    '),n.title&&""!==n.title&&(B='
    '+n.title+"
    "),r=n.html,"function"==typeof n.html&&(r="Error: html function must return text"),u+='",g=A(u),g.on("impromptu:submit",n.submit),void 0!==i?Q.find('[data-jqi-name="'+i+'"]').after(g):Q.append(g),l.options.states[t]=n,g},removeState:function(A,e){var t=this,n=t.getState(A),i=function(){n.remove()};return 0!==n.length&&("none"!==n.css("display")?void 0!==e&&t.getState(e).length>0?t.goToState(e,!1,i):n.next().length>0?t.nextState(i):n.prev().length>0?t.prevState(i):t.close():n.slideUp("slow",i),!0)},getApi:function(){return this},getBox:function(){return this.jqib},getPrompt:function(){return this.jqi},getState:function(A){return this.jqi.find('[data-jqi-name="'+A+'"]')},getCurrentState:function(){return this.getState(this.getCurrentStateName())},getCurrentStateName:function(){return this.currentStateName},position:function(e){var t=this,n=A.fx.off,i=t.getCurrentState(),r=t.options.states[i.data("jqi-name")],o=r?r.position:void 0,s=A(window),a=document.body.scrollHeight,c=A(window).height(),l=(A(document).height(),a>c?a:c),u=parseInt(s.scrollTop(),10)+((""+t.options.top).indexOf("%")>=0?c*(parseInt(t.options.top,10)/100):parseInt(t.options.top,10));if(void 0!==e&&!1===e.data.animate&&(A.fx.off=!0),t.jqib.css({position:"absolute",height:l,width:"100%",top:0,left:0,right:0,bottom:0}),t.jqif.css({position:"fixed",height:l,width:"100%",top:0,left:0,right:0,bottom:0}),o&&o.container){var g=A(o.container).offset();A.isPlainObject(g)&&void 0!==g.top&&(t.jqi.css({position:"absolute"}),t.jqi.animate({top:g.top+o.y,left:g.left+o.x,marginLeft:0,width:void 0!==o.width?o.width:null}),u=g.top+o.y-((""+t.options.top).indexOf("%")>=0?c*(parseInt(t.options.top,10)/100):parseInt(t.options.top,10)),A("html,body").animate({scrollTop:u},"slow","swing",function(){}))}else o&&o.width?(t.jqi.css({position:"absolute",left:"50%"}),t.jqi.animate({top:o.y||u,left:o.x||"50%",marginLeft:o.width/2*-1,width:o.width})):t.jqi.css({position:"absolute",top:u,left:"50%",marginLeft:t.jqi.outerWidth(!1)/2*-1});void 0!==e&&!1===e.data.animate&&(A.fx.off=n)},style:function(){var A=this;A.jqif.css({zIndex:A.options.zIndex,display:"none",opacity:A.options.opacity}),A.jqi.css({zIndex:A.options.zIndex+1,display:"none"}),A.jqib.css({zIndex:A.options.zIndex})},goToState:function(e,t,n){var i=this,r=(i.jqi,i.options),o=i.getState(e),s=r.states[o.data("jqi-name")],a=new A.Event("impromptu:statechanging"),c=i.options;if(void 0!==s){if("function"==typeof s.html){var l=s.html;o.find("."+c.prefix+"message ").html(l())}"function"==typeof t&&(n=t,t=!1),i.jqib.trigger(a,[i.getCurrentStateName(),e]),!a.isDefaultPrevented()&&o.length>0&&(i.jqi.find("."+c.prefix+"parentstate").removeClass(c.prefix+"parentstate"),t?(i.jqi.find("."+c.prefix+"substate").not(o).slideUp(r.promptspeed).removeClass("."+c.prefix+"substate").find("."+c.prefix+"arrow").hide(),i.jqi.find("."+c.prefix+"state:visible").addClass(c.prefix+"parentstate"),o.addClass(c.prefix+"substate")):i.jqi.find("."+c.prefix+"state").not(o).slideUp(r.promptspeed).find("."+c.prefix+"arrow").hide(),i.currentStateName=s.name,o.slideDown(r.promptspeed,function(){var t=A(this);"string"==typeof s.focus?t.find(s.focus).eq(0).focus():t.find("."+c.prefix+"defaultbutton").focus(),t.find("."+c.prefix+"arrow").show(r.promptspeed),"function"==typeof n&&i.jqib.on("impromptu:statechanged",n),i.jqib.trigger("impromptu:statechanged",[e]),"function"==typeof n&&i.jqib.off("impromptu:statechanged",n)}),t||i.position())}return o},nextState:function(A){var e=this,t=e.getCurrentState().next();return t.length>0&&e.goToState(t.data("jqi-name"),A),t},prevState:function(A){var e=this,t=e.getCurrentState().prev();return t.length>0&&e.goToState(t.data("jqi-name"),A),t}},A.prompt=function(A,t){return new e(A,t).jqi},A.each(e,function(e,t){A.prompt[e]=t}),A.each(e.prototype,function(t){A.prompt[t]=function(){var A=e.getLast();return A&&"function"==typeof A[t]?A[t].apply(A,arguments):void 0}}),A.fn.prompt=function(e){void 0===e&&(e={}),void 0===e.withDataAndEvents&&(e.withDataAndEvents=!1),A.prompt(A(this).clone(e.withDataAndEvents).html(),e)},window.Impromptu=e}),function(A){"use strict";"function"==typeof define&&define.amd?define("jstree",["jquery"],A):A("object"==typeof exports?require("jquery"):jQuery)}(function(A,e){"use strict";if(!A.jstree){var t,n,i=0,r=!1,o=!1,s=!1,a=[],c=A("script:last").attr("src"),l=document,u=l.createElement("LI");u.setAttribute("role","treeitem"),t=l.createElement("I"),t.className="jstree-icon jstree-ocl",t.setAttribute("role","presentation"),u.appendChild(t),t=l.createElement("A"),t.className="jstree-anchor",t.setAttribute("href","#"),t.setAttribute("tabindex","-1"),n=l.createElement("I"),n.className="jstree-icon jstree-themeicon",n.setAttribute("role","presentation"),t.appendChild(n),u.appendChild(t),t=n=null,A.jstree={version:"3.0.9",defaults:{plugins:[]},plugins:{},path:c&&-1!==c.indexOf("/")?c.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g},A.jstree.create=function(e,t){var n=new A.jstree.core(++i),r=t;return t=A.extend(!0,{},A.jstree.defaults,t),r&&r.plugins&&(t.plugins=r.plugins),A.each(t.plugins,function(A,e){"core"!==A&&(n=n.plugin(e,t[e]))}),n.init(e,t),n},A.jstree.destroy=function(){A(".jstree:jstree").jstree("destroy"),A(document).off(".jstree")},A.jstree.core=function(A){this._id=A,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},A.jstree.reference=function(e){var t=null,n=null;if(e&&e.id&&(e=e.id),!n||!n.length)try{n=A(e)}catch(A){}if(!n||!n.length)try{n=A("#"+e.replace(A.jstree.idregex,"\\$&"))}catch(A){}return n&&n.length&&(n=n.closest(".jstree")).length&&(n=n.data("jstree"))?t=n:A(".jstree").each(function(){var n=A(this).data("jstree");return n&&n._model.data[e]?(t=n,!1):void 0}),t},A.fn.jstree=function(t){var n="string"==typeof t,i=Array.prototype.slice.call(arguments,1),r=null;return!(!0===t&&!this.length)&&(this.each(function(){var o=A.jstree.reference(this),s=n&&o?o[t]:null;return r=n&&s?s.apply(o,i):null,o||n||t!==e&&!A.isPlainObject(t)||A(this).data("jstree",new A.jstree.create(this,t)),(o&&!n||!0===t)&&(r=o||!1),(null===r||r===e)&&void 0}),null!==r&&r!==e?r:this)},A.expr[":"].jstree=A.expr.createPseudo(function(t){return function(t){return A(t).hasClass("jstree")&&A(t).data("jstree")!==e}}),A.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:A.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},A.jstree.core.prototype={plugin:function(e,t){var n=A.jstree.plugins[e];return n?(this._data[e]={},n.prototype=this,new n(t,this)):this},init:function(e,t){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this.element=A(e).addClass("jstree jstree-"+this._id),this.settings=t,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter(function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))}).remove(),this.element.html("
    "),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().height()||24,this.trigger("loading"),this.load_node("#")},destroy:function(A){if(this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(A){}A||this.element.empty(),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/gi,"")}),this.element=null},bind:function(){var e="",t=null,n=0;this.element.on("dblclick.jstree",function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var A=window.getSelection();try{A.removeAllRanges(),A.collapse()}catch(A){}}}).on("mousedown.jstree",A.proxy(function(A){A.target===this.element[0]&&(A.preventDefault(),n=+new Date)},this)).on("mousedown.jstree",".jstree-ocl",function(A){A.preventDefault()}).on("click.jstree",".jstree-ocl",A.proxy(function(A){this.toggle_node(A.target)},this)).on("dblclick.jstree",".jstree-anchor",A.proxy(function(A){this.settings.core.dblclick_toggle&&this.toggle_node(A.target)},this)).on("click.jstree",".jstree-anchor",A.proxy(function(e){e.preventDefault(),e.currentTarget!==document.activeElement&&A(e.currentTarget).focus(),this.activate_node(e.currentTarget,e)},this)).on("keydown.jstree",".jstree-anchor",A.proxy(function(e){if("INPUT"===e.target.tagName)return!0;var t=null;switch(this._data.core.rtl&&(37===e.which?e.which=39:39===e.which&&(e.which=37)),e.which){case 32:e.ctrlKey&&(e.type="click",A(e.currentTarget).trigger(e));break;case 13:e.type="click",A(e.currentTarget).trigger(e);break;case 37:e.preventDefault(),this.is_open(e.currentTarget)?this.close_node(e.currentTarget):(t=this.get_parent(e.currentTarget))&&"#"!==t.id&&this.get_node(t,!0).children(".jstree-anchor").focus();break;case 38:e.preventDefault(),(t=this.get_prev_dom(e.currentTarget))&&t.length&&t.children(".jstree-anchor").focus();break;case 39:e.preventDefault(),this.is_closed(e.currentTarget)?this.open_node(e.currentTarget,function(A){this.get_node(A,!0).children(".jstree-anchor").focus()}):this.is_open(e.currentTarget)&&(t=this.get_node(e.currentTarget,!0).children(".jstree-children")[0])&&A(this._firstChild(t)).children(".jstree-anchor").focus();break;case 40:e.preventDefault(), +(t=this.get_next_dom(e.currentTarget))&&t.length&&t.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:e.preventDefault(),(t=this._firstChild(this.get_container_ul()[0]))&&A(t).children(".jstree-anchor").filter(":visible").focus();break;case 35:e.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()}},this)).on("load_node.jstree",A.proxy(function(e,t){t.status&&("#"!==t.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(A.proxy(function(){if(!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var e,t,n=[];for(e=0,t=this._data.core.selected.length;t>e;e++)n=n.concat(this._model.data[this._data.core.selected[e]].parents);for(n=A.vakata.array_unique(n),e=0,t=n.length;t>e;e++)this.open_node(n[e],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}},this),0))},this)).on("keypress.jstree",A.proxy(function(n){if("INPUT"===n.target.tagName)return!0;t&&clearTimeout(t),t=setTimeout(function(){e=""},500);var i=String.fromCharCode(n.which).toLowerCase(),r=this.element.find(".jstree-anchor").filter(":visible"),o=r.index(document.activeElement)||0,s=!1;if(e+=i,e.length>1){if(r.slice(o).each(A.proxy(function(t,n){return 0===A(n).text().toLowerCase().indexOf(e)?(A(n).focus(),s=!0,!1):void 0},this)),s)return;if(r.slice(0,o).each(A.proxy(function(t,n){return 0===A(n).text().toLowerCase().indexOf(e)?(A(n).focus(),s=!0,!1):void 0},this)),s)return}if(new RegExp("^"+i+"+$").test(e)){if(r.slice(o+1).each(A.proxy(function(e,t){return A(t).text().toLowerCase().charAt(0)===i?(A(t).focus(),s=!0,!1):void 0},this)),s)return;if(r.slice(0,o+1).each(A.proxy(function(e,t){return A(t).text().toLowerCase().charAt(0)===i?(A(t).focus(),s=!0,!1):void 0},this)),s)return}},this)).on("init.jstree",A.proxy(function(){var A=this.settings.core.themes;this._data.core.themes.dots=A.dots,this._data.core.themes.stripes=A.stripes,this._data.core.themes.icons=A.icons,this.set_theme(A.name||"default",A.url),this.set_theme_variant(A.variant)},this)).on("loading.jstree",A.proxy(function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()},this)).on("blur.jstree",".jstree-anchor",A.proxy(function(e){this._data.core.focused=null,A(e.currentTarget).filter(".jstree-hovered").mouseleave(),this.element.attr("tabindex","0")},this)).on("focus.jstree",".jstree-anchor",A.proxy(function(e){var t=this.get_node(e.currentTarget);t&&t.id&&(this._data.core.focused=t.id),this.element.find(".jstree-hovered").not(e.currentTarget).mouseleave(),A(e.currentTarget).mouseenter(),this.element.attr("tabindex","-1")},this)).on("focus.jstree",A.proxy(function(){+new Date-n>500&&!this._data.core.focused&&(n=0,this.get_node(this.element.attr("aria-activedescendant"),!0).find("> .jstree-anchor").focus())},this)).on("mouseenter.jstree",".jstree-anchor",A.proxy(function(A){this.hover_node(A.currentTarget)},this)).on("mouseleave.jstree",".jstree-anchor",A.proxy(function(A){this.dehover_node(A.currentTarget)},this))},unbind:function(){this.element.off(".jstree"),A(document).off(".jstree-"+this._id)},trigger:function(A,e){e||(e={}),e.instance=this,this.element.triggerHandler(A.replace(".jstree","")+".jstree",e)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(e){var t=this.settings.core.strings;return A.isFunction(t)?t.call(this,e):t&&t[e]?t[e]:e},_firstChild:function(A){for(A=A?A.firstChild:null;null!==A&&1!==A.nodeType;)A=A.nextSibling;return A},_nextSibling:function(A){for(A=A?A.nextSibling:null;null!==A&&1!==A.nodeType;)A=A.nextSibling;return A},_previousSibling:function(A){for(A=A?A.previousSibling:null;null!==A&&1!==A.nodeType;)A=A.previousSibling;return A},get_node:function(e,t){e&&e.id&&(e=e.id);var n;try{if(this._model.data[e])e=this._model.data[e];else if("string"==typeof e&&this._model.data[e.replace(/^#/,"")])e=this._model.data[e.replace(/^#/,"")];else if("string"==typeof e&&(n=A("#"+e.replace(A.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[n.closest(".jstree-node").attr("id")])e=this._model.data[n.closest(".jstree-node").attr("id")];else if((n=A(e,this.element)).length&&this._model.data[n.closest(".jstree-node").attr("id")])e=this._model.data[n.closest(".jstree-node").attr("id")];else{if(!(n=A(e,this.element)).length||!n.hasClass("jstree"))return!1;e=this._model.data["#"]}return t&&(e="#"===e.id?this.element:A("#"+e.id.replace(A.jstree.idregex,"\\$&"),this.element)),e}catch(A){return!1}},get_path:function(A,e,t){if(!(A=A.parents?A:this.get_node(A))||"#"===A.id||!A.parents)return!1;var n,i,r=[];for(r.push(t?A.id:A.text),n=0,i=A.parents.length;i>n;n++)r.push(t?A.parents[n]:this.get_text(A.parents[n]));return r=r.reverse().slice(1),e?r.join(e):r},get_next_dom:function(e,t){var n;if(e=this.get_node(e,!0),e[0]===this.element[0]){for(n=this._firstChild(this.get_container_ul()[0]);n&&0===n.offsetHeight;)n=this._nextSibling(n);return!!n&&A(n)}if(!e||!e.length)return!1;if(t){n=e[0];do{n=this._nextSibling(n)}while(n&&0===n.offsetHeight);return!!n&&A(n)}if(e.hasClass("jstree-open")){for(n=this._firstChild(e.children(".jstree-children")[0]);n&&0===n.offsetHeight;)n=this._nextSibling(n);if(null!==n)return A(n)}n=e[0];do{n=this._nextSibling(n)}while(n&&0===n.offsetHeight);return null!==n?A(n):e.parentsUntil(".jstree",".jstree-node").next(".jstree-node:visible").first()},get_prev_dom:function(e,t){var n;if(e=this.get_node(e,!0),e[0]===this.element[0]){for(n=this.get_container_ul()[0].lastChild;n&&0===n.offsetHeight;)n=this._previousSibling(n);return!!n&&A(n)}if(!e||!e.length)return!1;if(t){n=e[0];do{n=this._previousSibling(n)}while(n&&0===n.offsetHeight);return!!n&&A(n)}n=e[0];do{n=this._previousSibling(n)}while(n&&0===n.offsetHeight);if(null!==n){for(e=A(n);e.hasClass("jstree-open");)e=e.children(".jstree-children").first().children(".jstree-node:visible:last");return e}return!(!(n=e[0].parentNode.parentNode)||!n.className||-1===n.className.indexOf("jstree-node"))&&A(n)},get_parent:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.parent},get_children_dom:function(A){return A=this.get_node(A,!0),A[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):!(!A||!A.length)&&A.children(".jstree-children").children(".jstree-node")},is_parent:function(A){return(A=this.get_node(A))&&(!1===A.state.loaded||A.children.length>0)},is_loaded:function(A){return(A=this.get_node(A))&&A.state.loaded},is_loading:function(A){return(A=this.get_node(A))&&A.state&&A.state.loading},is_open:function(A){return(A=this.get_node(A))&&A.state.opened},is_closed:function(A){return(A=this.get_node(A))&&this.is_parent(A)&&!A.state.opened},is_leaf:function(A){return!this.is_parent(A)},load_node:function(e,t){var n,i,r,o,s;if(A.isArray(e))return this._load_nodes(e.slice(),t),!0;if(!(e=this.get_node(e)))return t&&t.call(this,e,!1),!1;if(e.state.loaded){for(e.state.loaded=!1,n=0,i=e.children_d.length;i>n;n++){for(r=0,o=e.parents.length;o>r;r++)this._model.data[e.parents[r]].children_d=A.vakata.array_remove_item(this._model.data[e.parents[r]].children_d,e.children_d[n]);this._model.data[e.children_d[n]].state.selected&&(s=!0,this._data.core.selected=A.vakata.array_remove_item(this._data.core.selected,e.children_d[n])),delete this._model.data[e.children_d[n]]}e.children=[],e.children_d=[],s&&this.trigger("changed",{action:"load_node",node:e,selected:this._data.core.selected})}return e.state.loading=!0,this.get_node(e,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(e,A.proxy(function(A){e=this._model.data[e.id],e.state.loading=!1,e.state.loaded=A;var n=this.get_node(e,!0);e.state.loaded&&!e.children.length&&n&&n.length&&!n.hasClass("jstree-leaf")&&n.removeClass("jstree-closed jstree-open").addClass("jstree-leaf"),n.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:e,status:A}),t&&t.call(this,e,A)},this)),!0},_load_nodes:function(A,e,t){var n,i,r=!0,o=function(){this._load_nodes(A,e,!0)},s=this._model.data;for(n=0,i=A.length;i>n;n++)!s[A[n]]||s[A[n]].state.loaded&&t||(this.is_loading(A[n])||this.load_node(A[n],o),r=!1);r&&e&&!e.done&&(e.call(this,A),e.done=!0)},load_all:function(A,e){if(A||(A="#"),!(A=this.get_node(A)))return!1;var t,n,i=[],r=this._model.data,o=r[A.id].children_d;for(A.state&&!A.state.loaded&&i.push(A.id),t=0,n=o.length;n>t;t++)r[o[t]]&&r[o[t]].state&&!r[o[t]].state.loaded&&i.push(o[t]);i.length?this._load_nodes(i,function(){this.load_all(A,e)}):(e&&e.call(this,A),this.trigger("load_all",{node:A}))},_load_node:function(e,t){var n,i=this.settings.core.data;return i?A.isFunction(i)?i.call(this,e,A.proxy(function(n){!1===n&&t.call(this,!1),this["string"==typeof n?"_append_html_data":"_append_json_data"](e,"string"==typeof n?A(n):n,function(A){t.call(this,A)})},this)):"object"==typeof i?i.url?(i=A.extend(!0,{},i),A.isFunction(i.url)&&(i.url=i.url.call(this,e)),A.isFunction(i.data)&&(i.data=i.data.call(this,e)),A.ajax(i).done(A.proxy(function(n,i,r){var o=r.getResponseHeader("Content-Type");return-1!==o.indexOf("json")||"object"==typeof n?this._append_json_data(e,n,function(A){t.call(this,A)}):-1!==o.indexOf("html")||"string"==typeof n?this._append_html_data(e,A(n),function(A){t.call(this,A)}):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:e.id,xhr:r})},this.settings.core.error.call(this,this._data.core.last_error),t.call(this,!1))},this)).fail(A.proxy(function(A){t.call(this,!1),this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:e.id,xhr:A})},this.settings.core.error.call(this,this._data.core.last_error)},this))):(n=A.isArray(i)||A.isPlainObject(i)?JSON.parse(JSON.stringify(i)):i,"#"===e.id?this._append_json_data(e,n,function(A){t.call(this,A)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:e.id})},this.settings.core.error.call(this,this._data.core.last_error),t.call(this,!1))):"string"==typeof i?"#"===e.id?this._append_html_data(e,A(i),function(A){t.call(this,A)}):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:e.id})},this.settings.core.error.call(this,this._data.core.last_error),t.call(this,!1)):t.call(this,!1):"#"===e.id?this._append_html_data(e,this._data.core.original_container_html.clone(!0),function(A){t.call(this,A)}):t.call(this,!1)},_node_changed:function(A){(A=this.get_node(A))&&this._model.changed.push(A.id)},_append_html_data:function(e,t,n){e=this.get_node(e),e.children=[],e.children_d=[];var i,r,o,s=t.is("ul")?t.children():t,a=e.id,c=[],l=[],u=this._model.data,g=u[a],h=this._data.core.selected.length;for(s.each(A.proxy(function(e,t){(i=this._parse_model_from_html(A(t),a,g.parents.concat()))&&(c.push(i),l.push(i),u[i].children_d.length&&(l=l.concat(u[i].children_d)))},this)),g.children=c,g.children_d=l,r=0,o=g.parents.length;o>r;r++)u[g.parents[r]].children_d=u[g.parents[r]].children_d.concat(l);this.trigger("model",{nodes:l,parent:a}),"#"!==a?(this._node_changed(a),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==h&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),n.call(this,!0)},_append_json_data:function(e,t,n,i){e=this.get_node(e),e.children=[],e.children_d=[],t.d&&"string"==typeof(t=t.d)&&(t=JSON.parse(t)),A.isArray(t)||(t=[t]);var r=null,o={df:this._model.default_state,dat:t,par:e.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},s=function(A,e){A.data&&(A=A.data);var t,n,i,r,o=A.dat,s=A.par,a=[],c=[],l=[],u=A.df,g=A.t_id,h=A.t_cnt,B=A.m,d=B[s],Q=A.sel,p=function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a=A.id.toString(),c={id:a,text:A.text||"",icon:A.icon===e||A.icon,parent:t,parents:n,children:A.children||[],children_d:A.children_d||[],data:A.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in u)u.hasOwnProperty(i)&&(c.state[i]=u[i]);if(A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(c.icon=A.data.jstree.icon),A&&A.data&&(c.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(c.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(c.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(c.li_attr[i]=A.li_attr[i]);if(c.li_attr.id||(c.li_attr.id=a),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(c.a_attr[i]=A.a_attr[i]);for(A&&A.children&&!0===A.children&&(c.state.loaded=!1,c.children=[],c.children_d=[]),B[c.id]=c,i=0,r=c.children.length;r>i;i++)o=p(B[c.children[i]],c.id,n),s=B[o],c.children_d.push(o),s.children_d.length&&(c.children_d=c.children_d.concat(s.children_d));return delete A.data,delete A.children,B[c.id].original=A,c.state.selected&&l.push(c.id),c.id},E=function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a,c=!1;do{c="j"+g+"_"+ ++h}while(B[c]);a={id:!1,text:"string"==typeof A?A:"",icon:"object"!=typeof A||A.icon===e||A.icon,parent:t,parents:n,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in u)u.hasOwnProperty(i)&&(a.state[i]=u[i]);if(A&&A.id&&(a.id=A.id.toString()),A&&A.text&&(a.text=A.text),A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(a.icon=A.data.jstree.icon),A&&A.data&&(a.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(a.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(a.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(a.li_attr[i]=A.li_attr[i]);if(a.li_attr.id&&!a.id&&(a.id=a.li_attr.id.toString()),a.id||(a.id=c),a.li_attr.id||(a.li_attr.id=a.id),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(a.a_attr[i]=A.a_attr[i]);if(A&&A.children&&A.children.length){for(i=0,r=A.children.length;r>i;i++)o=E(A.children[i],a.id,n),s=B[o],a.children.push(o),s.children_d.length&&(a.children_d=a.children_d.concat(s.children_d));a.children_d=a.children_d.concat(a.children)}return A&&A.children&&!0===A.children&&(a.state.loaded=!1,a.children=[],a.children_d=[]),delete A.data,delete A.children,a.original=A,B[a.id]=a,a.state.selected&&l.push(a.id),a.id};if(o.length&&o[0].id!==e&&o[0].parent!==e){for(n=0,i=o.length;i>n;n++)o[n].children||(o[n].children=[]),B[o[n].id.toString()]=o[n];for(n=0,i=o.length;i>n;n++)B[o[n].parent.toString()].children.push(o[n].id.toString()),d.children_d.push(o[n].id.toString());for(n=0,i=d.children.length;i>n;n++)t=p(B[d.children[n]],s,d.parents.concat()),c.push(t),B[t].children_d.length&&(c=c.concat(B[t].children_d));for(n=0,i=d.parents.length;i>n;n++)B[d.parents[n]].children_d=B[d.parents[n]].children_d.concat(c);r={cnt:h,mod:B,sel:Q,par:s,dpc:c,add:l}}else{for(n=0,i=o.length;i>n;n++)(t=E(o[n],s,d.parents.concat()))&&(a.push(t),c.push(t),B[t].children_d.length&&(c=c.concat(B[t].children_d)));for(d.children=a,d.children_d=c,n=0,i=d.parents.length;i>n;n++)B[d.parents[n]].children_d=B[d.parents[n]].children_d.concat(c);r={cnt:h,mod:B,sel:Q,par:s,dpc:c,add:l}}return"undefined"!=typeof window&&void 0!==window.document?r:void postMessage(r)},a=function(e,t){if(this._cnt=e.cnt,this._model.data=e.mod,t){var i,r,o=e.add,s=e.sel,a=this._data.core.selected.slice(),c=this._model.data;if(s.length!==a.length||A.vakata.array_unique(s.concat(a)).length!==s.length){for(i=0,r=s.length;r>i;i++)-1===A.inArray(s[i],o)&&-1===A.inArray(s[i],a)&&(c[s[i]].state.selected=!1);for(i=0,r=a.length;r>i;i++)-1===A.inArray(a[i],s)&&(c[a[i]].state.selected=!0)}}e.add.length&&(this._data.core.selected=this._data.core.selected.concat(e.add)),this.trigger("model",{nodes:e.dpc,parent:e.par}),"#"!==e.par?(this._node_changed(e.par),this.redraw()):this.redraw(!0),e.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),n.call(this,!0)};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+s.toString()],{type:"text/javascript"}))),!this._data.core.working||i?(this._data.core.working=!0,r=new window.Worker(this._wrk),r.onmessage=A.proxy(function(A){a.call(this,A.data,!0);try{r.terminate(),r=null}catch(A){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1},this),o.par?r.postMessage(o):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([e,t,n,!0])}catch(A){a.call(this,s(o),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else a.call(this,s(o),!1)},_parse_model_from_html:function(e,t,n){n=n?[].concat(n):[],t&&n.unshift(t);var i,r,o,s,a,c=this._model.data,l={id:!1,text:!1,icon:!0,parent:t,parents:n,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(o in this._model.default_state)this._model.default_state.hasOwnProperty(o)&&(l.state[o]=this._model.default_state[o]);if(s=A.vakata.attributes(e,!0),A.each(s,function(e,t){return t=A.trim(t),!t.length||(l.li_attr[e]=t,void("id"===e&&(l.id=t.toString())))}),s=e.children("a").first(),s.length&&(s=A.vakata.attributes(s,!0),A.each(s,function(e,t){t=A.trim(t),t.length&&(l.a_attr[e]=t)})),s=e.children("a").first().length?e.children("a").first().clone():e.clone(),s.children("ins, i, ul").remove(),s=s.html(),s=A("
    ").html(s),l.text=this.settings.core.force_text?s.text():s.html(),s=e.data(),l.data=s?A.extend(!0,{},s):null,l.state.opened=e.hasClass("jstree-open"),l.state.selected=e.children("a").hasClass("jstree-clicked"),l.state.disabled=e.children("a").hasClass("jstree-disabled"),l.data&&l.data.jstree)for(o in l.data.jstree)l.data.jstree.hasOwnProperty(o)&&(l.state[o]=l.data.jstree[o]);s=e.children("a").children(".jstree-themeicon"),s.length&&(l.icon=!s.hasClass("jstree-themeicon-hidden")&&s.attr("rel")),l.state.icon&&(l.icon=l.state.icon),s=e.children("ul").children("li");do{a="j"+this._id+"_"+ ++this._cnt}while(c[a]);return l.id=l.li_attr.id?l.li_attr.id.toString():a,s.length?(s.each(A.proxy(function(e,t){i=this._parse_model_from_html(A(t),l.id,n),r=this._model.data[i],l.children.push(i),r.children_d.length&&(l.children_d=l.children_d.concat(r.children_d))},this)),l.children_d=l.children_d.concat(l.children)):e.hasClass("jstree-closed")&&(l.state.loaded=!1),l.li_attr.class&&(l.li_attr.class=l.li_attr.class.replace("jstree-closed","").replace("jstree-open","")),l.a_attr.class&&(l.a_attr.class=l.a_attr.class.replace("jstree-clicked","").replace("jstree-disabled","")),c[l.id]=l,l.state.selected&&this._data.core.selected.push(l.id),l.id},_parse_model_from_flat_json:function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a=A.id.toString(),c=this._model.data,l=this._model.default_state,u={id:a,text:A.text||"",icon:A.icon===e||A.icon,parent:t,parents:n,children:A.children||[],children_d:A.children_d||[],data:A.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in l)l.hasOwnProperty(i)&&(u.state[i]=l[i]);if(A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(u.icon=A.data.jstree.icon),A&&A.data&&(u.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(u.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(u.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(u.li_attr[i]=A.li_attr[i]);if(u.li_attr.id||(u.li_attr.id=a),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(u.a_attr[i]=A.a_attr[i]);for(A&&A.children&&!0===A.children&&(u.state.loaded=!1,u.children=[],u.children_d=[]),c[u.id]=u,i=0,r=u.children.length;r>i;i++)o=this._parse_model_from_flat_json(c[u.children[i]],u.id,n),s=c[o],u.children_d.push(o),s.children_d.length&&(u.children_d=u.children_d.concat(s.children_d));return delete A.data,delete A.children,c[u.id].original=A,u.state.selected&&this._data.core.selected.push(u.id),u.id},_parse_model_from_json:function(A,t,n){n=n?n.concat():[],t&&n.unshift(t);var i,r,o,s,a,c=!1,l=this._model.data,u=this._model.default_state;do{c="j"+this._id+"_"+ ++this._cnt}while(l[c]);a={id:!1,text:"string"==typeof A?A:"",icon:"object"!=typeof A||A.icon===e||A.icon,parent:t,parents:n,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(i in u)u.hasOwnProperty(i)&&(a.state[i]=u[i]);if(A&&A.id&&(a.id=A.id.toString()),A&&A.text&&(a.text=A.text),A&&A.data&&A.data.jstree&&A.data.jstree.icon&&(a.icon=A.data.jstree.icon),A&&A.data&&(a.data=A.data,A.data.jstree))for(i in A.data.jstree)A.data.jstree.hasOwnProperty(i)&&(a.state[i]=A.data.jstree[i]);if(A&&"object"==typeof A.state)for(i in A.state)A.state.hasOwnProperty(i)&&(a.state[i]=A.state[i]);if(A&&"object"==typeof A.li_attr)for(i in A.li_attr)A.li_attr.hasOwnProperty(i)&&(a.li_attr[i]=A.li_attr[i]);if(a.li_attr.id&&!a.id&&(a.id=a.li_attr.id.toString()),a.id||(a.id=c),a.li_attr.id||(a.li_attr.id=a.id),A&&"object"==typeof A.a_attr)for(i in A.a_attr)A.a_attr.hasOwnProperty(i)&&(a.a_attr[i]=A.a_attr[i]);if(A&&A.children&&A.children.length){for(i=0,r=A.children.length;r>i;i++)o=this._parse_model_from_json(A.children[i],a.id,n),s=l[o],a.children.push(o),s.children_d.length&&(a.children_d=a.children_d.concat(s.children_d));a.children_d=a.children_d.concat(a.children)}return A&&A.children&&!0===A.children&&(a.state.loaded=!1,a.children=[],a.children_d=[]),delete A.data,delete A.children,a.original=A,l[a.id]=a,a.state.selected&&this._data.core.selected.push(a.id),a.id},_redraw:function(){var A,e,t,n=this._model.force_full_redraw?this._model.data["#"].children.concat([]):this._model.changed.concat([]),i=document.createElement("UL"),r=this._data.core.focused;for(e=0,t=n.length;t>e;e++)(A=this.redraw_node(n[e],!0,this._model.force_full_redraw))&&this._model.force_full_redraw&&i.appendChild(A);this._model.force_full_redraw&&(i.className=this.get_container_ul()[0].className,i.setAttribute("role","group"),this.element.empty().append(i)),null!==r&&(A=this.get_node(r,!0),A&&A.length&&A.children(".jstree-anchor")[0]!==document.activeElement?A.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:n})},redraw:function(A){A&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(A){var e=this.get_node(A),t=!1,n=!1,i=!1,r=document;if(!e)return!1;if("#"===e.id)return this.redraw(!0);if(!(A=this.get_node(A,!0))||!A.length)return!1;if(A.children(".jstree-children").remove(),A=A[0],e.children.length&&e.state.loaded){for(i=r.createElement("UL"),i.setAttribute("role","group"),i.className="jstree-children",t=0,n=e.children.length;n>t;t++)i.appendChild(this.redraw_node(e.children[t],!0,!0));A.appendChild(i)}},redraw_node:function(e,t,n,i){var r=this.get_node(e),o=!1,s=!1,a=!1,c=!1,l=!1,g=!1,h="",B=document,d=this._model.data,Q=!1,p=null,E=0,f=0;if(!r)return!1;if("#"===r.id)return this.redraw(!0);if(t=t||0===r.children.length,e=document.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(r.id[0])?"\\3"+r.id[0]+" "+r.id.substr(1).replace(A.jstree.idregex,"\\$&"):r.id.replace(A.jstree.idregex,"\\$&"))):document.getElementById(r.id))e=A(e),n||(o=e.parent().parent()[0],o===this.element[0]&&(o=null),s=e.index()),t||!r.children.length||e.children(".jstree-children").length||(t=!0),t||(a=e.children(".jstree-children")[0]),Q=e.children(".jstree-anchor")[0]===document.activeElement,e.remove();else if(t=!0,!n){if(!(null===(o="#"!==r.parent?A("#"+r.parent.replace(A.jstree.idregex,"\\$&"),this.element)[0]:null)||o&&d[r.parent].state.opened))return!1;s=A.inArray(r.id,null===o?d["#"].children:d[r.parent].children)}e=u.cloneNode(!0),h="jstree-node ";for(c in r.li_attr)if(r.li_attr.hasOwnProperty(c)){if("id"===c)continue;"class"!==c?e.setAttribute(c,r.li_attr[c]):h+=r.li_attr[c]}r.a_attr.id||(r.a_attr.id=r.id+"_anchor"),e.setAttribute("aria-selected",!!r.state.selected),e.setAttribute("aria-level",r.parents.length),e.setAttribute("aria-labelledby",r.a_attr.id),r.state.disabled&&e.setAttribute("aria-disabled",!0),r.state.loaded&&!r.children.length?h+=" jstree-leaf":(h+=r.state.opened&&r.state.loaded?" jstree-open":" jstree-closed",e.setAttribute("aria-expanded",r.state.opened&&r.state.loaded)),null!==r.parent&&d[r.parent].children[d[r.parent].children.length-1]===r.id&&(h+=" jstree-last"),e.id=r.id,e.className=h,h=(r.state.selected?" jstree-clicked":"")+(r.state.disabled?" jstree-disabled":"");for(l in r.a_attr)if(r.a_attr.hasOwnProperty(l)){if("href"===l&&"#"===r.a_attr[l])continue;"class"!==l?e.childNodes[1].setAttribute(l,r.a_attr[l]):h+=" "+r.a_attr[l]}if(h.length&&(e.childNodes[1].className="jstree-anchor "+h),(r.icon&&!0!==r.icon||!1===r.icon)&&(!1===r.icon?e.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===r.icon.indexOf("/")&&-1===r.icon.indexOf(".")?e.childNodes[1].childNodes[0].className+=" "+r.icon+" jstree-themeicon-custom":(e.childNodes[1].childNodes[0].style.backgroundImage="url("+r.icon+")",e.childNodes[1].childNodes[0].style.backgroundPosition="center center",e.childNodes[1].childNodes[0].style.backgroundSize="auto",e.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?e.childNodes[1].appendChild(B.createTextNode(r.text)):e.childNodes[1].innerHTML+=r.text,t&&r.children.length&&(r.state.opened||i)&&r.state.loaded){for(g=B.createElement("UL"),g.setAttribute("role","group"),g.className="jstree-children",c=0,l=r.children.length;l>c;c++)g.appendChild(this.redraw_node(r.children[c],t,!0));e.appendChild(g)}if(a&&e.appendChild(a),!n){for(o||(o=this.element[0]),c=0,l=o.childNodes.length;l>c;c++)if(o.childNodes[c]&&o.childNodes[c].className&&-1!==o.childNodes[c].className.indexOf("jstree-children")){p=o.childNodes[c];break}p||(p=B.createElement("UL"),p.setAttribute("role","group"),p.className="jstree-children",o.appendChild(p)),o=p,sr;r++)this.open_node(t[r],n,i);return!0}if(!(t=this.get_node(t))||"#"===t.id)return!1;if(i=i===e?this.settings.core.animation:i,!this.is_closed(t))return n&&n.call(this,t,!1),!1;if(this.is_loaded(t))s=this.get_node(t,!0),a=this,s.length&&(i&&s.children(".jstree-children").length&&s.children(".jstree-children").stop(!0,!0),t.children.length&&!this._firstChild(s.children(".jstree-children")[0])&&this.draw_children(t),i?(this.trigger("before_open",{node:t}),s.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(i,function(){this.style.display="",a.trigger("after_open",{node:t})})):(this.trigger("before_open",{node:t}),s[0].className=s[0].className.replace("jstree-closed","jstree-open"),s[0].setAttribute("aria-expanded",!0))),t.state.opened=!0,n&&n.call(this,t,!0),s.length||this.trigger("before_open",{node:t}),this.trigger("open_node",{node:t}),i&&s.length||this.trigger("after_open",{node:t});else{if(this.is_loading(t))return setTimeout(A.proxy(function(){this.open_node(t,n,i)},this),500);this.load_node(t,function(A,e){return e?this.open_node(A,n,i):!!n&&n.call(this,A,!1)})}},_open_to:function(e){if(!(e=this.get_node(e))||"#"===e.id)return!1;var t,n,i=e.parents;for(t=0,n=i.length;n>t;t+=1)"#"!==t&&this.open_node(i[t],!1,0);return A("#"+e.id.replace(A.jstree.idregex,"\\$&"),this.element)},close_node:function(t,n){var i,r,o,s;if(A.isArray(t)){for(t=t.slice(),i=0,r=t.length;r>i;i++)this.close_node(t[i],n);return!0}return!(!(t=this.get_node(t))||"#"===t.id)&&(!this.is_closed(t)&&(n=n===e?this.settings.core.animation:n,o=this,s=this.get_node(t,!0),s.length&&(n?s.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(n,function(){this.style.display="",s.children(".jstree-children").remove(),o.trigger("after_close",{node:t})}):(s[0].className=s[0].className.replace("jstree-open","jstree-closed"),s.attr("aria-expanded",!1).children(".jstree-children").remove())),t.state.opened=!1,this.trigger("close_node",{node:t}),void(n&&s.length||this.trigger("after_close",{node:t}))))},toggle_node:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.toggle_node(e[t]);return!0}return this.is_closed(e)?this.open_node(e):this.is_open(e)?this.close_node(e):void 0},open_all:function(A,e,t){if(A||(A="#"),!(A=this.get_node(A)))return!1;var n,i,r,o="#"===A.id?this.get_container_ul():this.get_node(A,!0);if(!o.length){for(n=0,i=A.children_d.length;i>n;n++)this.is_closed(this._model.data[A.children_d[n]])&&(this._model.data[A.children_d[n]].state.opened=!0);return this.trigger("open_all",{node:A})}t=t||o,r=this,o=this.is_closed(A)?o.find(".jstree-closed").addBack():o.find(".jstree-closed"),o.each(function(){r.open_node(this,function(A,n){n&&this.is_parent(A)&&this.open_all(A,e,t)},e||0)}),0===t.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(t)})},close_all:function(e,t){if(e||(e="#"),!(e=this.get_node(e)))return!1;var n,i,r="#"===e.id?this.get_container_ul():this.get_node(e,!0),o=this;if(!r.length){for(n=0,i=e.children_d.length;i>n;n++)this._model.data[e.children_d[n]].state.opened=!1;return this.trigger("close_all",{node:e})}r=this.is_open(e)?r.find(".jstree-open").addBack():r.find(".jstree-open"),A(r.get().reverse()).each(function(){o.close_node(this,t||0)}),this.trigger("close_all",{node:e})},is_disabled:function(A){return(A=this.get_node(A))&&A.state&&A.state.disabled},enable_node:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.enable_node(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(e.state.disabled=!1,this.get_node(e,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),void this.trigger("enable_node",{node:e}))},disable_node:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.disable_node(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(e.state.disabled=!0,this.get_node(e,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),void this.trigger("disable_node",{node:e}))},activate_node:function(A,t){if(this.is_disabled(A))return!1;if(this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==e?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null), +!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(t.metaKey||t.ctrlKey||t.shiftKey)&&(!t.shiftKey||this._data.core.last_clicked&&this.get_parent(A)&&this.get_parent(A)===this._data.core.last_clicked.parent))if(t.shiftKey){var n,i,r=this.get_node(A).id,o=this._data.core.last_clicked.id,s=this.get_node(this._data.core.last_clicked.parent).children,a=!1;for(n=0,i=s.length;i>n;n+=1)s[n]===r&&(a=!a),s[n]===o&&(a=!a),a||s[n]===r||s[n]===o?this.select_node(s[n],!0,!1,t):this.deselect_node(s[n],!0,t);this.trigger("changed",{action:"select_node",node:this.get_node(A),selected:this._data.core.selected,event:t})}else this.is_selected(A)?this.deselect_node(A,!1,t):this.select_node(A,!1,!1,t);else!this.settings.core.multiple&&(t.metaKey||t.ctrlKey||t.shiftKey)&&this.is_selected(A)?this.deselect_node(A,!1,t):(this.deselect_all(!0),this.select_node(A,!1,!1,t),this._data.core.last_clicked=this.get_node(A));this.trigger("activate_node",{node:this.get_node(A)})},hover_node:function(A){if(!(A=this.get_node(A,!0))||!A.length||A.children(".jstree-hovered").length)return!1;var e=this.element.find(".jstree-hovered"),t=this.element;e&&e.length&&this.dehover_node(e),A.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(A)}),setTimeout(function(){t.attr("aria-activedescendant",A[0].id)},0)},dehover_node:function(A){return!!((A=this.get_node(A,!0))&&A.length&&A.children(".jstree-hovered").length)&&(A.children(".jstree-anchor").removeClass("jstree-hovered"),void this.trigger("dehover_node",{node:this.get_node(A)}))},select_node:function(e,t,n,i){var r,o,s;if(A.isArray(e)){for(e=e.slice(),o=0,s=e.length;s>o;o++)this.select_node(e[o],t,n,i);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(r=this.get_node(e,!0),void(e.state.selected||(e.state.selected=!0,this._data.core.selected.push(e.id),n||(r=this._open_to(e)),r&&r.length&&r.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:e,selected:this._data.core.selected,event:i}),t||this.trigger("changed",{action:"select_node",node:e,selected:this._data.core.selected,event:i}))))},deselect_node:function(e,t,n){var i,r,o;if(A.isArray(e)){for(e=e.slice(),i=0,r=e.length;r>i;i++)this.deselect_node(e[i],t,n);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(o=this.get_node(e,!0),void(e.state.selected&&(e.state.selected=!1,this._data.core.selected=A.vakata.array_remove_item(this._data.core.selected,e.id),o.length&&o.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:e,selected:this._data.core.selected,event:n}),t||this.trigger("changed",{action:"deselect_node",node:e,selected:this._data.core.selected,event:n}))))},select_all:function(A){var e,t,n=this._data.core.selected.concat([]);for(this._data.core.selected=this._model.data["#"].children_d.concat(),e=0,t=this._data.core.selected.length;t>e;e++)this._model.data[this._data.core.selected[e]]&&(this._model.data[this._data.core.selected[e]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),A||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:n})},deselect_all:function(A){var e,t,n=this._data.core.selected.concat([]);for(e=0,t=this._data.core.selected.length;t>e;e++)this._model.data[this._data.core.selected[e]]&&(this._model.data[this._data.core.selected[e]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:n}),A||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:n})},is_selected:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.state.selected},get_selected:function(e){return e?A.map(this._data.core.selected,A.proxy(function(A){return this.get_node(A)},this)):this._data.core.selected.slice()},get_top_selected:function(e){var t,n,i,r,o=this.get_selected(!0),s={};for(t=0,n=o.length;n>t;t++)s[o[t].id]=o[t];for(t=0,n=o.length;n>t;t++)for(i=0,r=o[t].children_d.length;r>i;i++)s[o[t].children_d[i]]&&delete s[o[t].children_d[i]];o=[];for(t in s)s.hasOwnProperty(t)&&o.push(t);return e?A.map(o,A.proxy(function(A){return this.get_node(A)},this)):o},get_bottom_selected:function(e){var t,n,i=this.get_selected(!0),r=[];for(t=0,n=i.length;n>t;t++)i[t].children.length||r.push(i[t].id);return e?A.map(r,A.proxy(function(A){return this.get_node(A)},this)):r},get_state:function(){var A,e={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},selected:[]}};for(A in this._model.data)this._model.data.hasOwnProperty(A)&&"#"!==A&&(this._model.data[A].state.opened&&e.core.open.push(A),this._model.data[A].state.selected&&e.core.selected.push(A));return e},set_state:function(t,n){if(t){if(t.core){var i,r,o,s;if(t.core.open)return A.isArray(t.core.open)?(i=!0,r=!1,o=this,A.each(t.core.open.concat([]),function(e,s){(r=o.get_node(s))&&(o.is_loaded(s)?(o.is_closed(s)&&o.open_node(s,!1,0),t&&t.core&&t.core.open&&A.vakata.array_remove_item(t.core.open,s)):(o.is_loading(s)||o.open_node(s,A.proxy(function(e,i){!i&&t&&t.core&&t.core.open&&A.vakata.array_remove_item(t.core.open,e.id),this.set_state(t,n)},o),0),i=!1))}),i&&(delete t.core.open,this.set_state(t,n)),!1):(delete t.core.open,this.set_state(t,n),!1);if(t.core.scroll)return t.core.scroll&&t.core.scroll.left!==e&&this.element.scrollLeft(t.core.scroll.left),t.core.scroll&&t.core.scroll.top!==e&&this.element.scrollTop(t.core.scroll.top),delete t.core.scroll,this.set_state(t,n),!1;if(t.core.selected)return s=this,this.deselect_all(),A.each(t.core.selected,function(A,e){s.select_node(e)}),delete t.core.selected,this.set_state(t,n),!1;if(A.isEmptyObject(t.core))return delete t.core,this.set_state(t,n),!1}return!A.isEmptyObject(t)||(t=null,n&&n.call(this),this.trigger("set_state"),!1)}return!1},refresh:function(e,t){this._data.core.state=!0===t?{}:this.get_state(),t&&A.isFunction(t)&&(this._data.core.state=t.call(this,this._data.core.state)),this._cnt=0,this._model.data={"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}};var n=this.get_container_ul()[0].className;e||(this.element.html(""),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node("#",function(e,t){t&&(this.get_container_ul()[0].className=n,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(A.extend(!0,{},this._data.core.state),function(){this.trigger("refresh")})),this._data.core.state=null})},refresh_node:function(e){if(!(e=this.get_node(e))||"#"===e.id)return!1;var t=[],n=[];this._data.core.selected.concat([]);n.push(e.id),!0===e.state.opened&&t.push(e.id),this.get_node(e,!0).find(".jstree-open").each(function(){t.push(this.id)}),this._load_nodes(n,A.proxy(function(A){this.open_node(t,!1,0),this.select_node(this._data.core.selected),this.trigger("refresh_node",{node:e,nodes:A})},this))},set_id:function(e,t){if(!(e=this.get_node(e))||"#"===e.id)return!1;var n,i,r=this._model.data;for(t=t.toString(),r[e.parent].children[A.inArray(e.id,r[e.parent].children)]=t,n=0,i=e.parents.length;i>n;n++)r[e.parents[n]].children_d[A.inArray(e.id,r[e.parents[n]].children_d)]=t;for(n=0,i=e.children.length;i>n;n++)r[e.children[n]].parent=t;for(n=0,i=e.children_d.length;i>n;n++)r[e.children_d[n]].parents[A.inArray(e.id,r[e.children_d[n]].parents)]=t;return n=A.inArray(e.id,this._data.core.selected),-1!==n&&(this._data.core.selected[n]=t),n=this.get_node(e.id,!0),n&&n.attr("id",t),delete r[e.id],e.id=t,r[t]=e,!0},get_text:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.text},set_text:function(e,t){var n,i;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.set_text(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(e.text=t,this.get_node(e,!0).length&&this.redraw_node(e.id),this.trigger("set_text",{obj:e,text:t}),!0)},get_json:function(e,t,n){if(!(e=this.get_node(e||"#")))return!1;t&&t.flat&&!n&&(n=[]);var i,r,o={id:e.id,text:e.text,icon:this.get_icon(e),li_attr:A.extend(!0,{},e.li_attr),a_attr:A.extend(!0,{},e.a_attr),state:{},data:(!t||!t.no_data)&&A.extend(!0,{},e.data)};if(t&&t.flat?o.parent=e.parent:o.children=[],!t||!t.no_state)for(i in e.state)e.state.hasOwnProperty(i)&&(o.state[i]=e.state[i]);if(t&&t.no_id&&(delete o.id,o.li_attr&&o.li_attr.id&&delete o.li_attr.id,o.a_attr&&o.a_attr.id&&delete o.a_attr.id),t&&t.flat&&"#"!==e.id&&n.push(o),!t||!t.no_children)for(i=0,r=e.children.length;r>i;i++)t&&t.flat?this.get_json(e.children[i],t,n):o.children.push(this.get_json(e.children[i],t));return t&&t.flat?n:"#"===e.id?o.children:o},create_node:function(t,n,i,r,o){if(null===t&&(t="#"),!(t=this.get_node(t)))return!1;if(i=i===e?"last":i,!i.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(t))return this.load_node(t,function(){this.create_node(t,n,i,r,!0)});n||(n={text:this.get_string("New node")}),"string"==typeof n&&(n={text:n}),n.text===e&&(n.text=this.get_string("New node"));var s,a,c,l;switch("#"===t.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":s=this.get_node(t.parent),i=A.inArray(t.id,s.children),t=s;break;case"after":s=this.get_node(t.parent),i=A.inArray(t.id,s.children)+1,t=s;break;case"inside":case"first":i=0;break;case"last":i=t.children.length;break;default:i||(i=0)}if(i>t.children.length&&(i=t.children.length),n.id||(n.id=!0),!this.check("create_node",n,t,i))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!0===n.id&&delete n.id,!(n=this._parse_model_from_json(n,t.id,t.parents.concat())))return!1;for(s=this.get_node(n),a=[],a.push(n),a=a.concat(s.children_d),this.trigger("model",{nodes:a,parent:t.id}),t.children_d=t.children_d.concat(a),c=0,l=t.parents.length;l>c;c++)this._model.data[t.parents[c]].children_d=this._model.data[t.parents[c]].children_d.concat(a);for(n=s,s=[],c=0,l=t.children.length;l>c;c++)s[c>=i?c+1:c]=t.children[c];return s[i]=n.id,t.children=s,this.redraw_node(t,!0),r&&r.call(this,this.get_node(n)),this.trigger("create_node",{node:this.get_node(n),parent:t.id,position:i}),n.id},rename_node:function(e,t){var n,i,r;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.rename_node(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(r=e.text,this.check("rename_node",e,this.get_parent(e),t)?(this.set_text(e,t),this.trigger("rename_node",{node:e,text:t,old:r}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1))},delete_node:function(e){var t,n,i,r,o,s,a,c,l,u;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.delete_node(e[t]);return!0}if(!(e=this.get_node(e))||"#"===e.id)return!1;if(i=this.get_node(e.parent),r=A.inArray(e.id,i.children),u=!1,!this.check("delete_node",e,i,r))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==r&&(i.children=A.vakata.array_remove(i.children,r)),o=e.children_d.concat([]),o.push(e.id),c=0,l=o.length;l>c;c++){for(s=0,a=e.parents.length;a>s;s++)-1!==(r=A.inArray(o[c],this._model.data[e.parents[s]].children_d))&&(this._model.data[e.parents[s]].children_d=A.vakata.array_remove(this._model.data[e.parents[s]].children_d,r));this._model.data[o[c]].state.selected&&(u=!0,-1!==(r=A.inArray(o[c],this._data.core.selected))&&(this._data.core.selected=A.vakata.array_remove(this._data.core.selected,r)))}for(this.trigger("delete_node",{node:e,parent:i.id}),u&&this.trigger("changed",{action:"delete_node",node:e,selected:this._data.core.selected,parent:i.id}),c=0,l=o.length;l>c;c++)delete this._model.data[o[c]];return this.redraw_node(i,!0),!0},check:function(e,t,n,i,r){t=t&&t.id?t:this.get_node(t),n=n&&n.id?n:this.get_node(n);var o=e.match(/^move_node|copy_node|create_node$/i)?n:t,s=this.settings.core.check_callback;return"move_node"!==e&&"copy_node"!==e||r&&r.is_multi||t.id!==n.id&&A.inArray(t.id,n.children)!==i&&-1===A.inArray(n.id,t.children_d)?(o&&o.data&&(o=o.data),o&&o.functions&&(!1===o.functions[e]||!0===o.functions[e])?(!1===o.functions[e]&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!n||!n.id)&&n.id})}),o.functions[e]):!(!1===s||A.isFunction(s)&&!1===s.call(this,e,t,n,i,r)||s&&!1===s[e])||(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+e,data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!n||!n.id)&&n.id})},!1)):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:e,pos:i,obj:!(!t||!t.id)&&t.id,par:!(!n||!n.id)&&n.id})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(t,n,i,r,o,s){var a,c,l,u,g,h,B,d,Q,p,E,f,C,w;if(n=this.get_node(n),i=i===e?0:i,!n)return!1;if(!i.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(n))return this.load_node(n,function(){this.move_node(t,n,i,r,!0)});if(A.isArray(t)){for(t=t.slice(),a=0,c=t.length;c>a;a++)this.move_node(t[a],n,i,r,o,!0)&&(n=t[a],i="after");return this.redraw(),!0}if(!(t=t&&t.id?t:this.get_node(t))||"#"===t.id)return!1;if(l=(t.parent||"#").toString(),g=i.toString().match(/^(before|after)$/)&&"#"!==n.id?this.get_node(n.parent):n,h=t.instance?t.instance:this._model.data[t.id]?this:A.jstree.reference(t.id),B=!h||!h._id||this._id!==h._id,u=h&&h._id&&l&&h._model.data[l]&&h._model.data[l].children?A.inArray(t.id,h._model.data[l].children):-1,B)return!!this.copy_node(t,n,i,r,o)&&(h&&h.delete_node(t),!0);switch("#"===n.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":i=A.inArray(n.id,g.children);break;case"after":i=A.inArray(n.id,g.children)+1;break;case"inside":case"first":i=0;break;case"last":i=g.children.length;break;default:i||(i=0)}if(i>g.children.length&&(i=g.children.length),!this.check("move_node",t,g,i,{core:!0,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(t.parent===g.id){for(d=g.children.concat(),Q=A.inArray(t.id,d),-1!==Q&&(d=A.vakata.array_remove(d,Q),i>Q&&i--),Q=[],p=0,E=d.length;E>p;p++)Q[p>=i?p+1:p]=d[p];Q[i]=t.id,g.children=Q,this._node_changed(g.id),this.redraw("#"===g.id)}else{for(Q=t.children_d.concat(),Q.push(t.id),p=0,E=t.parents.length;E>p;p++){for(d=[],w=h._model.data[t.parents[p]].children_d,f=0,C=w.length;C>f;f++)-1===A.inArray(w[f],Q)&&d.push(w[f]);h._model.data[t.parents[p]].children_d=d}for(h._model.data[l].children=A.vakata.array_remove_item(h._model.data[l].children,t.id),p=0,E=g.parents.length;E>p;p++)this._model.data[g.parents[p]].children_d=this._model.data[g.parents[p]].children_d.concat(Q);for(d=[],p=0,E=g.children.length;E>p;p++)d[p>=i?p+1:p]=g.children[p];for(d[i]=t.id,g.children=d,g.children_d.push(t.id),g.children_d=g.children_d.concat(t.children_d),t.parent=g.id,Q=g.parents.concat(),Q.unshift(g.id),w=t.parents.length,t.parents=Q,Q=Q.concat(),p=0,E=t.children_d.length;E>p;p++)this._model.data[t.children_d[p]].parents=this._model.data[t.children_d[p]].parents.slice(0,-1*w),Array.prototype.push.apply(this._model.data[t.children_d[p]].parents,Q);("#"===l||"#"===g.id)&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(l),this._node_changed(g.id)),s||this.redraw()}return r&&r.call(this,t,g,i),this.trigger("move_node",{node:t,parent:g.id,position:i,old_parent:l,old_position:u,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id,old_instance:h,new_instance:this}),!0},copy_node:function(t,n,i,r,o,s){var a,c,l,u,g,h,B,d,Q,p;if(n=this.get_node(n),i=i===e?0:i,!n)return!1;if(!i.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(n))return this.load_node(n,function(){this.copy_node(t,n,i,r,!0)});if(A.isArray(t)){for(t=t.slice(),a=0,c=t.length;c>a;a++)(u=this.copy_node(t[a],n,i,r,o,!0))&&(n=u,i="after");return this.redraw(),!0}if(!(t=t&&t.id?t:this.get_node(t))||"#"===t.id)return!1;switch(d=(t.parent||"#").toString(),Q=i.toString().match(/^(before|after)$/)&&"#"!==n.id?this.get_node(n.parent):n,p=t.instance?t.instance:this._model.data[t.id]?this:A.jstree.reference(t.id),!p||!p._id||this._id!==p._id,"#"===n.id&&("before"===i&&(i="first"),"after"===i&&(i="last")),i){case"before":i=A.inArray(n.id,Q.children);break;case"after":i=A.inArray(n.id,Q.children)+1;break;case"inside":case"first":i=0;break;case"last":i=Q.children.length;break;default:i||(i=0)}if(i>Q.children.length&&(i=Q.children.length),!this.check("copy_node",t,Q,i,{core:!0,is_multi:p&&p._id&&p._id!==this._id,is_foreign:!p||!p._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!(B=p?p.get_json(t,{no_id:!0,no_data:!0,no_state:!0}):t))return!1;if(!0===B.id&&delete B.id,!(B=this._parse_model_from_json(B,Q.id,Q.parents.concat())))return!1;for(u=this.get_node(B),t&&t.state&&!1===t.state.loaded&&(u.state.loaded=!1),l=[],l.push(B),l=l.concat(u.children_d),this.trigger("model",{nodes:l,parent:Q.id}),g=0,h=Q.parents.length;h>g;g++)this._model.data[Q.parents[g]].children_d=this._model.data[Q.parents[g]].children_d.concat(l);for(l=[],g=0,h=Q.children.length;h>g;g++)l[g>=i?g+1:g]=Q.children[g];return l[i]=u.id,Q.children=l,Q.children_d.push(u.id),Q.children_d=Q.children_d.concat(u.children_d),"#"===Q.id&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(Q.id),s||this.redraw("#"===Q.id),r&&r.call(this,u,Q,i),this.trigger("copy_node",{node:u,original:t,parent:Q.id,position:i,old_parent:d,old_position:p&&p._id&&d&&p._model.data[d]&&p._model.data[d].children?A.inArray(t.id,p._model.data[d].children):-1,is_multi:p&&p._id&&p._id!==this._id,is_foreign:!p||!p._id,old_instance:p,new_instance:this}),u.id},cut:function(e){if(e||(e=this._data.core.selected.concat()),A.isArray(e)||(e=[e]),!e.length)return!1;var t,n,i,a=[];for(n=0,i=e.length;i>n;n++)(t=this.get_node(e[n]))&&t.id&&"#"!==t.id&&a.push(t);return!!a.length&&(r=a,s=this,o="move_node",void this.trigger("cut",{node:e}))},copy:function(e){if(e||(e=this._data.core.selected.concat()),A.isArray(e)||(e=[e]),!e.length)return!1;var t,n,i,a=[];for(n=0,i=e.length;i>n;n++)(t=this.get_node(e[n]))&&t.id&&"#"!==t.id&&a.push(t);return!!a.length&&(r=a,s=this,o="copy_node",void this.trigger("copy",{node:e}))},get_buffer:function(){return{mode:o,node:r,inst:s}},can_paste:function(){return!1!==o&&!1!==r},paste:function(A,e){return!!((A=this.get_node(A))&&o&&o.match(/^(copy_node|move_node)$/)&&r)&&(this[o](r,A,e)&&this.trigger("paste",{parent:A.id,node:r,mode:o}),r=!1,o=!1,void(s=!1))},clear_buffer:function(){r=!1,o=!1,s=!1,this.trigger("clear_buffer")},edit:function(e,t){if(!(e=this.get_node(e)))return!1;if(!1===this.settings.core.check_callback)return this._data.core.last_error={error:"check",plugin:"core",id:"core_07",reason:"Could not edit node because of check_callback"},this.settings.core.error.call(this,this._data.core.last_error),!1;t="string"==typeof t?t:e.text,this.set_text(e,""),e=this._open_to(e);var n=this._data.core.rtl,i=this.element.width(),r=e.children(".jstree-anchor"),o=A(""),s=t,a=A("
    ",{css:{position:"absolute",top:"-200px",left:n?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),c=A("",{value:s,class:"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:A.proxy(function(){var t=o.children(".jstree-rename-input"),n=t.val();""===n&&(n=s),a.remove(),o.replaceWith(r),o.remove(),this.set_text(e,s),!1===this.rename_node(e,A("
    ").text(n)[this.settings.core.force_text?"text":"html"]())&&this.set_text(e,s)},this),keydown:function(A){var e=A.which;27===e&&(this.value=s),(27===e||13===e||37===e||38===e||39===e||40===e||32===e)&&A.stopImmediatePropagation(),(27===e||13===e)&&(A.preventDefault(),this.blur())},click:function(A){A.stopImmediatePropagation()},mousedown:function(A){A.stopImmediatePropagation()},keyup:function(A){c.width(Math.min(a.text("pW"+this.value).width(),i))},keypress:function(A){return 13!==A.which&&void 0}}),l={fontFamily:r.css("fontFamily")||"",fontSize:r.css("fontSize")||"",fontWeight:r.css("fontWeight")||"",fontStyle:r.css("fontStyle")||"",fontStretch:r.css("fontStretch")||"",fontVariant:r.css("fontVariant")||"",letterSpacing:r.css("letterSpacing")||"",wordSpacing:r.css("wordSpacing")||""};o.attr("class",r.attr("class")).append(r.contents().clone()).append(c),r.replaceWith(o),a.css(l),c.css(l).width(Math.min(a.text("pW"+c[0].value).width(),i))[0].select()},set_theme:function(e,t){if(!e)return!1;if(!0===t){var n=this.settings.core.themes.dir;n||(n=A.jstree.path+"/themes"),t=n+"/"+e+"/style.css"}t&&-1===A.inArray(t,a)&&(A("head").append(''),a.push(t)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=e,this.element.addClass("jstree-"+e),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+e+"-responsive"),this.trigger("set_theme",{theme:e})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(A){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=A,A&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(e,t){var n,i,r,o;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.set_icon(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(o=e.icon,e.icon=t,r=this.get_node(e,!0).children(".jstree-anchor").children(".jstree-themeicon"),!1===t?this.hide_icon(e):!0===t?(r.removeClass("jstree-themeicon-custom "+o).css("background","").removeAttr("rel"),!1===o&&this.show_icon(e)):-1===t.indexOf("/")&&-1===t.indexOf(".")?(r.removeClass(o).css("background",""),r.addClass(t+" jstree-themeicon-custom").attr("rel",t),!1===o&&this.show_icon(e)):(r.removeClass(o).css("background",""),r.addClass("jstree-themeicon-custom").css("background","url('"+t+"') center center no-repeat").attr("rel",t),!1===o&&this.show_icon(e)),!0)},get_icon:function(A){return!(!(A=this.get_node(A))||"#"===A.id)&&A.icon},hide_icon:function(e){var t,n;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.hide_icon(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e)&&(e.icon=!1,this.get_node(e,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0)},show_icon:function(e){var t,n,i;if(A.isArray(e)){for(e=e.slice(),t=0,n=e.length;n>t;t++)this.show_icon(e[t]);return!0}return!(!(e=this.get_node(e))||"#"===e)&&(i=this.get_node(e,!0),e.icon=!i.length||i.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"),e.icon||(e.icon=!0),i.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0)}},A.vakata={},A.vakata.attributes=function(e,t){e=A(e)[0];var n=t?{}:[];return e&&e.attributes&&A.each(e.attributes,function(e,i){-1===A.inArray(i.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==i.value&&""!==A.trim(i.value)&&(t?n[i.name]=i.value:n.push(i.name))}),n},A.vakata.array_unique=function(A){var e,t,n,i=[];for(e=0,n=A.length;n>e;e++){for(t=0;e>=t&&A[e]!==A[t];t++);t===e&&i.push(A[e])}return i},A.vakata.array_remove=function(A,e,t){var n=A.slice((t||e)+1||A.length);return A.length=0>e?A.length+e:e,A.push.apply(A,n),A},A.vakata.array_remove_item=function(e,t){var n=A.inArray(t,e);return-1!==n?A.vakata.array_remove(e,n):e};var g=document.createElement("I");g.className="jstree-icon jstree-checkbox",g.setAttribute("role","presentation"),A.jstree.defaults.checkbox={visible:!0,three_state:!0,whole_node:!0,keep_selected_style:!0,cascade:"",tie_selection:!0},A.jstree.plugins.checkbox=function(e,t){this.bind=function(){t.bind.call(this),this._data.checkbox.uto=!1,this._data.checkbox.selected=[],this.settings.checkbox.three_state&&(this.settings.checkbox.cascade="up+down+undetermined"),this.element.on("init.jstree",A.proxy(function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.tie_selection&&this.element.addClass("jstree-checkbox-selection")},this)).on("loading.jstree",A.proxy(function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()},this)),-1!==this.settings.checkbox.cascade.indexOf("undetermined")&&this.element.on("changed.jstree uncheck_node.jstree check_node.jstree uncheck_all.jstree check_all.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree",A.proxy(function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(A.proxy(this._undetermined,this),50)},this)),this.settings.checkbox.tie_selection||this.element.on("model.jstree",A.proxy(function(A,e){var t,n,i=this._model.data,r=(i[e.parent],e.nodes);for(t=0,n=r.length;n>t;t++)i[r[t]].state.checked=i[r[t]].original&&i[r[t]].original.state&&i[r[t]].original.state.checked,i[r[t]].state.checked&&this._data.checkbox.selected.push(r[t])},this)),(-1!==this.settings.checkbox.cascade.indexOf("up")||-1!==this.settings.checkbox.cascade.indexOf("down"))&&this.element.on("model.jstree",A.proxy(function(e,t){var n,i,r,o,s,a,c=this._model.data,l=c[t.parent],u=t.nodes,g=[],h=this.settings.checkbox.cascade,B=this.settings.checkbox.tie_selection;if(-1!==h.indexOf("down"))if(l.state[B?"selected":"checked"]){for(i=0,r=u.length;r>i;i++)c[u[i]].state[B?"selected":"checked"]=!0;this._data[B?"core":"checkbox"].selected=this._data[B?"core":"checkbox"].selected.concat(u)}else for(i=0,r=u.length;r>i;i++)if(c[u[i]].state[B?"selected":"checked"]){for(o=0,s=c[u[i]].children_d.length;s>o;o++)c[c[u[i]].children_d[o]].state[B?"selected":"checked"]=!0;this._data[B?"core":"checkbox"].selected=this._data[B?"core":"checkbox"].selected.concat(c[u[i]].children_d)}if(-1!==h.indexOf("up")){for(i=0,r=l.children_d.length;r>i;i++)c[l.children_d[i]].children.length||g.push(c[l.children_d[i]].parent);for(g=A.vakata.array_unique(g),o=0,s=g.length;s>o;o++)for(l=c[g[o]];l&&"#"!==l.id;){for(n=0,i=0,r=l.children.length;r>i;i++)n+=c[l.children[i]].state[B?"selected":"checked"];if(n!==r)break;l.state[B?"selected":"checked"]=!0,this._data[B?"core":"checkbox"].selected.push(l.id),a=this.get_node(l,!0),a&&a.length&&a.attr("aria-selected",!0).children(".jstree-anchor").addClass(B?"jstree-clicked":"jstree-checked"),l=this.get_node(l.parent)}}this._data[B?"core":"checkbox"].selected=A.vakata.array_unique(this._data[B?"core":"checkbox"].selected)},this)).on(this.settings.checkbox.tie_selection?"select_node.jstree":"check_node.jstree",A.proxy(function(e,t){var n,i,r,o,s=t.node,a=this._model.data,c=this.get_node(s.parent),l=this.get_node(s,!0),u=this.settings.checkbox.cascade,g=this.settings.checkbox.tie_selection;if(-1!==u.indexOf("down"))for(this._data[g?"core":"checkbox"].selected=A.vakata.array_unique(this._data[g?"core":"checkbox"].selected.concat(s.children_d)),n=0,i=s.children_d.length;i>n;n++)o=a[s.children_d[n]],o.state[g?"selected":"checked"]=!0,o&&o.original&&o.original.state&&o.original.state.undetermined&&(o.original.state.undetermined=!1);if(-1!==u.indexOf("up"))for(;c&&"#"!==c.id;){for(r=0,n=0,i=c.children.length;i>n;n++)r+=a[c.children[n]].state[g?"selected":"checked"];if(r!==i)break;c.state[g?"selected":"checked"]=!0,this._data[g?"core":"checkbox"].selected.push(c.id),o=this.get_node(c,!0),o&&o.length&&o.attr("aria-selected",!0).children(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked"),c=this.get_node(c.parent)}-1!==u.indexOf("down")&&l.length&&l.find(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!0)},this)).on(this.settings.checkbox.tie_selection?"deselect_all.jstree":"uncheck_all.jstree",A.proxy(function(A,e){var t,n,i,r=this.get_node("#"),o=this._model.data;for(t=0,n=r.children_d.length;n>t;t++)(i=o[r.children_d[t]])&&i.original&&i.original.state&&i.original.state.undetermined&&(i.original.state.undetermined=!1)},this)).on(this.settings.checkbox.tie_selection?"deselect_node.jstree":"uncheck_node.jstree",A.proxy(function(e,t){var n,i,r,o=t.node,s=this.get_node(o,!0),a=this.settings.checkbox.cascade,c=this.settings.checkbox.tie_selection;if(o&&o.original&&o.original.state&&o.original.state.undetermined&&(o.original.state.undetermined=!1),-1!==a.indexOf("down"))for(n=0,i=o.children_d.length;i>n;n++)r=this._model.data[o.children_d[n]],r.state[c?"selected":"checked"]=!1,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1);if(-1!==a.indexOf("up"))for(n=0,i=o.parents.length;i>n;n++)r=this._model.data[o.parents[n]],r.state[c?"selected":"checked"]=!1,r&&r.original&&r.original.state&&r.original.state.undetermined&&(r.original.state.undetermined=!1),(r=this.get_node(o.parents[n],!0))&&r.length&&r.attr("aria-selected",!1).children(".jstree-anchor").removeClass(c?"jstree-clicked":"jstree-checked");for(r=[],n=0,i=this._data[c?"core":"checkbox"].selected.length;i>n;n++)-1!==a.indexOf("down")&&-1!==A.inArray(this._data[c?"core":"checkbox"].selected[n],o.children_d)||-1!==a.indexOf("up")&&-1!==A.inArray(this._data[c?"core":"checkbox"].selected[n],o.parents)||r.push(this._data[c?"core":"checkbox"].selected[n]);this._data[c?"core":"checkbox"].selected=A.vakata.array_unique(r),-1!==a.indexOf("down")&&s.length&&s.find(".jstree-anchor").removeClass(c?"jstree-clicked":"jstree-checked").parent().attr("aria-selected",!1)},this)),-1!==this.settings.checkbox.cascade.indexOf("up")&&this.element.on("delete_node.jstree",A.proxy(function(A,e){for(var t,n,i,r,o=this.get_node(e.parent),s=this._model.data,a=this.settings.checkbox.tie_selection;o&&"#"!==o.id;){for(i=0,t=0,n=o.children.length;n>t;t++)i+=s[o.children[t]].state[a?"selected":"checked"];if(i!==n)break;o.state[a?"selected":"checked"]=!0,this._data[a?"core":"checkbox"].selected.push(o.id),r=this.get_node(o,!0),r&&r.length&&r.attr("aria-selected",!0).children(".jstree-anchor").addClass(a?"jstree-clicked":"jstree-checked"),o=this.get_node(o.parent)}},this)).on("move_node.jstree",A.proxy(function(e,t){ +var n,i,r,o,s,a=t.is_multi,c=t.old_parent,l=this.get_node(t.parent),u=this._model.data,g=this.settings.checkbox.tie_selection;if(!a)for(n=this.get_node(c);n&&"#"!==n.id;){for(i=0,r=0,o=n.children.length;o>r;r++)i+=u[n.children[r]].state[g?"selected":"checked"];if(i!==o)break;n.state[g?"selected":"checked"]=!0,this._data[g?"core":"checkbox"].selected.push(n.id),s=this.get_node(n,!0),s&&s.length&&s.attr("aria-selected",!0).children(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked"),n=this.get_node(n.parent)}for(n=l;n&&"#"!==n.id;){for(i=0,r=0,o=n.children.length;o>r;r++)i+=u[n.children[r]].state[g?"selected":"checked"];if(i===o)n.state[g?"selected":"checked"]||(n.state[g?"selected":"checked"]=!0,this._data[g?"core":"checkbox"].selected.push(n.id),(s=this.get_node(n,!0))&&s.length&&s.attr("aria-selected",!0).children(".jstree-anchor").addClass(g?"jstree-clicked":"jstree-checked"));else{if(!n.state[g?"selected":"checked"])break;n.state[g?"selected":"checked"]=!1,this._data[g?"core":"checkbox"].selected=A.vakata.array_remove_item(this._data[g?"core":"checkbox"].selected,n.id),(s=this.get_node(n,!0))&&s.length&&s.attr("aria-selected",!1).children(".jstree-anchor").removeClass(g?"jstree-clicked":"jstree-checked")}n=this.get_node(n.parent)}},this))},this._undetermined=function(){var e,t,n=this._model.data,i=this.settings.checkbox.tie_selection,r=this._data[i?"core":"checkbox"].selected,o=[],s=this;for(e=0,t=r.length;t>e;e++)n[r[e]]&&n[r[e]].parents&&(o=o.concat(n[r[e]].parents));for(this.element.find(".jstree-closed").not(":has(.jstree-children)").each(function(){var A,i=s.get_node(this);if(i.state.loaded)for(e=0,t=i.children_d.length;t>e;e++)A=n[i.children_d[e]],!A.state.loaded&&A.original&&A.original.state&&A.original.state.undetermined&&!0===A.original.state.undetermined&&(o.push(A.id),o=o.concat(A.parents));else i.original&&i.original.state&&i.original.state.undetermined&&!0===i.original.state.undetermined&&(o.push(i.id),o=o.concat(i.parents))}),o=A.vakata.array_unique(o),o=A.vakata.array_remove_item(o,"#"),this.element.find(".jstree-undetermined").removeClass("jstree-undetermined"),e=0,t=o.length;t>e;e++)n[o[e]].state[i?"selected":"checked"]||(r=this.get_node(o[e],!0))&&r.length&&r.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined")},this.redraw_node=function(e,n,i,r){if(e=t.redraw_node.apply(this,arguments)){var o,s,a=null;for(o=0,s=e.childNodes.length;s>o;o++)if(e.childNodes[o]&&e.childNodes[o].className&&-1!==e.childNodes[o].className.indexOf("jstree-anchor")){a=e.childNodes[o];break}a&&(!this.settings.checkbox.tie_selection&&this._model.data[e.id].state.checked&&(a.className+=" jstree-checked"),a.insertBefore(g.cloneNode(!1),a.childNodes[0]))}return i||-1===this.settings.checkbox.cascade.indexOf("undetermined")||(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(A.proxy(this._undetermined,this),50)),e},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()},this.is_undetermined=function(e){e=this.get_node(e);var t,n,i=this.settings.checkbox.cascade,r=this.settings.checkbox.tie_selection,o=this._data[r?"core":"checkbox"].selected,s=this._model.data;if(!e||!0===e.state[r?"selected":"checked"]||-1===i.indexOf("undetermined")||-1===i.indexOf("down")&&-1===i.indexOf("up"))return!1;if(!e.state.loaded&&!0===e.original.state.undetermined)return!0;for(t=0,n=e.children_d.length;n>t;t++)if(-1!==A.inArray(e.children_d[t],o)||!s[e.children_d[t]].state.loaded&&s[e.children_d[t]].original.state.undetermined)return!0;return!1},this.activate_node=function(e,n){return this.settings.checkbox.tie_selection&&(this.settings.checkbox.whole_node||A(n.target).hasClass("jstree-checkbox"))&&(n.ctrlKey=!0),this.settings.checkbox.tie_selection||!this.settings.checkbox.whole_node&&!A(n.target).hasClass("jstree-checkbox")?t.activate_node.call(this,e,n):!this.is_disabled(e)&&(this.is_checked(e)?this.uncheck_node(e,n):this.check_node(e,n),void this.trigger("activate_node",{node:this.get_node(e)}))},this.check_node=function(e,t){if(this.settings.checkbox.tie_selection)return this.select_node(e,!1,!0,t);var n,i,r;if(A.isArray(e)){for(e=e.slice(),i=0,r=e.length;r>i;i++)this.check_node(e[i],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(n=this.get_node(e,!0),void(e.state.checked||(e.state.checked=!0,this._data.checkbox.selected.push(e.id),n&&n.length&&n.children(".jstree-anchor").addClass("jstree-checked"),this.trigger("check_node",{node:e,selected:this._data.checkbox.selected,event:t}))))},this.uncheck_node=function(e,t){if(this.settings.checkbox.tie_selection)return this.deselect_node(e,!1,t);var n,i,r;if(A.isArray(e)){for(e=e.slice(),n=0,i=e.length;i>n;n++)this.uncheck_node(e[n],t);return!0}return!(!(e=this.get_node(e))||"#"===e.id)&&(r=this.get_node(e,!0),void(e.state.checked&&(e.state.checked=!1,this._data.checkbox.selected=A.vakata.array_remove_item(this._data.checkbox.selected,e.id),r.length&&r.children(".jstree-anchor").removeClass("jstree-checked"),this.trigger("uncheck_node",{node:e,selected:this._data.checkbox.selected,event:t}))))},this.check_all=function(){if(this.settings.checkbox.tie_selection)return this.select_all();var A,e;this._data.checkbox.selected.concat([]);for(this._data.checkbox.selected=this._model.data["#"].children_d.concat(),A=0,e=this._data.checkbox.selected.length;e>A;A++)this._model.data[this._data.checkbox.selected[A]]&&(this._model.data[this._data.checkbox.selected[A]].state.checked=!0);this.redraw(!0),this.trigger("check_all",{selected:this._data.checkbox.selected})},this.uncheck_all=function(){if(this.settings.checkbox.tie_selection)return this.deselect_all();var A,e,t=this._data.checkbox.selected.concat([]);for(A=0,e=this._data.checkbox.selected.length;e>A;A++)this._model.data[this._data.checkbox.selected[A]]&&(this._model.data[this._data.checkbox.selected[A]].state.checked=!1);this._data.checkbox.selected=[],this.element.find(".jstree-checked").removeClass("jstree-checked"),this.trigger("uncheck_all",{selected:this._data.checkbox.selected,node:t})},this.is_checked=function(A){return this.settings.checkbox.tie_selection?this.is_selected(A):!(!(A=this.get_node(A))||"#"===A.id)&&A.state.checked},this.get_checked=function(e){return this.settings.checkbox.tie_selection?this.get_selected(e):e?A.map(this._data.checkbox.selected,A.proxy(function(A){return this.get_node(A)},this)):this._data.checkbox.selected},this.get_top_checked=function(e){if(this.settings.checkbox.tie_selection)return this.get_top_selected(e);var t,n,i,r,o=this.get_checked(!0),s={};for(t=0,n=o.length;n>t;t++)s[o[t].id]=o[t];for(t=0,n=o.length;n>t;t++)for(i=0,r=o[t].children_d.length;r>i;i++)s[o[t].children_d[i]]&&delete s[o[t].children_d[i]];o=[];for(t in s)s.hasOwnProperty(t)&&o.push(t);return e?A.map(o,A.proxy(function(A){return this.get_node(A)},this)):o},this.get_bottom_checked=function(e){if(this.settings.checkbox.tie_selection)return this.get_bottom_selected(e);var t,n,i=this.get_checked(!0),r=[];for(t=0,n=i.length;n>t;t++)i[t].children.length||r.push(i[t].id);return e?A.map(r,A.proxy(function(A){return this.get_node(A)},this)):r},this.load_node=function(e,n){var i,r,o;if(!A.isArray(e)&&!this.settings.checkbox.tie_selection&&(o=this.get_node(e))&&o.state.loaded)for(i=0,r=o.children_d.length;r>i;i++)this._model.data[o.children_d[i]].state.checked&&(!0,this._data.checkbox.selected=A.vakata.array_remove_item(this._data.checkbox.selected,o.children_d[i]));return t.load_node.apply(this,arguments)},this.get_state=function(){var A=t.get_state.apply(this,arguments);return this.settings.checkbox.tie_selection?A:(A.checkbox=this._data.checkbox.selected.slice(),A)},this.set_state=function(e,n){var i=t.set_state.apply(this,arguments);if(i&&e.checkbox){if(!this.settings.checkbox.tie_selection){this.uncheck_all();var r=this;A.each(e.checkbox,function(A,e){r.check_node(e)})}return delete e.checkbox,!1}return i}};var h,B,d=null;A.jstree.defaults.contextmenu={select_node:!0,show_at_node:!0,items:function(e,t){return{create:{separator_before:!1,separator_after:!0,_disabled:!1,label:"Create",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.create_node(n,{},"last",function(A){setTimeout(function(){t.edit(A)},0)})}},rename:{separator_before:!1,separator_after:!1,_disabled:!1,label:"Rename",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.edit(n)}},remove:{separator_before:!1,icon:!1,separator_after:!1,_disabled:!1,label:"Delete",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.delete_node(t.is_selected(n)?t.get_selected():n)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.cut(t.is_selected(n)?t.get_selected():n)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.copy(t.is_selected(n)?t.get_selected():n)}},paste:{separator_before:!1,icon:!1,_disabled:function(e){return!A.jstree.reference(e.reference).can_paste()},separator_after:!1,label:"Paste",action:function(e){var t=A.jstree.reference(e.reference),n=t.get_node(e.reference);t.paste(n)}}}}}}},A.jstree.plugins.contextmenu=function(t,n){this.bind=function(){n.bind.call(this);var e=0;this.element.on("contextmenu.jstree",".jstree-anchor",A.proxy(function(A,t){A.preventDefault(),e=A.ctrlKey?+new Date:0,(t||d)&&(e=+new Date+1e4),d&&clearTimeout(d),this.is_loading(A.currentTarget)||this.show_contextmenu(A.currentTarget,A.pageX,A.pageY,A)},this)).on("click.jstree",".jstree-anchor",A.proxy(function(t){this._data.contextmenu.visible&&(!e||+new Date-e>250)&&A.vakata.context.hide(),e=0},this)).on("touchstart.jstree",".jstree-anchor",function(e){e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(h=e.pageX,B=e.pageY,d=setTimeout(function(){A(e.currentTarget).trigger("contextmenu",!0)},750))}),A(document).on("context_hide.vakata.jstree",A.proxy(function(){this._data.contextmenu.visible=!1},this))},this.teardown=function(){this._data.contextmenu.visible&&A.vakata.context.hide(),n.teardown.call(this)},this.show_contextmenu=function(t,n,i,r){if(!(t=this.get_node(t))||"#"===t.id)return!1;var o=this.settings.contextmenu,s=this.get_node(t,!0),a=s.children(".jstree-anchor"),c=!1,l=!1;(o.show_at_node||n===e||i===e)&&(c=a.offset(),n=c.left,i=c.top+this._data.core.li_height),this.settings.contextmenu.select_node&&!this.is_selected(t)&&this.activate_node(t,r),l=o.items,A.isFunction(l)&&(l=l.call(this,t,A.proxy(function(A){this._show_contextmenu(t,n,i,A)},this))),A.isPlainObject(l)&&this._show_contextmenu(t,n,i,l)},this._show_contextmenu=function(e,t,n,i){var r=this.get_node(e,!0),o=r.children(".jstree-anchor");A(document).one("context_show.vakata.jstree",A.proxy(function(e,t){var n="jstree-contextmenu jstree-"+this.get_theme()+"-contextmenu";A(t.element).addClass(n)},this)),this._data.contextmenu.visible=!0,A.vakata.context.show(o,{x:t,y:n},i),this.trigger("show_contextmenu",{node:e,x:t,y:n})}},A(function(){A(document).on("touchmove.vakata.jstree",function(A){d&&A.originalEvent&&A.originalEvent.changedTouches&&A.originalEvent.changedTouches[0]&&(Math.abs(h-A.pageX)>50||Math.abs(B-A.pageY)>50)&&clearTimeout(d)}).on("touchend.vakata.jstree",function(A){d&&clearTimeout(d)})}),function(A){var e=!1,t={element:!1,reference:!1,position_x:0,position_y:0,items:[],html:"",is_visible:!1};A.vakata.context={settings:{hide_onmouseleave:0,icons:!0},_trigger:function(e){A(document).triggerHandler("context_"+e+".vakata",{reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}})},_execute:function(e){return!(!(e=t.items[e])||e._disabled&&(!A.isFunction(e._disabled)||e._disabled({item:e,reference:t.reference,element:t.element}))||!e.action)&&e.action.call(null,{item:e,reference:t.reference,element:t.element,position:{x:t.position_x,y:t.position_y}})},_parse:function(e,n){if(!e)return!1;n||(t.html="",t.items=[]);var i,r="",o=!1;return n&&(r+=""),n||(t.html=r,A.vakata.context._trigger("parse")),r.length>10&&r},_show_submenu:function(t){if(t=A(t),t.length&&t.children("ul").length){var n=t.children("ul"),i=t.offset().left+t.outerWidth(),r=t.offset().top,o=n.width(),s=n.height(),a=A(window).width()+A(window).scrollLeft(),c=A(window).height()+A(window).scrollTop();e?t[i-(o+10+t.outerWidth())<0?"addClass":"removeClass"]("vakata-context-left"):t[i+o+10>a?"addClass":"removeClass"]("vakata-context-right"),r+s+10>c&&n.css("bottom","-1px"),n.show()}},show:function(n,i,r){var o,s,a,c,l,u,g,h;switch(t.element&&t.element.length&&t.element.width(""),!0){case!i&&!n:return!1;case!!i&&!!n:t.reference=n,t.position_x=i.x,t.position_y=i.y;break;case!i&&!!n:t.reference=n,o=n.offset(),t.position_x=o.left+n.outerHeight(),t.position_y=o.top;break;case!!i&&!n:t.position_x=i.x,t.position_y=i.y}n&&!r&&A(n).data("vakata_contextmenu")&&(r=A(n).data("vakata_contextmenu")),A.vakata.context._parse(r)&&t.element.html(t.html),t.items.length&&(t.element.appendTo("body"),s=t.element,a=t.position_x,c=t.position_y,l=s.width(),u=s.height(),g=A(window).width()+A(window).scrollLeft(),h=A(window).height()+A(window).scrollTop(),e&&(a-=s.outerWidth()-A(n).outerWidth())g&&(a=g-(l+20)),c+u+20>h&&(c=h-(u+20)),t.element.css({left:a,top:c}).show().find("a").first().focus().parent().addClass("vakata-context-hover"),t.is_visible=!0,A.vakata.context._trigger("show"))},hide:function(){t.is_visible&&(t.element.hide().find("ul").hide().end().find(":focus").blur().end().detach(),t.is_visible=!1,A.vakata.context._trigger("hide"))}},A(function(){e="rtl"===A("body").css("direction");var n=!1;t.element=A("
      "),t.element.on("mouseenter","li",function(e){e.stopImmediatePropagation(),A.contains(this,e.relatedTarget)||(n&&clearTimeout(n),t.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),A(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),A.vakata.context._show_submenu(this))}).on("mouseleave","li",function(e){A.contains(this,e.relatedTarget)||A(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(e){A(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),A.vakata.context.settings.hide_onmouseleave&&(n=setTimeout(function(e){return function(){A.vakata.context.hide()}}(),A.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault(),A(this).blur().parent().hasClass("vakata-context-disabled")||!1===A.vakata.context._execute(A(this).attr("rel"))||A.vakata.context.hide()}).on("keydown","a",function(e){var n=null;switch(e.which){case 13:case 32:e.type="mouseup",e.preventDefault(),A(e.currentTarget).trigger(e);break;case 37:t.is_visible&&(t.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 38:t.is_visible&&(n=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first(),n.length||(n=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last()),n.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 39:t.is_visible&&(t.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 40:t.is_visible&&(n=t.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first(),n.length||(n=t.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first()),n.addClass("vakata-context-hover").children("a").focus(),e.stopImmediatePropagation(),e.preventDefault());break;case 27:A.vakata.context.hide(),e.preventDefault()}}).on("keydown",function(A){A.preventDefault();var e=t.element.find(".vakata-contextmenu-shortcut-"+A.which).parent();e.parent().not(".vakata-context-disabled")&&e.click()}),A(document).on("mousedown.vakata.jstree",function(e){t.is_visible&&!A.contains(t.element[0],e.target)&&A.vakata.context.hide()}).on("context_show.vakata.jstree",function(A,n){t.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),e&&t.element.addClass("vakata-context-rtl").css("direction","rtl"),t.element.find("ul").hide().end()})})}(A),A.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0},A.jstree.plugins.dnd=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("mousedown.jstree touchstart.jstree",".jstree-anchor",A.proxy(function(e){if("touchstart"===e.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!A(e.currentTarget).hasClass("jstree-clicked")))return!0;var t=this.get_node(e.target),n=this.is_selected(t)&&this.settings.drag_selection?this.get_selected().length:1,i=n>1?n+" "+this.get_string("nodes"):this.get_text(e.currentTarget);return this.settings.core.force_text&&(i=A("
      ").text(i).html()),t&&t.id&&"#"!==t.id&&(1===e.which||"touchstart"===e.type)&&(!0===this.settings.dnd.is_draggable||A.isFunction(this.settings.dnd.is_draggable)&&this.settings.dnd.is_draggable.call(this,n>1?this.get_selected(!0):[t]))?(this.element.trigger("mousedown.jstree"),A.vakata.dnd.start(e,{jstree:!0,origin:this,obj:this.get_node(t,!0),nodes:n>1?this.get_selected():[t.id]},'
      '+i+'
      ')):void 0},this))}},A(function(){var e=!1,t=!1,n=!1,i=A('
       
      ').hide();A(document).on("dnd_start.vakata.jstree",function(A,t){e=!1,t&&t.data&&t.data.jstree&&i.appendTo("body")}).on("dnd_move.vakata.jstree",function(r,o){if(n&&clearTimeout(n),o&&o.data&&o.data.jstree&&(!o.event.target.id||"jstree-marker"!==o.event.target.id)){var s,a,c,l,u,g,h,B,d,Q,p,E,f,C,w=A.jstree.reference(o.event.target),I=!1,m=!1,M=!1;if(w&&w._data&&w._data.dnd)if(i.attr("class","jstree-"+w.get_theme()+(w.settings.core.themes.responsive?" jstree-dnd-responsive":"")),o.helper.children().attr("class","jstree-"+w.get_theme()+" jstree-"+w.get_theme()+"-"+w.get_theme_variant()+" "+(w.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"show":"hide"](),o.event.target!==w.element[0]&&o.event.target!==w.get_container_ul()[0]||0!==w.get_container_ul().children().length){if((I=A(o.event.target).closest(".jstree-anchor"))&&I.length&&I.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(m=I.offset(),M=o.event.pageY-m.top,c=I.height(),g=c/3>M?["b","i","a"]:M>c-c/3?["a","i","b"]:M>c/2?["i","a","b"]:["i","b","a"],A.each(g,function(r,M){switch(M){case"b":s=m.left-6,a=m.top,l=w.get_parent(I),u=I.parent().index();break;case"i":f=w.settings.dnd.inside_pos,C=w.get_node(I.parent()),s=m.left-2,a=m.top+c/2+1,l=C.id,u="first"===f?0:"last"===f?C.children.length:Math.min(f,C.children.length);break;case"a":s=m.left-6,a=m.top+c,l=w.get_parent(I),u=I.parent().index()+1}for(h=!0,B=0,d=o.data.nodes.length;d>B;B++)if(Q=o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",p=u,"move_node"===Q&&"a"===M&&o.data.origin&&o.data.origin===w&&l===w.get_parent(o.data.nodes[B])&&(E=w.get_node(l),p>A.inArray(o.data.nodes[B],E.children)&&(p-=1)),!(h=h&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(Q,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[B]):o.data.nodes[B],l,p,{dnd:!0,ref:w.get_node(I.parent()),pos:M,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(t=w.last_error());break}return"i"===M&&I.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(n=setTimeout(function(A,e){return function(){A.open_node(e)}}(w,I),w.settings.dnd.open_timeout)),h?(e={ins:w,par:l,pos:"i"!==M||"last"!==f||0!==u||w.is_loaded(C)?u:"last"},i.css({left:s+"px",top:a+"px"}).show(),o.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),t={},g=!0,!1):void 0}),!0===g))return}else{for(h=!0,B=0,d=o.data.nodes.length;d>B&&(h=h&&w.check(o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[B]):o.data.nodes[B],"#","last",{dnd:!0,ref:w.get_node("#"),pos:"i",is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin}));B++);if(h)return e={ins:w,par:"#",pos:"last"},i.hide(),void o.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok")}e=!1,o.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),i.hide()}}).on("dnd_scroll.vakata.jstree",function(A,t){t&&t.data&&t.data.jstree&&(i.hide(),e=!1,t.helper.find(".jstree-icon").first().removeClass("jstree-ok").addClass("jstree-er"))}).on("dnd_stop.vakata.jstree",function(r,o){if(n&&clearTimeout(n),o&&o.data&&o.data.jstree){i.hide().detach();var s,a,c=[];if(e){for(s=0,a=o.data.nodes.length;a>s;s++)c[s]=o.data.origin?o.data.origin.get_node(o.data.nodes[s]):o.data.nodes[s],o.data.origin&&(c[s].instance=o.data.origin);for(e.ins[o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node"](c,e.par,e.pos),s=0,a=c.length;a>s;s++)c[s].instance&&(c[s].instance=null)}else s=A(o.event.target).closest(".jstree"),s.length&&t&&t.error&&"check"===t.error&&(s=s.jstree(!0))&&s.settings.core.error.call(this,t)}}).on("keyup.jstree keydown.jstree",function(e,t){(t=A.vakata.dnd._get())&&t.data&&t.data.jstree&&t.helper.find(".jstree-copy").first()[t.data.origin&&(t.data.origin.settings.dnd.always_copy||t.data.origin.settings.dnd.copy&&(e.metaKey||e.ctrlKey))?"show":"hide"]()})}),function(A){var e={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1};A.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:50},_trigger:function(e,t){var n=A.vakata.dnd._get();n.event=t,A(document).triggerHandler("dnd_"+e+".vakata",n)},_get:function(){return{data:e.data,element:e.element,helper:e.helper}},_clean:function(){e.helper&&e.helper.remove(),e.scroll_i&&(clearInterval(e.scroll_i),e.scroll_i=!1),e={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},A(document).off("mousemove.vakata.jstree touchmove.vakata.jstree",A.vakata.dnd.drag),A(document).off("mouseup.vakata.jstree touchend.vakata.jstree",A.vakata.dnd.stop)},_scroll:function(t){if(!e.scroll_e||!e.scroll_l&&!e.scroll_t)return e.scroll_i&&(clearInterval(e.scroll_i),e.scroll_i=!1),!1;if(!e.scroll_i)return e.scroll_i=setInterval(A.vakata.dnd._scroll,100),!1;if(!0===t)return!1;var n=e.scroll_e.scrollTop(),i=e.scroll_e.scrollLeft();e.scroll_e.scrollTop(n+e.scroll_t*A.vakata.dnd.settings.scroll_speed),e.scroll_e.scrollLeft(i+e.scroll_l*A.vakata.dnd.settings.scroll_speed),(n!==e.scroll_e.scrollTop()||i!==e.scroll_e.scrollLeft())&&A.vakata.dnd._trigger("scroll",e.scroll_e)},start:function(t,n,i){"touchstart"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_drag&&A.vakata.dnd.stop({});try{t.currentTarget.unselectable="on",t.currentTarget.onselectstart=function(){return!1},t.currentTarget.style&&(t.currentTarget.style.MozUserSelect="none")}catch(A){}return e.init_x=t.pageX,e.init_y=t.pageY,e.data=n,e.is_down=!0,e.element=t.currentTarget,e.target=t.target,e.is_touch="touchstart"===t.type,!1!==i&&(e.helper=A("
      ").html(i).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),A(document).on("mousemove.vakata.jstree touchmove.vakata.jstree",A.vakata.dnd.drag),A(document).on("mouseup.vakata.jstree touchend.vakata.jstree",A.vakata.dnd.stop),!1},drag:function(t){if("touchmove"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_down){if(!e.is_drag){if(!(Math.abs(t.pageX-e.init_x)>(e.is_touch?A.vakata.dnd.settings.threshold_touch:A.vakata.dnd.settings.threshold)||Math.abs(t.pageY-e.init_y)>(e.is_touch?A.vakata.dnd.settings.threshold_touch:A.vakata.dnd.settings.threshold)))return;e.helper&&(e.helper.appendTo("body"),e.helper_w=e.helper.outerWidth()),e.is_drag=!0,A.vakata.dnd._trigger("start",t)}var n=!1,i=!1,r=!1,o=!1,s=!1,a=!1,c=!1,l=!1,u=!1,g=!1;return e.scroll_t=0,e.scroll_l=0,e.scroll_e=!1,A(A(t.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(A(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var n=A(this),i=n.offset();return this.scrollHeight>this.offsetHeight&&(i.top+n.height()-t.pageYthis.offsetWidth&&(i.left+n.width()-t.pageXo&&t.pageY-co&&o-(t.pageY-c)a&&t.pageX-la&&a-(t.pageX-l)r&&(u=r-50),s&&g+e.helper_w>s&&(g=s-(e.helper_w+2)),e.helper.css({left:g+"px",top:u+"px"})),A.vakata.dnd._trigger("move",t),!1}},stop:function(t){if("touchend"===t.type&&t.originalEvent&&t.originalEvent.changedTouches&&t.originalEvent.changedTouches[0]&&(t.pageX=t.originalEvent.changedTouches[0].pageX,t.pageY=t.originalEvent.changedTouches[0].pageY,t.target=document.elementFromPoint(t.originalEvent.changedTouches[0].pageX-window.pageXOffset,t.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_drag)A.vakata.dnd._trigger("stop",t);else if("touchend"===t.type&&t.target===e.target){var n=setTimeout(function(){A(t.target).click()},100);A(t.target).one("click",function(){n&&clearTimeout(n)})}return A.vakata.dnd._clean(),!1}}}(A),A.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},A.jstree.plugins.search=function(t,n){this.bind=function(){n.bind.call(this),this._data.search.str="",this._data.search.dom=A(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=!1,this.element.on("before_open.jstree",A.proxy(function(e,t){var n,i,r=this._data.search.res,o=[],s=A();if(r&&r.length&&(this._data.search.dom=A(this.element[0].querySelectorAll("#"+A.map(r,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(A.jstree.idregex,"\\$&"):e.replace(A.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this._data.search.som&&this._data.search.res.length)){for(n=0,i=r.length;i>n;n++)o=o.concat(this.get_node(r[n]).parents);o=A.vakata.array_remove_item(A.vakata.array_unique(o),"#"),s=o.length?A(this.element[0].querySelectorAll("#"+A.map(o,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(A.jstree.idregex,"\\$&"):e.replace(A.jstree.idregex,"\\$&")}).join(", #"))):A(),this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),s=s.add(this._data.search.dom),s.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){A(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")})}},this)).on("search.jstree",A.proxy(function(e,t){this._data.search.som&&t.nodes.length&&(this.element.find(".jstree-node").hide().filter(".jstree-last").filter(function(){return this.nextSibling}).removeClass("jstree-last"),t.nodes.parentsUntil(".jstree").addBack().show().filter(".jstree-children").each(function(){A(this).children(".jstree-node:visible").eq(-1).addClass("jstree-last")}))},this)).on("clear_search.jstree",A.proxy(function(A,e){this._data.search.som&&e.nodes.length&&this.element.find(".jstree-node").css("display","").filter(".jstree-last").filter(function(){ +return this.nextSibling}).removeClass("jstree-last")},this))},this.search=function(t,n,i){if(!1===t||""===A.trim(t.toString()))return this.clear_search();t=t.toString();var r=this.settings.search,o=!!r.ajax&&r.ajax,s=null,a=[],c=[];return this._data.search.res.length&&this.clear_search(),i===e&&(i=r.show_only_matches),n||!1===o?(this._data.search.str=t,this._data.search.dom=A(),this._data.search.res=[],this._data.search.opn=[],this._data.search.som=i,s=new A.vakata.search(t,!0,{caseSensitive:r.case_sensitive,fuzzy:r.fuzzy}),A.each(this._model.data,function(A,e){e.text&&(r.search_callback&&r.search_callback.call(this,t,e)||!r.search_callback&&s.search(e.text).isMatch)&&(!r.search_leaves_only||e.state.loaded&&0===e.children.length)&&(a.push(A),c=c.concat(e.parents))}),a.length&&(c=A.vakata.array_unique(c),this._search_open(c),this._data.search.dom=A(this.element[0].querySelectorAll("#"+A.map(a,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(A.jstree.idregex,"\\$&"):e.replace(A.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.res=a,this._data.search.dom.children(".jstree-anchor").addClass("jstree-search")),void this.trigger("search",{nodes:this._data.search.dom,str:t,res:this._data.search.res,show_only_matches:i})):A.isFunction(o)?o.call(this,t,A.proxy(function(e){e&&e.d&&(e=e.d),this._load_nodes(A.isArray(e)?A.vakata.array_unique(e):[],function(){this.search(t,!0,i)},!0)},this)):(o=A.extend({},o),o.data||(o.data={}),o.data.str=t,A.ajax(o).fail(A.proxy(function(){this._data.core.last_error={error:"ajax",plugin:"search",id:"search_01",reason:"Could not load search parents",data:JSON.stringify(o)},this.settings.core.error.call(this,this._data.core.last_error)},this)).done(A.proxy(function(e){e&&e.d&&(e=e.d),this._load_nodes(A.isArray(e)?A.vakata.array_unique(e):[],function(){this.search(t,!0,i)},!0)},this)))},this.clear_search=function(){this._data.search.dom.children(".jstree-anchor").removeClass("jstree-search"),this.settings.search.close_opened_onclear&&this.close_node(this._data.search.opn,0),this.trigger("clear_search",{nodes:this._data.search.dom,str:this._data.search.str,res:this._data.search.res}),this._data.search.str="",this._data.search.res=[],this._data.search.opn=[],this._data.search.dom=A()},this._search_open=function(e){var t=this;A.each(e.concat([]),function(n,i){if("#"===i)return!0;try{i=A("#"+i.replace(A.jstree.idregex,"\\$&"),t.element)}catch(A){}i&&i.length&&t.is_closed(i)&&(t._data.search.opn.push(i[0].id),t.open_node(i,function(){t._search_open(e)},0))})}},function(A){A.vakata.search=function(A,e,t){t=t||{},!1!==t.fuzzy&&(t.fuzzy=!0),A=t.caseSensitive?A:A.toLowerCase();var n,i,r,o,s=t.location||0,a=t.distance||100,c=t.threshold||.6,l=A.length;return l>32&&(t.fuzzy=!1),t.fuzzy&&(n=1<t;t++)e[A.charAt(t)]=0;for(t=0;l>t;t++)e[A.charAt(t)]|=1<o;o++){for(u=0,g=w;g>u;)r(o,s+g)<=f?u=g:w=g,g=Math.floor((w-u)/2+u);for(w=g,B=Math.max(1,s-g+1),d=Math.min(s+g,E)+l,Q=new Array(d+2),Q[d+1]=(1<=B;a--)if(p=i[e.charAt(a-1)],Q[a]=0===o?(Q[a+1]<<1|1)&p:(Q[a+1]<<1|1)&p|(h[a+1]|h[a])<<1|1|h[a+1],Q[a]&n&&(I=r(o,a-1),f>=I)){if(f=I,C=a-1,m.push(C),!(C>s))break;B=Math.max(1,2*s-C)}if(r(o+1,s)>f)break;h=Q}return{isMatch:C>=0,score:I}},!0===e?{search:o}:o(e)}}(A),A.jstree.defaults.sort=function(A,e){return this.get_text(A)>this.get_text(e)?1:-1},A.jstree.plugins.sort=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("model.jstree",A.proxy(function(A,e){this.sort(e.parent,!0)},this)).on("rename_node.jstree create_node.jstree",A.proxy(function(A,e){this.sort(e.parent||e.node.parent,!1),this.redraw_node(e.parent||e.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",A.proxy(function(A,e){this.sort(e.parent,!1),this.redraw_node(e.parent,!0)},this))},this.sort=function(e,t){var n,i;if((e=this.get_node(e))&&e.children&&e.children.length&&(e.children.sort(A.proxy(this.settings.sort,this)),t))for(n=0,i=e.children_d.length;i>n;n++)this.sort(e.children_d[n],!1)}};var Q=!1;A.jstree.defaults.state={key:"jstree",events:"changed.jstree open_node.jstree close_node.jstree check_node.jstree uncheck_node.jstree",ttl:!1,filter:!1},A.jstree.plugins.state=function(e,t){this.bind=function(){t.bind.call(this);var e=A.proxy(function(){this.element.on(this.settings.state.events,A.proxy(function(){Q&&clearTimeout(Q),Q=setTimeout(A.proxy(function(){this.save_state()},this),100)},this)),this.trigger("state_ready")},this);this.element.on("ready.jstree",A.proxy(function(A,t){this.element.one("restore_state.jstree",e),this.restore_state()||e()},this))},this.save_state=function(){var e={state:this.get_state(),ttl:this.settings.state.ttl,sec:+new Date};A.vakata.storage.set(this.settings.state.key,JSON.stringify(e))},this.restore_state=function(){var e=A.vakata.storage.get(this.settings.state.key);if(e)try{e=JSON.parse(e)}catch(A){return!1}return!(e&&e.ttl&&e.sec&&+new Date-e.sec>e.ttl)&&(e&&e.state&&(e=e.state),e&&A.isFunction(this.settings.state.filter)&&(e=this.settings.state.filter.call(this,e)),!!e&&(this.element.one("set_state.jstree",function(t,n){n.instance.trigger("restore_state",{state:A.extend(!0,{},e)})}),this.set_state(e),!0))},this.clear_state=function(){return A.vakata.storage.del(this.settings.state.key)}},function(A,e){A.vakata.storage={set:function(A,e){return window.localStorage.setItem(A,e)},get:function(A){return window.localStorage.getItem(A)},del:function(A){return window.localStorage.removeItem(A)}}}(A),A.jstree.defaults.types={"#":{},default:{}},A.jstree.plugins.types=function(t,n){this.init=function(A,t){var i,r;if(t&&t.types&&t.types.default)for(i in t.types)if("default"!==i&&"#"!==i&&t.types.hasOwnProperty(i))for(r in t.types.default)t.types.default.hasOwnProperty(r)&&t.types[i][r]===e&&(t.types[i][r]=t.types.default[r]);n.init.call(this,A,t),this._model.data["#"].type="#"},this.refresh=function(A,e){n.refresh.call(this,A,e),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",A.proxy(function(A,t){var n,i,r=this._model.data,o=t.nodes,s=this.settings.types,a="default";for(n=0,i=o.length;i>n;n++)a="default",r[o[n]].original&&r[o[n]].original.type&&s[r[o[n]].original.type]&&(a=r[o[n]].original.type),r[o[n]].data&&r[o[n]].data.jstree&&r[o[n]].data.jstree.type&&s[r[o[n]].data.jstree.type]&&(a=r[o[n]].data.jstree.type),r[o[n]].type=a,!0===r[o[n]].icon&&s[a].icon!==e&&(r[o[n]].icon=s[a].icon);r["#"].type="#"},this)),n.bind.call(this)},this.get_json=function(e,t,i){var r,o,s=this._model.data,a=t?A.extend(!0,{},t,{no_id:!1}):{},c=n.get_json.call(this,e,a,i);if(!1===c)return!1;if(A.isArray(c))for(r=0,o=c.length;o>r;r++)c[r].type=c[r].id&&s[c[r].id]&&s[c[r].id].type?s[c[r].id].type:"default",t&&t.no_id&&(delete c[r].id,c[r].li_attr&&c[r].li_attr.id&&delete c[r].li_attr.id,c[r].a_attr&&c[r].a_attr.id&&delete c[r].a_attr.id);else c.type=c.id&&s[c.id]&&s[c.id].type?s[c.id].type:"default",t&&t.no_id&&(c=this._delete_ids(c));return c},this._delete_ids=function(e){if(A.isArray(e)){for(var t=0,n=e.length;n>t;t++)e[t]=this._delete_ids(e[t]);return e}return delete e.id,e.li_attr&&e.li_attr.id&&delete e.li_attr.id,e.a_attr&&e.a_attr.id&&delete e.a_attr.id,e.children&&A.isArray(e.children)&&(e.children=this._delete_ids(e.children)),e},this.check=function(t,i,r,o,s){if(!1===n.check.call(this,t,i,r,o,s))return!1;i=i&&i.id?i:this.get_node(i),r=r&&r.id?r:this.get_node(r);var a,c,l,u,g=i&&i.id?A.jstree.reference(i.id):null;switch(g=g&&g._model&&g._model.data?g._model.data:null,t){case"create_node":case"move_node":case"copy_node":if("move_node"!==t||-1===A.inArray(i.id,r.children)){if(a=this.get_rules(r),a.max_children!==e&&-1!==a.max_children&&a.max_children===r.children.length)return this._data.core.last_error={error:"check",plugin:"types",id:"types_01",reason:"max_children prevents function: "+t,data:JSON.stringify({chk:t,pos:o,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})},!1;if(a.valid_children!==e&&-1!==a.valid_children&&-1===A.inArray(i.type||"default",a.valid_children))return this._data.core.last_error={error:"check",plugin:"types",id:"types_02",reason:"valid_children prevents function: "+t,data:JSON.stringify({chk:t,pos:o,obj:!(!i||!i.id)&&i.id,par:!(!r||!r.id)&&r.id})},!1;if(g&&i.children_d&&i.parents){for(c=0,l=0,u=i.children_d.length;u>l;l++)c=Math.max(c,g[i.children_d[l]].parents.length);c=c-i.parents.length+1}(0>=c||c===e)&&(c=1);do{if(a.max_depth!==e&&-1!==a.max_depth&&a.max_depthr;r++)this.set_type(t[r],n);return!0}return i=this.settings.types,t=this.get_node(t),!(!i[n]||!t)&&(s=t.type,a=this.get_icon(t),t.type=n,(!0===a||i[s]&&i[s].icon!==e&&a===i[s].icon)&&this.set_icon(t,i[n].icon===e||i[n].icon),!0)}},A.jstree.defaults.unique={case_sensitive:!1,duplicate:function(A,e){return A+" ("+e+")"}},A.jstree.plugins.unique=function(t,n){this.check=function(e,t,i,r,o){if(!1===n.check.call(this,e,t,i,r,o))return!1;if(t=t&&t.id?t:this.get_node(t),!(i=i&&i.id?i:this.get_node(i))||!i.children)return!0;var s,a,c="rename_node"===e?r:t.text,l=[],u=this.settings.unique.case_sensitive,g=this._model.data;for(s=0,a=i.children.length;a>s;s++)l.push(u?g[i.children[s]].text:g[i.children[s]].text.toLowerCase());switch(u||(c=c.toLowerCase()),e){case"delete_node":return!0;case"rename_node":return s=-1===A.inArray(c,l)||t.text&&t.text[u?"toString":"toLowerCase"]()===c,s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_01",reason:"Child with name "+c+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s;case"create_node":return s=-1===A.inArray(c,l),s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_04",reason:"Child with name "+c+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s;case"copy_node":return s=-1===A.inArray(c,l),s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_02",reason:"Child with name "+c+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s;case"move_node":return s=t.parent===i.id||-1===A.inArray(c,l),s||(this._data.core.last_error={error:"check",plugin:"unique",id:"unique_03",reason:"Child with name "+c+" already exists. Preventing: "+e,data:JSON.stringify({chk:e,pos:r,obj:!(!t||!t.id)&&t.id,par:!(!i||!i.id)&&i.id})}),s}return!0},this.create_node=function(t,i,r,o,s){if(!i||i.text===e){if(null===t&&(t="#"),!(t=this.get_node(t)))return n.create_node.call(this,t,i,r,o,s);if(r=r===e?"last":r,!r.toString().match(/^(before|after)$/)&&!s&&!this.is_loaded(t))return n.create_node.call(this,t,i,r,o,s);i||(i={});var a,c,l,u,g,h=this._model.data,B=this.settings.unique.case_sensitive,d=this.settings.unique.duplicate;for(c=a=this.get_string("New node"),l=[],u=0,g=t.children.length;g>u;u++)l.push(B?h[t.children[u]].text:h[t.children[u]].text.toLowerCase());for(u=1;-1!==A.inArray(B?c:c.toLowerCase(),l);)c=d.call(this,a,++u).toString();i.text=c}return n.create_node.call(this,t,i,r,o,s)}};var p=document.createElement("DIV");p.setAttribute("unselectable","on"),p.setAttribute("role","presentation"),p.className="jstree-wholerow",p.innerHTML=" ",A.jstree.plugins.wholerow=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("ready.jstree set_state.jstree",A.proxy(function(){this.hide_dots()},this)).on("init.jstree loading.jstree ready.jstree",A.proxy(function(){this.get_container_ul().addClass("jstree-wholerow-ul")},this)).on("deselect_all.jstree",A.proxy(function(A,e){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")},this)).on("changed.jstree",A.proxy(function(A,e){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var t,n,i=!1;for(t=0,n=e.selected.length;n>t;t++)(i=this.get_node(e.selected[t],!0))&&i.length&&i.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("open_node.jstree",A.proxy(function(A,e){this.get_node(e.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")},this)).on("hover_node.jstree dehover_node.jstree",A.proxy(function(A,e){"hover_node"===A.type&&this.is_disabled(e.node)||this.get_node(e.node,!0).children(".jstree-wholerow")["hover_node"===A.type?"addClass":"removeClass"]("jstree-wholerow-hovered")},this)).on("contextmenu.jstree",".jstree-wholerow",A.proxy(function(e){e.preventDefault();var t=A.Event("contextmenu",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,pageX:e.pageX,pageY:e.pageY});A(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t)},this)).on("click.jstree",".jstree-wholerow",function(e){e.stopImmediatePropagation();var t=A.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});A(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).focus()}).on("click.jstree",".jstree-leaf > .jstree-ocl",A.proxy(function(e){e.stopImmediatePropagation();var t=A.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});A(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",A.proxy(function(A){return A.stopImmediatePropagation(),this.is_disabled(A.currentTarget)||this.hover_node(A.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",A.proxy(function(A){this.dehover_node(A.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),t.teardown.call(this)},this.redraw_node=function(e,n,i,r){if(e=t.redraw_node.apply(this,arguments)){var o=p.cloneNode(!0);-1!==A.inArray(e.id,this._data.core.selected)&&(o.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===e.id&&(o.className+=" jstree-wholerow-hovered"),e.insertBefore(o,e.childNodes[0])}return e}},function(A){if(document.registerElement&&Object&&Object.create){var e=Object.create(HTMLElement.prototype);e.createdCallback=function(){var e,t={core:{},plugins:[]};for(e in A.jstree.plugins)A.jstree.plugins.hasOwnProperty(e)&&this.attributes[e]&&(t.plugins.push(e),this.getAttribute(e)&&JSON.parse(this.getAttribute(e))&&(t[e]=JSON.parse(this.getAttribute(e))));for(e in A.jstree.defaults.core)A.jstree.defaults.core.hasOwnProperty(e)&&this.attributes[e]&&(t.core[e]=JSON.parse(this.getAttribute(e))||this.getAttribute(e));jQuery(this).jstree(t)};try{document.registerElement("vakata-jstree",{prototype:e})}catch(A){}}}(jQuery)}}),function(A){"function"==typeof define&&define.amd?define("cookie",["jquery"],A):A("object"==typeof exports?require("jquery"):jQuery)}(function(A){function e(A){return s.raw?A:encodeURIComponent(A)}function t(A){return s.raw?A:decodeURIComponent(A)}function n(A){return e(s.json?JSON.stringify(A):String(A))}function i(A){0===A.indexOf('"')&&(A=A.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return A=decodeURIComponent(A.replace(o," ")),s.json?JSON.parse(A):A}catch(A){}}function r(e,t){var n=s.raw?e:i(e);return A.isFunction(t)?t(n):n}var o=/\+/g,s=A.cookie=function(i,o,a){if(void 0!==o&&!A.isFunction(o)){if(a=A.extend({},s.defaults,a),"number"==typeof a.expires){var c=a.expires,l=a.expires=new Date;l.setTime(+l+864e5*c)}return document.cookie=[e(i),"=",n(o),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}for(var u=i?void 0:{},g=document.cookie?document.cookie.split("; "):[],h=0,B=g.length;h=0)&&t(e,!i)}}),A("").outerWidth(1).jquery||A.each(["Width","Height"],function(t,n){function i(e,t,n,i){return A.each(r,function(){t-=parseFloat(A.css(e,"padding"+this))||0,n&&(t-=parseFloat(A.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(A.css(e,"margin"+this))||0)}),t}var r="Width"===n?["Left","Right"]:["Top","Bottom"],o=n.toLowerCase(),s={innerWidth:A.fn.innerWidth,innerHeight:A.fn.innerHeight,outerWidth:A.fn.outerWidth,outerHeight:A.fn.outerHeight};A.fn["inner"+n]=function(t){return t===e?s["inner"+n].call(this):this.each(function(){A(this).css(o,i(this,t)+"px")})},A.fn["outer"+n]=function(e,t){return"number"!=typeof e?s["outer"+n].call(this,e):this.each(function(){A(this).css(o,i(this,e,!0,t)+"px")})}}),A.fn.addBack||(A.fn.addBack=function(A){return this.add(null==A?this.prevObject:this.prevObject.filter(A))}),A("").data("a-b","a").removeData("a-b").data("a-b")&&(A.fn.removeData=function(e){return function(t){return arguments.length?e.call(this,A.camelCase(t)):e.call(this)}}(A.fn.removeData)),A.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),A.support.selectstart="onselectstart"in document.createElement("div"),A.fn.extend({disableSelection:function(){return this.bind((A.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(A){A.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),A.extend(A.ui,{plugin:{add:function(e,t,n){var i,r=A.ui[e].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([t,n[i]])},call:function(A,e,t){var n,i=A.plugins[e];if(i&&A.element[0].parentNode&&11!==A.element[0].parentNode.nodeType)for(n=0;i.length>n;n++)A.options[i[n][0]]&&i[n][1].apply(A.element,t)}},hasScroll:function(e,t){if("hidden"===A(e).css("overflow"))return!1;var n=t&&"left"===t?"scrollLeft":"scrollTop",i=!1;return e[n]>0||(e[n]=1,i=e[n]>0,e[n]=0,i)}})}(A),function(A,e){var t=0,n=Array.prototype.slice,i=A.cleanData;A.cleanData=function(e){for(var t,n=0;null!=(t=e[n]);n++)try{A(t).triggerHandler("remove")}catch(A){}i(e)},A.widget=function(t,n,i){var r,o,s,a,c={},l=t.split(".")[0];t=t.split(".")[1],r=l+"-"+t,i||(i=n,n=A.Widget),A.expr[":"][r.toLowerCase()]=function(e){return!!A.data(e,r)},A[l]=A[l]||{},o=A[l][t],s=A[l][t]=function(A,t){return this._createWidget?(arguments.length&&this._createWidget(A,t),e):new s(A,t)},A.extend(s,o,{version:i.version,_proto:A.extend({},i),_childConstructors:[]}),a=new n,a.options=A.widget.extend({},a.options),A.each(i,function(t,i){return A.isFunction(i)?(c[t]=function(){var A=function(){return n.prototype[t].apply(this,arguments)},e=function(A){return n.prototype[t].apply(this,A)};return function(){var t,n=this._super,r=this._superApply;return this._super=A,this._superApply=e,t=i.apply(this,arguments),this._super=n,this._superApply=r,t}}(),e):(c[t]=i,e)}),s.prototype=A.widget.extend(a,{widgetEventPrefix:o?a.widgetEventPrefix:t},c,{constructor:s,namespace:l,widgetName:t,widgetFullName:r}),o?(A.each(o._childConstructors,function(e,t){var n=t.prototype;A.widget(n.namespace+"."+n.widgetName,s,t._proto)}),delete o._childConstructors):n._childConstructors.push(s),A.widget.bridge(t,s)},A.widget.extend=function(t){for(var i,r,o=n.call(arguments,1),s=0,a=o.length;a>s;s++)for(i in o[s])r=o[s][i],o[s].hasOwnProperty(i)&&r!==e&&(t[i]=A.isPlainObject(r)?A.isPlainObject(t[i])?A.widget.extend({},t[i],r):A.widget.extend({},r):r);return t},A.widget.bridge=function(t,i){var r=i.prototype.widgetFullName||t;A.fn[t]=function(o){var s="string"==typeof o,a=n.call(arguments,1),c=this;return o=!s&&a.length?A.widget.extend.apply(null,[o].concat(a)):o,s?this.each(function(){var n,i=A.data(this,r);return i?A.isFunction(i[o])&&"_"!==o.charAt(0)?(n=i[o].apply(i,a),n!==i&&n!==e?(c=n&&n.jquery?c.pushStack(n.get()):n,!1):e):A.error("no such method '"+o+"' for "+t+" widget instance"):A.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")}):this.each(function(){var e=A.data(this,r);e?e.option(o||{})._init():A.data(this,r,new i(o,this))}),c}},A.Widget=function(){},A.Widget._childConstructors=[],A.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
      ",options:{disabled:!1,create:null},_createWidget:function(e,n){n=A(n||this.defaultElement||this)[0],this.element=A(n),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=A.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=A(),this.hoverable=A(),this.focusable=A(),n!==this&&(A.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(A){A.target===n&&this.destroy()}}),this.document=A(n.style?n.ownerDocument:n.document||n),this.window=A(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:A.noop,_getCreateEventData:A.noop,_create:A.noop,_init:A.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(A.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:A.noop,widget:function(){return this.element},option:function(t,n){var i,r,o,s=t;if(0===arguments.length)return A.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(r=s[t]=A.widget.extend({},this.options[t]),o=0;i.length-1>o;o++)r[i[o]]=r[i[o]]||{},r=r[i[o]];if(t=i.pop(),n===e)return r[t]===e?null:r[t];r[t]=n}else{if(n===e)return this.options[t]===e?null:this.options[t];s[t]=n}return this._setOptions(s),this},_setOptions:function(A){var e;for(e in A)this._setOption(e,A[e]);return this},_setOption:function(A,e){return this.options[A]=e,"disabled"===A&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,i){var r,o=this;"boolean"!=typeof t&&(i=n,n=t,t=!1),i?(n=r=A(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,r=this.widget()),A.each(i,function(i,s){function a(){return t||!0!==o.options.disabled&&!A(this).hasClass("ui-state-disabled")?("string"==typeof s?o[s]:s).apply(o,arguments):e}"string"!=typeof s&&(a.guid=s.guid=s.guid||a.guid||A.guid++);var c=i.match(/^(\w+)\s*(.*)$/),l=c[1]+o.eventNamespace,u=c[2];u?r.delegate(u,l,a):n.bind(l,a)})},_off:function(A,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,A.unbind(e).undelegate(e)},_delay:function(A,e){function t(){return("string"==typeof A?n[A]:A).apply(n,arguments)}var n=this;return setTimeout(t,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){A(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){A(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){A(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){A(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,t,n){var i,r,o=this.options[e];if(n=n||{},t=A.Event(t),t.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),t.target=this.element[0],r=t.originalEvent)for(i in r)i in t||(t[i]=r[i]);return this.element.trigger(t,n),!(A.isFunction(o)&&!1===o.apply(this.element[0],[t].concat(n))||t.isDefaultPrevented())}},A.each({show:"fadeIn",hide:"fadeOut"},function(e,t){A.Widget.prototype["_"+e]=function(n,i,r){"string"==typeof i&&(i={effect:i});var o,s=i?!0===i||"number"==typeof i?t:i.effect||t:e;i=i||{},"number"==typeof i&&(i={duration:i}),o=!A.isEmptyObject(i),i.complete=r,i.delay&&n.delay(i.delay),o&&A.effects&&A.effects.effect[s]?n[e](i):s!==e&&n[s]?n[s](i.duration,i.easing,r):n.queue(function(t){A(this)[e](),r&&r.call(n[0]),t()})}})}(A),function(A){var e=!1;A(document).mouseup(function(){e=!1}),A.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(A){return e._mouseDown(A)}).bind("click."+this.widgetName,function(t){return!0===A.data(t.target,e.widgetName+".preventClickEvent")?(A.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&A(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!e){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,i=1===t.which,r=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&A(t.target).closest(this.options.cancel).length;return!(i&&!r&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===A.data(t.target,this.widgetName+".preventClickEvent")&&A.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(A){return n._mouseMove(A)},this._mouseUpDelegate=function(A){return n._mouseUp(A)},A(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),e=!0,!0))}},_mouseMove:function(e){return A.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return A(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&A.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(A){return Math.max(Math.abs(this._mouseDownEvent.pageX-A.pageX),Math.abs(this._mouseDownEvent.pageY-A.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(A),function(A,e){function t(A,e,t){return[parseFloat(A[0])*(h.test(A[0])?e/100:1),parseFloat(A[1])*(h.test(A[1])?t/100:1)]}function n(e,t){return parseInt(A.css(e,t),10)||0}function i(e){var t=e[0];return 9===t.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:A.isWindow(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}A.ui=A.ui||{};var r,o=Math.max,s=Math.abs,a=Math.round,c=/left|center|right/,l=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,g=/^\w+/,h=/%$/,B=A.fn.position;A.position={scrollbarWidth:function(){if(void 0!==r)return r;var e,t,n=A("
      "),i=n.children()[0];return A("body").append(n),e=i.offsetWidth,n.css("overflow","scroll"),t=i.offsetWidth,e===t&&(t=n[0].clientWidth),n.remove(),r=e-t},getScrollInfo:function(e){var t=e.isWindow?"":e.element.css("overflow-x"),n=e.isWindow?"":e.element.css("overflow-y"),i="scroll"===t||"auto"===t&&e.widthn?"left":t>0?"right":"center",vertical:0>r?"top":i>0?"bottom":"middle"};u>h&&h>s(t+n)&&(a.horizontal="center"),g>d&&d>s(i+r)&&(a.vertical="middle"),a.important=o(s(t),s(n))>o(s(i),s(r))?"horizontal":"vertical",e.using.call(this,A,a)}),l.offset(A.extend(v,{using:c}))})},A.ui.position={fit:{left:function(A,e){var t,n=e.within,i=n.isWindow?n.scrollLeft:n.offset.left,r=n.width,s=A.left-e.collisionPosition.marginLeft,a=i-s,c=s+e.collisionWidth-r-i;e.collisionWidth>r?a>0&&0>=c?(t=A.left+a+e.collisionWidth-r-i,A.left+=a-t):A.left=c>0&&0>=a?i:a>c?i+r-e.collisionWidth:i:a>0?A.left+=a:c>0?A.left-=c:A.left=o(A.left-s,A.left)},top:function(A,e){var t,n=e.within,i=n.isWindow?n.scrollTop:n.offset.top,r=e.within.height,s=A.top-e.collisionPosition.marginTop,a=i-s,c=s+e.collisionHeight-r-i;e.collisionHeight>r?a>0&&0>=c?(t=A.top+a+e.collisionHeight-r-i,A.top+=a-t):A.top=c>0&&0>=a?i:a>c?i+r-e.collisionHeight:i:a>0?A.top+=a:c>0?A.top-=c:A.top=o(A.top-s,A.top)}},flip:{left:function(A,e){var t,n,i=e.within,r=i.offset.left+i.scrollLeft,o=i.width,a=i.isWindow?i.scrollLeft:i.offset.left,c=A.left-e.collisionPosition.marginLeft,l=c-a,u=c+e.collisionWidth-o-a,g="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,h="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,B=-2*e.offset[0];0>l?(0>(t=A.left+g+h+B+e.collisionWidth-o-r)||s(l)>t)&&(A.left+=g+h+B):u>0&&((n=A.left-e.collisionPosition.marginLeft+g+h+B-a)>0||u>s(n))&&(A.left+=g+h+B)},top:function(A,e){var t,n,i=e.within,r=i.offset.top+i.scrollTop,o=i.height,a=i.isWindow?i.scrollTop:i.offset.top,c=A.top-e.collisionPosition.marginTop,l=c-a,u=c+e.collisionHeight-o-a,g="top"===e.my[1],h=g?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,B="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,d=-2*e.offset[1];0>l?(n=A.top+h+B+d+e.collisionHeight-o-r,A.top+h+B+d>l&&(0>n||s(l)>n)&&(A.top+=h+B+d)):u>0&&(t=A.top-e.collisionPosition.marginTop+h+B+d-a,A.top+h+B+d>u&&(t>0||u>s(t))&&(A.top+=h+B+d))}},flipfit:{left:function(){A.ui.position.flip.left.apply(this,arguments),A.ui.position.fit.left.apply(this,arguments)},top:function(){A.ui.position.flip.top.apply(this,arguments),A.ui.position.fit.top.apply(this,arguments)}}},function(){var e,t,n,i,r,o=document.getElementsByTagName("body")[0],s=document.createElement("div");e=document.createElement(o?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&A.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"});for(r in n)e.style[r]=n[r];e.appendChild(s),t=o||document.documentElement,t.insertBefore(e,t.firstChild),s.style.cssText="position: absolute; left: 10.7432222px;",i=A(s).offset().left,A.support.offsetFractions=i>10&&11>i,e.innerHTML="",t.removeChild(e)}()}(A),function(A){A.widget("ui.draggable",A.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var t=this.options;return!(this.helper||t.disabled||A(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(A(!0===t.iframeFix?"iframe":t.iframeFix).each(function(){A("
      ").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(A(this).offset()).appendTo("body")}),!0))},_mouseStart:function(e){var t=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),A.ui.ddmanager&&(A.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,A.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,t.cursorAt&&this._adjustOffsetFromHelper(t.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),A.ui.ddmanager&&!t.dropBehaviour&&A.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),A.ui.ddmanager&&A.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,t){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!t){var n=this._uiHash();if(!1===this._trigger("drag",e,n))return this._mouseUp({}),!1;this.position=n.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),A.ui.ddmanager&&A.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var t=this,n=!1;return A.ui.ddmanager&&!this.options.dropBehaviour&&(n=A.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1),!("original"===this.options.helper&&!A.contains(this.element[0].ownerDocument,this.element[0]))&&("invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||A.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==t._trigger("stop",e)&&t._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1)},_mouseUp:function(e){return A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),A.ui.ddmanager&&A.ui.ddmanager.dragStop(this,e),A.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!A(e.target).closest(this.element.find(this.options.handle)).length},_createHelper:function(e){var t=this.options,n=A.isFunction(t.helper)?A(t.helper.apply(this.element[0],[e])):"clone"===t.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===t.appendTo?this.element[0].parentNode:t.appendTo),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),A.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&A.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var A=this.element.position();return{top:A.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:A.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,n,i=this.options;return i.containment?"window"===i.containment?void(this.containment=[A(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,A(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,A(window).scrollLeft()+A(window).width()-this.helperProportions.width-this.margins.left,A(window).scrollTop()+(A(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===i.containment?void(this.containment=[0,0,A(document).width()-this.helperProportions.width-this.margins.left,(A(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):i.containment.constructor===Array?void(this.containment=i.containment):("parent"===i.containment&&(i.containment=this.helper[0].parentNode),t=A(i.containment),void((n=t[0])&&(e="hidden"!==t.css("overflow"),this.containment=[(parseInt(t.css("borderLeftWidth"),10)||0)+(parseInt(t.css("paddingLeft"),10)||0),(parseInt(t.css("borderTopWidth"),10)||0)+(parseInt(t.css("paddingTop"),10)||0),(e?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(t.css("borderRightWidth"),10)||0)-(parseInt(t.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(t.css("borderBottomWidth"),10)||0)-(parseInt(t.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=t))):void(this.containment=null)},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:i.scrollTop(),left:i.scrollLeft()}),{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*n}},_generatePosition:function(e){var t,n,i,r,o=this.options,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=e.pageX,c=e.pageY;return this.offset.scroll||(this.offset.scroll={top:s.scrollTop(),left:s.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(n=this.relative_container.offset(),t=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):t=this.containment,e.pageX-this.offset.click.leftt[2]&&(a=t[2]+this.offset.click.left),e.pageY-this.offset.click.top>t[3]&&(c=t[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,c=t?i-this.offset.click.top>=t[1]||i-this.offset.click.top>t[3]?i:i-this.offset.click.top>=t[1]?i-o.grid[1]:i+o.grid[1]:i,r=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=t?r-this.offset.click.left>=t[0]||r-this.offset.click.left>t[2]?r:r-this.offset.click.left>=t[0]?r-o.grid[0]:r+o.grid[0]:r)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,t,n){return n=n||this._uiHash(),A.ui.plugin.call(this,e,[t,n]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),A.Widget.prototype._trigger.call(this,e,t,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),A.ui.plugin.add("draggable","connectToSortable",{start:function(e,t){var n=A(this).data("ui-draggable"),i=n.options,r=A.extend({},t,{item:n.element});n.sortables=[],A(i.connectToSortable).each(function(){var t=A.data(this,"ui-sortable");t&&!t.options.disabled&&(n.sortables.push({instance:t,shouldRevert:t.options.revert}),t.refreshPositions(),t._trigger("activate",e,r))})},stop:function(e,t){var n=A(this).data("ui-draggable"),i=A.extend({},t,{item:n.element});A.each(n.sortables,function(){this.instance.isOver?(this.instance.isOver=0,n.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===n.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,i))})},drag:function(e,t){var n=A(this).data("ui-draggable"),i=this;A.each(n.sortables,function(){var r=!1,o=this;this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(r=!0,A.each(n.sortables,function(){return this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&A.contains(o.instance.element[0],this.instance.element[0])&&(r=!1),r})),r?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=A(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return t.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",e),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),n._trigger("fromSortable",e),n.dropped=!1)})}}),A.ui.plugin.add("draggable","cursor",{start:function(){var e=A("body"),t=A(this).data("ui-draggable").options;e.css("cursor")&&(t._cursor=e.css("cursor")),e.css("cursor",t.cursor)},stop:function(){var e=A(this).data("ui-draggable").options;e._cursor&&A("body").css("cursor",e._cursor)}}),A.ui.plugin.add("draggable","opacity",{start:function(e,t){var n=A(t.helper),i=A(this).data("ui-draggable").options;n.css("opacity")&&(i._opacity=n.css("opacity")),n.css("opacity",i.opacity)},stop:function(e,t){var n=A(this).data("ui-draggable").options;n._opacity&&A(t.helper).css("opacity",n._opacity)}}),A.ui.plugin.add("draggable","scroll",{start:function(){var e=A(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var t=A(this).data("ui-draggable"),n=t.options,i=!1;t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(t.overflowOffset.top+t.scrollParent[0].offsetHeight-e.pageY=0;u--)s=h.snapElements[u].left,a=s+h.snapElements[u].width,c=h.snapElements[u].top,l=c+h.snapElements[u].height,s-d>p||Q>a+d||c-d>f||E>l+d||!A.contains(h.snapElements[u].item.ownerDocument,h.snapElements[u].item)?(h.snapElements[u].snapping&&h.options.snap.release&&h.options.snap.release.call(h.element,e,A.extend(h._uiHash(),{snapItem:h.snapElements[u].item})),h.snapElements[u].snapping=!1):("inner"!==B.snapMode&&(n=d>=Math.abs(c-f),i=d>=Math.abs(l-E),r=d>=Math.abs(s-p),o=d>=Math.abs(a-Q),n&&(t.position.top=h._convertPositionTo("relative",{top:c-h.helperProportions.height,left:0}).top-h.margins.top),i&&(t.position.top=h._convertPositionTo("relative",{top:l,left:0}).top-h.margins.top),r&&(t.position.left=h._convertPositionTo("relative",{top:0,left:s-h.helperProportions.width}).left-h.margins.left),o&&(t.position.left=h._convertPositionTo("relative",{top:0,left:a}).left-h.margins.left)),g=n||i||r||o,"outer"!==B.snapMode&&(n=d>=Math.abs(c-E),i=d>=Math.abs(l-f),r=d>=Math.abs(s-Q),o=d>=Math.abs(a-p),n&&(t.position.top=h._convertPositionTo("relative",{top:c,left:0}).top-h.margins.top),i&&(t.position.top=h._convertPositionTo("relative",{top:l-h.helperProportions.height,left:0}).top-h.margins.top),r&&(t.position.left=h._convertPositionTo("relative",{top:0,left:s}).left-h.margins.left),o&&(t.position.left=h._convertPositionTo("relative",{top:0,left:a-h.helperProportions.width}).left-h.margins.left)),!h.snapElements[u].snapping&&(n||i||r||o||g)&&h.options.snap.snap&&h.options.snap.snap.call(h.element,e,A.extend(h._uiHash(),{snapItem:h.snapElements[u].item})),h.snapElements[u].snapping=n||i||r||o||g)}}),A.ui.plugin.add("draggable","stack",{start:function(){var e,t=this.data("ui-draggable").options,n=A.makeArray(A(t.stack)).sort(function(e,t){return(parseInt(A(e).css("zIndex"),10)||0)-(parseInt(A(t).css("zIndex"),10)||0)});n.length&&(e=parseInt(A(n[0]).css("zIndex"),10)||0,A(n).each(function(t){A(this).css("zIndex",e+t)}),this.css("zIndex",e+n.length))}}),A.ui.plugin.add("draggable","zIndex",{start:function(e,t){var n=A(t.helper),i=A(this).data("ui-draggable").options;n.css("zIndex")&&(i._zIndex=n.css("zIndex")),n.css("zIndex",i.zIndex)},stop:function(e,t){var n=A(this).data("ui-draggable").options;n._zIndex&&A(t.helper).css("zIndex",n._zIndex)}})}(A),function(A){function e(A,e,t){return A>e&&e+t>A}A.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e=this.options,t=e.accept;this.isover=!1,this.isout=!0,this.accept=A.isFunction(t)?t:function(A){return A.is(t)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},A.ui.ddmanager.droppables[e.scope]=A.ui.ddmanager.droppables[e.scope]||[],A.ui.ddmanager.droppables[e.scope].push(this),e.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,t=A.ui.ddmanager.droppables[this.options.scope];t.length>e;e++)t[e]===this&&t.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,t){"accept"===e&&(this.accept=A.isFunction(t)?t:function(A){return A.is(t)}),A.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var t=A.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),t&&this._trigger("activate",e,this.ui(t))},_deactivate:function(e){var t=A.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),t&&this._trigger("deactivate",e,this.ui(t))},_over:function(e){var t=A.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(t)))},_out:function(e){var t=A.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(t)))},_drop:function(e,t){var n=t||A.ui.ddmanager.current,i=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=A.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===n.options.scope&&e.accept.call(e.element[0],n.currentItem||n.element)&&A.ui.intersect(n,A.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(i=!0,!1):void 0}),!i&&(!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(n)),this.element)))},ui:function(A){return{draggable:A.currentItem||A.element,helper:A.helper,position:A.position,offset:A.positionAbs}}}),A.ui.intersect=function(A,t,n){if(!t.offset)return!1;var i,r,o=(A.positionAbs||A.position.absolute).left,s=o+A.helperProportions.width,a=(A.positionAbs||A.position.absolute).top,c=a+A.helperProportions.height,l=t.offset.left,u=l+t.proportions.width,g=t.offset.top,h=g+t.proportions.height;switch(n){case"fit":return o>=l&&u>=s&&a>=g&&h>=c;case"intersect":return o+A.helperProportions.width/2>l&&u>s-A.helperProportions.width/2&&a+A.helperProportions.height/2>g&&h>c-A.helperProportions.height/2;case"pointer":return i=(A.positionAbs||A.position.absolute).left+(A.clickOffset||A.offset.click).left,r=(A.positionAbs||A.position.absolute).top+(A.clickOffset||A.offset.click).top,e(r,g,t.proportions.height)&&e(i,l,t.proportions.width);case"touch":return(a>=g&&h>=a||c>=g&&h>=c||g>a&&c>h)&&(o>=l&&u>=o||s>=l&&u>=s||l>o&&s>u);default:return!1}},A.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,t){var n,i,r=A.ui.ddmanager.droppables[e.options.scope]||[],o=t?t.type:null,s=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();A:for(n=0;r.length>n;n++)if(!(r[n].options.disabled||e&&!r[n].accept.call(r[n].element[0],e.currentItem||e.element))){for(i=0;s.length>i;i++)if(s[i]===r[n].element[0]){r[n].proportions.height=0;continue A}r[n].visible="none"!==r[n].element.css("display"),r[n].visible&&("mousedown"===o&&r[n]._activate.call(r[n],t),r[n].offset=r[n].element.offset(),r[n].proportions={width:r[n].element[0].offsetWidth,height:r[n].element[0].offsetHeight})}},drop:function(e,t){var n=!1;return A.each((A.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&A.ui.intersect(e,this,this.options.tolerance)&&(n=this._drop.call(this,t)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,t)))}),n},dragStart:function(e,t){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||A.ui.ddmanager.prepareOffsets(e,t)})},drag:function(e,t){e.options.refreshPositions&&A.ui.ddmanager.prepareOffsets(e,t),A.each(A.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,i,r,o=A.ui.intersect(e,this,this.options.tolerance),s=!o&&this.isover?"isout":o&&!this.isover?"isover":null;s&&(this.options.greedy&&(i=this.options.scope,r=this.element.parents(":data(ui-droppable)").filter(function(){return A.data(this,"ui-droppable").options.scope===i}),r.length&&(n=A.data(r[0],"ui-droppable"),n.greedyChild="isover"===s)),n&&"isover"===s&&(n.isover=!1,n.isout=!0,n._out.call(n,t)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,t),n&&"isout"===s&&(n.isout=!1,n.isover=!0,n._over.call(n,t)))}})},dragStop:function(e,t){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||A.ui.ddmanager.prepareOffsets(e,t)}}}(A),function(A){function e(A){return parseInt(A,10)||0}function t(A){return!isNaN(parseInt(A,10))}A.widget("ui.resizable",A.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,t,n,i,r,o=this,s=this.options;if(this.element.addClass("ui-resizable"),A.extend(this,{_aspectRatio:!!s.aspectRatio,aspectRatio:s.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:s.helper||s.ghost||s.animate?s.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(A("
      ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=s.handles||(A(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},t=0;e.length>t;t++)n=A.trim(e[t]),r="ui-resizable-"+n,i=A("
      "),i.css({zIndex:s.zIndex}),"se"===n&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[n]=".ui-resizable-"+n,this.element.append(i);this._renderAxis=function(e){var t,n,i,r;e=e||this.element;for(t in this.handles)this.handles[t].constructor===String&&(this.handles[t]=A(this.handles[t],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(n=A(this.handles[t],this.element),r=/sw|ne|nw|se|n|s/.test(t)?n.outerHeight():n.outerWidth(),i=["padding",/ne|nw|n/.test(t)?"Top":/se|sw|s/.test(t)?"Bottom":/^e$/.test(t)?"Right":"Left"].join(""),e.css(i,r),this._proportionallyResize()),A(this.handles[t]).length},this._renderAxis(this.element),this._handles=A(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=i&&i[1]?i[1]:"se")}),s.autoHide&&(this._handles.hide(),A(this.element).addClass("ui-resizable-autohide").mouseenter(function(){ +s.disabled||(A(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){s.disabled||o.resizing||(A(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,t=function(e){A(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(e){var t,n,i=!1;for(t in this.handles)((n=A(this.handles[t])[0])===e.target||A.contains(n,e.target))&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(t){var n,i,r,o=this.options,s=this.element.position(),a=this.element;return this.resizing=!0,/absolute/.test(a.css("position"))?a.css({position:"absolute",top:a.css("top"),left:a.css("left")}):a.is(".ui-draggable")&&a.css({position:"absolute",top:s.top,left:s.left}),this._renderProxy(),n=e(this.helper.css("left")),i=e(this.helper.css("top")),o.containment&&(n+=A(o.containment).scrollLeft()||0,i+=A(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:i},this.size=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.originalPosition={left:n,top:i},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,r=A(".ui-resizable-"+this.axis).css("cursor"),A("body").css("cursor","auto"===r?this.axis+"-resize":r),a.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t,n=this.helper,i={},r=this.originalMousePosition,o=this.axis,s=this.position.top,a=this.position.left,c=this.size.width,l=this.size.height,u=e.pageX-r.left||0,g=e.pageY-r.top||0,h=this._change[o];return!!h&&(t=h.apply(this,[e,u,g]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(t=this._updateRatio(t,e)),t=this._respectSize(t,e),this._updateCache(t),this._propagate("resize",e),this.position.top!==s&&(i.top=this.position.top+"px"),this.position.left!==a&&(i.left=this.position.left+"px"),this.size.width!==c&&(i.width=this.size.width+"px"),this.size.height!==l&&(i.height=this.size.height+"px"),n.css(i),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),A.isEmptyObject(i)||this._trigger("resize",e,this.ui()),!1)},_mouseStop:function(e){this.resizing=!1;var t,n,i,r,o,s,a,c=this.options,l=this;return this._helper&&(t=this._proportionallyResizeElements,n=t.length&&/textarea/i.test(t[0].nodeName),i=n&&A.ui.hasScroll(t[0],"left")?0:l.sizeDiff.height,r=n?0:l.sizeDiff.width,o={width:l.helper.width()-r,height:l.helper.height()-i},s=parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left)||null,a=parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top)||null,c.animate||this.element.css(A.extend(o,{top:a,left:s})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!c.animate&&this._proportionallyResize()),A("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(A){var e,n,i,r,o,s=this.options;o={minWidth:t(s.minWidth)?s.minWidth:0,maxWidth:t(s.maxWidth)?s.maxWidth:1/0,minHeight:t(s.minHeight)?s.minHeight:0,maxHeight:t(s.maxHeight)?s.maxHeight:1/0},(this._aspectRatio||A)&&(e=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,n=o.maxHeight*this.aspectRatio,r=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),i>o.minHeight&&(o.minHeight=i),o.maxWidth>n&&(o.maxWidth=n),o.maxHeight>r&&(o.maxHeight=r)),this._vBoundaries=o},_updateCache:function(A){this.offset=this.helper.offset(),t(A.left)&&(this.position.left=A.left),t(A.top)&&(this.position.top=A.top),t(A.height)&&(this.size.height=A.height),t(A.width)&&(this.size.width=A.width)},_updateRatio:function(A){var e=this.position,n=this.size,i=this.axis;return t(A.height)?A.width=A.height*this.aspectRatio:t(A.width)&&(A.height=A.width/this.aspectRatio),"sw"===i&&(A.left=e.left+(n.width-A.width),A.top=null),"nw"===i&&(A.top=e.top+(n.height-A.height),A.left=e.left+(n.width-A.width)),A},_respectSize:function(A){var e=this._vBoundaries,n=this.axis,i=t(A.width)&&e.maxWidth&&e.maxWidthA.width,s=t(A.height)&&e.minHeight&&e.minHeight>A.height,a=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height,l=/sw|nw|w/.test(n),u=/nw|ne|n/.test(n);return o&&(A.width=e.minWidth),s&&(A.height=e.minHeight),i&&(A.width=e.maxWidth),r&&(A.height=e.maxHeight),o&&l&&(A.left=a-e.minWidth),i&&l&&(A.left=a-e.maxWidth),s&&u&&(A.top=c-e.minHeight),r&&u&&(A.top=c-e.maxHeight),A.width||A.height||A.left||!A.top?A.width||A.height||A.top||!A.left||(A.left=null):A.top=null,A},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var A,e,t,n,i,r=this.helper||this.element;for(A=0;this._proportionallyResizeElements.length>A;A++){if(i=this._proportionallyResizeElements[A],!this.borderDif)for(this.borderDif=[],t=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],n=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")],e=0;t.length>e;e++)this.borderDif[e]=(parseInt(t[e],10)||0)+(parseInt(n[e],10)||0);i.css({height:r.height()-this.borderDif[0]-this.borderDif[2]||0,width:r.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,t=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||A("
      "),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++t.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(A,e){return{width:this.originalSize.width+e}},w:function(A,e){var t=this.originalSize;return{left:this.originalPosition.left+e,width:t.width-e}},n:function(A,e,t){var n=this.originalSize;return{top:this.originalPosition.top+t,height:n.height-t}},s:function(A,e,t){return{height:this.originalSize.height+t}},se:function(e,t,n){return A.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,t,n]))},sw:function(e,t,n){return A.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,t,n]))},ne:function(e,t,n){return A.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,t,n]))},nw:function(e,t,n){return A.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,t,n]))}},_propagate:function(e,t){A.ui.plugin.call(this,e,[t,this.ui()]),"resize"!==e&&this._trigger(e,t,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),A.ui.plugin.add("resizable","animate",{stop:function(e){var t=A(this).data("ui-resizable"),n=t.options,i=t._proportionallyResizeElements,r=i.length&&/textarea/i.test(i[0].nodeName),o=r&&A.ui.hasScroll(i[0],"left")?0:t.sizeDiff.height,s=r?0:t.sizeDiff.width,a={width:t.size.width-s,height:t.size.height-o},c=parseInt(t.element.css("left"),10)+(t.position.left-t.originalPosition.left)||null,l=parseInt(t.element.css("top"),10)+(t.position.top-t.originalPosition.top)||null;t.element.animate(A.extend(a,l&&c?{top:l,left:c}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseInt(t.element.css("width"),10),height:parseInt(t.element.css("height"),10),top:parseInt(t.element.css("top"),10),left:parseInt(t.element.css("left"),10)};i&&i.length&&A(i[0]).css({width:n.width,height:n.height}),t._updateCache(n),t._propagate("resize",e)}})}}),A.ui.plugin.add("resizable","containment",{start:function(){var t,n,i,r,o,s,a,c=A(this).data("ui-resizable"),l=c.options,u=c.element,g=l.containment,h=g instanceof A?g.get(0):/parent/.test(g)?u.parent().get(0):g;h&&(c.containerElement=A(h),/document/.test(g)||g===document?(c.containerOffset={left:0,top:0},c.containerPosition={left:0,top:0},c.parentData={element:A(document),left:0,top:0,width:A(document).width(),height:A(document).height()||document.body.parentNode.scrollHeight}):(t=A(h),n=[],A(["Top","Right","Left","Bottom"]).each(function(A,i){n[A]=e(t.css("padding"+i))}),c.containerOffset=t.offset(),c.containerPosition=t.position(),c.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},i=c.containerOffset,r=c.containerSize.height,o=c.containerSize.width,s=A.ui.hasScroll(h,"left")?h.scrollWidth:o,a=A.ui.hasScroll(h)?h.scrollHeight:r,c.parentData={element:h,left:i.left,top:i.top,width:s,height:a}))},resize:function(e){var t,n,i,r,o=A(this).data("ui-resizable"),s=o.options,a=o.containerOffset,c=o.position,l=o._aspectRatio||e.shiftKey,u={top:0,left:0},g=o.containerElement;g[0]!==document&&/static/.test(g.css("position"))&&(u=a),c.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-u.left),l&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=s.helper?a.left:0),c.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?a.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,t=Math.abs((o._helper,o.offset.left-u.left+o.sizeDiff.width)),n=Math.abs((o._helper?o.offset.top-u.top:o.offset.top-a.top)+o.sizeDiff.height),i=o.containerElement.get(0)===o.element.parent().get(0),r=/relative|absolute/.test(o.containerElement.css("position")),i&&r&&(t-=o.parentData.left),t+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-t,l&&(o.size.height=o.size.width/o.aspectRatio)),n+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-n,l&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var e=A(this).data("ui-resizable"),t=e.options,n=e.containerOffset,i=e.containerPosition,r=e.containerElement,o=A(e.helper),s=o.offset(),a=o.outerWidth()-e.sizeDiff.width,c=o.outerHeight()-e.sizeDiff.height;e._helper&&!t.animate&&/relative/.test(r.css("position"))&&A(this).css({left:s.left-i.left-n.left,width:a,height:c}),e._helper&&!t.animate&&/static/.test(r.css("position"))&&A(this).css({left:s.left-i.left-n.left,width:a,height:c})}}),A.ui.plugin.add("resizable","alsoResize",{start:function(){var e=A(this).data("ui-resizable"),t=e.options,n=function(e){A(e).each(function(){var e=A(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof t.alsoResize||t.alsoResize.parentNode?n(t.alsoResize):t.alsoResize.length?(t.alsoResize=t.alsoResize[0],n(t.alsoResize)):A.each(t.alsoResize,function(A){n(A)})},resize:function(e,t){var n=A(this).data("ui-resizable"),i=n.options,r=n.originalSize,o=n.originalPosition,s={height:n.size.height-r.height||0,width:n.size.width-r.width||0,top:n.position.top-o.top||0,left:n.position.left-o.left||0},a=function(e,n){A(e).each(function(){var e=A(this),i=A(this).data("ui-resizable-alsoresize"),r={},o=n&&n.length?n:e.parents(t.originalElement[0]).length?["width","height"]:["width","height","top","left"];A.each(o,function(A,e){var t=(i[e]||0)+(s[e]||0);t&&t>=0&&(r[e]=t||null)}),e.css(r)})};"object"!=typeof i.alsoResize||i.alsoResize.nodeType?a(i.alsoResize):A.each(i.alsoResize,function(A,e){a(A,e)})},stop:function(){A(this).removeData("resizable-alsoresize")}}),A.ui.plugin.add("resizable","ghost",{start:function(){var e=A(this).data("ui-resizable"),t=e.options,n=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof t.ghost?t.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=A(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=A(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),A.ui.plugin.add("resizable","grid",{resize:function(){var e=A(this).data("ui-resizable"),t=e.options,n=e.size,i=e.originalSize,r=e.originalPosition,o=e.axis,s="number"==typeof t.grid?[t.grid,t.grid]:t.grid,a=s[0]||1,c=s[1]||1,l=Math.round((n.width-i.width)/a)*a,u=Math.round((n.height-i.height)/c)*c,g=i.width+l,h=i.height+u,B=t.maxWidth&&g>t.maxWidth,d=t.maxHeight&&h>t.maxHeight,Q=t.minWidth&&t.minWidth>g,p=t.minHeight&&t.minHeight>h;t.grid=s,Q&&(g+=a),p&&(h+=c),B&&(g-=a),d&&(h-=c),/^(se|s|e)$/.test(o)?(e.size.width=g,e.size.height=h):/^(ne)$/.test(o)?(e.size.width=g,e.size.height=h,e.position.top=r.top-u):/^(sw)$/.test(o)?(e.size.width=g,e.size.height=h,e.position.left=r.left-l):(e.size.width=g,e.size.height=h,e.position.top=r.top-u,e.position.left=r.left-l)}})}(A),function(A){A.widget("ui.selectable",A.ui.mouse,{version:"1.10.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,t=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=A(t.options.filter,t.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=A(this),t=e.offset();A.data(this,"selectable-item",{element:this,$element:e,left:t.left,top:t.top,right:t.left+e.outerWidth(),bottom:t.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=A("
      ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var t=this,n=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=A(n.filter,this.element[0]),this._trigger("start",e),A(n.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=A.data(this,"selectable-item");n.startselected=!0,e.metaKey||e.ctrlKey||(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,t._trigger("unselecting",e,{unselecting:n.element}))}),A(e.target).parents().addBack().each(function(){var n,i=A.data(this,"selectable-item");return i?(n=!e.metaKey&&!e.ctrlKey||!i.$element.hasClass("ui-selected"),i.$element.removeClass(n?"ui-unselecting":"ui-selected").addClass(n?"ui-selecting":"ui-unselecting"),i.unselecting=!n,i.selecting=n,i.selected=n,n?t._trigger("selecting",e,{selecting:i.element}):t._trigger("unselecting",e,{unselecting:i.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var t,n=this,i=this.options,r=this.opos[0],o=this.opos[1],s=e.pageX,a=e.pageY;return r>s&&(t=s,s=r,r=t),o>a&&(t=a,a=o,o=t),this.helper.css({left:r,top:o,width:s-r,height:a-o}),this.selectees.each(function(){var t=A.data(this,"selectable-item"),c=!1;t&&t.element!==n.element[0]&&("touch"===i.tolerance?c=!(t.left>s||r>t.right||t.top>a||o>t.bottom):"fit"===i.tolerance&&(c=t.left>r&&s>t.right&&t.top>o&&a>t.bottom),c?(t.selected&&(t.$element.removeClass("ui-selected"),t.selected=!1),t.unselecting&&(t.$element.removeClass("ui-unselecting"),t.unselecting=!1),t.selecting||(t.$element.addClass("ui-selecting"),t.selecting=!0,n._trigger("selecting",e,{selecting:t.element}))):(t.selecting&&((e.metaKey||e.ctrlKey)&&t.startselected?(t.$element.removeClass("ui-selecting"),t.selecting=!1,t.$element.addClass("ui-selected"),t.selected=!0):(t.$element.removeClass("ui-selecting"),t.selecting=!1,t.startselected&&(t.$element.addClass("ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",e,{unselecting:t.element}))),t.selected&&(e.metaKey||e.ctrlKey||t.startselected||(t.$element.removeClass("ui-selected"),t.selected=!1,t.$element.addClass("ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",e,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var t=this;return this.dragged=!1,A(".ui-unselecting",this.element[0]).each(function(){var n=A.data(this,"selectable-item");n.$element.removeClass("ui-unselecting"),n.unselecting=!1,n.startselected=!1,t._trigger("unselected",e,{unselected:n.element})}),A(".ui-selecting",this.element[0]).each(function(){var n=A.data(this,"selectable-item");n.$element.removeClass("ui-selecting").addClass("ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,t._trigger("selected",e,{selected:n.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(A),function(A){function e(A,e,t){return A>e&&e+t>A}function t(A){return/left|right/.test(A.css("float"))||/inline|table-cell/.test(A.css("display"))}A.widget("ui.sortable",A.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var A=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===A.axis||t(this.items[0].item)),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var A=this.items.length-1;A>=0;A--)this.items[A].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,t){"disabled"===e?(this.options[e]=t,this.widget().toggleClass("ui-sortable-disabled",!!t)):A.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,t){var n=null,i=!1,r=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),A(e.target).parents().each(function(){return A.data(this,r.widgetName+"-item")===r?(n=A(this),!1):void 0}),A.data(e.target,r.widgetName+"-item")===r&&(n=A(e.target)),!!n&&(!(this.options.handle&&!t&&(A(this.options.handle,n).find("*").addBack().each(function(){this===e.target&&(i=!0)}),!i))&&(this.currentItem=n,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,t,n){var i,r,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},A.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(r=this.document.find("body"),this.storedCursor=r.css("cursor"),r.css("cursor",o.cursor),this.storedStylesheet=A("").appendTo(r)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",e,this._uiHash(this));return A.ui.ddmanager&&(A.ui.ddmanager.current=this),A.ui.ddmanager&&!o.dropBehaviour&&A.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var t,n,i,r,o=this.options,s=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;t--)if(n=this.items[t],i=n.item[0],(r=this._intersectsWithPointer(n))&&n.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===r?"next":"prev"]()[0]!==i&&!A.contains(this.placeholder[0],i)&&("semi-dynamic"!==this.options.type||!A.contains(this.element[0],i))){if(this.direction=1===r?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(e,n),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),A.ui.ddmanager&&A.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,t){if(e){if(A.ui.ddmanager&&!this.options.dropBehaviour&&A.ui.ddmanager.drop(this,e),this.options.revert){var n=this,i=this.placeholder.offset(),r=this.options.axis,o={};r&&"x"!==r||(o.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),r&&"y"!==r||(o.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,A(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){n._clear(e)})}else this._clear(e,t);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),A.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?A(this.domPosition.prev).after(this.currentItem):A(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},A(t).each(function(){var t=(A(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&n.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!n.length&&e.key&&n.push(e.key+"="),n.join("&")},toArray:function(e){var t=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t.each(function(){n.push(A(e.item||this).attr(e.attribute||"id")||"")}),n},_intersectsWith:function(A){var e=this.positionAbs.left,t=e+this.helperProportions.width,n=this.positionAbs.top,i=n+this.helperProportions.height,r=A.left,o=r+A.width,s=A.top,a=s+A.height,c=this.offset.click.top,l=this.offset.click.left,u="x"===this.options.axis||n+c>s&&a>n+c,g="y"===this.options.axis||e+l>r&&o>e+l,h=u&&g;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>A[this.floating?"width":"height"]?h:e+this.helperProportions.width/2>r&&o>t-this.helperProportions.width/2&&n+this.helperProportions.height/2>s&&a>i-this.helperProportions.height/2},_intersectsWithPointer:function(A){var t="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,A.top,A.height),n="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,A.left,A.width),i=t&&n,r=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return!!i&&(this.floating?o&&"right"===o||"down"===r?2:1:r&&("down"===r?2:1))},_intersectsWithSides:function(A){var t=e(this.positionAbs.top+this.offset.click.top,A.top+A.height/2,A.height),n=e(this.positionAbs.left+this.offset.click.left,A.left+A.width/2,A.width),i=this._getDragVerticalDirection(),r=this._getDragHorizontalDirection();return this.floating&&r?"right"===r&&n||"left"===r&&!n:i&&("down"===i&&t||"up"===i&&!t)},_getDragVerticalDirection:function(){var A=this.positionAbs.top-this.lastPositionAbs.top;return 0!==A&&(A>0?"down":"up")},_getDragHorizontalDirection:function(){var A=this.positionAbs.left-this.lastPositionAbs.left;return 0!==A&&(A>0?"right":"left")},refresh:function(A){return this._refreshItems(A),this.refreshPositions(),this},_connectWith:function(){var A=this.options;return A.connectWith.constructor===String?[A.connectWith]:A.connectWith},_getItemsAsjQuery:function(e){var t,n,i,r,o=[],s=[],a=this._connectWith();if(a&&e)for(t=a.length-1;t>=0;t--)for(i=A(a[t]),n=i.length-1;n>=0;n--)(r=A.data(i[n],this.widgetFullName))&&r!==this&&!r.options.disabled&&s.push([A.isFunction(r.options.items)?r.options.items.call(r.element):A(r.options.items,r.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),r]);for(s.push([A.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):A(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),t=s.length-1;t>=0;t--)s[t][0].each(function(){o.push(this)});return A(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=A.grep(this.items,function(A){for(var t=0;e.length>t;t++)if(e[t]===A.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var t,n,i,r,o,s,a,c,l=this.items,u=[[A.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):A(this.options.items,this.element),this]],g=this._connectWith();if(g&&this.ready)for(t=g.length-1;t>=0;t--)for(i=A(g[t]),n=i.length-1;n>=0;n--)(r=A.data(i[n],this.widgetFullName))&&r!==this&&!r.options.disabled&&(u.push([A.isFunction(r.options.items)?r.options.items.call(r.element[0],e,{item:this.currentItem}):A(r.options.items,r.element),r]),this.containers.push(r));for(t=u.length-1;t>=0;t--)for(o=u[t][1],s=u[t][0],n=0,c=s.length;c>n;n++)a=A(s[n]),a.data(this.widgetName+"-item",o),l.push({item:a,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var t,n,i,r;for(t=this.items.length-1;t>=0;t--)n=this.items[t],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?A(this.options.toleranceElement,n.item):n.item,e||(n.width=i.outerWidth(),n.height=i.outerHeight()),r=i.offset(),n.left=r.left,n.top=r.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(t=this.containers.length-1;t>=0;t--)r=this.containers[t].element.offset(),this.containers[t].containerCache.left=r.left,this.containers[t].containerCache.top=r.top,this.containers[t].containerCache.width=this.containers[t].element.outerWidth(),this.containers[t].containerCache.height=this.containers[t].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var t,n=e.options;n.placeholder&&n.placeholder.constructor!==String||(t=n.placeholder,n.placeholder={element:function(){var n=e.currentItem[0].nodeName.toLowerCase(),i=A("<"+n+">",e.document[0]).addClass(t||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===n?e.currentItem.children().each(function(){A(" ",e.document[0]).attr("colspan",A(this).attr("colspan")||1).appendTo(i)}):"img"===n&&i.attr("src",e.currentItem.attr("src")),t||i.css("visibility","hidden"),i},update:function(A,i){(!t||n.forcePlaceholderSize)&&(i.height()||i.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=A(n.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_contactContainers:function(n){var i,r,o,s,a,c,l,u,g,h,B=null,d=null;for(i=this.containers.length-1;i>=0;i--)if(!A.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(B&&A.contains(this.containers[i].element[0],B.element[0]))continue;B=this.containers[i],d=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",n,this._uiHash(this)),this.containers[i].containerCache.over=0);if(B)if(1===this.containers.length)this.containers[d].containerCache.over||(this.containers[d]._trigger("over",n,this._uiHash(this)),this.containers[d].containerCache.over=1);else{for(o=1e4,s=null,h=B.floating||t(this.currentItem),a=h?"left":"top", +c=h?"width":"height",l=this.positionAbs[a]+this.offset.click[a],r=this.items.length-1;r>=0;r--)A.contains(this.containers[d].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(!h||e(this.positionAbs.top+this.offset.click.top,this.items[r].top,this.items[r].height))&&(u=this.items[r].item.offset()[a],g=!1,Math.abs(u-l)>Math.abs(u+this.items[r][c]-l)&&(g=!0,u+=this.items[r][c]),o>Math.abs(u-l)&&(o=Math.abs(u-l),s=this.items[r],this.direction=g?"up":"down"));if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[d])return;s?this._rearrange(n,s,null,!0):this._rearrange(n,null,this.containers[d].element,!0),this._trigger("change",n,this._uiHash()),this.containers[d]._trigger("change",n,this._uiHash(this)),this.currentContainer=this.containers[d],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",n,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(e){var t=this.options,n=A.isFunction(t.helper)?A(t.helper.apply(this.element[0],[e,this.currentItem])):"clone"===t.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||A("parent"!==t.appendTo?t.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!n[0].style.width||t.forceHelperSize)&&n.width(this.currentItem.width()),(!n[0].style.height||t.forceHelperSize)&&n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),A.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&A.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var A=this.currentItem.position();return{top:A.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:A.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,n,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A("document"===i.containment?document:window).width()-this.helperProportions.width-this.margins.left,(A("document"===i.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(e=A(i.containment)[0],t=A(i.containment).offset(),n="hidden"!==A(e).css("overflow"),this.containment=[t.left+(parseInt(A(e).css("borderLeftWidth"),10)||0)+(parseInt(A(e).css("paddingLeft"),10)||0)-this.margins.left,t.top+(parseInt(A(e).css("borderTopWidth"),10)||0)+(parseInt(A(e).css("paddingTop"),10)||0)-this.margins.top,t.left+(n?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(A(e).css("borderLeftWidth"),10)||0)-(parseInt(A(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,t.top+(n?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(A(e).css("borderTopWidth"),10)||0)-(parseInt(A(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(i[0].tagName);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:i.scrollTop())*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:i.scrollLeft())*n}},_generatePosition:function(e){var t,n,i=this.options,r=e.pageX,o=e.pageY,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&A.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(s[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(r=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(t=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=this.containment?t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-i.grid[1]:t+i.grid[1]:t,n=this.originalPageX+Math.round((r-this.originalPageX)/i.grid[0])*i.grid[0],r=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-i.grid[0]:n+i.grid[0]:n)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:s.scrollTop()),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:s.scrollLeft())}},_rearrange:function(A,e,t,n){t?t[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!n)})},_clear:function(A,e){this.reverting=!1;var t,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(t in this._storedCSS)("auto"===this._storedCSS[t]||"static"===this._storedCSS[t])&&(this._storedCSS[t]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(A){this._trigger("receive",A,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(A){this._trigger("update",A,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(A){this._trigger("remove",A,this._uiHash())}),n.push(function(A){return function(e){A._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(A){return function(e){A._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),t=this.containers.length-1;t>=0;t--)e||n.push(function(A){return function(e){A._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[t])),this.containers[t].containerCache.over&&(n.push(function(A){return function(e){A._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[t])),this.containers[t].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",A,this._uiHash()),t=0;n.length>t;t++)n[t].call(this,A);this._trigger("stop",A,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",A,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(t=0;n.length>t;t++)n[t].call(this,A);this._trigger("stop",A,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===A.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var t=e||this;return{helper:t.helper,placeholder:t.placeholder||A([]),position:t.position,originalPosition:t.originalPosition,offset:t.positionAbs,item:t.currentItem,sender:e?e.element:null}}})}(A),function(A){var e=0;A.widget("ui.autocomplete",{version:"1.10.3",defaultElement:"",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,t,n,i=this.element[0].nodeName.toLowerCase(),r="textarea"===i,o="input"===i;this.isMultiLine=!!r||!o&&this.element.prop("isContentEditable"),this.valueMethod=this.element[r||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly"))return e=!0,n=!0,void(t=!0);e=!1,n=!1,t=!1;var r=A.ui.keyCode;switch(i.keyCode){case r.PAGE_UP:e=!0,this._move("previousPage",i);break;case r.PAGE_DOWN:e=!0,this._move("nextPage",i);break;case r.UP:e=!0,this._keyEvent("previous",i);break;case r.DOWN:e=!0,this._keyEvent("next",i);break;case r.ENTER:case r.NUMPAD_ENTER:this.menu.active&&(e=!0,i.preventDefault(),this.menu.select(i));break;case r.TAB:this.menu.active&&this.menu.select(i);break;case r.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:t=!0,this._searchTimeout(i)}},keypress:function(n){if(e)return e=!1,void((!this.isMultiLine||this.menu.element.is(":visible"))&&n.preventDefault());if(!t){var i=A.ui.keyCode;switch(n.keyCode){case i.PAGE_UP:this._move("previousPage",n);break;case i.PAGE_DOWN:this._move("nextPage",n);break;case i.UP:this._keyEvent("previous",n);break;case i.DOWN:this._keyEvent("next",n)}}},input:function(A){return n?(n=!1,void A.preventDefault()):void this._searchTimeout(A)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(A){return this.cancelBlur?void delete this.cancelBlur:(clearTimeout(this.searching),this.close(A),void this._change(A))}}),this._initSource(),this.menu=A("
        ").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var t=this.menu.element[0];A(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(n){n.target===e.element[0]||n.target===t||A.contains(t,n.target)||e.close()})})},menufocus:function(e,t){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){A(e.target).trigger(e.originalEvent)});var n=t.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:n})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value):this.liveRegion.text(n.value)},menuselect:function(A,e){var t=e.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=t})),!1!==this._trigger("select",A,{item:t})&&this._value(t.value),this.term=this._value(),this.close(A),this.selectedItem=t}}),this.liveRegion=A("",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(A,e){this._super(A,e),"source"===A&&this._initSource(),"appendTo"===A&&this.menu.element.appendTo(this._appendTo()),"disabled"===A&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?A(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,t,n=this;A.isArray(this.options.source)?(e=this.options.source,this.source=function(t,n){n(A.ui.autocomplete.filter(e,t.term))}):"string"==typeof this.options.source?(t=this.options.source,this.source=function(e,i){n.xhr&&n.xhr.abort(),n.xhr=A.ajax({url:t,data:e,dataType:"json",success:function(A){i(A)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(A){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,A))},this.options.delay)},search:function(A,e){return A=null!=A?A:this._value(),this.term=this._value(),A.length").append(A("").text(t.label)).appendTo(e)},_move:function(A,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(A)||this.menu.isLastItem()&&/^next/.test(A)?(this._value(this.term),void this.menu.blur()):void this.menu[A](e):void this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(A,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(A,e),e.preventDefault())}}),A.extend(A.ui.autocomplete,{escapeRegex:function(A){return A.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,t){var n=RegExp(A.ui.autocomplete.escapeRegex(t),"i");return A.grep(e,function(A){return n.test(A.label||A.value||A)})}}),A.widget("ui.autocomplete",A.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(A){return A+(A>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(A){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=A&&A.length?this.options.messages.results(A.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(A),function(A){A.widget("ui.menu",{version:"1.10.3",defaultElement:"
          ",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,A.proxy(function(A){this.options.disabled&&A.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(A){A.preventDefault()},"click .ui-state-disabled > a":function(A){A.preventDefault()},"click .ui-menu-item:has(a)":function(e){var t=A(e.target).closest(".ui-menu-item");!this.mouseHandled&&t.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),t.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var t=A(e.currentTarget);t.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,t)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(A,e){var t=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(A,t)},blur:function(e){this._delay(function(){A.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){A(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=A(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function t(A){return A.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,i,r,o,s,a=!0;switch(e.keyCode){case A.ui.keyCode.PAGE_UP:this.previousPage(e);break;case A.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case A.ui.keyCode.HOME:this._move("first","first",e);break;case A.ui.keyCode.END:this._move("last","last",e);break;case A.ui.keyCode.UP:this.previous(e);break;case A.ui.keyCode.DOWN:this.next(e);break;case A.ui.keyCode.LEFT:this.collapse(e);break;case A.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case A.ui.keyCode.ENTER:case A.ui.keyCode.SPACE:this._activate(e);break;case A.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,i=this.previousFilter||"",r=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),r===i?o=!0:r=i+r,s=RegExp("^"+t(r),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return s.test(A(this).children("a").text())}),n=o&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(r=String.fromCharCode(e.keyCode),s=RegExp("^"+t(r),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return s.test(A(this).children("a").text())})),n.length?(this.focus(e,n),n.length>1?(this.previousFilter=r,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}a&&e.preventDefault()},_activate:function(A){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(A):this.select(A))},refresh:function(){var e,t=this.options.icons.submenu,n=this.element.find(this.options.menus);n.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=A(this),n=e.prev("a"),i=A("").addClass("ui-menu-icon ui-icon "+t).data("ui-menu-submenu-carat",!0);n.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",n.attr("id"))}),e=n.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=A(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!A.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(A,e){"icons"===A&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(A,e)},focus:function(A,e){var t,n;this.blur(A,A&&"focus"===A.type),this._scrollIntoView(e),this.active=e.first(),n=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",n.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),A&&"keydown"===A.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),t=e.children(".ui-menu"),t.length&&/^mouse/.test(A.type)&&this._startOpening(t),this.activeMenu=e.parent(),this._trigger("focus",A,{item:e})},_scrollIntoView:function(e){var t,n,i,r,o,s;this._hasScroll()&&(t=parseFloat(A.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(A.css(this.activeMenu[0],"paddingTop"))||0,i=e.offset().top-this.activeMenu.offset().top-t-n,r=this.activeMenu.scrollTop(),o=this.activeMenu.height(),s=e.height(),0>i?this.activeMenu.scrollTop(r+i):i+s>o&&this.activeMenu.scrollTop(r+i-o+s))},blur:function(A,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",A,{item:this.active}))},_startOpening:function(A){clearTimeout(this.timer),"true"===A.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(A)},this.delay))},_open:function(e){var t=A.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(t)},collapseAll:function(e,t){clearTimeout(this.timer),this.timer=this._delay(function(){var n=t?this.element:A(e&&e.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(e),this.activeMenu=n},this.delay)},_close:function(A){A||(A=this.active?this.active.parent():this.element),A.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(A){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(A,e))},expand:function(A){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(A,e)}))},next:function(A){this._move("next","first",A)},previous:function(A){this._move("prev","last",A)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(A,e,t){var n;this.active&&(n="first"===A||"last"===A?this.active["first"===A?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[A+"All"](".ui-menu-item").eq(0)),n&&n.length&&this.active||(n=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(t,n)},nextPage:function(e){var t,n,i;return this.active?void(this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return t=A(this),0>t.offset().top-n-i}),this.focus(e,t)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))):void this.next(e)},previousPage:function(e){var t,n,i;return this.active?void(this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return t=A(this),t.offset().top-n+i>0}),this.focus(e,t)):this.focus(e,this.activeMenu.children(".ui-menu-item").first()))):void this.next(e)},_hasScroll:function(){return this.element.outerHeight()A?0:A>n.max?n.max:A)}function n(t){var n=a(),i=n._rgba=[];return t=t.toLowerCase(),h(s,function(A,r){var o,s=r.re.exec(t),a=s&&r.parse(s),l=r.space||"rgba";return a?(o=n[l](a),n[c[l].cache]=o[c[l].cache],i=n._rgba=o._rgba,!1):e}),i.length?("0,0,0,0"===i.join()&&A.extend(i,r.transparent),n):r[t]}function i(A,e,t){return t=(t+1)%1,1>6*t?A+6*(e-A)*t:1>2*t?e:2>3*t?A+6*(e-A)*(2/3-t):A}var r,o=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(A){return[A[1],A[2],A[3],A[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(A){return[2.55*A[1],2.55*A[2],2.55*A[3],A[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(A){return[parseInt(A[1],16),parseInt(A[2],16),parseInt(A[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(A){return[parseInt(A[1]+A[1],16),parseInt(A[2]+A[2],16),parseInt(A[3]+A[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(A){return[A[1],A[2]/100,A[3]/100,A[4]]}}],a=A.Color=function(e,t,n,i){return new A.Color.fn.parse(e,t,n,i)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},l={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},u=a.support={},g=A("

          ")[0],h=A.each;g.style.cssText="background-color:rgba(1,1,1,.5)",u.rgba=g.style.backgroundColor.indexOf("rgba")>-1,h(c,function(A,e){e.cache="_"+A,e.props.alpha={idx:3,type:"percent",def:1}}),a.fn=A.extend(a.prototype,{parse:function(i,o,s,l){if(i===e)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=A(i).css(o),o=e);var u=this,g=A.type(i),B=this._rgba=[];return o!==e&&(i=[i,o,s,l],g="array"),"string"===g?this.parse(n(i)||r._default):"array"===g?(h(c.rgba.props,function(A,e){B[e.idx]=t(i[e.idx],e)}),this):"object"===g?(i instanceof a?h(c,function(A,e){i[e.cache]&&(u[e.cache]=i[e.cache].slice())}):h(c,function(e,n){var r=n.cache;h(n.props,function(A,e){if(!u[r]&&n.to){if("alpha"===A||null==i[A])return;u[r]=n.to(u._rgba)}u[r][e.idx]=t(i[A],e,!0)}),u[r]&&0>A.inArray(null,u[r].slice(0,3))&&(u[r][3]=1,n.from&&(u._rgba=n.from(u[r])))}),this):e},is:function(A){var t=a(A),n=!0,i=this;return h(c,function(A,r){var o,s=t[r.cache];return s&&(o=i[r.cache]||r.to&&r.to(i._rgba)||[],h(r.props,function(A,t){return null!=s[t.idx]?n=s[t.idx]===o[t.idx]:e})),n}),n},_space:function(){var A=[],e=this;return h(c,function(t,n){e[n.cache]&&A.push(t)}),A.pop()},transition:function(A,e){var n=a(A),i=n._space(),r=c[i],o=0===this.alpha()?a("transparent"):this,s=o[r.cache]||r.to(o._rgba),u=s.slice();return n=n[r.cache],h(r.props,function(A,i){var r=i.idx,o=s[r],a=n[r],c=l[i.type]||{};null!==a&&(null===o?u[r]=a:(c.mod&&(a-o>c.mod/2?o+=c.mod:o-a>c.mod/2&&(o-=c.mod)),u[r]=t((a-o)*e+o,i)))}),this[i](u)},blend:function(e){if(1===this._rgba[3])return this;var t=this._rgba.slice(),n=t.pop(),i=a(e)._rgba;return a(A.map(t,function(A,e){return(1-n)*i[e]+n*A}))},toRgbaString:function(){var e="rgba(",t=A.map(this._rgba,function(A,e){return null==A?e>2?1:0:A});return 1===t[3]&&(t.pop(),e="rgb("),e+t.join()+")"},toHslaString:function(){var e="hsla(",t=A.map(this.hsla(),function(A,e){return null==A&&(A=e>2?1:0),e&&3>e&&(A=Math.round(100*A)+"%"),A});return 1===t[3]&&(t.pop(),e="hsl("),e+t.join()+")"},toHexString:function(e){var t=this._rgba.slice(),n=t.pop();return e&&t.push(~~(255*n)),"#"+A.map(t,function(A){return A=(A||0).toString(16),1===A.length?"0"+A:A}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),a.fn.parse.prototype=a.fn,c.hsla.to=function(A){if(null==A[0]||null==A[1]||null==A[2])return[null,null,null,A[3]];var e,t,n=A[0]/255,i=A[1]/255,r=A[2]/255,o=A[3],s=Math.max(n,i,r),a=Math.min(n,i,r),c=s-a,l=s+a,u=.5*l;return e=a===s?0:n===s?60*(i-r)/c+360:i===s?60*(r-n)/c+120:60*(n-i)/c+240,t=0===c?0:.5>=u?c/l:c/(2-l),[Math.round(e)%360,t,u,null==o?1:o]},c.hsla.from=function(A){if(null==A[0]||null==A[1]||null==A[2])return[null,null,null,A[3]];var e=A[0]/360,t=A[1],n=A[2],r=A[3],o=.5>=n?n*(1+t):n+t-n*t,s=2*n-o;return[Math.round(255*i(s,o,e+1/3)),Math.round(255*i(s,o,e)),Math.round(255*i(s,o,e-1/3)),r]},h(c,function(n,i){var r=i.props,s=i.cache,c=i.to,l=i.from;a.fn[n]=function(n){if(c&&!this[s]&&(this[s]=c(this._rgba)),n===e)return this[s].slice();var i,o=A.type(n),u="array"===o||"object"===o?n:arguments,g=this[s].slice();return h(r,function(A,e){var n=u["object"===o?A:e.idx];null==n&&(n=g[e.idx]),g[e.idx]=t(n,e)}),l?(i=a(l(g)),i[s]=g,i):a(g)},h(r,function(e,t){a.fn[e]||(a.fn[e]=function(i){var r,s=A.type(i),a="alpha"===e?this._hsla?"hsla":"rgba":n,c=this[a](),l=c[t.idx];return"undefined"===s?l:("function"===s&&(i=i.call(this,l),s=A.type(i)),null==i&&t.empty?this:("string"===s&&(r=o.exec(i))&&(i=l+parseFloat(r[2])*("+"===r[1]?1:-1)),c[t.idx]=i,this[a](c)))})})}),a.hook=function(e){var t=e.split(" ");h(t,function(e,t){A.cssHooks[t]={set:function(e,i){var r,o,s="";if("transparent"!==i&&("string"!==A.type(i)||(r=n(i)))){if(i=a(r||i),!u.rgba&&1!==i._rgba[3]){ +for(o="backgroundColor"===t?e.parentNode:e;(""===s||"transparent"===s)&&o&&o.style;)try{s=A.css(o,"backgroundColor"),o=o.parentNode}catch(A){}i=i.blend(s&&"transparent"!==s?s:"_default")}i=i.toRgbaString()}try{e.style[t]=i}catch(A){}}},A.fx.step[t]=function(e){e.colorInit||(e.start=a(e.elem,t),e.end=a(e.end),e.colorInit=!0),A.cssHooks[t].set(e.elem,e.start.transition(e.end,e.pos))}})},a.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),A.cssHooks.borderColor={expand:function(A){var e={};return h(["Top","Right","Bottom","Left"],function(t,n){e["border"+n+"Color"]=A}),e}},r=A.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(A),function(){function n(A){var t,n,i=A.ownerDocument.defaultView?A.ownerDocument.defaultView.getComputedStyle(A,null):A.currentStyle,r={};if(i&&i.length&&i[0]&&i[i[0]])for(n=i.length;n--;)t=i[n],"string"==typeof i[t]&&(r[e.camelCase(t)]=i[t]);else for(t in i)"string"==typeof i[t]&&(r[t]=i[t]);return r}function i(A,t){var n,i,r={};for(n in t)i=t[n],A[n]!==i&&(o[n]||(e.fx.step[n]||!isNaN(parseFloat(i)))&&(r[n]=i));return r}var r=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(A.style(e.elem,n,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(A){return this.add(null==A?this.prevObject:this.prevObject.filter(A))}),e.effects.animateClass=function(A,t,o,s){var a=e.speed(t,o,s);return this.queue(function(){var t,o=e(this),s=o.attr("class")||"",c=a.children?o.find("*").addBack():o;c=c.map(function(){return{el:e(this),start:n(this)}}),t=function(){e.each(r,function(e,t){A[t]&&o[t+"Class"](A[t])})},t(),c=c.map(function(){return this.end=n(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",s),c=c.map(function(){var A=this,t=e.Deferred(),n=e.extend({},a,{queue:!1,complete:function(){t.resolve(A)}});return this.el.animate(this.diff,n),t.promise()}),e.when.apply(e,c.get()).done(function(){t(),e.each(arguments,function(){var A=this.el;e.each(this.diff,function(e){A.css(e,"")})}),a.complete.call(o[0])})})},e.fn.extend({addClass:function(A){return function(t,n,i,r){return n?e.effects.animateClass.call(this,{add:t},n,i,r):A.apply(this,arguments)}}(e.fn.addClass),removeClass:function(A){return function(t,n,i,r){return arguments.length>1?e.effects.animateClass.call(this,{remove:t},n,i,r):A.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(A){return function(n,i,r,o,s){return"boolean"==typeof i||i===t?r?e.effects.animateClass.call(this,i?{add:n}:{remove:n},r,o,s):A.apply(this,arguments):e.effects.animateClass.call(this,{toggle:n},i,r,o)}}(e.fn.toggleClass),switchClass:function(A,t,n,i,r){return e.effects.animateClass.call(this,{add:t,remove:A},n,i,r)}})}(),function(){function A(A,t,n,i){return e.isPlainObject(A)&&(t=A,A=A.effect),A={effect:A},null==t&&(t={}),e.isFunction(t)&&(i=t,n=null,t={}),("number"==typeof t||e.fx.speeds[t])&&(i=n,n=t,t={}),e.isFunction(n)&&(i=n,n=null),t&&e.extend(A,t),n=n||t.duration,A.duration=e.fx.off?0:"number"==typeof n?n:n in e.fx.speeds?e.fx.speeds[n]:e.fx.speeds._default,A.complete=i||t.complete,A}function i(A){return!(A&&"number"!=typeof A&&!e.fx.speeds[A])||("string"==typeof A&&!e.effects.effect[A]||(!!e.isFunction(A)||"object"==typeof A&&!A.effect))}e.extend(e.effects,{version:"1.10.3",save:function(A,e){for(var t=0;e.length>t;t++)null!==e[t]&&A.data(n+e[t],A[0].style[e[t]])},restore:function(A,e){var i,r;for(r=0;e.length>r;r++)null!==e[r]&&(i=A.data(n+e[r]),i===t&&(i=""),A.css(e[r],i))},setMode:function(A,e){return"toggle"===e&&(e=A.is(":hidden")?"show":"hide"),e},getBaseline:function(A,e){var t,n;switch(A[0]){case"top":t=0;break;case"middle":t=.5;break;case"bottom":t=1;break;default:t=A[0]/e.height}switch(A[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=A[1]/e.width}return{x:n,y:t}},createWrapper:function(A){if(A.parent().is(".ui-effects-wrapper"))return A.parent();var t={width:A.outerWidth(!0),height:A.outerHeight(!0),float:A.css("float")},n=e("

          ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:A.width(),height:A.height()},r=document.activeElement;try{r.id}catch(A){r=document.body}return A.wrap(n),(A[0]===r||e.contains(A[0],r))&&e(r).focus(),n=A.parent(),"static"===A.css("position")?(n.css({position:"relative"}),A.css({position:"relative"})):(e.extend(t,{position:A.css("position"),zIndex:A.css("z-index")}),e.each(["top","left","bottom","right"],function(e,n){t[n]=A.css(n),isNaN(parseInt(t[n],10))&&(t[n]="auto")}),A.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),A.css(i),n.css(t).show()},removeWrapper:function(A){var t=document.activeElement;return A.parent().is(".ui-effects-wrapper")&&(A.parent().replaceWith(A),(A[0]===t||e.contains(A[0],t))&&e(t).focus()),A},setTransition:function(A,t,n,i){return i=i||{},e.each(t,function(e,t){var r=A.cssUnit(t);r[0]>0&&(i[t]=r[0]*n+r[1])}),i}}),e.fn.extend({effect:function(){function t(A){function t(){e.isFunction(r)&&r.call(i[0]),e.isFunction(A)&&A()}var i=e(this),r=n.complete,s=n.mode;(i.is(":hidden")?"hide"===s:"show"===s)?(i[s](),t()):o.call(i[0],n,t)}var n=A.apply(this,arguments),i=n.mode,r=n.queue,o=e.effects.effect[n.effect];return e.fx.off||!o?i?this[i](n.duration,n.complete):this.each(function(){n.complete&&n.complete.call(this)}):!1===r?this.each(t):this.queue(r||"fx",t)},show:function(e){return function(t){if(i(t))return e.apply(this,arguments);var n=A.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(t){if(i(t))return e.apply(this,arguments);var n=A.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(t){if(i(t)||"boolean"==typeof t)return e.apply(this,arguments);var n=A.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(A){var t=this.css(A),n=[];return e.each(["em","px","%","pt"],function(A,e){t.indexOf(e)>0&&(n=[parseFloat(t),e])}),n}})}(),function(){var A={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){A[t]=function(A){return Math.pow(A,e+2)}}),e.extend(A,{Sine:function(A){return 1-Math.cos(A*Math.PI/2)},Circ:function(A){return 1-Math.sqrt(1-A*A)},Elastic:function(A){return 0===A||1===A?A:-Math.pow(2,8*(A-1))*Math.sin((80*(A-1)-7.5)*Math.PI/15)},Back:function(A){return A*A*(3*A-2)},Bounce:function(A){for(var e,t=4;((e=Math.pow(2,--t))-1)/11>A;);return 1/Math.pow(4,3-t)-7.5625*Math.pow((3*e-2)/22-A,2)}}),e.each(A,function(A,t){e.easing["easeIn"+A]=t,e.easing["easeOut"+A]=function(A){return 1-t(1-A)},e.easing["easeInOut"+A]=function(A){return.5>A?t(2*A)/2:1-t(-2*A+2)/2}})}()}(A),function(A){var e=/up|down|vertical/,t=/up|left|vertical|horizontal/;A.effects.effect.blind=function(n,i){var r,o,s,a=A(this),c=["position","top","bottom","left","right","height","width"],l=A.effects.setMode(a,n.mode||"hide"),u=n.direction||"up",g=e.test(u),h=g?"height":"width",B=g?"top":"left",d=t.test(u),Q={},p="show"===l;a.parent().is(".ui-effects-wrapper")?A.effects.save(a.parent(),c):A.effects.save(a,c),a.show(),r=A.effects.createWrapper(a).css({overflow:"hidden"}),o=r[h](),s=parseFloat(r.css(B))||0,Q[h]=p?o:0,d||(a.css(g?"bottom":"right",0).css(g?"top":"left","auto").css({position:"absolute"}),Q[B]=p?s:o+s),p&&(r.css(h,0),d||r.css(B,s+o)),r.animate(Q,{duration:n.duration,easing:n.easing,queue:!1,complete:function(){"hide"===l&&a.hide(),A.effects.restore(a,c),A.effects.removeWrapper(a),i()}})}}(A),function(A){A.effects.effect.bounce=function(e,t){var n,i,r,o=A(this),s=["position","top","bottom","left","right","height","width"],a=A.effects.setMode(o,e.mode||"effect"),c="hide"===a,l="show"===a,u=e.direction||"up",g=e.distance,h=e.times||5,B=2*h+(l||c?1:0),d=e.duration/B,Q=e.easing,p="up"===u||"down"===u?"top":"left",E="up"===u||"left"===u,f=o.queue(),C=f.length;for((l||c)&&s.push("opacity"),A.effects.save(o,s),o.show(),A.effects.createWrapper(o),g||(g=o["top"===p?"outerHeight":"outerWidth"]()/3),l&&(r={opacity:1},r[p]=0,o.css("opacity",0).css(p,E?2*-g:2*g).animate(r,d,Q)),c&&(g/=Math.pow(2,h-1)),r={},r[p]=0,n=0;h>n;n++)i={},i[p]=(E?"-=":"+=")+g,o.animate(i,d,Q).animate(r,d,Q),g=c?2*g:g/2;c&&(i={opacity:0},i[p]=(E?"-=":"+=")+g,o.animate(i,d,Q)),o.queue(function(){c&&o.hide(),A.effects.restore(o,s),A.effects.removeWrapper(o),t()}),C>1&&f.splice.apply(f,[1,0].concat(f.splice(C,B+1))),o.dequeue()}}(A),function(A){A.effects.effect.clip=function(e,t){var n,i,r,o=A(this),s=["position","top","bottom","left","right","height","width"],a=A.effects.setMode(o,e.mode||"hide"),c="show"===a,l=e.direction||"vertical",u="vertical"===l,g=u?"height":"width",h=u?"top":"left",B={};A.effects.save(o,s),o.show(),n=A.effects.createWrapper(o).css({overflow:"hidden"}),i="IMG"===o[0].tagName?n:o,r=i[g](),c&&(i.css(g,0),i.css(h,r/2)),B[g]=c?r:0,B[h]=c?0:r/2,i.animate(B,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){c||o.hide(),A.effects.restore(o,s),A.effects.removeWrapper(o),t()}})}}(A),function(A){A.effects.effect.drop=function(e,t){var n,i=A(this),r=["position","top","bottom","left","right","opacity","height","width"],o=A.effects.setMode(i,e.mode||"hide"),s="show"===o,a=e.direction||"left",c="up"===a||"down"===a?"top":"left",l="up"===a||"left"===a?"pos":"neg",u={opacity:s?1:0};A.effects.save(i,r),i.show(),A.effects.createWrapper(i),n=e.distance||i["top"===c?"outerHeight":"outerWidth"](!0)/2,s&&i.css("opacity",0).css(c,"pos"===l?-n:n),u[c]=(s?"pos"===l?"+=":"-=":"pos"===l?"-=":"+=")+n,i.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&i.hide(),A.effects.restore(i,r),A.effects.removeWrapper(i),t()}})}}(A),function(A){A.effects.effect.explode=function(e,t){function n(){f.push(this),f.length===u*g&&i()}function i(){h.css({visibility:"visible"}),A(f).remove(),d||h.hide(),t()}var r,o,s,a,c,l,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,g=u,h=A(this),B=A.effects.setMode(h,e.mode||"hide"),d="show"===B,Q=h.show().css("visibility","hidden").offset(),p=Math.ceil(h.outerWidth()/g),E=Math.ceil(h.outerHeight()/u),f=[];for(r=0;u>r;r++)for(a=Q.top+r*E,l=r-(u-1)/2,o=0;g>o;o++)s=Q.left+o*p,c=o-(g-1)/2,h.clone().appendTo("body").wrap("
          ").css({position:"absolute",visibility:"visible",left:-o*p,top:-r*E}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:E,left:s+(d?c*p:0),top:a+(d?l*E:0),opacity:d?0:1}).animate({left:s+(d?0:c*p),top:a+(d?0:l*E),opacity:d?1:0},e.duration||500,e.easing,n)}}(A),function(A){A.effects.effect.fade=function(e,t){var n=A(this),i=A.effects.setMode(n,e.mode||"toggle");n.animate({opacity:i},{queue:!1,duration:e.duration,easing:e.easing,complete:t})}}(A),function(A){A.effects.effect.fold=function(e,t){var n,i,r=A(this),o=["position","top","bottom","left","right","height","width"],s=A.effects.setMode(r,e.mode||"hide"),a="show"===s,c="hide"===s,l=e.size||15,u=/([0-9]+)%/.exec(l),g=!!e.horizFirst,h=a!==g,B=h?["width","height"]:["height","width"],d=e.duration/2,Q={},p={};A.effects.save(r,o),r.show(),n=A.effects.createWrapper(r).css({overflow:"hidden"}),i=h?[n.width(),n.height()]:[n.height(),n.width()],u&&(l=parseInt(u[1],10)/100*i[c?0:1]),a&&n.css(g?{height:0,width:l}:{height:l,width:0}),Q[B[0]]=a?i[0]:l,p[B[1]]=a?i[1]:0,n.animate(Q,d,e.easing).animate(p,d,e.easing,function(){c&&r.hide(),A.effects.restore(r,o),A.effects.removeWrapper(r),t()})}}(A),function(A){A.effects.effect.highlight=function(e,t){var n=A(this),i=["backgroundImage","backgroundColor","opacity"],r=A.effects.setMode(n,e.mode||"show"),o={backgroundColor:n.css("backgroundColor")};"hide"===r&&(o.opacity=0),A.effects.save(n,i),n.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===r&&n.hide(),A.effects.restore(n,i),t()}})}}(A),function(A){A.effects.effect.pulsate=function(e,t){var n,i=A(this),r=A.effects.setMode(i,e.mode||"show"),o="show"===r,s="hide"===r,a=o||"hide"===r,c=2*(e.times||5)+(a?1:0),l=e.duration/c,u=0,g=i.queue(),h=g.length;for((o||!i.is(":visible"))&&(i.css("opacity",0).show(),u=1),n=1;c>n;n++)i.animate({opacity:u},l,e.easing),u=1-u;i.animate({opacity:u},l,e.easing),i.queue(function(){s&&i.hide(),t()}),h>1&&g.splice.apply(g,[1,0].concat(g.splice(h,c+1))),i.dequeue()}}(A),function(A){A.effects.effect.puff=function(e,t){var n=A(this),i=A.effects.setMode(n,e.mode||"hide"),r="hide"===i,o=parseInt(e.percent,10)||150,s=o/100,a={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};A.extend(e,{effect:"scale",queue:!1,fade:!0,mode:i,complete:t,percent:r?o:100,from:r?a:{height:a.height*s,width:a.width*s,outerHeight:a.outerHeight*s,outerWidth:a.outerWidth*s}}),n.effect(e)},A.effects.effect.scale=function(e,t){var n=A(this),i=A.extend(!0,{},e),r=A.effects.setMode(n,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===r?0:100),s=e.direction||"both",a=e.origin,c={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()},l={y:"horizontal"!==s?o/100:1,x:"vertical"!==s?o/100:1};i.effect="size",i.queue=!1,i.complete=t,"effect"!==r&&(i.origin=a||["middle","center"],i.restore=!0),i.from=e.from||("show"===r?{height:0,width:0,outerHeight:0,outerWidth:0}:c),i.to={height:c.height*l.y,width:c.width*l.x,outerHeight:c.outerHeight*l.y,outerWidth:c.outerWidth*l.x},i.fade&&("show"===r&&(i.from.opacity=0,i.to.opacity=1),"hide"===r&&(i.from.opacity=1,i.to.opacity=0)),n.effect(i)},A.effects.effect.size=function(e,t){var n,i,r,o=A(this),s=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],c=["width","height","overflow"],l=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],g=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],h=A.effects.setMode(o,e.mode||"effect"),B=e.restore||"effect"!==h,d=e.scale||"both",Q=e.origin||["middle","center"],p=o.css("position"),E=B?s:a,f={height:0,width:0,outerHeight:0,outerWidth:0};"show"===h&&o.show(),n={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===h?(o.from=e.to||f,o.to=e.from||n):(o.from=e.from||("show"===h?f:n),o.to=e.to||("hide"===h?f:n)),r={from:{y:o.from.height/n.height,x:o.from.width/n.width},to:{y:o.to.height/n.height,x:o.to.width/n.width}},("box"===d||"both"===d)&&(r.from.y!==r.to.y&&(E=E.concat(u),o.from=A.effects.setTransition(o,u,r.from.y,o.from),o.to=A.effects.setTransition(o,u,r.to.y,o.to)),r.from.x!==r.to.x&&(E=E.concat(g),o.from=A.effects.setTransition(o,g,r.from.x,o.from),o.to=A.effects.setTransition(o,g,r.to.x,o.to))),("content"===d||"both"===d)&&r.from.y!==r.to.y&&(E=E.concat(l).concat(c),o.from=A.effects.setTransition(o,l,r.from.y,o.from),o.to=A.effects.setTransition(o,l,r.to.y,o.to)),A.effects.save(o,E),o.show(),A.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),Q&&(i=A.effects.getBaseline(Q,n),o.from.top=(n.outerHeight-o.outerHeight())*i.y,o.from.left=(n.outerWidth-o.outerWidth())*i.x,o.to.top=(n.outerHeight-o.to.outerHeight)*i.y,o.to.left=(n.outerWidth-o.to.outerWidth)*i.x),o.css(o.from),("content"===d||"both"===d)&&(u=u.concat(["marginTop","marginBottom"]).concat(l),g=g.concat(["marginLeft","marginRight"]),c=s.concat(u).concat(g),o.find("*[width]").each(function(){var t=A(this),n={height:t.height(),width:t.width(),outerHeight:t.outerHeight(),outerWidth:t.outerWidth()};B&&A.effects.save(t,c),t.from={height:n.height*r.from.y,width:n.width*r.from.x,outerHeight:n.outerHeight*r.from.y,outerWidth:n.outerWidth*r.from.x},t.to={height:n.height*r.to.y,width:n.width*r.to.x,outerHeight:n.height*r.to.y,outerWidth:n.width*r.to.x},r.from.y!==r.to.y&&(t.from=A.effects.setTransition(t,u,r.from.y,t.from),t.to=A.effects.setTransition(t,u,r.to.y,t.to)),r.from.x!==r.to.x&&(t.from=A.effects.setTransition(t,g,r.from.x,t.from),t.to=A.effects.setTransition(t,g,r.to.x,t.to)),t.css(t.from),t.animate(t.to,e.duration,e.easing,function(){B&&A.effects.restore(t,c)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===h&&o.hide(),A.effects.restore(o,E),B||("static"===p?o.css({position:"relative",top:o.to.top,left:o.to.left}):A.each(["top","left"],function(A,e){o.css(e,function(e,t){var n=parseInt(t,10),i=A?o.to.left:o.to.top;return"auto"===t?i+"px":n+i+"px"})})),A.effects.removeWrapper(o),t()}})}}(A),function(A){A.effects.effect.shake=function(e,t){var n,i=A(this),r=["position","top","bottom","left","right","height","width"],o=A.effects.setMode(i,e.mode||"effect"),s=e.direction||"left",a=e.distance||20,c=e.times||3,l=2*c+1,u=Math.round(e.duration/l),g="up"===s||"down"===s?"top":"left",h="up"===s||"left"===s,B={},d={},Q={},p=i.queue(),E=p.length;for(A.effects.save(i,r),i.show(),A.effects.createWrapper(i),B[g]=(h?"-=":"+=")+a,d[g]=(h?"+=":"-=")+2*a,Q[g]=(h?"-=":"+=")+2*a,i.animate(B,u,e.easing),n=1;c>n;n++)i.animate(d,u,e.easing).animate(Q,u,e.easing);i.animate(d,u,e.easing).animate(B,u/2,e.easing).queue(function(){"hide"===o&&i.hide(),A.effects.restore(i,r),A.effects.removeWrapper(i),t()}),E>1&&p.splice.apply(p,[1,0].concat(p.splice(E,l+1))),i.dequeue()}}(A),function(A){A.effects.effect.slide=function(e,t){var n,i=A(this),r=["position","top","bottom","left","right","width","height"],o=A.effects.setMode(i,e.mode||"show"),s="show"===o,a=e.direction||"left",c="up"===a||"down"===a?"top":"left",l="up"===a||"left"===a,u={};A.effects.save(i,r),i.show(),n=e.distance||i["top"===c?"outerHeight":"outerWidth"](!0),A.effects.createWrapper(i).css({overflow:"hidden"}),s&&i.css(c,l?isNaN(n)?"-"+n:-n:n),u[c]=(s?l?"+=":"-=":l?"-=":"+=")+n,i.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&i.hide(),A.effects.restore(i,r),A.effects.removeWrapper(i),t()}})}}(A),function(A){A.effects.effect.transfer=function(e,t){var n=A(this),i=A(e.to),r="fixed"===i.css("position"),o=A("body"),s=r?o.scrollTop():0,a=r?o.scrollLeft():0,c=i.offset(),l={top:c.top-s,left:c.left-a,height:i.innerHeight(),width:i.innerWidth()},u=n.offset(),g=A("
          ").appendTo(document.body).addClass(e.className).css({top:u.top-s,left:u.left-a,height:n.innerHeight(),width:n.innerWidth(),position:r?"fixed":"absolute"}).animate(l,e.duration,e.easing,function(){g.remove(),t()})}}(A)}),define("jquery-ui-touch-punch",["jquery","jquery-ui"],function(A){!function(A){function e(A,e){if(!(A.originalEvent.touches.length>1)){A.preventDefault();var t=A.originalEvent.changedTouches[0],n=document.createEvent("MouseEvents");n.initMouseEvent(e,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),A.target.dispatchEvent(n)}}if(A.support.touch="ontouchend"in document,A.support.touch){var t,n=A.ui.mouse.prototype,i=n._mouseInit,r=n._mouseDestroy;n._touchStart=function(A){var n=this;!t&&n._mouseCapture(A.originalEvent.changedTouches[0])&&(t=!0,n._touchMoved=!1,e(A,"mouseover"),e(A,"mousemove"),e(A,"mousedown"))},n._touchMove=function(A){t&&(this._touchMoved=!0,e(A,"mousemove"))},n._touchEnd=function(A){t&&(e(A,"mouseup"),e(A,"mouseout"),this._touchMoved||e(A,"click"),t=!1)},n._mouseInit=function(){var e=this;e.element.bind({touchstart:A.proxy(e,"_touchStart"),touchmove:A.proxy(e,"_touchMove"),touchend:A.proxy(e,"_touchEnd")}),i.call(e)},n._mouseDestroy=function(){var e=this;e.element.unbind({touchstart:A.proxy(e,"_touchStart"),touchmove:A.proxy(e,"_touchMove"),touchend:A.proxy(e,"_touchEnd")}),r.call(e)}}}(A)}),define("dependencies",["jquery","impromptu","jstree","cookie","jquery-ui","jquery-ui-touch-punch"],function(A){A.jstree.defaults.core.worker=window.JS_TREE_WORKERS_ENABLED}),function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("protoplast",[],e):"object"==typeof exports?exports.Protoplast=e():A.Protoplast=e()}(this,function(){return function(A){function e(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return A[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t={};return e.m=A,e.c=t,e.d=function(A,t,n){e.o(A,t)||Object.defineProperty(A,t,{configurable:!1,enumerable:!0,get:n})},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,e){return Object.prototype.hasOwnProperty.call(A,e)},e.p="",e(e.s=13)}([function(A,e,t){var n=t(5),i=t(2),r=t(6),o=t(7);A.exports={createObject:n.createObject,merge:n.merge,isLiteral:n.isLiteral,isPrimitive:n.isPrimitive,mixin:n.mixin,uniqueId:n.uniqueId,meta:n.meta,resolveProperty:i.resolveProperty,bind:i.bind,bindSetter:i.bindSetter,bindProperty:i.bindProperty,bindCollection:i.bindCollection,observe:i.observe,renderList:r.renderList,createRendererFunction:r.createRendererFunction,renderListDefaults:r.renderListDefaults,domProcessors:{injectElement:r.domProcessors.injectElement,createComponents:r.domProcessors.createComponents},html:o}},function(A,e,t){(function(e){function n(A,e){return A instanceof Array||(e=A,A=[]),{description:e||{},mixins:A||[]}}function i(A){var e=A.$meta||{};return e.properties=e.properties||{},delete A.$meta,e}function r(A,e){void 0!==e.$create&&(A.constructors=A.constructors||[],A.constructors.push(e.$create),delete e.$create)}function o(A,e){return A in this||e.set||e.get||e.value||(e.value=void 0),e}function s(A){return A.hasOwnProperty("writable")||A.hasOwnProperty("set")||A.hasOwnProperty("get")||(A.writable=!0),A.hasOwnProperty("enumerable")||(A.enumerable=!0),A.hasOwnProperty("configurable")||(A.configurable=!0),A}function a(A,e,t,n){n.hasOwnProperty(e)&&-1===g.indexOf(e)&&(A.properties[e]=A.properties[e]||{},A.properties[e][t]=n[e],delete n[e])}function c(A,e){var t,n=[];for(var i in e){if("[object Object]"!==Object.prototype.toString.call(e[i]))t={value:e[i],writable:!0,enumerable:!0,configurable:!0};else{t=e[i],o(i,t);for(var r in t)a(A,r,i,t);s(t)}n.push({property:i,desc:t})}return n}var l=t(0),u=new function(){},g=["value","get","set","writable","enumerable","configurable"];u.$meta={},u.$defineProperty=function(A,e){Object.defineProperty(this,A,e)},u.create=function(){return l.createObject(this,arguments)},u.extend=function(A,e){var t,o,s=Object.create(this),a=n(A,e);A=a.mixins,e=a.description,t=i(e),r(t,e),s=l.mixin(s,A);var u=c(t,e);return o=(A||[]).reduce(function(A,e){return l.merge(A,e.$meta)},{}),t=l.merge(t,o),s.$meta=l.merge(t,this.$meta),u.forEach(function(A){var e=A.property,t=A.desc;s.$defineProperty(e,t)}),s},e.Protoplast=u,A.exports=u}).call(e,t(3))},function(A,e){var t=function(A,e,n){var i=e.split(".");if(e)if(1===i.length)n(A[e]);else{var r=A[i[0]],o=i.slice(1).join(".");r&&t(r,o,n)}else n(A)},n=function(A,e,i,r){var o=e.split(".");if(r=r||{},1===o.length)A.on(e+"_changed",i,r),i();else{var s=A[o[0]],a=o.slice(1).join(".");s&&n(s,a,i,r),A.on(o[0]+"_changed",function(e,t){t&&t.on&&t.off(o[0]+"_changed",i),n(A[o[0]],a,i,r)},r)}return{start:function(){n(A,e,i)},stop:function(){for(t(A,e,function(A){A&&A.off&&A.off(null,null,r)});o.length;)o.pop(),t(A,o.join("."),function(A){A.off(null,null,r)})}}},i=function(A,e,i,r){return n(A,e,function(){t(A,e,function(A){void 0!==A&&i(A)})},r)},r=function(A,e,n,r){var o,s=null;return r=r||{},i(A,e,function(){t(A,e,function(e){s&&(s.off&&s.off("changed",o),s=null,o=null),e&&(s=e,o=n.bind(A,e),e.on&&e.on("changed",o,r)),n(e)})},r)},o=function(A,e,t){var n;if(3===arguments.length)return r(A,e,t);var i,s=[];for(var a in e)e.hasOwnProperty(a)&&(n=e[a],n instanceof Array||(n=[n]),n.forEach(function(e){i=o(A,a,e.bind(A)),s.push(i)}));var c=arguments;return{start:function(){o.apply(null,c)},stop:function(){s.forEach(function(A){A.stop()})}}},s=function(A,e,n,i){var r=i.split("."),s=r.pop();return o(A,e,function(){t(A,e,function(A){t(n,r.join("."),function(e){e&&(e[s]=A)})})})};A.exports={resolveProperty:t,bind:o,bindSetter:i,bindProperty:s,bindCollection:r,observe:n}},function(A,e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(A){"object"==typeof window&&(t=window)}A.exports=t},function(A,e,t){function n(A,e,t){var n=e.value;delete e.value,delete e.writable,delete e.enumerable,e.get=function(){return void 0===this["_"+A]&&(this["_"+A]=n.call(this)),this["_"+A]},e.set=t?function(){var e=this["_"+A];this["_"+A]=void 0,this.dispatch(A+"_changed",void 0,e)}:function(){var e,t;t=this["_"+A],this["_"+A]=void 0,(e=this[A])!==t&&this.dispatch(A+"_changed",e,t)}}function i(A,e,t){var n=e.value;delete e.value,delete e.writable,delete e.enumerable,e.get=function(){return this["_"+A]},e.set=function(e){if(e!==this["_"+A]){var t=this["_"+A];this["_"+A]=e,this.dispatch(A+"_changed",e,t)}},t["_"+A]=n}var r=t(1),o=t(8),s=t(0),a=r.extend([o],{$create:function(){var A=this.$meta.properties.computed;for(var e in A)A.hasOwnProperty(e)&&A[e].forEach(function(A){(function(e){s.observe(this,A,function(){this[e]=void 0}.bind(this))}).bind(this)(e)},this)},$defineProperty:function(A,e){if(this.$meta.properties.computed&&this.$meta.properties.computed[A]){n(A,e,this.$meta.properties.lazy&&this.$meta.properties.lazy[A])}else e.get&&-1===["number","boolean","string"].indexOf(typeof e.value)||i(A,e,this);r.$defineProperty.call(this,A,e)}});A.exports=a},function(A,e){function t(A){var e=++B;return(A||"")+e}function n(A,e){var t=Object.create(A);return t.$meta.constructors&&t.$meta.constructors.forEach(function(A){A.apply(t,e)}),t}function i(A){return-1!==["number","boolean","string","function"].indexOf(typeof A)}function r(A){return A&&A.constructor===Object}function o(A,e){for(var t in e)e.hasOwnProperty(t)&&s(A,e,t);return A}function s(A,e,t){e[t]instanceof Array?a(A,e,t):i(e[t])||!r(e[t])?c(A,e,t):l(A,e,t)}function a(A,e,t){A[t]=e[t].concat(A[t]||[])}function c(A,e,t){A.hasOwnProperty(t)||(A[t]=e[t])}function l(A,e,t){A[t]=A[t]||{},o(A[t],e[t])}function u(A,e){for(var t in e)"__"===t.substr(0,2)||t in A||(A[t]=e[t]);return A}function g(A,e){return e.forEach(function(e){u(A,e)}),A}function h(A,e,t){for(var n in A.$meta.properties[e])A.$meta.properties[e].hasOwnProperty(n)&&t(n,A.$meta.properties[e][n])}var B=0;A.exports={createObject:n,merge:o,isLiteral:r,isPrimitive:i,mixin:g,uniqueId:t,meta:h}},function(A,e,t){var n=t(2),i={attribute:"data-prop",process:function(A,e,t){!function(e){A[t]=e,A.$meta.elementWrapper?A[t]=A.$meta.elementWrapper(A[t]):A.$meta.elementWrapperFunctionName&&(A[t]=A[A.$meta.elementWrapperFunctionName](A[t]))}(e)}},r={attribute:"data-comp",process:function(A,e,t){var n=A[t]=A.$meta.properties.component[t].create();A.attach(n,e,e.parentNode)}},o={remove:function(A,e){A.remove(e)},create:function(A,e,t,n){var i=t.create();i[n]=e,A.add(i)},update:function(A,e,t){A[t]=e}},s=function(A){if(A=A||{},A.create=A.create||o.create,A.remove=A.remove||o.remove,A.update=A.update||o.update,A.property=A.property||"data",!A.renderer)throw new Error("Renderer is required");return A},a=function(A,e){return e=s(e),function(A){for(var t=Math.max(this.children.length,A.length),n=this.children.concat(),i=0;i]*)\/>/gi,e=/<([\w:]+)/,t=/<|&#?\w+;/,n={option:[1,""],thead:[1,"","
          "],col:[2,"","
          "],tr:[2,"","
          "],td:[3,"","
          "],tbody:[1,"","
          "],_default:[0,"",""]};return function(i,r){r=r||document;var o,s,a,c,l=r.createDocumentFragment();if(t.test(i)){for(o=l.appendChild(r.createElement("div")),s=(e.exec(i)||["",""])[1].toLowerCase(),a=n[s]||n._default,o.innerHTML=a[1]+i.replace(A,"<$1>")+a[2],c=a[0];c--;)o=o.lastChild;for(l.removeChild(l.firstChild);o.firstChild;)l.appendChild(o.firstChild)}else l.appendChild(r.createTextNode(i));return l}}();A.exports={parseHTML:t}},function(A,e,t){var n=t(1),i=n.extend({$create:function(){this._topics={}},dispatch:function(A){var e=Array.prototype.slice.call(arguments,1);(this._topics[A]||[]).forEach(function(A){A.handler.apply(A.context,e)})},on:function(A,e,t){if(!e)throw new Error("Handler is required for event "+A);this._topics[A]=this._topics[A]||[],this._topics[A].push({handler:e,context:t})},off:function(A,e,t){A?this._offSingle(A,e,t):this._offAll(e,t)},_offAll:function(A,e){for(var t in this._topics)this._topics.hasOwnProperty(t)&&this.off(t,A,e)},_offSingle:function(A,e,t){this._topics[A]=(this._topics[A]||[]).filter(function(A){return e?A.handler!==e:A.context!==t})}});A.exports=i},function(A,e,t){var n=t(4),i=n.extend({$create:function(A){this.array=A||[]},length:{get:function(){return this.array.length}},get:function(A){return this.array[A]},indexOf:function(){return this.array.indexOf.apply(this.array,arguments)},add:function(A){var e=this.array.push(A);return this.dispatch("changed",{added:[A],removed:[]}),e},addAll:function(A){A.forEach(this.add,this)},remove:function(A){var e=this.array.indexOf(A);-1!==e&&(this.array.splice(e,1),this.dispatch("changed",{added:[],removed:[A]}))},forEach:function(A,e){return this.array.forEach(A,e)},concat:function(){return i.create(this.array.concat.apply(this.array,arguments))},filter:function(A,e){return i.create(this.array.filter(A,e))},toArray:function(){return this.array},toJSON:function(){return this.toArray()}});A.exports=i},function(A,e,t){var n=t(1),i=t(8),r=n.extend({$create:function(){var A=this;this._children=[],this._objects={pub:{instance:function(e,t){A._dispatcher.dispatch(e,t)}},sub:{instance:function(e){var t=this;return{add:function(n){A._dispatcher.on(e,n,t)},remove:function(n){A._dispatcher.off(e,n,t)}}}}},this._unknows=[],this._dispatcher=i.create()},_objects:null,_unknows:null,_children:null,register:function(A,e,t){1===arguments.length?(e=A,this._unknows.push({instance:e,readonly:t&&t.readonly})):this._objects[A]={instance:e,readonly:t&&t.readonly},e.__fastinject__=function(A){this.register(A),this.process(A)}.bind(this),this._children.forEach(function(t){t.register(A,e,{readonly:!0})})},_injectDependencies:function(A){var e;A.$meta&&A.$meta.properties&&A.$meta.properties.inject&&Object.keys(A.$meta.properties.inject).forEach(function(t){if(e=A.$meta.properties.inject[t],this._objects[e])A[t]=this._objects[e].instance;else if(e.isPrototypeOf){var n=[];Object.keys(this._objects).forEach(function(A){n.push(this._objects[A])},this),this._unknows.concat(n).forEach(function(n){e.isPrototypeOf(n.instance)&&(A[t]=n.instance)},this)}},this)},_runOnAll:function(A){Object.keys(this._objects).filter(function(A){return!this._objects[A].readonly},this).forEach(function(e){var t=this._objects[e].instance;A(t)},this),this._unknows.filter(function(A){return!A.readonly},this).forEach(function(e){A(e.instance)},this)},_runInitMethods:function(A){ +A.$meta&&A.$meta.properties&&A.$meta.properties.injectInit&&Object.keys(A.$meta.properties.injectInit).forEach(function(e){A[e]()},this)},_runDestroyMethods:function(A){A.$meta&&A.$meta.properties&&A.$meta.properties.injectDestroy&&Object.keys(A.$meta.properties.injectDestroy).forEach(function(e){A.$meta.properties.injectDestroy[e]&&A[e]()},this)},_initialiseSubscriptions:function(A){A.$meta&&A.$meta.properties&&A.$meta.properties.sub&&Object.keys(A.$meta.properties.sub).forEach(function(e){this._objects.sub.instance.call(A,A.$meta.properties.sub[e]).add(A[e])},this)},process:function(A){this._injectDependencies(A),this._runInitMethods(A),this._initialiseSubscriptions(A)},build:function(){this._runOnAll(this.process.bind(this))},createChildContext:function(){var A=r.create();return this._children.push(A),A},destroy:function(){this._runOnAll(this._runDestroyMethods.bind(this))}});A.exports=r},function(A,e,t){var n=t(12),i=t(0),r=t(4),o=r.extend({$meta:{constructors:[n.autobind]},init:{injectInit:!0,value:function(){}},destroy:{injectDestroy:!0,value:function(){}},bind:function(A,e){i.bind(this,A,e)},bindProperty:function(A,e,t){i.bindProperty(this,A,e,t)}});A.exports=o},function(A,e){var t={autobind:function(){for(var A in this)"function"==typeof this[A]&&(this[A]=this[A].bind(this))}};A.exports=t},function(A,e,t){(function(e){var n=t(1),i=t(9),r=t(14),o=t(8),s=t(10),a=t(15),c=t(4),l=t(11),u=t(0),g=t(12),h={extend:n.extend.bind(n),create:n.create.bind(n),Dispatcher:o,Context:s,Component:a,Model:c,Object:l,Collection:i,CollectionView:r,constructors:g,utils:u};e.Protoplast=h,A.exports=h}).call(e,t(3))},function(A,e,t){var n=t(4),i=n.extend({_filters:null,_sort:null,_hiddenSelected:null,selected:null,length:{get:function(){return this._current.length}},$create:function(A){this._source=A,this._current=[],this._filters=[],this._sort=[],this._source.on("changed",this._invalidate,this),this.refresh=this.refresh.bind(this),this._invalidate({added:this._source.toArray()})},refresh:function(){this._invalidate()},addFilter:function(A){this._filters.push(A),this._invalidate()},removeFilter:function(A){var e=this._filters.indexOf(A);-1!==e&&(this._filters.splice(e,1),this._invalidate())},addSort:function(A){this._sort.push(A),this._invalidate()},removeSort:function(A){var e=this._sort.indexOf(A);-1!==e&&(this._sort.splice(e,1),this._invalidate())},get:function(A){return this._current[A]},toArray:function(){return this._current},forEach:function(){return this._current.forEach.apply(this._current,arguments)},_resubscribe:function(A,e){e.removed.forEach(function(e){A.properties&&A.properties.forEach(function(A){e.off(A+"_changed",this.refresh,this)},this)},this),e.added.forEach(function(e){A.properties&&A.properties.forEach(function(A){e.on(A+"_changed",this.refresh,this)},this)},this)},_invalidate:function(A){A||(A={added:this._source.toArray(),removed:this._source.toArray()}),this._current=this._source.toArray().concat(),this._filters.forEach(function(e){this._resubscribe(e,A),this._current=this._current.filter(function(A){return e.fn(A)})},this),this._sort.length&&(this._sort.forEach(function(e){this._resubscribe(e,A)},this),this._current.sort(function(A,e){for(var t=this._sort.concat(),n=0,i=t.shift();0===n&&i;)n=i.fn(A,e),i=t.shift();return n}.bind(this))),this.selected&&-1===this._current.indexOf(this.selected)?(this._hiddenSelected=this.selected,this.selected=null):!this.selected&&this._hiddenSelected&&-1!==this._current.indexOf(this._hiddenSelected)&&(this.selected=this._hiddenSelected,this._hiddenSelected=null),this.dispatch("changed")}});A.exports=i},function(A,e,t){var n=t(10),i=t(9),r=t(11),o=t(0),s=r.extend({$meta:{domProcessors:[o.domProcessors.createComponents,o.domProcessors.injectElement]},tag:"",html:"",root:{get:function(){return this._root},set:function(A){this._root=A,this.processRoot()}},parent:null,children:{get:function(){return this._children}},$create:function(){var A;if(this._children=[],this._createRootHtml(),A=o.html.parseHTML(this.html),A.childNodes.length>1)throw new Error("Component should have only one root element");this.root=A.firstChild,this.processInstance()},processRoot:function(){var A,e,t,n;this._root&&(this.$meta.domProcessors||[]).forEach(function(i){for(e=this._root.querySelectorAll("["+i.attribute+"]"),A=0;A")},remove:function(A){var e=this._children.indexOf(A);-1!==e&&(this._children.splice(e,1),A.root.parentNode.removeChild(A.root),A.destroy())},removeAll:function(){this._children.concat().forEach(function(A){this.remove(A)},this)},attach:function(A,e,t){this._children.push(A),(t||this.root).insertBefore(A.root,e),(t||this.root).removeChild(e)},attachTo:function(A,e){s.Root(A,e).add(this)}});s.Root=function(A,e){var t=s.create();return e=e||n.create(),t.root=A,e.register(t),t},s.Mount=function(A,e,t){var i,r,o;i=document.getElementsByTagName(A),t||(t=n.create(),t.build());for(var s=0;sA?-1:A>e?1:A>=e?0:NaN}function n(A){return null===A?NaN:+A}function i(A){return!isNaN(A)}function r(A){return{left:function(e,t,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var r=n+i>>>1;A(e[r],t)<0?n=r+1:i=r}return n},right:function(e,t,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=e.length);i>n;){var r=n+i>>>1;A(e[r],t)>0?i=r:n=r+1}return n}}}function o(A){return A.length}function s(A){for(var e=1;A*e%1;)e*=10;return e}function a(A,e){for(var t in e)Object.defineProperty(A.prototype,t,{value:e[t],enumerable:!1})}function l(){this._=Object.create(null)}function c(A){return(A+="")===fo||A[0]===Co?Co+A:A}function u(A){return(A+="")[0]===Co?A.slice(1):A}function g(A){return c(A)in this._}function h(A){return(A=c(A))in this._&&delete this._[A]}function B(){var A=[];for(var e in this._)A.push(u(e));return A}function d(){var A=0;for(var e in this._)++A;return A}function p(){for(var A in this._)return!1;return!0}function Q(){this._=Object.create(null)}function E(A){return A}function f(A,e,t){return function(){var n=t.apply(e,arguments);return n===e?A:n}}function C(A,e){if(e in A)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var t=0,n=wo.length;n>t;++t){var i=wo[t]+e;if(i in A)return i}}function w(){}function I(){}function m(A){function e(){for(var e,n=t,i=-1,r=n.length;++it;t++)for(var i,r=A[t],o=0,s=r.length;s>o;o++)(i=r[o])&&e(i,o,t);return A}function P(A){return mo(A,Fo),A}function O(A){var e,t;return function(n,i,r){var o,s=A[r].update,a=s.length;for(r!=t&&(t=r,e=0),i>=e&&(e=i+1);!(o=s[e])&&++e0&&(A=A.slice(0,s));var l=Yo.get(A);return l&&(A=l,a=K),s?e?i:n:e?w:r}function W(A,e){return function(t){var n=so.event;so.event=t,e[0]=this.__data__;try{A.apply(this,e)}finally{so.event=n}}}function K(A,e){var t=W(A,e);return function(A){var e=this,n=A.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||t.call(e,A)}}function z(t){var n=".dragsuppress-"+ ++Ho,i="click"+n,r=so.select(e(t)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==ko&&(ko=!("onselectstart"in t)&&C(t.style,"userSelect")),ko){var o=A(t).style,s=o[ko];o[ko]="none"}return function(A){if(r.on(n,null),ko&&(o[ko]=s),A){var e=function(){r.on(i,null)};r.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function Z(A,t){t.changedTouches&&(t=t.changedTouches[0]);var n=A.ownerSVGElement||A;if(n.createSVGPoint){var i=n.createSVGPoint();if(0>Lo){var r=e(A);if(r.scrollX||r.scrollY){n=so.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=n[0][0].getScreenCTM();Lo=!(o.f||o.e),n.remove()}}return Lo?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i=i.matrixTransform(A.getScreenCTM().inverse()),[i.x,i.y]}var s=A.getBoundingClientRect();return[t.clientX-s.left-A.clientLeft,t.clientY-s.top-A.clientTop]}function X(){return so.event.changedTouches[0].identifier}function q(A){return A>0?1:0>A?-1:0}function $(A,e,t){return(e[0]-A[0])*(t[1]-A[1])-(e[1]-A[1])*(t[0]-A[0])}function AA(A){return A>1?0:-1>A?xo:Math.acos(A)}function eA(A){return A>1?No:-1>A?-No:Math.asin(A)}function tA(A){return((A=Math.exp(A))-1/A)/2}function nA(A){return((A=Math.exp(A))+1/A)/2}function iA(A){return((A=Math.exp(2*A))-1)/(A+1)}function rA(A){return(A=Math.sin(A/2))*A}function oA(){}function sA(A,e,t){return this instanceof sA?(this.h=+A,this.s=+e,void(this.l=+t)):arguments.length<2?A instanceof sA?new sA(A.h,A.s,A.l):wA(""+A,IA,sA):new sA(A,e,t)}function aA(A,e,t){function n(A){return A>360?A-=360:0>A&&(A+=360),60>A?r+(o-r)*A/60:180>A?o:240>A?r+(o-r)*(240-A)/60:r}function i(A){return Math.round(255*n(A))}var r,o;return A=isNaN(A)?0:(A%=360)<0?A+360:A,e=isNaN(e)?0:0>e?0:e>1?1:e,t=0>t?0:t>1?1:t,o=.5>=t?t*(1+e):t+e-t*e,r=2*t-o,new QA(i(A+120),i(A),i(A-120))}function lA(A,e,t){return this instanceof lA?(this.h=+A,this.c=+e,void(this.l=+t)):arguments.length<2?A instanceof lA?new lA(A.h,A.c,A.l):A instanceof uA?hA(A.l,A.a,A.b):hA((A=mA((A=so.rgb(A)).r,A.g,A.b)).l,A.a,A.b):new lA(A,e,t)}function cA(A,e,t){return isNaN(A)&&(A=0),isNaN(e)&&(e=0),new uA(t,Math.cos(A*=jo)*e,Math.sin(A)*e)}function uA(A,e,t){return this instanceof uA?(this.l=+A,this.a=+e,void(this.b=+t)):arguments.length<2?A instanceof uA?new uA(A.l,A.a,A.b):A instanceof lA?cA(A.h,A.c,A.l):mA((A=QA(A)).r,A.g,A.b):new uA(A,e,t)}function gA(A,e,t){var n=(A+16)/116,i=n+e/500,r=n-t/200;return i=BA(i)*Zo,n=BA(n)*Xo,r=BA(r)*qo,new QA(pA(3.2404542*i-1.5371385*n-.4985314*r),pA(-.969266*i+1.8760108*n+.041556*r),pA(.0556434*i-.2040259*n+1.0572252*r))}function hA(A,e,t){return A>0?new lA(Math.atan2(t,e)*Jo,Math.sqrt(e*e+t*t),A):new lA(NaN,NaN,A)}function BA(A){return A>.206893034?A*A*A:(A-4/29)/7.787037}function dA(A){return A>.008856?Math.pow(A,1/3):7.787037*A+4/29}function pA(A){return Math.round(255*(.00304>=A?12.92*A:1.055*Math.pow(A,1/2.4)-.055))}function QA(A,e,t){return this instanceof QA?(this.r=~~A,this.g=~~e,void(this.b=~~t)):arguments.length<2?A instanceof QA?new QA(A.r,A.g,A.b):wA(""+A,QA,aA):new QA(A,e,t)}function EA(A){return new QA(A>>16,A>>8&255,255&A)}function fA(A){return EA(A)+""}function CA(A){return 16>A?"0"+Math.max(0,A).toString(16):Math.min(255,A).toString(16)}function wA(A,e,t){var n,i,r,o=0,s=0,a=0;if(n=/([a-z]+)\((.*)\)/.exec(A=A.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return t(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(bA(i[0]),bA(i[1]),bA(i[2]))}return(r=es.get(A))?e(r.r,r.g,r.b):(null==A||"#"!==A.charAt(0)||isNaN(r=parseInt(A.slice(1),16))||(4===A.length?(o=(3840&r)>>4,o|=o>>4,s=240&r,s|=s>>4,a=15&r,a|=a<<4):7===A.length&&(o=(16711680&r)>>16,s=(65280&r)>>8,a=255&r)),e(o,s,a))}function IA(A,e,t){var n,i,r=Math.min(A/=255,e/=255,t/=255),o=Math.max(A,e,t),s=o-r,a=(o+r)/2;return s?(i=.5>a?s/(o+r):s/(2-o-r),n=A==o?(e-t)/s+(t>e?6:0):e==o?(t-A)/s+2:(A-e)/s+4,n*=60):(n=NaN,i=a>0&&1>a?0:n),new sA(n,i,a)}function mA(A,e,t){A=MA(A),e=MA(e),t=MA(t);var n=dA((.4124564*A+.3575761*e+.1804375*t)/Zo),i=dA((.2126729*A+.7151522*e+.072175*t)/Xo);return uA(116*i-16,500*(n-i),200*(i-dA((.0193339*A+.119192*e+.9503041*t)/qo)))}function MA(A){return(A/=255)<=.04045?A/12.92:Math.pow((A+.055)/1.055,2.4)}function bA(A){var e=parseFloat(A);return"%"===A.charAt(A.length-1)?Math.round(2.55*e):e}function vA(A){return"function"==typeof A?A:function(){return A}}function yA(A){return function(e,t,n){return 2===arguments.length&&"function"==typeof t&&(n=t,t=null),DA(e,t,A,n)}}function DA(A,e,t,n){function i(){var A,e=a.status;if(!e&&FA(a)||e>=200&&300>e||304===e){try{A=t.call(r,a)}catch(A){return void o.error.call(r,A)}o.load.call(r,A)}else o.error.call(r,a)}var r={},o=so.dispatch("beforesend","progress","load","error"),s={},a=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in a||!/^(http(s)?:)?\/\//.test(A)||(a=new XDomainRequest),"onload"in a?a.onload=a.onerror=i:a.onreadystatechange=function(){a.readyState>3&&i()},a.onprogress=function(A){var e=so.event;so.event=A;try{o.progress.call(r,a)}finally{so.event=e}},r.header=function(A,e){return A=(A+"").toLowerCase(),arguments.length<2?s[A]:(null==e?delete s[A]:s[A]=e+"",r)},r.mimeType=function(A){return arguments.length?(e=null==A?null:A+"",r):e},r.responseType=function(A){return arguments.length?(l=A,r):l},r.response=function(A){return t=A,r},["get","post"].forEach(function(A){r[A]=function(){return r.send.apply(r,[A].concat(lo(arguments)))}}),r.send=function(t,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),a.open(t,A,!0),null==e||"accept"in s||(s.accept=e+",*/*"),a.setRequestHeader)for(var c in s)a.setRequestHeader(c,s[c]);return null!=e&&a.overrideMimeType&&a.overrideMimeType(e),null!=l&&(a.responseType=l),null!=i&&r.on("error",i).on("load",function(A){i(null,A)}),o.beforesend.call(r,a),a.send(null==n?null:n),r},r.abort=function(){return a.abort(),r},so.rebind(r,o,"on"),null==n?r:r.get(GA(n))}function GA(A){return 1===A.length?function(e,t){A(null==e?t:null)}:A}function FA(A){var e=A.responseType;return e&&"text"!==e?A.response:A.responseText}function YA(A,e,t){var n=arguments.length;2>n&&(e=0),3>n&&(t=Date.now());var i=t+e,r={c:A,t:i,n:null};return ns?ns.n=r:ts=r,ns=r,is||(rs=clearTimeout(rs),is=1,os(kA)),r}function kA(){var A=HA(),e=LA()-A;e>24?(isFinite(e)&&(clearTimeout(rs),rs=setTimeout(kA,e)),is=0):(is=1,os(kA))}function HA(){for(var A=Date.now(),e=ts;e;)A>=e.t&&e.c(A-e.t)&&(e.c=null),e=e.n;return A}function LA(){for(var A,e=ts,t=1/0;e;)e.c?(e.t8?function(A){return A/t}:function(A){return A*t},symbol:A}}function xA(A){var e=A.decimal,t=A.thousands,n=A.grouping,i=A.currency,r=n&&t?function(A,e){for(var i=A.length,r=[],o=0,s=n[0],a=0;i>0&&s>0&&(a+s+1>e&&(s=Math.max(1,e-a)),r.push(A.substring(i-=s,i+s)),!((a+=s+1)>e));)s=n[o=(o+1)%n.length];return r.reverse().join(t)}:E;return function(A){var t=as.exec(A),n=t[1]||" ",o=t[2]||">",s=t[3]||"-",a=t[4]||"",l=t[5],c=+t[6],u=t[7],g=t[8],h=t[9],B=1,d="",p="",Q=!1,E=!0;switch(g&&(g=+g.substring(1)),(l||"0"===n&&"="===o)&&(l=n="0",o="="),h){case"n":u=!0,h="g";break;case"%":B=100,p="%",h="f";break;case"p":B=100,p="%",h="r";break;case"b":case"o":case"x":case"X":"#"===a&&(d="0"+h.toLowerCase());case"c":E=!1;case"d":Q=!0,g=0;break;case"s":B=-1,h="r"}"$"===a&&(d=i[0],p=i[1]),"r"!=h||g||(h="g"),null!=g&&("g"==h?g=Math.max(1,Math.min(21,g)):"e"!=h&&"f"!=h||(g=Math.max(0,Math.min(20,g)))),h=ls.get(h)||SA;var f=l&&u;return function(A){var t=p;if(Q&&A%1)return"";var i=0>A||0===A&&0>1/A?(A=-A,"-"):"-"===s?"":s;if(0>B){var a=so.formatPrefix(A,g);A=a.scale(A),t=a.symbol+p}else A*=B;A=h(A,g);var C,w,I=A.lastIndexOf(".");if(0>I){var m=E?A.lastIndexOf("e"):-1;0>m?(C=A,w=""):(C=A.substring(0,m),w=A.substring(m))}else C=A.substring(0,I),w=e+A.substring(I+1);!l&&u&&(C=r(C,1/0));var M=d.length+C.length+w.length+(f?0:i.length),b=c>M?new Array(M=c-M+1).join(n):"";return f&&(C=r(b+C,b.length?c-w.length:1/0)),i+=d,A=C+w,("<"===o?i+A+b:">"===o?b+i+A:"^"===o?b.substring(0,M>>=1)+i+A+b.substring(M):i+(f?A:b+A))+t}}}function SA(A){return A+""}function TA(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function NA(A,e,t){function n(e){var t=A(e),n=r(t,1);return n-e>e-t?t:n}function i(t){return e(t=A(new us(t-1)),1),t}function r(A,t){return e(A=new us(+A),t),A}function o(A,n,r){var o=i(A),s=[];if(r>1)for(;n>o;)t(o)%r||s.push(new Date(+o)),e(o,1);else for(;n>o;)s.push(new Date(+o)),e(o,1);return s}function s(A,e,t){try{us=TA;var n=new TA;return n._=A,o(n,e,t)}finally{us=Date}}A.floor=A,A.round=n,A.ceil=i,A.offset=r,A.range=o;var a=A.utc=jA(A);return a.floor=a,a.round=jA(n),a.ceil=jA(i),a.offset=jA(r),a.range=s,A}function jA(A){return function(e,t){try{us=TA;var n=new TA;return n._=e,A(n,t)._}finally{us=Date}}}function JA(A){function e(A){function e(e){for(var t,i,r,o=[],s=-1,a=0;++ss;){if(n>=l)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(r=G[o in hs?e.charAt(s++):o])||(n=r(A,t,n))<0)return-1}else if(i!=t.charCodeAt(n++))return-1}return n}function n(A,e,t){I.lastIndex=0;var n=I.exec(e.slice(t));return n?(A.w=m.get(n[0].toLowerCase()),t+n[0].length):-1}function i(A,e,t){C.lastIndex=0;var n=C.exec(e.slice(t));return n?(A.w=w.get(n[0].toLowerCase()),t+n[0].length):-1}function r(A,e,t){v.lastIndex=0;var n=v.exec(e.slice(t));return n?(A.m=y.get(n[0].toLowerCase()),t+n[0].length):-1}function o(A,e,t){M.lastIndex=0;var n=M.exec(e.slice(t));return n?(A.m=b.get(n[0].toLowerCase()),t+n[0].length):-1}function s(A,e,n){return t(A,D.c.toString(),e,n)}function a(A,e,n){return t(A,D.x.toString(),e,n)}function l(A,e,n){return t(A,D.X.toString(),e,n)}function c(A,e,t){var n=f.get(e.slice(t,t+=2).toLowerCase());return null==n?-1:(A.p=n,t)}var u=A.dateTime,g=A.date,h=A.time,B=A.periods,d=A.days,p=A.shortDays,Q=A.months,E=A.shortMonths;e.utc=function(A){function t(A){try{us=TA;var e=new us;return e._=A,n(e)}finally{us=Date}}var n=e(A);return t.parse=function(A){try{us=TA;var e=n.parse(A);return e&&e._}finally{us=Date}},t.toString=n.toString,t},e.multi=e.utc.multi=ae;var f=so.map(),C=PA(d),w=OA(d),I=PA(p),m=OA(p),M=PA(Q),b=OA(Q),v=PA(E),y=OA(E);B.forEach(function(A,e){f.set(A.toLowerCase(),e)});var D={a:function(A){return p[A.getDay()]},A:function(A){return d[A.getDay()]},b:function(A){return E[A.getMonth()]},B:function(A){return Q[A.getMonth()]},c:e(u),d:function(A,e){return _A(A.getDate(),e,2)},e:function(A,e){return _A(A.getDate(),e,2)},H:function(A,e){return _A(A.getHours(),e,2)},I:function(A,e){return _A(A.getHours()%12||12,e,2)},j:function(A,e){return _A(1+cs.dayOfYear(A),e,3)},L:function(A,e){return _A(A.getMilliseconds(),e,3)},m:function(A,e){return _A(A.getMonth()+1,e,2)},M:function(A,e){return _A(A.getMinutes(),e,2)},p:function(A){return B[+(A.getHours()>=12)]},S:function(A,e){return _A(A.getSeconds(),e,2)},U:function(A,e){return _A(cs.sundayOfYear(A),e,2)},w:function(A){return A.getDay()},W:function(A,e){return _A(cs.mondayOfYear(A),e,2)},x:e(g),X:e(h),y:function(A,e){return _A(A.getFullYear()%100,e,2)},Y:function(A,e){return _A(A.getFullYear()%1e4,e,4)},Z:oe,"%":function(){return"%"}},G={a:n,A:i,b:r,B:o,c:s,d:Ae,e:Ae,H:te,I:te,j:ee,L:re,m:$A,M:ne,p:c,S:ie,U:WA,w:VA,W:KA,x:a,X:l,y:ZA,Y:zA,Z:XA,"%":se};return e}function _A(A,e,t){var n=0>A?"-":"",i=(n?-A:A)+"",r=i.length;return n+(t>r?new Array(t-r+1).join(e)+i:i)}function PA(A){return new RegExp("^(?:"+A.map(so.requote).join("|")+")","i")}function OA(A){for(var e=new l,t=-1,n=A.length;++t68?1900:2e3)}function $A(A,e,t){Bs.lastIndex=0;var n=Bs.exec(e.slice(t,t+2));return n?(A.m=n[0]-1,t+n[0].length):-1}function Ae(A,e,t){Bs.lastIndex=0;var n=Bs.exec(e.slice(t,t+2));return n?(A.d=+n[0],t+n[0].length):-1}function ee(A,e,t){Bs.lastIndex=0;var n=Bs.exec(e.slice(t,t+3));return n?(A.j=+n[0],t+n[0].length):-1}function te(A,e,t){Bs.lastIndex=0;var n=Bs.exec(e.slice(t,t+2));return n?(A.H=+n[0],t+n[0].length):-1}function ne(A,e,t){Bs.lastIndex=0;var n=Bs.exec(e.slice(t,t+2));return n?(A.M=+n[0],t+n[0].length):-1}function ie(A,e,t){Bs.lastIndex=0;var n=Bs.exec(e.slice(t,t+2));return n?(A.S=+n[0],t+n[0].length):-1}function re(A,e,t){Bs.lastIndex=0;var n=Bs.exec(e.slice(t,t+3));return n?(A.L=+n[0],t+n[0].length):-1}function oe(A){var e=A.getTimezoneOffset(),t=e>0?"-":"+",n=Eo(e)/60|0,i=Eo(e)%60;return t+_A(n,"0",2)+_A(i,"0",2)}function se(A,e,t){ds.lastIndex=0;var n=ds.exec(e.slice(t,t+1));return n?t+n[0].length:-1}function ae(A){for(var e=A.length,t=-1;++t=0?1:-1,s=o*t,a=Math.cos(e),l=Math.sin(e),c=r*l,u=i*a+c*Math.cos(s),g=c*o*Math.sin(s);ws.add(Math.atan2(g,u)),n=A,i=a,r=l}var e,t,n,i,r;Is.point=function(o,s){Is.point=A,n=(e=o)*jo,i=Math.cos(s=(t=s)*jo/2+xo/4),r=Math.sin(s)},Is.lineEnd=function(){A(e,t)}}function de(A){var e=A[0],t=A[1],n=Math.cos(t);return[n*Math.cos(e),n*Math.sin(e),Math.sin(t)]}function pe(A,e){return A[0]*e[0]+A[1]*e[1]+A[2]*e[2]}function Qe(A,e){return[A[1]*e[2]-A[2]*e[1],A[2]*e[0]-A[0]*e[2],A[0]*e[1]-A[1]*e[0]]}function Ee(A,e){A[0]+=e[0],A[1]+=e[1],A[2]+=e[2]}function fe(A,e){return[A[0]*e,A[1]*e,A[2]*e]}function Ce(A){var e=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);A[0]/=e,A[1]/=e,A[2]/=e}function we(A){return[Math.atan2(A[1],A[0]),eA(A[2])]}function Ie(A,e){return Eo(A[0]-e[0])s;++s)i.point((t=A[s])[0],t[1]);return void i.lineEnd()}var a=new ke(t,A,null,!0),l=new ke(t,null,a,!1);a.o=l,r.push(a),o.push(l),a=new ke(n,A,null,!1),l=new ke(n,null,a,!0),a.o=l,r.push(a),o.push(l)}}),o.sort(e),Ye(r),Ye(o),r.length){for(var s=0,a=t,l=o.length;l>s;++s)o[s].e=a=!a;for(var c,u,g=r[0];;){for(var h=g,B=!0;h.v;)if((h=h.n)===g)return;c=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(B)for(var s=0,l=c.length;l>s;++s)i.point((u=c[s])[0],u[1]);else n(h.x,h.n.x,1,i);h=h.n}else{if(B){c=h.p.z;for(var s=c.length-1;s>=0;--s)i.point((u=c[s])[0],u[1])}else n(h.x,h.p.x,-1,i);h=h.p}h=h.o,c=h.z,B=!B}while(!h.v);i.lineEnd()}}}function Ye(A){if(e=A.length){for(var e,t,n=0,i=A[0];++n0){for(w||(r.polygonStart(),w=!0),r.lineStart();++o1&&2&e&&t.push(t.pop().concat(t.shift())),h.push(t.filter(Le))}var h,B,d,p=e(r),Q=i.invert(n[0],n[1]),E={point:o,lineStart:a,lineEnd:l,polygonStart:function(){E.point=c,E.lineStart=u,E.lineEnd=g,h=[],B=[]},polygonEnd:function(){E.point=o,E.lineStart=a,E.lineEnd=l,h=so.merge(h);var A=Ne(Q,B);h.length?(w||(r.polygonStart(),w=!0),Fe(h,Ue,A,t,r)):A&&(w||(r.polygonStart(),w=!0),r.lineStart(),t(null,null,1,r),r.lineEnd()),w&&(r.polygonEnd(),w=!1),h=B=null},sphere:function(){r.polygonStart(),r.lineStart(),t(null,null,1,r),r.lineEnd(),r.polygonEnd()}},f=Re(),C=e(f),w=!1;return E}}function Le(A){return A.length>1}function Re(){var A,e=[];return{lineStart:function(){e.push(A=[])},point:function(e,t){A.push([e,t])},lineEnd:w,buffer:function(){var t=e;return e=[],A=null,t},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Ue(A,e){return((A=A.x)[0]<0?A[1]-No-Ro:No-A[1])-((e=e.x)[0]<0?e[1]-No-Ro:No-e[1])}function xe(A){var e,t=NaN,n=NaN,i=NaN;return{lineStart:function(){A.lineStart(),e=1},point:function(r,o){var s=r>0?xo:-xo,a=Eo(r-t);Eo(a-xo)0?No:-No),A.point(i,n),A.lineEnd(),A.lineStart(),A.point(s,n),A.point(r,n),e=0):i!==s&&a>=xo&&(Eo(t-i)Ro?Math.atan((Math.sin(e)*(r=Math.cos(n))*Math.sin(t)-Math.sin(n)*(i=Math.cos(e))*Math.sin(A))/(i*r*o)):(e+n)/2}function Te(A,e,t,n){var i;if(null==A)i=t*No,n.point(-xo,i),n.point(0,i),n.point(xo,i),n.point(xo,0),n.point(xo,-i),n.point(0,-i),n.point(-xo,-i),n.point(-xo,0),n.point(-xo,i);else if(Eo(A[0]-e[0])>Ro){var r=A[0]s;++s){var l=e[s],c=l.length;if(c)for(var u=l[0],g=u[0],h=u[1]/2+xo/4,B=Math.sin(h),d=Math.cos(h),p=1;;){p===c&&(p=0),A=l[p];var Q=A[0],E=A[1]/2+xo/4,f=Math.sin(E),C=Math.cos(E),w=Q-g,I=w>=0?1:-1,m=I*w,M=m>xo,b=B*f;if(ws.add(Math.atan2(b*I*Math.sin(m),d*C+b*Math.cos(m))),r+=M?w+I*So:w,M^g>=t^Q>=t){var v=Qe(de(u),de(A));Ce(v);var y=Qe(i,v);Ce(y);var D=(M^w>=0?-1:1)*eA(y[2]);(n>D||n===D&&(v[0]||v[1]))&&(o+=M^w>=0?1:-1)}if(!p++)break;g=Q,B=f,d=C,u=A}}return(-Ro>r||Ro>r&&-Ro>ws)^1&o}function je(A){function e(A,e){return Math.cos(A)*Math.cos(e)>r}function t(A){var t,r,a,l,c;return{lineStart:function(){l=a=!1,c=1},point:function(u,g){var h,B=[u,g],d=e(u,g),p=o?d?0:i(u,g):d?i(u+(0>u?xo:-xo),g):0;if(!t&&(l=a=d)&&A.lineStart(),d!==a&&(h=n(t,B),(Ie(t,h)||Ie(B,h))&&(B[0]+=Ro,B[1]+=Ro,d=e(B[0],B[1]))),d!==a)c=0,d?(A.lineStart(),h=n(B,t),A.point(h[0],h[1])):(h=n(t,B),A.point(h[0],h[1]),A.lineEnd()),t=h;else if(s&&t&&o^d){var Q;p&r||!(Q=n(B,t,!0))||(c=0,o?(A.lineStart(),A.point(Q[0][0],Q[0][1]),A.point(Q[1][0],Q[1][1]),A.lineEnd()):(A.point(Q[1][0],Q[1][1]),A.lineEnd(),A.lineStart(),A.point(Q[0][0],Q[0][1])))}!d||t&&Ie(t,B)||A.point(B[0],B[1]),t=B,a=d,r=p},lineEnd:function(){a&&A.lineEnd(),t=null},clean:function(){return c|(l&&a)<<1}}}function n(A,e,t){var n=de(A),i=de(e),o=[1,0,0],s=Qe(n,i),a=pe(s,s),l=s[0],c=a-l*l;if(!c)return!t&&A;var u=r*a/c,g=-r*l/c,h=Qe(o,s),B=fe(o,u);Ee(B,fe(s,g));var d=h,p=pe(B,d),Q=pe(d,d),E=p*p-Q*(pe(B,B)-1);if(!(0>E)){var f=Math.sqrt(E),C=fe(d,(-p-f)/Q);if(Ee(C,B),C=we(C),!t)return C;var w,I=A[0],m=e[0],M=A[1],b=e[1];I>m&&(w=I,I=m,m=w);var v=m-I,y=Eo(v-xo)v;if(!y&&M>b&&(w=M,M=b,b=w),D?y?M+b>0^C[1]<(Eo(C[0]-I)xo^(I<=C[0]&&C[0]<=m)){var G=fe(d,(-p+f)/Q);return Ee(G,B),[C,we(G)]}}}function i(e,t){var n=o?A:xo-A,i=0;return-n>e?i|=1:e>n&&(i|=2),-n>t?i|=4:t>n&&(i|=8),i}var r=Math.cos(A),o=r>0,s=Eo(r)>Ro;return He(e,t,Bt(A,6*jo),o?[0,-A]:[-xo,A-xo])}function Je(A,e,t,n){return function(i){var r,o=i.a,s=i.b,a=o.x,l=o.y,c=s.x,u=s.y,g=0,h=1,B=c-a,d=u-l;if(r=A-a,B||!(r>0)){if(r/=B,0>B){if(g>r)return;h>r&&(h=r)}else if(B>0){if(r>h)return;r>g&&(g=r)}if(r=t-a,B||!(0>r)){if(r/=B,0>B){if(r>h)return;r>g&&(g=r)}else if(B>0){if(g>r)return;h>r&&(h=r)}if(r=e-l,d||!(r>0)){if(r/=d,0>d){if(g>r)return;h>r&&(h=r)}else if(d>0){if(r>h)return;r>g&&(g=r)}if(r=n-l,d||!(0>r)){if(r/=d,0>d){if(r>h)return;r>g&&(g=r)}else if(d>0){if(g>r)return;h>r&&(h=r)}return g>0&&(i.a={x:a+g*B,y:l+g*d}),1>h&&(i.b={x:a+h*B,y:l+h*d}),i}}}}}}function _e(A,e,t,n){function i(n,i){return Eo(n[0]-A)0?0:3:Eo(n[0]-t)0?2:1:Eo(n[1]-e)0?1:0:i>0?3:2}function r(A,e){return o(A.x,e.x)}function o(A,e){var t=i(A,1),n=i(e,1);return t!==n?t-n:0===t?e[1]-A[1]:1===t?A[0]-e[0]:2===t?A[1]-e[1]:e[0]-A[0]}return function(s){function a(A){for(var e=0,t=p.length,n=A[1],i=0;t>i;++i)for(var r,o=1,s=p[i],a=s.length,l=s[0];a>o;++o)r=s[o],l[1]<=n?r[1]>n&&$(l,r,A)>0&&++e:r[1]<=n&&$(l,r,A)<0&&--e,l=r;return 0!==e}function l(r,s,a,l){var c=0,u=0;if(null==r||(c=i(r,a))!==(u=i(s,a))||o(r,s)<0^a>0)do{l.point(0===c||3===c?A:t,c>1?n:e)}while((c=(c+a+4)%4)!==u);else l.point(s[0],s[1])}function c(i,r){return i>=A&&t>=i&&r>=e&&n>=r}function u(A,e){c(A,e)&&s.point(A,e)}function g(){G.point=B,p&&p.push(Q=[]),M=!0,m=!1,w=I=NaN}function h(){d&&(B(E,f),C&&m&&y.rejoin(),d.push(y.buffer())),G.point=u,m&&s.lineEnd()}function B(A,e){A=Math.max(-Us,Math.min(Us,A)),e=Math.max(-Us,Math.min(Us,e));var t=c(A,e);if(p&&Q.push([A,e]),M)E=A,f=e,C=t,M=!1,t&&(s.lineStart(),s.point(A,e));else if(t&&m)s.point(A,e);else{var n={a:{x:w,y:I},b:{x:A,y:e}};D(n)?(m||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),t||s.lineEnd(),b=!1):t&&(s.lineStart(),s.point(A,e),b=!1)}w=A,I=e,m=t}var d,p,Q,E,f,C,w,I,m,M,b,v=s,y=Re(),D=Je(A,e,t,n),G={point:u,lineStart:g,lineEnd:h,polygonStart:function(){s=y,d=[],p=[],b=!0},polygonEnd:function(){s=v,d=so.merge(d);var e=a([A,n]),t=b&&e,i=d.length;(t||i)&&(s.polygonStart(),t&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&Fe(d,r,e,l,s),s.polygonEnd()),d=p=Q=null}};return G}}function Pe(A){var e=0,t=xo/3,n=ot(A),i=n(e,t);return i.parallels=function(A){return arguments.length?n(e=A[0]*xo/180,t=A[1]*xo/180):[e/xo*180,t/xo*180]},i}function Oe(A,e){function t(A,e){var t=Math.sqrt(r-2*i*Math.sin(e))/i;return[t*Math.sin(A*=i),o-t*Math.cos(A)]}var n=Math.sin(A),i=(n+Math.sin(e))/2,r=1+n*(2*i-n),o=Math.sqrt(r)/i;return t.invert=function(A,e){var t=o-e;return[Math.atan2(A,t)/i,eA((r-(A*A+t*t)*i*i)/(2*i))]},t}function Ve(){function A(A,e){Ss+=i*A-n*e,n=A,i=e}var e,t,n,i;_s.point=function(r,o){_s.point=A,e=n=r,t=i=o},_s.lineEnd=function(){A(e,t)}}function We(A,e){Ts>A&&(Ts=A),A>js&&(js=A),Ns>e&&(Ns=e),e>Js&&(Js=e)}function Ke(){function A(A,e){o.push("M",A,",",e,r)}function e(A,e){o.push("M",A,",",e),s.point=t}function t(A,e){o.push("L",A,",",e)}function n(){s.point=A}function i(){o.push("Z")}var r=ze(4.5),o=[],s={point:A,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=A},pointRadius:function(A){return r=ze(A),s},result:function(){if(o.length){var A=o.join("");return o=[],A}}};return s}function ze(A){return"m0,"+A+"a"+A+","+A+" 0 1,1 0,"+-2*A+"a"+A+","+A+" 0 1,1 0,"+2*A+"z"}function Ze(A,e){bs+=A,vs+=e,++ys}function Xe(){function A(A,n){var i=A-e,r=n-t,o=Math.sqrt(i*i+r*r);Ds+=o*(e+A)/2,Gs+=o*(t+n)/2,Fs+=o,Ze(e=A,t=n)}var e,t;Os.point=function(n,i){Os.point=A,Ze(e=n,t=i)}}function qe(){Os.point=Ze}function $e(){function A(A,e){var t=A-n,r=e-i,o=Math.sqrt(t*t+r*r);Ds+=o*(n+A)/2,Gs+=o*(i+e)/2,Fs+=o,o=i*A-n*e,Ys+=o*(n+A),ks+=o*(i+e),Hs+=3*o,Ze(n=A,i=e)}var e,t,n,i;Os.point=function(r,o){Os.point=A,Ze(e=n=r,t=i=o)},Os.lineEnd=function(){A(e,t)}}function At(A){function e(e,t){A.moveTo(e+o,t),A.arc(e,t,o,0,So)}function t(e,t){A.moveTo(e,t),s.point=n}function n(e,t){A.lineTo(e,t)}function i(){s.point=e}function r(){A.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=t},lineEnd:i, -polygonStart:function(){s.lineEnd=r},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(A){return o=A,s},result:w};return s}function et(A){function e(A){return(s?n:t)(A)}function t(e){return it(e,function(t,n){t=A(t,n),e.point(t[0],t[1])})}function n(e){function t(t,n){t=A(t,n),e.point(t[0],t[1])}function n(){f=NaN,M.point=r,e.lineStart()}function r(t,n){var r=de([t,n]),o=A(t,n);i(f,C,E,w,I,m,f=o[0],C=o[1],E=t,w=r[0],I=r[1],m=r[2],s,e),e.point(f,C)}function o(){M.point=t,e.lineEnd()}function a(){n(),M.point=l,M.lineEnd=c}function l(A,e){r(u=A,g=e),h=f,B=C,d=w,p=I,Q=m,M.point=r}function c(){i(f,C,E,w,I,m,h,B,u,d,p,Q,s,e),M.lineEnd=o,o()}var u,g,h,B,d,p,Q,E,f,C,w,I,m,M={point:t,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),M.lineStart=a},polygonEnd:function(){e.polygonEnd(),M.lineStart=n}};return M}function i(e,t,n,s,a,l,c,u,g,h,B,d,p,Q){var E=c-e,f=u-t,C=E*E+f*f;if(C>4*r&&p--){var w=s+h,I=a+B,m=l+d,M=Math.sqrt(w*w+I*I+m*m),b=Math.asin(m/=M),v=Eo(Eo(m)-1)r||Eo((E*F+f*Y)/C-.5)>.3||o>s*h+a*B+l*d)&&(i(e,t,n,s,a,l,D,G,v,w/=M,I/=M,m,p,Q),Q.point(D,G),i(D,G,v,w,I,m,c,u,g,h,B,d,p,Q))}}var r=.5,o=Math.cos(30*jo),s=16;return e.precision=function(A){return arguments.length?(s=(r=A*A)>0&&16,e):Math.sqrt(r)},e}function tt(A){var e=et(function(e,t){return A([e*Jo,t*Jo])});return function(A){return st(e(A))}}function nt(A){this.stream=A}function it(A,e){return{point:e,sphere:function(){A.sphere()},lineStart:function(){A.lineStart()},lineEnd:function(){A.lineEnd()},polygonStart:function(){A.polygonStart()},polygonEnd:function(){A.polygonEnd()}}}function rt(A){return ot(function(){return A})()}function ot(A){function e(A){return A=s(A[0]*jo,A[1]*jo),[A[0]*g+a,l-A[1]*g]}function t(A){return(A=s.invert((A[0]-a)/g,(l-A[1])/g))&&[A[0]*Jo,A[1]*Jo]}function n(){s=De(o=ct(Q,f,C),r);var A=r(d,p);return a=h-A[0]*g,l=B+A[1]*g,i()}function i(){return c&&(c.valid=!1,c=null),e}var r,o,s,a,l,c,u=et(function(A,e){return A=r(A,e),[A[0]*g+a,l-A[1]*g]}),g=150,h=480,B=250,d=0,p=0,Q=0,f=0,C=0,w=Rs,I=E,m=null,M=null;return e.stream=function(A){return c&&(c.valid=!1),c=st(w(o,u(I(A)))),c.valid=!0,c},e.clipAngle=function(A){return arguments.length?(w=null==A?(m=A,Rs):je((m=+A)*jo),i()):m},e.clipExtent=function(A){return arguments.length?(M=A,I=A?_e(A[0][0],A[0][1],A[1][0],A[1][1]):E,i()):M},e.scale=function(A){return arguments.length?(g=+A,n()):g},e.translate=function(A){return arguments.length?(h=+A[0],B=+A[1],n()):[h,B]},e.center=function(A){return arguments.length?(d=A[0]%360*jo,p=A[1]%360*jo,n()):[d*Jo,p*Jo]},e.rotate=function(A){return arguments.length?(Q=A[0]%360*jo,f=A[1]%360*jo,C=A.length>2?A[2]%360*jo:0,n()):[Q*Jo,f*Jo,C*Jo]},so.rebind(e,u,"precision"),function(){return r=A.apply(this,arguments),e.invert=r.invert&&t,n()}}function st(A){return it(A,function(e,t){A.point(e*jo,t*jo)})}function at(A,e){return[A,e]}function lt(A,e){return[A>xo?A-So:-xo>A?A+So:A,e]}function ct(A,e,t){return A?e||t?De(gt(A),ht(e,t)):gt(A):e||t?ht(e,t):lt}function ut(A){return function(e,t){return e+=A,[e>xo?e-So:-xo>e?e+So:e,t]}}function gt(A){var e=ut(A);return e.invert=ut(-A),e}function ht(A,e){function t(A,e){var t=Math.cos(e),s=Math.cos(A)*t,a=Math.sin(A)*t,l=Math.sin(e),c=l*n+s*i;return[Math.atan2(a*r-c*o,s*n-l*i),eA(c*r+a*o)]}var n=Math.cos(A),i=Math.sin(A),r=Math.cos(e),o=Math.sin(e);return t.invert=function(A,e){var t=Math.cos(e),s=Math.cos(A)*t,a=Math.sin(A)*t,l=Math.sin(e),c=l*r-a*o;return[Math.atan2(a*r+l*o,s*n+c*i),eA(c*n-s*i)]},t}function Bt(A,e){var t=Math.cos(A),n=Math.sin(A);return function(i,r,o,s){var a=o*e;null!=i?(i=dt(t,i),r=dt(t,r),(o>0?r>i:i>r)&&(i+=o*So)):(i=A+o*So,r=A-.5*a);for(var l,c=i;o>0?c>r:r>c;c-=a)s.point((l=we([t,-n*Math.cos(c),-n*Math.sin(c)]))[0],l[1])}}function dt(A,e){var t=de(e);t[0]-=A,Ce(t);var n=AA(-t[1]);return((-t[2]<0?-n:n)+2*Math.PI-Ro)%(2*Math.PI)}function pt(A,e,t){var n=so.range(A,e-Ro,t).concat(e);return function(A){return n.map(function(e){return[A,e]})}}function Qt(A,e,t){var n=so.range(A,e-Ro,t).concat(e);return function(A){return n.map(function(e){return[e,A]})}}function Et(A){return A.source}function ft(A){return A.target}function Ct(A,e,t,n){var i=Math.cos(e),r=Math.sin(e),o=Math.cos(n),s=Math.sin(n),a=i*Math.cos(A),l=i*Math.sin(A),c=o*Math.cos(t),u=o*Math.sin(t),g=2*Math.asin(Math.sqrt(rA(n-e)+i*o*rA(t-A))),h=1/Math.sin(g),B=g?function(A){var e=Math.sin(A*=g)*h,t=Math.sin(g-A)*h,n=t*a+e*c,i=t*l+e*u,o=t*r+e*s;return[Math.atan2(i,n)*Jo,Math.atan2(o,Math.sqrt(n*n+i*i))*Jo]}:function(){return[A*Jo,e*Jo]};return B.distance=g,B}function wt(){function A(A,i){var r=Math.sin(i*=jo),o=Math.cos(i),s=Eo((A*=jo)-e),a=Math.cos(s);Vs+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*r-t*o*a)*s),t*r+n*o*a),e=A,t=r,n=o}var e,t,n;Ws.point=function(i,r){e=i*jo,t=Math.sin(r*=jo),n=Math.cos(r),Ws.point=A},Ws.lineEnd=function(){Ws.point=Ws.lineEnd=w}}function It(A,e){function t(e,t){var n=Math.cos(e),i=Math.cos(t),r=A(n*i);return[r*i*Math.sin(e),r*Math.sin(t)]}return t.invert=function(A,t){var n=Math.sqrt(A*A+t*t),i=e(n),r=Math.sin(i),o=Math.cos(i);return[Math.atan2(A*r,n*o),Math.asin(n&&t*r/n)]},t}function mt(A,e){function t(A,e){o>0?-No+Ro>e&&(e=-No+Ro):e>No-Ro&&(e=No-Ro);var t=o/Math.pow(i(e),r);return[t*Math.sin(r*A),o-t*Math.cos(r*A)]}var n=Math.cos(A),i=function(A){return Math.tan(xo/4+A/2)},r=A===e?Math.sin(A):Math.log(n/Math.cos(e))/Math.log(i(e)/i(A)),o=n*Math.pow(i(A),r)/r;return r?(t.invert=function(A,e){var t=o-e,n=q(r)*Math.sqrt(A*A+t*t);return[Math.atan2(A,t)/r,2*Math.atan(Math.pow(o/n,1/r))-No]},t):bt}function Mt(A,e){function t(A,e){var t=r-e;return[t*Math.sin(i*A),r-t*Math.cos(i*A)]}var n=Math.cos(A),i=A===e?Math.sin(A):(n-Math.cos(e))/(e-A),r=n/i+A;return Eo(i)i;i++){for(;n>1&&$(A[t[n-2]],A[t[n-1]],A[i])<=0;)--n;t[n++]=i}return t.slice(0,n)}function Yt(A,e){return A[0]-e[0]||A[1]-e[1]}function kt(A,e,t){return(t[0]-e[0])*(A[1]-e[1])<(t[1]-e[1])*(A[0]-e[0])}function Ht(A,e,t,n){var i=A[0],r=t[0],o=e[0]-i,s=n[0]-r,a=A[1],l=t[1],c=e[1]-a,u=n[1]-l,g=(s*(a-l)-u*(i-r))/(u*o-s*c);return[i+g*o,a+g*c]}function Lt(A){var e=A[0],t=A[A.length-1];return!(e[0]-t[0]||e[1]-t[1])}function Rt(){tn(this),this.edge=this.site=this.circle=null}function Ut(A){var e=ra.pop()||new Rt;return e.site=A,e}function xt(A){Wt(A),ta.remove(A),ra.push(A),tn(A)}function St(A){var e=A.circle,t=e.x,n=e.cy,i={x:t,y:n},r=A.P,o=A.N,s=[A];xt(A);for(var a=r;a.circle&&Eo(t-a.circle.x)c;++c)l=s[c],a=s[c-1],$t(l.edge,a.site,l.site,i);a=s[0],l=s[u-1],l.edge=Xt(a.site,l.site,null,i),Vt(a),Vt(l)}function Tt(A){for(var e,t,n,i,r=A.x,o=A.y,s=ta._;s;)if((n=Nt(s,o)-r)>Ro)s=s.L;else{if(!((i=r-jt(s,o))>Ro)){n>-Ro?(e=s.P,t=s):i>-Ro?(e=s,t=s.N):e=t=s;break}if(!s.R){e=s;break}s=s.R}var a=Ut(A);if(ta.insert(e,a),e||t){if(e===t)return Wt(e),t=Ut(e.site),ta.insert(a,t),a.edge=t.edge=Xt(e.site,a.site),Vt(e),void Vt(t);if(!t)return void(a.edge=Xt(e.site,a.site));Wt(e),Wt(t);var l=e.site,c=l.x,u=l.y,g=A.x-c,h=A.y-u,B=t.site,d=B.x-c,p=B.y-u,Q=2*(g*p-h*d),E=g*g+h*h,f=d*d+p*p,C={x:(p*E-h*f)/Q+c,y:(g*f-d*E)/Q+u};$t(t.edge,l,B,C),a.edge=Xt(l,A,null,C),t.edge=Xt(A,B,null,C),Vt(e),Vt(t)}}function Nt(A,e){var t=A.site,n=t.x,i=t.y,r=i-e;if(!r)return n;var o=A.P;if(!o)return-1/0;t=o.site;var s=t.x,a=t.y,l=a-e;if(!l)return s;var c=s-n,u=1/r-1/l,g=c/l;return u?(-g+Math.sqrt(g*g-2*u*(c*c/(-2*l)-a+l/2+i-r/2)))/u+n:(n+s)/2}function jt(A,e){var t=A.N;if(t)return Nt(t,e);var n=A.site;return n.y===e?n.x:1/0}function Jt(A){this.site=A,this.edges=[]}function _t(A){for(var e,t,n,i,r,o,s,a,l,c,u=A[0][0],g=A[1][0],h=A[0][1],B=A[1][1],d=ea,p=d.length;p--;)if((r=d[p])&&r.prepare())for(s=r.edges,a=s.length,o=0;a>o;)c=s[o].end(),n=c.x,i=c.y,l=s[++o%a].start(),e=l.x,t=l.y,(Eo(n-e)>Ro||Eo(i-t)>Ro)&&(s.splice(o,0,new An(qt(r.site,c,Eo(n-u)Ro?{x:u,y:Eo(e-u)Ro?{x:Eo(t-B)Ro?{x:g,y:Eo(e-g)Ro?{x:Eo(t-h)=-Uo)){var h=a*a+l*l,B=c*c+u*u,d=(u*h-l*B)/g,p=(a*B-c*h)/g,u=p+s,Q=oa.pop()||new Ot;Q.arc=A,Q.site=i,Q.x=d+o,Q.y=u+Math.sqrt(d*d+p*p),Q.cy=u,A.circle=Q;for(var E=null,f=ia._;f;)if(Q.yp||p>=s)return;if(g>B){if(r){if(r.y>=l)return}else r={x:p,y:a};t={x:p,y:l}}else{if(r){if(r.yn||n>1)if(g>B){if(r){if(r.y>=l)return}else r={x:(a-i)/n,y:a};t={x:(l-i)/n,y:l}}else{if(r){if(r.yh){if(r){if(r.x>=s)return}else r={x:o,y:n*o+i};t={x:s,y:n*s+i}}else{if(r){if(r.xr||u>o||n>g||i>h)){if(B=l.point){var B,d=e-l.x,p=t-l.y,Q=d*d+p*p;if(a>Q){var E=Math.sqrt(a=Q);n=e-E,i=t-E,r=e+E,o=t+E,s=B}}for(var f=l.nodes,C=.5*(c+g),w=.5*(u+h),I=e>=C,m=t>=w,M=m<<1|I,b=M+4;b>M;++M)if(l=f[3&M])switch(3&M){case 0:A(l,c,u,C,w);break;case 1:A(l,C,u,g,w);break;case 2:A(l,c,w,C,h);break;case 3:A(l,C,w,g,h)}}}(A,n,i,r,o),s}function dn(A,e){A=so.rgb(A),e=so.rgb(e);var t=A.r,n=A.g,i=A.b,r=e.r-t,o=e.g-n,s=e.b-i;return function(A){return"#"+CA(Math.round(t+r*A))+CA(Math.round(n+o*A))+CA(Math.round(i+s*A))}}function pn(A,e){var t,n={},i={};for(t in A)t in e?n[t]=fn(A[t],e[t]):i[t]=A[t];for(t in e)t in A||(i[t]=e[t]);return function(A){for(t in n)i[t]=n[t](A);return i}}function Qn(A,e){return A=+A,e=+e,function(t){return A*(1-t)+e*t}}function En(A,e){var t,n,i,r=aa.lastIndex=la.lastIndex=0,o=-1,s=[],a=[];for(A+="",e+="";(t=aa.exec(A))&&(n=la.exec(e));)(i=n.index)>r&&(i=e.slice(r,i),s[o]?s[o]+=i:s[++o]=i),(t=t[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,a.push({i:o,x:Qn(t,n)})),r=la.lastIndex;return rn;++n)s[(t=a[n]).i]=t.x(A);return s.join("")})}function fn(A,e){for(var t,n=so.interpolators.length;--n>=0&&!(t=so.interpolators[n](A,e)););return t}function Cn(A,e){var t,n=[],i=[],r=A.length,o=e.length,s=Math.min(A.length,e.length);for(t=0;s>t;++t)n.push(fn(A[t],e[t]));for(;r>t;++t)i[t]=A[t];for(;o>t;++t)i[t]=e[t];return function(A){for(t=0;s>t;++t)i[t]=n[t](A);return i}}function wn(A){return function(e){return 0>=e?0:e>=1?1:A(e)}}function In(A){return function(e){return 1-A(1-e)}}function mn(A){return function(e){return.5*(.5>e?A(2*e):2-A(2-2*e))}}function Mn(A){return A*A}function bn(A){return A*A*A}function vn(A){if(0>=A)return 0;if(A>=1)return 1;var e=A*A,t=e*A;return 4*(.5>A?t:3*(A-e)+t-.75)}function yn(A){return function(e){return Math.pow(e,A)}}function Dn(A){return 1-Math.cos(A*No)}function Gn(A){return Math.pow(2,10*(A-1))}function Fn(A){return 1-Math.sqrt(1-A*A)}function Yn(A,e){var t;return arguments.length<2&&(e=.45),arguments.length?t=e/So*Math.asin(1/A):(A=1,t=e/4),function(n){return 1+A*Math.pow(2,-10*n)*Math.sin((n-t)*So/e)}}function kn(A){return A||(A=1.70158),function(e){return e*e*((A+1)*e-A)}}function Hn(A){return 1/2.75>A?7.5625*A*A:2/2.75>A?7.5625*(A-=1.5/2.75)*A+.75:2.5/2.75>A?7.5625*(A-=2.25/2.75)*A+.9375:7.5625*(A-=2.625/2.75)*A+.984375}function Ln(A,e){A=so.hcl(A),e=so.hcl(e);var t=A.h,n=A.c,i=A.l,r=e.h-t,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(r)?(r=0,t=isNaN(t)?e.h:t):r>180?r-=360:-180>r&&(r+=360),function(A){return cA(t+r*A,n+o*A,i+s*A)+""}}function Rn(A,e){A=so.hsl(A),e=so.hsl(e);var t=A.h,n=A.s,i=A.l,r=e.h-t,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(r)?(r=0,t=isNaN(t)?e.h:t):r>180?r-=360:-180>r&&(r+=360),function(A){return aA(t+r*A,n+o*A,i+s*A)+""}}function Un(A,e){A=so.lab(A),e=so.lab(e);var t=A.l,n=A.a,i=A.b,r=e.l-t,o=e.a-n,s=e.b-i;return function(A){return gA(t+r*A,n+o*A,i+s*A)+""}}function xn(A,e){return e-=A,function(t){return Math.round(A+e*t)}}function Sn(A){var e=[A.a,A.b],t=[A.c,A.d],n=Nn(e),i=Tn(e,t),r=Nn(jn(t,e,-i))||0;e[0]*t[1]180?e+=360:e-A>180&&(A+=360),n.push({i:t.push(Jn(t)+"rotate(",null,")")-2,x:Qn(A,e)})):e&&t.push(Jn(t)+"rotate("+e+")")}function On(A,e,t,n){A!==e?n.push({i:t.push(Jn(t)+"skewX(",null,")")-2,x:Qn(A,e)}):e&&t.push(Jn(t)+"skewX("+e+")")}function Vn(A,e,t,n){if(A[0]!==e[0]||A[1]!==e[1]){var i=t.push(Jn(t)+"scale(",null,",",null,")");n.push({i:i-4,x:Qn(A[0],e[0])},{i:i-2,x:Qn(A[1],e[1])})}else 1===e[0]&&1===e[1]||t.push(Jn(t)+"scale("+e+")")}function Wn(A,e){var t=[],n=[];return A=so.transform(A),e=so.transform(e),_n(A.translate,e.translate,t,n),Pn(A.rotate,e.rotate,t,n),On(A.skew,e.skew,t,n),Vn(A.scale,e.scale,t,n),A=e=null,function(A){for(var e,i=-1,r=n.length;++i=0;)t.push(i[n])}function oi(A,e){for(var t=[A],n=[];null!=(A=t.pop());)if(n.push(A),(r=A.children)&&(i=r.length))for(var i,r,o=-1;++ot;++t)(e=A[t][1])>i&&(n=t,i=e);return n}function Qi(A){return A.reduce(Ei,0)}function Ei(A,e){return A+e[1]}function fi(A,e){return Ci(A,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Ci(A,e){for(var t=-1,n=+A[0],i=(A[1]-n)/e,r=[];++t<=e;)r[t]=i*t+n;return r}function wi(A){return[so.min(A),so.max(A)]}function Ii(A,e){return A.value-e.value}function mi(A,e){var t=A._pack_next;A._pack_next=e,e._pack_prev=A,e._pack_next=t,t._pack_prev=e}function Mi(A,e){A._pack_next=e,e._pack_prev=A}function bi(A,e){var t=e.x-A.x,n=e.y-A.y,i=A.r+e.r;return.999*i*i>t*t+n*n}function vi(A){function e(A){c=Math.min(A.x-A.r,c),u=Math.max(A.x+A.r,u),g=Math.min(A.y-A.r,g),h=Math.max(A.y+A.r,h)}if((t=A.children)&&(l=t.length)){var t,n,i,r,o,s,a,l,c=1/0,u=-1/0,g=1/0,h=-1/0;if(t.forEach(yi),n=t[0],n.x=-n.r,n.y=0,e(n),l>1&&(i=t[1],i.x=i.r,i.y=0,e(i),l>2))for(r=t[2],Fi(n,i,r),e(r),mi(n,r),n._pack_prev=r,mi(r,i),i=n._pack_next,o=3;l>o;o++){Fi(n,i,r=t[o]);var B=0,d=1,p=1;for(s=i._pack_next;s!==i;s=s._pack_next,d++)if(bi(s,r)){B=1;break}if(1==B)for(a=n._pack_prev;a!==s._pack_prev&&!bi(a,r);a=a._pack_prev,p++);B?(p>d||d==p&&i.ro;o++)r=t[o],r.x-=Q,r.y-=E,f=Math.max(f,r.r+Math.sqrt(r.x*r.x+r.y*r.y));A.r=f,t.forEach(Di)}}function yi(A){A._pack_next=A._pack_prev=A}function Di(A){delete A._pack_next,delete A._pack_prev}function Gi(A,e,t,n){var i=A.children;if(A.x=e+=n*A.x,A.y=t+=n*A.y,A.r*=n,i)for(var r=-1,o=i.length;++r=0;)e=i[r],e.z+=t,e.m+=t,t+=e.s+(n+=e.c)}function Ui(A,e,t){return A.a.parent===e.parent?A.a:t}function xi(A){return 1+so.max(A,function(A){return A.y})}function Si(A){return A.reduce(function(A,e){return A+e.x},0)/A.length}function Ti(A){var e=A.children;return e&&e.length?Ti(e[0]):A}function Ni(A){var e,t=A.children;return t&&(e=t.length)?Ni(t[e-1]):A}function ji(A){return{x:A.x,y:A.y,dx:A.dx,dy:A.dy}}function Ji(A,e){var t=A.x+e[3],n=A.y+e[0],i=A.dx-e[1]-e[3],r=A.dy-e[0]-e[2];return 0>i&&(t+=i/2,i=0),0>r&&(n+=r/2,r=0),{x:t,y:n,dx:i,dy:r}}function _i(A){var e=A[0],t=A[A.length-1];return t>e?[e,t]:[t,e]}function Pi(A){return A.rangeExtent?A.rangeExtent():_i(A.range())}function Oi(A,e,t,n){var i=t(A[0],A[1]),r=n(e[0],e[1]);return function(A){return r(i(A))}}function Vi(A,e){var t,n=0,i=A.length-1,r=A[n],o=A[i];return r>o&&(t=n,n=i,i=t,t=r,r=o,o=t),A[n]=e.floor(r),A[i]=e.ceil(o),A}function Wi(A){return A?{floor:function(e){return Math.floor(e/A)*A},ceil:function(e){return Math.ceil(e/A)*A}}:Ca}function Ki(A,e,t,n){var i=[],r=[],o=0,s=Math.min(A.length,e.length)-1;for(A[s]2?Ki:Oi,a=n?zn:Kn;return o=i(A,e,a,t),s=i(e,A,a,fn),r}function r(A){return o(A)}var o,s;return r.invert=function(A){return s(A)},r.domain=function(e){return arguments.length?(A=e.map(Number),i()):A},r.range=function(A){return arguments.length?(e=A,i()):e},r.rangeRound=function(A){return r.range(A).interpolate(xn)},r.clamp=function(A){return arguments.length?(n=A,i()):n},r.interpolate=function(A){return arguments.length?(t=A,i()):t},r.ticks=function(e){return $i(A,e)},r.tickFormat=function(e,t){return Ar(A,e,t)},r.nice=function(e){return Xi(A,e),i()},r.copy=function(){return zi(A,e,t,n)},i()}function Zi(A,e){return so.rebind(A,e,"range","rangeRound","interpolate","clamp")}function Xi(A,e){return Vi(A,Wi(qi(A,e)[2])),Vi(A,Wi(qi(A,e)[2])),A}function qi(A,e){null==e&&(e=10);var t=_i(A),n=t[1]-t[0],i=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),r=e/n*i;return.15>=r?i*=10:.35>=r?i*=5:.75>=r&&(i*=2),t[0]=Math.ceil(t[0]/i)*i,t[1]=Math.floor(t[1]/i)*i+.5*i,t[2]=i,t}function $i(A,e){return so.range.apply(so,qi(A,e))}function Ar(A,e,t){var n=qi(A,e);if(t){var i=as.exec(t);if(i.shift(),"s"===i[8]){var r=so.formatPrefix(Math.max(Eo(n[0]),Eo(n[1])));return i[7]||(i[7]="."+er(r.scale(n[2]))),i[8]="f",t=so.format(i.join("")),function(A){return t(r.scale(A))+r.symbol}}i[7]||(i[7]="."+tr(i[8],n)),t=i.join("")}else t=",."+er(n[2])+"f";return so.format(t)}function er(A){return-Math.floor(Math.log(A)/Math.LN10+.01)}function tr(A,e){var t=er(e[2]);return A in wa?Math.abs(t-er(Math.max(Eo(e[0]),Eo(e[1]))))+ +("e"!==A):t-2*("%"===A)}function nr(A,e,t,n){function i(A){return(t?Math.log(0>A?0:A):-Math.log(A>0?0:-A))/Math.log(e)}function r(A){return t?Math.pow(e,A):-Math.pow(e,-A)}function o(e){return A(i(e))}return o.invert=function(e){return r(A.invert(e))},o.domain=function(e){return arguments.length?(t=e[0]>=0,A.domain((n=e.map(Number)).map(i)),o):n},o.base=function(t){return arguments.length?(e=+t,A.domain(n.map(i)),o):e},o.nice=function(){var e=Vi(n.map(i),t?Math:ma);return A.domain(e),n=e.map(r),o},o.ticks=function(){var A=_i(n),o=[],s=A[0],a=A[1],l=Math.floor(i(s)),c=Math.ceil(i(a)),u=e%1?2:e;if(isFinite(c-l)){if(t){for(;c>l;l++)for(var g=1;u>g;g++)o.push(r(l)*g);o.push(r(l))}else for(o.push(r(l));l++0;g--)o.push(r(l)*g);for(l=0;o[l]a;c--);o=o.slice(l,c)}return o},o.tickFormat=function(A,t){if(!arguments.length)return Ia;arguments.length<2?t=Ia:"function"!=typeof t&&(t=so.format(t));var n=Math.max(1,e*A/o.ticks().length);return function(A){var o=A/r(Math.round(i(A)));return e-.5>o*e&&(o*=e),n>=o?t(A):""}},o.copy=function(){return nr(A.copy(),e,t,n)},Zi(o,A)}function ir(A,e,t){function n(e){return A(i(e))}var i=rr(e),r=rr(1/e);return n.invert=function(e){return r(A.invert(e))},n.domain=function(e){return arguments.length?(A.domain((t=e.map(Number)).map(i)),n):t},n.ticks=function(A){return $i(t,A)},n.tickFormat=function(A,e){return Ar(t,A,e)},n.nice=function(A){return n.domain(Xi(t,A))},n.exponent=function(o){return arguments.length?(i=rr(e=o),r=rr(1/e),A.domain(t.map(i)),n):e},n.copy=function(){return ir(A.copy(),e,t)},Zi(n,A)}function rr(A){return function(e){return 0>e?-Math.pow(-e,A):Math.pow(e,A)}}function or(A,e){function t(t){return r[((i.get(t)||("range"===e.t?i.set(t,A.push(t)):NaN))-1)%r.length]}function n(e,t){return so.range(A.length).map(function(A){return e+t*A})}var i,r,o;return t.domain=function(n){if(!arguments.length)return A;A=[],i=new l;for(var r,o=-1,s=n.length;++ot?[NaN,NaN]:[t>0?s[t-1]:A[0],te?NaN:e/r+A,[e,e+1/r]},n.copy=function(){return ar(A,e,t)},i()}function lr(A,e){function t(t){return t>=t?e[so.bisect(A,t)]:void 0}return t.domain=function(e){return arguments.length?(A=e,t):A},t.range=function(A){return arguments.length?(e=A,t):e},t.invertExtent=function(t){return t=e.indexOf(t),[A[t-1],A[t]]},t.copy=function(){return lr(A,e)},t}function cr(A){function e(A){return+A}return e.invert=e,e.domain=e.range=function(t){return arguments.length?(A=t.map(e),e):A},e.ticks=function(e){return $i(A,e)},e.tickFormat=function(e,t){return Ar(A,e,t)},e.copy=function(){return cr(A)},e}function ur(){return 0}function gr(A){return A.innerRadius}function hr(A){return A.outerRadius}function Br(A){return A.startAngle}function dr(A){return A.endAngle}function pr(A){return A&&A.padAngle}function Qr(A,e,t,n){return(A-t)*e-(e-n)*A>0?0:1}function Er(A,e,t,n,i){var r=A[0]-e[0],o=A[1]-e[1],s=(i?n:-n)/Math.sqrt(r*r+o*o),a=s*o,l=-s*r,c=A[0]+a,u=A[1]+l,g=e[0]+a,h=e[1]+l,B=(c+g)/2,d=(u+h)/2,p=g-c,Q=h-u,E=p*p+Q*Q,f=t-n,C=c*h-g*u,w=(0>Q?-1:1)*Math.sqrt(Math.max(0,f*f*E-C*C)),I=(C*Q-p*w)/E,m=(-C*p-Q*w)/E,M=(C*Q+p*w)/E,b=(-C*p+Q*w)/E,v=I-B,y=m-d,D=M-B,G=b-d;return v*v+y*y>D*D+G*G&&(I=M,m=b),[[I-a,m-l],[I*t/f,m*t/f]]}function fr(A){function e(e){function o(){l.push("M",r(A(c),s))}for(var a,l=[],c=[],u=-1,g=e.length,h=vA(t),B=vA(n);++u1?A.join("L"):A+"Z"}function wr(A){return A.join("L")+"Z"}function Ir(A){for(var e=0,t=A.length,n=A[0],i=[n[0],",",n[1]];++e1&&i.push("H",n[0]),i.join("")}function mr(A){for(var e=0,t=A.length,n=A[0],i=[n[0],",",n[1]];++e1){s=e[1],r=A[a],a++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(r[0]-s[0])+","+(r[1]-s[1])+","+r[0]+","+r[1];for(var l=2;l9&&(i=3*e/Math.sqrt(i),o[s]=i*t,o[s+1]=i*n));for(s=-1;++s<=a;)i=(A[Math.min(a,s+1)][0]-A[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),r.push([i||0,o[s]*i||0]);return r}function Tr(A){return A.length<3?Cr(A):A[0]+Dr(A,Sr(A))}function Nr(A){for(var e,t,n,i=-1,r=A.length;++i=e?o(A-e):void(c.c=o)}function o(t){var i=B.active,r=B[i];r&&(r.timer.c=null,r.timer.t=NaN,--B.count,delete B[i],r.event&&r.event.interrupt.call(A,A.__data__,r.index));for(var o in B)if(n>+o){var l=B[o];l.timer.c=null,l.timer.t=NaN,--B.count,delete B[o]}c.c=s,YA(function(){return c.c&&s(t||1)&&(c.c=null,c.t=NaN),1},0,a),B.active=n,d.event&&d.event.start.call(A,A.__data__,e),h=[],d.tween.forEach(function(t,n){(n=n.call(A,A.__data__,e))&&h.push(n)}),g=d.ease,u=d.duration}function s(i){for(var r=i/u,o=g(r),s=h.length;s>0;)h[--s].call(A,o);return r>=1?(d.event&&d.event.end.call(A,A.__data__,e),--B.count?delete B[n]:delete A[t],1):void 0}var a,c,u,g,h,B=A[t]||(A[t]={active:0,count:0}),d=B[n];d||(a=i.time,c=YA(r,0,a),d=B[n]={tween:new l,time:a,timer:c,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++B.count)}function Ao(A,e,t){A.attr("transform",function(A){var n=e(A);return"translate("+(isFinite(n)?n:t(A))+",0)"})}function eo(A,e,t){A.attr("transform",function(A){var n=e(A);return"translate(0,"+(isFinite(n)?n:t(A))+")"})}function to(A){return A.toISOString()}function no(A,e,t){function n(e){return A(e)}function i(A,t){var n=A[1]-A[0],i=n/t,r=so.bisect(Ka,i);return r==Ka.length?[e.year,qi(A.map(function(A){return A/31536e6}),t)[2]]:r?e[i/Ka[r-1]1?{floor:function(e){for(;t(e=A.floor(e));)e=io(e-1);return e},ceil:function(e){for(;t(e=A.ceil(e));)e=io(+e+1);return e}}:A))},n.ticks=function(A,e){var t=_i(n.domain()),r=null==A?i(t,10):"number"==typeof A?i(t,A):!A.range&&[{range:A},e];return r&&(A=r[0],e=r[1]),A.range(t[0],io(+t[1]+1),1>e?1:e)},n.tickFormat=function(){return t},n.copy=function(){return no(A.copy(),e,t)},Zi(n,A)}function io(A){return new Date(A)}function ro(A){return JSON.parse(A.responseText)}function oo(A){var e=co.createRange();return e.selectNode(co.body),e.createContextualFragment(A.responseText)}var so={version:"3.5.17"},ao=[].slice,lo=function(A){return ao.call(A)},co=this.document;if(co)try{lo(co.documentElement.childNodes)[0].nodeType}catch(A){lo=function(A){for(var e=A.length,t=new Array(e);e--;)t[e]=A[e];return t}}if(Date.now||(Date.now=function(){return+new Date}),co)try{co.createElement("DIV").style.setProperty("opacity",0,"")}catch(A){var uo=this.Element.prototype,go=uo.setAttribute,ho=uo.setAttributeNS,Bo=this.CSSStyleDeclaration.prototype,po=Bo.setProperty;uo.setAttribute=function(A,e){go.call(this,A,e+"")},uo.setAttributeNS=function(A,e,t){ho.call(this,A,e,t+"")},Bo.setProperty=function(A,e,t){po.call(this,A,e+"",t)}}so.ascending=t,so.descending=function(A,e){return A>e?-1:e>A?1:e>=A?0:NaN},so.min=function(A,e){var t,n,i=-1,r=A.length;if(1===arguments.length){for(;++i=n){t=n;break}for(;++in&&(t=n)}else{for(;++i=n){t=n;break}for(;++in&&(t=n)}return t},so.max=function(A,e){var t,n,i=-1,r=A.length;if(1===arguments.length){for(;++i=n){t=n;break}for(;++it&&(t=n)}else{for(;++i=n){t=n;break}for(;++it&&(t=n)}return t},so.extent=function(A,e){var t,n,i,r=-1,o=A.length;if(1===arguments.length){for(;++r=n){t=i=n;break}for(;++rn&&(t=n),n>i&&(i=n))}else{for(;++r=n){t=i=n;break}for(;++rn&&(t=n),n>i&&(i=n))}return[t,i]},so.sum=function(A,e){var t,n=0,r=A.length,o=-1;if(1===arguments.length)for(;++o1?a/(c-1):void 0},so.deviation=function(){var A=so.variance.apply(this,arguments);return A?Math.sqrt(A):A};var Qo=r(t);so.bisectLeft=Qo.left,so.bisect=so.bisectRight=Qo.right,so.bisector=function(A){return r(1===A.length?function(e,n){return t(A(e),n)}:A)},so.shuffle=function(A,e,t){(r=arguments.length)<3&&(t=A.length,2>r&&(e=0));for(var n,i,r=t-e;r;)i=Math.random()*r--|0,n=A[r+e],A[r+e]=A[i+e],A[i+e]=n;return A},so.permute=function(A,e){for(var t=e.length,n=new Array(t);t--;)n[t]=A[e[t]];return n},so.pairs=function(A){for(var e=0,t=A.length-1,n=A[0],i=new Array(0>t?0:t);t>e;)i[e]=[n,n=A[++e]];return i},so.transpose=function(A){if(!(i=A.length))return[];for(var e=-1,t=so.min(A,o),n=new Array(t);++e=0;)for(n=A[i],e=n.length;--e>=0;)t[--o]=n[e];return t};var Eo=Math.abs;so.range=function(A,e,t){if(arguments.length<3&&(t=1,arguments.length<2&&(e=A,A=0)),(e-A)/t==1/0)throw new Error("infinite range");var n,i=[],r=s(Eo(t)),o=-1;if(A*=r,e*=r,0>(t*=r))for(;(n=A+t*++o)>e;)i.push(n/r);else for(;(n=A+t*++o)=r.length)return n?n.call(i,o):t?o.sort(t):o;for(var a,c,u,g,h=-1,B=o.length,d=r[s++],p=new l;++h=r.length)return A;var n=[],i=o[t++];return A.forEach(function(A,i){n.push({key:A,values:e(i,t)})}),i?n.sort(function(A,e){return i(A.key,e.key)}):n}var t,n,i={},r=[],o=[];return i.map=function(e,t){return A(t,e,0)},i.entries=function(t){return e(A(so.map,t,0),0)},i.key=function(A){return r.push(A),i},i.sortKeys=function(A){return o[r.length-1]=A,i},i.sortValues=function(A){return t=A,i},i.rollup=function(A){return n=A,i},i},so.set=function(A){var e=new Q;if(A)for(var t=0,n=A.length;n>t;++t)e.add(A[t]);return e},a(Q,{has:g,add:function(A){return this._[c(A+="")]=!0,A},remove:h,values:B,size:d,empty:p,forEach:function(A){for(var e in this._)A.call(this,u(e))}}),so.behavior={},so.rebind=function(A,e){for(var t,n=1,i=arguments.length;++n=0&&(n=A.slice(t+1),A=A.slice(0,t)),A)return arguments.length<2?this[A].on(n):this[A].on(n,e);if(2===arguments.length){if(null==e)for(A in this)this.hasOwnProperty(A)&&this[A].on(n,null);return this}},so.event=null,so.requote=function(A){return A.replace(Io,"\\$&")};var Io=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,mo={}.__proto__?function(A,e){A.__proto__=e}:function(A,e){for(var t in e)A[t]=e[t]},Mo=function(A,e){return e.querySelector(A)},bo=function(A,e){return e.querySelectorAll(A)},vo=function(A,e){var t=A.matches||A[C(A,"matchesSelector")];return(vo=function(A,e){return t.call(A,e)})(A,e)};"function"==typeof Sizzle&&(Mo=function(A,e){return Sizzle(A,e)[0]||null},bo=Sizzle,vo=Sizzle.matchesSelector),so.selection=function(){return so.select(co.documentElement)};var yo=so.selection.prototype=[];yo.select=function(A){var e,t,n,i,r=[];A=D(A);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(t=A.slice(0,e))&&(A=A.slice(e+1)),Go.hasOwnProperty(t)?{space:Go[t],local:A}:A}},yo.attr=function(A,e){if(arguments.length<2){if("string"==typeof A){var t=this.node();return A=so.ns.qualify(A),A.local?t.getAttributeNS(A.space,A.local):t.getAttribute(A)}for(e in A)this.each(F(e,A[e]));return this}return this.each(F(A,e))},yo.classed=function(A,e){if(arguments.length<2){if("string"==typeof A){var t=this.node(),n=(A=H(A)).length,i=-1;if(e=t.classList){for(;++ii){if("string"!=typeof A){2>i&&(t="");for(n in A)this.each(U(n,A[n],t));return this}if(2>i){var r=this.node();return e(r).getComputedStyle(r,null).getPropertyValue(A)}n=""}return this.each(U(A,t,n))},yo.property=function(A,e){if(arguments.length<2){if("string"==typeof A)return this.node()[A];for(e in A)this.each(x(e,A[e]));return this}return this.each(x(A,e))},yo.text=function(A){return arguments.length?this.each("function"==typeof A?function(){var e=A.apply(this,arguments);this.textContent=null==e?"":e}:null==A?function(){this.textContent=""}:function(){this.textContent=A}):this.node().textContent},yo.html=function(A){return arguments.length?this.each("function"==typeof A?function(){var e=A.apply(this,arguments);this.innerHTML=null==e?"":e}:null==A?function(){this.innerHTML=""}:function(){this.innerHTML=A}):this.node().innerHTML},yo.append=function(A){return A=S(A),this.select(function(){return this.appendChild(A.apply(this,arguments))})},yo.insert=function(A,e){return A=S(A),e=D(e),this.select(function(){return this.insertBefore(A.apply(this,arguments),e.apply(this,arguments)||null)})},yo.remove=function(){return this.each(T)},yo.data=function(A,e){function t(A,t){var n,i,r,o=A.length,u=t.length,g=Math.min(o,u),h=new Array(u),B=new Array(u),d=new Array(o);if(e){var p,Q=new l,E=new Array(o);for(n=-1;++nn;++n)B[n]=N(t[n]);for(;o>n;++n)d[n]=A[n]}B.update=h,B.parentNode=h.parentNode=d.parentNode=A.parentNode,s.push(B),a.push(h),c.push(d)}var n,i,r=-1,o=this.length;if(!arguments.length){for(A=new Array(o=(n=this[0]).length);++rr;r++){i.push(e=[]),e.parentNode=(t=this[r]).parentNode;for(var s=0,a=t.length;a>s;s++)(n=t[s])&&A.call(n,n.__data__,s,r)&&e.push(n)}return y(i)},yo.order=function(){for(var A=-1,e=this.length;++A=0;)(t=n[i])&&(r&&r!==t.nextSibling&&r.parentNode.insertBefore(t,r),r=t);return this},yo.sort=function(A){A=J.apply(this,arguments);for(var e=-1,t=this.length;++eA;A++)for(var t=this[A],n=0,i=t.length;i>n;n++){var r=t[n];if(r)return r}return null},yo.size=function(){var A=0;return _(this,function(){++A}),A};var Fo=[];so.selection.enter=P,so.selection.enter.prototype=Fo,Fo.append=yo.append,Fo.empty=yo.empty,Fo.node=yo.node,Fo.call=yo.call,Fo.size=yo.size,Fo.select=function(A){for(var e,t,n,i,r,o=[],s=-1,a=this.length;++sn){if("string"!=typeof A){2>n&&(e=!1);for(t in A)this.each(V(t,A[t],e));return this}if(2>n)return(n=this.node()["__on"+A])&&n._;t=!1}return this.each(V(A,e,t))};var Yo=so.map({mouseenter:"mouseover",mouseleave:"mouseout"});co&&Yo.forEach(function(A){"on"+A in co&&Yo.remove(A)});var ko,Ho=0;so.mouse=function(A){return Z(A,b())};var Lo=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;so.touch=function(A,e,t){if(arguments.length<3&&(t=e,e=b().changedTouches),e)for(var n,i=0,r=e.length;r>i;++i)if((n=e[i]).identifier===t)return Z(A,n)},so.behavior.drag=function(){function A(){this.on("mousedown.drag",r).on("touchstart.drag",o)}function t(A,e,t,r,o){return function(){function s(){var A,t,n=e(g,d);n&&(A=n[0]-f[0],t=n[1]-f[1],B|=A|t,f=n,h({type:"drag",x:n[0]+l[0],y:n[1]+l[1],dx:A,dy:t}))}function a(){e(g,d)&&(Q.on(r+p,null).on(o+p,null),E(B),h({type:"dragend"}))}var l,c=this,u=so.event.target.correspondingElement||so.event.target,g=c.parentNode,h=n.of(c,arguments),B=0,d=A(),p=".drag"+(null==d?"":"-"+d),Q=so.select(t(u)).on(r+p,s).on(o+p,a),E=z(u),f=e(g,d);i?(l=i.apply(c,arguments),l=[l.x-f[0],l.y-f[1]]):l=[0,0],h({type:"dragstart"})}}var n=v(A,"drag","dragstart","dragend"),i=null,r=t(w,so.mouse,e,"mousemove","mouseup"),o=t(X,so.touch,E,"touchmove","touchend");return A.origin=function(e){return arguments.length?(i=e,A):i},so.rebind(A,n,"on")},so.touches=function(A,e){return arguments.length<2&&(e=b().touches),e?lo(e).map(function(e){var t=Z(A,e);return t.identifier=e.identifier,t}):[]};var Ro=1e-6,Uo=Ro*Ro,xo=Math.PI,So=2*xo,To=So-Ro,No=xo/2,jo=xo/180,Jo=180/xo,_o=Math.SQRT2;so.interpolateZoom=function(A,e){var t,n,i=A[0],r=A[1],o=A[2],s=e[0],a=e[1],l=e[2],c=s-i,u=a-r,g=c*c+u*u;if(Uo>g)n=Math.log(l/o)/_o,t=function(A){return[i+A*c,r+A*u,o*Math.exp(_o*A*n)]};else{var h=Math.sqrt(g),B=(l*l-o*o+4*g)/(2*o*2*h),d=(l*l-o*o-4*g)/(2*l*2*h),p=Math.log(Math.sqrt(B*B+1)-B),Q=Math.log(Math.sqrt(d*d+1)-d);n=(Q-p)/_o,t=function(A){var e=A*n,t=nA(p),s=o/(2*h)*(t*iA(_o*e+p)-tA(p));return[i+s*c,r+s*u,o*t/nA(_o*e+p)]}}return t.duration=1e3*n,t},so.behavior.zoom=function(){function A(A){A.on(Y,u).on(Oo+".zoom",h).on("dblclick.zoom",B).on(L,g)}function t(A){return[(A[0]-b.x)/b.k,(A[1]-b.y)/b.k]}function n(A){return[A[0]*b.k+b.x,A[1]*b.k+b.y]}function i(A){b.k=Math.max(D[0],Math.min(D[1],A))}function r(A,e){e=n(e),b.x+=A[0]-e[0],b.y+=A[1]-e[1]}function o(e,t,n,o){e.__chart__={x:b.x,y:b.y,k:b.k},i(Math.pow(2,o)),r(p=t,n),e=so.select(e),G>0&&(e=e.transition().duration(G)),e.call(A.event)}function s(){w&&w.domain(C.range().map(function(A){return(A-b.x)/b.k}).map(C.invert)),m&&m.domain(I.range().map(function(A){return(A-b.y)/b.k}).map(I.invert))}function a(A){F++||A({type:"zoomstart"})}function l(A){s(),A({type:"zoom",scale:b.k,translate:[b.x,b.y]})}function c(A){--F||(A({type:"zoomend"}),p=null)}function u(){function A(){s=1,r(so.mouse(i),g),l(o)}function n(){u.on(k,null).on(H,null),h(s),c(o)}var i=this,o=R.of(i,arguments),s=0,u=so.select(e(i)).on(k,A).on(H,n),g=t(so.mouse(i)),h=z(i);Sa.call(i),a(o)}function g(){function A(){var A=so.touches(B);return h=b.k,A.forEach(function(A){A.identifier in p&&(p[A.identifier]=t(A))}),A}function e(){var e=so.event.target;so.select(e).on(C,n).on(w,s),I.push(e);for(var t=so.event.changedTouches,i=0,r=t.length;r>i;++i)p[t[i].identifier]=null;var a=A(),l=Date.now();if(1===a.length){if(500>l-f){var c=a[0];o(B,c,p[c.identifier],Math.floor(Math.log(b.k)/Math.LN2)+1),M()}f=l}else if(a.length>1){var c=a[0],u=a[1],g=c[0]-u[0],h=c[1]-u[1];Q=g*g+h*h}}function n(){var A,e,t,n,o=so.touches(B);Sa.call(B);for(var s=0,a=o.length;a>s;++s,n=null)if(t=o[s],n=p[t.identifier]){if(e)break;A=t,e=n}if(n){var c=(c=t[0]-A[0])*c+(c=t[1]-A[1])*c,u=Q&&Math.sqrt(c/Q);A=[(A[0]+t[0])/2,(A[1]+t[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],i(u*h)}f=null,r(A,e),l(d)}function s(){if(so.event.touches.length){for(var e=so.event.changedTouches,t=0,n=e.length;n>t;++t)delete p[e[t].identifier];for(var i in p)return void A()}so.selectAll(I).on(E,null),m.on(Y,u).on(L,g),v(),c(d)}var h,B=this,d=R.of(B,arguments),p={},Q=0,E=".zoom-"+so.event.changedTouches[0].identifier,C="touchmove"+E,w="touchend"+E,I=[],m=so.select(B),v=z(B);e(),a(d),m.on(Y,null).on(L,e)}function h(){var A=R.of(this,arguments);E?clearTimeout(E):(Sa.call(this),d=t(p=Q||so.mouse(this)),a(A)),E=setTimeout(function(){E=null,c(A)},50),M(),i(Math.pow(2,.002*Po())*b.k),r(p,d),l(A)}function B(){var A=so.mouse(this),e=Math.log(b.k)/Math.LN2;o(this,A,t(A),so.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)}var d,p,Q,E,f,C,w,I,m,b={x:0,y:0,k:1},y=[960,500],D=Vo,G=250,F=0,Y="mousedown.zoom",k="mousemove.zoom",H="mouseup.zoom",L="touchstart.zoom",R=v(A,"zoomstart","zoom","zoomend");return Oo||(Oo="onwheel"in co?(Po=function(){return-so.event.deltaY*(so.event.deltaMode?120:1)},"wheel"):"onmousewheel"in co?(Po=function(){return so.event.wheelDelta},"mousewheel"):(Po=function(){return-so.event.detail},"MozMousePixelScroll")),A.event=function(A){A.each(function(){var A=R.of(this,arguments),e=b;Ua?so.select(this).transition().each("start.zoom",function(){b=this.__chart__||{x:0,y:0,k:1},a(A)}).tween("zoom:zoom",function(){var t=y[0],n=y[1],i=p?p[0]:t/2,r=p?p[1]:n/2,o=so.interpolateZoom([(i-b.x)/b.k,(r-b.y)/b.k,t/b.k],[(i-e.x)/e.k,(r-e.y)/e.k,t/e.k]);return function(e){var n=o(e),s=t/n[2];this.__chart__=b={x:i-n[0]*s,y:r-n[1]*s,k:s},l(A)}}).each("interrupt.zoom",function(){c(A)}).each("end.zoom",function(){c(A)}):(this.__chart__=b,a(A),l(A),c(A))})},A.translate=function(e){return arguments.length?(b={x:+e[0],y:+e[1],k:b.k},s(),A):[b.x,b.y]},A.scale=function(e){return arguments.length?(b={x:b.x,y:b.y,k:null},i(+e),s(),A):b.k},A.scaleExtent=function(e){return arguments.length?(D=null==e?Vo:[+e[0],+e[1]],A):D},A.center=function(e){return arguments.length?(Q=e&&[+e[0],+e[1]],A):Q},A.size=function(e){return arguments.length?(y=e&&[+e[0],+e[1]],A):y},A.duration=function(e){return arguments.length?(G=+e,A):G},A.x=function(e){return arguments.length?(w=e,C=e.copy(),b={x:0,y:0,k:1},A):w},A.y=function(e){return arguments.length?(m=e,I=e.copy(),b={x:0,y:0,k:1},A):m},so.rebind(A,R,"on")};var Po,Oo,Vo=[0,1/0];so.color=oA,oA.prototype.toString=function(){return this.rgb()+""},so.hsl=sA;var Wo=sA.prototype=new oA;Wo.brighter=function(A){return A=Math.pow(.7,arguments.length?A:1),new sA(this.h,this.s,this.l/A)},Wo.darker=function(A){return A=Math.pow(.7,arguments.length?A:1),new sA(this.h,this.s,A*this.l)},Wo.rgb=function(){return aA(this.h,this.s,this.l)},so.hcl=lA;var Ko=lA.prototype=new oA;Ko.brighter=function(A){return new lA(this.h,this.c,Math.min(100,this.l+zo*(arguments.length?A:1)))},Ko.darker=function(A){return new lA(this.h,this.c,Math.max(0,this.l-zo*(arguments.length?A:1)))},Ko.rgb=function(){return cA(this.h,this.c,this.l).rgb()},so.lab=uA;var zo=18,Zo=.95047,Xo=1,qo=1.08883,$o=uA.prototype=new oA;$o.brighter=function(A){return new uA(Math.min(100,this.l+zo*(arguments.length?A:1)),this.a,this.b)},$o.darker=function(A){return new uA(Math.max(0,this.l-zo*(arguments.length?A:1)),this.a,this.b)},$o.rgb=function(){return gA(this.l,this.a,this.b)},so.rgb=QA;var As=QA.prototype=new oA;As.brighter=function(A){A=Math.pow(.7,arguments.length?A:1);var e=this.r,t=this.g,n=this.b,i=30;return e||t||n?(e&&i>e&&(e=i),t&&i>t&&(t=i),n&&i>n&&(n=i),new QA(Math.min(255,e/A),Math.min(255,t/A),Math.min(255,n/A))):new QA(i,i,i)},As.darker=function(A){return A=Math.pow(.7,arguments.length?A:1),new QA(A*this.r,A*this.g,A*this.b)},As.hsl=function(){return IA(this.r,this.g,this.b)},As.toString=function(){return"#"+CA(this.r)+CA(this.g)+CA(this.b)};var es=so.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});es.forEach(function(A,e){es.set(A,EA(e))}),so.functor=vA,so.xhr=yA(E),so.dsv=function(A,e){function t(A,t,r){arguments.length<3&&(r=t,t=null);var o=DA(A,e,null==t?n:i(t),r);return o.row=function(A){return arguments.length?o.response(null==(t=A)?n:i(A)):t},o}function n(A){return t.parse(A.responseText)}function i(A){return function(e){return t.parse(e.responseText,A)}}function r(e){return e.map(o).join(A)}function o(A){return s.test(A)?'"'+A.replace(/\"/g,'""')+'"':A}var s=new RegExp('["'+A+"\n]"),a=A.charCodeAt(0);return t.parse=function(A,e){var n;return t.parseRows(A,function(A,t){if(n)return n(A,t-1);var i=new Function("d","return {"+A.map(function(A,e){return JSON.stringify(A)+": d["+e+"]"}).join(",")+"}");n=e?function(A,t){return e(i(A),t)}:i})},t.parseRows=function(A,e){function t(){if(c>=l)return o;if(i)return i=!1,r;var e=c;if(34===A.charCodeAt(e)){for(var t=e;t++c;){var n=A.charCodeAt(c++),s=1;if(10===n)i=!0;else if(13===n)i=!0,10===A.charCodeAt(c)&&(++c,++s);else if(n!==a)continue;return A.slice(e,c-s)}return A.slice(e)}for(var n,i,r={},o={},s=[],l=A.length,c=0,u=0;(n=t())!==o;){for(var g=[];n!==r&&n!==o;)g.push(n),n=t();e&&null==(g=e(g,u++))||s.push(g)}return s},t.format=function(e){if(Array.isArray(e[0]))return t.formatRows(e);var n=new Q,i=[];return e.forEach(function(A){for(var e in A)n.has(e)||i.push(n.add(e))}),[i.map(o).join(A)].concat(e.map(function(e){return i.map(function(A){return o(e[A])}).join(A)})).join("\n")},t.formatRows=function(A){return A.map(r).join("\n")},t},so.csv=so.dsv(",","text/csv"),so.tsv=so.dsv("\t","text/tab-separated-values");var ts,ns,is,rs,os=this[C(this,"requestAnimationFrame")]||function(A){setTimeout(A,17)};so.timer=function(){YA.apply(this,arguments)},so.timer.flush=function(){HA(),LA()},so.round=function(A,e){return e?Math.round(A*(e=Math.pow(10,e)))/e:Math.round(A)};var ss=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(UA);so.formatPrefix=function(A,e){var t=0;return(A=+A)&&(0>A&&(A*=-1),e&&(A=so.round(A,RA(A,e))),t=1+Math.floor(1e-12+Math.log(A)/Math.LN10),t=Math.max(-24,Math.min(24,3*Math.floor((t-1)/3)))),ss[8+t/3]};var as=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ls=so.map({b:function(A){return A.toString(2)},c:function(A){return String.fromCharCode(A)},o:function(A){return A.toString(8)},x:function(A){return A.toString(16)},X:function(A){return A.toString(16).toUpperCase()},g:function(A,e){return A.toPrecision(e)},e:function(A,e){return A.toExponential(e)},f:function(A,e){return A.toFixed(e)},r:function(A,e){return(A=so.round(A,RA(A,e))).toFixed(Math.max(0,Math.min(20,RA(A*(1+1e-15),e))))}}),cs=so.time={},us=Date;TA.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){gs.setUTCDate.apply(this._,arguments)},setDay:function(){gs.setUTCDay.apply(this._,arguments)},setFullYear:function(){gs.setUTCFullYear.apply(this._,arguments)},setHours:function(){gs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gs.setUTCSeconds.apply(this._,arguments)},setTime:function(){gs.setTime.apply(this._,arguments)}};var gs=Date.prototype;cs.year=NA(function(A){return A=cs.day(A),A.setMonth(0,1),A},function(A,e){A.setFullYear(A.getFullYear()+e)},function(A){return A.getFullYear()}),cs.years=cs.year.range,cs.years.utc=cs.year.utc.range,cs.day=NA(function(A){var e=new us(2e3,0);return e.setFullYear(A.getFullYear(),A.getMonth(),A.getDate()),e},function(A,e){A.setDate(A.getDate()+e)},function(A){return A.getDate()-1}),cs.days=cs.day.range,cs.days.utc=cs.day.utc.range,cs.dayOfYear=function(A){var e=cs.year(A);return Math.floor((A-e-6e4*(A.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(A,e){e=7-e;var t=cs[A]=NA(function(A){return(A=cs.day(A)).setDate(A.getDate()-(A.getDay()+e)%7),A},function(A,e){A.setDate(A.getDate()+7*Math.floor(e))},function(A){var t=cs.year(A).getDay() -;return Math.floor((cs.dayOfYear(A)+(t+e)%7)/7)-(t!==e)});cs[A+"s"]=t.range,cs[A+"s"].utc=t.utc.range,cs[A+"OfYear"]=function(A){var t=cs.year(A).getDay();return Math.floor((cs.dayOfYear(A)+(t+e)%7)/7)}}),cs.week=cs.sunday,cs.weeks=cs.sunday.range,cs.weeks.utc=cs.sunday.utc.range,cs.weekOfYear=cs.sundayOfYear;var hs={"-":"",_:" ",0:"0"},Bs=/^\s*\d+/,ds=/^%/;so.locale=function(A){return{numberFormat:xA(A),timeFormat:JA(A)}};var ps=so.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});so.format=ps.numberFormat,so.geo={},le.prototype={s:0,t:0,add:function(A){ce(A,this.t,Qs),ce(Qs.s,this.s,this),this.s?this.t+=Qs.t:this.s=Qs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Qs=new le;so.geo.stream=function(A,e){A&&Es.hasOwnProperty(A.type)?Es[A.type](A,e):ue(A,e)};var Es={Feature:function(A,e){ue(A.geometry,e)},FeatureCollection:function(A,e){for(var t=A.features,n=-1,i=t.length;++nA?4*xo+A:A,Is.lineStart=Is.lineEnd=Is.point=w}};so.geo.bounds=function(){function A(A,e){f.push(C=[c=A,g=A]),u>e&&(u=e),e>h&&(h=e)}function e(e,t){var n=de([e*jo,t*jo]);if(Q){var i=Qe(Q,n),r=[i[1],-i[0],0],o=Qe(r,i);Ce(o),o=we(o);var a=e-B,l=a>0?1:-1,d=o[0]*Jo*l,p=Eo(a)>180;if(p^(d>l*B&&l*e>d)){var E=o[1]*Jo;E>h&&(h=E)}else if(d=(d+360)%360-180,p^(d>l*B&&l*e>d)){var E=-o[1]*Jo;u>E&&(u=E)}else u>t&&(u=t),t>h&&(h=t);p?B>e?s(c,e)>s(c,g)&&(g=e):s(e,g)>s(c,g)&&(c=e):g>=c?(c>e&&(c=e),e>g&&(g=e)):e>B?s(c,e)>s(c,g)&&(g=e):s(e,g)>s(c,g)&&(c=e)}else A(e,t);Q=n,B=e}function t(){w.point=e}function n(){C[0]=c,C[1]=g,w.point=A,Q=null}function i(A,t){if(Q){var n=A-B;E+=Eo(n)>180?n+(n>0?360:-360):n}else d=A,p=t;Is.point(A,t),e(A,t)}function r(){Is.lineStart()}function o(){i(d,p),Is.lineEnd(),Eo(E)>Ro&&(c=-(g=180)),C[0]=c,C[1]=g,Q=null}function s(A,e){return(e-=A)<0?e+360:e}function a(A,e){return A[0]-e[0]}function l(A,e){return e[0]<=e[1]?e[0]<=A&&A<=e[1]:Aws?(c=-(g=180),u=-(h=90)):E>Ro?h=90:-Ro>E&&(u=-90),C[0]=c,C[1]=g}};return function(A){h=g=-(c=u=1/0),f=[],so.geo.stream(A,w);var e=f.length;if(e){f.sort(a);for(var t,n=1,i=f[0],r=[i];e>n;++n)t=f[n],l(t[0],i)||l(t[1],i)?(s(i[0],t[1])>s(i[0],i[1])&&(i[1]=t[1]),s(t[0],i[1])>s(i[0],i[1])&&(i[0]=t[0])):r.push(i=t);for(var o,t,B=-1/0,e=r.length-1,n=0,i=r[e];e>=n;i=t,++n)t=r[n],(o=s(i[1],t[0]))>B&&(B=o,c=t[0],g=i[1])}return f=C=null,c===1/0||u===1/0?[[NaN,NaN],[NaN,NaN]]:[[c,u],[g,h]]}}(),so.geo.centroid=function(A){ms=Ms=bs=vs=ys=Ds=Gs=Fs=Ys=ks=Hs=0,so.geo.stream(A,Ls);var e=Ys,t=ks,n=Hs,i=e*e+t*t+n*n;return Uo>i&&(e=Ds,t=Gs,n=Fs,Ro>Ms&&(e=bs,t=vs,n=ys),i=e*e+t*t+n*n,Uo>i)?[NaN,NaN]:[Math.atan2(t,e)*Jo,eA(n/Math.sqrt(i))*Jo]};var ms,Ms,bs,vs,ys,Ds,Gs,Fs,Ys,ks,Hs,Ls={sphere:w,point:me,lineStart:be,lineEnd:ve,polygonStart:function(){Ls.lineStart=ye},polygonEnd:function(){Ls.lineStart=be}},Rs=He(Ge,xe,Te,[-xo,-xo/2]),Us=1e9;so.geo.clipExtent=function(){var A,e,t,n,i,r,o={stream:function(A){return i&&(i.valid=!1),i=r(A),i.valid=!0,i},extent:function(s){return arguments.length?(r=_e(A=+s[0][0],e=+s[0][1],t=+s[1][0],n=+s[1][1]),i&&(i.valid=!1,i=null),o):[[A,e],[t,n]]}};return o.extent([[0,0],[960,500]])},(so.geo.conicEqualArea=function(){return Pe(Oe)}).raw=Oe,so.geo.albers=function(){return so.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},so.geo.albersUsa=function(){function A(A){var r=A[0],o=A[1];return e=null,t(r,o),e||(n(r,o),e)||i(r,o),e}var e,t,n,i,r=so.geo.albers(),o=so.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=so.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a={point:function(A,t){e=[A,t]}};return A.invert=function(A){var e=r.scale(),t=r.translate(),n=(A[0]-t[0])/e,i=(A[1]-t[1])/e;return(i>=.12&&.234>i&&n>=-.425&&-.214>n?o:i>=.166&&.234>i&&n>=-.214&&-.115>n?s:r).invert(A)},A.stream=function(A){var e=r.stream(A),t=o.stream(A),n=s.stream(A);return{point:function(A,i){e.point(A,i),t.point(A,i),n.point(A,i)},sphere:function(){e.sphere(),t.sphere(),n.sphere()},lineStart:function(){e.lineStart(),t.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),t.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),t.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),t.polygonEnd(),n.polygonEnd()}}},A.precision=function(e){return arguments.length?(r.precision(e),o.precision(e),s.precision(e),A):r.precision()},A.scale=function(e){return arguments.length?(r.scale(e),o.scale(.35*e),s.scale(e),A.translate(r.translate())):r.scale()},A.translate=function(e){if(!arguments.length)return r.translate();var l=r.scale(),c=+e[0],u=+e[1];return t=r.translate(e).clipExtent([[c-.455*l,u-.238*l],[c+.455*l,u+.238*l]]).stream(a).point,n=o.translate([c-.307*l,u+.201*l]).clipExtent([[c-.425*l+Ro,u+.12*l+Ro],[c-.214*l-Ro,u+.234*l-Ro]]).stream(a).point,i=s.translate([c-.205*l,u+.212*l]).clipExtent([[c-.214*l+Ro,u+.166*l+Ro],[c-.115*l-Ro,u+.234*l-Ro]]).stream(a).point,A},A.scale(1070)};var xs,Ss,Ts,Ns,js,Js,_s={point:w,lineStart:w,lineEnd:w,polygonStart:function(){Ss=0,_s.lineStart=Ve},polygonEnd:function(){_s.lineStart=_s.lineEnd=_s.point=w,xs+=Eo(Ss/2)}},Ps={point:We,lineStart:w,lineEnd:w,polygonStart:w,polygonEnd:w},Os={point:Ze,lineStart:Xe,lineEnd:qe,polygonStart:function(){Os.lineStart=$e},polygonEnd:function(){Os.point=Ze,Os.lineStart=Xe,Os.lineEnd=qe}};so.geo.path=function(){function A(A){return A&&("function"==typeof s&&r.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(r)),so.geo.stream(A,o)),r.result()}function e(){return o=null,A}var t,n,i,r,o,s=4.5;return A.area=function(A){return xs=0,so.geo.stream(A,i(_s)),xs},A.centroid=function(A){return bs=vs=ys=Ds=Gs=Fs=Ys=ks=Hs=0,so.geo.stream(A,i(Os)),Hs?[Ys/Hs,ks/Hs]:Fs?[Ds/Fs,Gs/Fs]:ys?[bs/ys,vs/ys]:[NaN,NaN]},A.bounds=function(A){return js=Js=-(Ts=Ns=1/0),so.geo.stream(A,i(Ps)),[[Ts,Ns],[js,Js]]},A.projection=function(A){return arguments.length?(i=(t=A)?A.stream||tt(A):E,e()):t},A.context=function(A){return arguments.length?(r=null==(n=A)?new Ke:new At(A),"function"!=typeof s&&r.pointRadius(s),e()):n},A.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(r.pointRadius(+e),+e),A):s},A.projection(so.geo.albersUsa()).context(null)},so.geo.transform=function(A){return{stream:function(e){var t=new nt(e);for(var n in A)t[n]=A[n];return t}}},nt.prototype={point:function(A,e){this.stream.point(A,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},so.geo.projection=rt,so.geo.projectionMutator=ot,(so.geo.equirectangular=function(){return rt(at)}).raw=at.invert=at,so.geo.rotation=function(A){function e(e){return e=A(e[0]*jo,e[1]*jo),e[0]*=Jo,e[1]*=Jo,e}return A=ct(A[0]%360*jo,A[1]*jo,A.length>2?A[2]*jo:0),e.invert=function(e){return e=A.invert(e[0]*jo,e[1]*jo),e[0]*=Jo,e[1]*=Jo,e},e},lt.invert=at,so.geo.circle=function(){function A(){var A="function"==typeof n?n.apply(this,arguments):n,e=ct(-A[0]*jo,-A[1]*jo,0).invert,i=[];return t(null,null,1,{point:function(A,t){i.push(A=e(A,t)),A[0]*=Jo,A[1]*=Jo}}),{type:"Polygon",coordinates:[i]}}var e,t,n=[0,0],i=6;return A.origin=function(e){return arguments.length?(n=e,A):n},A.angle=function(n){return arguments.length?(t=Bt((e=+n)*jo,i*jo),A):e},A.precision=function(n){return arguments.length?(t=Bt(e*jo,(i=+n)*jo),A):i},A.angle(90)},so.geo.distance=function(A,e){var t,n=(e[0]-A[0])*jo,i=A[1]*jo,r=e[1]*jo,o=Math.sin(n),s=Math.cos(n),a=Math.sin(i),l=Math.cos(i),c=Math.sin(r),u=Math.cos(r);return Math.atan2(Math.sqrt((t=u*o)*t+(t=l*c-a*u*s)*t),a*c+l*u*s)},so.geo.graticule=function(){function A(){return{type:"MultiLineString",coordinates:e()}}function e(){return so.range(Math.ceil(r/p)*p,i,p).map(g).concat(so.range(Math.ceil(l/Q)*Q,a,Q).map(h)).concat(so.range(Math.ceil(n/B)*B,t,B).filter(function(A){return Eo(A%p)>Ro}).map(c)).concat(so.range(Math.ceil(s/d)*d,o,d).filter(function(A){return Eo(A%Q)>Ro}).map(u))}var t,n,i,r,o,s,a,l,c,u,g,h,B=10,d=B,p=90,Q=360,E=2.5;return A.lines=function(){return e().map(function(A){return{type:"LineString",coordinates:A}})},A.outline=function(){return{type:"Polygon",coordinates:[g(r).concat(h(a).slice(1),g(i).reverse().slice(1),h(l).reverse().slice(1))]}},A.extent=function(e){return arguments.length?A.majorExtent(e).minorExtent(e):A.minorExtent()},A.majorExtent=function(e){return arguments.length?(r=+e[0][0],i=+e[1][0],l=+e[0][1],a=+e[1][1],r>i&&(e=r,r=i,i=e),l>a&&(e=l,l=a,a=e),A.precision(E)):[[r,l],[i,a]]},A.minorExtent=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],s=+e[0][1],o=+e[1][1],n>t&&(e=n,n=t,t=e),s>o&&(e=s,s=o,o=e),A.precision(E)):[[n,s],[t,o]]},A.step=function(e){return arguments.length?A.majorStep(e).minorStep(e):A.minorStep()},A.majorStep=function(e){return arguments.length?(p=+e[0],Q=+e[1],A):[p,Q]},A.minorStep=function(e){return arguments.length?(B=+e[0],d=+e[1],A):[B,d]},A.precision=function(e){return arguments.length?(E=+e,c=pt(s,o,90),u=Qt(n,t,E),g=pt(l,a,90),h=Qt(r,i,E),A):E},A.majorExtent([[-180,-90+Ro],[180,90-Ro]]).minorExtent([[-180,-80-Ro],[180,80+Ro]])},so.geo.greatArc=function(){function A(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),t||i.apply(this,arguments)]}}var e,t,n=Et,i=ft;return A.distance=function(){return so.geo.distance(e||n.apply(this,arguments),t||i.apply(this,arguments))},A.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,A):n},A.target=function(e){return arguments.length?(i=e,t="function"==typeof e?null:e,A):i},A.precision=function(){return arguments.length?A:0},A},so.geo.interpolate=function(A,e){return Ct(A[0]*jo,A[1]*jo,e[0]*jo,e[1]*jo)},so.geo.length=function(A){return Vs=0,so.geo.stream(A,Ws),Vs};var Vs,Ws={sphere:w,point:w,lineStart:wt,lineEnd:w,polygonStart:w,polygonEnd:w},Ks=It(function(A){return Math.sqrt(2/(1+A))},function(A){return 2*Math.asin(A/2)});(so.geo.azimuthalEqualArea=function(){return rt(Ks)}).raw=Ks;var zs=It(function(A){var e=Math.acos(A);return e&&e/Math.sin(e)},E);(so.geo.azimuthalEquidistant=function(){return rt(zs)}).raw=zs,(so.geo.conicConformal=function(){return Pe(mt)}).raw=mt,(so.geo.conicEquidistant=function(){return Pe(Mt)}).raw=Mt;var Zs=It(function(A){return 1/A},Math.atan);(so.geo.gnomonic=function(){return rt(Zs)}).raw=Zs,bt.invert=function(A,e){return[A,2*Math.atan(Math.exp(e))-No]},(so.geo.mercator=function(){return vt(bt)}).raw=bt;var Xs=It(function(){return 1},Math.asin);(so.geo.orthographic=function(){return rt(Xs)}).raw=Xs;var qs=It(function(A){return 1/(1+A)},function(A){return 2*Math.atan(A)});(so.geo.stereographic=function(){return rt(qs)}).raw=qs,yt.invert=function(A,e){return[-e,2*Math.atan(Math.exp(A))-No]},(so.geo.transverseMercator=function(){var A=vt(yt),e=A.center,t=A.rotate;return A.center=function(A){return A?e([-A[1],A[0]]):(A=e(),[A[1],-A[0]])},A.rotate=function(A){return A?t([A[0],A[1],A.length>2?A[2]+90:90]):(A=t(),[A[0],A[1],A[2]-90])},t([0,0,90])}).raw=yt,so.geom={},so.geom.hull=function(A){function e(A){if(A.length<3)return[];var e,i=vA(t),r=vA(n),o=A.length,s=[],a=[];for(e=0;o>e;e++)s.push([+i.call(this,A[e],e),+r.call(this,A[e],e),e]);for(s.sort(Yt),e=0;o>e;e++)a.push([s[e][0],-s[e][1]]);var l=Ft(s),c=Ft(a),u=c[0]===l[0],g=c[c.length-1]===l[l.length-1],h=[];for(e=l.length-1;e>=0;--e)h.push(A[s[l[e]][2]]);for(e=+u;e=n&&l.x<=r&&l.y>=i&&l.y<=o?[[n,o],[r,o],[r,i],[n,i]]:[]).point=A[s]}),e}function t(A){return A.map(function(A,e){return{x:Math.round(r(A,e)/Ro)*Ro,y:Math.round(o(A,e)/Ro)*Ro,i:e}})}var n=Dt,i=Gt,r=n,o=i,s=sa;return A?e(A):(e.links=function(A){return sn(t(A)).edges.filter(function(A){return A.l&&A.r}).map(function(e){return{source:A[e.l.i],target:A[e.r.i]}})},e.triangles=function(A){var e=[];return sn(t(A)).cells.forEach(function(t,n){for(var i,r=t.site,o=t.edges.sort(Pt),s=-1,a=o.length,l=o[a-1].edge,c=l.l===r?l.r:l.l;++s=l,g=n>=c,h=g<<1|u;A.leaf=!1,A=A.nodes[h]||(A.nodes[h]=gn()),u?i=l:s=l,g?o=c:a=c,r(A,e,t,n,i,o,s,a)}var c,u,g,h,B,d,p,Q,E,f=vA(s),C=vA(a);if(null!=e)d=e,p=t,Q=n,E=i;else if(Q=E=-(d=p=1/0),u=[],g=[],B=A.length,o)for(h=0;B>h;++h)c=A[h],c.xQ&&(Q=c.x),c.y>E&&(E=c.y),u.push(c.x),g.push(c.y);else for(h=0;B>h;++h){var w=+f(c=A[h],h),I=+C(c,h);d>w&&(d=w),p>I&&(p=I),w>Q&&(Q=w),I>E&&(E=I),u.push(w),g.push(I)}var m=Q-d,M=E-p;m>M?E=p+m:Q=d+M;var b=gn();if(b.add=function(A){r(b,A,+f(A,++h),+C(A,h),d,p,Q,E)},b.visit=function(A){hn(A,b,d,p,Q,E)},b.find=function(A){return Bn(b,A[0],A[1],d,p,Q,E)},h=-1,null==e){for(;++h=0?A.slice(0,e):A,n=e>=0?A.slice(e+1):"in";return t=ua.get(t)||ca,n=ga.get(n)||E,wn(n(t.apply(null,ao.call(arguments,1))))},so.interpolateHcl=Ln,so.interpolateHsl=Rn,so.interpolateLab=Un,so.interpolateRound=xn,so.transform=function(A){var e=co.createElementNS(so.ns.prefix.svg,"g");return(so.transform=function(A){if(null!=A){e.setAttribute("transform",A);var t=e.transform.baseVal.consolidate()}return new Sn(t?t.matrix:ha)})(A)},Sn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ha={a:1,b:0,c:0,d:1,e:0,f:0};so.interpolateTransform=Wn,so.layout={},so.layout.bundle=function(){return function(A){for(var e=[],t=-1,n=A.length;++ts*s/Q){if(d>a){var l=e.charge/a;A.px-=r*l,A.py-=o*l}return!0}if(e.point&&a&&d>a){var l=e.pointCharge/a;A.px-=r*l,A.py-=o*l}}return!e.charge}}function e(A){A.px=so.event.x,A.py=so.event.y,a.resume()}var t,n,i,r,o,s,a={},l=so.dispatch("start","tick","end"),c=[1,1],u=.9,g=Ba,h=da,B=-30,d=pa,p=.1,Q=.64,f=[],C=[];return a.tick=function(){if((i*=.99)<.005)return t=null,l.end({type:"end",alpha:i=0}),!0;var e,n,a,g,h,d,Q,E,w,I=f.length,m=C.length;for(n=0;m>n;++n)a=C[n],g=a.source,h=a.target,E=h.x-g.x,w=h.y-g.y,(d=E*E+w*w)&&(d=i*o[n]*((d=Math.sqrt(d))-r[n])/d,E*=d,w*=d,h.x-=E*(Q=g.weight+h.weight?g.weight/(g.weight+h.weight):.5),h.y-=w*Q,g.x+=E*(Q=1-Q),g.y+=w*Q);if((Q=i*p)&&(E=c[0]/2,w=c[1]/2,n=-1,Q))for(;++n0?i=A:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:i=0})):A>0&&(l.start({type:"start",alpha:i=A}),t=YA(a.tick)),a):i},a.start=function(){function A(A,n){if(!t){for(t=new Array(i),a=0;i>a;++a)t[a]=[];for(a=0;l>a;++a){var r=C[a];t[r.source.index].push(r.target),t[r.target.index].push(r.source)}}for(var o,s=t[e],a=-1,c=s.length;++ae;++e)(n=f[e]).index=e,n.weight=0;for(e=0;l>e;++e)n=C[e],"number"==typeof n.source&&(n.source=f[n.source]),"number"==typeof n.target&&(n.target=f[n.target]),++n.source.weight,++n.target.weight;for(e=0;i>e;++e)n=f[e],isNaN(n.x)&&(n.x=A("x",u)),isNaN(n.y)&&(n.y=A("y",d)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(r=[],"function"==typeof g)for(e=0;l>e;++e)r[e]=+g.call(this,C[e],e);else for(e=0;l>e;++e)r[e]=g;if(o=[],"function"==typeof h)for(e=0;l>e;++e)o[e]=+h.call(this,C[e],e);else for(e=0;l>e;++e)o[e]=h;if(s=[],"function"==typeof B)for(e=0;i>e;++e)s[e]=+B.call(this,f[e],e);else for(e=0;i>e;++e)s[e]=B;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return n||(n=so.behavior.drag().origin(E).on("dragstart.force",$n).on("drag.force",e).on("dragend.force",Ai)),arguments.length?void this.on("mouseover.force",ei).on("mouseout.force",ti).call(n):n},so.rebind(a,l,"on")};var Ba=20,da=1,pa=1/0;so.layout.hierarchy=function(){function A(i){var r,o=[i],s=[];for(i.depth=0;null!=(r=o.pop());)if(s.push(r),(l=t.call(A,r,r.depth))&&(a=l.length)){for(var a,l,c;--a>=0;)o.push(c=l[a]),c.parent=r,c.depth=r.depth+1;n&&(r.value=0),r.children=l}else n&&(r.value=+n.call(A,r,r.depth)||0),delete r.children;return oi(i,function(A){var t,i;e&&(t=A.children)&&t.sort(e),n&&(i=A.parent)&&(i.value+=A.value)}),s}var e=li,t=si,n=ai;return A.sort=function(t){return arguments.length?(e=t,A):e},A.children=function(e){return arguments.length?(t=e,A):t},A.value=function(e){return arguments.length?(n=e,A):n},A.revalue=function(e){return n&&(ri(e,function(A){A.children&&(A.value=0)}),oi(e,function(e){var t;e.children||(e.value=+n.call(A,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)})),e},A},so.layout.partition=function(){function A(e,t,n,i){var r=e.children;if(e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i,r&&(o=r.length)){var o,s,a,l=-1;for(n=e.value?n/e.value:0;++lu?-1:1),B=so.sum(l),d=B?(u-a*h)/B:0,p=so.range(a),Q=[];return null!=t&&p.sort(t===Qa?function(A,e){return l[e]-l[A]}:function(A,e){return t(o[A],o[e])}),p.forEach(function(A){Q[A]={data:o[A],value:s=l[A],startAngle:c,endAngle:c+=s*d+h,padAngle:g}}),Q}var e=Number,t=Qa,n=0,i=So,r=0;return A.value=function(t){return arguments.length?(e=t,A):e},A.sort=function(e){return arguments.length?(t=e,A):t},A.startAngle=function(e){return arguments.length?(n=e,A):n},A.endAngle=function(e){return arguments.length?(i=e,A):i},A.padAngle=function(e){return arguments.length?(r=e,A):r},A};var Qa={};so.layout.stack=function(){function A(s,a){if(!(g=s.length))return s;var l=s.map(function(t,n){return e.call(A,t,n)}),c=l.map(function(e){return e.map(function(e,t){return[r.call(A,e,t),o.call(A,e,t)]})}),u=t.call(A,c,a);l=so.permute(l,u),c=so.permute(c,u);var g,h,B,d,p=n.call(A,c,a),Q=l[0].length;for(B=0;Q>B;++B)for(i.call(A,l[0][B],d=p[B],c[0][B][1]),h=1;g>h;++h)i.call(A,l[h][B],d+=c[h-1][B][1],c[h][B][1]);return s}var e=E,t=Bi,n=di,i=hi,r=ui,o=gi;return A.values=function(t){return arguments.length?(e=t,A):e},A.order=function(e){return arguments.length?(t="function"==typeof e?e:Ea.get(e)||Bi,A):t},A.offset=function(e){return arguments.length?(n="function"==typeof e?e:fa.get(e)||di,A):n},A.x=function(e){return arguments.length?(r=e,A):r},A.y=function(e){return arguments.length?(o=e,A):o},A.out=function(e){return arguments.length?(i=e,A):i},A};var Ea=so.map({"inside-out":function(A){var e,t,n=A.length,i=A.map(pi),r=A.map(Qi),o=so.range(n).sort(function(A,e){return i[A]-i[e]}),s=0,a=0,l=[],c=[];for(e=0;n>e;++e)t=o[e],a>s?(s+=r[t],l.push(t)):(a+=r[t],c.push(t));return c.reverse().concat(l)},reverse:function(A){return so.range(A.length).reverse()},default:Bi}),fa=so.map({silhouette:function(A){var e,t,n,i=A.length,r=A[0].length,o=[],s=0,a=[];for(t=0;r>t;++t){for(e=0,n=0;i>e;e++)n+=A[e][t][1];n>s&&(s=n),o.push(n)}for(t=0;r>t;++t)a[t]=(s-o[t])/2;return a},wiggle:function(A){var e,t,n,i,r,o,s,a,l,c=A.length,u=A[0],g=u.length,h=[];for(h[0]=a=l=0,t=1;g>t;++t){for(e=0,i=0;c>e;++e)i+=A[e][t][1];for(e=0,r=0,s=u[t][0]-u[t-1][0];c>e;++e){for(n=0,o=(A[e][t][1]-A[e][t-1][1])/(2*s);e>n;++n)o+=(A[n][t][1]-A[n][t-1][1])/s;r+=o*A[e][t][1]}h[t]=a-=i?r/i*s:0,l>a&&(l=a)}for(t=0;g>t;++t)h[t]-=l;return h},expand:function(A){var e,t,n,i=A.length,r=A[0].length,o=1/i,s=[];for(t=0;r>t;++t){for(e=0,n=0;i>e;e++)n+=A[e][t][1];if(n)for(e=0;i>e;e++)A[e][t][1]/=n;else for(e=0;i>e;e++)A[e][t][1]=o}for(t=0;r>t;++t)s[t]=0;return s},zero:di});so.layout.histogram=function(){function A(A,r){for(var o,s,a=[],l=A.map(t,this),c=n.call(this,l,r),u=i.call(this,c,l,r),r=-1,g=l.length,h=u.length-1,B=e?1:1/g;++r0)for(r=-1;++r=c[0]&&s<=c[1]&&(o=a[so.bisect(u,s,1,h)-1],o.y+=B,o.push(A[r]));return a}var e=!0,t=Number,n=wi,i=fi;return A.value=function(e){return arguments.length?(t=e,A):t},A.range=function(e){return arguments.length?(n=vA(e),A):n},A.bins=function(e){return arguments.length?(i="number"==typeof e?function(A){return Ci(A,e)}:vA(e),A):i},A.frequency=function(t){return arguments.length?(e=!!t,A):e},A},so.layout.pack=function(){function A(A,r){var o=t.call(this,A,r),s=o[0],a=i[0],l=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,oi(s,function(A){A.r=+c(A.value)}),oi(s,vi),n){var u=n*(e?1:Math.max(2*s.r/a,2*s.r/l))/2;oi(s,function(A){A.r+=u}),oi(s,vi),oi(s,function(A){A.r-=u})}return Gi(s,a/2,l/2,e?1:1/Math.max(2*s.r/a,2*s.r/l)),o}var e,t=so.layout.hierarchy().sort(Ii),n=0,i=[1,1];return A.size=function(e){return arguments.length?(i=e,A):i},A.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,A):e},A.padding=function(e){return arguments.length?(n=+e,A):n},ii(A,t)},so.layout.tree=function(){function A(A,i){var c=o.call(this,A,i),u=c[0],g=e(u);if(oi(g,t),g.parent.m=-g.z,ri(g,n),l)ri(u,r);else{var h=u,B=u,d=u;ri(u,function(A){A.xB.x&&(B=A),A.depth>d.depth&&(d=A)});var p=s(h,B)/2-h.x,Q=a[0]/(B.x+s(B,h)/2+p),E=a[1]/(d.depth||1);ri(u,function(A){A.x=(A.x+p)*Q,A.y=A.depth*E})}return c}function e(A){for(var e,t={A:null,children:[A]},n=[t];null!=(e=n.pop());)for(var i,r=e.children,o=0,s=r.length;s>o;++o)n.push((r[o]=i={_:r[o],parent:e,children:(i=r[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return t.children[0]}function t(A){var e=A.children,t=A.parent.children,n=A.i?t[A.i-1]:null;if(e.length){Ri(A);var r=(e[0].z+e[e.length-1].z)/2;n?(A.z=n.z+s(A._,n._),A.m=A.z-r):A.z=r}else n&&(A.z=n.z+s(A._,n._));A.parent.A=i(A,n,A.parent.A||t[0])}function n(A){A._.x=A.z+A.parent.m,A.m+=A.parent.m}function i(A,e,t){if(e){for(var n,i=A,r=A,o=e,a=i.parent.children[0],l=i.m,c=r.m,u=o.m,g=a.m;o=Hi(o),i=ki(i),o&&i;)a=ki(a),r=Hi(r),r.a=A,n=o.z+u-i.z-l+s(o._,i._),n>0&&(Li(Ui(o,A,t),A,n),l+=n,c+=n),u+=o.m,l+=i.m,g+=a.m,c+=r.m;o&&!Hi(r)&&(r.t=o,r.m+=u-c),i&&!ki(a)&&(a.t=i,a.m+=l-g,t=A)}return t}function r(A){A.x*=a[0],A.y=A.depth*a[1]}var o=so.layout.hierarchy().sort(null).value(null),s=Yi,a=[1,1],l=null;return A.separation=function(e){return arguments.length?(s=e,A):s},A.size=function(e){return arguments.length?(l=null==(a=e)?r:null,A):l?null:a},A.nodeSize=function(e){return arguments.length?(l=null==(a=e)?null:r,A):l?a:null},ii(A,o)},so.layout.cluster=function(){function A(A,r){var o,s=e.call(this,A,r),a=s[0],l=0;oi(a,function(A){var e=A.children;e&&e.length?(A.x=Si(e),A.y=xi(e)):(A.x=o?l+=t(A,o):0,A.y=0,o=A)});var c=Ti(a),u=Ni(a),g=c.x-t(c,u)/2,h=u.x+t(u,c)/2;return oi(a,i?function(A){A.x=(A.x-a.x)*n[0],A.y=(a.y-A.y)*n[1]}:function(A){A.x=(A.x-g)/(h-g)*n[0],A.y=(1-(a.y?A.y/a.y:1))*n[1]}),s}var e=so.layout.hierarchy().sort(null).value(null),t=Yi,n=[1,1],i=!1;return A.separation=function(e){return arguments.length?(t=e,A):t},A.size=function(e){return arguments.length?(i=null==(n=e),A):i?null:n},A.nodeSize=function(e){return arguments.length?(i=null!=(n=e),A):i?n:null},ii(A,e)},so.layout.treemap=function(){function A(A,e){for(var t,n,i=-1,r=A.length;++ie?0:e),t.area=isNaN(n)||0>=n?0:n}function e(t){var r=t.children;if(r&&r.length){var o,s,a,l=u(t),c=[],g=r.slice(),B=1/0,d="slice"===h?l.dx:"dice"===h?l.dy:"slice-dice"===h?1&t.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(A(g,l.dx*l.dy/t.value), -c.area=0;(a=g.length)>0;)c.push(o=g[a-1]),c.area+=o.area,"squarify"!==h||(s=n(c,d))<=B?(g.pop(),B=s):(c.area-=c.pop().area,i(c,d,l,!1),d=Math.min(l.dx,l.dy),c.length=c.area=0,B=1/0);c.length&&(i(c,d,l,!0),c.length=c.area=0),r.forEach(e)}}function t(e){var n=e.children;if(n&&n.length){var r,o=u(e),s=n.slice(),a=[];for(A(s,o.dx*o.dy/e.value),a.area=0;r=s.pop();)a.push(r),a.area+=r.area,null!=r.z&&(i(a,r.z?o.dx:o.dy,o,!s.length),a.length=a.area=0);n.forEach(t)}}function n(A,e){for(var t,n=A.area,i=0,r=1/0,o=-1,s=A.length;++ot&&(r=t),t>i&&(i=t));return n*=n,e*=e,n?Math.max(e*i*B/n,n/(e*r*B)):1/0}function i(A,e,t,n){var i,r=-1,o=A.length,s=t.x,l=t.y,c=e?a(A.area/e):0;if(e==t.dx){for((n||c>t.dy)&&(c=t.dy);++rt.dx)&&(c=t.dx);++rt&&(e=1),1>t&&(A=0),function(){var t,n,i;do{t=2*Math.random()-1,n=2*Math.random()-1,i=t*t+n*n}while(!i||i>1);return A+e*t*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var A=so.random.normal.apply(so,arguments);return function(){return Math.exp(A())}},bates:function(A){var e=so.random.irwinHall(A);return function(){return e()/A}},irwinHall:function(A){return function(){for(var e=0,t=0;A>t;t++)e+=Math.random();return e}}},so.scale={};var Ca={floor:E,ceil:E};so.scale.linear=function(){return zi([0,1],[0,1],fn,!1)};var wa={s:1,g:1,p:1,r:1,e:1};so.scale.log=function(){return nr(so.scale.linear().domain([0,1]),10,!0,[1,10])};var Ia=so.format(".0e"),ma={floor:function(A){return-Math.ceil(-A)},ceil:function(A){return-Math.floor(-A)}};so.scale.pow=function(){return ir(so.scale.linear(),1,[0,1])},so.scale.sqrt=function(){return so.scale.pow().exponent(.5)},so.scale.ordinal=function(){return or([],{t:"range",a:[[]]})},so.scale.category10=function(){return so.scale.ordinal().range(Ma)},so.scale.category20=function(){return so.scale.ordinal().range(ba)},so.scale.category20b=function(){return so.scale.ordinal().range(va)},so.scale.category20c=function(){return so.scale.ordinal().range(ya)};var Ma=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(fA),ba=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(fA),va=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(fA),ya=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(fA);so.scale.quantile=function(){return sr([],[])},so.scale.quantize=function(){return ar(0,1,[0,1])},so.scale.threshold=function(){return lr([.5],[0,1])},so.scale.identity=function(){return cr([0,1])},so.svg={},so.svg.arc=function(){function A(){var A=Math.max(0,+t.apply(this,arguments)),l=Math.max(0,+n.apply(this,arguments)),c=o.apply(this,arguments)-No,u=s.apply(this,arguments)-No,g=Math.abs(u-c),h=c>u?0:1;if(A>l&&(B=l,l=A,A=B),g>=To)return e(l,h)+(A?e(A,1-h):"")+"Z";var B,d,p,Q,E,f,C,w,I,m,M,b,v=0,y=0,D=[];if((Q=(+a.apply(this,arguments)||0)/2)&&(p=r===Da?Math.sqrt(A*A+l*l):+r.apply(this,arguments),h||(y*=-1),l&&(y=eA(p/l*Math.sin(Q))),A&&(v=eA(p/A*Math.sin(Q)))),l){E=l*Math.cos(c+y),f=l*Math.sin(c+y),C=l*Math.cos(u-y),w=l*Math.sin(u-y);var G=Math.abs(u-c-2*y)<=xo?0:1;if(y&&Qr(E,f,C,w)===h^G){var F=(c+u)/2;E=l*Math.cos(F),f=l*Math.sin(F),C=w=null}}else E=f=0;if(A){I=A*Math.cos(u-v),m=A*Math.sin(u-v),M=A*Math.cos(c+v),b=A*Math.sin(c+v);var Y=Math.abs(c-u+2*v)<=xo?0:1;if(v&&Qr(I,m,M,b)===1-h^Y){var k=(c+u)/2;I=A*Math.cos(k),m=A*Math.sin(k),M=b=null}}else I=m=0;if(g>Ro&&(B=Math.min(Math.abs(l-A)/2,+i.apply(this,arguments)))>.001){d=l>A^h?0:1;var H=B,L=B;if(xo>g){var R=null==M?[I,m]:null==C?[E,f]:Ht([E,f],[M,b],[C,w],[I,m]),U=E-R[0],x=f-R[1],S=C-R[0],T=w-R[1],N=1/Math.sin(Math.acos((U*S+x*T)/(Math.sqrt(U*U+x*x)*Math.sqrt(S*S+T*T)))/2),j=Math.sqrt(R[0]*R[0]+R[1]*R[1]);L=Math.min(B,(A-j)/(N-1)),H=Math.min(B,(l-j)/(N+1))}if(null!=C){var J=Er(null==M?[I,m]:[M,b],[E,f],l,H,h),_=Er([C,w],[I,m],l,H,h);B===H?D.push("M",J[0],"A",H,",",H," 0 0,",d," ",J[1],"A",l,",",l," 0 ",1-h^Qr(J[1][0],J[1][1],_[1][0],_[1][1]),",",h," ",_[1],"A",H,",",H," 0 0,",d," ",_[0]):D.push("M",J[0],"A",H,",",H," 0 1,",d," ",_[0])}else D.push("M",E,",",f);if(null!=M){var P=Er([E,f],[M,b],A,-L,h),O=Er([I,m],null==C?[E,f]:[C,w],A,-L,h);B===L?D.push("L",O[0],"A",L,",",L," 0 0,",d," ",O[1],"A",A,",",A," 0 ",h^Qr(O[1][0],O[1][1],P[1][0],P[1][1]),",",1-h," ",P[1],"A",L,",",L," 0 0,",d," ",P[0]):D.push("L",O[0],"A",L,",",L," 0 0,",d," ",P[0])}else D.push("L",I,",",m)}else D.push("M",E,",",f),null!=C&&D.push("A",l,",",l," 0 ",G,",",h," ",C,",",w),D.push("L",I,",",m),null!=M&&D.push("A",A,",",A," 0 ",Y,",",1-h," ",M,",",b);return D.push("Z"),D.join("")}function e(A,e){return"M0,"+A+"A"+A+","+A+" 0 1,"+e+" 0,"+-A+"A"+A+","+A+" 0 1,"+e+" 0,"+A}var t=gr,n=hr,i=ur,r=Da,o=Br,s=dr,a=pr;return A.innerRadius=function(e){return arguments.length?(t=vA(e),A):t},A.outerRadius=function(e){return arguments.length?(n=vA(e),A):n},A.cornerRadius=function(e){return arguments.length?(i=vA(e),A):i},A.padRadius=function(e){return arguments.length?(r=e==Da?Da:vA(e),A):r},A.startAngle=function(e){return arguments.length?(o=vA(e),A):o},A.endAngle=function(e){return arguments.length?(s=vA(e),A):s},A.padAngle=function(e){return arguments.length?(a=vA(e),A):a},A.centroid=function(){var A=(+t.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+o.apply(this,arguments)+ +s.apply(this,arguments))/2-No;return[Math.cos(e)*A,Math.sin(e)*A]},A};var Da="auto";so.svg.line=function(){return fr(E)};var Ga=so.map({linear:Cr,"linear-closed":wr,step:Ir,"step-before":mr,"step-after":Mr,basis:Fr,"basis-open":Yr,"basis-closed":kr,bundle:Hr,cardinal:yr,"cardinal-open":br,"cardinal-closed":vr,monotone:Tr});Ga.forEach(function(A,e){e.key=A,e.closed=/-closed$/.test(A)});var Fa=[0,2/3,1/3,0],Ya=[0,1/3,2/3,0],ka=[0,1/6,2/3,1/6];so.svg.line.radial=function(){var A=fr(Nr);return A.radius=A.x,delete A.x,A.angle=A.y,delete A.y,A},mr.reverse=Mr,Mr.reverse=mr,so.svg.area=function(){return jr(E)},so.svg.area.radial=function(){var A=jr(Nr);return A.radius=A.x,delete A.x,A.innerRadius=A.x0,delete A.x0,A.outerRadius=A.x1,delete A.x1,A.angle=A.y,delete A.y,A.startAngle=A.y0,delete A.y0,A.endAngle=A.y1,delete A.y1,A},so.svg.chord=function(){function A(A,s){var a=e(this,r,A,s),l=e(this,o,A,s);return"M"+a.p0+n(a.r,a.p1,a.a1-a.a0)+(t(a,l)?i(a.r,a.p1,a.r,a.p0):i(a.r,a.p1,l.r,l.p0)+n(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,a.r,a.p0))+"Z"}function e(A,e,t,n){var i=e.call(A,t,n),r=s.call(A,i,n),o=a.call(A,i,n)-No,c=l.call(A,i,n)-No;return{r:r,a0:o,a1:c,p0:[r*Math.cos(o),r*Math.sin(o)],p1:[r*Math.cos(c),r*Math.sin(c)]}}function t(A,e){return A.a0==e.a0&&A.a1==e.a1}function n(A,e,t){return"A"+A+","+A+" 0 "+ +(t>xo)+",1 "+e}function i(A,e,t,n){return"Q 0,0 "+n}var r=Et,o=ft,s=Jr,a=Br,l=dr;return A.radius=function(e){return arguments.length?(s=vA(e),A):s},A.source=function(e){return arguments.length?(r=vA(e),A):r},A.target=function(e){return arguments.length?(o=vA(e),A):o},A.startAngle=function(e){return arguments.length?(a=vA(e),A):a},A.endAngle=function(e){return arguments.length?(l=vA(e),A):l},A},so.svg.diagonal=function(){function A(A,i){var r=e.call(this,A,i),o=t.call(this,A,i),s=(r.y+o.y)/2,a=[r,{x:r.x,y:s},{x:o.x,y:s},o];return a=a.map(n),"M"+a[0]+"C"+a[1]+" "+a[2]+" "+a[3]}var e=Et,t=ft,n=_r;return A.source=function(t){return arguments.length?(e=vA(t),A):e},A.target=function(e){return arguments.length?(t=vA(e),A):t},A.projection=function(e){return arguments.length?(n=e,A):n},A},so.svg.diagonal.radial=function(){var A=so.svg.diagonal(),e=_r,t=A.projection;return A.projection=function(A){return arguments.length?t(Pr(e=A)):e},A},so.svg.symbol=function(){function A(A,n){return(Ha.get(e.call(this,A,n))||Wr)(t.call(this,A,n))}var e=Vr,t=Or;return A.type=function(t){return arguments.length?(e=vA(t),A):e},A.size=function(e){return arguments.length?(t=vA(e),A):t},A};var Ha=so.map({circle:Wr,cross:function(A){var e=Math.sqrt(A/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(A){var e=Math.sqrt(A/(2*Ra)),t=e*Ra;return"M0,"+-e+"L"+t+",0 0,"+e+" "+-t+",0Z"},square:function(A){var e=Math.sqrt(A)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(A){var e=Math.sqrt(A/La),t=e*La/2;return"M0,"+t+"L"+e+","+-t+" "+-e+","+-t+"Z"},"triangle-up":function(A){var e=Math.sqrt(A/La),t=e*La/2;return"M0,"+-t+"L"+e+","+t+" "+-e+","+t+"Z"}});so.svg.symbolTypes=Ha.keys();var La=Math.sqrt(3),Ra=Math.tan(30*jo);yo.transition=function(A){for(var e,t,n=Ua||++Na,i=qr(A),r=[],o=xa||{time:Date.now(),ease:vn,delay:0,duration:250},s=-1,a=this.length;++sr;r++){i.push(e=[]);for(var t=this[r],s=0,a=t.length;a>s;s++)(n=t[s])&&A.call(n,n.__data__,s,r)&&e.push(n)}return zr(i,this.namespace,this.id)},Ta.tween=function(A,e){var t=this.id,n=this.namespace;return arguments.length<2?this.node()[n][t].tween.get(A):_(this,null==e?function(e){e[n][t].tween.remove(A)}:function(i){i[n][t].tween.set(A,e)})},Ta.attr=function(A,e){function t(){this.removeAttribute(s)}function n(){this.removeAttributeNS(s.space,s.local)}function i(A){return null==A?t:(A+="",function(){var e,t=this.getAttribute(s);return t!==A&&(e=o(t,A),function(A){this.setAttribute(s,e(A))})})}function r(A){return null==A?n:(A+="",function(){var e,t=this.getAttributeNS(s.space,s.local);return t!==A&&(e=o(t,A),function(A){this.setAttributeNS(s.space,s.local,e(A))})})}if(arguments.length<2){for(e in A)this.attr(e,A[e]);return this}var o="transform"==A?Wn:fn,s=so.ns.qualify(A);return Zr(this,"attr."+A,e,s.local?r:i)},Ta.attrTween=function(A,e){function t(A,t){var n=e.call(this,A,t,this.getAttribute(i));return n&&function(A){this.setAttribute(i,n(A))}}function n(A,t){var n=e.call(this,A,t,this.getAttributeNS(i.space,i.local));return n&&function(A){this.setAttributeNS(i.space,i.local,n(A))}}var i=so.ns.qualify(A);return this.tween("attr."+A,i.local?n:t)},Ta.style=function(A,t,n){function i(){this.style.removeProperty(A)}function r(t){return null==t?i:(t+="",function(){var i,r=e(this).getComputedStyle(this,null).getPropertyValue(A);return r!==t&&(i=fn(r,t),function(e){this.style.setProperty(A,i(e),n)})})}var o=arguments.length;if(3>o){if("string"!=typeof A){2>o&&(t="");for(n in A)this.style(n,A[n],t);return this}n=""}return Zr(this,"style."+A,t,r)},Ta.styleTween=function(A,t,n){function i(i,r){var o=t.call(this,i,r,e(this).getComputedStyle(this,null).getPropertyValue(A));return o&&function(e){this.style.setProperty(A,o(e),n)}}return arguments.length<3&&(n=""),this.tween("style."+A,i)},Ta.text=function(A){return Zr(this,"text",A,Xr)},Ta.remove=function(){var A=this.namespace;return this.each("end.transition",function(){var e;this[A].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ta.ease=function(A){var e=this.id,t=this.namespace;return arguments.length<1?this.node()[t][e].ease:("function"!=typeof A&&(A=so.ease.apply(so,arguments)),_(this,function(n){n[t][e].ease=A}))},Ta.delay=function(A){var e=this.id,t=this.namespace;return arguments.length<1?this.node()[t][e].delay:_(this,"function"==typeof A?function(n,i,r){n[t][e].delay=+A.call(n,n.__data__,i,r)}:(A=+A,function(n){n[t][e].delay=A}))},Ta.duration=function(A){var e=this.id,t=this.namespace;return arguments.length<1?this.node()[t][e].duration:_(this,"function"==typeof A?function(n,i,r){n[t][e].duration=Math.max(1,A.call(n,n.__data__,i,r))}:(A=Math.max(1,A),function(n){n[t][e].duration=A}))},Ta.each=function(A,e){var t=this.id,n=this.namespace;if(arguments.length<2){var i=xa,r=Ua;try{Ua=t,_(this,function(e,i,r){xa=e[n][t],A.call(e,e.__data__,i,r)})}finally{xa=i,Ua=r}}else _(this,function(i){var r=i[n][t];(r.event||(r.event=so.dispatch("start","end","interrupt"))).on(A,e)});return this},Ta.transition=function(){for(var A,e,t,n,i=this.id,r=++Na,o=this.namespace,s=[],a=0,l=this.length;l>a;a++){s.push(A=[]);for(var e=this[a],c=0,u=e.length;u>c;c++)(t=e[c])&&(n=t[o][i],$r(t,c,o,r,{time:n.time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration})),A.push(t)}return zr(s,o,r)},so.svg.axis=function(){function A(A){A.each(function(){var A,l=so.select(this),c=this.__chart__||t,u=this.__chart__=t.copy(),g=null==a?u.ticks?u.ticks.apply(u,s):u.domain():a,h=null==e?u.tickFormat?u.tickFormat.apply(u,s):E:e,B=l.selectAll(".tick").data(g,u),d=B.enter().insert("g",".domain").attr("class","tick").style("opacity",Ro),p=so.transition(B.exit()).style("opacity",Ro).remove(),Q=so.transition(B.order()).style("opacity",1),f=Math.max(i,0)+o,C=Pi(u),w=l.selectAll(".domain").data([0]),I=(w.enter().append("path").attr("class","domain"),so.transition(w));d.append("line"),d.append("text");var m,M,b,v,y=d.select("line"),D=Q.select("line"),G=B.select("text").text(h),F=d.select("text"),Y=Q.select("text"),k="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(A=Ao,m="x",b="y",M="x2",v="y2",G.attr("dy",0>k?"0em":".71em").style("text-anchor","middle"),I.attr("d","M"+C[0]+","+k*r+"V0H"+C[1]+"V"+k*r)):(A=eo,m="y",b="x",M="y2",v="x2",G.attr("dy",".32em").style("text-anchor",0>k?"end":"start"),I.attr("d","M"+k*r+","+C[0]+"H0V"+C[1]+"H"+k*r)),y.attr(v,k*i),F.attr(b,k*f),D.attr(M,0).attr(v,k*i),Y.attr(m,0).attr(b,k*f),u.rangeBand){var H=u,L=H.rangeBand()/2;c=u=function(A){return H(A)+L}}else c.rangeBand?c=u:p.call(A,u,c);d.call(A,c,u),Q.call(A,u,u)})}var e,t=so.scale.linear(),n=ja,i=6,r=6,o=3,s=[10],a=null;return A.scale=function(e){return arguments.length?(t=e,A):t},A.orient=function(e){return arguments.length?(n=e in Ja?e+"":ja,A):n},A.ticks=function(){return arguments.length?(s=lo(arguments),A):s},A.tickValues=function(e){return arguments.length?(a=e,A):a},A.tickFormat=function(t){return arguments.length?(e=t,A):e},A.tickSize=function(e){var t=arguments.length;return t?(i=+e,r=+arguments[t-1],A):i},A.innerTickSize=function(e){return arguments.length?(i=+e,A):i},A.outerTickSize=function(e){return arguments.length?(r=+e,A):r},A.tickPadding=function(e){return arguments.length?(o=+e,A):o},A.tickSubdivide=function(){return arguments.length&&A},A};var ja="bottom",Ja={top:1,right:1,bottom:1,left:1};so.svg.brush=function(){function A(e){e.each(function(){var e=so.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",r).on("touchstart.brush",r),o=e.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=e.selectAll(".resize").data(d,E);s.exit().remove(),s.enter().append("g").attr("class",function(A){return"resize "+A}).style("cursor",function(A){return _a[A]}).append("rect").attr("x",function(A){return/[ew]$/.test(A)?-3:null}).attr("y",function(A){return/^[ns]/.test(A)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",A.empty()?"none":null);var a,u=so.transition(e),g=so.transition(o);l&&(a=Pi(l),g.attr("x",a[0]).attr("width",a[1]-a[0]),n(u)),c&&(a=Pi(c),g.attr("y",a[0]).attr("height",a[1]-a[0]),i(u)),t(u)})}function t(A){A.selectAll(".resize").attr("transform",function(A){return"translate("+u[+/e$/.test(A)]+","+g[+/^s/.test(A)]+")"})}function n(A){A.select(".extent").attr("x",u[0]),A.selectAll(".extent,.n>rect,.s>rect").attr("width",u[1]-u[0])}function i(A){A.select(".extent").attr("y",g[0]),A.selectAll(".extent,.e>rect,.w>rect").attr("height",g[1]-g[0])}function r(){function r(){32==so.event.keyCode&&(G||(f=null,Y[0]-=u[1],Y[1]-=g[1],G=2),M())}function d(){32==so.event.keyCode&&2==G&&(Y[0]+=u[1],Y[1]+=g[1],G=0,M())}function p(){var A=so.mouse(w),e=!1;C&&(A[0]+=C[0],A[1]+=C[1]),G||(so.event.altKey?(f||(f=[(u[0]+u[1])/2,(g[0]+g[1])/2]),Y[0]=u[+(A[0]c?(i=n,n=c):i=c),d[0]!=n||d[1]!=i?(t?s=null:o=null,d[0]=n,d[1]=i,!0):void 0}function E(){p(),b.style("pointer-events","all").selectAll(".resize").style("display",A.empty()?"none":null),so.select("body").style("cursor",null),k.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),F(),m({type:"brushend"})}var f,C,w=this,I=so.select(so.event.target),m=a.of(w,arguments),b=so.select(w),v=I.datum(),y=!/^(n|s)$/.test(v)&&l,D=!/^(e|w)$/.test(v)&&c,G=I.classed("extent"),F=z(w),Y=so.mouse(w),k=so.select(e(w)).on("keydown.brush",r).on("keyup.brush",d);if(so.event.changedTouches?k.on("touchmove.brush",p).on("touchend.brush",E):k.on("mousemove.brush",p).on("mouseup.brush",E),b.interrupt().selectAll("*").interrupt(),G)Y[0]=u[0]-Y[0],Y[1]=g[0]-Y[1];else if(v){var H=+/w$/.test(v),L=+/^n/.test(v);C=[u[1-H]-Y[0],g[1-L]-Y[1]],Y[0]=u[H],Y[1]=g[L]}else so.event.altKey&&(f=Y.slice());b.style("pointer-events","none").selectAll(".resize").style("display",null),so.select("body").style("cursor",I.style("cursor")),m({type:"brushstart"}),p()}var o,s,a=v(A,"brushstart","brush","brushend"),l=null,c=null,u=[0,0],g=[0,0],h=!0,B=!0,d=Pa[0];return A.event=function(A){A.each(function(){var A=a.of(this,arguments),e={x:u,y:g,i:o,j:s},t=this.__chart__||e;this.__chart__=e,Ua?so.select(this).transition().each("start.brush",function(){o=t.i,s=t.j,u=t.x,g=t.y,A({type:"brushstart"})}).tween("brush:brush",function(){var t=Cn(u,e.x),n=Cn(g,e.y);return o=s=null,function(i){u=e.x=t(i),g=e.y=n(i),A({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=e.i,s=e.j,A({type:"brush",mode:"resize"}),A({type:"brushend"})}):(A({type:"brushstart"}),A({type:"brush",mode:"resize"}),A({type:"brushend"}))})},A.x=function(e){return arguments.length?(l=e,d=Pa[!l<<1|!c],A):l},A.y=function(e){return arguments.length?(c=e,d=Pa[!l<<1|!c],A):c},A.clamp=function(e){return arguments.length?(l&&c?(h=!!e[0],B=!!e[1]):l?h=!!e:c&&(B=!!e),A):l&&c?[h,B]:l?h:c?B:null},A.extent=function(e){var t,n,i,r,a;return arguments.length?(l&&(t=e[0],n=e[1],c&&(t=t[0],n=n[0]),o=[t,n],l.invert&&(t=l(t),n=l(n)),t>n&&(a=t,t=n,n=a),t==u[0]&&n==u[1]||(u=[t,n])),c&&(i=e[0],r=e[1],l&&(i=i[1],r=r[1]),s=[i,r],c.invert&&(i=c(i),r=c(r)),i>r&&(a=i,i=r,r=a),i==g[0]&&r==g[1]||(g=[i,r])),A):(l&&(o?(t=o[0],n=o[1]):(t=u[0],n=u[1],l.invert&&(t=l.invert(t),n=l.invert(n)),t>n&&(a=t,t=n,n=a))),c&&(s?(i=s[0],r=s[1]):(i=g[0],r=g[1],c.invert&&(i=c.invert(i),r=c.invert(r)),i>r&&(a=i,i=r,r=a))),l&&c?[[t,i],[n,r]]:l?[t,n]:c&&[i,r])},A.clear=function(){return A.empty()||(u=[0,0],g=[0,0],o=s=null),A},A.empty=function(){return!!l&&u[0]==u[1]||!!c&&g[0]==g[1]},so.rebind(A,a,"on")};var _a={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Pa=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Oa=cs.format=ps.timeFormat,Va=Oa.utc,Wa=Va("%Y-%m-%dT%H:%M:%S.%LZ");Oa.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?to:Wa,to.parse=function(A){var e=new Date(A);return isNaN(e)?null:e},to.toString=Wa.toString,cs.second=NA(function(A){return new us(1e3*Math.floor(A/1e3))},function(A,e){A.setTime(A.getTime()+1e3*Math.floor(e))},function(A){return A.getSeconds()}),cs.seconds=cs.second.range,cs.seconds.utc=cs.second.utc.range,cs.minute=NA(function(A){return new us(6e4*Math.floor(A/6e4))},function(A,e){A.setTime(A.getTime()+6e4*Math.floor(e))},function(A){return A.getMinutes()}),cs.minutes=cs.minute.range,cs.minutes.utc=cs.minute.utc.range,cs.hour=NA(function(A){var e=A.getTimezoneOffset()/60;return new us(36e5*(Math.floor(A/36e5-e)+e))},function(A,e){A.setTime(A.getTime()+36e5*Math.floor(e))},function(A){return A.getHours()}),cs.hours=cs.hour.range,cs.hours.utc=cs.hour.utc.range,cs.month=NA(function(A){return A=cs.day(A),A.setDate(1),A},function(A,e){A.setMonth(A.getMonth()+e)},function(A){return A.getMonth()}),cs.months=cs.month.range,cs.months.utc=cs.month.utc.range;var Ka=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],za=[[cs.second,1],[cs.second,5],[cs.second,15],[cs.second,30],[cs.minute,1],[cs.minute,5],[cs.minute,15],[cs.minute,30],[cs.hour,1],[cs.hour,3],[cs.hour,6],[cs.hour,12],[cs.day,1],[cs.day,2],[cs.week,1],[cs.month,1],[cs.month,3],[cs.year,1]],Za=Oa.multi([[".%L",function(A){return A.getMilliseconds()}],[":%S",function(A){return A.getSeconds()}],["%I:%M",function(A){return A.getMinutes()}],["%I %p",function(A){return A.getHours()}],["%a %d",function(A){return A.getDay()&&1!=A.getDate()}],["%b %d",function(A){return 1!=A.getDate()}],["%B",function(A){return A.getMonth()}],["%Y",Ge]]),Xa={range:function(A,e,t){return so.range(Math.ceil(A/t)*t,+e,t).map(io)},floor:E,ceil:E};za.year=cs.year,cs.scale=function(){return no(so.scale.linear(),za,Za)};var qa=za.map(function(A){return[A[0].utc,A[1]]}),$a=Va.multi([[".%L",function(A){return A.getUTCMilliseconds()}],[":%S",function(A){return A.getUTCSeconds()}],["%I:%M",function(A){return A.getUTCMinutes()}],["%I %p",function(A){return A.getUTCHours()}],["%a %d",function(A){return A.getUTCDay()&&1!=A.getUTCDate()}],["%b %d",function(A){return 1!=A.getUTCDate()}],["%B",function(A){return A.getUTCMonth()}],["%Y",Ge]]);qa.year=cs.year.utc,cs.scale.utc=function(){return no(so.scale.linear(),qa,$a)},so.text=yA(function(A){return A.responseText}),so.json=function(A,e){return DA(A,"application/json",ro,e)},so.html=function(A,e){return DA(A,"text/html",oo,e)},so.xml=yA(function(A){return A.responseXML}),"function"==typeof define&&define.amd?(this.d3=so,define("d3",so)):"object"==typeof module&&module.exports?module.exports=so:this.d3=so}(),define("utils/helper",["require","d3"],function(A){var e=A("d3"),t={};t.format_time=function(A){var e=Math.floor(A/60),t=Math.floor(A%60),n=Math.round(A%1*60);60===n&&(t++,n=0);var i=function(A){return A=A.toString(),1===A.length?"0"+A:A},r=e?i(e)+":":"";return r+=i(t)+":"+i(n)};var n=e.time.format("%Y-%m-%d %H:%M");t.format_date=function(A){return n(A)};var i=[.0625,.1875,.3125,.4375,.5625,.6875,.8125,.9375,1.0625];return t.eights=function(A){for(var e,t=Math.floor(A),n=A%1,r=8;r>=0;r--)n<=i[r]&&(e=r);8===e&&(t++,e=0);var o=t||"";return o+=e?" "+e+"8":""},t.version_generator=function(A){A=A||"0";var e=A.split(".").concat([0,0,0,0,0,0,0,0,0,0]),t=function(A){e[A-1]++;for(var t=A;t1&&0===A[0];)A.shift();return A.reverse(),A.join(".")};return function(A){return 0===arguments.length?n():(t(A),n())}},t.double_id=function(A,e){return Math.min(A,e)+"_"+Math.max(A,e)},t.pairs=function(A){var e=A.map(function(e,t){return A.slice(t+1).map(function(e){return[A[t],e]})}).reduce(function(A,e){return A.concat(e)},[]);return e.each=function(A){e.forEach(function(e){A(e[0],e[1])})},e},t.blank_text=function(A){return(A||"").replace(/./g," ")},t.get_indentation=function(A){var e=(A||"").match(/^(\s+)/);return e?e[0]:""},t}),define("utils/pdfmaker",["require","pdfkit","utils/helper"],function(A){function e(A){var e=A.print,t=A.config.fonts||null,n={compress:!1,size:"a4"===e.paper_size?"A4":"LETTER",margins:{top:0,left:0,bottom:0,right:0}},i=new o(n);A.config.fonts?(i.registerFont("ScriptNormal",t.normal.src,t.normal.family),i.registerFont("ScriptBold",t.bold.src,t.bold.family),i.registerFont("ScriptBoldOblique",t.bolditalic.src,t.bolditalic.family),i.registerFont("ScriptOblique",t.italic.src,t.italic.family)):(i.registerFont("ScriptNormal","Courier"),i.registerFont("ScriptBold","Courier-Bold"),i.registerFont("ScriptBoldOblique","Courier-BoldOblique"),i.registerFont("ScriptOblique","Courier-Oblique")),i.font("ScriptNormal"),i.fontSize(e.font_size||12),i.reset_format=function(){i.format_state={bold:!1,italic:!1,underline:!1,override_color:null}},i.reset_format();var r=i.text;return i.simple_text=function(){i.font("ScriptNormal"),r.apply(i,arguments)},i.format_text=function(A,e,t,n){var r=i.format_state;i.reset_format(),i.text(A,e,t,n),i.format_state=r},i.text=function(A,t,n,o){o=o||{};var s=o.color||"black";s=i.format_state.override_color?i.format_state.override_color:s,i.fill(s),e.note.italic&&(A=A.replace(/\[\[/g,"*[[").replace(/\]\]/g,"]]*"));for(var a=A.split(/(\\\*)|(\*{1,3})|(\\?_)|(\[\[)|(\]\])/g).filter(function(A){return A}),l=e.font_width,c=0;c=e.length&&(t=""),t&&(t+=" "),A.format_text(t+r.print_header,1.5,o.page_number_top_margin,{color:"#777777"})}r.print_footer&&A.format_text(r.print_footer,1.5,o.page_height-.5,{color:"#777777"})},k=function(){if(r.print_watermark){var e,t,n,i,s={origin:[0,0]},a=180*Math.atan(o.page_height/o.page_width)/Math.PI;n=r.print_watermark.replace(/_/g,""),i=n.replace(/\*/g,"").length,t=Math.sqrt(Math.pow(o.page_width,2)+Math.pow(o.page_height,2)),t-=4,e=1.667*t/i*72,A.fontSize(e),A.rotate(a,s),A.format_text(n,2,-e/2/72,{color:"#eeeeee",line_break:!1}),A.rotate(-a,s),A.fontSize(o.font_size||12)}};k(),Y(),a.forEach(function(e){if("page_break"===e.type){if(r.scene_continuation_bottom&&e.scene_split){var t="("+(r.text_scene_continued||"CONTINUED")+")",n=o.action.feed+o.action.max*o.font_width-t.length*o.font_width;A.simple_text(t,72*n,72*(o.top_margin+o.font_height*(M+2)))}M=0,A.addPage(),b++;var i=o.page_number_top_margin;if(r.scene_continuation_top&&e.scene_split){y[C]=y[C]||0,y[C]++;var s=("none"!==r.scenes_numbers&&C?C+" ":"")+(r.text_scene_continued||"CONTINUED")+":";s+=y[C]>1?" ("+y[C]+")":"",s=s.replace(/\*/g,""),s=s.replace(/_/g,""),A.simple_text(s,72*o.action.feed,72*i),v=s}if(r.show_page_numbers){var a=b.toFixed()+".",l=o.action.feed+o.action.max*o.font_width-a.length*o.font_width;A.simple_text(a,72*l,72*i)}k(),Y(v),v=""}else if("separator"===e.type)M++;else{m=e.text;var c=o[e.type]&&o[e.type].color||"#000000",u={color:c};if("centered"===e.type)g(m,o.top_margin+o.font_height*M++);else{var n=(o[e.type]||{}).feed||o.action.feed;if("transition"===e.type&&(n=o.action.feed+o.action.max*o.font_width-e.text.length*o.font_width),"scene_heading"===e.type&&r.embolden_scene_headers&&(m="**"+m+"**"),"scene_heading"===e.type&&r.underline_scene_headers&&(m="_"+m+"_"),"section"===e.type?(D=e.token.level,n+=D*o.section.level_indent,r.number_sections&&(e.token!==I?(w=G(e.token.level),I=e.token,m=w+". "+m):m=Array(w.length+3).join(" ")+m)):"synopsis"===e.type&&(n+=o.synopsis.padding||0,o.synopsis.feed_with_last_section&&F?n+=D*o.section.level_indent:n=o.action.feed),o[e.type]&&o[e.type].italic&&m&&(m="*"+m+"*"),e.token&&e.token.dual){if(e.right_column){var h=M;e.right_column.forEach(function(e){var t=(o[e.type]||{}).feed||o.action.feed;t-=(t-o.left_margin)/2,t+=(o.page_width-o.right_margin-o.left_margin)/2,A.text(e.text,t,o.top_margin+o.font_height*h++,u)})}n-=(n-o.left_margin)/2}if(A.text(m,n,o.top_margin+o.font_height*M,u),e.number){C=String(e.number);var B=C.length;r.embolden_scene_headers&&(C="**"+C+"**"),r.underline_scene_headers&&(C="_"+C+"_");var d;"both"!==r.scenes_numbers&&"left"!==r.scenes_numbers||(d=(B+4)*o.font_width,A.text(C,n-d,o.top_margin+o.font_height*M,u)),"both"!==r.scenes_numbers&&"right"!==r.scenes_numbers||(d=(o.scene_heading.max+1)*o.font_width,A.text(C,n+d,o.top_margin+o.font_height*M,u))}M++}} -"section"===e.type?F=!0:"separator"!==e.type&&"synopsis"!==e.type&&"page_break"!==e.type&&(F=!1)})}var o=A("pdfkit"),s=A("utils/helper"),a={},l=function(e){var t={chunks:[],filepath:e};return t.on=function(A,e){this.callback=e},t.once=function(){},t.emit=function(){},t.write=function(A){this.chunks.push(A)},t.end=function(){if(t.filepath){var e=A("fs"),n=e.createWriteStream(t.filepath,{encoding:"binary"});n.on("finish",this.callback),t.chunks.forEach(function(A){n.write(new Buffer(A.toString("base64"),"base64"))}),n.end()}else t.blob=new Blob(t.chunks,{type:"application/pdf"}),t.url=URL.createObjectURL(this.blob),this.callback(t)},t},c=function(A,e){var t=null;return A&&A.title_page&&A.title_page.forEach(function(A){A.is(e)&&(t=A)}),t};return a.get_pdf=function(A){var t=e(A);r(t,A),i(t,A.callback,A.filepath)},a}),define("utils/textstats",["require"],function(A){var e={};return e.get_characters=function(A){var e,t={};for(e=0;e-1}function s(A,e,t){for(var n=-1,i=null==A?0:A.length;++n-1;);return t}function k(A,e){for(var t=A.length;t--&&Q(e,A[t],0)>-1;);return t}function H(A,e){for(var t=A.length,n=0;t--;)A[t]===e&&++n;return n}function L(A){return"\\"+ft[A]}function R(A,e){return null==A?X:A[e]}function U(A){return ct.test(A)}function x(A){return ut.test(A)}function S(A){for(var e,t=[];!(e=A.next()).done;)t.push(e.value);return t}function T(A){var e=-1,t=Array(A.size);return A.forEach(function(A,n){t[++e]=[n,A]}),t}function N(A,e){return function(t){return A(e(t))}}function j(A,e){for(var t=-1,n=A.length,i=0,r=[];++t>>1,kA=[["ary",pA],["bind",lA],["bindKey",cA],["curry",gA],["curryRight",hA],["flip",EA],["partial",BA],["partialRight",dA],["rearg",QA]],HA="[object Arguments]",LA="[object Array]",RA="[object AsyncFunction]",UA="[object Boolean]",xA="[object Date]",SA="[object DOMException]",TA="[object Error]",NA="[object Function]",jA="[object GeneratorFunction]",JA="[object Map]",_A="[object Number]",PA="[object Null]",OA="[object Object]",VA="[object Proxy]",WA="[object RegExp]",KA="[object Set]",zA="[object String]",ZA="[object Symbol]",XA="[object Undefined]",qA="[object WeakMap]",$A="[object WeakSet]",Ae="[object ArrayBuffer]",ee="[object DataView]",te="[object Float32Array]",ne="[object Float64Array]",ie="[object Int8Array]",re="[object Int16Array]",oe="[object Int32Array]",se="[object Uint8Array]",ae="[object Uint8ClampedArray]",le="[object Uint16Array]",ce="[object Uint32Array]",ue=/\b__p \+= '';/g,ge=/\b(__p \+=) '' \+/g,he=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Be=/&(?:amp|lt|gt|quot|#39);/g,de=/[&<>"']/g,pe=RegExp(Be.source),Qe=RegExp(de.source),Ee=/<%-([\s\S]+?)%>/g,fe=/<%([\s\S]+?)%>/g,Ce=/<%=([\s\S]+?)%>/g,we=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/,me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Me=/[\\^$.*+?()[\]{}|]/g,be=RegExp(Me.source),ve=/^\s+|\s+$/g,ye=/^\s+/,De=/\s+$/,Ge=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Fe=/\{\n\/\* \[wrapped with (.+)\] \*/,Ye=/,? & /,ke=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,He=/\\(\\)?/g,Le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Re=/\w*$/,Ue=/^[-+]0x[0-9a-f]+$/i,xe=/^0b[01]+$/i,Se=/^\[object .+?Constructor\]$/,Te=/^0o[0-7]+$/i,Ne=/^(?:0|[1-9]\d*)$/,je=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Je=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Pe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Oe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ve="["+Oe+"]",We="["+Pe+"]",Ke="[a-z\\xdf-\\xf6\\xf8-\\xff]",ze="[^\\ud800-\\udfff"+Oe+"\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ze="\\ud83c[\\udffb-\\udfff]",Xe="(?:\\ud83c[\\udde6-\\uddff]){2}",qe="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",At="(?:"+Ke+"|"+ze+")",et="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",tt="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",Xe,qe].join("|")+")[\\ufe0e\\ufe0f]?"+et+")*",nt="[\\ufe0e\\ufe0f]?"+et+tt,it="(?:"+["[\\u2700-\\u27bf]",Xe,qe].join("|")+")"+nt,rt="(?:"+["[^\\ud800-\\udfff]"+We+"?",We,Xe,qe,"[\\ud800-\\udfff]"].join("|")+")",ot=RegExp("['’]","g"),st=RegExp(We,"g"),at=RegExp(Ze+"(?="+Ze+")|"+rt+nt,"g"),lt=RegExp([$e+"?"+Ke+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Ve,$e,"$"].join("|")+")","(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Ve,$e+At,"$"].join("|")+")",$e+"?"+At+"+(?:['’](?:d|ll|m|re|s|t|ve))?",$e+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",it].join("|"),"g"),ct=RegExp("[\\u200d\\ud800-\\udfff"+Pe+"\\ufe0e\\ufe0f]"),ut=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ht=-1,Bt={};Bt[te]=Bt[ne]=Bt[ie]=Bt[re]=Bt[oe]=Bt[se]=Bt[ae]=Bt[le]=Bt[ce]=!0,Bt[HA]=Bt[LA]=Bt[Ae]=Bt[UA]=Bt[ee]=Bt[xA]=Bt[TA]=Bt[NA]=Bt[JA]=Bt[_A]=Bt[OA]=Bt[WA]=Bt[KA]=Bt[zA]=Bt[qA]=!1;var dt={};dt[HA]=dt[LA]=dt[Ae]=dt[ee]=dt[UA]=dt[xA]=dt[te]=dt[ne]=dt[ie]=dt[re]=dt[oe]=dt[JA]=dt[_A]=dt[OA]=dt[WA]=dt[KA]=dt[zA]=dt[ZA]=dt[se]=dt[ae]=dt[le]=dt[ce]=!0,dt[TA]=dt[NA]=dt[qA]=!1;var pt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Qt={"&":"&","<":"<",">":">",'"':""","'":"'"},Et={"&":"&","<":"<",">":">",""":'"',"'":"'"},ft={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ct=parseFloat,wt=parseInt,It="object"==typeof global&&global&&global.Object===Object&&global,mt="object"==typeof self&&self&&self.Object===Object&&self,Mt=It||mt||Function("return this")(),bt="object"==typeof exports&&exports&&!exports.nodeType&&exports,vt=bt&&"object"==typeof module&&module&&!module.nodeType&&module,yt=vt&&vt.exports===bt,Dt=yt&&It.process,Gt=function(){try{var A=vt&&vt.require&&vt.require("util").types;return A||Dt&&Dt.binding&&Dt.binding("util")}catch(A){}}(),Ft=Gt&&Gt.isArrayBuffer,Yt=Gt&&Gt.isDate,kt=Gt&&Gt.isMap,Ht=Gt&&Gt.isRegExp,Lt=Gt&&Gt.isSet,Rt=Gt&&Gt.isTypedArray,Ut=w("length"),xt=I(pt),St=I(Qt),Tt=I(Et),Nt=function h(I){function P(A){if(ea(A)&&!gg(A)&&!(A instanceof ke)){if(A instanceof z)return A;if(gc.call(A,"__wrapped__"))return Xr(A)}return new z(A)}function K(){}function z(A,e){this.__wrapped__=A,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=X}function ke(A){this.__wrapped__=A,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=GA,this.__views__=[]}function Pe(){var A=new ke(this.__wrapped__);return A.__actions__=ki(this.__actions__),A.__dir__=this.__dir__,A.__filtered__=this.__filtered__,A.__iteratees__=ki(this.__iteratees__),A.__takeCount__=this.__takeCount__,A.__views__=ki(this.__views__),A}function Oe(){if(this.__filtered__){var A=new ke(this);A.__dir__=-1,A.__filtered__=!0}else A=this.clone(),A.__dir__*=-1;return A}function Ve(){var A=this.__wrapped__.value(),e=this.__dir__,t=gg(A),n=e<0,i=t?A.length:0,r=wr(0,i,this.__views__),o=r.start,s=r.end,a=s-o,l=n?s:o-1,c=this.__iteratees__,u=c.length,g=0,h=Jc(a,this.__takeCount__);if(!t||!n&&i==a&&h==a)return di(A,this.__actions__);var B=[];A:for(;a--&&g-1}function it(A,e){var t=this.__data__,n=Vt(t,A);return n<0?(++this.size,t.push([A,e])):t[n][1]=e,this}function rt(A){var e=-1,t=null==A?0:A.length;for(this.clear();++e=e?A:e)),A}function $t(A,e,n,i,r,o){var s,a=e&iA,l=e&rA,c=e&oA;if(n&&(s=r?n(A,i,r,o):n(A)),s!==X)return s;if(!Aa(A))return A;var u=gg(A);if(u){if(s=Mr(A),!a)return ki(A,s)}else{var g=Iu(A),h=g==NA||g==jA;if(Bg(A))return Ii(A,a);if(g==OA||g==HA||h&&!r){if(s=l||h?{}:br(A),!a)return l?Ri(A,zt(s,A)):Li(A,Kt(s,A))}else{if(!dt[g])return r?A:{};s=vr(A,g,a)}}o||(o=new It);var B=o.get(A);if(B)return B;o.set(A,s),Eg(A)?A.forEach(function(t){s.add($t(t,e,n,t,A,o))}):pg(A)&&A.forEach(function(t,i){s.set(i,$t(t,e,n,i,A,o))});var d=c?l?hr:gr:l?xa:Ua,p=u?X:d(A);return t(p||A,function(t,i){p&&(i=t,t=A[i]),Ot(s,i,$t(t,e,n,i,A,o))}),s}function An(A){var e=Ua(A);return function(t){return en(t,A,e)}}function en(A,e,t){var n=t.length;if(null==A)return!n;for(A=nc(A);n--;){var i=t[n],r=e[i],o=A[i];if(o===X&&!(i in A)||!r(o))return!1}return!0}function tn(A,e,t){if("function"!=typeof A)throw new oc(AA);return bu(function(){A.apply(X,t)},e)}function nn(A,e,t,n){var i=-1,r=o,l=!0,c=A.length,u=[],g=e.length;if(!c)return u;t&&(e=a(e,D(t))),n?(r=s,l=!1):e.length>=q&&(r=F,l=!1,e=new Qt(e));A:for(;++ii?0:i+t),n=n===X||n>i?i:Ea(n),n<0&&(n+=i),n=t>n?0:fa(n);t0&&t(s)?e>1?ln(s,e-1,t,n,i):l(i,s):n||(i[i.length]=s)}return i}function cn(A,e){return A&&gu(A,e,Ua)}function un(A,e){return A&&hu(A,e,Ua)}function gn(A,e){return r(e,function(e){return Xs(A[e])})}function hn(A,e){e=Ci(e,A);for(var t=0,n=e.length;null!=A&&te}function Qn(A,e){return null!=A&&gc.call(A,e)}function En(A,e){return null!=A&&e in nc(A)}function fn(A,e,t){return A>=Jc(e,t)&&A=120&&h.length>=120)?new Qt(l&&h):X}h=A[0];var B=-1,d=c[0];A:for(;++B-1;)s!==A&&vc.call(s,l,1),vc.call(A,l,1);return A}function zn(A,e){for(var t=A?e.length:0,n=t-1;t--;){var i=e[t];if(t==n||i!==r){var r=i;Gr(i)?vc.call(A,i,1):gi(A,i)}}return A}function Zn(A,e){return A+Rc(Oc()*(e-A+1))}function Xn(A,e,t,n){for(var i=-1,r=jc(Lc((e-A)/(t||1)),0),o=ql(r);r--;)o[n?r:++i]=A,A+=t;return o}function qn(A,e){var t="";if(!A||e<1||e>vA)return t;do{e%2&&(t+=A),(e=Rc(e/2))&&(A+=A)}while(e);return t}function $n(A,e){return vu(jr(A,e,vl),A+"")}function Ai(A){return jt(za(A))}function ei(A,e){var t=za(A);return Wr(t,qt(e,0,t.length))}function ti(A,e,t,n){if(!Aa(A))return A;e=Ci(e,A);for(var i=-1,r=e.length,o=r-1,s=A;null!=s&&++ii?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var r=ql(i);++n>>1,o=A[r];null!==o&&!ga(o)&&(t?o<=e:o=q){var u=e?null:Eu(A);if(u)return J(u);a=!1,i=F,c=new Qt}else c=e?[]:l;A:for(;++n=n?A:ii(A,e,t)}function Ii(A,e){if(e)return A.slice();var t=A.length,n=Ic?Ic(t):new A.constructor(t);return A.copy(n),n}function mi(A){var e=new A.constructor(A.byteLength);return new wc(e).set(new wc(A)),e}function Mi(A,e){var t=e?mi(A.buffer):A.buffer;return new A.constructor(t,A.byteOffset,A.byteLength)}function bi(A){var e=new A.constructor(A.source,Re.exec(A));return e.lastIndex=A.lastIndex,e}function vi(A){return su?nc(su.call(A)):{}}function yi(A,e){var t=e?mi(A.buffer):A.buffer;return new A.constructor(t,A.byteOffset,A.length)}function Di(A,e){if(A!==e){var t=A!==X,n=null===A,i=A===A,r=ga(A),o=e!==X,s=null===e,a=e===e,l=ga(e);if(!s&&!l&&!r&&A>e||r&&o&&a&&!s&&!l||n&&o&&a||!t&&a||!i)return 1;if(!n&&!r&&!l&&A=s)return a;return a*("desc"==t[n]?-1:1)}}return A.index-e.index}function Fi(A,e,t,n){for(var i=-1,r=A.length,o=t.length,s=-1,a=e.length,l=jc(r-o,0),c=ql(a+l),u=!n;++s1?t[i-1]:X,o=i>2?t[2]:X;for(r=A.length>3&&"function"==typeof r?(i--,r):X,o&&Fr(t[0],t[1],o)&&(r=i<3?X:r,i=1),e=nc(e);++n-1?i[r?e[o]:o]:X}}function Vi(A){return ur(function(e){var t=e.length,n=t,i=z.prototype.thru;for(A&&e.reverse();n--;){var r=e[n];if("function"!=typeof r)throw new oc(AA);if(i&&!o&&"wrapper"==Br(r))var o=new z([],!0)}for(n=o?n:t;++n1&&E.reverse(),u&&as))return!1;var l=r.get(A),c=r.get(e);if(l&&c)return l==e&&c==A;var u=-1,h=!0,B=t&aA?new Qt:X;for(r.set(A,e),r.set(e,A);++u1?"& ":"")+e[n],e=e.join(t>2?", ":" "),A.replace(Ge,"{\n/* [wrapped with "+e+"] */\n")}function Dr(A){return gg(A)||ug(A)||!!(yc&&A&&A[yc])}function Gr(A,e){var t=typeof A;return!!(e=null==e?vA:e)&&("number"==t||"symbol"!=t&&Ne.test(A))&&A>-1&&A%1==0&&A0){if(++e>=wA)return arguments[0]}else e=0;return A.apply(X,arguments)}}function Wr(A,e){var t=-1,n=A.length,i=n-1;for(e=e===X?n:e;++t=this.__values__.length;return{done:A,value:A?X:this.__values__[this.__index__++]}}function qo(){return this}function $o(A){for(var e,t=this;t instanceof K;){var n=Xr(t);n.__index__=0,n.__values__=X,e?i.__wrapped__=n:e=n;var i=n;t=t.__wrapped__}return i.__wrapped__=A,e}function As(){var A=this.__wrapped__;if(A instanceof ke){var e=A;return this.__actions__.length&&(e=new ke(this)),e=e.reverse(),e.__actions__.push({func:Ko,args:[Mo],thisArg:X}),new z(e,this.__chain__)}return this.thru(Mo)}function es(){return di(this.__wrapped__,this.__actions__)}function ts(A,e,t){var n=gg(A)?i:rn;return t&&Fr(A,e,t)&&(e=X),n(A,pr(e,3))}function ns(A,e){return(gg(A)?r:an)(A,pr(e,3))}function is(A,e){return ln(cs(A,e),1)}function rs(A,e){return ln(cs(A,e),bA)}function os(A,e,t){return t=t===X?1:Ea(t),ln(cs(A,e),t)}function ss(A,e){return(gg(A)?t:cu)(A,pr(e,3))}function as(A,e){return(gg(A)?n:uu)(A,pr(e,3))}function ls(A,e,t,n){A=Js(A)?A:za(A),t=t&&!n?Ea(t):0;var i=A.length;return t<0&&(t=jc(i+t,0)),ua(A)?t<=i&&A.indexOf(e,t)>-1:!!i&&Q(A,e,t)>-1}function cs(A,e){return(gg(A)?a:Sn)(A,pr(e,3))}function us(A,e,t,n){return null==A?[]:(gg(e)||(e=null==e?[]:[e]),t=n?X:t,gg(t)||(t=null==t?[]:[t]),Pn(A,e,t))}function gs(A,e,t){var n=gg(A)?c:m,i=arguments.length<3;return n(A,pr(e,4),t,i,cu)}function hs(A,e,t){var n=gg(A)?u:m,i=arguments.length<3;return n(A,pr(e,4),t,i,uu)}function Bs(A,e){return(gg(A)?r:an)(A,Ds(pr(e,3)))}function ds(A){return(gg(A)?jt:Ai)(A)}function ps(A,e,t){return e=(t?Fr(A,e,t):e===X)?1:Ea(e),(gg(A)?Jt:ei)(A,e)}function Qs(A){return(gg(A)?_t:ni)(A)}function Es(A){if(null==A)return 0;if(Js(A))return ua(A)?V(A):A.length;var e=Iu(A);return e==JA||e==KA?A.size:Rn(A).length}function fs(A,e,t){var n=gg(A)?g:ri;return t&&Fr(A,e,t)&&(e=X),n(A,pr(e,3))}function Cs(A,e){if("function"!=typeof e)throw new oc(AA);return A=Ea(A),function(){if(--A<1)return e.apply(this,arguments)}}function ws(A,e,t){return e=t?X:e,e=A&&null==e?A.length:e,ir(A,pA,X,X,X,X,e)}function Is(A,e){var t;if("function"!=typeof e)throw new oc(AA);return A=Ea(A),function(){return--A>0&&(t=e.apply(this,arguments)),A<=1&&(e=X),t}}function ms(A,e,t){e=t?X:e;var n=ir(A,gA,X,X,X,X,X,e);return n.placeholder=ms.placeholder,n}function Ms(A,e,t){e=t?X:e;var n=ir(A,hA,X,X,X,X,X,e);return n.placeholder=Ms.placeholder,n}function bs(A,e,t){function n(e){var t=g,n=h;return g=h=X,E=e,d=A.apply(n,t)}function i(A){return E=A,p=bu(s,e),f?n(A):d}function r(A){var t=A-Q,n=A-E,i=e-t;return C?Jc(i,B-n):i}function o(A){var t=A-Q,n=A-E;return Q===X||t>=e||t<0||C&&n>=B}function s(){var A=Ag();if(o(A))return a(A);p=bu(s,r(A))}function a(A){return p=X,w&&g?n(A):(g=h=X,d)}function l(){p!==X&&Qu(p),E=0,g=Q=h=p=X}function c(){return p===X?d:a(Ag())}function u(){var A=Ag(),t=o(A);if(g=arguments,h=this,Q=A,t){if(p===X)return i(Q);if(C)return Qu(p),p=bu(s,e),n(Q)}return p===X&&(p=bu(s,e)),d}var g,h,B,d,p,Q,E=0,f=!1,C=!1,w=!0;if("function"!=typeof A)throw new oc(AA);return e=Ca(e)||0,Aa(t)&&(f=!!t.leading,C="maxWait"in t,B=C?jc(Ca(t.maxWait)||0,e):B,w="trailing"in t?!!t.trailing:w),u.cancel=l,u.flush=c,u}function vs(A){return ir(A,EA)}function ys(A,e){if("function"!=typeof A||null!=e&&"function"!=typeof e)throw new oc(AA);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],r=t.cache;if(r.has(i))return r.get(i);var o=A.apply(this,n);return t.cache=r.set(i,o)||r,o};return t.cache=new(ys.Cache||rt),t}function Ds(A){if("function"!=typeof A)throw new oc(AA);return function(){var e=arguments;switch(e.length){case 0:return!A.call(this);case 1:return!A.call(this,e[0]);case 2:return!A.call(this,e[0],e[1]);case 3:return!A.call(this,e[0],e[1],e[2])}return!A.apply(this,e)}}function Gs(A){return Is(2,A)}function Fs(A,e){if("function"!=typeof A)throw new oc(AA);return e=e===X?e:Ea(e),$n(A,e)}function Ys(e,t){if("function"!=typeof e)throw new oc(AA);return t=null==t?0:jc(Ea(t),0),$n(function(n){var i=n[t],r=wi(n,0,t);return i&&l(r,i),A(e,this,r)})}function ks(A,e,t){var n=!0,i=!0;if("function"!=typeof A)throw new oc(AA);return Aa(t)&&(n="leading"in t?!!t.leading:n,i="trailing"in t?!!t.trailing:i),bs(A,e,{leading:n,maxWait:e,trailing:i})}function Hs(A){return ws(A,1)}function Ls(A,e){return og(fi(e),A)}function Rs(){if(!arguments.length)return[];var A=arguments[0];return gg(A)?A:[A]}function Us(A){return $t(A,oA)}function xs(A,e){return e="function"==typeof e?e:X,$t(A,oA,e)}function Ss(A){return $t(A,iA|oA)}function Ts(A,e){return e="function"==typeof e?e:X,$t(A,iA|oA,e)}function Ns(A,e){return null==e||en(A,e,Ua(e))}function js(A,e){return A===e||A!==A&&e!==e}function Js(A){return null!=A&&$s(A.length)&&!Xs(A)}function _s(A){return ea(A)&&Js(A)}function Ps(A){return!0===A||!1===A||ea(A)&&dn(A)==UA}function Os(A){return ea(A)&&1===A.nodeType&&!la(A)}function Vs(A){if(null==A)return!0;if(Js(A)&&(gg(A)||"string"==typeof A||"function"==typeof A.splice||Bg(A)||fg(A)||ug(A)))return!A.length;var e=Iu(A);if(e==JA||e==KA)return!A.size;if(Rr(A))return!Rn(A).length;for(var t in A)if(gc.call(A,t))return!1;return!0}function Ws(A,e){return vn(A,e)}function Ks(A,e,t){t="function"==typeof t?t:X;var n=t?t(A,e):X;return n===X?vn(A,e,X,t):!!n}function zs(A){if(!ea(A))return!1;var e=dn(A);return e==TA||e==SA||"string"==typeof A.message&&"string"==typeof A.name&&!la(A)}function Zs(A){return"number"==typeof A&&Sc(A)}function Xs(A){if(!Aa(A))return!1;var e=dn(A);return e==NA||e==jA||e==RA||e==VA}function qs(A){return"number"==typeof A&&A==Ea(A)}function $s(A){return"number"==typeof A&&A>-1&&A%1==0&&A<=vA}function Aa(A){var e=typeof A;return null!=A&&("object"==e||"function"==e)}function ea(A){return null!=A&&"object"==typeof A}function ta(A,e){return A===e||Gn(A,e,Er(e))}function na(A,e,t){return t="function"==typeof t?t:X,Gn(A,e,Er(e),t)}function ia(A){return aa(A)&&A!=+A}function ra(A){if(mu(A))throw new Ac($);return Fn(A)}function oa(A){return null===A}function sa(A){return null==A}function aa(A){return"number"==typeof A||ea(A)&&dn(A)==_A}function la(A){if(!ea(A)||dn(A)!=OA)return!1;var e=mc(A);if(null===e)return!0;var t=gc.call(e,"constructor")&&e.constructor;return"function"==typeof t&&t instanceof t&&uc.call(t)==pc}function ca(A){return qs(A)&&A>=-vA&&A<=vA}function ua(A){return"string"==typeof A||!gg(A)&&ea(A)&&dn(A)==zA}function ga(A){return"symbol"==typeof A||ea(A)&&dn(A)==ZA}function ha(A){return A===X}function Ba(A){return ea(A)&&Iu(A)==qA}function da(A){return ea(A)&&dn(A)==$A}function pa(A){if(!A)return[];if(Js(A))return ua(A)?W(A):ki(A);if(Dc&&A[Dc])return S(A[Dc]());var e=Iu(A);return(e==JA?T:e==KA?J:za)(A)}function Qa(A){if(!A)return 0===A?A:0;if((A=Ca(A))===bA||A===-bA){return(A<0?-1:1)*yA}return A===A?A:0}function Ea(A){var e=Qa(A),t=e%1;return e===e?t?e-t:e:0}function fa(A){return A?qt(Ea(A),0,GA):0}function Ca(A){if("number"==typeof A)return A;if(ga(A))return DA;if(Aa(A)){var e="function"==typeof A.valueOf?A.valueOf():A;A=Aa(e)?e+"":e}if("string"!=typeof A)return 0===A?A:+A;A=A.replace(ve,"");var t=xe.test(A);return t||Te.test(A)?wt(A.slice(2),t?2:8):Ue.test(A)?DA:+A}function wa(A){return Hi(A,xa(A))}function Ia(A){return A?qt(Ea(A),-vA,vA):0===A?A:0}function ma(A){return null==A?"":ci(A)}function Ma(A,e){var t=lu(A);return null==e?t:Kt(t,e)}function ba(A,e){return d(A,pr(e,3),cn)}function va(A,e){return d(A,pr(e,3),un)}function ya(A,e){return null==A?A:gu(A,pr(e,3),xa)}function Da(A,e){return null==A?A:hu(A,pr(e,3),xa)}function Ga(A,e){return A&&cn(A,pr(e,3))}function Fa(A,e){return A&&un(A,pr(e,3))}function Ya(A){return null==A?[]:gn(A,Ua(A))}function ka(A){return null==A?[]:gn(A,xa(A))}function Ha(A,e,t){var n=null==A?X:hn(A,e);return n===X?t:n}function La(A,e){return null!=A&&mr(A,e,Qn)}function Ra(A,e){return null!=A&&mr(A,e,En)}function Ua(A){return Js(A)?Ut(A):Rn(A)}function xa(A){return Js(A)?Ut(A,!0):Un(A)}function Sa(A,e){var t={};return e=pr(e,3),cn(A,function(A,n,i){Zt(t,e(A,n,i),A)}),t}function Ta(A,e){var t={};return e=pr(e,3),cn(A,function(A,n,i){Zt(t,n,e(A,n,i))}),t}function Na(A,e){return ja(A,Ds(pr(e)))}function ja(A,e){if(null==A)return{};var t=a(hr(A),function(A){return[A]});return e=pr(e),Vn(A,t,function(A,t){return e(A,t[0])})}function Ja(A,e,t){e=Ci(e,A);var n=-1,i=e.length;for(i||(i=1,A=X);++ne){var n=A;A=e,e=n}if(t||A%1||e%1){var i=Oc();return Jc(A+i*(e-A+Ct("1e-"+((i+"").length-1))),e)}return Zn(A,e)}function Al(A){return Og(ma(A).toLowerCase())}function el(A){return(A=ma(A))&&A.replace(je,xt).replace(st,"")}function tl(A,e,t){A=ma(A),e=ci(e);var n=A.length;t=t===X?n:qt(Ea(t),0,n);var i=t;return(t-=e.length)>=0&&A.slice(t,i)==e}function nl(A){return A=ma(A),A&&Qe.test(A)?A.replace(de,St):A}function il(A){return A=ma(A),A&&be.test(A)?A.replace(Me,"\\$&"):A}function rl(A,e,t){A=ma(A),e=Ea(e);var n=e?V(A):0;if(!e||n>=e)return A;var i=(e-n)/2;return Xi(Rc(i),t)+A+Xi(Lc(i),t)}function ol(A,e,t){A=ma(A),e=Ea(e);var n=e?V(A):0;return e&&n>>0)?(A=ma(A),A&&("string"==typeof e||null!=e&&!Qg(e))&&!(e=ci(e))&&U(A)?wi(W(A),0,t):A.split(e,t)):[]}function gl(A,e,t){return A=ma(A),t=null==t?0:qt(Ea(t),0,A.length),e=ci(e),A.slice(t,t+e.length)==e}function hl(A,e,t){var n=P.templateSettings;t&&Fr(A,e,t)&&(e=X),A=ma(A),e=Mg({},e,n,rr);var i,r,o=Mg({},e.imports,n.imports,rr),s=Ua(o),a=G(o,s),l=0,c=e.interpolate||Je,u="__p += '",g=ic((e.escape||Je).source+"|"+c.source+"|"+(c===Ce?Le:Je).source+"|"+(e.evaluate||Je).source+"|$","g"),h="//# sourceURL="+(gc.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ht+"]")+"\n";A.replace(g,function(e,t,n,o,s,a){return n||(n=o),u+=A.slice(l,a).replace(_e,L),t&&(i=!0,u+="' +\n__e("+t+") +\n'"),s&&(r=!0,u+="';\n"+s+";\n__p += '"),n&&(u+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=a+e.length,e}),u+="';\n";var B=gc.call(e,"variable")&&e.variable;B||(u="with (obj) {\n"+u+"\n}\n"),u=(r?u.replace(ue,""):u).replace(ge,"$1").replace(he,"$1;"),u="function("+(B||"obj")+") {\n"+(B?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(r?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var d=Vg(function(){return ec(s,h+"return "+u).apply(X,a)});if(d.source=u,zs(d))throw d;return d}function Bl(A){return ma(A).toLowerCase()}function dl(A){return ma(A).toUpperCase()}function pl(A,e,t){if((A=ma(A))&&(t||e===X))return A.replace(ve,"");if(!A||!(e=ci(e)))return A;var n=W(A),i=W(e);return wi(n,Y(n,i),k(n,i)+1).join("")}function Ql(A,e,t){if((A=ma(A))&&(t||e===X))return A.replace(De,"");if(!A||!(e=ci(e)))return A;var n=W(A);return wi(n,0,k(n,W(e))+1).join("")}function El(A,e,t){if((A=ma(A))&&(t||e===X))return A.replace(ye,"");if(!A||!(e=ci(e)))return A;var n=W(A);return wi(n,Y(n,W(e))).join("")}function fl(A,e){var t=fA,n=CA;if(Aa(e)){var i="separator"in e?e.separator:i;t="length"in e?Ea(e.length):t,n="omission"in e?ci(e.omission):n}A=ma(A);var r=A.length;if(U(A)){var o=W(A);r=o.length}if(t>=r)return A;var s=t-V(n);if(s<1)return n;var a=o?wi(o,0,s).join(""):A.slice(0,s);if(i===X)return a+n;if(o&&(s+=a.length-s),Qg(i)){if(A.slice(s).search(i)){var l,c=a;for(i.global||(i=ic(i.source,ma(Re.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var u=l.index;a=a.slice(0,u===X?s:u)}}else if(A.indexOf(ci(i),s)!=s){var g=a.lastIndexOf(i);g>-1&&(a=a.slice(0,g))}return a+n}function Cl(A){return A=ma(A),A&&pe.test(A)?A.replace(Be,Tt):A}function wl(A,e,t){return A=ma(A),e=t?X:e,e===X?x(A)?Z(A):B(A):A.match(e)||[]}function Il(e){var t=null==e?0:e.length,n=pr();return e=t?a(e,function(A){if("function"!=typeof A[1])throw new oc(AA);return[n(A[0]),A[1]]}):[],$n(function(n){for(var i=-1;++ivA)return[];var t=GA,n=Jc(A,GA);e=pr(e),A-=GA;for(var i=v(n,e);++t1?A[e-1]:X;return t="function"==typeof t?(A.pop(),t):X,_o(A,t)}),Ou=ur(function(A){var e=A.length,t=e?A[0]:0,n=this.__wrapped__,i=function(e){return Xt(e,A)};return!(e>1||this.__actions__.length)&&n instanceof ke&&Gr(t)?(n=n.slice(t,+t+(e?1:0)),n.__actions__.push({func:Ko,args:[i],thisArg:X}),new z(n,this.__chain__).thru(function(A){return e&&!A.length&&A.push(X),A})):this.thru(i)}),Vu=Ui(function(A,e,t){gc.call(A,t)?++A[t]:Zt(A,t,1)}),Wu=Oi(oo),Ku=Oi(so),zu=Ui(function(A,e,t){gc.call(A,t)?A[t].push(e):Zt(A,t,[e])}),Zu=$n(function(e,t,n){var i=-1,r="function"==typeof t,o=Js(e)?ql(e.length):[];return cu(e,function(e){o[++i]=r?A(t,e,n):In(e,t,n)}),o}),Xu=Ui(function(A,e,t){Zt(A,t,e)}),qu=Ui(function(A,e,t){ -A[t?0:1].push(e)},function(){return[[],[]]}),$u=$n(function(A,e){if(null==A)return[];var t=e.length;return t>1&&Fr(A,e[0],e[1])?e=[]:t>2&&Fr(e[0],e[1],e[2])&&(e=[e[0]]),Pn(A,ln(e,1),[])}),Ag=kc||function(){return Mt.Date.now()},eg=$n(function(A,e,t){var n=lA;if(t.length){var i=j(t,dr(eg));n|=BA}return ir(A,n,e,t,i)}),tg=$n(function(A,e,t){var n=lA|cA;if(t.length){var i=j(t,dr(tg));n|=BA}return ir(e,n,A,t,i)}),ng=$n(function(A,e){return tn(A,1,e)}),ig=$n(function(A,e,t){return tn(A,Ca(e)||0,t)});ys.Cache=rt;var rg=pu(function(e,t){t=1==t.length&&gg(t[0])?a(t[0],D(pr())):a(ln(t,1),D(pr()));var n=t.length;return $n(function(i){for(var r=-1,o=Jc(i.length,n);++r=e}),ug=mn(function(){return arguments}())?mn:function(A){return ea(A)&&gc.call(A,"callee")&&!bc.call(A,"callee")},gg=ql.isArray,hg=Ft?D(Ft):Mn,Bg=xc||xl,dg=Yt?D(Yt):bn,pg=kt?D(kt):Dn,Qg=Ht?D(Ht):Yn,Eg=Lt?D(Lt):kn,fg=Rt?D(Rt):Hn,Cg=Ar(xn),wg=Ar(function(A,e){return A<=e}),Ig=xi(function(A,e){if(Rr(e)||Js(e))return void Hi(e,Ua(e),A);for(var t in e)gc.call(e,t)&&Ot(A,t,e[t])}),mg=xi(function(A,e){Hi(e,xa(e),A)}),Mg=xi(function(A,e,t,n){Hi(e,xa(e),A,n)}),bg=xi(function(A,e,t,n){Hi(e,Ua(e),A,n)}),vg=ur(Xt),yg=$n(function(A,e){A=nc(A);var t=-1,n=e.length,i=n>2?e[2]:X;for(i&&Fr(e[0],e[1],i)&&(n=1);++t1),e}),Hi(A,hr(A),t),n&&(t=$t(t,iA|rA|oA,sr));for(var i=e.length;i--;)gi(t,e[i]);return t}),Rg=ur(function(A,e){return null==A?{}:On(A,e)}),Ug=nr(Ua),xg=nr(xa),Sg=Ji(function(A,e,t){return e=e.toLowerCase(),A+(t?Al(e):e)}),Tg=Ji(function(A,e,t){return A+(t?"-":"")+e.toLowerCase()}),Ng=Ji(function(A,e,t){return A+(t?" ":"")+e.toLowerCase()}),jg=ji("toLowerCase"),Jg=Ji(function(A,e,t){return A+(t?"_":"")+e.toLowerCase()}),_g=Ji(function(A,e,t){return A+(t?" ":"")+Og(e)}),Pg=Ji(function(A,e,t){return A+(t?" ":"")+e.toUpperCase()}),Og=ji("toUpperCase"),Vg=$n(function(e,t){try{return A(e,X,t)}catch(A){return zs(A)?A:new Ac(A)}}),Wg=ur(function(A,e){return t(e,function(e){e=Kr(e),Zt(A,e,eg(A[e],A))}),A}),Kg=Vi(),zg=Vi(!0),Zg=$n(function(A,e){return function(t){return In(t,A,e)}}),Xg=$n(function(A,e){return function(t){return In(A,t,e)}}),qg=Zi(a),$g=Zi(i),Ah=Zi(g),eh=$i(),th=$i(!0),nh=zi(function(A,e){return A+e},0),ih=tr("ceil"),rh=zi(function(A,e){return A/e},1),oh=tr("floor"),sh=zi(function(A,e){return A*e},1),ah=tr("round"),lh=zi(function(A,e){return A-e},0);return P.after=Cs,P.ary=ws,P.assign=Ig,P.assignIn=mg,P.assignInWith=Mg,P.assignWith=bg,P.at=vg,P.before=Is,P.bind=eg,P.bindAll=Wg,P.bindKey=tg,P.castArray=Rs,P.chain=Vo,P.chunk=qr,P.compact=$r,P.concat=Ao,P.cond=Il,P.conforms=ml,P.constant=Ml,P.countBy=Vu,P.create=Ma,P.curry=ms,P.curryRight=Ms,P.debounce=bs,P.defaults=yg,P.defaultsDeep=Dg,P.defer=ng,P.delay=ig,P.difference=Du,P.differenceBy=Gu,P.differenceWith=Fu,P.drop=eo,P.dropRight=to,P.dropRightWhile=no,P.dropWhile=io,P.fill=ro,P.filter=ns,P.flatMap=is,P.flatMapDeep=rs,P.flatMapDepth=os,P.flatten=ao,P.flattenDeep=lo,P.flattenDepth=co,P.flip=vs,P.flow=Kg,P.flowRight=zg,P.fromPairs=uo,P.functions=Ya,P.functionsIn=ka,P.groupBy=zu,P.initial=Bo,P.intersection=Yu,P.intersectionBy=ku,P.intersectionWith=Hu,P.invert=Gg,P.invertBy=Fg,P.invokeMap=Zu,P.iteratee=yl,P.keyBy=Xu,P.keys=Ua,P.keysIn=xa,P.map=cs,P.mapKeys=Sa,P.mapValues=Ta,P.matches=Dl,P.matchesProperty=Gl,P.memoize=ys,P.merge=kg,P.mergeWith=Hg,P.method=Zg,P.methodOf=Xg,P.mixin=Fl,P.negate=Ds,P.nthArg=Hl,P.omit=Lg,P.omitBy=Na,P.once=Gs,P.orderBy=us,P.over=qg,P.overArgs=rg,P.overEvery=$g,P.overSome=Ah,P.partial=og,P.partialRight=sg,P.partition=qu,P.pick=Rg,P.pickBy=ja,P.property=Ll,P.propertyOf=Rl,P.pull=Lu,P.pullAll=Co,P.pullAllBy=wo,P.pullAllWith=Io,P.pullAt=Ru,P.range=eh,P.rangeRight=th,P.rearg=ag,P.reject=Bs,P.remove=mo,P.rest=Fs,P.reverse=Mo,P.sampleSize=ps,P.set=_a,P.setWith=Pa,P.shuffle=Qs,P.slice=bo,P.sortBy=$u,P.sortedUniq=ko,P.sortedUniqBy=Ho,P.split=ul,P.spread=Ys,P.tail=Lo,P.take=Ro,P.takeRight=Uo,P.takeRightWhile=xo,P.takeWhile=So,P.tap=Wo,P.throttle=ks,P.thru=Ko,P.toArray=pa,P.toPairs=Ug,P.toPairsIn=xg,P.toPath=Jl,P.toPlainObject=wa,P.transform=Oa,P.unary=Hs,P.union=Uu,P.unionBy=xu,P.unionWith=Su,P.uniq=To,P.uniqBy=No,P.uniqWith=jo,P.unset=Va,P.unzip=Jo,P.unzipWith=_o,P.update=Wa,P.updateWith=Ka,P.values=za,P.valuesIn=Za,P.without=Tu,P.words=wl,P.wrap=Ls,P.xor=Nu,P.xorBy=ju,P.xorWith=Ju,P.zip=_u,P.zipObject=Po,P.zipObjectDeep=Oo,P.zipWith=Pu,P.entries=Ug,P.entriesIn=xg,P.extend=mg,P.extendWith=Mg,Fl(P,P),P.add=nh,P.attempt=Vg,P.camelCase=Sg,P.capitalize=Al,P.ceil=ih,P.clamp=Xa,P.clone=Us,P.cloneDeep=Ss,P.cloneDeepWith=Ts,P.cloneWith=xs,P.conformsTo=Ns,P.deburr=el,P.defaultTo=bl,P.divide=rh,P.endsWith=tl,P.eq=js,P.escape=nl,P.escapeRegExp=il,P.every=ts,P.find=Wu,P.findIndex=oo,P.findKey=ba,P.findLast=Ku,P.findLastIndex=so,P.findLastKey=va,P.floor=oh,P.forEach=ss,P.forEachRight=as,P.forIn=ya,P.forInRight=Da,P.forOwn=Ga,P.forOwnRight=Fa,P.get=Ha,P.gt=lg,P.gte=cg,P.has=La,P.hasIn=Ra,P.head=go,P.identity=vl,P.includes=ls,P.indexOf=ho,P.inRange=qa,P.invoke=Yg,P.isArguments=ug,P.isArray=gg,P.isArrayBuffer=hg,P.isArrayLike=Js,P.isArrayLikeObject=_s,P.isBoolean=Ps,P.isBuffer=Bg,P.isDate=dg,P.isElement=Os,P.isEmpty=Vs,P.isEqual=Ws,P.isEqualWith=Ks,P.isError=zs,P.isFinite=Zs,P.isFunction=Xs,P.isInteger=qs,P.isLength=$s,P.isMap=pg,P.isMatch=ta,P.isMatchWith=na,P.isNaN=ia,P.isNative=ra,P.isNil=sa,P.isNull=oa,P.isNumber=aa,P.isObject=Aa,P.isObjectLike=ea,P.isPlainObject=la,P.isRegExp=Qg,P.isSafeInteger=ca,P.isSet=Eg,P.isString=ua,P.isSymbol=ga,P.isTypedArray=fg,P.isUndefined=ha,P.isWeakMap=Ba,P.isWeakSet=da,P.join=po,P.kebabCase=Tg,P.last=Qo,P.lastIndexOf=Eo,P.lowerCase=Ng,P.lowerFirst=jg,P.lt=Cg,P.lte=wg,P.max=Pl,P.maxBy=Ol,P.mean=Vl,P.meanBy=Wl,P.min=Kl,P.minBy=zl,P.stubArray=Ul,P.stubFalse=xl,P.stubObject=Sl,P.stubString=Tl,P.stubTrue=Nl,P.multiply=sh,P.nth=fo,P.noConflict=Yl,P.noop=kl,P.now=Ag,P.pad=rl,P.padEnd=ol,P.padStart=sl,P.parseInt=al,P.random=$a,P.reduce=gs,P.reduceRight=hs,P.repeat=ll,P.replace=cl,P.result=Ja,P.round=ah,P.runInContext=h,P.sample=ds,P.size=Es,P.snakeCase=Jg,P.some=fs,P.sortedIndex=vo,P.sortedIndexBy=yo,P.sortedIndexOf=Do,P.sortedLastIndex=Go,P.sortedLastIndexBy=Fo,P.sortedLastIndexOf=Yo,P.startCase=_g,P.startsWith=gl,P.subtract=lh,P.sum=Zl,P.sumBy=Xl,P.template=hl,P.times=jl,P.toFinite=Qa,P.toInteger=Ea,P.toLength=fa,P.toLower=Bl,P.toNumber=Ca,P.toSafeInteger=Ia,P.toString=ma,P.toUpper=dl,P.trim=pl,P.trimEnd=Ql,P.trimStart=El,P.truncate=fl,P.unescape=Cl,P.uniqueId=_l,P.upperCase=Pg,P.upperFirst=Og,P.each=ss,P.eachRight=as,P.first=go,Fl(P,function(){var A={};return cn(P,function(e,t){gc.call(P.prototype,t)||(A[t]=e)}),A}(),{chain:!1}),P.VERSION="4.17.20",t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(A){P[A].placeholder=P}),t(["drop","take"],function(A,e){ke.prototype[A]=function(t){t=t===X?1:jc(Ea(t),0);var n=this.__filtered__&&!e?new ke(this):this.clone();return n.__filtered__?n.__takeCount__=Jc(t,n.__takeCount__):n.__views__.push({size:Jc(t,GA),type:A+(n.__dir__<0?"Right":"")}),n},ke.prototype[A+"Right"]=function(e){return this.reverse()[A](e).reverse()}}),t(["filter","map","takeWhile"],function(A,e){var t=e+1,n=t==mA||3==t;ke.prototype[A]=function(A){var e=this.clone();return e.__iteratees__.push({iteratee:pr(A,3),type:t}),e.__filtered__=e.__filtered__||n,e}}),t(["head","last"],function(A,e){var t="take"+(e?"Right":"");ke.prototype[A]=function(){return this[t](1).value()[0]}}),t(["initial","tail"],function(A,e){var t="drop"+(e?"":"Right");ke.prototype[A]=function(){return this.__filtered__?new ke(this):this[t](1)}}),ke.prototype.compact=function(){return this.filter(vl)},ke.prototype.find=function(A){return this.filter(A).head()},ke.prototype.findLast=function(A){return this.reverse().find(A)},ke.prototype.invokeMap=$n(function(A,e){return"function"==typeof A?new ke(this):this.map(function(t){return In(t,A,e)})}),ke.prototype.reject=function(A){return this.filter(Ds(pr(A)))},ke.prototype.slice=function(A,e){A=Ea(A);var t=this;return t.__filtered__&&(A>0||e<0)?new ke(t):(A<0?t=t.takeRight(-A):A&&(t=t.drop(A)),e!==X&&(e=Ea(e),t=e<0?t.dropRight(-e):t.take(e-A)),t)},ke.prototype.takeRightWhile=function(A){return this.reverse().takeWhile(A).reverse()},ke.prototype.toArray=function(){return this.take(GA)},cn(ke.prototype,function(A,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),n=/^(?:head|last)$/.test(e),i=P[n?"take"+("last"==e?"Right":""):e],r=n||/^find/.test(e);i&&(P.prototype[e]=function(){var e=this.__wrapped__,o=n?[1]:arguments,s=e instanceof ke,a=o[0],c=s||gg(e),u=function(A){var e=i.apply(P,l([A],o));return n&&g?e[0]:e};c&&t&&"function"==typeof a&&1!=a.length&&(s=c=!1);var g=this.__chain__,h=!!this.__actions__.length,B=r&&!g,d=s&&!h;if(!r&&c){e=d?e:new ke(this);var p=A.apply(e,o);return p.__actions__.push({func:Ko,args:[u],thisArg:X}),new z(p,g)}return B&&d?A.apply(this,o):(p=this.thru(u),B?n?p.value()[0]:p.value():p)})}),t(["pop","push","shift","sort","splice","unshift"],function(A){var e=sc[A],t=/^(?:push|sort|unshift)$/.test(A)?"tap":"thru",n=/^(?:pop|shift)$/.test(A);P.prototype[A]=function(){var A=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(gg(i)?i:[],A)}return this[t](function(t){return e.apply(gg(t)?t:[],A)})}}),cn(ke.prototype,function(A,e){var t=P[e];if(t){var n=t.name+"";gc.call(Au,n)||(Au[n]=[]),Au[n].push({name:e,func:t})}}),Au[Wi(X,cA).name]=[{name:"wrapper",func:X}],ke.prototype.clone=Pe,ke.prototype.reverse=Oe,ke.prototype.value=Ve,P.prototype.at=Ou,P.prototype.chain=zo,P.prototype.commit=Zo,P.prototype.next=Xo,P.prototype.plant=$o,P.prototype.reverse=As,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=es,P.prototype.first=P.prototype.head,Dc&&(P.prototype[Dc]=qo),P}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Mt._=Nt,define("lodash",[],function(){return Nt})):vt?((vt.exports=Nt)._=Nt,bt._=Nt):Mt._=Nt}.call(this),define("utils/print-profile-util",["require","lodash","protoplast"],function(A){var e=A("lodash");return A("protoplast").extend({withNewFontSize:function(A,t){var n=e.cloneDeep(A),i=t/n.font_size,r=n.font_size/t;return n.font_size=t,n.lines_per_page=Math.floor(n.lines_per_page*r),n.font_width=n.font_width*i,n.font_height=n.font_height*i,Object.keys(n).forEach(function(A){"object"==typeof n[A]&&(n[A].max=Math.floor(n[A].max*r))}),n}})}),define("utils/print-profiles",["require","utils/browser","utils/print-profile-util"],function(A){var e=A("utils/browser"),t=A("utils/print-profile-util"),n={a4:{paper_size:"a4",font_size:12,lines_per_page:57,top_margin:1,page_width:8.27,page_height:11.7,left_margin:1.5,right_margin:1,font_width:.1,font_height:.1667,line_spacing:1,page_number_top_margin:.5,dual_max_factor:.75,title_page:{top_start:3.5,left_side:["notes","copyright"],right_side:["draft date","date","contact"]},scene_heading:{feed:1.5,max:58},action:{feed:1.5,max:58},shot:{feed:1.5,max:58},character:{feed:3.5,max:33},parenthetical:{feed:3,max:26},dialogue:{feed:2.5,max:36},transition:{feed:0,max:58},centered:{feed:1.5,style:"center",max:58},synopsis:{feed:.5,max:58,italic:!0,color:"#888888",padding:0,feed_with_last_section:!0},section:{feed:.5,max:58,color:"#555555",level_indent:.2},note:{color:"#888888",italic:!0}}};n.usletter=JSON.parse(JSON.stringify(n.a4));var i=n.usletter;i.paper_size="letter",i.lines_per_page=55,i.page_width=8.5,i.page_height=11,i.scene_heading.max=61,i.action.max=61,i.shot.max=61,i.transition.max=61,i.section.max=61,i.synopsis.max=61;var r=e.url_params();if(r.fontSize){var o=parseInt(r.fontSize,10);n.usletter=t.withNewFontSize(n.usletter,o),n.a4=t.withNewFontSize(n.a4,o)}return n}),define("core/model/settings",["require","protoplast","utils/print-profiles"],function(A){var e=A("protoplast"),t=A("utils/print-profiles");return e.Model.extend({snippets:{name:"snippets",value:{}},double_space_between_scenes:{name:"double_space_between_scenes",value:!1},use_dual_dialogue:{name:"use_dual_dialogue",value:!0},each_scene_on_new_page:{name:"each_scene_on_new_page",value:!1},print_sections:{name:"print_sections",value:!1},print_synopsis:{name:"print_synopsis",value:!1},print_actions:{name:"print_actions",value:!0},print_headers:{name:"print_headers",value:!0},print_dialogues:{name:"print_dialogues",value:!0},print_notes:{name:"print_notes",value:!1},text_more:{name:"text_more",value:"(MORE)"},text_contd:{name:"text_contd",value:"(CONT'D)"},split_dialogue:{name:"split_dialogue",value:!0},font_family:{name:"font_family",value:"CourierPrime"},print_profile:{name:"print_profile",value:"a4"},embolden_scene_headers:{name:"embolden_scene_headers",value:!1},underline_scene_headers:{name:"underline_scene_headers",value:!1},show_page_numbers:{name:"show_page_numbers",value:!0},print_title_page:{name:"print_title_page",value:!0},text_scene_continued:{name:"text_scene_continued",value:"CONTINUED"},number_sections:{name:"number_sections",value:!1},print_header:{name:"print_header",value:""},print_footer:{name:"print_footer",value:""},print_watermark:{name:"print_watermark",value:""},scenes_numbers:{name:"scenes_numbers",value:"none"},scene_continuation_bottom:{name:"scene_continuation_bottom",value:!1},scene_continuation_top:{name:"scene_continuation_top",value:!1},show_background_image:{name:"show_background_image",value:!0},load_last_opened:{name:"load_last_opened",value:!1},night_mode:{name:"night_mode",value:!1},use_print_settings_for_stats:{name:"use_print_settings_for_stats",value:!0},cloud_lazy_loading:{name:"cloud_lazy_loading",value:!1},pdfjs_viewer:{name:"pdfjs_viewer",value:!1},stats_keep_last_scene_time:{name:"stats_keep_last_scene_time",value:!0},stats_who_with_who_max:{name:"stats_who_with_who_max",value:10},merge_empty_lines:{name:"merge_empty_lines",value:!0},$create:function(){var A=this.$meta.properties.name;for(var e in A)A.hasOwnProperty(e)&&this.on(e+"_changed",this._triggerChanged.bind(this,e,A[e]))},toJSON:function(){var A={},e=this.$meta.properties.name;for(var t in e)e.hasOwnProperty(t)&&(A[e[t]]=this[t]);return A},fromJSON:function(A){var e,t=this.$meta.properties.name;for(var n in t)t.hasOwnProperty(n)&&(e=t[n],A.hasOwnProperty(e)&&(this[n]=A[e]))},print:{get:function(){return t[this.print_profile]}},_triggerChanged:function(A,e){this.dispatch("changed",{key:e,value:this[A]})}})}),define("utils/fountain/query",[],function(){return function(A,e,t){var n={flat:!A,key_name:A||"___",base:e,processors:[],result:[],config:t||{},lock:!1};return n.not=function(A){return function(e){return!A(e)}},n.prepare=function(A){return n.prepare_handler=A,n},n.enter=function(A,e){var t={condition:A,action:e};return n.processors.push(t),n},n.exit=function(A){return n.exit_handler=A,n},n.end=function(A){return n.end_handler=A,n},n.select=function(A){for(var t,i=0;i *)(.+)/,dialogue:/^([A-Z*_]+[0-9A-Z (._\-')]*)(\^?)?(?:\n(?!\n+))([\s\S]+)/,character:/^([A-Z*_]+[0-9A-Z (._\-')]*)\^?$|^@.*$/,parenthetical:/^(\(.+\))$/,action:/^(.+)/g,centered:/^(?:> *)(.+)(?: *<)(\n.+)*/g,page_break:/^\={3,}$/,line_break:/^ {2}$/};i.parse=function(A,e){var t=A,i={title_page:[],tokens:[]};if(!t)return i;var o=t.match(/\r\n/)?2:1;e.print_notes||(t=t.replace(/ {0,1}\[\[/g," /*").replace(/\]\] {0,1}/g,"*/"));for(var s,a,l,c,u,g,h,B=t.split(/\r\n|\r|\n/),d=B.length,p=0,Q=1,E=!1,f=!1,C="none",w="normal",I=0,m=!1,M=function(A,e){return"/*"===e?I++:"*/"===e?I--:I||(A+=e),A},b=function(A){return A},v=0;v| ?/,""),c.type="transition";else if(s=c.text.match(r.synopsis))c.text=s[1],c.type=c.text?"synopsis":"separator";else if(s=c.text.match(r.section))c.level=s[1].length,c.text=s[2],c.type="section";else if(c.text.match(r.page_break))c.text="",c.type="page_break";else if(c.text.length&&"!"===c.text[0])c.type="action",c.text=c.text.substr(1);else if(c.text.length>0&&"@"===c.text[0]||c.text===c.text.toUpperCase()&&f)if(v===d||v===d-1||0===B[v+1].trim().length)c.type="shot";else{if(w="dialogue",c.type="character",c.text=c.text.replace(/^@/,""),"^"===c.text[c.text.length-1]){if(e.use_dual_dialogue){for(var G=["dialogue","character","parenthetical"];-1!==G.indexOf(i.tokens[u].type);)i.tokens[u].dual="left",u++;c.dual="right",g=!0}c.text=c.text.replace("^","")}u=i.tokens.length}else c.type="action";else c.text.match(r.parenthetical)?c.type="parenthetical":c.type="dialogue",g&&(c.dual="right");E=!1,"script"===C&&"ignore"!==w&&(c.is("scene_heading","transition")&&(c.text=c.text.toUpperCase(),m=!0),c.text&&"~"===c.text[0]&&(c.text="*"+c.text.substr(1)+"*"),c.text=c.is("action")?c.text:c.text.trim(),i.tokens.push(c))}else{if(w="normal",e.merge_multiple_empty_lines&&E||"title_page"===w)continue;g=!1,c.type="separator",E=!0,i.tokens.push(c)}for(var F=0,Y=null;F0&&"separator"===i.tokens[i.tokens.length-1].type;)i.tokens.pop();return i},A.exports=i}])}),function(A){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=A();else if("function"==typeof define&&define.amd)define("aw-liner",[],A);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.awLiner=A()}}(function(){return function A(e,t,n){function i(o,s){if(!t[o]){if(!e[o]){var a="function"==typeof require&&require;if(!s&&a)return a(o,!0);if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=t[o]={exports:{}};e[o][0].call(c.exports,function(A){var t=e[o][1][A];return i(t||A)},c,c.exports,A,e,t,n)}return t[o].exports}for(var r="function"==typeof require&&require,o=0;o=4&&(0===a.token.lines.indexOf(a)||a.token.lines.indexOf(a)===a.token.lines.length-2))return!1;if(n.split_dialogue&&a.is("dialogue")&&l&&l.is("dialogue")&&c.is("dialogue")&&!a.dual){for(var u,g=o;"character"!==t[g].type;g--);if(t.splice(e,0,A.create_line({type:"parenthetical",text:r,start:a.start,end:a.end,token:a.token}),u=A.create_line({type:"character",text:t[g].text.trim()+" "+(-1!==t[g].text.indexOf(i)?"":i),start:l.start,end:l.end,token:a.token})),t[g].right_column){var h=e-g,B=t[g].right_column.slice(0,h).concat([A.create_line({type:"parenthetical",text:r,start:a.start,end:a.end,token:a.token})]),d=[A.create_line({type:"character",text:B[0].text.trim()+" "+(-1!==B[0].text.indexOf(i)?"":i),start:l.start,end:l.end,token:a.token})].concat(t[g].right_column.slice(h));t[g].right_column=B,d.length>1&&(u.right_column=d)}return!0}return!(t[e].is_dialogue()&&t[s]&&t[s].is("dialogue","parenthetical"))},o=function(e,t,n,i){for(;e.length&&!e[0].text;)e.shift();for(var r,s=t,a=0,l=0;l Text").map(function(){return e(this).text()}).get().join(" "),s=e(A).find("ScriptNote Paragraph Text").map(function(){return"[["+e(this).text()+"]]"}).get();if(o=e("
          ").html(o).text(),o=o.replace(/’/g,"'").replace(/”/g,'"').replace(/“/g,'"').replace(/‘/g,"'"),"Yes"===r&&(o+="\n====\n"+o),"Character"!==n&&"Scene Heading"!==n&&"Transition"!==n||(o=o.toUpperCase()),s.length&&(o+="Scene Heading"===n?"\n\n"+s.join("\n\n"):" "+s.join(" ")),"Character"===n&&t&&(o+=" ^"),"Transition"===n&&(o="> "+o),"Center"===i&&(o="> "+o.split("\n").join(" ")+" <"),"Scene Heading"===n){/^((?:\*{0,3}_?)?(?:(?:int|ext|est|i\/e)[. ]).+)|^(?:\.(?!\.+))(.+)/i.test(o)||(o="."+o);var a=e(A).find("SceneProperties Paragraph Text");a.length&&(o+="\n\n"+a.map(function(){return"= "+e(this).text()}).get().join("\n\n"))}return"Parenthetical"!==n&&"Dialogue"!==n&&(o="\n"+o),"Center"!==n&&(o+="\n"),""===o.replace(/\n/g,"")?"":o};return t.to_fountain=function(A){var t="";try{var i=e.parseXML(A),r=e(i),o=["Title: ","Credit: ","Author: "],s=!1;r.find("FinalDraft TitlePage Content > Paragraph").each(function(){if(0!==o.length){var A=e(this).find("Text").text().trim();""===A?s=!1:(s||(t+=o.shift(),s=!0),t+=A+"\n")}}),r.find("FinalDraft > Content > Paragraph").each(function(){var A=e(this).find("DualDialogue");if(A.size()){var i=!1;A.find("Paragraph").each(function(){t+=n(this,i),i=!0})}else t+=n(this)})}catch(A){t="Sorry, I couldn't convert FinalDraft file :(\nerror: "+A.message}return t},t}),define("utils/converters/scriptconverter",["require","utils/converters/finaldraft"],function(A){function e(A){try{return"HTML"!==(A.ownerDocument||A).documentElement.nodeName}catch(A){return!1}}var t=A("utils/converters/finaldraft"),n={};return n.to_fountain=function(A){var n="fountain";return/<\?xml/.test(A)?(A=t.to_fountain(A),n="fdx"):e(A)&&(A=t.to_fountain((new XMLSerializer).serializeToString(A)),n="fdx"),{value:A,format:n}},n}),define("utils/fountain/preprocessor",["require"],function(A){var e={},t=function(A){return A.charAt(0).toLocaleUpperCase()+A.slice(1)},n=function(A,e){return A?A+"."+e:e},i=function(A,e,t){t=t||"",Object.keys(A).forEach(function(r){"string"==typeof A[r]?e[n(t,r)]=A[r]:i(A[r],e,n(t,r))})},r=function(A,e,t){return A.replace(new RegExp(e,"g"),t)};return e.process_snippets=function(A,e){var n,o={};return i(e||{},o),n=Object.keys(o),n.sort(function(A,e){return-1!==o[A].toLocaleUpperCase().indexOf(e.toLocaleUpperCase())?-1:1}),n.forEach(function(e){A=r(A,"\\$"+e,o[e]),A=r(A,"\\$"+e.toLocaleUpperCase(),o[e].toLocaleUpperCase()),A=r(A,"\\$"+t(e),t(o[e]))}),A},e}),define("core/model/script-model",["require","protoplast","utils/fountain/query","utils/fountain/helpers","aw-parser","aw-liner","utils/converters/scriptconverter","utils/fountain/preprocessor"],function(A){ -var e=A("protoplast"),t=A("utils/fountain/query"),n=A("utils/fountain/helpers"),i=A("aw-parser"),r=A("aw-liner"),o=A("utils/converters/scriptconverter"),s=A("utils/fountain/preprocessor"),a=n.fq;return e.Model.extend({settings:{inject:"settings"},_basicStats:null,format:null,liner:null,parser:null,$create:function(){this.parser=i.parser,this.liner=new r.Liner(i.helpers)},parsed:{computed:["script"],lazy:!0,value:function(){var A;return A=this.parser.parse(this.script,{print_headers:this.settings.print_headers,print_actions:this.settings.print_actions,print_dialogues:this.settings.print_dialogues,print_notes:this.settings.print_notes,print_sections:this.settings.print_sections,print_synopsis:this.settings.print_synopsis,each_scene_on_new_page:this.settings.each_scene_on_new_page,double_space_between_scenes:this.settings.double_space_between_scenes,use_dual_dialogue:this.settings.use_dual_dialogue,merge_multiple_empty_lines:this.settings.merge_empty_lines}),A.lines=this.liner.line(A.tokens,{print:this.settings.print,text_more:this.settings.text_more,text_contd:this.settings.text_contd,split_dialogue:this.settings.split_dialogue}),A}},parsed_stats:{computed:["parsed"],lazy:!0,value:function(){var A;if(this.settings.use_print_settings_for_stats)A=this.parsed;else{var e=Object.create(this.settings);e.print_actions=!0,e.print_headers=!0,e.print_dialogues=!0,e.print_sections=!1,e.print_notes=!1,e.print_synopsis=!1,A=this.parser.parse(this.script,e),A.lines=this.liner.line(A.tokens,e)}return A}},script:{set:function(A){var e=o.to_fountain(A);e.value=s.process_snippets(e.value,this.settings.snippets),this.format=this.format||e.format,this._script=e.value,this.dispatch("script_changed")},get:function(){return this._script}},getBasicStats:function(){return this._createStatsQuery(),this._basicStats.run(this.parsed_stats.lines)},_createStatsQuery:function(){var A=this.settings.print,e=t(null,{last_page_lines:0,scenes:0,pages:0,filled_pages:0,action_lines:0,dialogue_lines:0,action_scenes:0,dialogue_scenes:0});e.prepare(function(A){A.current_scene_heading_token=null,A.dialogue_in_the_scene=!1}),e.count("action_lines",a.is("action","scene_heading","shot")),e.count("dialogue_lines",a.is_dialogue()),e.count("pages",a.is("page_break")),e.enter(a.is_dialogue(),function(A,e){e.dialogue_in_the_scene=!0}),e.enter(a.is("scene_heading"),function(A,e){e.current_scene_heading_token!==A.token&&(e.select().scenes++,e.current_scene_heading_token=A.token,e.select().scenes>1&&(e.dialogue_in_the_scene?e.select().dialogue_scenes+=1:e.select().action_scenes+=1,e.dialogue_in_the_scene=!1))}),e.enter(!0,function(e,t){var n=t.select();e.is("page_break")?(n.filled_pages+=(n.last_page_lines+1)/A.lines_per_page,n.last_page_lines=0):n.last_page_lines++}),e.exit(function(e,t){t.dialogue_in_the_scene?t.select().dialogue_scenes++:t.select().action_scenes++;var n=e.action_lines+e.dialogue_lines;e.pages=e.pages+e.last_page_lines/A.lines_per_page,e.filled_pages+=e.last_page_lines/A.lines_per_page,e.action_time=e.action_lines/n*e.filled_pages,e.dialogue_time=e.dialogue_lines/n*e.filled_pages}),e.end(function(A){0===A.length&&A.push({pages:0,filled_pages:0,scenes:0,action_time:0,dialogue_time:0,dialogue_lines:0,characters:[],locations:[]})}),this._basicStats=e}})}),define("bootstrap/core-config",["require","protoplast","core/controller/pdf-controller","core/model/settings","core/model/script-model"],function(A){var e=A("protoplast"),t=A("core/controller/pdf-controller"),n=A("core/model/settings"),i=A("core/model/script-model");return e.extend({init:function(A){A.register("settings",n.create()),A.register("script",i.create()),A.register("pdf",t.create())}})}),define("theme/aw-bubble/model/tooltip",["require","protoplast"],function(A){return A("protoplast").Model.extend({text:null,x:0,y:0})}),define("theme/aw-bubble/model/theme-model",["require","protoplast","theme/aw-bubble/model/tooltip"],function(A){var e=A("protoplast"),t=A("theme/aw-bubble/model/tooltip");return e.Model.extend({sections:null,sectionsMenu:null,_allSections:null,sectionsMap:null,animationDelay:800,contentSlideAnimation:500,width:void 0,height:void 0,footer:"",expanded:!1,nightMode:!1,showBackgroundImage:!0,tooltip:null,mainInfoComponent:null,backgroundImageVisible:{computed:["showBackgroundImage","small"],value:function(){return this.showBackgroundImage&&!this.small}},small:{computed:["deviceWidth"],value:function(){return this.deviceWidth<800}},deviceWidth:{computed:["width"],value:function(){var A=window.orientation?window.screen.height:window.screen.width;return navigator.userAgent.indexOf("Android")>=0&&window.devicePixelRatio&&(A/=window.devicePixelRatio),A}},$create:function(){this._allSections=e.Collection.create(),this.sections=e.CollectionView.create(this._allSections),this.sectionsMenu=e.CollectionView.create(this._allSections),this.sectionsMenu.addFilter({properties:["isVisibleInMenu"],fn:function(A){return A.isVisibleInMenu}}),this.sectionsMap={},this.tooltip=t.create()},addSection:function(A,e){this.sectionsMap[A]=e,this._allSections.add(e)},getSection:function(A){return this.sectionsMap[A]}})}),define("theme/aw-bubble/controller/theme-controller",["require","protoplast","theme/aw-bubble/model/theme-model"],function(A){var e=A("protoplast"),t=A("theme/aw-bubble/model/theme-model");return e.Object.extend({themeModel:{inject:t},addSection:function(A){this.themeModel.addSection(A.name,A)},selectSection:function(A){this.themeModel.tooltip.text="",this.themeModel.sections.selected=A,this.themeModel.sections.forEach(function(e){e.isActive=e===A})},selectSectionByName:function(A){var e=this.themeModel.getSection(A);this.selectSection(e)},clearSelectedSection:function(){this.selectSection(null)},toggleExpanded:function(){this.themeModel.expanded=!this.themeModel.expanded},allSectionsHidden:function(){this.themeModel.sections.forEach(function(A){A.isFullyVisible=!1})},selectedSectionFullyVisible:function(){this.themeModel.sections.selected.isFullyVisible=!0},setMainInfoComponent:function(A){this.themeModel.mainInfoComponent=A},setFooter:function(A){this.themeModel.footer=A},showBackgroundImage:function(A){this.themeModel.showBackgroundImage=A},nightMode:function(A){this.themeModel.nightMode=A},showTooltip:function(A){this.themeModel.tooltip.text=A},hideTooltip:function(){this.themeModel.tooltip.text=""},moveTooltip:function(A,e){this.themeModel.tooltip.x=A,this.themeModel.tooltip.y=e}})}),define("utils/common",[],function(){return{data:{footer:"version: 1.15.1 (2020/09/18)"}}}),define("theme/aw-bubble/presenter/switcher-presenter",["require","protoplast","theme/aw-bubble/controller/theme-controller"],function(A){var e=A("protoplast"),t=A("theme/aw-bubble/controller/theme-controller");return e.Object.extend({pub:{inject:"pub"},themeController:{inject:t},init:function(){this.view.on("clicked",this._switchToSection)},_switchToSection:function(){this.themeController.selectSectionByName(this.view.sectionName),this.pub("aw-bubble/switcher/clicked",this.view.sectionName)}})}),define("theme/aw-bubble/view/switcher",["require","protoplast","theme/aw-bubble/presenter/switcher-presenter"],function(A){var e=A("protoplast"),t=A("theme/aw-bubble/presenter/switcher-presenter");return e.Component.extend({$meta:{presenter:t},sectionName:null,title:"",html:'',init:function(){this.root.onclick=this.dispatch.bind(this,"clicked")},updateTitle:{bindWith:"title",value:function(){this.root.innerHTML=this.title}},updateSectionName:{bindWith:"sectionName",value:function(){this.root.setAttribute("section",this.sectionName)}}})}),define("handlebars/utils",["exports"],function(A){"use strict";function e(A){return l[A]}function t(A){for(var e=1;e":">",'"':""","'":"'","`":"`","=":"="},c=/[&<>"'`=]/g,u=/[&<>"'`=]/,g=Object.prototype.toString;A.toString=g;var h=function(A){return"function"==typeof A};h(/x/)&&(A.isFunction=h=function(A){return"function"==typeof A&&"[object Function]"===g.call(A)}),A.isFunction=h;var B=Array.isArray||function(A){return!(!A||"object"!=typeof A)&&"[object Array]"===g.call(A)};A.isArray=B}),define("handlebars/exception",["exports","module"],function(A,e){"use strict";function t(A,e){var i=e&&e.loc,r=void 0,o=void 0,s=void 0,a=void 0;i&&(r=i.start.line,o=i.end.line,s=i.start.column,a=i.end.column,A+=" - "+r+":"+s);for(var l=Error.prototype.constructor.call(this,A),c=0;c0?(n.ids&&(n.ids=[n.name]),A.helpers.each(e,n)):i(this);if(n.data&&n.ids){var o=t.createFrame(n.data);o.contextPath=t.appendContextPath(n.data.contextPath,n.name),n={data:o}}return r(e,n)})}}),define("handlebars/helpers/each",["exports","module","../utils","../exception"],function(A,e,t,n){"use strict";var i=function(A){return A&&A.__esModule?A:{default:A}}(n);e.exports=function(A){A.registerHelper("each",function(A,e){function n(e,n,i){l&&(l.key=e,l.index=n,l.first=0===n,l.last=!!i,c&&(l.contextPath=c+e)),a+=r(A[e],{data:l,blockParams:t.blockParams([A[e],e],[c+e,null])})}if(!e)throw new i.default("Must pass iterator to #each");var r=e.fn,o=e.inverse,s=0,a="",l=void 0,c=void 0;if(e.data&&e.ids&&(c=t.appendContextPath(e.data.contextPath,e.ids[0])+"."),t.isFunction(A)&&(A=A.call(this)),e.data&&(l=t.createFrame(e.data)),A&&"object"==typeof A)if(t.isArray(A))for(var u=A.length;s=0?e:parseInt(A,10)}return A},log:function(A){if(A=n.lookupLevel(A),"undefined"!=typeof console&&n.lookupLevel(n.level)<=A){var e=n.methodMap[A];console[e]||(e="log");for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;r= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};A.REVISION_CHANGES=c;s.prototype={constructor:s,logger:l.default,log:l.default.log,registerHelper:function(A,t){if("[object Object]"===e.toString.call(A)){if(t)throw new a.default("Arg not supported with multiple helpers");e.extend(this.helpers,A)}else this.helpers[A]=t},unregisterHelper:function(A){delete this.helpers[A]},registerPartial:function(A,t){if("[object Object]"===e.toString.call(A))e.extend(this.partials,A);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+A+'" as undefined');this.partials[A]=t}},unregisterPartial:function(A){delete this.partials[A]},registerDecorator:function(A,t){if("[object Object]"===e.toString.call(A)){if(t)throw new a.default("Arg not supported with multiple decorators");e.extend(this.decorators,A)}else this.decorators[A]=t},unregisterDecorator:function(A){delete this.decorators[A]}};var u=l.default.log;A.log=u,A.createFrame=e.createFrame,A.logger=l.default}),define("handlebars/safe-string",["exports","module"],function(A,e){"use strict";function t(A){this.string=A}t.prototype.toString=t.prototype.toHTML=function(){return""+this.string},e.exports=t}),define("handlebars/internal/wrapHelper",["exports"],function(A){"use strict";function e(A,e){return function(){var t=arguments[arguments.length-1];return arguments[arguments.length-1]=e(t),A.apply(this,arguments)}}A.__esModule=!0,A.wrapHelper=e}),define("handlebars/internal/createNewLookupObject",["exports","../utils"],function(A,e){"use strict";function t(){for(var A=arguments.length,t=Array(A),n=0;n=n.LAST_COMPATIBLE_COMPILER_REVISION&&e<=n.COMPILER_REVISION)){if(e2&&C.push("'"+this.terminals_[Q]+"'");I=this.lexer.showPosition?"Parse error on line "+(s+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(s+1)+": Unexpected "+(1==g?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(I,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:c,expected:C})}}if(d[0]instanceof Array&&d.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+g);switch(d[0]){case 1:t.push(g),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),t.push(d[1]),g=null,h?(g=h,h=null):(a=this.lexer.yyleng,o=this.lexer.yytext,s=this.lexer.yylineno,c=this.lexer.yylloc,l>0&&l--);break;case 2:if(E=this.productions_[d[1]][1],w.$=n[n.length-E],w._$={first_line:i[i.length-(E||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(E||1)].first_column,last_column:i[i.length-1].last_column},u&&(w._$.range=[i[i.length-(E||1)].range[0],i[i.length-1].range[1]]),void 0!==(p=this.performAction.call(w,o,a,s,this.yy,d[1],n,i)))return p;E&&(t=t.slice(0,-1*E*2),n=n.slice(0,-1*E),i=i.slice(0,-1*E)),t.push(this.productions_[d[1]][0]),n.push(w.$),i.push(w._$),f=r[t[t.length-2]][t[t.length-1]],t.push(f);break;case 3:return!0}}return!0}},t=function(){var A={EOF:1,parseError:function(A,e){if(!this.yy.parser)throw new Error(A);this.yy.parser.parseError(A,e)},setInput:function(A){return this._input=A,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var A=this._input[0];return this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A,A.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),A},unput:function(A){var e=A.length,t=A.split(/(?:\r\n?|\n)/g);this._input=A+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===n.length?this.yylloc.first_column:0)+n[n.length-t.length].length-t[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(A){this.unput(this.match.slice(A))},pastInput:function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var A=this.pastInput(),e=new Array(A.length+1).join("-");return A+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,e,t,n,i;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;oe[0].length)||(e=t,n=o,this.options.flex));o++);return e?(i=e[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],A=this.performAction.call(this,this.yy,this,r[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var A=this.next();return void 0!==A?A:this.lex()},begin:function(A){this.conditionStack.push(A)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(A){this.begin(A)}};return A.options={},A.performAction=function(A,e,t,n){function i(A,t){return e.yytext=e.yytext.substring(A,e.yyleng-t+A)}switch(t){case 0:if("\\\\"===e.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},A.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],A.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},A}();return e.lexer=t,A.prototype=e,e.Parser=A,new A}();e.exports=t}),define("handlebars/compiler/visitor",["exports","module","../exception"],function(A,e,t){"use strict";function n(){this.parents=[]}function i(A){this.acceptRequired(A,"path"),this.acceptArray(A.params),this.acceptKey(A,"hash")}function r(A){i.call(this,A),this.acceptKey(A,"program"),this.acceptKey(A,"inverse")}function o(A){this.acceptRequired(A,"name"),this.acceptArray(A.params),this.acceptKey(A,"hash")}var s=function(A){return A&&A.__esModule?A:{default:A}}(t);n.prototype={constructor:n,mutating:!1,acceptKey:function(A,e){var t=this.accept(A[e]);if(this.mutating){if(t&&!n.prototype[t.type])throw new s.default('Unexpected node type "'+t.type+'" found when accepting '+e+" on "+A.type);A[e]=t}},acceptRequired:function(A,e){if(this.acceptKey(A,e),!A[e])throw new s.default(A.type+" requires "+e)},acceptArray:function(A){for(var e=0,t=A.length;e0)throw new h.default("Invalid path: "+n,{loc:t});".."===a&&r++}}return{type:"PathExpression",data:A,depth:r,parts:i,original:n,loc:t}}function a(A,e,t,n,i,r){var o=n.charAt(3)||n.charAt(2),s="{"!==o&&"&"!==o;return{type:/\*/.test(n)?"Decorator":"MustacheStatement",path:A,params:e,hash:t,escaped:s,strip:i,loc:this.locInfo(r)}}function l(A,e,n,i){t(A,n),i=this.locInfo(i);var r={type:"Program",body:e,strip:{},loc:i};return{type:"BlockStatement",path:A.path,params:A.params,hash:A.hash,program:r,openStrip:{},inverseStrip:{},closeStrip:{},loc:i}}function c(A,e,n,i,r,o){i&&i.path&&t(A,i);var s=/\*/.test(A.open);e.blockParams=A.blockParams;var a=void 0,l=void 0;if(n){if(s)throw new h.default("Unexpected inverse block on decorator",n);n.chain&&(n.program.body[0].closeStrip=i.strip),l=n.strip,a=n.program}return r&&(r=a,a=e,e=r),{type:s?"DecoratorBlock":"BlockStatement",path:A.path,params:A.params,hash:A.hash,program:e,inverse:a,openStrip:A.strip,inverseStrip:l,closeStrip:i&&i.strip,loc:this.locInfo(o)}}function u(A,e){if(!e&&A.length){var t=A[0].loc,n=A[A.length-1].loc;t&&n&&(e={source:t.source,start:{line:t.start.line,column:t.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:A,strip:{},loc:e}}function g(A,e,n,i){return t(A,n),{type:"PartialBlockStatement",name:A.path,params:A.params,hash:A.hash,program:e,openStrip:A.strip,closeStrip:n&&n.strip,loc:this.locInfo(i)}}A.__esModule=!0,A.SourceLocation=n,A.id=i,A.stripFlags=r,A.stripComment=o,A.preparePath=s,A.prepareMustache=a,A.prepareRawBlock=l,A.prepareBlock=c,A.prepareProgram=u,A.preparePartialBlock=g;var h=function(A){return A&&A.__esModule?A:{default:A}}(e)}),define("handlebars/compiler/base",["exports","./parser","./whitespace-control","./helpers","../utils"],function(A,e,t,n,i){"use strict";function r(A){return A&&A.__esModule?A:{default:A}}function o(A,e){return"Program"===A.type?A:(a.default.yy=c,c.locInfo=function(A){return new c.SourceLocation(e&&e.srcName,A)},a.default.parse(A))}function s(A,e){var t=o(A,e);return new l.default(e).accept(t)}A.__esModule=!0,A.parseWithoutProcessing=o,A.parse=s;var a=r(e),l=r(t);A.parser=a.default;var c={};i.extend(c,n)}),define("handlebars/compiler/compiler",["exports","../exception","../utils","./ast"],function(A,e,t,n){"use strict";function i(A){return A&&A.__esModule?A:{default:A}}function r(){}function o(A,e,t){if(null==A||"string"!=typeof A&&"Program"!==A.type)throw new c.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+A);e=e||{},"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var n=t.parse(A,e),i=(new t.Compiler).compile(n,e);return(new t.JavaScriptCompiler).compile(i,e)}function s(A,e,n){function i(){var t=n.parse(A,e),i=(new n.Compiler).compile(t,e),r=(new n.JavaScriptCompiler).compile(i,e,void 0,!0);return n.template(r)}function r(A,e){return o||(o=i()),o.call(this,A,e)}if(void 0===e&&(e={}),null==A||"string"!=typeof A&&"Program"!==A.type)throw new c.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+A);e=t.extend({},e),"data"in e||(e.data=!0),e.compat&&(e.useDepths=!0);var o=void 0;return r._setup=function(A){return o||(o=i()),o._setup(A)},r._child=function(A,e,t,n){return o||(o=i()),o._child(A,e,t,n)},r}function a(A,e){if(A===e)return!0;if(t.isArray(A)&&t.isArray(e)&&A.length===e.length){for(var n=0;n1)throw new c.default("Unsupported number of partial arguments: "+t.length,A);t.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):t.push({type:"PathExpression",parts:[],depth:0}));var n=A.name.original,i="SubExpression"===A.name.type;i&&this.accept(A.name),this.setupFullMustacheParams(A,e,void 0,!0);var r=A.indent||"";this.options.preventIndent&&r&&(this.opcode("appendContent",r),r=""),this.opcode("invokePartial",i,n,r),this.opcode("append")},PartialBlockStatement:function(A){this.PartialStatement(A)},MustacheStatement:function(A){this.SubExpression(A),A.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(A){this.DecoratorBlock(A)},ContentStatement:function(A){A.value&&this.opcode("appendContent",A.value)},CommentStatement:function(){},SubExpression:function(A){l(A);var e=this.classifySexpr(A);"simple"===e?this.simpleSexpr(A):"helper"===e?this.helperSexpr(A):this.ambiguousSexpr(A)},ambiguousSexpr:function(A,e,t){var n=A.path,i=n.parts[0],r=null!=e||null!=t;this.opcode("getContext",n.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",t),n.strict=!0,this.accept(n),this.opcode("invokeAmbiguous",i,r)},simpleSexpr:function(A){var e=A.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(A,e,t){var n=this.setupFullMustacheParams(A,e,t),i=A.path,r=i.parts[0];if(this.options.knownHelpers[r])this.opcode("invokeKnownHelper",n.length,r);else{if(this.options.knownHelpersOnly)throw new c.default("You specified knownHelpersOnly, but used the unknown helper "+r,A);i.strict=!0,i.falsy=!0,this.accept(i),this.opcode("invokeHelper",n.length,i.original,u.default.helpers.simpleId(i))}},PathExpression:function(A){this.addDepth(A.depth),this.opcode("getContext",A.depth);var e=A.parts[0],t=u.default.helpers.scopedId(A),n=!A.depth&&!t&&this.blockParamIndex(e);n?this.opcode("lookupBlockParam",n,A.parts):e?A.data?(this.options.data=!0,this.opcode("lookupData",A.depth,A.parts,A.strict)):this.opcode("lookupOnContext",A.parts,A.falsy,A.strict,t):this.opcode("pushContext")},StringLiteral:function(A){this.opcode("pushString",A.value)},NumberLiteral:function(A){this.opcode("pushLiteral",A.value)},BooleanLiteral:function(A){this.opcode("pushLiteral",A.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(A){var e=A.pairs,t=0,n=e.length;for(this.opcode("pushHash");t=0)return[e,r]}}}}),define("handlebars/compiler/code-gen",["exports","module","../utils"],function(A,e,t){"use strict";function n(A,e,n){if(t.isArray(A)){for(var i=[],r=0,o=A.length;r0&&(t+=", "+n.join(", "));var i=0;Object.keys(this.aliases).forEach(function(A){var n=e.aliases[A];n.children&&n.referenceCount>1&&(t+=", alias"+ ++i+"="+A,n.children[0]="alias"+i)}),this.lookupPropertyFunctionIsUsed&&(t+=", "+this.lookupPropertyFunctionVarDeclaration());var r=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&r.push("blockParams"),this.useDepths&&r.push("depths");var o=this.mergeSource(t);return A?(r.push(o),Function.apply(this,r)):this.source.wrap(["function(",r.join(","),") {\n ",o,"}"])},mergeSource:function(A){var e=this.environment.isSimple,t=!this.forceBuffer,n=void 0,i=void 0,r=void 0,o=void 0;return this.source.each(function(A){A.appendToBuffer?(r?A.prepend(" + "):r=A,o=A):(r&&(i?r.prepend("buffer += "):n=!0,o.add(";"),r=o=void 0),i=!0,e||(t=!1))}),t?r?(r.prepend("return "),o.add(";")):i||this.source.push('return "";'):(A+=", buffer = "+(n?"":this.initializeBuffer()),r?(r.prepend("return buffer + "),o.add(";")):this.source.push("return buffer;")),A&&this.source.prepend("var "+A.substring(2)+(n?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(A){var e=this.aliasable("container.hooks.blockHelperMissing"),t=[this.contextName(0)];this.setupHelperArgs(A,0,t);var n=this.popStack();t.splice(1,0,n),this.push(this.source.functionCall(e,"call",t))},ambiguousBlockValue:function(){var A=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var t=this.topStack();e.splice(1,0,t),this.pushSource(["if (!",this.lastHelper,") { ",t," = ",this.source.functionCall(A,"call",e),"}"])},appendContent:function(A){this.pendingContent?A=this.pendingContent+A:this.pendingLocation=this.source.currentLocation,this.pendingContent=A},append:function(){if(this.isInline())this.replaceStack(function(A){return[" != null ? ",A,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var A=this.popStack();this.pushSource(["if (",A," != null) { ",this.appendToBuffer(A,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(A){this.lastContext=A},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(A,e,t,n){var i=0;n||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(A[i++])),this.resolvePath("context",A,i,e,t)},lookupBlockParam:function(A,e){this.useBlockParams=!0,this.push(["blockParams[",A[0],"][",A[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(A,e,t){A?this.pushStackLiteral("container.data(data, "+A+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,t)},resolvePath:function(A,e,t,n,i){var r=this;if(this.options.strict||this.options.assumeObjects)return void this.push(l(this.options.strict&&i,this,e,A));for(var o=e.length;tthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var A=this.inlineStack;this.inlineStack=[];for(var e=0,t=A.length;e

          ’afterwriting turns .fountain screenplays into beautiful PDFs. Free, open-source, offline-first. No registration, no ads, no fuss.

          Start by using the menu above to or .

          Privacy Policy | Terms of Service | Source Code

          ',$meta:{presenter:n},switchToInfo:{component:e},switchToOpen:{component:e},addInteractions:function(){this.switchToOpen.sectionName="open",this.switchToOpen.title="open a new file",this.switchToInfo.sectionName="info",this.switchToInfo.title="get more details"},left:{set:function(A){this.$root.offset({left:A})},get:function(){return this.$root&&this.$root.offset().left}},outerWidth:{get:function(){return this.$root?this.$root.outerWidth():null}}})}),define("core/controller/app-controller",["require","utils/common","protoplast","core/view/main-info","theme/aw-bubble/model/theme-model","theme/aw-bubble/controller/theme-controller"],function(A){var e=A("utils/common"),t=A("protoplast"),n=A("core/view/main-info"),i=A("theme/aw-bubble/model/theme-model"),r=A("theme/aw-bubble/controller/theme-controller");return t.Object.extend({appModel:{inject:"appModel"},pdfController:{inject:"pdf"},themeModel:{inject:i},themeController:{inject:r},pub:{inject:"pub"},init:function(){this.appModel.urlParams=this._parseUrlParams()},initialiseApp:{sub:"app/init",value:function(){this.appModel.urlParams.fontFix&&(this.pdfController.fontFixEnabled=!0),this.themeController.setMainInfoComponent(n.create());var A=e.data.footer;this.themeController.setFooter(A),this.pub("bubble-theme/init")}},_parseUrlParams:function(){var A={};return window&&window.location&&window.location.search&&window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,t,n){A[t]=n}),A}})}),define("core/model/app-model",["require","protoplast"],function(A){return A("protoplast").extend({urlParams:null})}),window.Modernizr=function(A,e,t){function n(A){u.cssText=A}function i(A,e){return typeof A===e}var r,o,s={},a=e.documentElement,l="modernizr",c=e.createElement(l),u=c.style,g={},h=[],B=h.slice,d={}.hasOwnProperty;o=i(d,"undefined")||i(d.call,"undefined")?function(A,e){return e in A&&i(A.constructor.prototype[e],"undefined")}:function(A,e){return d.call(A,e)},Function.prototype.bind||(Function.prototype.bind=function(A){var e=this;if("function"!=typeof e)throw new TypeError;var t=B.call(arguments,1),n=function(){if(this instanceof n){var i=function(){};i.prototype=e.prototype;var r=new i,o=e.apply(r,t.concat(B.call(arguments)));return Object(o)===o?o:r}return e.apply(A,t.concat(B.call(arguments)))};return n}),g.localstorage=function(){try{return localStorage.setItem(l,l),localStorage.removeItem(l),!0}catch(A){return!1}};for(var p in g)o(g,p)&&(r=p.toLowerCase(),s[r]=g[p](),h.push((s[r]?"":"no-")+r));return s.addTest=function(A,e){if("object"==typeof A)for(var n in A)o(A,n)&&s.addTest(n,A[n]);else{if(A=A.toLowerCase(),s[A]!==t)return s;e="function"==typeof e?e():e,a.className+=" "+(e?"":"no-")+A,s[A]=e}return s},n(""),c=null,function(A,e){function t(A,e){var t=A.createElement("p"),n=A.getElementsByTagName("head")[0]||A.documentElement;return t.innerHTML="x",n.insertBefore(t.lastChild,n.firstChild)}function n(){var A=Q.elements;return"string"==typeof A?A.split(" "):A}function i(A){var e=p[A[B]];return e||(e={},d++,A[B]=d,p[d]=e),e}function r(A,t,n){if(t||(t=e),c)return t.createElement(A);n||(n=i(t));var r;return r=n.cache[A]?n.cache[A].cloneNode():h.test(A)?(n.cache[A]=n.createElem(A)).cloneNode():n.createElem(A),!r.canHaveChildren||g.test(A)||r.tagUrn?r:n.frag.appendChild(r)}function o(A,t){if(A||(A=e),c)return A.createDocumentFragment();t=t||i(A);for(var r=t.frag.cloneNode(),o=0,s=n(),a=s.length;o",l="hidden"in A,c=1==A.childNodes.length||function(){e.createElement("a");var A=e.createDocumentFragment();return void 0===A.cloneNode||void 0===A.createDocumentFragment||void 0===A.createElement}()}catch(A){l=!0,c=!0}}();var Q={elements:u.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:"3.7.0",shivCSS:!1!==u.shivCSS,supportsUnknownElements:c,shivMethods:!1!==u.shivMethods,type:"default",shivDocument:a,createElement:r,createDocumentFragment:o};A.html5=Q,a(e)}(this,e),s._version="2.8.3",a.className=a.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+" js "+h.join(" "),s}(0,this.document),function(A,e,t){function n(A){return"[object Function]"==p.call(A)}function i(A){return"string"==typeof A}function r(){}function o(A){return!A||"loaded"==A||"complete"==A||"uninitialized"==A}function s(){var A=Q.shift();E=1,A?A.t?B(function(){("c"==A.t?g.injectCss:g.injectJs)(A.s,0,A.a,A.x,A.e,1)},0):(A(),s()):E=0}function a(A,t,n,i,r,a,l){function c(e){if(!h&&o(u.readyState)&&(f.r=h=1,!E&&s(),u.onload=u.onreadystatechange=null,e)){"img"!=A&&B(function(){w.removeChild(u)},50);for(var n in v[t])v[t].hasOwnProperty(n)&&v[t][n].onload()}}var l=l||g.errorTimeout,u=e.createElement(A),h=0,p=0,f={t:n,s:t,e:r,a:a,x:l};1===v[t]&&(p=1,v[t]=[]),"object"==A?u.data=t:(u.src=t,u.type=A),u.width=u.height="0",u.onerror=u.onload=u.onreadystatechange=function(){c.call(this,p)},Q.splice(i,0,f),"img"!=A&&(p||2===v[t]?(w.insertBefore(u,C?null:d),B(c,l)):v[t].push(u))}function l(A,e,t,n,r){return E=0,e=e||"j",i(A)?a("c"==e?m:I,A,e,this.i++,t,n,r):(Q.splice(this.i++,0,A),1==Q.length&&s()),this}function c(){var A=g;return A.loader={load:l,i:0},A}var u,g,h=e.documentElement,B=A.setTimeout,d=e.getElementsByTagName("script")[0],p={}.toString,Q=[],E=0,f="MozAppearance"in h.style,C=f&&!!e.createRange().compareNode,w=C?h:d.parentNode,h=A.opera&&"[object Opera]"==p.call(A.opera),h=!!e.attachEvent&&!h,I=f?"object":h?"script":"img",m=h?"script":I,M=Array.isArray||function(A){return"[object Array]"==p.call(A)},b=[],v={},y={timeout:function(A,e){return e.length&&(A.timeout=e[0]),A}};g=function(A){function e(A){var e,t,n,A=A.split("!"),i=b.length,r=A.pop(),o=A.length,r={url:r,origUrl:r,prefixes:A};for(t=0;t/im,c=/]*>\s*([\s\S]+)\s*<\/body>/im,u="undefined"!=typeof location&&location.href,g=u&&location.protocol&&location.protocol.replace(/\:/,""),h=u&&location.hostname,B=u&&(location.port||void 0),d={},p=A.config&&A.config()||{};return n={version:"2.0.16",strip:function(A){if(A){A=A.replace(l,"");var e=A.match(c);e&&(A=e[1])}else A="";return A},jsEscape:function(A){return A.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var A,e,t;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(e=0;e<3;e+=1){t=a[e];try{A=new ActiveXObject(t)}catch(A){}if(A){a=[t];break}}return A},parseName:function(A){var e,t,n,i=!1,r=A.lastIndexOf("."),o=0===A.indexOf("./")||0===A.indexOf("../");return-1!==r&&(!o||r>1)?(e=A.substring(0,r),t=A.substring(r+1)):e=A,n=t||e,r=n.indexOf("!"),-1!==r&&(i="strip"===n.substring(r+1),n=n.substring(0,r),t?t=n:e=n),{moduleName:e,ext:t,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(A,e,i,r){var o,s,a,l=n.xdRegExp.exec(A);return!l||(o=l[2],s=l[3],s=s.split(":"),a=s[1],s=s[0],(!o||o===e)&&(!s||s.toLowerCase()===i.toLowerCase())&&(!a&&!s||t(o,a,e,r)))},finishLoad:function(A,e,t,i){t=e?n.strip(t):t,p.isBuild&&(d[A]=t),i(t)},load:function(A,e,t,i){if(i&&i.isBuild&&!i.inlineText)return void t();p.isBuild=i&&i.isBuild;var r=n.parseName(A),o=r.moduleName+(r.ext?"."+r.ext:""),s=e.toUrl(o),a=p.useXhr||n.useXhr;if(0===s.indexOf("empty:"))return void t();!u||a(s,g,h,B)?n.get(s,function(e){n.finishLoad(A,r.strip,e,t)},function(A){t.error&&t.error(A)}):e([o],function(A){n.finishLoad(r.moduleName+"."+r.ext,r.strip,A,t)},function(A){t.error&&t.error(A)})},write:function(A,e,t,i){if(d.hasOwnProperty(e)){var r=n.jsEscape(d[e]);t.asModule(A+"!"+e,"define(function () { return '"+r+"';});\n")}},writeFile:function(A,e,t,i,r){var o=n.parseName(e),s=o.ext?"."+o.ext:"",a=o.moduleName+s,l=t.toUrl(o.moduleName+s)+".js";n.load(a,t,function(e){var t=function(A){return i(l,A)};t.asModule=function(A,e){return i.asModule(A,l,e)},n.write(A,a,t,r)},r)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"]?(i=require.nodeRequire("fs"),n.get=function(A,e,t){try{var n=i.readFileSync(A,"utf8");"\ufeff"===n[0]&&(n=n.substring(1)),e(n)}catch(A){t&&t(A)}}):"xhr"===p.env||!p.env&&n.createXhr()?n.get=function(A,e,t,i){var r,o=n.createXhr();if(o.open("GET",A,!0),i)for(r in i)i.hasOwnProperty(r)&&o.setRequestHeader(r.toLowerCase(),i[r]);p.onXhr&&p.onXhr(o,A),o.onreadystatechange=function(n){var i,r;4===o.readyState&&(i=o.status||0,i>399&&i<600?(r=new Error(A+" HTTP status: "+i),r.xhr=o,t&&t(r)):e(o.responseText),p.onXhrComplete&&p.onXhrComplete(o,A))},o.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?n.get=function(A,e){var t,n,i=new java.io.File(A),r=java.lang.System.getProperty("line.separator"),o=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(i),"utf-8")),s="";try{for(t=new java.lang.StringBuffer,n=o.readLine(),n&&n.length()&&65279===n.charAt(0)&&(n=n.substring(1)),null!==n&&t.append(n);null!==(n=o.readLine());)t.append(r),t.append(n);s=String(t.toString())}finally{o.close()}e(s)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,o=Components.interfaces,Components.utils.import("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,n.get=function(A,e){var t,n,i,a={};s&&(A=A.replace(/\//g,"\\")),i=new FileUtils.File(A);try{t=r["@mozilla.org/network/file-input-stream;1"].createInstance(o.nsIFileInputStream),t.init(i,1,0,!1),n=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(o.nsIConverterInputStream),n.init(t,"utf-8",t.available(),o.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),n.readString(t.available(),a),n.close(),t.close(),e(a.value)}catch(A){throw new Error((i&&i.path||"")+": "+A)}}),n}),define("text!plugin/info/view/info.hbs",[],function(){return'

          \n\t\'Afterwriting is a place where you can play with some screenwriting tools. You can open screenplays written in Fountain format or Final Draft (it will be converted to fountain). You can also use one of the\n\t.

          \n

          Offline

          \n\n

          There\'s an offline version too! Just download\n\tfile, unzip and double click on afterwriting.html.

          \n

          \n\tIt\'s a client-side only app. That means your screenplay is never sent out of your PC.\n

          \n\n

          Command Line Interface

          \n\n

          \'Afterwriting is also available as Command Line Interface. More details on GitHub

          \n\n

          \n

          Contact

          \n

          @afterwriting

          \n

          blog.afterwriting.com

          \n

          contact@afterwriting.com

          \n

          about.me\n

          GitHub\n

          \n

          Thanks

          \n

          \n\t

          \n

          \n'}),define("plugin/info/view/info-view-presenter",["require","protoplast","theme/aw-bubble/controller/theme-controller"],function(A){var e=A("protoplast"),t=A("theme/aw-bubble/controller/theme-controller");return e.Object.extend({pub:{inject:"pub"},themeController:{inject:t},init:function(){this.view.on("download-clicked",this._downloadClicked,this)},_downloadClicked:function(){this.pub("info/download-link/clicked")}})}),define("theme/aw-bubble/view/section-view-mixin",["require","protoplast"],function(A){return A("protoplast").extend({section:null,active:!1,activate:function(){this.active=!0},deactivate:function(){this.active=!1},show:function(){},hide:function(){},updateSize:function(){}})}),define("plugin/info/view/info-view",["require","text!plugin/info/view/info.hbs","jquery","plugin/info/view/info-view-presenter","core/view/base-component","theme/aw-bubble/view/section-view-mixin","theme/aw-bubble/view/switcher"],function(A){var e=A("text!plugin/info/view/info.hbs"),t=(A("jquery"),A("plugin/info/view/info-view-presenter")),n=A("core/view/base-component"),i=A("theme/aw-bubble/view/section-view-mixin"),r=A("theme/aw-bubble/view/switcher");return n.extend([i],{$meta:{presenter:t},switchToOpen:{component:r},hbs:e,$downloadLink:null,addInteractions:function(){this.switchToOpen.sectionName="open",this.switchToOpen.title="samples",this.$downloadLink.click(this.dispatch.bind(this,"download-clicked"))}})}),define("plugin/info/model/info-section",["require","theme/aw-bubble/model/section","plugin/info/view/info-view"],function(A){var e=A("theme/aw-bubble/model/section"),t=A("plugin/info/view/info-view");return e.extend({title:"About",shortTitle:"info",smallIcon:"gfx/icons/info.svg",MainContent:{value:t}})}),define("plugin/info/controller/init-info-controller",["require","protoplast","plugin/info/model/info-section","theme/aw-bubble/controller/theme-controller"],function(A){var e=A("protoplast"),t=A("plugin/info/model/info-section"),n=A("theme/aw-bubble/controller/theme-controller");return e.Object.extend({themeController:{inject:n},init:function(){var A=t.create("info");this.themeController.addSection(A)}})}),define("plugin/info/info-plugin",["require","core/plugin","plugin/info/controller/init-info-controller"],function(A){var e=A("core/plugin"),t=A("plugin/info/controller/init-info-controller");return e.extend({$create:function(A){A.register(t.create())}})}),define("utils/fn",[],function(){var A={};return A.conflate=function(A,e,t){var n=[],i=function(){var r=Array.prototype.slice.call(arguments);n.push(r),e.apply(null,r)?A.apply(null,[i].concat(r)):t(n)};A(i,null)},A}),function(){var A,e,t,n,i,r,o,s,a,l,c,u={}.hasOwnProperty,g=[].indexOf||function(A){for(var e=0,t=this.length;t>e;e++)if(e in this&&this[e]===A)return e;return-1},h=function(A,e){function t(){this.constructor=A}for(var n in e)u.call(e,n)&&(A[n]=e[n]);return t.prototype=e.prototype,A.prototype=new t,A.__super__=e.prototype,A};if(c=function(){function A(){throw new Error("Not implemented. Did you mean to use Dropbox.Client?")}return A}(),c.Util=function(){function A(){}return A}(),c.Http=function(){function A(){}return A}(),c.File=function(){function A(){}return A}(),"undefined"!=typeof global&&"undefined"!=typeof module&&"exports"in module)e=global,t=module.require.bind(module),module.exports=c;else if("undefined"!=typeof window&&"undefined"!=typeof navigator)e=window,t=null,window.Dropbox&&function(){var A,e,t,n;t=window.Dropbox,n=[];for(A in t)u.call(t,A)&&(e=t[A],n.push(c[A]=e))}(),window.Dropbox=c;else{if("undefined"==typeof self||"undefined"==typeof navigator)throw new Error("dropbox.js loaded in an unsupported JavaScript environment.");e=self,t=self.importScripts.bind(self),self.Dropbox=c}if(c.Env=function(){function A(){}return A.global=e,A.require=t,A}(),c.Util.EventSource=function(){function A(A){this._cancelable=A&&A.cancelable,this._listeners=[]}return A.prototype.addListener=function(A){if("function"!=typeof A)throw new TypeError("Invalid listener type; expected function");return g.call(this._listeners,A)<0&&this._listeners.push(A),this},A.prototype.removeListener=function(A){var e,t,n,i,r;if(this._listeners.indexOf)-1!==(t=this._listeners.indexOf(A))&&this._listeners.splice(t,1);else for(r=this._listeners,e=n=0,i=r.length;i>n;e=++n)if(r[e]===A){this._listeners.splice(e,1);break}return this},A.prototype.dispatch=function(A){var e,t,n,i,r;for(r=this._listeners,n=0,i=r.length;i>n;n++)if(e=r[n],t=e(A),this._cancelable&&!1===t)return!1;return!0},A}(),c.AccountInfo=function(){function A(A){var e;this._json=A,this.name=A.display_name,this.email=A.email,this.countryCode=A.country||null,this.uid=A.uid.toString(),A.public_app_url?(this.publicAppUrl=A.public_app_url,(e=this.publicAppUrl.length-1)>=0&&"/"===this.publicAppUrl.substring(e)&&(this.publicAppUrl=this.publicAppUrl.substring(0,e))):this.publicAppUrl=null,this.referralUrl=A.referral_link,this.quota=A.quota_info.quota,this.privateBytes=A.quota_info.normal||0,this.sharedBytes=A.quota_info.shared||0,this.usedQuota=this.privateBytes+this.sharedBytes}return A.parse=function(A){return A&&"object"==typeof A?new c.AccountInfo(A):A},A.prototype.name=null,A.prototype.email=null,A.prototype.countryCode=null,A.prototype.uid=null,A.prototype.referralUrl=null,A.prototype.publicAppUrl=null,A.prototype.quota=null,A.prototype.usedQuota=null,A.prototype.privateBytes=null,A.prototype.sharedBytes=null,A.prototype.json=function(){return this._json},A}(),c.ApiError=function(){function A(A,e,t){var n;if(this.method=e,this.url=t,this.status=A.status,A.responseType)try{n=A.response||A.responseText}catch(e){e;try{n=A.responseText}catch(A){A,n=null}}else try{n=A.responseText}catch(A){A,n=null}if(n)try{this.responseText=n.toString(),this.response=JSON.parse(n)}catch(A){A,this.response=null}else this.responseText="(no response)",this.response=null}return A.prototype.status=null,A.prototype.method=null,A.prototype.url=null,A.prototype.responseText=null,A.prototype.response=null,A.NETWORK_ERROR=0,A.NO_CONTENT=304,A.INVALID_PARAM=400,A.INVALID_TOKEN=401,A.OAUTH_ERROR=403,A.NOT_FOUND=404,A.INVALID_METHOD=405,A.NOT_ACCEPTABLE=406,A.CONFLICT=409,A.RATE_LIMITED=429,A.SERVER_ERROR=503,A.OVER_QUOTA=507,A.prototype.toString=function(){return"Dropbox API error "+this.status+" from "+this.method+" "+this.url+" :: "+this.responseText},A.prototype.inspect=function(){return this.toString()},A}(),c.AuthDriver=function(){function A(){}return A.prototype.authType=function(){return"code"},A.prototype.url=function(){return"https://some.url"},A.prototype.doAuthorize=function(A,e,t,n){return n({code:"access-code"})},A.prototype.getStateParam=function(A,e){return e(c.Util.Oauth.randomAuthStateParam())},A.prototype.resumeAuthorize=function(A,e,t){return t({code:"access-code"})},A.prototype.onAuthStepChange=function(A,e){return e()},A.oauthQueryParams=["access_token","expires_in","scope","token_type","code","error","error_description","error_uri","mac_key","mac_algorithm"].sort(),A}(),c.AuthDriver.autoConfigure=function(A){if("undefined"!=typeof chrome&&chrome.runtime&&chrome.runtime.id)return void A.authDriver(chrome.tabs&&chrome.tabs.create?new c.AuthDriver.ChromeExtension:new c.AuthDriver.ChromeApp);if("undefined"!=typeof window){if(window.cordova)return void A.authDriver(new c.AuthDriver.Cordova);window&&window.navigator&&A.authDriver(new c.AuthDriver.Redirect)}},c.AuthDriver.BrowserBase=function(){function A(A){A?(this.rememberUser=!("rememberUser"in A)||A.rememberUser,this.scope=A.scope||"default"):(this.rememberUser=!0,this.scope="default"),this.storageKey=null,this.storage=c.AuthDriver.BrowserBase.localStorage(),this.stateRe=/^[^#]+\#(.*&)?state=([^&]+)(&|$)/}return A.prototype.authType=function(){return"token"},A.prototype.onAuthStepChange=function(A,e){switch(this.setStorageKey(A),A.authStep){case c.Client.RESET:return this.loadCredentials(function(t){return function(n){return n?(A.setCredentials(n),A.authStep!==c.Client.DONE?e():t.rememberUser?(A.setCredentials(n),e()):t.forgetCredentials(e)):e()}}(this));case c.Client.DONE:return this.rememberUser?this.storeCredentials(A.credentials(),e):this.forgetCredentials(e);case c.Client.SIGNED_OUT:case c.Client.ERROR:return this.forgetCredentials(e);default:return e(),this}},A.prototype.setStorageKey=function(A){return this.storageKey="dropbox-auth:"+this.scope+":"+A.appHash(),this},A.prototype.storeCredentials=function(A,e){var t,n,i;t=JSON.stringify(A);try{this.storage.setItem(this.storageKey,t)}catch(A){A,n=encodeURIComponent(this.storageKey),i=encodeURIComponent(t),document.cookie=n+"="+i+"; path=/"}return e(),this},A.prototype.loadCredentials=function(A){var e,t,n,i;try{t=this.storage.getItem(this.storageKey)}catch(A){A,t=null}if(null===t&&(i=encodeURIComponent(this.storageKey),i.replace(/[.*+()]/g,"\\$&"),e=new RegExp("(^|(;\\s*))"+i+"=([^;]*)(;|$)"),(n=e.exec(document.cookie))&&(t=decodeURIComponent(n[3]))),!t)return A(null),this;try{A(JSON.parse(t))}catch(e){e,A(null)}return this},A.prototype.forgetCredentials=function(A){var e,t;try{this.storage.removeItem(this.storageKey)}catch(A){A,t=encodeURIComponent(this.storageKey),e=new Date(0).toGMTString(),document.cookie=t+"={}; expires="+e+"; path=/"}return A(),this},A.prototype.locationStateParam=function(A){var e,t;return e=A||c.AuthDriver.BrowserBase.currentLocation(),t=this.stateRe.exec(e),t?decodeURIComponent(t[2]):null},A.prototype.replaceUrlBasename=function(A,e){var t,n,i;return n=A.indexOf("#"),-1!==n&&(A=A.substring(0,n)),i=A.indexOf("?"),-1!==i&&(A=A.substring(0,i)),t=A.split("/"),t[t.length-1]=e,t.join("/")},A.localStorage=function(){if("undefined"==typeof window)return null;try{return window.localStorage}catch(A){return A,null}},A.currentLocation=function(){return window.location.href},A.cleanupLocation=function(){var A,e;window.history&&window.history.replaceState?(e=this.currentLocation(),A=e.indexOf("#"),window.history.replaceState({},document.title,e.substring(0,A))):window.location.hash=""},A}(),c.AuthDriver.Redirect=function(A){function e(A){e.__super__.constructor.call(this,A),this.receiverUrl=this.baseUrl(A)}return h(e,A),e.prototype.baseUrl=function(A){var e,t;if(t=c.AuthDriver.BrowserBase.currentLocation(),A){if(A.redirectUrl)return A.redirectUrl;if(A.redirectFile)return this.replaceUrlBasename(t,A.redirectFile)}return e=t.indexOf("#"),-1!==e&&(t=t.substring(0,e)),t},e.prototype.url=function(){return this.receiverUrl},e.prototype.doAuthorize=function(A,e,t){return this.storeCredentials(t.credentials(),function(){return window.location.assign(A)})},e.prototype.resumeAuthorize=function(A,e,t){var n;return this.locationStateParam()===A?(n=c.AuthDriver.BrowserBase.currentLocation(),c.AuthDriver.BrowserBase.cleanupLocation(),t(c.Util.Oauth.queryParamsFromUrl(n))):this.forgetCredentials(function(){return t({error:"Authorization error"})})},e}(c.AuthDriver.BrowserBase),c.AuthDriver.Popup=function(A){function e(A){e.__super__.constructor.call(this,A),this.receiverUrl=this.baseUrl(A)}return h(e,A),e.prototype.url=function(){return this.receiverUrl},e.prototype.doAuthorize=function(A,e,t,n){return this.listenForMessage(e,n),this.openWindow(A)},e.prototype.baseUrl=function(A){var e;if(e=c.AuthDriver.BrowserBase.currentLocation(),A){if(A.receiverUrl)return A.receiverUrl;if(A.receiverFile)return this.replaceUrlBasename(e,A.receiverFile)}return e},e.prototype.openWindow=function(A){return window.open(A,"_dropboxOauthSigninWindow",this.popupWindowSpec(980,700))},e.prototype.popupWindowSpec=function(A,e){var t,n,i,r,o,s,a,l,c,u;return o=null!=(a=window.screenX)?a:window.screenLeft,s=null!=(l=window.screenY)?l:window.screenTop,r=null!=(c=window.outerWidth)?c:document.documentElement.clientWidth,t=null!=(u=window.outerHeight)?u:document.documentElement.clientHeight,n=Math.round(o+(r-A)/2),i=Math.round(s+(t-e)/2.5),o>n&&(n=o),s>i&&(i=s),"width="+A+",height="+e+",left="+n+",top="+i+"dialog=yes,dependent=yes,scrollbars=yes,location=yes"},e.prototype.listenForMessage=function(A,e){var t;return t=function(n){return function(i){var r,o;r=i.data?i.data:i;try{o=JSON.parse(r)._dropboxjs_oauth_info}catch(A){return void A}if(o)return n.locationStateParam(o)===A?(A=!1,window.removeEventListener("message",t),c.AuthDriver.Popup.onMessage.removeListener(t),e(c.Util.Oauth.queryParamsFromUrl(r))):void 0}}(this),window.addEventListener("message",t,!1),c.AuthDriver.Popup.onMessage.addListener(t)},e.locationOrigin=function(A){var e;return(e=/^(file:\/\/[^\?\#]*)(\?|\#|$)/.exec(A))?e[1]:(e=/^([^\:]+\:\/\/[^\/\?\#]*)(\/|\?|\#|$)/.exec(A),e?e[1]:A)},e.oauthReceiver=function(){window.addEventListener("load",function(){var A,e,t,n;if(n=window.location.href,A=JSON.stringify({_dropboxjs_oauth_info:n}),c.AuthDriver.BrowserBase.cleanupLocation(),e=window.opener,window.parent!==window.top&&(e||(e=window.parent)),e){try{t=window.location.origin||locationOrigin(n),e.postMessage(A,t),window.close()}catch(A){A}try{return e.Dropbox.AuthDriver.Popup.onMessage.dispatch(A),window.close()}catch(A){A}}})},e.onMessage=new c.Util.EventSource,e}(c.AuthDriver.BrowserBase),c.AuthDriver.ChromeBase=function(A){function e(A){e.__super__.constructor.call(this,A),this.storageKey="dropbox_js_"+this.scope+"_credentials"}return h(e,A),e.prototype.onAuthStepChange=function(A,e){switch(A.authStep){case c.Client.RESET:return this.loadCredentials(function(t){return t&&A.setCredentials(t),e()});case c.Client.DONE:return this.storeCredentials(A.credentials(),e);case c.Client.SIGNED_OUT:case c.Client.ERROR:return this.forgetCredentials(e);default:return e()}},e.prototype.url=function(){return this.receiverUrl},e.prototype.storeCredentials=function(A,e){var t;return t={},t[this.storageKey]=A,chrome.storage.local.set(t,e),this},e.prototype.loadCredentials=function(A){return chrome.storage.local.get(this.storageKey,function(e){return function(t){return A(t[e.storageKey]||null)}}(this)),this},e.prototype.forgetCredentials=function(A){return chrome.storage.local.remove(this.storageKey,A),this},e}(c.AuthDriver.BrowserBase),c.AuthDriver.ChromeApp=function(A){function e(A){e.__super__.constructor.call(this,A),this.receiverUrl="https://"+chrome.runtime.id+".chromiumapp.org/"}return h(e,A),e.prototype.doAuthorize=function(A,e,t,n){return chrome.identity.launchWebAuthFlow({url:A,interactive:!0},function(A){return function(t){return A.locationStateParam(t)===e?(e=!1,n(c.Util.Oauth.queryParamsFromUrl(t))):void 0}}(this))},e}(c.AuthDriver.ChromeBase),c.AuthDriver.ChromeExtension=function(A){function e(A){var t;e.__super__.constructor.call(this,A),t=A&&A.receiverPath||"chrome_oauth_receiver.html",this.receiverUrl=chrome.runtime.getURL(t)}return h(e,A),e.prototype.doAuthorize=function(A,e,t,n){var i,r;return r=null,i=function(A){return function(t,o){var s;if((!o||!o.tab||o.tab.url.substring(0,A.receiverUrl.length)===A.receiverUrl)&&t.dropbox_oauth_receiver_href)return s=t.dropbox_oauth_receiver_href,A.locationStateParam(s)===e?(e=!1,r&&chrome.tabs.remove(r.id),chrome.runtime.onMessage.removeListener(i),n(c.Util.Oauth.queryParamsFromUrl(s))):void 0}}(this),chrome.runtime.onMessage.addListener(i),chrome.tabs.create({url:A,active:!0,pinned:!1},function(A){return r=A})},e.oauthReceiver=function(){return window.addEventListener("load",function(){var A;return A=window.location.href,window.location.hash="",chrome.runtime.sendMessage({dropbox_oauth_receiver_href:A}),window.close?window.close():void 0})},e}(c.AuthDriver.ChromeBase),c.AuthDriver.Cordova=function(A){function e(A){e.__super__.constructor.call(this,A)}return h(e,A),e.prototype.url=function(){return"https://www.dropbox.com/1/oauth2/redirect_receiver"},e.prototype.doAuthorize=function(A,e,t,n){var i,r,o;return i=window.open(A,"_blank","location=yes,closebuttoncaption=Cancel"),!1,/^[^\/]*\/\/[^\/]*\//.exec(A)[0],o=!1,r=function(A){return function(t){if(t.url&&A.locationStateParam(t.url)===e){if(o)return;return i.removeEventListener("loadstart",r),i.removeEventListener("loaderror",r),i.removeEventListener("loadstop",r),i.removeEventListener("exit",r),o=!0,window.setTimeout(function(){return i.close()},10),void n(c.Util.Oauth.queryParamsFromUrl(t.url))}if("exit"===t.type){if(o)return;i.removeEventListener("loadstart",r),i.removeEventListener("loaderror",r),i.removeEventListener("loadstop",r),i.removeEventListener("exit",r),o=!0,n(new AuthError("error=access_denied&error_description=User+closed+browser+window"))}}}(this),i.addEventListener("loadstart",r),i.addEventListener("loaderror",r),i.addEventListener("loadstop",r),i.addEventListener("exit",r)},e}(c.AuthDriver.BrowserBase),c.AuthDriver.NodeServer=function(){function A(A){this._port=(null!=A?A.port:void 0)||8912,(null!=A?A.tls:void 0)?(this._tlsOptions=A.tls,("string"==typeof this._tlsOptions||this._tlsOptions instanceof Buffer)&&(this._tlsOptions={key:this._tlsOptions,cert:this._tlsOptions})):this._tlsOptions=null,this._fs=c.Env.require("fs"),this._http=c.Env.require("http"),this._https=c.Env.require("https"),this._open=c.Env.require("open"),this._callbacks={},this._nodeUrl=c.Env.require("url"),this.createApp()}return A.prototype.authType=function(){return"code"},A.prototype.url=function(){return(null===this._tlsOptions?"http":"https")+"://localhost:"+this._port+"/oauth_callback"},A.prototype.doAuthorize=function(A,e,t,n){return this._callbacks[e]=n,this.openBrowser(A)},A.prototype.openBrowser=function(A){if(!A.match(/^https?:\/\//))throw new Error("Not a http/https URL: "+A);return"BROWSER"in process.env?this._open(A,process.env.BROWSER):this._open(A)},A.prototype.createApp=function(){return this._app=this._tlsOptions?this._https.createServer(this._tlsOptions,function(A){return function(e,t){return A.doRequest(e,t)}}(this)):this._http.createServer(function(A){return function(e,t){return A.doRequest(e,t)}}(this)),this._app.listen(this._port)},A.prototype.closeServer=function(){return this._app.close()},A.prototype.doRequest=function(A,e){var t,n,i;return i=this._nodeUrl.parse(A.url,!0),"/oauth_callback"===i.pathname&&(n=i.query.state,this._callbacks[n]&&(this._callbacks[n](i.query),delete this._callbacks[n])),t="",A.on("data",function(A){return t+=A}),A.on("end",function(A){return function(){return A.closeBrowser(e)}}(this))},A.prototype.closeBrowser=function(A){var e;return e='\n - +

          Loading...

          diff --git a/html/index.html b/html/index.html index 4d00aaec..e095447a 100644 --- a/html/index.html +++ b/html/index.html @@ -4,7 +4,7 @@ - + - +

          Loading...

          diff --git a/index.html b/index.html index 4d00aaec..e095447a 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + - +

          Loading...

          diff --git a/js/utils/common.js b/js/utils/common.js index 282700f1..fa74fdfa 100644 --- a/js/utils/common.js +++ b/js/utils/common.js @@ -1,7 +1,7 @@ define(function() { return { data: { - footer: 'version: 1.15.1 (2020/09/18)' + footer: 'version: 1.16.0 (2020/10/05)' } }; diff --git a/package-lock.json b/package-lock.json index 3b647e58..cd860db2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "afterwriting", - "version": "1.15.1", + "version": "1.16.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 81ca1f84..3a90b258 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "afterwriting", - "version": "1.15.1", + "version": "1.16.0", "description": "Screewriting tools", "keywords": [ "screenwriting",