/*!
 * ZUI: Standard edition - v1.6.0 - 2017-03-16
 * http://zui.sexy
 * GitHub: https://github.com/easysoft/zui.git 
 * Copyright (c) 2017 cnezsoft.com; Licensed MIT
 */
/*! Some code copy from Bootstrap v3.0.0 by @fat and @mdo. (Copyright 2013 Twitter, Inc. Licensed under http://www.apache.org/licenses/)*/
!function(t,e){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var i=0;t.zui({uuid:function(){return 1e3*(new Date).getTime()+i++%1e3},callEvent:function(e,i,o){if(t.isFunction(e)){void 0!==o&&(e=t.proxy(e,o));var n=e(i);return i&&(i.result=n),!(void 0!==n&&!n)}return 1},clientLang:function(){var i,o=e.config;if("undefined"!=typeof o&&o.clientLang&&(i=o.clientLang),!i){var n=t("html").attr("lang");i=n?n:navigator.userLanguage||navigator.userLanguage||"zh_cn"}return i.replace("-","_").toLowerCase()},strCode:function(t){var e=0;if(t&&t.length)for(var i=0;i<t.length;++i)e+=i*t.charCodeAt(i);return e}}),t.fn.callEvent=function(e,i,o){var n=t(this),a=e.indexOf(".zui."),s=0>a?e:e.substring(0,a),r=t.Event(s,i);if(void 0===o&&a>0&&(o=n.data(e.substring(a+1))),o&&o.options){var l=o.options[s];t.isFunction(l)&&t.zui.callEvent(l,r,o)}return n.trigger(r),r}}(jQuery,window),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),+function(t){"use strict";var e=function(i,o){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,o),this.isLoading=!1};e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",a=o.data();e+="Text",a.resetText||o.data("resetText",o[n]()),o[n](a[e]||this.options[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i))},this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=function(i){return this.each(function(){var o=t(this),n=o.data("zui.button"),a="object"==typeof i&&i;n||o.data("zui.button",n=new e(this,a)),"toggle"==i?n.toggle():i&&n.setState(i)})},t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.zui.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle"),e.preventDefault()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",o=function(i){t(i).on("click",e,this.close)};o.prototype.close=function(e){function o(){s.trigger("closed."+i).remove()}var n=t(this),a=n.attr("data-target");a||(a=n.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var s=t(a);e&&e.preventDefault(),s.length||(s=n.hasClass("alert")?n:n.parent()),s.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,o).emulateTransitionEnd(150):o())};var n=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var n=t(this),a=n.data(i);a||n.data(i,a=new o(this)),"string"==typeof e&&a[e].call(n)})},t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click."+i+".data-api",e,o.prototype.close)}(window.jQuery),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,o=i.closest("ul:not(.dropdown-menu)"),n=i.attr("data-target")||i.attr("data-tab");if(n||(n=i.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=o.find(".active:last a")[0],s=t.Event("show."+e,{relatedTarget:a});if(i.trigger(s),!s.isDefaultPrevented()){var r=t(n);this.activate(i.parent("li"),o),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,o){function n(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),o&&o()}var a=i.find("> .active"),s=o&&t.support.transition&&a.hasClass("fade");s?a.one(t.support.transition.end,n).emulateTransitionEnd(150):n(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=function(o){return this.each(function(){var n=t(this),a=n.data(e);a||n.data(e,a=new i(this)),"string"==typeof o&&a[o]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var o=this.$parent&&this.$parent.find(".in");if(o&&o.length){var n=o.data(e);if(n&&n.transitioning)return;o.collapse("hide"),n||o.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return s.call(this);var r=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,t.proxy(s,this)).emulateTransitionEnd(350)[a](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var o=this.dimension();this.$element[o](this.$element[o]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[o](0).one(t.support.transition.end,t.proxy(n,this)).emulateTransitionEnd(350):n.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var o=t.fn.collapse;t.fn.collapse=function(o){return this.each(function(){var n=t(this),a=n.data(e),s=t.extend({},i.DEFAULTS,n.data(),"object"==typeof o&&o);a||n.data(e,a=new i(this,s)),"string"==typeof o&&a[o]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=o,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var o,n=t(this),a=n.attr("data-target")||i.preventDefault()||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""),s=t(a),r=s.data(e),l=r?"toggle":n.data(),d=n.attr("data-parent"),h=d&&t(d);r&&r.transitioning||(h&&h.find('[data-toggle=collapse][data-parent="'+d+'"]').not(n).addClass("collapsed"),n[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),s.collapse(l)})}(window.jQuery),function(t,e){"use strict";var i=1200,o=992,n=768,a={desktop:"screen-desktop",desktopLg:"screen-desktop-wide",tablet:"screen-tablet",phone:"screen-phone",isMobile:"device-mobile",isDesktop:"device-desktop",touch:"is-touchable"},s=e(t),r=function(){var t=s.width();e("html").toggleClass(a.desktop,t>=o&&i>t).toggleClass(a.desktopLg,t>=i).toggleClass(a.tablet,t>=n&&o>t).toggleClass(a.phone,n>t).toggleClass(a.isMobile,o>t).toggleClass(a.touch,"ontouchstart"in document.documentElement).toggleClass(a.isDesktop,t>=o)};s.resize(r),r()}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低，无法体验所有功能，建议升级或者更换浏览器。 <a href="http://browsehappy.com/" target="_blank" class="alert-link">了解更多...</a>',zh_tw:'您的瀏覽器版本過低，無法體驗所有功能，建議升級或者更换瀏覽器。<a href="http://browsehappy.com/" target="_blank" class="alert-link">了解更多...</a>',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. <a href="http://browsehappy.com/" target="_blank" class="alert-link">Learn more...</a>'},i=function(){var t=this.isIE()||this.isIE10()||!1;if(t)for(var e=10;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",8>e).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",9>e).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",10>e)},i.prototype.tip=function(i){var o=t("#browseHappyTip");o.length||(o=t('<div id="browseHappyTip" class="alert alert-dismissable alert-danger-inverse alert-block" style="position: relative; z-index: 99999"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><div class="container"><div class="content text-center"></div></div></div>'),o.prependTo("body")),o.find(".content").html(i||this.browseHappyTip||e[t.zui.clientLang()||"zh_cn"])},i.prototype.isIE=function(t){if(10===t)return this.isIE10();var e=document.createElement("b");return e.innerHTML="<!--[if IE "+(t||"")+"]><i></i><![endif]-->",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return!1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(){"use strict";Date.ONEDAY_TICKS=864e5,Date.prototype.format||(Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S+":this.getMilliseconds()};/(y+)/i.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var i in e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t}),Date.prototype.addMilliseconds||(Date.prototype.addMilliseconds=function(t){return this.setTime(this.getTime()+t),this}),Date.prototype.addDays||(Date.prototype.addDays=function(t){return this.addMilliseconds(t*Date.ONEDAY_TICKS),this}),Date.prototype.clone||(Date.prototype.clone=function(){var t=new Date;return t.setTime(this.getTime()),t}),Date.isLeapYear||(Date.isLeapYear=function(t){return t%4===0&&t%100!==0||t%400===0}),Date.getDaysInMonth||(Date.getDaysInMonth=function(t,e){return[31,Date.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}),Date.prototype.isLeapYear||(Date.prototype.isLeapYear=function(){return Date.isLeapYear(this.getFullYear())}),Date.prototype.clearTime||(Date.prototype.clearTime=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this}),Date.prototype.getDaysInMonth||(Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())}),Date.prototype.addMonths||(Date.prototype.addMonths=function(t){var e=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+t),this.setDate(Math.min(e,this.getDaysInMonth())),this}),Date.prototype.getLastWeekday||(Date.prototype.getLastWeekday=function(t){t=t||1;for(var e=this.clone();e.getDay()!=t;)e.addDays(-1);return e.clearTime(),e}),Date.prototype.isSameDay||(Date.prototype.isSameDay=function(t){return t.toDateString()===this.toDateString()}),Date.prototype.isSameWeek||(Date.prototype.isSameWeek=function(t){var e=this.getLastWeekday(),i=e.clone().addDays(7);return t>=e&&i>t}),Date.prototype.isSameYear||(Date.prototype.isSameYear=function(t){return this.getFullYear()===t.getFullYear()})}(),function(){"use strict";String.prototype.format||(String.prototype.format=function(t){var e=this;if(arguments.length>0){var i;if(arguments.length<=2&&"object"==typeof t)for(var o in t)void 0!==t[o]&&(i=new RegExp("("+(arguments[1]?arguments[1].replace("0",o):"{"+o+"}")+")","g"),e=e.replace(i,t[o]));else for(var n=0;n<arguments.length;n++)void 0!==arguments[n]&&(i=new RegExp("({["+n+"]})","g"),e=e.replace(i,arguments[n]))}return e}),String.prototype.isNum||(String.prototype.isNum=function(t){if(null!==t){var e,i;return i=/\d*/i,e=t.match(i),e==t?!0:!1}return!1})}(),/*!
 * jQuery resize event - v1.1
 * http://benalman.com/projects/jquery-resize-plugin/
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * MIT & GPL http://benalman.com/about/license/
 */
function(t,e,i){"$:nomunge";function o(){n=e[r](function(){a.each(function(){var e=t(this),i=e.width(),o=e.height(),n=t.data(this,d);(i!==n.w||o!==n.h)&&e.trigger(l,[n.w=i,n.h=o])}),o()},s[h])}var n,a=t([]),s=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",d=l+"-special-event",h="delay",c="throttleWindow";s[h]=250,s[c]=!0,t.event.special[l]={setup:function(){if(!s[c]&&this[r])return!1;var e=t(this);a=a.add(e),t.data(this,d,{w:e.width(),h:e.height()}),1===a.length&&o()},teardown:function(){if(!s[c]&&this[r])return!1;var e=t(this);a=a.not(e),e.removeData(d),a.length||clearTimeout(n)},add:function(e){function o(e,o,a){var s=t(this),r=t.data(this,d)||{};r.w=o!==i?o:s.width(),r.h=a!==i?a:s.height(),n.apply(this,arguments)}if(!s[c]&&this[r])return!1;var n;return t.isFunction(e)?(n=e,o):(n=e.handler,void(e.handler=o))}}}(jQuery,this),+function(t){"use strict";function e(o,n){var a,s=t.proxy(this.process,this);this.$element=t(t(o).is("body")?window:o),this.$body=t("body"),this.$scrollElement=this.$element.on("scroll."+i+".data-api",s),this.options=t.extend({},e.DEFAULTS,n),this.selector||(this.selector=(this.options.target||(a=t(o).attr("href"))&&a.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a"),this.offsets=t([]),this.targets=t([]),this.activeTarget=null,this.refresh(),this.process()}var i="zui.scrollspy";e.DEFAULTS={offset:10},e.prototype.refresh=function(){var e=this.$element[0]==window?"offset":"position";this.offsets=t([]),this.targets=t([]);var i=this;this.$body.find(this.selector).map(function(){var o=t(this),n=o.data("target")||o.attr("href"),a=/^#./.test(n)&&t(n);return a&&a.length&&a.is(":visible")&&[[a[e]().top+(!t.isWindow(i.$scrollElement.get(0))&&i.$scrollElement.scrollTop()),n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){i.offsets.push(this[0]),i.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,o=i-this.$scrollElement.height(),n=this.offsets,a=this.targets,s=this.activeTarget;if(e>=o)return s!=(t=a.last()[0])&&this.activate(t);if(s&&e<=n[0])return s!=(t=a[0])&&this.activate(t);for(t=n.length;t--;)s!=a[t]&&e>=n[t]&&(!n[t+1]||e<=n[t+1])&&this.activate(a[t])},e.prototype.activate=function(e){this.activeTarget=e,t(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var o=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',n=t(o).parents("li").addClass("active");n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate."+i)};var o=t.fn.scrollspy;t.fn.scrollspy=function(o){return this.each(function(){var n=t(this),a=n.data(i),s="object"==typeof o&&o;a||n.data(i,a=new e(this,s)),"string"==typeof o&&a[o]()})},t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=o,this},t(window).on("load",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);e.scrollspy(e.data())})})}(jQuery),function(t,e){"use strict";var i,o,n="localStorage",a="page_"+t.location.pathname+t.location.search,s=function(){this.slience=!0;try{n in t&&t[n]&&t[n].setItem&&(this.enable=!0,i=t[n])}catch(s){}this.enable||(o={},i={getLength:function(){var t=0;return e.each(o,function(){t++}),t},key:function(t){var i,n=0;return e.each(o,function(e){return n===t?(i=e,!1):void n++}),i},removeItem:function(t){delete o[t]},getItem:function(t){return o[t]},setItem:function(t,e){o[t]=e},clear:function(){o={}}}),this.storage=i,this.page=this.get(a,{})};s.prototype.pageSave=function(){if(e.isEmptyObject(this.page))this.remove(a);else{var t,i=[];for(t in this.page){var o=this.page[t];null===o&&i.push(t)}for(t=i.length-1;t>=0;t--)delete this.page[i[t]];this.set(a,this.page)}},s.prototype.pageRemove=function(t){"undefined"!=typeof this.page[t]&&(this.page[t]=null,this.pageSave())},s.prototype.pageClear=function(){this.page={},this.pageSave()},s.prototype.pageGet=function(t,e){var i=this.page[t];return void 0===e||null!==i&&void 0!==i?i:e},s.prototype.pageSet=function(t,i){e.isPlainObject(t)?e.extend(!0,this.page,t):this.page[this.serialize(t)]=i,this.pageSave()},s.prototype.check=function(){if(!this.enable&&!this.slience)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},s.prototype.length=function(){return this.check()?i.getLength?i.getLength():i.length:0},s.prototype.removeItem=function(t){return i.removeItem(t),this},s.prototype.remove=function(t){return this.removeItem(t)},s.prototype.getItem=function(t){return i.getItem(t)},s.prototype.get=function(t,e){var i=this.deserialize(this.getItem(t));return"undefined"!=typeof i&&null!==i||"undefined"==typeof e?i:e},s.prototype.key=function(t){return i.key(t)},s.prototype.setItem=function(t,e){return i.setItem(t,e),this},s.prototype.set=function(t,e){return void 0===e?this.remove(t):(this.setItem(t,this.serialize(e)),this)},s.prototype.clear=function(){return i.clear(),this},s.prototype.forEach=function(t){for(var e=this.length(),o=e-1;o>=0;o--){var n=i.key(o);t(n,this.get(n))}return this},s.prototype.getAll=function(){var t={};return this.forEach(function(e,i){t[e]=i}),t},s.prototype.serialize=function(t){return"string"==typeof t?t:JSON.stringify(t)},s.prototype.deserialize=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t||void 0}},e.zui({store:new s})}(window,jQuery),function(t,e){"use strict";var i="zui.draggable",o={container:"body",move:!0},n=0,a=function(e,i){var a=this;a.$=t(e),a.id=n++,a.options=t.extend({},o,a.$.data(),i),a.init()};a.DEFAULTS=o,a.NAME=i,a.prototype.init=function(){var o,n,a,s,r,l=this,d=l.$,h="before",c="drag",p="finish",f="."+i+"."+l.id,u="mousedown"+f,g="mouseup"+f,m="mousemove"+f,v=l.options,y=v.selector,b=v.handle,w=d,C=function(t){var e=t.pageX,i=t.pageY;r=!0;var n={left:e-a.x,top:i-a.y};w.removeClass("drag-ready").addClass("dragging"),v.move&&w.css(n),v[c]&&v[c]({event:t,element:w,startOffset:a,pos:n,offset:{x:e-o.x,y:i-o.y},smallOffset:{x:e-s.x,y:i-s.y}}),s.x=e,s.y=i,v.stopPropagation&&t.stopPropagation()},$=function(i){if(t(e).off(f),!r)return void w.removeClass("drag-ready");var n={left:i.pageX-a.x,top:i.pageY-a.y};w.removeClass("drag-ready dragging"),v.move&&w.css(n),v[p]&&v[p]({event:i,element:w,startOffset:a,pos:n,offset:{x:i.pageX-o.x,y:i.pageY-o.y},smallOffset:{x:i.pageX-s.x,y:i.pageY-s.y}}),i.preventDefault(),v.stopPropagation&&i.stopPropagation()},x=function(i){var l=t(this);if(y&&(w=b?l.closest(y):l),v[h]){var d=v[h]({event:i,element:w});if(d===!1)return}var c=t(v.container),p=w.offset();n=c.offset(),o={x:i.pageX,y:i.pageY},a={x:i.pageX-p.left+n.left,y:i.pageY-p.top+n.top},s=t.extend({},o),r=!1,w.addClass("drag-ready"),i.preventDefault(),v.stopPropagation&&i.stopPropagation(),t(e).on(m,C).on(g,$)};b?d.on(u,b,x):y?d.on(u,y,x):d.on(u,x)},a.prototype.destroy=function(){var o="."+i+"."+this.id;this.$.off(o),t(e).off(o),this.$.data(i,null)},t.fn.draggable=function(e){return this.each(function(){var o=t(this),n=o.data(i),s="object"==typeof e&&e;n||o.data(i,n=new a(this,s)),"string"==typeof e&&n[e]()})},t.fn.draggable.Constructor=a}(jQuery,document),function(t,e,i){"use strict";var o="zui.droppable",n={target:".droppable-target",deviation:5,sensorOffsetX:0,sensorOffsetY:0},a=0,s=function(e,i){var o=this;o.id=a++,o.$=t(e),o.options=t.extend({},n,o.$.data(),i),o.init()};s.DEFAULTS=n,s.NAME=o,s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},s.prototype.init=function(){var n,a,s,r,l,d,h,c,p,f,u,g,m,v=this,y=v.$,b=v.options,w=b.deviation,C="."+o+"."+v.id,$="mousedown"+C,x="mouseup"+C,T="mousemove"+C,k=b.selector,D=b.handle,E=b.flex,S=b.container,z=y,I=!1,j=S?t(b.container).first():k?y:t("body"),L=function(e){if(I&&(u={left:e.pageX,top:e.pageY},!(i.abs(u.left-c.left)<w&&i.abs(u.top-c.top)<w))){if(null===s){var o=j.css("position");"absolute"!=o&&"relative"!=o&&"fixed"!=o&&(d=o,j.css("position","relative")),s=z.clone().removeClass("drag-from").addClass("drag-shadow").css({position:"absolute",width:z.outerWidth(),transition:"none"}).appendTo(j),z.addClass("dragging"),v.trigger("start",{event:e,element:z})}var h={left:u.left-f.left,top:u.top-f.top},m={left:h.left-p.left,top:h.top-p.top};s.css(m),t.extend(g,u);var y=!1;r=!1,E||n.removeClass("drop-to");var C=null;if(n.each(function(){var e=t(this),i=e.offset(),o=e.outerWidth(),n=e.outerHeight(),a=i.left+b.sensorOffsetX,s=i.top+b.sensorOffsetY;return u.left>a&&u.top>s&&u.left<a+o&&u.top<s+n&&(C&&C.removeClass("drop-to"),C=e,!b.nested)?!1:void 0}),C){r=!0;var $=C.data("id");z.data("id")!=$&&(l=!1),(null===a||a.data("id")!==$&&!l)&&(y=!0),a=C,E&&n.removeClass("drop-to"),a.addClass("drop-to")}E?null!==a&&a.length&&(r=!0):(z.toggleClass("drop-in",r),s.toggleClass("drop-in",r)),v.trigger("drag",{event:e,isIn:r,target:a,element:z,isNew:y,selfTarget:l,clickOffset:f,offset:h,position:{left:h.left-p.left,top:h.top-p.top},mouseOffset:u}),e.preventDefault()}},A=function(i){if(t(e).off(C),clearTimeout(m),I){if(I=!1,d&&j.css("position",d),null===s)return z.removeClass("drag-from"),void v.trigger("always",{event:i,cancel:!0});r||(a=null);var o=!0;u=i?{left:i.pageX,top:i.pageY}:g;var h={left:u.left-f.left,top:u.top-f.top},c={left:u.left-g.left,top:u.top-g.top};g.left=u.left,g.top=u.top;var y={event:i,isIn:r,target:a,element:z,isNew:!l&&null!==a,selfTarget:l,offset:h,mouseOffset:u,position:{left:h.left-p.left,top:h.top-p.top},lastMouseOffset:g,moveOffset:c};o=v.trigger("beforeDrop",y),o&&r&&v.trigger("drop",y),n.removeClass("drop-to"),z.removeClass("dragging").removeClass("drag-from"),s.remove(),s=null,v.trigger("finish",y),v.trigger("always",y),i&&i.preventDefault()}},O=function(i){var o=t(this);k&&(z=D?o.closest(k):o),z.hasClass("drag-shadow")||b.before&&b.before({event:i,element:z})===!1||(I=!0,n=t.isFunction(b.target)?b.target(y):j.find(b.target),a=null,s=null,r=!1,l=!0,d=null,h=z.offset(),p=j.offset(),c={left:i.pageX,top:i.pageY},g=t.extend({},c),f={left:c.left-h.left,top:c.top-h.top},z.addClass("drag-from"),t(e).on(T,L).on(x,A),m=setTimeout(function(){t(e).on($,A)},10),i.preventDefault())};D?y.on($,D,O):k?y.on($,k,O):y.on($,O)},s.prototype.destroy=function(){var i="."+o+"."+this.id;this.$.off(i),t(e).off(i),this.$.data(o,null)},s.prototype.reset=function(){this.destroy(),this.init()},t.fn.droppable=function(e){return this.each(function(){var i=t(this),n=i.data(o),a="object"==typeof e&&e;n||i.data(o,n=new s(this,a)),"string"==typeof e&&n[e]()})},t.fn.droppable.Constructor=s}(jQuery,document,Math),+function(t){"use strict";function e(e,n,a){return this.each(function(){var s=t(this),r=s.data(i),l=t.extend({},o.DEFAULTS,s.data(),"object"==typeof e&&e);r||s.data(i,r=new o(this,l)),"string"==typeof e?r[e](n,a):l.show&&r.show(n,a)})}var i="zui.modal",o=function(e,o){this.options=o,this.$body=t(document.body),this.$element=t(e),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,"undefined"==typeof this.options.moveable&&(this.options.moveable=this.$element.hasClass("modal-moveable")),this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded."+i)},this))};o.VERSION="3.2.0",o.TRANSITION_DURATION=300,o.BACKDROP_TRANSITION_DURATION=150,o.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"},o.prototype.toggle=function(t,e){return this.isShown?this.hide():this.show(t,e)},o.prototype.ajustPosition=function(e){if("undefined"==typeof e&&(e=this.options.position),"undefined"!=typeof e){var o=this.$element.find(".modal-dialog"),n=Math.max(0,(t(window).height()-o.outerHeight())/2),a="fit"==e?2*n/3:"center"==e?n:e;if(o.hasClass("modal-moveable")){var s=null;this.options.rememberPos&&(this.options.rememberPos===!0?s=this.$element.data("modal-pos"):t.zui.store&&(s=t.zui.store.pageGet(i+".rememberPos"))),s||(s={left:Math.max(0,(t(window).width()-o.outerWidth())/2),top:a}),o.css(s)}else o.css("margin-top",a)}},o.prototype.setMoveale=function(){t.fn.draggable||console.error("Moveable modal requires draggable.js.");var e=this,o=e.options,n=e.$element.find(".modal-dialog").removeClass("modal-dragged");n.toggleClass("modal-moveable",o.moveable),e.$element.data("modal-moveable-setup")||n.draggable({container:e.$element,handle:".modal-header",before:function(){n.css("margin-top","").addClass("modal-dragged")},finish:function(n){o.rememberPos&&(e.$element.data("modal-pos",n.pos),t.zui.store&&o.rememberPos!==!0&&t.zui.store.pageSet(i+".rememberPos",n.pos))}})},o.prototype.show=function(e,n){var a=this,s=t.Event("show."+i,{relatedTarget:e});a.$element.trigger(s),a.isShown||s.isDefaultPrevented()||(a.isShown=!0,a.options.moveable&&a.setMoveale(),a.checkScrollbar(),a.$body.addClass("modal-open"),a.setScrollbar(),a.escape(),a.$element.on("click.dismiss."+i,'[data-dismiss="modal"]',t.proxy(a.hide,a)),a.backdrop(function(){var s=t.support.transition&&a.$element.hasClass("fade");a.$element.parent().length||a.$element.appendTo(a.$body),a.$element.show().scrollTop(0),s&&a.$element[0].offsetWidth,a.$element.addClass("in").attr("aria-hidden",!1),a.ajustPosition(n),a.enforceFocus();var r=t.Event("shown."+i,{relatedTarget:e});s?a.$element.find(".modal-dialog").one("bsTransitionEnd",function(){a.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(o.TRANSITION_DURATION):a.$element.trigger("focus").trigger(r)}))},o.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide."+i),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),t(document).off("focusin."+i),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss."+i),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(o.TRANSITION_DURATION):this.hideModal())},o.prototype.enforceFocus=function(){t(document).off("focusin."+i).on("focusin."+i,t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},o.prototype.escape=function(){this.isShown&&this.options.keyboard?t(document).on("keydown.dismiss."+i,t.proxy(function(e){if(27==e.which){var o=t.Event("escaping."+i),n=this.$element.triggerHandler(o,"esc");if(void 0!=n&&!n)return;this.hide()}},this)):this.isShown||t(document).off("keydown.dismiss."+i)},o.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$element.trigger("hidden."+i)})},o.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},o.prototype.backdrop=function(e){var n=this,a=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&a;if(this.$backdrop=t('<div class="modal-backdrop '+a+'" />').appendTo(this.$body),this.$element.on("mousedown.dismiss."+i,t.proxy(function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){n.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):r()}else e&&e()},o.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},o.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",t+this.scrollbarWidth)},o.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},o.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var n=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=o,t.fn.modal.noConflict=function(){return t.fn.modal=n,this},t(document).on("click."+i+".data-api",'[data-toggle="modal"]',function(o){var n=t(this),a=n.attr("href"),s=null;try{s=t(n.attr("data-target")||a&&a.replace(/.*(?=#[^\s]+$)/,""))}catch(r){return}if(s.length){var l=s.data(i)?"toggle":t.extend({remote:!/#/.test(a)&&a},s.data(),n.data());n.is("a")&&o.preventDefault(),s.one("show."+i,function(t){t.isDefaultPrevented()||s.one("hidden."+i,function(){n.is(":visible")&&n.trigger("focus")})}),e.call(s,l,this,n.data("position"))}})}(jQuery),function(t,e){"use strict";if(!t.fn.modal)throw new Error("Modal trigger requires modal.js");var i="zui.modaltrigger",o="ajax",n=".zui.modal",a="string",s=function(e,i){e=t.extend({},s.DEFAULTS,t.ModalTriggerDefaults,i?i.data():null,e),this.isShown,this.$trigger=i,this.options=e,this.id=t.zui.uuid()};s.DEFAULTS={type:"custom",height:"auto",name:"triggerModal",fade:!0,position:"fit",showHeader:!0,delay:0,backdrop:!0,keyboard:!0,waittime:0,loadingIcon:"icon-spinner-indicator"},s.prototype.init=function(s){var r=this;if(s.url&&(!s.type||s.type!=o&&"iframe"!=s.type)&&(s.type=o),s.remote)s.type=o,typeof s.remote===a&&(s.url=s.remote);else if(s.iframe)s.type="iframe",typeof s.iframe===a&&(s.url=s.iframe);else if(s.custom&&(s.type="custom",typeof s.custom===a)){var l;try{l=t(s.custom)}catch(d){}l&&l.length?s.custom=l:t.isFunction(e[s.custom])&&(s.custom=e[s.custom])}var h=t("#"+s.name);h.length&&(r.isShown||h.off(n),h.remove()),h=t('<div id="'+s.name+'" class="modal modal-trigger">'+("string"==typeof s.loadingIcon&&0===s.loadingIcon.indexOf("icon-")?'<div class="icon icon-spin loader '+s.loadingIcon+'"></div>':s.loadingIcon)+'<div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button class="close" data-dismiss="modal">×</button><h4 class="modal-title"><i class="modal-icon"></i> <span class="modal-title-name"></span></h4></div><div class="modal-body"></div></div></div></div>').appendTo("body").data(i,r);var c=function(e,i){var o=s[e];t.isFunction(o)&&h.on(i+n,o)};c("onShow","show"),c("shown","shown"),c("onHide","hide"),c("hidden","hidden"),c("loaded","loaded"),h.on("shown"+n,function(){r.isShown=!0}).on("hidden"+n,function(){r.isShown=!1}),this.$modal=h,this.$dialog=h.find(".modal-dialog"),s.mergeOptions&&(this.options=s)},s.prototype.show=function(s){var r=t.extend({},this.options,{url:this.$trigger?this.$trigger.attr("href")||this.$trigger.attr("data-url")||this.$trigger.data("url"):this.options.url},s);this.init(r);var l=this,d=this.$modal,h=this.$dialog,c=r.custom,p=h.find(".modal-body").css("padding",""),f=h.find(".modal-header"),u=h.find(".modal-content");d.toggleClass("fade",r.fade).addClass(r.cssClass).toggleClass("modal-loading",!this.isShown),h.toggleClass("modal-md","md"===r.size).toggleClass("modal-sm","sm"===r.size).toggleClass("modal-lg","lg"===r.size).toggleClass("modal-fullscreen","fullscreen"===r.size),f.toggle(r.showHeader),f.find(".modal-icon").attr("class","modal-icon icon-"+r.icon),f.find(".modal-title-name").html(r.title||""),r.size&&"fullscreen"===r.size&&(r.width="",r.height="");var g=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){l.ajustPosition()},100)},m=function(t,e){return"undefined"==typeof t&&(t=r.delay),setTimeout(function(){h=d.find(".modal-dialog"),r.width&&"auto"!=r.width&&h.css("width",r.width),r.height&&"auto"!=r.height&&(h.css("height",r.height),"iframe"===r.type&&p.css("height",h.height()-f.outerHeight())),l.ajustPosition(r.position),d.removeClass("modal-loading"),"iframe"!=r.type&&h.off("resize."+i).on("resize."+i,g),e&&e()},t)};if("custom"===r.type&&c)if(t.isFunction(c)){var v=c({modal:d,options:r,modalTrigger:l,ready:m});typeof v===a&&(p.html(v),m())}else c instanceof t?(p.html(t("<div>").append(c.clone()).html()),m()):(p.html(c),m());else if(r.url){var y=function(){var t=d.callEvent("broken"+n,l,l);t&&p.html(t)};if(d.attr("ref",r.url),"iframe"===r.type){d.addClass("modal-iframe"),this.firstLoad=!0;var b="iframe-"+r.name;f.detach(),p.detach(),u.empty().append(f).append(p),p.css("padding",0).html('<iframe id="'+b+'" name="'+b+'" src="'+r.url+'" frameborder="no"  allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"  allowtransparency="true" scrolling="auto" style="width: 100%; height: 100%; left: 0px;"></iframe>'),r.waittime>0&&(l.waitTimeout=m(r.waittime,y));var w=document.getElementById(b);w.onload=w.onreadystatechange=function(){if(l.firstLoad&&d.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){l.firstLoad=!1,r.waittime>0&&clearTimeout(l.waitTimeout);try{d.attr("ref",w.contentWindow.location.href);var t=e.frames[b].$;if(t&&"auto"===r.height&&"fullscreen"!=r.size){var o=t("body").addClass("body-modal");r.iframeBodyClass&&o.addClass(r.iframeBodyClass);var a=function(t){d.removeClass("fade");var e=o.outerHeight();t===!0&&r.onlyIncreaseHeight&&(e=Math.max(e,p.data("minModalHeight")||0),p.data("minModalHeight",e)),p.css("height",e),r.fade&&d.addClass("fade"),m()};d.callEvent("loaded"+n,{modalType:"iframe",jQuery:t},null),setTimeout(a,100),o.off("resize."+i).on("resize."+i,g)}else m();t.extend({closeModal:e.closeModal})}catch(s){m()}}}}else t.get(r.url,function(e){try{var i=t(e);i.hasClass("modal-dialog")?h.replaceWith(i):i.hasClass("modal-content")?h.find(".modal-content").replaceWith(i):p.wrapInner(i)}catch(a){d.html(e)}d.callEvent("loaded"+n,{modalType:o},l),m()}).error(y)}d.modal({show:"show",backdrop:r.backdrop,moveable:r.moveable,keyboard:r.keyboard})},s.prototype.close=function(i,o){(i||o)&&this.$modal.on("hidden"+n,function(){t.isFunction(i)&&i(),typeof o===a&&("this"===o?e.location.reload():e.location=o)}),this.$modal.modal("hide")},s.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},s.prototype.ajustPosition=function(t){this.$modal.modal("ajustPosition",t||this.options.position)},t.zui({ModalTrigger:s,modalTrigger:new s}),t.fn.modalTrigger=function(e,o){return t(this).each(function(){var n=t(this),r=n.data(i),l=t.extend({title:n.attr("title")||n.text(),url:n.attr("href"),type:n.hasClass("iframe")?"iframe":""},n.data(),t.isPlainObject(e)&&e);r||n.data(i,r=new s(l,n)),typeof e==a?r[e](o):l.show&&r.show(o),n.on((l.trigger||"click")+".toggle."+i,function(t){r.toggle(l),n.is("a")&&t.preventDefault()})})};var r=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var o=t(this);o.hasClass("modal")?r.call(o,e,i):o.modalTrigger(e,i)})};var l=function(e){var i=typeof e;return"undefined"===i?e=t(".modal.modal-trigger"):i===a&&(e=t(e)),e&&e instanceof t?e:null},d=function(e,o,n){if(t.isFunction(e)){var a=n;n=o,o=e,e=a}e=l(e),e&&e.length&&e.each(function(){t(this).data(i).close(o,n)})},h=function(t,e){e=l(e),e&&e.length&&e.modal("ajustPosition",t)};t.zui({closeModal:d,ajustModalPosition:h}),t(document).on("click."+i+".data-api",'[data-toggle="modal"]',function(e){var o=t(this),n=o.attr("href"),a=null;try{a=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}a&&a.length||(o.data(i)?o.trigger(".toggle."+i):o.modalTrigger({show:!0})),o.is("a")&&e.preventDefault()})}(window.jQuery,window),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,o){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o);for(var n=this.options.trigger.split(" "),a=n.length;a--;){var s=n[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var o=this;if(o.$element.trigger(i),i.isDefaultPrevented())return;var n=o.tip();o.setContent(e),o.options.animation&&n.addClass("fade");var a="function"==typeof o.options.placement?o.options.placement.call(o,n[0],o.$element[0]):o.options.placement,s=/\s?auto?\s?/i,r=s.test(a);r&&(a=a.replace(s,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass(a),o.options.container?n.appendTo(o.options.container):n.insertAfter(o.$element);var l=o.getPosition(),d=n[0].offsetWidth,h=n[0].offsetHeight;if(r){var c=o.$element.parent(),p=a,f=document.documentElement.scrollTop||document.body.scrollTop,u="body"==o.options.container?window.innerWidth:c.outerWidth(),g="body"==o.options.container?window.innerHeight:c.outerHeight(),m="body"==o.options.container?0:c.offset().left;a="bottom"==a&&l.top+l.height+h-f>g?"top":"top"==a&&l.top-f-h<0?"bottom":"right"==a&&l.right+d>u?"left":"left"==a&&l.left-d<m?"right":a,n.removeClass(p).addClass(a)}var v=o.getCalculatedOffset(a,l,d,h);o.applyPlacement(v,a);var y=function(){var t=o.hoverState;o.$element.trigger("shown.bs."+o.type),o.hoverState=null,"out"==t&&o.leave(o)};t.support.transition&&o.$tip.hasClass("fade")?n.one("bsTransitionEnd",y).emulateTransitionEnd(150):y()}},e.prototype.applyPlacement=function(t,e){var i,o=this.tip(),n=o[0].offsetWidth,a=o[0].offsetHeight,s=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(r)&&(r=0),t.top=t.top+s,t.left=t.left+r,o.offset(t).addClass("in");var l=o[0].offsetWidth,d=o[0].offsetHeight;if("top"==e&&d!=a&&(i=!0,t.top=t.top+a-d),/bottom|top/.test(e)){var h=0;t.left<0&&(h=-2*t.left,t.left=0,o.offset(t),l=o[0].offsetWidth,d=o[0].offsetHeight),this.replaceArrow(h-n+l,l,"left")}else this.replaceArrow(d-a,d,"top");i&&o.offset(t)},e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i,t?50*(1-t/e)+"%":"")},e.prototype.setContent=function(t){var e=this.tip(),i=t||this.getTitle();this.options.tipId&&e.attr("id",this.options.tipId),this.options.tipClass&&e.addClass(this.options.tipClass),e.find(".tooltip-inner")[this.options.html?"html":"text"](i),e.removeClass("fade in top bottom left right")},e.prototype.hide=function(){function e(){"in"!=i.hoverState&&o.detach()}var i=this,o=this.tip(),n=t.Event("hide.zui."+this.type);return this.$element.trigger(n),n.isDefaultPrevented()?void 0:(o.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?o.one(t.support.transition.end,e).emulateTransitionEnd(150):e(),this.$element.trigger("hidden.zui."+this.type),this)},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(){var e=this.$element[0];return t.extend({},"function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},e.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},e.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},e.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var i=e?t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)},e.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("zui."+this.type)};var i=t.fn.tooltip;t.fn.tooltip=function(i,o){return this.each(function(){var n=t(this),a=n.data("zui.tooltip"),s="object"==typeof i&&i;a||n.data("zui.tooltip",a=new e(this,s)),"string"==typeof i&&a[i](o)})},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(window.jQuery),+function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),o=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](o),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,o=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return o?"$next"==o?e.next(".popover"):t(o):!1},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var o=t(this),n=o.data("zui.popover"),a="object"==typeof i&&i;n||o.data("zui.popover",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),+function(t){"use strict";function e(){t(n).remove(),
t(a).each(function(e){var n=i(t(this));n.hasClass("open")&&(n.trigger(e=t.Event("hide."+o)),e.isDefaultPrevented()||n.removeClass("open").trigger("hidden."+o))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o;try{o=i&&t(i)}catch(n){}return o&&o.length?o:e.parent()}var o="zui.dropdown",n=".dropdown-backdrop",a="[data-toggle=dropdown]",s=function(e){t(e).on("click."+o,this.toggle)};s.prototype.toggle=function(n){var a=t(this);if(!a.is(".disabled, :disabled")){var s=i(a),r=s.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e),s.trigger(n=t.Event("show."+o)),n.isDefaultPrevented())return;s.toggleClass("open").trigger("shown."+o),a.focus()}return!1}},s.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var o=t(this);if(e.preventDefault(),e.stopPropagation(),!o.is(".disabled, :disabled")){var n=i(o),s=n.hasClass("open");if(!s||s&&27==e.keyCode)return 27==e.which&&n.find(a).focus(),o.click();var r=t("[role=menu] li:not(.divider):visible a",n);if(r.length){var l=r.index(r.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l<r.length-1&&l++,~l||(l=0),r.eq(l).focus()}}}};var r=t.fn.dropdown;t.fn.dropdown=function(e){return this.each(function(){var i=t(this),o=i.data("dropdown");o||i.data("dropdown",o=new s(this)),"string"==typeof e&&o[e].call(i)})},t.fn.dropdown.Constructor=s,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this};var l=o+".data-api";t(document).on("click."+l,e).on("click."+l,".dropdown form",function(t){t.stopPropagation()}).on("click."+l,a,s.prototype.toggle).on("keydown."+l,a+", [role=menu]",s.prototype.keydown)}(window.jQuery),+function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,touchable:!0},e.prototype.touchable=function(){function e(e){var e=e||window.event;e.originalEvent&&(e=e.originalEvent);var a=t(this);switch(e.type){case"touchstart":o=e.touches[0].pageX,n=e.touches[0].pageY;break;case"touchend":var s=e.changedTouches[0].pageX-o,r=e.changedTouches[0].pageY-n;if(Math.abs(s)>Math.abs(r))i(a,s),Math.abs(s)>10&&e.preventDefault();else{var l=t(window);t("body,html").animate({scrollTop:l.scrollTop()-r},400)}}}function i(t,e){e>10?a.prev():-10>e&&a.next()}if(this.options.touchable){this.$element.on("touchstart touchmove touchend",e);var o,n,a=this}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},e.prototype.to=function(e){var i=this,o=this.getActiveIndex();return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid",function(){i.to(e)}):o==e?this.pause().cycle():this.slide(e>o?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition.end&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){return this.sliding?void 0:this.slide("next")},e.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},e.prototype.slide=function(e,i){var o=this.$element.find(".item.active"),n=i||o[e](),a=this.interval,s="next"==e?"left":"right",r="next"==e?"first":"last",l=this;if(!n.length){if(!this.options.wrap)return;n=this.$element.find(".item")[r]()}this.sliding=!0,a&&this.pause();var d=t.Event("slide.zui.carousel",{relatedTarget:n[0],direction:s});if(!n.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var e=t(l.$indicators.children()[l.getActiveIndex()]);e&&e.addClass("active")})),t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(d),d.isDefaultPrevented())return;n.addClass(e),n[0].offsetWidth,o.addClass(s),n.addClass(s),o.one(t.support.transition.end,function(){n.removeClass([e,s].join(" ")).addClass("active"),o.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(d),d.isDefaultPrevented())return;o.removeClass("active"),n.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return a&&this.cycle(),this}};var i=t.fn.carousel;t.fn.carousel=function(i){return this.each(function(){var o=t(this),n=o.data("zui.carousel"),a=t.extend({},e.DEFAULTS,o.data(),"object"==typeof i&&i),s="string"==typeof i?i:a.slide;n||o.data("zui.carousel",n=new e(this,a)),"number"==typeof i?n.to(i):s?n[s]():a.interval&&n.pause().cycle(),a.touchable&&n.touchable()})},t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=i,this},t(document).on("click.zui.carousel.data-api","[data-slide], [data-slide-to]",function(e){var i,o=t(this),n=t(o.attr("data-target")||(i=o.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),a=t.extend({},n.data(),o.data()),s=o.attr("data-slide-to");s&&(a.interval=!1),n.carousel(a),(s=o.attr("data-slide-to"))&&n.data("zui.carousel").to(s),e.preventDefault()}),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);e.carousel(e.data())})})}(window.jQuery),/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */
function(t){"use strict";t.zui.imgReady=function(){var t=[],e=null,i=function(){for(var e=0;e<t.length;e++)t[e].end?t.splice(e--,1):t[e]();!t.length&&o()},o=function(){clearInterval(e),e=null};return function(o,n,a,s){var r,l,d,h,c,p=new Image;return p.src=o,p.complete?(n.call(p),void(a&&a.call(p))):(l=p.width,d=p.height,p.onerror=function(){s&&s.call(p),r.end=!0,p=p.onload=p.onerror=null},r=function(){h=p.width,c=p.height,(h!==l||c!==d||h*c>1024)&&(n.call(p),r.end=!0)},r(),p.onload=function(){!r.end&&r(),a&&a.call(p),p=p.onload=p.onerror=null},void(r.end||(t.push(r),null===e&&(e=setInterval(i,40)))))}}()}(jQuery),function(t,e,i){"use strict";if(!t.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!t.zui.imgReady)throw new Error("imgReady requires for lightbox");var o=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};o.DEFAULTS={modalTeamplate:'<div class="icon-spinner icon-spin loader"></div><div class="modal-dialog"><button class="close" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i></button><button class="controller prev"><i class="icon icon-chevron-left"></i></button><button class="controller next"><i class="icon icon-chevron-right"></i></button><img class="lightbox-img" src="{image}" alt="" data-dismiss="modal" /><div class="caption"><div class="content">{caption}<div></div></div>'},o.prototype.getOptions=function(e){var i="image";return e=t.extend({},o.DEFAULTS,this.$.data(),e),e[i]||(e[i]=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data(i,e[i])),e},o.prototype.init=function(){this.bindEvents()},o.prototype.initGroups=function(){var e=this.$.data("groups");e||(e=t('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",e),e.each(function(e){t(this).attr("data-group-index",e)})),this.groups=e,this.groupIndex=parseInt(this.$.data("group-index"))},o.prototype.bindEvents=function(){var o=this.$,n=this,a=this.options;return a.image?void o.modalTrigger({type:"custom",name:"lightboxModal",position:"center",custom:function(o){n.initGroups();var s=o.modal,r=n.groups,l=n.groupIndex;s.addClass("modal-lightbox").html(a.modalTeamplate.format(a)).toggleClass("lightbox-with-caption","string"==typeof a.caption).removeClass("lightbox-full").data("group-index",l);var d=s.find(".modal-dialog"),h=t(e).width();t.zui.imgReady(a.image,function(){d.css({width:i.min(h,this.width)}),h<this.width+30&&s.addClass("lightbox-full"),o.ready(200)}),s.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(l-1)+'"]').length>0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(l+1)+'"]').length>0),s.find(".controller").click(function(){var n=t(this),a=s.data("group-index")+(n.hasClass("prev")?-1:1),l=r.filter('[data-group-index="'+a+'"]');if(l.length){var c=l.data("image"),p=l.data("caption");s.addClass("modal-loading").data("group-index",a).toggleClass("lightbox-with-caption","string"==typeof p).removeClass("lightbox-full"),s.find(".lightbox-img").attr("src",c),s.find(".caption > .content").text(p),h=t(e).width(),t.zui.imgReady(c,function(){d.css({width:i.min(h,this.width)}),h<this.width+30&&s.addClass("lightbox-full"),o.ready()})}return s.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(a-1)+'"]').length>0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(a+1)+'"]').length>0),!1})}}):!1},t.fn.lightbox=function(e){var i="group"+(new Date).getTime();return this.each(function(){var n=t(this),a="object"==typeof e&&e;"object"==typeof a&&a.group?n.attr("data-lightbox-group",a.group):n.data("group")?n.attr("data-lightbox-group",n.data("group")):n.attr("data-lightbox-group",i),n.data("group",n.data("lightbox-group"));var s=n.data("zui.lightbox");s||n.data("zui.lightbox",s=new o(this,a)),"string"==typeof e&&s[e]()})},t.fn.lightbox.Constructor=o,t(function(){t('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,Math),function(t,e,i){"use strict";var o=0,n='<div class="messager messager-{type} {placement}" style="display: none"><div class="messager-content"></div><div class="messager-actions"></div></div>',a={type:"default",placement:"top",time:4e3,parent:"body",icon:null,close:!0,fade:!0,scale:!0},s={},r=function(e,r){t.isPlainObject(e)&&(r=e,e=r.message);var l=this;r=l.options=t.extend({},a,r),l.id=r.id||o++;var d=s[l.id];d&&d.destroy(),s[l.id]=l,l.message=(r.icon?'<i class="icon-'+r.icon+' icon"></i> ':"")+e,l.$=t(n.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var h=!1,c=l.$.find(".messager-actions"),p=function(e){var o=t('<button type="button" class="action action-'+e.name+'"/>');"close"===e.name&&o.addClass("close"),e.html!==i&&o.html(e.html),e.icon!==i&&o.append('<i class="action-icon icon-'+e.icon+'"/>'),e.text!==i&&o.append('<span class="action-text">'+e.text+"</span>"),e.tooltip!==i&&o.attr("title",e.tooltip).tooltip(),o.data("action",e),c.append(o)};r.actions&&t.each(r.actions,function(t,e){e.name===i&&(e.name=t),"close"==e.name&&(h=!0),p(e)}),!h&&r.close&&p({name:"close",html:"&times;"}),l.$.on("click",".action",function(e){var i,o=t(this).data("action");r.onAction&&(i=r.onAction.call(this,o.name,o,l),i===!1)||t.isFunction(o.action)&&(i=o.action.call(this,l),i===!1)||(l.hide(),e.stopPropagation())}),l.$.on("click",function(t){if(r.onAction){var e=r.onAction.call(this,"content",null,l);e===!0&&l.hide()}});var f=l.$.find(".messager-content").html(l.message);r.contentClass&&f.addClass(r.cssClass),l.$.data("zui.messager",l),r.show&&l.message!==i&&l.show()};r.prototype.update=function(e,i){var o=this,n=o.options;o.$.removeClass("messager-"+n.type),i&&(n=t.extend(n,i)),o.$.addClass("messager-"+n.type),e&&(o.message=(n.icon?'<i class="icon-'+n.icon+' icon"></i> ':"")+e,o.$.find(".messager-content").html(o.message))},r.prototype.show=function(o,n){var a=this,s=this.options;if(t.isFunction(o)){var r=n;n=o,r!==i&&(o=r)}if(a.isShow)return void a.hide(function(){a.show(o,n)});a.hiding&&(clearTimeout(a.hiding),a.hiding=null),a.update(o);var l=s.placement,d=t(s.parent),h=d.children(".messagers-holder."+l);if(h.length||(h=t("<div/>").attr("class","messagers-holder "+l).appendTo(d)),h.append(a.$),"center"===l){var c=t(e).height()-h.height();h.css("top",Math.max(-c,c/2))}return a.$.show().addClass("in"),s.time&&(a.hiding=setTimeout(function(){a.hide()},s.time)),a.isShow=!0,n&&n(),a},r.prototype.hide=function(t,e){t===!0&&(e=!0,t=null);var i=this;if(i.$.hasClass("in")){i.$.removeClass("in");var o=function(){var e=i.$.parent();i.$.detach(),e.children().length||e.remove(),t&&t(!0)};e?o():setTimeout(o,200)}else t&&t(!1);i.isShow=!1},r.prototype.destroy=function(){var t=this;t.hide(function(){t.$.remove(),t.$=null},!0),delete s[t.id]},r.all=s;var l=function(){t(".messager").each(function(){var e=t(this).data("zui.messager");e&&e.hide&&e.hide(!0)})},d=function(e,o){"string"==typeof o&&(o={type:o}),o=t.extend({},o),o.id===i&&l();var n=s[o.id]||new r(e,o);return n.show(),n},h=function(t){return"string"==typeof t?{placement:t}:t},c={show:d,hide:l};t.each({primary:0,success:"ok-sign",info:"info-sign",warning:"warning-sign",danger:"exclamation-sign",important:0,special:0},function(e,i){c[e]=function(o,n){return d(o,t.extend({type:e,icon:i||null},h(n)))}}),t.zui({Messager:r,showMessager:d,messager:c})}(jQuery,window,void 0),function(t){"use strict";var e=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};e.DEFAULTS={auto:!1,foldicon:"icon-chevron-right"},e.prototype.getOptions=function(i){return i=t.extend({},e.DEFAULTS,this.$.data(),i)},e.prototype.init=function(){var t=this.$.children(".nav");t.find(".nav").closest("li").addClass("nav-parent"),t.find(".nav > li.active").parent().closest("li").addClass("active"),t.find(".nav-parent > a").append('<i class="'+this.options.foldicon+' nav-parent-fold-icon"></i>'),t.find(".nav-parent.show").find(".nav-parent-fold-icon").addClass("icon-rotate-90"),this.handleFold()},e.prototype.handleFold=function(){var e=this.options.auto,i=this.$;this.$.on("click",".nav-parent > a",function(o){e&&(i.find(".nav-parent.show").find(".nav").slideUp(function(){t(this).closest(".nav-parent").removeClass("show")}),i.find(".icon-rotate-90").removeClass("icon-rotate-90"));var n=t(this).closest(".nav-parent");return n.hasClass("show")?(n.find(".icon-rotate-90").removeClass("icon-rotate-90"),n.find(".nav").slideUp(function(){t(this).closest(".nav-parent").removeClass("show")})):(n.find(".nav-parent-fold-icon").addClass("icon-rotate-90"),n.find(".nav").slideDown(function(){t(this).closest(".nav-parent").addClass("show")})),o.preventDefault(),!1})},t.fn.menu=function(i){return this.each(function(){var o=t(this),n=o.data("zui.menu"),a="object"==typeof i&&i;n||o.data("zui.menu",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.menu.Constructor=e,t(function(){t('[data-toggle="menu"],[data-ride="menu"]').menu()})}(jQuery),function(t,e,i,o){"use strict";function n(t){if(t=t.toLowerCase(),t&&h.test(t)){var e;if(4===t.length){var i="#";for(e=1;4>e;e+=1)i+=t.slice(e,e+1).concat(t.slice(e,e+1));t=i}var o=[];for(e=1;7>e;e+=2)o.push(b("0x"+t.slice(e,e+2)));return{r:o[0],g:o[1],b:o[2],a:1}}throw new Error("Wrong hex string! (hex: "+t+")")}function a(e){return typeof e===u&&("transparent"===e.toLowerCase()||m[e.toLowerCase()]||h.test(t.trim(e.toLowerCase())))}function s(t){function e(t){return t=0>t?t+1:t>1?t-1:t,1>6*t?r+(s-r)*t*6:1>2*t?s:2>3*t?r+(s-r)*(2/3-t)*6:r}var i=t.h,o=t.s,n=t.l,a=t.a;i=d(i)%p/p,o=l(d(o)),n=l(d(n)),a=l(d(a));var s=.5>=n?n*(o+1):n+o-n*o,r=2*n-s,h={r:e(i+1/3)*c,g:e(i)*c,b:e(i-1/3)*c,a:a};return h}function r(t,i,o){return v(o)&&(o=0),v(i)&&(i=c),e.min(e.max(t,o),i)}function l(t,e){return r(t,e)}function d(t){return"number"==typeof t?t:parseFloat(t)}var h=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,c=255,p=360,f=100,u="string",g="object",m={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",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#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",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",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#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",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",yellowgreen:"#9acd32"},v=function(t){return t===o},y=function(t){return!v(t)},b=function(t){return parseInt(t)},w=function(t){return b(l(d(t),c))},C=function(t,e,i,o){var a=this;if(a.r=a.g=a.b=0,a.a=1,y(o)&&(a.a=l(d(o),1)),y(t)&&y(e)&&y(i))a.r=w(t),a.g=w(e),a.b=w(i);else if(y(t)){var r=typeof t;if(r==u)t=t.toLowerCase(),"transparent"===t?a.a=0:m[t]?this.rgb(n(m[t])):a.rgb(n(t));else if("number"==r&&v(e))a.r=a.g=a.b=w(t);else if(r==g&&y(t.r))a.r=w(t.r),y(t.g)&&(a.g=w(t.g)),y(t.b)&&(a.b=w(t.b)),y(t.a)&&(a.a=l(d(t.a),1));else if(r==g&&y(t.h)){var h={h:l(d(t.h),p),s:1,l:1,a:1};y(t.s)&&(h.s=l(d(t.s),1)),y(t.l)&&(h.l=l(d(t.l),1)),y(t.a)&&(h.a=l(d(t.a),1)),a.rgb(s(h))}}};C.prototype.rgb=function(t){var e=this;if(y(t)){if(typeof t==g)y(t.r)&&(e.r=w(t.r)),y(t.g)&&(e.g=w(t.g)),y(t.b)&&(e.b=w(t.b)),y(t.a)&&(e.a=l(d(t.a),1));else{var i=b(d(t));e.r=i,e.g=i,e.b=i}return e}return{r:e.r,g:e.g,b:e.b,a:e.a}},C.prototype.hue=function(t){var e=this,i=e.toHsl();return v(t)?i.h:(i.h=l(d(t),p),e.rgb(s(i)),e)},C.prototype.darken=function(t){var e=this,i=e.toHsl();return i.l-=t/f,i.l=l(i.l,1),e.rgb(s(i)),e},C.prototype.clone=function(){var t=this;return new C(t.r,t.g,t.b,t.a)},C.prototype.lighten=function(t){return this.darken(-t)},C.prototype.fade=function(t){return this.a=l(t/f,1),this},C.prototype.spin=function(t){var e=this.toHsl(),i=(e.h+t)%p;return e.h=0>i?p+i:i,this.rgb(s(e))},C.prototype.toHsl=function(){var t,i,o=this,n=o.r/c,a=o.g/c,s=o.b/c,r=o.a,l=e.max(n,a,s),d=e.min(n,a,s),h=(l+d)/2,f=l-d;if(l===d)t=i=0;else{switch(i=h>.5?f/(2-l-d):f/(l+d),l){case n:t=(a-s)/f+(s>a?6:0);break;case a:t=(s-n)/f+2;break;case s:t=(n-a)/f+4}t/=6}return{h:t*p,s:i,l:h,a:r}},C.prototype.luma=function(){var t=this.r/c,i=this.g/c,o=this.b/c;return t=.03928>=t?t/12.92:e.pow((t+.055)/1.055,2.4),i=.03928>=i?i/12.92:e.pow((i+.055)/1.055,2.4),o=.03928>=o?o/12.92:e.pow((o+.055)/1.055,2.4),.2126*t+.7152*i+.0722*o},C.prototype.saturate=function(t){var e=this.toHsl();return e.s+=t/f,e.s=l(e.s),this.rgb(s(e))},C.prototype.desaturate=function(t){return this.saturate(-t)},C.prototype.contrast=function(t,e,i){if(e=v(e)?new C(c,c,c,1):new C(e),t=v(t)?new C(0,0,0,1):new C(t),t.luma()>e.luma()){var o=e;e=t,t=o}return this.a<.5?t:(i=v(i)?.43:d(i),this.luma()<i?e:t)},C.prototype.hexStr=function(){var t=this.r.toString(16),e=this.g.toString(16),i=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==i.length&&(i="0"+i),"#"+t+e+i},C.prototype.toCssStr=function(){var t=this;return t.a>0?t.a<1?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":t.hexStr():"transparent"},C.isColor=a,C.names=m,t.zui({Color:C})}(jQuery,Math,window,void 0),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var o;return t.isArray(e)&&(o={},t.each(e,function(e,i){t.isPlainObject(i)?o[i.action]=i:o[i]=!0}),e=o),t.isPlainObject(e)&&(o={},t.each(e,function(e,i){i?o[e]=t.extend({type:e},s[e],t.isPlainObject(i)?i:null):o[e]=!1}),e=o),i?t.extend(!0,{},i,e):e}function i(e,i,o){return i=i||e.type,t(o||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var o="zui.tree",n=0,a=function(e,i){this.name=o,this.$=t(e),this.getOptions(i),this._init()},s={sort:{template:'<a class="sort-handler" href="javascript:;"><i class="icon icon-move"></i></a>'},add:{template:'<a href="javascript:;"><i class="icon icon-plus"></i></a>'},edit:{template:'<a href="javascript:;"><i class="icon icon-pencil"></i></a>'},"delete":{template:'<a href="javascript:;"><i class="icon icon-trash"></i></a>'}};a.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:'<i class="list-toggle icon"></i>'},a.prototype.add=function(e,i,o,n,a){var s,r=t(e),l=this.options;if(r.is("li")?(s=r.children("ul"),s.length||(s=t("<ul/>"),r.append(s),this._initList(s,r))):s=r,s){var d=this;t.isArray(i)||(i=[i]),t.each(i,function(e,i){var o=t("<li/>").data(i).appendTo(s);void 0!==i.id&&o.attr("data-id",i.id);var n=l.itemWrapper?t(l.itemWrapper===!0?'<div class="tree-item-wrapper"/>':l.itemWrapper).appendTo(o):o;if(i.html)n.html(i.html);else if(t.isFunction(d.options.itemCreator)){var a=d.options.itemCreator(o,i);a!==!0&&a!==!1&&n.html(a)}else i.url?n.append(t("<a/>",{href:i.url}).text(i.title||i.name)):n.append(t("<span/>").text(i.title||i.name));d._initItem(o,i.idx||e,s,i),i.children&&i.children.length&&d.add(o,i.children)}),this._initList(s),o&&!s.hasClass("tree")&&d.expand(s.parent("li"),n,a)}},a.prototype.reload=function(e){var i=this;e&&(i.$.empty(),i.add(i.$,e)),i.isPreserve&&i.store.time&&i.$.find("li:not(.tree-action-item)").each(function(){var e=t(this);i[i.store[e.data("id")]?"expand":"collapse"](e,!0,!0)})},a.prototype._initList=function(o,n,a,s){var r=this;o.hasClass("tree")?(a=0,n=null):(n=(n||o.closest("li")).addClass("has-list"),n.find(".list-toggle").length||n.prepend(this.options.toggleTemplate),a=a||n.data("idx"));var l=o.attr("data-idx",a||0).children("li:not(.tree-action-item)").each(function(e){r._initItem(t(this),e+1,o)});1!==l.length||l.find("ul").length||l.addClass("tree-single-item"),s=s||(n?n.data():null);var d=e(s?s.actions:null,this.actions);if(d){if(d.add&&d.add.templateInList!==!1){var h=o.children("li.tree-action-item");h.length?h.detach().appendTo(o):t('<li class="tree-action-item"/>').append(i(d.add,"add",d.add.templateInList)).appendTo(o)}d.sort&&o.sortable(t.extend({dragCssClass:"tree-drag-holder",trigger:".sort-handler",selector:"li:not(.tree-action-item)",finish:function(t){r.callEvent("action",{action:d.sort,$list:o,target:t.target,item:s})}},d.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}n&&(n.hasClass("open")||s&&s.open)&&n.addClass("open in")},a.prototype._initItem=function(o,n,a,s){if(void 0===n){var r=o.prev("li");n=r.length?r.data("idx")+1:1}if(a=a||o.closest("ul"),o.attr("data-idx",n).removeClass("tree-single-item"),!o.data("id")){var l=n;a.hasClass("tree")||(l=a.parent("li").data("id")+"-"+l),o.attr("data-id",l)}s=s||o.data();var d=e(s.actions,this.actions);if(d){var h=o.find(".tree-actions");h.length||(h=t('<div class="tree-actions"/>').appendTo(this.options.itemWrapper?o.find(".tree-item-wrapper"):o),t.each(d,function(t,e){e&&h.append(i(e,t))}))}var c=o.children("ul");c.length&&this._initList(c,o,n,s)},a.prototype._init=function(){var i=this.options,a=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var s=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=o+"::"+(i.name||"")+"#"+(this.$.attr("id")||n++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===s&&(r?this.isPreserve=!0:this.options.initialState=s="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===s?this.expand():"collapse"===s&&this.collapse(),this.$.on("click",'.list-toggle,a[href="#"],.tree-toggle',function(e){var i=t(this),o=i.parent("li");a.callEvent("hit",{target:o,item:o.data()}),a.toggle(o),i.is("a")&&e.preventDefault()}).on("click",".tree-action",function(){var e=t(this),i=e.data();if(i.action&&(i=i.action),"sort"!==i.type){var o=e.closest("li:not(.tree-action-item)");a.callEvent("action",{action:i,target:this,$item:o,item:o.data()})}})},a.prototype.preserve=function(e,i,o){if(this.isPreserve)if(e)i=i||e.data("id"),o=void 0===o?e.hasClass("open"):!1,o?this.store[i]=o:delete this.store[i],this.store.time=(new Date).getTime(),t.zui.store[this.options.name?"set":"pageSet"](this.selector,this.store);else{var n=this;this.store={},this.$.find("li").each(function(){n.preserve(t(this))})}},a.prototype.expand=function(t,e,i){t?(t.addClass("open"),!e&&this.options.animate?setTimeout(function(){t.addClass("in")},10):t.addClass("in")):t=this.$.find("li.has-list").addClass("open in"),i||this.preserve(t),this.callEvent("expand",t,this)},a.prototype.show=function(e,i,o){var n=this;e.each(function(){var e=t(this);if(n.expand(e,i,o),e)for(var a=e.parent("ul");a&&a.length&&!a.hasClass("tree");){var s=a.parent("li");s.length?(n.expand(s,i,o),a=s.parent("ul")):a=!1}})},a.prototype.collapse=function(t,e,i){t?!e&&this.options.animate?(t.removeClass("in"),setTimeout(function(){t.removeClass("open")},300)):t.removeClass("open in"):t=this.$.find("li.has-list").removeClass("open in"),i||this.preserve(t),this.callEvent("collapse",t,this)},a.prototype.toggle=function(t){var e=t&&t.hasClass("open")||t===!1||void 0===t&&this.$.find("li.has-list.open").length;this[e?"collapse":"expand"](t)},a.prototype.getOptions=function(e){this.options=t.extend({},a.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},a.prototype.toData=function(e,i){t.isFunction(e)&&(i=e,e=null),e=e||this.$;var o=this;return e.children("li:not(.tree-action-item)").map(function(){var e=t(this),n=e.data();delete n["zui.droppable"];var a=e.children("ul");return a.length&&(n.children=o.toData(a)),t.isFunction(i)?i(n,e):n}).get()},a.prototype.callEvent=function(e,i){var o;return t.isFunction(this.options[e])&&(o=this.options[e](i,this)),this.$.trigger(t.Event(e+"."+this.name,i)),o},t.fn.tree=function(e,i){return this.each(function(){var n=t(this),s=n.data(o),r="object"==typeof e&&e;s||n.data(o,s=new a(this,r)),"string"==typeof e&&s[e](i)})},t.fn.tree.Constructor=a,t(function(){t('[data-ride="tree"]').tree()})}(jQuery);