zui.min.js 125.9 KB
Newer Older
C
Catouse 已提交
1
/*!
C
Catouse 已提交
2
 * ZUI - v1.2.1 - 2015-01-08
C
Catouse 已提交
3 4
 * http://zui.sexy
 * GitHub: https://github.com/easysoft/zui.git 
C
Catouse 已提交
5
 * Copyright (c) 2015 cnezsoft.com; Licensed MIT
C
Catouse 已提交
6 7 8 9
 */

/* Some code copy from Bootstrap v3.0.0 by @fat and @mdo. (Copyright 2013 Twitter, Inc. Licensed under http://www.apache.org/licenses/)*/

C
Catouse 已提交
10 11 12 13 14
!function(a,b,c){"use strict";if("undefined"==typeof a)throw new Error("ZUI requires jQuery");a.extend({uuid:function(){for(var a=(new Date).getTime();1e16>a;)a*=10;return a+c.floor(9999*c.random())},getPropertyCount:function(a){return"object"!=typeof a||null===a?0:Object.getOwnPropertyNames(a).length},callEvent:function(b,c,d){return a.isFunction(b)?("undefined"!=typeof d&&(b=a.proxy(b,d)),c.result=b(c),!(void 0!==c.result&&!c.result)):1},clientLang:function(){var c;if("undefined"!=typeof b.config&&b.config.clientLang)c=b.config.clientLang;else{var d=a("html").attr("lang");c=d?d:navigator.userLanguage||navigator.userLanguage||"zh_cn"}return c.replace("-","_").toLowerCase()}}),a.fn.callEvent=function(b,c,d){var e=a(this),f=b.indexOf(".zui."),g=b;0>f&&d&&d.name?b+="."+d.name:g=b.substring(0,f);var h=a.Event(b,c);if("undefined"==typeof d&&f>0&&(d=e.data(b.substring(f+1))),d&&d.options){var i=d.options[g];a.isFunction(i)&&a.callEvent(d.options[g],h,d)}return h}}(jQuery,window,Math),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),function(a,b){"use strict";var c=1200,d=992,e=768,f={desktop:"screen-desktop",desktopLg:"screen-desktop-wide",tablet:"screen-tablet",phone:"screen-phone",isMobile:"device-mobile",isDesktop:"device-desktop"},g=b(a),h=function(){var a=g.width();b("html").toggleClass(f.desktop,a>=d&&c>a).toggleClass(f.desktopLg,a>=c).toggleClass(f.tablet,a>=e&&d>a).toggleClass(f.phone,e>a).toggleClass(f.isMobile,d>a).toggleClass(f.isDesktop,a>=d)};g.resize(h),h()}(window,jQuery),function(a,b){"use strict";var c={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>'},d=function(){var a=this.isIE,b=a();if(b)for(var c=10;c>5;c--)if(a(c)){b=c;break}this.ie=b,this.cssHelper()};d.prototype.cssHelper=function(){var a=this.ie,c=b("html");c.toggleClass("ie",a).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),a&&c.addClass("ie-"+a).toggleClass("gt-ie-7 gte-ie-8 support-ie",a>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",8>a).toggleClass("gt-ie-8 gte-ie-9",a>=9).toggleClass("lte-ie-8 lt-ie-9",9>a).toggleClass("gt-ie-9 gte-ie-10",a>=10).toggleClass("lte-ie-9 lt-ie-10",10>a)},d.prototype.tip=function(){if(this.ie&&this.ie<8){var a=b("#browseHappyTip");a.length||(a=b('<div id="browseHappyTip" class="alert alert-dismissable alert-danger 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>'),a.prependTo("body")),a.find(".content").html(this.browseHappyTip||c[b.clientLang()||"zh_cn"])}},d.prototype.isIE=function(a){var b=document.createElement("b");return b.innerHTML="<!--[if IE "+(a||"")+"]><i></i><![endif]-->",1===b.getElementsByTagName("i").length},d.prototype.isIE10=function(){return!1},a.browser=new d,b(function(){b("body").hasClass("disabled-browser-tip")||a.browser.tip()})}(window,jQuery),function(){"use strict";Date.ONEDAY_TICKS=864e5,Date.prototype.format=function(a){var b={"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(a)&&(a=a.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var c in b)new RegExp("("+c+")").test(a)&&(a=a.replace(RegExp.$1,1==RegExp.$1.length?b[c]:("00"+b[c]).substr((""+b[c]).length)));return a},Date.prototype.addMilliseconds=function(a){return this.setTime(this.getTime()+a),this},Date.prototype.addDays=function(a){return this.addMilliseconds(a*Date.ONEDAY_TICKS),this},Date.prototype.clone=function(){var a=new Date;return a.setTime(this.getTime()),a},Date.isLeapYear=function(a){return a%4===0&&a%100!==0||a%400===0},Date.getDaysInMonth=function(a,b){return[31,Date.isLeapYear(a)?29:28,31,30,31,30,31,31,30,31,30,31][b]},Date.prototype.isLeapYear=function(){return Date.isLeapYear(this.getFullYear())},Date.prototype.clearTime=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this},Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())},Date.prototype.addMonths=function(a){var b=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+a),this.setDate(Math.min(b,this.getDaysInMonth())),this},Date.prototype.getLastWeekday=function(a){a=a||1;for(var b=this.clone();b.getDay()!=a;)b.addDays(-1);return b.clearTime(),b},Date.prototype.isSameDay=function(a){return a.toDateString()===this.toDateString()},Date.prototype.isSameWeek=function(a){var b=this.getLastWeekday(),c=b.clone().addDays(7);return a>=b&&c>a},Date.prototype.isSameYear=function(a){return this.getFullYear()===a.getFullYear()}}(),function(){"use strict";String.prototype.format=function(a){var b=this;if(arguments.length>0){var c;if(1==arguments.length&&"object"==typeof a)for(var d in a)void 0!==a[d]&&(c=new RegExp("({"+d+"})","g"),b=b.replace(c,a[d]));else for(var e=0;e<arguments.length;e++)void 0!==arguments[e]&&(c=new RegExp("({["+e+"]})","g"),b=b.replace(c,arguments[e]))}return b},String.prototype.isNum=function(a){if(null!==a){var b,c;return c=/\d*/i,b=a.match(c),b==a?!0:!1}return!1}}(),function(a,b,c){"$:nomunge";function d(){e=b[h](function(){f.each(function(){var b=a(this),c=b.width(),d=b.height(),e=a.data(this,j);(c!==e.w||d!==e.h)&&b.trigger(i,[e.w=c,e.h=d])}),d()},g[k])}var e,f=a([]),g=a.resize=a.extend(a.resize,{}),h="setTimeout",i="resize",j=i+"-special-event",k="delay",l="throttleWindow";g[k]=250,g[l]=!0,a.event.special[i]={setup:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.add(b),a.data(this,j,{w:b.width(),h:b.height()}),1===f.length&&d()},teardown:function(){if(!g[l]&&this[h])return!1;var b=a(this);f=f.not(b),b.removeData(j),f.length||clearTimeout(e)},add:function(b){function d(b,d,f){var g=a(this),h=a.data(this,j)||{};h.w=d!==c?d:g.width(),h.h=f!==c?f:g.height(),e.apply(this,arguments)}if(!g[l]&&this[h])return!1;var e;return a.isFunction(b)?(e=b,d):(e=b.handler,void(b.handler=d))}}}(jQuery,this),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector||(this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a"),this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),function(a,b){"use strict";var c="localStorage",d=a[c],e=a.store,f="page_"+a.location.pathname+a.location.search,g=function(){this.slience=!0,this.enable=c in a&&a[c]&&a[c].setItem,this.storage=d,this.page=this.get(f,{})};g.prototype.pageSave=function(){if(b.isEmptyObject(this.page))this.remove(f);else{var a,c=[];for(a in this.page){var d=this.page[a];null===d&&c.push(a)}for(a=c.length-1;a>=0;a--)delete this.page[c[a]];this.set(f,this.page)}},g.prototype.pageRemove=function(a){"undefined"!=typeof this.page[a]&&(this.page[a]=null,this.pageSave())},g.prototype.pageClear=function(){this.page={},this.pageSave()},g.prototype.pageGet=function(a,b){var c=this.page[a];return void 0===b||null!==c&&void 0!==c?c:b},g.prototype.pageSet=function(a,c){b.isPlainObject(a)?b.extend(!0,this.page,a):this.page[this.serialize(a)]=c,this.pageSave()},g.prototype.check=function(){if(!this.enable&&!this.slience)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},g.prototype.length=function(){return this.check()?d.getLength?d.getLength():d.length:0},g.prototype.removeItem=function(a){return d.removeItem(a),this},g.prototype.remove=function(a){return this.removeItem(a)},g.prototype.getItem=function(a){return d.getItem(a)},g.prototype.get=function(a,b){var c=this.deserialize(this.getItem(a));return void 0===b||"undefined"!=typeof c&&null!==c&&void 0!==c?c:b},g.prototype.key=function(a){return d.key(a)},g.prototype.setItem=function(a,b){return d.setItem(a,b),this},g.prototype.set=function(a,b){return void 0===b?this.remove(a):(this.setItem(a,this.serialize(b)),this)},g.prototype.clear=function(){return d.clear(),this},g.prototype.forEach=function(a){for(var b=d.length-1;b>=0;b--){var c=d.key(b);a(c,this.get(c))}return this},g.prototype.getAll=function(){var a={};return this.forEach(function(b,c){a[b]=c}),a},g.prototype.serialize=function(a){return"string"==typeof a?a:JSON.stringify(a)},g.prototype.deserialize=function(a){if("string"!=typeof a)return void 0;try{return JSON.parse(a)}catch(b){return a||void 0}};var h=new g;a.store=h,a.store.noConflict=function(){return a.store=e,h}}(window,jQuery),function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={container:"body",move:!0},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){this.handleMouseEvents()},b.prototype.handleMouseEvents=function(){var b=this.$,c="before",d="drag",e="finish",f=this.options;b.mousedown(function(g){function h(c){q=!0;var e=c.pageX,g=c.pageY,h={left:e-o.x,top:g-o.y};b.removeClass("drag-ready").addClass("dragging"),f.move&&b.css(h),f.hasOwnProperty(d)&&a.isFunction(f[d])&&f[d]({event:c,element:b,startOffset:o,pos:h,offset:{x:e-n.x,y:g-n.y},smallOffset:{x:e-p.x,y:g-p.y}}),p.x=e,p.y=g,f.stopPropagation&&c.stopPropagation()}function i(c){if(a(document).unbind("mousemove",h).unbind("mouseup",i),!q)return void b.removeClass("drag-ready");var d={left:c.pageX-o.x,top:c.pageY-o.y};b.removeClass("drag-ready").removeClass("dragging"),f.move&&b.css(d),f.hasOwnProperty(e)&&a.isFunction(f[e])&&f[e]({event:c,element:b,pos:d,offset:{x:c.pageX-n.x,y:c.pageY-n.y},smallOffset:{x:c.pageX-p.x,y:c.pageY-p.y}}),c.preventDefault(),f.stopPropagation&&c.stopPropagation()}if(f.hasOwnProperty(c)&&a.isFunction(f[c])){var j=f[c]({event:g,element:b});if(void 0!==j&&!j)return}var k=a(f.container),l=b.offset(),m=k.offset(),n={x:g.pageX,y:g.pageY},o={x:g.pageX-l.left+m.left,y:g.pageY-l.top+m.top},p=a.extend({},n),q=!1;b.addClass("drag-ready"),a(document).bind("mousemove",h).bind("mouseup",i),g.preventDefault(),f.stopPropagation&&g.stopPropagation()})},a.fn.draggable=function(c){return this.each(function(){var d=a(this),e=d.data("zui.draggable"),f="object"==typeof c&&c;e||d.data("zui.draggable",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.draggable.Constructor=b}(jQuery),function(a,b,c){"use strict";var d=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};d.DEFAULTS={container:"body",flex:!1,deviation:5,sensorOffsetX:0,sensorOffsetY:0,nested:!1},d.prototype.getOptions=function(b){return b=a.extend({},d.DEFAULTS,this.$.data(),b)},d.prototype.callEvent=function(b,c){return a.callEvent(this.options[b],c,this)},d.prototype.init=function(){this.handleMouseEvents()},d.prototype.handleMouseEvents=function(){var d=this.$,e=this,f=this.options,g="before";this.$triggerTarget=f.trigger?(a.isFunction(f.trigger)?f.trigger(d):d.find(f.trigger)).first():d,this.$triggerTarget.on("mousedown",function(h){function i(b){var g={left:b.pageX,top:b.pageY};if(!(c.abs(g.left-t.left)<f.deviation&&c.abs(g.top-t.top)<f.deviation)){if(null===o){var h=p.css("position");"absolute"!=h&&"relative"!=h&&"fixed"!=h&&(l=h,p.css("position","relative")),o=d.clone().removeClass("drag-from").addClass("drag-shadow").css({position:"absolute",width:d.outerWidth(),transition:"none"}).appendTo(p),d.addClass("dragging"),e.callEvent("start",{event:b,element:d})}var i={left:g.left-v.left,top:g.top-v.top},j={left:i.left-u.left,top:i.top-u.top};o.css(j),w.left=g.left,w.top=g.top;var k=!1;q=!1,f.flex||m.removeClass("drop-to");var s=null;if(m.each(function(){var b=a(this),c=b.offset(),d=b.outerWidth(),e=b.outerHeight(),h=c.left+f.sensorOffsetX,i=c.top+f.sensorOffsetY;return g.left>h&&g.top>i&&g.left<h+d&&g.top<i+e&&(s&&s.removeClass("drop-to"),s=b,!f.nested)?!1:void 0}),s){q=!0;var x=s.data("id");d.data("id")!=x&&(r=!1),(null===n||n.data("id")!==x&&!r)&&(k=!0),n=s,f.flex&&m.removeClass("drop-to"),n.addClass("drop-to")}f.flex?null!==n&&n.length&&(q=!0):(d.toggleClass("drop-in",q),o.toggleClass("drop-in",q)),e.callEvent("drag",{event:b,isIn:q,target:n,element:d,isNew:k,selfTarget:r,clickOffset:v,offset:i,position:{left:i.left-u.left,top:i.top-u.top},mouseOffset:g})}}function j(c){if(l&&p.css("position",l),null===o)return d.removeClass("drag-from"),void a(b).unbind("mousemove",i).unbind("mouseup",j);q||(n=null);var f=!0,g={left:c.pageX,top:c.pageY},h={left:g.left-v.left,top:g.top-v.top},k={left:g.left-w.left,top:g.top-w.top};w.left=g.left,w.top=g.top;var s={event:c,isIn:q,target:n,element:d,isNew:!r&&null!==n,selfTarget:r,offset:h,mouseOffset:g,position:{left:h.left-u.left,top:h.top-u.top},lastMouseOffset:w,moveOffset:k};f=e.callEvent("beforeDrop",s),f&&q&&e.callEvent("drop",s),a(b).unbind("mousemove",i).unbind("mouseup",j),m.removeClass("drop-to"),d.removeClass("dragging").removeClass("drag-from"),o.remove(),e.callEvent("finish",s),c.preventDefault()}if(f.hasOwnProperty(g)&&a.isFunction(f[g])){var k=f[g]({event:h,element:d});if(void 0!==k&&!k)return}var l,m=a.isFunction(f.target)?f.target(d):a(f.target),n=null,o=null,p=a(f.container).first(),q=!1,r=!0,s=d.offset(),t={left:h.pageX,top:h.pageY},u=p.offset(),v={left:t.left-s.left,top:t.top-s.top},w={left:t.left,top:t.top};d.addClass("drag-from"),a(b).bind("mousemove",i).bind("mouseup",j),h.preventDefault()})},d.prototype.reset=function(){this.$triggerTarget.off("mousedown"),this.handleMouseEvents()},a.fn.droppable=function(b){return this.each(function(){var c=a(this),e=c.data("zui.droppable"),f="object"==typeof b&&b;e||c.data("zui.droppable",e=new d(this,f)),"string"==typeof b&&e[b]()})},a.fn.droppable.Constructor=d}(jQuery,document,Math),+function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={list:"li, div",dragCssClass:"invisible"},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){this.bindEventToList(this.$.children(this.options.selector))},b.prototype.reset=function(){var b=this,c=0,d=this.$.children(this.options.selector);d.each(function(){var e=a(this);e.data("zui.droppable")?(e.data("zui.droppable").options.target=d,e.droppable("reset")):b.bindEventToList(e),a(this).attr("data-order",++c)})},b.prototype.bindEventToList=function(b){function c(b){var c=0;b.each(function(){a(this).attr("data-order",++c)})}var d=this.$,e=this.options;c(b),b.droppable({trigger:e.trigger,target:d.children(e.selector),container:d,flex:!0,start:function(a){e.dragCssClass&&a.element.addClass(e.dragCssClass)},drag:function(b){if(b.isIn){var f=b.element,g=b.target,h=f.attr("data-order"),i=g.attr("data-order");if(h==i)return;h>i?g.before(f):g.after(f);var j=d.children(e.selector);c(j),a.callEvent(e.order,{list:j,element:f})}},finish:function(b){e.dragCssClass&&b.element.removeClass(e.dragCssClass),a.callEvent(e.finish,{list:d.children(e.selector),element:b.element})}})},a.fn.sortable=function(c){return this.each(function(){var d=a(this),e=d.data("zui.sortable"),f="object"==typeof c&&c;e?"object"==typeof c&&e.reset():d.data("zui.sortable",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.sortable.Constructor=b}(jQuery,window,document,Math),+function(a){"use strict";function b(b,d,e){return this.each(function(){var f=a(this),g=f.data("zui.modal"),h=a.extend({},c.DEFAULTS,f.data(),"object"==typeof b&&b);g||f.data("zui.modal",g=new c(this,h)),"string"==typeof b?g[b](d,e):h.show&&g.show(d,e)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.zui.modal")},this))};c.VERSION="3.2.0",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"},c.prototype.toggle=function(a,b){return this.isShown?this.hide():this.show(a,b)},c.prototype.ajustPosition=function(b){if("undefined"==typeof b&&(b=this.options.position),"undefined"!=typeof b){var c=this.$element.find(".modal-dialog"),d=Math.max(0,(a(window).height()-c.outerHeight())/2),e="fit"==b?2*d/3:"center"==b?d:b;c.css("margin-top",e)}},c.prototype.show=function(b,d){var e=this,f=a.Event("show.zui.modal",{relatedTarget:b});this.$element.trigger(f),this.isShown||f.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.$body.addClass("modal-open"),this.setScrollbar(),this.escape(),this.$element.on("click.dismiss.zui.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var f=a.support.transition&&e.$element.hasClass("fade");e.$element.parent().length||e.$element.appendTo(e.$body),e.$element.show().scrollTop(0),f&&e.$element[0].offsetWidth,e.$element.addClass("in").attr("aria-hidden",!1),e.ajustPosition(d),e.enforceFocus();var g=a.Event("shown.zui.modal",{relatedTarget:b});f?e.$element.find(".modal-dialog").one("bsTransitionEnd",function(){e.$element.trigger("focus").trigger(g)}).emulateTransitionEnd(c.TRANSITION_DURATION):e.$element.trigger("focus").trigger(g)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.zui.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),a(document).off("focusin.zui.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.zui.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.zui.modal").on("focusin.zui.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?a(document).on("keydown.dismiss.zui.modal",a.proxy(function(b){if(27==b.which){var c=a.Event("escaping.zui.modal"),d=this.$element.triggerHandler(c,"esc");if(void 0!=d&&!d)return;this.hide()}},this)):this.isShown||a(document).off("keydown.dismiss.zui.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$element.trigger("hidden.zui.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').appendTo(this.$body),this.$element.on("mousedown.dismiss.zui.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.zui.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=null;try{f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,""))}catch(g){return}if(f.length){var h=f.data("zui.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.zui.modal",function(a){a.isDefaultPrevented()||f.one("hidden.zui.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,h,this,d.data("position"))}})}(jQuery),function(a){"use strict";function b(b){var c=typeof b;return"undefined"===c?b=a(".modal.modal-trigger"):"string"===c&&(b=a(b)),b&&b instanceof a?b:null}if(!a.fn.modal)throw new Error("Modal trigger requires modal.js");var c="zui.modaltrigger",d=function(b){b=a.extend({},d.DEFAULTS,a.ModalTriggerDefaults,b),this.isShown=!1,this.options=b,this.id=a.uuid()};d.DEFAULTS={type:"custom",width:null,size:null,height:"auto",icon:null,name:"triggerModal",fade:!0,position:"fit",showHeader:!0,delay:0,backdrop:!0,keyboard:!0},d.prototype.init=function(b){var d=this;if(b.url&&(!b.type||"ajax"!=b.type&&"iframe"!=b.type)&&(b.type="ajax"),b.remote)b.type="ajax","string"==typeof b.remote&&(b.url=b.remote);else if(b.iframe)b.type="iframe","string"==typeof b.iframe&&(b.url=b.iframe);else if(b.custom&&(b.type="custom","string"==typeof b.custom)){var e;try{e=a(b.custom)}catch(f){}e&&e.length?b.custom=e:a.isFunction(window[b.custom])&&(b.custom=window[b.custom])}var g=a("#"+b.name);g.length&&(d.isShown||g.off(".zui.modal"),g.remove()),g=a('<div id="'+b.name+'" class="modal modal-trigger"><div class="icon-spinner icon-spin loader"></div><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(c,d);var h=function(c,d){var e=b[c];a.isFunction(e)&&g.on(d+".zui.modal",e)};h("onShow","show"),h("shown","shown"),h("onHide","hide"),h("hidden","hidden"),h("loaded","loaded"),g.on("shown.zui.modal",function(){d.isShown=!0}).on("hidden.zui.modal",function(){d.isShown=!1}),this.$modal=g,this.$dialog=g.find(".modal-dialog")},d.prototype.show=function(b){var d=a.extend({},this.options,b);this.init(d);var e=this,f=this.$modal,g=this.$dialog,h=d.custom,i=g.find(".modal-body").css("padding",""),j=g.find(".modal-header"),k=g.find(".modal-content");f.toggleClass("fade",d.fade).addClass(d.cssClass).toggleClass("modal-md","md"===d.size).toggleClass("modal-sm","sm"===d.size).toggleClass("modal-lg","lg"===d.size).toggleClass("modal-fullscreen","fullscreen"===d.size).toggleClass("modal-loading",!this.isShown),j.toggle(d.showHeader),j.find(".modal-icon").attr("class","modal-icon icon-"+d.icon),j.find(".modal-title-name").html(d.title||""),d.size&&"fullscreen"===d.size&&(d.width="",d.height="");var l=function(a){"undefined"==typeof a&&(a=300),setTimeout(function(){g=f.find(".modal-dialog"),d.width&&"auto"!=d.width&&g.css("width",d.width),d.height&&"auto"!=d.height&&(g.css("height",d.height),"iframe"===d.type&&i.css("height",g.height()-j.outerHeight())),e.ajustPosition(d.position),f.removeClass("modal-loading"),"iframe"!=d.type&&g.off("resize."+c).on("resize."+c,function(){e.ajustPosition()})},a)};if("custom"===d.type&&h)if(a.isFunction(h)){var m=h({modal:f,options:d,modalTrigger:e,ready:l});"string"==typeof m&&(i.html(m),l())}else h instanceof a?(i.html(a("<div>").append(h.clone()).html()),l()):(i.html(h),l());else if(d.url)if(f.attr("ref",d.url),"iframe"===d.type){f.addClass("modal-iframe"),this.firstLoad=!0;var n="iframe-"+d.name;j.detach(),i.detach(),k.empty().append(j).append(i),i.css("padding",0).html('<iframe id="'+n+'" name="'+n+'" src="'+d.url+'" frameborder="no" allowtransparency="true" scrolling="auto" style="width: 100%; height: 100%; left: 0px;"></iframe>'),d.waittime>0&&(e.waitTimeout=setTimeout(l,d.waittime));var o=document.getElementById(n);o.onload=o.onreadystatechange=function(){if(e.firstLoad&&f.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){e.firstLoad=!1,d.waittime>0&&clearTimeout(e.waitTimeout);
try{f.attr("ref",o.contentWindow.location.href);var a=window.frames[n].$;if(a&&"auto"===d.height&&"fullscreen"!=d.size){var b=a("body").addClass("body-modal"),g=function(){f.removeClass("fade");var a=b.outerHeight();i.css("height",a),d.fade&&f.addClass("fade"),l()};f.callEvent("loaded.zui.modal",{modalType:"iframe"}),setTimeout(g,100),b.off("resize."+c).on("resize."+c,g)}a.extend({closeModal:e.close})}catch(h){l()}}}}else a.get(d.url,function(b){try{var c=a(b);c.hasClass("modal-dialog")?g.replaceWith(c):c.hasClass("modal-content")?g.find(".modal-content").replaceWith(c):i.wrapInner(c)}catch(d){f.html(b)}f.callEvent("loaded.zui.modal",{modalType:"ajax"}),l()});f.modal({show:"show",backdrop:d.backdrop,keyboard:d.keyboard})},d.prototype.close=function(b,c){(b||c)&&this.$modal.on("hidden.zui.modal",function(){a.isFunction(b)&&b(),"string"==typeof c&&("this"===c?window.location.reload():window.location=c)}),this.$modal.modal("hide")},d.prototype.toggle=function(a){this.isShown?this.close():this.show(a)},d.prototype.ajustPosition=function(a){this.$modal.modal("ajustPosition",a||this.options.position)},window.ModalTrigger=d,window.modalTrigger=new d,a.fn.modalTrigger=function(b,e){return a(this).each(function(){var f=a(this),g=f.data(c),h=a.extend({title:f.attr("title")||f.text(),url:f.attr("href"),type:f.hasClass("iframe")?"iframe":""},f.data(),a.isPlainObject(b)&&b);g||f.data(c,g=new d(h)),"string"==typeof b?g[b](e):h.show&&g.show(e),f.on((h.trigger||"click")+".toggle."+c,function(a){g.toggle(h),f.is("a")&&a.preventDefault()})})};var e=a.fn.modal;a.fn.modal=function(b,c){return a(this).each(function(){var d=a(this);d.hasClass("modal")?e.call(d,b,c):d.modalTrigger(b,c)})},window.closeModal=function(d,e,f){if(a.isFunction(d)){var g=f;f=e,e=d,d=g}d=b(d),d&&d.length&&d.each(function(){a(this).data(c).close(e,f)})},window.ajustModalPosition=function(a,c){c=b(c),c&&c.length&&c.modal("ajustPosition",a)},a.extend({closeModal:window.closeModal,ajustModalPosition:window.ajustModalPosition}),a(document).on("click."+c+".data-api",'[data-toggle="modal"]',function(b){var d=a(this),e=d.attr("href"),f=null;try{f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,""))}catch(g){}f&&f.length||(d.data(c)?d.trigger(".toggle."+c):d.modalTrigger({show:!0})),d.is("a")&&b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.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},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focus",i="hover"==g?"mouseleave":"blur";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this.tip();this.setContent(),this.options.animation&&c.addClass("fade");var d="function"==typeof this.options.placement?this.options.placement.call(this,c[0],this.$element[0]):this.options.placement,e=/\s?auto?\s?/i,f=e.test(d);f&&(d=d.replace(e,"")||"top"),c.detach().css({top:0,left:0,display:"block"}).addClass(d),this.options.container?c.appendTo(this.options.container):c.insertAfter(this.$element);var g=this.getPosition(),h=c[0].offsetWidth,i=c[0].offsetHeight;if(f){var j=this.$element.parent(),k=d,l=document.documentElement.scrollTop||document.body.scrollTop,m="body"==this.options.container?window.innerWidth:j.outerWidth(),n="body"==this.options.container?window.innerHeight:j.outerHeight(),o="body"==this.options.container?0:j.offset().left;d="bottom"==d&&g.top+g.height+i-l>n?"top":"top"==d&&g.top-l-i<0?"bottom":"right"==d&&g.right+h>m?"left":"left"==d&&g.left-h<o?"right":d,c.removeClass(k).addClass(d)}var p=this.getCalculatedOffset(d,g,h,i);this.applyPlacement(p,d),this.$element.trigger("shown.bs."+this.type)}},b.prototype.applyPlacement=function(a,b){var c,d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),a.top=a.top+g,a.left=a.left+h,d.offset(a).addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;if("top"==b&&j!=f&&(c=!0,a.top=a.top+f-j),/bottom|top/.test(b)){var k=0;a.left<0&&(k=-2*a.left,a.left=0,d.offset(a),i=d[0].offsetWidth,j=d[0].offsetHeight),this.replaceArrow(k-e+i,i,"left")}else this.replaceArrow(j-f,j,"top");c&&d.offset(a)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach()}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.$element.trigger("hidden.bs."+this.type),this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(window.jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.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>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTarget();if(this.options.id&&a.attr("id",this.options.id),b)return b.find(".arrow").length<1&&a.addClass("no-arrow"),void a.html(b.html());var c=this.getTitle(),d=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](c),a.find(".popover-content")[this.options.html?"html":"text"](d),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.getTarget=function(){var b=this.$element,c=this.options,d=b.attr("data-target")||("function"==typeof c.target?c.target.call(b[0]):c.target);return d?"$next"==d?b.next(".popover"):a(d):!1},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b),f.trigger(d=a.Event("show.bs.dropdown")),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown"),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=a("[role=menu] li:not(.divider):visible a",f);if(h.length){var i=h.index(h.filter(":focus"));38==b.keyCode&&i>0&&i--,40==b.keyCode&&i<h.length-1&&i++,~i||(i=0),h.eq(i).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("dropdown");d||c.data("dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu]",f.prototype.keydown)}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,touchable:!0},b.prototype.touchable=function(){function b(b){var b=b||window.event;b.originalEvent&&(b=b.originalEvent);var f=a(this);switch(b.type){case"touchstart":d=b.touches[0].pageX,e=b.touches[0].pageY;break;case"touchend":var g=b.changedTouches[0].pageX-d,h=b.changedTouches[0].pageY-e;if(Math.abs(g)>Math.abs(h))c(f,g),Math.abs(g)>10&&b.preventDefault();else{var i=a(window);a("body,html").animate({scrollTop:i.scrollTop()-h},400)}}}function c(a,b){b>10&&a.find(".left.carousel-control").click(),-10>b&&a.find(".right.carousel-control").click()}if(this.options.touchable){this.$element.on("touchstart touchmove touchend",b);var d,e}},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle(),f.touchable&&e.touchable()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),function(){"use strict";window.imgReady=function(){var a=[],b=null,c=function(){for(var b=0;b<a.length;b++)a[b].end?a.splice(b--,1):a[b]();!a.length&&d()},d=function(){clearInterval(b),b=null};return function(d,e,f,g){var h,i,j,k,l,m=new Image;return m.src=d,m.complete?(e.call(m),void(f&&f.call(m))):(i=m.width,j=m.height,m.onerror=function(){g&&g.call(m),h.end=!0,m=m.onload=m.onerror=null},h=function(){k=m.width,l=m.height,(k!==i||l!==j||k*l>1024)&&(e.call(m),h.end=!0)},h(),m.onload=function(){!h.end&&h(),f&&f.call(m),m=m.onload=m.onerror=null},void(h.end||(a.push(h),null===b&&(b=setInterval(c,40)))))}}()}(),function(a,b,c){"use strict";if(!a.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!b.imgReady)throw new Error("imgReady requires for lightbox");var d=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};d.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>'},d.prototype.getOptions=function(b){var c="image";return b=a.extend({},d.DEFAULTS,this.$.data(),b),b[c]||(b[c]=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data(c,b[c])),b},d.prototype.init=function(){this.bindEvents()},d.prototype.initGroups=function(){var b=this.$.data("groups");b||(b=a('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",b),b.each(function(b){a(this).attr("data-group-index",b)})),this.groups=b,this.groupIndex=parseInt(this.$.data("group-index"))},d.prototype.bindEvents=function(){var d=this.$,e=this,f=this.options;return f.image?void d.modalTrigger({type:"custom",name:"lightboxModal",position:"center",custom:function(d){e.initGroups();var g=d.modal,h=e.groups,i=e.groupIndex;g.addClass("modal-lightbox").html(f.modalTeamplate.format(f)).toggleClass("lightbox-with-caption","string"==typeof f.caption).removeClass("lightbox-full").data("group-index",i);var j=g.find(".modal-dialog"),k=a(b).width();b.imgReady(f.image,function(){j.css({width:c.min(k,this.width)}),k<this.width+30&&g.addClass("lightbox-full"),d.ready()}),g.find(".prev").toggleClass("show",h.filter('[data-group-index="'+(i-1)+'"]').length>0),g.find(".next").toggleClass("show",h.filter('[data-group-index="'+(i+1)+'"]').length>0),g.find(".controller").click(function(){var e=a(this),f=g.data("group-index")+(e.hasClass("prev")?-1:1),i=h.filter('[data-group-index="'+f+'"]');if(i.length){var l=i.data("image"),m=i.data("caption");g.addClass("modal-loading").data("group-index",f).toggleClass("lightbox-with-caption","string"==typeof m).removeClass("lightbox-full"),g.find(".lightbox-img").attr("src",l),k=a(b).width(),b.imgReady(l,function(){j.css({width:c.min(k,this.width)}),k<this.width+30&&g.addClass("lightbox-full"),d.ready()})}return g.find(".prev").toggleClass("show",h.filter('[data-group-index="'+(f-1)+'"]').length>0),g.find(".next").toggleClass("show",h.filter('[data-group-index="'+(f+1)+'"]').length>0),!1})}}):!1},a.fn.lightbox=function(b){var c="group"+(new Date).getTime();return this.each(function(){var e=a(this),f="object"==typeof b&&b;"object"==typeof f&&f.group?e.attr("data-lightbox-group",f.group):e.data("group")?e.attr("data-lightbox-group",e.data("group")):e.attr("data-lightbox-group",c),e.data("group",e.data("lightbox-group"));var g=e.data("zui.lightbox");g||e.data("zui.lightbox",g=new d(this,f)),"string"==typeof b&&g[b]()})},a.fn.lightbox.Constructor=d,a(function(){a('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,Math),function(a,b){"use strict";var c,d=0,e='<div class="messager messager-{type} {placement}" id="messager{id}" style="display:none"><div class="messager-content"></div><div class="messager-actions"><button type="button" class="close action">&times;</button></div></div>',f={type:"default",placement:"top",time:4e3,parent:"body",icon:null,close:!0,fade:!0,scale:!0},g=function(b,c){var g=this;g.id=d++,c=g.options=a.extend({},f,c),g.message=(c.icon?'<i class="icon-'+c.icon+' icon"></i> ':"")+b,g.$=a(e.format(c)).toggleClass("fade",c.fade).toggleClass("scale",c.scale).attr("id","messager-"+g.id),c.close?g.$.on("click",".close",function(){g.hide()}):g.$.find(".close").remove(),g.$.find(".messager-content").html(g.message),g.$.data("zui.messager",g)};g.prototype.show=function(d){var e=this,f=this.options;c&&(c.id==e.id?e.$.removeClass("in"):c.isShow&&c.hide()),e.hiding&&(clearTimeout(e.hiding),e.hiding=null),d&&(e.message=(f.icon?'<i class="icon-'+f.icon+' icon"></i> ':"")+d,e.$.find(".messager-content").html(e.message)),e.$.appendTo(f.parent).show(),("top"===f.placement||"bottom"===f.placement||"center"===f.placement)&&e.$.css("left",(a(b).width()-e.$.width()-50)/2),("left"===f.placement||"right"===f.placement||"center"===f.placement)&&e.$.css("top",(a(b).height()-e.$.height()-50)/2),e.$.addClass("in"),f.time&&(e.hiding=setTimeout(function(){e.hide()},f.time)),e.isShow=!0,c=e},g.prototype.hide=function(){var a=this;a.$.hasClass("in")&&(a.$.removeClass("in"),setTimeout(function(){a.$.remove()},200)),a.isShow=!1},a.Messager=g;var h=b.Messager;b.Messager=a.Messager,b.Messager.noConflict=function(){b.Messager=h},a.showMessage=function(a,b){"string"==typeof b&&(b={type:b});var c=new g(a,b);return c.show(),c};var i=function(a){return"string"==typeof a?{placement:a}:a};a.messager={show:a.showMessage,primary:function(b,c){return a.showMessage(b,a.extend({type:"primary"},i(c)))},success:function(b,c){return a.showMessage(b,a.extend({type:"success",icon:"ok-sign"},i(c)))},info:function(b,c){return a.showMessage(b,a.extend({type:"info",icon:"info-sign"},i(c)))},warning:function(b,c){return a.showMessage(b,a.extend({type:"warning",icon:"warning-sign"},i(c)))},danger:function(b,c){return a.showMessage(b,a.extend({type:"danger",icon:"exclamation-sign"},i(c)))},important:function(b,c){return a.showMessage(b,a.extend({type:"important"},i(c)))},special:function(b,c){return a.showMessage(b,a.extend({type:"special"},i(c)))}};var j=b.messager;b.messager=a.messager,b.messager.noConflict=function(){b.messager=j}}(jQuery,window),function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={auto:!1,foldicon:"icon-chevron-right"},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){var a=this.$.children(".nav");a.find(".nav").closest("li").addClass("nav-parent"),a.find(".nav > li.active").closest("li").addClass("active"),a.find(".nav-parent > a").append('<i class="'+this.options.foldicon+' nav-parent-fold-icon"></i>'),this.handleFold()},b.prototype.handleFold=function(){var b=this.options.auto,c=this.$;this.$.find(".nav-parent > a").click(function(d){b&&(c.find(".nav-parent.show").find(".nav").slideUp(function(){a(this).closest(".nav-parent").removeClass("show")}),c.find(".icon-rotate-90").removeClass("icon-rotate-90"));var e=a(this).closest(".nav-parent");return e.hasClass("show")?(e.find(".icon-rotate-90").removeClass("icon-rotate-90"),e.find(".nav").slideUp(function(){a(this).closest(".nav-parent").removeClass("show")})):(e.find(".nav-parent-fold-icon").addClass("icon-rotate-90"),e.find(".nav").slideDown(function(){a(this).closest(".nav-parent").addClass("show")})),d.preventDefault(),!1})},a.fn.menu=function(c){return this.each(function(){var d=a(this),e=d.data("zui.menu"),f="object"==typeof c&&c;e||d.data("zui.menu",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.menu.Constructor=b,a(function(){a('[data-toggle="menu"]').menu()})}(jQuery),function(a,b){"use strict";"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.bootbox=b(a.jQuery)}(this,function a(b,c){"use strict";function d(){var a;if("undefined"!=typeof config&&config.clientLang)a=config.clientLang;else{var c=b("html").attr("lang");a=c?c:"en"}return a.replace("-","_").toLowerCase()}function e(a){var b=r[p.locale];return b?b[a]:r.en[a]}function f(a,c,d){a.stopPropagation(),a.preventDefault();var e=b.isFunction(d)&&d(a)===!1;e||c.modal("hide")}function g(a){var b,c=0;for(b in a)c++;return c}function h(a,c){var d=0;b.each(a,function(a,b){c(a,b,d++)})}function i(a){var c,d;if("object"!=typeof a)throw new Error("Please supply an object of options");if(!a.message)throw new Error("Please specify a message");return a=b.extend({},p,a),a.buttons||(a.buttons={}),a.backdrop=a.backdrop?"static":!1,c=a.buttons,d=g(c),h(c,function(a,e){if(b.isFunction(e)&&(e=c[a]={callback:e}),"object"!==b.type(e))throw new Error("button with key "+a+" must be an object");e.label||(e.label=a),e.className||(e.className=1==d||d>=2&&"confirm"===a?"btn-primary":"btn-default")}),a}function j(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function k(a,c,d){return b.extend(!0,{},a,j(c,d))}function l(a,b,c,d){var e={className:"bootbox-"+a,buttons:m.apply(null,b)};return n(k(e,d,c),b)}function m(){for(var a={},b=0,c=arguments.length;c>b;b++){var d=arguments[b],f=d.toLowerCase(),g=d.toUpperCase();a[f]={label:e(g)}}return a}function n(a,b){var d={};return h(b,function(a,b){d[b]=!0}),h(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var o={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'></select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},p={locale:d(),backdrop:!0,animate:!0,className:null,closeButton:!0,show:!0,container:"body"},q={};q.alert=function(){var a;if(a=l("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback():!0},q.dialog(a)},q.confirm=function(){var a;if(a=l("confirm",["confirm","cancel"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback(!1)},a.buttons.confirm.callback=function(){return a.callback(!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return q.dialog(a)},q.prompt=function(){var a,d,e,f,g,i,j;f=b(o.form),d={className:"bootbox-prompt",buttons:m("confirm","cancel"),value:"",inputType:"text"},a=n(k(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0:a.show;var l=["date","time","number"],p=document.createElement("input");if(p.setAttribute("type",a.inputType),l[a.inputType]&&(a.inputType=p.type),a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback(null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=g.val();break;case"checkbox":var d=g.find("input:checked");c=[],h(d,function(a,d){c.push(b(d).val())})}return a.callback(c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!o.inputs[a.inputType])throw new Error("invalid prompt type");switch(g=b(o.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":g.val(a.value);break;case"select":var r={};if(j=a.inputOptions||[],!j.length)throw new Error("prompt with select requires options");h(j,function(a,d){var e=g;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(r[d.group]||(r[d.group]=b("<optgroup/>").attr("label",d.group)),e=r[d.group]),e.append("<option value='"+d.value+"'>"+d.text+"</option>")}),h(r,function(a,b){g.append(b)}),g.val(a.value);break;case"checkbox":var s=b.isArray(a.value)?a.value:[a.value];if(j=a.inputOptions||[],!j.length)throw new Error("prompt with checkbox requires options");if(!j[0].value||!j[0].text)throw new Error("given options in wrong format");g=b("<div/>"),h(j,function(c,d){var e=b(o.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),h(s,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),g.append(e)})}return a.placeholder&&g.attr("placeholder",a.placeholder),a.pattern&&g.attr("pattern",a.pattern),f.append(g),f.on("submit",function(a){a.preventDefault(),a.stopPropagation(),e.find(".btn-primary").click()}),e=q.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){g.focus()}),i===!0&&e.modal("show"),e},q.dialog=function(a){a=i(a);var c=b(o.dialog),d=c.find(".modal-dialog"),e=c.find(".modal-body"),g=a.buttons,j="",k={onEscape:a.onEscape};if(h(g,function(a,b){j+="<button data-bb-handler='"+a+"' type='button' class='btn "+b.className+"'>"+b.label+"</button>",k[a]=b.callback}),e.find(".bootbox-body").html(a.message),a.animate===!0&&c.addClass("fade"),a.className&&c.addClass(a.className),"large"===a.size&&d.addClass("modal-lg"),"small"===a.size&&d.addClass("modal-sm"),a.title&&e.before(o.header),a.closeButton){var l=b(o.closeButton);a.title?c.find(".modal-header").prepend(l):l.css("margin-top","-10px").prependTo(e)}return a.title&&c.find(".modal-title").html(a.title),j.length&&(e.after(o.footer),c.find(".modal-footer").html(j)),c.on("hidden.bs.modal",function(a){a.target===this&&c.remove()}),c.on("shown.bs.modal",function(){c.find(".btn-primary:first").focus()}),c.on("escape.close.bb",function(a){k.onEscape&&f(a,c,k.onEscape)}),c.on("click",".modal-footer button",function(a){var d=b(this).data("bb-handler");f(a,c,k[d])}),c.on("click",".bootbox-close-button",function(a){f(a,c,k.onEscape)}),c.on("keyup",function(a){27===a.which&&c.trigger("escape.close.bb")}),b(a.container).append(c),c.modal({backdrop:a.backdrop,keyboard:!1,show:!1}),a.show&&c.modal("show"),c
},q.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(p,a)},q.hideAll=function(){b(".bootbox").modal("hide")};var r={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},zh_cn:{OK:"确认",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"確認",CANCEL:"取消",CONFIRM:"確認"}};return q.init=function(c){return a(c||b)},q}),function(a,b){"use strict";function c(b){var c=b.data("url");c&&(b.addClass("panel-loading").find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").addClass("icon-spin"),a.ajax({url:c,dataType:"html"}).done(function(a){b.find(".panel-body").html(a)}).fail(function(){b.addClass("panel-error")}).always(function(){b.removeClass("panel-loading"),b.find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").removeClass("icon-spin")}))}function d(a,c,d,e){return b.abs((d-a)*(e-c))}function e(a,b,c,d,e,f){return a>=c&&e>=a&&b>=d&&f>=b}function f(a,c,f,g,h,i,j,k){var l=b.max(a,h),m=b.max(c,i),n=b.min(f,j),o=b.min(g,k);return e(l,m,a,c,f,g)&&e(n,o,a,c,f,g)&&e(l,m,h,i,j,k)&&e(n,o,h,i,j,k)?d(l,m,n,o):0}var g=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.draggable=this.$.hasClass("dashboard-draggable")||this.options.draggable,this.init()};g.DEFAULTS={height:360,shadowType:"circle",sensitive:!1,circleShadowSize:100},g.prototype.getOptions=function(b){return b=a.extend({},g.DEFAULTS,this.$.data(),b)},g.prototype.handleRemoveEvent=function(){var b=this.options.afterPanelRemoved,c=this.options.panelRemovingTip;this.$.on("click",".remove-panel",function(){var d=a(this).closest(".panel"),e=d.data("name")||d.find(".panel-heading").text().replace("\n","").replace(/(^\s*)|(\s*$)/g,""),f=d.attr("data-id");(void 0===c||confirm(c.format(e)))&&(d.parent().remove(),b&&a.isFunction(b)&&b(f))})},g.prototype.handleRefreshEvent=function(){this.$.on("click",".refresh-panel",function(){var b=a(this).closest(".panel");c(b)})},g.prototype.handleDraggable=function(){var c=this.$,e=this.options,g="circle"===e.shadowType,h=e.circleShadowSize,i=h/2,j=e.afterOrdered;this.$.addClass("dashboard-draggable"),this.$.find(".panel-actions").mousedown(function(a){a.preventDefault(),a.stopPropagation()});var k;this.$.find(".panel-heading").mousedown(function(l){function m(c){var g=A.data("mouseOffset");p=c.pageX-g.x,q=c.pageY-g.y,r=p+E,s=q+F,A.css({left:p,top:q}),z.find(".dragging-in").removeClass("dragging-in"),v=!1,u=null;var h,i=0;z.children(":not(.dragging-col)").each(function(){var g=a(this);if(g.hasClass("dragging-col-holder"))return v=!e.sensitive||100>i,!0;var j=g.children(".panel"),k=j.offset(),l=j.width(),m=j.height(),n=k.left,o=k.top;if(e.sensitive)n-=C.left,o-=C.top,h=f(p,q,r,s,n,o,n+l,o+m),h>100&&h>i&&h>b.min(d(p,q,r,s),d(n,o,n+l,o+m))/3&&(i=h,u=g);else{var t=c.pageX,w=c.pageY;if(t>n&&w>o&&n+l>t&&o+m>w)return u=g,!1}}),u&&(t&&clearTimeout(t),w=u,t=setTimeout(n,50)),c.preventDefault()}function n(){w&&(w.addClass("dragging-in"),v?D.insertAfter(w):D.insertBefore(w),c.addClass("dashboard-holding"),t=null,w=null)}function o(b){t&&clearTimeout(t);var d=x.data("order");x.parent().insertAfter(D);var e=0,f={};z.children(":not(.dragging-col-holder)").each(function(){var b=a(this).children(".panel");b.data("order",++e),f[b.attr("id")]=e,b.parent().attr("data-order",e)}),d!=f[x.attr("id")]&&(z.data("orders",f),j&&a.isFunction(j)&&j(f)),A.remove(),c.removeClass("dashboard-holding"),c.find(".dragging-col").removeClass("dragging-col"),c.find(".panel-dragging").removeClass("panel-dragging"),z.find(".dragging-in").removeClass("dragging-in"),c.removeClass("dashboard-dragging"),a(document).unbind("mousemove",m).unbind("mouseup",o),b.preventDefault()}var p,q,r,s,t,u,v,w,x=a(this).closest(".panel"),y=x.parent(),z=x.closest(".row"),A=x.clone().addClass("panel-dragging-shadow"),B=x.offset(),C=c.offset(),D=z.find(".dragging-col-holder"),E=x.width(),F=x.height();D.length||(D=a('<div class="dragging-col-holder"><div class="panel"></div></div>').removeClass("dragging-col").appendTo(z)),k&&D.removeClass(k),D.addClass(k=y.attr("class")),D.insertBefore(y).find(".panel").replaceWith(x.clone().addClass("panel-dragging panel-dragging-holder")),c.addClass("dashboard-dragging"),x.addClass("panel-dragging").parent().addClass("dragging-col"),A.css({left:B.left-C.left,top:B.top-C.top,width:E,height:F}).appendTo(c).data("mouseOffset",{x:l.pageX-B.left+C.left,y:l.pageY-B.top+C.top}),g&&(A.addClass("circle"),setTimeout(function(){A.css({left:l.pageX-C.left-i,top:l.pageY-C.top-i,width:h,height:h}).data("mouseOffset",{x:C.left+i,y:C.top+i})},100)),a(document).bind("mousemove",m).bind("mouseup",o),l.preventDefault()})},g.prototype.handlePanelPadding=function(){this.$.find(".panel-body > table, .panel-body > .list-group").closest(".panel-body").addClass("no-padding")},g.prototype.handlePanelHeight=function(){var c=this.options.height;this.$.find(".row").each(function(){var d=a(this),e=d.find(".panel"),f=d.data("height")||c;"number"!=typeof f&&(f=0,e.each(function(){f=b.max(f,a(this).innerHeight())})),e.each(function(){var b=a(this);b.find(".panel-body").css("height",f-b.find(".panel-heading").outerHeight()-2)})})},g.prototype.init=function(){this.handlePanelHeight(),this.handlePanelPadding(),this.handleRemoveEvent(),this.handleRefreshEvent(),this.draggable&&this.handleDraggable();var b=0;this.$.find(".panel").each(function(){var d=a(this);d.data("order",++b),d.attr("id")||d.attr("id","panel"+b),d.attr("data-id")||d.attr("data-id",b),c(d)})},a.fn.dashboard=function(b){return this.each(function(){var c=a(this),d=c.data("zui.dashboard"),e="object"==typeof b&&b;d||c.data("zui.dashboard",d=new g(this,e)),"string"==typeof b&&d[b]()})},a.fn.dashboard.Constructor=g}(jQuery,Math),function(a){"use strict";if(!a.fn.droppable)throw new Error("droppable requires for boards");var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.getLang(),this.init()};b.DEFAULTS={lang:"zh-cn",langs:{"zh-cn":{appendToTheEnd:"移动到末尾"},"zh-tw":{appendToTheEnd:"移动到末尾"},en:{appendToTheEnd:"Move to the end."}}},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.getLang=function(){var c=window.config;if(!this.options.lang){if("undefined"!=typeof c&&c.clientLang)this.options.lang=c.clientLang;else{var d=a("html").attr("lang");this.options.lang=d?d:"en"}this.options.lang=this.options.lang.replace(/-/,"_").toLowerCase()}this.lang=this.options.langs[this.options.lang]||this.options.langs[b.DEFAULTS.lang]},b.prototype.init=function(){var b=1,c=this.lang;this.$.find('.board-item:not(".disable-drop"), .board:not(".disable-drop")').each(function(){var d=a(this);d.attr("id")?d.attr("data-id",d.attr("id")):d.attr("data-id")||d.attr("data-id","board"+b++),d.hasClass("board")&&d.find(".board-list").append('<div class="board-item board-item-empty"><i class="icon-plus"></i> {appendToTheEnd}</div>'.format(c)).append('<div class="board-item board-item-shadow"></div>'.format(c))}),this.bind()},b.prototype.bind=function(b){var c=this.$,d=this.options;"undefined"==typeof b&&(b=c.find('.board-item:not(".disable-drop, .board-item-shadow")')),b.droppable({target:'.board-item:not(".disable-drop, .board-item-shadow")',flex:!0,start:function(a){c.addClass("dragging").find(".board-item-shadow").height(a.element.outerHeight())},drag:function(a){if(c.find(".board.drop-in-empty").removeClass("drop-in-empty"),a.isIn){var b=a.target.closest(".board").addClass("drop-in"),d=b.find(".board-item-shadow"),e=a.target;c.addClass("drop-in").find(".board.drop-in").not(b).removeClass("drop-in"),d.insertBefore(e),b.toggleClass("drop-in-empty",e.hasClass("board-item-empty"))}},drop:function(b){if(b.isNew){var c="drop";d.hasOwnProperty(c)&&a.isFunction(d[c])&&d[c](b),b.element.insertBefore(b.target)}},finish:function(){c.removeClass("dragging").removeClass("drop-in").find(".board.drop-in").removeClass("drop-in")}})},a.fn.boards=function(c){return this.each(function(){var d=a(this),e=d.data("zui.boards"),f="object"==typeof c&&c;e||d.data("zui.boards",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.boards.Constructor=b,a(function(){a('[data-toggle="boards"]').boards()})}(jQuery),function(a){"use strict";var b="zui.datatable",c=function(c,d){this.name=b,this.$=a(c),this.isTable="TABLE"===this.$[0].tagName,this.firstShow=!0,this.isTable?(this.$table=this.$,this.id="datatable-"+(this.$.attr("id")||a.uuid())):(this.$datatable=this.$.addClass("datatable"),this.$.attr("id")?this.id=this.$.attr("id"):(this.id="datatable-"+a.uuid(),this.$.attr("id",this.id))),this.getOptions(d),this.load(),this.callEvent("ready")};c.DEFAULTS={checkable:!1,checkByClickRow:!0,checkedClass:"active",checkboxName:null,sortable:!1,storage:!0,fixedHeader:!0,fixedHeaderOffset:0,fixedLeftWidth:"30%",fixedRightWidth:"30%",flexHeadDrag:!0,scrollPos:"in",rowHover:!0,colHover:!0,hoverClass:"hover",colHoverClass:"col-hover",mergeRows:!1,minColWidth:20,minFixedLeftWidth:200,minFixedRightWidth:200,minFlexAreaWidth:200},c.prototype.getOptions=function(b){var d=this.$;b=a.extend({},c.DEFAULTS,this.$.data(),b),b.tableClass=b.tableClass||"",b.tableClass=" "+b.tableClass+" table-datatable",a.each(["bordered","condensed","striped","condensed","fixed"],function(a,c){c="table-"+c,d.hasClass(c)&&(b.tableClass+=" "+c)}),(d.hasClass("table-hover")||b.rowHover)&&(b.tableClass+=" table-hover"),this.options=b},c.prototype.load=function(c){var d,e=this.options;if(a.isPlainObject(c))this.data=c;else if("string"==typeof c){var f=a(c);f.length&&(this.$table=f.first(),this.$table.data(b,this),this.isTable=!0),c=null}else c=e.data;if(!c){if(!this.isTable)throw new Error("No data avaliable!");c={cols:[],rows:[]},d=c.cols;var g,h,i,j,k,l,m=c.rows,n=this.$table;n.find("thead > tr:first").children("th").each(function(){h=a(this),d.push(a.extend({text:h.html(),flex:!1||h.hasClass("flex-col"),width:"auto",cssClass:h.attr("class"),css:h.attr("style"),type:"string",ignore:h.hasClass("ignore"),sort:!h.hasClass("sort-disabled"),mergeRows:h.attr("merge-rows")},h.data()))}),n.find("tbody > tr").each(function(){i=a(this),k=a.extend({data:[],checked:!1,cssClass:i.attr("class"),css:i.attr("style"),id:i.attr("id")},i.data()),i.children("td").each(function(){if(j=a(this),l=j.attr("colspan")||1,k.data.push(a.extend({cssClass:j.attr("class"),css:j.attr("style"),text:j.html(),colSpan:l},j.data())),l>1)for(g=1;l>g;g++)k.data.push({empty:!0})}),m.push(k)});var o=n.find("tfoot");o.length&&(c.footer=a('<table class="table'+e.tableClass+'"></table>').append(o))}c.flexStart=-1,c.flexEnd=-1,d=c.cols,c.colsLength=d.length;for(var g=0;g<c.colsLength;++g){var p=d[g];p.flex&&(c.flexStart<0&&(c.flexStart=g),c.flexEnd=g)}0===c.flexStart&&c.flexEnd===c.colsLength&&(c.flexStart=-1,c.flexEnd=-1),c.flexArea=c.flexStart>=0,c.fixedRight=c.flexEnd>=0&&c.flexEnd<c.colsLength-1,c.fixedLeft=c.flexStart>0,c.flexStart<0&&c.flexEnd<0&&(c.fixedLeft=!0,c.flexStart=c.colsLength,c.flexEnd=c.colsLength),this.data=c,this.callEvent("afterLoad",{data:c}),this.render()},c.prototype.render=function(){var c,d,e,f,g=this,h=g.$datatable||(g.isTable?a('<div class="datatable" id="'+g.id+'"/>'):g.$datatable),i=g.options,j=g.data,k=g.data.cols,l=g.data.rows,m=i.checkable,n='<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',o='<div class="datatable-head-span datatable-span"><div class="datatable-wrapper"><table class="table"><thead></thead></table></div></div>';h.children(".datatable-head, .datatable-rows, .scroll-wrapper").remove(),h.toggleClass("sortable",i.sortable);var p,q,r,s=a('<div class="datatable-head"/>');for(c=a("<tr/>"),e=a("<tr/>"),f=a("<tr/>"),d=0;d<k.length;d++)r=k[d],p=d<j.flexStart?c:d>=j.flexStart&&d<=j.flexEnd?f:e,0===d&&m&&p.append('<th data-index="check" class="check-all check-btn"><i class="icon-check-empty"></i></th>'),r.ignore||(q=a("<th/>"),q.toggleClass("sort-down","down"===r.sort).toggleClass("sort-up","up"===r.sort).toggleClass("sort-disabled",r.sort===!1),q.addClass(r.cssClass).addClass(r.colClass).html(r.text).attr({"data-index":d,"data-type":r.type,style:r.css}),p.append(q));var t;j.fixedLeft&&(t=a(o),t.addClass("fixed-left").find("table").addClass(i.tableClass).find("thead").append(c),s.append(t)),j.flexArea&&(t=a(o),t.addClass("flexarea").find(".datatable-wrapper").append('<div class="scrolled-shadow scrolled-in-shadow"></div><div class="scrolled-shadow scrolled-out-shadow"></div>').find("table").addClass(i.tableClass).find("thead").append(f),s.append(t)),j.fixedRight&&(t=a(o),t.addClass("fixed-right").find("table").addClass(i.tableClass).find("thead").append(e),s.append(t)),h.append(s);var u,v,w,x,y,z,A,B,C=a('<div class="datatable-rows">'),D=l.length;c=a("<tbody/>"),e=a("<tbody/>"),f=a("<tbody/>");for(var E=0;D>E;++E){for(z=l[E],"undefined"==typeof z.id&&(z.id=E),z.index=E,u=a("<tr/>"),u.addClass(z.cssClass).toggleClass(i.checkedClass,z.checked).attr({"data-index":E,"data-id":z.id}),v=u.clone(),w=u.clone(),B=z.data.length,d=0;B>d;++d)A=z.data[d],d>0&&A.empty||(p=d<j.flexStart?u:d>=j.flexStart&&d<=j.flexEnd?v:w,0===d&&m&&(y=a('<td data-index="check" class="check-row check-btn"><i class="icon-check-empty"></i></td>'),i.checkboxName&&y.append('<input class="hide" type="checkbox" name="'+i.checkboxName+'" value="'+z.id+'">'),p.append(y)),k[d].ignore||(a.isPlainObject(A)||(A={text:A,row:E,index:d},z.data[d]=A),x=a("<td/>"),x.html(A.text).addClass(A.cssClass).addClass(k[d].colClass).attr("colspan",A.colSpan).attr({"data-row":E,"data-index":d,"data-flex":!1,"data-type":k[d].type,style:A.css}),p.append(x)));c.append(u),f.append(v),e.append(w)}var F;j.fixedLeft&&(F=a(n),F.addClass("fixed-left").find("table").addClass(i.tableClass).append(c),C.append(F)),j.flexArea&&(F=a(n),F.addClass("flexarea").find(".datatable-wrapper").append('<div class="scrolled-shadow scrolled-in-shadow"></div><div class="scrolled-shadow scrolled-out-shadow"></div>').find("table").addClass(i.tableClass).append(f),C.append(F)),j.fixedRight&&(F=a(n),F.addClass("fixed-right").find("table").addClass(i.tableClass).append(e),C.append(F)),h.append(C),j.flexArea&&h.append('<div class="scroll-wrapper"><div class="scroll-slide scroll-pos-'+i.scrollPos+'"><div class="bar"></div></div></div>');var G=h.children(".datatable-footer").detach();j.footer?(h.append(a('<div class="datatable-footer"/>').append(j.footer)),j.footer=null):G.length&&h.append(G),g.$datatable=h.data(b,g),g.isTable&&g.firstShow&&(g.$table.attr("data-datatable-id",this.id).hide().after(h),g.firstShow=!1),g.bindEvents(),g.refreshSize(),g.callEvent("render")},c.prototype.bindEvents=function(){var b=this,c=this.data,d=this.options,e=window.store,f=this.$datatable,g=b.$dataSpans=f.children(".datatable-head, .datatable-rows").find(".datatable-span"),h=b.$rowsSpans=f.children(".datatable-rows").children(".datatable-rows-span"),i=b.$headSpans=f.children(".datatable-head").children(".datatable-head-span"),j=b.$cells=g.find("td, th"),k=b.$dataCells=j.filter("td");b.$headCells=j.filter("th");var l=b.$rows=b.$rowsSpans.find(".table > tbody > tr");if(d.rowHover){var m=d.hoverClass;h.on("mouseenter","td",function(){k.filter("."+m).removeClass(m),l.filter("."+m).removeClass(m),l.filter('[data-index="'+a(this).addClass(m).closest("tr").data("index")+'"]').addClass(m)}).on("mouseleave","td",function(){k.filter("."+m).removeClass(m),l.filter("."+m).removeClass(m)})}if(d.colHover){var n=d.colHoverClass;i.on("mouseenter","th",function(){j.filter("."+n).removeClass(n),j.filter('[data-index="'+a(this).data("index")+'"]').addClass(n)}).on("mouseleave","th",function(){j.filter("."+n).removeClass(n)})}if(c.flexArea){var o,p,q,r,s,t,u,v=f.find(".scroll-slide"),w=f.find(".datatable-span.flexarea"),x=f.find(".datatable-span.fixed-left"),y=f.find(".datatable-span.flexarea .table"),z=v.children(".bar"),A=b.id+"_scrollOffset";b.width=f.width(),f.resize(function(){b.width=f.width()});var B=function(a,b){s=Math.max(0,Math.min(o-p,a)),b||f.addClass("scrolling"),z.css("left",s),u=0-Math.floor((q-o)*s/(o-p)),y.css("left",u),r=s,f.toggleClass("scrolled-in",s>2).toggleClass("scrolled-out",o-p-2>s),d.storage&&e.pageSet(A,s)},C=function(){o=w.width(),v.width(o).css("left",x.width()),q=y.width(),p=Math.floor(o*o/q),z.css("width",p),y.css("min-width",o),f.toggleClass("show-scroll-slide",q>o),t||o===p||(t=!0,B(e.pageGet(A,0),!0)),f.hasClass("size-changing")&&B(s,!0)};w.resize(C),d.storage&&C();var D={move:!1,stopPropagation:!0,drag:function(a){B(z.position().left+a.smallOffset.x*(a.element.hasClass("bar")?1:-1))},finish:function(){f.removeClass("scrolling")}};z.draggable(D),d.flexHeadDrag&&f.find(".datatable-head-span.flexarea").draggable(D),v.mousedown(function(a){var b=a.pageX-v.offset().left;B(b-p/2)})}if(d.checkable){var E,F=b.id+"_checkedStatus",G=d.checkedClass,H=function(){var f=h.first().find(".table > tbody > tr"),g=f.filter("."+G);f.find(".check-row input:checkbox").prop("checked",!1);var j={checkedAll:f.length===g.length&&g.length>0,checks:g.map(function(){return E=a(this).data("id"),d.checkboxName&&a(this).find(".check-row input:checkbox").prop("checked",!0),E}).toArray()};a.each(c.rows,function(b,c){c.checked=a.inArray(c.id,j.checks)>-1}),i.find(".check-all").toggleClass("checked",j.checkedAll),d.storage&&e.pageSet(F,j),b.callEvent("checksChanged",{checks:j})};this.$rowsSpans.on("click",d.checkByClickRow?"tr":".check-row",function(){l.filter('[data-index="'+a(this).closest("tr").data("index")+'"]').toggleClass(G),H()});var I="click.zui.datatable.check-all";if(this.$datatable.off(I).on(I,".check-all",function(){l.toggleClass(G,a(this).toggleClass("checked").hasClass("checked")),H()}).on("click",".check-none",function(){l.toggleClass(G,!1),H()}).on("click",".check-inverse",function(){l.toggleClass(G),H()}),d.storage){var J=e.pageGet(F);J&&(i.find(".check-all").toggleClass("checked",J.checkedAll),J.checkedAll?l.addClass(G):(l.removeClass(G),a.each(J.checks,function(a,b){l.filter('[data-id="'+b+'"]').addClass(G)})),J.checks.length&&H())}}if(d.fixedHeader){var K,L,M,N=f.children(".datatable-head"),O=d.fixedHeaderOffset||a(".navbar.navbar-fixed-top").height()||0,P=function(){K=f.offset().top,M=a(window).scrollTop(),L=f.height(),f.toggleClass("head-fixed",M+O>K&&K+L>M+O),f.hasClass("head-fixed")?N.css({width:f.width(),top:O}):N.attr("style","")};a(window).scroll(P),P()}d.sortable?(i.on("click","th:not(.sort-disabled, .check-btn)",function(){f.hasClass("size-changing")||b.sortTable(a(this))}),d.storage&&b.sortTable()):d.mergeRows&&this.mergeRows()},c.prototype.mergeRows=function(){for(var b=this.$rowsSpans.find(".table > tbody > tr > td"),c=this.data.cols,d=0;d<c.length;d++){var e=c[d];if(e.mergeRows){var f=b.filter('[data-index="'+d+'"]');if(f.length>1){var g,h;f.each(function(){var b=a(this);g&&b.html()===g.html()?(h=g.attr("rowspan")||1,"number"!=typeof h&&(h=parseInt(h),isNaN(h)&&(h=1)),g.attr("rowspan",h+1).css("vertical-align","middle"),b.remove()):g=b})}}}},c.prototype.sortTable=function(b){var c=window.store,d=this.options,e=this.id+"_datatableSorter",f=d.storage?c.pageGet(e):null;if(b||(b=f?this.$headCells.filter('[data-index="'+f.index+'"]').addClass("sort-"+f.type):this.$headCells.filter(".sort-up, .sort-down").first()),b.length){var g,h,i,j=this.data,k=j.cols,l=j.rows,m=this.$headCells;g=!b.hasClass("sort-up"),m.removeClass("sort-up sort-down"),b.addClass(g?"sort-up":"sort-down"),i=b.data("index"),g=b.hasClass("sort-up"),a.each(k,function(a,b){a==i||"up"!==b.sort&&"down"!==b.sort?a==i&&(b.sort=g?"up":"down",h=b.type):b.sort=!0});var n,o,p,q=this.$dataCells.filter('[data-index="'+i+'"]');l.sort(function(a,b){return a=a.data[i],b=b.data[i],n=q.filter('[data-row="'+a.row+'"]').text(),o=q.filter('[data-row="'+b.row+'"]').text(),"number"===h?(n=parseFloat(n),o=parseFloat(o)):"date"===h?(n=Date.parse(n),o=Date.parse(o)):(n=n.toLowerCase(),o=o.toLowerCase()),p=n>o?1:o>n?-1:0,g&&(p=-1*p),p});var r,s,t,u=this.$rows,v=[];a.each(l,function(b,c){r=u.filter('[data-index="'+c.index+'"]'),r.each(function(b){t=a(this),s=v[b],s?s.after(t):t.parent().prepend(t),v[b]=t})}),f={index:i,type:g?"up":"down"},d.storage&&c.pageSet(e,f),this.callEvent("sort",{sorter:f})}},c.prototype.refreshSize=function(){var b,c=this.$datatable,d=this.options,e=this.data.rows,f=this.data.cols;c.find(".datatable-span.fixed-left").css("width",d.fixedLeftWidth),c.find(".datatable-span.fixed-right").css("width",d.fixedRightWidth);var g=function(b){var c,d=0;return b.css("height","auto"),b.each(function(){c=a(this),c.attr("rowspan")||(d=Math.max(d,c.height()))}),d},h=this.$dataCells,i=this.$cells,j=this.$headCells;for(b=0;b<f.length;++b)i.filter('[data-index="'+b+'"]').css("width",f[b].width);j.height(g(j));var k;for(b=0;b<e.length;++b)k=h.filter('[data-row="'+b+'"]'),k.height(g(k))},c.prototype.callEvent=function(a,b){var c=this.$.callEvent(a+"."+this.name,b,this).result;return!(void 0!==c&&!c)},a.fn.datatable=function(d){return this.each(function(){var e=a(this),f=e.data(b),g="object"==typeof d&&d;f||e.data(b,f=new c(this,g)),"string"==typeof d&&f[d]()})},a.fn.datatable.Constructor=c}(jQuery),function(a,b){"use strict";var c="zui.calendar",d=function(a,b){b=b||1;for(var c=a.clone();c.getDay()!=b;)c.addDays(-1);return c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0),c},e=function(a){var b=a.clone();return b.setDate(1),b},f=function(d,e){if(this.name=c,this.$=a(d),this.id=this.$.attr("id")||c+a.uuid(),this.$.attr("id",this.id),this.storeName=c+"."+this.id,this.getOptions(e),this.getLang(),this.data=this.options.data,this.calendars=a.isPlainObject(this.data.calendars)?this.data.calendars:{},this.events=this.data.events,this.sortEvents(),this.storeData=b.store.pageGet(this.storeName,{date:"today",view:"month"}),this.date=this.options.startDate||(this.options.storage?this.storeData.date:"today"),this.view=this.options.startView||(this.options.storage?this.storeData.view:"month"),this.$.toggleClass("limit-event-title",e.limitEventTitle),this.options.withHeader){var f=this.$.children(".calender-header");f.length||(f=a('<header><div class="btn-toolbar"><div class="btn-group"><button type="button" class="btn btn-today">{today}</button></div><div class="btn-group"><button type="button" class="btn btn-prev"><i class="icon-chevron-left"></i></button><button type="button" class="btn btn-next"><i class="icon-chevron-right"></i></button></div><div class="btn-group"><span class="calendar-caption"></span></div></div></header>'.format(this.lang)),this.$.append(f)),this.$caption=f.find(".calendar-caption"),this.$todayBtn=f.find(".btn-today"),this.$header=f}var g=this.$.children(".calendar-views");g.length||(g=a('<div class="calendar-views"></div>'),this.$.append(g)),this.$views=g,this.$monthView=g.children(".calendar-view.month"),this.display(),this.bindEvents()};f.DEFAULTS={langs:{zh_cn:{weekNames:["周一","周二","周三","周四","周五","周六","周日"],monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",year:"{0}年",month:"{0}月",yearMonth:"{0}年{1}月"}},data:{calendars:{defaultCal:{color:"#229F24"}},events:[]},limitEventTitle:!0,storage:!0,withHeader:!0,dragThenDrop:!0},f.prototype.sortEvents=function(){var b=this.events;a.isArray(b)||(b=[]),a.each(b,function(b,c){"string"==typeof c.start&&(c.start=new Date(c.start)),"string"==typeof c.end&&(c.end=new Date(c.end)),"undefined"==typeof c.id&&(c.id=a.uuid())}),b.sort(function(a,b){return a.start>b.start?1:a.start<b.start?-1:0})},f.prototype.bindEvents=function(){var b=this.$,c=this;b.on("click",".btn-today",function(){c.date=new Date,c.display(),c.callEvent("clickTodayBtn")}).on("click",".btn-next",function(){"month"===c.view&&c.date.addMonths(1),c.display(),c.callEvent("clickNextBtn")}).on("click",".btn-prev",function(){"month"===c.view&&c.date.addMonths(-1),c.display(),c.callEvent("clickPrevBtn")}).on("click",".event",function(b){c.callEvent("clickEvent",{event:a(this).data("event"),events:c.events}),b.stopPropagation()}).on("click",".cell-day",function(){c.callEvent("clickCell",{view:c.view,date:a(this).attr("data-date"),events:c.events})})},f.prototype.addCalendars=function(b){a.isPlainObject(b)&&(b=[b]),a.each(b,function(a,b){this.callEvent("beforeAddCalendars",{newCalendar:b,data:this.data})&&this.calendars[b.name](b)}),this.display(),this.callEvent("addCalendars",{newCalendars:b,data:this.data})},f.prototype.addEvents=function(b){a.isPlainObject(b)&&(b=[b]),a.each(b,function(a,b){this.callEvent("beforeAddEvent",{newEvent:b,data:this.data})&&this.events.push(b)}),this.sortEvents(),this.display(),this.callEvent("addEvents",{newEvents:b,data:this.data})},f.prototype.getEvent=function(a){for(var b=this.events,c=0;c<b.length;c++)if(b[c].id==a)return b[c];return null},f.prototype.updateEvents=function(b){var c={data:this.data,changes:[]};a.isPlainObject(b)&&(b=[b]);var d,e,f;a.each(b,function(b,g){d=g.event,e=g.changes,f={event:d,changes:[]},"string"==typeof d&&(d=this.getEvent(d)),d&&(a.isPlainObject(e)&&(e=[e]),a.each(function(b,c){this.callEvent("beforeChange",{event:d,change:c.change,to:c.to,from:d[c.change]})&&(f.changes.push(a.entend(!0,{},c,{from:d[c.change]})),d[c.change]=c.to)})),c.changes.push(f)}),this.sortEvents(),this.display(),this.callEvent("change",c)},f.prototype.removeEvents=function(b){a.isArray(b)||(b=[b]);var c,d,e,f=this.events,g=[];a.each(b,function(b,h){c=a.isPlainObject(h)?h.id:h,e=-1;for(var i=0;i<f.length;i++)if(f[i].id==c){e=i,d=f[i];break}e>=0&&this.callEvent("beforeRemoveEvent",{event:d,eventId:c,data:this.data})&&(f.splice(e,1),g.push(d))}),this.sortEvents(),this.display(),this.callEvent("removeEvents",{removedEvents:g,data:this.data})},f.prototype.getOptions=function(b){this.options=a.extend({},f.DEFAULTS,this.$.data(),b)},f.prototype.getLang=function(){this.lang=this.options.langs[this.options.lang||a.clientLang()]},f.prototype.display=function(a,c){"undefined"==typeof a?a=this.view:this.view=a,"undefined"==typeof c?c=this.date:this.date=c,"today"===c?(c=new Date,this.date=c):"string"==typeof c&&(c=new Date(c),this.date=c),this.options.storage&&b.store.pageSet(this.storeName,{date:c,view:a});var d={view:a,date:c};if(this.callEvent("beforeDisplay",d)){switch(a){case"month":this.displayMonth(c)}this.callEvent("display",d)}},f.prototype.displayMonth=function(){var b,c=this.options,f=this,g=this.lang,h=this.date,i=this.$views,j=this.$,k=f.$monthView;if(!k.length){k=a('<div class="calendar-view month"><table class="table table-bordered"><thead><tr class="week-head"></tr></thead><tbody class="month-days"></tbody></table></div>');var l,m=k.find(".week-head"),n=k.find(".month-days");for(b=0;7>b;b++)m.append("<th>"+g.weekNames[b]+"</th>");for(b=0;6>b;b++){l=a('<tr class="week-days"></tr>');for(var o=0;7>o;o++)l.append('<td class="cell-day"><div class="day"><div class="heading"><span class="month"></span> <span class="number"></span></div><div class="content"><div class="events"></div></div></div></td>');n.append(l)}i.append(k),f.$monthView=k}var p,q,r,s,t,u,v=k.find(".week-days"),w=k.find(".day"),x=e(h),y=new Date,z=d(x),A=h.getFullYear(),B=h.getMonth(),C=y.getMonth(),D=y.getFullYear(),E=y.getDate(),F=z.clone().addDays(42).addMilliseconds(-1),G=z.clone().addDays(1).addMilliseconds(-1);v.each(function(b){p=a(this),p.find(".day").each(function(c){q=a(this),r=q.closest(".cell-day"),s=G.getFullYear(),t=G.getDate(),u=G.getMonth(),q.attr("data-date",G.toDateString()),q.find(".heading > .number").text(t),q.find(".heading > .month").toggle(0===b&&0===c||1===t).text((0===u&&1===t?g.year.format(s)+" ":"")+g.monthNames[u]),r.toggleClass("current-month",u===B),r.toggleClass("current",t===E&&u===C&&s===D),r.toggleClass("past",y>G),r.toggleClass("future",G>y),q.find(".events").empty(),G.addDays(1)})}),c.withHeader&&(this.$caption.text(g.yearMonth.format(A,B+1)),this.$todayBtn.toggleClass("disabled",B===C));var H,I,J=this.calendars;a.each(this.events,function(b,c){c.start>=z&&c.start<=F&&(q=w.filter('[data-date="'+c.start.toDateString()+'"]'),q.length&&(H=a('<div data-id="'+c.id+'" class="event" title="'+c.desc+'"><span class="time">'+c.start.format("hh:mm")+'</span> <span class="title">'+c.title+"</span></div>"),H.find(".time").toggle(!c.allDay),H.data("event",c),c.calendar&&(I=J[c.calendar],I&&H.data("calendar",I).css("background-color",I.color)),q.find(".events").append(H)))}),c.dragThenDrop&&k.find(".event").droppable({target:w,container:k,flex:!0,start:function(){j.addClass("event-dragging")},drop:function(a){var b=a.element.data("event"),c=a.target.attr("data-date"),d=b.start.clone();if(d.toDateString()!=c&&(c=new Date(c),c.setHours(d.getHours()),c.setMinutes(d.getMinutes()),c.setSeconds(d.getSeconds()),f.callEvent("beforeChange",{event:b,change:"start",to:c}))){var e=b.end.clone();b.end.addMilliseconds(b.end.getTime()-d.getTime()),b.start=c,a.target.find(".events").append(a.element),f.callEvent("change",{data:f.data,changes:[{event:b,changes:[{change:"start",from:d,to:b.start},{change:"end",from:e,to:b.end}]}]})}},finish:function(){j.removeClass("event-dragging")}})},f.prototype.callEvent=function(a,b){var c=this.$.callEvent(a+"."+this.name,b,this);return!(void 0!==c.result&&!c.result)},a.fn.calendar=function(b){return this.each(function(){var d=a(this),e=d.data(c),g="object"==typeof b&&b;e||d.data(c,e=new f(this,g)),"string"==typeof b&&e[b]()})},a.fn.calendar.Constructor=f}(jQuery,window),function(a){function b(b){if("string"==typeof b.data){var c=b.handler,d=b.data.toLowerCase().split(" ");b.handler=function(b){if(this===b.target||!/textarea|select/i.test(b.target.nodeName)&&"text"!==b.target.type){var e="keypress"!==b.type&&a.hotkeys.specialKeys[b.which],f=String.fromCharCode(b.which).toLowerCase(),g="",h={};b.altKey&&"alt"!==e&&(g+="alt+"),b.ctrlKey&&"ctrl"!==e&&(g+="ctrl+"),b.metaKey&&!b.ctrlKey&&"meta"!==e&&(g+="meta+"),b.shiftKey&&"shift"!==e&&(g+="shift+"),e?h[g+e]=!0:(h[g+f]=!0,h[g+a.hotkeys.shiftNums[f]]=!0,"shift+"===g&&(h[a.hotkeys.shiftNums[f]]=!0));for(var i=0,j=d.length;j>i;i++)if(h[d[i]])return c.apply(this,arguments)}}}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})}(jQuery),function(a){"use strict";var b=function(b,c){this.$=a(b),this.options=this.getOptions(c),this.init()};b.DEFAULTS={trigger:"toggle",selector:null,animate:"slide",easing:"linear",animateSpeed:"fast",events:"click",preventDefault:!0,cancelBubble:!0,target:null},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){this.bindEvents()},b.prototype.bindEvents=function(){var b,c=this.options;if(this.bindTrigger(c),a.isArray(c.triggers))for(b in c.triggers)this.bindTrigger(a.extend({},c,c.triggers[b]));else if("string"==typeof c.triggers){var d=c.triggers.split("|");for(b in d){var e=d[b].split(",",4);if(!(e.length<2)){var f={};e[0]&&(f.events=e[0]),e[1]&&(f.trigger=e[1]),e[2]&&(f.target=e[2]),e[3]&&(f.data=e[3]),this.bindTrigger(a.extend({},c,f))}}}},b.prototype.bindTrigger=function(b){var c=this;c.$.on(b.events,b.selector,function(d){var e=b.target&&"self"!=b.target?a(b.target):c.$,f={event:d,element:this,target:e,options:b};if(a.callEvent(b.before,f,c)){if(a.isFunction(b.trigger))a.callEvent(b.trigger,f,c);else{var g=b.trigger;"toggle"===g&&(g=e.hasClass("hide")?"show":"hide");var h;switch(g){case"toggle":e.toggle();break;case"show":h={duration:b.animateSpeed,easing:b.easing},e.removeClass("hide"),"slide"===b.animate?e.slideDown(h):"fade"===b.animate?e.fadeIn(h):e.show(h);
break;case"hide":h={duration:b.animateSpeed,easing:b.easing,complete:function(){e.addClass("hide")}},"slide"===b.animate?e.slideUp(h):"fade"===b.animate?e.fadeOut(h):e.hide(h);break;case"addClass":case"removeClass":case"toggleClass":e[g](b.data)}}a.callEvent(b.after,f,c),b.preventDefault&&d.preventDefault(),b.cancelBubble&&d.stopPropagation()}})},a.fn.autoTrigger=function(c){return this.each(function(){var d=a(this),e=d.data("zui.autoTrigger"),f="object"==typeof c&&c;e||d.data("zui.autoTrigger",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.autoTrigger.Constructor=b,a(function(){a('[data-toggle="autoTrigger"]').autoTrigger(),a('[data-toggle="toggle"]').autoTrigger(),a('[data-toggle="show"]').autoTrigger({trigger:"show"}),a('[data-toggle="hide"]').autoTrigger({trigger:"hide"}),a('[data-toggle="addClass"]').autoTrigger({trigger:"addClass"}),a('[data-toggle="removeClass"]').autoTrigger({trigger:"removeClass"}),a('[data-toggle="toggleClass"]').autoTrigger({trigger:"toggleClass"})})}(jQuery),function(){var a,b,c,d,e,f={}.hasOwnProperty,g=function(a,b){function c(){this.constructor=a}for(var d in b)f.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=function(){function b(){this.options_index=0,this.parsed=[]}return b.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},b.prototype.add_group=function(b){var c,d,e,f,g,h;for(c=this.parsed.length,this.parsed.push({array_index:c,group:!0,label:this.escapeExpression(b.label),children:0,disabled:b.disabled,title:b.title,search_keys:a.trim(b.getAttribute("data-keys")||"").replace(/,/," ")}),g=b.childNodes,h=[],e=0,f=g.length;f>e;e++)d=g[e],h.push(this.add_option(d,c,b.disabled));return h},b.prototype.add_option=function(b,c,d){return"OPTION"===b.nodeName.toUpperCase()?(""!==b.text?(null!=c&&(this.parsed[c].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:b.value,text:b.text,title:b.title,html:b.innerHTML,selected:b.selected,disabled:d===!0?d:b.disabled,group_array_index:c,classes:b.className,style:b.style.cssText,search_keys:a.trim(b.getAttribute("data-keys")||"").replace(/,/," ")})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},b.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},b}(),d.select_to_array=function(a){var b,c,e,f,g;for(c=new d,g=a.childNodes,e=0,f=g.length;f>e;e++)b=g[e],c.add_node(b);return c.parsed},b=function(){function a(b,c){this.form_field=b,this.options=null!=c?c:{},a.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},a.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||a.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||a.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||a.default_no_result_text},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},a.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},a.prototype.result_add_option=function(a){var b,c;return a.search_match&&this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.title=a.title,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b;return(a.search_match||a.group_match)&&a.active_options>0?(b=document.createElement("li"),b.className="group-result",b.title=a.title,b.innerHTML=a.search_text,this.outerHTML(b)):""},a.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},a.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],e.push(a.selected?a.selected=!1:void 0);return e},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.search_contains?"":"^",c=new RegExp(d+a,"i"),j=new RegExp(a,"i"),m=this.results_data,k=0,l=m.length;l>k;k++)b=m[k],b.search_match=!1,f=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(f=this.results_data[b.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.html,b.search_keys_match=this.search_string_match(b.search_keys,c),b.search_text_match=this.search_string_match(b.search_text,c),b.search_match=b.search_text_match||b.search_keys_match,b.search_match&&!b.group&&(e+=1),b.search_match?(b.search_text_match&&b.search_text.length?(h=b.search_text.search(j),i=b.search_text.substr(0,h+g.length)+"</em>"+b.search_text.substr(h+g.length),b.search_text=i.substr(0,h)+"<em>"+i.substr(h)):b.search_keys_match&&b.search_keys.length&&(h=b.search_keys.search(j),i=b.search_keys.substr(0,h+g.length)+"</em>"+b.search_keys.substr(h+g.length),b.search_text+='&nbsp; <small style="opacity: 0.7">'+i.substr(0,h)+"<em>"+i.substr(h)+"</small>"),null!=f&&(f.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>e&&g.length?(this.update_results_content(""),this.no_results(g)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},a.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},a.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&""!=a.value&&(this.selected_option_count+=1);return this.selected_option_count},a.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},a.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},a.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},a.default_multiple_text="",a.default_single_text="",a.default_no_result_text="No results match",a}(),a=jQuery,a.fn.extend({chosen:function(d){return b.browser_is_supported()?this.each(function(){var b,e;b=a(this),e=b.data("chosen"),"destroy"===d&&e?e.destroy():e||b.data("chosen",new c(this,d))}):this}}),c=function(b){function c(){return e=c.__super__.constructor.apply(this,arguments)}return g(c,b),c.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},c.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.container.html(this.is_multiple?'<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>':'<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},c.prototype.register_observers=function(){var a=this;return this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},c.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},c.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},c.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},c.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},c.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},c.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},c.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},c.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},c.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},c.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=d.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},c.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},c.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},c.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},c.prototype.update_results_content=function(a){return this.search_results.html(a)},c.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},c.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},c.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},c.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},c.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},c.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},c.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},c.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+b.html+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},c.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},c.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},c.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},c.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},c.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},c.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(a)},c.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},c.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},c.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html()},c.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},c.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},c.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},c.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},c.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},c.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},c.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},c.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},c.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},c}(b)}.call(this),+function(a){"use strict";var b=function(c,d){this.$=a(c),this.options=this.getOptions(d),this.lang=b.LANGS[this.options.lang],this.id="chosen-icons-"+parseInt(1e10*Math.random()+1),this.init()};b.DEFAULTS={canEmpty:!0,lang:"zh-cn",commonIcons:["heart","user","group","list-ul","th","th-large","star","star-empty","search","envelope","dashboard","sitemap","umbrella","lightbulb","envelope-alt","cog","ok","remove","home","time","flag","flag-alt","flag-checkered","qrcode","tag","tags","book","bookmark","bookmark-empty","print","camera","picture","globe","map-marker","edit","edit-sign","play","stop","plus-sign","minus-sign","remove-sign","ok-sign","check-sign","question-sign","info-sign","exclamation-sign","plus","plus-sign","minus","minus-sign","asterisk","calendar","calendar-empty","comment","comment-alt","comments","comments-alt","folder-close","folder-open","folder-close-alt","folder-open-alt","thumbs-up","thumbs-down","pushpin","building","phone","rss","rss-sign","bullhorn","bell","bell-alt","certificate","wrench","tasks","cloud","beaker","magic","smile","frown","meh","code","location-arrow"],webIcons:["share","pencil","trash","file-alt","file","file-text","download-alt","upload-alt","inbox","repeat","refresh","lock","check","check-empty","eye-open","eye-close","key","signin","signout","external-link","external-link-sign","link","reorder","quote-left","quote-right","spinner","reply","question","info","archive","collapse","collapse-top"],editorIcons:["table","copy","save","list-ol","paste","keyboard","paper-clip","crop","unlink","sort-by-alphabet","sort-by-alphabet-alt","sort-by-attributes","sort-by-attributes-alt","sort-by-order","sort-by-order-alt"],directionalIcons:["chevron-left","chevron-right","chevron-down","chevron-up","arrow-left","arrow-right","arrow-down","arrow-up","hand-right","hand-left","hand-up","hand-down","circle-arrow-left","circle-arrow-right","circle-arrow-up","circle-arrow-down","double-angle-left","double-angle-right","double-angle-down","double-angle-up","angle-left","angle-right","angle-down","angle-up","long-arrow-left","long-arrow-right","long-arrow-down","long-arrow-up","caret-left","caret-right","caret-down","caret-up"],otherIcons:["desktop","laptop","tablet","mobile","building","firefox","ie","opera","qq","lemon","sign-blank","circle","circle-blank","terminal","html5","android","apple","windows","weibo","renren","bug","moon","sun"]},b.LANGS={},b.LANGS["zh-cn"]={emptyIcon:"[没有图标]",commonIcons:"常用图标",webIcons:"Web 图标",editorIcons:"编辑器图标",directionalIcons:"箭头总汇",otherIcons:"其他图标"},b.LANGS.en={emptyIcon:"[No Icon]",commonIcons:"Common Icons",webIcons:"Web Icons",editorIcons:"Editor Icons",directionalIcons:"Directional Icons",otherIcons:"Other Icons"},b.LANGS["zh-tw"]={emptyIcon:"[沒有圖標]",commonIcons:"常用圖標",webIcons:"Web 圖標",editorIcons:"編輯器圖標",directionalIcons:"箭頭總匯",otherIcons:"其他圖標"},b.prototype.getOptions=function(c){return c=a.extend({},b.DEFAULTS,this.$.data(),c)},b.prototype.init=function(){var b=this.$.addClass("chosen-icons").addClass(this.id);b.empty(),this.options.canEmpty&&b.append(this.getOptionHtml());var c=this.lang;b.append(this.getgroupHtml("commonIcons")),b.append(this.getgroupHtml("webIcons")),b.append(this.getgroupHtml("editorIcons")),b.append(this.getgroupHtml("directionalIcons")),b.append(this.getgroupHtml("otherIcons")),b.chosen({placeholder_text:" ",disable_search:!0,width:"100%",inherit_select_classes:!0});var d=".chosen-container."+this.id;b.on("chosen:showing_dropdown",function(){a(d+" .chosen-results .group-option").each(function(){var b=a(this).addClass("icon"),c=a(this).text();b.html('<i class="icon-'+c+'" title="'+c+'"></i>')})}).change(function(){var b=a(d+" .chosen-single > span"),e=a(this).val();b.html(e&&e.length>0?'<i class="'+e+'"></i> &nbsp; <span class="text-muted">'+e.substr(5).replace(/-/g," ")+"</span>":'<span class="text-muted">'+c.emptyIcon+"</span>")});var e=b.data("value");e&&b.val(e).change()},b.prototype.getgroupHtml=function(a){var b=this.options[a],c='<optgroup label="'+this.lang[a]+'">';for(var d in b)c+=this.getOptionHtml(b[d]);return c+"</optgroup>"},b.prototype.getOptionHtml=function(a){return name=a,a&&a.length>0?a="icon-"+a:(a="",name=this.lang.emptyIcon),'<option value="'+a+'">'+name+"</option>"},a.fn.chosenIcons=function(c){return this.each(function(){var d=a(this),e=d.data("zui.chosenIcons"),f="object"==typeof c&&c;
e||d.data("zui.chosenIcons",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.chosenIcons.Constructor=b}(jQuery);