kityminder.share.min.js 412 KB

12345678910111213141516171819202122232425
  1. /*!
  2. * ====================================================
  3. * kityminder - v1.3.5 - 2015-05-15
  4. * https://github.com/fex-team/kityminder
  5. * GitHub: https://github.com/fex-team/kityminder.git
  6. * Copyright (c) 2015 f-cube @ FEX; Licensed MIT
  7. * ====================================================
  8. */
  9. !function(window){function getMetaKeyCode(a){var b=4096,c=8192,d=16384,e=0;return"string"==typeof a?a.toLowerCase().split(/\+\s*/).forEach(function(a){switch(a){case"ctrl":case"cmd":e|=b;break;case"alt":e|=c;break;case"shift":e|=d;break;default:e|=keymap[a]}}):((a.ctrlKey||a.metaKey)&&(e|=b),a.altKey&&(e|=c),a.shiftKey&&(e|=d),e|=a.keyCode),e}function updateCircle(a,b,c){var d=b.getStyle("padding-left"),e=b.getStyle("padding-right"),f=b.getStyle("padding-top"),g=b.getStyle("padding-bottom"),h=Math.max(c.width,c.height),i={x:c.x-d,y:c.y-f,width:h+d+e,height:h+f+g},j=b.isSelected()?"selected-":"";return h=Math.max(i.width,i.height),a.setPosition(i.x,i.y).setSize(h,h).setRadius(h/2).fill(b.getData("background")||b.getStyle(j+"background")||b.getStyle("background")).stroke(b.getStyle(j+"stroke"||b.getStyle("stroke")),b.getStyle(j+"stroke-width")),new kity.Box(i)}!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=a.length,c=_.type(a);return"function"===c||_.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+Math.random()}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c}catch(e){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)ra.set(a[c],"globalEval",!b||ra.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(ra.hasData(a)&&(f=ra.access(a),g=ra.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sa.hasData(a)&&(h=sa.access(a),i=_.extend({},h),sa.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ya.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Oa[a];return c||(c=t(a,b),"none"!==c&&c||(Na=(Na||_("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=Na[0].contentDocument,b.write(),b.close(),c=t(a,b),Na.detach()),Oa[a]=c),c}function v(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||_.contains(a.ownerDocument,a)||(g=_.style(a,b)),Qa.test(g)&&Pa.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function w(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}function x(a,b){if(b in a)return b;for(var c=b[0].toUpperCase()+b.slice(1),d=b,e=Xa.length;e--;)if(b=Xa[e]+c,b in a)return b;return d}function y(a,b,c){var d=Ta.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function z(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=_.css(a,c+wa[f],!0,e)),d?("content"===c&&(g-=_.css(a,"padding"+wa[f],!0,e)),"margin"!==c&&(g-=_.css(a,"border"+wa[f]+"Width",!0,e))):(g+=_.css(a,"padding"+wa[f],!0,e),"padding"!==c&&(g+=_.css(a,"border"+wa[f]+"Width",!0,e)));return g}function A(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ra(a),g="border-box"===_.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=v(a,b,f),(0>e||null==e)&&(e=a.style[b]),Qa.test(e))return e;d=g&&(Y.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+z(a,b,c||(g?"border":"content"),d,f)+"px"}function B(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=ra.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&xa(d)&&(f[g]=ra.access(d,"olddisplay",u(d.nodeName)))):(e=xa(d),"none"===c&&e||ra.set(d,"olddisplay",e?c:_.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function C(a,b,c,d,e){return new C.prototype.init(a,b,c,d,e)}function D(){return setTimeout(function(){Ya=void 0}),Ya=_.now()}function E(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=wa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function F(a,b,c){for(var d,e=(cb[b]||[]).concat(cb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function G(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},n=a.style,o=a.nodeType&&xa(a),p=ra.get(a,"fxshow");c.queue||(h=_._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,_.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[n.overflow,n.overflowX,n.overflowY],j=_.css(a,"display"),k="none"===j?ra.get(a,"olddisplay")||u(a.nodeName):j,"inline"===k&&"none"===_.css(a,"float")&&(n.display="inline-block")),c.overflow&&(n.overflow="hidden",l.always(function(){n.overflow=c.overflow[0],n.overflowX=c.overflow[1],n.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],$a.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(o?"hide":"show")){if("show"!==e||!p||void 0===p[d])continue;o=!0}m[d]=p&&p[d]||_.style(a,d)}else j=void 0;if(_.isEmptyObject(m))"inline"===("none"===j?u(a.nodeName):j)&&(n.display=j);else{p?"hidden"in p&&(o=p.hidden):p=ra.access(a,"fxshow",{}),f&&(p.hidden=!o),o?_(a).show():l.done(function(){_(a).hide()}),l.done(function(){var b;ra.remove(a,"fxshow");for(b in m)_.style(a,b,m[b])});for(d in m)g=F(o?p[d]:0,d,l),d in p||(p[d]=g.start,o&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function H(a,b){var c,d,e,f,g;for(c in a)if(d=_.camelCase(c),e=b[d],f=a[c],_.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=_.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function I(a,b,c){var d,e,f=0,g=bb.length,h=_.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||D(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:_.extend({},b),opts:_.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Ya||D(),duration:c.duration,tweens:[],createTween:function(b,c){var d=_.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(H(k,j.opts.specialEasing);g>f;f++)if(d=bb[f].call(j,a,k,j.opts))return d;return _.map(k,F,j),_.isFunction(j.opts.start)&&j.opts.start.call(a,j),_.fx.timer(_.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function J(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(na)||[];if(_.isFunction(c))for(;d=f[e++];)"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function K(a,b,c,d){function e(h){var i;return f[h]=!0,_.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||g||f[j]?g?!(i=j):void 0:(b.dataTypes.unshift(j),e(j),!1)}),i}var f={},g=a===vb;return e(b.dataTypes[0])||!f["*"]&&e("*")}function L(a,b){var c,d,e=_.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&_.extend(!0,a,d),a}function M(a,b,c){for(var d,e,f,g,h=a.contents,i=a.dataTypes;"*"===i[0];)i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function N(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];for(f=k.shift();f;)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}function O(a,b,c,d){var e;if(_.isArray(b))_.each(b,function(b,e){c||zb.test(a)?d(a,e):O(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==_.type(b))d(a,b);else for(e in b)O(a+"["+e+"]",b[e],c,d)}function P(a){return _.isWindow(a)?a:9===a.nodeType&&a.defaultView}var Q=[],R=Q.slice,S=Q.concat,T=Q.push,U=Q.indexOf,V={},W=V.toString,X=V.hasOwnProperty,Y={},Z=a.document,$="2.1.1",_=function(a,b){return new _.fn.init(a,b)},aa=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ba=/^-ms-/,ca=/-([\da-z])/gi,da=function(a,b){return b.toUpperCase()};_.fn=_.prototype={jquery:$,constructor:_,selector:"",length:0,toArray:function(){return R.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:R.call(this)},pushStack:function(a){var b=_.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return _.each(this,a,b)},map:function(a){return this.pushStack(_.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(R.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:T,sort:Q.sort,splice:Q.splice},_.extend=_.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||_.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(_.isPlainObject(d)||(e=_.isArray(d)))?(e?(e=!1,f=c&&_.isArray(c)?c:[]):f=c&&_.isPlainObject(c)?c:{},g[b]=_.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},_.extend({expando:"jQuery"+($+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===_.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!_.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==_.type(a)||a.nodeType||_.isWindow(a)?!1:a.constructor&&!X.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?V[W.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=_.trim(a),a&&(1===a.indexOf("use strict")?(b=Z.createElement("script"),b.text=a,Z.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(ba,"ms-").replace(ca,da)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,d){var e,f=0,g=a.length,h=c(a);if(d){if(h)for(;g>f&&(e=b.apply(a[f],d),e!==!1);f++);else for(f in a)if(e=b.apply(a[f],d),e===!1)break}else if(h)for(;g>f&&(e=b.call(a[f],f,a[f]),e!==!1);f++);else for(f in a)if(e=b.call(a[f],f,a[f]),e===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(aa,"")},makeArray:function(a,b){var d=b||[];return null!=a&&(c(Object(a))?_.merge(d,"string"==typeof a?[a]:a):T.call(d,a)),d},inArray:function(a,b,c){return null==b?-1:U.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,d){var e,f=0,g=a.length,h=c(a),i=[];if(h)for(;g>f;f++)e=b(a[f],f,d),null!=e&&i.push(e);else for(f in a)e=b(a[f],f,d),null!=e&&i.push(e);return S.apply([],i)},guid:1,proxy:function(a,b){var c,d,e;return"string"==typeof b&&(c=a[b],b=a,a=c),_.isFunction(a)?(d=R.call(arguments,2),e=function(){return a.apply(b||this,d.concat(R.call(arguments)))},e.guid=a.guid=a.guid||_.guid++,e):void 0},now:Date.now,support:Y}),_.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){V["[object "+b+"]"]=b.toLowerCase()});var ea=function(a){function b(a,b,c,d){var e,f,g,h,i,j,l,n,o,p;if((b?b.ownerDocument||b:O)!==G&&F(b),b=b||G,c=c||[],!a||"string"!=typeof a)return c;if(1!==(h=b.nodeType)&&9!==h)return[];if(I&&!d){if(e=sa.exec(a))if(g=e[1]){if(9===h){if(f=b.getElementById(g),!f||!f.parentNode)return c;if(f.id===g)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(g))&&M(b,f)&&f.id===g)return c.push(f),c}else{if(e[2])return _.apply(c,b.getElementsByTagName(a)),c;if((g=e[3])&&v.getElementsByClassName&&b.getElementsByClassName)return _.apply(c,b.getElementsByClassName(g)),c}if(v.qsa&&(!J||!J.test(a))){if(n=l=N,o=b,p=9===h&&a,1===h&&"object"!==b.nodeName.toLowerCase()){for(j=z(a),(l=b.getAttribute("id"))?n=l.replace(ua,"\\$&"):b.setAttribute("id",n),n="[id='"+n+"'] ",i=j.length;i--;)j[i]=n+m(j[i]);o=ta.test(a)&&k(b.parentNode)||b,p=j.join(",")}if(p)try{return _.apply(c,o.querySelectorAll(p)),c}catch(q){}finally{l||b.removeAttribute("id")}}}return B(a.replace(ia,"$1"),b,c,d)}function c(){function a(c,d){return b.push(c+" ")>w.cacheLength&&delete a[b.shift()],a[c+" "]=d}var b=[];return a}function d(a){return a[N]=!0,a}function e(a){var b=G.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function f(a,b){for(var c=a.split("|"),d=a.length;d--;)w.attrHandle[c[d]]=b}function g(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||W)-(~a.sourceIndex||W);if(d)return d;if(c)for(;c=c.nextSibling;)if(c===b)return-1;return a?1:-1}function h(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function i(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function j(a){return d(function(b){return b=+b,d(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function k(a){return a&&typeof a.getElementsByTagName!==V&&a}function l(){}function m(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function n(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=Q++;return b.first?function(b,c,f){for(;b=b[d];)if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[P,f];if(g){for(;b=b[d];)if((1===b.nodeType||e)&&a(b,c,g))return!0}else for(;b=b[d];)if(1===b.nodeType||e){if(i=b[N]||(b[N]={}),(h=i[d])&&h[0]===P&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function o(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function p(a,c,d){for(var e=0,f=c.length;f>e;e++)b(a,c[e],d);return d}function q(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function r(a,b,c,e,f,g){return e&&!e[N]&&(e=r(e)),f&&!f[N]&&(f=r(f,g)),d(function(d,g,h,i){var j,k,l,m=[],n=[],o=g.length,r=d||p(b||"*",h.nodeType?[h]:h,[]),s=!a||!d&&b?r:q(r,m,a,h,i),t=c?f||(d?a:o||e)?[]:g:s;if(c&&c(s,t,h,i),e)for(j=q(t,n),e(j,[],h,i),k=j.length;k--;)(l=j[k])&&(t[n[k]]=!(s[n[k]]=l));if(d){if(f||a){if(f){for(j=[],k=t.length;k--;)(l=t[k])&&j.push(s[k]=l);f(null,t=[],j,i)}for(k=t.length;k--;)(l=t[k])&&(j=f?ba.call(d,l):m[k])>-1&&(d[j]=!(g[j]=l))}}else t=q(t===g?t.splice(o,t.length):t),f?f(null,g,t,i):_.apply(g,t)})}function s(a){for(var b,c,d,e=a.length,f=w.relative[a[0].type],g=f||w.relative[" "],h=f?1:0,i=n(function(a){return a===b},g,!0),j=n(function(a){return ba.call(b,a)>-1},g,!0),k=[function(a,c,d){return!f&&(d||c!==C)||((b=c).nodeType?i(a,c,d):j(a,c,d))}];e>h;h++)if(c=w.relative[a[h].type])k=[n(o(k),c)];else{if(c=w.filter[a[h].type].apply(null,a[h].matches),c[N]){for(d=++h;e>d&&!w.relative[a[d].type];d++);return r(h>1&&o(k),h>1&&m(a.slice(0,h-1).concat({value:" "===a[h-2].type?"*":""})).replace(ia,"$1"),c,d>h&&s(a.slice(h,d)),e>d&&s(a=a.slice(d)),e>d&&m(a))}k.push(c)}return o(k)}function t(a,c){var e=c.length>0,f=a.length>0,g=function(d,g,h,i,j){var k,l,m,n=0,o="0",p=d&&[],r=[],s=C,t=d||f&&w.find.TAG("*",j),u=P+=null==s?1:Math.random()||.1,v=t.length;for(j&&(C=g!==G&&g);o!==v&&null!=(k=t[o]);o++){if(f&&k){for(l=0;m=a[l++];)if(m(k,g,h)){i.push(k);break}j&&(P=u)}e&&((k=!m&&k)&&n--,d&&p.push(k))}if(n+=o,e&&o!==n){for(l=0;m=c[l++];)m(p,r,g,h);if(d){if(n>0)for(;o--;)p[o]||r[o]||(r[o]=Z.call(i));r=q(r)}_.apply(i,r),j&&!d&&r.length>0&&n+c.length>1&&b.uniqueSort(i)}return j&&(P=u,C=s),p};return e?d(g):g}var u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N="sizzle"+-new Date,O=a.document,P=0,Q=0,R=c(),S=c(),T=c(),U=function(a,b){return a===b&&(E=!0),0},V="undefined",W=1<<31,X={}.hasOwnProperty,Y=[],Z=Y.pop,$=Y.push,_=Y.push,aa=Y.slice,ba=Y.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},ca="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",da="[\\x20\\t\\r\\n\\f]",ea="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",fa=ea.replace("w","w#"),ga="\\["+da+"*("+ea+")(?:"+da+"*([*^$|!~]?=)"+da+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+fa+"))|)"+da+"*\\]",ha=":("+ea+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ga+")*)|.*)\\)|)",ia=new RegExp("^"+da+"+|((?:^|[^\\\\])(?:\\\\.)*)"+da+"+$","g"),ja=new RegExp("^"+da+"*,"+da+"*"),ka=new RegExp("^"+da+"*([>+~]|"+da+")"+da+"*"),la=new RegExp("="+da+"*([^\\]'\"]*?)"+da+"*\\]","g"),ma=new RegExp(ha),na=new RegExp("^"+fa+"$"),oa={ID:new RegExp("^#("+ea+")"),CLASS:new RegExp("^\\.("+ea+")"),TAG:new RegExp("^("+ea.replace("w","w*")+")"),ATTR:new RegExp("^"+ga),PSEUDO:new RegExp("^"+ha),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+da+"*(even|odd|(([+-]|)(\\d*)n|)"+da+"*(?:([+-]|)"+da+"*(\\d+)|))"+da+"*\\)|)","i"),bool:new RegExp("^(?:"+ca+")$","i"),needsContext:new RegExp("^"+da+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+da+"*((?:-\\d)?\\d*)"+da+"*\\)|)(?=[^-]|$)","i")},pa=/^(?:input|select|textarea|button)$/i,qa=/^h\d$/i,ra=/^[^{]+\{\s*\[native \w/,sa=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ta=/[+~]/,ua=/'|\\/g,va=new RegExp("\\\\([\\da-f]{1,6}"+da+"?|("+da+")|.)","ig"),wa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{_.apply(Y=aa.call(O.childNodes),O.childNodes),Y[O.childNodes.length].nodeType}catch(xa){_={apply:Y.length?function(a,b){$.apply(a,aa.call(b))}:function(a,b){for(var c=a.length,d=0;a[c++]=b[d++];);a.length=c-1}}}v=b.support={},y=b.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},F=b.setDocument=function(a){var b,c=a?a.ownerDocument||a:O,d=c.defaultView;return c!==G&&9===c.nodeType&&c.documentElement?(G=c,H=c.documentElement,I=!y(c),d&&d!==d.top&&(d.addEventListener?d.addEventListener("unload",function(){F()},!1):d.attachEvent&&d.attachEvent("onunload",function(){F()})),v.attributes=e(function(a){return a.className="i",!a.getAttribute("className")}),v.getElementsByTagName=e(function(a){return a.appendChild(c.createComment("")),!a.getElementsByTagName("*").length}),v.getElementsByClassName=ra.test(c.getElementsByClassName)&&e(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),v.getById=e(function(a){return H.appendChild(a).id=N,!c.getElementsByName||!c.getElementsByName(N).length}),v.getById?(w.find.ID=function(a,b){if(typeof b.getElementById!==V&&I){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},w.filter.ID=function(a){var b=a.replace(va,wa);return function(a){return a.getAttribute("id")===b}}):(delete w.find.ID,w.filter.ID=function(a){var b=a.replace(va,wa);return function(a){var c=typeof a.getAttributeNode!==V&&a.getAttributeNode("id");return c&&c.value===b}}),w.find.TAG=v.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==V?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){for(;c=f[e++];)1===c.nodeType&&d.push(c);return d}return f},w.find.CLASS=v.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==V&&I?b.getElementsByClassName(a):void 0},K=[],J=[],(v.qsa=ra.test(c.querySelectorAll))&&(e(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&J.push("[*^$]="+da+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||J.push("\\["+da+"*(?:value|"+ca+")"),a.querySelectorAll(":checked").length||J.push(":checked")}),e(function(a){var b=c.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&J.push("name"+da+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||J.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),J.push(",.*:")})),(v.matchesSelector=ra.test(L=H.matches||H.webkitMatchesSelector||H.mozMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&e(function(a){v.disconnectedMatch=L.call(a,"div"),L.call(a,"[s!='']:x"),K.push("!=",ha)}),J=J.length&&new RegExp(J.join("|")),K=K.length&&new RegExp(K.join("|")),b=ra.test(H.compareDocumentPosition),M=b||ra.test(H.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},U=b?function(a,b){if(a===b)return E=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!v.sortDetached&&b.compareDocumentPosition(a)===d?a===c||a.ownerDocument===O&&M(O,a)?-1:b===c||b.ownerDocument===O&&M(O,b)?1:D?ba.call(D,a)-ba.call(D,b):0:4&d?-1:1)}:function(a,b){if(a===b)return E=!0,0;var d,e=0,f=a.parentNode,h=b.parentNode,i=[a],j=[b];if(!f||!h)return a===c?-1:b===c?1:f?-1:h?1:D?ba.call(D,a)-ba.call(D,b):0;if(f===h)return g(a,b);for(d=a;d=d.parentNode;)i.unshift(d);for(d=b;d=d.parentNode;)j.unshift(d);for(;i[e]===j[e];)e++;return e?g(i[e],j[e]):i[e]===O?-1:j[e]===O?1:0},c):G},b.matches=function(a,c){return b(a,null,null,c)},b.matchesSelector=function(a,c){if((a.ownerDocument||a)!==G&&F(a),c=c.replace(la,"='$1']"),!(!v.matchesSelector||!I||K&&K.test(c)||J&&J.test(c)))try{var d=L.call(a,c);if(d||v.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return b(c,G,null,[a]).length>0},b.contains=function(a,b){return(a.ownerDocument||a)!==G&&F(a),M(a,b)},b.attr=function(a,b){(a.ownerDocument||a)!==G&&F(a);var c=w.attrHandle[b.toLowerCase()],d=c&&X.call(w.attrHandle,b.toLowerCase())?c(a,b,!I):void 0;return void 0!==d?d:v.attributes||!I?a.getAttribute(b):(d=a.getAttributeNode(b))&&d.specified?d.value:null},b.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},b.uniqueSort=function(a){var b,c=[],d=0,e=0;if(E=!v.detectDuplicates,D=!v.sortStable&&a.slice(0),a.sort(U),E){for(;b=a[e++];)b===a[e]&&(d=c.push(e));for(;d--;)a.splice(c[d],1)}return D=null,a},x=b.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=x(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d++];)c+=x(b);return c},w=b.selectors={cacheLength:50,createPseudo:d,match:oa,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(va,wa),a[3]=(a[3]||a[4]||a[5]||"").replace(va,wa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||b.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&b.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return oa.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&ma.test(c)&&(b=z(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(va,wa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=R[a+" "];return b||(b=new RegExp("(^|"+da+")"+a+"("+da+"|$)"))&&R(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==V&&a.getAttribute("class")||"")})},ATTR:function(a,c,d){return function(e){var f=b.attr(e,a);return null==f?"!="===c:c?(f+="","="===c?f===d:"!="===c?f!==d:"^="===c?d&&0===f.indexOf(d):"*="===c?d&&f.indexOf(d)>-1:"$="===c?d&&f.slice(-d.length)===d:"~="===c?(" "+f+" ").indexOf(d)>-1:"|="===c?f===d||f.slice(0,d.length+1)===d+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){for(;p;){for(l=b;l=l[p];)if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){for(k=q[N]||(q[N]={}),j=k[a]||[],n=j[0]===P&&j[1],m=j[0]===P&&j[2],l=n&&q.childNodes[n];l=++n&&l&&l[p]||(m=n=0)||o.pop();)if(1===l.nodeType&&++m&&l===b){k[a]=[P,n,m];break}}else if(s&&(j=(b[N]||(b[N]={}))[a])&&j[0]===P)m=j[1];else for(;(l=++n&&l&&l[p]||(m=n=0)||o.pop())&&((h?l.nodeName.toLowerCase()!==r:1!==l.nodeType)||!++m||(s&&((l[N]||(l[N]={}))[a]=[P,m]),l!==b)););return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,c){var e,f=w.pseudos[a]||w.setFilters[a.toLowerCase()]||b.error("unsupported pseudo: "+a);return f[N]?f(c):f.length>1?(e=[a,a,"",c],w.setFilters.hasOwnProperty(a.toLowerCase())?d(function(a,b){for(var d,e=f(a,c),g=e.length;g--;)d=ba.call(a,e[g]),a[d]=!(b[d]=e[g])}):function(a){return f(a,0,e)}):f}},pseudos:{not:d(function(a){var b=[],c=[],e=A(a.replace(ia,"$1"));return e[N]?d(function(a,b,c,d){for(var f,g=e(a,null,d,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,d,f){return b[0]=a,e(b,null,f,c),!c.pop()}}),has:d(function(a){return function(c){return b(a,c).length>0}}),contains:d(function(a){return function(b){return(b.textContent||b.innerText||x(b)).indexOf(a)>-1}}),lang:d(function(a){return na.test(a||"")||b.error("unsupported lang: "+a),a=a.replace(va,wa).toLowerCase(),function(b){var c;do if(c=I?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===H},focus:function(a){return a===G.activeElement&&(!G.hasFocus||G.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!w.pseudos.empty(a)},header:function(a){return qa.test(a.nodeName)},input:function(a){return pa.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:j(function(){return[0]}),last:j(function(a,b){return[b-1]}),eq:j(function(a,b,c){return[0>c?c+b:c]}),even:j(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:j(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:j(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:j(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},w.pseudos.nth=w.pseudos.eq;for(u in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[u]=h(u);for(u in{submit:!0,reset:!0})w.pseudos[u]=i(u);return l.prototype=w.filters=w.pseudos,w.setFilters=new l,z=b.tokenize=function(a,c){var d,e,f,g,h,i,j,k=S[a+" "];if(k)return c?0:k.slice(0);for(h=a,i=[],j=w.preFilter;h;){(!d||(e=ja.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),d=!1,(e=ka.exec(h))&&(d=e.shift(),f.push({value:d,type:e[0].replace(ia," ")}),h=h.slice(d.length));for(g in w.filter)!(e=oa[g].exec(h))||j[g]&&!(e=j[g](e))||(d=e.shift(),f.push({value:d,type:g,matches:e}),h=h.slice(d.length));if(!d)break}return c?h.length:h?b.error(a):S(a,i).slice(0)},A=b.compile=function(a,b){var c,d=[],e=[],f=T[a+" "];if(!f){for(b||(b=z(a)),c=b.length;c--;)f=s(b[c]),f[N]?d.push(f):e.push(f);f=T(a,t(e,d)),f.selector=a}return f},B=b.select=function(a,b,c,d){var e,f,g,h,i,j="function"==typeof a&&a,l=!d&&z(a=j.selector||a);if(c=c||[],1===l.length){if(f=l[0]=l[0].slice(0),f.length>2&&"ID"===(g=f[0]).type&&v.getById&&9===b.nodeType&&I&&w.relative[f[1].type]){if(b=(w.find.ID(g.matches[0].replace(va,wa),b)||[])[0],!b)return c;j&&(b=b.parentNode),a=a.slice(f.shift().value.length)}for(e=oa.needsContext.test(a)?0:f.length;e--&&(g=f[e],!w.relative[h=g.type]);)if((i=w.find[h])&&(d=i(g.matches[0].replace(va,wa),ta.test(f[0].type)&&k(b.parentNode)||b))){if(f.splice(e,1),a=d.length&&m(f),!a)return _.apply(c,d),c;break}}return(j||A(a,l))(d,b,!I,c,ta.test(a)&&k(b.parentNode)||b),c},v.sortStable=N.split("").sort(U).join("")===N,v.detectDuplicates=!!E,F(),v.sortDetached=e(function(a){return 1&a.compareDocumentPosition(G.createElement("div"))}),e(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||f("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),v.attributes&&e(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),
  10. ""===a.firstChild.getAttribute("value")})||f("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),e(function(a){return null==a.getAttribute("disabled")})||f(ca,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),b}(a);_.find=ea,_.expr=ea.selectors,_.expr[":"]=_.expr.pseudos,_.unique=ea.uniqueSort,_.text=ea.getText,_.isXMLDoc=ea.isXML,_.contains=ea.contains;var fa=_.expr.match.needsContext,ga=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ha=/^.[^:#\[\.,]*$/;_.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?_.find.matchesSelector(d,a)?[d]:[]:_.find.matches(a,_.grep(b,function(a){return 1===a.nodeType}))},_.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(_(a).filter(function(){for(b=0;c>b;b++)if(_.contains(e[b],this))return!0}));for(b=0;c>b;b++)_.find(a,e[b],d);return d=this.pushStack(c>1?_.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(d(this,a||[],!1))},not:function(a){return this.pushStack(d(this,a||[],!0))},is:function(a){return!!d(this,"string"==typeof a&&fa.test(a)?_(a):a||[],!1).length}});var ia,ja=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ka=_.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:ja.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||ia).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof _?b[0]:b,_.merge(this,_.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:Z,!0)),ga.test(c[1])&&_.isPlainObject(b))for(c in b)_.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=Z.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=Z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):_.isFunction(a)?"undefined"!=typeof ia.ready?ia.ready(a):a(_):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),_.makeArray(a,this))};ka.prototype=_.fn,ia=_(Z);var la=/^(?:parents|prev(?:Until|All))/,ma={children:!0,contents:!0,next:!0,prev:!0};_.extend({dir:function(a,b,c){for(var d=[],e=void 0!==c;(a=a[b])&&9!==a.nodeType;)if(1===a.nodeType){if(e&&_(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),_.fn.extend({has:function(a){var b=_(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(_.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=fa.test(a)||"string"!=typeof a?_(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&_.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?_.unique(f):f)},index:function(a){return a?"string"==typeof a?U.call(_(a),this[0]):U.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(_.unique(_.merge(this.get(),_(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),_.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return _.dir(a,"parentNode")},parentsUntil:function(a,b,c){return _.dir(a,"parentNode",c)},next:function(a){return e(a,"nextSibling")},prev:function(a){return e(a,"previousSibling")},nextAll:function(a){return _.dir(a,"nextSibling")},prevAll:function(a){return _.dir(a,"previousSibling")},nextUntil:function(a,b,c){return _.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return _.dir(a,"previousSibling",c)},siblings:function(a){return _.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return _.sibling(a.firstChild)},contents:function(a){return a.contentDocument||_.merge([],a.childNodes)}},function(a,b){_.fn[a]=function(c,d){var e=_.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=_.filter(d,e)),this.length>1&&(ma[a]||_.unique(e),la.test(a)&&e.reverse()),this.pushStack(e)}});var na=/\S+/g,oa={};_.Callbacks=function(a){a="string"==typeof a?oa[a]||f(a):_.extend({},a);var b,c,d,e,g,h,i=[],j=!a.once&&[],k=function(f){for(b=a.memory&&f,c=!0,h=e||0,e=0,g=i.length,d=!0;i&&g>h;h++)if(i[h].apply(f[0],f[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,i&&(j?j.length&&k(j.shift()):b?i=[]:l.disable())},l={add:function(){if(i){var c=i.length;!function f(b){_.each(b,function(b,c){var d=_.type(c);"function"===d?a.unique&&l.has(c)||i.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),d?g=i.length:b&&(e=c,k(b))}return this},remove:function(){return i&&_.each(arguments,function(a,b){for(var c;(c=_.inArray(b,i,c))>-1;)i.splice(c,1),d&&(g>=c&&g--,h>=c&&h--)}),this},has:function(a){return a?_.inArray(a,i)>-1:!(!i||!i.length)},empty:function(){return i=[],g=0,this},disable:function(){return i=j=b=void 0,this},disabled:function(){return!i},lock:function(){return j=void 0,b||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return!i||c&&!j||(b=b||[],b=[a,b.slice?b.slice():b],d?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!c}};return l},_.extend({Deferred:function(a){var b=[["resolve","done",_.Callbacks("once memory"),"resolved"],["reject","fail",_.Callbacks("once memory"),"rejected"],["notify","progress",_.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return _.Deferred(function(c){_.each(b,function(b,f){var g=_.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&_.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?_.extend(a,d):d}},e={};return d.pipe=d.then,_.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=R.call(arguments),g=f.length,h=1!==g||a&&_.isFunction(a.promise)?g:0,i=1===h?a:_.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?R.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&_.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}});var pa;_.fn.ready=function(a){return _.ready.promise().done(a),this},_.extend({isReady:!1,readyWait:1,holdReady:function(a){a?_.readyWait++:_.ready(!0)},ready:function(a){(a===!0?--_.readyWait:_.isReady)||(_.isReady=!0,a!==!0&&--_.readyWait>0||(pa.resolveWith(Z,[_]),_.fn.triggerHandler&&(_(Z).triggerHandler("ready"),_(Z).off("ready"))))}}),_.ready.promise=function(b){return pa||(pa=_.Deferred(),"complete"===Z.readyState?setTimeout(_.ready):(Z.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1))),pa.promise(b)},_.ready.promise();var qa=_.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===_.type(c)){e=!0;for(h in c)_.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,_.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(_(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};_.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType},h.uid=1,h.accepts=_.acceptData,h.prototype={key:function(a){if(!h.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=h.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,_.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(_.isEmptyObject(f))_.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,_.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{_.isArray(b)?d=b.concat(b.map(_.camelCase)):(e=_.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(na)||[])),c=d.length;for(;c--;)delete g[d[c]]}},hasData:function(a){return!_.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var ra=new h,sa=new h,ta=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ua=/([A-Z])/g;_.extend({hasData:function(a){return sa.hasData(a)||ra.hasData(a)},data:function(a,b,c){return sa.access(a,b,c)},removeData:function(a,b){sa.remove(a,b)},_data:function(a,b,c){return ra.access(a,b,c)},_removeData:function(a,b){ra.remove(a,b)}}),_.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=sa.get(f),1===f.nodeType&&!ra.get(f,"hasDataAttrs"))){for(c=g.length;c--;)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=_.camelCase(d.slice(5)),i(f,d,e[d])));ra.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){sa.set(this,a)}):qa(this,function(b){var c,d=_.camelCase(a);if(f&&void 0===b){if(c=sa.get(f,a),void 0!==c)return c;if(c=sa.get(f,d),void 0!==c)return c;if(c=i(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=sa.get(this,d);sa.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&sa.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){sa.remove(this,a)})}}),_.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=ra.get(a,b),c&&(!d||_.isArray(c)?d=ra.access(a,b,_.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=_.queue(a,b),d=c.length,e=c.shift(),f=_._queueHooks(a,b),g=function(){_.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return ra.get(a,c)||ra.access(a,c,{empty:_.Callbacks("once memory").add(function(){ra.remove(a,[b+"queue",c])})})}}),_.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?_.queue(this[0],a):void 0===b?this:this.each(function(){var c=_.queue(this,a,b);_._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&_.dequeue(this,a)})},dequeue:function(a){return this.each(function(){_.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=_.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};for("string"!=typeof a&&(b=a,a=void 0),a=a||"fx";g--;)c=ra.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var va=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,wa=["Top","Right","Bottom","Left"],xa=function(a,b){return a=b||a,"none"===_.css(a,"display")||!_.contains(a.ownerDocument,a)},ya=/^(?:checkbox|radio)$/i;!function(){var a=Z.createDocumentFragment(),b=a.appendChild(Z.createElement("div")),c=Z.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),Y.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",Y.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var za="undefined";Y.focusinBubbles="onfocusin"in a;var Aa=/^key/,Ba=/^(?:mouse|pointer|contextmenu)|click/,Ca=/^(?:focusinfocus|focusoutblur)$/,Da=/^([^.]*)(?:\.(.+)|)$/;_.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=ra.get(a);if(q)for(c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=_.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return typeof _!==za&&_.event.triggered!==b.type?_.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(na)||[""],j=b.length;j--;)h=Da.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=_.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=_.event.special[n]||{},k=_.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&_.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),_.event.global[n]=!0)},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=ra.hasData(a)&&ra.get(a);if(q&&(i=q.events)){for(b=(b||"").match(na)||[""],j=b.length;j--;)if(h=Da.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){for(l=_.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;f--;)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||_.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)_.event.remove(a,n+b[j],c,d,!0);_.isEmptyObject(i)&&(delete q.handle,ra.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,j,k,l,m=[d||Z],n=X.call(b,"type")?b.type:b,o=X.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||Z,3!==d.nodeType&&8!==d.nodeType&&!Ca.test(n+_.event.triggered)&&(n.indexOf(".")>=0&&(o=n.split("."),n=o.shift(),o.sort()),j=n.indexOf(":")<0&&"on"+n,b=b[_.expando]?b:new _.Event(n,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=o.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:_.makeArray(c,[b]),l=_.event.special[n]||{},e||!l.trigger||l.trigger.apply(d,c)!==!1)){if(!e&&!l.noBubble&&!_.isWindow(d)){for(i=l.delegateType||n,Ca.test(i+n)||(g=g.parentNode);g;g=g.parentNode)m.push(g),h=g;h===(d.ownerDocument||Z)&&m.push(h.defaultView||h.parentWindow||a)}for(f=0;(g=m[f++])&&!b.isPropagationStopped();)b.type=f>1?i:l.bindType||n,k=(ra.get(g,"events")||{})[b.type]&&ra.get(g,"handle"),k&&k.apply(g,c),k=j&&g[j],k&&k.apply&&_.acceptData(g)&&(b.result=k.apply(g,c),b.result===!1&&b.preventDefault());return b.type=n,e||b.isDefaultPrevented()||l._default&&l._default.apply(m.pop(),c)!==!1||!_.acceptData(d)||j&&_.isFunction(d[n])&&!_.isWindow(d)&&(h=d[j],h&&(d[j]=null),_.event.triggered=n,d[n](),_.event.triggered=void 0,h&&(d[j]=h)),b.result}},dispatch:function(a){a=_.event.fix(a);var b,c,d,e,f,g=[],h=R.call(arguments),i=(ra.get(this,"events")||{})[a.type]||[],j=_.event.special[a.type]||{};if(h[0]=a,a.delegateTarget=this,!j.preDispatch||j.preDispatch.call(this,a)!==!1){for(g=_.event.handlers.call(this,a,i),b=0;(e=g[b++])&&!a.isPropagationStopped();)for(a.currentTarget=e.elem,c=0;(f=e.handlers[c++])&&!a.isImmediatePropagationStopped();)(!a.namespace_re||a.namespace_re.test(f.namespace))&&(a.handleObj=f,a.data=f.data,d=((_.event.special[f.origType]||{}).handle||f.handler).apply(e.elem,h),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()));return j.postDispatch&&j.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?_(e,this).index(i)>=0:_.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||Z,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[_.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];for(g||(this.fixHooks[e]=g=Ba.test(e)?this.mouseHooks:Aa.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new _.Event(f),b=d.length;b--;)c=d[b],a[c]=f[c];return a.target||(a.target=Z),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==l()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===l()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&_.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return _.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=_.extend(new _.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?_.event.trigger(e,null,b):_.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},_.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},_.Event=function(a,b){return this instanceof _.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?j:k):this.type=a,b&&_.extend(this,b),this.timeStamp=a&&a.timeStamp||_.now(),void(this[_.expando]=!0)):new _.Event(a,b)},_.Event.prototype={isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=j,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=j,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=j,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},_.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){_.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!_.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),Y.focusinBubbles||_.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){_.event.simulate(b,a.target,_.event.fix(a),!0)};_.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=ra.access(d,b);e||d.addEventListener(a,c,!0),ra.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=ra.access(d,b)-1;e?ra.access(d,b,e):(d.removeEventListener(a,c,!0),ra.remove(d,b))}}}),_.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=k;else if(!d)return this;return 1===e&&(f=d,d=function(a){return _().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=_.guid++)),this.each(function(){_.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,_(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=k),this.each(function(){_.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){_.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?_.event.trigger(a,b,c,!0):void 0}});var Ea=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Fa=/<([\w:]+)/,Ga=/<|&#?\w+;/,Ha=/<(?:script|style|link)/i,Ia=/checked\s*(?:[^=]|=\s*.checked.)/i,Ja=/^$|\/(?:java|ecma)script/i,Ka=/^true\/(.*)/,La=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ma.optgroup=Ma.option,Ma.tbody=Ma.tfoot=Ma.colgroup=Ma.caption=Ma.thead,Ma.th=Ma.td,_.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=_.contains(a.ownerDocument,a);if(!(Y.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||_.isXMLDoc(a)))for(g=r(h),f=r(a),d=0,e=f.length;e>d;d++)s(f[d],g[d]);if(b)if(c)for(f=f||r(a),g=g||r(h),d=0,e=f.length;e>d;d++)q(f[d],g[d]);else q(a,h);return g=r(h,"script"),g.length>0&&p(g,!i&&r(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,n=a.length;n>m;m++)if(e=a[m],e||0===e)if("object"===_.type(e))_.merge(l,e.nodeType?[e]:e);else if(Ga.test(e)){for(f=f||k.appendChild(b.createElement("div")),g=(Fa.exec(e)||["",""])[1].toLowerCase(),h=Ma[g]||Ma._default,f.innerHTML=h[1]+e.replace(Ea,"<$1></$2>")+h[2],j=h[0];j--;)f=f.lastChild;_.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));for(k.textContent="",m=0;e=l[m++];)if((!d||-1===_.inArray(e,d))&&(i=_.contains(e.ownerDocument,e),f=r(k.appendChild(e),"script"),i&&p(f),c))for(j=0;e=f[j++];)Ja.test(e.type||"")&&c.push(e);return k},cleanData:function(a){for(var b,c,d,e,f=_.event.special,g=0;void 0!==(c=a[g]);g++){if(_.acceptData(c)&&(e=c[ra.expando],e&&(b=ra.cache[e]))){if(b.events)for(d in b.events)f[d]?_.event.remove(c,d):_.removeEvent(c,d,b.handle);ra.cache[e]&&delete ra.cache[e]}delete sa.cache[c[sa.expando]]}}}),_.fn.extend({text:function(a){return qa(this,function(a){return void 0===a?_.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=m(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=m(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?_.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||_.cleanData(r(c)),c.parentNode&&(b&&_.contains(c.ownerDocument,c)&&p(r(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(_.cleanData(r(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return _.clone(this,a,b)})},html:function(a){return qa(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Ha.test(a)&&!Ma[(Fa.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ea,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(_.cleanData(r(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,_.cleanData(r(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=S.apply([],a);var c,d,e,f,g,h,i=0,j=this.length,k=this,l=j-1,m=a[0],p=_.isFunction(m);if(p||j>1&&"string"==typeof m&&!Y.checkClone&&Ia.test(m))return this.each(function(c){var d=k.eq(c);p&&(a[0]=m.call(this,c,d.html())),d.domManip(a,b)});if(j&&(c=_.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(e=_.map(r(c,"script"),n),f=e.length;j>i;i++)g=c,i!==l&&(g=_.clone(g,!0,!0),f&&_.merge(e,r(g,"script"))),b.call(this[i],g,i);if(f)for(h=e[e.length-1].ownerDocument,_.map(e,o),i=0;f>i;i++)g=e[i],Ja.test(g.type||"")&&!ra.access(g,"globalEval")&&_.contains(h,g)&&(g.src?_._evalUrl&&_._evalUrl(g.src):_.globalEval(g.textContent.replace(La,"")))}return this}}),_.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){_.fn[a]=function(a){for(var c,d=[],e=_(a),f=e.length-1,g=0;f>=g;g++)c=g===f?this:this.clone(!0),_(e[g])[b](c),T.apply(d,c.get());return this.pushStack(d)}});var Na,Oa={},Pa=/^margin/,Qa=new RegExp("^("+va+")(?!px)[a-z%]+$","i"),Ra=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};!function(){function b(){g.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",g.innerHTML="",e.appendChild(f);var b=a.getComputedStyle(g,null);c="1%"!==b.top,d="4px"===b.width,e.removeChild(f)}var c,d,e=Z.documentElement,f=Z.createElement("div"),g=Z.createElement("div");g.style&&(g.style.backgroundClip="content-box",g.cloneNode(!0).style.backgroundClip="",Y.clearCloneStyle="content-box"===g.style.backgroundClip,f.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",f.appendChild(g),a.getComputedStyle&&_.extend(Y,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return null==d&&b(),d},reliableMarginRight:function(){var b,c=g.appendChild(Z.createElement("div"));return c.style.cssText=g.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",g.style.width="1px",e.appendChild(f),b=!parseFloat(a.getComputedStyle(c,null).marginRight),e.removeChild(f),b}}))}(),_.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Sa=/^(none|table(?!-c[ea]).+)/,Ta=new RegExp("^("+va+")(.*)$","i"),Ua=new RegExp("^([+-])=("+va+")","i"),Va={position:"absolute",visibility:"hidden",display:"block"},Wa={letterSpacing:"0",fontWeight:"400"},Xa=["Webkit","O","Moz","ms"];_.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=v(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=_.camelCase(b),i=a.style;return b=_.cssProps[h]||(_.cssProps[h]=x(i,h)),g=_.cssHooks[b]||_.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ua.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(_.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||_.cssNumber[h]||(c+="px"),Y.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=_.camelCase(b);return b=_.cssProps[h]||(_.cssProps[h]=x(a.style,h)),g=_.cssHooks[b]||_.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=v(a,b,d)),"normal"===e&&b in Wa&&(e=Wa[b]),""===c||c?(f=parseFloat(e),c===!0||_.isNumeric(f)?f||0:e):e}}),_.each(["height","width"],function(a,b){_.cssHooks[b]={get:function(a,c,d){return c?Sa.test(_.css(a,"display"))&&0===a.offsetWidth?_.swap(a,Va,function(){return A(a,b,d)}):A(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return y(a,c,d?z(a,b,d,"border-box"===_.css(a,"boxSizing",!1,e),e):0)}}}),_.cssHooks.marginRight=w(Y.reliableMarginRight,function(a,b){return b?_.swap(a,{display:"inline-block"},v,[a,"marginRight"]):void 0}),_.each({margin:"",padding:"",border:"Width"},function(a,b){_.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+wa[d]+b]=f[d]||f[d-2]||f[0];return e}},Pa.test(a)||(_.cssHooks[a+b].set=y)}),_.fn.extend({css:function(a,b){return qa(this,function(a,b,c){var d,e,f={},g=0;if(_.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=_.css(a,b[g],!1,d);return f}return void 0!==c?_.style(a,b,c):_.css(a,b)},a,b,arguments.length>1)},show:function(){return B(this,!0)},hide:function(){return B(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){xa(this)?_(this).show():_(this).hide()})}}),_.Tween=C,C.prototype={constructor:C,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(_.cssNumber[c]?"":"px")},cur:function(){var a=C.propHooks[this.prop];return a&&a.get?a.get(this):C.propHooks._default.get(this)},run:function(a){var b,c=C.propHooks[this.prop];return this.options.duration?this.pos=b=_.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):C.propHooks._default.set(this),this}},C.prototype.init.prototype=C.prototype,C.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=_.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){_.fx.step[a.prop]?_.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[_.cssProps[a.prop]]||_.cssHooks[a.prop])?_.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},C.propHooks.scrollTop=C.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},_.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},_.fx=C.prototype.init,_.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=new RegExp("^(?:([+-])=|)("+va+")([a-z%]*)$","i"),ab=/queueHooks$/,bb=[G],cb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=_a.exec(b),f=e&&e[3]||(_.cssNumber[a]?"":"px"),g=(_.cssNumber[a]||"px"!==f&&+d)&&_a.exec(_.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,_.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};_.Animation=_.extend(I,{tweener:function(a,b){_.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],cb[c]=cb[c]||[],cb[c].unshift(b)},prefilter:function(a,b){b?bb.unshift(a):bb.push(a)}}),_.speed=function(a,b,c){var d=a&&"object"==typeof a?_.extend({},a):{complete:c||!c&&b||_.isFunction(a)&&a,duration:a,easing:c&&b||b&&!_.isFunction(b)&&b};return d.duration=_.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in _.fx.speeds?_.fx.speeds[d.duration]:_.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){_.isFunction(d.old)&&d.old.call(this),d.queue&&_.dequeue(this,d.queue)},d},_.fn.extend({fadeTo:function(a,b,c,d){return this.filter(xa).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=_.isEmptyObject(a),f=_.speed(b,c,d),g=function(){var b=I(this,_.extend({},a),f);(e||ra.get(this,"finish"))&&b.stop(!0);
  11. };return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=_.timers,g=ra.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ab.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&_.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=ra.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=_.timers,g=d?d.length:0;for(c.finish=!0,_.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),_.each(["toggle","show","hide"],function(a,b){var c=_.fn[b];_.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(E(b,!0),a,d,e)}}),_.each({slideDown:E("show"),slideUp:E("hide"),slideToggle:E("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){_.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),_.timers=[],_.fx.tick=function(){var a,b=0,c=_.timers;for(Ya=_.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||_.fx.stop(),Ya=void 0},_.fx.timer=function(a){_.timers.push(a),a()?_.fx.start():_.timers.pop()},_.fx.interval=13,_.fx.start=function(){Za||(Za=setInterval(_.fx.tick,_.fx.interval))},_.fx.stop=function(){clearInterval(Za),Za=null},_.fx.speeds={slow:600,fast:200,_default:400},_.fn.delay=function(a,b){return a=_.fx?_.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=Z.createElement("input"),b=Z.createElement("select"),c=b.appendChild(Z.createElement("option"));a.type="checkbox",Y.checkOn=""!==a.value,Y.optSelected=c.selected,b.disabled=!0,Y.optDisabled=!c.disabled,a=Z.createElement("input"),a.value="t",a.type="radio",Y.radioValue="t"===a.value}();var db,eb,fb=_.expr.attrHandle;_.fn.extend({attr:function(a,b){return qa(this,_.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){_.removeAttr(this,a)})}}),_.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===za?_.prop(a,b,c):(1===f&&_.isXMLDoc(a)||(b=b.toLowerCase(),d=_.attrHooks[b]||(_.expr.match.bool.test(b)?eb:db)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=_.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void _.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(na);if(f&&1===a.nodeType)for(;c=f[e++];)d=_.propFix[c]||c,_.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!Y.radioValue&&"radio"===b&&_.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),eb={set:function(a,b,c){return b===!1?_.removeAttr(a,c):a.setAttribute(c,c),c}},_.each(_.expr.match.bool.source.match(/\w+/g),function(a,b){var c=fb[b]||_.find.attr;fb[b]=function(a,b,d){var e,f;return d||(f=fb[b],fb[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,fb[b]=f),e}});var gb=/^(?:input|select|textarea|button)$/i;_.fn.extend({prop:function(a,b){return qa(this,_.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[_.propFix[a]||a]})}}),_.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!_.isXMLDoc(a),f&&(b=_.propFix[b]||b,e=_.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||gb.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),Y.optSelected||(_.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){_.propFix[this.toLowerCase()]=this});var hb=/[\t\r\n\f]/g;_.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(_.isFunction(a))return this.each(function(b){_(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(na)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(hb," "):" ")){for(f=0;e=b[f++];)d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=_.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(_.isFunction(a))return this.each(function(b){_(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(na)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(hb," "):"")){for(f=0;e=b[f++];)for(;d.indexOf(" "+e+" ")>=0;)d=d.replace(" "+e+" "," ");g=a?_.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(_.isFunction(a)?function(c){_(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c)for(var b,d=0,e=_(this),f=a.match(na)||[];b=f[d++];)e.hasClass(b)?e.removeClass(b):e.addClass(b);else(c===za||"boolean"===c)&&(this.className&&ra.set(this,"__className__",this.className),this.className=this.className||a===!1?"":ra.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(hb," ").indexOf(b)>=0)return!0;return!1}});var ib=/\r/g;_.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=_.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,_(this).val()):a,null==e?e="":"number"==typeof e?e+="":_.isArray(e)&&(e=_.map(e,function(a){return null==a?"":a+""})),b=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=_.valHooks[e.type]||_.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ib,""):null==c?"":c)}}}),_.extend({valHooks:{option:{get:function(a){var b=_.find.attr(a,"value");return null!=b?b:_.trim(_.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(Y.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&_.nodeName(c.parentNode,"optgroup"))){if(b=_(c).val(),f)return b;g.push(b)}return g},set:function(a,b){for(var c,d,e=a.options,f=_.makeArray(b),g=e.length;g--;)d=e[g],(d.selected=_.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),_.each(["radio","checkbox"],function(){_.valHooks[this]={set:function(a,b){return _.isArray(b)?a.checked=_.inArray(_(a).val(),b)>=0:void 0}},Y.checkOn||(_.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),_.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){_.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),_.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var jb=_.now(),kb=/\?/;_.parseJSON=function(a){return JSON.parse(a+"")},_.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&_.error("Invalid XML: "+a),b};var lb,mb,nb=/#.*$/,ob=/([?&])_=[^&]*/,pb=/^(.*?):[ \t]*([^\r\n]*)$/gm,qb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rb=/^(?:GET|HEAD)$/,sb=/^\/\//,tb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,ub={},vb={},wb="*/".concat("*");try{mb=location.href}catch(xb){mb=Z.createElement("a"),mb.href="",mb=mb.href}lb=tb.exec(mb.toLowerCase())||[],_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:mb,type:"GET",isLocal:qb.test(lb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":_.parseJSON,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?L(L(a,_.ajaxSettings),b):L(_.ajaxSettings,a)},ajaxPrefilter:J(ub),ajaxTransport:J(vb),ajax:function(a,b){function c(a,b,c,g){var i,k,r,s,u,w=b;2!==t&&(t=2,h&&clearTimeout(h),d=void 0,f=g||"",v.readyState=a>0?4:0,i=a>=200&&300>a||304===a,c&&(s=M(l,v,c)),s=N(l,s,v,i),i?(l.ifModified&&(u=v.getResponseHeader("Last-Modified"),u&&(_.lastModified[e]=u),u=v.getResponseHeader("etag"),u&&(_.etag[e]=u)),204===a||"HEAD"===l.type?w="nocontent":304===a?w="notmodified":(w=s.state,k=s.data,r=s.error,i=!r)):(r=w,(a||!w)&&(w="error",0>a&&(a=0))),v.status=a,v.statusText=(b||w)+"",i?o.resolveWith(m,[k,w,v]):o.rejectWith(m,[v,w,r]),v.statusCode(q),q=void 0,j&&n.trigger(i?"ajaxSuccess":"ajaxError",[v,l,i?k:r]),p.fireWith(m,[v,w]),j&&(n.trigger("ajaxComplete",[v,l]),--_.active||_.event.trigger("ajaxStop")))}"object"==typeof a&&(b=a,a=void 0),b=b||{};var d,e,f,g,h,i,j,k,l=_.ajaxSetup({},b),m=l.context||l,n=l.context&&(m.nodeType||m.jquery)?_(m):_.event,o=_.Deferred(),p=_.Callbacks("once memory"),q=l.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!g)for(g={};b=pb.exec(f);)g[b[1].toLowerCase()]=b[2];b=g[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return d&&d.abort(b),c(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,l.url=((a||l.url||mb)+"").replace(nb,"").replace(sb,lb[1]+"//"),l.type=b.method||b.type||l.method||l.type,l.dataTypes=_.trim(l.dataType||"*").toLowerCase().match(na)||[""],null==l.crossDomain&&(i=tb.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]===lb[1]&&i[2]===lb[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(lb[3]||("http:"===lb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=_.param(l.data,l.traditional)),K(ub,l,b,v),2===t)return v;j=l.global,j&&0===_.active++&&_.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!rb.test(l.type),e=l.url,l.hasContent||(l.data&&(e=l.url+=(kb.test(e)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=ob.test(e)?e.replace(ob,"$1_="+jb++):e+(kb.test(e)?"&":"?")+"_="+jb++)),l.ifModified&&(_.lastModified[e]&&v.setRequestHeader("If-Modified-Since",_.lastModified[e]),_.etag[e]&&v.setRequestHeader("If-None-Match",_.etag[e])),(l.data&&l.hasContent&&l.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",l.contentType),v.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+wb+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)v.setRequestHeader(k,l.headers[k]);if(l.beforeSend&&(l.beforeSend.call(m,v,l)===!1||2===t))return v.abort();u="abort";for(k in{success:1,error:1,complete:1})v[k](l[k]);if(d=K(vb,l,b,v)){v.readyState=1,j&&n.trigger("ajaxSend",[v,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){v.abort("timeout")},l.timeout));try{t=1,d.send(r,c)}catch(w){if(!(2>t))throw w;c(-1,w)}}else c(-1,"No Transport");return v},getJSON:function(a,b,c){return _.get(a,b,c,"json")},getScript:function(a,b){return _.get(a,void 0,b,"script")}}),_.each(["get","post"],function(a,b){_[b]=function(a,c,d,e){return _.isFunction(c)&&(e=e||d,d=c,c=void 0),_.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),_.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){_.fn[b]=function(a){return this.on(b,a)}}),_._evalUrl=function(a){return _.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},_.fn.extend({wrapAll:function(a){var b;return _.isFunction(a)?this.each(function(b){_(this).wrapAll(a.call(this,b))}):(this[0]&&(b=_(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstElementChild;)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(_.isFunction(a)?function(b){_(this).wrapInner(a.call(this,b))}:function(){var b=_(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=_.isFunction(a);return this.each(function(c){_(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){_.nodeName(this,"body")||_(this).replaceWith(this.childNodes)}).end()}}),_.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},_.expr.filters.visible=function(a){return!_.expr.filters.hidden(a)};var yb=/%20/g,zb=/\[\]$/,Ab=/\r?\n/g,Bb=/^(?:submit|button|image|reset|file)$/i,Cb=/^(?:input|select|textarea|keygen)/i;_.param=function(a,b){var c,d=[],e=function(a,b){b=_.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=_.ajaxSettings&&_.ajaxSettings.traditional),_.isArray(a)||a.jquery&&!_.isPlainObject(a))_.each(a,function(){e(this.name,this.value)});else for(c in a)O(c,a[c],b,e);return d.join("&").replace(yb,"+")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=_.prop(this,"elements");return a?_.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!_(this).is(":disabled")&&Cb.test(this.nodeName)&&!Bb.test(a)&&(this.checked||!ya.test(a))}).map(function(a,b){var c=_(this).val();return null==c?null:_.isArray(c)?_.map(c,function(a){return{name:b.name,value:a.replace(Ab,"\r\n")}}):{name:b.name,value:c.replace(Ab,"\r\n")}}).get()}}),_.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Db=0,Eb={},Fb={0:200,1223:204},Gb=_.ajaxSettings.xhr();a.ActiveXObject&&_(a).on("unload",function(){for(var a in Eb)Eb[a]()}),Y.cors=!!Gb&&"withCredentials"in Gb,Y.ajax=Gb=!!Gb,_.ajaxTransport(function(a){var b;return Y.cors||Gb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Db;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Eb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Fb[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Eb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return _.globalEval(a),a}}}),_.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),_.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=_("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),Z.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Hb=[],Ib=/(=)\?(?=&|$)|\?\?/;_.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Hb.pop()||_.expando+"_"+jb++;return this[a]=!0,a}}),_.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ib.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ib.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=_.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ib,"$1"+e):b.jsonp!==!1&&(b.url+=(kb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||_.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Hb.push(e)),g&&_.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),_.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||Z;var d=ga.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=_.buildFragment([a],b,e),e&&e.length&&_(e).remove(),_.merge([],d.childNodes))};var Jb=_.fn.load;_.fn.load=function(a,b,c){if("string"!=typeof a&&Jb)return Jb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=_.trim(a.slice(h)),a=a.slice(0,h)),_.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&_.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?_("<div>").append(_.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},_.expr.filters.animated=function(a){return _.grep(_.timers,function(b){return a===b.elem}).length};var Kb=a.document.documentElement;_.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=_.css(a,"position"),l=_(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=_.css(a,"top"),i=_.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),_.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},_.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){_.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,_.contains(b,d)?(typeof d.getBoundingClientRect!==za&&(e=d.getBoundingClientRect()),c=P(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===_.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),_.nodeName(a[0],"html")||(d=a.offset()),d.top+=_.css(a[0],"borderTopWidth",!0),d.left+=_.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-_.css(c,"marginTop",!0),left:b.left-d.left-_.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||Kb;a&&!_.nodeName(a,"html")&&"static"===_.css(a,"position");)a=a.offsetParent;return a||Kb})}}),_.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;_.fn[b]=function(e){return qa(this,function(b,e,f){var g=P(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),_.each(["top","left"],function(a,b){_.cssHooks[b]=w(Y.pixelPosition,function(a,c){return c?(c=v(a,b),Qa.test(c)?_(a).position()[b]+"px":c):void 0})}),_.each({Height:"height",Width:"width"},function(a,b){_.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){_.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return qa(this,function(b,c,d){var e;return _.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?_.css(b,c,g):_.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),_.fn.size=function(){return this.length},_.fn.andSelf=_.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return _});var Lb=a.jQuery,Mb=a.$;return _.noConflict=function(b){return a.$===_&&(a.$=Mb),b&&a.jQuery===_&&(a.jQuery=Lb),_},typeof b===za&&(a.jQuery=a.$=_),_}),function(){var a,b,c,d;!function(){var e={},f={};a=function(a,b,c){e[a]={deps:b,callback:c}},d=c=b=function(a){function c(b){if("."!==b.charAt(0))return b;for(var c=b.split("/"),d=a.split("/").slice(0,-1),e=0,f=c.length;f>e;e++){var g=c[e];if(".."===g)d.pop();else{if("."===g)continue;d.push(g)}}return d.join("/")}if(d._eak_seen=e,f[a])return f[a];if(f[a]={},!e[a])throw new Error("Could not find module "+a);for(var g,h=e[a],i=h.deps,j=h.callback,k=[],l=0,m=i.length;m>l;l++)k.push("exports"===i[l]?g={}:b(c(i[l])));var n=j.apply(this,k);return f[a]=g||n}}(),a("promise/all",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to all.");return new b(function(b,c){function d(a){return function(b){f(a,b)}}function f(a,c){h[a]=c,0===--i&&b(h)}var g,h=[],i=a.length;0===i&&b([]);for(var j=0;j<a.length;j++)g=a[j],g&&e(g.then)?g.then(d(j),c):f(j,g)})}var d=a.isArray,e=a.isFunction;b.all=c}),a("promise/asap",["exports"],function(a){"use strict";function b(){return function(){process.nextTick(e)}}function c(){var a=0,b=new i(e),c=document.createTextNode("");return b.observe(c,{characterData:!0}),function(){c.data=a=++a%2}}function d(){return function(){j.setTimeout(e,1)}}function e(){for(var a=0;a<k.length;a++){var b=k[a],c=b[0],d=b[1];c(d)}k=[]}function f(a,b){var c=k.push([a,b]);1===c&&g()}var g,h="undefined"!=typeof window?window:{},i=h.MutationObserver||h.WebKitMutationObserver,j="undefined"!=typeof global?global:void 0===this?window:this,k=[];g="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?b():i?c():d(),a.asap=f}),a("promise/config",["exports"],function(a){"use strict";function b(a,b){return 2!==arguments.length?c[a]:void(c[a]=b)}var c={instrument:!1};a.config=c,a.configure=b}),a("promise/polyfill",["./promise","./utils","exports"],function(a,b,c){"use strict";function d(){var a;a="undefined"!=typeof global?global:"undefined"!=typeof window&&window.document?window:self;"Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;return new a.Promise(function(a){b=a}),f(b)}();a.Promise=e}var e=a.Promise,f=b.isFunction;c.polyfill=d}),a("promise/promise",["./config","./utils","./all","./race","./resolve","./reject","./asap","exports"],function(a,b,c,d,e,f,g,h){"use strict";function i(a){if(!v(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof i))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],j(a,this)}function j(a,b){function c(a){o(b,a)}function d(a){q(b,a)}try{a(c,d)}catch(e){d(e)}}function k(a,b,c,d){var e,f,g,h,i=v(c);if(i)try{e=c(d),g=!0}catch(j){h=!0,f=j}else e=d,g=!0;n(b,e)||(i&&g?o(b,e):h?q(b,f):a===D?o(b,e):a===E&&q(b,e))}function l(a,b,c,d){var e=a._subscribers,f=e.length;e[f]=b,e[f+D]=c,e[f+E]=d}function m(a,b){for(var c,d,e=a._subscribers,f=a._detail,g=0;g<e.length;g+=3)c=e[g],d=e[g+b],k(b,c,d,f);a._subscribers=null}function n(a,b){var c,d=null;try{if(a===b)throw new TypeError("A promises callback cannot return that same promise.");if(u(b)&&(d=b.then,v(d)))return d.call(b,function(d){return c?!0:(c=!0,void(b!==d?o(a,d):p(a,d)))},function(b){return c?!0:(c=!0,void q(a,b))}),!0}catch(e){return c?!0:(q(a,e),!0)}return!1}function o(a,b){a===b?p(a,b):n(a,b)||p(a,b)}function p(a,b){a._state===B&&(a._state=C,a._detail=b,t.async(r,a))}function q(a,b){a._state===B&&(a._state=C,a._detail=b,t.async(s,a))}function r(a){m(a,a._state=D)}function s(a){m(a,a._state=E)}var t=a.config,u=(a.configure,b.objectOrFunction),v=b.isFunction,w=(b.now,c.all),x=d.race,y=e.resolve,z=f.reject,A=g.asap;t.async=A;var B=void 0,C=0,D=1,E=2;i.prototype={constructor:i,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(a,b){var c=this,d=new this.constructor(function(){});if(this._state){var e=arguments;t.async(function(){k(c._state,d,e[c._state-1],c._detail)})}else l(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}},i.all=w,i.race=x,i.resolve=y,i.reject=z,h.Promise=i}),a("promise/race",["./utils","exports"],function(a,b){"use strict";function c(a){var b=this;if(!d(a))throw new TypeError("You must pass an array to race.");return new b(function(b,c){for(var d,e=0;e<a.length;e++)d=a[e],d&&"function"==typeof d.then?d.then(b,c):b(d)})}var d=a.isArray;b.race=c}),a("promise/reject",["exports"],function(a){"use strict";function b(a){var b=this;return new b(function(b,c){c(a)})}a.reject=b}),a("promise/resolve",["exports"],function(a){"use strict";function b(a){if(a&&"object"==typeof a&&a.constructor===this)return a;var b=this;return new b(function(b){b(a)})}a.resolve=b}),a("promise/utils",["exports"],function(a){"use strict";function b(a){return c(a)||"object"==typeof a&&null!==a}function c(a){return"function"==typeof a}function d(a){return"[object Array]"===Object.prototype.toString.call(a)}var e=Date.now||function(){return(new Date).getTime()};a.objectOrFunction=b,a.isFunction=c,a.isArray=d,a.now=e}),b("promise/polyfill").polyfill()}(),window.jQuery&&function(a){a.extend({xml2json:function(b,c){function d(b,g){if(!b)return null;var h="",i=null,j=null;b.nodeType,e(b.localName||b.nodeName),b.text||b.nodeValue||"";b.childNodes&&b.childNodes.length>0&&a.each(b.childNodes,function(a,b){var c=b.nodeType,g=e(b.localName||b.nodeName),j=b.text||b.nodeValue||"";if(8!=c)if(3!=c&&4!=c&&g)i=i||{},i[g]?(i[g].length||(i[g]=f(i[g])),i[g]=f(i[g]),i[g][i[g].length]=d(b,!0),i[g].length=i[g].length):i[g]=d(b);else{if(j.match(/^\s+$/))return;h+=j.replace(/^\s+/,"").replace(/\s+$/,"")}}),b.attributes&&b.attributes.length>0&&(j={},i=i||{},a.each(b.attributes,function(a,b){var c=e(b.name),d=b.value;j[c]=d,i[c]?(i[cnn]=f(i[cnn]),i[c][i[c].length]=d,i[c].length=i[c].length):i[c]=d})),i&&(i=a.extend(""!=h?new String(h):{},i||{}),h=i.text?[i.text||""].concat([h]):h,h&&(i.text=h),h="");var k=i||h;return c&&(h&&(k={}),h=k.text||h||"",h&&(k.text=h),g||(k=f(k))),k}if(!b)return{};var e=function(a){return String(a||"").replace(/-/g,"_")},f=function(b){return a.isArray(b)||(b=[b]),b.length=b.length,b};if("string"==typeof b&&(b=a.text2xml(b)),b.nodeType){if(3==b.nodeType||4==b.nodeType)return b.nodeValue;var g=9==b.nodeType?b.documentElement:b,h=d(g,!0);return b=null,g=null,h}},text2xml:function(b){return a.parseXML(b)}})}(jQuery),function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){function b(a){if(a in l.style)return a;for(var b=["Moz","Webkit","O","ms"],c=a.charAt(0).toUpperCase()+a.substr(1),d=0;d<b.length;++d){var e=b[d]+c;if(e in l.style)return e}}function c(){return l.style[m.transform]="",l.style[m.transform]="rotateY(90deg)",""!==l.style[m.transform]}function d(a){return"string"==typeof a&&this.parse(a),this}function e(a,b,c){b===!0?a.queue(c):b?a.queue(b,c):a.each(function(){c.call(this)})}function f(b){var c=[];return a.each(b,function(b){b=a.camelCase(b),b=a.transit.propertyMap[b]||a.cssProps[b]||b,b=i(b),m[b]&&(b=i(m[b])),-1===a.inArray(b,c)&&c.push(b)}),c}function g(b,c,d,e){var g=f(b);a.cssEase[d]&&(d=a.cssEase[d]);var h=""+k(c)+" "+d;parseInt(e,10)>0&&(h+=" "+k(e));var i=[];return a.each(g,function(a,b){i.push(b+" "+h)}),i.join(", ")}function h(b,c){c||(a.cssNumber[b]=!0),a.transit.propertyMap[b]=m.transform,a.cssHooks[b]={get:function(c){var d=a(c).css("transit:transform");return d.get(b)},set:function(c,d){var e=a(c).css("transit:transform");e.setFromString(b,d),a(c).css({"transit:transform":e})}}}function i(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function j(a,b){return"string"!=typeof a||a.match(/^[\-0-9\.]+$/)?""+a+b:a}function k(b){var c=b;return"string"!=typeof c||c.match(/^[\-0-9\.]+/)||(c=a.fx.speeds[c]||a.fx.speeds._default),j(c,"ms")}a.transit={version:"0.9.12",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:!0,useTransitionEnd:!1};var l=document.createElement("div"),m={},n=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;m.transition=b("transition"),m.transitionDelay=b("transitionDelay"),m.transform=b("transform"),m.transformOrigin=b("transformOrigin"),m.filter=b("Filter"),m.transform3d=c();var o={transition:"transitionend",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"},p=m.transitionEnd=o[m.transition]||null;for(var q in m)m.hasOwnProperty(q)&&"undefined"==typeof a.support[q]&&(a.support[q]=m[q]);return l=null,a.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeInCubic:"cubic-bezier(.550,.055,.675,.190)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"},a.cssHooks["transit:transform"]={get:function(b){return a(b).data("transform")||new d},set:function(b,c){var e=c;e instanceof d||(e=new d(e)),"WebkitTransform"!==m.transform||n?b.style[m.transform]=e.toString():b.style[m.transform]=e.toString(!0),a(b).data("transform",e)}},a.cssHooks.transform={set:a.cssHooks["transit:transform"].set},a.cssHooks.filter={get:function(a){return a.style[m.filter]},set:function(a,b){a.style[m.filter]=b}},a.fn.jquery<"1.8"&&(a.cssHooks.transformOrigin={get:function(a){return a.style[m.transformOrigin]},set:function(a,b){a.style[m.transformOrigin]=b}},a.cssHooks.transition={get:function(a){return a.style[m.transition]},set:function(a,b){a.style[m.transition]=b}}),h("scale"),h("scaleX"),h("scaleY"),h("translate"),h("rotate"),h("rotateX"),h("rotateY"),h("rotate3d"),h("perspective"),h("skewX"),h("skewY"),h("x",!0),h("y",!0),d.prototype={setFromString:function(a,b){var c="string"==typeof b?b.split(","):b.constructor===Array?b:[b];c.unshift(a),d.prototype.set.apply(this,c)},set:function(a){var b=Array.prototype.slice.apply(arguments,[1]);this.setter[a]?this.setter[a].apply(this,b):this[a]=b.join(",");
  12. },get:function(a){return this.getter[a]?this.getter[a].apply(this):this[a]||0},setter:{rotate:function(a){this.rotate=j(a,"deg")},rotateX:function(a){this.rotateX=j(a,"deg")},rotateY:function(a){this.rotateY=j(a,"deg")},scale:function(a,b){void 0===b&&(b=a),this.scale=a+","+b},skewX:function(a){this.skewX=j(a,"deg")},skewY:function(a){this.skewY=j(a,"deg")},perspective:function(a){this.perspective=j(a,"px")},x:function(a){this.set("translate",a,null)},y:function(a){this.set("translate",null,a)},translate:function(a,b){void 0===this._translateX&&(this._translateX=0),void 0===this._translateY&&(this._translateY=0),null!==a&&void 0!==a&&(this._translateX=j(a,"px")),null!==b&&void 0!==b&&(this._translateY=j(b,"px")),this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var a=(this.scale||"1,1").split(",");return a[0]&&(a[0]=parseFloat(a[0])),a[1]&&(a[1]=parseFloat(a[1])),a[0]===a[1]?a[0]:a},rotate3d:function(){for(var a=(this.rotate3d||"0,0,0,0deg").split(","),b=0;3>=b;++b)a[b]&&(a[b]=parseFloat(a[b]));return a[3]&&(a[3]=j(a[3],"deg")),a}},parse:function(a){var b=this;a.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(a,c,d){b.setFromString(c,d)})},toString:function(a){var b=[];for(var c in this)if(this.hasOwnProperty(c)){if(!m.transform3d&&("rotateX"===c||"rotateY"===c||"perspective"===c||"transformOrigin"===c))continue;"_"!==c[0]&&b.push(a&&"scale"===c?c+"3d("+this[c]+",1)":a&&"translate"===c?c+"3d("+this[c]+",0)":c+"("+this[c]+")")}return b.join(" ")}},a.fn.transition=a.fn.transit=function(b,c,d,f){var h=this,i=0,j=!0,l=a.extend(!0,{},b);"function"==typeof c&&(f=c,c=void 0),"object"==typeof c&&(d=c.easing,i=c.delay||0,j="undefined"==typeof c.queue?!0:c.queue,f=c.complete,c=c.duration),"function"==typeof d&&(f=d,d=void 0),"undefined"!=typeof l.easing&&(d=l.easing,delete l.easing),"undefined"!=typeof l.duration&&(c=l.duration,delete l.duration),"undefined"!=typeof l.complete&&(f=l.complete,delete l.complete),"undefined"!=typeof l.queue&&(j=l.queue,delete l.queue),"undefined"!=typeof l.delay&&(i=l.delay,delete l.delay),"undefined"==typeof c&&(c=a.fx.speeds._default),"undefined"==typeof d&&(d=a.cssEase._default),c=k(c);var n=g(l,c,d,i),o=a.transit.enabled&&m.transition,q=o?parseInt(c,10)+parseInt(i,10):0;if(0===q){var r=function(a){h.css(l),f&&f.apply(h),a&&a()};return e(h,j,r),h}var s={},t=function(b){var c=!1,d=function(){c&&h.unbind(p,d),q>0&&h.each(function(){this.style[m.transition]=s[this]||null}),"function"==typeof f&&f.apply(h),"function"==typeof b&&b()};q>0&&p&&a.transit.useTransitionEnd?(c=!0,h.bind(p,d)):window.setTimeout(d,q),h.each(function(){q>0&&(this.style[m.transition]=n),a(this).css(l)})},u=function(a){this.offsetWidth,t(a)};return e(h,j,u),this},a.transit.getTransitionValue=g,a});var jhtmls="undefined"==typeof exports?jhtmls||{}:exports;void function(a){"use strict";function b(a){return String(a).replace(/["<>& ]/g,function(a){return"&"+e[a]+";"})}function c(a){var b=[];return b.push("with(this){"),b.push(a.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g,function(a){return['!#{unescape("',escape(a),'")}'].join("")}).replace(/[\r\n]+/g,"\n").replace(/^\n+|\s+$/gm,"").replace(/^([ \w\t_$]*([^&\^?|\n\w\/'"{}\[\]+\-():; \t=\.$_]|:\/\/).*$|^(?!\s*(else|do|try|finally|void|typeof\s[\w$_]*)\s*$)[^'":;{}()\n|=&\/^?]+$)\s?/gm,function(a){return a=a.replace(/&none;/g,"").replace(/["'\\]/g,"\\$&").replace(/\n/g,"\\n").replace(/(!?#)\{(.*?)\}|(!?\$)([a-z_]+\w*(?:\.[a-z_]+\w*)*)/g,function(a,b,c,d,e){if(d&&(b=d,c=e),!c)return"";c=c.replace(/\\n/g,"\n").replace(/\\([\\'"])/g,"$1");var f=/^[a-z$][\w+$]+$/i.test(c)&&!/^(true|false|NaN|null|this)$/.test(c);return["',",f?["typeof ",c,"==='undefined'?'':"].join(""):"","#"===b||"$"===b?"_encode_":"","(",c,"),'"].join("")}),a=["'",a,"'"].join("").replace(/^'',|,''$/g,""),a?["_output_.push(",a,");"].join(""):""})),b.push("}"),new Function("_output_","_encode_","helper","jhtmls",b.join(""))}function d(d,e,f){"function"==typeof d&&(d=String(d).replace(/^[^\{]*\{\s*\/\*!?[ \f\t\v]*\n?|[ \f\t\v]*\*\/[;|\s]*\}$/g,""));var g=c(d),h=function(c,d){d=d||a;var e=[];return g.call(c,e,b,d,a),e.join("")};return arguments.length<=1?h:h(e,f)}var e={'"':"quot","<":"lt",">":"gt","&":"amp"," ":"nbsp"};a.render=d}(jhtmls),function(){function use(a){_p.r([moduleMapping[a]])}var _p={r:function(a){if(_p[a].inited)return _p[a].value;if("function"!=typeof _p[a].value)return _p[a].inited=!0,_p[a].value;var b={exports:{}},c=_p[a].value(null,b.exports,b);if(_p[a].inited=!0,_p[a].value=c,void 0!==c)return c;for(var d in b.exports)if(b.exports.hasOwnProperty(d))return _p[a].inited=!0,_p[a].value=b.exports,b.exports}};_p[0]={value:function(a){function b(a){var b=e[a.clazz];return b?new b(a):null}var c={},d=_p.r(4),e=_p.r(11);return d.extend(c,{parse:function(a){var c=[];return d.isArray(a)?(d.each(a,function(a,d){c.push(b(d))}),c):b(a)}}),c}},_p[1]={value:function(a){var b=_p.r(11);b.___register({ALLOW_FOCUS:!0}),b.___register({Widget:_p.r(60),Icon:_p.r(42),Label:_p.r(48),Button:_p.r(37),ToggleButton:_p.r(59),Buttonset:_p.r(36),Separator:_p.r(56),Item:_p.r(46),Input:_p.r(45),InputButton:_p.r(43),Mask:_p.r(49),ColorPicker:_p.r(38),Tabs:_p.r(58),SpinButton:_p.r(57),Container:_p.r(39),Panel:_p.r(51),PPanel:_p.r(54),LabelPanel:_p.r(47),Menu:_p.r(50),InputMenu:_p.r(44),ButtonMenu:_p.r(34),DropPanel:_p.r(41),Popup:_p.r(53),PopupMenu:_p.r(52),SelectMenu:_p.r(55),Dialog:_p.r(40),Utils:_p.r(13),Creator:_p.r(0)}),b.__export()}},_p[2]={value:function(a){var b=_p.r(11);b.___register({TablePicker:_p.r(17)})}},_p[3]={value:function(){return jhtmls}},_p[4]={value:function(a){return window.jQuery}},_p[5]={value:function(require,exports){function Class(){}function checkBaseConstructorCall(a,b){var c=a.toString();if(!/this\.callBase/.test(c))throw new Error(b+" : 类构造函数没有调用父类的构造函数!为了安全,请调用父类的构造函数")}function inherit(constructor,BaseClass,classname){var KityClass=eval("(function "+classname+"( __inherit__flag ) {if( __inherit__flag != KITY_INHERIT_FLAG ) {KityClass.__KityConstructor.apply(this, arguments);}this.__KityClassName = KityClass.__KityClassName;})||0");KityClass.__KityConstructor=constructor,KityClass.prototype=new BaseClass(KITY_INHERIT_FLAG);for(var methodName in BaseClass.prototype)BaseClass.prototype.hasOwnProperty(methodName)&&0!==methodName.indexOf("__Kity")&&(KityClass.prototype[methodName]=BaseClass.prototype[methodName]);return KityClass.prototype.constructor=KityClass,KityClass}function mixin(a,b){if(!1==b instanceof Array)return a;var c,d,e,f=b.length;for(a.__KityMixins={constructor:[]},c=0;f>c;c++){d=b[c].prototype;for(e in d)!1!==d.hasOwnProperty(e)&&0!==e.indexOf("__Kity")&&("constructor"===e?a.__KityMixins.constructor.push(d[e]):a.prototype[e]=a.__KityMixins[e]=d[e])}return a}function extend(a,b){b.__KityClassName&&(b=b.prototype);for(var c in b)if(b.hasOwnProperty(c)&&c.indexOf("__Kity")&&"constructor"!=c){var d=a.prototype[c]=b[c];d.__KityMethodClass=a,d.__KityMethodName=c}return a}Function.prototype.bind=Function.prototype.bind||function(a){var b=Array.prototype.slice.call(arguments,1);return this.apply(a,b)},Class.__KityClassName="Class",Class.prototype.base=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityBaseClass.prototype[a];return c.apply(this,Array.prototype.slice.call(arguments,1))},Class.prototype.callBase=function(){var a=arguments.callee.caller,b=a.__KityMethodClass.__KityBaseClass.prototype[a.__KityMethodName];return b.apply(this,arguments)},Class.prototype.mixin=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[a];return d.apply(this,Array.prototype.slice.call(arguments,1))},Class.prototype.callMixin=function(){var a=arguments.callee.caller,b=a.__KityMethodName,c=a.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[b];if("constructor"==b){for(var e=0,f=d.length;f>e;e++)d[e].call(this);return this}return d.apply(this,arguments)},Class.prototype.pipe=function(a){return"function"==typeof a&&a.call(this,this),this},Class.prototype.getType=function(){return this.__KityClassName},Class.prototype.getClass=function(){return this.constructor};var KITY_INHERIT_FLAG="__KITY_INHERIT_FLAG_"+ +new Date;Class.prototype._accessProperty=function(){return this._propertyRawData||(this._propertyRawData={})},exports.createClass=function(a,b){var c,d,e;return 1===arguments.length&&(b=arguments[0],a="AnonymousClass"),e=b.base||Class,b.hasOwnProperty("constructor")?(c=b.constructor,e!=Class&&checkBaseConstructorCall(c,a)):c=function(){this.callBase.apply(this,arguments),this.callMixin.apply(this,arguments)},d=inherit(c,e,a),d=mixin(d,b.mixins),d.__KityClassName=c.__KityClassName=a,d.__KityBaseClass=c.__KityBaseClass=e,d.__KityMethodName=c.__KityMethodName="constructor",d.__KityMethodClass=c.__KityMethodClass=d,delete b.mixins,delete b.constructor,delete b.base,d=extend(d,b)},exports.extendClass=extend}},_p[6]={value:function(a){var b=_p.r(4),c="__fui__marker__"+ +new Date;return{isElement:function(a){return 1===a.nodeType},getMarker:function(){return c},getRect:function(a){var b=a.getBoundingClientRect();return{width:b.width,height:b.height,top:b.top,bottom:b.bottom,left:b.left,right:b.right}},getBound:function(a){var c=0,d=0;return"body"===a.tagName.toLowerCase()?(d=b(this.getView(a)),c=d.width(),d=d.height(),{top:0,left:0,bottom:d,right:c,width:c,height:d}):this.getRect(a)},getView:function(a){return a.ownerDocument.defaultView||a.ownerDocument.parentWindow}}}},_p[7]={value:function(a){var b=_p.r(3),c=_p.r(4),d={forEach:function(a,b){c.each(a,function(a,c){b.call(null,a,c)})}};return{compile:function(a,e){return a=c.trim(a),0===a.length?"":b.render(a,e,d)}}}},_p[8]={value:function(a,b){function c(a){this.__options=d.extend({},f,a),this.__started=!1,this.__point={x:0,y:0},this.__location={x:0,y:0},this.__range={top:0,left:0,bottom:0,right:0}}var d=_p.r(4),e=_p.r(6),f={handler:null,target:null,axis:"all",range:null};return d.extend(c.prototype,{bind:function(a){if(a&&(this.__options.target=a),!this.__options.target)throw new Error("target unset");this.__target=this.__options.target,this.__handler=this.__options.handler,this.__rangeNode=this.__options.range,this.__initOptions(),this.__initEnv(),this.__initEvent()},__initEvent:function(){var a=this.__handler,b=this;d(a).on("mousedown",function(c){if(1===c.which){var d=e.getRect(a);c.preventDefault(),b.__started=!0,b.__point={x:c.clientX,y:c.clientY},b.__location={x:d.left,y:d.top},b.__range=b.__getRange()}}),d(a.ownerDocument).on("mousemove",function(a){if(b.__started){var c=a.clientX,d=a.clientY;b.__allowAxisX&&b.__xMove(c),b.__allowAxisY&&b.__yMove(d)}}).on("mouseup",function(a){b.__started=!1})},__xMove:function(a){var b=a-this.__point.x;b=this.__location.x+b,b<this.__range.left?b=this.__range.left:b>this.__range.right&&(b=this.__range.right),this.__target.style.left=b+"px"},__yMove:function(a){var b=a-this.__point.y;b=this.__location.y+b,b<this.__range.top?b=this.__range.top:b>this.__range.bottom&&(b=this.__range.bottom),this.__target.style.top=b+"px"},__initEnv:function(){var a=d(this.__handler);a.css("cursor","move")},__initOptions:function(){this.__handler||(this.__handler=this.__target),this.__rangeNode||(this.__rangeNode=this.__options.target.ownerDocument.body),this.__allowAxisX="y"!==this.__options.axis,this.__allowAxisY="x"!==this.__options.axis},__getRange:function(){var a=this.__rangeNode,b=e.getRect(this.__target);return"body"===a.tagName.toLowerCase()?(a=d(this.__rangeNode.ownerDocument),a={top:0,left:0,bottom:a.height(),right:a.width()}):a=e.getRect(a),{top:a.top,left:a.left,bottom:a.bottom-b.height,right:a.right-b.width}}}),function(a){return new c(a)}}},_p[9]={value:function(a){function b(a){var e=!1,f=!1,g=null;return 1===arguments.length?c(a):(d.each([].slice.call(arguments,1),function(c,h){for(var i in h)g=h[i],h.hasOwnProperty(i)&&(e=d.isPlainObject(g),f=d.isArray(g),e||f?e?(d.isPlainObject(a[i])||(a[i]={}),a[i]=b(a[i],g)):f&&(a[i]=b(g)):a[i]=h[i])}),a)}function c(a){var e=null;return d.isPlainObject(a)?b({},a):d.isArray(a)?(e=[],d.each(a,function(a,b){e.push(d.isPlainObject(b)||d.isArray(b)?c(b):b)}),e):a}var d=_p.r(4);return b}},_p[10]={value:function(a){return{isContainer:function(a){return"container"===a.__widgetType}}}},_p[11]={value:function(){var a={};return{widgets:a,__export:function(){window.FUI=this},___register:function(a,b){if("string"==typeof a)this[a]=b;else{b=a;for(var c in b)b.hasOwnProperty(c)&&(this[c]=b[c])}},__registerInstance:function(b){a[b.getId()]=b}}}},_p[12]={value:function(a){var b=_p.r(11);return{classPrefix:"fui-",layout:{TOP:"top",LEFT:"left",BOTTOM:"bottom",RIGHT:"right",CENTER:"center",MIDDLE:"middle",LEFT_TOP:"left-top",RIGHT_TOP:"right-top",LEFT_BOTTOM:"left-bottom",RIGHT_BOTTOM:"right-bottom"},allowFocus:!!b.ALLOW_FOCUS,control:{input:1,textarea:1,button:1,select:1,option:1,object:1,embed:1}}}},_p[13]={value:function(a){var b=_p.r(4),c={Tpl:_p.r(7),Widget:_p.r(10),createDraggable:_p.r(8)};return b.extend(c,_p.r(6),_p.r(5))}},_p[14]={value:function(){return'<div unselectable="on" class="fui-t-picker"></div>\n'}},_p[15]={value:function(){return'<div unselectable="on" class="fui-table-picker"></div>\n'}},_p[16]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(14);return _p.r(13).createClass("TPicker",{base:_p.r(60),constructor:function(a){var c={row:10,col:10};a=b.extend({},c,a),this.callBase(a)},__initOptions:function(){this.callBase(),this.widgetName="TPicker",this.__tpl=d,this.__backplane=null},__render:function(){this.callBase(),this.__backplane=this.__createBackplane(),this.__element.appendChild(this.__backplane)},__initEvent:function(){var a=this,c={};this.callBase(),b(this.__backplane).delegate("td","mousemove",function(b){c=b.target.getAttribute("data-index").split(","),c={row:parseInt(c[0],10),col:parseInt(c[1],10)},a.__update(c.row,c.col)}),b(this.__backplane).on("click",function(b){a.__select(c.row,c.col)})},__select:function(a,b){this.trigger("pickerselect",{row:a,col:b})},__update:function(a,b){for(var d=null,e=this.__options.row,f=this.__options.col,g=c.classPrefix+"table-picker-hoverin",h=0;e>h;h++){d=this.__backplane.rows[h];for(var i=0;f>i;i++)a>=h&&b>=i?d.cells[i].className=g:d.cells[i].className=""}this.trigger("pickerhover",{row:a,col:b})},__createBackplane:function(){for(var a=[],d=null,e=0,f=this.__options.row;f>e;e++){d=[];for(var g=0,h=this.__options.col;h>g;g++)d.push('<td data-index="'+e+","+g+'"></td>');a.push("<tr>"+d.join("")+"</tr>")}return a=b("<table><tbody>"+a.join("")+"</tbody></table>"),a.addClass(c.classPrefix+"t-picker-table"),a[0]}})}},_p[17]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(15),e=_p.r(48),f=_p.r(16),g=_p.r(37),h=_p.r(54),i=_p.r(49);return _p.r(13).createClass("TablePicker",{base:_p.r(60),constructor:function(a){var c={button:null,row:10,col:10};a=b.extend({},c,a),this.callBase(a)},open:function(){this.__panelWidget.show(),this.__maskWidget.show()},close:function(){this.__panelWidget.hide(),this.__maskWidget.hide()},appendTo:function(a){a.appendChild(this.__buttonWidget.getElement())},getButton:function(){return this.__buttonWidget},__initOptions:function(){this.callBase(),this.widgetName="TablePicker",this.__tpl=d,this.__pickerWidget=null,this.__labelWidget=null,this.__buttonWidget=null,this.__panelWidget=null,this.__maskWidget=null},__render:function(){this.callBase(),this.__pickerWidget=new f(this.__options),this.__labelWidget=new e({text:"插入表格"}),this.__buttonWidget=new g(this.__options.button),this.__panelWidget=new h({className:c.classPrefix+"table-picker-panel",column:!0,resize:"none"}),this.__maskWidget=new i,this.__panelWidget.appendWidget(this.__labelWidget),this.__panelWidget.appendWidget(this.__pickerWidget),this.__panelWidget.positionTo(this.__buttonWidget)},__initEvent:function(){var a=this;this.callBase(),this.__buttonWidget.on("btnclick",function(b){a.open()}),this.__maskWidget.on("maskclick",function(b){a.close()}),this.__pickerWidget.on("pickerhover",function(b,c){var d=c.row+1,e=c.col+1;a.__labelWidget.setText(d+"x"+e+" 表格")}).on("pickerselect",function(b,c){var d=c.row+1,e=c.col+1;a.close(),a.trigger("pickerselect",{row:d,col:e})})},__createBackplane:function(){for(var a=[],d=null,e=0,f=this.__options.row;f>e;e++){d=[];for(var g=0,h=this.__options.col;h>g;g++)d.push('<td data-index="'+e+","+g+'"></td>');a.push("<tr>"+d.join("")+"</tr>")}return a=b("<table><tbody>"+a.join("")+"</tbody></table>"),a.addClass(c.classPrefix+"t-picker-table"),a[0]}})}},_p[18]={value:function(){return'<div unselectable="on" class="fui-button-menu"></div>\n'}},_p[19]={value:function(){return'<div unselectable="on" class="fui-button"></div>\n'}},_p[20]={value:function(){return'<div unselectable="on" class="fui-colorpicker-container">\n<div unselectable="on" class="fui-colorpicker-toolbar">\n<div unselectable="on" class="fui-colorpicker-preview"></div>\n<div unselectable="on" class="fui-colorpicker-clear">$clearText</div>\n</div>\n<div unselectable="on" class="fui-colorpicker-title">$commonText</div>\n<div unselectable="on" class="fui-colorpicker-commoncolor">\nhelper.forEach( commonColor, function ( index, colors ) {\n<div unselectable="on" class="fui-colorpicker-colors fui-colorpicker-colors-line$index">\nhelper.forEach( colors, function( i, color ) {\n<span unselectable="on" class="fui-colorpicker-item" style="background-color: $color; border-color: #{color.toLowerCase() == \'#ffffff\' ? \'#eeeeee\': color};" data-color="$color"></span>\n});\n</div>\n} );\n</div>\n<div unselectable="on" class="fui-colorpicker-title">$standardText</div>\n<div unselectable="on" class="fui-colorpicker-standardcolor fui-colorpicker-colors">\nhelper.forEach( standardColor, function ( i, color ) {\n<span unselectable="on" class="fui-colorpicker-item" style="background-color: $color; border-color: $color;" data-color="$color"></span>\n} );\n</div>\n</div>\n'}},_p[21]={value:function(){return'<div unselectable="on" class="fui-dialog-wrap">\n<div unselectable="on" class="fui-dialog-head">\n<h1 unselectable="on" class="fui-dialog-caption">$caption</h1>\n</div>\n<div unselectable="on" class="fui-dialog-body"></div>\n<div unselectable="on" class="fui-dialog-foot"></div>\n</div>\n'}},_p[22]={value:function(){return"<div unselectable=\"on\" class=\"fui-drop-panel\" #{ text ? 'title=\"' + m.text + '\"' : '' }></div>\n"}},_p[23]={value:function(){return'<div unselectable="on" class="fui-icon" >\nif ( this.img ) {\n<img unselectable="on" src="#{this.img}" >\n}\n</div>\n'}},_p[24]={value:function(){return'<div unselectable="on" class="fui-input-button"></div>\n'}},_p[25]={value:function(){return'<div unselectable="on" class="fui-input-menu"></div>\n'}},_p[26]={value:function(){return'<input unselectable="on" class="fui-input" autocomplete="off" !#{ value ? \'value="\' + value + \'"\' : \'\'}>\n'}},_p[27]={value:function(){return"<div unselectable=\"on\" class=\"fui-item!#{ selected ? ' fui-item-selected': '' }\" ></div>\n"}},_p[28]={value:function(){return'<div unselectable="on" class="fui-label">$text</div>\n'}},_p[29]={value:function(){return'<div unselectable="on" class="fui-mask" style="background-color: $bgcolor; opacity: $opacity;"></div>\n'}},_p[30]={value:function(){return'<div unselectable="on" class="fui-panel"></div>\n'}},_p[31]={value:function(){return'<div unselectable="on" class="fui-separator"></div>\n'}},_p[32]={value:function(){return'<div unselectable="on" class="fui-spin-button"></div>\n'}},_p[33]={value:function(){return'<div unselectable="on" class="fui-tabs">\n<div unselectable="on" class="fui-tabs-button-wrap"></div>\n<div unselectable="on" class="fui-tabs-panel-wrap"></div>\n</div>\n'}},_p[34]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(18),e=_p.r(37),f=_p.r(50),g=_p.r(49),h=c.layout;return _p.r(13).createClass("ButtonMenu",{base:_p.r(60),constructor:function(a){var c={menu:null,mask:null,buttons:[],selected:-1,layout:h.RIGHT};a=b.extend({},c,a),this.callBase(a)},open:function(){this.__openState=!0,this.__maskWidget.show(),this.__menuWidget.show(),this.addClass(c.classPrefix+"button-active")},close:function(){this.__openState=!1,this.__maskWidget.hide(),this.__menuWidget.hide(),this.removeClass(c.classPrefix+"button-active")},isOpen:function(){return!!this.__openState},getSelected:function(){return this.__menuWidget.getSelected()},getSelectedItem:function(){return this.__menuWidget.getSelectedItem()},getValue:function(){return this.getSelectedItem().getValue()},__render:function(){this.callBase(),this.__initButtons(),this.__menuWidget=new f(this.__options.menu),this.__maskWidget=new g(this.__options.mask),this.__menuWidget.positionTo(this.__element),this.__menuWidget.appendTo(this.__element.ownerDocument.body)},__initOptions:function(){this.callBase(),this.widgetName="ButtonMenu",this.__tpl=d,this.__buttonWidgets=null,this.__menuWidget=null,this.__maskWidget=null,this.__openState=!1,-1!==this.__options.selected&&(this.__options.menu.selected=this.__options.selected)},__initButtons:function(){var a=[],d=this.__element,f=null,g=this.__options.buttons.length-1;this.__options.layout===h.TOP||this.__options.layout===h.LEFT?(f=new e(this.__options.buttons[g]),f.appendTo(d)):g=-1,b.each(this.__options.buttons,function(b,c){if(g!==b){var h=new e(c);h.appendTo(d),a.push(h)}else a.push(f)}),this.addClass(c.classPrefix+"layout-"+this.__options.layout),a[a.length-1].addClass(c.classPrefix+"open-btn"),this.__buttonWidgets=a},__initEvent:function(){var a=this.__buttonWidgets[this.__buttonWidgets.length-1],c=this;this.callBase(),a.on("click",function(a){c.open()}),this.__maskWidget.on("maskclick",function(){c.close()}),this.__menuWidget.on("select",function(a,b){a.stopPropagation(),c.close(),c.trigger("select",b)}).on("change",function(a,b){c.trigger("change",b)}),this.on("btnclick",function(a){a.stopPropagation();var c=b.inArray(a.widget,this.__buttonWidgets);c>-1&&c<this.__buttonWidgets.length-1&&this.trigger("buttonclick",{button:this.__buttonWidgets[c]})})}})}},_p[35]={value:function(a){var b=_p.r(4),c=_p.r(25),d=_p.r(43),e=_p.r(50),f=_p.r(49),g=_p.r(13);return _p.r(13).createClass("InputMenu",{base:_p.r(60),constructor:function(a){var b=g.getMarker();this.callBase(b);var d={input:null,menu:null,mask:null};this.__extendOptions(d,a),this.widgetName="InputMenu",this.__tpl=c,this.__lastTime=0,this.__lastSelect=null,this.__inputWidget=null,this.__menuWidget=null,this.__maskWidget=null,this.__menuState=!1,a!==b&&this.__render()},select:function(a){this.__menuWidget.select(a)},setValue:function(a){return this.__inputWidget.setValue(a),this},getValue:function(){return this.__inputWidget.getValue()},__render:function(){return this.__rendered?this:(this.__inputWidget=new d(this.__options.input),this.__menuWidget=new e(this.__options.menu),this.__maskWidget=new f(this.__options.mask),this.callBase(),this.__inputWidget.appendTo(this.__element),this.__menuWidget.positionTo(this.__inputWidget),void this.__initInputMenuEvent())},open:function(){this.__maskWidget.show(),this.__menuWidget.show()},close:function(){this.__maskWidget.hide(),this.__menuWidget.hide()},__initInputMenuEvent:function(){var a=this;this.on("buttonclick",function(){this.__menuState||(this.__appendMenu(),this.__menuState=!0),this.__inputWidget.unfocus(),this.open()}),this.on("keypress",function(a){this.__lastTime=new Date}),this.on("keyup",function(a){8!==a.keyCode&&13!==a.keyCode&&new Date-this.__lastTime<500&&this.__update()}),this.on("inputcomplete",function(){this.__inputWidget.selectRange(99999999),this.__inputComplete()}),this.__menuWidget.on("select",function(b,c){b.stopPropagation(),a.setValue(c.value),a.trigger("select",c),a.close()}),this.__menuWidget.on("change",function(b,c){b.stopPropagation(),a.trigger("change",c)}),this.__inputWidget.on("select change",function(a){a.stopPropagation()}),this.__maskWidget.on("maskclick",function(){a.close()}),this.on("select",function(a,b){this.__lastSelect=b})},__update:function(){var a=this.getValue(),c=a.toLowerCase(),d=this.__getItemValues(),e=null;a&&(b.each(d,function(a,b){return 0===b.toLowerCase().indexOf(c)?(e=b,!1):void 0}),e&&(this.__inputWidget.setValue(e),this.__inputWidget.selectRange(a.length)))},__getItemValues:function(){var a=[];return b.each(this.__menuWidget.getWidgets(),function(b,c){a.push(c.getValue())}),a},__inputComplete:function(){var a=this.__getItemValues(),c=-1,d=this.getValue(),e=this.__lastSelect;b.each(a,function(a,b){return b===d?(c=a,!1):void 0}),this.trigger("select",{index:c,value:d}),e&&e.value===d||this.trigger("change",{from:e||{index:-1,value:null},to:{index:c,value:d}})},__appendMenu:function(){this.__menuWidget.appendTo(this.__inputWidget.getElement().ownerDocument.body)}})}},_p[36]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(59);return _p.r(13).createClass("Buttonset",{base:_p.r(51),constructor:function(a){var c={selected:-1};a=b.extend({},c,a),this.callBase(a)},getButtons:function(){return this.getWidgets()},getButton:function(a){return this.getWidgets()[a]||null},getValue:function(){return this.__currentIndex>-1?this.__widgets[this.__currentIndex].getValue():null},getSelectedIndex:function(){return this.__currentIndex},appendButton:function(){return this.appendWidget.apply(this,arguments)},insertButton:function(){return this.insertWidget.apply(this,arguments)},select:function(a){return this.__options.disabled?this:(a instanceof d&&(a=b.inArray(a,this.__widgets)),0>a?this.clearSelect():(a=this.__widgets[a],this.__pressButton(a),this))},selectByValue:function(a){var b=this.__widgets.map(function(a){return a.getValue()});return this.select(b.indexOf(a))},clearSelect:function(){return this.__pressButton(null),this},removeButton:function(){return this.removeWidget.apply(this,arguments)},insertWidget:function(a,b){var c=this.callBase(a,b);return null===c?c:(a<=this.__currentIndex&&this.__currentIndex++,a<=this.__prevIndex&&this.__prevIndex++,c)},removeWidget:function(a){var b=a;return"number"!=typeof b&&(b=this.indexOf(a)),a=this.callBase(a),b===this.__currentIndex?this.__currentIndex=-1:b<this.__currentIndex&&this.__currentIndex--,b===this.__prevIndex?this.__prevIndex=-1:b<this.__prevIndex&&this.__prevIndex--,a},__initOptions:function(){this.callBase(),this.widgetName="Buttonset",this.__currentIndex=this.__options.selected,this.__prevIndex=-1},__render:function(){return this.callBase(),b(this.__element).addClass(c.classPrefix+"buttonset"),this.__initButtons(),this},__initButtons:function(){var a=this,c=null;b.each(this.__options.buttons,function(e,f){c=new d(b.extend({},f,{pressed:e===a.__options.selected,preventDefault:!0})),c.__on("click",function(b){a.isDisabled()||a.__pressButton(this)}),c.__on("change",function(a){a.stopPropagation()}),a.appendButton(c)})},__pressButton:function(a){this.__prevIndex=this.__currentIndex,this.__currentIndex=this.indexOf(a),this.__currentIndex!==this.__prevIndex&&(a&&a.press(),b.each(this.__widgets,function(b,c){c!==a&&c.bounce()}),this.trigger("change",{currentIndex:this.__currentIndex,prevIndex:this.__prevIndex}))},__valid:function(a){return a instanceof d}})}},_p[37]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(19),e=_p.r(42),f=_p.r(48);return _p.r(13).createClass("Button",{base:_p.r(60),constructor:function(a){var c={label:null,text:null,icon:null,layout:"right"};a=b.extend({},c,a),this.callBase(a)},getLabel:function(){return this.__labelWidget.getText()},setLabel:function(a){return this.__labelWidget.setText(a)},getLabelWidget:function(){return this.__labelWidget},getIconWidget:function(){return this.__iconWidget},__render:function(){switch(this.callBase(),this.__iconWidget=new e(this.__options.icon),this.__labelWidget=new f(this.__options.label),this.__options.layout){case"left":case"top":this.__element.appendChild(this.__labelWidget.getElement()),this.__element.appendChild(this.__iconWidget.getElement());break;case"right":case"bottom":default:this.__element.appendChild(this.__iconWidget.getElement()),this.__element.appendChild(this.__labelWidget.getElement())}b(this.__element).addClass(c.classPrefix+"button-layout-"+this.__options.layout)},__initOptions:function(){this.callBase(),this.widgetName="Button",this.__tpl=d,this.__iconWidget=null,this.__labelWidget=null,"object"!=typeof this.__options.label&&(this.__options.label={text:this.__options.label}),"object"!=typeof this.__options.icon&&(this.__options.icon={img:this.__options.icon})},__initEvent:function(){this.callBase(),this.on("click",function(){this.__trigger("btnclick")})}})}},_p[38]={value:function(a){var b=_p.r(13),c=_p.r(12),d=_p.r(49),e=_p.r(20),f=_p.r(4);return b.createClass("ColorPicker",{base:_p.r(54),constructor:function(a){var b={clearText:"",commonText:"",commonColor:[["#ffffff","#000000","#eeece1","#1f497d","#4f81bd","#c0504d","#9bbb59","#8064a2","#4bacc6","#f79646"],["#f2f2f2","#808080","#ddd8c2","#c6d9f1","#dbe5f1","#f2dbdb","#eaf1dd","#e5dfec","#daeef3","#fde9d9"],["#d9d9d9","#595959","#c4bc96","#8db3e2","#b8cce4","#e5b8b7","#d6e3bc","#ccc0d9","#b6dde8","#fbd4b4"],["#bfbfbf","#404040","#938953","#548dd4","#95b3d7","#d99594","#c2d69b","#b2a1c7","#92cddc","#fabf8f"],["#a6a6a6","#262626","#4a442a","#17365d","#365f91","#943634","#76923c","#5f497a","#31849b","#e36c0a"],["#7f7f7f","#0d0d0d","#1c1a10","#0f243e","#243f60","#622423","#4e6128","#3f3151","#205867","#974706"]],standardText:"",standardColor:["#c00000","#ff0000","#ffc000","#ffff00","#92d050","#00b050","#00b0f0","#0070c0","#002060","#7030a0"]};a=f.extend({},b,a),this.callBase(a)},show:function(){return this.__inDoc||(this.__inDoc=!0,this.appendTo(this.__element.ownerDocument.body)),this.__maskWidget.show(),this.callBase(),this},hide:function(){return this.callBase(),this.__maskWidget.hide(),this},attachTo:function(a){var b=this;a.on("click",function(){b.appendTo(a.getElement().ownerDocument.body),b.positionTo(a),b.show()})},__initOptions:function(){this.callBase(),this.widgetName="ColorPicker",this.__contentElement=null,this.__maskWidget=null,this.__inDoc=!1},__render:function(){this.callBase(),f(this.__element).addClass(c.classPrefix+"colorpicker");var a=b.Tpl.compile(e,this.__options);this.__contentElement.appendChild(f(a)[0]),this.__previewElement=f(this.__contentElement).find("."+c.classPrefix+"colorpicker-preview"),this.__clearElement=f(this.__contentElement).find("."+c.classPrefix+"colorpicker-clear"),this.__maskWidget=new d(this.__options.mask)},__initEvent:function(){var a=this;this.callBase(),this.on("click",function(b){var d,e=f(b.target);e.hasClass(c.classPrefix+"colorpicker-item")?(d=e.attr("data-color"),a.trigger("selectcolor",d),a.hide()):e.hasClass(c.classPrefix+"colorpicker-clear")&&(a.trigger("selectcolor",""),a.hide())}),this.on("mouseover",function(b){var d,e=f(b.target);e.hasClass(c.classPrefix+"colorpicker-item")&&(d=e.attr("data-color"),f(a.__element).find("."+c.classPrefix+"colorpicker-preview").css({"background-color":d,"border-color":d}))}),this.__maskWidget.on("click",function(){a.hide()})}})}},_p[39]={value:function(a){var b=_p.r(13),c=_p.r(12),d=_p.r(60),e=_p.r(0),f=_p.r(4);return b.createClass("Container",{base:d,constructor:function(a){var b={column:!1,widgets:null};a=f.extend({},b,a),this.callBase(a)},indexOf:function(a){return f.inArray(a,this.__widgets)},disable:function(){this.callBase(),f.each(this.__widgets,function(a,b){b.disable()})},enable:function(){this.callBase(),f.each(this.__widgets,function(a,b){b.enable()})},getWidgets:function(){return this.__widgets},getWidget:function(a){return this.__widgets[a]||null},getWidgetByValue:function(a){var b=null;return f.each(this.__widgets,function(c,d){return d.getValue()===a?(b=d,!1):void 0}),b},appendWidget:function(a){return this.__valid(a)?(this.__options.disabled&&a.disable(),this.__widgets.push(a),a.appendTo(this.__contentElement),this.__options.column?(this.__widgets.length>0&&this.__widgets.length%this.__options.column===0&&this.__contentElement.appendChild(f('<span class="fui-column"></span>')[0]),f(a.getElement()).addClass(c.classPrefix+"panel-column-widget"),
  13. a):a):null},appendWidgets:function(a){var b=this,c=a;return f.isArray(a)||(c=arguments),f.each(c,function(a,c){b.appendWidget(c)}),this},insertWidget:function(a,b){var d=null;return 0===this.__widgets.length?this.appendWidget(b):this.__valid(b)?(this.__options.disabled&&b.disable(),d=this.__widgets[a],this.__widgets.splice(a,0,b),this.__contentElement.insertBefore(b.getElement(),d.getElement()),this.__options.column===!1?b:(this.__contentElement.insertBefore(f('<span class="fui-column"></span>')[0],d.getElement()),f(b.getElement()).addClass(c.classPrefix+"panel-column-widget"),b)):null},insertWidgets:function(a,b){var c=this,d=b;return f.isArray(b)||(d=[].slice.call(arguments,1)),f.each(d,function(b,d){c.insertWidget(a,d),a++}),this},getContentElement:function(){return this.__contentElement},removeWidget:function(a){return"number"==typeof a?a=this.__widgets.splice(a,1)[0]:this.__widgets.splice(this.indexOf(a),1),this.__contentElement.removeChild(a.getElement()),f(a.getElement()).removeClass(c.classPrefix+"panel-column-widget"),a},__initOptions:function(){this.widgetName="Container",this.__widgets=[],this.__contentElement=null,this.__options.column-=0},__render:function(){return this.callBase(),this.__contentElement=this.__element,f(this.__element).addClass(c.classPrefix+"container"),this.__options.column&&f(this.__element).addClass(c.classPrefix+"container-column"),this},__appendChild:function(a){return this.appendWidget(a)},__initWidgets:function(){if(this.__options.widgets){var a=e.parse(this.__options.widgets),b=this;f.isArray(a)||(a=[a]),f.each(a,function(a,c){b.appendWidget(c)})}},__valid:function(a){return a instanceof d}})}},_p[40]={value:function(a){var b=_p.r(13),c=_p.r(12),d=_p.r(60),e=_p.r(49),f=_p.r(21),g=_p.r(37),h=c.layout,i=_p.r(4),j={CANCEL:"cancel",OK:"ok"};return b.createClass("Dialog",{base:_p.r(54),constructor:function(a){var b={layout:h.CENTER,caption:null,resize:"height",draggable:!0,closeButton:!0,mask:{color:"#000",opacity:.2},prompt:!1,buttons:[{className:c.classPrefix+"xdialog-ok-btn",action:"ok",label:"确定"},{className:c.classPrefix+"xdialog-cancel-btn",action:"cancel",label:"取消"}]};a=i.extend({},b,a),this.callBase(a)},open:function(){return this.__fire("open",function(){this.show()}),this},close:function(){return this.__fire("close",function(){this.hide()}),this},getButtons:function(){return this.__buttons},getButton:function(a){return this.__buttons[a]},appendTo:function(a){return this.callBase(a),this.__maskWidget.appendTo(a),this.__inDoc=!0,this},show:function(){return this.__target||(this.__target=this.__element.ownerDocument.body),this.__inDoc||this.appendTo(this.__element.ownerDocument.body),this.__maskWidget.show(),this.callBase(),this.__openState=!0,this},hide:function(){return this.callBase(),this.__maskWidget.hide(),this.__openState=!1,this},toggle:function(){return this.isOpen()?this.close():this.open(),this},isOpen:function(){return this.__openState},getHeadElement:function(){return this.__headElement},getBodyElement:function(){return this.getContentElement()},getFootElement:function(){return this.__footElement},__initOptions:function(){this.callBase(),this.widgetName="Dialog",this.__target=this.__options.target,this.__layout=this.__options.layout,this.__inDoc=!1,this.__hinting=!1,this.__openState=!1,this.__headElement=null,this.__bodyElement=null,this.__footElement=null,this.__maskWidget=null,this.__buttons=[],this.__target instanceof d&&(this.__target=this.__target.getElement())},__render:function(){this.callBase(),this.__innerTpl=b.Tpl.compile(f,this.__options),this.__contentElement.appendChild(i(this.__innerTpl)[0]),i(this.__element).addClass(c.classPrefix+"dialog"),this.__headElement=i(".fui-dialog-head",this.__contentElement)[0],this.__bodyElement=i(".fui-dialog-body",this.__contentElement)[0],this.__footElement=i(".fui-dialog-foot",this.__contentElement)[0],this.__maskWidget=new e(this.__options.mask),this.__contentElement=this.__bodyElement,this.__options.draggable&&this.__initDraggable(),this.__options.closeButton&&this.__initCloseButton(),this.__initButtons(),this.__initMaskLint()},__action:function(a,b){switch(a){case j.OK:this.__triggerHandler(a)!==!1&&this.close();break;case j.CANCEL:this.__triggerHandler(a),this.close()}},__initButtons:function(){var a=this,b=null,c=this.__footElement;i.each(this.__options.buttons,function(d,e){b=new g(e),b.appendTo(c),a.__buttons.push(b)})},__initEvent:function(){var a=this;this.callBase(),i([this.__footElement,this.__headElement]).on("btnclick",function(b,c){a.__action(c.getOptions().action,c)}),this.__options.prompt&&i(this.__element).on("keydown",function(b){switch(b.keyCode){case 13:a.__action(j.OK);break;case 27:a.__action(j.CANCEL)}})},__initDraggable:function(){b.createDraggable({handler:this.__headElement,target:this.__element}).bind()},__initCloseButton:function(){var a=new g({className:"fui-close-button",action:"cancel",icon:{className:"fui-close-button-icon"}});a.appendTo(this.__headElement)},__initMaskLint:function(){var a=this;this.__maskWidget.on("click",function(){a.__hint()})},__hint:function(){if(!this.__hinting){this.__hinting=!0;var a=i(this.__element),b=this,d=[c.classPrefix+"mask-hint",c.classPrefix+"mask-animate"];a.addClass(d.join(" ")),window.setTimeout(function(){a.removeClass(d[0]),window.setTimeout(function(){a.removeClass(d[1]),b.__hinting=!1},200)},200)}}})}},_p[41]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(22),e=_p.r(37),f=_p.r(51),g=_p.r(54),h=_p.r(49);return _p.r(13).createClass("DropPanel",{base:_p.r(60),constructor:function(a){var c={button:null,panel:null,width:null,height:null};a=b.extend({},c,a),this.callBase(a)},disable:function(){this.callBase()},enable:function(){this.callBase()},open:function(){this.__popupWidget.appendWidget(this.__panelWidget),this.__maskWidget.show(),this.__popupWidget.show();var a=b(this.__popupWidget.getElement());a.css("top",parseInt(a.css("top"))-b(this.__element).outerHeight()),a.css("min-width",b(this.__element).outerWidth()),a.css("min-height",b(this.__element).height())},close:function(){this.__maskWidget.hide(),this.__popupWidget.hide(),this.__panelWidget.appendTo(this.__contentElement)},getPanelElement:function(){return this.__panelWidget.getElement()},appendWidget:function(a){this.__panelWidget.appendWidget(a)},getWidgets:function(){return this.__panelWidget.getWidgets()},getWidget:function(a){return this.__panelWidget.getWidget(a)},appendWidgets:function(a){return this.__panelWidget.appendWidgets.apply(this,arguments),this},insertWidget:function(a,b){this.__panelWidget.insertWidget(a,b)},insertWidgets:function(a,b){return this.__panelWidget.insertWidgets.apply(this,arguments),this},removeWidget:function(a){return this.__panelWidget.removeWidget(a)},__render:function(){this.__initOptions(),this.__buttonWidget=new e(this.__options.button),this.__panelWidget=new f(this.__options.content),this.__popupWidget=new g,this.__maskWidget=new h(this.__options.mask),this.callBase(),this.__popupWidget.positionTo(this.__element),b(this.__popupWidget.getElement()).addClass(c.classPrefix+"drop-panel-popup");var a=b('<div class="'+c.classPrefix+'drop-panel-content"></div>').append(this.__panelWidget.getElement());this.__contentElement=a[0],b(this.__element).append(a).append(this.__buttonWidget.getElement()),this.__initDropPanelEvent()},__initOptions:function(){this.widgetName="DropPanel",this.__tpl=d,this.__buttonWidget=null,this.__popupWidget=null,this.__panelWidget=null,this.__contentElement=null,this.__maskWidget=null,this.__popupState=!1,"object"!=typeof this.__options.button&&(this.__options.input={icon:this.__options.button})},__initDropPanelEvent:function(){var a=this;this.__buttonWidget.on("click",function(){a.__popupState||(a.__appendPopup(),a.__popupState=!0),a.trigger("buttonclick"),a.open()}),this.__panelWidget.on("click",function(){a.trigger("panelclick")}),this.__maskWidget.on("maskclick",function(){a.close()})},__appendPopup:function(){this.__popupWidget.appendTo(this.__element.ownerDocument.body)}})}},_p[42]={value:function(a){var b=_p.r(4),c=_p.r(23);return _p.r(13).createClass("Icon",{base:_p.r(60),constructor:function(a){var c={img:null};a=b.extend({},c,a),this.callBase(a)},getValue:function(){return this.__options.value||this.__options.img},setImage:function(a){return this.__options.img===a?this:(this.__image&&(this.__image.src=a),void this.trigger("iconchange",{prevImage:this.__prevIcon,currentImage:this.__currentIcon}))},getImage:function(){return this.__currentIcon},__initOptions:function(){this.callBase(),this.widgetName="Icon",this.__tpl=c,this.__prevIcon=null,this.__currentIcon=this.__options.img,this.__image=null},__render:function(){this.__options.__width=this.__options.width,this.__options.__height=this.__options.height,this.__options.width=null,this.__options.height=null,this.callBase(),this.__options.img&&(this.__image=b("img",this.__element)[0],null!==this.__options.__width&&(this.__image.width=this.__options.__width),null!==this.__options.__height&&(this.__image.height=this.__options.__height))}})}},_p[43]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(24),e=_p.r(37),f=_p.r(45);return _p.r(13).createClass("InputButton",{base:_p.r(60),constructor:function(a){var c={button:null,input:null,placeholder:null,layout:"right"};a=b.extend({},c,a),this.callBase(a)},getValue:function(){return this.__inputWidget.getValue()},setValue:function(a){return this.__inputWidget.setValue(a),this},reset:function(){this.__inputWidget.reset()},selectAll:function(){return this.__inputWidget.selectAll(),this},selectRange:function(a,b){return this.__inputWidget.selectRange(a,b),this},focus:function(){return this.__inputWidget.focus(),this},unfocus:function(){return this.__inputWidget.unfocus(),this},__initOptions:function(){this.callBase(),this.widgetName="InputButton",this.__tpl=d,this.__inputWidget=null,this.__buttonWidget=null,"object"!=typeof this.__options.input&&(this.__options.input={placeholder:this.__options.input}),this.__options.input=b.extend({},this.__options.input,{placeholder:this.__options.placeholder}),"object"!=typeof this.__options.button&&(this.__options.button={icon:this.__options.button})},__render:function(){var a=this;switch(this.callBase(),this.__buttonWidget=new e(this.__options.button),this.__inputWidget=new f(this.__options.input),this.__options.layout){case"left":case"top":this.__buttonWidget.appendTo(this.__element),this.__inputWidget.appendTo(this.__element);break;case"right":case"bottom":default:this.__inputWidget.appendTo(this.__element),this.__buttonWidget.appendTo(this.__element)}b(this.__element).addClass(c.classPrefix+"layout-"+this.__options.layout),this.__buttonWidget.on("click",function(){a.trigger("buttonclick")})}})}},_p[44]={value:function(a){var b=_p.r(4),c=_p.r(25),d=_p.r(43),e=_p.r(50),f=_p.r(49);return _p.r(13).createClass("InputMenu",{base:_p.r(60),constructor:function(a){var c={input:null,menu:null,mask:null,selected:-1};a=b.extend({},c,a),this.callBase(a)},select:function(a){this.__menuWidget.select(a)},selectByValue:function(a){return this.__selectBy("values",a)},selectByLabel:function(a){return this.__selectBy("labels",a)},clearSelect:function(){return this.__lastSelect=-1,this.__menuWidget.clearSelect(),this.__inputWidget.reset(),this},setValue:function(a){return this},getValue:function(){return this.__menuWidget.getSelectedItem().getValue()},open:function(){this.__maskWidget.show(),this.__menuWidget.show()},close:function(){this.__maskWidget.hide(),this.__menuWidget.hide()},__render:function(){this.__inputWidget=new d(this.__options.input),this.__menuWidget=new e(this.__options.menu),this.__maskWidget=new f(this.__options.mask),this.callBase(),this.__inputWidget.appendTo(this.__element),this.__menuWidget.positionTo(this.__inputWidget),this.__initInputValue()},__selectBy:function(a,c){var d=this.__getItemValues()[a],e=-1;return b.each(d,function(a,b){return c===b?(e=a,!1):void 0}),-1!==e?(this.select(e),this.__menuWidget.getSelectedItem()):null},__initInputValue:function(){var a=this.__menuWidget.getItem(this.__options.selected);a&&this.__inputWidget.setValue(a.getLabel())},__initEvent:function(){var a=this;this.callBase(),this.on("buttonclick",function(){this.__menuState||(this.__appendMenu(),this.__menuState=!0),this.__inputWidget.unfocus(),this.open()}),this.on("keypress",function(a){this.__lastTime=new Date}),this.on("keyup",function(a){8!==a.keyCode&&13!==a.keyCode&&new Date-this.__lastTime<500&&this.__update()}),this.on("inputcomplete",function(){this.__inputWidget.selectRange(99999999),this.__inputComplete()}),this.__menuWidget.on("select",function(b,c){b.stopPropagation(),a.__inputWidget.setValue(c.label),a.trigger("select",c),a.close()}),this.__menuWidget.on("menuitemclick",function(b,c){a.trigger("itemclick",c)}),this.__menuWidget.on("change",function(b,c){b.stopPropagation(),a.trigger("change",c)}),this.__inputWidget.on("select change",function(a){a.stopPropagation()}),this.__maskWidget.on("maskclick",function(){a.close()}),this.on("select",function(a,b){this.__lastSelect=b})},__update:function(){var a=this.__inputWidget.getValue(),c=a.toLowerCase(),d=this.__getItemValues().labels,e=null;a&&(b.each(d,function(a,b){return 0===b.toLowerCase().indexOf(c)?(e=b,!1):void 0}),e&&(this.__inputWidget.setValue(e),this.__inputWidget.selectRange(a.length)))},__getItemValues:function(){var a=[],c=[];return b.each(this.__menuWidget.getWidgets(),function(b,d){c.push(d.getLabel()),a.push(d.getValue())}),{labels:c,values:a}},__inputComplete:function(){var a=this.__getItemValues(),c=a.labels,d=-1,e=this.__inputWidget.getValue(),f=this.__lastSelect;b.each(c,function(a,b){return b===e?(d=a,!1):void 0}),this.trigger("select",{index:d,label:e,value:a.values[d]}),f&&f.value===e||this.trigger("change",{from:f||{index:-1,label:null,value:null},to:{index:d,label:e,value:a.values[d]}})},__appendMenu:function(){this.__menuWidget.appendTo(this.__inputWidget.getElement().ownerDocument.body)},__initOptions:function(){this.callBase(),this.widgetName="InputMenu",this.__tpl=c,this.__lastTime=0,this.__lastSelect=null,this.__inputWidget=null,this.__menuWidget=null,this.__maskWidget=null,this.__menuState=!1,-1!==this.__options.selected&&(this.__options.menu.selected=this.__options.selected)}})}},_p[45]={value:function(a){var b=_p.r(12),c=_p.r(4),d=_p.r(26);return _p.r(13).createClass("Input",{base:_p.r(60),constructor:function(a){var b={placeholder:null};a=c.extend({},b,a),this.callBase(a)},getValue:function(){return this.__element.value},setValue:function(a){return this.__element.value=a,this},disable:function(){this.callBase(),this.__element.disabled=!0},enable:function(){this.__element.disabled=!1,this.callBase()},reset:function(){return this.__element.value=this.__options.value||"",this},selectAll:function(){this.__element.select()},selectRange:function(a,b){a||(a=0),b||(b=1e9),this.__element.setSelectionRange(a,b)},focus:function(){return this.__element.focus(),this},unfocus:function(){return this.__element.blur(),this},__initOptions:function(){this.callBase(),this.widgetName="Input",this.__tpl=d,this.__allow_focus=!0},__render:function(){this.callBase(),this.__element.removeAttribute("unselectable"),this.__options.placeholder&&this.__element.setAttribute("placeholder",this.__options.placeholder),this.addClass(b.classPrefix+"selectable")},__initEvent:function(){this.callBase(),this.on("keydown",function(a){13===a.keyCode&&this.trigger("inputcomplete",{value:this.getValue()})})}})}},_p[46]={value:function(a){var b=_p.r(13),c=_p.r(27),d=_p.r(42),e=_p.r(48),f=_p.r(12),g=_p.r(4);return b.createClass("Item",{base:_p.r(60),constructor:function(a){var b={label:"",icon:null,selected:!1,textAlign:"left"};a=g.extend({},b,a),this.callBase(a)},getValue:function(){return this.__options.value||this.__labelWidget.getValue()||this.__iconWidget.getValue()||null},select:function(){return this.__update(!0),this},unselect:function(){return this.__update(!1),this},isSelected:function(){return this.__selectState},setLabel:function(a){return this.__labelWidget.setText(a),this},getLabel:function(){return this.__labelWidget.getText()},setIcon:function(a){return this.__iconWidget.setImage(a),this},getIcon:function(){return this.__iconWidget.getImage()},__render:function(){this.callBase(),this.__iconWidget=new d(this.__options.icon),this.__labelWidget=new e(this.__options.label),this.__iconWidget.appendTo(this.__element),this.__labelWidget.appendTo(this.__element)},__update:function(a){var b=a?"addClass":"removeClass";return a=!!a,g(this.__element)[b](f.classPrefix+"item-selected"),this.__selectState=a,this.trigger(a?"itemselect":"itemunselect"),this},__initEvent:function(){this.callBase(),this.on("click",function(){this.trigger("itemclick")})},__initOptions:function(){this.callBase(),this.widgetName="Item",this.__tpl=c,this.__iconWidget=null,this.__labelWidget=null,this.__selectState=this.__options.selected,"object"!=typeof this.__options.label&&(this.__options.label={text:this.__options.label}),this.__options.label.textAlign||(this.__options.label.textAlign=this.__options.textAlign),"object"!=typeof this.__options.icon&&(this.__options.icon={img:this.__options.icon})}})}},_p[47]={value:function(a){var b=_p.r(13),c=_p.r(12),d=_p.r(48),e=_p.r(4);return b.createClass("LabelPanel",{base:_p.r(51),constructor:function(a){var b={layout:"bottom"};a=e.extend({},b,a),this.callBase(a)},disable:function(){this.callBase(),this.__labelWidget.disable()},enable:function(){this.callBase(),this.__labelWidget.enable()},__render:function(){var a=null,b=this.__options,f=this.__element,g=c.classPrefix,h="fui-label-panel-content",i=null;return this.__labelWidget=new d(b.label),this.callBase(),i=this.__contentElement,e(f).addClass(g+"label-panel"),e(f).addClass(g+"layout-"+b.layout),a=e('<div class="'+h+'"></div>'),i.appendChild(this.__labelWidget.getElement()),i.appendChild(a[0]),this.__contentElement=a[0],this},__initOptions:function(){var a=this.__options.label;this.callBase(),this.widgetName="LabelPanel",this.__labelWidget=null,"object"!=typeof a&&(this.__options.label={text:a}),this.__options.label.className||(this.__options.label.className=""),this.__options.label.className+=" fui-label-panel-label"}})}},_p[48]={value:function(a){var b=_p.r(13),c=_p.r(28),d=_p.r(4);return b.createClass("Label",{base:_p.r(60),constructor:function(a){var b={text:"",textAlign:"center"};a=d.extend({},b,a),this.callBase(a)},getValue:function(){return this.__options.text},setText:function(a){var b=this.__options.text;return this.__options.text=a,d(this.__element).text(a),this.trigger("labelchange",{currentText:a,prevText:b}),this},getText:function(){return this.__options.text},__allowShowTitle:function(){return!1},__initOptions:function(){this.callBase(),this.widgetName="Label",this.__tpl=c,this.__options.text=this.__options.text.toString()}})}},_p[49]={value:function(a){function b(){f(window).on("resize",function(){f.each(h,function(a,b){b&&!b.isHide()&&b.__resize()})})}var c=_p.r(13),d=_p.r(29),e=_p.r(60),f=_p.r(4),g=!1,h=[];return c.createClass("Mask",{base:_p.r(60),constructor:function(a){var b={bgcolor:"#000",opacity:0,inner:!0,target:null,scroll:!1,hide:!0};a=f.extend({},b,a),this.callBase(a)},maskTo:function(a){return a&&(this.__target=a),this},show:function(){var a=null;this.__target||(this.__target=this.__element.ownerDocument.body),a=this.__target.ownerDocument.documentElement,f.contains(a,this.__element)||this.appendTo(this.__target.ownerDocument.body),this.callBase(),this.__position(),this.__resize(),this.__hideState=!1},hide:function(){this.callBase(),this.__hideState=!0},isHide:function(){return this.__hideState},__initOptions:function(){this.callBase(),this.widgetName="Mask",this.__tpl=d,this.__cacheId=h.length,this.__hideState=!0,h.push(this),this.__target=this.__options.target,this.__target instanceof e&&(this.__target=this.__target.getElement())},__render:function(){this.callBase(),this.__initMaskEvent(),g||(g=!0,b())},__initMaskEvent:function(){this.on("mousewheel",function(a){var b=a.originalEvent;a.preventDefault(),a.stopPropagation(),this.trigger("scroll",{delta:b.wheelDelta||b.deltaY||b.detail})}),this.on("click",function(a){a.stopPropagation(),a.target===this.__element&&this.trigger("maskclick")})},__resize:function(){var a=null;this.__targetIsBody()?(a=f(c.getView(this.__target)),a={width:a.width(),height:a.height()}):a=c.getRect(this.__target),this.__element.style.width=a.width+"px",this.__element.style.height=a.height+"px"},__position:function(){var a=null,b=null;this.__targetIsBody()?a={top:0,left:0}:(b=c.getRect(this.__target),a={top:b.top,left:b.left}),f(this.__element).css("top",a.top+"px").css("left",a.left+"px")},__targetIsBody:function(){return"body"===this.__target.tagName.toLowerCase()}})}},_p[50]={value:function(a){var b=_p.r(13),c=_p.r(46),d=_p.r(12),e=_p.r(4);return b.createClass("Menu",{base:_p.r(54),constructor:function(a){var b={column:!0,selected:-1,textAlign:"left",items:[]};a=e.extend({},b,a),this.callBase(a)},select:function(a){var b=this.__widgets[a];return b?(this.__selectItem(b),this):this},clearSelect:function(){var a=this.getSelectedItem();a&&a.unselect(),this.__currentSelect=-1,this.__prevSelect=-1},getItems:function(){return this.getWidgets.apply(this,arguments)},getItem:function(){return this.getWidget.apply(this,arguments)},appendItem:function(a){return this.appendWidget.apply(this,arguments)},insertItem:function(a){return this.insertWidget.apply(this,arguments)},removeItem:function(a){return this.removeWidget.apply(this,arguments)},clearItems:function(){for(;this.getItems().length;)this.removeItem(0);return this},getSelected:function(){return this.__currentSelect},getSelectedItem:function(){return this.getItem(this.__currentSelect)},insertWidget:function(a,b){var c=this.callBase(a,b);return null===c?c:(a<=this.__currentSelect&&this.__currentSelect++,a<=this.__prevSelect&&this.__prevSelect++,c)},removeWidget:function(a){var b=a;return"number"!=typeof b&&(b=this.indexOf(a)),a=this.callBase(a),b===this.__currentSelect?this.__currentSelect=-1:b<this.__currentSelect&&this.__currentSelect--,b===this.__prevSelect?this.__prevSelect=-1:b<this.__prevSelect&&this.__prevSelect--,a},__initOptions:function(){this.callBase(),this.__prevSelect=-1,this.__currentSelect=this.__options.selected,this.widgetName="Menu"},__render:function(){var a=this,b=this.__options.textAlign,f=this.__options.selected;this.callBase(),e(this.__element).addClass(d.classPrefix+"menu"),e.each(this.__options.items,function(d,e){"object"!=typeof e&&(e={label:e}),e.selected=d===f,e.textAlign=b,a.appendItem(new c(e))})},__initEvent:function(){this.callBase(),this.on("itemclick",function(a){this.__selectItem(a.widget,!0)})},__selectItem:function(a,b){var c=null;if(this.__currentSelect>-1&&this.__widgets[this.__currentSelect].unselect(),this.__prevSelect=this.__currentSelect,this.__currentSelect=this.indexOf(a),a.select(),c={index:this.__currentSelect,label:a.getLabel(),value:a.getValue()},b&&this.trigger("menuitemclick",c),this.trigger("select",c),this.__prevSelect!==this.__currentSelect){var d=this.__widgets[this.__prevSelect]||null;this.trigger("change",{from:{index:this.__prevSelect,label:d&&d.getLabel(),value:d&&d.getValue()},to:{index:this.__currentSelect,label:a.getLabel(),value:a.getValue()}})}},__valid:function(a){return a instanceof c}})}},_p[51]={value:function(a){var b=_p.r(13),c=_p.r(30),d=_p.r(4);return b.createClass("Panel",{base:_p.r(39),constructor:function(a){var b={};a=d.extend({},b,a),this.callBase(a)},__render:function(){var a=null;this.callBase(),a=d('<div class="fui-panel-content"></div>'),this.__contentElement.appendChild(a[0]),this.__contentElement=a[0]},__initOptions:function(){this.callBase(),this.widgetName="Panel",this.__tpl=c}})}},_p[52]={value:function(a){var b=_p.r(13),c=_p.r(12),d=_p.r(4),e=_p.r(50);return b.createClass("PopupMenu",{base:_p.r(53),constructor:function(a){this.callBase(d.extend({menu:{}},a))},getMenuWidget:function(){return this.__menuWidget},__initOptions:function(){this.callBase(),this.widgetName="PopupMenu"},__render:function(){this.callBase(),this.__menuWidget=new e,this.appendWidget(this.__menuWidget),d(this.__element).addClass(c.classPrefix+"popup-menu")}})}},_p[53]={value:function(a){var b=_p.r(13),c=_p.r(12),d=_p.r(60),e=_p.r(49),f=_p.r(4);return b.createClass("Popup",{base:_p.r(54),constructor:function(a){var b={mask:{}};a=f.extend({},b,a),this.callBase(a)},open:function(){return this.__fire("open",function(){this.show()}),this},close:function(){return this.__fire("close",function(){this.hide()}),this},show:function(){return this.__target||(this.__target=this.__element.ownerDocument.body),this.__inDoc||(this.__inDoc=!0,this.appendTo(this.__element.ownerDocument.body)),this.__maskWidget.show(),this.callBase(),this.__openState=!0,this},hide:function(){return this.callBase(),this.__maskWidget.hide(),this.__openState=!1,this},toggle:function(){return this.isOpen()?this.close():this.open(),this},isOpen:function(){return this.__openState},__initOptions:function(){this.callBase(),this.widgetName="Popup",this.__target=this.__options.target,this.__layout=this.__options.layout,this.__inDoc=!1,this.__openState=!1,this.__maskWidget=null,this.__target instanceof d&&(this.__target=this.__target.getElement())},__render:function(){this.callBase(),f(this.__element).addClass(c.classPrefix+"popup"),this.__maskWidget=new e(this.__options.mask),this.__options.draggable&&this.__initDraggable(),this.__initMaskEvent()},__initMaskEvent:function(){var a=this;this.__maskWidget.on("click",function(){a.close()})}})}},_p[54]={value:function(a){var b=_p.r(13),c=_p.r(12),d=_p.r(60),e=c.layout,f=_p.r(4);return b.createClass("PPanel",{base:_p.r(51),constructor:function(a){var b={layout:e.BOTTOM,target:null,bound:null,diff:10,hide:!0,resize:"all",iframe:!1};a=f.extend({},b,a),this.callBase(a)},positionTo:function(a,b){return a instanceof d&&(a=a.getElement()),this.__target=a,b&&(this.__layout=b),this},show:function(){var a=null;return this.__target?(this.__options.bound||(this.__options.bound=this.__target.ownerDocument.body),a=this.__target.ownerDocument.documentElement,f.contains(a,this.__element)||this.__target.ownerDocument.body.appendChild(this.__element),f.contains(a,this.__target)&&(this.callBase(b.getMarker()),this.__position(),this.__resize()),this):this.callBase()},__initOptions:function(){this.callBase(),this.widgetName="PPanel",this.__target=this.__options.target,this.__layout=this.__options.layout,this.__height_resized=!1},__render:function(){this.callBase(),this.__options.iframe&&f('<iframe class="fui-ppanel-cover" frameborder="0"></iframe>').appendTo(this.__element),f(this.__element).addClass(c.classPrefix+"ppanel")},__position:function(){var a=null,b=c.classPrefix+"ppanel-position";f(this.__element).addClass(b),a=this.__getLocation(),f(this.__element).css("top",a.top+"px").css("left",a.left+"px")},__resize:function(){var a=b.getBound(this.__target);switch(this.__options.resize){case"all":this.__resizeWidth(a),this.__resizeHeight();break;case"width":this.__resizeWidth(a);break;case"height":this.__resizeHeight()}},__resizeWidth:function(a){if(this.__target){var b=f(this.__element),c=b.outerWidth(),d=b.outerHeight(),e=a.width-c-d;this.__element.style.minWidth=e+"px"}},__resizeHeight:function(){var a=null,c=null,d=0;c=b.getRect(this.__element),c.height=this.__element.scrollHeight,c.bottom=c.top+c.height,a=this.__getBoundRect(),d=c.bottom-a.bottom,d>0?(this.__height_resized=!0,d=c.height-d-this.__options.diff,f(this.__element).css("height",d+"px")):this.__height_resized&&(this.__element.style.height=null)},__getLocation:function(){var a=b.getBound(this.__target);switch(this.__layout){case e.CENTER:case e.MIDDLE:return this.__getCenterLayout(a);case e.LEFT:case e.RIGHT:case e.BOTTOM:case e.TOP:return this.__getOuterLayout(a);default:return this.__getInnerLayout(a)}return location},__getCenterLayout:function(a){var c={top:0,left:0},d=b.getRect(this.__element),e=0;return e=a.height-d.height,e>0&&(c.top=a.top+e/2),e=a.width-d.width,e>0&&(c.left=a.left+e/2),c},__getOuterLayout:function(a){var c={top:0,left:0},d=b.getRect(this.__element);switch(this.__layout){case e.TOP:c.left=a.left,c.top=a.top-d.height;break;case e.LEFT:c.top=a.top,c.left=a.left-d.width;break;case e.RIGHT:c.top=a.top,c.left=a.right;break;case e.BOTTOM:default:c.left=a.left,c.top=a.bottom}return c},__getInnerLayout:function(a){var c={top:0,left:0},d=a,f=b.getRect(this.__element);switch(this.__layout){case e.LEFT_TOP:c.top=d.top,c.left=d.left;break;case e.RIGHT_TOP:c.top=d.top,c.left=d.left+d.width-f.width;break;case e.LEFT_BOTTOM:c.top=d.top+d.height-f.height,c.left=d.left;break;case e.RIGHT_BOTTOM:c.top=d.top+d.height-f.height,c.left=d.left+d.width-f.width}return this.__correctionLocation(c)},__getBoundRect:function(){var a=-1,c=-1,d=null;return"body"===this.__options.bound.tagName.toLowerCase()?(d=b.getView(this.__options.bound),a=f(d).width(),c=f(d).height(),{top:0,left:0,right:a,bottom:c,width:a,height:c}):b.getRect(this.__options.bound)},__correctionLocation:function(a){var c=b.getRect(this.__element),d=b.getRect(this.__target),f=this.__getBoundRect();switch(this.__layout){case e.LEFT_TOP:case e.LEFT_BOTTOM:a.left+c.width>f.right&&(a.left+=d.width-c.width);break;case e.RIGHT_TOP:case e.RIGHT_BOTTOM:a.left<f.left&&(a.left=d.left)}return a}})}},_p[55]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(51),e=_p.r(54),f=_p.r(37),g=_p.r(0),h=_p.r(49);return _p.r(13).createClass("SelectMenu",{base:d,constructor:function(a){var c={bed:{className:"fui-select-menu-bed"},button:{className:"fui-select-menu-btn"},events:["btnclick"],selected:-1};a=b.extend({},c,a),this.callBase(a)},show:function(){this.__widgetMenu.show(),this.__mask.show()},hide:function(){this.__widgetMenu.hide(),this.__mask.hide()},getValue:function(){var a=this.__widgets[this.__selected];return a?a.getValue():null},getSelected:function(){return this.__widgets[this.__selected]},select:function(a){var b=this.__widgets[a],c="fui-select-menu-selected",d=this.__selected,e=this.__widgets[this.__selected],f=this.__bed.getElement();return b?(e&&e.removeClass(c),f.innerHTML="",f.appendChild(b.cloneElement()),b.addClass(c),this.__selected=a,this.trigger("select",{index:a,widget:b}),this.__selected!==d&&this.trigger("change",{from:{index:d,widget:e},to:{index:a,widget:b}}),this):this},selectByWidget:function(a){return this.select(this.indexOf(a))},selectByValue:function(a){var c=-1;return b.each(this.__widgets,function(b,d){return d.getValue()===a?(c=b,!1):void 0}),this.select(c)},__render:function(){this.__bed=new d(this.__options.bed),this.__dropBtn=new f(this.__options.button),this.__widgetMenu=new e({className:"fui-select-menu-container",layout:c.layout.LEFT_TOP,column:this.__column}),this.__mask=new h;var a=this.__initWidgets();this.callBase(),b(this.__element).addClass(c.classPrefix+"select-menu"),this.appendWidgets([this.__bed,this.__dropBtn,this.__mask,this.__widgetMenu]),this.__widgets=[],this.__oldContentElement=this.__contentElement,this.__contentElement=this.__widgetMenu,this.appendWidgets(a),this.__widgetMenu.positionTo(this.getElement()),b.isNumeric(this.__options.selected)?-1!=this.__options.selected&&this.select(this.__options.selected):this.__bed.appendWidget(g.parse(this.__options.selected))},__initWidgets:function(){var a=[];if(this.__options.widgets)return b.each(this.__options.widgets,function(b,c){a.push(g.parse(c))}),a},__initEvent:function(){this.callBase();var a=this;this.__dropBtn.on("btnclick",function(){a.show()}),this.__mask.on("click",function(){a.hide()}),this.__widgetMenu.on(this.__options.events.join(" "),function(b){var c=b.target;if(c!==a.__oldContentElement&&c!==a.getElement)return b.stopPropagation(),a.selectByWidget(b.widget),a.hide(),!1})},__initOptions:function(){this.callBase(),this.widgetName="SelectMenu",this.__bed=null,this.__dropBtn=null,this.__widgetMenu=null,this.__mask=null,this.__widgets=[],this.__selected=-1,this.__oldContentElement=null,this.__column=this.__options.column,
  14. delete this.__options.column}})}},_p[56]={value:function(a){var b=_p.r(13),c=_p.r(31),d=_p.r(4);return b.createClass("Separator",{base:_p.r(60),constructor:function(a){var b={width:1,height:"100%",bgcolor:"#e1e1e1"};a=d.extend({},b,a),this.callBase(a)},__initOptions:function(){this.callBase(),this.widgetName="Separator",this.__tpl=c}})}},_p[57]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(32),e=_p.r(37),f=_p.r(45),g=_p.r(51);return _p.r(13).createClass("SpinButton",{base:_p.r(60),constructor:function(a){var c={suffix:null,selected:-1,items:[]};a=b.extend({},c,a),this.callBase(a)},getValue:function(){return this.__options.items[this.__currentSelected]||null},setValue:function(a){},select:function(a){this.__update(a)},selectByValue:function(a){a+="",this.__update(b.inArray(a,this.__options.items))},__render:function(){this.callBase(),this.__buttons=[new e({className:c.classPrefix+"spin-up-btn"}),new e({className:c.classPrefix+"spin-down-btn"})],this.__inputWidget=new f,this.__panelWidget=new g({column:!0}),this.__inputWidget.appendTo(this.__element),this.__panelWidget.appendWidget(this.__buttons[0]),this.__panelWidget.appendWidget(this.__buttons[1]),this.__panelWidget.appendTo(this.__element),this.__initSelected(this.__options.selected)},__initEvent:function(){var a=this;this.callBase(),this.__buttons[0].on("btnclick",function(){a.__update(a.__currentSelected-1)}),this.__buttons[1].on("btnclick",function(){a.__update(a.__currentSelected+1)})},__initSelected:function(a){this.__update(a,!1)},__update:function(a,b){var c=-1,d=null,e=null;0>a||a>=this.__options.items.length||(c=this.__currentSelected,this.__currentSelected=a,e=this.__options.items[this.__currentSelected],d=e+" "+(this.__options.suffix||""),this.__inputWidget.setValue(d),b!==!1&&this.trigger("change",{from:this.__options.items[c]||null,to:e}))},__initOptions:function(){var a=this.__options.items;this.callBase(),this.widgetName="SpinButton",this.__tpl=d,this.__buttons=[],this.__panelWidget=null,this.__inputWidget=null,this.__currentSelected=-1,b.each(a,function(b,c){a[b]=c+""})}})}},_p[58]={value:function(a){var b=_p.r(4),c=_p.r(12),d=_p.r(33),e=_p.r(37),f=_p.r(51);return _p.r(13).createClass("Tabs",{base:_p.r(60),constructor:function(a){var c={selected:0,buttons:[],panels:[]};a=b.extend({},c,a),this.callBase(a)},getButtons:function(){return this.__btns},getButton:function(a){return this.getButtons()[a]||null},getButtonByValue:function(a){var c=null;return b.each(this.__btns,function(b,d){return d.getValue()===a?(c=d,!1):void 0}),c},getPanels:function(){return this.__panels},getPanel:function(a){return this.getPanels()[a]||null},getPanelByValue:function(a){var c=null;return b.each(this.__panels,function(b,d){return d.getValue()===a?(c=d,!1):void 0}),c},getSelectedIndex:function(){return this.__selected},getSelected:function(){var a=this.getSelectedIndex();return{button:this.getButton(a),panel:this.getPanel(a)}},appendTab:function(a){return a.panels=a.panels||[],this.__renderByOptions(a)},removeTab:function(a){if(0>a)return null;var b=this.__btns.splice(a,1),c=this.__panels.splice(a,1);return b.length?(b=b[0],c=c[0],b.remove(),c.remove(),{button:b,panel:c}):null},select:function(a){var b=null;return this.__selectItem(a)?(b=this.__getInfo(a),this.trigger("tabsselect",b),this.__prevSelected!==this.__selected&&this.trigger("tabschange",{from:this.__getInfo(this.__prevSelected),to:b}),this):this},getIndexByButton:function(a){return b.inArray(a,this.__btns)},appendButtonTo:function(a){b.each(this.__btns,function(b,c){c.appendTo(a)})},appendPanelTo:function(a){b.each(this.__panels,function(b,c){c.appendTo(a)})},__render:function(){this.callBase(),this.__btnWrap=b(".fui-tabs-button-wrap",this.__element)[0],this.__panelWrap=b(".fui-tabs-panel-wrap",this.__element)[0],this.__renderByOptions(this.__options),this.__selectItem(this.__options.selected)},__renderByOptions:function(a){var c=this,d=[],g=this.__btns,h=this.__panels,i=this.__btnWrap,j=this.__panelWrap;return b.each(a.buttons,function(b,k){var l=null,m=null;"object"!=typeof k&&(k={label:k}),l=new e(k),l.on("click",function(){c.select(c.getIndexByButton(this))}),k=a.panels[b]||{},k.hide=!0,m=new f(k),g.push(l),h.push(m),d.push({button:l,panel:m}),l.appendTo(i),m.appendTo(j)}),d},__initOptions:function(){this.callBase(),this.widgetName="Tabs",this.__tpl=d,this.__btns=[],this.__panels=[],this.__prevSelected=-1,this.__selected=-1,this.__btnWrap=null,this.__panelWrap=null,null===this.__options.panels&&(this.__options.panels=[],this.__options.panels.length=this.__options.buttons.length)},__selectItem:function(a){var b=this.getButton(a),d=this.getButton(this.__selected),e=c.classPrefix+"selected";return b?(d&&(d.removeClass(e),this.getPanel(this.__selected).hide()),b.addClass(e),this.getPanel(a).show(),this.__prevSelected=this.__selected,this.__selected=a,!0):!1},__getInfo:function(a){return{index:a,button:this.getButton(a),panel:this.getPanel(a)}}})}},_p[59]={value:function(a){var b=_p.r(4),c=_p.r(12);return _p.r(13).createClass("ToggleButton",{base:_p.r(37),constructor:function(a){var c={pressed:!1};a=b.extend({},c,a),this.callBase(a)},isPressed:function(){return this.__state},press:function(){var a=c.classPrefix+"button-pressed";b(this.__element).addClass(a),this.__updateState(!0)},bounce:function(){var a=c.classPrefix+"button-pressed";b(this.__element).removeClass(a),this.__updateState(!1)},toggle:function(){this.__state?this.bounce():this.press()},__initOptions:function(){this.callBase(),this.widgetName="ToggleButton",this.__state=!1},__render:function(){return this.callBase(),b(this.__element).addClass(c.classPrefix+"toggle-button"),this.__initButtonState(),this},__initButtonState:function(){this.__options.pressed&&(b(this.__element).addClass(c.classPrefix+"button-pressed"),this.__state=!0)},__initEvent:function(){this.callBase(),this.on("click",function(){this.toggle()})},__updateState:function(a){a=!!a,this.__state=a,this.trigger("change",a,!a)}})}},_p[60]={value:function(a){function b(){return c+ ++d}var c="_fui_",d=0,e=_p.r(12),f=_p.r(11),g=_p.r(4),h=_p.r(13),i=h.createClass("Widget",{constructor:function(a){var b={id:null,className:"",disabled:!1,preventDefault:!1,text:"",value:null,hide:!1,width:null,height:null};this.__widgetType="widget",this.__tpl="",this.__compiledTpl="",this.__options={},this.__element=null,this.__allow_focus=!!e.allowFocus,this.widgetName="Widget",this.__extendOptions(b,a),this.__initOptions(),this.__render(),this.__initEvent(),this.__initWidgets&&this.__initWidgets()},getId:function(){return this.id},getValue:function(){return this.__options.value},getOptions:function(){return this.__options},setValue:function(a){return this.__options.value=a,this},show:function(){return this.__show(),this},hide:function(){return this.__hide(),this},addClass:function(a){return g(this.__element).addClass(a),this},removeClass:function(a){return g(this.__element).removeClass(a),this},setStyle:function(){return g.fn.css.apply(g(this.__element),arguments),this},getStyle:function(){return g.fn.css.apply(g(this.__element),arguments)},isDisabled:function(){return this.__options.disabled},enable:function(){return this.__options.disabled=!1,g(this.__element).removeClass(e.classPrefix+"disabled"),this},disable:function(){return this.__options.disabled=!0,g(this.__element).addClass(e.classPrefix+"disabled"),this},cloneElement:function(){return this.__element.cloneNode(!0)},getElement:function(){return this.__element},appendTo:function(a){if(h.isElement(a))a.appendChild(this.__element);else{if(!(a instanceof i))throw new Error("TypeError: Widget.appendTo()");a.__appendChild(this)}return this},remove:function(){var a=this.__element.parentNode;return a&&a.removeChild(this.__element),this},off:function(a,b){return g(this.__element).off(b&&b.__fui_listener),this},on:function(a,b){return this.__options.preventDefault||this.__on(a,b),this},__initOptions:function(){},__render:function(){var a=null,b=this.__tpl,c=this.__options,d=null;return this.id=this.__id(),f.__registerInstance(this),this.__compiledTpl=h.Tpl.compile(b,c),this.__element=g(this.__compiledTpl)[0],this.__element.setAttribute("id",this.id),a=g(this.__element),c.disabled&&a.addClass(e.classPrefix+"disabled"),a.addClass(e.classPrefix+"widget"),d=c.className,d.length>0&&a.addClass(g.isArray(d)?d.join(" "):d),this.__initBasicEnv(),c.hide&&this.__hide(),c.style&&this.setStyle(c.style),this},__appendChild:function(a){return this.__element.appendChild(a.getElement())},__initEvent:function(){this.on("mousedown",function(a){var b=a.target.tagName.toLowerCase();e.control[b]||this.__allowFocus()?a.stopPropagation():a.preventDefault()})},__on:function(a,b){var c=this;return b.__fui_listener=function(a,d){for(var e=[],f=0,g=arguments.length;g>f;f++)1!==f&&e.push(arguments[f]);return a.widget=d,c.isDisabled()?void 0:b.apply(c,e)},g(this.__element).on(a,b.__fui_listener),this},trigger:function(a,b){return this.__options.preventDefault||this.__trigger.apply(this,arguments),this},__allowShowTitle:function(){return!0},__allowFocus:function(){return!!this.__allow_focus},__trigger:function(a,b){var c=[].slice.call(arguments,1);return g(this.__element).trigger(a,[this].concat(c)),this},__triggerHandler:function(a,b){var c=[this].concat([].slice.call(arguments,1));return g(this.__element).triggerHandler(a,c)},__fire:function(a,b){var c={cancel:!1};return/^(before|after)/.test(a)?this:(this.__trigger("before"+a,c),c.cancel===!0?this:(c=b.call(this,a),this.__trigger(a),this.__trigger("after"+a,c),this))},__extendOptions:function(){var a=[{},this.__options],b=[!0];a=a.concat([].slice.call(arguments,0));for(var c=0,d=a.length;d>c;c++)"string"!=typeof a[c]&&b.push(a[c]);this.__options=g.extend.apply(g,b)},__hide:function(){g(this.__element).addClass(e.classPrefix+"hide")},__show:function(){g(this.__element).removeClass(e.classPrefix+"hide")},__initBasicEnv:function(){this.__options.text&&this.__allowShowTitle()&&this.__element.setAttribute("title",this.__options.text),this.__options.width&&(this.__element.style.width=this.__options.width+"px"),this.__options.height&&(this.__element.style.height=this.__options.height+"px"),this.widgetName&&this.__element.setAttribute("rule",this.widgetName)},__id:function(){return this.__options.id||b()}});return i}},_p[61]={value:function(a){_p.r(1),_p.r(2)}};var moduleMapping={"fui.export":61};use("fui.export")}(),function(){function a(a){this.tokens=[],this.tokens.links={},this.options=a||j.defaults,this.rules=k.normal,this.options.gfm&&(this.options.tables?this.rules=k.tables:this.rules=k.gfm)}function b(a,b){if(this.options=b||j.defaults,this.links=a,this.rules=l.normal,this.renderer=this.options.renderer||new c,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=l.breaks:this.rules=l.gfm:this.options.pedantic&&(this.rules=l.pedantic)}function c(a){this.options=a||{}}function d(a){this.tokens=[],this.token=null,this.options=a||j.defaults,this.options.renderer=this.options.renderer||new c,this.renderer=this.options.renderer,this.renderer.options=this.options}function e(a,b){return a.replace(b?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function f(a){return a.replace(/&([#\w]+);/g,function(a,b){return b=b.toLowerCase(),"colon"===b?":":"#"===b.charAt(0)?String.fromCharCode("x"===b.charAt(1)?parseInt(b.substring(2),16):+b.substring(1)):""})}function g(a,b){return a=a.source,b=b||"",function c(d,e){return d?(e=e.source||e,e=e.replace(/(^|[^\[])\^/g,"$1"),a=a.replace(d,e),c):new RegExp(a,b)}}function h(){}function i(a){for(var b,c,d=1;d<arguments.length;d++){b=arguments[d];for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a[c]=b[c])}return a}function j(b,c,f){if(f||"function"==typeof c){f||(f=c,c=null),c=i({},j.defaults,c||{});var g,h,k=c.highlight,l=0;try{g=a.lex(b,c)}catch(m){return f(m)}h=g.length;var n=function(a){if(a)return c.highlight=k,f(a);var b;try{b=d.parse(g,c)}catch(e){a=e}return c.highlight=k,a?f(a):f(null,b)};if(!k||k.length<3)return n();if(delete c.highlight,!h)return n();for(;l<g.length;l++)!function(a){return"code"!==a.type?--h||n():k(a.text,a.lang,function(b,c){return b?n(b):null==c||c===a.text?--h||n():(a.text=c,a.escaped=!0,void(--h||n()))})}(g[l])}else try{return c&&(c=i({},j.defaults,c)),d.parse(a.lex(b,c),c)}catch(m){if(m.message+="\nPlease report this to https://github.com/chjj/marked.",(c||j.defaults).silent)return"<p>An error occured:</p><pre>"+e(m.message+"",!0)+"</pre>";throw m}}var k={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};k.bullet=/(?:[*+-]|\d+\.)/,k.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,k.item=g(k.item,"gm")(/bull/g,k.bullet)(),k.list=g(k.list)(/bull/g,k.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+k.def.source+")")(),k.blockquote=g(k.blockquote)("def",k.def)(),k._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",k.html=g(k.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,k._tag)(),k.paragraph=g(k.paragraph)("hr",k.hr)("heading",k.heading)("lheading",k.lheading)("blockquote",k.blockquote)("tag","<"+k._tag)("def",k.def)(),k.normal=i({},k),k.gfm=i({},k.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),k.gfm.paragraph=g(k.paragraph)("(?!","(?!"+k.gfm.fences.source.replace("\\1","\\2")+"|"+k.list.source.replace("\\1","\\3")+"|")(),k.tables=i({},k.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=k,a.lex=function(b,c){var d=new a(c);return d.lex(b)},a.prototype.lex=function(a){return a=a.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(a,!0)},a.prototype.token=function(a,b,c){for(var d,e,f,g,h,i,j,l,m,a=a.replace(/^ +$/gm,"");a;)if((f=this.rules.newline.exec(a))&&(a=a.substring(f[0].length),f[0].length>1&&this.tokens.push({type:"space"})),f=this.rules.code.exec(a))a=a.substring(f[0].length),f=f[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?f:f.replace(/\n+$/,"")});else if(f=this.rules.fences.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"code",lang:f[2],text:f[3]});else if(f=this.rules.heading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:f[1].length,text:f[2]});else if(b&&(f=this.rules.nptable.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/\n$/,"").split("\n")},l=0;l<i.align.length;l++)/^ *-+: *$/.test(i.align[l])?i.align[l]="right":/^ *:-+: *$/.test(i.align[l])?i.align[l]="center":/^ *:-+ *$/.test(i.align[l])?i.align[l]="left":i.align[l]=null;for(l=0;l<i.cells.length;l++)i.cells[l]=i.cells[l].split(/ *\| */);this.tokens.push(i)}else if(f=this.rules.lheading.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"heading",depth:"="===f[2]?1:2,text:f[1]});else if(f=this.rules.hr.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"hr"});else if(f=this.rules.blockquote.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"blockquote_start"}),f=f[0].replace(/^ *> ?/gm,""),this.token(f,b,!0),this.tokens.push({type:"blockquote_end"});else if(f=this.rules.list.exec(a)){for(a=a.substring(f[0].length),g=f[2],this.tokens.push({type:"list_start",ordered:g.length>1}),f=f[0].match(this.rules.item),d=!1,m=f.length,l=0;m>l;l++)i=f[l],j=i.length,i=i.replace(/^ *([*+-]|\d+\.) +/,""),~i.indexOf("\n ")&&(j-=i.length,i=this.options.pedantic?i.replace(/^ {1,4}/gm,""):i.replace(new RegExp("^ {1,"+j+"}","gm"),"")),this.options.smartLists&&l!==m-1&&(h=k.bullet.exec(f[l+1])[0],g===h||g.length>1&&h.length>1||(a=f.slice(l+1).join("\n")+a,l=m-1)),e=d||/\n\n(?!\s*$)/.test(i),l!==m-1&&(d="\n"===i.charAt(i.length-1),e||(e=d)),this.tokens.push({type:e?"loose_item_start":"list_item_start"}),this.token(i,!1,c),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(f=this.rules.html.exec(a))a=a.substring(f[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===f[1]||"script"===f[1]||"style"===f[1],text:f[0]});else if(!c&&b&&(f=this.rules.def.exec(a)))a=a.substring(f[0].length),this.tokens.links[f[1].toLowerCase()]={href:f[2],title:f[3]};else if(b&&(f=this.rules.table.exec(a))){for(a=a.substring(f[0].length),i={type:"table",header:f[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3].replace(/(?: *\| *)?\n$/,"").split("\n")},l=0;l<i.align.length;l++)/^ *-+: *$/.test(i.align[l])?i.align[l]="right":/^ *:-+: *$/.test(i.align[l])?i.align[l]="center":/^ *:-+ *$/.test(i.align[l])?i.align[l]="left":i.align[l]=null;for(l=0;l<i.cells.length;l++)i.cells[l]=i.cells[l].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(i)}else if(b&&(f=this.rules.paragraph.exec(a)))a=a.substring(f[0].length),this.tokens.push({type:"paragraph",text:"\n"===f[1].charAt(f[1].length-1)?f[1].slice(0,-1):f[1]});else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),this.tokens.push({type:"text",text:f[0]});else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0));return this.tokens};var l={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:h,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};l._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,l._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,l.link=g(l.link)("inside",l._inside)("href",l._href)(),l.reflink=g(l.reflink)("inside",l._inside)(),l.normal=i({},l),l.pedantic=i({},l.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),l.gfm=i({},l.normal,{escape:g(l.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:g(l.text)("]|","~]|")("|","|https?://|")()}),l.breaks=i({},l.gfm,{br:g(l.br)("{2,}","*")(),text:g(l.gfm.text)("{2,}","*")()}),b.rules=l,b.output=function(a,c,d){var e=new b(c,d);return e.output(a)},b.prototype.output=function(a){for(var b,c,d,f,g="";a;)if(f=this.rules.escape.exec(a))a=a.substring(f[0].length),g+=f[1];else if(f=this.rules.autolink.exec(a))a=a.substring(f[0].length),"@"===f[2]?(c=this.mangle(":"===f[1].charAt(6)?f[1].substring(7):f[1]),d=this.mangle("mailto:")+c):(c=e(f[1]),d=c),g+=this.renderer.link(d,null,c);else if(this.inLink||!(f=this.rules.url.exec(a))){if(f=this.rules.tag.exec(a))!this.inLink&&/^<a /i.test(f[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(f[0])&&(this.inLink=!1),a=a.substring(f[0].length),g+=this.options.sanitize?e(f[0]):f[0];else if(f=this.rules.link.exec(a))a=a.substring(f[0].length),this.inLink=!0,g+=this.outputLink(f,{href:f[2],title:f[3]}),this.inLink=!1;else if((f=this.rules.reflink.exec(a))||(f=this.rules.nolink.exec(a))){if(a=a.substring(f[0].length),b=(f[2]||f[1]).replace(/\s+/g," "),b=this.links[b.toLowerCase()],!b||!b.href){g+=f[0].charAt(0),a=f[0].substring(1)+a;continue}this.inLink=!0,g+=this.outputLink(f,b),this.inLink=!1}else if(f=this.rules.strong.exec(a))a=a.substring(f[0].length),g+=this.renderer.strong(this.output(f[2]||f[1]));else if(f=this.rules.em.exec(a))a=a.substring(f[0].length),g+=this.renderer.em(this.output(f[2]||f[1]));else if(f=this.rules.code.exec(a))a=a.substring(f[0].length),g+=this.renderer.codespan(e(f[2],!0));else if(f=this.rules.br.exec(a))a=a.substring(f[0].length),g+=this.renderer.br();else if(f=this.rules.del.exec(a))a=a.substring(f[0].length),g+=this.renderer.del(this.output(f[1]));else if(f=this.rules.text.exec(a))a=a.substring(f[0].length),g+=e(this.smartypants(f[0]));else if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0))}else a=a.substring(f[0].length),c=e(f[1]),d=c,g+=this.renderer.link(d,null,c);return g},b.prototype.outputLink=function(a,b){var c=e(b.href),d=b.title?e(b.title):null;return"!"!==a[0].charAt(0)?this.renderer.link(c,d,this.output(a[1])):this.renderer.image(c,d,e(a[1]))},b.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):a},b.prototype.mangle=function(a){for(var b,c="",d=a.length,e=0;d>e;e++)b=a.charCodeAt(e),Math.random()>.5&&(b="x"+b.toString(16)),c+="&#"+b+";";return c},c.prototype.code=function(a,b,c){if(this.options.highlight){var d=this.options.highlight(a,b);null!=d&&d!==a&&(c=!0,a=d)}return b?'<pre><code class="'+this.options.langPrefix+e(b,!0)+'">'+(c?a:e(a,!0))+"\n</code></pre>\n":"<pre><code>"+(c?a:e(a,!0))+"\n</code></pre>"},c.prototype.blockquote=function(a){return"<blockquote>\n"+a+"</blockquote>\n"},c.prototype.html=function(a){return a},c.prototype.heading=function(a,b,c){return"<h"+b+' id="'+this.options.headerPrefix+c.toLowerCase().replace(/[^\w]+/g,"-")+'">'+a+"</h"+b+">\n"},c.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},c.prototype.list=function(a,b){var c=b?"ol":"ul";return"<"+c+">\n"+a+"</"+c+">\n"},c.prototype.listitem=function(a){return"<li>"+a+"</li>\n"},c.prototype.paragraph=function(a){return"<p>"+a+"</p>\n"},c.prototype.table=function(a,b){return"<table>\n<thead>\n"+a+"</thead>\n<tbody>\n"+b+"</tbody>\n</table>\n"},c.prototype.tablerow=function(a){return"<tr>\n"+a+"</tr>\n"},c.prototype.tablecell=function(a,b){var c=b.header?"th":"td",d=b.align?"<"+c+' style="text-align:'+b.align+'">':"<"+c+">";return d+a+"</"+c+">\n"},c.prototype.strong=function(a){return"<strong>"+a+"</strong>"},c.prototype.em=function(a){return"<em>"+a+"</em>"},c.prototype.codespan=function(a){return"<code>"+a+"</code>"},c.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},c.prototype.del=function(a){return"<del>"+a+"</del>"},c.prototype.link=function(a,b,c){if(this.options.sanitize){try{var d=decodeURIComponent(f(a)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===d.indexOf("javascript:"))return""}var g='<a href="'+a+'"';return b&&(g+=' title="'+b+'"'),g+=">"+c+"</a>"},c.prototype.image=function(a,b,c){var d='<img src="'+a+'" alt="'+c+'"';return b&&(d+=' title="'+b+'"'),d+=this.options.xhtml?"/>":">"},d.parse=function(a,b,c){var e=new d(b,c);return e.parse(a)},d.prototype.parse=function(a){this.inline=new b(a.links,this.options,this.renderer),this.tokens=a.reverse();for(var c="";this.next();)c+=this.tok();return c},d.prototype.next=function(){return this.token=this.tokens.pop()},d.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},d.prototype.parseText=function(){for(var a=this.token.text;"text"===this.peek().type;)a+="\n"+this.next().text;return this.inline.output(a)},d.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var a,b,c,d,e,f="",g="";for(c="",a=0;a<this.token.header.length;a++)d={header:!0,align:this.token.align[a]},c+=this.renderer.tablecell(this.inline.output(this.token.header[a]),{header:!0,align:this.token.align[a]});for(f+=this.renderer.tablerow(c),a=0;a<this.token.cells.length;a++){for(b=this.token.cells[a],c="",e=0;e<b.length;e++)c+=this.renderer.tablecell(this.inline.output(b[e]),{header:!1,align:this.token.align[e]});g+=this.renderer.tablerow(c)}return this.renderer.table(f,g);case"blockquote_start":for(var g="";"blockquote_end"!==this.next().type;)g+=this.tok();return this.renderer.blockquote(g);case"list_start":for(var g="",h=this.token.ordered;"list_end"!==this.next().type;)g+=this.tok();return this.renderer.list(g,h);case"list_item_start":for(var g="";"list_item_end"!==this.next().type;)g+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(g);case"loose_item_start":for(var g="";"list_item_end"!==this.next().type;)g+=this.tok();return this.renderer.listitem(g);case"html":var i=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(i);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},h.exec=h,j.options=j.setOptions=function(a){return i(j.defaults,a),j},j.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new c,xhtml:!1},j.Parser=d,j.parser=d.parse,j.Renderer=c,j.Lexer=a,j.lexer=a.lex,j.InlineLexer=b,j.inlineLexer=b.output,j.parse=j,"undefined"!=typeof module&&"object"==typeof exports?module.exports=j:"function"==typeof define&&define.amd?define(function(){return j}):this.marked=j}.call(function(){return this||("undefined"!=typeof window?window:global)}()),function(){function use(a){_p.r([moduleMapping[a]])}var _p={r:function(a){if(_p[a].inited)return _p[a].value;if("function"!=typeof _p[a].value)return _p[a].inited=!0,_p[a].value;var b={exports:{}},c=_p[a].value(null,b.exports,b);if(_p[a].inited=!0,_p[a].value=c,void 0!==c)return c;for(var d in b.exports)if(b.exports.hasOwnProperty(d))return _p[a].inited=!0,_p[a].value=b.exports,b.exports}};_p[0]={value:function(a){function b(a){var b=parseFloat(a,10);return/ms/.test(a)?b:/s/.test(a)?1e3*b:/min/.test(a)?60*b*1e3:b}var c=_p.r(8),d=_p.r(1),e=_p.r(11).createClass("Animator",{constructor:function(a,b,c){if(1==arguments.length){var d=arguments[0];this.beginValue=d.beginValue,this.finishValue=d.finishValue,this.setter=d.setter}else this.beginValue=a,this.finishValue=b,this.setter=c},start:function(a,c,d,e,f){2===arguments.length&&"object"==typeof c&&(d=c.easing,e=c.delay,f=c.callback,c=c.duration),4===arguments.length&&"function"==typeof e&&(f=e,e=0);var g=this.create(a,c,d,f);return e=b(e),e>0?setTimeout(function(){g.play()},e):g.play(),g},create:function(a,f,g,h){var i;return f=f&&b(f)||e.DEFAULT_DURATION,g=g||e.DEFAULT_EASING,"string"==typeof g&&(g=d[g]),i=new c(this,a,f,g),"function"==typeof h&&i.on("finish",h),i},reverse:function(){return new e(this.finishValue,this.beginValue,this.setter)}});e.DEFAULT_DURATION=300,e.DEFAULT_EASING="linear";var f=_p.r(60);return _p.r(11).extendClass(f,{animate:function(a,b,c,d,e){function f(){g.shift(),g.length&&setTimeout(g[0].t.play.bind(g[0].t),g[0].d)}var g=this._KityAnimateQueue=this._KityAnimateQueue||[],h=a.create(this,b,c,e);return h.on("finish",f),g.push({t:h,d:d}),1==g.length&&setTimeout(h.play.bind(h),d),this},timeline:function(){return this._KityAnimateQueue[0].t},stop:function(){var a=this._KityAnimateQueue;if(a)for(;a.length;)a.shift().t.stop();return this}}),e}},_p[1]={value:function(a,b,c){var d={linear:function(a,b,c,d){return c*(a/d)+b},swing:function(a,b,c,e){return d.easeOutQuad(a,b,c,e)},ease:function(a,b,c,e){return d.easeInOutCubic(a,b,c,e)},easeInQuad:function(a,b,c,d){return c*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},easeInCubic:function(a,b,c,d){return c*(a/=d)*a*a+b},easeOutCubic:function(a,b,c,d){return c*((a=a/d-1)*a*a+1)+b},easeInOutCubic:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a+b:c/2*((a-=2)*a*a+2)+b},easeInQuart:function(a,b,c,d){return c*(a/=d)*a*a*a+b},easeOutQuart:function(a,b,c,d){return-c*((a=a/d-1)*a*a*a-1)+b},easeInOutQuart:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a+b:-c/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(a,b,c,d){return c*(a/=d)*a*a*a*a+b},easeOutQuint:function(a,b,c,d){return c*((a=a/d-1)*a*a*a*a+1)+b},easeInOutQuint:function(a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a*a+b:c/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},easeOutSine:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},easeInOutSine:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},easeInExpo:function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b},easeOutExpo:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},easeInOutExpo:function(a,b,c,d){return 0===a?b:a==d?b+c:(a/=d/2)<1?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(a,b,c,d){return-c*(Math.sqrt(1-(a/=d)*a)-1)+b},easeOutCirc:function(a,b,c,d){return c*Math.sqrt(1-(a=a/d-1)*a)+b},easeInOutCirc:function(a,b,c,d){return(a/=d/2)<1?-c/2*(Math.sqrt(1-a*a)-1)+b:c/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(a,b,c,d){var e=1.70158,f=0,g=c;return 0===a?b:1==(a/=d)?b+c:(f||(f=.3*d),g<Math.abs(c)?(g=c,e=f/4):e=f/(2*Math.PI)*Math.asin(c/g),-(g*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-e)*Math.PI/f))+b)},easeOutElastic:function(a,b,c,d){var e=1.70158,f=0,g=c;return 0===a?b:1==(a/=d)?b+c:(f||(f=.3*d),g<Math.abs(c)?(g=c,e=f/4):e=f/(2*Math.PI)*Math.asin(c/g),g*Math.pow(2,-10*a)*Math.sin(2*(a*d-e)*Math.PI/f)+c+b)},easeInOutElastic:function(a,b,c,d){var e=1.70158,f=0,g=c;if(0===a)return b;if(2==(a/=d/2))return b+c;if(f||(f=.3*d*1.5),g<Math.abs(c)){g=c;var e=f/4}else var e=f/(2*Math.PI)*Math.asin(c/g);return 1>a?-.5*g*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-e)*Math.PI/f)+b:g*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-e)*Math.PI/f)*.5+c+b},easeInBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),c*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),c*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){return void 0==e&&(e=1.70158),(a/=d/2)<1?c/2*a*a*(((e*=1.525)+1)*a-e)+b:c/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,c,e){return c-d.easeOutBounce(e-a,0,c,e)+b},easeOutBounce:function(a,b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:2/2.75>a?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,c,e){return e/2>a?.5*d.easeInBounce(2*a,0,c,e)+b:.5*d.easeOutBounce(2*a-e,0,c,e)+.5*c+b}};return d}},_p[2]={value:function(a,b){function c(a){1===l.push(a)&&(i=j(d))}function d(){var a=l;for(l=[];a.length;)h(a.pop());i=0}function e(a){var b=g(a);return c(b),b}function f(a){var b=l.indexOf(a);~b&&l.splice(b,1),0===l.length&&k(i)}function g(a){var b={index:0,time:+new Date,elapsed:0,action:a,next:function(){c(b)}};return b}function h(a){var b=+new Date,c=b-a.time;c>200&&(c=1e3/60),a.dur=c,a.elapsed+=c,a.time=b,a.action.call(null,a),a.index++}var i,j=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(a){return setTimeout(a,1e3/60)},k=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame||window.clearTimeout,l=[];b.requestFrame=e,b.releaseFrame=f}},_p[3]={value:function(a){var b=_p.r(0),c=_p.r(34),d=_p.r(46),e=_p.r(60),f=_p.r(11).createClass("MotionAnimator",{
  15. base:b,constructor:function(a,b){var e=this;this.callBase({beginValue:0,finishValue:1,setter:function(a,b){var f=e.motionPath instanceof d?e.motionPath.getPathData():e.motionPath,g=c.pointAtPath(f,b);a.setTranslate(g.x,g.y),this.doRotate&&a.setRotate(g.tan.getAngle())}}),this.doRotate=b,this.motionPath=a}});return _p.r(11).extendClass(e,{motion:function(a,b,c,d,e){return this.animate(new f(a),b,c,d,e)}}),f}},_p[4]={value:function(a){var b=_p.r(0),c=_p.r(11).createClass("OpacityAnimator",{base:b,constructor:function(a){this.callBase({beginValue:function(a){return a.getOpacity()},finishValue:a,setter:function(a,b){a.setOpacity(b)}})}}),d=_p.r(60);return _p.r(11).extendClass(d,{fxOpacity:function(a,b,d,e,f){return this.animate(new c(a),b,d,e,f)},fadeTo:function(){return this.fxOpacity.apply(this,arguments)},fadeIn:function(){return this.fxOpacity.apply(this,[1].concat([].slice.call(arguments)))},fadeOut:function(){return this.fxOpacity.apply(this,[0].concat([].slice.call(arguments)))}}),c}},_p[5]={value:function(a){var b=_p.r(0),c=_p.r(34),d=_p.r(11).createClass("OpacityAnimator",{base:b,constructor:function(a){this.callBase({beginValue:function(a){return this.beginPath=a.getPathData(),0},finishValue:1,setter:function(b,d){b.setPathData(c.pathTween(this.beginPath,a,d))}})}}),e=_p.r(46);return _p.r(11).extendClass(e,{fxPath:function(a,b,c,e,f){return this.animate(new d(a),b,c,e,f)}}),d}},_p[6]={value:function(a){var b=_p.r(0),c=_p.r(11).createClass("RotateAnimator",{base:b,constructor:function(a){this.callBase({beginValue:0,finishValue:a,setter:function(a,b,c){var d=c.getDelta();a.rotate(d,ax,ay)}})}}),d=_p.r(60);return _p.r(11).extendClass(d,{fxRotate:function(a,b,d,e,f){return this.animate(new c(a),b,d,e,f)}}),c}},_p[7]={value:function(a){var b=_p.r(0),c=_p.r(11).createClass("ScaleAnimator",{base:b,constructor:function(a,b){this.callBase({beginValue:0,finishValue:1,setter:function(c,d,e){var f=e.getDelta(),g=Math.pow(a,f),h=Math.pow(b,f);c.scale(h,g)}})}}),d=_p.r(60);return _p.r(11).extendClass(d,{fxScale:function(a,b,d,e,f,g){return this.animate(new c(a,b),d,e,f,g)}}),c}},_p[8]={value:function(a){function b(a,b,c){return f.paralle(a,b,function(a,b){return a+(b-a)*c})}function c(a,b){return f.paralle(a,b,function(a,b){return b-a})}function d(a,b,c){this.timeline=a,this.target=a.target,this.type=b;for(var d in c)c.hasOwnProperty(d)&&(this[d]=c[d])}var e=_p.r(33),f=_p.r(12),g=_p.r(2),h=_p.r(11).createClass("Timeline",{mixins:[e],constructor:function(a,b,c,d){this.callMixin(),this.target=b,this.time=0,this.duration=c,this.easing=d,this.animator=a,this.beginValue=a.beginValue,this.finishValue=a.finishValue,this.setter=a.setter,this.status="ready"},nextFrame:function(a){"playing"==this.status&&(this.time+=a.dur,this.setValue(this.getValue()),this.time>=this.duration&&this.timeUp(),a.next())},getPlayTime:function(){return this.rollbacking?this.duration-this.time:this.time},getTimeProportion:function(){return this.getPlayTime()/this.duration},getValueProportion:function(){return this.easing(this.getPlayTime(),0,1,this.duration)},getValue:function(){var a=this.beginValue,c=this.finishValue,d=this.getValueProportion();return b(a,c,d)},setValue:function(a){this.lastValue=this.currentValue,this.currentValue=a,this.setter.call(this.target,this.target,a,this)},getDelta:function(){return this.lastValue=void 0===this.lastValue?this.beginValue:this.lastValue,c(this.lastValue,this.currentValue)},play:function(){var a=this.status;switch(this.status="playing",a){case"ready":f.isFunction(this.beginValue)&&(this.beginValue=this.beginValue.call(this.target,this.target)),f.isFunction(this.finishValue)&&(this.finishValue=this.finishValue.call(this.target,this.target)),this.time=0,this.setValue(this.beginValue),this.frame=g.requestFrame(this.nextFrame.bind(this));break;case"finished":case"stoped":this.time=0,this.frame=g.requestFrame(this.nextFrame.bind(this));break;case"paused":this.frame.next()}return this.fire("play",new d(this,"play",{lastStatus:a})),this},pause:function(){return this.status="paused",this.fire("pause",new d(this,"pause")),g.releaseFrame(this.frame),this},stop:function(){return this.status="stoped",this.setValue(this.finishValue),this.rollbacking=!1,this.fire("stop",new d(this,"stop")),g.releaseFrame(this.frame),this},timeUp:function(){this.repeatOption?(this.time=0,this.rollback?this.rollbacking?(this.decreaseRepeat(),this.rollbacking=!1):(this.rollbacking=!0,this.fire("rollback",new d(this,"rollback"))):this.decreaseRepeat(),this.repeatOption?this.fire("repeat",new d(this,"repeat")):this.finish()):this.finish()},finish:function(){this.setValue(this.finishValue),this.status="finished",this.fire("finish",new d(this,"finish")),g.releaseFrame(this.frame)},decreaseRepeat:function(){this.repeatOption!==!0&&this.repeatOption--},repeat:function(a,b){return this.repeatOption=a,this.rollback=b,this}});return h.requestFrame=g.requestFrame,h.releaseFrame=g.releaseFrame,h}},_p[9]={value:function(a){var b=_p.r(0),c=_p.r(11).createClass("TranslateAnimator",{base:b,constructor:function(a,b){this.callBase({x:0,y:0},{x:a,y:b},function(a,b,c){var d=c.getDelta();a.translate(d.x,d.y)})}}),d=_p.r(60);return _p.r(11).extendClass(d,{fxTranslate:function(a,b,d,e,f,g){return this.animate(new c(a,b),d,e,f,g)}}),c}},_p[10]={value:function(){var a=function(){var a,b=navigator.userAgent.toLowerCase(),c=window.opera;a={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(b),opera:!!c&&c.version,webkit:b.indexOf(" applewebkit/")>-1,mac:b.indexOf("macintosh")>-1},a.gecko="Gecko"==navigator.product&&!a.webkit&&!a.opera&&!a.ie;var d=0;if(a.ie&&(d=1*(b.match(/(msie\s|trident.*rv:)([\w.]+)/)[2]||0),a.ie11Compat=11==document.documentMode,a.ie9Compat=9==document.documentMode),a.gecko){var e=b.match(/rv:([\d\.]+)/);e&&(e=e[1].split("."),d=1e4*e[0]+100*(e[1]||0)+1*(e[2]||0))}return/chrome\/(\d+\.\d)/i.test(b)&&(a.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(b)&&!/chrome/i.test(b)&&(a.safari=+(RegExp.$1||RegExp.$2)),a.opera&&(d=parseFloat(c.version())),a.webkit&&(d=parseFloat(b.match(/ applewebkit\/(\d+)/)[1])),a.version=d,a.isCompatible=!a.mobile&&(a.ie&&d>=6||a.gecko&&d>=10801||a.opera&&d>=9.5||a.air&&d>=1||a.webkit&&d>=522||!1),a}();return a}},_p[11]={value:function(require,exports){function Class(){}function checkBaseConstructorCall(a,b){var c=a.toString();if(!/this\.callBase/.test(c))throw new Error(b+" : 类构造函数没有调用父类的构造函数!为了安全,请调用父类的构造函数")}function inherit(constructor,BaseClass,classname){var KityClass=eval("(function "+classname+"( __inherit__flag ) {if( __inherit__flag != KITY_INHERIT_FLAG ) {KityClass.__KityConstructor.apply(this, arguments);}this.__KityClassName = KityClass.__KityClassName;})");KityClass.__KityConstructor=constructor,KityClass.prototype=new BaseClass(KITY_INHERIT_FLAG);for(var methodName in BaseClass.prototype)BaseClass.prototype.hasOwnProperty(methodName)&&0!==methodName.indexOf("__Kity")&&(KityClass.prototype[methodName]=BaseClass.prototype[methodName]);return KityClass.prototype.constructor=KityClass,KityClass}function mixin(a,b){if(!1==b instanceof Array)return a;var c,d,e,f=b.length;for(a.__KityMixins={constructor:[]},c=0;f>c;c++){d=b[c].prototype;for(e in d)!1!==d.hasOwnProperty(e)&&0!==e.indexOf("__Kity")&&("constructor"===e?a.__KityMixins.constructor.push(d[e]):a.prototype[e]=a.__KityMixins[e]=d[e])}return a}function extend(a,b){b.__KityClassName&&(b=b.prototype);for(var c in b)if(b.hasOwnProperty(c)&&c.indexOf("__Kity")&&"constructor"!=c){var d=a.prototype[c]=b[c];d.__KityMethodClass=a,d.__KityMethodName=c}return a}exports.Class=Class,Class.__KityClassName="Class",Class.prototype.base=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityBaseClass.prototype[a];return c.apply(this,Array.prototype.slice.call(arguments,1))},Class.prototype.callBase=function(){var a=arguments.callee.caller,b=a.__KityMethodClass.__KityBaseClass.prototype[a.__KityMethodName];return b.apply(this,arguments)},Class.prototype.mixin=function(a){var b=arguments.callee.caller,c=b.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[a];return d.apply(this,Array.prototype.slice.call(arguments,1))},Class.prototype.callMixin=function(){var a=arguments.callee.caller,b=a.__KityMethodName,c=a.__KityMethodClass.__KityMixins;if(!c)return this;var d=c[b];if("constructor"==b){for(var e=0,f=d.length;f>e;e++)d[e].call(this);return this}return d.apply(this,arguments)},Class.prototype.pipe=function(a){return"function"==typeof a&&a.call(this,this),this},Class.prototype.getType=function(){return this.__KityClassName},Class.prototype.getClass=function(){return this.constructor};var KITY_INHERIT_FLAG="__KITY_INHERIT_FLAG_"+ +new Date;exports.createClass=function(a,b){var c,d,e;return 1===arguments.length&&(b=arguments[0],a="AnonymousClass"),e=b.base||Class,b.hasOwnProperty("constructor")?(c=b.constructor,e!=Class&&checkBaseConstructorCall(c,a)):c=function(){this.callBase.apply(this,arguments),this.callMixin.apply(this,arguments)},d=inherit(c,e,a),d=mixin(d,b.mixins),d.__KityClassName=c.__KityClassName=a,d.__KityBaseClass=c.__KityBaseClass=e,d.__KityMethodName=c.__KityMethodName="constructor",d.__KityMethodClass=c.__KityMethodClass=d,delete b.mixins,delete b.constructor,delete b.base,d=extend(d,b)},exports.extendClass=extend}},_p[12]={value:function(){var a={each:function(a,b,c){if(null!==a)if(a.length===+a.length){for(var d=0,e=a.length;e>d;d++)if(b.call(c,a[d],d,a)===!1)return!1}else for(var f in a)if(a.hasOwnProperty(f)&&b.call(c,a[f],f,a)===!1)return!1},extend:function(a){for(var b=arguments,c=this.isBoolean(b[b.length-1])?b[b.length-1]:!1,d=this.isBoolean(b[b.length-1])?b.length-1:b.length,e=1;d>e;e++){var f=b[e];for(var g in f)c&&a.hasOwnProperty(g)||(a[g]=f[g])}return a},deepExtend:function(a,b){for(var c=arguments,d=this.isBoolean(c[c.length-1])?c[c.length-1]:!1,e=this.isBoolean(c[c.length-1])?c.length-1:c.length,f=1;e>f;f++){var g=c[f];for(var h in g)d&&a.hasOwnProperty(h)||(this.isObject(a[h])&&this.isObject(g[h])?this.deepExtend(a[h],g[h],d):a[h]=g[h])}return a},clone:function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},copy:function(a){return"object"!=typeof a?a:"function"==typeof a?null:JSON.parse(JSON.stringify(a))},queryPath:function(a,b){for(var c=a.split("."),d=0,e=b,f=c.length;f>d;){if(!(c[d]in e))return void 0;if(e=e[c[d]],d++,d>=f||void 0===e)return e}},getValue:function(a,b){return void 0!==a?a:b},flatten:function(b){var c,d=[],e=b.length;for(c=0;e>c;c++)b[c]instanceof Array?d=d.concat(a.flatten(b[c])):d.push(b[c]);return d},paralle:function(b,c,d){var e,f,g,h;if(b instanceof Array){for(h=[],f=0;f<b.length;f++)h.push(a.paralle(b[f],c[f],d));return h}if(b instanceof Object){if(e=b.getClass&&b.getClass(),e&&e.parse)b=b.valueOf(),c=c.valueOf(),h=a.paralle(b,c,d),h=e.parse(h);else{h={};for(g in b)b.hasOwnProperty(g)&&c.hasOwnProperty(g)&&(h[g]=a.paralle(b[g],c[g],d))}return h}return!1===isNaN(parseFloat(b))?d(b,c):h},parallelize:function(b){return function(c,d){return a.paralle(c,d,b)}}};return a.each(["String","Function","Array","Number","RegExp","Object","Boolean"],function(b){a["is"+b]=function(a){return Object.prototype.toString.apply(a)=="[object "+b+"]"}}),a}},_p[13]={value:function(a,b,c){var d=_p.r(16),e=_p.r(12),f=_p.r(11).createClass("ColorMatrixEffect",{base:d,constructor:function(a,b){this.callBase(d.NAME_COLOR_MATRIX),this.set("type",e.getValue(a,f.TYPE_MATRIX)),this.set("in",e.getValue(b,d.INPUT_SOURCE_GRAPHIC))}});return e.extend(f,{TYPE_MATRIX:"matrix",TYPE_SATURATE:"saturate",TYPE_HUE_ROTATE:"hueRotate",TYPE_LUMINANCE_TO_ALPHA:"luminanceToAlpha",MATRIX_ORIGINAL:"10000010000010000010".split("").join(" "),MATRIX_EMPTY:"00000000000000000000".split("").join(" ")}),f}},_p[14]={value:function(a,b,c){var d=_p.r(16),e=_p.r(12),f=_p.r(11).createClass("CompositeEffect",{base:d,constructor:function(a,b,c){this.callBase(d.NAME_COMPOSITE),this.set("operator",e.getValue(a,f.OPERATOR_OVER)),b&&this.set("in",b),c&&this.set("in2",c)}});return e.extend(f,{OPERATOR_OVER:"over",OPERATOR_IN:"in",OPERATOR_OUT:"out",OPERATOR_ATOP:"atop",OPERATOR_XOR:"xor",OPERATOR_ARITHMETIC:"arithmetic"}),f}},_p[15]={value:function(a,b,c){var d=_p.r(16),e=_p.r(12),f=_p.r(11).createClass("ConvolveMatrixEffect",{base:d,constructor:function(a,b){this.callBase(d.NAME_CONVOLVE_MATRIX),this.set("edgeMode",e.getValue(a,f.MODE_DUPLICATE)),this.set("in",e.getValue(b,d.INPUT_SOURCE_GRAPHIC))}});return e.extend(f,{MODE_DUPLICATE:"duplicate",MODE_WRAP:"wrap",MODE_NONE:"none"}),f}},_p[16]={value:function(a,b,c){var d=_p.r(67),e=_p.r(11).createClass("Effect",{constructor:function(a){this.node=d.createNode(a)},getId:function(){return this.node.id},setId:function(a){return this.node.id=a,this},set:function(a,b){return this.node.setAttribute(a,b),this},get:function(a){return this.node.getAttribute(a)},getNode:function(){return this.node},toString:function(){return this.node.getAttribute("result")||""}});return _p.r(12).extend(e,{NAME_GAUSSIAN_BLUR:"feGaussianBlur",NAME_OFFSET:"feOffset",NAME_COMPOSITE:"feComposite",NAME_COLOR_MATRIX:"feColorMatrix",NAME_CONVOLVE_MATRIX:"feConvolveMatrix",INPUT_SOURCE_GRAPHIC:"SourceGraphic",INPUT_SOURCE_ALPHA:"SourceAlpha",INPUT_BACKGROUND_IMAGE:"BackgroundImage",INPUT_BACKGROUND_ALPHA:"BackgroundAlpha",INPUT_FILL_PAINT:"FillPaint",INPUT_STROKE_PAINT:"StrokePaint"}),e}},_p[17]={value:function(a,b,c){var d=_p.r(16),e=_p.r(12);return _p.r(11).createClass("GaussianblurEffect",{base:d,constructor:function(a,b){this.callBase(d.NAME_GAUSSIAN_BLUR),this.set("stdDeviation",e.getValue(a,1)),this.set("in",e.getValue(b,d.INPUT_SOURCE_GRAPHIC))}})}},_p[18]={value:function(a,b,c){var d=_p.r(16),e=_p.r(12);return _p.r(11).createClass("OffsetEffect",{base:d,constructor:function(a,b,c){this.callBase(d.NAME_OFFSET),this.set("dx",e.getValue(a,0)),this.set("dy",e.getValue(b,0)),this.set("in",e.getValue(c,d.INPUT_SOURCE_GRAPHIC))}})}},_p[19]={value:function(a){return _p.r(11).createClass("EffectContainer",{base:_p.r(29),addEffect:function(a,b){return this.addItem.apply(this,arguments)},prependEffect:function(){return this.prependItem.apply(this,arguments)},appendEffect:function(){return this.appendItem.apply(this,arguments)},removeEffect:function(a){return this.removeItem.apply(this,arguments)},addEffects:function(){return this.addItems.apply(this,arguments)},setEffects:function(){return this.setItems.apply(this,arguments)},getEffect:function(){return this.getItem.apply(this,arguments)},getEffects:function(){return this.getItems.apply(this,arguments)},getFirstEffect:function(){return this.getFirstItem.apply(this,arguments)},getLastEffect:function(){return this.getLastItem.apply(this,arguments)},handleAdd:function(a,b){var c=this.getEffects().length,d=this.getItem(b+1);return c===b+1?void this.node.appendChild(a.getNode()):void this.node.insertBefore(a.getNode(),d.getNode())}})}},_p[20]={value:function(a,b,c){var d=_p.r(67),e=_p.r(11),f=e.createClass("Filter",{mixins:[_p.r(19)],constructor:function(a,b,c,e){this.node=d.createNode("filter"),void 0!==a&&this.set("x",a),void 0!==b&&this.set("y",b),void 0!==c&&this.set("width",c),void 0!==e&&this.set("height",e)},getId:function(){return this.id},setId:function(a){return this.node.id=a,this},set:function(a,b){return this.node.setAttribute(a,b),this},get:function(a){return this.node.getAttribute(a)},getNode:function(){return this.node}}),g=_p.r(60);return e.extendClass(g,{applyFilter:function(a){var b=a.get("id");return b&&this.node.setAttribute("filter","url(#"+b+")"),this}}),f}},_p[21]={value:function(a,b,c){var d=_p.r(17);return _p.r(11).createClass("GaussianblurFilter",{base:_p.r(20),constructor:function(a){this.callBase(),this.addEffect(new d(a))}})}},_p[22]={value:function(a,b,c){var d=_p.r(17),e=_p.r(16),f=_p.r(13),g=_p.r(28),h=_p.r(12),i=_p.r(14),j=_p.r(18);return _p.r(11).createClass("ProjectionFilter",{base:_p.r(20),constructor:function(a,b,c){this.callBase(),this.gaussianblurEffect=new d(a,e.INPUT_SOURCE_ALPHA),this.gaussianblurEffect.set("result","gaussianblur"),this.addEffect(this.gaussianblurEffect),this.offsetEffect=new j(b,c,this.gaussianblurEffect),this.offsetEffect.set("result","offsetBlur"),this.addEffect(this.offsetEffect),this.colorMatrixEffect=new f(f.TYPE_MATRIX,this.offsetEffect),this.colorMatrixEffect.set("values",f.MATRIX_ORIGINAL),this.colorMatrixEffect.set("result","colorOffsetBlur"),this.addEffect(this.colorMatrixEffect),this.compositeEffect=new i(i.OPERATOR_OVER,e.INPUT_SOURCE_GRAPHIC,this.colorMatrixEffect),this.addEffect(this.compositeEffect)},setColor:function(a){var b=null,c=[];if(h.isString(a)&&(a=g.parse(a)),!a)return this;b=f.MATRIX_EMPTY.split(" "),c.push(a.get("r")),c.push(a.get("g")),c.push(a.get("b"));for(var d=0,e=c.length;e>d;d++)b[5*d+3]=c[d]/255;return b[18]=a.get("a"),this.colorMatrixEffect.set("values",b.join(" ")),this},setOpacity:function(a){var b=this.colorMatrixEffect.get("values").split(" ");return b[18]=a,this.colorMatrixEffect.set("values",b.join(" ")),this},setOffset:function(a,b){this.setOffsetX(a),this.setOffsetY(b)},setOffsetX:function(a){this.offsetEffect.set("dx",a)},setOffsetY:function(a){this.offsetEffect.set("dy",a)},setDeviation:function(a){this.gaussianblurEffect.set("stdDeviation",a)}})}},_p[23]={value:function(a,b,c){return _p.r(11).createClass("Bezier",{mixins:[_p.r(51)],base:_p.r(46),constructor:function(a){this.callBase(),a=a||[],this.changeable=!0,this.setBezierPoints(a)},getBezierPoints:function(){return this.getPoints()},setBezierPoints:function(a){return this.setPoints(a)},onContainerChanged:function(){this.changeable&&this.update()},update:function(){var a=null,b=this.getBezierPoints();if(!(b.length<2)){a=this.getDrawer(),a.clear();var c=b[0].getVertex(),d=null,e=null;a.moveTo(c.x,c.y);for(var f=1,g=b.length;g>f;f++)c=b[f].getVertex(),e=b[f].getBackward(),d=b[f-1].getForward(),a.bezierTo(d.x,d.y,e.x,e.y,c.x,c.y);return this}}})}},_p[24]={value:function(a,b,c){var d=_p.r(63),e=_p.r(73),f=_p.r(11).createClass("BezierPoint",{constructor:function(a,b,c){this.vertex=new d(a,b),this.forward=new d(a,b),this.backward=new d(a,b),this.setSmooth(void 0===c||c),this.setSymReflaction(!0)},clone:function(){var a=new f,b=null;return b=this.getVertex(),a.setVertex(b.x,b.y),b=this.getForward(),a.setForward(b.x,b.y),b=this.getBackward(),a.setBackward(b.x,b.y),a.setSymReflaction(this.isSymReflaction),a.setSmooth(this.isSmooth()),a},setVertex:function(a,b){return this.vertex.setPoint(a,b),this.update(),this},moveTo:function(a,b){var c=this.forward.getPoint(),d=this.backward.getPoint(),e=this.vertex.getPoint(),f={left:a-e.x,top:b-e.y};this.forward.setPoint(c.x+f.left,c.y+f.top),this.backward.setPoint(d.x+f.left,d.y+f.top),this.vertex.setPoint(a,b),this.update()},setForward:function(a,b){return this.forward.setPoint(a,b),this.smooth&&this.updateAnother(this.forward,this.backward),this.update(),this.lastControlPointSet=this.forward,this},setBackward:function(a,b){return this.backward.setPoint(a,b),this.smooth&&this.updateAnother(this.backward,this.forward),this.update(),this.lastControlPointSet=this.backward,this},setSymReflaction:function(a){return this.symReflaction=a,this.smooth&&this.setSmooth(!0),this},isSymReflaction:function(){return this.symReflaction},updateAnother:function(a,b){var c=this.getVertex(),d=e.fromPoints(a.getPoint(),c),f=e.fromPoints(c,b.getPoint());return f=d.normalize(this.isSymReflaction()?d.length():f.length()),b.setPoint(c.x+f.x,c.y+f.y),this},setSmooth:function(a){var b;return this.smooth=!!a,this.smooth&&(b=this.lastControlPointSet)&&this.updateAnother(b,b==this.forward?this.backward:this.forward),this},isSmooth:function(){return this.smooth},getVertex:function(){return this.vertex.getPoint()},getForward:function(){return this.forward.getPoint()},getBackward:function(){return this.backward.getPoint()},update:function(){return this.container?void(this.container.update&&this.container.update(this)):this}});return f}},_p[25]={value:function(a,b,c){var d=_p.r(11).createClass("Box",{constructor:function(a,b,c,d){var e=arguments[0];e&&"object"==typeof e&&(a=e.x,b=e.y,c=e.width,d=e.height),0>c&&(a-=c=-c),0>d&&(b-=d=-d),this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.left=this.x,this.right=this.x+this.width,this.top=this.y,this.bottom=this.y+this.height,this.cx=this.x+this.width/2,this.cy=this.y+this.height/2},getRangeX:function(){return[this.left,this.right]},getRangeY:function(){return[this.top,this.bottom]},merge:function(a){if(this.isEmpty())return new d(a.x,a.y,a.width,a.height);var b=Math.min(this.left,a.left),c=Math.max(this.right,a.right),e=Math.min(this.top,a.top),f=Math.max(this.bottom,a.bottom);return new d(b,e,c-b,f-e)},intersect:function(a){!a instanceof d&&(a=new d(a));var b=Math.max(this.left,a.left),c=Math.min(this.right,a.right),e=Math.max(this.top,a.top),f=Math.min(this.bottom,a.bottom);return b>c||e>f?new d:new d(b,e,c-b,f-e)},expand:function(a,b,c,e){if(arguments.length<1)return new d(this);arguments.length<2&&(b=a),arguments.length<3&&(c=a),arguments.length<4&&(e=b);var f=this.left-e,g=this.top-a,h=this.width+b,i=this.height+a;return new d(f,g,h,i)},valueOf:function(){return[this.x,this.y,this.width,this.height]},toString:function(){return this.valueOf().join(" ")},isEmpty:function(){return!this.width||!this.height}});return d.parse=function(a){return"string"==typeof a?d.parse(a.split(/[\s,]+/).map(parseFloat)):a instanceof Array?new d(a[0],a[1],a[2],a[3]):"x"in a?new d(a):null},d}},_p[26]={value:function(a,b,c){return _p.r(11).createClass("Circle",{base:_p.r(32),constructor:function(a,b,c){this.callBase(a,a,b,c)},getRadius:function(){return this.getRadiusX()},setRadius:function(a){return this.callBase(a,a)}})}},_p[27]={value:function(a,b,c){var d=_p.r(11),e=_p.r(60),f=d.createClass("Clip",{base:e,mixins:[_p.r(61)],constructor:function(a){this.callBase("clipPath",a)},clip:function(a){return a.getNode().setAttribute("clip-path",this),this}});return d.extendClass(e,{clipWith:function(a){return a instanceof e&&(a=new f(a.getPaper()).addShape(a)),a.clip(this),this}}),f}},_p[28]={value:function(a,b,c){var d=_p.r(12),e=_p.r(64),f={},g=_p.r(11).createClass("Color",{constructor:function(){var a=null;"string"==typeof arguments[0]?(a=f.parseToValue(arguments[0]),null===a&&(a={r:0,g:0,b:0,h:0,s:0,l:0,a:1})):(a={r:0|arguments[0],g:0|arguments[1],b:0|arguments[2],a:void 0===arguments[3]?1:parseFloat(arguments[3])},a=f.overflowFormat(a),a=d.extend(a,f.rgbValueToHslValue(a))),this._color=a},set:function(a,b){if(!g._MAX_VALUE[a])throw new Error("Color set(): Illegal parameter");return"a"!==a&&(b=Math.floor(b)),"h"==a&&(b=(b+360)%360),this._color[a]=Math.max(g._MIN_VALUE[a],Math.min(g._MAX_VALUE[a],b)),-1!=="rgb".indexOf(a)?this._color=d.extend(this._color,f.rgbValueToHslValue(this._color)):-1!=="hsl".indexOf(a)&&(this._color=d.extend(this._color,f.hslValueToRGBValue(this._color))),this},inc:function(a,b){return b=this.get(a)+b,"h"==a?b=(b+360)%360:(b=Math.min(g._MAX_VALUE[a],b),b=Math.max(g._MIN_VALUE[a],b)),this.clone().set(a,b)},dec:function(a,b){return this.inc(a,-b)},clone:function(){return new g(this.toRGBA())},get:function(a){return g._MAX_VALUE[a]?this._color[a]:null},getValues:function(){return d.clone(this._color)},valueOf:function(){return this.getValues()},toRGB:function(){return f.toString(this._color,"rgb")},toRGBA:function(){return f.toString(this._color,"rgba")},toHEX:function(){return f.toString(this._color,"hex")},toHSL:function(){return f.toString(this._color,"hsl")},toHSLA:function(){return f.toString(this._color,"hsla")},toString:function(){return 1===this._color.a?this.toRGB():this.toRGBA()}});return d.extend(g,{_MAX_VALUE:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},_MIN_VALUE:{r:0,g:0,b:0,h:0,s:0,l:0,a:0},R:"r",G:"g",B:"b",H:"h",S:"s",L:"l",A:"a",parse:function(a){var b;return d.isString(a)&&(b=f.parseToValue(a)),d.isObject(a)&&"r"in a&&(b=a),null===b?new g:new g(b.r,b.g,b.b,b.a)},createHSL:function(a,b,c){return g.createHSLA(a,b,c,1)},createHSLA:function(a,b,c,d){var e=null;return b+="%",c+="%",e=["hsla("+a,b,c,d+")"],g.parse(e.join(", "))},createRGB:function(a,b,c){return g.createRGBA(a,b,c,1)},createRGBA:function(a,b,c,d){return new g(a,b,c,d)}}),d.extend(f,{parseToValue:function(a){var b={};if(a=e.EXTEND_STANDARD[a]||e.COLOR_STANDARD[a]||a,/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a))b=f.hexToValue(a);else if(/^(rgba?)/i.test(a))b=f.rgbaToValue(a);else{if(!/^(hsla?)/i.test(a))return null;b=f.hslaToValue(a)}return f.overflowFormat(b)},hexToValue:function(a){var b={},c=["r","g","b"];return/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(a)?(a=RegExp.$1.split(""),d.each(c,function(c,d){3===a.length?b[c]=f.toNumber(a[d]+a[d]):b[c]=f.toNumber(a[2*d]+a[2*d+1])}),b=d.extend(b,f.rgbValueToHslValue(b)),b.a=1,b):null},rgbaToValue:function(a){var b={},c=!1,e=["r","g","b"];return/^(rgba?)/i.test(a)?(c=4===RegExp.$1.length,a=a.replace(/^rgba?/i,"").replace(/\s+/g,"").replace(/[^0-9,.]/g,"").split(","),d.each(e,function(c,d){b[c]=0|a[d]}),b=d.extend(b,f.rgbValueToHslValue(b)),b.a=c?parseFloat(a[3]):1,b):null},hslaToValue:function(a){var b={},c=!1;return/^(hsla?)/i.test(a)?(c=4===RegExp.$1.length,a=a.replace(/^hsla?/i,"").replace(/\s+/g,"").replace(/[^0-9,.]/g,"").split(","),b.h=0|a[0],b.s=0|a[1],b.l=0|a[2],b=d.extend(b,f.hslValueToRGBValue(b)),b=f.hslValueToRGBValue(b),b.a=c?parseFloat(a[3]):1,b):null},hslValueToRGBValue:function(a){function b(a,b,c){return 0>c?c+=1:c>1&&(c-=1),1>6*c?a+6*(b-a)*c:1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}var c=null,e=null,f={};return a=d.extend({},a),a.h=a.h/360,a.s=a.s/100,a.l=a.l/100,0===a.s?f.r=f.g=f.b=a.l:(c=a.l<.5?a.l*(1+a.s):a.l+a.s-a.l*a.s,e=2*a.l-c,f.r=b(e,c,a.h+1/3),f.g=b(e,c,a.h),f.b=b(e,c,a.h-1/3)),f.r=Math.min(Math.round(255*f.r),255),f.g=Math.min(Math.round(255*f.g),255),f.b=Math.min(Math.round(255*f.b),255),f},rgbValueToHslValue:function(a){var b=null,c=null,e={};return a=d.extend({},a),a.r=a.r/255,a.g=a.g/255,a.b=a.b/255,b=Math.max(a.r,a.g,a.b),c=Math.min(a.r,a.g,a.b),b===c?e.h=0:b===a.r?a.g>=a.b?e.h=60*(a.g-a.b)/(b-c):e.h=60*(a.g-a.b)/(b-c)+360:b===a.g?e.h=60*(a.b-a.r)/(b-c)+120:b===a.b&&(e.h=60*(a.r-a.g)/(b-c)+240),e.l=(b+c)/2,0===e.l||b===c?e.s=0:e.l>0&&e.l<=.5?e.s=(b-c)/(b+c):e.s=(b-c)/(2-b-c),e.h=Math.round(e.h),e.s=Math.round(100*e.s),e.l=Math.round(100*e.l),e},toString:function(a,b){var c=[];return a=d.extend({},a),-1!==b.indexOf("hsl")&&(a.s+="%",a.l+="%"),"hex"!==b?(d.each(b.split(""),function(b){c.push(a[b])}),(b+"("+c.join(", ")+")").toLowerCase()):(c.push(f.toHexValue(+a.r)),c.push(f.toHexValue(+a.g)),c.push(f.toHexValue(+a.b)),("#"+c.join("")).toLowerCase())},toNumber:function(a){return 0|Number("0x"+a)},toHexValue:function(a){var b=a.toString(16);return 1===b.length?"0"+b:b},overflowFormat:function(a){var b=d.extend({},a),c="rgba";return d.each(c.split(""),function(a){b.hasOwnProperty(a)&&(b[a]=Math.min(g._MAX_VALUE[a],b[a]),b[a]=Math.max(g._MIN_VALUE[a],b[a]))}),b}}),g}},_p[29]={value:function(a,b,c){function d(){return this.container.removeItem(this),this}return _p.r(11).createClass("Container",{getItems:function(){return this.items||(this.items=[])},getItem:function(a){return this.getItems()[a]},getFirstItem:function(){return this.getItem(0)},getLastItem:function(){return this.getItem(this.getItems().length-1)},indexOf:function(a){return this.getItems().indexOf(a)},eachItem:function(a){var b,c=this.getItems(),d=c.length;for(b=0;d>b;b++)a.call(this,b,c[b]);return this},addItem:function(a,b,c){var e=this.getItems(),f=e.length;return~e.indexOf(a)?this:(b>=0&&f>b||(b=f),e.splice(b,0,a),"object"==typeof a&&(a.container=this,a.remove=d),this.handleAdd(a,b),c||this.onContainerChanged("add",[a]),this)},addItems:function(a){for(var b=0,c=a.length;c>b;b++)this.addItem(a[b],-1,!0);return this.onContainerChanged("add",a),this},setItems:function(a){return this.clear().addItems(a)},appendItem:function(a){return this.addItem(a)},prependItem:function(a){return this.addItem(a,0)},removeItem:function(a,b){if("number"!=typeof a)return this.removeItem(this.indexOf(a));var c=this.getItems(),d=(c.length,c[a]);return void 0===d?this:(c.splice(a,1),d.container&&delete d.container,d.remove&&delete d.remove,this.handleRemove(d,a),b||this.onContainerChanged("remove",[d]),this)},clear:function(){for(var a,b=[];a=this.getFirstItem();)b.push(a),this.removeItem(0,!0);return this.onContainerChanged("remove",b),this},onContainerChanged:function(a,b){},handleAdd:function(a,b){},handleRemove:function(a,b){}})}},_p[30]={value:function(a,b,c){var d=_p.r(12),e={getCurvePanLines:function(a,b){var c=e.getCenterPoints(a),d=e.getPanLine(a.length,c);return e.getMovedPanLines(a,d,b)},getCenterPoints:function(a){for(var b={},c=null,d=0,e=0,f=a.length;f>d;d++)e=d===f-1?0:d+1,c=d+","+e,b[c]={x:(a[d].x+a[e].y)/2,y:(a[d].x+a[e].y)/2};return b},getPanLine:function(a,b){for(var c,d={},e=null,f=0;a>f;f++){var g=null,h=null;c=(f+1)%a,e=c,g=b[f+","+c],f=c,c=(f+1)%a,h=b[f+","+c],d[e]={points:[{x:g.x,y:g.y},{x:h.x,y:h.y}],center:{x:(g.x+h.x)/2,y:(g.y+h.y)/2}},f=(e+a-1)%a}return d},getMovedPanLines:function(a,b,c){var e={};return d.each(a,function(a,f){var g=b[f],h=g.center,i={x:h.x-a.x,y:h.y-a.y},j=e[f]={points:[],center:{x:a.x,y:a.y}};d.each(g.points,function(a,b){var d={x:a.x-i.x,y:a.y-i.y},e=j.center,f=d.x-e.x,g=d.y-e.y;d.x=e.x+c*f,d.y=e.y+c*g,j.points.push(d)})}),e}};return _p.r(11).createClass("Curve",{base:_p.r(46),mixins:[_p.r(51)],constructor:function(a,b){this.callBase(),this.setPoints(a||[]),this.closeState=!!b,this.changeable=!0,this.smoothFactor=1,this.update()},onContainerChanged:function(){this.changeable&&this.update()},setSmoothFactor:function(a){return this.smoothFactor=0>a?0:a,this.update(),this},getSmoothFactor:function(){return this.smoothFactor},update:function(){var a=this.getPoints(),b=null,c=this.getDrawer(),d=null,f=null,g=null;if(c.clear(),0===a.length)return this;if(c.moveTo(a[0]),1===a.length)return this;if(2===a.length)return c.lineTo(a[1]),this;b=e.getCurvePanLines(a,this.getSmoothFactor());for(var h=1,i=a.length;i>h;h++)d=b[h].center,f=this.closeState||h!=i-1?b[h].points[0]:b[h].center,g=this.closeState||1!=h?b[h-1].points[1]:b[h-1].center,c.bezierTo(g.x,g.y,f.x,f.y,d.x,d.y);return this.closeState&&(d=b[0].center,f=b[0].points[0],g=b[a.length-1].points[1],c.bezierTo(g.x,g.y,f.x,f.y,d.x,d.y)),this},close:function(){return this.closeState=!0,this.update()},open:function(){return this.closeState=!1,this.update()},isClose:function(){return!!this.closeState}})}},_p[31]={value:function(a,b,c){return _p.r(11).createClass("Data",{constructor:function(){this._data={}},setData:function(a,b){return this._data[a]=b,this},getData:function(a){return this._data[a]},removeData:function(a){return delete this._data[a],this}})}},_p[32]={value:function(a,b,c){var d=(_p.r(12),_p.r(50));return _p.r(11).createClass("Ellipse",{base:_p.r(46),constructor:function(a,b,c,d){this.callBase(),this.rx=a||0,this.ry=b||0,this.cx=c||0,this.cy=d||0,this.update()},update:function(){var a=this.rx,b=this.ry,c=this.cx+a,d=this.cx-a,e=this.cy,f=this.getDrawer();return f.clear(),f.moveTo(c,e),f.arcTo(a,b,0,1,1,d,e),f.arcTo(a,b,0,1,1,c,e),this},getRadius:function(){return{x:this.rx,y:this.ry}},getRadiusX:function(){return this.rx},getRadiusY:function(){return this.ry},getCenter:function(){return new d(this.cx,this.cy)},getCenterX:function(){return this.cx},getCenterY:function(){return this.cy},setRadius:function(a,b){return this.rx=a,this.ry=b,this.update()},setRadiusX:function(a){return this.rx=a,this.update()},setRadiusY:function(a){return this.ry=a,this.update()},setCenter:function(a,b){if(1==arguments.length){var c=d.parse(arguments[0]);a=c.x,b=c.y}return this.cx=a,this.cy=b,this.update()},setCenterX:function(a){return this.cx=a,this.update()},setCenterY:function(a){return this.cy=a,this.update()}})}},_p[33]={value:function(a,b,c){function d(a,b,c){return c=!!c,j.isString(a)&&(a=a.match(/\S+/g)),j.each(a,function(a){f.call(this,this.node,a,b,c)},this),this}function e(a,b){var c=null,d=this._EVNET_UID,e=void 0===b;return c=m[d][a],e||(e=!0,j.each(c,function(a,d){a===b?delete c[d]:e=!1;
  16. })),e&&(h(this.node,a,l[d][a]),delete m[d][a],delete l[d][a]),this}function f(a,b,c,d){var e=this._EVNET_UID,f=this;l[e]||(l[e]={}),l[e][b]||(l[e][b]=function(a){a=new k(a||window.event),j.each(m[e][b],function(c){var e;return c&&(e=c.call(f,a),d&&f.off(b,c)),e},f)}),m[e]||(m[e]={}),m[e][b]?m[e][b].push(c):(m[e][b]=[c],a&&"on"+b in a&&g(a,b,l[e][b]))}function g(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)}function h(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent(b,c)}function i(a,b,c){var d=null,e=null,f=l[a._EVNET_UID];f&&(e=f[b],e&&(d=j.extend({type:b,target:a},c||{}),e.call(a,d)))}!function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c}a.prototype=window.Event.prototype,window.CustomEvent=a}();var j=_p.r(12),k=_p.r(62),l={},m={},n=0;return _p.r(11).createClass("EventHandler",{constructor:function(){this._EVNET_UID=++n},addEventListener:function(a,b){return d.call(this,a,b,!1)},addOnceEventListener:function(a,b){return d.call(this,a,b,!0)},removeEventListener:function(a,b){return e.call(this,a,b)},on:function(a,b){return this.addEventListener.apply(this,arguments)},once:function(a,b){return this.addOnceEventListener.apply(this,arguments)},off:function(){return this.removeEventListener.apply(this,arguments)},fire:function(a,b){return this.trigger.apply(this,arguments)},trigger:function(a,b){return i(this,a,b),this}})}},_p[34]={value:function(a){function b(a){var b,c,d,e,f;for(b=[],c=0;c<a.length;c++)for(e=a[c],b.push(f=[]),d=0;d<e.length;d++)f.push(e[d]);return a.isUniform&&(b.isUniform=!0),a.isAbsolute&&(b.isAbsolute=!0),a.isCurve&&(b.isCurve=!0),b}function c(a,b,c){function d(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function e(){var f=Array.prototype.slice.call(arguments,0),g=f.join("␀"),h=e.cache=e.cache||{},i=e.count=e.count||[];return h.hasOwnProperty(g)?(d(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a.apply(b,f),c?c(h[g]):h[g])}return e}function d(a,b,c,e,f,g,h,i,j,k){var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q=Math,R=Q.PI,S=Math.abs,T=120*R/180,U=R/180*(+f||0),V=[],W=function(a,b,c){var d=a*Q.cos(c)-b*Q.sin(c),e=a*Q.sin(c)+b*Q.cos(c);return{x:d,y:e}};if(k?(w=k[0],x=k[1],u=k[2],v=k[3]):(l=W(a,b,-U),a=l.x,b=l.y,l=W(i,j,-U),i=l.x,j=l.y,m=Q.cos(R/180*f),n=Q.sin(R/180*f),p=(a-i)/2,q=(b-j)/2,o=p*p/(c*c)+q*q/(e*e),o>1&&(o=Q.sqrt(o),c=o*c,e=o*e),r=c*c,s=e*e,t=(g==h?-1:1)*Q.sqrt(S((r*s-r*q*q-s*p*p)/(r*q*q+s*p*p))),u=t*c*q/e+(a+i)/2,v=t*-e*p/c+(b+j)/2,w=Q.asin(((b-v)/e).toFixed(9)),x=Q.asin(((j-v)/e).toFixed(9)),w=u>a?R-w:w,x=u>i?R-x:x,0>w&&(w=2*R+w),0>x&&(x=2*R+x),h&&w>x&&(w-=2*R),!h&&x>w&&(x-=2*R)),y=x-w,S(y)>T&&(z=x,A=i,B=j,x=w+T*(h&&x>w?1:-1),i=u+c*Q.cos(x),j=v+e*Q.sin(x),V=d(i,j,c,e,f,0,h,A,B,[x,z,u,v])),y=x-w,C=Q.cos(w),D=Q.sin(w),E=Q.cos(x),F=Q.sin(x),G=Q.tan(y/4),H=4/3*c*G,I=4/3*e*G,J=[a,b],K=[a+H*D,b-I*C],L=[i+H*F,j-I*E],M=[i,j],K[0]=2*J[0]-K[0],K[1]=2*J[1]-K[1],k)return[K,L,M].concat(V);for(V=[K,L,M].concat(V).join().split(","),N=[],O=0,P=V.length;P>O;O++)N[O]=O%2?W(V[O-1],V[O],U).y:W(V[O],V[O+1],U).x;return N}function e(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]}function f(a,b){function c(a){return function(b,c){return b+a*(c-b)}}var d=c(b||.5),e=a,f=e[0],g=e[1],h=e[2],i=e[3],j=e[4],k=e[5],l=e[6],m=e[7],n=d(f,h),o=d(g,i),p=d(h,j),q=d(i,k),r=d(j,l),s=d(k,m),t=d(n,p),u=d(o,q),v=d(p,r),w=d(q,s),x=d(t,v),y=d(u,w);return[[f,g,n,o,t,u,x,y],[x,y,v,w,r,s,l,m]]}var g=_p.r(12),h=_p.r(50),i=_p.r(73),j=_p.r(43),k={},l=/([achlmrqstvz])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?\s*)+)/gi,m=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)\s*,?\s*/gi,n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0};k.pathToString=function(a){return a=a||this,"string"==typeof a?a:a instanceof Array?(a=g.flatten(a),a.join(",").replace(/,?([achlmqrstvxz]),?/gi,"$1")):void 0},k.parsePathString=c(function(a){var b=[];return a.replace(l,function(a,c,d){var e=[],f=c.toLowerCase();if(d.replace(m,function(a,b){b&&e.push(+b)}),"m"==f&&e.length>2&&(b.push([c].concat(e.splice(0,2))),f="l",c="m"==c?"l":"L"),"r"==f)b.push([c].concat(e));else for(;e.length>=n[f]&&(b.push([c].concat(e.splice(0,n[f]))),n[f]););}),b.isUniform=!0,b.toString=k.pathToString,b}),k.pathToAbsolute=c(function(a){var b,c,d,e,f,g,h,i,j=a.isUniform?a:k.parsePathString(k.pathToString(a)),l=[],m=0,n=0,o=0,p=0,q=0;for("M"==j[0][0]&&(m=+j[0][1],n=+j[0][2],o=m,p=n,q++,l[0]=["M",m,n]),d=q,g=j.length;g>d;d++){if(l.push(b=[]),c=j[d],c[0]!=c[0].toUpperCase())switch(b[0]=c[0].toUpperCase(),b[0]){case"A":b[1]=c[1],b[2]=c[2],b[3]=c[3],b[4]=c[4],b[5]=c[5],b[6]=+(c[6]+m),b[7]=+(c[7]+n);break;case"V":b[1]=+c[1]+n;break;case"H":b[1]=+c[1]+m;break;case"M":o=+c[1]+m,p=+c[2]+n;break;default:for(e=1,h=c.length;h>e;e++)b[e]=+c[e]+(e%2?m:n)}else for(f=0,i=c.length;i>f;f++)b[f]=c[f];switch(b[0]){case"Z":m=o,n=p;break;case"H":m=b[1];break;case"V":n=b[1];break;case"M":o=b[b.length-2],p=b[b.length-1];break;default:m=b[b.length-2],n=b[b.length-1]}}return l.isUniform=!0,l.isAbsolute=!0,l.toString=k.pathToString,l}),k.pathToCurve=c(function(a){var b,c,f,g,h,i,j,l,m,n,o,p,q=[];for(a.isAbsolute||(a=k.pathToAbsolute(a)),b=0;b<a.length;b++)if(f=a[b][0],g=a[b].slice(1),"M"!=f){switch("Z"==f&&(l=!0,f="L",g=h),j=g.slice(g.length-2),"H"==f&&(j=[g[0],i[1]],f="L"),"V"==f&&(j=[i[0],g[0]],f="L"),("S"==f||"T"==f)&&(n=[i[0]+(i[0]-m[0]),i[1]+(i[1]-m[1])]),f){case"L":o=i,p=j;break;case"C":o=g.slice(0,2),p=g.slice(2,4);break;case"S":o=n.slice(),p=g.slice(0,2);break;case"Q":m=g.slice(0,2),g=e.apply(null,i.concat(g)),o=g.slice(0,2),p=g.slice(2,4);break;case"T":g=e.apply(null,i.concat(n).concat(g)),o=g.slice(0,2),p=g.slice(2,4);break;case"A":for(g=d.apply(null,i.concat(g)),c=0;c in g;)o=g.slice(c,c+2),p=g.slice(c+2,c+4),j=g.slice(c+4,c+6),q.push(["C"].concat(o).concat(p).concat(j)),c+=6}"A"!=f&&q.push(["C"].concat(o).concat(p).concat(j)),i=j,"Q"!=f&&(m=p),l&&(q.push(["Z"]),l=!1)}else h=m=i=g,q.push(a[b]);return q.isUniform=!0,q.isAbsolute=!0,q.isCurve=!0,q.toString=k.pathToString,q}),k.cutBezier=c(f),k.subBezier=function(a,b,c){var d=f(a,b)[0];return c?f(d,c/b)[1]:d},k.pointAtBezier=function(a,b){var c=f(a,b)[0],d=h.parse(c.slice(6)),e=h.parse(c.slice(4,2)),g=i.fromPoints(e,d);return 0===b?d.tan=k.pointAtBezier(a,.01).tan:d.tan=g.normalize(),d},k.bezierLength=c(function(a){function b(a){var b=i*Math.pow(a,4)+j*Math.pow(a,3)+k*Math.pow(a,2)+l*a+m;return 0>b&&(b=0),Math.pow(b,.5)}var c,d,e,f,g,h,i,j,k,l,m,n=a;return c=-3*n[0]+9*n[2]-9*n[4]+3*n[6],d=6*n[0]-12*n[2]+6*n[4],e=-3*n[0]+3*n[2],f=-3*n[1]+9*n[3]-9*n[5]+3*n[7],g=6*n[1]-12*n[3]+6*n[5],h=-3*n[1]+3*n[3],i=Math.pow(c,2)+Math.pow(f,2),j=2*(c*d+f*g),k=2*(c*e+f*h)+Math.pow(d,2)+Math.pow(g,2),l=2*(d*e+g*h),m=Math.pow(e,2)+Math.pow(h,2),(b(0)+b(1)+4*(b(.125)+b(.375)+b(.625)+b(.875))+2*(b(.25)+b(.5)+b(.75)))/24});var o=c(function(a){var b,c,d,e,f,g,h;for(g=[],h=0,b=0,c=a.length;c>b;b++)d=a[b],"M"!=d[0]?"Z"!=d[0]?(f=k.bezierLength(e.concat(d.slice(1))),g.push([h,h+f]),h+=f,e=d.slice(4)):g.push(null):(e=d.slice(1),g.push(null));return g.totalLength=h,g});k.subPath=function(a,b,c){var d;if(c=c||0,d=b-c,d-=0|d,c-=0|c,b=c+d,b>1)return k.subPath(a,1,c).concat(k.subPath(a,b-1));a.isCurve||(a=k.pathToCurve(a));var e,f,g,h,i,j,l,m,n,p=o(a),q=p.totalLength,r=q*b,s=q*(c||0),t=[];for(e=0,f=a.length;f>e;e++)if("M"!=a[e][0]){if("Z"!=a[e][0])if(g=p[e][0],h=p[e][1],i=h-g,l=j.concat(a[e].slice(1)),s>h)j=l.slice(l.length-2);else{if(s>=g)m=k.subBezier(l,Math.min((r-g)/i,1),(s-g)/i),n=!0,j=m.slice(0,2),t.push(["M"].concat(m.slice(0,2))),t.push(["C"].concat(m.slice(2)));else if(r>=h)t.push(a[e].slice());else{if(!(r>=g))break;m=k.subBezier(l,(r-g)/i),t.push(["C"].concat(m.slice(2))),n=!1}j=l.slice(l.length-2)}}else j=a[e].slice(1),n&&t.push(a[e].slice());return t.isAbsolute=!0,t.isCurve=!0,t.isUniform=!0,t.toString=k.pathToString,t},k.pointAtPath=function(a,b){a.isCurve||(a=k.pathToCurve(a));var c=k.subPath(a,b),d="Z"==c[c.length-1][0]?c[c.length-2]:c[c.length-1];d=d.slice(1);var e=h.parse(d.slice(4)),f=h.parse(d.slice(2,4));return e.tan=i.fromPoints(f,e).normalize(),e},k.pathLength=c(function(a){a.isCurve||(a=k.pathToCurve(a));var b=o(a);return b.totalLength}),k.pathKeyPoints=c(function(a){var b,c,d;for(a.isCurve||(a=k.pathToCurve(a)),d=[],b=0,c=a.length;c>b;b++)"z"!=a[b][0]&&d.push(a[b].slice(a[b].length-2));return d});var p=c(function(a,c){function d(a,b){return a[b||a.i]&&a[b||a.i][0]}function e(a,b){return a[b||a.i]&&a[b||a.i].slice(1)}function f(a,b){var c=e(a,b);return c&&c.slice(-2)}function g(a){return"Z"==d(a)?(a.splice(a.i,1),!0):!1}function h(a){return"M"==d(a)?(a.o.splice(a.o.i,0,["M"].concat(f(a.o,a.o.i-1))),a.i++,a.o.i++,!0):!1}function i(a){for(var b,c=1;!b;)b=f(a,a.length-c++);for(a.o.i=a.i;a.length<a.o.length;)g(a.o)||h(a.o)||(a.push(["C"].concat(b).concat(b).concat(b)),a.i++,a.o.i++)}a.isCurve||(a=k.pathToCurve(a)),c.isCurve||(c=k.pathToCurve(c));var j=b(a),l=b(c);for(j.i=0,l.i=0,j.o=l,l.o=j;j.i<j.length&&l.i<l.length;)g(j)||g(l)||(d(j)!=d(l)?h(j)||h(l)||(j.i++,l.i++):(j.i++,l.i++));return j.i==j.length&&i(j),l.i==l.length&&i(l),delete j.i,delete j.o,delete l.i,delete l.o,[j,l]});return k.alignCurve=p,k.pathTween=function(a,b,c){if(0===c)return a;if(1===c)return b;var d,e,f,g=p(a,b),h=[];for(a=g[0],b=g[1],e=0;e<a.length;e++)for(h.push(d=[]),d.push(a[e][0]),f=1;f<a[e].length;f++)d.push(a[e][f]+c*(b[e][f]-a[e][f]));return h.isUniform=h.isCurve=h.isAbsolute=!0,h},k.transformPath=c(function(a,b){var c,d,e,f,g,i;for(a.isCurve||(a=k.pathToCurve(a)),f=[],c=0,d=a.length;d>c;c++)for(f.push(g=[a[c][0]]),e=1;e<a[c].length;e+=2)i=a[c].slice(e,e+2),i=b.transformPoint(h.parse(i)),f.push(i);return f}),_p.r(11).extendClass(j,{transformPath:function(a){return k.transformPath(a,this)}}),k}},_p[35]={value:function(a,b,c){var d=_p.r(67),e=_p.r(58),f=_p.r(28);return _p.r(11).createClass("GradientBrush",{base:e,constructor:function(a,b){this.callBase(a,b),this.stops=[]},addStop:function(a,b,c){var e=d.createNode("stop");return b instanceof f||(b=f.parse(b)),void 0===c&&(c=b.get("a")),e.setAttribute("offset",a),e.setAttribute("stop-color",b.toRGB()),1>c&&e.setAttribute("stop-opacity",c),this.node.appendChild(e),this}})}},_p[36]={value:function(a,b,c){var d=_p.r(61);return _p.r(11).createClass("Group",{mixins:[d],base:_p.r(60),constructor:function(){this.callBase("g")}})}},_p[37]={value:function(a,b,c){var d=_p.r(61);return _p.r(11).createClass("HyperLink",{mixins:[d],base:_p.r(60),constructor:function(a){this.callBase("a"),this.setHref(a)},setHref:function(a){return this.node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a),this},getHref:function(){return this.node.getAttributeNS("xlink:href")},setTarget:function(a){return this.node.setAttribute("target",a),this},getTarget:function(){return this.node.getAttribute("target")}})}},_p[38]={value:function(a,b,c){return _p.r(11).createClass("Image",{base:_p.r(60),constructor:function(a,b,c,d,e){this.callBase("image"),this.url=a,this.width=b||0,this.height=c||0,this.x=d||0,this.y=e||0,this.update()},update:function(){return this.node.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",this.url),this.node.setAttribute("x",this.x),this.node.setAttribute("y",this.y),this.node.setAttribute("width",this.width),this.node.setAttribute("height",this.height),this},setUrl:function(a){return this.url=""===a?null:a,this.update()},getUrl:function(){return this.url},setWidth:function(a){return this.width=a,this.update()},getWidth:function(){return this.width},setHeight:function(a){return this.height=a,this.update()},getHeight:function(){return this.height},setX:function(a){return this.x=a,this.update()},getX:function(){return this.x},setY:function(a){return this.y=a,this.update()},getY:function(){return this.y}})}},_p[39]={value:function(a,b,c){return _p.r(11).createClass("Line",{base:_p.r(46),constructor:function(a,b,c,d){this.callBase(),this.point1={x:a||0,y:b||0},this.point2={x:c||0,y:d||0},this.update()},setPoint1:function(a,b){return this.point1.x=a,this.point1.y=b,this.update()},setPoint2:function(a,b){return this.point2.x=a,this.point2.y=b,this.update()},getPoint1:function(){return{x:this.point1.x,y:this.point1.y}},getPoint2:function(){return{x:this.point2.x,y:this.point2.y}},update:function(){var a=this.getDrawer();return a.clear(),a.moveTo(this.point1.x,this.point1.y),a.lineTo(this.point2.x,this.point2.y),this}})}},_p[40]={value:function(a,b,c){var d=(_p.r(67),_p.r(35));return _p.r(11).createClass("LinearGradientBrush",{base:d,constructor:function(a){this.callBase("linearGradient",a),this.setStartPosition(0,0),this.setEndPosition(1,0)},setStartPosition:function(a,b){return this.node.setAttribute("x1",a),this.node.setAttribute("y1",b),this},setEndPosition:function(a,b){return this.node.setAttribute("x2",a),this.node.setAttribute("y2",b),this},getStartPosition:function(){return{x:+this.node.getAttribute("x1"),y:+this.node.getAttribute("y1")}},getEndPosition:function(){return{x:+this.node.getAttribute("x2"),y:+this.node.getAttribute("y2")}}})}},_p[41]={value:function(a,b,c){var d=_p.r(50),e=_p.r(11).createClass("Marker",{base:_p.r(58),mixins:[_p.r(61),_p.r(75)],constructor:function(){this.callBase("marker"),this.setOrient("auto")},setRef:function(a,b){return 1===arguments.length&&(b=a.y,a=a.x),this.node.setAttribute("refX",a),this.node.setAttribute("refY",b),this},getRef:function(){return new d(+this.node.getAttribute("refX"),+this.node.getAttribute("refY"))},setWidth:function(a){return this.node.setAttribute("markerWidth",this.width=a),this},setOrient:function(a){return this.node.setAttribute("orient",this.orient=a),this},getOrient:function(){return this.orient},getWidth:function(){return+this.width},setHeight:function(a){return this.node.setAttribute("markerHeight",this.height=a),this},getHeight:function(){return+this.height}}),f=_p.r(46);return _p.r(11).extendClass(f,{setMarker:function(a,b){return b=b||"end",a?this.node.setAttribute("marker-"+b,a.toString()):this.node.removeAttribute("marker-"+b),this}}),e}},_p[42]={value:function(a,b,c){var d=_p.r(11),e=_p.r(60),f=d.createClass("Mask",{base:e,mixins:[_p.r(61)],constructor:function(){this.callBase("mask")},mask:function(a){return a.getNode().setAttribute("mask","url(#"+this.getId()+")"),this}});return d.extendClass(e,{maskWith:function(a){return a.mask(this),this}}),f}},_p[43]={value:function(a,b,c){function d(a,b){return{a:b.a*a.a+b.c*a.b,b:b.b*a.a+b.d*a.b,c:b.a*a.c+b.c*a.d,d:b.b*a.c+b.d*a.d,e:b.a*a.e+b.c*a.f+b.e,f:b.b*a.e+b.d*a.f+b.f}}function e(a){return a*Math.PI/180}var f=_p.r(12),g=_p.r(25),h=/matrix\s*\((.+)\)/i,i=_p.r(50),j=_p.r(11).createClass("Matrix",{constructor:function(){arguments.length?this.setMatrix.apply(this,arguments):this.setMatrix(1,0,0,1,0,0)},translate:function(a,b){return this.m=d(this.m,{a:1,c:0,e:a,b:0,d:1,f:b}),this},rotate:function(a){var b=e(a),c=Math.sin(b),f=Math.cos(b);return this.m=d(this.m,{a:f,c:-c,e:0,b:c,d:f,f:0}),this},scale:function(a,b){return void 0===b&&(b=a),this.m=d(this.m,{a:a,c:0,e:0,b:0,d:b,f:0}),this},skew:function(a,b){void 0===b&&(b=a);var c=Math.tan(e(a)),f=Math.tan(e(b));return this.m=d(this.m,{a:1,c:c,e:0,b:f,d:1,f:0}),this},inverse:function(){var a,b,c,d,e,f,g,h=this.m,i=h.a,k=h.b,l=h.c,m=h.d,n=h.e,o=h.f;return a=i*m-k*l,b=m/a,c=-k/a,d=-l/a,e=i/a,f=(l*o-n*m)/a,g=(k*n-i*o)/a,new j(b,c,d,e,f,g)},setMatrix:function(a,b,c,d,e,g){return 1===arguments.length?this.m=f.clone(arguments[0]):this.m={a:a,b:b,c:c,d:d,e:e,f:g},this},getMatrix:function(){return f.clone(this.m)},getTranslate:function(){var a=this.m;return{x:a.e/a.a,y:a.f/a.d}},mergeMatrix:function(a){return new j(d(this.m,a.m))},merge:function(a){return this.mergeMatrix(a)},toString:function(){return this.valueOf().join(" ")},valueOf:function(){var a=this.m;return[a.a,a.b,a.c,a.d,a.e,a.f]},equals:function(a){var b=this.m,c=a.m;return b.a==c.a&&b.b==c.b&&b.c==c.c&&b.d==c.d&&b.e==c.e&&b.f==c.f},transformPoint:function(){return j.transformPoint.apply(null,[].slice.call(arguments).concat([this.m]))},transformBox:function(a){return j.transformBox(a,this.m)},clone:function(){return new j(this.m)}});return j.parse=function(a){var b,c=parseFloat;if(a instanceof Array)return new j({a:a[0],b:a[1],c:a[2],d:a[3],e:a[4],f:a[5]});if(b=h.exec(a)){var d=b[1].split(",");return 6!=d.length&&(d=b[1].split(" ")),new j({a:c(d[0]),b:c(d[1]),c:c(d[2]),d:c(d[3]),e:c(d[4]),f:c(d[5])})}return new j},j.transformPoint=function(a,b,c){return 2===arguments.length&&(c=b,b=a.y,a=a.x),new i(c.a*a+c.c*b+c.e,c.b*a+c.d*b+c.f)},j.transformBox=function(a,b){for(var c,d,e=Number.MAX_VALUE,h=-Number.MAX_VALUE,i=Number.MAX_VALUE,k=-Number.MAX_VALUE,l=[[a.x,a.y],[a.x+a.width,a.y],[a.x,a.y+a.height],[a.x+a.width,a.y+a.height]],m=[];c=l.pop();)d=j.transformPoint(c[0],c[1],b),m.push(d),e=Math.min(e,d.x),h=Math.max(h,d.x),i=Math.min(i,d.y),k=Math.max(k,d.y);return a=new g({x:e,y:i,width:h-e,height:k-i}),f.extend(a,{closurePoints:m}),a},j.getCTM=function(a,b){var c={a:1,b:0,c:0,d:1,e:0,f:0},d=a.shapeNode||a.node;switch(b=b||"parent"){case"screen":c=d.getScreenCTM();break;case"doc":case"paper":c=d.getCTM();break;case"view":case"top":a.getPaper()&&(c=d.getTransformToElement(a.getPaper().shapeNode));break;case"parent":a.node.parentNode&&(c=d.getTransformToElement(a.node.parentNode));break;default:b.node&&(c=d.getTransformToElement(b.shapeNode||b.node))}return c?new j(c.a,c.b,c.c,c.d,c.e,c.f):new j},j}},_p[44]={value:function(a,b,c){var d=_p.r(64),e=_p.r(28),f=_p.r(12),g=_p.r(11).createClass("Palette",{constructor:function(){this.color={}},get:function(a){var b=this.color[a]||d.EXTEND_STANDARD[a]||d.COLOR_STANDARD[a]||"";return b?new e(b):null},getColorValue:function(a){return this.color[a]||d.EXTEND_STANDARD[a]||d.COLOR_STANDARD[a]||""},add:function(a,b){return"string"==typeof b?this.color[a]=new e(b).toRGBA():this.color[a]=b.toRGBA(),b},remove:function(a){return this.color.hasOwnProperty(a)?(delete this.color[a],!0):!1}});return f.extend(g,{getColor:function(a){var b=d.EXTEND_STANDARD[a]||d.COLOR_STANDARD[a];return b?new e(b):null},getColorValue:function(a){return d.EXTEND_STANDARD[a]||d.COLOR_STANDARD[a]||""},addColor:function(a,b){return"string"==typeof b?d.EXTEND_STANDARD[a]=new e(b).toRGBA():d.EXTEND_STANDARD[a]=b.toRGBA(),b},removeColor:function(a){return d.EXTEND_STANDARD.hasOwnProperty(a)?(delete d.EXTEND_STANDARD[a],!0):!1}}),g}},_p[45]={value:function(a,b,c){var d=_p.r(11),e=_p.r(12),f=_p.r(67),g=_p.r(29),h=_p.r(61),i=_p.r(75),j=_p.r(33),k=_p.r(66),l=_p.r(43),m=d.createClass("Paper",{mixins:[h,j,k,i],constructor:function(a){this.callBase(),this.node=this.createSVGNode(),this.node.paper=this,this.node.appendChild(this.resourceNode=f.createNode("defs")),this.node.appendChild(this.shapeNode=f.createNode("g")),this.resources=new g,this.setWidth("100%").setHeight("100%"),a&&this.renderTo(a),this.callMixin()},renderTo:function(a){e.isString(a)&&(a=document.getElementById(a)),this.container=a,a.appendChild(this.node)},createSVGNode:function(){var a=f.createNode("svg");return a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttribute("version","1.1"),a},getNode:function(){return this.node},getContainer:function(){return this.container},getWidth:function(){return this.node.clientWidth},setWidth:function(a){return this.node.setAttribute("width",a),this},getHeight:function(){return this.node.clientHeight},setHeight:function(a){return this.node.setAttribute("height",a),this},setViewPort:function(a,b,c){var d,e;1==arguments.length&&(d=arguments[0],a=d.center.x,b=d.center.y,c=d.zoom),c=c||1,e=this.getViewBox();var f=new l,g=e.x+e.width/2-a,h=e.y+e.height/2-b;return f.translate(-a,-b),f.scale(c),f.translate(a,b),f.translate(g,h),this.shapeNode.setAttribute("transform","matrix("+f+")"),this.viewport={center:{x:a,y:b},offset:{x:g,y:h},zoom:c},this},getViewPort:function(){if(!this.viewport){var a=this.getViewBox();return{zoom:1,center:{x:a.x+a.width/2,y:a.y+a.height/2},offset:{x:0,y:0}}}return this.viewport},getViewPortMatrix:function(){return l.parse(this.shapeNode.getAttribute("transform"))},getViewPortTransform:function(){var a=this.shapeNode.getCTM();return new l(a.a,a.b,a.c,a.d,a.e,a.f)},getTransform:function(){return this.getViewPortTransform().reverse()},addResource:function(a){return this.resources.appendItem(a),a.node&&this.resourceNode.appendChild(a.node),this},removeResource:function(a){return a.remove&&a.remove(),a.node&&this.resourceNode.removeChild(a.node),this},getPaper:function(){return this}}),n=_p.r(60);return d.extendClass(n,{getPaper:function(){for(var a=this.container;a&&a instanceof m==!1;)a=a.container;return a},isAttached:function(){return!!this.getPaper()},whenPaperReady:function(a){function b(){var b=c.getPaper();return b&&a&&a.call(c,b),b}var c=this;return b()||this.on("add treeadd",function d(){b()&&(c.off("add",d),c.off("treeadd",d))}),this}}),m}},_p[46]={value:function(a,b,c){var d=_p.r(12),e=_p.r(11).createClass,f=_p.r(60),g=_p.r(67),h=_p.r(34),i=Array.prototype.slice,j=(d.flatten,e("PathDrawer",{constructor:function(a){this.segment=[],this.path=a,this.__clear=!1},getPath:function(){return this.path},redraw:function(){return this._transation=this._transation||[],this.clear()},done:function(){var a=this._transation;return this._transation=null,this.push(a),this},clear:function(){return this._transation?this._transation=[]:this.path.setPathData("M 0 0"),this._clear=!0,this},push:function(){var a,b=i.call(arguments);return this._transation?(this._transation.push(b),this):(this._clear?(a="",this._clear=!1):a=this.path.getPathData(),a=a||"",this.path.setPathData(a+h.pathToString(b)),this)},moveTo:function(a,b){return this.push("M",i.call(arguments))},moveBy:function(a,b){return this.push("m",i.call(arguments))},lineTo:function(a,b){return this.push("L",i.call(arguments))},lineBy:function(a,b){return this.push("l",i.call(arguments))},arcTo:function(a,b,c,d,e,f,g){return this.push("A",i.call(arguments))},arcBy:function(a,b,c,d,e,f,g){return this.push("a",arguments)},carcTo:function(a,b,c,d,e){return this.push("A",[a,a,0].concat(i.call(arguments,1)))},carcBy:function(a,b,c,d,e){return this.push("a",[a,a,0].concat(i.call(arguments,1)))},bezierTo:function(a,b,c,d,e,f){return this.push("C",i.call(arguments))},bezierBy:function(a,b,c,d,e,f){return this.push("c",i.call(arguments))},close:function(){return this.push("z")}}));return e("Path",{base:f,constructor:function(a){this.callBase("path"),a&&this.setPathData(a),this.node.setAttribute("fill",g.defaults.fill),this.node.setAttribute("stroke",g.defaults.stroke)},setPathData:function(a){return a=a||"M0,0",this.pathdata=h.pathToString(a),this.node.setAttribute("d",this.pathdata),this.trigger("shapeupdate",{type:"pathdata"}),this},getPathData:function(){return this.pathdata||""},getDrawer:function(){return new j(this)},isClosed:function(){var a=this.getPathData();return!!~a.indexOf("z")||!!~a.indexOf("Z")}})}},_p[47]={value:function(a,b,c){var d=_p.r(58),e=_p.r(61);_p.r(67);return _p.r(11).createClass("PatternBrush",{base:d,mixins:[e],constructor:function(a){this.callBase("pattern",a),this.node.setAttribute("patternUnits","userSpaceOnUse")},setX:function(a){return this.x=a,this.node.setAttribute("x",a),this},setY:function(a){return this.y=a,this.node.setAttribute("y",a),this},setWidth:function(a){return this.width=a,this.node.setAttribute("width",a),this},setHeight:function(a){return this.height=a,this.node.setAttribute("height",a),this},getWidth:function(){return this.width},getHeight:function(){return this.height}})}},_p[48]={value:function(a,b,c){var d=_p.r(28);return _p.r(11).createClass("Pen",{constructor:function(a,b){this.brush=a,this.width=b||1,this.linecap=null,this.linejoin=null,this.dashArray=null,this.opacity=1},getBrush:function(){return this.brush},setBrush:function(a){return this.brush=a,this},setColor:function(a){return this.setBrush(a)},getColor:function(){return this.brush instanceof d?this.brush:null},getWidth:function(){return this.width},setWidth:function(a){return this.width=a,this},getOpacity:function(){return this.opacity},setOpacity:function(a){this.opacity=a},getLineCap:function(){return this.linecap},setLineCap:function(a){return this.linecap=a,this},getLineJoin:function(){return this.linejoin},setLineJoin:function(a){return this.linejoin=a,this},getDashArray:function(){return this.dashArray},setDashArray:function(a){return this.dashArray=a,this},stroke:function(a){var b=a.node;b.setAttribute("stroke",this.brush.toString()),b.setAttribute("stroke-width",this.getWidth()),this.getOpacity()<1&&b.setAttribute("stroke-opacity",this.getOpacity()),this.getLineCap()&&b.setAttribute("stroke-linecap",this.getLineCap()),this.getLineJoin()&&b.setAttribute("stroke-linejoin",this.getLineJoin()),this.getDashArray()&&b.setAttribute("stroke-dasharray",this.getDashArray())}})}},_p[49]={value:function(a,b,c){return _p.r(11).createClass({base:_p.r(68),constructor:function(a,b,c){this.callBase([0,a],b,c)},getRadius:function(){return this.getSectionArray()[1]},setRadius:function(a){this.setSectionArray([0,a])}})}},_p[50]={value:function(a,b,c){var d=_p.r(11).createClass("Point",{constructor:function(a,b){this.x=a||0,this.y=b||0},offset:function(a,b){return 1==arguments.length&&(b=a.y,a=a.x),new d(this.x+a,this.y+b)},valueOf:function(){return[this.x,this.y]},toString:function(){return this.valueOf().join(" ")},spof:function(){return new d((0|this.x)+.5,(0|this.y)+.5)},round:function(){return new d(0|this.x,0|this.y)},isOrigin:function(){return 0===this.x&&0===this.y}});return d.fromPolar=function(a,b,c){return"rad"!=c&&(b=b/180*Math.PI),new d(a*Math.cos(b),a*Math.sin(b))},d.parse=function(a){return a?a instanceof d?a:"string"==typeof a?d.parse(a.split(/\s*[\s,]\s*/)):"0"in a&&"1"in a?new d(a[0],a[1]):void 0:new d},d}},_p[51]={value:function(a,b,c){return _p.r(11).createClass("PointContainer",{base:_p.r(29),constructor:function(){this.callBase()},addPoint:function(a,b){return this.addItem.apply(this,arguments)},prependPoint:function(){return this.prependItem.apply(this,arguments)},appendPoint:function(){return this.appendItem.apply(this,arguments)},removePoint:function(a){return this.removeItem.apply(this,arguments)},addPoints:function(){return this.addItems.apply(this,arguments)},setPoints:function(){return this.setItems.apply(this,arguments)},getPoint:function(){return this.getItem.apply(this,arguments)},getPoints:function(){return this.getItems.apply(this,arguments)},getFirstPoint:function(){return this.getFirstItem.apply(this,arguments)},getLastPoint:function(){return this.getLastItem.apply(this,arguments)}})}},_p[52]={value:function(a,b,c){_p.r(12);return _p.r(11).createClass("Poly",{base:_p.r(46),mixins:[_p.r(51)],constructor:function(a,b){this.callBase(),this.closeable=!!b,this.setPoints(a||[]),this.changeable=!0,this.update()},onContainerChanged:function(){this.changeable&&this.update()},update:function(){var a=this.getDrawer(),b=this.getPoints();if(a.clear(),!b.length)return this;a.moveTo(b[0]);for(var c,d=1,e=b.length;e>d;d++)c=b[d],a.lineTo(c);return this.closeable&&b.length>2&&a.close(),this}})}},_p[53]={value:function(a,b,c){return _p.r(11).createClass("Polygon",{base:_p.r(52),constructor:function(a){this.callBase(a,!0)}})}},_p[54]={value:function(a,b,c){return _p.r(11).createClass("Polyline",{base:_p.r(52),constructor:function(a){this.callBase(a)}})}},_p[55]={value:function(a,b,c){var d=_p.r(35);return _p.r(11).createClass("RadialGradientBrush",{base:d,constructor:function(a){this.callBase("radialGradient",a),this.setCenter(.5,.5),this.setFocal(.5,.5),this.setRadius(.5)},setCenter:function(a,b){return this.node.setAttribute("cx",a),this.node.setAttribute("cy",b),this},getCenter:function(){return{x:+this.node.getAttribute("cx"),y:+this.node.getAttribute("cy")}},setFocal:function(a,b){return this.node.setAttribute("fx",a),this.node.setAttribute("fy",b),this},getFocal:function(){return{x:+this.node.getAttribute("fx"),y:+this.node.getAttribute("fy")}},setRadius:function(a){return this.node.setAttribute("r",a),this},getRadius:function(){return+this.node.getAttribute("r")}})}},_p[56]={value:function(a,b,c){var d={},e=_p.r(12),f=_p.r(50),g=_p.r(25);e.extend(d,{formatRadius:function(a,b,c){var d=Math.floor(Math.min(a/2,b/2));return Math.min(d,c)}});var h=_p.r(11).createClass("Rect",{base:_p.r(46),constructor:function(a,b,c,e,f){this.callBase(),this.x=c||0,this.y=e||0,this.width=a||0,this.height=b||0,this.radius=d.formatRadius(this.width,this.height,f||0),this.update()},update:function(){var a=this.x,b=this.y,c=this.width,d=this.height,e=this.radius,f=this.getDrawer().redraw();return e?(c-=2*e,d-=2*e,f.push("M",a+e,b),f.push("h",c),f.push("a",e,e,0,0,1,e,e),f.push("v",d),f.push("a",e,e,0,0,1,-e,e),f.push("h",-c),f.push("a",e,e,0,0,1,-e,-e),f.push("v",-d),f.push("a",e,e,0,0,1,e,-e),f.push("z")):(f.push("M",a,b),f.push("h",c),f.push("v",d),f.push("h",-c),f.push("z")),f.done(),this},setWidth:function(a){return this.width=a,this.update()},setHeight:function(a){return this.height=a,this.update()},setSize:function(a,b){return this.width=a,this.height=b,this.update()},setBox:function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this.update()},getBox:function(){return new g(this.x,this.y,this.width,this.height)},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=d.formatRadius(this.width,this.height,a||0),this.update()},getPosition:function(){return new f(this.x,this.y)},setPosition:function(a,b){if(1==arguments.length){var c=f.parse(arguments[0]);b=c.y,a=c.x}return this.x=a,this.y=b,this.update()},getWidth:function(){return this.width},getHeight:function(){return this.height},getPositionX:function(){return this.x},getPositionY:function(){return this.y},setPositionX:function(a){return this.x=a,this.update()},setPositionY:function(a){return this.y=a,this.update()}});return h}},_p[57]={value:function(a,b,c){var d=_p.r(50);return _p.r(11).createClass("RegularPolygon",{base:_p.r(46),constructor:function(a,b,c,e){this.callBase(),this.radius=b||0,this.side=Math.max(a||3,3),arguments.length>2&&3==arguments.length&&(e=c.y,c=c.x),this.center=new d(c,e),this.draw()},getSide:function(){return this.side},setSide:function(a){return this.side=a,this.draw()},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.draw()},draw:function(){var a,b=this.radius,c=this.side,e=2*Math.PI/c,f=this.getDrawer();for(f.clear(),f.moveTo(d.fromPolar(b,Math.PI/2,"rad").offset(this.center)),a=0;c>=a;a++)f.lineTo(d.fromPolar(b,e*a+Math.PI/2,"rad").offset(this.center));return f.close(),this}})}},_p[58]={value:function(a,b,c){var d=_p.r(67);return _p.r(11).createClass("Resource",{constructor:function(a,b){this.callBase(),this.node=d.createNode(a),b&&b.addResource(this)},toString:function(){return"url(#"+this.node.id+")"}})}},_p[59]={value:function(a,b,c){return _p.r(11).createClass({base:_p.r(68),constructor:function(a,b){this.callBase([a,b],360,0)},getInnerRadius:function(){return this.getSectionArray()[0]},getOuterRadius:function(){return this.getSectionArray()[1]},setInnerRadius:function(a){this.setSectionArray([a,this.getOuterRadius()])},setOuterRadius:function(a){this.setSectionArray([this.getInnerRadius(),a])}})}},_p[60]={value:function(a,b,c){var d=_p.r(67),e=_p.r(12),f=_p.r(33),g=_p.r(66),h=_p.r(31),i=_p.r(43),j=(_p.r(48),Array.prototype.slice),k=_p.r(25),l=_p.r(11).createClass("Shape",{mixins:[f,g,h],constructor:function(a){this.node=d.createNode(a),this.node.shape=this,this.transform={translate:null,rotate:null,scale:null,matrix:null},this.callMixin()},getId:function(){return this.node.id},setId:function(a){return this.node.id=a,this},getNode:function(){return this.node},getBoundaryBox:function(){var a;try{a=this.node.getBBox()}catch(b){a={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}return new k(a);
  17. },getRenderBox:function(a){var b=this.getBoundaryBox(),c=this.getTransform(a);return c.transformBox(b)},getWidth:function(){return this.getRenderBox().width},getHeight:function(){return this.getRenderBox().height},getSize:function(){var a=this.getRenderBox();return delete a.x,delete a.y,a},setOpacity:function(a){return this.node.setAttribute("opacity",a),this},getOpacity:function(){var a=this.node.getAttribute("opacity");return a?+a:1},setVisible:function(a){return a?this.node.removeAttribute("display"):this.node.setAttribute("display","none"),this},getVisible:function(){this.node.getAttribute("display")},hasAncestor:function(a){for(var b=this.container;b;){if(b===a)return!0;b=b.container}return!1},getTransform:function(a){return i.getCTM(this,a)},clearTransform:function(){return this.node.removeAttribute("transform"),this.transform={translate:null,rotate:null,scale:null,matrix:null},this.trigger("shapeupdate",{type:"transform"}),this},_applyTransform:function(){var a=this.transform,b=[];return a.translate&&b.push(["translate(",a.translate,")"]),a.rotate&&b.push(["rotate(",a.rotate,")"]),a.scale&&b.push(["scale(",a.scale,")"]),a.matrix&&b.push(["matrix(",a.matrix,")"]),this.node.setAttribute("transform",e.flatten(b).join(" ")),this},setMatrix:function(a){return this.transform.matrix=a,this._applyTransform()},setTranslate:function(a){return this.transform.translate=null!==a&&j.call(arguments)||null,this._applyTransform()},setRotate:function(a){return this.transform.rotate=null!==a&&j.call(arguments)||null,this._applyTransform()},setScale:function(a){return this.transform.scale=null!==a&&j.call(arguments)||null,this._applyTransform()},translate:function(a,b){var c=this.transform.matrix||new i;return void 0===b&&(b=0),this.transform.matrix=c.translate(a,b),this._applyTransform()},rotate:function(a){var b=this.transform.matrix||new i;return this.transform.matrix=b.rotate(a),this._applyTransform()},scale:function(a,b){var c=this.transform.matrix||new i;return void 0===b&&(b=a),this.transform.matrix=c.scale(a,b),this._applyTransform()},skew:function(a,b){var c=this.transform.matrix||new i;return void 0===b&&(b=a),this.transform.matrix=c.skew(a,b),this._applyTransform()},stroke:function(a,b){return a&&a.stroke?a.stroke(this):a?(this.node.setAttribute("stroke",a.toString()),b&&this.node.setAttribute("stroke-width",b)):null===a&&this.node.removeAttribute("stroe"),this},fill:function(a){return a&&this.node.setAttribute("fill",a.toString()),null===a&&this.node.removeAttribute("fill"),this},setAttr:function(a,b){var c=this;return e.isObject(a)&&e.each(a,function(a,b){c.setAttr(b,a)}),void 0===b||null===b||""===b?this.node.removeAttribute(a):this.node.setAttribute(a,b),this},getAttr:function(a){return this.node.getAttribute(a)}});return l}},_p[61]={value:function(a,b,c){var d=_p.r(29),e=_p.r(12),f=_p.r(11).createClass("ShapeContainer",{base:d,isShapeContainer:!0,handleAdd:function(a,b){var c=this.getShapeNode();c.insertBefore(a.node,c.childNodes[b]||null),a.trigger("add",{container:this}),a.notifyTreeModification&&a.notifyTreeModification("treeadd",this)},handleRemove:function(a,b){var c=this.getShapeNode();c.removeChild(a.node),a.trigger("remove",{container:this}),a.notifyTreeModification&&a.notifyTreeModification("treeremove",this)},notifyTreeModification:function(a,b){this.eachItem(function(c,d){d.notifyTreeModification&&d.notifyTreeModification(a,b),d.trigger(a,{container:b})})},getShape:function(a){return this.getItem(a)},addShape:function(a,b){return this.addItem(a,b)},put:function(a){return this.addShape(a),a},appendShape:function(a){return this.addShape(a)},prependShape:function(a){return this.addShape(a,0)},replaceShape:function(a,b){var c=this.indexOf(b);if(-1!==c)return this.removeShape(c),this.addShape(a,c),this},addShapeBefore:function(a,b){var c=this.indexOf(b);return this.addShape(a,c)},addShapeAfter:function(a,b){var c=this.indexOf(b);return this.addShape(a,-1===c?void 0:c+1)},addShapes:function(a){return this.addItems(a)},removeShape:function(a){return this.removeItem(a)},getShapes:function(){return this.getItems()},getShapesByType:function(a){function b(d){a.toLowerCase()==d.getType().toLowerCase()&&c.push(d),d.isShapeContainer&&e.each(d.getShapes(),function(a){b(a)})}var c=[];return b(this),c},getShapeById:function(a){return this.getShapeNode().getElementById(a).shape},arrangeShape:function(a,b){return this.removeShape(a).addShape(a,b)},getShapeNode:function(){return this.shapeNode||this.node}}),g=_p.r(60);return _p.r(11).extendClass(g,{bringTo:function(a){return this.container.arrangeShape(this,a),this},bringFront:function(){return this.bringTo(this.container.indexOf(this)+1)},bringBack:function(){return this.bringTo(this.container.indexOf(this)-1)},bringTop:function(){return this.container.removeShape(this).addShape(this),this},bringRear:function(){return this.bringTo(0)},bringRefer:function(a,b){return a.container&&(this.remove&&this.remove(),a.container.addShape(this,a.container.indexOf(a)+(b||0))),this},bringAbove:function(a){return this.bringRefer(a)},bringBelow:function(a){return this.bringRefer(a,1)},replaceBy:function(a){return this.container&&(a.bringAbove(this),this.remove()),this}}),f}},_p[62]={value:function(a,b,c){var d=_p.r(43),e=_p.r(12),f=_p.r(50);return _p.r(11).createClass("ShapeEvent",{constructor:function(a){var b=null;e.isObject(a.target)?e.extend(this,a):(this.type=a.type,b=a.target,b.correspondingUseElement&&(b=b.correspondingUseElement),this.originEvent=a,this.targetShape=b.shape||b.paper||a.currentTarget&&(a.currentTarget.shape||a.currentTarget.paper),a._kityParam&&e.extend(this,a._kityParam))},preventDefault:function(){var a=this.originEvent;return a?a.preventDefault?(a.preventDefault(),a.cancelable):(a.returnValue=!1,!0):!0},getPosition:function(a,b){if(!this.originEvent)return null;var c=this.originEvent.touches?this.originEvent.touches[b||0]:this.originEvent,e=this.targetShape,g=e.shapeNode||e.node,h=new f(c&&c.clientX||0,c&&c.clientY||0),i=d.transformPoint(h,g.getScreenCTM().inverse()),j=d.getCTM(e,a||"view").transformPoint(i);return j},stopPropagation:function(){var a=this.originEvent;return a?void(a.stopPropagation?a.stopPropagation():a.cancelBubble=!1):!0}})}},_p[63]={value:function(a,b,c){return _p.r(11).createClass("ShapePoint",{base:_p.r(50),constructor:function(a,b){this.callBase(a,b)},setX:function(a){return this.setPoint(a,this.y)},setY:function(a){return this.setPoint(this.x,a)},setPoint:function(a,b){return this.x=a,this.y=b,this.update(),this},getPoint:function(){return this},update:function(){return this.container&&this.container.update&&this.container.update(),this}})}},_p[64]={value:{COLOR_STANDARD:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00"},EXTEND_STANDARD:{}}},_p[65]={value:function(a,b,c){var d={3:.2,5:.38196601125,6:.57735026919,8:.541196100146,10:.726542528005,12:.707106781187},e=_p.r(50);return _p.r(11).createClass("Star",{base:_p.r(46),constructor:function(a,b,c,d,f){this.callBase(),this.vertex=a||3,this.radius=b||0,this.shrink=c,this.offset=d||new e(0,0),this.angleOffset=f||0,this.draw()},getVertex:function(){return this.vertex},setVertex:function(a){return this.vertex=a,this.draw()},getRadius:function(){return this.radius},setRadius:function(a){return this.radius=a,this.draw()},getShrink:function(){return this.shrink},setShrink:function(a){return this.shrink=a,this.draw()},getOffset:function(){return this.offset},setOffset:function(a){return this.offset=a,this.draw()},getAngleOffset:function(){return this.angleOffset},setAngleOffset:function(a){return this.angleOffset=a,this.draw()},draw:function(){var a,b,c=this.radius,f=this.radius*(this.shrink||d[this.vertex]||.5),g=this.vertex,h=this.offset,i=90,j=180/g,k=this.angleOffset,l=this.getDrawer();for(l.clear(),l.moveTo(e.fromPolar(f,i)),a=1;2*g>=a;a++)b=i+j*a,l.lineTo(a%2?e.fromPolar(c,b+k).offset(h):e.fromPolar(f,b));l.close()}})}},_p[66]={value:function(a,b,c){function d(a){return a.classList||(a.classList=new e(a)),a.classList}var e=_p.r(11).createClass("ClassList",{constructor:function(a){this._node=a,this._list=a.className.toString().split(" ")},_update:function(){this._node.className=this._list.join(" ")},add:function(a){this._list.push(a),this._update()},remove:function(a){var b=this._list.indexOf(a);~b&&this._list.splice(b,1),this._update()},contains:function(a){return!!~this._list.indexOf(a)}});return _p.r(11).createClass("Styled",{addClass:function(a){return d(this.node).add(a),this},removeClass:function(a){return d(this.node).remove(a),this},hasClass:function(a){return d(this.node).contains(a)},setStyle:function(a){if(2==arguments.length)return this.node.style[arguments[0]]=arguments[1],this;for(var b in a)a.hasOwnProperty(b)&&(this.node.style[b]=a[b]);return this}})}},_p[67]={value:function(a,b,c){var d=document,e=0,f={createNode:function(a){var b=d.createElementNS(f.ns,a);return b.id="kity_"+a+"_"+e++,b},defaults:{stroke:"none",fill:"none"},xlink:"http://www.w3.org/1999/xlink",ns:"http://www.w3.org/2000/svg"};return f}},_p[68]={value:function(a,b,c){var d=_p.r(50);return _p.r(11).createClass("Sweep",{base:_p.r(46),constructor:function(a,b,c){this.callBase(),this.sectionArray=a||[],this.angle=b||0,this.angleOffset=c||0,this.draw()},getSectionArray:function(){return this.sectionArray},setSectionArray:function(a){return this.sectionArray=a,this.draw()},getAngle:function(){return this.angle},setAngle:function(a){return this.angle=a,this.draw()},getAngleOffset:function(){return this.angleOffset},setAngleOffset:function(a){return this.angleOffset=a,this.draw()},draw:function(){var a,b=this.sectionArray;for(a=0;a<b.length;a+=2)this.drawSection(b[a],b[a+1]);return this},drawSection:function(a,b){var c=this.angle&&(this.angle%360?this.angle%360:360),e=this.angleOffset,f=e+c/2,g=e+c,h=0>c?0:1,i=this.getDrawer();return i.redraw(),0===c?void i.done():(i.moveTo(d.fromPolar(a,e)),i.lineTo(d.fromPolar(b,e)),b&&(i.carcTo(b,0,h,d.fromPolar(b,f)),i.carcTo(b,0,h,d.fromPolar(b,g))),i.lineTo(d.fromPolar(a,g)),a&&(i.carcTo(a,0,h,d.fromPolar(a,f)),i.carcTo(a,0,h,d.fromPolar(a,e))),i.close(),void i.done())}})}},_p[69]={value:function(a,b,c){function d(a){var b=a._cachedFontHash;if(i[b])return i[b];var c=a.getContent();a.setContent("百度Fex");var d=a.getBoundaryBox(),e=a.getY(),f=e-d.y+ +a.node.getAttribute("dy"),g=f-d.height;return a.setContent(c),i[b]={top:f,bottom:g,middle:(f+g)/2}}var e=_p.r(70),f=_p.r(61),g=_p.r(67),h=_p.r(12),i={};return _p.r(11).createClass("Text",{base:e,mixins:[f],constructor:function(a){this.callBase("text"),void 0!==a&&this.setContent(a),this._buildFontHash()},_buildFontHash:function(){var a=window.getComputedStyle(this.node);this._cachedFontHash=[a.fontFamily,a.fontSize,a.fontStretch,a.fontStyle,a.fontVariant,a.fontWeight].join("-")},_fontChanged:function(a){var b=this._lastFont,c=h.extend({},b,a);if(!b)return this._lastFont=a,!0;var d=b.family!=c.family||b.size!=c.size||b.style!=c.style||b.weight!=c.weight;return this._lastFont=c,d},setX:function(a){return this.node.setAttribute("x",a),this},setPosition:function(a,b){return this.setX(a).setY(b)},setY:function(a){return this.node.setAttribute("y",a),this},getX:function(){return+this.node.getAttribute("x")||0},getY:function(){return+this.node.getAttribute("y")||0},setFont:function(a){return this.callBase(a),this._fontChanged(a)&&(this._buildFontHash(),this.setVerticalAlign(this.getVerticalAlign())),this},setTextAnchor:function(a){return this.node.setAttribute("text-anchor",a),this},getTextAnchor:function(){return this.node.getAttribute("text-anchor")||"start"},setVerticalAlign:function(a){return this.whenPaperReady(function(){var b;switch(a){case"top":b=d(this).top;break;case"bottom":b=d(this).bottom;break;case"middle":b=d(this).middle;break;default:b=0}this.node.setAttribute("dy",b)}),this.verticalAlign=a,this},getVerticalAlign:function(){return this.verticalAlign||"baseline"},setStartOffset:function(a){this.shapeNode!=this.node&&this.shapeNode.setAttribute("startOffset",100*a+"%")},addSpan:function(a){return this.addShape(a),this},setPath:function(a){var b=this.shapeNode;if(this.shapeNode==this.node){for(b=this.shapeNode=g.createNode("textPath");this.node.firstChild;)this.shapeNode.appendChild(this.node.firstChild);this.node.appendChild(b)}return b.setAttributeNS(g.xlink,"xlink:href","#"+a.node.id),this.setTextAnchor(this.getTextAnchor()),this}})}},_p[70]={value:function(a,b,c){var d=_p.r(60);return _p.r(11).createClass("TextContent",{base:d,constructor:function(a){this.callBase(a),this.shapeNode=this.shapeNode||this.node,this.shapeNode.setAttribute("text-rendering","geometricPrecision")},clearContent:function(){for(;this.shapeNode.firstChild;)this.shapeNode.removeChild(this.shapeNode.firstChild);return this},setContent:function(a){return this.shapeNode.textContent=a,this},getContent:function(){return this.shapeNode.textContent},appendContent:function(a){return this.shapeNode.textContent+=a,this},setSize:function(a){return this.setFontSize(a)},setFontSize:function(a){return this.setFont({size:a})},setFontFamily:function(a){return this.setFont({family:a})},setFontBold:function(a){return this.setFont({weight:a?"bold":"normal"})},setFontItalic:function(a){return this.setFont({style:a?"italic":"normal"})},setFont:function(a){var b=this.node;return["family","size","weight","style"].forEach(function(c){null===a[c]?b.removeAttribute("font-"+c):a[c]&&b.setAttribute("font-"+c,a[c])}),this},getExtentOfChar:function(a){return this.node.getExtentOfChar(a)},getRotationOfChar:function(a){return this.node.getRotationOfChar(a)},getCharNumAtPosition:function(a,b){return this.node.getCharNumAtPosition(this.node.viewportElement.createSVGPoint(a,b))}})}},_p[71]={value:function(a,b,c){var d=_p.r(70),e=_p.r(66);return _p.r(11).createClass("TextSpan",{base:d,mixins:[e],constructor:function(a){this.callBase("tspan"),this.setContent(a)}})}},_p[72]={value:function(a,b,c){var d=_p.r(67),e=_p.r(11),f=e.createClass("Use",{base:_p.r(60),constructor:function(a){this.callBase("use"),this.ref(a)},ref:function(a){if(!a)return this.node.removeAttributeNS(d.xlink,"xlink:href"),this;var b=a.getId();return b&&this.node.setAttributeNS(d.xlink,"xlink:href","#"+b),"none"===a.node.getAttribute("fill")&&a.node.removeAttribute("fill"),"none"===a.node.getAttribute("stroke")&&a.node.removeAttribute("stroke"),this}}),g=_p.r(60);return e.extendClass(g,{use:function(){return new f(this)}}),f}},_p[73]={value:function(a,b,c){var d=_p.r(50),e=_p.r(43),f=_p.r(11).createClass("Vector",{base:d,constructor:function(a,b){this.callBase(a,b)},square:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.square())},add:function(a){return new f(this.x+a.x,this.y+a.y)},minus:function(a){return new f(this.x-a.x,this.y-a.y)},dot:function(a){return this.x*a.x+this.y*a.y},project:function(a){return a.multipy(this.dot(a)/a.square())},normalize:function(a){return void 0===a&&(a=1),this.multipy(a/this.length())},multipy:function(a){return new f(this.x*a,this.y*a)},rotate:function(a,b){"rad"==b&&(a=a/Math.PI*180);var c=(new e).rotate(a).transformPoint(this);return new f(c.x,c.y)},vertical:function(){return new f(this.y,-this.x)},reverse:function(){return this.multipy(-1)},getAngle:function(){var a=this.length();if(0===a)return 0;var b=Math.acos(this.x/a),c=this.y>0?1:-1;return 180*c*b/Math.PI}});return f.fromPoints=function(a,b){return new f(b.x-a.x,b.y-a.y)},f.fromPolar=function(){var a=d.fromPolar.apply(d,arguments);return new f(a.x,a.y)},_p.r(11).extendClass(d,{asVector:function(){return new f(this.x,this.y)}}),f}},_p[74]={value:function(a,b,c){var d=_p.r(61),e=_p.r(75);return _p.r(11).createClass("View",{mixins:[d,e],base:_p.r(74),constructor:function(){this.callBase("view")}})}},_p[75]={value:function(a,b,c){return _p.r(11).createClass("ViewBox",{getViewBox:function(){var a=this.node.getAttribute("viewBox");return null===a?{x:0,y:0,width:this.node.clientWidth||this.node.parentNode.clientWidth,height:this.node.clientHeight||this.node.parentNode.clientHeight}:(a=a.split(" "),{x:+a[0],y:+a[1],width:+a[2],height:+a[3]})},setViewBox:function(a,b,c,d){return this.node.setAttribute("viewBox",[a,b,c,d].join(" ")),this}})}},_p[76]={value:function(a,b,c){var d={},e=_p.r(12);return d.version="2.0.0",e.extend(d,{createClass:_p.r(11).createClass,extendClass:_p.r(11).extendClass,Utils:e,Browser:_p.r(10),Box:_p.r(25),Bezier:_p.r(23),BezierPoint:_p.r(24),Circle:_p.r(26),Clip:_p.r(27),Color:_p.r(28),Container:_p.r(29),Curve:_p.r(30),Ellipse:_p.r(32),Group:_p.r(36),Gradient:_p.r(35),HyperLink:_p.r(37),Image:_p.r(38),Line:_p.r(39),LinearGradient:_p.r(40),Mask:_p.r(42),Matrix:_p.r(43),Marker:_p.r(41),Palette:_p.r(44),Paper:_p.r(45),Path:_p.r(46),Pattern:_p.r(47),Pen:_p.r(48),Point:_p.r(50),PointContainer:_p.r(51),Polygon:_p.r(53),Polyline:_p.r(54),Pie:_p.r(49),RadialGradient:_p.r(55),Resource:_p.r(58),Rect:_p.r(56),RegularPolygon:_p.r(57),Ring:_p.r(59),Shape:_p.r(60),ShapePoint:_p.r(63),ShapeContainer:_p.r(61),Sweep:_p.r(68),Star:_p.r(65),Text:_p.r(69),TextSpan:_p.r(71),Use:_p.r(72),Vector:_p.r(73),g:_p.r(34),Animator:_p.r(0),Easing:_p.r(1),OpacityAnimator:_p.r(4),RotateAnimator:_p.r(6),ScaleAnimator:_p.r(7),Timeline:_p.r(8),TranslateAnimator:_p.r(9),PathAnimator:_p.r(5),MotionAnimator:_p.r(3),requestFrame:_p.r(2).requestFrame,releaseFrame:_p.r(2).releaseFrame,Filter:_p.r(20),GaussianblurFilter:_p.r(21),ProjectionFilter:_p.r(22),ColorMatrixEffect:_p.r(13),CompositeEffect:_p.r(14),ConvolveMatrixEffect:_p.r(15),Effect:_p.r(16),GaussianblurEffect:_p.r(17),OffsetEffect:_p.r(18)}),window.kity=d}};var moduleMapping={kity:76};use("kity")}();var KityMinder=window.KM=window.KityMinder=function(){var a={},b=0,c={};return{version:"1.3.5",uuid:function(a){return a=a||"unknown",c[a]=c[a]||0,++c[a],a+"_"+c[a]},createMinder:function(a,b){b=b||{},b.renderTo=Utils.isString(a)?document.getElementById(a):a;var c=new Minder(b);return this.addMinder(b.renderTo,c),c},addMinder:function(c,d){var e;e="string"==typeof c?c:c.id||"KM_INSTANCE_"+b++,a[e]=d},getMinder:function(c,d){var e;return e="string"==typeof c?c:c.id||"KM_INSTANCE_"+b++,a[e]||this.createMinder(c,d)},LANG:{}}}(),utils=Utils=KityMinder.Utils={extend:kity.Utils.extend.bind(kity.Utils),listen:function(a,b,c){var d=utils.isArray(b)?b:utils.trim(b).split(/\s+/),e=d.length;if(e)for(;e--;)if(b=d[e],a.addEventListener)a.addEventListener(b,c,!1);else{c._d||(c._d={els:[]});var f=b+c.toString(),g=utils.indexOf(c._d.els,a);c._d[f]&&-1!=g||(-1==g&&c._d.els.push(a),c._d[f]||(c._d[f]=function(a){return c.call(a.srcElement,a||window.event)}),a.attachEvent("on"+b,c._d[f]))}a=null},trim:function(a){return a.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},each:function(a,b,c){if(null!=a)if(a.length===+a.length){for(var d=0,e=a.length;e>d;d++)if(b.call(c,d,a[d],a)===!1)return!1}else for(var f in a)if(a.hasOwnProperty(f)&&b.call(c,f,a[f],a)===!1)return!1},addCssRule:function(a,b,c){var d;return void 0===b||b&&b.nodeType&&9==b.nodeType?(c=b&&b.nodeType&&9==b.nodeType?b:c||document,d=c.getElementById(a),d?d.innerHTML:void 0):(c=c||document,d=c.getElementById(a),""===b?d?(d.parentNode.removeChild(d),!0):!1:void(d?d.innerHTML=b:(d=c.createElement("style"),d.id=a,d.innerHTML=b,c.getElementsByTagName("head")[0].appendChild(d))))},keys:function(a){var b=[];for(var c in a)a.hasOwnProperty(c)&&b.push(c);return b},proxy:function(a,b){return function(){return a.apply(b,arguments)}},indexOf:function(a,b,c){var d=-1;return c=this.isNumber(c)?c:0,this.each(a,function(a,e){return e>=c&&a===b?(d=e,!1):void 0}),d},argsToArray:function(a,b){return Array.prototype.slice.call(a,b||0)},clonePlainObject:function(a,b){var c;b=b||{};for(var d in a)a.hasOwnProperty(d)&&(c=a[d],utils.isObject(c)||utils.isArray(c)?(b[d]=utils.isArray(c)?[]:{},utils.clonePlainObject(a[d],b[d])):b[d]=c);return b},compareObject:function(a,b){var c;if(this.isEmptyObject(a)!==this.isEmptyObject(b))return!1;if(this.getObjectLength(a)!=this.getObjectLength(b))return!1;for(var d in a)if(a.hasOwnProperty(d)){if(c=a[d],void 0===b[d])return!1;if(this.isObject(c)||this.isArray(c)){if(this.isObject(b[d])!==this.isObject(c))return!1;if(this.isArray(c)!==this.isArray(b[d]))return!1;if(this.compareObject(c,b[d])===!1)return!1}else if(c!=b[d])return!1}return!0},getObjectLength:function(a){if(this.isArray(a)||this.isString(a))return a.length;var b=0;for(var c in a)a.hasOwnProperty(c)&&b++;return b},isEmptyObject:function(a){if(null==a)return!0;if(this.isArray(a)||this.isString(a))return 0===a.length;for(var b in a)if(a.hasOwnProperty(b))return!1;return!0},loadFile:function(){function a(a,c){try{for(var d,e=0;d=b[e++];)if(d.doc===a&&d.url==(c.src||c.href))return d}catch(f){return null}}var b=[];return function(c,d,e){var f=a(c,d);if(f)return void(f.ready?e&&e():f.funs.push(e));if(b.push({doc:c,url:d.src||d.href,funs:[e]}),!c.body){var g=[];for(var h in d)"tag"!=h&&g.push(h+'="'+d[h]+'"');return void c.write("<"+d.tag+" "+g.join(" ")+" ></"+d.tag+">")}if(!d.id||!c.getElementById(d.id)){var i=c.createElement(d.tag);delete d.tag;for(var h in d)i.setAttribute(h,d[h]);i.onload=i.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(f=a(c,d),f.funs.length>0){f.ready=1;for(var b;b=f.funs.pop();)b()}i.onload=i.onreadystatechange=null}},c.getElementsByTagName("head")[0].appendChild(i)}}}(),clone:function(a,b){var c;b=b||{};for(var d in a)a.hasOwnProperty(d)&&(c=a[d],"object"==typeof c?(b[d]=utils.isArray(c)?[]:{},utils.clone(a[d],b[d])):b[d]=c);return b},unhtml:function(a,b){return a?a.replace(b||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g,function(a,b){return b?a:{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;","'":"&#39;"}[a]}):""},cloneArr:function(a){return[].concat(a)},clearWhitespace:function(a){return a.replace(/[\u200b\t\r\n]/g,"")},getValueByIndex:function(a,b){var c=0,d=0;return utils.each(a,function(a,e){if(c+e.length>=b){if(b-c==e.length){if(1==e.length&&0===e[0].width)return void c++;d={x:e[e.length-1].x+e[e.length-1].width,y:e[e.length-1].y}}else d=e[b-c];return!1}c+=e.length+(1==e.length&&0===e[0].width?0:1)}),d},getNodeIndex:function(a,b){for(var c=a,d=0;c=c.previousSibling;)b&&3==c.nodeType?c.nodeType!=c.nextSibling.nodeType&&d++:d++;return d}};Utils.each(["String","Function","Array","Number","RegExp","Object"],function(a,b){KityMinder.Utils["is"+b]=function(a){return Object.prototype.toString.apply(a)=="[object "+b+"]"}});var browser=KityMinder.browser=function(){var a=navigator.userAgent.toLowerCase(),b=window.opera,c={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(a),opera:!!b&&b.version,webkit:a.indexOf(" applewebkit/")>-1,mac:a.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode,ipad:a.indexOf("ipad")>-1};c.gecko="Gecko"==navigator.product&&!c.webkit&&!c.opera&&!c.ie;var d=0;if(c.ie){var e=a.match(/(?:msie\s([\w.]+))/),f=a.match(/(?:trident.*rv:([\w.]+))/);d=e&&f&&e[1]&&f[1]?Math.max(1*e[1],1*f[1]):e&&e[1]?1*e[1]:f&&f[1]?1*f[1]:0,c.ie11Compat=11==document.documentMode,c.ie9Compat=9==document.documentMode,c.ie8=!!document.documentMode,c.ie8Compat=8==document.documentMode,c.ie7Compat=7==d&&!document.documentMode||7==document.documentMode,c.ie6Compat=7>d||c.quirks,c.ie9above=d>8,c.ie9below=9>d}if(c.gecko){var g=a.match(/rv:([\d\.]+)/);g&&(g=g[1].split("."),d=1e4*g[0]+100*(g[1]||0)+1*(g[2]||0))}return/chrome\/(\d+\.\d)/i.test(a)&&(c.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(a)&&!/chrome/i.test(a)&&(c.safari=+(RegExp.$1||RegExp.$2)),c.opera&&(d=parseFloat(b.version())),c.webkit&&(d=parseFloat(a.match(/ applewebkit\/(\d+)/)[1])),c.version=d,c.isCompatible=!c.mobile&&(c.ie&&d>=6||c.gecko&&d>=10801||c.opera&&d>=9.5||c.air&&d>=1||c.webkit&&d>=522||!1),c}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,Minder=KityMinder.Minder=kity.createClass("KityMinder",{constructor:function(a){this._options=Utils.extend(window.KITYMINDER_CONFIG||{},a);for(var b=Minder._initFnQueue.slice();b.length;)b.shift().call(this,a);this.fire("ready")}});Minder._initFnQueue=[],Minder.registerInit=function(a){Minder._initFnQueue.push(a)};var Command=kity.createClass("Command",{constructor:function(){this._isContentChange=!0,this._isSelectionChange=!1},execute:function(a,b){},setContentChanged:function(a){this._isContentChange=!!a},isContentChanged:function(){return this._isContentChange},setSelectionChanged:function(a){this._isSelectionChange=!!a},isSelectionChanged:function(){return this._isContentChange},queryState:function(a){return 0},queryValue:function(a){return 0},isNeedUndo:function(){return!0}});kity.extendClass(Minder,{_getCommand:function(a){return this._commands[a.toLowerCase()]},_queryCommand:function(a,b,c){var d=this._getCommand(a);if(d){var e=d["query"+b];if(e)return e.apply(d,[this].concat(c))}return 0},queryCommandState:function(a){return this._queryCommand(a,"State",Utils.argsToArray(1))},queryCommandValue:function(a){return this._queryCommand(a,"Value",Utils.argsToArray(1))},execCommand:function(a){a=a.toLowerCase();var b,c,d,e,f=Utils.argsToArray(arguments,1),g=this;return b=this._getCommand(a),e={command:b,commandName:a.toLowerCase(),commandArgs:f},b&&~this.queryCommandState(a)?(!this._hasEnterExecCommand&&b.isNeedUndo()?(this._hasEnterExecCommand=!0,c=this._fire(new MinderEvent("beforeExecCommand",e,!0)),c||(this._fire(new MinderEvent("saveScene")),this._fire(new MinderEvent("preExecCommand",e,!1)),d=b.execute.apply(b,[g].concat(f)),this._fire(new MinderEvent("execCommand",e,!1)),this._fire(new MinderEvent("saveScene")),b.isContentChanged()&&this._firePharse(new MinderEvent("contentchange")),this._interactChange()),this._hasEnterExecCommand=!1):(d=b.execute.apply(b,[g].concat(f)),this._hasEnterExecCommand||this._interactChange()),void 0===d?null:d):!1}});var MinderNode=KityMinder.MinderNode=kity.createClass("MinderNode",{constructor:function(a){this.parent=null,this.root=this,this.children=[],this.data={},this.tmpData={},this.initContainers(),Utils.isString(a)?this.setText(a):this.setData(a)},initContainers:function(){this.rc=(new kity.Group).setId(KityMinder.uuid("minder_node")),this.rc.minderNode=this},isRoot:function(){return this.root===this},isLeaf:function(){return 0===this.children.length},getRoot:function(){return this.root||this},getParent:function(){return this.parent},getLevel:function(){for(var a=0,b=this.parent;b;)a++,b=b.parent;return a},getComplex:function(){var a=0;return this.traverse(function(){a++}),a},getType:function(a){return this.type=["root","main","sub"][Math.min(this.getLevel(),2)],this.type},isAncestorOf:function(a){for(var b=a.parent;b;){if(b==this)return!0;b=b.parent}return!1},setText:function(a){return utils.isArray(a)&&(a=a.join("\n")),this.setData("text",a)},getText:function(a){var b=this.getData("text")||"";return a&&(b=b.split("\n")),b},preTraverse:function(a,b){var c=this.getChildren();b||a(this);for(var d=0;d<c.length;d++)c[d].preTraverse(a)},postTraverse:function(a,b){for(var c=this.getChildren(),d=0;d<c.length;d++)c[d].postTraverse(a);b||a(this)},traverse:function(a,b){return this.postTraverse(a,b)},getChildren:function(){return this.children},getIndex:function(){return this.parent?this.parent.children.indexOf(this):-1},insertChild:function(a,b){void 0===b&&(b=this.children.length),a.parent&&a.parent.removeChild(a),a.parent=this,a.root=this.root,this.children.splice(b,0,a)},appendChild:function(a){return this.insertChild(a)},prependChild:function(a){return this.insertChild(a,0)},removeChild:function(a){var b,c=a;a instanceof MinderNode&&(c=this.children.indexOf(a)),c>=0&&(b=this.children.splice(c,1)[0],b.parent=null,b.root=b)},getChild:function(a){return this.children[a]},getFirstChild:function(){return this.children[0]},getLastChild:function(){return this.children[this.children.length-1]},getData:function(a){return void 0===a?this.data:this.data[a]},setData:function(a,b){return void 0===a?this.data={}:utils.isObject(a)?Utils.extend(this.data,a):void 0===b?(this.data[a]=null,delete this.data[a]):this.data[a]=b,this},getRenderContainer:function(){return this.rc},getCommonAncestor:function(a){return Utils.getNodeCommonAncestor(this,a)},contains:function(a){return this==a||this.isAncestorOf(a)},clone:function(){function a(b,c){var d=new KM.MinderNode;d.data=Utils.clonePlainObject(c.getData()),d.tmpData=Utils.clonePlainObject(c.getTmpData()),b&&b.appendChild(d);for(var e,f=0;e=c.children[f++];)a(d,e);return d}return a(null,this)},equals:function(a,b){function c(){e&&d.setSelectedFlag(),f&&a.setSelectedFlag()}var d=this;if(b){var e=!1,f=!1;d.isSelected()&&(e=!0,d.clearSelectedFlag()),a.isSelected()&&(f=!0,a.clearSelectedFlag())}if(a.children.length!=this.children.length)return c(),!1;if(utils.compareObject(a.getData(),d.getData())===!1)return c(),!1;if(utils.compareObject(a.getTmpData(),d.getTmpData())===!1)return c(),!1;for(var g,h=0;g=d.children[h];h++)if(g.equals(a.children[h],b)===!1)return c(),!1;return c(),!0},clearChildren:function(){this.children=[]},setTmpData:function(a,b){var c=this;utils.isObject(a)&&utils.each(a,function(a,b){c.setTmpData(a,b)}),void 0===b||null===b||""===b?delete this.tmpData[a]:this.tmpData[a]=b},getTmpData:function(a){return void 0===a?this.tmpData:this.tmpData[a];
  18. },setValue:function(a){return this.data={},this.setData(utils.clonePlainObject(a.getData())),this.tmpData={},this.setTmpData(utils.clonePlainObject(a.getTmpData())),this}});MinderNode.getCommonAncestor=function(a,b){if(a instanceof Array)return MinderNode.getCommonAncestor.apply(this,a);switch(arguments.length){case 1:return a.parent||a;case 2:if(a.isAncestorOf(b))return a;if(b.isAncestorOf(a))return b;for(var c=a.parent;c&&!c.isAncestorOf(b);)c=c.parent;return c;default:return Array.prototype.reduce.call(arguments,function(a,b){return MinderNode.getCommonAncestor(a,b)},a)}},kity.extendClass(Minder,{getRoot:function(){return this._root},setRoot:function(a){this._root=a,a.minder=this},createNode:function(a,b,c){var d=new MinderNode(a);return this.fire("nodecreate",{node:d,parent:b,index:c}),this.appendNode(d,b,c),d},appendNode:function(a,b,c){return b&&b.insertChild(a,c),this.attachNode(a),this},removeNode:function(a){a.parent&&(a.parent.removeChild(a),this.detachNode(a),this.fire("noderemove",{node:a}))},attachNode:function(a){var b=this._rc;a.traverse(function(a){a.attached=!0,b.addShape(a.getRenderContainer())}),b.addShape(a.getRenderContainer()),this.fire("nodeattach",{node:a})},detachNode:function(a){var b=this._rc;a.traverse(function(a){a.attached=!1,b.removeShape(a.getRenderContainer())}),this.fire("nodedetach",{node:a})},getMinderTitle:function(){return this.getRoot().getText()}}),kity.extendClass(MinderNode,{getMinder:function(){return this.getRoot().minder}}),kity.extendClass(Minder,{getOptions:function(a){var b;return a?(b=this.getPreferences(a),b&&b[a]||this._options[a]):(b=this.getPreferences(),utils.extend(b,this._options,!0))},setDefaultOptions:function(a,b,c){var d={};Utils.isString(a)?d[a]=b:d=a,utils.extend(this._options,d,!c)},setOptions:function(a,b){this.setPreferences(a,b)}}),Minder.registerInit(function(a){this.setDefaultOptions(KM.defaultOptions)});var MinderEvent=kity.createClass("MindEvent",{constructor:function(a,b,c){b=b||{},b.getType&&"ShapeEvent"==b.getType()?(this.kityEvent=b,this.originEvent=b.originEvent,this.getPosition=b.getPosition.bind(b)):b.target&&b.preventDefault?this.originEvent=b:kity.Utils.extend(this,b),this.type=a,this._canstop=c||!1},getTargetNode:function(){var a=this.kityEvent&&this.kityEvent.targetShape;if(!a)return null;for(;!a.minderNode&&a.container;)a=a.container;var b=a.minderNode;return b&&a.getOpacity()<1?null:b||null},stopPropagation:function(){this._stoped=!0},stopPropagationImmediately:function(){this._immediatelyStoped=!0,this._stoped=!0},shouldStopPropagation:function(){return this._canstop&&this._stoped},shouldStopPropagationImmediately:function(){return this._canstop&&this._immediatelyStoped},preventDefault:function(){this.originEvent.preventDefault()},isRightMB:function(){var a=!1;return this.originEvent?("which"in this.originEvent?a=3==this.originEvent.which:"button"in this.originEvent&&(a=2==this.originEvent.button),a):!1},getKeyCode:function(){var a=this.originEvent;return a.keyCode||a.which}});Minder.registerInit(function(){this._initEvents()}),kity.extendClass(Minder,{_initEvents:function(){this._eventCallbacks={}},_bindEvents:function(){this._bindPaperEvents(),this._bindKeyboardEvents()},_resetEvents:function(){this._initEvents(),this._bindEvents()},_bindPaperEvents:function(){this._paper.on("click dblclick mousedown contextmenu mouseup mousemove mouseover mousewheel DOMMouseScroll touchstart touchmove touchend dragenter dragleave drop",this._firePharse.bind(this)),window&&(window.addEventListener("resize",this._firePharse.bind(this)),window.addEventListener("blur",this._firePharse.bind(this)))},_bindKeyboardEvents:function(){-1==navigator.userAgent.indexOf("iPhone")&&-1==navigator.userAgent.indexOf("iPod")&&-1==navigator.userAgent.indexOf("iPad")&&Utils.listen(document.body,"keydown keyup keypress paste",this._firePharse.bind(this))},_firePharse:function(a){var b,c,d;"DOMMouseScroll"==a.type&&(a.type="mousewheel",a.wheelDelta=a.originEvent.wheelDelta=-10*a.originEvent.detail,a.wheelDeltaX=a.originEvent.mozMovementX,a.wheelDeltaY=a.originEvent.mozMovementY),b=new MinderEvent("before"+a.type,a,!0),this._fire(b)||(c=new MinderEvent("pre"+a.type,a,!0),d=new MinderEvent(a.type,a,!0),(this._fire(c)||this._fire(d))&&this._fire(new MinderEvent("after"+a.type,a,!1)))},_interactChange:function(a){var b=this;b._interactScheduled||(setTimeout(function(){b._fire(new MinderEvent("interactchange")),b._interactScheduled=!1},100),b._interactScheduled=!0)},_listen:function(a,b){var c=this._eventCallbacks[a]||(this._eventCallbacks[a]=[]);c.push(b)},_fire:function(a){var b=this.getStatus(),c=this._eventCallbacks[a.type.toLowerCase()]||[];if(b&&(c=c.concat(this._eventCallbacks[b+"."+a.type.toLowerCase()]||[])),0!==c.length){for(var d=(this.getStatus(),0);d<c.length&&(c[d].call(this,a),!a.shouldStopPropagationImmediately());d++);return a.shouldStopPropagation()}},on:function(a,b){var c=this;return utils.each(a.split(/\s+/),function(a,d){c._listen(d.toLowerCase(),b)}),this},off:function(a,b){var c,d,e,f,g=a.split(/\s+/);for(c=0;c<g.length;c++)if(e=this._eventCallbacks[g[c].toLowerCase()]){for(f=null,d=0;d<e.length;d++)e[d]==b&&(f=d);null!==f&&e.splice(f,1)}},fire:function(a,b){var c=new MinderEvent(a,b);return this._fire(c),this}}),Minder.registerInit(function(){this._initStatus()}),kity.extendClass(Minder,{_initStatus:function(){this._status="normal",this._rollbackStatus="normal"},setStatus:function(){var a=~window.location.href.indexOf("status"),b=~window.location.href.indexOf("trace");return function(c,d){return"readonly"!=this._status||d?(c!=this._status&&(this._rollbackStatus=this._status,this._status=c,this.fire("statuschange",{lastStatus:this._rollbackStatus,currentStatus:this._status}),a&&(console.log(window.event.type,this._rollbackStatus,"->",this._status),b&&console.trace())),this):this}}(),rollbackStatus:function(){this.setStatus(this._rollbackStatus)},getRollbackStatus:function(){return this._rollbackStatus},getStatus:function(){return this._status}}),Minder.registerInit(function(){this._initPaper()}),kity.extendClass(Minder,{_initPaper:function(){this._paper=new kity.Paper,this._paper.getNode().setAttribute("contenteditable",!0),this._paper.getNode().ondragstart=function(a){a.preventDefault()},this._paper.shapeNode.setAttribute("transform","translate(0.5, 0.5)"),this._addRenderContainer(),this.setRoot(this.createNode(this.getLang().maintopic)),this._options.renderTo&&this.renderTo(this._options.renderTo)},_addRenderContainer:function(){this._rc=(new kity.Group).setId(KityMinder.uuid("minder")),this._paper.addShape(this._rc)},renderTo:function(a){this._paper.renderTo(this._renderTarget=a),this._bindEvents()},getRenderContainer:function(){return this._rc},getPaper:function(){return this._paper},getRenderTarget:function(){return this._renderTarget}}),Minder.registerInit(function(){this._initSelection()}),kity.extendClass(Minder,{_initSelection:function(){this._selectedNodes=[]},renderChangedSelection:function(a){var b=this.getSelectedNodes(),c=[],d=0;for(b.forEach(function(b){-1==a.indexOf(b)&&(c.push(b),b.setTmpData("selected",!0))}),a.forEach(function(a){-1==b.indexOf(a)&&(c.push(a),a.setTmpData("selected",!1))}),c.length&&(this._interactChange(),this.fire("selectionchange"));d<c.length;)c[d++].render()},getSelectedNodes:function(){return this._selectedNodes},getSelectedNode:function(){return this.getSelectedNodes()[0]||null},removeAllSelectedNodes:function(){var a=this._selectedNodes.splice(0);return this._selectedNodes=[],this.renderChangedSelection(a),this.fire("selectionclear")},removeSelectedNodes:function(a){var b=this,c=this._selectedNodes.slice(0);return a=Utils.isArray(a)?a:[a],Utils.each(a,function(a,c){var d;-1!==(d=b._selectedNodes.indexOf(c))&&b._selectedNodes.splice(d,1)}),this.renderChangedSelection(c),this},select:function(a,b){var c=this.getSelectedNodes().slice(0);b&&(this._selectedNodes=[]);var d=this;return a=Utils.isArray(a)?a:[a],Utils.each(a,function(a,b){-1===d._selectedNodes.indexOf(b)&&d._selectedNodes.push(b)}),this.renderChangedSelection(c),this},toggleSelect:function(a){return Utils.isArray(a)?a.forEach(this.toggleSelect.bind(this)):a.isSelected()?this.removeSelectedNodes(a):this.select(a),this},isSingleSelect:function(){return 1==this._selectedNodes.length},getSelectedAncestors:function(a){function b(a,b){for(var c=a.length-1;c>=0;--c)if(a[c].isAncestorOf(b))return!0;return!1}var c,d=this.getSelectedNodes().slice(0),e=[],f=d.indexOf(this.getRoot());for(~f&&!a&&d.splice(f,1),d.sort(function(a,b){return a.getLevel()-b.getLevel()});c=d.pop();)b(d,c)||e.push(c);return e}}),kity.extendClass(MinderNode,{isSelected:function(){return this.getTmpData("selected")},clearSelectedFlag:function(){this.setTmpData("selected")},setSelectedFlag:function(){this.setTmpData("selected",!0)}}),kity.extendClass(MinderEvent,{isShortcutKey:function(a){var b=this.originEvent;return b?getMetaKeyCode(a)==getMetaKeyCode(b):!1}}),Minder.registerInit(function(){this._initShortcutKey()}),kity.extendClass(Minder,{_initShortcutKey:function(){this._bindShortcutKeys()},_bindShortcutKeys:function(){var a=this._shortcutKeys={},b="hasOwnProperty";this.on("keydown",function(c){for(var d in a)if(a[b](d)&&c.isShortcutKey(d)){var e=a[d];if(e.__statusCondition&&e.__statusCondition!=this.getStatus())return;e(),c.preventDefault()}})},addShortcut:function(a,b){var c=this._shortcutKeys;a.split(/\|\s*/).forEach(function(a){var d,e=a.split("::");e.length>1&&(a=e[1],d=e[0],b.__statusCondition=d),c[a]=b})},addCommandShortcutKeys:function(a,b){var c=this._commandShortcutKeys||(this._commandShortcutKeys={}),d={};b?d[a]=b:d=a;var e=this;utils.each(d,function(a,b){c[a]=b,e.addShortcut(b,function(){0===e.queryCommandState(a)&&e.execCommand(a)})})},getCommandShortcutKey:function(a){var b=this._commandShortcutKeys;return b&&b[a]||null}}),Minder.registerInit(function(){this._initContextMenu()}),kity.extendClass(Minder,{_initContextMenu:function(){this.contextmenus=[]},addContextMenu:function(a){return utils.isArray(a)?this.contextmenus=this.contextmenus.concat(a):this.contextmenus.push(a),this},getContextMenu:function(){return this.contextmenus}}),function(){var a;KityMinder.registerModule=function(b,c){a||(a={}),a[b]=c},KityMinder.getModules=function(){return a}}(),Minder.registerInit(function(){this._initModules()}),kity.extendClass(Minder,{_initModules:function(){var a=KityMinder.getModules(),b=this._options.modules||Utils.keys(a);this._commands={},this._query={},this._modules={},this._rendererClasses={};var c,d,e,f,g,h,i,j=this;for(c=0;c<b.length;c++)if(d=b[c],a[d]&&(f="function"==typeof a[d]?a[d].call(j):a[d],this._modules[d]=f,f)){f.init&&f.init.call(j,this._options),g=f.commands;for(d in g)this._commands[d.toLowerCase()]=new g[d];if(h=f.events)for(e in h)j.on(e,h[e]);if(i=f.renderers)for(e in i)this._rendererClasses[e]=this._rendererClasses[e]||[],Utils.isArray(i[e])?this._rendererClasses[e]=this._rendererClasses[e].concat(i[e]):this._rendererClasses[e].push(i[e]);f.defaultOptions&&this.setDefaultOptions(f.defaultOptions),f.commandShortcutKeys&&this.addCommandShortcutKeys(f.commandShortcutKeys),f.contextmenu&&this.addContextMenu(f.contextmenu)}},_garbage:function(){for(this.clearSelect();this._root.getChildren().length;)this._root.removeChild(0)},destroy:function(){var a=this._modules;this._resetEvents(),this._garbage();for(var b in a)a[b].destroy&&a[b].destroy.call(this)},reset:function(){var a=this._modules;this._garbage();for(var b in a)a[b].reset&&a[b].reset.call(this)}}),Utils.extend(KityMinder,{_protocols:{},registerProtocol:function(a,b){KityMinder._protocols[a]=b}});var DEFAULT_TEXT={root:"maintopic",main:"topic",sub:"topic"};Minder.registerInit(function(){this._initProtocols()}),kity.extendClass(Minder,{_initProtocols:function(a){var b=this._protocols={},c=KityMinder._protocols;for(var d in c)c.hasOwnProperty(d)&&(b[d]=c[d](this)),b[d].name=d},getProtocol:function(a){return this._protocols[a]||null},getSupportedProtocols:function(){var a=this._protocols;return Utils.keys(a).map(function(b){return a[b]})},exportJson:function(){function a(b){var c={};c.data=b.getData();var d=b.getChildren();if(d.length){c.children=[];for(var e=0;e<d.length;e++)c.children.push(a(d[e]))}return c}var b=a(this.getRoot());return b.template=this.getTemplate(),b.theme=this.getTheme(),b.version=KityMinder.version,b},importJson:function(a,b){function c(a,b,d){var e=b.data;a.data={};for(var f in e)a.setData(f,e[f]);a.setData("text",e.text||d.getLang(DEFAULT_TEXT[a.getType()]));for(var g=b.children||[],h=0;h<g.length;h++){var i=d.createNode(null,a);c(i,g[h],d)}return a}if(a){for(this._fire(new MinderEvent("preimport",b,!1));this._root.getChildren().length;)this.removeNode(this._root.getChildren()[0]);a=KityMinder.compatibility(a),c(this._root,a,this),this.setTemplate(a.template||"default"),this.setTheme(a.theme||null),this.refresh(),this.fire("import",b),this._firePharse({type:"contentchange"}),this._interactChange()}},exportData:function(a,b){var c,d;return c=this.exportJson(),!a||(d=this.getProtocol(a),d&&d.encode)?(this._fire(new MinderEvent("beforeexport",{json:c,protocolName:a,protocol:d})),Promise.resolve(d?d.encode(c,this,b):c)):Promise.reject(new Error("Not supported protocol:"+a))},importData:function(a,b){var c,d=this;if(b&&(c=this.getProtocol(b),!c||!c.decode))return Promise.reject(new Error("Not supported protocol:"+b));var e={local:a,protocolName:b,protocol:c};return this._fire(new MinderEvent("beforeimport",e)),new Promise(function(b,d){b(c?c.decode(a):a)}).then(function(a){return d.importJson(a,e),a})}}),Minder.registerInit(function(a){a.readOnly&&this.setDisabled()}),kity.extendClass(Minder,{disable:function(){var a=this;a.bkqueryCommandState=a.queryCommandState,a.bkqueryCommandValue=a.queryCommandValue,a.queryCommandState=function(b){var c=this._getCommand(b);return c&&c.enableReadOnly?a.bkqueryCommandState.apply(a,arguments):-1},a.queryCommandValue=function(b){var c=this._getCommand(b);return c&&c.enableReadOnly?a.bkqueryCommandValue.apply(a,arguments):null},this.setStatus("readonly"),a._interactChange()},enable:function(){var a=this;a.bkqueryCommandState&&(a.queryCommandState=a.bkqueryCommandState,delete a.bkqueryCommandState),a.bkqueryCommandValue&&(a.queryCommandValue=a.bkqueryCommandValue,delete a.bkqueryCommandValue),this.setStatus("normal"),a._interactChange()}}),Utils.extend(KityMinder,{_layout:{},registerLayout:function(a,b){KityMinder._layout[a]=b,KityMinder._defaultLayout||(KityMinder._defaultLayout=a)},getLayoutList:function(){return this._layout},getLayoutInstance:function(a){var b=KityMinder._layout[a];if(!b)throw new Error("Missing Layout: "+a);var c=new b;return c}}),kity.extendClass(MinderNode,{getLayout:function(){var a=this.getData("layout");return a=a||(this.isRoot()?KityMinder._defaultLayout:this.parent.getLayout())},setLayout:function(a){return a&&("inherit"==a?this.setData("layout"):this.setData("layout",a)),this},layout:function(a,b){return this.setLayout(a).getMinder().layout(b),this},getLayoutInstance:function(){return KityMinder.getLayoutInstance(this.getLayout())},getOrderHint:function(a){return this.parent.getLayoutInstance().getOrderHint(this)},getExpandPosition:function(){return this.getLayoutInstance().getExpandPosition()},getLayoutTransform:function(){return this._layoutTransform||new kity.Matrix},getGlobalLayoutTransformPreview:function(){var a=this.parent?this.parent.getLayoutTransform():new kity.Matrix,b=this.getLayoutTransform(),c=this.getLayoutOffset();return c&&b.translate(c.x,c.y),a.merge(b)},getLayoutPointPreview:function(){return this.getGlobalLayoutTransformPreview().transformPoint(new kity.Point)},getGlobalLayoutTransform:function(){return this._globalLayoutTransform?this._globalLayoutTransform:this.parent?this.parent.getGlobalLayoutTransform():new kity.Matrix},setLayoutTransform:function(a){return this._layoutTransform=a,this},setGlobalLayoutTransform:function(a){return this.getRenderContainer().setMatrix(this._globalLayoutTransform=a),this},setVertexIn:function(a){this._vertexIn=a},setVertexOut:function(a){this._vertexOut=a},getVertexIn:function(){return this._vertexIn||new kity.Point},getVertexOut:function(){return this._vertexOut||new kity.Point},getLayoutVertexIn:function(){return this.getGlobalLayoutTransform().transformPoint(this.getVertexIn())},getLayoutVertexOut:function(){return this.getGlobalLayoutTransform().transformPoint(this.getVertexOut())},setLayoutVectorIn:function(a){return this._layoutVectorIn=a,this},setLayoutVectorOut:function(a){return this._layoutVectorOut=a,this},getLayoutVectorIn:function(){return this._layoutVectorIn||new kity.Vector},getLayoutVectorOut:function(){return this._layoutVectorOut||new kity.Vector},getLayoutBox:function(){var a=this.getGlobalLayoutTransform();return a.transformBox(this.getContentBox())},getLayoutPoint:function(){var a=this.getGlobalLayoutTransform();return a.transformPoint(new kity.Point)},getLayoutOffset:function(){if(!this.parent)return new kity.Point;var a=this.getData("layout_"+this.parent.getLayout()+"_offset");return a?new kity.Point(a.x,a.y):new kity.Point},setLayoutOffset:function(a){if(!this.parent)return this;if(a&&!this.hasLayoutOffset()){var b=this.getLayoutTransform().m;a=a.offset(b.e,b.f),this.setLayoutTransform(null)}return this.setData("layout_"+this.parent.getLayout()+"_offset",a?{x:a.x,y:a.y}:null),this},hasLayoutOffset:function(){return!!this.getData("layout_"+this.parent.getLayout()+"_offset")},resetLayoutOffset:function(){return this.setLayoutOffset(null)},getLayoutRoot:function(){return this.isLayoutRoot()?this:this.parent.getLayoutRoot()},isLayoutRoot:function(){return this.getData("layout")||this.isRoot()}}),Minder.registerInit(function(a){this.refresh()}),kity.extendClass(Minder,{layout:function(a){function b(a,c){a.isExpanded(),0||a.children.forEach(function(a){b(a,c)});var d=a.getLayoutInstance(),e=a.getChildren().filter(function(a){return!a.hasLayoutOffset()});d.doLayout(a,e,c)}this.getRoot().traverse(function(a){a.setLayoutTransform(null)}),b(this.getRoot(),1),b(this.getRoot(),2),a=a?300:0;var c=this;return this.applyLayoutResult(this.getRoot(),a).then(function(){c.fire("layoutallfinish")}),this.fire("layout")},refresh:function(a){return this.getRoot().renderTree(),this.layout(a).fire("contentchange")._interactChange(),this},applyLayoutResult:function(a,b){function c(){--i||g.resolve()}function d(a,b){a.setGlobalLayoutTransform(b),f.fire("layoutapply",{node:a,matrix:b})}function e(a,g){var h=a.getLayoutTransform().merge(g),i=a.getGlobalLayoutTransform()||new kity.Matrix,j=a.getLayoutOffset();h.translate(j.x,j.y),h.m.e=Math.round(h.m.e),h.m.f=Math.round(h.m.f),a._layoutTimeline&&(a._layoutTimeline.stop(),a._layoutTimeline=null),b?a._layoutTimeline=new kity.Animator(i,h,d).start(a,b,"ease").on("finish",function(){setTimeout(function(){d(a,h),f.fire("layoutfinish",{node:a,matrix:h}),c()},150)}):(d(a,h),f.fire("layoutfinish",{node:a,matrix:h}),c());for(var k=0;k<a.children.length;k++)e(a.children[k],h)}a=a||this.getRoot();var f=this,g={},h=new Promise(function(a,b){g.resolve=a,g.reject=b}),i=a.getComplex();return i>200&&(b=0),e(a,a.parent?a.parent.getGlobalLayoutTransform():new kity.Matrix),h}});var Layout=kity.createClass("Layout",{doLayout:function(a){throw new Error("Not Implement: Layout.doLayout()")},align:function(a,b,c){var d=this;c=c||0,a.forEach(function(a){var e=d.getTreeBox([a]),f=a.getLayoutTransform();switch(b){case"left":return f.translate(c-e.left,0);case"right":return f.translate(c-e.right,0);case"top":return f.translate(0,c-e.top);case"bottom":return f.translate(0,c-e.bottom)}})},stack:function(a,b,c){var d=this,e=0;return c=c||function(a,b,c){return a.getStyle({x:"margin-right",y:"margin-bottom"}[c])+b.getStyle({x:"margin-left",y:"margin-top"}[c])},a.forEach(function(a,f,g){var h=d.getTreeBox([a]),i={x:h.width,y:h.height}[b],j={x:h.left,y:h.top}[b],k=a.getLayoutTransform();"x"==b?k.translate(e-j,0):k.translate(0,e-j),e+=i,g[f+1]&&(e+=c(a,g[f+1],b))}),e},move:function(a,b,c){a.forEach(function(a){a.getLayoutTransform().translate(b,c)})},getBranchBox:function(a){var b,c,d,e,f=new kity.Box;for(b=0;b<a.length;b++)c=a[b],d=c.getLayoutTransform(),e=c.getContentBox(),f=f.merge(d.transformBox(e));return f},getTreeBox:function(a){var b,c,d,e,f=KityMinder.Geometry,g={x:0,y:0,height:0,width:0};for(a instanceof Array||(a=[a]),b=0;b<a.length;b++)c=a[b],d=c.getLayoutTransform(),e=c.getContentBox(),c.isExpanded()&&c.children.length&&(e=f.mergeBox(e,this.getTreeBox(c.children))),g=f.mergeBox(g,d.transformBox(e));return g},getOrderHint:function(a){return[]}}),LayoutCommand=kity.createClass("LayoutCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNodes();c.forEach(function(a){a.layout(b)})},queryValue:function(a){var b=a.getSelectedNode();return b?b.getData("layout"):void 0},queryState:function(a){return a.getSelectedNode()?0:-1}}),ResetLayoutCommand=kity.createClass("ResetLayoutCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNodes();c.length||(c=[a.getRoot()]),c.forEach(function(a){a.traverse(function(a){a.resetLayoutOffset(),a.isRoot()||a.setData("layout",null)})}),a.layout(300)},enableReadOnly:!0});KityMinder.registerModule("LayoutModule",{commands:{layout:LayoutCommand,resetlayout:ResetLayoutCommand},contextmenu:[{command:"resetlayout"},{divider:!0}],commandShortcutKeys:{resetlayout:"Ctrl+Shift+L"}});var cssLikeValueMatcher={left:function(a){return 3 in a&&a[3]||1 in a&&a[1]||a[0]},right:function(a){return 1 in a&&a[1]||a[0]},top:function(a){return a[0]},bottom:function(a){return 2 in a&&a[2]||a[0]}};Utils.extend(KityMinder,{_themes:{},registerTheme:function(a,b){KityMinder._themes[a]=b},getThemeList:function(){return KityMinder._themes}}),kity.extendClass(Minder,{useTheme:function(a){return this.setTheme(a),this.refresh(800),!0},setTheme:function(a){this._theme=a||null,this.getRenderTarget().style.background=this.getStyle("background"),this.fire("themechange",{theme:a})},getTheme:function(a){return this._theme||this.getOptions("defaultTheme")},getThemeItems:function(a){this.getTheme(a);return KityMinder._themes[this.getTheme(a)]},getStyle:function(a,b){var c,d,e,f,g=this.getThemeItems(b);if(a in g)return g[a];if(c=a.split("-"),c.length<2)return null;if(d=c.pop(),a=c.join("-"),a in g){if(e=g[a],Utils.isArray(e)&&(f=cssLikeValueMatcher[d]))return f(e);if(!isNaN(e))return e}return null},getNodeStyle:function(a,b){var c=this.getStyle(a.getType()+"-"+b,a);return null!==c?c:this.getStyle(b,a)}}),kity.extendClass(MinderNode,{getStyle:function(a){return this.getMinder().getNodeStyle(this,a)}}),KityMinder.registerModule("Theme",{defaultOptions:{defaultTheme:"fresh-blue"},commands:{theme:kity.createClass("ThemeCommand",{base:Command,execute:function(a,b){return a.useTheme(b)},queryValue:function(a){return a.getTheme()||"default"}})}}),Minder.registerInit(function(){this.setTheme()}),Utils.extend(KityMinder,{compatibility:function(a){function b(a,c){c(a),a.children&&a.children.forEach(function(a){b(a,c)})}function c(a){b(a,function(a){var b=a.data;delete b.layout_bottom_offset,delete b.layout_default_offset,delete b.layout_filetree_offset})}function d(a){var c=a.data.currentstyle;delete a.data.currentstyle,"bottom"==c?(a.template="structure",a.theme="snow"):"default"==c&&(a.template="default",a.theme="classic"),b(a,function(a){var b=a.data;"PriorityIcon"in b&&(b.priority=b.PriorityIcon,delete b.PriorityIcon),"ProgressIcon"in b&&(b.progress=1+(b.ProgressIcon-1<<1),delete b.ProgressIcon),delete b.point,delete b.layout})}var e=a.version||"1.1.3";switch(e){case"1.1.3":d(a);case"1.2.0":case"1.2.1":c(a)}return a}});var Renderer=KityMinder.Renderer=kity.createClass("Renderer",{constructor:function(a){this.node=a},create:function(a){throw new Error("Not implement: Renderer.create()")},shouldRender:function(a){return!0},watchChange:function(a){var b;b=void 0===this.watchingData?!0:this.watchingData!=a?!0:!1,this.watchingData=a},shouldDraw:function(a){return!0},update:function(a,b,c){return this.shouldDraw()&&this.draw(a,b),this.place(a,b,c)},draw:function(a,b){throw new Error("Not implement: Renderer.draw()")},place:function(a,b,c){throw new Error("Not implement: Renderer.place()")},getRenderShape:function(){return this._renderShape||null},setRenderShape:function(a){this._renderShape=a}});kity.extendClass(Minder,function(){function a(a,b){var c=[];["center","left","right","top","bottom","outline","outside"].forEach(function(a){var d="before"+a,e="after"+a;b[d]&&(c=c.concat(b[d])),b[a]&&(c=c.concat(b[a])),b[e]&&(c=c.concat(b[e]))}),a._renderers=c.map(function(b){return new b(a)})}return{renderNodeBatch:function(b){var c,d,e,f,g=this._rendererClasses,h=[],i=0;if(b.length){for(d=0;d<b.length;d++)f=b[d],f._renderers||a(f,g),f._contentBox=new kity.Box,this.fire("beforerender",{node:f});for(i=b[0]._renderers.length,c=0;i>c;c++){for(d=0;d<b.length;d++)"function"==typeof h[d]&&(h[d]=h[d]()),h[d]instanceof kity.Box||(h[d]=new kity.Box(h[d]));for(d=0;d<b.length;d++)f=b[d],e=f._renderers[c],h[d]&&(f._contentBox=f._contentBox.merge(h[d])),e.shouldRender(f)?(e.getRenderShape()||(e.setRenderShape(e.create(f)),e.bringToBack?f.getRenderContainer().prependShape(e.getRenderShape()):f.getRenderContainer().appendShape(e.getRenderShape())),e.getRenderShape().setVisible(!0),h[d]=e.update(e.getRenderShape(),f,f._contentBox)):e.getRenderShape()&&(e.getRenderShape().setVisible(!1),h[d]=null)}for(d=0;d<b.length;d++)this.fire("noderender",{node:b[d]})}},renderNode:function(b){var c,d=this._rendererClasses;KityMinder.Geometry;b._renderers||a(b,d),this.fire("beforerender",{node:b}),b._contentBox=new kity.Box,b._renderers.forEach(function(a){a.shouldRender(b)?(a.getRenderShape()||(a.setRenderShape(a.create(b)),a.bringToBack?b.getRenderContainer().prependShape(a.getRenderShape()):b.getRenderContainer().appendShape(a.getRenderShape())),a.getRenderShape().setVisible(!0),c=a.update(a.getRenderShape(),b,b._contentBox),"function"==typeof c&&(c=c()),c&&(b._contentBox=b._contentBox.merge(c))):a.getRenderShape()&&a.getRenderShape().setVisible(!1)}),this.fire("noderender",{node:b})}}}()),kity.extendClass(MinderNode,{render:function(){return this.attached?(this.getMinder().renderNode(this),this):void 0},renderTree:function(){if(this.attached){var a=[];return this.traverse(function(b){a.push(b)}),this.getMinder().renderNodeBatch(a),this}},getRenderer:function(a){for(var b=this._renderers,c=0;c<b.length;c++)if(b[c].getType()==a)return b[c];return null},getContentBox:function(){return this.parent&&this.parent.isCollapsed()?new kity.Box:this._contentBox||new kity.Box}}),utils.extend(KityMinder,{_connectProviders:{},_defaultConnectProvider:function(a,b,c){c.setPathData(["M",b.getLayoutVertexOut(),"L",a.getLayoutVertexIn()])},registerConnectProvider:function(a,b){KityMinder._connectProviders[a]=b},getConnectProvider:function(a){return KityMinder._connectProviders[a]||KityMinder._defaultConnectProvider}}),kity.extendClass(MinderNode,{getConnectProvider:function(){return KityMinder.getConnectProvider(this.getConnect())},getConnect:function(){return null},getConnection:function(){return this._connection||null}}),kity.extendClass(Minder,{getConnectContainer:function(){return this._connectContainer},createConnect:function(a){if(!a.isRoot()){var b=new kity.Path;a._connection=b,this._connectContainer.addShape(b),this.updateConnect(a)}},removeConnect:function(a){var b=this;a.traverse(function(a){b._connectContainer.removeShape(a._connection),a._connection=null})},updateConnect:function(a){var b=a._connection,c=a.parent;if(c&&b){if(c.isCollapsed())return void b.setVisible(!1);b.setVisible(!0);var d=a.getConnectProvider(),e=a.getStyle("connect-color")||"white",f=a.getStyle("connect-width")||2;b.stroke(e,f),d(a,c,b,f,e),f%2===0?b.setTranslate(.5,.5):b.setTranslate(0,0)}}}),KityMinder.registerModule("Connect",{init:function(){this._connectContainer=(new kity.Group).setId(KityMinder.uuid("minder_connect_group")),this.getRenderContainer().prependShape(this._connectContainer)},events:{nodeattach:function(a){this.createConnect(a.node)},nodedetach:function(a){this.removeConnect(a.node)},"layoutapply layoutfinish noderender":function(a){this.updateConnect(a.node)}}}),utils.extend(KityMinder,{_templates:{},registerTemplate:function(a,b){KityMinder._templates[a]=b},getTemplateList:function(){return KityMinder._templates}}),kity.extendClass(Minder,function(){var a=Minder.prototype.getTheme;return{useTemplate:function(a,b){this.setTemplate(a),this.refresh(b||800)},getTemplate:function(){return this._template||"default"},setTemplate:function(a){this._template=a||null},getTemplateSupport:function(a){var b=KityMinder._templates[this.getTemplate()];return b&&b[a]},getTheme:function(b){var c=this.getTemplateSupport("getTheme")||a;return c.call(this,b)}}}()),kity.extendClass(MinderNode,function(){var a=MinderNode.prototype.getLayout,b=MinderNode.prototype.getConnect;return{getLayout:function(){var b=this.getMinder().getTemplateSupport("getLayout")||a;return b.call(this,this)},getConnect:function(){var a=this.getMinder().getTemplateSupport("getConnect")||b;return a.call(this,this)}}}()),KityMinder.registerModule("TemplateModule",{commands:{template:kity.createClass("TemplateCommand",{base:Command,execute:function(a,b){a.useTemplate(b),a.execCommand("camera")},queryValue:function(a){return a.getTemplate()||"default"}})}}),kity.extendClass(Minder,{getLang:function(a){var b=KM.LANG[this.getOptions("lang")];if(!b)throw Error("not import language file");a=(a||"").split(".");for(var c,d=0;(c=a[d++])&&(b=b[c],b););if("string"==typeof b){var e=arguments;return b.replace(/\{(\d+)\}/gi,function(a,b){return void 0!=e[+b+1]&&e[+b+1].toString()||a})}return b}}),KM.defaultOptions={zIndex:1e3,lang:"zh-cn",readyOnly:!1},kity.extendClass(Minder,function(){var a="kityminder_preference",b=function(){var a=window.localStorage;return{saveLocalData:function(b,c){return a&&c?(a.setItem(b,c),!0):!1},getLocalData:function(b){return a?a.getItem(b):null},removeItem:function(b){a&&a.removeItem(b)}}}();return{setPreferences:function(c,d){var e={};Utils.isString(c)?e[c]=d:e=c;var f=b.getLocalData(a);f?(f=JSON.parse(f),utils.extend(f,e)):f=e,b.saveLocalData(a,JSON.stringify(f))},getPreferences:function(c){var d=b.getLocalData(a);return d?(d=JSON.parse(d),c?d[c]:d):{}},resetPreferences:function(a){var c=a?JSON.stringify(a):"";b.saveLocalData(c)}}}());var keymap=KityMinder.keymap=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c],b[c.toLowerCase()]=a[c]);var d=65,e="a".charCodeAt(0);"abcdefghijklmnopqrstuvwxyz".split("").forEach(function(a){b[a]=d+(a.charCodeAt(0)-e)});var f=9;do b[f.toString()]=f+48;while(--f);return b}({Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,CapsLock:20,Esc:27,Spacebar:32,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Left:37,Up:38,Right:39,Down:40,direction:{37:1,38:1,39:1,40:1},Del:46,NumLock:144,Cmd:91,CmdFF:224,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,"`":192,"=":187,"-":189,"/":191,".":190,controlKeys:{16:1,17:1,18:1,20:1,91:1,224:1},notContentChange:{13:1,9:1,33:1,34:1,35:1,36:1,16:1,17:1,18:1,20:1,91:1,37:1,38:1,39:1,40:1,113:1,114:1,115:1,144:1,27:1},isSelectedNodeKey:{37:1,38:1,39:1,40:1,13:1,9:1}});KityMinder.registerLayout("mind",kity.createClass({base:Layout,doLayout:function(a,b){var c=Math.ceil(a.children.length/2),d=[],e=[];b.forEach(function(a){a.getIndex()<c?d.push(a):e.push(a)});var f=KityMinder.getLayoutInstance("left"),g=KityMinder.getLayoutInstance("right");f.doLayout(a,e),g.doLayout(a,d);var h=a.getContentBox();a.setVertexOut(new kity.Point(h.cx,h.cy)),a.setLayoutVectorOut(new kity.Vector(0,0))},getOrderHint:function(a){var b=[],c=a.getLayoutBox(),d=5;return b.push({type:"up",node:a,area:{x:c.x,y:c.top-a.getStyle("margin-top")-d,width:c.width,height:a.getStyle("margin-top")},path:["M",c.x,c.top-d,"L",c.right,c.top-d]}),b.push({type:"down",node:a,area:{x:c.x,y:c.bottom+d,width:c.width,height:a.getStyle("margin-bottom")
  19. },path:["M",c.x,c.bottom+d,"L",c.right,c.bottom+d]}),b}})),[-1,1].forEach(function(a){var b="filetree-"+(a>0?"down":"up");KityMinder.registerLayout(b,kity.createClass({base:Layout,doLayout:function(b,c,d){var e=b.getContentBox(),f=20;if(b.setVertexOut(new kity.Point(e.left+f,a>0?e.bottom:e.top)),b.setLayoutVectorOut(new kity.Vector(0,a)),c.length){c.forEach(function(a){var b=a.getContentBox();a.setLayoutTransform(new kity.Matrix),a.setVertexIn(new kity.Point(b.left,b.cy)),a.setLayoutVectorIn(new kity.Vector(1,0))}),this.align(c,"left"),this.stack(c,"y");var g=0;g+=e.left,g+=f,g+=c[0].getStyle("margin-left");var h=0;a>0?(h+=e.bottom,h+=b.getStyle("margin-bottom"),h+=c[0].getStyle("margin-top")):(h-=this.getTreeBox(c).bottom,h+=e.top,h-=b.getStyle("margin-top"),h-=c[0].getStyle("margin-bottom")),this.move(c,g,h)}},getOrderHint:function(a){var b=[],c=a.getLayoutBox(),d=a.getLevel()>1?3:5;return b.push({type:"up",node:a,area:{x:c.x,y:c.top-a.getStyle("margin-top")-d,width:c.width,height:a.getStyle("margin-top")},path:["M",c.x,c.top-d,"L",c.right,c.top-d]}),b.push({type:"down",node:a,area:{x:c.x,y:c.bottom+d,width:c.width,height:a.getStyle("margin-bottom")},path:["M",c.x,c.bottom+d,"L",c.right,c.bottom+d]}),b}}))});var layouts=["left","right","top","bottom"];layouts.forEach(function(a){function b(a){var b=[],d=a.getLayoutBox(),e=5;return"x"==c?(b.push({type:"up",node:a,area:{x:d.x,y:d.top-a.getStyle("margin-top")-e,width:d.width,height:a.getStyle("margin-top")},path:["M",d.x,d.top-e,"L",d.right,d.top-e]}),b.push({type:"down",node:a,area:{x:d.x,y:d.bottom+e,width:d.width,height:a.getStyle("margin-bottom")},path:["M",d.x,d.bottom+e,"L",d.right,d.bottom+e]})):(b.push({type:"up",node:a,area:{x:d.left-a.getStyle("margin-left")-e,y:d.top,width:a.getStyle("margin-left"),height:d.height},path:["M",d.left-e,d.top,"L",d.left-e,d.bottom]}),b.push({type:"down",node:a,area:{x:d.right+e,y:d.top,width:a.getStyle("margin-right"),height:d.height},path:["M",d.right+e,d.top,"L",d.right+e,d.bottom]})),b}var c="left"==a||"right"==a?"x":"y",d="left"==a||"top"==a?-1:1,e={left:"right",right:"left",top:"bottom",bottom:"top",x:"y",y:"x"};KityMinder.registerLayout(a,kity.createClass({base:Layout,doLayout:function(b,f){var g=b.getContentBox();if("x"==c?(b.setVertexOut(new kity.Point(g[a],g.cy)),b.setLayoutVectorOut(new kity.Vector(d,0))):(b.setVertexOut(new kity.Point(g.cx,g[a])),b.setLayoutVectorOut(new kity.Vector(0,d))),!f.length)return!1;f.forEach(function(b){var f=b.getContentBox();b.setLayoutTransform(new kity.Matrix),"x"==c?(b.setVertexIn(new kity.Point(f[e[a]],f.cy)),b.setLayoutVectorIn(new kity.Vector(d,0))):(b.setVertexIn(new kity.Point(f.cx,f[e[a]])),b.setLayoutVectorIn(new kity.Vector(0,d)))}),this.align(f,e[a]),this.stack(f,e[c]);var h,i,j=this.getBranchBox(f);"x"==c?(h=g[a],h+=d*b.getStyle("margin-"+a),h+=d*f[0].getStyle("margin-"+e[a]),i=g.bottom,i-=g.height/2,i-=j.height/2,i-=j.y):(h=g.right,h-=g.width/2,h-=j.width/2,h-=j.x,i=g[a],i+=d*b.getStyle("margin-"+a),i+=d*f[0].getStyle("margin-"+e[a])),this.move(f,h,i)},getOrderHint:b}))}),KityMinder.registerLayout("fish-bone-master",kity.createClass("FishBoneMasterLayout",{base:Layout,doLayout:function(a,b,c){var d=[],e=[],f=b[0],g=a.getContentBox();if(a.setVertexOut(new kity.Point(g.right,g.cy)),a.setLayoutVectorOut(new kity.Vector(1,0)),f){var h=(f.getContentBox(),a.getStyle("margin-right")),i=f.getStyle("margin-left"),j=f.getStyle("margin-top"),k=f.getStyle("margin-bottom");b.forEach(function(a,b){a.setLayoutTransform(new kity.Matrix);var c=a.getContentBox();b%2?(e.push(a),a.setVertexIn(new kity.Point(c.left,c.top)),a.setLayoutVectorIn(new kity.Vector(1,1))):(d.push(a),a.setVertexIn(new kity.Point(c.left,c.bottom)),a.setLayoutVectorIn(new kity.Vector(1,-1)))}),this.stack(d,"x"),this.stack(e,"x"),this.align(d,"bottom"),this.align(e,"top");var l=g.right+h+i,m=g.cy-k-a.getStyle("margin-top"),n=g.cy+j+a.getStyle("margin-bottom");this.move(d,l,m),this.move(e,l+i,n)}}})),KityMinder.registerLayout("fish-bone-slave",kity.createClass("FishBoneSlaveLayout",{base:Layout,doLayout:function(a,b,c){var d=this,e=Math.abs,f=.382,g=a.getContentBox(),h=a.getLayoutVectorIn();a.setLayoutVectorOut(h);var i=g.left+g.width*f,j=new kity.Point(i,h.y>0?g.bottom:g.top);a.setVertexOut(j);var k=b[0];if(k){var l=k.getContentBox();b.forEach(function(a,b){a.setLayoutTransform(new kity.Matrix),a.setLayoutVectorIn(new kity.Vector(1,0)),a.setVertexIn(new kity.Point(l.left,l.cy))}),this.stack(b,"y"),this.align(b,"left");var m=0,n=0;m+=j.x,a.getLayoutVectorOut().y<0?(n-=this.getTreeBox(b).bottom,n+=a.getContentBox().top,n-=a.getStyle("margin-top"),n-=k.getStyle("margin-bottom")):(n+=a.getContentBox().bottom,n+=a.getStyle("margin-bottom"),n+=k.getStyle("margin-top")),this.move(b,m,n),2==c&&b.forEach(function(a){var b=a.getLayoutTransform(),c=a.getContentBox(),f=b.transformPoint(new kity.Point(c.left,0));d.move([a],e(f.y-j.y),0)})}}})),KityMinder.registerLayout("tianpan",kity.createClass({base:Layout,doLayout:function(a,b){if(0!=b.length){var c,d,e,f=this,g=a.getContentBox(),h=5,i=Math.max(g.width,50);b.forEach(function(a,b){a.setLayoutTransform(new kity.Matrix),e=f.getTreeBox(a),i=Math.max(Math.max(e.width,e.height),i)}),i=i/1.5/Math.PI,b.forEach(function(a,b){c=i*(Math.cos(h)+Math.sin(h)*h),d=i*(Math.sin(h)-Math.cos(h)*h),h+=.9-.02*b,a.setLayoutVectorIn(new kity.Vector(1,0)),a.setVertexIn(new kity.Point(g.cx,g.cy)),a.setLayoutTransform(new kity.Matrix),f.move([a],c,d)})}},getOrderHint:function(a){var b=[],c=a.getLayoutBox(),d=5;return b.push({type:"up",node:a,area:{x:c.x,y:c.top-a.getStyle("margin-top")-d,width:c.width,height:a.getStyle("margin-top")},path:["M",c.x,c.top-d,"L",c.right,c.top-d]}),b.push({type:"down",node:a,area:{x:c.x,y:c.bottom+d,width:c.width,height:a.getStyle("margin-bottom")},path:["M",c.x,c.bottom+d,"L",c.right,c.bottom+d]}),b}})),KityMinder.registerConnectProvider("bezier",function(a,b,c){var d=b.getLayoutVertexOut(),e=a.getLayoutVertexIn(),f=b.getLayoutVectorOut().normalize(),g=Math.round,h=Math.abs,i=[];if(i.push("M",g(d.x),g(d.y)),h(f.x)>h(f.y)){var j=(e.x+d.x)/2;i.push("C",j,d.y,j,e.y,e.x,e.y)}else{var k=(e.y+d.y)/2;i.push("C",d.x,k,e.x,k,e.x,e.y)}c.setMarker(null),c.setPathData(i)}),KityMinder.registerConnectProvider("poly",function(a,b,c,d){var e=b.getLayoutVertexOut(),f=a.getLayoutVertexIn(),g=b.getLayoutVectorOut().normalize(),h=Math.round,i=Math.abs,j=[];switch(j.push("M",h(e.x),h(e.y)),!0){case i(g.x)>i(g.y)&&g.x<0:j.push("h",-b.getStyle("margin-left")),j.push("v",f.y-e.y),j.push("H",f.x);break;case i(g.x)>i(g.y)&&g.x>=0:j.push("h",b.getStyle("margin-right")),j.push("v",f.y-e.y),j.push("H",f.x);break;case i(g.x)<=i(g.y)&&g.y<0:j.push("v",-b.getStyle("margin-top")),j.push("h",f.x-e.x),j.push("V",f.y);break;case i(g.x)<=i(g.y)&&g.y>=0:j.push("v",b.getStyle("margin-bottom")),j.push("h",f.x-e.x),j.push("V",f.y)}c.setMarker(null),c.setPathData(j)});var connectMarker=(new kity.Marker).pipe(function(){var a=7,b=new kity.Circle(a-1);this.addShape(b),this.setRef(a-1,0).setViewBox(-a,-a,a+a,a+a).setWidth(a).setHeight(a),this.dot=b,this.node.setAttribute("markerUnits","userSpaceOnUse")});KityMinder.registerConnectProvider("arc",function(a,b,c,d,e){var f,g,h,i=a.getLayoutBox(),j=b.getLayoutBox(),k=Math.abs,l=[],m=i.x>j.x?"right":"left";a.getMinder().getPaper().addResource(connectMarker),f=new kity.Point(j.cx,j.cy),g="left"==m?new kity.Point(i.right+2,i.cy):new kity.Point(i.left-2,i.cy),h=kity.Vector.fromPoints(f,g),l.push("M",f),l.push("A",k(h.x),k(h.y),0,0,h.x*h.y>0?0:1,g),c.setMarker(connectMarker),connectMarker.dot.fill(e),c.setPathData(l)}),KityMinder.registerConnectProvider("under",function(a,b,c,d,e){var f,g,h,i,j=a.getLayoutBox(),k=b.getLayoutBox(),l=(Math.abs,[]),m=j.x>k.x?"right":"left",n=(a.getStyle("connect-radius"),j.bottom+3),o="sub"==b.getType()?k.bottom+3:k.cy;"right"==m?(f=new kity.Point(k.right,o),g=new kity.Point(j.left-10,n),h=new kity.Point(j.right,n)):(f=new kity.Point(k.left,o),g=new kity.Point(j.right+10,n),h=new kity.Point(j.left,n)),i=(f.x+g.x)/2,l.push("M",f),l.push("C",i,f.y,i,g.y,g),l.push("L",h),c.setMarker(null),c.setPathData(l)}),KityMinder.registerConnectProvider("l",function(a,b,c){var d=b.getLayoutVertexOut(),e=a.getLayoutVertexIn(),f=b.getLayoutVectorOut(),g=[],h=Math.round,i=Math.abs;g.push("M",d.round()),i(f.x)>i(f.y)?g.push("H",h(e.x)):g.push("V",e.y),g.push("L",e),c.setPathData(g)}),KityMinder.registerConnectProvider("fish-bone-master",function(a,b,c){var d=b.getLayoutVertexOut(),e=a.getLayoutVertexIn(),f=Math.abs,g=f(d.y-e.y),h=f(d.x-e.x),i=[];i.push("M",d.x,d.y),i.push("h",h-g),i.push("L",e.x,e.y),c.setMarker(null),c.setPathData(i)});var connectMarker=(new kity.Marker).pipe(function(){var a=7,b=new kity.Circle(a-1);this.addShape(b),this.setRef(a-1,0).setViewBox(-a,-a,a+a,a+a).setWidth(a).setHeight(a),this.dot=b,this.node.setAttribute("markerUnits","userSpaceOnUse")});KityMinder.registerConnectProvider("arc_tp",function(a,b,c,d,e){var f=a.getLayoutBox(),g=b.getLayoutBox();if(a.getIndex()>0){var h=a.getIndex();g=b.getChildren()[h-1].getLayoutBox()}var i,j,k,l=(Math.abs,[]);f.x>g.x?"right":"left";a.getMinder().getPaper().addResource(connectMarker),i=new kity.Point(g.cx,g.cy),j=new kity.Point(f.cx,f.cy);var m=Math.sqrt(Math.abs(i.x-j.x)*Math.abs(i.x-j.x)+Math.abs(i.y-j.y)*Math.abs(i.y-j.y));m=0==a.getIndex()?.4*m:m,k=kity.Vector.fromPoints(i,j),l.push("M",i),l.push("A",m,m,0,0,1,j),c.setMarker(connectMarker),connectMarker.dot.fill(e),c.setPathData(l)}),["classic","classic-compact"].forEach(function(a){var b="classic-compact"==a;KityMinder.registerTheme(a,{background:"#3A4144 url(ui/theme/default/images/grid.png) repeat","root-color":"#430","root-background":"#e9df98","root-stroke":"#e9df98","root-font-size":24,"root-padding":b?[10,25]:[15,25],"root-margin":b?[15,25]:[30,100],"root-radius":30,"root-space":10,"root-shadow":"rgba(0, 0, 0, .25)","main-color":"#333","main-background":"#a4c5c0","main-stroke":"#a4c5c0","main-font-size":16,"main-padding":b?[5,15]:[6,20],"main-margin":b?[5,10]:20,"main-radius":10,"main-space":5,"main-shadow":"rgba(0, 0, 0, .25)","sub-color":"white","sub-background":"transparent","sub-stroke":"none","sub-font-size":12,"sub-padding":[5,10],"sub-margin":b?[5,10]:[15,20],"sub-tree-margin":30,"sub-radius":5,"sub-space":5,"connect-color":"white","connect-width":2,"main-connect-width":3,"connect-radius":5,"selected-background":"rgb(254, 219, 0)","selected-stroke":"rgb(254, 219, 0)","selected-color":"black","marquee-background":"rgba(255,255,255,.3)","marquee-stroke":"white","drop-hint-color":"yellow","sub-drop-hint-width":2,"main-drop-hint-width":4,"root-drop-hint-width":4,"order-hint-area-color":"rgba(0, 255, 0, .5)","order-hint-path-color":"#0f0","order-hint-path-width":1,"text-selection-color":"rgb(27,171,255)","line-height":1.5})}),["snow","snow-compact"].forEach(function(a){var b="snow-compact"==a;KityMinder.registerTheme(a,{background:"#3A4144 url(ui/theme/default/images/grid.png) repeat","root-color":"#430","root-background":"#e9df98","root-stroke":"#e9df98","root-font-size":24,"root-padding":b?[5,10]:[15,25],"root-margin":b?15:30,"root-radius":5,"root-space":10,"root-shadow":"rgba(0, 0, 0, .25)","main-color":"#333","main-background":"#a4c5c0","main-stroke":"#a4c5c0","main-font-size":16,"main-padding":b?[4,10]:[6,20],"main-margin":b?[5,10]:[20,40],"main-radius":5,"main-space":5,"main-shadow":"rgba(0, 0, 0, .25)","sub-color":"black","sub-background":"white","sub-stroke":"white","sub-font-size":12,"sub-padding":[5,10],"sub-margin":b?[5,10]:[10,20],"sub-radius":5,"sub-space":5,"connect-color":"white","connect-width":2,"main-connect-width":3,"connect-radius":5,"selected-background":"rgb(254, 219, 0)","selected-stroke":"rgb(254, 219, 0)","marquee-background":"rgba(255,255,255,.3)","marquee-stroke":"white","drop-hint-color":"yellow","drop-hint-width":4,"order-hint-area-color":"rgba(0, 255, 0, .5)","order-hint-path-color":"#0f0","order-hint-path-width":1,"text-selection-color":"rgb(27,171,255)","line-height":1.5})}),function(){function a(a,b,c){return kity.Color.createHSL(a,b,c)}function b(b,c){return{background:"#fbfbfb","root-color":"white","root-background":a(b,37,60),"root-stroke":a(b,37,60),"root-font-size":16,"root-padding":c?[6,12]:[12,24],"root-margin":c?10:[30,100],"root-radius":5,"root-space":10,"main-color":"black","main-background":a(b,33,95),"main-stroke":a(b,37,60),"main-stroke-width":1,"main-font-size":14,"main-padding":[6,20],"main-margin":c?8:20,"main-radius":3,"main-space":5,"sub-color":"black","sub-background":"transparent","sub-stroke":"none","sub-font-size":12,"sub-padding":c?[3,5]:[5,10],"sub-margin":c?[4,8]:[15,20],"sub-radius":5,"sub-space":5,"connect-color":a(b,37,60),"connect-width":1,"connect-radius":5,"selected-stroke":a(b,26,30),"selected-stroke-width":"3","marquee-background":a(b,100,80).set("a",.1),"marquee-stroke":a(b,37,60),"drop-hint-color":a(b,26,35),"drop-hint-width":5,"order-hint-area-color":a(b,100,30).set("a",.5),"order-hint-path-color":a(b,100,25),"order-hint-path-width":1,"text-selection-color":a(b,100,20),"line-height":1.5}}var c,d={red:0,soil:25,green:122,blue:204,purple:246,pink:334};for(c in d)KityMinder.registerTheme("fresh-"+c,b(d[c])),KityMinder.registerTheme("fresh-"+c+"-compat",b(d[c],!0))}(),KityMinder.registerTheme("fish",{background:"#3A4144 url(ui/theme/default/images/grid.png) repeat","root-color":"#430","root-background":"#e9df98","root-stroke":"#e9df98","root-font-size":24,"root-padding":[35,35],"root-margin":30,"root-radius":100,"root-space":10,"root-shadow":"rgba(0, 0, 0, .25)","main-color":"#333","main-background":"#a4c5c0","main-stroke":"#a4c5c0","main-font-size":16,"main-padding":[6,20],"main-margin":[20,20],"main-radius":5,"main-space":5,"main-shadow":"rgba(0, 0, 0, .25)","sub-color":"black","sub-background":"white","sub-stroke":"white","sub-font-size":12,"sub-padding":[5,10],"sub-margin":[10],"sub-radius":5,"sub-space":5,"connect-color":"white","connect-width":3,"main-connect-width":3,"connect-radius":5,"selected-background":"rgb(254, 219, 0)","selected-stroke":"rgb(254, 219, 0)","marquee-background":"rgba(255,255,255,.3)","marquee-stroke":"white","drop-hint-color":"yellow","drop-hint-width":4,"order-hint-area-color":"rgba(0, 255, 0, .5)","order-hint-path-color":"#0f0","order-hint-path-width":1,"text-selection-color":"rgb(27,171,255)","line-height":1.5}),KityMinder.registerTheme("wire",{background:"black",color:"#999",stroke:"none",padding:10,margin:20,"font-size":14,"connect-color":"#999","connect-width":1,"selected-background":"#999","selected-color":"black","marquee-background":"rgba(255,255,255,.3)","marquee-stroke":"white","drop-hint-color":"yellow","sub-drop-hint-width":2,"main-drop-hint-width":4,"root-drop-hint-width":4,"order-hint-area-color":"rgba(0, 255, 0, .5)","order-hint-path-color":"#0f0","order-hint-path-width":1,"text-selection-color":"rgb(27,171,255)","line-height":1.5}),["tianpan","tianpan-compact"].forEach(function(a){var b="tianpan-compact"==a;KityMinder.registerTheme(a,{background:"#3A4144 url(ui/theme/default/images/grid.png) repeat","root-color":"#430","root-background":"#e9df98","root-stroke":"#e9df98","root-font-size":25,"root-padding":b?15:20,"root-margin":b?[15,25]:100,"root-radius":30,"root-space":10,"root-shadow":"rgba(0, 0, 0, .25)","root-shape":"circle","main-color":"#333","main-background":"#a4c5c0","main-stroke":"#a4c5c0","main-font-size":15,"main-padding":b?10:12,"main-margin":b?10:12,"main-radius":10,"main-space":5,"main-shadow":"rgba(0, 0, 0, .25)","main-shape":"circle","sub-color":"#333","sub-background":"#99ca6a","sub-stroke":"#a4c5c0","sub-font-size":13,"sub-padding":5,"sub-margin":b?6:10,"sub-tree-margin":30,"sub-radius":5,"sub-space":5,"sub-shadow":"rgba(0, 0, 0, .25)","sub-shape":"circle","connect-color":"white","connect-width":2,"main-connect-width":3,"connect-radius":5,"selected-background":"rgb(254, 219, 0)","selected-stroke":"rgb(254, 219, 0)","selected-color":"black","marquee-background":"rgba(255,255,255,.3)","marquee-stroke":"white","drop-hint-color":"yellow","sub-drop-hint-width":2,"main-drop-hint-width":4,"root-drop-hint-width":4,"order-hint-area-color":"rgba(0, 255, 0, .5)","order-hint-path-color":"#0f0","order-hint-path-width":1,"text-selection-color":"rgb(27,171,255)","line-height":1.4})}),KityMinder.registerTemplate("default",{getLayout:function(a){if(a.getData("layout"))return a.getData("layout");var b=a.getLevel();return 0===b?"mind":1===b?a.getLayoutPointPreview().x>0?"right":"left":a.parent.getLayout()},getConnect:function(a){return 1==a.getLevel()?"arc":"under"}}),KityMinder.registerTemplate("structure",{getLayout:function(a){return a.getData("layout")||"bottom"},getConnect:function(a){return"poly"}}),KityMinder.registerTemplate("filetree",{getLayout:function(a){return a.getData("layout")?a.getData("layout"):a.isRoot()?"bottom":"filetree-down"},getConnect:function(a){return 1==a.getLevel()?"poly":"l"}}),KityMinder.registerTemplate("right",{getLayout:function(a){return a.getData("layout")||"right"},getConnect:function(a){return 1==a.getLevel()?"arc":"bezier"}}),KityMinder.registerTemplate("fish-bone",{getLayout:function(a){if(a.getData("layout"))return a.getData("layout");var b=a.getLevel();return 0===b?"fish-bone-master":1===b?"fish-bone-slave":a.getLayoutPointPreview().y>0?"filetree-up":"filetree-down"},getConnect:function(a){switch(a.getLevel()){case 1:return"fish-bone-master";case 2:return"line";default:return"l"}}}),KityMinder.registerTemplate("tianpan",{getLayout:function(a){if(a.getData("layout"))return a.getData("layout");var b=a.getLevel();return 0===b?"tianpan":a.parent.getLayout()},getConnect:function(a){return"arc_tp"}});var AppendChildCommand=kity.createClass("AppendChildCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNode();if(!c)return null;b=b||a.getLang("topic"),c.expand();var d=a.createNode(b,c);a.select(d,!0),d.render(),a.layout(600)},queryState:function(a){var b=a.getSelectedNode();return b?0:-1}}),AppendSiblingCommand=kity.createClass("AppendSiblingCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNode(),d=c.parent;if(!d)return a.execCommand("AppendChildNode",b);b=b||a.getLang("topic");var e=a.createNode(b,d,c.getIndex()+1);a.select(e,!0),e.render(),a.layout(600)},queryState:function(a){var b=a.getSelectedNode();return b?0:-1}}),RemoveNodeCommand=kity.createClass("RemoverNodeCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNodes(),d=MinderNode.getCommonAncestor.apply(null,c);c.forEach(function(b){b.isRoot()||a.removeNode(b)}),a.select(d||a.getRoot(),!0),a.layout(600)},queryState:function(a){var b=a.getSelectedNode();return b?0:-1}}),EditNodeCommand=kity.createClass("EditNodeCommand",{base:Command,execute:function(a){var b=a.getSelectedNode();return b?(a.select(b,!0),void a.textEditNode(b)):null},queryState:function(a){var b=a.getSelectedNode();return b?0:-1},isNeedUndo:function(){return!1}}),$importDialog,$exportDialog,ImportTextNode=kity.createClass("ImportTextNode",{base:Command,execute:function(a,b){function c(a){var b;if(a)try{g=d.decode(a,!0)}catch(c){b="文本格式解析错误. "+c.message}else b="内容不能为空";b?(h.addClass("validate-error"),j.text(b),i.disable()):(h.removeClass("validate-error"),j.text(""),i.enable())}if(!$importDialog){var d=a.getProtocol("plain"),e=400;$importDialog=new FUI.Dialog({width:600,height:e,prompt:!0,caption:a.getLang("ui.importtextnode")}).appendTo(document.getElementById("content-wrapper"));var f=$($importDialog.getBodyElement());f.html(['<textarea style="width: 100%; height: '+(e-130)+'px"></textarea>'].join(""));var g,h=f.find("textarea"),i=$importDialog.getButton(0),j=$('<span class="validate-error"></span>');h.after(j),h.on("input",function(){c(h.val())}),h.on("keydown keyup",function(a){if(9===a.keyCode&&"keydown"===a.type){a.preventDefault();var b=this.selectionStart;this.value=this.value.substring(0,this.selectionStart)+" "+this.value.substring(this.selectionEnd),this.selectionEnd=b+1}(13!==a.keyCode||a.shiftKey)&&a.stopPropagation()}),$importDialog.on("open",function(){c(h.val()),setTimeout(function(){h[0].focus()},10)}),$importDialog.on("ok",function(){function b(c,d,e){if(c&&d){var f=a.createNode(d.data.text,c);return d.children&&d.children.forEach(function(a){b(f,a)}),f.render(),f}}var c=[],d=a.getSelectedNode();g&&g.children&&d&&(d.expand(),g.children.forEach(function(a){c.push(b(d,a))})),a.select(c,!0),a.layout(300),h.val(""),c=null,g=null})}$importDialog.open()},queryState:function(a){var b=a.getSelectedNode();return b?0:-1}}),ExportTextNode=kity.createClass("ExportTextNode",{base:Command,execute:function(a,b){if(!$exportDialog){var c=a.getProtocol("plain"),d=400;$exportDialog=new FUI.Dialog({width:600,height:d,prompt:!0,caption:a.getLang("ui.exporttextnode")}).appendTo(document.getElementById("content-wrapper"));var e=$($exportDialog.getBodyElement());e.html(['<textarea style="width: 100%; height: '+(d-130)+'px"></textarea>'].join(""));var f=e.find("textarea");f.on("keydown keyup",function(a){if(9===a.keyCode&&"keydown"===a.type){a.preventDefault();var b=this.selectionStart;this.value=this.value.substring(0,this.selectionStart)+" "+this.value.substring(this.selectionEnd),this.selectionEnd=b+1}(13!==a.keyCode||a.shiftKey)&&a.stopPropagation()}),$exportDialog.on("open",function(){f.val(c.encode(a.getSelectedNode())),setTimeout(function(){f[0].focus()},10)})}$exportDialog.open()},queryState:function(a){var b=a.getSelectedNode();return b?0:-1}});KityMinder.registerModule("NodeModule",function(){return{commands:{AppendChildNode:AppendChildCommand,AppendSiblingNode:AppendSiblingCommand,ImportTextNode:ImportTextNode,ExportTextNode:ExportTextNode,RemoveNode:RemoveNodeCommand,EditNode:EditNodeCommand},contextmenu:[{command:"appendsiblingnode"},{command:"appendchildnode"},{command:"editnode"},{command:"removenode"},{command:"importtextnode"},{command:"exporttextnode"},{divider:1}],commandShortcutKeys:{appendsiblingnode:"normal::Enter",appendchildnode:"normal::Insert|Tab",editnode:"normal::F2",removenode:"normal::Del|Backspace"}}});var FONT_ADJUST={"微软雅黑,Microsoft YaHei":-.15,"arial black,avant garde":-.17,"default":-.15},TextRenderer=KityMinder.TextRenderer=kity.createClass("TextRenderer",{base:Renderer,create:function(){return(new kity.Group).setId(KityMinder.uuid("node_text"))},update:function(a,b){function c(a){return b.getData(a)||b.getStyle(a)}var d=b.getText(!0),e=b.getStyle("line-height"),f=c("font-size"),g=c("font-family")||"default",h=e*f*d.length-(e-1)*f,i=-h/2,j=FONT_ADJUST[g]||0;a.setTranslate(0,j*f);var k=new kity.Box,l=Math.round;this.setTextStyle(b,a);var m=d.length,n=a.getItems().length;if(n>m)for(var o,p=m;o=a.getItem(p);)a.removeItem(p);else if(m>n)for(var q=m-n,p=0;q>p;p++){var r=(new kity.Text).setAttr("text-rendering","inherit");kity.Browser.ie?r.setVerticalAlign("top"):r.setAttr("dominant-baseline","text-before-edge"),a.addItem(r)}for(var s,r,p=0;s=d[p],r=a.getItem(p);p++)r.setContent(s);this.setTextStyle(b,a);var t=b.getText()+[c("font-size"),c("font-name"),c("font-weight"),c("font-style")].join("/");return b._currentTextHash==t&&b._currentTextGroupBox?b._currentTextGroupBox:(b._currentTextHash=t,function(){a.eachItem(function(a,b){var c=i+a*f*e;b.setY(c),k=k.merge(new kity.Box(0,c,b.getBoundaryBox().width||1,f))});var c=0,d=b.getStyle("shape");d&&"circle"==d&&(c=Math.max(k.width,k.height)/2-k.height/2);var g=new kity.Box(l(k.x),l(k.y-c),l(k.width),l(k.height));return b._currentTextGroupBox=g,g})},setTextStyle:function(a,b){var c=TextRenderer._styleHooks;c.forEach(function(c){c(a,b)})}});utils.extend(TextRenderer,{_styleHooks:[],registerStyleHook:function(a){TextRenderer._styleHooks.push(a)}}),kity.extendClass(MinderNode,{getTextGroup:function(){return this.getRenderer("TextRenderer").getRenderShape()}}),KityMinder.registerModule("text",{renderers:{center:TextRenderer}}),KityMinder.registerModule("Expand",function(){var a=this,b="expandState",c="expand",d="collapse";kity.extendClass(MinderNode,{expand:function(){return this.setData(b,c),this},collapse:function(){return this.setData(b,d),this},isExpanded:function(){var a=this.getData(b)!==d;return a&&(this.isRoot()||this.parent.isExpanded())},isCollapsed:function(){return!this.isExpanded()}});var e=kity.createClass("ExpandCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNode();if(c){for(b&&(c=c.parent);c.parent;)c.expand(),c=c.parent;c.renderTree(),a.layout(100)}},queryState:function(a){return a.getSelectedNode()?0:-1}}),f=kity.createClass("ExpandToLevelCommand",{base:Command,execute:function(a,b){a.getRoot().traverse(function(a){a.getLevel()<b&&a.expand(),a.getLevel()==b&&a.collapse()}),a.refresh(100)},enableReadOnly:!0}),g=kity.createClass("Expander",{base:kity.Group,constructor:function(a){this.callBase(),this.radius=6,this.outline=new kity.Circle(this.radius).stroke("gray").fill("white"),this.sign=(new kity.Path).stroke("gray"),this.addShapes([this.outline,this.sign]),this.initEvent(a),this.setId(KityMinder.uuid("node_expander")),this.setStyle("cursor","pointer")},initEvent:function(a){this.on("mousedown",function(b){a.isExpanded()?a.collapse():a.expand(),a.renderTree().getMinder().layout(100),a.getMinder().fire("contentchange"),b.stopPropagation(),b.preventDefault()}),this.on("dblclick click mouseup",function(a){a.stopPropagation(),a.preventDefault()})},setState:function(a){if("hide"==a)return void this.setVisible(!1);this.setVisible(!0);var b=["M",1.5-this.radius,0,"L",this.radius-1.5,0];a==d&&b.push(["M",0,1.5-this.radius,"L",0,this.radius-1.5]),this.sign.setPathData(b)}}),h=kity.createClass("ExpanderRenderer",{base:Renderer,create:function(a){return a.isRoot()?void 0:(this.expander=new g(a),a.getRenderContainer().prependShape(this.expander),a.expanderRenderer=this,this.node=a,this.expander)},shouldRender:function(a){return!a.isRoot()},update:function(a,c,d){if(c.parent){var e=c.parent.isExpanded();a.setState(e&&c.children.length?c.getData(b):"hide");var f=c.getLayoutVectorIn().normalize(a.radius+c.getStyle("stroke-width")),g=c.getVertexIn().offset(f.reverse());this.expander.setTranslate(g)}}});return{commands:{expand:e,expandtolevel:f},events:{layoutapply:function(a){var b=a.node.getRenderer("ExpanderRenderer");b.getRenderShape()&&b.update(b.getRenderShape(),a.node)},beforerender:function(a){var b=a.node,c=!b.parent||b.parent.isExpanded();b.getRenderContainer().setVisible(c),c||a.stopPropagation()},"normal.keydown":function(a){if("textedit"!=this.getStatus()){if(a.originEvent.keyCode==keymap["/"]){var b=this.getSelectedNode();if(!b||b==this.getRoot())return;var c=b.isExpanded();this.getSelectedNodes().forEach(function(a){c?a.collapse():a.expand(),a.renderTree()}),this.layout(100),this.fire("contentchange"),a.preventDefault(),a.stopPropagationImmediately()}a.isShortcutKey("Alt+`")&&this.execCommand("expandtolevel",9999);for(var d=1;6>d;d++)a.isShortcutKey("Alt+"+d)&&this.execCommand("expandtolevel",d)}}},renderers:{outside:h},contextmenu:[{command:"expandtoleaf",query:function(){return!a.getSelectedNode()},fn:function(a){a.execCommand("expandtolevel",9999)}},{command:"expandtolevel1",query:function(){return!a.getSelectedNode()},fn:function(a){a.execCommand("expandtolevel",1)}},{command:"expandtolevel2",query:function(){return!a.getSelectedNode()},fn:function(a){a.execCommand("expandtolevel",2)}},{command:"expandtolevel3",query:function(){return!a.getSelectedNode()},fn:function(a){a.execCommand("expandtolevel",3)}},{divider:!0}]}});var OutlineRenderer=kity.createClass("OutlineRenderer",{base:Renderer,create:function(a){var b=(new kity.Rect).setId(KityMinder.uuid("node_outline"));return this.bringToBack=!0,b},update:function(a,b,c){var d=b.getStyle("shape");if(d&&"circle"==d)return updateCircle(a,b,c);var e=b.getStyle("padding-left"),f=b.getStyle("padding-right"),g=b.getStyle("padding-top"),h=b.getStyle("padding-bottom"),i={x:c.x-e,y:c.y-g,width:c.width+e+f,height:c.height+g+h},j=b.isSelected()?"selected-":"";return a.setPosition(i.x,i.y).setSize(i.width,i.height).setRadius(b.getStyle("radius")).fill(b.getData("background")||b.getStyle(j+"background")||b.getStyle("background")).stroke(b.getStyle(j+"stroke"||b.getStyle("stroke")),b.getStyle(j+"stroke-width")),new kity.Box(i)}}),ShadowRenderer=kity.createClass("ShadowRenderer",{base:Renderer,create:function(a){return this.bringToBack=!0,new kity.Rect},shouldRender:function(a){return a.getStyle("shadow")},update:function(a,b,c){a.setPosition(c.x+4,c.y+5).fill(b.getStyle("shadow"));var d=b.getStyle("shape");if(d){if("circle"==d){var e=Math.max(c.width,c.height);a.setSize(e,e),a.setRadius(e/2)}}else a.setSize(c.width,c.height),a.setRadius(b.getStyle("radius"))}}),marker=new kity.Marker;marker.setWidth(10),marker.setHeight(12),marker.setRef(0,0),marker.setViewBox(-6,-4,8,10),marker.addShape((new kity.Path).setPathData("M-5-3l5,3,-5,3").stroke("#33ffff"));var wireframeOption=/wire/.test(window.location.href),WireframeRenderer=kity.createClass("WireframeRenderer",{base:Renderer,create:function(){var a=new kity.Group,b=this.oxy=(new kity.Path).stroke("#f6f").setPathData("M0,-50L0,50M-50,0L50,0"),c=this.wireframe=(new kity.Rect).stroke("lightgreen"),d=this.vectorIn=(new kity.Path).stroke("#66ffff"),e=this.vectorOut=(new kity.Path).stroke("#66ffff");return d.setMarker(marker,"end"),e.setMarker(marker,"end"),a.addShapes([b,c,d,e])},shouldRender:function(){return wireframeOption},update:function(a,b,c){this.wireframe.setPosition(c.x,c.y).setSize(c.width,c.height);var d=b.getVertexIn(),e=b.getVertexOut(),f=b.getLayoutVectorIn().normalize(30),g=b.getLayoutVectorOut().normalize(30);this.vectorIn.setPathData(["M",d.offset(f.reverse()),"L",d]),this.vectorOut.setPathData(["M",e,"l",g])}});KityMinder.registerModule("OutlineModule",function(){return{events:wireframeOption?{ready:function(){this.getPaper().addResource(marker)},layoutallfinish:function(){this.getRoot().traverse(function(a){a.getRenderer("WireframeRenderer").update(null,a,a.getContentBox())})}}:null,renderers:{outline:OutlineRenderer,outside:[ShadowRenderer,WireframeRenderer]}}}),KityMinder.Geometry=function(){function a(a){return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a.cx=a.x+a.width/2,a.cy=a.y+a.height/2,a}function b(a){"x"in a&&(a.left=a.x,a.right=a.x+a.width,a.top=a.y,a.bottom=a.y+a.height)}var c={},d=Math.min,e=Math.max,f=(Math.abs,Object.prototype.hasOwnProperty);return c.isNumberInRange=function(a,b){return a>b[0]&&a<b[1]},c.getDistance=function(a,b){return kity.Vector.fromPoints(a,b).length()},c.wrapBox=a,c.getBox=function(b,c){return a({left:d(b.x,c.x),right:e(b.x,c.x),top:d(b.y,c.y),bottom:e(b.y,c.y)})},c.mergeBox=function(c,f){return b(c),b(f),a({left:d(c.left,f.left),right:e(c.right,f.right),top:d(c.top,f.top),bottom:e(c.bottom,f.bottom)})},c.getBoxRange=function(a){return{x:[a.left,a.right],y:[a.top,a.bottom]}},c.getBoxVertex=function(a){return{leftTop:{x:a.left,y:a.top},rightTop:{x:a.right,y:a.top},leftBottom:{x:a.left,y:a.bottom},rightBottom:{x:a.right,y:a.bottom}}},c.isPointInsideBox=function(a,d){b(d);var e=c.getBoxRange(d);return c.isNumberInRange(a.x,e.x)&&c.isNumberInRange(a.y,e.y)},c.getIntersectBox=function(c,f){b(c),b(f);var g=e(c.left,f.left),h=e(c.top,f.top),i=d(c.right,f.right),j=d(c.bottom,f.bottom);return i>g&&j>h?a({left:g,right:i,top:h,bottom:j}):null},c.snapToSharp=function(a){return utils.isNumber(a)?(0|a)+.5:utils.isArray(a)?a.map(c.snapToSharp):(["x","y","left","top","right","bottom"].forEach(function(b){f.call(a,b)&&(a[b]=c.snapToSharp(a[b]))}),a)},c.expandBox=function(b,c,d){return void 0===d&&(d=c),a({left:b.left-c,top:b.top-d,right:b.right+c,bottom:b.bottom+d})},c}(),KityMinder.registerModule("HistoryModule",function(){var a=this,b=kity.createClass("Scene",{constructor:function(a,b){this.data=a.clone(),this.inputStatus=b},getData:function(){return this.data},cloneData:function(){return this.getData().clone()},equals:function(a){return this.getData().equals(a.getData())},isInputStatus:function(){return this.inputStatus},setInputStatus:function(a){this.inputStatus=a;
  20. }}),c=kity.createClass("HistoryManager",{constructor:function(a){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.km=a},undo:function(){if(this.hasUndo){var a=this.list[this.index];if(a&&a.isInputStatus())return this.saveScene(),this.restore(--this.index),void a.setInputStatus(!1);if(1==this.list.length)return void this.restore(0);if(!this.list[this.index-1]&&1==this.list.length)return void this.reset();for(;this.list[this.index].equals(this.list[this.index-1]);)if(this.index--,0===this.index)return this.restore(0);this.restore(--this.index)}},redo:function(){if(this.hasRedo){for(;this.list[this.index].equals(this.list[this.index+1]);)if(this.index++,this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}},partialRenewal:function(b){function c(a,b){return a.getText()!=b.getText()?!1:utils.compareObject(a.getData(),b.getData())===!1?!1:utils.compareObject(a.getTmpData(),b.getTmpData())===!1?!1:!0}function d(b,c){c.isSelected()&&f.push(c),a.appendNode(c,b),c.render();for(var e,g=utils.cloneArr(c.children),h=0;e=g[h++];)d(c,e)}function e(b,g){c(b,g)===!1&&b.setValue(g),b.render(),b.isSelected()&&f.push(b);for(var h,i,j=0,k=0;h=b.children[j],i=g.children[k],h||i;j++,k++)h&&!i?(j--,a.removeNode(h)):!h&&i?(k--,d(b,i)):e(h,i)}var f=[];e(a.getRoot(),b),a.layout(200),a.select(f,!0),f=[]},restore:function(a){a=void 0===a?this.index:a;var b=this.list[a];this.partialRenewal(b.cloneData()),this.update(),this.km.fire("restoreScene"),this.km.fire("contentChange")},getScene:function(a){return new b(this.km.getRoot(),a)},saveScene:function(a){var b=this.getScene(a),c=this.list[this.index];return c&&c.equals(b)?void(a&&(c.setInputStatus(!0),this.update())):(this.list=this.list.slice(0,this.index+1),this.list.push(b),this.list.length>this.km.getOptions("maxUndoCount")&&this.list.shift(),this.index=this.list.length-1,void this.update())},update:function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1];var a=this.list[this.index];a&&a.isInputStatus()&&(this.hasUndo=!0)},reset:function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1}});return this.historyManager=new c(this),{defaultOptions:{maxUndoCount:20,maxInputCount:20},commands:{undo:kity.createClass("UndoCommand",{base:Command,execute:function(a){a.historyManager.undo()},queryState:function(a){return a.historyManager.hasUndo?0:-1},isNeedUndo:function(){return!1}}),redo:kity.createClass("RedoCommand",{base:Command,execute:function(a){a.historyManager.redo()},queryState:function(a){return a.historyManager.hasRedo?0:-1},isNeedUndo:function(){return!1}})},commandShortcutKeys:{undo:"ctrl+z",redo:"ctrl+y"},events:{saveScene:function(a){this.historyManager.saveScene(a.inputStatus)},"import":function(){this.historyManager.reset()}}}}),KityMinder.registerModule("ProgressModule",function(){var a=this,b="progress",c="#FFED83",d="#43BC00",e="M10,3c4.418,0,8,3.582,8,8h1c0-5.523-3.477-10-9-10S1,5.477,1,11h1C2,6.582,5.582,3,10,3z",f="#8E8E8E",g="M10,0C4.477,0,0,4.477,0,10c0,5.523,4.477,10,10,10s10-4.477,10-10C20,4.477,15.523,0,10,0zM10,18c-4.418,0-8-3.582-8-8s3.582-8,8-8s8,3.582,8,8S14.418,18,10,18z",h=(new kity.LinearGradient).pipe(function(a){a.setStartPosition(0,0),a.setEndPosition(0,1),a.addStop(0,"#fff"),a.addStop(1,"#ccc")}),i="M15.812,7.896l-6.75,6.75l-4.5-4.5L6.25,8.459l2.812,2.803l5.062-5.053L15.812,7.896z",j="#EEE";a.getPaper().addResource(h);var k=kity.createClass("ProgressIcon",{base:kity.Group,constructor:function(a){this.callBase(),this.setSize(20),this.create(),this.setValue(a),this.setId(KityMinder.uuid("node_progress")),this.translate(.5,.5)},setSize:function(a){this.width=this.height=a},create:function(){var a,b,k,l,m;a=new kity.Circle(9).fill(c),b=new kity.Pie(9,0).fill(d),k=(new kity.Path).setPathData(e).setTranslate(-10,-10).fill(f),l=(new kity.Path).setTranslate(-10,-10).setPathData(g).fill(h),m=(new kity.Path).setTranslate(-10,-10).setPathData(i).fill(j),this.addShapes([a,b,k,m,l]),this.pie=b,this.check=m},setValue:function(a){this.pie.setAngle(-360*(a-1)/8),this.check.setVisible(9==a)}}),l=kity.createClass("ProgressCommand",{base:Command,execute:function(a,c){for(var d=a.getSelectedNodes(),e=0;e<d.length;e++)d[e].setData(b,c||null).render();a.layout()},queryValue:function(a){for(var c,d=a.getSelectedNodes(),e=0;e<d.length&&!(c=d[e].getData(b));e++);return c||null},queryState:function(a){return a.getSelectedNodes().length?0:-1}});return{commands:{progress:l},renderers:{left:kity.createClass("ProgressRenderer",{base:KityMinder.Renderer,create:function(a){return new k},shouldRender:function(a){return a.getData(b)},update:function(a,c,d){var e,f,g=c.getData(b),h=c.getStyle("space-left");return a.setValue(g),e=d.left-a.width-h,f=-a.height/2,a.setTranslate(e+a.width/2,f+a.height/2),new kity.Box(e,f,a.width,a.height)}})}}}),KityMinder.registerModule("PriorityModule",function(){var a=[null,["#FF1200","#840023"],["#0074FF","#01467F"],["#00AF00","#006300"],["#FF962E","#B25000"],["#A464FF","#4720C4"],["#A3A3A3","#515151"],["#A3A3A3","#515151"],["#A3A3A3","#515151"],["#A3A3A3","#515151"]],b="M0,13c0,3.866,3.134,7,7,7h6c3.866,0,7-3.134,7-7V7H0V13z",c="M20,10c0,3.866-3.134,7-7,7H7c-3.866,0-7-3.134-7-7V7c0-3.866,3.134-7,7-7h6c3.866,0,7,3.134,7,7V10z",d="priority",e=kity.createClass("PriorityIcon",{base:kity.Group,constructor:function(){this.callBase(),this.setSize(20),this.create(),this.setId(KityMinder.uuid("node_priority"))},setSize:function(a){this.width=this.height=a},create:function(){var a,d,e,f;a=(new kity.Path).setPathData(c).fill("white"),d=(new kity.Path).setPathData(b).setTranslate(.5,.5),e=(new kity.Path).setPathData(c).setOpacity(.8).setTranslate(.5,.5),f=(new kity.Text).setX(this.width/2-.5).setY(this.height/2-1.5).setTextAnchor("middle").setVerticalAlign("middle").setFontItalic(!0).setFontSize(14).fill("white"),this.addShapes([d,e,f]),this.mask=e,this.back=d,this.number=f},setValue:function(b){var c=this.back,d=this.mask,e=this.number,f=a[b];f&&(c.fill(f[1]),d.fill(f[0])),e.setContent(b)}}),f=kity.createClass("SetPriorityCommand",{base:Command,execute:function(a,b){for(var c=a.getSelectedNodes(),e=0;e<c.length;e++)c[e].setData(d,b||null).render();a.layout()},queryValue:function(a){for(var b,c=a.getSelectedNodes(),e=0;e<c.length&&!(b=c[e].getData(d));e++);return b||null},queryState:function(a){return a.getSelectedNodes().length?0:-1}});return{commands:{priority:f},renderers:{left:kity.createClass("PriorityRenderer",{base:KityMinder.Renderer,create:function(a){return new e},shouldRender:function(a){return a.getData(d)},update:function(a,b,c){var e,f,g=b.getData(d),h=b.getStyle("space-left");return a.setValue(g),e=c.left-a.width-h,f=-a.height/2,a.setTranslate(e,f),new kity.Box({x:e,y:f,width:a.width,height:a.height})}})}}}),KityMinder.registerModule("image",function(){function a(a,b){var c=document.createElement("img");c.onload=function(){b(c.width,c.height)},c.onerror=function(){b(null)},c.src=a}function b(a,b,c,d){var e=a/b,f=c/d;return a>c&&e>f?(a=c,b=a/e):b>d&&(b=d,a=b*e),{width:0|a,height:0|b}}var c=kity.createClass("ImageCommand",{base:Command,execute:function(c,d,e){var f=c.getSelectedNodes();a(d,function(a,g){a&&(utils.each(f,function(f,h){var i=b(a,g,c.getOptions("maxImageWidth"),c.getOptions("maxImageHeight"));h.setData("image",d),h.setData("imageTitle",e),h.setData("imageSize",i),h.render()}),c.fire("saveScene"),c.layout(300))})},queryState:function(a){var b=a.getSelectedNodes(),c=0;return 0===b.length?-1:(utils.each(b,function(a,b){return b&&b.getData("image")?(c=0,!1):void 0}),c)},queryValue:function(a){var b=a.getSelectedNode();return{url:b.getData("image"),title:b.getData("imageTitle")}}}),d=kity.createClass("RemoveImageCommand",{base:Command,execute:function(a){var b=a.getSelectedNodes();utils.each(b,function(a,b){b.setData("image").render()}),a.layout(300)},queryState:function(a){var b=a.getSelectedNodes();if(0===b.length)return-1;var c=!1;return utils.each(b,function(a,b){return b.getData("image")?(c=!0,!1):void 0}),c?0:-1}}),e=kity.createClass("ImageRenderer",{base:KityMinder.Renderer,create:function(a){return new kity.Image(a.getData("image"))},shouldRender:function(a){return a.getData("image")},update:function(a,b,c){var d=b.getData("image"),e=b.getData("imageTitle"),f=b.getData("imageSize"),g=b.getStyle("space-top");if(f){e&&a.node.setAttributeNS("http://www.w3.org/1999/xlink","title",e);var h=c.cx-f.width/2,i=c.y-f.height-g;return a.setUrl(d).setX(0|h).setY(0|i).setWidth(0|f.width).setHeight(0|f.height),new kity.Box(0|h,0|i,0|f.width,0|f.height)}}});return{defaultOptions:{maxImageWidth:200,maxImageHeight:200},commands:{image:c,removeimage:d},renderers:{top:e}}}),KityMinder.registerModule("Resource",function(){var a=function(){var a,b,c,d,e,f,g,h,i,j,k;return k=4*(1<<30),a=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479],j=function(a){return 0>a&&(a+=k),("00000000"+a.toString(16)).slice(-8)},f=[[16,50,84,118,152,186,220,254],[174,132,249,109,193,32,123,53],[139,12,37,223,234,99,23,73],[151,19,205,235,98,165,4,143],[9,117,66,250,30,203,134,211],[194,166,176,56,212,87,239,145],[92,241,222,164,112,54,41,184],[189,231,28,147,5,79,104,162],[246,158,59,128,44,125,65,90],[42,72,103,81,191,233,195,13]],g=function(a,b,c){var d=h[a]^h[b];h[a]=d>>>c|d<<32-c},b=function(a,b,j,k,l){var m=d+f[c][a]%16,n=d+(f[c][a]>>4);b%=4,j=4+j%4,k=8+k%4,l=12+l%4,h[b]+=h[j]+(i[m]^e[n%16]),g(l,b,16),h[k]+=h[l],g(j,k,12),h[b]+=h[j]+(i[n]^e[m%16]),g(l,b,8),h[k]+=h[l],g(j,k,7)},function(f,g){g instanceof Array&&4===g.length||(g=[0,0,0,0]);var k,l,m,n,o,p,q,r;for(l=a.slice(0),k=e.slice(0,8),c=0;4>c;c+=1)k[c]^=g[c];if(m=16*f.length,o=m%512>446||m%512===0?0:m,m%512===432)f+="老";else{for(f+="耀";f.length%32!==27;)f+="\x00";f+=""}for(i=[],r=0;r<f.length;r+=2)i.push(65536*f.charCodeAt(r)+f.charCodeAt(r+1));for(i.push(0),i.push(m),p=i.length-16,q=0,d=0;d<i.length;d+=16){for(q+=512,n=d===p?o:Math.min(m,q),h=l.concat(k),h[12]^=n,h[13]^=n,c=0;10>c;c+=1)for(r=0;8>r;r+=1)4>r?b(r,r,r,r,r):b(r,r,r+1,r+2,r+3);for(r=0;8>r;r+=1)l[r]^=g[r%4]^h[r]^h[r+8]}return l.map(j).join("")}}(),b=[51,303,75,200,157,0,26,254].map(function(a){return kity.Color.createHSL(a,100,85)});kity.extendClass(Minder,{getHashCode:function(b){b=a(b);var c,d,e=1315423911;for(c=b.length-1;c>=0;c--)d=b.charCodeAt(c),e^=(e<<5)+d+(e>>2);return 2147483647&e},getResourceColor:function(a){var c,d=this._getResourceColorIndexMapping();return d.hasOwnProperty(a)||(c=this._getNextResourceColorIndex(),d[a]=c),b[d[a]]||kity.Color.createHSL(Math.floor(this.getHashCode(a)/2147483647*359),100,85)},getUsedResource:function(){var a,b=this._getResourceColorIndexMapping(),c=[];for(a in b)b.hasOwnProperty(a)&&c.push(a);return c},_getNextResourceColorIndex:function(){var a,c,d,e=this._getResourceColorIndexMapping();c=[];for(a in e)e.hasOwnProperty(a)&&c.push(e[a]);for(d=0;d<b.length;d++)if(!~c.indexOf(d))return d;return-1},_getResourceColorIndexMapping:function(){return this._resourceColorMapping||(this._resourceColorMapping={})}});var c=kity.createClass("ResourceCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNodes();"string"==typeof b&&(b=[b]),c.forEach(function(a){a.setData("resource",b).render()}),a.layout(200)},queryValue:function(a){var b=a.getSelectedNodes(),c=[];return b.forEach(function(a){var b=a.getData("resource");b&&b.forEach(function(a){~c.indexOf(a)||c.push(a)})}),c},queryState:function(a){return a.getSelectedNode()?0:-1}}),d=kity.createClass("ResourceOverlay",{base:kity.Group,constructor:function(){this.callBase();var a,b;b=this.rect=(new kity.Rect).setRadius(4),a=this.text=(new kity.Text).setFontSize(12).setVerticalAlign("middle"),this.addShapes([b,a])},setValue:function(a,b){var c,d,e,f=8,g=4;c=this.text,a==this.lastResourceName?d=this.lastBox:(c.setContent(a),d=c.getBoundaryBox(),this.lastResourceName=a,this.lastBox=d),c.setX(f).fill(b.dec("l",70)),e=this.rect,e.setPosition(0,d.y-g),this.width=Math.round(d.width+2*f),this.height=Math.round(d.height+2*g),e.setSize(this.width,this.height),e.fill(b)}}),e=kity.createClass("ResourceRenderer",{base:KityMinder.Renderer,create:function(a){return this.overlays=[],new kity.Group},shouldRender:function(a){return a.getData("resource")&&a.getData("resource").length},update:function(a,b,c){var e,f,g,h=b.getStyle("space-right"),i=this.overlays,j=b.getData("resource"),k=b.getMinder();for(g=0,e=0;e<j.length;e++)g+=h,f=i[e],f||(f=new d,i.push(f),a.addShape(f)),f.setVisible(!0),f.setValue(j[e],k.getResourceColor(j[e])),f.setTranslate(g,-1),g+=f.width;for(;f=i[e++];)f.setVisible(!1);return a.setTranslate(c.right,0),new kity.Box({x:c.right,y:Math.round(-i[0].height/2),width:g,height:i[0].height})}});return{commands:{resource:c},renderers:{right:e}}}),KityMinder.registerModule("NoteModule",function(){var a="M9,9H3V8h6L9,9L9,9z M9,7H3V6h6V7z M9,5H3V4h6V5z M8.5,11H2V2h8v7.5 M9,12l2-2V1H1v11",b=kity.createClass("NoteCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNode();c.setData("note",b),c.render(),c.getMinder().layout(300)},queryState:function(a){return 1===a.getSelectedNodes().length?0:-1},queryValue:function(a){var b=a.getSelectedNode();return b&&b.getData("note")}}),c=kity.createClass("NoteIcon",{base:kity.Group,constructor:function(){this.callBase(),this.width=16,this.height=17,this.rect=new kity.Rect(16,17,.5,-8.5,2).fill("transparent"),this.path=(new kity.Path).setPathData(a).setTranslate(2.5,-6.5),this.addShapes([this.rect,this.path]),this.on("mouseover",function(){this.rect.fill("rgba(255, 255, 200, .8)")}).on("mouseout",function(){this.rect.fill("transparent")}),this.setStyle("cursor","pointer")}}),d=kity.createClass("NoteIconRenderer",{base:KityMinder.Renderer,create:function(a){var b=new c;return b.on("mousedown",function(b){b.preventDefault(),a.getMinder().fire("editnoterequest")}),b.on("mouseover",function(){a.getMinder().fire("shownoterequest",{node:a,icon:b})}),b.on("mouseout",function(){a.getMinder().fire("hidenoterequest",{node:a,icon:b})}),b},shouldRender:function(a){return a.getData("note")},update:function(a,b,c){var d=c.right+b.getStyle("space-left"),e=c.cy;return a.path.fill(b.getStyle("color")),a.setTranslate(d,e),new kity.Box(d,Math.round(e-a.height/2),a.width,a.height)}});return{renderers:{right:d},commands:{note:b}}});var ViewDragger=kity.createClass("ViewDragger",{constructor:function(a){this._minder=a,this._enabled=!1,this._bind();var b=this;this._minder.getViewDragger=function(){return b}},isEnabled:function(){return this._enabled},setEnabled:function(a){var b=this._minder.getPaper();b.setStyle("cursor",a?"pointer":"default"),b.setStyle("cursor",a?"-webkit-grab":"default"),this._enabled=a},move:function(a,b){var c=(this._minder,this.getMovement().offset(a));this.moveTo(c,b)},moveTo:function(a,b){if(b){var c=this;return this._moveTimeline&&this._moveTimeline.stop(),this._moveTimeline=this._minder.getRenderContainer().animate(new kity.Animator(this.getMovement(),a,function(a,b){c.moveTo(b)}),b,"easeOutCubic"),this._moveTimeline.on("finish",function(){c._moveTimeline=null}),this}this._minder.getRenderContainer().setTranslate(a.round()),this._minder.fire("viewchange")},getMovement:function(){var a=this._minder.getRenderContainer().transform.translate;return a?a[0]:new kity.Point},getView:function(){var a=this._minder,b={width:a.getRenderTarget().clientWidth,height:a.getRenderTarget().clientHeight},c=this.getMovement(),d=new kity.Box(0,0,b.width,b.height),e=a.getPaper().getViewPortMatrix();return e.inverse().translate(-c.x,-c.y).transformBox(d)},_bind:function(){function a(a){if(d){d=null,a.stopPropagation(),c&&(b.setEnabled(!1),c=!1,"hand"==b._minder.getStatus()&&b._minder.rollbackStatus());var e=b._minder.getPaper();e.setStyle("cursor","hand"==b._minder.getStatus()?"-webkit-grab":"default")}}var b=this,c=!1,d=null,e=null;this._minder.on("normal.mousedown normal.touchstart inputready.mousedown inputready.touchstart readonly.mousedown readonly.touchstart",function(a){2==a.originEvent.button&&a.originEvent.preventDefault(),(a.getTargetNode()==this.getRoot()||2==a.originEvent.button||a.originEvent.altKey)&&(d=a.getPosition(),c=!0)}).on("normal.mousemove normal.touchmove readonly.mousemove readonly.touchmove inputready.mousemove inputready.touchmove",function(a){if("touchmove"==a.type&&a.preventDefault(),c){var e=kity.Vector.fromPoints(d,a.getPosition());if(e.length()>10){this.setStatus("hand",!0);var f=b._minder.getPaper();f.setStyle("cursor","-webkit-grabbing")}}}).on("hand.beforemousedown hand.beforetouchstart",function(a){if(b.isEnabled()){d=a.getPosition(),a.stopPropagation();var c=b._minder.getPaper();c.setStyle("cursor","-webkit-grabbing")}}).on("hand.beforemousemove hand.beforetouchmove",function(a){if(d){e=a.getPosition();var c=kity.Vector.fromPoints(d,e);b.move(c),a.stopPropagation(),a.preventDefault(),a.originEvent.preventDefault(),d=e}}).on("mouseup touchend",a),window.addEventListener("mouseup",a),this._minder.on("contextmenu",function(a){a.preventDefault()})}});KityMinder.registerModule("View",function(){var a=kity.createClass("ToggleHandCommand",{base:Command,execute:function(a){"hand"!=a.getStatus()?a.setStatus("hand",!0):a.rollbackStatus(),this.setContentChanged(!1)},queryState:function(a){return"hand"==a.getStatus()?1:0},enableReadOnly:!0}),b=kity.createClass("CameraCommand",{base:Command,execute:function(a,b,c){b=b||a.getRoot();var d=a.getPaper().getViewPort(),e=b.getRenderContainer().getRenderBox("view"),f=d.center.x-e.x-e.width/2,g=d.center.y-e.y,h=a._viewDragger;h.move(new kity.Point(f,g),c),this.setContentChanged(!1)},enableReadOnly:!0}),c=kity.createClass("MoveCommand",{base:Command,execute:function(a,b,c){var d=a._viewDragger,e=a._lastClientSize;switch(b){case"up":d.move(new kity.Point(0,e.height/2),c);break;case"down":d.move(new kity.Point(0,-e.height/2),c);break;case"left":d.move(new kity.Point(e.width/2,0),c);break;case"right":d.move(new kity.Point(-e.width/2,0),c)}},enableReadOnly:!0});return{init:function(){this._viewDragger=new ViewDragger(this)},commands:{hand:a,camera:b,move:c},events:{keydown:function(a){var b=this;["up","down","left","right"].forEach(function(c){a.isShortcutKey("ctrl+"+c)&&"textedit"!=b.getStatus()&&(b.removeAllSelectedNodes(),b.execCommand("move",c,100),a.preventDefault())}),a.isShortcutKey("ctrl+enter")&&b.execCommand("camera",b.getRoot(),100)},statuschange:function(a){this._viewDragger.setEnabled("hand"==a.currentStatus)},mousewheel:function(a){var b,c;a=a.originEvent,a.ctrlKey||a.shiftKey||("wheelDeltaX"in a?(b=a.wheelDeltaX||0,c=a.wheelDeltaY||0):(b=0,c=a.wheelDelta),this._viewDragger.move({x:b/2.5,y:c/2.5}),a.preventDefault())},"normal.dblclick readonly.dblclick":function(a){a.kityEvent.targetShape instanceof kity.Paper&&this.execCommand("camera",this.getRoot(),800)},ready:function(){this.execCommand("camera",null,0),this._lastClientSize={width:this.getRenderTarget().clientWidth,height:this.getRenderTarget().clientHeight}},resize:function(a){var b={width:this.getRenderTarget().clientWidth,height:this.getRenderTarget().clientHeight},c=this._lastClientSize;this._viewDragger.move(new kity.Point((b.width-c.width)/2|0,(b.height-c.height)/2|0)),this._lastClientSize=b},"selectionchange layoutallfinish":function(a){var b=this.getSelectedNode();if(b){var c=this._viewDragger,d=c.getView(),e=b.getLayoutBox(),f=50,g=0,h=0;e.right>d.right?g+=d.right-e.right-f:e.left<d.left&&(g+=d.left-e.left+f),e.bottom>d.bottom&&(h+=d.bottom-e.bottom-f),e.top<d.top&&(h+=d.top-e.top+f),(g||h)&&c.move(new kity.Point(g,h),100)}}}}});var GM=KityMinder.Geometry,MoveToParentCommand=kity.createClass("MoveToParentCommand",{base:Command,execute:function(a,b,c){for(var d,e=b.length-1;e>=0;e--)d=b[e],d.parent&&(d.parent.removeChild(d),c.appendChild(d),d.render());c.expand(),a.select(b,!0)}}),DropHinter=kity.createClass("DropHinter",{base:kity.Group,constructor:function(){this.callBase(),this.rect=new kity.Rect,this.addShape(this.rect)},render:function(a){this.setVisible(!!a),a&&(this.rect.setBox(a.getLayoutBox()).setRadius(a.getStyle("radius")||0).stroke(a.getStyle("drop-hint-color")||"yellow",a.getStyle("drop-hint-width")||2),this.bringTop())}}),OrderHinter=kity.createClass("OrderHinter",{base:kity.Group,constructor:function(){this.callBase(),this.area=new kity.Rect,this.path=new kity.Path,this.addShapes([this.area,this.path])},render:function(a){this.setVisible(!!a),a&&(this.area.setBox(a.area),this.area.fill(a.node.getStyle("order-hint-area-color")||"rgba(0, 255, 0, .5)"),this.path.setPathData(a.path),this.path.stroke(a.node.getStyle("order-hint-path-color")||"#0f0",a.node.getStyle("order-hint-path-width")||1))}}),TreeDragger=kity.createClass("TreeDragger",{constructor:function(a){this._minder=a,this._dropHinter=new DropHinter,this._orderHinter=new OrderHinter,a.getRenderContainer().addShapes([this._dropHinter,this._orderHinter])},dragStart:function(a){this._startPosition=a},dragMove:function(a){var b=10;if(this._startPosition){var c=kity.Vector.fromPoints(this._dragPosition||this._startPosition,a),d=this._minder;if(this._dragPosition=a,!this._dragMode){if(GM.getDistance(this._dragPosition,this._startPosition)<b)return;if(!this._enterDragMode())return}for(var e=0;e<this._dragSources.length;e++)this._dragSources[e].setLayoutOffset(this._dragSources[e].getLayoutOffset().offset(c)),d.applyLayoutResult(this._dragSources[e]);this._dropTest()?this._renderOrderHint(this._orderSucceedHint=null):this._orderTest()}},dragEnd:function(){if(this._startPosition=null,this._dragPosition=null,this._dragMode){if(this._fadeDragSources(1),this._dropSucceedTarget)this._dragSources.forEach(function(a){a.setLayoutOffset(null)}),this._minder.layout(-1),this._minder.execCommand("movetoparent",this._dragSources,this._dropSucceedTarget);else if(this._orderSucceedHint){var a=this._orderSucceedHint,b=a.node.getIndex(),c=this._dragSources.map(function(a){return a.setLayoutOffset(null),a.getIndex()}),d=Math.max.apply(Math,c),e=Math.min.apply(Math,c);e>b&&"down"==a.type&&b++,b>d&&"up"==a.type&&b--,a.node.setLayoutOffset(null),this._minder.execCommand("arrange",this._dragSources,b),this._renderOrderHint(null)}else this._minder.fire("savescene");this._minder.layout(300),this._leaveDragMode(),this._minder.fire("contentchange")}},_enterDragMode:function(){return this._calcDragSources(),this._dragSources.length?(this._fadeDragSources(.5),this._calcDropTargets(),this._calcOrderHints(),this._dragMode=!0,this._minder.setStatus("dragtree"),!0):(this._startPosition=null,!1)},_calcDragSources:function(){this._dragSources=this._minder.getSelectedAncestors()},_fadeDragSources:function(a){var b=this._minder;this._dragSources.forEach(function(c){c.getRenderContainer().setOpacity(a,200),c.traverse(function(c){1>a?b.detachNode(c):b.attachNode(c)},!0)})},_calcDropTargets:function(){function a(b,c){var d,e=[];return e.push(c),c.getChildren().forEach(function(c){for(d=0;d<b.length;d++)if(b[d]==c)return;e=e.concat(a(b,c))}),e}this._dropTargets=a(this._dragSources,this._minder.getRoot()),this._dropTargetBoxes=this._dropTargets.map(function(a){return a.getLayoutBox()})},_calcOrderHints:function(){var a=this._dragSources,b=MinderNode.getCommonAncestor(a);if(b==a[0]&&(b=a[0].parent),0===a.length||b!=a[0].parent)return void(this._orderHints=[]);var c=b.children;this._orderHints=c.reduce(function(b,c){return-1==a.indexOf(c)&&(b=b.concat(c.getOrderHint())),b},[])},_leaveDragMode:function(){this._dragMode=!1,this._dropSucceedTarget=null,this._orderSucceedHint=null,this._renderDropHint(null),this._renderOrderHint(null),this._minder.rollbackStatus()},_drawForDragMode:function(){this._text.setContent(this._dragSources.length+" items"),this._text.setPosition(this._startPosition.x,this._startPosition.y+5),this._minder.getRenderContainer().addShape(this)},_boxTest:function(a,b,c){var d,e,f,g,h,i=this._dragSources.map(function(a){return a.getLayoutBox()});for(c=c||function(a,b,c){return a},d=0;d<a.length;d++)for(f=a[d],h=b.call(this,f,d),e=0;e<i.length;e++){g=i[e];var j=GM.getIntersectBox(g,h);if(c(j,g,h))return f}return null},_dropTest:function(){return this._dropSucceedTarget=this._boxTest(this._dropTargets,function(a,b){return this._dropTargetBoxes[b]},function(a,b,c){function d(a){return a.width*a.height}return a?d(a)>.5*Math.min(d(b),d(c))?!0:a.width+1>=Math.min(b.width,c.width)?!0:a.height+1>=Math.min(b.height,c.height)?!0:!1:!1}),this._renderDropHint(this._dropSucceedTarget),!!this._dropSucceedTarget},_orderTest:function(){return this._orderSucceedHint=this._boxTest(this._orderHints,function(a){return a.area}),this._renderOrderHint(this._orderSucceedHint),!!this._orderSucceedHint},_renderDropHint:function(a){this._dropHinter.render(a)},_renderOrderHint:function(a){this._orderHinter.render(a)},preventDragMove:function(){this._startPosition=null}});KityMinder.registerModule("DragTree",function(){var a;return{init:function(){a=new TreeDragger(this),window.addEventListener("mouseup",function(){a.dragEnd()})},events:{"normal.mousedown inputready.mousedown":function(b){b.originEvent.button||b.getTargetNode()&&b.getTargetNode()!=this.getRoot()&&a.dragStart(b.getPosition(this.getRenderContainer()))},"normal.mousemove dragtree.mousemove":function(b){a.dragMove(b.getPosition(this.getRenderContainer()))},"normal.mouseup dragtree.beforemouseup":function(b){a.dragEnd(),b.preventDefault()},statuschange:function(b){"textedit"==b.lastStatus&&"normal"==b.currentStatus&&a.preventDragMove()}},commands:{movetoparent:MoveToParentCommand}}}),KityMinder.registerModule("KeyboardModule",function(){function a(a){var b,d=[];a.traverse(function(a){b=a.getLayoutBox(),b.width&&b.height&&d.push({left:b.x,top:b.y,right:b.x+b.width,bottom:b.y+b.height,width:b.width,height:b.height,node:a,text:a.getText()})});for(var e=0;e<d.length;e++)c(d,e)}function b(a,b){var c,d,h,i,j,k,l;return c=e(a.left,b.left),d=f(a.right,b.right),h=e(a.top,b.top),i=f(a.bottom,b.bottom),j=d-c-a.width-b.width,k=i-h-a.height-b.height,l=0>j?k:0>k?j:g(j*j+k*k),{cx:l,cy:l}}function c(a,c){for(var d,e,f=a[c],g={},h=0;h<a.length;h++)h!=c&&(d=a[h],e=b(d,f),d.right<f.left&&(!g.left||e.cx<g.left.dist)&&(g.left={dist:e.cx,node:d.node}),d.left>f.right&&(!g.right||e.cx<g.right.dist)&&(g.right={dist:e.cx,node:d.node}),d.bottom<f.top&&(!g.top||e.cy<g.top.dist)&&(g.top={dist:e.cy,node:d.node}),d.top>f.bottom&&(!g.down||e.cy<g.down.dist)&&(g.down={dist:e.cy,node:d.node}));f.node._nearestNodes={right:g.right&&g.right.node||null,top:g.top&&g.top.node||null,left:g.left&&g.left.node||null,down:g.down&&g.down.node||null}}function d(b,c){var d=b.getSelectedNode();if(!d)return b.select(b.getRoot()),void a(b.getRoot());d._nearestNodes||a(b.getRoot());var e=d._nearestNodes[c];e&&b.select(e,!0)}var e=Math.min,f=Math.max,g=(Math.abs,Math.sqrt),h=(Math.exp,kity.createClass({base:Command,execute:function(a){var b=a.getSelectedNode();b&&b.parent&&a.select(b.parent,!0),this.setContentChanged(!1)},queryState:function(a){return a.getSelectedNode()?0:-1},enableReadOnly:!0}));return{commands:{navparent:h},commandShortcutKeys:{navparent:"shift+tab"},events:{layoutallfinish:function(){var b=this.getRoot();a(b)},"normal.keydown readonly.keydown":function(a){var b=this;["left","right","up","down"].forEach(function(c){a.isShortcutKey(c)&&d(b,"up"==c?"top":c)})},"normal.keyup":function(a){if(browser.ipad){var b=KityMinder.keymap,c=a.getTargetNode(),d=this.getLang();this.receiver&&(this.receiver.keydownNode=c);var e=a.originEvent;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;switch(e.keyCode){case b.Enter:this.execCommand("AppendSiblingNode",d.topic),a.preventDefault();break;case b.Backspace:case b.Del:a.preventDefault(),this.execCommand("RemoveNode")}}}}}}),KityMinder.registerModule("Select",function(){var a=this,b=a.getRenderContainer(),c=KityMinder.Geometry,d=function(){var d=null,e=new kity.Path,f=!1,g=10;return{selectStart:function(a){return a.originEvent.button||a.originEvent.altKey?void 0:d?this.selectEnd():void(d=c.snapToSharp(a.getPosition(b)))},selectMove:function(h){if("textedit"!=a.getStatus()&&d){var i=d,j=h.getPosition(b);if(!f){if(c.getDistance(i,j)<g)return;f=!0,b.addShape(e),e.fill(a.getStyle("marquee-background")).stroke(a.getStyle("marquee-stroke")).setOpacity(.8).getDrawer().clear()}var k=c.getBox(i,j),l=[];k.left=Math.round(k.left),k.top=Math.round(k.top),k.right=Math.round(k.right),k.bottom=Math.round(k.bottom),e.getDrawer().pipe(function(){this.clear(),this.moveTo(k.left,k.top),this.lineTo(k.right,k.top),this.lineTo(k.right,k.bottom),this.lineTo(k.left,k.bottom),this.close()}),a.getRoot().traverse(function(a){var b=a.getLayoutBox();c.getIntersectBox(b,k)&&l.push(a)}),a.select(l,!0),window.getSelection().removeAllRanges()}},selectEnd:function(a){d&&(d=null),f&&(e.fadeOut(200,"ease",0,function(){e.remove&&e.remove()}),f=!1)}}}(),e=null,f=null;return{init:function(){window.addEventListener("mouseup",function(){d.selectEnd()})},events:{mousedown:function(a){var b=a.getTargetNode();b?a.originEvent.shiftKey?this.toggleSelect(b):b.isSelected()?this.isSingleSelect()||(e=b,f=a.getPosition(this.getRenderContainer())):this.select(b,!0):(this.removeAllSelectedNodes(),d.selectStart(a),this.setStatus("normal"))},mousemove:d.selectMove,mouseup:function(a){var b=a.getTargetNode();if(b&&b==e){var c=a.getPosition(this.getRenderContainer()),g=kity.Vector.fromPoints(f,c);g.length()<1&&this.select(e,!0),e=null}d.selectEnd(a)},"normal.keydown inputready.keydown":function(a){if(a.isShortcutKey("ctrl+a")){var b=[];this.getRoot().traverse(function(a){b.push(a)}),this.select(b,!0),a.preventDefault()}}}}}),KityMinder.registerModule("basestylemodule",function(){function a(a,b){return a.getData(b)||a.getStyle(b)}var b=this;return KityMinder.TextRenderer.registerStyleHook(function(b,c){var d=a(b,"font-weight"),e=a(b,"font-style");[d,e].join("/");c.eachItem(function(a,b){b.setFont({weight:d,style:e})})}),{commands:{bold:kity.createClass("boldCommand",{base:Command,execute:function(a){var b=a.getSelectedNodes();1==this.queryState("bold")?utils.each(b,function(a,b){b.setData("font-weight").render()}):utils.each(b,function(a,b){b.setData("font-weight","bold").render()}),a.layout()},queryState:function(){var a=b.getSelectedNodes(),c=0;return 0===a.length?-1:(utils.each(a,function(a,b){return b&&b.getData("font-weight")?(c=1,!1):void 0}),c)}}),italic:kity.createClass("italicCommand",{base:Command,execute:function(a){var b=a.getSelectedNodes();1==this.queryState("italic")?utils.each(b,function(a,b){b.setData("font-style").render()}):utils.each(b,function(a,b){b.setData("font-style","italic").render()}),a.layout()},queryState:function(){var a=b.getSelectedNodes(),c=0;return 0===a.length?-1:(utils.each(a,function(a,b){return b&&b.getData("font-style")?(c=1,!1):void 0}),c)}})},commandShortcutKeys:{bold:"ctrl+b",italic:"ctrl+i"}}}),KityMinder.registerModule("fontmodule",function(){function a(a,b){return a.getData(b)||a.getStyle(b)}return KityMinder.TextRenderer.registerStyleHook(function(b,c){var d=b.getData("color"),e=b.getStyle("selected-color"),f=b.getStyle("color"),g=d||(b.isSelected()&&e?e:f),h=a(b,"font-family"),i=a(b,"font-size"),j=[h,i].join("/");c.fill(g),b.setTmpData("fore-color",g.toString()),c.eachItem(function(a,b){b.setFont({family:h,size:i})}),b.setTmpData("font-hash",j)}),{defaultOptions:{fontfamily:[{name:"宋体",val:"宋体,SimSun"},{name:"微软雅黑",val:"微软雅黑,Microsoft YaHei"},{name:"楷体",val:"楷体,楷体_GB2312,SimKai"},{name:"黑体",val:"黑体, SimHei"},{name:"隶书",val:"隶书, SimLi"},{name:"Andale Mono",val:"andale mono"},{name:"Arial",val:"arial,helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"Comic Sans Ms",val:"comic sans ms"},{name:"Impact",val:"impact,chicago"},{name:"Times New Roman",val:"times new roman"},{name:"Sans-Serif",val:"sans-serif"}],fontsize:[10,12,16,18,24,32,48]},commands:{forecolor:kity.createClass("fontcolorCommand",{base:Command,
  21. execute:function(a,b){var c=a.getSelectedNodes();utils.each(c,function(a,c){c.setData("color",b),c.render()})},queryState:function(a){return 0==a.getSelectedNodes().length?-1:0},queryValue:function(a){return 1==a.getSelectedNodes().length?a.getSelectedNodes()[0].getData("color"):"mixed"}}),background:kity.createClass("backgroudCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNodes();utils.each(c,function(a,c){c.setData("background",b),c.render()})},queryState:function(a){return 0==a.getSelectedNodes().length?-1:0},queryValue:function(a){return 1==a.getSelectedNodes().length?a.getSelectedNodes()[0].getData("background"):"mixed"}}),fontfamily:kity.createClass("fontfamilyCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNodes();utils.each(c,function(c,d){d.setData("font-family",b),d.render(),a.layout()})},queryState:function(a){return 0===a.getSelectedNodes().length?-1:0},queryValue:function(a){var b=a.getSelectedNode();return b?b.getData("font-family"):null}}),fontsize:kity.createClass("fontsizeCommand",{base:Command,execute:function(a,b){var c=a.getSelectedNodes();utils.each(c,function(c,d){d.setData("font-size",b),d.render(),a.layout(300)})},queryState:function(a){return 0==a.getSelectedNodes().length?-1:0},queryValue:function(a){var b=a.getSelectedNode();return b?b.getData("font-size"):null}})}}}),KityMinder.registerModule("Zoom",function(){function a(){var a=e._zoomValue>=100?"optimize-speed":"geometricPrecision";e.getRenderContainer().setAttr("text-rendering",a)}function b(a){var b=a.shapeNode,c=b.getCTM(),d=new kity.Matrix(c.a,c.b,c.c,c.d,(0|c.e)+.5,(0|c.f)+.5);b.setAttribute("transform","matrix("+d.toString()+")")}function c(b,c){var e=b.getPaper();e.getViewPort();if(c){if(a(),b.getRoot().getComplex()>200)b._zoomValue=c,b.zoom(c),b.fire("viewchange");else{var f=new kity.Animator({beginValue:b._zoomValue,finishValue:c,setter:function(a,b){a.zoom(b)}});b._zoomValue=c,d&&d.pause(),d=f.start(b,300,"easeInOutSine"),d.on("finish",function(){b.fire("viewchange")})}b.fire("zoom",{zoom:c})}}var d,e=this;e.setDefaultOptions("zoom",[10,20,30,50,80,100,120,150,200]),kity.extendClass(Minder,{zoom:function(a){var c=this.getPaper(),d=c.getViewPort();d.zoom=a/100,d.center={x:d.center.x,y:d.center.y},c.setViewPort(d),100==a&&b(c)},getZoomValue:function(){return this._zoomValue}});var f=kity.createClass("Zoom",{base:Command,execute:c,queryValue:function(a){return a._zoomValue}}),g=kity.createClass("ZoomInCommand",{base:Command,execute:function(a){c(a,this.nextValue(a))},queryState:function(a){return+!this.nextValue(a)},nextValue:function(a){var b,c=a.getOptions("zoom");for(b=0;b<c.length;b++)if(c[b]>a._zoomValue)return c[b];return 0},enableReadOnly:!0}),h=kity.createClass("ZoomOutCommand",{base:Command,execute:function(a){c(a,this.nextValue(a))},queryState:function(a){return+!this.nextValue(a)},nextValue:function(a){var b,c=a.getOptions("zoom");for(b=c.length-1;b>=0;b--)if(c[b]<a._zoomValue)return c[b];return 0},enableReadOnly:!0});return{init:function(){this._zoomValue=100,a()},commands:{"zoom-in":g,"zoom-out":h,zoom:f},events:{"normal.mousewheel readonly.mousewheel":function(a){if(a.originEvent.ctrlKey||a.originEvent.metaKey){var b=a.originEvent.wheelDelta,c=this;kity.Browser.mac||(b=-b),Math.abs(b)>100&&(clearTimeout(this._wheelZoomTimeout),this._wheelZoomTimeout=setTimeout(function(){c.getPaper()._zoom||1;0>b?c.execCommand("zoom-in"):b>0&&c.execCommand("zoom-out")},100),a.originEvent.preventDefault())}}},commandShortcutKeys:{"zoom-in":"ctrl+=","zoom-out":"ctrl+-"}}}),KityMinder.registerModule("hyperlink",function(){var a="M16.614,10.224h-1.278c-1.668,0-3.07-1.07-3.599-2.556h4.877c0.707,0,1.278-0.571,1.278-1.278V3.834 c0-0.707-0.571-1.278-1.278-1.278h-4.877C12.266,1.071,13.668,0,15.336,0h1.278c2.116,0,3.834,1.716,3.834,3.834V6.39 C20.448,8.508,18.73,10.224,16.614,10.224z M5.112,5.112c0-0.707,0.573-1.278,1.278-1.278h7.668c0.707,0,1.278,0.571,1.278,1.278 S14.765,6.39,14.058,6.39H6.39C5.685,6.39,5.112,5.819,5.112,5.112z M2.556,3.834V6.39c0,0.707,0.573,1.278,1.278,1.278h4.877 c-0.528,1.486-1.932,2.556-3.599,2.556H3.834C1.716,10.224,0,8.508,0,6.39V3.834C0,1.716,1.716,0,3.834,0h1.278 c1.667,0,3.071,1.071,3.599,2.556H3.834C3.129,2.556,2.556,3.127,2.556,3.834z";return{commands:{hyperlink:kity.createClass("hyperlink",{base:Command,execute:function(a,b,c){var d=a.getSelectedNodes();utils.each(d,function(a,d){d.setData("hyperlink",b),d.setData("hyperlinkTitle",c),d.render()}),a.layout()},queryState:function(a){var b=a.getSelectedNodes(),c=0;return 0===b.length?-1:(utils.each(b,function(a,b){return b&&b.getData("hyperlink")?(c=0,!1):void 0}),c)},queryValue:function(a){var b=a.getSelectedNode();return{url:b.getData("hyperlink"),title:b.getData("hyperlinkTitle")}}}),unhyperlink:kity.createClass("hyperlink",{base:Command,execute:function(a){var b=a.getSelectedNodes();utils.each(b,function(a,b){b.setData("hyperlink"),b.render()}),a.layout()},queryState:function(a){var b=a.getSelectedNodes();if(0===b.length)return-1;var c=!1;return utils.each(b,function(a,b){return b.getData("hyperlink")?(c=!0,!1):void 0}),c?0:-1}})},renderers:{right:kity.createClass("hyperlinkrender",{base:KityMinder.Renderer,create:function(){var b=new kity.HyperLink,c=new kity.Path,d=new kity.Rect(24,22,-2,-6,4).fill("rgba(255, 255, 255, 0)");return c.setPathData(a).fill("#666"),b.addShape(d),b.addShape(c),b.setTarget("_blank"),b.setStyle("cursor","pointer"),b.on("mouseover",function(){d.fill("rgba(255, 255, 200, .8)")}).on("mouseout",function(){d.fill("rgba(255, 255, 255, 0)")}),b},shouldRender:function(a){return a.getData("hyperlink")},update:function(a,b,c){var d=b.getData("hyperlink");a.setHref(d);var e=b.getData("hyperlinkTitle");e=e?[e,"(",d,")"].join(""):d,a.node.setAttributeNS("http://www.w3.org/1999/xlink","title",e);var f=b.getStyle("space-right");return a.setTranslate(c.right+f+2,-5),new kity.Box({x:c.right+f,y:-11,width:24,height:22})}})}}}),KityMinder.registerProtocol("plain",function(a){function b(a,b){for(var c="";b--;)c+=a;return c}function c(a,d){var e="";return d=d||0,e+=b(j,d),e+=a.data.text+h,a.children&&a.children.forEach(function(a){e+=c(a,d+1)}),e}function d(a){return!/\S/.test(a)}function e(a){for(var b=0;a.charAt(b)===j;)b++;return b}function f(a){return{data:{text:a.replace(new RegExp("^"+j+"*"),"")}}}function g(a,b){function c(a,b){var c=a.children||(a.children=[]);c.push(b)}var g,h,j,k,l,m={},n=a.split(i);b?(m[0]=g=f("root"),h=1):h=0;for(var o=0;o<n.length;o++)if(j=n[o],!d(j)){if(k=e(j)+h,l=f(j),0===k){if(g)throw new Error("Invalid local format");g=l}else{if(!m[k-1])throw new Error("Invalid local format");c(m[k-1],l)}m[k]=l}return g}var h="\r",i=/\r\n|\r|\n/,j=" ";return{fileDescription:"大纲文本",fileExtension:".txt",mineType:"text/plain",dataType:"text",encode:function(a){return c(a,0)},decode:function(a,b){return g(a,b)},recognizePriority:-1}}),KityMinder.registerProtocol("markdown",function(){function a(a){return b(a,1).join("\n")}function b(a,d){var e=[];d=d||1;var f=c(d);e.push(f+" "+a.data.text),e.push(j);var g=a.data.note;if(g){var h=/^#/.test(g);h&&(e.push(k),g=g.replace(/^#+/gm,function(a){return f+a})),e.push(g),h&&e.push(l),e.push(j)}return a.children&&a.children.forEach(function(a){e=e.concat(b(a,d+1))}),e}function c(a){for(var b="";a--;)b+="#";return b}function d(a){var b,c,d,j,k,l,m,n={};a=a.replace(/^(.+)\n={3,}/,function(a,b){return"# "+b}),b=a.split(i);for(var o=0;o<b.length;o++)c=b[o],d=g(c),d.noteClose?l=!1:d.noteStart?l=!0:(m=d.codeBlock?!m:m,l||m||!d.level||d.level>j+1?k&&f(k,c):(j=d.level,k=e(d.content,n[j-1]),n[j]=k));return h(n[1]),n[1]}function e(a,b){var c={data:{text:a,note:""}};return b&&(b.children?b.children.push(c):b.children=[c]),c}function f(a,b){a.data.note+=b+"\n"}function g(a){var b=/^(#+)?\s*(.*)$/.exec(a);return{level:b[1]&&b[1].length||null,content:b[2],noteStart:a==k,noteClose:a==l,codeBlock:/^\s*```/.test(a)}}function h(a){if(/\S/.test(a.data.note)){for(var b=a.data.note.split("\n");b.length&&!/\S/.test(b[0]);)b.shift();for(;b.length&&!/\S/.test(b[b.length-1]);)b.pop();a.data.note=b.join("\n")}else a.data.note=null,delete a.data.note;a.children&&a.children.forEach(h)}var i=/\r\n|\r|\n/,j="",k="<!--Note-->",l="<!--/Note-->";return{fileDescription:"Markdown/GFM 格式",fileExtension:".md",mineType:"text/markdown",dataType:"text",encode:function(b){return a(b)},decode:function(a){return d(a)},recognizePriority:-1}}),KityMinder.registerProtocol("json",function(a){return{fileDescription:"KityMinder 格式",fileExtension:".km",dataType:"text",mineType:"application/json",encode:function(a){return JSON.stringify(a)},decode:function(a){return JSON.parse(a)}}}),kity.Browser.ie||KityMinder.registerProtocol("png",function(a){function b(a,b){return new Promise(function(b,c){var d=document.createElement("img");d.onload=function(){b(this)},d.onerror=function(a){c(a)},d.crossOrigin="",d.src=a})}function c(){var b,c,d,f,g,h=a.getPaper(),i=(h.container,a.getRenderContainer()),j=i.getRenderBox(),k=j.width+1,l=j.height+1;return b=h.shapeNode.getAttribute("transform"),h.shapeNode.setAttribute("transform","translate(0.5, 0.5)"),i.translate(-j.x,-j.y),c=h.container.innerHTML,i.translate(j.x,j.y),h.shapeNode.setAttribute("transform",b),d=$(c).filter("svg"),d.attr({width:j.width+1,height:j.height+1,style:'font-family: Arial, "Microsoft Yahei","Heiti SC";'}),c=$("<div></div>").append(d).html(),c=c.replace(' xmlns="http://www.w3.org/2000/svg" xmlns:NS1="" NS1:ns1:xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:NS2="" NS2:xmlns:ns1=""',""),c=c.replace(/&nbsp;/g,"&#xa0;"),f=new Blob([c],{type:"image/svg+xml"}),g=e.createObjectURL(f),{width:k,height:l,dataUrl:g,xml:c}}function d(d){function f(a,b){a.save(),a.fillStyle=b,a.fillRect(0,0,j.width,j.height),a.restore()}function g(a,b,c,d){a.drawImage(b,c,d)}function h(a){try{var b=a.toDataURL("png");return b}catch(c){throw new Error("当前浏览器版本不支持导出 PNG 功能,请尝试升级到最新版本!")}}function i(){return"undefined"!=typeof window.canvg?new Promise(function(a){window.canvg(j,o.xml,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:s,offsetY:s,renderCallback:function(){a(h(j))}})}):b(r).then(function(a){return g(k,a,s,s),e.revokeObjectURL(r),h(j)})}var j=document.createElement("canvas"),k=j.getContext("2d"),l=a.getStyle("background").toString(),m=/url\((.+)\)/.exec(l),n=kity.Color.parse(l),o=c(),p=o.width,q=o.height,r=o.dataUrl,s=20;return j.width=p+2*s,j.height=q+2*s,m?b(m[1]).then(function(a){return f(k,k.createPattern(a,"repeat")),i()}):(f(k,n.toString()),i())}var e=window.URL||window.webkitURL||window;return{fileDescription:"PNG 图片",fileExtension:".png",mineType:"image/png",dataType:"base64",encode:d,recognizePriority:-1}}),kity.Browser.ie||KityMinder.registerProtocol("svg",function(a){return{fileDescription:"SVG 矢量图",fileExtension:".svg",mineType:"image/svg+xml",dataType:"text",encode:function(b){var c,d,e=a.getPaper(),f=e.shapeNode.getAttribute("transform"),g=a.getRenderContainer(),h=g.getRenderBox(),i=(g.getTransform(),h.width),j=h.height,k=20;return e.shapeNode.setAttribute("transform","translate(0.5, 0.5)"),c=e.container.innerHTML,e.shapeNode.setAttribute("transform",f),d=$(c).filter("svg"),d.attr({width:i+2*k|0,height:j+2*k|0,style:'font-family: Arial, "Microsoft Yahei", "Heiti SC"; background: '+a.getStyle("background")}),d[0].setAttribute("viewBox",[h.x-k|0,h.y-k|0,i+2*k|0,j+2*k|0].join(" ")),c=$("<div></div>").append(d).html(),c=$("<div></div>").append(d).html(),c=c.replace(/&nbsp;/g,"&#xa0;")},recognizePriority:-1}}),function(){var a=[];KityMinder.registerUI=function(b,c,d){"function"==typeof c&&(d=c,c=null),a.push({id:b,ui:d,deps:c})},kity.extendClass(Minder,{initUI:function(){var b=this._ui={},c=this;a.forEach(function(a){var d=a.deps;d&&(d=d.map(function(a){return c.getUI(a)})),b[a.id]=a.ui.apply(null,[c].concat(d||[]))}),$("#content-wrapper").delegate("#panel, #tab-container, .fui-dialog, #main-menu","keydown keyup",function(a){a.stopPropagation()}),$("#content-wrapper").delegate("input","mousedown mousemove mouseup contextmenu",function(a){a.stopPropagation()}),c.getPaper().addClass("loading-target"),this.fire("interactchange"),this.fire("uiready")},getUI:function(a){return this._ui[a]}}),$.ajaxSetup({cache:!1}),$.extend($,{pajax:function(){var a=$.ajax.apply($,arguments);return new Promise(function(b,c){a.done(b),a.fail(function(a,b,d){var e=new Error(b);e.getDetail=function(){try{return"jQuery XHR Error: \n"+JSON.stringify(d)}catch(a){return d}},c(e)})})}}),$(function(){var a=["kmcat_warn.png","kmcat_sad.png","icons.png","template_large.png","history.png","feedback.png","iconpriority.png","iconprogress.png","template.png","layout.png","next-level.png","prev-level.png"];a.forEach(function(a){(new Image).src="ui/theme/default/images/"+a})})}(),KityMinder.registerUI("eve",function(a){return{setup:function(a){var b={};return a.on=function(a,c){var d=b[a]||(b[a]=[]);return d.push(c),this},a.off=function(a,c){var d=b[a];if(d){var e=d.indexOf(c);~e?d.splice(e,1):c[a]=null}return this},a.once=function(b,c){return this.on(b,function d(){c.apply(a,arguments),a.off(b,d)})},a.fire=function(c){var d=b[c],e=[].slice.call(arguments,1);return d&&d.forEach(function(b){b.apply(a,e)}),this},a}}}),KityMinder.registerUI("memory",function(){var a=window.localStorage,b=a.uiMemory?JSON.parse(a.uiMemory):{};return{get:function(a){return b[a]||null},set:function(c,d){b[c]=d,a.uiMemory=JSON.stringify(b)}}}),kity.extendClass(FUI.Widget,{setEnable:function(a){a===!1?this.disable():this.enable()},setActive:function(a){a===!1?this.removeClass("active"):this.addClass("active")},bindExecution:function(a,b){var c=this;c.on(a,function(){c.interactFlag||b.apply(c,arguments)})},bindCommandState:function(a,b,c){var d=this;a.on("interactchange",function(){if(d.interactFlag=!0,c){var a=this.queryCommandValue(b);a!=d.lastHandleCommandValue&&(c.call(d,a),d.lastHandleCommandValue=a)}d.setEnable(-1!==this.queryCommandState(b)),d.setActive(1===this.queryCommandState(b)),d.interactFlag=!1})}}),KityMinder.registerUI("axss",function(){function a(a){var b=document.createElement("div");b.innerHTML=a,$(b).find("script, iframe, link").remove();for(var c in b)0===c.indexOf("on")&&b.removeAttribute(c);return b.innerHTML}return a}),KityMinder.registerUI("widget/commandbutton",function(a){return{generate:function(b,c){var d=new FUI.Button({label:a.getLang("ui.command."+b)||a.getLang("ui."+b),text:a.getLang("ui.command."+b)||a.getLang("ui."+b),className:["command-widget","command-button",b]});return d.bindExecution("click",c||function(){a.execCommand(b)}),d.bindCommandState(a,b),d}}}),KityMinder.registerUI("widget/notice",function(a){function b(a,b){function c(){var b=a.text(),c=new RegExp("at.+"+o+".+\\:(\\d+)\\:(\\d+)\\)?","g");a.text(b.replace(c,function(a,b,c){var d={line:+b,column:+c},e=m.originalPositionFor(d),f=e.name;d={line:e.line,column:e.column},e=l.originalPositionFor(d),f=f||"<Anonymous>";var g="at "+f+" ("+e.source.replace("../","")+":"+e.line+":"+e.column+")";return-1!=g.indexOf("promise")&&(g="at <async> Promise."+f),g}))}if(o){if(l)return c();b.addClass("loading"),setTimeout(function(){b.removeClass("loading")},5e3);var d=document.createElement("script");d.onload=function(){Promise.all([$.pajax({url:o.replace("min.js","js.map"),dataType:"json"}),$.pajax({url:o.replace(".js",".map"),dataType:"json"})]).then(function(a){l=new window.sourceMap.SourceMapConsumer(a[0]),m=new window.sourceMap.SourceMapConsumer(a[1]),c(),b.removeClass("loading")})},d.src="lib/source-map.min.js",document.head.appendChild(d)}}function c(b,d,e){j.hasClass("show")||j.empty(),clearTimeout(c.ttl2),d?j.addClass("warn"):j.removeClass("warn");var f=a.getUI("menu/menu");j.css({top:f&&f.isVisible()?$("#main-menu .main-menu-level1").offset().top:$("#kityminder").offset().top+20}),j.append($("<p>").text(b)),j.addClass("show"),clearTimeout(c.ttl),e=e||(d?5e3:3e3),c.ttl=setTimeout(function(){j.removeClass("show"),c.ttl2=setTimeout(function(){j.empty()},1e3)},e)}function d(a){c(a,d)}function e(a){return a=a||new Error,"string"==typeof a&&(a=new Error(a)),a.getDetail?a:("undefined"!=typeof fio&&a instanceof fio.FileRequestError?(a.status?a.description=h.pcs_code[a.detail.error_code]:a.description=h.err_network,a.getDetail=function(){return JSON.stringify(a,null,4)}):"readyState"in a||(a.getDetail=function(){return a.stack||(new Error).stack}),a)}function f(c,d){1==arguments.length&&(d=c,c="unknown"),n.empty(),d=e(d);var j=$("<div>").addClass("error-content").appendTo(n);$("<h3>").text(h[c]||h.err_unknown).appendTo(j),$("<p>").text(d.message||d.description||h.unknownreason).appendTo(j);if(d.getDetail){var l=$("<div>").addClass("error-detail").append($('<a class="expander"></a>').text(a.getLang("ui.error_detail"))).appendTo(n),m=$("<div>").addClass("error-detail-wrapper").appendTo(l),o=$("<textarea>").attr("id","error-detail-content").text(d.getDetail()+"\n\n浏览器信息:"+navigator.userAgent).appendTo(m);b(o,m);var p=$("<button>").addClass("copy-and-feedback").text(a.getLang("ui.copy_and_feedback")).appendTo(m);p.attr("data-clipboard-target","error-detail-content"),g(p),i.get("show-error-detail")&&l.addClass("expanded")}return k.show(),k.getElement().style.top="180px",new Promise(function(a){f.resolve=a})}function g(b){if(window.ZeroClipboard){ZeroClipboard.config({swfPath:"lib/ZeroClipboard.swf",hoverClass:"hover",activeClass:"active"});var c=new window.ZeroClipboard(b);c.on("ready",function(){c.on("aftercopy",function(){k.hide(),a.getUI("topbar/feedback").click()})})}else b.remove()}var h=a.getLang("error_message"),i=a.getUI("memory"),j=$("<div>").addClass("notice-widget").appendTo("#content-wrapper"),k=($("<div>").addClass("error-mask"),new FUI.Dialog({width:500,height:"auto",prompt:!0,caption:h.title,className:"error-dialog"}).appendTo(document.getElementById("content-wrapper")));k.on("ok cancel",function(a){f.resolve&&f.resolve(a)});var l,m,n=$(k.getBodyElement()),o=function(){for(var a,b,c=[].slice.apply(document.getElementsByTagName("script"));a=c.pop();)if(b=/kityminder.*\.min\.js/.exec(a.src))return b[0];return!1}();return n.delegate(".error-detail a.expander","click",function(a){var b=$(a.target).closest(".error-detail").toggleClass("expanded"),c=b.hasClass("expanded");i.set("show-error-detail",c)}),{info:c,error:f,warn:d}}),KM.registerUI("widget/menutab",function(a){function b(b,c,d){var e=b.getButtons().length,f=b.appendTab({buttons:[{label:a.getLang("ui.menu."+c+"tab"),className:"tab-"+c}]});return d&&b.select(e),f[0].panel.getContentElement()}return{generate:b}}),KityMinder.registerUI("doc",function(a){function b(a,b){function c(a,b){for(var c=0;c in a&&c in b&&a[c]==b[c];)c++;return c in b?0:c}if("netdisk"==h.source){var d=a.split("/"),e=b.split("/"),f=h.path.split("/"),i=c(f,d);if(i){var j=e.concat(f.slice(i));h.path=j.join("/"),h.title=j.pop(),g.fire("docchange",h)}}}function c(b){if(l)return Promise.reject(new Error("doc was locked"));var c=b;return h=b,i=!0,a.importData(b.content,b.protocol).then(function(c){return b.title=b.title||a.getMinderTitle(),a.execCommand("camera",a.getRoot(),300),b.data=c,b.json=JSON.stringify(c),g.fire("docload",b),g.fire("docchange",b),b})["catch"](function(a){h=c,j.error("err_doc_resolve",a)}).then(function(b){return i=!1,b&&j.info(a.getLang("ui.load_success",b.title)),b})}function d(b){h=b,b.data=a.exportJson(),b.json=JSON.stringify(b.data),b.saved=!0,g.fire("docsave",b),g.fire("docchange",b)}function e(){return h}function f(b){return fio.user.current()?l?!1:b?h.saved:h.saved||window.confirm(a.getLang("ui.unsavedcontent","* "+h.title)):!0}var g=a.getUI("eve").setup({}),h={saved:!0},i=!1,j=a.getUI("widget/notice"),k=a.getUI("widget/netdiskfinder");k&&k.on("mv",b);var l=!1;return g.lock=function(){l=!0},g.unlock=function(){l=!1},setTimeout(function(){a.on("contentchange",function(){i||("netdisk"!=h.source?(h.title=a.getMinderTitle(),h.saved=!1):h.saved=h.json==JSON.stringify(a.exportJson()),g.fire("docchange",h))})},1e3),g.load=c,g.save=d,g.current=e,g.checkSaved=f,g}),KityMinder.registerUI("contextmenu",function(a){function b(a){return a.charAt(0).toUpperCase()+a.substr(1).toLowerCase()}function c(a,b){var c=a[0]-b[0],d=a[1]-b[1],e=Math.sqrt(c*c+d*d);return e}var d,e=kity.Browser.mac,f=$("<ul>").addClass("km-context-menu fui-popup-menu").appendTo("#content-wrapper");f.delegate("li","mousedown",function(b,c){var d=$(b.target).closest("li").data("menu");return d.fn?d.fn.call(a,a):d.command?a.execCommand(d.command):void 0}),$("#content-wrapper").on("contextmenu",function(a){a.preventDefault()}),$("#content-wrapper").on("mousedown",function(a){f.hide(),d=2==a.button?[a.pageX,a.pageY]:null}),a.on("mouseup",function(g){if(g.isRightMB()){g=g.originEvent;var h=c(d,[g.pageX,g.pageY]);if(!(isNaN(h)||h>5)){f.empty();var i=a.getContextMenu(),j=!0;if(i.forEach(function(c){var d=c.query||function(){return c.command&&0===a.queryCommandState(c.command)};if(d()){var g=a.getLang("ui.command."+c.command),h=$("<li>").addClass("fui-item").data("menu",c).appendTo(f),i=a.getCommandShortcutKey(c.command);i&&i.split("|").forEach(function(a){var c=$("<span>").addClass("shortcut").appendTo(h);a.split("+").forEach(function(a){var d=a.split("::");a=d.length>1?d[1]:d[0],$("<span>").addClass("shortcut-key "+a.toLowerCase()).text(b(a)).appendTo(c)}),e&&c.addClass("mac")}),h.append($("<div>").text(g).addClass("menu-label")),j=!1}c.divider&&!j&&($("<li>").addClass("divider").appendTo(f),j=!0)}),i.length){f.show();var k=g.pageX,l=g.pageY,m=f.outerWidth(),n=f.outerHeight(),o=document.body.clientWidth,p=document.body.clientHeight;k+m>o&&(k-=m),l+n>p&&(l-=n),f.offset({left:k,top:l})}}}})}),KityMinder.registerUI("nav",function(a){function b(b){function c(a){return(1-(a-g)/i)*j}function d(a){l.animate({y:c(a)},200)}var e=$("<div>").addClass("zoom-pan").appendTo(b),f=a.getOptions("zoom"),g=f[0],h=f[f.length-1],i=h-g,j=e.height(),k=$("<div>").addClass("origin").appendTo(e).css("y",c(100)),l=$("<div>").addClass("indicator").appendTo(e).css("y",c(100));return a.on("zoom",function(a){d(a.zoom)}),k.click(function(){a.execCommand("zoom",100)}),e}function c(){function b(){a.on("layout layoutallfinish",e),a.on("viewchange",f)}function c(){a.off("layout layoutallfinish",e),a.off("viewchange",f)}function d(){function b(b,c){var d=m;b.x=-b.x,b.y=-b.y;var e=a.getPaper().getViewPortMatrix();d=e.transformBox(d);var f=b.offset(d.width/2,d.height/2);a.getViewDragger().moveTo(f,c)}var c=!1;h.on("mousedown",function(a){c=!0,b(a.getPosition("top"),200),g.addClass("grab")}),h.on("mousemove",function(a){c&&b(a.getPosition("top"))}),$(window).on("mouseup",function(){c=!1,g.removeClass("grab")})}function e(){var b=a.getRenderContainer().getBoundaryBox();l=b;var c=30;h.setViewBox(b.x-c-.5,b.y-c-.5,b.width+2*c+1,b.height+2*c+1);var d=[],e=[];a.getRoot().traverse(function(a){var b=a.getLayoutBox();d.push("M",b.x,b.y,"h",b.width,"v",b.height,"h",-b.width,"z"),a.getConnection()&&a.parent&&a.parent.isExpanded()&&e.push(a.getConnection().getPathData())}),h.setStyle("background",a.getStyle("background")),d.length?i.fill(a.getStyle("root-background")).setPathData(d):i.setPathData(null),e.length?j.stroke(a.getStyle("connect-color"),"0.5%").setPathData(e):j.setPathData(null),f()}function f(){m=a.getViewDragger().getView(),k.setBox(m.intersect(l))}var g=$("<div>").addClass("preview-navigator").appendTo("#content-wrapper"),h=new kity.Paper(g[0]),i=h.put(new kity.Path),j=h.put(new kity.Path),k=h.put(new kity.Rect(100,100).stroke("red","1%")),l=new kity.Box,m=new kity.Box;return d(),g.show=function(){$.fn.show.call(this),b(),e(),f()},g.hide=function(){$.fn.hide.call(this),c()},window.u=e,g}function d(b){function c(){d.toggleClass("active").hasClass("active")?(b.show(),e.set("navigator-hidden",!1)):(b.hide(),e.set("navigator-hidden",!0))}var d=$("<div>").addClass("command-button nav-trigger");return d.append('<div class="fui-icon">'),d.click(c),d.attr("title",a.getLang("ui.navigator")),e.get("navigator-hidden")&&c(),c(),d}var e=a.getUI("memory"),f=$("<div>").addClass("nav-bar").appendTo("#content-wrapper"),g=a.getUI("widget/commandbutton"),h=(g.generate("zoom-in").appendTo(f[0]),b(f),g.generate("zoom-out").appendTo(f[0]),c());g.generate("hand").appendTo(f[0]),g.generate("camera",function(){a.execCommand("camera",a.getRoot(),600)}).appendTo(f[0]),d(h).appendTo(f)}),KityMinder.registerUI("topbar/moreservice",function(a){function b(){c.prependTo("#panel").moreService({button:{"float":"left",width:"40px",height:"40px","border-right":"1px solid rgba(255, 255, 255, .5)"}})}var c,d=$("<link>").attr("href","http://baiduoffice.duapp.com/public/assets/style/moreService.css").attr("rel","stylesheet");return $("head").append(d),$.getScript("http://baiduoffice.duapp.com/public/widget/moreService.js",b),c=$('<div id="moreservice"></div>')}),KityMinder.registerUI("menu/menu",function(a){function b(){k.css("display","block"),clearTimeout(h),h=setTimeout(function(){k.addClass("show"),i.fire("show")})}function c(){i.fire("hide"),k.removeClass("show"),a.getRenderTarget().focus(),h=setTimeout(function(){k.css("display","none")})}function d(){return k.hasClass("show")}function e(){$("#content-wrapper").hasClass("fullscreen")||(d()?c:b)()}function f(b,c){var d=j.generate(m,b,c);$("<h2></h2>").text(a.getLang("ui.menu."+b+"header")).appendTo(d);return d}function g(a,b){var c=f(a,b),d=(new FUI.Tabs).appendTo(c);return{$tabs:d,createSub:function(a,b){return j.generate(d,a,b)}}}var h,i=a.getUI("eve").setup({}),j=a.getUI("widget/menutab"),k=$("<div>").attr("id","main-menu").css("display","none").appendTo("#content-wrapper"),l=new FUI.Button({id:"main-menu-btn",label:a.getLang("ui.menu.mainmenutext")}).appendTo(document.getElementById("panel")),m=new FUI.Tabs({className:"main-menu-level1"}).appendTo(k[0]);return l.on("click",e),a.addShortcut("esc",e),i.show=b,i.hide=c,i.toggle=e,i.isVisible=d,i.createSub=f,i.createSubMenu=g,i.$panel=k,i.$button=l,i.$tabs=m,i}),KityMinder.registerUI("menu/header",function(a){var b=a.getUI("menu/menu"),c=$('<div class="main-menu-header"></div>').prependTo(b.$panel),d=$('<div class="main-menu-back-panel"></div>').appendTo(c),e=$('<div class="main-menu-title">众核脑图</div>').appendTo(c);new FUI.Button({className:"main-menu-back-button",label:a.getLang("ui.back")}).appendTo(d[0]).on("click",b.hide);return b.on("show",function(){var b=a.getUI("topbar/title");e.text(b.getTitle())}),c}),KityMinder.registerUI("menu/save/save",function(a){return a.getUI("menu/menu").createSubMenu("save")}),KityMinder.registerUI("menu/save/download",function(a){function b(b){var e=a.getMinderTitle()+b.fileExtension,g=b.mineType||"text/plain";f.addClass("loading");var h={download:!0,filename:e};a.exportData(b.name,h).then(function(a){if("freemind"!=b.name){switch(b.dataType){case"text":return c(d(g,a),e,"text");case"base64":return c(a,e,"base64");case"blob":return null}return null}})["catch"](function(b){var c=a.getUI("widget/notice");return c.error("err_download",b)}).then(function(a){f.removeClass("loading")})}function c(b,c,d){var e=1e5*+new Date+Math.floor(99999*Math.random());e=e.toString(36);var f=new Promise(function(a,b){function c(){return-1!=document.cookie.indexOf(e+"=1")?a([e,d]):(++d>f&&a([e,d]),void setTimeout(c,g))}var d=0,f=30,g=1e3;setTimeout(c,g)}),g=b.split(",")[1],h=$("<form></form>").attr({action:"download.php",method:"POST","accept-charset":"utf-8"});$("<input />").attr({name:"content",type:"hidden",value:decodeURIComponent(g)}).appendTo(h),$("<input />").attr({name:"type",type:"hidden",value:d}).appendTo(h),$("<input />").attr({name:"filename",type:"hidden",value:c}).appendTo(h);kity.Browser.ie&&$('<input name="iehack" value="1" />').appendTo(h),$('<input name="stamp" />').val(e).appendTo(h);var i=a.getUI("menu/save/netdisk");return i&&(i.mute=!0,setTimeout(function(){i.mute=!1},1e3)),h.appendTo("body").submit().remove(),f}function d(a,b){return"data:"+a+"; utf-8,"+encodeURIComponent(b)}var e=(a.getUI("menu/menu"),a.getUI("menu/save/save")),f=$(e.createSub("download")).addClass("download-panel"),g=($("<h2></h2>").text(a.getLang("ui.menu.downloadheader")).appendTo(f),$("<ul>").addClass("download-list").appendTo(f)),h=[];a.getSupportedProtocols().forEach(function(a){a.encode&&h.push(a)}),h.forEach(function(a){$("<li>").addClass(a.name).text(a.fileDescription+" ("+a.fileExtension+")").data("protocol",a).appendTo(g)}),g.delegate("li","click",function(a){var c=$(a.target).data("protocol");f.hasClass("loading")||b(c)})}),KityMinder.registerUI("menu/share/view",function(a){function b(){function b(b){if(b.error)return g.error("err_share_data",b.error);var c=b.shareMinder.data,d=b.path?b.path.split("/").pop():b.title;return d=d||JSON.parse(c).data.text,d=a.getLang("ui.shared_file_title",d),f.load({title:d,source:"share",content:c,protocol:"json",saved:!0,ownerId:b.uid,ownerName:b.uname})}var d=/(?:shareId|share_id)=(\w+)([&#]|$)/,e=d.exec(window.location)||d.exec(document.referrer);if(!e)return Promise.resolve(null);c=e[1];var h=$(a.getRenderTarget()).addClass("loading");return $.pajax({url:"http://naotu.baidu.com/share.php",data:{action:"find",id:c},dataType:"json"}).then(b)["catch"](function(a){g.error("err_share_data",a)}).then(function(){a.disable(),a.execCommand("hand",!0),h.removeClass("loading")})}var c,d=a.getUI("menu/menu"),e=a.getUI("menu/save/save"),f=a.getUI("doc"),g=a.getUI("widget/notice");return d.$tabs.select(0),e.$tabs.select(0),a.on("uiready",function(){var b=a.getUI("topbar/quickvisit"),d=b.add("editshare","right");d.on("click",function(){c&&window.open("edit.html?shareId="+c)}),b.$new.remove(),b.$save.remove(),b.$share.remove()}),{ready:b()}}),KityMinder.registerUI("menu/help/help",function(a){function b(b,d){function e(a){a=a.split("z").map(function(a){return parseInt(a,35)});var b=305,c=[],d=0;for(c.push(a[d]^b);void 0!==a[++d];)c.push(a[d]^c[d-1]);return String.fromCharCode.apply(null,c)}var g=jhtmls.render(b);f.html(g({lang:a.getLang("ui"),minder:a})),f.find(".shortcut-content").html(c(d)),kity.Browser.mac&&f.addClass("mac"),f.removeClass("loading"),f.find(".km-version").text(KityMinder.version);var h=0,i={1:"gctz8m5z8cpz61kz5vvz3uuz1a3az1hwtzbqdz124y",10:"gctz8m5z8cpz9tdz1dz2p1zcn3zalez6d3z2f7zbqdz124y",100:"hctz77uzd0az123kzr6u",1000:"gctzbs8z3kpz8nzclpz8nrzw8z8wwz3syz5oyzoiuz0zi7yzbqz7nbz77uzd0az123kzuu5z2f9z8ny",1000000:"96z1zjzoz27z2kz2oz23z22zbz2izrzoz2az5z27zpz2az3z24z3zbznzvzfzdzczez25z2cznzhzvz25z2dz2cz1z25z25z4z1vz29z1vz25z2ez2cz2nzgz1vz2lzizbzpzazjziz2nzdz1vz22z2z24z23z23zezez22z2ezsz25z22z3zbzbz25z2hzsz3z3z23z23z1vz1vzuzuziziz22z2ozmz22z5z27zpzpz22"};f.delegate(".shortcut-key","click",function(){var a=i[++h];a&&(window.alert(e(a)),h>1e6&&console.log(a))})}function c(a){function b(a){var b=d.exec(a);if(b)return f&&(c+="</section>"),c+="<section><h3>"+b[1]+"</h3>",void(f=!0);if(b=e.exec(a)){var g=b[1],h=b[2];return c+='<div class="shortcut-group"><span class="shortcut">',c+=g.replace(/\`(.+?)\`/g,function(a,b){return'<span class="shortcut-key '+b.toLowerCase()+'" title="'+b+'">'+b+"</span>"}),c+="</span>",c+='<span class="description">'+h+"</span>",void(c+="</div>")}}var c="",d=/##\s(.+)$/,e=/(.+?)\:\s(.+)$/,f=!1;return a.split("\n").forEach(b),f&&(c+="</section>"),c}var d=a.getUI("menu/menu"),e=$(d.createSub("help")),f=$('<div id="help-panel">').appendTo(e).addClass("loading");Promise.all([$.pajax({url:"static/pages/helpcontent.html",dataType:"text"}),$.pajax({url:"static/pages/operation."+a.getOptions("lang")+".txt",dataType:"text"})]).then(function(a){var c=a[0],d=a[1];b(c,d)})}),KityMinder.registerUI("menu/help/feedback",function(a){function b(b){var c=jhtmls.render(b);e.html(c({lang:a.getLang("ui"),minder:a})),e.on("click contextmenu keydown",function(a){a.stopPropagation()}),e.removeClass("loading"),e.find(".km-version").text(KityMinder.version)}var c=a.getUI("menu/menu"),d=$(c.createSub("feedback")),e=$('<div id="feedback-panel">').appendTo(d).addClass("loading");$.pajax({url:"static/pages/feedback.html",dataType:"text"}).then(b)}),KityMinder.registerUI("topbar/quickvisit",function(a){function b(b,d){
  22. var e=$('<a class="quick-visit-button"></a>').text(a.getLang("ui.quickvisit."+b)).attr("title",a.getLang("ui.quickvisit."+b)).addClass(b);return d?c.push(e):e.appendTo("#panel"),e}var c=[],d=b("new"),e=b("save"),f=b("share"),g={$new:d,$save:e,$share:f};return a.on("uiready",function(){function b(){var b=a.getUI("doc");b.checkSaved()&&b.load({content:{template:"default",version:KityMinder.version,data:{text:a.getLang("maintopic")}},saved:!0})}function h(){a.getUI("menu/save/netdisk").quickSave()}function i(){var b=a.getUI("menu/menu");b.$tabs.select(3),b.show()}for(;c.length;)$("#panel #search").after(c.shift());d.click(b),e.click(h),f.click(i),a.addShortcut("ctrl+alt+n",b),a.addShortcut("ctrl+s",h),a.addShortcut("ctrl+alt+s",i),a.addShortcut("ctrl+shift+s",function(){var b=a.getUI("menu/menu");b.$tabs.select(2),b.show()}),g.ready=!0,g.quickNew=b,g.quickSave=h,g.quickShare=i}),g.add=b,g}),KityMinder.registerUI("topbar/feedback",function(a){function b(){var b=a.getUI("menu/menu");b.$tabs.select(5),b.show()}var c=a.getUI("topbar/quickvisit"),d=c.add("feedback","right");return d.click(b),a.addShortcut("f1",b),d}),KityMinder.registerUI("topbar/search",function(a){function b(){f=[],a.getRoot().traverse(function(a){f.push(a)})}function c(b){function d(b,c){var d=a.getUI("ribbon/idea/notepreview");d&&d.hide(),a.execCommand("camera",b,50),setTimeout(function(){a.select(b,!0),b.isExpanded()||a.execCommand("expand",!0),c&&d&&d.preview(b,c)},60)}if(!/\S/.exec(b))return e[0].focus(),void e[0].select();b=b.toLowerCase();var g=c.lastKeyword!=b;c.lastKeyword=b;for(var h=g?0:c.lastIndex+1||0,i=h+f.length-1,j=h;i>=j;j++){var k=f[j%f.length],l=k.getText().toLowerCase();if(-1!=l.indexOf(b)){d(k),c.lastIndex=j;break}var m=k.getData("note");if(m&&-1!=m.indexOf(b)){d(k,b),c.lastIndex=j;break}}}var d=$('<div id="search"><input type="search" /></div>').appendTo("#panel"),e=d.find("input");a.addShortcut("ctrl+f",function(){e[0].focus(),e[0].select()}),e.on("keydown",function(a){13==a.keyCode&&c(e.val()),27==a.keyCode&&e[0].blur()});var f;return a.on("contentchange",b),d}),KityMinder.registerUI("topbar/title",function(a){function b(){function b(){setTimeout(function(){j=!1})}function c(){d(),b()}function k(){var f=m.val(),i=fio.file.anlysisPath(n),j=fio.file.anlysisPath(f);if(!j.name.length)return c();f=j.name+i.extension;var k=fio.file.anlysisPath(o).parentPath+f;return k==o?c():(e.addClass("loading"),void fio.file.move({path:o,newPath:k}).then(function(){l.path=k,l.title=f,g.fire("mv",o,k),h.info(a.getLang("ui.rename_success",f))})["catch"](function(a){h.error("err_rename",a)}).then(function(){e.removeClass("loading"),d(),b()}))}if(i&&!j){var l=f.current(),m=$("<input>").width(e.find(".title-content").width()),n=l.title,o=l.path;m.val(n),setTimeout(function(){m[0].select()}),e.addClass("rename-mode"),e.empty(),e.append(m),j=!0,m.on("keydown",function(a){13==a.keyCode?k():27==a.keyCode&&(c(),a.stopPropagation())}).on("blur",c)}}function c(a){i=a,a?e.addClass("rename-enabled"):e.removeClass("rename-enabled")}function d(){function b(c){b.lastValue!=c&&(c=c||a.getLang("ui.untitleddoc"),e.empty().append($('<span class="title-content"></span>').text(c)),document.title=c?c+" - 众核脑图":"众核脑图",b.lastValue=c)}var d=f.current();b(d.saved?d.title:"* "+d.title),c("netdisk"==d.source&&d.saved)}var e=$("<h1>").appendTo("#panel"),f=a.getUI("doc"),g=a.getUI("widget/netdiskfinder"),h=a.getUI("widget/notice"),i=!1,j=!1;return f.on("docchange",d),e.on("click",b),d(),{$title:e,getTitle:function(){return f.current().title}}}),KityMinder.registerUI("ribbon/idea/notepreview",function(a){function b(a,b){var d=a.getRenderer("NoteIconRenderer").getRenderShape(),g=d.getRenderBox("screen"),h=a.getData("note");e[0].scrollTop=0;var i=marked(h);b&&(i=i.replace(new RegExp("("+b+")","ig"),'<span class="highlight">$1</span>')),e.html(c(i));var j=$("#content-wrapper").width(),k=$("#content-wrapper").height(),l=e.outerWidth(),m=e.outerHeight(),n=g.cx-l/2,o=g.bottom+10;0>n&&(n=10),n+l>j&&(n=j-l-10),o+m>k&&(o=g.top-m-10),e.css({left:Math.round(n),top:Math.round(o)}),e.show();var p=e[0].querySelector(".highlight");p&&p.scrollIntoView(),f=!0}var c=a.getUI("axss");marked.setOptions({gfm:!0,breaks:!0});var d,e=$('<div id="note-previewer"></div>').appendTo("#content-wrapper");a.on("shownoterequest",function(a){d=setTimeout(function(){b(a.node)},300)}),a.on("hidenoterequest",function(){clearTimeout(d)});var f=!1;return $("#kityminder").on("mousedown mousewheel DOMMouseScroll",function(){f&&(e.fadeOut(),f=!1)}),e.hide(),e.delegate("a","click",function(b){var c=$(b.target).closest("a"),d=c.prop("href");window.confirm(a.getLang("ui.redirect",d))&&window.open(d,"_blank"),b.preventDefault()}),{preview:b,hide:function(){e.hide()}}})}(window);
  23. //# sourceMappingURL=kityminder.share.min.map